(function(){var o=!!!document.createElement("canvas").getContext;var s=!!document.createElement("canvas").getContext;var d=!!window.SVGAngle||document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");var a=!(s|d);var l=function(y,z,w,C){var B=function(F,E){if(F===E){return true}else{if(typeof F=="object"&&typeof E=="object"){var G=true;for(var D in F){if(!B(F[D],E[D])){G=false;break}}for(var D in E){if(!B(E[D],F[D])){G=false;break}}return G}}};for(var A=+w||0,x=y.length;A=0){delete (ax[ay]);ax.splice(ay,1);return true}}}return false},w=function(ay,ax){return J(ay,function(az,aA){ag[aA]=ax;if(i.CurrentLibrary.isDragSupported(az)){i.CurrentLibrary.setDraggable(az,ax)}})},ao=function(ax,ay){V(c(ax,"id"),function(az){az.canvas.style.display=ay})},O=function(ax){return J(ax,function(az,ay){var aA=ag[ay]==null?Y:ag[ay];aA=!aA;ag[ay]=aA;i.CurrentLibrary.setDraggable(az,aA);return aA})},y=function(ax){V(ax,function(az){var ay=("none"==az.canvas.style.display);az.canvas.style.display=ay?"block":"none"})},F=function(aC){var aA=aC.timestamp,ax=aC.recalc,aB=aC.offset,ay=aC.elId;if(!ax){if(aA&&aA===D[ay]){return}}if(ax||aB==null){var az=v(ay);if(az!=null){Q[ay]=b(az);W[ay]=n(az);D[ay]=aA}}else{W[ay]=aB}},aw=function(ax,ay){var az=v(ax);var aA=c(az,"id");if(!aA||aA=="undefined"){if(arguments.length==2&&arguments[1]!=undefined){aA=ay}else{aA="jsPlumb_"+ar()}e(az,"id",aA)}return aA},am=function(az,ax,ay){az=az||function(){};ax=ax||function(){};return function(){var aA=null;try{aA=ax.apply(this,arguments)}catch(aB){k(E,"jsPlumb function failed : "+aB)}if(ay==null||(aA!==ay)){try{az.apply(this,arguments)}catch(aB){k(E,"wrapped function failed : "+aB)}}return aA}};this.connectorClass="_jsPlumb_connector";this.endpointClass="_jsPlumb_endpoint";this.overlayClass="_jsPlumb_overlay";this.Anchors={};this.Connectors={canvas:{},svg:{},vml:{}};this.Endpoints={canvas:{},svg:{},vml:{}};this.Overlays={canvas:{},svg:{},vml:{}};this.addEndpoint=function(az,aA,aJ){aJ=aJ||{};var ay=i.extend({},aJ);i.extend(ay,aA);ay.endpoint=ay.endpoint||E.Defaults.Endpoint||i.Defaults.Endpoint;ay.paintStyle=ay.paintStyle||E.Defaults.EndpointStyle||i.Defaults.EndpointStyle;az=x(az);var aB=[],aE=az.length&&az.constructor!=String?az:[az];for(var aC=0;aC0?l(aK,aJ)!=-1:true},aB=aE.length>1?{}:[],aH=function(aK,aL){if(aE.length>1){var aJ=aB[aK];if(aJ==null){aJ=[];aB[aK]=aJ}aJ.push(aL)}else{aB.push(aL)}};for(var aA in M){if(ay(aE,aA)){for(var az=0;az=4){ay.orientation=[arguments[2],arguments[3]]}if(arguments.length==6){ay.offsets=[arguments[4],arguments[5]]}}var aD=new ac(ay);aD.clone=function(){return new ac(ay)};return aD};this.makeAnchors=function(ay){var az=[];for(var ax=0;ax0?aG[0]:null;var aC=aG.length>0?0:-1;this.locked=false;var aF=this;var aB=function(aJ,aH,aN,aM,aI){var aL=aM[0]+(aJ.x*aI[0]),aK=aM[1]+(aJ.y*aI[1]);return Math.sqrt(Math.pow(aH-aL,2)+Math.pow(aN-aK,2))};var ax=ay||function(aR,aI,aJ,aK,aH){var aM=aJ[0]+(aK[0]/2),aL=aJ[1]+(aK[1]/2);var aO=-1,aQ=Infinity;for(var aN=0;aNaX){aX=a4}}var a8=this.connector.compute(aZ,ba,this.endpoints[be].anchor,this.endpoints[aW].anchor,aI.paintStyleInUse.lineWidth,aX);aI.connector.paint(a8,aI.paintStyleInUse);for(var a9=0;a9=0){aM.connections.splice(aY,1);if(!a1){var a0=aZ.endpoints[0]==aM?aZ.endpoints[1]:aZ.endpoints[0];a0.detach(aZ,true);if(aZ.endpointToDeleteOnDetach&&aZ.endpointToDeleteOnDetach.connections.length==0){i.deleteEndpoint(aZ.endpointToDeleteOnDetach)}}R(aZ.connector.getDisplayElements(),aZ.parent);N(M,aZ.scope,aZ);if(!a1){ad(aZ)}}};this.detachAll=function(){while(aM.connections.length>0){aM.detach(aM.connections[0])}};this.detachFrom=function(aZ){var a0=[];for(var aY=0;aY=0){aM.connections.splice(aY,1)}};this.getElement=function(){return aL};this.getUuid=function(){return aH};this.makeInPlaceCopy=function(){return an({anchor:aM.anchor,source:aL,paintStyle:this.paintStyle,endpoint:aK})};this.isConnectedTo=function(a0){var aZ=false;if(a0){for(var aY=0;aY0){var a8=aM.connections[0];var ba=a8.endpoints[0]==aM?1:0;var a3=ba==0?a8.sourceId:a8.targetId;var a7=W[a3],a9=Q[a3];aZ.txy=[a7.left,a7.top];aZ.twh=a9;aZ.tElement=a8.endpoints[ba]}}a4=aM.anchor.compute(aZ)}var a6=aK.compute(a4,aM.anchor.getOrientation(),aM.paintStyleInUse,a2||aM.paintStyleInUse);aK.paint(a6,aM.paintStyleInUse,aM.anchor);aM.timestamp=a5}};this.repaint=this.paint;this.removeConnection=this.detach;if(aX.isSource&&i.CurrentLibrary.isDragSupported(aL)){var aR=null,aN=null,aQ=null,ax=false,aA=null;var aC=function(){aQ=aM.connectorSelector();if(aM.isFull()&&!aI){return false}F({elId:aE});aB=aM.makeInPlaceCopy();aB.paint();aR=document.createElement("div");aR.style.position="absolute";var a5=v(aR);S(aR,aM.parent);var aY=aw(a5);var a6=v(aB.canvas),a4=i.CurrentLibrary.getOffset(a6),a1=i.CurrentLibrary.getSize(a6);i.CurrentLibrary.setOffset(aR,a4);F({elId:aY});e(v(aM.canvas),"dragId",aY);e(v(aM.canvas),"elId",aE);var a7=new I({reference:aM.anchor,referenceCanvas:aM.canvas});aV=an({paintStyle:aM.paintStyle,endpoint:aK,anchor:a7,source:a5});if(aQ==null){aM.anchor.locked=true;aQ=au({sourceEndpoint:aM,targetEndpoint:aV,source:v(aL),target:v(aR),anchors:[aM.anchor,a7],paintStyle:aX.connectorStyle,hoverPaintStyle:aX.connectorHoverStyle,connector:aX.connector,overlays:aX.connectorOverlays});aQ.connector.setHover(false)}else{ax=true;aQ.connector.setHover(false);aD(v(aB.canvas));var aZ=aQ.sourceId==aE?0:1;aQ.floatingAnchorIndex=aZ;aM.detachFromConnection(aQ);var a3=v(aM.canvas);var a2=i.CurrentLibrary.getDragScope(a3);e(a3,"originalScope",a2);var a0="scope_"+(new Date()).getTime();if(aZ==0){aA=[aQ.source,aQ.sourceId,aU,a2];aQ.source=v(aR);aQ.sourceId=aY}else{aA=[aQ.target,aQ.targetId,aU,a2];aQ.target=v(aR);aQ.targetId=aY}i.CurrentLibrary.setDragScope(aU,a0);aQ.endpoints[aZ==0?1:0].anchor.locked=true;aQ.suspendedEndpoint=aQ.endpoints[aZ];aQ.endpoints[aZ]=aV}Z[aY]=aQ;aV.addConnection(aQ);T(ah,aY,aV);E.currentlyDragging=true};var ay=i.CurrentLibrary,aT=aX.dragOptions||{},aO=i.extend({},ay.defaultDragOptions),aP=ay.dragEvents.start,aW=ay.dragEvents.stop,aG=ay.dragEvents.drag;aT=i.extend(aO,aT);aT.scope=aT.scope||aM.scope;aT[aP]=am(aT[aP],aC);aT[aG]=am(aT[aG],function(){var aY=i.CurrentLibrary.getUIPosition(arguments);i.CurrentLibrary.setOffset(aR,aY);at(v(aR),aY)});aT[aW]=am(aT[aW],function(){N(ah,aN,aV);R([aR,aV.canvas],aL);ae(aB.canvas,aL);var aY=aQ.floatingAnchorIndex==null?1:aQ.floatingAnchorIndex;aQ.endpoints[aY==0?1:0].anchor.locked=false;if(aQ.endpoints[aY]==aV){if(ax&&aQ.suspendedEndpoint){if(aY==0){aQ.source=aA[0];aQ.sourceId=aA[1]}else{aQ.target=aA[0];aQ.targetId=aA[1]}i.CurrentLibrary.setDragScope(aA[2],aA[3]);aQ.endpoints[aY]=aQ.suspendedEndpoint;if(aJ){aQ.floatingAnchorIndex=null;aQ.suspendedEndpoint.addConnection(aQ);i.repaint(aA[1])}else{aQ.endpoints[aY==0?1:0].detach(aQ)}}else{R(aQ.connector.getDisplayElements(),aM.parent);aM.detachFromConnection(aQ)}}aM.anchor.locked=false;aM.paint();aQ.setHover(false);aQ.repaint();aQ=null;delete aB;delete ah[aV.elementId];aV=null;delete aV;E.currentlyDragging=false});var aU=v(aM.canvas);i.CurrentLibrary.initDraggable(aU,aT)}var aD=function(a1){if(aX.isTarget&&i.CurrentLibrary.isDropSupported(aL)){var aY=aX.dropOptions||E.Defaults.DropOptions||i.Defaults.DropOptions;aY=i.extend({},aY);aY.scope=aY.scope||aM.scope;var a4=null;var a2=i.CurrentLibrary.dragEvents.drop;var a3=i.CurrentLibrary.dragEvents.over;var aZ=i.CurrentLibrary.dragEvents.out;var a0=function(){var bd=v(i.CurrentLibrary.getDragObject(arguments));var a5=c(bd,"dragId");var a7=c(bd,"elId");var bc=c(bd,"originalScope");if(bc){i.CurrentLibrary.setDragScope(bd,bc)}var a9=Z[a5];var ba=a9.floatingAnchorIndex==null?1:a9.floatingAnchorIndex,bb=ba==0?1:0;if(!aM.isFull()&&!(ba==0&&!aM.isSource)&&!(ba==1&&!aM.isTarget)){if(ba==0){a9.source=aL;a9.sourceId=aE}else{a9.target=aL;a9.targetId=aE}a9.endpoints[ba].detachFromConnection(a9);if(a9.suspendedEndpoint){a9.suspendedEndpoint.detachFromConnection(a9)}a9.endpoints[ba]=aM;aM.addConnection(a9);if(!a9.suspendedEndpoint){T(M,a9.scope,a9);P(aL,aX.draggable,{})}else{var a8=a9.suspendedEndpoint.getElement(),a6=a9.suspendedEndpoint.elementId;E.fire("jsPlumbConnectionDetached",{source:ba==0?a8:a9.source,target:ba==1?a8:a9.target,sourceId:ba==0?a6:a9.sourceId,targetId:ba==1?a6:a9.targetId,sourceEndpoint:ba==0?a9.suspendedEndpoint:a9.endpoints[0],targetEndpoint:ba==1?a9.suspendedEndpoint:a9.endpoints[1],connection:a9})}i.repaint(a7);E.fire("jsPlumbConnection",{source:a9.source,target:a9.target,sourceId:a9.sourceId,targetId:a9.targetId,sourceEndpoint:a9.endpoints[0],targetEndpoint:a9.endpoints[1],connection:a9})}E.currentlyDragging=false;delete Z[a5]};aY[a2]=am(aY[a2],a0);aY[a3]=am(aY[a3],function(){var a6=i.CurrentLibrary.getDragObject(arguments);var a8=c(v(a6),"dragId");var a7=Z[a8];if(a7!=null){var a5=a7.floatingAnchorIndex==null?1:a7.floatingAnchorIndex;a7.endpoints[a5].anchor.over(aM.anchor)}});aY[aZ]=am(aY[aZ],function(){var a6=i.CurrentLibrary.getDragObject(arguments),a8=c(v(a6),"dragId"),a7=Z[a8];if(a7!=null){var a5=a7.floatingAnchorIndex==null?1:a7.floatingAnchorIndex;a7.endpoints[a5].anchor.out()}});i.CurrentLibrary.initDroppable(a1,aY)}};aD(v(aM.canvas));return aM}};var i=window.jsPlumb=new r();i.getInstance=function(x){var w=new r(x);return w};var m=function(w,B,A,z){return function(){return i.makeAnchor(w,B,A,z)}};i.Anchors.TopCenter=m(0.5,0,0,-1);i.Anchors.BottomCenter=m(0.5,1,0,1);i.Anchors.LeftMiddle=m(0,0.5,-1,0);i.Anchors.RightMiddle=m(1,0.5,1,0);i.Anchors.Center=m(0.5,0.5,0,0);i.Anchors.TopRight=m(1,0,0,-1);i.Anchors.BottomRight=m(1,1,0,1);i.Anchors.TopLeft=m(0,0,0,-1);i.Anchors.BottomLeft=m(0,1,0,1);i.Defaults.DynamicAnchors=function(){return i.makeAnchors(["TopCenter","RightMiddle","BottomCenter","LeftMiddle"])};i.Anchors.AutoDefault=function(){return i.makeDynamicAnchor(i.Defaults.DynamicAnchors())}})();(function(){jsPlumb.DOMElementComponent=function(a){jsPlumb.jsPlumbUIComponent.apply(this,arguments);this.mousemove=this.dblclick=this.click=this.mousedown=this.mouseup=function(b){}};jsPlumb.Connectors.Straight=function(){var n=this;var g=null;var c,h,l,k,i,d,m,f,e,b,a;this.compute=function(r,F,B,o,v,q){var E=Math.abs(r[0]-F[0]);var u=Math.abs(r[1]-F[1]);var z=false,s=false;var t=0.45*E,p=0.45*u;E*=1.9;u*=1.9;var C=Math.min(r[0],F[0])-t;var A=Math.min(r[1],F[1])-p;var D=Math.max(2*v,q);if(E0?1:-1;var t=Math.abs(u*Math.sin(d));if(e>a){t=t*-1}var o=Math.abs(u*Math.cos(d));if(f>b){o=o*-1}return{x:s.x+(r*o),y:s.y+(r*t)}};this.perpendicularToPathAt=function(s,t,w){var u=n.pointAlongPathFrom(s,w);var r=n.gradientAtPoint(u.location);var q=Math.atan(-1/r);var v=t/2*Math.sin(q);var o=t/2*Math.cos(q);return[{x:u.x+o,y:u.y+v},{x:u.x-o,y:u.y-v}]}};jsPlumb.Connectors.Bezier=function(e){var o=this;e=e||{};this.majorAnchor=e.curviness||150;this.minorAnchor=10;var h=null;this._findControlPoint=function(z,q,u,x,r){var w=x.getOrientation(),y=r.getOrientation();var t=w[0]!=y[0]||w[1]==y[1];var s=[];var A=o.majorAnchor,v=o.minorAnchor;if(!t){if(w[0]==0){s.push(q[0]l){l=u}if(x<0){d+=x;var y=Math.abs(x);l+=y;n[0]+=y;i+=y;b+=y;m[0]+=y}var G=Math.min(f,a);var E=Math.min(n[1],m[1]);var t=Math.min(G,E);var z=Math.max(f,a);var w=Math.max(n[1],m[1]);var r=Math.max(z,w);if(r>g){g=r}if(t<0){c+=t;var v=Math.abs(t);g+=v;n[1]+=v;f+=v;a+=v;m[1]+=v}if(D&&l=s){q=t;r=(s-l[t][0])/a[t];break}}return{segment:i[q],proportion:r,index:q}};this.compute=function(Q,v,P,r,q,H){i=[];h=[];a=[];g=[];segmentProportionals=[];d=v[0]t[0]?t[0]+((1-x)*r)-y:t[2]+(x*r)+y,y:q==0?t[3]:t[3]>t[1]?t[1]+((1-x)*r)-y:t[3]+(x*r)+y,segmentInfo:v};return w};this.perpendicularToPathAt=function(t,u,z){var v=n.pointAlongPathFrom(t,z);var s=h[v.segmentInfo.index];var r=Math.atan(-1/s);var w=u/2*Math.sin(r);var q=u/2*Math.cos(r);return[{x:v.x+q,y:v.y+w},{x:v.x-q,y:v.y-w}]}};jsPlumb.Endpoints.Dot=function(b){var a=this;b=b||{};this.radius=b.radius||10;this.defaultOffset=0.5*this.radius;this.defaultInnerRadius=this.radius/3;this.compute=function(g,d,i,f){var e=i.radius||a.radius;var c=g[0]-e;var h=g[1]-e;return[c,h,e*2,e*2,e]}};jsPlumb.Endpoints.Rectangle=function(b){var a=this;b=b||{};this.width=b.width||20;this.height=b.height||20;this.compute=function(h,e,k,g){var f=k.width||a.width;var d=k.height||a.height;var c=h[0]-(f/2);var i=h[1]-(d/2);return[c,i,f,d]}};jsPlumb.Endpoints.Image=function(d){jsPlumb.DOMElementComponent.apply(this,arguments);var a=this,c=false;this.img=new Image();a.ready=false;this.img.onload=function(){a.ready=true};this.img.src=d.src||d.url;this.compute=function(g,e,h,f){a.anchorPoint=g;if(a.ready){return[g[0]-a.img.width/2,g[1]-a.img.height/2,a.img.width,a.img.height]}else{return[0,0,0,0]}};a.canvas=document.createElement("img"),c=false;a.canvas.style.margin=0;a.canvas.style.padding=0;a.canvas.style.outline=0;a.canvas.style.position="absolute";a.canvas.className=jsPlumb.endpointClass;jsPlumb.appendElement(a.canvas,d.parent);a.attachListeners(a.canvas,a);var b=function(k,i,g){if(!c){a.canvas.setAttribute("src",a.img.src);c=true}var h=a.img.width,f=a.img.height,e=a.anchorPoint[0]-(h/2),l=a.anchorPoint[1]-(f/2);jsPlumb.sizeCanvas(a.canvas,e,l,h,f)};this.paint=function(g,f,e){if(a.ready){b(g,f,e)}else{window.setTimeout(function(){a.paint(g,f,e)},200)}}};jsPlumb.Endpoints.Blank=function(){jsPlumb.DOMElementComponent.apply(this,arguments);this.compute=function(){return[0,0,0,0]};self.canvas=document.createElement("div");this.paint=function(){}};jsPlumb.Endpoints.Triangle=function(a){a=a||{};a.width=a.width||55;param.height=a.height||55;this.width=a.width;this.height=a.height;this.compute=function(g,d,i,f){var e=i.width||self.width;var c=i.height||self.height;var b=g[0]-(e/2);var h=g[1]-(c/2);return[b,h,e,c]}};jsPlumb.Overlays.Arrow=function(f){f=f||{};var b=this;this.length=f.length||20;this.width=f.width||20;this.id=f.id;this.connection=f.connection;var e=(f.direction||1)<0?-1:1;var c=f.paintStyle||{lineWidth:1};this.loc=f.location==null?0.5:f.location;var a=f.foldback||0.623;var d=function(g,i){if(a==0.5){return g.pointOnPath(i)}else{var h=0.5-a;return g.pointAlongPathFrom(i,e*b.length*h)}};this.computeMaxSize=function(){return b.width*1.5};this.draw=function(k,q,w){var y=k.pointAlongPathFrom(b.loc,e*(b.length/2));var t=k.pointAlongPathFrom(b.loc,-1*e*(b.length/2)),B=t.x,A=t.y;var r=k.perpendicularToPathAt(b.loc,b.width,-1*e*(b.length/2));var i=d(k,b.loc);if(b.loc==1){var h=k.pointOnPath(b.loc);var v=(h.x-y.x)*e,u=(h.y-y.y)*e;i.x+=v;i.y+=u;t.x+=v;t.y+=u;r[0].x+=v;r[0].y+=u;r[1].x+=v;r[1].y+=u;y.x+=v;y.y+=u}if(b.loc==0){var h=k.pointOnPath(b.loc);var s=a>1?i:{x:r[0].x+((r[1].x-r[0].x)/2),y:r[0].y+((r[1].y-r[0].y)/2)};var v=(h.x-s.x)*e,u=(h.y-s.y)*e;i.x+=v;i.y+=u;t.x+=v;t.y+=u;r[0].x+=v;r[0].y+=u;r[1].x+=v;r[1].y+=u;y.x+=v;y.y+=u}var o=Math.min(y.x,r[0].x,r[1].x);var n=Math.max(y.x,r[0].x,r[1].x);var m=Math.min(y.y,r[0].y,r[1].y);var l=Math.max(y.y,r[0].y,r[1].y);var z={hxy:y,tail:r,cxy:i},x=c.strokeStyle||q.strokeStyle,p=c.fillStyle||q.strokeStyle,g=c.lineWidth||q.lineWidth;b.paint(k,z,g,x,p,w);return[o,n,m,l]}};jsPlumb.Overlays.PlainArrow=function(b){b=b||{};var a=jsPlumb.extend(b,{foldback:1});jsPlumb.Overlays.Arrow.call(this,a)};jsPlumb.Overlays.Diamond=function(c){c=c||{};var a=c.length||40;var b=jsPlumb.extend(c,{length:a/2,foldback:2});jsPlumb.Overlays.Arrow.call(this,b)};jsPlumb.Overlays.Label=function(d){jsPlumb.DOMElementComponent.apply(this,arguments);this.labelStyle=d.labelStyle||jsPlumb.Defaults.LabelStyle;this.labelStyle.font=this.labelStyle.font||"12px sans-serif";this.label=d.label;this.connection=d.connection;this.id=d.id;var k=this;var h=null,e=null,c=null,b=null;this.location=d.location||0.5;this.cachedDimensions=null;var i=false,c=null,a=document.createElement("div");a.style.position="absolute";a.style.textAlign="center";a.style.cursor="pointer";a.style.font=k.labelStyle.font;a.style.color=k.labelStyle.color||"black";if(k.labelStyle.fillStyle){a.style.background=k.labelStyle.fillStyle}if(k.labelStyle.borderWidth>0){var g=k.labelStyle.borderStyle?k.labelStyle.borderStyle:"black";a.style.border=k.labelStyle.borderWidth+"px solid "+g}if(k.labelStyle.padding){a.style.padding=k.labelStyle.padding}var f=d._jsPlumb.overlayClass+" "+(k.labelStyle.cssClass?k.labelStyle.cssClass:d.cssClass?d.cssClass:"");a.className=f;jsPlumb.appendElement(a,d.connection.parent);jsPlumb.getId(a);k.attachListeners(a,k);this.paint=function(l,n,m){if(!i){l.appendDisplayElement(a);k.attachListeners(a,l);i=true}a.style.left=(m[0]+n.minx)+"px";a.style.top=(m[1]+n.miny)+"px"};this.getTextDimensions=function(l){c=typeof k.label=="function"?k.label(k):k.label;a.innerHTML=c.replace(/\r\n/g,"
");var n=jsPlumb.CurrentLibrary.getElementObject(a),m=jsPlumb.CurrentLibrary.getSize(n);return{width:m[0],height:m[1]}};this.computeMaxSize=function(l){var m=k.getTextDimensions(l);return m.width?Math.max(m.width,m.height)*1.5:0};this.draw=function(n,p,o){var r=k.getTextDimensions(n);if(r.width!=null){var q=n.pointOnPath(k.location);var m=q.x-(r.width/2);var l=q.y-(r.height/2);k.paint(n,{minx:m,miny:l,td:r,cxy:q},o);return[m,m+r.width,l,l+r.height]}else{return[0,0,0,0]}}}})();(function(){var h={"stroke-linejoin":"joinstyle",joinstyle:"joinstyle",endcap:"endcap",miterlimit:"miterlimit"};if(document.createStyleSheet){document.createStyleSheet().addRule(".jsplumb_vml","behavior:url(#default#VML);position:absolute;");document.createStyleSheet().addRule("jsplumb\\:textbox","behavior:url(#default#VML);position:absolute;");document.createStyleSheet().addRule("jsplumb\\:oval","behavior:url(#default#VML);position:absolute;");document.createStyleSheet().addRule("jsplumb\\:rect","behavior:url(#default#VML);position:absolute;");document.createStyleSheet().addRule("jsplumb\\:stroke","behavior:url(#default#VML);position:absolute;");document.createStyleSheet().addRule("jsplumb\\:shape","behavior:url(#default#VML);position:absolute;");document.namespaces.add("jsplumb","urn:schemas-microsoft-com:vml")}var c=1000,d=function(p,q){for(var n in q){p[n]=q[n]}},m=function(n,q,r){r=r||{};var p=document.createElement("jsplumb:"+n);p.className=(r["class"]?r["class"]+" ":"")+"jsplumb_vml";l(p,q);d(p,r);return p},l=function(p,n){p.style.left=n[0]+"px";p.style.top=n[1]+"px";p.style.width=n[2]+"px";p.style.height=n[3]+"px";p.style.position="absolute"},g=function(n){return Math.floor(n*c)},a=function(p,n){var v=p,u=function(o){return o.length==1?"0"+o:o},q=function(o){return u(Number(o).toString(16))},r=/(rgb[a]?\()(.*)(\))/;if(p.match(r)){var t=p.match(r)[2].split(",");v="#"+q(t[0])+q(t[1])+q(t[2]);if(!n&&t.length==4){v=v+q(t[3])}}return v},f=function(s,r,p){var u={};if(r.strokeStyle){u.stroked="true";u.strokecolor=a(r.strokeStyle,true);u.strokeweight=r.lineWidth+"px"}else{u.stroked="false"}if(r.fillStyle){u.filled="true";u.fillcolor=a(r.fillStyle,true)}else{u.filled="false"}if(r.dashstyle){if(p.strokeNode==null){p.strokeNode=m("stroke",[0,0,0,0],{dashstyle:r.dashstyle});s.appendChild(p.strokeNode)}else{p.strokeNode.dashstyle=r.dashstyle}}else{if(r["stroke-dasharray"]&&r.lineWidth){var o=r["stroke-dasharray"].indexOf(",")==-1?" ":",",t=r["stroke-dasharray"].split(o),n="";for(var q=0;q0&&F>0&&z=z&&B[2]<=F&&B[3]>=F)){return true}}var D=v.canvas.getContext("2d").getImageData(parseInt(z),parseInt(F),1,1);return D.data[0]!=0||D.data[1]!=0||D.data[2]!=0||D.data[3]!=0}return false};var u=false;var t=false,y=null,x=false;var w=function(A,z){return A!=null&&f(A,z)};this.mousemove=function(C){var E=e(C),B=i(C),A=document.elementFromPoint(B[0],B[1]),D=w(A,"_jsPlumb_overlay");var z=o==null&&(w(A,"_jsPlumb_endpoint")||w(A,"_jsPlumb_connector"));if(!u&&z&&v._over(C)){u=true;v.fire("mouseenter",v,C);return true}else{if(u&&(!v._over(C)||!z)&&!D){u=false;v.fire("mouseexit",v,C)}}v.fire("mousemove",v,C)};this.click=function(z){if(u&&v._over(z)&&!x){v.fire("click",v,z)}x=false};this.dblclick=function(z){if(u&&v._over(z)&&!x){v.fire("dblclick",v,z)}x=false};this.mousedown=function(z){if(v._over(z)&&!t){t=true;y=m(s(v.canvas));v.fire("mousedown",v,z)}};this.mouseup=function(z){t=false;v.fire("mouseup",v,z)}};var p=function(u){var t=document.createElement("canvas");jsPlumb.appendElement(t,u.parent);t.style.position="absolute";if(u["class"]){t.className=u["class"]}u._jsPlumb.getId(t,u.uuid);return t};var d=jsPlumb.CanvasConnector=function(x){n.apply(this,arguments);var t=function(B,z){u.ctx.save();jsPlumb.extend(u.ctx,z);if(z.gradient){var A=u.createGradient(B,u.ctx);for(var y=0;y0?1:-1}}var b={subtract:function(m,l){return{x:m.x-l.x,y:m.y-l.y}},dotProduct:function(m,l){return m.x*l.x+m.y*l.y},square:function(l){return Math.sqrt(l.x*l.x+l.y*l.y)},scale:function(m,l){return{x:m.x*l,y:m.y*l}}},d=Math.pow(2,-65),h=function(y,x){for(var s=[],v=x.length-1,r=2*v-1,t=[],w=[],o=[],p=[],q=[[1,0.6,0.3,0.1],[0.4,0.6,0.6,0.4],[0.1,0.3,0.6,1]],u=0;u<=v;u++){t[u]=b.subtract(x[u],y)}for(u=0;u<=v-1;u++){w[u]=b.subtract(x[u+1],x[u]);w[u]=b.scale(w[u],3)}for(u=0;u<=v-1;u++){for(var n=0;n<=v;n++){o[u]||(o[u]=[]);o[u][n]=b.dotProduct(w[u],t[n])}}for(u=0;u<=r;u++){p[u]||(p[u]=[]);p[u].y=0;p[u].x=parseFloat(u)/r}r=v-1;for(t=0;t<=v+r;t++){w=Math.min(t,v);for(u=Math.max(0,t-r);u<=w;u++){j=t-u;p[u+j].y+=o[j][u]*q[j][u]}}v=x.length-1;p=k(p,2*v-1,s,0);r=b.subtract(y,x[0]);o=b.square(r);for(u=q=0;u=64){y[0]=(E[0].x+E[D].x)/2;return 1}var s,r,p;v=E[0].y-E[D].y;w=E[D].x-E[0].x;A=E[0].x*E[D].y-E[D].x*E[0].y;t=max_distance_below=0;for(r=1;rt){t=p}else{if(p0?1:-1,r=null;n