UNPKG

@anthologen/cytoscape-node-html-label

Version:
27 lines (21 loc) 309 kB
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.cytoscape=e()}}(function(){return function e(t,r,n){function i(o,s){if(!r[o]){if(!t[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[o]={exports:{}};t[o][0].call(c.exports,function(e){var r=t[o][1][e];return i(r?r:e)},c,c.exports,e,t,r,n)}return r[o].exports}for(var a="function"==typeof require&&require,o=0;o<n.length;o++)i(n[o]);return i}({1:[function(e,t,r){/*! Cytoscape.js 3.1.4 (MIT licensed) Copyright (c) The Cytoscape Consortium Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ "use strict"},{}],2:[function(e,t,r){"use strict";var n=e("./util"),i=e("./is"),a=e("./promise"),o=function(e,t,r){var a=this._private=n.extend({duration:1e3},t,r);a.target=e,a.style=a.style||a.css,a.started=!1,a.playing=!1,a.hooked=!1,a.applying=!1,a.progress=0,a.completes=[],a.frames=[],a.complete&&i.fn(a.complete)&&a.completes.push(a.complete),this.length=1,this[0]=this},s=o.prototype;n.extend(s,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var t,r=e.target._private.animation;t=e.queue?r.queue:r.current,t.push(this),i.elementOrCollection(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return 1===e.progress&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var t=this._private;return void 0===e?t.progress*t.duration:this.progress(e/t.duration)},progress:function(e){var t=this._private,r=t.playing;return void 0===e?t.progress:(r&&this.pause(),t.progress=e,t.started=!1,r&&this.play(),this)},completed:function(){return 1===this._private.progress},reverse:function(){var e=this._private,t=e.playing;t&&this.pause(),e.progress=1-e.progress,e.started=!1;var r=function(t,r){var n=e[t];null!=n&&(e[t]=e[r],e[r]=n)};if(r("zoom","startZoom"),r("pan","startPan"),r("position","startPosition"),e.style)for(var n=0;n<e.style.length;n++){var i=e.style[n],a=i.name,o=e.startStyle[a];e.startStyle[a]=i,e.style[n]=o}return t&&this.play(),this},promise:function(e){var t,r=this._private;switch(e){case"frame":t=r.frames;break;default:case"complete":case"completed":t=r.completes}return new a(function(e,r){t.push(function(){e()})})}}),s.complete=s.completed,t.exports=o},{"./is":91,"./promise":94,"./util":108}],3:[function(e,t,r){"use strict";var n=e("../../is"),i={aStar:function(e){var t=this;e=e||{};var r=function(e,t,n,i){if(e==t)return i.unshift(a.getElementById(t)),i;if(t in n){var o=n[t],s=v[t];return i.unshift(a.getElementById(s)),i.unshift(a.getElementById(t)),r(e,o,n,i)}},i=function(e,t){if(0!==e.length){for(var r=0,n=t[e[0]],i=1;i<e.length;i++){var a=t[e[i]];a<n&&(n=a,r=i)}return r}},a=this._private.cy;if(null!=e&&null!=e.root){var o=n.string(e.root)?this.filter(e.root)[0]:e.root[0];if(null!=e.goal){var s=n.string(e.goal)?this.filter(e.goal)[0]:e.goal[0];if(null!=e.heuristic&&n.fn(e.heuristic))var l=e.heuristic;else var l=function(){return 0};if(null!=e.weight&&n.fn(e.weight))var u=e.weight;else var u=function(e){return 1};if(null!=e.directed)var c=e.directed;else var c=!1;var d=o.id(),h=s.id(),p=[],f=[d],g={},v={},y={},m={};y[d]=0,m[d]=l(o);for(var b=0;f.length>0;){var x=i(f,m),w=a.getElementById(f[x]),E=w.id();if(b++,E==h){var C=r(d,h,g,[]);return{found:!0,distance:y[E],path:t.spawn(C),steps:b}}p.push(E),f.splice(x,1);for(var P=w._private.edges,D=0;D<P.length;D++){var T=P[D];if(this.hasElementWithId(T.id())&&(!c||T.data("source")===E)){var k=T.source(),S=T.target(),_=k.id()!==E?k:S,M=_.id();if(this.hasElementWithId(M)&&p.indexOf(M)==-1){var I=y[E]+u(T);f.indexOf(M)!=-1?I<y[M]&&(y[M]=I,m[M]=I+l(_),g[M]=E):(y[M]=I,m[M]=I+l(_),f.push(M),g[M]=E,v[M]=T.id())}}}}return{found:!1,distance:void 0,path:void 0,steps:b}}}}};t.exports=i},{"../../is":91}],4:[function(e,t,r){"use strict";var n=e("../../is"),i=e("../../util"),a={bellmanFord:function(e){var t=this;if(e=e||{},null!=e.weight&&n.fn(e.weight))var r=e.weight;else var r=function(e){return 1};if(null!=e.directed)var a=e.directed;else var a=!1;if(null!=e.root){if(n.string(e.root))var o=this.filter(e.root)[0];else var o=e.root[0];for(var s=this._private.cy,l=this.edges().stdFilter(function(e){return!e.isLoop()}),u=this.nodes(),c=u.length,d={},h=0;h<c;h++)d[u[h].id()]=h;for(var p=[],f=[],g=[],h=0;h<c;h++)u[h].id()===o.id()?p[h]=0:p[h]=1/0,f[h]=void 0;for(var v=!1,h=1;h<c;h++){v=!1;for(var y=0;y<l.length;y++){var m=d[l[y].source().id()],b=d[l[y].target().id()],x=r(l[y]),w=p[m]+x;if(w<p[b]&&(p[b]=w,f[b]=m,g[b]=l[y],v=!0),!a){var w=p[b]+x;w<p[m]&&(p[m]=w,f[m]=b,g[m]=l[y],v=!0)}}if(!v)break}if(v)for(var y=0;y<l.length;y++){var m=d[l[y].source().id()],b=d[l[y].target().id()],x=r(l[y]);if(p[m]+x<p[b])return i.error("Graph contains a negative weight cycle for Bellman-Ford"),{pathTo:void 0,distanceTo:void 0,hasNegativeWeightCycle:!0}}for(var E=[],h=0;h<c;h++)E.push(u[h].id());var C={distanceTo:function(e){if(n.string(e))var t=s.filter(e)[0].id();else var t=e.id();return p[d[t]]},pathTo:function(e){var r=function(e,t,r,n,i,a){for(;;){if(i.push(s.getElementById(n[r])),i.push(a[r]),t===r)return i;var o=e[r];if("undefined"==typeof o)return;r=o}};if(n.string(e))var i=s.filter(e)[0].id();else var i=e.id();var a=[],l=r(f,d[o.id()],d[i],E,a,g);return null!=l&&l.reverse(),t.spawn(l)},hasNegativeWeightCycle:!1};return C}}};t.exports=a},{"../../is":91,"../../util":108}],5:[function(e,t,r){"use strict";var n=e("../../is"),i=e("../../heap"),a={betweennessCentrality:function(e){e=e||{};var t,r;n.fn(e.weight)?(r=e.weight,t=!0):t=!1;for(var a=null!=e.directed&&e.directed,o=this._private.cy,s=this.nodes(),l={},u={},c=0,d={set:function(e,t){u[e]=t,t>c&&(c=t)},get:function(e){return u[e]}},h=0;h<s.length;h++){var p=s[h],f=p.id();a?l[f]=p.outgoers().nodes():l[f]=p.openNeighborhood().nodes(),d.set(f,0)}for(var g=0;g<s.length;g++){for(var v=s[g].id(),y=[],m={},b={},x={},w=new i(function(e,t){return x[e]-x[t]}),h=0;h<s.length;h++){var f=s[h].id();m[f]=[],b[f]=0,x[f]=1/0}for(b[v]=1,x[v]=0,w.push(v);!w.empty();){var p=w.pop();if(y.push(p),t)for(var E=0;E<l[p].length;E++){var C,P=l[p][E],D=o.getElementById(p);C=D.edgesTo(P).length>0?D.edgesTo(P)[0]:P.edgesTo(D)[0];var T=r(C);P=P.id(),x[P]>x[p]+T&&(x[P]=x[p]+T,w.nodes.indexOf(P)<0?w.push(P):w.updateItem(P),b[P]=0,m[P]=[]),x[P]==x[p]+T&&(b[P]=b[P]+b[p],m[P].push(p))}else for(var E=0;E<l[p].length;E++){var P=l[p][E].id();x[P]==1/0&&(w.push(P),x[P]=x[p]+1),x[P]==x[p]+1&&(b[P]=b[P]+b[p],m[P].push(p))}}for(var k={},h=0;h<s.length;h++)k[s[h].id()]=0;for(;y.length>0;)for(var P=y.pop(),E=0;E<m[P].length;E++){var p=m[P][E];k[p]=k[p]+b[p]/b[P]*(1+k[P]),P!=s[g].id()&&d.set(P,d.get(P)+k[P])}}var S={betweenness:function(e){if(n.string(e))var e=o.filter(e).id();else var e=e.id();return d.get(e)},betweennessNormalized:function(e){if(0==c)return 0;if(n.string(e))var e=o.filter(e).id();else var e=e.id();return d.get(e)/c}};return S.betweennessNormalised=S.betweennessNormalized,S}};a.bc=a.betweennessCentrality,t.exports=a},{"../../heap":89,"../../is":91}],6:[function(e,t,r){"use strict";var n=e("../../is"),i=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(t,r,i){var a;n.plainObject(t)&&!n.elementOrCollection(t)&&(a=t,t=a.roots||a.root,r=a.visit,i=a.directed),i=2!==arguments.length||n.fn(r)?i:r,r=n.fn(r)?r:function(){};for(var o,s=this._private.cy,l=t=n.string(t)?this.filter(t):t,u=[],c=[],d={},h={},p={},f=0,g=this.nodes(),v=this.edges(),y=0;y<l.length;y++)l[y].isNode()&&(u.unshift(l[y]),e.bfs&&(p[l[y].id()]=!0,c.push(l[y])),h[l[y].id()]=0);for(;0!==u.length;){var l=e.bfs?u.shift():u.pop();if(e.dfs){if(p[l.id()])continue;p[l.id()]=!0,c.push(l)}var m,b=h[l.id()],x=d[l.id()],w=null==x?void 0:x.connectedNodes().not(l)[0];if(m=r(l,x,w,f++,b),m===!0){o=l;break}if(m===!1)break;for(var E=l.connectedEdges(i?function(e){return e.data("source")===l.id()}:void 0).intersect(v),y=0;y<E.length;y++){var C=E[y],P=C.connectedNodes(function(e){return e.id()!==l.id()}).intersect(g);0===P.length||p[P.id()]||(P=P[0],u.push(P),e.bfs&&(p[P.id()]=!0,c.push(P)),d[P.id()]=C,h[P.id()]=h[l.id()]+1)}}for(var D=[],y=0;y<c.length;y++){var T=c[y],k=d[T.id()];k&&D.push(k),D.push(T)}return{path:s.collection(D,{unique:!0}),found:s.collection(o)}}},a={breadthFirstSearch:i({bfs:!0}),depthFirstSearch:i({dfs:!0})};a.bfs=a.breadthFirstSearch,a.dfs=a.depthFirstSearch,t.exports=a},{"../../is":91}],7:[function(e,t,r){"use strict";var n=e("../../is"),i={closenessCentralityNormalized:function(e){e=e||{};var t=this.cy(),r=e.harmonic;void 0===r&&(r=!0);for(var i={},a=0,o=this.nodes(),s=this.floydWarshall({weight:e.weight,directed:e.directed}),l=0;l<o.length;l++){for(var u=0,c=0;c<o.length;c++)if(l!=c){var d=s.distance(o[l],o[c]);u+=r?1/d:d}r||(u=1/u),a<u&&(a=u),i[o[l].id()]=u}return{closeness:function(e){if(0==a)return 0;if(n.string(e))var e=t.filter(e)[0].id();else var e=e.id();return i[e]/a}}},closenessCentrality:function(e){if(e=e||{},null!=e.root){if(n.string(e.root))var t=this.filter(e.root)[0];else var t=e.root[0];if(null!=e.weight&&n.fn(e.weight))var r=e.weight;else var r=function(){return 1};if(null!=e.directed&&n.bool(e.directed))var i=e.directed;else var i=!1;var a=e.harmonic;void 0===a&&(a=!0);for(var o=this.dijkstra({root:t,weight:r,directed:i}),s=0,l=this.nodes(),u=0;u<l.length;u++)if(l[u].id()!=t.id()){var c=o.distanceTo(l[u]);s+=a?1/c:c}return a?s:1/s}}};i.cc=i.closenessCentrality,i.ccn=i.closenessCentralityNormalised=i.closenessCentralityNormalized,t.exports=i},{"../../is":91}],8:[function(e,t,r){"use strict";var n=e("../../is"),i=e("../../util"),a={degreeCentralityNormalized:function(e){e=e||{};var t=this.cy();if(null!=e.directed)var r=e.directed;else var r=!1;var a=this.nodes(),o=a.length;if(r){for(var s={},l={},u=0,c=0,d=0;d<o;d++){var h=a[d],p=this.degreeCentrality(i.extend({},e,{root:h}));u<p.indegree&&(u=p.indegree),c<p.outdegree&&(c=p.outdegree),s[h.id()]=p.indegree,l[h.id()]=p.outdegree}return{indegree:function(e){if(0==u)return 0;if(n.string(e))var e=t.filter(e)[0].id();else var e=e.id();return s[e]/u},outdegree:function(e){if(0==c)return 0;if(n.string(e))var e=t.filter(e)[0].id();else var e=e.id();return l[e]/c}}}for(var f={},g=0,d=0;d<o;d++){var h=a[d],p=this.degreeCentrality(i.extend({},e,{root:h}));g<p.degree&&(g=p.degree),f[h.id()]=p.degree}return{degree:function(e){if(0==g)return 0;if(n.string(e))var e=t.filter(e)[0].id();else var e=e.id();return f[e]/g}}},degreeCentrality:function(e){e=e||{};var t=this;if(null!=e&&null!=e.root){var r=n.string(e.root)?this.filter(e.root)[0]:e.root[0];if(null!=e.weight&&n.fn(e.weight))var i=e.weight;else var i=function(e){return 1};if(null!=e.directed)var a=e.directed;else var a=!1;if(null!=e.alpha&&n.number(e.alpha))var o=e.alpha;else o=0;if(a){for(var s=r.connectedEdges('edge[target = "'+r.id()+'"]').intersection(t),l=r.connectedEdges('edge[source = "'+r.id()+'"]').intersection(t),u=s.length,c=l.length,d=0,h=0,p=0;p<s.length;p++){var f=s[p];d+=i(f)}for(var p=0;p<l.length;p++){var f=l[p];h+=i(f)}return{indegree:Math.pow(u,1-o)*Math.pow(d,o),outdegree:Math.pow(c,1-o)*Math.pow(h,o)}}for(var g=r.connectedEdges().intersection(t),v=g.length,y=0,p=0;p<g.length;p++){var f=g[p];y+=i(f)}return{degree:Math.pow(v,1-o)*Math.pow(y,o)}}}};a.dc=a.degreeCentrality,a.dcn=a.degreeCentralityNormalised=a.degreeCentralityNormalized,t.exports=a},{"../../is":91,"../../util":108}],9:[function(e,t,r){"use strict";var n=e("../../is"),i=e("../../heap"),a={dijkstra:function(e,t,r){var a;n.plainObject(e)&&!n.elementOrCollection(e)&&(a=e,e=a.root,t=a.weight,r=a.directed);var o=this._private.cy;t=n.fn(t)?t:function(){return 1};for(var s=n.string(e)?this.filter(e)[0]:e[0],l={},u={},c={},d=this.edges().filter(function(e){return!e.isLoop()}),h=this.nodes(),p=function(e){return l[e.id()]},f=function(e,t){l[e.id()]=t,g.updateItem(e)},g=new i(function(e,t){return p(e)-p(t)}),v=0;v<h.length;v++){var y=h[v];l[y.id()]=y.same(s)?0:1/0,g.push(y)}for(var m=function(e,n){for(var i,a=(r?e.edgesTo(n):e.edgesWith(n)).intersect(d),o=1/0,s=0;s<a.length;s++){var l=a[s],u=t(l);(u<o||!i)&&(o=u,i=l)}return{edge:i,dist:o}};g.size()>0;){var b=g.pop(),x=p(b),w=b.id();if(c[w]=x,x===Math.Infinite)break;for(var E=b.neighborhood().intersect(h),v=0;v<E.length;v++){var C=E[v],P=C.id(),D=m(b,C),T=x+D.dist;T<p(C)&&(f(C,T),u[P]={node:b,edge:D.edge})}}return{distanceTo:function(e){var t=n.string(e)?h.filter(e)[0]:e[0];return c[t.id()]},pathTo:function(e){var t=n.string(e)?h.filter(e)[0]:e[0],r=[],i=t;if(t.length>0)for(r.unshift(t);u[i.id()];){var a=u[i.id()];r.unshift(a.edge),r.unshift(a.node),i=a.node}return o.collection(r)}}}};t.exports=a},{"../../heap":89,"../../is":91}],10:[function(e,t,r){"use strict";var n=e("../../is"),i={floydWarshall:function(e){e=e||{};var t=this.cy();if(null!=e.weight&&n.fn(e.weight))var r=e.weight;else var r=function(e){return 1};if(null!=e.directed)var i=e.directed;else var i=!1;for(var a=this.edges().stdFilter(function(e){return!e.isLoop()}),o=this.nodes(),s=o.length,l={},u=0;u<s;u++)l[o[u].id()]=u;for(var c=[],u=0;u<s;u++){for(var d=new Array(s),h=0;h<s;h++)u==h?d[h]=0:d[h]=1/0;c.push(d)}var p=[],f=[],g=function(e){for(var t=0;t<s;t++){for(var r=new Array(s),n=0;n<s;n++)r[n]=void 0;e.push(r)}};g(p),g(f);for(var u=0;u<a.length;u++){var v=l[a[u].source().id()],y=l[a[u].target().id()],m=r(a[u]);c[v][y]>m&&(c[v][y]=m,p[v][y]=y,f[v][y]=a[u])}if(!i)for(var u=0;u<a.length;u++){var v=l[a[u].target().id()],y=l[a[u].source().id()],m=r(a[u]);c[v][y]>m&&(c[v][y]=m,p[v][y]=y,f[v][y]=a[u])}for(var b=0;b<s;b++)for(var u=0;u<s;u++)for(var h=0;h<s;h++)c[u][b]+c[b][h]<c[u][h]&&(c[u][h]=c[u][b]+c[b][h],p[u][h]=p[u][b]);for(var x=[],u=0;u<s;u++)x.push(o[u].id());var w={distance:function(e,r){if(n.string(e))var i=t.filter(e)[0].id();else var i=e.id();if(n.string(r))var a=t.filter(r)[0].id();else var a=r.id();return c[l[i]][l[a]]},path:function(e,r){var i=function(e,r,n,i,a){if(e===r)return t.getElementById(i[e]);if(void 0!==n[e][r]){for(var o=[t.getElementById(i[e])],s=e;e!==r;){s=e,e=n[e][r];var l=a[s][e];o.push(l),o.push(t.getElementById(i[e]))}return o}};if(n.string(e))var a=t.filter(e)[0].id();else var a=e.id();if(n.string(r))var o=t.filter(r)[0].id();else var o=r.id();var s=i(l[a],l[o],p,x,f);return t.collection(s)}};return w}};t.exports=i},{"../../is":91}],11:[function(e,t,r){"use strict";var n=e("../../util"),i={};[e("./bfs-dfs"),e("./dijkstra"),e("./kruskal"),e("./a-star"),e("./floyd-warshall"),e("./bellman-ford"),e("./kerger-stein"),e("./page-rank"),e("./degree-centrality"),e("./closeness-centrality"),e("./betweenness-centrality")].forEach(function(e){n.extend(i,e)}),t.exports=i},{"../../util":108,"./a-star":3,"./bellman-ford":4,"./betweenness-centrality":5,"./bfs-dfs":6,"./closeness-centrality":7,"./degree-centrality":8,"./dijkstra":9,"./floyd-warshall":10,"./kerger-stein":12,"./kruskal":13,"./page-rank":14}],12:[function(e,t,r){"use strict";var n=e("../../util"),i={kargerStein:function(e){var t=this;e=e||{};var r=function(e,t,r){for(var n=r[e],i=n[1],a=n[2],o=t[i],s=t[a],l=r.filter(function(e){return(t[e[1]]!==o||t[e[2]]!==s)&&(t[e[1]]!==s||t[e[2]]!==o)}),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},i=function(e,t,n,a){if(n<=a)return t;var o=Math.floor(Math.random()*t.length),s=r(o,e,t);return i(e,s,n-1,a)},a=this._private.cy,o=this.edges().stdFilter(function(e){return!e.isLoop()}),s=this.nodes(),l=s.length,u=o.length,c=Math.ceil(Math.pow(Math.log(l)/Math.LN2,2)),d=Math.floor(l/Math.sqrt(2));if(l<2)return void n.error("At least 2 nodes are required for Karger-Stein algorithm");for(var h={},p=0;p<l;p++)h[s[p].id()]=p;for(var f=[],p=0;p<u;p++){var g=o[p];f.push([p,h[g.source().id()],h[g.target().id()]])}for(var v,y=1/0,m=[],p=0;p<l;p++)m.push(p);for(var b=0;b<=c;b++){var x=m.slice(0),w=i(x,f,l,d),E=x.slice(0),C=i(x,w,d,2),P=i(E,w,d,2);C.length<=P.length&&C.length<y?(y=C.length,v=[C,x]):P.length<=C.length&&P.length<y&&(y=P.length,v=[P,E])}for(var D=v[0].map(function(e){return o[e[0]]}),T=[],k=[],S=v[1][0],p=0;p<v[1].length;p++){var _=v[1][p];_===S?T.push(s[p]):k.push(s[p])}var M={cut:t.spawn(a,D),partition1:t.spawn(T),partition2:t.spawn(k)};return M}};t.exports=i},{"../../util":108}],13:[function(e,t,r){"use strict";var n=e("../../is"),i={kruskal:function(e){function t(e){for(var t=0;t<a.length;t++){var r=a[t];if(r.anySame(e))return{eles:r,index:t}}}var r=this.cy();e=n.fn(e)?e:function(){return 1};for(var i=r.collection(r,[]),a=[],o=this.nodes(),s=0;s<o.length;s++)a.push(o[s].collection());for(var l=this.edges(),u=l.toArray().sort(function(t,r){var n=e(t),i=e(r);return n-i}),s=0;s<u.length;s++){var c=u[s],d=c.source()[0],h=c.target()[0],p=t(d),f=t(h);p.index!==f.index&&(i=i.add(c),a[p.index]=p.eles.add(f.eles),a.splice(f.index,1))}return o.add(i)}};t.exports=i},{"../../is":91}],14:[function(e,t,r){"use strict";var n=e("../../is"),i={pageRank:function(e){e=e||{};var t=function(e){for(var t=e.length,r=0,n=0;n<t;n++)r+=e[n];for(var n=0;n<t;n++)e[n]=e[n]/r};if(null!=e&&null!=e.dampingFactor)var r=e.dampingFactor;else var r=.8;if(null!=e&&null!=e.precision)var i=e.precision;else var i=1e-6;if(null!=e&&null!=e.iterations)var a=e.iterations;else var a=200;if(null!=e&&null!=e.weight&&n.fn(e.weight))var o=e.weight;else var o=function(e){return 1};for(var s=this._private.cy,l=this.edges().stdFilter(function(e){return!e.isLoop()}),u=this.nodes(),c=u.length,d=l.length,h={},p=0;p<c;p++)h[u[p].id()]=p;for(var f=[],g=[],v=(1-r)/c,p=0;p<c;p++){for(var y=[],m=0;m<c;m++)y.push(0);f.push(y),g.push(0)}for(var p=0;p<d;p++){var b=l[p],x=h[b.source().id()],w=h[b.target().id()],E=o(b);f[w][x]+=E,g[x]+=E}for(var C=1/c+v,m=0;m<c;m++)if(0===g[m])for(var p=0;p<c;p++)f[p][m]=C;else for(var p=0;p<c;p++)f[p][m]=f[p][m]/g[m]+v;for(var P,D=[],T=[],p=0;p<c;p++)D.push(1),T.push(0);for(var k=0;k<a;k++){for(var S=T.slice(0),p=0;p<c;p++)for(var m=0;m<c;m++)S[p]+=f[p][m]*D[m];t(S),P=D,D=S;for(var _=0,p=0;p<c;p++)_+=Math.pow(P[p]-D[p],2);if(_<i)break}var M={rank:function(e){if(n.string(e))var t=s.filter(e)[0].id();else var t=e.id();return D[h[t]]}};return M}};t.exports=i},{"../../is":91}],15:[function(e,t,r){"use strict";var n=e("../define"),i={animate:n.animate(),animation:n.animation(),animated:n.animated(),clearQueue:n.clearQueue(),delay:n.delay(),delayAnimation:n.delayAnimation(),stop:n.stop()};t.exports=i},{"../define":44}],16:[function(e,t,r){"use strict";var n=e("../util"),i={classes:function(e){e=(e||"").match(/\S+/g)||[];for(var t=this,r=[],i={},a=0;a<e.length;a++){var o=e[a];i[o]=!0}for(var s=0;s<t.length;s++){for(var l=t[s],u=l._private,c=u.classes,d=!1,a=0;a<e.length;a++){var o=e[a],h=c[o];if(!h){d=!0;break}}if(!d)for(var e=Object.keys(c),a=0;a<e.length;a++){var p=e[a],h=c[p],f=i[p];if(h&&!f){d=!0;break}}d&&(u.classes=n.copy(i),r.push(l))}return r.length>0&&this.spawn(r).updateStyle().trigger("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return!(null==t||!t._private.classes[e])},toggleClass:function(e,t){for(var r=e.match(/\S+/g)||[],n=this,i=[],a=0,o=n.length;a<o;a++)for(var s=n[a],l=!1,u=0;u<r.length;u++){var c=r[u],d=s._private.classes,h=d[c],p=t||void 0===t&&!h;p?(d[c]=!0,h||l||(i.push(s),l=!0)):(d[c]=!1,h&&!l&&(i.push(s),l=!0))}return i.length>0&&this.spawn(i).updateStyle().trigger("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var r=this;if(null==t)t=250;else if(0===t)return r;return r.addClass(e),setTimeout(function(){r.removeClass(e)},t),r}};t.exports=i},{"../util":108}],17:[function(e,t,r){"use strict";var n=(e("../is"),e("../selector")),i={allAre:function(e){var t=new n(e);return this.every(function(e){return t.matches(e)})},is:function(e){var t=new n(e);return this.some(function(e){return t.matches(e)})},some:function(e,t){for(var r=0;r<this.length;r++){var n=t?e.apply(t,[this[r],r,this]):e(this[r],r,this);if(n)return!0}return!1},every:function(e,t){for(var r=0;r<this.length;r++){var n=t?e.apply(t,[this[r],r,this]):e(this[r],r,this);if(!n)return!1}return!0},same:function(e){return e=this.cy().collection(e),this.length===e.length&&this.every(function(t){return e.hasElementWithId(t.id())})},anySame:function(e){return e=this.cy().collection(e),this.some(function(t){return e.hasElementWithId(t.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var t=this.neighborhood();return e.every(function(e){return t.hasElementWithId(e.id())})},contains:function(e){e=this.cy().collection(e);var t=this;return e.every(function(e){return t.hasElementWithId(e.id())})}};i.allAreNeighbours=i.allAreNeighbors,i.has=i.contains,t.exports=i},{"../is":91,"../selector":95}],18:[function(e,t,r){"use strict";var n={parent:function(e){var t=[];this._private.cy;if(1===this.length){var r=this[0]._private.parent;if(r)return r}for(var n=0;n<this.length;n++){var i=this[n],r=i._private.parent;r&&t.push(r)}return this.spawn(t,{unique:!0}).filter(e)},parents:function(e){for(var t=[],r=this.parent();r.nonempty();){for(var n=0;n<r.length;n++){var i=r[n];t.push(i)}r=r.parent()}return this.spawn(t,{unique:!0}).filter(e)},commonAncestors:function(e){for(var t,r=0;r<this.length;r++){var n=this[r],i=n.parents();t=t||i,t=t.intersect(i)}return t.filter(e)},orphans:function(e){return this.stdFilter(function(e){return e.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(e){return e.isChild()}).filter(e)},children:function(e){for(var t=[],r=0;r<this.length;r++){var n=this[r];t=t.concat(n._private.children)}return this.spawn(t,{unique:!0}).filter(e)},siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&0!==e._private.children.length},isChildless:function(){var e=this[0];if(e)return e.isNode()&&0===e._private.children.length},isChild:function(){var e=this[0];if(e)return e.isNode()&&null!=e._private.parent},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&null==e._private.parent},descendants:function(e){function t(e){for(var n=0;n<e.length;n++){var i=e[n];r.push(i),i.children().nonempty()&&t(i.children())}}var r=[];return t(this.children()),this.spawn(r,{unique:!0}).filter(e)}};n.ancestors=n.parents,t.exports=n},{}],19:[function(e,t,r){"use strict";var n,i,a=e("../define");n=i={data:a.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:a.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:a.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:a.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:a.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:a.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}},n.attr=n.data,n.removeAttr=n.removeData,t.exports=i},{"../define":44}],20:[function(e,t,r){"use strict";function n(e){return function(t){var r=this;if(void 0===t&&(t=!0),0!==r.length&&r.isNode()&&!r.removed()){for(var n=0,i=r[0],a=i._private.edges,o=0;o<a.length;o++){var s=a[o];!t&&s.isLoop()||(n+=e(i,s))}return n}}}function i(e,t){return function(r){for(var n,i=this.nodes(),a=0;a<i.length;a++){var o=i[a],s=o[e](r);void 0===s||void 0!==n&&!t(s,n)||(n=s)}return n}}var a=e("../util"),o={};a.extend(o,{degree:n(function(e,t){return t.source().same(t.target())?2:1}),indegree:n(function(e,t){return t.target().same(e)?1:0}),outdegree:n(function(e,t){return t.source().same(e)?1:0})}),a.extend(o,{minDegree:i("degree",function(e,t){return e<t}),maxDegree:i("degree",function(e,t){return e>t}),minIndegree:i("indegree",function(e,t){return e<t}),maxIndegree:i("indegree",function(e,t){return e>t}),minOutdegree:i("outdegree",function(e,t){return e<t}),maxOutdegree:i("outdegree",function(e,t){return e>t})}),a.extend(o,{totalDegree:function(e){for(var t=0,r=this.nodes(),n=0;n<r.length;n++)t+=r[n].degree(e);return t}}),t.exports=o},{"../util":108}],21:[function(e,t,r){"use strict";function n(e){return{includeNodes:l["default"](e.includeNodes,x.includeNodes),includeEdges:l["default"](e.includeEdges,x.includeEdges),includeLabels:l["default"](e.includeLabels,x.includeLabels),includeOverlays:l["default"](e.includeOverlays,x.includeOverlays),useCache:l["default"](e.useCache,x.useCache)}}var i,a,o=e("../define"),s=e("../is"),l=e("../util"),u=e("../math");i=a={position:o.data({field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"rtrigger",allowGetting:!0,validKeys:["x","y"],beforeGet:function(e){e.updateCompoundBounds()},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()&&!e.isParent()}}),silentPosition:o.data({field:"position",bindingEvent:"position",allowBinding:!1,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!1,triggerFnName:"trigger",allowGetting:!1,validKeys:["x","y"],onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()&&!e.isParent()}}),positions:function(e,t){if(s.plainObject(e))t?this.silentPosition(e):this.position(e);else if(s.fn(e)){for(var r=e,n=0;n<this.length;n++){var e,i=this[n];if(!i.locked()&&!i.isParent()&&(e=r(i,n))){var a=i._private.position;a.x=e.x,a.y=e.y}}this.dirtyCompoundBoundsCache(),t?this.trigger("position"):this.rtrigger("position")}return this},silentPositions:function(e){return this.positions(e,!0)},renderedPosition:function(e,t){var r=this[0],n=this.cy(),i=n.zoom(),a=n.pan(),o=s.plainObject(e)?e:void 0,l=void 0!==o||void 0!==t&&s.string(e);if(r&&r.isNode()){if(!l){var u=r.position();return o={x:u.x*i+a.x,y:u.y*i+a.y},void 0===e?o:o[e]}for(var c=0;c<this.length;c++){var r=this[c];void 0!==t?r.position(e,(t-a[e])/i):void 0!==o&&r.position({x:(o.x-a.x)/i,y:(o.y-a.y)/i})}}else if(!l)return;return this},relativePosition:function(e,t){var r=this[0],n=this.cy(),i=s.plainObject(e)?e:void 0,a=void 0!==i||void 0!==t&&s.string(e),o=n.hasCompoundNodes();if(r&&r.isNode()){if(!a){var l=r.position(),u=o?r.parent():null,c=u&&u.length>0,d=c;c&&(u=u[0]);var h=d?u.position():{x:0,y:0};return i={x:l.x-h.x,y:l.y-h.y},void 0===e?i:i[e]}for(var p=0;p<this.length;p++){var r=this[p],u=o?r.parent():null,c=u&&u.length>0,d=c;c&&(u=u[0]);var h=d?u.position():{x:0,y:0};void 0!==t?r.position(e,t+h[e]):void 0!==i&&r.position({x:i.x+h.x,y:i.y+h.y})}}else if(!a)return;return this},renderedBoundingBox:function(e){var t=this.boundingBox(e),r=this.cy(),n=r.zoom(),i=r.pan(),a=t.x1*n+i.x,o=t.x2*n+i.x,s=t.y1*n+i.y,l=t.y2*n+i.y;return{x1:a,x2:o,y1:s,y2:l,w:o-a,h:l-s}},dirtyCompoundBoundsCache:function(){var e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;for(var t=this,r=[],n=0;n<t.length;n++)r.push(t[n]);for(;r.length>0;){var i=r.shift();i._private.compoundBoundsClean=!1,i.isParent()&&i.trigger("bounds"),i.isChild()&&r.push(i.parent())}return this},updateCompoundBounds:function(){function e(e){function t(e,t,r){var n=0,i=0,a=t+r;return e>0&&a>0&&(n=t/a*e,i=r/a*e),{biasDiff:n,biasComplementDiff:i}}function n(e,t,r,n){if("%"!==r.units)return"px"===r.units?r.pfValue:0;switch(n){case"width":return e>0?r.pfValue*e:0;case"height":return t>0?r.pfValue*t:0;case"average":return e>0&&t>0?r.pfValue*(e+t)/2:0;case"min":return e>0&&t>0?e>t?r.pfValue*t:r.pfValue*e:0;case"max":return e>0&&t>0?e>t?r.pfValue*e:r.pfValue*t:0;default:return 0}}if(e.isParent()){var a=e._private,o=e.children(),s="include"===e.pstyle("compound-sizing-wrt-labels").value,l={width:{val:e.pstyle("min-width").pfValue,left:e.pstyle("min-width-bias-left"),right:e.pstyle("min-width-bias-right")},height:{val:e.pstyle("min-height").pfValue,top:e.pstyle("min-height-bias-top"),bottom:e.pstyle("min-height-bias-bottom")}},u=o.boundingBox({includeLabels:s,includeOverlays:!1,useCache:!1}),c=a.position,d=l.width.left.value;"px"===l.width.left.units&&l.width.val>0&&(d=100*d/l.width.val);var h=l.width.right.value;"px"===l.width.right.units&&l.width.val>0&&(h=100*h/l.width.val);var p=l.height.top.value;"px"===l.height.top.units&&l.height.val>0&&(p=100*p/l.height.val);var f=l.height.bottom.value;"px"===l.height.bottom.units&&l.height.val>0&&(f=100*f/l.height.val);var g=t(l.width.val-u.w,d,h),v=g.biasDiff,y=g.biasComplementDiff,m=t(l.height.val-u.h,p,f),b=m.biasDiff,x=m.biasComplementDiff;a.autoPadding=n(u.w,u.h,i.pstyle("padding"),i.pstyle("padding-relative-to").value),a.autoWidth=Math.max(u.w,l.width.val),c.x=(-v+u.x1+u.x2+y)/2,a.autoHeight=Math.max(u.h,l.height.val),c.y=(-b+u.y1+u.y2+x)/2,r.push(e)}}var t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes())return this;for(var r=[],n=0;n<this.length;n++){var i=this[n],a=i._private;a.compoundBoundsClean||(e(i),t._private.batchingStyle||(a.compoundBoundsClean=!0))}return this}};var c=function(e){return e===1/0||e===-(1/0)?0:e},d=function(e,t,r,n,i){n-t!==0&&i-r!==0&&(e.x1=t<e.x1?t:e.x1,e.x2=n>e.x2?n:e.x2,e.y1=r<e.y1?r:e.y1,e.y2=i>e.y2?i:e.y2)},h=function(e,t){return d(e,t.x1,t.y1,t.x2,t.y2)},p=function(e,t,r){return l.getPrefixedProperty(e,t,r)},f=function(e,t,r,n){var i,a,o=t._private,s=o.rstyle,l=s.arrowWidth/2,u=t.pstyle(r+"-arrow-shape").value;"none"!==u&&("source"===r?(i=s.srcX,a=s.srcY):"target"===r?(i=s.tgtX,a=s.tgtY):(i=s.midX,a=s.midY),d(e,i-l,a-l,i+l,a+l))},g=function(e,t,r,n){var i;i=r?r+"-":"";var a=t._private,o=a.rstyle,s=t.pstyle(i+"label").strValue;if(s){var l,u,c,h,f=t.pstyle("text-halign"),g=t.pstyle("text-valign"),v=p(o,"labelWidth",r),y=p(o,"labelHeight",r),m=p(o,"labelX",r),b=p(o,"labelY",r),x=t.pstyle(i+"text-margin-x").pfValue,w=t.pstyle(i+"text-margin-y").pfValue,E=t.isEdge(),C=t.pstyle(i+"text-rotation"),P=t.pstyle("text-outline-width").pfValue,D=t.pstyle("text-border-width").pfValue,T=D/2,k=t.pstyle("text-background-padding").pfValue,S=y+2*k,_=v+2*k,M=_/2,I=S/2;if(E)l=m-M,u=m+M,c=b-I,h=b+I;else{switch(f.value){case"left":l=m-_,u=m;break;case"center":l=m-M,u=m+M;break;case"right":l=m,u=m+_}switch(g.value){case"top":c=b-S,h=b;break;case"center":c=b-I,h=b+I;break;case"bottom":c=b,h=b+S}}var N=E&&"autorotate"===C.strValue,B=null!=C.pfValue&&0!==C.pfValue;if(N||B){var z=N?p(a.rstyle,"labelAngle",r):C.pfValue,L=Math.cos(z),O=Math.sin(z),A=function(e,t){return e-=m,t-=b,{x:e*L-t*O+m,y:e*O+t*L+b}},R=A(l,c),V=A(l,h),q=A(u,c),F=A(u,h);l=Math.min(R.x,V.x,q.x,F.x),u=Math.max(R.x,V.x,q.x,F.x),c=Math.min(R.y,V.y,q.y,F.y),h=Math.max(R.y,V.y,q.y,F.y)}l+=x-Math.max(P,T),u+=x+Math.max(P,T),c+=w-Math.max(P,T),h+=w+Math.max(P,T),d(e,l,c,u,h)}return e},v=function(e,t){var r,n,i,a,o,s,l=e._private.cy,h=l._private,p=h.styleEnabled,v={x1:1/0,y1:1/0,x2:-(1/0),y2:-(1/0)},y=e._private,m=p?e.pstyle("display").value:"element",b=e.isNode(),x=e.isEdge(),w="none"!==m;if(w){var E=0,C=0;p&&t.includeOverlays&&(E=e.pstyle("overlay-opacity").value,0!==E&&(C=e.pstyle("overlay-padding").value));var P=0,D=0;if(p&&(P=e.pstyle("width").pfValue,D=P/2),b&&t.includeNodes){var T=e.position();o=T.x,s=T.y;var P=e.outerWidth(),k=P/2,S=e.outerHeight(),_=S/2;r=o-k-C,n=o+k+C,i=s-_-C,a=s+_+C,d(v,r,i,n,a)}else if(x&&t.includeEdges){var M=y.rstyle||{};if(p&&(r=Math.min(M.srcX,M.midX,M.tgtX),n=Math.max(M.srcX,M.midX,M.tgtX),i=Math.min(M.srcY,M.midY,M.tgtY),a=Math.max(M.srcY,M.midY,M.tgtY),r-=D,n+=D,i-=D,a+=D,d(v,r,i,n,a)),p&&"haystack"===e.pstyle("curve-style").strValue){var I=M.haystackPts;if(r=I[0].x,i=I[0].y,n=I[1].x,a=I[1].y,r>n){var N=r;r=n,n=N}if(i>a){var N=i;i=a,a=N}d(v,r-D,i-D,n+D,a+D)}else{for(var B=M.bezierPts||M.linePts||[],z=0;z<B.length;z++){var L=B[z];r=L.x-D,n=L.x+D,i=L.y-D,a=L.y+D,d(v,r,i,n,a)}if(0===B.length){var O=e.source(),A=O.position(),R=e.target(),V=R.position();if(r=A.x,n=V.x,i=A.y,a=V.y,r>n){var N=r;r=n,n=N}if(i>a){var N=i;i=a,a=N}r-=D,n+=D,i-=D,a+=D,d(v,r,i,n,a)}}}p&&(r=v.x1,n=v.x2, i=v.y1,a=v.y2,d(v,r-C,i-C,n+C,a+C)),p&&t.includeEdges&&x&&(f(v,e,"mid-source",t),f(v,e,"mid-target",t),f(v,e,"source",t),f(v,e,"target",t)),p&&t.includeLabels&&(g(v,e,null,t),x&&(g(v,e,"source",t),g(v,e,"target",t)))}return v.x1=c(v.x1),v.y1=c(v.y1),v.x2=c(v.x2),v.y2=c(v.y2),v.w=c(v.x2-v.x1),v.h=c(v.y2-v.y1),v.w>0&&v.h>0&&w&&u.expandBoundingBox(v,1),v},y=function(e){return e?"t":"f"},m=function(e){var t="";return t+=y(e.incudeNodes),t+=y(e.includeEdges),t+=y(e.includeLabels),t+=y(e.includeOverlays)},b=function(e,t){var r,n=e._private,i=e.cy().headless(),a=t===x?w:m(t);return t.useCache&&!i&&n.bbCache&&n.bbCache[a]?r=n.bbCache[a]:(r=v(e,t),i||(n.bbCache=n.bbCache||{},n.bbCache[a]=r)),r},x={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeOverlays:!0,useCache:!0},w=m(x);a.recalculateRenderedStyle=function(e){var t=this.cy(),r=t.renderer(),n=t.styleEnabled();return r&&n&&r.recalculateRenderedStyle(this,e),this},a.boundingBox=function(e){if(1===this.length&&this[0]._private.bbCache&&(void 0===e||void 0===e.useCache||e.useCache===!0))return e=void 0===e?x:n(e),b(this[0],e);var t={x1:1/0,y1:1/0,x2:-(1/0),y2:-(1/0)};e=e||l.staticEmptyObject();var r=n(e),i=this,a=i.cy(),o=a.styleEnabled();o&&this.recalculateRenderedStyle(r.useCache),this.updateCompoundBounds();for(var s={},u=0;u<i.length;u++){var d=i[u];if(o&&d.isEdge()&&"bezier"===d.pstyle("curve-style").strValue&&!s[d.id()]){for(var p=d.parallelEdges(),f=0;f<p.length;f++)s[p[f].id()]=!0;p.recalculateRenderedStyle(r.useCache)}h(t,b(d,r))}return t.x1=c(t.x1),t.y1=c(t.y1),t.x2=c(t.x2),t.y2=c(t.y2),t.w=c(t.x2-t.x1),t.h=c(t.y2-t.y1),t},a.boundingBoxAt=function(e){var t=this.nodes();if(s.plainObject(e)){var r=e;e=function(){return r}}for(var n=0;n<t.length;n++){var i=t[n],a=i._private,o=a.position,l=e.call(i,n,i);a.bbAtOldPos={x:o.x,y:o.y},l&&(o.x=l.x,o.y=l.y)}this.trigger("dirty"),t.dirtyCompoundBoundsCache().updateCompoundBounds();for(var u=this.boundingBox({useCache:!1}),n=0;n<t.length;n++){var i=t[n],a=i._private,o=i._private.position,c=a.bbAtOldPos;o.x=c.x,o.y=c.y}return t.dirtyCompoundBoundsCache(),this.trigger("dirty"),u};var E=function(e){e.uppercaseName=l.capitalize(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=l.capitalize(e.outerName),i[e.name]=function(){var t=this[0],r=t._private,n=r.cy,i=n._private.styleEnabled;if(t){if(!i)return 1;if(t.isParent())return t.updateCompoundBounds(),r[e.autoName]||0;var a=t.pstyle(e.name);switch(a.strValue){case"label":return t.recalculateRenderedStyle(),r.rstyle[e.labelName]||0;default:return a.pfValue}}},i["outer"+e.uppercaseName]=function(){var t=this[0],r=t._private,n=r.cy,i=n._private.styleEnabled;if(t){if(i){var a=t[e.name](),o=t.pstyle("border-width").pfValue,s=2*t.padding();return a+o+s}return 1}},i["rendered"+e.uppercaseName]=function(){var t=this[0];if(t){var r=t[e.name]();return r*this.cy().zoom()}},i["rendered"+e.uppercaseOuterName]=function(){var t=this[0];if(t){var r=t[e.outerName]();return r*this.cy().zoom()}}};E({name:"width"}),E({name:"height"}),a.padding=function(){var e=this[0],t=e._private;return e.isParent()?(e.updateCompoundBounds(),void 0!==t.autoPadding?t.autoPadding:e.pstyle("padding").pfValue):e.pstyle("padding").pfValue},i.modelPosition=i.point=i.position,i.modelPositions=i.points=i.positions,i.renderedPoint=i.renderedPosition,i.relativePoint=i.relativePosition,i.boundingbox=i.boundingBox,i.renderedBoundingbox=i.renderedBoundingBox,t.exports=a},{"../define":44,"../is":91,"../math":93,"../util":108}],22:[function(e,t,r){"use strict";var n=e("../util"),i=e("../is"),a=function(e,t,r){if(r=!(void 0!==r&&!r),void 0===e||void 0===t||!i.core(e))return void n.error("An element must have a core reference and parameters set");var a=t.group;if(null==a&&(a=t.data&&null!=t.data.source&&null!=t.data.target?"edges":"nodes"),"nodes"!==a&&"edges"!==a)return void n.error("An element must be of type `nodes` or `edges`; you specified `"+a+"`");this.length=1,this[0]=this;var o=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:a,style:{},rstyle:{},styleCxts:[],removed:!0,selected:!!t.selected,selectable:void 0===t.selectable||!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:void 0===t.grabbable||!!t.grabbable,active:!1,classes:{},animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:null,traversalCache:{}};if(t.renderedPosition){var s=t.renderedPosition,l=e.pan(),u=e.zoom();o.position={x:(s.x-l.x)/u,y:(s.y-l.y)/u}}if(i.string(t.classes))for(var c=t.classes.split(/\s+/),d=0,h=c.length;d<h;d++){var p=c[d];p&&""!==p&&(o.classes[p]=!0)}(t.style||t.css)&&e.style().applyBypass(this,t.style||t.css),(void 0===r||r)&&this.restore()};t.exports=a},{"../is":91,"../util":108}],23:[function(e,t,r){"use strict";var n=e("../define"),i={on:n.on(),one:n.on({unbindSelfOnTrigger:!0}),once:n.on({unbindAllBindersOnTrigger:!0}),off:n.off(),trigger:n.trigger(),rtrigger:function(e,t){if(0!==this.length)return this.cy().notify({type:e,eles:this}),this.trigger(e,t),this}};n.eventAliasesOn(i),t.exports=i},{"../define":44}],24:[function(e,t,r){"use strict";var n=e("../is"),i=e("../selector"),a={nodes:function(e){return this.filter(function(e,t){return e.isNode()}).filter(e)},edges:function(e){return this.filter(function(e,t){return e.isEdge()}).filter(e)},filter:function(e,t){if(void 0===e)return this;if(n.string(e)||n.elementOrCollection(e))return new i(e).filter(this);if(n.fn(e)){for(var r=this.spawn(),a=this,o=0;o<a.length;o++){var s=a[o],l=t?e.apply(t,[s,o,a]):e(s,o,a);l&&r.merge(s)}return r}return this.spawn()},not:function(e){if(e){n.string(e)&&(e=this.filter(e));for(var t=[],r=e._private.map,i=0;i<this.length;i++){var a=this[i],o=r.has(a.id());o||t.push(a)}return this.spawn(t)}return this},absoluteComplement:function(){var e=this._private.cy;return e.mutableElements().not(this)},intersect:function(e){if(n.string(e)){var t=e;return this.filter(t)}for(var r=[],i=this,a=e,o=this.length<e.length,s=o?a._private.map:i._private.map,l=o?i:a,u=0;u<l.length;u++){var c=l[u]._private.data.id,d=s.get(c);d&&r.push(d.ele)}return this.spawn(r)},xor:function(e){var t=this._private.cy;n.string(e)&&(e=t.$(e));var r=[],i=this,a=e,o=function(e,t){for(var n=0;n<e.length;n++){var i=e[n],a=i._private.data.id,o=t.hasElementWithId(a);o||r.push(i)}};return o(i,a),o(a,i),this.spawn(r)},diff:function(e){var t=this._private.cy;n.string(e)&&(e=t.$(e));var r=[],i=[],a=[],o=this,s=e,l=function(e,t,r){for(var n=0;n<e.length;n++){var i=e[n],o=i._private.data.id,s=t.hasElementWithId(o);s?a.push(i):r.push(i)}};return l(o,s,r),l(s,o,i),{left:this.spawn(r,{unique:!0}),right:this.spawn(i,{unique:!0}),both:this.spawn(a,{unique:!0})}},add:function(e){var t=this._private.cy;if(!e)return this;if(n.string(e)){var r=e;e=t.mutableElements().filter(r)}for(var i=[],a=0;a<this.length;a++)i.push(this[a]);for(var o=this._private.map,a=0;a<e.length;a++){var s=!o.has(e[a].id());s&&i.push(e[a])}return this.spawn(i)},merge:function(e){var t=this._private,r=t.cy;if(!e)return this;if(e&&n.string(e)){var i=e;e=r.mutableElements().filter(i)}for(var a=t.map,o=0;o<e.length;o++){var s=e[o],l=s._private.data.id,u=!a.has(l);if(u){var c=this.length++;this[c]=s,a.set(l,{ele:s,index:c})}else{var c=a.get(l).index;this[c]=s,a.set(l,{ele:s,index:c})}}return this},unmergeOne:function(e){e=e[0];var t=this._private,r=e._private.data.id,n=t.map,i=n.get(r);if(!i)return this;var a=i.index;this[a]=void 0,n["delete"](r);var o=a===this.length-1;if(this.length>1&&!o){var s=this.length-1,l=this[s],u=l._private.data.id;this[s]=void 0,this[a]=l,n.set(u,{ele:l,index:a})}return this.length--,this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&n.string(e)){var r=e;e=t.mutableElements().filter(r)}for(var i=0;i<e.length;i++)this.unmergeOne(e[i]);return this},map:function(e,t){for(var r=[],n=this,i=0;i<n.length;i++){var a=n[i],o=t?e.apply(t,[a,i,n]):e(a,i,n);r.push(o)}return r},reduce:function(e,t){for(var r=t,n=this,i=0;i<n.length;i++)r=e(r,n[i],i,n);return r},max:function(e,t){for(var r,n=-(1/0),i=this,a=0;a<i.length;a++){var o=i[a],s=t?e.apply(t,[o,a,i]):e(o,a,i);s>n&&(n=s,r=o)}return{value:n,ele:r}},min:function(e,t){for(var r,n=1/0,i=this,a=0;a<i.length;a++){var o=i[a],s=t?e.apply(t,[o,a,i]):e(o,a,i);s<n&&(n=s,r=o)}return{value:n,ele:r}}},o=a;o.u=o["|"]=o["+"]=o.union=o.or=o.add,o["\\"]=o["!"]=o["-"]=o.difference=o.relativeComplement=o.subtract=o.not,o.n=o["&"]=o["."]=o.and=o.intersection=o.intersect,o["^"]=o["(+)"]=o["(-)"]=o.symmetricDifference=o.symdiff=o.xor,o.fnFilter=o.filterFn=o.stdFilter=o.filter,o.complement=o.abscomp=o.absoluteComplement,t.exports=a},{"../is":91,"../selector":95}],25:[function(e,t,r){"use strict";var n={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];if(e)return e._private.group}};t.exports=n},{}],26:[function(e,t,r){"use strict";var n=e("../util"),i=e("../is"),a=e("../map"),o=e("../set"),s=e("./element"),l={generate:function(e,t,r){for(var i=null!=r?r:n.uuid();e.hasElementWithId(i);)i=n.uuid();return i}},u=function(e,t,r){if(void 0===e||!i.core(e))return void n.error("A collection must have a reference to the core");var u=new a,c=!1;if(t){if(t.length>0&&i.plainObject(t[0])&&!i.element(t[0])){c=!0;for(var d=[],h=new o,p=0,f=t.length;p<f;p++){var g=t[p];null==g.data&&(g.data={});var v=g.data;if(null==v.id)v.id=l.generate(e,g);else if(e.hasElementWithId(v.id)||h.has(v.id))continue;var y=new s(e,g,(!1));d.push(y),h.add(v.id)}t=d}}else t=[];this.length=0;for(var p=0,f=t.length;p<f;p++){var m=t[p];if(m){var b=m._private.data.id;(!r||r.unique&&!u.has(b))&&(u.set(b,{index:this.length,ele:m}),this[this.length]=m,this.length++)}}this._private={cy:e,map:u},c&&this.restore()},c=s.prototype=u.prototype;c.instanceString=function(){return"collection"},c.spawn=function(e,t,r){return i.core(e)||(r=t,t=e,e=this.cy()),new u(e,t,r)},c.spawnSelf=function(){return this.spawn(this)},c.cy=function(){return this._private.cy},c.element=function(){return this[0]},c.collection=function(){return i.collection(this)?this:new u(this._private.cy,[this])},c.unique=function(){return new u(this._private.cy,this,{unique:!0})},c.hasElementWithId=function(e){return this._private.map.has(e)},c.getElementById=function(e){var t=this._private.cy,r=this._private.map.get(e);return r?r.ele:new u(t)},c.poolIndex=function(){var e=this._private.cy,t=e._private.elements,r=this._private.data.id;return t._private.map.get(r).index},c.json=function(e){var t=this.element(),r=this.cy();if(null==t&&e)return this;if(null!=t){var a=t._private;if(i.plainObject(e)){r.startBatch(),e.data&&t.data(e.data),e.position&&t.position(e.position);var o=function(r,n,i){var o=e[r];null!=o&&o!==a[r]&&(o?t[n]():t[i]())};return o("removed","remove","restore"),o("selected","select","unselect"),o("selectable","selectify","unselectify"),o("locked","lock","unlock"),o("grabbable","grabify","ungrabify"),null!=e.classes&&t.classes(e.classes),r.endBatch(),this}if(void 0===e){var s={data:n.copy(a.data),position:n.copy(a.position),group:a.group,removed:a.removed,selected:a.selected,selectable:a.selectable,locked:a.locked,grabbable:a.grabbable,classes:null};return s.classes=Object.keys(a.classes).filter(function(e){return a.classes[e]}).join(" "),s}}},c.jsons=function(){for(var e=[],t=0;t<this.length;t++){var r=this[t],n=r.json();e.push(n)}return e},c.clone=function(){for(var e=this.cy(),t=[],r=0;r<this.length;r++){var n=this[r],i=n.json(),a=new s(e,i,(!1));t.push(a)}return new u(e,t)},c.copy=c.clone,c.restore=function(e){var t=this,r=t.cy(),o=r._private;void 0===e&&(e=!0);for(var s,c=[],d=[],h=0,p=t.length;h<p;h++){var f=t[h];f.removed()&&(f.isNode()?c.push(f):d.push(f))}s=c.concat(d);var h,g=function(){s.splice(h,1),h--};for(h=0;h<s.length;h++){var f=s[h],v=f._private,y=v.data;if(f.clearTraversalCache(),void 0===y.id)y.id=l.generate(r,f);else if(i.number(y.id))y.id=""+y.id;else{if(i.emptyString(y.id)||!i.string(y.id)){n.error("Can not create element with invalid string ID `"+y.id+"`"),g();continue}if(r.hasElementWithId(y.id)){n.error("Can not create second element with ID `"+y.id+"`"),g();continue}}var m=y.id;if(f.isNode()){var b=f,x=v.position;null==x.x&&(x.x=0),null==x.y&&(x.y=0)}if(f.isEdge()){for(var w=f,E=["source","target"],C=E.length,P=!1,D=0;D<C;D++){var T=E[D],k=y[T];i.number(k)&&(k=y[T]=""+y[T]),null==k||""===k?(n.error("Can not create edge `"+m+"` with unspecified "+T),P=!0):r.hasElementWithId(k)||(n.error("Can not create edge `"+m+"` with nonexistant "+T+" `"+k+"`"),P=!0)}if(P){g();continue}var S=r.getElementById(y.source),_=r.getElementById(y.target);S._private.edges.push(w),_._private.edges.push(w),w._private.source=S,w._private.target=_}v.map=new a,v.map.set(m,{ele:f,index:0}),v.removed=!1,r.addToPool(f)}for(var h=0;h<c.length;h++){var b=c[h],y=b._private.data;i.number(y.parent)&&(y.parent=""+y.parent);var M=y.parent,I=null!=M;if(I){var N=r.getElementById(M);if(N.empty())y.parent=void 0;else{for(var B=!1,z=N;!z.empty();){if(b.same(z)){B=!0,y.parent=void 0;break}z=z.parent()}B||(N[0]._private.children.push(b),b._private.parent=N[0],o.hasCompoundNodes=!0)}}}if(s.length>0){for(var L=new u(r,s),h=0;h<L.length;h++){var f=L[h];if(!f.isNode()){f.parallelEdges().clearTraversalCache();f.source().clearTraversalCache(),f.target().clearTraversalCache()}}var O;O=o.hasCompoundNodes?r.collection().merge(L).merge(L.connectedNodes()).merge(L.parent()):L,O.dirtyCompoundBoundsCache().updateStyle(e),e?L.rtrigger("add"):L.trigger("add")}return t},c.removed=function(){var e=this[0];return e&&e._private.removed},c.inside=function(){var e=this[0];return e&&!e._private.removed},c.remove=function(e){function t(e){for(var t=e._private.edges,r=0;r<t.length;r++)i(t[r])}function r(e){for(var t=e._private.children,r=0;r<t.length;r++)i(t[r])}function i(e){var n=h[e.id()];n||(h[e.id()]=!0,e.isNode()?(d.push(e),t(e),r(e)):d.unshift(e))}function a(e,t){var r=e._private.edges;n.removeFromArray(r,t),e.clearTraversalCache()}function o(e){e.parallelEdges().clearTraversalCache()}function s(e,t){t=t[0],e=e[0];var r=e._private.children,i=e.id();n.removeFromArray(r,t),y.ids[i]||(y.ids[i]=!0,y.push(e))}var l=this,c=[],d=[],h={},p=l._private.cy;void 0===e&&(e=!0);for(var f=0,g=l.length;f<g;f++){var v=l[f];i(v)}var y=[];y.ids={},l.dirtyCompoundBoundsCache(),p.removeFromPool(d);for(var f=0;f<d.length;f++){var v=d[f];if(v._private.removed=!0,c.push(v),v.isEdge()){var m=v.source()[0],b=v.target()[0];a(m,v),a(b,v),o(v)}else{var x=v.parent();0!==x.length&&s(x,v)}}var w=p._private.elements;p._private.hasCompoundNodes=!1;for(var f=0;f<w.length;f++){var v=w[f];if(v.isParent()){p._private.hasCompoundNodes=!0;break}}var E=new u(this.cy(),c);E.size()>0&&(e&&this.cy().notify({type:"remove",eles:E}),E.trigger("remove"));for(var f=0;f<y.length;f++){var v=y[f];v.removed()||v.updateStyle()}return new u(p,c)},c.move=function(e){var t=this._private.cy;if(void 0!==e.source||void 0!==e.target){var r=e.source,n=e.target,i=t.hasElementWithId(r),a=t.hasElementWithId(n);if(i||a){var o=this.jsons();this.remove();for(var s=0;s<o.length;s++){var l=o[s],u=this[s];"edges"===l.group&&(i&&(l.data.source=r),a&&(l.data.target=n),l.scratch=u._private.scratch)}return t.add(o)}}else if(void 0!==e.parent){var c=e.parent,d=null===c||t.hasElementWithId(c);if(d){var o=this.jsons(),h=this.descendants(),p=h.union(h.union(this).connectedEdges()).jsons();this.remove();for(var s=0;s<o.length;s++){var l=o[s],u=this[s];"nodes"===l.group&&(l.data.parent=null===c?void 0:c,l.scratch=u._private.scratch)}return t.add(o.concat(p))}}return this},[e("./algorithms"),e("./animation"),e("./class"),e("./comparators"),e("./compounds"),e("./data"),e("./degree"),e("./dimensions"),e("./events"),e("./filter"),e("./group"),e("./index"),e("./iteration"),e("./layout"),e("./style