mirror of https://github.com/waku-org/waku.org.git
2 lines
450 KiB
JavaScript
2 lines
450 KiB
JavaScript
/*! For license information please see 724.51924eb8.js.LICENSE.txt */
|
|
(self.webpackChunkwaku_docusaurus_template=self.webpackChunkwaku_docusaurus_template||[]).push([[724],{84182:function(e,t,n){var r;r=function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(t,n){t.exports=e},function(e,t,n){"use strict";var r=n(0).FDLayoutConstants;function i(){}for(var a in r)i[a]=r[a];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TREE_REDUCTION_ON_INCREMENTAL=!1,e.exports=i},function(e,t,n){"use strict";var r=n(0).FDLayoutEdge;function i(e,t,n){r.call(this,e,t,n)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i},function(e,t,n){"use strict";var r=n(0).LGraph;function i(e,t,n){r.call(this,e,t,n)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i},function(e,t,n){"use strict";var r=n(0).LGraphManager;function i(e){r.call(this,e)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i},function(e,t,n){"use strict";var r=n(0).FDLayoutNode,i=n(0).IMath;function a(e,t,n,i){r.call(this,e,t,n,i)}for(var o in a.prototype=Object.create(r.prototype),r)a[o]=r[o];a.prototype.move=function(){var e=this.graphManager.getLayout();this.displacementX=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementX=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementY=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementY)),null==this.child||0==this.child.getNodes().length?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),e.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},a.prototype.propogateDisplacementToChildren=function(e,t){for(var n,r=this.getChild().getNodes(),i=0;i<r.length;i++)null==(n=r[i]).getChild()?(n.moveBy(e,t),n.displacementX+=e,n.displacementY+=t):n.propogateDisplacementToChildren(e,t)},a.prototype.setPred1=function(e){this.pred1=e},a.prototype.getPred1=function(){return pred1},a.prototype.getPred2=function(){return pred2},a.prototype.setNext=function(e){this.next=e},a.prototype.getNext=function(){return next},a.prototype.setProcessed=function(e){this.processed=e},a.prototype.isProcessed=function(){return processed},e.exports=a},function(e,t,n){"use strict";var r=n(0).FDLayout,i=n(4),a=n(3),o=n(5),s=n(2),l=n(1),u=n(0).FDLayoutConstants,c=n(0).LayoutConstants,h=n(0).Point,d=n(0).PointD,p=n(0).Layout,g=n(0).Integer,f=n(0).IGeometry,v=n(0).LGraph,y=n(0).Transform;function m(){r.call(this),this.toBeTiled={}}for(var b in m.prototype=Object.create(r.prototype),r)m[b]=r[b];m.prototype.newGraphManager=function(){var e=new i(this);return this.graphManager=e,e},m.prototype.newGraph=function(e){return new a(null,this.graphManager,e)},m.prototype.newNode=function(e){return new o(this.graphManager,e)},m.prototype.newEdge=function(e){return new s(null,null,e)},m.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.isSubLayout||(l.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=l.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=u.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=u.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=u.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=u.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=u.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/u.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=u.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},m.prototype.layout=function(){return c.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},m.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental)l.TREE_REDUCTION_ON_INCREMENTAL&&(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter((function(e){return t.has(e)})),this.graphManager.setAllNodesToApplyGravitation(n));else{var e=this.getFlatForest();if(e.length>0)this.positionNodesRadially(e);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter((function(e){return t.has(e)}));this.graphManager.setAllNodesToApplyGravitation(n),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},m.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%u.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(t),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var n=!this.isTreeGrowing&&!this.isGrowthFinished,r=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(n,r),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},m.prototype.getPositionsData=function(){for(var e=this.graphManager.getAllNodes(),t={},n=0;n<e.length;n++){var r=e[n].rect,i=e[n].id;t[i]={id:i,x:r.getCenterX(),y:r.getCenterY(),w:r.width,h:r.height}}return t},m.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var e=!1;if("during"===u.ANIMATE)this.emit("layoutstarted");else{for(;!e;)e=this.tick();this.graphManager.updateBounds()}},m.prototype.calculateNodesToApplyGravitationTo=function(){var e,t,n=[],r=this.graphManager.getGraphs(),i=r.length;for(t=0;t<i;t++)(e=r[t]).updateConnected(),e.isConnected||(n=n.concat(e.getNodes()));return n},m.prototype.createBendpoints=function(){var e=[];e=e.concat(this.graphManager.getAllEdges());var t,n=new Set;for(t=0;t<e.length;t++){var r=e[t];if(!n.has(r)){var i=r.getSource(),a=r.getTarget();if(i==a)r.getBendpoints().push(new d),r.getBendpoints().push(new d),this.createDummyNodesForBendpoints(r),n.add(r);else{var o=[];if(o=(o=o.concat(i.getEdgeListToNode(a))).concat(a.getEdgeListToNode(i)),!n.has(o[0])){var s;if(o.length>1)for(s=0;s<o.length;s++){var l=o[s];l.getBendpoints().push(new d),this.createDummyNodesForBendpoints(l)}o.forEach((function(e){n.add(e)}))}}}if(n.size==e.length)break}},m.prototype.positionNodesRadially=function(e){for(var t=new h(0,0),n=Math.ceil(Math.sqrt(e.length)),r=0,i=0,a=0,o=new d(0,0),s=0;s<e.length;s++){s%n==0&&(a=0,i=r,0!=s&&(i+=l.DEFAULT_COMPONENT_SEPERATION),r=0);var u=e[s],g=p.findCenterOfTree(u);t.x=a,t.y=i,(o=m.radialLayout(u,g,t)).y>r&&(r=Math.floor(o.y)),a=Math.floor(o.x+l.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(c.WORLD_CENTER_X-o.x/2,c.WORLD_CENTER_Y-o.y/2))},m.radialLayout=function(e,t,n){var r=Math.max(this.maxDiagonalInTree(e),l.DEFAULT_RADIAL_SEPARATION);m.branchRadialLayout(t,null,0,359,0,r);var i=v.calculateBounds(e),a=new y;a.setDeviceOrgX(i.getMinX()),a.setDeviceOrgY(i.getMinY()),a.setWorldOrgX(n.x),a.setWorldOrgY(n.y);for(var o=0;o<e.length;o++)e[o].transform(a);var s=new d(i.getMaxX(),i.getMaxY());return a.inverseTransformPoint(s)},m.branchRadialLayout=function(e,t,n,r,i,a){var o=(r-n+1)/2;o<0&&(o+=180);var s=(o+n)%360*f.TWO_PI/360,l=(Math.cos(s),i*Math.cos(s)),u=i*Math.sin(s);e.setCenter(l,u);var c=[],h=(c=c.concat(e.getEdges())).length;null!=t&&h--;for(var d,p=0,g=c.length,v=e.getEdgesBetween(t);v.length>1;){var y=v[0];v.splice(0,1);var b=c.indexOf(y);b>=0&&c.splice(b,1),g--,h--}d=null!=t?(c.indexOf(v[0])+1)%g:0;for(var x=Math.abs(r-n)/h,w=d;p!=h;w=++w%g){var E=c[w].getOtherEnd(e);if(E!=t){var T=(n+p*x)%360,_=(T+x)%360;m.branchRadialLayout(E,e,T,_,i+a,a),p++}}},m.maxDiagonalInTree=function(e){for(var t=g.MIN_VALUE,n=0;n<e.length;n++){var r=e[n].getDiagonal();r>t&&(t=r)}return t},m.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},m.prototype.groupZeroDegreeMembers=function(){var e=this,t={};this.memberGroups={},this.idToDummyNode={};for(var n=[],r=this.graphManager.getAllNodes(),i=0;i<r.length;i++){var a=(s=r[i]).getParent();0!==this.getNodeDegreeWithChildren(s)||null!=a.id&&this.getToBeTiled(a)||n.push(s)}for(i=0;i<n.length;i++){var s,l=(s=n[i]).getParent().id;void 0===t[l]&&(t[l]=[]),t[l]=t[l].concat(s)}Object.keys(t).forEach((function(n){if(t[n].length>1){var r="DummyCompound_"+n;e.memberGroups[r]=t[n];var i=t[n][0].getParent(),a=new o(e.graphManager);a.id=r,a.paddingLeft=i.paddingLeft||0,a.paddingRight=i.paddingRight||0,a.paddingBottom=i.paddingBottom||0,a.paddingTop=i.paddingTop||0,e.idToDummyNode[r]=a;var s=e.getGraphManager().add(e.newGraph(),a),l=i.getChild();l.add(a);for(var u=0;u<t[n].length;u++){var c=t[n][u];l.remove(c),s.add(c)}}}))},m.prototype.clearCompounds=function(){var e={},t={};this.performDFSOnCompounds();for(var n=0;n<this.compoundOrder.length;n++)t[this.compoundOrder[n].id]=this.compoundOrder[n],e[this.compoundOrder[n].id]=[].concat(this.compoundOrder[n].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[n].getChild()),this.compoundOrder[n].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(e,t)},m.prototype.clearZeroDegreeMembers=function(){var e=this,t=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach((function(n){var r=e.idToDummyNode[n];t[n]=e.tileNodes(e.memberGroups[n],r.paddingLeft+r.paddingRight),r.rect.width=t[n].width,r.rect.height=t[n].height}))},m.prototype.repopulateCompounds=function(){for(var e=this.compoundOrder.length-1;e>=0;e--){var t=this.compoundOrder[e],n=t.id,r=t.paddingLeft,i=t.paddingTop;this.adjustLocations(this.tiledMemberPack[n],t.rect.x,t.rect.y,r,i)}},m.prototype.repopulateZeroDegreeMembers=function(){var e=this,t=this.tiledZeroDegreePack;Object.keys(t).forEach((function(n){var r=e.idToDummyNode[n],i=r.paddingLeft,a=r.paddingTop;e.adjustLocations(t[n],r.rect.x,r.rect.y,i,a)}))},m.prototype.getToBeTiled=function(e){var t=e.id;if(null!=this.toBeTiled[t])return this.toBeTiled[t];var n=e.getChild();if(null==n)return this.toBeTiled[t]=!1,!1;for(var r=n.getNodes(),i=0;i<r.length;i++){var a=r[i];if(this.getNodeDegree(a)>0)return this.toBeTiled[t]=!1,!1;if(null!=a.getChild()){if(!this.getToBeTiled(a))return this.toBeTiled[t]=!1,!1}else this.toBeTiled[a.id]=!1}return this.toBeTiled[t]=!0,!0},m.prototype.getNodeDegree=function(e){e.id;for(var t=e.getEdges(),n=0,r=0;r<t.length;r++){var i=t[r];i.getSource().id!==i.getTarget().id&&(n+=1)}return n},m.prototype.getNodeDegreeWithChildren=function(e){var t=this.getNodeDegree(e);if(null==e.getChild())return t;for(var n=e.getChild().getNodes(),r=0;r<n.length;r++){var i=n[r];t+=this.getNodeDegreeWithChildren(i)}return t},m.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},m.prototype.fillCompexOrderByDFS=function(e){for(var t=0;t<e.length;t++){var n=e[t];null!=n.getChild()&&this.fillCompexOrderByDFS(n.getChild().getNodes()),this.getToBeTiled(n)&&this.compoundOrder.push(n)}},m.prototype.adjustLocations=function(e,t,n,r,i){n+=i;for(var a=t+=r,o=0;o<e.rows.length;o++){var s=e.rows[o];t=a;for(var l=0,u=0;u<s.length;u++){var c=s[u];c.rect.x=t,c.rect.y=n,t+=c.rect.width+e.horizontalPadding,c.rect.height>l&&(l=c.rect.height)}n+=l+e.verticalPadding}},m.prototype.tileCompoundMembers=function(e,t){var n=this;this.tiledMemberPack=[],Object.keys(e).forEach((function(r){var i=t[r];n.tiledMemberPack[r]=n.tileNodes(e[r],i.paddingLeft+i.paddingRight),i.rect.width=n.tiledMemberPack[r].width,i.rect.height=n.tiledMemberPack[r].height}))},m.prototype.tileNodes=function(e,t){var n={rows:[],rowWidth:[],rowHeight:[],width:0,height:t,verticalPadding:l.TILING_PADDING_VERTICAL,horizontalPadding:l.TILING_PADDING_HORIZONTAL};e.sort((function(e,t){return e.rect.width*e.rect.height>t.rect.width*t.rect.height?-1:e.rect.width*e.rect.height<t.rect.width*t.rect.height?1:0}));for(var r=0;r<e.length;r++){var i=e[r];0==n.rows.length?this.insertNodeToRow(n,i,0,t):this.canAddHorizontal(n,i.rect.width,i.rect.height)?this.insertNodeToRow(n,i,this.getShortestRowIndex(n),t):this.insertNodeToRow(n,i,n.rows.length,t),this.shiftToLastRow(n)}return n},m.prototype.insertNodeToRow=function(e,t,n,r){var i=r;n==e.rows.length&&(e.rows.push([]),e.rowWidth.push(i),e.rowHeight.push(0));var a=e.rowWidth[n]+t.rect.width;e.rows[n].length>0&&(a+=e.horizontalPadding),e.rowWidth[n]=a,e.width<a&&(e.width=a);var o=t.rect.height;n>0&&(o+=e.verticalPadding);var s=0;o>e.rowHeight[n]&&(s=e.rowHeight[n],e.rowHeight[n]=o,s=e.rowHeight[n]-s),e.height+=s,e.rows[n].push(t)},m.prototype.getShortestRowIndex=function(e){for(var t=-1,n=Number.MAX_VALUE,r=0;r<e.rows.length;r++)e.rowWidth[r]<n&&(t=r,n=e.rowWidth[r]);return t},m.prototype.getLongestRowIndex=function(e){for(var t=-1,n=Number.MIN_VALUE,r=0;r<e.rows.length;r++)e.rowWidth[r]>n&&(t=r,n=e.rowWidth[r]);return t},m.prototype.canAddHorizontal=function(e,t,n){var r=this.getShortestRowIndex(e);if(r<0)return!0;var i=e.rowWidth[r];if(i+e.horizontalPadding+t<=e.width)return!0;var a,o,s=0;return e.rowHeight[r]<n&&r>0&&(s=n+e.verticalPadding-e.rowHeight[r]),a=e.width-i>=t+e.horizontalPadding?(e.height+s)/(i+t+e.horizontalPadding):(e.height+s)/e.width,s=n+e.verticalPadding,(o=e.width<t?(e.height+s)/t:(e.height+s)/e.width)<1&&(o=1/o),a<1&&(a=1/a),a<o},m.prototype.shiftToLastRow=function(e){var t=this.getLongestRowIndex(e),n=e.rowWidth.length-1,r=e.rows[t],i=r[r.length-1],a=i.width+e.horizontalPadding;if(e.width-e.rowWidth[n]>a&&t!=n){r.splice(-1,1),e.rows[n].push(i),e.rowWidth[t]=e.rowWidth[t]-a,e.rowWidth[n]=e.rowWidth[n]+a,e.width=e.rowWidth[instance.getLongestRowIndex(e)];for(var o=Number.MIN_VALUE,s=0;s<r.length;s++)r[s].height>o&&(o=r[s].height);t>0&&(o+=e.verticalPadding);var l=e.rowHeight[t]+e.rowHeight[n];e.rowHeight[t]=o,e.rowHeight[n]<i.height+e.verticalPadding&&(e.rowHeight[n]=i.height+e.verticalPadding);var u=e.rowHeight[t]+e.rowHeight[n];e.height+=u-l,this.shiftToLastRow(e)}},m.prototype.tilingPreLayout=function(){l.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},m.prototype.tilingPostLayout=function(){l.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},m.prototype.reduceTrees=function(){for(var e,t=[],n=!0;n;){var r=this.graphManager.getAllNodes(),i=[];n=!1;for(var a=0;a<r.length;a++)1!=(e=r[a]).getEdges().length||e.getEdges()[0].isInterGraph||null!=e.getChild()||(i.push([e,e.getEdges()[0],e.getOwner()]),n=!0);if(1==n){for(var o=[],s=0;s<i.length;s++)1==i[s][0].getEdges().length&&(o.push(i[s]),i[s][0].getOwner().remove(i[s][0]));t.push(o),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=t},m.prototype.growTree=function(e){for(var t,n=e[e.length-1],r=0;r<n.length;r++)t=n[r],this.findPlaceforPrunedNode(t),t[2].add(t[0]),t[2].add(t[1],t[1].source,t[1].target);e.splice(e.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},m.prototype.findPlaceforPrunedNode=function(e){var t,n,r=e[0],i=(n=r==e[1].source?e[1].target:e[1].source).startX,a=n.finishX,o=n.startY,s=n.finishY,l=[0,0,0,0];if(o>0)for(var c=i;c<=a;c++)l[0]+=this.grid[c][o-1].length+this.grid[c][o].length-1;if(a<this.grid.length-1)for(c=o;c<=s;c++)l[1]+=this.grid[a+1][c].length+this.grid[a][c].length-1;if(s<this.grid[0].length-1)for(c=i;c<=a;c++)l[2]+=this.grid[c][s+1].length+this.grid[c][s].length-1;if(i>0)for(c=o;c<=s;c++)l[3]+=this.grid[i-1][c].length+this.grid[i][c].length-1;for(var h,d,p=g.MAX_VALUE,f=0;f<l.length;f++)l[f]<p?(p=l[f],h=1,d=f):l[f]==p&&h++;if(3==h&&0==p)0==l[0]&&0==l[1]&&0==l[2]?t=1:0==l[0]&&0==l[1]&&0==l[3]?t=0:0==l[0]&&0==l[2]&&0==l[3]?t=3:0==l[1]&&0==l[2]&&0==l[3]&&(t=2);else if(2==h&&0==p){var v=Math.floor(2*Math.random());t=0==l[0]&&0==l[1]?0==v?0:1:0==l[0]&&0==l[2]?0==v?0:2:0==l[0]&&0==l[3]?0==v?0:3:0==l[1]&&0==l[2]?0==v?1:2:0==l[1]&&0==l[3]?0==v?1:3:0==v?2:3}else t=4==h&&0==p?v=Math.floor(4*Math.random()):d;0==t?r.setCenter(n.getCenterX(),n.getCenterY()-n.getHeight()/2-u.DEFAULT_EDGE_LENGTH-r.getHeight()/2):1==t?r.setCenter(n.getCenterX()+n.getWidth()/2+u.DEFAULT_EDGE_LENGTH+r.getWidth()/2,n.getCenterY()):2==t?r.setCenter(n.getCenterX(),n.getCenterY()+n.getHeight()/2+u.DEFAULT_EDGE_LENGTH+r.getHeight()/2):r.setCenter(n.getCenterX()-n.getWidth()/2-u.DEFAULT_EDGE_LENGTH-r.getWidth()/2,n.getCenterY())},e.exports=m},function(e,t,n){"use strict";var r={};r.layoutBase=n(0),r.CoSEConstants=n(1),r.CoSEEdge=n(2),r.CoSEGraph=n(3),r.CoSEGraphManager=n(4),r.CoSELayout=n(6),r.CoSENode=n(5),e.exports=r}])},e.exports=r(n(82241))},23701:function(e,t,n){var r;r=function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(t,n){t.exports=e},function(e,t,n){"use strict";var r=n(0).layoutBase.LayoutConstants,i=n(0).layoutBase.FDLayoutConstants,a=n(0).CoSEConstants,o=n(0).CoSELayout,s=n(0).CoSENode,l=n(0).layoutBase.PointD,u=n(0).layoutBase.DimensionD,c={ready:function(){},stop:function(){},quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function h(e){this.options=function(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n}(c,e),d(this.options)}var d=function(e){null!=e.nodeRepulsion&&(a.DEFAULT_REPULSION_STRENGTH=i.DEFAULT_REPULSION_STRENGTH=e.nodeRepulsion),null!=e.idealEdgeLength&&(a.DEFAULT_EDGE_LENGTH=i.DEFAULT_EDGE_LENGTH=e.idealEdgeLength),null!=e.edgeElasticity&&(a.DEFAULT_SPRING_STRENGTH=i.DEFAULT_SPRING_STRENGTH=e.edgeElasticity),null!=e.nestingFactor&&(a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.nestingFactor),null!=e.gravity&&(a.DEFAULT_GRAVITY_STRENGTH=i.DEFAULT_GRAVITY_STRENGTH=e.gravity),null!=e.numIter&&(a.MAX_ITERATIONS=i.MAX_ITERATIONS=e.numIter),null!=e.gravityRange&&(a.DEFAULT_GRAVITY_RANGE_FACTOR=i.DEFAULT_GRAVITY_RANGE_FACTOR=e.gravityRange),null!=e.gravityCompound&&(a.DEFAULT_COMPOUND_GRAVITY_STRENGTH=i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.gravityCompound),null!=e.gravityRangeCompound&&(a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.gravityRangeCompound),null!=e.initialEnergyOnIncremental&&(a.DEFAULT_COOLING_FACTOR_INCREMENTAL=i.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.initialEnergyOnIncremental),"draft"==e.quality?r.QUALITY=0:"proof"==e.quality?r.QUALITY=2:r.QUALITY=1,a.NODE_DIMENSIONS_INCLUDE_LABELS=i.NODE_DIMENSIONS_INCLUDE_LABELS=r.NODE_DIMENSIONS_INCLUDE_LABELS=e.nodeDimensionsIncludeLabels,a.DEFAULT_INCREMENTAL=i.DEFAULT_INCREMENTAL=r.DEFAULT_INCREMENTAL=!e.randomize,a.ANIMATE=i.ANIMATE=r.ANIMATE=e.animate,a.TILE=e.tile,a.TILING_PADDING_VERTICAL="function"==typeof e.tilingPaddingVertical?e.tilingPaddingVertical.call():e.tilingPaddingVertical,a.TILING_PADDING_HORIZONTAL="function"==typeof e.tilingPaddingHorizontal?e.tilingPaddingHorizontal.call():e.tilingPaddingHorizontal};h.prototype.run=function(){var e,t,n=this.options,r=(this.idToLNode={},this.layout=new o),i=this;i.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var a=r.newGraphManager();this.gm=a;var s=this.options.eles.nodes(),l=this.options.eles.edges();this.root=a.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(s),r);for(var u=0;u<l.length;u++){var c=l[u],h=this.idToLNode[c.data("source")],d=this.idToLNode[c.data("target")];h!==d&&0==h.getEdgesBetween(d).length&&(a.add(r.newEdge(),h,d).id=c.id())}var p=function(e,t){"number"==typeof e&&(e=t);var n=e.data("id"),r=i.idToLNode[n];return{x:r.getRect().getCenterX(),y:r.getRect().getCenterY()}},g=function a(){for(var o,s=function(){n.fit&&n.cy.fit(n.eles,n.padding),e||(e=!0,i.cy.one("layoutready",n.ready),i.cy.trigger({type:"layoutready",layout:i}))},l=i.options.refresh,u=0;u<l&&!o;u++)o=i.stopped||i.layout.tick();if(o)return r.checkLayoutSuccess()&&!r.isSubLayout&&r.doPostLayout(),r.tilingPostLayout&&r.tilingPostLayout(),r.isLayoutFinished=!0,i.options.eles.nodes().positions(p),s(),i.cy.one("layoutstop",i.options.stop),i.cy.trigger({type:"layoutstop",layout:i}),t&&cancelAnimationFrame(t),void(e=!1);var c=i.layout.getPositionsData();n.eles.nodes().positions((function(e,t){if("number"==typeof e&&(e=t),!e.isParent()){for(var n=e.id(),r=c[n],i=e;null==r&&(r=c[i.data("parent")]||c["DummyCompound_"+i.data("parent")],c[n]=r,null!=(i=i.parent()[0])););return null!=r?{x:r.x,y:r.y}:{x:e.position("x"),y:e.position("y")}}})),s(),t=requestAnimationFrame(a)};return r.addListener("layoutstarted",(function(){"during"===i.options.animate&&(t=requestAnimationFrame(g))})),r.runLayout(),"during"!==this.options.animate&&(i.options.eles.nodes().not(":parent").layoutPositions(i,i.options,p),e=!1),this},h.prototype.getTopMostNodes=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].id()]=!0;var r=e.filter((function(e,n){"number"==typeof e&&(e=n);for(var r=e.parent()[0];null!=r;){if(t[r.id()])return!1;r=r.parent()[0]}return!0}));return r},h.prototype.processChildrenList=function(e,t,n){for(var r=t.length,i=0;i<r;i++){var a,o,c=t[i],h=c.children(),d=c.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if((a=null!=c.outerWidth()&&null!=c.outerHeight()?e.add(new s(n.graphManager,new l(c.position("x")-d.w/2,c.position("y")-d.h/2),new u(parseFloat(d.w),parseFloat(d.h)))):e.add(new s(this.graphManager))).id=c.data("id"),a.paddingLeft=parseInt(c.css("padding")),a.paddingTop=parseInt(c.css("padding")),a.paddingRight=parseInt(c.css("padding")),a.paddingBottom=parseInt(c.css("padding")),this.options.nodeDimensionsIncludeLabels&&c.isParent()){var p=c.boundingBox({includeLabels:!0,includeNodes:!1}).w,g=c.boundingBox({includeLabels:!0,includeNodes:!1}).h,f=c.css("text-halign");a.labelWidth=p,a.labelHeight=g,a.labelPos=f}this.idToLNode[c.data("id")]=a,isNaN(a.rect.x)&&(a.rect.x=0),isNaN(a.rect.y)&&(a.rect.y=0),null!=h&&h.length>0&&(o=n.getGraphManager().add(n.newGraph(),a),this.processChildrenList(o,h,n))}},h.prototype.stop=function(){return this.stopped=!0,this};var p=function(e){e("layout","cose-bilkent",h)};"undefined"!=typeof cytoscape&&p(cytoscape),e.exports=p}])},e.exports=r(n(84182))},71377:function(e,t,n){e.exports=function(){"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){return s(e)||l(e,t)||u(e,t)||h()}function s(e){if(Array.isArray(e))return e}function l(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],o=!0,s=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(l){s=!0,i=l}finally{try{o||null==n.return||n.return()}finally{if(s)throw i}}return a}}function u(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function h(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var d="undefined"==typeof window?null:window,p=d?d.navigator:null;d&&d.document;var g=e(""),f=e({}),v=e((function(){})),y="undefined"==typeof HTMLElement?"undefined":e(HTMLElement),m=function(e){return e&&e.instanceString&&x(e.instanceString)?e.instanceString():null},b=function(t){return null!=t&&e(t)==g},x=function(t){return null!=t&&e(t)===v},w=function(e){return!N(e)&&(Array.isArray?Array.isArray(e):null!=e&&e instanceof Array)},E=function(t){return null!=t&&e(t)===f&&!w(t)&&t.constructor===Object},T=function(t){return null!=t&&e(t)===f},_=function(t){return null!=t&&e(t)===e(1)&&!isNaN(t)},D=function(e){return _(e)&&Math.floor(e)===e},C=function(e){return"undefined"===y?void 0:null!=e&&e instanceof HTMLElement},N=function(e){return A(e)||L(e)},A=function(e){return"collection"===m(e)&&e._private.single},L=function(e){return"collection"===m(e)&&!e._private.single},S=function(e){return"core"===m(e)},O=function(e){return"stylesheet"===m(e)},I=function(e){return"event"===m(e)},k=function(e){return null==e||!(""!==e&&!e.match(/^\s+$/))},M=function(e){return"undefined"!=typeof HTMLElement&&e instanceof HTMLElement},P=function(e){return E(e)&&_(e.x1)&&_(e.x2)&&_(e.y1)&&_(e.y2)},R=function(e){return T(e)&&x(e.then)},B=function(){return p&&p.userAgent.match(/msie|trident|edge/i)},F=function(e,t){t||(t=function(){if(1===arguments.length)return arguments[0];if(0===arguments.length)return"undefined";for(var e=[],t=0;t<arguments.length;t++)e.push(arguments[t]);return e.join("$")});var n=function n(){var r,i=this,a=arguments,o=t.apply(i,a),s=n.cache;return(r=s[o])||(r=s[o]=e.apply(i,a)),r};return n.cache={},n},z=F((function(e){return e.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()}))})),G=F((function(e){return e.replace(/(-\w)/g,(function(e){return e[1].toUpperCase()}))})),Y=F((function(e,t){return e+t[0].toUpperCase()+t.substring(1)}),(function(e,t){return e+"$"+t})),X=function(e){return k(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},V="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",U="rgb[a]?\\(("+V+"[%]?)\\s*,\\s*("+V+"[%]?)\\s*,\\s*("+V+"[%]?)(?:\\s*,\\s*("+V+"))?\\)",j="rgb[a]?\\((?:"+V+"[%]?)\\s*,\\s*(?:"+V+"[%]?)\\s*,\\s*(?:"+V+"[%]?)(?:\\s*,\\s*(?:"+V+"))?\\)",H="hsl[a]?\\(("+V+")\\s*,\\s*("+V+"[%])\\s*,\\s*("+V+"[%])(?:\\s*,\\s*("+V+"))?\\)",q="hsl[a]?\\((?:"+V+")\\s*,\\s*(?:"+V+"[%])\\s*,\\s*(?:"+V+"[%])(?:\\s*,\\s*(?:"+V+"))?\\)",W="\\#[0-9a-fA-F]{3}",$="\\#[0-9a-fA-F]{6}",Z=function(e,t){return e<t?-1:e>t?1:0},K=function(e,t){return-1*Z(e,t)},Q=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments,n=1;n<t.length;n++){var r=t[n];if(null!=r)for(var i=Object.keys(r),a=0;a<i.length;a++){var o=i[a];e[o]=r[o]}}return e},J=function(e){if((4===e.length||7===e.length)&&"#"===e[0]){var t,n,r,i=16;return 4===e.length?(t=parseInt(e[1]+e[1],i),n=parseInt(e[2]+e[2],i),r=parseInt(e[3]+e[3],i)):(t=parseInt(e[1]+e[2],i),n=parseInt(e[3]+e[4],i),r=parseInt(e[5]+e[6],i)),[t,n,r]}},ee=function(e){var t,n,r,i,a,o,s,l;function u(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var c=new RegExp("^"+H+"$").exec(e);if(c){if((n=parseInt(c[1]))<0?n=(360- -1*n%360)%360:n>360&&(n%=360),n/=360,(r=parseFloat(c[2]))<0||r>100)return;if(r/=100,(i=parseFloat(c[3]))<0||i>100)return;if(i/=100,void 0!==(a=c[4])&&((a=parseFloat(a))<0||a>1))return;if(0===r)o=s=l=Math.round(255*i);else{var h=i<.5?i*(1+r):i+r-i*r,d=2*i-h;o=Math.round(255*u(d,h,n+1/3)),s=Math.round(255*u(d,h,n)),l=Math.round(255*u(d,h,n-1/3))}t=[o,s,l,a]}return t},te=function(e){var t,n=new RegExp("^"+U+"$").exec(e);if(n){t=[];for(var r=[],i=1;i<=3;i++){var a=n[i];if("%"===a[a.length-1]&&(r[i]=!0),a=parseFloat(a),r[i]&&(a=a/100*255),a<0||a>255)return;t.push(Math.floor(a))}var o=r[1]||r[2]||r[3],s=r[1]&&r[2]&&r[3];if(o&&!s)return;var l=n[4];if(void 0!==l){if((l=parseFloat(l))<0||l>1)return;t.push(l)}}return t},ne=function(e){return ie[e.toLowerCase()]},re=function(e){return(w(e)?e:null)||ne(e)||J(e)||te(e)||ee(e)},ie={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]},ae=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i<r;i++){var a=n[i];if(E(a))throw Error("Tried to set map with object key");i<n.length-1?(null==t[a]&&(t[a]={}),t=t[a]):t[a]=e.value}},oe=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i<r;i++){var a=n[i];if(E(a))throw Error("Tried to get map with object key");if(null==(t=t[a]))return t}return t};function se(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var le=se,ue="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{};function ce(e,t){return e(t={exports:{}},t.exports),t.exports}var he="object"==typeof ue&&ue&&ue.Object===Object&&ue,de="object"==typeof self&&self&&self.Object===Object&&self,pe=he||de||Function("return this")(),ge=function(){return pe.Date.now()},fe=/\s/;function ve(e){for(var t=e.length;t--&&fe.test(e.charAt(t)););return t}var ye=ve,me=/^\s+/;function be(e){return e?e.slice(0,ye(e)+1).replace(me,""):e}var xe=be,we=pe.Symbol,Ee=Object.prototype,Te=Ee.hasOwnProperty,_e=Ee.toString,De=we?we.toStringTag:void 0;function Ce(e){var t=Te.call(e,De),n=e[De];try{e[De]=void 0;var r=!0}catch(a){}var i=_e.call(e);return r&&(t?e[De]=n:delete e[De]),i}var Ne=Ce,Ae=Object.prototype.toString;function Le(e){return Ae.call(e)}var Se=Le,Oe="[object Null]",Ie="[object Undefined]",ke=we?we.toStringTag:void 0;function Me(e){return null==e?void 0===e?Ie:Oe:ke&&ke in Object(e)?Ne(e):Se(e)}var Pe=Me;function Re(e){return null!=e&&"object"==typeof e}var Be=Re,Fe="[object Symbol]";function ze(e){return"symbol"==typeof e||Be(e)&&Pe(e)==Fe}var Ge=ze,Ye=NaN,Xe=/^[-+]0x[0-9a-f]+$/i,Ve=/^0b[01]+$/i,Ue=/^0o[0-7]+$/i,je=parseInt;function He(e){if("number"==typeof e)return e;if(Ge(e))return Ye;if(le(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=le(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=xe(e);var n=Ve.test(e);return n||Ue.test(e)?je(e.slice(2),n?2:8):Xe.test(e)?Ye:+e}var qe=He,We="Expected a function",$e=Math.max,Ze=Math.min;function Ke(e,t,n){var r,i,a,o,s,l,u=0,c=!1,h=!1,d=!0;if("function"!=typeof e)throw new TypeError(We);function p(t){var n=r,a=i;return r=i=void 0,u=t,o=e.apply(a,n)}function g(e){return u=e,s=setTimeout(y,t),c?p(e):o}function f(e){var n=t-(e-l);return h?Ze(n,a-(e-u)):n}function v(e){var n=e-l;return void 0===l||n>=t||n<0||h&&e-u>=a}function y(){var e=ge();if(v(e))return m(e);s=setTimeout(y,f(e))}function m(e){return s=void 0,d&&r?p(e):(r=i=void 0,o)}function b(){void 0!==s&&clearTimeout(s),u=0,r=l=i=s=void 0}function x(){return void 0===s?o:m(ge())}function w(){var e=ge(),n=v(e);if(r=arguments,i=this,l=e,n){if(void 0===s)return g(l);if(h)return clearTimeout(s),s=setTimeout(y,t),p(l)}return void 0===s&&(s=setTimeout(y,t)),o}return t=qe(t)||0,le(n)&&(c=!!n.leading,a=(h="maxWait"in n)?$e(qe(n.maxWait)||0,t):a,d="trailing"in n?!!n.trailing:d),w.cancel=b,w.flush=x,w}var Qe=Ke,Je=d?d.performance:null,et=Je&&Je.now?function(){return Je.now()}:function(){return Date.now()},tt=function(){if(d){if(d.requestAnimationFrame)return function(e){d.requestAnimationFrame(e)};if(d.mozRequestAnimationFrame)return function(e){d.mozRequestAnimationFrame(e)};if(d.webkitRequestAnimationFrame)return function(e){d.webkitRequestAnimationFrame(e)};if(d.msRequestAnimationFrame)return function(e){d.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout((function(){e(et())}),1e3/60)}}(),nt=function(e){return tt(e)},rt=et,it=9261,at=65599,ot=5381,st=function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:it;!(t=e.next()).done;)n=n*at+t.value|0;return n},lt=function(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:it)*at+e|0},ut=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ot;return(t<<5)+t+e|0},ct=function(e,t){return 2097152*e+t},ht=function(e){return 2097152*e[0]+e[1]},dt=function(e,t){return[lt(e[0],t[0]),ut(e[1],t[1])]},pt=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return st({next:function(){return r<i?n.value=e[r++]:n.done=!0,n}},t)},gt=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return st({next:function(){return r<i?n.value=e.charCodeAt(r++):n.done=!0,n}},t)},ft=function(){return vt(arguments)},vt=function(e){for(var t,n=0;n<e.length;n++){var r=e[n];t=0===n?gt(r):gt(r,t)}return t},yt=!0,mt=null!=console.warn,bt=null!=console.trace,xt=Number.MAX_SAFE_INTEGER||9007199254740991,wt=function(){return!0},Et=function(){return!1},Tt=function(){return 0},_t=function(){},Dt=function(e){throw new Error(e)},Ct=function(e){if(void 0===e)return yt;yt=!!e},Nt=function(e){Ct()&&(mt?console.warn(e):(console.log(e),bt&&console.trace()))},At=function(e){return Q({},e)},Lt=function(e){return null==e?e:w(e)?e.slice():E(e)?At(e):e},St=function(e){return e.slice()},Ot=function(e,t){for(t=e="";e++<36;t+=51*e&52?(15^e?8^Math.random()*(20^e?16:4):4).toString(16):"-");return t},It={},kt=function(){return It},Mt=function(e){var t=Object.keys(e);return function(n){for(var r={},i=0;i<t.length;i++){var a=t[i],o=null==n?void 0:n[a];r[a]=void 0===o?e[a]:o}return r}},Pt=function(e,t,n){for(var r=e.length-1;r>=0&&(e[r]!==t||(e.splice(r,1),!n));r--);},Rt=function(e){e.splice(0,e.length)},Bt=function(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.push(r)}},Ft=function(e,t,n){return n&&(t=Y(n,t)),e[t]},zt=function(e,t,n,r){n&&(t=Y(n,t)),e[t]=r},Gt=function(){function e(){t(this,e),this._obj={}}return i(e,[{key:"set",value:function(e,t){return this._obj[e]=t,this}},{key:"delete",value:function(e){return this._obj[e]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(e){return void 0!==this._obj[e]}},{key:"get",value:function(e){return this._obj[e]}}]),e}(),Yt="undefined"!=typeof Map?Map:Gt,Xt="undefined",Vt=function(){function e(n){if(t(this,e),this._obj=Object.create(null),this.size=0,null!=n){var r;r=null!=n.instanceString&&n.instanceString()===this.instanceString()?n.toArray():n;for(var i=0;i<r.length;i++)this.add(r[i])}}return i(e,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(e){var t=this._obj;1!==t[e]&&(t[e]=1,this.size++)}},{key:"delete",value:function(e){var t=this._obj;1===t[e]&&(t[e]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(e){return 1===this._obj[e]}},{key:"toArray",value:function(){var e=this;return Object.keys(this._obj).filter((function(t){return e.has(t)}))}},{key:"forEach",value:function(e,t){return this.toArray().forEach(e,t)}}]),e}(),Ut=("undefined"==typeof Set?"undefined":e(Set))!==Xt?Set:Vt,jt=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0!==e&&void 0!==t&&S(e)){var r=t.group;if(null==r&&(r=t.data&&null!=t.data.source&&null!=t.data.target?"edges":"nodes"),"nodes"===r||"edges"===r){this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:r,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:void 0===t.selectable||!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:void 0===t.grabbable||!!t.grabbable,pannable:void 0===t.pannable?"edges"===r:!!t.pannable,active:!1,classes:new Ut,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(null==i.position.x&&(i.position.x=0),null==i.position.y&&(i.position.y=0),t.renderedPosition){var a=t.renderedPosition,o=e.pan(),s=e.zoom();i.position={x:(a.x-o.x)/s,y:(a.y-o.y)/s}}var l=[];w(t.classes)?l=t.classes:b(t.classes)&&(l=t.classes.split(/\s+/));for(var u=0,c=l.length;u<c;u++){var h=l[u];h&&""!==h&&i.classes.add(h)}this.createEmitter();var d=t.style||t.css;d&&(Nt("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(d)),(void 0===n||n)&&this.restore()}else Dt("An element must be of type `nodes` or `edges`; you specified `"+r+"`")}else Dt("An element must have a core reference and parameters set")},Ht=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(t,n,r){var i;E(t)&&!N(t)&&(t=(i=t).roots||i.root,n=i.visit,r=i.directed),r=2!==arguments.length||x(n)?r:n,n=x(n)?n:function(){};for(var a,o=this._private.cy,s=t=b(t)?this.filter(t):t,l=[],u=[],c={},h={},d={},p=0,g=this.byGroup(),f=g.nodes,v=g.edges,y=0;y<s.length;y++){var m=s[y],w=m.id();m.isNode()&&(l.unshift(m),e.bfs&&(d[w]=!0,u.push(m)),h[w]=0)}for(var T=function(){var t=e.bfs?l.shift():l.pop(),i=t.id();if(e.dfs){if(d[i])return"continue";d[i]=!0,u.push(t)}var o=h[i],s=c[i],g=null!=s?s.source():null,y=null!=s?s.target():null,m=null==s?void 0:t.same(g)?y[0]:g[0],b=void 0;if(!0===(b=n(t,s,m,p++,o)))return a=t,"break";if(!1===b)return"break";for(var x=t.connectedEdges().filter((function(e){return(!r||e.source().same(t))&&v.has(e)})),w=0;w<x.length;w++){var E=x[w],T=E.connectedNodes().filter((function(e){return!e.same(t)&&f.has(e)})),_=T.id();0===T.length||d[_]||(T=T[0],l.push(T),e.bfs&&(d[_]=!0,u.push(T)),c[_]=E,h[_]=h[i]+1)}};0!==l.length;){var _=T();if("continue"!==_&&"break"===_)break}for(var D=o.collection(),C=0;C<u.length;C++){var A=u[C],L=c[A.id()];null!=L&&D.push(L),D.push(A)}return{path:o.collection(D),found:o.collection(a)}}},qt={breadthFirstSearch:Ht({bfs:!0}),depthFirstSearch:Ht({dfs:!0})};qt.bfs=qt.breadthFirstSearch,qt.dfs=qt.depthFirstSearch;var Wt=ce((function(e,t){(function(){var t,n,r,i,a,o,s,l,u,c,h,d,p,g,f;r=Math.floor,c=Math.min,n=function(e,t){return e<t?-1:e>t?1:0},u=function(e,t,i,a,o){var s;if(null==i&&(i=0),null==o&&(o=n),i<0)throw new Error("lo must be non-negative");for(null==a&&(a=e.length);i<a;)o(t,e[s=r((i+a)/2)])<0?a=s:i=s+1;return[].splice.apply(e,[i,i-i].concat(t)),t},o=function(e,t,r){return null==r&&(r=n),e.push(t),g(e,0,e.length-1,r)},a=function(e,t){var r,i;return null==t&&(t=n),r=e.pop(),e.length?(i=e[0],e[0]=r,f(e,0,t)):i=r,i},l=function(e,t,r){var i;return null==r&&(r=n),i=e[0],e[0]=t,f(e,0,r),i},s=function(e,t,r){var i;return null==r&&(r=n),e.length&&r(e[0],t)<0&&(t=(i=[e[0],t])[0],e[0]=i[1],f(e,0,r)),t},i=function(e,t){var i,a,o,s,l,u;for(null==t&&(t=n),l=[],a=0,o=(s=function(){u=[];for(var t=0,n=r(e.length/2);0<=n?t<n:t>n;0<=n?t++:t--)u.push(t);return u}.apply(this).reverse()).length;a<o;a++)i=s[a],l.push(f(e,i,t));return l},p=function(e,t,r){var i;if(null==r&&(r=n),-1!==(i=e.indexOf(t)))return g(e,0,i,r),f(e,i,r)},h=function(e,t,r){var a,o,l,u,c;if(null==r&&(r=n),!(o=e.slice(0,t)).length)return o;for(i(o,r),l=0,u=(c=e.slice(t)).length;l<u;l++)a=c[l],s(o,a,r);return o.sort(r).reverse()},d=function(e,t,r){var o,s,l,h,d,p,g,f,v;if(null==r&&(r=n),10*t<=e.length){if(!(l=e.slice(0,t).sort(r)).length)return l;for(s=l[l.length-1],h=0,p=(g=e.slice(t)).length;h<p;h++)r(o=g[h],s)<0&&(u(l,o,0,null,r),l.pop(),s=l[l.length-1]);return l}for(i(e,r),v=[],d=0,f=c(t,e.length);0<=f?d<f:d>f;0<=f?++d:--d)v.push(a(e,r));return v},g=function(e,t,r,i){var a,o,s;for(null==i&&(i=n),a=e[r];r>t&&i(a,o=e[s=r-1>>1])<0;)e[r]=o,r=s;return e[r]=a},f=function(e,t,r){var i,a,o,s,l;for(null==r&&(r=n),a=e.length,l=t,o=e[t],i=2*t+1;i<a;)(s=i+1)<a&&!(r(e[i],e[s])<0)&&(i=s),e[t]=e[i],i=2*(t=i)+1;return e[t]=o,g(e,l,t,r)},t=function(){function e(e){this.cmp=null!=e?e:n,this.nodes=[]}return e.push=o,e.pop=a,e.replace=l,e.pushpop=s,e.heapify=i,e.updateItem=p,e.nlargest=h,e.nsmallest=d,e.prototype.push=function(e){return o(this.nodes,e,this.cmp)},e.prototype.pop=function(){return a(this.nodes,this.cmp)},e.prototype.peek=function(){return this.nodes[0]},e.prototype.contains=function(e){return-1!==this.nodes.indexOf(e)},e.prototype.replace=function(e){return l(this.nodes,e,this.cmp)},e.prototype.pushpop=function(e){return s(this.nodes,e,this.cmp)},e.prototype.heapify=function(){return i(this.nodes,this.cmp)},e.prototype.updateItem=function(e){return p(this.nodes,e,this.cmp)},e.prototype.clear=function(){return this.nodes=[]},e.prototype.empty=function(){return 0===this.nodes.length},e.prototype.size=function(){return this.nodes.length},e.prototype.clone=function(){var t;return(t=new e).nodes=this.nodes.slice(0),t},e.prototype.toArray=function(){return this.nodes.slice(0)},e.prototype.insert=e.prototype.push,e.prototype.top=e.prototype.peek,e.prototype.front=e.prototype.peek,e.prototype.has=e.prototype.contains,e.prototype.copy=e.prototype.clone,e}(),function(t,n){e.exports=n()}(0,(function(){return t}))}).call(ue)})),$t=Wt,Zt=Mt({root:null,weight:function(e){return 1},directed:!1}),Kt={dijkstra:function(e){if(!E(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var n=Zt(e),r=n.root,i=n.weight,a=n.directed,o=this,s=i,l=b(r)?this.filter(r)[0]:r[0],u={},c={},h={},d=this.byGroup(),p=d.nodes,g=d.edges;g.unmergeBy((function(e){return e.isLoop()}));for(var f=function(e){return u[e.id()]},v=function(e,t){u[e.id()]=t,y.updateItem(e)},y=new $t((function(e,t){return f(e)-f(t)})),m=0;m<p.length;m++){var x=p[m];u[x.id()]=x.same(l)?0:1/0,y.push(x)}for(var w=function(e,t){for(var n,r=(a?e.edgesTo(t):e.edgesWith(t)).intersect(g),i=1/0,o=0;o<r.length;o++){var l=r[o],u=s(l);(u<i||!n)&&(i=u,n=l)}return{edge:n,dist:i}};y.size()>0;){var T=y.pop(),_=f(T),D=T.id();if(h[D]=_,_!==1/0)for(var C=T.neighborhood().intersect(p),N=0;N<C.length;N++){var A=C[N],L=A.id(),S=w(T,A),O=_+S.dist;O<f(A)&&(v(A,O),c[L]={node:T,edge:S.edge})}}return{distanceTo:function(e){var t=b(e)?p.filter(e)[0]:e[0];return h[t.id()]},pathTo:function(e){var t=b(e)?p.filter(e)[0]:e[0],n=[],r=t,i=r.id();if(t.length>0)for(n.unshift(t);c[i];){var a=c[i];n.unshift(a.edge),n.unshift(a.node),i=(r=a.node).id()}return o.spawn(n)}}}},Qt={kruskal:function(e){e=e||function(e){return 1};for(var t=this.byGroup(),n=t.nodes,r=t.edges,i=n.length,a=new Array(i),o=n,s=function(e){for(var t=0;t<a.length;t++)if(a[t].has(e))return t},l=0;l<i;l++)a[l]=this.spawn(n[l]);for(var u=r.sort((function(t,n){return e(t)-e(n)})),c=0;c<u.length;c++){var h=u[c],d=h.source()[0],p=h.target()[0],g=s(d),f=s(p),v=a[g],y=a[f];g!==f&&(o.merge(h),v.merge(y),a.splice(f,1))}return o}},Jt=Mt({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),en={aStar:function(e){var t=this.cy(),n=Jt(e),r=n.root,i=n.goal,a=n.heuristic,o=n.directed,s=n.weight;r=t.collection(r)[0],i=t.collection(i)[0];var l,u,c=r.id(),h=i.id(),d={},p={},g={},f=new $t((function(e,t){return p[e.id()]-p[t.id()]})),v=new Ut,y={},m={},b=function(e,t){f.push(e),v.add(t)},x=function(){l=f.pop(),u=l.id(),v.delete(u)},w=function(e){return v.has(e)};b(r,c),d[c]=0,p[c]=a(r);for(var E=0;f.size()>0;){if(x(),E++,u===h){for(var T=[],_=i,D=h,C=m[D];T.unshift(_),null!=C&&T.unshift(C),null!=(_=y[D]);)C=m[D=_.id()];return{found:!0,distance:d[u],path:this.spawn(T),steps:E}}g[u]=!0;for(var N=l._private.edges,A=0;A<N.length;A++){var L=N[A];if(this.hasElementWithId(L.id())&&(!o||L.data("source")===u)){var S=L.source(),O=L.target(),I=S.id()!==u?S:O,k=I.id();if(this.hasElementWithId(k)&&!g[k]){var M=d[u]+s(L);w(k)?M<d[k]&&(d[k]=M,p[k]=M+a(I),y[k]=l,m[k]=L):(d[k]=M,p[k]=M+a(I),b(I,k),y[k]=l,m[k]=L)}}}}return{found:!1,distance:void 0,path:void 0,steps:E}}},tn=Mt({weight:function(e){return 1},directed:!1}),nn={floydWarshall:function(e){for(var t=this.cy(),n=tn(e),r=n.weight,i=n.directed,a=r,o=this.byGroup(),s=o.nodes,l=o.edges,u=s.length,c=u*u,h=function(e){return s.indexOf(e)},d=function(e){return s[e]},p=new Array(c),g=0;g<c;g++){var f=g%u,v=(g-f)/u;p[g]=v===f?0:1/0}for(var y=new Array(c),m=new Array(c),x=0;x<l.length;x++){var w=l[x],E=w.source()[0],T=w.target()[0];if(E!==T){var _=h(E),D=h(T),C=_*u+D,N=a(w);if(p[C]>N&&(p[C]=N,y[C]=D,m[C]=w),!i){var A=D*u+_;!i&&p[A]>N&&(p[A]=N,y[A]=_,m[A]=w)}}}for(var L=0;L<u;L++)for(var S=0;S<u;S++)for(var O=S*u+L,I=0;I<u;I++){var k=S*u+I,M=L*u+I;p[O]+p[M]<p[k]&&(p[k]=p[O]+p[M],y[k]=y[O])}var P=function(e){return(b(e)?t.filter(e):e)[0]},R=function(e){return h(P(e))},B={distance:function(e,t){var n=R(e),r=R(t);return p[n*u+r]},path:function(e,n){var r=R(e),i=R(n),a=d(r);if(r===i)return a.collection();if(null==y[r*u+i])return t.collection();var o,s=t.collection(),l=r;for(s.merge(a);r!==i;)l=r,r=y[r*u+i],o=m[l*u+r],s.merge(o),s.merge(d(r));return s}};return B}},rn=Mt({weight:function(e){return 1},directed:!1,root:null}),an={bellmanFord:function(e){var t=this,n=rn(e),r=n.weight,i=n.directed,a=n.root,o=r,s=this,l=this.cy(),u=this.byGroup(),c=u.edges,h=u.nodes,d=h.length,p=new Yt,g=!1,f=[];a=l.collection(a)[0],c.unmergeBy((function(e){return e.isLoop()}));for(var v=c.length,y=function(e){var t=p.get(e.id());return t||(t={},p.set(e.id(),t)),t},m=function(e){return(b(e)?l.$(e):e)[0]},x=function(e){return y(m(e)).dist},w=function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a,r=[],i=m(e);;){if(null==i)return t.spawn();var o=y(i),l=o.edge,u=o.pred;if(r.unshift(i[0]),i.same(n)&&r.length>0)break;null!=l&&r.unshift(l),i=u}return s.spawn(r)},E=0;E<d;E++){var T=h[E],_=y(T);T.same(a)?_.dist=0:_.dist=1/0,_.pred=null,_.edge=null}for(var D=!1,C=function(e,t,n,r,i,a){var o=r.dist+a;o<i.dist&&!n.same(r.edge)&&(i.dist=o,i.pred=e,i.edge=n,D=!0)},N=1;N<d;N++){D=!1;for(var A=0;A<v;A++){var L=c[A],S=L.source(),O=L.target(),I=o(L),k=y(S),M=y(O);C(S,O,L,k,M,I),i||C(O,S,L,M,k,I)}if(!D)break}if(D)for(var P=[],R=0;R<v;R++){var B=c[R],F=B.source(),z=B.target(),G=o(B),Y=y(F).dist,X=y(z).dist;if(Y+G<X||!i&&X+G<Y){if(g||(Nt("Graph contains a negative weight cycle for Bellman-Ford"),g=!0),!1===e.findNegativeWeightCycles)break;var V=[];Y+G<X&&V.push(F),!i&&X+G<Y&&V.push(z);for(var U=V.length,j=0;j<U;j++){var H=V[j],q=[H];q.push(y(H).edge);for(var W=y(H).pred;-1===q.indexOf(W);)q.push(W),q.push(y(W).edge),W=y(W).pred;for(var $=(q=q.slice(q.indexOf(W)))[0].id(),Z=0,K=2;K<q.length;K+=2)q[K].id()<$&&($=q[K].id(),Z=K);(q=q.slice(Z).concat(q.slice(0,Z))).push(q[0]);var Q=q.map((function(e){return e.id()})).join(",");-1===P.indexOf(Q)&&(f.push(s.spawn(q)),P.push(Q))}}}return{distanceTo:x,pathTo:w,hasNegativeWeightCycle:g,negativeWeightCycles:f}}},on=Math.sqrt(2),sn=function(e,t,n){0===n.length&&Dt("Karger-Stein must be run on a connected (sub)graph");for(var r=n[e],i=r[1],a=r[2],o=t[i],s=t[a],l=n,u=l.length-1;u>=0;u--){var c=l[u],h=c[1],d=c[2];(t[h]===o&&t[d]===s||t[h]===s&&t[d]===o)&&l.splice(u,1)}for(var p=0;p<l.length;p++){var g=l[p];g[1]===s?(l[p]=g.slice(),l[p][1]=o):g[2]===s&&(l[p]=g.slice(),l[p][2]=o)}for(var f=0;f<t.length;f++)t[f]===s&&(t[f]=o);return l},ln=function(e,t,n,r){for(;n>r;){var i=Math.floor(Math.random()*t.length);t=sn(i,e,t),n--}return t},un={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,r=t.edges;r.unmergeBy((function(e){return e.isLoop()}));var i=n.length,a=r.length,o=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),s=Math.floor(i/on);if(!(i<2)){for(var l=[],u=0;u<a;u++){var c=r[u];l.push([u,n.indexOf(c.source()),n.indexOf(c.target())])}for(var h=1/0,d=[],p=new Array(i),g=new Array(i),f=new Array(i),v=function(e,t){for(var n=0;n<i;n++)t[n]=e[n]},y=0;y<=o;y++){for(var m=0;m<i;m++)g[m]=m;var b=ln(g,l.slice(),i,s),x=b.slice();v(g,f);var w=ln(g,b,s,2),E=ln(f,x,s,2);w.length<=E.length&&w.length<h?(h=w.length,d=w,v(g,p)):E.length<=w.length&&E.length<h&&(h=E.length,d=E,v(f,p))}for(var T=this.spawn(d.map((function(e){return r[e[0]]}))),_=this.spawn(),D=this.spawn(),C=p[0],N=0;N<p.length;N++){var A=p[N],L=n[N];A===C?_.merge(L):D.merge(L)}var S=function(t){var n=e.spawn();return t.forEach((function(t){n.merge(t),t.connectedEdges().forEach((function(t){e.contains(t)&&!T.contains(t)&&n.merge(t)}))})),n},O=[S(_),S(D)];return{cut:T,components:O,partition1:_,partition2:D}}Dt("At least 2 nodes are required for Karger-Stein algorithm")}},cn=function(e){return{x:e.x,y:e.y}},hn=function(e,t,n){return{x:e.x*t+n.x,y:e.y*t+n.y}},dn=function(e,t,n){return{x:(e.x-n.x)/t,y:(e.y-n.y)/t}},pn=function(e){return{x:e[0],y:e[1]}},gn=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=1/0,i=t;i<n;i++){var a=e[i];isFinite(a)&&(r=Math.min(a,r))}return r},fn=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=-1/0,i=t;i<n;i++){var a=e[i];isFinite(a)&&(r=Math.max(a,r))}return r},vn=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=0,i=0,a=t;a<n;a++){var o=e[a];isFinite(o)&&(r+=o,i++)}return r/i},yn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];arguments.length>3&&void 0!==arguments[3]&&!arguments[3]?(n<e.length&&e.splice(n,e.length-n),t>0&&e.splice(0,t)):e=e.slice(t,n);for(var a=0,o=e.length-1;o>=0;o--){var s=e[o];i?isFinite(s)||(e[o]=-1/0,a++):e.splice(o,1)}r&&e.sort((function(e,t){return e-t}));var l=e.length,u=Math.floor(l/2);return l%2!=0?e[u+1+a]:(e[u-1+a]+e[u+a])/2},mn=function(e){return Math.PI*e/180},bn=function(e,t){return Math.atan2(t,e)-Math.PI/2},xn=Math.log2||function(e){return Math.log(e)/Math.log(2)},wn=function(e){return e>0?1:e<0?-1:0},En=function(e,t){return Math.sqrt(Tn(e,t))},Tn=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},_n=function(e){for(var t=e.length,n=0,r=0;r<t;r++)n+=e[r];for(var i=0;i<t;i++)e[i]=e[i]/n;return e},Dn=function(e,t,n,r){return(1-r)*(1-r)*e+2*(1-r)*r*t+r*r*n},Cn=function(e,t,n,r){return{x:Dn(e.x,t.x,n.x,r),y:Dn(e.y,t.y,n.y,r)}},Nn=function(e,t,n,r){var i={x:t.x-e.x,y:t.y-e.y},a=En(e,t),o={x:i.x/a,y:i.y/a};return n=null==n?0:n,r=null!=r?r:n*a,{x:e.x+o.x*r,y:e.y+o.y*r}},An=function(e,t,n){return Math.max(e,Math.min(n,t))},Ln=function(e){if(null==e)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};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}}},Sn=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},On=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},In=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},kn=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},Mn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Pn=function(e){var t,n,r,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===a.length)t=n=r=i=a[0];else if(2===a.length)t=r=a[0],i=n=a[1];else if(4===a.length){var s=o(a,4);t=s[0],n=s[1],r=s[2],i=s[3]}return e.x1-=i,e.x2+=n,e.y1-=t,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Rn=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},Bn=function(e,t){return!(e.x1>t.x2||t.x1>e.x2||e.x2<t.x1||t.x2<e.x1||e.y2<t.y1||t.y2<e.y1||e.y1>t.y2||t.y1>e.y2)},Fn=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},zn=function(e,t){return Fn(e,t.x,t.y)},Gn=function(e,t){return Fn(e,t.x1,t.y1)&&Fn(e,t.x2,t.y2)},Yn=function(e,t,n,r,i,a,o){var s,l=cr(i,a),u=i/2,c=a/2,h=r-c-o;if((s=rr(e,t,n,r,n-u+l-o,h,n+u-l+o,h,!1)).length>0)return s;var d=n+u+o;if((s=rr(e,t,n,r,d,r-c+l-o,d,r+c-l+o,!1)).length>0)return s;var p=r+c+o;if((s=rr(e,t,n,r,n-u+l-o,p,n+u-l+o,p,!1)).length>0)return s;var g,f=n-u-o;if((s=rr(e,t,n,r,f,r-c+l-o,f,r+c-l+o,!1)).length>0)return s;var v=n-u+l,y=r-c+l;if((g=tr(e,t,n,r,v,y,l+o)).length>0&&g[0]<=v&&g[1]<=y)return[g[0],g[1]];var m=n+u-l,b=r-c+l;if((g=tr(e,t,n,r,m,b,l+o)).length>0&&g[0]>=m&&g[1]<=b)return[g[0],g[1]];var x=n+u-l,w=r+c-l;if((g=tr(e,t,n,r,x,w,l+o)).length>0&&g[0]>=x&&g[1]>=w)return[g[0],g[1]];var E=n-u+l,T=r+c-l;return(g=tr(e,t,n,r,E,T,l+o)).length>0&&g[0]<=E&&g[1]>=T?[g[0],g[1]]:[]},Xn=function(e,t,n,r,i,a,o){var s=o,l=Math.min(n,i),u=Math.max(n,i),c=Math.min(r,a),h=Math.max(r,a);return l-s<=e&&e<=u+s&&c-s<=t&&t<=h+s},Vn=function(e,t,n,r,i,a,o,s,l){var u={x1:Math.min(n,o,i)-l,x2:Math.max(n,o,i)+l,y1:Math.min(r,s,a)-l,y2:Math.max(r,s,a)+l};return!(e<u.x1||e>u.x2||t<u.y1||t>u.y2)},Un=function(e,t,n,r){var i=t*t-4*e*(n-=r);if(i<0)return[];var a=Math.sqrt(i),o=2*e;return[(-t+a)/o,(-t-a)/o]},jn=function(e,t,n,r,i){var a,o,s,l,u,c,h,d;return 0===e&&(e=1e-5),s=-27*(r/=e)+(t/=e)*(9*(n/=e)-t*t*2),a=(o=(3*n-t*t)/9)*o*o+(s/=54)*s,i[1]=0,h=t/3,a>0?(u=(u=s+Math.sqrt(a))<0?-Math.pow(-u,1/3):Math.pow(u,1/3),c=(c=s-Math.sqrt(a))<0?-Math.pow(-c,1/3):Math.pow(c,1/3),i[0]=-h+u+c,h+=(u+c)/2,i[4]=i[2]=-h,h=Math.sqrt(3)*(-c+u)/2,i[3]=h,void(i[5]=-h)):(i[5]=i[3]=0,0===a?(d=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3),i[0]=2*d-h,void(i[4]=i[2]=-(d+h))):(l=(o=-o)*o*o,l=Math.acos(s/Math.sqrt(l)),d=2*Math.sqrt(o),i[0]=-h+d*Math.cos(l/3),i[2]=-h+d*Math.cos((l+2*Math.PI)/3),void(i[4]=-h+d*Math.cos((l+4*Math.PI)/3))))},Hn=function(e,t,n,r,i,a,o,s){var l=[];jn(1*n*n-4*n*i+2*n*o+4*i*i-4*i*o+o*o+r*r-4*r*a+2*r*s+4*a*a-4*a*s+s*s,9*n*i-3*n*n-3*n*o-6*i*i+3*i*o+9*r*a-3*r*r-3*r*s-6*a*a+3*a*s,3*n*n-6*n*i+n*o-n*e+2*i*i+2*i*e-o*e+3*r*r-6*r*a+r*s-r*t+2*a*a+2*a*t-s*t,1*n*i-n*n+n*e-i*e+r*a-r*r+r*t-a*t,l);for(var u=1e-7,c=[],h=0;h<6;h+=2)Math.abs(l[h+1])<u&&l[h]>=0&&l[h]<=1&&c.push(l[h]);c.push(1),c.push(0);for(var d,p,g,f=-1,v=0;v<c.length;v++)d=Math.pow(1-c[v],2)*n+2*(1-c[v])*c[v]*i+c[v]*c[v]*o,p=Math.pow(1-c[v],2)*r+2*(1-c[v])*c[v]*a+c[v]*c[v]*s,g=Math.pow(d-e,2)+Math.pow(p-t,2),f>=0?g<f&&(f=g):f=g;return f},qn=function(e,t,n,r,i,a){var o=[e-n,t-r],s=[i-n,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],h=c*c/l;return c<0?u:h>l?(e-i)*(e-i)+(t-a)*(t-a):u-h},Wn=function(e,t,n){for(var r,i,a,o,s=0,l=0;l<n.length/2;l++)if(r=n[2*l],i=n[2*l+1],l+1<n.length/2?(a=n[2*(l+1)],o=n[2*(l+1)+1]):(a=n[2*(l+1-n.length/2)],o=n[2*(l+1-n.length/2)+1]),r==e&&a==e);else{if(!(r>=e&&e>=a||r<=e&&e<=a))continue;(e-r)/(a-r)*(o-i)+i>t&&s++}return s%2!=0},$n=function(e,t,n,r,i,a,o,s,l){var u,c=new Array(n.length);null!=s[0]?(u=Math.atan(s[1]/s[0]),s[0]<0?u+=Math.PI/2:u=-u-Math.PI/2):u=s;for(var h,d=Math.cos(-u),p=Math.sin(-u),g=0;g<c.length/2;g++)c[2*g]=a/2*(n[2*g]*d-n[2*g+1]*p),c[2*g+1]=o/2*(n[2*g+1]*d+n[2*g]*p),c[2*g]+=r,c[2*g+1]+=i;if(l>0){var f=Qn(c,-l);h=Kn(f)}else h=c;return Wn(e,t,h)},Zn=function(e,t,n,r,i,a,o){for(var s=new Array(n.length),l=a/2,u=o/2,c=hr(a,o),h=c*c,d=0;d<n.length/4;d++){var p=void 0,g=void 0;p=0===d?n.length-2:4*d-2,g=4*d+2;var f=r+l*n[4*d],v=i+u*n[4*d+1],y=-n[p]*n[g]-n[p+1]*n[g+1],m=c/Math.tan(Math.acos(y)/2),b=f-m*n[p],x=v-m*n[p+1],w=f+m*n[g],E=v+m*n[g+1];s[4*d]=b,s[4*d+1]=x,s[4*d+2]=w,s[4*d+3]=E;var T=n[p+1],_=-n[p];T*n[g]+_*n[g+1]<0&&(T*=-1,_*=-1);var D=b+T*c,C=x+_*c;if(Math.pow(D-e,2)+Math.pow(C-t,2)<=h)return!0}return Wn(e,t,s)},Kn=function(e){for(var t,n,r,i,a,o,s,l,u=new Array(e.length/2),c=0;c<e.length/4;c++){t=e[4*c],n=e[4*c+1],r=e[4*c+2],i=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 h=rr(t,n,r,i,a,o,s,l,!0);u[2*c]=h[0],u[2*c+1]=h[1]}return u},Qn=function(e,t){for(var n,r,i,a,o=new Array(2*e.length),s=0;s<e.length/2;s++){n=e[2*s],r=e[2*s+1],s<e.length/2-1?(i=e[2*(s+1)],a=e[2*(s+1)+1]):(i=e[0],a=e[1]);var l=a-r,u=-(i-n),c=Math.sqrt(l*l+u*u),h=l/c,d=u/c;o[4*s]=n+h*t,o[4*s+1]=r+d*t,o[4*s+2]=i+h*t,o[4*s+3]=a+d*t}return o},Jn=function(e,t,n,r,i,a){var o=n-e,s=r-t;o/=i,s/=a;var l=Math.sqrt(o*o+s*s),u=l-1;if(u<0)return[];var c=u/l;return[(n-e)*c+e,(r-t)*c+t]},er=function(e,t,n,r,i,a,o){return e-=i,t-=a,(e/=n/2+o)*e+(t/=r/2+o)*t<=1},tr=function(e,t,n,r,i,a,o){var s=[n-e,r-t],l=[e-i,t-a],u=s[0]*s[0]+s[1]*s[1],c=2*(l[0]*s[0]+l[1]*s[1]),h=c*c-4*u*(l[0]*l[0]+l[1]*l[1]-o*o);if(h<0)return[];var d=(-c+Math.sqrt(h))/(2*u),p=(-c-Math.sqrt(h))/(2*u),g=Math.min(d,p),f=Math.max(d,p),v=[];if(g>=0&&g<=1&&v.push(g),f>=0&&f<=1&&v.push(f),0===v.length)return[];var y=v[0]*s[0]+e,m=v[0]*s[1]+t;return v.length>1?v[0]==v[1]?[y,m]:[y,m,v[1]*s[0]+e,v[1]*s[1]+t]:[y,m]},nr=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},rr=function(e,t,n,r,i,a,o,s,l){var u=e-i,c=n-e,h=o-i,d=t-a,p=r-t,g=s-a,f=h*d-g*u,v=c*d-p*u,y=g*c-h*p;if(0!==y){var m=f/y,b=v/y,x=.001,w=0-x,E=1+x;return w<=m&&m<=E&&w<=b&&b<=E||l?[e+m*c,t+m*p]:[]}return 0===f||0===v?nr(e,n,o)===o?[o,s]:nr(e,n,i)===i?[i,a]:nr(i,o,n)===n?[n,r]:[]:[]},ir=function(e,t,n,r,i,a,o,s){var l,u,c,h,d,p,g=[],f=new Array(n.length),v=!0;if(null==a&&(v=!1),v){for(var y=0;y<f.length/2;y++)f[2*y]=n[2*y]*a+r,f[2*y+1]=n[2*y+1]*o+i;if(s>0){var m=Qn(f,-s);u=Kn(m)}else u=f}else u=n;for(var b=0;b<u.length/2;b++)c=u[2*b],h=u[2*b+1],b<u.length/2-1?(d=u[2*(b+1)],p=u[2*(b+1)+1]):(d=u[0],p=u[1]),0!==(l=rr(e,t,r,i,c,h,d,p)).length&&g.push(l[0],l[1]);return g},ar=function(e,t,n,r,i,a,o,s){for(var l,u=[],c=new Array(n.length),h=a/2,d=o/2,p=hr(a,o),g=0;g<n.length/4;g++){var f=void 0,v=void 0;f=0===g?n.length-2:4*g-2,v=4*g+2;var y=r+h*n[4*g],m=i+d*n[4*g+1],b=-n[f]*n[v]-n[f+1]*n[v+1],x=p/Math.tan(Math.acos(b)/2),w=y-x*n[f],E=m-x*n[f+1],T=y+x*n[v],_=m+x*n[v+1];0===g?(c[n.length-2]=w,c[n.length-1]=E):(c[4*g-2]=w,c[4*g-1]=E),c[4*g]=T,c[4*g+1]=_;var D=n[f+1],C=-n[f];D*n[v]+C*n[v+1]<0&&(D*=-1,C*=-1),0!==(l=tr(e,t,r,i,w+D*p,E+C*p,p)).length&&u.push(l[0],l[1])}for(var N=0;N<c.length/4;N++)0!==(l=rr(e,t,r,i,c[4*N],c[4*N+1],c[4*N+2],c[4*N+3],!1)).length&&u.push(l[0],l[1]);if(u.length>2){for(var A=[u[0],u[1]],L=Math.pow(A[0]-e,2)+Math.pow(A[1]-t,2),S=1;S<u.length/2;S++){var O=Math.pow(u[2*S]-e,2)+Math.pow(u[2*S+1]-t,2);O<=L&&(A[0]=u[2*S],A[1]=u[2*S+1],L=O)}return A}return u},or=function(e,t,n){var r=[e[0]-t[0],e[1]-t[1]],i=Math.sqrt(r[0]*r[0]+r[1]*r[1]),a=(i-n)/i;return a<0&&(a=1e-5),[t[0]+a*r[0],t[1]+a*r[1]]},sr=function(e,t){var n=ur(e,t);return n=lr(n)},lr=function(e){for(var t,n,r=e.length/2,i=1/0,a=1/0,o=-1/0,s=-1/0,l=0;l<r;l++)t=e[2*l],n=e[2*l+1],i=Math.min(i,t),o=Math.max(o,t),a=Math.min(a,n),s=Math.max(s,n);for(var u=2/(o-i),c=2/(s-a),h=0;h<r;h++)t=e[2*h]=e[2*h]*u,n=e[2*h+1]=e[2*h+1]*c,i=Math.min(i,t),o=Math.max(o,t),a=Math.min(a,n),s=Math.max(s,n);if(a<-1)for(var d=0;d<r;d++)n=e[2*d+1]=e[2*d+1]+(-1-a);return e},ur=function(e,t){var n=1/e*2*Math.PI,r=e%2==0?Math.PI/2+n/2:Math.PI/2;r+=t;for(var i,a=new Array(2*e),o=0;o<e;o++)i=o*n+r,a[2*o]=Math.cos(i),a[2*o+1]=Math.sin(-i);return a},cr=function(e,t){return Math.min(e/4,t/4,8)},hr=function(e,t){return Math.min(e/10,t/10,8)},dr=function(){return 8},pr=function(e,t,n){return[e-2*t+n,2*(t-e),e]},gr=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},fr=Mt({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),vr={pageRank:function(e){for(var t=fr(e),n=t.dampingFactor,r=t.precision,i=t.iterations,a=t.weight,o=this._private.cy,s=this.byGroup(),l=s.nodes,u=s.edges,c=l.length,h=c*c,d=u.length,p=new Array(h),g=new Array(c),f=(1-n)/c,v=0;v<c;v++){for(var y=0;y<c;y++)p[v*c+y]=0;g[v]=0}for(var m=0;m<d;m++){var b=u[m],x=b.data("source"),w=b.data("target");if(x!==w){var E=l.indexOfId(x),T=l.indexOfId(w),_=a(b);p[T*c+E]+=_,g[E]+=_}}for(var D=1/c+f,C=0;C<c;C++)if(0===g[C])for(var N=0;N<c;N++)p[N*c+C]=D;else for(var A=0;A<c;A++){var L=A*c+C;p[L]=p[L]/g[C]+f}for(var S,O=new Array(c),I=new Array(c),k=0;k<c;k++)O[k]=1;for(var M=0;M<i;M++){for(var P=0;P<c;P++)I[P]=0;for(var R=0;R<c;R++)for(var B=0;B<c;B++){var F=R*c+B;I[R]+=p[F]*O[B]}_n(I),S=O,O=I,I=S;for(var z=0,G=0;G<c;G++){var Y=S[G]-O[G];z+=Y*Y}if(z<r)break}return{rank:function(e){return e=o.collection(e)[0],O[l.indexOf(e)]}}}},yr=Mt({root:null,weight:function(e){return 1},directed:!1,alpha:0}),mr={degreeCentralityNormalized:function(e){e=yr(e);var t=this.cy(),n=this.nodes(),r=n.length;if(e.directed){for(var i={},a={},o=0,s=0,l=0;l<r;l++){var u=n[l],c=u.id();e.root=u;var h=this.degreeCentrality(e);o<h.indegree&&(o=h.indegree),s<h.outdegree&&(s=h.outdegree),i[c]=h.indegree,a[c]=h.outdegree}return{indegree:function(e){return 0==o?0:(b(e)&&(e=t.filter(e)),i[e.id()]/o)},outdegree:function(e){return 0===s?0:(b(e)&&(e=t.filter(e)),a[e.id()]/s)}}}for(var d={},p=0,g=0;g<r;g++){var f=n[g];e.root=f;var v=this.degreeCentrality(e);p<v.degree&&(p=v.degree),d[f.id()]=v.degree}return{degree:function(e){return 0===p?0:(b(e)&&(e=t.filter(e)),d[e.id()]/p)}}},degreeCentrality:function(e){e=yr(e);var t=this.cy(),n=this,r=e,i=r.root,a=r.weight,o=r.directed,s=r.alpha;if(i=t.collection(i)[0],o){for(var l=i.connectedEdges(),u=l.filter((function(e){return e.target().same(i)&&n.has(e)})),c=l.filter((function(e){return e.source().same(i)&&n.has(e)})),h=u.length,d=c.length,p=0,g=0,f=0;f<u.length;f++)p+=a(u[f]);for(var v=0;v<c.length;v++)g+=a(c[v]);return{indegree:Math.pow(h,1-s)*Math.pow(p,s),outdegree:Math.pow(d,1-s)*Math.pow(g,s)}}for(var y=i.connectedEdges().intersection(n),m=y.length,b=0,x=0;x<y.length;x++)b+=a(y[x]);return{degree:Math.pow(m,1-s)*Math.pow(b,s)}}};mr.dc=mr.degreeCentrality,mr.dcn=mr.degreeCentralityNormalised=mr.degreeCentralityNormalized;var br=Mt({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),xr={closenessCentralityNormalized:function(e){for(var t=br(e),n=t.harmonic,r=t.weight,i=t.directed,a=this.cy(),o={},s=0,l=this.nodes(),u=this.floydWarshall({weight:r,directed:i}),c=0;c<l.length;c++){for(var h=0,d=l[c],p=0;p<l.length;p++)if(c!==p){var g=u.distance(d,l[p]);h+=n?1/g:g}n||(h=1/h),s<h&&(s=h),o[d.id()]=h}return{closeness:function(e){return 0==s?0:(e=b(e)?a.filter(e)[0].id():e.id(),o[e]/s)}}},closenessCentrality:function(e){var t=br(e),n=t.root,r=t.weight,i=t.directed,a=t.harmonic;n=this.filter(n)[0];for(var o=this.dijkstra({root:n,weight:r,directed:i}),s=0,l=this.nodes(),u=0;u<l.length;u++){var c=l[u];if(!c.same(n)){var h=o.distanceTo(c);s+=a?1/h:h}}return a?s:1/s}};xr.cc=xr.closenessCentrality,xr.ccn=xr.closenessCentralityNormalised=xr.closenessCentralityNormalized;var wr=Mt({weight:null,directed:!1}),Er={betweennessCentrality:function(e){for(var t=wr(e),n=t.directed,r=t.weight,i=null!=r,a=this.cy(),o=this.nodes(),s={},l={},u=0,c={set:function(e,t){l[e]=t,t>u&&(u=t)},get:function(e){return l[e]}},h=0;h<o.length;h++){var d=o[h],p=d.id();s[p]=n?d.outgoers().nodes():d.openNeighborhood().nodes(),c.set(p,0)}for(var g=function(e){for(var t=o[e].id(),n=[],l={},u={},h={},d=new $t((function(e,t){return h[e]-h[t]})),p=0;p<o.length;p++){var g=o[p].id();l[g]=[],u[g]=0,h[g]=1/0}for(u[t]=1,h[t]=0,d.push(t);!d.empty();){var f=d.pop();if(n.push(f),i)for(var v=0;v<s[f].length;v++){var y=s[f][v],m=a.getElementById(f),b=void 0;b=m.edgesTo(y).length>0?m.edgesTo(y)[0]:y.edgesTo(m)[0];var x=r(b);y=y.id(),h[y]>h[f]+x&&(h[y]=h[f]+x,d.nodes.indexOf(y)<0?d.push(y):d.updateItem(y),u[y]=0,l[y]=[]),h[y]==h[f]+x&&(u[y]=u[y]+u[f],l[y].push(f))}else for(var w=0;w<s[f].length;w++){var E=s[f][w].id();h[E]==1/0&&(d.push(E),h[E]=h[f]+1),h[E]==h[f]+1&&(u[E]=u[E]+u[f],l[E].push(f))}}for(var T={},_=0;_<o.length;_++)T[o[_].id()]=0;for(;n.length>0;){for(var D=n.pop(),C=0;C<l[D].length;C++){var N=l[D][C];T[N]=T[N]+u[N]/u[D]*(1+T[D])}D!=o[e].id()&&c.set(D,c.get(D)+T[D])}},f=0;f<o.length;f++)g(f);var v={betweenness:function(e){var t=a.collection(e).id();return c.get(t)},betweennessNormalized:function(e){if(0==u)return 0;var t=a.collection(e).id();return c.get(t)/u}};return v.betweennessNormalised=v.betweennessNormalized,v}};Er.bc=Er.betweennessCentrality;var Tr=Mt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(e){return 1}]}),_r=function(e){return Tr(e)},Dr=function(e,t){for(var n=0,r=0;r<t.length;r++)n+=t[r](e);return n},Cr=function(e,t,n){for(var r=0;r<t;r++)e[r*t+r]=n},Nr=function(e,t){for(var n,r=0;r<t;r++){n=0;for(var i=0;i<t;i++)n+=e[i*t+r];for(var a=0;a<t;a++)e[a*t+r]=e[a*t+r]/n}},Ar=function(e,t,n){for(var r=new Array(n*n),i=0;i<n;i++){for(var a=0;a<n;a++)r[i*n+a]=0;for(var o=0;o<n;o++)for(var s=0;s<n;s++)r[i*n+s]+=e[i*n+o]*t[o*n+s]}return r},Lr=function(e,t,n){for(var r=e.slice(0),i=1;i<n;i++)e=Ar(e,r,t);return e},Sr=function(e,t,n){for(var r=new Array(t*t),i=0;i<t*t;i++)r[i]=Math.pow(e[i],n);return Nr(r,t),r},Or=function(e,t,n,r){for(var i=0;i<n;i++)if(Math.round(e[i]*Math.pow(10,r))/Math.pow(10,r)!=Math.round(t[i]*Math.pow(10,r))/Math.pow(10,r))return!1;return!0},Ir=function(e,t,n,r){for(var i=[],a=0;a<t;a++){for(var o=[],s=0;s<t;s++)Math.round(1e3*e[a*t+s])/1e3>0&&o.push(n[s]);0!==o.length&&i.push(r.collection(o))}return i},kr=function(e,t){for(var n=0;n<e.length;n++)if(!t[n]||e[n].id()!==t[n].id())return!1;return!0},Mr=function(e){for(var t=0;t<e.length;t++)for(var n=0;n<e.length;n++)t!=n&&kr(e[t],e[n])&&e.splice(n,1);return e},Pr=function(e){for(var t=this.nodes(),n=this.edges(),r=this.cy(),i=_r(e),a={},o=0;o<t.length;o++)a[t[o].id()]=o;for(var s,l=t.length,u=l*l,c=new Array(u),h=0;h<u;h++)c[h]=0;for(var d=0;d<n.length;d++){var p=n[d],g=a[p.source().id()],f=a[p.target().id()],v=Dr(p,i.attributes);c[g*l+f]+=v,c[f*l+g]+=v}Cr(c,l,i.multFactor),Nr(c,l);for(var y=!0,m=0;y&&m<i.maxIterations;)y=!1,s=Lr(c,l,i.expandFactor),c=Sr(s,l,i.inflateFactor),Or(c,s,u,4)||(y=!0),m++;var b=Ir(c,l,t,r);return b=Mr(b)},Rr={markovClustering:Pr,mcl:Pr},Br=function(e){return e},Fr=function(e,t){return Math.abs(t-e)},zr=function(e,t,n){return e+Fr(t,n)},Gr=function(e,t,n){return e+Math.pow(n-t,2)},Yr=function(e){return Math.sqrt(e)},Xr=function(e,t,n){return Math.max(e,Fr(t,n))},Vr=function(e,t,n,r,i){for(var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Br,o=r,s=0;s<e;s++)o=i(o,t(s),n(s));return a(o)},Ur={euclidean:function(e,t,n){return e>=2?Vr(e,t,n,0,Gr,Yr):Vr(e,t,n,0,zr)},squaredEuclidean:function(e,t,n){return Vr(e,t,n,0,Gr)},manhattan:function(e,t,n){return Vr(e,t,n,0,zr)},max:function(e,t,n){return Vr(e,t,n,-1/0,Xr)}};function jr(e,t,n,r,i,a){var o;return o=x(e)?e:Ur[e]||Ur.euclidean,0===t&&x(e)?o(i,a):o(t,n,r,i,a)}Ur["squared-euclidean"]=Ur.squaredEuclidean,Ur.squaredeuclidean=Ur.squaredEuclidean;var Hr=Mt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),qr=function(e){return Hr(e)},Wr=function(e,t,n,r,i){var a="kMedoids"!==i?function(e){return n[e]}:function(e){return r[e](n)},o=function(e){return r[e](t)},s=n,l=t;return jr(e,r.length,a,o,s,l)},$r=function(e,t,n){for(var r=n.length,i=new Array(r),a=new Array(r),o=new Array(t),s=null,l=0;l<r;l++)i[l]=e.min(n[l]).value,a[l]=e.max(n[l]).value;for(var u=0;u<t;u++){s=[];for(var c=0;c<r;c++)s[c]=Math.random()*(a[c]-i[c])+i[c];o[u]=s}return o},Zr=function(e,t,n,r,i){for(var a=1/0,o=0,s=0;s<t.length;s++){var l=Wr(n,e,t[s],r,i);l<a&&(a=l,o=s)}return o},Kr=function(e,t,n){for(var r=[],i=null,a=0;a<t.length;a++)n[(i=t[a]).id()]===e&&r.push(i);return r},Qr=function(e,t,n){return Math.abs(t-e)<=n},Jr=function(e,t,n){for(var r=0;r<e.length;r++)for(var i=0;i<e[r].length;i++)if(Math.abs(e[r][i]-t[r][i])>n)return!1;return!0},ei=function(e,t,n){for(var r=0;r<n;r++)if(e===t[r])return!0;return!1},ti=function(e,t){var n=new Array(t);if(e.length<50)for(var r=0;r<t;r++){for(var i=e[Math.floor(Math.random()*e.length)];ei(i,n,r);)i=e[Math.floor(Math.random()*e.length)];n[r]=i}else for(var a=0;a<t;a++)n[a]=e[Math.floor(Math.random()*e.length)];return n},ni=function(e,t,n){for(var r=0,i=0;i<t.length;i++)r+=Wr("manhattan",t[i],e,n,"kMedoids");return r},ri=function(e,t,n,r,i){for(var a,o,s=0;s<t.length;s++)for(var l=0;l<e.length;l++)r[s][l]=Math.pow(n[s][l],i.m);for(var u=0;u<e.length;u++)for(var c=0;c<i.attributes.length;c++){a=0,o=0;for(var h=0;h<t.length;h++)a+=r[h][u]*i.attributes[c](t[h]),o+=r[h][u];e[u][c]=a/o}},ii=function(e,t,n,r,i){for(var a=0;a<e.length;a++)t[a]=e[a].slice();for(var o,s,l,u=2/(i.m-1),c=0;c<n.length;c++)for(var h=0;h<r.length;h++){o=0;for(var d=0;d<n.length;d++)s=Wr(i.distance,r[h],n[c],i.attributes,"cmeans"),l=Wr(i.distance,r[h],n[d],i.attributes,"cmeans"),o+=Math.pow(s/l,u);e[h][c]=1/o}},ai=function(e,t,n,r){for(var i,a,o=new Array(n.k),s=0;s<o.length;s++)o[s]=[];for(var l=0;l<t.length;l++){i=-1/0,a=-1;for(var u=0;u<t[0].length;u++)t[l][u]>i&&(i=t[l][u],a=u);o[a].push(e[l])}for(var c=0;c<o.length;c++)o[c]=r.collection(o[c]);return o},oi=function(e){var t,n,r,i,a=this.cy(),o=this.nodes(),s=qr(e);r=new Array(o.length);for(var l=0;l<o.length;l++)r[l]=new Array(s.k);n=new Array(o.length);for(var u=0;u<o.length;u++)n[u]=new Array(s.k);for(var c=0;c<o.length;c++){for(var h=0,d=0;d<s.k;d++)n[c][d]=Math.random(),h+=n[c][d];for(var p=0;p<s.k;p++)n[c][p]=n[c][p]/h}t=new Array(s.k);for(var g=0;g<s.k;g++)t[g]=new Array(s.attributes.length);i=new Array(o.length);for(var f=0;f<o.length;f++)i[f]=new Array(s.k);for(var v=!0,y=0;v&&y<s.maxIterations;)v=!1,ri(t,o,n,i,s),ii(n,r,t,o,s),Jr(n,r,s.sensitivityThreshold)||(v=!0),y++;return{clusters:ai(o,n,s,a),degreeOfMembership:n}},si={kMeans:function(t){var n,r=this.cy(),i=this.nodes(),a=null,o=qr(t),s=new Array(o.k),l={};o.testMode?"number"==typeof o.testCentroids?(o.testCentroids,n=$r(i,o.k,o.attributes)):n="object"===e(o.testCentroids)?o.testCentroids:$r(i,o.k,o.attributes):n=$r(i,o.k,o.attributes);for(var u=!0,c=0;u&&c<o.maxIterations;){for(var h=0;h<i.length;h++)l[(a=i[h]).id()]=Zr(a,n,o.distance,o.attributes,"kMeans");u=!1;for(var d=0;d<o.k;d++){var p=Kr(d,i,l);if(0!==p.length){for(var g=o.attributes.length,f=n[d],v=new Array(g),y=new Array(g),m=0;m<g;m++){y[m]=0;for(var b=0;b<p.length;b++)a=p[b],y[m]+=o.attributes[m](a);v[m]=y[m]/p.length,Qr(v[m],f[m],o.sensitivityThreshold)||(u=!0)}n[d]=v,s[d]=r.collection(p)}}c++}return s},kMedoids:function(t){var n,r,i=this.cy(),a=this.nodes(),o=null,s=qr(t),l=new Array(s.k),u={},c=new Array(s.k);s.testMode?"number"==typeof s.testCentroids||(n="object"===e(s.testCentroids)?s.testCentroids:ti(a,s.k)):n=ti(a,s.k);for(var h=!0,d=0;h&&d<s.maxIterations;){for(var p=0;p<a.length;p++)u[(o=a[p]).id()]=Zr(o,n,s.distance,s.attributes,"kMedoids");h=!1;for(var g=0;g<n.length;g++){var f=Kr(g,a,u);if(0!==f.length){c[g]=ni(n[g],f,s.attributes);for(var v=0;v<f.length;v++)(r=ni(f[v],f,s.attributes))<c[g]&&(c[g]=r,n[g]=f[v],h=!0);l[g]=i.collection(f)}}d++}return l},fuzzyCMeans:oi,fcm:oi},li=Mt({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),ui={single:"min",complete:"max"},ci=function(e){var t=li(e),n=ui[t.linkage];return null!=n&&(t.linkage=n),t},hi=function(e,t,n,r,i){for(var a,o=0,s=1/0,l=i.attributes,u=function(e,t){return jr(i.distance,l.length,(function(t){return l[t](e)}),(function(e){return l[e](t)}),e,t)},c=0;c<e.length;c++){var h=e[c].key,d=n[h][r[h]];d<s&&(o=h,s=d)}if("threshold"===i.mode&&s>=i.threshold||"dendrogram"===i.mode&&1===e.length)return!1;var p,g=t[o],f=t[r[o]];p="dendrogram"===i.mode?{left:g,right:f,key:g.key}:{value:g.value.concat(f.value),key:g.key},e[g.index]=p,e.splice(f.index,1),t[g.key]=p;for(var v=0;v<e.length;v++){var y=e[v];g.key===y.key?a=1/0:"min"===i.linkage?(a=n[g.key][y.key],n[g.key][y.key]>n[f.key][y.key]&&(a=n[f.key][y.key])):"max"===i.linkage?(a=n[g.key][y.key],n[g.key][y.key]<n[f.key][y.key]&&(a=n[f.key][y.key])):a="mean"===i.linkage?(n[g.key][y.key]*g.size+n[f.key][y.key]*f.size)/(g.size+f.size):"dendrogram"===i.mode?u(y.value,g.value):u(y.value[0],g.value[0]),n[g.key][y.key]=n[y.key][g.key]=a}for(var m=0;m<e.length;m++){var b=e[m].key;if(r[b]===g.key||r[b]===f.key){for(var x=b,w=0;w<e.length;w++){var E=e[w].key;n[b][E]<n[b][x]&&(x=E)}r[b]=x}e[m].index=m}return g.key=f.key=g.index=f.index=null,!0},di=function e(t,n,r){t&&(t.value?n.push(t.value):(t.left&&e(t.left,n),t.right&&e(t.right,n)))},pi=function e(t,n){if(!t)return"";if(t.left&&t.right){var r=e(t.left,n),i=e(t.right,n),a=n.add({group:"nodes",data:{id:r+","+i}});return n.add({group:"edges",data:{source:r,target:a.id()}}),n.add({group:"edges",data:{source:i,target:a.id()}}),a.id()}return t.value?t.value.id():void 0},gi=function e(t,n,r){if(!t)return[];var i=[],a=[],o=[];return 0===n?(t.left&&di(t.left,i),t.right&&di(t.right,a),o=i.concat(a),[r.collection(o)]):1===n?t.value?[r.collection(t.value)]:(t.left&&di(t.left,i),t.right&&di(t.right,a),[r.collection(i),r.collection(a)]):t.value?[r.collection(t.value)]:(t.left&&(i=e(t.left,n-1,r)),t.right&&(a=e(t.right,n-1,r)),i.concat(a))},fi=function(e){for(var t=this.cy(),n=this.nodes(),r=ci(e),i=r.attributes,a=function(e,t){return jr(r.distance,i.length,(function(t){return i[t](e)}),(function(e){return i[e](t)}),e,t)},o=[],s=[],l=[],u=[],c=0;c<n.length;c++){var h={value:"dendrogram"===r.mode?n[c]:[n[c]],key:c,index:c};o[c]=h,u[c]=h,s[c]=[],l[c]=0}for(var d=0;d<o.length;d++)for(var p=0;p<=d;p++){var g=void 0;g="dendrogram"===r.mode?d===p?1/0:a(o[d].value,o[p].value):d===p?1/0:a(o[d].value[0],o[p].value[0]),s[d][p]=g,s[p][d]=g,g<s[d][l[d]]&&(l[d]=p)}for(var f,v=hi(o,u,s,l,r);v;)v=hi(o,u,s,l,r);return"dendrogram"===r.mode?(f=gi(o[0],r.dendrogramDepth,t),r.addDendrogram&&pi(o[0],t)):(f=new Array(o.length),o.forEach((function(e,n){e.key=e.index=null,f[n]=t.collection(e.value)}))),f},vi={hierarchicalClustering:fi,hca:fi},yi=Mt({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),mi=function(e){var t=e.damping,n=e.preference;.5<=t&&t<1||Dt("Damping must range on [0.5, 1). Got: ".concat(t));var r=["median","mean","min","max"];return r.some((function(e){return e===n}))||_(n)||Dt("Preference must be one of [".concat(r.map((function(e){return"'".concat(e,"'")})).join(", "),"] or a number. Got: ").concat(n)),yi(e)},bi=function(e,t,n,r){var i=function(e,t){return r[t](e)};return-jr(e,r.length,(function(e){return i(t,e)}),(function(e){return i(n,e)}),t,n)},xi=function(e,t){return"median"===t?yn(e):"mean"===t?vn(e):"min"===t?gn(e):"max"===t?fn(e):t},wi=function(e,t,n){for(var r=[],i=0;i<e;i++)t[i*e+i]+n[i*e+i]>0&&r.push(i);return r},Ei=function(e,t,n){for(var r=[],i=0;i<e;i++){for(var a=-1,o=-1/0,s=0;s<n.length;s++){var l=n[s];t[i*e+l]>o&&(a=l,o=t[i*e+l])}a>0&&r.push(a)}for(var u=0;u<n.length;u++)r[n[u]]=n[u];return r},Ti=function(e,t,n){for(var r=Ei(e,t,n),i=0;i<n.length;i++){for(var a=[],o=0;o<r.length;o++)r[o]===n[i]&&a.push(o);for(var s=-1,l=-1/0,u=0;u<a.length;u++){for(var c=0,h=0;h<a.length;h++)c+=t[a[h]*e+a[u]];c>l&&(s=u,l=c)}n[i]=a[s]}return r=Ei(e,t,n)},_i=function(e){for(var t,n,r,i,a,o,s=this.cy(),l=this.nodes(),u=mi(e),c={},h=0;h<l.length;h++)c[l[h].id()]=h;n=(t=l.length)*t,r=new Array(n);for(var d=0;d<n;d++)r[d]=-1/0;for(var p=0;p<t;p++)for(var g=0;g<t;g++)p!==g&&(r[p*t+g]=bi(u.distance,l[p],l[g],u.attributes));i=xi(r,u.preference);for(var f=0;f<t;f++)r[f*t+f]=i;a=new Array(n);for(var v=0;v<n;v++)a[v]=0;o=new Array(n);for(var y=0;y<n;y++)o[y]=0;for(var m=new Array(t),b=new Array(t),x=new Array(t),w=0;w<t;w++)m[w]=0,b[w]=0,x[w]=0;for(var E,T=new Array(t*u.minIterations),_=0;_<T.length;_++)T[_]=0;for(E=0;E<u.maxIterations;E++){for(var D=0;D<t;D++){for(var C=-1/0,N=-1/0,A=-1,L=0,S=0;S<t;S++)m[S]=a[D*t+S],(L=o[D*t+S]+r[D*t+S])>=C?(N=C,C=L,A=S):L>N&&(N=L);for(var O=0;O<t;O++)a[D*t+O]=(1-u.damping)*(r[D*t+O]-C)+u.damping*m[O];a[D*t+A]=(1-u.damping)*(r[D*t+A]-N)+u.damping*m[A]}for(var I=0;I<t;I++){for(var k=0,M=0;M<t;M++)m[M]=o[M*t+I],b[M]=Math.max(0,a[M*t+I]),k+=b[M];k-=b[I],b[I]=a[I*t+I],k+=b[I];for(var P=0;P<t;P++)o[P*t+I]=(1-u.damping)*Math.min(0,k-b[P])+u.damping*m[P];o[I*t+I]=(1-u.damping)*(k-b[I])+u.damping*m[I]}for(var R=0,B=0;B<t;B++){var F=o[B*t+B]+a[B*t+B]>0?1:0;T[E%u.minIterations*t+B]=F,R+=F}if(R>0&&(E>=u.minIterations-1||E==u.maxIterations-1)){for(var z=0,G=0;G<t;G++){x[G]=0;for(var Y=0;Y<u.minIterations;Y++)x[G]+=T[Y*t+G];0!==x[G]&&x[G]!==u.minIterations||z++}if(z===t)break}}for(var X=wi(t,a,o),V=Ti(t,r,X),U={},j=0;j<X.length;j++)U[X[j]]=[];for(var H=0;H<l.length;H++){var q=V[c[l[H].id()]];null!=q&&U[q].push(l[H])}for(var W=new Array(X.length),$=0;$<X.length;$++)W[$]=s.collection(U[X[$]]);return W},Di={affinityPropagation:_i,ap:_i},Ci=Mt({root:void 0,directed:!1}),Ni={hierholzer:function(e){if(!E(e)){var t=arguments;e={root:t[0],directed:t[1]}}var n,r,i,a=Ci(e),o=a.root,s=a.directed,l=this,u=!1;o&&(i=b(o)?this.filter(o)[0].id():o[0].id());var c={},h={};s?l.forEach((function(e){var t=e.id();if(e.isNode()){var i=e.indegree(!0),a=e.outdegree(!0),o=i-a,s=a-i;1==o?n?u=!0:n=t:1==s?r?u=!0:r=t:(s>1||o>1)&&(u=!0),c[t]=[],e.outgoers().forEach((function(e){e.isEdge()&&c[t].push(e.id())}))}else h[t]=[void 0,e.target().id()]})):l.forEach((function(e){var t=e.id();e.isNode()?(e.degree(!0)%2&&(n?r?u=!0:r=t:n=t),c[t]=[],e.connectedEdges().forEach((function(e){return c[t].push(e.id())}))):h[t]=[e.source().id(),e.target().id()]}));var d={found:!1,trail:void 0};if(u)return d;if(r&&n)if(s){if(i&&r!=i)return d;i=r}else{if(i&&r!=i&&n!=i)return d;i||(i=r)}else i||(i=l[0].id());var p=function(e){for(var t,n,r,i=e,a=[e];c[i].length;)t=c[i].shift(),n=h[t][0],i!=(r=h[t][1])?(c[r]=c[r].filter((function(e){return e!=t})),i=r):s||i==n||(c[n]=c[n].filter((function(e){return e!=t})),i=n),a.unshift(t),a.unshift(i);return a},g=[],f=[];for(f=p(i);1!=f.length;)0==c[f[0]].length?(g.unshift(l.getElementById(f.shift())),g.unshift(l.getElementById(f.shift()))):f=p(f.shift()).concat(f);for(var v in g.unshift(l.getElementById(f.shift())),c)if(c[v].length)return d;return d.found=!0,d.trail=this.spawn(g,!0),d}},Ai=function(){var e=this,t={},n=0,r=0,i=[],a=[],o={},s=function(n,r){for(var o=a.length-1,s=[],l=e.spawn();a[o].x!=n||a[o].y!=r;)s.push(a.pop().edge),o--;s.push(a.pop().edge),s.forEach((function(n){var r=n.connectedNodes().intersection(e);l.merge(n),r.forEach((function(n){var r=n.id(),i=n.connectedEdges().intersection(e);l.merge(n),t[r].cutVertex?l.merge(i.filter((function(e){return e.isLoop()}))):l.merge(i)}))})),i.push(l)},l=function l(u,c,h){u===h&&(r+=1),t[c]={id:n,low:n++,cutVertex:!1};var d,p,g,f,v=e.getElementById(c).connectedEdges().intersection(e);0===v.size()?i.push(e.spawn(e.getElementById(c))):v.forEach((function(e){d=e.source().id(),p=e.target().id(),(g=d===c?p:d)!==h&&(f=e.id(),o[f]||(o[f]=!0,a.push({x:c,y:g,edge:e})),g in t?t[c].low=Math.min(t[c].low,t[g].id):(l(u,g,c),t[c].low=Math.min(t[c].low,t[g].low),t[c].id<=t[g].low&&(t[c].cutVertex=!0,s(c,g))))}))};e.forEach((function(e){if(e.isNode()){var n=e.id();n in t||(r=0,l(n,n),t[n].cutVertex=r>1)}}));var u=Object.keys(t).filter((function(e){return t[e].cutVertex})).map((function(t){return e.getElementById(t)}));return{cut:e.spawn(u),components:i}},Li=function(){var e=this,t={},n=0,r=[],i=[],a=e.spawn(e),o=function o(s){if(i.push(s),t[s]={index:n,low:n++,explored:!1},e.getElementById(s).connectedEdges().intersection(e).forEach((function(e){var n=e.target().id();n!==s&&(n in t||o(n),t[n].explored||(t[s].low=Math.min(t[s].low,t[n].low)))})),t[s].index===t[s].low){for(var l=e.spawn();;){var u=i.pop();if(l.merge(e.getElementById(u)),t[u].low=t[s].index,t[u].explored=!0,u===s)break}var c=l.edgesWith(l),h=l.merge(c);r.push(h),a=a.difference(h)}};return e.forEach((function(e){if(e.isNode()){var n=e.id();n in t||o(n)}})),{cut:a,components:r}},Si={};[qt,Kt,Qt,en,nn,an,un,vr,mr,xr,Er,Rr,si,vi,Di,Ni,{hopcroftTarjanBiconnected:Ai,htbc:Ai,htb:Ai,hopcroftTarjanBiconnectedComponents:Ai},{tarjanStronglyConnected:Li,tsc:Li,tscc:Li,tarjanStronglyConnectedComponents:Li}].forEach((function(e){Q(Si,e)}));var Oi=0,Ii=1,ki=2,Mi=function e(t){if(!(this instanceof e))return new e(t);this.id="Thenable/1.0.7",this.state=Oi,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},"function"==typeof t&&t.call(this,this.fulfill.bind(this),this.reject.bind(this))};Mi.prototype={fulfill:function(e){return Pi(this,Ii,"fulfillValue",e)},reject:function(e){return Pi(this,ki,"rejectReason",e)},then:function(e,t){var n=this,r=new Mi;return n.onFulfilled.push(Fi(e,r,"fulfill")),n.onRejected.push(Fi(t,r,"reject")),Ri(n),r.proxy}};var Pi=function(e,t,n,r){return e.state===Oi&&(e.state=t,e[n]=r,Ri(e)),e},Ri=function(e){e.state===Ii?Bi(e,"onFulfilled",e.fulfillValue):e.state===ki&&Bi(e,"onRejected",e.rejectReason)},Bi=function(e,t,n){if(0!==e[t].length){var r=e[t];e[t]=[];var i=function(){for(var e=0;e<r.length;e++)r[e](n)};"function"==typeof setImmediate?setImmediate(i):setTimeout(i,0)}},Fi=function(e,t,n){return function(r){if("function"!=typeof e)t[n].call(t,r);else{var i;try{i=e(r)}catch(a){return void t.reject(a)}zi(t,i)}}},zi=function t(n,r){if(n!==r&&n.proxy!==r){var i;if("object"===e(r)&&null!==r||"function"==typeof r)try{i=r.then}catch(o){return void n.reject(o)}if("function"!=typeof i)n.fulfill(r);else{var a=!1;try{i.call(r,(function(e){a||(a=!0,e===r?n.reject(new TypeError("circular thenable chain")):t(n,e))}),(function(e){a||(a=!0,n.reject(e))}))}catch(o){a||n.reject(o)}}}else n.reject(new TypeError("cannot resolve promise with itself"))};Mi.all=function(e){return new Mi((function(t,n){for(var r=new Array(e.length),i=0,a=function(n,a){r[n]=a,++i===e.length&&t(r)},o=0;o<e.length;o++)!function(t){var r=e[t];null!=r&&null!=r.then?r.then((function(e){a(t,e)}),(function(e){n(e)})):a(t,r)}(o)}))},Mi.resolve=function(e){return new Mi((function(t,n){t(e)}))},Mi.reject=function(e){return new Mi((function(t,n){n(e)}))};var Gi="undefined"!=typeof Promise?Promise:Mi,Yi=function(e,t,n){var r=S(e),i=!r,a=this._private=Q({duration:1e3},t,n);if(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&&x(a.complete)&&a.completes.push(a.complete),i){var o=e.position();a.startPosition=a.startPosition||{x:o.x,y:o.y},a.startStyle=a.startStyle||e.cy().style().getAnimationStartStyle(e,a.style)}if(r){var s=e.pan();a.startPan={x:s.x,y:s.y},a.startZoom=e.zoom()}this.length=1,this[0]=this},Xi=Yi.prototype;Q(Xi,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var t=e.target._private.animation;(e.queue?t.queue:t.current).push(this),N(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,n=t.playing;return void 0===e?t.progress:(n&&this.pause(),t.progress=e,t.started=!1,n&&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 n=function(t,n){var r=e[t];null!=r&&(e[t]=e[n],e[n]=r)};if(n("zoom","startZoom"),n("pan","startPan"),n("position","startPosition"),e.style)for(var r=0;r<e.style.length;r++){var i=e.style[r],a=i.name,o=e.startStyle[a];e.startStyle[a]=i,e.style[r]=o}return t&&this.play(),this},promise:function(e){var t,n=this._private;return t="frame"===e?n.frames:n.completes,new Gi((function(e,n){t.push((function(){e()}))}))}}),Xi.complete=Xi.completed,Xi.run=Xi.play,Xi.running=Xi.playing;var Vi={animated:function(){return function(){var e=this,t=void 0!==e.length?e:[e];if(!(this._private.cy||this).styleEnabled())return!1;var n=t[0];return n?n._private.animation.current.length>0:void 0}},clearQueue:function(){return function(){var e=this,t=void 0!==e.length?e:[e];if(!(this._private.cy||this).styleEnabled())return this;for(var n=0;n<t.length;n++)t[n]._private.animation.queue=[];return this}},delay:function(){return function(e,t){return(this._private.cy||this).styleEnabled()?this.animate({delay:e,duration:e,complete:t}):this}},delayAnimation:function(){return function(e,t){return(this._private.cy||this).styleEnabled()?this.animation({delay:e,duration:e,complete:t}):this}},animation:function(){return function(e,t){var n=this,r=void 0!==n.length,i=r?n:[n],a=this._private.cy||this,o=!r,s=!o;if(!a.styleEnabled())return this;var l=a.style();if(e=Q({},e,t),0===Object.keys(e).length)return new Yi(i[0],e);switch(void 0===e.duration&&(e.duration=400),e.duration){case"slow":e.duration=600;break;case"fast":e.duration=200}if(s&&(e.style=l.getPropsList(e.style||e.css),e.css=void 0),s&&null!=e.renderedPosition){var u=e.renderedPosition,c=a.pan(),h=a.zoom();e.position=dn(u,h,c)}if(o&&null!=e.panBy){var d=e.panBy,p=a.pan();e.pan={x:p.x+d.x,y:p.y+d.y}}var g=e.center||e.centre;if(o&&null!=g){var f=a.getCenterPan(g.eles,e.zoom);null!=f&&(e.pan=f)}if(o&&null!=e.fit){var v=e.fit,y=a.getFitViewport(v.eles||v.boundingBox,v.padding);null!=y&&(e.pan=y.pan,e.zoom=y.zoom)}if(o&&E(e.zoom)){var m=a.getZoomedViewport(e.zoom);null!=m?(m.zoomed&&(e.zoom=m.zoom),m.panned&&(e.pan=m.pan)):e.zoom=null}return new Yi(i[0],e)}},animate:function(){return function(e,t){var n=this,r=void 0!==n.length?n:[n];if(!(this._private.cy||this).styleEnabled())return this;t&&(e=Q({},e,t));for(var i=0;i<r.length;i++){var a=r[i],o=a.animated()&&(void 0===e.queue||e.queue);a.animation(e,o?{queue:!0}:void 0).play()}return this}},stop:function(){return function(e,t){var n=this,r=void 0!==n.length?n:[n],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var a=0;a<r.length;a++){for(var o=r[a]._private,s=o.animation.current,l=0;l<s.length;l++){var u=s[l]._private;t&&(u.duration=0)}e&&(o.animation.queue=[]),t||(o.animation.current=[])}return i.notify("draw"),this}}},Ui=Array.isArray,ji=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Hi=/^\w*$/;function qi(e,t){if(Ui(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Ge(e))||Hi.test(e)||!ji.test(e)||null!=t&&e in Object(t)}var Wi=qi,$i="[object AsyncFunction]",Zi="[object Function]",Ki="[object GeneratorFunction]",Qi="[object Proxy]";function Ji(e){if(!le(e))return!1;var t=Pe(e);return t==Zi||t==Ki||t==$i||t==Qi}var ea,ta=Ji,na=pe["__core-js_shared__"],ra=(ea=/[^.]+$/.exec(na&&na.keys&&na.keys.IE_PROTO||""))?"Symbol(src)_1."+ea:"";function ia(e){return!!ra&&ra in e}var aa=ia,oa=Function.prototype.toString;function sa(e){if(null!=e){try{return oa.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var la=sa,ua=/[\\^$.*+?()[\]{}|]/g,ca=/^\[object .+?Constructor\]$/,ha=Function.prototype,da=Object.prototype,pa=ha.toString,ga=da.hasOwnProperty,fa=RegExp("^"+pa.call(ga).replace(ua,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function va(e){return!(!le(e)||aa(e))&&(ta(e)?fa:ca).test(la(e))}var ya=va;function ma(e,t){return null==e?void 0:e[t]}var ba=ma;function xa(e,t){var n=ba(e,t);return ya(n)?n:void 0}var wa=xa,Ea=wa(Object,"create");function Ta(){this.__data__=Ea?Ea(null):{},this.size=0}var _a=Ta;function Da(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Ca=Da,Na="__lodash_hash_undefined__",Aa=Object.prototype.hasOwnProperty;function La(e){var t=this.__data__;if(Ea){var n=t[e];return n===Na?void 0:n}return Aa.call(t,e)?t[e]:void 0}var Sa=La,Oa=Object.prototype.hasOwnProperty;function Ia(e){var t=this.__data__;return Ea?void 0!==t[e]:Oa.call(t,e)}var ka=Ia,Ma="__lodash_hash_undefined__";function Pa(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ea&&void 0===t?Ma:t,this}var Ra=Pa;function Ba(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ba.prototype.clear=_a,Ba.prototype.delete=Ca,Ba.prototype.get=Sa,Ba.prototype.has=ka,Ba.prototype.set=Ra;var Fa=Ba;function za(){this.__data__=[],this.size=0}var Ga=za;function Ya(e,t){return e===t||e!=e&&t!=t}var Xa=Ya;function Va(e,t){for(var n=e.length;n--;)if(Xa(e[n][0],t))return n;return-1}var Ua=Va,ja=Array.prototype.splice;function Ha(e){var t=this.__data__,n=Ua(t,e);return!(n<0||(n==t.length-1?t.pop():ja.call(t,n,1),--this.size,0))}var qa=Ha;function Wa(e){var t=this.__data__,n=Ua(t,e);return n<0?void 0:t[n][1]}var $a=Wa;function Za(e){return Ua(this.__data__,e)>-1}var Ka=Za;function Qa(e,t){var n=this.__data__,r=Ua(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var Ja=Qa;function eo(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}eo.prototype.clear=Ga,eo.prototype.delete=qa,eo.prototype.get=$a,eo.prototype.has=Ka,eo.prototype.set=Ja;var to=eo,no=wa(pe,"Map");function ro(){this.size=0,this.__data__={hash:new Fa,map:new(no||to),string:new Fa}}var io=ro;function ao(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}var oo=ao;function so(e,t){var n=e.__data__;return oo(t)?n["string"==typeof t?"string":"hash"]:n.map}var lo=so;function uo(e){var t=lo(this,e).delete(e);return this.size-=t?1:0,t}var co=uo;function ho(e){return lo(this,e).get(e)}var po=ho;function go(e){return lo(this,e).has(e)}var fo=go;function vo(e,t){var n=lo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var yo=vo;function mo(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}mo.prototype.clear=io,mo.prototype.delete=co,mo.prototype.get=po,mo.prototype.has=fo,mo.prototype.set=yo;var bo=mo,xo="Expected a function";function wo(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(xo);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(wo.Cache||bo),n}wo.Cache=bo;var Eo=wo,To=500;function _o(e){var t=Eo(e,(function(e){return n.size===To&&n.clear(),e})),n=t.cache;return t}var Do=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Co=/\\(\\)?/g,No=_o((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Do,(function(e,n,r,i){t.push(r?i.replace(Co,"$1"):n||e)})),t}));function Ao(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var Lo=Ao,So=1/0,Oo=we?we.prototype:void 0,Io=Oo?Oo.toString:void 0;function ko(e){if("string"==typeof e)return e;if(Ui(e))return Lo(e,ko)+"";if(Ge(e))return Io?Io.call(e):"";var t=e+"";return"0"==t&&1/e==-So?"-0":t}var Mo=ko;function Po(e){return null==e?"":Mo(e)}var Ro=Po;function Bo(e,t){return Ui(e)?e:Wi(e,t)?[e]:No(Ro(e))}var Fo=Bo,zo=1/0;function Go(e){if("string"==typeof e||Ge(e))return e;var t=e+"";return"0"==t&&1/e==-zo?"-0":t}var Yo=Go;function Xo(e,t){for(var n=0,r=(t=Fo(t,e)).length;null!=e&&n<r;)e=e[Yo(t[n++])];return n&&n==r?e:void 0}var Vo=Xo;function Uo(e,t,n){var r=null==e?void 0:Vo(e,t);return void 0===r?n:r}var jo=Uo,Ho=function(){try{var e=wa(Object,"defineProperty");return e({},"",{}),e}catch(t){}}();function qo(e,t,n){"__proto__"==t&&Ho?Ho(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Wo=qo,$o=Object.prototype.hasOwnProperty;function Zo(e,t,n){var r=e[t];$o.call(e,t)&&Xa(r,n)&&(void 0!==n||t in e)||Wo(e,t,n)}var Ko=Zo,Qo=9007199254740991,Jo=/^(?:0|[1-9]\d*)$/;function es(e,t){var n=typeof e;return!!(t=null==t?Qo:t)&&("number"==n||"symbol"!=n&&Jo.test(e))&&e>-1&&e%1==0&&e<t}var ts=es;function ns(e,t,n,r){if(!le(e))return e;for(var i=-1,a=(t=Fo(t,e)).length,o=a-1,s=e;null!=s&&++i<a;){var l=Yo(t[i]),u=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(i!=o){var c=s[l];void 0===(u=r?r(c,l,s):void 0)&&(u=le(c)?c:ts(t[i+1])?[]:{})}Ko(s,l,u),s=s[l]}return e}var rs=ns;function is(e,t,n){return null==e?e:rs(e,t,n)}var as=is;function os(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var ss=os;function ls(e){return Ui(e)?Lo(e,Yo):Ge(e)?[e]:ss(No(Ro(e)))}var us=ls,cs={eventAliasesOn:function(e){var t=e;t.addListener=t.listen=t.bind=t.on,t.unlisten=t.unbind=t.off=t.removeListener,t.trigger=t.emit,t.pon=t.promiseOn=function(e,t){var n=this,r=Array.prototype.slice.call(arguments,0);return new Gi((function(e,t){var i=function(t){n.off.apply(n,o),e(t)},a=r.concat([i]),o=a.concat([]);n.on.apply(n,a)}))}}},hs={};[Vi,{data:function(e){return e=Q({},{field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(e){},beforeSet:function(e,t){},onSet:function(e){},canSet:function(e){return!0}},e),function(t,n){var r=e,i=this,o=void 0!==i.length,s=o?i:[i],l=o?i[0]:i;if(b(t)){var u,c=-1!==t.indexOf(".")&&us(t);if(r.allowGetting&&void 0===n)return l&&(r.beforeGet(l),u=c&&void 0===l._private[r.field][t]?jo(l._private[r.field],c):l._private[r.field][t]),u;if(r.allowSetting&&void 0!==n&&!r.immutableKeys[t]){var h=a({},t,n);r.beforeSet(i,h);for(var d=0,p=s.length;d<p;d++){var g=s[d];r.canSet(g)&&(c&&void 0===l._private[r.field][t]?as(g._private[r.field],c,n):g._private[r.field][t]=n)}r.updateStyle&&i.updateStyle(),r.onSet(i),r.settingTriggersEvent&&i[r.triggerFnName](r.settingEvent)}}else if(r.allowSetting&&E(t)){var f,v,y=t,m=Object.keys(y);r.beforeSet(i,y);for(var w=0;w<m.length;w++)if(v=y[f=m[w]],!r.immutableKeys[f])for(var T=0;T<s.length;T++){var _=s[T];r.canSet(_)&&(_._private[r.field][f]=v)}r.updateStyle&&i.updateStyle(),r.onSet(i),r.settingTriggersEvent&&i[r.triggerFnName](r.settingEvent)}else if(r.allowBinding&&x(t)){var D=t;i.on(r.bindingEvent,D)}else if(r.allowGetting&&void 0===t){var C;return l&&(r.beforeGet(l),C=l._private[r.field]),C}return i}},removeData:function(e){return e=Q({},{field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}},e),function(t){var n=e,r=this,i=void 0!==r.length?r:[r];if(b(t)){for(var a=t.split(/\s+/),o=a.length,s=0;s<o;s++){var l=a[s];if(!k(l)&&!n.immutableKeys[l])for(var u=0,c=i.length;u<c;u++)i[u]._private[n.field][l]=void 0}n.triggerEvent&&r[n.triggerFnName](n.event)}else if(void 0===t){for(var h=0,d=i.length;h<d;h++)for(var p=i[h]._private[n.field],g=Object.keys(p),f=0;f<g.length;f++){var v=g[f];!n.immutableKeys[v]&&(p[v]=void 0)}n.triggerEvent&&r[n.triggerFnName](n.event)}return r}}},cs].forEach((function(e){Q(hs,e)}));var ds={animate:hs.animate(),animation:hs.animation(),animated:hs.animated(),clearQueue:hs.clearQueue(),delay:hs.delay(),delayAnimation:hs.delayAnimation(),stop:hs.stop()},ps={classes:function(e){var t=this;if(void 0===e){var n=[];return t[0]._private.classes.forEach((function(e){return n.push(e)})),n}w(e)||(e=(e||"").match(/\S+/g)||[]);for(var r=[],i=new Ut(e),a=0;a<t.length;a++){for(var o=t[a],s=o._private,l=s.classes,u=!1,c=0;c<e.length;c++){var h=e[c];if(!l.has(h)){u=!0;break}}u||(u=l.size!==e.length),u&&(s.classes=i,r.push(o))}return r.length>0&&this.spawn(r).updateStyle().emit("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return null!=t&&t._private.classes.has(e)},toggleClass:function(e,t){w(e)||(e=e.match(/\S+/g)||[]);for(var n=this,r=void 0===t,i=[],a=0,o=n.length;a<o;a++)for(var s=n[a],l=s._private.classes,u=!1,c=0;c<e.length;c++){var h=e[c],d=l.has(h),p=!1;t||r&&!d?(l.add(h),p=!0):(!t||r&&d)&&(l.delete(h),p=!0),!u&&p&&(i.push(s),u=!0)}return i.length>0&&this.spawn(i).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var n=this;if(null==t)t=250;else if(0===t)return n;return n.addClass(e),setTimeout((function(){n.removeClass(e)}),t),n}};ps.className=ps.classNames=ps.classes;var gs={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:"\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'",number:V,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};gs.variable="(?:[\\w-.]|(?:\\\\"+gs.metaChar+"))+",gs.className="(?:[\\w-]|(?:\\\\"+gs.metaChar+"))+",gs.value=gs.string+"|"+gs.number,gs.id=gs.variable,function(){var e,t,n;for(e=gs.comparatorOp.split("|"),n=0;n<e.length;n++)t=e[n],gs.comparatorOp+="|@"+t;for(e=gs.comparatorOp.split("|"),n=0;n<e.length;n++)(t=e[n]).indexOf("!")>=0||"="!==t&&(gs.comparatorOp+="|\\!"+t)}();var fs=function(){return{checks:[]}},vs={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},ys=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort((function(e,t){return K(e.selector,t.selector)})),ms=function(){for(var e,t={},n=0;n<ys.length;n++)t[(e=ys[n]).selector]=e.matches;return t}(),bs=function(e,t){return ms[e](t)},xs="("+ys.map((function(e){return e.selector})).join("|")+")",ws=function(e){return e.replace(new RegExp("\\\\("+gs.metaChar+")","g"),(function(e,t){return t}))},Es=function(e,t,n){e[e.length-1]=n},Ts=[{name:"group",query:!0,regex:"("+gs.group+")",populate:function(e,t,n){var r=o(n,1)[0];t.checks.push({type:vs.GROUP,value:"*"===r?r:r+"s"})}},{name:"state",query:!0,regex:xs,populate:function(e,t,n){var r=o(n,1)[0];t.checks.push({type:vs.STATE,value:r})}},{name:"id",query:!0,regex:"\\#("+gs.id+")",populate:function(e,t,n){var r=o(n,1)[0];t.checks.push({type:vs.ID,value:ws(r)})}},{name:"className",query:!0,regex:"\\.("+gs.className+")",populate:function(e,t,n){var r=o(n,1)[0];t.checks.push({type:vs.CLASS,value:ws(r)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+gs.variable+")\\s*\\]",populate:function(e,t,n){var r=o(n,1)[0];t.checks.push({type:vs.DATA_EXIST,field:ws(r)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+gs.variable+")\\s*("+gs.comparatorOp+")\\s*("+gs.value+")\\s*\\]",populate:function(e,t,n){var r=o(n,3),i=r[0],a=r[1],s=r[2];s=null!=new RegExp("^"+gs.string+"$").exec(s)?s.substring(1,s.length-1):parseFloat(s),t.checks.push({type:vs.DATA_COMPARE,field:ws(i),operator:a,value:s})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+gs.boolOp+")\\s*("+gs.variable+")\\s*\\]",populate:function(e,t,n){var r=o(n,2),i=r[0],a=r[1];t.checks.push({type:vs.DATA_BOOL,field:ws(a),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+gs.meta+")\\s*("+gs.comparatorOp+")\\s*("+gs.number+")\\s*\\]\\]",populate:function(e,t,n){var r=o(n,3),i=r[0],a=r[1],s=r[2];t.checks.push({type:vs.META_COMPARE,field:ws(i),operator:a,value:parseFloat(s)})}},{name:"nextQuery",separator:!0,regex:gs.separator,populate:function(e,t){var n=e.currentSubject,r=e.edgeCount,i=e.compoundCount,a=e[e.length-1];return null!=n&&(a.subject=n,e.currentSubject=null),a.edgeCount=r,a.compoundCount=i,e.edgeCount=0,e.compoundCount=0,e[e.length++]=fs()}},{name:"directedEdge",separator:!0,regex:gs.directedEdge,populate:function(e,t){if(null==e.currentSubject){var n=fs(),r=t,i=fs();return n.checks.push({type:vs.DIRECTED_EDGE,source:r,target:i}),Es(e,t,n),e.edgeCount++,i}var a=fs(),o=t,s=fs();return a.checks.push({type:vs.NODE_SOURCE,source:o,target:s}),Es(e,t,a),e.edgeCount++,s}},{name:"undirectedEdge",separator:!0,regex:gs.undirectedEdge,populate:function(e,t){if(null==e.currentSubject){var n=fs(),r=t,i=fs();return n.checks.push({type:vs.UNDIRECTED_EDGE,nodes:[r,i]}),Es(e,t,n),e.edgeCount++,i}var a=fs(),o=t,s=fs();return a.checks.push({type:vs.NODE_NEIGHBOR,node:o,neighbor:s}),Es(e,t,a),s}},{name:"child",separator:!0,regex:gs.child,populate:function(e,t){if(null==e.currentSubject){var n=fs(),r=fs(),i=e[e.length-1];return n.checks.push({type:vs.CHILD,parent:i,child:r}),Es(e,t,n),e.compoundCount++,r}if(e.currentSubject===t){var a=fs(),o=e[e.length-1],s=fs(),l=fs(),u=fs(),c=fs();return a.checks.push({type:vs.COMPOUND_SPLIT,left:o,right:s,subject:l}),l.checks=t.checks,t.checks=[{type:vs.TRUE}],c.checks.push({type:vs.TRUE}),s.checks.push({type:vs.PARENT,parent:c,child:u}),Es(e,o,a),e.currentSubject=l,e.compoundCount++,u}var h=fs(),d=fs(),p=[{type:vs.PARENT,parent:h,child:d}];return h.checks=t.checks,t.checks=p,e.compoundCount++,d}},{name:"descendant",separator:!0,regex:gs.descendant,populate:function(e,t){if(null==e.currentSubject){var n=fs(),r=fs(),i=e[e.length-1];return n.checks.push({type:vs.DESCENDANT,ancestor:i,descendant:r}),Es(e,t,n),e.compoundCount++,r}if(e.currentSubject===t){var a=fs(),o=e[e.length-1],s=fs(),l=fs(),u=fs(),c=fs();return a.checks.push({type:vs.COMPOUND_SPLIT,left:o,right:s,subject:l}),l.checks=t.checks,t.checks=[{type:vs.TRUE}],c.checks.push({type:vs.TRUE}),s.checks.push({type:vs.ANCESTOR,ancestor:c,descendant:u}),Es(e,o,a),e.currentSubject=l,e.compoundCount++,u}var h=fs(),d=fs(),p=[{type:vs.ANCESTOR,ancestor:h,descendant:d}];return h.checks=t.checks,t.checks=p,e.compoundCount++,d}},{name:"subject",modifier:!0,regex:gs.subject,populate:function(e,t){if(null!=e.currentSubject&&e.currentSubject!==t)return Nt("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=t;var n=e[e.length-1].checks[0],r=null==n?null:n.type;r===vs.DIRECTED_EDGE?n.type=vs.NODE_TARGET:r===vs.UNDIRECTED_EDGE&&(n.type=vs.NODE_NEIGHBOR,n.node=n.nodes[1],n.neighbor=n.nodes[0],n.nodes=null)}}];Ts.forEach((function(e){return e.regexObj=new RegExp("^"+e.regex)}));var _s=function(e){for(var t,n,r,i=0;i<Ts.length;i++){var a=Ts[i],o=a.name,s=e.match(a.regexObj);if(null!=s){n=s,t=a,r=o;var l=s[0];e=e.substring(l.length);break}}return{expr:t,match:n,name:r,remaining:e}},Ds=function(e){var t=e.match(/^\s+/);if(t){var n=t[0];e=e.substring(n.length)}return e},Cs={parse:function(e){var t=this,n=t.inputText=e,r=t[0]=fs();for(t.length=1,n=Ds(n);;){var i=_s(n);if(null==i.expr)return Nt("The selector `"+e+"`is invalid"),!1;var a=i.match.slice(1),o=i.expr.populate(t,r,a);if(!1===o)return!1;if(null!=o&&(r=o),(n=i.remaining).match(/^\s*$/))break}var s=t[t.length-1];null!=t.currentSubject&&(s.subject=t.currentSubject),s.edgeCount=t.edgeCount,s.compoundCount=t.compoundCount;for(var l=0;l<t.length;l++){var u=t[l];if(u.compoundCount>0&&u.edgeCount>0)return Nt("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(u.edgeCount>1)return Nt("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;1===u.edgeCount&&Nt("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},toString:function(){if(null!=this.toStringCache)return this.toStringCache;for(var e=function(e){return null==e?"":e},t=function(t){return b(t)?'"'+t+'"':e(t)},n=function(e){return" "+e+" "},r=function(r,a){var o=r.type,s=r.value;switch(o){case vs.GROUP:var l=e(s);return l.substring(0,l.length-1);case vs.DATA_COMPARE:var u=r.field,c=r.operator;return"["+u+n(e(c))+t(s)+"]";case vs.DATA_BOOL:var h=r.operator,d=r.field;return"["+e(h)+d+"]";case vs.DATA_EXIST:return"["+r.field+"]";case vs.META_COMPARE:var p=r.operator;return"[["+r.field+n(e(p))+t(s)+"]]";case vs.STATE:return s;case vs.ID:return"#"+s;case vs.CLASS:return"."+s;case vs.PARENT:case vs.CHILD:return i(r.parent,a)+n(">")+i(r.child,a);case vs.ANCESTOR:case vs.DESCENDANT:return i(r.ancestor,a)+" "+i(r.descendant,a);case vs.COMPOUND_SPLIT:var g=i(r.left,a),f=i(r.subject,a),v=i(r.right,a);return g+(g.length>0?" ":"")+f+v;case vs.TRUE:return""}},i=function(e,t){return e.checks.reduce((function(n,i,a){return n+(t===e&&0===a?"$":"")+r(i,t)}),"")},a="",o=0;o<this.length;o++){var s=this[o];a+=i(s,s.subject),this.length>1&&o<this.length-1&&(a+=", ")}return this.toStringCache=a,a}},Ns=function(e,t,n){var r,i,a,o=b(e),s=_(e),l=b(n),u=!1,c=!1,h=!1;switch(t.indexOf("!")>=0&&(t=t.replace("!",""),c=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),u=!0),(o||l||u)&&(i=o||s?""+e:"",a=""+n),u&&(e=i=i.toLowerCase(),n=a=a.toLowerCase()),t){case"*=":r=i.indexOf(a)>=0;break;case"$=":r=i.indexOf(a,i.length-a.length)>=0;break;case"^=":r=0===i.indexOf(a);break;case"=":r=e===n;break;case">":h=!0,r=e>n;break;case">=":h=!0,r=e>=n;break;case"<":h=!0,r=e<n;break;case"<=":h=!0,r=e<=n;break;default:r=!1}return!c||null==e&&h||(r=!r),r},As=function(e,t){switch(t){case"?":return!!e;case"!":return!e;case"^":return void 0===e}},Ls=function(e){return void 0!==e},Ss=function(e,t){return e.data(t)},Os=function(e,t){return e[t]()},Is=[],ks=function(e,t){return e.checks.every((function(e){return Is[e.type](e,t)}))};Is[vs.GROUP]=function(e,t){var n=e.value;return"*"===n||n===t.group()},Is[vs.STATE]=function(e,t){var n=e.value;return bs(n,t)},Is[vs.ID]=function(e,t){var n=e.value;return t.id()===n},Is[vs.CLASS]=function(e,t){var n=e.value;return t.hasClass(n)},Is[vs.META_COMPARE]=function(e,t){var n=e.field,r=e.operator,i=e.value;return Ns(Os(t,n),r,i)},Is[vs.DATA_COMPARE]=function(e,t){var n=e.field,r=e.operator,i=e.value;return Ns(Ss(t,n),r,i)},Is[vs.DATA_BOOL]=function(e,t){var n=e.field,r=e.operator;return As(Ss(t,n),r)},Is[vs.DATA_EXIST]=function(e,t){var n=e.field;return e.operator,Ls(Ss(t,n))},Is[vs.UNDIRECTED_EDGE]=function(e,t){var n=e.nodes[0],r=e.nodes[1],i=t.source(),a=t.target();return ks(n,i)&&ks(r,a)||ks(r,i)&&ks(n,a)},Is[vs.NODE_NEIGHBOR]=function(e,t){return ks(e.node,t)&&t.neighborhood().some((function(t){return t.isNode()&&ks(e.neighbor,t)}))},Is[vs.DIRECTED_EDGE]=function(e,t){return ks(e.source,t.source())&&ks(e.target,t.target())},Is[vs.NODE_SOURCE]=function(e,t){return ks(e.source,t)&&t.outgoers().some((function(t){return t.isNode()&&ks(e.target,t)}))},Is[vs.NODE_TARGET]=function(e,t){return ks(e.target,t)&&t.incomers().some((function(t){return t.isNode()&&ks(e.source,t)}))},Is[vs.CHILD]=function(e,t){return ks(e.child,t)&&ks(e.parent,t.parent())},Is[vs.PARENT]=function(e,t){return ks(e.parent,t)&&t.children().some((function(t){return ks(e.child,t)}))},Is[vs.DESCENDANT]=function(e,t){return ks(e.descendant,t)&&t.ancestors().some((function(t){return ks(e.ancestor,t)}))},Is[vs.ANCESTOR]=function(e,t){return ks(e.ancestor,t)&&t.descendants().some((function(t){return ks(e.descendant,t)}))},Is[vs.COMPOUND_SPLIT]=function(e,t){return ks(e.subject,t)&&ks(e.left,t)&&ks(e.right,t)},Is[vs.TRUE]=function(){return!0},Is[vs.COLLECTION]=function(e,t){return e.value.has(t)},Is[vs.FILTER]=function(e,t){return(0,e.value)(t)};var Ms={matches:function(e){for(var t=this,n=0;n<t.length;n++){var r=t[n];if(ks(r,e))return!0}return!1},filter:function(e){var t=this;if(1===t.length&&1===t[0].checks.length&&t[0].checks[0].type===vs.ID)return e.getElementById(t[0].checks[0].value).collection();var n=function(e){for(var n=0;n<t.length;n++){var r=t[n];if(ks(r,e))return!0}return!1};return null==t.text()&&(n=function(){return!0}),e.filter(n)}},Ps=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,null==e||b(e)&&e.match(/^\s*$/)||(N(e)?this.addQuery({checks:[{type:vs.COLLECTION,value:e.collection()}]}):x(e)?this.addQuery({checks:[{type:vs.FILTER,value:e}]}):b(e)?this.parse(e)||(this.invalid=!0):Dt("A selector must be created from a string; found "))},Rs=Ps.prototype;[Cs,Ms].forEach((function(e){return Q(Rs,e)})),Rs.text=function(){return this.inputText},Rs.size=function(){return this.length},Rs.eq=function(e){return this[e]},Rs.sameText=function(e){return!this.invalid&&!e.invalid&&this.text()===e.text()},Rs.addQuery=function(e){this[this.length++]=e},Rs.selector=Rs.toString;var Bs={allAre:function(e){var t=new Ps(e);return this.every((function(e){return t.matches(e)}))},is:function(e){var t=new Ps(e);return this.some((function(e){return t.matches(e)}))},some:function(e,t){for(var n=0;n<this.length;n++)if(t?e.apply(t,[this[n],n,this]):e(this[n],n,this))return!0;return!1},every:function(e,t){for(var n=0;n<this.length;n++)if(!(t?e.apply(t,[this[n],n,this]):e(this[n],n,this)))return!1;return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var t=this.length;return t===e.length&&(1===t?this[0]===e[0]: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())}))}};Bs.allAreNeighbours=Bs.allAreNeighbors,Bs.has=Bs.contains,Bs.equal=Bs.equals=Bs.same;var Fs,zs,Gs=function(e,t){return function(n,r,i,a){var o,s=n,l=this;if(null==s?o="":N(s)&&1===s.length&&(o=s.id()),1===l.length&&o){var u=l[0]._private,c=u.traversalCache=u.traversalCache||{},h=c[t]=c[t]||[],d=gt(o),p=h[d];return p||(h[d]=e.call(l,n,r,i,a))}return e.call(l,n,r,i,a)}},Ys={parent:function(e){var t=[];if(1===this.length){var n=this[0]._private.parent;if(n)return n}for(var r=0;r<this.length;r++){var i=this[r]._private.parent;i&&t.push(i)}return this.spawn(t,!0).filter(e)},parents:function(e){for(var t=[],n=this.parent();n.nonempty();){for(var r=0;r<n.length;r++){var i=n[r];t.push(i)}n=n.parent()}return this.spawn(t,!0).filter(e)},commonAncestors:function(e){for(var t,n=0;n<this.length;n++){var r=this[n].parents();t=(t=t||r).intersect(r)}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:Gs((function(e){for(var t=[],n=0;n<this.length;n++)for(var r=this[n]._private.children,i=0;i<r.length;i++)t.push(r[i]);return this.spawn(t,!0).filter(e)}),"children"),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){var t=[];function n(e){for(var r=0;r<e.length;r++){var i=e[r];t.push(i),i.children().nonempty()&&n(i.children())}}return n(this.children()),this.spawn(t,!0).filter(e)}};function Xs(e,t,n,r){for(var i=[],a=new Ut,o=e.cy().hasCompoundNodes(),s=0;s<e.length;s++){var l=e[s];n?i.push(l):o&&r(i,a,l)}for(;i.length>0;){var u=i.shift();t(u),a.add(u.id()),o&&r(i,a,u)}return e}function Vs(e,t,n){if(n.isParent())for(var r=n._private.children,i=0;i<r.length;i++){var a=r[i];t.has(a.id())||e.push(a)}}function Us(e,t,n){if(n.isChild()){var r=n._private.parent;t.has(r.id())||e.push(r)}}function js(e,t,n){Us(e,t,n),Vs(e,t,n)}Ys.forEachDown=function(e){return Xs(this,e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],Vs)},Ys.forEachUp=function(e){return Xs(this,e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],Us)},Ys.forEachUpAndDown=function(e){return Xs(this,e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],js)},Ys.ancestors=Ys.parents,(Fs=zs={data:hs.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:hs.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:hs.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:hs.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:hs.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:hs.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}}).attr=Fs.data,Fs.removeAttr=Fs.removeData;var Hs,qs,Ws=zs,$s={};function Zs(e){return function(t){var n=this;if(void 0===t&&(t=!0),0!==n.length&&n.isNode()&&!n.removed()){for(var r=0,i=n[0],a=i._private.edges,o=0;o<a.length;o++){var s=a[o];!t&&s.isLoop()||(r+=e(i,s))}return r}}}function Ks(e,t){return function(n){for(var r,i=this.nodes(),a=0;a<i.length;a++){var o=i[a][e](n);void 0===o||void 0!==r&&!t(o,r)||(r=o)}return r}}Q($s,{degree:Zs((function(e,t){return t.source().same(t.target())?2:1})),indegree:Zs((function(e,t){return t.target().same(e)?1:0})),outdegree:Zs((function(e,t){return t.source().same(e)?1:0}))}),Q($s,{minDegree:Ks("degree",(function(e,t){return e<t})),maxDegree:Ks("degree",(function(e,t){return e>t})),minIndegree:Ks("indegree",(function(e,t){return e<t})),maxIndegree:Ks("indegree",(function(e,t){return e>t})),minOutdegree:Ks("outdegree",(function(e,t){return e<t})),maxOutdegree:Ks("outdegree",(function(e,t){return e>t}))}),Q($s,{totalDegree:function(e){for(var t=0,n=this.nodes(),r=0;r<n.length;r++)t+=n[r].degree(e);return t}});var Qs=function(e,t,n){for(var r=0;r<e.length;r++){var i=e[r];if(!i.locked()){var a=i._private.position,o={x:null!=t.x?t.x-a.x:0,y:null!=t.y?t.y-a.y:0};!i.isParent()||0===o.x&&0===o.y||i.children().shift(o,n),i.dirtyBoundingBoxCache()}}},Js={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,t){Qs(e,t,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};(Hs=qs={position:hs.data(Js),silentPosition:hs.data(Q({},Js,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,t){Qs(e,t,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,t){if(E(e))t?this.silentPosition(e):this.position(e);else if(x(e)){var n=e,r=this.cy();r.startBatch();for(var i=0;i<this.length;i++){var a=this[i],o=void 0;(o=n(a,i))&&(t?a.silentPosition(o):a.position(o))}r.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,t,n){var r;if(E(e)?(r={x:_(e.x)?e.x:0,y:_(e.y)?e.y:0},n=t):b(e)&&_(t)&&((r={x:0,y:0})[e]=t),null!=r){var i=this.cy();i.startBatch();for(var a=0;a<this.length;a++){var o=this[a];if(!(i.hasCompoundNodes()&&o.isChild()&&o.ancestors().anySame(this))){var s=o.position(),l={x:s.x+r.x,y:s.y+r.y};n?o.silentPosition(l):o.position(l)}}i.endBatch()}return this},silentShift:function(e,t){return E(e)?this.shift(e,!0):b(e)&&_(t)&&this.shift(e,t,!0),this},renderedPosition:function(e,t){var n=this[0],r=this.cy(),i=r.zoom(),a=r.pan(),o=E(e)?e:void 0,s=void 0!==o||void 0!==t&&b(e);if(n&&n.isNode()){if(!s){var l=n.position();return o=hn(l,i,a),void 0===e?o:o[e]}for(var u=0;u<this.length;u++){var c=this[u];void 0!==t?c.position(e,(t-a[e])/i):void 0!==o&&c.position(dn(o,i,a))}}else if(!s)return;return this},relativePosition:function(e,t){var n=this[0],r=this.cy(),i=E(e)?e:void 0,a=void 0!==i||void 0!==t&&b(e),o=r.hasCompoundNodes();if(n&&n.isNode()){if(!a){var s=n.position(),l=o?n.parent():null,u=l&&l.length>0,c=u;u&&(l=l[0]);var h=c?l.position():{x:0,y:0};return i={x:s.x-h.x,y:s.y-h.y},void 0===e?i:i[e]}for(var d=0;d<this.length;d++){var p=this[d],g=o?p.parent():null,f=g&&g.length>0,v=f;f&&(g=g[0]);var y=v?g.position():{x:0,y:0};void 0!==t?p.position(e,t+y[e]):void 0!==i&&p.position({x:i.x+y.x,y:i.y+y.y})}}else if(!a)return;return this}}).modelPosition=Hs.point=Hs.position,Hs.modelPositions=Hs.points=Hs.positions,Hs.renderedPoint=Hs.renderedPosition,Hs.relativePoint=Hs.relativePosition;var el,tl,nl=qs;el=tl={},tl.renderedBoundingBox=function(e){var t=this.boundingBox(e),n=this.cy(),r=n.zoom(),i=n.pan(),a=t.x1*r+i.x,o=t.x2*r+i.x,s=t.y1*r+i.y,l=t.y2*r+i.y;return{x1:a,x2:o,y1:s,y2:l,w:o-a,h:l-s}},tl.dirtyCompoundBoundsCache=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();return t.styleEnabled()&&t.hasCompoundNodes()?(this.forEachUp((function(t){if(t.isParent()){var n=t._private;n.compoundBoundsClean=!1,n.bbCache=null,e||t.emitAndNotify("bounds")}})),this):this},tl.updateCompoundBounds=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes())return this;if(!e&&t.batching())return this;function n(e){if(e.isParent()){var t=e._private,n=e.children(),r="include"===e.pstyle("compound-sizing-wrt-labels").value,i={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")}},a=n.boundingBox({includeLabels:r,includeOverlays:!1,useCache:!1}),o=t.position;0!==a.w&&0!==a.h||((a={w:e.pstyle("width").pfValue,h:e.pstyle("height").pfValue}).x1=o.x-a.w/2,a.x2=o.x+a.w/2,a.y1=o.y-a.h/2,a.y2=o.y+a.h/2);var s=i.width.left.value;"px"===i.width.left.units&&i.width.val>0&&(s=100*s/i.width.val);var l=i.width.right.value;"px"===i.width.right.units&&i.width.val>0&&(l=100*l/i.width.val);var u=i.height.top.value;"px"===i.height.top.units&&i.height.val>0&&(u=100*u/i.height.val);var c=i.height.bottom.value;"px"===i.height.bottom.units&&i.height.val>0&&(c=100*c/i.height.val);var h=y(i.width.val-a.w,s,l),d=h.biasDiff,p=h.biasComplementDiff,g=y(i.height.val-a.h,u,c),f=g.biasDiff,v=g.biasComplementDiff;t.autoPadding=m(a.w,a.h,e.pstyle("padding"),e.pstyle("padding-relative-to").value),t.autoWidth=Math.max(a.w,i.width.val),o.x=(-d+a.x1+a.x2+p)/2,t.autoHeight=Math.max(a.h,i.height.val),o.y=(-f+a.y1+a.y2+v)/2}function y(e,t,n){var r=0,i=0,a=t+n;return e>0&&a>0&&(r=t/a*e,i=n/a*e),{biasDiff:r,biasComplementDiff:i}}function m(e,t,n,r){if("%"!==n.units)return"px"===n.units?n.pfValue:0;switch(r){case"width":return e>0?n.pfValue*e:0;case"height":return t>0?n.pfValue*t:0;case"average":return e>0&&t>0?n.pfValue*(e+t)/2:0;case"min":return e>0&&t>0?e>t?n.pfValue*t:n.pfValue*e:0;case"max":return e>0&&t>0?e>t?n.pfValue*e:n.pfValue*t:0;default:return 0}}}for(var r=0;r<this.length;r++){var i=this[r],a=i._private;a.compoundBoundsClean&&!e||(n(i),t.batching()||(a.compoundBoundsClean=!0))}return this};var rl=function(e){return e===1/0||e===-1/0?0:e},il=function(e,t,n,r,i){r-t!=0&&i-n!=0&&null!=t&&null!=n&&null!=r&&null!=i&&(e.x1=t<e.x1?t:e.x1,e.x2=r>e.x2?r:e.x2,e.y1=n<e.y1?n:e.y1,e.y2=i>e.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},al=function(e,t){return null==t?e:il(e,t.x1,t.y1,t.x2,t.y2)},ol=function(e,t,n){return Ft(e,t,n)},sl=function(e,t,n){if(!t.cy().headless()){var r,i,a=t._private,o=a.rstyle,s=o.arrowWidth/2;if("none"!==t.pstyle(n+"-arrow-shape").value){"source"===n?(r=o.srcX,i=o.srcY):"target"===n?(r=o.tgtX,i=o.tgtY):(r=o.midX,i=o.midY);var l=a.arrowBounds=a.arrowBounds||{},u=l[n]=l[n]||{};u.x1=r-s,u.y1=i-s,u.x2=r+s,u.y2=i+s,u.w=u.x2-u.x1,u.h=u.y2-u.y1,Mn(u,1),il(e,u.x1,u.y1,u.x2,u.y2)}}},ll=function(e,t,n){if(!t.cy().headless()){var r;r=n?n+"-":"";var i=t._private,a=i.rstyle;if(t.pstyle(r+"label").strValue){var o,s,l,u,c=t.pstyle("text-halign"),h=t.pstyle("text-valign"),d=ol(a,"labelWidth",n),p=ol(a,"labelHeight",n),g=ol(a,"labelX",n),f=ol(a,"labelY",n),v=t.pstyle(r+"text-margin-x").pfValue,y=t.pstyle(r+"text-margin-y").pfValue,m=t.isEdge(),b=t.pstyle(r+"text-rotation"),x=t.pstyle("text-outline-width").pfValue,w=t.pstyle("text-border-width").pfValue/2,E=t.pstyle("text-background-padding").pfValue,T=2,_=p,D=d,C=D/2,N=_/2;if(m)o=g-C,s=g+C,l=f-N,u=f+N;else{switch(c.value){case"left":o=g-D,s=g;break;case"center":o=g-C,s=g+C;break;case"right":o=g,s=g+D}switch(h.value){case"top":l=f-_,u=f;break;case"center":l=f-N,u=f+N;break;case"bottom":l=f,u=f+_}}o+=v-Math.max(x,w)-E-T,s+=v+Math.max(x,w)+E+T,l+=y-Math.max(x,w)-E-T,u+=y+Math.max(x,w)+E+T;var A=n||"main",L=i.labelBounds,S=L[A]=L[A]||{};S.x1=o,S.y1=l,S.x2=s,S.y2=u,S.w=s-o,S.h=u-l;var O=m&&"autorotate"===b.strValue,I=null!=b.pfValue&&0!==b.pfValue;if(O||I){var k=O?ol(i.rstyle,"labelAngle",n):b.pfValue,M=Math.cos(k),P=Math.sin(k),R=(o+s)/2,B=(l+u)/2;if(!m){switch(c.value){case"left":R=s;break;case"right":R=o}switch(h.value){case"top":B=u;break;case"bottom":B=l}}var F=function(e,t){return{x:(e-=R)*M-(t-=B)*P+R,y:e*P+t*M+B}},z=F(o,l),G=F(o,u),Y=F(s,l),X=F(s,u);o=Math.min(z.x,G.x,Y.x,X.x),s=Math.max(z.x,G.x,Y.x,X.x),l=Math.min(z.y,G.y,Y.y,X.y),u=Math.max(z.y,G.y,Y.y,X.y)}var V=A+"Rot",U=L[V]=L[V]||{};U.x1=o,U.y1=l,U.x2=s,U.y2=u,U.w=s-o,U.h=u-l,il(e,o,l,s,u),il(i.labelBounds.all,o,l,s,u)}return e}},ul=function(e,t){var n,r,i,a,o,s,l=e._private.cy,u=l.styleEnabled(),c=l.headless(),h=Ln(),d=e._private,p=e.isNode(),g=e.isEdge(),f=d.rstyle,v=p&&u?e.pstyle("bounds-expansion").pfValue:[0],y=function(e){return"none"!==e.pstyle("display").value},m=!u||y(e)&&(!g||y(e.source())&&y(e.target()));if(m){var b=0;u&&t.includeOverlays&&0!==e.pstyle("overlay-opacity").value&&(b=e.pstyle("overlay-padding").value);var x=0;u&&t.includeUnderlays&&0!==e.pstyle("underlay-opacity").value&&(x=e.pstyle("underlay-padding").value);var w=Math.max(b,x),E=0;if(u&&(E=e.pstyle("width").pfValue/2),p&&t.includeNodes){var T=e.position();o=T.x,s=T.y;var _=e.outerWidth()/2,D=e.outerHeight()/2;il(h,n=o-_,i=s-D,r=o+_,a=s+D)}else if(g&&t.includeEdges)if(u&&!c){var C=e.pstyle("curve-style").strValue;if(n=Math.min(f.srcX,f.midX,f.tgtX),r=Math.max(f.srcX,f.midX,f.tgtX),i=Math.min(f.srcY,f.midY,f.tgtY),a=Math.max(f.srcY,f.midY,f.tgtY),il(h,n-=E,i-=E,r+=E,a+=E),"haystack"===C){var N=f.haystackPts;if(N&&2===N.length){if(n=N[0].x,i=N[0].y,n>(r=N[1].x)){var A=n;n=r,r=A}if(i>(a=N[1].y)){var L=i;i=a,a=L}il(h,n-E,i-E,r+E,a+E)}}else if("bezier"===C||"unbundled-bezier"===C||"segments"===C||"taxi"===C){var S;switch(C){case"bezier":case"unbundled-bezier":S=f.bezierPts;break;case"segments":case"taxi":S=f.linePts}if(null!=S)for(var O=0;O<S.length;O++){var I=S[O];n=I.x-E,r=I.x+E,i=I.y-E,a=I.y+E,il(h,n,i,r,a)}}}else{var k=e.source().position(),M=e.target().position();if((n=k.x)>(r=M.x)){var P=n;n=r,r=P}if((i=k.y)>(a=M.y)){var R=i;i=a,a=R}il(h,n-=E,i-=E,r+=E,a+=E)}if(u&&t.includeEdges&&g&&(sl(h,e,"mid-source"),sl(h,e,"mid-target"),sl(h,e,"source"),sl(h,e,"target")),u&&"yes"===e.pstyle("ghost").value){var B=e.pstyle("ghost-offset-x").pfValue,F=e.pstyle("ghost-offset-y").pfValue;il(h,h.x1+B,h.y1+F,h.x2+B,h.y2+F)}var z=d.bodyBounds=d.bodyBounds||{};Rn(z,h),Pn(z,v),Mn(z,1),u&&(n=h.x1,r=h.x2,i=h.y1,a=h.y2,il(h,n-w,i-w,r+w,a+w));var G=d.overlayBounds=d.overlayBounds||{};Rn(G,h),Pn(G,v),Mn(G,1);var Y=d.labelBounds=d.labelBounds||{};null!=Y.all?On(Y.all):Y.all=Ln(),u&&t.includeLabels&&(t.includeMainLabels&&ll(h,e,null),g&&(t.includeSourceLabels&&ll(h,e,"source"),t.includeTargetLabels&&ll(h,e,"target")))}return h.x1=rl(h.x1),h.y1=rl(h.y1),h.x2=rl(h.x2),h.y2=rl(h.y2),h.w=rl(h.x2-h.x1),h.h=rl(h.y2-h.y1),h.w>0&&h.h>0&&m&&(Pn(h,v),Mn(h,1)),h},cl=function(e){var t=0,n=function(e){return(e?1:0)<<t++},r=0;return r+=n(e.incudeNodes),r+=n(e.includeEdges),r+=n(e.includeLabels),r+=n(e.includeMainLabels),r+=n(e.includeSourceLabels),r+=n(e.includeTargetLabels),r+=n(e.includeOverlays)},hl=function(e){if(e.isEdge()){var t=e.source().position(),n=e.target().position(),r=function(e){return Math.round(e)};return pt([r(t.x),r(t.y),r(n.x),r(n.y)])}return 0},dl=function(e,t){var n,r=e._private,i=e.isEdge(),a=(null==t?gl:cl(t))===gl,o=hl(e),s=r.bbCachePosKey===o,l=t.useCache&&s,u=function(e){return null==e._private.bbCache||e._private.styleDirty};if(!l||u(e)||i&&u(e.source())||u(e.target())?(s||e.recalculateRenderedStyle(l),n=ul(e,pl),r.bbCache=n,r.bbCachePosKey=o):n=r.bbCache,!a){var c=e.isNode();n=Ln(),(t.includeNodes&&c||t.includeEdges&&!c)&&(t.includeOverlays?al(n,r.overlayBounds):al(n,r.bodyBounds)),t.includeLabels&&(t.includeMainLabels&&(!i||t.includeSourceLabels&&t.includeTargetLabels)?al(n,r.labelBounds.all):(t.includeMainLabels&&al(n,r.labelBounds.mainRot),t.includeSourceLabels&&al(n,r.labelBounds.sourceRot),t.includeTargetLabels&&al(n,r.labelBounds.targetRot))),n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n},pl={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,useCache:!0},gl=cl(pl),fl=Mt(pl);tl.boundingBox=function(e){var t;if(1!==this.length||null==this[0]._private.bbCache||this[0]._private.styleDirty||void 0!==e&&void 0!==e.useCache&&!0!==e.useCache){t=Ln();var n=fl(e=e||pl),r=this;if(r.cy().styleEnabled())for(var i=0;i<r.length;i++){var a=r[i],o=a._private,s=hl(a),l=o.bbCachePosKey===s,u=n.useCache&&l&&!o.styleDirty;a.recalculateRenderedStyle(u)}this.updateCompoundBounds(!e.useCache);for(var c=0;c<r.length;c++){var h=r[c];al(t,dl(h,n))}}else e=void 0===e?pl:fl(e),t=dl(this[0],e);return t.x1=rl(t.x1),t.y1=rl(t.y1),t.x2=rl(t.x2),t.y2=rl(t.y2),t.w=rl(t.x2-t.x1),t.h=rl(t.y2-t.y1),t},tl.dirtyBoundingBoxCache=function(){for(var e=0;e<this.length;e++){var t=this[e]._private;t.bbCache=null,t.bbCachePosKey=null,t.bodyBounds=null,t.overlayBounds=null,t.labelBounds.all=null,t.labelBounds.source=null,t.labelBounds.target=null,t.labelBounds.main=null,t.labelBounds.sourceRot=null,t.labelBounds.targetRot=null,t.labelBounds.mainRot=null,t.arrowBounds.source=null,t.arrowBounds.target=null,t.arrowBounds["mid-source"]=null,t.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this},tl.boundingBoxAt=function(e){var t=this.nodes(),n=this.cy(),r=n.hasCompoundNodes(),i=n.collection();if(r&&(i=t.filter((function(e){return e.isParent()})),t=t.not(i)),E(e)){var a=e;e=function(){return a}}var o=function(t,n){return t._private.bbAtOldPos=e(t,n)},s=function(e){return e._private.bbAtOldPos};n.startBatch(),t.forEach(o).silentPositions(e),r&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0));var l=Sn(this.boundingBox({useCache:!1}));return t.silentPositions(s),r&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0)),n.endBatch(),l},el.boundingbox=el.bb=el.boundingBox,el.renderedBoundingbox=el.renderedBoundingBox;var vl,yl,ml=tl;vl=yl={};var bl=function(e){e.uppercaseName=X(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=X(e.outerName),vl[e.name]=function(){var t=this[0],n=t._private,r=n.cy._private.styleEnabled;if(t){if(r){if(t.isParent())return t.updateCompoundBounds(),n[e.autoName]||0;var i=t.pstyle(e.name);return"label"===i.strValue?(t.recalculateRenderedStyle(),n.rstyle[e.labelName]||0):i.pfValue}return 1}},vl["outer"+e.uppercaseName]=function(){var t=this[0],n=t._private.cy._private.styleEnabled;if(t)return n?t[e.name]()+t.pstyle("border-width").pfValue+2*t.padding():1},vl["rendered"+e.uppercaseName]=function(){var t=this[0];if(t)return t[e.name]()*this.cy().zoom()},vl["rendered"+e.uppercaseOuterName]=function(){var t=this[0];if(t)return t[e.outerName]()*this.cy().zoom()}};bl({name:"width"}),bl({name:"height"}),yl.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},yl.paddedHeight=function(){var e=this[0];return e.height()+2*e.padding()},yl.paddedWidth=function(){var e=this[0];return e.width()+2*e.padding()};var xl=yl,wl=function(e,t){if(e.isEdge())return t(e)},El=function(e,t){if(e.isEdge()){var n=e.cy();return hn(t(e),n.zoom(),n.pan())}},Tl=function(e,t){if(e.isEdge()){var n=e.cy(),r=n.pan(),i=n.zoom();return t(e).map((function(e){return hn(e,i,r)}))}},_l={controlPoints:{get:function(e){return e.renderer().getControlPoints(e)},mult:!0},segmentPoints:{get:function(e){return e.renderer().getSegmentPoints(e)},mult:!0},sourceEndpoint:{get:function(e){return e.renderer().getSourceEndpoint(e)}},targetEndpoint:{get:function(e){return e.renderer().getTargetEndpoint(e)}},midpoint:{get:function(e){return e.renderer().getEdgeMidpoint(e)}}},Dl=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},Cl=Object.keys(_l).reduce((function(e,t){var n=_l[t],r=Dl(t);return e[t]=function(){return wl(this,n.get)},n.mult?e[r]=function(){return Tl(this,n.get)}:e[r]=function(){return El(this,n.get)},e}),{}),Nl=Q({},nl,ml,xl,Cl),Al=function(e,t){this.recycle(e,t)};function Ll(){return!1}function Sl(){return!0}Al.prototype={instanceString:function(){return"event"},recycle:function(e,t){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Ll,null!=e&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?Sl:Ll):null!=e&&e.type?t=e:this.type=e,null!=t&&(this.originalEvent=t.originalEvent,this.type=null!=t.type?t.type:this.type,this.cy=t.cy,this.target=t.target,this.position=t.position,this.renderedPosition=t.renderedPosition,this.namespace=t.namespace,this.layout=t.layout),null!=this.cy&&null!=this.position&&null==this.renderedPosition){var n=this.position,r=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:n.x*r+i.x,y:n.y*r+i.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=Sl;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=Sl;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Sl,this.stopPropagation()},isDefaultPrevented:Ll,isPropagationStopped:Ll,isImmediatePropagationStopped:Ll};var Ol=/^([^.]+)(\.(?:[^.]+))?$/,Il=".*",kl={qualifierCompare:function(e,t){return e===t},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},Ml=Object.keys(kl),Pl={};function Rl(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Pl,t=arguments.length>1?arguments[1]:void 0,n=0;n<Ml.length;n++){var r=Ml[n];this[r]=e[r]||kl[r]}this.context=t||this.context,this.listeners=[],this.emitting=0}var Bl=Rl.prototype,Fl=function(e,t,n,r,i,a,o){x(r)&&(i=r,r=null),o&&(a=null==a?o:Q({},a,o));for(var s=w(n)?n:n.split(/\s+/),l=0;l<s.length;l++){var u=s[l];if(!k(u)){var c=u.match(Ol);if(c&&!1===t(e,u,c[1],c[2]?c[2]:null,r,i,a))break}}},zl=function(e,t){return e.addEventFields(e.context,t),new Al(t.type,t)},Gl=function(e,t,n){if(I(n))t(e,n);else if(E(n))t(e,zl(e,n));else for(var r=w(n)?n:n.split(/\s+/),i=0;i<r.length;i++){var a=r[i];if(!k(a)){var o=a.match(Ol);if(o){var s=o[1],l=o[2]?o[2]:null;t(e,zl(e,{type:s,namespace:l,target:e.context}))}}}};Bl.on=Bl.addListener=function(e,t,n,r,i){return Fl(this,(function(e,t,n,r,i,a,o){x(a)&&e.listeners.push({event:t,callback:a,type:n,namespace:r,qualifier:i,conf:o})}),e,t,n,r,i),this},Bl.one=function(e,t,n,r){return this.on(e,t,n,r,{one:!0})},Bl.removeListener=Bl.off=function(e,t,n,r){var i=this;0!==this.emitting&&(this.listeners=St(this.listeners));for(var a=this.listeners,o=function(o){var s=a[o];Fl(i,(function(t,n,r,i,l,u){if((s.type===r||"*"===e)&&(!i&&".*"!==s.namespace||s.namespace===i)&&(!l||t.qualifierCompare(s.qualifier,l))&&(!u||s.callback===u))return a.splice(o,1),!1}),e,t,n,r)},s=a.length-1;s>=0;s--)o(s);return this},Bl.removeAllListeners=function(){return this.removeListener("*")},Bl.emit=Bl.trigger=function(e,t,n){var r=this.listeners,i=r.length;return this.emitting++,w(t)||(t=[t]),Gl(this,(function(e,a){null!=n&&(r=[{event:a.event,type:a.type,namespace:a.namespace,callback:n}],i=r.length);for(var o=function(n){var i=r[n];if(i.type===a.type&&(!i.namespace||i.namespace===a.namespace||i.namespace===Il)&&e.eventMatches(e.context,i,a)){var o=[a];null!=t&&Bt(o,t),e.beforeEmit(e.context,i,a),i.conf&&i.conf.one&&(e.listeners=e.listeners.filter((function(e){return e!==i})));var s=e.callbackContext(e.context,i,a),l=i.callback.apply(s,o);e.afterEmit(e.context,i,a),!1===l&&(a.stopPropagation(),a.preventDefault())}},s=0;s<i;s++)o(s);e.bubble(e.context)&&!a.isPropagationStopped()&&e.parent(e.context).emit(a,t)}),e),this.emitting--,this};var Yl={qualifierCompare:function(e,t){return null==e||null==t?null==e&&null==t:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return null==r||e!==n.target&&A(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e.cy(),t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e},beforeEmit:function(e,t){t.conf&&t.conf.once&&t.conf.onceCollection.removeListener(t.event,t.qualifier,t.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},Xl=function(e){return b(e)?new Ps(e):e},Vl={createEmitter:function(){for(var e=0;e<this.length;e++){var t=this[e],n=t._private;n.emitter||(n.emitter=new Rl(Yl,t))}return this},emitter:function(){return this._private.emitter},on:function(e,t,n){for(var r=Xl(t),i=0;i<this.length;i++)this[i].emitter().on(e,r,n);return this},removeListener:function(e,t,n){for(var r=Xl(t),i=0;i<this.length;i++)this[i].emitter().removeListener(e,r,n);return this},removeAllListeners:function(){for(var e=0;e<this.length;e++)this[e].emitter().removeAllListeners();return this},one:function(e,t,n){for(var r=Xl(t),i=0;i<this.length;i++)this[i].emitter().one(e,r,n);return this},once:function(e,t,n){for(var r=Xl(t),i=0;i<this.length;i++)this[i].emitter().on(e,r,n,{once:!0,onceCollection:this})},emit:function(e,t){for(var n=0;n<this.length;n++)this[n].emitter().emit(e,t);return this},emitAndNotify:function(e,t){if(0!==this.length)return this.cy().notify(e,this),this.emit(e,t),this}};hs.eventAliasesOn(Vl);var Ul={nodes:function(e){return this.filter((function(e){return e.isNode()})).filter(e)},edges:function(e){return this.filter((function(e){return e.isEdge()})).filter(e)},byGroup:function(){for(var e=this.spawn(),t=this.spawn(),n=0;n<this.length;n++){var r=this[n];r.isNode()?e.push(r):t.push(r)}return{nodes:e,edges:t}},filter:function(e,t){if(void 0===e)return this;if(b(e)||N(e))return new Ps(e).filter(this);if(x(e)){for(var n=this.spawn(),r=this,i=0;i<r.length;i++){var a=r[i];(t?e.apply(t,[a,i,r]):e(a,i,r))&&n.push(a)}return n}return this.spawn()},not:function(e){if(e){b(e)&&(e=this.filter(e));for(var t=this.spawn(),n=0;n<this.length;n++){var r=this[n];e.has(r)||t.push(r)}return t}return this},absoluteComplement:function(){return this.cy().mutableElements().not(this)},intersect:function(e){if(b(e)){var t=e;return this.filter(t)}for(var n=this.spawn(),r=this,i=e,a=this.length<e.length,o=a?r:i,s=a?i:r,l=0;l<o.length;l++){var u=o[l];s.has(u)&&n.push(u)}return n},xor:function(e){var t=this._private.cy;b(e)&&(e=t.$(e));var n=this.spawn(),r=this,i=e,a=function(e,t){for(var r=0;r<e.length;r++){var i=e[r],a=i._private.data.id;t.hasElementWithId(a)||n.push(i)}};return a(r,i),a(i,r),n},diff:function(e){var t=this._private.cy;b(e)&&(e=t.$(e));var n=this.spawn(),r=this.spawn(),i=this.spawn(),a=this,o=e,s=function(e,t,n){for(var r=0;r<e.length;r++){var a=e[r],o=a._private.data.id;t.hasElementWithId(o)?i.merge(a):n.push(a)}};return s(a,o,n),s(o,a,r),{left:n,right:r,both:i}},add:function(e){var t=this._private.cy;if(!e)return this;if(b(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=this.spawnSelf(),i=0;i<e.length;i++){var a=e[i],o=!this.has(a);o&&r.push(a)}return r},merge:function(e){var t=this._private,n=t.cy;if(!e)return this;if(e&&b(e)){var r=e;e=n.mutableElements().filter(r)}for(var i=t.map,a=0;a<e.length;a++){var o=e[a],s=o._private.data.id;if(!i.has(s)){var l=this.length++;this[l]=o,i.set(s,{ele:o,index:l})}}return this},unmergeAt:function(e){var t=this[e].id(),n=this._private.map;this[e]=void 0,n.delete(t);var r=e===this.length-1;if(this.length>1&&!r){var i=this.length-1,a=this[i],o=a._private.data.id;this[i]=void 0,this[e]=a,n.set(o,{ele:a,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,n=e._private.data.id,r=t.map.get(n);if(!r)return this;var i=r.index;return this.unmergeAt(i),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&b(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=0;r<e.length;r++)this.unmergeOne(e[r]);return this},unmergeBy:function(e){for(var t=this.length-1;t>=0;t--)e(this[t])&&this.unmergeAt(t);return this},map:function(e,t){for(var n=[],r=this,i=0;i<r.length;i++){var a=r[i],o=t?e.apply(t,[a,i,r]):e(a,i,r);n.push(o)}return n},reduce:function(e,t){for(var n=t,r=this,i=0;i<r.length;i++)n=e(n,r[i],i,r);return n},max:function(e,t){for(var n,r=-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>r&&(r=s,n=o)}return{value:r,ele:n}},min:function(e,t){for(var n,r=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<r&&(r=s,n=o)}return{value:r,ele:n}}},jl=Ul;jl.u=jl["|"]=jl["+"]=jl.union=jl.or=jl.add,jl["\\"]=jl["!"]=jl["-"]=jl.difference=jl.relativeComplement=jl.subtract=jl.not,jl.n=jl["&"]=jl["."]=jl.and=jl.intersection=jl.intersect,jl["^"]=jl["(+)"]=jl["(-)"]=jl.symmetricDifference=jl.symdiff=jl.xor,jl.fnFilter=jl.filterFn=jl.stdFilter=jl.filter,jl.complement=jl.abscomp=jl.absoluteComplement;var Hl,ql={isNode:function(){return"nodes"===this.group()},isEdge:function(){return"edges"===this.group()},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},Wl=function(e,t){var n=e.cy().hasCompoundNodes();function r(e){var t=e.pstyle("z-compound-depth");return"auto"===t.value?n?e.zDepth():0:"bottom"===t.value?-1:"top"===t.value?xt:0}var i=r(e)-r(t);if(0!==i)return i;function a(e){return"auto"===e.pstyle("z-index-compare").value&&e.isNode()?1:0}var o=a(e)-a(t);if(0!==o)return o;var s=e.pstyle("z-index").value-t.pstyle("z-index").value;return 0!==s?s:e.poolIndex()-t.poolIndex()},$l={forEach:function(e,t){if(x(e))for(var n=this.length,r=0;r<n;r++){var i=this[r];if(!1===(t?e.apply(t,[i,r,this]):e(i,r,this)))break}return this},toArray:function(){for(var e=[],t=0;t<this.length;t++)e.push(this[t]);return e},slice:function(e,t){var n=[],r=this.length;null==t&&(t=r),null==e&&(e=0),e<0&&(e=r+e),t<0&&(t=r+t);for(var i=e;i>=0&&i<t&&i<r;i++)n.push(this[i]);return this.spawn(n)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return 0===this.length},nonempty:function(){return!this.empty()},sort:function(e){if(!x(e))return this;var t=this.toArray().sort(e);return this.spawn(t)},sortByZIndex:function(){return this.sort(Wl)},zDepth:function(){var e=this[0];if(e){var t=e._private;if("nodes"===t.group){var n=t.data.parent?e.parents().size():0;return e.isParent()?n:xt-1}var r=t.source,i=t.target,a=r.zDepth(),o=i.zDepth();return Math.max(a,o,0)}}};$l.each=$l.forEach,Hl="undefined",("undefined"==typeof Symbol?"undefined":e(Symbol))!=Hl&&e(Symbol.iterator)!=Hl&&($l[Symbol.iterator]=function(){var e=this,t={value:void 0,done:!1},n=0,r=this.length;return a({next:function(){return n<r?t.value=e[n++]:(t.value=void 0,t.done=!0),t}},Symbol.iterator,(function(){return this}))});var Zl=Mt({nodeDimensionsIncludeLabels:!1}),Kl={layoutDimensions:function(e){var t;if(e=Zl(e),this.takesUpSpace())if(e.nodeDimensionsIncludeLabels){var n=this.boundingBox();t={w:n.w,h:n.h}}else t={w:this.outerWidth(),h:this.outerHeight()};else t={w:0,h:0};return 0!==t.w&&0!==t.h||(t.w=t.h=1),t},layoutPositions:function(e,t,n){var r=this.nodes().filter((function(e){return!e.isParent()})),i=this.cy(),a=t.eles,o=function(e){return e.id()},s=F(n,o);e.emit({type:"layoutstart",layout:e}),e.animations=[];var l=function(e,t,n){var r={x:t.x1+t.w/2,y:t.y1+t.h/2},i={x:(n.x-r.x)*e,y:(n.y-r.y)*e};return{x:r.x+i.x,y:r.y+i.y}},u=t.spacingFactor&&1!==t.spacingFactor,c=function(){if(!u)return null;for(var e=Ln(),t=0;t<r.length;t++){var n=r[t],i=s(n,t);kn(e,i.x,i.y)}return e},h=c(),d=F((function(e,n){var r=s(e,n);if(u){var i=Math.abs(t.spacingFactor);r=l(i,h,r)}return null!=t.transform&&(r=t.transform(e,r)),r}),o);if(t.animate){for(var p=0;p<r.length;p++){var g=r[p],f=d(g,p);if(null==t.animateFilter||t.animateFilter(g,p)){var v=g.animation({position:f,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(v)}else g.position(f)}if(t.fit){var y=i.animation({fit:{boundingBox:a.boundingBoxAt(d),padding:t.padding},duration:t.animationDuration,easing:t.animationEasing});e.animations.push(y)}else if(void 0!==t.zoom&&void 0!==t.pan){var m=i.animation({zoom:t.zoom,pan:t.pan,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(m)}e.animations.forEach((function(e){return e.play()})),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),Gi.all(e.animations.map((function(e){return e.promise()}))).then((function(){e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e})}))}else r.positions(d),t.fit&&i.fit(t.eles,t.padding),null!=t.zoom&&i.zoom(t.zoom),t.pan&&i.pan(t.pan),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){return this.cy().makeLayout(Q({},e,{eles:this}))}};function Ql(e,t,n){var r,i=n._private,a=i.styleCache=i.styleCache||[];return null!=(r=a[e])?r:r=a[e]=t(n)}function Jl(e,t){return e=gt(e),function(n){return Ql(e,t,n)}}function eu(e,t){e=gt(e);var n=function(e){return t.call(e)};return function(){var t=this[0];if(t)return Ql(e,n,t)}}Kl.createLayout=Kl.makeLayout=Kl.layout;var tu={recalculateRenderedStyle:function(e){var t=this.cy(),n=t.renderer(),r=t.styleEnabled();return n&&r&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e,t=this.cy(),n=function(e){return e._private.styleCache=null};return t.hasCompoundNodes()?((e=this.spawnSelf().merge(this.descendants()).merge(this.parents())).merge(e.connectedEdges()),e.forEach(n)):this.forEach((function(e){n(e),e.connectedEdges().forEach(n)})),this},updateStyle:function(e){var t=this._private.cy;if(!t.styleEnabled())return this;if(t.batching())return t._private.batchStyleEles.merge(this),this;var n=this;e=!(!e&&void 0!==e),t.hasCompoundNodes()&&(n=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var r=n;return e?r.emitAndNotify("style"):r.emit("style"),n.forEach((function(e){return e._private.styleDirty=!0})),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var t=0;t<this.length;t++){var n=this[t];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},parsedStyle:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this[0],r=n.cy();if(r.styleEnabled()&&n){this.cleanStyle();var i=n._private.style[e];return null!=i?i:t?r.style().getDefaultProperty(e):null}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var n=t.pstyle(e);return void 0!==n.pfValue?n.pfValue:n.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled())return t?t.pstyle(e).units:void 0},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=this[0];return n?t.style().getRenderedStyle(n,e):void 0},style:function(e,t){var n=this.cy();if(!n.styleEnabled())return this;var r=!1,i=n.style();if(E(e)){var a=e;i.applyBypass(this,a,r),this.emitAndNotify("style")}else if(b(e)){if(void 0===t){var o=this[0];return o?i.getStylePropertyValue(o,e):void 0}i.applyBypass(this,e,t,r),this.emitAndNotify("style")}else if(void 0===e){var s=this[0];return s?i.getRawStyle(s):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=!1,r=t.style(),i=this;if(void 0===e)for(var a=0;a<i.length;a++){var o=i[a];r.removeAllBypasses(o,n)}else{e=e.split(/\s+/);for(var s=0;s<i.length;s++){var l=i[s];r.removeBypasses(l,e,n)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var t=e.hasCompoundNodes(),n=this[0];if(n){var r=n._private,i=n.pstyle("opacity").value;if(!t)return i;var a=r.data.parent?n.parents():null;if(a)for(var o=0;o<a.length;o++)i*=a[o].pstyle("opacity").value;return i}},transparent:function(){if(!this.cy().styleEnabled())return!1;var e=this[0],t=e.cy().hasCompoundNodes();return e?t?0===e.effectiveOpacity():0===e.pstyle("opacity").value:void 0},backgrounding:function(){return!!this.cy().styleEnabled()&&!!this[0]._private.backgrounding}};function nu(e,t){var n=e._private.data.parent?e.parents():null;if(n)for(var r=0;r<n.length;r++)if(!t(n[r]))return!1;return!0}function ru(e){var t=e.ok,n=e.edgeOkViaNode||e.ok,r=e.parentOk||e.ok;return function(){var e=this.cy();if(!e.styleEnabled())return!0;var i=this[0],a=e.hasCompoundNodes();if(i){var o=i._private;if(!t(i))return!1;if(i.isNode())return!a||nu(i,r);var s=o.source,l=o.target;return n(s)&&(!a||nu(s,n))&&(s===l||n(l)&&(!a||nu(l,n)))}}}var iu=Jl("eleTakesUpSpace",(function(e){return"element"===e.pstyle("display").value&&0!==e.width()&&(!e.isNode()||0!==e.height())}));tu.takesUpSpace=eu("takesUpSpace",ru({ok:iu}));var au=Jl("eleInteractive",(function(e){return"yes"===e.pstyle("events").value&&"visible"===e.pstyle("visibility").value&&iu(e)})),ou=Jl("parentInteractive",(function(e){return"visible"===e.pstyle("visibility").value&&iu(e)}));tu.interactive=eu("interactive",ru({ok:au,parentOk:ou,edgeOkViaNode:iu})),tu.noninteractive=function(){var e=this[0];if(e)return!e.interactive()};var su=Jl("eleVisible",(function(e){return"visible"===e.pstyle("visibility").value&&0!==e.pstyle("opacity").pfValue&&iu(e)})),lu=iu;tu.visible=eu("visible",ru({ok:su,edgeOkViaNode:lu})),tu.hidden=function(){var e=this[0];if(e)return!e.visible()},tu.isBundledBezier=eu("isBundledBezier",(function(){return!!this.cy().styleEnabled()&&!this.removed()&&"bezier"===this.pstyle("curve-style").value&&this.takesUpSpace()})),tu.bypass=tu.css=tu.style,tu.renderedCss=tu.renderedStyle,tu.removeBypass=tu.removeCss=tu.removeStyle,tu.pstyle=tu.parsedStyle;var uu={};function cu(e){return function(){var t=arguments,n=[];if(2===t.length){var r=t[0],i=t[1];this.on(e.event,r,i)}else if(1===t.length&&x(t[0])){var a=t[0];this.on(e.event,a)}else if(0===t.length||1===t.length&&w(t[0])){for(var o=1===t.length?t[0]:null,s=0;s<this.length;s++){var l=this[s],u=!e.ableField||l._private[e.ableField],c=l._private[e.field]!=e.value;if(e.overrideAble){var h=e.overrideAble(l);if(void 0!==h&&(u=h,!h))return this}u&&(l._private[e.field]=e.value,c&&n.push(l))}var d=this.spawn(n);d.updateStyle(),d.emit(e.event),o&&d.emit(o)}return this}}function hu(e){uu[e.field]=function(){var t=this[0];if(t){if(e.overrideField){var n=e.overrideField(t);if(void 0!==n)return n}return t._private[e.field]}},uu[e.on]=cu({event:e.on,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!0}),uu[e.off]=cu({event:e.off,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!1})}hu({field:"locked",overrideField:function(e){return!!e.cy().autolock()||void 0},on:"lock",off:"unlock"}),hu({field:"grabbable",overrideField:function(e){return!e.cy().autoungrabify()&&!e.pannable()&&void 0},on:"grabify",off:"ungrabify"}),hu({field:"selected",ableField:"selectable",overrideAble:function(e){return!e.cy().autounselectify()&&void 0},on:"select",off:"unselect"}),hu({field:"selectable",overrideField:function(e){return!e.cy().autounselectify()&&void 0},on:"selectify",off:"unselectify"}),uu.deselect=uu.unselect,uu.grabbed=function(){var e=this[0];if(e)return e._private.grabbed},hu({field:"active",on:"activate",off:"unactivate"}),hu({field:"pannable",on:"panify",off:"unpanify"}),uu.inactive=function(){var e=this[0];if(e)return!e._private.active};var du={},pu=function(e){return function(t){for(var n=this,r=[],i=0;i<n.length;i++){var a=n[i];if(a.isNode()){for(var o=!1,s=a.connectedEdges(),l=0;l<s.length;l++){var u=s[l],c=u.source(),h=u.target();if(e.noIncomingEdges&&h===a&&c!==a||e.noOutgoingEdges&&c===a&&h!==a){o=!0;break}}o||r.push(a)}}return this.spawn(r,!0).filter(t)}},gu=function(e){return function(t){for(var n=this,r=[],i=0;i<n.length;i++){var a=n[i];if(a.isNode())for(var o=a.connectedEdges(),s=0;s<o.length;s++){var l=o[s],u=l.source(),c=l.target();e.outgoing&&u===a?(r.push(l),r.push(c)):e.incoming&&c===a&&(r.push(l),r.push(u))}}return this.spawn(r,!0).filter(t)}},fu=function(e){return function(t){for(var n=this,r=[],i={};;){var a=e.outgoing?n.outgoers():n.incomers();if(0===a.length)break;for(var o=!1,s=0;s<a.length;s++){var l=a[s],u=l.id();i[u]||(i[u]=!0,r.push(l),o=!0)}if(!o)break;n=a}return this.spawn(r,!0).filter(t)}};function vu(e){return function(t){for(var n=[],r=0;r<this.length;r++){var i=this[r]._private[e.attr];i&&n.push(i)}return this.spawn(n,!0).filter(t)}}function yu(e){return function(t){var n=[],r=this._private.cy,i=e||{};b(t)&&(t=r.$(t));for(var a=0;a<t.length;a++)for(var o=t[a]._private.edges,s=0;s<o.length;s++){var l=o[s],u=l._private.data,c=this.hasElementWithId(u.source)&&t.hasElementWithId(u.target),h=t.hasElementWithId(u.source)&&this.hasElementWithId(u.target);if(c||h){if(i.thisIsSrc||i.thisIsTgt){if(i.thisIsSrc&&!c)continue;if(i.thisIsTgt&&!h)continue}n.push(l)}}return this.spawn(n,!0)}}function mu(e){return e=Q({},{codirected:!1},e),function(t){for(var n=[],r=this.edges(),i=e,a=0;a<r.length;a++)for(var o=r[a]._private,s=o.source,l=s._private.data.id,u=o.data.target,c=s._private.edges,h=0;h<c.length;h++){var d=c[h],p=d._private.data,g=p.target,f=p.source,v=g===u&&f===l,y=l===g&&u===f;(i.codirected&&v||!i.codirected&&(v||y))&&n.push(d)}return this.spawn(n,!0).filter(t)}}du.clearTraversalCache=function(){for(var e=0;e<this.length;e++)this[e]._private.traversalCache=null},Q(du,{roots:pu({noIncomingEdges:!0}),leaves:pu({noOutgoingEdges:!0}),outgoers:Gs(gu({outgoing:!0}),"outgoers"),successors:fu({outgoing:!0}),incomers:Gs(gu({incoming:!0}),"incomers"),predecessors:fu({incoming:!0})}),Q(du,{neighborhood:Gs((function(e){for(var t=[],n=this.nodes(),r=0;r<n.length;r++)for(var i=n[r],a=i.connectedEdges(),o=0;o<a.length;o++){var s=a[o],l=s.source(),u=s.target(),c=i===l?u:l;c.length>0&&t.push(c[0]),t.push(s[0])}return this.spawn(t,!0).filter(e)}),"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),du.neighbourhood=du.neighborhood,du.closedNeighbourhood=du.closedNeighborhood,du.openNeighbourhood=du.openNeighborhood,Q(du,{source:Gs((function(e){var t,n=this[0];return n&&(t=n._private.source||n.cy().collection()),t&&e?t.filter(e):t}),"source"),target:Gs((function(e){var t,n=this[0];return n&&(t=n._private.target||n.cy().collection()),t&&e?t.filter(e):t}),"target"),sources:vu({attr:"source"}),targets:vu({attr:"target"})}),Q(du,{edgesWith:Gs(yu(),"edgesWith"),edgesTo:Gs(yu({thisIsSrc:!0}),"edgesTo")}),Q(du,{connectedEdges:Gs((function(e){for(var t=[],n=this,r=0;r<n.length;r++){var i=n[r];if(i.isNode())for(var a=i._private.edges,o=0;o<a.length;o++){var s=a[o];t.push(s)}}return this.spawn(t,!0).filter(e)}),"connectedEdges"),connectedNodes:Gs((function(e){for(var t=[],n=this,r=0;r<n.length;r++){var i=n[r];i.isEdge()&&(t.push(i.source()[0]),t.push(i.target()[0]))}return this.spawn(t,!0).filter(e)}),"connectedNodes"),parallelEdges:Gs(mu(),"parallelEdges"),codirectedEdges:Gs(mu({codirected:!0}),"codirectedEdges")}),Q(du,{components:function(e){var t=this,n=t.cy(),r=n.collection(),i=null==e?t.nodes():e.nodes(),a=[];null!=e&&i.empty()&&(i=e.sources());var o=function(e,t){r.merge(e),i.unmerge(e),t.merge(e)};if(i.empty())return t.spawn();var s=function(){var e=n.collection();a.push(e);var r=i[0];o(r,e),t.bfs({directed:!1,roots:r,visit:function(t){return o(t,e)}}),e.forEach((function(n){n.connectedEdges().forEach((function(n){t.has(n)&&e.has(n.source())&&e.has(n.target())&&e.merge(n)}))}))};do{s()}while(i.length>0);return a},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),du.componentsOf=du.components;var bu=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(void 0!==e){var i=new Yt,a=!1;if(t){if(t.length>0&&E(t[0])&&!A(t[0])){a=!0;for(var o=[],s=new Ut,l=0,u=t.length;l<u;l++){var c=t[l];null==c.data&&(c.data={});var h=c.data;if(null==h.id)h.id=Ot();else if(e.hasElementWithId(h.id)||s.has(h.id))continue;var d=new jt(e,c,!1);o.push(d),s.add(h.id)}t=o}}else t=[];this.length=0;for(var p=0,g=t.length;p<g;p++){var f=t[p][0];if(null!=f){var v=f._private.data.id;n&&i.has(v)||(n&&i.set(v,{index:this.length,ele:f}),this[this.length]=f,this.length++)}}this._private={eles:this,cy:e,get map(){return null==this.lazyMap&&this.rebuildMap(),this.lazyMap},set map(e){this.lazyMap=e},rebuildMap:function(){for(var e=this.lazyMap=new Yt,t=this.eles,n=0;n<t.length;n++){var r=t[n];e.set(r.id(),{index:n,ele:r})}}},n&&(this._private.map=i),a&&!r&&this.restore()}else Dt("A collection must have a reference to the core")},xu=jt.prototype=bu.prototype=Object.create(Array.prototype);xu.instanceString=function(){return"collection"},xu.spawn=function(e,t){return new bu(this.cy(),e,t)},xu.spawnSelf=function(){return this.spawn(this)},xu.cy=function(){return this._private.cy},xu.renderer=function(){return this._private.cy.renderer()},xu.element=function(){return this[0]},xu.collection=function(){return L(this)?this:new bu(this._private.cy,[this])},xu.unique=function(){return new bu(this._private.cy,this,!0)},xu.hasElementWithId=function(e){return e=""+e,this._private.map.has(e)},xu.getElementById=function(e){e=""+e;var t=this._private.cy,n=this._private.map.get(e);return n?n.ele:new bu(t)},xu.$id=xu.getElementById,xu.poolIndex=function(){var e=this._private.cy._private.elements,t=this[0]._private.data.id;return e._private.map.get(t).index},xu.indexOf=function(e){var t=e[0]._private.data.id;return this._private.map.get(t).index},xu.indexOfId=function(e){return e=""+e,this._private.map.get(e).index},xu.json=function(e){var t=this.element(),n=this.cy();if(null==t&&e)return this;if(null!=t){var r=t._private;if(E(e)){if(n.startBatch(),e.data){t.data(e.data);var i=r.data;if(t.isEdge()){var a=!1,o={},s=e.data.source,l=e.data.target;null!=s&&s!=i.source&&(o.source=""+s,a=!0),null!=l&&l!=i.target&&(o.target=""+l,a=!0),a&&(t=t.move(o))}else{var u="parent"in e.data,c=e.data.parent;!u||null==c&&null==i.parent||c==i.parent||(void 0===c&&(c=null),null!=c&&(c=""+c),t=t.move({parent:c}))}}e.position&&t.position(e.position);var h=function(n,i,a){var o=e[n];null!=o&&o!==r[n]&&(o?t[i]():t[a]())};return h("removed","remove","restore"),h("selected","select","unselect"),h("selectable","selectify","unselectify"),h("locked","lock","unlock"),h("grabbable","grabify","ungrabify"),h("pannable","panify","unpanify"),null!=e.classes&&t.classes(e.classes),n.endBatch(),this}if(void 0===e){var d={data:Lt(r.data),position:Lt(r.position),group:r.group,removed:r.removed,selected:r.selected,selectable:r.selectable,locked:r.locked,grabbable:r.grabbable,pannable:r.pannable,classes:null};d.classes="";var p=0;return r.classes.forEach((function(e){return d.classes+=0==p++?e:" "+e})),d}}},xu.jsons=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t].json();e.push(n)}return e},xu.clone=function(){for(var e=this.cy(),t=[],n=0;n<this.length;n++){var r=this[n].json(),i=new jt(e,r,!1);t.push(i)}return new bu(e,t)},xu.copy=xu.clone,xu.restore=function(){for(var e,t,n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this,a=i.cy(),o=a._private,s=[],l=[],u=0,c=i.length;u<c;u++){var h=i[u];r&&!h.removed()||(h.isNode()?s.push(h):l.push(h))}e=s.concat(l);var d=function(){e.splice(t,1),t--};for(t=0;t<e.length;t++){var p=e[t],g=p._private,f=g.data;if(p.clearTraversalCache(),r||g.removed)if(void 0===f.id)f.id=Ot();else if(_(f.id))f.id=""+f.id;else{if(k(f.id)||!b(f.id)){Dt("Can not create element with invalid string ID `"+f.id+"`"),d();continue}if(a.hasElementWithId(f.id)){Dt("Can not create second element with ID `"+f.id+"`"),d();continue}}var v=f.id;if(p.isNode()){var y=g.position;null==y.x&&(y.x=0),null==y.y&&(y.y=0)}if(p.isEdge()){for(var m=p,x=["source","target"],w=x.length,E=!1,T=0;T<w;T++){var D=x[T],C=f[D];_(C)&&(C=f[D]=""+f[D]),null==C||""===C?(Dt("Can not create edge `"+v+"` with unspecified "+D),E=!0):a.hasElementWithId(C)||(Dt("Can not create edge `"+v+"` with nonexistant "+D+" `"+C+"`"),E=!0)}if(E){d();continue}var N=a.getElementById(f.source),A=a.getElementById(f.target);N.same(A)?N._private.edges.push(m):(N._private.edges.push(m),A._private.edges.push(m)),m._private.source=N,m._private.target=A}g.map=new Yt,g.map.set(v,{ele:p,index:0}),g.removed=!1,r&&a.addToPool(p)}for(var L=0;L<s.length;L++){var S=s[L],O=S._private.data;_(O.parent)&&(O.parent=""+O.parent);var I=O.parent;if(null!=I||S._private.parent){var M=S._private.parent?a.collection().merge(S._private.parent):a.getElementById(I);if(M.empty())O.parent=void 0;else if(M[0].removed())Nt("Node added with missing parent, reference to parent removed"),O.parent=void 0,S._private.parent=null;else{for(var P=!1,R=M;!R.empty();){if(S.same(R)){P=!0,O.parent=void 0;break}R=R.parent()}P||(M[0]._private.children.push(S),S._private.parent=M[0],o.hasCompoundNodes=!0)}}}if(e.length>0){for(var B=e.length===i.length?i:new bu(a,e),F=0;F<B.length;F++){var z=B[F];z.isNode()||(z.parallelEdges().clearTraversalCache(),z.source().clearTraversalCache(),z.target().clearTraversalCache())}(o.hasCompoundNodes?a.collection().merge(B).merge(B.connectedNodes()).merge(B.parent()):B).dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(n),n?B.emitAndNotify("add"):r&&B.emit("add")}return i},xu.removed=function(){var e=this[0];return e&&e._private.removed},xu.inside=function(){var e=this[0];return e&&!e._private.removed},xu.remove=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this,r=[],i={},a=n._private.cy;function o(e){for(var t=e._private.edges,n=0;n<t.length;n++)l(t[n])}function s(e){for(var t=e._private.children,n=0;n<t.length;n++)l(t[n])}function l(e){var n=i[e.id()];t&&e.removed()||n||(i[e.id()]=!0,e.isNode()?(r.push(e),o(e),s(e)):r.unshift(e))}for(var u=0,c=n.length;u<c;u++)l(n[u]);function h(e,t){var n=e._private.edges;Pt(n,t),e.clearTraversalCache()}function d(e){e.clearTraversalCache()}var p=[];function g(e,t){t=t[0];var n=(e=e[0])._private.children,r=e.id();Pt(n,t),t._private.parent=null,p.ids[r]||(p.ids[r]=!0,p.push(e))}p.ids={},n.dirtyCompoundBoundsCache(),t&&a.removeFromPool(r);for(var f=0;f<r.length;f++){var v=r[f];if(v.isEdge()){var y=v.source()[0],m=v.target()[0];h(y,v),h(m,v);for(var b=v.parallelEdges(),x=0;x<b.length;x++){var w=b[x];d(w),w.isBundledBezier()&&w.dirtyBoundingBoxCache()}}else{var E=v.parent();0!==E.length&&g(E,v)}t&&(v._private.removed=!0)}var T=a._private.elements;a._private.hasCompoundNodes=!1;for(var _=0;_<T.length;_++)if(T[_].isParent()){a._private.hasCompoundNodes=!0;break}var D=new bu(this.cy(),r);D.size()>0&&(e?D.emitAndNotify("remove"):t&&D.emit("remove"));for(var C=0;C<p.length;C++){var N=p[C];t&&N.removed()||N.updateStyle()}return D},xu.move=function(e){var t=this._private.cy,n=this,r=!1,i=!1,a=function(e){return null==e?e:""+e};if(void 0!==e.source||void 0!==e.target){var o=a(e.source),s=a(e.target),l=null!=o&&t.hasElementWithId(o),u=null!=s&&t.hasElementWithId(s);(l||u)&&(t.batch((function(){n.remove(r,i),n.emitAndNotify("moveout");for(var e=0;e<n.length;e++){var t=n[e],a=t._private.data;t.isEdge()&&(l&&(a.source=o),u&&(a.target=s))}n.restore(r,i)})),n.emitAndNotify("move"))}else if(void 0!==e.parent){var c=a(e.parent);if(null===c||t.hasElementWithId(c)){var h=null===c?void 0:c;t.batch((function(){var e=n.remove(r,i);e.emitAndNotify("moveout");for(var t=0;t<n.length;t++){var a=n[t],o=a._private.data;a.isNode()&&(o.parent=h)}e.restore(r,i)})),n.emitAndNotify("move")}}return this},[Si,ds,ps,Bs,Ys,Ws,$s,Nl,Vl,Ul,ql,$l,Kl,tu,uu,du].forEach((function(e){Q(xu,e)}));var wu={add:function(e){var t,n=this;if(N(e)){var r=e;if(r._private.cy===n)t=r.restore();else{for(var i=[],a=0;a<r.length;a++){var o=r[a];i.push(o.json())}t=new bu(n,i)}}else if(w(e))t=new bu(n,e);else if(E(e)&&(w(e.nodes)||w(e.edges))){for(var s=e,l=[],u=["nodes","edges"],c=0,h=u.length;c<h;c++){var d=u[c],p=s[d];if(w(p))for(var g=0,f=p.length;g<f;g++){var v=Q({group:d},p[g]);l.push(v)}}t=new bu(n,l)}else t=new jt(n,e).collection();return t},remove:function(e){if(N(e));else if(b(e)){var t=e;e=this.$(t)}return e.remove()}};function Eu(e,t,n,r){var i=4,a=.001,o=1e-7,s=10,l=11,u=1/(l-1),c="undefined"!=typeof Float32Array;if(4!==arguments.length)return!1;for(var h=0;h<4;++h)if("number"!=typeof arguments[h]||isNaN(arguments[h])||!isFinite(arguments[h]))return!1;e=Math.min(e,1),n=Math.min(n,1),e=Math.max(e,0),n=Math.max(n,0);var d=c?new Float32Array(l):new Array(l);function p(e,t){return 1-3*t+3*e}function g(e,t){return 3*t-6*e}function f(e){return 3*e}function v(e,t,n){return((p(t,n)*e+g(t,n))*e+f(t))*e}function y(e,t,n){return 3*p(t,n)*e*e+2*g(t,n)*e+f(t)}function m(t,r){for(var a=0;a<i;++a){var o=y(r,e,n);if(0===o)return r;r-=(v(r,e,n)-t)/o}return r}function b(){for(var t=0;t<l;++t)d[t]=v(t*u,e,n)}function x(t,r,i){var a,l,u=0;do{(a=v(l=r+(i-r)/2,e,n)-t)>0?i=l:r=l}while(Math.abs(a)>o&&++u<s);return l}function w(t){for(var r=0,i=1,o=l-1;i!==o&&d[i]<=t;++i)r+=u;--i;var s=r+(t-d[i])/(d[i+1]-d[i])*u,c=y(s,e,n);return c>=a?m(t,s):0===c?s:x(t,r,r+u)}var E=!1;function T(){E=!0,e===t&&n===r||b()}var _=function(i){return E||T(),e===t&&n===r?i:0===i?0:1===i?1:v(w(i),t,r)};_.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var D="generateBezier("+[e,t,n,r]+")";return _.toString=function(){return D},_}var Tu=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,n,r){var i={x:t.x+r.dx*n,v:t.v+r.dv*n,tension:t.tension,friction:t.friction};return{dx:i.v,dv:e(i)}}function n(n,r){var i={dx:n.v,dv:e(n)},a=t(n,.5*r,i),o=t(n,.5*r,a),s=t(n,r,o),l=1/6*(i.dx+2*(a.dx+o.dx)+s.dx),u=1/6*(i.dv+2*(a.dv+o.dv)+s.dv);return n.x=n.x+l*r,n.v=n.v+u*r,n}return function e(t,r,i){var a,o,s,l={x:-1,v:0,tension:null,friction:null},u=[0],c=0,h=1e-4,d=.016;for(t=parseFloat(t)||500,r=parseFloat(r)||20,i=i||null,l.tension=t,l.friction=r,o=(a=null!==i)?(c=e(t,r))/i*d:d;s=n(s||l,o),u.push(1+s.x),c+=16,Math.abs(s.x)>h&&Math.abs(s.v)>h;);return a?function(e){return u[e*(u.length-1)|0]}:c}}(),_u=function(e,t,n,r){var i=Eu(e,t,n,r);return function(e,t,n){return e+(t-e)*i(n)}},Du={linear:function(e,t,n){return e+(t-e)*n},ease:_u(.25,.1,.25,1),"ease-in":_u(.42,0,1,1),"ease-out":_u(0,0,.58,1),"ease-in-out":_u(.42,0,.58,1),"ease-in-sine":_u(.47,0,.745,.715),"ease-out-sine":_u(.39,.575,.565,1),"ease-in-out-sine":_u(.445,.05,.55,.95),"ease-in-quad":_u(.55,.085,.68,.53),"ease-out-quad":_u(.25,.46,.45,.94),"ease-in-out-quad":_u(.455,.03,.515,.955),"ease-in-cubic":_u(.55,.055,.675,.19),"ease-out-cubic":_u(.215,.61,.355,1),"ease-in-out-cubic":_u(.645,.045,.355,1),"ease-in-quart":_u(.895,.03,.685,.22),"ease-out-quart":_u(.165,.84,.44,1),"ease-in-out-quart":_u(.77,0,.175,1),"ease-in-quint":_u(.755,.05,.855,.06),"ease-out-quint":_u(.23,1,.32,1),"ease-in-out-quint":_u(.86,0,.07,1),"ease-in-expo":_u(.95,.05,.795,.035),"ease-out-expo":_u(.19,1,.22,1),"ease-in-out-expo":_u(1,0,0,1),"ease-in-circ":_u(.6,.04,.98,.335),"ease-out-circ":_u(.075,.82,.165,1),"ease-in-out-circ":_u(.785,.135,.15,.86),spring:function(e,t,n){if(0===n)return Du.linear;var r=Tu(e,t,n);return function(e,t,n){return e+(t-e)*r(n)}},"cubic-bezier":_u};function Cu(e,t,n,r,i){if(1===r)return n;if(t===n)return n;var a=i(t,n,r);return null==e||((e.roundValue||e.color)&&(a=Math.round(a)),void 0!==e.min&&(a=Math.max(a,e.min)),void 0!==e.max&&(a=Math.min(a,e.max))),a}function Nu(e,t){return null!=e.pfValue||null!=e.value?null==e.pfValue||null!=t&&"%"===t.type.units?e.value:e.pfValue:e}function Au(e,t,n,r,i){var a=null!=i?i.type:null;n<0?n=0:n>1&&(n=1);var o=Nu(e,i),s=Nu(t,i);if(_(o)&&_(s))return Cu(a,o,s,n,r);if(w(o)&&w(s)){for(var l=[],u=0;u<s.length;u++){var c=o[u],h=s[u];if(null!=c&&null!=h){var d=Cu(a,c,h,n,r);l.push(d)}else l.push(h)}return l}}function Lu(e,t,n,r){var i=!r,a=e._private,o=t._private,s=o.easing,l=o.startTime,u=(r?e:e.cy()).style();if(!o.easingImpl)if(null==s)o.easingImpl=Du.linear;else{var c,h,d;c=b(s)?u.parse("transition-timing-function",s).value:s,b(c)?(h=c,d=[]):(h=c[1],d=c.slice(2).map((function(e){return+e}))),d.length>0?("spring"===h&&d.push(o.duration),o.easingImpl=Du[h].apply(null,d)):o.easingImpl=Du[h]}var p,g=o.easingImpl;if(p=0===o.duration?1:(n-l)/o.duration,o.applying&&(p=o.progress),p<0?p=0:p>1&&(p=1),null==o.delay){var f=o.startPosition,v=o.position;if(v&&i&&!e.locked()){var y={};Su(f.x,v.x)&&(y.x=Au(f.x,v.x,p,g)),Su(f.y,v.y)&&(y.y=Au(f.y,v.y,p,g)),e.position(y)}var m=o.startPan,x=o.pan,w=a.pan,E=null!=x&&r;E&&(Su(m.x,x.x)&&(w.x=Au(m.x,x.x,p,g)),Su(m.y,x.y)&&(w.y=Au(m.y,x.y,p,g)),e.emit("pan"));var T=o.startZoom,_=o.zoom,D=null!=_&&r;D&&(Su(T,_)&&(a.zoom=An(a.minZoom,Au(T,_,p,g),a.maxZoom)),e.emit("zoom")),(E||D)&&e.emit("viewport");var C=o.style;if(C&&C.length>0&&i){for(var N=0;N<C.length;N++){var A=C[N],L=A.name,S=A,O=o.startStyle[L],I=Au(O,S,p,g,u.properties[O.name]);u.overrideBypass(e,L,I)}e.emit("style")}}return o.progress=p,p}function Su(e,t){return!!(null!=e&&null!=t&&(_(e)&&_(t)||e&&t))}function Ou(e,t,n,r){var i=t._private;i.started=!0,i.startTime=n-i.progress*i.duration}function Iu(e,t){var n=t._private.aniEles,r=[];function i(t,n){var i=t._private,a=i.animation.current,o=i.animation.queue,s=!1;if(0===a.length){var l=o.shift();l&&a.push(l)}for(var u=function(e){for(var t=e.length-1;t>=0;t--)(0,e[t])();e.splice(0,e.length)},c=a.length-1;c>=0;c--){var h=a[c],d=h._private;d.stopped?(a.splice(c,1),d.hooked=!1,d.playing=!1,d.started=!1,u(d.frames)):(d.playing||d.applying)&&(d.playing&&d.applying&&(d.applying=!1),d.started||Ou(t,h,e),Lu(t,h,e,n),d.applying&&(d.applying=!1),u(d.frames),null!=d.step&&d.step(e),h.completed()&&(a.splice(c,1),d.hooked=!1,d.playing=!1,d.started=!1,u(d.completes)),s=!0)}return n||0!==a.length||0!==o.length||r.push(t),s}for(var a=!1,o=0;o<n.length;o++){var s=i(n[o]);a=a||s}var l=i(t,!0);(a||l)&&(n.length>0?t.notify("draw",n):t.notify("draw")),n.unmerge(r),t.emit("step")}var ku={animate:hs.animate(),animation:hs.animation(),animated:hs.animated(),clearQueue:hs.clearQueue(),delay:hs.delay(),delayAnimation:hs.delayAnimation(),stop:hs.stop(),addToAnimationPool:function(e){var t=this;t.styleEnabled()&&t._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,e.styleEnabled()){var t=e.renderer();t&&t.beforeRender?t.beforeRender((function(t,n){Iu(n,e)}),t.beforeRenderPriorities.animations):n()}function n(){e._private.animationsRunning&&nt((function(t){Iu(t,e),n()}))}}},Mu={qualifierCompare:function(e,t){return null==e||null==t?null==e&&null==t:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return null==r||e!==n.target&&A(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e}},Pu=function(e){return b(e)?new Ps(e):e},Ru={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Rl(Mu,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,Pu(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,Pu(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,Pu(t),n),this},once:function(e,t,n){return this.emitter().one(e,Pu(t),n),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};hs.eventAliasesOn(Ru);var Bu={png:function(e){return e=e||{},this._private.renderer.png(e)},jpg:function(e){var t=this._private.renderer;return(e=e||{}).bg=e.bg||"#fff",t.jpg(e)}};Bu.jpeg=Bu.jpg;var Fu={layout:function(e){var t=this;if(null!=e)if(null!=e.name){var n=e.name,r=t.extension("layout",n);if(null!=r){var i;i=b(e.eles)?t.$(e.eles):null!=e.eles?e.eles:t.$();var a=new r(Q({},e,{cy:t,eles:i}));return a}Dt("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?")}else Dt("A `name` must be specified to make a layout");else Dt("Layout options must be specified to make a layout")}};Fu.createLayout=Fu.makeLayout=Fu.layout;var zu={notify:function(e,t){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var r=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();null!=t&&r.merge(t)}else if(n.notificationsEnabled){var i=this.renderer();!this.destroyed()&&i&&i.notify(e,t)}},notifications:function(e){var t=this._private;return void 0===e?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return null==e.batchCount&&(e.batchCount=0),0===e.batchCount&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(0===e.batchCount)return this;if(e.batchCount--,0===e.batchCount){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach((function(n){var r=e.batchNotifications[n];r.empty()?t.notify(n):t.notify(n,r)}))}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch((function(){for(var n=Object.keys(e),r=0;r<n.length;r++){var i=n[r],a=e[i];t.getElementById(i).data(a)}}))}},Gu=Mt({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1}),Yu={renderTo:function(e,t,n,r){return this._private.renderer.renderTo(e,t,n,r),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(e){var t=this,n=t.extension("renderer",e.name);if(null!=n){void 0!==e.wheelSensitivity&&Nt("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var r=Gu(e);r.cy=t,t._private.renderer=new n(r),this.notify("init")}else Dt("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"))},destroyRenderer:function(){var e=this;e.notify("destroy");var t=e.container();if(t)for(t._cyreg=null;t.childNodes.length>0;)t.removeChild(t.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach((function(e){var t=e._private;t.rscratch={},t.rstyle={},t.animation.current=[],t.animation.queue=[]}))},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};Yu.invalidateDimensions=Yu.resize;var Xu={collection:function(e,t){return b(e)?this.$(e):N(e)?e.collection():w(e)?(t||(t={}),new bu(this,e,t.unique,t.removed)):new bu(this)},nodes:function(e){var t=this.$((function(e){return e.isNode()}));return e?t.filter(e):t},edges:function(e){var t=this.$((function(e){return e.isEdge()}));return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};Xu.elements=Xu.filter=Xu.$;var Vu={},Uu="t",ju="f";Vu.apply=function(e){for(var t=this,n=t._private.cy.collection(),r=0;r<e.length;r++){var i=e[r],a=t.getContextMeta(i);if(!a.empty){var o=t.getContextStyle(a),s=t.applyContextStyle(a,o,i);i._private.appliedInitStyle?t.updateTransitions(i,s.diffProps):i._private.appliedInitStyle=!0,t.updateStyleHints(i)&&n.push(i)}}return n},Vu.getPropertiesDiff=function(e,t){var n=this,r=n._private.propDiffs=n._private.propDiffs||{},i=e+"-"+t,a=r[i];if(a)return a;for(var o=[],s={},l=0;l<n.length;l++){var u=n[l],c=e[l]===Uu,h=t[l]===Uu,d=c!==h,p=u.mappedProperties.length>0;if(d||h&&p){var g=void 0;d&&p||d?g=u.properties:p&&(g=u.mappedProperties);for(var f=0;f<g.length;f++){for(var v=g[f],y=v.name,m=!1,b=l+1;b<n.length;b++){var x=n[b];if(t[b]===Uu&&(m=null!=x.properties[v.name]))break}s[y]||m||(s[y]=!0,o.push(y))}}}return r[i]=o,o},Vu.getContextMeta=function(e){for(var t,n=this,r="",i=e._private.styleCxtKey||"",a=0;a<n.length;a++){var o=n[a];r+=o.selector&&o.selector.matches(e)?Uu:ju}return t=n.getPropertiesDiff(i,r),e._private.styleCxtKey=r,{key:r,diffPropNames:t,empty:0===t.length}},Vu.getContextStyle=function(e){var t=e.key,n=this,r=this._private.contextStyles=this._private.contextStyles||{};if(r[t])return r[t];for(var i={_private:{key:t}},a=0;a<n.length;a++){var o=n[a];if(t[a]===Uu)for(var s=0;s<o.properties.length;s++){var l=o.properties[s];i[l.name]=l}}return r[t]=i,i},Vu.applyContextStyle=function(e,t,n){for(var r=this,i=e.diffPropNames,a={},o=r.types,s=0;s<i.length;s++){var l=i[s],u=t[l],c=n.pstyle(l);if(!u){if(!c)continue;u=c.bypass?{name:l,deleteBypassed:!0}:{name:l,delete:!0}}if(c!==u){if(u.mapped===o.fn&&null!=c&&null!=c.mapping&&c.mapping.value===u.value){var h=c.mapping;if((h.fnValue=u.value(n))===h.prevFnValue)continue}var d=a[l]={prev:c};r.applyParsedProperty(n,u),d.next=n.pstyle(l),d.next&&d.next.bypass&&(d.next=d.next.bypassed)}}return{diffProps:a}},Vu.updateStyleHints=function(e){var t=e._private,n=this,r=n.propertyGroupNames,i=n.propertyGroupKeys,a=function(e,t,r){return n.getPropertiesHash(e,t,r)},o=t.styleKey;if(e.removed())return!1;var s="nodes"===t.group,l=e._private.style;r=Object.keys(l);for(var u=0;u<i.length;u++){var c=i[u];t.styleKeys[c]=[it,ot]}for(var h=function(e,n){return t.styleKeys[n][0]=lt(e,t.styleKeys[n][0])},d=function(e,n){return t.styleKeys[n][1]=ut(e,t.styleKeys[n][1])},p=function(e,t){h(e,t),d(e,t)},g=function(e,t){for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);h(r,t),d(r,t)}},f=2e9,v=function(e){return-128<e&&e<128&&Math.floor(e)!==e?f-(1024*e|0):e},y=0;y<r.length;y++){var m=r[y],b=l[m];if(null!=b){var x=this.properties[m],w=x.type,E=x.groupKey,T=void 0;null!=x.hashOverride?T=x.hashOverride(e,b):null!=b.pfValue&&(T=b.pfValue);var _=null==x.enums?b.value:null,D=null!=T,C=D||null!=_,N=b.units;w.number&&C&&!w.multiple?(p(v(D?T:_),E),D||null==N||g(N,E)):g(b.strValue,E)}}for(var A=[it,ot],L=0;L<i.length;L++){var S=i[L],O=t.styleKeys[S];A[0]=lt(O[0],A[0]),A[1]=ut(O[1],A[1])}t.styleKey=ct(A[0],A[1]);var I=t.styleKeys;t.labelDimsKey=ht(I.labelDimensions);var k=a(e,["label"],I.labelDimensions);if(t.labelKey=ht(k),t.labelStyleKey=ht(dt(I.commonLabel,k)),!s){var M=a(e,["source-label"],I.labelDimensions);t.sourceLabelKey=ht(M),t.sourceLabelStyleKey=ht(dt(I.commonLabel,M));var P=a(e,["target-label"],I.labelDimensions);t.targetLabelKey=ht(P),t.targetLabelStyleKey=ht(dt(I.commonLabel,P))}if(s){var R=t.styleKeys,B=R.nodeBody,F=R.nodeBorder,z=R.backgroundImage,G=R.compound,Y=R.pie,X=[B,F,z,G,Y].filter((function(e){return null!=e})).reduce(dt,[it,ot]);t.nodeKey=ht(X),t.hasPie=null!=Y&&Y[0]!==it&&Y[1]!==ot}return o!==t.styleKey},Vu.clearStyleHints=function(e){var t=e._private;t.styleCxtKey="",t.styleKeys={},t.styleKey=null,t.labelKey=null,t.labelStyleKey=null,t.sourceLabelKey=null,t.sourceLabelStyleKey=null,t.targetLabelKey=null,t.targetLabelStyleKey=null,t.nodeKey=null,t.hasPie=null},Vu.applyParsedProperty=function(e,t){var n,r=this,i=t,a=e._private.style,o=r.types,s=r.properties[i.name].type,l=i.bypass,u=a[i.name],c=u&&u.bypass,h=e._private,d="mapping",p=function(e){return null==e?null:null!=e.pfValue?e.pfValue:e.value},g=function(){var t=p(u),n=p(i);r.checkTriggers(e,i.name,t,n)};if(i&&"pie"===i.name.substr(0,3)&&Nt("The pie style properties are deprecated. Create charts using background images instead."),"curve-style"===t.name&&e.isEdge()&&("bezier"!==t.value&&e.isLoop()||"haystack"===t.value&&(e.source().isParent()||e.target().isParent()))&&(i=t=this.parse(t.name,"bezier",l)),i.delete)return a[i.name]=void 0,g(),!0;if(i.deleteBypassed)return u?!!u.bypass&&(u.bypassed=void 0,g(),!0):(g(),!0);if(i.deleteBypass)return u?!!u.bypass&&(a[i.name]=u.bypassed,g(),!0):(g(),!0);var f=function(){Nt("Do not assign mappings to elements without corresponding data (i.e. ele `"+e.id()+"` has no mapping for property `"+i.name+"` with data field `"+i.field+"`); try a `["+i.field+"]` selector to limit scope to elements with `"+i.field+"` defined")};switch(i.mapped){case o.mapData:for(var v,y=i.field.split("."),m=h.data,b=0;b<y.length&&m;b++)m=m[y[b]];if(null==m)return f(),!1;if(!_(m))return Nt("Do not use continuous mappers without specifying numeric data (i.e. `"+i.field+": "+m+"` for `"+e.id()+"` is non-numeric)"),!1;var x=i.fieldMax-i.fieldMin;if((v=0===x?0:(m-i.fieldMin)/x)<0?v=0:v>1&&(v=1),s.color){var w=i.valueMin[0],E=i.valueMax[0],T=i.valueMin[1],D=i.valueMax[1],C=i.valueMin[2],N=i.valueMax[2],A=null==i.valueMin[3]?1:i.valueMin[3],L=null==i.valueMax[3]?1:i.valueMax[3],S=[Math.round(w+(E-w)*v),Math.round(T+(D-T)*v),Math.round(C+(N-C)*v),Math.round(A+(L-A)*v)];n={bypass:i.bypass,name:i.name,value:S,strValue:"rgb("+S[0]+", "+S[1]+", "+S[2]+")"}}else{if(!s.number)return!1;var O=i.valueMin+(i.valueMax-i.valueMin)*v;n=this.parse(i.name,O,i.bypass,d)}if(!n)return f(),!1;n.mapping=i,i=n;break;case o.data:for(var I=i.field.split("."),k=h.data,M=0;M<I.length&&k;M++)k=k[I[M]];if(null!=k&&(n=this.parse(i.name,k,i.bypass,d)),!n)return f(),!1;n.mapping=i,i=n;break;case o.fn:var P=i.value,R=null!=i.fnValue?i.fnValue:P(e);if(i.prevFnValue=R,null==R)return Nt("Custom function mappers may not return null (i.e. `"+i.name+"` for ele `"+e.id()+"` is null)"),!1;if(!(n=this.parse(i.name,R,i.bypass,d)))return Nt("Custom function mappers may not return invalid values for the property type (i.e. `"+i.name+"` for ele `"+e.id()+"` is invalid)"),!1;n.mapping=Lt(i),i=n;break;case void 0:break;default:return!1}return l?(i.bypassed=c?u.bypassed:u,a[i.name]=i):c?u.bypassed=i:a[i.name]=i,g(),!0},Vu.cleanElements=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(this.clearStyleHints(r),r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache(),t)for(var i=r._private.style,a=Object.keys(i),o=0;o<a.length;o++){var s=a[o],l=i[s];null!=l&&(l.bypass?l.bypassed=null:i[s]=null)}else r._private.style={}}},Vu.update=function(){this._private.cy.mutableElements().updateStyle()},Vu.updateTransitions=function(e,t){var n=this,r=e._private,i=e.pstyle("transition-property").value,a=e.pstyle("transition-duration").pfValue,o=e.pstyle("transition-delay").pfValue;if(i.length>0&&a>0){for(var s={},l=!1,u=0;u<i.length;u++){var c=i[u],h=e.pstyle(c),d=t[c];if(d){var p=d.prev,g=null!=d.next?d.next:h,f=!1,v=void 0,y=1e-6;p&&(_(p.pfValue)&&_(g.pfValue)?(f=g.pfValue-p.pfValue,v=p.pfValue+y*f):_(p.value)&&_(g.value)?(f=g.value-p.value,v=p.value+y*f):w(p.value)&&w(g.value)&&(f=p.value[0]!==g.value[0]||p.value[1]!==g.value[1]||p.value[2]!==g.value[2],v=p.strValue),f&&(s[c]=g.strValue,this.applyBypass(e,c,v),l=!0))}}if(!l)return;r.transitioning=!0,new Gi((function(t){o>0?e.delayAnimation(o).play().promise().then(t):t()})).then((function(){return e.animation({style:s,duration:a,easing:e.pstyle("transition-timing-function").value,queue:!1}).play().promise()})).then((function(){n.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1}))}else r.transitioning&&(this.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1)},Vu.checkTrigger=function(e,t,n,r,i,a){var o=this.properties[t],s=i(o);null!=s&&s(n,r)&&a(o)},Vu.checkZOrderTrigger=function(e,t,n,r){var i=this;this.checkTrigger(e,t,n,r,(function(e){return e.triggersZOrder}),(function(){i._private.cy.notify("zorder",e)}))},Vu.checkBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,(function(e){return e.triggersBounds}),(function(i){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache(),!i.triggersBoundsOfParallelBeziers||("curve-style"!==t||"bezier"!==n&&"bezier"!==r)&&("display"!==t||"none"!==n&&"none"!==r)||e.parallelEdges().forEach((function(e){e.isBundledBezier()&&e.dirtyBoundingBoxCache()}))}))},Vu.checkTriggers=function(e,t,n,r){e.dirtyStyleCache(),this.checkZOrderTrigger(e,t,n,r),this.checkBoundsTrigger(e,t,n,r)};var Hu={applyBypass:function(e,t,n,r){var i=this,a=[],o=!0;if("*"===t||"**"===t){if(void 0!==n)for(var s=0;s<i.properties.length;s++){var l=i.properties[s].name,u=this.parse(l,n,!0);u&&a.push(u)}}else if(b(t)){var c=this.parse(t,n,!0);c&&a.push(c)}else{if(!E(t))return!1;var h=t;r=n;for(var d=Object.keys(h),p=0;p<d.length;p++){var g=d[p],f=h[g];if(void 0===f&&(f=h[G(g)]),void 0!==f){var v=this.parse(g,f,!0);v&&a.push(v)}}}if(0===a.length)return!1;for(var y=!1,m=0;m<e.length;m++){for(var x=e[m],w={},T=void 0,_=0;_<a.length;_++){var D=a[_];if(r){var C=x.pstyle(D.name);T=w[D.name]={prev:C}}y=this.applyParsedProperty(x,Lt(D))||y,r&&(T.next=x.pstyle(D.name))}y&&this.updateStyleHints(x),r&&this.updateTransitions(x,w,o)}return y},overrideBypass:function(e,t,n){t=z(t);for(var r=0;r<e.length;r++){var i=e[r],a=i._private.style[t],o=this.properties[t].type,s=o.color,l=o.mutiple,u=a?null!=a.pfValue?a.pfValue:a.value:null;a&&a.bypass?(a.value=n,null!=a.pfValue&&(a.pfValue=n),a.strValue=s?"rgb("+n.join(",")+")":l?n.join(" "):""+n,this.updateStyleHints(i)):this.applyBypass(i,t,n),this.checkTriggers(i,t,u,n)}},removeAllBypasses:function(e,t){return this.removeBypasses(e,this.propertyNames,t)},removeBypasses:function(e,t,n){for(var r=!0,i=0;i<e.length;i++){for(var a=e[i],o={},s=0;s<t.length;s++){var l=t[s],u=this.properties[l],c=a.pstyle(u.name);if(c&&c.bypass){var h="",d=this.parse(l,h,!0),p=o[u.name]={prev:c};this.applyParsedProperty(a,d),p.next=a.pstyle(u.name)}}this.updateStyleHints(a),n&&this.updateTransitions(a,o,r)}}},qu={getEmSizeInPixels:function(){var e=this.containerCss("font-size");return null!=e?parseFloat(e):1},containerCss:function(e){var t=this._private.cy,n=t.container(),r=t.window();if(r&&n&&r.getComputedStyle)return r.getComputedStyle(n).getPropertyValue(e)}},Wu={getRenderedStyle:function(e,t){return t?this.getStylePropertyValue(e,t,!0):this.getRawStyle(e,!0)},getRawStyle:function(e,t){var n=this;if(e=e[0]){for(var r={},i=0;i<n.properties.length;i++){var a=n.properties[i],o=n.getStylePropertyValue(e,a.name,t);null!=o&&(r[a.name]=o,r[G(a.name)]=o)}return r}},getIndexedStyle:function(e,t,n,r){var i=e.pstyle(t)[n][r];return null!=i?i:e.cy().style().getDefaultProperty(t)[n][0]},getStylePropertyValue:function(e,t,n){var r=this;if(e=e[0]){var i=r.properties[t];i.alias&&(i=i.pointsTo);var a=i.type,o=e.pstyle(i.name);if(o){var s=o.value,l=o.units,u=o.strValue;if(n&&a.number&&null!=s&&_(s)){var c=e.cy().zoom(),h=function(e){return e*c},d=function(e,t){return h(e)+t},p=w(s);return(p?l.every((function(e){return null!=e})):null!=l)?p?s.map((function(e,t){return d(e,l[t])})).join(" "):d(s,l):p?s.map((function(e){return b(e)?e:""+h(e)})).join(" "):""+h(s)}if(null!=u)return u}return null}},getAnimationStartStyle:function(e,t){for(var n={},r=0;r<t.length;r++){var i=t[r].name,a=e.pstyle(i);void 0!==a&&(a=E(a)?this.parse(i,a.strValue):this.parse(i,a)),a&&(n[i]=a)}return n},getPropsList:function(e){var t=[],n=e,r=this.properties;if(n)for(var i=Object.keys(n),a=0;a<i.length;a++){var o=i[a],s=n[o],l=r[o]||r[z(o)],u=this.parse(l.name,s);u&&t.push(u)}return t},getNonDefaultPropertiesHash:function(e,t,n){var r,i,a,o,s,l,u=n.slice();for(s=0;s<t.length;s++)if(r=t[s],null!=(i=e.pstyle(r,!1)))if(null!=i.pfValue)u[0]=lt(o,u[0]),u[1]=ut(o,u[1]);else for(a=i.strValue,l=0;l<a.length;l++)o=a.charCodeAt(l),u[0]=lt(o,u[0]),u[1]=ut(o,u[1]);return u}};Wu.getPropertiesHash=Wu.getNonDefaultPropertiesHash;var $u={appendFromJson:function(e){for(var t=this,n=0;n<e.length;n++){var r=e[n],i=r.selector,a=r.style||r.css,o=Object.keys(a);t.selector(i);for(var s=0;s<o.length;s++){var l=o[s],u=a[l];t.css(l,u)}}return t},fromJson:function(e){var t=this;return t.resetToDefault(),t.appendFromJson(e),t},json:function(){for(var e=[],t=this.defaultLength;t<this.length;t++){for(var n=this[t],r=n.selector,i=n.properties,a={},o=0;o<i.length;o++){var s=i[o];a[s.name]=s.strValue}e.push({selector:r?r.toString():"core",style:a})}return e}},Zu={appendFromString:function(e){var t,n,r,i=this,a=this,o=""+e;function s(){o=o.length>t.length?o.substr(t.length):""}function l(){n=n.length>r.length?n.substr(r.length):""}for(o=o.replace(/[/][*](\s|.)+?[*][/]/g,"");!o.match(/^\s*$/);){var u=o.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!u){Nt("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+o);break}t=u[0];var c=u[1];if("core"!==c&&new Ps(c).invalid)Nt("Skipping parsing of block: Invalid selector found in string stylesheet: "+c),s();else{var h=u[2],d=!1;n=h;for(var p=[];!n.match(/^\s*$/);){var g=n.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!g){Nt("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+h),d=!0;break}r=g[0];var f=g[1],v=g[2];i.properties[f]?a.parse(f,v)?(p.push({name:f,val:v}),l()):(Nt("Skipping property: Invalid property definition in: "+r),l()):(Nt("Skipping property: Invalid property name in: "+r),l())}if(d){s();break}a.selector(c);for(var y=0;y<p.length;y++){var m=p[y];a.css(m.name,m.val)}s()}}return a},fromString:function(e){var t=this;return t.resetToDefault(),t.appendFromString(e),t}},Ku={};(function(){var e=V,t=j,n=q,r=W,i=$,a=function(e){return"^"+e+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},o=function(a){var o=e+"|\\w+|"+t+"|"+n+"|"+r+"|"+i;return"^"+a+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+e+")\\s*\\,\\s*("+e+")\\s*,\\s*("+o+")\\s*\\,\\s*("+o+")\\)$"},s=["^url\\s*\\(\\s*['\"]?(.+?)['\"]?\\s*\\)$","^(none)$","^(.+)$"];Ku.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},nonNegativeNumber:{number:!0,min:0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials","null"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi"]},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","right-rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:!0},data:{mapping:!0,regex:a("data")},layoutData:{mapping:!0,regex:a("layoutData")},scratch:{mapping:!0,regex:a("scratch")},mapData:{mapping:!0,regex:o("mapData")},mapLayoutData:{mapping:!0,regex:o("mapLayoutData")},mapScratch:{mapping:!0,regex:o("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:s,singleRegexMatchValue:!0},urls:{regexes:s,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position","endpoints"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(e,t){switch(e.length){case 2:return"deg"!==t[0]&&"rad"!==t[0]&&"deg"!==t[1]&&"rad"!==t[1];case 1:return b(e[0])||"deg"===t[0]||"rad"===t[0];default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+e+")\\s*,\\s*("+e+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+e+")\\s*,\\s*("+e+")\\s*,\\s*("+e+")\\s*,\\s*("+e+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(e){var t=e.length;return 1===t||2===t||4===t}}};var l={zeroNonZero:function(e,t){return(null==e||null==t)&&e!==t||0==e&&0!=t||0!=e&&0==t},any:function(e,t){return e!=t},emptyNonEmpty:function(e,t){var n=k(e),r=k(t);return n&&!r||!n&&r}},u=Ku.types,c=[{name:"label",type:u.text,triggersBounds:l.any,triggersZOrder:l.emptyNonEmpty},{name:"text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any}],h=[{name:"source-label",type:u.text,triggersBounds:l.any},{name:"source-text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"source-text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"source-text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"source-text-offset",type:u.size,triggersBounds:l.any}],d=[{name:"target-label",type:u.text,triggersBounds:l.any},{name:"target-text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"target-text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"target-text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"target-text-offset",type:u.size,triggersBounds:l.any}],p=[{name:"font-family",type:u.fontFamily,triggersBounds:l.any},{name:"font-style",type:u.fontStyle,triggersBounds:l.any},{name:"font-weight",type:u.fontWeight,triggersBounds:l.any},{name:"font-size",type:u.size,triggersBounds:l.any},{name:"text-transform",type:u.textTransform,triggersBounds:l.any},{name:"text-wrap",type:u.textWrap,triggersBounds:l.any},{name:"text-overflow-wrap",type:u.textOverflowWrap,triggersBounds:l.any},{name:"text-max-width",type:u.size,triggersBounds:l.any},{name:"text-outline-width",type:u.size,triggersBounds:l.any},{name:"line-height",type:u.positiveNumber,triggersBounds:l.any}],g=[{name:"text-valign",type:u.valign,triggersBounds:l.any},{name:"text-halign",type:u.halign,triggersBounds:l.any},{name:"color",type:u.color},{name:"text-outline-color",type:u.color},{name:"text-outline-opacity",type:u.zeroOneNumber},{name:"text-background-color",type:u.color},{name:"text-background-opacity",type:u.zeroOneNumber},{name:"text-background-padding",type:u.size,triggersBounds:l.any},{name:"text-border-opacity",type:u.zeroOneNumber},{name:"text-border-color",type:u.color},{name:"text-border-width",type:u.size,triggersBounds:l.any},{name:"text-border-style",type:u.borderStyle,triggersBounds:l.any},{name:"text-background-shape",type:u.textBackgroundShape,triggersBounds:l.any},{name:"text-justification",type:u.justification}],f=[{name:"events",type:u.bool,triggersZOrder:l.any},{name:"text-events",type:u.bool,triggersZOrder:l.any}],v=[{name:"display",type:u.display,triggersZOrder:l.any,triggersBounds:l.any,triggersBoundsOfParallelBeziers:!0},{name:"visibility",type:u.visibility,triggersZOrder:l.any},{name:"opacity",type:u.zeroOneNumber,triggersZOrder:l.zeroNonZero},{name:"text-opacity",type:u.zeroOneNumber},{name:"min-zoomed-font-size",type:u.size},{name:"z-compound-depth",type:u.zCompoundDepth,triggersZOrder:l.any},{name:"z-index-compare",type:u.zIndexCompare,triggersZOrder:l.any},{name:"z-index",type:u.number,triggersZOrder:l.any}],y=[{name:"overlay-padding",type:u.size,triggersBounds:l.any},{name:"overlay-color",type:u.color},{name:"overlay-opacity",type:u.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:"overlay-shape",type:u.overlayShape,triggersBounds:l.any}],m=[{name:"underlay-padding",type:u.size,triggersBounds:l.any},{name:"underlay-color",type:u.color},{name:"underlay-opacity",type:u.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:"underlay-shape",type:u.overlayShape,triggersBounds:l.any}],x=[{name:"transition-property",type:u.propList},{name:"transition-duration",type:u.time},{name:"transition-delay",type:u.time},{name:"transition-timing-function",type:u.easing}],w=function(e,t){return"label"===t.value?-e.poolIndex():t.pfValue},E=[{name:"height",type:u.nodeSize,triggersBounds:l.any,hashOverride:w},{name:"width",type:u.nodeSize,triggersBounds:l.any,hashOverride:w},{name:"shape",type:u.nodeShape,triggersBounds:l.any},{name:"shape-polygon-points",type:u.polygonPointList,triggersBounds:l.any},{name:"background-color",type:u.color},{name:"background-fill",type:u.fill},{name:"background-opacity",type:u.zeroOneNumber},{name:"background-blacken",type:u.nOneOneNumber},{name:"background-gradient-stop-colors",type:u.colors},{name:"background-gradient-stop-positions",type:u.percentages},{name:"background-gradient-direction",type:u.gradientDirection},{name:"padding",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"padding-relative-to",type:u.paddingRelativeTo,triggersBounds:l.any},{name:"bounds-expansion",type:u.boundsExpansion,triggersBounds:l.any}],T=[{name:"border-color",type:u.color},{name:"border-opacity",type:u.zeroOneNumber},{name:"border-width",type:u.size,triggersBounds:l.any},{name:"border-style",type:u.borderStyle}],_=[{name:"background-image",type:u.urls},{name:"background-image-crossorigin",type:u.bgCrossOrigin},{name:"background-image-opacity",type:u.zeroOneNumbers},{name:"background-image-containment",type:u.bgContainment},{name:"background-image-smoothing",type:u.bools},{name:"background-position-x",type:u.bgPos},{name:"background-position-y",type:u.bgPos},{name:"background-width-relative-to",type:u.bgRelativeTo},{name:"background-height-relative-to",type:u.bgRelativeTo},{name:"background-repeat",type:u.bgRepeat},{name:"background-fit",type:u.bgFit},{name:"background-clip",type:u.bgClip},{name:"background-width",type:u.bgWH},{name:"background-height",type:u.bgWH},{name:"background-offset-x",type:u.bgPos},{name:"background-offset-y",type:u.bgPos}],D=[{name:"position",type:u.position,triggersBounds:l.any},{name:"compound-sizing-wrt-labels",type:u.compoundIncludeLabels,triggersBounds:l.any},{name:"min-width",type:u.size,triggersBounds:l.any},{name:"min-width-bias-left",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-width-bias-right",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-height",type:u.size,triggersBounds:l.any},{name:"min-height-bias-top",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-height-bias-bottom",type:u.sizeMaybePercent,triggersBounds:l.any}],C=[{name:"line-style",type:u.lineStyle},{name:"line-color",type:u.color},{name:"line-fill",type:u.fill},{name:"line-cap",type:u.lineCap},{name:"line-opacity",type:u.zeroOneNumber},{name:"line-dash-pattern",type:u.numbers},{name:"line-dash-offset",type:u.number},{name:"line-gradient-stop-colors",type:u.colors},{name:"line-gradient-stop-positions",type:u.percentages},{name:"curve-style",type:u.curveStyle,triggersBounds:l.any,triggersBoundsOfParallelBeziers:!0},{name:"haystack-radius",type:u.zeroOneNumber,triggersBounds:l.any},{name:"source-endpoint",type:u.edgeEndpoint,triggersBounds:l.any},{name:"target-endpoint",type:u.edgeEndpoint,triggersBounds:l.any},{name:"control-point-step-size",type:u.size,triggersBounds:l.any},{name:"control-point-distances",type:u.bidirectionalSizes,triggersBounds:l.any},{name:"control-point-weights",type:u.numbers,triggersBounds:l.any},{name:"segment-distances",type:u.bidirectionalSizes,triggersBounds:l.any},{name:"segment-weights",type:u.numbers,triggersBounds:l.any},{name:"taxi-turn",type:u.bidirectionalSizeMaybePercent,triggersBounds:l.any},{name:"taxi-turn-min-distance",type:u.size,triggersBounds:l.any},{name:"taxi-direction",type:u.axisDirection,triggersBounds:l.any},{name:"edge-distances",type:u.edgeDistances,triggersBounds:l.any},{name:"arrow-scale",type:u.positiveNumber,triggersBounds:l.any},{name:"loop-direction",type:u.angle,triggersBounds:l.any},{name:"loop-sweep",type:u.angle,triggersBounds:l.any},{name:"source-distance-from-node",type:u.size,triggersBounds:l.any},{name:"target-distance-from-node",type:u.size,triggersBounds:l.any}],N=[{name:"ghost",type:u.bool,triggersBounds:l.any},{name:"ghost-offset-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"ghost-offset-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"ghost-opacity",type:u.zeroOneNumber}],A=[{name:"selection-box-color",type:u.color},{name:"selection-box-opacity",type:u.zeroOneNumber},{name:"selection-box-border-color",type:u.color},{name:"selection-box-border-width",type:u.size},{name:"active-bg-color",type:u.color},{name:"active-bg-opacity",type:u.zeroOneNumber},{name:"active-bg-size",type:u.size},{name:"outside-texture-bg-color",type:u.color},{name:"outside-texture-bg-opacity",type:u.zeroOneNumber}],L=[];Ku.pieBackgroundN=16,L.push({name:"pie-size",type:u.sizeMaybePercent});for(var S=1;S<=Ku.pieBackgroundN;S++)L.push({name:"pie-"+S+"-background-color",type:u.color}),L.push({name:"pie-"+S+"-background-size",type:u.percent}),L.push({name:"pie-"+S+"-background-opacity",type:u.zeroOneNumber});var O=[],I=Ku.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:u.arrowShape,triggersBounds:l.any},{name:"arrow-color",type:u.color},{name:"arrow-fill",type:u.arrowFill}].forEach((function(e){I.forEach((function(t){var n=t+"-"+e.name,r=e.type,i=e.triggersBounds;O.push({name:n,type:r,triggersBounds:i})}))}),{});var M=Ku.properties=[].concat(f,x,v,y,m,N,g,p,c,h,d,E,T,_,L,D,C,O,A),P=Ku.propertyGroups={behavior:f,transition:x,visibility:v,overlay:y,underlay:m,ghost:N,commonLabel:g,labelDimensions:p,mainLabel:c,sourceLabel:h,targetLabel:d,nodeBody:E,nodeBorder:T,backgroundImage:_,pie:L,compound:D,edgeLine:C,edgeArrow:O,core:A},R=Ku.propertyGroupNames={};(Ku.propertyGroupKeys=Object.keys(P)).forEach((function(e){R[e]=P[e].map((function(e){return e.name})),P[e].forEach((function(t){return t.groupKey=e}))}));var B=Ku.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];Ku.propertyNames=M.map((function(e){return e.name}));for(var F=0;F<M.length;F++){var z=M[F];M[z.name]=z}for(var G=0;G<B.length;G++){var Y=B[G],X=M[Y.pointsTo],U={name:Y.name,alias:!0,pointsTo:X};M.push(U),M[Y.name]=U}})(),Ku.getDefaultProperty=function(e){return this.getDefaultProperties()[e]},Ku.getDefaultProperties=function(){var e=this._private;if(null!=e.defaultProperties)return e.defaultProperties;for(var t=Q({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce((function(e,t){for(var n=1;n<=Ku.pieBackgroundN;n++){var r=t.name.replace("{{i}}",n),i=t.value;e[r]=i}return e}),{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"taxi-turn":"50%","taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"}].reduce((function(e,t){return Ku.arrowPrefixes.forEach((function(n){var r=n+"-"+t.name,i=t.value;e[r]=i})),e}),{})),n={},r=0;r<this.properties.length;r++){var i=this.properties[r];if(!i.pointsTo){var a=i.name,o=t[a],s=this.parse(a,o);n[a]=s}}return e.defaultProperties=n,e.defaultProperties},Ku.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var Qu={parse:function(e,t,n,r){var i=this;if(x(t))return i.parseImplWarn(e,t,n,r);var a,o=ft(e,""+t,n?"t":"f","mapping"===r||!0===r||!1===r||null==r?"dontcare":r),s=i.propCache=i.propCache||[];return(a=s[o])||(a=s[o]=i.parseImplWarn(e,t,n,r)),(n||"mapping"===r)&&(a=Lt(a))&&(a.value=Lt(a.value)),a},parseImplWarn:function(e,t,n,r){var i=this.parseImpl(e,t,n,r);return i||null==t||Nt("The style property `".concat(e,": ").concat(t,"` is invalid")),!i||"width"!==i.name&&"height"!==i.name||"label"!==t||Nt("The style value of `label` is deprecated for `"+i.name+"`"),i},parseImpl:function(e,t,n,r){var i=this;e=z(e);var a=i.properties[e],o=t,s=i.types;if(!a)return null;if(void 0===t)return null;a.alias&&(a=a.pointsTo,e=a.name);var l=b(t);l&&(t=t.trim());var u,c,h=a.type;if(!h)return null;if(n&&(""===t||null===t))return{name:e,value:t,bypass:!0,deleteBypass:!0};if(x(t))return{name:e,value:t,strValue:"fn",mapped:s.fn,bypass:n};if(!l||r||t.length<7||"a"!==t[1]);else{if(t.length>=7&&"d"===t[0]&&(u=new RegExp(s.data.regex).exec(t))){if(n)return!1;var d=s.data;return{name:e,value:u,strValue:""+t,mapped:d,field:u[1],bypass:n}}if(t.length>=10&&"m"===t[0]&&(c=new RegExp(s.mapData.regex).exec(t))){if(n)return!1;if(h.multiple)return!1;var p=s.mapData;if(!h.color&&!h.number)return!1;var g=this.parse(e,c[4]);if(!g||g.mapped)return!1;var f=this.parse(e,c[5]);if(!f||f.mapped)return!1;if(g.pfValue===f.pfValue||g.strValue===f.strValue)return Nt("`"+e+": "+t+"` is not a valid mapper because the output range is zero; converting to `"+e+": "+g.strValue+"`"),this.parse(e,g.strValue);if(h.color){var v=g.value,y=f.value;if(!(v[0]!==y[0]||v[1]!==y[1]||v[2]!==y[2]||v[3]!==y[3]&&(null!=v[3]&&1!==v[3]||null!=y[3]&&1!==y[3])))return!1}return{name:e,value:c,strValue:""+t,mapped:p,field:c[1],fieldMin:parseFloat(c[2]),fieldMax:parseFloat(c[3]),valueMin:g.value,valueMax:f.value,bypass:n}}}if(h.multiple&&"multiple"!==r){var m;if(m=l?t.split(/\s+/):w(t)?t:[t],h.evenMultiple&&m.length%2!=0)return null;for(var E=[],T=[],_=[],C="",N=!1,A=0;A<m.length;A++){var L=i.parse(e,m[A],n,"multiple");N=N||b(L.value),E.push(L.value),_.push(null!=L.pfValue?L.pfValue:L.value),T.push(L.units),C+=(A>0?" ":"")+L.strValue}return h.validate&&!h.validate(E,T)?null:h.singleEnum&&N?1===E.length&&b(E[0])?{name:e,value:E[0],strValue:E[0],bypass:n}:null:{name:e,value:E,pfValue:_,strValue:C,bypass:n,units:T}}var S=function(){for(var r=0;r<h.enums.length;r++)if(h.enums[r]===t)return{name:e,value:t,strValue:""+t,bypass:n};return null};if(h.number){var O,I="px";if(h.units&&(O=h.units),h.implicitUnits&&(I=h.implicitUnits),!h.unitless)if(l){var k="px|em"+(h.allowPercent?"|\\%":"");O&&(k=O);var M=t.match("^("+V+")("+k+")?$");M&&(t=M[1],O=M[2]||I)}else O&&!h.implicitUnits||(O=I);if(t=parseFloat(t),isNaN(t)&&void 0===h.enums)return null;if(isNaN(t)&&void 0!==h.enums)return t=o,S();if(h.integer&&!D(t))return null;if(void 0!==h.min&&(t<h.min||h.strictMin&&t===h.min)||void 0!==h.max&&(t>h.max||h.strictMax&&t===h.max))return null;var P={name:e,value:t,strValue:""+t+(O||""),units:O,bypass:n};return h.unitless||"px"!==O&&"em"!==O?P.pfValue=t:P.pfValue="px"!==O&&O?this.getEmSizeInPixels()*t:t,"ms"!==O&&"s"!==O||(P.pfValue="ms"===O?t:1e3*t),"deg"!==O&&"rad"!==O||(P.pfValue="rad"===O?t:mn(t)),"%"===O&&(P.pfValue=t/100),P}if(h.propList){var R=[],B=""+t;if("none"===B);else{for(var F=B.split(/\s*,\s*|\s+/),G=0;G<F.length;G++){var Y=F[G].trim();i.properties[Y]?R.push(Y):Nt("`"+Y+"` is not a valid property name")}if(0===R.length)return null}return{name:e,value:R,strValue:0===R.length?"none":R.join(" "),bypass:n}}if(h.color){var X=re(t);return X?{name:e,value:X,pfValue:X,strValue:"rgb("+X[0]+","+X[1]+","+X[2]+")",bypass:n}:null}if(h.regex||h.regexes){if(h.enums){var U=S();if(U)return U}for(var j=h.regexes?h.regexes:[h.regex],H=0;H<j.length;H++){var q=new RegExp(j[H]).exec(t);if(q)return{name:e,value:h.singleRegexMatchValue?q[1]:q,strValue:""+t,bypass:n}}return null}return h.string?{name:e,value:""+t,strValue:""+t,bypass:n}:h.enums?S():null}},Ju=function e(t){if(!(this instanceof e))return new e(t);S(t)?(this._private={cy:t,coreStyle:{}},this.length=0,this.resetToDefault()):Dt("A style must have a core reference")},ec=Ju.prototype;ec.instanceString=function(){return"style"},ec.clear=function(){for(var e=this._private,t=e.cy.elements(),n=0;n<this.length;n++)this[n]=void 0;return this.length=0,e.contextStyles={},e.propDiffs={},this.cleanElements(t,!0),t.forEach((function(e){var t=e[0]._private;t.styleDirty=!0,t.appliedInitStyle=!1})),this},ec.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},ec.core=function(e){return this._private.coreStyle[e]||this.getDefaultProperty(e)},ec.selector=function(e){var t="core"===e?null:new Ps(e),n=this.length++;return this[n]={selector:t,properties:[],mappedProperties:[],index:n},this},ec.css=function(){var e=this,t=arguments;if(1===t.length)for(var n=t[0],r=0;r<e.properties.length;r++){var i=e.properties[r],a=n[i.name];void 0===a&&(a=n[G(i.name)]),void 0!==a&&this.cssRule(i.name,a)}else 2===t.length&&this.cssRule(t[0],t[1]);return this},ec.style=ec.css,ec.cssRule=function(e,t){var n=this.parse(e,t);if(n){var r=this.length-1;this[r].properties.push(n),this[r].properties[n.name]=n,n.name.match(/pie-(\d+)-background-size/)&&n.value&&(this._private.hasPie=!0),n.mapped&&this[r].mappedProperties.push(n),!this[r].selector&&(this._private.coreStyle[n.name]=n)}return this},ec.append=function(e){return O(e)?e.appendToStyle(this):w(e)?this.appendFromJson(e):b(e)&&this.appendFromString(e),this},Ju.fromJson=function(e,t){var n=new Ju(e);return n.fromJson(t),n},Ju.fromString=function(e,t){return new Ju(e).fromString(t)},[Vu,Hu,qu,Wu,$u,Zu,Ku,Qu].forEach((function(e){Q(ec,e)})),Ju.types=ec.types,Ju.properties=ec.properties,Ju.propertyGroups=ec.propertyGroups,Ju.propertyGroupNames=ec.propertyGroupNames,Ju.propertyGroupKeys=ec.propertyGroupKeys;var tc={style:function(e){return e&&this.setStyle(e).update(),this._private.style},setStyle:function(e){var t=this._private;return O(e)?t.style=e.generateStyle(this):w(e)?t.style=Ju.fromJson(this,e):b(e)?t.style=Ju.fromString(this,e):t.style=Ju(this),t.style},updateStyle:function(){this.mutableElements().updateStyle()}},nc="single",rc={autolock:function(e){return void 0===e?this._private.autolock:(this._private.autolock=!!e,this)},autoungrabify:function(e){return void 0===e?this._private.autoungrabify:(this._private.autoungrabify=!!e,this)},autounselectify:function(e){return void 0===e?this._private.autounselectify:(this._private.autounselectify=!!e,this)},selectionType:function(e){var t=this._private;return null==t.selectionType&&(t.selectionType=nc),void 0===e?t.selectionType:("additive"!==e&&"single"!==e||(t.selectionType=e),this)},panningEnabled:function(e){return void 0===e?this._private.panningEnabled:(this._private.panningEnabled=!!e,this)},userPanningEnabled:function(e){return void 0===e?this._private.userPanningEnabled:(this._private.userPanningEnabled=!!e,this)},zoomingEnabled:function(e){return void 0===e?this._private.zoomingEnabled:(this._private.zoomingEnabled=!!e,this)},userZoomingEnabled:function(e){return void 0===e?this._private.userZoomingEnabled:(this._private.userZoomingEnabled=!!e,this)},boxSelectionEnabled:function(e){return void 0===e?this._private.boxSelectionEnabled:(this._private.boxSelectionEnabled=!!e,this)},pan:function(){var e,t,n,r,i,a=arguments,o=this._private.pan;switch(a.length){case 0:return o;case 1:if(b(a[0]))return o[e=a[0]];if(E(a[0])){if(!this._private.panningEnabled)return this;r=(n=a[0]).x,i=n.y,_(r)&&(o.x=r),_(i)&&(o.y=i),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;e=a[0],t=a[1],"x"!==e&&"y"!==e||!_(t)||(o[e]=t),this.emit("pan viewport")}return this.notify("viewport"),this},panBy:function(e,t){var n,r,i,a,o,s=arguments,l=this._private.pan;if(!this._private.panningEnabled)return this;switch(s.length){case 1:E(e)&&(a=(i=s[0]).x,o=i.y,_(a)&&(l.x+=a),_(o)&&(l.y+=o),this.emit("pan viewport"));break;case 2:r=t,"x"!==(n=e)&&"y"!==n||!_(r)||(l[n]+=r),this.emit("pan viewport")}return this.notify("viewport"),this},fit:function(e,t){var n=this.getFitViewport(e,t);if(n){var r=this._private;r.zoom=n.zoom,r.pan=n.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,t){if(_(e)&&void 0===t&&(t=e,e=void 0),this._private.panningEnabled&&this._private.zoomingEnabled){var n;if(b(e)){var r=e;e=this.$(r)}else if(P(e)){var i=e;(n={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2}).w=n.x2-n.x1,n.h=n.y2-n.y1}else N(e)||(e=this.mutableElements());if(!N(e)||!e.empty()){n=n||e.boundingBox();var a,o=this.width(),s=this.height();if(t=_(t)?t:0,!isNaN(o)&&!isNaN(s)&&o>0&&s>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0)return{zoom:a=(a=(a=Math.min((o-2*t)/n.w,(s-2*t)/n.h))>this._private.maxZoom?this._private.maxZoom:a)<this._private.minZoom?this._private.minZoom:a,pan:{x:(o-a*(n.x1+n.x2))/2,y:(s-a*(n.y1+n.y2))/2}}}}},zoomRange:function(e,t){var n=this._private;if(null==t){var r=e;e=r.min,t=r.max}return _(e)&&_(t)&&e<=t?(n.minZoom=e,n.maxZoom=t):_(e)&&void 0===t&&e<=n.maxZoom?n.minZoom=e:_(t)&&void 0===e&&t>=n.minZoom&&(n.maxZoom=t),this},minZoom:function(e){return void 0===e?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return void 0===e?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t,n,r=this._private,i=r.pan,a=r.zoom,o=!1;if(r.zoomingEnabled||(o=!0),_(e)?n=e:E(e)&&(n=e.level,null!=e.position?t=hn(e.position,a,i):null!=e.renderedPosition&&(t=e.renderedPosition),null==t||r.panningEnabled||(o=!0)),n=(n=n>r.maxZoom?r.maxZoom:n)<r.minZoom?r.minZoom:n,o||!_(n)||n===a||null!=t&&(!_(t.x)||!_(t.y)))return null;if(null!=t){var s=i,l=a,u=n;return{zoomed:!0,panned:!0,zoom:u,pan:{x:-u/l*(t.x-s.x)+t.x,y:-u/l*(t.y-s.y)+t.y}}}return{zoomed:!0,panned:!1,zoom:n,pan:i}},zoom:function(e){if(void 0===e)return this._private.zoom;var t=this.getZoomedViewport(e),n=this._private;return null!=t&&t.zoomed?(n.zoom=t.zoom,t.panned&&(n.pan.x=t.pan.x,n.pan.y=t.pan.y),this.emit("zoom"+(t.panned?" pan":"")+" viewport"),this.notify("viewport"),this):this},viewport:function(e){var t=this._private,n=!0,r=!0,i=[],a=!1,o=!1;if(!e)return this;if(_(e.zoom)||(n=!1),E(e.pan)||(r=!1),!n&&!r)return this;if(n){var s=e.zoom;s<t.minZoom||s>t.maxZoom||!t.zoomingEnabled?a=!0:(t.zoom=s,i.push("zoom"))}if(r&&(!a||!e.cancelOnFailedZoom)&&t.panningEnabled){var l=e.pan;_(l.x)&&(t.pan.x=l.x,o=!1),_(l.y)&&(t.pan.y=l.y,o=!1),o||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(b(e)){var n=e;e=this.mutableElements().filter(n)}else N(e)||(e=this.mutableElements());if(0!==e.length){var r=e.boundingBox(),i=this.width(),a=this.height();return{x:(i-(t=void 0===t?this._private.zoom:t)*(r.x1+r.x2))/2,y:(a-t*(r.y1+r.y2))/2}}}},reset:function(){return this._private.panningEnabled&&this._private.zoomingEnabled?(this.viewport({pan:{x:0,y:0},zoom:1}),this):this},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e,t,n=this._private,r=n.container,i=this;return n.sizeCache=n.sizeCache||(r?(e=i.window().getComputedStyle(r),t=function(t){return parseFloat(e.getPropertyValue(t))},{width:r.clientWidth-t("padding-left")-t("padding-right"),height:r.clientHeight-t("padding-top")-t("padding-bottom")}):{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,n=this.renderedExtent(),r={x1:(n.x1-e.x)/t,x2:(n.x2-e.x)/t,y1:(n.y1-e.y)/t,y2:(n.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}},multiClickDebounceTime:function(e){return e?(this._private.multiClickDebounceTime=e,this):this._private.multiClickDebounceTime}};rc.centre=rc.center,rc.autolockNodes=rc.autolock,rc.autoungrabifyNodes=rc.autoungrabify;var ic={data:hs.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:hs.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:hs.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:hs.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};ic.attr=ic.data,ic.removeAttr=ic.removeData;var ac=function(e){var t=this,n=(e=Q({},e)).container;n&&!C(n)&&C(n[0])&&(n=n[0]);var r=n?n._cyreg:null;(r=r||{})&&r.cy&&(r.cy.destroy(),r={});var i=r.readies=r.readies||[];n&&(n._cyreg=r),r.cy=t;var a=void 0!==d&&void 0!==n&&!e.headless,o=e;o.layout=Q({name:a?"grid":"null"},o.layout),o.renderer=Q({name:a?"canvas":"null"},o.renderer);var s=function(e,t,n){return void 0!==t?t:void 0!==n?n:e},l=this._private={container:n,ready:!1,options:o,elements:new bu(this),listeners:[],aniEles:new bu(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:s(!0,o.zoomingEnabled),userZoomingEnabled:s(!0,o.userZoomingEnabled),panningEnabled:s(!0,o.panningEnabled),userPanningEnabled:s(!0,o.userPanningEnabled),boxSelectionEnabled:s(!0,o.boxSelectionEnabled),autolock:s(!1,o.autolock,o.autolockNodes),autoungrabify:s(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:s(!1,o.autounselectify),styleEnabled:void 0===o.styleEnabled?a:o.styleEnabled,zoom:_(o.zoom)?o.zoom:1,pan:{x:E(o.pan)&&_(o.pan.x)?o.pan.x:0,y:E(o.pan)&&_(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:s(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var u=function(e,t){if(e.some(R))return Gi.all(e).then(t);t(e)};l.styleEnabled&&t.setStyle([]);var c=Q({},o,o.renderer);t.initRenderer(c);var h=function(e,n,r){t.notifications(!1);var i=t.mutableElements();i.length>0&&i.remove(),null!=e&&(E(e)||w(e))&&t.add(e),t.one("layoutready",(function(e){t.notifications(!0),t.emit(e),t.one("load",n),t.emitAndNotify("load")})).one("layoutstop",(function(){t.one("done",r),t.emit("done")}));var a=Q({},t._private.options.layout);a.eles=t.elements(),t.layout(a).run()};u([o.style,o.elements],(function(e){var n=e[0],a=e[1];l.styleEnabled&&t.style().append(n),h(a,(function(){t.startAnimationLoop(),l.ready=!0,x(o.ready)&&t.on("ready",o.ready);for(var e=0;e<i.length;e++){var n=i[e];t.on("ready",n)}r&&(r.readies=[]),t.emit("ready")}),o.done)}))},oc=ac.prototype;Q(oc,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},window:function(){if(null==this._private.container)return d;var e=this._private.container.ownerDocument;return void 0===e||null==e?d:e.defaultView||d},mount:function(e){if(null!=e){var t=this,n=t._private,r=n.options;return!C(e)&&C(e[0])&&(e=e[0]),t.stopAnimationLoop(),t.destroyRenderer(),n.container=e,n.styleEnabled=!0,t.invalidateSize(),t.initRenderer(Q({},r,r.renderer,{name:"null"===r.renderer.name?"canvas":r.renderer.name})),t.startAnimationLoop(),t.style(r.style),t.emit("mount"),t}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return Lt(this._private.options)},json:function(e){var t=this,n=t._private,r=t.mutableElements(),i=function(e){return t.getElementById(e.id())};if(E(e)){if(t.startBatch(),e.elements){var a={},o=function(e,n){for(var r=[],i=[],o=0;o<e.length;o++){var s=e[o];if(s.data.id){var l=""+s.data.id,u=t.getElementById(l);a[l]=!0,0!==u.length?i.push({ele:u,json:s}):n?(s.group=n,r.push(s)):r.push(s)}else Nt("cy.json() cannot handle elements without an ID attribute")}t.add(r);for(var c=0;c<i.length;c++){var h=i[c],d=h.ele,p=h.json;d.json(p)}};if(w(e.elements))o(e.elements);else for(var s=["nodes","edges"],l=0;l<s.length;l++){var u=s[l],c=e.elements[u];w(c)&&o(c,u)}var h=t.collection();r.filter((function(e){return!a[e.id()]})).forEach((function(e){e.isParent()?h.merge(e):e.remove()})),h.forEach((function(e){return e.children().move({parent:null})})),h.forEach((function(e){return i(e).remove()}))}e.style&&t.style(e.style),null!=e.zoom&&e.zoom!==n.zoom&&t.zoom(e.zoom),e.pan&&(e.pan.x===n.pan.x&&e.pan.y===n.pan.y||t.pan(e.pan)),e.data&&t.data(e.data);for(var d=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],p=0;p<d.length;p++){var g=d[p];null!=e[g]&&t[g](e[g])}return t.endBatch(),this}var f={};e?f.elements=this.elements().map((function(e){return e.json()})):(f.elements={},r.forEach((function(e){var t=e.group();f.elements[t]||(f.elements[t]=[]),f.elements[t].push(e.json())}))),this._private.styleEnabled&&(f.style=t.style().json()),f.data=Lt(t.data());var v=n.options;return f.zoomingEnabled=n.zoomingEnabled,f.userZoomingEnabled=n.userZoomingEnabled,f.zoom=n.zoom,f.minZoom=n.minZoom,f.maxZoom=n.maxZoom,f.panningEnabled=n.panningEnabled,f.userPanningEnabled=n.userPanningEnabled,f.pan=Lt(n.pan),f.boxSelectionEnabled=n.boxSelectionEnabled,f.renderer=Lt(v.renderer),f.hideEdgesOnViewport=v.hideEdgesOnViewport,f.textureOnViewport=v.textureOnViewport,f.wheelSensitivity=v.wheelSensitivity,f.motionBlur=v.motionBlur,f.multiClickDebounceTime=v.multiClickDebounceTime,f}}),oc.$id=oc.getElementById,[wu,ku,Ru,Bu,Fu,zu,Yu,Xu,tc,rc,ic].forEach((function(e){Q(oc,e)}));var sc={fit:!0,directed:!1,padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}},lc={maximal:!1,acyclic:!1},uc=function(e){return e.scratch("breadthfirst")},cc=function(e,t){return e.scratch("breadthfirst",t)};function hc(e){this.options=Q({},sc,lc,e)}hc.prototype.run=function(){var e,t=this.options,n=t,r=t.cy,i=n.eles,a=i.nodes().filter((function(e){return!e.isParent()})),o=i,s=n.directed,l=n.acyclic||n.maximal||n.maximalAdjustments>0,u=Ln(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(N(n.roots))e=n.roots;else if(w(n.roots)){for(var c=[],h=0;h<n.roots.length;h++){var d=n.roots[h],p=r.getElementById(d);c.push(p)}e=r.collection(c)}else if(b(n.roots))e=r.$(n.roots);else if(s)e=a.roots();else{var g=i.components();e=r.collection();for(var f=function(t){var n=g[t],r=n.maxDegree(!1),i=n.filter((function(e){return e.degree(!1)===r}));e=e.add(i)},v=0;v<g.length;v++)f(v)}var y=[],m={},x=function(e,t){null==y[t]&&(y[t]=[]);var n=y[t].length;y[t].push(e),cc(e,{index:n,depth:t})},E=function(e,t){var n=uc(e),r=n.depth,i=n.index;y[r][i]=null,x(e,t)};o.bfs({roots:e,directed:n.directed,visit:function(e,t,n,r,i){var a=e[0],o=a.id();x(a,i),m[o]=!0}});for(var T=[],_=0;_<a.length;_++){var D=a[_];m[D.id()]||T.push(D)}var C=function(e){for(var t=y[e],n=0;n<t.length;n++){var r=t[n];null!=r?cc(r,{depth:e,index:n}):(t.splice(n,1),n--)}},A=function(){for(var e=0;e<y.length;e++)C(e)},L=function(e,t){for(var r=uc(e),a=e.incomers().filter((function(e){return e.isNode()&&i.has(e)})),o=-1,s=e.id(),l=0;l<a.length;l++){var u=a[l],c=uc(u);o=Math.max(o,c.depth)}if(r.depth<=o){if(!n.acyclic&&t[s])return null;var h=o+1;return E(e,h),t[s]=h,!0}return!1};if(s&&l){var S=[],O={},I=function(e){return S.push(e)},k=function(){return S.shift()};for(a.forEach((function(e){return S.push(e)}));S.length>0;){var M=k(),P=L(M,O);if(P)M.outgoers().filter((function(e){return e.isNode()&&i.has(e)})).forEach(I);else if(null===P){Nt("Detected double maximal shift for node `"+M.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}A();var R=0;if(n.avoidOverlap)for(var B=0;B<a.length;B++){var F=a[B].layoutDimensions(n),z=F.w,G=F.h;R=Math.max(R,z,G)}var Y={},X=function(e){if(Y[e.id()])return Y[e.id()];for(var t=uc(e).depth,n=e.neighborhood(),r=0,i=0,o=0;o<n.length;o++){var s=n[o];if(!s.isEdge()&&!s.isParent()&&a.has(s)){var l=uc(s);if(null!=l){var u=l.index,c=l.depth;if(null!=u&&null!=c){var h=y[c].length;c<t&&(r+=u/h,i++)}}}}return r/=i=Math.max(1,i),0===i&&(r=0),Y[e.id()]=r,r},V=function(e,t){var n=X(e)-X(t);return 0===n?Z(e.id(),t.id()):n};void 0!==n.depthSort&&(V=n.depthSort);for(var U=0;U<y.length;U++)y[U].sort(V),C(U);for(var j=[],H=0;H<T.length;H++)j.push(T[H]);y.unshift(j),A();for(var q=0,W=0;W<y.length;W++)q=Math.max(y[W].length,q);var $={x:u.x1+u.w/2,y:u.x1+u.h/2},K=y.reduce((function(e,t){return Math.max(e,t.length)}),0),Q=function(e){var t=uc(e),r=t.depth,i=t.index,a=y[r].length,o=Math.max(u.w/((n.grid?K:a)+1),R),s=Math.max(u.h/(y.length+1),R),l=Math.min(u.w/2/y.length,u.h/2/y.length);if(l=Math.max(l,R),n.circle){var c=l*r+l-(y.length>0&&y[0].length<=3?l/2:0),h=2*Math.PI/y[r].length*i;return 0===r&&1===y[0].length&&(c=1),{x:$.x+c*Math.cos(h),y:$.y+c*Math.sin(h)}}return{x:$.x+(i+1-(a+1)/2)*o,y:(r+1)*s}};return i.nodes().layoutPositions(this,n,Q),this};var dc={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function pc(e){this.options=Q({},dc,e)}pc.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,a=r.nodes().not(":parent");t.sort&&(a=a.sort(t.sort));for(var o,s=Ln(t.boundingBox?t.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=(void 0===t.sweep?2*Math.PI-2*Math.PI/a.length:t.sweep)/Math.max(1,a.length-1),c=0,h=0;h<a.length;h++){var d=a[h].layoutDimensions(t),p=d.w,g=d.h;c=Math.max(c,p,g)}if(o=_(t.radius)?t.radius:a.length<=1?0:Math.min(s.h,s.w)/2-c,a.length>1&&t.avoidOverlap){c*=1.75;var f=Math.cos(u)-Math.cos(0),v=Math.sin(u)-Math.sin(0),y=Math.sqrt(c*c/(f*f+v*v));o=Math.max(y,o)}var m=function(e,n){var r=t.startAngle+n*u*(i?1:-1),a=o*Math.cos(r),s=o*Math.sin(r);return{x:l.x+a,y:l.y+s}};return r.nodes().layoutPositions(this,t,m),this};var gc,fc={fit:!0,padding:30,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function vc(e){this.options=Q({},fc,e)}vc.prototype.run=function(){for(var e=this.options,t=e,n=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,r=e.cy,i=t.eles,a=i.nodes().not(":parent"),o=Ln(t.boundingBox?t.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=0,c=0;c<a.length;c++){var h=a[c],d=void 0;d=t.concentric(h),l.push({value:d,node:h}),h._private.scratch.concentric=d}a.updateStyle();for(var p=0;p<a.length;p++){var g=a[p].layoutDimensions(t);u=Math.max(u,g.w,g.h)}l.sort((function(e,t){return t.value-e.value}));for(var f=t.levelWidth(a),v=[[]],y=v[0],m=0;m<l.length;m++){var b=l[m];y.length>0&&Math.abs(y[0].value-b.value)>=f&&(y=[],v.push(y)),y.push(b)}var x=u+t.minNodeSpacing;if(!t.avoidOverlap){var w=v.length>0&&v[0].length>1,E=(Math.min(o.w,o.h)/2-x)/(v.length+w?1:0);x=Math.min(x,E)}for(var T=0,_=0;_<v.length;_++){var D=v[_],C=void 0===t.sweep?2*Math.PI-2*Math.PI/D.length:t.sweep,N=D.dTheta=C/Math.max(1,D.length-1);if(D.length>1&&t.avoidOverlap){var A=Math.cos(N)-Math.cos(0),L=Math.sin(N)-Math.sin(0),S=Math.sqrt(x*x/(A*A+L*L));T=Math.max(S,T)}D.r=T,T+=x}if(t.equidistant){for(var O=0,I=0,k=0;k<v.length;k++){var M=v[k].r-I;O=Math.max(O,M)}I=0;for(var P=0;P<v.length;P++){var R=v[P];0===P&&(I=R.r),R.r=I,I+=O}}for(var B={},F=0;F<v.length;F++)for(var z=v[F],G=z.dTheta,Y=z.r,X=0;X<z.length;X++){var V=z[X],U=t.startAngle+(n?1:-1)*G*X,j={x:s.x+Y*Math.cos(U),y:s.y+Y*Math.sin(U)};B[V.node.id()]=j}return i.nodes().layoutPositions(this,t,(function(e){var t=e.id();return B[t]})),this};var yc={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,t){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function mc(e){this.options=Q({},yc,e),this.options.layout=this;var t=this.options.eles.nodes(),n=this.options.eles.edges().filter((function(e){var n=e.source().data("id"),r=e.target().data("id"),i=t.some((function(e){return e.data("id")===n})),a=t.some((function(e){return e.data("id")===r}));return!i||!a}));this.options.eles=this.options.eles.not(n)}mc.prototype.run=function(){var e=this.options,t=e.cy,n=this;n.stopped=!1,!0!==e.animate&&!1!==e.animate||n.emit({type:"layoutstart",layout:n}),gc=!0===e.debug;var r=xc(t,n,e);gc&&bc(r),e.randomize&&Tc(r);var i=rt(),a=function(){Dc(r,t,e),!0===e.fit&&t.fit(e.padding)},o=function(t){return!(n.stopped||t>=e.numIter||(Cc(r,e),r.temperature=r.temperature*e.coolingFactor,r.temperature<e.minTemp))},s=function(){if(!0===e.animate||!1===e.animate)a(),n.one("layoutstop",e.stop),n.emit({type:"layoutstop",layout:n});else{var t=e.eles.nodes(),i=_c(r,e,t);t.layoutPositions(n,e,i)}},l=0,u=!0;if(!0===e.animate)!function t(){for(var n=0;u&&n<e.refresh;)u=o(l),l++,n++;u?(rt()-i>=e.animationThreshold&&a(),nt(t)):(Fc(r,e),s())}();else{for(;u;)u=o(l),l++;Fc(r,e),s()}return this},mc.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},mc.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var bc,xc=function(e,t,n){for(var r=n.eles.edges(),i=n.eles.nodes(),a=Ln(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:r.size(),temperature:n.initialTemp,clientWidth:a.w,clientHeight:a.h,boundingBox:a},s=n.eles.components(),l={},u=0;u<s.length;u++)for(var c=s[u],h=0;h<c.length;h++)l[c[h].id()]=u;for(u=0;u<o.nodeSize;u++){var d=(y=i[u]).layoutDimensions(n);(M={}).isLocked=y.locked(),M.id=y.data("id"),M.parentId=y.data("parent"),M.cmptId=l[y.id()],M.children=[],M.positionX=y.position("x"),M.positionY=y.position("y"),M.offsetX=0,M.offsetY=0,M.height=d.w,M.width=d.h,M.maxX=M.positionX+M.width/2,M.minX=M.positionX-M.width/2,M.maxY=M.positionY+M.height/2,M.minY=M.positionY-M.height/2,M.padLeft=parseFloat(y.style("padding")),M.padRight=parseFloat(y.style("padding")),M.padTop=parseFloat(y.style("padding")),M.padBottom=parseFloat(y.style("padding")),M.nodeRepulsion=x(n.nodeRepulsion)?n.nodeRepulsion(y):n.nodeRepulsion,o.layoutNodes.push(M),o.idToIndex[M.id]=u}var p=[],g=0,f=-1,v=[];for(u=0;u<o.nodeSize;u++){var y,m=(y=o.layoutNodes[u]).parentId;null!=m?o.layoutNodes[o.idToIndex[m]].children.push(y.id):(p[++f]=y.id,v.push(y.id))}for(o.graphSet.push(v);g<=f;){var b=p[g++],w=o.idToIndex[b],E=o.layoutNodes[w].children;if(E.length>0)for(o.graphSet.push(E),u=0;u<E.length;u++)p[++f]=E[u]}for(u=0;u<o.graphSet.length;u++){var T=o.graphSet[u];for(h=0;h<T.length;h++){var _=o.idToIndex[T[h]];o.indexToGraph[_]=u}}for(u=0;u<o.edgeSize;u++){var D=r[u],C={};C.id=D.data("id"),C.sourceId=D.data("source"),C.targetId=D.data("target");var N=x(n.idealEdgeLength)?n.idealEdgeLength(D):n.idealEdgeLength,A=x(n.edgeElasticity)?n.edgeElasticity(D):n.edgeElasticity,L=o.idToIndex[C.sourceId],S=o.idToIndex[C.targetId];if(o.indexToGraph[L]!=o.indexToGraph[S]){for(var O=wc(C.sourceId,C.targetId,o),I=o.graphSet[O],k=0,M=o.layoutNodes[L];-1===I.indexOf(M.id);)M=o.layoutNodes[o.idToIndex[M.parentId]],k++;for(M=o.layoutNodes[S];-1===I.indexOf(M.id);)M=o.layoutNodes[o.idToIndex[M.parentId]],k++;N*=k*n.nestingFactor}C.idealLength=N,C.elasticity=A,o.layoutEdges.push(C)}return o},wc=function(e,t,n){var r=Ec(e,t,0,n);return 2>r.count?0:r.graph},Ec=function e(t,n,r,i){var a=i.graphSet[r];if(-1<a.indexOf(t)&&-1<a.indexOf(n))return{count:2,graph:r};for(var o=0,s=0;s<a.length;s++){var l=a[s],u=i.idToIndex[l],c=i.layoutNodes[u].children;if(0!==c.length){var h=e(t,n,i.indexToGraph[i.idToIndex[c[0]]],i);if(0!==h.count){if(1!==h.count)return h;if(2==++o)break}}}return{count:o,graph:r}},Tc=function(e,t){for(var n=e.clientWidth,r=e.clientHeight,i=0;i<e.nodeSize;i++){var a=e.layoutNodes[i];0!==a.children.length||a.isLocked||(a.positionX=Math.random()*n,a.positionY=Math.random()*r)}},_c=function(e,t,n){var r=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return t.boundingBox&&(n.forEach((function(t){var n=e.layoutNodes[e.idToIndex[t.data("id")]];i.x1=Math.min(i.x1,n.positionX),i.x2=Math.max(i.x2,n.positionX),i.y1=Math.min(i.y1,n.positionY),i.y2=Math.max(i.y2,n.positionY)})),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(n,a){var o=e.layoutNodes[e.idToIndex[n.data("id")]];if(t.boundingBox){var s=(o.positionX-i.x1)/i.w,l=(o.positionY-i.y1)/i.h;return{x:r.x1+s*r.w,y:r.y1+l*r.h}}return{x:o.positionX,y:o.positionY}}},Dc=function(e,t,n){var r=n.layout,i=n.eles.nodes(),a=_c(e,n,i);i.positions(a),!0!==e.ready&&(e.ready=!0,r.one("layoutready",n.ready),r.emit({type:"layoutready",layout:this}))},Cc=function(e,t,n){Nc(e,t),Ic(e),kc(e,t),Mc(e),Pc(e)},Nc=function(e,t){for(var n=0;n<e.graphSet.length;n++)for(var r=e.graphSet[n],i=r.length,a=0;a<i;a++)for(var o=e.layoutNodes[e.idToIndex[r[a]]],s=a+1;s<i;s++){var l=e.layoutNodes[e.idToIndex[r[s]]];Lc(o,l,e,t)}},Ac=function(e){return-e+2*e*Math.random()},Lc=function(e,t,n,r){if(e.cmptId===t.cmptId||n.isCompound){var i=t.positionX-e.positionX,a=t.positionY-e.positionY,o=1;0===i&&0===a&&(i=Ac(o),a=Ac(o));var s=Sc(e,t,i,a);if(s>0)var l=(c=r.nodeOverlap*s)*i/(v=Math.sqrt(i*i+a*a)),u=c*a/v;else{var c,h=Oc(e,i,a),d=Oc(t,-1*i,-1*a),p=d.x-h.x,g=d.y-h.y,f=p*p+g*g,v=Math.sqrt(f);l=(c=(e.nodeRepulsion+t.nodeRepulsion)/f)*p/v,u=c*g/v}e.isLocked||(e.offsetX-=l,e.offsetY-=u),t.isLocked||(t.offsetX+=l,t.offsetY+=u)}},Sc=function(e,t,n,r){if(n>0)var i=e.maxX-t.minX;else i=t.maxX-e.minX;if(r>0)var a=e.maxY-t.minY;else a=t.maxY-e.minY;return i>=0&&a>=0?Math.sqrt(i*i+a*a):0},Oc=function(e,t,n){var r=e.positionX,i=e.positionY,a=e.height||1,o=e.width||1,s=n/t,l=a/o,u={};return 0===t&&0<n||0===t&&0>n?(u.x=r,u.y=i+a/2,u):0<t&&-1*l<=s&&s<=l?(u.x=r+o/2,u.y=i+o*n/2/t,u):0>t&&-1*l<=s&&s<=l?(u.x=r-o/2,u.y=i-o*n/2/t,u):0<n&&(s<=-1*l||s>=l)?(u.x=r+a*t/2/n,u.y=i+a/2,u):0>n&&(s<=-1*l||s>=l)?(u.x=r-a*t/2/n,u.y=i-a/2,u):u},Ic=function(e,t){for(var n=0;n<e.edgeSize;n++){var r=e.layoutEdges[n],i=e.idToIndex[r.sourceId],a=e.layoutNodes[i],o=e.idToIndex[r.targetId],s=e.layoutNodes[o],l=s.positionX-a.positionX,u=s.positionY-a.positionY;if(0!==l||0!==u){var c=Oc(a,l,u),h=Oc(s,-1*l,-1*u),d=h.x-c.x,p=h.y-c.y,g=Math.sqrt(d*d+p*p),f=Math.pow(r.idealLength-g,2)/r.elasticity;if(0!==g)var v=f*d/g,y=f*p/g;else v=0,y=0;a.isLocked||(a.offsetX+=v,a.offsetY+=y),s.isLocked||(s.offsetX-=v,s.offsetY-=y)}}},kc=function(e,t){if(0!==t.gravity)for(var n=1,r=0;r<e.graphSet.length;r++){var i=e.graphSet[r],a=i.length;if(0===r)var o=e.clientHeight/2,s=e.clientWidth/2;else{var l=e.layoutNodes[e.idToIndex[i[0]]],u=e.layoutNodes[e.idToIndex[l.parentId]];o=u.positionX,s=u.positionY}for(var c=0;c<a;c++){var h=e.layoutNodes[e.idToIndex[i[c]]];if(!h.isLocked){var d=o-h.positionX,p=s-h.positionY,g=Math.sqrt(d*d+p*p);if(g>n){var f=t.gravity*d/g,v=t.gravity*p/g;h.offsetX+=f,h.offsetY+=v}}}}},Mc=function(e,t){var n=[],r=0,i=-1;for(n.push.apply(n,e.graphSet[0]),i+=e.graphSet[0].length;r<=i;){var a=n[r++],o=e.idToIndex[a],s=e.layoutNodes[o],l=s.children;if(0<l.length&&!s.isLocked){for(var u=s.offsetX,c=s.offsetY,h=0;h<l.length;h++){var d=e.layoutNodes[e.idToIndex[l[h]]];d.offsetX+=u,d.offsetY+=c,n[++i]=l[h]}s.offsetX=0,s.offsetY=0}}},Pc=function(e,t){for(var n=0;n<e.nodeSize;n++)0<(i=e.layoutNodes[n]).children.length&&(i.maxX=void 0,i.minX=void 0,i.maxY=void 0,i.minY=void 0);for(n=0;n<e.nodeSize;n++)if(!(0<(i=e.layoutNodes[n]).children.length||i.isLocked)){var r=Rc(i.offsetX,i.offsetY,e.temperature);i.positionX+=r.x,i.positionY+=r.y,i.offsetX=0,i.offsetY=0,i.minX=i.positionX-i.width,i.maxX=i.positionX+i.width,i.minY=i.positionY-i.height,i.maxY=i.positionY+i.height,Bc(i,e)}for(n=0;n<e.nodeSize;n++){var i;0<(i=e.layoutNodes[n]).children.length&&!i.isLocked&&(i.positionX=(i.maxX+i.minX)/2,i.positionY=(i.maxY+i.minY)/2,i.width=i.maxX-i.minX,i.height=i.maxY-i.minY)}},Rc=function(e,t,n){var r=Math.sqrt(e*e+t*t);if(r>n)var i={x:n*e/r,y:n*t/r};else i={x:e,y:t};return i},Bc=function e(t,n){var r=t.parentId;if(null!=r){var i=n.layoutNodes[n.idToIndex[r]],a=!1;return(null==i.maxX||t.maxX+i.padRight>i.maxX)&&(i.maxX=t.maxX+i.padRight,a=!0),(null==i.minX||t.minX-i.padLeft<i.minX)&&(i.minX=t.minX-i.padLeft,a=!0),(null==i.maxY||t.maxY+i.padBottom>i.maxY)&&(i.maxY=t.maxY+i.padBottom,a=!0),(null==i.minY||t.minY-i.padTop<i.minY)&&(i.minY=t.minY-i.padTop,a=!0),a?e(i,n):void 0}},Fc=function(e,t){for(var n=e.layoutNodes,r=[],i=0;i<n.length;i++){var a=n[i],o=a.cmptId;(r[o]=r[o]||[]).push(a)}var s=0;for(i=0;i<r.length;i++)if(f=r[i]){f.x1=1/0,f.x2=-1/0,f.y1=1/0,f.y2=-1/0;for(var l=0;l<f.length;l++){var u=f[l];f.x1=Math.min(f.x1,u.positionX-u.width/2),f.x2=Math.max(f.x2,u.positionX+u.width/2),f.y1=Math.min(f.y1,u.positionY-u.height/2),f.y2=Math.max(f.y2,u.positionY+u.height/2)}f.w=f.x2-f.x1,f.h=f.y2-f.y1,s+=f.w*f.h}r.sort((function(e,t){return t.w*t.h-e.w*e.h}));var c=0,h=0,d=0,p=0,g=Math.sqrt(s)*e.clientWidth/e.clientHeight;for(i=0;i<r.length;i++){var f;if(f=r[i]){for(l=0;l<f.length;l++)(u=f[l]).isLocked||(u.positionX+=c-f.x1,u.positionY+=h-f.y1);c+=f.w+t.componentSpacing,d+=f.w+t.componentSpacing,p=Math.max(p,f.h),d>g&&(h+=p+t.componentSpacing,c=0,d=0,p=0)}}},zc={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Gc(e){this.options=Q({},zc,e)}Gc.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=r.nodes().not(":parent");t.sort&&(i=i.sort(t.sort));var a=Ln(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(0===a.h||0===a.w)r.nodes().layoutPositions(this,t,(function(e){return{x:a.x1,y:a.y1}}));else{var o=i.size(),s=Math.sqrt(o*a.h/a.w),l=Math.round(s),u=Math.round(a.w/a.h*s),c=function(e){if(null==e)return Math.min(l,u);Math.min(l,u)==l?l=e:u=e},h=function(e){if(null==e)return Math.max(l,u);Math.max(l,u)==l?l=e:u=e},d=t.rows,p=null!=t.cols?t.cols:t.columns;if(null!=d&&null!=p)l=d,u=p;else if(null!=d&&null==p)l=d,u=Math.ceil(o/l);else if(null==d&&null!=p)u=p,l=Math.ceil(o/u);else if(u*l>o){var g=c(),f=h();(g-1)*f>=o?c(g-1):(f-1)*g>=o&&h(f-1)}else for(;u*l<o;){var v=c(),y=h();(y+1)*v>=o?h(y+1):c(v+1)}var m=a.w/u,b=a.h/l;if(t.condense&&(m=0,b=0),t.avoidOverlap)for(var x=0;x<i.length;x++){var w=i[x],E=w._private.position;null!=E.x&&null!=E.y||(E.x=0,E.y=0);var T=w.layoutDimensions(t),_=t.avoidOverlapPadding,D=T.w+_,C=T.h+_;m=Math.max(m,D),b=Math.max(b,C)}for(var N={},A=function(e,t){return!!N["c-"+e+"-"+t]},L=function(e,t){N["c-"+e+"-"+t]=!0},S=0,O=0,I=function(){++O>=u&&(O=0,S++)},k={},M=0;M<i.length;M++){var P=i[M],R=t.position(P);if(R&&(void 0!==R.row||void 0!==R.col)){var B={row:R.row,col:R.col};if(void 0===B.col)for(B.col=0;A(B.row,B.col);)B.col++;else if(void 0===B.row)for(B.row=0;A(B.row,B.col);)B.row++;k[P.id()]=B,L(B.row,B.col)}}var F=function(e,t){var n,r;if(e.locked()||e.isParent())return!1;var i=k[e.id()];if(i)n=i.col*m+m/2+a.x1,r=i.row*b+b/2+a.y1;else{for(;A(S,O);)I();n=O*m+m/2+a.x1,r=S*b+b/2+a.y1,L(S,O),I()}return{x:n,y:r}};i.layoutPositions(this,t,F)}return this};var Yc={ready:function(){},stop:function(){}};function Xc(e){this.options=Q({},Yc,e)}Xc.prototype.run=function(){var e=this.options,t=e.eles,n=this;return e.cy,n.emit("layoutstart"),t.nodes().positions((function(){return{x:0,y:0}})),n.one("layoutready",e.ready),n.emit("layoutready"),n.one("layoutstop",e.stop),n.emit("layoutstop"),this},Xc.prototype.stop=function(){return this};var Vc={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Uc(e){this.options=Q({},Vc,e)}Uc.prototype.run=function(){var e=this.options,t=e.eles.nodes(),n=x(e.positions);function r(t){if(null==e.positions)return cn(t.position());if(n)return e.positions(t);var r=e.positions[t._private.data.id];return null==r?null:r}return t.layoutPositions(this,e,(function(e,t){var n=r(e);return!e.locked()&&null!=n&&n})),this};var jc={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Hc(e){this.options=Q({},jc,e)}Hc.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,r=Ln(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),i=function(e,t){return{x:r.x1+Math.round(Math.random()*r.w),y:r.y1+Math.round(Math.random()*r.h)}};return n.nodes().layoutPositions(this,e,i),this};var qc=[{name:"breadthfirst",impl:hc},{name:"circle",impl:pc},{name:"concentric",impl:vc},{name:"cose",impl:mc},{name:"grid",impl:Gc},{name:"null",impl:Xc},{name:"preset",impl:Uc},{name:"random",impl:Hc}];function Wc(e){this.options=e,this.notifications=0}var $c=function(){},Zc=function(){throw new Error("A headless instance can not render images")};Wc.prototype={recalculateRenderedStyle:$c,notify:function(){this.notifications++},init:$c,isHeadless:function(){return!0},png:Zc,jpg:Zc};var Kc={arrowShapeWidth:.3,registerArrowShapes:function(){var e=this.arrowShapes={},t=this,n=function(e,t,n,r,i,a,o){var s=i.x-n/2-o,l=i.x+n/2+o,u=i.y-n/2-o,c=i.y+n/2+o;return s<=e&&e<=l&&u<=t&&t<=c},r=function(e,t,n,r,i){var a=e*Math.cos(r)-t*Math.sin(r),o=(e*Math.sin(r)+t*Math.cos(r))*n;return{x:a*n+i.x,y:o+i.y}},i=function(e,t,n,i){for(var a=[],o=0;o<e.length;o+=2){var s=e[o],l=e[o+1];a.push(r(s,l,t,n,i))}return a},a=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r.x,r.y)}return t},o=function(e){return e.pstyle("width").pfValue*e.pstyle("arrow-scale").pfValue*2},s=function(r,s){b(s)&&(s=e[s]),e[r]=Q({name:r,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(e,t,n,r,o,s){var l=a(i(this.points,n+2*s,r,o));return Wn(e,t,l)},roughCollide:n,draw:function(e,n,r,a){var o=i(this.points,n,r,a);t.arrowShapeImpl("polygon")(e,o)},spacing:function(e){return 0},gap:o},s)};s("none",{collide:Et,roughCollide:Et,draw:_t,spacing:Tt,gap:Tt}),s("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),s("arrow","triangle"),s("triangle-backcurve",{points:e.triangle.points,controlPoint:[0,-.15],roughCollide:n,draw:function(e,n,a,o,s){var l=i(this.points,n,a,o),u=this.controlPoint,c=r(u[0],u[1],n,a,o);t.arrowShapeImpl(this.name)(e,l,c)},gap:function(e){return.8*o(e)}}),s("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(e,t,n,r,o,s,l){var u=a(i(this.points,n+2*l,r,o)),c=a(i(this.pointsTee,n+2*l,r,o));return Wn(e,t,u)||Wn(e,t,c)},draw:function(e,n,r,a,o){var s=i(this.points,n,r,a),l=i(this.pointsTee,n,r,a);t.arrowShapeImpl(this.name)(e,s,l)}}),s("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(e,t,n,r,o,s,l){var u=o,c=Math.pow(u.x-e,2)+Math.pow(u.y-t,2)<=Math.pow((n+2*l)*this.radius,2),h=a(i(this.points,n+2*l,r,o));return Wn(e,t,h)||c},draw:function(e,n,r,a,o){var s=i(this.pointsTr,n,r,a);t.arrowShapeImpl(this.name)(e,s,a.x,a.y,this.radius*n)},spacing:function(e){return t.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.radius}}),s("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(e,t){var n=this.baseCrossLinePts.slice(),r=t/e,i=3,a=5;return n[i]=n[i]-r,n[a]=n[a]-r,n},collide:function(e,t,n,r,o,s,l){var u=a(i(this.points,n+2*l,r,o)),c=a(i(this.crossLinePts(n,s),n+2*l,r,o));return Wn(e,t,u)||Wn(e,t,c)},draw:function(e,n,r,a,o){var s=i(this.points,n,r,a),l=i(this.crossLinePts(n,o),n,r,a);t.arrowShapeImpl(this.name)(e,s,l)}}),s("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(e){return.525*o(e)}}),s("circle",{radius:.15,collide:function(e,t,n,r,i,a,o){var s=i;return Math.pow(s.x-e,2)+Math.pow(s.y-t,2)<=Math.pow((n+2*o)*this.radius,2)},draw:function(e,n,r,i,a){t.arrowShapeImpl(this.name)(e,i.x,i.y,this.radius*n)},spacing:function(e){return t.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.radius}}),s("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(e){return 1},gap:function(e){return 1}}),s("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),s("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(e){return e.pstyle("width").pfValue*e.pstyle("arrow-scale").value}}),s("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(e){return.95*e.pstyle("width").pfValue*e.pstyle("arrow-scale").value}})}},Qc={projectIntoViewport:function(e,t){var n=this.cy,r=this.findContainerClientCoords(),i=r[0],a=r[1],o=r[4],s=n.pan(),l=n.zoom();return[((e-i)/o-s.x)/l,((t-a)/o-s.y)/l]},findContainerClientCoords:function(){if(this.containerBB)return this.containerBB;var e=this.container,t=e.getBoundingClientRect(),n=this.cy.window().getComputedStyle(e),r=function(e){return parseFloat(n.getPropertyValue(e))},i={left:r("padding-left"),right:r("padding-right"),top:r("padding-top"),bottom:r("padding-bottom")},a={left:r("border-left-width"),right:r("border-right-width"),top:r("border-top-width"),bottom:r("border-bottom-width")},o=e.clientWidth,s=e.clientHeight,l=i.left+i.right,u=i.top+i.bottom,c=a.left+a.right,h=t.width/(o+c),d=o-l,p=s-u,g=t.left+i.left+a.left,f=t.top+i.top+a.top;return this.containerBB=[g,f,d,p,h]},invalidateContainerClientCoordsCache:function(){this.containerBB=null},findNearestElement:function(e,t,n,r){return this.findNearestElements(e,t,n,r)[0]},findNearestElements:function(e,t,n,r){var i,a,o=this,s=this,l=s.getCachedZSortedEles(),u=[],c=s.cy.zoom(),h=s.cy.hasCompoundNodes(),d=(r?24:8)/c,p=(r?8:2)/c,g=(r?8:2)/c,f=1/0;function v(e,t){if(e.isNode()){if(a)return;a=e,u.push(e)}if(e.isEdge()&&(null==t||t<f))if(i){if(i.pstyle("z-compound-depth").value===e.pstyle("z-compound-depth").value&&i.pstyle("z-compound-depth").value===e.pstyle("z-compound-depth").value)for(var n=0;n<u.length;n++)if(u[n].isEdge()){u[n]=e,i=e,f=null!=t?t:f;break}}else u.push(e),i=e,f=null!=t?t:f}function y(n){var r=n.outerWidth()+2*p,i=n.outerHeight()+2*p,a=r/2,l=i/2,u=n.position();if(u.x-a<=e&&e<=u.x+a&&u.y-l<=t&&t<=u.y+l&&s.nodeShapes[o.getNodeShape(n)].checkPoint(e,t,0,r,i,u.x,u.y))return v(n,0),!0}function m(n){var r,i=n._private,a=i.rscratch,l=n.pstyle("width").pfValue,c=n.pstyle("arrow-scale").value,p=l/2+d,g=p*p,f=2*p,m=i.source,b=i.target;if("segments"===a.edgeType||"straight"===a.edgeType||"haystack"===a.edgeType){for(var x=a.allpts,w=0;w+3<x.length;w+=2)if(Xn(e,t,x[w],x[w+1],x[w+2],x[w+3],f)&&g>(r=qn(e,t,x[w],x[w+1],x[w+2],x[w+3])))return v(n,r),!0}else if("bezier"===a.edgeType||"multibezier"===a.edgeType||"self"===a.edgeType||"compound"===a.edgeType)for(x=a.allpts,w=0;w+5<a.allpts.length;w+=4)if(Vn(e,t,x[w],x[w+1],x[w+2],x[w+3],x[w+4],x[w+5],f)&&g>(r=Hn(e,t,x[w],x[w+1],x[w+2],x[w+3],x[w+4],x[w+5])))return v(n,r),!0;m=m||i.source,b=b||i.target;var E=o.getArrowWidth(l,c),T=[{name:"source",x:a.arrowStartX,y:a.arrowStartY,angle:a.srcArrowAngle},{name:"target",x:a.arrowEndX,y:a.arrowEndY,angle:a.tgtArrowAngle},{name:"mid-source",x:a.midX,y:a.midY,angle:a.midsrcArrowAngle},{name:"mid-target",x:a.midX,y:a.midY,angle:a.midtgtArrowAngle}];for(w=0;w<T.length;w++){var _=T[w],D=s.arrowShapes[n.pstyle(_.name+"-arrow-shape").value],C=n.pstyle("width").pfValue;if(D.roughCollide(e,t,E,_.angle,{x:_.x,y:_.y},C,d)&&D.collide(e,t,E,_.angle,{x:_.x,y:_.y},C,d))return v(n),!0}h&&u.length>0&&(y(m),y(b))}function b(e,t,n){return Ft(e,t,n)}function x(n,r){var i,a=n._private,o=g;i=r?r+"-":"",n.boundingBox();var s=a.labelBounds[r||"main"],l=n.pstyle(i+"label").value;if("yes"===n.pstyle("text-events").strValue&&l){var u=b(a.rscratch,"labelX",r),c=b(a.rscratch,"labelY",r),h=b(a.rscratch,"labelAngle",r),d=n.pstyle(i+"text-margin-x").pfValue,p=n.pstyle(i+"text-margin-y").pfValue,f=s.x1-o-d,y=s.x2+o-d,m=s.y1-o-p,x=s.y2+o-p;if(h){var w=Math.cos(h),E=Math.sin(h),T=function(e,t){return{x:(e-=u)*w-(t-=c)*E+u,y:e*E+t*w+c}},_=T(f,m),D=T(f,x),C=T(y,m),N=T(y,x),A=[_.x+d,_.y+p,C.x+d,C.y+p,N.x+d,N.y+p,D.x+d,D.y+p];if(Wn(e,t,A))return v(n),!0}else if(Fn(s,e,t))return v(n),!0}}n&&(l=l.interactive);for(var w=l.length-1;w>=0;w--){var E=l[w];E.isNode()?y(E)||x(E):m(E)||x(E)||x(E,"source")||x(E,"target")}return u},getAllInBox:function(e,t,n,r){for(var i=this.getCachedZSortedEles().interactive,a=[],o=Math.min(e,n),s=Math.max(e,n),l=Math.min(t,r),u=Math.max(t,r),c=Ln({x1:e=o,y1:t=l,x2:n=s,y2:r=u}),h=0;h<i.length;h++){var d=i[h];if(d.isNode()){var p=d,g=p.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});Bn(c,g)&&!Gn(g,c)&&a.push(p)}else{var f=d,v=f._private,y=v.rscratch;if(null!=y.startX&&null!=y.startY&&!Fn(c,y.startX,y.startY))continue;if(null!=y.endX&&null!=y.endY&&!Fn(c,y.endX,y.endY))continue;if("bezier"===y.edgeType||"multibezier"===y.edgeType||"self"===y.edgeType||"compound"===y.edgeType||"segments"===y.edgeType||"haystack"===y.edgeType){for(var m=v.rstyle.bezierPts||v.rstyle.linePts||v.rstyle.haystackPts,b=!0,x=0;x<m.length;x++)if(!zn(c,m[x])){b=!1;break}b&&a.push(f)}else"haystack"!==y.edgeType&&"straight"!==y.edgeType||a.push(f)}}return a}},Jc={calculateArrowAngles:function(e){var t,n,r,i,a,o,s=e._private.rscratch,l="haystack"===s.edgeType,u="bezier"===s.edgeType,c="multibezier"===s.edgeType,h="segments"===s.edgeType,d="compound"===s.edgeType,p="self"===s.edgeType;if(l?(r=s.haystackPts[0],i=s.haystackPts[1],a=s.haystackPts[2],o=s.haystackPts[3]):(r=s.arrowStartX,i=s.arrowStartY,a=s.arrowEndX,o=s.arrowEndY),f=s.midX,v=s.midY,h)t=r-s.segpts[0],n=i-s.segpts[1];else if(c||d||p||u){var g=s.allpts;t=r-Dn(g[0],g[2],g[4],.1),n=i-Dn(g[1],g[3],g[5],.1)}else t=r-f,n=i-v;s.srcArrowAngle=bn(t,n);var f=s.midX,v=s.midY;if(l&&(f=(r+a)/2,v=(i+o)/2),t=a-r,n=o-i,h)if((g=s.allpts).length/2%2==0){var y=(m=g.length/2)-2;t=g[m]-g[y],n=g[m+1]-g[y+1]}else{y=(m=g.length/2-1)-2;var m,b=m+2;t=g[m]-g[y],n=g[m+1]-g[y+1]}else if(c||d||p){var x,w,E,T,g=s.allpts;if(s.ctrlpts.length/2%2==0){var _=2+(D=2+(C=g.length/2-1));x=Dn(g[C],g[D],g[_],0),w=Dn(g[C+1],g[D+1],g[_+1],0),E=Dn(g[C],g[D],g[_],1e-4),T=Dn(g[C+1],g[D+1],g[_+1],1e-4)}else{var D,C;_=2+(D=g.length/2-1),x=Dn(g[C=D-2],g[D],g[_],.4999),w=Dn(g[C+1],g[D+1],g[_+1],.4999),E=Dn(g[C],g[D],g[_],.5),T=Dn(g[C+1],g[D+1],g[_+1],.5)}t=E-x,n=T-w}if(s.midtgtArrowAngle=bn(t,n),s.midDispX=t,s.midDispY=n,t*=-1,n*=-1,h&&((g=s.allpts).length/2%2==0||(t=-(g[b=2+(m=g.length/2-1)]-g[m]),n=-(g[b+1]-g[m+1]))),s.midsrcArrowAngle=bn(t,n),h)t=a-s.segpts[s.segpts.length-2],n=o-s.segpts[s.segpts.length-1];else if(c||d||p||u){var N=(g=s.allpts).length;t=a-Dn(g[N-6],g[N-4],g[N-2],.9),n=o-Dn(g[N-5],g[N-3],g[N-1],.9)}else t=a-f,n=o-v;s.tgtArrowAngle=bn(t,n)}};Jc.getArrowWidth=Jc.getArrowHeight=function(e,t){var n=this.arrowWidthCache=this.arrowWidthCache||{},r=n[e+", "+t];return r||(r=Math.max(Math.pow(13.37*e,.9),29)*t,n[e+", "+t]=r,r)};var eh={};function th(e){var t=[];if(null!=e){for(var n=0;n<e.length;n+=2){var r=e[n],i=e[n+1];t.push({x:r,y:i})}return t}}eh.findMidptPtsEtc=function(e,t){var n,r=t.posPts,i=t.intersectionPts,a=t.vectorNormInverse,s=e.pstyle("source-endpoint"),l=e.pstyle("target-endpoint"),u=null!=s.units&&null!=l.units,c=function(e,t,n,r){var i=r-t,a=n-e,o=Math.sqrt(a*a+i*i);return{x:-i/o,y:a/o}};switch(e.pstyle("edge-distances").value){case"node-position":n=r;break;case"intersection":n=i;break;case"endpoints":if(u){var h=o(this.manualEndptToPx(e.source()[0],s),2),d=h[0],p=h[1],g=o(this.manualEndptToPx(e.target()[0],l),2),f=g[0],v=g[1],y={x1:d,y1:p,x2:f,y2:v};a=c(d,p,f,v),n=y}else Nt("Edge ".concat(e.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),n=i}return{midptPts:n,vectorNormInverse:a}},eh.findHaystackPoints=function(e){for(var t=0;t<e.length;t++){var n=e[t],r=n._private,i=r.rscratch;if(!i.haystack){var a=2*Math.random()*Math.PI;i.source={x:Math.cos(a),y:Math.sin(a)},a=2*Math.random()*Math.PI,i.target={x:Math.cos(a),y:Math.sin(a)}}var o=r.source,s=r.target,l=o.position(),u=s.position(),c=o.width(),h=s.width(),d=o.height(),p=s.height(),g=n.pstyle("haystack-radius").value/2;i.haystackPts=i.allpts=[i.source.x*c*g+l.x,i.source.y*d*g+l.y,i.target.x*h*g+u.x,i.target.y*p*g+u.y],i.midX=(i.allpts[0]+i.allpts[2])/2,i.midY=(i.allpts[1]+i.allpts[3])/2,i.edgeType="haystack",i.haystack=!0,this.storeEdgeProjections(n),this.calculateArrowAngles(n),this.recalculateEdgeLabelProjections(n),this.calculateLabelAngles(n)}},eh.findSegmentsPoints=function(e,t){var n=e._private.rscratch,r=e.pstyle("segment-weights"),i=e.pstyle("segment-distances"),a=Math.min(r.pfValue.length,i.pfValue.length);n.edgeType="segments",n.segpts=[];for(var o=0;o<a;o++){var s=r.pfValue[o],l=i.pfValue[o],u=1-s,c=s,h=this.findMidptPtsEtc(e,t),d=h.midptPts,p=h.vectorNormInverse,g={x:d.x1*u+d.x2*c,y:d.y1*u+d.y2*c};n.segpts.push(g.x+p.x*l,g.y+p.y*l)}},eh.findLoopPoints=function(e,t,n,r){var i=e._private.rscratch,a=t.dirCounts,o=t.srcPos,s=e.pstyle("control-point-distances"),l=s?s.pfValue[0]:void 0,u=e.pstyle("loop-direction").pfValue,c=e.pstyle("loop-sweep").pfValue,h=e.pstyle("control-point-step-size").pfValue;i.edgeType="self";var d=n,p=h;r&&(d=0,p=l);var g=u-Math.PI/2,f=g-c/2,v=g+c/2,y=String(u+"_"+c);d=void 0===a[y]?a[y]=0:++a[y],i.ctrlpts=[o.x+1.4*Math.cos(f)*p*(d/3+1),o.y+1.4*Math.sin(f)*p*(d/3+1),o.x+1.4*Math.cos(v)*p*(d/3+1),o.y+1.4*Math.sin(v)*p*(d/3+1)]},eh.findCompoundLoopPoints=function(e,t,n,r){var i=e._private.rscratch;i.edgeType="compound";var a=t.srcPos,o=t.tgtPos,s=t.srcW,l=t.srcH,u=t.tgtW,c=t.tgtH,h=e.pstyle("control-point-step-size").pfValue,d=e.pstyle("control-point-distances"),p=d?d.pfValue[0]:void 0,g=n,f=h;r&&(g=0,f=p);var v=50,y={x:a.x-s/2,y:a.y-l/2},m={x:o.x-u/2,y:o.y-c/2},b={x:Math.min(y.x,m.x),y:Math.min(y.y,m.y)},x=.5,w=Math.max(x,Math.log(.01*s)),E=Math.max(x,Math.log(.01*u));i.ctrlpts=[b.x,b.y-(1+Math.pow(v,1.12)/100)*f*(g/3+1)*w,b.x-(1+Math.pow(v,1.12)/100)*f*(g/3+1)*E,b.y]},eh.findStraightEdgePoints=function(e){e._private.rscratch.edgeType="straight"},eh.findBezierPoints=function(e,t,n,r,i){var a=e._private.rscratch,o=e.pstyle("control-point-step-size").pfValue,s=e.pstyle("control-point-distances"),l=e.pstyle("control-point-weights"),u=s&&l?Math.min(s.value.length,l.value.length):1,c=s?s.pfValue[0]:void 0,h=l.value[0],d=r;a.edgeType=d?"multibezier":"bezier",a.ctrlpts=[];for(var p=0;p<u;p++){var g=(.5-t.eles.length/2+n)*o*(i?-1:1),f=void 0,v=wn(g);d&&(c=s?s.pfValue[p]:o,h=l.value[p]);var y=void 0!==(f=r?c:void 0!==c?v*c:void 0)?f:g,m=1-h,b=h,x=this.findMidptPtsEtc(e,t),w=x.midptPts,E=x.vectorNormInverse,T={x:w.x1*m+w.x2*b,y:w.y1*m+w.y2*b};a.ctrlpts.push(T.x+E.x*y,T.y+E.y*y)}},eh.findTaxiPoints=function(e,t){var n=e._private.rscratch;n.edgeType="segments";var r="vertical",i="horizontal",a="leftward",o="rightward",s="downward",l="upward",u="auto",c=t.posPts,h=t.srcW,d=t.srcH,p=t.tgtW,g=t.tgtH,f="node-position"!==e.pstyle("edge-distances").value,v=e.pstyle("taxi-direction").value,y=v,m=e.pstyle("taxi-turn"),b="%"===m.units,x=m.pfValue,w=x<0,E=e.pstyle("taxi-turn-min-distance").pfValue,T=f?(h+p)/2:0,_=f?(d+g)/2:0,D=c.x2-c.x1,C=c.y2-c.y1,N=function(e,t){return e>0?Math.max(e-t,0):Math.min(e+t,0)},A=N(D,T),L=N(C,_),S=!1;y===u?v=Math.abs(A)>Math.abs(L)?i:r:y===l||y===s?(v=r,S=!0):y!==a&&y!==o||(v=i,S=!0);var O,I=v===r,k=I?L:A,M=I?C:D,P=wn(M),R=!1;S&&(b||w)||!(y===s&&M<0||y===l&&M>0||y===a&&M>0||y===o&&M<0)||(k=(P*=-1)*Math.abs(k),R=!0);var B=function(e){return Math.abs(e)<E||Math.abs(e)>=Math.abs(k)},F=B(O=b?(x<0?1+x:x)*k:(x<0?k:0)+x*P),z=B(Math.abs(k)-Math.abs(O));if(!F&&!z||R)if(I){var G=c.y1+O+(f?d/2*P:0),Y=c.x1,X=c.x2;n.segpts=[Y,G,X,G]}else{var V=c.x1+O+(f?h/2*P:0),U=c.y1,j=c.y2;n.segpts=[V,U,V,j]}else if(I){var H=Math.abs(M)<=d/2,q=Math.abs(D)<=p/2;if(H){var W=(c.x1+c.x2)/2,$=c.y1,Z=c.y2;n.segpts=[W,$,W,Z]}else if(q){var K=(c.y1+c.y2)/2,Q=c.x1,J=c.x2;n.segpts=[Q,K,J,K]}else n.segpts=[c.x1,c.y2]}else{var ee=Math.abs(M)<=h/2,te=Math.abs(C)<=g/2;if(ee){var ne=(c.y1+c.y2)/2,re=c.x1,ie=c.x2;n.segpts=[re,ne,ie,ne]}else if(te){var ae=(c.x1+c.x2)/2,oe=c.y1,se=c.y2;n.segpts=[ae,oe,ae,se]}else n.segpts=[c.x2,c.y1]}},eh.tryToCorrectInvalidPoints=function(e,t){var n=e._private.rscratch;if("bezier"===n.edgeType){var r=t.srcPos,i=t.tgtPos,a=t.srcW,o=t.srcH,s=t.tgtW,l=t.tgtH,u=t.srcShape,c=t.tgtShape,h=!_(n.startX)||!_(n.startY),d=!_(n.arrowStartX)||!_(n.arrowStartY),p=!_(n.endX)||!_(n.endY),g=!_(n.arrowEndX)||!_(n.arrowEndY),f=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth*3,v=En({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),y=v<f,m=En({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.endX,y:n.endY}),b=m<f,x=!1;if(h||d||y){x=!0;var w={x:n.ctrlpts[0]-r.x,y:n.ctrlpts[1]-r.y},E=Math.sqrt(w.x*w.x+w.y*w.y),T={x:w.x/E,y:w.y/E},D=Math.max(a,o),C={x:n.ctrlpts[0]+2*T.x*D,y:n.ctrlpts[1]+2*T.y*D},N=u.intersectLine(r.x,r.y,a,o,C.x,C.y,0);y?(n.ctrlpts[0]=n.ctrlpts[0]+T.x*(f-v),n.ctrlpts[1]=n.ctrlpts[1]+T.y*(f-v)):(n.ctrlpts[0]=N[0]+T.x*f,n.ctrlpts[1]=N[1]+T.y*f)}if(p||g||b){x=!0;var A={x:n.ctrlpts[0]-i.x,y:n.ctrlpts[1]-i.y},L=Math.sqrt(A.x*A.x+A.y*A.y),S={x:A.x/L,y:A.y/L},O=Math.max(a,o),I={x:n.ctrlpts[0]+2*S.x*O,y:n.ctrlpts[1]+2*S.y*O},k=c.intersectLine(i.x,i.y,s,l,I.x,I.y,0);b?(n.ctrlpts[0]=n.ctrlpts[0]+S.x*(f-m),n.ctrlpts[1]=n.ctrlpts[1]+S.y*(f-m)):(n.ctrlpts[0]=k[0]+S.x*f,n.ctrlpts[1]=k[1]+S.y*f)}x&&this.findEndpoints(e)}},eh.storeAllpts=function(e){var t=e._private.rscratch;if("multibezier"===t.edgeType||"bezier"===t.edgeType||"self"===t.edgeType||"compound"===t.edgeType){t.allpts=[],t.allpts.push(t.startX,t.startY);for(var n=0;n+1<t.ctrlpts.length;n+=2)t.allpts.push(t.ctrlpts[n],t.ctrlpts[n+1]),n+3<t.ctrlpts.length&&t.allpts.push((t.ctrlpts[n]+t.ctrlpts[n+2])/2,(t.ctrlpts[n+1]+t.ctrlpts[n+3])/2);var r,i;t.allpts.push(t.endX,t.endY),t.ctrlpts.length/2%2==0?(r=t.allpts.length/2-1,t.midX=t.allpts[r],t.midY=t.allpts[r+1]):(r=t.allpts.length/2-3,i=.5,t.midX=Dn(t.allpts[r],t.allpts[r+2],t.allpts[r+4],i),t.midY=Dn(t.allpts[r+1],t.allpts[r+3],t.allpts[r+5],i))}else if("straight"===t.edgeType)t.allpts=[t.startX,t.startY,t.endX,t.endY],t.midX=(t.startX+t.endX+t.arrowStartX+t.arrowEndX)/4,t.midY=(t.startY+t.endY+t.arrowStartY+t.arrowEndY)/4;else if("segments"===t.edgeType)if(t.allpts=[],t.allpts.push(t.startX,t.startY),t.allpts.push.apply(t.allpts,t.segpts),t.allpts.push(t.endX,t.endY),t.segpts.length%4==0){var a=t.segpts.length/2,o=a-2;t.midX=(t.segpts[o]+t.segpts[a])/2,t.midY=(t.segpts[o+1]+t.segpts[a+1])/2}else{var s=t.segpts.length/2-1;t.midX=t.segpts[s],t.midY=t.segpts[s+1]}},eh.checkForInvalidEdgeWarning=function(e){var t=e[0]._private.rscratch;t.nodesOverlap||_(t.startX)&&_(t.startY)&&_(t.endX)&&_(t.endY)?t.loggedErr=!1:t.loggedErr||(t.loggedErr=!0,Nt("Edge `"+e.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."))},eh.findEdgeControlPoints=function(e){var t=this;if(e&&0!==e.length){for(var n=this,r=n.cy.hasCompoundNodes(),i={map:new Yt,get:function(e){var t=this.map.get(e[0]);return null!=t?t.get(e[1]):null},set:function(e,t){var n=this.map.get(e[0]);null==n&&(n=new Yt,this.map.set(e[0],n)),n.set(e[1],t)}},a=[],o=[],s=0;s<e.length;s++){var l=e[s],u=l._private,c=l.pstyle("curve-style").value;if(!l.removed()&&l.takesUpSpace())if("haystack"!==c){var h="unbundled-bezier"===c||"segments"===c||"straight"===c||"straight-triangle"===c||"taxi"===c,d="unbundled-bezier"===c||"bezier"===c,p=u.source,g=u.target,f=[p.poolIndex(),g.poolIndex()].sort(),v=i.get(f);null==v&&(v={eles:[]},i.set(f,v),a.push(f)),v.eles.push(l),h&&(v.hasUnbundled=!0),d&&(v.hasBezier=!0)}else o.push(l)}for(var y=function(e){var o=a[e],s=i.get(o),l=void 0;if(!s.hasUnbundled){var u=s.eles[0].parallelEdges().filter((function(e){return e.isBundledBezier()}));Rt(s.eles),u.forEach((function(e){return s.eles.push(e)})),s.eles.sort((function(e,t){return e.poolIndex()-t.poolIndex()}))}var c=s.eles[0],h=c.source(),d=c.target();if(h.poolIndex()>d.poolIndex()){var p=h;h=d,d=p}var g=s.srcPos=h.position(),f=s.tgtPos=d.position(),v=s.srcW=h.outerWidth(),y=s.srcH=h.outerHeight(),m=s.tgtW=d.outerWidth(),b=s.tgtH=d.outerHeight(),x=s.srcShape=n.nodeShapes[t.getNodeShape(h)],w=s.tgtShape=n.nodeShapes[t.getNodeShape(d)];s.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var E=0;E<s.eles.length;E++){var T=s.eles[E],D=T[0]._private.rscratch,C=T.pstyle("curve-style").value,N="unbundled-bezier"===C||"segments"===C||"taxi"===C,A=!h.same(T.source());if(!s.calculatedIntersection&&h!==d&&(s.hasBezier||s.hasUnbundled)){s.calculatedIntersection=!0;var L=x.intersectLine(g.x,g.y,v,y,f.x,f.y,0),S=s.srcIntn=L,O=w.intersectLine(f.x,f.y,m,b,g.x,g.y,0),I=s.tgtIntn=O,k=s.intersectionPts={x1:L[0],x2:O[0],y1:L[1],y2:O[1]},M=s.posPts={x1:g.x,x2:f.x,y1:g.y,y2:f.y},P=O[1]-L[1],R=O[0]-L[0],B=Math.sqrt(R*R+P*P),F=s.vector={x:R,y:P},z=s.vectorNorm={x:F.x/B,y:F.y/B},G={x:-z.y,y:z.x};s.nodesOverlap=!_(B)||w.checkPoint(L[0],L[1],0,m,b,f.x,f.y)||x.checkPoint(O[0],O[1],0,v,y,g.x,g.y),s.vectorNormInverse=G,l={nodesOverlap:s.nodesOverlap,dirCounts:s.dirCounts,calculatedIntersection:!0,hasBezier:s.hasBezier,hasUnbundled:s.hasUnbundled,eles:s.eles,srcPos:f,tgtPos:g,srcW:m,srcH:b,tgtW:v,tgtH:y,srcIntn:I,tgtIntn:S,srcShape:w,tgtShape:x,posPts:{x1:M.x2,y1:M.y2,x2:M.x1,y2:M.y1},intersectionPts:{x1:k.x2,y1:k.y2,x2:k.x1,y2:k.y1},vector:{x:-F.x,y:-F.y},vectorNorm:{x:-z.x,y:-z.y},vectorNormInverse:{x:-G.x,y:-G.y}}}var Y=A?l:s;D.nodesOverlap=Y.nodesOverlap,D.srcIntn=Y.srcIntn,D.tgtIntn=Y.tgtIntn,r&&(h.isParent()||h.isChild()||d.isParent()||d.isChild())&&(h.parents().anySame(d)||d.parents().anySame(h)||h.same(d)&&h.isParent())?t.findCompoundLoopPoints(T,Y,E,N):h===d?t.findLoopPoints(T,Y,E,N):"segments"===C?t.findSegmentsPoints(T,Y):"taxi"===C?t.findTaxiPoints(T,Y):"straight"===C||!N&&s.eles.length%2==1&&E===Math.floor(s.eles.length/2)?t.findStraightEdgePoints(T):t.findBezierPoints(T,Y,E,N,A),t.findEndpoints(T),t.tryToCorrectInvalidPoints(T,Y),t.checkForInvalidEdgeWarning(T),t.storeAllpts(T),t.storeEdgeProjections(T),t.calculateArrowAngles(T),t.recalculateEdgeLabelProjections(T),t.calculateLabelAngles(T)}},m=0;m<a.length;m++)y(m);this.findHaystackPoints(o)}},eh.getSegmentPoints=function(e){var t=e[0]._private.rscratch;if("segments"===t.edgeType)return this.recalculateRenderedStyle(e),th(t.segpts)},eh.getControlPoints=function(e){var t=e[0]._private.rscratch,n=t.edgeType;if("bezier"===n||"multibezier"===n||"self"===n||"compound"===n)return this.recalculateRenderedStyle(e),th(t.ctrlpts)},eh.getEdgeMidpoint=function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),{x:t.midX,y:t.midY}};var nh={manualEndptToPx:function(e,t){var n=this,r=e.position(),i=e.outerWidth(),a=e.outerHeight();if(2===t.value.length){var o=[t.pfValue[0],t.pfValue[1]];return"%"===t.units[0]&&(o[0]=o[0]*i),"%"===t.units[1]&&(o[1]=o[1]*a),o[0]+=r.x,o[1]+=r.y,o}var s=t.pfValue[0];s=-Math.PI/2+s;var l=2*Math.max(i,a),u=[r.x+Math.cos(s)*l,r.y+Math.sin(s)*l];return n.nodeShapes[this.getNodeShape(e)].intersectLine(r.x,r.y,i,a,u[0],u[1],0)},findEndpoints:function(e){var t,n,r,i,a,o=this,s=e.source()[0],l=e.target()[0],u=s.position(),c=l.position(),h=e.pstyle("target-arrow-shape").value,d=e.pstyle("source-arrow-shape").value,p=e.pstyle("target-distance-from-node").pfValue,g=e.pstyle("source-distance-from-node").pfValue,f=e.pstyle("curve-style").value,v=e._private.rscratch,y=v.edgeType,m="self"===y||"compound"===y,b="bezier"===y||"multibezier"===y||m,x="bezier"!==y,w="straight"===y||"segments"===y,E="segments"===y,T=b||x||w,D=m||"taxi"===f,C=e.pstyle("source-endpoint"),N=D?"outside-to-node":C.value,A=e.pstyle("target-endpoint"),L=D?"outside-to-node":A.value;if(v.srcManEndpt=C,v.tgtManEndpt=A,b){var S=[v.ctrlpts[0],v.ctrlpts[1]];n=x?[v.ctrlpts[v.ctrlpts.length-2],v.ctrlpts[v.ctrlpts.length-1]]:S,r=S}else if(w){var O=E?v.segpts.slice(0,2):[c.x,c.y];n=E?v.segpts.slice(v.segpts.length-2):[u.x,u.y],r=O}if("inside-to-node"===L)t=[c.x,c.y];else if(A.units)t=this.manualEndptToPx(l,A);else if("outside-to-line"===L)t=v.tgtIntn;else if("outside-to-node"===L||"outside-to-node-or-label"===L?i=n:"outside-to-line"!==L&&"outside-to-line-or-label"!==L||(i=[u.x,u.y]),t=o.nodeShapes[this.getNodeShape(l)].intersectLine(c.x,c.y,l.outerWidth(),l.outerHeight(),i[0],i[1],0),"outside-to-node-or-label"===L||"outside-to-line-or-label"===L){var I=l._private.rscratch,k=I.labelWidth,M=I.labelHeight,P=I.labelX,R=I.labelY,B=k/2,F=M/2,z=l.pstyle("text-valign").value;"top"===z?R-=F:"bottom"===z&&(R+=F);var G=l.pstyle("text-halign").value;"left"===G?P-=B:"right"===G&&(P+=B);var Y=ir(i[0],i[1],[P-B,R-F,P+B,R-F,P+B,R+F,P-B,R+F],c.x,c.y);if(Y.length>0){var X=u,V=Tn(X,pn(t)),U=Tn(X,pn(Y)),j=V;U<V&&(t=Y,j=U),Y.length>2&&Tn(X,{x:Y[2],y:Y[3]})<j&&(t=[Y[2],Y[3]])}}var H=or(t,n,o.arrowShapes[h].spacing(e)+p),q=or(t,n,o.arrowShapes[h].gap(e)+p);if(v.endX=q[0],v.endY=q[1],v.arrowEndX=H[0],v.arrowEndY=H[1],"inside-to-node"===N)t=[u.x,u.y];else if(C.units)t=this.manualEndptToPx(s,C);else if("outside-to-line"===N)t=v.srcIntn;else if("outside-to-node"===N||"outside-to-node-or-label"===N?a=r:"outside-to-line"!==N&&"outside-to-line-or-label"!==N||(a=[c.x,c.y]),t=o.nodeShapes[this.getNodeShape(s)].intersectLine(u.x,u.y,s.outerWidth(),s.outerHeight(),a[0],a[1],0),"outside-to-node-or-label"===N||"outside-to-line-or-label"===N){var W=s._private.rscratch,$=W.labelWidth,Z=W.labelHeight,K=W.labelX,Q=W.labelY,J=$/2,ee=Z/2,te=s.pstyle("text-valign").value;"top"===te?Q-=ee:"bottom"===te&&(Q+=ee);var ne=s.pstyle("text-halign").value;"left"===ne?K-=J:"right"===ne&&(K+=J);var re=ir(a[0],a[1],[K-J,Q-ee,K+J,Q-ee,K+J,Q+ee,K-J,Q+ee],u.x,u.y);if(re.length>0){var ie=c,ae=Tn(ie,pn(t)),oe=Tn(ie,pn(re)),se=ae;oe<ae&&(t=[re[0],re[1]],se=oe),re.length>2&&Tn(ie,{x:re[2],y:re[3]})<se&&(t=[re[2],re[3]])}}var le=or(t,r,o.arrowShapes[d].spacing(e)+g),ue=or(t,r,o.arrowShapes[d].gap(e)+g);v.startX=ue[0],v.startY=ue[1],v.arrowStartX=le[0],v.arrowStartY=le[1],T&&(_(v.startX)&&_(v.startY)&&_(v.endX)&&_(v.endY)?v.badLine=!1:v.badLine=!0)},getSourceEndpoint:function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),"haystack"===t.edgeType?{x:t.haystackPts[0],y:t.haystackPts[1]}:{x:t.arrowStartX,y:t.arrowStartY}},getTargetEndpoint:function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),"haystack"===t.edgeType?{x:t.haystackPts[2],y:t.haystackPts[3]}:{x:t.arrowEndX,y:t.arrowEndY}}},rh={};function ih(e,t,n){for(var r=function(e,t,n,r){return Dn(e,t,n,r)},i=t._private.rstyle.bezierPts,a=0;a<e.bezierProjPcts.length;a++){var o=e.bezierProjPcts[a];i.push({x:r(n[0],n[2],n[4],o),y:r(n[1],n[3],n[5],o)})}}rh.storeEdgeProjections=function(e){var t=e._private,n=t.rscratch,r=n.edgeType;if(t.rstyle.bezierPts=null,t.rstyle.linePts=null,t.rstyle.haystackPts=null,"multibezier"===r||"bezier"===r||"self"===r||"compound"===r){t.rstyle.bezierPts=[];for(var i=0;i+5<n.allpts.length;i+=4)ih(this,e,n.allpts.slice(i,i+6))}else if("segments"===r){var a=t.rstyle.linePts=[];for(i=0;i+1<n.allpts.length;i+=2)a.push({x:n.allpts[i],y:n.allpts[i+1]})}else if("haystack"===r){var o=n.haystackPts;t.rstyle.haystackPts=[{x:o[0],y:o[1]},{x:o[2],y:o[3]}]}t.rstyle.arrowWidth=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth},rh.recalculateEdgeProjections=function(e){this.findEdgeControlPoints(e)};var ah={recalculateNodeLabelProjection:function(e){var t=e.pstyle("label").strValue;if(!k(t)){var n,r,i=e._private,a=e.width(),o=e.height(),s=e.padding(),l=e.position(),u=e.pstyle("text-halign").strValue,c=e.pstyle("text-valign").strValue,h=i.rscratch,d=i.rstyle;switch(u){case"left":n=l.x-a/2-s;break;case"right":n=l.x+a/2+s;break;default:n=l.x}switch(c){case"top":r=l.y-o/2-s;break;case"bottom":r=l.y+o/2+s;break;default:r=l.y}h.labelX=n,h.labelY=r,d.labelX=n,d.labelY=r,this.calculateLabelAngles(e),this.applyLabelDimensions(e)}}},oh=function(e,t){var n=Math.atan(t/e);return 0===e&&n<0&&(n*=-1),n},sh=function(e,t){var n=t.x-e.x,r=t.y-e.y;return oh(n,r)},lh=function(e,t,n,r){var i=An(0,r-.001,1),a=An(0,r+.001,1),o=Cn(e,t,n,i),s=Cn(e,t,n,a);return sh(o,s)};ah.recalculateEdgeLabelProjections=function(e){var t,n=e._private,r=n.rscratch,i=this,a={mid:e.pstyle("label").strValue,source:e.pstyle("source-label").strValue,target:e.pstyle("target-label").strValue};if(a.mid||a.source||a.target){t={x:r.midX,y:r.midY};var o=function(e,t,r){zt(n.rscratch,e,t,r),zt(n.rstyle,e,t,r)};o("labelX",null,t.x),o("labelY",null,t.y);var s=oh(r.midDispX,r.midDispY);o("labelAutoAngle",null,s);var l=function e(){if(e.cache)return e.cache;for(var t=[],a=0;a+5<r.allpts.length;a+=4){var o={x:r.allpts[a],y:r.allpts[a+1]},s={x:r.allpts[a+2],y:r.allpts[a+3]},l={x:r.allpts[a+4],y:r.allpts[a+5]};t.push({p0:o,p1:s,p2:l,startDist:0,length:0,segments:[]})}var u=n.rstyle.bezierPts,c=i.bezierProjPcts.length;function h(e,t,n,r,i){var a=En(t,n),o=e.segments[e.segments.length-1],s={p0:t,p1:n,t0:r,t1:i,startDist:o?o.startDist+o.length:0,length:a};e.segments.push(s),e.length+=a}for(var d=0;d<t.length;d++){var p=t[d],g=t[d-1];g&&(p.startDist=g.startDist+g.length),h(p,p.p0,u[d*c],0,i.bezierProjPcts[0]);for(var f=0;f<c-1;f++)h(p,u[d*c+f],u[d*c+f+1],i.bezierProjPcts[f],i.bezierProjPcts[f+1]);h(p,u[d*c+c-1],p.p2,i.bezierProjPcts[c-1],1)}return e.cache=t},u=function(n){var i,s="source"===n;if(a[n]){var u=e.pstyle(n+"-text-offset").pfValue;switch(r.edgeType){case"self":case"compound":case"bezier":case"multibezier":for(var c,h=l(),d=0,p=0,g=0;g<h.length;g++){for(var f=h[s?g:h.length-1-g],v=0;v<f.segments.length;v++){var y=f.segments[s?v:f.segments.length-1-v],m=g===h.length-1&&v===f.segments.length-1;if(d=p,(p+=y.length)>=u||m){c={cp:f,segment:y};break}}if(c)break}var b=c.cp,x=c.segment,w=(u-d)/x.length,E=x.t1-x.t0,T=s?x.t0+E*w:x.t1-E*w;T=An(0,T,1),t=Cn(b.p0,b.p1,b.p2,T),i=lh(b.p0,b.p1,b.p2,T);break;case"straight":case"segments":case"haystack":for(var _,D,C,N,A=0,L=r.allpts.length,S=0;S+3<L&&(s?(C={x:r.allpts[S],y:r.allpts[S+1]},N={x:r.allpts[S+2],y:r.allpts[S+3]}):(C={x:r.allpts[L-2-S],y:r.allpts[L-1-S]},N={x:r.allpts[L-4-S],y:r.allpts[L-3-S]}),D=A,!((A+=_=En(C,N))>=u));S+=2);var O=(u-D)/_;O=An(0,O,1),t=Nn(C,N,O),i=sh(C,N)}o("labelX",n,t.x),o("labelY",n,t.y),o("labelAutoAngle",n,i)}};u("source"),u("target"),this.applyLabelDimensions(e)}},ah.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))},ah.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),i=this.calculateLabelDimensions(e,r),a=e.pstyle("line-height").pfValue,o=e.pstyle("text-wrap").strValue,s=Ft(n.rscratch,"labelWrapCachedLines",t)||[],l="wrap"!==o?1:Math.max(s.length,1),u=i.height/l,c=u*a,h=i.width,d=i.height+(l-1)*(a-1)*u;zt(n.rstyle,"labelWidth",t,h),zt(n.rscratch,"labelWidth",t,h),zt(n.rstyle,"labelHeight",t,d),zt(n.rscratch,"labelHeight",t,d),zt(n.rscratch,"labelLineHeight",t,c)},ah.getLabelText=function(e,t){var n=e._private,r=t?t+"-":"",i=e.pstyle(r+"label").strValue,a=e.pstyle("text-transform").value,o=function(e,r){return r?(zt(n.rscratch,e,t,r),r):Ft(n.rscratch,e,t)};if(!i)return"";"none"==a||("uppercase"==a?i=i.toUpperCase():"lowercase"==a&&(i=i.toLowerCase()));var s=e.pstyle("text-wrap").value;if("wrap"===s){var l=o("labelKey");if(null!=l&&o("labelWrapKey")===l)return o("labelWrapCachedText");for(var u="\u200b",c=i.split("\n"),h=e.pstyle("text-max-width").pfValue,d="anywhere"===e.pstyle("text-overflow-wrap").value,p=[],g=/[\s\u200b]+/,f=d?"":" ",v=0;v<c.length;v++){var y=c[v],m=this.calculateLabelDimensions(e,y).width;if(d){var b=y.split("").join(u);y=b}if(m>h){for(var x=y.split(g),w="",E=0;E<x.length;E++){var T=x[E],_=0===w.length?T:w+f+T;this.calculateLabelDimensions(e,_).width<=h?w+=T+f:(w&&p.push(w),w=T+f)}w.match(/^[\s\u200b]+$/)||p.push(w)}else p.push(y)}o("labelWrapCachedLines",p),i=o("labelWrapCachedText",p.join("\n")),o("labelWrapKey",l)}else if("ellipsis"===s){var D=e.pstyle("text-max-width").pfValue,C="",N="\u2026",A=!1;if(this.calculateLabelDimensions(e,i).width<D)return i;for(var L=0;L<i.length&&!(this.calculateLabelDimensions(e,C+i[L]+N).width>D);L++)C+=i[L],L===i.length-1&&(A=!0);return A||(C+=N),C}return i},ah.getLabelJustification=function(e){var t=e.pstyle("text-justification").strValue,n=e.pstyle("text-halign").strValue;if("auto"!==t)return t;if(!e.isNode())return"center";switch(n){case"left":return"right";case"right":return"left";default:return"center"}},ah.calculateLabelDimensions=function(e,t){var n=this,r=gt(t,e._private.labelDimsKey),i=n.labelDimCache||(n.labelDimCache=[]),a=i[r];if(null!=a)return a;var o=0,s=e.pstyle("font-style").strValue,l=e.pstyle("font-size").pfValue,u=e.pstyle("font-family").strValue,c=e.pstyle("font-weight").strValue,h=this.labelCalcCanvas,d=this.labelCalcCanvasContext;if(!h){h=this.labelCalcCanvas=document.createElement("canvas"),d=this.labelCalcCanvasContext=h.getContext("2d");var p=h.style;p.position="absolute",p.left="-9999px",p.top="-9999px",p.zIndex="-1",p.visibility="hidden",p.pointerEvents="none"}d.font="".concat(s," ").concat(c," ").concat(l,"px ").concat(u);for(var g=0,f=0,v=t.split("\n"),y=0;y<v.length;y++){var m=v[y],b=d.measureText(m),x=Math.ceil(b.width),w=l;g=Math.max(x,g),f+=w}return g+=o,f+=o,i[r]={width:g,height:f}},ah.calculateLabelAngle=function(e,t){var n=e._private.rscratch,r=e.isEdge(),i=t?t+"-":"",a=e.pstyle(i+"text-rotation"),o=a.strValue;return"none"===o?0:r&&"autorotate"===o?n.labelAutoAngle:"autorotate"===o?0:a.pfValue},ah.calculateLabelAngles=function(e){var t=this,n=e.isEdge(),r=e._private.rscratch;r.labelAngle=t.calculateLabelAngle(e),n&&(r.sourceLabelAngle=t.calculateLabelAngle(e,"source"),r.targetLabelAngle=t.calculateLabelAngle(e,"target"))};var uh={},ch=28,hh=!1;uh.getNodeShape=function(e){var t=this,n=e.pstyle("shape").value;if("cutrectangle"===n&&(e.width()<ch||e.height()<ch))return hh||(Nt("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),hh=!0),"rectangle";if(e.isParent())return"rectangle"===n||"roundrectangle"===n||"round-rectangle"===n||"cutrectangle"===n||"cut-rectangle"===n||"barrel"===n?n:"rectangle";if("polygon"===n){var r=e.pstyle("shape-polygon-points").value;return t.nodeShapes.makePolygon(r).name}return n};var dh={registerCalculationListeners:function(){var e=this.cy,t=e.collection(),n=this,r=function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(t.merge(e),n)for(var r=0;r<e.length;r++){var i=e[r]._private.rstyle;i.clean=!1,i.cleanConnected=!1}};n.binder(e).on("bounds.* dirty.*",(function(e){var t=e.target;r(t)})).on("style.* background.*",(function(e){var t=e.target;r(t,!1)}));var i=function(i){if(i){var a=n.onUpdateEleCalcsFns;t.cleanStyle();for(var o=0;o<t.length;o++){var s=t[o],l=s._private.rstyle;s.isNode()&&!l.cleanConnected&&(r(s.connectedEdges()),l.cleanConnected=!0)}if(a)for(var u=0;u<a.length;u++)(0,a[u])(i,t);n.recalculateRenderedStyle(t),t=e.collection()}};n.flushRenderedStyleQueue=function(){i(!0)},n.beforeRender(i,n.beforeRenderPriorities.eleCalcs)},onUpdateEleCalcs:function(e){(this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[]).push(e)},recalculateRenderedStyle:function(e,t){var n=function(e){return e._private.rstyle.cleanConnected},r=[],i=[];if(!this.destroyed){void 0===t&&(t=!0);for(var a=0;a<e.length;a++){var o=e[a],s=o._private,l=s.rstyle;!o.isEdge()||n(o.source())&&n(o.target())||(l.clean=!1),t&&l.clean||o.removed()||"none"!==o.pstyle("display").value&&("nodes"===s.group?i.push(o):r.push(o),l.clean=!0)}for(var u=0;u<i.length;u++){var c=i[u],h=c._private.rstyle,d=c.position();this.recalculateNodeLabelProjection(c),h.nodeX=d.x,h.nodeY=d.y,h.nodeW=c.pstyle("width").pfValue,h.nodeH=c.pstyle("height").pfValue}this.recalculateEdgeProjections(r);for(var p=0;p<r.length;p++){var g=r[p]._private,f=g.rstyle,v=g.rscratch;f.srcX=v.arrowStartX,f.srcY=v.arrowStartY,f.tgtX=v.arrowEndX,f.tgtY=v.arrowEndY,f.midX=v.midX,f.midY=v.midY,f.labelAngle=v.labelAngle,f.sourceLabelAngle=v.sourceLabelAngle,f.targetLabelAngle=v.targetLabelAngle}}}},ph={updateCachedGrabbedEles:function(){var e=this.cachedZSortedEles;if(e){e.drag=[],e.nondrag=[];for(var t=[],n=0;n<e.length;n++){var r=(i=e[n])._private.rscratch;i.grabbed()&&!i.isParent()?t.push(i):r.inDragLayer?e.drag.push(i):e.nondrag.push(i)}for(n=0;n<t.length;n++){var i=t[n];e.drag.push(i)}}},invalidateCachedZSortedEles:function(){this.cachedZSortedEles=null},getCachedZSortedEles:function(e){if(e||!this.cachedZSortedEles){var t=this.cy.mutableElements().toArray();t.sort(Wl),t.interactive=t.filter((function(e){return e.interactive()})),this.cachedZSortedEles=t,this.updateCachedGrabbedEles()}else t=this.cachedZSortedEles;return t}},gh={};[Qc,Jc,eh,nh,rh,ah,uh,dh,ph].forEach((function(e){Q(gh,e)}));var fh={getCachedImage:function(e,t,n){var r=this,i=r.imageCache=r.imageCache||{},a=i[e];if(a)return a.image.complete||a.image.addEventListener("load",n),a.image;var o=(a=i[e]=i[e]||{}).image=new Image;o.addEventListener("load",n),o.addEventListener("error",(function(){o.error=!0}));var s="data:";return e.substring(0,s.length).toLowerCase()===s||(t="null"===t?null:t,o.crossOrigin=t),o.src=e,o}},vh={registerBinding:function(e,t,n,r){var i=Array.prototype.slice.apply(arguments,[1]),a=this.binder(e);return a.on.apply(a,i)},binder:function(e){var t=this,n=t.cy.window(),r=e===n||e===n.document||e===n.document.body||M(e);if(null==t.supportsPassiveEvents){var i=!1;try{var a=Object.defineProperty({},"passive",{get:function(){return i=!0,!0}});n.addEventListener("test",null,a)}catch(s){}t.supportsPassiveEvents=i}var o=function(n,i,a){var o=Array.prototype.slice.call(arguments);return r&&t.supportsPassiveEvents&&(o[2]={capture:null!=a&&a,passive:!1,once:!1}),t.bindings.push({target:e,args:o}),(e.addEventListener||e.on).apply(e,o),this};return{on:o,addEventListener:o,addListener:o,bind:o}},nodeIsDraggable:function(e){return e&&e.isNode()&&!e.locked()&&e.grabbable()},nodeIsGrabbable:function(e){return this.nodeIsDraggable(e)&&e.interactive()},load:function(){var e=this,t=e.cy.window(),n=function(e){return e.selected()},r=function(t,n,r,i){null==t&&(t=e.cy);for(var a=0;a<n.length;a++){var o=n[a];t.emit({originalEvent:r,type:o,position:i})}},i=function(e){return e.shiftKey||e.metaKey||e.ctrlKey},a=function(t,n){var r=!0;if(e.cy.hasCompoundNodes()&&t&&t.pannable()){for(var i=0;n&&i<n.length;i++)if((t=n[i]).isNode()&&t.isParent()&&!t.pannable()){r=!1;break}}else r=!0;return r},o=function(e){e[0]._private.grabbed=!0},s=function(e){e[0]._private.grabbed=!1},l=function(e){e[0]._private.rscratch.inDragLayer=!0},u=function(e){e[0]._private.rscratch.inDragLayer=!1},c=function(e){e[0]._private.rscratch.isGrabTarget=!0},h=function(e){e[0]._private.rscratch.isGrabTarget=!1},d=function(e,t){var n=t.addToList;n.has(e)||!e.grabbable()||e.locked()||(n.merge(e),o(e))},p=function(e,t){if(e.cy().hasCompoundNodes()&&(null!=t.inDragLayer||null!=t.addToList)){var n=e.descendants();t.inDragLayer&&(n.forEach(l),n.connectedEdges().forEach(l)),t.addToList&&d(n,t)}},g=function(t,n){n=n||{};var r=t.cy().hasCompoundNodes();n.inDragLayer&&(t.forEach(l),t.neighborhood().stdFilter((function(e){return!r||e.isEdge()})).forEach(l)),n.addToList&&t.forEach((function(e){d(e,n)})),p(t,n),y(t,{inDragLayer:n.inDragLayer}),e.updateCachedGrabbedEles()},f=g,v=function(t){t&&(e.getCachedZSortedEles().forEach((function(e){s(e),u(e),h(e)})),e.updateCachedGrabbedEles())},y=function(e,t){if((null!=t.inDragLayer||null!=t.addToList)&&e.cy().hasCompoundNodes()){var n=e.ancestors().orphans();if(!n.same(e)){var r=n.descendants().spawnSelf().merge(n).unmerge(e).unmerge(e.descendants()),i=r.connectedEdges();t.inDragLayer&&(i.forEach(l),r.forEach(l)),t.addToList&&r.forEach((function(e){d(e,t)}))}}},m=function(){null!=document.activeElement&&null!=document.activeElement.blur&&document.activeElement.blur()},b="undefined"!=typeof MutationObserver,x="undefined"!=typeof ResizeObserver;b?(e.removeObserver=new MutationObserver((function(t){for(var n=0;n<t.length;n++){var r=t[n].removedNodes;if(r)for(var i=0;i<r.length;i++)if(r[i]===e.container){e.destroy();break}}})),e.container.parentNode&&e.removeObserver.observe(e.container.parentNode,{childList:!0})):e.registerBinding(e.container,"DOMNodeRemoved",(function(t){e.destroy()}));var w=Qe((function(){e.cy.resize()}),100);b&&(e.styleObserver=new MutationObserver(w),e.styleObserver.observe(e.container,{attributes:!0})),e.registerBinding(t,"resize",w),x&&(e.resizeObserver=new ResizeObserver(w),e.resizeObserver.observe(e.container));var E=function(e,t){for(;null!=e;)t(e),e=e.parentNode},T=function(){e.invalidateContainerClientCoordsCache()};E(e.container,(function(t){e.registerBinding(t,"transitionend",T),e.registerBinding(t,"animationend",T),e.registerBinding(t,"scroll",T)})),e.registerBinding(e.container,"contextmenu",(function(e){e.preventDefault()}));var D,C,N,A=function(){return 0!==e.selection[4]},L=function(t){for(var n=e.findContainerClientCoords(),r=n[0],i=n[1],a=n[2],o=n[3],s=t.touches?t.touches:[t],l=!1,u=0;u<s.length;u++){var c=s[u];if(r<=c.clientX&&c.clientX<=r+a&&i<=c.clientY&&c.clientY<=i+o){l=!0;break}}if(!l)return!1;for(var h=e.container,d=t.target.parentNode,p=!1;d;){if(d===h){p=!0;break}d=d.parentNode}return!!p};e.registerBinding(e.container,"mousedown",(function(t){if(L(t)){t.preventDefault(),m(),e.hoverData.capture=!0,e.hoverData.which=t.which;var n=e.cy,i=[t.clientX,t.clientY],a=e.projectIntoViewport(i[0],i[1]),o=e.selection,s=e.findNearestElements(a[0],a[1],!0,!1),l=s[0],u=e.dragData.possibleDragElements;e.hoverData.mdownPos=a,e.hoverData.mdownGPos=i;var h=function(){e.hoverData.tapholdCancelled=!1,clearTimeout(e.hoverData.tapholdTimeout),e.hoverData.tapholdTimeout=setTimeout((function(){if(!e.hoverData.tapholdCancelled){var r=e.hoverData.down;r?r.emit({originalEvent:t,type:"taphold",position:{x:a[0],y:a[1]}}):n.emit({originalEvent:t,type:"taphold",position:{x:a[0],y:a[1]}})}}),e.tapholdDuration)};if(3==t.which){e.hoverData.cxtStarted=!0;var d={originalEvent:t,type:"cxttapstart",position:{x:a[0],y:a[1]}};l?(l.activate(),l.emit(d),e.hoverData.down=l):n.emit(d),e.hoverData.downTime=(new Date).getTime(),e.hoverData.cxtDragged=!1}else if(1==t.which){if(l&&l.activate(),null!=l&&e.nodeIsGrabbable(l)){var p=function(e){return{originalEvent:t,type:e,position:{x:a[0],y:a[1]}}},v=function(e){e.emit(p("grab"))};if(c(l),l.selected()){u=e.dragData.possibleDragElements=n.collection();var y=n.$((function(t){return t.isNode()&&t.selected()&&e.nodeIsGrabbable(t)}));g(y,{addToList:u}),l.emit(p("grabon")),y.forEach(v)}else u=e.dragData.possibleDragElements=n.collection(),f(l,{addToList:u}),l.emit(p("grabon")).emit(p("grab"));e.redrawHint("eles",!0),e.redrawHint("drag",!0)}e.hoverData.down=l,e.hoverData.downs=s,e.hoverData.downTime=(new Date).getTime(),r(l,["mousedown","tapstart","vmousedown"],t,{x:a[0],y:a[1]}),null==l?(o[4]=1,e.data.bgActivePosistion={x:a[0],y:a[1]},e.redrawHint("select",!0),e.redraw()):l.pannable()&&(o[4]=1),h()}o[0]=o[2]=a[0],o[1]=o[3]=a[1]}}),!1),e.registerBinding(t,"mousemove",(function(t){if(e.hoverData.capture||L(t)){var n=!1,o=e.cy,s=o.zoom(),l=[t.clientX,t.clientY],u=e.projectIntoViewport(l[0],l[1]),c=e.hoverData.mdownPos,h=e.hoverData.mdownGPos,d=e.selection,p=null;e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.selecting||(p=e.findNearestElement(u[0],u[1],!0,!1));var f,y=e.hoverData.last,m=e.hoverData.down,b=[u[0]-d[2],u[1]-d[3]],x=e.dragData.possibleDragElements;if(h){var w=l[0]-h[0],E=w*w,T=l[1]-h[1],D=E+T*T;e.hoverData.isOverThresholdDrag=f=D>=e.desktopTapThreshold2}var C=i(t);f&&(e.hoverData.tapholdCancelled=!0);var N=function(){var t=e.hoverData.dragDelta=e.hoverData.dragDelta||[];0===t.length?(t.push(b[0]),t.push(b[1])):(t[0]+=b[0],t[1]+=b[1])};n=!0,r(p,["mousemove","vmousemove","tapdrag"],t,{x:u[0],y:u[1]});var A=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||o.emit({originalEvent:t,type:"boxstart",position:{x:u[0],y:u[1]}}),d[4]=1,e.hoverData.selecting=!0,e.redrawHint("select",!0),e.redraw()};if(3===e.hoverData.which){if(f){var S={originalEvent:t,type:"cxtdrag",position:{x:u[0],y:u[1]}};m?m.emit(S):o.emit(S),e.hoverData.cxtDragged=!0,e.hoverData.cxtOver&&p===e.hoverData.cxtOver||(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:u[0],y:u[1]}}),e.hoverData.cxtOver=p,p&&p.emit({originalEvent:t,type:"cxtdragover",position:{x:u[0],y:u[1]}}))}}else if(e.hoverData.dragging){if(n=!0,o.panningEnabled()&&o.userPanningEnabled()){var O;if(e.hoverData.justStartedPan){var I=e.hoverData.mdownPos;O={x:(u[0]-I[0])*s,y:(u[1]-I[1])*s},e.hoverData.justStartedPan=!1}else O={x:b[0]*s,y:b[1]*s};o.panBy(O),o.emit("dragpan"),e.hoverData.dragged=!0}u=e.projectIntoViewport(t.clientX,t.clientY)}else if(1!=d[4]||null!=m&&!m.pannable()){if(m&&m.pannable()&&m.active()&&m.unactivate(),m&&m.grabbed()||p==y||(y&&r(y,["mouseout","tapdragout"],t,{x:u[0],y:u[1]}),p&&r(p,["mouseover","tapdragover"],t,{x:u[0],y:u[1]}),e.hoverData.last=p),m)if(f){if(o.boxSelectionEnabled()&&C)m&&m.grabbed()&&(v(x),m.emit("freeon"),x.emit("free"),e.dragData.didDrag&&(m.emit("dragfreeon"),x.emit("dragfree"))),A();else if(m&&m.grabbed()&&e.nodeIsDraggable(m)){var k=!e.dragData.didDrag;k&&e.redrawHint("eles",!0),e.dragData.didDrag=!0,e.hoverData.draggingEles||g(x,{inDragLayer:!0});var M={x:0,y:0};if(_(b[0])&&_(b[1])&&(M.x+=b[0],M.y+=b[1],k)){var P=e.hoverData.dragDelta;P&&_(P[0])&&_(P[1])&&(M.x+=P[0],M.y+=P[1])}e.hoverData.draggingEles=!0,x.silentShift(M).emit("position drag"),e.redrawHint("drag",!0),e.redraw()}}else N();n=!0}else f&&(e.hoverData.dragging||!o.boxSelectionEnabled()||!C&&o.panningEnabled()&&o.userPanningEnabled()?!e.hoverData.selecting&&o.panningEnabled()&&o.userPanningEnabled()&&a(m,e.hoverData.downs)&&(e.hoverData.dragging=!0,e.hoverData.justStartedPan=!0,d[4]=0,e.data.bgActivePosistion=pn(c),e.redrawHint("select",!0),e.redraw()):A(),m&&m.pannable()&&m.active()&&m.unactivate());return d[2]=u[0],d[3]=u[1],n?(t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),!1):void 0}}),!1),e.registerBinding(t,"mouseup",(function(t){if(e.hoverData.capture){e.hoverData.capture=!1;var a=e.cy,o=e.projectIntoViewport(t.clientX,t.clientY),s=e.selection,l=e.findNearestElement(o[0],o[1],!0,!1),u=e.dragData.possibleDragElements,c=e.hoverData.down,h=i(t);if(e.data.bgActivePosistion&&(e.redrawHint("select",!0),e.redraw()),e.hoverData.tapholdCancelled=!0,e.data.bgActivePosistion=void 0,c&&c.unactivate(),3===e.hoverData.which){var d={originalEvent:t,type:"cxttapend",position:{x:o[0],y:o[1]}};if(c?c.emit(d):a.emit(d),!e.hoverData.cxtDragged){var p={originalEvent:t,type:"cxttap",position:{x:o[0],y:o[1]}};c?c.emit(p):a.emit(p)}e.hoverData.cxtDragged=!1,e.hoverData.which=null}else if(1===e.hoverData.which){if(r(l,["mouseup","tapend","vmouseup"],t,{x:o[0],y:o[1]}),e.dragData.didDrag||e.hoverData.dragged||e.hoverData.selecting||e.hoverData.isOverThresholdDrag||(r(c,["click","tap","vclick"],t,{x:o[0],y:o[1]}),C=!1,t.timeStamp-N<=a.multiClickDebounceTime()?(D&&clearTimeout(D),C=!0,N=null,r(c,["dblclick","dbltap","vdblclick"],t,{x:o[0],y:o[1]})):(D=setTimeout((function(){C||r(c,["oneclick","onetap","voneclick"],t,{x:o[0],y:o[1]})}),a.multiClickDebounceTime()),N=t.timeStamp)),null!=c||e.dragData.didDrag||e.hoverData.selecting||e.hoverData.dragged||i(t)||(a.$(n).unselect(["tapunselect"]),u.length>0&&e.redrawHint("eles",!0),e.dragData.possibleDragElements=u=a.collection()),l!=c||e.dragData.didDrag||e.hoverData.selecting||null!=l&&l._private.selectable&&(e.hoverData.dragging||("additive"===a.selectionType()||h?l.selected()?l.unselect(["tapunselect"]):l.select(["tapselect"]):h||(a.$(n).unmerge(l).unselect(["tapunselect"]),l.select(["tapselect"]))),e.redrawHint("eles",!0)),e.hoverData.selecting){var g=a.collection(e.getAllInBox(s[0],s[1],s[2],s[3]));e.redrawHint("select",!0),g.length>0&&e.redrawHint("eles",!0),a.emit({type:"boxend",originalEvent:t,position:{x:o[0],y:o[1]}});var f=function(e){return e.selectable()&&!e.selected()};"additive"===a.selectionType()||h||a.$(n).unmerge(g).unselect(),g.emit("box").stdFilter(f).select().emit("boxselect"),e.redraw()}if(e.hoverData.dragging&&(e.hoverData.dragging=!1,e.redrawHint("select",!0),e.redrawHint("eles",!0),e.redraw()),!s[4]){e.redrawHint("drag",!0),e.redrawHint("eles",!0);var y=c&&c.grabbed();v(u),y&&(c.emit("freeon"),u.emit("free"),e.dragData.didDrag&&(c.emit("dragfreeon"),u.emit("dragfree")))}}s[4]=0,e.hoverData.down=null,e.hoverData.cxtStarted=!1,e.hoverData.draggingEles=!1,e.hoverData.selecting=!1,e.hoverData.isOverThresholdDrag=!1,e.dragData.didDrag=!1,e.hoverData.dragged=!1,e.hoverData.dragDelta=[],e.hoverData.mdownPos=null,e.hoverData.mdownGPos=null}}),!1);var S,O,I,k,M,P,R,B,F,z,G,Y,X,V=function(t){if(!e.scrollingPage){var n=e.cy,r=n.zoom(),i=n.pan(),a=e.projectIntoViewport(t.clientX,t.clientY),o=[a[0]*r+i.x,a[1]*r+i.y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||A())t.preventDefault();else if(n.panningEnabled()&&n.userPanningEnabled()&&n.zoomingEnabled()&&n.userZoomingEnabled()){var s;t.preventDefault(),e.data.wheelZooming=!0,clearTimeout(e.data.wheelTimeout),e.data.wheelTimeout=setTimeout((function(){e.data.wheelZooming=!1,e.redrawHint("eles",!0),e.redraw()}),150),s=null!=t.deltaY?t.deltaY/-250:null!=t.wheelDeltaY?t.wheelDeltaY/1e3:t.wheelDelta/1e3,s*=e.wheelSensitivity,1===t.deltaMode&&(s*=33);var l=n.zoom()*Math.pow(10,s);"gesturechange"===t.type&&(l=e.gestureStartZoom*t.scale),n.zoom({level:l,renderedPosition:{x:o[0],y:o[1]}}),n.emit("gesturechange"===t.type?"pinchzoom":"scrollzoom")}}};e.registerBinding(e.container,"wheel",V,!0),e.registerBinding(t,"scroll",(function(t){e.scrollingPage=!0,clearTimeout(e.scrollingPageTimeout),e.scrollingPageTimeout=setTimeout((function(){e.scrollingPage=!1}),250)}),!0),e.registerBinding(e.container,"gesturestart",(function(t){e.gestureStartZoom=e.cy.zoom(),e.hasTouchStarted||t.preventDefault()}),!0),e.registerBinding(e.container,"gesturechange",(function(t){e.hasTouchStarted||V(t)}),!0),e.registerBinding(e.container,"mouseout",(function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseout",position:{x:n[0],y:n[1]}})}),!1),e.registerBinding(e.container,"mouseover",(function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseover",position:{x:n[0],y:n[1]}})}),!1);var U,j,H,q,W,$,Z,K=function(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))},Q=function(e,t,n,r){return(n-e)*(n-e)+(r-t)*(r-t)};if(e.registerBinding(e.container,"touchstart",U=function(t){if(e.hasTouchStarted=!0,L(t)){m(),e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var n=e.cy,i=e.touchData.now,a=e.touchData.earlier;if(t.touches[0]){var o=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);i[0]=o[0],i[1]=o[1]}if(t.touches[1]&&(o=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY),i[2]=o[0],i[3]=o[1]),t.touches[2]&&(o=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY),i[4]=o[0],i[5]=o[1]),t.touches[1]){e.touchData.singleTouchMoved=!0,v(e.dragData.touchDragEles);var s=e.findContainerClientCoords();F=s[0],z=s[1],G=s[2],Y=s[3],S=t.touches[0].clientX-F,O=t.touches[0].clientY-z,I=t.touches[1].clientX-F,k=t.touches[1].clientY-z,X=0<=S&&S<=G&&0<=I&&I<=G&&0<=O&&O<=Y&&0<=k&&k<=Y;var l=n.pan(),u=n.zoom();M=K(S,O,I,k),P=Q(S,O,I,k),B=[((R=[(S+I)/2,(O+k)/2])[0]-l.x)/u,(R[1]-l.y)/u];var h=200;if(P<h*h&&!t.touches[2]){var d=e.findNearestElement(i[0],i[1],!0,!0),p=e.findNearestElement(i[2],i[3],!0,!0);return d&&d.isNode()?(d.activate().emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=d):p&&p.isNode()?(p.activate().emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=p):n.emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!0,e.touchData.cxtDragged=!1,e.data.bgActivePosistion=void 0,void e.redraw()}}if(t.touches[2])n.boxSelectionEnabled()&&t.preventDefault();else if(t.touches[1]);else if(t.touches[0]){var y=e.findNearestElements(i[0],i[1],!0,!0),b=y[0];if(null!=b&&(b.activate(),e.touchData.start=b,e.touchData.starts=y,e.nodeIsGrabbable(b))){var x=e.dragData.touchDragEles=n.collection(),w=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),b.selected()?(w=n.$((function(t){return t.selected()&&e.nodeIsGrabbable(t)})),g(w,{addToList:x})):f(b,{addToList:x}),c(b);var E=function(e){return{originalEvent:t,type:e,position:{x:i[0],y:i[1]}}};b.emit(E("grabon")),w?w.forEach((function(e){e.emit(E("grab"))})):b.emit(E("grab"))}r(b,["touchstart","tapstart","vmousedown"],t,{x:i[0],y:i[1]}),null==b&&(e.data.bgActivePosistion={x:o[0],y:o[1]},e.redrawHint("select",!0),e.redraw()),e.touchData.singleTouchMoved=!1,e.touchData.singleTouchStartTime=+new Date,clearTimeout(e.touchData.tapholdTimeout),e.touchData.tapholdTimeout=setTimeout((function(){!1!==e.touchData.singleTouchMoved||e.pinching||e.touchData.selecting||r(e.touchData.start,["taphold"],t,{x:i[0],y:i[1]})}),e.tapholdDuration)}if(t.touches.length>=1){for(var T=e.touchData.startPosition=[null,null,null,null,null,null],_=0;_<i.length;_++)T[_]=a[_]=i[_];var D=t.touches[0];e.touchData.startGPosition=[D.clientX,D.clientY]}}},!1),e.registerBinding(window,"touchmove",j=function(t){var n=e.touchData.capture;if(n||L(t)){var i=e.selection,o=e.cy,s=e.touchData.now,l=e.touchData.earlier,u=o.zoom();if(t.touches[0]){var c=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);s[0]=c[0],s[1]=c[1]}t.touches[1]&&(c=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY),s[2]=c[0],s[3]=c[1]),t.touches[2]&&(c=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY),s[4]=c[0],s[5]=c[1]);var h,d=e.touchData.startGPosition;if(n&&t.touches[0]&&d){for(var p=[],f=0;f<s.length;f++)p[f]=s[f]-l[f];var y=t.touches[0].clientX-d[0],m=y*y,b=t.touches[0].clientY-d[1];h=m+b*b>=e.touchTapThreshold2}if(n&&e.touchData.cxt){t.preventDefault();var x=t.touches[0].clientX-F,w=t.touches[0].clientY-z,E=t.touches[1].clientX-F,T=t.touches[1].clientY-z,D=Q(x,w,E,T),C=150,N=1.5;if(D/P>=N*N||D>=C*C){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var A={originalEvent:t,type:"cxttapend",position:{x:s[0],y:s[1]}};e.touchData.start?(e.touchData.start.unactivate().emit(A),e.touchData.start=null):o.emit(A)}}if(n&&e.touchData.cxt){A={originalEvent:t,type:"cxtdrag",position:{x:s[0],y:s[1]}},e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.touchData.start?e.touchData.start.emit(A):o.emit(A),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var R=e.findNearestElement(s[0],s[1],!0,!0);e.touchData.cxtOver&&R===e.touchData.cxtOver||(e.touchData.cxtOver&&e.touchData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:s[0],y:s[1]}}),e.touchData.cxtOver=R,R&&R.emit({originalEvent:t,type:"cxtdragover",position:{x:s[0],y:s[1]}}))}else if(n&&t.touches[2]&&o.boxSelectionEnabled())t.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||o.emit({originalEvent:t,type:"boxstart",position:{x:s[0],y:s[1]}}),e.touchData.selecting=!0,e.touchData.didSelect=!0,i[4]=1,i&&0!==i.length&&void 0!==i[0]?(i[2]=(s[0]+s[2]+s[4])/3,i[3]=(s[1]+s[3]+s[5])/3):(i[0]=(s[0]+s[2]+s[4])/3,i[1]=(s[1]+s[3]+s[5])/3,i[2]=(s[0]+s[2]+s[4])/3+1,i[3]=(s[1]+s[3]+s[5])/3+1),e.redrawHint("select",!0),e.redraw();else if(n&&t.touches[1]&&!e.touchData.didSelect&&o.zoomingEnabled()&&o.panningEnabled()&&o.userZoomingEnabled()&&o.userPanningEnabled()){if(t.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),ne=e.dragData.touchDragEles){e.redrawHint("drag",!0);for(var G=0;G<ne.length;G++){var Y=ne[G]._private;Y.grabbed=!1,Y.rscratch.inDragLayer=!1}}var V=e.touchData.start,U=(x=t.touches[0].clientX-F,w=t.touches[0].clientY-z,E=t.touches[1].clientX-F,T=t.touches[1].clientY-z,K(x,w,E,T)),j=U/M;if(X){var H=(x-S+(E-I))/2,q=(w-O+(T-k))/2,W=o.zoom(),$=W*j,Z=o.pan(),J=B[0]*W+Z.x,ee=B[1]*W+Z.y,te={x:-$/W*(J-Z.x-H)+J,y:-$/W*(ee-Z.y-q)+ee};if(V&&V.active()){var ne=e.dragData.touchDragEles;v(ne),e.redrawHint("drag",!0),e.redrawHint("eles",!0),V.unactivate().emit("freeon"),ne.emit("free"),e.dragData.didDrag&&(V.emit("dragfreeon"),ne.emit("dragfree"))}o.viewport({zoom:$,pan:te,cancelOnFailedZoom:!0}),o.emit("pinchzoom"),M=U,S=x,O=w,I=E,k=T,e.pinching=!0}t.touches[0]&&(c=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY),s[0]=c[0],s[1]=c[1]),t.touches[1]&&(c=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY),s[2]=c[0],s[3]=c[1]),t.touches[2]&&(c=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY),s[4]=c[0],s[5]=c[1])}else if(t.touches[0]&&!e.touchData.didSelect){var re=e.touchData.start,ie=e.touchData.last;if(e.hoverData.draggingEles||e.swipePanning||(R=e.findNearestElement(s[0],s[1],!0,!0)),n&&null!=re&&t.preventDefault(),n&&null!=re&&e.nodeIsDraggable(re))if(h){ne=e.dragData.touchDragEles;var ae=!e.dragData.didDrag;ae&&g(ne,{inDragLayer:!0}),e.dragData.didDrag=!0;var oe={x:0,y:0};_(p[0])&&_(p[1])&&(oe.x+=p[0],oe.y+=p[1],ae&&(e.redrawHint("eles",!0),(se=e.touchData.dragDelta)&&_(se[0])&&_(se[1])&&(oe.x+=se[0],oe.y+=se[1]))),e.hoverData.draggingEles=!0,ne.silentShift(oe).emit("position drag"),e.redrawHint("drag",!0),e.touchData.startPosition[0]==l[0]&&e.touchData.startPosition[1]==l[1]&&e.redrawHint("eles",!0),e.redraw()}else{var se;0===(se=e.touchData.dragDelta=e.touchData.dragDelta||[]).length?(se.push(p[0]),se.push(p[1])):(se[0]+=p[0],se[1]+=p[1])}if(r(re||R,["touchmove","tapdrag","vmousemove"],t,{x:s[0],y:s[1]}),re&&re.grabbed()||R==ie||(ie&&ie.emit({originalEvent:t,type:"tapdragout",position:{x:s[0],y:s[1]}}),R&&R.emit({originalEvent:t,type:"tapdragover",position:{x:s[0],y:s[1]}})),e.touchData.last=R,n)for(G=0;G<s.length;G++)s[G]&&e.touchData.startPosition[G]&&h&&(e.touchData.singleTouchMoved=!0);n&&(null==re||re.pannable())&&o.panningEnabled()&&o.userPanningEnabled()&&(a(re,e.touchData.starts)&&(t.preventDefault(),e.data.bgActivePosistion||(e.data.bgActivePosistion=pn(e.touchData.startPosition)),e.swipePanning?(o.panBy({x:p[0]*u,y:p[1]*u}),o.emit("dragpan")):h&&(e.swipePanning=!0,o.panBy({x:y*u,y:b*u}),o.emit("dragpan"),re&&(re.unactivate(),e.redrawHint("select",!0),e.touchData.start=null))),c=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY),s[0]=c[0],s[1]=c[1])}for(f=0;f<s.length;f++)l[f]=s[f];n&&t.touches.length>0&&!e.hoverData.draggingEles&&!e.swipePanning&&null!=e.data.bgActivePosistion&&(e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.redraw())}},!1),e.registerBinding(t,"touchcancel",H=function(t){var n=e.touchData.start;e.touchData.capture=!1,n&&n.unactivate()}),e.registerBinding(t,"touchend",q=function(t){var i=e.touchData.start;if(e.touchData.capture){0===t.touches.length&&(e.touchData.capture=!1),t.preventDefault();var a=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var o,s=e.cy,l=s.zoom(),u=e.touchData.now,c=e.touchData.earlier;if(t.touches[0]){var h=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);u[0]=h[0],u[1]=h[1]}if(t.touches[1]&&(h=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY),u[2]=h[0],u[3]=h[1]),t.touches[2]&&(h=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY),u[4]=h[0],u[5]=h[1]),i&&i.unactivate(),e.touchData.cxt){if(o={originalEvent:t,type:"cxttapend",position:{x:u[0],y:u[1]}},i?i.emit(o):s.emit(o),!e.touchData.cxtDragged){var d={originalEvent:t,type:"cxttap",position:{x:u[0],y:u[1]}};i?i.emit(d):s.emit(d)}return e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!1,e.touchData.start=null,void e.redraw()}if(!t.touches[2]&&s.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=!1;var p=s.collection(e.getAllInBox(a[0],a[1],a[2],a[3]));a[0]=void 0,a[1]=void 0,a[2]=void 0,a[3]=void 0,a[4]=0,e.redrawHint("select",!0),s.emit({type:"boxend",originalEvent:t,position:{x:u[0],y:u[1]}});var g=function(e){return e.selectable()&&!e.selected()};p.emit("box").stdFilter(g).select().emit("boxselect"),p.nonempty()&&e.redrawHint("eles",!0),e.redraw()}if(null!=i&&i.unactivate(),t.touches[2])e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);else if(t.touches[1]);else if(t.touches[0]);else if(!t.touches[0]){e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var f=e.dragData.touchDragEles;if(null!=i){var y=i._private.grabbed;v(f),e.redrawHint("drag",!0),e.redrawHint("eles",!0),y&&(i.emit("freeon"),f.emit("free"),e.dragData.didDrag&&(i.emit("dragfreeon"),f.emit("dragfree"))),r(i,["touchend","tapend","vmouseup","tapdragout"],t,{x:u[0],y:u[1]}),i.unactivate(),e.touchData.start=null}else{var m=e.findNearestElement(u[0],u[1],!0,!0);r(m,["touchend","tapend","vmouseup","tapdragout"],t,{x:u[0],y:u[1]})}var b=e.touchData.startPosition[0]-u[0],x=b*b,w=e.touchData.startPosition[1]-u[1],E=(x+w*w)*l*l;e.touchData.singleTouchMoved||(i||s.$(":selected").unselect(["tapunselect"]),r(i,["tap","vclick"],t,{x:u[0],y:u[1]}),W=!1,t.timeStamp-Z<=s.multiClickDebounceTime()?($&&clearTimeout($),W=!0,Z=null,r(i,["dbltap","vdblclick"],t,{x:u[0],y:u[1]})):($=setTimeout((function(){W||r(i,["onetap","voneclick"],t,{x:u[0],y:u[1]})}),s.multiClickDebounceTime()),Z=t.timeStamp)),null!=i&&!e.dragData.didDrag&&i._private.selectable&&E<e.touchTapThreshold2&&!e.pinching&&("single"===s.selectionType()?(s.$(n).unmerge(i).unselect(["tapunselect"]),i.select(["tapselect"])):i.selected()?i.unselect(["tapunselect"]):i.select(["tapselect"]),e.redrawHint("eles",!0)),e.touchData.singleTouchMoved=!0}for(var T=0;T<u.length;T++)c[T]=u[T];e.dragData.didDrag=!1,0===t.touches.length&&(e.touchData.dragDelta=[],e.touchData.startPosition=[null,null,null,null,null,null],e.touchData.startGPosition=null,e.touchData.didSelect=!1),t.touches.length<2&&(1===t.touches.length&&(e.touchData.startGPosition=[t.touches[0].clientX,t.touches[0].clientY]),e.pinching=!1,e.redrawHint("eles",!0),e.redraw())}},!1),"undefined"==typeof TouchEvent){var J=[],ee=function(e){return{clientX:e.clientX,clientY:e.clientY,force:1,identifier:e.pointerId,pageX:e.pageX,pageY:e.pageY,radiusX:e.width/2,radiusY:e.height/2,screenX:e.screenX,screenY:e.screenY,target:e.target}},te=function(e){return{event:e,touch:ee(e)}},ne=function(e){J.push(te(e))},re=function(e){for(var t=0;t<J.length;t++)if(J[t].event.pointerId===e.pointerId)return void J.splice(t,1)},ie=function(e){var t=J.filter((function(t){return t.event.pointerId===e.pointerId}))[0];t.event=e,t.touch=ee(e)},ae=function(e){e.touches=J.map((function(e){return e.touch}))},oe=function(e){return"mouse"===e.pointerType||4===e.pointerType};e.registerBinding(e.container,"pointerdown",(function(e){oe(e)||(e.preventDefault(),ne(e),ae(e),U(e))})),e.registerBinding(e.container,"pointerup",(function(e){oe(e)||(re(e),ae(e),q(e))})),e.registerBinding(e.container,"pointercancel",(function(e){oe(e)||(re(e),ae(e),H(e))})),e.registerBinding(e.container,"pointermove",(function(e){oe(e)||(e.preventDefault(),ie(e),ae(e),j(e))}))}}},yh={generatePolygon:function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl("polygon",e,t,n,r,i,this.points)},intersectLine:function(e,t,n,r,i,a,o){return ir(i,a,this.points,e,t,n/2,r/2,o)},checkPoint:function(e,t,n,r,i,a,o){return $n(e,t,this.points,a,o,r,i,[0,-1],n)}}},generateEllipse:function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,a,o){return Jn(i,a,e,t,n/2+o,r/2+o)},checkPoint:function(e,t,n,r,i,a,o){return er(e,t,r,i,a,o,n)}}},generateRoundPolygon:function(e,t){for(var n=new Array(2*t.length),r=0;r<t.length/2;r++){var i=2*r,a=void 0;a=r<t.length/2-1?2*(r+1):0,n[4*r]=t[i],n[4*r+1]=t[i+1];var o=t[a]-t[i],s=t[a+1]-t[i+1],l=Math.sqrt(o*o+s*s);n[4*r+2]=o/l,n[4*r+3]=s/l}return this.nodeShapes[e]={renderer:this,name:e,points:n,draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl("round-polygon",e,t,n,r,i,this.points)},intersectLine:function(e,t,n,r,i,a,o){return ar(i,a,this.points,e,t,n,r)},checkPoint:function(e,t,n,r,i,a,o){return Zn(e,t,this.points,a,o,r,i)}}},generateRoundRectangle:function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:sr(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,a,o){return Yn(i,a,e,t,n,r,o)},checkPoint:function(e,t,n,r,i,a,o){var s=cr(r,i),l=2*s;return!!($n(e,t,this.points,a,o,r,i-l,[0,-1],n)||$n(e,t,this.points,a,o,r-l,i,[0,-1],n)||er(e,t,l,l,a-r/2+s,o-i/2+s,n)||er(e,t,l,l,a+r/2-s,o-i/2+s,n)||er(e,t,l,l,a+r/2-s,o+i/2-s,n)||er(e,t,l,l,a-r/2+s,o+i/2-s,n))}}},generateCutRectangle:function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:dr(),points:sr(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},generateCutTrianglePts:function(e,t,n,r){var i=this.cornerLength,a=t/2,o=e/2,s=n-o,l=n+o,u=r-a,c=r+a;return{topLeft:[s,u+i,s+i,u,s+i,u+i],topRight:[l-i,u,l,u+i,l-i,u+i],bottomRight:[l,c-i,l-i,c,l-i,c-i],bottomLeft:[s+i,c,s,c-i,s+i,c-i]}},intersectLine:function(e,t,n,r,i,a,o){var s=this.generateCutTrianglePts(n+2*o,r+2*o,e,t),l=[].concat.apply([],[s.topLeft.splice(0,4),s.topRight.splice(0,4),s.bottomRight.splice(0,4),s.bottomLeft.splice(0,4)]);return ir(i,a,l,e,t)},checkPoint:function(e,t,n,r,i,a,o){if($n(e,t,this.points,a,o,r,i-2*this.cornerLength,[0,-1],n))return!0;if($n(e,t,this.points,a,o,r-2*this.cornerLength,i,[0,-1],n))return!0;var s=this.generateCutTrianglePts(r,i,a,o);return Wn(e,t,s.topLeft)||Wn(e,t,s.topRight)||Wn(e,t,s.bottomRight)||Wn(e,t,s.bottomLeft)}}},generateBarrel:function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:sr(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,a,o){var s=.15,l=.5,u=.85,c=this.generateBarrelBezierPts(n+2*o,r+2*o,e,t),h=function(e){var t=Cn({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},s),n=Cn({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},l),r=Cn({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},u);return[e[0],e[1],t.x,t.y,n.x,n.y,r.x,r.y,e[4],e[5]]},d=[].concat(h(c.topLeft),h(c.topRight),h(c.bottomRight),h(c.bottomLeft));return ir(i,a,d,e,t)},generateBarrelBezierPts:function(e,t,n,r){var i=t/2,a=e/2,o=n-a,s=n+a,l=r-i,u=r+i,c=gr(e,t),h=c.heightOffset,d=c.widthOffset,p=c.ctrlPtOffsetPct*e,g={topLeft:[o,l+h,o+p,l,o+d,l],topRight:[s-d,l,s-p,l,s,l+h],bottomRight:[s,u-h,s-p,u,s-d,u],bottomLeft:[o+d,u,o+p,u,o,u-h]};return g.topLeft.isTop=!0,g.topRight.isTop=!0,g.bottomLeft.isBottom=!0,g.bottomRight.isBottom=!0,g},checkPoint:function(e,t,n,r,i,a,o){var s=gr(r,i),l=s.heightOffset,u=s.widthOffset;if($n(e,t,this.points,a,o,r,i-2*l,[0,-1],n))return!0;if($n(e,t,this.points,a,o,r-2*u,i,[0,-1],n))return!0;for(var c=this.generateBarrelBezierPts(r,i,a,o),h=function(e,t,n){var r=n[4],i=n[2],a=n[0],o=n[5],s=n[1],l=Math.min(r,a),u=Math.max(r,a),c=Math.min(o,s),h=Math.max(o,s);if(l<=e&&e<=u&&c<=t&&t<=h){var d=pr(r,i,a),p=Un(d[0],d[1],d[2],e).filter((function(e){return 0<=e&&e<=1}));if(p.length>0)return p[0]}return null},d=Object.keys(c),p=0;p<d.length;p++){var g=c[d[p]],f=h(e,t,g);if(null!=f){var v=g[5],y=g[3],m=g[1],b=Dn(v,y,m,f);if(g.isTop&&b<=t)return!0;if(g.isBottom&&t<=b)return!0}}return!1}}},generateBottomRoundrectangle:function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:sr(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,a,o){var s=t-(r/2+o),l=rr(i,a,e,t,e-(n/2+o),s,e+(n/2+o),s,!1);return l.length>0?l:Yn(i,a,e,t,n,r,o)},checkPoint:function(e,t,n,r,i,a,o){var s=cr(r,i),l=2*s;if($n(e,t,this.points,a,o,r,i-l,[0,-1],n))return!0;if($n(e,t,this.points,a,o,r-l,i,[0,-1],n))return!0;var u=r/2+2*n,c=i/2+2*n;return!!Wn(e,t,[a-u,o-c,a-u,o,a+u,o,a+u,o-c])||!!er(e,t,l,l,a+r/2-s,o+i/2-s,n)||!!er(e,t,l,l,a-r/2+s,o+i/2-s,n)}}},registerNodeShapes:function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",sr(3,0)),this.generateRoundPolygon("round-triangle",sr(3,0)),this.generatePolygon("rectangle",sr(4,0)),e.square=e.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();var n=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",n),this.generateRoundPolygon("round-diamond",n),this.generatePolygon("pentagon",sr(5,0)),this.generateRoundPolygon("round-pentagon",sr(5,0)),this.generatePolygon("hexagon",sr(6,0)),this.generateRoundPolygon("round-hexagon",sr(6,0)),this.generatePolygon("heptagon",sr(7,0)),this.generateRoundPolygon("round-heptagon",sr(7,0)),this.generatePolygon("octagon",sr(8,0)),this.generateRoundPolygon("round-octagon",sr(8,0));var r=new Array(20),i=ur(5,0),a=ur(5,Math.PI/5),o=.5*(3-Math.sqrt(5));o*=1.57;for(var s=0;s<a.length/2;s++)a[2*s]*=o,a[2*s+1]*=o;for(s=0;s<5;s++)r[4*s]=i[2*s],r[4*s+1]=i[2*s+1],r[4*s+2]=a[2*s],r[4*s+3]=a[2*s+1];r=lr(r),this.generatePolygon("star",r),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.generatePolygon("right-rhomboid",[-.333,-1,1,-1,.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);var l=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",l),this.generateRoundPolygon("round-tag",l),e.makePolygon=function(e){var n,r="polygon-"+e.join("$");return(n=this[r])?n:t.generatePolygon(r,e)}}},mh={timeToRender:function(){return this.redrawTotalTime/this.redrawCount},redraw:function(e){e=e||kt();var t=this;void 0===t.averageRedrawTime&&(t.averageRedrawTime=0),void 0===t.lastRedrawTime&&(t.lastRedrawTime=0),void 0===t.lastDrawTime&&(t.lastDrawTime=0),t.requestedFrame=!0,t.renderOptions=e},beforeRender:function(e,t){if(!this.destroyed){null==t&&Dt("Priority is not optional for beforeRender");var n=this.beforeRenderCallbacks;n.push({fn:e,priority:t}),n.sort((function(e,t){return t.priority-e.priority}))}}},bh=function(e,t,n){for(var r=e.beforeRenderCallbacks,i=0;i<r.length;i++)r[i].fn(t,n)};mh.startRenderLoop=function(){var e=this,t=e.cy;if(!e.renderLoopStarted){e.renderLoopStarted=!0;var n=function n(r){if(!e.destroyed){if(t.batching());else if(e.requestedFrame&&!e.skipFrame){bh(e,!0,r);var i=rt();e.render(e.renderOptions);var a=e.lastDrawTime=rt();void 0===e.averageRedrawTime&&(e.averageRedrawTime=a-i),void 0===e.redrawCount&&(e.redrawCount=0),e.redrawCount++,void 0===e.redrawTotalTime&&(e.redrawTotalTime=0);var o=a-i;e.redrawTotalTime+=o,e.lastRedrawTime=o,e.averageRedrawTime=e.averageRedrawTime/2+o/2,e.requestedFrame=!1}else bh(e,!1,r);e.skipFrame=!1,nt(n)}};nt(n)}};var xh=function(e){this.init(e)},wh=xh.prototype;wh.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],wh.init=function(e){var t=this;t.options=e,t.cy=e.cy;var n=t.container=e.cy.container(),r=t.cy.window();if(r){var i=r.document,a=i.head,o="__________cytoscape_stylesheet",s="__________cytoscape_container",l=null!=i.getElementById(o);if(n.className.indexOf(s)<0&&(n.className=(n.className||"")+" "+s),!l){var u=i.createElement("style");u.id=o,u.textContent="."+s+" { position: relative; }",a.insertBefore(u,a.children[0])}"static"===r.getComputedStyle(n).getPropertyValue("position")&&Nt("A Cytoscape container has style position:static and so can not use UI extensions properly")}t.selection=[void 0,void 0,void 0,void 0,0],t.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],t.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},t.dragData={possibleDragElements:[]},t.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]},t.redraws=0,t.showFps=e.showFps,t.debug=e.debug,t.hideEdgesOnViewport=e.hideEdgesOnViewport,t.textureOnViewport=e.textureOnViewport,t.wheelSensitivity=e.wheelSensitivity,t.motionBlurEnabled=e.motionBlur,t.forcedPixelRatio=_(e.pixelRatio)?e.pixelRatio:null,t.motionBlur=e.motionBlur,t.motionBlurOpacity=e.motionBlurOpacity,t.motionBlurTransparency=1-t.motionBlurOpacity,t.motionBlurPxRatio=1,t.mbPxRBlurry=1,t.minMbLowQualFrames=4,t.fullQualityMb=!1,t.clearedForMotionBlur=[],t.desktopTapThreshold=e.desktopTapThreshold,t.desktopTapThreshold2=e.desktopTapThreshold*e.desktopTapThreshold,t.touchTapThreshold=e.touchTapThreshold,t.touchTapThreshold2=e.touchTapThreshold*e.touchTapThreshold,t.tapholdDuration=500,t.bindings=[],t.beforeRenderCallbacks=[],t.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},t.registerNodeShapes(),t.registerArrowShapes(),t.registerCalculationListeners()},wh.notify=function(e,t){var n=this,r=n.cy;this.destroyed||("init"!==e?"destroy"!==e?(("add"===e||"remove"===e||"move"===e&&r.hasCompoundNodes()||"load"===e||"zorder"===e||"mount"===e)&&n.invalidateCachedZSortedEles(),"viewport"===e&&n.redrawHint("select",!0),"load"!==e&&"resize"!==e&&"mount"!==e||(n.invalidateContainerClientCoordsCache(),n.matchCanvasSize(n.container)),n.redrawHint("eles",!0),n.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()):n.destroy():n.load())},wh.destroy=function(){var e=this;e.destroyed=!0,e.cy.stopAnimationLoop();for(var t=0;t<e.bindings.length;t++){var n=e.bindings[t],r=n.target;(r.off||r.removeEventListener).apply(r,n.args)}if(e.bindings=[],e.beforeRenderCallbacks=[],e.onUpdateEleCalcsFns=[],e.removeObserver&&e.removeObserver.disconnect(),e.styleObserver&&e.styleObserver.disconnect(),e.resizeObserver&&e.resizeObserver.disconnect(),e.labelCalcDiv)try{document.body.removeChild(e.labelCalcDiv)}catch(i){}},wh.isHeadless=function(){return!1},[Kc,gh,fh,vh,yh,mh].forEach((function(e){Q(wh,e)}));var Eh=1e3/60,Th={setupDequeueing:function(e){return function(){var t=this,n=this.renderer;if(!t.dequeueingSetup){t.dequeueingSetup=!0;var r=Qe((function(){n.redrawHint("eles",!0),n.redrawHint("drag",!0),n.redraw()}),e.deqRedrawThreshold),i=function(i,a){var o=rt(),s=n.averageRedrawTime,l=n.lastRedrawTime,u=[],c=n.cy.extent(),h=n.getPixelRatio();for(i||n.flushRenderedStyleQueue();;){var d=rt(),p=d-o,g=d-a;if(l<Eh){var f=Eh-(i?s:0);if(g>=e.deqFastCost*f)break}else if(i){if(p>=e.deqCost*l||p>=e.deqAvgCost*s)break}else if(g>=e.deqNoDrawCost*Eh)break;var v=e.deq(t,h,c);if(!(v.length>0))break;for(var y=0;y<v.length;y++)u.push(v[y])}u.length>0&&(e.onDeqd(t,u),!i&&e.shouldRedraw(t,u,h,c)&&r())},a=e.priority||_t;n.beforeRender(i,a(t))}}}},_h=function(){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Et;t(this,e),this.idsByKey=new Yt,this.keyForId=new Yt,this.cachesByLvl=new Yt,this.lvls=[],this.getKey=n,this.doesEleInvalidateKey=r}return i(e,[{key:"getIdsFor",value:function(e){null==e&&Dt("Can not get id list for null key");var t=this.idsByKey,n=this.idsByKey.get(e);return n||(n=new Ut,t.set(e,n)),n}},{key:"addIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).add(t)}},{key:"deleteIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).delete(t)}},{key:"getNumberOfIdsForKey",value:function(e){return null==e?0:this.getIdsFor(e).size}},{key:"updateKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t),r=this.getKey(e);this.deleteIdForKey(n,t),this.addIdForKey(r,t),this.keyForId.set(t,r)}},{key:"deleteKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteIdForKey(n,t),this.keyForId.delete(t)}},{key:"keyHasChangedFor",value:function(e){var t=e.id();return this.keyForId.get(t)!==this.getKey(e)}},{key:"isInvalid",value:function(e){return this.keyHasChangedFor(e)||this.doesEleInvalidateKey(e)}},{key:"getCachesAt",value:function(e){var t=this.cachesByLvl,n=this.lvls,r=t.get(e);return r||(r=new Yt,t.set(e,r),n.push(e)),r}},{key:"getCache",value:function(e,t){return this.getCachesAt(t).get(e)}},{key:"get",value:function(e,t){var n=this.getKey(e),r=this.getCache(n,t);return null!=r&&this.updateKeyMappingFor(e),r}},{key:"getForCachedKey",value:function(e,t){var n=this.keyForId.get(e.id());return this.getCache(n,t)}},{key:"hasCache",value:function(e,t){return this.getCachesAt(t).has(e)}},{key:"has",value:function(e,t){var n=this.getKey(e);return this.hasCache(n,t)}},{key:"setCache",value:function(e,t,n){n.key=e,this.getCachesAt(t).set(e,n)}},{key:"set",value:function(e,t,n){var r=this.getKey(e);this.setCache(r,t,n),this.updateKeyMappingFor(e)}},{key:"deleteCache",value:function(e,t){this.getCachesAt(t).delete(e)}},{key:"delete",value:function(e,t){var n=this.getKey(e);this.deleteCache(n,t)}},{key:"invalidateKey",value:function(e){var t=this;this.lvls.forEach((function(n){return t.deleteCache(e,n)}))}},{key:"invalidate",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteKeyMappingFor(e);var r=this.doesEleInvalidateKey(e);return r&&this.invalidateKey(n),r||0===this.getNumberOfIdsForKey(n)}}]),e}(),Dh=25,Ch=50,Nh=-4,Ah=3,Lh=7.99,Sh=8,Oh=1024,Ih=1024,kh=1024,Mh=.2,Ph=.8,Rh=10,Bh=.15,Fh=.1,zh=.9,Gh=.9,Yh=100,Xh=1,Vh={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},Uh=Mt({getKey:null,doesEleInvalidateKey:Et,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:wt,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),jh=function(e,t){var n=this;n.renderer=e,n.onDequeues=[];var r=Uh(t);Q(n,r),n.lookup=new _h(r.getKey,r.doesEleInvalidateKey),n.setupDequeueing()},Hh=jh.prototype;Hh.reasons=Vh,Hh.getTextureQueue=function(e){var t=this;return t.eleImgCaches=t.eleImgCaches||{},t.eleImgCaches[e]=t.eleImgCaches[e]||[]},Hh.getRetiredTextureQueue=function(e){var t=this,n=t.eleImgCaches.retired=t.eleImgCaches.retired||{};return n[e]=n[e]||[]},Hh.getElementQueue=function(){var e=this;return e.eleCacheQueue=e.eleCacheQueue||new $t((function(e,t){return t.reqs-e.reqs}))},Hh.getElementKeyToQueue=function(){var e=this;return e.eleKeyToCacheQueue=e.eleKeyToCacheQueue||{}},Hh.getElement=function(e,t,n,r,i){var a=this,o=this.renderer,s=o.cy.zoom(),l=this.lookup;if(!t||0===t.w||0===t.h||isNaN(t.w)||isNaN(t.h)||!e.visible()||e.removed())return null;if(!a.allowEdgeTxrCaching&&e.isEdge()||!a.allowParentTxrCaching&&e.isParent())return null;if(null==r&&(r=Math.ceil(xn(s*n))),r<Nh)r=Nh;else if(s>=Lh||r>Ah)return null;var u=Math.pow(2,r),c=t.h*u,h=t.w*u,d=o.eleTextBiggerThanMin(e,u);if(!this.isVisible(e,d))return null;var p,g=l.get(e,r);if(g&&g.invalidated&&(g.invalidated=!1,g.texture.invalidatedWidth-=g.width),g)return g;if(p=c<=Dh?Dh:c<=Ch?Ch:Math.ceil(c/Ch)*Ch,c>kh||h>Ih)return null;var f=a.getTextureQueue(p),v=f[f.length-2],y=function(){return a.recycleTexture(p,h)||a.addTexture(p,h)};v||(v=f[f.length-1]),v||(v=y()),v.width-v.usedWidth<h&&(v=y());for(var m,b=function(e){return e&&e.scaledLabelShown===d},x=i&&i===Vh.dequeue,w=i&&i===Vh.highQuality,E=i&&i===Vh.downscale,T=r+1;T<=Ah;T++){var _=l.get(e,T);if(_){m=_;break}}var D=m&&m.level===r+1?m:null,C=function(){v.context.drawImage(D.texture.canvas,D.x,0,D.width,D.height,v.usedWidth,0,h,c)};if(v.context.setTransform(1,0,0,1,0,0),v.context.clearRect(v.usedWidth,0,h,p),b(D))C();else if(b(m)){if(!w)return a.queueElement(e,m.level-1),m;for(var N=m.level;N>r;N--)D=a.getElement(e,t,n,N,Vh.downscale);C()}else{var A;if(!x&&!w&&!E)for(var L=r-1;L>=Nh;L--){var S=l.get(e,L);if(S){A=S;break}}if(b(A))return a.queueElement(e,r),A;v.context.translate(v.usedWidth,0),v.context.scale(u,u),this.drawElement(v.context,e,t,d,!1),v.context.scale(1/u,1/u),v.context.translate(-v.usedWidth,0)}return g={x:v.usedWidth,texture:v,level:r,scale:u,width:h,height:c,scaledLabelShown:d},v.usedWidth+=Math.ceil(h+Sh),v.eleCaches.push(g),l.set(e,r,g),a.checkTextureFullness(v),g},Hh.invalidateElements=function(e){for(var t=0;t<e.length;t++)this.invalidateElement(e[t])},Hh.invalidateElement=function(e){var t=this,n=t.lookup,r=[];if(n.isInvalid(e)){for(var i=Nh;i<=Ah;i++){var a=n.getForCachedKey(e,i);a&&r.push(a)}if(n.invalidate(e))for(var o=0;o<r.length;o++){var s=r[o],l=s.texture;l.invalidatedWidth+=s.width,s.invalidated=!0,t.checkTextureUtility(l)}t.removeFromQueue(e)}},Hh.checkTextureUtility=function(e){e.invalidatedWidth>=Mh*e.width&&this.retireTexture(e)},Hh.checkTextureFullness=function(e){var t=this.getTextureQueue(e.height);e.usedWidth/e.width>Ph&&e.fullnessChecks>=Rh?Pt(t,e):e.fullnessChecks++},Hh.retireTexture=function(e){var t=this,n=e.height,r=t.getTextureQueue(n),i=this.lookup;Pt(r,e),e.retired=!0;for(var a=e.eleCaches,o=0;o<a.length;o++){var s=a[o];i.deleteCache(s.key,s.level)}Rt(a),t.getRetiredTextureQueue(n).push(e)},Hh.addTexture=function(e,t){var n=this,r={};return n.getTextureQueue(e).push(r),r.eleCaches=[],r.height=e,r.width=Math.max(Oh,t),r.usedWidth=0,r.invalidatedWidth=0,r.fullnessChecks=0,r.canvas=n.renderer.makeOffscreenCanvas(r.width,r.height),r.context=r.canvas.getContext("2d"),r},Hh.recycleTexture=function(e,t){for(var n=this,r=n.getTextureQueue(e),i=n.getRetiredTextureQueue(e),a=0;a<i.length;a++){var o=i[a];if(o.width>=t)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,Rt(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),Pt(i,o),r.push(o),o}},Hh.queueElement=function(e,t){var n=this,r=n.getElementQueue(),i=n.getElementKeyToQueue(),a=this.getKey(e),o=i[a];if(o)o.level=Math.max(o.level,t),o.eles.merge(e),o.reqs++,r.updateItem(o);else{var s={eles:e.spawn().merge(e),level:t,reqs:1,key:a};r.push(s),i[a]=s}},Hh.dequeue=function(e){for(var t=this,n=t.getElementQueue(),r=t.getElementKeyToQueue(),i=[],a=t.lookup,o=0;o<Xh&&n.size()>0;o++){var s=n.pop(),l=s.key,u=s.eles[0],c=a.hasCache(u,s.level);if(r[l]=null,!c){i.push(s);var h=t.getBoundingBox(u);t.getElement(u,h,e,s.level,Vh.dequeue)}}return i},Hh.removeFromQueue=function(e){var t=this,n=t.getElementQueue(),r=t.getElementKeyToQueue(),i=this.getKey(e),a=r[i];null!=a&&(1===a.eles.length?(a.reqs=xt,n.updateItem(a),n.pop(),r[i]=null):a.eles.unmerge(e))},Hh.onDequeue=function(e){this.onDequeues.push(e)},Hh.offDequeue=function(e){Pt(this.onDequeues,e)},Hh.setupDequeueing=Th.setupDequeueing({deqRedrawThreshold:Yh,deqCost:Bh,deqAvgCost:Fh,deqNoDrawCost:zh,deqFastCost:Gh,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n<e.onDequeues.length;n++)(0,e.onDequeues[n])(t)},shouldRedraw:function(e,t,n,r){for(var i=0;i<t.length;i++)for(var a=t[i].eles,o=0;o<a.length;o++){var s=a[o].boundingBox();if(Bn(s,r))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var qh=1,Wh=-4,$h=2,Zh=3.99,Kh=50,Qh=50,Jh=.15,ed=.1,td=.9,nd=.9,rd=1,id=250,ad=16e6,od=!0,sd=function(e){var t=this,n=t.renderer=e,r=n.cy;t.layersByLevel={},t.firstGet=!0,t.lastInvalidationTime=rt()-2*id,t.skipping=!1,t.eleTxrDeqs=r.collection(),t.scheduleElementRefinement=Qe((function(){t.refineElementTextures(t.eleTxrDeqs),t.eleTxrDeqs.unmerge(t.eleTxrDeqs)}),Qh),n.beforeRender((function(e,n){n-t.lastInvalidationTime<=id?t.skipping=!0:t.skipping=!1}),n.beforeRenderPriorities.lyrTxrSkip);var i=function(e,t){return t.reqs-e.reqs};t.layersQueue=new $t(i),t.setupDequeueing()},ld=sd.prototype,ud=0,cd=Math.pow(2,53)-1;ld.makeLayer=function(e,t){var n=Math.pow(2,t),r=Math.ceil(e.w*n),i=Math.ceil(e.h*n),a=this.renderer.makeOffscreenCanvas(r,i),o={id:ud=++ud%cd,bb:e,level:t,width:r,height:i,canvas:a,context:a.getContext("2d"),eles:[],elesQueue:[],reqs:0},s=o.context,l=-o.bb.x1,u=-o.bb.y1;return s.scale(n,n),s.translate(l,u),o},ld.getLayers=function(e,t,n){var r=this,i=r.renderer.cy.zoom(),a=r.firstGet;if(r.firstGet=!1,null==n)if((n=Math.ceil(xn(i*t)))<Wh)n=Wh;else if(i>=Zh||n>$h)return null;r.validateLayersElesOrdering(n,e);var o,s,l=r.layersByLevel,u=Math.pow(2,n),c=l[n]=l[n]||[],h=function(){var t=function(t){if(r.validateLayersElesOrdering(t,e),r.levelIsComplete(t,e))return s=l[t],!0},i=function(e){if(!s)for(var r=n+e;Wh<=r&&r<=$h&&!t(r);r+=e);};i(1),i(-1);for(var a=c.length-1;a>=0;a--){var o=c[a];o.invalid&&Pt(c,o)}};if(r.levelIsComplete(n,e))return c;h();var d=function(){if(!o){o=Ln();for(var t=0;t<e.length;t++)In(o,e[t].boundingBox())}return o},p=function(e){var t=(e=e||{}).after;if(d(),o.w*u*(o.h*u)>ad)return null;var i=r.makeLayer(o,n);if(null!=t){var a=c.indexOf(t)+1;c.splice(a,0,i)}else(void 0===e.insert||e.insert)&&c.unshift(i);return i};if(r.skipping&&!a)return null;for(var g=null,f=e.length/qh,v=!a,y=0;y<e.length;y++){var m=e[y],b=m._private.rscratch,x=b.imgLayerCaches=b.imgLayerCaches||{},w=x[n];if(w)g=w;else{if((!g||g.eles.length>=f||!Gn(g.bb,m.boundingBox()))&&!(g=p({insert:!0,after:g})))return null;s||v?r.queueLayer(g,m):r.drawEleInLayer(g,m,n,t),g.eles.push(m),x[n]=g}}return s||(v?null:c)},ld.getEleLevelForLayerLevel=function(e,t){return e},ld.drawEleInLayer=function(e,t,n,r){var i=this,a=this.renderer,o=e.context,s=t.boundingBox();0!==s.w&&0!==s.h&&t.visible()&&(n=i.getEleLevelForLayerLevel(n,r),a.setImgSmoothing(o,!1),a.drawCachedElement(o,t,null,null,n,od),a.setImgSmoothing(o,!0))},ld.levelIsComplete=function(e,t){var n=this.layersByLevel[e];if(!n||0===n.length)return!1;for(var r=0,i=0;i<n.length;i++){var a=n[i];if(a.reqs>0)return!1;if(a.invalid)return!1;r+=a.eles.length}return r===t.length},ld.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var r=0;r<n.length;r++){for(var i=n[r],a=-1,o=0;o<t.length;o++)if(i.eles[0]===t[o]){a=o;break}if(a<0)this.invalidateLayer(i);else{var s=a;for(o=0;o<i.eles.length;o++)if(i.eles[o]!==t[s+o]){this.invalidateLayer(i);break}}}},ld.updateElementsInLayers=function(e,t){for(var n=this,r=A(e[0]),i=0;i<e.length;i++)for(var a=r?null:e[i],o=r?e[i]:e[i].ele,s=o._private.rscratch,l=s.imgLayerCaches=s.imgLayerCaches||{},u=Wh;u<=$h;u++){var c=l[u];c&&(a&&n.getEleLevelForLayerLevel(c.level)!==a.level||t(c,o,a))}},ld.haveLayers=function(){for(var e=this,t=!1,n=Wh;n<=$h;n++){var r=e.layersByLevel[n];if(r&&r.length>0){t=!0;break}}return t},ld.invalidateElements=function(e){var t=this;0!==e.length&&(t.lastInvalidationTime=rt(),0!==e.length&&t.haveLayers()&&t.updateElementsInLayers(e,(function(e,n,r){t.invalidateLayer(e)})))},ld.invalidateLayer=function(e){if(this.lastInvalidationTime=rt(),!e.invalid){var t=e.level,n=e.eles,r=this.layersByLevel[t];Pt(r,e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var i=0;i<n.length;i++){var a=n[i]._private.rscratch.imgLayerCaches;a&&(a[t]=null)}}},ld.refineElementTextures=function(e){var t=this;t.updateElementsInLayers(e,(function(e,n,r){var i=e.replacement;if(i||((i=e.replacement=t.makeLayer(e.bb,e.level)).replaces=e,i.eles=e.eles),!i.reqs)for(var a=0;a<i.eles.length;a++)t.queueLayer(i,i.eles[a])}))},ld.enqueueElementRefinement=function(e){this.eleTxrDeqs.merge(e),this.scheduleElementRefinement()},ld.queueLayer=function(e,t){var n=this.layersQueue,r=e.elesQueue,i=r.hasId=r.hasId||{};if(!e.replacement){if(t){if(i[t.id()])return;r.push(t),i[t.id()]=!0}e.reqs?(e.reqs++,n.updateItem(e)):(e.reqs=1,n.push(e))}},ld.dequeue=function(e){for(var t=this,n=t.layersQueue,r=[],i=0;i<rd&&0!==n.size();){var a=n.peek();if(a.replacement)n.pop();else if(a.replaces&&a!==a.replaces.replacement)n.pop();else if(a.invalid)n.pop();else{var o=a.elesQueue.shift();o&&(t.drawEleInLayer(a,o,a.level,e),i++),0===r.length&&r.push(!0),0===a.elesQueue.length&&(n.pop(),a.reqs=0,a.replaces&&t.applyLayerReplacement(a),t.requestRedraw())}}return r},ld.applyLayerReplacement=function(e){var t=this,n=t.layersByLevel[e.level],r=e.replaces,i=n.indexOf(r);if(!(i<0||r.invalid)){n[i]=e;for(var a=0;a<e.eles.length;a++){var o=e.eles[a]._private,s=o.imgLayerCaches=o.imgLayerCaches||{};s&&(s[e.level]=e)}t.requestRedraw()}},ld.requestRedraw=Qe((function(){var e=this.renderer;e.redrawHint("eles",!0),e.redrawHint("drag",!0),e.redraw()}),100),ld.setupDequeueing=Th.setupDequeueing({deqRedrawThreshold:Kh,deqCost:Jh,deqAvgCost:ed,deqNoDrawCost:td,deqFastCost:nd,deq:function(e,t){return e.dequeue(t)},onDeqd:_t,shouldRedraw:wt,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var hd,dd={};function pd(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.lineTo(r.x,r.y)}}function gd(e,t,n){for(var r,i=0;i<t.length;i++){var a=t[i];0===i&&(r=a),e.lineTo(a.x,a.y)}e.quadraticCurveTo(n.x,n.y,r.x,r.y)}function fd(e,t,n){e.beginPath&&e.beginPath();for(var r=t,i=0;i<r.length;i++){var a=r[i];e.lineTo(a.x,a.y)}var o=n,s=n[0];for(e.moveTo(s.x,s.y),i=1;i<o.length;i++)a=o[i],e.lineTo(a.x,a.y);e.closePath&&e.closePath()}function vd(e,t,n,r,i){e.beginPath&&e.beginPath(),e.arc(n,r,i,0,2*Math.PI,!1);var a=t,o=a[0];e.moveTo(o.x,o.y);for(var s=0;s<a.length;s++){var l=a[s];e.lineTo(l.x,l.y)}e.closePath&&e.closePath()}function yd(e,t,n,r){e.arc(t,n,r,0,2*Math.PI,!1)}dd.arrowShapeImpl=function(e){return(hd||(hd={polygon:pd,"triangle-backcurve":gd,"triangle-tee":fd,"circle-triangle":vd,"triangle-cross":fd,circle:yd}))[e]};var md={drawElement:function(e,t,n,r,i,a){var o=this;t.isNode()?o.drawNode(e,t,n,r,i,a):o.drawEdge(e,t,n,r,i,a)},drawElementOverlay:function(e,t){var n=this;t.isNode()?n.drawNodeOverlay(e,t):n.drawEdgeOverlay(e,t)},drawElementUnderlay:function(e,t){var n=this;t.isNode()?n.drawNodeUnderlay(e,t):n.drawEdgeUnderlay(e,t)},drawCachedElementPortion:function(e,t,n,r,i,a,o,s){var l=this,u=n.getBoundingBox(t);if(0!==u.w&&0!==u.h){var c=n.getElement(t,u,r,i,a);if(null!=c){var h=s(l,t);if(0===h)return;var d,p,g,f,v,y,m=o(l,t),b=u.x1,x=u.y1,w=u.w,E=u.h;if(0!==m){var T=n.getRotationPoint(t);g=T.x,f=T.y,e.translate(g,f),e.rotate(m),(v=l.getImgSmoothing(e))||l.setImgSmoothing(e,!0);var _=n.getRotationOffset(t);d=_.x,p=_.y}else d=b,p=x;1!==h&&(y=e.globalAlpha,e.globalAlpha=y*h),e.drawImage(c.texture.canvas,c.x,0,c.width,c.height,d,p,w,E),1!==h&&(e.globalAlpha=y),0!==m&&(e.rotate(-m),e.translate(-g,-f),v||l.setImgSmoothing(e,!1))}else n.drawElement(e,t)}}},bd=function(){return 0},xd=function(e,t){return e.getTextAngle(t,null)},wd=function(e,t){return e.getTextAngle(t,"source")},Ed=function(e,t){return e.getTextAngle(t,"target")},Td=function(e,t){return t.effectiveOpacity()},_d=function(e,t){return t.pstyle("text-opacity").pfValue*t.effectiveOpacity()};md.drawCachedElement=function(e,t,n,r,i,a){var o=this,s=o.data,l=s.eleTxrCache,u=s.lblTxrCache,c=s.slbTxrCache,h=s.tlbTxrCache,d=t.boundingBox(),p=!0===a?l.reasons.highQuality:null;if(0!==d.w&&0!==d.h&&t.visible()&&(!r||Bn(d,r))){var g=t.isEdge(),f=t.element()._private.rscratch.badLine;o.drawElementUnderlay(e,t),o.drawCachedElementPortion(e,t,l,n,i,p,bd,Td),g&&f||o.drawCachedElementPortion(e,t,u,n,i,p,xd,_d),g&&!f&&(o.drawCachedElementPortion(e,t,c,n,i,p,wd,_d),o.drawCachedElementPortion(e,t,h,n,i,p,Ed,_d)),o.drawElementOverlay(e,t)}},md.drawElements=function(e,t){for(var n=this,r=0;r<t.length;r++){var i=t[r];n.drawElement(e,i)}},md.drawCachedElements=function(e,t,n,r){for(var i=this,a=0;a<t.length;a++){var o=t[a];i.drawCachedElement(e,o,n,r)}},md.drawCachedNodes=function(e,t,n,r){for(var i=this,a=0;a<t.length;a++){var o=t[a];o.isNode()&&i.drawCachedElement(e,o,n,r)}},md.drawLayeredElements=function(e,t,n,r){var i=this,a=i.data.lyrTxrCache.getLayers(t,n);if(a)for(var o=0;o<a.length;o++){var s=a[o],l=s.bb;0!==l.w&&0!==l.h&&e.drawImage(s.canvas,l.x1,l.y1,l.w,l.h)}else i.drawCachedElements(e,t,n,r)};var Dd={drawEdge:function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],o=this,s=t._private.rscratch;if((!a||t.visible())&&!s.badLine&&null!=s.allpts&&!isNaN(s.allpts[0])){var l;n&&(l=n,e.translate(-l.x1,-l.y1));var u=a?t.pstyle("opacity").value:1,c=a?t.pstyle("line-opacity").value:1,h=t.pstyle("curve-style").value,d=t.pstyle("line-style").value,p=t.pstyle("width").pfValue,g=t.pstyle("line-cap").value,f=u*c,v=u*c,y=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f;"straight-triangle"===h?(o.eleStrokeStyle(e,t,n),o.drawEdgeTrianglePath(t,e,s.allpts)):(e.lineWidth=p,e.lineCap=g,o.eleStrokeStyle(e,t,n),o.drawEdgePath(t,e,s.allpts,d),e.lineCap="butt")},m=function(){i&&o.drawEdgeOverlay(e,t)},b=function(){i&&o.drawEdgeUnderlay(e,t)},x=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v;o.drawArrowheads(e,t,n)},w=function(){o.drawElementText(e,t,null,r)};if(e.lineJoin="round","yes"===t.pstyle("ghost").value){var E=t.pstyle("ghost-offset-x").pfValue,T=t.pstyle("ghost-offset-y").pfValue,_=t.pstyle("ghost-opacity").value,D=f*_;e.translate(E,T),y(D),x(D),e.translate(-E,-T)}b(),y(),x(),m(),w(),n&&e.translate(l.x1,l.y1)}}},Cd=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n){if(n.visible()){var r=n.pstyle("".concat(e,"-opacity")).value;if(0!==r){var i=this,a=i.usePaths(),o=n._private.rscratch,s=2*n.pstyle("".concat(e,"-padding")).pfValue,l=n.pstyle("".concat(e,"-color")).value;t.lineWidth=s,"self"!==o.edgeType||a?t.lineCap="round":t.lineCap="butt",i.colorStrokeStyle(t,l[0],l[1],l[2],r),i.drawEdgePath(n,t,o.allpts,"solid")}}}};Dd.drawEdgeOverlay=Cd("overlay"),Dd.drawEdgeUnderlay=Cd("underlay"),Dd.drawEdgePath=function(e,t,n,r){var i,a=e._private.rscratch,o=t,s=!1,l=this.usePaths(),u=e.pstyle("line-dash-pattern").pfValue,c=e.pstyle("line-dash-offset").pfValue;if(l){var h=n.join("$");a.pathCacheKey&&a.pathCacheKey===h?(i=t=a.pathCache,s=!0):(i=t=new Path2D,a.pathCacheKey=h,a.pathCache=i)}if(o.setLineDash)switch(r){case"dotted":o.setLineDash([1,1]);break;case"dashed":o.setLineDash(u),o.lineDashOffset=c;break;case"solid":o.setLineDash([])}if(!s&&!a.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(n[0],n[1]),a.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var d=2;d+3<n.length;d+=4)t.quadraticCurveTo(n[d],n[d+1],n[d+2],n[d+3]);break;case"straight":case"segments":case"haystack":for(var p=2;p+1<n.length;p+=2)t.lineTo(n[p],n[p+1])}t=o,l?t.stroke(i):t.stroke(),t.setLineDash&&t.setLineDash([])},Dd.drawEdgeTrianglePath=function(e,t,n){t.fillStyle=t.strokeStyle;for(var r=e.pstyle("width").pfValue,i=0;i+1<n.length;i+=2){var a=[n[i+2]-n[i],n[i+3]-n[i+1]],o=Math.sqrt(a[0]*a[0]+a[1]*a[1]),s=[a[1]/o,-a[0]/o],l=[s[0]*r/2,s[1]*r/2];t.beginPath(),t.moveTo(n[i]-l[0],n[i+1]-l[1]),t.lineTo(n[i]+l[0],n[i+1]+l[1]),t.lineTo(n[i+2],n[i+3]),t.closePath(),t.fill()}},Dd.drawArrowheads=function(e,t,n){var r=t._private.rscratch,i="haystack"===r.edgeType;i||this.drawArrowhead(e,t,"source",r.arrowStartX,r.arrowStartY,r.srcArrowAngle,n),this.drawArrowhead(e,t,"mid-target",r.midX,r.midY,r.midtgtArrowAngle,n),this.drawArrowhead(e,t,"mid-source",r.midX,r.midY,r.midsrcArrowAngle,n),i||this.drawArrowhead(e,t,"target",r.arrowEndX,r.arrowEndY,r.tgtArrowAngle,n)},Dd.drawArrowhead=function(e,t,n,r,i,a,o){if(!(isNaN(r)||null==r||isNaN(i)||null==i||isNaN(a)||null==a)){var s=this,l=t.pstyle(n+"-arrow-shape").value;if("none"!==l){var u="hollow"===t.pstyle(n+"-arrow-fill").value?"both":"filled",c=t.pstyle(n+"-arrow-fill").value,h=t.pstyle("width").pfValue,d=t.pstyle("opacity").value;void 0===o&&(o=d);var p=e.globalCompositeOperation;1===o&&"hollow"!==c||(e.globalCompositeOperation="destination-out",s.colorFillStyle(e,255,255,255,1),s.colorStrokeStyle(e,255,255,255,1),s.drawArrowShape(t,e,u,h,l,r,i,a),e.globalCompositeOperation=p);var g=t.pstyle(n+"-arrow-color").value;s.colorFillStyle(e,g[0],g[1],g[2],o),s.colorStrokeStyle(e,g[0],g[1],g[2],o),s.drawArrowShape(t,e,c,h,l,r,i,a)}}},Dd.drawArrowShape=function(e,t,n,r,i,a,o,s){var l,u=this,c=this.usePaths()&&"triangle-cross"!==i,h=!1,d=t,p={x:a,y:o},g=e.pstyle("arrow-scale").value,f=this.getArrowWidth(r,g),v=u.arrowShapes[i];if(c){var y=u.arrowPathCache=u.arrowPathCache||[],m=gt(i),b=y[m];null!=b?(l=t=b,h=!0):(l=t=new Path2D,y[m]=l)}h||(t.beginPath&&t.beginPath(),c?v.draw(t,1,0,{x:0,y:0},1):v.draw(t,f,s,p,r),t.closePath&&t.closePath()),t=d,c&&(t.translate(a,o),t.rotate(s),t.scale(f,f)),"filled"!==n&&"both"!==n||(c?t.fill(l):t.fill()),"hollow"!==n&&"both"!==n||(t.lineWidth=(v.matchEdgeWidth?r:1)/(c?f:1),t.lineJoin="miter",c?t.stroke(l):t.stroke()),c&&(t.scale(1/f,1/f),t.rotate(-s),t.translate(-a,-o))};var Nd={safeDrawImage:function(e,t,n,r,i,a,o,s,l,u){if(!(i<=0||a<=0||l<=0||u<=0))try{e.drawImage(t,n,r,i,a,o,s,l,u)}catch(c){Nt(c)}},drawInscribedImage:function(e,t,n,r,i){var a=this,o=n.position(),s=o.x,l=o.y,u=n.cy().style(),c=u.getIndexedStyle.bind(u),h=c(n,"background-fit","value",r),d=c(n,"background-repeat","value",r),p=n.width(),g=n.height(),f=2*n.padding(),v=p+("inner"===c(n,"background-width-relative-to","value",r)?0:f),y=g+("inner"===c(n,"background-height-relative-to","value",r)?0:f),m=n._private.rscratch,b="node"===c(n,"background-clip","value",r),x=c(n,"background-image-opacity","value",r)*i,w=c(n,"background-image-smoothing","value",r),E=t.width||t.cachedW,T=t.height||t.cachedH;null!=E&&null!=T||(document.body.appendChild(t),E=t.cachedW=t.width||t.offsetWidth,T=t.cachedH=t.height||t.offsetHeight,document.body.removeChild(t));var _=E,D=T;if("auto"!==c(n,"background-width","value",r)&&(_="%"===c(n,"background-width","units",r)?c(n,"background-width","pfValue",r)*v:c(n,"background-width","pfValue",r)),"auto"!==c(n,"background-height","value",r)&&(D="%"===c(n,"background-height","units",r)?c(n,"background-height","pfValue",r)*y:c(n,"background-height","pfValue",r)),0!==_&&0!==D){if("contain"===h)_*=C=Math.min(v/_,y/D),D*=C;else if("cover"===h){var C;_*=C=Math.max(v/_,y/D),D*=C}var N=s-v/2,A=c(n,"background-position-x","units",r),L=c(n,"background-position-x","pfValue",r);N+="%"===A?(v-_)*L:L;var S=c(n,"background-offset-x","units",r),O=c(n,"background-offset-x","pfValue",r);N+="%"===S?(v-_)*O:O;var I=l-y/2,k=c(n,"background-position-y","units",r),M=c(n,"background-position-y","pfValue",r);I+="%"===k?(y-D)*M:M;var P=c(n,"background-offset-y","units",r),R=c(n,"background-offset-y","pfValue",r);I+="%"===P?(y-D)*R:R,m.pathCache&&(N-=s,I-=l,s=0,l=0);var B=e.globalAlpha;e.globalAlpha=x;var F=a.getImgSmoothing(e),z=!1;if("no"===w&&F?(a.setImgSmoothing(e,!1),z=!0):"yes"!==w||F||(a.setImgSmoothing(e,!0),z=!0),"no-repeat"===d)b&&(e.save(),m.pathCache?e.clip(m.pathCache):(a.nodeShapes[a.getNodeShape(n)].draw(e,s,l,v,y),e.clip())),a.safeDrawImage(e,t,0,0,E,T,N,I,_,D),b&&e.restore();else{var G=e.createPattern(t,d);e.fillStyle=G,a.nodeShapes[a.getNodeShape(n)].draw(e,s,l,v,y),e.translate(N,I),e.fill(),e.translate(-N,-I)}e.globalAlpha=B,z&&a.setImgSmoothing(e,F)}}},Ad={};function Ld(e,t,n,r,i){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:5;e.beginPath(),e.moveTo(t+a,n),e.lineTo(t+r-a,n),e.quadraticCurveTo(t+r,n,t+r,n+a),e.lineTo(t+r,n+i-a),e.quadraticCurveTo(t+r,n+i,t+r-a,n+i),e.lineTo(t+a,n+i),e.quadraticCurveTo(t,n+i,t,n+i-a),e.lineTo(t,n+a),e.quadraticCurveTo(t,n,t+a,n),e.closePath(),e.fill()}Ad.eleTextBiggerThanMin=function(e,t){if(!t){var n=e.cy().zoom(),r=this.getPixelRatio(),i=Math.ceil(xn(n*r));t=Math.pow(2,i)}return!(e.pstyle("font-size").pfValue*t<e.pstyle("min-zoomed-font-size").pfValue)},Ad.drawElementText=function(e,t,n,r,i){var a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],o=this;if(null==r){if(a&&!o.eleTextBiggerThanMin(t))return}else if(!1===r)return;if(t.isNode()){var s=t.pstyle("label");if(!s||!s.value)return;var l=o.getLabelJustification(t);e.textAlign=l,e.textBaseline="bottom"}else{var u=t.element()._private.rscratch.badLine,c=t.pstyle("label"),h=t.pstyle("source-label"),d=t.pstyle("target-label");if(u||(!c||!c.value)&&(!h||!h.value)&&(!d||!d.value))return;e.textAlign="center",e.textBaseline="bottom"}var p,g=!n;n&&(p=n,e.translate(-p.x1,-p.y1)),null==i?(o.drawText(e,t,null,g,a),t.isEdge()&&(o.drawText(e,t,"source",g,a),o.drawText(e,t,"target",g,a))):o.drawText(e,t,i,g,a),n&&e.translate(p.x1,p.y1)},Ad.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var n=0;n<this.fontCaches.length;n++)if((t=this.fontCaches[n]).context===e)return t;return t={context:e},this.fontCaches.push(t),t},Ad.setupTextStyle=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=t.pstyle("font-style").strValue,i=t.pstyle("font-size").pfValue+"px",a=t.pstyle("font-family").strValue,o=t.pstyle("font-weight").strValue,s=n?t.effectiveOpacity()*t.pstyle("text-opacity").value:1,l=t.pstyle("text-outline-opacity").value*s,u=t.pstyle("color").value,c=t.pstyle("text-outline-color").value;e.font=r+" "+o+" "+i+" "+a,e.lineJoin="round",this.colorFillStyle(e,u[0],u[1],u[2],s),this.colorStrokeStyle(e,c[0],c[1],c[2],l)},Ad.getTextAngle=function(e,t){var n=e._private.rscratch,r=t?t+"-":"",i=e.pstyle(r+"text-rotation"),a=Ft(n,"labelAngle",t);return"autorotate"===i.strValue?e.isEdge()?a:0:"none"===i.strValue?0:i.pfValue},Ad.drawText=function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=t._private.rscratch,o=i?t.effectiveOpacity():1;if(!i||0!==o&&0!==t.pstyle("text-opacity").value){"main"===n&&(n=null);var s,l,u=Ft(a,"labelX",n),c=Ft(a,"labelY",n),h=this.getLabelText(t,n);if(null!=h&&""!==h&&!isNaN(u)&&!isNaN(c)){this.setupTextStyle(e,t,i);var d,p=n?n+"-":"",g=Ft(a,"labelWidth",n),f=Ft(a,"labelHeight",n),v=t.pstyle(p+"text-margin-x").pfValue,y=t.pstyle(p+"text-margin-y").pfValue,m=t.isEdge(),b=t.pstyle("text-halign").value,x=t.pstyle("text-valign").value;switch(m&&(b="center",x="center"),u+=v,c+=y,0!==(d=r?this.getTextAngle(t,n):0)&&(s=u,l=c,e.translate(s,l),e.rotate(d),u=0,c=0),x){case"top":break;case"center":c+=f/2;break;case"bottom":c+=f}var w=t.pstyle("text-background-opacity").value,E=t.pstyle("text-border-opacity").value,T=t.pstyle("text-border-width").pfValue,_=t.pstyle("text-background-padding").pfValue;if(w>0||T>0&&E>0){var D=u-_;switch(b){case"left":D-=g;break;case"center":D-=g/2}var C=c-f-_,N=g+2*_,A=f+2*_;if(w>0){var L=e.fillStyle,S=t.pstyle("text-background-color").value;e.fillStyle="rgba("+S[0]+","+S[1]+","+S[2]+","+w*o+")",0===t.pstyle("text-background-shape").strValue.indexOf("round")?Ld(e,D,C,N,A,2):e.fillRect(D,C,N,A),e.fillStyle=L}if(T>0&&E>0){var O=e.strokeStyle,I=e.lineWidth,k=t.pstyle("text-border-color").value,M=t.pstyle("text-border-style").value;if(e.strokeStyle="rgba("+k[0]+","+k[1]+","+k[2]+","+E*o+")",e.lineWidth=T,e.setLineDash)switch(M){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=T/4,e.setLineDash([]);break;case"solid":e.setLineDash([])}if(e.strokeRect(D,C,N,A),"double"===M){var P=T/2;e.strokeRect(D+P,C+P,N-2*P,A-2*P)}e.setLineDash&&e.setLineDash([]),e.lineWidth=I,e.strokeStyle=O}}var R=2*t.pstyle("text-outline-width").pfValue;if(R>0&&(e.lineWidth=R),"wrap"===t.pstyle("text-wrap").value){var B=Ft(a,"labelWrapCachedLines",n),F=Ft(a,"labelLineHeight",n),z=g/2,G=this.getLabelJustification(t);switch("auto"===G||("left"===b?"left"===G?u+=-g:"center"===G&&(u+=-z):"center"===b?"left"===G?u+=-z:"right"===G&&(u+=z):"right"===b&&("center"===G?u+=z:"right"===G&&(u+=g))),x){case"top":case"center":case"bottom":c-=(B.length-1)*F}for(var Y=0;Y<B.length;Y++)R>0&&e.strokeText(B[Y],u,c),e.fillText(B[Y],u,c),c+=F}else R>0&&e.strokeText(h,u,c),e.fillText(h,u,c);0!==d&&(e.rotate(-d),e.translate(-s,-l))}}};var Sd={drawNode:function(e,t,n){var r,i,a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],l=this,u=t._private,c=u.rscratch,h=t.position();if(_(h.x)&&_(h.y)&&(!s||t.visible())){var d,p,g=s?t.effectiveOpacity():1,f=l.usePaths(),v=!1,y=t.padding();r=t.width()+2*y,i=t.height()+2*y,n&&(p=n,e.translate(-p.x1,-p.y1));for(var m=t.pstyle("background-image").value,b=new Array(m.length),x=new Array(m.length),w=0,E=0;E<m.length;E++){var T=m[E];if(b[E]=null!=T&&"none"!==T){var D=t.cy().style().getIndexedStyle(t,"background-image-crossorigin","value",E);w++,x[E]=l.getCachedImage(T,D,(function(){u.backgroundTimestamp=Date.now(),t.emitAndNotify("background")}))}}var C=t.pstyle("background-blacken").value,N=t.pstyle("border-width").pfValue,A=t.pstyle("background-opacity").value*g,L=t.pstyle("border-color").value,S=t.pstyle("border-style").value,O=t.pstyle("border-opacity").value*g;e.lineJoin="miter";var I=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:A;l.eleFillStyle(e,t,n)},k=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:O;l.colorStrokeStyle(e,L[0],L[1],L[2],t)},M=t.pstyle("shape").strValue,P=t.pstyle("shape-polygon-points").pfValue;if(f){e.translate(h.x,h.y);var R=l.nodePathCache=l.nodePathCache||[],B=ft("polygon"===M?M+","+P.join(","):M,""+i,""+r),F=R[B];null!=F?(d=F,v=!0,c.pathCache=d):(d=new Path2D,R[B]=c.pathCache=d)}var z=function(){if(!v){var n=h;f&&(n={x:0,y:0}),l.nodeShapes[l.getNodeShape(t)].draw(d||e,n.x,n.y,r,i)}f?e.fill(d):e.fill()},G=function(){for(var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=u.backgrounding,a=0,o=0;o<x.length;o++){var s=t.cy().style().getIndexedStyle(t,"background-image-containment","value",o);r&&"over"===s||!r&&"inside"===s?a++:b[o]&&x[o].complete&&!x[o].error&&(a++,l.drawInscribedImage(e,x[o],t,o,n))}u.backgrounding=!(a===w),i!==u.backgrounding&&t.updateStyle(!1)},Y=function(){var n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g;l.hasPie(t)&&(l.drawPie(e,t,a),n&&(f||l.nodeShapes[l.getNodeShape(t)].draw(e,h.x,h.y,r,i)))},X=function(){var t=(C>0?C:-C)*(arguments.length>0&&void 0!==arguments[0]?arguments[0]:g),n=C>0?0:255;0!==C&&(l.colorFillStyle(e,n,n,n,t),f?e.fill(d):e.fill())},V=function(){if(N>0){if(e.lineWidth=N,e.lineCap="butt",e.setLineDash)switch(S){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([])}if(f?e.stroke(d):e.stroke(),"double"===S){e.lineWidth=N/3;var t=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",f?e.stroke(d):e.stroke(),e.globalCompositeOperation=t}e.setLineDash&&e.setLineDash([])}},U=function(){o&&l.drawNodeOverlay(e,t,h,r,i)},j=function(){o&&l.drawNodeUnderlay(e,t,h,r,i)},H=function(){l.drawElementText(e,t,null,a)};if("yes"===t.pstyle("ghost").value){var q=t.pstyle("ghost-offset-x").pfValue,W=t.pstyle("ghost-offset-y").pfValue,$=t.pstyle("ghost-opacity").value,Z=$*g;e.translate(q,W),I($*A),z(),G(Z,!0),k($*O),V(),Y(0!==C||0!==N),G(Z,!1),X(Z),e.translate(-q,-W)}f&&e.translate(-h.x,-h.y),j(),f&&e.translate(h.x,h.y),I(),z(),G(g,!0),k(),V(),Y(0!==C||0!==N),G(g,!1),X(),f&&e.translate(-h.x,-h.y),H(),U(),n&&e.translate(p.x1,p.y1)}}},Od=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n,r,i,a){var o=this;if(n.visible()){var s=n.pstyle("".concat(e,"-padding")).pfValue,l=n.pstyle("".concat(e,"-opacity")).value,u=n.pstyle("".concat(e,"-color")).value,c=n.pstyle("".concat(e,"-shape")).value;if(l>0){if(r=r||n.position(),null==i||null==a){var h=n.padding();i=n.width()+2*h,a=n.height()+2*h}o.colorFillStyle(t,u[0],u[1],u[2],l),o.nodeShapes[c].draw(t,r.x,r.y,i+2*s,a+2*s),t.fill()}}}};Sd.drawNodeOverlay=Od("overlay"),Sd.drawNodeUnderlay=Od("underlay"),Sd.hasPie=function(e){return(e=e[0])._private.hasPie},Sd.drawPie=function(e,t,n,r){t=t[0],r=r||t.position();var i=t.cy().style(),a=t.pstyle("pie-size"),o=r.x,s=r.y,l=t.width(),u=t.height(),c=Math.min(l,u)/2,h=0;this.usePaths()&&(o=0,s=0),"%"===a.units?c*=a.pfValue:void 0!==a.pfValue&&(c=a.pfValue/2);for(var d=1;d<=i.pieBackgroundN;d++){var p=t.pstyle("pie-"+d+"-background-size").value,g=t.pstyle("pie-"+d+"-background-color").value,f=t.pstyle("pie-"+d+"-background-opacity").value*n,v=p/100;v+h>1&&(v=1-h);var y=1.5*Math.PI+2*Math.PI*h,m=y+2*Math.PI*v;0===p||h>=1||h+v>1||(e.beginPath(),e.moveTo(o,s),e.arc(o,s,c,y,m),e.closePath(),this.colorFillStyle(e,g[0],g[1],g[2],f),e.fill(),h+=v)}};var Id={},kd=100;Id.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},Id.paintCache=function(e){for(var t,n=this.paintCaches=this.paintCaches||[],r=!0,i=0;i<n.length;i++)if((t=n[i]).context===e){r=!1;break}return r&&(t={context:e},n.push(t)),t},Id.createGradientStyleFor=function(e,t,n,r,i){var a,o=this.usePaths(),s=n.pstyle(t+"-gradient-stop-colors").value,l=n.pstyle(t+"-gradient-stop-positions").pfValue;if("radial-gradient"===r)if(n.isEdge()){var u=n.sourceEndpoint(),c=n.targetEndpoint(),h=n.midpoint(),d=En(u,h),p=En(c,h);a=e.createRadialGradient(h.x,h.y,0,h.x,h.y,Math.max(d,p))}else{var g=o?{x:0,y:0}:n.position(),f=n.paddedWidth(),v=n.paddedHeight();a=e.createRadialGradient(g.x,g.y,0,g.x,g.y,Math.max(f,v))}else if(n.isEdge()){var y=n.sourceEndpoint(),m=n.targetEndpoint();a=e.createLinearGradient(y.x,y.y,m.x,m.y)}else{var b=o?{x:0,y:0}:n.position(),x=n.paddedWidth()/2,w=n.paddedHeight()/2;switch(n.pstyle("background-gradient-direction").value){case"to-bottom":a=e.createLinearGradient(b.x,b.y-w,b.x,b.y+w);break;case"to-top":a=e.createLinearGradient(b.x,b.y+w,b.x,b.y-w);break;case"to-left":a=e.createLinearGradient(b.x+x,b.y,b.x-x,b.y);break;case"to-right":a=e.createLinearGradient(b.x-x,b.y,b.x+x,b.y);break;case"to-bottom-right":case"to-right-bottom":a=e.createLinearGradient(b.x-x,b.y-w,b.x+x,b.y+w);break;case"to-top-right":case"to-right-top":a=e.createLinearGradient(b.x-x,b.y+w,b.x+x,b.y-w);break;case"to-bottom-left":case"to-left-bottom":a=e.createLinearGradient(b.x+x,b.y-w,b.x-x,b.y+w);break;case"to-top-left":case"to-left-top":a=e.createLinearGradient(b.x+x,b.y+w,b.x-x,b.y-w)}}if(!a)return null;for(var E=l.length===s.length,T=s.length,_=0;_<T;_++)a.addColorStop(E?l[_]:_/(T-1),"rgba("+s[_][0]+","+s[_][1]+","+s[_][2]+","+i+")");return a},Id.gradientFillStyle=function(e,t,n,r){var i=this.createGradientStyleFor(e,"background",t,n,r);if(!i)return null;e.fillStyle=i},Id.colorFillStyle=function(e,t,n,r,i){e.fillStyle="rgba("+t+","+n+","+r+","+i+")"},Id.eleFillStyle=function(e,t,n){var r=t.pstyle("background-fill").value;if("linear-gradient"===r||"radial-gradient"===r)this.gradientFillStyle(e,t,r,n);else{var i=t.pstyle("background-color").value;this.colorFillStyle(e,i[0],i[1],i[2],n)}},Id.gradientStrokeStyle=function(e,t,n,r){var i=this.createGradientStyleFor(e,"line",t,n,r);if(!i)return null;e.strokeStyle=i},Id.colorStrokeStyle=function(e,t,n,r,i){e.strokeStyle="rgba("+t+","+n+","+r+","+i+")"},Id.eleStrokeStyle=function(e,t,n){var r=t.pstyle("line-fill").value;if("linear-gradient"===r||"radial-gradient"===r)this.gradientStrokeStyle(e,t,r,n);else{var i=t.pstyle("line-color").value;this.colorStrokeStyle(e,i[0],i[1],i[2],n)}},Id.matchCanvasSize=function(e){var t=this,n=t.data,r=t.findContainerClientCoords(),i=r[2],a=r[3],o=t.getPixelRatio(),s=t.motionBlurPxRatio;e!==t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_NODE]&&e!==t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_DRAG]||(o=s);var l,u=i*o,c=a*o;if(u!==t.canvasWidth||c!==t.canvasHeight){t.fontCaches=null;var h=n.canvasContainer;h.style.width=i+"px",h.style.height=a+"px";for(var d=0;d<t.CANVAS_LAYERS;d++)(l=n.canvases[d]).width=u,l.height=c,l.style.width=i+"px",l.style.height=a+"px";for(d=0;d<t.BUFFER_COUNT;d++)(l=n.bufferCanvases[d]).width=u,l.height=c,l.style.width=i+"px",l.style.height=a+"px";t.textureMult=1,o<=1&&(l=n.bufferCanvases[t.TEXTURE_BUFFER],t.textureMult=2,l.width=u*t.textureMult,l.height=c*t.textureMult),t.canvasWidth=u,t.canvasHeight=c}},Id.renderTo=function(e,t,n,r){this.render({forcedContext:e,forcedZoom:t,forcedPan:n,drawAllLayers:!0,forcedPxRatio:r})},Id.render=function(e){var t=(e=e||kt()).forcedContext,n=e.drawAllLayers,r=e.drawOnlyNodeLayer,i=e.forcedZoom,a=e.forcedPan,o=this,s=void 0===e.forcedPxRatio?this.getPixelRatio():e.forcedPxRatio,l=o.cy,u=o.data,c=u.canvasNeedsRedraw,h=o.textureOnViewport&&!t&&(o.pinching||o.hoverData.dragging||o.swipePanning||o.data.wheelZooming),d=void 0!==e.motionBlur?e.motionBlur:o.motionBlur,p=o.motionBlurPxRatio,g=l.hasCompoundNodes(),f=o.hoverData.draggingEles,v=!(!o.hoverData.selecting&&!o.touchData.selecting),y=d=d&&!t&&o.motionBlurEnabled&&!v;t||(o.prevPxRatio!==s&&(o.invalidateContainerClientCoordsCache(),o.matchCanvasSize(o.container),o.redrawHint("eles",!0),o.redrawHint("drag",!0)),o.prevPxRatio=s),!t&&o.motionBlurTimeout&&clearTimeout(o.motionBlurTimeout),d&&(null==o.mbFrames&&(o.mbFrames=0),o.mbFrames++,o.mbFrames<3&&(y=!1),o.mbFrames>o.minMbLowQualFrames&&(o.motionBlurPxRatio=o.mbPxRBlurry)),o.clearingMotionBlur&&(o.motionBlurPxRatio=1),o.textureDrawLastFrame&&!h&&(c[o.NODE]=!0,c[o.SELECT_BOX]=!0);var m=l.style(),b=l.zoom(),x=void 0!==i?i:b,w=l.pan(),E={x:w.x,y:w.y},T={zoom:b,pan:{x:w.x,y:w.y}},_=o.prevViewport;void 0===_||T.zoom!==_.zoom||T.pan.x!==_.pan.x||T.pan.y!==_.pan.y||f&&!g||(o.motionBlurPxRatio=1),a&&(E=a),x*=s,E.x*=s,E.y*=s;var D=o.getCachedZSortedEles();function C(e,t,n,r,i){var a=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",o.colorFillStyle(e,255,255,255,o.motionBlurTransparency),e.fillRect(t,n,r,i),e.globalCompositeOperation=a}function N(e,r){var s,l,c,h;o.clearingMotionBlur||e!==u.bufferContexts[o.MOTIONBLUR_BUFFER_NODE]&&e!==u.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG]?(s=E,l=x,c=o.canvasWidth,h=o.canvasHeight):(s={x:w.x*p,y:w.y*p},l=b*p,c=o.canvasWidth*p,h=o.canvasHeight*p),e.setTransform(1,0,0,1,0,0),"motionBlur"===r?C(e,0,0,c,h):t||void 0!==r&&!r||e.clearRect(0,0,c,h),n||(e.translate(s.x,s.y),e.scale(l,l)),a&&e.translate(a.x,a.y),i&&e.scale(i,i)}if(h||(o.textureDrawLastFrame=!1),h){if(o.textureDrawLastFrame=!0,!o.textureCache){o.textureCache={},o.textureCache.bb=l.mutableElements().boundingBox(),o.textureCache.texture=o.data.bufferCanvases[o.TEXTURE_BUFFER];var A=o.data.bufferContexts[o.TEXTURE_BUFFER];A.setTransform(1,0,0,1,0,0),A.clearRect(0,0,o.canvasWidth*o.textureMult,o.canvasHeight*o.textureMult),o.render({forcedContext:A,drawOnlyNodeLayer:!0,forcedPxRatio:s*o.textureMult}),(T=o.textureCache.viewport={zoom:l.zoom(),pan:l.pan(),width:o.canvasWidth,height:o.canvasHeight}).mpan={x:(0-T.pan.x)/T.zoom,y:(0-T.pan.y)/T.zoom}}c[o.DRAG]=!1,c[o.NODE]=!1;var L=u.contexts[o.NODE],S=o.textureCache.texture;T=o.textureCache.viewport,L.setTransform(1,0,0,1,0,0),d?C(L,0,0,T.width,T.height):L.clearRect(0,0,T.width,T.height);var O=m.core("outside-texture-bg-color").value,I=m.core("outside-texture-bg-opacity").value;o.colorFillStyle(L,O[0],O[1],O[2],I),L.fillRect(0,0,T.width,T.height),b=l.zoom(),N(L,!1),L.clearRect(T.mpan.x,T.mpan.y,T.width/T.zoom/s,T.height/T.zoom/s),L.drawImage(S,T.mpan.x,T.mpan.y,T.width/T.zoom/s,T.height/T.zoom/s)}else o.textureOnViewport&&!t&&(o.textureCache=null);var k=l.extent(),M=o.pinching||o.hoverData.dragging||o.swipePanning||o.data.wheelZooming||o.hoverData.draggingEles||o.cy.animated(),P=o.hideEdgesOnViewport&&M,R=[];if(R[o.NODE]=!c[o.NODE]&&d&&!o.clearedForMotionBlur[o.NODE]||o.clearingMotionBlur,R[o.NODE]&&(o.clearedForMotionBlur[o.NODE]=!0),R[o.DRAG]=!c[o.DRAG]&&d&&!o.clearedForMotionBlur[o.DRAG]||o.clearingMotionBlur,R[o.DRAG]&&(o.clearedForMotionBlur[o.DRAG]=!0),c[o.NODE]||n||r||R[o.NODE]){var B=d&&!R[o.NODE]&&1!==p;N(L=t||(B?o.data.bufferContexts[o.MOTIONBLUR_BUFFER_NODE]:u.contexts[o.NODE]),d&&!B?"motionBlur":void 0),P?o.drawCachedNodes(L,D.nondrag,s,k):o.drawLayeredElements(L,D.nondrag,s,k),o.debug&&o.drawDebugPoints(L,D.nondrag),n||d||(c[o.NODE]=!1)}if(!r&&(c[o.DRAG]||n||R[o.DRAG])&&(B=d&&!R[o.DRAG]&&1!==p,N(L=t||(B?o.data.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG]:u.contexts[o.DRAG]),d&&!B?"motionBlur":void 0),P?o.drawCachedNodes(L,D.drag,s,k):o.drawCachedElements(L,D.drag,s,k),o.debug&&o.drawDebugPoints(L,D.drag),n||d||(c[o.DRAG]=!1)),o.showFps||!r&&c[o.SELECT_BOX]&&!n){if(N(L=t||u.contexts[o.SELECT_BOX]),1==o.selection[4]&&(o.hoverData.selecting||o.touchData.selecting)){b=o.cy.zoom();var F=m.core("selection-box-border-width").value/b;L.lineWidth=F,L.fillStyle="rgba("+m.core("selection-box-color").value[0]+","+m.core("selection-box-color").value[1]+","+m.core("selection-box-color").value[2]+","+m.core("selection-box-opacity").value+")",L.fillRect(o.selection[0],o.selection[1],o.selection[2]-o.selection[0],o.selection[3]-o.selection[1]),F>0&&(L.strokeStyle="rgba("+m.core("selection-box-border-color").value[0]+","+m.core("selection-box-border-color").value[1]+","+m.core("selection-box-border-color").value[2]+","+m.core("selection-box-opacity").value+")",L.strokeRect(o.selection[0],o.selection[1],o.selection[2]-o.selection[0],o.selection[3]-o.selection[1]))}if(u.bgActivePosistion&&!o.hoverData.selecting){b=o.cy.zoom();var z=u.bgActivePosistion;L.fillStyle="rgba("+m.core("active-bg-color").value[0]+","+m.core("active-bg-color").value[1]+","+m.core("active-bg-color").value[2]+","+m.core("active-bg-opacity").value+")",L.beginPath(),L.arc(z.x,z.y,m.core("active-bg-size").pfValue/b,0,2*Math.PI),L.fill()}var G=o.lastRedrawTime;if(o.showFps&&G){G=Math.round(G);var Y=Math.round(1e3/G);L.setTransform(1,0,0,1,0,0),L.fillStyle="rgba(255, 0, 0, 0.75)",L.strokeStyle="rgba(255, 0, 0, 0.75)",L.lineWidth=1,L.fillText("1 frame = "+G+" ms = "+Y+" fps",0,20);var X=60;L.strokeRect(0,30,250,20),L.fillRect(0,30,250*Math.min(Y/X,1),20)}n||(c[o.SELECT_BOX]=!1)}if(d&&1!==p){var V=u.contexts[o.NODE],U=o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_NODE],j=u.contexts[o.DRAG],H=o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_DRAG],q=function(e,t,n){e.setTransform(1,0,0,1,0,0),n||!y?e.clearRect(0,0,o.canvasWidth,o.canvasHeight):C(e,0,0,o.canvasWidth,o.canvasHeight);var r=p;e.drawImage(t,0,0,o.canvasWidth*r,o.canvasHeight*r,0,0,o.canvasWidth,o.canvasHeight)};(c[o.NODE]||R[o.NODE])&&(q(V,U,R[o.NODE]),c[o.NODE]=!1),(c[o.DRAG]||R[o.DRAG])&&(q(j,H,R[o.DRAG]),c[o.DRAG]=!1)}o.prevViewport=T,o.clearingMotionBlur&&(o.clearingMotionBlur=!1,o.motionBlurCleared=!0,o.motionBlur=!0),d&&(o.motionBlurTimeout=setTimeout((function(){o.motionBlurTimeout=null,o.clearedForMotionBlur[o.NODE]=!1,o.clearedForMotionBlur[o.DRAG]=!1,o.motionBlur=!1,o.clearingMotionBlur=!h,o.mbFrames=0,c[o.NODE]=!0,c[o.DRAG]=!0,o.redraw()}),kd)),t||l.emit("render")};for(var Md={drawPolygonPath:function(e,t,n,r,i,a){var o=r/2,s=i/2;e.beginPath&&e.beginPath(),e.moveTo(t+o*a[0],n+s*a[1]);for(var l=1;l<a.length/2;l++)e.lineTo(t+o*a[2*l],n+s*a[2*l+1]);e.closePath()},drawRoundPolygonPath:function(e,t,n,r,i,a){var o=r/2,s=i/2,l=hr(r,i);e.beginPath&&e.beginPath();for(var u=0;u<a.length/4;u++){var c=void 0,h=void 0;c=0===u?a.length-2:4*u-2,h=4*u+2;var d=t+o*a[4*u],p=n+s*a[4*u+1],g=-a[c]*a[h]-a[c+1]*a[h+1],f=l/Math.tan(Math.acos(g)/2),v=d-f*a[c],y=p-f*a[c+1],m=d+f*a[h],b=p+f*a[h+1];0===u?e.moveTo(v,y):e.lineTo(v,y),e.arcTo(d,p,m,b,l)}e.closePath()},drawRoundRectanglePath:function(e,t,n,r,i){var a=r/2,o=i/2,s=cr(r,i);e.beginPath&&e.beginPath(),e.moveTo(t,n-o),e.arcTo(t+a,n-o,t+a,n,s),e.arcTo(t+a,n+o,t,n+o,s),e.arcTo(t-a,n+o,t-a,n,s),e.arcTo(t-a,n-o,t,n-o,s),e.lineTo(t,n-o),e.closePath()},drawBottomRoundRectanglePath:function(e,t,n,r,i){var a=r/2,o=i/2,s=cr(r,i);e.beginPath&&e.beginPath(),e.moveTo(t,n-o),e.lineTo(t+a,n-o),e.lineTo(t+a,n),e.arcTo(t+a,n+o,t,n+o,s),e.arcTo(t-a,n+o,t-a,n,s),e.lineTo(t-a,n-o),e.lineTo(t,n-o),e.closePath()},drawCutRectanglePath:function(e,t,n,r,i){var a=r/2,o=i/2,s=dr();e.beginPath&&e.beginPath(),e.moveTo(t-a+s,n-o),e.lineTo(t+a-s,n-o),e.lineTo(t+a,n-o+s),e.lineTo(t+a,n+o-s),e.lineTo(t+a-s,n+o),e.lineTo(t-a+s,n+o),e.lineTo(t-a,n+o-s),e.lineTo(t-a,n-o+s),e.closePath()},drawBarrelPath:function(e,t,n,r,i){var a=r/2,o=i/2,s=t-a,l=t+a,u=n-o,c=n+o,h=gr(r,i),d=h.widthOffset,p=h.heightOffset,g=h.ctrlPtOffsetPct*d;e.beginPath&&e.beginPath(),e.moveTo(s,u+p),e.lineTo(s,c-p),e.quadraticCurveTo(s+g,c,s+d,c),e.lineTo(l-d,c),e.quadraticCurveTo(l-g,c,l,c-p),e.lineTo(l,u+p),e.quadraticCurveTo(l-g,u,l-d,u),e.lineTo(s+d,u),e.quadraticCurveTo(s+g,u,s,u+p),e.closePath()}},Pd=Math.sin(0),Rd=Math.cos(0),Bd={},Fd={},zd=Math.PI/40,Gd=0*Math.PI;Gd<2*Math.PI;Gd+=zd)Bd[Gd]=Math.sin(Gd),Fd[Gd]=Math.cos(Gd);Md.drawEllipsePath=function(e,t,n,r,i){if(e.beginPath&&e.beginPath(),e.ellipse)e.ellipse(t,n,r/2,i/2,0,0,2*Math.PI);else for(var a,o,s=r/2,l=i/2,u=0*Math.PI;u<2*Math.PI;u+=zd)a=t-s*Bd[u]*Pd+s*Fd[u]*Rd,o=n+l*Fd[u]*Pd+l*Bd[u]*Rd,0===u?e.moveTo(a,o):e.lineTo(a,o);e.closePath()};var Yd={};function Xd(e,t){for(var n=atob(e),r=new ArrayBuffer(n.length),i=new Uint8Array(r),a=0;a<n.length;a++)i[a]=n.charCodeAt(a);return new Blob([r],{type:t})}function Vd(e){var t=e.indexOf(",");return e.substr(t+1)}function Ud(e,t,n){var r=function(){return t.toDataURL(n,e.quality)};switch(e.output){case"blob-promise":return new Gi((function(r,i){try{t.toBlob((function(e){null!=e?r(e):i(new Error("`canvas.toBlob()` sent a null value in its callback"))}),n,e.quality)}catch(a){i(a)}}));case"blob":return Xd(Vd(r()),n);case"base64":return Vd(r());default:return r()}}Yd.createBuffer=function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,[n,n.getContext("2d")]},Yd.bufferCanvasImage=function(e){var t=this.cy,n=t.mutableElements().boundingBox(),r=this.findContainerClientCoords(),i=e.full?Math.ceil(n.w):r[2],a=e.full?Math.ceil(n.h):r[3],o=_(e.maxWidth)||_(e.maxHeight),s=this.getPixelRatio(),l=1;if(void 0!==e.scale)i*=e.scale,a*=e.scale,l=e.scale;else if(o){var u=1/0,c=1/0;_(e.maxWidth)&&(u=l*e.maxWidth/i),_(e.maxHeight)&&(c=l*e.maxHeight/a),i*=l=Math.min(u,c),a*=l}o||(i*=s,a*=s,l*=s);var h=document.createElement("canvas");h.width=i,h.height=a,h.style.width=i+"px",h.style.height=a+"px";var d=h.getContext("2d");if(i>0&&a>0){d.clearRect(0,0,i,a),d.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(e.full)d.translate(-n.x1*l,-n.y1*l),d.scale(l,l),this.drawElements(d,p),d.scale(1/l,1/l),d.translate(n.x1*l,n.y1*l);else{var g=t.pan(),f={x:g.x*l,y:g.y*l};l*=t.zoom(),d.translate(f.x,f.y),d.scale(l,l),this.drawElements(d,p),d.scale(1/l,1/l),d.translate(-f.x,-f.y)}e.bg&&(d.globalCompositeOperation="destination-over",d.fillStyle=e.bg,d.rect(0,0,i,a),d.fill())}return h},Yd.png=function(e){return Ud(e,this.bufferCanvasImage(e),"image/png")},Yd.jpg=function(e){return Ud(e,this.bufferCanvasImage(e),"image/jpeg")};var jd={nodeShapeImpl:function(e,t,n,r,i,a,o){switch(e){case"ellipse":return this.drawEllipsePath(t,n,r,i,a);case"polygon":return this.drawPolygonPath(t,n,r,i,a,o);case"round-polygon":return this.drawRoundPolygonPath(t,n,r,i,a,o);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(t,n,r,i,a);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(t,n,r,i,a);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(t,n,r,i,a);case"barrel":return this.drawBarrelPath(t,n,r,i,a)}}},Hd=Wd,qd=Wd.prototype;function Wd(e){var t=this;t.data={canvases:new Array(qd.CANVAS_LAYERS),contexts:new Array(qd.CANVAS_LAYERS),canvasNeedsRedraw:new Array(qd.CANVAS_LAYERS),bufferCanvases:new Array(qd.BUFFER_COUNT),bufferContexts:new Array(qd.CANVAS_LAYERS)};var n="-webkit-tap-highlight-color",r="rgba(0,0,0,0)";t.data.canvasContainer=document.createElement("div");var i=t.data.canvasContainer.style;t.data.canvasContainer.style[n]=r,i.position="relative",i.zIndex="0",i.overflow="hidden";var a=e.cy.container();a.appendChild(t.data.canvasContainer),a.style[n]=r;var o={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};B()&&(o["-ms-touch-action"]="none",o["touch-action"]="none");for(var s=0;s<qd.CANVAS_LAYERS;s++){var l=t.data.canvases[s]=document.createElement("canvas");t.data.contexts[s]=l.getContext("2d"),Object.keys(o).forEach((function(e){l.style[e]=o[e]})),l.style.position="absolute",l.setAttribute("data-id","layer"+s),l.style.zIndex=String(qd.CANVAS_LAYERS-s),t.data.canvasContainer.appendChild(l),t.data.canvasNeedsRedraw[s]=!1}for(t.data.topCanvas=t.data.canvases[0],t.data.canvases[qd.NODE].setAttribute("data-id","layer"+qd.NODE+"-node"),t.data.canvases[qd.SELECT_BOX].setAttribute("data-id","layer"+qd.SELECT_BOX+"-selectbox"),t.data.canvases[qd.DRAG].setAttribute("data-id","layer"+qd.DRAG+"-drag"),s=0;s<qd.BUFFER_COUNT;s++)t.data.bufferCanvases[s]=document.createElement("canvas"),t.data.bufferContexts[s]=t.data.bufferCanvases[s].getContext("2d"),t.data.bufferCanvases[s].style.position="absolute",t.data.bufferCanvases[s].setAttribute("data-id","buffer"+s),t.data.bufferCanvases[s].style.zIndex=String(-s-1),t.data.bufferCanvases[s].style.visibility="hidden";t.pathsEnabled=!0;var u=Ln(),c=function(e){return{x:(e.x1+e.x2)/2,y:(e.y1+e.y2)/2}},h=function(e){return{x:-e.w/2,y:-e.h/2}},d=function(e){var t=e[0]._private;return!(t.oldBackgroundTimestamp===t.backgroundTimestamp)},p=function(e){return e[0]._private.nodeKey},g=function(e){return e[0]._private.labelStyleKey},f=function(e){return e[0]._private.sourceLabelStyleKey},v=function(e){return e[0]._private.targetLabelStyleKey},y=function(e,n,r,i,a){return t.drawElement(e,n,r,!1,!1,a)},m=function(e,n,r,i,a){return t.drawElementText(e,n,r,i,"main",a)},b=function(e,n,r,i,a){return t.drawElementText(e,n,r,i,"source",a)},x=function(e,n,r,i,a){return t.drawElementText(e,n,r,i,"target",a)},w=function(e){return e.boundingBox(),e[0]._private.bodyBounds},E=function(e){return e.boundingBox(),e[0]._private.labelBounds.main||u},T=function(e){return e.boundingBox(),e[0]._private.labelBounds.source||u},_=function(e){return e.boundingBox(),e[0]._private.labelBounds.target||u},D=function(e,t){return t},C=function(e){return c(w(e))},N=function(e,t,n){var r=e?e+"-":"";return{x:t.x+n.pstyle(r+"text-margin-x").pfValue,y:t.y+n.pstyle(r+"text-margin-y").pfValue}},A=function(e,t,n){var r=e[0]._private.rscratch;return{x:r[t],y:r[n]}},L=function(e){return N("",A(e,"labelX","labelY"),e)},S=function(e){return N("source",A(e,"sourceLabelX","sourceLabelY"),e)},O=function(e){return N("target",A(e,"targetLabelX","targetLabelY"),e)},I=function(e){return h(w(e))},k=function(e){return h(T(e))},M=function(e){return h(_(e))},P=function(e){var t=E(e),n=h(E(e));if(e.isNode()){switch(e.pstyle("text-halign").value){case"left":n.x=-t.w;break;case"right":n.x=0}switch(e.pstyle("text-valign").value){case"top":n.y=-t.h;break;case"bottom":n.y=0}}return n},R=t.data.eleTxrCache=new jh(t,{getKey:p,doesEleInvalidateKey:d,drawElement:y,getBoundingBox:w,getRotationPoint:C,getRotationOffset:I,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),F=t.data.lblTxrCache=new jh(t,{getKey:g,drawElement:m,getBoundingBox:E,getRotationPoint:L,getRotationOffset:P,isVisible:D}),z=t.data.slbTxrCache=new jh(t,{getKey:f,drawElement:b,getBoundingBox:T,getRotationPoint:S,getRotationOffset:k,isVisible:D}),G=t.data.tlbTxrCache=new jh(t,{getKey:v,drawElement:x,getBoundingBox:_,getRotationPoint:O,getRotationOffset:M,isVisible:D}),Y=t.data.lyrTxrCache=new sd(t);t.onUpdateEleCalcs((function(e,t){R.invalidateElements(t),F.invalidateElements(t),z.invalidateElements(t),G.invalidateElements(t),Y.invalidateElements(t);for(var n=0;n<t.length;n++){var r=t[n]._private;r.oldBackgroundTimestamp=r.backgroundTimestamp}}));var X=function(e){for(var t=0;t<e.length;t++)Y.enqueueElementRefinement(e[t].ele)};R.onDequeue(X),F.onDequeue(X),z.onDequeue(X),G.onDequeue(X)}qd.CANVAS_LAYERS=3,qd.SELECT_BOX=0,qd.DRAG=1,qd.NODE=2,qd.BUFFER_COUNT=3,qd.TEXTURE_BUFFER=0,qd.MOTIONBLUR_BUFFER_NODE=1,qd.MOTIONBLUR_BUFFER_DRAG=2,qd.redrawHint=function(e,t){var n=this;switch(e){case"eles":n.data.canvasNeedsRedraw[qd.NODE]=t;break;case"drag":n.data.canvasNeedsRedraw[qd.DRAG]=t;break;case"select":n.data.canvasNeedsRedraw[qd.SELECT_BOX]=t}};var $d="undefined"!=typeof Path2D;qd.path2dEnabled=function(e){if(void 0===e)return this.pathsEnabled;this.pathsEnabled=!!e},qd.usePaths=function(){return $d&&this.pathsEnabled},qd.setImgSmoothing=function(e,t){null!=e.imageSmoothingEnabled?e.imageSmoothingEnabled=t:(e.webkitImageSmoothingEnabled=t,e.mozImageSmoothingEnabled=t,e.msImageSmoothingEnabled=t)},qd.getImgSmoothing=function(e){return null!=e.imageSmoothingEnabled?e.imageSmoothingEnabled:e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled},qd.makeOffscreenCanvas=function(t,n){var r;return"undefined"!==("undefined"==typeof OffscreenCanvas?"undefined":e(OffscreenCanvas))?r=new OffscreenCanvas(t,n):((r=document.createElement("canvas")).width=t,r.height=n),r},[dd,md,Dd,Nd,Ad,Sd,Id,Md,Yd,jd].forEach((function(e){Q(qd,e)}));var Zd=[{type:"layout",extensions:qc},{type:"renderer",extensions:[{name:"null",impl:Wc},{name:"base",impl:xh},{name:"canvas",impl:Hd}]}],Kd={},Qd={};function Jd(e,t,n){var r=n,i=function(n){Nt("Can not register `"+t+"` for `"+e+"` since `"+n+"` already exists in the prototype and can not be overridden")};if("core"===e){if(ac.prototype[t])return i(t);ac.prototype[t]=n}else if("collection"===e){if(bu.prototype[t])return i(t);bu.prototype[t]=n}else if("layout"===e){for(var a=function(e){this.options=e,n.call(this,e),E(this._private)||(this._private={}),this._private.cy=e.cy,this._private.listeners=[],this.createEmitter()},o=a.prototype=Object.create(n.prototype),s=[],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});var c=n.prototype.stop;o.stop=function(){var e=this.options;if(e&&e.animate){var t=this.animations;if(t)for(var n=0;n<t.length;n++)t[n].stop()}return c?c.call(this):this.emit("layoutstop"),this},o.destroy||(o.destroy=function(){return this}),o.cy=function(){return this._private.cy};var h=function(e){return e._private.cy},d={addEventFields:function(e,t){t.layout=e,t.cy=h(e),t.target=e},bubble:function(){return!0},parent:function(e){return h(e)}};Q(o,{createEmitter:function(){return this._private.emitter=new Rl(d,this),this},emitter:function(){return this._private.emitter},on:function(e,t){return this.emitter().on(e,t),this},one:function(e,t){return this.emitter().one(e,t),this},once:function(e,t){return this.emitter().one(e,t),this},removeListener:function(e,t){return this.emitter().removeListener(e,t),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(e,t){return this.emitter().emit(e,t),this}}),hs.eventAliasesOn(o),r=a}else if("renderer"===e&&"null"!==t&&"base"!==t){var p=ep("renderer","base"),g=p.prototype,f=n,v=n.prototype,y=function(){p.apply(this,arguments),f.apply(this,arguments)},m=y.prototype;for(var b in g){var x=g[b];if(null!=v[b])return i(b);m[b]=x}for(var w in v)m[w]=v[w];g.clientFunctions.forEach((function(e){m[e]=m[e]||function(){Dt("Renderer does not implement `renderer."+e+"()` on its prototype")}})),r=y}else if("__proto__"===e||"constructor"===e||"prototype"===e)return Dt(e+" is an illegal type to be registered, possibly lead to prototype pollutions");return ae({map:Kd,keys:[e,t],value:r})}function ep(e,t){return oe({map:Kd,keys:[e,t]})}function tp(e,t,n,r,i){return ae({map:Qd,keys:[e,t,n,r],value:i})}function np(e,t,n,r){return oe({map:Qd,keys:[e,t,n,r]})}var rp=function(){return 2===arguments.length?ep.apply(null,arguments):3===arguments.length?Jd.apply(null,arguments):4===arguments.length?np.apply(null,arguments):5===arguments.length?tp.apply(null,arguments):void Dt("Invalid extension access syntax")};ac.prototype.extension=rp,Zd.forEach((function(e){e.extensions.forEach((function(t){Jd(e.type,t.name,t.impl)}))}));var ip=function e(){if(!(this instanceof e))return new e;this.length=0},ap=ip.prototype;ap.instanceString=function(){return"stylesheet"},ap.selector=function(e){return this[this.length++]={selector:e,properties:[]},this},ap.css=function(e,t){var n=this.length-1;if(b(e))this[n].properties.push({name:e,value:t});else if(E(e))for(var r=e,i=Object.keys(r),a=0;a<i.length;a++){var o=i[a],s=r[o];if(null!=s){var l=Ju.properties[o]||Ju.properties[G(o)];if(null!=l){var u=l.name,c=s;this[n].properties.push({name:u,value:c})}}}return this},ap.style=ap.css,ap.generateStyle=function(e){var t=new Ju(e);return this.appendToStyle(t)},ap.appendToStyle=function(e){for(var t=0;t<this.length;t++){var n=this[t],r=n.selector,i=n.properties;e.selector(r);for(var a=0;a<i.length;a++){var o=i[a];e.css(o.name,o.value)}}return e};var op="3.27.0",sp=function(e){return void 0===e&&(e={}),E(e)?new ac(e):b(e)?rp.apply(rp,arguments):void 0};return sp.use=function(e){var t=Array.prototype.slice.call(arguments,1);return t.unshift(sp),e.apply(null,t),this},sp.warnings=function(e){return Ct(e)},sp.version=op,sp.stylesheet=sp.Stylesheet=ip,sp}()},82241:function(e){var t;t=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=26)}([function(e,t,n){"use strict";function r(){}r.QUALITY=1,r.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,r.DEFAULT_INCREMENTAL=!1,r.DEFAULT_ANIMATION_ON_LAYOUT=!0,r.DEFAULT_ANIMATION_DURING_LAYOUT=!1,r.DEFAULT_ANIMATION_PERIOD=50,r.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,r.DEFAULT_GRAPH_MARGIN=15,r.NODE_DIMENSIONS_INCLUDE_LABELS=!1,r.SIMPLE_NODE_SIZE=40,r.SIMPLE_NODE_HALF_SIZE=r.SIMPLE_NODE_SIZE/2,r.EMPTY_COMPOUND_NODE_SIZE=40,r.MIN_EDGE_LENGTH=1,r.WORLD_BOUNDARY=1e6,r.INITIAL_WORLD_BOUNDARY=r.WORLD_BOUNDARY/1e3,r.WORLD_CENTER_X=1200,r.WORLD_CENTER_Y=900,e.exports=r},function(e,t,n){"use strict";var r=n(2),i=n(8),a=n(9);function o(e,t,n){r.call(this,n),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=n,this.bendpoints=[],this.source=e,this.target=t}for(var s in o.prototype=Object.create(r.prototype),r)o[s]=r[s];o.prototype.getSource=function(){return this.source},o.prototype.getTarget=function(){return this.target},o.prototype.isInterGraph=function(){return this.isInterGraph},o.prototype.getLength=function(){return this.length},o.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},o.prototype.getBendpoints=function(){return this.bendpoints},o.prototype.getLca=function(){return this.lca},o.prototype.getSourceInLca=function(){return this.sourceInLca},o.prototype.getTargetInLca=function(){return this.targetInLca},o.prototype.getOtherEnd=function(e){if(this.source===e)return this.target;if(this.target===e)return this.source;throw"Node is not incident with this edge"},o.prototype.getOtherEndInGraph=function(e,t){for(var n=this.getOtherEnd(e),r=t.getGraphManager().getRoot();;){if(n.getOwner()==t)return n;if(n.getOwner()==r)break;n=n.getOwner().getParent()}return null},o.prototype.updateLength=function(){var e=new Array(4);this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),e),this.isOverlapingSourceAndTarget||(this.lengthX=e[0]-e[2],this.lengthY=e[1]-e[3],Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},o.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},e.exports=o},function(e,t,n){"use strict";e.exports=function(e){this.vGraphObject=e}},function(e,t,n){"use strict";var r=n(2),i=n(10),a=n(13),o=n(0),s=n(16),l=n(4);function u(e,t,n,o){null==n&&null==o&&(o=t),r.call(this,o),null!=e.graphManager&&(e=e.graphManager),this.estimatedSize=i.MIN_VALUE,this.inclusionTreeDepth=i.MAX_VALUE,this.vGraphObject=o,this.edges=[],this.graphManager=e,this.rect=null!=n&&null!=t?new a(t.x,t.y,n.width,n.height):new a}for(var c in u.prototype=Object.create(r.prototype),r)u[c]=r[c];u.prototype.getEdges=function(){return this.edges},u.prototype.getChild=function(){return this.child},u.prototype.getOwner=function(){return this.owner},u.prototype.getWidth=function(){return this.rect.width},u.prototype.setWidth=function(e){this.rect.width=e},u.prototype.getHeight=function(){return this.rect.height},u.prototype.setHeight=function(e){this.rect.height=e},u.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},u.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},u.prototype.getCenter=function(){return new l(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},u.prototype.getLocation=function(){return new l(this.rect.x,this.rect.y)},u.prototype.getRect=function(){return this.rect},u.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},u.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},u.prototype.setRect=function(e,t){this.rect.x=e.x,this.rect.y=e.y,this.rect.width=t.width,this.rect.height=t.height},u.prototype.setCenter=function(e,t){this.rect.x=e-this.rect.width/2,this.rect.y=t-this.rect.height/2},u.prototype.setLocation=function(e,t){this.rect.x=e,this.rect.y=t},u.prototype.moveBy=function(e,t){this.rect.x+=e,this.rect.y+=t},u.prototype.getEdgeListToNode=function(e){var t=[],n=this;return n.edges.forEach((function(r){if(r.target==e){if(r.source!=n)throw"Incorrect edge source!";t.push(r)}})),t},u.prototype.getEdgesBetween=function(e){var t=[],n=this;return n.edges.forEach((function(r){if(r.source!=n&&r.target!=n)throw"Incorrect edge source and/or target";r.target!=e&&r.source!=e||t.push(r)})),t},u.prototype.getNeighborsList=function(){var e=new Set,t=this;return t.edges.forEach((function(n){if(n.source==t)e.add(n.target);else{if(n.target!=t)throw"Incorrect incidency!";e.add(n.source)}})),e},u.prototype.withChildren=function(){var e=new Set;if(e.add(this),null!=this.child)for(var t=this.child.getNodes(),n=0;n<t.length;n++)t[n].withChildren().forEach((function(t){e.add(t)}));return e},u.prototype.getNoOfChildren=function(){var e=0;if(null==this.child)e=1;else for(var t=this.child.getNodes(),n=0;n<t.length;n++)e+=t[n].getNoOfChildren();return 0==e&&(e=1),e},u.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},u.prototype.calcEstimatedSize=function(){return null==this.child?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},u.prototype.scatter=function(){var e,t,n=-o.INITIAL_WORLD_BOUNDARY,r=o.INITIAL_WORLD_BOUNDARY;e=o.WORLD_CENTER_X+s.nextDouble()*(r-n)+n;var i=-o.INITIAL_WORLD_BOUNDARY,a=o.INITIAL_WORLD_BOUNDARY;t=o.WORLD_CENTER_Y+s.nextDouble()*(a-i)+i,this.rect.x=e,this.rect.y=t},u.prototype.updateBounds=function(){if(null==this.getChild())throw"assert failed";if(0!=this.getChild().getNodes().length){var e=this.getChild();if(e.updateBounds(!0),this.rect.x=e.getLeft(),this.rect.y=e.getTop(),this.setWidth(e.getRight()-e.getLeft()),this.setHeight(e.getBottom()-e.getTop()),o.NODE_DIMENSIONS_INCLUDE_LABELS){var t=e.getRight()-e.getLeft(),n=e.getBottom()-e.getTop();this.labelWidth>t&&(this.rect.x-=(this.labelWidth-t)/2,this.setWidth(this.labelWidth)),this.labelHeight>n&&("center"==this.labelPos?this.rect.y-=(this.labelHeight-n)/2:"top"==this.labelPos&&(this.rect.y-=this.labelHeight-n),this.setHeight(this.labelHeight))}}},u.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},u.prototype.transform=function(e){var t=this.rect.x;t>o.WORLD_BOUNDARY?t=o.WORLD_BOUNDARY:t<-o.WORLD_BOUNDARY&&(t=-o.WORLD_BOUNDARY);var n=this.rect.y;n>o.WORLD_BOUNDARY?n=o.WORLD_BOUNDARY:n<-o.WORLD_BOUNDARY&&(n=-o.WORLD_BOUNDARY);var r=new l(t,n),i=e.inverseTransformPoint(r);this.setLocation(i.x,i.y)},u.prototype.getLeft=function(){return this.rect.x},u.prototype.getRight=function(){return this.rect.x+this.rect.width},u.prototype.getTop=function(){return this.rect.y},u.prototype.getBottom=function(){return this.rect.y+this.rect.height},u.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},e.exports=u},function(e,t,n){"use strict";function r(e,t){null==e&&null==t?(this.x=0,this.y=0):(this.x=e,this.y=t)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.setX=function(e){this.x=e},r.prototype.setY=function(e){this.y=e},r.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},r.prototype.getCopy=function(){return new r(this.x,this.y)},r.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},e.exports=r},function(e,t,n){"use strict";var r=n(2),i=n(10),a=n(0),o=n(6),s=n(3),l=n(1),u=n(13),c=n(12),h=n(11);function d(e,t,n){r.call(this,n),this.estimatedSize=i.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=e,null!=t&&t instanceof o?this.graphManager=t:null!=t&&t instanceof Layout&&(this.graphManager=t.graphManager)}for(var p in d.prototype=Object.create(r.prototype),r)d[p]=r[p];d.prototype.getNodes=function(){return this.nodes},d.prototype.getEdges=function(){return this.edges},d.prototype.getGraphManager=function(){return this.graphManager},d.prototype.getParent=function(){return this.parent},d.prototype.getLeft=function(){return this.left},d.prototype.getRight=function(){return this.right},d.prototype.getTop=function(){return this.top},d.prototype.getBottom=function(){return this.bottom},d.prototype.isConnected=function(){return this.isConnected},d.prototype.add=function(e,t,n){if(null==t&&null==n){var r=e;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(r)>-1)throw"Node already in graph!";return r.owner=this,this.getNodes().push(r),r}var i=e;if(!(this.getNodes().indexOf(t)>-1&&this.getNodes().indexOf(n)>-1))throw"Source or target not in graph!";if(t.owner!=n.owner||t.owner!=this)throw"Both owners must be this graph!";return t.owner!=n.owner?null:(i.source=t,i.target=n,i.isInterGraph=!1,this.getEdges().push(i),t.edges.push(i),n!=t&&n.edges.push(i),i)},d.prototype.remove=function(e){var t=e;if(e instanceof s){if(null==t)throw"Node is null!";if(null==t.owner||t.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var n=t.edges.slice(),r=n.length,i=0;i<r;i++)(a=n[i]).isInterGraph?this.graphManager.remove(a):a.source.owner.remove(a);if(-1==(o=this.nodes.indexOf(t)))throw"Node not in owner node list!";this.nodes.splice(o,1)}else if(e instanceof l){var a;if(null==(a=e))throw"Edge is null!";if(null==a.source||null==a.target)throw"Source and/or target is null!";if(null==a.source.owner||null==a.target.owner||a.source.owner!=this||a.target.owner!=this)throw"Source and/or target owner is invalid!";var o,u=a.source.edges.indexOf(a),c=a.target.edges.indexOf(a);if(!(u>-1&&c>-1))throw"Source and/or target doesn't know this edge!";if(a.source.edges.splice(u,1),a.target!=a.source&&a.target.edges.splice(c,1),-1==(o=a.source.owner.getEdges().indexOf(a)))throw"Not in owner's edge list!";a.source.owner.getEdges().splice(o,1)}},d.prototype.updateLeftTop=function(){for(var e,t,n,r=i.MAX_VALUE,a=i.MAX_VALUE,o=this.getNodes(),s=o.length,l=0;l<s;l++){var u=o[l];r>(e=u.getTop())&&(r=e),a>(t=u.getLeft())&&(a=t)}return r==i.MAX_VALUE?null:(n=null!=o[0].getParent().paddingLeft?o[0].getParent().paddingLeft:this.margin,this.left=a-n,this.top=r-n,new c(this.left,this.top))},d.prototype.updateBounds=function(e){for(var t,n,r,a,o,s=i.MAX_VALUE,l=-i.MAX_VALUE,c=i.MAX_VALUE,h=-i.MAX_VALUE,d=this.nodes,p=d.length,g=0;g<p;g++){var f=d[g];e&&null!=f.child&&f.updateBounds(),s>(t=f.getLeft())&&(s=t),l<(n=f.getRight())&&(l=n),c>(r=f.getTop())&&(c=r),h<(a=f.getBottom())&&(h=a)}var v=new u(s,c,l-s,h-c);s==i.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),o=null!=d[0].getParent().paddingLeft?d[0].getParent().paddingLeft:this.margin,this.left=v.x-o,this.right=v.x+v.width+o,this.top=v.y-o,this.bottom=v.y+v.height+o},d.calculateBounds=function(e){for(var t,n,r,a,o=i.MAX_VALUE,s=-i.MAX_VALUE,l=i.MAX_VALUE,c=-i.MAX_VALUE,h=e.length,d=0;d<h;d++){var p=e[d];o>(t=p.getLeft())&&(o=t),s<(n=p.getRight())&&(s=n),l>(r=p.getTop())&&(l=r),c<(a=p.getBottom())&&(c=a)}return new u(o,l,s-o,c-l)},d.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},d.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},d.prototype.calcEstimatedSize=function(){for(var e=0,t=this.nodes,n=t.length,r=0;r<n;r++)e+=t[r].calcEstimatedSize();return this.estimatedSize=0==e?a.EMPTY_COMPOUND_NODE_SIZE:e/Math.sqrt(this.nodes.length),this.estimatedSize},d.prototype.updateConnected=function(){var e=this;if(0!=this.nodes.length){var t,n,r=new h,i=new Set,a=this.nodes[0];for(a.withChildren().forEach((function(e){r.push(e),i.add(e)}));0!==r.length;)for(var o=(t=(a=r.shift()).getEdges()).length,s=0;s<o;s++)null==(n=t[s].getOtherEndInGraph(a,this))||i.has(n)||n.withChildren().forEach((function(e){r.push(e),i.add(e)}));if(this.isConnected=!1,i.size>=this.nodes.length){var l=0;i.forEach((function(t){t.owner==e&&l++})),l==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},e.exports=d},function(e,t,n){"use strict";var r,i=n(1);function a(e){r=n(5),this.layout=e,this.graphs=[],this.edges=[]}a.prototype.addRoot=function(){var e=this.layout.newGraph(),t=this.layout.newNode(null),n=this.add(e,t);return this.setRootGraph(n),this.rootGraph},a.prototype.add=function(e,t,n,r,i){if(null==n&&null==r&&null==i){if(null==e)throw"Graph is null!";if(null==t)throw"Parent node is null!";if(this.graphs.indexOf(e)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(e),null!=e.parent)throw"Already has a parent!";if(null!=t.child)throw"Already has a child!";return e.parent=t,t.child=e,e}i=n,n=e;var a=(r=t).getOwner(),o=i.getOwner();if(null==a||a.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==o||o.getGraphManager()!=this)throw"Target not in this graph mgr!";if(a==o)return n.isInterGraph=!1,a.add(n,r,i);if(n.isInterGraph=!0,n.source=r,n.target=i,this.edges.indexOf(n)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(n),null==n.source||null==n.target)throw"Edge source and/or target is null!";if(-1!=n.source.edges.indexOf(n)||-1!=n.target.edges.indexOf(n))throw"Edge already in source and/or target incidency list!";return n.source.edges.push(n),n.target.edges.push(n),n},a.prototype.remove=function(e){if(e instanceof r){var t=e;if(t.getGraphManager()!=this)throw"Graph not in this graph mgr";if(t!=this.rootGraph&&(null==t.parent||t.parent.graphManager!=this))throw"Invalid parent node!";for(var n,a=[],o=(a=a.concat(t.getEdges())).length,s=0;s<o;s++)n=a[s],t.remove(n);var l,u=[];for(o=(u=u.concat(t.getNodes())).length,s=0;s<o;s++)l=u[s],t.remove(l);t==this.rootGraph&&this.setRootGraph(null);var c=this.graphs.indexOf(t);this.graphs.splice(c,1),t.parent=null}else if(e instanceof i){if(null==(n=e))throw"Edge is null!";if(!n.isInterGraph)throw"Not an inter-graph edge!";if(null==n.source||null==n.target)throw"Source and/or target is null!";if(-1==n.source.edges.indexOf(n)||-1==n.target.edges.indexOf(n))throw"Source and/or target doesn't know this edge!";if(c=n.source.edges.indexOf(n),n.source.edges.splice(c,1),c=n.target.edges.indexOf(n),n.target.edges.splice(c,1),null==n.source.owner||null==n.source.owner.getGraphManager())throw"Edge owner graph or owner graph manager is null!";if(-1==n.source.owner.getGraphManager().edges.indexOf(n))throw"Not in owner graph manager's edge list!";c=n.source.owner.getGraphManager().edges.indexOf(n),n.source.owner.getGraphManager().edges.splice(c,1)}},a.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},a.prototype.getGraphs=function(){return this.graphs},a.prototype.getAllNodes=function(){if(null==this.allNodes){for(var e=[],t=this.getGraphs(),n=t.length,r=0;r<n;r++)e=e.concat(t[r].getNodes());this.allNodes=e}return this.allNodes},a.prototype.resetAllNodes=function(){this.allNodes=null},a.prototype.resetAllEdges=function(){this.allEdges=null},a.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},a.prototype.getAllEdges=function(){if(null==this.allEdges){for(var e=[],t=this.getGraphs(),n=(t.length,0);n<t.length;n++)e=e.concat(t[n].getEdges());e=e.concat(this.edges),this.allEdges=e}return this.allEdges},a.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},a.prototype.setAllNodesToApplyGravitation=function(e){if(null!=this.allNodesToApplyGravitation)throw"assert failed";this.allNodesToApplyGravitation=e},a.prototype.getRoot=function(){return this.rootGraph},a.prototype.setRootGraph=function(e){if(e.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=e,null==e.parent&&(e.parent=this.layout.newNode("Root node"))},a.prototype.getLayout=function(){return this.layout},a.prototype.isOneAncestorOfOther=function(e,t){if(null==e||null==t)throw"assert failed";if(e==t)return!0;for(var n,r=e.getOwner();null!=(n=r.getParent());){if(n==t)return!0;if(null==(r=n.getOwner()))break}for(r=t.getOwner();null!=(n=r.getParent());){if(n==e)return!0;if(null==(r=n.getOwner()))break}return!1},a.prototype.calcLowestCommonAncestors=function(){for(var e,t,n,r,i,a=this.getAllEdges(),o=a.length,s=0;s<o;s++)if(t=(e=a[s]).source,n=e.target,e.lca=null,e.sourceInLca=t,e.targetInLca=n,t!=n){for(r=t.getOwner();null==e.lca;){for(e.targetInLca=n,i=n.getOwner();null==e.lca;){if(i==r){e.lca=i;break}if(i==this.rootGraph)break;if(null!=e.lca)throw"assert failed";e.targetInLca=i.getParent(),i=e.targetInLca.getOwner()}if(r==this.rootGraph)break;null==e.lca&&(e.sourceInLca=r.getParent(),r=e.sourceInLca.getOwner())}if(null==e.lca)throw"assert failed"}else e.lca=t.getOwner()},a.prototype.calcLowestCommonAncestor=function(e,t){if(e==t)return e.getOwner();for(var n=e.getOwner();null!=n;){for(var r=t.getOwner();null!=r;){if(r==n)return r;r=r.getParent().getOwner()}n=n.getParent().getOwner()}return n},a.prototype.calcInclusionTreeDepths=function(e,t){var n;null==e&&null==t&&(e=this.rootGraph,t=1);for(var r=e.getNodes(),i=r.length,a=0;a<i;a++)(n=r[a]).inclusionTreeDepth=t,null!=n.child&&this.calcInclusionTreeDepths(n.child,t+1)},a.prototype.includesInvalidEdge=function(){for(var e,t=this.edges.length,n=0;n<t;n++)if(e=this.edges[n],this.isOneAncestorOfOther(e.source,e.target))return!0;return!1},e.exports=a},function(e,t,n){"use strict";var r=n(0);function i(){}for(var a in r)i[a]=r[a];i.MAX_ITERATIONS=2500,i.DEFAULT_EDGE_LENGTH=50,i.DEFAULT_SPRING_STRENGTH=.45,i.DEFAULT_REPULSION_STRENGTH=4500,i.DEFAULT_GRAVITY_STRENGTH=.4,i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,i.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,i.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,i.COOLING_ADAPTATION_FACTOR=.33,i.ADAPTATION_LOWER_NODE_LIMIT=1e3,i.ADAPTATION_UPPER_NODE_LIMIT=5e3,i.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,i.MAX_NODE_DISPLACEMENT=3*i.MAX_NODE_DISPLACEMENT_INCREMENTAL,i.MIN_REPULSION_DIST=i.DEFAULT_EDGE_LENGTH/10,i.CONVERGENCE_CHECK_PERIOD=100,i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,i.MIN_EDGE_LENGTH=1,i.GRID_CALCULATION_CHECK_PERIOD=10,e.exports=i},function(e,t,n){"use strict";var r=n(12);function i(){}i.calcSeparationAmount=function(e,t,n,r){if(!e.intersects(t))throw"assert failed";var i=new Array(2);this.decideDirectionsForOverlappingNodes(e,t,i),n[0]=Math.min(e.getRight(),t.getRight())-Math.max(e.x,t.x),n[1]=Math.min(e.getBottom(),t.getBottom())-Math.max(e.y,t.y),e.getX()<=t.getX()&&e.getRight()>=t.getRight()?n[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight()):t.getX()<=e.getX()&&t.getRight()>=e.getRight()&&(n[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight())),e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()?n[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()):t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()&&(n[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()));var a=Math.abs((t.getCenterY()-e.getCenterY())/(t.getCenterX()-e.getCenterX()));t.getCenterY()===e.getCenterY()&&t.getCenterX()===e.getCenterX()&&(a=1);var o=a*n[0],s=n[1]/a;n[0]<s?s=n[0]:o=n[1],n[0]=-1*i[0]*(s/2+r),n[1]=-1*i[1]*(o/2+r)},i.decideDirectionsForOverlappingNodes=function(e,t,n){e.getCenterX()<t.getCenterX()?n[0]=-1:n[0]=1,e.getCenterY()<t.getCenterY()?n[1]=-1:n[1]=1},i.getIntersection2=function(e,t,n){var r=e.getCenterX(),i=e.getCenterY(),a=t.getCenterX(),o=t.getCenterY();if(e.intersects(t))return n[0]=r,n[1]=i,n[2]=a,n[3]=o,!0;var s=e.getX(),l=e.getY(),u=e.getRight(),c=e.getX(),h=e.getBottom(),d=e.getRight(),p=e.getWidthHalf(),g=e.getHeightHalf(),f=t.getX(),v=t.getY(),y=t.getRight(),m=t.getX(),b=t.getBottom(),x=t.getRight(),w=t.getWidthHalf(),E=t.getHeightHalf(),T=!1,_=!1;if(r===a){if(i>o)return n[0]=r,n[1]=l,n[2]=a,n[3]=b,!1;if(i<o)return n[0]=r,n[1]=h,n[2]=a,n[3]=v,!1}else if(i===o){if(r>a)return n[0]=s,n[1]=i,n[2]=y,n[3]=o,!1;if(r<a)return n[0]=u,n[1]=i,n[2]=f,n[3]=o,!1}else{var D=e.height/e.width,C=t.height/t.width,N=(o-i)/(a-r),A=void 0,L=void 0,S=void 0,O=void 0,I=void 0,k=void 0;if(-D===N?r>a?(n[0]=c,n[1]=h,T=!0):(n[0]=u,n[1]=l,T=!0):D===N&&(r>a?(n[0]=s,n[1]=l,T=!0):(n[0]=d,n[1]=h,T=!0)),-C===N?a>r?(n[2]=m,n[3]=b,_=!0):(n[2]=y,n[3]=v,_=!0):C===N&&(a>r?(n[2]=f,n[3]=v,_=!0):(n[2]=x,n[3]=b,_=!0)),T&&_)return!1;if(r>a?i>o?(A=this.getCardinalDirection(D,N,4),L=this.getCardinalDirection(C,N,2)):(A=this.getCardinalDirection(-D,N,3),L=this.getCardinalDirection(-C,N,1)):i>o?(A=this.getCardinalDirection(-D,N,1),L=this.getCardinalDirection(-C,N,3)):(A=this.getCardinalDirection(D,N,2),L=this.getCardinalDirection(C,N,4)),!T)switch(A){case 1:O=l,S=r+-g/N,n[0]=S,n[1]=O;break;case 2:S=d,O=i+p*N,n[0]=S,n[1]=O;break;case 3:O=h,S=r+g/N,n[0]=S,n[1]=O;break;case 4:S=c,O=i+-p*N,n[0]=S,n[1]=O}if(!_)switch(L){case 1:k=v,I=a+-E/N,n[2]=I,n[3]=k;break;case 2:I=x,k=o+w*N,n[2]=I,n[3]=k;break;case 3:k=b,I=a+E/N,n[2]=I,n[3]=k;break;case 4:I=m,k=o+-w*N,n[2]=I,n[3]=k}}return!1},i.getCardinalDirection=function(e,t,n){return e>t?n:1+n%4},i.getIntersection=function(e,t,n,i){if(null==i)return this.getIntersection2(e,t,n);var a,o,s,l,u,c,h,d=e.x,p=e.y,g=t.x,f=t.y,v=n.x,y=n.y,m=i.x,b=i.y;return 0==(h=(a=f-p)*(l=v-m)-(o=b-y)*(s=d-g))?null:new r((s*(c=m*y-v*b)-l*(u=g*p-d*f))/h,(o*u-a*c)/h)},i.angleOfVector=function(e,t,n,r){var i=void 0;return e!==n?(i=Math.atan((r-t)/(n-e)),n<e?i+=Math.PI:r<t&&(i+=this.TWO_PI)):i=r<t?this.ONE_AND_HALF_PI:this.HALF_PI,i},i.doIntersect=function(e,t,n,r){var i=e.x,a=e.y,o=t.x,s=t.y,l=n.x,u=n.y,c=r.x,h=r.y,d=(o-i)*(h-u)-(c-l)*(s-a);if(0===d)return!1;var p=((h-u)*(c-i)+(l-c)*(h-a))/d,g=((a-s)*(c-i)+(o-i)*(h-a))/d;return 0<p&&p<1&&0<g&&g<1},i.HALF_PI=.5*Math.PI,i.ONE_AND_HALF_PI=1.5*Math.PI,i.TWO_PI=2*Math.PI,i.THREE_PI=3*Math.PI,e.exports=i},function(e,t,n){"use strict";function r(){}r.sign=function(e){return e>0?1:e<0?-1:0},r.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},r.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},e.exports=r},function(e,t,n){"use strict";function r(){}r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,e.exports=r},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(e){return{value:e,next:null,prev:null}},a=function(e,t,n,r){return null!==e?e.next=t:r.head=t,null!==n?n.prev=t:r.tail=t,t.prev=e,t.next=n,r.length++,t},o=function(e,t){var n=e.prev,r=e.next;return null!==n?n.next=r:t.head=r,null!==r?r.prev=n:t.tail=n,e.prev=e.next=null,t.length--,e},s=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.length=0,this.head=null,this.tail=null,null!=t&&t.forEach((function(e){return n.push(e)}))}return r(e,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(e,t){return a(t.prev,i(e),t,this)}},{key:"insertAfter",value:function(e,t){return a(t,i(e),t.next,this)}},{key:"insertNodeBefore",value:function(e,t){return a(t.prev,e,t,this)}},{key:"insertNodeAfter",value:function(e,t){return a(t,e,t.next,this)}},{key:"push",value:function(e){return a(this.tail,i(e),null,this)}},{key:"unshift",value:function(e){return a(null,i(e),this.head,this)}},{key:"remove",value:function(e){return o(e,this)}},{key:"pop",value:function(){return o(this.tail,this).value}},{key:"popNode",value:function(){return o(this.tail,this)}},{key:"shift",value:function(){return o(this.head,this).value}},{key:"shiftNode",value:function(){return o(this.head,this)}},{key:"get_object_at",value:function(e){if(e<=this.length()){for(var t=1,n=this.head;t<e;)n=n.next,t++;return n.value}}},{key:"set_object_at",value:function(e,t){if(e<=this.length()){for(var n=1,r=this.head;n<e;)r=r.next,n++;r.value=t}}}]),e}();e.exports=s},function(e,t,n){"use strict";function r(e,t,n){this.x=null,this.y=null,null==e&&null==t&&null==n?(this.x=0,this.y=0):"number"==typeof e&&"number"==typeof t&&null==n?(this.x=e,this.y=t):"Point"==e.constructor.name&&null==t&&null==n&&(n=e,this.x=n.x,this.y=n.y)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.getLocation=function(){return new r(this.x,this.y)},r.prototype.setLocation=function(e,t,n){"Point"==e.constructor.name&&null==t&&null==n?(n=e,this.setLocation(n.x,n.y)):"number"==typeof e&&"number"==typeof t&&null==n&&(parseInt(e)==e&&parseInt(t)==t?this.move(e,t):(this.x=Math.floor(e+.5),this.y=Math.floor(t+.5)))},r.prototype.move=function(e,t){this.x=e,this.y=t},r.prototype.translate=function(e,t){this.x+=e,this.y+=t},r.prototype.equals=function(e){if("Point"==e.constructor.name){var t=e;return this.x==t.x&&this.y==t.y}return this==e},r.prototype.toString=function(){return(new r).constructor.name+"[x="+this.x+",y="+this.y+"]"},e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){this.x=0,this.y=0,this.width=0,this.height=0,null!=e&&null!=t&&null!=n&&null!=r&&(this.x=e,this.y=t,this.width=n,this.height=r)}r.prototype.getX=function(){return this.x},r.prototype.setX=function(e){this.x=e},r.prototype.getY=function(){return this.y},r.prototype.setY=function(e){this.y=e},r.prototype.getWidth=function(){return this.width},r.prototype.setWidth=function(e){this.width=e},r.prototype.getHeight=function(){return this.height},r.prototype.setHeight=function(e){this.height=e},r.prototype.getRight=function(){return this.x+this.width},r.prototype.getBottom=function(){return this.y+this.height},r.prototype.intersects=function(e){return!(this.getRight()<e.x||this.getBottom()<e.y||e.getRight()<this.x||e.getBottom()<this.y)},r.prototype.getCenterX=function(){return this.x+this.width/2},r.prototype.getMinX=function(){return this.getX()},r.prototype.getMaxX=function(){return this.getX()+this.width},r.prototype.getCenterY=function(){return this.y+this.height/2},r.prototype.getMinY=function(){return this.getY()},r.prototype.getMaxY=function(){return this.getY()+this.height},r.prototype.getWidthHalf=function(){return this.width/2},r.prototype.getHeightHalf=function(){return this.height/2},e.exports=r},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function i(){}i.lastID=0,i.createID=function(e){return i.isPrimitive(e)?e:(null!=e.uniqueID||(e.uniqueID=i.getString(),i.lastID++),e.uniqueID)},i.getString=function(e){return null==e&&(e=i.lastID),"Object#"+e},i.isPrimitive=function(e){var t=void 0===e?"undefined":r(e);return null==e||"object"!=t&&"function"!=t},e.exports=i},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var i=n(0),a=n(6),o=n(3),s=n(1),l=n(5),u=n(4),c=n(17),h=n(27);function d(e){h.call(this),this.layoutQuality=i.QUALITY,this.createBendsAsNeeded=i.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=i.DEFAULT_INCREMENTAL,this.animationOnLayout=i.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=i.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=i.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=i.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new a(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,null!=e&&(this.isRemoteUse=e)}d.RANDOM_SEED=1,d.prototype=Object.create(h.prototype),d.prototype.getGraphManager=function(){return this.graphManager},d.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},d.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},d.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},d.prototype.newGraphManager=function(){var e=new a(this);return this.graphManager=e,e},d.prototype.newGraph=function(e){return new l(null,this.graphManager,e)},d.prototype.newNode=function(e){return new o(this.graphManager,e)},d.prototype.newEdge=function(e){return new s(null,null,e)},d.prototype.checkLayoutSuccess=function(){return null==this.graphManager.getRoot()||0==this.graphManager.getRoot().getNodes().length||this.graphManager.includesInvalidEdge()},d.prototype.runLayout=function(){var e;return this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters(),e=!this.checkLayoutSuccess()&&this.layout(),"during"!==i.ANIMATE&&(e&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,e)},d.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},d.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var e=this.graphManager.getAllEdges(),t=0;t<e.length;t++)e[t];var n=this.graphManager.getRoot().getNodes();for(t=0;t<n.length;t++)n[t];this.update(this.graphManager.getRoot())}},d.prototype.update=function(e){if(null==e)this.update2();else if(e instanceof o){var t=e;if(null!=t.getChild())for(var n=t.getChild().getNodes(),r=0;r<n.length;r++)update(n[r]);null!=t.vGraphObject&&t.vGraphObject.update(t)}else if(e instanceof s){var i=e;null!=i.vGraphObject&&i.vGraphObject.update(i)}else if(e instanceof l){var a=e;null!=a.vGraphObject&&a.vGraphObject.update(a)}},d.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=i.QUALITY,this.animationDuringLayout=i.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=i.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=i.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=i.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=i.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=i.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},d.prototype.transform=function(e){if(null==e)this.transform(new u(0,0));else{var t=new c,n=this.graphManager.getRoot().updateLeftTop();if(null!=n){t.setWorldOrgX(e.x),t.setWorldOrgY(e.y),t.setDeviceOrgX(n.x),t.setDeviceOrgY(n.y);for(var r=this.getAllNodes(),i=0;i<r.length;i++)r[i].transform(t)}}},d.prototype.positionNodesRandomly=function(e){if(null==e)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var t,n,r=e.getNodes(),i=0;i<r.length;i++)null==(n=(t=r[i]).getChild())||0==n.getNodes().length?t.scatter():(this.positionNodesRandomly(n),t.updateBounds())},d.prototype.getFlatForest=function(){for(var e=[],t=!0,n=this.graphManager.getRoot().getNodes(),i=!0,a=0;a<n.length;a++)null!=n[a].getChild()&&(i=!1);if(!i)return e;var o=new Set,s=[],l=new Map,u=[];for(u=u.concat(n);u.length>0&&t;){for(s.push(u[0]);s.length>0&&t;){var c=s[0];s.splice(0,1),o.add(c);var h=c.getEdges();for(a=0;a<h.length;a++){var d=h[a].getOtherEnd(c);if(l.get(c)!=d){if(o.has(d)){t=!1;break}s.push(d),l.set(d,c)}}}if(t){var p=[].concat(r(o));for(e.push(p),a=0;a<p.length;a++){var g=p[a],f=u.indexOf(g);f>-1&&u.splice(f,1)}o=new Set,l=new Map}else e=[]}return e},d.prototype.createDummyNodesForBendpoints=function(e){for(var t=[],n=e.source,r=this.graphManager.calcLowestCommonAncestor(e.source,e.target),i=0;i<e.bendpoints.length;i++){var a=this.newNode(null);a.setRect(new Point(0,0),new Dimension(1,1)),r.add(a);var o=this.newEdge(null);this.graphManager.add(o,n,a),t.add(a),n=a}return o=this.newEdge(null),this.graphManager.add(o,n,e.target),this.edgeToDummyNodes.set(e,t),e.isInterGraph()?this.graphManager.remove(e):r.remove(e),t},d.prototype.createBendpointsFromDummyNodes=function(){var e=[];e=e.concat(this.graphManager.getAllEdges()),e=[].concat(r(this.edgeToDummyNodes.keys())).concat(e);for(var t=0;t<e.length;t++){var n=e[t];if(n.bendpoints.length>0){for(var i=this.edgeToDummyNodes.get(n),a=0;a<i.length;a++){var o=i[a],s=new u(o.getCenterX(),o.getCenterY()),l=n.bendpoints.get(a);l.x=s.x,l.y=s.y,o.getOwner().remove(o)}this.graphManager.add(n,n.source,n.target)}}},d.transform=function(e,t,n,r){if(null!=n&&null!=r){var i=t;return e<=50?i-=(t-t/n)/50*(50-e):i+=(t*r-t)/50*(e-50),i}var a,o;return e<=50?(a=9*t/500,o=t/10):(a=9*t/50,o=-8*t),a*e+o},d.findCenterOfTree=function(e){var t=[];t=t.concat(e);var n=[],r=new Map,i=!1,a=null;1!=t.length&&2!=t.length||(i=!0,a=t[0]);for(var o=0;o<t.length;o++){var s=(c=t[o]).getNeighborsList().size;r.set(c,c.getNeighborsList().size),1==s&&n.push(c)}var l=[];for(l=l.concat(n);!i;){var u=[];for(u=u.concat(l),l=[],o=0;o<t.length;o++){var c=t[o],h=t.indexOf(c);h>=0&&t.splice(h,1),c.getNeighborsList().forEach((function(e){if(n.indexOf(e)<0){var t=r.get(e)-1;1==t&&l.push(e),r.set(e,t)}}))}n=n.concat(l),1!=t.length&&2!=t.length||(i=!0,a=t[0])}return a},d.prototype.setGraphManager=function(e){this.graphManager=e},e.exports=d},function(e,t,n){"use strict";function r(){}r.seed=1,r.x=0,r.nextDouble=function(){return r.x=1e4*Math.sin(r.seed++),r.x-Math.floor(r.x)},e.exports=r},function(e,t,n){"use strict";var r=n(4);function i(e,t){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(e){this.lworldOrgX=e},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(e){this.lworldOrgY=e},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(e){this.lworldExtX=e},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(e){this.lworldExtY=e},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(e){this.ldeviceOrgX=e},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(e){this.ldeviceOrgY=e},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(e){this.ldeviceExtX=e},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(e){this.ldeviceExtY=e},i.prototype.transformX=function(e){var t=0,n=this.lworldExtX;return 0!=n&&(t=this.ldeviceOrgX+(e-this.lworldOrgX)*this.ldeviceExtX/n),t},i.prototype.transformY=function(e){var t=0,n=this.lworldExtY;return 0!=n&&(t=this.ldeviceOrgY+(e-this.lworldOrgY)*this.ldeviceExtY/n),t},i.prototype.inverseTransformX=function(e){var t=0,n=this.ldeviceExtX;return 0!=n&&(t=this.lworldOrgX+(e-this.ldeviceOrgX)*this.lworldExtX/n),t},i.prototype.inverseTransformY=function(e){var t=0,n=this.ldeviceExtY;return 0!=n&&(t=this.lworldOrgY+(e-this.ldeviceOrgY)*this.lworldExtY/n),t},i.prototype.inverseTransformPoint=function(e){return new r(this.inverseTransformX(e.x),this.inverseTransformY(e.y))},e.exports=i},function(e,t,n){"use strict";var r=n(15),i=n(7),a=n(0),o=n(8),s=n(9);function l(){r.call(this),this.useSmartIdealEdgeLengthCalculation=i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=i.DEFAULT_EDGE_LENGTH,this.springConstant=i.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=i.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=i.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=i.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=i.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=i.MAX_ITERATIONS}for(var u in l.prototype=Object.create(r.prototype),r)l[u]=r[u];l.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},l.prototype.calcIdealEdgeLengths=function(){for(var e,t,n,r,o,s,l=this.getGraphManager().getAllEdges(),u=0;u<l.length;u++)(e=l[u]).idealLength=this.idealEdgeLength,e.isInterGraph&&(n=e.getSource(),r=e.getTarget(),o=e.getSourceInLca().getEstimatedSize(),s=e.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(e.idealLength+=o+s-2*a.SIMPLE_NODE_SIZE),t=e.getLca().getInclusionTreeDepth(),e.idealLength+=i.DEFAULT_EDGE_LENGTH*i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(n.getInclusionTreeDepth()+r.getInclusionTreeDepth()-2*t))},l.prototype.initSpringEmbedder=function(){var e=this.getAllNodes().length;this.incremental?(e>i.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(e-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(e>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(e-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},l.prototype.calcSpringForces=function(){for(var e,t=this.getAllEdges(),n=0;n<t.length;n++)e=t[n],this.calcSpringForce(e,e.idealLength)},l.prototype.calcRepulsionForces=function(){var e,t,n,r,a,o=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],s=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&o&&this.updateGrid(),a=new Set,e=0;e<l.length;e++)n=l[e],this.calculateRepulsionForceOfANode(n,a,o,s),a.add(n);else for(e=0;e<l.length;e++)for(n=l[e],t=e+1;t<l.length;t++)r=l[t],n.getOwner()==r.getOwner()&&this.calcRepulsionForce(n,r)},l.prototype.calcGravitationalForces=function(){for(var e,t=this.getAllNodesToApplyGravitation(),n=0;n<t.length;n++)e=t[n],this.calcGravitationalForce(e)},l.prototype.moveNodes=function(){for(var e=this.getAllNodes(),t=0;t<e.length;t++)e[t].move()},l.prototype.calcSpringForce=function(e,t){var n,r,i,a,o=e.getSource(),s=e.getTarget();if(this.uniformLeafNodeSizes&&null==o.getChild()&&null==s.getChild())e.updateLengthSimple();else if(e.updateLength(),e.isOverlapingSourceAndTarget)return;0!=(n=e.getLength())&&(i=(r=this.springConstant*(n-t))*(e.lengthX/n),a=r*(e.lengthY/n),o.springForceX+=i,o.springForceY+=a,s.springForceX-=i,s.springForceY-=a)},l.prototype.calcRepulsionForce=function(e,t){var n,r,a,l,u,c,h,d=e.getRect(),p=t.getRect(),g=new Array(2),f=new Array(4);if(d.intersects(p)){o.calcSeparationAmount(d,p,g,i.DEFAULT_EDGE_LENGTH/2),c=2*g[0],h=2*g[1];var v=e.noOfChildren*t.noOfChildren/(e.noOfChildren+t.noOfChildren);e.repulsionForceX-=v*c,e.repulsionForceY-=v*h,t.repulsionForceX+=v*c,t.repulsionForceY+=v*h}else this.uniformLeafNodeSizes&&null==e.getChild()&&null==t.getChild()?(n=p.getCenterX()-d.getCenterX(),r=p.getCenterY()-d.getCenterY()):(o.getIntersection(d,p,f),n=f[2]-f[0],r=f[3]-f[1]),Math.abs(n)<i.MIN_REPULSION_DIST&&(n=s.sign(n)*i.MIN_REPULSION_DIST),Math.abs(r)<i.MIN_REPULSION_DIST&&(r=s.sign(r)*i.MIN_REPULSION_DIST),a=n*n+r*r,l=Math.sqrt(a),c=(u=this.repulsionConstant*e.noOfChildren*t.noOfChildren/a)*n/l,h=u*r/l,e.repulsionForceX-=c,e.repulsionForceY-=h,t.repulsionForceX+=c,t.repulsionForceY+=h},l.prototype.calcGravitationalForce=function(e){var t,n,r,i,a,o,s,l;n=((t=e.getOwner()).getRight()+t.getLeft())/2,r=(t.getTop()+t.getBottom())/2,i=e.getCenterX()-n,a=e.getCenterY()-r,o=Math.abs(i)+e.getWidth()/2,s=Math.abs(a)+e.getHeight()/2,e.getOwner()==this.graphManager.getRoot()?(o>(l=t.getEstimatedSize()*this.gravityRangeFactor)||s>l)&&(e.gravitationForceX=-this.gravityConstant*i,e.gravitationForceY=-this.gravityConstant*a):(o>(l=t.getEstimatedSize()*this.compoundGravityRangeFactor)||s>l)&&(e.gravitationForceX=-this.gravityConstant*i*this.compoundGravityConstant,e.gravitationForceY=-this.gravityConstant*a*this.compoundGravityConstant)},l.prototype.isConverged=function(){var e,t=!1;return this.totalIterations>this.maxIterations/3&&(t=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),e=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,e||t},l.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},l.prototype.calcNoOfChildrenForAllNodes=function(){for(var e,t=this.graphManager.getAllNodes(),n=0;n<t.length;n++)(e=t[n]).noOfChildren=e.getNoOfChildren()},l.prototype.calcGrid=function(e){var t,n;t=parseInt(Math.ceil((e.getRight()-e.getLeft())/this.repulsionRange)),n=parseInt(Math.ceil((e.getBottom()-e.getTop())/this.repulsionRange));for(var r=new Array(t),i=0;i<t;i++)r[i]=new Array(n);for(i=0;i<t;i++)for(var a=0;a<n;a++)r[i][a]=new Array;return r},l.prototype.addNodeToGrid=function(e,t,n){var r,i,a,o;r=parseInt(Math.floor((e.getRect().x-t)/this.repulsionRange)),i=parseInt(Math.floor((e.getRect().width+e.getRect().x-t)/this.repulsionRange)),a=parseInt(Math.floor((e.getRect().y-n)/this.repulsionRange)),o=parseInt(Math.floor((e.getRect().height+e.getRect().y-n)/this.repulsionRange));for(var s=r;s<=i;s++)for(var l=a;l<=o;l++)this.grid[s][l].push(e),e.setGridCoordinates(r,i,a,o)},l.prototype.updateGrid=function(){var e,t,n=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),e=0;e<n.length;e++)t=n[e],this.addNodeToGrid(t,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},l.prototype.calculateRepulsionForceOfANode=function(e,t,n,r){if(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&n||r){var a,o=new Set;e.surrounding=new Array;for(var s=this.grid,l=e.startX-1;l<e.finishX+2;l++)for(var u=e.startY-1;u<e.finishY+2;u++)if(!(l<0||u<0||l>=s.length||u>=s[0].length))for(var c=0;c<s[l][u].length;c++)if(a=s[l][u][c],e.getOwner()==a.getOwner()&&e!=a&&!t.has(a)&&!o.has(a)){var h=Math.abs(e.getCenterX()-a.getCenterX())-(e.getWidth()/2+a.getWidth()/2),d=Math.abs(e.getCenterY()-a.getCenterY())-(e.getHeight()/2+a.getHeight()/2);h<=this.repulsionRange&&d<=this.repulsionRange&&o.add(a)}e.surrounding=[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(o))}for(l=0;l<e.surrounding.length;l++)this.calcRepulsionForce(e,e.surrounding[l])},l.prototype.calcRepulsionRange=function(){return 0},e.exports=l},function(e,t,n){"use strict";var r=n(1),i=n(7);function a(e,t,n){r.call(this,e,t,n),this.idealLength=i.DEFAULT_EDGE_LENGTH}for(var o in a.prototype=Object.create(r.prototype),r)a[o]=r[o];e.exports=a},function(e,t,n){"use strict";var r=n(3);function i(e,t,n,i){r.call(this,e,t,n,i),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];i.prototype.setGridCoordinates=function(e,t,n,r){this.startX=e,this.finishX=t,this.startY=n,this.finishY=r},e.exports=i},function(e,t,n){"use strict";function r(e,t){this.width=0,this.height=0,null!==e&&null!==t&&(this.height=t,this.width=e)}r.prototype.getWidth=function(){return this.width},r.prototype.setWidth=function(e){this.width=e},r.prototype.getHeight=function(){return this.height},r.prototype.setHeight=function(e){this.height=e},e.exports=r},function(e,t,n){"use strict";var r=n(14);function i(){this.map={},this.keys=[]}i.prototype.put=function(e,t){var n=r.createID(e);this.contains(n)||(this.map[n]=t,this.keys.push(e))},i.prototype.contains=function(e){return r.createID(e),null!=this.map[e]},i.prototype.get=function(e){var t=r.createID(e);return this.map[t]},i.prototype.keySet=function(){return this.keys},e.exports=i},function(e,t,n){"use strict";var r=n(14);function i(){this.set={}}i.prototype.add=function(e){var t=r.createID(e);this.contains(t)||(this.set[t]=e)},i.prototype.remove=function(e){delete this.set[r.createID(e)]},i.prototype.clear=function(){this.set={}},i.prototype.contains=function(e){return this.set[r.createID(e)]==e},i.prototype.isEmpty=function(){return 0===this.size()},i.prototype.size=function(){return Object.keys(this.set).length},i.prototype.addAllTo=function(e){for(var t=Object.keys(this.set),n=t.length,r=0;r<n;r++)e.push(this.set[t[r]])},i.prototype.size=function(){return Object.keys(this.set).length},i.prototype.addAll=function(e){for(var t=e.length,n=0;n<t;n++){var r=e[n];this.add(r)}},e.exports=i},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(11),a=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),null===n&&void 0===n||(this.compareFunction=this._defaultCompareFunction);var r=void 0;r=t instanceof i?t.size():t.length,this._quicksort(t,0,r-1)}return r(e,[{key:"_quicksort",value:function(e,t,n){if(t<n){var r=this._partition(e,t,n);this._quicksort(e,t,r),this._quicksort(e,r+1,n)}}},{key:"_partition",value:function(e,t,n){for(var r=this._get(e,t),i=t,a=n;;){for(;this.compareFunction(r,this._get(e,a));)a--;for(;this.compareFunction(this._get(e,i),r);)i++;if(!(i<a))return a;this._swap(e,i,a),i++,a--}}},{key:"_get",value:function(e,t){return e instanceof i?e.get_object_at(t):e[t]}},{key:"_set",value:function(e,t,n){e instanceof i?e.set_object_at(t,n):e[t]=n}},{key:"_swap",value:function(e,t,n){var r=this._get(e,t);this._set(e,t,this._get(e,n)),this._set(e,n,r)}},{key:"_defaultCompareFunction",value:function(e,t){return t>e}}]),e}();e.exports=a},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sequence1=t,this.sequence2=n,this.match_score=r,this.mismatch_penalty=i,this.gap_penalty=a,this.iMax=t.length+1,this.jMax=n.length+1,this.grid=new Array(this.iMax);for(var o=0;o<this.iMax;o++){this.grid[o]=new Array(this.jMax);for(var s=0;s<this.jMax;s++)this.grid[o][s]=0}this.tracebackGrid=new Array(this.iMax);for(var l=0;l<this.iMax;l++){this.tracebackGrid[l]=new Array(this.jMax);for(var u=0;u<this.jMax;u++)this.tracebackGrid[l][u]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return r(e,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var e=1;e<this.jMax;e++)this.grid[0][e]=this.grid[0][e-1]+this.gap_penalty,this.tracebackGrid[0][e]=[!1,!1,!0];for(var t=1;t<this.iMax;t++)this.grid[t][0]=this.grid[t-1][0]+this.gap_penalty,this.tracebackGrid[t][0]=[!1,!0,!1];for(var n=1;n<this.iMax;n++)for(var r=1;r<this.jMax;r++){var i=[this.sequence1[n-1]===this.sequence2[r-1]?this.grid[n-1][r-1]+this.match_score:this.grid[n-1][r-1]+this.mismatch_penalty,this.grid[n-1][r]+this.gap_penalty,this.grid[n][r-1]+this.gap_penalty],a=this.arrayAllMaxIndexes(i);this.grid[n][r]=i[a[0]],this.tracebackGrid[n][r]=[a.includes(0),a.includes(1),a.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var e=[];for(e.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});e[0];){var t=e[0],n=this.tracebackGrid[t.pos[0]][t.pos[1]];n[0]&&e.push({pos:[t.pos[0]-1,t.pos[1]-1],seq1:this.sequence1[t.pos[0]-1]+t.seq1,seq2:this.sequence2[t.pos[1]-1]+t.seq2}),n[1]&&e.push({pos:[t.pos[0]-1,t.pos[1]],seq1:this.sequence1[t.pos[0]-1]+t.seq1,seq2:"-"+t.seq2}),n[2]&&e.push({pos:[t.pos[0],t.pos[1]-1],seq1:"-"+t.seq1,seq2:this.sequence2[t.pos[1]-1]+t.seq2}),0===t.pos[0]&&0===t.pos[1]&&this.alignments.push({sequence1:t.seq1,sequence2:t.seq2}),e.shift()}return this.alignments}},{key:"getAllIndexes",value:function(e,t){for(var n=[],r=-1;-1!==(r=e.indexOf(t,r+1));)n.push(r);return n}},{key:"arrayAllMaxIndexes",value:function(e){return this.getAllIndexes(e,Math.max.apply(null,e))}}]),e}();e.exports=i},function(e,t,n){"use strict";var r=function(){};r.FDLayout=n(18),r.FDLayoutConstants=n(7),r.FDLayoutEdge=n(19),r.FDLayoutNode=n(20),r.DimensionD=n(21),r.HashMap=n(22),r.HashSet=n(23),r.IGeometry=n(8),r.IMath=n(9),r.Integer=n(10),r.Point=n(12),r.PointD=n(4),r.RandomSeed=n(16),r.RectangleD=n(13),r.Transform=n(17),r.UniqueIDGeneretor=n(14),r.Quicksort=n(24),r.LinkedList=n(11),r.LGraphObject=n(2),r.LGraph=n(5),r.LEdge=n(1),r.LGraphManager=n(6),r.LNode=n(3),r.Layout=n(15),r.LayoutConstants=n(0),r.NeedlemanWunsch=n(25),e.exports=r},function(e,t,n){"use strict";function r(){this.listeners=[]}var i=r.prototype;i.addListener=function(e,t){this.listeners.push({event:e,callback:t})},i.removeListener=function(e,t){for(var n=this.listeners.length;n>=0;n--){var r=this.listeners[n];r.event===e&&r.callback===t&&this.listeners.splice(n,1)}},i.emit=function(e,t){for(var n=0;n<this.listeners.length;n++){var r=this.listeners[n];e===r.event&&r.callback(t)}},e.exports=r}])},e.exports=t()},47724:(e,t,n)=>{"use strict";n.d(t,{diagram:()=>S});var r=n(75822),i=n(59373),a=n(71377),o=n.n(a),s=n(23701),l=n.n(s),u=n(91619),c=n(12281),h=n(7201),d=(n(27484),n(17967),n(27856),n(70277),n(45625),n(39354),n(91518),n(59542),n(10285),n(28734),function(){var e=function(e,t,n,r){for(n=n||{},r=e.length;r--;n[e[r]]=t);return n},t=[1,4],n=[1,13],r=[1,12],i=[1,15],a=[1,16],o=[1,20],s=[1,19],l=[6,7,8],u=[1,26],c=[1,24],h=[1,25],d=[6,7,11],p=[1,6,13,15,16,19,22],g=[1,33],f=[1,34],v=[1,6,7,11,13,15,16,19,22],y={trace:function(){},yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 6:case 7:return r;case 8:r.getLogger().trace("Stop NL ");break;case 9:r.getLogger().trace("Stop EOF ");break;case 11:r.getLogger().trace("Stop NL2 ");break;case 12:r.getLogger().trace("Stop EOF2 ");break;case 15:r.getLogger().info("Node: ",a[s].id),r.addNode(a[s-1].length,a[s].id,a[s].descr,a[s].type);break;case 16:r.getLogger().trace("Icon: ",a[s]),r.decorateNode({icon:a[s]});break;case 17:case 21:r.decorateNode({class:a[s]});break;case 18:r.getLogger().trace("SPACELIST");break;case 19:r.getLogger().trace("Node: ",a[s].id),r.addNode(0,a[s].id,a[s].descr,a[s].type);break;case 20:r.decorateNode({icon:a[s]});break;case 25:r.getLogger().trace("node found ..",a[s-2]),this.$={id:a[s-1],descr:a[s-1],type:r.getType(a[s-2],a[s])};break;case 26:this.$={id:a[s],descr:a[s],type:r.nodeType.DEFAULT};break;case 27:r.getLogger().trace("node found ..",a[s-3]),this.$={id:a[s-3],descr:a[s-1],type:r.getType(a[s-2],a[s])}}},table:[{3:1,4:2,5:3,6:[1,5],8:t},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:t},{6:n,7:[1,10],9:9,12:11,13:r,14:14,15:i,16:a,17:17,18:18,19:o,22:s},e(l,[2,3]),{1:[2,2]},e(l,[2,4]),e(l,[2,5]),{1:[2,6],6:n,12:21,13:r,14:14,15:i,16:a,17:17,18:18,19:o,22:s},{6:n,9:22,12:11,13:r,14:14,15:i,16:a,17:17,18:18,19:o,22:s},{6:u,7:c,10:23,11:h},e(d,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:o,22:s}),e(d,[2,18]),e(d,[2,19]),e(d,[2,20]),e(d,[2,21]),e(d,[2,23]),e(d,[2,24]),e(d,[2,26],{19:[1,30]}),{20:[1,31]},{6:u,7:c,10:32,11:h},{1:[2,7],6:n,12:21,13:r,14:14,15:i,16:a,17:17,18:18,19:o,22:s},e(p,[2,14],{7:g,11:f}),e(v,[2,8]),e(v,[2,9]),e(v,[2,10]),e(d,[2,15]),e(d,[2,16]),e(d,[2,17]),{20:[1,35]},{21:[1,36]},e(p,[2,13],{7:g,11:f}),e(v,[2,11]),e(v,[2,12]),{21:[1,37]},e(d,[2,25]),e(d,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:function(e,t){if(!t.recoverable){var n=new Error(e);throw n.hash=t,n}this.trace(e)},parse:function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",l=0,u=0,c=a.slice.call(arguments,1),h=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);h.setInput(e,d.yy),d.yy.lexer=h,d.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var g=h.yylloc;a.push(g);var f=h.options&&h.options.ranges;"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var v,y,m,b,x,w,E,T,_,D={};;){if(y=n[n.length-1],this.defaultActions[y]?m=this.defaultActions[y]:(null==v&&(_=void 0,"number"!=typeof(_=r.pop()||h.lex()||1)&&(_ instanceof Array&&(_=(r=_).pop()),_=t.symbols_[_]||_),v=_),m=o[y]&&o[y][v]),void 0===m||!m.length||!m[0]){var C="";for(x in T=[],o[y])this.terminals_[x]&&x>2&&T.push("'"+this.terminals_[x]+"'");C=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==v?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(C,{text:h.match,token:this.terminals_[v]||v,line:h.yylineno,loc:g,expected:T})}if(m[0]instanceof Array&&m.length>1)throw new Error("Parse Error: multiple actions possible at state: "+y+", token: "+v);switch(m[0]){case 1:n.push(v),i.push(h.yytext),a.push(h.yylloc),n.push(m[1]),v=null,u=h.yyleng,s=h.yytext,l=h.yylineno,g=h.yylloc;break;case 2:if(w=this.productions_[m[1]][1],D.$=i[i.length-w],D._$={first_line:a[a.length-(w||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(w||1)].first_column,last_column:a[a.length-1].last_column},f&&(D._$.range=[a[a.length-(w||1)].range[0],a[a.length-1].range[1]]),void 0!==(b=this.performAction.apply(D,[s,u,l,d.yy,m[1],i,a].concat(c))))return b;w&&(n=n.slice(0,-1*w*2),i=i.slice(0,-1*w),a=a.slice(0,-1*w)),n.push(this.productions_[m[1]][0]),i.push(D.$),a.push(D._$),E=o[n[n.length-2]][n[n.length-1]],n.push(E);break;case 3:return!0}}return!0}},m={EOF:1,parseError:function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},setInput:function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},unput:function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},test_match:function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;var e,t,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;a<i.length;a++)if((n=this._input.match(this.rules[i[a]]))&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var e=this.next();return e||this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},pushState:function(e){this.begin(e)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(e,t,n,r){switch(n){case 0:e.getLogger().trace("Found comment",t.yytext);break;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:case 23:this.popState();break;case 5:e.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return e.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:e.getLogger().trace("end icon"),this.popState();break;case 10:return e.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return e.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return e.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return e.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:case 15:case 16:case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:e.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 22:return e.getLogger().trace("description:",t.yytext),"NODE_DESCR";case 24:return this.popState(),e.getLogger().trace("node end ))"),"NODE_DEND";case 25:return this.popState(),e.getLogger().trace("node end )"),"NODE_DEND";case 26:return this.popState(),e.getLogger().trace("node end ...",t.yytext),"NODE_DEND";case 27:case 30:case 31:return this.popState(),e.getLogger().trace("node end (("),"NODE_DEND";case 28:case 29:return this.popState(),e.getLogger().trace("node end (-"),"NODE_DEND";case 32:case 33:return e.getLogger().trace("Long description:",t.yytext),20}},rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\-\)\{\}]+)/i,/^(?:$)/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR:{rules:[22,23],inclusive:!1},NODE:{rules:[21,24,25,26,27,28,29,30,31,32,33],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};function b(){this.yy={}}return y.lexer=m,b.prototype=y,y.Parser=b,new b}());d.parser=d;const p=d,g=e=>(0,r.n)(e,(0,r.g)());let f=[],v=0,y={};const m={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},b=(e,t)=>{y[e]=t},x=e=>{switch(e){case m.DEFAULT:return"no-border";case m.RECT:return"rect";case m.ROUNDED_RECT:return"rounded-rect";case m.CIRCLE:return"circle";case m.CLOUD:return"cloud";case m.BANG:return"bang";case m.HEXAGON:return"hexgon";default:return"no-border"}};let w;const E=e=>y[e],T=Object.freeze(Object.defineProperty({__proto__:null,addNode:(e,t,n,i)=>{r.l.info("addNode",e,t,n,i);const a=(0,r.g)(),o={id:v++,nodeId:g(t),level:e,descr:g(n),type:i,children:[],width:(0,r.g)().mindmap.maxNodeWidth};switch(o.type){case m.ROUNDED_RECT:case m.RECT:case m.HEXAGON:o.padding=2*a.mindmap.padding;break;default:o.padding=a.mindmap.padding}const s=function(e){for(let t=f.length-1;t>=0;t--)if(f[t].level<e)return f[t];return null}(e);if(s)s.children.push(o),f.push(o);else{if(0!==f.length){let e=new Error('There can be only one root. No parent could be found for ("'+o.descr+'")');throw e.hash={text:"branch "+name,token:"branch "+name,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:['"checkout '+name+'"']},e}f.push(o)}},clear:()=>{f=[],v=0,y={}},decorateNode:e=>{const t=f[f.length-1];e&&e.icon&&(t.icon=g(e.icon)),e&&e.class&&(t.class=g(e.class))},getElementById:E,getLogger:()=>r.l,getMindmap:()=>f.length>0?f[0]:null,getNodeById:e=>f[e],getType:(e,t)=>{switch(r.l.debug("In get type",e,t),e){case"[":return m.RECT;case"(":return")"===t?m.ROUNDED_RECT:m.CLOUD;case"((":return m.CIRCLE;case")":return m.CLOUD;case"))":return m.BANG;case"{{":return m.HEXAGON;default:return m.DEFAULT}},nodeType:m,get parseError(){return w},sanitizeText:g,setElementForId:b,setErrorHandler:e=>{w=e},type2Str:x},Symbol.toStringTag,{value:"Module"}));function _(e,t){e.each((function(){var e,n=(0,i.Ys)(this),r=n.text().split(/(\s+|<br>)/).reverse(),a=[],o=n.attr("y"),s=parseFloat(n.attr("dy")),l=n.text(null).append("tspan").attr("x",0).attr("y",o).attr("dy",s+"em");for(let i=0;i<r.length;i++)e=r[r.length-1-i],a.push(e),l.text(a.join(" ").trim()),(l.node().getComputedTextLength()>t||"<br>"===e)&&(a.pop(),l.text(a.join(" ").trim()),a="<br>"===e?[""]:[e],l=n.append("tspan").attr("x",0).attr("y",o).attr("dy","1.1em").text(e))}))}const D=function(e,t,n,r){const i=n%11,a=e.append("g");t.section=i;let o="section-"+i;i<0&&(o+=" section-root"),a.attr("class",(t.class?t.class+" ":"")+"mindmap-node "+o);const s=a.append("g"),l=a.append("g"),u=l.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(_,t.width).node().getBBox(),c=r.fontSize.replace?r.fontSize.replace("px",""):r.fontSize;if(t.height=u.height+1.1*c*.5+t.padding,t.width=u.width+2*t.padding,t.icon)if(t.type===m.CIRCLE){t.height+=50,t.width+=50;a.append("foreignObject").attr("height","50px").attr("width",t.width).attr("style","text-align: center;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+i+" "+t.icon),l.attr("transform","translate("+t.width/2+", "+(t.height/2-1.5*t.padding)+")")}else{t.width+=50;const e=t.height;t.height=Math.max(e,60);const n=Math.abs(t.height-e);a.append("foreignObject").attr("width","60px").attr("height",t.height).attr("style","text-align: center;margin-top:"+n/2+"px;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+i+" "+t.icon),l.attr("transform","translate("+(25+t.width/2)+", "+(n/2+t.padding/2)+")")}else l.attr("transform","translate("+t.width/2+", "+t.padding/2+")");switch(t.type){case m.DEFAULT:!function(e,t,n){e.append("path").attr("id","node-"+t.id).attr("class","node-bkg node-"+x(t.type)).attr("d",`M0 ${t.height-5} v${10-t.height} q0,-5 5,-5 h${t.width-10} q5,0 5,5 v${t.height-5} H0 Z`),e.append("line").attr("class","node-line-"+n).attr("x1",0).attr("y1",t.height).attr("x2",t.width).attr("y2",t.height)}(s,t,i);break;case m.ROUNDED_RECT:!function(e,t){e.append("rect").attr("id","node-"+t.id).attr("class","node-bkg node-"+x(t.type)).attr("height",t.height).attr("rx",t.padding).attr("ry",t.padding).attr("width",t.width)}(s,t);break;case m.RECT:!function(e,t){e.append("rect").attr("id","node-"+t.id).attr("class","node-bkg node-"+x(t.type)).attr("height",t.height).attr("width",t.width)}(s,t);break;case m.CIRCLE:s.attr("transform","translate("+t.width/2+", "+ +t.height/2+")"),function(e,t){e.append("circle").attr("id","node-"+t.id).attr("class","node-bkg node-"+x(t.type)).attr("r",t.width/2)}(s,t);break;case m.CLOUD:!function(e,t){const n=t.width,r=t.height,i=.15*n,a=.25*n,o=.35*n,s=.2*n;e.append("path").attr("id","node-"+t.id).attr("class","node-bkg node-"+x(t.type)).attr("d",`M0 0 a${i},${i} 0 0,1 ${.25*n},${-1*n*.1}\n a${o},${o} 1 0,1 ${.4*n},${-1*n*.1}\n a${a},${a} 1 0,1 ${.35*n},${1*n*.2}\n\n a${i},${i} 1 0,1 ${.15*n},${1*r*.35}\n a${s},${s} 1 0,1 ${-1*n*.15},${1*r*.65}\n\n a${a},${i} 1 0,1 ${-1*n*.25},${.15*n}\n a${o},${o} 1 0,1 ${-1*n*.5},0\n a${i},${i} 1 0,1 ${-1*n*.25},${-1*n*.15}\n\n a${i},${i} 1 0,1 ${-1*n*.1},${-1*r*.35}\n a${s},${s} 1 0,1 ${.1*n},${-1*r*.65}\n\n H0 V0 Z`)}(s,t);break;case m.BANG:!function(e,t){const n=t.width,r=t.height,i=.15*n;e.append("path").attr("id","node-"+t.id).attr("class","node-bkg node-"+x(t.type)).attr("d",`M0 0 a${i},${i} 1 0,0 ${.25*n},${-1*r*.1}\n a${i},${i} 1 0,0 ${.25*n},0\n a${i},${i} 1 0,0 ${.25*n},0\n a${i},${i} 1 0,0 ${.25*n},${1*r*.1}\n\n a${i},${i} 1 0,0 ${.15*n},${1*r*.33}\n a${.8*i},${.8*i} 1 0,0 0,${1*r*.34}\n a${i},${i} 1 0,0 ${-1*n*.15},${1*r*.33}\n\n a${i},${i} 1 0,0 ${-1*n*.25},${.15*r}\n a${i},${i} 1 0,0 ${-1*n*.25},0\n a${i},${i} 1 0,0 ${-1*n*.25},0\n a${i},${i} 1 0,0 ${-1*n*.25},${-1*r*.15}\n\n a${i},${i} 1 0,0 ${-1*n*.1},${-1*r*.33}\n a${.8*i},${.8*i} 1 0,0 0,${-1*r*.34}\n a${i},${i} 1 0,0 ${.1*n},${-1*r*.33}\n\n H0 V0 Z`)}(s,t);break;case m.HEXAGON:!function(e,t){const n=t.height,r=n/4,i=t.width-t.padding+2*r;!function(e,t,n,r,i){e.insert("polygon",":first-child").attr("points",r.map((function(e){return e.x+","+e.y})).join(" ")).attr("transform","translate("+(i.width-t)/2+", "+n+")")}(e,i,n,[{x:r,y:0},{x:i-r,y:0},{x:i,y:-n/2},{x:i-r,y:-n},{x:r,y:-n},{x:0,y:-n/2}],t)}(s,t)}return b(t.id,a),t.height},C=function(e){const t=E(e.id),n=e.x||0,r=e.y||0;t.attr("transform","translate("+n+","+r+")")};function N(e,t,n,r){D(e,t,n,r),t.children&&t.children.forEach(((t,i)=>{N(e,t,n<0?i:n,r)}))}function A(e,t,n,r){t.add({group:"nodes",data:{id:e.id,labelText:e.descr,height:e.height,width:e.width,level:r,nodeId:e.id,padding:e.padding,type:e.type},position:{x:e.x,y:e.y}}),e.children&&e.children.forEach((i=>{A(i,t,n,r+1),t.add({group:"edges",data:{id:`${e.id}_${i.id}`,source:e.id,target:i.id,depth:r,section:i.section}})}))}function L(e,t){return new Promise((n=>{const a=(0,i.Ys)("body").append("div").attr("id","cy").attr("style","display:none"),s=o()({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});a.remove(),A(e,s,t,0),s.nodes().forEach((function(e){e.layoutDimensions=()=>{const t=e.data();return{w:t.width,h:t.height}}})),s.layout({name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1}).run(),s.ready((e=>{r.l.info("Ready",e),n(s)}))}))}o().use(l());const S={db:T,renderer:{draw:async(e,t,n,a)=>{const o=(0,r.g)();a.db.clear(),a.parser.parse(e),r.l.debug("Renering info diagram\n"+e);const s=(0,r.g)().securityLevel;let l;"sandbox"===s&&(l=(0,i.Ys)("#i"+t));const u=("sandbox"===s?(0,i.Ys)(l.nodes()[0].contentDocument.body):(0,i.Ys)("body")).select("#"+t);u.append("g");const c=a.db.getMindmap(),h=u.append("g");h.attr("class","mindmap-edges");const d=u.append("g");d.attr("class","mindmap-nodes"),N(d,c,-1,o);const p=await L(c,o);!function(e,t){t.edges().map(((t,n)=>{const i=t.data();if(t[0]._private.bodyBounds){const a=t[0]._private.rscratch;r.l.trace("Edge: ",n,i),e.insert("path").attr("d",`M ${a.startX},${a.startY} L ${a.midX},${a.midY} L${a.endX},${a.endY} `).attr("class","edge section-edge-"+i.section+" edge-depth-"+i.depth)}}))}(h,p),function(e){e.nodes().map(((e,t)=>{const n=e.data();n.x=e.position().x,n.y=e.position().y,C(n);const i=E(n.nodeId);r.l.info("Id:",t,"Position: (",e.position().x,", ",e.position().y,")",n),i.attr("transform",`translate(${e.position().x-n.width/2}, ${e.position().y-n.height/2})`),i.attr("attr",`apa-${t})`)}))}(p),(0,r.s)(void 0,u,o.mindmap.padding,o.mindmap.useMaxWidth)}},parser:p,styles:e=>`\n .edge {\n stroke-width: 3;\n }\n ${(e=>{let t="";for(let n=0;n<e.THEME_COLOR_LIMIT;n++)e["lineColor"+n]=e["lineColor"+n]||e["cScaleInv"+n],(0,u.Z)(e["lineColor"+n])?e["lineColor"+n]=(0,c.Z)(e["lineColor"+n],20):e["lineColor"+n]=(0,h.Z)(e["lineColor"+n],20);for(let n=0;n<e.THEME_COLOR_LIMIT;n++){const r=""+(17-3*n);t+=`\n .section-${n-1} rect, .section-${n-1} path, .section-${n-1} circle, .section-${n-1} polygon, .section-${n-1} path {\n fill: ${e["cScale"+n]};\n }\n .section-${n-1} text {\n fill: ${e["cScaleLabel"+n]};\n }\n .node-icon-${n-1} {\n font-size: 40px;\n color: ${e["cScaleLabel"+n]};\n }\n .section-edge-${n-1}{\n stroke: ${e["cScale"+n]};\n }\n .edge-depth-${n-1}{\n stroke-width: ${r};\n }\n .section-${n-1} line {\n stroke: ${e["cScaleInv"+n]} ;\n stroke-width: 3;\n }\n\n .disabled, .disabled circle, .disabled text {\n fill: lightgray;\n }\n .disabled text {\n fill: #efefef;\n }\n `}return t})(e)}\n .section-root rect, .section-root path, .section-root circle, .section-root polygon {\n fill: ${e.git0};\n }\n .section-root text {\n fill: ${e.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n`}},91619:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(61691),i=n(71610);const a=e=>{const{r:t,g:n,b:a}=i.Z.parse(e),o=.2126*r.Z.channel.toLinear(t)+.7152*r.Z.channel.toLinear(n)+.0722*r.Z.channel.toLinear(a);return r.Z.lang.round(o)},o=e=>a(e)>=.5,s=e=>!o(e)}}]); |