From 07c587ec5488f31406ecb2059d787f224bd5a242 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 15 Jan 2019 13:56:31 +0100 Subject: [PATCH 1/4] new cytoscape version 3.3.2 --- styles/bootstrap/cytoscape/cytoscape.min.js | 31 +++++++++++++++------ 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/styles/bootstrap/cytoscape/cytoscape.min.js b/styles/bootstrap/cytoscape/cytoscape.min.js index 7ee28d32a..78fecacd7 100644 --- a/styles/bootstrap/cytoscape/cytoscape.min.js +++ b/styles/bootstrap/cytoscape/cytoscape.min.js @@ -1,10 +1,23 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.cytoscape=t():e.cytoscape=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=20)}([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},i=n(3),a=i?i.navigator:null,o=i?i.document:null,s=r(""),l=r({}),u=r(function(){}),c="undefined"==typeof HTMLElement?"undefined":r(HTMLElement),d=function(e){return e&&e.instanceString&&h.fn(e.instanceString)?e.instanceString():null},h={defined:function(e){return null!=e},string:function(e){return null!=e&&(void 0===e?"undefined":r(e))==s},fn:function(e){return null!=e&&(void 0===e?"undefined":r(e))===u},array:function(e){return Array.isArray?Array.isArray(e):null!=e&&e instanceof Array},plainObject:function(e){return null!=e&&(void 0===e?"undefined":r(e))===l&&!h.array(e)&&e.constructor===Object},object:function(e){return null!=e&&(void 0===e?"undefined":r(e))===l},number:function(e){return null!=e&&(void 0===e?"undefined":r(e))===r(1)&&!isNaN(e)},integer:function(e){return h.number(e)&&Math.floor(e)===e},bool:function(e){return null!=e&&(void 0===e?"undefined":r(e))===r(!0)},htmlElement:function(e){return"undefined"===c?void 0:null!=e&&e instanceof HTMLElement},elementOrCollection:function(e){return h.element(e)||h.collection(e)},element:function(e){return"collection"===d(e)&&e._private.single},collection:function(e){return"collection"===d(e)&&!e._private.single},core:function(e){return"core"===d(e)},style:function(e){return"style"===d(e)},stylesheet:function(e){return"stylesheet"===d(e)},event:function(e){return"event"===d(e)},thread:function(e){return"thread"===d(e)},fabric:function(e){return"fabric"===d(e)},emptyString:function(e){return void 0===e||null===e||!(""!==e&&!e.match(/^\s+$/))},nonemptyString:function(e){return!(!e||!h.string(e)||""===e||e.match(/^\s+$/))},domElement:function(e){return"undefined"!=typeof HTMLElement&&e instanceof HTMLElement},boundingBox:function(e){return h.plainObject(e)&&h.number(e.x1)&&h.number(e.x2)&&h.number(e.y1)&&h.number(e.y2)},promise:function(e){return h.object(e)&&h.fn(e.then)},touch:function(){return i&&("ontouchstart"in i||i.DocumentTouch&&o instanceof DocumentTouch)},gecko:function(){return i&&("undefined"!=typeof InstallTrigger||"MozAppearance"in o.documentElement.style)},webkit:function(){return i&&("undefined"!=typeof webkitURL||"WebkitAppearance"in o.documentElement.style)},chromium:function(){return i&&"undefined"!=typeof chrome},khtml:function(){return a&&a.vendor.match(/kde/i)},khtmlEtc:function(){return h.khtml()||h.webkit()||h.chromium()},ms:function(){return a&&a.userAgent.match(/msie|trident|edge/i)},windows:function(){return a&&a.appVersion.match(/Win/i)},mac:function(){return a&&a.appVersion.match(/Mac/i)},linux:function(){return a&&a.appVersion.match(/Linux/i)},unix:function(){return a&&a.appVersion.match(/X11/i)}};e.exports=h},function(e,t,n){"use strict";var r=n(0),i=n(2),a={MAX_INT:Number.MAX_SAFE_INTEGER||9007199254740991,trueify:function(){return!0},falsify:function(){return!1},zeroify:function(){return 0},noop:function(){},error:function(e){console.error?(console.error.apply(console,arguments),console.trace&&console.trace()):(console.log.apply(console,arguments),console.trace&&console.trace())},clone:function(e){return this.extend({},e)},copy:function(e){return null==e?e:r.array(e)?e.slice():r.plainObject(e)?this.clone(e):e},copyArray:function(e){return e.slice()},clonePosition:function(e){return{x:e.x,y:e.y}},uuid: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}};a.makeBoundingBox=i.makeBoundingBox.bind(i),a._staticEmptyObject={},a.staticEmptyObject=function(){return a._staticEmptyObject},a.extend=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments,n=1;n=0&&(e[r]!==t||(e.splice(r,1),n));r--);},a.clearArray=function(e){e.splice(0,e.length)},a.push=function(e,t){for(var n=0;n0?1:e<0?-1:0},r.dist=function(e,t){return Math.sqrt(r.sqdist(e,t))},r.sqdist=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},r.qbezierAt=function(e,t,n,r){return(1-r)*(1-r)*e+2*(1-r)*r*t+r*r*n},r.qbezierPtAt=function(e,t,n,i){return{x:r.qbezierAt(e.x,t.x,n.x,i),y:r.qbezierAt(e.y,t.y,n.y,i)}},r.lineAt=function(e,t,n,i){var a={x:t.x-e.x,y:t.y-e.y},o=r.dist(e,t),s={x:a.x/o,y:a.y/o};return n=null==n?0:n,i=null!=i?i:n*o,{x:e.x+s.x*i,y:e.y+s.y*i}},r.lineAtDist=function(e,t,n){return r.lineAt(e,t,void 0,n)},r.triangleAngle=function(e,t,n){var i=r.dist(t,n),a=r.dist(e,n),o=r.dist(e,t);return Math.acos((i*i+a*a-o*o)/(2*i*a))},r.bound=function(e,t,n){return Math.max(e,Math.min(n,t))},r.makeBoundingBox=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}}},r.updateBoundingBox=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},r.expandBoundingBoxByPoint=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},r.expandBoundingBox=function(e,t){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},r.boundingBoxesIntersect=function(e,t){return!(e.x1>t.x2)&&(!(t.x1>e.x2)&&(!(e.x2t.y2)&&!(t.y1>e.y2)))))))},r.inBoundingBox=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},r.pointInBoundingBox=function(e,t){return this.inBoundingBox(e,t.x,t.y)},r.boundingBoxInBoundingBox=function(e,t){return r.inBoundingBox(e,t.x1,t.y1)&&r.inBoundingBox(e,t.x2,t.y2)},r.roundRectangleIntersectLine=function(e,t,n,r,i,a,o){var s=this.getRoundRectangleRadius(i,a),l=i/2,u=a/2,c=void 0,d=n-l+s-o,h=r-u-o,p=n+l-s+o,f=h;if(c=this.finiteLinesIntersect(e,t,n,r,d,h,p,f,!1),c.length>0)return c;var v=n+l+o,g=r-u+s-o,y=v,m=r+u-s+o;if(c=this.finiteLinesIntersect(e,t,n,r,v,g,y,m,!1),c.length>0)return c;var b=n-l+s-o,x=r+u+o,w=n+l-s+o,E=x;if(c=this.finiteLinesIntersect(e,t,n,r,b,x,w,E,!1),c.length>0)return c;var P=n-l-o,C=r-u+s-o,S=P,T=r+u-s+o;if(c=this.finiteLinesIntersect(e,t,n,r,P,C,S,T,!1),c.length>0)return c;var D=void 0,k=n-l+s,_=r-u+s;if(D=this.intersectLineCircle(e,t,n,r,k,_,s+o),D.length>0&&D[0]<=k&&D[1]<=_)return[D[0],D[1]];var M=n+l-s,I=r-u+s;if(D=this.intersectLineCircle(e,t,n,r,M,I,s+o),D.length>0&&D[0]>=M&&D[1]<=I)return[D[0],D[1]];var N=n+l-s,B=r+u-s;if(D=this.intersectLineCircle(e,t,n,r,N,B,s+o),D.length>0&&D[0]>=N&&D[1]>=B)return[D[0],D[1]];var z=n-l+s,L=r+u-s;return D=this.intersectLineCircle(e,t,n,r,z,L,s+o),D.length>0&&D[0]<=z&&D[1]>=L?[D[0],D[1]]:[]},r.inLineVicinity=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),d=Math.max(r,a);return l-s<=e&&e<=u+s&&c-s<=t&&t<=d+s},r.inBezierVicinity=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!(eu.x2||tu.y2)},r.solveQuadratic=function(e,t,n,r){n-=r;var i=t*t-4*e*n;if(i<0)return[];var a=Math.sqrt(i),o=2*e;return[(-t+a)/o,(-t-a)/o]},r.solveCubic=function(e,t,n,r,i){t/=e,n/=e,r/=e;var a=void 0,o=void 0,s=void 0,l=void 0,u=void 0,c=void 0,d=void 0,h=void 0;return o=(3*n-t*t)/9,s=-27*r+t*(9*n-t*t*2),s/=54,a=o*o*o+s*s,i[1]=0,d=t/3,a>0?(u=s+Math.sqrt(a),u=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),c=s-Math.sqrt(a),c=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3),i[0]=-d+u+c,d+=(u+c)/2,i[4]=i[2]=-d,d=Math.sqrt(3)*(-c+u)/2,i[3]=d,void(i[5]=-d)):(i[5]=i[3]=0,0===a?(h=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3),i[0]=2*h-d,void(i[4]=i[2]=-(h+d))):(o=-o,l=o*o*o,l=Math.acos(s/Math.sqrt(l)),h=2*Math.sqrt(o),i[0]=-d+h*Math.cos(l/3),i[2]=-d+h*Math.cos((l+2*Math.PI)/3),void(i[4]=-d+h*Math.cos((l+4*Math.PI)/3))))},r.sqdistToQuadraticBezier=function(e,t,n,r,i,a,o,s){var l=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,u=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,c=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,d=1*n*i-n*n+n*e-i*e+r*a-r*r+r*t-a*t,h=[];this.solveCubic(l,u,c,d,h);for(var p=[],f=0;f<6;f+=2)Math.abs(h[f+1])<1e-7&&h[f]>=0&&h[f]<=1&&p.push(h[f]);p.push(1),p.push(0);for(var v=-1,g=void 0,y=void 0,m=void 0,b=0;b=0?ml?(e-i)*(e-i)+(t-a)*(t-a):u-d},r.pointInsidePolygonPoints=function(e,t,n){for(var r=void 0,i=void 0,a=void 0,o=void 0,s=0,l=0;l=e&&e>=a||r<=e&&e<=a))continue;(e-r)/(a-r)*(o-i)+i>t&&s++}return s%2!=0},r.pointInsidePolygon=function(e,t,n,i,a,o,s,l,u){var c=new Array(n.length),d=void 0;null!=l[0]?(d=Math.atan(l[1]/l[0]),l[0]<0?d+=Math.PI/2:d=-d-Math.PI/2):d=l;for(var h=Math.cos(-d),p=Math.sin(-d),f=0;f0){var g=this.expandPolygon(c,-u);v=this.joinLines(g)}else v=c;return r.pointInsidePolygonPoints(e,t,v)},r.joinLines=function(e){for(var t=new Array(e.length/2),n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,l=void 0,u=void 0,c=0;c=0&&v<=1&&y.push(v),g>=0&&g<=1&&y.push(g),0===y.length)return[];var m=y[0]*s[0]+e,b=y[0]*s[1]+t;if(y.length>1){if(y[0]==y[1])return[m,b];return[m,b,y[1]*s[0]+e,y[1]*s[1]+t]}return[m,b]},r.findCircleNearPoint=function(e,t,n,r,i){var a=r-e,o=i-t,s=Math.sqrt(a*a+o*o);return[e+a/s*n,t+o/s*n]},r.findMaxSqDistanceToOrigin=function(e){for(var t=1e-6,n=void 0,r=0;rt&&(t=n);return t},r.midOfThree=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},r.finiteLinesIntersect=function(e,t,n,r,i,a,o,s,l){var u=e-i,c=n-e,d=o-i,h=t-a,p=r-t,f=s-a,v=d*h-f*u,g=c*h-p*u,y=f*c-d*p;if(0!==y){var m=v/y,b=g/y;return-.001<=m&&m<=1.001&&-.001<=b&&b<=1.001?[e+m*c,t+m*p]:l?[e+m*c,t+m*p]:[]}return 0===v||0===g?this.midOfThree(e,n,o)===o?[o,s]:this.midOfThree(e,n,i)===i?[i,a]:this.midOfThree(i,o,n)===n?[n,r]:[]:[]},r.polygonIntersectLine=function(e,t,n,i,a,o,s,l){var u=[],c=void 0,d=new Array(n.length),h=!0;5===arguments.length&&(h=!1);var p=void 0;if(h){for(var f=0;f0){var v=r.expandPolygon(d,-l);p=r.joinLines(v)}else p=d}else p=n;for(var g=void 0,y=void 0,m=void 0,b=void 0,x=0;x "+t(r.target)),null!=r.connectedNodes){var h=r.connectedNodes;o=t(h[0])+" <-> "+t(h[1])}return null!=r.parent&&(o=t(r.parent)+" > "+o),null!=r.ancestor&&(o=t(r.ancestor)+" "+o),null!=r.child&&(o+=" > "+t(r.child)),null!=r.descendant&&(o+=" "+t(r.descendant)),o}(o),this.length>1&&e0&&i.plainObject(t[0])&&!i.element(t[0])){c=!0;for(var d=[],h=new o,p=0,f=t.length;p0){for(var R=new u(n,d),V=0;V0&&(e&&this.cy().notify({type:"remove",eles:E}),E.emit("remove"));for(var P=0;P=0;s--)!function(i){var s=o[i];c(a,function(e,t,n,r,a,l){if(s.type===n&&(!r||s.namespace===r)&&(!a||e.qualifierCompare(s.qualifier,a))&&(!l||s.callback===l))return o.splice(i,1),!1},e,t,n,r)}(s);return this},u.emit=u.trigger=function(e,t,n){var r=this.listeners,o=r.length;return this.emitting++,a.array(t)||(t=[t]),h(this,function(e,a){null!=n&&(r=[{event:a.event,type:a.type,namespace:a.namespace,callback:n}],o=r.length);for(var s=0;s0?d.wheelSensitivity:1,motionBlur:void 0!==d.motionBlur&&d.motionBlur,motionBlurOpacity:void 0===d.motionBlurOpacity?.05:d.motionBlurOpacity,pixelRatio:o.number(d.pixelRatio)&&d.pixelRatio>0?d.pixelRatio:void 0,desktopTapThreshold:void 0===d.desktopTapThreshold?4:d.desktopTapThreshold,touchTapThreshold:void 0===d.touchTapThreshold?8:d.touchTapThreshold},d.renderer));var v=function(e,n,r){t.notifications(!1);var a=t.mutableElements();a.length>0&&a.remove(),null!=e&&(o.plainObject(e)||o.array(e))&&t.add(e),t.one("layoutready",function(e){t.notifications(!0),t.emit(e),t.notify({type:"load",eles:t.mutableElements()}),t.one("load",n),t.emit("load")}).one("layoutstop",function(){t.one("done",r),t.emit("done")});var s=i.extend({},t._private.options.layout);s.eles=t.elements(),t.layout(s).run()};!function(e,t){if(e.some(o.promise))return s.all(e).then(t);t(e)}([d.style,d.elements],function(e){var n=e[0],r=e[1];p.styleEnabled&&t.style().append(n),v(r,function(){t.startAnimationLoop(),p.ready=!0,o.fn(d.ready)&&t.on("ready",d.ready);for(var e=0;e=e.deqFastCost*g)break}else if(a){if(f>=e.deqCost*u||f>=e.deqAvgCost*l)break}else if(v>=e.deqNoDrawCost*(1e3/60))break;var y=e.deq(t,h,d);if(!(y.length>0))break;for(var m=0;m0&&(e.onDeqd(t,c),!a&&e.shouldRedraw(t,c,h,d)&&i())},o=e.priority||r.noop;n.beforeRender(a,o(t))}}}}},function(e,t,n){"use strict";var r=n(0),i=n(12),a=n(95),o=n(137),s=function(e){return void 0===e&&(e={}),r.plainObject(e)?new i(e):r.string(e)?a.apply(a,arguments):void 0};s.use=function(e){var t=Array.prototype.slice.call(arguments,1);return t.unshift(s),e.apply(null,t),this},s.version=n(138),s.stylesheet=s.Stylesheet=o,e.exports=s},function(e,t,n){"use strict";var r=n(0);e.exports={hex2tuple:function(e){if((4===e.length||7===e.length)&&"#"===e[0]){var t=4===e.length,n=void 0,r=void 0,i=void 0;return t?(n=parseInt(e[1]+e[1],16),r=parseInt(e[2]+e[2],16),i=parseInt(e[3]+e[3],16)):(n=parseInt(e[1]+e[2],16),r=parseInt(e[3]+e[4],16),i=parseInt(e[5]+e[6],16)),[n,r,i]}},hsl2tuple:function(e){function t(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 n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,l=void 0,u=void 0,c=new RegExp("^"+this.regex.hsla+"$").exec(e);if(c){if(r=parseInt(c[1]),r<0?r=(360- -1*r%360)%360:r>360&&(r%=360),r/=360,(i=parseFloat(c[2]))<0||i>100)return;if(i/=100,(a=parseFloat(c[3]))<0||a>100)return;if(a/=100,void 0!==(o=c[4])&&((o=parseFloat(o))<0||o>1))return;if(0===i)s=l=u=Math.round(255*a);else{var d=a<.5?a*(1+i):a+i-a*i,h=2*a-d;s=Math.round(255*t(h,d,r+1/3)),l=Math.round(255*t(h,d,r)),u=Math.round(255*t(h,d,r-1/3))}n=[s,l,u,o]}return n},rgb2tuple:function(e){var t=void 0,n=new RegExp("^"+this.regex.rgba+"$").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},colorname2tuple:function(e){return this.colors[e.toLowerCase()]},color2tuple:function(e){return(r.array(e)?e:null)||this.colorname2tuple(e)||this.hex2tuple(e)||this.rgb2tuple(e)||this.hsl2tuple(e)},colors:{transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}},function(e,t,n){"use strict";var r=n(0);e.exports={mapEmpty:function(e){return null==e||0===Object.keys(e).length},pushMap:function(e){var t=this.getMap(e);null==t?this.setMap(this.extend({},e,{value:[e.value]})):t.push(e.value)},setMap:function(e){for(var t=e.map,n=e.keys,i=n.length,a=0;a=t||n<0||T&&r>=y}function c(){var e=E();if(u(e))return d(e);b=setTimeout(c,l(e))}function d(e){return b=void 0,D&&v?i(e):(v=g=void 0,m)}function h(){void 0!==b&&clearTimeout(b),C=0,v=P=g=b=void 0}function p(){return void 0===b?m:d(E())}function f(){var e=E(),n=u(e);if(v=arguments,g=this,P=e,n){if(void 0===b)return a(P);if(T)return b=setTimeout(c,t),i(P)}return void 0===b&&(b=setTimeout(c,t)),m}var v,g,y,m,b,P,C=0,S=!1,T=!1,D=!0;if("function"!=typeof e)throw new TypeError(s);return t=o(t)||0,r(n)&&(S=!!n.leading,T="maxWait"in n,y=T?x(o(n.maxWait)||0,t):y,D="trailing"in n?!!n.trailing:D),f.cancel=h,f.flush=p,f}function r(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function i(e){return!!e&&"object"==typeof e}function a(e){return"symbol"==typeof e||i(e)&&b.call(e)==u}function o(e){if("number"==typeof e)return e;if(a(e))return l;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(c,"");var n=h.test(e);return n||p.test(e)?f(e.slice(2),n?2:8):d.test(e)?l:+e}var s="Expected a function",l=NaN,u="[object Symbol]",c=/^\s+|\s+$/g,d=/^[-+]0x[0-9a-f]+$/i,h=/^0b[01]+$/i,p=/^0o[0-7]+$/i,f=parseInt,v="object"==typeof global&&global&&global.Object===Object&&global,g="object"==typeof self&&self&&self.Object===Object&&self,y=v||g||Function("return this")(),m=Object.prototype,b=m.toString,x=Math.max,w=Math.min,E=function(){return y.Date.now()};e.exports=n},function(e,t,n){"use strict";function r(e,t){return et?1:0}function i(e,t){return-1*r(e,t)}e.exports={sort:{ascending:r,descending:i}}},function(e,t,n){"use strict";function r(){this._obj={}}var i=r.prototype;i.set=function(e,t){this._obj[e]=t},i.delete=function(e){this._obj[e]=null},i.has=function(e){return null!=this._obj[e]},i.get=function(e){return this._obj[e]},e.exports=r},function(e,t,n){"use strict";var r=n(1),i={};[n(30),n(31),n(34),n(35),n(36),n(37),n(38),n(39),n(40),n(41),n(42)].forEach(function(e){r.extend(i,e)}),e.exports=i},function(e,t,n){"use strict";var r=n(0),i=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(t,n,i){var a;r.plainObject(t)&&!r.elementOrCollection(t)&&(a=t,t=a.roots||a.root,n=a.visit,i=a.directed),i=2!==arguments.length||r.fn(n)?i:n,n=r.fn(n)?n:function(){};for(var o,s=this._private.cy,l=t=r.string(t)?this.filter(t):t,u=[],c=[],d={},h={},p={},f=0,v=this.nodes(),g=this.edges(),y=0;y0;){var y=f.pop(),m=p(y),b=y.id();if(c[b]=m,m!==1/0)for(var x=y.neighborhood().intersect(h),v=0;v0)for(n.unshift(t);u[i.id()];){var a=u[i.id()];n.unshift(a.edge),n.unshift(a.node),i=a.node}return o.collection(n)}}}};e.exports=a},function(e,t,n){e.exports=n(33)},function(e,t,n){var r,i,a;(function(){var n,o,s,l,u,c,d,h,p,f,v,g,y,m,b;s=Math.floor,f=Math.min,o=function(e,t){return et?1:0},p=function(e,t,n,r,i){var a;if(null==n&&(n=0),null==i&&(i=o),n<0)throw new Error("lo must be non-negative");for(null==r&&(r=e.length);nn;0<=n?t++:t--)u.push(t);return u}.apply(this).reverse(),l=[],r=0,i=a.length;rv;0<=v?++c:--c)g.push(u(e,n));return g},m=function(e,t,n,r){var i,a,s;for(null==r&&(r=o),i=e[n];n>t&&(s=n-1>>1,a=e[s],r(i,a)<0);)e[n]=a,n=s;return e[n]=i},b=function(e,t,n){var r,i,a,s,l;for(null==n&&(n=o),i=e.length,l=t,a=e[t],r=2*t+1;r0;){var m=function(e,t){if(0!==e.length){for(var n=0,r=t[e[0]],i=1;im&&(c[g][y]=m,p[g][y]=y,f[g][y]=a[u])}if(!i)for(var u=0;um&&(c[g][y]=m,p[g][y]=y,f[g][y]=a[u])}for(var b=0;bc&&(c=t)},get:function(e){return u[e]}},h=0;h0?S.edgesTo(C)[0]:C.edgesTo(S)[0];var T=n(P);C=C.id(),x[C]>x[p]+T&&(x[C]=x[p]+T,w.nodes.indexOf(C)<0?w.push(C):w.updateItem(C),b[C]=0,m[C]=[]),x[C]==x[p]+T&&(b[C]=b[C]+b[p],m[C].push(p))}else for(var E=0;E0;)for(var C=y.pop(),E=0;E0:void 0}},clearQueue:function(){return function(){var e=this,t=void 0!==e.length,n=t?e:[e];if(!(this._private.cy||this).styleEnabled())return this;for(var r=0;r0&&this.spawn(n).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){for(var n=e.match(/\S+/g)||[],r=this,i=[],a=0,o=r.length;a0&&this.spawn(i).updateStyle().emit("class"),r},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}};e.exports=i},function(e,t,n){"use strict";var r=(n(0),n(6)),i={allAre:function(e){var t=new r(e);return this.every(function(e){return t.matches(e)})},is:function(e){var t=new r(e);return this.some(function(e){return t.matches(e)})},some:function(e,t){for(var n=0;n\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:'"(?:\\\\"|[^"])*"|'+"'(?:\\\\'|[^'])*'",number:r.regex.number,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};i.variable="(?:[\\w-]|(?:\\\\"+i.metaChar+"))+",i.value=i.string+"|"+i.number,i.className=i.variable,i.id=i.variable,function(){var e=void 0,t=void 0,n=void 0;for(e=i.comparatorOp.split("|"),n=0;n=0||"="!==t&&(i.comparatorOp+="|\\!"+t)}(),e.exports=i},function(e,t,n){"use strict";var r=n(15),i=r.stateSelectorMatches,a=n(0),o=function(e,t){for(var n=!0,r=0;r=0&&(d=d.toLowerCase(),h=h.toLowerCase(),o=o.replace("@",""),p=!0);var f=!1;o.indexOf("!")>=0&&(o=o.replace("!",""),f=!0),p&&(s=h.toLowerCase(),c=d.toLowerCase());var v=!1;switch(o){case"*=":u=d.indexOf(h)>=0;break;case"$=":u=d.indexOf(h,d.length-h.length)>=0;break;case"^=":u=0===d.indexOf(h);break;case"=":u=c===s;break;case">":v=!0,u=c>s;break;case">=":v=!0,u=c>=s;break;case"<":v=!0,u=c0;){var d=i.shift();t(d),a.add(d.id()),l&&r(i,a,d)}return e}function i(e,t,n){if(n.isParent())for(var r=n._private.children,i=0;i1&&void 0!==arguments[1])||arguments[1],i)},l.forEachUp=function(e){return r(this,e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a)},l.forEachUpAndDown=function(e){return r(this,e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o)},l.ancestors=l.parents,e.exports=l},function(e,t,n){"use strict";var r=n(4),i=void 0,a=void 0;i=a={data:r.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:r.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:r.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:r.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:r.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:r.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}},i.attr=i.data,i.removeAttr=i.removeData,e.exports=a},function(e,t,n){"use strict";function r(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;ot}),minIndegree:i("indegree",function(e,t){return et}),minOutdegree:i("outdegree",function(e,t){return et})}),a.extend(o,{totalDegree:function(e){for(var t=0,n=this.nodes(),r=0;r0,d=c;c&&(u=u[0]);var h=d?u.position():{x:0,y:0};return a={x:l.x-h.x,y:l.y-h.y},void 0===e?a:a[e]}for(var p=0;p0,y=g;g&&(v=v[0]);var m=y?v.position():{x:0,y:0};void 0!==t?f.position(e,t+m[e]):void 0!==a&&f.position({x:a.x+m.x,y:a.y+m.y})}}else if(!o)return;return this}},o.modelPosition=o.point=o.position,o.modelPositions=o.points=o.positions,o.renderedPoint=o.renderedPosition,o.relativePoint=o.relativePosition,e.exports=s},function(e,t,n){"use strict";function r(e){return{includeNodes:a.default(e.includeNodes,b.includeNodes),includeEdges:a.default(e.includeEdges,b.includeEdges),includeLabels:a.default(e.includeLabels,b.includeLabels),includeOverlays:a.default(e.includeOverlays,b.includeOverlays),useCache:a.default(e.useCache,b.useCache)}}var i=n(0),a=n(1),o=n(2),s=void 0,l=void 0;s=l={},l.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}},l.dirtyCompoundBoundsCache=function(){var e=this.cy();return e.styleEnabled()&&e.hasCompoundNodes()?(this.forEachUp(function(e){e._private.compoundBoundsClean=!1,e.isParent()&&e.emit("bounds")}),this):this},l.updateCompoundBounds=function(){var e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(e.batching())return this;for(var t=[],n=0;n0&&a>0&&(r=t/a*e,i=n/a*e),{biasDiff:r,biasComplementDiff:i}}if(e.isParent()){var r=e._private,i=e.children(),a="include"===e.pstyle("compound-sizing-wrt-labels").value,o={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")}},s=i.boundingBox({includeLabels:a,includeOverlays:!1,useCache:!1}),l=r.position;0!==s.w&&0!==s.h||(s={w:e.pstyle("width").pfValue,h:e.pstyle("height").pfValue},s.x1=l.x-s.w/2,s.x2=l.x+s.w/2,s.y1=l.y-s.h/2,s.y2=l.y+s.h/2);var u=o.width.left.value;"px"===o.width.left.units&&o.width.val>0&&(u=100*u/o.width.val);var c=o.width.right.value;"px"===o.width.right.units&&o.width.val>0&&(c=100*c/o.width.val);var d=o.height.top.value;"px"===o.height.top.units&&o.height.val>0&&(d=100*d/o.height.val);var h=o.height.bottom.value;"px"===o.height.bottom.units&&o.height.val>0&&(h=100*h/o.height.val);var p=n(o.width.val-s.w,u,c),f=p.biasDiff,v=p.biasComplementDiff,g=n(o.height.val-s.h,d,h),y=g.biasDiff,m=g.biasComplementDiff;r.autoPadding=function(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}}(s.w,s.h,e.pstyle("padding"),e.pstyle("padding-relative-to").value),r.autoWidth=Math.max(s.w,o.width.val),l.x=(-f+s.x1+s.x2+v)/2,r.autoHeight=Math.max(s.h,o.height.val),l.y=(-y+s.y1+s.y2+m)/2,t.push(e)}}(r),e._private.batchingStyle||(i.compoundBoundsClean=!0))}return this};var u=function(e){return e===1/0||e===-1/0?0:e},c=function(e,t,n,r,i){r-t!=0&&i-n!=0&&null!=t&&null!=n&&null!=r&&null!=i&&(e.x1=te.x2?r:e.x2,e.y1=ne.y2?i:e.y2)},d=function(e,t){return c(e,t.x1,t.y1,t.x2,t.y2)},h=function(e,t,n){return a.getPrefixedProperty(e,t,n)},p=function(e,t,n){if(!t.cy().headless()){var r=t._private,i=r.rstyle,a=i.arrowWidth/2,o=t.pstyle(n+"-arrow-shape").value,s=void 0,l=void 0;"none"!==o&&("source"===n?(s=i.srcX,l=i.srcY):"target"===n?(s=i.tgtX,l=i.tgtY):(s=i.midX,l=i.midY),c(e,s-a,l-a,s+a,l+a))}},f=function(e,t,n){if(!t.cy().headless()){var r=void 0;r=n?n+"-":"";var i=t._private,a=i.rstyle;if(t.pstyle(r+"label").strValue){var o=t.pstyle("text-halign"),s=t.pstyle("text-valign"),l=h(a,"labelWidth",n),u=h(a,"labelHeight",n),d=h(a,"labelX",n),p=h(a,"labelY",n),f=t.pstyle(r+"text-margin-x").pfValue,v=t.pstyle(r+"text-margin-y").pfValue,g=t.isEdge(),y=t.pstyle(r+"text-rotation"),m=t.pstyle("text-outline-width").pfValue,b=t.pstyle("text-border-width").pfValue,x=b/2,w=t.pstyle("text-background-padding").pfValue,E=u+2*w,P=l+2*w,C=P/2,S=E/2,T=void 0,D=void 0,k=void 0,_=void 0;if(g)T=d-C,D=d+C,k=p-S,_=p+S;else{switch(o.value){case"left":T=d-P,D=d;break;case"center":T=d-C,D=d+C;break;case"right":T=d,D=d+P}switch(s.value){case"top":k=p-E,_=p;break;case"center":k=p-S,_=p+S;break;case"bottom":k=p,_=p+E}}var M=g&&"autorotate"===y.strValue,I=null!=y.pfValue&&0!==y.pfValue;if(M||I){var N=M?h(i.rstyle,"labelAngle",n):y.pfValue,B=Math.cos(N),z=Math.sin(N),L=function(e,t){return e-=d,t-=p,{x:e*B-t*z+d,y:e*z+t*B+p}},A=L(T,k),O=L(T,_),R=L(D,k),V=L(D,_);T=Math.min(A.x,O.x,R.x,V.x),D=Math.max(A.x,O.x,R.x,V.x),k=Math.min(A.y,O.y,R.y,V.y),_=Math.max(A.y,O.y,R.y,V.y)}T+=f-Math.max(m,x),D+=f+Math.max(m,x),k+=v-Math.max(m,x),_+=v+Math.max(m,x),c(e,T,k,D,_)}return e}},v=function(e,t){var n=e._private.cy,r=n.styleEnabled(),i=n.headless(),a={x1:1/0,y1:1/0,x2:-1/0,y2:-1/0},s=e._private,l=r?e.pstyle("display").value:"element",d=e.isNode(),h=e.isEdge(),v=void 0,g=void 0,y=void 0,m=void 0,b=void 0,x=void 0,w="none"!==l;if(w){var E=0;r&&t.includeOverlays&&0!==e.pstyle("overlay-opacity").value&&(E=e.pstyle("overlay-padding").value);var P=0,C=0;if(r&&(P=e.pstyle("width").pfValue,C=P/2),d&&t.includeNodes){var S=e.position();b=S.x,x=S.y;var T=e.outerWidth(),D=T/2,k=e.outerHeight(),_=k/2;v=b-D-E,g=b+D+E,y=x-_-E,m=x+_+E,c(a,v,y,g,m)}else if(h&&t.includeEdges){var M=s.rstyle||{};if(r&&!i&&(v=Math.min(M.srcX,M.midX,M.tgtX),g=Math.max(M.srcX,M.midX,M.tgtX),y=Math.min(M.srcY,M.midY,M.tgtY),m=Math.max(M.srcY,M.midY,M.tgtY),v-=C,g+=C,y-=C,m+=C,c(a,v,y,g,m)),r&&!i&&"haystack"===e.pstyle("curve-style").strValue){var I=M.haystackPts||[];if(v=I[0].x,y=I[0].y,g=I[1].x,m=I[1].y,v>g){var N=v;v=g,g=N}if(y>m){var B=y;y=m,m=B}c(a,v-C,y-C,g+C,m+C)}else{for(var z=M.bezierPts||M.linePts||[],L=0;Lg){var F=v;v=g,g=F}if(y>m){var j=y;y=m,m=j}v-=C,g+=C,y-=C,m+=C,c(a,v,y,g,m)}}}if(r&&t.includeEdges&&h&&(p(a,e,"mid-source"),p(a,e,"mid-target"),p(a,e,"source"),p(a,e,"target")),r){if("yes"===e.pstyle("ghost").value){var X=e.pstyle("ghost-offset-x").pfValue,Y=e.pstyle("ghost-offset-y").pfValue;c(a,a.x1+X,a.y1+Y,a.x2+X,a.y2+Y)}}r&&(v=a.x1,g=a.x2,y=a.y1,m=a.y2,c(a,v-E,y-E,g+E,m+E)),r&&t.includeLabels&&(f(a,e,null),h&&(f(a,e,"source"),f(a,e,"target")))}return a.x1=u(a.x1),a.y1=u(a.y1),a.x2=u(a.x2),a.y2=u(a.y2),a.w=u(a.x2-a.x1),a.h=u(a.y2-a.y1),a.w>0&&a.h>0&&w&&o.expandBoundingBox(a,1),a},g=function(e){return e?"t":"f"},y=function(e){var t="";return t+=g(e.incudeNodes),t+=g(e.includeEdges),t+=g(e.includeLabels),t+=g(e.includeOverlays)},m=function(e,t){var n=e._private,r=void 0,i=e.cy().headless(),a=t===b?x:y(t);return t.useCache&&!i&&n.bbCache&&n.bbCache[a]?r=n.bbCache[a]:(r=v(e,t),i||(n.bbCache=n.bbCache||{},n.bbCache[a]=r)),r},b={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeOverlays:!0,useCache:!0},x=y(b);l.boundingBox=function(e){if(1===this.length&&this[0]._private.bbCache&&(void 0===e||void 0===e.useCache||!0===e.useCache))return e=void 0===e?b:r(e),m(this[0],e);var t={x1:1/0,y1:1/0,x2:-1/0,y2:-1/0};e=e||a.staticEmptyObject();var n=r(e),i=this,o=i.cy(),s=o.styleEnabled();s&&this.recalculateRenderedStyle(n.useCache),this.updateCompoundBounds();for(var l={},c=0;c1&&!o){var s=this.length-1,l=this[s],u=l._private.data.id;this[s]=void 0,this[a]=l,r.set(u,{ele:l,index:a})}return this.length--,this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&r.string(e)){var n=e;e=t.mutableElements().filter(n)}for(var i=0;in&&(n=s,r=o)}return{value:n,ele:r}},min:function(e,t){for(var n=1/0,r=void 0,i=this,a=0;a=0&&i0&&t.push(c[0]),t.push(s[0])}return this.spawn(t,{unique:!0}).filter(e)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),l.neighbourhood=l.neighborhood,l.closedNeighbourhood=l.closedNeighborhood,l.openNeighbourhood=l.openNeighborhood,o.extend(l,{source:u(function(e){var t=this[0],n=void 0;return t&&(n=t._private.source||t.cy().collection()),n&&e?n.filter(e):n},"source"),target:u(function(e){var t=this[0],n=void 0;return t&&(n=t._private.target||t.cy().collection()),n&&e?n.filter(e):n},"target"),sources:r({attr:"source"}),targets:r({attr:"target"})}),o.extend(l,{edgesWith:u(i(),"edgesWith"),edgesTo:u(i({thisIsSrc:!0}),"edgesTo")}),o.extend(l,{connectedEdges:u(function(e){for(var t=[],n=this,r=0;r0);return i.map(function(e){var t=e.connectedEdges().stdFilter(function(t){return e.anySame(t.source())&&e.anySame(t.target())});return e.union(t)})}}),e.exports=l},function(e,t,n){"use strict";var r=n(0),i=n(1),a=n(7),o=n(14),s={add:function(e){var t=void 0,n=this;if(r.elementOrCollection(e)){var s=e;if(s._private.cy===n)t=s.restore();else{for(var l=[],u=0;u=0;t--){(0,e[t])()}e.splice(0,e.length)},p=s.length-1;p>=0;p--){var f=s[p],v=f._private;v.stopped?(s.splice(p,1),v.hooked=!1,v.playing=!1,v.started=!1,h(v.frames)):(v.playing||v.applying)&&(v.playing&&v.applying&&(v.applying=!1),v.started||a(t,f,e,n),i(t,f,e,n),v.applying&&(v.applying=!1),h(v.frames),f.completed()&&(s.splice(p,1),v.hooked=!1,v.playing=!1,v.started=!1,h(v.completes)),u=!0)}return n||0!==s.length||0!==l.length||o.push(t),u}for(var r=t._private.aniEles,o=[],s=!1,l=0;l0?(r.dirtyCompoundBoundsCache(),t.notify({type:"draw",eles:r})):t.notify({type:"draw"})),r.unmerge(o),t.emit("step")}var i=n(73),a=n(78);e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){var l=!r,u=e._private,c=t._private,d=c.easing,h=c.startTime,p=r?e:e.cy(),f=p.style();if(!c.easingImpl)if(null==d)c.easingImpl=a.linear;else{var v=void 0;if(s.string(d)){var g=f.parse("transition-timing-function",d);v=g.value}else v=d;var y=void 0,m=void 0;s.string(v)?(y=v,m=[]):(y=v[1],m=v.slice(2).map(function(e){return+e})),m.length>0?("spring"===y&&m.push(c.duration),c.easingImpl=a[y].apply(null,m)):c.easingImpl=a[y]}var b=c.easingImpl,x=void 0;if(x=0===c.duration?1:(n-h)/c.duration,c.applying&&(x=c.progress),x<0?x=0:x>1&&(x=1),null==c.delay){var w=c.startPosition,E=c.position;if(E&&l&&!e.locked()){var P=e.position();i(w.x,E.x)&&(P.x=o(w.x,E.x,x,b)),i(w.y,E.y)&&(P.y=o(w.y,E.y,x,b)),e.emit("position")}var C=c.startPan,S=c.pan,T=u.pan,D=null!=S&&r;D&&(i(C.x,S.x)&&(T.x=o(C.x,S.x,x,b)),i(C.y,S.y)&&(T.y=o(C.y,S.y,x,b)),e.emit("pan"));var k=c.startZoom,_=c.zoom,M=null!=_&&r;M&&(i(k,_)&&(u.zoom=o(k,_,x,b)),e.emit("zoom")),(D||M)&&e.emit("viewport");var I=c.style;if(I&&I.length>0&&l){for(var N=0;N0?i=o:r=o}while(Math.abs(a)>g&&++l=v?u(t,s):0===c?s:d(t,r,r+b)}function p(){P=!0,e===t&&n===r||c()}var f=4,v=.001,g=1e-7,y=10,m=11,b=1/(m-1),x="undefined"!=typeof Float32Array;if(4!==arguments.length)return!1;for(var w=0;w<4;++w)if("number"!=typeof arguments[w]||isNaN(arguments[w])||!isFinite(arguments[w]))return!1;e=Math.min(e,1),n=Math.min(n,1),e=Math.max(e,0),n=Math.max(n,0);var E=x?new Float32Array(m):new Array(m),P=!1,C=function(i){return P||p(),e===t&&n===r?i:0===i?0:1===i?1:s(h(i),t,r)};C.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var S="generateBezier("+[e,t,n,r]+")";return C.toString=function(){return S},C}e.exports=r},function(e,t,n){"use strict";/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */ -var r=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={x:-1,v:0,tension:null,friction:null},o=[0],s=0,l=void 0,u=void 0,c=void 0;for(t=parseFloat(t)||500,r=parseFloat(r)||20,i=i||null,a.tension=t,a.friction=r,l=null!==i,l?(s=e(t,r),u=s/i*.016):u=.016;c=n(c||a,u),o.push(1+c.x),s+=16,Math.abs(c.x)>1e-4&&Math.abs(c.v)>1e-4;);return l?function(e){return o[e*(o.length-1)|0]}:s}}();e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r,i){if(1===r)return n;var a=i(t,n,r);return null==e?a:((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 i(e,t){return null!=e.pfValue||null!=e.value?null==e.pfValue||null!=t&&"%"===t.type.units?e.value:e.pfValue:e}function a(e,t,n,a,s){var l=null!=s?s.type:null;n<0?n=0:n>1&&(n=1);var u=i(e,s),c=i(t,s);if(o.number(u)&&o.number(c))return r(l,u,c,n,a);if(o.array(u)&&o.array(c)){for(var d=[],h=0;h0},startBatch:function(){var e=this._private;return null==e.batchCount&&(e.batchCount=0),0===e.batchCount&&(e.batchingStyle=e.batchingNotify=!0,e.batchStyleEles=this.collection(),e.batchNotifyEles=this.collection(),e.batchNotifyTypes=[],e.batchNotifyTypes.ids={}),e.batchCount++,this},endBatch:function(){var e=this._private;return e.batchCount--,0===e.batchCount&&(e.batchingStyle=!1,e.batchStyleEles.updateStyle(),e.batchingNotify=!1,this.notify({type:e.batchNotifyTypes,eles:e.batchNotifyEles})),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;r0;)t.removeChild(t.childNodes[0]);e._private.renderer=null},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};i.invalidateDimensions=i.resize,e.exports=i},function(e,t,n){"use strict";var r=n(0),i=n(7),a={collection:function(e,t){return r.string(e)?this.$(e):r.elementOrCollection(e)?e.collection():r.array(e)?new i(this,e,t):new i(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}};a.elements=a.filter=a.$,e.exports=a},function(e,t,n){"use strict";var r=n(0),i=n(18),a={style:function(e){if(e){this.setStyle(e).update()}return this._private.style},setStyle:function(e){var t=this._private;return r.stylesheet(e)?t.style=e.generateStyle(this):r.array(e)?t.style=i.fromJson(this,e):r.string(e)?t.style=i.fromString(this,e):t.style=i(this),t.style}};e.exports=a},function(e,t,n){"use strict";var r=n(1),i=n(0),a=n(5),o={};o.apply=function(e){var t=this,n=t._private,r=n.cy,i=r.collection();n.newStyle&&(n.contextStyles={},n.propDiffs={},t.cleanElements(e,!0));for(var a=0;a0;if(h||p){var f=void 0;h&&p?f=u.properties:h?f=u.properties:p&&(f=u.mappedProperties);for(var v=0;v0){r=!0;break}}t.hasPie=r;var o=e.pstyle("text-transform").strValue,s=e.pstyle("label").strValue,l=e.pstyle("source-label").strValue,u=e.pstyle("target-label").strValue,c=e.pstyle("font-style").strValue,d=e.pstyle("font-size").pfValue+"px",h=e.pstyle("font-family").strValue,p=e.pstyle("font-weight").strValue,f=e.pstyle("text-valign").strValue,v=e.pstyle("text-valign").strValue,g=e.pstyle("text-outline-width").pfValue,y=e.pstyle("text-wrap").strValue,m=e.pstyle("text-max-width").pfValue,b=c+"$"+d+"$"+h+"$"+p+"$"+o+"$"+f+"$"+v+"$"+g+"$"+y+"$"+m;t.labelStyleKey=b,t.sourceLabelKey=b+"$"+l,t.targetLabelKey=b+"$"+u,t.labelKey=b+"$"+s,t.fontKey=c+"$"+p+"$"+d+"$"+h,t.styleKey=Date.now()}},o.applyParsedProperty=function(e,t){var n=this,a=t,o=e._private.style,s=void 0,l=n.types,u=n.properties[a.name].type,c=a.bypass,d=o[a.name],h=d&&d.bypass,p=e._private,f=function(){n.checkZOrderTrigger(e,a.name,d?d.value:null,a.value)};if("curve-style"===t.name&&"haystack"===t.value&&e.isEdge()&&(e.isLoop()||e.source().isParent()||e.target().isParent())&&(a=t=this.parse(t.name,"bezier",c)),a.delete)return o[a.name]=void 0,f(),!0;if(a.deleteBypassed)return d?!!d.bypass&&(d.bypassed=void 0,f(),!0):(f(),!0);if(a.deleteBypass)return d?!!d.bypass&&(o[a.name]=d.bypassed,f(),!0):(f(),!0);var v=function(){r.error("Do not assign mappings to elements without corresponding data (e.g. ele `"+e.id()+"` for property `"+a.name+"` with data field `"+a.field+"`); try a `["+a.field+"]` selector to limit scope to elements with `"+a.field+"` defined")};switch(a.mapped){case l.mapData:for(var g=a.field.split("."),y=p.data,m=0;m1&&(b=1),u.color){var x=a.valueMin[0],w=a.valueMax[0],E=a.valueMin[1],P=a.valueMax[1],C=a.valueMin[2],S=a.valueMax[2],T=null==a.valueMin[3]?1:a.valueMin[3],D=null==a.valueMax[3]?1:a.valueMax[3],k=[Math.round(x+(w-x)*b),Math.round(E+(P-E)*b),Math.round(C+(S-C)*b),Math.round(T+(D-T)*b)];s={bypass:a.bypass,name:a.name,value:k,strValue:"rgb("+k[0]+", "+k[1]+", "+k[2]+")"}}else{if(!u.number)return!1;var _=a.valueMin+(a.valueMax-a.valueMin)*b;s=this.parse(a.name,_,a.bypass,"mapping")}s||(s=this.parse(a.name,d.strValue,a.bypass,"mapping")),s||v(),s.mapping=a,a=s;break;case l.data:var M=a.field.split("."),I=p.data;if(I)for(var N=0;N0&&l>0){for(var c={},d=!1,h=0;h0?e.delayAnimation(u).play().promise().then(t):t()}).then(function(){return e.animation({style:c,duration:l,easing:e.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){r.removeBypasses(e,s),e.emitAndNotify("style"),o.transitioning=!1})}else o.transitioning&&(this.removeBypasses(e,s),e.emitAndNotify("style"),o.transitioning=!1)},o.checkZOrderTrigger=function(e,t,n,r){var i=this.properties[t];null==i.triggersZOrder||null!=n&&!i.triggersZOrder(n,r)||this._private.cy.notify({type:"zorder",eles:e})},e.exports=o},function(e,t,n){"use strict";var r=n(0),i=n(1),a={};a.applyBypass=function(e,t,n,a){var o=this,s=[];if("*"===t||"**"===t){if(void 0!==n)for(var l=0;ll.length?s.substr(l.length):""}function n(){u=u.length>c.length?u.substr(c.length):""}var a=this,o=this,s=""+e,l=void 0,u=void 0,c=void 0;for(s=s.replace(/[\/][*](\s|.)+?[*][\/]/g,"");;){if(s.match(/^\s*$/))break;var d=s.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!d){r.error("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+s);break}l=d[0];var h=d[1];if("core"!==h){if(new i(h)._private.invalid){r.error("Skipping parsing of block: Invalid selector found in string stylesheet: "+h),t();continue}}var p=d[2],f=!1;u=p;for(var v=[];;){if(u.match(/^\s*$/))break;var g=u.match(/^\s*(.+?)\s*:\s*(.+?)\s*;/);if(!g){r.error("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+p),f=!0;break}c=g[0];var y=g[1],m=g[2];if(a.properties[y]){o.parse(y,m)?(v.push({name:y,val:m}),n()):(r.error("Skipping property: Invalid property definition in: "+c),n())}else r.error("Skipping property: Invalid property name in: "+c),n()}if(f){t();break}o.selector(h);for(var b=0;b node").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3,"curve-style":"haystack"}).selector(":parent <-> node").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("node:parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}).selector("core").css({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125}),this.defaultLength=this.length},e.exports=a},function(e,t,n){"use strict";var r=n(1),i=n(0),a=n(2),o={};o.parse=function(e,t,n,a){var o=this;if(i.fn(t))return o.parseImplWarn(e,t,n,a);var s="mapping"===a||!0===a||!1===a||null==a?"dontcare":a,l=[e,t,n,s].join("$"),u=o.propCache=o.propCache||{},c=void 0;return(c=u[l])||(c=u[l]=o.parseImplWarn(e,t,n,a)),(n||"mapping"===a)&&(c=r.copy(c))&&(c.value=r.copy(c.value)),c},o.parseImplWarn=function(e,t,n,i){var a=this.parseImpl(e,t,n,i);return a||null==t||r.error("The style property `%s: %s` is invalid",e,t),a},o.parseImpl=function(e,t,n,o){var s=this;e=r.camel2dash(e);var l=s.properties[e],u=t,c=s.types;if(!l)return null;if(void 0===t)return null;l.alias&&(l=l.pointsTo,e=l.name);var d=i.string(t);d&&(t=t.trim());var h=l.type;if(!h)return null;if(n&&(""===t||null===t))return{name:e,value:t,bypass:!0,deleteBypass:!0};if(i.fn(t))return{name:e,value:t,strValue:"fn",mapped:c.fn,bypass:n};var p=void 0,f=void 0;if(!d||o);else{if(p=new RegExp(c.data.regex).exec(t)){if(n)return!1;var v=c.data;return{name:e,value:p,strValue:""+t,mapped:v,field:p[1],bypass:n}}if(f=new RegExp(c.mapData.regex).exec(t)){if(n)return!1;if(h.multiple)return!1;var g=c.mapData;if(!h.color&&!h.number)return!1;var y=this.parse(e,f[4]);if(!y||y.mapped)return!1;var m=this.parse(e,f[5]);if(!m||m.mapped)return!1;if(y.value===m.value)return!1;if(h.color){var b=y.value,x=m.value;if(!(b[0]!==x[0]||b[1]!==x[1]||b[2]!==x[2]||b[3]!==x[3]&&(null!=b[3]&&1!==b[3]||null!=x[3]&&1!==x[3])))return!1}return{name:e,value:f,strValue:""+t,mapped:g,field:f[1],fieldMin:parseFloat(f[2]),fieldMax:parseFloat(f[3]),valueMin:y.value,valueMax:m.value,bypass:n}}}if(h.multiple&&"multiple"!==o){var w=void 0;if(w=d?t.split(/\s+/):i.array(t)?t:[t],h.evenMultiple&&w.length%2!=0)return null;for(var E=[],P=[],C=[],S=!1,T=0;Th.max||h.strictMax&&t===h.max))return null;var B={name:e,value:t,strValue:""+t+(_||""),units:_,bypass:n};return h.unitless||"px"!==_&&"em"!==_?B.pfValue=t:B.pfValue="px"!==_&&_?this.getEmSizeInPixels()*t:t,"ms"!==_&&"s"!==_||(B.pfValue="ms"===_?t:1e3*t),"deg"!==_&&"rad"!==_||(B.pfValue="rad"===_?t:a.deg2rad(t)),"%"===_&&(B.pfValue=t/100),B}if(h.propList){var z=[],L=""+t;if("none"===L);else{for(var A=L.split(","),O=0;O0&&s>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){l=Math.min((o-2*t)/n.w,(s-2*t)/n.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=lt.maxZoom?t.maxZoom:s,s=st.maxZoom||!t.zoomingEnabled?o=!0:(t.zoom=l,a.push("zoom"))}if(i&&(!o||!e.cancelOnFailedZoom)&&t.panningEnabled){var u=e.pan;r.number(u.x)&&(t.pan.x=u.x,s=!1),r.number(u.y)&&(t.pan.y=u.y,s=!1),s||a.push("pan")}return a.length>0&&(a.push("viewport"),this.emit(a.join(" ")),this.notify({type:"viewport"})),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify({type:"viewport"})),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(r.string(e)){var n=e;e=this.mutableElements().filter(n)}else r.elementOrCollection(e)||(e=this.mutableElements());if(0!==e.length){var i=e.boundingBox(),a=this.width(),o=this.height();t=void 0===t?this._private.zoom:t;return{x:(a-t*(i.x1+i.x2))/2,y:(o-t*(i.y1+i.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=this._private,t=e.container;return e.sizeCache=e.sizeCache||(t?function(){var e=i.getComputedStyle(t),n=function(t){return parseFloat(e.getPropertyValue(t))};return{width:t.clientWidth-n("padding-left")-n("padding-right"),height:t.clientHeight-n("padding-top")-n("padding-bottom")}}():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,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}}};o.centre=o.center,o.autolockNodes=o.autolock,o.autoungrabifyNodes=o.autoungrabify,e.exports=o},function(e,t,n){"use strict";function r(e,t,n){var r=n,a=function(n){s.error("Can not register `"+t+"` for `"+e+"` since `"+n+"` already exists in the prototype and can not be overridden")};if("core"===e){if(c.prototype[t])return a(t);c.prototype[t]=n}else if("collection"===e){if(u.prototype[t])return a(t);u.prototype[t]=n}else if("layout"===e){for(var o=function(e){this.options=e,n.call(this,e),h.plainObject(this._private)||(this._private={}),this._private.cy=e.cy,this._private.listeners=[],this.createEmitter()},d=o.prototype=Object.create(n.prototype),v=[],g=0;g0;)!function(){var e=n.collection();r.bfs({roots:v[0],visit:function(t,n,r,i,a){e=e.add(t)},directed:!1}),v=v.not(e),f.push(e)}();u=n.collection();for(var g=0;gy.length-1;)y.push([]);y[G].push(H),Z.depth=G,Z.index=y[G].length-1}z()}var Q=0;if(t.avoidOverlap)for(var K=0;Kc||0===t)&&(r+=u/d,a++)}return a=Math.max(1,a),r/=a,0===a&&(r=void 0),re[e.id()]=r,r},ae=function(e,t){return ie(e)-ie(t)},oe=0;oe<3;oe++){for(var se=0;se=0;he--)for(var pe=y[he],fe=0;fe0&&y[0].length<=3?c/2:0),h=2*Math.PI/y[i].length*a;return 0===i&&1===y[0].length&&(d=1),{x:ce.x+d*Math.cos(h),y:ce.y+d*Math.sin(h)}}return{x:ce.x+(a+1-(o+1)/2)*s,y:(i+1)*u}}var p={x:ce.x+(a+1-(o+1)/2)*s,y:(i+1)*u};return p}(ve,y.length)}return i.layoutPositions(this,t,function(e){return de[e.id()]}),this},e.exports=r},function(e,t,n){"use strict";function r(e){this.options=i.extend({},s,e)}var i=n(1),a=n(2),o=n(0),s={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}};r.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,s=r.nodes().not(":parent");t.sort&&(s=s.sort(t.sort));for(var l=a.makeBoundingBox(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),u={x:l.x1+l.w/2,y:l.y1+l.h/2},c=void 0===t.sweep?2*Math.PI-2*Math.PI/s.length:t.sweep,d=c/Math.max(1,s.length-1),h=void 0,p=0,f=0;f1&&t.avoidOverlap){p*=1.75;var b=Math.cos(d)-Math.cos(0),x=Math.sin(d)-Math.sin(0),w=Math.sqrt(p*p/(b*b+x*x));h=Math.max(w,h)}var E=function(e,n){var r=t.startAngle+n*d*(i?1:-1),a=h*Math.cos(r),o=h*Math.sin(r);return{x:u.x+a,y:u.y+o}};return s.layoutPositions(this,t,E),this},e.exports=r},function(e,t,n){"use strict";function r(e){this.options=i.extend({},o,e)}var i=n(1),a=n(2),o={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}};r.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,o=i.nodes().not(":parent"),s=a.makeBoundingBox(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),l={x:s.x1+s.w/2,y:s.y1+s.h/2},u=[],c=(t.startAngle,0),d=0;d0){Math.abs(b[0].value-w.value)>=y&&(b=[],m.push(b))}b.push(w)}var E=c+t.minNodeSpacing;if(!t.avoidOverlap){var P=m.length>0&&m[0].length>1,C=Math.min(s.w,s.h)/2-E,S=C/(m.length+P?1:0);E=Math.min(E,S)}for(var T=0,D=0;D1&&t.avoidOverlap){var I=Math.cos(M)-Math.cos(0),N=Math.sin(M)-Math.sin(0),B=Math.sqrt(E*E/(I*I+N*N));T=Math.max(B,T)}k.r=T,T+=E}if(t.equidistant){for(var z=0,L=0,A=0;A0)var l=r.nodeOverlap*o,d=Math.sqrt(i*i+a*a),h=l*i/d,p=l*a/d;else var f=c(e,i,a),v=c(t,-1*i,-1*a),g=v.x-f.x,y=v.y-f.y,m=g*g+y*y,d=Math.sqrt(m),l=(e.nodeRepulsion+t.nodeRepulsion)/m,h=l*g/d,p=l*y/d;e.isLocked||(e.offsetX-=h,e.offsetY-=p),t.isLocked||(t.offsetX+=h,t.offsetY+=p)}},u=function(e,t,n,r){if(n>0)var i=e.maxX-t.minX;else var i=t.maxX-e.minX;if(r>0)var a=e.maxY-t.minY;else var a=t.maxY-e.minY;return i>=0&&a>=0?Math.sqrt(i*i+a*a):0},c=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&&0n?(u.x=r,u.y=i+a/2,u):0t&&-1*l<=s&&s<=l?(u.x=r-o/2,u.y=i-o*n/2/t,u):0=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},d=function(e,t){for(var n=0;n1){var f=t.gravity*d/p,v=t.gravity*h/p;c.offsetX+=f,c.offsetY+=v}}}}},p=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(0n)var i={x:n*e/r,y:n*t/r};else var i={x:e,y:t};return i},g=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.padLefti.maxY)&&(i.maxY=t.maxY+i.padBottom,a=!0),(null==i.minY||t.minY-i.padTopg&&(p+=v+t.componentSpacing,h=0,f=0,v=0)}}}(0,i),r}).then(function(e){h.layoutNodes=e.layoutNodes,o.stop(),b()});var b=function(){!0===t.animate||!1===t.animate?m({force:!0,next:function(){r.one("layoutstop",t.stop),r.emit({type:"layoutstop",layout:r})}}):t.eles.nodes().layoutPositions(r,t,function(e){var t=h.layoutNodes[h.idToIndex[e.data("id")]];return{x:t.positionX,y:t.positionY}})};return this},r.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},r.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var c=function(e,t,n){for(var r=n.eles.edges(),i=n.eles.nodes(),a={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:r.size(),temperature:n.initialTemp,clientWidth:e.width(),clientHeight:e.width(),boundingBox:o.makeBoundingBox(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()})},l=n.eles.components(),u={},c=0;c0){a.graphSet.push(S);for(var c=0;cr.count?0:r.graph},h=function e(t,n,r,i){var a=i.graphSet[r];if(-1s){var v=d(),g=h();(v-1)*g>=s?d(v-1):(g-1)*v>=s&&h(g-1)}else for(;c*u=s?h(m+1):d(y+1)}var b=o.w/c,x=o.h/u;if(t.condense&&(b=0,x=0),t.avoidOverlap)for(var w=0;w=c&&(N=0,I++)},z={},L=0;L=0;E--){var P=f[E];P.isNode()?s(P)||u(P):function(n){var r,a=n._private,l=a.rscratch,u=n.pstyle("width").pfValue,c=n.pstyle("arrow-scale").value,d=u/2+m,f=d*d,g=2*d,b=a.source,x=a.target;if("segments"===l.edgeType||"straight"===l.edgeType||"haystack"===l.edgeType){for(var w=l.allpts,E=0;E+3(r=i.sqdistToFiniteLine(e,t,w[E],w[E+1],w[E+2],w[E+3])))return o(n,r),!0}else if("bezier"===l.edgeType||"multibezier"===l.edgeType||"self"===l.edgeType||"compound"===l.edgeType)for(var w=l.allpts,E=0;E+5(r=i.sqdistToQuadraticBezier(e,t,w[E],w[E+1],w[E+2],w[E+3],w[E+4],w[E+5])))return o(n,r),!0;for(var b=b||a.source,x=x||a.target,P=h.getArrowWidth(u,c),C=[{name:"source",x:l.arrowStartX,y:l.arrowStartY,angle:l.srcArrowAngle},{name:"target",x:l.arrowEndX,y:l.arrowEndY,angle:l.tgtArrowAngle},{name:"mid-source",x:l.midX,y:l.midY,angle:l.midsrcArrowAngle},{name:"mid-target",x:l.midX,y:l.midY,angle:l.midtgtArrowAngle}],E=0;E0&&(s(b),s(x))}(P)||u(P)||u(P,"source")||u(P,"target")}return v},o.getAllInBox=function(e,t,n,r){var a=this.getCachedZSortedEles().interactive,o=[],s=Math.min(e,n),l=Math.max(e,n),u=Math.min(t,r),c=Math.max(t,r);e=s,n=l,t=u,r=c;for(var d=i.makeBoundingBox({x1:e,y1:t,x2:n,y2:r}),h=0;hm?m+"$-$"+y:y+"$-$"+m,v&&(t="unbundled$-$"+p.id);var b=s[t];null==b&&(b=s[t]=[],l.push(t)),b.push(d),v&&(b.hasUnbundled=!0),g&&(b.hasBezier=!0)}else u.push(d)}for(var x,w,E,P,C,S,T,D,k,_,M,I,N=0;Nw.id()){var z=x;x=w,w=z}E=x.position(),P=w.position(),C=x.outerWidth(),S=x.outerHeight(),T=w.outerWidth(),D=w.outerHeight(),k=n.nodeShapes[this.getNodeShape(x)],_=n.nodeShapes[this.getNodeShape(w)],I=!1;for(var d,L,A,O={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0},R=E.x,V=E.y,q=C,F=S,j=P.x,X=P.y,Y=T,W=D,H=B.length,c=0;c=s||w){h={cp:m,segment:x};break}}if(h)break}var m=h.cp,x=h.segment,E=(s-v)/x.length,P=x.t1-x.t0,C=o?x.t0+P*E:x.t1-P*E;C=r.bound(0,C,1),t=r.qbezierPtAt(m.p0,m.p1,m.p2,C),a=u(m.p0,m.p1,m.p2,C);break;case"straight":case"segments":case"haystack":for(var S,T,D,k,_=0,M=i.allpts.length,y=0;y+3=s));y+=2);var I=s-T,C=I/S;C=r.bound(0,C,1),t=r.lineAt(D,k,C),a=l(D,k)}d("labelX",n,t.x),d("labelY",n,t.y),d("labelAutoAngle",n,a)}};f("source"),f("target"),this.applyLabelDimensions(e)}},o.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))},o.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),i=this.calculateLabelDimensions(e,r);a.setPrefixedProperty(n.rstyle,"labelWidth",t,i.width),a.setPrefixedProperty(n.rscratch,"labelWidth",t,i.width),a.setPrefixedProperty(n.rstyle,"labelHeight",t,i.height),a.setPrefixedProperty(n.rscratch,"labelHeight",t,i.height)},o.getLabelText=function(e,t){var n=e._private,r=t?t+"-":"",i=e.pstyle(r+"label").strValue,o=e.pstyle("text-transform").value,s=function(e,r){return r?(a.setPrefixedProperty(n.rscratch,e,t,r),r):a.getPrefixedProperty(n.rscratch,e,t)};if(!i)return"";"none"==o||("uppercase"==o?i=i.toUpperCase():"lowercase"==o&&(i=i.toLowerCase()));var l=e.pstyle("text-wrap").value;if("wrap"===l){var u=s("labelKey");if(u&&s("labelWrapKey")===u)return s("labelWrapCachedText");for(var c=i.split("\n"),d=e.pstyle("text-max-width").pfValue,h=[],p=0;pd){for(var v=f.split(/\s+/),g="",y=0;yd)break;x+=i[E],E===i.length-1&&(w=!0)}return w||(x+="…"),x}return i},o.calculateLabelDimensions=function(e,t,n){var r=this,i=e._private.labelStyleKey+"$@$"+t;n&&(i+="$@$"+n);var a=r.labelDimCache||(r.labelDimCache={});if(a[i])return a[i];var o=e.pstyle("font-style").strValue,s=1*e.pstyle("font-size").pfValue+"px",l=e.pstyle("font-family").strValue,u=e.pstyle("font-weight").strValue,c=this.labelCalcDiv;c||(c=this.labelCalcDiv=document.createElement("div"),document.body.appendChild(c));var d=c.style;return d.fontFamily=l,d.fontStyle=o,d.fontSize=s,d.fontWeight=u,d.position="absolute",d.left="-9999px",d.top="-9999px",d.zIndex="-1",d.visibility="hidden",d.pointerEvents="none",d.padding="0",d.lineHeight="1","wrap"===e.pstyle("text-wrap").value?d.whiteSpace="pre":d.whiteSpace="normal",c.textContent=t,a[i]={width:Math.ceil(c.clientWidth/1),height:Math.ceil(c.clientHeight/1)},a[i]},o.calculateLabelAngles=function(e){var t=e._private,n=t.rscratch,r=e.isEdge(),i=e.pstyle("text-rotation"),a=i.strValue;"none"===a?n.labelAngle=n.sourceLabelAngle=n.targetLabelAngle=0:r&&"autorotate"===a?(n.labelAngle=n.labelAutoAngle,n.sourceLabelAngle=n.sourceLabelAutoAngle,n.targetLabelAngle=n.targetLabelAutoAngle):n.labelAngle=n.sourceLabelAngle=n.targetLabelAngle="autorotate"===a?0:i.pfValue},e.exports=o},function(e,t,n){"use strict";var r={};r.getNodeShape=function(e){var t=this,n=e.pstyle("shape").value;if(e.isParent())return"rectangle"===n||"roundrectangle"===n||"cutrectangle"===n||"barrel"===n?n:"rectangle";if("polygon"===n){var r=e.pstyle("shape-polygon-points").value;return t.nodeShapes.makePolygon(r).name}return n},e.exports=r},function(e,t,n){"use strict";var r={};r.registerCalculationListeners=function(){var e=this.cy,t=e.collection(),n=this,r=function(e,n){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];t.merge(e);for(var i=0;i=e.desktopTapThreshold2}var _=n(i);y&&(e.hoverData.tapholdCancelled=!0),s=!0,t(v,["mousemove","vmousemove","tapdrag"],i,{position:{x:d[0],y:d[1]}});var M=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||l.emit("boxstart"),f[4]=1,e.hoverData.selecting=!0,e.redrawHint("select",!0),e.redraw()};if(3===e.hoverData.which){if(y){var I={originalEvent:i,type:"cxtdrag",position:{x:d[0],y:d[1]}};x?x.emit(I):l.emit(I),e.hoverData.cxtDragged=!0,e.hoverData.cxtOver&&v===e.hoverData.cxtOver||(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit({originalEvent:i,type:"cxtdragout",position:{x:d[0],y:d[1]}}),e.hoverData.cxtOver=v,v&&v.emit({originalEvent:i,type:"cxtdragover",position:{x:d[0],y:d[1]}}))}}else if(e.hoverData.dragging){if(s=!0,l.panningEnabled()&&l.userPanningEnabled()){var N;if(e.hoverData.justStartedPan){var B=e.hoverData.mdownPos;N={x:(d[0]-B[0])*u,y:(d[1]-B[1])*u},e.hoverData.justStartedPan=!1}else N={x:w[0]*u,y:w[1]*u};l.panBy(N),e.hoverData.dragged=!0}d=e.projectIntoViewport(i.clientX,i.clientY)}else if(1!=f[4]||null!=x&&!x.isEdge()){if(x&&x.isEdge()&&x.active()&&x.unactivate(),x&&x.grabbed()||v==b||(b&&t(b,["mouseout","tapdragout"],i,{position:{x:d[0],y:d[1]}}),v&&t(v,["mouseover","tapdragover"],i,{position:{x:d[0],y:d[1]}}),e.hoverData.last=v),x)if(y){if(l.boxSelectionEnabled()&&_)x&&x.grabbed()&&(m(E),x.emit("free")),M();else if(x&&x.grabbed()&&e.nodeIsDraggable(x)){var z=!e.dragData.didDrag;z&&e.redrawHint("eles",!0),e.dragData.didDrag=!0;var L=[];e.hoverData.draggingEles||g(l.collection(E),{inDragLayer:!0});for(var A=0;A0&&e.redrawHint("eles",!0),e.dragData.possibleDragElements=l=[]),t(s,["mouseup","tapend","vmouseup"],r,{position:{x:a[0],y:a[1]}}),e.dragData.didDrag||e.hoverData.dragged||e.hoverData.selecting||e.hoverData.isOverThresholdDrag||t(u,["click","tap","vclick"],r,{position:{x:a[0],y:a[1]}}),s!=u||e.dragData.didDrag||e.hoverData.selecting||null!=s&&s._private.selectable&&(e.hoverData.dragging||("additive"===i.selectionType()||c?s.selected()?s.unselect():s.select():c||(i.$(":selected").unmerge(s).unselect(),s.select())),e.redrawHint("eles",!0)),e.hoverData.selecting){var p=i.collection(e.getAllInBox(o[0],o[1],o[2],o[3]));e.redrawHint("select",!0),p.length>0&&e.redrawHint("eles",!0),i.emit("boxend");var f=function(e){return e.selectable()&&!e.selected()};"additive"===i.selectionType()?p.emit("box").stdFilter(f).select().emit("boxselect"):(c||i.$(":selected").unmerge(p).unselect(),p.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()),!o[4]){e.redrawHint("drag",!0),e.redrawHint("eles",!0);var v=u&&u.grabbed();m(l),v&&u.emit("free")}}o[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 T=function(t){if(!e.scrollingPage){var n=e.cy,r=e.projectIntoViewport(t.clientX,t.clientY),i=[r[0]*n.zoom()+n.pan().x,r[1]*n.zoom()+n.pan().y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||C())return void t.preventDefault();if(n.panningEnabled()&&n.userPanningEnabled()&&n.zoomingEnabled()&&n.userZoomingEnabled()){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);var a;a=null!=t.deltaY?t.deltaY/-250:null!=t.wheelDeltaY?t.wheelDeltaY/1e3:t.wheelDelta/1e3,a*=e.wheelSensitivity;1===t.deltaMode&&(a*=33),n.zoom({level:n.zoom()*Math.pow(10,a),renderedPosition:{x:i[0],y:i[1]}})}}};e.registerBinding(e.container,"wheel",T,!0),e.registerBinding(window,"scroll",function(t){e.scrollingPage=!0,clearTimeout(e.scrollingPageTimeout),e.scrollingPageTimeout=setTimeout(function(){e.scrollingPage=!1},250)},!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 D,k,_,M,I,N,B,z,L,A,O,R,V,q,F=function(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))},j=function(e,t,n,r){return(n-e)*(n-e)+(r-t)*(r-t)};e.registerBinding(e.container,"touchstart",q=function(n){if(S(n)){x(),e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var r=e.cy,i=e.touchData.now,a=e.touchData.earlier;if(n.touches[0]){var o=e.projectIntoViewport(n.touches[0].clientX,n.touches[0].clientY);i[0]=o[0],i[1]=o[1]}if(n.touches[1]){var o=e.projectIntoViewport(n.touches[1].clientX,n.touches[1].clientY);i[2]=o[0],i[3]=o[1]}if(n.touches[2]){var o=e.projectIntoViewport(n.touches[2].clientX,n.touches[2].clientY);i[4]=o[0],i[5]=o[1]}if(n.touches[1]){m(e.dragData.touchDragEles);var s=e.findContainerClientCoords();L=s[0],A=s[1],O=s[2],R=s[3],D=n.touches[0].clientX-L,k=n.touches[0].clientY-A,_=n.touches[1].clientX-L,M=n.touches[1].clientY-A,V=0<=D&&D<=O&&0<=_&&_<=O&&0<=k&&k<=R&&0<=M&&M<=R;var l=r.pan(),u=r.zoom();I=F(D,k,_,M),N=j(D,k,_,M),B=[(D+_)/2,(k+M)/2],z=[(B[0]-l.x)/u,(B[1]-l.y)/u];if(N<4e4&&!n.touches[2]){var c=e.findNearestElement(i[0],i[1],!0,!0),d=e.findNearestElement(i[2],i[3],!0,!0);return c&&c.isNode()?(c.activate().emit({originalEvent:n,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=c):d&&d.isNode()?(d.activate().emit({originalEvent:n,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=d):r.emit({originalEvent:n,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(n.touches[2]);else if(n.touches[1]);else if(n.touches[0]){var p=e.findNearestElements(i[0],i[1],!0,!0),f=p[0];if(null!=f&&(f.activate(),e.touchData.start=f,e.touchData.starts=p,e.nodeIsGrabbable(f))){var v=e.dragData.touchDragEles=[],b=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),f.selected()?(b=r.$(function(t){return t.selected()&&e.nodeIsGrabbable(t)}),g(b,{addToList:v})):y(f,{addToList:v}),h(f);var w=function(e){return{originalEvent:n,type:e,position:{x:i[0],y:i[1]}}};f.emit(w("grabon")),b?b.forEach(function(e){e.emit(w("grab"))}):f.emit(w("grab"))}t(f,["touchstart","tapstart","vmousedown"],n,{position:{x:i[0],y:i[1]}}),null==f&&(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||(t(e.touchData.start,["taphold"],n,{position:{x:i[0],y:i[1]}}),e.touchData.start||r.$(":selected").unselect())},e.tapholdDuration)}if(n.touches.length>=1){for(var E=e.touchData.startPosition=[],P=0;P=e.touchTapThreshold2}if(i&&e.touchData.cxt){n.preventDefault();var E=n.touches[0].clientX-L,P=n.touches[0].clientY-A,C=n.touches[1].clientX-L,T=n.touches[1].clientY-A,B=j(E,P,C,T),O=B/N;if(O>=2.25||B>=22500){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var R={originalEvent:n,type:"cxttapend",position:{x:u[0],y:u[1]}};e.touchData.start?(e.touchData.start.unactivate().emit(R),e.touchData.start=null):l.emit(R)}}if(i&&e.touchData.cxt){var R={originalEvent:n,type:"cxtdrag",position:{x:u[0],y:u[1]}};e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.touchData.start?e.touchData.start.emit(R):l.emit(R),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var q=e.findNearestElement(u[0],u[1],!0,!0);e.touchData.cxtOver&&q===e.touchData.cxtOver||(e.touchData.cxtOver&&e.touchData.cxtOver.emit({originalEvent:n,type:"cxtdragout",position:{x:u[0],y:u[1]}}),e.touchData.cxtOver=q,q&&q.emit({originalEvent:n,type:"cxtdragover",position:{x:u[0],y:u[1]}}))}else if(i&&n.touches[2]&&l.boxSelectionEnabled())n.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||l.emit("boxstart"),e.touchData.selecting=!0,e.redrawHint("select",!0),s&&0!==s.length&&void 0!==s[0]?(s[2]=(u[0]+u[2]+u[4])/3,s[3]=(u[1]+u[3]+u[5])/3):(s[0]=(u[0]+u[2]+u[4])/3,s[1]=(u[1]+u[3]+u[5])/3,s[2]=(u[0]+u[2]+u[4])/3+1,s[3]=(u[1]+u[3]+u[5])/3+1),s[4]=1,e.touchData.selecting=!0,e.redraw();else if(i&&n.touches[1]&&l.zoomingEnabled()&&l.panningEnabled()&&l.userZoomingEnabled()&&l.userPanningEnabled()){n.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var X=e.dragData.touchDragEles;if(X){e.redrawHint("drag",!0);for(var Y=0;Y0&&!e.hoverData.draggingEles&&!e.swipePanning&&null!=e.data.bgActivePosistion&&(e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.redraw())}},!1);var Y;e.registerBinding(window,"touchcancel",Y=function(t){var n=e.touchData.start;e.touchData.capture=!1,n&&n.unactivate()});var W;if(e.registerBinding(window,"touchend",W=function(n){var r=e.touchData.start;if(e.touchData.capture){0===n.touches.length&&(e.touchData.capture=!1),n.preventDefault();var i=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var a=e.cy,o=a.zoom(),s=e.touchData.now,l=e.touchData.earlier;if(n.touches[0]){var u=e.projectIntoViewport(n.touches[0].clientX,n.touches[0].clientY);s[0]=u[0],s[1]=u[1]}if(n.touches[1]){var u=e.projectIntoViewport(n.touches[1].clientX,n.touches[1].clientY);s[2]=u[0],s[3]=u[1]}if(n.touches[2]){var u=e.projectIntoViewport(n.touches[2].clientX,n.touches[2].clientY);s[4]=u[0],s[5]=u[1]}r&&r.unactivate();var c;if(e.touchData.cxt){if(c={originalEvent:n,type:"cxttapend",position:{x:s[0],y:s[1]}},r?r.emit(c):a.emit(c),!e.touchData.cxtDragged){var d={originalEvent:n,type:"cxttap",position:{x:s[0],y:s[1]}};r?r.emit(d):a.emit(d)}return e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!1,e.touchData.start=null,void e.redraw()}if(!n.touches[2]&&a.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=!1;var h=a.collection(e.getAllInBox(i[0],i[1],i[2],i[3]));i[0]=void 0,i[1]=void 0,i[2]=void 0,i[3]=void 0,i[4]=0,e.redrawHint("select",!0),a.emit("boxend");var p=function(e){return e.selectable()&&!e.selected()};h.emit("box").stdFilter(p).select().emit("boxselect"),h.nonempty()&&e.redrawHint("eles",!0),e.redraw()}if(null!=r&&r.unactivate(),n.touches[2])e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);else if(n.touches[1]);else if(n.touches[0]);else if(!n.touches[0]){e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var f=e.dragData.touchDragEles;if(null!=r){var v=r._private.grabbed;m(f),e.redrawHint("drag",!0),e.redrawHint("eles",!0),v&&r.emit("free"),t(r,["touchend","tapend","vmouseup","tapdragout"],n,{position:{x:s[0],y:s[1]}}),r.unactivate(),e.touchData.start=null}else{var g=e.findNearestElement(s[0],s[1],!0,!0);t(g,["touchend","tapend","vmouseup","tapdragout"],n,{position:{x:s[0],y:s[1]}})}var y=e.touchData.startPosition[0]-s[0],b=y*y,x=e.touchData.startPosition[1]-s[1],w=x*x,E=b+w,P=E*o*o;null!=r&&!e.dragData.didDrag&&r._private.selectable&&P0)return v[0]}return null}(e,t,v);if(null!=g){var y=v[5],m=v[3],b=v[1],x=r.qbezierAt(y,m,b,g);if(v.isTop&&x<=t)return!0;if(v.isBottom&&t<=x)return!0}}return!1}}},i.generateBottomRoundrectangle=function(){return this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottomroundrectangle",points:r.generateUnitNgonPointsFitToSquare(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,i,a,o,s){var l=e-(n/2+s),u=t-(i/2+s),c=u,d=e+(n/2+s),h=r.finiteLinesIntersect(a,o,e,t,l,u,d,c,!1);return h.length>0?h:r.roundRectangleIntersectLine(a,o,e,t,n,i,s)},checkPoint:function(e,t,n,i,a,o,s){var l=r.getRoundRectangleRadius(i,a),u=2*l;if(r.pointInsidePolygon(e,t,this.points,o,s,i,a-u,[0,-1],n))return!0;if(r.pointInsidePolygon(e,t,this.points,o,s,i-u,a,[0,-1],n))return!0;var c=i/2+2*n,d=a/2+2*n,h=[o-c,s-d,o-c,s,o+c,s,o+c,s-d];return!!r.pointInsidePolygonPoints(e,t,h)||(!!r.checkInEllipse(e,t,u,u,o+i/2-l,s+a/2-l,n)||!!r.checkInEllipse(e,t,u,u,o-i/2+l,s+a/2-l,n))}}},i.registerNodeShapes=function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",r.generateUnitNgonPointsFitToSquare(3,0)),this.generatePolygon("rectangle",r.generateUnitNgonPointsFitToSquare(4,0)),e.square=e.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle(),this.generatePolygon("diamond",[0,1,1,0,0,-1,-1,0]),this.generatePolygon("pentagon",r.generateUnitNgonPointsFitToSquare(5,0)),this.generatePolygon("hexagon",r.generateUnitNgonPointsFitToSquare(6,0)),this.generatePolygon("heptagon",r.generateUnitNgonPointsFitToSquare(7,0)),this.generatePolygon("octagon",r.generateUnitNgonPointsFitToSquare(8,0));var n=new Array(20),i=r.generateUnitNgonPoints(5,0),a=r.generateUnitNgonPoints(5,Math.PI/5),o=.5*(3-Math.sqrt(5));o*=1.57;for(var s=0;s0&&t.data.lyrTxrCache.invalidateElements(n)})}var i=n(1),a=n(0),o=n(125),s=n(126),l=r,u=r.prototype;u.CANVAS_LAYERS=3,u.SELECT_BOX=0,u.DRAG=1,u.NODE=2,u.BUFFER_COUNT=3,u.TEXTURE_BUFFER=0,u.MOTIONBLUR_BUFFER_NODE=1,u.MOTIONBLUR_BUFFER_DRAG=2,u.redrawHint=function(e,t){var n=this;switch(e){case"eles":n.data.canvasNeedsRedraw[u.NODE]=t;break;case"drag":n.data.canvasNeedsRedraw[u.DRAG]=t;break;case"select":n.data.canvasNeedsRedraw[u.SELECT_BOX]=t}};var c="undefined"!=typeof Path2D;u.path2dEnabled=function(e){if(void 0===e)return this.pathsEnabled;this.pathsEnabled=!!e},u.usePaths=function(){return c&&this.pathsEnabled},[n(127),n(128),n(129),n(130),n(131),n(132),n(133),n(134),n(135),n(136)].forEach(function(e){i.extend(u,e)}),e.exports=l},function(e,t,n){"use strict";var r=n(2),i=n(1),a=n(9),o=n(19),s={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},l=function(e){var t=this;t.renderer=e,t.onDequeues=[],t.setupDequeueing()},u=l.prototype;u.reasons=s,u.getTextureQueue=function(e){var t=this;return t.eleImgCaches=t.eleImgCaches||{},t.eleImgCaches[e]=t.eleImgCaches[e]||[]},u.getRetiredTextureQueue=function(e){var t=this,n=t.eleImgCaches.retired=t.eleImgCaches.retired||{};return n[e]=n[e]||[]},u.getElementQueue=function(){var e=this;return e.eleCacheQueue=e.eleCacheQueue||new a(function(e,t){return t.reqs-e.reqs})},u.getElementIdToQueue=function(){var e=this;return e.eleIdToCacheQueue=e.eleIdToCacheQueue||{}},u.getElement=function(e,t,n,i,a){var o=this,l=this.renderer,u=e._private.rscratch,c=l.cy.zoom();if(0===t.w||0===t.h||!e.visible())return null;if(null==i&&(i=Math.ceil(r.log2(c*n))),i<-4)i=-4;else if(c>=3.99||i>2)return null;var d=Math.pow(2,i),h=t.h*d,p=t.w*d,f=u.imgCaches=u.imgCaches||{},v=f[i];if(v)return v;var g;if(g=h<=25?25:h<=50?50:50*Math.ceil(h/50),h>1024||p>1024||e.isEdge()||e.isParent())return null;var y=o.getTextureQueue(g),m=y[y.length-2],b=function(){return o.recycleTexture(g,p)||o.addTexture(g,p)};m||(m=y[y.length-1]),m||(m=b()),m.width-m.usedWidthi;T--)k=o.getElement(e,t,n,T,s.downscale);_()}else{var M;if(!P&&!C&&!S)for(var T=i-1;T>=-4;T--){var D=f[T];if(D){M=D;break}}if(E(M))return o.queueElement(e,i),M;m.context.translate(m.usedWidth,0),m.context.scale(d,d),l.drawElement(m.context,e,t,w),m.context.scale(1/d,1/d),m.context.translate(-m.usedWidth,0)}return v=f[i]={ele:e,x:m.usedWidth,texture:m,level:i,scale:d,width:p,height:h,scaledLabelShown:w},m.usedWidth+=Math.ceil(p+8),m.eleCaches.push(v),o.checkTextureFullness(m),v},u.invalidateElement=function(e){var t=this,n=e._private.rscratch.imgCaches;if(n)for(var r=-4;r<=2;r++){var a=n[r];if(a){var o=a.texture;o.invalidatedWidth+=a.width,n[r]=null,i.removeFromArray(o.eleCaches,a),t.removeFromQueue(e),t.checkTextureUtility(o)}}},u.checkTextureUtility=function(e){e.invalidatedWidth>=.5*e.width&&this.retireTexture(e)},u.checkTextureFullness=function(e){var t=this,n=t.getTextureQueue(e.height);e.usedWidth/e.width>.8&&e.fullnessChecks>=10?i.removeFromArray(n,e):e.fullnessChecks++},u.retireTexture=function(e){var t=this,n=e.height,r=t.getTextureQueue(n);i.removeFromArray(r,e),e.retired=!0;for(var a=e.eleCaches,o=0;o=t)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,i.clearArray(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),i.removeFromArray(a,s),r.push(s),s}},u.queueElement=function(e,t){var n=this,r=n.getElementQueue(),i=n.getElementIdToQueue(),a=e.id(),o=i[a];if(o)o.level=Math.max(o.level,t),o.reqs++,r.updateItem(o);else{var s={ele:e,level:t,reqs:1};r.push(s),i[a]=s}},u.dequeue=function(e){for(var t=this,n=t.getElementQueue(),r=t.getElementIdToQueue(),i=[],a=0;a<1&&n.size()>0;a++){var o=n.pop(),l=o.ele;if(null==l._private.rscratch.imgCaches[o.level]){r[l.id()]=null,i.push(o);var u=l.boundingBox();t.getElement(l,u,e,o.level,s.dequeue)}}return i},u.removeFromQueue=function(e){var t=this,n=t.getElementQueue(),r=t.getElementIdToQueue(),a=r[e.id()];null!=a&&(a.reqs=i.MAX_INT,n.updateItem(a),n.pop(),r[e.id()]=null)},u.onDequeue=function(e){this.onDequeues.push(e)},u.offDequeue=function(e){i.removeFromArray(this.onDequeues,e)},u.setupDequeueing=o.setupDequeueing({deqRedrawThreshold:100,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n=3.99||n>2)return null;r.validateLayersElesOrdering(n,e);var c,d,h=r.layersByLevel,p=Math.pow(2,n),f=h[n]=h[n]||[],v=r.levelIsComplete(n,e);if(v)return f;!function(){var t=function(t){if(r.validateLayersElesOrdering(t,e),r.levelIsComplete(t,e))return d=h[t],!0},a=function(e){if(!d)for(var r=n+e;-4<=r&&r<=2&&!t(r);r+=e);};a(1),a(-1);for(var o=f.length-1;o>=0;o--){var s=f[o];s.invalid&&i.removeFromArray(f,s)}}();var g=function(){if(!c){c=a.makeBoundingBox();for(var t=0;t=m||!a.boundingBoxInBoundingBox(y.bb,w.boundingBox()))&&!(y=function(e){e=e||{};var t=e.after;if(g(),c.w*p*(c.h*p)>16e6)return null;var i=r.makeLayer(c,n);if(null!=t){var a=f.indexOf(t)+1;f.splice(a,0,i)}else(void 0===e.insert||e.insert)&&f.unshift(i);return i}({insert:!0,after:y})))return null;d||b?r.queueLayer(y,w):r.drawEleInLayer(y,w,n,t),y.eles.push(w),P[n]=y}}return d||(b?null:f)},c.getEleLevelForLayerLevel=function(e,t){return e},c.drawEleInLayer=function(e,t,n,i){var a=this,o=this.renderer,s=e.context,l=t.boundingBox();if(0!==l.w&&0!==l.h&&t.visible()){var u=a.eleTxrCache,c=u.reasons.highQuality;n=a.getEleLevelForLayerLevel(n,i);var d=u.getElement(t,l,null,n,c);d?(r(s,!1),s.drawImage(d.texture.canvas,d.x,0,d.width,d.height,l.x1,l.y1,l.w,l.h),r(s,!0)):o.drawElement(s,t)}},c.levelIsComplete=function(e,t){var n=this,r=n.layersByLevel[e];if(!r||0===r.length)return!1;for(var i=0,a=0;a0)return!1;if(o.invalid)return!1;i+=o.eles.length}return i===t.length},c.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var r=0;r0){t=!0;break}}return t},c.invalidateElements=function(e){var t=this;t.lastInvalidationTime=i.performanceNow(),0!==e.length&&t.haveLayers()&&t.updateElementsInLayers(e,function(e,n,r){t.invalidateLayer(e)})},c.invalidateLayer=function(e){if(this.lastInvalidationTime=i.performanceNow(),!e.invalid){var t=e.level,n=e.eles,r=this.layersByLevel[t];i.removeFromArray(r,e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:p;e.lineWidth=v,e.lineCap="butt",i.strokeStyle(e,h[0],h[1],h[2],n),i.drawEdgePath(t,e,a.allpts,f)},y=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p;i.drawArrowheads(e,t,n)};e.lineJoin="round";if("yes"===t.pstyle("ghost").value){var m=t.pstyle("ghost-offset-x").pfValue,b=t.pstyle("ghost-offset-y").pfValue,x=t.pstyle("ghost-opacity").value,w=p*x;e.translate(m,b),g(w),y(w),e.translate(-m,-b)}g(),y(),function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c;e.lineWidth=u,"self"!==a.edgeType||o?e.lineCap="round":e.lineCap="butt",i.strokeStyle(e,d[0],d[1],d[2],n),i.drawEdgePath(t,e,a.allpts,"solid")}(),function(){i.drawElementText(e,t,r)}(),n&&e.translate(s.x1,s.y1)}},r.drawEdgePath=function(e,t,n,r){var i=e._private.rscratch,a=t,o=void 0,s=!1,l=this.usePaths();if(l){var u=n.join("$");i.pathCacheKey&&i.pathCacheKey===u?(o=t=i.pathCache,s=!0):(o=t=new Path2D,i.pathCacheKey=u,i.pathCache=o)}if(a.setLineDash)switch(r){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash([6,3]);break;case"solid":a.setLineDash([])}if(!s&&!i.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(n[0],n[1]),i.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var c=2;c+30||T>0&&S>0){var k=l-D;switch(m){case"left":k-=h;break;case"center":k-=h/2}var _=u-p-D,M=h+2*D,I=p+2*D;if(C>0){var N=e.fillStyle,B=t.pstyle("text-background-color").value;e.fillStyle="rgba("+B[0]+","+B[1]+","+B[2]+","+C*s+")";"roundrectangle"==t.pstyle("text-background-shape").strValue?r(e,k,_,M,I,2):e.fillRect(k,_,M,I),e.fillStyle=N}if(T>0&&S>0){var z=e.strokeStyle,L=e.lineWidth,A=t.pstyle("text-border-color").value,O=t.pstyle("text-border-style").value;if(e.strokeStyle="rgba("+A[0]+","+A[1]+","+A[2]+","+S*s+")",e.lineWidth=T,e.setLineDash)switch(O){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(k,_,M,I),"double"===O){var R=T/2;e.strokeRect(k+R,_+R,M-2*R,I-2*R)}e.setLineDash&&e.setLineDash([]),e.lineWidth=L,e.strokeStyle=z}}var V=2*t.pstyle("text-outline-width").pfValue;if(V>0&&(e.lineWidth=V),"wrap"===t.pstyle("text-wrap").value){var q=i.getPrefixedProperty(o,"labelWrapCachedLines",n),F=p/q.length;switch(b){case"top":u-=(q.length-1)*F;break;case"center":case"bottom":u-=(q.length-1)*F}for(var j=0;j0&&e.strokeText(q[j],l,u),e.fillText(q[j],l,u),u+=F}else V>0&&e.strokeText(c,l,u),e.fillText(c,l,u);0!==x&&(e.rotate(-x),e.translate(-E,-P))}}},e.exports=o},function(e,t,n){"use strict";var r=n(0),i={};i.drawNode=function(e,t,n,i){var a=this,o=void 0,s=void 0,l=t._private,u=l.rscratch,c=t.position();if(r.number(c.x)&&r.number(c.y)&&t.visible()){var d=t.effectiveOpacity(),h=a.usePaths(),p=void 0,f=!1,v=t.padding();o=t.width()+2*v,s=t.height()+2*v;var g=void 0;n&&(g=n,e.translate(-g.x1,-g.y1));for(var y=t.pstyle("background-image"),m=y.value,b=new Array(m.length),x=new Array(m.length),w=0,E=0;E0&&void 0!==arguments[0]?arguments[0]:k;a.fillStyle(e,D[0],D[1],D[2],t)},B=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:I;a.strokeStyle(e,_[0],_[1],_[2],t)},z=t.pstyle("shape").strValue,L=t.pstyle("shape-polygon-points").pfValue;if(h){var A=z+"$"+o+"$"+s+("polygon"===z?"$"+L.join("$"):"");e.translate(c.x,c.y),u.pathCacheKey===A?(p=u.pathCache,f=!0):(p=new Path2D,u.pathCacheKey=A,u.pathCache=p)}var O=function(){if(!f){var n=c;h&&(n={x:0,y:0}),a.nodeShapes[a.getNodeShape(t)].draw(p||e,n.x,n.y,o,s)}h?e.fill(p):e.fill()},R=function(){for(var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d,r=l.backgrounding,i=0,o=0;o0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d;a.hasPie(t)&&(a.drawPie(e,t,r),n&&(h||a.nodeShapes[a.getNodeShape(t)].draw(e,c.x,c.y,o,s)))},q=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d,n=(S>0?S:-S)*t,r=S>0?0:255;0!==S&&(a.fillStyle(e,r,r,r,n),h?e.fill(p):e.fill())},F=function(){if(T>0){if(e.lineWidth=T,e.lineCap="butt",e.setLineDash)switch(M){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([])}if(h?e.stroke(p):e.stroke(),"double"===M){e.lineWidth=T/3;var t=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",h?e.stroke(p):e.stroke(),e.globalCompositeOperation=t}e.setLineDash&&e.setLineDash([])}};if("yes"===t.pstyle("ghost").value){var j=t.pstyle("ghost-offset-x").pfValue,X=t.pstyle("ghost-offset-y").pfValue,Y=t.pstyle("ghost-opacity").value,W=Y*d;e.translate(j,X),N(Y*k),O(),R(W),V(0!==S||0!==T),q(W),B(Y*I),F(),e.translate(-j,-X)}N(),O(),R(),V(0!==S||0!==T),q(),B(),F(),h&&e.translate(-c.x,-c.y),function(){a.drawElementText(e,t,i)}(),function(){var n=t.pstyle("overlay-padding").pfValue,r=t.pstyle("overlay-opacity").value,i=t.pstyle("overlay-color").value;r>0&&(a.fillStyle(e,i[0],i[1],i[2],r),a.nodeShapes.roundrectangle.draw(e,c.x,c.y,o+2*n,s+2*n),e.fill())}(),n&&e.translate(g.x1,g.y1)}},i.hasPie=function(e){return e=e[0],e._private.hasPie},i.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,d=0;this.usePaths()&&(o=0,s=0),"%"===a.units?c*=a.pfValue:void 0!==a.pfValue&&(c=a.pfValue/2);for(var h=1;h<=i.pieBackgroundN;h++){var p=t.pstyle("pie-"+h+"-background-size").value,f=t.pstyle("pie-"+h+"-background-color").value,v=t.pstyle("pie-"+h+"-background-opacity").value*n,g=p/100;g+d>1&&(g=1-d);var y=1.5*Math.PI+2*Math.PI*d,m=2*Math.PI*g,b=y+m;0===p||d>=1||d+g>1||(e.beginPath(),e.moveTo(o,s),e.arc(o,s,c,y,b),e.closePath(),this.fillStyle(e,f[0],f[1],f[2],v),e.fill(),d+=g)}},e.exports=i},function(e,t,n){"use strict";var r={},i=n(1);r.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},r.paintCache=function(e){for(var t,n=this.paintCaches=this.paintCaches||[],r=!0,i=0;iu.minMbLowQualFrames&&(u.motionBlurPxRatio=u.mbPxRBlurry)),u.clearingMotionBlur&&(u.motionBlurPxRatio=1),u.textureDrawLastFrame&&!f&&(p[u.NODE]=!0,p[u.SELECT_BOX]=!0);var w=d.style()._private.coreStyle,E=d.zoom(),P=void 0!==s?s:E,C=d.pan(),S={x:C.x,y:C.y},T={zoom:E,pan:{x:C.x,y:C.y}},D=u.prevViewport;void 0===D||T.zoom!==D.zoom||T.pan.x!==D.pan.x||T.pan.y!==D.pan.y||m&&!y||(u.motionBlurPxRatio=1),l&&(S=l),P*=c,S.x*=c,S.y*=c;var k=u.getCachedZSortedEles();if(f||(u.textureDrawLastFrame=!1),f){u.textureDrawLastFrame=!0;if(!u.textureCache){u.textureCache={},u.textureCache.bb=d.mutableElements().boundingBox(),u.textureCache.texture=u.data.bufferCanvases[u.TEXTURE_BUFFER];var _=u.data.bufferContexts[u.TEXTURE_BUFFER];_.setTransform(1,0,0,1,0,0),_.clearRect(0,0,u.canvasWidth*u.textureMult,u.canvasHeight*u.textureMult),u.render({forcedContext:_,drawOnlyNodeLayer:!0,forcedPxRatio:c*u.textureMult});var T=u.textureCache.viewport={zoom:d.zoom(),pan:d.pan(),width:u.canvasWidth,height:u.canvasHeight};T.mpan={x:(0-T.pan.x)/T.zoom,y:(0-T.pan.y)/T.zoom}}p[u.DRAG]=!1,p[u.NODE]=!1;var M=h.contexts[u.NODE],I=u.textureCache.texture,T=u.textureCache.viewport;u.textureCache.bb,M.setTransform(1,0,0,1,0,0),v?t(M,0,0,T.width,T.height):M.clearRect(0,0,T.width,T.height);var N=w["outside-texture-bg-color"].value,B=w["outside-texture-bg-opacity"].value;u.fillStyle(M,N[0],N[1],N[2],B),M.fillRect(0,0,T.width,T.height);var E=d.zoom();n(M,!1),M.clearRect(T.mpan.x,T.mpan.y,T.width/T.zoom/c,T.height/T.zoom/c),M.drawImage(I,T.mpan.x,T.mpan.y,T.width/T.zoom/c,T.height/T.zoom/c)}else u.textureOnViewport&&!r&&(u.textureCache=null);var z=d.extent(),L=u.pinching||u.hoverData.dragging||u.swipePanning||u.data.wheelZooming||u.hoverData.draggingEles,A=u.hideEdgesOnViewport&&L,O=[];if(O[u.NODE]=!p[u.NODE]&&v&&!u.clearedForMotionBlur[u.NODE]||u.clearingMotionBlur,O[u.NODE]&&(u.clearedForMotionBlur[u.NODE]=!0),O[u.DRAG]=!p[u.DRAG]&&v&&!u.clearedForMotionBlur[u.DRAG]||u.clearingMotionBlur,O[u.DRAG]&&(u.clearedForMotionBlur[u.DRAG]=!0),p[u.NODE]||a||o||O[u.NODE]){var R=v&&!O[u.NODE]&&1!==g,M=r||(R?u.data.bufferContexts[u.MOTIONBLUR_BUFFER_NODE]:h.contexts[u.NODE]);n(M,v&&!R?"motionBlur":void 0),A?u.drawCachedNodes(M,k.nondrag,c,z):u.drawLayeredElements(M,k.nondrag,c,z),u.debug&&u.drawDebugPoints(M,k.nondrag),a||v||(p[u.NODE]=!1)}if(!o&&(p[u.DRAG]||a||O[u.DRAG])){var R=v&&!O[u.DRAG]&&1!==g,M=r||(R?u.data.bufferContexts[u.MOTIONBLUR_BUFFER_DRAG]:h.contexts[u.DRAG]);n(M,v&&!R?"motionBlur":void 0),A?u.drawCachedNodes(M,k.drag,c,z):u.drawCachedElements(M,k.drag,c,z),u.debug&&u.drawDebugPoints(M,k.drag),a||v||(p[u.DRAG]=!1)}if(u.showFps||!o&&p[u.SELECT_BOX]&&!a){var M=r||h.contexts[u.SELECT_BOX];if(n(M),1==u.selection[4]&&(u.hoverData.selecting||u.touchData.selecting)){var E=u.cy.zoom(),V=w["selection-box-border-width"].value/E;M.lineWidth=V,M.fillStyle="rgba("+w["selection-box-color"].value[0]+","+w["selection-box-color"].value[1]+","+w["selection-box-color"].value[2]+","+w["selection-box-opacity"].value+")",M.fillRect(u.selection[0],u.selection[1],u.selection[2]-u.selection[0],u.selection[3]-u.selection[1]),V>0&&(M.strokeStyle="rgba("+w["selection-box-border-color"].value[0]+","+w["selection-box-border-color"].value[1]+","+w["selection-box-border-color"].value[2]+","+w["selection-box-opacity"].value+")",M.strokeRect(u.selection[0],u.selection[1],u.selection[2]-u.selection[0],u.selection[3]-u.selection[1]))}if(h.bgActivePosistion&&!u.hoverData.selecting){var E=u.cy.zoom(),q=h.bgActivePosistion;M.fillStyle="rgba("+w["active-bg-color"].value[0]+","+w["active-bg-color"].value[1]+","+w["active-bg-color"].value[2]+","+w["active-bg-opacity"].value+")",M.beginPath(),M.arc(q.x,q.y,w["active-bg-size"].pfValue/E,0,2*Math.PI),M.fill()}var F=u.lastRedrawTime;if(u.showFps&&F){F=Math.round(F);var j=Math.round(1e3/F);M.setTransform(1,0,0,1,0,0),M.fillStyle="rgba(255, 0, 0, 0.75)",M.strokeStyle="rgba(255, 0, 0, 0.75)",M.lineWidth=1,M.fillText("1 frame = "+F+" ms = "+j+" fps",0,20);M.strokeRect(0,30,250,20),M.fillRect(0,30,250*Math.min(j/60,1),20)}a||(p[u.SELECT_BOX]=!1)}if(v&&1!==g){var X=h.contexts[u.NODE],Y=u.data.bufferCanvases[u.MOTIONBLUR_BUFFER_NODE],W=h.contexts[u.DRAG],H=u.data.bufferCanvases[u.MOTIONBLUR_BUFFER_DRAG],Z=function(e,n,r){e.setTransform(1,0,0,1,0,0),r||!x?e.clearRect(0,0,u.canvasWidth,u.canvasHeight):t(e,0,0,u.canvasWidth,u.canvasHeight);var i=g;e.drawImage(n,0,0,u.canvasWidth*i,u.canvasHeight*i,0,0,u.canvasWidth,u.canvasHeight)};(p[u.NODE]||O[u.NODE])&&(Z(X,Y,O[u.NODE]),p[u.NODE]=!1),(p[u.DRAG]||O[u.DRAG])&&(Z(W,H,O[u.DRAG]),p[u.DRAG]=!1)}u.prevViewport=T,u.clearingMotionBlur&&(u.clearingMotionBlur=!1,u.motionBlurCleared=!0,u.motionBlur=!0),v&&(u.motionBlurTimeout=setTimeout(function(){u.motionBlurTimeout=null,u.clearedForMotionBlur[u.NODE]=!1,u.clearedForMotionBlur[u.DRAG]=!1,u.motionBlur=!1,u.clearingMotionBlur=!f,u.mbFrames=0,p[u.NODE]=!0,p[u.DRAG]=!0,u.redraw()},100)),r||d.emit("render")},e.exports=r},function(e,t,n){"use strict";var r=n(2),i={};i.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;l0&&s>0){f.clearRect(0,0,a,s),f.globalCompositeOperation="source-over";var v=this.getCachedZSortedEles();if(e.full)f.translate(-r.x1*c,-r.y1*c),f.scale(c,c),this.drawElements(f,v),f.scale(1/c,1/c),f.translate(r.x1*c,r.y1*c);else{var g=t.pan(),y={x:g.x*c,y:g.y*c};c*=t.zoom(),f.translate(y.x,y.y),f.scale(c,c),this.drawElements(f,v),f.scale(1/c,1/c),f.translate(-y.x,-y.y)}e.bg&&(f.globalCompositeOperation="destination-over",f.fillStyle=e.bg,f.rect(0,0,a,s),f.fill())}return p},s.png=function(e){return a(e,this.bufferCanvasImage(e),"image/png")},s.jpg=function(e){return a(e,this.bufferCanvasImage(e),"image/jpeg")},e.exports=s},function(e,t,n){"use strict";var r={};r.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"roundrectangle":return this.drawRoundRectanglePath(t,n,r,i,a);case"cutrectangle":return this.drawCutRectanglePath(t,n,r,i,a);case"bottomroundrectangle":return this.drawBottomRoundRectanglePath(t,n,r,i,a);case"barrel":return this.drawBarrelPath(t,n,r,i,a)}},e.exports=r},function(e,t,n){"use strict";var r=n(0),i=n(1),a=n(18),o=function e(){if(!(this instanceof e))return new e;this.length=0},s=o.prototype;s.instanceString=function(){return"stylesheet"},s.selector=function(e){return this[this.length++]={selector:e,properties:[]},this},s.css=function(e,t){var n=this.length-1;if(r.string(e))this[n].properties.push({name:e,value:t});else if(r.plainObject(e))for(var o=e,s=0;s>>0},oe=function(e){return(33*(1>>0},se=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return ie({next:function(){return r>1])<0;)e[n]=a,n=o;return e[n]=i},h=function(e,t,n){var r,i,a,o,s;for(null==n&&(n=d),i=e.length,a=e[s=t],r=2*t+1;rD&&(p[S]=D,y[S]=C,m[S]=x),!r){var T=C*u+k;!r&&p[T]>D&&(p[T]=D,y[T]=k,m[T]=x)}}}for(var P=0;P=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&&0<=e.w&&0<=e.h)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},ot=function(e){var t=1t.x2)&&(!(t.x1>e.x2)&&(!(e.x2t.y2)&&!(t.y1>e.y2)))))))},ct=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},ht=function(e,t){return ct(e,t.x1,t.y1)&&ct(e,t.x2,t.y2)},dt=function(e,t,n,r,i,a,o){var s,l=Tt(i,a),u=i/2,c=a/2,h=r-c-o;if(0<(s=wt(e,t,n,r,n-u+l-o,h,n+u-l+o,h,!1)).length)return s;var d=n+u+o;if(0<(s=wt(e,t,n,r,d,r-c+l-o,d,r+c-l+o,!1)).length)return s;var p=r+c+o;if(0<(s=wt(e,t,n,r,n-u+l-o,p,n+u-l+o,p,!1)).length)return s;var f,g=n-u-o;if(0<(s=wt(e,t,n,r,g,r-c+l-o,g,r+c-l+o,!1)).length)return s;var v=n-u+l,y=r-c+l;if(0<(f=bt(e,t,n,r,v,y,l+o)).length&&f[0]<=v&&f[1]<=y)return[f[0],f[1]];var m=n+u-l,b=r-c+l;if(0<(f=bt(e,t,n,r,m,b,l+o)).length&&f[0]>=m&&f[1]<=b)return[f[0],f[1]];var x=n+u-l,w=r+c-l;if(0<(f=bt(e,t,n,r,x,w,l+o)).length&&f[0]>=x&&f[1]>=w)return[f[0],f[1]];var E=n-u+l,k=r+c-l;return 0<(f=bt(e,t,n,r,E,k,l+o)).length&&f[0]<=E&&f[1]>=k?[f[0],f[1]]:[]},pt=function(e,t,n,r,i,a,o,s){var l,u,c,h,d,p,f,g,v,y,m,b,x,w=[];u=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,c=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,h=1*n*i-n*n+n*e-i*e+r*a-r*r+r*t-a*t,g=-27*(h/=l=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)+(u/=l)*(9*(c/=l)-u*u*2),p=(f=(3*c-u*u)/9)*f*f+(g/=54)*g,b=u/3,((d=w)[1]=0)a[u]+f&&(a[h]=a[u]+f,o.nodes.indexOf(h)<0?o.push(h):o.updateItem(h),i[h]=0,r[h]=[]),a[h]==a[u]+f&&(i[h]=i[h]+i[u],r[h].push(u))}else for(var g=0;gi&&(i=t[l][u],a=u);o[a].push(e[l])}for(var c=0;c=i.threshold||"dendrogram"===i.mode&&1===e.length)return!1;var p,f=t[o],g=t[r[o]];p="dendrogram"===i.mode?{left:f,right:g,key:f.key}:{value:f.value.concat(g.value),key:f.key},e[f.index]=p,e.splice(g.index,1),t[f.key]=p;for(var v=0;vn[g.key][y.key]&&(a=n[g.key][y.key])):"max"===i.linkage?(a=n[f.key][y.key],n[f.key][y.key]o&&(o=t[i*e+(a=l)])}0=u.minIterations-1||E==u.maxIterations-1)){for(var F=0,V=0;V\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:'"(?:\\\\"|[^"])*"|'+"'(?:\\\\'|[^'])*'",number:W,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};jn.variable="(?:[\\w-]|(?:\\\\"+jn.metaChar+"))+",jn.value=jn.string+"|"+jn.number,jn.className=jn.variable,jn.id=jn.variable,function(){var e,t,n;for(e=jn.comparatorOp.split("|"),n=0;n")+v(e.child,t);case ur:case sr:return v(e.ancestor,t)+" "+v(e.descendant,t);case cr:var c=v(e.left,t),h=v(e.subject,t),d=v(e.right,t);return c+(0":h=!0,r=n=":h=!0,r=n<=e;break;case"<":h=!0,r=ee.x2?r:e.x2,e.y1=ne.y2?i:e.y2)},Gr=function(e,t){return Kr(e,t.x1,t.y1,t.x2,t.y2)},Zr=function(e,t,n){return De(e,t,n)},Ur=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){i="source"===n?(r=o.srcX,o.srcY):"target"===n?(r=o.tgtX,o.tgtY):(r=o.midX,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,ot(u,1),Kr(e,u.x1,u.y1,u.x2,u.y2)}}},$r=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=Zr(a,"labelWidth",n),p=Zr(a,"labelHeight",n),f=Zr(a,"labelX",n),g=Zr(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,k=p+2*E,C=d+2*E,S=C/2,D=k/2;if(m)o=f-S,s=f+S,l=g-D,u=g+D;else{switch(c.value){case"left":o=f-C,s=f;break;case"center":o=f-S,s=f+S;break;case"right":s=(o=f)+C}switch(h.value){case"top":l=g-k,u=g;break;case"center":l=g-D,u=g+D;break;case"bottom":u=(l=g)+k}}o+=v-Math.max(x,w),s+=v+Math.max(x,w),l+=y-Math.max(x,w),u+=y+Math.max(x,w);var T=n||"main",P=i.labelBounds,M=P[T]=P[T]||{};M.x1=o,M.y1=l,M.x2=s,M.y2=u,M.w=s-o,M.h=u-l,ot(M,1);var _=m&&"autorotate"===b.strValue,B=null!=b.pfValue&&0!==b.pfValue;if(_||B){var N=_?Zr(i.rstyle,"labelAngle",n):b.pfValue,I=Math.cos(N),A=Math.sin(N),L=(o+s)/2,z=(l+u)/2;if(!m){switch(c.value){case"left":L=s;break;case"right":L=o}switch(h.value){case"top":z=u;break;case"bottom":z=l}}var O=function(e,t){return{x:(e-=L)*I-(t-=z)*A+L,y:e*A+t*I+z}},R=O(o,l),F=O(o,u),V=O(s,l),q=O(s,u);o=Math.min(R.x,F.x,V.x,q.x),s=Math.max(R.x,F.x,V.x,q.x),l=Math.min(R.y,F.y,V.y,q.y),u=Math.max(R.y,F.y,V.y,q.y)}Kr(e,o,l,s,u),Kr(i.labelBounds.all,o,l,s,u)}return e}},Qr=function(e){var t=0,n=function(e){return(e?1:0)<u&&++at.length?i.substr(t.length):""}function o(){n=n.length>r.length?n.substr(r.length):""}for(i=i.replace(/[/][*](\s|.)+?[*][/]/g,"");;){if(i.match(/^\s*$/))break;var s=i.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!s){be("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+i);break}t=s[0];var l=s[1];if("core"!==l)if(new Cr(l).invalid){be("Skipping parsing of block: Invalid selector found in string stylesheet: "+l),a();continue}var u=s[2],c=!1;n=u;for(var h=[];;){if(n.match(/^\s*$/))break;var d=n.match(/^\s*(.+?)\s*:\s*(.+?)\s*;/);if(!d){be("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+u),c=!0;break}r=d[0];var p=d[1],f=d[2];if(this.properties[p])this.parse(p,f)?h.push({name:p,val:f}):be("Skipping property: Invalid property definition in: "+r),o();else be("Skipping property: Invalid property name in: "+r),o()}if(c){a();break}this.selector(l);for(var g=0;gc.max||c.strictMax&&n===c.max))return null;var N={name:t,value:n,strValue:""+n+(P||""),units:P,bypass:r};return c.unitless||"px"!==P&&"em"!==P?N.pfValue=n:N.pfValue="px"!==P&&P?this.getEmSizeInPixels()*n:n,"ms"!==P&&"s"!==P||(N.pfValue="ms"===P?n:1e3*n),"deg"!==P&&"rad"!==P||(N.pfValue="rad"===P?n:(S=n,Math.PI*S/180)),"%"===P&&(N.pfValue=n/100),N}if(c.propList){var I=[],A=""+n;if("none"===A);else{for(var L=A.split(/\s*,\s*|\s+/),z=0;zthis._private.maxZoom?this._private.maxZoom:o)=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),$t(e)?n=e:B(e)&&(n=e.level,null!=e.position?t=Ze(e.position,a,i):null!=e.renderedPosition&&(t=e.renderedPosition),null==t||r.panningEnabled||(o=!0)),n=(n=n>r.maxZoom?r.maxZoom:n)t.maxZoom||!t.zoomingEnabled?a=!0:(t.zoom=s,i.push("zoom"))}if(r&&(!a||!e.cancelOnFailedZoom)&&t.panningEnabled){var l=e.pan;$t(l.x)&&(t.pan.x=l.x,o=!1),$t(l.y)&&(t.pan.y=l.y,o=!1),o||i.push("pan")}return 0i.maxX)&&(i.maxX=t.maxX+i.padRight,a=!0),(null==i.minX||t.minX-i.padLefti.maxY)&&(i.maxY=t.maxY+i.padBottom,a=!0),(null==i.minY||t.minY-i.padTop(g=ee,v=te,y=K[G],m=K[G+1],b=K[G+2],x=K[G+3],void 0,C=(w=[g-y,v-m])[0]*w[0]+w[1]*w[1],D=(S=w[0]*(E=[b-y,x-m])[0]+w[1]*E[1])*S/(k=E[0]*E[0]+E[1]*E[1]),t=S<0?C:k(t=pt(ee,te,K[G],K[G+1],K[G+2],K[G+3],K[G+4],K[G+5])))return se(e,t),!0;W=W||R.source,H=H||R.target;var Z=ne.getArrowWidth(V,q),U=[{name:"source",x:F.arrowStartX,y:F.arrowStartY,angle:F.srcArrowAngle},{name:"target",x:F.arrowEndX,y:F.arrowEndY,angle:F.tgtArrowAngle},{name:"mid-source",x:F.midX,y:F.midY,angle:F.midsrcArrowAngle},{name:"mid-target",x:F.midX,y:F.midY,angle:F.midtgtArrowAngle}];for(G=0;Gr.id()){var B=n;n=r,r=B}i=n.position(),a=r.position(),o=n.outerWidth(),s=n.outerHeight(),l=r.outerWidth(),u=r.outerHeight(),c=this.nodeShapes[this.getNodeShape(n)],h=this.nodeShapes[this.getNodeShape(r)],p=!1;var N={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0},I=i.x,A=i.y,L=o,z=s,O=a.x,R=a.y,F=l,V=u,q=M.length;for(b=0;b=q.desktopTapThreshold2}var b=B(e);c&&(q.hoverData.tapholdCancelled=!0);t=!0,Y(u,["mousemove","vmousemove","tapdrag"],e,{x:a[0],y:a[1]});var x,w=function(){q.data.bgActivePosistion=void 0,q.hoverData.selecting||n.emit({originalEvent:e,type:"boxstart",position:{x:a[0],y:a[1]}}),l[4]=1,q.hoverData.selecting=!0,q.redrawHint("select",!0),q.redraw()};if(3===q.hoverData.which){if(c){var E={originalEvent:e,type:"cxtdrag",position:{x:a[0],y:a[1]}};d?d.emit(E):n.emit(E),q.hoverData.cxtDragged=!0,q.hoverData.cxtOver&&u===q.hoverData.cxtOver||(q.hoverData.cxtOver&&q.hoverData.cxtOver.emit({originalEvent:e,type:"cxtdragout",position:{x:a[0],y:a[1]}}),(q.hoverData.cxtOver=u)&&u.emit({originalEvent:e,type:"cxtdragover",position:{x:a[0],y:a[1]}}))}}else if(q.hoverData.dragging){if(t=!0,n.panningEnabled()&&n.userPanningEnabled()){var k;if(q.hoverData.justStartedPan){var C=q.hoverData.mdownPos;k={x:(a[0]-C[0])*r,y:(a[1]-C[1])*r},q.hoverData.justStartedPan=!1}else k={x:p[0]*r,y:p[1]*r};n.panBy(k),q.hoverData.dragged=!0}a=q.projectIntoViewport(e.clientX,e.clientY)}else if(1!=l[4]||null!=d&&!d.isEdge()){if(d&&d.isEdge()&&d.active()&&d.unactivate(),d&&d.grabbed()||u==h||(h&&Y(h,["mouseout","tapdragout"],e,{x:a[0],y:a[1]}),u&&Y(u,["mouseover","tapdragover"],e,{x:a[0],y:a[1]}),q.hoverData.last=u),d)if(c){if(n.boxSelectionEnabled()&&b)d&&d.grabbed()&&(W(f),d.emit("freeon"),f.emit("free"),q.dragData.didDrag&&(d.emit("dragfreeon"),f.emit("dragfree"))),w();else if(d&&d.grabbed()&&q.nodeIsDraggable(d)){var S=!q.dragData.didDrag;S&&q.redrawHint("eles",!0),q.dragData.didDrag=!0;var D=n.collection();q.hoverData.draggingEles||j(f,{inDragLayer:!0});var T={x:0,y:0};if($t(p[0])&&$t(p[1])&&(T.x+=p[0],T.y+=p[1],S)){var P=q.hoverData.dragDelta;P&&$t(P[0])&&$t(P[1])&&(T.x+=P[0],T.y+=P[1])}for(var M=0;M=q.touchTapThreshold2}if(t&&q.touchData.cxt){e.preventDefault();var g=e.touches[0].clientX-ee,v=e.touches[0].clientY-te,y=e.touches[1].clientX-ee,m=e.touches[1].clientY-te,b=ie(g,v,y,m);if(2.25<=b/Q||22500<=b){q.touchData.cxt=!1,q.data.bgActivePosistion=void 0,q.redrawHint("select",!0);var x={originalEvent:e,type:"cxttapend",position:{x:i[0],y:i[1]}};q.touchData.start?(q.touchData.start.unactivate().emit(x),q.touchData.start=null):r.emit(x)}}if(t&&q.touchData.cxt){x={originalEvent:e,type:"cxtdrag",position:{x:i[0],y:i[1]}};q.data.bgActivePosistion=void 0,q.redrawHint("select",!0),q.touchData.start?q.touchData.start.emit(x):r.emit(x),q.touchData.start&&(q.touchData.start._private.grabbed=!1),q.touchData.cxtDragged=!0;var w=q.findNearestElement(i[0],i[1],!0,!0);q.touchData.cxtOver&&w===q.touchData.cxtOver||(q.touchData.cxtOver&&q.touchData.cxtOver.emit({originalEvent:e,type:"cxtdragout",position:{x:i[0],y:i[1]}}),(q.touchData.cxtOver=w)&&w.emit({originalEvent:e,type:"cxtdragover",position:{x:i[0],y:i[1]}}))}else if(t&&e.touches[2]&&r.boxSelectionEnabled())e.preventDefault(),q.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,q.touchData.selecting||r.emit({originalEvent:e,type:"boxstart",position:{x:i[0],y:i[1]}}),q.touchData.selecting=!0,q.redrawHint("select",!0),n&&0!==n.length&&void 0!==n[0]?(n[2]=(i[0]+i[2]+i[4])/3,n[3]=(i[1]+i[3]+i[5])/3):(n[0]=(i[0]+i[2]+i[4])/3,n[1]=(i[1]+i[3]+i[5])/3,n[2]=(i[0]+i[2]+i[4])/3+1,n[3]=(i[1]+i[3]+i[5])/3+1),n[4]=1,q.touchData.selecting=!0,q.redraw();else if(t&&e.touches[1]&&r.zoomingEnabled()&&r.panningEnabled()&&r.userZoomingEnabled()&&r.userPanningEnabled()){if(e.preventDefault(),q.data.bgActivePosistion=void 0,q.redrawHint("select",!0),L=q.dragData.touchDragEles){q.redrawHint("drag",!0);for(var E=0;E=y.deqFastCost*h)break}else if(e){if(u>=y.deqCost*i||u>=y.deqAvgCost*r)break}else if(c>=y.deqNoDrawCost*Lo)break;var d=y.deq(f,s,o);if(!(0=.2*e.width&&this.retireTexture(e)},qo.checkTextureFullness=function(e){var t=this.getTextureQueue(e.height);.8=t)return a.retired=!1,a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,Qt(a.eleCaches),a.context.setTransform(1,0,0,1,0,0),a.context.clearRect(0,0,a.width,a.height),Se(r,a),n.push(a),a}},qo.queueElement=function(e,t){var n=this.getElementQueue(),r=this.getElementKeyToQueue(),i=this.getKey(e),a=r[i];if(a)a.level=Math.max(a.level,t),a.eles.merge(e),a.reqs++,n.updateItem(a);else{var o={eles:e.spawn().merge(e),level:t,reqs:1,key:i};n.push(o),r[i]=o}},qo.dequeue=function(e){for(var t=this.getElementQueue(),n=this.getElementKeyToQueue(),r=[],i=this.lookup,a=0;a<1&&0=p||!ht(d.bb,v.boundingBox()))&&!(d=r({insert:!0,after:d})))return null;l||f?o.queueLayer(d,v):o.drawEleInLayer(d,v,a,e),d.eles.push(v),m[a]=d}}return l||(f?null:h)},Xo.getEleLevelForLayerLevel=function(e,t){return e},Xo.drawEleInLayer=function(e,t,n,r){var i=this.renderer,a=e.context,o=t.boundingBox();0!==o.w&&0!==o.h&&t.visible()&&(n=this.getEleLevelForLayerLevel(n,r),i.setImgSmoothing(a,!1),i.drawCachedElement(a,t,null,null,n,!0),i.setImgSmoothing(a,!0))},Xo.levelIsComplete=function(e,t){var n=this.layersByLevel[e];if(!n||0===n.length)return!1;for(var r=0,i=0;ic.minMbLowQualFrames&&(c.motionBlurPxRatio=c.mbPxRBlurry)),c.clearingMotionBlur&&(c.motionBlurPxRatio=1),c.textureDrawLastFrame&&!a&&(i[c.NODE]=!0,i[c.SELECT_BOX]=!0);var m=r.style(),b=r.zoom(),x=void 0!==l?l:b,w=r.pan(),E={x:w.x,y:w.y},k={zoom:b,pan:{x:w.x,y:w.y}},C=c.prevViewport;void 0===C||k.zoom!==C.zoom||k.pan.x!==C.pan.x||k.pan.y!==C.pan.y||g&&!f||(c.motionBlurPxRatio=1),u&&(E=u),x*=n,E.x*=n,E.y*=n;var S=c.getCachedZSortedEles();function D(e,t,n,r,i){var a=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",c.colorFillStyle(e,255,255,255,c.motionBlurTransparency),e.fillRect(t,n,r,i),e.globalCompositeOperation=a}function T(e,t){var n,r,i,a;a=c.clearingMotionBlur||e!==h.bufferContexts[c.MOTIONBLUR_BUFFER_NODE]&&e!==h.bufferContexts[c.MOTIONBLUR_BUFFER_DRAG]?(n=E,r=x,i=c.canvasWidth,c.canvasHeight):(n={x:w.x*p,y:w.y*p},r=b*p,i=c.canvasWidth*p,c.canvasHeight*p),e.setTransform(1,0,0,1,0,0),"motionBlur"===t?D(e,0,0,i,a):o||void 0!==t&&!t||e.clearRect(0,0,i,a),s||(e.translate(n.x,n.y),e.scale(r,r)),u&&e.translate(u.x,u.y),l&&e.scale(l,l)}if(a||(c.textureDrawLastFrame=!1),a){if(c.textureDrawLastFrame=!0,!c.textureCache){c.textureCache={},c.textureCache.bb=r.mutableElements().boundingBox(),c.textureCache.texture=c.data.bufferCanvases[c.TEXTURE_BUFFER];var P=c.data.bufferContexts[c.TEXTURE_BUFFER];P.setTransform(1,0,0,1,0,0),P.clearRect(0,0,c.canvasWidth*c.textureMult,c.canvasHeight*c.textureMult),c.render({forcedContext:P,drawOnlyNodeLayer:!0,forcedPxRatio:n*c.textureMult}),(k=c.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:c.canvasWidth,height:c.canvasHeight}).mpan={x:(0-k.pan.x)/k.zoom,y:(0-k.pan.y)/k.zoom}}i[c.DRAG]=!1,i[c.NODE]=!1;var M=h.contexts[c.NODE],_=c.textureCache.texture;k=c.textureCache.viewport;M.setTransform(1,0,0,1,0,0),d?D(M,0,0,k.width,k.height):M.clearRect(0,0,k.width,k.height);var B=m.core("outside-texture-bg-color").value,N=m.core("outside-texture-bg-opacity").value;c.colorFillStyle(M,B[0],B[1],B[2],N),M.fillRect(0,0,k.width,k.height);b=r.zoom();T(M,!1),M.clearRect(k.mpan.x,k.mpan.y,k.width/k.zoom/n,k.height/k.zoom/n),M.drawImage(_,k.mpan.x,k.mpan.y,k.width/k.zoom/n,k.height/k.zoom/n)}else c.textureOnViewport&&!o&&(c.textureCache=null);var I=r.extent(),A=c.pinching||c.hoverData.dragging||c.swipePanning||c.data.wheelZooming||c.hoverData.draggingEles,L=c.hideEdgesOnViewport&&A,z=[];if(z[c.NODE]=!i[c.NODE]&&d&&!c.clearedForMotionBlur[c.NODE]||c.clearingMotionBlur,z[c.NODE]&&(c.clearedForMotionBlur[c.NODE]=!0),z[c.DRAG]=!i[c.DRAG]&&d&&!c.clearedForMotionBlur[c.DRAG]||c.clearingMotionBlur,z[c.DRAG]&&(c.clearedForMotionBlur[c.DRAG]=!0),i[c.NODE]||s||t||z[c.NODE]){var O=d&&!z[c.NODE]&&1!==p;T(M=o||(O?c.data.bufferContexts[c.MOTIONBLUR_BUFFER_NODE]:h.contexts[c.NODE]),d&&!O?"motionBlur":void 0),L?c.drawCachedNodes(M,S.nondrag,n,I):c.drawLayeredElements(M,S.nondrag,n,I),c.debug&&c.drawDebugPoints(M,S.nondrag),s||d||(i[c.NODE]=!1)}if(!t&&(i[c.DRAG]||s||z[c.DRAG])){O=d&&!z[c.DRAG]&&1!==p;T(M=o||(O?c.data.bufferContexts[c.MOTIONBLUR_BUFFER_DRAG]:h.contexts[c.DRAG]),d&&!O?"motionBlur":void 0),L?c.drawCachedNodes(M,S.drag,n,I):c.drawCachedElements(M,S.drag,n,I),c.debug&&c.drawDebugPoints(M,S.drag),s||d||(i[c.DRAG]=!1)}if(c.showFps||!t&&i[c.SELECT_BOX]&&!s){if(T(M=o||h.contexts[c.SELECT_BOX]),1==c.selection[4]&&(c.hoverData.selecting||c.touchData.selecting)){b=c.cy.zoom();var R=m.core("selection-box-border-width").value/b;M.lineWidth=R,M.fillStyle="rgba("+m.core("selection-box-color").value[0]+","+m.core("selection-box-color").value[1]+","+m.core("selection-box-color").value[2]+","+m.core("selection-box-opacity").value+")",M.fillRect(c.selection[0],c.selection[1],c.selection[2]-c.selection[0],c.selection[3]-c.selection[1]),0 Date: Tue, 15 Jan 2019 13:57:18 +0100 Subject: [PATCH 2/4] fix url for out.WorkflowGraph.php --- views/bootstrap/class.TriggerWorkflow.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/bootstrap/class.TriggerWorkflow.php b/views/bootstrap/class.TriggerWorkflow.php index 4ed56f449..b9a89bbd5 100644 --- a/views/bootstrap/class.TriggerWorkflow.php +++ b/views/bootstrap/class.TriggerWorkflow.php @@ -120,7 +120,7 @@ $(document).ready(function() {
- +
Date: Tue, 15 Jan 2019 13:57:33 +0100 Subject: [PATCH 3/4] add item for 5.1.10 --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 8d2d724cb..b5c0d0aab 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -19,6 +19,7 @@ - added Slim-Framework for a simple router - move most of the login code into a controller, added more hooks in login process - failed login is reported in log file +- update of cytoscape library, fix output of workflow on TriggerWorkflowGraph -------------------------------------------------------------------------------- Changes in version 5.1.9 From 1f8f7d350a1aeac50b2c56e46457a566a932843d Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 15 Jan 2019 13:58:10 +0100 Subject: [PATCH 4/4] .htaccess needed for new router code --- .htaccess | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .htaccess diff --git a/.htaccess b/.htaccess new file mode 100644 index 000000000..4a74b071d --- /dev/null +++ b/.htaccess @@ -0,0 +1,21 @@ +RewriteEngine On +# Store the current location in an environment variable CWD to use +# mod_rewrite in .htaccess files without knowing the RewriteBase +RewriteCond $0#%{REQUEST_URI} ([^#]*)#(.*)\1$ +RewriteRule ^.*$ - [E=CWD:%2] + +# Anything below the following dirs will never be rewritten +RewriteRule "^pdfviewer/.*$" "-" [L] +RewriteRule "^views/bootstrap/images.*$" "-" [L] +RewriteRule "^out/images.*$" "-" [L] +RewriteRule "^styles/.*$" "-" [L] + +# Accessing a file in an extension is always possible +# Added for old extensions which do not use routes +RewriteCond %{REQUEST_FILENAME} -f +RewriteRule "^ext/.*$" "-" [L] + +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d +RewriteCond %{REQUEST_FILENAME} !-l +RewriteRule ^.*$ %{ENV:CWD}index.php [QSA,L]