stratos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From im...@apache.org
Subject [5/8] stratos git commit: jsPlumb lib added to application editor
Date Sat, 13 Dec 2014 04:19:32 GMT
http://git-wip-us.apache.org/repos/asf/stratos/blob/f72d80fd/components/org.apache.stratos.manager.console/console/themes/theme0/js/jsplumb-1.7.2/dom.jsPlumb-1.7.2-min.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/js/jsplumb-1.7.2/dom.jsPlumb-1.7.2-min.js b/components/org.apache.stratos.manager.console/console/themes/theme0/js/jsplumb-1.7.2/dom.jsPlumb-1.7.2-min.js
new file mode 100644
index 0000000..5e22a63
--- /dev/null
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/js/jsplumb-1.7.2/dom.jsPlumb-1.7.2-min.js
@@ -0,0 +1,6 @@
+!function(){"undefined"==typeof Math.sgn&&(Math.sgn=function(a){return 0==a?0:a>0?1:-1});var a={subtract:function(a,b){return{x:a.x-b.x,y:a.y-b.y}},dotProduct:function(a,b){return a.x*b.x+a.y*b.y},square:function(a){return Math.sqrt(a.x*a.x+a.y*a.y)},scale:function(a,b){return{x:a.x*b,y:a.y*b}}},b=64,c=Math.pow(2,-b-1),d=function(b,c){for(var d=[],e=f(b,c),h=c.length-1,i=2*h-1,j=g(e,i,d,0),k=a.subtract(b,c[0]),m=a.square(k),n=0,o=0;j>o;o++){k=a.subtract(b,l(c,h,d[o],null,null));var p=a.square(k);m>p&&(m=p,n=d[o])}return k=a.subtract(b,c[h]),p=a.square(k),m>p&&(m=p,n=1),{location:n,distance:m}},e=function(a,b){var c=d(a,b);return{point:l(b,b.length-1,c.location,null,null),location:c.location}},f=function(b,c){for(var d=c.length-1,e=2*d-1,f=[],g=[],h=[],i=[],k=[[1,.6,.3,.1],[.4,.6,.6,.4],[.1,.3,.6,1]],l=0;d>=l;l++)f[l]=a.subtract(c[l],b);for(var l=0;d-1>=l;l++)g[l]=a.subtract(c[l+1],c[l]),g[l]=a.scale(g[l],3);for(var m=0;d-1>=m;m++)for(var n=0;d>=n;n++)h[m]||(h[m]=[]),h[m][n]=a.dotPro
 duct(g[m],f[n]);for(l=0;e>=l;l++)i[l]||(i[l]=[]),i[l].y=0,i[l].x=parseFloat(l)/e;for(var o=d,p=d-1,q=0;o+p>=q;q++){var r=Math.max(0,q-p),s=Math.min(q,o);for(l=r;s>=l;l++)j=q-l,i[l+j].y+=h[j][l]*k[j][l]}return i},g=function(a,c,d,e){var f,j,m=[],n=[],o=[],p=[];switch(h(a,c)){case 0:return 0;case 1:if(e>=b)return d[0]=(a[0].x+a[c].x)/2,1;if(i(a,c))return d[0]=k(a,c),1}l(a,c,.5,m,n),f=g(m,c,o,e+1),j=g(n,c,p,e+1);for(var q=0;f>q;q++)d[q]=o[q];for(var q=0;j>q;q++)d[q+f]=p[q];return f+j},h=function(a,b){var c,d,e=0;c=d=Math.sgn(a[0].y);for(var f=1;b>=f;f++)c=Math.sgn(a[f].y),c!=d&&e++,d=c;return e},i=function(a,b){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;i=a[0].y-a[b].y,j=a[b].x-a[0].x,k=a[0].x*a[b].y-a[b].x*a[0].y;for(var t=max_distance_below=0,u=1;b>u;u++){var v=i*a[u].x+j*a[u].y+k;v>t?t=v:max_distance_below>v&&(max_distance_below=v)}return n=0,o=1,p=0,q=i,r=j,s=k-t,l=n*r-q*o,m=1/l,e=(o*s-r*p)*m,q=i,r=j,s=k-max_distance_below,l=n*r-q*o,m=1/l,f=(o*s-r*p)*m,g=Math.min(e,f),h=Math.max(e,f),d=h-
 g,c>d?1:0},k=function(a,b){var c=1,d=0,e=a[b].x-a[0].x,f=a[b].y-a[0].y,g=a[0].x-0,h=a[0].y-0,i=e*d-f*c,j=1/i,k=(e*h-f*g)*j;return 0+c*k},l=function(a,b,c,d,e){for(var f=[[]],g=0;b>=g;g++)f[0][g]=a[g];for(var h=1;b>=h;h++)for(var g=0;b-h>=g;g++)f[h]||(f[h]=[]),f[h][g]||(f[h][g]={}),f[h][g].x=(1-c)*f[h-1][g].x+c*f[h-1][g+1].x,f[h][g].y=(1-c)*f[h-1][g].y+c*f[h-1][g+1].y;if(null!=d)for(g=0;b>=g;g++)d[g]=f[g][0];if(null!=e)for(g=0;b>=g;g++)e[g]=f[b-g][g];return f[b][0]},m={},n=function(a){var b=m[a];if(!b){b=[];var c=function(){return function(b){return Math.pow(b,a)}},d=function(){return function(b){return Math.pow(1-b,a)}},e=function(a){return function(){return a}},f=function(){return function(a){return a}},g=function(){return function(a){return 1-a}},h=function(a){return function(b){for(var c=1,d=0;d<a.length;d++)c*=a[d](b);return c}};b.push(new c);for(var i=1;a>i;i++){for(var j=[new e(a)],k=0;a-i>k;k++)j.push(new f);for(var k=0;i>k;k++)j.push(new g);b.push(new h(j))}b.push(new d),m[a
 ]=b}return b},o=function(a,b){for(var c=n(a.length-1),d=0,e=0,f=0;f<a.length;f++)d+=a[f].x*c[f](b),e+=a[f].y*c[f](b);return{x:d,y:e}},p=function(a,b){return Math.sqrt(Math.pow(a.x-b.x,2)+Math.pow(a.y-b.y,2))},q=function(a){return a[0].x==a[1].x&&a[0].y==a[1].y},r=function(a,b,c){if(q(a))return{point:a[0],location:b};for(var d=o(a,b),e=0,f=b,g=c>0?1:-1,h=null;e<Math.abs(c);)f+=.005*g,h=o(a,f),e+=p(h,d),d=h;return{point:h,location:f}},s=function(a){if(q(a))return 0;for(var b=o(a,0),c=0,d=0,e=1,f=null;1>d;)d+=.005*e,f=o(a,d),c+=p(f,b),b=f;return c},t=function(a,b,c){return r(a,b,c).point},u=function(a,b,c){return r(a,b,c).location},v=function(a,b){var c=o(a,b),d=o(a.slice(0,a.length-1),b),e=d.y-c.y,f=d.x-c.x;return 0==e?1/0:Math.atan(e/f)},w=function(a,b,c){var d=r(a,b,c);return d.location>1&&(d.location=1),d.location<0&&(d.location=0),v(a,d.location)},x=function(a,b,c,d){d=null==d?0:d;var e=r(a,b,d),f=v(a,e.location),g=Math.atan(-1/f),h=c/2*Math.sin(g),i=c/2*Math.cos(g);return[{x:e.po
 int.x+i,y:e.point.y+h},{x:e.point.x-i,y:e.point.y-h}]};window.jsBezier={distanceFromCurve:d,gradientAtPoint:v,gradientAtPointAlongCurveFrom:w,nearestPointOnCurve:e,pointOnCurve:o,pointAlongCurveFrom:t,perpendicularToCurveAt:x,locationAlongCurveFrom:u,getLength:s}}(),function(){"use strict";var a=this.Biltong={},b=function(a){return"[object Array]"===Object.prototype.toString.call(a)},c=function(a,c,d){return a=b(a)?a:[a.x,a.y],c=b(c)?c:[c.x,c.y],d(a,c)},d=a.gradient=function(a,b){return c(a,b,function(a,b){return b[0]==a[0]?b[1]>a[1]?1/0:-1/0:b[1]==a[1]?b[0]>a[0]?0:-0:(b[1]-a[1])/(b[0]-a[0])})},e=(a.normal=function(a,b){return-1/d(a,b)},a.lineLength=function(a,b){return c(a,b,function(a,b){return Math.sqrt(Math.pow(b[1]-a[1],2)+Math.pow(b[0]-a[0],2))})},a.quadrant=function(a,b){return c(a,b,function(a,b){return b[0]>a[0]?b[1]>a[1]?2:1:b[0]==a[0]?b[1]>a[1]?2:1:b[1]>a[1]?3:4})}),f=(a.theta=function(a,b){return c(a,b,function(a,b){var c=d(a,b),f=Math.atan(c),g=e(a,b);return(4==g||3==g)
 &&(f+=Math.PI),0>f&&(f+=2*Math.PI),f})},a.intersects=function(a,b){var c=a.x,d=a.x+a.w,e=a.y,f=a.y+a.h,g=b.x,h=b.x+b.w,i=b.y,j=b.y+b.h;return g>=c&&d>=g&&i>=e&&f>=i||h>=c&&d>=h&&i>=e&&f>=i||g>=c&&d>=g&&j>=e&&f>=j||h>=c&&d>=g&&j>=e&&f>=j||c>=g&&h>=c&&e>=i&&j>=e||d>=g&&h>=d&&e>=i&&j>=e||c>=g&&h>=c&&f>=i&&j>=f||d>=g&&h>=c&&f>=i&&j>=f},a.encloses=function(a,b,c){var d=a.x,e=a.x+a.w,f=a.y,g=a.y+a.h,h=b.x,i=b.x+b.w,j=b.y,k=b.y+b.h,l=function(a,b,d,e){return c?b>=a&&d>=e:b>a&&d>e};return l(d,h,e,i)&&l(f,j,g,k)},[null,[1,-1],[1,1],[-1,1],[-1,-1]]),g=[null,[-1,-1],[-1,1],[1,1],[1,-1]];a.pointOnLine=function(a,b,c){var h=d(a,b),i=e(a,b),j=c>0?f[i]:g[i],k=Math.atan(h),l=Math.abs(c*Math.sin(k))*j[1],m=Math.abs(c*Math.cos(k))*j[0];return{x:a.x+m,y:a.y+l}},a.perpendicularLineTo=function(a,b,c){var e=d(a,b),f=Math.atan(-1/e),g=c/2*Math.sin(f),h=c/2*Math.cos(f);return[{x:b.x+h,y:b.y+g},{x:b.x-h,y:b.y-g}]}}.call(this),function(){"use strict";var a={android:navigator.userAgent.toLowerCase().indexOf("
 android")>-1},b=function(a,b,c){c=c||a.parentNode;for(var d=c.querySelectorAll(b),e=0;e<d.length;e++)if(d[e]===a)return!0;return!1},c=function(a){return"string"==typeof a?document.getElementById(a):a},d=function(a){return a.srcElement||a.target},e=function(a,b){for(var c=0,d=a.length;d>c&&a[c]!=b;c++);c<a.length&&a.splice(c,1)},f=1,g=function(a,b,c){var d=f++;return a.__ta=a.__ta||{},a.__ta[b]=a.__ta[b]||{},a.__ta[b][d]=c,c.__tauid=d,d},h=function(a,b,c){if(a.__ta&&a.__ta[b]&&delete a.__ta[b][c.__tauid],c.__taExtra){for(var d=0;d<c.__taExtra.length;d++)D(a,c.__taExtra[d][0],c.__taExtra[d][1]);c.__taExtra.length=0}c.__taUnstore&&c.__taUnstore()},i=function(a,c,e,f){if(null==a)return e;var g=a.split(","),h=function(a){h.__tauid=e.__tauid;for(var f=d(a),i=0;i<g.length;i++)b(f,g[i],c)&&e.apply(f,arguments)};return j(e,f,h),h},j=function(a,b,c){a.__taExtra=a.__taExtra||[],a.__taExtra.push([b,c])},k=function(a,b,c,d){q&&s[b]?C(a,s[b],i(d,a,c,s[b]),c):C(a,b,i(d,a,c,b),c)},l=function(a,b,c,
 f){if(null==a.__taSmartClicks){var g=function(b){a.__tad=w(b)},h=function(b){a.__tau=w(b)},i=function(b){if(a.__tad&&a.__tau&&a.__tad[0]===a.__tau[0]&&a.__tad[1]===a.__tau[1])for(var c=0;c<a.__taSmartClicks.length;c++)a.__taSmartClicks[c].apply(d(b),[b])};k(a,"mousedown",g,f),k(a,"mouseup",h,f),k(a,"click",i,f),a.__taSmartClicks=[]}a.__taSmartClicks.push(c),c.__taUnstore=function(){e(a.__taSmartClicks,c)}},m={tap:{touches:1,taps:1},dbltap:{touches:1,taps:2},contextmenu:{touches:2,taps:1}},n=function(a,c){return function(f,g,h,i){if("contextmenu"==g&&r)k(f,g,h,i);else{if(null==f.__taTapHandler){var j=f.__taTapHandler={tap:[],dbltap:[],contextmenu:[],down:!1,taps:0,downSelectors:[]},l=function(d){for(var e=d.srcElement||d.target,g=0;g<j.downSelectors.length;g++)if(null==j.downSelectors[g]||b(e,j.downSelectors[g],f)){j.down=!0,setTimeout(o,a),setTimeout(p,c);break}},n=function(a){if(j.down){var c=a.srcElement||a.target;j.taps++;var e=B(a);for(var g in m){var h=m[g];if(h.touches===e&&(1
 ===h.taps||h.taps===j.taps))for(var i=0;i<j[g].length;i++)(null==j[g][i][1]||b(c,j[g][i][1],f))&&j[g][i][0].apply(d(a),[a])}}},o=function(){j.down=!1},p=function(){j.taps=0};k(f,"mousedown",l),k(f,"mouseup",n)}f.__taTapHandler.downSelectors.push(i),f.__taTapHandler[g].push([h,i]),h.__taUnstore=function(){e(f.__taTapHandler[g],h)}}}},o=function(a,b,c,d){for(var e in c.__tamee[a])c.__tamee[a][e].apply(d,[b])},p=function(){var a=[];return function(c,e,f,h){if(!c.__tamee){c.__tamee={over:!1,mouseenter:[],mouseexit:[]};var j=function(e){var f=d(e);(null==h&&f==c&&!c.__tamee.over||b(f,h,c)&&(null==f.__tamee||!f.__tamee.over))&&(o("mouseenter",e,c,f),f.__tamee=f.__tamee||{},f.__tamee.over=!0,a.push(f))},k=function(e){for(var f=d(e),g=0;g<a.length;g++)f!=a[g]||b(e.relatedTarget||e.toElement,"*",f)||(f.__tamee.over=!1,a.splice(g,1),o("mouseexit",e,c,f))};C(c,"mouseover",i(h,c,j,"mouseover"),j),C(c,"mouseout",i(h,c,k,"mouseout"),k)}f.__taUnstore=function(){delete c.__tamee[e][f.__tauid]},g(c,
 e,f),c.__tamee[e][f.__tauid]=f}},q="ontouchstart"in document.documentElement,r="onmousedown"in document.documentElement,s={mousedown:"touchstart",mouseup:"touchend",mousemove:"touchmove"},t=function(){var a=-1;if("Microsoft Internet Explorer"==navigator.appName){var b=navigator.userAgent,c=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");null!=c.exec(b)&&(a=parseFloat(RegExp.$1))}return a}(),u=t>-1&&9>t,v=function(a,b){if(null==a)return[0,0];var c=A(a),d=z(c,0);return[d[b+"X"],d[b+"Y"]]},w=function(a){return null==a?[0,0]:u?[a.clientX+document.documentElement.scrollLeft,a.clientY+document.documentElement.scrollTop]:v(a,"page")},x=function(a){return v(a,"screen")},y=function(a){return v(a,"client")},z=function(a,b){return a.item?a.item(b):a[b]},A=function(a){return a.touches&&a.touches.length>0?a.touches:a.changedTouches&&a.changedTouches.length>0?a.changedTouches:a.targetTouches&&a.targetTouches.length>0?a.targetTouches:[a]},B=function(a){return A(a).length},C=function(a,b,c,d){if(g(a,b,c),
 d.__tauid=c.__tauid,a.addEventListener)a.addEventListener(b,c,!1);else if(a.attachEvent){var e=b+c.__tauid;a["e"+e]=c,a[e]=function(){a["e"+e]&&a["e"+e](window.event)},a.attachEvent("on"+b,a[e])}},D=function(a,b,d){null!=d&&E(a,function(){var a=c(this);if(h(a,b,d),null!=d.__tauid)if(a.removeEventListener)a.removeEventListener(b,d,!1);else if(this.detachEvent){var e=b+d.__tauid;a[e]&&a.detachEvent("on"+b,a[e]),a[e]=null,a["e"+e]=null}})},E=function(a,b){if(null!=a){a="string"!=typeof a&&null==a.tagName&&null!=a.length?a:"string"==typeof a?document.querySelectorAll(a):[a];for(var c=0;c<a.length;c++)b.apply(a[c])}};this.Mottle=function(b){b=b||{};var d=b.clickThreshold||150,e=b.dblClickThreshold||350,f=new p,g=new n(d,e),h=b.smartClicks,i=function(a,b,d,e){null!=d&&E(a,function(){var a=c(this);h&&"click"===b?l(a,b,d,e):"tap"===b||"dbltap"===b||"contextmenu"===b?g(a,b,d,e):"mouseenter"===b||"mouseexit"==b?f(a,b,d,e):k(a,b,d,e)})};this.remove=function(a){return E(a,function(){var a=c(thi
 s);if(a.__ta)for(var b in a.__ta)for(var d in a.__ta[b])D(a,b,a.__ta[b][d]);a.parentNode&&a.parentNode.removeChild(a)}),this},this.on=function(){var a=arguments[0],b=4==arguments.length?arguments[2]:null,c=arguments[1],d=arguments[arguments.length-1];return i(a,c,d,b),this},this.off=function(a,b,c){return D(a,b,c),this},this.trigger=function(b,d,e,f){var g=q&&s[d]?s[d]:d,h=w(e),i=x(e),j=y(e);return E(b,function(){var b,k=c(this);e=e||{screenX:i[0],screenY:i[1],clientX:j[0],clientY:j[1]};var l=function(a){f&&(a.payload=f)},m={TouchEvent:function(a){var b=document.createTouch(window,k,0,h[0],h[1],i[0],i[1],j[0],j[1],0,0,0,0);a.initTouchEvent(g,!0,!0,window,0,i[0],i[1],j[0],j[1],!1,!1,!1,!1,document.createTouchList(b))},MouseEvents:function(b){if(b.initMouseEvent(g,!0,!0,window,0,i[0],i[1],j[0],j[1],!1,!1,!1,!1,1,k),a.android){var c=document.createTouch(window,k,0,h[0],h[1],i[0],i[1],j[0],j[1],0,0,0,0);b.touches=b.targetTouches=b.changedTouches=document.createTouchList(c)}}};if(documen
 t.createEvent){var n=q&&s[d]&&!a.android,o=n?"TouchEvent":"MouseEvents";b=document.createEvent(o),m[o](b),l(b),k.dispatchEvent(b)}else document.createEventObject&&(b=document.createEventObject(),b.eventType=b.eventName=g,b.screenX=i[0],b.screenY=i[1],b.clientX=j[0],b.clientY=j[1],l(b),k.fireEvent("on"+g,b))}),this}},Mottle.consume=function(a,b){a.stopPropagation?a.stopPropagation():a.returnValue=!1,!b&&a.preventDefault&&a.preventDefault()},Mottle.pageLocation=w}.call(this),function(){"use strict";var a=function(a){var b=a.getBoundingClientRect(),c=document.body,d=document.documentElement,e=window.pageYOffset||d.scrollTop||c.scrollTop,f=window.pageXOffset||d.scrollLeft||c.scrollLeft,g=d.clientTop||c.clientTop||0,h=d.clientLeft||c.clientLeft||0,i=b.top+e-g,j=b.left+f-h;return{top:Math.round(i),left:Math.round(j)}},b=function(a,b,c){c=c||a.parentNode;for(var d=c.querySelectorAll(b),e=0;e<d.length;e++)if(d[e]===a)return!0;return!1},c=function(){var a=-1;if("Microsoft Internet Explorer"=
 =navigator.appName){var b=navigator.userAgent,c=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");null!=c.exec(b)&&(a=parseFloat(RegExp.$1))}return a}(),d=c>-1&&9>c,e=function(a){if(d)return[a.clientX+document.documentElement.scrollLeft,a.clientY+document.documentElement.scrollTop];var b=g(a),c=f(b,0);return[c.pageX,c.pageY]},f=function(a,b){return a.item?a.item(b):a[b]},g=function(a){return a.touches&&a.touches.length>0?a.touches:a.changedTouches&&a.changedTouches.length>0?a.changedTouches:a.targetTouches&&a.targetTouches.length>0?a.targetTouches:[a]},h={draggable:"katavorio-draggable",droppable:"katavorio-droppable",drag:"katavorio-drag",selected:"katavorio-drag-selected",active:"katavorio-drag-active",hover:"katavorio-drag-hover",noSelect:"katavorio-drag-no-select"},i="katavorio-drag-scope",j=["stop","start","drag","drop","over","out"],k=function(){},l=function(){return!0},m=function(a,b,c){for(var d=0;d<a.length;d++)a[d]!=c&&b(a[d])},n=function(a,b,c,d){m(a,function(a){a.setActive(b),b&&
 a.updatePosition(),c&&a.setHover(d,b)})},o=function(a,b){if(null!=a){a="string"!=typeof a&&null==a.tagName&&null!=a.length?a:[a];for(var c=0;c<a.length;c++)b.apply(a[c],[a[c]])}},p=function(a){a.stopPropagation?(a.stopPropagation(),a.preventDefault()):a.returnValue=!1},q="input,textarea,select,button",r=function(a,c,d){var e=a.srcElement||a.target;return!b(e,d.getInputFilterSelector(),c)},s=function(a,b,c,d){this.params=b||{},this.el=a,this.params.addClass(this.el,this._class);var e=!0;return this.setEnabled=function(a){e=a},this.isEnabled=function(){return e},this.toggleEnabled=function(){e=!e},this.setScope=function(a){this.scopes=a?a.split(/\s+/):[d]},this.addScope=function(a){var b={};o(this.scopes,function(a){b[a]=!0}),o(a?a.split(/\s+/):[],function(a){b[a]=!0}),this.scopes=[];for(var c in b)this.scopes.push(c)},this.removeScope=function(a){var b={};o(this.scopes,function(a){b[a]=!0}),o(a?a.split(/\s+/):[],function(a){delete b[a]}),this.scopes=[];for(var c in b)this.scopes.push
 (c)},this.toggleScope=function(a){var b={};o(this.scopes,function(a){b[a]=!0}),o(a?a.split(/\s+/):[],function(a){b[a]?delete b[a]:b[a]=!0}),this.scopes=[];for(var c in b)this.scopes.push(c)},this.setScope(b.scope),this.k=b.katavorio,b.katavorio},t=function(c,d,f){this._class=f.draggable;var g=s.apply(this,arguments);this.rightButtonCanDrag=this.params.rightButtonCanDrag;var h=[0,0],i=null,j=!1,k=this.params.consumeStartEvent!==!1,m=this.el,o=this.params.clone;this.toGrid=function(a){return null==this.params.grid?a:[this.params.grid[0]*Math.floor(a[0]/this.params.grid[0]),this.params.grid[1]*Math.floor(a[1]/this.params.grid[1])]},this.constrain="function"==typeof this.params.constrain?this.params.constrain:this.params.constrain||this.params.containment?function(a){return[Math.max(0,Math.min(w.w-this.size[0],a[0])),Math.max(0,Math.min(w.h-this.size[1],a[1]))]}:function(a){return a};var q=l,t="",u=this.params.filterExclude!==!1,v=this.setFilter=function(a,d){a&&(t=a,u=d!==!1,q=function
 (d){var e=d.srcElement||d.target,f=b(e,a,c);return u?!f:f})};this.canDrag=this.params.canDrag||l;var w,x=[],y=[];this.downListener=function(b){var c=this.rightButtonCanDrag||3!==b.which&&2!==b.button;if(c&&this.isEnabled()&&this.canDrag()){var d=q(b)&&r(b,this.el,this.k);if(d){if(o){m=this.el.cloneNode(!0),m.setAttribute("id",null),m.style.position="absolute";var i=a(this.el);m.style.left=i.left+"px",m.style.top=i.top+"px",document.body.appendChild(m)}else m=this.el;k&&p(b),h=e(b),this.params.bind(document,"mousemove",this.moveListener),this.params.bind(document,"mouseup",this.upListener),g.markSelection(this),this.params.addClass(document.body,f.noSelect)}else this.params.consumeFilteredEvents&&p(b)}}.bind(this),this.moveListener=function(a){if(h){j||(this.params.events.start({el:this.el,pos:i,e:a,drag:this}),this.mark(),j=!0),y.length=0;var b=e(a),c=b[0]-h[0],d=b[1]-h[1],f=this.params.ignoreZoom?1:g.getZoom();c/=f,d/=f,this.moveBy(c,d,a),g.updateSelection(c,d,this)}}.bind(this),th
 is.upListener=function(a){h=null,j=!1,this.params.unbind(document,"mousemove",this.moveListener),this.params.unbind(document,"mouseup",this.upListener),this.params.removeClass(document.body,f.noSelect),this.unmark(a),g.unmarkSelection(this,a),this.stop(a),g.notifySelectionDragStop(this,a),o&&(m&&m.parentNode&&m.parentNode.removeChild(m),m=null)}.bind(this),this.getFilter=function(){return t},this.isFilterExclude=function(){return u},this.abort=function(){null!=h&&this.upListener()},this.getDragElement=function(){return m||this.el},this.stop=function(a){this.params.events.stop({el:m,pos:this.params.getPosition(m),e:a,drag:this})},this.mark=function(){if(i=this.params.getPosition(m),this.size=this.params.getSize(m),x=g.getMatchingDroppables(this),n(x,!0,!1,this),this.params.addClass(m,this.params.dragClass||f.drag),this.params.constrain||this.params.containment){var a=this.params.getSize(m.parentNode);w={w:a[0],h:a[1]}}},this.unmark=function(a){n(x,!1,!0,this),x.length=0;for(var b=0;b
 <y.length;b++)y[b].drop(this,a)},this.moveBy=function(a,b,c){y.length=0;var d=this.constrain(this.toGrid([i[0]+a,i[1]+b]),m),e={x:d[0],y:d[1],w:this.size[0],h:this.size[1]};this.params.setPosition(m,d);for(var f=0;f<x.length;f++){var g={x:x[f].position[0],y:x[f].position[1],w:x[f].size[0],h:x[f].size[1]};this.params.intersects(e,g)&&x[f].canDrop(this)?(y.push(x[f]),x[f].setHover(this,!0,c)):x[f].el._katavorioDragHover&&x[f].setHover(this,!1,c)}this.params.events.drag({el:this.el,pos:d,e:c,drag:this})},this.destroy=function(){this.params.unbind(this.el,"mousedown",this.downListener),this.params.unbind(document,"mousemove",this.moveListener),this.params.unbind(document,"mouseup",this.upListener),this.downListener=null,this.upListener=null,this.moveListener=null},this.params.bind(this.el,"mousedown",this.downListener),this.params.handle?v(this.params.handle,!1):v(this.params.filter,this.params.filterExclude)},u=function(a,b,c){this._class=c.droppable,this.params=b||{},this._activeClass
 =b.activeClass||c.active,this._hoverClass=b.hoverClass||c.hover,s.apply(this,arguments);var d=!1;this.setActive=function(a){this.params[a?"addClass":"removeClass"](this.el,this._activeClass)},this.updatePosition=function(){this.position=this.params.getPosition(this.el),this.size=this.params.getSize(this.el)},this.canDrop=this.params.canDrop||function(){return!0},this.setHover=function(a,b,c){(b||null==this.el._katavorioDragHover||this.el._katavorioDragHover==a.el._katavorio)&&(this.params[b?"addClass":"removeClass"](this.el,this._hoverClass),this.el._katavorioDragHover=b?a.el._katavorio:null,d!==b&&this.params.events[b?"over":"out"]({el:this.el,e:c,drag:a,drop:this}),d=b)},this.drop=function(a,b){this.params.events.drop({drag:a,e:b,drop:this})},this.destroy=function(){this._class=null,this._activeClass=null,this._hoverClass=null,d=null}},v=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=0|16*Math.random(),c="x"==a?b:8|3&b;return c.toString(1
 6)})},w=function(a){return null==a?null:(a="string"==typeof a?document.getElementById(a):a,null==a?null:(a._katavorio=a._katavorio||v(),a))};this.Katavorio=function(a){var b=[],c={};this._dragsByScope={},this._dropsByScope={};var d=1,e=function(a,b){for(var c=0;c<a.scopes.length;c++)b[a.scopes[c]]=b[a.scopes[c]]||[],b[a.scopes[c]].push(a)},f=function(b,c){for(var d=0,e=0;e<b.scopes.length;e++)if(c[b.scopes[e]]){var f=a.indexOf(c[b.scopes[e]],b);-1!=f&&(c[b.scopes[e]].splice(f,1),d++)}return d>0},g=(this.getMatchingDroppables=function(a){for(var b=[],c={},d=0;d<a.scopes.length;d++){var e=this._dropsByScope[a.scopes[d]];if(e)for(var f=0;f<e.length;f++)e[f].canDrop(a)&&!c[e[f].el._katavorio]&&e[f].el!==a.el&&(c[e[f].el._katavorio]=!0,b.push(e[f]))}return b},function(b){b=b||{};var c={events:{}};for(var d in a)c[d]=a[d];for(var d in b)c[d]=b[d];for(var d=0;d<j.length;d++)c.events[j[d]]=b[j[d]]||k;return c.katavorio=this,c}.bind(this)),l={},n=a.css||{},p=a.scope||i;for(var r in h)l[r]=h[
 r];for(var r in n)l[r]=n[r];var s=a.inputFilterSelector||q;this.getInputFilterSelector=function(){return s},this.setInputFilterSelector=function(a){return s=a,this},this.draggable=function(b,c){var d=[];return o(b,function(b){if(b=w(b),null!=b){var f=g(c);b._katavorioDrag=new t(b,f,l,p),e(b._katavorioDrag,this._dragsByScope),d.push(b._katavorioDrag),a.addClass(b,l.draggable)}}.bind(this)),d},this.droppable=function(b,c){var d=[];return o(b,function(b){b=w(b),null!=b&&(b._katavorioDrop=new u(b,g(c),l,p),e(b._katavorioDrop,this._dropsByScope),d.push(b._katavorioDrop),a.addClass(b,l.droppable))}.bind(this)),d},this.select=function(d){return o(d,function(){var d=w(this);d&&d._katavorioDrag&&(c[d._katavorio]||(b.push(d._katavorioDrag),c[d._katavorio]=[d,b.length-1],a.addClass(d,l.selected)))}),this},this.deselect=function(d){return o(d,function(){var d=w(this);if(d&&d._katavorio){var e=c[d._katavorio];if(e){for(var f=[],g=0;g<b.length;g++)b[g].el!==d&&f.push(b[g]);b=f,delete c[d._katavor
 io],a.removeClass(d,l.selected)}}}),this},this.deselectAll=function(){for(var d in c){var e=c[d];a.removeClass(e[0],l.selected)}b.length=0,c={}},this.markSelection=function(a){m(b,function(a){a.mark()},a)},this.unmarkSelection=function(a,c){m(b,function(a){a.unmark(c)},a)},this.getSelection=function(){return b.slice(0)},this.updateSelection=function(a,c,d){m(b,function(b){b.moveBy(a,c)},d)},this.notifySelectionDragStop=function(a,c){m(b,function(a){a.stop(c)},a)},this.setZoom=function(a){d=a},this.getZoom=function(){return d};var v=function(a,b,c,d){null!=a&&(f(a,c),a[d](b),e(a,c))};o(["set","add","remove","toggle"],function(a){this[a+"Scope"]=function(b,c){v(b._katavorioDrag,c,this._dragsByScope,a+"Scope"),v(b._katavorioDrop,c,this._dropsByScope,a+"Scope")}.bind(this),this[a+"DragScope"]=function(b,c){v(b._katavorioDrag,c,this._dragsByScope,a+"Scope")}.bind(this),this[a+"DropScope"]=function(b,c){v(b._katavorioDrop,c,this._dropsByScope,a+"Scope")}.bind(this)}.bind(this)),this.getDr
 agsForScope=function(a){return this._dragsByScope[a]},this.getDropsForScope=function(a){return this._dropsByScope[a]};var x=function(a,b,c){a=w(a),a[b]&&(f(a[b],c)&&a[b].destroy(),a[b]=null)};this.elementRemoved=function(a){this.destroyDraggable(a),this.destroyDroppable(a)},this.destroyDraggable=function(a){x(a,"_katavorioDrag",this._dragsByScope)},this.destroyDroppable=function(a){x(a,"_katavorioDrop",this._dropsByScope)}}}.call(this),function(){var a=function(a){return"[object Array]"===Object.prototype.toString.call(a)},b=function(a){return"[object Number]"===Object.prototype.toString.call(a)},c=function(a){return"string"==typeof a},d=function(a){return"boolean"==typeof a},e=function(a){return null==a},f=function(a){return null==a?!1:"[object Object]"===Object.prototype.toString.call(a)},g=function(a){return"[object Date]"===Object.prototype.toString.call(a)},h=function(a){return"[object Function]"===Object.prototype.toString.call(a)},i=function(a){for(var b in a)if(a.hasOwnPrope
 rty(b))return!1;return!0},j=this,k=j.jsPlumbUtil={isArray:a,isString:c,isBoolean:d,isNull:e,isObject:f,isDate:g,isFunction:h,isEmpty:i,isNumber:b,clone:function(b){if(c(b))return""+b;if(d(b))return!!b;if(g(b))return new Date(b.getTime());if(h(b))return b;if(a(b)){for(var e=[],i=0;i<b.length;i++)e.push(this.clone(b[i]));return e}if(f(b)){var j={};for(var k in b)j[k]=this.clone(b[k]);return j}return b},merge:function(b,e,g){var h,i,j={};for(g=g||[],i=0;i<g.length;i++)j[g[i]]=!0;var k=this.clone(b);for(i in e)if(null==k[i])k[i]=e[i];else if(c(e[i])||d(e[i]))j[i]?(h=[],h.push.apply(h,a(k[i])?k[i]:[k[i]]),h.push.apply(h,a(e[i])?e[i]:[e[i]]),k[i]=h):k[i]=e[i];else if(a(e[i]))h=[],a(k[i])&&h.push.apply(h,k[i]),h.push.apply(h,e[i]),k[i]=h;else if(f(e[i])){f(k[i])||(k[i]={});for(var l in e[i])k[i][l]=e[i][l]}return k},replace:function(a,b,c){if(null!=a){var d=a,e=d;return b.replace(/([^\.])+/g,function(a,b,d,f){var g=a.match(/([^\[0-9]+){1}(\[)([0-9+])/),h=d+a.length>=f.length,i=function(){r
 eturn e[g[1]]||function(){return e[g[1]]=[],e[g[1]]}()};if(h)g?i()[g[3]]=c:e[a]=c;else if(g){var j=i();e=j[g[3]]||function(){return j[g[3]]={},j[g[3]]}()}else e=e[a]||function(){return e[a]={},e[a]}()}),a}},functionChain:function(a,b,c){for(var d=0;d<c.length;d++){var e=c[d][0][c[d][1]].apply(c[d][0],c[d][2]);if(e===b)return e}return a},populate:function(b,d){var e=function(a){var b=a.match(/(\${.*?})/g);if(null!=b)for(var c=0;c<b.length;c++){var e=d[b[c].substring(2,b[c].length-1)]||"";null!=e&&(a=a.replace(b[c],e))}return a},g=function(b){if(null!=b){if(c(b))return e(b);if(a(b)){for(var d=[],h=0;h<b.length;h++)d.push(g(b[h]));return d}if(f(b)){var i={};for(var j in b)i[j]=g(b[j]);return i}return b}};return g(b)},convertStyle:function(a,b){if("transparent"===a)return a;var c=a,d=function(a){return 1==a.length?"0"+a:a},e=function(a){return d(Number(a).toString(16))},f=/(rgb[a]?\()(.*)(\))/;if(a.match(f)){var g=a.match(f)[2].split(",");c="#"+e(g[0])+e(g[1])+e(g[2]),b||4!=g.length||(c
 +=e(g[3]))}return c},findWithFunction:function(a,b){if(a)for(var c=0;c<a.length;c++)if(b(a[c]))return c;return-1},indexOf:function(a,b){return a.indexOf?a.indexOf(b):k.findWithFunction(a,function(a){return a==b})},removeWithFunction:function(a,b){var c=k.findWithFunction(a,b);return c>-1&&a.splice(c,1),-1!=c},remove:function(a,b){var c=k.indexOf(a,b);return c>-1&&a.splice(c,1),-1!=c},addWithFunction:function(a,b,c){-1==k.findWithFunction(a,c)&&a.push(b)},addToList:function(a,b,c,d){var e=a[b];return null==e&&(e=[],a[b]=e),e[d?"unshift":"push"](c),e},extend:function(b,c){var d;for(c=a(c)?c:[c],d=0;d<c.length;d++)for(var e in c[d].prototype)c[d].prototype.hasOwnProperty(e)&&(b.prototype[e]=c[d].prototype[e]);var f=function(a,b){return function(){for(d=0;d<c.length;d++)c[d].prototype[a]&&c[d].prototype[a].apply(this,arguments);return b.apply(this,arguments)}},g=function(a){for(var c in a)b.prototype[c]=f(c,a[c])};if(arguments.length>2)for(d=2;d<arguments.length;d++)g(arguments[d]);retu
 rn b},uuid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=0|16*Math.random(),c="x"==a?b:8|3&b;return c.toString(16)})},logEnabled:!0,log:function(){if(k.logEnabled&&"undefined"!=typeof console)try{var a=arguments[arguments.length-1];console.log(a)}catch(b){}},wrap:function(a,b,c){return a=a||function(){},b=b||function(){},function(){var d=null;try{d=b.apply(this,arguments)}catch(e){k.log("jsPlumb function failed : "+e)}if(null==c||d!==c)try{d=a.apply(this,arguments)}catch(e){k.log("wrapped function failed : "+e)}return d}}};k.EventGenerator=function(){var a={},b=!1,c={ready:!0};this.bind=function(b,c,d){return k.addToList(a,b,c,d),this},this.fire=function(d,e,f){if(!b&&a[d]){var g=a[d].length,h=0,i=!1,j=null;if(!this.shouldFireEvent||this.shouldFireEvent(d,e,f))for(;!i&&g>h&&j!==!1;){if(c[d])a[d][h].apply(this,[e,f]);else try{j=a[d][h].apply(this,[e,f])}catch(l){k.log("jsPlumb: fire failed for event "+d+" : "+l)}h++,(null==a||null==a[d])&&(
 i=!0)}}return this},this.unbind=function(b){return b?delete a[b]:a={},this},this.getListener=function(b){return a[b]},this.setSuspendEvents=function(a){b=a},this.isSuspendEvents=function(){return b},this.cleanupListeners=function(){for(var b in a)a[b]=null}},k.EventGenerator.prototype={cleanup:function(){this.cleanupListeners()}},Function.prototype.bind||(Function.prototype.bind=function(a){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var b=Array.prototype.slice.call(arguments,1),c=this,d=function(){},e=function(){return c.apply(this instanceof d&&a?this:a,b.concat(Array.prototype.slice.call(arguments)))};return d.prototype=this.prototype,e.prototype=new d,e})}.call(this),function(){"use strict";var a=this,b=a.jsPlumbUtil;b.ieVersion=/MSIE\s([\d.]+)/.test(navigator.userAgent)?new Number(RegExp.$1):-1,b.oldIE=b.ieVersion>-1&&b.ieVersion<9,b.matchesSelector=function(a,b,c){c=c||a.parentNode;for(var d=c.querySele
 ctorAll(b),e=0;e<d.length;e++)if(d[e]===a)return!0;return!1},b.consume=function(a,b){a.stopPropagation?a.stopPropagation():a.returnValue=!1,!b&&a.preventDefault&&a.preventDefault()},b.sizeElement=function(a,b,c,d,e){a&&(a.style.height=e+"px",a.height=e,a.style.width=d+"px",a.width=d,a.style.left=b+"px",a.style.top=c+"px")}}.call(this),function(){var a=this,b=!!window.SVGAngle||document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"),c=function(){if(void 0===c.vml){var a=document.body.appendChild(document.createElement("div"));a.innerHTML='<v:shape id="vml_flag1" adj="1" />';var b=a.firstChild;null!=b&&null!=b.style?(b.style.behavior="url(#default#VML)",c.vml=b?"object"==typeof b.adj:!0):c.vml=!1,a.parentNode.removeChild(a)}return c.vml},d=function(){var a=-1;if("Microsoft Internet Explorer"==navigator.appName){var b=navigator.userAgent,c=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");null!=c.exec(b)&&(a=parseFloat(RegExp.$1))}return a}(),e=d>-1&&9>d,f=
 function(a,b){if(null==a)return[0,0];var c=k(a),d=j(c,0);return[d[b+"X"],d[b+"Y"]]},g=function(a){return null==a?[0,0]:e?[a.clientX+document.documentElement.scrollLeft,a.clientY+document.documentElement.scrollTop]:f(a,"page")},h=function(a){return f(a,"screen")},i=function(a){return f(a,"client")},j=function(a,b){return a.item?a.item(b):a[b]},k=function(a){return a.touches&&a.touches.length>0?a.touches:a.changedTouches&&a.changedTouches.length>0?a.changedTouches:a.targetTouches&&a.targetTouches.length>0?a.targetTouches:[a]},l=function(a){var b={},c=[],d={},e={},f={};this.register=function(g){var h=a.getId(g),i=jsPlumbAdapter.getOffset(g,a);b[h]||(b[h]=g,c.push(g),d[h]={});var j=function(b){if(b)for(var c=0;c<b.childNodes.length;c++)if(3!=b.childNodes[c].nodeType&&8!=b.childNodes[c].nodeType){var g=jsPlumb.getElementObject(b.childNodes[c]),k=a.getId(b.childNodes[c],null,!0);if(k&&e[k]&&e[k]>0){var l=jsPlumbAdapter.getOffset(g,a);d[h][k]={id:k,offset:{left:l.left-i.left,top:l.top-i.to
 p}},f[k]=h}j(b.childNodes[c])}};j(g)},this.updateOffsets=function(b){if(null!=b){var c=jsPlumb.getDOMElement(b),e=a.getId(c),g=d[e],h=jsPlumbAdapter.getOffset(c,a);if(g)for(var i in g){var j=jsPlumb.getElementObject(i),k=jsPlumbAdapter.getOffset(j,a);d[e][i]={id:i,offset:{left:k.left-h.left,top:k.top-h.top}},f[i]=e}}},this.endpointAdded=function(c,g){g=g||a.getId(c);var h=document.body,i=c.parentNode;for(e[g]=e[g]?e[g]+1:1;null!=i&&i!=h;){var j=a.getId(i,null,!0);if(j&&b[j]){var k=jsPlumbAdapter.getOffset(i,a);if(null==d[j][g]){var l=jsPlumbAdapter.getOffset(c,a);d[j][g]={id:g,offset:{left:l.left-k.left,top:l.top-k.top}},f[g]=j}break}i=i.parentNode}},this.endpointDeleted=function(a){if(e[a.elementId]&&(e[a.elementId]--,e[a.elementId]<=0))for(var b in d)d[b]&&(delete d[b][a.elementId],delete f[a.elementId])},this.changeId=function(a,b){d[b]=d[a],d[a]={},f[b]=f[a],f[a]=null},this.getElementsForDraggable=function(a){return d[a]},this.elementRemoved=function(a){var b=f[a];b&&(delete d[b
 ][a],delete f[a])},this.reset=function(){b={},c=[],d={},e={}},this.dragEnded=function(b){var c=a.getId(b),d=f[c];
+d&&this.updateOffsets(d)},this.setParent=function(b,c,e,g){var h=f[c];if(h){d[g]||(d[g]={}),d[g][c]=d[h][c],delete d[h][c];var i=jsPlumbAdapter.getOffset(e,a),j=jsPlumbAdapter.getOffset(b,a);d[g][c].offset={left:j.left-i.left,top:j.top-i.top},f[c]=g}},this.getDragAncestor=function(b){var c=jsPlumb.getDOMElement(b),d=a.getId(c),e=f[d];return e?jsPlumb.getDOMElement(e):null}};window.console||(window.console={time:function(){},timeEnd:function(){},group:function(){},groupEnd:function(){},log:function(){}});var m=function(a){return null==a?null:a.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},n=function(a,b){b=m(b),"undefined"!=typeof a.className.baseVal?a.className.baseVal=b:a.className=b},o=function(a){return"undefined"==typeof a.className.baseVal?a.className:a.className.baseVal},p=function(a,b,c){b=null==b?[]:jsPlumbUtil.isArray(b)?b:b.split(/\s+/),c=null==c?[]:jsPlumbUtil.isArray(c)?c:c.split(/\s+/);var d=o(a),e=d.split(/\s+/),f=function(a,b){for(var c=0;c<b.length;c++)if(a)-1==jsPlumbU
 til.indexOf(e,b[c])&&e.push(b[c]);else{var d=jsPlumbUtil.indexOf(e,b[c]);-1!=d&&e.splice(d,1)}};f(!0,b),f(!1,c),n(a,e.join(" "))},q=function(a,b){if(null!=a)if("string"==typeof a)b(jsPlumb.getDOMElement(a));else if(null!=a.length)for(var c=0;c<a.length;c++)b(jsPlumb.getDOMElement(a[c]));else b(a)};window.jsPlumbAdapter={headless:!1,pageLocation:g,screenLocation:h,clientLocation:i,getAttribute:function(a,b){return a.getAttribute(b)},setAttribute:function(a,b,c){a.setAttribute(b,c)},appendToRoot:function(a){document.body.appendChild(a)},getRenderModes:function(){return["svg","vml"]},isRenderModeAvailable:function(a){return{svg:b,vml:c()}[a]},getDragManager:function(a){return new l(a)},setRenderMode:function(a){var b;if(a){a=a.toLowerCase();var c=this.isRenderModeAvailable("svg"),d=this.isRenderModeAvailable("vml");"svg"===a?c?b="svg":d&&(b="vml"):d&&(b="vml")}return b},addClass:function(a,b){q(a,function(a){p(a,b)})},hasClass:function(a,b){return a=jsPlumb.getDOMElement(a),a.classList
 ?a.classList.contains(b):-1!=o(a).indexOf(b)},removeClass:function(a,b){q(a,function(a){p(a,null,b)})},updateClasses:function(a,b,c){q(a,function(a){p(a,b,c)})},setClass:function(a,b){q(a,function(a){n(a,b)})},setPosition:function(a,b){a.style.left=b.left+"px",a.style.top=b.top+"px"},getPosition:function(a){var b=function(b){var c=a.style[b];return c?c.substring(0,c.length-2):0};return{left:b("left"),top:b("top")}},getOffset:function(a,b,c){a=jsPlumb.getDOMElement(a);for(var d=b.getContainer(),e=a.offsetLeft,f=a.offsetTop,g=c||null!=d&&a.offsetParent!=d?a.offsetParent:null;null!=g;)e+=g.offsetLeft,f+=g.offsetTop,g=c?g.offsetParent:g.offsetParent==d?null:g.offsetParent;return{left:e,top:f}},getPositionOnElement:function(a,b,c){var d="undefined"!=typeof b.getBoundingClientRect?b.getBoundingClientRect():{left:0,top:0,width:0,height:0},e=document.body,f=document.documentElement,g=(b.offsetParent,window.pageYOffset||f.scrollTop||e.scrollTop),h=window.pageXOffset||f.scrollLeft||e.scrollLe
 ft,i=f.clientTop||e.clientTop||0,j=f.clientLeft||e.clientLeft||0,k=0,l=0,m=d.top+g-i+k*c,n=d.left+h-j+l*c,o=jsPlumbAdapter.pageLocation(a),p=d.width||b.offsetWidth*c,q=d.height||b.offsetHeight*c,r=(o[0]-n)/p,s=(o[1]-m)/q;return[r,s]},getAbsolutePosition:function(a){var b=function(b){var c=a.style[b];return c?parseFloat(c.substring(0,c.length-2)):void 0};return[b("left"),b("top")]},setAbsolutePosition:function(b,c,d,e){d?a.jsPlumb.animate(b,{left:"+="+(c[0]-d[0]),top:"+="+(c[1]-d[1])},e):(b.style.left=c[0]+"px",b.style.top=c[1]+"px")}}}.call(this),function(){"use strict";var a=jsPlumbUtil,b=function(a,b,c){return jsPlumbAdapter.getOffset(a,b,c)},c=function(){return""+(new Date).getTime()},d=function(a){if(a._jsPlumb.paintStyle&&a._jsPlumb.hoverPaintStyle){var b={};t.extend(b,a._jsPlumb.paintStyle),t.extend(b,a._jsPlumb.hoverPaintStyle),delete a._jsPlumb.hoverPaintStyle,b.gradient&&a._jsPlumb.paintStyle.fillStyle&&delete b.gradient,a._jsPlumb.hoverPaintStyle=b}},e=["click","dblclick",
 "mouseover","mouseout","mousemove","mousedown","mouseup","contextmenu"],f=function(a,b,c,d){var e=a.getAttachedElements();if(e)for(var f=0,g=e.length;g>f;f++)d&&d==e[f]||e[f].setHover(b,!0,c)},g=function(a){return null==a?null:a.split(" ")},h=function(b,c,d){if(b.getDefaultType){for(var e=b.getTypeDescriptor(),f=a.merge({},b.getDefaultType()),g=0,h=b._jsPlumb.types.length;h>g;g++)f=a.merge(f,b._jsPlumb.instance.getType(b._jsPlumb.types[g],e),["cssClass"]);c&&(f=a.populate(f,c)),b.applyType(f,d),d||b.repaint()}},i=window.jsPlumbUIComponent=function(b){jsPlumbUtil.EventGenerator.apply(this,arguments);var c=this,d=arguments,e=c.idPrefix,f=e+(new Date).getTime();if(this._jsPlumb={instance:b._jsPlumb,parameters:b.parameters||{},paintStyle:null,hoverPaintStyle:null,paintStyleInUse:null,hover:!1,beforeDetach:b.beforeDetach,beforeDrop:b.beforeDrop,overlayPlacements:[],hoverClass:b.hoverClass||b._jsPlumb.Defaults.HoverClass,types:[]},this.getId=function(){return f},b.events)for(var g in b.ev
 ents)c.bind(g,b.events[g]);this.clone=function(){var a={};return this.constructor.apply(a,d),a}.bind(this),this.isDetachAllowed=function(b){var c=!0;if(this._jsPlumb.beforeDetach)try{c=this._jsPlumb.beforeDetach(b)}catch(d){a.log("jsPlumb: beforeDetach callback failed",d)}return c},this.isDropAllowed=function(b,c,d,e,f,g,h){var i=this._jsPlumb.instance.checkCondition("beforeDrop",{sourceId:b,targetId:c,scope:d,connection:e,dropEndpoint:f,source:g,target:h});if(this._jsPlumb.beforeDrop)try{i=this._jsPlumb.beforeDrop({sourceId:b,targetId:c,scope:d,connection:e,dropEndpoint:f,source:g,target:h})}catch(j){a.log("jsPlumb: beforeDrop callback failed",j)}return i};var h=[];this.setListenerComponent=function(a){for(var b=0;b<h.length;b++)h[b][3]=a}},j=function(a,b){var c=a._jsPlumb.types[b],d=a._jsPlumb.instance.getType(c,a.getTypeDescriptor());null!=d&&d.cssClass&&a.canvas&&a._jsPlumb.instance.removeClass(a.canvas,d.cssClass)};jsPlumbUtil.extend(i,jsPlumbUtil.EventGenerator,{getParameter:f
 unction(a){return this._jsPlumb.parameters[a]},setParameter:function(a,b){this._jsPlumb.parameters[a]=b},getParameters:function(){return this._jsPlumb.parameters},setParameters:function(a){this._jsPlumb.parameters=a},addClass:function(a){jsPlumbAdapter.addClass(this.canvas,a)},removeClass:function(a){jsPlumbAdapter.removeClass(this.canvas,a)},updateClasses:function(a,b){jsPlumbAdapter.updateClasses(this.canvas,a,b)},setType:function(a,b,c){this.clearTypes(),this._jsPlumb.types=g(a)||[],h(this,b,c)},getType:function(){return this._jsPlumb.types},reapplyTypes:function(a,b){h(this,a,b)},hasType:function(a){return-1!=jsPlumbUtil.indexOf(this._jsPlumb.types,a)},addType:function(a,b,c){var d=g(a),e=!1;if(null!=d){for(var f=0,i=d.length;i>f;f++)this.hasType(d[f])||(this._jsPlumb.types.push(d[f]),e=!0);e&&h(this,b,c)}},removeType:function(b,c){var d=g(b),e=!1,f=function(b){var c=a.indexOf(this._jsPlumb.types,b);return-1!=c?(j(this,c),this._jsPlumb.types.splice(c,1),!0):!1}.bind(this);if(nul
 l!=d){for(var i=0,k=d.length;k>i;i++)e=f(d[i])||e;e&&h(this,null,c)}},clearTypes:function(a){for(var b=this._jsPlumb.types.length,c=0;b>c;c++)j(this,0),this._jsPlumb.types.splice(0,1);h(this,{},a)},toggleType:function(a,b,c){var d=g(a);if(null!=d){for(var e=0,f=d.length;f>e;e++){var i=jsPlumbUtil.indexOf(this._jsPlumb.types,d[e]);-1!=i?(j(this,i),this._jsPlumb.types.splice(i,1)):this._jsPlumb.types.push(d[e])}h(this,b,c)}},applyType:function(a,b){if(this.setPaintStyle(a.paintStyle,b),this.setHoverPaintStyle(a.hoverPaintStyle,b),a.parameters)for(var c in a.parameters)this.setParameter(c,a.parameters[c])},setPaintStyle:function(a,b){this._jsPlumb.paintStyle=a,this._jsPlumb.paintStyleInUse=this._jsPlumb.paintStyle,d(this),b||this.repaint()},getPaintStyle:function(){return this._jsPlumb.paintStyle},setHoverPaintStyle:function(a,b){this._jsPlumb.hoverPaintStyle=a,d(this),b||this.repaint()},getHoverPaintStyle:function(){return this._jsPlumb.hoverPaintStyle},destroy:function(){this.cleanup
 Listeners(),this.clone=null,this._jsPlumb=null},isHover:function(){return this._jsPlumb.hover},setHover:function(a,b,d){if(this._jsPlumb&&!this._jsPlumb.instance.currentlyDragging&&!this._jsPlumb.instance.isHoverSuspended()){if(this._jsPlumb.hover=a,null!=this.canvas){if(null!=this._jsPlumb.instance.hoverClass){var e=a?"addClass":"removeClass";this._jsPlumb.instance[e](this.canvas,this._jsPlumb.instance.hoverClass)}null!=this._jsPlumb.hoverClass&&this._jsPlumb.instance[e](this.canvas,this._jsPlumb.hoverClass)}null!=this._jsPlumb.hoverPaintStyle&&(this._jsPlumb.paintStyleInUse=a?this._jsPlumb.hoverPaintStyle:this._jsPlumb.paintStyle,this._jsPlumb.instance.isSuspendDrawing()||(d=d||c(),this.repaint({timestamp:d,recalc:!1}))),this.getAttachedElements&&!b&&f(this,a,c(),this)}}});var k="__label",l=function(a,b){for(var c=-1,d=0,e=a._jsPlumb.overlays.length;e>d;d++)if(b===a._jsPlumb.overlays[d].id){c=d;break}return c},m=function(a,b){var c={cssClass:b.cssClass,labelStyle:a.labelStyle,id:k
 ,component:a,_jsPlumb:a._jsPlumb.instance},d=t.extend(c,b);return new(t.Overlays[a._jsPlumb.instance.getRenderMode()].Label)(d)},n=function(b,c){var d=null;if(a.isArray(c)){var e=c[0],f=t.extend({component:b,_jsPlumb:b._jsPlumb.instance},c[1]);3==c.length&&t.extend(f,c[2]),d=new(t.Overlays[b._jsPlumb.instance.getRenderMode()][e])(f)}else d=c.constructor==String?new(t.Overlays[b._jsPlumb.instance.getRenderMode()][c])({component:b,_jsPlumb:b._jsPlumb.instance}):c;b._jsPlumb.overlays.push(d)},o=function(a,b){var c=a.defaultOverlayKeys||[],d=b.overlays,e=function(b){return a._jsPlumb.instance.Defaults[b]||t.Defaults[b]||[]};d||(d=[]);for(var f=0,g=c.length;g>f;f++)d.unshift.apply(d,e(c[f]));return d},p=window.OverlayCapableJsPlumbUIComponent=function(a){i.apply(this,arguments),this._jsPlumb.overlays=[];var b=o(this,a);if(b)for(var c=0,d=b.length;d>c;c++)n(this,b[c]);if(a.label){var e=a.labelLocation||this.defaultLabelLocation||.5,f=a.labelStyle||this._jsPlumb.instance.Defaults.LabelStyl
 e;this._jsPlumb.overlays.push(m(this,{label:a.label,location:e,labelStyle:f}))}this.setListenerComponent=function(a){if(this._jsPlumb)for(var b=0;b<this._jsPlumb.overlays.length;b++)this._jsPlumb.overlays[b].setListenerComponent(a)}};jsPlumbUtil.extend(p,i,{applyType:function(a,b){if(this.removeAllOverlays(b),a.overlays)for(var c=0,d=a.overlays.length;d>c;c++)this.addOverlay(a.overlays[c],!0)},setHover:function(a){if(this._jsPlumb&&!this._jsPlumb.instance.isConnectionBeingDragged())for(var b=0,c=this._jsPlumb.overlays.length;c>b;b++)this._jsPlumb.overlays[b][a?"addClass":"removeClass"](this._jsPlumb.instance.hoverClass)},addOverlay:function(a,b){n(this,a),b||this.repaint()},getOverlay:function(a){var b=l(this,a);return b>=0?this._jsPlumb.overlays[b]:null},getOverlays:function(){return this._jsPlumb.overlays},hideOverlay:function(a){var b=this.getOverlay(a);b&&b.hide()},hideOverlays:function(){for(var a=0,b=this._jsPlumb.overlays.length;b>a;a++)this._jsPlumb.overlays[a].hide()},showO
 verlay:function(a){var b=this.getOverlay(a);b&&b.show()},showOverlays:function(){for(var a=0,b=this._jsPlumb.overlays.length;b>a;a++)this._jsPlumb.overlays[a].show()},removeAllOverlays:function(a){for(var b=0,c=this._jsPlumb.overlays.length;c>b;b++)this._jsPlumb.overlays[b].cleanup&&this._jsPlumb.overlays[b].cleanup();this._jsPlumb.overlays.splice(0,this._jsPlumb.overlays.length),this._jsPlumb.overlayPositions=null,a||this.repaint()},removeOverlay:function(a){var b=l(this,a);if(-1!=b){var c=this._jsPlumb.overlays[b];c.cleanup&&c.cleanup(),this._jsPlumb.overlays.splice(b,1),this._jsPlumb.overlayPositions&&delete this._jsPlumb.overlayPositions[a]}},removeOverlays:function(){for(var a=0,b=arguments.length;b>a;a++)this.removeOverlay(arguments[a])},moveParent:function(a){this.bgCanvas&&(this.bgCanvas.parentNode.removeChild(this.bgCanvas),a.appendChild(this.bgCanvas)),this.canvas.parentNode.removeChild(this.canvas),a.appendChild(this.canvas);for(var b=0;b<this._jsPlumb.overlays.length;b++
 )this._jsPlumb.overlays[b].isAppendedAtTopLevel&&(this._jsPlumb.overlays[b].canvas.parentNode.removeChild(this._jsPlumb.overlays[b].canvas),a.appendChild(this._jsPlumb.overlays[b].canvas))},getLabel:function(){var a=this.getOverlay(k);return null!=a?a.getLabel():null},getLabelOverlay:function(){return this.getOverlay(k)},setLabel:function(a){var b=this.getOverlay(k);if(b)a.constructor==String||a.constructor==Function?b.setLabel(a):(a.label&&b.setLabel(a.label),a.location&&b.setLocation(a.location));else{var c=a.constructor==String||a.constructor==Function?{label:a}:a;b=m(this,c),this._jsPlumb.overlays.push(b)}this._jsPlumb.instance.isSuspendDrawing()||this.repaint()},cleanup:function(){for(var a=0;a<this._jsPlumb.overlays.length;a++)this._jsPlumb.overlays[a].cleanup(),this._jsPlumb.overlays[a].destroy();this._jsPlumb.overlays.length=0,this._jsPlumb.overlayPositions=null},setVisible:function(a){this[a?"showOverlays":"hideOverlays"]()},setAbsoluteOverlayPosition:function(a,b){this._js
 Plumb.overlayPositions=this._jsPlumb.overlayPositions||{},this._jsPlumb.overlayPositions[a.id]=b},getAbsoluteOverlayPosition:function(a){return this._jsPlumb.overlayPositions?this._jsPlumb.overlayPositions[a.id]:null}});var q=0,r=function(){var a=q+1;return q++,a},s=window.jsPlumbInstance=function(d){this.Defaults={Anchor:"Bottom",Anchors:[null,null],ConnectionsDetachable:!0,ConnectionOverlays:[],Connector:"Bezier",Container:null,DoNotThrowErrors:!1,DragOptions:{},DropOptions:{},Endpoint:"Dot",EndpointOverlays:[],Endpoints:[null,null],EndpointStyle:{fillStyle:"#456"},EndpointStyles:[null,null],EndpointHoverStyle:null,EndpointHoverStyles:[null,null],HoverPaintStyle:null,LabelStyle:{color:"black"},LogEnabled:!1,Overlays:[],MaxConnections:1,PaintStyle:{lineWidth:4,strokeStyle:"#456"},ReattachConnections:!1,RenderMode:"svg",Scope:"jsPlumb_DefaultScope"},d&&t.extend(this.Defaults,d),this.logEnabled=this.Defaults.LogEnabled,this._connectionTypes={},this._endpointTypes={},jsPlumbUtil.Event
 Generator.apply(this);var f=this,g=r(),h=f.bind,j={},k=1,l=function(a){var b=f.getDOMElement(a);return{el:b,id:jsPlumbUtil.isString(a)&&null==b?a:X(b)}};this.getInstanceIndex=function(){return g},this.setZoom=function(a,b){return jsPlumbUtil.oldIE||(k=a,f.fire("zoom",k),b&&f.repaintEverything()),!jsPlumbUtil.oldIE},this.getZoom=function(){return k};for(var m in this.Defaults)j[m]=this.Defaults[m];var n;this.setContainer=function(a){a=this.getDOMElement(a),this.select().each(function(b){b.moveParent(a)}),this.selectEndpoints().each(function(b){b.moveParent(a)}),n=a;for(var b=function(a,b){var c=b.srcElement||b.target,d=(c&&c.parentNode?c.parentNode._jsPlumb:null)||(c?c._jsPlumb:null)||(c&&c.parentNode&&c.parentNode.parentNode?c.parentNode.parentNode._jsPlumb:null);d&&(d.fire(a,d,b),f.fire(a,d,b))},c=function(a){f.on(n,a,"._jsPlumb_connector, ._jsPlumb_connector > *",function(c){b(a,c)}),f.on(n,a,"._jsPlumb_endpoint, ._jsPlumb_endpoint > *, ._jsPlumb_endpoint svg *",function(c){b(a,c)
 }),f.on(n,a,"._jsPlumb_overlay, ._jsPlumb_overlay *",function(c){b(a,c)})},d=0;d<e.length;d++)c(e[d])},this.getContainer=function(){return n},this.bind=function(a,b){"ready"===a&&p?b():h.apply(f,[a,b])},f.importDefaults=function(a){for(var b in a)f.Defaults[b]=a[b];return a.Container&&f.setContainer(a.Container),f},f.restoreDefaults=function(){return f.Defaults=t.extend({},j),f};var o=null,p=!1,q=[],s={},u={},v={},w={},x={},y={},z=!1,A=[],B=!1,C=null,D=this.Defaults.Scope,E=null,F=1,G=function(){return""+F++},H=function(a,b){n?n.appendChild(a):b?this.getDOMElement(b).appendChild(a):this.appendToRoot(a)}.bind(this),I=function(a,b,d,e){if(!jsPlumbAdapter.headless&&!B){var g=X(a),h=f.dragManager.getElementsForDraggable(g);null==d&&(d=c());var i=tb({elId:g,offset:b,recalc:!1,timestamp:d});if(h)for(var j in h)tb({elId:h[j].id,offset:{left:i.o.left+h[j].offset.left,top:i.o.top+h[j].offset.top},recalc:!1,timestamp:d});if(f.anchorManager.redraw(g,b,d,null,e),h)for(var k in h)f.anchorManager
 .redraw(h[k].id,b,d,h[k].offset,e,!0)}},J=function(b,c){var d,e,g,h=null;if(a.isArray(b)){h=[];for(var i=0,j=b.length;j>i;i++)d=f.getElementObject(b[i]),g=f.getDOMElement(d),e=f.getAttribute(g,"id"),h.push(c.apply(f,[g,e]))}else d=f.getDOMElement(b),e=f.getId(d),h=c.apply(f,[d,e]);return h},K=function(a){return u[a]},L=function(b,c,d,e){if(!jsPlumbAdapter.headless){var g=null==c?!1:c;if(g&&t.isDragSupported(b,f)&&!t.isAlreadyDraggable(b,f)){var h=d||f.Defaults.DragOptions;h=t.extend({},h);var i=t.dragEvents.drag,j=t.dragEvents.stop,k=t.dragEvents.start,l=f.getDOMElement(b),m=f.dragManager.getDragAncestor(l),n={left:0,top:0},o=n,p=!1;rb(e,b),h[k]=a.wrap(h[k],function(){return o=null!=m?jsPlumbAdapter.getOffset(m,f):n,f.setHoverSuspended(!0),f.select({source:b}).addClass(f.elementDraggingClass+" "+f.sourceElementDraggingClass,!0),f.select({target:b}).addClass(f.elementDraggingClass+" "+f.targetElementDraggingClass,!0),f.setConnectionBeingDragged(!0),h.canDrag?d.canDrag():void 0},!1),h
 [i]=a.wrap(h[i],function(){var a=f.getUIPosition(arguments,f.getZoom());a.left+=o.left,a.top+=o.top,I(b,a,null,!0),p&&f.addClass(b,"jsPlumb_dragged"),p=!0}),h[j]=a.wrap(h[j],function(){var a=f.getUIPosition(arguments,f.getZoom(),!0);I(b,a),p=!1,f.removeClass(b,"jsPlumb_dragged"),f.setHoverSuspended(!1),f.select({source:b}).removeClass(f.elementDraggingClass+" "+f.sourceElementDraggingClass,!0),f.select({target:b}).removeClass(f.elementDraggingClass+" "+f.targetElementDraggingClass,!0),f.setConnectionBeingDragged(!1),f.dragManager.dragEnded(b)});var q=X(b);y[q]=!0;var r=y[q];h.disabled=null==r?!1:!r,f.initDraggable(b,h),f.dragManager.register(b)}}},M=function(a,b){for(var c=a.scope.split(/\s/),d=b.scope.split(/\s/),e=0;e<c.length;e++)for(var f=0;f<d.length;f++)if(d[f]==c[e])return!0;return!1},N=function(b,c){var d=t.extend({},b);if(c&&t.extend(d,c),d.source&&(d.source.endpoint?d.sourceEndpoint=d.source:d.source=f.getDOMElement(d.source)),d.target&&(d.target.endpoint?d.targetEndpoint=
 d.target:d.target=f.getDOMElement(d.target)),b.uuids&&(d.sourceEndpoint=K(b.uuids[0]),d.targetEndpoint=K(b.uuids[1])),d.sourceEndpoint&&d.sourceEndpoint.isFull())return a.log(f,"could not add connection; source endpoint is full"),void 0;if(d.targetEndpoint&&d.targetEndpoint.isFull())return a.log(f,"could not add connection; target endpoint is full"),void 0;if(!d.type&&d.sourceEndpoint&&(d.type=d.sourceEndpoint.connectionType),d.sourceEndpoint&&d.sourceEndpoint.connectorOverlays){d.overlays=d.overlays||[];for(var e=0,g=d.sourceEndpoint.connectorOverlays.length;g>e;e++)d.overlays.push(d.sourceEndpoint.connectorOverlays[e])}!d["pointer-events"]&&d.sourceEndpoint&&d.sourceEndpoint.connectorPointerEvents&&(d["pointer-events"]=d.sourceEndpoint.connectorPointerEvents);var h=function(a,b){var c=t.extend({},a);for(var d in b)b[d]&&(c[d]=b[d]);return c},i=function(a,b,c){return f.addEndpoint(a,h(b,{anchor:d.anchors?d.anchors[c]:d.anchor,endpoint:d.endpoints?d.endpoints[c]:d.endpoint,paintStyl
 e:d.endpointStyles?d.endpointStyles[c]:d.endpointStyle,hoverPaintStyle:d.endpointHoverStyles?d.endpointHoverStyles[c]:d.endpointHoverStyle}))},j=function(a,b,c){if(d[a]&&!d[a].endpoint&&!d[a+"Endpoint"]&&!d.newConnection){var e=X(d[a]),f=c[e];if(f){if(!f.enabled)return!1;var g=null!=f.endpoint&&f.endpoint._jsPlumb?f.endpoint:i(d[a],f.def,b);if(f.uniqueEndpoint&&(f.endpoint=g),g.isFull())return!1;d[a+"Endpoint"]=g,g._doNotDeleteOnDetach=!1,g._deleteOnDetach=!0}}};return j("source",0,this.sourceEndpointDefinitions)!==!1&&j("target",1,this.targetEndpointDefinitions)!==!1?(d.sourceEndpoint&&d.targetEndpoint&&(M(d.sourceEndpoint,d.targetEndpoint)||(d=null)),d):void 0}.bind(f),O=function(a){var b=f.Defaults.ConnectionType||f.getDefaultConnectionType();a._jsPlumb=f,a.newConnection=O,a.newEndpoint=Q,a.endpointsByUUID=u,a.endpointsByElement=s,a.finaliseConnection=P;var c=new b(a);return c.id="con_"+G(),c.isDetachable()&&(c.endpoints[0].initDraggable(),c.endpoints[1].initDraggable()),c},P=f.f
 inaliseConnection=function(a,b,c,d){if(b=b||{},a.suspendedEndpoint||q.push(a),a.endpoints[0].isTemporarySource=!1,(null==a.suspendedEndpoint||d)&&f.anchorManager.newConnection(a),I(a.source),!b.doNotFireConnectionEvent&&b.fireEvent!==!1){var e={connection:a,source:a.source,target:a.target,sourceId:a.sourceId,targetId:a.targetId,sourceEndpoint:a.endpoints[0],targetEndpoint:a.endpoints[1]};f.fire("connection",e,c)}},Q=function(a,b){var c=f.Defaults.EndpointType||t.Endpoint,d=t.extend({},a);d._jsPlumb=f,d.newConnection=O,d.newEndpoint=Q,d.endpointsByUUID=u,d.endpointsByElement=s,d.fireDetachEvent=$,d.elementId=b||X(d.source);var e=new c(d);return e.id="ep_"+G(),rb(d.elementId,d.source),jsPlumbAdapter.headless||f.dragManager.endpointAdded(d.source,b),e},R=function(a,b,c){var d=s[a];if(d&&d.length)for(var e=0,f=d.length;f>e;e++){for(var g=0,h=d[e].connections.length;h>g;g++){var i=b(d[e].connections[g]);if(i)return}c&&c(d[e])}},S=function(a,b){return J(a,function(a,c){y[c]=b,this.isDragS
 upported(a)&&this.setElementDraggable(a,b)})},T=function(a,b,c){b="block"===b;var d=null;c&&(d=b?function(a){a.setVisible(!0,!0,!0)}:function(a){a.setVisible(!1,!0,!0)});var e=l(a);R(e.id,function(a){if(b&&c){var d=a.sourceId===e.id?1:0;a.endpoints[d].isVisible()&&a.setVisible(!0)}else a.setVisible(b)},d)},U=function(a){return J(a,function(a,b){var c=null==y[b]?!1:y[b];return c=!c,y[b]=c,this.setDraggable(a,c),c}.bind(this))},V=function(a,b){var c=null;b&&(c=function(a){var b=a.isVisible();a.setVisible(!b)}),R(a,function(a){var b=a.isVisible();a.setVisible(!b)},c)},W=function(a){var b=w[a];return b?{o:b,s:A[a]}:tb({elId:a})},X=function(a,b,c){if(jsPlumbUtil.isString(a))return a;if(null==a)return null;var d=f.getAttribute(a,"id");return d&&"undefined"!==d||(2==arguments.length&&void 0!==arguments[1]?d=b:(1==arguments.length||3==arguments.length&&!arguments[2])&&(d="jsPlumb_"+g+"_"+G()),c||f.setAttribute(a,"id",d)),d};this.setConnectionBeingDragged=function(a){z=a},this.isConnectionBe
 ingDragged=function(){return z},this.connectorClass="_jsPlumb_connector",this.hoverClass="_jsPlumb_hover",this.endpointClass="_jsPlumb_endpoint",this.endpointConnectedClass="_jsPlumb_endpoint_connected",this.endpointFullClass="_jsPlumb_endpoint_full",this.endpointDropAllowedClass="_jsPlumb_endpoint_drop_allowed",this.endpointDropForbiddenClass="_jsPlumb_endpoint_drop_forbidden",this.overlayClass="_jsPlumb_overlay",this.draggingClass="_jsPlumb_dragging",this.elementDraggingClass="_jsPlumb_element_dragging",this.sourceElementDraggingClass="_jsPlumb_source_element_dragging",this.targetElementDraggingClass="_jsPlumb_target_element_dragging",this.endpointAnchorClassPrefix="_jsPlumb_endpoint_anchor",this.hoverSourceClass="_jsPlumb_source_hover",this.hoverTargetClass="_jsPlumb_target_hover",this.dragSelectClass="_jsPlumb_drag_select",this.Anchors={},this.Connectors={svg:{},vml:{}},this.Endpoints={svg:{},vml:{}},this.Overlays={svg:{},vml:{}},this.ConnectorRenderers={},this.SVG="svg",this.VM
 L="vml",this.addEndpoint=function(b,c,d){d=d||{};var e=t.extend({},d);t.extend(e,c),e.endpoint=e.endpoint||f.Defaults.Endpoint,e.paintStyle=e.paintStyle||f.Defaults.EndpointStyle;for(var g=[],h=a.isArray(b)||null!=b.length&&!a.isString(b)?b:[b],i=0,j=h.length;j>i;i++){e.source=f.getDOMElement(h[i]),pb(e.source);var k=X(e.source),l=Q(e,k),m=rb(k,e.source).info.o;a.addToList(s,k,l),B||l.paint({anchorLoc:l.anchor.compute({xy:[m.left,m.top],wh:A[k],element:l,timestamp:C}),timestamp:C}),g.push(l),l._doNotDeleteOnDetach=!0}return 1==g.length?g[0]:g},this.addEndpoints=function(b,c,d){for(var e=[],g=0,h=c.length;h>g;g++){var i=f.addEndpoint(b,c[g],d);a.isArray(i)?Array.prototype.push.apply(e,i):e.push(i)}return e},this.animate=function(b,c,d){d=d||{};var e=f.getElementObject(b),g=f.getDOMElement(b),h=X(g),i=t.animEvents.step,j=t.animEvents.complete;d[i]=a.wrap(d[i],function(){f.revalidate(h)}),d[j]=a.wrap(d[j],function(){f.revalidate(h)}),f.doAnimate(e,c,d)},this.checkCondition=function(b,c
 ){var d=f.getListener(b),e=!0;if(d&&d.length>0)try{for(var g=0,h=d.length;h>g;g++)e=e&&d[g](c)}catch(i){a.log(f,"cannot check condition ["+b+"]"+i)}return e},this.connect=function(a,b){var c,d=N(a,b);if(d){if(null==d.source&&null==d.sourceEndpoint)return jsPlumbUtil.log("Cannot establish connection - source does not exist"),void 0;if(null==d.target&&null==d.targetEndpoint)return jsPlumbUtil.log("Cannot establish connection - target does not exist"),void 0;pb(d.source),c=O(d),P(c,d)}return c};var Y=[{el:"source",elId:"sourceId",epDefs:"sourceEndpointDefinitions"},{el:"target",elId:"targetId",epDefs:"targetEndpointDefinitions"}],Z=function(a,b,c,d){var e,f,g,h=Y[c],i=a[h.elId],j=(a[h.el],a.endpoints[c]),k={index:c,originalSourceId:0===c?i:a.sourceId,newSourceId:a.sourceId,originalTargetId:1==c?i:a.targetId,newTargetId:a.targetId,connection:a};if(b.constructor==t.Endpoint)e=b,e.addConnection(a);else if(f=X(b),g=this[h.epDefs][f],f===a[h.elId])e=null;else if(g){if(!g.enabled)return;e=nu
 ll!=g.endpoint&&g.endpoint._jsPlumb?g.endpoint:this.addEndpoint(b,g.def),g.uniqueEndpoint&&(g.endpoint=e),e._doNotDeleteOnDetach=!1,e._deleteOnDetach=!0,e.addConnection(a)}else e=a.makeEndpoint(0===c,b,f),e._doNotDeleteOnDetach=!1,e._deleteOnDetach=!0;return null!=e&&(j.detachFromConnection(a),a.endpoints[c]=e,a[h.el]=e.element,a[h.elId]=e.elementId,k[0===c?"newSourceId":"newTargetId"]=e.elementId,_(k),d||a.repaint()),k}.bind(this);this.setSource=function(a,b,c){var d=Z(a,b,0,c);this.anchorManager.sourceChanged(d.originalSourceId,d.newSourceId,a)},this.setTarget=function(a,b,c){var d=Z(a,b,1,c);this.anchorManager.updateOtherEndpoint(d.originalSourceId,d.originalTargetId,d.newTargetId,a)},this.deleteEndpoint=function(a,b){var c="string"==typeof a?u[a]:a;return c&&f.deleteObject({endpoint:c,dontUpdateHover:b}),f},this.deleteEveryEndpoint=function(){var a=f.setSuspendDrawing(!0);for(var b in s){var c=s[b];if(c&&c.length)for(var d=0,e=c.length;e>d;d++)f.deleteEndpoint(c[d],!0)}return s=
 {},v={},u={},f.anchorManager.reset(),f.dragManager.reset(),a||f.setSuspendDrawing(!1),f};var $=function(a,b,c){var d=f.Defaults.ConnectionType||f.getDefaultConnectionType(),e=a.constructor==d,g=e?{connection:a,source:a.source,target:a.target,sourceId:a.sourceId,targetId:a.targetId,sourceEndpoint:a.endpoints[0],targetEndpoint:a.endpoints[1]}:a;b&&f.fire("connectionDetached",g,c),f.anchorManager.connectionDetached(g)},_=f.fireMoveEvent=function(a,b){f.fire("connectionMoved",a,b)};this.unregisterEndpoint=function(a){a._jsPlumb.uuid&&(u[a._jsPlumb.uuid]=null),f.anchorManager.deleteEndpoint(a);for(var b in s){var c=s[b];if(c){for(var d=[],e=0,g=c.length;g>e;e++)c[e]!=a&&d.push(c[e]);s[b]=d}s[b].length<1&&delete s[b]}},this.detach=function(){if(0!==arguments.length){var a=f.Defaults.ConnectionType||f.getDefaultConnectionType(),b=arguments[0].constructor==a,c=2==arguments.length?b?arguments[1]||{}:arguments[0]:arguments[0],d=c.fireEvent!==!1,e=c.forceDetach,g=b?arguments[0]:c.connection;if
 (g)(e||jsPlumbUtil.functionChain(!0,!1,[[g.endpoints[0],"isDetachAllowed",[g]],[g.endpoints[1],"isDetachAllowed",[g]],[g,"isDetachAllowed",[g]],[f,"checkCondition",["beforeDetach",g]]]))&&g.endpoints[0].detach(g,!1,!0,d);else{var h=t.extend({},c);if(h.uuids)K(h.uuids[0]).detachFrom(K(h.uuids[1]),d);else if(h.sourceEndpoint&&h.targetEndpoint)h.sourceEndpoint.detachFrom(h.targetEndpoint);else{var i=X(f.getDOMElement(h.source)),j=X(f.getDOMElement(h.target));R(i,function(a){(a.sourceId==i&&a.targetId==j||a.targetId==i&&a.sourceId==j)&&f.checkCondition("beforeDetach",a)&&a.endpoints[0].detach(a,!1,!0,d)})}}}},this.detachAllConnections=function(a,b){b=b||{},a=f.getDOMElement(a);var c=X(a),d=s[c];if(d&&d.length)for(var e=0,g=d.length;g>e;e++)d[e].detachAll(b.fireEvent!==!1);return f},this.detachEveryConnection=function(a){return a=a||{},f.doWhileSuspended(function(){for(var b in s){var c=s[b];if(c&&c.length)for(var d=0,e=c.length;e>d;d++)c[d].detachAll(a.fireEvent!==!1)}q.length=0}),f},th
 is.deleteObject=function(a){var b={endpoints:{},connections:{},endpointCount:0,connectionCount:0},c=a.fireEvent!==!1,d=a.deleteAttachedObjects!==!1,e=function(c){if(null!=c&&null==b.connections[c.id]&&(a.dontUpdateHover||null==c._jsPlumb||c.setHover(!1),b.connections[c.id]=c,b.connectionCount++,d))for(var e=0;e<c.endpoints.length;e++)c.endpoints[e]._deleteOnDetach&&g(c.endpoints[e])},g=function(c){if(null!=c&&null==b.endpoints[c.id]&&(a.dontUpdateHover||null==c._jsPlumb||c.setHover(!1),b.endpoints[c.id]=c,b.endpointCount++,d))for(var f=0;f<c.connections.length;f++){var g=c.connections[f];e(g)}};a.connection?e(a.connection):g(a.endpoint);for(var h in b.connections){var i=b.connections[h];i._jsPlumb&&(jsPlumbUtil.removeWithFunction(q,function(a){return i.id==a.id}),$(i,c,a.originalEvent),i.endpoints[0].detachFromConnection(i),i.endpoints[1].detachFromConnection(i),i.cleanup(),i.destroy())}for(var j in b.endpoints){var k=b.endpoints[j];k._jsPlumb&&(f.unregisterEndpoint(k),k.cleanup(),k
 .destroy())}return b},this.draggable=function(a,b){var c,d,e;if("object"==typeof a&&a.length)for(c=0,d=a.length;d>c;c++)e=l(a[c]),e.el&&L(e.el,!0,b,e.id);else e=l(a),e.el&&L(e.el,!0,b,e.id);return f};var ab=function(a,b,c,d){for(var e=0,f=a.length;f>e;e++)a[e][b].apply(a[e],c);return d(a)},bb=function(a,b,c){for(var d=[],e=0,f=a.length;f>e;e++)d.push([a[e][b].apply(a[e],c),a[e]]);return d},cb=function(a,b,c){return function(){return ab(a,b,arguments,c)}},db=function(a,b){return function(){return bb(a,b,arguments)}},eb=function(a,b){var c=[];if(a)if("string"==typeof a){if("*"===a)return a;c.push(a)}else if(b)c=a;else if(a.length)for(var d=0,e=a.length;e>d;d++)c.push(l(a[d]).id);else c.push(l(a).id);return c},fb=function(a,b,c){return"*"===a?!0:a.length>0?-1!=jsPlumbUtil.indexOf(a,b):!c};this.getConnections=function(a,b){a?a.constructor==String&&(a={scope:a}):a={};for(var c=a.scope||f.getDefaultScope(),d=eb(c,!0),e=eb(a.source),g=eb(a.target),h=!b&&d.length>1?{}:[],i=function(a,c){if(
 !b&&d.length>1){var e=h[a];null==e&&(e=h[a]=[]),e.push(c)}else h.push(c)},j=0,k=q.length;k>j;j++){var l=q[j];fb(d,l.scope)&&fb(e,l.sourceId)&&fb(g,l.targetId)&&i(l.scope,l)}return h};var gb=function(a,b){return function(c){for(var d=0,e=a.length;e>d;d++)c(a[d]);return b(a)}},hb=function(a){return function(b){return a[b]}},ib=function(a,b){var c,d,e={length:a.length,each:gb(a,b),get:hb(a)},f=["setHover","removeAllOverlays","setLabel","addClass","addOverlay","removeOverlay","removeOverlays","showOverlay","hideOverlay","showOverlays","hideOverlays","setPaintStyle","setHoverPaintStyle","setSuspendEvents","setParameter","setParameters","setVisible","repaint","addType","toggleType","removeType","removeClass","setType","bind","unbind"],g=["getLabel","getOverlay","isHover","getParameter","getParameters","getPaintStyle","getHoverPaintStyle","isVisible","hasType","getType","isSuspendEvents"];for(c=0,d=f.length;d>c;c++)e[f[c]]=cb(a,f[c],b);for(c=0,d=g.length;d>c;c++)e[g[c]]=db(a,g[c]);return e
 },jb=function(a){var b=ib(a,jb);return t.extend(b,{setDetachable:cb(a,"setDetachable",jb),setReattach:cb(a,"setReattach",jb),setConnector:cb(a,"setConnector",jb),detach:function(){for(var b=0,c=a.length;c>b;b++)f.detach(a[b])},isDetachable:db(a,"isDetachable"),isReattach:db(a,"isReattach")})},kb=function(a){var b=ib(a,kb);return t.extend(b,{setEnabled:cb(a,"setEnabled",kb),setAnchor:cb(a,"setAnchor",kb),isEnabled:db(a,"isEnabled"),detachAll:function(){for(var b=0,c=a.length;c>b;b++)a[b].detachAll()},remove:function(){for(var b=0,c=a.length;c>b;b++)f.deleteObject({endpoint:a[b]})}})};this.select=function(a){return a=a||{},a.scope=a.scope||"*",jb(a.connections||f.getConnections(a,!0))},this.selectEndpoints=function(a){a=a||{},a.scope=a.scope||"*";var b=!a.element&&!a.source&&!a.target,c=b?"*":eb(a.element),d=b?"*":eb(a.source),e=b?"*":eb(a.target),f=eb(a.scope,!0),g=[];for(var h in s){var i=fb(c,h,!0),j=fb(d,h,!0),k="*"!=d,l=fb(e,h,!0),m="*"!=e;if(i||j||l)a:for(var n=0,o=s[h].length;o
 >n;n++){var p=s[h][n];if(fb(f,p.scope,!0)){var q=k&&d.length>0&&!p.isSource,r=m&&e.length>0&&!p.isTarget;
+if(q||r)continue a;g.push(p)}}}return kb(g)},this.getAllConnections=function(){return q},this.getDefaultScope=function(){return D},this.getEndpoint=K,this.getEndpoints=function(a){return s[l(a).id]},this.getDefaultEndpointType=function(){return t.Endpoint},this.getDefaultConnectionType=function(){return t.Connection},this.getId=X,this.getOffset=function(a){return tb({elId:a}).o},this.appendElement=H;var lb=!1;this.isHoverSuspended=function(){return lb},this.setHoverSuspended=function(a){lb=a};var mb=function(a){return function(){return jsPlumbAdapter.isRenderModeAvailable(a)}};this.isSVGAvailable=mb("svg"),this.isVMLAvailable=mb("vml"),this.hide=function(a,b){return T(a,"none",b),f},this.idstamp=G,this.connectorsInitialized=!1;var nb=[],ob=["svg","vml"];this.registerConnectorType=function(a,b){nb.push([a,b])};var pb=function(a){if(!n&&a){var b=f.getDOMElement(a);b.offsetParent&&f.setContainer(b.offsetParent)}},qb=function(){f.Defaults.Container&&f.setContainer(f.Defaults.Container)}
 ,rb=f.manage=function(a,b){return v[a]||(v[a]={el:b,endpoints:[],connections:[]},v[a].info=tb({elId:a,timestamp:C})),v[a]},sb=function(a){delete v[a]},tb=this.updateOffset=function(a){var c,d=a.timestamp,e=a.recalc,g=a.offset,h=a.elId;return B&&!d&&(d=C),!e&&d&&d===x[h]?{o:a.offset||w[h],s:A[h]}:(e||!g&&null==w[h]?(c=v[h]?v[h].el:null,null!=c&&(A[h]=f.getSize(c),w[h]=b(c,f),x[h]=d)):(w[h]=g||w[h],null==A[h]&&(c=v[h].el,null!=c&&(A[h]=f.getSize(c))),x[h]=d),w[h]&&!w[h].right&&(w[h].right=w[h].left+A[h][0],w[h].bottom=w[h].top+A[h][1],w[h].width=A[h][0],w[h].height=A[h][1],w[h].centerx=w[h].left+w[h].width/2,w[h].centery=w[h].top+w[h].height/2),{o:w[h],s:A[h]})};this.init=function(){var a=function(a,b,c){t.Connectors[a][b]=function(){c.apply(this,arguments),t.ConnectorRenderers[a].apply(this,arguments)},jsPlumbUtil.extend(t.Connectors[a][b],[c,t.ConnectorRenderers[a]])};if(!t.connectorsInitialized){for(var b=0;b<nb.length;b++)for(var c=0;c<ob.length;c++)a(ob[c],nb[b][1],nb[b][0]);t.co
 nnectorsInitialized=!0}p||(qb(),f.anchorManager=new t.AnchorManager({jsPlumbInstance:f}),f.setRenderMode(f.Defaults.RenderMode),p=!0,f.fire("ready",f))}.bind(this),this.log=o,this.jsPlumbUIComponent=i,this.makeAnchor=function(){var b,c=function(a,b){if(t.Anchors[a])return new t.Anchors[a](b);if(!f.Defaults.DoNotThrowErrors)throw{msg:"jsPlumb: unknown anchor type '"+a+"'"}};if(0===arguments.length)return null;var d=arguments[0],e=arguments[1],g=(arguments[2],null);if(d.compute&&d.getOrientation)return d;if("string"==typeof d)g=c(arguments[0],{elementId:e,jsPlumbInstance:f});else if(a.isArray(d))if(a.isArray(d[0])||a.isString(d[0]))2==d.length&&a.isObject(d[1])?a.isString(d[0])?(b=t.extend({elementId:e,jsPlumbInstance:f},d[1]),g=c(d[0],b)):(b=t.extend({elementId:e,jsPlumbInstance:f,anchors:d[0]},d[1]),g=new t.DynamicAnchor(b)):g=new t.DynamicAnchor({anchors:d,selector:null,elementId:e,jsPlumbInstance:f});else{var h={x:d[0],y:d[1],orientation:d.length>=4?[d[2],d[3]]:[0,0],offsets:d.len
 gth>=6?[d[4],d[5]]:[0,0],elementId:e,jsPlumbInstance:f,cssClass:7==d.length?d[6]:null};g=new t.Anchor(h),g.clone=function(){return new t.Anchor(h)}}return g.id||(g.id="anchor_"+G()),g},this.makeAnchors=function(b,c,d){for(var e=[],g=0,h=b.length;h>g;g++)"string"==typeof b[g]?e.push(t.Anchors[b[g]]({elementId:c,jsPlumbInstance:d})):a.isArray(b[g])&&e.push(f.makeAnchor(b[g],c,d));return e},this.makeDynamicAnchor=function(a,b){return new t.DynamicAnchor({anchors:a,selector:b,elementId:null,jsPlumbInstance:f})},this.targetEndpointDefinitions={};var ub=function(a,b,c){a.paintStyle=a.paintStyle||c.Defaults.EndpointStyles[b]||c.Defaults.EndpointStyle,a.hoverPaintStyle=a.hoverPaintStyle||c.Defaults.EndpointHoverStyles[b]||c.Defaults.EndpointHoverStyle,a.anchor=a.anchor||c.Defaults.Anchors[b]||c.Defaults.Anchor,a.endpoint=a.endpoint||c.Defaults.Endpoints[b]||c.Defaults.Endpoint};this.sourceEndpointDefinitions={};var vb=function(a,b,c,d,e){for(var f=a.target||a.srcElement,g=!1,h=d.getSelector
 (b,c),i=0;i<h.length;i++)if(h[i]==f){g=!0;break}return e?!g:g};this.makeTarget=function(c,d,e){var g=t.extend({_jsPlumb:this},e);t.extend(g,d),ub(g,1,this);for(var h=g.scope||f.Defaults.Scope,j=(!(g.deleteEndpointsOnDetach===!1),g.maxConnections||-1),k=g.onMaxConnections,m=function(c){var d=l(c),e=d.id,m=new i(g),n=t.extend({},g.dropOptions||{});pb(e);var o={def:g,uniqueEndpoint:g.uniqueEndpoint,maxConnections:j,enabled:!0};d.el._jsPlumbTarget=o,this.targetEndpointDefinitions[e]=o;var p=g._jsPlumb.EndpointDropHandler({jsPlumb:f,enabled:function(){return d.el._jsPlumbTarget.enabled},isFull:function(a){var b=f.select({target:e}).length,c=d.el._jsPlumbTarget,g=c.maxConnections>0&&b>=c.maxConnections;return g&&k&&k({element:d.el,connection:jpc},a),g},element:d.el,elementId:e,isSource:!1,isTarget:!0,addClass:function(a){f.addClass(d.el,a)},removeClass:function(a){f.removeClass(d.el,a)},onDrop:function(a){var b=a.endpoints[0];b.anchor.locked=!1},isDropAllowed:function(){return m.isDropAll
 owed.apply(m,arguments)},getEndpoint:function(a){var c=f.getElementObject(d.el),e=d.el._jsPlumbTarget,h=e.endpoint;if((null==h||null==h._jsPlumb)&&(h=f.addEndpoint(c,g)),g.uniqueEndpoint&&(e.endpoint=h),h._doNotDeleteOnDetach=!1,h._deleteOnDetach=!0,a.isDetachable()&&h.initDraggable(),null!=h.anchor.positionFinder){var i=f.getUIPosition(arguments,this.getZoom()),j=b(c,this),k=f.getSize(c),l=h.anchor.positionFinder(i,j,k,h.anchor.constructorParams);h.anchor.x=l[0],h.anchor.y=l[1]}return h}}),q=t.dragEvents.drop;n.scope=n.scope||h,n[q]=a.wrap(n[q],p),g.allowLoopback===!1&&(n.canDrop=function(a){var b=a.getDragElement()._jsPlumbRelatedElement;return b!=d.el}),this.initDroppable(this.getElementObject(d.el),n,"internal")}.bind(this),n=c.length&&c.constructor!=String?c:[c],o=0,p=n.length;p>o;o++)m(n[o]);return this},this.unmakeTarget=function(a,b){var c=l(a);return t.destroyDroppable(c.el),b||delete this.targetEndpointDefinitions[c.id],this},this.makeSource=function(c,d,e){var g=t.extend(
 {},e);t.extend(g,d),ub(g,0,this);for(var h=g.maxConnections||1,i=g.onMaxConnections,j=function(c){var d=c.id,e=this.getElementObject(c.el),j=this.getDOMElement(e),l=function(){return null==g.parent?null:"parent"===g.parent?c.el.parentNode:f.getDOMElement(g.parent)},m=null!=g.parent?this.getId(l()):d;pb(m),this.sourceEndpointDefinitions[m]={def:g,uniqueEndpoint:g.uniqueEndpoint,maxConnections:h,enabled:!0};var o=t.dragEvents.stop,p=t.dragEvents.drag,q=t.extend({},g.dragOptions||{}),r=q.drag,s=q.stop,u=null,v=!1;q.scope=q.scope||g.scope,q[p]=a.wrap(q[p],function(){r&&r.apply(this,arguments),v=!1}),q[o]=a.wrap(q[o],function(){if(s&&s.apply(this,arguments),this.currentlyDragging=!1,null!=u._jsPlumb){var a=g.anchor||this.Defaults.Anchor,c=u.anchor,e=u.connections[0],f=this.makeAnchor(a,d,this),h=u.element;if(null!=f.positionFinder){var i=b(h,this),j=this.getSize(h),k={left:i.left+c.x*j[0],top:i.top+c.y*j[1]},m=f.positionFinder(k,i,j,f.constructorParams);f.x=m[0],f.y=m[1]}if(u.setAnchor(f
 ,!0),g.parent){var o=l();if(o){var p=g.container||n;u.setElement(o,p)}}u.repaint(),this.repaint(u.elementId),this.repaint(e.targetId)}}.bind(this));var w=function(a){var b=this.getOriginalEvent(a);if(3!==a.which&&2!==a.button){var c=this.sourceEndpointDefinitions[m];if(d=this.getId(this.getDOMElement(e)),c.enabled){if(g.filter){var n=jsPlumbUtil.isString(g.filter)?vb(b,e,g.filter,this,g.filterExclude):g.filter(b,e);if(n===!1)return}var o=this.select({source:m}).length;if(c.maxConnections>=0&&c.uniqueEndpoint&&o>=c.maxConnections)return i&&i({element:e,maxConnections:h},a),!1;var p=jsPlumbAdapter.getPositionOnElement(b,j,k),r={};t.extend(r,g),r.isTemporarySource=!0,r.anchor=[p[0],p[1],0,0],r.dragOptions=q,u=this.addEndpoint(d,r),v=!0,u.endpointWillMoveTo=g.parent?l():null,c.uniqueEndpoint&&(c.endpoint?u.finalEndpoint=c.endpoint:c.endpoint=u),u._doNotDeleteOnDetach=!1,u._deleteOnDetach=!0;var s=function(){f.off(u.canvas,"mouseup",s),f.off(e,"mouseup",s),v&&(v=!1,f.deleteEndpoint(u))};
 f.on(u.canvas,"mouseup",s),f.on(e,"mouseup",s),f.trigger(u.canvas,"mousedown",a),jsPlumbUtil.consume(a)}}}.bind(this);this.on(e,"mousedown",w),this.sourceEndpointDefinitions[m].trigger=w,g.filter&&jsPlumbUtil.isString(g.filter)&&f.setDragFilter(e,g.filter)}.bind(this),m=c.length&&c.constructor!=String?c:[c],o=0,p=m.length;p>o;o++)j(l(m[o]));return this},this.unmakeSource=function(a,b){var c=l(a),d=this.sourceEndpointDefinitions[c.id].trigger;return d&&f.off(c.el,"mousedown",d),b||delete this.sourceEndpointDefinitions[c.id],this},this.unmakeEverySource=function(){for(var a in this.sourceEndpointDefinitions)f.unmakeSource(a,!0);return this.sourceEndpointDefinitions={},this};var wb=function(a,b){b=jsPlumbUtil.isArray(b)?b:[b];for(var c=X(a),d=0;d<b.length;d++){var e=this[b[d]][c];if(e)return e.def.scope||this.Defaults.Scope}}.bind(this),xb=function(a,b,c){c=jsPlumbUtil.isArray(c)?c:[c];for(var d=X(a),e=0;e<c.length;e++){var f=this[c[e]][d];f&&(f.def.scope=b,null!=this.scopeChange&&this
 .scopeChange(a,d,s[d],b,c[e]))}}.bind(this);this.getScope=function(a){return wb(a,["sourceEndpointDefinitions","targetEndpointDefinitions"])},this.getSourceScope=function(a){return wb(a,"sourceEndpointDefinitions")},this.getTargetScope=function(a){return wb(a,"targetEndpointDefinitions")},this.setScope=function(a,b){xb(a,b,["sourceEndpointDefinitions","targetEndpointDefinitions"])},this.setSourceScope=function(a,b){xb(a,b,"sourceEndpointDefinitions")},this.setTargetScope=function(a,b){xb(a,b,"targetEndpointDefinitions")},this.unmakeEveryTarget=function(){for(var a in this.targetEndpointDefinitions)f.unmakeTarget(a,!0);return this.targetEndpointDefinitions={},this};var yb=function(b,c,d,e){var f="source"==b?this.sourceEndpointDefinitions:this.targetEndpointDefinitions;if(a.isString(c))f[c].enabled=e?!f[c].enabled:d;else if(c.length)for(var g=0,h=c.length;h>g;g++){var i=l(c[g]);f[i.id]&&(f[i.id].enabled=e?!f[i.id].enabled:d)}else{var j=l(c).id;f[j].enabled=e?!f[j].enabled:d}return thi
 s}.bind(this),zb=function(b,c){return a.isString(b)||!b.length?c.apply(this,[b]):b.length?c.apply(this,[b[0]]):void 0}.bind(this);this.toggleSourceEnabled=function(a){return yb("source",a,null,!0),this.isSourceEnabled(a)},this.setSourceEnabled=function(a,b){return yb("source",a,b)},this.isSource=function(a){return zb(a,function(a){return null!=this.sourceEndpointDefinitions[l(a).id]}.bind(this))},this.isSourceEnabled=function(a){return zb(a,function(a){var b=this.sourceEndpointDefinitions[l(a).id];return b&&b.enabled===!0}.bind(this))},this.toggleTargetEnabled=function(a){return yb("target",a,null,!0),this.isTargetEnabled(a)},this.isTarget=function(a){return zb(a,function(a){return null!=this.targetEndpointDefinitions[l(a).id]}.bind(this))},this.isTargetEnabled=function(a){return zb(a,function(a){var b=this.targetEndpointDefinitions[l(a).id];return b&&b.enabled===!0}.bind(this))},this.setTargetEnabled=function(a,b){return yb("target",a,b)},this.ready=function(a){f.bind("ready",a)},t
 his.repaint=function(a,b,c){if("object"==typeof a&&a.length)for(var d=0,e=a.length;e>d;d++)I(a[d],b,c);else I(a,b,c);return f},this.revalidate=function(a){var b=f.getId(a);return f.updateOffset({elId:b,recalc:!0}),f.repaint(a)},this.repaintEverything=function(a){var b,d=c();for(b in s)f.updateOffset({elId:b,recalc:!0,timestamp:d});for(b in s)I(b,null,d,a);return this},this.removeAllEndpoints=function(a,b){var c=function(a){var d,e,g=l(a),h=s[g.id];if(h)for(d=0,e=h.length;e>d;d++)f.deleteEndpoint(h[d]);if(delete s[g.id],b&&g.el&&3!=g.el.nodeType&&8!=g.el.nodeType)for(d=0,e=g.el.childNodes.length;e>d;d++)c(g.el.childNodes[d])};return c(a),this},this.remove=function(a,b){var c=l(a);return f.doWhileSuspended(function(){f.removeAllEndpoints(c.id,!0),f.dragManager.elementRemoved(c.id),delete f.floatingConnections[c.id],f.anchorManager.clearFor(c.id),f.anchorManager.removeFloatingConnection(c.id)},b===!1),sb(c.id),c.el&&(f.removeElement(c.el),c.el._jsPlumb=null),f},this.reset=function(){f.
 setSuspendEvents(!0),f.deleteEveryEndpoint(),f.unbind(),this.targetEndpointDefinitions={},this.sourceEndpointDefinitions={},q.length=0,f.setSuspendEvents(!1)};var Ab=function(a){a.canvas&&a.canvas.parentNode&&a.canvas.parentNode.removeChild(a.canvas),a.cleanup(),a.destroy()},Bb=function(a){Ab(a)};this.clear=function(){f.select().each(Bb),f.selectEndpoints().each(Bb),s={},u={}},this.setDefaultScope=function(a){return D=a,f},this.setDraggable=S,this.setId=function(a,b,c){var d;jsPlumbUtil.isString(a)?d=a:(a=this.getDOMElement(a),d=this.getId(a));var e=this.getConnections({source:d,scope:"*"},!0),f=this.getConnections({target:d,scope:"*"},!0);b=""+b,c?a=this.getDOMElement(b):(a=this.getDOMElement(d),this.setAttribute(a,"id",b)),s[b]=s[d]||[];for(var g=0,h=s[b].length;h>g;g++)s[b][g].setElementId(b),s[b][g].setReferenceElement(a);delete s[d],this.anchorManager.changeId(d,b),this.dragManager&&this.dragManager.changeId(d,b),v[b]=v[d],delete v[d];var i=function(c,d,e){for(var f=0,g=c.lengt
 h;g>f;f++)c[f].endpoints[d].setElementId(b),c[f].endpoints[d].setReferenceElement(a),c[f][e+"Id"]=b,c[f][e]=a};i(e,0,"source"),i(f,1,"target"),this.repaint(b)},this.setDebugLog=function(a){o=a},this.setSuspendDrawing=function(a,b){var c=B;return B=a,C=a?(new Date).getTime():null,b&&this.repaintEverything(),c},this.isSuspendDrawing=function(){return B},this.getSuspendedAt=function(){return C},this.doWhileSuspended=function(b,c){var d=this.isSuspendDrawing();d||this.setSuspendDrawing(!0);try{b()}catch(e){a.log("Function run while suspended failed",e)}d||this.setSuspendDrawing(!1,!c)},this.getOffset=function(a){return w[a]},this.getCachedData=W,this.timestamp=c,this.setRenderMode=function(a){if(a!==t.SVG&&a!==t.VML)throw new TypeError("Render mode ["+a+"] not supported");return E=jsPlumbAdapter.setRenderMode(a)},this.getRenderMode=function(){return E},this.show=function(a,b){return T(a,"block",b),f},this.toggleVisible=V,this.toggleDraggable=U,this.addListener=this.bind,jsPlumbAdapter.h
 eadless||(f.dragManager=jsPlumbAdapter.getDragManager(f),f.recalculateOffsets=f.dragManager.updateOffsets)};jsPlumbUtil.extend(s,jsPlumbUtil.EventGenerator,{setAttribute:function(a,b,c){this.setAttribute(a,b,c)},getAttribute:function(a,b){return this.getAttribute(t.getDOMElement(a),b)},registerConnectionType:function(a,b){this._connectionTypes[a]=t.extend({},b)},registerConnectionTypes:function(a){for(var b in a)this._connectionTypes[b]=t.extend({},a[b])},registerEndpointType:function(a,b){this._endpointTypes[a]=t.extend({},b)},registerEndpointTypes:function(a){for(var b in a)this._endpointTypes[b]=t.extend({},a[b])},getType:function(a,b){return"connection"===b?this._connectionTypes[a]:this._endpointTypes[a]},setIdChanged:function(a,b){this.setId(a,b,!0)},setParent:function(a,b){var c=this.getElementObject(a),d=this.getDOMElement(c),e=this.getId(d),f=this.getElementObject(b),g=this.getDOMElement(f),h=this.getId(g);d.parentNode.removeChild(d),g.appendChild(d),this.dragManager.setPare
 nt(c,e,f,h)},getSize:function(a){return[a.offsetWidth,a.offsetHeight]},getWidth:function(a){return a.offsetWidth},getHeight:function(a){return a.offsetHeight},extend:function(a,b,c){var d;if(c)for(d=0;d<c.length;d++)a[c[d]]=b[c[d]];else for(d in b)a[d]=b[d];return a},floatingConnections:{},getFloatingAnchorIndex:function(a){return a.endpoints[0].isFloating()?0:1}},jsPlumbAdapter);var t=new s;"undefined"!=typeof window&&(window.jsPlumb=t),t.getInstance=function(a){var b=new s(a);return b.init(),b},"function"==typeof define&&(define("jsplumb",[],function(){return t}),define("jsplumbinstance",[],function(){return t.getInstance()})),"undefined"!=typeof exports&&(exports.jsPlumb=t)}(),function(){"use strict";var a=function(a,b){var c=!1;return{drag:function(){if(c)return c=!1,!0;var d=jsPlumb.getUIPosition(arguments,b.getZoom());a.element&&(jsPlumbAdapter.setPosition(a.element,d),b.repaint(a.element,d))},stopDrag:function(){c=!0}}},b=function(a,b){var c=document.createElement("div");c.st
 yle.position="absolute";var d=b.getContainer()||document.body;d.appendChild(c);var e=b.getId(c);b.manage(e,c),a.id=e,a.element=c},c=function(a,b,c,d,e,f,g,h){var i=new jsPlumb.FloatingAnchor({reference:b,referenceCanvas:d,jsPlumbInstance:f});return g({paintStyle:a,endpoint:c,anchor:i,source:e,scope:h})},d=["connectorStyle","connectorHoverStyle","connectorOverlays","connector","connectionType","connectorClass","connectorHoverClass"],e=function(a,b){var c=0;if(null!=b)for(var d=0;d<a.connections.length;d++)if(a.connections[d].sourceId==b||a.connections[d].targetId==b){c=d;break}return a.connections[c]},f=function(a,b){return jsPlumbUtil.findWithFunction(b.connections,function(b){return b.id==a.id})};jsPlumb.Endpoint=function(g){var h=g._jsPlumb,i=jsPlumb.getElementObject,j=jsPlumbUtil,k=g.newConnection,l=g.newEndpoint;g.finaliseConnection,g.fireMoveEvent,this.idPrefix="_jsplumb_e_",this.defaultLabelLocation=[.5,.5],this.defaultOverlayKeys=["Overlays","EndpointOverlays"],OverlayCapable
 JsPlumbUIComponent.apply(this,arguments),this.getDefaultType=function(){return{parameters:{},scope:null,maxConnections:this._jsPlumb.instance.Defaults.MaxConnections,paintStyle:this._jsPlumb.instance.Defaults.EndpointStyle||jsPlumb.Defaults.EndpointStyle,endpoint:this._jsPlumb.instance.Defaults.Endpoint||jsPlumb.Defaults.Endpoint,hoverPaintStyle:this._jsPlumb.instance.Defaults.EndpointHoverStyle||jsPlumb.Defaults.EndpointHoverStyle,overlays:this._jsPlumb.instance.Defaults.EndpointOverlays||jsPlumb.Defaults.EndpointOverlays,connectorStyle:g.connectorStyle,connectorHoverStyle:g.connectorHoverStyle,connectorClass:g.connectorClass,connectorHoverClass:g.connectorHoverClass,connectorOverlays:g.connectorOverlays,connector:g.connector,connectorTooltip:g.connectorTooltip}},this._jsPlumb.enabled=!(g.enabled===!1),this._jsPlumb.visible=!0,this.element=jsPlumb.getDOMElement(g.source),this._jsPlumb.uuid=g.uuid,this._jsPlumb.floatingEndpoint=null;var m=null;this._jsPlumb.uuid&&(g.endpointsByUUID[
 this._jsPlumb.uuid]=this),this.elementId=g.elementId,this._jsPlumb.connectionCost=g.connectionCost,this._jsPlumb.connectionsDirected=g.connectionsDirected,this._jsPlumb.currentAnchorClass="",this._jsPlumb.events={};var n=function(){var a=this._jsPlumb.currentAnchorClass;this._jsPlumb.currentAnchorClass=this.anchor.getCssClass(),jsPlumbAdapter.updateClasses(this.element,h.endpointAnchorClassPrefix+"_"+this._jsPlumb.currentAnchorClass,h.endpointAnchorClassPrefix+"_"+a),this.updateClasses(h.endpointAnchorClassPrefix+"_"+this._jsPlumb.currentAnchorClass,h.endpointAnchorClassPrefix+"_"+a)}.bind(this);this.setAnchor=function(a,b){return this._jsPlumb.instance.continuousAnchorFactory.clear(this.elementId),this.anchor=this._jsPlumb.instance.makeAnchor(a,this.elementId,h),n(),this.anchor.bind("anchorChanged",function(a){this.fire("anchorChanged",{endpoint:this,anchor:a}),n()}.bind(this)),b||this._jsPlumb.instance.repaint(this.elementId),this};var o=g.anchor?g.anchor:g.anchors?g.anchors:h.Def
 aults.Anchor||"Top";this.setAnchor(o,!0);var p=function(a){if(this.connections.length>0)for(var b=0;b<this.connections.length;b++)this.connections[b].setHover(a,!1);else this.setHover(a)}.bind(this);this.bind("mouseover",function(){p(!0)}),this.bind("mouseout",function(){p(!1)}),g._transient||this._jsPlumb.instance.anchorManager.add(this,this.elementId),this.setEndpoint=function(a){null!=this.endpoint&&(this.endpoint.cleanup(),this.endpoint.destroy());var b=function(a,b){var c=h.getRenderMode();if(jsPlumb.Endpoints[c][a])return new jsPlumb.Endpoints[c][a](b);if(!h.Defaults.DoNotThrowErrors)throw{msg:"jsPlumb: unknown endpoint type '"+a+"'"}},c={_jsPlumb:this._jsPlumb.instance,cssClass:g.cssClass,container:g.container,tooltip:g.tooltip,connectorTooltip:g.connectorTooltip,endpoint:this};j.isString(a)?this.endpoint=b(a,c):j.isArray(a)?(c=j.merge(a[1],c),this.endpoint=b(a[0],c)):this.endpoint=a.clone(),this.endpoint.clone=function(){return j.isString(a)?b(a,c):j.isArray(a)?(c=j.merge(a[
 1],c),b(a[0],c)):void 0}.bind(this),this.type=this.endpoint.type},this.setEndpoint(g.endpoint||h.Defaults.Endpoint||jsPlumb.Defaults.Endpoint||"Dot"),this.setPaintStyle(g.endpointStyle||g.paintStyle||g.style||h.Defaults.EndpointStyle||jsPlumb.Defaults.EndpointStyle,!0),this.setHoverPaintStyle(g.endpointHoverStyle||g.hoverPaintStyle||h.Defaults.EndpointHoverStyle||jsPlumb.Defaults.EndpointHoverStyle,!0),this._jsPlumb.paintStyleInUse=this.getPaintStyle(),jsPlumb.extend(this,g,d),this.isSource=g.isSource||!1,this.isTemporarySource=g.isTemporarySource||!1,this.isTarget=g.isTarget||!1,this._jsPlumb.maxConnections=g.maxConnections||h.Defaults.MaxConnections,this.canvas=this.endpoint.canvas,this.canvas._jsPlumb=this,this.addClass(h.endpointAnchorClassPrefix+"_"+this._jsPlumb.currentAnchorClass),jsPlumbAdapter.addClass(this.element,h.endpointAnchorClassPrefix+"_"+this._jsPlumb.currentAnchorClass),this.connections=g.connections||[],this.connectorPointerEvents=g["connector-pointer-events"],th
 is.scope=g.scope||h.getDefaultScope(),this.timestamp=null,this.reattachConnections=g.reattach||h.Defaults.ReattachConnections,this.connectionsDetachable=h.Defaults.ConnectionsDetachable,(g.connectionsDetachable===!1||g.detachable===!1)&&(this.connectionsDetachable=!1),this.dragAllowedWhenFull=g.dragAllowedWhenFull!==!1,g.onMaxConnections&&this.bind("maxConnections",g.onMaxConnections),this.addConnection=function(a){this.connections.push(a),this[(this.connections.length>0?"add":"remove")+"Class"](h.endpointConnectedClass),this[(this.isFull()?"add":"remove")+"Class"](h.endpointFullClass)},this.detachFromConnection=function(a,b,c){b=null==b?f(a,this):b,b>=0&&(this.connections.splice(b,1),this[(this.connections.length>0?"add":"remove")+"Class"](h.endpointConnectedClass),this[(this.isFull()?"add":"remove")+"Class"](h.endpointFullClass)),!c&&this._deleteOnDetach&&0===this.connections.length&&h.deleteObject({endpoint:this,fireEvent:!1,deleteAttachedObjects:!1})},this.detach=function(a,b,c,
 d,e,g,i){var j=null==i?f(a,this):i,k=!1;return d=d!==!1,j>=0&&(c||a._forceDetach||a.isDetachable()&&a.isDetachAllowed(a)&&this.isDetachAllowed(a)&&h.checkCondition("beforeDetach",a))&&(h.deleteObject({connection:a,fireEvent:!b&&d,originalEvent:e,deleteAttachedObjects:!1}),k=!0),k},this.detachAll=function(a,b){for(;this.connections.length>0;)this.detach(this.connections[0],!1,!0,a!==!1,b,this,0);return this},this.detachFrom=function(a,b,c){for(var d=[],e=0;e<this.connections.length;e++)(this.connections[e].endpoints[1]==a||this.connections[e].endpoints[0]==a)&&d.push(this.connections[e]);for(var f=0;f<d.length;f++)this.detach(d[f],!1,!0,b,c);return this},this.getElement=function(){return this.element},this.setElement=function(a){var b=this._jsPlumb.instance.getId(a),c=this.elementId;return j.removeWithFunction(g.endpointsByElement[this.elementId],function(a){return a.id==this.id}.bind(this)),this.element=jsPlumb.getDOMElement(a),this.elementId=h.getId(this.element),h.anchorManager.re
 homeEndpoint(this,c,this.element),h.dragManager.endpointAdded(this.element),j.addToList(g.endpointsByElement,b,this),this},this.makeInPlaceCopy=function(){var a=this.anchor.getCurrentLocation({element:this}),b=this.anchor.getOrientation(this),c=this.anchor.getCssClass(),d={bind:function(){},compute:function(){return[a[0],a[1]]},getCurrentLocation:function(){return[a[0],a[1]]},getOrientation:function(){return b},getCssClass:function(){return c}};return l({dropOptions:g.dropOptions,anchor:d,source:this.element,paintStyle:this.getPaintStyle(),endpoint:g.hideOnDrag?"Blank":this.endpoint,_transient:!0,scope:this.scope})},this.connectorSelector=function(){var a=this.connections[0];return this.isTarget&&a?a:this.connections.length<this._jsPlumb.maxConnections||-1==this._jsPlumb.maxConnections?null:a},this.setStyle=this.setPaintStyle,this.paint=function(a){a=a||{};var b=a.timestamp,c=!(a.recalc===!1);if(!b||this.timestamp!==b){var d=h.updateOffset({elId:this.elementId,timestamp:b}),f=a.offs
 et?a.offset.o:d.o;if(null!=f){var g=a.anchorPoint,i=a.connectorPaintStyle;if(null==g){var j=a.dimensions||d.s,k={xy:[f.left,f.top],wh:j,element:this,timestamp:b};if(c&&this.anchor.isDynamic&&this.connections.length>0){var l=e(this,a.elementWithPrecedence),m=l.endpoints[0]==this?1:0,n=0===m?l.sourceId:l.targetId,o=h.getCachedData(n),p=o.o,q=o.s;k.txy=[p.left,p.top],k.twh=q,k.tElement=l.endpoints[m]}g=this.anchor.compute(k)}this.endpoint.compute(g,this.anchor.getOrientation(this),this._jsPlumb.paintStyleInUse,i||this.paintStyleInUse),this.endpoint.paint(this._jsPlumb.paintStyleInUse,this.anchor),this.timestamp=b;for(var r=0;r<this._jsPlumb.overlays.length;r++){var s=this._jsPlumb.overlays[r];s.isVisible()&&(this._jsPlumb.overlayPlacements[r]=s.draw(this.endpoint,this._jsPlumb.paintStyleInUse),s.paint(this._jsPlumb.overlayPlacements[r]))}}}},this.repain

<TRUNCATED>

Mime
View raw message