12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- (function(){var O=function(){var o=function(){var a={};this.bind=function(b,d){if(b.constructor==Array)for(var h=0;h<b.length;h++)C(a,b[h],d);else C(a,b,d)};this.fireUpdate=function(b,d){if(a[b])for(var h=0;h<a[b].length;h++)try{a[b][h][b](d)}catch(n){G("jsPlumb: fireUpdate failed for event "+b+";not fatal.")}};this.clearListeners=function(){delete a;a={}}},l=this,w=!!!document.createElement("canvas").getContext,t={},x={},u={},y={},k={},e={},g={},s=true,r=[],j="DEFAULT",f=1200,q=function(a,b,d){var h=
- function(m,A){if(m===A)return true;else if(typeof m=="object"&&typeof A=="object"){var D=true,F;for(F in m)if(!h(m[F],A[F])){D=false;break}for(F in A)if(!h(A[F],m[F])){D=false;break}return D}};d=+d||0;for(var n=a.length;d<n;d++)if(h(a[d],b))return d;return-1},C=function(a,b,d){var h=a[b];if(h==null){h=[];a[b]=h}h.push(d);return h},I=function(a,b,d){a=J(a,"id");var h=t[a];d||(d=""+(new Date).getTime());if(h){W({elId:a,offset:b,recalc:false,timestamp:d});for(var n=y[a],m=r[a],A=0;A<h.length;A++){h[A].paint({timestamp:d,
- offset:n,dimensions:m});for(var D=h[A].connections,F=0;F<D.length;F++){D[F].paint({elId:a,ui:b,recalc:false,timestamp:d});var B=D[F].endpoints[0]==h[A]?1:0;if(D[F].endpoints[B].anchor.isDynamic&&!D[F].endpoints[B].isFloating()){var N=B==0?D[F].sourceId:D[F].targetId,K=y[N];N=D[F].endpoints[B].anchor.compute({xy:[K.left,K.top],wh:r[N],element:D[F].endpoints[B],txy:[n.left,n.top],twh:m,tElement:h[A]});D[F].endpoints[B].paint({anchorLoc:N})}}}}},H=function(a,b){var d=null;if(a.constructor==Array){d=
- [];for(var h=0;h<a.length;h++){var n=v(a[h]),m=J(n,"id");d.push(b(n,m))}}else{n=v(a);m=J(n,"id");d=b(n,m)}return d},G=function(a){l.logEnabled&&typeof console!="undefined"&&console.log(a)},J=function(a,b){return c.CurrentLibrary.getAttribute(v(a),b)},v=function(a){return c.CurrentLibrary.getElementObject(a)},S=function(a){return c.CurrentLibrary.getSize(v(a))},X=function(a,b){var d=v(a),h=J(d,"id");if(!h){var n=h=arguments.length==2?b:"_jsPlumb_"+(""+(new Date).getTime());c.CurrentLibrary.setAttribute(v(d),
- "id",n)}return h},ba=function(a,b,d){if(b=b==null?s:b)if(c.CurrentLibrary.isDragSupported(a)){d=d||l.Defaults.DragOptions||c.Defaults.DragOptions;d=c.extend({},d);b=c.CurrentLibrary.dragEvents.drag;var h=c.CurrentLibrary.dragEvents.stop;d[b]=U(d[b],function(){var n=c.CurrentLibrary.getUIPosition(arguments);I(a,n);c.CurrentLibrary.addClass(v(a),"jsPlumb_dragged")});d[h]=U(d[h],function(){var n=c.CurrentLibrary.getUIPosition(arguments);I(a,n);c.CurrentLibrary.removeClass(v(a),"jsPlumb_dragged")});b=
- g[X(a)];d.disabled=b==null?false:!b;c.CurrentLibrary.initDraggable(a,d)}},ha=function(a,b,d){var h=document.createElement("canvas"),n=h;b?c.CurrentLibrary.appendElement(n,b):document.body.appendChild(n);h.style.position="absolute";if(a)h.className=a;X(h,d);if(w){c.sizeCanvas(h,0,0,f,f);h=G_vmlCanvasManager.initElement(h)}return h},da=function(a,b){var d=t[a];if(d&&d.length)for(var h=0;h<d.length;h++)for(var n=0;n<d[h].connections.length;n++)if(b(d[h].connections[n]))return},Y=function(a,b){if(a!=
- null)if(b)c.CurrentLibrary.removeElement(a,b);else try{document.body.removeChild(a)}catch(d){}},ca=function(a,b,d){a=a[b];if(a!=null){d=q(a,d);if(d>=0){delete a[d];a.splice(d,1);return true}}return false},ia=function(a,b){da(J(a,"id"),function(d){d.canvas.style.display=b})},ma=function(a){da(a,function(b){b.canvas.style.display="none"==b.canvas.style.display?"block":"none"})},W=function(a){var b=a.timestamp,d=a.recalc,h=a.offset;a=a.elId;if(!d)if(b&&b===k[a])return;if(d||h==null){d=v(a);r[a]=S(d);
- y[a]=c.CurrentLibrary.getOffset(v(d));k[a]=b}else y[a]=h},U=function(a,b){a=a||function(){};b=b||function(){};return function(){var d=null;try{d=b.apply(this,arguments)}catch(h){G("jsPlumb function failed : "+h)}try{a.apply(this,arguments)}catch(n){G("wrapped function failed : "+n)}return d}},ja=function(a){var b=this;this.x=a.x||0;this.y=a.y||0;var d=a.orientation||[0,0],h=null;this.offsets=a.offsets||[0,0];b.timestamp=null;this.compute=function(n){var m=n.xy,A=n.wh,D=n.element;if((n=n.timestamp)&&
- n===b.timestamp)return h;h=[m[0]+b.x*A[0]+b.offsets[0],m[1]+b.y*A[1]+b.offsets[1]];A=D?D.container:null;m={left:0,top:0};if(A!=null){var F=v(A);A=c.CurrentLibrary.getOffset(v(F));D=c.CurrentLibrary.getScrollLeft(F);F=c.CurrentLibrary.getScrollTop(F);m.left=A.left-D;m.top=A.top-F;h[0]-=m.left;h[1]-=m.top}b.timestamp=n;return h};this.getOrientation=function(){return d};this.equals=function(n){if(!n)return false;var m=n.getOrientation(),A=this.getOrientation();return this.x==n.x&&this.y==n.y&&this.offsets[0]==
- n.offsets[0]&&this.offsets[1]==n.offsets[1]&&A[0]==m[0]&&A[1]==m[1]};this.getCurrentLocation=function(){return h}},na=function(a){var b=a.reference,d=S(v(a.referenceCanvas)),h=null,n=null;this.compute=function(m){var A=m.xy;m=m.element;A=[A[0]+d[0]/2,A[1]+d[1]/2];if(m.container!=null){m=c.CurrentLibrary.getOffset(v(m.container));A[0]-=m.left;A[1]-=m.top}return n=A};this.getOrientation=function(){if(h)return h;else{var m=b.getOrientation();return[Math.abs(m[0])*0*-1,Math.abs(m[1])*0*-1]}};this.over=
- function(m){h=m.getOrientation()};this.out=function(){h=null};this.getCurrentLocation=function(){return n}},oa=function(a){this.isDynamic=this.isSelective=true;var b=a||[];for(a=0;a<b.length;a++)b[a]=b[a].constructor==Array?c.makeAnchor(b[a]):b[a];this.addAnchor=function(n){b.push(n.constructor==Array?c.makeAnchor(n):n)};this.getAnchors=function(){return b};var d=b.length>0?b[0]:null;this.locked=false;var h=this;this.compute=function(n){var m=n.xy,A=n.wh,D=n.txy,F=n.twh;if(h.locked||D==null||F==null)return d.compute(n);
- else n.timestamp=null;var B=D[0]+F[0]/2;D=D[1]+F[1]/2;F=-1;for(var N=Infinity,K=0;K<b.length;K++){var P=Math.sqrt(Math.pow(B-(m[0]+b[K].x*A[0]),2)+Math.pow(D-(m[1]+b[K].y*A[1]),2));if(P<N){F=K+0;N=P}}d=b[F];return d.compute(n)};this.getCurrentLocation=function(){return d!=null?d.getCurrentLocation():null};this.getOrientation=function(){return d!=null?d.getOrientation():[0,0]};this.over=function(n){d!=null&&d.over(n)};this.out=function(){d!=null&&d.out()}},ga=function(a){o.apply(this);var b=this,d=
- new String("_jsplumb_c_"+(new Date).getTime());this.getId=function(){return d};this.container=a.container||l.Defaults.Container;this.source=v(a.source);this.target=v(a.target);if(a.sourceEndpoint)this.source=a.sourceEndpoint.getElement();if(a.targetEndpoint)this.target=a.targetEndpoint.getElement();this.sourceId=J(this.source,"id");this.targetId=J(this.target,"id");this.endpointsOnTop=a.endpointsOnTop!=null?a.endpointsOnTop:true;this.scope=a.scope;this.endpoints=[];this.endpointStyles=[];var h=function(B){if(B)return c.makeAnchor(B)},
- n=function(B,N,K,P){if(B){b.endpoints[N]=B;B.addConnection(b)}else{if(!K.endpoints)K.endpoints=[null,null];B=K.endpoints[N]||K.endpoint||l.Defaults.Endpoints[N]||c.Defaults.Endpoints[N]||l.Defaults.Endpoint||c.Defaults.Endpoint||new c.Endpoints.Dot;if(B.constructor==String)B=new c.Endpoints[B];if(!K.endpointStyles)K.endpointStyles=[null,null];var E=K.endpointStyles[N]||K.endpointStyle||l.Defaults.EndpointStyles[N]||c.Defaults.EndpointStyles[N]||l.Defaults.EndpointStyle||c.Defaults.EndpointStyle,T=
- K.anchors?K.anchors[N]:h(l.Defaults.Anchors[N])||h(c.Defaults.Anchors[N])||h(l.Defaults.Anchor)||h(c.Defaults.Anchor)||h("BottomCenter");K=new ea({style:E,endpoint:B,connections:[b],uuid:K.uuids?K.uuids[N]:null,anchor:T,source:P,container:b.container});return b.endpoints[N]=K}},m=n(a.sourceEndpoint,0,a,b.source);m&&C(t,this.sourceId,m);(n=n(a.targetEndpoint,1,a,b.target))&&C(t,this.targetId,n);if(!this.scope)this.scope=this.endpoints[0].scope;this.connector=this.endpoints[0].connector||this.endpoints[1].connector||
- a.connector||l.Defaults.Connector||c.Defaults.Connector||new c.Connectors.Bezier;if(this.connector.constructor==String)this.connector=new c.Connectors[this.connector];this.paintStyle=this.endpoints[0].connectorStyle||this.endpoints[1].connectorStyle||a.paintStyle||l.Defaults.PaintStyle||c.Defaults.PaintStyle;this.backgroundPaintStyle=this.endpoints[0].connectorBackgroundStyle||this.endpoints[1].connectorBackgroundStyle||a.backgroundPaintStyle||l.Defaults.BackgroundPaintStyle||c.Defaults.BackgroundPaintStyle;
- this.overlays=a.overlays||[];this.addOverlay=function(B){overlays.push(B)};this.labelStyle=a.labelStyle||l.Defaults.LabelStyle||c.Defaults.LabelStyle;(this.label=a.label)&&this.overlays.push(new c.Overlays.Label({labelStyle:this.labelStyle,label:this.label}));W({elId:this.sourceId});W({elId:this.targetId});this.distanceFrom=function(B){return b.connector.distanceFrom(B)};this.setLabel=function(B){b.label=B;l.repaint(b.source)};n=y[this.sourceId];m=r[this.sourceId];var A=y[this.targetId];otherWH=r[this.targetId];
- var D=this.endpoints[0].anchor.compute({xy:[n.left,n.top],wh:m,element:this.endpoints[0],txy:[A.left,A.top],twh:otherWH,tElement:this.endpoints[1]});this.endpoints[0].paint({anchorLoc:D});D=this.endpoints[1].anchor.compute({xy:[A.left,A.top],wh:otherWH,element:this.endpoints[1],txy:[n.left,n.top],twh:m,tElement:this.endpoints[0]});this.endpoints[1].paint({anchorLoc:D});var F=ha(c.connectorClass,b.container);this.canvas=F;this.paint=function(B){B=B||{};var N=B.elId,K=B.ui,P=B.recalc;B=B.timestamp;
- var E=this.targetId;if(this.canvas.getContext){W({elId:N,offset:K,recalc:P,timestamp:B});W({elId:E,timestamp:B});K=F.getContext("2d");P=this.endpoints[0].anchor.getCurrentLocation();this.endpoints[0].anchor.getOrientation();B=this.endpoints[1].anchor.getCurrentLocation();this.endpoints[1].anchor.getOrientation();for(var T=E=0;T<b.overlays.length;T++){var R=b.overlays[T];R=R.computeMaxSize(b.connector,K);if(R>E)E=R}var M=this.connector.compute(P,B,this.endpoints[0].anchor,this.endpoints[1].anchor,
- this.paintStyle.lineWidth,E);c.sizeCanvas(F,M[0],M[1],M[2],M[3]);P=function(Q,V){Q.save();c.extend(Q,V);if(V.gradient&&!w){for(var Z=b.connector.createGradient(M,Q,N==this.sourceId),p=0;p<V.gradient.stops.length;p++)Z.addColorStop(V.gradient.stops[p][0],V.gradient.stops[p][1]);Q.strokeStyle=Z}b.connector.paint(M,Q);Q.restore()};this.backgroundPaintStyle!=null&&P(K,this.backgroundPaintStyle);P(K,this.paintStyle);for(T=0;T<b.overlays.length;T++){R=b.overlays[T];R.draw(b.connector,K)}}};this.repaint=
- function(){this.paint({elId:this.sourceId,recalc:true})};ba(b.source,a.draggable,a.dragOptions);ba(b.target,a.draggable,a.dragOptions);this.source.resize&&this.source.resize(function(){c.repaint(b.sourceId)})},ea=function(a){a=a||{};var b=this,d=new String("_jsplumb_e_"+(new Date).getTime());this.getId=function(){return d};b.anchor=a.anchor?c.makeAnchor(a.anchor):c.makeAnchor("TopCenter");var h=a.endpoint||new c.Endpoints.Dot;if(h.constuctor==String)h=new c.Endpoints[h];b.endpoint=h;var n=a.style||
- l.Defaults.EndpointStyle||c.Defaults.EndpointStyle;this.connectorStyle=a.connectorStyle;this.connectorOverlays=a.connectorOverlays;this.connector=a.connector;this.isSource=a.isSource||false;this.isTarget=a.isTarget||false;var m=a.source,A=a.uuid,D=null,F=null;if(A)x[A]=b;this.container=a.container||l.Defaults.Container||c.Defaults.Container;var B=J(m,"id"),N=a.maxConnections||1;this.canvas=a.canvas||ha(c.endpointClass,this.container,a.uuid);this.connections=a.connections||[];this.scope=a.scope||j;
- this.timestamp=null;var K=a.reattach||false;this.dragAllowedWhenFull=a.dragAllowedWhenFull||true;this.computeAnchor=function(p){return b.anchor.compute(p)};this.addConnection=function(p){b.connections.push(p)};this.detach=function(p,L){var z=q(b.connections,p);if(z>=0){b.connections.splice(z,1);L||(p.endpoints[0]==b?p.endpoints[1]:p.endpoints[0]).detach(p,true)}Y(p.canvas,p.container);ca(u,p.scope,p);$(p)};this.detachAll=function(){for(;b.connections.length>0;)b.detach(b.connections[0])};this.detachFrom=
- function(p){for(var L=[],z=0;z<b.connections.length;z++)if(b.connections[z].endpoints[1]==p||b.connections[z].endpoints[0]==p)L.push(b.connections[z]);for(z=0;z<L.length;z++)b.detach(L[z])};this.detachFromConnection=function(p){p=q(b.connections,p);p>=0&&b.connections.splice(p,1)};this.getElement=function(){return m};this.getUuid=function(){return A};this.makeInPlaceCopy=function(){return new ea({anchor:b.anchor,source:m,style:n,endpoint:h})};this.isConnectedTo=function(p){var L=false;if(p)for(var z=
- 0;z<b.connections.length;z++)if(b.connections[z].endpoints[1]==p){L=true;break}return L};this.isFloating=function(){return D!=null};this.isFull=function(){return N<1?false:b.connections.length>=N};this.setDragAllowedWhenFull=function(p){b.dragAllowedWhenFull=p};this.equals=function(p){return this.anchor.equals(p.anchor)};this.paint=function(p){p=p||{};var L=p.timestamp;if(!L||b.timestamp!==L){var z=p.anchorPoint,aa=p.canvas,pa=p.connectorPaintStyle;if(z==null){z=p.offset||y[B];p=p.dimensions||r[B];
- if(z==null||p==null){W({elId:B,timestamp:L});z=y[B];p=r[B]}p={xy:[z.left,z.top],wh:p,element:b,timestamp:L};if(b.anchor.isDynamic)if(b.connections.length>0){z=b.connections[0];var ka=z.endpoints[0]==b?1:0,fa=ka==0?z.sourceId:z.targetId,la=y[fa];fa=r[fa];p.txy=[la.left,la.top];p.twh=fa;p.tElement=z.endpoints[ka]}z=b.anchor.compute(p)}h.paint(z,b.anchor.getOrientation(),aa||b.canvas,n,pa||n);b.timestamp=L}};this.removeConnection=this.detach;if(a.isSource&&c.CurrentLibrary.isDragSupported(m)){var P=
- null;var E=d=null,T=false,R=null,M=a.dragOptions||{},Q=c.extend({},c.CurrentLibrary.defaultDragOptions);M=c.extend(Q,M);M.scope=M.scope||b.scope;Q=c.CurrentLibrary.dragEvents.start;var V=c.CurrentLibrary.dragEvents.stop,Z=c.CurrentLibrary.dragEvents.drag;M[Q]=U(M[Q],function(){E=b.connections.length<N?null:b.connections[0];if(b.isFull()&&!b.dragAllowedWhenFull)return false;W({elId:B});F=b.makeInPlaceCopy();F.paint();P=document.createElement("div");var p=v(P),L=P,z=b.container;z?c.CurrentLibrary.appendElement(L,
- z):document.body.appendChild(L);L=X(p);W({elId:L});z=v(b.canvas);c.CurrentLibrary.setAttribute(v(z),"dragId",L);z=v(b.canvas);c.CurrentLibrary.setAttribute(v(z),"elId",B);z=new na({reference:b.anchor,referenceCanvas:b.canvas});D=new ea({style:{fillStyle:"rgba(0,0,0,0)"},endpoint:h,anchor:z,source:p});if(E==null){b.anchor.locked=true;E=new ga({sourceEndpoint:b,targetEndpoint:D,source:v(m),target:v(P),anchors:[b.anchor,z],paintStyle:a.connectorStyle,connector:a.connector,overlays:b.connectorOverlays})}else{T=
- true;p=E.sourceId==B?0:1;E.floatingAnchorIndex=p;b.detachFromConnection(E);if(p==0){R=[E.source,E.sourceId];E.source=v(P);E.sourceId=L}else{R=[E.target,E.targetId];E.target=v(P);E.targetId=L}E.endpoints[p==0?1:0].anchor.locked=true;E.suspendedEndpoint=E.endpoints[p];E.endpoints[p]=D}e[L]=E;D.addConnection(E);C(t,L,D)});M[Z]=U(M[Z],function(){var p=c.CurrentLibrary.getUIPosition(arguments);c.CurrentLibrary.setOffset(P,p);I(v(P),p)});M[V]=U(M[V],function(){ca(t,d,D);for(var p=[P,D.canvas],L=0;L<p.length;L++)Y(p[L],
- m);Y(F.canvas,m);p=E.floatingAnchorIndex==null?1:E.floatingAnchorIndex;E.endpoints[p==0?1:0].anchor.locked=false;if(E.endpoints[p]==D)if(T&&E.suspendedEndpoint){if(p==0){E.source=R[0];E.sourceId=R[1]}else{E.target=R[0];E.targetId=R[1]}E.endpoints[p]=E.suspendedEndpoint;if(K){E.floatingAnchorIndex=null;E.suspendedEndpoint.addConnection(E);c.repaint(R[1])}else{E.endpoints[1].detach(E);E.endpoints[0].detach(E)}}else{Y(E.canvas,b.container);b.detachFromConnection(E)}b.anchor.locked=false;b.paint();E.repaint();
- E=null;delete D;delete F});Q=v(b.canvas);c.CurrentLibrary.initDraggable(Q,M)}if(a.isTarget&&c.CurrentLibrary.isDropSupported(m)){M=a.dropOptions||l.Defaults.DropOptions||c.Defaults.DropOptions;M=c.extend({},M);M.scope=M.scope||b.scope;Q=c.CurrentLibrary.dragEvents.drop;V=c.CurrentLibrary.dragEvents.over;Z=c.CurrentLibrary.dragEvents.out;M[Q]=U(M[Q],function(){var p=c.CurrentLibrary.getDragObject(arguments),L=J(v(p),"dragId");p=J(v(p),"elId");var z=e[L],aa=z.floatingAnchorIndex==null?1:z.floatingAnchorIndex;
- if(!b.isFull()&&!(aa==0&&!b.isSource)&&!(aa==1&&!b.isTarget)){if(aa==0){z.source=m;z.sourceId=B}else{z.target=m;z.targetId=B}z.endpoints[aa].detachFromConnection(z);z.suspendedEndpoint&&z.suspendedEndpoint.detachFromConnection(z);z.endpoints[aa]=b;b.addConnection(z);C(u,z.scope,z);ba(m,a.draggable,{});c.repaint(p);l.fireUpdate("jsPlumbConnection",{source:z.source,target:z.target,sourceId:z.sourceId,targetId:z.targetId,sourceEndpoint:z.endpoints[0],targetEndpoint:z.endpoints[1]})}delete e[L]});M[V]=
- U(M[V],function(){var p=c.CurrentLibrary.getDragObject(arguments);p=J(v(p),"dragId");p=e[p];p.endpoints[p.floatingAnchorIndex==null?1:p.floatingAnchorIndex].anchor.over(b.anchor)});M[Z]=U(M[Z],function(){var p=c.CurrentLibrary.getDragObject(arguments);p=J(v(p),"dragId");p=e[p];p.endpoints[p.floatingAnchorIndex==null?1:p.floatingAnchorIndex].anchor.out()});c.CurrentLibrary.initDroppable(v(b.canvas),M)}return b};this.Defaults={Anchor:null,Anchors:[null,null],BackgroundPaintStyle:null,Connector:null,
- Container:null,DragOptions:{},DropOptions:{},Endpoint:null,Endpoints:[null,null],EndpointStyle:{fillStyle:null},EndpointStyles:[null,null],LabelStyle:{fillStyle:"rgba(0,0,0,0)",color:"black"},LogEnabled:true,MaxConnections:null,PaintStyle:{lineWidth:10,strokeStyle:"red"},Scope:"_jsPlumb_DefaultScope"};this.logEnabled=this.Defaults.LogEnabled;this.connectorClass="_jsPlumb_connector";this.endpointClass="_jsPlumb_endpoint";this.overlayClass="_jsPlumb_overlay";this.Anchors={};this.Connectors={};this.Endpoints=
- {};this.Overlays={};this.addEndpoint=function(a,b){b=c.extend({},b);b.endpoint=b.endpoint||l.Defaults.Endpoint||c.Defaults.Endpoint;b.endpointStyle=b.endpointStyle||l.Defaults.EndpointStyle||c.Defaults.EndpointStyle;var d=v(a),h=J(d,"id");b.source=d;W({elId:h});d=new ea(b);C(t,h,d);var n=y[h];h=d.anchor.compute({xy:[n.left,n.top],wh:r[h],element:d});d.paint({anchorLoc:h});return d};this.addEndpoints=function(a,b){for(var d=[],h=0;h<b.length;h++)d.push(l.addEndpoint(a,b[h]));return d};this.animate=
- function(a,b,d){var h=v(a),n=J(a,"id");d=d||{};a=c.CurrentLibrary.dragEvents.step;var m=c.CurrentLibrary.dragEvents.complete;d[a]=U(d[a],function(){l.repaint(n)});d[m]=U(d[m],function(){l.repaint(n)});c.CurrentLibrary.animate(h,b,d)};this.autoConnect=function(a){var b=[],d=[],h=a.endpoint||l.Defaults.EndpointStyle||c.Defaults.EndpointStyle,n=F||c.Defaults.DynamicAnchors(),m=function(B,N){for(var K=0;K<B.length;K++)N.push(B[K])},A=a.source,D=a.target,F=a.anchors;typeof A=="string"?b.push(v(A)):m(A,
- b);typeof D=="string"?d.push(v(D)):m(D,d);a=c.extend(a,{source:null,target:null,anchors:null});for(m=0;m<b.length;m++)for(A=0;A<d.length;A++){D=c.addEndpoint(b[m],c.extend({anchor:c.makeDynamicAnchor(n)},h));F=c.addEndpoint(d[A],c.extend({anchor:c.makeDynamicAnchor(n)},h));l.connect(c.extend(a,{sourceEndpoint:D,targetEndpoint:F}))}};this.connect=function(a){var b=c.extend({},a);if(a.uuids){b.sourceEndpoint=x[a.uuids[0]];b.targetEndpoint=x[a.uuids[1]]}if(b.sourceEndpoint&&b.sourceEndpoint.isFull())G("could not add connection; source endpoint is full");
- else if(b.targetEndpoint&&b.targetEndpoint.isFull())G("could not add connection; target endpoint is full");else{a=new ga(b);C(u,a.scope,a);l.fireUpdate("jsPlumbConnection",{source:a.source,target:a.target,sourceId:a.sourceId,targetId:a.targetId,sourceEndpoint:a.endpoints[0],targetEndpoint:a.endpoints[1]});I(a.source);return a}};this.deleteEndpoint=function(a){if(a=typeof a=="string"?x[a]:a){var b=a.getUuid();if(b)x[b]=null;a.detachAll();Y(a.canvas,a.container);for(var d in t)if(b=t[d]){for(var h=
- [],n=0;n<b.length;n++)b[n]!=a&&h.push(b[n]);t[d]=h}delete a}};this.deleteEveryEndpoint=function(){for(var a in t){var b=t[a];if(b&&b.length)for(var d=0;d<b.length;d++)l.deleteEndpoint(b[d])}delete t;t={};delete x;x={}};var $=function(a){l.fireUpdate("jsPlumbConnectionDetached",{source:a.source,target:a.target,sourceId:a.sourceId,targetId:a.targetId,sourceEndpoint:a.endpoints[0],targetEndpoint:a.endpoints[1]})};this.detach=function(a,b){if(arguments.length==2){var d=v(a),h=X(d);d=v(b);var n=X(d);da(h,
- function(m){if(m.sourceId==h&&m.targetId==n||m.targetId==h&&m.sourceId==n){Y(m.canvas,m.container);m.endpoints[0].removeConnection(m);m.endpoints[1].removeConnection(m);ca(u,m.scope,m);$(m)}})}else if(arguments.length==1)if(arguments[0].constructor==ga){arguments[0].endpoints[0].detachFrom(arguments[0].endpoints[1]);$(arguments[0])}else if(arguments[0].connection){arguments[0].connection.endpoints[0].detachFrom(arguments[0].connection.endpoints[1]);$(arguments[0].connection)}else{d=c.extend({},a);
- if(d.uuids)x[d.uuids[0]].detachFrom(x[d.uuids[1]]);else if(d.sourceEndpoint&&d.targetEndpoint)d.sourceEndpoint.detachFrom(d.targetEndpoint);else{sourceId=X(d.source);targetId=X(d.target);da(sourceId,function(m){if(m.sourceId==sourceId&&m.targetId==targetId||m.targetId==sourceId&&m.sourceId==targetId){Y(m.canvas,m.container);m.endpoints[0].removeConnection(m);m.endpoints[1].removeConnection(m);ca(u,m.scope,m);$(m)}})}}};this.detachAll=this.detachAllConnections=function(a){a=J(a,"id");if((a=t[a])&&
- a.length)for(var b=0;b<a.length;b++){var d=a[b].connections.length;if(d>0)for(var h=0;h<d;h++){var n=a[b].connections[0];Y(n.canvas,n.container);n.endpoints[0].removeConnection(n);n.endpoints[1].removeConnection(n);ca(u,n.scope,n);$(n)}}};this.detachEverything=this.detachEveryConnection=function(){for(var a in t){var b=t[a];if(b&&b.length)for(var d=0;d<b.length;d++){var h=b[d].connections.length;if(h>0)for(var n=0;n<h;n++){var m=b[d].connections[0];Y(m.canvas,m.container);m.endpoints[0].removeConnection(m);
- m.endpoints[1].removeConnection(m);$(m)}}}delete u;u={}};this.draggable=function(a,b){if(typeof a=="object"&&a.length)for(var d=0;d<a.length;d++){var h=v(a[d]);h&&ba(h,true,b)}else(h=v(a))&&ba(h,true,b)};this.extend=function(a,b){return c.CurrentLibrary.extend(a,b)};this.getConnections=function(a){var b={};a=a||{};var d=function(D){var F=[];if(D)if(typeof D=="string")F.push(D);else F=D;return F},h=d(a.scope),n=d(a.source);a=d(a.target);for(var m in u)if(h.length>0?q(h,m)!=-1:true){b[m]=[];for(d=0;d<
- u[m].length;d++){var A=u[m][d];(n.length>0?q(n,A.sourceId)!=-1:true)&&(a.length>0?q(a,A.targetId)!=-1:true)&&b[m].push({sourceId:A.sourceId,targetId:A.targetId,source:A.source,target:A.target,sourceEndpoint:A.endpoints[0],targetEndpoint:A.endpoints[1],connection:A})}}return b};this.getDefaultScope=function(){return j};this.getEndpoint=function(a){return x[a]};this.getId=X;this.hide=function(a){ia(a,"none")};this.makeAnchor=function(a,b){if(arguments.length==0)return null;var d={};if(arguments.length==
- 1){var h=arguments[0];if(h.compute&&h.getOrientation)return h;else if(typeof h=="string")return l.Anchors[arguments[0]]();else if(h.constructor==Array)return c.makeAnchor.apply(this,h);else typeof arguments[0]=="object"&&c.extend(d,a)}else{d={x:a,y:b};if(arguments.length>=4)d.orientation=[arguments[2],arguments[3]];if(arguments.length==6)d.offsets=[arguments[4],arguments[5]]}h=new ja(d);h.clone=function(){return new ja(d)};return h};this.makeAnchors=function(a){for(var b=[],d=0;d<a.length;d++)b.push(l.Anchors[a[d]]());
- return b};this.makeDynamicAnchor=function(a){return new oa(a)};this.repaint=function(a){if(typeof a=="object")for(var b=0;b<a.length;b++)I(v(a[b]));else I(v(a))};this.repaintEverything=function(){var a=""+(new Date).getTime(),b;for(b in t)I(v(b),null,a)};this.removeAllEndpoints=function(a){a=J(a,"id");var b=t[a],d;for(d in b)l.deleteEndpoint(b[d]);t[a]=[]};this.removeEveryEndpoint=this.deleteEveryEndpoint;this.removeEndpoint=function(a,b){l.deleteEndpoint(b)};this.reset=function(){this.deleteEveryEndpoint();
- this.clearListeners()};this.setAutomaticRepaint=function(){};this.setDefaultNewCanvasSize=function(a){f=a};this.setDefaultScope=function(a){j=a};this.setDraggable=function(a,b){return H(a,function(d,h){g[h]=b;c.CurrentLibrary.isDragSupported(d)&&c.CurrentLibrary.setDraggable(d,b)})};this.setDraggableByDefault=function(a){s=a};this.setDebugLog=function(){};this.setRepaintFunction=function(){};this.show=function(a){ia(a,"block")};this.sizeCanvas=function(a,b,d,h,n){if(a){a.style.height=n+"px";a.height=
- n;a.style.width=h+"px";a.width=h;a.style.left=b+"px";a.style.top=d+"px"}};this.getTestHarness=function(){return{endpointsByElement:t,endpointCount:function(a){return(a=t[a])?a.length:0},connectionCount:function(a){a=a||j;return(a=u[a])?a.length:0},findIndex:q,getId:X}};this.toggleVisible=this.toggle=ma;this.toggleDraggable=function(a){return H(a,function(b,d){var h=g[d]==null?s:g[d];h=!h;g[d]=h;c.CurrentLibrary.setDraggable(b,h);return h})};this.unload=function(){delete t;delete x;delete y;delete r;
- delete e;delete g};this.wrap=U;o.apply(this);this.addListener=this.bind},c=window.jsPlumb=new O;c.getInstance=function(o){var l=new O;o&&c.extend(l.Defaults,o);return l}})();
- (function(){var O=!!!document.createElement("canvas").getContext,c=function(o,l,w,t){return function(){return jsPlumb.makeAnchor(o,l,w,t)}};jsPlumb.Anchors.TopCenter=c(0.5,0,0,-1);jsPlumb.Anchors.BottomCenter=c(0.5,1,0,1);jsPlumb.Anchors.LeftMiddle=c(0,0.5,-1,0);jsPlumb.Anchors.RightMiddle=c(1,0.5,1,0);jsPlumb.Anchors.Center=c(0.5,0.5,0,0);jsPlumb.Anchors.TopRight=c(1,0,0,-1);jsPlumb.Anchors.BottomRight=c(1,1,0,1);jsPlumb.Anchors.TopLeft=c(0,0,0,-1);jsPlumb.Anchors.BottomLeft=c(0,1,0,1);jsPlumb.Defaults.DynamicAnchors=
- function(){return jsPlumb.makeAnchors(["TopCenter","RightMiddle","BottomCenter","LeftMiddle"])};jsPlumb.Anchors.AutoDefault=function(){return jsPlumb.makeDynamicAnchor(jsPlumb.Defaults.DynamicAnchors())};jsPlumb.Connectors.Straight=function(){var o=this,l=null,w,t,x,u,y,k,e,g,s;this.compute=function(r,j,f,q,C,I){f=Math.abs(r[0]-j[0]);q=Math.abs(r[1]-j[1]);var H=0.45*f,G=0.45*q;f*=1.9;q*=1.9;var J=Math.min(r[0],j[0])-H,v=Math.min(r[1],j[1])-G;C=Math.max(2*C,I);if(f<C){f=C;J=r[0]+(j[0]-r[0])/2-C/2;
- H=(f-Math.abs(r[0]-j[0]))/2}if(q<C){q=C;v=r[1]+(j[1]-r[1])/2-C/2;G=(q-Math.abs(r[1]-j[1]))/2}k=r[0]<j[0]?H:f-H;e=r[1]<j[1]?G:q-G;g=r[0]<j[0]?f-H:H;s=r[1]<j[1]?q-G:G;l=[J,v,f,q,k,e,g,s];x=g-k;u=s-e;w=u/x;t=-1*(w*k-e);y=Math.atan(w);return l};this.paint=function(r,j){j.beginPath();j.moveTo(r[4],r[5]);j.lineTo(r[6],r[7]);j.stroke()};this.pointOnPath=function(r){r=k+r*x;return[r,w==Infinity?r+t:w*r+t]};this.gradientAtPoint=function(){return w};this.pointAlongPathFrom=function(r,j){var f=o.pointOnPath(r),
- q=j>0?1:-1,C=Math.abs(j*Math.sin(y));if(e>s)C*=-1;var I=Math.abs(j*Math.cos(y));if(k>g)I*=-1;return[f[0]+q*I,f[1]+q*C]};this.perpendicularToPathAt=function(r,j,f){r=o.pointAlongPathFrom(r,j);j=o.gradientAtPoint(r.location);var q=Math.atan(-1/j);j=f/2*Math.sin(q);f=f/2*Math.cos(q);return[[r[0]+f,r[1]+j],[r[0]-f,r[1]-j]]};this.createGradient=function(r,j){return j.createLinearGradient(r[4],r[5],r[6],r[7])}};jsPlumb.Connectors.Bezier=function(o){var l=this;this.majorAnchor=o||150;this.minorAnchor=10;
- var w=null;this._findControlPoint=function(f,q,C,I,H){I=I.getOrientation();H=H.getOrientation();var G=[],J=l.majorAnchor,v=l.minorAnchor;if(I[0]!=H[0]||I[1]==H[1]){H[0]==0?G.push(C[0]<q[0]?f[0]+v:f[0]-v):G.push(f[0]+J*H[0]);H[1]==0?G.push(C[1]<q[1]?f[1]+v:f[1]-v):G.push(f[1]+J*I[1])}else{I[0]==0?G.push(q[0]<C[0]?f[0]+v:f[0]-v):G.push(f[0]-J*I[0]);I[1]==0?G.push(q[1]<C[1]?f[1]+v:f[1]-v):G.push(f[1]+J*H[1])}return G};var t,x,u,y,k,e,g,s,r;this.compute=function(f,q,C,I,H,G){H=H||0;s=Math.abs(f[0]-q[0])+
- H;r=Math.abs(f[1]-q[1])+H;e=Math.min(f[0],q[0])-H/2;g=Math.min(f[1],q[1])-H/2;u=f[0]<q[0]?s-H/2:H/2;k=f[1]<q[1]?r-H/2:H/2;y=f[0]<q[0]?H/2:s-H/2;_ty=f[1]<q[1]?H/2:r-H/2;t=l._findControlPoint([u,k],f,q,C,I);x=l._findControlPoint([y,_ty],q,f,I,C);f=Math.min(Math.min(u,y),Math.min(t[0],x[0]));q=Math.max(Math.max(u,y),Math.max(t[0],x[0]));if(q>s)s=q;if(f<0){e+=f;f=Math.abs(f);s+=f;t[0]+=f;u+=f;y+=f;x[0]+=f}f=Math.min(Math.min(k,_ty),Math.min(t[1],x[1]));q=Math.max(Math.max(k,_ty),Math.max(t[1],x[1]));
- if(q>r)r=q;if(f<0){g+=f;f=Math.abs(f);r+=f;t[1]+=f;k+=f;_ty+=f;x[1]+=f}if(G&&s<G){f=(G-s)/2;s=G;e-=f;u+=f;y+=f;t[0]+=f;x[0]+=f}if(G&&r<G){f=(G-r)/2;r=G;g-=f;k+=f;_ty+=f;t[1]+=f;x[1]+=f}return w=[e,g,s,r,u,k,y,_ty,t[0],t[1],x[0],x[1]]};this.paint=function(f,q){q.beginPath();q.moveTo(f[4],f[5]);q.bezierCurveTo(f[8],f[9],f[10],f[11],f[6],f[7]);q.stroke()};var j=function(){return[{x:u,y:k},{x:t[0],y:t[1]},{x:x[0],y:x[1]},{x:y,y:_ty}]};this.pointOnPath=function(f){return jsBezier.pointOnCurve(j(),f)};
- this.gradientAtPoint=function(f){return jsBezier.gradientAtPoint(j(),f)};this.pointAlongPathFrom=function(f,q){return jsBezier.pointAlongCurveFrom(j(),f,q)};this.perpendicularToPathAt=function(f,q,C){return jsBezier.perpendicularToCurveAt(j(),f,q,C)};this.createGradient=function(f,q,C){return C?q.createLinearGradient(f[4],f[5],f[6],f[7]):q.createLinearGradient(f[6],f[7],f[4],f[5])}};jsPlumb.Endpoints.Dot=function(o){o=o||{radius:10};var l=this;this.radius=o.radius;var w=0.5*this.radius,t=this.radius/
- 3,x=function(u){try{return parseInt(u)}catch(y){if(u.substring(u.length-1)=="%")return parseInt(u.substring(0,u-1))}};this.paint=function(u,y,k,e,g){var s=e.radius||l.radius;jsPlumb.sizeCanvas(k,u[0]-s,u[1]-s,s*2,s*2);u=k.getContext("2d");k=jsPlumb.extend({},e);if(k.fillStyle==null)k.fillStyle=g.strokeStyle;jsPlumb.extend(u,k);if(e.gradient&&!O){g=e.gradient;k=w;var r=t;if(g.offset)k=x(g.offset);if(g.innerRadius)r=x(g.innerRadius);g=[k,r];y=u.createRadialGradient(s,s,s,s+(y[0]==1?g[0]*-1:g[0]),s+
- (y[1]==1?g[0]*-1:g[0]),g[1]);for(g=0;g<e.gradient.stops.length;g++)y.addColorStop(e.gradient.stops[g][0],e.gradient.stops[g][1]);u.fillStyle=y}u.beginPath();u.arc(s,s,s,0,Math.PI*2,true);u.closePath();u.fill()}};jsPlumb.Endpoints.Rectangle=function(o){o=o||{width:20,height:20};var l=this;this.width=o.width;this.height=o.height;this.paint=function(w,t,x,u,y){var k=u.width||l.width,e=u.height||l.height;jsPlumb.sizeCanvas(x,w[0]-k/2,w[1]-e/2,k,e);w=x.getContext("2d");x=jsPlumb.extend({},u);if(x.fillStyle==
- null)x.fillStyle=y.strokeStyle;jsPlumb.extend(w,x);y=/MSIE/.test(navigator.userAgent)&&!window.opera;if(u.gradient&&!y){t=w.createLinearGradient(t[0]==1?k:t[0]==0?k/2:0,t[1]==1?e:t[1]==0?e/2:0,t[0]==-1?k:t[0]==0?e/2:0,t[1]==-1?e:t[1]==0?e/2:0);for(y=0;y<u.gradient.stops.length;y++)t.addColorStop(u.gradient.stops[y][0],u.gradient.stops[y][1]);w.fillStyle=t}w.beginPath();w.rect(0,0,k,e);w.closePath();w.fill()}};jsPlumb.Endpoints.Triangle=function(o){o=o||{width:15,height:15};var l=this;this.width=o.width;
- this.height=o.height;this.paint=function(w,t,x,u){var y=u.width||l.width,k=u.height||l.height;jsPlumb.sizeCanvas(x,w[0]-y/2,w[1]-k/2,y,k);w=x.getContext("2d");var e=x=0,g=0;if(t[0]==1){x=y;e=k;g=180}if(t[1]==-1){x=y;g=90}if(t[1]==1){e=k;g=-90}w.fillStyle=u.fillStyle;w.translate(x,e);w.rotate(g*Math.PI/180);w.beginPath();w.moveTo(0,0);w.lineTo(y/2,k/2);w.lineTo(0,k);w.closePath();w.fill()}};jsPlumb.Endpoints.Image=function(o){var l=this;this.img=new Image;this.img.onload=function(){l.ready=true};this.img.src=
- o.src||o.url;var w=function(t,x,u,y){x=l.img.width||y.width;y=l.img.height||y.height;jsPlumb.sizeCanvas(u,t[0]-x/2,t[1]-y/2,x,y);u.getContext("2d").drawImage(l.img,0,0)};this.paint=function(t,x,u,y,k){l.ready?w(t,x,u,y,k):window.setTimeout(function(){l.paint(t,x,u,y,k)},200)}};jsPlumb.Overlays.Arrow=function(o){o=o||{};var l=this,w=o.length||20,t=o.width||20,x=o.fillStyle||"black",u=o.strokeStyle,y=o.lineWidth||1;this.loc=o.location||0.5;var k=o.foldback||0.623;this.computeMaxSize=function(){return t*
- 1.5};this.draw=function(e,g){var s=e.pointAlongPathFrom(l.loc,w/2);e.pointAlongPathFrom(l.loc,-w/2);var r=e.perpendicularToPathAt(l.loc,-w/2,t),j;j=l.loc;j=k==0.5?e.pointOnPath(j):e.pointAlongPathFrom(j,w*(0.5-k));g.lineWidth=y;g.beginPath();g.moveTo(s[0],s[1]);g.lineTo(r[0][0],r[0][1]);g.lineTo(j[0],j[1]);g.lineTo(r[1][0],r[1][1]);g.lineTo(s[0],s[1]);g.closePath();if(u){g.strokeStyle=u;g.stroke()}g.fillStyle=x;g.fill()}};jsPlumb.Overlays.PlainArrow=function(o){o=o||{};o=jsPlumb.extend(o,{foldback:1});
- jsPlumb.Overlays.Arrow.call(this,o)};jsPlumb.Overlays.Diamond=function(o){o=o||{};o=jsPlumb.extend(o,{length:(o.length||40)/2,foldback:2});jsPlumb.Overlays.Arrow.call(this,o)};jsPlumb.Overlays.Label=function(o){this.labelStyle=o.labelStyle||jsPlumb.Defaults.LabelStyle;this.label=o.label;var l=this,w=null,t=null,x=null,u=null;this.location=o.location||0.5;this.cachedDimensions=null;var y=function(k){if(l.cachedDimensions)return l.cachedDimensions;x=typeof l.label=="function"?l.label(l):l.label;var e=
- {};if(x){e=x.split("\n");k.save();if(l.labelStyle.font)k.font=l.labelStyle.font;var g,s=0;for(g=0;g<e.length;g++){var r=k.measureText(e[g]).width;if(r>s)s=r}g=s;s=k.measureText("M").width;u=l.labelStyle.padding||0.25;w=g+2*g*u;t=e.length*s+2*s*u;g=e.length*s;k.restore();e={width:w,height:t,lines:e,oneLine:s,padding:u,textHeight:g}}if(typeof l.label!="function")l.cachedDimensions=e;return e};this.computeMaxSize=function(k,e){var g=y(e);return g.width?Math.max(g.width,g.height)*1.5:0};this.draw=function(k,
- e){var g=y(e);if(g.width){var s=k.pointOnPath(l.location);if(l.labelStyle.font)e.font=l.labelStyle.font;e.fillStyle=l.labelStyle.fillStyle?l.labelStyle.fillStyle:"rgba(0,0,0,0)";e.fillRect(s[0]-g.width/2,s[1]-g.height/2,g.width,g.height);if(l.labelStyle.color)e.fillStyle=l.labelStyle.color;e.textBaseline="middle";e.textAlign="center";for(i=0;i<g.lines.length;i++)e.fillText(g.lines[i],s[0],s[1]-g.textHeight/2+g.oneLine/2+i*g.oneLine);if(l.labelStyle.borderWidth>0){e.strokeStyle=l.labelStyle.borderStyle||
- "black";e.strokeRect(s[0]-g.width/2,s[1]-g.height/2,g.width,g.height)}}}};jsPlumb.Overlays.Image=function(o){var l=this;this.location=o.location||0.5;this.img=new Image;var w=null,t=null,x,u,y=o.events||{};this.img.onload=function(){l.ready=true};this.img.src=o.src||o.url;t=window.setInterval(function(){if(l.ready){window.clearInterval(t);w=document.createElement("img");w.src=l.img.src;w.style.position="absolute";w.style.display="none";w.className="_jsPlumb_overlay";document.body.appendChild(w);for(var e in y)jsPlumb.CurrentLibrary.bind(w,
- e,y[e]);if(x&&u){k(x,u);x=u=null}}},250);this.computeMaxSize=function(){return[l.img.width,l.img.height]};var k=function(e,g){var s=e.pointOnPath(l.location),r=jsPlumb.CurrentLibrary.getElementObject(g.canvas);r=jsPlumb.CurrentLibrary.getOffset(r);jsPlumb.CurrentLibrary.setOffset(w,{left:r.left+s[0]-l.img.width/2,top:r.top+s[1]-l.img.height/2});w.style.display="block"};this.draw=function(e,g){if(l.ready)k(e,g);else{x=e;u=g}}}})();
- (function(O){O.fn.plumb=function(c){c=O.extend({},c);return this.each(function(){var o=O.extend({source:O(this)},c);jsPlumb.connect(o)})};O.fn.detach=function(c){return this.each(function(){if(c){var o=O(this).attr("id");if(typeof c=="string")c=[c];for(var l=0;l<c.length;l++)jsPlumb.detach(o,c[l])}})};O.fn.detachAll=function(){return this.each(function(){var c=O(this).attr("id");jsPlumb.detachAll(c)})};O.fn.addEndpoint=function(c){var o=[];this.each(function(){o.push(jsPlumb.addEndpoint(O(this).attr("id"),
- c))});return o[0]};O.fn.addEndpoints=function(c){var o=[];return this.each(function(){for(var l=jsPlumb.addEndpoints(O(this).attr("id"),c),w=0;w<l.length;w++)o.push(l[w])})};O.fn.removeEndpoint=function(c){this.each(function(){jsPlumb.removeEndpoint(O(this).attr("id"),c)})}})(jQuery);
- (function(O){jsPlumb.CurrentLibrary={dragEvents:{start:"start",stop:"stop",drag:"drag",step:"step",over:"over",out:"out",drop:"drop",complete:"complete"},bind:function(c,o,l){c=jsPlumb.CurrentLibrary.getElementObject(c);c.bind(o,l)},appendElement:function(c,o){jsPlumb.CurrentLibrary.getElementObject(o).append(c)},extend:function(c,o){return O.extend(c,o)},getElementObject:function(c){return typeof c=="string"?O("#"+c):O(c)},getOffset:function(c){return c.offset()},getSize:function(c){return[c.outerWidth(),
- c.outerHeight()]},getAttribute:function(c,o){return c.attr(o)},setAttribute:function(c,o,l){c.attr(o,l)},addClass:function(c,o){c.addClass(o)},removeClass:function(c,o){c.removeClass(o)},initDraggable:function(c,o){o.helper=null;o.scope=o.scope||jsPlumb.Defaults.Scope;c.draggable(o)},isDragSupported:function(c){return c.draggable},setDraggable:function(c,o){c.draggable("option","disabled",!o)},initDroppable:function(c,o){o.scope=o.scope||jsPlumb.Defaults.Scope;c.droppable(o)},isDropSupported:function(c){return c.droppable},
- animate:function(c,o,l){c.animate(o,l)},getUIPosition:function(c){c=c[1];return c.offset||c.absolutePosition},getDragObject:function(c){return c[1].draggable},removeElement:function(c){jsPlumb.CurrentLibrary.getElementObject(c).remove()},getScrollLeft:function(c){return c.scrollLeft()},getScrollTop:function(c){return c.scrollTop()},setOffset:function(c,o){jsPlumb.CurrentLibrary.getElementObject(c).offset(o)}}})(jQuery);
- (function(){var O=Math.pow(2,-65),c=function(k,e){return{x:k.x-e.x,y:k.y-e.y}},o=function(k){return k.x*k.x+k.y*k.y},l=function(k,e){var g,s,r=Array(5),j,f,q,C;g=Array(4);q=Array(3);s=[];var I=[[1,0.6,0.3,0.1],[0.4,0.6,0.6,0.4],[0.1,0.3,0.6,1]];for(j=0;j<=3;j++)g[j]=c(e[j],k);for(j=0;j<=2;j++){q[j]=c(e[j+1],e[j]);q[j]={x:q[j].x*3,y:q[j].y*3}}for(j=0;j<=2;j++)for(C=0;C<=3;C++){s[j]||(s[j]=[]);s[j][C]=q[j].x*g[C].x+q[j].y*g[C].y}g=[];for(j=0;j<=5;j++){g[j]||(g[j]=[]);g[j].y=0;g[j].x=parseFloat(j)/5}for(q=
- 0;q<=5;q++){j=Math.max(0,q-2);C=Math.min(q,3);for(j=j;j<=C;j++){f=q-j;g[j+f].y+=s[f][j]*I[f][j]}}a:{q=Array(6);j=Array(6);s=Array(6);I=Array(6);C=0;var H;H=g[0].y==0?0:g[0].y>0?1:-1;for(var G=1;G<=5;G++){f=g[G].y==0?0:g[G].y>0?1:-1;f!=H&&C++;H=f}switch(C){case 0:g=0;break a;case 1:var J,v,S;C=g[0].y-g[5].y;f=g[5].x-g[0].x;H=g[0].x*g[5].y-g[5].x*g[0].y;G=max_distance_below=0;for(S=1;S<5;S++){J=C*g[S].x+f*g[S].y+H;if(J>G)G=J;else if(J<max_distance_below)max_distance_below=J}v=C;J=f;S=H-G;v=0*J-v*1;
- v=1/v;G=(1*S-J*0)*v;v=C;J=f;S=H-max_distance_below;v=0*J-v*1;v=1/v;C=(1*S-J*0)*v;if(Math.max(G,C)-Math.min(G,C)<O?1:0){s=g[5].x-g[0].x;I=g[5].y-g[0].y;r[0]=0+1*(s*(g[0].y-0)-I*(g[0].x-0))*(1/(s*0-I*1));g=1;break a}}w(g,5,0.5,q,j);g=FindRoots(q,5,s,1);q=FindRoots(j,5,I,1);for(j=0;j<g;j++)r[j]=s[j];for(j=0;j<q;j++)r[j+g]=I[j];g=g+q}q=c(k,e[0]);I=o(q);for(j=s=0;j<g;j++){q=w(e,3,r[j],null,null);q=c(k,q);q=o(q);if(q<I){I=q;s=r[j]}}q=c(k,e[3]);q=o(q);if(q<I){I=q;s=1}return{t:s,d:I}},w=function(k,e,g,s,
- r){for(var j=[],f=0;f<=e;f++){j[0]||(j[0]=[]);j[0][f]=k[f]}for(k=1;k<=e;k++)for(f=0;f<=e-k;f++){j[k]||(j[k]=[]);j[k][f]||(j[k][f]={});j[k][f].x=(1-g)*j[k-1][f].x+g*j[k-1][f+1].x;j[k][f].y=(1-g)*j[k-1][f].y+g*j[k-1][f+1].y}if(s!=null)for(f=0;f<=e;f++)s[f]=j[f][0];if(r!=null)for(f=0;f<=e;f++)r[f]=j[e-f][f];return j[e][0]},t=function(k,e){return[k[0].x*e*e*e+k[1].x*3*e*e*(1-e)+k[2].x*3*e*(1-e)*(1-e)+k[3].x*(1-e)*(1-e)*(1-e),k[0].y*e*e*e+k[1].y*3*e*e*(1-e)+k[2].y*3*e*(1-e)*(1-e)+k[3].y*(1-e)*(1-e)*(1-
- e)]},x=function(k,e){return[k[0].x*e*e+k[1].x*2*e*(1-e)+k[2].x*(1-e)*(1-e),k[0].y*e*e+k[1].y*2*e*(1-e)+k[2].y*(1-e)*(1-e)]},u=function(k,e,g){var s=t(k,e),r=0;e=e;for(var j=g>0?1:-1,f=null;r<Math.abs(g);){e+=0.0050*j;f=t(k,e);r+=Math.sqrt(Math.pow(f[0]-s[0],2)+Math.pow(f[1]-s[1],2));s=f}return{point:f,location:e}},y=function(k,e){var g=t(k,e),s=x(k,e);return Math.atan((s[1]-g[1])/(s[0]-g[0]))};window.jsBezier={distanceFromCurve:l,gradientAtPoint:y,nearestPointOnCurve:function(k,e){var g=l(k,e);return w(e,
- 3,g.t,null,null)},pointOnCurve:t,pointAlongCurveFrom:function(k,e,g){return u(k,e,g).point},perpendicularToCurveAt:function(k,e,g,s){e=u(k,e,g);k=y(k,e.location);g=Math.atan(-1/k);k=s/2*Math.sin(g);s=s/2*Math.cos(g);return[[e.point[0]+s,e.point[1]+k],[e.point[0]-s,e.point[1]-k]]},quadraticPointOnCurve:x}})();
|