-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcytoscape.min.js
24 lines (24 loc) · 247 KB
/
cytoscape.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*!
* This file is part of Cytoscape.js 2.3.3.
*
* Cytoscape.js is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* Cytoscape.js 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 Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* Cytoscape.js. If not, see <http://www.gnu.org/licenses/>.
*/
var cytoscape;!function(e){"use strict";var t=cytoscape=function(){return cytoscape.init.apply(cytoscape,arguments)};t.version="2.3.3",t.init=function(e){return void 0===e&&(e={}),t.is.plainObject(e)?new t.Core(e):t.is.string(e)?t.extension.apply(t.extension,arguments):void 0},t.fn={},"undefined"!=typeof module&&module.exports&&(module.exports=cytoscape),"undefined"!=typeof define&&define.amd&&define("cytoscape",function(){return cytoscape}),e&&(e.cytoscape=cytoscape)}("undefined"==typeof window?null:window),function(e,t){"use strict";e.is={defined:function(e){return null!=e},string:function(e){return null!=e&&"string"==typeof e},fn:function(e){return null!=e&&"function"==typeof e},array:function(e){return Array.isArray?Array.isArray(e):null!=e&&e instanceof Array},plainObject:function(t){return null!=t&&typeof t==typeof{}&&!e.is.array(t)&&t.constructor===Object},number:function(e){return null!=e&&"number"==typeof e&&!isNaN(e)},integer:function(t){return e.is.number(t)&&Math.floor(t)===t},color:function(e){return null!=e&&"string"==typeof e&&""!==$.Color(e).toString()},bool:function(e){return null!=e&&typeof e==typeof!0},elementOrCollection:function(t){return e.is.element(t)||e.is.collection(t)},element:function(t){return t instanceof e.Element&&t._private.single},collection:function(t){return t instanceof e.Collection&&!t._private.single},core:function(t){return t instanceof e.Core},style:function(t){return t instanceof e.Style},stylesheet:function(t){return t instanceof e.Stylesheet},event:function(t){return t instanceof e.Event},emptyString:function(t){return t?e.is.string(t)&&(""===t||t.match(/^\s+$/))?!0:!1:!0},nonemptyString:function(t){return t&&e.is.string(t)&&""!==t&&!t.match(/^\s+$/)?!0:!1},domElement:function(e){return"undefined"==typeof HTMLElement?!1:e instanceof HTMLElement},touch:function(){return t&&("ontouchstart"in t||t.DocumentTouch&&document instanceof DocumentTouch)},boundingBox:function(t){return e.is.plainObject(t)&&e.is.number(t.x1)&&e.is.number(t.x2)&&e.is.number(t.y1)&&e.is.number(t.y2)}}}(cytoscape,"undefined"==typeof window?null:window),function(e,t){"use strict";e.util={extend:function(){var t,i,r,n,a,o,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"==typeof s||e.is.fn(s)||(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(t=arguments[l]))for(i in t)r=s[i],n=t[i],s!==n&&(c&&n&&(e.is.plainObject(n)||(a=e.is.array(n)))?(a?(a=!1,o=r&&e.is.array(r)?r:[]):o=r&&e.is.plainObject(r)?r:{},s[i]=e.util.extend(c,o,n)):void 0!==n&&(s[i]=n));return s},require:function(i,r,n){var a;n=e.util.extend({msgIfNotFound:!0},n);var o=!1,s=function(e){o=!0,r(e)},l=function(e){t&&(a=t[i]),void 0!==a&&s(a),e&&e()},u=function(){o||c(d)},c=function(e){"undefined"!=typeof module&&module.exports&&require&&(a=require(i)),void 0!==a&&s(a),e&&e()},d=function(){o||p(h)},p=function(e){"undefined"!=typeof define&&define.amd&&require&&require([i],function(t){a=t,void 0!==a&&s(a),e&&e()})},h=function(){!o&&n.msgIfNotFound&&e.util.error("Cytoscape.js tried to pull in dependency `"+i+"` but no module (i.e. CommonJS, AMD, or window) was found")};l(u)},requires:function(t,i){for(var r=[],n=[],a=function(){for(var e=0;e<t.length;e++)if(!n[e])return;i.apply(i,r)},o=0;o<t.length;o++)!function(){var i=t[o],s=o;e.util.require(i,function(e){r[s]=e,n[s]=!0,a()})}()},throttle:function(t,i,r){var n=!0,a=!0;return r===!1?n=!1:e.is.plainObject(r)&&(n="leading"in r?r.leading:n,a="trailing"in r?r.trailing:a),r=r||{},r.leading=n,r.maxWait=i,r.trailing=a,e.util.debounce(t,i,r)},now:function(){return+new Date},debounce:function(t,i,r){var n,a,o,s,l,u,c,d=0,p=!1,h=!0;if(e.is.fn(t)){if(i=Math.max(0,i)||0,r===!0){var v=!0;h=!1}else e.is.plainObject(r)&&(v=r.leading,p="maxWait"in r&&(Math.max(i,r.maxWait)||0),h="trailing"in r?r.trailing:h);var f=function(){var r=i-(e.util.now()-s);if(0>=r){a&&clearTimeout(a);var p=c;a=u=c=void 0,p&&(d=e.util.now(),o=t.apply(l,n),u||a||(n=l=null))}else u=setTimeout(f,r)},g=function(){u&&clearTimeout(u),a=u=c=void 0,(h||p!==i)&&(d=e.util.now(),o=t.apply(l,n),u||a||(n=l=null))};return function(){if(n=arguments,s=e.util.now(),l=this,c=h&&(u||!v),p===!1)var r=v&&!u;else{a||v||(d=s);var y=p-(s-d),m=0>=y;m?(a&&(a=clearTimeout(a)),d=s,o=t.apply(l,n)):a||(a=setTimeout(g,y))}return m&&u?u=clearTimeout(u):u||i===p||(u=setTimeout(f,i)),r&&(m=!0,o=t.apply(l,n)),!m||u||a||(n=l=null),o}}},error:function(e){if(!console)throw e;if(console.error)console.error.apply(console,arguments);else{if(!console.log)throw e;console.log.apply(console,arguments)}},clone:function(e){var t={};for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t},copy:function(t){return null==t?t:e.is.array(t)?t.slice():e.is.plainObject(t)?e.util.clone(t):t},makeBoundingBox:function(e){if(null!=e.x1&&null!=e.y1){if(null!=e.x2&&null!=e.y2&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(null!=e.w&&null!=e.h&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},mapEmpty:function(e){var t=!0;if(null!=e)for(var i in e){t=!1;break}return t},pushMap:function(t){var i=e.util.getMap(t);null==i?e.util.setMap($.extend({},t,{value:[t.value]})):i.push(t.value)},setMap:function(t){for(var i,r=t.map,n=t.keys,a=n.length,o=0;a>o;o++){var i=n[o];e.is.plainObject(i)&&e.util.error("Tried to set map with object key"),o<n.length-1?(null==r[i]&&(r[i]={}),r=r[i]):r[i]=t.value}},getMap:function(t){for(var i=t.map,r=t.keys,n=r.length,a=0;n>a;a++){var o=r[a];if(e.is.plainObject(o)&&e.util.error("Tried to get map with object key"),i=i[o],null==i)return i}return i},deleteMap:function(t){for(var i=t.map,r=t.keys,n=r.length,a=t.keepChildren,o=0;n>o;o++){var s=r[o];e.is.plainObject(s)&&e.util.error("Tried to delete map with object key");var l=o===t.keys.length-1;if(l)if(a)for(var u in i)a[u]||(i[u]=void 0);else i[s]=void 0;else i=i[s]}},capitalize:function(t){return e.is.emptyString(t)?t:t.charAt(0).toUpperCase()+t.substring(1)},camel2dash:function(e){for(var t=[],i=0;i<e.length;i++){var r=e[i],n=r.toLowerCase(),a=r!==n;a?(t.push("-"),t.push(n)):t.push(r)}var o=t.length===e.length;return o?e:t.join("")},dash2camel:function(e){for(var t=[],i=!1,r=0;r<e.length;r++){var n=e[r],a="-"===n;a?i=!0:(t.push(i?n.toUpperCase():n),i=!1)}return t.join("")},trim:function(e){var t,i;for(t=0;t<e.length&&" "===e[t];t++);for(i=e.length-1;i>t&&" "===e[i];i--);return e.substring(t,i+1)},hex2tuple:function(e){if((4===e.length||7===e.length)&&"#"===e[0]){var t,i,r,n=4===e.length,a=16;return n?(t=parseInt(e[1]+e[1],a),i=parseInt(e[2]+e[2],a),r=parseInt(e[3]+e[3],a)):(t=parseInt(e[1]+e[2],a),i=parseInt(e[3]+e[4],a),r=parseInt(e[5]+e[6],a)),[t,i,r]}},hsl2tuple:function(t){function i(e,t,i){return 0>i&&(i+=1),i>1&&(i-=1),1/6>i?e+6*(t-e)*i:.5>i?t:2/3>i?e+(t-e)*(2/3-i)*6:e}var r,n,a,o,s,l,u,c,d=new RegExp("^"+e.util.regex.hsla+"$").exec(t);if(d){if(n=parseInt(d[1]),0>n?n=(360- -1*n%360)%360:n>360&&(n%=360),n/=360,a=parseFloat(d[2]),0>a||a>100)return;if(a/=100,o=parseFloat(d[3]),0>o||o>100)return;if(o/=100,s=d[4],void 0!==s&&(s=parseFloat(s),0>s||s>1))return;if(0===a)l=u=c=Math.round(255*o);else{var p=.5>o?o*(1+a):o+a-o*a,h=2*o-p;l=Math.round(255*i(h,p,n+1/3)),u=Math.round(255*i(h,p,n)),c=Math.round(255*i(h,p,n-1/3))}r=[l,u,c,s]}return r},rgb2tuple:function(t){var i,r=new RegExp("^"+e.util.regex.rgba+"$").exec(t);if(r){i=[];for(var n=[],a=1;3>=a;a++){var o=r[a];if("%"===o[o.length-1]&&(n[a]=!0),o=parseFloat(o),n[a]&&(o=o/100*255),0>o||o>255)return;i.push(Math.floor(o))}var s=n[1]||n[2]||n[3],l=n[1]&&n[2]&&n[3];if(s&&!l)return;var u=r[4];if(void 0!==u){if(u=parseFloat(u),0>u||u>1)return;i.push(u)}}return i},colorname2tuple:function(t){return e.util.colors[t.toLowerCase()]},color2tuple:function(t){return(e.is.array(t)?t:null)||e.util.colorname2tuple(t)||e.util.hex2tuple(t)||e.util.rgb2tuple(t)||e.util.hsl2tuple(t)},tuple2hex:function(e){function t(e){var t=e.toString(16);return 1===t.length&&(t="0"+t),t}var i=e[0],r=e[1],n=e[2];return"#"+t(i)+t(r)+t(n)},colors:{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]}},e.util.regex={},e.util.regex.number="(?:[-]?\\d*\\.\\d+|[-]?\\d+|[-]?\\d*\\.\\d+[eE]\\d+)",e.util.regex.rgba="rgb[a]?\\(("+e.util.regex.number+"[%]?)\\s*,\\s*("+e.util.regex.number+"[%]?)\\s*,\\s*("+e.util.regex.number+"[%]?)(?:\\s*,\\s*("+e.util.regex.number+"))?\\)",e.util.regex.rgbaNoBackRefs="rgb[a]?\\((?:"+e.util.regex.number+"[%]?)\\s*,\\s*(?:"+e.util.regex.number+"[%]?)\\s*,\\s*(?:"+e.util.regex.number+"[%]?)(?:\\s*,\\s*(?:"+e.util.regex.number+"))?\\)",e.util.regex.hsla="hsl[a]?\\(("+e.util.regex.number+")\\s*,\\s*("+e.util.regex.number+"[%])\\s*,\\s*("+e.util.regex.number+"[%])(?:\\s*,\\s*("+e.util.regex.number+"))?\\)",e.util.regex.hslaNoBackRefs="hsl[a]?\\((?:"+e.util.regex.number+")\\s*,\\s*(?:"+e.util.regex.number+"[%])\\s*,\\s*(?:"+e.util.regex.number+"[%])(?:\\s*,\\s*(?:"+e.util.regex.number+"))?\\)",e.util.regex.hex3="\\#[0-9a-fA-F]{3}",e.util.regex.hex6="\\#[0-9a-fA-F]{6}";var i=t?t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame:null;i=i||function(e){e&&setTimeout(e,1e3/60)},e.util.requestAnimationFrame=function(e){i(e)}}(cytoscape,"undefined"==typeof window?null:window),function(e){"use strict";e.math={},e.math.signum=function(e){return e>0?1:0>e?-1:0},e.math.distance=function(e,t){var i=t.x-e.x,r=t.y-e.y;return Math.sqrt(i*i+r*r)},e.math.qbezierAt=function(e,t,i,r){return(1-r)*(1-r)*e+2*(1-r)*r*t+r*r*i},e.math.qbezierPtAt=function(t,i,r,n){return{x:e.math.qbezierAt(t.x,i.x,r.x,n),y:e.math.qbezierAt(t.y,i.y,r.y,n)}},e.math.boundingBoxesIntersect=function(e,t){return e.x1>t.x2?!1:t.x1>e.x2?!1:e.x2<t.x1?!1:t.x2<e.x1?!1:e.y2<t.y1?!1:t.y2<e.y1?!1:e.y1>t.y2?!1:t.y1>e.y2?!1:!0},e.math.inBoundingBox=function(e,t,i){return e.x1<=t&&t<=e.x2&&e.y1<=i&&i<=e.y2},e.math.pointInBoundingBox=function(e,t){return this.inBoundingBox(e,t.x,t.y)},e.math.roundRectangleIntersectLine=function(e,t,i,r,n,a,o){var s,l=this.getRoundRectangleRadius(n,a),u=n/2,c=a/2,d=i-u+l-o,p=r-c-o,h=i+u-l+o,v=p;if(s=this.finiteLinesIntersect(e,t,i,r,d,p,h,v,!1),s.length>0)return s;var f=i+u+o,g=r-c+l-o,y=f,m=r+c-l+o;if(s=this.finiteLinesIntersect(e,t,i,r,f,g,y,m,!1),s.length>0)return s;var x=i-u+l-o,b=r+c+o,w=i+u-l+o,_=b;if(s=this.finiteLinesIntersect(e,t,i,r,x,b,w,_,!1),s.length>0)return s;var E=i-u-o,S=r-c+l-o,P=E,k=r+c-l+o;if(s=this.finiteLinesIntersect(e,t,i,r,E,S,P,k,!1),s.length>0)return s;var C,D=i-u+l,N=r-c+l;if(C=this.intersectLineCircle(e,t,i,r,D,N,l+o),C.length>0&&C[0]<=D&&C[1]<=N)return[C[0],C[1]];var T=i+u-l,M=r-c+l;if(C=this.intersectLineCircle(e,t,i,r,T,M,l+o),C.length>0&&C[0]>=T&&C[1]<=M)return[C[0],C[1]];var B=i+u-l,I=r+c-l;if(C=this.intersectLineCircle(e,t,i,r,B,I,l+o),C.length>0&&C[0]>=B&&C[1]>=I)return[C[0],C[1]];var z=i-u+l,L=r+c-l;return C=this.intersectLineCircle(e,t,i,r,z,L,l+o),C.length>0&&C[0]<=z&&C[1]>=L?[C[0],C[1]]:[]},e.math.roundRectangleIntersectBox=function(e,t,i,r,n,a,o,s,l){var u=this.getRoundRectangleRadius(n,a),c=o-n/2-l,d=s-a/2+u-l,p=o+n/2+l,h=s+a/2-u+l,v=o-n/2+u-l,f=s-a/2-l,g=o+n/2-u+l,y=s+a/2+l,m=Math.min(e,i),x=Math.max(e,i),b=Math.min(t,r),w=Math.max(t,r);return c>x?!1:m>p?!1:f>w?!1:b>y?!1:c>=m&&x>=c&&d>=b&&w>=d?!0:p>=m&&x>=p&&d>=b&&w>=d?!0:p>=m&&x>=p&&h>=b&&w>=h?!0:c>=m&&x>=c&&h>=b&&w>=h?!0:m>=c&&p>=m&&b>=d&&h>=b?!0:x>=c&&p>=x&&b>=d&&h>=b?!0:x>=c&&p>=x&&w>=d&&h>=w?!0:m>=c&&p>=m&&w>=d&&h>=w?!0:v>=m&&x>=v&&f>=b&&w>=f?!0:g>=m&&x>=g&&f>=b&&w>=f?!0:g>=m&&x>=g&&y>=b&&w>=y?!0:v>=m&&x>=v&&y>=b&&w>=y?!0:m>=v&&g>=m&&b>=f&&y>=b?!0:x>=v&&g>=x&&b>=f&&y>=b?!0:x>=v&&g>=x&&w>=f&&y>=w?!0:m>=v&&g>=m&&w>=f&&y>=w?!0:this.boxIntersectEllipse(m,b,x,w,l,2*u,2*u,v+l,d+l)?!0:this.boxIntersectEllipse(m,b,x,w,l,2*u,2*u,g-l,d+l)?!0:this.boxIntersectEllipse(m,b,x,w,l,2*u,2*u,g-l,h-l)?!0:this.boxIntersectEllipse(m,b,x,w,l,2*u,2*u,v+l,h-l)?!0:!1},e.math.checkInBoundingCircle=function(e,t,i,r,n,a,o,s){return e=(e-o)/(n+r),t=(t-s)/(a+r),i>=e*e+t*t},e.math.boxInBezierVicinity=function(e,t,i,r,n,a,o,s,l,u,c){var d=.25*n+.5*o+.25*l,p=.25*a+.5*s+.25*u,h=Math.min(e,i)-c,v=Math.min(t,r)-c,f=Math.max(e,i)+c,g=Math.max(t,r)+c;if(n>=h&&f>=n&&a>=v&&g>=a)return 1;if(l>=h&&f>=l&&u>=v&&g>=u)return 1;if(d>=h&&f>=d&&p>=v&&g>=p)return 1;if(o>=h&&f>=o&&s>=v&&g>=s)return 1;var y=Math.min(n,d,l),m=Math.min(a,p,u),x=Math.max(n,d,l),b=Math.max(a,p,u);return y>f||h>x||m>g||v>b?0:1},e.math.checkBezierInBox=function(t,i,r,n,a,o,s,l,u,c){function d(d){var p=e.math.qbezierAt(a,s,u,d),h=e.math.qbezierAt(o,l,c,d);return p>=t&&r>=p&&h>=i&&n>=h}for(var p=0;1>=p;p+=.25)if(!d(p))return!1;return!0},e.math.checkStraightEdgeInBox=function(e,t,i,r,n,a,o,s){return n>=e&&i>=n&&o>=e&&i>=o&&a>=t&&r>=a&&s>=t&&r>=s},e.math.checkStraightEdgeCrossesBox=function(e,t,i,r,n,a,o,s,l){var u,c,d=Math.min(e,i)-l,p=Math.min(t,r)-l,h=Math.max(e,i)+l,v=Math.max(t,r)+l,f=o-n,g=n,y=s-a,m=a;if(Math.abs(f)<1e-4)return n>=d&&h>=n&&Math.min(a,s)<=p&&Math.max(a,s)>=v;var x=(d-g)/f;if(x>0&&1>=x&&(u=y*x+m,u>=p&&v>=u))return!0;var b=(h-g)/f;if(b>0&&1>=b&&(u=y*b+m,u>=p&&v>=u))return!0;var w=(p-m)/y;if(w>0&&1>=w&&(c=f*w+g,c>=d&&h>=c))return!0;var _=(v-m)/y;return _>0&&1>=_&&(c=f*_+g,c>=d&&h>=c)?!0:!1},e.math.checkBezierCrossesBox=function(e,t,i,r,n,a,o,s,l,u,c){var d=Math.min(e,i)-c,p=Math.min(t,r)-c,h=Math.max(e,i)+c,v=Math.max(t,r)+c;if(n>=d&&h>=n&&a>=p&&v>=a)return!0;if(l>=d&&h>=l&&u>=p&&v>=u)return!0;var f=n-2*o+l,g=-2*n+2*o,y=n,m=[];if(Math.abs(f)<1e-4){var x=(d-n)/g,b=(h-n)/g;m.push(x,b)}else{var w,_,E=g*g-4*f*(y-d);if(E>0){var S=Math.sqrt(E);w=(-g+S)/(2*f),_=(-g-S)/(2*f),m.push(w,_)}var P,k,C=g*g-4*f*(y-h);if(C>0){var S=Math.sqrt(C);P=(-g+S)/(2*f),k=(-g-S)/(2*f),m.push(P,k)}}m.sort(function(e,t){return e-t});var D=a-2*s+u,N=-2*a+2*s,T=a,M=[];if(Math.abs(D)<1e-4){var B=(p-a)/N,I=(v-a)/N;M.push(B,I)}else{var z,L,O=N*N-4*D*(T-p);if(O>0){var S=Math.sqrt(O);z=(-N+S)/(2*D),L=(-N-S)/(2*D),M.push(z,L)}var R,X,V=N*N-4*D*(T-v);if(V>0){var S=Math.sqrt(V);R=(-N+S)/(2*D),X=(-N-S)/(2*D),M.push(R,X)}}M.sort(function(e,t){return e-t});for(var Y=0;Y<m.length;Y+=2)for(var A=1;A<M.length;A+=2)if(m[Y]<M[A]&&M[A]>=0&&m[Y]<=1&&m[Y+1]>M[A-1]&&M[A-1]<=1&&m[Y+1]>=0)return!0;return!1},e.math.inLineVicinity=function(e,t,i,r,n,a,o){var s=o,l=Math.min(i,n),u=Math.max(i,n),c=Math.min(r,a),d=Math.max(r,a);return e>=l-s&&u+s>=e&&t>=c-s&&d+s>=t},e.math.inBezierVicinity=function(e,t,i,r,n,a,o,s){var l={x1:Math.min(i,o,n),x2:Math.max(i,o,n),y1:Math.min(r,s,a),y2:Math.max(r,s,a)};return e<l.x1||e>l.x2||t<l.y1||t>l.y2?!1:!0},e.math.solveCubic=function(e,t,i,r,n){t/=e,i/=e,r/=e;var a,o,s,l,u,c,d,p;return o=(3*i-t*t)/9,s=-(27*r)+t*(9*i-2*t*t),s/=54,a=o*o*o+s*s,n[1]=0,d=t/3,a>0?(u=s+Math.sqrt(a),u=0>u?-Math.pow(-u,1/3):Math.pow(u,1/3),c=s-Math.sqrt(a),c=0>c?-Math.pow(-c,1/3):Math.pow(c,1/3),n[0]=-d+u+c,d+=(u+c)/2,n[4]=n[2]=-d,d=Math.sqrt(3)*(-c+u)/2,n[3]=d,void(n[5]=-d)):(n[5]=n[3]=0,0===a?(p=0>s?-Math.pow(-s,1/3):Math.pow(s,1/3),n[0]=-d+2*p,void(n[4]=n[2]=-(p+d))):(o=-o,l=o*o*o,l=Math.acos(s/Math.sqrt(l)),p=2*Math.sqrt(o),n[0]=-d+p*Math.cos(l/3),n[2]=-d+p*Math.cos((l+2*Math.PI)/3),void(n[4]=-d+p*Math.cos((l+4*Math.PI)/3))))},e.math.sqDistanceToQuadraticBezier=function(e,t,i,r,n,a,o,s){var l=1*i*i-4*i*n+2*i*o+4*n*n-4*n*o+o*o+r*r-4*r*a+2*r*s+4*a*a-4*a*s+s*s,u=9*i*n-3*i*i-3*i*o-6*n*n+3*n*o+9*r*a-3*r*r-3*r*s-6*a*a+3*a*s,c=3*i*i-6*i*n+i*o-i*e+2*n*n+2*n*e-o*e+3*r*r-6*r*a+r*s-r*t+2*a*a+2*a*t-s*t,d=1*i*n-i*i+i*e-n*e+r*a-r*r+r*t-a*t,p=[];this.solveCubic(l,u,c,d,p);for(var h=1e-7,v=[],f=0;6>f;f+=2)Math.abs(p[f+1])<h&&p[f]>=0&&p[f]<=1&&v.push(p[f]);v.push(1),v.push(0);for(var g,y,m,x,b=-1,w=0;w<v.length;w++)y=Math.pow(1-v[w],2)*i+2*(1-v[w])*v[w]*n+v[w]*v[w]*o,m=Math.pow(1-v[w],2)*r+2*(1-v[w])*v[w]*a+v[w]*v[w]*s,x=Math.pow(y-e,2)+Math.pow(m-t,2),b>=0?b>x&&(b=x,g=v[w]):(b=x,g=v[w]);return b},e.math.sqDistanceToFiniteLine=function(e,t,i,r,n,a){var o=[e-i,t-r],s=[n-i,a-r],l=s[0]*s[0]+s[1]*s[1],u=o[0]*o[0]+o[1]*o[1],c=o[0]*s[0]+o[1]*s[1],d=c*c/l;return 0>c?u:d>l?(e-n)*(e-n)+(t-a)*(t-a):u-d},e.math.pointInsidePolygon=function(e,t,i,r,n,a,o,s,l){var u=new Array(i.length),c=Math.asin(s[1]/Math.sqrt(s[0]*s[0]+s[1]*s[1]));s[0]<0?c+=Math.PI/2:c=-c-Math.PI/2;for(var d=Math.cos(-c),p=Math.sin(-c),h=0;h<u.length/2;h++)u[2*h]=a/2*(i[2*h]*d-i[2*h+1]*p),u[2*h+1]=o/2*(i[2*h+1]*d+i[2*h]*p),u[2*h]+=r,u[2*h+1]+=n;var v;if(l>0){var f=this.expandPolygon(u,-l);v=this.joinLines(f)}else v=u;for(var g,y,m,x,b,w=0,_=0,h=0;h<v.length/2;h++)if(g=v[2*h],y=v[2*h+1],h+1<v.length/2?(m=v[2*(h+1)],x=v[2*(h+1)+1]):(m=v[2*(h+1-v.length/2)],x=v[2*(h+1-v.length/2)+1]),g==e&&m==e);else{if(!(g>=e&&e>=m||e>=g&&m>=e))continue;b=(e-g)/(m-g)*(x-y)+y,b>t&&w++,t>b&&_++}return w%2===0?!1:!0},e.math.joinLines=function(e){for(var t,i,r,n,a,o,s,l,u=new Array(e.length/2),c=0;c<e.length/4;c++){t=e[4*c],i=e[4*c+1],r=e[4*c+2],n=e[4*c+3],c<e.length/4-1?(a=e[4*(c+1)],o=e[4*(c+1)+1],s=e[4*(c+1)+2],l=e[4*(c+1)+3]):(a=e[0],o=e[1],s=e[2],l=e[3]);var d=this.finiteLinesIntersect(t,i,r,n,a,o,s,l,!0);u[2*c]=d[0],u[2*c+1]=d[1]}return u},e.math.expandPolygon=function(e,t){for(var i,r,n,a,o=new Array(2*e.length),s=0;s<e.length/2;s++){i=e[2*s],r=e[2*s+1],s<e.length/2-1?(n=e[2*(s+1)],a=e[2*(s+1)+1]):(n=e[0],a=e[1]);var l=a-r,u=-(n-i),c=Math.sqrt(l*l+u*u),d=l/c,p=u/c;o[4*s]=i+d*t,o[4*s+1]=r+p*t,o[4*s+2]=n+d*t,o[4*s+3]=a+p*t}return o},e.math.intersectLineEllipse=function(e,t,i,r,n,a){var o=i-e,s=r-t;o/=n,s/=a;var l=Math.sqrt(o*o+s*s),u=l-1;if(0>u)return[];var c=u/l;return[(i-e)*c+e,(r-t)*c+t]},e.math.dotProduct=function(e,t){if(2!=e.length||2!=t.length)throw"dot product: arguments are not vectors";return e[0]*t[0]+e[1]*t[1]},e.math.intersectLineCircle=function(e,t,i,r,n,a,o){var s=[i-e,r-t],l=[n,a],u=[e-n,t-a],c=s[0]*s[0]+s[1]*s[1],d=2*(u[0]*s[0]+u[1]*s[1]),l=u[0]*u[0]+u[1]*u[1]-o*o,p=d*d-4*c*l;if(0>p)return[];var h=(-d+Math.sqrt(p))/(2*c),v=(-d-Math.sqrt(p))/(2*c),f=Math.min(h,v),g=Math.max(h,v),y=[];if(f>=0&&1>=f&&y.push(f),g>=0&&1>=g&&y.push(g),0===y.length)return[];var m=y[0]*s[0]+e,x=y[0]*s[1]+t;if(y.length>1){if(y[0]==y[1])return[m,x];var b=y[1]*s[0]+e,w=y[1]*s[1]+t;return[m,x,b,w]}return[m,x]},e.math.findCircleNearPoint=function(e,t,i,r,n){var a=r-e,o=n-t,s=Math.sqrt(a*a+o*o),l=a/s,u=o/s;return[e+l*i,t+u*i]},e.math.findMaxSqDistanceToOrigin=function(e){for(var t,i=1e-6,r=0;r<e.length/2;r++)t=e[2*r]*e[2*r]+e[2*r+1]*e[2*r+1],t>i&&(i=t);return i},e.math.finiteLinesIntersect=function(e,t,i,r,n,a,o,s,l){var u=(o-n)*(t-a)-(s-a)*(e-n),c=(i-e)*(t-a)-(r-t)*(e-n),d=(s-a)*(i-e)-(o-n)*(r-t);if(0!==d){var p=u/d,h=c/d;return p>=0&&1>=p&&h>=0&&1>=h?[e+p*(i-e),t+p*(r-t)]:l?[e+p*(i-e),t+p*(r-t)]:[]}return 0===u||0===c?[e,i,o].sort()[1]===o?[o,s]:[e,i,n].sort()[1]===n?[n,a]:[n,o,i].sort()[1]===i?[i,r]:[]:[]},e.math.boxIntersectEllipse=function(e,t,i,r,n,a,o,s,l){if(e>i){var u=e;e=i,i=u}if(t>r){var c=t;t=r,r=c}var d=[s-a/2-n,l],p=[s+a/2+n,l],h=[s,l-o/2-n],v=[s,l+o/2+n];return i<d[0]?!1:e>p[0]?!1:t>v[1]?!1:r<h[1]?!1:e<=p[0]&&p[0]<=i&&t<=p[1]&&p[1]<=r?!0:e<=d[0]&&d[0]<=i&&t<=d[1]&&d[1]<=r?!0:e<=h[0]&&h[0]<=i&&t<=h[1]&&h[1]<=r?!0:e<=v[0]&&v[0]<=i&&t<=v[1]&&v[1]<=r?!0:(e=(e-s)/(a/2+n),i=(i-s)/(a/2+n),t=(t-l)/(o/2+n),r=(r-l)/(o/2+n),1>=e*e+t*t?!0:1>=i*i+t*t?!0:1>=i*i+r*r?!0:1>=e*e+r*r?!0:!1)},e.math.boxIntersectPolygon=function(t,i,r,n,a,o,s,l,u,c,d){if(t>r){var p=t;t=r,r=p}if(i>n){var h=i;i=n,n=h}var v=new Array(a.length),f=Math.asin(c[1]/Math.sqrt(c[0]*c[0]+c[1]*c[1]));c[0]<0?f+=Math.PI/2:f=-f-Math.PI/2;for(var g=Math.cos(-f),y=Math.sin(-f),m=0;m<v.length/2;m++)v[2*m]=o/2*(a[2*m]*g-a[2*m+1]*y),v[2*m+1]=s/2*(a[2*m+1]*g+a[2*m]*y),v[2*m]+=l,v[2*m+1]+=u;for(var x=v[0],b=v[0],w=v[1],_=v[1],m=1;m<v.length/2;m++)v[2*m]>b&&(b=v[2*m]),v[2*m]<x&&(x=v[2*m]),v[2*m+1]>_&&(_=v[2*m+1]),v[2*m+1]<w&&(w=v[2*m+1]);if(x-d>r)return!1;if(t>b+d)return!1;if(w-d>n)return!1;if(i>_+d)return!1;var E;if(d>0){var S=e.math.expandPolygon(v,-d);E=e.math.joinLines(S)}else E=v;for(var m=0;m<v.length/2;m++)if(t<=v[2*m]&&v[2*m]<=r&&i<=v[2*m+1]&&v[2*m+1]<=n)return!0;for(var m=0;m<E.length/2;m++){var P,k,C=E[2*m],D=E[2*m+1];if(m<E.length/2-1?(P=E[2*(m+1)],k=E[2*(m+1)+1]):(P=E[0],k=E[1]),e.math.finiteLinesIntersect(C,D,P,k,t,i,r,i,!1).length>0)return!0;if(e.math.finiteLinesIntersect(C,D,P,k,t,n,r,n,!1).length>0)return!0;if(e.math.finiteLinesIntersect(C,D,P,k,t,i,t,n,!1).length>0)return!0;if(e.math.finiteLinesIntersect(C,D,P,k,r,i,r,n,!1).length>0)return!0}return!1},e.math.polygonIntersectLine=function(t,i,r,n,a,o,s,l){for(var u,c=[],d=new Array(r.length),p=0;p<d.length/2;p++)d[2*p]=r[2*p]*o+n,d[2*p+1]=r[2*p+1]*s+a;var h;if(l>0){var v=e.math.expandPolygon(d,-l);h=e.math.joinLines(v)}else h=d;for(var f,g,y,m,p=0;p<h.length/2;p++)f=h[2*p],g=h[2*p+1],p<h.length/2-1?(y=h[2*(p+1)],m=h[2*(p+1)+1]):(y=h[0],m=h[1]),u=this.finiteLinesIntersect(t,i,n,a,f,g,y,m),0!==u.length&&c.push(u[0],u[1]);return c},e.math.shortenIntersection=function(e,t,i){var r=[e[0]-t[0],e[1]-t[1]],n=Math.sqrt(r[0]*r[0]+r[1]*r[1]),a=(n-i)/n;return 0>a&&(a=1e-5),[t[0]+a*r[0],t[1]+a*r[1]]},e.math.generateUnitNgonPointsFitToSquare=function(t,i){var r=e.math.generateUnitNgonPoints(t,i);return r=e.math.fitPolygonToSquare(r)},e.math.fitPolygonToSquare=function(e){for(var t,i,r=e.length/2,n=1/0,a=1/0,o=-1/0,s=-1/0,l=0;r>l;l++)t=e[2*l],i=e[2*l+1],n=Math.min(n,t),o=Math.max(o,t),a=Math.min(a,i),s=Math.max(s,i);for(var u=2/(o-n),c=2/(s-a),l=0;r>l;l++)t=e[2*l]=e[2*l]*u,i=e[2*l+1]=e[2*l+1]*c,n=Math.min(n,t),o=Math.max(o,t),a=Math.min(a,i),s=Math.max(s,i);if(-1>a)for(var l=0;r>l;l++)i=e[2*l+1]=e[2*l+1]+(-1-a);return e},e.math.generateUnitNgonPoints=function(e,t){var i=1/e*2*Math.PI,r=e%2===0?Math.PI/2+i/2:Math.PI/2;r+=t;for(var n,a,o,s=new Array(2*e),l=0;e>l;l++)n=l*i+r,a=s[2*l]=Math.cos(n),o=s[2*l+1]=Math.sin(-n);return s},e.math.getRoundRectangleRadius=function(e,t){return Math.min(e/4,t/4,8)}}(cytoscape),function(e){"use strict";function t(t,i,r){var n={};switch(n[i]=r,t){case"core":case"collection":e.fn[t](n)}if("layout"===t){for(var o=r.prototype,s=["stop"],l=0;l<s.length;l++){var u=s[l];o[u]=o[u]||function(){return this}}o.start&&!o.run?o.run=function(){return this.start(),this}:!o.start&&o.run&&(o.start=function(){return this.run(),this}),o.on=e.define.on({layout:!0}),o.one=e.define.on({layout:!0,unbindSelfOnTrigger:!0}),o.once=e.define.on({layout:!0,unbindAllBindersOnTrigger:!0}),o.off=e.define.off({layout:!0}),o.trigger=e.define.trigger({layout:!0}),o.bind=o.on,o.unbind=o.off}return e.util.setMap({map:a,keys:[t,i],value:r})}function i(t,i){return e.util.getMap({map:a,keys:[t,i]})}function r(t,i,r,n,a){return e.util.setMap({map:o,keys:[t,i,r,n],value:a})}function n(t,i,r,n){return e.util.getMap({map:o,keys:[t,i,r,n]})}var a={};e.extensions=a;var o={};e.modules=o,e.extension=function(){return 2==arguments.length?i.apply(this,arguments):3==arguments.length?t.apply(this,arguments):4==arguments.length?n.apply(this,arguments):5==arguments.length?r.apply(this,arguments):void e.util.error("Invalid extension access syntax")}}(cytoscape),function(e,t){"use strict";if(e){var i=function(e){var t=e[0]._cyreg=e[0]._cyreg||{};return t};e.fn.cytoscape=function(r){var n=e(this);if("get"===r)return i(n).cy;if(t.is.fn(r)){var a=r,o=i(n).cy;if(o&&o.isReady())o.trigger("ready",[],a);else{var s=i(n),l=s.readies=s.readies||[];l.push(a)}}else if(t.is.plainObject(r))return n.each(function(){var t=e.extend({},r,{container:e(this)[0]});cytoscape(t)})},e.cytoscape=cytoscape,null==e.fn.cy&&null==e.cy&&(e.fn.cy=e.fn.cytoscape,e.cy=e.cytoscape)}}("undefined"!=typeof jQuery?jQuery:null,cytoscape),function(e){"use strict";function t(){return!1}function i(){return!0}e.Event=function(r,n){return this instanceof e.Event?(r&&r.type?(this.originalEvent=r,this.type=r.type,this.isDefaultPrevented=r.defaultPrevented||r.getPreventDefault&&r.getPreventDefault()?i:t):this.type=r,n&&(this.type=void 0!==n.type?n.type:this.type,this.cy=n.cy,this.cyTarget=n.cyTarget,this.cyPosition=n.cyPosition,this.cyRenderedPosition=n.cyRenderedPosition,this.namespace=n.namespace,this.layout=n.layout,this.data=n.data),void(this.timeStamp=r&&r.timeStamp||+new Date)):new e.Event(r,n)},e.Event.prototype={preventDefault:function(){this.isDefaultPrevented=i;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=i;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=i,this.stopPropagation()},isDefaultPrevented:t,isPropagationStopped:t,isImmediatePropagationStopped:t}}(cytoscape),function(e){"use strict";e.define={data:function(t){var i={field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,onSet:function(){},canSet:function(){return!0}};return t=e.util.extend({},i,t),function(i,r){var n=t,a=this,o=void 0!==a.length,s=o?a:[a],l=o?a[0]:a;if(e.is.string(i)){if(n.allowGetting&&void 0===r){var u;return l&&(u=l._private[n.field][i]),u}if(n.allowSetting&&void 0!==r){var c=!n.immutableKeys[i];if(c){for(var d=0,p=s.length;p>d;d++)n.canSet(s[d])&&(s[d]._private[n.field][i]=r);n.updateStyle&&a.updateStyle(),n.onSet(a),n.settingTriggersEvent&&a[n.triggerFnName](n.settingEvent)}}}else if(n.allowSetting&&e.is.plainObject(i)){var h,v,f=i;for(h in f){v=f[h];var c=!n.immutableKeys[h];if(c)for(var d=0,p=s.length;p>d;d++)n.canSet(s[d])&&(s[d]._private[n.field][h]=v)}n.updateStyle&&a.updateStyle(),n.onSet(a),n.settingTriggersEvent&&a[n.triggerFnName](n.settingEvent)}else if(n.allowBinding&&e.is.fn(i)){var g=i;a.bind(n.bindingEvent,g)}else if(n.allowGetting&&void 0===i){var u;return l&&(u=l._private[n.field]),u}return a}},removeData:function(t){var i={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return t=e.util.extend({},i,t),function(i){var r=t,n=this,a=void 0!==n.length,o=a?n:[n];if(e.is.string(i)){for(var s=i.split(/\s+/),l=s.length,u=0;l>u;u++){var c=s[u];if(!e.is.emptyString(c)){var d=!r.immutableKeys[c];if(d)for(var p=0,h=o.length;h>p;p++)o[p]._private[r.field][c]=void 0}}r.triggerEvent&&n[r.triggerFnName](r.event)}else if(void 0===i){for(var p=0,h=o.length;h>p;p++){var v=o[p]._private[r.field];for(var c in v){var f=!r.immutableKeys[c];f&&(v[c]=void 0)}}r.triggerEvent&&n[r.triggerFnName](r.event)}return n}},event:{regex:/(\w+)(\.\w+)?/,optionalTypeRegex:/(\w+)?(\.\w+)?/,falseCallback:function(){return!1}},on:function(t){var i={unbindSelfOnTrigger:!1,unbindAllBindersOnTrigger:!1};return t=e.util.extend({},i,t),function(i,r,n,a){var o=this,s=void 0!==o.length,l=s?o:[o],u=e.is.string(i),c=t;if(e.is.plainObject(r)?(a=n,n=r,r=void 0):(e.is.fn(r)||r===!1)&&(a=r,n=void 0,r=void 0),(e.is.fn(n)||n===!1)&&(a=n,n=void 0),!e.is.fn(a)&&a!==!1&&u)return o;if(u){var d={};d[i]=a,i=d}for(var p in i)if(a=i[p],a===!1&&(a=e.define.event.falseCallback),e.is.fn(a)){p=p.split(/\s+/);for(var h=0;h<p.length;h++){var v=p[h];if(!e.is.emptyString(v)){var f=v.match(e.define.event.regex);if(f)for(var g=f[1],y=f[2]?f[2]:void 0,m={callback:a,data:n,delegated:r?!0:!1,selector:r,selObj:new e.Selector(r),type:g,namespace:y,unbindSelfOnTrigger:c.unbindSelfOnTrigger,unbindAllBindersOnTrigger:c.unbindAllBindersOnTrigger,binders:l},x=0;x<l.length;x++)l[x]._private.listeners.push(m)}}}return o}},off:function(t){var i={};return t=e.util.extend({},i,t),function(t,i,r){var n=this,a=void 0!==n.length,o=a?n:[n],s=e.is.string(t);if(0===arguments.length){for(var l=0;l<o.length;l++)o[l]._private.listeners=[];return n}if((e.is.fn(i)||i===!1)&&(r=i,i=void 0),s){var u={};u[t]=r,t=u}for(var c in t){r=t[c],r===!1&&(r=e.define.event.falseCallback),c=c.split(/\s+/);for(var d=0;d<c.length;d++){var p=c[d];if(!e.is.emptyString(p)){var h=p.match(e.define.event.optionalTypeRegex);if(h)for(var v=h[1]?h[1]:void 0,f=h[2]?h[2]:void 0,l=0;l<o.length;l++)for(var g=o[l]._private.listeners,y=0;y<g.length;y++){var m=g[y],x=!f||f===m.namespace,b=!v||m.type===v,w=!r||r===m.callback,_=x&&b&&w;_&&(g.splice(y,1),y--)}}}}return n}},trigger:function(t){var i={};return t=e.util.extend({},i,t),function(i,r,n){var a=this,o=void 0!==a.length,s=o?a:[a],l=e.is.string(i),u=e.is.plainObject(i),c=e.is.event(i),d=this._private.cy||this,p=d.hasCompoundNodes();if(l){var h=i.split(/\s+/);i=[];for(var v=0;v<h.length;v++){var f=h[v];if(!e.is.emptyString(f)){var g=f.match(e.define.event.regex),y=g[1],m=g[2]?g[2]:void 0;i.push({type:y,namespace:m})}}}else if(u){var x=i;i=[x]}r?e.is.array(r)||(r=[r]):r=[];for(var v=0;v<i.length;v++)for(var b=i[v],w=0;w<s.length;w++){var f,_=s[w],E=_._private.listeners,S=e.is.element(_),P=S||t.layout;if(c?(f=b,f.cyTarget=f.cyTarget||_,f.cy=f.cy||d):f=new e.Event(b,{cyTarget:_,cy:d,namespace:b.namespace}),b.layout&&(f.layout=b.layout),t.layout&&(f.layout=_),f.cyPosition){var k=f.cyPosition,C=d.zoom(),D=d.pan();
f.cyRenderedPosition={x:k.x*C+D.x,y:k.y*C+D.y}}n&&(E=[{namespace:f.namespace,type:f.type,callback:n}]);for(var N=0;N<E.length;N++){var T=E[N],M=!T.namespace||T.namespace===f.namespace,B=T.type===f.type,I=T.delegated?_!==f.cyTarget&&e.is.element(f.cyTarget)&&T.selObj.matches(f.cyTarget):!0,z=M&&B&&I;if(z){var L=[f];if(L=L.concat(r),f.data=T.data?T.data:void 0,(T.unbindSelfOnTrigger||T.unbindAllBindersOnTrigger)&&(E.splice(N,1),N--),T.unbindAllBindersOnTrigger)for(var O=T.binders,R=0;R<O.length;R++){var X=O[R];if(X&&X!==_)for(var V=X._private.listeners,Y=0;Y<V.length;Y++){var A=V[Y];A===T&&(V.splice(Y,1),Y--)}}var q=T.delegated?f.cyTarget:_,F=T.callback.apply(q,L);(F===!1||f.isPropagationStopped())&&(P=!1,F===!1&&(f.stopPropagation(),f.preventDefault()))}}if(P){var j=p?_._private.parent:null,W=null!=j&&0!==j.length;W?(j=j[0],j.trigger(f)):d.trigger(f)}}return a}},animated:function(t){var i={};return t=e.util.extend({},i,t),function(){var e=this,t=void 0!==e.length,i=t?e:[e],r=this._private.cy||this;if(!r.styleEnabled())return!1;var n=i[0];return n?n._private.animation.current.length>0:void 0}},clearQueue:function(t){var i={};return t=e.util.extend({},i,t),function(){var e=this,t=void 0!==e.length,i=t?e:[e],r=this._private.cy||this;if(!r.styleEnabled())return this;for(var n=0;n<i.length;n++){var a=i[n];a._private.animation.queue=[]}return this}},delay:function(t){var i={};return t=e.util.extend({},i,t),function(e,t){var i=this._private.cy||this;return i.styleEnabled()?(this.animate({delay:e},{duration:e,complete:t}),this):this}},animate:function(t){var i={};return t=e.util.extend({},i,t),function(e,t){var i=this,r=void 0!==i.length,n=r?i:[i],a=this._private.cy||this,o=!r,s=!o;if(!a.styleEnabled())return this;var l,u=+new Date,c=a.style();switch(void 0===t&&(t={}),void 0===t.duration&&(t.duration=400),t.duration){case"slow":t.duration=600;break;case"fast":t.duration=200}var d=!0;if(e)for(var p in e){d=!1;break}if(d)return this;if(e.css&&s&&(e.css=c.getValueStyle(e.css,{array:!0})),e.renderedPosition&&s){var h=e.renderedPosition,v=a.pan(),f=a.zoom();e.position={x:(h.x-v.x)/f,y:(h.y-v.y)/f}}if(e.panBy&&o){var g=e.panBy,y=a.pan();e.pan={x:y.x+g.x,y:y.y+g.y}}var m=e.center||e.centre;if(m&&o){var x=a.getCenterPan(m.eles);x&&(e.pan=x)}if(e.fit&&o){var b=e.fit,w=a.getFitViewport(b.eles||b.boundingBox,b.padding);w&&(e.pan=w.pan,e.zoom=w.zoom)}for(var p=0;p<n.length;p++){var _=n[p];l=_.animated()&&(void 0===t.queue||t.queue)?_._private.animation.queue:_._private.animation.current,l.push({properties:e,duration:t.duration,params:t,callTime:u})}return s&&a.addToAnimationPool(this),this}},stop:function(t){var i={};return t=e.util.extend({},i,t),function(e,t){var i=this,r=void 0!==i.length,n=r?i:[i],a=this._private.cy||this;if(!a.styleEnabled())return this;for(var o=0;o<n.length;o++){for(var s=n[o],l=s._private.animation.current,u=0;u<l.length;u++){var c=l[u];t&&(c.duration=0)}e&&(s._private.animation.queue=[]),t||(s._private.animation.current=[])}return a.notify({collection:this,type:"draw"}),this}}}}(cytoscape),function(e){"use strict";e.fn.selector=function(t){for(var i in t){var r=t[i];e.Selector.prototype[i]=r}},e.Selector=function(t,i){if(!(this instanceof e.Selector))return new e.Selector(t,i);void 0===i&&void 0!==t&&(i=t,t=void 0);var r=this;if(r._private={selectorText:null,invalid:!0},!i||e.is.string(i)&&i.match(/^\s*$/))null==t?r.length=0:(r[0]=o(),r[0].group=t,r.length=1);else if(e.is.element(i)){var n=new e.Collection(r.cy(),[i]);r[0]=o(),r[0].collection=n,r.length=1}else if(e.is.collection(i))r[0]=o(),r[0].collection=i,r.length=1;else if(e.is.fn(i))r[0]=o(),r[0].filter=i,r.length=1;else{if(!e.is.string(i))return void e.util.error("A selector must be created from a string; found "+i);var a=null,o=function(){return{classes:[],colonSelectors:[],data:[],group:null,ids:[],meta:[],collection:null,filter:null,parent:null,ancestor:null,subject:null,child:null,descendant:null}},s={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:'"(?:\\\\"|[^"])+"|'+"'(?:\\\\'|[^'])+'",number:e.util.regex.number,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$"};s.variable="(?:[\\w-]|(?:\\\\"+s.metaChar+"))+",s.value=s.string+"|"+s.number,s.className=s.variable,s.id=s.variable;for(var l=function(e){return e.replace(new RegExp("\\\\("+s.metaChar+")","g"),function(e,t){return t})},u=s.comparatorOp.split("|"),c=0;c<u.length;c++){var d=u[c];s.comparatorOp+="|@"+d}for(var u=s.comparatorOp.split("|"),c=0;c<u.length;c++){var d=u[c];d.indexOf("!")>=0||"="!==d&&(s.comparatorOp+="|\\!"+d)}var p={group:{query:!0,regex:"(node|edge|\\*)",populate:function(e){this.group="*"==e?e:e+"s"}},state:{query:!0,regex:"(:selected|:unselected|:locked|:unlocked|:visible|:hidden|:transparent|:grabbed|:free|:removed|:inside|:grabbable|:ungrabbable|:animated|:unanimated|:selectable|:unselectable|:orphan|:nonorphan|:parent|:child|:loop|:simple|:active|:inactive|:touch)",populate:function(e){this.colonSelectors.push(e)}},id:{query:!0,regex:"\\#("+s.id+")",populate:function(e){this.ids.push(l(e))}},className:{query:!0,regex:"\\.("+s.className+")",populate:function(e){this.classes.push(l(e))}},dataExists:{query:!0,regex:"\\[\\s*("+s.variable+")\\s*\\]",populate:function(e){this.data.push({field:l(e)})}},dataCompare:{query:!0,regex:"\\[\\s*("+s.variable+")\\s*("+s.comparatorOp+")\\s*("+s.value+")\\s*\\]",populate:function(e,t,i){var r=null!=new RegExp("^"+s.string+"$").exec(i);i=r?i.substring(1,i.length-1):parseFloat(i),this.data.push({field:l(e),operator:t,value:i})}},dataBool:{query:!0,regex:"\\[\\s*("+s.boolOp+")\\s*("+s.variable+")\\s*\\]",populate:function(e,t){this.data.push({field:l(t),operator:e})}},metaCompare:{query:!0,regex:"\\[\\[\\s*("+s.meta+")\\s*("+s.comparatorOp+")\\s*("+s.number+")\\s*\\]\\]",populate:function(e,t,i){this.meta.push({field:l(e),operator:t,value:parseFloat(i)})}},nextQuery:{separator:!0,regex:s.separator,populate:function(){r[++c]=o(),a=null}},child:{separator:!0,regex:s.child,populate:function(){var e=o();e.parent=this,e.subject=a,r[c]=e}},descendant:{separator:!0,regex:s.descendant,populate:function(){var e=o();e.ancestor=this,e.subject=a,r[c]=e}},subject:{modifier:!0,regex:s.subject,populate:function(){return null!=a&&this.subject!=this?(e.util.error("Redefinition of subject in selector `"+i+"`"),!1):(a=this,void(this.subject=this))}}},h=0;for(var v in p)p[h]=p[v],p[h].name=v,h++;p.length=h,r._private.selectorText=i;var f=i,c=0,g=function(t){for(var i,r,n,a=0;a<p.length;a++){var o=p[a],s=o.name;if(!e.is.fn(t)||t(s,o)){var l=f.match(new RegExp("^"+o.regex));if(null!=l){r=l,i=o,n=s;var u=l[0];f=f.substring(u.length);break}}}return{expr:i,match:r,name:n}},y=function(){var e=f.match(/^\s+/);if(e){var t=e[0];f=f.substring(t.length)}};for(r[0]=o(),y();;){var m=g();if(null==m.expr)return void e.util.error("The selector `"+i+"`is invalid");for(var x=[],h=1;h<m.match.length;h++)x.push(m.match[h]);var b=m.expr.populate.apply(r[c],x);if(b===!1)return;if(f.match(/^\s*$/))break}for(r.length=c+1,h=0;h<r.length;h++){var w=r[h];if(null!=w.subject){for(;w.subject!=w;)if(null!=w.parent){var _=w.parent,E=w;E.parent=null,_.child=E,w=_}else{if(null==w.ancestor){e.util.error("When adjusting references for the selector `"+w+"`, neither parent nor ancestor was found");break}var S=w.ancestor,P=w;P.ancestor=null,S.descendant=P,w=S}r[h]=w.subject}}if(null!=t)for(var h=0;h<r.length;h++){if(null!=r[h].group&&r[h].group!=t)return void e.util.error("Group `"+r[h].group+"` conflicts with implicit group `"+t+"` in selector `"+i+"`");r[h].group=t}}r._private.invalid=!1},e.selfn=e.Selector.prototype,e.selfn.size=function(){return this.length},e.selfn.eq=function(e){return this[e]},e.selfn.find=function(){};var t=function(i,r){if(null!=i.group&&"*"!=i.group&&i.group!=r._private.group)return!1;for(var n=r.cy(),a=!0,o=0;o<i.colonSelectors.length;o++){var s=i.colonSelectors[o];switch(s){case":selected":a=r.selected();break;case":unselected":a=!r.selected();break;case":selectable":a=r.selectable();break;case":unselectable":a=!r.selectable();break;case":locked":a=r.locked();break;case":unlocked":a=!r.locked();break;case":visible":a=r.visible();break;case":hidden":a=!r.visible();break;case":transparent":a=r.transparent();break;case":grabbed":a=r.grabbed();break;case":free":a=!r.grabbed();break;case":removed":a=r.removed();break;case":inside":a=!r.removed();break;case":grabbable":a=r.grabbable();break;case":ungrabbable":a=!r.grabbable();break;case":animated":a=r.animated();break;case":unanimated":a=!r.animated();break;case":parent":a=r.isNode()&&r.children().nonempty();break;case":child":case":nonorphan":a=r.isNode()&&r.parent().nonempty();break;case":orphan":a=r.isNode()&&r.parent().empty();break;case":loop":a=r.isEdge()&&r.data("source")===r.data("target");break;case":simple":a=r.isEdge()&&r.data("source")!==r.data("target");break;case":active":a=r.active();break;case":inactive":a=!r.active();break;case":touch":a=e.is.touch()}if(!a)break}if(!a)return!1;for(var l=!0,o=0;o<i.ids.length;o++){var u=i.ids[o],c=r._private.data.id;if(l=l&&u==c,!l)break}if(!l)return!1;for(var d=!0,o=0;o<i.classes.length;o++){var p=i.classes[o];if(d=d&&r.hasClass(p),!d)break}if(!d)return!1;var h=function(t){for(var r=!0,n=0;n<i[t.name].length;n++){var a,o=i[t.name][n],s=o.operator,l=o.value,u=o.field;if(null!=s&&null!=l){var c=t.fieldValue(u),d=e.is.string(c)||e.is.number(c)?""+c:"",p=""+l,h=!1;s.indexOf("@")>=0&&(d=d.toLowerCase(),p=p.toLowerCase(),s=s.replace("@",""),h=!0);var v=!1,f=!1;switch(s.indexOf("!")>=0&&(s=s.replace("!",""),v=!0),h&&(l=p.toLowerCase(),c=d.toLowerCase()),s){case"*=":a=d.search(p)>=0;break;case"$=":a=null!=new RegExp(p+"$").exec(d);break;case"^=":a=null!=new RegExp("^"+p).exec(d);break;case"=":a=c===l;break;case"!=":a=c!==l;break;case">":a=v?l>=c:c>l,f=!0;break;case">=":a=v?l>c:c>=l,f=!0;break;case"<":a=v?c>=l:l>c,f=!0;break;case"<=":a=v?c>l:l>=c,f=!0;break;default:a=!1}}else if(null!=s)switch(s){case"?":a=t.fieldTruthy(u);break;case"!":a=!t.fieldTruthy(u);break;case"^":a=t.fieldUndefined(u)}else a=!t.fieldUndefined(u);if(v&&!f&&(a=!a,f=!0),!a){r=!1;break}}return r},v=h({name:"data",fieldValue:function(e){return r._private.data[e]},fieldRef:function(e){return"element._private.data."+e},fieldUndefined:function(e){return void 0===r._private.data[e]},fieldTruthy:function(e){return r._private.data[e]?!0:!1}});if(!v)return!1;var f=h({name:"meta",fieldValue:function(e){return r[e]()},fieldRef:function(e){return"element."+e+"()"},fieldUndefined:function(e){return null==r[e]()},fieldTruthy:function(e){return r[e]()?!0:!1}});if(!f)return!1;if(null!=i.collection){var g=null!=i.collection._private.ids[r.id()];if(!g)return!1}if(null!=i.filter&&0===r.collection().filter(i.filter).size())return!1;var y=function(e,i){if(null!=e){var r=!1;if(!n.hasCompoundNodes())return!1;i=i();for(var a=0;a<i.length;a++)if(t(e,i[a])){r=!0;break}return r}return!0};return y(i.parent,function(){return r.parent()})&&y(i.ancestor,function(){return r.parents()})&&y(i.child,function(){return r.children()})&&y(i.descendant,function(){return r.descendants()})?!0:!1};e.selfn.filter=function(i){var r=this,n=i.cy();if(r._private.invalid)return new e.Collection(n);var a=function(e,i){for(var n=0;n<r.length;n++){var a=r[n];if(t(a,i))return!0}return!1};null==r._private.selectorText&&(a=function(){return!0});var o=i.filter(a);return o},e.selfn.matches=function(e){var i=this;if(i._private.invalid)return!1;for(var r=0;r<i.length;r++){var n=i[r];if(t(n,e))return!0}return!1},e.selfn.toString=e.selfn.selector=function(){for(var t="",i=function(t){return e.is.string(t)?t:""},r=function(e){var t="",a=i(e.group);t+=a.substring(0,a.length-1);for(var o=0;o<e.data.length;o++){var s=e.data[o];t+=s.value?"["+s.field+i(s.operator)+i(s.value)+"]":"["+i(s.operator)+s.field+"]"}for(var o=0;o<e.meta.length;o++){var l=e.meta[o];t+="[["+l.field+i(l.operator)+i(l.value)+"]]"}for(var o=0;o<e.colonSelectors.length;o++){var u=e.colonSelectors[n];t+=u}for(var o=0;o<e.ids.length;o++){var u="#"+e.ids[n];t+=u}for(var o=0;o<e.classes.length;o++){var u="."+e.classes[n];t+=u}return null!=e.parent&&(t=r(e.parent)+" > "+t),null!=e.ancestor&&(t=r(e.ancestor)+" "+t),null!=e.child&&(t+=" > "+r(e.child)),null!=e.descendant&&(t+=" "+r(e.descendant)),t},n=0;n<this.length;n++){var a=this[n];t+=r(a),this.length>1&&n<this.length-1&&(t+=", ")}return t}}(cytoscape),function(e){"use strict";e.Style=function(t){return this instanceof e.Style?e.is.core(t)?(this._private={cy:t,coreStyle:{},newStyle:!0},this.length=0,void this.addDefaultStylesheet()):void e.util.error("A style must have a core reference"):new e.Style(t)},e.style=e.Style,e.styfn=e.Style.prototype,e.fn.style=function(t){for(var i in t){var r=t[i];e.Style.prototype=r}},function(){var t=e.util.regex.number,i=e.util.regex.rgbaNoBackRefs,r=e.util.regex.hslaNoBackRefs,n=e.util.regex.hex3,a=e.util.regex.hex6,o=function(e){return"^"+e+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},s=function(e){return"^"+e+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+t+"|\\w+|"+i+"|"+r+"|"+n+"|"+a+")\\s*\\,\\s*("+t+"|\\w+|"+i+"|"+r+"|"+n+"|"+a+")\\)$"};e.style.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%"},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},position:{enums:["parent","origin"]},autoSize:{number:!0,min:0,enums:["auto"]},number:{number:!0},size:{number:!0,min:0},bgSize:{number:!0,min:0,allowPercent:!0},bgPos:{number:!0,allowPercent:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"]},bgFit:{enums:["none","contain","cover"]},bgClip:{enums:["none","node"]},color:{color:!0},lineStyle:{enums:["solid","dotted","dashed"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack"]},fontFamily:{regex:"^([\\w- ]+(?:\\s*,\\s*[\\w- ]+)*)$"},fontVariant:{enums:["small-caps","normal"]},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"]},nodeShape:{enums:["rectangle","roundrectangle","ellipse","triangle","square","pentagon","hexagon","heptagon","octagon","star"]},arrowShape:{enums:["tee","triangle","triangle-tee","triangle-backcurve","half-triangle-overshot","square","circle","diamond","none"]},arrowFill:{enums:["filled","hollow"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},text:{string:!0},data:{mapping:!0,regex:o("data")},layoutData:{mapping:!0,regex:o("layoutData")},mapData:{mapping:!0,regex:s("mapData")},mapLayoutData:{mapping:!0,regex:s("mapLayoutData")},url:{regex:"^url\\s*\\(\\s*([^\\s]+)\\s*\\s*\\)|none|(.+)$"},propList:{propList:!0},angle:{number:!0,units:"deg|rad"}};var l=e.style.types,u=e.style.properties=[{name:"text-valign",type:l.valign},{name:"text-halign",type:l.halign},{name:"color",type:l.color},{name:"content",type:l.text},{name:"text-outline-color",type:l.color},{name:"text-outline-width",type:l.size},{name:"text-outline-opacity",type:l.zeroOneNumber},{name:"text-opacity",type:l.zeroOneNumber},{name:"text-transform",type:l.textTransform},{name:"font-family",type:l.fontFamily},{name:"font-style",type:l.fontStyle},{name:"font-weight",type:l.fontWeight},{name:"font-size",type:l.size},{name:"min-zoomed-font-size",type:l.size},{name:"display",type:l.display},{name:"visibility",type:l.visibility},{name:"opacity",type:l.zeroOneNumber},{name:"z-index",type:l.nonNegativeInt},{name:"overlay-padding",type:l.size},{name:"overlay-color",type:l.color},{name:"overlay-opacity",type:l.zeroOneNumber},{name:"transition-property",type:l.propList},{name:"transition-duration",type:l.time},{name:"transition-delay",type:l.time},{name:"height",type:l.autoSize},{name:"width",type:l.autoSize},{name:"shape",type:l.nodeShape},{name:"background-color",type:l.color},{name:"background-opacity",type:l.zeroOneNumber},{name:"background-blacken",type:l.nOneOneNumber},{name:"border-color",type:l.color},{name:"border-opacity",type:l.zeroOneNumber},{name:"border-width",type:l.size},{name:"border-style",type:l.borderStyle},{name:"background-image",type:l.url},{name:"background-image-opacity",type:l.zeroOneNumber},{name:"background-position-x",type:l.bgPos},{name:"background-position-y",type:l.bgPos},{name:"background-repeat",type:l.bgRepeat},{name:"background-fit",type:l.bgFit},{name:"background-clip",type:l.bgClip},{name:"padding-left",type:l.size},{name:"padding-right",type:l.size},{name:"padding-top",type:l.size},{name:"padding-bottom",type:l.size},{name:"position",type:l.position},{name:"line-style",type:l.lineStyle},{name:"line-color",type:l.color},{name:"control-point-step-size",type:l.size},{name:"control-point-distance",type:l.number},{name:"control-point-weight",type:l.zeroOneNumber},{name:"curve-style",type:l.curveStyle},{name:"haystack-radius",type:l.zeroOneNumber},{name:"source-arrow-shape",type:l.arrowShape},{name:"target-arrow-shape",type:l.arrowShape},{name:"mid-source-arrow-shape",type:l.arrowShape},{name:"mid-target-arrow-shape",type:l.arrowShape},{name:"source-arrow-color",type:l.color},{name:"target-arrow-color",type:l.color},{name:"mid-source-arrow-color",type:l.color},{name:"mid-target-arrow-color",type:l.color},{name:"source-arrow-fill",type:l.arrowFill},{name:"target-arrow-fill",type:l.arrowFill},{name:"mid-source-arrow-fill",type:l.arrowFill},{name:"mid-target-arrow-fill",type:l.arrowFill},{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}];e.style.pieBackgroundN=16,u.push({name:"pie-size",type:l.bgSize});for(var c=1;c<=e.style.pieBackgroundN;c++)u.push({name:"pie-"+c+"-background-color",type:l.color}),u.push({name:"pie-"+c+"-background-size",type:l.percent}),u.push({name:"pie-"+c+"-background-opacity",type:l.zeroOneNumber});for(var c=0;c<u.length;c++){var d=u[c];u[d.name]=d}}(),e.styfn.addDefaultStylesheet=function(){var t="Helvetica",i="normal",r="normal",n="#000",a="none",o=16;this.selector("node, edge").css({"text-valign":"top","text-halign":"center",color:n,"text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":a,"font-family":t,"font-style":i,"font-weight":r,"font-size":o,"min-zoomed-font-size":0,visibility:"visible",display:"element",opacity:1,"z-index":0,content:"","overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"transition-property":"none","transition-duration":0,"transition-delay":0,"background-blacken":0,"background-color":"#888","background-opacity":1,"background-image":"none","background-image-opacity":1,"background-position-x":"50%","background-position-y":"50%","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid",height:30,width:30,shape:"ellipse","padding-top":0,"padding-bottom":0,"padding-left":0,"padding-right":0,position:"origin","pie-size":"100%","pie-1-background-color":"black","pie-2-background-color":"black","pie-3-background-color":"black","pie-4-background-color":"black","pie-5-background-color":"black","pie-6-background-color":"black","pie-7-background-color":"black","pie-8-background-color":"black","pie-9-background-color":"black","pie-10-background-color":"black","pie-11-background-color":"black","pie-12-background-color":"black","pie-13-background-color":"black","pie-14-background-color":"black","pie-15-background-color":"black","pie-16-background-color":"black","pie-1-background-size":"0%","pie-2-background-size":"0%","pie-3-background-size":"0%","pie-4-background-size":"0%","pie-5-background-size":"0%","pie-6-background-size":"0%","pie-7-background-size":"0%","pie-8-background-size":"0%","pie-9-background-size":"0%","pie-10-background-size":"0%","pie-11-background-size":"0%","pie-12-background-size":"0%","pie-13-background-size":"0%","pie-14-background-size":"0%","pie-15-background-size":"0%","pie-16-background-size":"0%","pie-1-background-opacity":1,"pie-2-background-opacity":1,"pie-3-background-opacity":1,"pie-4-background-opacity":1,"pie-5-background-opacity":1,"pie-6-background-opacity":1,"pie-7-background-opacity":1,"pie-8-background-opacity":1,"pie-9-background-opacity":1,"pie-10-background-opacity":1,"pie-11-background-opacity":1,"pie-12-background-opacity":1,"pie-13-background-opacity":1,"pie-14-background-opacity":1,"pie-15-background-opacity":1,"pie-16-background-opacity":1,"source-arrow-shape":"none","mid-source-arrow-shape":"none","target-arrow-shape":"none","mid-target-arrow-shape":"none","source-arrow-color":"#ddd","mid-source-arrow-color":"#ddd","target-arrow-color":"#ddd","mid-target-arrow-color":"#ddd","source-arrow-fill":"filled","mid-source-arrow-fill":"filled","target-arrow-fill":"filled","mid-target-arrow-fill":"filled","line-style":"solid","line-color":"#ddd","control-point-step-size":40,"control-point-weight":.5,"curve-style":"bezier","haystack-radius":.8}).selector("$node > node").css({width:"auto",height:"auto",shape:"rectangle","background-opacity":.5,"padding-top":10,"padding-right":10,"padding-left":10,"padding-bottom":10}).selector("edge").css({width:1}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}).selector("core").css({"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":e.is.touch()?40:15,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125})},e.styfn.clear=function(){for(var e=0;e<this.length;e++)this[e]=void 0;return this.length=0,this._private.newStyle=!0,this},e.styfn.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},e.styfn.core=function(){return this._private.coreStyle},e.styfn.parse=function(t,i,r,n){t=e.util.camel2dash(t);var a=e.style.properties[t],o=i;if(!a)return null;if(void 0===i||null===i)return null;var s=e.is.string(i);s&&(i=e.util.trim(i));var l=a.type;if(!l)return null;if(r&&(""===i||null===i))return{name:t,value:i,bypass:!0,deleteBypass:!0};var u,c,d,p;if(!s||n);else{if((u=new RegExp(e.style.types.data.regex).exec(i))||(d=new RegExp(e.style.types.layoutData.regex).exec(i))){if(r)return!1;var h=void 0!==d;return u=u||d,{name:t,value:u,strValue:""+i,mapped:h?e.style.types.layoutData:e.style.types.data,field:u[1],bypass:r,hasPie:t.match(/pie-(\d+)-background-size/)}}if((c=new RegExp(e.style.types.mapData.regex).exec(i))||(p=new RegExp(e.style.types.mapLayoutData.regex).exec(i))){if(r)return!1;var h=void 0!==p;if(c=c||p,!l.color&&!l.number)return!1;var v=this.parse(t,c[4]);if(!v||v.mapped)return!1;var f=this.parse(t,c[5]);if(!f||f.mapped)return!1;if(v.value===f.value)return!1;if(l.color){var g=v.value,y=f.value,m=!(g[0]!==y[0]||g[1]!==y[1]||g[2]!==y[2]||g[3]!==y[3]&&(null!=g[3]&&1!==g[3]||null!=y[3]&&1!==y[3]));if(m)return!1}return{name:t,value:c,strValue:""+i,mapped:h?e.style.types.mapLayoutData:e.style.types.mapData,field:c[1],fieldMin:parseFloat(c[2]),fieldMax:parseFloat(c[3]),valueMin:v.value,valueMax:f.value,bypass:r,hasPie:t.match(/pie-(\d+)-background-size/)}}}if(l.number){var x,b="px";if(l.units&&(x=l.units),l.implicitUnits&&(b=l.implicitUnits),!l.unitless)if(s){var w="px|em"+(l.allowPercent?"|\\%":"");x&&(w=x);var _=i.match("^("+e.util.regex.number+")("+w+")?$");_&&(i=_[1],x=_[2]||b)}else(!x||l.implicitUnits)&&(x=b);if(i=parseFloat(i),isNaN(i)&&void 0===l.enums)return null;if(isNaN(i)&&void 0!==l.enums){i=o;for(var E=0;E<l.enums.length;E++){var S=l.enums[E];if(S===i)return{name:t,value:i,strValue:""+i,bypass:r}}return null}if(l.integer&&!e.is.integer(i))return null;if(void 0!==l.min&&i<l.min||void 0!==l.max&&i>l.max)return null;var P={name:t,value:i,strValue:""+i+(x?x:""),units:x,bypass:r,hasPie:t.match(/pie-(\d+)-background-size/)&&null!=i&&0!==i&&""!==i};return l.unitless||"px"!==x&&"em"!==x||(P.pxValue="px"!==x&&x?this.getEmSizeInPixels()*i:i),("ms"===x||"s"===x)&&(P.msValue="ms"===x?i:1e3*i),P}if(l.propList){var k=[],C=""+i;if("none"===C);else{for(var D=C.split(","),E=0;E<D.length;E++){var N=e.util.trim(D[E]);e.style.properties[N]&&k.push(N)}if(0===k.length)return null}return{name:t,value:k,strValue:0===k.length?"none":k.join(", "),bypass:r}}if(l.color){var T=e.util.color2tuple(i);return T?{name:t,value:T,strValue:""+i,bypass:r}:null}if(l.enums){for(var E=0;E<l.enums.length;E++){var S=l.enums[E];if(S===i)return{name:t,value:i,strValue:""+i,bypass:r}}return null}if(l.regex){var M=new RegExp(l.regex),B=M.exec(i);return B?{name:t,value:B,strValue:""+i,bypass:r}:null}return l.string?{name:t,value:i,strValue:""+i,bypass:r}:null},e.styfn.selector=function(t){var i="core"===t?null:new e.Selector(t),r=this.length++;return this[r]={selector:i,properties:[],mappedProperties:[],index:r},this},e.styfn.css=function(){var t=arguments;switch(t.length){case 1:for(var i=t[0],r=0;r<e.style.properties.length;r++){var n=e.style.properties[r],a=i[n.name];void 0===a&&(a=i[e.util.dash2camel(n.name)]),void 0!==a&&this.cssRule(n.name,a)}break;case 2:this.cssRule(t[0],t[1])}return this},e.styfn.cssRule=function(e,t){var i=this.parse(e,t);if(i){var r=this.length-1;this[r].properties.push(i),this[r].properties[i.name]=i,i.hasPie&&(this._private.hasPie=!0),i.mapped&&this[r].mappedProperties.push(i);var n=!this[r].selector;n&&(this._private.coreStyle[i.name]=i)}return this}}(cytoscape),function(e){"use strict";e.styfn.apply=function(e){var t=this;t._private.newStyle&&(this._private.contextStyles={},this._private.propDiffs={});for(var i=0;i<e.length;i++){var r=e[i],n=t.getContextMeta(r),a=t.getContextStyle(n),o=t.applyContextStyle(n,a,r);t.updateTransitions(r,o.diffProps),t.updateStyleHints(r)}t._private.newStyle=!1},e.styfn.getPropertiesDiff=function(e,t){var i=this,r=i._private.propDiffs=i._private.propDiffs||{},n=e+"-"+t,a=r[n];if(a)return a;for(var o=[],s={},l=0;l<i.length;l++){var u=i[l],c="t"===e[l],d="t"===t[l],p=c!==d,h=u.mappedProperties.length>0;if(p||h){var v;p&&h?v=u.properties:p?v=u.properties:h&&(v=u.mappedProperties);for(var f=0;f<v.length;f++){for(var g=v[f],y=g.name,m=!1,x=l+1;x<i.length;x++){var b=i[x],w="t"===t[x];if(w&&(m=null!=b.properties[g.name]))break}s[y]||m||(s[y]=!0,o.push(y))}}}return r[n]=o,o},e.styfn.getContextMeta=function(e){var t,i=this,r="",n=e._private.styleCxtKey||"";i._private.newStyle&&(n="");for(var a=0;a<i.length;a++){var o=i[a],s=o.selector&&o.selector.matches(e);r+=s?"t":"f"}return t=i.getPropertiesDiff(n,r),e._private.styleCxtKey=r,{key:r,diffPropNames:t}},e.styfn.getContextStyle=function(e){var t=e.key,i=this,r=this._private.contextStyles=this._private.contextStyles||{};if(r[t])return r[t];for(var n={_private:{key:t}},a=0;a<i.length;a++){var o=i[a],s="t"===t[a];if(s)for(var l=0;l<o.properties.length;l++){var u=o.properties[l],c=n[u.name]=u;c.context=o}}return r[t]=n,n},e.styfn.applyContextStyle=function(e,t,i){for(var r=this,n=e.diffPropNames,a={},o=0;o<n.length;o++){var s=n[o],l=t[s],u=i._private.style[s];if(l&&u!==l){var c=a[s]={prev:u};r.applyParsedProperty(i,l),c.next=i._private.style[s],c.next.bypass&&(c.next=c.next.bypassed)}}return{diffProps:a}},e.styfn.updateStyleHints=function(t){var i=t._private,r=this,n=i.style,a=!1;if("nodes"===i.group&&r._private.hasPie)for(var o=1;o<=e.style.pieBackgroundN;o++){var s=i.style["pie-"+o+"-background-size"].value;if(s>0){a=!0;break}}i.hasPie=a;var l=n["text-transform"].strValue,u=n.content.strValue,c=n["font-style"].strValue,s=n["font-size"].pxValue+"px",d=n["font-family"].strValue,p=n["font-weight"].strValue,h=n["text-valign"].strValue,v=n["text-valign"].strValue,f=n["text-outline-width"].pxValue;i.labelKey=c+"$"+s+"$"+d+"$"+p+"$"+u+"$"+l+"$"+h+"$"+v+"$"+f,i.fontKey=c+"$"+p+"$"+s+"$"+d;var g=n.width.pxValue,y=n.height.pxValue,m=n["border-width"].pxValue;if(i.boundingBoxKey=g+"$"+y+"$"+m,"edges"===t._private.group){var x=n["control-point-step-size"].pxValue,b=n["control-point-distance"]?n["control-point-distance"].pxValue:void 0,w=n["control-point-weight"].value,_=n["curve-style"].strValue;i.boundingBoxKey+="$"+x+"$"+b+"$"+w+"$"+_}i.styleKey=Date.now()},e.styfn.applyParsedProperty=function(t,i){var r,n,a=i,o=t._private.style,s=e.style.properties[a.name].type,l=a.bypass,u=o[a.name],c=u&&u.bypass;if(("height"===i.name||"width"===i.name)&&"auto"===i.value&&t.isNode()&&!t.isParent())return!1;if(l&&a.deleteBypass){var d=o[a.name];return d?d.bypass&&d.bypassed?(o[a.name]=d.bypassed,!0):!1:!0}switch(a.mapped){case e.style.types.mapData:case e.style.types.mapLayoutData:for(var p=a.mapped===e.style.types.mapLayoutData,h=a.field.split("."),r=p?t._private.layoutData:t._private.data,v=0;v<h.length&&r;v++){var f=h[v];r=r[f]}var g;if(g=e.is.number(r)?(r-a.fieldMin)/(a.fieldMax-a.fieldMin):0,0>g?g=0:g>1&&(g=1),s.color){var y=a.valueMin[0],m=a.valueMax[0],x=a.valueMin[1],b=a.valueMax[1],w=a.valueMin[2],_=a.valueMax[2],E=null==a.valueMin[3]?1:a.valueMin[3],S=null==a.valueMax[3]?1:a.valueMax[3],P=[Math.round(y+(m-y)*g),Math.round(x+(b-x)*g),Math.round(w+(_-w)*g),Math.round(E+(S-E)*g)];n={bypass:a.bypass,name:a.name,value:P,strValue:"rgb("+P[0]+", "+P[1]+", "+P[2]+")"}}else{if(!s.number)return!1;var k=a.valueMin+(a.valueMax-a.valueMin)*g;n=this.parse(a.name,k,a.bypass,!0)}n||(n=this.parse(a.name,u.strValue,a.bypass,!0)),n.mapping=a,a=n;break;case e.style.types.data:case e.style.types.layoutData:for(var p=a.mapped===e.style.types.layoutData,h=a.field.split("."),r=p?t._private.layoutData:t._private.data,v=0;v<h.length&&r;v++){var f=h[v];r=r[f]}if(n=this.parse(a.name,r,a.bypass,!0),!n){var C=u?u.strValue:"";n=this.parse(a.name,C,a.bypass,!0)}n.mapping=a,a=n;break;case void 0:break;default:return!1}return l?(a.bypassed=c?u.bypassed:u,o[a.name]=a):c?u.bypassed=a:o[a.name]=a,!0},e.styfn.update=function(){var e=this._private.cy,t=e.elements();t.updateStyle()},e.styfn.updateMappers=function(t){for(var i=0;i<t.length;i++){for(var r=t[i],n=r._private.style,a=0;a<e.style.properties.length;a++){var o=e.style.properties[a],s=n[o.name];if(s&&s.mapping){var l=s.mapping;this.applyParsedProperty(r,l)}}this.updateStyleHints(r)}},e.styfn.updateTransitions=function(t,i,r){var n=this,a=t._private.style,o=a["transition-property"].value,s=a["transition-duration"].msValue,l=a["transition-delay"].msValue,u={};if(o.length>0&&s>0){for(var c=!1,d=0;d<o.length;d++){var p=o[d],h=a[p],v=i[p];if(v){var f=v.prev,g=f,y=null!=v.next?v.next:h,m=!1;g&&(e.is.number(g.pxValue)&&e.is.number(y.pxValue)?m=g.pxValue!==y.pxValue:e.is.number(g.value)&&e.is.number(y.value)?m=g.value!==y.value:e.is.array(g.value)&&e.is.array(y.value)&&(m=g.value[0]!==y.value[0]||g.value[1]!==y.value[1]||g.value[2]!==y.value[2]),m&&(u[p]=y.strValue,this.applyBypass(t,p,g.strValue),c=!0))}}if(!c)return;t._private.transitioning=!0,t.stop(),l>0&&t.delay(l),t.animate({css:u},{duration:s,queue:!1,complete:function(){r||n.removeBypasses(t,o),t._private.transitioning=!1}})}else t._private.transitioning&&(t.stop(),this.removeBypasses(t,o),t._private.transitioning=!1)}}(cytoscape),function(e){"use strict";e.styfn.applyBypass=function(t,i,r,n){var a=[],o=!0;if("*"===i||"**"===i){if(void 0!==r)for(var s=0;s<e.style.properties.length;s++){var l=e.style.properties[s],i=l.name,u=this.parse(i,r,!0);
u&&a.push(u)}}else if(e.is.string(i)){var u=this.parse(i,r,!0);u&&a.push(u)}else{if(!e.is.plainObject(i))return!1;var c=i;n=r;for(var s=0;s<e.style.properties.length;s++){var l=e.style.properties[s],i=l.name,r=c[i];if(void 0===r&&(r=c[e.util.dash2camel(i)]),void 0!==r){var u=this.parse(i,r,!0);u&&a.push(u)}}}if(0===a.length)return!1;for(var d=!1,s=0;s<t.length;s++){for(var p,h=t[s],v=h._private.style,f={},g=0;g<a.length;g++){var l=a[g];if(n){var y=v[l.name];p=f[l.name]={prev:y}}d=this.applyParsedProperty(h,l)||d,n&&(p.next=v[l.name])}n&&this.updateTransitions(h,f,o)}return d},e.styfn.overrideBypass=function(t,i,r){for(var n=0;n<t.length;n++){var a=t[n],o=a._private.style[e.util.camel2dash(i)];o.bypass?(o.value=r,o.pxValue=r):this.applyBypass(a,i,r)}},e.styfn.removeAllBypasses=function(t,i){for(var r=!0,n=0;n<t.length;n++){for(var a=t[n],o={},s=a._private.style,l=0;l<e.style.properties.length;l++){var u=e.style.properties[l],c=u.name,d="",p=this.parse(c,d,!0),h=s[u.name],v=o[u.name]={prev:h};this.applyParsedProperty(a,p),v.next=s[u.name]}i&&this.updateTransitions(a,o,r)}},e.styfn.removeBypasses=function(t,i,r){for(var n=!0,a=0;a<t.length;a++){for(var o=t[a],s={},l=o._private.style,u=0;u<i.length;u++){var c=i[u],d=e.style.properties[c],p="",h=this.parse(c,p,!0),v=l[d.name],f=s[d.name]={prev:v};this.applyParsedProperty(o,h),f.next=l[d.name]}r&&this.updateTransitions(o,s,n)}}}(cytoscape),function(e,t){"use strict";e.styfn.getEmSizeInPixels=function(){var e=this._private.cy,i=e.container();if(t&&i&&t.getComputedStyle){var r=t.getComputedStyle(i).getPropertyValue("font-size"),n=parseFloat(r);return n}return 1},e.styfn.containerCss=function(e){var i=this._private.cy,r=i.container();return t&&r&&t.getComputedStyle?t.getComputedStyle(r).getPropertyValue(e):void 0},e.styfn.containerProperty=function(e){var t=this.containerCss(e),i=this.parse(e,t);return i},e.styfn.containerPropertyAsString=function(e){var t=this.containerProperty(e);return t?t.strValue:void 0}}(cytoscape,"undefined"==typeof window?null:window),function(e){"use strict";e.styfn.getRenderedStyle=function(t){var t=t[0];if(t){for(var i={},r=t._private.style,n=this._private.cy,a=n.zoom(),o=0;o<e.style.properties.length;o++){var s=e.style.properties[o],l=r[s.name];if(l){var u=l.unitless?l.strValue:l.pxValue*a+"px";i[s.name]=u,i[e.util.dash2camel(s.name)]=u}}return i}},e.styfn.getRawStyle=function(t){var t=t[0];if(t){for(var i={},r=t._private.style,n=0;n<e.style.properties.length;n++){var a=e.style.properties[n],o=r[a.name];o&&(i[a.name]=o.strValue,i[e.util.dash2camel(a.name)]=o.strValue)}return i}},e.styfn.getValueStyle=function(t,i){i=i||{};var r,n=i.array?[]:{};if(r=e.is.element(t)?t._private.style:t)for(var a=0;a<e.style.properties.length;a++){var o=e.style.properties[a],s=r[o.name]||r[e.util.dash2camel(o.name)];void 0===s||e.is.plainObject(s)||(s=this.parse(o.name,s)),s&&(i.array?n.push(s):(n[o.name]=s,n[e.util.dash2camel(o.name)]=s))}return n}}(cytoscape),function(e){"use strict";e.style.applyFromJson=function(e,t){for(var i=0;i<t.length;i++){var r=t[i],n=r.selector,a=r.css;e.selector(n);for(var o in a){var s=a[o];e.css(o,s)}}return e},e.style.fromJson=function(t,i){var r=new e.Style(t);return e.style.applyFromJson(r,i),r},e.styfn.fromJson=function(t){var i=this;return i.resetToDefault(),e.style.applyFromJson(i,t),i},e.styfn.json=function(){for(var e=[],t=0;t<this.length;t++){for(var i=this[t],r=i.selector,n=i.properties,a={},o=0;o<n.length;o++){var s=n[o];a[s.name]=s.strValue}e.push({selector:r?r.toString():"core",css:a})}return e}}(cytoscape),function(e){"use strict";e.style.applyFromString=function(t,i){function r(){l=l.length>a.length?l.substr(a.length):""}function n(){o=o.length>s.length?o.substr(s.length):""}var a,o,s,l=""+i;for(l=l.replace(/[/][*](\s|.)+?[*][/]/g,"");;){var u=l.match(/^\s*$/);if(u)break;var c=l.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!c){e.util.error("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+l);break}a=c[0];var d=c[1],p=new e.Selector(d);if(p._private.invalid)e.util.error("Skipping parsing of block: Invalid selector found in string stylesheet: "+d),r();else{var h=c[2],v=!1;o=h;for(var f=[];;){var u=o.match(/^\s*$/);if(u)break;var g=o.match(/^\s*(.+?)\s*:\s*(.+?)\s*;/);if(!g){e.util.error("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+h),v=!0;break}s=g[0];var y=g[1],m=g[2],x=e.style.properties[y];if(x){var b=t.parse(y,m);b?(f.push({name:y,val:m}),n()):(e.util.error("Skipping property: Invalid property definition in: "+s),n())}else e.util.error("Skipping property: Invalid property name in: "+s),n()}if(v){r();break}t.selector(d);for(var w=0;w<f.length;w++){var x=f[w];t.css(x.name,x.val)}r()}}return t},e.style.fromString=function(t,i){var r=new e.Style(t);return e.style.applyFromString(r,i),r},e.styfn.fromString=function(t){var i=this;return i.resetToDefault(),e.style.applyFromString(i,t),i}}(cytoscape),function(e){"use strict";e.stylesheet=e.Stylesheet=function(){return this instanceof e.Stylesheet?void(this.length=0):new e.Stylesheet},e.Stylesheet.prototype.selector=function(e){var t=this.length++;return this[t]={selector:e,properties:[]},this},e.Stylesheet.prototype.css=function(t,i){var r=this.length-1;if(e.is.string(t))this[r].properties.push({name:t,value:i});else if(e.is.plainObject(t))for(var n=t,a=0;a<e.style.properties.length;a++){var o=e.style.properties[a],s=n[o.name];if(void 0===s&&(s=n[e.util.dash2camel(o.name)]),void 0!==s){var t=o.name,i=s;this[r].properties.push({name:t,value:i})}}return this},e.Stylesheet.prototype.generateStyle=function(t){for(var i=new e.Style(t),r=0;r<this.length;r++){var n=this[r],a=n.selector,o=n.properties;i.selector(a);for(var s=0;s<o.length;s++){var l=o[s];i.css(l.name,l.value)}}return i}}(cytoscape),function(e,t){"use strict";var i=e.is.touch(),r={},n=e.util.copy(r);e.defaults=function(t){r=e.util.extend({},n,t)},e.fn.core=function(t){for(var i in t){var r=t[i];e.Core.prototype[i]=r}},e.Core=function(n){if(!(this instanceof e.Core))return new e.Core(n);var a=this;n=e.util.extend({},r,n);var o=n.container,s=o?o._cyreg:null;if(s=s||{},s&&s.cy){if(o)for(;o.firstChild;)o.removeChild(o.firstChild);s.cy.notify({type:"destroy"}),s={}}var l=s.readies=s.readies||[];o&&(o._cyreg=s),s.cy=a;var u=void 0!==t&&void 0!==o&&!n.headless,c=n;c.layout=e.util.extend({name:u?"grid":"null"},c.layout),c.renderer=e.util.extend({name:u?"canvas":"null"},c.renderer);var d=function(e,t,i){return void 0!==t?t:void 0!==i?i:e},p=this._private={container:c.container,ready:!1,initrender:!1,options:c,elements:[],id2index:{},listeners:[],aniEles:e.Collection(this),scratch:{},layout:null,renderer:null,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:d(!0,c.zoomingEnabled),userZoomingEnabled:d(!0,c.userZoomingEnabled),panningEnabled:d(!0,c.panningEnabled),userPanningEnabled:d(!0,c.userPanningEnabled),boxSelectionEnabled:d(!0,c.boxSelectionEnabled),autolock:d(!1,c.autolock,c.autolockNodes),autoungrabify:d(!1,c.autoungrabify,c.autoungrabifyNodes),autounselectify:d(!1,c.autounselectify),styleEnabled:void 0===c.styleEnabled?u:c.styleEnabled,zoom:e.is.number(c.zoom)?c.zoom:1,pan:{x:e.is.plainObject(c.pan)&&e.is.number(c.pan.x)?c.pan.x:0,y:e.is.plainObject(c.pan)&&e.is.number(c.pan.y)?c.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,deferredExecQueue:[]},h=c.selectionType;p.selectionType=void 0===h||"additive"!==h&&"single"!==h?i?"additive":"single":h,e.is.number(c.minZoom)&&e.is.number(c.maxZoom)&&c.minZoom<c.maxZoom?(p.minZoom=c.minZoom,p.maxZoom=c.maxZoom):e.is.number(c.minZoom)&&void 0===c.maxZoom?p.minZoom=c.minZoom:e.is.number(c.maxZoom)&&void 0===c.minZoom&&(p.maxZoom=c.maxZoom),p.styleEnabled&&this.setStyle(c.style),a.initRenderer(e.util.extend({hideEdgesOnViewport:c.hideEdgesOnViewport,hideLabelsOnViewport:c.hideLabelsOnViewport,textureOnViewport:c.textureOnViewport,wheelSensitivity:e.is.number(c.wheelSensitivity)&&c.wheelSensitivity>0?c.wheelSensitivity:1,motionBlur:c.motionBlur,pixelRatio:e.is.number(c.pixelRatio)&&c.pixelRatio>0?c.pixelRatio:"auto"===c.pixelRatio?void 0:1},c.renderer)),c.initrender&&(a.on("initrender",c.initrender),a.on("initrender",function(){a._private.initrender=!0})),a.load(c.elements,function(){a.startAnimationLoop(),a._private.ready=!0,e.is.fn(c.ready)&&a.on("ready",c.ready);for(var t=0;t<l.length;t++){var i=l[t];a.on("ready",i)}s&&(s.readies=[]),a.trigger("ready")},c.done)},e.corefn=e.Core.prototype,e.fn.core({isReady:function(){return this._private.ready},ready:function(e){this.isReady()?this.trigger("ready",[],e):this.on("ready",e)},initrender:function(){return this._private.initrender},destroy:function(){this.notify({type:"destroy"});var e=this.container(),t=e.parentNode;return t&&t.removeChild(e),this},getElementById:function(t){var i=this._private.id2index[t];return void 0!==i?this._private.elements[i]:new e.Collection(this)},selectionType:function(){return this._private.selectionType},hasCompoundNodes:function(){return this._private.hasCompoundNodes},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){for(var t=this._private.elements,i=this._private.id2index,r=0;r<e.length;r++){var n=e[r],a=n._private.data.id,o=i[a],s=void 0!==o;s||(o=t.length,t.push(n),i[a]=o,n._private.index=o)}return this},removeFromPool:function(e){for(var t=this._private.elements,i=this._private.id2index,r=0;r<e.length;r++){var n=e[r],a=n._private.data.id,o=i[a],s=void 0!==o;if(s){this._private.id2index[a]=void 0,t.splice(o,1);for(var l=o;l<t.length;l++){var u=t[l]._private.data.id;i[u]--}}}},container:function(){return this._private.container},options:function(){return e.util.copy(this._private.options)},json:function(){var e={},t=this;return e.elements={},t.elements().each(function(t,i){var r=i.group();e.elements[r]||(e.elements[r]=[]),e.elements[r].push(i.json())}),this._private.styleEnabled&&(e.style=t.style().json()),e.zoomingEnabled=t._private.zoomingEnabled,e.userZoomingEnabled=t._private.userZoomingEnabled,e.zoom=t._private.zoom,e.minZoom=t._private.minZoom,e.maxZoom=t._private.maxZoom,e.panningEnabled=t._private.panningEnabled,e.userPanningEnabled=t._private.userPanningEnabled,e.pan=t._private.pan,e.boxSelectionEnabled=t._private.boxSelectionEnabled,e.layout=t._private.options.layout,e.renderer=t._private.options.renderer,e.hideEdgesOnViewport=t._private.options.hideEdgesOnViewport,e.hideLabelsOnViewport=t._private.options.hideLabelsOnViewport,e.textureOnViewport=t._private.options.textureOnViewport,e.wheelSensitivity=t._private.options.wheelSensitivity,e.motionBlur=t._private.options.motionBlur,e},defer:function(e){var t=this,i=t._private,r=i.deferredExecQueue;r.push(e),i.deferredTimeout||(i.deferredTimeout=setTimeout(function(){for(;r.length>0;)r.shift()();i.deferredTimeout=null},0))}})}(cytoscape,"undefined"==typeof window?null:window),function(e,t){"use strict";function i(e){var t=!document||"interactive"!==document.readyState&&"complete"!==document.readyState?i:e;setTimeout(t,9,e)}e.fn.core({add:function(t){var i,r=this;if(e.is.elementOrCollection(t)){var n=t;if(n._private.cy===r)i=n.restore();else{for(var a=[],o=0;o<n.length;o++){var s=n[o];a.push(s.json())}i=new e.Collection(r,a)}}else if(e.is.array(t)){var a=t;i=new e.Collection(r,a)}else if(e.is.plainObject(t)&&(e.is.array(t.nodes)||e.is.array(t.edges))){for(var l=t,a=[],u=["nodes","edges"],o=0,c=u.length;c>o;o++){var d=u[o],p=l[d];if(e.is.array(p))for(var h=0,v=p.length;v>h;h++){var f=p[h];f.group=d,a.push(f)}}i=new e.Collection(r,a)}else{var f=t;i=new e.Element(r,f).collection()}return i},remove:function(t){if(e.is.elementOrCollection(t))t=t;else if(e.is.string(t)){var i=t;t=this.$(i)}return t.remove()},load:function(r,n,a){function o(){s.one("layoutready",function(e){s.notifications(!0),s.trigger(e),s.notify({type:"load",collection:s.elements()}),s.one("load",n),s.trigger("load")}).one("layoutstop",function(){s.one("done",a),s.trigger("done")});var t=e.util.extend({},s._private.options.layout);t.eles=s.$(),s.layout(t)}var s=this,l=s.elements();return l.length>0&&l.remove(),s.notifications(!1),null!=r&&(e.is.plainObject(r)||e.is.array(r))&&s.add(r),t?i(o):o(),this}})}(cytoscape,"undefined"==typeof window?null:window),function(e,t){"use strict";e.fn.core({animated:e.define.animated(),clearQueue:e.define.clearQueue(),delay:e.define.delay(),animate:e.define.animate(),stop:e.define.stop(),addToAnimationPool:function(e){var t=this;t.styleEnabled()&&t._private.aniEles.merge(e)},startAnimationLoop:function(){function i(){e.util.requestAnimationFrame(function(e){r(e),i()})}function r(t){function i(i,r){var s=i._private.animation.current,l=i._private.animation.queue,u=!1;if(0===s.length){var c=l.length>0?l.shift():null;c&&(c.callTime=t,s.push(c))}for(var d=[],p=s.length-1;p>=0;p--){var h=s[p];h.started||n(i,h),a(i,h,t,r),h.done&&(d.push(h),s.splice(p,1)),u=!0}for(var p=0;p<d.length;p++){var h=d[p],v=h.params.complete;e.is.fn(v)&&v.apply(i,[t])}return r||0!==s.length||0!==l.length||o.push(i),u}t=+new Date;for(var r=l._private.aniEles,o=[],s=0;s<r.length;s++){var u=r[s];i(u)}var c=i(l,!0);if(r.length>0||c){var d;if(r.length>0){var p=r.updateCompoundBounds();d=p.length>0?r.add(p):r}l.notify({type:"draw",collection:d})}r.unmerge(o)}function n(t,i){var r=e.is.core(t),n=!r,a=t,o=l._private.style;if(n)var s=a._private.position,u={x:s.x,y:s.y},c=o.getValueStyle(a);if(r)var d=l._private.pan,p={x:d.x,y:d.y},h=l._private.zoom;i.started=!0,i.startTime=Date.now(),i.startPosition=u,i.startStyle=c,i.startPan=p,i.startZoom=h}function a(t,i,r,n){var a,u=l._private.style,c=i.properties,d=i.params,p=i.startTime,h=!n;if(a=0===i.duration?1:Math.min(1,(r-p)/i.duration),0>a?a=0:a>1&&(a=1),null==c.delay){var v=i.startPosition,f=c.position,g=t._private.position;f&&h&&(o(v.x,f.x)&&(g.x=s(v.x,f.x,a)),o(v.y,f.y)&&(g.y=s(v.y,f.y,a)));var y=i.startPan,m=c.pan,x=t._private.pan,b=null!=m&&n;b&&(o(y.x,m.x)&&(x.x=s(y.x,m.x,a)),o(y.y,m.y)&&(x.y=s(y.y,m.y,a)),t.trigger("pan"));var w=i.startZoom,_=c.zoom,E=null!=_&&n;if(E&&(o(w,_)&&(t._private.zoom=s(w,_,a)),t.trigger("zoom")),(b||E)&&t.trigger("viewport"),c.css&&h)for(var S=c.css,P=0;P<S.length;P++){var k=S[P].name,C=S[P],D=C,N=i.startStyle[k],T=s(N,D,a);u.overrideBypass(t,k,T)}}return e.is.fn(d.step)&&d.step.apply(t,[r]),a>=1&&(i.done=!0),a}function o(t,i){return null==t||null==i?!1:e.is.number(t)&&e.is.number(i)?!0:t&&i?!0:!1}function s(t,i,r){0>r?r=0:r>1&&(r=1);var n,a;if(n=null!=t.pxValue||null!=t.value?null!=t.pxValue?t.pxValue:t.value:t,a=null!=i.pxValue||null!=i.value?null!=i.pxValue?i.pxValue:i.value:i,e.is.number(n)&&e.is.number(a))return n+(a-n)*r;if(e.is.number(n[0])&&e.is.number(a[0])){var o=n,s=a,l=function(e,t){var i=t-e,n=e;return Math.round(r*i+n)},u=l(o[0],s[0]),c=l(o[1],s[1]),d=l(o[2],s[2]);return[u,c,d]}return void 0}var l=this;l.styleEnabled()&&t&&i()}})}(cytoscape,"undefined"==typeof window?null:window),function(e){"use strict";e.fn.core({data:e.define.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0}),removeData:e.define.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0}),scratch:e.define.data({field:"scratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeScratch:e.define.removeData({field:"scratch",triggerEvent:!1})})}(cytoscape),function(e){"use strict";e.fn.core({on:e.define.on(),one:e.define.on({unbindSelfOnTrigger:!0}),once:e.define.on({unbindAllBindersOnTrigger:!0}),off:e.define.off(),trigger:e.define.trigger()}),e.corefn.bind=e.corefn.on,e.corefn.unbind=e.corefn.off}(cytoscape),function(e){"use strict";e.fn.core({png:function(e){var t=this._private.renderer;return e=e||{},t.png(e)}})}(cytoscape),function(e){"use strict";e.fn.core({layout:function(e){var t=this._private.prevLayout=null==e?this._private.prevLayout:this.initLayout(e);return t.run(),this},makeLayout:function(e){return this.initLayout(e)},initLayout:function(t){if(null==t)return void e.util.error("Layout options must be specified to make a layout");if(null==t.name)return void e.util.error("A `name` must be specified to make a layout");var i=t.name,r=e.extension("layout",i);if(null==r)return void e.util.error("Can not apply layout: No such layout `"+i+"` found; did you include its JS file?");t.eles=null!=t.eles?t.eles:this.$(),e.is.string(t.eles)&&(t.eles=this.$(t.eles));var n=new r(e.util.extend({},t,{cy:this}));return e.is.plainObject(n._private)||(n._private={}),n._private.cy=this,n._private.listeners=[],n}})}(cytoscape),function(e){"use strict";e.fn.core({notify:function(e){if(this._private.batchingNotify){var t=this._private.batchNotifyEles,i=this._private.batchNotifyTypes;if(e.collection)for(var r=0;r<e.collection.length;r++){var n=e.collection[r];t.ids[n._private.id]||t.push(n)}return void(i.ids[e.type]||i.push(e.type))}if(this._private.notificationsEnabled){var a=this.renderer();a.notify(e)}},notifications:function(e){var t=this._private;return void 0===e?t.notificationsEnabled:void(t.notificationsEnabled=e?!0:!1)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},startBatch:function(){var e=this._private;return e.batchingStyle=e.batchingNotify=!0,e.batchStyleEles=[],e.batchNotifyEles=[],e.batchNotifyTypes=[],e.batchStyleEles.ids={},e.batchNotifyEles.ids={},e.batchNotifyTypes.ids={},this},endBatch:function(){var t=this._private;return t.batchingStyle=!1,new e.Collection(this,t.batchStyleEles).updateStyle(),t.batchingNotify=!1,this.notify({type:t.batchNotifyTypes,collection:t.batchNotifyEles}),this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch(function(){for(var i in e){var r=e[i],n=t.getElementById(i);n.data(r)}})}})}(cytoscape),function(e){"use strict";e.fn.core({renderTo:function(e,t,i,r){var n=this._private.renderer;return n.renderTo(e,t,i,r),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify({type:"draw"}),this},resize:function(){return this.notify({type:"resize"}),this.trigger("resize"),this},initRenderer:function(t){var i=this,r=e.extension("renderer",t.name);return null==r?void e.util.error("Can not initialise: No such renderer `%s` found; did you include its JS file?",t.name):void(this._private.renderer=new r(e.util.extend({},t,{cy:i,style:i._private.style})))}})}(cytoscape),function(e){"use strict";e.fn.core({collection:function(t){return e.is.string(t)?this.$(t):e.is.elementOrCollection(t)?t.collection():e.is.array(t)?new e.Collection(this,t):new e.Collection(this)},nodes:function(e){var t=this.$(function(){return this.isNode()});return e?t.filter(e):t},edges:function(e){var t=this.$(function(){return this.isEdge()});return e?t.filter(e):t},$:function(t){var i=new e.Collection(this,this._private.elements);return t?i.filter(t):i}}),e.corefn.elements=e.corefn.filter=e.corefn.$}(cytoscape),function(e){"use strict";e.fn.core({style:function(e){if(e){var t=this.setStyle(e);t.update()}return this._private.style},setStyle:function(t){var i=this._private;return i.style=e.is.stylesheet(t)?t.generateStyle(this):e.is.array(t)?e.style.fromJson(this,t):e.is.string(t)?e.style.fromString(this,t):new e.Style(this),i.style}})}(cytoscape),function(e){"use strict";e.fn.core({autolock:function(e){return void 0===e?this._private.autolock:(this._private.autolock=e?!0:!1,this)},autoungrabify:function(e){return void 0===e?this._private.autoungrabify:(this._private.autoungrabify=e?!0:!1,this)},autounselectify:function(e){return void 0===e?this._private.autounselectify:(this._private.autounselectify=e?!0:!1,this)},panningEnabled:function(e){return void 0===e?this._private.panningEnabled:(this._private.panningEnabled=e?!0:!1,this)},userPanningEnabled:function(e){return void 0===e?this._private.userPanningEnabled:(this._private.userPanningEnabled=e?!0:!1,this)},zoomingEnabled:function(e){return void 0===e?this._private.zoomingEnabled:(this._private.zoomingEnabled=e?!0:!1,this)},userZoomingEnabled:function(e){return void 0===e?this._private.userZoomingEnabled:(this._private.userZoomingEnabled=e?!0:!1,this)},boxSelectionEnabled:function(e){return void 0===e?this._private.boxSelectionEnabled:(this._private.boxSelectionEnabled=e?!0:!1,this)},pan:function(){var t,i,r,n,a,o=arguments,s=this._private.pan;switch(o.length){case 0:return s;case 1:if(e.is.string(o[0]))return t=o[0],s[t];if(e.is.plainObject(o[0])){if(!this._private.panningEnabled)return this;r=o[0],n=r.x,a=r.y,e.is.number(n)&&(s.x=n),e.is.number(a)&&(s.y=a),this.trigger("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;t=o[0],i=o[1],"x"!==t&&"y"!==t||!e.is.number(i)||(s[t]=i),this.trigger("pan viewport")}return this.notify({type:"viewport"}),this},panBy:function(){var t,i,r,n,a,o=arguments,s=this._private.pan;if(!this._private.panningEnabled)return this;switch(o.length){case 1:e.is.plainObject(o[0])&&(r=o[0],n=r.x,a=r.y,e.is.number(n)&&(s.x+=n),e.is.number(a)&&(s.y+=a),this.trigger("pan viewport"));break;case 2:t=o[0],i=o[1],"x"!==t&&"y"!==t||!e.is.number(i)||(s[t]+=i),this.trigger("pan viewport")}return this.notify({type:"viewport"}),this},fit:function(e,t){var i=this.getFitViewport(e,t);if(i){var r=this._private;r.zoom=i.zoom,r.pan=i.pan,this.trigger("pan zoom viewport"),this.notify({type:"viewport"})}return this},getFitViewport:function(t,i){if(e.is.number(t)&&void 0===i&&(i=t,t=void 0),this._private.panningEnabled&&this._private.zoomingEnabled){var r;if(e.is.string(t)){var n=t;t=this.$(n)}else if(e.is.boundingBox(t)){var a=t;r={x1:a.x1,y1:a.y1,x2:a.x2,y2:a.y2},r.w=r.x2-r.x1,r.h=r.y2-r.y1}else e.is.elementOrCollection(t)||(t=this.elements());r=r||t.boundingBox();var o,s=this.width(),l=this.height();if(i=e.is.number(i)?i:0,!isNaN(s)&&!isNaN(l)&&s>0&&l>0&&!isNaN(r.w)&&!isNaN(r.h)&&r.w>0&&r.h>0){o=Math.min((s-2*i)/r.w,(l-2*i)/r.h),o=o>this._private.maxZoom?this._private.maxZoom:o,o=o<this._private.minZoom?this._private.minZoom:o;var u={x:(s-o*(r.x1+r.x2))/2,y:(l-o*(r.y1+r.y2))/2};return{zoom:o,pan:u}}}},minZoom:function(t){return void 0===t?this._private.minZoom:(e.is.number(t)&&(this._private.minZoom=t),this)},maxZoom:function(t){return void 0===t?this._private.maxZoom:(e.is.number(t)&&(this._private.maxZoom=t),this)},zoom:function(t){var i,r;if(void 0===t)return this._private.zoom;if(e.is.number(t))r=t;else if(e.is.plainObject(t)){if(r=t.level,t.position){var n=t.position,a=this._private.pan,o=this._private.zoom;i={x:n.x*o+a.x,y:n.y*o+a.y}}else t.renderedPosition&&(i=t.renderedPosition);if(i&&!this._private.panningEnabled)return this}if(!this._private.zoomingEnabled)return this;if(!e.is.number(r)||i&&(!e.is.number(i.x)||!e.is.number(i.y)))return this;if(r=r>this._private.maxZoom?this._private.maxZoom:r,r=r<this._private.minZoom?this._private.minZoom:r,i){var s=this._private.pan,l=this._private.zoom,u=r,c={x:-u/l*(i.x-s.x)+i.x,y:-u/l*(i.y-s.y)+i.y};this._private.zoom=r,this._private.pan=c;var d=s.x!==c.x||s.y!==c.y;this.trigger(" zoom "+(d?" pan ":"")+" viewport ")}else this._private.zoom=r,this.trigger("zoom viewport");return this.notify({type:"viewport"}),this},viewport:function(t){var i=this._private,r=!0,n=!0,a=[],o=!1,s=!1;if(!t)return this;if(e.is.number(t.zoom)||(r=!1),e.is.plainObject(t.pan)||(n=!1),!r&&!n)return this;if(r){var l=t.zoom;l<i.minZoom||l>i.maxZoom||!i.zoomingEnabled?o=!0:(i.zoom=l,a.push("zoom"))}if(n&&(!o||!t.cancelOnFailedZoom)&&i.panningEnabled){var u=t.pan;e.is.number(u.x)&&(i.pan.x=u.x,s=!1),e.is.number(u.y)&&(i.pan.y=u.y,s=!1),s||a.push("pan")}return a.length>0&&(a.push("viewport"),this.trigger(a.join(" ")),this.notify({type:"viewport"})),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.trigger("pan viewport"),this.notify({type:"viewport"})),this},getCenterPan:function(t){if(this._private.panningEnabled){if(e.is.string(t)){var i=t;t=this.elements(i)}else e.is.elementOrCollection(t)||(t=this.elements());var r=t.boundingBox(),n=this.width(),a=this.height(),o=this._private.zoom,s={x:(n-o*(r.x1+r.x2))/2,y:(a-o*(r.y1+r.y2))/2};return s}},reset:function(){return this._private.panningEnabled&&this._private.zoomingEnabled?(this.viewport({pan:{x:0,y:0},zoom:1}),this):this},width:function(){var e=this._private.container;return e?e.clientWidth:1},height:function(){var e=this._private.container;return e?e.clientHeight:1},extent:function(){var e=this._private.pan,t=this._private.zoom,i=this.renderedExtent(),r={x1:(i.x1-e.x)/t,x2:(i.x2-e.x)/t,y1:(i.y1-e.y)/t,y2:(i.y2-e.y)/t};return r.w=r.x2-r.x1,r.h=r.y2-r.y1,r},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}}}),e.corefn.centre=e.corefn.center,e.corefn.autolockNodes=e.corefn.autolock,e.corefn.autoungrabifyNodes=e.corefn.autoungrabifyNodes}(cytoscape),function(e){"use strict";e.fn.collection=e.fn.eles=function(t){for(var i in t){var r=t[i];e.Collection.prototype[i]=r}};var t={prefix:{nodes:"n",edges:"e"},id:{nodes:0,edges:0},generate:function(t,i,r){var n=e.is.element(i)?i._private:i,a=n.group,o=null!=r?r:this.prefix[a]+this.id[a];if(t.getElementById(o).empty())this.id[a]++;else for(;!t.getElementById(o).empty();)o=this.prefix[a]+ ++this.id[a];return o}};e.Element=function(t,i,r){if(!(this instanceof e.Element))return new e.Element(t,i,r);var n=this;if(r=void 0===r||r?!0:!1,void 0===t||void 0===i||!e.is.core(t))return void e.util.error("An element must have a core reference and parameters set");if("nodes"!==i.group&&"edges"!==i.group)return void e.util.error("An element must be of type `nodes` or `edges`; you specified `"+i.group+"`");if(this.length=1,this[0]=this,this._private={cy:t,single:!0,data:i.data||{},layoutData:{},position:i.position||{},autoWidth:void 0,autoHeight:void 0,listeners:[],group:i.group,style:{},rstyle:{},styleCxts:[],removed:!0,selected:i.selected?!0:!1,selectable:void 0===i.selectable?!0:i.selectable?!0:!1,locked:i.locked?!0:!1,grabbed:!1,grabbable:void 0===i.grabbable?!0:i.grabbable?!0:!1,active:!1,classes:{},animation:{current:[],queue:[]},rscratch:{},scratch:{},edges:[],children:[]},i.renderedPosition){var a=i.renderedPosition,o=t.pan(),s=t.zoom();this._private.position={x:(a.x-o.x)/s,y:(a.y-o.y)/s}}if(e.is.string(i.classes))for(var l=i.classes.split(/\s+/),u=0,c=l.length;c>u;u++){var d=l[u];d&&""!==d&&(n._private.classes[d]=!0)}i.css&&t.style().applyBypass(this,i.css),(void 0===r||r)&&this.restore()},e.Collection=function(i,r,n){if(!(this instanceof e.Collection))return new e.Collection(i,r);if(void 0===i||!e.is.core(i))return void e.util.error("A collection must have a reference to the core");var a={},o={},s=!1;if(r){if(r.length>0&&e.is.plainObject(r[0])&&!e.is.element(r[0])){s=!0;for(var l=[],u={},c=0,d=r.length;d>c;c++){var p=r[c];null==p.data&&(p.data={});var h=p.data;if(null==h.id)h.id=t.generate(i,p);else if(0!==i.getElementById(h.id).length||u[h.id])continue;var v=new e.Element(i,p,!1);l.push(v),u[h.id]=!0}r=l}}else r=[];this.length=0;for(var c=0,d=r.length;d>c;c++){var f=r[c];if(f){var g=f._private.data.id;(!n||n.unique&&!a[g])&&(a[g]=f,o[g]=this.length,this[this.length]=f,this.length++)}}this._private={cy:i,ids:a,indexes:o},s&&this.restore()},e.elefn=e.elesfn=e.Element.prototype=e.Collection.prototype,e.elesfn.cy=function(){return this._private.cy},e.elesfn.element=function(){return this[0]},e.elesfn.collection=function(){return e.is.collection(this)?this:new e.Collection(this._private.cy,[this])},e.elesfn.unique=function(){return new e.Collection(this._private.cy,this,{unique:!0})},e.elesfn.getElementById=function(t){var i=this._private.cy,r=this._private.ids[t];return r?r:e.Collection(i)},e.elesfn.json=function(){var t=this.element();if(null==t)return void 0;var i=t._private,r=e.util.copy({data:i.data,position:i.position,group:i.group,bypass:i.bypass,removed:i.removed,selected:i.selected,selectable:i.selectable,locked:i.locked,grabbed:i.grabbed,grabbable:i.grabbable,classes:""}),n=[];for(var a in i.classes)i.classes[a]&&n.push(a);for(var o=0;o<n.length;o++){var a=n[o];r.classes+=a+(o<n.length-1?" ":"")}return r},e.elesfn.jsons=function(){for(var e=[],t=0;t<this.length;t++){var i=this[t],r=i.json();e.push(r)}return e},e.elesfn.clone=function(){for(var t=this.cy(),i=[],r=0;r<this.length;r++){var n=this[r],a=n.json(),o=new e.Element(t,a,!1);i.push(o)}return new e.Collection(t,i)},e.elesfn.restore=function(i){var r=this,n=[],a=r.cy();void 0===i&&(i=!0);for(var o=[],s=[],l=[],u=0,c=0,d=0,p=r.length;p>d;d++){var h=r[d];h.isNode()?(s.push(h),u++):(l.push(h),c++)}o=s.concat(l);for(var d=0,p=o.length;p>d;d++){var h=o[d];if(h.removed()){var v=h._private,f=v.data;if(void 0===f.id)f.id=t.generate(a,h);else{if(e.is.emptyString(f.id)||!e.is.string(f.id)){e.util.error("Can not create element with invalid string ID `"+f.id+"`");continue}if(0!==a.getElementById(f.id).length){e.util.error("Can not create second element with ID `"+f.id+"`");continue}}var g=f.id;if(h.isEdge()){for(var y=h,m=["source","target"],x=m.length,b=!1,w=0;x>w;w++){var _=m[w],E=f[_];null==E||""===E?(e.util.error("Can not create edge `"+g+"` with unspecified "+_),b=!0):a.getElementById(E).empty()&&(e.util.error("Can not create edge `"+g+"` with nonexistant "+_+" `"+E+"`"),b=!0)}if(b)continue;var S=a.getElementById(f.source),P=a.getElementById(f.target);S._private.edges.push(y),P._private.edges.push(y),y._private.source=S,y._private.target=P}v.ids={},v.ids[g]=h,v.removed=!1,a.addToPool(h),n.push(h)}}for(var d=0;u>d;d++){var k=o[d],f=k._private.data,C=k._private.data.parent,D=null!=C;if(D){var N=a.getElementById(C);if(N.empty())f.parent=void 0;else{for(var T=!1,M=N;!M.empty();){if(k.same(M)){T=!0,f.parent=void 0;break}M=M.parent()}T||(N[0]._private.children.push(k),k._private.parent=N[0],a._private.hasCompoundNodes=!0)}}}if(n=new e.Collection(a,n),n.length>0){var B=n.add(n.connectedNodes()).add(n.parent());B.updateStyle(i),i?n.rtrigger("add"):n.trigger("add")}return r},e.elesfn.removed=function(){var e=this[0];return e&&e._private.removed},e.elesfn.inside=function(){var e=this[0];return e&&!e._private.removed},e.elesfn.remove=function(t){function i(e){for(var t=e._private.edges,i=0;i<t.length;i++)n(t[i])}function r(e){for(var t=e._private.children,i=0;i<t.length;i++)n(t[i])}function n(e){var t=c[e.id()];t||(c[e.id()]=!0,e.isNode()?(u.push(e),i(e),r(e)):u.unshift(e))}function a(e,t){for(var i=e._private.edges,r=0;r<i.length;r++){var n=i[r];if(t===n){i.splice(r,1);break}}}function o(e,t){t=t[0],e=e[0];for(var i=e._private.children,r=0;r<i.length;r++)if(i[r][0]===t[0]){i.splice(r,1);break}}var s=this,l=[],u=[],c={},d=s._private.cy;void 0===t&&(t=!0);for(var p=0,h=s.length;h>p;p++){var v=s[p];n(v)}for(var p=0;p<u.length;p++){var v=u[p];if(v._private.removed=!0,d.removeFromPool(v),l.push(v),v.isEdge()){var f=v.source()[0],g=v.target()[0];a(f,v),a(g,v)}else{var y=v.parent();0!==y.length&&o(y,v)}}var m=d._private.elements;d._private.hasCompoundNodes=!1;for(var p=0;p<m.length;p++){var v=m[p];if(v.isParent()){d._private.hasCompoundNodes=!0;break}}var x=new e.Collection(this.cy(),l);x.size()>0&&(t&&this.cy().notify({type:"remove",collection:x}),x.trigger("remove"));for(var b={},p=0;p<u.length;p++){var v=u[p],w="nodes"===v._private.group,_=v._private.data.parent;if(w&&void 0!==_&&!b[_]){b[_]=!0;var y=d.getElementById(_);y&&0!==y.length&&!y._private.removed&&0===y.children().length&&y.updateStyle()}}return this},e.elesfn.move=function(e){var t=this._private.cy;if(void 0!==e.source||void 0!==e.target){var i=e.source,r=e.target,n=t.getElementById(i).length>0,a=t.getElementById(r).length>0;if(n||a){var o=this.jsons();this.remove();for(var s=0;s<o.length;s++){var l=o[s];"edges"===l.group&&(n&&(l.data.source=i),a&&(l.data.target=r))}return t.add(o)}}else if(void 0!==e.parent){var u=e.parent,c=null===e.parent||t.getElementById(u).length>0;if(c){var o=this.jsons();this.remove();for(var s=0;s<this.length;s++){var l=o[s];"nodes"===l.group&&(l.data.parent=null===u?void 0:u)
}}return t.add(o)}return this}}(cytoscape),function(e){"use strict";e.fn.eles({stdBreadthFirstSearch:function(t){return t=e.util.extend({},t,{std:!0}),this.breadthFirstSearch(t)},breadthFirstSearch:function(t,i,r){var n,a,o;e.is.plainObject(t)&&!e.is.elementOrCollection(t)&&(n=t,t=n.roots,i=n.visit,r=n.directed,a=n.std,o=n.thisArg),r=2!==arguments.length||e.is.fn(i)?r:i,i=e.is.fn(i)?i:function(){};for(var s,l=this._private.cy,u=e.is.string(t)?this.filter(t):t,c=[],d=[],p={},h={},v={},f=0,g=this.nodes(),y=this.edges(),m=0;m<u.length;m++)u[m].isNode()&&(c.unshift(u[m]),v[u[m].id()]=!0,d.push(u[m]),h[u[m].id()]=0);for(;0!==c.length;){var x,u=c.shift(),b=h[u.id()],w=p[u.id()],_=null==w?void 0:w.connectedNodes().not(u)[0];if(x=a?i.call(o,u,w,_,f++,b):i.call(u,f++,b,u,w,_),x===!0){s=u;break}if(x===!1)break;for(var E=u.connectedEdges(r?function(){return this.data("source")===u.id()}:void 0).intersect(y),m=0;m<E.length;m++){var S=E[m],P=S.connectedNodes(function(){return this.id()!==u.id()}).intersect(g);0===P.length||v[P.id()]||(P=P[0],c.push(P),v[P.id()]=!0,h[P.id()]=h[u.id()]+1,d.push(P),p[P.id()]=S)}}for(var k=[],m=0;m<d.length;m++){var C=d[m],D=p[C.id()];D&&k.push(D),k.push(C)}return{path:new e.Collection(l,k,{unique:!0}),found:new e.Collection(l,s,{unique:!0})}},stdDepthFirstSearch:function(t){return t=e.util.extend({},t,{std:!0}),this.depthFirstSearch(t)},depthFirstSearch:function(t,i,r){var n,a,o;e.is.plainObject(t)&&!e.is.elementOrCollection(t)&&(n=t,t=n.roots,i=n.visit,r=n.directed,a=n.std,o=n.thisArg),r=2!==arguments.length||e.is.fn(i)?r:i,i=e.is.fn(i)?i:function(){};for(var s,l=this._private.cy,u=e.is.string(t)?this.filter(t):t,c=[],d=[],p={},h={},v={},f=0,g=this.edges(),y=this.nodes(),m=0;m<u.length;m++)u[m].isNode()&&(c.push(u[m]),d.push(u[m]),h[u[m].id()]=0);for(;0!==c.length;){var u=c.pop();if(!v[u.id()]){v[u.id()]=!0;var x,b=h[u.id()],w=p[u.id()],_=null==w?void 0:w.connectedNodes().not(u)[0];if(x=a?i.call(o,u,w,_,f++,b):i.call(u,f++,b,u,w,_),x===!0){s=u;break}if(x===!1)break;for(var E=u.connectedEdges(r?function(){return this.data("source")===u.id()}:void 0).intersect(g),m=0;m<E.length;m++){var S=E[m],P=S.connectedNodes(function(){return this.id()!==u.id()}).intersect(y);0===P.length||v[P.id()]||(P=P[0],c.push(P),h[P.id()]=h[u.id()]+1,d.push(P),p[P.id()]=S)}}}for(var k=[],m=0;m<d.length;m++){var C=d[m],D=p[C.id()];D&&k.push(D),k.push(C)}return{path:new e.Collection(l,k,{unique:!0}),found:new e.Collection(l,s,{unique:!0})}},kruskal:function(t){function i(e){for(var t=0;t<n.length;t++){var i=n[t];if(i.anySame(e))return{eles:i,index:t}}}t=e.is.fn(t)?t:function(){return 1};for(var r=new e.Collection(this._private.cy,[]),n=[],a=this.nodes(),o=0;o<a.length;o++)n.push(a[o].collection());for(var s=this.edges(),l=s.toArray().sort(function(e,i){var r=t.call(e,e),n=t.call(i,i);return r-n}),o=0;o<l.length;o++){var u=l[o],c=u.source()[0],d=u.target()[0],p=i(c),h=i(d);p.index!==h.index&&(r=r.add(u),n[p.index]=p.eles.add(h.eles),n.splice(h.index,1))}return a.add(r)},dijkstra:function(t,i,r){var n;e.is.plainObject(t)&&!e.is.elementOrCollection(t)&&(n=t,t=n.root,i=n.weight,r=n.directed);var a=this._private.cy;r=e.is.fn(i)?r:i,i=e.is.fn(i)?i:function(){return 1};for(var o=e.is.string(t)?this.filter(t).eq(0):t.eq(0),s={},l={},u={},c=this.edges().filter(function(){return!this.isLoop()}),d=this.nodes(),p=[],h=0;h<d.length;h++)s[d[h].id()]=d[h].same(o)?0:1/0,p.push(d[h]);var v=function(e){return s[e.id()]};p=new e.Collection(a,p);for(var f=e.Minheap(a,p,v),g=function(e,t){for(var n,a=(r?e.edgesTo(t):e.edgesWith(t)).intersect(c),o=1/0,s=0;s<a.length;s++){var l=a[s],u=i.apply(l,[l]);(o>u||!n)&&(o=u,n=l)}return{edge:n,dist:o}};f.size()>0;){var y=f.pop(),m=y.value,x=y.id,b=a.getElementById(x);if(u[x]=m,m===Math.Infinite)break;for(var w=b.neighborhood().intersect(d),h=0;h<w.length;h++){var _=w[h],E=_.id(),S=g(b,_),P=m+S.dist;P<f.getValueById(E)&&(f.edit(E,P),l[E]={node:b,edge:S.edge})}}return{distanceTo:function(t){var i=e.is.string(t)?d.filter(t).eq(0):t.eq(0);return u[i.id()]},pathTo:function(t){var i=e.is.string(t)?d.filter(t).eq(0):t.eq(0),r=[],n=i;if(i.length>0)for(r.unshift(i);l[n.id()];){var o=l[n.id()];r.unshift(o.edge),r.unshift(o.node),n=o.node}return new e.Collection(a,r)}}}}),e.elesfn.bfs=e.elesfn.breadthFirstSearch,e.elesfn.dfs=e.elesfn.depthFirstSearch,e.elesfn.stdBfs=e.elesfn.stdBreadthFirstSearch,e.elesfn.stdDfs=e.elesfn.stdDepthFirstSearch}(cytoscape),function(e){"use strict";e.fn.eles({aStar:function(t){t=t||{};var i=function(){a&&console.log.apply(console,arguments)},r=function(e,t,i,n){if(e==t)return n.push(o.getElementById(t)),n;if(t in i){var a=i[t],s=f[t];return n.push(o.getElementById(t)),n.push(o.getElementById(s)),r(e,a,i,n)}return void 0},n=function(e,t){if(0===e.length)return void 0;for(var i=0,r=t[e[0]],n=1;n<e.length;n++){var a=t[e[n]];r>a&&(r=a,i=n)}return i};if(null!=t.debug)var a=t.debug;else var a=!1;i("Starting aStar...");var o=this._private.cy;if(null==t||null==t.root)return void 0;var s=e.is.string(t.root)?this.filter(t.root)[0]:t.root[0];if(i("Source node: %s",s.id()),null==t.goal)return void 0;var l=e.is.string(t.goal)?this.filter(t.goal)[0]:t.goal[0];if(i("Target node: %s",l.id()),null!=t.heuristic&&e.is.fn(t.heuristic))var u=t.heuristic;else var u=function(){return 0};if(null!=t.weight&&e.is.fn(t.weight))var c=t.weight;else var c=function(){return 1};if(null!=t.directed)var d=t.directed;else var d=!1;var p=[],h=[s.id()],v={},f={},g={},y={};g[s.id()]=0,y[s.id()]=u(s);for(var m=this.edges().not(":loop"),x=this.nodes(),b=0;h.length>0;){var w=n(h,y),_=this.filter("#"+h[w])[0];if(b++,i("\nStep: %s",b),i("Processing node: %s, fScore = %s",_.id(),y[_.id()]),_.id()==l.id()){i("Found goal node!");var E=r(s.id(),l.id(),v,[]);return E.reverse(),i("Path: %s",E),{found:!0,distance:g[_.id()],path:new e.Collection(o,E),steps:b}}p.push(_.id()),h.splice(w,1),i("Added node to closedSet, removed from openSet."),i("Processing neighbors...");for(var S=_.connectedEdges(d?'[source = "'+_.id()+'"]':void 0).intersect(m),P=0;P<S.length;P++){var k=S[P],C=k.connectedNodes('[id != "'+_.id()+'"]').intersect(x);if(i(" processing neighbor: %s",C.id()),-1==p.indexOf(C.id())){var D=g[_.id()]+c.apply(k,[k]);i(" tentative gScore: %d",D),-1!=h.indexOf(C.id())?D<g[C.id()]&&(g[C.id()]=D,y[C.id()]=D+u(C),v[C.id()]=_.id(),i(" better score, replacing gScore. "),i(" fScore(%s) = %s",C.id(),D)):(g[C.id()]=D,y[C.id()]=D+u(C),h.push(C.id()),v[C.id()]=_.id(),f[C.id()]=k.id(),i(" not in openSet, adding it. "),i(" fScore(%s) = %s",C.id(),D))}else i(" already in closedSet, ignoring it.")}}return i("Reached end of computation without finding our goal"),{found:!1,distance:void 0,path:void 0,steps:b}},floydWarshall:function(t){t=t||{};var i=function(){r&&console.log.apply(console,arguments)};if(null!=t.debug)var r=t.debug;else var r=!1;i("Starting floydWarshall...");var n=this._private.cy;if(null!=t.weight&&e.is.fn(t.weight))var a=t.weight;else var a=function(){return 1};if(null!=t.directed)var o=t.directed;else var o=!1;for(var s=this.edges().not(":loop"),l=this.nodes(),u=l.length,c={},d=0;u>d;d++)c[l[d].id()]=d;for(var p=[],d=0;u>d;d++){for(var h=new Array(u),v=0;u>v;v++)h[v]=d==v?0:1/0;p.push(h)}var f=[],g=[],y=function(e){for(var t=0;u>t;t++){for(var i=new Array(u),r=0;u>r;r++)i[r]=void 0;e.push(i)}};y(f),y(g);for(var d=0;d<s.length;d++){var m=c[s[d].source().id()],x=c[s[d].target().id()],b=a.apply(s[d],[s[d]]);p[m][x]>b&&(p[m][x]=b,f[m][x]=x,g[m][x]=s[d])}if(!o)for(var d=0;d<s.length;d++){var m=c[s[d].target().id()],x=c[s[d].source().id()],b=a.apply(s[d],[s[d]]);p[m][x]>b&&(p[m][x]=b,f[m][x]=x,g[m][x]=s[d])}for(var w=0;u>w;w++)for(var d=0;u>d;d++)for(var v=0;u>v;v++)p[d][w]+p[w][v]<p[d][v]&&(p[d][v]=p[d][w]+p[w][v],f[d][v]=f[d][w]);for(var _=[],d=0;u>d;d++)_.push(l[d].id());var E={distance:function(t,i){if(e.is.string(t))var r=n.filter(t)[0].id();else var r=t.id();if(e.is.string(i))var a=n.filter(i)[0].id();else var a=i.id();return p[c[r]][c[a]]},path:function(t,i){var r=function(e,t,i,r,a){if(e===t)return n.getElementById(r[e]);if(void 0===i[e][t])return void 0;for(var o=[n.getElementById(r[e])],s=e;e!==t;){s=e,e=i[e][t];var l=a[s][e];o.push(l),o.push(n.getElementById(r[e]))}return o};if(e.is.string(t))var a=n.filter(t)[0].id();else var a=t.id();if(e.is.string(i))var o=n.filter(i)[0].id();else var o=i.id();var s=r(c[a],c[o],f,_,g);return new e.Collection(n,s)}};return E},bellmanFord:function(t){t=t||{};var i=function(){r&&console.log.apply(console,arguments)};if(null!=t.debug)var r=t.debug;else var r=!1;if(i("Starting bellmanFord..."),null!=t.weight&&e.is.fn(t.weight))var n=t.weight;else var n=function(){return 1};if(null!=t.directed)var a=t.directed;else var a=!1;if(null==t.root)return void e.util.error("options.root required");if(e.is.string(t.root))var o=this.filter(t.root)[0];else var o=t.root[0];i("Source node: %s",o.id());for(var s=this._private.cy,l=this.edges().not(":loop"),u=this.nodes(),c=u.length,d={},p=0;c>p;p++)d[u[p].id()]=p;for(var h=[],v=[],f=[],p=0;c>p;p++)h[p]=u[p].id()===o.id()?0:1/0,v[p]=void 0;for(var g=!1,p=1;c>p;p++){g=!1;for(var y=0;y<l.length;y++){var m=d[l[y].source().id()],x=d[l[y].target().id()],b=n.apply(l[y],[l[y]]),w=h[m]+b;if(w<h[x]&&(h[x]=w,v[x]=m,f[x]=l[y],g=!0),!a){var w=h[x]+b;w<h[m]&&(h[m]=w,v[m]=x,f[m]=l[y],g=!0)}}if(!g)break}if(g)for(var y=0;y<l.length;y++){var m=d[l[y].source().id()],x=d[l[y].target().id()],b=n.apply(l[y],[l[y]]);if(h[m]+b<h[x])return e.util.error("Error: graph contains a negative weigth cycle!"),{pathTo:void 0,distanceTo:void 0,hasNegativeWeightCycle:!0}}for(var _=[],p=0;c>p;p++)_.push(u[p].id());var E={distanceTo:function(t){if(e.is.string(t))var i=s.filter(t)[0].id();else var i=t.id();return h[d[i]]},pathTo:function(t){var i=function(e,t,i,r,n,a){for(;;){if(n.push(s.getElementById(r[i])),n.push(a[i]),t===i)return n;var o=e[i];if("undefined"==typeof o)return void 0;i=o}};if(e.is.string(t))var r=s.filter(t)[0].id();else var r=t.id();var n=[],a=i(v,d[o.id()],d[r],_,n,f);return null!=a&&a.reverse(),new e.Collection(s,a)},hasNegativeWeightCycle:!1};return E},kargerStein:function(t){t=t||{};var i=function(){a&&console.log.apply(console,arguments)},r=function(e,t,i){for(var r=i[e],n=r[1],a=r[2],o=t[n],s=t[a],l=i.filter(function(e){return t[e[1]]===o&&t[e[2]]===s?!1:t[e[1]]===s&&t[e[2]]===o?!1:!0}),u=0;u<l.length;u++){var c=l[u];c[1]===s?(l[u]=c.slice(0),l[u][1]=o):c[2]===s&&(l[u]=c.slice(0),l[u][2]=o)}for(var u=0;u<t.length;u++)t[u]===s&&(t[u]=o);return l},n=function(e,t,i,a){if(a>=i)return t;var o=Math.floor(Math.random()*t.length),s=r(o,e,t);return n(e,s,i-1,a)};if(null!=t&&null!=t.debug)var a=t.debug;else var a=!1;i("Starting kargerStein...");var o=this._private.cy,s=this.edges().not(":loop"),l=this.nodes(),u=l.length,c=s.length,d=Math.ceil(Math.pow(Math.log(u)/Math.LN2,2)),p=Math.floor(u/Math.sqrt(2));if(2>u)return void e.util.error("At least 2 nodes are required for KargerSteing algorithm!");for(var h={},v=0;u>v;v++)h[l[v].id()]=v;for(var f=[],v=0;c>v;v++){var g=s[v];f.push([v,h[g.source().id()],h[g.target().id()]])}for(var y,m=1/0,x=[],v=0;u>v;v++)x.push(v);for(var b=0;d>=b;b++){var w=x.slice(0),_=n(w,f,u,p),E=w.slice(0),S=n(w,_,p,2),P=n(E,_,p,2);S.length<=P.length&&S.length<m?(m=S.length,y=[S,w]):P.length<=S.length&&P.length<m&&(m=P.length,y=[P,E])}for(var k=y[0].map(function(e){return s[e[0]]}),C=[],D=[],N=y[1][0],v=0;v<y[1].length;v++){var T=y[1][v];T===N?C.push(l[v]):D.push(l[v])}var M={cut:new e.Collection(o,k),partition1:new e.Collection(o,C),partition2:new e.Collection(o,D)};return M},pageRank:function(t){t=t||{};var i=function(e){for(var t=e.length,i=0,r=0;t>r;r++)i+=e[r];for(var r=0;t>r;r++)e[r]=e[r]/i},r=function(){n&&console.log.apply(console,arguments)};if(null!=t&&null!=t.debug)var n=t.debug;else var n=!1;if(r("Starting pageRank..."),null!=t&&null!=t.dampingfactor)var a=t.dampingFactor;else var a=.8;if(null!=t&&null!=t.precision)var o=t.precision;else var o=1e-6;if(null!=t&&null!=t.iterations)var s=t.iterations;else var s=200;if(null!=t&&null!=t.weight&&e.is.fn(t.weight))var l=t.weight;else var l=function(){return 1};for(var u=this._private.cy,c=this.edges().not(":loop"),d=this.nodes(),p=d.length,h=c.length,v={},f=0;p>f;f++)v[d[f].id()]=f;for(var g=[],y=[],m=(1-a)/p,f=0;p>f;f++){for(var x=[],b=0;p>b;b++)x.push(0);g.push(x),y.push(0)}for(var f=0;h>f;f++){var w=c[f],_=v[w.source().id()],E=v[w.target().id()],S=l.apply(w,[w]);g[E][_]+=S,y[_]+=S}for(var P=1/p+m,b=0;p>b;b++)if(0===y[b])for(var f=0;p>f;f++)g[f][b]=P;else for(var f=0;p>f;f++)g[f][b]=g[f][b]/y[b]+m;for(var k,C=[],D=[],f=0;p>f;f++)C.push(1),D.push(0);for(var N=0;s>N;N++){for(var T=D.slice(0),f=0;p>f;f++)for(var b=0;p>b;b++)T[f]+=g[f][b]*C[b];i(T),k=C,C=T;for(var M=0,f=0;p>f;f++)M+=Math.pow(k[f]-C[f],2);if(o>M){r("Stoped at iteration %s",N);break}}r("Result:\n"+C);var B={rank:function(t){if(e.is.string(t))var i=u.filter(t)[0].id();else var i=t.id();return C[v[i]]}};return B}})}(cytoscape),function(e){"use strict";e.fn.eles({animated:e.define.animated(),clearQueue:e.define.clearQueue(),delay:e.define.delay(),animate:e.define.animate(),stop:e.define.stop()})}(cytoscape),function(e){"use strict";e.fn.eles({classes:function(t){var i,r=this,n=[];if(e.is.fn(t))i=t;else if(!e.is.plainObject(t))return this;for(var a=0;a<r.length;a++){var o=r[a],s=!1;if(t=i?i.apply(o,[a,o]):t,t.add)for(var l=0;l<t.add.length;l++){var u=t.add[l],c=o._private.classes[u];o._private.classes[u]=!0,c||s||(n.push(o),s=!0)}if(t.remove)for(var l=0;l<t.remove.length;l++){var u=t.remove[l],c=o._private.classes[u];o._private.classes[u]=!1,c&&!s&&(n.push(o),s=!0)}if(t.toggle)for(var l=0;l<t.toggle.length;l++){var u=t.toggle[l],c=o._private.classes[u];o._private.classes[u]=!c,s||(n.push(o),s=!0)}}return n.length>0&&new e.Collection(this.cy(),n).updateStyle().trigger("class"),this},addClass:function(t){t=t.split(/\s+/);for(var i=this,r=[],n=0;n<t.length;n++){var a=t[n];if(!e.is.emptyString(a))for(var o=0;o<i.length;o++){var s=i[o],l=s._private.classes[a];s._private.classes[a]=!0,l||r.push(s)}}return r.length>0&&new e.Collection(this._private.cy,r).updateStyle().trigger("class"),i},hasClass:function(e){var t=this[0];return null!=t&&t._private.classes[e]?!0:!1},toggleClass:function(t,i){for(var r=t.split(/\s+/),n=this,a=[],o=0,s=n.length;s>o;o++)for(var l=n[o],u=0;u<r.length;u++){var c=r[u];if(!e.is.emptyString(c)){var d=l._private.classes[c],p=i||void 0===i&&!d;p?(l._private.classes[c]=!0,d||a.push(l)):(l._private.classes[c]=!1,d&&a.push(l))}}return a.length>0&&new e.Collection(this._private.cy,a).updateStyle().trigger("class"),n},removeClass:function(t){t=t.split(/\s+/);for(var i=this,r=[],n=0;n<i.length;n++)for(var a=i[n],o=0;o<t.length;o++){var s=t[o];if(s&&""!==s){var l=a._private.classes[s];a._private.classes[s]=void 0,l&&r.push(a)}}return r.length>0&&new e.Collection(i._private.cy,r).updateStyle(),i.trigger("class"),i},flashClass:function(e,t){var i=this;if(null==t)t=250;else if(0===t)return i;return i.addClass(e),setTimeout(function(){i.removeClass(e)},t),i}})}(cytoscape),function(e){"use strict";e.fn.eles({allAre:function(e){return this.filter(e).length===this.length},is:function(e){return this.filter(e).length>0},some:function(e,t){for(var i=0;i<this.length;i++){var r=e.apply(t,[this[i],i,this]);if(r)return!0}return!1},every:function(e,t){for(var i=0;i<this.length;i++){var r=e.apply(t,[this[i],i,this]);if(!r)return!1}return!0},same:function(e){return e=this.cy().collection(e),this.length!==e.length?!1:this.intersect(e).length===this.length},anySame:function(e){return e=this.cy().collection(e),this.intersect(e).length>0},allAreNeighbors:function(e){return e=this.cy().collection(e),this.neighborhood().intersect(e).length===e.length}})}(cytoscape),function(e){"use strict";e.fn.eles({parent:function(t){for(var i=[],r=this._private.cy,n=0;n<this.length;n++){var a=this[n],o=r.getElementById(a._private.data.parent);o.size()>0&&i.push(o)}return new e.Collection(r,i,{unique:!0}).filter(t)},parents:function(t){for(var i=[],r=this.parent();r.nonempty();){for(var n=0;n<r.length;n++){var a=r[n];i.push(a)}r=r.parent()}return new e.Collection(this.cy(),i,{unique:!0}).filter(t)},commonAncestors:function(e){for(var t,i=0;i<this.length;i++){var r=this[i],n=r.parents();t=t||n,t=t.intersect(n)}return t.filter(e)},orphans:function(e){return this.stdFilter(function(e){return e.isNode()&&e.parent().empty()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(e){return e.isNode()&&e.parent().nonempty()}).filter(e)},children:function(t){for(var i=[],r=0;r<this.length;r++){var n=this[r];i=i.concat(n._private.children)}return new e.Collection(this.cy(),i,{unique:!0}).filter(t)},siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];return e?0!==e._private.children.length:void 0},isChild:function(){var e=this[0];return e?void 0!==e._private.data.parent&&0!==e.parent().length:void 0},descendants:function(t){function i(e){for(var t=0;t<e.length;t++){var n=e[t];r.push(n),n.children().nonempty()&&i(n.children())}}var r=[];return i(this.children()),new e.Collection(this.cy(),r,{unique:!0}).filter(t)}}),e.elesfn.ancestors=e.elesfn.parents}(cytoscape),function(e){"use strict";var t=1,i=0;e.fn.eles({data:e.define.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:e.define.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:e.define.data({field:"scratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeScratch:e.define.removeData({field:"scratch",triggerEvent:!1}),rscratch:e.define.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:e.define.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];return e?e._private.data.id:void 0},position:e.define.data({field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"rtrigger",allowGetting:!0,validKeys:["x","y"],onSet:function(e){var t=e.updateCompoundBounds();t.rtrigger("position")},canSet:function(e){return!e.locked()}}),silentPosition:e.define.data({field:"position",bindingEvent:"position",allowBinding:!1,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!1,triggerFnName:"trigger",allowGetting:!0,validKeys:["x","y"],onSet:function(e){e.updateCompoundBounds()},canSet:function(e){return!e.locked()}}),positions:function(t,i){if(e.is.plainObject(t))this.position(t);else if(e.is.fn(t)){for(var r=t,n=0;n<this.length;n++){var a=this[n],t=r.apply(a,[n,a]);if(t&&!a.locked()){var o=a._private.position;o.x=t.x,o.y=t.y}}var s=this.updateCompoundBounds(),l=s.length>0?this.add(s):this;i?l.trigger("position"):l.rtrigger("position")}return this},silentPositions:function(e){return this.positions(e,!0)},updateCompoundBounds:function(){function t(e){var t=e.children(),i=e._private.style,n=t.boundingBox({includeLabels:!1,includeEdges:!1}),a={top:i["padding-top"].pxValue,bottom:i["padding-bottom"].pxValue,left:i["padding-left"].pxValue,right:i["padding-right"].pxValue},o=e._private.position,s=!1;"auto"===i.width.value&&(e._private.autoWidth=n.w+a.left+a.right,o.x=(n.x1+n.x2-a.left+a.right)/2,s=!0),"auto"===i.height.value&&(e._private.autoHeight=n.h+a.top+a.bottom,o.y=(n.y1+n.y2-a.top+a.bottom)/2,s=!0),s&&r.push(e)}var i=this.cy();if(!i.styleEnabled()||!i.hasCompoundNodes())return i.collection();for(var r=[],n=this.parent();n.nonempty();){for(var a=0;a<n.length;a++){var o=n[a];t(o)}n=n.parent()}return new e.Collection(i,r)},renderedPosition:function(t,i){var r=this[0],n=this.cy(),a=n.zoom(),o=n.pan(),s=e.is.plainObject(t)?t:void 0,l=void 0!==s||void 0!==i&&e.is.string(t);if(r&&r.isNode()){if(!l){var u=r._private.position;return s={x:u.x*a+o.x,y:u.y*a+o.y},void 0===t?s:s[t]}for(var c=0;c<this.length;c++){var r=this[c];void 0!==i?r._private.position[t]=(i-o[t])/a:void 0!==s&&(r._private.position={x:(s.x-o.x)/a,y:(s.y-o.y)/a})}this.rtrigger("position")}else if(!l)return void 0;return this},parentPosition:function(t,i){var r=this[0],n=this.cy(),a=e.is.plainObject(t)?t:void 0,o=void 0!==a||void 0!==i&&e.is.string(t),s=n.hasCompoundNodes();if(r&&r.isNode()){if(!o){var l=r._private.position,u=s?r.parent():null,c=u&&u.length>0,d=c;c&&(u=u[0]);var p=d?u._private.position:{x:0,y:0};return a={x:l.x-p.x,y:l.y-p.y},void 0===t?a:a[t]}for(var h=0;h<this.length;h++){var r=this[h],u=s?r.parent():null,c=u&&u.length>0,d=c;c&&(u=u[0]);var p=d?u._private.position:{x:0,y:0};void 0!==i?r._private.position[t]=i+p[t]:void 0!==a&&(r._private.position={x:a.x+p.x,y:a.y+p.y})}this.rtrigger("position")}else if(!o)return void 0;return this},width:function(){var e=this[0],t=e._private.cy,i=t._private.styleEnabled;if(e){if(i){var r=e._private.style.width;return"auto"===r.strValue?e._private.autoWidth:r.pxValue}return 1}},outerWidth:function(){var e=this[0],r=e._private.cy,n=r._private.styleEnabled;if(e){if(n){var a=e._private.style,o="auto"===a.width.strValue?e._private.autoWidth:a.width.pxValue,s=a["border-width"]?a["border-width"].pxValue*t+i:0;return o+s}return 1}},renderedWidth:function(){var e=this[0];if(e){var t=e.width();return t*this.cy().zoom()}},renderedOuterWidth:function(){var e=this[0];if(e){var t=e.outerWidth();return t*this.cy().zoom()}},height:function(){var e=this[0],t=e._private.cy,i=t._private.styleEnabled;if(e&&"nodes"===e._private.group){if(i){var r=e._private.style.height;return"auto"===r.strValue?e._private.autoHeight:r.pxValue}return 1}},outerHeight:function(){var e=this[0],r=e._private.cy,n=r._private.styleEnabled;if(e&&"nodes"===e._private.group){if(!n)return 1;var a=e._private.style,o="auto"===a.height.strValue?e._private.autoHeight:a.height.pxValue,s=a["border-width"]?a["border-width"].pxValue*t+i:0;return o+s}},renderedHeight:function(){var e=this[0];if(e&&"nodes"===e._private.group){var t=e.height();return t*this.cy().zoom()}},renderedOuterHeight:function(){var e=this[0];if(e&&"nodes"===e._private.group){var t=e.outerHeight();return t*this.cy().zoom()}},renderedBoundingBox:function(e){var t=this.boundingBox(e),i=this.cy(),r=i.zoom(),n=i.pan(),a=t.x1*r+n.x,o=t.x2*r+n.x,s=t.y1*r+n.y,l=t.y2*r+n.y;return{x1:a,x2:o,y1:s,y2:l,w:o-a,h:l-s}},boundingBox:function(e){var t=this,i=t._private.cy,r=i._private,n=r.styleEnabled;e=e||{};var a=void 0===e.includeNodes?!0:e.includeNodes,o=void 0===e.includeEdges?!0:e.includeEdges,s=void 0===e.includeLabels?!0:e.includeLabels;n&&r.renderer.recalculateRenderedStyle(this);for(var l=1/0,u=-1/0,c=1/0,d=-1/0,p=0;p<t.length;p++){var h,v,f,g,y,m,x=t[p],b=x._private,w=n?b.style.display.value:"element",_="nodes"===b.group,E=!1;if("none"!==w){if(_&&a){E=!0;var S=b.position;y=S.x,m=S.y;var P=x.outerWidth(),k=P/2,C=x.outerHeight(),D=C/2;h=y-k,v=y+k,f=m-D,g=m+D,l=l>h?h:l,u=v>u?v:u,c=c>f?f:c,d=g>d?g:d}else if(x.isEdge()&&o){E=!0;var N=x._private.source._private.position,T=x._private.target._private.position,M=x._private.rstyle||{};if(h=N.x,v=T.x,f=N.y,g=T.y,h>v){var B=h;h=v,v=B}if(f>g){var B=f;f=g,g=B}if(l=l>h?h:l,u=v>u?v:u,c=c>f?f:c,d=g>d?g:d,n)for(var I=M.bezierPts||[],P=x._private.style.width.pxValue,z=P/2,L=0;L<I.length;L++){var O=I[L];h=O.x-z,v=O.x+z,f=O.y-z,g=O.y+z,l=l>h?h:l,u=v>u?v:u,c=c>f?f:c,d=g>d?g:d}}if(n){var R=x._private.style,M=x._private.rstyle,X=R.content.strValue,V=R["font-size"],Y=R["text-halign"],A=R["text-valign"],q=M.labelWidth,F=M.labelHeight,j=M.labelX,W=M.labelY;if(E&&s&&X&&V&&null!=F&&null!=q&&null!=j&&null!=W&&Y&&A){var H,$,Z,U,G=F,K=q;if(x.isEdge())H=j-K/2,$=j+K/2,Z=W-G/2,U=W+G/2;else{switch(Y.value){case"left":H=j-K,$=j;break;case"center":H=j-K/2,$=j+K/2;break;case"right":H=j,$=j+K}switch(A.value){case"top":Z=W-G,U=W;break;case"center":Z=W-G/2,U=W+G/2;break;case"bottom":Z=W,U=W+G}}l=l>H?H:l,u=$>u?$:u,c=c>Z?Z:c,d=U>d?U:d}}}}return{x1:l,x2:u,y1:c,y2:d,w:u-l,h:d-c}}}),e.elesfn.modelPosition=e.elesfn.position,e.elesfn.modelPositions=e.elesfn.positions}(cytoscape),function(e){"use strict";function t(e){return function(t){var i=this;if(void 0===t&&(t=!0),0!==i.length&&i.isNode()&&!i.removed()){for(var r=0,n=i[0],a=n._private.edges,o=0;o<a.length;o++){var s=a[o];(t||!s.isLoop())&&(r+=e(n,s))}return r}}}function i(e,t){return function(i){for(var r,n=this.nodes(),a=0;a<n.length;a++){var o=n[a],s=o[e](i);void 0===s||void 0!==r&&!t(s,r)||(r=s)}return r}}e.fn.eles({degree:t(function(e,t){return t.source().same(t.target())?2:1}),indegree:t(function(e,t){return t.target().same(e)?1:0}),outdegree:t(function(e,t){return t.source().same(e)?1:0})}),e.fn.eles({minDegree:i("degree",function(e,t){return t>e}),maxDegree:i("degree",function(e,t){return e>t}),minIndegree:i("indegree",function(e,t){return t>e}),maxIndegree:i("indegree",function(e,t){return e>t}),minOutdegree:i("outdegree",function(e,t){return t>e}),maxOutdegree:i("outdegree",function(e,t){return e>t})}),e.fn.eles({totalDegree:function(e){for(var t=0,i=this.nodes(),r=0;r<i.length;r++)t+=i[r].degree(e);return t}})}(cytoscape),function(e){"use strict";e.fn.eles({on:e.define.on(),one:e.define.on({unbindSelfOnTrigger:!0}),once:e.define.on({unbindAllBindersOnTrigger:!0}),off:e.define.off(),trigger:e.define.trigger(),rtrigger:function(e,t){return 0!==this.length?(this.cy().notify({type:e,collection:this}),this.trigger(e,t),this):void 0}}),e.elesfn.bind=e.elesfn.on,e.elesfn.unbind=e.elesfn.off}(cytoscape),function(e){"use strict";e.fn.eles({nodes:function(e){return this.filter(function(e,t){return t.isNode()}).filter(e)},edges:function(e){return this.filter(function(e,t){return t.isEdge()}).filter(e)},filter:function(t){var i=this._private.cy;if(e.is.fn(t)){for(var r=[],n=0;n<this.length;n++){var a=this[n];t.apply(a,[n,a])&&r.push(a)}return new e.Collection(i,r)}return e.is.string(t)||e.is.elementOrCollection(t)?new e.Selector(t).filter(this):void 0===t?this:new e.Collection(i)},not:function(t){var i=this._private.cy;if(t){e.is.string(t)&&(t=this.filter(t));for(var r=[],n=0;n<this.length;n++){var a=this[n],o=t._private.ids[a.id()];o||r.push(a)}return new e.Collection(i,r)}return this},intersect:function(t){var i=this._private.cy;if(e.is.string(t)){var r=t;return this.filter(r)}for(var n=[],a=this,o=t,s=this.length<t.length,l=s?o._private.ids:a._private.ids,u=s?a:o,c=0;c<u.length;c++){var d=u[c]._private.data.id,p=l[d];p&&n.push(p)}return new e.Collection(i,n)},add:function(t){var i=this._private.cy;if(!t)return this;if(e.is.string(t)){var r=t;t=i.elements(r)}for(var n=[],a=0;a<this.length;a++)n.push(this[a]);for(var a=0;a<t.length;a++){var o=!this._private.ids[t[a].id()];o&&n.push(t[a])}return new e.Collection(i,n)},merge:function(t){var i=this._private,r=i.cy;if(!t)return this;if(e.is.string(t)){var n=t;t=r.elements(n)}for(var a=0;a<t.length;a++){var o=t[a],s=o.id(),l=!i.ids[s];if(l){var u=this.length++;this[u]=o,i.ids[s]=o,i.indexes[s]=u}}return this},unmergeOne:function(e){e=e[0];var t=this._private,i=e.id(),r=t.indexes[i];if(null==r)return this;this[r]=void 0,t.ids[i]=void 0,t.indexes[i]=void 0;var n=r===this.length-1;if(this.length>1&&!n){var a=this.length-1,o=this[a];this[a]=void 0,this[r]=o,t.indexes[o.id()]=r}return this.length--,this},unmerge:function(t){var i=this._private.cy;if(!t)return this;if(e.is.string(t)){var r=t;t=i.elements(r)}for(var n=0;n<t.length;n++)this.unmergeOne(t[n]);return this},map:function(e,t){for(var i=[],r=this,n=0;n<r.length;n++){var a=r[n],o=e.apply(t,[a,n,r]);i.push(o)}return i},stdFilter:function(t,i){for(var r=[],n=this,a=this._private.cy,o=0;o<n.length;o++){var s=n[o],l=t.apply(i,[s,o,n]);l&&r.push(s)}return new e.Collection(a,r)},max:function(e,t){for(var i,r=-1/0,n=this,a=0;a<n.length;a++){var o=n[a],s=e.apply(t,[o,a,n]);s>r&&(r=s,i=o)}return{value:r,ele:i}},min:function(e,t){for(var i,r=1/0,n=this,a=0;a<n.length;a++){var o=n[a],s=e.apply(t,[o,a,n]);r>s&&(r=s,i=o)}return{value:r,ele:i}}})}(cytoscape),function(e){"use strict";e.fn.eles({isNode:function(){return"nodes"===this.group()},isEdge:function(){return"edges"===this.group()},isLoop:function(){return this.isEdge()&&this.source().id()===this.target().id()},isSimple:function(){return this.isEdge()&&this.source().id()!==this.target().id()},group:function(){var e=this[0];return e?e._private.group:void 0}})}(cytoscape),function(e){"use strict";e.fn.eles({each:function(t){if(e.is.fn(t))for(var i=0;i<this.length;i++){var r=this[i],n=t.apply(r,[i,r]);if(n===!1)break}return this},forEach:function(t,i){if(e.is.fn(t))for(var r=0;r<this.length;r++){var n=this[r],a=t.apply(i,[n,r,this]);if(a===!1)break}return this},toArray:function(){for(var e=[],t=0;t<this.length;t++)e.push(this[t]);return e},slice:function(t,i){var r=[],n=this.length;null==i&&(i=n),null==t&&(t=0),0>t&&(t=n+t),0>i&&(i=n+i);for(var a=t;a>=0&&i>a&&n>a;a++)r.push(this[a]);return new e.Collection(this.cy(),r)},size:function(){return this.length},eq:function(t){return this[t]||new e.Collection(this.cy())},first:function(){return this[0]||new e.Collection(this.cy())},last:function(){return this[this.length-1]||new e.Collection(this.cy())},empty:function(){return 0===this.length},nonempty:function(){return!this.empty()},sort:function(t){if(!e.is.fn(t))return this;var i=this.cy(),r=this.toArray().sort(t);return new e.Collection(i,r)},sortByZIndex:function(){return this.sort(e.Collection.zIndexSort)},zDepth:function(){var e=this[0];if(!e)return void 0;var t=e._private,i=t.group;if("nodes"===i)return t.data.parent?e.parents().size():0;var r=t.source,n=t.target,a=r._private.data.parent?r.parents().size():0,o=n._private.data.parent?n.parents().size():0;return Math.max(a-1,o-1,0)+.5}}),e.Collection.zIndexSort=function(e,t){var i=e.cy(),r=e._private,n=t._private,a=r.style["z-index"].value-n.style["z-index"].value,o=0,s=0,l=i.hasCompoundNodes(),u="nodes"===r.group,c="edges"===r.group,d="nodes"===n.group,p="edges"===n.group;l&&(o=e.zDepth(),s=t.zDepth());var h=o-s,v=0===h;return v?u&&p?1:c&&d?-1:0===a?r.index-n.index:a:h}}(cytoscape),function(e){"use strict";e.fn.eles({layoutPositions:function(t,i,r){var n=this.nodes(),a=this.cy();if(t.trigger({type:"layoutstart",layout:t}),i.animate)for(var o=0;o<n.length;o++){var s=n[o],l=o===n.length-1,u=r.call(s,o,s),c=s.position();e.is.number(c.x)&&e.is.number(c.y)||s.silentPosition({x:0,y:0}),t.one("layoutready",i.ready),t.trigger({type:"layoutready",layout:t}),s.animate({position:u},{duration:i.animationDuration,step:l?void 0:function(){i.fit&&a.fit(i.padding)},complete:l?void 0:function(){null!=i.zoom&&a.zoom(i.zoom),i.pan&&a.pan(i.pan),i.fit&&a.fit(i.padding),t.one("layoutstop",i.stop),t.trigger({type:"layoutstop",layout:t})}})}else n.positions(r),i.fit&&a.fit(i.padding),null!=i.zoom&&a.zoom(i.zoom),i.pan&&a.pan(i.pan),t.one("layoutready",i.ready),t.trigger({type:"layoutready",layout:t}),t.one("layoutstop",i.stop),t.trigger({type:"layoutstop",layout:t});return this},layout:function(t){var i=this.cy();return i.layout(e.util.extend({},t,{eles:this})),this},makeLayout:function(t){var i=this.cy();return i.makeLayout(e.util.extend({},t,{eles:this}))}})}(cytoscape),function(e){"use strict";e.fn.eles({updateStyle:function(e){var t=this._private.cy;if(!t.styleEnabled())return this;if(t._private.batchingStyle){for(var i=t._private.batchStyleEles,r=0;r<this.length;r++){var n=this[r];i.ids[n._private.id]||i.push(n)}return this}var a=t.style();e=e||void 0===e?!0:!1,a.apply(this);var o=this.updateCompoundBounds(),s=o.length>0?this.add(o):this;return e?s.rtrigger("style"):s.trigger("style"),this},updateMappers:function(e){var t=this._private.cy,i=t.style();if(e=e||void 0===e?!0:!1,!t.styleEnabled())return this;i.updateMappers(this);var r=this.updateCompoundBounds(),n=r.length>0?this.add(r):this;return e?n.rtrigger("style"):n.trigger("style"),this},renderedCss:function(e){var t=this.cy();if(!t.styleEnabled())return this;var i=this[0];
if(i){var r=i.cy().style().getRenderedStyle(i);return void 0===e?r:r[e]}},css:function(t,i){var r=this.cy();if(!r.styleEnabled())return this;var n=!1,a=r.style();if(e.is.plainObject(t)){var o=t;a.applyBypass(this,o,n);var s=this.updateCompoundBounds(),l=s.length>0?this.add(s):this;l.rtrigger("style")}else if(e.is.string(t)){if(void 0===i){var u=this[0];return u?u._private.style[t].strValue:void 0}a.applyBypass(this,t,i,n);var s=this.updateCompoundBounds(),l=s.length>0?this.add(s):this;l.rtrigger("style")}else if(void 0===t){var u=this[0];return u?a.getRawStyle(u):void 0}return this},removeCss:function(e){var t=this.cy();if(!t.styleEnabled())return this;var i=!1,r=t.style(),n=this;if(void 0===e)for(var a=0;a<n.length;a++){var o=n[a];r.removeAllBypasses(o,i)}else{e=e.split(/\s+/);for(var a=0;a<n.length;a++){var o=n[a];r.removeBypasses(o,e,i)}}var s=this.updateCompoundBounds(),l=s.length>0?this.add(s):this;return l.rtrigger("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},visible:function(){var e=this.cy();if(!e.styleEnabled())return!0;var t=this[0],i=e.hasCompoundNodes();if(t){var r=t._private.style;if("visible"!==r.visibility.value||"element"!==r.display.value)return!1;if("nodes"===t._private.group){if(!i)return!0;var n=t._private.data.parent?t.parents():null;if(n)for(var a=0;a<n.length;a++){var o=n[a],s=o._private.style,l=s.visibility.value,u=s.display.value;if("visible"!==l||"element"!==u)return!1}return!0}var c=t._private.source,d=t._private.target;return c.visible()&&d.visible()}},hidden:function(){var e=this[0];return e?!e.visible():void 0},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var t=e.hasCompoundNodes(),i=this[0];if(i){var r=i._private,n=r.style.opacity.value;if(!t)return n;var a=r.data.parent?i.parents():null;if(a)for(var o=0;o<a.length;o++){var s=a[o],l=s._private.style.opacity.value;n=l*n}return n}},transparent:function(){var e=this[0],t=e.cy().hasCompoundNodes();return e?t?0===e.effectiveOpacity():0===e._private.style.opacity:void 0},isFullAutoParent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var t=this[0];if(t){var i="auto"===t._private.style.width.value,r="auto"===t._private.style.height.value;return t.isParent()&&i&&r}}}),e.elesfn.style=e.elesfn.css,e.elesfn.renderedStyle=e.elesfn.renderedCss,e.elesfn.removeStyle=e.elesfn.removeCss}(cytoscape),function(e){"use strict";function t(e){return function(){var t=arguments;if(2===t.length){var i=t[0],r=t[1];this.bind(e.event,i,r)}else if(1===t.length){var r=t[0];this.bind(e.event,r)}else if(0===t.length){for(var n=0;n<this.length;n++){var a=this[n],o=!e.ableField||a._private[e.ableField];if(e.overrideAble){var s=e.overrideAble(a);if(void 0!==s&&(o=s,!s))return this}o&&(a._private[e.field]=e.value)}this.updateStyle(),this.trigger(e.event)}return this}}function i(i){e.elesfn[i.field]=function(){var e=this[0];if(e){if(i.overrideField){var t=i.overrideField(e);if(void 0!==t)return t}return e._private[i.field]}},e.elesfn[i.on]=t({event:i.on,field:i.field,ableField:i.ableField,overrideAble:i.overrideAble,value:!0}),e.elesfn[i.off]=t({event:i.off,field:i.field,ableField:i.ableField,overrideAble:i.overrideAble,value:!1})}i({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"}),i({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()?!1:void 0},on:"grabify",off:"ungrabify"}),i({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"}),i({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"}),e.elesfn.grabbed=function(){var e=this[0];return e?e._private.grabbed:void 0},i({field:"active",on:"activate",off:"unactivate"}),e.elesfn.inactive=function(){var e=this[0];return e?!e._private.active:void 0}}(cytoscape),function(e){"use strict";function t(t){return function(i){for(var r=[],n=this._private.cy,a=0;a<this.length;a++){var o=this[a],s=o._private[t.attr];s&&r.push(s)}return new e.Collection(n,r,{unique:!0}).filter(i)}}function i(t){return function(i){var r=[],n=this._private.cy,a=t||{};e.is.string(i)&&(i=n.$(i));for(var o=i.connectedEdges(),s=this._private.ids,l=0;l<o.length;l++){var u,c=o[l],d=c._private.data;if(a.thisIs){var p=d[a.thisIs];u=s[p]}else u=s[d.source]||s[d.target];u&&r.push(c)}return new e.Collection(n,r,{unique:!0})}}function r(t){var i={codirected:!1};return t=e.util.extend({},i,t),function(i){for(var r=this._private.cy,n=[],a=this.edges(),o=t,s=0;s<a.length;s++)for(var l=a[s],u=l.source()[0],c=u.id(),d=l.target()[0],p=d.id(),h=u._private.edges,v=0;v<h.length;v++){var f=h[v],g=f._private.data,y=g.target,m=g.source,x=y===p&&m===c,b=c===y&&p===m;(o.codirected&&x||!o.codirected&&(x||b))&&n.push(f)}return new e.Collection(r,n,{unique:!0}).filter(i)}}e.fn.eles({roots:function(t){for(var i=this,r=[],n=0;n<i.length;n++){var a=i[n];if(a.isNode()){var o=a.connectedEdges(function(){return this.data("target")===a.id()&&this.data("source")!==a.id()}).length>0;o||r.push(a)}}return new e.Collection(this._private.cy,r,{unique:!0}).filter(t)},leaves:function(t){for(var i=this,r=[],n=0;n<i.length;n++){var a=i[n];if(a.isNode()){var o=a.connectedEdges(function(){return this.data("source")===a.id()&&this.data("target")!==a.id()}).length>0;o||r.push(a)}}return new e.Collection(this._private.cy,r,{unique:!0}).filter(t)},outgoers:function(t){for(var i=this,r=[],n=0;n<i.length;n++){var a=i[n],o=a.id();if(a.isNode())for(var s=a._private.edges,l=0;l<s.length;l++){var u=s[l],c=u._private.data.source,d=u._private.data.target;c===o&&d!==o&&(r.push(u),r.push(u.target()[0]))}}return new e.Collection(this._private.cy,r,{unique:!0}).filter(t)},successors:function(t){for(var i=this,r=[],n={};;){var a=i.outgoers();if(0===a.length)break;for(var o=!1,s=0;s<a.length;s++){var l=a[s],u=l.id();n[u]||(n[u]=!0,r.push(l),o=!0)}if(!o)break;i=a}return new e.Collection(this._private.cy,r,{unique:!0}).filter(t)},incomers:function(t){for(var i=this,r=[],n=0;n<i.length;n++){var a=i[n],o=a.id();if(a.isNode())for(var s=a._private.edges,l=0;l<s.length;l++){var u=s[l],c=u._private.data.source,d=u._private.data.target;d===o&&c!==o&&(r.push(u),r.push(u.source()[0]))}}return new e.Collection(this._private.cy,r,{unique:!0}).filter(t)},predecessors:function(t){for(var i=this,r=[],n={};;){var a=i.incomers();if(0===a.length)break;for(var o=!1,s=0;s<a.length;s++){var l=a[s],u=l.id();n[u]||(n[u]=!0,r.push(l),o=!0)}if(!o)break;i=a}return new e.Collection(this._private.cy,r,{unique:!0}).filter(t)}}),e.fn.eles({neighborhood:function(t){for(var i=[],r=this._private.cy,n=this.nodes(),a=0;a<n.length;a++)for(var o=n[a],s=o.connectedEdges(),l=0;l<s.length;l++){var u=s[l],c=u.connectedNodes().not(o);c.length>0&&i.push(c[0]),i.push(u[0])}return new e.Collection(r,i,{unique:!0}).filter(t)},closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),e.fn.eles({source:function(e){var t,i=this[0];return i&&(t=i._private.source),t&&e?t.filter(e):t},target:function(e){var t,i=this[0];return i&&(t=i._private.target),t&&e?t.filter(e):t},sources:t({attr:"source"}),targets:t({attr:"target"})}),e.fn.eles({edgesWith:i(),edgesTo:i({thisIs:"source"})}),e.fn.eles({connectedEdges:function(t){for(var i=[],r=this._private.cy,n=this,a=0;a<n.length;a++){var o=n[a];if(o.isNode())for(var s=o._private.edges,l=0;l<s.length;l++){var u=s[l];i.push(u)}}return new e.Collection(r,i,{unique:!0}).filter(t)},connectedNodes:function(t){for(var i=[],r=this._private.cy,n=this,a=0;a<n.length;a++){var o=n[a];o.isEdge()&&(i.push(o.source()[0]),i.push(o.target()[0]))}return new e.Collection(r,i,{unique:!0}).filter(t)},parallelEdges:r(),codirectedEdges:r({codirected:!0})})}(cytoscape),function(e){"use strict";e.fn.eles({fit:function(){},center:function(){}})}(cytoscape),function(e){"use strict";e.Minheap=function(t,i,r){return new e.Heap(t,i,e.Heap.minHeapComparator,r)},e.Maxheap=function(t,i,r){return new e.Heap(t,i,e.Heap.maxHeapComparator,r)},e.Heap=function(t,i,r,n){if("undefined"!=typeof r&&"undefined"!=typeof i){"undefined"==typeof n&&(n=e.Heap.idFn);var a,o,s,l=[],u={},c=[],d=0;for(i=this.getArgumentAsCollection(i,t),s=i.length,d=0;s>d;d+=1){if(l.push(n.call(t,i[d],d,i)),a=i[d].id(),u.hasOwnProperty(a))throw"ERROR: Multiple items with the same id found: "+a;u[a]=d,c.push(a)}for(this._private={cy:t,heap:l,pointers:u,elements:c,comparator:r,extractor:n,length:s},d=Math.floor(s/2);d>=0;d-=1)o=this.heapify(d);return o}},e.Heap.idFn=function(e){return e.id()},e.Heap.minHeapComparator=function(e,t){return e>=t},e.Heap.maxHeapComparator=function(e,t){return t>=e},e.fn.heap=function(t){for(var i in t){var r=t[i];e.Heap.prototype[i]=r}},e.heapfn=e.Heap.prototype,e.heapfn.size=function(){return this._private.length},e.heapfn.getArgumentAsCollection=function(t,i){var r;if("undefined"==typeof i&&(i=this._private.cy),e.is.elementOrCollection(t))r=t;else{for(var n=[],a=[].concat.apply([],[t]),o=0;o<a.length;o++){var s=a[o],l=i.getElementById(s);l.length>0&&n.push(l)}r=new e.Collection(i,n)}return r},e.heapfn.isHeap=function(){var e,t,i,r,n,a=this._private.heap,o=a.length,s=this._private.comparator;for(e=0;o>e;e+=1)if(t=2*e+1,i=t+1,r=o>t?s(a[t],a[e]):!0,n=o>i?s(a[i],a[e]):!0,!r||!n)return!1;return!0},e.heapfn.heapSwap=function(e,t){var i=this._private.heap,r=this._private.pointers,n=this._private.elements,a=i[e],o=n[e],s=n[e],l=n[t];i[e]=i[t],n[e]=n[t],r[s]=t,r[l]=e,i[t]=a,n[t]=o},e.heapfn.heapify=function(e,t){var i,r,n,a,o,s,l,u=0,c=!1;for("undefined"==typeof t&&(t=!0),i=this._private.heap,u=i.length,s=this._private.comparator,r=e;!c;)t?(n=2*r+1,a=n+1,o=r,u>n&&!s(i[n],i[o])&&(o=n),u>a&&!s(i[a],i[o])&&(o=a),c=o===r,c||(this.heapSwap(o,r),r=o)):(l=Math.floor((r-1)/2),o=r,c=0>l||s(i[o],i[l]),c||(this.heapSwap(o,l),r=l))},e.heapfn.insert=function(e){var t,i,r,n,a,o=this.getArgumentAsCollection(e),s=o.length;for(a=0;s>a;a+=1){if(t=o[a],i=this._private.heap.length,r=this._private.extractor(t),n=t.id(),this._private.pointers.hasOwnProperty(n))throw"ERROR: Multiple items with the same id found: "+n;this._private.heap.push(r),this._private.elements.push(n),this._private.pointers[n]=i,this.heapify(i,!1)}this._private.length=this._private.heap.length},e.heapfn.getValueById=function(e){if(this._private.pointers.hasOwnProperty(e)){var t=this._private.pointers[e];return this._private.heap[t]}},e.heapfn.contains=function(e){for(var t=this.getArgumentAsCollection(e),i=0;i<t.length;i+=1){var r=t[i].id();if(!this._private.pointers.hasOwnProperty(r))return!1}return!0},e.heapfn.top=function(){return this._private.length>0?{value:this._private.heap[0],id:this._private.elements[0]}:void 0},e.heapfn.pop=function(){if(this._private.length>0){var e,t,i,r=this.top(),n=this._private.length-1;return this.heapSwap(0,n),e=this._private.elements[n],t=this._private.heap[n],i=e,this._private.heap.pop(),this._private.elements.pop(),this._private.length=this._private.heap.length,this._private.pointers[i]=void 0,this.heapify(0),r}},e.heapfn.findDirectionHeapify=function(e){var t=Math.floor((e-1)/2),i=this._private.heap,r=0>t||this._private.comparator(i[e],i[t]);this.heapify(e,r)},e.heapfn.edit=function(t,i){for(var r=this.getArgumentAsCollection(t),n=0;n<r.length;n+=1){var a=r[n].id(),o=this._private.pointers[a],s=this._private.heap[o];e.is.number(i)?this._private.heap[o]=i:e.is.fn(i)&&(this._private.heap[o]=i.call(this._private.cy,s,o)),this.findDirectionHeapify(o)}},e.heapfn.delete=function(e){for(var t=this.getArgumentAsCollection(e),i=0;i<t.length;i+=1){var r,n,a,o=t[i].id(),s=this._private.pointers[o],l=this._private.length-1;s!==l&&this.heapSwap(s,l),r=this._private.elements[l],n=this._private.heap[l],a=r,this._private.heap.pop(),this._private.elements.pop(),this._private.length=this._private.heap.length,this._private.pointers[a]=void 0,this.findDirectionHeapify(s)}return n}}(cytoscape),function(e){"use strict";function t(e){t.CANVAS_LAYERS=5,t.SELECT_BOX=0,t.DRAG=2,t.NODE=4,t.TEXTURE_BUFFER=0,t.BUFFER_COUNT=2,this.options=e,this.data={select:[void 0,void 0,void 0,void 0,0],renderer:this,cy:e.cy,container:e.cy.container(),canvases:new Array(t.CANVAS_LAYERS),contexts:new Array(t.CANVAS_LAYERS),canvasNeedsRedraw:new Array(t.CANVAS_LAYERS),bufferCanvases:new Array(t.BUFFER_COUNT),bufferContexts:new Array(t.CANVAS_LAYERS)},this.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},this.timeoutData={panTimeout:null},this.dragData={possibleDragElements:[]},this.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},this.zoomData={freeToZoom:!1,lastPointerX:null},this.redraws=0,this.showFps=e.showFps,this.bindings=[],this.data.canvasContainer=document.createElement("div");var i=this.data.canvasContainer.style;i.position="absolute",i.zIndex="0",i.overflow="hidden",this.data.container.appendChild(this.data.canvasContainer);for(var r=0;r<t.CANVAS_LAYERS;r++)this.data.canvases[r]=document.createElement("canvas"),this.data.contexts[r]=this.data.canvases[r].getContext("2d"),this.data.canvases[r].style.position="absolute",this.data.canvases[r].setAttribute("data-id","layer"+r),this.data.canvases[r].style.zIndex=String(t.CANVAS_LAYERS-r),this.data.canvasContainer.appendChild(this.data.canvases[r]),this.data.canvasNeedsRedraw[r]=!1;this.data.topCanvas=this.data.canvases[0],this.data.canvases[t.NODE].setAttribute("data-id","layer"+t.NODE+"-node"),this.data.canvases[t.SELECT_BOX].setAttribute("data-id","layer"+t.SELECT_BOX+"-selectbox"),this.data.canvases[t.DRAG].setAttribute("data-id","layer"+t.DRAG+"-drag");for(var r=0;r<t.BUFFER_COUNT;r++)this.data.bufferCanvases[r]=document.createElement("canvas"),this.data.bufferContexts[r]=this.data.bufferCanvases[r].getContext("2d"),this.data.bufferCanvases[r].style.position="absolute",this.data.bufferCanvases[r].setAttribute("data-id","buffer"+r),this.data.bufferCanvases[r].style.zIndex=String(-r-1),this.data.bufferCanvases[r].style.visibility="hidden";this.hideEdgesOnViewport=e.hideEdgesOnViewport,this.hideLabelsOnViewport=e.hideLabelsOnViewport,this.textureOnViewport=e.textureOnViewport,this.wheelSensitivity=e.wheelSensitivity,this.motionBlurEnabled=e.motionBlur,this.forcedPixelRatio=e.pixelRatio,this.motionBlur=!0,this.load()}t.panOrBoxSelectDelay=400,t.isTouch=e.is.touch();var i="undefined"!=typeof Path2D;t.usePaths=function(){return i},t.prototype.notify=function(i){var r;r=e.is.array(i.type)?i.type:[i.type];for(var n=0;n<r.length;n++){var a=r[n];switch(a){case"destroy":return void this.destroy();case"add":case"remove":case"load":this.updateNodesCache(),this.updateEdgesCache();break;case"viewport":this.data.canvasNeedsRedraw[t.SELECT_BOX]=!0;break;case"style":this.updateCachedZSortedEles()}("load"===a||"resize"===a)&&(this.invalidateContainerClientCoordsCache(),this.matchCanvasSize(this.data.container))}this.data.canvasNeedsRedraw[t.NODE]=!0,this.data.canvasNeedsRedraw[t.DRAG]=!0,this.redraw()},t.prototype.destroy=function(){this.destroyed=!0;for(var e=0;e<this.bindings.length;e++){var t=this.bindings[e],i=t;i.target.removeEventListener(i.event,i.handler,i.useCapture)}};for(var r in e.math)t.prototype[r]=e.math[r];e("renderer","canvas",t)}(cytoscape),function(e){"use strict";var t=e("renderer","canvas"),i=t.prototype,r=t.arrowShapes={};t.arrowShapeHeight=.3;var n=function(e,t,i,r,n,a){var o=i-n/2,s=i+n/2,l=r-a/2,u=r+a/2;return e>=o&&s>=e&&t>=l&&u>=t},a=function(e,t,i,r,n){r=-r;var a=e*Math.cos(r)-t*Math.sin(r),o=e*Math.sin(r)+t*Math.cos(r),s=a*i,l=o*i,u=s+n.x,c=l+n.y;return{x:u,y:c}};r.arrow={_points:[-.15,-.3,0,0,.15,-.3],collide:function(t,i,n,a,o,s,l,u){var c=r.arrow._points;return e.math.pointInsidePolygon(t,i,c,n,a,o,s,l,u)},roughCollide:n,draw:function(e,t,i,n){for(var o=r.arrow._points,s=0;s<o.length/2;s++){var l=a(o[2*s],o[2*s+1],t,i,n);e.lineTo(l.x,l.y)}},spacing:function(){return 0},gap:function(e){return 2*e._private.style.width.pxValue}},r.triangle=r.arrow,r["triangle-backcurve"]={_ctrlPt:[0,-.15],collide:function(t,i,n,a,o,s,l,u){var c=r.triangle._points;return e.math.pointInsidePolygon(t,i,c,n,a,o,s,l,u)},roughCollide:n,draw:function(e,t,i,n){for(var o,s=r.triangle._points,l=0;l<s.length/2;l++){var u=a(s[2*l],s[2*l+1],t,i,n);0===l&&(o=u),e.lineTo(u.x,u.y)}var c=this._ctrlPt,d=a(c[0],c[1],t,i,n);e.quadraticCurveTo(d.x,d.y,o.x,o.y)},spacing:function(){return 0},gap:function(e){return 2*e._private.style.width.pxValue}},r["triangle-tee"]={_points:[-.15,-.3,0,0,.15,-.3,-.15,-.3],_pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(t,i,n,a,o,s,l,u){var c=r["triangle-tee"]._points,d=r["triangle-tee"]._pointsTee,p=e.math.pointInsidePolygon(t,i,d,n,a,o,s,l,u)||e.math.pointInsidePolygon(t,i,c,n,a,o,s,l,u);return p},roughCollide:n,draw:function(e,t,i,n){for(var o=r["triangle-tee"]._points,s=0;s<o.length/2;s++){var l=a(o[2*s],o[2*s+1],t,i,n);e.lineTo(l.x,l.y)}var u=r["triangle-tee"]._pointsTee,c=a(u[0],u[1],t,i,n);e.moveTo(c.x,c.y);for(var s=0;s<u.length/2;s++){var l=a(u[2*s],u[2*s+1],t,i,n);e.lineTo(l.x,l.y)}},spacing:function(){return 0},gap:function(e){return 2*e._private.style.width.pxValue}},r["half-triangle-overshot"]={_points:[0,-.25,-.5,-.25,.5,.25],leavePathOpen:!0,matchEdgeWidth:!0,collide:function(t,i,r,n,a,o,s,l){var u=this._points;return e.math.pointInsidePolygon(t,i,u,r,n,a,o,s,l)},roughCollide:n,draw:function(e,t,i,r){for(var n=this._points,o=0;o<n.length/2;o++){var s=a(n[2*o],n[2*o+1],t,i,r);e.lineTo(s.x,s.y)}},spacing:function(){return 0},gap:function(e){return 2*e._private.style.width.pxValue}},r.none={collide:function(){return!1},roughCollide:function(){return!1},draw:function(){},spacing:function(){return 0},gap:function(){return 0}},r.circle={_baseRadius:.15,collide:function(e,t,i,n,a,o,s,l){if(a!=o){var u=(o+l)/(a+l);return t/=u,n/=u,Math.pow(i-e,2)+Math.pow(n-t,2)<=Math.pow((a+l)*r.circle._baseRadius,2)}return Math.pow(i-e,2)+Math.pow(n-t,2)<=Math.pow((a+l)*r.circle._baseRadius,2)},roughCollide:n,draw:function(e,t,i,n){e.arc(n.x,n.y,r.circle._baseRadius*t,0,2*Math.PI,!1)},spacing:function(e){return i.getArrowWidth(e._private.style.width.pxValue)*r.circle._baseRadius},gap:function(e){return 2*e._private.style.width.pxValue}},r.inhibitor={_points:[-.25,0,-.25,-.1,.25,-.1,.25,0],collide:function(t,i,n,a,o,s,l,u){var c=r.inhibitor._points;return e.math.pointInsidePolygon(t,i,c,n,a,o,s,l,u)},roughCollide:n,draw:function(e,t,i,n){for(var o=r.inhibitor._points,s=0;s<o.length/2;s++){var l=a(o[2*s],o[2*s+1],t,i,n);e.lineTo(l.x,l.y)}},spacing:function(){return 1},gap:function(){return 1}},r.tee=r.inhibitor,r.square={_points:[-.15,0,.15,0,.15,-.3,-.15,-.3],collide:function(t,i,n,a,o,s,l,u){var c=r.square._points;return e.math.pointInsidePolygon(t,i,c,n,a,o,s,l,u)},roughCollide:n,draw:function(e,t,i,n){for(var o=r.square._points,s=0;s<o.length/2;s++){var l=a(o[2*s],o[2*s+1],t,i,n);e.lineTo(l.x,l.y)}},spacing:function(){return 0},gap:function(e){return 2*e._private.style.width.pxValue}},r.diamond={_points:[-.15,-.15,0,-.3,.15,-.15,0,0],collide:function(t,i,n,a,o,s,l,u){var c=r.diamond._points;return e.math.pointInsidePolygon(t,i,c,n,a,o,s,l,u)},roughCollide:n,draw:function(e,t,i,n){for(var o=r.diamond._points,s=0;s<o.length/2;s++){var l=a(o[2*s],o[2*s+1],t,i,n);e.lineTo(l.x,l.y)}},spacing:function(){return 0},gap:function(e){return e._private.style.width.pxValue}}}(cytoscape),function(e){"use strict";var t=e("renderer","canvas");t.prototype.getCachedNodes=function(){var e=this.data,t=this.data.cy;return null==e.cache&&(e.cache={}),null==e.cache.cachedNodes&&(e.cache.cachedNodes=t.nodes()),e.cache.cachedNodes},t.prototype.updateNodesCache=function(){var e=this.data,t=this.data.cy;null==e.cache&&(e.cache={}),e.cache.cachedNodes=t.nodes()},t.prototype.getCachedEdges=function(){var e=this.data,t=this.data.cy;return null==e.cache&&(e.cache={}),null==e.cache.cachedEdges&&(e.cache.cachedEdges=t.edges()),e.cache.cachedEdges},t.prototype.updateEdgesCache=function(){var e=this.data,t=this.data.cy;null==e.cache&&(e.cache={}),e.cache.cachedEdges=t.edges()}}(cytoscape),function(e){"use strict";var t=e("renderer","canvas");t.prototype.projectIntoViewport=function(e,t){var i=this.findContainerClientCoords(),r=i[0],n=i[1],a=e-r,o=t-n;return a-=this.data.cy.pan().x,o-=this.data.cy.pan().y,a/=this.data.cy.zoom(),o/=this.data.cy.zoom(),[a,o]},t.prototype.findContainerClientCoords=function(){var e=this.data.container,t=this.containerBB=this.containerBB||e.getBoundingClientRect();return[t.left,t.top,t.right-t.left,t.bottom-t.top]},t.prototype.invalidateContainerClientCoordsCache=function(){this.containerBB=null},t.prototype.findNearestElement=function(i,r,n){function a(e){var a=e.outerWidth(),o=e.outerHeight(),l=a/2,c=o/2,d=e._private.position;if(d.x-l<=i&&i<=d.x+l&&d.y-c<=r&&r<=d.y+c){var p=!n||e.visible()&&!e.transparent();if(n&&!p)return;var h=t.nodeShapes[s.getNodeShape(e)],f=e._private.style["border-width"].pxValue/2;h.checkPoint(i,r,f,a+v,o+v,d.x,d.y)&&u.push(e)}}function o(o){var l,c=o._private.rscratch,d=o._private.style,v=d.width.pxValue,f=v*v,g=2*v,y=o._private.source,m=o._private.target,x=!1,b=function(){if(void 0!==l)return l;if(!n)return l=!0,!0;var e=o.visible()&&!o.transparent();return e?(l=!0,!0):(l=!1,!1)};if("self"===c.edgeType)((x=e.math.inBezierVicinity(i,r,c.startX,c.startY,c.cp2ax,c.cp2ay,c.selfEdgeMidX,c.selfEdgeMidY,f))&&b()&&f+h>e.math.sqDistanceToQuadraticBezier(i,r,c.startX,c.startY,c.cp2ax,c.cp2ay,c.selfEdgeMidX,c.selfEdgeMidY)||(x=e.math.inBezierVicinity(i,r,c.selfEdgeMidX,c.selfEdgeMidY,c.cp2cx,c.cp2cy,c.endX,c.endY,f))&&b()&&f+h>e.math.sqDistanceToQuadraticBezier(i,r,c.selfEdgeMidX,c.selfEdgeMidY,c.cp2cx,c.cp2cy,c.endX,c.endY))&&u.push(o);else if("haystack"===c.edgeType){var w=d["haystack-radius"].value,_=w/2,E=m._private.position,S=m.width(),P=m.height(),k=y._private.position,C=y.width(),D=y.height(),N=k.x+c.source.x*C*_,T=k.y+c.source.y*D*_,M=E.x+c.target.x*S*_,B=E.y+c.target.y*P*_;(x=e.math.inLineVicinity(i,r,N,T,M,B,g))&&b()&&f+h>e.math.sqDistanceToFiniteLine(i,r,N,T,M,B)&&u.push(o)}else"straight"===c.edgeType?(x=e.math.inLineVicinity(i,r,c.startX,c.startY,c.endX,c.endY,g))&&b()&&f+h>e.math.sqDistanceToFiniteLine(i,r,c.startX,c.startY,c.endX,c.endY)&&u.push(o):"bezier"===c.edgeType&&(x=e.math.inBezierVicinity(i,r,c.startX,c.startY,c.cp2x,c.cp2y,c.endX,c.endY,f))&&b()&&f+h>e.math.sqDistanceToQuadraticBezier(i,r,c.startX,c.startY,c.cp2x,c.cp2y,c.endX,c.endY)&&u.push(o);if(x&&b()&&0===u.length||u[u.length-1]!==o){var I=t.arrowShapes[d["source-arrow-shape"].value],z=t.arrowShapes[d["target-arrow-shape"].value],y=y||o._private.source,m=m||o._private.target,E=m._private.position,k=y._private.position,L=s.getArrowWidth(d.width.pxValue),O=s.getArrowHeight(d.width.pxValue),R=L,X=O;(I.roughCollide(i,r,c.arrowStartX,c.arrowStartY,L,O,[c.arrowStartX-k.x,c.arrowStartY-k.y],0)&&I.collide(i,r,c.arrowStartX,c.arrowStartY,L,O,[c.arrowStartX-k.x,c.arrowStartY-k.y],0)||z.roughCollide(i,r,c.arrowEndX,c.arrowEndY,R,X,[c.arrowEndX-E.x,c.arrowEndY-E.y],0)&&z.collide(i,r,c.arrowEndX,c.arrowEndY,R,X,[c.arrowEndX-E.x,c.arrowEndY-E.y],0))&&u.push(o)}p&&u.length>0&&u[u.length-1]===o&&(a(y),a(m))}for(var s=this,l=this.getCachedZSortedEles(),u=[],c=t.isTouch,d=this.data.cy.zoom(),p=this.data.cy.hasCompoundNodes(),h=(c?256:32)/d,v=(c?16:0)/d,f=l.length-1;f>=0;f--){var g=l[f];if(u.length>0)break;"nodes"===g._private.group?a(l[f]):o(l[f])}return u.length>0?u[u.length-1]:null},t.prototype.getAllInBox=function(i,r,n,a){var o=this.getCachedNodes(),s=this.getCachedEdges(),l=[],u=Math.min(i,n),c=Math.max(i,n),d=Math.min(r,a),p=Math.max(r,a);i=u,n=c,r=d,a=p;for(var h,v=0;v<o.length;v++){var f=o[v]._private.position,g=this.getNodeShape(o[v]),y=this.getNodeWidth(o[v]),m=this.getNodeHeight(o[v]),x=o[v]._private.style["border-width"].pxValue/2,b=t.nodeShapes[g];b.intersectBox(i,r,n,a,y,m,f.x,f.y,x)&&l.push(o[v])}for(var v=0;v<s.length;v++){var w=s[v]._private.rscratch;if("self"==s[v]._private.rscratch.edgeType&&((h=e.math.boxInBezierVicinity(i,r,n,a,w.startX,w.startY,w.cp2ax,w.cp2ay,w.endX,w.endY,s[v]._private.style.width.pxValue))&&(2==h||1==h&&e.math.checkBezierInBox(i,r,n,a,w.startX,w.startY,w.cp2ax,w.cp2ay,w.endX,w.endY,s[v]._private.style.width.pxValue))||(h=e.math.boxInBezierVicinity(i,r,n,a,w.startX,w.startY,w.cp2cx,w.cp2cy,w.endX,w.endY,s[v]._private.style.width.pxValue))&&(2==h||1==h&&e.math.checkBezierInBox(i,r,n,a,w.startX,w.startY,w.cp2cx,w.cp2cy,w.endX,w.endY,s[v]._private.style.width.pxValue)))&&l.push(s[v]),"bezier"==w.edgeType&&(h=e.math.boxInBezierVicinity(i,r,n,a,w.startX,w.startY,w.cp2x,w.cp2y,w.endX,w.endY,s[v]._private.style.width.pxValue))&&(2==h||1==h&&e.math.checkBezierInBox(i,r,n,a,w.startX,w.startY,w.cp2x,w.cp2y,w.endX,w.endY,s[v]._private.style.width.pxValue))&&l.push(s[v]),"straight"==w.edgeType&&(h=e.math.boxInBezierVicinity(i,r,n,a,w.startX,w.startY,.5*w.startX+.5*w.endX,.5*w.startY+.5*w.endY,w.endX,w.endY,s[v]._private.style.width.pxValue))&&(2==h||1==h&&e.math.checkStraightEdgeInBox(i,r,n,a,w.startX,w.startY,w.endX,w.endY,s[v]._private.style.width.pxValue))&&l.push(s[v]),"haystack"==w.edgeType){var _=s[v].target()[0],E=_.position(),S=s[v].source()[0],P=S.position(),k=P.x+w.source.x,C=P.y+w.source.y,D=E.x+w.target.x,N=E.y+w.target.y,T=k>=i&&n>=k&&C>=r&&a>=C,M=D>=i&&n>=D&&N>=r&&a>=N;T&&M&&l.push(s[v])}}return l},t.prototype.getNodeWidth=function(e){return e.width()},t.prototype.getNodeHeight=function(e){return e.height()},t.prototype.getNodeShape=function(e){var t=e._private.style.shape.value;return e.isParent()?"rectangle"===t||"roundrectangle"===t?t:"rectangle":t},t.prototype.getNodePadding=function(e){var t=e._private.style["padding-left"].pxValue,i=e._private.style["padding-right"].pxValue,r=e._private.style["padding-top"].pxValue,n=e._private.style["padding-bottom"].pxValue;return isNaN(t)&&(t=0),isNaN(i)&&(i=0),isNaN(r)&&(r=0),isNaN(n)&&(n=0),{left:t,right:i,top:r,bottom:n}},t.prototype.zOrderSort=e.Collection.zIndexSort,t.prototype.updateCachedZSortedEles=function(){this.getCachedZSortedEles(!0)},t.prototype.getCachedZSortedEles=function(e){var t=this.lastZOrderCachedNodes,i=this.lastZOrderCachedEdges,r=this.getCachedNodes(),n=this.getCachedEdges(),a=[];if(!e&&t&&i&&t===r&&i===n)a=this.cachedZSortedEles;else{for(var o=0;o<r.length;o++)r[o].visible()&&!r[o].transparent()&&a.push(r[o]);for(var o=0;o<n.length;o++)n[o].visible()&&!n[o].transparent()&&a.push(n[o]);a.sort(this.zOrderSort),this.cachedZSortedEles=a}return this.lastZOrderCachedNodes=r,this.lastZOrderCachedEdges=n,a},t.prototype.projectBezier=function(t){function i(e){a.push({x:r(e[0],e[2],e[4],.05),y:r(e[1],e[3],e[5],.05)}),a.push({x:r(e[0],e[2],e[4],.25),y:r(e[1],e[3],e[5],.25)}),a.push({x:r(e[0],e[2],e[4],.4),y:r(e[1],e[3],e[5],.4)});var t={x:r(e[0],e[2],e[4],.5),y:r(e[1],e[3],e[5],.5)};a.push(t),"self"===n.edgeType?(n.midX=n.selfEdgeMidX,n.midY=n.selfEdgeMidY):(n.midX=t.x,n.midY=t.y),a.push({x:r(e[0],e[2],e[4],.6),y:r(e[1],e[3],e[5],.6)}),a.push({x:r(e[0],e[2],e[4],.75),y:r(e[1],e[3],e[5],.75)}),a.push({x:r(e[0],e[2],e[4],.95),y:r(e[1],e[3],e[5],.95)})}var r=e.math.qbezierAt,n=t._private.rscratch,a=t._private.rstyle.bezierPts=[];"self"===n.edgeType?(i([n.startX,n.startY,n.cp2ax,n.cp2ay,n.selfEdgeMidX,n.selfEdgeMidY]),i([n.selfEdgeMidX,n.selfEdgeMidY,n.cp2cx,n.cp2cy,n.endX,n.endY])):"bezier"===n.edgeType&&i([n.startX,n.startY,n.cp2x,n.cp2y,n.endX,n.endY])},t.prototype.recalculateNodeLabelProjection=function(e){var t=e._private.style.content.strValue;if(t&&!t.match(/^\s+$/)){var i,r,n=e.outerWidth(),a=e.outerHeight(),o=e._private.position,s=e._private.style["text-halign"].strValue,l=e._private.style["text-valign"].strValue,u=e._private.rscratch,c=e._private.rstyle;switch(s){case"left":i=o.x-n/2;break;case"right":i=o.x+n/2;break;default:i=o.x}switch(l){case"top":r=o.y-a/2;break;case"bottom":r=o.y+a/2;break;default:r=o.y}u.labelX=i,u.labelY=r,c.labelX=i,c.labelY=r,this.applyLabelDimensions(e)}},t.prototype.recalculateEdgeLabelProjection=function(t){var i=t._private.style.content.strValue;if(i&&!i.match(/^\s+$/)){var r,n,a,o,s=t._private.rscratch,l=t._private.rstyle;if("self"==s.edgeType)a=s.selfEdgeMidX,o=s.selfEdgeMidY;else if("straight"==s.edgeType)a=(s.startX+s.endX)/2,o=(s.startY+s.endY)/2;else if("bezier"==s.edgeType)a=e.math.qbezierAt(s.startX,s.cp2x,s.endX,.5),o=e.math.qbezierAt(s.startY,s.cp2y,s.endY,.5);else if("haystack"==s.edgeType){var u=t._private.source._private.position,c=t._private.target._private.position;a=(u.x+s.source.x+c.x+s.target.x)/2,o=(u.y+s.source.y+c.y+s.target.y)/2}r=a,n=o,s.labelX=r,s.labelY=n,l.labelX=r,l.labelY=n,this.applyLabelDimensions(t)}},t.prototype.applyLabelDimensions=function(e){var t=e._private.rscratch,i=e._private.rstyle,r=this.getLabelText(e),n=this.calculateLabelDimensions(e,r);i.labelWidth=n.width,t.labelWidth=n.width,i.labelHeight=n.height,t.labelHeight=n.height},t.prototype.getLabelText=function(e){var t=e._private.style,i=e._private.style.content.strValue,r=t["text-transform"].value;return"none"==r||("uppercase"==r?i=i.toUpperCase():"lowercase"==r&&(i=i.toLowerCase())),i},t.prototype.calculateLabelDimensions=function(e,t){var i=this,r=e._private.style,n=r["font-style"].strValue,a=r["font-size"].pxValue+"px",o=r["font-family"].strValue,s=r["font-weight"].strValue,l=e._private.labelKey,u=i.labelDimCache||(i.labelDimCache={});if(u[l])return u[l];var c=this.labelCalcDiv;c||(c=this.labelCalcDiv=document.createElement("div"),document.body.appendChild(c));var d=c.style;return d.fontFamily=o,d.fontStyle=n,d.fontSize=a,d.fontWeight=s,d.position="absolute",d.left="-9999px",d.top="-9999px",d.zIndex="-1",d.visibility="hidden",d.padding="0",d.lineHeight="1",c.innerText=t,u[l]={width:c.clientWidth,height:c.clientHeight},u[l]},t.prototype.recalculateRenderedStyle=function(e){for(var t=[],i=[],r={},n=0;n<e.length;n++){var a=e[n],o=a._private,s=o.rscratch,l=o.rstyle,u=o.data.id,c=null!=s.boundingBoxKey&&o.boundingBoxKey===s.boundingBoxKey,d=null!=s.labelKey&&o.labelKey===s.labelKey,p=c&&d;if("nodes"===a._private.group){var h=o.position,v=null!=l.nodeX&&null!=l.nodeY&&h.x===l.nodeX&&h.y===l.nodeY;v&&p||i.push(a),l.nodeX=h.x,l.nodeY=h.y}else{var f=a._private.source._private.position,g=a._private.target._private.position,y=null!=l.srcX&&null!=l.srcY&&f.x===l.srcX&&f.y===l.srcY,m=null!=l.tgtX&&null!=l.tgtY&&g.x===l.tgtX&&g.y===l.tgtY,x=y&&m;if(!x||!p){var b=o.style["curve-style"].value;if("bezier"===b){if(!r[u]){t.push(a),r[u]=!0;for(var w=a.parallelEdges(),n=0;n<w.length;n++){var _=w[n],E=_._private.data.id;r[E]||(t.push(_),r[E]=!0)}}}else t.push(a)}l.srcX=f.x,l.srcY=f.y,l.tgtX=g.x,l.tgtY=g.y}s.boundingBoxKey=o.boundingBoxKey,s.labelKey=o.labelKey}this.recalculateEdgeProjections(t),this.recalculateLabelProjections(i,t)},t.prototype.recalculateLabelProjections=function(e,t){for(var i=0;i<e.length;i++)this.recalculateNodeLabelProjection(e[i]);for(var i=0;i<t.length;i++)this.recalculateEdgeLabelProjection(t[i])},t.prototype.recalculateEdgeProjections=function(e){this.findEdgeControlPoints(e)},t.prototype.findEdgeControlPoints=function(i){if(i&&0!==i.length){for(var r,n={},a=[],o=[],s=0;s<i.length;s++){var l=i[s],u=l._private.style,c="unbundled-bezier"===u["curve-style"].value;if("none"!==u.display.value)if("haystack"!==u["curve-style"].value){var d=l._private.data.source,p=l._private.data.target;r=d>p?p+"-"+d:d+"-"+p,c&&(r="unbundled"+l._private.data.id),null==n[r]&&(n[r]=[],a.push(r)),n[r].push(l),c&&(n[r].hasUnbundled=!0)}else o.push(l)}for(var h,v,f,g,y,m,x,b,w,_,E,S,P,k,C=0;C<a.length;C++){r=a[C];var D=n[r];if(D.sort(function(e,t){return e._private.index-t._private.index}),h=D[0]._private.source,v=D[0]._private.target,h._private.data.id>v._private.data.id){var N=h;h=v,v=N}if(f=h._private.position,g=v._private.position,y=this.getNodeWidth(h),m=this.getNodeHeight(h),x=this.getNodeWidth(v),b=this.getNodeHeight(v),w=t.nodeShapes[this.getNodeShape(h)],_=t.nodeShapes[this.getNodeShape(v)],E=h._private.style["border-width"].pxValue,S=v._private.style["border-width"].pxValue,k=!1,D.length>1&&h!==v||D.hasUnbundled){var T=w.intersectLine(f.x,f.y,y,m,g.x,g.y,E/2),M=_.intersectLine(g.x,g.y,x,b,f.x,f.y,S/2),B={x1:T[0],x2:M[0],y1:T[1],y2:M[1]},I=M[1]-T[1],z=M[0]-T[0],L=Math.sqrt(z*z+I*I),O={x:z,y:I},R={x:O.x/L,y:O.y/L};
P={x:-R.y,y:R.x},(_.checkPoint(T[0],T[1],S/2,x,b,g.x,g.y)||w.checkPoint(M[0],M[1],E/2,y,m,f.x,f.y))&&(P={},k=!0)}for(var l,X,s=0;s<D.length;s++){l=D[s],X=l._private.rscratch;var V=X.lastEdgeIndex,Y=s,A=X.lastNumEdges,q=D.length,F=l._private.style,j=F["control-point-step-size"].pxValue,W=void 0!==F["control-point-distance"]?F["control-point-distance"].pxValue:void 0,H=F["control-point-weight"].value,c="unbundled-bezier"===F["curve-style"].value,$=X.lastSrcCtlPtX,Z=f.x,U=X.lastSrcCtlPtY,G=f.y,K=X.lastSrcCtlPtW,J=h.outerWidth(),Q=X.lastSrcCtlPtH,et=h.outerHeight(),tt=X.lastTgtCtlPtX,it=g.x,rt=X.lastTgtCtlPtY,nt=g.y,at=X.lastTgtCtlPtW,ot=v.outerWidth(),st=X.lastTgtCtlPtH,lt=v.outerHeight();if(X.badBezier=k?!0:!1,$!==Z||U!==G||K!==J||Q!==et||tt!==it||rt!==nt||at!==ot||st!==lt||!(V===Y&&A===q||c)){if(X.lastSrcCtlPtX=Z,X.lastSrcCtlPtY=G,X.lastSrcCtlPtW=J,X.lastSrcCtlPtH=et,X.lastTgtCtlPtX=it,X.lastTgtCtlPtY=nt,X.lastTgtCtlPtW=ot,X.lastTgtCtlPtH=lt,X.lastEdgeIndex=Y,X.lastNumEdges=q,h===v){X.edgeType="self";var ut=s,ct=j;c&&(ut=0,ct=W),X.cp2ax=f.x,X.cp2ay=f.y-(1+Math.pow(m,1.12)/100)*ct*(ut/3+1),X.cp2cx=h._private.position.x-(1+Math.pow(y,1.12)/100)*ct*(ut/3+1),X.cp2cy=f.y,X.selfEdgeMidX=(X.cp2ax+X.cp2cx)/2,X.selfEdgeMidY=(X.cp2ay+X.cp2cy)/2}else if(D.length%2!==1||s!==Math.floor(D.length/2)||c){var dt,pt=(.5-D.length/2+s)*j,ht=e.math.signum(pt);dt=c?W:void 0!==W?ht*W:void 0;var vt=void 0!==dt?dt:pt,ft=1-H,gt=H,yt=l._private.source!==h;yt&&(ft=H,gt=1-H);var mt={x:B.x1*ft+B.x2*gt,y:B.y1*ft+B.y2*gt};X.edgeType="bezier",X.cp2x=mt.x+P.x*vt,X.cp2y=mt.y+P.y*vt}else X.edgeType="straight";this.findEndpoints(l);var xt=!e.is.number(X.startX)||!e.is.number(X.startY),bt=!e.is.number(X.arrowStartX)||!e.is.number(X.arrowStartY),wt=!e.is.number(X.endX)||!e.is.number(X.endY),_t=!e.is.number(X.arrowEndX)||!e.is.number(X.arrowEndY),Et=3,St=this.getArrowWidth(l._private.style.width.pxValue)*t.arrowShapeHeight,Pt=Et*St,kt=e.math.distance({x:X.cp2x,y:X.cp2y},{x:X.startX,y:X.startY}),Ct=Pt>kt,Dt=e.math.distance({x:X.cp2x,y:X.cp2y},{x:X.endX,y:X.endY}),Nt=Pt>Dt;if("bezier"===X.edgeType){var Tt=!1;if(xt||bt||Ct){Tt=!0;var Mt={x:X.cp2x-f.x,y:X.cp2y-f.y},Bt=Math.sqrt(Mt.x*Mt.x+Mt.y*Mt.y),It={x:Mt.x/Bt,y:Mt.y/Bt},zt=Math.max(y,m),Lt={x:X.cp2x+2*It.x*zt,y:X.cp2y+2*It.y*zt},Ot=w.intersectLine(f.x,f.y,y,m,Lt.x,Lt.y,E/2);Ct?(X.cp2x=X.cp2x+It.x*(Pt-kt),X.cp2y=X.cp2y+It.y*(Pt-kt)):(X.cp2x=Ot[0]+It.x*Pt,X.cp2y=Ot[1]+It.y*Pt)}if(wt||_t||Nt){Tt=!0;var Mt={x:X.cp2x-g.x,y:X.cp2y-g.y},Bt=Math.sqrt(Mt.x*Mt.x+Mt.y*Mt.y),It={x:Mt.x/Bt,y:Mt.y/Bt},zt=Math.max(y,m),Lt={x:X.cp2x+2*It.x*zt,y:X.cp2y+2*It.y*zt},Rt=_.intersectLine(g.x,g.y,x,b,Lt.x,Lt.y,S/2);Nt?(X.cp2x=X.cp2x+It.x*(Pt-Dt),X.cp2y=X.cp2y+It.y*(Pt-Dt)):(X.cp2x=Rt[0]+It.x*Pt,X.cp2y=Rt[1]+It.y*Pt)}Tt&&this.findEndpoints(l)}else"straight"===X.edgeType&&(X.midX=(Z+it)/2,X.midY=(G+nt)/2);this.projectBezier(l)}}}for(var s=0;s<o.length;s++){var l=o[s],Xt=l._private.rscratch;if(!Xt.haystack){var Vt=2*Math.random()*Math.PI;Xt.source={x:Math.cos(Vt),y:Math.sin(Vt)};var Vt=2*Math.random()*Math.PI;Xt.target={x:Math.cos(Vt),y:Math.sin(Vt)},Xt.edgeType="haystack",Xt.haystack=!0}}return n}},t.prototype.findEndpoints=function(i){var r,n=i.source()[0],a=i.target()[0],o=i._private.style["target-arrow-shape"].value,s=i._private.style["source-arrow-shape"].value,l=a._private.style["border-width"].pxValue,u=n._private.style["border-width"].pxValue,c=i._private.rscratch;if("self"==i._private.rscratch.edgeType){var d=[c.cp2cx,c.cp2cy];r=t.nodeShapes[this.getNodeShape(a)].intersectLine(a._private.position.x,a._private.position.y,this.getNodeWidth(a),this.getNodeHeight(a),d[0],d[1],l/2);var p=e.math.shortenIntersection(r,d,t.arrowShapes[o].spacing(i)),h=e.math.shortenIntersection(r,d,t.arrowShapes[o].gap(i));c.endX=h[0],c.endY=h[1],c.arrowEndX=p[0],c.arrowEndY=p[1];var d=[c.cp2ax,c.cp2ay];r=t.nodeShapes[this.getNodeShape(n)].intersectLine(n._private.position.x,n._private.position.y,this.getNodeWidth(n),this.getNodeHeight(n),d[0],d[1],u/2);var v=e.math.shortenIntersection(r,d,t.arrowShapes[s].spacing(i)),f=e.math.shortenIntersection(r,d,t.arrowShapes[s].gap(i));c.startX=f[0],c.startY=f[1],c.arrowStartX=v[0],c.arrowStartY=v[1]}else if("straight"==c.edgeType){r=t.nodeShapes[this.getNodeShape(a)].intersectLine(a._private.position.x,a._private.position.y,this.getNodeWidth(a),this.getNodeHeight(a),n.position().x,n.position().y,l/2),c.noArrowPlacement=0===r.length?!0:!1;var p=e.math.shortenIntersection(r,[n.position().x,n.position().y],t.arrowShapes[o].spacing(i)),h=e.math.shortenIntersection(r,[n.position().x,n.position().y],t.arrowShapes[o].gap(i));c.endX=h[0],c.endY=h[1],c.arrowEndX=p[0],c.arrowEndY=p[1],r=t.nodeShapes[this.getNodeShape(n)].intersectLine(n._private.position.x,n._private.position.y,this.getNodeWidth(n),this.getNodeHeight(n),a.position().x,a.position().y,u/2),c.noArrowPlacement=0===r.length?!0:!1;var v=e.math.shortenIntersection(r,[a.position().x,a.position().y],t.arrowShapes[s].spacing(i)),f=e.math.shortenIntersection(r,[a.position().x,a.position().y],t.arrowShapes[s].gap(i));c.startX=f[0],c.startY=f[1],c.arrowStartX=v[0],c.arrowStartY=v[1]}else if("bezier"==c.edgeType){var d=[c.cp2x,c.cp2y];r=t.nodeShapes[this.getNodeShape(a)].intersectLine(a._private.position.x,a._private.position.y,this.getNodeWidth(a),this.getNodeHeight(a),d[0],d[1],l/2);var p=e.math.shortenIntersection(r,d,t.arrowShapes[o].spacing(i)),h=e.math.shortenIntersection(r,d,t.arrowShapes[o].gap(i));c.endX=h[0],c.endY=h[1],c.arrowEndX=p[0],c.arrowEndY=p[1],r=t.nodeShapes[this.getNodeShape(n)].intersectLine(n._private.position.x,n._private.position.y,this.getNodeWidth(n),this.getNodeHeight(n),d[0],d[1],u/2);var v=e.math.shortenIntersection(r,d,t.arrowShapes[s].spacing(i)),f=e.math.shortenIntersection(r,d,t.arrowShapes[s].gap(i));c.startX=f[0],c.startY=f[1],c.arrowStartX=v[0],c.arrowStartY=v[1]}else if(c.isArcEdge)return},t.prototype.findEdges=function(e){for(var t=this.getCachedEdges(),i={},r=[],n=0;n<e.length;n++)i[e[n]._private.data.id]=e[n];for(var n=0;n<t.length;n++)(i[t[n]._private.data.source]||i[t[n]._private.data.target])&&r.push(t[n]);return r},t.prototype.getArrowWidth=t.prototype.getArrowHeight=function(e){var t=this.arrowWidthCache=this.arrowWidthCache||{},i=t[e];return i?i:(i=Math.max(Math.pow(13.37*e,.9),29),t[e]=i,i)}}(cytoscape),function(e){"use strict";var t=e("renderer","canvas");t.prototype.drawEdge=function(e,i,r){var n=i._private.rscratch,a=t.usePaths();if(!n.badBezier){var o=i._private.style;if(!(o.width.pxValue<=0)){var s=o["overlay-padding"].pxValue,l=o["overlay-opacity"].value,u=o["overlay-color"].value;if(r){if(0===l)return;this.strokeStyle(e,u[0],u[1],u[2],l),e.lineCap="round","self"!=i._private.rscratch.edgeType||a||(e.lineCap="butt")}else{var c=o["line-color"].value;this.strokeStyle(e,c[0],c[1],c[2],o.opacity.value),e.lineCap="butt"}var d,p,h,v;h=d=i._private.source,v=p=i._private.target;var f=v._private.position,g=v.width(),y=v.height(),m=h._private.position,x=h.width(),b=h.height(),w=o.width.pxValue+(r?2*s:0),_=r?"solid":o["line-style"].value;if(e.lineWidth=w,"haystack"!==n.edgeType,"haystack"===n.edgeType){var E=o["haystack-radius"].value,S=E/2;this.drawStyledEdge(i,e,n.haystackPts=[n.source.x*x*S+m.x,n.source.y*b*S+m.y,n.target.x*g*S+f.x,n.target.y*y*S+f.y],_,w)}else if("self"===n.edgeType){var P=i._private.rscratch,k=[P.startX,P.startY,P.cp2ax,P.cp2ay,P.selfEdgeMidX,P.selfEdgeMidY,P.selfEdgeMidX,P.selfEdgeMidY,P.cp2cx,P.cp2cy,P.endX,P.endY],P=i._private.rscratch;this.drawStyledEdge(i,e,k,_,w)}else if("straight"===n.edgeType){var C=p._private.position.x-d._private.position.x,D=p._private.position.y-d._private.position.y,N=n.endX-n.startX,T=n.endY-n.startY;if(0>C*N+D*T)n.straightEdgeTooShort=!0;else{var P=n;this.drawStyledEdge(i,e,[P.startX,P.startY,P.endX,P.endY],_,w),n.straightEdgeTooShort=!1}}else{var P=n;this.drawStyledEdge(i,e,[P.startX,P.startY,P.cp2x,P.cp2y,P.endX,P.endY],_,w)}"haystack"===n.edgeType?this.drawArrowheads(e,i,r):n.noArrowPlacement!==!0&&void 0!==n.startX&&this.drawArrowheads(e,i,r)}}},t.prototype.drawStyledEdge=function(e,i,r,n){var a,o=e._private.rscratch,s=i,l=!1,u=t.usePaths();if(u){for(var c=r,d=o.pathCacheKey&&c.length===o.pathCacheKey.length,p=d,h=0;p&&h<c.length;h++)o.pathCacheKey[h]!==c[h]&&(p=!1);p?(a=i=o.pathCache,l=!0):(a=i=new Path2D,o.pathCacheKey=c,o.pathCache=a)}switch(n){case"dotted":s.setLineDash([1,1]);break;case"dashed":s.setLineDash([6,3]);break;case"solid":s.setLineDash([])}l||(i.beginPath&&i.beginPath(),i.moveTo(r[0],r[1]),6===r.length?i.quadraticCurveTo(r[2],r[3],r[4],r[5]):12===r.length?(i.quadraticCurveTo(r[2],r[3],r[4],r[5]),i.quadraticCurveTo(r[8],r[9],r[10],r[11])):i.lineTo(r[2],r[3])),i=s,u?i.stroke(a):i.stroke(),i.setLineDash([])},t.prototype.drawArrowheads=function(e,t,i){function r(i,r,n,a,o){var s=f[i+"-arrow-shape"].value;if("none"!==s){var l=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",d.fillStyle(e,255,255,255,1);var u="hollow"===f[i+"-arrow-fill"].value?"both":"filled",c=f[i+"-arrow-fill"].value;"half-triangle-overshot"===s&&(c="hollow",u="hollow"),d.drawArrowShape(t,i,e,u,f.width.pxValue,f[i+"-arrow-shape"].value,r,n,a,o),e.globalCompositeOperation=l;var p=f[i+"-arrow-color"].value;d.fillStyle(e,p[0],p[1],p[2],f.opacity.value),d.drawArrowShape(t,i,e,c,f.width.pxValue,f[i+"-arrow-shape"].value,r,n,a,o)}}if(!i){var n,a,o,s,l,u,c=t._private.rscratch,d=this,p="haystack"===c.edgeType,h=t.source().position(),v=t.target().position();p?(o=c.haystackPts[0],s=c.haystackPts[1],l=c.haystackPts[2],u=c.haystackPts[3]):(o=c.arrowStartX,s=c.arrowStartY,l=c.arrowEndX,u=c.arrowEndY);var f=t._private.style;n=o-h.x,a=s-h.y,p||isNaN(o)||isNaN(s)||isNaN(n)||isNaN(a)||r("source",o,s,n,a);var g=c.midX,y=c.midY;p&&(g=(o+l)/2,y=(s+u)/2),n=o-l,a=s-u,"self"===c.edgeType&&(n=1,a=-1),isNaN(g)||isNaN(y)||r("mid-target",g,y,n,a),n*=-1,a*=-1,isNaN(g)||isNaN(y)||r("mid-source",g,y,n,a),n=l-v.x,a=u-v.y,p||isNaN(l)||isNaN(u)||isNaN(n)||isNaN(a)||r("target",l,u,n,a)}},t.prototype.drawArrowShape=function(e,i,r,n,a,o,s,l,u,c){var d,p=t.usePaths(),h=e._private.rscratch,v=!1,f=r,g={x:s,y:l},y=Math.asin(c/Math.sqrt(u*u+c*c));0>u?y+=Math.PI/2:y=-(Math.PI/2+y);var m=this.getArrowWidth(a),x=t.arrowShapes[o];if(p){var b=m+"$"+o+"$"+y+"$"+s+"$"+l;h.arrowPathCacheKey=h.arrowPathCacheKey||{},h.arrowPathCache=h.arrowPathCache||{};var w=h.arrowPathCacheKey[i]===b;w?(d=r=h.arrowPathCache[i],v=!0):(d=r=new Path2D,h.arrowPathCacheKey[i]=b,h.arrowPathCache[i]=d)}r.beginPath&&r.beginPath(),v||x.draw(r,m,y,g),!x.leavePathOpen&&r.closePath&&r.closePath(),r=f,("filled"===n||"both"===n)&&(p?r.fill(d):r.fill()),("hollow"===n||"both"===n)&&(r.lineWidth=x.matchEdgeWidth?a:1,r.lineJoin="miter",p?r.stroke(d):r.stroke())}}(cytoscape),function(e){"use strict";var t=e("renderer","canvas");t.prototype.getCachedImage=function(e,t){var i=this,r=i.imageCache=i.imageCache||{};if(r[e]&&r[e].image)return r[e].image;var n=r[e]=r[e]||{},a=n.image=new Image;return a.addEventListener("load",t),a.src=e,a},t.prototype.drawInscribedImage=function(e,i,r){var n=this,a=r._private.position.x,o=r._private.position.y,s=r._private.style,l=s["background-fit"].value,u=s["background-position-x"],c=s["background-position-y"],d=s["background-repeat"].value,p=r.width(),h=r.height(),v=r._private.rscratch,f=s["background-clip"].value,g="node"===f,y=s["background-image-opacity"].value,m=i.width,x=i.height;if("contain"===l){var b=Math.min(p/m,h/x);m*=b,x*=b}else if("cover"===l){var b=Math.max(p/m,h/x);m*=b,x*=b}var w=a-p/2;w+="%"===u.units?(p-m)*u.value/100:u.pxValue;var _=o-h/2;_+="%"===c.units?(h-x)*c.value/100:c.pxValue,v.pathCache&&(w-=a,_-=o,a=0,o=0);var E=e.globalAlpha;if(e.globalAlpha=y,"no-repeat"===d)g&&(e.save(),v.pathCache?e.clip(v.pathCache):(t.nodeShapes[n.getNodeShape(r)].drawPath(e,a,o,p,h),e.clip())),e.drawImage(i,0,0,i.width,i.height,w,_,m,x),g&&e.restore();else{var S=e.createPattern(i,d);e.fillStyle=S,t.nodeShapes[n.getNodeShape(r)].drawPath(e,a,o,p,h),e.translate(w,_),e.fill(),e.translate(-w,-_)}e.globalAlpha=E}}(cytoscape),function(e){"use strict";var t=e("renderer","canvas");t.prototype.drawEdgeText=function(e,t){var i=t._private.style.content.strValue;if(!(!i||i.match(/^\s+$/)||this.hideEdgesOnViewport&&(this.dragData.didDrag||this.pinching||this.hoverData.dragging||this.data.wheel||this.swipePanning))){var r=t._private.style["font-size"].pxValue*t.cy().zoom(),n=t._private.style["min-zoomed-font-size"].pxValue;if(!(n>r)){e.textAlign="center",e.textBaseline="middle";var a=t._private.rscratch;this.drawText(e,t,a.labelX,a.labelY)}}},t.prototype.drawNodeText=function(e,t){var i=t._private.style.content.strValue;if(i&&!i.match(/^\s+$/)){var r=t._private.style["font-size"].pxValue*t.cy().zoom(),n=t._private.style["min-zoomed-font-size"].pxValue;if(!(n>r)){var a=t._private.style["text-halign"].strValue,o=t._private.style["text-valign"].strValue,s=t._private.rscratch;switch(a){case"left":e.textAlign="right";break;case"right":e.textAlign="left";break;default:e.textAlign="center"}switch(o){case"top":e.textBaseline="bottom";break;case"bottom":e.textBaseline="top";break;default:e.textBaseline="middle"}this.drawText(e,t,s.labelX,s.labelY)}}},t.prototype.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var i=0;i<this.fontCaches.length;i++)if(t=this.fontCaches[i],t.context===e)return t;return t={context:e},this.fontCaches.push(t),t},t.prototype.setupTextStyle=function(e,t){var i=t.effectiveOpacity(),r=t._private.style,n=r["font-style"].strValue,a=r["font-size"].pxValue+"px",o=r["font-family"].strValue,s=r["font-weight"].strValue,l=r["text-opacity"].value*r.opacity.value*i,u=r.color.value,c=r["text-outline-color"].value,d=t._private.fontKey,p=this.getFontCache(e);p.key!==d&&(e.font=n+" "+s+" "+a+" "+o,p.key=d);var h=String(r.content.value),v=r["text-transform"].value;return"none"==v||("uppercase"==v?h=h.toUpperCase():"lowercase"==v&&(h=h.toLowerCase())),e.lineJoin="round",this.fillStyle(e,u[0],u[1],u[2],l),this.strokeStyle(e,c[0],c[1],c[2],l),h},t.prototype.drawText=function(e,t,i,r){var n=t._private.style,a=t.effectiveOpacity();if(0!==a){var o=this.setupTextStyle(e,t);if(null!=o&&!isNaN(i)&&!isNaN(r)){var s=2*n["text-outline-width"].value;s>0&&(e.lineWidth=s,e.strokeText(o,i,r)),e.fillText(o,i,r)}}}}(cytoscape),function(e){"use strict";var t=e("renderer","canvas");t.prototype.drawNode=function(e,i,r){var n,a,o,s=this,l=i._private.style,u=i._private.rscratch,c=t.usePaths(),d=e,p=!1,h=l["overlay-padding"].pxValue,v=l["overlay-opacity"].value,f=l["overlay-color"].value;if(!r||0!==v){var g=i.effectiveOpacity();if(0!==g)if(n=this.getNodeWidth(i),a=this.getNodeHeight(i),e.lineWidth=l["border-width"].pxValue,void 0!==r&&r)v>0&&(this.fillStyle(e,f[0],f[1],f[2],v),t.nodeShapes.roundrectangle.drawPath(e,i._private.position.x,i._private.position.y,n+2*h,a+2*h),e.fill());else{var y=l["background-color"].value,m=l["border-color"].value,x=l["border-style"].value;switch(this.fillStyle(e,y[0],y[1],y[2],l["background-opacity"].value*l.opacity.value*g),this.strokeStyle(e,m[0],m[1],m[2],l["border-opacity"].value*l.opacity.value*g),e.lineJoin="miter",x){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([])}var b=l["background-image"].value[2]||l["background-image"].value[1],w=l.shape.strValue,_=i._private.position;if(c){var E=w+"$"+n+"$"+a;e.translate(_.x,_.y),u.pathCacheKey===E?(o=e=u.pathCache,p=!0):(o=e=new Path2D,u.pathCacheKey=E,u.pathCache=o)}if(!p){var S=_;c&&(S={x:0,y:0}),t.nodeShapes[this.getNodeShape(i)].drawPath(e,S.x,S.y,n,a)}if(e=d,c?e.fill(o):e.fill(),void 0!==b){var P=this.getCachedImage(b,function(){s.data.canvasNeedsRedraw[t.NODE]=!0,s.data.canvasNeedsRedraw[t.DRAG]=!0,s.redraw()});P.complete&&this.drawInscribedImage(e,P,i)}var k=l["background-blacken"].value,C=l["border-width"].pxValue;if(this.hasPie(i)&&(this.drawPie(e,i),(0!==k||0!==C)&&(c||t.nodeShapes[this.getNodeShape(i)].drawPath(e,_.x,_.y,n,a))),k>0?(this.fillStyle(e,0,0,0,k),c?e.fill(o):e.fill()):0>k&&(this.fillStyle(e,255,255,255,-k),c?e.fill(o):e.fill()),C>0&&(c?e.stroke(o):e.stroke(),"double"===x)){e.lineWidth=l["border-width"].pxValue/3;var D=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",c?e.stroke(o):e.stroke(),e.globalCompositeOperation=D}c&&e.translate(-_.x,-_.y),e.setLineDash([])}}},t.prototype.hasPie=function(e){return e=e[0],e._private.hasPie},t.prototype.drawPie=function(i,r){r=r[0];var n=r._private.style["pie-size"],a=this.getNodeWidth(r),o=this.getNodeHeight(r),s=r._private.position.x,l=r._private.position.y,u=Math.min(a,o)/2,c=0,d=t.usePaths();d&&(s=0,l=0),"%"===n.units?u=u*n.value/100:void 0!==n.pxValue&&(u=n.pxValue/2);for(var p=1;p<=e.style.pieBackgroundN;p++){var h=r._private.style["pie-"+p+"-background-size"].value,v=r._private.style["pie-"+p+"-background-color"].value,f=r._private.style["pie-"+p+"-background-opacity"].value,g=h/100,y=1.5*Math.PI+2*Math.PI*c,m=2*Math.PI*g,x=y+m;0===h||c>=1||c+g>1||(i.beginPath(),i.moveTo(s,l),i.arc(s,l,u,y,x),i.closePath(),this.fillStyle(i,v[0],v[1],v[2],f),i.fill(),c+=g)}}}(cytoscape),function(e){"use strict";var t=e("renderer","canvas");t.prototype.getPixelRatio=function(){var e=this.data.contexts[0];if(null!=this.forcedPixelRatio)return this.forcedPixelRatio;var t=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/t},t.prototype.paintCache=function(e){for(var t,i=this.paintCaches=this.paintCaches||[],r=!0,n=0;n<i.length;n++)if(t=i[n],t.context===e){r=!1;break}return r&&(t={context:e},i.push(t)),t},t.prototype.fillStyle=function(e,t,i,r,n){e.fillStyle="rgba("+t+","+i+","+r+","+n+")"},t.prototype.strokeStyle=function(e,t,i,r,n){e.strokeStyle="rgba("+t+","+i+","+r+","+n+")"},t.prototype.matchCanvasSize=function(e){var i,r=this.data,n=e.clientWidth,a=e.clientHeight,o=this.getPixelRatio(),s=n*o,l=a*o;if(s!==this.canvasWidth||l!==this.canvasHeight){this.fontCaches=null;var u=r.canvasContainer;u.style.width=n+"px",u.style.height=a+"px";for(var c=0;c<t.CANVAS_LAYERS;c++)i=r.canvases[c],(i.width!==s||i.height!==l)&&(i.width=s,i.height=l,i.style.width=n+"px",i.style.height=a+"px");for(var c=0;c<t.BUFFER_COUNT;c++)i=r.bufferCanvases[c],(i.width!==s||i.height!==l)&&(i.width=s,i.height=l,i.style.width=n+"px",i.style.height=a+"px");this.textureMult=1,1>=o&&(i=r.bufferCanvases[t.TEXTURE_BUFFER],this.textureMult=2,i.width=s*this.textureMult,i.height=l*this.textureMult),this.canvasWidth=s,this.canvasHeight=l}},t.prototype.renderTo=function(e,t,i,r){this.redraw({forcedContext:e,forcedZoom:t,forcedPan:i,drawAllLayers:!0,forcedPxRatio:r})},t.prototype.timeToRender=function(){return this.redrawTotalTime/this.redrawCount},t.minRedrawLimit=1e3/60,t.maxRedrawLimit=1e3,t.motionBlurDelay=100,t.prototype.redraw=function(i){function r(){function i(e,t){if(e.setTransform(1,0,0,1,0,0),"motionBlur"===t){var i=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",u.fillStyle(e,255,255,255,.666),e.fillRect(0,0,u.canvasWidth,u.canvasHeight),e.globalCompositeOperation=i}else n||void 0!==t&&!t||e.clearRect(0,0,u.canvasWidth,u.canvasHeight);a||(e.translate(b.x,b.y),e.scale(m,m)),l&&e.translate(l.x,l.y),s&&e.scale(s,s)}function r(e,t){for(var i=e.eles,r=0;r<i.length;r++){var n=i[r];n.isNode()?(u.drawNode(t,n),I||u.drawNodeText(t,n),u.drawNode(t,n,!0)):B||(u.drawEdge(t,n),I||u.drawEdgeText(t,n),u.drawEdge(t,n,!0))}}var f=u.getCachedEdges(),g=d.style()._private.coreStyle,y=d.zoom(),m=void 0!==s?s:y,x=d.pan(),b={x:x.x,y:x.y};l&&(b=l),m*=c,b.x*=c,b.y*=c;var _={drag:{nodes:[],edges:[],eles:[]},nondrag:{nodes:[],edges:[],eles:[]}},E=u.textureOnViewport&&!n&&(u.pinching||u.hoverData.dragging||u.swipePanning||u.data.wheelZooming);if(E){var S;if(!u.textureCache){u.textureCache={},S=u.textureCache.bb=d.elements().boundingBox(),u.textureCache.texture=u.data.bufferCanvases[t.TEXTURE_BUFFER];var P=u.data.bufferContexts[t.TEXTURE_BUFFER];P.setTransform(1,0,0,1,0,0),P.clearRect(0,0,u.canvasWidth*u.textureMult,u.canvasHeight*u.textureMult),u.redraw({forcedContext:P,drawOnlyNodeLayer:!0,forcedPxRatio:c*u.textureMult});var k=u.textureCache.viewport={zoom:d.zoom(),pan:d.pan(),width:u.canvasWidth,height:u.canvasHeight};k.mpan={x:(0-k.pan.x)/k.zoom,y:(0-k.pan.y)/k.zoom}}h[t.DRAG]=!1,h[t.NODE]=!1;var C=p.contexts[t.NODE],D=u.textureCache.texture,k=u.textureCache.viewport;S=u.textureCache.bb,C.setTransform(1,0,0,1,0,0),C.clearRect(0,0,k.width,k.height);var N=g["outside-texture-bg-color"].value,T=g["outside-texture-bg-opacity"].value;u.fillStyle(C,N[0],N[1],N[2],T),C.fillRect(0,0,k.width,k.height);var y=d.zoom();i(C,!1),C.clearRect(k.mpan.x,k.mpan.y,k.width/k.zoom/c,k.height/k.zoom/c),C.drawImage(D,k.mpan.x,k.mpan.y,k.width/k.zoom/c,k.height/k.zoom/c)}else u.textureOnViewport&&!n&&(u.textureCache=null);var M=u.pinching||u.hoverData.dragging||u.swipePanning||u.data.wheelZooming||u.hoverData.draggingEles,B=u.hideEdgesOnViewport&&M,I=u.hideLabelsOnViewport&&M;if(h[t.DRAG]||h[t.NODE]||a||o){B||u.findEdgeControlPoints(f);for(var z=u.getCachedZSortedEles(),L=d.extent(),O=0;O<z.length;O++){var R,X=z[O],S=n?null:X.boundingBox(),V=n?!0:e.math.boundingBoxesIntersect(L,S);V&&(R=X._private.rscratch.inDragLayer?_.drag:_.nondrag,R.eles.push(X))}}var Y=h[t.DRAG]&&!h[t.NODE]&&v&&!u.clearedNodeLayerForMotionBlur;if(Y&&(u.clearedNodeLayerForMotionBlur=!0),h[t.NODE]||a||o||Y){var C=n||p.contexts[t.NODE];i(C,v&&!Y?"motionBlur":void 0),r(_.nondrag,C),a||(h[t.NODE]=!1)}if(!o&&(h[t.DRAG]||a)){var C=n||p.contexts[t.DRAG];i(C,v?"motionBlur":void 0),r(_.drag,C),a||(h[t.DRAG]=!1)}if(u.showFps||!o&&h[t.SELECT_BOX]&&!a){var C=n||p.contexts[t.SELECT_BOX];if(i(C),1==p.select[4]){var y=p.cy.zoom(),A=g["selection-box-border-width"].value/y;C.lineWidth=A,C.fillStyle="rgba("+g["selection-box-color"].value[0]+","+g["selection-box-color"].value[1]+","+g["selection-box-color"].value[2]+","+g["selection-box-opacity"].value+")",C.fillRect(p.select[0],p.select[1],p.select[2]-p.select[0],p.select[3]-p.select[1]),A>0&&(C.strokeStyle="rgba("+g["selection-box-border-color"].value[0]+","+g["selection-box-border-color"].value[1]+","+g["selection-box-border-color"].value[2]+","+g["selection-box-opacity"].value+")",C.strokeRect(p.select[0],p.select[1],p.select[2]-p.select[0],p.select[3]-p.select[1]))}if(p.bgActivePosistion){var y=p.cy.zoom(),q=p.bgActivePosistion;C.fillStyle="rgba("+g["active-bg-color"].value[0]+","+g["active-bg-color"].value[1]+","+g["active-bg-color"].value[2]+","+g["active-bg-opacity"].value+")",C.beginPath(),C.arc(q.x,q.y,g["active-bg-size"].pxValue/y,0,2*Math.PI),C.fill()}var F=u.averageRedrawTime;if(u.showFps&&F){F=Math.round(F);var j=Math.round(1e3/F);C.setTransform(1,0,0,1,0,0),C.fillStyle="rgba(255, 0, 0, 0.75)",C.strokeStyle="rgba(255, 0, 0, 0.75)",C.lineWidth=1,C.fillText("1 frame = "+F+" ms = "+j+" fps",0,20);var W=60;C.strokeRect(0,30,250,20),C.fillRect(0,30,250*Math.min(j/W,1),20)}a||(h[t.SELECT_BOX]=!1)}var H=+new Date;void 0===u.averageRedrawTime&&(u.averageRedrawTime=H-w),void 0===u.redrawCount&&(u.redrawCount=0),u.redrawCount++,void 0===u.redrawTotalTime&&(u.redrawTotalTime=0),u.redrawTotalTime+=H-w,u.lastRedrawTime=H-w,u.averageRedrawTime=u.averageRedrawTime/2+(H-w)/2,u.currentlyDrawing=!1,u.clearingMotionBlur&&(u.clearingMotionBlur=!1,u.motionBlurCleared=!0,u.motionBlur=!0),v&&(u.motionBlurTimeout=setTimeout(function(){u.motionBlurTimeout=null,u.clearedNodeLayerForMotionBlur=!1,u.motionBlur=!1,u.clearingMotionBlur=!0,h[t.NODE]=!0,h[t.DRAG]=!0,u.redraw()},t.motionBlurDelay))}i=i||{};var n=i.forcedContext,a=i.drawAllLayers,o=i.drawOnlyNodeLayer,s=i.forcedZoom,l=i.forcedPan,u=this,c=void 0===i.forcedPxRatio?this.getPixelRatio():i.forcedPxRatio,d=u.data.cy,p=u.data,h=p.canvasNeedsRedraw,v=void 0!==i.motionBlur?i.motionBlur:u.motionBlur;v=v&&!n&&u.motionBlurEnabled,u.motionBlurTimeout&&clearTimeout(u.motionBlurTimeout),this.redrawTimeout&&clearTimeout(this.redrawTimeout),this.redrawTimeout=null,void 0===this.averageRedrawTime&&(this.averageRedrawTime=0);var f=t.minRedrawLimit,g=t.maxRedrawLimit,y=this.averageRedrawTime;y=f>y?f:y,y=g>y?y:g,void 0===this.lastDrawTime&&(this.lastDrawTime=0);var m=+new Date,x=m-this.lastDrawTime,b=x>=y;if(!n){if(!b||this.currentlyDrawing)return void(this.redrawTimeout=setTimeout(function(){u.redraw()},y));this.lastDrawTime=m,this.currentlyDrawing=!0}var w=+new Date;n?r():e.util.requestAnimationFrame(r),n||u.initrender||(u.initrender=!0,d.trigger("initrender"))}}(cytoscape),function(e){"use strict";var t=e("renderer","canvas");t.prototype.drawPolygonPath=function(e,t,i,r,n,a){var o=r/2,s=n/2;e.beginPath&&e.beginPath(),e.moveTo(t+o*a[0],i+s*a[1]);for(var l=1;l<a.length/2;l++)e.lineTo(t+o*a[2*l],i+s*a[2*l+1]);e.closePath()},t.prototype.drawPolygon=function(e,t,i,r,n,a){this.drawPolygonPath(e,t,i,r,n,a),e.fill()},t.prototype.drawRoundRectanglePath=function(t,i,r,n,a){var o=n/2,s=a/2,l=e.math.getRoundRectangleRadius(n,a);t.beginPath&&t.beginPath(),t.moveTo(i,r-s),t.arcTo(i+o,r-s,i+o,r,l),t.arcTo(i+o,r+s,i,r+s,l),t.arcTo(i-o,r+s,i-o,r,l),t.arcTo(i-o,r-s,i,r-s,l),t.lineTo(i,r-s),t.closePath()},t.prototype.drawRoundRectangle=function(e,t,i,r,n,a){this.drawRoundRectanglePath(e,t,i,r,n,a),e.fill()}}(cytoscape),function(e){"use strict";var t=e("renderer","canvas");t.prototype.createBuffer=function(e,t){var i=document.createElement("canvas");return i.width=e,i.height=t,[i,i.getContext("2d")]},t.prototype.bufferCanvasImage=function(e){var t=this.data,i=t.cy,r=i.elements().boundingBox(),n=e.full?Math.ceil(r.w):this.data.container.clientWidth,a=e.full?Math.ceil(r.h):this.data.container.clientHeight,o=1;void 0!==e.scale&&(n*=e.scale,a*=e.scale,o=e.scale);var s=document.createElement("canvas");s.width=n,s.height=a,s.style.width=n+"px",s.style.height=a+"px";var l=s.getContext("2d");if(n>0&&a>0)if(l.clearRect(0,0,n,a),e.bg&&(l.fillStyle=e.bg,l.rect(0,0,n,a),l.fill()),l.globalCompositeOperation="source-over",e.full)this.redraw({forcedContext:l,drawAllLayers:!0,forcedZoom:o,forcedPan:{x:-r.x1*o,y:-r.y1*o},forcedPxRatio:1});else{var u=i.pan(),c={x:u.x*o,y:u.y*o},d=i.zoom()*o;this.redraw({forcedContext:l,drawAllLayers:!0,forcedZoom:d,forcedPan:c,forcedPxRatio:1})}return s},t.prototype.png=function(e){return this.bufferCanvasImage(e).toDataURL("image/png")}}(cytoscape),function(e){"use strict";var t=e("renderer","canvas");t.prototype.registerBinding=function(e,t,i,r){this.bindings.push({target:e,event:t,handler:i,useCapture:r}),e.addEventListener(t,i,r)},t.prototype.nodeIsDraggable=function(e){return 0!==e._private.style.opacity.value&&"visible"==e._private.style.visibility.value&&"element"==e._private.style.display.value&&!e.locked()&&e.grabbable()?!0:!1},t.prototype.load=function(){var i=this,r=function(e){var t;if(e.addToList&&i.data.cy.hasCompoundNodes()){if(!e.addToList.hasId){e.addToList.hasId={};for(var r=0;r<e.addToList.length;r++){var n=e.addToList[r];e.addToList.hasId[n.id()]=!0}}t=e.addToList.hasId}return t||{}},n=function(e,t){if(e._private.cy.hasCompoundNodes())for(var i=r(t),n=e.descendants(),a=0;a<n.size();a++){var o=n[a],s=o._private;t.inDragLayer&&(s.rscratch.inDragLayer=!0),t.addToList&&!i[o.id()]&&(t.addToList.push(o),i[o.id()]=!0,s.grabbed=!0);for(var l=s.edges,u=0;t.inDragLayer&&u<l.length;u++)l[u]._private.rscratch.inDragLayer=!0}},a=function(e,t){var i=e._private,a=r(t);t.inDragLayer&&(i.rscratch.inDragLayer=!0),t.addToList&&!a[e.id()]&&(t.addToList.push(e),a[e.id()]=!0,i.grabbed=!0);for(var s=i.edges,l=0;t.inDragLayer&&l<s.length;l++)s[l]._private.rscratch.inDragLayer=!0;n(e,t),o(e,{inDragLayer:!0})},o=function(e,t){var i=e;if(e._private.cy.hasCompoundNodes()){for(;i.parent().nonempty();)i=i.parent()[0];if(i!=e){for(var n=i.descendants().add(i).not(e).not(e.descendants()),a=n.connectedEdges(),o=r(t),s=0;s<n.size();s++)void 0!==t.inDragLayer&&(n[s]._private.rscratch.inDragLayer=t.inDragLayer),t.addToList&&!o[n[s].id()]&&(t.addToList.push(n[s]),o[n[s].id()]=!0,n[s]._private.grabbed=!0);for(var l=0;void 0!==t.inDragLayer&&l<a.length;l++)a[l]._private.rscratch.inDragLayer=t.inDragLayer}}};i.registerBinding(i.data.container,"DOMNodeRemoved",function(){i.destroy()}),i.registerBinding(window,"resize",e.util.debounce(function(){i.invalidateContainerClientCoordsCache(),i.matchCanvasSize(i.data.container),i.data.canvasNeedsRedraw[t.NODE]=!0,i.redraw()},100));for(var s=function(e){i.registerBinding(e,"scroll",function(){i.invalidateContainerClientCoordsCache()})},l=i.data.cy.container();s(l),l.parentNode;)l=l.parentNode;i.registerBinding(i.data.container,"contextmenu",function(e){e.preventDefault()});var u=function(){return 0!==i.data.select[4]};i.registerBinding(i.data.container,"mousedown",function(r){r.preventDefault(),i.hoverData.capture=!0,i.hoverData.which=r.which;var n=i.data.cy,o=i.projectIntoViewport(r.clientX,r.clientY),s=i.data.select,l=i.findNearestElement(o[0],o[1],!0),u=i.dragData.possibleDragElements,c=new e.Event("grab");if(3==r.which){i.hoverData.cxtStarted=!0;var d=new e.Event(r,{type:"cxttapstart",cyPosition:{x:o[0],y:o[1]}});l?(l.activate(),l.trigger(d),i.hoverData.down=l):n.trigger(d),i.hoverData.downTime=(new Date).getTime(),i.hoverData.cxtDragged=!1}else if(1==r.which){if(l&&l.activate(),null!=l){if(i.nodeIsDraggable(l)){if(l.isNode()&&!l.selected())u=i.dragData.possibleDragElements=[],a(l,{addToList:u}),l.trigger(c);else if(l.isNode()&&l.selected()){u=i.dragData.possibleDragElements=[];for(var p=n.$(function(){return this.isNode()&&this.selected()}),h=0;h<p.length;h++)i.nodeIsDraggable(p[h])&&a(p[h],{addToList:u});l.trigger(c)}i.data.canvasNeedsRedraw[t.NODE]=!0,i.data.canvasNeedsRedraw[t.DRAG]=!0}l.trigger(new e.Event(r,{type:"mousedown",cyPosition:{x:o[0],y:o[1]}})).trigger(new e.Event(r,{type:"tapstart",cyPosition:{x:o[0],y:o[1]}})).trigger(new e.Event(r,{type:"vmousedown",cyPosition:{x:o[0],y:o[1]}}))}else null==l&&n.trigger(new e.Event(r,{type:"mousedown",cyPosition:{x:o[0],y:o[1]}})).trigger(new e.Event(r,{type:"tapstart",cyPosition:{x:o[0],y:o[1]}})).trigger(new e.Event(r,{type:"vmousedown",cyPosition:{x:o[0],y:o[1]}}));if(i.hoverData.down=l,i.hoverData.downTime=(new Date).getTime(),null==l||l.isEdge()){s[4]=1;var v=Math.max(0,t.panOrBoxSelectDelay-(+new Date-i.hoverData.downTime));clearTimeout(i.bgActiveTimeout),i.bgActiveTimeout=setTimeout(function(){l&&l.unactivate(),i.data.bgActivePosistion={x:o[0],y:o[1]},i.data.canvasNeedsRedraw[t.SELECT_BOX]=!0,i.redraw()},v)}}s[0]=s[2]=o[0],s[1]=s[3]=o[1]},!1),i.registerBinding(window,"mousemove",e.util.throttle(function(r){var n=!1,o=i.hoverData.capture;if(!o){var s=i.findContainerClientCoords();if(!(r.clientX>s[0]&&r.clientX<s[0]+i.canvasWidth&&r.clientY>s[1]&&r.clientY<s[1]+i.canvasHeight))return;for(var l=i.data.container,u=r.target,c=u.parentNode,d=!1;c;){if(c===l){d=!0;break}c=c.parentNode}if(!d)return}var p=i.data.cy,h=i.projectIntoViewport(r.clientX,r.clientY),v=i.data.select,f=null;i.hoverData.draggingEles||(f=i.findNearestElement(h[0],h[1],!0));var g=i.hoverData.last,y=i.hoverData.down,m=[h[0]-v[2],h[1]-v[3]],x=i.dragData.possibleDragElements;if(n=!0,null!=f?f.trigger(new e.Event(r,{type:"mousemove",cyPosition:{x:h[0],y:h[1]}})).trigger(new e.Event(r,{type:"vmousemove",cyPosition:{x:h[0],y:h[1]}})).trigger(new e.Event(r,{type:"tapdrag",cyPosition:{x:h[0],y:h[1]}})):null==f&&p.trigger(new e.Event(r,{type:"mousemove",cyPosition:{x:h[0],y:h[1]}})).trigger(new e.Event(r,{type:"vmousemove",cyPosition:{x:h[0],y:h[1]}})).trigger(new e.Event(r,{type:"tapdrag",cyPosition:{x:h[0],y:h[1]}})),3===i.hoverData.which){var b=new e.Event(r,{type:"cxtdrag",cyPosition:{x:h[0],y:h[1]}});y?y.trigger(b):p.trigger(b),i.hoverData.cxtDragged=!0,i.hoverData.cxtOver&&f===i.hoverData.cxtOver||(i.hoverData.cxtOver&&i.hoverData.cxtOver.trigger(new e.Event(r,{type:"cxtdragout",cyPosition:{x:h[0],y:h[1]}})),i.hoverData.cxtOver=f,f&&f.trigger(new e.Event(r,{type:"cxtdragover",cyPosition:{x:h[0],y:h[1]}})))}else if(i.hoverData.dragging){if(n=!0,p.panningEnabled()&&p.userPanningEnabled()){var w={x:m[0]*p.zoom(),y:m[1]*p.zoom()};
p.panBy(w)}h=i.projectIntoViewport(r.clientX,r.clientY)}else if(1==v[4]&&(null==y||y.isEdge())&&(!p.boxSelectionEnabled()||+new Date-i.hoverData.downTime>=t.panOrBoxSelectDelay)&&Math.abs(v[3]-v[1])+Math.abs(v[2]-v[0])<4&&p.panningEnabled()&&p.userPanningEnabled())i.hoverData.dragging=!0,v[4]=0;else{if(p.boxSelectionEnabled()&&Math.pow(v[2]-v[0],2)+Math.pow(v[3]-v[1],2)>7&&v[4]&&(clearTimeout(i.bgActiveTimeout),i.data.bgActivePosistion=void 0,i.data.canvasNeedsRedraw[t.SELECT_BOX]=!0,i.redraw()),y&&y.isEdge()&&y.active()&&y.unactivate(),f!=g&&(g&&(g.trigger(new e.Event(r,{type:"mouseout",cyPosition:{x:h[0],y:h[1]}})),g.trigger(new e.Event(r,{type:"tapdragout",cyPosition:{x:h[0],y:h[1]}}))),f&&(f.trigger(new e.Event(r,{type:"mouseover",cyPosition:{x:h[0],y:h[1]}})),f.trigger(new e.Event(r,{type:"tapdragover",cyPosition:{x:h[0],y:h[1]}}))),i.hoverData.last=f),y&&y.isNode()&&i.nodeIsDraggable(y)){i.dragData.didDrag||(i.data.canvasNeedsRedraw[t.NODE]=!0),i.dragData.didDrag=!0;for(var _=[],E=0;E<x.length;E++){var S=x[E];if(i.hoverData.draggingEles||a(S,{inDragLayer:!0}),S.isNode()&&i.nodeIsDraggable(S)&&S.grabbed()){var P=S._private.position;_.push(S),e.is.number(m[0])&&e.is.number(m[1])&&(P.x+=m[0],P.y+=m[1])}}i.hoverData.draggingEles=!0;var k=new e.Collection(p,_);k.updateCompoundBounds(),k.trigger("position drag"),i.data.canvasNeedsRedraw[t.DRAG]=!0,i.redraw()}n=!0}return v[2]=h[0],v[3]=h[1],n?(r.stopPropagation&&r.stopPropagation(),r.preventDefault&&r.preventDefault(),!1):void 0},1e3/30),!1),i.registerBinding(window,"mouseup",function(r){var n=i.hoverData.capture;if(n){i.hoverData.capture=!1;var a=i.data.cy,s=i.projectIntoViewport(r.clientX,r.clientY),l=i.data.select,u=i.findNearestElement(s[0],s[1],!0),c=i.dragData.possibleDragElements,d=i.hoverData.down,p=r.shiftKey;if(i.data.bgActivePosistion&&(i.data.canvasNeedsRedraw[t.SELECT_BOX]=!0,i.redraw()),i.data.bgActivePosistion=void 0,clearTimeout(i.bgActiveTimeout),i.hoverData.cxtStarted=!1,i.hoverData.draggingEles=!1,d&&d.unactivate(),3===i.hoverData.which){var h=new e.Event(r,{type:"cxttapend",cyPosition:{x:s[0],y:s[1]}});if(d?d.trigger(h):a.trigger(h),!i.hoverData.cxtDragged){var v=new e.Event(r,{type:"cxttap",cyPosition:{x:s[0],y:s[1]}});d?d.trigger(v):a.trigger(v)}i.hoverData.cxtDragged=!1,i.hoverData.which=null}else{if(null!=d||i.dragData.didDrag||Math.pow(l[2]-l[0],2)+Math.pow(l[3]-l[1],2)>7&&l[4]||i.hoverData.dragging||(a.$(function(){return this.selected()}).unselect(),c.length>0&&(i.data.canvasNeedsRedraw[t.NODE]=!0),i.dragData.possibleDragElements=c=[]),null!=u?u.trigger(new e.Event(r,{type:"mouseup",cyPosition:{x:s[0],y:s[1]}})).trigger(new e.Event(r,{type:"tapend",cyPosition:{x:s[0],y:s[1]}})).trigger(new e.Event(r,{type:"vmouseup",cyPosition:{x:s[0],y:s[1]}})):null==u&&a.trigger(new e.Event(r,{type:"mouseup",cyPosition:{x:s[0],y:s[1]}})).trigger(new e.Event(r,{type:"tapend",cyPosition:{x:s[0],y:s[1]}})).trigger(new e.Event(r,{type:"vmouseup",cyPosition:{x:s[0],y:s[1]}})),Math.pow(l[2]-l[0],2)+Math.pow(l[3]-l[1],2)===0&&(null!=u?u.trigger(new e.Event(r,{type:"click",cyPosition:{x:s[0],y:s[1]}})).trigger(new e.Event(r,{type:"tap",cyPosition:{x:s[0],y:s[1]}})).trigger(new e.Event(r,{type:"vclick",cyPosition:{x:s[0],y:s[1]}})):null==u&&a.trigger(new e.Event(r,{type:"click",cyPosition:{x:s[0],y:s[1]}})).trigger(new e.Event(r,{type:"tap",cyPosition:{x:s[0],y:s[1]}})).trigger(new e.Event(r,{type:"vclick",cyPosition:{x:s[0],y:s[1]}}))),u!=d||i.dragData.didDrag||null!=u&&u._private.selectable&&("additive"===a.selectionType()||p?u.selected()?u.unselect():u.select():p||(a.$(":selected").not(u).unselect(),u.select()),i.data.canvasNeedsRedraw[t.NODE]=!0),a.boxSelectionEnabled()&&Math.pow(l[2]-l[0],2)+Math.pow(l[3]-l[1],2)>7&&l[4]){var f=[],g=i.getAllInBox(l[0],l[1],l[2],l[3]);i.data.canvasNeedsRedraw[t.SELECT_BOX]=!0,g.length>0&&(i.data.canvasNeedsRedraw[t.NODE]=!0);for(var y=0;y<g.length;y++)g[y]._private.selectable&&f.push(g[y]);var m=new e.Collection(a,f);"additive"===a.selectionType()?m.select():(p||a.$(":selected").not(m).unselect(),m.select()),i.redraw()}if(i.hoverData.dragging&&(i.data.canvasNeedsRedraw[t.SELECT_BOX]=!0,i.redraw()),i.hoverData.dragging=!1,!l[4]){i.data.canvasNeedsRedraw[t.DRAG]=!0,i.data.canvasNeedsRedraw[t.NODE]=!0;for(var y=0;y<c.length;y++)if("nodes"===c[y]._private.group){c[y]._private.rscratch.inDragLayer=!1,c[y]._private.grabbed=!1;for(var x=c[y]._private.edges,b=0;b<x.length;b++)x[b]._private.rscratch.inDragLayer=!1;o(c[y],{inDragLayer:!1})}else"edges"===c[y]._private.group&&(c[y]._private.rscratch.inDragLayer=!1);d&&d.trigger("free")}}l[4]=0,i.hoverData.down=null,i.dragData.didDrag=!1}},!1);var c=function(e){var r=i.data.cy,n=i.projectIntoViewport(e.clientX,e.clientY),a=[n[0]*r.zoom()+r.pan().x,n[1]*r.zoom()+r.pan().y];if(i.hoverData.draggingEles||i.hoverData.dragging||i.hoverData.cxtStarted||u())return void e.preventDefault();if(r.panningEnabled()&&r.userPanningEnabled()&&r.zoomingEnabled()&&r.userZoomingEnabled()){e.preventDefault(),i.data.wheelZooming=!0,clearTimeout(i.data.wheelTimeout),i.data.wheelTimeout=setTimeout(function(){i.data.wheelZooming=!1,i.data.canvasNeedsRedraw[t.NODE]=!0,i.redraw()},150);var o=e.wheelDeltaY/1e3||e.wheelDelta/1e3||e.detail/-32||-e.deltaY/500;o*=i.wheelSensitivity,r.zoom({level:r.zoom()*Math.pow(10,o),renderedPosition:{x:a[0],y:a[1]}})}};i.registerBinding(i.data.container,"wheel",c,!0),i.registerBinding(i.data.container,"mousewheel",c,!0),i.registerBinding(i.data.container,"DOMMouseScroll",c,!0),i.registerBinding(i.data.container,"MozMousePixelScroll",function(){},!1),i.registerBinding(i.data.container,"mouseout",function(t){var r=i.projectIntoViewport(t.clientX,t.clientY);i.data.cy.trigger(new e.Event(t,{type:"mouseout",cyPosition:{x:r[0],y:r[1]}}))},!1),i.registerBinding(i.data.container,"mouseover",function(t){var r=i.projectIntoViewport(t.clientX,t.clientY);i.data.cy.trigger(new e.Event(t,{type:"mouseover",cyPosition:{x:r[0],y:r[1]}}))},!1);var d,p,h,v,f,g,y,m,x,b,w,_,E=function(e,t,i,r){return Math.sqrt((i-e)*(i-e)+(r-t)*(r-t))};i.registerBinding(i.data.container,"touchstart",function(r){clearTimeout(this.threeFingerSelectTimeout),r.target!==i.data.link&&r.preventDefault(),i.touchData.capture=!0,i.data.bgActivePosistion=void 0;var n=i.data.cy,o=i.getCachedNodes(),s=i.getCachedEdges(),l=i.touchData.now,u=i.touchData.earlier;if(r.touches[0]){var c=i.projectIntoViewport(r.touches[0].clientX,r.touches[0].clientY);l[0]=c[0],l[1]=c[1]}if(r.touches[1]){var c=i.projectIntoViewport(r.touches[1].clientX,r.touches[1].clientY);l[2]=c[0],l[3]=c[1]}if(r.touches[2]){var c=i.projectIntoViewport(r.touches[2].clientX,r.touches[2].clientY);l[4]=c[0],l[5]=c[1]}if(r.touches[1]){var S=function(e){for(var t=0;t<e.length;t++)e[t]._private.grabbed=!1,e[t]._private.rscratch.inDragLayer=!1,e[t].active()&&e[t].unactivate()};S(o),S(s);var P=i.findContainerClientCoords();m=P[0],x=P[1],b=P[2],w=P[3],d=r.touches[0].clientX-m,p=r.touches[0].clientY-x,h=r.touches[1].clientX-m,v=r.touches[1].clientY-x,_=d>=0&&b>=d&&h>=0&&b>=h&&p>=0&&w>=p&&v>=0&&w>=v;var k=n.pan(),C=n.zoom();if(f=E(d,p,h,v),g=[(d+h)/2,(p+v)/2],y=[(g[0]-k.x)/C,(g[1]-k.y)/C],200>f&&!r.touches[2]){var D=i.findNearestElement(l[0],l[1],!0),N=i.findNearestElement(l[2],l[3],!0);return D&&D.isNode()?(D.activate().trigger(new e.Event(r,{type:"cxttapstart",cyPosition:{x:l[0],y:l[1]}})),i.touchData.start=D):N&&N.isNode()?(N.activate().trigger(new e.Event(r,{type:"cxttapstart",cyPosition:{x:l[0],y:l[1]}})),i.touchData.start=N):(n.trigger(new e.Event(r,{type:"cxttapstart",cyPosition:{x:l[0],y:l[1]}})),i.touchData.start=null),i.touchData.start&&(i.touchData.start._private.grabbed=!1),i.touchData.cxt=!0,i.touchData.cxtDragged=!1,i.data.bgActivePosistion=void 0,void i.redraw()}}if(r.touches[2]);else if(r.touches[1]);else if(r.touches[0]){var T=i.findNearestElement(l[0],l[1],!0);if(null!=T){if(T.activate(),i.touchData.start=T,T.isNode()&&i.nodeIsDraggable(T)){var M=i.dragData.touchDragEles=[];if(i.data.canvasNeedsRedraw[t.NODE]=!0,i.data.canvasNeedsRedraw[t.DRAG]=!0,T.selected())for(var B=n.$(function(){return this.isNode()&&this.selected()}),I=0;I<B.length;I++){var z=B[I];i.nodeIsDraggable(z)&&a(z,{addToList:M})}else a(T,{addToList:M});T.trigger("grab")}T.trigger(new e.Event(r,{type:"touchstart",cyPosition:{x:l[0],y:l[1]}})).trigger(new e.Event(r,{type:"tapstart",cyPosition:{x:l[0],y:l[1]}})).trigger(new e.Event(r,{type:"vmousdown",cyPosition:{x:l[0],y:l[1]}}))}null==T&&(n.trigger(new e.Event(r,{type:"touchstart",cyPosition:{x:l[0],y:l[1]}})).trigger(new e.Event(r,{type:"tapstart",cyPosition:{x:l[0],y:l[1]}})).trigger(new e.Event(r,{type:"vmousedown",cyPosition:{x:l[0],y:l[1]}})),i.data.bgActivePosistion={x:c[0],y:c[1]},i.data.canvasNeedsRedraw[t.SELECT_BOX]=!0,i.redraw());for(var L=0;L<l.length;L++)u[L]=l[L],i.touchData.startPosition[L]=l[L];i.touchData.singleTouchMoved=!1,i.touchData.singleTouchStartTime=+new Date,setTimeout(function(){i.touchData.singleTouchMoved===!1&&+new Date-i.touchData.singleTouchStartTime>250&&(i.touchData.start?i.touchData.start.trigger(new e.Event(r,{type:"taphold",cyPosition:{x:l[0],y:l[1]}})):(i.data.cy.trigger(new e.Event(r,{type:"taphold",cyPosition:{x:l[0],y:l[1]}})),n.$(":selected").unselect()))},1e3)}},!1),i.registerBinding(window,"touchmove",e.util.throttle(function(r){var n=i.data.select,o=i.touchData.capture;o&&r.preventDefault();var s=i.data.cy,l=i.touchData.now,u=i.touchData.earlier;if(r.touches[0]){var c=i.projectIntoViewport(r.touches[0].clientX,r.touches[0].clientY);l[0]=c[0],l[1]=c[1]}if(r.touches[1]){var c=i.projectIntoViewport(r.touches[1].clientX,r.touches[1].clientY);l[2]=c[0],l[3]=c[1]}if(r.touches[2]){var c=i.projectIntoViewport(r.touches[2].clientX,r.touches[2].clientY);l[4]=c[0],l[5]=c[1]}for(var g=[],b=0;b<l.length;b++)g[b]=l[b]-u[b];if(o&&i.touchData.cxt){var w=r.touches[0].clientX-m,S=r.touches[0].clientY-x,P=r.touches[1].clientX-m,k=r.touches[1].clientY-x,C=E(w,S,P,k),D=C/f;if(D>=1.5||C>=150){i.touchData.cxt=!1,i.touchData.start&&(i.touchData.start.unactivate(),i.touchData.start=null),i.data.bgActivePosistion=void 0,i.data.canvasNeedsRedraw[t.SELECT_BOX]=!0;var N=new e.Event(r,{type:"cxttapend",cyPosition:{x:l[0],y:l[1]}});i.touchData.start?i.touchData.start.trigger(N):s.trigger(N)}}if(o&&i.touchData.cxt){var N=new e.Event(r,{type:"cxtdrag",cyPosition:{x:l[0],y:l[1]}});i.data.bgActivePosistion=void 0,i.data.canvasNeedsRedraw[t.SELECT_BOX]=!0,i.touchData.start?i.touchData.start.trigger(N):s.trigger(N),i.touchData.start&&(i.touchData.start._private.grabbed=!1),i.touchData.cxtDragged=!0;var T=i.findNearestElement(l[0],l[1],!0);i.touchData.cxtOver&&T===i.touchData.cxtOver||(i.touchData.cxtOver&&i.touchData.cxtOver.trigger(new e.Event(r,{type:"cxtdragout",cyPosition:{x:l[0],y:l[1]}})),i.touchData.cxtOver=T,T&&T.trigger(new e.Event(r,{type:"cxtdragover",cyPosition:{x:l[0],y:l[1]}})))}else if(o&&r.touches[2]&&s.boxSelectionEnabled())i.data.bgActivePosistion=void 0,clearTimeout(this.threeFingerSelectTimeout),this.lastThreeTouch=+new Date,i.data.canvasNeedsRedraw[t.SELECT_BOX]=!0,n&&0!==n.length&&void 0!==n[0]?(n[2]=(l[0]+l[2]+l[4])/3,n[3]=(l[1]+l[3]+l[5])/3):(n[0]=(l[0]+l[2]+l[4])/3,n[1]=(l[1]+l[3]+l[5])/3,n[2]=(l[0]+l[2]+l[4])/3+1,n[3]=(l[1]+l[3]+l[5])/3+1),n[4]=1,i.redraw();else if(o&&r.touches[1]&&s.zoomingEnabled()&&s.panningEnabled()&&s.userZoomingEnabled()&&s.userPanningEnabled()){i.data.bgActivePosistion=void 0,i.data.canvasNeedsRedraw[t.SELECT_BOX]=!0;var M=i.dragData.touchDragEles;if(M){i.data.canvasNeedsRedraw[t.DRAG]=!0;for(var B=0;B<M.length;B++)M[B]._private.grabbed=!1,M[B]._private.rscratch.inDragLayer=!1}var w=r.touches[0].clientX-m,S=r.touches[0].clientY-x,P=r.touches[1].clientX-m,k=r.touches[1].clientY-x,C=E(w,S,P,k),D=C/f;if(1!=D&&_){var I=w-d,z=S-p,L=P-h,O=k-v,R=(I+L)/2,X=(z+O)/2,V=s.zoom(),Y=V*D,A=s.pan(),q=y[0]*V+A.x,F=y[1]*V+A.y,j={x:-Y/V*(q-A.x-R)+q,y:-Y/V*(F-A.y-X)+F};if(i.touchData.start){var M=i.dragData.touchDragEles;if(M)for(var B=0;B<M.length;B++)M[B]._private.grabbed=!1,M[B]._private.rscratch.inDragLayer=!1;i.touchData.start._private.active=!1,i.touchData.start._private.grabbed=!1,i.touchData.start._private.rscratch.inDragLayer=!1,i.data.canvasNeedsRedraw[t.DRAG]=!0,i.touchData.start.trigger("free").trigger("unactivate")}s.viewport({zoom:Y,pan:j,cancelOnFailedZoom:!0}),f=C,d=w,p=S,h=P,v=k,i.pinching=!0}if(r.touches[0]){var c=i.projectIntoViewport(r.touches[0].clientX,r.touches[0].clientY);l[0]=c[0],l[1]=c[1]}if(r.touches[1]){var c=i.projectIntoViewport(r.touches[1].clientX,r.touches[1].clientY);l[2]=c[0],l[3]=c[1]}if(r.touches[2]){var c=i.projectIntoViewport(r.touches[2].clientX,r.touches[2].clientY);l[4]=c[0],l[5]=c[1]}}else if(r.touches[0]){var W=i.touchData.start,H=i.touchData.last,T=T||i.findNearestElement(l[0],l[1],!0);if(null!=W&&"nodes"==W._private.group&&i.nodeIsDraggable(W)){for(var M=i.dragData.touchDragEles,$=0;$<M.length;$++){var Z=M[$];if(i.nodeIsDraggable(Z)&&Z.isNode()&&Z.grabbed()){i.dragData.didDrag=!0;var U=Z._private.position;U.x+=g[0],U.y+=g[1],i.hoverData.draggingEles||a(Z,{inDragLayer:!0})}}var G=new e.Collection(s,Z);G.updateCompoundBounds(),G.trigger("position drag"),i.hoverData.draggingEles=!0,i.data.canvasNeedsRedraw[t.DRAG]=!0,i.touchData.startPosition[0]==u[0]&&i.touchData.startPosition[1]==u[1]&&(i.data.canvasNeedsRedraw[t.NODE]=!0),i.redraw()}null!=W&&(W.trigger(new e.Event(r,{type:"touchmove",cyPosition:{x:l[0],y:l[1]}})),W.trigger(new e.Event(r,{type:"tapdrag",cyPosition:{x:l[0],y:l[1]}})),W.trigger(new e.Event(r,{type:"vmousemove",cyPosition:{x:l[0],y:l[1]}}))),null==W&&(null!=T&&(T.trigger(new e.Event(r,{type:"touchmove",cyPosition:{x:l[0],y:l[1]}})),T.trigger(new e.Event(r,{type:"tapdrag",cyPosition:{x:l[0],y:l[1]}})),T.trigger(new e.Event(r,{type:"vmousemove",cyPosition:{x:l[0],y:l[1]}}))),null==T&&(s.trigger(new e.Event(r,{type:"touchmove",cyPosition:{x:l[0],y:l[1]}})),s.trigger(new e.Event(r,{type:"tapdrag",cyPosition:{x:l[0],y:l[1]}})),s.trigger(new e.Event(r,{type:"vmousemove",cyPosition:{x:l[0],y:l[1]}})))),T!=H&&(H&&H.trigger(new e.Event(r,{type:"tapdragout",cyPosition:{x:l[0],y:l[1]}})),T&&T.trigger(new e.Event(r,{type:"tapdragover",cyPosition:{x:l[0],y:l[1]}}))),i.touchData.last=T;for(var B=0;B<l.length;B++)l[B]&&i.touchData.startPosition[B]&&Math.abs(l[B]-i.touchData.startPosition[B])>4&&(i.touchData.singleTouchMoved=!0);if(o&&(null==W||W.isEdge())&&s.panningEnabled()&&s.userPanningEnabled()){W&&(W.unactivate(),i.data.bgActivePosistion||(i.data.bgActivePosistion={x:l[0],y:l[1]}),i.data.canvasNeedsRedraw[t.SELECT_BOX]=!0,i.touchData.start=null),s.panBy({x:g[0]*s.zoom(),y:g[1]*s.zoom()}),i.swipePanning=!0;var c=i.projectIntoViewport(r.touches[0].clientX,r.touches[0].clientY);l[0]=c[0],l[1]=c[1]}}for(var b=0;b<l.length;b++)u[b]=l[b]},1e3/30),!1),i.registerBinding(window,"touchcancel",function(){var e=i.touchData.start;i.touchData.capture=!1,e&&e.unactivate()}),i.registerBinding(window,"touchend",function(r){var n=i.touchData.start,a=i.touchData.capture;if(a){i.touchData.capture=!1,r.preventDefault();var s=i.data.select;i.swipePanning=!1,i.hoverData.draggingEles=!1;var l=i.data.cy,u=i.touchData.now,c=i.touchData.earlier;if(r.touches[0]){var d=i.projectIntoViewport(r.touches[0].clientX,r.touches[0].clientY);u[0]=d[0],u[1]=d[1]}if(r.touches[1]){var d=i.projectIntoViewport(r.touches[1].clientX,r.touches[1].clientY);u[2]=d[0],u[3]=d[1]}if(r.touches[2]){var d=i.projectIntoViewport(r.touches[2].clientX,r.touches[2].clientY);u[4]=d[0],u[5]=d[1]}n&&n.unactivate();var p;if(i.touchData.cxt){if(p=new e.Event(r,{type:"cxttapend",cyPosition:{x:u[0],y:u[1]}}),n?n.trigger(p):l.trigger(p),!i.touchData.cxtDragged){var h=new e.Event(r,{type:"cxttap",cyPosition:{x:u[0],y:u[1]}});n?n.trigger(h):l.trigger(h)}return i.touchData.start&&(i.touchData.start._private.grabbed=!1),i.touchData.cxt=!1,i.touchData.start=null,void i.redraw()}if(!r.touches[2]&&l.boxSelectionEnabled()){clearTimeout(this.threeFingerSelectTimeout);var v=[],f=i.getAllInBox(s[0],s[1],s[2],s[3]);s[0]=void 0,s[1]=void 0,s[2]=void 0,s[3]=void 0,s[4]=0,i.data.canvasNeedsRedraw[t.SELECT_BOX]=!0;for(var g=0;g<f.length;g++)f[g]._private.selectable&&v.push(f[g]);var y=new e.Collection(l,v);"single"===l.selectionType()&&l.$(":selected").not(y).unselect(),y.select(),y.length>0?i.data.canvasNeedsRedraw[t.NODE]=!0:i.redraw()}r.touches.length<2&&(i.pinching=!1,i.data.canvasNeedsRedraw[t.NODE]=!0,i.redraw());var m=!1;if(null!=n&&(n._private.active=!1,m=!0,n.unactivate()),r.touches[2])i.data.bgActivePosistion=void 0,i.data.canvasNeedsRedraw[t.SELECT_BOX]=!0;else if(r.touches[1]);else if(r.touches[0]);else if(!r.touches[0]){if(i.data.bgActivePosistion=void 0,i.data.canvasNeedsRedraw[t.SELECT_BOX]=!0,null!=n){n._private.grabbed&&(n._private.grabbed=!1,n.trigger("free"),n._private.rscratch.inDragLayer=!1);for(var x=n._private.edges,b=0;b<x.length;b++)x[b]._private.rscratch.inDragLayer=!1;if(o(n,!1),n.selected())for(var w=l.$("node:selected"),_=0;_<w.length;_++){var E=w[_];E._private.rscratch.inDragLayer=!1,E._private.grabbed=!1;for(var x=E._private.edges,b=0;b<x.length;b++)x[b]._private.rscratch.inDragLayer=!1;o(E,!1)}i.data.canvasNeedsRedraw[t.DRAG]=!0,i.data.canvasNeedsRedraw[t.NODE]=!0,n.trigger(new e.Event(r,{type:"touchend",cyPosition:{x:u[0],y:u[1]}})).trigger(new e.Event(r,{type:"tapend",cyPosition:{x:u[0],y:u[1]}})).trigger(new e.Event(r,{type:"vmouseup",cyPosition:{x:u[0],y:u[1]}})),n.unactivate(),i.touchData.start=null}else{var S=i.findNearestElement(u[0],u[1],!0);null!=S&&S.trigger(new e.Event(r,{type:"touchend",cyPosition:{x:u[0],y:u[1]}})).trigger(new e.Event(r,{type:"tapend",cyPosition:{x:u[0],y:u[1]}})).trigger(new e.Event(r,{type:"vmouseup",cyPosition:{x:u[0],y:u[1]}})),null==S&&l.trigger(new e.Event(r,{type:"touchend",cyPosition:{x:u[0],y:u[1]}})).trigger(new e.Event(r,{type:"tapend",cyPosition:{x:u[0],y:u[1]}})).trigger(new e.Event(r,{type:"vmouseup",cyPosition:{x:u[0],y:u[1]}}))}null!=n&&!i.dragData.didDrag&&n._private.selectable&&Math.sqrt(Math.pow(i.touchData.startPosition[0]-u[0],2)+Math.pow(i.touchData.startPosition[1]-u[1],2))<6&&("single"===l.selectionType()?(l.$(":selected").not(n).unselect(),n.select()):n.selected()?n.unselect():n.select(),m=!0,i.data.canvasNeedsRedraw[t.NODE]=!0),i.touchData.singleTouchMoved===!1&&(n?n.trigger(new e.Event(r,{type:"tap",cyPosition:{x:u[0],y:u[1]}})).trigger(new e.Event(r,{type:"vclick",cyPosition:{x:u[0],y:u[1]}})):l.trigger(new e.Event(r,{type:"tap",cyPosition:{x:u[0],y:u[1]}})).trigger(new e.Event(r,{type:"vclick",cyPosition:{x:u[0],y:u[1]}}))),i.touchData.singleTouchMoved=!0}for(var b=0;b<u.length;b++)c[b]=u[b];i.dragData.didDrag=!1,m&&n&&n.updateStyle(!1)}},!1)}}(cytoscape),function(e){"use strict";for(var t=e("renderer","canvas"),i=t.prototype,r=t.usePaths(),n=t.nodeShapes={},a=Math.sin(0),o=Math.cos(0),s={},l={},u=.1,c=0*Math.PI;c<2*Math.PI;c+=u)s[c]=Math.sin(c),l[c]=Math.cos(c);n.ellipse={draw:function(e,t,i,r,a){n.ellipse.drawPath(e,t,i,r,a),e.fill()},drawPath:function(e,t,i,n,c){if(r){e.beginPath&&e.beginPath();for(var d,p,h=n/2,v=c/2,f=0*Math.PI;f<2*Math.PI;f+=u)d=t-h*s[f]*a+h*l[f]*o,p=i+v*l[f]*a+v*s[f]*o,0===f?e.moveTo(d,p):e.lineTo(d,p);e.closePath()}else e.beginPath&&e.beginPath(),e.translate(t,i),e.scale(n/2,c/2),e.arc(0,0,1,0,2*Math.PI*.999,!1),e.closePath(),e.scale(2/n,2/c),e.translate(-t,-i)},intersectLine:function(t,i,r,n,a,o,s){var l=e.math.intersectLineEllipse(a,o,t,i,r/2+s,n/2+s);return l},intersectBox:function(t,i,r,n,a,o,s,l,u){return e.math.boxIntersectEllipse(t,i,r,n,u,a,o,s,l)},checkPoint:function(e,t,i,r,n,a,o){return e-=a,t-=o,e/=r/2+i,t/=n/2+i,Math.pow(e,2)+Math.pow(t,2)<=1}},n.triangle={points:e.math.generateUnitNgonPointsFitToSquare(3,0),draw:function(e,t,r,a,o){i.drawPolygon(e,t,r,a,o,n.triangle.points)},drawPath:function(e,t,r,a,o){i.drawPolygonPath(e,t,r,a,o,n.triangle.points)},intersectLine:function(t,i,r,a,o,s,l){return e.math.polygonIntersectLine(o,s,n.triangle.points,t,i,r/2,a/2,l)},intersectBox:function(t,i,r,a,o,s,l,u,c){var d=n.triangle.points;return e.math.boxIntersectPolygon(t,i,r,a,d,o,s,l,u,[0,-1],c)},checkPoint:function(t,i,r,a,o,s,l){return e.math.pointInsidePolygon(t,i,n.triangle.points,s,l,a,o,[0,-1],r)}},n.square={points:e.math.generateUnitNgonPointsFitToSquare(4,0),draw:function(e,t,r,a,o){i.drawPolygon(e,t,r,a,o,n.square.points)},drawPath:function(e,t,r,a,o){i.drawPolygonPath(e,t,r,a,o,n.square.points)},intersectLine:function(t,i,r,a,o,s,l){return e.math.polygonIntersectLine(o,s,n.square.points,t,i,r/2,a/2,l)},intersectBox:function(t,i,r,a,o,s,l,u,c){var d=n.square.points;return e.math.boxIntersectPolygon(t,i,r,a,d,o,s,l,u,[0,-1],c)},checkPoint:function(t,i,r,a,o,s,l){return e.math.pointInsidePolygon(t,i,n.square.points,s,l,a,o,[0,-1],r)}},n.rectangle=n.square,n.octogon={},n.roundrectangle={points:e.math.generateUnitNgonPointsFitToSquare(4,0),draw:function(e,t,r,n,a){i.drawRoundRectangle(e,t,r,n,a,10)},drawPath:function(e,t,r,n,a){i.drawRoundRectanglePath(e,t,r,n,a,10)},intersectLine:function(t,i,r,n,a,o,s){return e.math.roundRectangleIntersectLine(a,o,t,i,r,n,s)},intersectBox:function(t,i,r,n,a,o,s,l,u){return e.math.roundRectangleIntersectBox(t,i,r,n,a,o,s,l,u)},checkPoint:function(t,i,r,a,o,s,l){var u=e.math.getRoundRectangleRadius(a,o);if(e.math.pointInsidePolygon(t,i,n.roundrectangle.points,s,l,a,o-2*u,[0,-1],r))return!0;if(e.math.pointInsidePolygon(t,i,n.roundrectangle.points,s,l,a-2*u,o,[0,-1],r))return!0;var c=function(e,t,i,r,n,a,o){return e-=i,t-=r,e/=n/2+o,t/=a/2+o,Math.pow(e,2)+Math.pow(t,2)<=1};return c(t,i,s-a/2+u,l-o/2+u,2*u,2*u,r)?!0:c(t,i,s+a/2-u,l-o/2+u,2*u,2*u,r)?!0:c(t,i,s+a/2-u,l+o/2-u,2*u,2*u,r)?!0:c(t,i,s-a/2+u,l+o/2-u,2*u,2*u,r)?!0:!1}},n.pentagon={points:e.math.generateUnitNgonPointsFitToSquare(5,0),draw:function(e,t,r,a,o){i.drawPolygon(e,t,r,a,o,n.pentagon.points)},drawPath:function(e,t,r,a,o){i.drawPolygonPath(e,t,r,a,o,n.pentagon.points)},intersectLine:function(e,t,r,a,o,s,l){return i.polygonIntersectLine(o,s,n.pentagon.points,e,t,r/2,a/2,l)},intersectBox:function(t,i,r,a,o,s,l,u,c){var d=n.pentagon.points;return e.math.boxIntersectPolygon(t,i,r,a,d,o,s,l,u,[0,-1],c)},checkPoint:function(t,i,r,a,o,s,l){return e.math.pointInsidePolygon(t,i,n.pentagon.points,s,l,a,o,[0,-1],r)}},n.hexagon={points:e.math.generateUnitNgonPointsFitToSquare(6,0),draw:function(e,t,r,a,o){i.drawPolygon(e,t,r,a,o,n.hexagon.points)},drawPath:function(e,t,r,a,o){i.drawPolygonPath(e,t,r,a,o,n.hexagon.points)},intersectLine:function(t,i,r,a,o,s,l){return e.math.polygonIntersectLine(o,s,n.hexagon.points,t,i,r/2,a/2,l)},intersectBox:function(t,i,r,a,o,s,l,u,c){var d=n.hexagon.points;return e.math.boxIntersectPolygon(t,i,r,a,d,o,s,l,u,[0,-1],c)},checkPoint:function(t,i,r,a,o,s,l){return e.math.pointInsidePolygon(t,i,n.hexagon.points,s,l,a,o,[0,-1],r)}},n.heptagon={points:e.math.generateUnitNgonPointsFitToSquare(7,0),draw:function(e,t,r,a,o){i.drawPolygon(e,t,r,a,o,n.heptagon.points)},drawPath:function(e,t,r,a,o){i.drawPolygonPath(e,t,r,a,o,n.heptagon.points)},intersectLine:function(e,t,r,a,o,s,l){return i.polygonIntersectLine(o,s,n.heptagon.points,e,t,r/2,a/2,l)},intersectBox:function(e,t,r,a,o,s,l,u,c){var d=n.heptagon.points;return i.boxIntersectPolygon(e,t,r,a,d,o,s,l,u,[0,-1],c)},checkPoint:function(t,i,r,a,o,s,l){return e.math.pointInsidePolygon(t,i,n.heptagon.points,s,l,a,o,[0,-1],r)}},n.octagon={points:e.math.generateUnitNgonPointsFitToSquare(8,0),draw:function(e,t,r,a,o){i.drawPolygon(e,t,r,a,o,n.octagon.points)},drawPath:function(e,t,r,a,o){i.drawPolygonPath(e,t,r,a,o,n.octagon.points)},intersectLine:function(e,t,r,a,o,s,l){return i.polygonIntersectLine(o,s,n.octagon.points,e,t,r/2,a/2,l)},intersectBox:function(e,t,r,a,o,s,l,u,c){var d=n.octagon.points;return i.boxIntersectPolygon(e,t,r,a,d,o,s,l,u,[0,-1],c)},checkPoint:function(t,i,r,a,o,s,l){return e.math.pointInsidePolygon(t,i,n.octagon.points,s,l,a,o,[0,-1],r)}};var d=new Array(20),p=e.math.generateUnitNgonPoints(5,0),h=e.math.generateUnitNgonPoints(5,Math.PI/5),v=.5*(3-Math.sqrt(5));v*=1.57;for(var c=0;c<h.length/2;c++)h[2*c]*=v,h[2*c+1]*=v;for(var c=0;5>c;c++)d[4*c]=p[2*c],d[4*c+1]=p[2*c+1],d[4*c+2]=h[2*c],d[4*c+3]=h[2*c+1];d=e.math.fitPolygonToSquare(d),n.star5=n.star={points:d,draw:function(e,t,r,a,o){i.drawPolygon(e,t,r,a,o,n.star5.points)},drawPath:function(e,t,r,a,o){i.drawPolygonPath(e,t,r,a,o,n.star5.points)},intersectLine:function(e,t,r,a,o,s,l){return i.polygonIntersectLine(o,s,n.star5.points,e,t,r/2,a/2,l)},intersectBox:function(e,t,r,a,o,s,l,u,c){var d=n.star5.points;return i.boxIntersectPolygon(e,t,r,a,d,o,s,l,u,[0,-1],c)},checkPoint:function(t,i,r,a,o,s,l){return e.math.pointInsidePolygon(t,i,n.star5.points,s,l,a,o,[0,-1],r)}}}(cytoscape),function(e){"use strict";function t(t){this._private={},this._private.options=e.util.extend({},i,t)}var i={animate:!0,maxSimulationTime:4e3,fit:!0,padding:30,boundingBox:void 0,ungrabifyWhileSimulating:!1,ready:void 0,stop:void 0,repulsion:void 0,stiffness:void 0,friction:void 0,gravity:!0,fps:void 0,precision:void 0,nodeMass:void 0,edgeLength:void 0,stepSize:.1,stableEnergy:function(e){var t=e;return t.max<=.5||t.mean<=.3},infinite:!1};t.prototype.run=function(){var t=this,i=this._private.options;return e.util.require("arbor",function(r){function n(e,t){return null==t?void 0:"function"==typeof t?t.apply(e,[e._private.data,{nodes:u.length,edges:c.length,element:e}]):t}function a(e){if(!e.isFullAutoParent()){var t=e._private.data.id,r=n(e,i.nodeMass),a=e._private.locked,o=e.position(),s=h.fromScreen({x:o.x,y:o.y});e.scratch().arbor=h.addNode(t,{element:e,mass:r,fixed:a,x:a?s.x:void 0,y:a?s.y:void 0})}}function o(e){var t=e.source().id(),r=e.target().id(),a=n(e,i.edgeLength);e.scratch().arbor=h.addEdge(t,r,{length:a})}var s=i.cy,l=i.eles,u=l.nodes().not(":parent"),c=l.edges(),d=e.util.makeBoundingBox(i.boundingBox?i.boundingBox:{x1:0,y1:0,w:s.width(),h:s.height()}),p=!1;if(t.trigger({type:"layoutstart",layout:t}),void 0!==i.liveUpdate&&(i.animate=i.liveUpdate),s.nodes().size()<=1)return i.fit&&s.reset(),s.nodes().position({x:Math.round((d.x1+d.x2)/2),y:Math.round((d.y1+d.y2)/2)}),t.one("layoutready",i.ready),t.trigger({type:"layoutready",layout:t}),t.one("layoutstop",i.stop),void t.trigger({type:"layoutstop",layout:t});var h=t._private.system=r.ParticleSystem();h.parameters({repulsion:i.repulsion,stiffness:i.stiffness,friction:i.friction,gravity:i.gravity,fps:i.fps,dt:i.dt,precision:i.precision}),i.animate&&i.fit&&s.fit(d,i.padding);var v,f=250,g=!1,y=+new Date,m={init:function(){},redraw:function(){var e=h.energy();if(!i.infinite&&null!=i.stableEnergy&&null!=e&&e.n>0&&i.stableEnergy(e))return void t.stop();i.infinite||1/0==f||(clearTimeout(v),v=setTimeout(P,f));var r=s.collection();h.eachNode(function(e,t){var i=e.data,n=i.element;null!=n&&(n.locked()||n.grabbed()||(n.silentPosition({x:d.x1+t.x,y:d.y1+t.y}),r.merge(n)))}),i.animate&&r.length>0&&(p=!0,r.rtrigger("position"),i.fit&&s.fit(i.padding),y=+new Date,p=!1),g||(g=!0,t.one("layoutready",i.ready),t.trigger({type:"layoutready",layout:t}))}};h.renderer=m,h.screenSize(d.w,d.h),h.screenPadding(i.padding,i.padding,i.padding,i.padding),h.screenStep(i.stepSize);var x;u.on("grab free position",x=function(e){if(!p){var t=this.position(),n=h.fromScreen(t);if(n){var a=r.Point(n.x,n.y),o=i.padding;switch(d.x1+o<=t.x&&t.x<=d.x2-o&&d.y1+o<=t.y&&t.y<=d.y2-o&&(this.scratch().arbor.p=a),e.type){case"grab":this.scratch().arbor.fixed=!0;break;case"free":this.scratch().arbor.fixed=!1}}}});var b;u.on("lock unlock",b=function(){node.scratch().arbor.fixed=node.locked()});var w;l.on("remove",w=function(){});var _;s.on("add","*",_=function(){});var E;s.on("resize",E=function(){if(null==i.boundingBox&&null!=t._private.system){var e=s.width(),r=s.height();h.screenSize(e,r)}}),u.each(function(e,t){a(t)}),c.each(function(e,t){o(t)});var S=u.filter(":grabbable");i.ungrabifyWhileSimulating&&S.ungrabify();var P=t._private.doneHandler=function(){t._private.doneHandler=null,i.animate||(i.fit&&s.reset(),u.rtrigger("position")),u.off("grab free position",x),u.off("lock unlock",b),l.off("remove",w),s.off("add","*",_),s.off("resize",E),i.ungrabifyWhileSimulating&&S.grabify(),t.one("layoutstop",i.stop),t.trigger({type:"layoutstop",layout:t})};h.start(),!i.infinite&&null!=i.maxSimulationTime&&i.maxSimulationTime>0&&1/0!==i.maxSimulationTime&&setTimeout(function(){t.stop()},i.maxSimulationTime)}),this},t.prototype.stop=function(){return null!=this._private.system&&this._private.system.stop(),this._private.doneHandler&&this._private.doneHandler(),this},e("layout","arbor",t)}(cytoscape),function(e){"use strict";function t(t){this.options=e.util.extend({},i,t)}var i={fit:!0,directed:!1,padding:30,circle:!1,boundingBox:void 0,avoidOverlap:!0,roots:void 0,maximalAdjustments:0,animate:!1,animationDuration:500,ready:void 0,stop:void 0};t.prototype.run=function(){var t,i=this.options,r=i,n=i.cy,a=r.eles,o=a.nodes().not(":parent"),s=a,l=e.util.makeBoundingBox(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(e.is.elementOrCollection(r.roots))t=r.roots;else if(e.is.array(r.roots)){for(var u=[],c=0;c<r.roots.length;c++){var d=r.roots[c],p=n.getElementById(d);u.push(p)}t=new e.Collection(n,u)}else if(e.is.string(r.roots))t=n.$(r.roots);else if(r.directed)t=o.roots();else{for(var h=[],v=o;v.length>0;){var f=n.collection();a.bfs({roots:v[0],visit:function(e,t,i){f=f.add(i)},directed:!1}),v=v.not(f),h.push(f)}t=n.collection();for(var c=0;c<h.length;c++){var g=h[c],y=g.maxDegree(!1),m=g.filter(function(){return this.degree(!1)===y});t=t.add(m)}}var x=[],b={},w={},_={},E={},S={};s.bfs({roots:t,directed:r.directed,visit:function(e,t,i,r,n){var a=this[0],o=a.id();if(x[t]||(x[t]=[]),x[t].push(a),b[o]=!0,w[o]=t,_[o]=n,E[o]=r,n){var s=n.id(),l=S[s]=S[s]||[];l.push(i)}}});for(var P=[],c=0;c<o.length;c++){var p=o[c];b[p.id()]||P.push(p)}for(var k=3*P.length,C=0;0!==P.length&&k>C;){for(var D=P.shift(),N=D.neighborhood().nodes(),T=!1,c=0;c<N.length;c++){var M=w[N[c].id()];if(void 0!==M){x[M].push(D),T=!0;break}}T||P.push(D),C++}for(;0!==P.length;){var D=P.shift(),T=!1;T||(0===x.length&&x.push([]),x[0].push(D))}var B=function(){for(var e=0;e<x.length;e++)for(var t=x[e],i=0;i<t.length;i++){var r=t[i];r._private.scratch.breadthfirst={depth:e,index:i}}};B();for(var I=function(e){for(var t,i=e.connectedEdges(function(){return this.data("target")===e.id()}),r=e._private.scratch.breadthfirst,n=0,a=0;a<i.length;a++){var o=i[a],s=o.source()[0],l=s._private.scratch.breadthfirst;r.depth<=l.depth&&n<l.depth&&(n=l.depth,t=s)}return t},z=0;z<r.maximalAdjustments;z++){for(var L=x.length,O=[],c=0;L>c;c++)for(var M=x[c],R=M.length,X=0;R>X;X++){var p=M[X],V=p._private.scratch.breadthfirst,Y=I(p);Y&&(V.intEle=Y,O.push(p))}for(var c=0;c<O.length;c++){var p=O[c],V=p._private.scratch.breadthfirst,Y=V.intEle,A=Y._private.scratch.breadthfirst;x[V.depth].splice(V.index,1);for(var q=A.depth+1;q>x.length-1;)x.push([]);x[q].push(p),V.depth=q,V.index=x[q].length-1}B()}var F=0;if(r.avoidOverlap){for(var c=0;c<o.length;c++){var j=o[c].outerWidth(),W=o[c].outerHeight();F=Math.max(F,j,W)}F*=1.75}for(var H={},$=function(e){if(H[e.id()])return H[e.id()];for(var t=e._private.scratch.breadthfirst.depth,i=e.neighborhood().nodes(),r=0,n=0,a=0;a<i.length;a++){var o=i[a],s=o._private.scratch.breadthfirst.index,l=o._private.scratch.breadthfirst.depth,u=x[l].length;(t>l||0===t)&&(r+=s/u,n++)}return n=Math.max(1,n),r/=n,0===n&&(r=void 0),H[e.id()]=r,r},Z=function(e,t){var i=$(e),r=$(t);return i-r},U=0;3>U;U++){for(var c=0;c<x.length;c++)x[c]=x[c].sort(Z);B()}for(var G=0,c=0;c<x.length;c++)G=Math.max(x[c].length,G);for(var K={x:l.x1+l.w/2,y:l.x1+l.h/2},J=function(e,t){var i=e._private.scratch.breadthfirst,n=i.depth,a=i.index,o=x[n].length;r.strictHierarchy&&(o=G);var s=Math.max(l.w/(o+1),F),u=Math.max(l.h/(x.length+1),F),c=Math.min(l.w/2/x.length,l.h/2/x.length);if(c=Math.max(c,F),r.strictHierarchy&&!r.circle){var d={x:K.x+(a+1-(o+1)/2)*s,y:(n+1)*u};if(t)return d;var p=S[e.id()];if(p){d.x=0;for(var h=0;h<p.length;h++){var v=Q[p[h].id()];
d.x+=v.x}d.x/=p.length}return d}if(r.circle){var f=c*n+c-(x.length>0&&x[0].length<=3?c/2:0),g=2*Math.PI/x[n].length*a;return 0===n&&1===x[0].length&&(f=1),{x:K.x+f*Math.cos(g),y:K.y+f*Math.sin(g)}}return{x:K.x+(a+1-(o+1)/2)*s,y:(n+1)*u}},Q={},c=x.length-1;c>=0;c--)for(var M=x[c],X=0;X<M.length;X++){var D=M[X];Q[D.id()]=J(D,c===x.length-1)}return o.layoutPositions(this,r,function(){return Q[this.id()]}),this},e("layout","breadthfirst",t)}(cytoscape),function(e){"use strict";function t(t){this.options=e.util.extend({},i,t)}var i={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,radius:void 0,startAngle:1.5*Math.PI,counterclockwise:!1,animate:!1,animationDuration:500,ready:void 0,stop:void 0};t.prototype.run=function(){for(var t,i=this.options,r=i,n=i.cy,a=r.eles,o=a.nodes().not(":parent"),s=e.util.makeBoundingBox(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),l={x:s.x1+s.w/2,y:s.y1+s.h/2},u=r.startAngle,c=2*Math.PI/o.length,d=0,p=0;p<o.length;p++){var h=o[p].outerWidth(),v=o[p].outerHeight();d=Math.max(d,h,v)}if(t=e.is.number(r.radius)?r.radius:o.length<=1?0:Math.min(s.h,s.w)/2-d,o.length>1&&r.avoidOverlap){d*=1.75;var c=2*Math.PI/o.length,f=Math.cos(c)-Math.cos(0),g=Math.sin(c)-Math.sin(0),y=Math.sqrt(d*d/(f*f+g*g));t=Math.max(y,t)}var m=function(){var e=t*Math.cos(u),i=t*Math.sin(u),n={x:l.x+e,y:l.y+i};return u=r.counterclockwise?u-c:u+c,n};return o.layoutPositions(this,r,m),this},e("layout","circle",t)}(cytoscape),function(e){"use strict";function t(t){this.options=e.util.extend(!0,{},i,t)}var i={animate:!0,refresh:1,maxSimulationTime:4e3,ungrabifyWhileSimulating:!1,fit:!0,padding:30,boundingBox:void 0,ready:function(){},stop:function(){},randomize:!1,avoidOverlap:!0,handleDisconnected:!0,nodeSpacing:function(){return 10},flow:void 0,alignment:void 0,edgeLength:void 0,edgeSymDiffLength:void 0,edgeJaccardLength:void 0,unconstrIter:void 0,userConstIter:void 0,allConstIter:void 0,infinite:!1};t.prototype.run=function(){var t=this,i=this.options;return e.util.require("cola",function(r){var n=i.cy,a=i.eles,o=a.nodes(),s=a.edges(),l=!1,u=e.util.makeBoundingBox(i.boundingBox?i.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),c=function(t,i){if(e.is.fn(t)){var r=t;return r.apply(i,[i])}return t},d=function(){for(var e={min:1/0,max:-1/0},t={min:1/0,max:-1/0},r=0;r<o.length;r++){var a=o[r],s=a._private.scratch.cola;e.min=Math.min(e.min,s.x),e.max=Math.max(e.max,s.x),t.min=Math.min(t.min,s.y),t.max=Math.max(t.max,s.y)}o.positions(function(i,r){var n=r._private.position,a=r._private.scratch.cola;r.grabbed()||(n.x=u.x1+a.x-e.min,n.y=u.y1+a.y-t.min)}),l||(h(),l=!0),i.fit&&n.fit(i.padding)},p=function(){t.manuallyStopped=!1,i.ungrabifyWhileSimulating&&y.grabify(),o.off("grab free position",m),o.off("lock unlock",x),t.one("layoutstop",i.stop),t.trigger({type:"layoutstop",layout:t})},h=function(){t.one("layoutready",i.ready),t.trigger({type:"layoutready",layout:t})},v=i.refresh,f=1;i.refresh<0?(f=Math.abs(i.refresh),v=1):v=Math.max(1,v);var g=r.adaptor({trigger:function(e){switch(e.type){case"tick":i.animate&&d();break;case"end":d(),(!i.infinite||t.manuallyStopped)&&p()}},kick:function(t){var r=0,n=function(){var e=t();return e&&i.infinite&&g.resume(),e},a=function(){var e,t=r;if(r=(r+1)%f,0!==t)return!1;for(var i=0;v>i&&!e;i++)e=e||n();return e};if(i.animate){var o=function(){a()||e.util.requestAnimationFrame(o)};e.util.requestAnimationFrame(o)}else for(;!n(););},on:function(){},drag:function(){}});t.adaptor=g;var y=o.filter(":grabbable");i.ungrabifyWhileSimulating&&y.ungrabify();var m;o.on("grab free position",m=function(t){var i=this,r=i._private.scratch.cola,n=i._private.position;switch(i.grabbed()?(r.x=n.x-u.x1,r.y=n.y-u.y1,g.dragstart(r)):e.is.number(r.x)&&e.is.number(r.y)&&(n.x=r.x+u.x1,n.y=r.y+u.y1),t.type){case"grab":g.dragstart(r),g.resume();break;case"free":g.dragend(r)}});var x;o.on("lock unlock",x=function(){var e=this,t=e._private.scratch.cola;e.locked()?g.dragstart(t):g.dragend(t)});var b=o.stdFilter(function(e){return!e.isParent()});if(g.nodes(b.map(function(e,t){var r=c(i.nodeSpacing,e),n=e.position(),a=e._private.scratch.cola={x:i.randomize?Math.round(Math.random()*u.w):n.x,y:i.randomize?Math.round(Math.random()*u.h):n.y,width:e.outerWidth()+2*r,height:e.outerHeight()+2*r,index:t};return a})),i.alignment){var w=[],_=[];b.forEach(function(e){var t=c(i.alignment,e),r=e._private.scratch.cola,n=r.index;t&&(null!=t.x&&w.push({node:n,offset:t.x}),null!=t.y&&_.push({node:n,offset:t.y}))});var E=[];w.length>0&&E.push({type:"alignment",axis:"x",offsets:w}),_.length>0&&E.push({type:"alignment",axis:"y",offsets:_}),g.constraints(E)}g.groups(o.stdFilter(function(e){return e.isParent()}).map(function(e,t){return e._private.scratch.cola={index:t,leaves:e.children().stdFilter(function(e){return!e.isParent()}).map(function(e){return e[0]._private.scratch.cola.index})},e}).map(function(e){return e._private.scratch.cola.groups=e.children().stdFilter(function(e){return e.isParent()}).map(function(e){return e._private.scratch.cola.index}),e._private.scratch.cola}));var S,P;null!=i.edgeLength?(S=i.edgeLength,P="linkDistance"):null!=i.edgeSymDiffLength?(S=i.edgeSymDiffLength,P="symmetricDiffLinkLengths"):null!=i.edgeJaccardLength?(S=i.edgeJaccardLength,P="jaccardLinkLengths"):(S=100,P="linkDistance");var k=function(e){return e.calcLength};if(g.links(s.stdFilter(function(e){return!e.source().isParent()&&!e.target().isParent()}).map(function(e){var t=e._private.scratch.cola={source:e.source()[0]._private.scratch.cola.index,target:e.target()[0]._private.scratch.cola.index};return null!=S&&(t.calcLength=c(S,e)),t})),g.size([u.w,u.h]),null!=S&&g[P](k),i.flow){var C,D="y",N=50;e.is.string(i.flow)?C={axis:i.flow,minSeparation:N}:e.is.number(i.flow)?C={axis:D,minSeparation:i.flow}:e.is.plainObject(i.flow)?(C=i.flow,C.axis=C.axis||D,C.minSeparation=null!=C.minSeparation?C.minSeparation:N):C={axis:D,minSeparation:N},g.flowLayout(C.axis,C.minSeparation)}g.avoidOverlaps(i.avoidOverlap).handleDisconnected(i.handleDisconnected).start(i.unconstrIter,i.userConstIter,i.allConstIter),t.trigger({type:"layoutstart",layout:t}),i.infinite||setTimeout(function(){g.stop()},i.maxSimulationTime)}),this},t.prototype.stop=function(){return this.adaptor&&(this.manuallyStopped=!0,this.adaptor.stop()),this},e("layout","cola",t)}(cytoscape),function(e){"use strict";function t(t){this.options=e.util.extend({},i,t)}var i={fit:!0,padding:30,startAngle:1.5*Math.PI,counterclockwise:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,height:void 0,width:void 0,concentric:function(){return this.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,ready:void 0,stop:void 0};t.prototype.run=function(){for(var t=this.options,i=t,r=t.cy,n=i.eles,a=n.nodes().not(":parent"),o=e.util.makeBoundingBox(i.boundingBox?i.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},l=[],u=i.startAngle,c=0,d=0;d<a.length;d++){var p,h=a[d];p=i.concentric.call(h),l.push({value:p,node:h}),h._private.layoutData.concentric=p}a.updateStyle();for(var d=0;d<a.length;d++){var h=a[d];c=Math.max(c,h.outerWidth(),h.outerHeight())}l.sort(function(e,t){return t.value-e.value});for(var v=i.levelWidth(a),f=[[]],g=f[0],d=0;d<l.length;d++){var y=l[d];if(g.length>0){var m=Math.abs(g[0].value-y.value);m>=v&&(g=[],f.push(g))}g.push(y)}var x={},b=0,w=c+i.minNodeSpacing;if(!i.avoidOverlap){var _=f.length>0&&f[0].length>1,E=Math.min(o.w,o.h)/2-w,S=E/(f.length+_?1:0);w=Math.min(w,S)}for(var d=0;d<f.length;d++){var P=f[d],k=2*Math.PI/P.length;if(P.length>1&&i.avoidOverlap){var C=Math.cos(k)-Math.cos(0),D=Math.sin(k)-Math.sin(0),N=Math.sqrt(w*w/(C*C+D*D));b=Math.max(N,b)}for(var T=0;T<P.length;T++){var y=P[T],u=i.startAngle+(i.counterclockwise?1:-1)*k*T,M={x:s.x+b*Math.cos(u),y:s.y+b*Math.sin(u)};x[y.node.id()]=M}b+=w}return a.layoutPositions(this,i,function(){var e=this.id();return x[e]}),this},e("layout","concentric",t)}(cytoscape),function(e){"use strict";function t(t){this.options=e.util.extend({},r,t)}var i,r={ready:function(){},stop:function(){},animate:!0,refresh:4,fit:!0,padding:30,boundingBox:void 0,randomize:!0,debug:!1,nodeRepulsion:4e5,nodeOverlap:10,idealEdgeLength:10,edgeElasticity:100,nestingFactor:5,gravity:250,numIter:100,initialTemp:200,coolingFactor:.95,minTemp:1};t.prototype.run=function(){var t=this.options,r=t.cy,a=this;a.stopped=!1,a.trigger({type:"layoutstart",layout:a}),i=!0===t.debug?!0:!1;var o=new Date,d=n(r,a,t);i&&s(d),!0===t.randomize&&l(d,r),m(d,r,t);var p=function(e){return a.stopped?(w("Layout manually stopped. Stopping computation in step "+e),!1):(c(d,r,t,e),d.temperature=d.temperature*t.coolingFactor,w("New temperature: "+d.temperature),d.temperature<t.minTemp?(w("Temperature drop below minimum threshold. Stopping computation in step "+e),!1):!0)},h=function(){u(d,r,t),!0===t.fit&&r.fit(t.padding);var e=new Date;console.info("Layout took "+(e-o)+" ms"),a.one("layoutstop",t.stop),a.trigger({type:"layoutstop",layout:a})};if(t.animate){var v=0,f=function(){for(var i,n=0;n<t.refresh&&v<t.numIter;){var i=p(v);if(i===!1)break;n++,v++}u(d,r,t),t.fit&&r.fit(t.padding),i!==!1&&v+1<t.numIter?e.util.requestAnimationFrame(f):h()};e.util.requestAnimationFrame(f)}else{for(var v=0;v<t.numIter&&p(v)!==!1;v++);h()}return this},t.prototype.stop=function(){return this.stopped=!0,this};var n=function(t,i,r){for(var n=r.eles.edges(),o=r.eles.nodes(),s={layout:i,layoutNodes:[],idToIndex:{},nodeSize:o.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:n.size(),temperature:r.initialTemp,clientWidth:t.width(),clientHeight:t.width(),boundingBox:e.util.makeBoundingBox(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()})},l=0;l<s.nodeSize;l++){var u={};u.id=o[l].data("id"),u.parentId=o[l].data("parent"),u.children=[],u.positionX=o[l].position("x"),u.positionY=o[l].position("y"),u.offsetX=0,u.offsetY=0,u.height=o[l].height(),u.width=o[l].width(),u.maxX=u.positionX+u.width/2,u.minX=u.positionX-u.width/2,u.maxY=u.positionY+u.height/2,u.minY=u.positionY-u.height/2,u.padLeft=o[l]._private.style["padding-left"].pxValue,u.padRight=o[l]._private.style["padding-right"].pxValue,u.padTop=o[l]._private.style["padding-top"].pxValue,u.padBottom=o[l]._private.style["padding-bottom"].pxValue,s.layoutNodes.push(u),s.idToIndex[u.id]=l}for(var c=[],d=0,p=-1,h=[],l=0;l<s.nodeSize;l++){var v=s.layoutNodes[l],f=v.parentId;null!=f?s.layoutNodes[s.idToIndex[f]].children.push(v.id):(c[++p]=v.id,h.push(v.id))}for(s.graphSet.push(h);p>=d;){var g=c[d++],y=s.idToIndex[g],m=s.layoutNodes[y],x=m.children;if(x.length>0){s.graphSet.push(x);for(var l=0;l<x.length;l++)c[++p]=x[l]}}for(var l=0;l<s.graphSet.length;l++)for(var b=s.graphSet[l],_=0;_<b.length;_++){var E=s.idToIndex[b[_]];s.indexToGraph[E]=l}for(var l=0;l<s.edgeSize;l++){var S=n[l],P={};P.id=S.data("id"),P.sourceId=S.data("source"),P.targetId=S.data("target");var k=r.idealEdgeLength,C=s.idToIndex[P.sourceId],D=s.idToIndex[P.targetId],N=s.indexToGraph[C],T=s.indexToGraph[D];if(N!=T){for(var M=a(P.sourceId,P.targetId,s),B=s.graphSet[M],I=0,u=s.layoutNodes[C];-1===$.inArray(u.id,B);)u=s.layoutNodes[s.idToIndex[u.parentId]],I++;for(u=s.layoutNodes[D];-1===$.inArray(u.id,B);)u=s.layoutNodes[s.idToIndex[u.parentId]],I++;w("LCA of nodes "+P.sourceId+" and "+P.targetId+". Index: "+M+" Contents: "+B.toString()+". Depth: "+I),k*=I*r.nestingFactor}P.idealLength=k,s.layoutEdges.push(P)}return s},a=function(e,t,i){var r=o(e,t,0,i);return 2>r.count?0:r.graph},o=function(e,t,i,r){var n=r.graphSet[i];if(-1<$.inArray(e,n)&&-1<$.inArray(t,n))return{count:2,graph:i};for(var a=0,s=0;s<n.length;s++){var l=n[s],u=r.idToIndex[l],c=r.layoutNodes[u].children;if(0!==c.length){var d=r.indexToGraph[r.idToIndex[c[0]]],p=o(e,t,d,r);if(0!==p.count){if(1!==p.count)return p;if(a++,2===a)break}}}return{count:a,graph:i}},s=function(e){if(i){console.debug("layoutNodes:");for(var t=0;t<e.nodeSize;t++){var r=e.layoutNodes[t],n="\nindex: "+t+"\nId: "+r.id+"\nChildren: "+r.children.toString()+"\nparentId: "+r.parentId+"\npositionX: "+r.positionX+"\npositionY: "+r.positionY+"\nOffsetX: "+r.offsetX+"\nOffsetY: "+r.offsetY+"\npadLeft: "+r.padLeft+"\npadRight: "+r.padRight+"\npadTop: "+r.padTop+"\npadBottom: "+r.padBottom;console.debug(n)}console.debug("idToIndex");for(var t in e.idToIndex)console.debug("Id: "+t+"\nIndex: "+e.idToIndex[t]);console.debug("Graph Set");for(var a=e.graphSet,t=0;t<a.length;t++)console.debug("Set : "+t+": "+a[t].toString());for(var n="IndexToGraph",t=0;t<e.indexToGraph.length;t++)n+="\nIndex : "+t+" Graph: "+e.indexToGraph[t];console.debug(n),n="Layout Edges";for(var t=0;t<e.layoutEdges.length;t++){var o=e.layoutEdges[t];n+="\nEdge Index: "+t+" ID: "+o.id+" SouceID: "+o.sourceId+" TargetId: "+o.targetId+" Ideal Length: "+o.idealLength}console.debug(n),n="nodeSize: "+e.nodeSize,n+="\nedgeSize: "+e.edgeSize,n+="\ntemperature: "+e.temperature,console.debug(n)}},l=function(e){for(var t=e.clientWidth,i=e.clientHeight,r=0;r<e.nodeSize;r++){var n=e.layoutNodes[r];n.positionX=Math.random()*t,n.positionY=Math.random()*i}},u=function(e,t,i){var r="Refreshing positions";w(r);var n=e.layout,a=i.eles.nodes(),o=e.boundingBox,s={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};i.boundingBox&&(a.forEach(function(t){var i=e.layoutNodes[e.idToIndex[t.data("id")]];s.x1=Math.min(s.x1,i.positionX),s.x2=Math.max(s.x2,i.positionX),s.y1=Math.min(s.y1,i.positionY),s.y2=Math.max(s.y2,i.positionY)}),s.w=s.x2-s.x1,s.h=s.y2-s.y1),a.positions(function(t,n){var a=e.layoutNodes[e.idToIndex[n.data("id")]];if(r="Node: "+a.id+". Refreshed position: ("+a.positionX+", "+a.positionY+").",w(r),i.boundingBox){var l=(a.positionX-s.x1)/s.w,u=(a.positionY-s.y1)/s.h;return{x:o.x1+l*o.w,y:o.y1+u*o.h}}return{x:a.positionX,y:a.positionY}}),!0!==e.ready&&(r="Triggering layoutready",w(r),e.ready=!0,n.one("layoutready",i.ready),n.trigger({type:"layoutready",layout:this}))},c=function(e,t,i,r){var n="\n\n###############################";n+="\nSTEP: "+r,n+="\n###############################\n",w(n),d(e,t,i),f(e,t,i),g(e,t,i),y(e,t,i),m(e,t,i)},d=function(e,t,i){var r="calculateNodeForces";w(r);for(var n=0;n<e.graphSet.length;n++){var a=e.graphSet[n],o=a.length;r="Set: "+a.toString(),w(r);for(var s=0;o>s;s++)for(var l=e.layoutNodes[e.idToIndex[a[s]]],u=s+1;o>u;u++){var c=e.layoutNodes[e.idToIndex[a[u]]];p(l,c,e,t,i)}}},p=function(e,t,i,r,n){var a="Node repulsion. Node1: "+e.id+" Node2: "+t.id,o=t.positionX-e.positionX,s=t.positionY-e.positionY;if(a+="\ndirectionX: "+o+", directionY: "+s,0===o&&0===s)return void(a+="\nNodes have the same position.");var l=v(e,t,o,s);if(l>0){a+="\nNodes DO overlap.",a+="\nOverlap: "+l;var u=n.nodeOverlap*l,c=Math.sqrt(o*o+s*s);a+="\nDistance: "+c;var d=u*o/c,p=u*s/c}else{a+="\nNodes do NOT overlap.";var f=h(e,o,s),g=h(t,-1*o,-1*s),y=g.x-f.x,m=g.y-f.y,x=y*y+m*m,c=Math.sqrt(x);a+="\nDistance: "+c;var u=n.nodeRepulsion/x,d=u*y/c,p=u*m/c}e.offsetX-=d,e.offsetY-=p,t.offsetX+=d,t.offsetY+=p,a+="\nForceX: "+d+" ForceY: "+p,w(a)},h=function(e,t,i){var r=e.positionX,n=e.positionY,a=e.height,o=e.width,s=i/t,l=a/o,u="Computing clipping point of node "+e.id+" . Height: "+a+", Width: "+o+"\nDirection "+t+", "+i,c={};do{if(0===t&&i>0){c.x=r,u+="\nUp direction",c.y=n+a/2;break}if(0===t&&0>i){c.x=r,c.y=n+a/2,u+="\nDown direction";break}if(t>0&&s>=-1*l&&l>=s){c.x=r+o/2,c.y=n+o*i/2/t,u+="\nRightborder";break}if(0>t&&s>=-1*l&&l>=s){c.x=r-o/2,c.y=n-o*i/2/t,u+="\nLeftborder";break}if(i>0&&(-1*l>=s||s>=l)){c.x=r+a*t/2/i,c.y=n+a/2,u+="\nTop border";break}if(0>i&&(-1*l>=s||s>=l)){c.x=r-a*t/2/i,c.y=n-a/2,u+="\nBottom border";break}}while(!1);return u+="\nClipping point found at "+c.x+", "+c.y,w(u),c},v=function(e,t,i,r){if(i>0)var n=e.maxX-t.minX;else var n=t.maxX-e.minX;if(r>0)var a=e.maxY-t.minY;else var a=t.maxY-e.minY;return n>=0&&a>=0?Math.sqrt(n*n+a*a):0},f=function(e,t,i){for(var r=0;r<e.edgeSize;r++){var n=e.layoutEdges[r],a=e.idToIndex[n.sourceId],o=e.layoutNodes[a],s=e.idToIndex[n.targetId],l=e.layoutNodes[s],u=l.positionX-o.positionX,c=l.positionY-o.positionY;if(0===u&&0===c)return;var d=h(o,u,c),p=h(l,-1*u,-1*c),v=p.x-d.x,f=p.y-d.y,g=Math.sqrt(v*v+f*f),y=Math.pow(n.idealLength-g,2)/i.edgeElasticity;if(0!==g)var m=y*v/g,x=y*f/g;else var m=0,x=0;o.offsetX+=m,o.offsetY+=x,l.offsetX-=m,l.offsetY-=x;var b="Edge force between nodes "+o.id+" and "+l.id;b+="\nDistance: "+g+" Force: ("+m+", "+x+")",w(b)}},g=function(e,t,i){var r="calculateGravityForces";w(r);for(var n=0;n<e.graphSet.length;n++){var a=e.graphSet[n],o=a.length;if(r="Set: "+a.toString(),w(r),0===n)var s=e.clientHeight/2,l=e.clientWidth/2;else var u=e.layoutNodes[e.idToIndex[a[0]]],c=e.layoutNodes[e.idToIndex[u.parentId]],s=c.positionX,l=c.positionY;r="Center found at: "+s+", "+l,w(r);for(var d=0;o>d;d++){var p=e.layoutNodes[e.idToIndex[a[d]]];r="Node: "+p.id;var h=s-p.positionX,v=l-p.positionY,f=Math.sqrt(h*h+v*v);if(f>1){var g=i.gravity*h/f,y=i.gravity*v/f;p.offsetX+=g,p.offsetY+=y,r+=": Applied force: "+g+", "+y}else r+=": skypped since it's too close to center";w(r)}}},y=function(e){var t=[],i=0,r=-1;for(w("propagateForces"),t.push.apply(t,e.graphSet[0]),r+=e.graphSet[0].length;r>=i;){var n=t[i++],a=e.idToIndex[n],o=e.layoutNodes[a],s=o.children;if(0<s.length){var l=o.offsetX,u=o.offsetY,c="Propagating offset from parent node : "+o.id+". OffsetX: "+l+". OffsetY: "+u;c+="\n Children: "+s.toString(),w(c);for(var d=0;d<s.length;d++){var p=e.layoutNodes[e.idToIndex[s[d]]];p.offsetX+=l,p.offsetY+=u,t[++r]=s[d]}o.offsetX=0,o.offsetY=0}}},m=function(e){var t="Updating positions";w(t);for(var i=0;i<e.nodeSize;i++){var r=e.layoutNodes[i];0<r.children.length&&(w("Resetting boundaries of compound node: "+r.id),r.maxX=void 0,r.minX=void 0,r.maxY=void 0,r.minY=void 0)}for(var i=0;i<e.nodeSize;i++){var r=e.layoutNodes[i];if(0<r.children.length)w("Skipping position update of node: "+r.id);else{t="Node: "+r.id+" Previous position: ("+r.positionX+", "+r.positionY+").";var n=x(r.offsetX,r.offsetY,e.temperature);r.positionX+=n.x,r.positionY+=n.y,r.offsetX=0,r.offsetY=0,r.minX=r.positionX-r.width,r.maxX=r.positionX+r.width,r.minY=r.positionY-r.height,r.maxY=r.positionY+r.height,t+=" New Position: ("+r.positionX+", "+r.positionY+").",w(t),b(r,e)}}for(var i=0;i<e.nodeSize;i++){var r=e.layoutNodes[i];0<r.children.length&&(r.positionX=(r.maxX+r.minX)/2,r.positionY=(r.maxY+r.minY)/2,r.width=r.maxX-r.minX,r.height=r.maxY-r.minY,t="Updating position, size of compound node "+r.id,t+="\nPositionX: "+r.positionX+", PositionY: "+r.positionY,t+="\nWidth: "+r.width+", Height: "+r.height,w(t))}},x=function(e,t,i){var r="Limiting force: ("+e+", "+t+"). Max: "+i,n=Math.sqrt(e*e+t*t);if(n>i)var a={x:i*e/n,y:i*t/n};else var a={x:e,y:t};return r+=".\nResult: ("+a.x+", "+a.y+")",w(r),a},b=function(e,t){var i="Propagating new position/size of node "+e.id,r=e.parentId;if(null==r)return i+=". No parent node.",void w(i);var n=t.layoutNodes[t.idToIndex[r]],a=!1;return(null==n.maxX||e.maxX+n.padRight>n.maxX)&&(n.maxX=e.maxX+n.padRight,a=!0,i+="\nNew maxX for parent node "+n.id+": "+n.maxX),(null==n.minX||e.minX-n.padLeft<n.minX)&&(n.minX=e.minX-n.padLeft,a=!0,i+="\nNew minX for parent node "+n.id+": "+n.minX),(null==n.maxY||e.maxY+n.padBottom>n.maxY)&&(n.maxY=e.maxY+n.padBottom,a=!0,i+="\nNew maxY for parent node "+n.id+": "+n.maxY),(null==n.minY||e.minY-n.padTop<n.minY)&&(n.minY=e.minY-n.padTop,a=!0,i+="\nNew minY for parent node "+n.id+": "+n.minY),a?(w(i),b(n,t)):(i+=". No changes in boundaries/position of parent node "+n.id,void w(i))},w=function(e){i&&console.debug(e)};e("layout","cose",t)}(cytoscape),function(e){"use strict";function t(t){this.options=e.util.extend(!0,{},i,t)}var i={nodeSep:void 0,edgeSep:void 0,rankSep:void 0,rankDir:void 0,minLen:function(){return 1},fit:!0,padding:30,animate:!1,animationDuration:500,boundingBox:void 0,ready:function(){},stop:function(){}};t.prototype.run=function(){var t=this.options,i=this;return e.util.require("dagre",function(r){for(var n=t.cy,a=t.eles,o=e.util.makeBoundingBox(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),s=new r.Digraph,l=a.nodes().not(":parent"),u=0;u<l.length;u++){var c=l[u];s.addNode(c.id(),{width:c.width(),height:c.height()})}for(var d=a.edges(),u=0;u<d.length;u++){var p=d[u];s.addEdge(p.id(),p.source().id(),p.target().id(),{minLen:e.is.fn(t.minLen)?t.minLen.apply(p,[p]):t.minLen})}var h=r.layout();t.nodeSep&&h.nodeSep(t.nodeSep),t.edgeSep&&h.edgeSep(t.edgeSep),t.rankSep&&h.rankSep(t.rankSep),h=h.run(s),h.eachNode(function(e,t){n.getElementById(e).scratch().dagre=t});var v;t.boundingBox?(v={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0},l.forEach(function(e){var t=e.scratch().dagre;v.x1=Math.min(v.x1,t.x),v.x2=Math.max(v.x2,t.x),v.y1=Math.min(v.y1,t.y),v.y2=Math.max(v.y2,t.y)}),v.w=v.x2-v.x1,v.h=v.y2-v.y1):v=o;var f=function(e){if(t.boundingBox){var i=(e.x-v.x1)/v.w,r=(e.y-v.y1)/v.h;return{x:o.x1+i*o.w,y:o.y1+r*o.h}}return e};l.layoutPositions(i,t,function(){var e=this.scratch().dagre;return f({x:e.x,y:e.y})})}),this},e("layout","dagre",t)}(cytoscape),function(e){"use strict";function t(t){this.options=e.util.extend({},i,t)}var i={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,rows:void 0,columns:void 0,position:function(){},animate:!1,animationDuration:500,ready:void 0,stop:void 0};t.prototype.run=function(){var t=this.options,i=t,r=t.cy,n=i.eles,a=n.nodes().not(":parent"),o=e.util.makeBoundingBox(i.boundingBox?i.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(0===o.h||0===o.w)a.layoutPositions(this,i,function(){return{x:o.x1,y:o.y1}});else{var s=a.size(),l=Math.sqrt(s*o.h/o.w),u=Math.round(l),c=Math.round(o.w/o.h*l),d=function(e){if(null==e)return Math.min(u,c);var t=Math.min(u,c);t==u?u=e:c=e},p=function(e){if(null==e)return Math.max(u,c);var t=Math.max(u,c);t==u?u=e:c=e};if(null!=i.rows&&null!=i.columns)u=i.rows,c=i.columns;else if(null!=i.rows&&null==i.columns)u=i.rows,c=Math.ceil(s/u);else if(null==i.rows&&null!=i.columns)c=i.columns,u=Math.ceil(s/c);else if(c*u>s){var h=d(),v=p();(h-1)*v>=s?d(h-1):(v-1)*h>=s&&p(v-1)}else for(;s>c*u;){var h=d(),v=p();(v+1)*h>=s?p(v+1):d(h+1)}var f=o.w/c,g=o.h/u;if(i.avoidOverlap)for(var y=0;y<a.length;y++){var m=a[y],x=m.outerWidth(),b=m.outerHeight();f=Math.max(f,x),g=Math.max(g,b)}for(var w={},_=function(e,t){return w["c-"+e+"-"+t]?!0:!1},E=function(e,t){w["c-"+e+"-"+t]=!0},S=0,P=0,k=function(){P++,P>=c&&(P=0,S++)},C={},y=0;y<a.length;y++){var m=a[y],D=i.position(m);if(D&&(void 0!==D.row||void 0!==D.col)){var N={row:D.row,col:D.col};if(void 0===N.col)for(N.col=0;_(N.row,N.col);)N.col++;else if(void 0===N.row)for(N.row=0;_(N.row,N.col);)N.row++;C[m.id()]=N,E(N.row,N.col)}}var T=function(e,t){var i,r;if(t.locked()||t.isFullAutoParent())return!1;var n=C[t.id()];if(n)i=n.col*f+f/2+o.x1,r=n.row*g+g/2+o.y1;else{for(;_(S,P);)k();i=P*f+f/2+o.x1,r=S*g+g/2+o.y1,E(S,P),k()}return{x:i,y:r}};a.layoutPositions(this,i,T)}return this},e("layout","grid",t)}(cytoscape),function(e){"use strict";function t(t){this.options=e.util.extend(!0,{},i,t)}var i={ready:function(){},stop:function(){}};t.prototype.run=function(){{var e=this.options,t=e.eles,i=this;e.cy}return i.trigger("layoutstart"),t.nodes().positions(function(){return{x:0,y:0}}),i.one("layoutready",e.ready),i.trigger("layoutready"),i.one("layoutstop",e.stop),i.trigger("layoutstop"),this},t.prototype.stop=function(){return this},e("layout","null",t)}(cytoscape),function(e){"use strict";function t(t){this.options=e.util.extend(!0,{},i,t)}var i={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,animate:!1,animationDuration:500,ready:void 0,stop:void 0};t.prototype.run=function(){function t(e){if(null==i.positions)return null;if(a)return i.positions.apply(e,[e]);var t=i.positions[e._private.data.id];return null==t?null:t}var i=this.options,r=i.eles,n=r.nodes(),a=e.is.fn(i.positions);return n.layoutPositions(this,i,function(e,i){var r=t(i);return i.locked()||null==r?!1:r}),this},e("layout","preset",t)}(cytoscape),function(e){"use strict";function t(t){this.options=e.util.extend(!0,{},i,t)}var i={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,ready:void 0,stop:void 0};t.prototype.run=function(){var t=this.options,i=t.cy,r=t.eles,n=r.nodes().not(":parent"),a=e.util.makeBoundingBox(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:i.width(),h:i.height()}),o=function(){return{x:a.x1+Math.round(Math.random()*a.w),y:a.y1+Math.round(Math.random()*a.h)}};return n.layoutPositions(this,t,o),this},e("layout","random",t)}(cytoscape),function(e){"use strict";function t(t){this.options=e.util.extend(!0,{},i,t)}var i={animate:!0,maxSimulationTime:4e3,ungrabifyWhileSimulating:!1,fit:!0,padding:30,boundingBox:void 0,random:!1,infinite:!1,ready:void 0,stop:void 0,stiffness:400,repulsion:400,damping:.5};t.prototype.run=function(){var t=this,i=this,r=this.options;return e.util.require("Springy",function(n){function a(e){var t=e.scratch("springy").model.id,i=w.layout.nodePoints[t].p,r=e.position(),n=null!=r.x&&null!=r.y?y(e.position()):{x:4*Math.random()-2,y:4*Math.random()-2};i.x=n.x,i.y=n.y}function o(){r.ungrabifyWhileSimulating&&E.ungrabify(),w.start()}var s=!1,l=r.cy;t.trigger({type:"layoutstart",layout:t});var u=r.eles,c=u.nodes().not(":parent"),d=u.edges(),p=e.util.makeBoundingBox(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:l.width(),h:l.height()}),h=new n.Graph;c.each(function(e,t){t.scratch("springy",{model:h.newNode({element:t})})}),d.each(function(e,t){var i=t.source().scratch("springy").model,r=t.target().scratch("springy").model;t.scratch("springy",{model:h.newEdge(i,r,{element:t})})});var v=window.sim=new n.Layout.ForceDirected(h,r.stiffness,r.repulsion,r.damping);r.infinite&&(v.minEnergyThreshold=-1/0);var f=v.getBoundingBox(),g=function(e){f=v.getBoundingBox();var t=f.topright.subtract(f.bottomleft),i=e.subtract(f.bottomleft).divide(t.x).x*p.w+p.x1,r=e.subtract(f.bottomleft).divide(t.y).y*p.h+p.x1;return new n.Vector(i,r)},y=function(e){f=v.getBoundingBox();var t=f.topright.subtract(f.bottomleft),i=(e.x-p.x1)/p.w*t.x+f.bottomleft.x,r=(e.y-p.y1)/p.h*t.y+f.bottomleft.y;return new n.Vector(i,r)},m=l.collection(),x=l.nodes().size(),b=1,w=new n.Renderer(v,function(){m.length>0&&r.animate&&(s=!0,m.rtrigger("position"),r.fit&&l.fit(r.padding),m=l.collection(),s=!1)},function(){},function(e,i){var n=g(i),a=e.data.element;a.locked()||a.grabbed()||(a._private.position={x:n.x,y:n.y},m.merge(a)),b==x&&(t.one("layoutready",r.ready),t.trigger({type:"layoutready",layout:t})),b++});c.each(function(e,t){r.random||a(t)});var _;c.on("position",_=function(){s||a(this)});var E=c.filter(":grabbable");i.stopSystem=function(){h.filterNodes(function(){return!1}),r.ungrabifyWhileSimulating&&E.grabify(),r.fit&&l.fit(r.padding),c.off("drag position",_),t.one("layoutstop",r.stop),t.trigger({type:"layoutstop",layout:t}),i.stopSystem=null},o(),r.infinite||setTimeout(function(){i.stop()},r.maxSimulationTime)}),this},t.prototype.stop=function(){return null!=this.stopSystem&&this.stopSystem(),this},e("layout","springy",t)}(cytoscape),function(e){"use strict";function t(e){this.options=e}t.prototype.recalculateRenderedStyle=function(){},t.prototype.notify=function(){},e("renderer","null",t)}(cytoscape);