From c0e97315bd8bd079ead472e11a0ea96984eff0e5 Mon Sep 17 00:00:00 2001 From: Ajai Date: Sun, 2 Jul 2017 14:44:19 -0700 Subject: [PATCH] Removes instances attached to window object + bumps version in package.json --- dag.js | 1 - dist/react-dag.js | 14 +++++++------- package.json | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/dag.js b/dag.js index 3d2614c..4a1db5f 100644 --- a/dag.js +++ b/dag.js @@ -81,7 +81,6 @@ export default class DAG extends Component { let container = document.querySelector(`#${this.state.componentId} #dag-container`); jsPlumb.setContainer(container); this.instance = jsPlumb.getInstance(dagSettings); - window.plumbInstance = this.instance; this.instance.bind('connection', this.makeConnections.bind(this)); this.instance.bind('connectionDetached', this.makeConnections.bind(this)); }); diff --git a/dist/react-dag.js b/dist/react-dag.js index c6cb6f9..394d26d 100644 --- a/dist/react-dag.js +++ b/dist/react-dag.js @@ -1,9 +1,9 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.reactDag=e(require("react")):t.reactDag=e(t.React)}(this,function(t){return function(t){function e(i){if(n[i])return n[i].exports;var o=n[i]={exports:{},id:i,loaded:!1};return t[i].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function o(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|t}function v(e){return+e!=e&&(e=0),t.alloc(+e)}function m(e,n){if(t.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var i=e.length;if(0===i)return 0;for(var o=!1;;)switch(n){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return X(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return q(e).length;default:if(o)return X(e).length;n=(""+n).toLowerCase(),o=!0}}function y(t,e,n){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,e>>>=0,n<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return T(this,e,n);case"utf8":case"utf-8":return A(this,e,n);case"ascii":return O(this,e,n);case"latin1":case"binary":return k(this,e,n);case"base64":return D(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,n);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function b(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function _(e,n,i,o,r){if(0===e.length)return-1;if("string"==typeof i?(o=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=r?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(r)return-1;i=e.length-1}else if(i<0){if(!r)return-1;i=0}if("string"==typeof n&&(n=t.from(n,o)),t.isBuffer(n))return 0===n.length?-1:P(e,n,i,o,r);if("number"==typeof n)return n=255&n,t.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,n,i):Uint8Array.prototype.lastIndexOf.call(e,n,i):P(e,[n],i,o,r);throw new TypeError("val must be string, number or Buffer")}function P(t,e,n,i,o){function r(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}var s=1,a=t.length,u=e.length;if(void 0!==i&&(i=String(i).toLowerCase(),"ucs2"===i||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,n/=2}var l;if(o){var c=-1;for(l=n;la&&(n=a-u),l=n;l>=0;l--){for(var h=!0,d=0;do&&(i=o)):i=o;var r=e.length;if(r%2!==0)throw new TypeError("Invalid hex string");i>r/2&&(i=r/2);for(var s=0;s239?4:r>223?3:r>191?2:1;if(o+a<=n){var u,l,c,h;switch(a){case 1:r<128&&(s=r);break;case 2:u=t[o+1],128===(192&u)&&(h=(31&r)<<6|63&u,h>127&&(s=h));break;case 3:u=t[o+1],l=t[o+2],128===(192&u)&&128===(192&l)&&(h=(15&r)<<12|(63&u)<<6|63&l,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:u=t[o+1],l=t[o+2],c=t[o+3],128===(192&u)&&128===(192&l)&&128===(192&c)&&(h=(15&r)<<18|(63&u)<<12|(63&l)<<6|63&c,h>65535&&h<1114112&&(s=h))}}null===s?(s=65533,a=1):s>65535&&(s-=65536,i.push(s>>>10&1023|55296),s=56320|1023&s),i.push(s),o+=a}return I(i)}function I(t){var e=t.length;if(e<=tt)return String.fromCharCode.apply(String,t);for(var n="",i=0;ii)&&(n=i);for(var o="",r=e;rn)throw new RangeError("Trying to access beyond buffer length")}function R(e,n,i,o,r,s){if(!t.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>r||ne.length)throw new RangeError("Index out of range")}function N(t,e,n,i){e<0&&(e=65535+e+1);for(var o=0,r=Math.min(t.length-n,2);o>>8*(i?o:1-o)}function B(t,e,n,i){e<0&&(e=4294967295+e+1);for(var o=0,r=Math.min(t.length-n,4);o>>8*(i?o:3-o)&255}function U(t,e,n,i,o,r){if(n+i>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function F(t,e,n,i,o){return o||U(t,e,n,4,3.4028234663852886e38,-3.4028234663852886e38),$.write(t,e,n,i,23,4),n+4}function G(t,e,n,i,o){return o||U(t,e,n,8,1.7976931348623157e308,-1.7976931348623157e308),$.write(t,e,n,i,52,8),n+8}function Y(t){if(t=z(t).replace(et,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function z(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function H(t){return t<16?"0"+t.toString(16):t.toString(16)}function X(t,e){e=e||1/0;for(var n,i=t.length,o=null,r=[],s=0;s55295&&n<57344){if(!o){if(n>56319){(e-=3)>-1&&r.push(239,191,189);continue}if(s+1===i){(e-=3)>-1&&r.push(239,191,189);continue}o=n;continue}if(n<56320){(e-=3)>-1&&r.push(239,191,189),o=n;continue}n=(o-55296<<10|n-56320)+65536}else o&&(e-=3)>-1&&r.push(239,191,189);if(o=null,n<128){if((e-=1)<0)break;r.push(n)}else if(n<2048){if((e-=2)<0)break;r.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;r.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;r.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return r}function W(t){for(var e=[],n=0;n>8,o=n%256,r.push(o),r.push(i);return r}function q(t){return K.toByteArray(Y(t))}function J(t,e,n,i){for(var o=0;o=e.length||o>=t.length);++o)e[o+n]=t[o];return o}function Z(t){return t!==t}var K=n(28),$=n(37),Q=n(38);e.Buffer=t,e.SlowBuffer=v,e.INSPECT_MAX_BYTES=50,t.TYPED_ARRAY_SUPPORT=void 0!==i.TYPED_ARRAY_SUPPORT?i.TYPED_ARRAY_SUPPORT:o(),e.kMaxLength=r(),t.poolSize=8192,t._augment=function(e){return e.__proto__=t.prototype,e},t.from=function(t,e,n){return a(null,t,e,n)},t.TYPED_ARRAY_SUPPORT&&(t.prototype.__proto__=Uint8Array.prototype,t.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&t[Symbol.species]===t&&Object.defineProperty(t,Symbol.species,{value:null,configurable:!0})),t.alloc=function(t,e,n){return l(null,t,e,n)},t.allocUnsafe=function(t){return c(null,t)},t.allocUnsafeSlow=function(t){return c(null,t)},t.isBuffer=function(t){return!(null==t||!t._isBuffer)},t.compare=function(e,n){if(!t.isBuffer(e)||!t.isBuffer(n))throw new TypeError("Arguments must be Buffers");if(e===n)return 0;for(var i=e.length,o=n.length,r=0,s=Math.min(i,o);r0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),""},t.prototype.compare=function(e,n,i,o,r){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===n&&(n=0),void 0===i&&(i=e?e.length:0),void 0===o&&(o=0),void 0===r&&(r=this.length),n<0||i>e.length||o<0||r>this.length)throw new RangeError("out of range index");if(o>=r&&n>=i)return 0;if(o>=r)return-1;if(n>=i)return 1;if(n>>>=0,i>>>=0,o>>>=0,r>>>=0,this===e)return 0;for(var s=r-o,a=i-n,u=Math.min(s,a),l=this.slice(o,r),c=e.slice(n,i),h=0;ho)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var r=!1;;)switch(i){case"hex":return E(this,t,e,n);case"utf8":case"utf-8":return x(this,t,e,n);case"ascii":return C(this,t,e,n);case"latin1":case"binary":return w(this,t,e,n);case"base64":return j(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,n);default:if(r)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),r=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var tt=4096;t.prototype.slice=function(e,n){var i=this.length;e=~~e,n=void 0===n?i:~~n,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),n<0?(n+=i,n<0&&(n=0)):n>i&&(n=i),n0&&(o*=256);)i+=this[t+--e]*o;return i},t.prototype.readUInt8=function(t,e){return e||L(t,1,this.length),this[t]},t.prototype.readUInt16LE=function(t,e){return e||L(t,2,this.length),this[t]|this[t+1]<<8},t.prototype.readUInt16BE=function(t,e){return e||L(t,2,this.length),this[t]<<8|this[t+1]},t.prototype.readUInt32LE=function(t,e){return e||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},t.prototype.readUInt32BE=function(t,e){return e||L(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},t.prototype.readIntLE=function(t,e,n){t=0|t,e=0|e,n||L(t,e,this.length);for(var i=this[t],o=1,r=0;++r=o&&(i-=Math.pow(2,8*e)),i},t.prototype.readIntBE=function(t,e,n){t=0|t,e=0|e,n||L(t,e,this.length);for(var i=e,o=1,r=this[t+--i];i>0&&(o*=256);)r+=this[t+--i]*o;return o*=128,r>=o&&(r-=Math.pow(2,8*e)),r},t.prototype.readInt8=function(t,e){return e||L(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},t.prototype.readInt16LE=function(t,e){e||L(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},t.prototype.readInt16BE=function(t,e){e||L(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},t.prototype.readInt32LE=function(t,e){return e||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},t.prototype.readInt32BE=function(t,e){return e||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},t.prototype.readFloatLE=function(t,e){return e||L(t,4,this.length),$.read(this,t,!0,23,4)},t.prototype.readFloatBE=function(t,e){return e||L(t,4,this.length),$.read(this,t,!1,23,4)},t.prototype.readDoubleLE=function(t,e){return e||L(t,8,this.length),$.read(this,t,!0,52,8)},t.prototype.readDoubleBE=function(t,e){return e||L(t,8,this.length),$.read(this,t,!1,52,8)},t.prototype.writeUIntLE=function(t,e,n,i){if(t=+t,e=0|e,n=0|n,!i){var o=Math.pow(2,8*n)-1;R(this,t,e,n,o,0)}var r=1,s=0;for(this[e]=255&t;++s=0&&(s*=256);)this[e+r]=t/s&255;return e+n},t.prototype.writeUInt8=function(e,n,i){return e=+e,n=0|n,i||R(this,e,n,1,255,0),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[n]=255&e,n+1},t.prototype.writeUInt16LE=function(e,n,i){return e=+e,n=0|n,i||R(this,e,n,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[n]=255&e,this[n+1]=e>>>8):N(this,e,n,!0),n+2},t.prototype.writeUInt16BE=function(e,n,i){return e=+e,n=0|n,i||R(this,e,n,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[n]=e>>>8,this[n+1]=255&e):N(this,e,n,!1),n+2},t.prototype.writeUInt32LE=function(e,n,i){return e=+e,n=0|n,i||R(this,e,n,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[n+3]=e>>>24,this[n+2]=e>>>16,this[n+1]=e>>>8,this[n]=255&e):B(this,e,n,!0),n+4},t.prototype.writeUInt32BE=function(e,n,i){return e=+e,n=0|n,i||R(this,e,n,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[n]=e>>>24,this[n+1]=e>>>16,this[n+2]=e>>>8,this[n+3]=255&e):B(this,e,n,!1),n+4},t.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e=0|e,!i){var o=Math.pow(2,8*n-1);R(this,t,e,n,o-1,-o)}var r=0,s=1,a=0;for(this[e]=255&t;++r>0)-a&255;return e+n},t.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e=0|e,!i){var o=Math.pow(2,8*n-1);R(this,t,e,n,o-1,-o)}var r=n-1,s=1,a=0;for(this[e+r]=255&t;--r>=0&&(s*=256);)t<0&&0===a&&0!==this[e+r+1]&&(a=1),this[e+r]=(t/s>>0)-a&255;return e+n},t.prototype.writeInt8=function(e,n,i){return e=+e,n=0|n,i||R(this,e,n,1,127,-128),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[n]=255&e,n+1},t.prototype.writeInt16LE=function(e,n,i){return e=+e,n=0|n,i||R(this,e,n,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[n]=255&e,this[n+1]=e>>>8):N(this,e,n,!0),n+2},t.prototype.writeInt16BE=function(e,n,i){return e=+e,n=0|n,i||R(this,e,n,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[n]=e>>>8,this[n+1]=255&e):N(this,e,n,!1),n+2},t.prototype.writeInt32LE=function(e,n,i){return e=+e,n=0|n,i||R(this,e,n,4,2147483647,-2147483648),t.TYPED_ARRAY_SUPPORT?(this[n]=255&e,this[n+1]=e>>>8,this[n+2]=e>>>16,this[n+3]=e>>>24):B(this,e,n,!0),n+4},t.prototype.writeInt32BE=function(e,n,i){return e=+e,n=0|n,i||R(this,e,n,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),t.TYPED_ARRAY_SUPPORT?(this[n]=e>>>24,this[n+1]=e>>>16,this[n+2]=e>>>8,this[n+3]=255&e):B(this,e,n,!1),n+4},t.prototype.writeFloatLE=function(t,e,n){return F(this,t,e,!0,n)},t.prototype.writeFloatBE=function(t,e,n){return F(this,t,e,!1,n)},t.prototype.writeDoubleLE=function(t,e,n){return G(this,t,e,!0,n)},t.prototype.writeDoubleBE=function(t,e,n){return G(this,t,e,!1,n)},t.prototype.copy=function(e,n,i,o){if(i||(i=0),o||0===o||(o=this.length),n>=e.length&&(n=e.length),n||(n=0),o>0&&o=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),e.length-n=0;--r)e[r+n]=this[r+i];else if(s<1e3||!t.TYPED_ARRAY_SUPPORT)for(r=0;r>>=0,i=void 0===i?this.length:i>>>0,e||(e=0);var s;if("number"==typeof e)for(s=n;s>>((3&e)<<3)&255;return i},"undefined"!=typeof console&&console.warn&&console.warn("[SECURITY] node-uuid: crypto not usable, falling back to insecure Math.random()")}}function a(){try{var t=n(31).randomBytes;p=d=t&&function(){return t(16)},d()}catch(e){}}function u(t,e,n){var i=e&&n||0,o=0;for(e=e||[],t.toLowerCase().replace(/[0-9a-f]{2}/g,function(t){o<16&&(e[i+o++]=y[t])});o<16;)e[i+o++]=0;return e}function l(t,e){var n=e||0,i=m;return i[t[n++]]+i[t[n++]]+i[t[n++]]+i[t[n++]]+"-"+i[t[n++]]+i[t[n++]]+"-"+i[t[n++]]+i[t[n++]]+"-"+i[t[n++]]+i[t[n++]]+"-"+i[t[n++]]+i[t[n++]]+i[t[n++]]+i[t[n++]]+i[t[n++]]+i[t[n++]]}function c(t,e,n){var i=e&&n||0,o=e||[];t=t||{};var r=null!=t.clockseq?t.clockseq:E,s=null!=t.msecs?t.msecs:(new Date).getTime(),a=null!=t.nsecs?t.nsecs:C+1,u=s-x+(a-C)/1e4;if(u<0&&null==t.clockseq&&(r=r+1&16383),(u<0||s>x)&&null==t.nsecs&&(a=0),a>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");x=s,C=a,E=r,s+=122192928e5;var c=(1e4*(268435455&s)+a)%4294967296;o[i++]=c>>>24&255,o[i++]=c>>>16&255,o[i++]=c>>>8&255,o[i++]=255&c;var h=s/4294967296*1e4&268435455;o[i++]=h>>>8&255,o[i++]=255&h,o[i++]=h>>>24&15|16,o[i++]=h>>>16&255,o[i++]=r>>>8|128,o[i++]=255&r;for(var d=t.node||P,f=0;f<6;f++)o[i+f]=d[f];return e?e:l(o)}function h(t,e,n){var i=e&&n||0;"string"==typeof t&&(e="binary"===t?new v(16):null,t=null),t=t||{};var o=t.random||(t.rng||d)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e)for(var r=0;r<16;r++)e[i+r]=o[r];return e||l(o)}var d,f,p,g;r?s():a();for(var v="function"==typeof o?o:Array,m=[],y={},b=0;b<256;b++)m[b]=(b+256).toString(16).substr(1),y[m[b]]=b;var _=d(),P=[1|_[0],_[1],_[2],_[3],_[4],_[5]],E=16383&(_[6]<<8|_[7]),x=0,C=0,w=h;w.v1=c,w.v4=h,w.parse=u,w.unparse=l,w.BufferClass=v,w._rng=d,w._mathRNG=f,w._nodeRNG=p,w._whatwgRNG=g,"undefined"!=typeof t&&t.exports?t.exports=w:(i=function(){return w}.call(e,n,e,t),!(void 0!==i&&(t.exports=i)))}("undefined"!=typeof window?window:null)}).call(e,n(1).Buffer)},function(t,e){function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function o(t){if(c===setTimeout)return setTimeout(t,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(t,0);try{return c(t,0)}catch(e){try{return c.call(null,t,0)}catch(e){return c.call(this,t,0)}}}function r(t){if(h===clearTimeout)return clearTimeout(t);if((h===i||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(t);try{return h(t)}catch(e){try{return h.call(null,t)}catch(e){return h.call(this,t)}}}function s(){g&&f&&(g=!1,f.length?p=f.concat(p):v=-1,p.length&&a())}function a(){if(!g){var t=o(s);g=!0;for(var e=p.length;e;){for(f=p,p=[];++v1)for(var n=1;n=3&&(i.depth=arguments[2]),arguments.length>=4&&(i.colors=arguments[3]),g(n)?i.showHidden=n:n&&e._extend(i,n),P(i.showHidden)&&(i.showHidden=!1),P(i.depth)&&(i.depth=2),P(i.colors)&&(i.colors=!1),P(i.customInspect)&&(i.customInspect=!0),i.colors&&(i.stylize=r),u(i,t,i.depth)}function r(t,e){var n=o.styles[e];return n?"["+o.colors[n][0]+"m"+t+"["+o.colors[n][1]+"m":t}function s(t,e){return t}function a(t){var e={};return t.forEach(function(t,n){e[t]=!0}),e}function u(t,n,i){if(t.customInspect&&n&&j(n.inspect)&&n.inspect!==e.inspect&&(!n.constructor||n.constructor.prototype!==n)){var o=n.inspect(i,t);return b(o)||(o=u(t,o,i)),o}var r=l(t,n);if(r)return r;var s=Object.keys(n),g=a(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(n)),w(n)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return c(n);if(0===s.length){if(j(n)){var v=n.name?": "+n.name:"";return t.stylize("[Function"+v+"]","special")}if(E(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(C(n))return t.stylize(Date.prototype.toString.call(n),"date");if(w(n))return c(n); -}var m="",y=!1,_=["{","}"];if(p(n)&&(y=!0,_=["[","]"]),j(n)){var P=n.name?": "+n.name:"";m=" [Function"+P+"]"}if(E(n)&&(m=" "+RegExp.prototype.toString.call(n)),C(n)&&(m=" "+Date.prototype.toUTCString.call(n)),w(n)&&(m=" "+c(n)),0===s.length&&(!y||0==n.length))return _[0]+m+_[1];if(i<0)return E(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special");t.seen.push(n);var x;return x=y?h(t,n,i,g,s):s.map(function(e){return d(t,n,i,g,e,y)}),t.seen.pop(),f(x,m,_)}function l(t,e){if(P(e))return t.stylize("undefined","undefined");if(b(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}return y(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):v(e)?t.stylize("null","null"):void 0}function c(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,n,i,o){for(var r=[],s=0,a=e.length;s-1&&(a=r?a.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+a.split("\n").map(function(t){return" "+t}).join("\n"))):a=t.stylize("[Circular]","special")),P(s)){if(r&&o.match(/^\d+$/))return a;s=JSON.stringify(""+o),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function f(t,e,n){var i=0,o=t.reduce(function(t,e){return i++,e.indexOf("\n")>=0&&i++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return o>60?n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1]:n[0]+e+" "+t.join(", ")+" "+n[1]}function p(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function v(t){return null===t}function m(t){return null==t}function y(t){return"number"==typeof t}function b(t){return"string"==typeof t}function _(t){return"symbol"==typeof t}function P(t){return void 0===t}function E(t){return x(t)&&"[object RegExp]"===D(t)}function x(t){return"object"==typeof t&&null!==t}function C(t){return x(t)&&"[object Date]"===D(t)}function w(t){return x(t)&&("[object Error]"===D(t)||t instanceof Error)}function j(t){return"function"==typeof t}function S(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function D(t){return Object.prototype.toString.call(t)}function A(t){return t<10?"0"+t.toString(10):t.toString(10)}function I(){var t=new Date,e=[A(t.getHours()),A(t.getMinutes()),A(t.getSeconds())].join(":");return[t.getDate(),L[t.getMonth()],e].join(" ")}function O(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var k=/%[sdj%]/g;e.format=function(t){if(!b(t)){for(var e=[],n=0;n=r)return t;switch(t){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":try{return JSON.stringify(i[n++])}catch(e){return"[Circular]"}default:return t}}),a=i[n];n=0&&b.splice(e,1)}function a(t){var e=document.createElement("style");return e.type="text/css",r(t,e),e}function u(t){var e=document.createElement("link");return e.rel="stylesheet",r(t,e),e}function l(t,e){var n,i,o;if(e.singleton){var r=y++;n=m||(m=a(e)),i=c.bind(null,n,r,!1),o=c.bind(null,n,r,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=u(e),i=d.bind(null,n),o=function(){s(n),n.href&&URL.revokeObjectURL(n.href)}):(n=a(e),i=h.bind(null,n),o=function(){s(n)});return i(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;i(t=e)}else o()}}function c(t,e,n,i){var o=n?"":i.css;if(t.styleSheet)t.styleSheet.cssText=_(e,o);else{var r=document.createTextNode(o),s=t.childNodes;s[e]&&t.removeChild(s[e]),s.length?t.insertBefore(r,s[e]):t.appendChild(r)}}function h(t,e){var n=e.css,i=e.media;if(i&&t.setAttribute("media",i),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}function d(t,e){var n=e.css,i=e.sourceMap;i&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var o=new Blob([n],{type:"text/css"}),r=t.href;t.href=URL.createObjectURL(o),r&&URL.revokeObjectURL(r)}var f={},p=function(t){var e;return function(){return"undefined"==typeof e&&(e=t.apply(this,arguments)),e}},g=p(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),v=p(function(){return document.head||document.getElementsByTagName("head")[0]}),m=null,y=0,b=[];t.exports=function(t,e){e=e||{},"undefined"==typeof e.singleton&&(e.singleton=g()),"undefined"==typeof e.insertAt&&(e.insertAt="bottom");var n=o(t);return i(n,e),function(t){for(var r=[],s=0;s0&&void 0!==arguments[0]&&arguments[0],e={transformSource:{},transformSink:{}};return e=t?{"default":l,commonSettings:(0,s["default"])(f,d),source:(0,s["default"])(p,d),sink:(0,s["default"])(g,d),transformSource:{},transformSink:{}}:{"default":l,commonSettings:(0,s["default"])(f,h),source:(0,s["default"])(p,h),sink:(0,s["default"])(g,h),transformSource:{},transformSink:{}},e.transformSource=(0,u["default"])(e.source),e.transformSink=(0,u["default"])(e.sink),e.transformSource.anchor=[.5,1,1,0,26,-43,"transformAnchor"],e.transformSink.anchor=[.5,1,-1,0,-26,-43,"transformAnchor"],e}Object.defineProperty(e,"__esModule",{value:!0}),e.sinkSettings=e.sourceSettings=e.commonSettings=e.disabledConnectorOverlays=e.connectorOverlays=e.connectorStyle=e.defaultSettings=void 0,e.getSettings=o;var r=n(72),s=i(r),a=n(71),u=i(a),l=e.defaultSettings={Connector:["Flowchart",{gap:6,stub:[10,15],alwaysRespectStubs:!0}],ConnectionsDetachable:!0},c=e.connectorStyle={stroke:"black",strokeWidth:2,radius:5,lineWidth:2},h=e.connectorOverlays={connectorOverlays:[["Arrow",{location:1,length:12,width:12,height:10,foldback:1}]]},d=e.disabledConnectorOverlays={connectorOverlays:[["Arrow",{location:1,length:12,width:12,height:10,foldback:1}]]},f=e.commonSettings={endpoint:"Dot",maxConnections:-1,paintStyle:{stroke:"black",fill:"black",radius:5,lineWidth:3},anchors:["Static"]},p=e.sourceSettings=(0,s["default"])({isSource:!0,connectorStyle:c,anchor:[.5,1,1,0,26,-43,"sourceAnchor"]},f),g=e.sinkSettings=(0,s["default"])({isTarget:!0,anchor:[.5,1,-1,0,-26,-43,"sinkAnchor"],connectorStyle:c},f)},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function o(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e2&&void 0!==arguments[2]?arguments[2]:[],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=(0,s.createStore)(p(e),t,s.compose.apply(null,[s.applyMiddleware.apply(null,n)].concat(i.map(function(t){return t()}))));return o}Object.defineProperty(e,"__esModule",{value:!0}),e.STOREACTIONS=void 0,e["default"]=r;var s=n(83),a=n(5),u=i(a),l={ADDNODE:"ADD_NODE",UPDATENODE:"UPDATE_NODE",REMOVENODE:"REMOVE_NODE",ADDCONNECTION:"ADD_CONNECTIONS",SETCONNECTIONS:"SET_CONNECTIONS",RESET:"RESET",GRAPHLOADING:"GRAPHLOADING"};e.STOREACTIONS=l;var c=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(e.type){case l.ADDNODE:return[].concat(o(t),[{id:u["default"].v4(),label:e.payload.label,type:e.payload.type}]);case l.UPDATENODE:return t.map(function(t){return t.id===e.payload.nodeId?(t.style=e.payload.style,t):t});case l.REMOVENODE:return t.filter(function(t){return t.id!==e.payload.nodeId});case l.RESET:return[];default:return t}},h=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(e.type){case l.ADDCONNECTION:return[].concat(o(t),[{from:e.connection.from,to:e.connection.to}]);case l.SETCONNECTIONS:return[].concat(o(e.payload.connections));case l.RESET:return[];default:return t}},d=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(e.type){case l.GRAPHLOADING:return Object.assign({},t,{loading:e.payload.loading});case l.RESET:return{};default:return t}},f=function(){return{nodes:[function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t}],graph:[function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t}],connections:[function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t}]}},p=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f(),e=f(),n=function(t,e,n){return Array.isArray(t[e])&&t[e].length>0?t[e]:n[e]},i=[c].concat(n(t,"nodes",e)),o=[d].concat(n(t,"graph",e)),r=[h].concat(n(t,"connections",e)),a=function(t,e,n){return t.length>1?t.reduce(function(t,i){return i.bind(null,t(e,n),n)})():t[0]()};return(0,s.combineReducers)({nodes:function(t,e){return a(i,t,e)},connections:function(t,e){return a(r,t,e)},graph:function(t,e){return a(o,t,e)}})}},function(t,e){"use strict";function n(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function i(t){return 3*t.length/4-n(t)}function o(t){var e,i,o,r,s,a,u=t.length;s=n(t),a=new c(3*u/4-s),o=s>0?u-4:u;var h=0;for(e=0,i=0;e>16&255,a[h++]=r>>8&255,a[h++]=255&r;return 2===s?(r=l[t.charCodeAt(e)]<<2|l[t.charCodeAt(e+1)]>>4,a[h++]=255&r):1===s&&(r=l[t.charCodeAt(e)]<<10|l[t.charCodeAt(e+1)]<<4|l[t.charCodeAt(e+2)]>>2,a[h++]=r>>8&255,a[h++]=255&r),a}function r(t){return u[t>>18&63]+u[t>>12&63]+u[t>>6&63]+u[63&t]}function s(t,e,n){for(var i,o=[],s=e;sc?c:l+a));return 1===i?(e=t[n-1],o+=u[e>>2],o+=u[e<<4&63],o+="=="):2===i&&(e=(t[n-2]<<8)+t[n-1],o+=u[e>>10],o+=u[e>>4&63],o+=u[e<<2&63],o+="="),r.push(o),r.join("")}e.byteLength=i,e.toByteArray=o,e.fromByteArray=a;for(var u=[],l=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,f=h.length;ds?n=o(t).update(n).digest():n.length>5]|=128<>>9<<4)+14]=e;for(var n=1732584193,i=-271733879,o=-1732584194,c=271733878,h=0;h>16)+(e>>16)+(n>>16);return i<<16|65535&n}function c(t,e){return t<>>32-e}var h=n(30);t.exports=function(t){return h.hash(t,i,16)}},function(t,e,n){var i=n(79);t.exports=function(t,e){e=e||{};var n=i(t);return e.pbkdf2=n.pbkdf2,e.pbkdf2Sync=n.pbkdf2Sync,e}},function(t,e,n){(function(e,i){!function(){var o=("undefined"==typeof window?e:window)||{};_crypto=o.crypto||o.msCrypto||n(97),t.exports=function(t){if(_crypto.getRandomValues){var e=new i(t);return _crypto.getRandomValues(e),e}if(_crypto.randomBytes)return _crypto.randomBytes(t);throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}}()}).call(e,function(){return this}(),n(1).Buffer)},function(t,e,n){e=t.exports=n(11)(),e.push([t.id,".node .dag-node{position:relative}.node .dag-node .close-btn{cursor:pointer;position:absolute;top:-3px;right:3px}",""])},function(t,e,n){e=t.exports=n(11)(),e.push([t.id,".react-dag{display:block}.react-dag .jtk-endpoint svg{overflow:visible}.react-dag .jtk-endpoint circle{fill:#fff;r:2px;stroke-width:8px}.react-dag .jtk-endpoint-anchor-sourceAnchor circle{stroke:green}.react-dag .jtk-endpoint-anchor-transformAnchor circle{stroke:purple}.react-dag .jtk-endpoint-anchor-sinkAnchor circle{stroke:orange}.react-dag .diagram-container{position:relative;width:100%;height:80vh;background:#eee;overflow:hidden}.react-dag .diagram-container #dag-container{height:inherit;width:inherit;position:absolute;transform-origin:left center}.react-dag .diagram-container #dag-container .node{position:absolute;height:66px;width:105px;cursor:pointer}.react-dag .diagram-container #dag-container .node .dag-node{margin:0 auto;background-clip:border-box;height:46px;width:56px;border-radius:5px}.react-dag .diagram-container #dag-container .node .dag-node.source{border:2px solid green}.react-dag .diagram-container #dag-container .node .dag-node.source~.label{color:green}.react-dag .diagram-container #dag-container .node .dag-node.transform{border:2px solid purple}.react-dag .diagram-container #dag-container .node .dag-node.transform~.label{color:purple}.react-dag .diagram-container #dag-container .node .dag-node.sink{border:2px solid orange}.react-dag .diagram-container #dag-container .node .dag-node.sink~.label{color:orange}.react-dag .diagram-container #dag-container .node .label{font-size:12px}.react-dag .fa.fa-spin.fa-refresh{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}",""])},function(t,e){e.read=function(t,e,n,i,o){var r,s,a=8*o-i-1,u=(1<>1,c=-7,h=n?o-1:0,d=n?-1:1,f=t[e+h];for(h+=d,r=f&(1<<-c)-1,f>>=-c,c+=a;c>0;r=256*r+t[e+h],h+=d,c-=8);for(s=r&(1<<-c)-1,r>>=-c,c+=i;c>0;s=256*s+t[e+h],h+=d,c-=8);if(0===r)r=1-l;else{if(r===u)return s?NaN:(f?-1:1)*(1/0);s+=Math.pow(2,i),r-=l}return(f?-1:1)*s*Math.pow(2,r-i)},e.write=function(t,e,n,i,o,r){var s,a,u,l=8*r-o-1,c=(1<>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:r-1,p=i?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),e+=s+h>=1?d/u:d*Math.pow(2,1-h),e*u>=2&&(s++,u/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(e*u-1)*Math.pow(2,o),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,o),s=0));o>=8;t[n+f]=255&a,f+=p,a/=256,o-=8);for(s=s<0;t[n+f]=255&s,f+=p,s/=256,l-=8);t[n+f-p]|=128*g}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){var i,o;(function(){"undefined"==typeof Math.sgn&&(Math.sgn=function(t){return 0==t?0:t>0?1:-1});var t={subtract:function(t,e){return{x:t.x-e.x,y:t.y-e.y}},dotProduct:function(t,e){return t.x*e.x+t.y*e.y},square:function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},scale:function(t,e){return{x:t.x*e,y:t.y*e}}},e=64,n=Math.pow(2,-e-1),i=function(e,n){for(var i=[],o=r(e,n),a=n.length-1,u=2*a-1,l=s(o,u,i,0),h=t.subtract(e,n[0]),d=t.square(h),f=0,p=0;p=e)return i[0]=(t[0].x+t[n].x)/2,1;if(u(t,n))return i[0]=l(t,n),1}c(t,n,.5,d,f),r=s(d,n,p,o+1),h=s(f,n,g,o+1); -for(var v=0;vb?b=P:P0?1:-1,a=null;o1&&(i.location=1),i.location<0&&(i.location=0),_(t,i.location)},E=function(t,e,n,i){i=null==i?0:i;var o=v(t,e,i),r=_(t,o.location),s=Math.atan(-1/r),a=n/2*Math.sin(s),u=n/2*Math.cos(s);return[{x:o.point.x+u,y:o.point.y+a},{x:o.point.x-u,y:o.point.y-a}]};this.jsBezier={distanceFromCurve:i,gradientAtPoint:_,gradientAtPointAlongCurveFrom:P,nearestPointOnCurve:o,pointOnCurve:f,pointAlongCurveFrom:y,perpendicularToCurveAt:E,locationAlongCurveFrom:b,getLength:m}}).call("undefined"!=typeof window?window:this),function(){"use strict";var t=this,e=t.Biltong={},n=function(t){return"[object Array]"===Object.prototype.toString.call(t)},i=function(t,e,i){return t=n(t)?t:[t.x,t.y],e=n(e)?e:[e.x,e.y],i(t,e)},o=e.gradient=function(t,e){return i(t,e,function(t,e){return e[0]==t[0]?e[1]>t[1]?1/0:-(1/0):e[1]==t[1]?e[0]>t[0]?0:-0:(e[1]-t[1])/(e[0]-t[0])})},r=(e.normal=function(t,e){return-1/o(t,e)},e.lineLength=function(t,e){return i(t,e,function(t,e){return Math.sqrt(Math.pow(e[1]-t[1],2)+Math.pow(e[0]-t[0],2))})},e.quadrant=function(t,e){return i(t,e,function(t,e){return e[0]>t[0]?e[1]>t[1]?2:1:e[0]==t[0]?e[1]>t[1]?2:1:e[1]>t[1]?3:4})}),s=(e.theta=function(t,e){return i(t,e,function(t,e){var n=o(t,e),i=Math.atan(n),s=r(t,e);return 4!=s&&3!=s||(i+=Math.PI),i<0&&(i+=2*Math.PI),i})},e.intersects=function(t,e){var n=t.x,i=t.x+t.w,o=t.y,r=t.y+t.h,s=e.x,a=e.x+e.w,u=e.y,l=e.y+e.h;return n<=s&&s<=i&&o<=u&&u<=r||n<=a&&a<=i&&o<=u&&u<=r||n<=s&&s<=i&&o<=l&&l<=r||n<=a&&s<=i&&o<=l&&l<=r||s<=n&&n<=a&&u<=o&&o<=l||s<=i&&i<=a&&u<=o&&o<=l||s<=n&&n<=a&&u<=r&&r<=l||s<=i&&n<=a&&u<=r&&r<=l},e.encloses=function(t,e,n){var i=t.x,o=t.x+t.w,r=t.y,s=t.y+t.h,a=e.x,u=e.x+e.w,l=e.y,c=e.y+e.h,h=function(t,e,i,o){return n?t<=e&&i>=o:to};return h(i,a,o,u)&&h(r,l,s,c)},[null,[1,-1],[1,1],[-1,1],[-1,-1]]),a=[null,[-1,-1],[-1,1],[1,1],[1,-1]];e.pointOnLine=function(t,e,n){var i=o(t,e),u=r(t,e),l=n>0?s[u]:a[u],c=Math.atan(i),h=Math.abs(n*Math.sin(c))*l[1],d=Math.abs(n*Math.cos(c))*l[0];return{x:t.x+d,y:t.y+h}},e.perpendicularLineTo=function(t,e,n){var i=o(t,e),r=Math.atan(-1/i),s=n/2*Math.sin(r),a=n/2*Math.cos(r);return[{x:e.x+a,y:e.y+s},{x:e.x-a,y:e.y-s}]}}.call("undefined"!=typeof window?window:this),function(){"use strict";var t=this,e={android:navigator.userAgent.toLowerCase().indexOf("android")>-1},n=function(t,e,n){n=n||t.parentNode;for(var i=n.querySelectorAll(e),o=0;o-1&&P<9,x=function(t,e){if(null==t)return[0,0];var n=D(t),i=S(n,0);return[i[e+"X"],i[e+"Y"]]},C=function(t){return null==t?[0,0]:E?[t.clientX+document.documentElement.scrollLeft,t.clientY+document.documentElement.scrollTop]:x(t,"page")},w=function(t){return x(t,"screen")},j=function(t){return x(t,"client")},S=function(t,e){return t.item?t.item(e):t[e]},D=function(t){return t.touches&&t.touches.length>0?t.touches:t.changedTouches&&t.changedTouches.length>0?t.changedTouches:t.targetTouches&&t.targetTouches.length>0?t.targetTouches:[t]},A=function(t){return D(t).length},I=function(t,e,n,i){if(u(t,e,n),i.__tauid=n.__tauid,t.addEventListener)t.addEventListener(e,n,!1);else if(t.attachEvent){var o=e+n.__tauid;t["e"+o]=n,t[o]=function(){t["e"+o]&&t["e"+o](window.event)},t.attachEvent("on"+e,t[o])}},O=function(t,e,n){null!=n&&k(t,function(){var o=i(this);if(l(o,e,n),null!=n.__tauid)if(o.removeEventListener)o.removeEventListener(e,n,!1),y&&_[e]&&o.removeEventListener(_[e],n,!1);else if(this.detachEvent){var r=e+n.__tauid;o[r]&&o.detachEvent("on"+e,o[r]),o[r]=null,o["e"+r]=null}n.__taTouchProxy&&O(t,n.__taTouchProxy[1],n.__taTouchProxy[0])})},k=function(t,e){if(null!=t){t="undefined"!=typeof Window&&"unknown"!=typeof t.top&&t==t.top?[t]:"string"!=typeof t&&null==t.tagName&&null!=t.length?t:"string"==typeof t?document.querySelectorAll(t):[t];for(var n=0;n-1&&a<9,h=9==a,d=function(t){if(c)return[t.clientX+document.documentElement.scrollLeft,t.clientY+document.documentElement.scrollTop];var e=p(t),n=f(e,0);return h?[n.pageX||n.clientX,n.pageY||n.clientY]:[n.pageX,n.pageY]},f=function(t,e){return t.item?t.item(e):t[e]},p=function(t){return t.touches&&t.touches.length>0?t.touches:t.changedTouches&&t.changedTouches.length>0?t.changedTouches:t.targetTouches&&t.targetTouches.length>0?t.targetTouches:[t]},g={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",ghostProxy:"katavorio-ghost-proxy"},v="katavorio-drag-scope",m=["stop","start","drag","drop","over","out","beforeStart"],y=function(){},b=function(){return!0},_=function(t,e,n){for(var i=0;i1)for(var r=0;r0&&V&&e.setPosition(this.el,V);for(var o=0;o0},c=(this.getMatchingDroppables=function(t){for(var e=[],n={},i=0;i=0&&r.splice(i,1),l(t[e],n)&&E(t[e],function(t){t.destroy()}),delete t[e]}};this.elementRemoved=function(t){this.destroyDraggable(t),this.destroyDroppable(t)},this.destroyDraggable=function(t){j(t,"_katavorioDrag",this._dragsByScope)},this.destroyDroppable=function(t){j(t,"_katavorioDrop",this._dropsByScope)},this.reset=function(){this._dragsByScope={},this._dropsByScope={},r=[],s={},S={}};var S={},D=function(t,n,i){var r=o(n)?n:n.id,s=!!o(n)||n.active!==!1,a=S[r]||function(){var t={name:r,members:[]};return S[r]=t,t}();return E(t,function(t){if(t._katavorioDrag){if(i&&null!=t._katavorioDrag.posseRoles[a.name])return;e(a.members,t._katavorioDrag),e(t._katavorioDrag.posses,a.name),t._katavorioDrag.posseRoles[a.name]=s}}),a};this.addToPosse=function(t,e){for(var n=[],i=1;i=r.length,u=function(){return o[s[1]]||function(){return o[s[1]]=[],o[s[1]]}()};if(a)s?u()[s[3]]=n:o[t]=n;else if(s){var l=u();o=l[s[3]]||function(){return l[s[3]]={},l[s[3]]}()}else o=o[t]||function(){return o[t]={},o[t]}()}),t}},functionChain:function(t,e,n){for(var i=0;i-1&&t.splice(n,1),n!=-1},remove:function(t,e){var n=t.indexOf(e);return n>-1&&t.splice(n,1),n!=-1},addWithFunction:function(t,e,n){c.jsPlumbUtil.findWithFunction(t,n)==-1&&t.push(e); -},addToList:function(t,e,n,i){var o=t[e];return null==o&&(o=[],t[e]=o),o[i?"unshift":"push"](n),o},suggest:function(t,e,n){return t.indexOf(e)===-1&&(n?t.unshift(e):t.push(e),!0)},extend:function(e,n,i){var o;for(n=t(n)?n:[n],o=0;o2)for(o=2;o0)for(var t=0;t0){var r=Array.prototype.slice.call(arguments,1);try{for(var s=0,u=i.length;s0?t.indexOf(e)!=-1:!n)};this.getConnections=function(t,n){t?t.constructor==String&&(t={scope:t}):t={};for(var i=t.scope||e.getDefaultScope(),o=st(i,!0),r=st(t.source),s=st(t.target),a=!n&&o.length>1?{}:[],u=function(t,e){if(!n&&o.length>1){var i=a[t];null==i&&(i=a[t]=[]),i.push(e)}else a.push(e)},l=0,c=E.length;l0&&!g.isSource,m=d&&o.length>0&&!g.isTarget;if(v||m)continue t;s.push(g)}}}return dt(s)},this.getAllConnections=function(){return E},this.getDefaultScope=function(){return T},this.getEndpoint=B,this.getEndpoints=function(t){return x[d(t).id]},this.getDefaultEndpointType=function(){return P.Endpoint},this.getDefaultConnectionType=function(){return P.Connection},this.getId=K,this.appendElement=R;var ft=!1;this.isHoverSuspended=function(){return ft},this.setHoverSuspended=function(t){ft=t},this.hide=function(t,n){return V(t,"none",n),e},this.idstamp=L,this.connectorsInitialized=!1,this.registerConnectorType=function(t,e){s.push([t,e])};var pt=function(t){if(!g&&t){var n=e.getElement(t);n.offsetParent&&e.setContainer(n.offsetParent)}},gt=function(){e.Defaults.Container&&e.setContainer(e.Defaults.Container)},vt=e.manage=function(t,n,i){return w[t]||(w[t]={el:n,endpoints:[],connections:[]},w[t].info=mt({elId:t,timestamp:k}),i||e.fire("manageElement",{id:t,info:w[t].info,el:n})),w[t]},mt=this.updateOffset=function(t){var n,i=t.timestamp,o=t.recalc,r=t.offset,s=t.elId;return O&&!i&&(i=k),!o&&i&&i===S[s]?{o:t.offset||j[s],s:I[s]}:(o||!r&&null==j[s]?(n=w[s]?w[s].el:null,null!=n&&(I[s]=e.getSize(n),j[s]=e.getOffset(n),S[s]=i)):(j[s]=r||j[s],null==I[s]&&(n=w[s].el,null!=n&&(I[s]=e.getSize(n))),S[s]=i),j[s]&&!j[s].right&&(j[s].right=j[s].left+I[s][0],j[s].bottom=j[s].top+I[s][1],j[s].width=I[s][0],j[s].height=I[s][1],j[s].centerx=j[s].left+j[s].width/2,j[s].centery=j[s].top+j[s].height/2),{o:j[s],s:I[s]})};this.init=function(){n=r.jsPlumb.getRenderModes();var t=function(t,e,n){r.jsPlumb.Connectors[t][e]=function(){n.apply(this,arguments),r.jsPlumb.ConnectorRenderers[t].apply(this,arguments)},a.extend(r.jsPlumb.Connectors[t][e],[n,r.jsPlumb.ConnectorRenderers[t]])};if(!r.jsPlumb.connectorsInitialized){for(var i=0;i=4?[i[2],i[3]]:[0,0],offsets:i.length>=6?[i[4],i[5]]:[0,0],elementId:o,jsPlumbInstance:e,cssClass:7==i.length?i[6]:null};s=new r.jsPlumb.Anchor(u),s.clone=function(){return new r.jsPlumb.Anchor(u)}}return s.id||(s.id="anchor_"+L()),s},this.makeAnchors=function(t,n,i){for(var o=[],s=0,u=t.length;s0&&n>=t.def.maxConnections},element:t.el,elementId:t.id,isSource:o,isTarget:s,addClass:function(n){e.addClass(t.el,n)},removeClass:function(n){e.removeClass(t.el,n)},onDrop:function(t){var e=t.endpoints[0];e.anchor.locked=!1},isDropAllowed:function(){return u.isDropAllowed.apply(u,arguments)},isRedrop:function(e){return null!=e.suspendedElement&&null!=e.suspendedEndpoint&&e.suspendedEndpoint.element===t.el},getEndpoint:function(i){var o=t.def.endpoint;if(null==o||null==o._jsPlumb){var s=e.deriveEndpointAndAnchorSpec(i.getType().join(" "),!0),a=s.endpoints?r.jsPlumb.extend(n,{endpoint:t.def.def.endpoint||s.endpoints[1]}):n;s.anchors&&(a=r.jsPlumb.extend(a,{anchor:t.def.def.anchor||s.anchors[1]})),o=e.addEndpoint(t.el,a),o._mtNew=!0}if(n.uniqueEndpoint&&(t.def.endpoint=o),o._doNotDeleteOnDetach=!1,o._deleteOnDetach=!0,i.isDetachable()&&o.initDraggable(),null!=o.anchor.positionFinder){var u=e.getUIPosition(arguments,e.getZoom()),l=e.getOffset(t.el),c=e.getSize(t.el),h=null==u?[0,0]:o.anchor.positionFinder(u,l,c,o.anchor.constructorParams);o.anchor.x=h[0],o.anchor.y=h[1]}return o},maybeCleanup:function(t){t._mtNew&&0===t.connections.length?e.deleteObject({endpoint:t}):delete t._mtNew}}),c=r.jsPlumb.dragEvents.drop;return i.scope=i.scope||n.scope||e.Defaults.Scope,i[c]=a.wrap(i[c],l,!0),s&&(i[r.jsPlumb.dragEvents.over]=function(){return!0}),n.allowLoopback===!1&&(i.canDrop=function(e){var n=e.getDragElement()._jsPlumbRelatedElement;return n!=t.el}),e.initDroppable(t.el,i,"internal"),l};this.makeTarget=function(t,e,n){var i=r.jsPlumb.extend({_jsPlumb:this},n);r.jsPlumb.extend(i,e),yt(i,1,this);for(var o=(!(i.deleteEndpointsOnDetach===!1),i.maxConnections||-1),s=function(t){var e=d(t),n=e.id,s=r.jsPlumb.extend({},i.dropOptions||{}),a="default";this.targetEndpointDefinitions[n]=this.targetEndpointDefinitions[n]||{},pt(n);var u={def:r.jsPlumb.extend({},i),uniqueEndpoint:i.uniqueEndpoint,maxConnections:o,enabled:!0};e.def=u,this.targetEndpointDefinitions[n][a]=u,_t(e,i,s,i.isSource===!0,!0),e.el._katavorioDrop[e.el._katavorioDrop.length-1].targetDef=u}.bind(this),a=t.length&&t.constructor!=String?t:[t],u=0,l=a.length;u=0&&g>=d.maxConnections)return c&&c({element:t.el,maxConnections:l},u),!1;var v=r.jsPlumb.getPositionOnElement(u,i,h),b={};r.jsPlumb.extend(b,o),b.isTemporarySource=!0,b.anchor=[v[0],v[1],0,0],b.dragOptions=p,d.def.scope&&(b.scope=d.def.scope),m=this.addEndpoint(n,b),y=!0,m._doNotDeleteOnDetach=!1,m._deleteOnDetach=!0,d.uniqueEndpoint&&(d.endpoint?m.finalEndpoint=d.endpoint:(d.endpoint=m,m._deleteOnDetach=!1,m._doNotDeleteOnDetach=!0));var _=function(){e.off(m.canvas,"mouseup",_),e.off(t.el,"mouseup",_),y&&(y=!1,e.deleteEndpoint(m))};e.on(m.canvas,"mouseup",_),e.on(t.el,"mouseup",_);var P={};if(d.def.extract)for(var E in d.def.extract){var x=(u.srcElement||u.target).getAttribute(E);x&&(P[d.def.extract[E]]=x)}e.trigger(m.canvas,"mousedown",u,P),a.consume(u)}}}.bind(this);this.on(t.el,"mousedown",b),u.trigger=b,o.filter&&(a.isString(o.filter)||a.isFunction(o.filter))&&e.setDragFilter(t.el,o.filter);var _=r.jsPlumb.extend({},o.dropOptions||{});_t(t,o,_,!0,o.isTarget===!0)}.bind(this),p=t.length&&t.constructor!=String?t:[t],g=0,v=p.length;g0;)o(n.el.childNodes[0]);e||jt(n,i)}};return e.batch(function(){o(t,!0)},n===!1),e},this.reset=function(){e.silently(function(){ft=!1,e.removeAllGroups(),e.removeGroupManager(),e.deleteEveryEndpoint(),e.unbind(),this.targetEndpointDefinitions={},this.sourceEndpointDefinitions={},E.length=0,this.doReset&&this.doReset()}.bind(this))};var St=function(t){t.canvas&&t.canvas.parentNode&&t.canvas.parentNode.removeChild(t.canvas),t.cleanup(),t.destroy()};this.clear=function(){e.select().each(St),e.selectEndpoints().each(St),x={},C={}},this.setDefaultScope=function(t){return T=t,e},this.setDraggable=W,this.deriveEndpointAndAnchorSpec=function(t,n){for(var i=((n?"":"default ")+t).split(/[\s]/),o=null,r=null,s=null,a=null,u=0;u0?t.touches:t.changedTouches&&t.changedTouches.length>0?t.changedTouches:t.targetTouches&&t.targetTouches.length>0?t.targetTouches:[t]},u=function(t){var e={},n=[],i={},o={},r={};this.register=function(s){var a=t.getId(s),u=t.getOffset(s);e[a]||(e[a]=s,n.push(s),i[a]={});var l=function(e){if(e)for(var n=0;n0){var h=t.getOffset(s);i[a][c]={id:c,offset:{left:h.left-u.left,top:h.top-u.top}},r[c]=a}l(e.childNodes[n])}};l(s)},this.updateOffsets=function(e,n){if(null!=e){n=n||{};var o=jsPlumb.getElement(e),s=t.getId(o),a=i[s],u=t.getOffset(o);if(a)for(var l in a)if(a.hasOwnProperty(l)){var c=jsPlumb.getElement(l),h=n[l]||t.getOffset(c);if(null==c.offsetParent&&null!=i[s][l])continue;i[s][l]={id:l,offset:{left:h.left-u.left,top:h.top-u.top}},r[l]=s}}},this.endpointAdded=function(n,s){s=s||t.getId(n);var a=document.body,u=n.parentNode;for(o[s]=o[s]?o[s]+1:1;null!=u&&u!=a;){var l=t.getId(u,null,!0);if(l&&e[l]){var c=t.getOffset(u);if(null==i[l][s]){var h=t.getOffset(n);i[l][s]={id:s,offset:{left:h.left-c.left,top:h.top-c.top}},r[s]=l}break}u=u.parentNode}},this.endpointDeleted=function(t){if(o[t.elementId]&&(o[t.elementId]--,o[t.elementId]<=0))for(var e in i)i.hasOwnProperty(e)&&i[e]&&(delete i[e][t.elementId],delete r[t.elementId])},this.changeId=function(t,e){i[e]=i[t],i[t]={},r[e]=r[t],r[t]=null},this.getElementsForDraggable=function(t){return i[t]},this.elementRemoved=function(t){var e=r[t];e&&(delete i[e][t],delete r[t])},this.reset=function(){e={},n=[],i={},o={}},this.dragEnded=function(e){if(null!=e.offsetParent){var n=t.getId(e),i=r[n];i&&this.updateOffsets(i)}},this.setParent=function(e,n,o,s,a){var u=r[n];i[s]||(i[s]={});var l=t.getOffset(o),c=a||t.getOffset(e);u&&delete i[u][n],i[s][n]={id:n,offset:{left:c.left-l.left,top:c.top-l.top}},r[n]=s},this.clearParent=function(t,e){var n=r[e];n&&(delete i[n][e],delete r[e])},this.revalidateParent=function(e,n,i){var o=r[n];if(o){var s={};s[n]=i,this.updateOffsets(o,s),t.revalidate(o)}},this.getDragAncestor=function(e){var n=jsPlumb.getElement(e),i=t.getId(n),o=r[i];return o?jsPlumb.getElement(o):null}},l=function(t){return null==t?null:t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},c=function(t,e){e=l(e),"undefined"!=typeof t.className.baseVal?t.className.baseVal=e:t.className=e},h=function(t){return"undefined"==typeof t.className.baseVal?t.className:t.className.baseVal},d=function(t,n,i){n=null==n?[]:e.isArray(n)?n:n.split(/\s+/),i=null==i?[]:e.isArray(i)?i:i.split(/\s+/);var o=h(t),r=o.split(/\s+/),s=function(t,e){for(var n=0;n0||t.scrollLeft>0)&&(i.left-=t.scrollLeft,i.top-=t.scrollTop)}.bind(this);null!=o;)i.left+=o.offsetLeft,i.top+=o.offsetTop,r(o),o=e?o.offsetParent:o.offsetParent==n?null:o.offsetParent;if(null!=n&&!e&&(n.scrollTop>0||n.scrollLeft>0)){var s=null!=t.offsetParent?this.getStyle(t.offsetParent,"position"):"static",a=this.getStyle(t,"position");"absolute"!==a&&"fixed"!==a&&"absolute"!==s&&"fixed"!=s&&(i.left-=n.scrollLeft,i.top-=n.scrollTop)}return i},getPositionOnElement:function(t,e,n){var i="undefined"!=typeof e.getBoundingClientRect?e.getBoundingClientRect():{left:0,top:0,width:0,height:0},o=document.body,r=document.documentElement,s=window.pageYOffset||r.scrollTop||o.scrollTop,a=window.pageXOffset||r.scrollLeft||o.scrollLeft,u=r.clientTop||o.clientTop||0,l=r.clientLeft||o.clientLeft||0,c=0,h=0,d=i.top+s-u+c*n,f=i.left+a-l+h*n,p=jsPlumb.pageLocation(t),g=i.width||e.offsetWidth*n,v=i.height||e.offsetHeight*n,m=(p[0]-f)/g,y=(p[1]-d)/v;return[m,y]},getAbsolutePosition:function(t){var e=function(e){var n=t.style[e];if(n)return parseFloat(n.substring(0,n.length-2))};return[e("left"),e("top")]},setAbsolutePosition:function(t,e,n,i){n?this.animate(t,{left:"+="+(e[0]-n[0]),top:"+="+(e[1]-n[1])},i):(t.style.left=e[0]+"px",t.style.top=e[1]+"px")},getSize:function(t){return[t.offsetWidth,t.offsetHeight]},getWidth:function(t){return t.offsetWidth},getHeight:function(t){return t.offsetHeight},getRenderMode:function(){return"svg"}})}.call("undefined"!=typeof window?window:this),function(){"use strict";var t=this,e=t.jsPlumb,n=t.jsPlumbUtil,i="__label",o=function(t,n){var o={cssClass:n.cssClass,labelStyle:t.labelStyle,id:i,component:t,_jsPlumb:t._jsPlumb.instance},r=e.extend(o,n);return new(e.Overlays[t._jsPlumb.instance.getRenderMode()].Label)(r)},r=function(t,i){var o=null;if(n.isArray(i)){var r=i[0],s=e.extend({component:t,_jsPlumb:t._jsPlumb.instance},i[1]);3==i.length&&e.extend(s,i[2]),o=new(e.Overlays[t._jsPlumb.instance.getRenderMode()][r])(s)}else o=i.constructor==String?new(e.Overlays[t._jsPlumb.instance.getRenderMode()][i])({component:t,_jsPlumb:t._jsPlumb.instance}):i;return o.id=o.id||n.uuid(),t.cacheTypeItem("overlay",o,o.id),t._jsPlumb.overlays[o.id]=o,o};e.OverlayCapableJsPlumbUIComponent=function(e){t.jsPlumbUIComponent.apply(this,arguments),this._jsPlumb.overlays={},this._jsPlumb.overlayPositions={},e.label&&(this.getDefaultType().overlays[i]=["Label",{label:e.label,location:e.labelLocation||this.defaultLabelLocation||.5,labelStyle:e.labelStyle||this._jsPlumb.instance.Defaults.LabelStyle,id:i}]),this.setListenerComponent=function(t){if(this._jsPlumb)for(var e in this._jsPlumb.overlays)this._jsPlumb.overlays[e].setListenerComponent(t)}},e.OverlayCapableJsPlumbUIComponent.applyType=function(t,e){if(e.overlays){var n,i={};for(n in e.overlays){var o=t._jsPlumb.overlays[e.overlays[n][1].id];if(o)o.updateFrom(e.overlays[n][1]),i[e.overlays[n][1].id]=!0;else{var r=t.getCachedTypeItem("overlay",e.overlays[n][1].id);null!=r?(r.reattach(t._jsPlumb.instance),r.setVisible(!0),r.updateFrom(e.overlays[n][1]),t._jsPlumb.overlays[r.id]=r):r=t.addOverlay(e.overlays[n],!0),i[r.id]=!0}}for(n in t._jsPlumb.overlays)null==i[t._jsPlumb.overlays[n].id]&&t.removeOverlay(t._jsPlumb.overlays[n].id,!0)}},n.extend(e.OverlayCapableJsPlumbUIComponent,t.jsPlumbUIComponent,{setHover:function(t,e){if(this._jsPlumb&&!this._jsPlumb.instance.isConnectionBeingDragged())for(var n in this._jsPlumb.overlays)this._jsPlumb.overlays[n][t?"addClass":"removeClass"](this._jsPlumb.instance.hoverClass)},addOverlay:function(t,e){var n=r(this,t);return e||this.repaint(),n},getOverlay:function(t){return this._jsPlumb.overlays[t]},getOverlays:function(){return this._jsPlumb.overlays},hideOverlay:function(t){var e=this.getOverlay(t);e&&e.hide()},hideOverlays:function(){for(var t in this._jsPlumb.overlays)this._jsPlumb.overlays[t].hide()},showOverlay:function(t){var e=this.getOverlay(t);e&&e.show()},showOverlays:function(){for(var t in this._jsPlumb.overlays)this._jsPlumb.overlays[t].show()},removeAllOverlays:function(t){for(var e in this._jsPlumb.overlays)this._jsPlumb.overlays[e].cleanup&&this._jsPlumb.overlays[e].cleanup();this._jsPlumb.overlays={},this._jsPlumb.overlayPositions=null,t||this.repaint()},removeOverlay:function(t,e){var n=this._jsPlumb.overlays[t];n&&(n.setVisible(!1),!e&&n.cleanup&&n.cleanup(),delete this._jsPlumb.overlays[t],this._jsPlumb.overlayPositions&&delete this._jsPlumb.overlayPositions[t])},removeOverlays:function(){for(var t=0,e=arguments.length;t0)for(var e=0;e0?"add":"remove")+"Class"](u.endpointConnectedClass),this[(this.isFull()?"add":"remove")+"Class"](u.endpointFullClass)},this.detachFromConnection=function(t,e,n){e=null==e?this.connections.indexOf(t):e,e>=0&&(this.connections.splice(e,1),this[(this.connections.length>0?"add":"remove")+"Class"](u.endpointConnectedClass),this[(this.isFull()?"add":"remove")+"Class"](u.endpointFullClass)),(this._forceDeleteOnDetach||!n&&this._deleteOnDetach)&&0===this.connections.length&&u.deleteObject({ -endpoint:this,fireEvent:!1,deleteAttachedObjects:n!==!0})},this.detach=function(t){var e=t.connectionIndex,n=t.connection,i=t.ignoreTarget,o=t.fireEvent,r=t.originalEvent,s=t.endpointBeingDeleted,a=t.forceDetach,l=null==e?this.connections.indexOf(n):e,c=!1;return o=o!==!1,l>=0&&(a||n._forceDetach||n.isDetachable()&&n.isDetachAllowed(n)&&this.isDetachAllowed(n)&&u.checkCondition("beforeDetach",n,s))&&(u.deleteObject({connection:n,fireEvent:!i&&o,originalEvent:r,deleteAttachedObjects:t.deleteAttachedObjects}),c=!0),c},this.detachAll=function(t,e){for(var n=[];this.connections.length>0;){var i=this.detach({connection:this.connections[0],ignoreTarget:!1,forceDetach:e===!0,fireEvent:t!==!1,originalEvent:null,endpointBeingDeleted:this,connectionIndex:0});i||(n.push(this.connections[0]),this.connections.splice(0,1))}return this.connections=n,this},this.detachFrom=function(t,e,n){for(var i=[],o=0;o0){var h=a(this,t.elementWithPrecedence),d=h.endpoints[0]==this?1:0,f=0===d?h.sourceId:h.targetId,p=u.getCachedData(f),g=p.o,v=p.s;c.txy=[g.left,g.top],c.twh=v,c.tElement=h.endpoints[d]}r=this.anchor.compute(c)}this.endpoint.compute(r,this.anchor.getOrientation(this),this._jsPlumb.paintStyleInUse,s||this.paintStyleInUse),this.endpoint.paint(this._jsPlumb.paintStyleInUse,this.anchor),this.timestamp=e;for(var m in this._jsPlumb.overlays)if(this._jsPlumb.overlays.hasOwnProperty(m)){var y=this._jsPlumb.overlays[m];y.isVisible()&&(this._jsPlumb.overlayPlacements[m]=y.draw(this.endpoint,this._jsPlumb.paintStyleInUse),y.paint(this._jsPlumb.overlayPlacements[m]))}}}},this.getTypeDescriptor=function(){return"endpoint"},this.isVisible=function(){return this._jsPlumb.visible},this.repaint=this.paint;var p=!1;this.initDraggable=function(){if(!p&&e.isDragSupported(this.element)){var s,a={id:null,element:null},d=null,f=!1,g=null,v=i(this,a,u),m=t.dragOptions||{},y={},b=e.dragEvents.start,_=e.dragEvents.stop,P=e.dragEvents.drag,E=e.dragEvents.beforeStart,x=function(t){s=t.e.payload||{}},C=function(i){d=this.connectorSelector();var h=!0;this.isEnabled()||(h=!1),null!=d||this.isSource||this.isTemporarySource||(h=!1),!this.isSource||!this.isFull()||null!=d&&this.dragAllowedWhenFull||(h=!1),null==d||d.isDetachable(this)||(h=!1);var p=u.checkCondition(null==d?"beforeDrag":"beforeStartDetach",{endpoint:this,source:this.element,sourceId:this.elementId,connection:d});if(p===!1?h=!1:"object"==typeof p?e.extend(p,s||{}):p=s||{},h===!1)return u.stopDrag&&u.stopDrag(this.canvas),v.stopDrag(),!1;for(var m=0;m0}.bind(this),u.initDraggable(this.canvas,m,"internal"),this.canvas._jsPlumbRelatedElement=this.element,p=!0}};var g=t.endpoint||this._jsPlumb.instance.Defaults.Endpoint||e.Defaults.Endpoint;this.setEndpoint(g,!0);var v=t.anchor?t.anchor:t.anchors?t.anchors:u.Defaults.Anchor||"Top";this.setAnchor(v,!0);var m=["default",t.type||""].join(" ");this.addType(m,t.data,!0),this.canvas=this.endpoint.canvas,this.canvas._jsPlumb=this,this.initDraggable();var y=function(i,o,r,s){if(e.isDropSupported(this.element)){var a=t.dropOptions||u.Defaults.DropOptions||e.Defaults.DropOptions;a=e.extend({},a),a.scope=a.scope||this.scope;var l=e.dragEvents.drop,c=e.dragEvents.over,h=e.dragEvents.out,d=this,f=u.EndpointDropHandler({getEndpoint:function(){return d},jsPlumb:u,enabled:function(){return null==r||r.isEnabled()},isFull:function(){return r.isFull()},element:this.element,elementId:this.elementId,isSource:this.isSource,isTarget:this.isTarget,addClass:function(t){d.addClass(t)},removeClass:function(t){d.removeClass(t)},isDropAllowed:function(){return d.isDropAllowed.apply(d,arguments)},reference:s,isRedrop:function(t,e){return t.suspendedEndpoint&&e.reference&&t.suspendedEndpoint.id===e.reference.id}});a[l]=n.wrap(a[l],f,!0),a[c]=n.wrap(a[c],function(){var t=e.getDragObject(arguments),n=u.getAttribute(e.getElement(t),"dragId"),i=u.floatingConnections[n];if(null!=i){var o=u.getFloatingAnchorIndex(i),r=this.isTarget&&0!==o||i.suspendedEndpoint&&this.referenceEndpoint&&this.referenceEndpoint.id==i.suspendedEndpoint.id;if(r){var s=u.checkCondition("checkDropAllowed",{sourceEndpoint:i.endpoints[o],targetEndpoint:this,connection:i});this[(s?"add":"remove")+"Class"](u.endpointDropAllowedClass),this[(s?"remove":"add")+"Class"](u.endpointDropForbiddenClass),i.endpoints[o].anchor.over(this.anchor,this)}}}.bind(this)),a[h]=n.wrap(a[h],function(){var t=e.getDragObject(arguments),n=null==t?null:u.getAttribute(e.getElement(t),"dragId"),i=n?u.floatingConnections[n]:null;if(null!=i){var o=u.getFloatingAnchorIndex(i),r=this.isTarget&&0!==o||i.suspendedEndpoint&&this.referenceEndpoint&&this.referenceEndpoint.id==i.suspendedEndpoint.id;r&&(this.removeClass(u.endpointDropAllowedClass),this.removeClass(u.endpointDropForbiddenClass),i.endpoints[o].anchor.out())}}.bind(this)),u.initDroppable(i,a,"internal",o)}}.bind(this);return this.anchor.isFloating||y(this.canvas,!(t._transient||this.anchor.isFloating),this,t.reference),this},n.extend(e.Endpoint,e.OverlayCapableJsPlumbUIComponent,{setVisible:function(t,e,n){if(this._jsPlumb.visible=t,this.canvas&&(this.canvas.style.display=t?"block":"none"),this[t?"showOverlays":"hideOverlays"](),!e)for(var i=0;ie.dist?1:0});for(var p=c[0].source,g=c[0].target,v=0;vn[0][0],i===!1?-1:1}},m=function(t,e){var n=t[0][0]<0?-Math.PI-t[0][0]:Math.PI-t[0][0],i=e[0][0]<0?-Math.PI-e[0][0]:Math.PI-e[0][0];return n>i?1:-1},y={top:function(t,e){return t[0]>e[0]?1:-1},right:v(!0),bottom:v(!0),left:m},b=function(t,e){return t.sort(e)},_=function(t,e){var n=d.getCachedData(t),i=n.s,r=n.o,a=function(e,n,i,r,a,u,l){if(r.length>0)for(var c=b(r,y[e]),h="right"===e||"top"===e,d=g(e,n,i,c,a,u,h),f=function(t,e){o[t.id]=[e[0],e[1],e[2],e[3]],s[t.id]=l},p=0;p-1&&(l[i].splice(a,1),e.addToList(l,o,[r,r.endpoints[0],r.endpoints[0].anchor.constructor==n.DynamicAnchor])),r.updateConnectedClass()},this.sourceChanged=function(t,i,o,r){if(t!==i){o.sourceId=i,o.source=r,e.removeWithFunction(l[t],function(t){return t[0].id===o.id});var s=e.findWithFunction(l[o.targetId],function(t){return t[0].id===o.id});s>-1&&(l[o.targetId][s][0]=o,l[o.targetId][s][1]=o.endpoints[0],l[o.targetId][s][2]=o.endpoints[0].anchor.constructor==n.DynamicAnchor),e.addToList(l,i,[o,o.endpoints[1],o.endpoints[1].anchor.constructor==n.DynamicAnchor]),o.endpoints[1].anchor.isContinuous&&(o.source===o.target?o._jsPlumb.instance.removeElement(o.endpoints[1].canvas):null==o.endpoints[1].canvas.parentNode&&o._jsPlumb.instance.appendElement(o.endpoints[1].canvas)),o.updateConnectedClass()}},this.rehomeEndpoint=function(t,e,n){var o=i[e]||[],r=d.getId(n);if(r!==e){var s=o.indexOf(t);if(s>-1){var a=o.splice(s,1)[0];c.add(a,r)}}for(var u=0;u0?this.anchors[0]:null,r=o,s=this,a=function(t,e,n,i,o){var r=i[0]+t.x*o[0],s=i[1]+t.y*o[1],a=i[0]+o[0]/2,u=i[1]+o[1]/2;return Math.sqrt(Math.pow(e-r,2)+Math.pow(n-s,2))+Math.sqrt(Math.pow(a-r,2)+Math.pow(u-s,2))},u=t.selector||function(t,e,n,i,o){for(var r=n[0]+i[0]/2,s=n[1]+i[1]/2,u=-1,l=1/0,c=0;c0?t:n+t:t*n;return i.pointOnLine({x:s,y:u},{x:a,y:l},o)}return{x:a,y:l}}return{x:s,y:u}},this.gradientAtPoint=function(t){return o},this.pointAlongPathFrom=function(t,e,n){var o=this.pointOnPath(t,n),r=e<=0?{x:s,y:u}:{x:a,y:l};return e<=0&&Math.abs(e)>1&&(e*=-1),i.pointOnLine(o,r,e)};var h=function(t,e,n){return n>=Math.min(t,e)&&n<=Math.max(t,e)},d=function(t,e,n){return Math.abs(n-t)0?0:1,n)),n};this.pointOnPath=function(e,n){return e=i(this.curve,e,n),t.jsBezier.pointOnCurve(this.curve,e)},this.gradientAtPoint=function(e,n){return e=i(this.curve,e,n),t.jsBezier.gradientAtPoint(this.curve,e)},this.pointAlongPathFrom=function(e,n,o){return e=i(this.curve,e,o),t.jsBezier.pointAlongCurveFrom(this.curve,e,n)},this.getLength=function(){return t.jsBezier.getLength(this.curve)},this.getBounds=function(){return this.bounds}}},e.SegmentRenderer={getPath:function(t){return{Straight:function(){var e=t.getCoordinates();return"M "+e.x1+" "+e.y1+" L "+e.x2+" "+e.y2},Bezier:function(){var e=t.params;return"M "+e.x1+" "+e.y1+" C "+e.cp1x+" "+e.cp1y+" "+e.cp2x+" "+e.cp2y+" "+e.x2+" "+e.y2},Arc:function(){var e=t.params,n=t.sweep>Math.PI?1:0,i=t.anticlockwise?0:1;return"M"+t.x1+" "+t.y1+" A "+t.radius+" "+e.r+" 0 "+n+","+i+" "+t.x2+" "+t.y2}}[t.type]()}};var o=function(){this.resetBounds=function(){this.bounds={minX:1/0,minY:1/0,maxX:-(1/0),maxY:-(1/0)}},this.resetBounds()};e.Connectors.AbstractConnector=function(t){o.apply(this,arguments);var r=[],s=0,a=[],u=[],l=t.stub||0,c=n.isArray(l)?l[0]:l,h=n.isArray(l)?l[1]:l,d=t.gap||0,f=n.isArray(d)?d[0]:d,p=n.isArray(d)?d[1]:d,g=null,v=!1,m=null,y=null,b=t.editable!==!1&&null!=e.ConnectorEditors&&null!=e.ConnectorEditors[this.type],_=this.setGeometry=function(t,e){v=!e,y=t},P=this.getGeometry=function(){return y};this.getPathData=function(){for(var t="",n=0;n0?t/s:(s+t)/s);for(var n=a.length-1,i=1,o=0;o=t){n=o,i=1==t?1:0===t?0:(t-a[o][0])/u[o];break}return{segment:r[n],proportion:i,index:n}},C=function(t,n,i){if(i.x1!=i.x2||i.y1!=i.y2){var o=new e.Segments[n](i);r.push(o),s+=o.getLength(),t.updateBounds(o)}},w=function(){s=r.length=a.length=u.length=0};this.setSegments=function(t){g=[],s=0;for(var e=0;eg?0:1,m=[1,0][v];s=[],a=[],s[v]=t.sourcePos[v]>t.targetPos[v]?-1:1,a[v]=t.sourcePos[v]>t.targetPos[v]?1:-1,s[m]=0,a[m]=0}var y=n?d+f*s[0]:f*s[0],b=o?g+f*s[1]:f*s[1],_=n?p*a[0]:d+p*a[0],P=o?p*a[1]:g+p*a[1],E=s[0]*a[0]+s[1]*a[1],x={sx:y,sy:b,tx:_,ty:P,lw:r,xSpan:Math.abs(_-y),ySpan:Math.abs(P-b),mx:(y+_)/2,my:(b+P)/2,so:s,to:a,x:u,y:l,w:d,h:g,segment:e,startStubX:y+s[0]*c,startStubY:b+s[1]*c,endStubX:_+a[0]*h,endStubY:P+a[1]*h,isXGreaterThanStubTimes2:Math.abs(y-_)>c+h,isYGreaterThanStubTimes2:Math.abs(b-P)>c+h,opposite:E==-1,perpendicular:0===E,orthogonal:1==E,sourceAxis:0===s[0]?"y":"x",points:[u,l,d,g,y,b,_,P]};return x.anchorOrientation=x.opposite?"opposite":x.orthogonal?"orthogonal":"perpendicular",x};return this.getSegments=function(){return r},this.updateBounds=function(t){var e=t.getBounds();this.bounds.minX=Math.min(this.bounds.minX,e.minX),this.bounds.maxX=Math.max(this.bounds.maxX,e.maxX),this.bounds.minY=Math.min(this.bounds.minY,e.minY),this.bounds.maxY=Math.max(this.bounds.maxY,e.maxY)},this.pointOnPath=function(t,e){var n=x(t,e);return n.segment&&n.segment.pointOnPath(n.proportion,!1)||[0,0]},this.gradientAtPoint=function(t,e){var n=x(t,e);return n.segment&&n.segment.gradientAtPoint(n.proportion,!1)||0},this.pointAlongPathFrom=function(t,e,n){var i=x(t,n);return i.segment&&i.segment.pointAlongPathFrom(i.proportion,e,!1)||[0,0]},this.compute=function(t){m=j.call(this,t),w(),this._compute(m,t),this.x=m.points[0],this.y=m.points[1],this.w=m.points[2],this.h=m.points[3],this.segment=m.segment,E()},{addSegment:C,prepareCompute:j,sourceStub:c,targetStub:h,maxStub:Math.max(c,h),sourceGap:f,targetGap:p,maxGap:Math.max(f,p),setGeometry:_,getGeometry:P}},n.extend(e.Connectors.AbstractConnector,o),e.Endpoints.AbstractEndpoint=function(t){o.apply(this,arguments);var e=this.compute=function(t,e,n,i){var o=this._compute.apply(this,arguments);return this.x=o[0],this.y=o[1],this.w=o[2],this.h=o[3],this.bounds.minX=this.x,this.bounds.minY=this.y,this.bounds.maxX=this.x+this.w,this.bounds.maxY=this.y+this.h,o};return{compute:e,cssClass:t.cssClass}},n.extend(e.Endpoints.AbstractEndpoint,o),e.Endpoints.Dot=function(t){this.type="Dot",e.Endpoints.AbstractEndpoint.apply(this,arguments),t=t||{},this.radius=t.radius||10,this.defaultOffset=.5*this.radius,this.defaultInnerRadius=this.radius/3,this._compute=function(t,e,n,i){this.radius=n.radius||this.radius;var o=t[0]-this.radius,r=t[1]-this.radius,s=2*this.radius,a=2*this.radius;if(n.stroke){var u=n.strokeWidth||1;o-=u,r-=u,s+=2*u,a+=2*u}return[o,r,s,a,this.radius]}},n.extend(e.Endpoints.Dot,e.Endpoints.AbstractEndpoint),e.Endpoints.Rectangle=function(t){this.type="Rectangle",e.Endpoints.AbstractEndpoint.apply(this,arguments),t=t||{},this.width=t.width||20,this.height=t.height||20,this._compute=function(t,e,n,i){var o=n.width||this.width,r=n.height||this.height,s=t[0]-o/2,a=t[1]-r/2;return[s,a,o,r]}},n.extend(e.Endpoints.Rectangle,e.Endpoints.AbstractEndpoint);var r=function(t){e.jsPlumbUIComponent.apply(this,arguments),this._jsPlumb.displayElements=[]};n.extend(r,e.jsPlumbUIComponent,{getDisplayElements:function(){return this._jsPlumb.displayElements},appendDisplayElement:function(t){this._jsPlumb.displayElements.push(t)}}),e.Endpoints.Image=function(i){this.type="Image",r.apply(this,arguments),e.Endpoints.AbstractEndpoint.apply(this,arguments);var o=i.onload,s=i.src||i.url,a=i.cssClass?" "+i.cssClass:"";this._jsPlumb.img=new Image,this._jsPlumb.ready=!1,this._jsPlumb.initialized=!1,this._jsPlumb.deleted=!1,this._jsPlumb.widthToUse=i.width,this._jsPlumb.heightToUse=i.height,this._jsPlumb.endpoint=i.endpoint,this._jsPlumb.img.onload=function(){null!=this._jsPlumb&&(this._jsPlumb.ready=!0,this._jsPlumb.widthToUse=this._jsPlumb.widthToUse||this._jsPlumb.img.width,this._jsPlumb.heightToUse=this._jsPlumb.heightToUse||this._jsPlumb.img.height,o&&o(this))}.bind(this),this._jsPlumb.endpoint.setImage=function(t,e){var n=t.constructor==String?t:t.src;o=e,this._jsPlumb.img.src=n,null!=this.canvas&&this.canvas.setAttribute("src",this._jsPlumb.img.src)}.bind(this),this._jsPlumb.endpoint.setImage(s,o),this._compute=function(t,e,n,i){return this.anchorPoint=t,this._jsPlumb.ready?[t[0]-this._jsPlumb.widthToUse/2,t[1]-this._jsPlumb.heightToUse/2,this._jsPlumb.widthToUse,this._jsPlumb.heightToUse]:[0,0,0,0]},this.canvas=e.createElement("img",{position:"absolute",margin:0,padding:0,outline:0},this._jsPlumb.instance.endpointClass+a),this._jsPlumb.widthToUse&&this.canvas.setAttribute("width",this._jsPlumb.widthToUse),this._jsPlumb.heightToUse&&this.canvas.setAttribute("height",this._jsPlumb.heightToUse),this._jsPlumb.instance.appendElement(this.canvas),this.actuallyPaint=function(t,e,i){if(!this._jsPlumb.deleted){this._jsPlumb.initialized||(this.canvas.setAttribute("src",this._jsPlumb.img.src),this.appendDisplayElement(this.canvas),this._jsPlumb.initialized=!0);var o=this.anchorPoint[0]-this._jsPlumb.widthToUse/2,r=this.anchorPoint[1]-this._jsPlumb.heightToUse/2;n.sizeElement(this.canvas,o,r,this._jsPlumb.widthToUse,this._jsPlumb.heightToUse)}},this.paint=function(e,n){null!=this._jsPlumb&&(this._jsPlumb.ready?this.actuallyPaint(e,n):t.setTimeout(function(){this.paint(e,n)}.bind(this),200))}},n.extend(e.Endpoints.Image,[r,e.Endpoints.AbstractEndpoint],{cleanup:function(t){t&&(this._jsPlumb.deleted=!0,this.canvas&&this.canvas.parentNode.removeChild(this.canvas),this.canvas=null)}}),e.Endpoints.Blank=function(t){e.Endpoints.AbstractEndpoint.apply(this,arguments),this.type="Blank",r.apply(this,arguments),this._compute=function(t,e,n,i){return[t[0],t[1],10,0]};var i=t.cssClass?" "+t.cssClass:"";this.canvas=e.createElement("div",{display:"block",width:"1px",height:"1px",background:"transparent",position:"absolute"},this._jsPlumb.instance.endpointClass+i),this._jsPlumb.instance.appendElement(this.canvas),this.paint=function(t,e){n.sizeElement(this.canvas,this.x,this.y,this.w,this.h)}},n.extend(e.Endpoints.Blank,[e.Endpoints.AbstractEndpoint,r],{cleanup:function(){this.canvas&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)}}),e.Endpoints.Triangle=function(t){this.type="Triangle",e.Endpoints.AbstractEndpoint.apply(this,arguments),t=t||{},t.width=t.width||55,t.height=t.height||55,this.width=t.width,this.height=t.height,this._compute=function(t,e,n,i){var o=n.width||self.width,r=n.height||self.height,s=t[0]-o/2,a=t[1]-r/2;return[s,a,o,r]}};var s=e.Overlays.AbstractOverlay=function(t){this.visible=!0,this.isAppendedAtTopLevel=!0,this.component=t.component,this.loc=null==t.location?.5:t.location,this.endpointLoc=null==t.endpointLocation?[.5,.5]:t.endpointLocation,this.visible=t.visible!==!1};s.prototype={cleanup:function(t){t&&(this.component=null,this.canvas=null,this.endpointLoc=null)},reattach:function(t){},setVisible:function(t){this.visible=t,this.component.repaint()},isVisible:function(){return this.visible},hide:function(){this.setVisible(!1)},show:function(){this.setVisible(!0)},incrementLocation:function(t){this.loc+=t,this.component.repaint()},setLocation:function(t){this.loc=t,this.component.repaint()},getLocation:function(){return this.loc},updateFrom:function(){}},e.Overlays.Arrow=function(t){this.type="Arrow",s.apply(this,arguments),this.isAppendedAtTopLevel=!1,t=t||{},this.length=t.length||20,this.width=t.width||20,this.id=t.id;var o=(t.direction||1)<0?-1:1,r=t.paintStyle||{"stroke-width":1},a=t.foldback||.623;this.computeMaxSize=function(){return 1.5*self.width},this.elementCreated=function(n,i){if(this.path=n,t.events)for(var o in t.events)e.on(n,o,t.events[o])},this.draw=function(t,e){var s,u,l,c,h;if(t.pointAlongPathFrom){if(n.isString(this.loc)||this.loc>1||this.loc<0){var d=parseInt(this.loc,10),f=this.loc<0?1:0;s=t.pointAlongPathFrom(f,d,!1),u=t.pointAlongPathFrom(f,d-o*this.length/2,!1),l=i.pointOnLine(s,u,this.length)}else if(1==this.loc){if(s=t.pointOnPath(this.loc),u=t.pointAlongPathFrom(this.loc,-this.length),l=i.pointOnLine(s,u,this.length),o==-1){var p=l;l=s,s=p}}else if(0===this.loc){if(l=t.pointOnPath(this.loc),u=t.pointAlongPathFrom(this.loc,this.length),s=i.pointOnLine(l,u,this.length),o==-1){var g=l;l=s,s=g}}else s=t.pointAlongPathFrom(this.loc,o*this.length/2),u=t.pointOnPath(this.loc),l=i.pointOnLine(s,u,this.length);c=i.perpendicularLineTo(s,l,this.width),h=i.pointOnLine(s,l,a*this.length);var v={hxy:s,tail:c,cxy:h},m=r.stroke||e.stroke,y=r.fill||e.stroke,b=r.strokeWidth||e.strokeWidth;return{component:t,d:v,"stroke-width":b,stroke:m,fill:y,minX:Math.min(s.x,c[0].x,c[1].x),maxX:Math.max(s.x,c[0].x,c[1].x),minY:Math.min(s.y,c[0].y,c[1].y),maxY:Math.max(s.y,c[0].y,c[1].y)}}return{component:t,minX:0,maxX:0,minY:0,maxY:0}}},n.extend(e.Overlays.Arrow,s,{updateFrom:function(t){this.length=t.length||this.length,this.width=t.width||this.width,this.direction=null!=t.direction?t.direction:this.direction,this.foldback=t.foldback||this.foldback}}),e.Overlays.PlainArrow=function(t){t=t||{};var n=e.extend(t,{foldback:1});e.Overlays.Arrow.call(this,n),this.type="PlainArrow"},n.extend(e.Overlays.PlainArrow,e.Overlays.Arrow),e.Overlays.Diamond=function(t){t=t||{};var n=t.length||40,i=e.extend(t,{length:n/2,foldback:2});e.Overlays.Arrow.call(this,i),this.type="Diamond"},n.extend(e.Overlays.Diamond,e.Overlays.Arrow);var a=function(t,e){return(null==t._jsPlumb.cachedDimensions||e)&&(t._jsPlumb.cachedDimensions=t.getDimensions()),t._jsPlumb.cachedDimensions},u=function(t){e.jsPlumbUIComponent.apply(this,arguments),s.apply(this,arguments);var i=this.fire;this.fire=function(){i.apply(this,arguments),this.component&&this.component.fire.apply(this.component,arguments)},this.detached=!1,this.id=t.id,this._jsPlumb.div=null,this._jsPlumb.initialised=!1,this._jsPlumb.component=t.component,this._jsPlumb.cachedDimensions=null,this._jsPlumb.create=t.create,this._jsPlumb.initiallyInvisible=t.visible===!1,this.getElement=function(){if(null==this._jsPlumb.div){var n=this._jsPlumb.div=e.getElement(this._jsPlumb.create(this._jsPlumb.component));n.style.position="absolute",n.className=this._jsPlumb.instance.overlayClass+" "+(this.cssClass?this.cssClass:t.cssClass?t.cssClass:""),this._jsPlumb.instance.appendElement(n),this._jsPlumb.instance.getId(n),this.canvas=n;var i="translate(-50%, -50%)";n.style.webkitTransform=i,n.style.mozTransform=i,n.style.msTransform=i,n.style.oTransform=i,n.style.transform=i,n._jsPlumb=this,t.visible===!1&&(n.style.display="none")}return this._jsPlumb.div},this.draw=function(t,e,i){var o=a(this);if(null!=o&&2==o.length){var r={x:0,y:0};if(i)r={x:i[0],y:i[1]};else if(t.pointOnPath){var s=this.loc,u=!1;(n.isString(this.loc)||this.loc<0||this.loc>1)&&(s=parseInt(this.loc,10),u=!0),r=t.pointOnPath(s,u)}else{var l=this.loc.constructor==Array?this.loc:this.endpointLoc;r={x:l[0]*t.w,y:l[1]*t.h}}var c=r.x-o[0]/2,h=r.y-o[1]/2;return{component:t,d:{minx:c,miny:h,td:o,cxy:r},minX:c,maxX:c+o[0],minY:h,maxY:h+o[1]}}return{minX:0,maxX:0,minY:0,maxY:0}}};n.extend(u,[e.jsPlumbUIComponent,s],{getDimensions:function(){return[1,1]},setVisible:function(t){this._jsPlumb.div&&(this._jsPlumb.div.style.display=t?"block":"none", +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.reactDag=e(require("react")):t.reactDag=e(t.React)}(this,function(t){return function(t){function e(i){if(n[i])return n[i].exports;var o=n[i]={exports:{},id:i,loaded:!1};return t[i].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function o(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|t}function v(e){return+e!=e&&(e=0),t.alloc(+e)}function m(e,n){if(t.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var i=e.length;if(0===i)return 0;for(var o=!1;;)switch(n){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return X(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return q(e).length;default:if(o)return X(e).length;n=(""+n).toLowerCase(),o=!0}}function y(t,e,n){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,e>>>=0,n<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return T(this,e,n);case"utf8":case"utf-8":return A(this,e,n);case"ascii":return O(this,e,n);case"latin1":case"binary":return k(this,e,n);case"base64":return D(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,n);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function b(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function _(e,n,i,o,r){if(0===e.length)return-1;if("string"==typeof i?(o=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=r?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(r)return-1;i=e.length-1}else if(i<0){if(!r)return-1;i=0}if("string"==typeof n&&(n=t.from(n,o)),t.isBuffer(n))return 0===n.length?-1:P(e,n,i,o,r);if("number"==typeof n)return n=255&n,t.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,n,i):Uint8Array.prototype.lastIndexOf.call(e,n,i):P(e,[n],i,o,r);throw new TypeError("val must be string, number or Buffer")}function P(t,e,n,i,o){function r(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}var s=1,a=t.length,u=e.length;if(void 0!==i&&(i=String(i).toLowerCase(),"ucs2"===i||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,n/=2}var l;if(o){var c=-1;for(l=n;la&&(n=a-u),l=n;l>=0;l--){for(var h=!0,d=0;do&&(i=o)):i=o;var r=e.length;if(r%2!==0)throw new TypeError("Invalid hex string");i>r/2&&(i=r/2);for(var s=0;s239?4:r>223?3:r>191?2:1;if(o+a<=n){var u,l,c,h;switch(a){case 1:r<128&&(s=r);break;case 2:u=t[o+1],128===(192&u)&&(h=(31&r)<<6|63&u,h>127&&(s=h));break;case 3:u=t[o+1],l=t[o+2],128===(192&u)&&128===(192&l)&&(h=(15&r)<<12|(63&u)<<6|63&l,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:u=t[o+1],l=t[o+2],c=t[o+3],128===(192&u)&&128===(192&l)&&128===(192&c)&&(h=(15&r)<<18|(63&u)<<12|(63&l)<<6|63&c,h>65535&&h<1114112&&(s=h))}}null===s?(s=65533,a=1):s>65535&&(s-=65536,i.push(s>>>10&1023|55296),s=56320|1023&s),i.push(s),o+=a}return I(i)}function I(t){var e=t.length;if(e<=tt)return String.fromCharCode.apply(String,t);for(var n="",i=0;ii)&&(n=i);for(var o="",r=e;rn)throw new RangeError("Trying to access beyond buffer length")}function R(e,n,i,o,r,s){if(!t.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>r||ne.length)throw new RangeError("Index out of range")}function N(t,e,n,i){e<0&&(e=65535+e+1);for(var o=0,r=Math.min(t.length-n,2);o>>8*(i?o:1-o)}function B(t,e,n,i){e<0&&(e=4294967295+e+1);for(var o=0,r=Math.min(t.length-n,4);o>>8*(i?o:3-o)&255}function U(t,e,n,i,o,r){if(n+i>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function F(t,e,n,i,o){return o||U(t,e,n,4,3.4028234663852886e38,-3.4028234663852886e38),$.write(t,e,n,i,23,4),n+4}function G(t,e,n,i,o){return o||U(t,e,n,8,1.7976931348623157e308,-1.7976931348623157e308),$.write(t,e,n,i,52,8),n+8}function Y(t){if(t=z(t).replace(et,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function z(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function H(t){return t<16?"0"+t.toString(16):t.toString(16)}function X(t,e){e=e||1/0;for(var n,i=t.length,o=null,r=[],s=0;s55295&&n<57344){if(!o){if(n>56319){(e-=3)>-1&&r.push(239,191,189);continue}if(s+1===i){(e-=3)>-1&&r.push(239,191,189);continue}o=n;continue}if(n<56320){(e-=3)>-1&&r.push(239,191,189),o=n;continue}n=(o-55296<<10|n-56320)+65536}else o&&(e-=3)>-1&&r.push(239,191,189);if(o=null,n<128){if((e-=1)<0)break;r.push(n)}else if(n<2048){if((e-=2)<0)break;r.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;r.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;r.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return r}function W(t){for(var e=[],n=0;n>8,o=n%256,r.push(o),r.push(i);return r}function q(t){return K.toByteArray(Y(t))}function J(t,e,n,i){for(var o=0;o=e.length||o>=t.length);++o)e[o+n]=t[o];return o}function Z(t){return t!==t}var K=n(28),$=n(37),Q=n(38);e.Buffer=t,e.SlowBuffer=v,e.INSPECT_MAX_BYTES=50,t.TYPED_ARRAY_SUPPORT=void 0!==i.TYPED_ARRAY_SUPPORT?i.TYPED_ARRAY_SUPPORT:o(),e.kMaxLength=r(),t.poolSize=8192,t._augment=function(e){return e.__proto__=t.prototype,e},t.from=function(t,e,n){return a(null,t,e,n)},t.TYPED_ARRAY_SUPPORT&&(t.prototype.__proto__=Uint8Array.prototype,t.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&t[Symbol.species]===t&&Object.defineProperty(t,Symbol.species,{value:null,configurable:!0})),t.alloc=function(t,e,n){return l(null,t,e,n)},t.allocUnsafe=function(t){return c(null,t)},t.allocUnsafeSlow=function(t){return c(null,t)},t.isBuffer=function(t){return!(null==t||!t._isBuffer)},t.compare=function(e,n){if(!t.isBuffer(e)||!t.isBuffer(n))throw new TypeError("Arguments must be Buffers");if(e===n)return 0;for(var i=e.length,o=n.length,r=0,s=Math.min(i,o);r0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),""},t.prototype.compare=function(e,n,i,o,r){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===n&&(n=0),void 0===i&&(i=e?e.length:0),void 0===o&&(o=0),void 0===r&&(r=this.length),n<0||i>e.length||o<0||r>this.length)throw new RangeError("out of range index");if(o>=r&&n>=i)return 0;if(o>=r)return-1;if(n>=i)return 1;if(n>>>=0,i>>>=0,o>>>=0,r>>>=0,this===e)return 0;for(var s=r-o,a=i-n,u=Math.min(s,a),l=this.slice(o,r),c=e.slice(n,i),h=0;ho)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var r=!1;;)switch(i){case"hex":return E(this,t,e,n);case"utf8":case"utf-8":return x(this,t,e,n);case"ascii":return C(this,t,e,n);case"latin1":case"binary":return w(this,t,e,n);case"base64":return j(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,n);default:if(r)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),r=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var tt=4096;t.prototype.slice=function(e,n){var i=this.length;e=~~e,n=void 0===n?i:~~n,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),n<0?(n+=i,n<0&&(n=0)):n>i&&(n=i),n0&&(o*=256);)i+=this[t+--e]*o;return i},t.prototype.readUInt8=function(t,e){return e||L(t,1,this.length),this[t]},t.prototype.readUInt16LE=function(t,e){return e||L(t,2,this.length),this[t]|this[t+1]<<8},t.prototype.readUInt16BE=function(t,e){return e||L(t,2,this.length),this[t]<<8|this[t+1]},t.prototype.readUInt32LE=function(t,e){return e||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},t.prototype.readUInt32BE=function(t,e){return e||L(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},t.prototype.readIntLE=function(t,e,n){t=0|t,e=0|e,n||L(t,e,this.length);for(var i=this[t],o=1,r=0;++r=o&&(i-=Math.pow(2,8*e)),i},t.prototype.readIntBE=function(t,e,n){t=0|t,e=0|e,n||L(t,e,this.length);for(var i=e,o=1,r=this[t+--i];i>0&&(o*=256);)r+=this[t+--i]*o;return o*=128,r>=o&&(r-=Math.pow(2,8*e)),r},t.prototype.readInt8=function(t,e){return e||L(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},t.prototype.readInt16LE=function(t,e){e||L(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},t.prototype.readInt16BE=function(t,e){e||L(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},t.prototype.readInt32LE=function(t,e){return e||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},t.prototype.readInt32BE=function(t,e){return e||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},t.prototype.readFloatLE=function(t,e){return e||L(t,4,this.length),$.read(this,t,!0,23,4)},t.prototype.readFloatBE=function(t,e){return e||L(t,4,this.length),$.read(this,t,!1,23,4)},t.prototype.readDoubleLE=function(t,e){return e||L(t,8,this.length),$.read(this,t,!0,52,8)},t.prototype.readDoubleBE=function(t,e){return e||L(t,8,this.length),$.read(this,t,!1,52,8)},t.prototype.writeUIntLE=function(t,e,n,i){if(t=+t,e=0|e,n=0|n,!i){var o=Math.pow(2,8*n)-1;R(this,t,e,n,o,0)}var r=1,s=0;for(this[e]=255&t;++s=0&&(s*=256);)this[e+r]=t/s&255;return e+n},t.prototype.writeUInt8=function(e,n,i){return e=+e,n=0|n,i||R(this,e,n,1,255,0),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[n]=255&e,n+1},t.prototype.writeUInt16LE=function(e,n,i){return e=+e,n=0|n,i||R(this,e,n,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[n]=255&e,this[n+1]=e>>>8):N(this,e,n,!0),n+2},t.prototype.writeUInt16BE=function(e,n,i){return e=+e,n=0|n,i||R(this,e,n,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[n]=e>>>8,this[n+1]=255&e):N(this,e,n,!1),n+2},t.prototype.writeUInt32LE=function(e,n,i){return e=+e,n=0|n,i||R(this,e,n,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[n+3]=e>>>24,this[n+2]=e>>>16,this[n+1]=e>>>8,this[n]=255&e):B(this,e,n,!0),n+4},t.prototype.writeUInt32BE=function(e,n,i){return e=+e,n=0|n,i||R(this,e,n,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[n]=e>>>24,this[n+1]=e>>>16,this[n+2]=e>>>8,this[n+3]=255&e):B(this,e,n,!1),n+4},t.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e=0|e,!i){var o=Math.pow(2,8*n-1);R(this,t,e,n,o-1,-o)}var r=0,s=1,a=0;for(this[e]=255&t;++r>0)-a&255;return e+n},t.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e=0|e,!i){var o=Math.pow(2,8*n-1);R(this,t,e,n,o-1,-o)}var r=n-1,s=1,a=0;for(this[e+r]=255&t;--r>=0&&(s*=256);)t<0&&0===a&&0!==this[e+r+1]&&(a=1),this[e+r]=(t/s>>0)-a&255;return e+n},t.prototype.writeInt8=function(e,n,i){return e=+e,n=0|n,i||R(this,e,n,1,127,-128),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[n]=255&e,n+1},t.prototype.writeInt16LE=function(e,n,i){return e=+e,n=0|n,i||R(this,e,n,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[n]=255&e,this[n+1]=e>>>8):N(this,e,n,!0),n+2},t.prototype.writeInt16BE=function(e,n,i){return e=+e,n=0|n,i||R(this,e,n,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[n]=e>>>8,this[n+1]=255&e):N(this,e,n,!1),n+2},t.prototype.writeInt32LE=function(e,n,i){return e=+e,n=0|n,i||R(this,e,n,4,2147483647,-2147483648),t.TYPED_ARRAY_SUPPORT?(this[n]=255&e,this[n+1]=e>>>8,this[n+2]=e>>>16,this[n+3]=e>>>24):B(this,e,n,!0),n+4},t.prototype.writeInt32BE=function(e,n,i){return e=+e,n=0|n,i||R(this,e,n,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),t.TYPED_ARRAY_SUPPORT?(this[n]=e>>>24,this[n+1]=e>>>16,this[n+2]=e>>>8,this[n+3]=255&e):B(this,e,n,!1),n+4},t.prototype.writeFloatLE=function(t,e,n){return F(this,t,e,!0,n)},t.prototype.writeFloatBE=function(t,e,n){return F(this,t,e,!1,n)},t.prototype.writeDoubleLE=function(t,e,n){return G(this,t,e,!0,n)},t.prototype.writeDoubleBE=function(t,e,n){return G(this,t,e,!1,n)},t.prototype.copy=function(e,n,i,o){if(i||(i=0),o||0===o||(o=this.length),n>=e.length&&(n=e.length),n||(n=0),o>0&&o=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),e.length-n=0;--r)e[r+n]=this[r+i];else if(s<1e3||!t.TYPED_ARRAY_SUPPORT)for(r=0;r>>=0,i=void 0===i?this.length:i>>>0,e||(e=0);var s;if("number"==typeof e)for(s=n;s>>((3&e)<<3)&255;return i},"undefined"!=typeof console&&console.warn&&console.warn("[SECURITY] node-uuid: crypto not usable, falling back to insecure Math.random()")}}function a(){try{var t=n(31).randomBytes;p=d=t&&function(){return t(16)},d()}catch(e){}}function u(t,e,n){var i=e&&n||0,o=0;for(e=e||[],t.toLowerCase().replace(/[0-9a-f]{2}/g,function(t){o<16&&(e[i+o++]=y[t])});o<16;)e[i+o++]=0;return e}function l(t,e){var n=e||0,i=m;return i[t[n++]]+i[t[n++]]+i[t[n++]]+i[t[n++]]+"-"+i[t[n++]]+i[t[n++]]+"-"+i[t[n++]]+i[t[n++]]+"-"+i[t[n++]]+i[t[n++]]+"-"+i[t[n++]]+i[t[n++]]+i[t[n++]]+i[t[n++]]+i[t[n++]]+i[t[n++]]}function c(t,e,n){var i=e&&n||0,o=e||[];t=t||{};var r=null!=t.clockseq?t.clockseq:E,s=null!=t.msecs?t.msecs:(new Date).getTime(),a=null!=t.nsecs?t.nsecs:C+1,u=s-x+(a-C)/1e4;if(u<0&&null==t.clockseq&&(r=r+1&16383),(u<0||s>x)&&null==t.nsecs&&(a=0),a>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");x=s,C=a,E=r,s+=122192928e5;var c=(1e4*(268435455&s)+a)%4294967296;o[i++]=c>>>24&255,o[i++]=c>>>16&255,o[i++]=c>>>8&255,o[i++]=255&c;var h=s/4294967296*1e4&268435455;o[i++]=h>>>8&255,o[i++]=255&h,o[i++]=h>>>24&15|16,o[i++]=h>>>16&255,o[i++]=r>>>8|128,o[i++]=255&r;for(var d=t.node||P,f=0;f<6;f++)o[i+f]=d[f];return e?e:l(o)}function h(t,e,n){var i=e&&n||0;"string"==typeof t&&(e="binary"===t?new v(16):null,t=null),t=t||{};var o=t.random||(t.rng||d)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e)for(var r=0;r<16;r++)e[i+r]=o[r];return e||l(o)}var d,f,p,g;r?s():a();for(var v="function"==typeof o?o:Array,m=[],y={},b=0;b<256;b++)m[b]=(b+256).toString(16).substr(1),y[m[b]]=b;var _=d(),P=[1|_[0],_[1],_[2],_[3],_[4],_[5]],E=16383&(_[6]<<8|_[7]),x=0,C=0,w=h;w.v1=c,w.v4=h,w.parse=u,w.unparse=l,w.BufferClass=v,w._rng=d,w._mathRNG=f,w._nodeRNG=p,w._whatwgRNG=g,"undefined"!=typeof t&&t.exports?t.exports=w:(i=function(){return w}.call(e,n,e,t),!(void 0!==i&&(t.exports=i)))}("undefined"!=typeof window?window:null)}).call(e,n(1).Buffer)},function(t,e){function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function o(t){if(c===setTimeout)return setTimeout(t,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(t,0);try{return c(t,0)}catch(e){try{return c.call(null,t,0)}catch(e){return c.call(this,t,0)}}}function r(t){if(h===clearTimeout)return clearTimeout(t);if((h===i||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(t);try{return h(t)}catch(e){try{return h.call(null,t)}catch(e){return h.call(this,t)}}}function s(){g&&f&&(g=!1,f.length?p=f.concat(p):v=-1,p.length&&a())}function a(){if(!g){var t=o(s);g=!0;for(var e=p.length;e;){for(f=p,p=[];++v1)for(var n=1;n=3&&(i.depth=arguments[2]),arguments.length>=4&&(i.colors=arguments[3]),g(n)?i.showHidden=n:n&&e._extend(i,n),P(i.showHidden)&&(i.showHidden=!1),P(i.depth)&&(i.depth=2),P(i.colors)&&(i.colors=!1),P(i.customInspect)&&(i.customInspect=!0),i.colors&&(i.stylize=r),u(i,t,i.depth)}function r(t,e){var n=o.styles[e];return n?"["+o.colors[n][0]+"m"+t+"["+o.colors[n][1]+"m":t}function s(t,e){return t}function a(t){var e={};return t.forEach(function(t,n){e[t]=!0}),e}function u(t,n,i){if(t.customInspect&&n&&j(n.inspect)&&n.inspect!==e.inspect&&(!n.constructor||n.constructor.prototype!==n)){var o=n.inspect(i,t);return b(o)||(o=u(t,o,i)),o}var r=l(t,n);if(r)return r;var s=Object.keys(n),g=a(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(n)),w(n)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return c(n);if(0===s.length){if(j(n)){var v=n.name?": "+n.name:"";return t.stylize("[Function"+v+"]","special")}if(E(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(C(n))return t.stylize(Date.prototype.toString.call(n),"date");if(w(n))return c(n)}var m="",y=!1,_=["{","}"]; +if(p(n)&&(y=!0,_=["[","]"]),j(n)){var P=n.name?": "+n.name:"";m=" [Function"+P+"]"}if(E(n)&&(m=" "+RegExp.prototype.toString.call(n)),C(n)&&(m=" "+Date.prototype.toUTCString.call(n)),w(n)&&(m=" "+c(n)),0===s.length&&(!y||0==n.length))return _[0]+m+_[1];if(i<0)return E(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special");t.seen.push(n);var x;return x=y?h(t,n,i,g,s):s.map(function(e){return d(t,n,i,g,e,y)}),t.seen.pop(),f(x,m,_)}function l(t,e){if(P(e))return t.stylize("undefined","undefined");if(b(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}return y(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):v(e)?t.stylize("null","null"):void 0}function c(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,n,i,o){for(var r=[],s=0,a=e.length;s-1&&(a=r?a.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+a.split("\n").map(function(t){return" "+t}).join("\n"))):a=t.stylize("[Circular]","special")),P(s)){if(r&&o.match(/^\d+$/))return a;s=JSON.stringify(""+o),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function f(t,e,n){var i=0,o=t.reduce(function(t,e){return i++,e.indexOf("\n")>=0&&i++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return o>60?n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1]:n[0]+e+" "+t.join(", ")+" "+n[1]}function p(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function v(t){return null===t}function m(t){return null==t}function y(t){return"number"==typeof t}function b(t){return"string"==typeof t}function _(t){return"symbol"==typeof t}function P(t){return void 0===t}function E(t){return x(t)&&"[object RegExp]"===D(t)}function x(t){return"object"==typeof t&&null!==t}function C(t){return x(t)&&"[object Date]"===D(t)}function w(t){return x(t)&&("[object Error]"===D(t)||t instanceof Error)}function j(t){return"function"==typeof t}function S(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function D(t){return Object.prototype.toString.call(t)}function A(t){return t<10?"0"+t.toString(10):t.toString(10)}function I(){var t=new Date,e=[A(t.getHours()),A(t.getMinutes()),A(t.getSeconds())].join(":");return[t.getDate(),L[t.getMonth()],e].join(" ")}function O(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var k=/%[sdj%]/g;e.format=function(t){if(!b(t)){for(var e=[],n=0;n=r)return t;switch(t){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":try{return JSON.stringify(i[n++])}catch(e){return"[Circular]"}default:return t}}),a=i[n];n=0&&b.splice(e,1)}function a(t){var e=document.createElement("style");return e.type="text/css",r(t,e),e}function u(t){var e=document.createElement("link");return e.rel="stylesheet",r(t,e),e}function l(t,e){var n,i,o;if(e.singleton){var r=y++;n=m||(m=a(e)),i=c.bind(null,n,r,!1),o=c.bind(null,n,r,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=u(e),i=d.bind(null,n),o=function(){s(n),n.href&&URL.revokeObjectURL(n.href)}):(n=a(e),i=h.bind(null,n),o=function(){s(n)});return i(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;i(t=e)}else o()}}function c(t,e,n,i){var o=n?"":i.css;if(t.styleSheet)t.styleSheet.cssText=_(e,o);else{var r=document.createTextNode(o),s=t.childNodes;s[e]&&t.removeChild(s[e]),s.length?t.insertBefore(r,s[e]):t.appendChild(r)}}function h(t,e){var n=e.css,i=e.media;if(i&&t.setAttribute("media",i),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}function d(t,e){var n=e.css,i=e.sourceMap;i&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var o=new Blob([n],{type:"text/css"}),r=t.href;t.href=URL.createObjectURL(o),r&&URL.revokeObjectURL(r)}var f={},p=function(t){var e;return function(){return"undefined"==typeof e&&(e=t.apply(this,arguments)),e}},g=p(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),v=p(function(){return document.head||document.getElementsByTagName("head")[0]}),m=null,y=0,b=[];t.exports=function(t,e){e=e||{},"undefined"==typeof e.singleton&&(e.singleton=g()),"undefined"==typeof e.insertAt&&(e.insertAt="bottom");var n=o(t);return i(n,e),function(t){for(var r=[],s=0;s0&&void 0!==arguments[0]&&arguments[0],e={transformSource:{},transformSink:{}};return e=t?{"default":l,commonSettings:(0,s["default"])(f,d),source:(0,s["default"])(p,d),sink:(0,s["default"])(g,d),transformSource:{},transformSink:{}}:{"default":l,commonSettings:(0,s["default"])(f,h),source:(0,s["default"])(p,h),sink:(0,s["default"])(g,h),transformSource:{},transformSink:{}},e.transformSource=(0,u["default"])(e.source),e.transformSink=(0,u["default"])(e.sink),e.transformSource.anchor=[.5,1,1,0,26,-43,"transformAnchor"],e.transformSink.anchor=[.5,1,-1,0,-26,-43,"transformAnchor"],e}Object.defineProperty(e,"__esModule",{value:!0}),e.sinkSettings=e.sourceSettings=e.commonSettings=e.disabledConnectorOverlays=e.connectorOverlays=e.connectorStyle=e.defaultSettings=void 0,e.getSettings=o;var r=n(72),s=i(r),a=n(71),u=i(a),l=e.defaultSettings={Connector:["Flowchart",{gap:6,stub:[10,15],alwaysRespectStubs:!0}],ConnectionsDetachable:!0},c=e.connectorStyle={stroke:"black",strokeWidth:2,radius:5,lineWidth:2},h=e.connectorOverlays={connectorOverlays:[["Arrow",{location:1,length:12,width:12,height:10,foldback:1}]]},d=e.disabledConnectorOverlays={connectorOverlays:[["Arrow",{location:1,length:12,width:12,height:10,foldback:1}]]},f=e.commonSettings={endpoint:"Dot",maxConnections:-1,paintStyle:{stroke:"black",fill:"black",radius:5,lineWidth:3},anchors:["Static"]},p=e.sourceSettings=(0,s["default"])({isSource:!0,connectorStyle:c,anchor:[.5,1,1,0,26,-43,"sourceAnchor"]},f),g=e.sinkSettings=(0,s["default"])({isTarget:!0,anchor:[.5,1,-1,0,-26,-43,"sinkAnchor"],connectorStyle:c},f)},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function o(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e2&&void 0!==arguments[2]?arguments[2]:[],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=(0,s.createStore)(p(e),t,s.compose.apply(null,[s.applyMiddleware.apply(null,n)].concat(i.map(function(t){return t()}))));return o}Object.defineProperty(e,"__esModule",{value:!0}),e.STOREACTIONS=void 0,e["default"]=r;var s=n(83),a=n(5),u=i(a),l={ADDNODE:"ADD_NODE",UPDATENODE:"UPDATE_NODE",REMOVENODE:"REMOVE_NODE",ADDCONNECTION:"ADD_CONNECTIONS",SETCONNECTIONS:"SET_CONNECTIONS",RESET:"RESET",GRAPHLOADING:"GRAPHLOADING"};e.STOREACTIONS=l;var c=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(e.type){case l.ADDNODE:return[].concat(o(t),[{id:u["default"].v4(),label:e.payload.label,type:e.payload.type}]);case l.UPDATENODE:return t.map(function(t){return t.id===e.payload.nodeId?(t.style=e.payload.style,t):t});case l.REMOVENODE:return t.filter(function(t){return t.id!==e.payload.nodeId});case l.RESET:return[];default:return t}},h=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(e.type){case l.ADDCONNECTION:return[].concat(o(t),[{from:e.connection.from,to:e.connection.to}]);case l.SETCONNECTIONS:return[].concat(o(e.payload.connections));case l.RESET:return[];default:return t}},d=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(e.type){case l.GRAPHLOADING:return Object.assign({},t,{loading:e.payload.loading});case l.RESET:return{};default:return t}},f=function(){return{nodes:[function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t}],graph:[function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t}],connections:[function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t}]}},p=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f(),e=f(),n=function(t,e,n){return Array.isArray(t[e])&&t[e].length>0?t[e]:n[e]},i=[c].concat(n(t,"nodes",e)),o=[d].concat(n(t,"graph",e)),r=[h].concat(n(t,"connections",e)),a=function(t,e,n){return t.length>1?t.reduce(function(t,i){return i.bind(null,t(e,n),n)})():t[0]()};return(0,s.combineReducers)({nodes:function(t,e){return a(i,t,e)},connections:function(t,e){return a(r,t,e)},graph:function(t,e){return a(o,t,e)}})}},function(t,e){"use strict";function n(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function i(t){return 3*t.length/4-n(t)}function o(t){var e,i,o,r,s,a,u=t.length;s=n(t),a=new c(3*u/4-s),o=s>0?u-4:u;var h=0;for(e=0,i=0;e>16&255,a[h++]=r>>8&255,a[h++]=255&r;return 2===s?(r=l[t.charCodeAt(e)]<<2|l[t.charCodeAt(e+1)]>>4,a[h++]=255&r):1===s&&(r=l[t.charCodeAt(e)]<<10|l[t.charCodeAt(e+1)]<<4|l[t.charCodeAt(e+2)]>>2,a[h++]=r>>8&255,a[h++]=255&r),a}function r(t){return u[t>>18&63]+u[t>>12&63]+u[t>>6&63]+u[63&t]}function s(t,e,n){for(var i,o=[],s=e;sc?c:l+a));return 1===i?(e=t[n-1],o+=u[e>>2],o+=u[e<<4&63],o+="=="):2===i&&(e=(t[n-2]<<8)+t[n-1],o+=u[e>>10],o+=u[e>>4&63],o+=u[e<<2&63],o+="="),r.push(o),r.join("")}e.byteLength=i,e.toByteArray=o,e.fromByteArray=a;for(var u=[],l=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,f=h.length;ds?n=o(t).update(n).digest():n.length>5]|=128<>>9<<4)+14]=e;for(var n=1732584193,i=-271733879,o=-1732584194,c=271733878,h=0;h>16)+(e>>16)+(n>>16);return i<<16|65535&n}function c(t,e){return t<>>32-e}var h=n(30);t.exports=function(t){return h.hash(t,i,16)}},function(t,e,n){var i=n(79);t.exports=function(t,e){e=e||{};var n=i(t);return e.pbkdf2=n.pbkdf2,e.pbkdf2Sync=n.pbkdf2Sync,e}},function(t,e,n){(function(e,i){!function(){var o=("undefined"==typeof window?e:window)||{};_crypto=o.crypto||o.msCrypto||n(97),t.exports=function(t){if(_crypto.getRandomValues){var e=new i(t);return _crypto.getRandomValues(e),e}if(_crypto.randomBytes)return _crypto.randomBytes(t);throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}}()}).call(e,function(){return this}(),n(1).Buffer)},function(t,e,n){e=t.exports=n(11)(),e.push([t.id,".node .dag-node{position:relative}.node .dag-node .close-btn{cursor:pointer;position:absolute;top:-3px;right:3px}",""])},function(t,e,n){e=t.exports=n(11)(),e.push([t.id,".react-dag{display:block}.react-dag .jtk-endpoint svg{overflow:visible}.react-dag .jtk-endpoint circle{fill:#fff;r:2px;stroke-width:8px}.react-dag .jtk-endpoint-anchor-sourceAnchor circle{stroke:green}.react-dag .jtk-endpoint-anchor-transformAnchor circle{stroke:purple}.react-dag .jtk-endpoint-anchor-sinkAnchor circle{stroke:orange}.react-dag .diagram-container{position:relative;width:100%;height:80vh;background:#eee;overflow:hidden}.react-dag .diagram-container #dag-container{height:inherit;width:inherit;position:absolute;transform-origin:left center}.react-dag .diagram-container #dag-container .node{position:absolute;height:66px;width:105px;cursor:pointer}.react-dag .diagram-container #dag-container .node .dag-node{margin:0 auto;background-clip:border-box;height:46px;width:56px;border-radius:5px}.react-dag .diagram-container #dag-container .node .dag-node.source{border:2px solid green}.react-dag .diagram-container #dag-container .node .dag-node.source~.label{color:green}.react-dag .diagram-container #dag-container .node .dag-node.transform{border:2px solid purple}.react-dag .diagram-container #dag-container .node .dag-node.transform~.label{color:purple}.react-dag .diagram-container #dag-container .node .dag-node.sink{border:2px solid orange}.react-dag .diagram-container #dag-container .node .dag-node.sink~.label{color:orange}.react-dag .diagram-container #dag-container .node .label{font-size:12px}.react-dag .fa.fa-spin.fa-refresh{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}",""])},function(t,e){e.read=function(t,e,n,i,o){var r,s,a=8*o-i-1,u=(1<>1,c=-7,h=n?o-1:0,d=n?-1:1,f=t[e+h];for(h+=d,r=f&(1<<-c)-1,f>>=-c,c+=a;c>0;r=256*r+t[e+h],h+=d,c-=8);for(s=r&(1<<-c)-1,r>>=-c,c+=i;c>0;s=256*s+t[e+h],h+=d,c-=8);if(0===r)r=1-l;else{if(r===u)return s?NaN:(f?-1:1)*(1/0);s+=Math.pow(2,i),r-=l}return(f?-1:1)*s*Math.pow(2,r-i)},e.write=function(t,e,n,i,o,r){var s,a,u,l=8*r-o-1,c=(1<>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:r-1,p=i?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),e+=s+h>=1?d/u:d*Math.pow(2,1-h),e*u>=2&&(s++,u/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(e*u-1)*Math.pow(2,o),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,o),s=0));o>=8;t[n+f]=255&a,f+=p,a/=256,o-=8);for(s=s<0;t[n+f]=255&s,f+=p,s/=256,l-=8);t[n+f-p]|=128*g}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){var i,o;(function(){"undefined"==typeof Math.sgn&&(Math.sgn=function(t){return 0==t?0:t>0?1:-1});var t={subtract:function(t,e){return{x:t.x-e.x,y:t.y-e.y}},dotProduct:function(t,e){return t.x*e.x+t.y*e.y},square:function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},scale:function(t,e){return{x:t.x*e,y:t.y*e}}},e=64,n=Math.pow(2,-e-1),i=function(e,n){for(var i=[],o=r(e,n),a=n.length-1,u=2*a-1,l=s(o,u,i,0),h=t.subtract(e,n[0]),d=t.square(h),f=0,p=0;p=e)return i[0]=(t[0].x+t[n].x)/2,1;if(u(t,n))return i[0]=l(t,n),1}c(t,n,.5,d,f),r=s(d,n,p,o+1),h=s(f,n,g,o+1);for(var v=0;vb?b=P:P0?1:-1,a=null;o1&&(i.location=1),i.location<0&&(i.location=0),_(t,i.location)},E=function(t,e,n,i){i=null==i?0:i;var o=v(t,e,i),r=_(t,o.location),s=Math.atan(-1/r),a=n/2*Math.sin(s),u=n/2*Math.cos(s);return[{x:o.point.x+u,y:o.point.y+a},{x:o.point.x-u,y:o.point.y-a}]};this.jsBezier={distanceFromCurve:i,gradientAtPoint:_,gradientAtPointAlongCurveFrom:P,nearestPointOnCurve:o,pointOnCurve:f,pointAlongCurveFrom:y,perpendicularToCurveAt:E,locationAlongCurveFrom:b,getLength:m}}).call("undefined"!=typeof window?window:this),function(){"use strict";var t=this,e=t.Biltong={},n=function(t){return"[object Array]"===Object.prototype.toString.call(t)},i=function(t,e,i){return t=n(t)?t:[t.x,t.y],e=n(e)?e:[e.x,e.y],i(t,e)},o=e.gradient=function(t,e){return i(t,e,function(t,e){return e[0]==t[0]?e[1]>t[1]?1/0:-(1/0):e[1]==t[1]?e[0]>t[0]?0:-0:(e[1]-t[1])/(e[0]-t[0])})},r=(e.normal=function(t,e){return-1/o(t,e)},e.lineLength=function(t,e){return i(t,e,function(t,e){return Math.sqrt(Math.pow(e[1]-t[1],2)+Math.pow(e[0]-t[0],2))})},e.quadrant=function(t,e){return i(t,e,function(t,e){return e[0]>t[0]?e[1]>t[1]?2:1:e[0]==t[0]?e[1]>t[1]?2:1:e[1]>t[1]?3:4})}),s=(e.theta=function(t,e){return i(t,e,function(t,e){var n=o(t,e),i=Math.atan(n),s=r(t,e);return 4!=s&&3!=s||(i+=Math.PI),i<0&&(i+=2*Math.PI),i})},e.intersects=function(t,e){var n=t.x,i=t.x+t.w,o=t.y,r=t.y+t.h,s=e.x,a=e.x+e.w,u=e.y,l=e.y+e.h;return n<=s&&s<=i&&o<=u&&u<=r||n<=a&&a<=i&&o<=u&&u<=r||n<=s&&s<=i&&o<=l&&l<=r||n<=a&&s<=i&&o<=l&&l<=r||s<=n&&n<=a&&u<=o&&o<=l||s<=i&&i<=a&&u<=o&&o<=l||s<=n&&n<=a&&u<=r&&r<=l||s<=i&&n<=a&&u<=r&&r<=l},e.encloses=function(t,e,n){var i=t.x,o=t.x+t.w,r=t.y,s=t.y+t.h,a=e.x,u=e.x+e.w,l=e.y,c=e.y+e.h,h=function(t,e,i,o){return n?t<=e&&i>=o:to};return h(i,a,o,u)&&h(r,l,s,c)},[null,[1,-1],[1,1],[-1,1],[-1,-1]]),a=[null,[-1,-1],[-1,1],[1,1],[1,-1]];e.pointOnLine=function(t,e,n){var i=o(t,e),u=r(t,e),l=n>0?s[u]:a[u],c=Math.atan(i),h=Math.abs(n*Math.sin(c))*l[1],d=Math.abs(n*Math.cos(c))*l[0];return{x:t.x+d,y:t.y+h}},e.perpendicularLineTo=function(t,e,n){var i=o(t,e),r=Math.atan(-1/i),s=n/2*Math.sin(r),a=n/2*Math.cos(r);return[{x:e.x+a,y:e.y+s},{x:e.x-a,y:e.y-s}]}}.call("undefined"!=typeof window?window:this),function(){"use strict";var t=this,e={android:navigator.userAgent.toLowerCase().indexOf("android")>-1},n=function(t,e,n){n=n||t.parentNode;for(var i=n.querySelectorAll(e),o=0;o-1&&P<9,x=function(t,e){if(null==t)return[0,0];var n=D(t),i=S(n,0);return[i[e+"X"],i[e+"Y"]]},C=function(t){return null==t?[0,0]:E?[t.clientX+document.documentElement.scrollLeft,t.clientY+document.documentElement.scrollTop]:x(t,"page")},w=function(t){return x(t,"screen")},j=function(t){return x(t,"client")},S=function(t,e){return t.item?t.item(e):t[e]},D=function(t){return t.touches&&t.touches.length>0?t.touches:t.changedTouches&&t.changedTouches.length>0?t.changedTouches:t.targetTouches&&t.targetTouches.length>0?t.targetTouches:[t]},A=function(t){return D(t).length},I=function(t,e,n,i){if(u(t,e,n),i.__tauid=n.__tauid,t.addEventListener)t.addEventListener(e,n,!1);else if(t.attachEvent){var o=e+n.__tauid;t["e"+o]=n,t[o]=function(){t["e"+o]&&t["e"+o](window.event)},t.attachEvent("on"+e,t[o])}},O=function(t,e,n){null!=n&&k(t,function(){var o=i(this);if(l(o,e,n),null!=n.__tauid)if(o.removeEventListener)o.removeEventListener(e,n,!1),y&&_[e]&&o.removeEventListener(_[e],n,!1);else if(this.detachEvent){var r=e+n.__tauid;o[r]&&o.detachEvent("on"+e,o[r]),o[r]=null,o["e"+r]=null}n.__taTouchProxy&&O(t,n.__taTouchProxy[1],n.__taTouchProxy[0])})},k=function(t,e){if(null!=t){t="undefined"!=typeof Window&&"unknown"!=typeof t.top&&t==t.top?[t]:"string"!=typeof t&&null==t.tagName&&null!=t.length?t:"string"==typeof t?document.querySelectorAll(t):[t];for(var n=0;n-1&&a<9,h=9==a,d=function(t){if(c)return[t.clientX+document.documentElement.scrollLeft,t.clientY+document.documentElement.scrollTop];var e=p(t),n=f(e,0);return h?[n.pageX||n.clientX,n.pageY||n.clientY]:[n.pageX,n.pageY]},f=function(t,e){return t.item?t.item(e):t[e]},p=function(t){return t.touches&&t.touches.length>0?t.touches:t.changedTouches&&t.changedTouches.length>0?t.changedTouches:t.targetTouches&&t.targetTouches.length>0?t.targetTouches:[t]},g={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",ghostProxy:"katavorio-ghost-proxy"},v="katavorio-drag-scope",m=["stop","start","drag","drop","over","out","beforeStart"],y=function(){},b=function(){return!0},_=function(t,e,n){for(var i=0;i1)for(var r=0;r0&&V&&e.setPosition(this.el,V);for(var o=0;o0},c=(this.getMatchingDroppables=function(t){for(var e=[],n={},i=0;i=0&&r.splice(i,1),l(t[e],n)&&E(t[e],function(t){t.destroy()}),delete t[e]}};this.elementRemoved=function(t){this.destroyDraggable(t),this.destroyDroppable(t)},this.destroyDraggable=function(t){j(t,"_katavorioDrag",this._dragsByScope)},this.destroyDroppable=function(t){j(t,"_katavorioDrop",this._dropsByScope)},this.reset=function(){this._dragsByScope={},this._dropsByScope={},r=[],s={},S={}};var S={},D=function(t,n,i){var r=o(n)?n:n.id,s=!!o(n)||n.active!==!1,a=S[r]||function(){var t={name:r,members:[]};return S[r]=t,t}();return E(t,function(t){if(t._katavorioDrag){if(i&&null!=t._katavorioDrag.posseRoles[a.name])return;e(a.members,t._katavorioDrag),e(t._katavorioDrag.posses,a.name),t._katavorioDrag.posseRoles[a.name]=s}}),a};this.addToPosse=function(t,e){for(var n=[],i=1;i=r.length,u=function(){return o[s[1]]||function(){return o[s[1]]=[],o[s[1]]}()};if(a)s?u()[s[3]]=n:o[t]=n;else if(s){var l=u();o=l[s[3]]||function(){return l[s[3]]={},l[s[3]]}()}else o=o[t]||function(){return o[t]={},o[t]}()}),t}},functionChain:function(t,e,n){for(var i=0;i-1&&t.splice(n,1),n!=-1},remove:function(t,e){var n=t.indexOf(e);return n>-1&&t.splice(n,1),n!=-1},addWithFunction:function(t,e,n){c.jsPlumbUtil.findWithFunction(t,n)==-1&&t.push(e)},addToList:function(t,e,n,i){ +var o=t[e];return null==o&&(o=[],t[e]=o),o[i?"unshift":"push"](n),o},suggest:function(t,e,n){return t.indexOf(e)===-1&&(n?t.unshift(e):t.push(e),!0)},extend:function(e,n,i){var o;for(n=t(n)?n:[n],o=0;o2)for(o=2;o0)for(var t=0;t0){var r=Array.prototype.slice.call(arguments,1);try{for(var s=0,u=i.length;s0?t.indexOf(e)!=-1:!n)};this.getConnections=function(t,n){t?t.constructor==String&&(t={scope:t}):t={};for(var i=t.scope||e.getDefaultScope(),o=st(i,!0),r=st(t.source),s=st(t.target),a=!n&&o.length>1?{}:[],u=function(t,e){if(!n&&o.length>1){var i=a[t];null==i&&(i=a[t]=[]),i.push(e)}else a.push(e)},l=0,c=E.length;l0&&!g.isSource,m=d&&o.length>0&&!g.isTarget;if(v||m)continue t;s.push(g)}}}return dt(s)},this.getAllConnections=function(){return E},this.getDefaultScope=function(){return T},this.getEndpoint=B,this.getEndpoints=function(t){return x[d(t).id]},this.getDefaultEndpointType=function(){return P.Endpoint},this.getDefaultConnectionType=function(){return P.Connection},this.getId=K,this.appendElement=R;var ft=!1;this.isHoverSuspended=function(){return ft},this.setHoverSuspended=function(t){ft=t},this.hide=function(t,n){return V(t,"none",n),e},this.idstamp=L,this.connectorsInitialized=!1,this.registerConnectorType=function(t,e){s.push([t,e])};var pt=function(t){if(!g&&t){var n=e.getElement(t);n.offsetParent&&e.setContainer(n.offsetParent)}},gt=function(){e.Defaults.Container&&e.setContainer(e.Defaults.Container)},vt=e.manage=function(t,n,i){return w[t]||(w[t]={el:n,endpoints:[],connections:[]},w[t].info=mt({elId:t,timestamp:k}),i||e.fire("manageElement",{id:t,info:w[t].info,el:n})),w[t]},mt=this.updateOffset=function(t){var n,i=t.timestamp,o=t.recalc,r=t.offset,s=t.elId;return O&&!i&&(i=k),!o&&i&&i===S[s]?{o:t.offset||j[s],s:I[s]}:(o||!r&&null==j[s]?(n=w[s]?w[s].el:null,null!=n&&(I[s]=e.getSize(n),j[s]=e.getOffset(n),S[s]=i)):(j[s]=r||j[s],null==I[s]&&(n=w[s].el,null!=n&&(I[s]=e.getSize(n))),S[s]=i),j[s]&&!j[s].right&&(j[s].right=j[s].left+I[s][0],j[s].bottom=j[s].top+I[s][1],j[s].width=I[s][0],j[s].height=I[s][1],j[s].centerx=j[s].left+j[s].width/2,j[s].centery=j[s].top+j[s].height/2),{o:j[s],s:I[s]})};this.init=function(){n=r.jsPlumb.getRenderModes();var t=function(t,e,n){r.jsPlumb.Connectors[t][e]=function(){n.apply(this,arguments),r.jsPlumb.ConnectorRenderers[t].apply(this,arguments)},a.extend(r.jsPlumb.Connectors[t][e],[n,r.jsPlumb.ConnectorRenderers[t]])};if(!r.jsPlumb.connectorsInitialized){for(var i=0;i=4?[i[2],i[3]]:[0,0],offsets:i.length>=6?[i[4],i[5]]:[0,0],elementId:o,jsPlumbInstance:e,cssClass:7==i.length?i[6]:null};s=new r.jsPlumb.Anchor(u),s.clone=function(){return new r.jsPlumb.Anchor(u)}}return s.id||(s.id="anchor_"+L()),s},this.makeAnchors=function(t,n,i){for(var o=[],s=0,u=t.length;s0&&n>=t.def.maxConnections},element:t.el,elementId:t.id,isSource:o,isTarget:s,addClass:function(n){e.addClass(t.el,n)},removeClass:function(n){e.removeClass(t.el,n)},onDrop:function(t){var e=t.endpoints[0];e.anchor.locked=!1},isDropAllowed:function(){return u.isDropAllowed.apply(u,arguments)},isRedrop:function(e){return null!=e.suspendedElement&&null!=e.suspendedEndpoint&&e.suspendedEndpoint.element===t.el},getEndpoint:function(i){var o=t.def.endpoint;if(null==o||null==o._jsPlumb){var s=e.deriveEndpointAndAnchorSpec(i.getType().join(" "),!0),a=s.endpoints?r.jsPlumb.extend(n,{endpoint:t.def.def.endpoint||s.endpoints[1]}):n;s.anchors&&(a=r.jsPlumb.extend(a,{anchor:t.def.def.anchor||s.anchors[1]})),o=e.addEndpoint(t.el,a),o._mtNew=!0}if(n.uniqueEndpoint&&(t.def.endpoint=o),o._doNotDeleteOnDetach=!1,o._deleteOnDetach=!0,i.isDetachable()&&o.initDraggable(),null!=o.anchor.positionFinder){var u=e.getUIPosition(arguments,e.getZoom()),l=e.getOffset(t.el),c=e.getSize(t.el),h=null==u?[0,0]:o.anchor.positionFinder(u,l,c,o.anchor.constructorParams);o.anchor.x=h[0],o.anchor.y=h[1]}return o},maybeCleanup:function(t){t._mtNew&&0===t.connections.length?e.deleteObject({endpoint:t}):delete t._mtNew}}),c=r.jsPlumb.dragEvents.drop;return i.scope=i.scope||n.scope||e.Defaults.Scope,i[c]=a.wrap(i[c],l,!0),s&&(i[r.jsPlumb.dragEvents.over]=function(){return!0}),n.allowLoopback===!1&&(i.canDrop=function(e){var n=e.getDragElement()._jsPlumbRelatedElement;return n!=t.el}),e.initDroppable(t.el,i,"internal"),l};this.makeTarget=function(t,e,n){var i=r.jsPlumb.extend({_jsPlumb:this},n);r.jsPlumb.extend(i,e),yt(i,1,this);for(var o=(!(i.deleteEndpointsOnDetach===!1),i.maxConnections||-1),s=function(t){var e=d(t),n=e.id,s=r.jsPlumb.extend({},i.dropOptions||{}),a="default";this.targetEndpointDefinitions[n]=this.targetEndpointDefinitions[n]||{},pt(n);var u={def:r.jsPlumb.extend({},i),uniqueEndpoint:i.uniqueEndpoint,maxConnections:o,enabled:!0};e.def=u,this.targetEndpointDefinitions[n][a]=u,_t(e,i,s,i.isSource===!0,!0),e.el._katavorioDrop[e.el._katavorioDrop.length-1].targetDef=u}.bind(this),a=t.length&&t.constructor!=String?t:[t],u=0,l=a.length;u=0&&g>=d.maxConnections)return c&&c({element:t.el,maxConnections:l},u),!1;var v=r.jsPlumb.getPositionOnElement(u,i,h),b={};r.jsPlumb.extend(b,o),b.isTemporarySource=!0,b.anchor=[v[0],v[1],0,0],b.dragOptions=p,d.def.scope&&(b.scope=d.def.scope),m=this.addEndpoint(n,b),y=!0,m._doNotDeleteOnDetach=!1,m._deleteOnDetach=!0,d.uniqueEndpoint&&(d.endpoint?m.finalEndpoint=d.endpoint:(d.endpoint=m,m._deleteOnDetach=!1,m._doNotDeleteOnDetach=!0));var _=function(){e.off(m.canvas,"mouseup",_),e.off(t.el,"mouseup",_),y&&(y=!1,e.deleteEndpoint(m))};e.on(m.canvas,"mouseup",_),e.on(t.el,"mouseup",_);var P={};if(d.def.extract)for(var E in d.def.extract){var x=(u.srcElement||u.target).getAttribute(E);x&&(P[d.def.extract[E]]=x)}e.trigger(m.canvas,"mousedown",u,P),a.consume(u)}}}.bind(this);this.on(t.el,"mousedown",b),u.trigger=b,o.filter&&(a.isString(o.filter)||a.isFunction(o.filter))&&e.setDragFilter(t.el,o.filter);var _=r.jsPlumb.extend({},o.dropOptions||{});_t(t,o,_,!0,o.isTarget===!0)}.bind(this),p=t.length&&t.constructor!=String?t:[t],g=0,v=p.length;g0;)o(n.el.childNodes[0]);e||jt(n,i)}};return e.batch(function(){o(t,!0)},n===!1),e},this.reset=function(){e.silently(function(){ft=!1,e.removeAllGroups(),e.removeGroupManager(),e.deleteEveryEndpoint(),e.unbind(),this.targetEndpointDefinitions={},this.sourceEndpointDefinitions={},E.length=0,this.doReset&&this.doReset()}.bind(this))};var St=function(t){t.canvas&&t.canvas.parentNode&&t.canvas.parentNode.removeChild(t.canvas),t.cleanup(),t.destroy()};this.clear=function(){e.select().each(St),e.selectEndpoints().each(St),x={},C={}},this.setDefaultScope=function(t){return T=t,e},this.setDraggable=W,this.deriveEndpointAndAnchorSpec=function(t,n){for(var i=((n?"":"default ")+t).split(/[\s]/),o=null,r=null,s=null,a=null,u=0;u0?t.touches:t.changedTouches&&t.changedTouches.length>0?t.changedTouches:t.targetTouches&&t.targetTouches.length>0?t.targetTouches:[t]},u=function(t){var e={},n=[],i={},o={},r={};this.register=function(s){var a=t.getId(s),u=t.getOffset(s);e[a]||(e[a]=s,n.push(s),i[a]={});var l=function(e){if(e)for(var n=0;n0){var h=t.getOffset(s);i[a][c]={id:c,offset:{left:h.left-u.left,top:h.top-u.top}},r[c]=a}l(e.childNodes[n])}};l(s)},this.updateOffsets=function(e,n){if(null!=e){n=n||{};var o=jsPlumb.getElement(e),s=t.getId(o),a=i[s],u=t.getOffset(o);if(a)for(var l in a)if(a.hasOwnProperty(l)){var c=jsPlumb.getElement(l),h=n[l]||t.getOffset(c);if(null==c.offsetParent&&null!=i[s][l])continue;i[s][l]={id:l,offset:{left:h.left-u.left,top:h.top-u.top}},r[l]=s}}},this.endpointAdded=function(n,s){s=s||t.getId(n);var a=document.body,u=n.parentNode;for(o[s]=o[s]?o[s]+1:1;null!=u&&u!=a;){var l=t.getId(u,null,!0);if(l&&e[l]){var c=t.getOffset(u);if(null==i[l][s]){var h=t.getOffset(n);i[l][s]={id:s,offset:{left:h.left-c.left,top:h.top-c.top}},r[s]=l}break}u=u.parentNode}},this.endpointDeleted=function(t){if(o[t.elementId]&&(o[t.elementId]--,o[t.elementId]<=0))for(var e in i)i.hasOwnProperty(e)&&i[e]&&(delete i[e][t.elementId],delete r[t.elementId])},this.changeId=function(t,e){i[e]=i[t],i[t]={},r[e]=r[t],r[t]=null},this.getElementsForDraggable=function(t){return i[t]},this.elementRemoved=function(t){var e=r[t];e&&(delete i[e][t],delete r[t])},this.reset=function(){e={},n=[],i={},o={}},this.dragEnded=function(e){if(null!=e.offsetParent){var n=t.getId(e),i=r[n];i&&this.updateOffsets(i)}},this.setParent=function(e,n,o,s,a){var u=r[n];i[s]||(i[s]={});var l=t.getOffset(o),c=a||t.getOffset(e);u&&delete i[u][n],i[s][n]={id:n,offset:{left:c.left-l.left,top:c.top-l.top}},r[n]=s},this.clearParent=function(t,e){var n=r[e];n&&(delete i[n][e],delete r[e])},this.revalidateParent=function(e,n,i){var o=r[n];if(o){var s={};s[n]=i,this.updateOffsets(o,s),t.revalidate(o)}},this.getDragAncestor=function(e){var n=jsPlumb.getElement(e),i=t.getId(n),o=r[i];return o?jsPlumb.getElement(o):null}},l=function(t){return null==t?null:t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},c=function(t,e){e=l(e),"undefined"!=typeof t.className.baseVal?t.className.baseVal=e:t.className=e},h=function(t){return"undefined"==typeof t.className.baseVal?t.className:t.className.baseVal},d=function(t,n,i){n=null==n?[]:e.isArray(n)?n:n.split(/\s+/),i=null==i?[]:e.isArray(i)?i:i.split(/\s+/);var o=h(t),r=o.split(/\s+/),s=function(t,e){for(var n=0;n0||t.scrollLeft>0)&&(i.left-=t.scrollLeft,i.top-=t.scrollTop)}.bind(this);null!=o;)i.left+=o.offsetLeft,i.top+=o.offsetTop,r(o),o=e?o.offsetParent:o.offsetParent==n?null:o.offsetParent;if(null!=n&&!e&&(n.scrollTop>0||n.scrollLeft>0)){var s=null!=t.offsetParent?this.getStyle(t.offsetParent,"position"):"static",a=this.getStyle(t,"position");"absolute"!==a&&"fixed"!==a&&"absolute"!==s&&"fixed"!=s&&(i.left-=n.scrollLeft,i.top-=n.scrollTop)}return i},getPositionOnElement:function(t,e,n){var i="undefined"!=typeof e.getBoundingClientRect?e.getBoundingClientRect():{left:0,top:0,width:0,height:0},o=document.body,r=document.documentElement,s=window.pageYOffset||r.scrollTop||o.scrollTop,a=window.pageXOffset||r.scrollLeft||o.scrollLeft,u=r.clientTop||o.clientTop||0,l=r.clientLeft||o.clientLeft||0,c=0,h=0,d=i.top+s-u+c*n,f=i.left+a-l+h*n,p=jsPlumb.pageLocation(t),g=i.width||e.offsetWidth*n,v=i.height||e.offsetHeight*n,m=(p[0]-f)/g,y=(p[1]-d)/v;return[m,y]},getAbsolutePosition:function(t){var e=function(e){var n=t.style[e];if(n)return parseFloat(n.substring(0,n.length-2))};return[e("left"),e("top")]},setAbsolutePosition:function(t,e,n,i){n?this.animate(t,{left:"+="+(e[0]-n[0]),top:"+="+(e[1]-n[1])},i):(t.style.left=e[0]+"px",t.style.top=e[1]+"px")},getSize:function(t){return[t.offsetWidth,t.offsetHeight]},getWidth:function(t){return t.offsetWidth},getHeight:function(t){return t.offsetHeight},getRenderMode:function(){return"svg"}})}.call("undefined"!=typeof window?window:this),function(){"use strict";var t=this,e=t.jsPlumb,n=t.jsPlumbUtil,i="__label",o=function(t,n){var o={cssClass:n.cssClass,labelStyle:t.labelStyle,id:i,component:t,_jsPlumb:t._jsPlumb.instance},r=e.extend(o,n);return new(e.Overlays[t._jsPlumb.instance.getRenderMode()].Label)(r)},r=function(t,i){var o=null;if(n.isArray(i)){var r=i[0],s=e.extend({component:t,_jsPlumb:t._jsPlumb.instance},i[1]);3==i.length&&e.extend(s,i[2]),o=new(e.Overlays[t._jsPlumb.instance.getRenderMode()][r])(s)}else o=i.constructor==String?new(e.Overlays[t._jsPlumb.instance.getRenderMode()][i])({component:t,_jsPlumb:t._jsPlumb.instance}):i;return o.id=o.id||n.uuid(),t.cacheTypeItem("overlay",o,o.id),t._jsPlumb.overlays[o.id]=o,o};e.OverlayCapableJsPlumbUIComponent=function(e){t.jsPlumbUIComponent.apply(this,arguments),this._jsPlumb.overlays={},this._jsPlumb.overlayPositions={},e.label&&(this.getDefaultType().overlays[i]=["Label",{label:e.label,location:e.labelLocation||this.defaultLabelLocation||.5,labelStyle:e.labelStyle||this._jsPlumb.instance.Defaults.LabelStyle,id:i}]),this.setListenerComponent=function(t){if(this._jsPlumb)for(var e in this._jsPlumb.overlays)this._jsPlumb.overlays[e].setListenerComponent(t)}},e.OverlayCapableJsPlumbUIComponent.applyType=function(t,e){if(e.overlays){var n,i={};for(n in e.overlays){var o=t._jsPlumb.overlays[e.overlays[n][1].id];if(o)o.updateFrom(e.overlays[n][1]),i[e.overlays[n][1].id]=!0;else{var r=t.getCachedTypeItem("overlay",e.overlays[n][1].id);null!=r?(r.reattach(t._jsPlumb.instance),r.setVisible(!0),r.updateFrom(e.overlays[n][1]),t._jsPlumb.overlays[r.id]=r):r=t.addOverlay(e.overlays[n],!0),i[r.id]=!0}}for(n in t._jsPlumb.overlays)null==i[t._jsPlumb.overlays[n].id]&&t.removeOverlay(t._jsPlumb.overlays[n].id,!0)}},n.extend(e.OverlayCapableJsPlumbUIComponent,t.jsPlumbUIComponent,{setHover:function(t,e){if(this._jsPlumb&&!this._jsPlumb.instance.isConnectionBeingDragged())for(var n in this._jsPlumb.overlays)this._jsPlumb.overlays[n][t?"addClass":"removeClass"](this._jsPlumb.instance.hoverClass)},addOverlay:function(t,e){var n=r(this,t);return e||this.repaint(),n},getOverlay:function(t){return this._jsPlumb.overlays[t]},getOverlays:function(){return this._jsPlumb.overlays},hideOverlay:function(t){var e=this.getOverlay(t);e&&e.hide()},hideOverlays:function(){for(var t in this._jsPlumb.overlays)this._jsPlumb.overlays[t].hide()},showOverlay:function(t){var e=this.getOverlay(t);e&&e.show()},showOverlays:function(){for(var t in this._jsPlumb.overlays)this._jsPlumb.overlays[t].show()},removeAllOverlays:function(t){for(var e in this._jsPlumb.overlays)this._jsPlumb.overlays[e].cleanup&&this._jsPlumb.overlays[e].cleanup();this._jsPlumb.overlays={},this._jsPlumb.overlayPositions=null,t||this.repaint()},removeOverlay:function(t,e){var n=this._jsPlumb.overlays[t];n&&(n.setVisible(!1),!e&&n.cleanup&&n.cleanup(),delete this._jsPlumb.overlays[t],this._jsPlumb.overlayPositions&&delete this._jsPlumb.overlayPositions[t])},removeOverlays:function(){for(var t=0,e=arguments.length;t0)for(var e=0;e0?"add":"remove")+"Class"](u.endpointConnectedClass),this[(this.isFull()?"add":"remove")+"Class"](u.endpointFullClass)},this.detachFromConnection=function(t,e,n){e=null==e?this.connections.indexOf(t):e,e>=0&&(this.connections.splice(e,1),this[(this.connections.length>0?"add":"remove")+"Class"](u.endpointConnectedClass),this[(this.isFull()?"add":"remove")+"Class"](u.endpointFullClass)),(this._forceDeleteOnDetach||!n&&this._deleteOnDetach)&&0===this.connections.length&&u.deleteObject({endpoint:this,fireEvent:!1,deleteAttachedObjects:n!==!0 +})},this.detach=function(t){var e=t.connectionIndex,n=t.connection,i=t.ignoreTarget,o=t.fireEvent,r=t.originalEvent,s=t.endpointBeingDeleted,a=t.forceDetach,l=null==e?this.connections.indexOf(n):e,c=!1;return o=o!==!1,l>=0&&(a||n._forceDetach||n.isDetachable()&&n.isDetachAllowed(n)&&this.isDetachAllowed(n)&&u.checkCondition("beforeDetach",n,s))&&(u.deleteObject({connection:n,fireEvent:!i&&o,originalEvent:r,deleteAttachedObjects:t.deleteAttachedObjects}),c=!0),c},this.detachAll=function(t,e){for(var n=[];this.connections.length>0;){var i=this.detach({connection:this.connections[0],ignoreTarget:!1,forceDetach:e===!0,fireEvent:t!==!1,originalEvent:null,endpointBeingDeleted:this,connectionIndex:0});i||(n.push(this.connections[0]),this.connections.splice(0,1))}return this.connections=n,this},this.detachFrom=function(t,e,n){for(var i=[],o=0;o0){var h=a(this,t.elementWithPrecedence),d=h.endpoints[0]==this?1:0,f=0===d?h.sourceId:h.targetId,p=u.getCachedData(f),g=p.o,v=p.s;c.txy=[g.left,g.top],c.twh=v,c.tElement=h.endpoints[d]}r=this.anchor.compute(c)}this.endpoint.compute(r,this.anchor.getOrientation(this),this._jsPlumb.paintStyleInUse,s||this.paintStyleInUse),this.endpoint.paint(this._jsPlumb.paintStyleInUse,this.anchor),this.timestamp=e;for(var m in this._jsPlumb.overlays)if(this._jsPlumb.overlays.hasOwnProperty(m)){var y=this._jsPlumb.overlays[m];y.isVisible()&&(this._jsPlumb.overlayPlacements[m]=y.draw(this.endpoint,this._jsPlumb.paintStyleInUse),y.paint(this._jsPlumb.overlayPlacements[m]))}}}},this.getTypeDescriptor=function(){return"endpoint"},this.isVisible=function(){return this._jsPlumb.visible},this.repaint=this.paint;var p=!1;this.initDraggable=function(){if(!p&&e.isDragSupported(this.element)){var s,a={id:null,element:null},d=null,f=!1,g=null,v=i(this,a,u),m=t.dragOptions||{},y={},b=e.dragEvents.start,_=e.dragEvents.stop,P=e.dragEvents.drag,E=e.dragEvents.beforeStart,x=function(t){s=t.e.payload||{}},C=function(i){d=this.connectorSelector();var h=!0;this.isEnabled()||(h=!1),null!=d||this.isSource||this.isTemporarySource||(h=!1),!this.isSource||!this.isFull()||null!=d&&this.dragAllowedWhenFull||(h=!1),null==d||d.isDetachable(this)||(h=!1);var p=u.checkCondition(null==d?"beforeDrag":"beforeStartDetach",{endpoint:this,source:this.element,sourceId:this.elementId,connection:d});if(p===!1?h=!1:"object"==typeof p?e.extend(p,s||{}):p=s||{},h===!1)return u.stopDrag&&u.stopDrag(this.canvas),v.stopDrag(),!1;for(var m=0;m0}.bind(this),u.initDraggable(this.canvas,m,"internal"),this.canvas._jsPlumbRelatedElement=this.element,p=!0}};var g=t.endpoint||this._jsPlumb.instance.Defaults.Endpoint||e.Defaults.Endpoint;this.setEndpoint(g,!0);var v=t.anchor?t.anchor:t.anchors?t.anchors:u.Defaults.Anchor||"Top";this.setAnchor(v,!0);var m=["default",t.type||""].join(" ");this.addType(m,t.data,!0),this.canvas=this.endpoint.canvas,this.canvas._jsPlumb=this,this.initDraggable();var y=function(i,o,r,s){if(e.isDropSupported(this.element)){var a=t.dropOptions||u.Defaults.DropOptions||e.Defaults.DropOptions;a=e.extend({},a),a.scope=a.scope||this.scope;var l=e.dragEvents.drop,c=e.dragEvents.over,h=e.dragEvents.out,d=this,f=u.EndpointDropHandler({getEndpoint:function(){return d},jsPlumb:u,enabled:function(){return null==r||r.isEnabled()},isFull:function(){return r.isFull()},element:this.element,elementId:this.elementId,isSource:this.isSource,isTarget:this.isTarget,addClass:function(t){d.addClass(t)},removeClass:function(t){d.removeClass(t)},isDropAllowed:function(){return d.isDropAllowed.apply(d,arguments)},reference:s,isRedrop:function(t,e){return t.suspendedEndpoint&&e.reference&&t.suspendedEndpoint.id===e.reference.id}});a[l]=n.wrap(a[l],f,!0),a[c]=n.wrap(a[c],function(){var t=e.getDragObject(arguments),n=u.getAttribute(e.getElement(t),"dragId"),i=u.floatingConnections[n];if(null!=i){var o=u.getFloatingAnchorIndex(i),r=this.isTarget&&0!==o||i.suspendedEndpoint&&this.referenceEndpoint&&this.referenceEndpoint.id==i.suspendedEndpoint.id;if(r){var s=u.checkCondition("checkDropAllowed",{sourceEndpoint:i.endpoints[o],targetEndpoint:this,connection:i});this[(s?"add":"remove")+"Class"](u.endpointDropAllowedClass),this[(s?"remove":"add")+"Class"](u.endpointDropForbiddenClass),i.endpoints[o].anchor.over(this.anchor,this)}}}.bind(this)),a[h]=n.wrap(a[h],function(){var t=e.getDragObject(arguments),n=null==t?null:u.getAttribute(e.getElement(t),"dragId"),i=n?u.floatingConnections[n]:null;if(null!=i){var o=u.getFloatingAnchorIndex(i),r=this.isTarget&&0!==o||i.suspendedEndpoint&&this.referenceEndpoint&&this.referenceEndpoint.id==i.suspendedEndpoint.id;r&&(this.removeClass(u.endpointDropAllowedClass),this.removeClass(u.endpointDropForbiddenClass),i.endpoints[o].anchor.out())}}.bind(this)),u.initDroppable(i,a,"internal",o)}}.bind(this);return this.anchor.isFloating||y(this.canvas,!(t._transient||this.anchor.isFloating),this,t.reference),this},n.extend(e.Endpoint,e.OverlayCapableJsPlumbUIComponent,{setVisible:function(t,e,n){if(this._jsPlumb.visible=t,this.canvas&&(this.canvas.style.display=t?"block":"none"),this[t?"showOverlays":"hideOverlays"](),!e)for(var i=0;ie.dist?1:0});for(var p=c[0].source,g=c[0].target,v=0;vn[0][0],i===!1?-1:1}},m=function(t,e){var n=t[0][0]<0?-Math.PI-t[0][0]:Math.PI-t[0][0],i=e[0][0]<0?-Math.PI-e[0][0]:Math.PI-e[0][0];return n>i?1:-1},y={top:function(t,e){return t[0]>e[0]?1:-1},right:v(!0),bottom:v(!0),left:m},b=function(t,e){return t.sort(e)},_=function(t,e){var n=d.getCachedData(t),i=n.s,r=n.o,a=function(e,n,i,r,a,u,l){if(r.length>0)for(var c=b(r,y[e]),h="right"===e||"top"===e,d=g(e,n,i,c,a,u,h),f=function(t,e){o[t.id]=[e[0],e[1],e[2],e[3]],s[t.id]=l},p=0;p-1&&(l[i].splice(a,1),e.addToList(l,o,[r,r.endpoints[0],r.endpoints[0].anchor.constructor==n.DynamicAnchor])),r.updateConnectedClass()},this.sourceChanged=function(t,i,o,r){if(t!==i){o.sourceId=i,o.source=r,e.removeWithFunction(l[t],function(t){return t[0].id===o.id});var s=e.findWithFunction(l[o.targetId],function(t){return t[0].id===o.id});s>-1&&(l[o.targetId][s][0]=o,l[o.targetId][s][1]=o.endpoints[0],l[o.targetId][s][2]=o.endpoints[0].anchor.constructor==n.DynamicAnchor),e.addToList(l,i,[o,o.endpoints[1],o.endpoints[1].anchor.constructor==n.DynamicAnchor]),o.endpoints[1].anchor.isContinuous&&(o.source===o.target?o._jsPlumb.instance.removeElement(o.endpoints[1].canvas):null==o.endpoints[1].canvas.parentNode&&o._jsPlumb.instance.appendElement(o.endpoints[1].canvas)),o.updateConnectedClass()}},this.rehomeEndpoint=function(t,e,n){var o=i[e]||[],r=d.getId(n);if(r!==e){var s=o.indexOf(t);if(s>-1){var a=o.splice(s,1)[0];c.add(a,r)}}for(var u=0;u0?this.anchors[0]:null,r=o,s=this,a=function(t,e,n,i,o){var r=i[0]+t.x*o[0],s=i[1]+t.y*o[1],a=i[0]+o[0]/2,u=i[1]+o[1]/2;return Math.sqrt(Math.pow(e-r,2)+Math.pow(n-s,2))+Math.sqrt(Math.pow(a-r,2)+Math.pow(u-s,2))},u=t.selector||function(t,e,n,i,o){for(var r=n[0]+i[0]/2,s=n[1]+i[1]/2,u=-1,l=1/0,c=0;c0?t:n+t:t*n;return i.pointOnLine({x:s,y:u},{x:a,y:l},o)}return{x:a,y:l}}return{x:s,y:u}},this.gradientAtPoint=function(t){return o},this.pointAlongPathFrom=function(t,e,n){var o=this.pointOnPath(t,n),r=e<=0?{x:s,y:u}:{x:a,y:l};return e<=0&&Math.abs(e)>1&&(e*=-1),i.pointOnLine(o,r,e)};var h=function(t,e,n){return n>=Math.min(t,e)&&n<=Math.max(t,e)},d=function(t,e,n){return Math.abs(n-t)0?0:1,n)),n};this.pointOnPath=function(e,n){return e=i(this.curve,e,n),t.jsBezier.pointOnCurve(this.curve,e)},this.gradientAtPoint=function(e,n){return e=i(this.curve,e,n),t.jsBezier.gradientAtPoint(this.curve,e)},this.pointAlongPathFrom=function(e,n,o){return e=i(this.curve,e,o),t.jsBezier.pointAlongCurveFrom(this.curve,e,n)},this.getLength=function(){return t.jsBezier.getLength(this.curve)},this.getBounds=function(){return this.bounds}}},e.SegmentRenderer={getPath:function(t){return{Straight:function(){var e=t.getCoordinates();return"M "+e.x1+" "+e.y1+" L "+e.x2+" "+e.y2},Bezier:function(){var e=t.params;return"M "+e.x1+" "+e.y1+" C "+e.cp1x+" "+e.cp1y+" "+e.cp2x+" "+e.cp2y+" "+e.x2+" "+e.y2},Arc:function(){var e=t.params,n=t.sweep>Math.PI?1:0,i=t.anticlockwise?0:1;return"M"+t.x1+" "+t.y1+" A "+t.radius+" "+e.r+" 0 "+n+","+i+" "+t.x2+" "+t.y2}}[t.type]()}};var o=function(){this.resetBounds=function(){this.bounds={minX:1/0,minY:1/0,maxX:-(1/0),maxY:-(1/0)}},this.resetBounds()};e.Connectors.AbstractConnector=function(t){o.apply(this,arguments);var r=[],s=0,a=[],u=[],l=t.stub||0,c=n.isArray(l)?l[0]:l,h=n.isArray(l)?l[1]:l,d=t.gap||0,f=n.isArray(d)?d[0]:d,p=n.isArray(d)?d[1]:d,g=null,v=!1,m=null,y=null,b=t.editable!==!1&&null!=e.ConnectorEditors&&null!=e.ConnectorEditors[this.type],_=this.setGeometry=function(t,e){v=!e,y=t},P=this.getGeometry=function(){return y};this.getPathData=function(){for(var t="",n=0;n0?t/s:(s+t)/s);for(var n=a.length-1,i=1,o=0;o=t){n=o,i=1==t?1:0===t?0:(t-a[o][0])/u[o];break}return{segment:r[n],proportion:i,index:n}},C=function(t,n,i){if(i.x1!=i.x2||i.y1!=i.y2){var o=new e.Segments[n](i);r.push(o),s+=o.getLength(),t.updateBounds(o)}},w=function(){s=r.length=a.length=u.length=0};this.setSegments=function(t){g=[],s=0;for(var e=0;eg?0:1,m=[1,0][v];s=[],a=[],s[v]=t.sourcePos[v]>t.targetPos[v]?-1:1,a[v]=t.sourcePos[v]>t.targetPos[v]?1:-1,s[m]=0,a[m]=0}var y=n?d+f*s[0]:f*s[0],b=o?g+f*s[1]:f*s[1],_=n?p*a[0]:d+p*a[0],P=o?p*a[1]:g+p*a[1],E=s[0]*a[0]+s[1]*a[1],x={sx:y,sy:b,tx:_,ty:P,lw:r,xSpan:Math.abs(_-y),ySpan:Math.abs(P-b),mx:(y+_)/2,my:(b+P)/2,so:s,to:a,x:u,y:l,w:d,h:g,segment:e,startStubX:y+s[0]*c,startStubY:b+s[1]*c,endStubX:_+a[0]*h,endStubY:P+a[1]*h,isXGreaterThanStubTimes2:Math.abs(y-_)>c+h,isYGreaterThanStubTimes2:Math.abs(b-P)>c+h,opposite:E==-1,perpendicular:0===E,orthogonal:1==E,sourceAxis:0===s[0]?"y":"x",points:[u,l,d,g,y,b,_,P]};return x.anchorOrientation=x.opposite?"opposite":x.orthogonal?"orthogonal":"perpendicular",x};return this.getSegments=function(){return r},this.updateBounds=function(t){var e=t.getBounds();this.bounds.minX=Math.min(this.bounds.minX,e.minX),this.bounds.maxX=Math.max(this.bounds.maxX,e.maxX),this.bounds.minY=Math.min(this.bounds.minY,e.minY),this.bounds.maxY=Math.max(this.bounds.maxY,e.maxY)},this.pointOnPath=function(t,e){var n=x(t,e);return n.segment&&n.segment.pointOnPath(n.proportion,!1)||[0,0]},this.gradientAtPoint=function(t,e){var n=x(t,e);return n.segment&&n.segment.gradientAtPoint(n.proportion,!1)||0},this.pointAlongPathFrom=function(t,e,n){var i=x(t,n);return i.segment&&i.segment.pointAlongPathFrom(i.proportion,e,!1)||[0,0]},this.compute=function(t){m=j.call(this,t),w(),this._compute(m,t),this.x=m.points[0],this.y=m.points[1],this.w=m.points[2],this.h=m.points[3],this.segment=m.segment,E()},{addSegment:C,prepareCompute:j,sourceStub:c,targetStub:h,maxStub:Math.max(c,h),sourceGap:f,targetGap:p,maxGap:Math.max(f,p),setGeometry:_,getGeometry:P}},n.extend(e.Connectors.AbstractConnector,o),e.Endpoints.AbstractEndpoint=function(t){o.apply(this,arguments);var e=this.compute=function(t,e,n,i){var o=this._compute.apply(this,arguments);return this.x=o[0],this.y=o[1],this.w=o[2],this.h=o[3],this.bounds.minX=this.x,this.bounds.minY=this.y,this.bounds.maxX=this.x+this.w,this.bounds.maxY=this.y+this.h,o};return{compute:e,cssClass:t.cssClass}},n.extend(e.Endpoints.AbstractEndpoint,o),e.Endpoints.Dot=function(t){this.type="Dot",e.Endpoints.AbstractEndpoint.apply(this,arguments),t=t||{},this.radius=t.radius||10,this.defaultOffset=.5*this.radius,this.defaultInnerRadius=this.radius/3,this._compute=function(t,e,n,i){this.radius=n.radius||this.radius;var o=t[0]-this.radius,r=t[1]-this.radius,s=2*this.radius,a=2*this.radius;if(n.stroke){var u=n.strokeWidth||1;o-=u,r-=u,s+=2*u,a+=2*u}return[o,r,s,a,this.radius]}},n.extend(e.Endpoints.Dot,e.Endpoints.AbstractEndpoint),e.Endpoints.Rectangle=function(t){this.type="Rectangle",e.Endpoints.AbstractEndpoint.apply(this,arguments),t=t||{},this.width=t.width||20,this.height=t.height||20,this._compute=function(t,e,n,i){var o=n.width||this.width,r=n.height||this.height,s=t[0]-o/2,a=t[1]-r/2;return[s,a,o,r]}},n.extend(e.Endpoints.Rectangle,e.Endpoints.AbstractEndpoint);var r=function(t){e.jsPlumbUIComponent.apply(this,arguments),this._jsPlumb.displayElements=[]};n.extend(r,e.jsPlumbUIComponent,{getDisplayElements:function(){return this._jsPlumb.displayElements},appendDisplayElement:function(t){this._jsPlumb.displayElements.push(t)}}),e.Endpoints.Image=function(i){this.type="Image",r.apply(this,arguments),e.Endpoints.AbstractEndpoint.apply(this,arguments);var o=i.onload,s=i.src||i.url,a=i.cssClass?" "+i.cssClass:"";this._jsPlumb.img=new Image,this._jsPlumb.ready=!1,this._jsPlumb.initialized=!1,this._jsPlumb.deleted=!1,this._jsPlumb.widthToUse=i.width,this._jsPlumb.heightToUse=i.height,this._jsPlumb.endpoint=i.endpoint,this._jsPlumb.img.onload=function(){null!=this._jsPlumb&&(this._jsPlumb.ready=!0,this._jsPlumb.widthToUse=this._jsPlumb.widthToUse||this._jsPlumb.img.width,this._jsPlumb.heightToUse=this._jsPlumb.heightToUse||this._jsPlumb.img.height,o&&o(this))}.bind(this),this._jsPlumb.endpoint.setImage=function(t,e){var n=t.constructor==String?t:t.src;o=e,this._jsPlumb.img.src=n,null!=this.canvas&&this.canvas.setAttribute("src",this._jsPlumb.img.src)}.bind(this),this._jsPlumb.endpoint.setImage(s,o),this._compute=function(t,e,n,i){return this.anchorPoint=t,this._jsPlumb.ready?[t[0]-this._jsPlumb.widthToUse/2,t[1]-this._jsPlumb.heightToUse/2,this._jsPlumb.widthToUse,this._jsPlumb.heightToUse]:[0,0,0,0]},this.canvas=e.createElement("img",{position:"absolute",margin:0,padding:0,outline:0},this._jsPlumb.instance.endpointClass+a),this._jsPlumb.widthToUse&&this.canvas.setAttribute("width",this._jsPlumb.widthToUse),this._jsPlumb.heightToUse&&this.canvas.setAttribute("height",this._jsPlumb.heightToUse),this._jsPlumb.instance.appendElement(this.canvas),this.actuallyPaint=function(t,e,i){if(!this._jsPlumb.deleted){this._jsPlumb.initialized||(this.canvas.setAttribute("src",this._jsPlumb.img.src),this.appendDisplayElement(this.canvas),this._jsPlumb.initialized=!0);var o=this.anchorPoint[0]-this._jsPlumb.widthToUse/2,r=this.anchorPoint[1]-this._jsPlumb.heightToUse/2;n.sizeElement(this.canvas,o,r,this._jsPlumb.widthToUse,this._jsPlumb.heightToUse)}},this.paint=function(e,n){null!=this._jsPlumb&&(this._jsPlumb.ready?this.actuallyPaint(e,n):t.setTimeout(function(){this.paint(e,n)}.bind(this),200))}},n.extend(e.Endpoints.Image,[r,e.Endpoints.AbstractEndpoint],{cleanup:function(t){t&&(this._jsPlumb.deleted=!0,this.canvas&&this.canvas.parentNode.removeChild(this.canvas),this.canvas=null)}}),e.Endpoints.Blank=function(t){e.Endpoints.AbstractEndpoint.apply(this,arguments),this.type="Blank",r.apply(this,arguments),this._compute=function(t,e,n,i){return[t[0],t[1],10,0]};var i=t.cssClass?" "+t.cssClass:"";this.canvas=e.createElement("div",{display:"block",width:"1px",height:"1px",background:"transparent",position:"absolute"},this._jsPlumb.instance.endpointClass+i),this._jsPlumb.instance.appendElement(this.canvas),this.paint=function(t,e){n.sizeElement(this.canvas,this.x,this.y,this.w,this.h)}},n.extend(e.Endpoints.Blank,[e.Endpoints.AbstractEndpoint,r],{cleanup:function(){this.canvas&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)}}),e.Endpoints.Triangle=function(t){this.type="Triangle",e.Endpoints.AbstractEndpoint.apply(this,arguments),t=t||{},t.width=t.width||55,t.height=t.height||55,this.width=t.width,this.height=t.height,this._compute=function(t,e,n,i){var o=n.width||self.width,r=n.height||self.height,s=t[0]-o/2,a=t[1]-r/2;return[s,a,o,r]}};var s=e.Overlays.AbstractOverlay=function(t){this.visible=!0,this.isAppendedAtTopLevel=!0,this.component=t.component,this.loc=null==t.location?.5:t.location,this.endpointLoc=null==t.endpointLocation?[.5,.5]:t.endpointLocation,this.visible=t.visible!==!1};s.prototype={cleanup:function(t){t&&(this.component=null,this.canvas=null,this.endpointLoc=null)},reattach:function(t){},setVisible:function(t){this.visible=t,this.component.repaint()},isVisible:function(){return this.visible},hide:function(){this.setVisible(!1)},show:function(){this.setVisible(!0)},incrementLocation:function(t){this.loc+=t,this.component.repaint()},setLocation:function(t){this.loc=t,this.component.repaint()},getLocation:function(){return this.loc},updateFrom:function(){}},e.Overlays.Arrow=function(t){this.type="Arrow",s.apply(this,arguments),this.isAppendedAtTopLevel=!1,t=t||{},this.length=t.length||20,this.width=t.width||20,this.id=t.id;var o=(t.direction||1)<0?-1:1,r=t.paintStyle||{"stroke-width":1},a=t.foldback||.623;this.computeMaxSize=function(){return 1.5*self.width},this.elementCreated=function(n,i){if(this.path=n,t.events)for(var o in t.events)e.on(n,o,t.events[o])},this.draw=function(t,e){var s,u,l,c,h;if(t.pointAlongPathFrom){if(n.isString(this.loc)||this.loc>1||this.loc<0){var d=parseInt(this.loc,10),f=this.loc<0?1:0;s=t.pointAlongPathFrom(f,d,!1),u=t.pointAlongPathFrom(f,d-o*this.length/2,!1),l=i.pointOnLine(s,u,this.length)}else if(1==this.loc){if(s=t.pointOnPath(this.loc),u=t.pointAlongPathFrom(this.loc,-this.length),l=i.pointOnLine(s,u,this.length),o==-1){var p=l;l=s,s=p}}else if(0===this.loc){if(l=t.pointOnPath(this.loc),u=t.pointAlongPathFrom(this.loc,this.length),s=i.pointOnLine(l,u,this.length),o==-1){var g=l;l=s,s=g}}else s=t.pointAlongPathFrom(this.loc,o*this.length/2),u=t.pointOnPath(this.loc),l=i.pointOnLine(s,u,this.length);c=i.perpendicularLineTo(s,l,this.width),h=i.pointOnLine(s,l,a*this.length);var v={hxy:s,tail:c,cxy:h},m=r.stroke||e.stroke,y=r.fill||e.stroke,b=r.strokeWidth||e.strokeWidth;return{component:t,d:v,"stroke-width":b,stroke:m,fill:y,minX:Math.min(s.x,c[0].x,c[1].x),maxX:Math.max(s.x,c[0].x,c[1].x),minY:Math.min(s.y,c[0].y,c[1].y),maxY:Math.max(s.y,c[0].y,c[1].y)}}return{component:t,minX:0,maxX:0,minY:0,maxY:0}}},n.extend(e.Overlays.Arrow,s,{updateFrom:function(t){this.length=t.length||this.length,this.width=t.width||this.width,this.direction=null!=t.direction?t.direction:this.direction,this.foldback=t.foldback||this.foldback}}),e.Overlays.PlainArrow=function(t){t=t||{};var n=e.extend(t,{foldback:1});e.Overlays.Arrow.call(this,n),this.type="PlainArrow"},n.extend(e.Overlays.PlainArrow,e.Overlays.Arrow),e.Overlays.Diamond=function(t){t=t||{};var n=t.length||40,i=e.extend(t,{length:n/2,foldback:2});e.Overlays.Arrow.call(this,i),this.type="Diamond"},n.extend(e.Overlays.Diamond,e.Overlays.Arrow);var a=function(t,e){return(null==t._jsPlumb.cachedDimensions||e)&&(t._jsPlumb.cachedDimensions=t.getDimensions()),t._jsPlumb.cachedDimensions},u=function(t){e.jsPlumbUIComponent.apply(this,arguments),s.apply(this,arguments);var i=this.fire;this.fire=function(){i.apply(this,arguments),this.component&&this.component.fire.apply(this.component,arguments)},this.detached=!1,this.id=t.id,this._jsPlumb.div=null,this._jsPlumb.initialised=!1,this._jsPlumb.component=t.component,this._jsPlumb.cachedDimensions=null,this._jsPlumb.create=t.create,this._jsPlumb.initiallyInvisible=t.visible===!1,this.getElement=function(){if(null==this._jsPlumb.div){var n=this._jsPlumb.div=e.getElement(this._jsPlumb.create(this._jsPlumb.component));n.style.position="absolute",n.className=this._jsPlumb.instance.overlayClass+" "+(this.cssClass?this.cssClass:t.cssClass?t.cssClass:""),this._jsPlumb.instance.appendElement(n),this._jsPlumb.instance.getId(n),this.canvas=n;var i="translate(-50%, -50%)";n.style.webkitTransform=i,n.style.mozTransform=i,n.style.msTransform=i,n.style.oTransform=i,n.style.transform=i,n._jsPlumb=this,t.visible===!1&&(n.style.display="none")}return this._jsPlumb.div},this.draw=function(t,e,i){var o=a(this);if(null!=o&&2==o.length){var r={x:0,y:0};if(i)r={x:i[0],y:i[1]};else if(t.pointOnPath){var s=this.loc,u=!1;(n.isString(this.loc)||this.loc<0||this.loc>1)&&(s=parseInt(this.loc,10),u=!0),r=t.pointOnPath(s,u)}else{var l=this.loc.constructor==Array?this.loc:this.endpointLoc;r={x:l[0]*t.w,y:l[1]*t.h}}var c=r.x-o[0]/2,h=r.y-o[1]/2;return{component:t,d:{minx:c,miny:h,td:o,cxy:r},minX:c,maxX:c+o[0],minY:h,maxY:h+o[1]}}return{minX:0,maxX:0,minY:0,maxY:0}}};n.extend(u,[e.jsPlumbUIComponent,s],{getDimensions:function(){return[1,1]},setVisible:function(t){this._jsPlumb.div&&(this._jsPlumb.div.style.display=t?"block":"none", t&&this._jsPlumb.initiallyInvisible&&(a(this,!0),this.component.repaint(),this._jsPlumb.initiallyInvisible=!1))},clearCachedDimensions:function(){this._jsPlumb.cachedDimensions=null},cleanup:function(t){t?null!=this._jsPlumb.div&&(this._jsPlumb.div._jsPlumb=null,this._jsPlumb.instance.removeElement(this._jsPlumb.div)):(this._jsPlumb&&this._jsPlumb.div&&this._jsPlumb.div.parentNode&&this._jsPlumb.div.parentNode.removeChild(this._jsPlumb.div),this.detached=!0)},reattach:function(t){null!=this._jsPlumb.div&&t.getContainer().appendChild(this._jsPlumb.div),this.detached=!1},computeMaxSize:function(){var t=a(this);return Math.max(t[0],t[1])},paint:function(t,e){this._jsPlumb.initialised||(this.getElement(),t.component.appendDisplayElement(this._jsPlumb.div),this._jsPlumb.initialised=!0,this.detached&&this._jsPlumb.div.parentNode.removeChild(this._jsPlumb.div)),this._jsPlumb.div.style.left=t.component.x+t.d.minx+"px",this._jsPlumb.div.style.top=t.component.y+t.d.miny+"px"}}),e.Overlays.Custom=function(t){this.type="Custom",u.apply(this,arguments)},n.extend(e.Overlays.Custom,u),e.Overlays.GuideLines=function(){var t=this;t.length=50,t.strokeWidth=5,this.type="GuideLines",s.apply(this,arguments),e.jsPlumbUIComponent.apply(this,arguments),this.draw=function(e,n){var o=e.pointAlongPathFrom(t.loc,t.length/2),r=e.pointOnPath(t.loc),s=i.pointOnLine(o,r,t.length),a=i.perpendicularLineTo(o,s,40),u=i.perpendicularLineTo(s,o,20);return{connector:e,head:o,tail:s,headLine:u,tailLine:a,minX:Math.min(o.x,s.x,u[0].x,u[1].x),minY:Math.min(o.y,s.y,u[0].y,u[1].y),maxX:Math.max(o.x,s.x,u[0].x,u[1].x),maxY:Math.max(o.y,s.y,u[0].y,u[1].y)}}},e.Overlays.Label=function(t){this.labelStyle=t.labelStyle,this.cssClass=null!=this.labelStyle?this.labelStyle.cssClass:null;var n=e.extend({create:function(){return e.createElement("div")}},t);if(e.Overlays.Custom.call(this,n),this.type="Label",this.label=t.label||"",this.labelText=null,this.labelStyle){var i=this.getElement();if(this.labelStyle.font=this.labelStyle.font||"12px sans-serif",i.style.font=this.labelStyle.font,i.style.color=this.labelStyle.color||"black",this.labelStyle.fill&&(i.style.background=this.labelStyle.fill),this.labelStyle.borderWidth>0){var o=this.labelStyle.borderStyle?this.labelStyle.borderStyle:"black";i.style.border=this.labelStyle.borderWidth+"px solid "+o}this.labelStyle.padding&&(i.style.padding=this.labelStyle.padding)}},n.extend(e.Overlays.Label,e.Overlays.Custom,{cleanup:function(t){t&&(this.div=null,this.label=null,this.labelText=null,this.cssClass=null,this.labelStyle=null)},getLabel:function(){return this.label},setLabel:function(t){this.label=t,this.labelText=null,this.clearCachedDimensions(),this.update(),this.component.repaint()},getDimensions:function(){return this.update(),u.prototype.getDimensions.apply(this,arguments)},update:function(){if("function"==typeof this.label){var t=this.label(this);this.getElement().innerHTML=t.replace(/\r\n/g,"
")}else null==this.labelText&&(this.labelText=this.label,this.getElement().innerHTML=this.labelText.replace(/\r\n/g,"
"))},updateFrom:function(t){t.label&&this.setLabel(t.label)}})}.call("undefined"!=typeof window?window:this),function(){"use strict";var t=this,e=t.jsPlumb,n=function(e){var n=e._mottle;return n||(n=e._mottle=new t.Mottle),n};e.extend(t.jsPlumbInstance.prototype,{getEventManager:function(){return n(this)},on:function(t,e,n){return this.getEventManager().on.apply(this,arguments),this},off:function(t,e,n){return this.getEventManager().off.apply(this,arguments),this}})}.call("undefined"!=typeof window?window:this),function(){"use strict";var t=this,e=t.jsPlumbUtil,n=t.jsPlumbInstance,i="jtk-group-collapsed",o="jtk-group-expanded",r="[jtk-group-content]",s="elementDraggable",a="stop",u="revert",l="_groupManager",c="_jsPlumbGroup",h="_jsPlumbGroupDrag",d="group:addMember",f="group:removeMember",p="group:add",g="group:remove",v="group:expand",m="group:collapse",y=function(t){function n(t){delete t.proxies;var n,i=u[t.id];null!=i&&(n=function(e){return e.id===t.id},e.removeWithFunction(i.connections.source,n),e.removeWithFunction(i.connections.target,n),delete u[t.id]),i=l[t.id],null!=i&&(n=function(e){return e.id===t.id},e.removeWithFunction(i.connections.source,n),e.removeWithFunction(i.connections.target,n),delete l[t.id])}function r(e,n){for(var i=e.getMembers(),o=0;o0&&a0&&l0?t[0]:_},E=i.ghost===!0,x=E||i.constrain===!0,C=i.revert!==!1,w=i.orphan===!0,j=i.prune===!0,S=i.dropOverride===!0,D=i.proxied!==!1,A=[];if(this.connections={source:[],target:[],internal:[]},this.getAnchor=function(t,e){return i.anchor||"Continuous"},this.getEndpoint=function(t,e){return i.endpoint||["Dot",{radius:10}]},this.collapsed=!1,i.draggable!==!1){var I={stop:function(t){n.fire("groupDragStop",jsPlumb.extend(t,{group:b}))},scope:h};i.dragOptions&&t.jsPlumb.extend(I,i.dragOptions),n.draggable(i.el,I)}i.droppable!==!1&&n.droppable(i.el,{drop:function(t){var e=n.getGroupManager(),i=t.drag.el;if(!i._isJsPlumbGroup){var o=i._jsPlumbGroup;if(o!==b){var r=n.getOffset(i,!0),s=b.collapsed?n.getOffset(_,!0):n.getOffset(P(),!0);if(null!=o){if(o.overrideDrop(i,b))return;o.remove(i,!0),e.updateConnectionsForGroup(o)}b.add(i,!0);var a=function(t,n){var i=0==n?1:0;t.each(function(t){t.setVisible(!1),t.endpoints[i].element._jsPlumbGroup===b?(t.endpoints[i].setVisible(!1),e.expandConnection(t,i,b)):(t.endpoints[n].setVisible(!1),e.collapseConnection(t,n,b))})};b.collapsed&&(a(n.select({source:i}),0),a(n.select({target:i}),1));var u=n.getId(i);n.dragManager.setParent(i,u,_,n.getId(_),r),n.setPosition(i,{left:r.left-s.left,top:r.top-s.top}),n.dragManager.revalidateParent(i,u,r),e.updateConnectionsForGroup(b),setTimeout(function(){n.fire(d,{group:b,el:i})},0)}}}});var O=function(t,e){for(var n=null==t.nodeType?t:[t],i=0;i0&&r[4]!=i[4]){var a=Math.min(l,d(r),d(i));r[2]-=r[5]*a,r[3]-=r[6]*a,i[0]+=i[5]*a,i[1]+=i[6]*a;var u=r[6]==i[5]&&1==i[5]||r[6]==i[5]&&0===i[5]&&r[5]!=i[6]||r[6]==i[5]&&i[5]==-1,c=i[1]>r[3]?1:-1,h=i[0]>r[2]?1:-1,p=c==h,g=p&&u||!p&&!u?i[0]:r[2],v=p&&u||!p&&!u?r[3]:i[1];o.addSegment(t,"Straight",{x1:r[0],y1:r[1],x2:r[2],y2:r[3]}),o.addSegment(t,"Arc",{r:a,x1:r[2],y1:r[3],x2:i[0],y2:i[1],cx:g,cy:v,ac:u})}else{var m=r[2]==r[0]?0:r[2]>r[0]?n.lw/2:-(n.lw/2),y=r[3]==r[1]?0:r[3]>r[1]?n.lw/2:-(n.lw/2);o.addSegment(t,"Straight",{x1:r[0]-m,y1:r[1]-y,x2:r[2]+m,y2:r[3]+y})}r=i}null!=i&&o.addSegment(t,"Straight",{x1:i[0],y1:i[1],x2:i[2],y2:i[3]})};this._compute=function(t,e){n=[],a=null,u=null,i=null;var l=function(){return[t.startStubX,t.startStubY,t.endStubX,t.endStubY]},c={perpendicular:l,orthogonal:l,opposite:function(e){var n=t,i="x"==e?0:1,o={x:function(){return 1==n.so[i]&&(n.startStubX>n.endStubX&&n.tx>n.startStubX||n.sx>n.endStubX&&n.tx>n.sx)||n.so[i]==-1&&(n.startStubXn.endStubY&&n.ty>n.startStubY||n.sy>n.endStubY&&n.ty>n.sy)||n.so[i]==-1&&(n.startStubYl[e][0],g=o[e][d][0],v=o[e][d][1],m=i[e][d][f];return n.segment==m[3]||n.segment==m[2]&&p?r[e]:n.segment==m[2]&&v=g||n.segment==m[1]&&!p?u[e]:n.segment==m[0]||n.segment==m[1]&&p?a[e]:void 0},orthogonal:function(e,n,i,o,r){var s=t,a={x:s.so[0]==-1?Math.min(n,o):Math.max(n,o),y:s.so[1]==-1?Math.min(n,o):Math.max(n,o)}[e];return{x:[[a,i],[a,r],[o,r]],y:[[i,a],[r,a],[r,o]]}[e]},opposite:function(n,i,r,s){var a=t,u={x:"y",y:"x"}[n],l={x:"height",y:"width"}[n],c=a["is"+n.toUpperCase()+"GreaterThanStubTimes2"];if(e.sourceEndpoint.elementId==e.targetEndpoint.elementId){var h=r+(1-e.sourceEndpoint.anchor[u])*e.sourceInfo[l]+o.maxStub;return{x:[[i,h],[s,h]],y:[[h,i],[h,s]]}[n]}return!c||1==a.so[f]&&i>s||a.so[f]==-1&&is?{x:[[_,a.sy],[_,a.ty]],y:[[a.sx,P],[a.tx,P]]}[n]:void 0}},C=x[t.anchorOrientation](t.sourceAxis,v,m,y,b);if(C)for(var w=0;w=e?3:4},o=function(t,e,n,i,o,r,s,a,u){return a<=u?[t,e]:1===n?i[3]<=0&&o[3]>=1?[t+(i[2]<.5?-1*r:r),e]:i[2]>=1&&o[2]<=0?[t,e+(i[3]<.5?-1*s:s)]:[t+-1*r,e+-1*s]:2===n?i[3]>=1&&o[3]<=0?[t+(i[2]<.5?-1*r:r),e]:i[2]>=1&&o[2]<=0?[t,e+(i[3]<.5?-1*s:s)]:[t+r,e+-1*s]:3===n?i[3]>=1&&o[3]<=0?[t+(i[2]<.5?-1*r:r),e]:i[2]<=0&&o[2]>=1?[t,e+(i[3]<.5?-1*s:s)]:[t+-1*r,e+-1*s]:4===n?i[3]<=0&&o[3]>=1?[t+(i[2]<.5?-1*r:r),e]:i[2]<=0&&o[2]>=1?[t,e+(i[3]<.5?-1*s:s)]:[t+r,e+-1*s]:void 0},r=function(t){t=t||{},this.type="StateMachine";var n,r=e.Connectors.AbstractBezierConnector.apply(this,arguments),s=t.curviness||10,a=t.margin||5,u=t.proximityLimit||80;t.orientation&&"clockwise"===t.orientation,this._computeBezier=function(t,e,l,c,h,d){var f=e.sourcePos[0]n?t.insertBefore(e,t.childNodes[n]):t.appendChild(e)};n.svg={node:b,attr:y,pos:_};var w=function(t){var i=t.pointerEventsSpec||"all",o={};e.jsPlumbUIComponent.apply(this,t.originalArgs),this.canvas=null,this.path=null,this.svg=null,this.bgCanvas=null;var r=t.cssClass+" "+(t.originalArgs[0].cssClass||""),s={style:"",width:0,height:0,"pointer-events":i,position:"absolute"};this.svg=b("svg",s),t.useDivWrapper?(this.canvas=e.createElement("div",{position:"absolute"}),n.sizeElement(this.canvas,0,0,1,1),this.canvas.className=r):(y(this.svg,{"class":r}),this.canvas=this.svg),t._jsPlumb.appendElement(this.canvas,t.originalArgs[0].parent),t.useDivWrapper&&this.canvas.appendChild(this.svg);var a=[this.canvas];return this.getDisplayElements=function(){return a},this.appendDisplayElement=function(t){a.push(t)},this.paint=function(e,i,r){if(null!=e){var s,a=[this.x,this.y],u=[this.w,this.h];null!=r&&(r.xmin<0&&(a[0]+=r.xmin),r.ymin<0&&(a[1]+=r.ymin),u[0]=r.xmax+(r.xmin<0?-r.xmin:0),u[1]=r.ymax+(r.ymin<0?-r.ymin:0)),t.useDivWrapper?(n.sizeElement(this.canvas,a[0],a[1],u[0],u[1]),a[0]=0,a[1]=0,s=_([0,0])):s=_([a[0],a[1]]),o.paint.apply(this,arguments),y(this.svg,{style:s,width:u[0]||0,height:u[1]||0})}},{renderer:o}};n.extend(w,e.jsPlumbUIComponent,{cleanup:function(t){t||null==this.typeId?(this.canvas&&(this.canvas._jsPlumb=null),this.svg&&(this.svg._jsPlumb=null),this.bgCanvas&&(this.bgCanvas._jsPlumb=null),this.canvas&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.bgCanvas&&this.bgCanvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.svg=null,this.canvas=null,this.path=null,this.group=null):(this.canvas&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.bgCanvas&&this.bgCanvas.parentNode&&this.bgCanvas.parentNode.removeChild(this.bgCanvas))},reattach:function(t){var e=t.getContainer();this.canvas&&null==this.canvas.parentNode&&e.appendChild(this.canvas),this.bgCanvas&&null==this.bgCanvas.parentNode&&e.appendChild(this.bgCanvas)},setVisible:function(t){this.canvas&&(this.canvas.style.display=t?"block":"none")}}),e.ConnectorRenderers.svg=function(t){var n=this,i=w.apply(this,[{cssClass:t._jsPlumb.connectorClass+(this.isEditable()?" "+t._jsPlumb.editableConnectorClass:""),originalArgs:arguments,pointerEventsSpec:"none",_jsPlumb:t._jsPlumb}]),o=this.setEditable;this.setEditable=function(t){var n=o.apply(this,[t]);e[n?"addClass":"removeClass"](this.canvas,this._jsPlumb.instance.editableConnectorClass)},i.renderer.paint=function(i,o,r){var s=n.getSegments(),a="",u=[0,0];if(r.xmin<0&&(u[0]=-r.xmin),r.ymin<0&&(u[1]=-r.ymin),s.length>0){a=n.getPathData();var l={d:a,transform:"translate("+u[0]+","+u[1]+")","pointer-events":t["pointer-events"]||"visibleStroke"},c=null,h=[n.x,n.y,n.w,n.h];if(i.outlineStroke){var d=i.outlineWidth||1,f=i.strokeWidth+2*d;c=e.extend({},i),delete c.gradient,c.stroke=i.outlineStroke,c.strokeWidth=f,null==n.bgPath?(n.bgPath=b("path",l),e.addClass(n.bgPath,e.connectorOutlineClass),C(n.svg,n.bgPath,0)):y(n.bgPath,l),x(n.svg,n.bgPath,c,h,n)}null==n.path?(n.path=b("path",l),C(n.svg,n.path,i.outlineStroke?1:0)):y(n.path,l),x(n.svg,n.path,i,h,n)}}},n.extend(e.ConnectorRenderers.svg,w);var j=e.SvgEndpoint=function(t){var n=w.apply(this,[{cssClass:t._jsPlumb.endpointClass,originalArgs:arguments,pointerEventsSpec:"all",useDivWrapper:!0,_jsPlumb:t._jsPlumb}]);n.renderer.paint=function(t){var n=e.extend({},t);n.outlineStroke&&(n.strokeWidth=n.strokeWidth,n.stroke=n.outlineStroke),null==this.node?(this.node=this.makeNode(n),this.svg.appendChild(this.node)):null!=this.updateNode&&this.updateNode(this.node),x(this.svg,this.node,n,[this.x,this.y,this.w,this.h],this),_(this.node,[this.x,this.y])}.bind(this)};n.extend(j,w),e.Endpoints.svg.Dot=function(){e.Endpoints.Dot.apply(this,arguments),j.apply(this,arguments),this.makeNode=function(t){return b("circle",{cx:this.w/2,cy:this.h/2,r:this.radius})},this.updateNode=function(t){y(t,{cx:this.w/2,cy:this.h/2,r:this.radius})}},n.extend(e.Endpoints.svg.Dot,[e.Endpoints.Dot,j]),e.Endpoints.svg.Rectangle=function(){e.Endpoints.Rectangle.apply(this,arguments),j.apply(this,arguments),this.makeNode=function(t){return b("rect",{width:this.w,height:this.h})},this.updateNode=function(t){y(t,{width:this.w,height:this.h})}},n.extend(e.Endpoints.svg.Rectangle,[e.Endpoints.Rectangle,j]),e.Endpoints.svg.Image=e.Endpoints.Image,e.Endpoints.svg.Blank=e.Endpoints.Blank,e.Overlays.svg.Label=e.Overlays.Label,e.Overlays.svg.Custom=e.Overlays.Custom;var S=function(t,n){t.apply(this,n),e.jsPlumbUIComponent.apply(this,n),this.isAppendedAtTopLevel=!1,this.path=null,this.paint=function(t,e){if(t.component.svg&&e){null==this.path&&(this.path=b("path",{"pointer-events":"all"}),t.component.svg.appendChild(this.path),this.elementCreated&&this.elementCreated(this.path,t.component),this.canvas=t.component.svg);var o=n&&1==n.length?n[0].cssClass||"":"",r=[0,0];e.xmin<0&&(r[0]=-e.xmin),e.ymin<0&&(r[1]=-e.ymin),y(this.path,{d:i(t.d),"class":o,stroke:t.stroke?t.stroke:null,fill:t.fill?t.fill:null,transform:"translate("+r[0]+","+r[1]+")"})}};var i=function(t){return isNaN(t.cxy.x)||isNaN(t.cxy.y)?"":"M"+t.hxy.x+","+t.hxy.y+" L"+t.tail[0].x+","+t.tail[0].y+" L"+t.cxy.x+","+t.cxy.y+" L"+t.tail[1].x+","+t.tail[1].y+" L"+t.hxy.x+","+t.hxy.y};this.transfer=function(t){t.canvas&&this.path&&this.path.parentNode&&(this.path.parentNode.removeChild(this.path),t.canvas.appendChild(this.path))}};n.extend(S,[e.jsPlumbUIComponent,e.Overlays.AbstractOverlay],{cleanup:function(t){null!=this.path&&(t?this._jsPlumb.instance.removeElement(this.path):this.path.parentNode&&this.path.parentNode.removeChild(this.path))},reattach:function(t){this.path&&this.canvas&&null==this.path.parentNode&&this.canvas.appendChild(this.path)},setVisible:function(t){null!=this.path&&(this.path.style.display=t?"block":"none")}}),e.Overlays.svg.Arrow=function(){S.apply(this,[e.Overlays.Arrow,arguments])},n.extend(e.Overlays.svg.Arrow,[e.Overlays.Arrow,S]),e.Overlays.svg.PlainArrow=function(){S.apply(this,[e.Overlays.PlainArrow,arguments])},n.extend(e.Overlays.svg.PlainArrow,[e.Overlays.PlainArrow,S]),e.Overlays.svg.Diamond=function(){S.apply(this,[e.Overlays.Diamond,arguments])},n.extend(e.Overlays.svg.Diamond,[e.Overlays.Diamond,S]),e.Overlays.svg.GuideLines=function(){var t,n,i=null,o=this;e.Overlays.GuideLines.apply(this,arguments),this.paint=function(e,s){null==i&&(i=b("path"),e.connector.svg.appendChild(i),o.attachListeners(i,e.connector),o.attachListeners(i,o),t=b("path"),e.connector.svg.appendChild(t),o.attachListeners(t,e.connector),o.attachListeners(t,o),n=b("path"),e.connector.svg.appendChild(n),o.attachListeners(n,e.connector),o.attachListeners(n,o));var a=[0,0];s.xmin<0&&(a[0]=-s.xmin),s.ymin<0&&(a[1]=-s.ymin),y(i,{d:r(e.head,e.tail),stroke:"red",fill:null,transform:"translate("+a[0]+","+a[1]+")"}),y(t,{d:r(e.tailLine[0],e.tailLine[1]),stroke:"blue",fill:null,transform:"translate("+a[0]+","+a[1]+")"}),y(n,{d:r(e.headLine[0],e.headLine[1]),stroke:"green",fill:null,transform:"translate("+a[0]+","+a[1]+")"})};var r=function(t,e){return"M "+t.x+","+t.y+" L"+e.x+","+e.y}},n.extend(e.Overlays.svg.GuideLines,e.Overlays.GuideLines)}.call("undefined"!=typeof window?window:this),function(){"use strict";var t=this,e=t.jsPlumb,n=t.jsPlumbUtil,i=t.Katavorio,o=t.Biltong,r=function(t,n){n=n||"main";var r="_katavorio_"+n,s=t[r],a=t.getEventManager();return s||(s=new i({bind:a.on,unbind:a.off,getSize:e.getSize,getPosition:function(e,n){var i=t.getOffset(e,n,e._katavorioDrag?e.offsetParent:null);return[i.left,i.top]},setPosition:function(t,e){t.style.left=e[0]+"px",t.style.top=e[1]+"px"},addClass:e.addClass,removeClass:e.removeClass,intersects:o.intersects,indexOf:function(t,e){return t.indexOf(e)},scope:t.getDefaultScope(),css:{noSelect:t.dragSelectClass,droppable:"jtk-droppable",draggable:"jtk-draggable",drag:"jtk-drag",selected:"jtk-drag-selected",active:"jtk-drag-active",hover:"jtk-drag-hover",ghostProxy:"jtk-ghost-proxy"}}),t[r]=s,t.bind("zoom",s.setZoom)),s},s=function(t,e){var i=function(i){if(null!=e[i]){if(n.isString(e[i])){ var o=e[i].match(/-=/)?-1:1,r=e[i].substring(2);return t[i]+o*r}return e[i]}return t[i]};return[i("left"),i("top")]};e.extend(t.jsPlumbInstance.prototype,{animationSupported:!0,getElement:function(t){return null==t?null:(t="string"==typeof t?t:null!=t.length&&null==t.enctype?t[0]:t,"string"==typeof t?document.getElementById(t):t)},removeElement:function(t){r(this).elementRemoved(t),this.getEventManager().remove(t)},doAnimate:function(t,n,i){i=i||{};var o=this.getOffset(t),r=s(o,n),a=r[0]-o.left,u=r[1]-o.top,l=i.duration||250,c=15,h=l/c,d=c/l*a,f=c/l*u,p=0,g=setInterval(function(){e.setPosition(t,{left:o.left+d*(p+1),top:o.top+f*(p+1)}),null!=i.step&&i.step(p,Math.ceil(h)),p++,p>=h&&(window.clearInterval(g),null!=i.complete&&i.complete())},c)},destroyDraggable:function(t,e){r(this,e).destroyDraggable(t)},destroyDroppable:function(t,e){r(this,e).destroyDroppable(t)},initDraggable:function(t,e,n){r(this,n).draggable(t,e)},initDroppable:function(t,e,n){r(this,n).droppable(t,e)},isAlreadyDraggable:function(t){return null!=t._katavorioDrag},isDragSupported:function(t,e){return!0},isDropSupported:function(t,e){return!0},isElementDraggable:function(t){return t=e.getElement(t),t._katavorioDrag&&t._katavorioDrag.isEnabled()},getDragObject:function(t){return t[0].drag.getDragElement()},getDragScope:function(t){return t._katavorioDrag&&t._katavorioDrag.scopes.join(" ")||""},getDropEvent:function(t){return t[0].e},getUIPosition:function(t,e){var n=t[0].el;if(null==n.offsetParent)return null;var i=t[0].finalPos||t[0].pos,o={left:i[0],top:i[1]};if(n._katavorioDrag&&n.offsetParent!==this.getContainer()){var r=this.getOffset(n.offsetParent);o.left+=r.left,o.top+=r.top}return o},setDragFilter:function(t,e,n){t._katavorioDrag&&t._katavorioDrag.setFilter(e,n)},setElementDraggable:function(t,n){t=e.getElement(t),t._katavorioDrag&&t._katavorioDrag.setEnabled(n)},setDragScope:function(t,e){t._katavorioDrag&&t._katavorioDrag.k.setDragScope(t,e)},setDropScope:function(t,e){t._katavorioDrop&&t._katavorioDrop.length>0&&t._katavorioDrop[0].k.setDropScope(t,e)},addToPosse:function(t,n){var i=Array.prototype.slice.call(arguments,1),o=r(this);e.each(t,function(t){t=[e.getElement(t)],t.push.apply(t,i),o.addToPosse.apply(o,t)})},setPosse:function(t,n){var i=Array.prototype.slice.call(arguments,1),o=r(this);e.each(t,function(t){t=[e.getElement(t)],t.push.apply(t,i),o.setPosse.apply(o,t)})},removeFromPosse:function(t,n){var i=Array.prototype.slice.call(arguments,1),o=r(this);e.each(t,function(t){t=[e.getElement(t)],t.push.apply(t,i),o.removeFromPosse.apply(o,t)})},removeFromAllPosses:function(t){var n=r(this);e.each(t,function(t){n.removeFromAllPosses(e.getElement(t))})},setPosseState:function(t,n,i){var o=r(this);e.each(t,function(t){o.setPosseState(e.getElement(t),n,i)})},dragEvents:{start:"start",stop:"stop",drag:"drag",step:"step",over:"over",out:"out",drop:"drop",complete:"complete",beforeStart:"beforeStart"},animEvents:{step:"step",complete:"complete"},stopDrag:function(t){t._katavorioDrag&&t._katavorioDrag.abort()},addToDragSelection:function(t){r(this).select(t)},removeFromDragSelection:function(t){r(this).deselect(t)},clearDragSelection:function(){r(this).deselectAll()},trigger:function(t,e,n,i){this.getEventManager().trigger(t,e,n,i)},doReset:function(){for(var t in this)0===t.indexOf("_katavorio_")&&this[t].reset()}});var a=function(t){var e=function(){/complete|loaded|interactive/.test(document.readyState)&&"undefined"!=typeof document.body&&null!=document.body?t():setTimeout(e,9)};e()};a(e.init)}.call("undefined"!=typeof window?window:this)},function(t,e,n){function i(t){var e=-1,n=t?t.length:0;for(this.clear();++e1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(s=t.length>3&&"function"==typeof s?(o--,s):void 0,a&&r(n[0],n[1],a)&&(s=o<3?void 0:s,o=1),e=Object(e);++i-1}var o=n(2);t.exports=i},function(t,e,n){function i(t,e){var n=this.__data__,i=o(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}var o=n(2);t.exports=i},function(t,e,n){function i(t,e,n){return e=r(void 0===e?t.length-1:e,0),function(){for(var i=arguments,s=-1,a=r(i.length-e,0),u=Array(a);++s(Math.pow(2,32)-1)*a))throw new TypeError("keylen exceeds maximum length");p.copy(l,0,0,a);for(var g=1;g0?"Unexpected "+(s.length>1?"keys":"key")+" "+('"'+s.join('", "')+'" found in '+r+". ")+"Expected to find one of the known reducer keys instead: "+('"'+o.join('", "')+'". Unexpected keys will be ignored.'):void 0}function s(t){Object.keys(t).forEach(function(e){var n=t[e],i=n(void 0,{type:u.ActionTypes.INIT});if("undefined"==typeof i)throw new Error('Reducer "'+e+'" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined.');var o="@@redux/PROBE_UNKNOWN_ACTION_"+Math.random().toString(36).substring(7).split("").join(".");if("undefined"==typeof n(void 0,{type:o}))throw new Error('Reducer "'+e+'" returned undefined when probed with a random type. '+("Don't try to handle "+u.ActionTypes.INIT+' or other actions in "redux/*" ')+"namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined.")})}function a(e){for(var n=Object.keys(e),i={},a=0;a>>32-e}function u(t){var n=[1732584193,4023233417,2562383102,271733878,3285377520];"string"==typeof t&&(t=new e(t,"utf8"));var i=g(t),o=8*t.length,r=8*t.length;i[o>>>5]|=128<<24-o%32,i[(o+64>>>9<<4)+14]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8);for(var s=0;s>>24)|4278255360&(a<<24|a>>>8)}var u=v(n);return new e(u)}t.exports=u;var l=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],c=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],h=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],d=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],f=[0,1518500249,1859775393,2400959708,2840853838],p=[1352829926,1548603684,1836072691,2053994217,0],g=function(t){for(var e=[],n=0,i=0;n>>5]|=t[n]<<24-i%32;return e},v=function(t){for(var e=[],n=0;n<32*t.length;n+=8)e.push(t[n>>>5]>>>24-n%32&255);return e},m=function(t,e,u){for(var g=0;g<16;g++){var v=u+g,m=e[v];e[v]=16711935&(m<<8|m>>>24)|4278255360&(m<<24|m>>>8)}var y,b,_,P,E,x,C,w,j,S;x=y=t[0],C=b=t[1],w=_=t[2],j=P=t[3],S=E=t[4];for(var D,g=0;g<80;g+=1)D=y+e[u+l[g]]|0,D+=g<16?n(b,_,P)+f[0]:g<32?i(b,_,P)+f[1]:g<48?o(b,_,P)+f[2]:g<64?r(b,_,P)+f[3]:s(b,_,P)+f[4],D=0|D,D=a(D,h[g]),D=D+E|0,y=E,E=P,P=a(_,10),_=b,b=D,D=x+e[u+c[g]]|0,D+=g<16?s(C,w,j)+p[0]:g<32?r(C,w,j)+p[1]:g<48?o(C,w,j)+p[2]:g<64?i(C,w,j)+p[3]:n(C,w,j)+p[4],D=0|D,D=a(D,d[g]),D=D+S|0,x=S,S=j,j=a(w,10),w=C,C=D;D=t[1]+_+j|0,t[1]=t[2]+P+S|0,t[2]=t[3]+E+x|0,t[3]=t[4]+y+C|0,t[4]=t[0]+b+w|0,t[0]=D}}).call(e,n(1).Buffer)},function(t,e){t.exports=function(t){function e(e,n){this._block=new t(e),this._finalSize=n,this._blockSize=e,this._len=0,this._s=0}return e.prototype.init=function(){this._s=0,this._len=0},e.prototype.update=function(e,n){"string"==typeof e&&(n=n||"utf8",e=new t(e,n));for(var i=this._len+=e.length,o=this._s=this._s||0,r=0,s=this._block;o=8*this._finalSize&&(this._update(this._block),this._block.fill(0)),this._block.writeInt32BE(e,this._blockSize-4);var n=this._update(this._block)||this._hash();return t?n.toString(t):n},e.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e}},function(t,e,n){var e=t.exports=function(t){var n=e[t];if(!n)throw new Error(t+" is not supported (we accept pull requests)");return new n},i=n(1).Buffer,o=n(85)(i);e.sha1=n(87)(i,o),e.sha256=n(88)(i,o),e.sha512=n(89)(i,o)},function(t,e,n){var i=n(7).inherits;t.exports=function(t,e){function n(){return p.length?p.pop().init():this instanceof n?(this._w=f,e.call(this,64,56),this._h=null,void this.init()):new n}function o(t,e,n,i){return t<20?e&n|~e&i:t<40?e^n^i:t<60?e&n|e&i|n&i:e^n^i}function r(t){return t<20?1518500249:t<40?1859775393:t<60?-1894007588:-899497514}function s(t,e){return t+e|0}function a(t,e){return t<>>32-e}var u=0,l=4,c=8,h=12,d=16,f=new("undefined"==typeof Int32Array?Array:Int32Array)(80),p=[];return i(n,e),n.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,e.prototype.init.call(this),this},n.prototype._POOL=p,n.prototype._update=function(t){var e,n,i,u,l,c,h,d,f,p;e=c=this._a,n=h=this._b,i=d=this._c,u=f=this._d,l=p=this._e;for(var g=this._w,v=0;v<80;v++){var m=g[v]=v<16?t.readInt32BE(4*v):a(g[v-3]^g[v-8]^g[v-14]^g[v-16],1),y=s(s(a(e,5),o(v,n,i,u)),s(s(l,m),r(v)));l=u,u=i,i=a(n,30),n=e,e=y}this._a=s(e,c),this._b=s(n,h),this._c=s(i,d),this._d=s(u,f),this._e=s(l,p)},n.prototype._hash=function(){p.length<100&&p.push(this);var e=new t(20);return e.writeInt32BE(0|this._a,u),e.writeInt32BE(0|this._b,l),e.writeInt32BE(0|this._c,c),e.writeInt32BE(0|this._d,h),e.writeInt32BE(0|this._e,d),e},n}},function(t,e,n){var i=n(7).inherits;t.exports=function(t,e){function n(){this.init(),this._w=f,e.call(this,64,56)}function o(t,e){return t>>>e|t<<32-e}function r(t,e){return t>>>e}function s(t,e,n){return t&e^~t&n}function a(t,e,n){return t&e^t&n^e&n}function u(t){return o(t,2)^o(t,13)^o(t,22)}function l(t){return o(t,6)^o(t,11)^o(t,25)}function c(t){return o(t,7)^o(t,18)^r(t,3)}function h(t){return o(t,17)^o(t,19)^r(t,10)}var d=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],f=new Array(64);return i(n,e),n.prototype.init=function(){return this._a=1779033703,this._b=-1150833019,this._c=1013904242,this._d=-1521486534,this._e=1359893119,this._f=-1694144372,this._g=528734635,this._h=1541459225,this._len=this._s=0,this},n.prototype._update=function(t){var e,n,i,o,r,f,p,g,v,m,y=this._w;e=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,r=0|this._e,f=0|this._f,p=0|this._g,g=0|this._h;for(var b=0;b<64;b++){var _=y[b]=b<16?t.readInt32BE(4*b):h(y[b-2])+y[b-7]+c(y[b-15])+y[b-16];v=g+l(r)+s(r,f,p)+d[b]+_,m=u(e)+a(e,n,i),g=p,p=f,f=r,r=o+v,o=i,i=n,n=e,e=v+m}this._a=e+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=r+this._e|0,this._f=f+this._f|0,this._g=p+this._g|0,this._h=g+this._h|0},n.prototype._hash=function(){var e=new t(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},n}},function(t,e,n){var i=n(7).inherits;t.exports=function(t,e){function n(){this.init(),this._w=u,e.call(this,128,112)}function o(t,e,n){return t>>>n|e<<32-n}function r(t,e,n){return t&e^~t&n}function s(t,e,n){return t&e^t&n^e&n}var a=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],u=new Array(160);return i(n,e),n.prototype.init=function(){return this._a=1779033703,this._b=-1150833019,this._c=1013904242,this._d=-1521486534,this._e=1359893119,this._f=-1694144372,this._g=528734635,this._h=1541459225,this._al=-205731576,this._bl=-2067093701,this._cl=-23791573,this._dl=1595750129,this._el=-1377402159,this._fl=725511199,this._gl=-79577749,this._hl=327033209,this._len=this._s=0,this},n.prototype._update=function(t){var e,n,i,u,l,c,h,d,f,p,g,v,m,y,b,_,P=this._w;e=0|this._a,n=0|this._b,i=0|this._c,u=0|this._d,l=0|this._e,c=0|this._f,h=0|this._g,d=0|this._h,f=0|this._al,p=0|this._bl,g=0|this._cl,v=0|this._dl,m=0|this._el,y=0|this._fl,b=0|this._gl,_=0|this._hl;for(var E=0;E<80;E++){var x,C,w=2*E;if(E<16)x=P[w]=t.readInt32BE(4*w),C=P[w+1]=t.readInt32BE(4*w+4);else{var j=P[w-30],S=P[w-30+1],D=o(j,S,1)^o(j,S,8)^j>>>7,A=o(S,j,1)^o(S,j,8)^o(S,j,7);j=P[w-4],S=P[w-4+1];var I=o(j,S,19)^o(S,j,29)^j>>>6,O=o(S,j,19)^o(j,S,29)^o(S,j,6),k=P[w-14],T=P[w-14+1],M=P[w-32],L=P[w-32+1];C=A+T,x=D+k+(C>>>0>>0?1:0),C+=O,x=x+I+(C>>>0>>0?1:0),C+=L,x=x+M+(C>>>0>>0?1:0),P[w]=x,P[w+1]=C}var R=s(e,n,i),N=s(f,p,g),B=o(e,f,28)^o(f,e,2)^o(f,e,7),U=o(f,e,28)^o(e,f,2)^o(e,f,7),F=o(l,m,14)^o(l,m,18)^o(m,l,9),G=o(m,l,14)^o(m,l,18)^o(l,m,9),Y=a[w],z=a[w+1],H=r(l,c,h),X=r(m,y,b),W=_+G,V=d+F+(W>>>0<_>>>0?1:0);W+=X,V=V+H+(W>>>0>>0?1:0),W+=z,V=V+Y+(W>>>0>>0?1:0),W+=C,V=V+x+(W>>>0>>0?1:0);var q=U+N,J=B+R+(q>>>0>>0?1:0);d=h,_=b,h=c,b=y,c=l,y=m,m=v+W|0,l=u+V+(m>>>0>>0?1:0)|0,u=i,v=g,i=n,g=p,n=e,p=f,f=W+q|0,e=V+J+(f>>>0>>0?1:0)|0}this._al=this._al+f|0,this._bl=this._bl+p|0,this._cl=this._cl+g|0,this._dl=this._dl+v|0,this._el=this._el+m|0,this._fl=this._fl+y|0,this._gl=this._gl+b|0,this._hl=this._hl+_|0,this._a=this._a+e+(this._al>>>0>>0?1:0)|0,this._b=this._b+n+(this._bl>>>0

>>0?1:0)|0,this._c=this._c+i+(this._cl>>>0>>0?1:0)|0,this._d=this._d+u+(this._dl>>>0>>0?1:0)|0,this._e=this._e+l+(this._el>>>0>>0?1:0)|0,this._f=this._f+c+(this._fl>>>0>>0?1:0)|0,this._g=this._g+h+(this._gl>>>0>>0?1:0)|0,this._h=this._h+d+(this._hl>>>0<_>>>0?1:0)|0},n.prototype._hash=function(){function e(t,e,i){n.writeInt32BE(t,i),n.writeInt32BE(e,i+4)}var n=new t(64);return e(this._a,this._al,0),e(this._b,this._bl,8),e(this._c,this._cl,16),e(this._d,this._dl,24),e(this._e,this._el,32),e(this._f,this._fl,40),e(this._g,this._gl,48),e(this._h,this._hl,56),n},n}},function(t,e,n){var i=n(35);"string"==typeof i&&(i=[[t.id,i,""]]),n(22)(i,{}),i.locals&&(t.exports=i.locals)},function(t,e,n){var i=n(36);"string"==typeof i&&(i=[[t.id,i,""]]),n(22)(i,{}),i.locals&&(t.exports=i.locals)},function(t,e,n){t.exports=n(93)},function(t,e,n){(function(t,i){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var r,s=n(94),a=o(s);r="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof t?t:i;var u=(0,a["default"])(r);e["default"]=u}).call(e,function(){return this}(),n(23)(t))},function(t,e){"use strict";function n(t){var e,n=t.Symbol;return"function"==typeof n?n.observable?e=n.observable:(e=n("observable"),n.observable=e):e="@@observable",e}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},function(t,e){t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},function(t,e){}])}); \ No newline at end of file diff --git a/package.json b/package.json index 21ef3ab..67e2dbf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-dag", - "version": "1.2.2", + "version": "1.2.3", "description": "This is a base implementation of wrapping jsplumb with react + redux to be more usable in a react based environment", "main": "dist/react-dag.js", "scripts": {