vendor/assets/javascripts/vis-network.min.js in visjs-rails-4.16.1.0 vs vendor/assets/javascripts/vis-network.min.js in visjs-rails-4.21.0.0
- old
+ new
@@ -2,15 +2,15 @@
* vis.js
* https://github.com/almende/vis
*
* A dynamic, browser-based visualization library.
*
- * @version 4.16.1
- * @date 2016-04-18
+ * @version 4.21.0
+ * @date 2017-10-12
*
* @license
- * Copyright (C) 2011-2016 Almende B.V, http://almende.com
+ * Copyright (C) 2011-2017 Almende B.V, http://almende.com
*
* Vis.js is dual licensed under both
*
* * The Apache 2.0 License
* http://www.apache.org/licenses/LICENSE-2.0
@@ -20,22 +20,11 @@
* * The MIT License
* http://opensource.org/licenses/MIT
*
* Vis.js may be distributed under either license.
*/
-"use strict";!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.vis=t():e.vis=t()}(this,function(){return function(e){function t(o){if(i[o])return i[o].exports;var n=i[o]={exports:{},id:o,loaded:!1};return e[o].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var i={};return t.m=e,t.c=i,t.p="",t(0)}([function(e,t,i){t.util=i(1),t.DOMutil=i(7),t.DataSet=i(8),t.DataView=i(10),t.Queue=i(9),t.Network=i(11),t.network={Images:i(12),dotparser:i(77),gephiParser:i(78),allOptions:i(72)},t.network.convertDot=function(e){return t.network.dotparser.DOTToGraph(e)},t.network.convertGephi=function(e,i){return t.network.gephiParser.parseGephi(e,i)},t.moment=i(2),t.Hammer=i(58),t.keycharm=i(65)},function(e,t,i){var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},n=i(2),s=i(6);t.isNumber=function(e){return e instanceof Number||"number"==typeof e},t.recursiveDOMDelete=function(e){if(e)for(;e.hasChildNodes()===!0;)t.recursiveDOMDelete(e.firstChild),e.removeChild(e.firstChild)},t.giveRange=function(e,t,i,o){if(t==e)return.5;var n=1/(t-e);return Math.max(0,(o-e)*n)},t.isString=function(e){return e instanceof String||"string"==typeof e},t.isDate=function(e){if(e instanceof Date)return!0;if(t.isString(e)){var i=r.exec(e);if(i)return!0;if(!isNaN(Date.parse(e)))return!0}return!1},t.randomUUID=function(){return s.v4()},t.assignAllKeys=function(e,t){for(var i in e)e.hasOwnProperty(i)&&"object"!==o(e[i])&&(e[i]=t)},t.fillIfDefined=function(e,i){var n=arguments.length<=2||void 0===arguments[2]?!1:arguments[2];for(var s in e)void 0!==i[s]&&("object"!==o(i[s])?void 0!==i[s]&&null!==i[s]||void 0===e[s]||n!==!0?e[s]=i[s]:delete e[s]:"object"===o(e[s])&&t.fillIfDefined(e[s],i[s],n))},t.protoExtend=function(e,t){for(var i=1;i<arguments.length;i++){var o=arguments[i];for(var n in o)e[n]=o[n]}return e},t.extend=function(e,t){for(var i=1;i<arguments.length;i++){var o=arguments[i];for(var n in o)o.hasOwnProperty(n)&&(e[n]=o[n])}return e},t.selectiveExtend=function(e,t,i){if(!Array.isArray(e))throw new Error("Array with property names expected as first argument");for(var o=2;o<arguments.length;o++)for(var n=arguments[o],s=0;s<e.length;s++){var r=e[s];n.hasOwnProperty(r)&&(t[r]=n[r])}return t},t.selectiveDeepExtend=function(e,i,o){var n=arguments.length<=3||void 0===arguments[3]?!1:arguments[3];if(Array.isArray(o))throw new TypeError("Arrays are not supported by deepExtend");for(var s=2;s<arguments.length;s++)for(var r=arguments[s],a=0;a<e.length;a++){var h=e[a];if(r.hasOwnProperty(h))if(o[h]&&o[h].constructor===Object)void 0===i[h]&&(i[h]={}),i[h].constructor===Object?t.deepExtend(i[h],o[h],!1,n):null===o[h]&&void 0!==i[h]&&n===!0?delete i[h]:i[h]=o[h];else{if(Array.isArray(o[h]))throw new TypeError("Arrays are not supported by deepExtend");null===o[h]&&void 0!==i[h]&&n===!0?delete i[h]:i[h]=o[h]}}return i},t.selectiveNotDeepExtend=function(e,i,o){var n=arguments.length<=3||void 0===arguments[3]?!1:arguments[3];if(Array.isArray(o))throw new TypeError("Arrays are not supported by deepExtend");for(var s in o)if(o.hasOwnProperty(s)&&-1==e.indexOf(s))if(o[s]&&o[s].constructor===Object)void 0===i[s]&&(i[s]={}),i[s].constructor===Object?t.deepExtend(i[s],o[s]):null===o[s]&&void 0!==i[s]&&n===!0?delete i[s]:i[s]=o[s];else if(Array.isArray(o[s])){i[s]=[];for(var r=0;r<o[s].length;r++)i[s].push(o[s][r])}else null===o[s]&&void 0!==i[s]&&n===!0?delete i[s]:i[s]=o[s];return i},t.deepExtend=function(e,i,o,n){for(var s in i)if(i.hasOwnProperty(s)||o===!0)if(i[s]&&i[s].constructor===Object)void 0===e[s]&&(e[s]={}),e[s].constructor===Object?t.deepExtend(e[s],i[s],o):null===i[s]&&void 0!==e[s]&&n===!0?delete e[s]:e[s]=i[s];else if(Array.isArray(i[s])){e[s]=[];for(var r=0;r<i[s].length;r++)e[s].push(i[s][r])}else null===i[s]&&void 0!==e[s]&&n===!0?delete e[s]:e[s]=i[s];return e},t.equalArray=function(e,t){if(e.length!=t.length)return!1;for(var i=0,o=e.length;o>i;i++)if(e[i]!=t[i])return!1;return!0},t.convert=function(e,i){var o;if(void 0!==e){if(null===e)return null;if(!i)return e;if("string"!=typeof i&&!(i instanceof String))throw new Error("Type must be a string");switch(i){case"boolean":case"Boolean":return Boolean(e);case"number":case"Number":return Number(e.valueOf());case"string":case"String":return String(e);case"Date":if(t.isNumber(e))return new Date(e);if(e instanceof Date)return new Date(e.valueOf());if(n.isMoment(e))return new Date(e.valueOf());if(t.isString(e))return o=r.exec(e),o?new Date(Number(o[1])):n(e).toDate();throw new Error("Cannot convert object of type "+t.getType(e)+" to type Date");case"Moment":if(t.isNumber(e))return n(e);if(e instanceof Date)return n(e.valueOf());if(n.isMoment(e))return n(e);if(t.isString(e))return o=r.exec(e),n(o?Number(o[1]):e);throw new Error("Cannot convert object of type "+t.getType(e)+" to type Date");case"ISODate":if(t.isNumber(e))return new Date(e);if(e instanceof Date)return e.toISOString();if(n.isMoment(e))return e.toDate().toISOString();if(t.isString(e))return o=r.exec(e),o?new Date(Number(o[1])).toISOString():new Date(e).toISOString();throw new Error("Cannot convert object of type "+t.getType(e)+" to type ISODate");case"ASPDate":if(t.isNumber(e))return"/Date("+e+")/";if(e instanceof Date)return"/Date("+e.valueOf()+")/";if(t.isString(e)){o=r.exec(e);var s;return s=o?new Date(Number(o[1])).valueOf():new Date(e).valueOf(),"/Date("+s+")/"}throw new Error("Cannot convert object of type "+t.getType(e)+" to type ASPDate");default:throw new Error('Unknown type "'+i+'"')}}};var r=/^\/?Date\((\-?\d+)/i;t.getType=function(e){var t="undefined"==typeof e?"undefined":o(e);return"object"==t?null===e?"null":e instanceof Boolean?"Boolean":e instanceof Number?"Number":e instanceof String?"String":Array.isArray(e)?"Array":e instanceof Date?"Date":"Object":"number"==t?"Number":"boolean"==t?"Boolean":"string"==t?"String":void 0===t?"undefined":t},t.copyAndExtendArray=function(e,t){for(var i=[],o=0;o<e.length;o++)i.push(e[o]);return i.push(t),i},t.copyArray=function(e){for(var t=[],i=0;i<e.length;i++)t.push(e[i]);return t},t.getAbsoluteLeft=function(e){return e.getBoundingClientRect().left},t.getAbsoluteRight=function(e){return e.getBoundingClientRect().right},t.getAbsoluteTop=function(e){return e.getBoundingClientRect().top},t.addClassName=function(e,t){var i=e.className.split(" ");-1==i.indexOf(t)&&(i.push(t),e.className=i.join(" "))},t.removeClassName=function(e,t){var i=e.className.split(" "),o=i.indexOf(t);-1!=o&&(i.splice(o,1),e.className=i.join(" "))},t.forEach=function(e,t){var i,o;if(Array.isArray(e))for(i=0,o=e.length;o>i;i++)t(e[i],i,e);else for(i in e)e.hasOwnProperty(i)&&t(e[i],i,e)},t.toArray=function(e){var t=[];for(var i in e)e.hasOwnProperty(i)&&t.push(e[i]);return t},t.updateProperty=function(e,t,i){return e[t]!==i?(e[t]=i,!0):!1},t.throttle=function(e,t){var i=null,o=!1;return function n(){i?o=!0:(o=!1,e(),i=setTimeout(function(){i=null,o&&n()},t))}},t.addEventListener=function(e,t,i,o){e.addEventListener?(void 0===o&&(o=!1),"mousewheel"===t&&navigator.userAgent.indexOf("Firefox")>=0&&(t="DOMMouseScroll"),e.addEventListener(t,i,o)):e.attachEvent("on"+t,i)},t.removeEventListener=function(e,t,i,o){e.removeEventListener?(void 0===o&&(o=!1),"mousewheel"===t&&navigator.userAgent.indexOf("Firefox")>=0&&(t="DOMMouseScroll"),e.removeEventListener(t,i,o)):e.detachEvent("on"+t,i)},t.preventDefault=function(e){e||(e=window.event),e.preventDefault?e.preventDefault():e.returnValue=!1},t.getTarget=function(e){e||(e=window.event);var t;return e.target?t=e.target:e.srcElement&&(t=e.srcElement),void 0!=t.nodeType&&3==t.nodeType&&(t=t.parentNode),t},t.hasParent=function(e,t){for(var i=e;i;){if(i===t)return!0;i=i.parentNode}return!1},t.option={},t.option.asBoolean=function(e,t){return"function"==typeof e&&(e=e()),null!=e?0!=e:t||null},t.option.asNumber=function(e,t){return"function"==typeof e&&(e=e()),null!=e?Number(e)||t||null:t||null},t.option.asString=function(e,t){return"function"==typeof e&&(e=e()),null!=e?String(e):t||null},t.option.asSize=function(e,i){return"function"==typeof e&&(e=e()),t.isString(e)?e:t.isNumber(e)?e+"px":i||null},t.option.asElement=function(e,t){return"function"==typeof e&&(e=e()),e||t||null},t.hexToRGB=function(e){var t=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;e=e.replace(t,function(e,t,i,o){return t+t+i+i+o+o});var i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return i?{r:parseInt(i[1],16),g:parseInt(i[2],16),b:parseInt(i[3],16)}:null},t.overrideOpacity=function(e,i){if(-1!=e.indexOf("rgba"))return e;if(-1!=e.indexOf("rgb")){var o=e.substr(e.indexOf("(")+1).replace(")","").split(",");return"rgba("+o[0]+","+o[1]+","+o[2]+","+i+")"}var o=t.hexToRGB(e);return null==o?e:"rgba("+o.r+","+o.g+","+o.b+","+i+")"},t.RGBToHex=function(e,t,i){return"#"+((1<<24)+(e<<16)+(t<<8)+i).toString(16).slice(1)},t.parseColor=function(e){var i;if(t.isString(e)===!0){if(t.isValidRGB(e)===!0){var o=e.substr(4).substr(0,e.length-5).split(",").map(function(e){return parseInt(e)});e=t.RGBToHex(o[0],o[1],o[2])}if(t.isValidHex(e)===!0){var n=t.hexToHSV(e),s={h:n.h,s:.8*n.s,v:Math.min(1,1.02*n.v)},r={h:n.h,s:Math.min(1,1.25*n.s),v:.8*n.v},a=t.HSVToHex(r.h,r.s,r.v),h=t.HSVToHex(s.h,s.s,s.v);i={background:e,border:a,highlight:{background:h,border:a},hover:{background:h,border:a}}}else i={background:e,border:e,highlight:{background:e,border:e},hover:{background:e,border:e}}}else i={},i.background=e.background||void 0,i.border=e.border||void 0,t.isString(e.highlight)?i.highlight={border:e.highlight,background:e.highlight}:(i.highlight={},i.highlight.background=e.highlight&&e.highlight.background||void 0,i.highlight.border=e.highlight&&e.highlight.border||void 0),t.isString(e.hover)?i.hover={border:e.hover,background:e.hover}:(i.hover={},i.hover.background=e.hover&&e.hover.background||void 0,i.hover.border=e.hover&&e.hover.border||void 0);return i},t.RGBToHSV=function(e,t,i){e/=255,t/=255,i/=255;var o=Math.min(e,Math.min(t,i)),n=Math.max(e,Math.max(t,i));if(o==n)return{h:0,s:0,v:o};var s=e==o?t-i:i==o?e-t:i-e,r=e==o?3:i==o?1:5,a=60*(r-s/(n-o))/360,h=(n-o)/n,d=n;return{h:a,s:h,v:d}};var a={split:function(e){var t={};return e.split(";").forEach(function(e){if(""!=e.trim()){var i=e.split(":"),o=i[0].trim(),n=i[1].trim();t[o]=n}}),t},join:function(e){return Object.keys(e).map(function(t){return t+": "+e[t]}).join("; ")}};t.addCssText=function(e,i){var o=a.split(e.style.cssText),n=a.split(i),s=t.extend(o,n);e.style.cssText=a.join(s)},t.removeCssText=function(e,t){var i=a.split(e.style.cssText),o=a.split(t);for(var n in o)o.hasOwnProperty(n)&&delete i[n];e.style.cssText=a.join(i)},t.HSVToRGB=function(e,t,i){var o,n,s,r=Math.floor(6*e),a=6*e-r,h=i*(1-t),d=i*(1-a*t),l=i*(1-(1-a)*t);switch(r%6){case 0:o=i,n=l,s=h;break;case 1:o=d,n=i,s=h;break;case 2:o=h,n=i,s=l;break;case 3:o=h,n=d,s=i;break;case 4:o=l,n=h,s=i;break;case 5:o=i,n=h,s=d}return{r:Math.floor(255*o),g:Math.floor(255*n),b:Math.floor(255*s)}},t.HSVToHex=function(e,i,o){var n=t.HSVToRGB(e,i,o);return t.RGBToHex(n.r,n.g,n.b)},t.hexToHSV=function(e){var i=t.hexToRGB(e);return t.RGBToHSV(i.r,i.g,i.b)},t.isValidHex=function(e){var t=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(e);return t},t.isValidRGB=function(e){e=e.replace(" ","");var t=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/i.test(e);return t},t.isValidRGBA=function(e){e=e.replace(" ","");var t=/rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(.{1,3})\)/i.test(e);return t},t.selectiveBridgeObject=function(e,i){if("object"==("undefined"==typeof i?"undefined":o(i))){for(var n=Object.create(i),s=0;s<e.length;s++)i.hasOwnProperty(e[s])&&"object"==o(i[e[s]])&&(n[e[s]]=t.bridgeObject(i[e[s]]));return n}return null},t.bridgeObject=function(e){if("object"==("undefined"==typeof e?"undefined":o(e))){var i=Object.create(e);for(var n in e)e.hasOwnProperty(n)&&"object"==o(e[n])&&(i[n]=t.bridgeObject(e[n]));return i}return null},t.insertSort=function(e,t){for(var i=0;i<e.length;i++){for(var o=e[i],n=i;n>0&&t(o,e[n-1])<0;n--)e[n]=e[n-1];e[n]=o}return e},t.mergeOptions=function(e,t,i){var o=(arguments.length<=3||void 0===arguments[3]?!1:arguments[3],arguments.length<=4||void 0===arguments[4]?{}:arguments[4]);if(null===t[i])e[i]=Object.create(o[i]);else if(void 0!==t[i])if("boolean"==typeof t[i])e[i].enabled=t[i];else{void 0===t[i].enabled&&(e[i].enabled=!0);for(var n in t[i])t[i].hasOwnProperty(n)&&(e[i][n]=t[i][n])}},t.binarySearchCustom=function(e,t,i,o){for(var n=1e4,s=0,r=0,a=e.length-1;a>=r&&n>s;){var h=Math.floor((r+a)/2),d=e[h],l=void 0===o?d[i]:d[i][o],c=t(l);if(0==c)return h;-1==c?r=h+1:a=h-1,s++}return-1},t.binarySearchValue=function(e,t,i,o,n){for(var s,r,a,h,d=1e4,l=0,c=0,u=e.length-1,n=void 0!=n?n:function(e,t){return e==t?0:t>e?-1:1};u>=c&&d>l;){if(h=Math.floor(.5*(u+c)),s=e[Math.max(0,h-1)][i],r=e[h][i],a=e[Math.min(e.length-1,h+1)][i],0==n(r,t))return h;if(n(s,t)<0&&n(r,t)>0)return"before"==o?Math.max(0,h-1):h;if(n(r,t)<0&&n(a,t)>0)return"before"==o?h:Math.min(e.length-1,h+1);n(r,t)<0?c=h+1:u=h-1,l++}return-1},t.easingFunctions={linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return e*(2-e)},easeInOutQuad:function(e){return.5>e?2*e*e:-1+(4-2*e)*e},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return--e*e*e+1},easeInOutCubic:function(e){return.5>e?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return 1- --e*e*e*e},easeInOutQuart:function(e){return.5>e?8*e*e*e*e:1-8*--e*e*e*e},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return 1+--e*e*e*e*e},easeInOutQuint:function(e){return.5>e?16*e*e*e*e*e:1+16*--e*e*e*e*e}}},function(e,t,i){e.exports="undefined"!=typeof window&&window.moment||i(3)},function(e,t,i){(function(e){!function(t,i){e.exports=i()}(this,function(){function t(){return ro.apply(null,arguments)}function i(e){ro=e}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function n(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function s(e,t){var i,o=[];for(i=0;i<e.length;++i)o.push(t(e[i],i));return o}function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function a(e,t){for(var i in t)r(t,i)&&(e[i]=t[i]);return r(t,"toString")&&(e.toString=t.toString),r(t,"valueOf")&&(e.valueOf=t.valueOf),e}function h(e,t,i,o){return Ne(e,t,i,o,!0).utc()}function d(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null}}function l(e){return null==e._pf&&(e._pf=d()),e._pf}function c(e){if(null==e._isValid){var t=l(e),i=ao.call(t.parsedDateParts,function(e){return null!=e});e._isValid=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&i),e._strict&&(e._isValid=e._isValid&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour)}return e._isValid}function u(e){var t=h(NaN);return null!=e?a(l(t),e):l(t).userInvalidated=!0,t}function f(e){return void 0===e}function p(e,t){var i,o,n;if(f(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),f(t._i)||(e._i=t._i),f(t._f)||(e._f=t._f),f(t._l)||(e._l=t._l),f(t._strict)||(e._strict=t._strict),f(t._tzm)||(e._tzm=t._tzm),f(t._isUTC)||(e._isUTC=t._isUTC),f(t._offset)||(e._offset=t._offset),f(t._pf)||(e._pf=l(t)),f(t._locale)||(e._locale=t._locale),ho.length>0)for(i in ho)o=ho[i],n=t[o],f(n)||(e[o]=n);return e}function v(e){p(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),lo===!1&&(lo=!0,t.updateOffset(this),lo=!1)}function y(e){return e instanceof v||null!=e&&null!=e._isAMomentObject}function g(e){return 0>e?Math.ceil(e):Math.floor(e)}function b(e){var t=+e,i=0;return 0!==t&&isFinite(t)&&(i=g(t)),i}function m(e,t,i){var o,n=Math.min(e.length,t.length),s=Math.abs(e.length-t.length),r=0;for(o=0;n>o;o++)(i&&e[o]!==t[o]||!i&&b(e[o])!==b(t[o]))&&r++;return r+s}function _(e){t.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function w(e,i){var o=!0;return a(function(){return null!=t.deprecationHandler&&t.deprecationHandler(null,e),o&&(_(e+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),o=!1),i.apply(this,arguments)},i)}function k(e,i){null!=t.deprecationHandler&&t.deprecationHandler(e,i),co[e]||(_(i),co[e]=!0)}function x(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function O(e){return"[object Object]"===Object.prototype.toString.call(e)}function E(e){var t,i;for(i in e)t=e[i],x(t)?this[i]=t:this["_"+i]=t;this._config=e,this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function M(e,t){var i,o=a({},e);for(i in t)r(t,i)&&(O(e[i])&&O(t[i])?(o[i]={},a(o[i],e[i]),a(o[i],t[i])):null!=t[i]?o[i]=t[i]:delete o[i]);return o}function D(e){null!=e&&this.set(e)}function S(e){return e?e.toLowerCase().replace("_","-"):e}function C(e){for(var t,i,o,n,s=0;s<e.length;){for(n=S(e[s]).split("-"),t=n.length,i=S(e[s+1]),i=i?i.split("-"):null;t>0;){if(o=T(n.slice(0,t).join("-")))return o;if(i&&i.length>=t&&m(n,i,!0)>=t-1)break;t--}s++}return null}function T(t){var i=null;if(!vo[t]&&"undefined"!=typeof e&&e&&e.exports)try{i=fo._abbr,!function(){var e=new Error('Cannot find module "./locale"');throw e.code="MODULE_NOT_FOUND",e}(),P(i)}catch(o){}return vo[t]}function P(e,t){var i;return e&&(i=f(t)?I(e):B(e,t),i&&(fo=i)),fo._abbr}function B(e,t){return null!==t?(t.abbr=e,null!=vo[e]?(k("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale"),t=M(vo[e]._config,t)):null!=t.parentLocale&&(null!=vo[t.parentLocale]?t=M(vo[t.parentLocale]._config,t):k("parentLocaleUndefined","specified parentLocale is not defined yet")),vo[e]=new D(t),P(e),vo[e]):(delete vo[e],null)}function F(e,t){if(null!=t){var i;null!=vo[e]&&(t=M(vo[e]._config,t)),i=new D(t),i.parentLocale=vo[e],vo[e]=i,P(e)}else null!=vo[e]&&(null!=vo[e].parentLocale?vo[e]=vo[e].parentLocale:null!=vo[e]&&delete vo[e]);return vo[e]}function I(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return fo;if(!o(e)){if(t=T(e))return t;e=[e]}return C(e)}function j(){return uo(vo)}function N(e,t){var i=e.toLowerCase();yo[i]=yo[i+"s"]=yo[t]=e}function z(e){return"string"==typeof e?yo[e]||yo[e.toLowerCase()]:void 0}function R(e){var t,i,o={};for(i in e)r(e,i)&&(t=z(i),t&&(o[t]=e[i]));return o}function A(e,i){return function(o){return null!=o?(H(this,e,o),t.updateOffset(this,i),this):L(this,e)}}function L(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function H(e,t,i){e.isValid()&&e._d["set"+(e._isUTC?"UTC":"")+t](i)}function W(e,t){var i;if("object"==typeof e)for(i in e)this.set(i,e[i]);else if(e=z(e),x(this[e]))return this[e](t);return this}function Y(e,t,i){var o=""+Math.abs(e),n=t-o.length,s=e>=0;return(s?i?"+":"":"-")+Math.pow(10,Math.max(0,n)).toString().substr(1)+o}function U(e,t,i,o){var n=o;"string"==typeof o&&(n=function(){return this[o]()}),e&&(_o[e]=n),t&&(_o[t[0]]=function(){return Y(n.apply(this,arguments),t[1],t[2])}),i&&(_o[i]=function(){return this.localeData().ordinal(n.apply(this,arguments),e)})}function V(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function q(e){var t,i,o=e.match(go);for(t=0,i=o.length;i>t;t++)_o[o[t]]?o[t]=_o[o[t]]:o[t]=V(o[t]);return function(t){var n,s="";for(n=0;i>n;n++)s+=o[n]instanceof Function?o[n].call(t,e):o[n];return s}}function G(e,t){return e.isValid()?(t=X(t,e.localeData()),mo[t]=mo[t]||q(t),mo[t](e)):e.localeData().invalidDate()}function X(e,t){function i(e){return t.longDateFormat(e)||e}var o=5;for(bo.lastIndex=0;o>=0&&bo.test(e);)e=e.replace(bo,i),bo.lastIndex=0,o-=1;return e}function K(e,t,i){Ro[e]=x(t)?t:function(e,o){return e&&i?i:t}}function Z(e,t){return r(Ro,e)?Ro[e](t._strict,t._locale):new RegExp(Q(e))}function Q(e){return J(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,i,o,n){return t||i||o||n}))}function J(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function $(e,t){var i,o=t;for("string"==typeof e&&(e=[e]),"number"==typeof t&&(o=function(e,i){i[t]=b(e)}),i=0;i<e.length;i++)Ao[e[i]]=o}function ee(e,t){$(e,function(e,i,o,n){o._w=o._w||{},t(e,o._w,o,n)})}function te(e,t,i){null!=t&&r(Ao,e)&&Ao[e](t,i._a,i,e)}function ie(e,t){return new Date(Date.UTC(e,t+1,0)).getUTCDate()}function oe(e,t){return o(this._months)?this._months[e.month()]:this._months[Ko.test(t)?"format":"standalone"][e.month()]}function ne(e,t){return o(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Ko.test(t)?"format":"standalone"][e.month()]}function se(e,t,i){var o,n,s,r=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],o=0;12>o;++o)s=h([2e3,o]),this._shortMonthsParse[o]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[o]=this.months(s,"").toLocaleLowerCase();return i?"MMM"===t?(n=po.call(this._shortMonthsParse,r),-1!==n?n:null):(n=po.call(this._longMonthsParse,r),-1!==n?n:null):"MMM"===t?(n=po.call(this._shortMonthsParse,r),-1!==n?n:(n=po.call(this._longMonthsParse,r),-1!==n?n:null)):(n=po.call(this._longMonthsParse,r),-1!==n?n:(n=po.call(this._shortMonthsParse,r),-1!==n?n:null))}function re(e,t,i){var o,n,s;if(this._monthsParseExact)return se.call(this,e,t,i);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),o=0;12>o;o++){if(n=h([2e3,o]),i&&!this._longMonthsParse[o]&&(this._longMonthsParse[o]=new RegExp("^"+this.months(n,"").replace(".","")+"$","i"),this._shortMonthsParse[o]=new RegExp("^"+this.monthsShort(n,"").replace(".","")+"$","i")),i||this._monthsParse[o]||(s="^"+this.months(n,"")+"|^"+this.monthsShort(n,""),this._monthsParse[o]=new RegExp(s.replace(".",""),"i")),i&&"MMMM"===t&&this._longMonthsParse[o].test(e))return o;if(i&&"MMM"===t&&this._shortMonthsParse[o].test(e))return o;if(!i&&this._monthsParse[o].test(e))return o}}function ae(e,t){var i;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=b(t);else if(t=e.localeData().monthsParse(t),"number"!=typeof t)return e;return i=Math.min(e.date(),ie(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,i),e}function he(e){return null!=e?(ae(this,e),t.updateOffset(this,!0),this):L(this,"Month")}function de(){return ie(this.year(),this.month())}function le(e){return this._monthsParseExact?(r(this,"_monthsRegex")||ue.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex}function ce(e){return this._monthsParseExact?(r(this,"_monthsRegex")||ue.call(this),e?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex}function ue(){function e(e,t){return t.length-e.length}var t,i,o=[],n=[],s=[];for(t=0;12>t;t++)i=h([2e3,t]),o.push(this.monthsShort(i,"")),n.push(this.months(i,"")),s.push(this.months(i,"")),s.push(this.monthsShort(i,""));for(o.sort(e),n.sort(e),s.sort(e),t=0;12>t;t++)o[t]=J(o[t]),n[t]=J(n[t]),s[t]=J(s[t]);this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+o.join("|")+")","i")}function fe(e){var t,i=e._a;return i&&-2===l(e).overflow&&(t=i[Ho]<0||i[Ho]>11?Ho:i[Wo]<1||i[Wo]>ie(i[Lo],i[Ho])?Wo:i[Yo]<0||i[Yo]>24||24===i[Yo]&&(0!==i[Uo]||0!==i[Vo]||0!==i[qo])?Yo:i[Uo]<0||i[Uo]>59?Uo:i[Vo]<0||i[Vo]>59?Vo:i[qo]<0||i[qo]>999?qo:-1,l(e)._overflowDayOfYear&&(Lo>t||t>Wo)&&(t=Wo),l(e)._overflowWeeks&&-1===t&&(t=Go),l(e)._overflowWeekday&&-1===t&&(t=Xo),l(e).overflow=t),e}function pe(e){var t,i,o,n,s,r,a=e._i,h=en.exec(a)||tn.exec(a);if(h){for(l(e).iso=!0,t=0,i=nn.length;i>t;t++)if(nn[t][1].exec(h[1])){n=nn[t][0],o=nn[t][2]!==!1;break}if(null==n)return void(e._isValid=!1);if(h[3]){for(t=0,i=sn.length;i>t;t++)if(sn[t][1].exec(h[3])){s=(h[2]||" ")+sn[t][0];break}if(null==s)return void(e._isValid=!1)}if(!o&&null!=s)return void(e._isValid=!1);if(h[4]){if(!on.exec(h[4]))return void(e._isValid=!1);r="Z"}e._f=n+(s||"")+(r||""),Ce(e)}else e._isValid=!1}function ve(e){var i=rn.exec(e._i);return null!==i?void(e._d=new Date(+i[1])):(pe(e),void(e._isValid===!1&&(delete e._isValid,t.createFromInputFallback(e))))}function ye(e,t,i,o,n,s,r){var a=new Date(e,t,i,o,n,s,r);return 100>e&&e>=0&&isFinite(a.getFullYear())&&a.setFullYear(e),a}function ge(e){var t=new Date(Date.UTC.apply(null,arguments));return 100>e&&e>=0&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function be(e){return me(e)?366:365}function me(e){return e%4===0&&e%100!==0||e%400===0}function _e(){return me(this.year())}function we(e,t,i){var o=7+t-i,n=(7+ge(e,0,o).getUTCDay()-t)%7;return-n+o-1}function ke(e,t,i,o,n){var s,r,a=(7+i-o)%7,h=we(e,o,n),d=1+7*(t-1)+a+h;return 0>=d?(s=e-1,r=be(s)+d):d>be(e)?(s=e+1,r=d-be(e)):(s=e,r=d),{year:s,dayOfYear:r}}function xe(e,t,i){var o,n,s=we(e.year(),t,i),r=Math.floor((e.dayOfYear()-s-1)/7)+1;return 1>r?(n=e.year()-1,o=r+Oe(n,t,i)):r>Oe(e.year(),t,i)?(o=r-Oe(e.year(),t,i),n=e.year()+1):(n=e.year(),o=r),{week:o,year:n}}function Oe(e,t,i){var o=we(e,t,i),n=we(e+1,t,i);return(be(e)-o+n)/7}function Ee(e,t,i){return null!=e?e:null!=t?t:i}function Me(e){var i=new Date(t.now());return e._useUTC?[i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()]:[i.getFullYear(),i.getMonth(),i.getDate()]}function De(e){var t,i,o,n,s=[];if(!e._d){for(o=Me(e),e._w&&null==e._a[Wo]&&null==e._a[Ho]&&Se(e),e._dayOfYear&&(n=Ee(e._a[Lo],o[Lo]),e._dayOfYear>be(n)&&(l(e)._overflowDayOfYear=!0),i=ge(n,0,e._dayOfYear),e._a[Ho]=i.getUTCMonth(),e._a[Wo]=i.getUTCDate()),t=0;3>t&&null==e._a[t];++t)e._a[t]=s[t]=o[t];for(;7>t;t++)e._a[t]=s[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[Yo]&&0===e._a[Uo]&&0===e._a[Vo]&&0===e._a[qo]&&(e._nextDay=!0,e._a[Yo]=0),e._d=(e._useUTC?ge:ye).apply(null,s),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Yo]=24)}}function Se(e){var t,i,o,n,s,r,a,h;t=e._w,null!=t.GG||null!=t.W||null!=t.E?(s=1,r=4,i=Ee(t.GG,e._a[Lo],xe(ze(),1,4).year),o=Ee(t.W,1),n=Ee(t.E,1),(1>n||n>7)&&(h=!0)):(s=e._locale._week.dow,r=e._locale._week.doy,i=Ee(t.gg,e._a[Lo],xe(ze(),s,r).year),o=Ee(t.w,1),null!=t.d?(n=t.d,(0>n||n>6)&&(h=!0)):null!=t.e?(n=t.e+s,(t.e<0||t.e>6)&&(h=!0)):n=s),1>o||o>Oe(i,s,r)?l(e)._overflowWeeks=!0:null!=h?l(e)._overflowWeekday=!0:(a=ke(i,o,n,s,r),e._a[Lo]=a.year,e._dayOfYear=a.dayOfYear)}function Ce(e){if(e._f===t.ISO_8601)return void pe(e);e._a=[],l(e).empty=!0;var i,o,n,s,r,a=""+e._i,h=a.length,d=0;for(n=X(e._f,e._locale).match(go)||[],i=0;i<n.length;i++)s=n[i],o=(a.match(Z(s,e))||[])[0],o&&(r=a.substr(0,a.indexOf(o)),r.length>0&&l(e).unusedInput.push(r),a=a.slice(a.indexOf(o)+o.length),d+=o.length),_o[s]?(o?l(e).empty=!1:l(e).unusedTokens.push(s),te(s,o,e)):e._strict&&!o&&l(e).unusedTokens.push(s);l(e).charsLeftOver=h-d,a.length>0&&l(e).unusedInput.push(a),l(e).bigHour===!0&&e._a[Yo]<=12&&e._a[Yo]>0&&(l(e).bigHour=void 0),l(e).parsedDateParts=e._a.slice(0),l(e).meridiem=e._meridiem,e._a[Yo]=Te(e._locale,e._a[Yo],e._meridiem),De(e),fe(e)}function Te(e,t,i){var o;return null==i?t:null!=e.meridiemHour?e.meridiemHour(t,i):null!=e.isPM?(o=e.isPM(i),o&&12>t&&(t+=12),o||12!==t||(t=0),t):t}function Pe(e){var t,i,o,n,s;if(0===e._f.length)return l(e).invalidFormat=!0,void(e._d=new Date(NaN));for(n=0;n<e._f.length;n++)s=0,t=p({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[n],Ce(t),c(t)&&(s+=l(t).charsLeftOver,s+=10*l(t).unusedTokens.length,l(t).score=s,(null==o||o>s)&&(o=s,i=t));a(e,i||t)}function Be(e){if(!e._d){var t=R(e._i);e._a=s([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),De(e)}}function Fe(e){var t=new v(fe(Ie(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Ie(e){var t=e._i,i=e._f;return e._locale=e._locale||I(e._l),null===t||void 0===i&&""===t?u({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),y(t)?new v(fe(t)):(o(i)?Pe(e):i?Ce(e):n(t)?e._d=t:je(e),c(e)||(e._d=null),e))}function je(e){var i=e._i;void 0===i?e._d=new Date(t.now()):n(i)?e._d=new Date(i.valueOf()):"string"==typeof i?ve(e):o(i)?(e._a=s(i.slice(0),function(e){return parseInt(e,10)}),De(e)):"object"==typeof i?Be(e):"number"==typeof i?e._d=new Date(i):t.createFromInputFallback(e)}function Ne(e,t,i,o,n){var s={};return"boolean"==typeof i&&(o=i,i=void 0),s._isAMomentObject=!0,s._useUTC=s._isUTC=n,s._l=i,s._i=e,s._f=t,s._strict=o,Fe(s)}function ze(e,t,i,o){return Ne(e,t,i,o,!1)}function Re(e,t){var i,n;if(1===t.length&&o(t[0])&&(t=t[0]),!t.length)return ze();for(i=t[0],n=1;n<t.length;++n)t[n].isValid()&&!t[n][e](i)||(i=t[n]);return i}function Ae(){var e=[].slice.call(arguments,0);return Re("isBefore",e)}function Le(){var e=[].slice.call(arguments,0);return Re("isAfter",e)}function He(e){var t=R(e),i=t.year||0,o=t.quarter||0,n=t.month||0,s=t.week||0,r=t.day||0,a=t.hour||0,h=t.minute||0,d=t.second||0,l=t.millisecond||0;this._milliseconds=+l+1e3*d+6e4*h+1e3*a*60*60,this._days=+r+7*s,this._months=+n+3*o+12*i,this._data={},this._locale=I(),this._bubble()}function We(e){return e instanceof He}function Ye(e,t){U(e,0,0,function(){var e=this.utcOffset(),i="+";return 0>e&&(e=-e,i="-"),i+Y(~~(e/60),2)+t+Y(~~e%60,2)})}function Ue(e,t){var i=(t||"").match(e)||[],o=i[i.length-1]||[],n=(o+"").match(cn)||["-",0,0],s=+(60*n[1])+b(n[2]);return"+"===n[0]?s:-s}function Ve(e,i){var o,s;return i._isUTC?(o=i.clone(),s=(y(e)||n(e)?e.valueOf():ze(e).valueOf())-o.valueOf(),o._d.setTime(o._d.valueOf()+s),t.updateOffset(o,!1),o):ze(e).local()}function qe(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Ge(e,i){var o,n=this._offset||0;return this.isValid()?null!=e?("string"==typeof e?e=Ue(jo,e):Math.abs(e)<16&&(e=60*e),!this._isUTC&&i&&(o=qe(this)),this._offset=e,this._isUTC=!0,null!=o&&this.add(o,"m"),n!==e&&(!i||this._changeInProgress?lt(this,nt(e-n,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,t.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?n:qe(this):null!=e?this:NaN}function Xe(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function Ke(e){return this.utcOffset(0,e)}function Ze(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(qe(this),"m")),this}function Qe(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Ue(Io,this._i)),this}function Je(e){return this.isValid()?(e=e?ze(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function $e(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function et(){if(!f(this._isDSTShifted))return this._isDSTShifted;var e={};if(p(e,this),e=Ie(e),e._a){var t=e._isUTC?h(e._a):ze(e._a);this._isDSTShifted=this.isValid()&&m(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function tt(){return this.isValid()?!this._isUTC:!1}function it(){return this.isValid()?this._isUTC:!1}function ot(){return this.isValid()?this._isUTC&&0===this._offset:!1}function nt(e,t){var i,o,n,s=e,a=null;return We(e)?s={ms:e._milliseconds,d:e._days,M:e._months}:"number"==typeof e?(s={},t?s[t]=e:s.milliseconds=e):(a=un.exec(e))?(i="-"===a[1]?-1:1,s={y:0,d:b(a[Wo])*i,h:b(a[Yo])*i,m:b(a[Uo])*i,s:b(a[Vo])*i,ms:b(a[qo])*i}):(a=fn.exec(e))?(i="-"===a[1]?-1:1,s={y:st(a[2],i),M:st(a[3],i),w:st(a[4],i),d:st(a[5],i),h:st(a[6],i),m:st(a[7],i),s:st(a[8],i)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(n=at(ze(s.from),ze(s.to)),s={},
-s.ms=n.milliseconds,s.M=n.months),o=new He(s),We(e)&&r(e,"_locale")&&(o._locale=e._locale),o}function st(e,t){var i=e&&parseFloat(e.replace(",","."));return(isNaN(i)?0:i)*t}function rt(e,t){var i={milliseconds:0,months:0};return i.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(i.months,"M").isAfter(t)&&--i.months,i.milliseconds=+t-+e.clone().add(i.months,"M"),i}function at(e,t){var i;return e.isValid()&&t.isValid()?(t=Ve(t,e),e.isBefore(t)?i=rt(e,t):(i=rt(t,e),i.milliseconds=-i.milliseconds,i.months=-i.months),i):{milliseconds:0,months:0}}function ht(e){return 0>e?-1*Math.round(-1*e):Math.round(e)}function dt(e,t){return function(i,o){var n,s;return null===o||isNaN(+o)||(k(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period)."),s=i,i=o,o=s),i="string"==typeof i?+i:i,n=nt(i,o),lt(this,n,e),this}}function lt(e,i,o,n){var s=i._milliseconds,r=ht(i._days),a=ht(i._months);e.isValid()&&(n=null==n?!0:n,s&&e._d.setTime(e._d.valueOf()+s*o),r&&H(e,"Date",L(e,"Date")+r*o),a&&ae(e,L(e,"Month")+a*o),n&&t.updateOffset(e,r||a))}function ct(e,t){var i=e||ze(),o=Ve(i,this).startOf("day"),n=this.diff(o,"days",!0),s=-6>n?"sameElse":-1>n?"lastWeek":0>n?"lastDay":1>n?"sameDay":2>n?"nextDay":7>n?"nextWeek":"sameElse",r=t&&(x(t[s])?t[s]():t[s]);return this.format(r||this.localeData().calendar(s,this,ze(i)))}function ut(){return new v(this)}function ft(e,t){var i=y(e)?e:ze(e);return this.isValid()&&i.isValid()?(t=z(f(t)?"millisecond":t),"millisecond"===t?this.valueOf()>i.valueOf():i.valueOf()<this.clone().startOf(t).valueOf()):!1}function pt(e,t){var i=y(e)?e:ze(e);return this.isValid()&&i.isValid()?(t=z(f(t)?"millisecond":t),"millisecond"===t?this.valueOf()<i.valueOf():this.clone().endOf(t).valueOf()<i.valueOf()):!1}function vt(e,t,i,o){return o=o||"()",("("===o[0]?this.isAfter(e,i):!this.isBefore(e,i))&&(")"===o[1]?this.isBefore(t,i):!this.isAfter(t,i))}function yt(e,t){var i,o=y(e)?e:ze(e);return this.isValid()&&o.isValid()?(t=z(t||"millisecond"),"millisecond"===t?this.valueOf()===o.valueOf():(i=o.valueOf(),this.clone().startOf(t).valueOf()<=i&&i<=this.clone().endOf(t).valueOf())):!1}function gt(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function bt(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function mt(e,t,i){var o,n,s,r;return this.isValid()?(o=Ve(e,this),o.isValid()?(n=6e4*(o.utcOffset()-this.utcOffset()),t=z(t),"year"===t||"month"===t||"quarter"===t?(r=_t(this,o),"quarter"===t?r/=3:"year"===t&&(r/=12)):(s=this-o,r="second"===t?s/1e3:"minute"===t?s/6e4:"hour"===t?s/36e5:"day"===t?(s-n)/864e5:"week"===t?(s-n)/6048e5:s),i?r:g(r)):NaN):NaN}function _t(e,t){var i,o,n=12*(t.year()-e.year())+(t.month()-e.month()),s=e.clone().add(n,"months");return 0>t-s?(i=e.clone().add(n-1,"months"),o=(t-s)/(s-i)):(i=e.clone().add(n+1,"months"),o=(t-s)/(i-s)),-(n+o)||0}function wt(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function kt(){var e=this.clone().utc();return 0<e.year()&&e.year()<=9999?x(Date.prototype.toISOString)?this.toDate().toISOString():G(e,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):G(e,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function xt(e){e||(e=this.isUtc()?t.defaultFormatUtc:t.defaultFormat);var i=G(this,e);return this.localeData().postformat(i)}function Ot(e,t){return this.isValid()&&(y(e)&&e.isValid()||ze(e).isValid())?nt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Et(e){return this.from(ze(),e)}function Mt(e,t){return this.isValid()&&(y(e)&&e.isValid()||ze(e).isValid())?nt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Dt(e){return this.to(ze(),e)}function St(e){var t;return void 0===e?this._locale._abbr:(t=I(e),null!=t&&(this._locale=t),this)}function Ct(){return this._locale}function Tt(e){switch(e=z(e)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===e&&this.weekday(0),"isoWeek"===e&&this.isoWeekday(1),"quarter"===e&&this.month(3*Math.floor(this.month()/3)),this}function Pt(e){return e=z(e),void 0===e||"millisecond"===e?this:("date"===e&&(e="day"),this.startOf(e).add(1,"isoWeek"===e?"week":e).subtract(1,"ms"))}function Bt(){return this._d.valueOf()-6e4*(this._offset||0)}function Ft(){return Math.floor(this.valueOf()/1e3)}function It(){return this._offset?new Date(this.valueOf()):this._d}function jt(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function Nt(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function zt(){return this.isValid()?this.toISOString():null}function Rt(){return c(this)}function At(){return a({},l(this))}function Lt(){return l(this).overflow}function Ht(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Wt(e,t){U(0,[e,e.length],0,t)}function Yt(e){return Gt.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Ut(e){return Gt.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function Vt(){return Oe(this.year(),1,4)}function qt(){var e=this.localeData()._week;return Oe(this.year(),e.dow,e.doy)}function Gt(e,t,i,o,n){var s;return null==e?xe(this,o,n).year:(s=Oe(e,o,n),t>s&&(t=s),Xt.call(this,e,t,i,o,n))}function Xt(e,t,i,o,n){var s=ke(e,t,i,o,n),r=ge(s.year,0,s.dayOfYear);return this.year(r.getUTCFullYear()),this.month(r.getUTCMonth()),this.date(r.getUTCDate()),this}function Kt(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}function Zt(e){return xe(e,this._week.dow,this._week.doy).week}function Qt(){return this._week.dow}function Jt(){return this._week.doy}function $t(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function ei(e){var t=xe(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function ti(e,t){return"string"!=typeof e?e:isNaN(e)?(e=t.weekdaysParse(e),"number"==typeof e?e:null):parseInt(e,10)}function ii(e,t){return o(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(t)?"format":"standalone"][e.day()]}function oi(e){return this._weekdaysShort[e.day()]}function ni(e){return this._weekdaysMin[e.day()]}function si(e,t,i){var o,n,s,r=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],o=0;7>o;++o)s=h([2e3,1]).day(o),this._minWeekdaysParse[o]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[o]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[o]=this.weekdays(s,"").toLocaleLowerCase();return i?"dddd"===t?(n=po.call(this._weekdaysParse,r),-1!==n?n:null):"ddd"===t?(n=po.call(this._shortWeekdaysParse,r),-1!==n?n:null):(n=po.call(this._minWeekdaysParse,r),-1!==n?n:null):"dddd"===t?(n=po.call(this._weekdaysParse,r),-1!==n?n:(n=po.call(this._shortWeekdaysParse,r),-1!==n?n:(n=po.call(this._minWeekdaysParse,r),-1!==n?n:null))):"ddd"===t?(n=po.call(this._shortWeekdaysParse,r),-1!==n?n:(n=po.call(this._weekdaysParse,r),-1!==n?n:(n=po.call(this._minWeekdaysParse,r),-1!==n?n:null))):(n=po.call(this._minWeekdaysParse,r),-1!==n?n:(n=po.call(this._weekdaysParse,r),-1!==n?n:(n=po.call(this._shortWeekdaysParse,r),-1!==n?n:null)))}function ri(e,t,i){var o,n,s;if(this._weekdaysParseExact)return si.call(this,e,t,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),o=0;7>o;o++){if(n=h([2e3,1]).day(o),i&&!this._fullWeekdaysParse[o]&&(this._fullWeekdaysParse[o]=new RegExp("^"+this.weekdays(n,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[o]=new RegExp("^"+this.weekdaysShort(n,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[o]=new RegExp("^"+this.weekdaysMin(n,"").replace(".",".?")+"$","i")),this._weekdaysParse[o]||(s="^"+this.weekdays(n,"")+"|^"+this.weekdaysShort(n,"")+"|^"+this.weekdaysMin(n,""),this._weekdaysParse[o]=new RegExp(s.replace(".",""),"i")),i&&"dddd"===t&&this._fullWeekdaysParse[o].test(e))return o;if(i&&"ddd"===t&&this._shortWeekdaysParse[o].test(e))return o;if(i&&"dd"===t&&this._minWeekdaysParse[o].test(e))return o;if(!i&&this._weekdaysParse[o].test(e))return o}}function ai(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=ti(e,this.localeData()),this.add(e-t,"d")):t}function hi(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function di(e){return this.isValid()?null==e?this.day()||7:this.day(this.day()%7?e:e-7):null!=e?this:NaN}function li(e){return this._weekdaysParseExact?(r(this,"_weekdaysRegex")||fi.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex}function ci(e){return this._weekdaysParseExact?(r(this,"_weekdaysRegex")||fi.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex}function ui(e){return this._weekdaysParseExact?(r(this,"_weekdaysRegex")||fi.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex}function fi(){function e(e,t){return t.length-e.length}var t,i,o,n,s,r=[],a=[],d=[],l=[];for(t=0;7>t;t++)i=h([2e3,1]).day(t),o=this.weekdaysMin(i,""),n=this.weekdaysShort(i,""),s=this.weekdays(i,""),r.push(o),a.push(n),d.push(s),l.push(o),l.push(n),l.push(s);for(r.sort(e),a.sort(e),d.sort(e),l.sort(e),t=0;7>t;t++)a[t]=J(a[t]),d[t]=J(d[t]),l[t]=J(l[t]);this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+r.join("|")+")","i")}function pi(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}function vi(){return this.hours()%12||12}function yi(){return this.hours()||24}function gi(e,t){U(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function bi(e,t){return t._meridiemParse}function mi(e){return"p"===(e+"").toLowerCase().charAt(0)}function _i(e,t,i){return e>11?i?"pm":"PM":i?"am":"AM"}function wi(e,t){t[qo]=b(1e3*("0."+e))}function ki(){return this._isUTC?"UTC":""}function xi(){return this._isUTC?"Coordinated Universal Time":""}function Oi(e){return ze(1e3*e)}function Ei(){return ze.apply(null,arguments).parseZone()}function Mi(e,t,i){var o=this._calendar[e];return x(o)?o.call(t,i):o}function Di(e){var t=this._longDateFormat[e],i=this._longDateFormat[e.toUpperCase()];return t||!i?t:(this._longDateFormat[e]=i.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])}function Si(){return this._invalidDate}function Ci(e){return this._ordinal.replace("%d",e)}function Ti(e){return e}function Pi(e,t,i,o){var n=this._relativeTime[i];return x(n)?n(e,t,i,o):n.replace(/%d/i,e)}function Bi(e,t){var i=this._relativeTime[e>0?"future":"past"];return x(i)?i(t):i.replace(/%s/i,t)}function Fi(e,t,i,o){var n=I(),s=h().set(o,t);return n[i](s,e)}function Ii(e,t,i){if("number"==typeof e&&(t=e,e=void 0),e=e||"",null!=t)return Fi(e,t,i,"month");var o,n=[];for(o=0;12>o;o++)n[o]=Fi(e,o,i,"month");return n}function ji(e,t,i,o){"boolean"==typeof e?("number"==typeof t&&(i=t,t=void 0),t=t||""):(t=e,i=t,e=!1,"number"==typeof t&&(i=t,t=void 0),t=t||"");var n=I(),s=e?n._week.dow:0;if(null!=i)return Fi(t,(i+s)%7,o,"day");var r,a=[];for(r=0;7>r;r++)a[r]=Fi(t,(r+s)%7,o,"day");return a}function Ni(e,t){return Ii(e,t,"months")}function zi(e,t){return Ii(e,t,"monthsShort")}function Ri(e,t,i){return ji(e,t,i,"weekdays")}function Ai(e,t,i){return ji(e,t,i,"weekdaysShort")}function Li(e,t,i){return ji(e,t,i,"weekdaysMin")}function Hi(){var e=this._data;return this._milliseconds=Ln(this._milliseconds),this._days=Ln(this._days),this._months=Ln(this._months),e.milliseconds=Ln(e.milliseconds),e.seconds=Ln(e.seconds),e.minutes=Ln(e.minutes),e.hours=Ln(e.hours),e.months=Ln(e.months),e.years=Ln(e.years),this}function Wi(e,t,i,o){var n=nt(t,i);return e._milliseconds+=o*n._milliseconds,e._days+=o*n._days,e._months+=o*n._months,e._bubble()}function Yi(e,t){return Wi(this,e,t,1)}function Ui(e,t){return Wi(this,e,t,-1)}function Vi(e){return 0>e?Math.floor(e):Math.ceil(e)}function qi(){var e,t,i,o,n,s=this._milliseconds,r=this._days,a=this._months,h=this._data;return s>=0&&r>=0&&a>=0||0>=s&&0>=r&&0>=a||(s+=864e5*Vi(Xi(a)+r),r=0,a=0),h.milliseconds=s%1e3,e=g(s/1e3),h.seconds=e%60,t=g(e/60),h.minutes=t%60,i=g(t/60),h.hours=i%24,r+=g(i/24),n=g(Gi(r)),a+=n,r-=Vi(Xi(n)),o=g(a/12),a%=12,h.days=r,h.months=a,h.years=o,this}function Gi(e){return 4800*e/146097}function Xi(e){return 146097*e/4800}function Ki(e){var t,i,o=this._milliseconds;if(e=z(e),"month"===e||"year"===e)return t=this._days+o/864e5,i=this._months+Gi(t),"month"===e?i:i/12;switch(t=this._days+Math.round(Xi(this._months)),e){case"week":return t/7+o/6048e5;case"day":return t+o/864e5;case"hour":return 24*t+o/36e5;case"minute":return 1440*t+o/6e4;case"second":return 86400*t+o/1e3;case"millisecond":return Math.floor(864e5*t)+o;default:throw new Error("Unknown unit "+e)}}function Zi(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*b(this._months/12)}function Qi(e){return function(){return this.as(e)}}function Ji(e){return e=z(e),this[e+"s"]()}function $i(e){return function(){return this._data[e]}}function eo(){return g(this.days()/7)}function to(e,t,i,o,n){return n.relativeTime(t||1,!!i,e,o)}function io(e,t,i){var o=nt(e).abs(),n=is(o.as("s")),s=is(o.as("m")),r=is(o.as("h")),a=is(o.as("d")),h=is(o.as("M")),d=is(o.as("y")),l=n<os.s&&["s",n]||1>=s&&["m"]||s<os.m&&["mm",s]||1>=r&&["h"]||r<os.h&&["hh",r]||1>=a&&["d"]||a<os.d&&["dd",a]||1>=h&&["M"]||h<os.M&&["MM",h]||1>=d&&["y"]||["yy",d];return l[2]=t,l[3]=+e>0,l[4]=i,to.apply(null,l)}function oo(e,t){return void 0===os[e]?!1:void 0===t?os[e]:(os[e]=t,!0)}function no(e){var t=this.localeData(),i=io(this,!e,t);return e&&(i=t.pastFuture(+this,i)),t.postformat(i)}function so(){var e,t,i,o=ns(this._milliseconds)/1e3,n=ns(this._days),s=ns(this._months);e=g(o/60),t=g(e/60),o%=60,e%=60,i=g(s/12),s%=12;var r=i,a=s,h=n,d=t,l=e,c=o,u=this.asSeconds();return u?(0>u?"-":"")+"P"+(r?r+"Y":"")+(a?a+"M":"")+(h?h+"D":"")+(d||l||c?"T":"")+(d?d+"H":"")+(l?l+"M":"")+(c?c+"S":""):"P0D"}var ro,ao;ao=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),i=t.length>>>0,o=0;i>o;o++)if(o in t&&e.call(this,t[o],o,t))return!0;return!1};var ho=t.momentProperties=[],lo=!1,co={};t.suppressDeprecationWarnings=!1,t.deprecationHandler=null;var uo;uo=Object.keys?Object.keys:function(e){var t,i=[];for(t in e)r(e,t)&&i.push(t);return i};var fo,po,vo={},yo={},go=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,bo=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,mo={},_o={},wo=/\d/,ko=/\d\d/,xo=/\d{3}/,Oo=/\d{4}/,Eo=/[+-]?\d{6}/,Mo=/\d\d?/,Do=/\d\d\d\d?/,So=/\d\d\d\d\d\d?/,Co=/\d{1,3}/,To=/\d{1,4}/,Po=/[+-]?\d{1,6}/,Bo=/\d+/,Fo=/[+-]?\d+/,Io=/Z|[+-]\d\d:?\d\d/gi,jo=/Z|[+-]\d\d(?::?\d\d)?/gi,No=/[+-]?\d+(\.\d{1,3})?/,zo=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Ro={},Ao={},Lo=0,Ho=1,Wo=2,Yo=3,Uo=4,Vo=5,qo=6,Go=7,Xo=8;po=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},U("M",["MM",2],"Mo",function(){return this.month()+1}),U("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),U("MMMM",0,0,function(e){return this.localeData().months(this,e)}),N("month","M"),K("M",Mo),K("MM",Mo,ko),K("MMM",function(e,t){return t.monthsShortRegex(e)}),K("MMMM",function(e,t){return t.monthsRegex(e)}),$(["M","MM"],function(e,t){t[Ho]=b(e)-1}),$(["MMM","MMMM"],function(e,t,i,o){var n=i._locale.monthsParse(e,o,i._strict);null!=n?t[Ho]=n:l(i).invalidMonth=e});var Ko=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,Zo="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Qo="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Jo=zo,$o=zo,en=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,tn=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,on=/Z|[+-]\d\d(?::?\d\d)?/,nn=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],sn=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],rn=/^\/?Date\((\-?\d+)/i;t.createFromInputFallback=w("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),U("Y",0,0,function(){var e=this.year();return 9999>=e?""+e:"+"+e}),U(0,["YY",2],0,function(){return this.year()%100}),U(0,["YYYY",4],0,"year"),U(0,["YYYYY",5],0,"year"),U(0,["YYYYYY",6,!0],0,"year"),N("year","y"),K("Y",Fo),K("YY",Mo,ko),K("YYYY",To,Oo),K("YYYYY",Po,Eo),K("YYYYYY",Po,Eo),$(["YYYYY","YYYYYY"],Lo),$("YYYY",function(e,i){i[Lo]=2===e.length?t.parseTwoDigitYear(e):b(e)}),$("YY",function(e,i){i[Lo]=t.parseTwoDigitYear(e)}),$("Y",function(e,t){t[Lo]=parseInt(e,10)}),t.parseTwoDigitYear=function(e){return b(e)+(b(e)>68?1900:2e3)};var an=A("FullYear",!0);t.ISO_8601=function(){};var hn=w("moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var e=ze.apply(null,arguments);return this.isValid()&&e.isValid()?this>e?this:e:u()}),dn=w("moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var e=ze.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:u()}),ln=function(){return Date.now?Date.now():+new Date};Ye("Z",":"),Ye("ZZ",""),K("Z",jo),K("ZZ",jo),$(["Z","ZZ"],function(e,t,i){i._useUTC=!0,i._tzm=Ue(jo,e)});var cn=/([\+\-]|\d\d)/gi;t.updateOffset=function(){};var un=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,fn=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;nt.fn=He.prototype;var pn=dt(1,"add"),vn=dt(-1,"subtract");t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",t.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var yn=w("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});U(0,["gg",2],0,function(){return this.weekYear()%100}),U(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Wt("gggg","weekYear"),Wt("ggggg","weekYear"),Wt("GGGG","isoWeekYear"),Wt("GGGGG","isoWeekYear"),N("weekYear","gg"),N("isoWeekYear","GG"),K("G",Fo),K("g",Fo),K("GG",Mo,ko),K("gg",Mo,ko),K("GGGG",To,Oo),K("gggg",To,Oo),K("GGGGG",Po,Eo),K("ggggg",Po,Eo),ee(["gggg","ggggg","GGGG","GGGGG"],function(e,t,i,o){t[o.substr(0,2)]=b(e)}),ee(["gg","GG"],function(e,i,o,n){i[n]=t.parseTwoDigitYear(e)}),U("Q",0,"Qo","quarter"),N("quarter","Q"),K("Q",wo),$("Q",function(e,t){t[Ho]=3*(b(e)-1)}),U("w",["ww",2],"wo","week"),U("W",["WW",2],"Wo","isoWeek"),N("week","w"),N("isoWeek","W"),K("w",Mo),K("ww",Mo,ko),K("W",Mo),K("WW",Mo,ko),ee(["w","ww","W","WW"],function(e,t,i,o){t[o.substr(0,1)]=b(e)});var gn={dow:0,doy:6};U("D",["DD",2],"Do","date"),N("date","D"),K("D",Mo),K("DD",Mo,ko),K("Do",function(e,t){return e?t._ordinalParse:t._ordinalParseLenient}),$(["D","DD"],Wo),$("Do",function(e,t){t[Wo]=b(e.match(Mo)[0],10)});var bn=A("Date",!0);U("d",0,"do","day"),U("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),U("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),U("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),U("e",0,0,"weekday"),U("E",0,0,"isoWeekday"),N("day","d"),N("weekday","e"),N("isoWeekday","E"),K("d",Mo),K("e",Mo),K("E",Mo),K("dd",function(e,t){return t.weekdaysMinRegex(e)}),K("ddd",function(e,t){return t.weekdaysShortRegex(e)}),K("dddd",function(e,t){return t.weekdaysRegex(e)}),ee(["dd","ddd","dddd"],function(e,t,i,o){var n=i._locale.weekdaysParse(e,o,i._strict);null!=n?t.d=n:l(i).invalidWeekday=e}),ee(["d","e","E"],function(e,t,i,o){t[o]=b(e)});var mn="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),_n="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),wn="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),kn=zo,xn=zo,On=zo;U("DDD",["DDDD",3],"DDDo","dayOfYear"),N("dayOfYear","DDD"),K("DDD",Co),K("DDDD",xo),$(["DDD","DDDD"],function(e,t,i){i._dayOfYear=b(e)}),U("H",["HH",2],0,"hour"),U("h",["hh",2],0,vi),U("k",["kk",2],0,yi),U("hmm",0,0,function(){return""+vi.apply(this)+Y(this.minutes(),2)}),U("hmmss",0,0,function(){return""+vi.apply(this)+Y(this.minutes(),2)+Y(this.seconds(),2)}),U("Hmm",0,0,function(){return""+this.hours()+Y(this.minutes(),2)}),U("Hmmss",0,0,function(){return""+this.hours()+Y(this.minutes(),2)+Y(this.seconds(),2)}),gi("a",!0),gi("A",!1),N("hour","h"),K("a",bi),K("A",bi),K("H",Mo),K("h",Mo),K("HH",Mo,ko),K("hh",Mo,ko),K("hmm",Do),K("hmmss",So),K("Hmm",Do),K("Hmmss",So),$(["H","HH"],Yo),$(["a","A"],function(e,t,i){i._isPm=i._locale.isPM(e),i._meridiem=e}),$(["h","hh"],function(e,t,i){t[Yo]=b(e),l(i).bigHour=!0}),$("hmm",function(e,t,i){var o=e.length-2;t[Yo]=b(e.substr(0,o)),t[Uo]=b(e.substr(o)),l(i).bigHour=!0}),$("hmmss",function(e,t,i){var o=e.length-4,n=e.length-2;t[Yo]=b(e.substr(0,o)),t[Uo]=b(e.substr(o,2)),t[Vo]=b(e.substr(n)),l(i).bigHour=!0}),$("Hmm",function(e,t,i){var o=e.length-2;t[Yo]=b(e.substr(0,o)),t[Uo]=b(e.substr(o))}),$("Hmmss",function(e,t,i){var o=e.length-4,n=e.length-2;t[Yo]=b(e.substr(0,o)),t[Uo]=b(e.substr(o,2)),t[Vo]=b(e.substr(n))});var En=/[ap]\.?m?\.?/i,Mn=A("Hours",!0);U("m",["mm",2],0,"minute"),N("minute","m"),K("m",Mo),K("mm",Mo,ko),$(["m","mm"],Uo);var Dn=A("Minutes",!1);U("s",["ss",2],0,"second"),N("second","s"),K("s",Mo),K("ss",Mo,ko),$(["s","ss"],Vo);var Sn=A("Seconds",!1);U("S",0,0,function(){return~~(this.millisecond()/100)}),U(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),U(0,["SSS",3],0,"millisecond"),U(0,["SSSS",4],0,function(){return 10*this.millisecond()}),U(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),U(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),U(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),U(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),U(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),N("millisecond","ms"),K("S",Co,wo),K("SS",Co,ko),K("SSS",Co,xo);var Cn;for(Cn="SSSS";Cn.length<=9;Cn+="S")K(Cn,Bo);for(Cn="S";Cn.length<=9;Cn+="S")$(Cn,wi);var Tn=A("Milliseconds",!1);U("z",0,0,"zoneAbbr"),U("zz",0,0,"zoneName");var Pn=v.prototype;Pn.add=pn,Pn.calendar=ct,Pn.clone=ut,Pn.diff=mt,Pn.endOf=Pt,Pn.format=xt,Pn.from=Ot,Pn.fromNow=Et,Pn.to=Mt,Pn.toNow=Dt,Pn.get=W,Pn.invalidAt=Lt,Pn.isAfter=ft,Pn.isBefore=pt,Pn.isBetween=vt,Pn.isSame=yt,Pn.isSameOrAfter=gt,Pn.isSameOrBefore=bt,Pn.isValid=Rt,Pn.lang=yn,Pn.locale=St,Pn.localeData=Ct,Pn.max=dn,Pn.min=hn,Pn.parsingFlags=At,Pn.set=W,Pn.startOf=Tt,Pn.subtract=vn,Pn.toArray=jt,Pn.toObject=Nt,Pn.toDate=It,Pn.toISOString=kt,Pn.toJSON=zt,Pn.toString=wt,Pn.unix=Ft,Pn.valueOf=Bt,Pn.creationData=Ht,Pn.year=an,Pn.isLeapYear=_e,Pn.weekYear=Yt,Pn.isoWeekYear=Ut,Pn.quarter=Pn.quarters=Kt,Pn.month=he,Pn.daysInMonth=de,Pn.week=Pn.weeks=$t,Pn.isoWeek=Pn.isoWeeks=ei,Pn.weeksInYear=qt,Pn.isoWeeksInYear=Vt,Pn.date=bn,Pn.day=Pn.days=ai,Pn.weekday=hi,Pn.isoWeekday=di,Pn.dayOfYear=pi,Pn.hour=Pn.hours=Mn,Pn.minute=Pn.minutes=Dn,Pn.second=Pn.seconds=Sn,Pn.millisecond=Pn.milliseconds=Tn,Pn.utcOffset=Ge,Pn.utc=Ke,Pn.local=Ze,Pn.parseZone=Qe,Pn.hasAlignedHourOffset=Je,Pn.isDST=$e,Pn.isDSTShifted=et,Pn.isLocal=tt,Pn.isUtcOffset=it,Pn.isUtc=ot,Pn.isUTC=ot,Pn.zoneAbbr=ki,Pn.zoneName=xi,Pn.dates=w("dates accessor is deprecated. Use date instead.",bn),Pn.months=w("months accessor is deprecated. Use month instead",he),Pn.years=w("years accessor is deprecated. Use year instead",an),Pn.zone=w("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Xe);var Bn=Pn,Fn={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},In={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},jn="Invalid date",Nn="%d",zn=/\d{1,2}/,Rn={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},An=D.prototype;An._calendar=Fn,An.calendar=Mi,An._longDateFormat=In,An.longDateFormat=Di,An._invalidDate=jn,An.invalidDate=Si,An._ordinal=Nn,An.ordinal=Ci,An._ordinalParse=zn,An.preparse=Ti,An.postformat=Ti,An._relativeTime=Rn,An.relativeTime=Pi,An.pastFuture=Bi,An.set=E,An.months=oe,An._months=Zo,An.monthsShort=ne,An._monthsShort=Qo,An.monthsParse=re,An._monthsRegex=$o,An.monthsRegex=ce,An._monthsShortRegex=Jo,An.monthsShortRegex=le,An.week=Zt,An._week=gn,An.firstDayOfYear=Jt,An.firstDayOfWeek=Qt,An.weekdays=ii,An._weekdays=mn,An.weekdaysMin=ni,An._weekdaysMin=wn,An.weekdaysShort=oi,An._weekdaysShort=_n,An.weekdaysParse=ri,An._weekdaysRegex=kn,An.weekdaysRegex=li,An._weekdaysShortRegex=xn,An.weekdaysShortRegex=ci,An._weekdaysMinRegex=On,An.weekdaysMinRegex=ui,An.isPM=mi,An._meridiemParse=En,An.meridiem=_i,P("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,i=1===b(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+i}}),t.lang=w("moment.lang is deprecated. Use moment.locale instead.",P),t.langData=w("moment.langData is deprecated. Use moment.localeData instead.",I);var Ln=Math.abs,Hn=Qi("ms"),Wn=Qi("s"),Yn=Qi("m"),Un=Qi("h"),Vn=Qi("d"),qn=Qi("w"),Gn=Qi("M"),Xn=Qi("y"),Kn=$i("milliseconds"),Zn=$i("seconds"),Qn=$i("minutes"),Jn=$i("hours"),$n=$i("days"),es=$i("months"),ts=$i("years"),is=Math.round,os={s:45,m:45,h:22,d:26,M:11},ns=Math.abs,ss=He.prototype;ss.abs=Hi,ss.add=Yi,ss.subtract=Ui,ss.as=Ki,ss.asMilliseconds=Hn,ss.asSeconds=Wn,ss.asMinutes=Yn,ss.asHours=Un,ss.asDays=Vn,ss.asWeeks=qn,ss.asMonths=Gn,ss.asYears=Xn,ss.valueOf=Zi,ss._bubble=qi,ss.get=Ji,ss.milliseconds=Kn,ss.seconds=Zn,ss.minutes=Qn,ss.hours=Jn,ss.days=$n,ss.weeks=eo,ss.months=es,ss.years=ts,ss.humanize=no,ss.toISOString=so,ss.toString=so,ss.toJSON=so,ss.locale=St,ss.localeData=Ct,ss.toIsoString=w("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",so),ss.lang=yn,U("X",0,0,"unix"),U("x",0,0,"valueOf"),K("x",Fo),K("X",No),$("X",function(e,t,i){i._d=new Date(1e3*parseFloat(e,10))}),$("x",function(e,t,i){i._d=new Date(b(e))}),t.version="2.13.0",i(ze),t.fn=Bn,t.min=Ae,t.max=Le,t.now=ln,t.utc=h,t.unix=Oi,t.months=Ni,t.isDate=n,t.locale=P,t.invalid=u,t.duration=nt,t.isMoment=y,t.weekdays=Ri,t.parseZone=Ei,t.localeData=I,t.isDuration=We,t.monthsShort=zi,t.weekdaysMin=Li,t.defineLocale=B,t.updateLocale=F,t.locales=j,t.weekdaysShort=Ai,t.normalizeUnits=z,t.relativeTimeThreshold=oo,t.prototype=Bn;var rs=t;return rs})}).call(t,i(4)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t){function i(e){throw new Error("Cannot find module '"+e+"'.")}i.keys=function(){return[]},i.resolve=i,e.exports=i,i.id=5},function(e,t){(function(t){function i(e,t,i){var o=t&&i||0,n=0;for(t=t||[],e.toLowerCase().replace(/[0-9a-f]{2}/g,function(e){16>n&&(t[o+n++]=c[e])});16>n;)t[o+n++]=0;return t}function o(e,t){var i=t||0,o=l;return o[e[i++]]+o[e[i++]]+o[e[i++]]+o[e[i++]]+"-"+o[e[i++]]+o[e[i++]]+"-"+o[e[i++]]+o[e[i++]]+"-"+o[e[i++]]+o[e[i++]]+"-"+o[e[i++]]+o[e[i++]]+o[e[i++]]+o[e[i++]]+o[e[i++]]+o[e[i++]]}function n(e,t,i){var n=t&&i||0,s=t||[];e=e||{};var r=void 0!==e.clockseq?e.clockseq:v,a=void 0!==e.msecs?e.msecs:(new Date).getTime(),h=void 0!==e.nsecs?e.nsecs:g+1,d=a-y+(h-g)/1e4;if(0>d&&void 0===e.clockseq&&(r=r+1&16383),(0>d||a>y)&&void 0===e.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");y=a,g=h,v=r,a+=122192928e5;var l=(1e4*(268435455&a)+h)%4294967296;s[n++]=l>>>24&255,s[n++]=l>>>16&255,s[n++]=l>>>8&255,s[n++]=255&l;var c=a/4294967296*1e4&268435455;s[n++]=c>>>8&255,s[n++]=255&c,s[n++]=c>>>24&15|16,s[n++]=c>>>16&255,s[n++]=r>>>8|128,s[n++]=255&r;for(var u=e.node||p,f=0;6>f;f++)s[n+f]=u[f];return t?t:o(s)}function s(e,t,i){var n=t&&i||0;"string"==typeof e&&(t="binary"==e?new Array(16):null,e=null),e=e||{};var s=e.random||(e.rng||r)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t)for(var a=0;16>a;a++)t[n+a]=s[a];return t||o(s)}var r,a="undefined"!=typeof window?window:"undefined"!=typeof t?t:null;if(a&&a.crypto&&crypto.getRandomValues){var h=new Uint8Array(16);r=function(){return crypto.getRandomValues(h),h}}if(!r){var d=new Array(16);r=function(){for(var e,t=0;16>t;t++)0===(3&t)&&(e=4294967296*Math.random()),d[t]=e>>>((3&t)<<3)&255;return d}}for(var l=[],c={},u=0;256>u;u++)l[u]=(u+256).toString(16).substr(1),c[l[u]]=u;var f=r(),p=[1|f[0],f[1],f[2],f[3],f[4],f[5]],v=16383&(f[6]<<8|f[7]),y=0,g=0,b=s;b.v1=n,b.v4=s,b.parse=i,b.unparse=o,e.exports=b}).call(t,function(){return this}())},function(e,t){t.prepareElements=function(e){for(var t in e)e.hasOwnProperty(t)&&(e[t].redundant=e[t].used,e[t].used=[])},t.cleanupElements=function(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t].redundant){for(var i=0;i<e[t].redundant.length;i++)e[t].redundant[i].parentNode.removeChild(e[t].redundant[i]);e[t].redundant=[]}},t.resetElements=function(e){t.prepareElements(e),t.cleanupElements(e),t.prepareElements(e)},t.getSVGElement=function(e,t,i){var o;return t.hasOwnProperty(e)?t[e].redundant.length>0?(o=t[e].redundant[0],t[e].redundant.shift()):(o=document.createElementNS("http://www.w3.org/2000/svg",e),i.appendChild(o)):(o=document.createElementNS("http://www.w3.org/2000/svg",e),t[e]={used:[],redundant:[]},i.appendChild(o)),t[e].used.push(o),o},t.getDOMElement=function(e,t,i,o){var n;return t.hasOwnProperty(e)?t[e].redundant.length>0?(n=t[e].redundant[0],t[e].redundant.shift()):(n=document.createElement(e),void 0!==o?i.insertBefore(n,o):i.appendChild(n)):(n=document.createElement(e),t[e]={used:[],redundant:[]},void 0!==o?i.insertBefore(n,o):i.appendChild(n)),t[e].used.push(n),n},t.drawPoint=function(e,i,o,n,s,r){var a;if("circle"==o.style?(a=t.getSVGElement("circle",n,s),a.setAttributeNS(null,"cx",e),a.setAttributeNS(null,"cy",i),a.setAttributeNS(null,"r",.5*o.size)):(a=t.getSVGElement("rect",n,s),a.setAttributeNS(null,"x",e-.5*o.size),a.setAttributeNS(null,"y",i-.5*o.size),a.setAttributeNS(null,"width",o.size),a.setAttributeNS(null,"height",o.size)),void 0!==o.styles&&a.setAttributeNS(null,"style",o.styles),
-a.setAttributeNS(null,"class",o.className+" vis-point"),r){var h=t.getSVGElement("text",n,s);r.xOffset&&(e+=r.xOffset),r.yOffset&&(i+=r.yOffset),r.content&&(h.textContent=r.content),r.className&&h.setAttributeNS(null,"class",r.className+" vis-label"),h.setAttributeNS(null,"x",e),h.setAttributeNS(null,"y",i)}return a},t.drawBar=function(e,i,o,n,s,r,a,h){if(0!=n){0>n&&(n*=-1,i-=n);var d=t.getSVGElement("rect",r,a);d.setAttributeNS(null,"x",e-.5*o),d.setAttributeNS(null,"y",i),d.setAttributeNS(null,"width",o),d.setAttributeNS(null,"height",n),d.setAttributeNS(null,"class",s),h&&d.setAttributeNS(null,"style",h)}}},function(e,t,i){function o(e,t){if(e&&!Array.isArray(e)&&(t=e,e=null),this._options=t||{},this._data={},this.length=0,this._fieldId=this._options.fieldId||"id",this._type={},this._options.type)for(var i=Object.keys(this._options.type),o=0,n=i.length;n>o;o++){var s=i[o],r=this._options.type[s];"Date"==r||"ISODate"==r||"ASPDate"==r?this._type[s]="Date":this._type[s]=r}if(this._options.convert)throw new Error('Option "convert" is deprecated. Use "type" instead.');this._subscribers={},e&&this.add(e),this.setOptions(t)}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},s=i(1),r=i(9);o.prototype.setOptions=function(e){e&&void 0!==e.queue&&(e.queue===!1?this._queue&&(this._queue.destroy(),delete this._queue):(this._queue||(this._queue=r.extend(this,{replace:["add","update","remove"]})),"object"===n(e.queue)&&this._queue.setOptions(e.queue)))},o.prototype.on=function(e,t){var i=this._subscribers[e];i||(i=[],this._subscribers[e]=i),i.push({callback:t})},o.prototype.subscribe=function(){throw new Error("DataSet.subscribe is deprecated. Use DataSet.on instead.")},o.prototype.off=function(e,t){var i=this._subscribers[e];i&&(this._subscribers[e]=i.filter(function(e){return e.callback!=t}))},o.prototype.unsubscribe=function(){throw new Error("DataSet.unsubscribe is deprecated. Use DataSet.off instead.")},o.prototype._trigger=function(e,t,i){if("*"==e)throw new Error("Cannot trigger event *");var o=[];e in this._subscribers&&(o=o.concat(this._subscribers[e])),"*"in this._subscribers&&(o=o.concat(this._subscribers["*"]));for(var n=0,s=o.length;s>n;n++){var r=o[n];r.callback&&r.callback(e,t,i||null)}},o.prototype.add=function(e,t){var i,o=[],n=this;if(Array.isArray(e))for(var s=0,r=e.length;r>s;s++)i=n._addItem(e[s]),o.push(i);else{if(!(e instanceof Object))throw new Error("Unknown dataType");i=n._addItem(e),o.push(i)}return o.length&&this._trigger("add",{items:o},t),o},o.prototype.update=function(e,t){var i=[],o=[],n=[],r=[],a=this,h=a._fieldId,d=function(e){var t=e[h];if(a._data[t]){var d=s.extend({},a._data[t]);t=a._updateItem(e),o.push(t),r.push(e),n.push(d)}else t=a._addItem(e),i.push(t)};if(Array.isArray(e))for(var l=0,c=e.length;c>l;l++)e[l]instanceof Object?d(e[l]):console.warn("Ignoring input item, which is not an object at index "+l);else{if(!(e instanceof Object))throw new Error("Unknown dataType");d(e)}if(i.length&&this._trigger("add",{items:i},t),o.length){var u={items:o,oldData:n,data:r};this._trigger("update",u,t)}return i.concat(o)},o.prototype.get=function(e){var t,i,o,n=this,r=s.getType(arguments[0]);"String"==r||"Number"==r?(t=arguments[0],o=arguments[1]):"Array"==r?(i=arguments[0],o=arguments[1]):o=arguments[0];var a;if(o&&o.returnType){var h=["Array","Object"];a=-1==h.indexOf(o.returnType)?"Array":o.returnType}else a="Array";var d,l,c,u,f,p=o&&o.type||this._options.type,v=o&&o.filter,y=[];if(void 0!=t)d=n._getItem(t,p),d&&v&&!v(d)&&(d=null);else if(void 0!=i)for(u=0,f=i.length;f>u;u++)d=n._getItem(i[u],p),v&&!v(d)||y.push(d);else for(l=Object.keys(this._data),u=0,f=l.length;f>u;u++)c=l[u],d=n._getItem(c,p),v&&!v(d)||y.push(d);if(o&&o.order&&void 0==t&&this._sort(y,o.order),o&&o.fields){var g=o.fields;if(void 0!=t)d=this._filterFields(d,g);else for(u=0,f=y.length;f>u;u++)y[u]=this._filterFields(y[u],g)}if("Object"==a){var b,m={};for(u=0,f=y.length;f>u;u++)b=y[u],m[b.id]=b;return m}return void 0!=t?d:y},o.prototype.getIds=function(e){var t,i,o,n,s,r=this._data,a=e&&e.filter,h=e&&e.order,d=e&&e.type||this._options.type,l=Object.keys(r),c=[];if(a)if(h){for(s=[],t=0,i=l.length;i>t;t++)o=l[t],n=this._getItem(o,d),a(n)&&s.push(n);for(this._sort(s,h),t=0,i=s.length;i>t;t++)c.push(s[t][this._fieldId])}else for(t=0,i=l.length;i>t;t++)o=l[t],n=this._getItem(o,d),a(n)&&c.push(n[this._fieldId]);else if(h){for(s=[],t=0,i=l.length;i>t;t++)o=l[t],s.push(r[o]);for(this._sort(s,h),t=0,i=s.length;i>t;t++)c.push(s[t][this._fieldId])}else for(t=0,i=l.length;i>t;t++)o=l[t],n=r[o],c.push(n[this._fieldId]);return c},o.prototype.getDataSet=function(){return this},o.prototype.forEach=function(e,t){var i,o,n,s,r=t&&t.filter,a=t&&t.type||this._options.type,h=this._data,d=Object.keys(h);if(t&&t.order){var l=this.get(t);for(i=0,o=l.length;o>i;i++)n=l[i],s=n[this._fieldId],e(n,s)}else for(i=0,o=d.length;o>i;i++)s=d[i],n=this._getItem(s,a),r&&!r(n)||e(n,s)},o.prototype.map=function(e,t){var i,o,n,s,r=t&&t.filter,a=t&&t.type||this._options.type,h=[],d=this._data,l=Object.keys(d);for(i=0,o=l.length;o>i;i++)n=l[i],s=this._getItem(n,a),r&&!r(s)||h.push(e(s,n));return t&&t.order&&this._sort(h,t.order),h},o.prototype._filterFields=function(e,t){if(!e)return e;var i,o,n={},s=Object.keys(e),r=s.length;if(Array.isArray(t))for(i=0;r>i;i++)o=s[i],-1!=t.indexOf(o)&&(n[o]=e[o]);else for(i=0;r>i;i++)o=s[i],t.hasOwnProperty(o)&&(n[t[o]]=e[o]);return n},o.prototype._sort=function(e,t){if(s.isString(t)){var i=t;e.sort(function(e,t){var o=e[i],n=t[i];return o>n?1:n>o?-1:0})}else{if("function"!=typeof t)throw new TypeError("Order must be a function or a string");e.sort(t)}},o.prototype.remove=function(e,t){var i,o,n,s=[];if(Array.isArray(e))for(i=0,o=e.length;o>i;i++)n=this._remove(e[i]),null!=n&&s.push(n);else n=this._remove(e),null!=n&&s.push(n);return s.length&&this._trigger("remove",{items:s},t),s},o.prototype._remove=function(e){if(s.isNumber(e)||s.isString(e)){if(this._data[e])return delete this._data[e],this.length--,e}else if(e instanceof Object){var t=e[this._fieldId];if(void 0!==t&&this._data[t])return delete this._data[t],this.length--,t}return null},o.prototype.clear=function(e){var t=Object.keys(this._data);return this._data={},this.length=0,this._trigger("remove",{items:t},e),t},o.prototype.max=function(e){var t,i,o=this._data,n=Object.keys(o),s=null,r=null;for(t=0,i=n.length;i>t;t++){var a=n[t],h=o[a],d=h[e];null!=d&&(!s||d>r)&&(s=h,r=d)}return s},o.prototype.min=function(e){var t,i,o=this._data,n=Object.keys(o),s=null,r=null;for(t=0,i=n.length;i>t;t++){var a=n[t],h=o[a],d=h[e];null!=d&&(!s||r>d)&&(s=h,r=d)}return s},o.prototype.distinct=function(e){var t,i,o,n=this._data,r=Object.keys(n),a=[],h=this._options.type&&this._options.type[e]||null,d=0;for(t=0,o=r.length;o>t;t++){var l=r[t],c=n[l],u=c[e],f=!1;for(i=0;d>i;i++)if(a[i]==u){f=!0;break}f||void 0===u||(a[d]=u,d++)}if(h)for(t=0,o=a.length;o>t;t++)a[t]=s.convert(a[t],h);return a},o.prototype._addItem=function(e){var t=e[this._fieldId];if(void 0!=t){if(this._data[t])throw new Error("Cannot add item: item with id "+t+" already exists")}else t=s.randomUUID(),e[this._fieldId]=t;var i,o,n={},r=Object.keys(e);for(i=0,o=r.length;o>i;i++){var a=r[i],h=this._type[a];n[a]=s.convert(e[a],h)}return this._data[t]=n,this.length++,t},o.prototype._getItem=function(e,t){var i,o,n,r,a=this._data[e];if(!a)return null;var h={},d=Object.keys(a);if(t)for(n=0,r=d.length;r>n;n++)i=d[n],o=a[i],h[i]=s.convert(o,t[i]);else for(n=0,r=d.length;r>n;n++)i=d[n],o=a[i],h[i]=o;return h},o.prototype._updateItem=function(e){var t=e[this._fieldId];if(void 0==t)throw new Error("Cannot update item: item has no id (item: "+JSON.stringify(e)+")");var i=this._data[t];if(!i)throw new Error("Cannot update item: no item with id "+t+" found");for(var o=Object.keys(e),n=0,r=o.length;r>n;n++){var a=o[n],h=this._type[a];i[a]=s.convert(e[a],h)}return t},e.exports=o},function(e,t){function i(e){this.delay=null,this.max=1/0,this._queue=[],this._timeout=null,this._extended=null,this.setOptions(e)}i.prototype.setOptions=function(e){e&&"undefined"!=typeof e.delay&&(this.delay=e.delay),e&&"undefined"!=typeof e.max&&(this.max=e.max),this._flushIfNeeded()},i.extend=function(e,t){var o=new i(t);if(void 0!==e.flush)throw new Error("Target object already has a property flush");e.flush=function(){o.flush()};var n=[{name:"flush",original:void 0}];if(t&&t.replace)for(var s=0;s<t.replace.length;s++){var r=t.replace[s];n.push({name:r,original:e[r]}),o.replace(e,r)}return o._extended={object:e,methods:n},o},i.prototype.destroy=function(){if(this.flush(),this._extended){for(var e=this._extended.object,t=this._extended.methods,i=0;i<t.length;i++){var o=t[i];o.original?e[o.name]=o.original:delete e[o.name]}this._extended=null}},i.prototype.replace=function(e,t){var i=this,o=e[t];if(!o)throw new Error("Method "+t+" undefined");e[t]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];i.queue({args:e,fn:o,context:this})}},i.prototype.queue=function(e){"function"==typeof e?this._queue.push({fn:e}):this._queue.push(e),this._flushIfNeeded()},i.prototype._flushIfNeeded=function(){if(this._queue.length>this.max&&this.flush(),clearTimeout(this._timeout),this.queue.length>0&&"number"==typeof this.delay){var e=this;this._timeout=setTimeout(function(){e.flush()},this.delay)}},i.prototype.flush=function(){for(;this._queue.length>0;){var e=this._queue.shift();e.fn.apply(e.context||e.fn,e.args||[])}},e.exports=i},function(e,t,i){function o(e,t){this._data=null,this._ids={},this.length=0,this._options=t||{},this._fieldId="id",this._subscribers={};var i=this;this.listener=function(){i._onEvent.apply(i,arguments)},this.setData(e)}var n=i(1),s=i(8);o.prototype.setData=function(e){var t,i,o,n;if(this._data&&(this._data.off&&this._data.off("*",this.listener),t=Object.keys(this._ids),this._ids={},this.length=0,this._trigger("remove",{items:t})),this._data=e,this._data){for(this._fieldId=this._options.fieldId||this._data&&this._data.options&&this._data.options.fieldId||"id",t=this._data.getIds({filter:this._options&&this._options.filter}),o=0,n=t.length;n>o;o++)i=t[o],this._ids[i]=!0;this.length=t.length,this._trigger("add",{items:t}),this._data.on&&this._data.on("*",this.listener)}},o.prototype.refresh=function(){var e,t,i,o=this._data.getIds({filter:this._options&&this._options.filter}),n=Object.keys(this._ids),s={},r=[],a=[];for(t=0,i=o.length;i>t;t++)e=o[t],s[e]=!0,this._ids[e]||(r.push(e),this._ids[e]=!0);for(t=0,i=n.length;i>t;t++)e=n[t],s[e]||(a.push(e),delete this._ids[e]);this.length+=r.length-a.length,r.length&&this._trigger("add",{items:r}),a.length&&this._trigger("remove",{items:a})},o.prototype.get=function(e){var t,i,o,s=this,r=n.getType(arguments[0]);"String"==r||"Number"==r||"Array"==r?(t=arguments[0],i=arguments[1],o=arguments[2]):(i=arguments[0],o=arguments[1]);var a=n.extend({},this._options,i);this._options.filter&&i&&i.filter&&(a.filter=function(e){return s._options.filter(e)&&i.filter(e)});var h=[];return void 0!=t&&h.push(t),h.push(a),h.push(o),this._data&&this._data.get.apply(this._data,h)},o.prototype.getIds=function(e){var t;if(this._data){var i,o=this._options.filter;i=e&&e.filter?o?function(t){return o(t)&&e.filter(t)}:e.filter:o,t=this._data.getIds({filter:i,order:e&&e.order})}else t=[];return t},o.prototype.map=function(e,t){var i=[];if(this._data){var o,n=this._options.filter;o=t&&t.filter?n?function(e){return n(e)&&t.filter(e)}:t.filter:n,i=this._data.map(e,{filter:o,order:t&&t.order})}else i=[];return i},o.prototype.getDataSet=function(){for(var e=this;e instanceof o;)e=e._data;return e||null},o.prototype._onEvent=function(e,t,i){var o,n,s,r,a=t&&t.items,h=this._data,d=[],l=[],c=[],u=[];if(a&&h){switch(e){case"add":for(o=0,n=a.length;n>o;o++)s=a[o],r=this.get(s),r&&(this._ids[s]=!0,l.push(s));break;case"update":for(o=0,n=a.length;n>o;o++)s=a[o],r=this.get(s),r?this._ids[s]?(c.push(s),d.push(t.data[o])):(this._ids[s]=!0,l.push(s)):this._ids[s]&&(delete this._ids[s],u.push(s));break;case"remove":for(o=0,n=a.length;n>o;o++)s=a[o],this._ids[s]&&(delete this._ids[s],u.push(s))}this.length+=l.length-u.length,l.length&&this._trigger("add",{items:l},i),c.length&&this._trigger("update",{items:c,data:d},i),u.length&&this._trigger("remove",{items:u},i)}},o.prototype.on=s.prototype.on,o.prototype.off=s.prototype.off,o.prototype._trigger=s.prototype._trigger,o.prototype.subscribe=o.prototype.on,o.prototype.unsubscribe=o.prototype.off,e.exports=o},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t,i){var o=this;if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this.options={},this.defaultOptions={locale:"en",locales:Y,clickToUse:!1},A.extend(this.options,this.defaultOptions),this.body={container:e,nodes:{},nodeIndices:[],edges:{},edgeIndices:[],emitter:{on:this.on.bind(this),off:this.off.bind(this),emit:this.emit.bind(this),once:this.once.bind(this)},eventListeners:{onTap:function(){},onTouch:function(){},onDoubleTap:function(){},onHold:function(){},onDragStart:function(){},onDrag:function(){},onDragEnd:function(){},onMouseWheel:function(){},onPinch:function(){},onMouseMove:function(){},onRelease:function(){},onContext:function(){}},data:{nodes:null,edges:null},functions:{createNode:function(){},createEdge:function(){},getPointer:function(){}},modules:{},view:{scale:1,translation:{x:0,y:0}}},this.bindEventListeners(),this.images=new r["default"](function(){return o.body.emitter.emit("_requestRedraw")}),this.groups=new h["default"],this.canvas=new _["default"](this.body),this.selectionHandler=new M["default"](this.body,this.canvas),this.interactionHandler=new O["default"](this.body,this.canvas,this.selectionHandler),this.view=new k["default"](this.body,this.canvas),this.renderer=new b["default"](this.body,this.canvas),this.physics=new p["default"](this.body),this.layoutEngine=new S["default"](this.body),this.clustering=new y["default"](this.body),this.manipulation=new T["default"](this.body,this.canvas,this.selectionHandler),this.nodesHandler=new l["default"](this.body,this.images,this.groups,this.layoutEngine),this.edgesHandler=new u["default"](this.body,this.images,this.groups),this.body.modules.kamadaKawai=new z["default"](this.body,150,.05),this.body.modules.clustering=this.clustering,this.canvas._create(),this.setOptions(i),this.setData(t)}var s=i(12),r=o(s),a=i(13),h=o(a),d=i(14),l=o(d),c=i(35),u=o(c),f=i(44),p=o(f),v=i(53),y=o(v),g=i(56),b=o(g),m=i(57),_=o(m),w=i(62),k=o(w),x=i(63),O=o(x),E=i(67),M=o(E),D=i(68),S=o(D),C=i(69),T=o(C),P=i(70),B=o(P),F=i(34),I=o(F),j=i(72),N=i(73),z=o(N);i(75);var R=i(76),A=i(1),L=(i(8),i(10),i(77)),H=i(78),W=i(79),Y=i(80);R(n.prototype),n.prototype.setOptions=function(e){var t=this;if(void 0!==e){var i=I["default"].validate(e,j.allOptions);i===!0&&console.log("%cErrors have been found in the supplied options object.",F.printStyle);var o=["locale","locales","clickToUse"];if(A.selectiveDeepExtend(o,this.options,e),e=this.layoutEngine.setOptions(e.layout,e),this.canvas.setOptions(e),this.groups.setOptions(e.groups),this.nodesHandler.setOptions(e.nodes),this.edgesHandler.setOptions(e.edges),this.physics.setOptions(e.physics),this.manipulation.setOptions(e.manipulation,e,this.options),this.interactionHandler.setOptions(e.interaction),this.renderer.setOptions(e.interaction),this.selectionHandler.setOptions(e.interaction),void 0!==e.groups&&this.body.emitter.emit("refreshNodes"),"configure"in e&&(this.configurator||(this.configurator=new B["default"](this,this.body.container,j.configureOptions,this.canvas.pixelRatio)),this.configurator.setOptions(e.configure)),this.configurator&&this.configurator.options.enabled===!0){var n={nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};A.deepExtend(n.nodes,this.nodesHandler.options),A.deepExtend(n.edges,this.edgesHandler.options),A.deepExtend(n.layout,this.layoutEngine.options),A.deepExtend(n.interaction,this.selectionHandler.options),A.deepExtend(n.interaction,this.renderer.options),A.deepExtend(n.interaction,this.interactionHandler.options),A.deepExtend(n.manipulation,this.manipulation.options),A.deepExtend(n.physics,this.physics.options),A.deepExtend(n.global,this.canvas.options),A.deepExtend(n.global,this.options),this.configurator.setModuleOptions(n)}void 0!==e.clickToUse?e.clickToUse===!0?void 0===this.activator&&(this.activator=new W(this.canvas.frame),this.activator.on("change",function(){t.body.emitter.emit("activate")})):(void 0!==this.activator&&(this.activator.destroy(),delete this.activator),this.body.emitter.emit("activate")):this.body.emitter.emit("activate"),this.canvas.setSize(),this.body.emitter.emit("startSimulation")}},n.prototype._updateVisibleIndices=function(){var e=this.body.nodes,t=this.body.edges;this.body.nodeIndices=[],this.body.edgeIndices=[];for(var i in e)e.hasOwnProperty(i)&&e[i].options.hidden===!1&&this.body.nodeIndices.push(e[i].id);for(var o in t)t.hasOwnProperty(o)&&t[o].options.hidden===!1&&this.body.edgeIndices.push(t[o].id)},n.prototype.bindEventListeners=function(){var e=this;this.body.emitter.on("_dataChanged",function(){e._updateVisibleIndices(),e.body.emitter.emit("_requestRedraw"),e.body.emitter.emit("_dataUpdated")}),this.body.emitter.on("_dataUpdated",function(){e._updateValueRange(e.body.nodes),e._updateValueRange(e.body.edges),e.body.emitter.emit("startSimulation"),e.body.emitter.emit("_requestRedraw")})},n.prototype.setData=function(e){if(this.body.emitter.emit("resetPhysics"),this.body.emitter.emit("_resetData"),this.selectionHandler.unselectAll(),e&&e.dot&&(e.nodes||e.edges))throw new SyntaxError('Data must contain either parameter "dot" or parameter pair "nodes" and "edges", but not both.');if(this.setOptions(e&&e.options),e&&e.dot){console.log("The dot property has been depricated. Please use the static convertDot method to convert DOT into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertDot(dotString);");var t=L.DOTToGraph(e.dot);return void this.setData(t)}if(e&&e.gephi){console.log("The gephi property has been depricated. Please use the static convertGephi method to convert gephi into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertGephi(gephiJson);");var i=H.parseGephi(e.gephi);return void this.setData(i)}this.nodesHandler.setData(e&&e.nodes,!0),this.edgesHandler.setData(e&&e.edges,!0),this.body.emitter.emit("_dataChanged"),this.body.emitter.emit("_dataLoaded"),this.body.emitter.emit("initPhysics")},n.prototype.destroy=function(){this.body.emitter.emit("destroy"),this.body.emitter.off(),this.off(),delete this.groups,delete this.canvas,delete this.selectionHandler,delete this.interactionHandler,delete this.view,delete this.renderer,delete this.physics,delete this.layoutEngine,delete this.clustering,delete this.manipulation,delete this.nodesHandler,delete this.edgesHandler,delete this.configurator,delete this.images;for(var e in this.body.nodes)delete this.body.nodes[e];for(var t in this.body.edges)delete this.body.edges[t];A.recursiveDOMDelete(this.body.container)},n.prototype._updateValueRange=function(e){var t,i=void 0,o=void 0,n=0;for(t in e)if(e.hasOwnProperty(t)){var s=e[t].getValue();void 0!==s&&(i=void 0===i?s:Math.min(s,i),o=void 0===o?s:Math.max(s,o),n+=s)}if(void 0!==i&&void 0!==o)for(t in e)e.hasOwnProperty(t)&&e[t].setValueRange(i,o,n)},n.prototype.isActive=function(){return!this.activator||this.activator.active},n.prototype.setSize=function(){return this.canvas.setSize.apply(this.canvas,arguments)},n.prototype.canvasToDOM=function(){return this.canvas.canvasToDOM.apply(this.canvas,arguments)},n.prototype.DOMtoCanvas=function(){return this.canvas.DOMtoCanvas.apply(this.canvas,arguments)},n.prototype.findNode=function(){return this.clustering.findNode.apply(this.clustering,arguments)},n.prototype.isCluster=function(){return this.clustering.isCluster.apply(this.clustering,arguments)},n.prototype.openCluster=function(){return this.clustering.openCluster.apply(this.clustering,arguments)},n.prototype.cluster=function(){return this.clustering.cluster.apply(this.clustering,arguments)},n.prototype.getNodesInCluster=function(){return this.clustering.getNodesInCluster.apply(this.clustering,arguments)},n.prototype.clusterByConnection=function(){return this.clustering.clusterByConnection.apply(this.clustering,arguments)},n.prototype.clusterByHubsize=function(){return this.clustering.clusterByHubsize.apply(this.clustering,arguments)},n.prototype.clusterOutliers=function(){return this.clustering.clusterOutliers.apply(this.clustering,arguments)},n.prototype.getSeed=function(){return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments)},n.prototype.enableEditMode=function(){return this.manipulation.enableEditMode.apply(this.manipulation,arguments)},n.prototype.disableEditMode=function(){return this.manipulation.disableEditMode.apply(this.manipulation,arguments)},n.prototype.addNodeMode=function(){return this.manipulation.addNodeMode.apply(this.manipulation,arguments)},n.prototype.editNode=function(){return this.manipulation.editNode.apply(this.manipulation,arguments)},n.prototype.editNodeMode=function(){return console.log("Deprecated: Please use editNode instead of editNodeMode."),this.manipulation.editNode.apply(this.manipulation,arguments)},n.prototype.addEdgeMode=function(){return this.manipulation.addEdgeMode.apply(this.manipulation,arguments)},n.prototype.editEdgeMode=function(){return this.manipulation.editEdgeMode.apply(this.manipulation,arguments)},n.prototype.deleteSelected=function(){return this.manipulation.deleteSelected.apply(this.manipulation,arguments)},n.prototype.getPositions=function(){return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments)},n.prototype.storePositions=function(){return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments)},n.prototype.moveNode=function(){return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments)},n.prototype.getBoundingBox=function(){return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments)},n.prototype.getConnectedNodes=function(e){return void 0!==this.body.nodes[e]?this.nodesHandler.getConnectedNodes.apply(this.nodesHandler,arguments):this.edgesHandler.getConnectedNodes.apply(this.edgesHandler,arguments)},n.prototype.getConnectedEdges=function(){return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments)},n.prototype.startSimulation=function(){return this.physics.startSimulation.apply(this.physics,arguments)},n.prototype.stopSimulation=function(){return this.physics.stopSimulation.apply(this.physics,arguments)},n.prototype.stabilize=function(){return this.physics.stabilize.apply(this.physics,arguments)},n.prototype.getSelection=function(){return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments)},n.prototype.setSelection=function(){return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments)},n.prototype.getSelectedNodes=function(){return this.selectionHandler.getSelectedNodes.apply(this.selectionHandler,arguments)},n.prototype.getSelectedEdges=function(){return this.selectionHandler.getSelectedEdges.apply(this.selectionHandler,arguments)},n.prototype.getNodeAt=function(){var e=this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);return void 0!==e&&void 0!==e.id?e.id:e},n.prototype.getEdgeAt=function(){var e=this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);return void 0!==e&&void 0!==e.id?e.id:e},n.prototype.selectNodes=function(){return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments)},n.prototype.selectEdges=function(){return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments)},n.prototype.unselectAll=function(){this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments),this.redraw()},n.prototype.redraw=function(){return this.renderer.redraw.apply(this.renderer,arguments)},n.prototype.getScale=function(){return this.view.getScale.apply(this.view,arguments)},n.prototype.getViewPosition=function(){return this.view.getViewPosition.apply(this.view,arguments)},n.prototype.fit=function(){return this.view.fit.apply(this.view,arguments)},n.prototype.moveTo=function(){return this.view.moveTo.apply(this.view,arguments)},n.prototype.focus=function(){return this.view.focus.apply(this.view,arguments)},n.prototype.releaseNode=function(){return this.view.releaseNode.apply(this.view,arguments)},n.prototype.getOptionsFromConfigurator=function(){var e={};return this.configurator&&(e=this.configurator.getOptions.apply(this.configurator)),e},e.exports=n},function(e,t){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),n=function(){function e(t){i(this,e),this.images={},this.imageBroken={},this.callback=t}return o(e,[{key:"_addImageToCache",value:function(e,t){0===t.width&&(document.body.appendChild(t),t.width=t.offsetWidth,t.height=t.offsetHeight,document.body.removeChild(t)),this.images[e]=t}},{key:"_tryloadBrokenUrl",value:function(e,t,i){var o=this;void 0!==e&&void 0!==t&&void 0!==i&&(i.onerror=function(){console.error("Could not load brokenImage:",t),o._addImageToCache(e,new Image)},i.src=t)}},{key:"_redrawWithImage",value:function(e){this.callback&&this.callback(e)}},{key:"load",value:function(e,t,i){var o=this,n=this.images[e];if(n)return n;var s=new Image;return s.onload=function(){o._addImageToCache(e,s),o._redrawWithImage(s)},s.onerror=function(){console.error("Could not load image:",e),o._tryloadBrokenUrl(e,t,s)},s.src=e,s}}]),e}();t["default"]=n},function(e,t,i){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),s=i(1),r=function(){function e(){o(this,e),this.clear(),this.defaultIndex=0,this.groupsArray=[],this.groupIndex=0,this.defaultGroups=[{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},{border:"#FFA500",background:"#FFFF00",highlight:{border:"#FFA500",background:"#FFFFA3"},hover:{border:"#FFA500",background:"#FFFFA3"}},{border:"#FA0A10",background:"#FB7E81",highlight:{border:"#FA0A10",background:"#FFAFB1"},hover:{border:"#FA0A10",background:"#FFAFB1"}},{border:"#41A906",background:"#7BE141",highlight:{border:"#41A906",background:"#A1EC76"},hover:{border:"#41A906",background:"#A1EC76"}},{border:"#E129F0",background:"#EB7DF4",highlight:{border:"#E129F0",background:"#F0B3F5"},hover:{border:"#E129F0",background:"#F0B3F5"}},{border:"#7C29F0",background:"#AD85E4",highlight:{border:"#7C29F0",background:"#D3BDF0"},hover:{border:"#7C29F0",background:"#D3BDF0"}},{border:"#C37F00",background:"#FFA807",highlight:{border:"#C37F00",background:"#FFCA66"},hover:{border:"#C37F00",background:"#FFCA66"}},{border:"#4220FB",background:"#6E6EFD",highlight:{border:"#4220FB",background:"#9B9BFD"},hover:{border:"#4220FB",background:"#9B9BFD"}},{border:"#FD5A77",background:"#FFC0CB",highlight:{border:"#FD5A77",background:"#FFD1D9"},hover:{border:"#FD5A77",background:"#FFD1D9"}},{border:"#4AD63A",background:"#C2FABC",highlight:{border:"#4AD63A",background:"#E6FFE3"},hover:{border:"#4AD63A",background:"#E6FFE3"}},{border:"#990000",background:"#EE0000",highlight:{border:"#BB0000",background:"#FF3333"},hover:{border:"#BB0000",background:"#FF3333"}},{border:"#FF6000",background:"#FF6000",highlight:{border:"#FF6000",background:"#FF6000"},hover:{border:"#FF6000",background:"#FF6000"}},{border:"#97C2FC",background:"#2B7CE9",highlight:{border:"#D2E5FF",background:"#2B7CE9"},hover:{border:"#D2E5FF",background:"#2B7CE9"}},{border:"#399605",background:"#255C03",highlight:{border:"#399605",background:"#255C03"},hover:{border:"#399605",background:"#255C03"}},{border:"#B70054",background:"#FF007E",highlight:{border:"#B70054",background:"#FF007E"},hover:{border:"#B70054",background:"#FF007E"}},{border:"#AD85E4",background:"#7C29F0",highlight:{border:"#D3BDF0",background:"#7C29F0"},hover:{border:"#D3BDF0",background:"#7C29F0"}},{border:"#4557FA",background:"#000EA1",highlight:{border:"#6E6EFD",background:"#000EA1"},hover:{border:"#6E6EFD",background:"#000EA1"}},{border:"#FFC0CB",background:"#FD5A77",highlight:{border:"#FFD1D9",background:"#FD5A77"},hover:{border:"#FFD1D9",background:"#FD5A77"}},{border:"#C2FABC",background:"#74D66A",highlight:{border:"#E6FFE3",background:"#74D66A"},hover:{border:"#E6FFE3",background:"#74D66A"}},{border:"#EE0000",background:"#990000",highlight:{border:"#FF3333",background:"#BB0000"},hover:{border:"#FF3333",background:"#BB0000"}}],this.options={},this.defaultOptions={useDefaultGroups:!0},s.extend(this.options,this.defaultOptions)}return n(e,[{key:"setOptions",value:function(e){var t=["useDefaultGroups"];if(void 0!==e)for(var i in e)if(e.hasOwnProperty(i)&&-1===t.indexOf(i)){var o=e[i];this.add(i,o)}}},{key:"clear",value:function(){this.groups={},this.groupsArray=[]}},{key:"get",value:function(e){var t=this.groups[e];if(void 0===t)if(this.options.useDefaultGroups===!1&&this.groupsArray.length>0){var i=this.groupIndex%this.groupsArray.length;this.groupIndex++,t={},t.color=this.groups[this.groupsArray[i]],this.groups[e]=t}else{var o=this.defaultIndex%this.defaultGroups.length;this.defaultIndex++,t={},t.color=this.defaultGroups[o],this.groups[e]=t}return t}},{key:"add",value:function(e,t){return this.groups[e]=t,this.groupsArray.push(e),t}}]),e}();t["default"]=r},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),r=i(15),a=o(r),h=i(16),d=o(h),l=i(1),c=i(8),u=i(10),f=function(){function e(t,i,o,s){var r=this;n(this,e),this.body=t,this.images=i,this.groups=o,this.layoutEngine=s,this.body.functions.createNode=this.create.bind(this),this.nodesListeners={add:function(e,t){r.add(t.items)},update:function(e,t){r.update(t.items,t.data)},remove:function(e,t){r.remove(t.items)}},this.options={},this.defaultOptions={borderWidth:1,borderWidthSelected:2,brokenImage:void 0,color:{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},fixed:{x:!1,y:!1},font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:0,strokeColor:"#ffffff",align:"center"},group:void 0,hidden:!1,icon:{face:"FontAwesome",code:void 0,size:50,color:"#2B7CE9"},image:void 0,label:void 0,labelHighlightBold:!0,level:void 0,mass:1,physics:!0,scaling:{min:10,max:30,label:{enabled:!1,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(e,t,i,o){if(t===e)return.5;var n=1/(t-e);return Math.max(0,(o-e)*n)}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},shape:"ellipse",shapeProperties:{borderDashes:!1,borderRadius:6,interpolation:!0,useImageSize:!1,useBorderWithImage:!1},size:25,
-title:void 0,value:void 0,x:void 0,y:void 0},l.extend(this.options,this.defaultOptions),this.bindEventListeners()}return s(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("refreshNodes",this.refresh.bind(this)),this.body.emitter.on("refresh",this.refresh.bind(this)),this.body.emitter.on("destroy",function(){l.forEach(e.nodesListeners,function(t,i){e.body.data.nodes&&e.body.data.nodes.off(i,t)}),delete e.body.functions.createNode,delete e.nodesListeners.add,delete e.nodesListeners.update,delete e.nodesListeners.remove,delete e.nodesListeners})}},{key:"setOptions",value:function(e){if(void 0!==e){if(a["default"].parseOptions(this.options,e),void 0!==e.shape)for(var t in this.body.nodes)this.body.nodes.hasOwnProperty(t)&&this.body.nodes[t].updateShape();if(void 0!==e.font){d["default"].parseOptions(this.options.font,e);for(var i in this.body.nodes)this.body.nodes.hasOwnProperty(i)&&(this.body.nodes[i].updateLabelModule(),this.body.nodes[i]._reset())}if(void 0!==e.size)for(var o in this.body.nodes)this.body.nodes.hasOwnProperty(o)&&this.body.nodes[o]._reset();void 0===e.hidden&&void 0===e.physics||this.body.emitter.emit("_dataChanged")}}},{key:"setData",value:function(e){var t=this,i=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],o=this.body.data.nodes;if(e instanceof c||e instanceof u)this.body.data.nodes=e;else if(Array.isArray(e))this.body.data.nodes=new c,this.body.data.nodes.add(e);else{if(e)throw new TypeError("Array or DataSet expected");this.body.data.nodes=new c}o&&l.forEach(this.nodesListeners,function(e,t){o.off(t,e)}),this.body.nodes={},this.body.data.nodes&&!function(){var e=t;l.forEach(t.nodesListeners,function(t,i){e.body.data.nodes.on(i,t)});var i=t.body.data.nodes.getIds();t.add(i,!0)}(),i===!1&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(e){for(var t=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],i=void 0,o=[],n=0;n<e.length;n++){i=e[n];var s=this.body.data.nodes.get(i),r=this.create(s);o.push(r),this.body.nodes[i]=r}this.layoutEngine.positionInitially(o),t===!1&&this.body.emitter.emit("_dataChanged")}},{key:"update",value:function(e,t){for(var i=this.body.nodes,o=!1,n=0;n<e.length;n++){var s=e[n],r=i[s],a=t[n];void 0!==r?o=r.setOptions(a):(o=!0,r=this.create(a),i[s]=r)}o===!0?this.body.emitter.emit("_dataChanged"):this.body.emitter.emit("_dataUpdated")}},{key:"remove",value:function(e){for(var t=this.body.nodes,i=0;i<e.length;i++){var o=e[i];delete t[o]}this.body.emitter.emit("_dataChanged")}},{key:"create",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?a["default"]:arguments[1];return new t(e,this.body,this.images,this.groups,this.options)}},{key:"refresh",value:function(){var e=arguments.length<=0||void 0===arguments[0]?!1:arguments[0],t=this.body.nodes;for(var i in t){var o=void 0;t.hasOwnProperty(i)&&(o=t[i]);var n=this.body.data.nodes._data[i];void 0!==o&&void 0!==n&&(e===!0&&o.setOptions({x:null,y:null}),o.setOptions({fixed:!1}),o.setOptions(n))}}},{key:"getPositions",value:function(e){var t={};if(void 0!==e){if(Array.isArray(e)===!0){for(var i=0;i<e.length;i++)if(void 0!==this.body.nodes[e[i]]){var o=this.body.nodes[e[i]];t[e[i]]={x:Math.round(o.x),y:Math.round(o.y)}}}else if(void 0!==this.body.nodes[e]){var n=this.body.nodes[e];t[e]={x:Math.round(n.x),y:Math.round(n.y)}}}else for(var s=0;s<this.body.nodeIndices.length;s++){var r=this.body.nodes[this.body.nodeIndices[s]];t[this.body.nodeIndices[s]]={x:Math.round(r.x),y:Math.round(r.y)}}return t}},{key:"storePositions",value:function(){var e=[],t=this.body.data.nodes.getDataSet();for(var i in t._data)if(t._data.hasOwnProperty(i)){var o=this.body.nodes[i];t._data[i].x==Math.round(o.x)&&t._data[i].y==Math.round(o.y)||e.push({id:o.id,x:Math.round(o.x),y:Math.round(o.y)})}t.update(e)}},{key:"getBoundingBox",value:function(e){return void 0!==this.body.nodes[e]?this.body.nodes[e].shape.boundingBox:void 0}},{key:"getConnectedNodes",value:function(e){var t=[];if(void 0!==this.body.nodes[e])for(var i=this.body.nodes[e],o={},n=0;n<i.edges.length;n++){var s=i.edges[n];s.toId==i.id?void 0===o[s.fromId]&&(t.push(s.fromId),o[s.fromId]=!0):s.fromId==i.id&&void 0===o[s.toId]&&(t.push(s.toId),o[s.toId]=!0)}return t}},{key:"getConnectedEdges",value:function(e){var t=[];if(void 0!==this.body.nodes[e])for(var i=this.body.nodes[e],o=0;o<i.edges.length;o++)t.push(i.edges[o].id);else console.log("NodeId provided for getConnectedEdges does not exist. Provided: ",e);return t}},{key:"moveNode",value:function(e,t,i){var o=this;void 0!==this.body.nodes[e]?(this.body.nodes[e].x=Number(t),this.body.nodes[e].y=Number(i),setTimeout(function(){o.body.emitter.emit("startSimulation")},0)):console.log("Node id supplied to moveNode does not exist. Provided: ",e)}}]),e}();t["default"]=f},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),r=i(16),a=o(r),h=i(17),d=o(h),l=i(19),c=o(l),u=i(21),f=o(u),p=i(22),v=o(p),y=i(23),g=o(y),b=i(25),m=o(b),_=i(26),w=o(_),k=i(27),x=o(k),O=i(28),E=o(O),M=i(29),D=o(M),S=i(30),C=o(S),T=i(31),P=o(T),B=i(32),F=o(B),I=i(33),j=o(I),N=i(34),z=(o(N),i(1)),R=function(){function e(t,i,o,s,r){n(this,e),this.options=z.bridgeObject(r),this.globalOptions=r,this.body=i,this.edges=[],this.id=void 0,this.imagelist=o,this.grouplist=s,this.x=void 0,this.y=void 0,this.baseSize=this.options.size,this.baseFontSize=this.options.font.size,this.predefinedPosition=!1,this.selected=!1,this.hover=!1,this.labelModule=new a["default"](this.body,this.options,!1),this.setOptions(t)}return s(e,[{key:"attachEdge",value:function(e){-1===this.edges.indexOf(e)&&this.edges.push(e)}},{key:"detachEdge",value:function(e){var t=this.edges.indexOf(e);-1!=t&&this.edges.splice(t,1)}},{key:"setOptions",value:function(t){var i=this.options.shape;if(t){if(void 0!==t.id&&(this.id=t.id),void 0===this.id)throw"Node must have an id";if(void 0!==t.x&&(null===t.x?(this.x=void 0,this.predefinedPosition=!1):(this.x=parseInt(t.x),this.predefinedPosition=!0)),void 0!==t.y&&(null===t.y?(this.y=void 0,this.predefinedPosition=!1):(this.y=parseInt(t.y),this.predefinedPosition=!0)),void 0!==t.size&&(this.baseSize=t.size),void 0!==t.value&&(t.value=parseFloat(t.value)),"number"==typeof t.group||"string"==typeof t.group&&""!=t.group){var o=this.grouplist.get(t.group);z.deepExtend(this.options,o),this.options.color=z.parseColor(this.options.color)}if(e.parseOptions(this.options,t,!0,this.globalOptions),void 0!==this.options.image){if(!this.imagelist)throw"No imagelist provided";this.imageObj=this.imagelist.load(this.options.image,this.options.brokenImage,this.id)}return this.updateLabelModule(),this.updateShape(i),void 0!==t.hidden||void 0!==t.physics}}},{key:"updateLabelModule",value:function(){void 0!==this.options.label&&null!==this.options.label||(this.options.label=""),this.labelModule.setOptions(this.options,!0),void 0!==this.labelModule.baseSize&&(this.baseFontSize=this.labelModule.baseSize)}},{key:"updateShape",value:function(e){if(e===this.options.shape&&this.shape)this.shape.setOptions(this.options,this.imageObj);else switch(this.options.shape){case"box":this.shape=new d["default"](this.options,this.body,this.labelModule);break;case"circle":this.shape=new c["default"](this.options,this.body,this.labelModule);break;case"circularImage":this.shape=new f["default"](this.options,this.body,this.labelModule,this.imageObj);break;case"database":this.shape=new v["default"](this.options,this.body,this.labelModule);break;case"diamond":this.shape=new g["default"](this.options,this.body,this.labelModule);break;case"dot":this.shape=new m["default"](this.options,this.body,this.labelModule);break;case"ellipse":this.shape=new w["default"](this.options,this.body,this.labelModule);break;case"icon":this.shape=new x["default"](this.options,this.body,this.labelModule);break;case"image":this.shape=new E["default"](this.options,this.body,this.labelModule,this.imageObj);break;case"square":this.shape=new D["default"](this.options,this.body,this.labelModule);break;case"star":this.shape=new C["default"](this.options,this.body,this.labelModule);break;case"text":this.shape=new P["default"](this.options,this.body,this.labelModule);break;case"triangle":this.shape=new F["default"](this.options,this.body,this.labelModule);break;case"triangleDown":this.shape=new j["default"](this.options,this.body,this.labelModule);break;default:this.shape=new w["default"](this.options,this.body,this.labelModule)}this._reset()}},{key:"select",value:function(){this.selected=!0,this._reset()}},{key:"unselect",value:function(){this.selected=!1,this._reset()}},{key:"_reset",value:function(){this.shape.width=void 0,this.shape.height=void 0}},{key:"getTitle",value:function(){return this.options.title}},{key:"distanceToBorder",value:function(e,t){return this.shape.distanceToBorder(e,t)}},{key:"isFixed",value:function(){return this.options.fixed.x&&this.options.fixed.y}},{key:"isSelected",value:function(){return this.selected}},{key:"getValue",value:function(){return this.options.value}},{key:"setValueRange",value:function(e,t,i){if(void 0!==this.options.value){var o=this.options.scaling.customScalingFunction(e,t,i,this.options.value),n=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){var s=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+o*s}this.options.size=this.options.scaling.min+o*n}else this.options.size=this.baseSize,this.options.font.size=this.baseFontSize;this.updateLabelModule()}},{key:"draw",value:function(e){this.shape.draw(e,this.x,this.y,this.selected,this.hover)}},{key:"updateBoundingBox",value:function(e){this.shape.updateBoundingBox(this.x,this.y,e)}},{key:"resize",value:function(e){this.shape.resize(e,this.selected)}},{key:"isOverlappingWith",value:function(e){return this.shape.left<e.right&&this.shape.left+this.shape.width>e.left&&this.shape.top<e.bottom&&this.shape.top+this.shape.height>e.top}},{key:"isBoundingBoxOverlappingWith",value:function(e){return this.shape.boundingBox.left<e.right&&this.shape.boundingBox.right>e.left&&this.shape.boundingBox.top<e.bottom&&this.shape.boundingBox.bottom>e.top}}],[{key:"parseOptions",value:function(e,t){var i=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],o=arguments.length<=3||void 0===arguments[3]?{}:arguments[3],n=["color","font","fixed","shadow"];if(z.selectiveNotDeepExtend(n,e,t,i),z.mergeOptions(e,t,"shadow",i,o),void 0!==t.color&&null!==t.color){var s=z.parseColor(t.color);z.fillIfDefined(e.color,s)}else i===!0&&null===t.color&&(e.color=z.bridgeObject(o.color));void 0!==t.fixed&&null!==t.fixed&&("boolean"==typeof t.fixed?(e.fixed.x=t.fixed,e.fixed.y=t.fixed):(void 0!==t.fixed.x&&"boolean"==typeof t.fixed.x&&(e.fixed.x=t.fixed.x),void 0!==t.fixed.y&&"boolean"==typeof t.fixed.y&&(e.fixed.y=t.fixed.y))),void 0!==t.font&&null!==t.font?a["default"].parseOptions(e.font,t):i===!0&&null===t.font&&(e.font=z.bridgeObject(o.font)),void 0!==t.scaling&&z.mergeOptions(e.scaling,t.scaling,"label",i,o.scaling)}}]),e}();t["default"]=R},function(e,t,i){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){var i=[],o=!0,n=!1,s=void 0;try{for(var r,a=e[Symbol.iterator]();!(o=(r=a.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(h){n=!0,s=h}finally{try{!o&&a["return"]&&a["return"]()}finally{if(n)throw s}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},r=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),a=i(1),h=function(){function e(t,i){var n=arguments.length<=2||void 0===arguments[2]?!1:arguments[2];o(this,e),this.body=t,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(i),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=n}return r(e,[{key:"setOptions",value:function(t){var i=arguments.length<=1||void 0===arguments[1]?!1:arguments[1];this.nodeOptions=t,this.fontOptions=a.deepExtend({},t.font,!0),void 0!==t.label&&(this.labelDirty=!0),void 0!==t.font&&(e.parseOptions(this.fontOptions,t,i),"string"==typeof t.font?this.baseSize=this.fontOptions.size:"object"===s(t.font)&&void 0!==t.font.size&&(this.baseSize=t.font.size))}},{key:"draw",value:function(e,t,i,o){var n=arguments.length<=4||void 0===arguments[4]?"middle":arguments[4];if(void 0!==this.nodeOptions.label){var s=this.fontOptions.size*this.body.view.scale;this.nodeOptions.label&&s<this.nodeOptions.scaling.label.drawThreshold-1||(this.calculateLabelSize(e,o,t,i,n),this._drawBackground(e),this._drawText(e,o,t,i,n))}}},{key:"_drawBackground",value:function(e){if(void 0!==this.fontOptions.background&&"none"!==this.fontOptions.background){e.fillStyle=this.fontOptions.background;var t=2;if(this.isEdgeLabel)switch(this.fontOptions.align){case"middle":e.fillRect(.5*-this.size.width,.5*-this.size.height,this.size.width,this.size.height);break;case"top":e.fillRect(.5*-this.size.width,-(this.size.height+t),this.size.width,this.size.height);break;case"bottom":e.fillRect(.5*-this.size.width,t,this.size.width,this.size.height);break;default:e.fillRect(this.size.left,this.size.top-.5*t,this.size.width,this.size.height)}else e.fillRect(this.size.left,this.size.top-.5*t,this.size.width,this.size.height)}}},{key:"_drawText",value:function(e,t,i,o){var s=arguments.length<=4||void 0===arguments[4]?"middle":arguments[4],r=this.fontOptions.size,a=r*this.body.view.scale;a>=this.nodeOptions.scaling.label.maxVisible&&(r=Number(this.nodeOptions.scaling.label.maxVisible)/this.body.view.scale);var h=this.size.yLine,d=this._getColor(a),l=n(d,2),c=l[0],u=l[1],f=this._setAlignment(e,i,h,s),p=n(f,2);i=p[0],h=p[1],e.font=(t&&this.nodeOptions.labelHighlightBold?"bold ":"")+r+"px "+this.fontOptions.face,e.fillStyle=c,this.isEdgeLabel||"left"!==this.fontOptions.align?e.textAlign="center":(e.textAlign=this.fontOptions.align,i-=.5*this.size.width),this.fontOptions.strokeWidth>0&&(e.lineWidth=this.fontOptions.strokeWidth,e.strokeStyle=u,e.lineJoin="round");for(var v=0;v<this.lineCount;v++)this.fontOptions.strokeWidth>0&&e.strokeText(this.lines[v],i,h),e.fillText(this.lines[v],i,h),h+=r}},{key:"_setAlignment",value:function(e,t,i,o){if(this.isEdgeLabel&&"horizontal"!==this.fontOptions.align&&this.pointToSelf===!1){t=0,i=0;var n=2;"top"===this.fontOptions.align?(e.textBaseline="alphabetic",i-=2*n):"bottom"===this.fontOptions.align?(e.textBaseline="hanging",i+=2*n):e.textBaseline="middle"}else e.textBaseline=o;return[t,i]}},{key:"_getColor",value:function(e){var t=this.fontOptions.color||"#000000",i=this.fontOptions.strokeColor||"#ffffff";if(e<=this.nodeOptions.scaling.label.drawThreshold){var o=Math.max(0,Math.min(1,1-(this.nodeOptions.scaling.label.drawThreshold-e)));t=a.overrideOpacity(t,o),i=a.overrideOpacity(i,o)}return[t,i]}},{key:"getTextSize",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],i={width:this._processLabel(e,t),height:this.fontOptions.size*this.lineCount,lineCount:this.lineCount};return i}},{key:"calculateLabelSize",value:function(e,t){var i=arguments.length<=2||void 0===arguments[2]?0:arguments[2],o=arguments.length<=3||void 0===arguments[3]?0:arguments[3],n=arguments.length<=4||void 0===arguments[4]?"middle":arguments[4];this.labelDirty===!0&&(this.size.width=this._processLabel(e,t)),this.size.height=this.fontOptions.size*this.lineCount,this.size.left=i-.5*this.size.width,this.size.top=o-.5*this.size.height,this.size.yLine=o+.5*(1-this.lineCount)*this.fontOptions.size,"hanging"===n&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4),this.labelDirty=!1}},{key:"_processLabel",value:function(e,t){var i=0,o=[""],n=0;if(void 0!==this.nodeOptions.label){o=String(this.nodeOptions.label).split("\n"),n=o.length,e.font=(t&&this.nodeOptions.labelHighlightBold?"bold ":"")+this.fontOptions.size+"px "+this.fontOptions.face,i=e.measureText(o[0]).width;for(var s=1;n>s;s++){var r=e.measureText(o[s]).width;i=r>i?r:i}}return this.lines=o,this.lineCount=n,i}}],[{key:"parseOptions",value:function(e,t){var i=arguments.length<=2||void 0===arguments[2]?!1:arguments[2];if("string"==typeof t.font){var o=t.font.split(" ");e.size=o[0].replace("px",""),e.face=o[1],e.color=o[2]}else"object"===s(t.font)&&a.fillIfDefined(e,t.font,i);e.size=Number(e.size)}}]),e}();t["default"]=h},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(18),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"resize",value:function(e,t){if(void 0===this.width){var i=5,o=this.labelModule.getTextSize(e,t);this.width=o.width+2*i,this.height=o.height+2*i,this.radius=.5*this.width}}},{key:"draw",value:function(e,t,i,o,n){this.resize(e,o),this.left=t-this.width/2,this.top=i-this.height/2;var s=this.options.borderWidth,r=this.options.borderWidthSelected||2*this.options.borderWidth;e.strokeStyle=o?this.options.color.highlight.border:n?this.options.color.hover.border:this.options.color.border,e.lineWidth=o?r:s,e.lineWidth/=this.body.view.scale,e.lineWidth=Math.min(this.width,e.lineWidth),e.fillStyle=o?this.options.color.highlight.background:n?this.options.color.hover.background:this.options.color.background;var a=this.options.shapeProperties.borderRadius;e.roundRect(this.left,this.top,this.width,this.height,a),this.enableShadow(e),e.fill(),this.disableShadow(e),e.save(),s>0&&(this.enableBorderDashes(e),e.stroke(),this.disableBorderDashes(e)),e.restore(),this.updateBoundingBox(t,i,e,o),this.labelModule.draw(e,t,i,o)}},{key:"updateBoundingBox",value:function(e,t,i,o){this.resize(i,o),this.left=e-.5*this.width,this.top=t-.5*this.height;var n=this.options.shapeProperties.borderRadius;this.boundingBox.left=this.left-n,this.boundingBox.top=this.top-n,this.boundingBox.bottom=this.top+this.height+n,this.boundingBox.right=this.left+this.width+n}},{key:"distanceToBorder",value:function(e,t){this.resize(e);var i=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(t)),Math.abs(this.height/2/Math.sin(t)))+i}}]),t}(d["default"]);t["default"]=l},function(e,t){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),n=function(){function e(t,o,n){i(this,e),this.body=o,this.labelModule=n,this.setOptions(t),this.top=void 0,this.left=void 0,this.height=void 0,this.width=void 0,this.radius=void 0,this.boundingBox={top:0,left:0,right:0,bottom:0}}return o(e,[{key:"setOptions",value:function(e){this.options=e}},{key:"_distanceToBorder",value:function(e,t){var i=this.options.borderWidth;return this.resize(e),Math.min(Math.abs(this.width/2/Math.cos(t)),Math.abs(this.height/2/Math.sin(t)))+i}},{key:"enableShadow",value:function(e){this.options.shadow.enabled===!0&&(e.shadowColor=this.options.shadow.color,e.shadowBlur=this.options.shadow.size,e.shadowOffsetX=this.options.shadow.x,e.shadowOffsetY=this.options.shadow.y)}},{key:"disableShadow",value:function(e){this.options.shadow.enabled===!0&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}},{key:"enableBorderDashes",value:function(e){if(this.options.shapeProperties.borderDashes!==!1)if(void 0!==e.setLineDash){var t=this.options.shapeProperties.borderDashes;t===!0&&(t=[5,15]),e.setLineDash(t)}else console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1}},{key:"disableBorderDashes",value:function(e){this.options.shapeProperties.borderDashes!==!1&&(void 0!==e.setLineDash?e.setLineDash([0]):(console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1))}}]),e}();t["default"]=n},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(20),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"resize",value:function(e,t){if(void 0===this.width){var i=5,o=this.labelModule.getTextSize(e,t),n=Math.max(o.width,o.height)+2*i;this.options.size=n/2,this.width=n,this.height=n,this.radius=.5*this.width}}},{key:"draw",value:function(e,t,i,o,n){this.resize(e,o),this.left=t-this.width/2,this.top=i-this.height/2,this._drawRawCircle(e,t,i,o,n,this.options.size),this.boundingBox.top=i-this.options.size,this.boundingBox.left=t-this.options.size,this.boundingBox.right=t+this.options.size,this.boundingBox.bottom=i+this.options.size,this.updateBoundingBox(t,i),this.labelModule.draw(e,t,i,o)}},{key:"updateBoundingBox",value:function(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size}},{key:"distanceToBorder",value:function(e,t){return this.resize(e),.5*this.width}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(18),d=o(h),l=function(e){function t(e,i,o){n(this,t);var r=s(this,Object.getPrototypeOf(t).call(this,e,i,o));return r.labelOffset=0,r.imageLoaded=!1,r}return r(t,e),a(t,[{key:"setOptions",value:function(e,t){this.options=e,t&&(this.imageObj=t)}},{key:"_resizeImage",value:function(){var e=!1;if(this.imageObj.width&&this.imageObj.height?this.imageLoaded===!1&&(this.imageLoaded=!0,e=!0):this.imageLoaded=!1,!this.width||!this.height||e===!0){var t,i,o;this.imageObj.width&&this.imageObj.height&&(t=0,i=0),this.options.shapeProperties.useImageSize===!1?this.imageObj.width>this.imageObj.height?(o=this.imageObj.width/this.imageObj.height,t=2*this.options.size*o||this.imageObj.width,i=2*this.options.size||this.imageObj.height):(o=this.imageObj.width&&this.imageObj.height?this.imageObj.height/this.imageObj.width:1,t=2*this.options.size,i=2*this.options.size*o):(t=this.imageObj.width,i=this.imageObj.height),this.width=t,this.height=i,this.radius=.5*this.width}}},{key:"_drawRawCircle",value:function(e,t,i,o,n,s){var r=this.options.borderWidth,a=this.options.borderWidthSelected||2*this.options.borderWidth,h=(o?a:r)/this.body.view.scale;e.lineWidth=Math.min(this.width,h),e.strokeStyle=o?this.options.color.highlight.border:n?this.options.color.hover.border:this.options.color.border,e.fillStyle=o?this.options.color.highlight.background:n?this.options.color.hover.background:this.options.color.background,e.circle(t,i,s),this.enableShadow(e),e.fill(),this.disableShadow(e),e.save(),h>0&&(this.enableBorderDashes(e),e.stroke(),this.disableBorderDashes(e)),e.restore()}},{key:"_drawImageAtPosition",value:function(e){if(0!=this.imageObj.width){e.globalAlpha=1,this.enableShadow(e);var t=this.imageObj.width/this.width/this.body.view.scale;if(t>2&&this.options.shapeProperties.interpolation===!0){var i=this.imageObj.width,o=this.imageObj.height,n=document.createElement("canvas");n.width=i,n.height=i;var s=n.getContext("2d");t*=.5,i*=.5,o*=.5,s.drawImage(this.imageObj,0,0,i,o);for(var r=0,a=1;t>2&&4>a;)s.drawImage(n,r,0,i,o,r+i,0,i/2,o/2),r+=i,t*=.5,i*=.5,o*=.5,a+=1;e.drawImage(n,r,0,i,o,this.left,this.top,this.width,this.height)}else e.drawImage(this.imageObj,this.left,this.top,this.width,this.height);this.disableShadow(e)}}},{key:"_drawImageLabel",value:function(e,t,i,o){var n,s=0;if(void 0!==this.height){s=.5*this.height;var r=this.labelModule.getTextSize(e);r.lineCount>=1&&(s+=r.height/2)}n=i+s,this.options.label&&(this.labelOffset=s),this.labelModule.draw(e,t,n,o,"hanging")}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(20),d=o(h),l=function(e){function t(e,i,o,r){n(this,t);var a=s(this,Object.getPrototypeOf(t).call(this,e,i,o));return a.imageObj=r,a._swapToImageResizeWhenImageLoaded=!0,a}return r(t,e),a(t,[{key:"resize",value:function(){if(void 0===this.imageObj.src||void 0===this.imageObj.width||void 0===this.imageObj.height){if(!this.width){var e=2*this.options.size;this.width=e,this.height=e,this._swapToImageResizeWhenImageLoaded=!0,this.radius=.5*this.width}}else this._swapToImageResizeWhenImageLoaded&&(this.width=void 0,this.height=void 0,this._swapToImageResizeWhenImageLoaded=!1),this._resizeImage()}},{key:"draw",value:function(e,t,i,o,n){this.resize(),this.left=t-this.width/2,this.top=i-this.height/2;var s=Math.min(.5*this.height,.5*this.width);this._drawRawCircle(e,t,i,o,n,s),e.save(),e.clip(),this._drawImageAtPosition(e),e.restore(),this._drawImageLabel(e,t,i,o),this.updateBoundingBox(t,i)}},{key:"updateBoundingBox",value:function(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size,this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset)}},{key:"distanceToBorder",value:function(e,t){return this.resize(e),.5*this.width}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(18),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"resize",value:function(e,t){if(void 0===this.width){var i=5,o=this.labelModule.getTextSize(e,t),n=o.width+2*i;this.width=n,this.height=n,this.radius=.5*this.width}}},{key:"draw",value:function(e,t,i,o,n){this.resize(e,o),this.left=t-this.width/2,this.top=i-this.height/2;var s=this.options.borderWidth,r=this.options.borderWidthSelected||2*this.options.borderWidth,a=(o?r:s)/this.body.view.scale;e.lineWidth=Math.min(this.width,a),e.strokeStyle=o?this.options.color.highlight.border:n?this.options.color.hover.border:this.options.color.border,e.fillStyle=o?this.options.color.highlight.background:n?this.options.color.hover.background:this.options.color.background,e.database(t-this.width/2,i-.5*this.height,this.width,this.height),this.enableShadow(e),e.fill(),this.disableShadow(e),e.save(),a>0&&(this.enableBorderDashes(e),e.stroke(),this.disableBorderDashes(e)),e.restore(),this.updateBoundingBox(t,i,e,o),this.labelModule.draw(e,t,i,o)}},{key:"updateBoundingBox",value:function(e,t,i,o){this.resize(i,o),this.left=e-.5*this.width,this.top=t-.5*this.height,this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,
-this.boundingBox.right=this.left+this.width}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(24),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"resize",value:function(e){this._resizeShape()}},{key:"draw",value:function(e,t,i,o,n){this._drawShape(e,"diamond",4,t,i,o,n)}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(18),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"_resizeShape",value:function(){if(void 0===this.width){var e=2*this.options.size;this.width=e,this.height=e,this.radius=.5*this.width}}},{key:"_drawShape",value:function(e,t,i,o,n,s,r){this._resizeShape(),this.left=o-this.width/2,this.top=n-this.height/2;var a=this.options.borderWidth,h=this.options.borderWidthSelected||2*this.options.borderWidth,d=(s?h:a)/this.body.view.scale;if(e.lineWidth=Math.min(this.width,d),e.strokeStyle=s?this.options.color.highlight.border:r?this.options.color.hover.border:this.options.color.border,e.fillStyle=s?this.options.color.highlight.background:r?this.options.color.hover.background:this.options.color.background,e[t](o,n,this.options.size),this.enableShadow(e),e.fill(),this.disableShadow(e),e.save(),d>0&&(this.enableBorderDashes(e),e.stroke(),this.disableBorderDashes(e)),e.restore(),void 0!==this.options.label){var l=n+.5*this.height+3;this.labelModule.draw(e,o,l,s,"hanging")}this.updateBoundingBox(o,n)}},{key:"updateBoundingBox",value:function(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size,void 0!==this.options.label&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+3))}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(24),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"resize",value:function(e){this._resizeShape()}},{key:"draw",value:function(e,t,i,o,n){this._drawShape(e,"circle",2,t,i,o,n)}},{key:"distanceToBorder",value:function(e,t){return this.resize(e),this.options.size}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(18),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"resize",value:function(e,t){if(void 0===this.width){var i=this.labelModule.getTextSize(e,t);this.width=1.5*i.width,this.height=2*i.height,this.width<this.height&&(this.width=this.height),this.radius=.5*this.width}}},{key:"draw",value:function(e,t,i,o,n){this.resize(e,o),this.left=t-.5*this.width,this.top=i-.5*this.height;var s=this.options.borderWidth,r=this.options.borderWidthSelected||2*this.options.borderWidth,a=(o?r:s)/this.body.view.scale;e.lineWidth=Math.min(this.width,a),e.strokeStyle=o?this.options.color.highlight.border:n?this.options.color.hover.border:this.options.color.border,e.fillStyle=o?this.options.color.highlight.background:n?this.options.color.hover.background:this.options.color.background,e.ellipse(this.left,this.top,this.width,this.height),this.enableShadow(e),e.fill(),this.disableShadow(e),e.save(),a>0&&(this.enableBorderDashes(e),e.stroke(),this.disableBorderDashes(e)),e.restore(),this.updateBoundingBox(t,i,e,o),this.labelModule.draw(e,t,i,o)}},{key:"updateBoundingBox",value:function(e,t,i,o){this.resize(i,o),this.left=e-.5*this.width,this.top=t-.5*this.height,this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width}},{key:"distanceToBorder",value:function(e,t){this.resize(e);var i=.5*this.width,o=.5*this.height,n=Math.sin(t)*i,s=Math.cos(t)*o;return i*o/Math.sqrt(n*n+s*s)}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(18),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"resize",value:function(e){if(void 0===this.width){var t=5,i={width:Number(this.options.icon.size),height:Number(this.options.icon.size)};this.width=i.width+2*t,this.height=i.height+2*t,this.radius=.5*this.width}}},{key:"draw",value:function(e,t,i,o,n){if(this.resize(e),this.options.icon.size=this.options.icon.size||50,this.left=t-.5*this.width,this.top=i-.5*this.height,this._icon(e,t,i,o),void 0!==this.options.label){var s=5;this.labelModule.draw(e,t,i+.5*this.height+s,o)}this.updateBoundingBox(t,i)}},{key:"updateBoundingBox",value:function(e,t){if(this.boundingBox.top=t-.5*this.options.icon.size,this.boundingBox.left=e-.5*this.options.icon.size,this.boundingBox.right=e+.5*this.options.icon.size,this.boundingBox.bottom=t+.5*this.options.icon.size,void 0!==this.options.label&&this.labelModule.size.width>0){var i=5;this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+i)}}},{key:"_icon",value:function(e,t,i,o){var n=Number(this.options.icon.size);void 0!==this.options.icon.code?(e.font=(o?"bold ":"")+n+"px "+this.options.icon.face,e.fillStyle=this.options.icon.color||"black",e.textAlign="center",e.textBaseline="middle",this.enableShadow(e),e.fillText(this.options.icon.code,t,i),this.disableShadow(e)):console.error("When using the icon shape, you need to define the code in the icon options object. This can be done per node or globally.")}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(20),d=o(h),l=function(e){function t(e,i,o,r){n(this,t);var a=s(this,Object.getPrototypeOf(t).call(this,e,i,o));return a.imageObj=r,a}return r(t,e),a(t,[{key:"resize",value:function(){this._resizeImage()}},{key:"draw",value:function(e,t,i,o,n){if(this.resize(),this.left=t-this.width/2,this.top=i-this.height/2,this.options.shapeProperties.useBorderWithImage===!0){var s=this.options.borderWidth,r=this.options.borderWidthSelected||2*this.options.borderWidth,a=(o?r:s)/this.body.view.scale;e.lineWidth=Math.min(this.width,a),e.beginPath(),e.strokeStyle=o?this.options.color.highlight.border:n?this.options.color.hover.border:this.options.color.border,e.fillStyle=o?this.options.color.highlight.background:n?this.options.color.hover.background:this.options.color.background,e.rect(this.left-.5*e.lineWidth,this.top-.5*e.lineWidth,this.width+e.lineWidth,this.height+e.lineWidth),e.fill(),e.save(),a>0&&(this.enableBorderDashes(e),e.stroke(),this.disableBorderDashes(e)),e.restore(),e.closePath()}this._drawImageAtPosition(e),this._drawImageLabel(e,t,i,o||n),this.updateBoundingBox(t,i)}},{key:"updateBoundingBox",value:function(e,t){this.resize(),this.left=e-this.width/2,this.top=t-this.height/2,this.boundingBox.top=this.top,this.boundingBox.left=this.left,this.boundingBox.right=this.left+this.width,this.boundingBox.bottom=this.top+this.height,void 0!==this.options.label&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset))}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(24),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"resize",value:function(){this._resizeShape()}},{key:"draw",value:function(e,t,i,o,n){this._drawShape(e,"square",2,t,i,o,n)}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(24),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"resize",value:function(e){this._resizeShape()}},{key:"draw",value:function(e,t,i,o,n){this._drawShape(e,"star",4,t,i,o,n)}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(18),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"resize",value:function(e,t){if(void 0===this.width){var i=5,o=this.labelModule.getTextSize(e,t);this.width=o.width+2*i,this.height=o.height+2*i,this.radius=.5*this.width}}},{key:"draw",value:function(e,t,i,o,n){this.resize(e,o||n),this.left=t-this.width/2,this.top=i-this.height/2,this.enableShadow(e),this.labelModule.draw(e,t,i,o||n),this.disableShadow(e),this.updateBoundingBox(t,i,e,o)}},{key:"updateBoundingBox",value:function(e,t,i,o){this.resize(i,o),this.left=e-this.width/2,this.top=t-this.height/2,this.boundingBox.top=this.top,this.boundingBox.left=this.left,this.boundingBox.right=this.left+this.width,this.boundingBox.bottom=this.top+this.height}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(24),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"resize",value:function(e){this._resizeShape()}},{key:"draw",value:function(e,t,i,o,n){this._drawShape(e,"triangle",3,t,i,o,n)}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(24),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"resize",value:function(e){this._resizeShape()}},{key:"draw",value:function(e,t,i,o,n){this._drawShape(e,"triangleDown",3,t,i,o,n)}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},s=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),r=i(1),a=!1,h=void 0,d="background: #FFeeee; color: #dd0000",l=function(){function e(){o(this,e)}return s(e,null,[{key:"validate",value:function(t,i,o){a=!1,h=i;var n=i;return void 0!==o&&(n=i[o]),e.parse(t,n,[]),a}},{key:"parse",value:function(t,i,o){for(var n in t)t.hasOwnProperty(n)&&e.check(n,t,i,o)}},{key:"check",value:function(t,i,o,n){void 0===o[t]&&void 0===o.__any__?e.getSuggestion(t,o,n):void 0===o[t]&&void 0!==o.__any__?"object"===e.getType(i[t])&&void 0!==o.__any__.__type__?e.checkFields(t,i,o,"__any__",o.__any__.__type__,n):e.checkFields(t,i,o,"__any__",o.__any__,n):void 0!==o[t].__type__?e.checkFields(t,i,o,t,o[t].__type__,n):e.checkFields(t,i,o,t,o[t],n)}},{key:"checkFields",value:function(t,i,o,n,s,h){var l=e.getType(i[t]),c=s[l];void 0!==c?"array"===e.getType(c)&&-1===c.indexOf(i[t])?(console.log('%cInvalid option detected in "'+t+'". Allowed values are:'+e.print(c)+' not "'+i[t]+'". '+e.printLocation(h,t),d),a=!0):"object"===l&&"__any__"!==n&&(h=r.copyAndExtendArray(h,t),e.parse(i[t],o[n],h)):void 0===s.any&&(console.log('%cInvalid type received for "'+t+'". Expected: '+e.print(Object.keys(s))+". Received ["+l+'] "'+i[t]+'"'+e.printLocation(h,t),d),a=!0)}},{key:"getType",value:function(e){var t="undefined"==typeof e?"undefined":n(e);return"object"===t?null===e?"null":e instanceof Boolean?"boolean":e instanceof Number?"number":e instanceof String?"string":Array.isArray(e)?"array":e instanceof Date?"date":void 0!==e.nodeType?"dom":e._isAMomentObject===!0?"moment":"object":"number"===t?"number":"boolean"===t?"boolean":"string"===t?"string":void 0===t?"undefined":t}},{key:"getSuggestion",value:function(t,i,o){var n=e.findInOptions(t,i,o,!1),s=e.findInOptions(t,h,[],!0),r=8,l=4;void 0!==n.indexMatch?console.log('%cUnknown option detected: "'+t+'" in '+e.printLocation(n.path,t,"")+'Perhaps it was incomplete? Did you mean: "'+n.indexMatch+'"?\n\n',d):s.distance<=l&&n.distance>s.distance?console.log('%cUnknown option detected: "'+t+'" in '+e.printLocation(n.path,t,"")+"Perhaps it was misplaced? Matching option found at: "+e.printLocation(s.path,s.closestMatch,""),d):n.distance<=r?console.log('%cUnknown option detected: "'+t+'". Did you mean "'+n.closestMatch+'"?'+e.printLocation(n.path,t),d):console.log('%cUnknown option detected: "'+t+'". Did you mean one of these: '+e.print(Object.keys(i))+e.printLocation(o,t),d),a=!0}},{key:"findInOptions",value:function(t,i,o){var n=arguments.length<=3||void 0===arguments[3]?!1:arguments[3],s=1e9,a="",h=[],d=t.toLowerCase(),l=void 0;for(var c in i){var u=void 0;if(void 0!==i[c].__type__&&n===!0){var f=e.findInOptions(t,i[c],r.copyAndExtendArray(o,c));s>f.distance&&(a=f.closestMatch,h=f.path,s=f.distance,l=f.indexMatch)}else-1!==c.toLowerCase().indexOf(d)&&(l=c),u=e.levenshteinDistance(t,c),s>u&&(a=c,h=r.copyArray(o),s=u)}return{closestMatch:a,path:h,distance:s,indexMatch:l}}},{key:"printLocation",value:function(e,t){for(var i=arguments.length<=2||void 0===arguments[2]?"Problem value found at: \n":arguments[2],o="\n\n"+i+"options = {\n",n=0;n<e.length;n++){for(var s=0;n+1>s;s++)o+=" ";o+=e[n]+": {\n"}for(var r=0;r<e.length+1;r++)o+=" ";o+=t+"\n";for(var a=0;a<e.length+1;a++){for(var h=0;h<e.length-a;h++)o+=" ";o+="}\n"}return o+"\n\n"}},{key:"print",value:function(e){return JSON.stringify(e).replace(/(\")|(\[)|(\])|(,"__type__")/g,"").replace(/(\,)/g,", ")}},{key:"levenshteinDistance",value:function(e,t){if(0===e.length)return t.length;if(0===t.length)return e.length;var i,o=[];for(i=0;i<=t.length;i++)o[i]=[i];var n;for(n=0;n<=e.length;n++)o[0][n]=n;for(i=1;i<=t.length;i++)for(n=1;n<=e.length;n++)t.charAt(i-1)==e.charAt(n-1)?o[i][n]=o[i-1][n-1]:o[i][n]=Math.min(o[i-1][n-1]+1,Math.min(o[i][n-1]+1,o[i-1][n]+1));return o[t.length][e.length]}}]),e}();t["default"]=l,t.printStyle=d},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),r=i(36),a=o(r),h=i(16),d=o(h),l=i(1),c=i(8),u=i(10),f=function(){function e(t,i,o){var s=this;n(this,e),this.body=t,this.images=i,this.groups=o,this.body.functions.createEdge=this.create.bind(this),this.edgesListeners={add:function(e,t){s.add(t.items)},update:function(e,t){s.update(t.items)},remove:function(e,t){s.remove(t.items)}},this.options={},this.defaultOptions={arrows:{to:{enabled:!1,scaleFactor:1},middle:{enabled:!1,scaleFactor:1},from:{enabled:!1,scaleFactor:1}},arrowStrikethrough:!0,color:{color:"#848484",highlight:"#848484",hover:"#848484",inherit:"from",opacity:1},dashes:!1,font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:2,strokeColor:"#ffffff",align:"horizontal"},hidden:!1,hoverWidth:1.5,label:void 0,labelHighlightBold:!0,length:void 0,physics:!0,scaling:{min:1,max:15,label:{enabled:!0,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(e,t,i,o){if(t===e)return.5;var n=1/(t-e);return Math.max(0,(o-e)*n)}},selectionWidth:1.5,selfReferenceSize:20,shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},smooth:{enabled:!0,type:"dynamic",forceDirection:"none",roundness:.5},title:void 0,width:1,value:void 0},l.extend(this.options,this.defaultOptions),this.bindEventListeners()}return s(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("_forceDisableDynamicCurves",function(t){"dynamic"===t&&(t="continuous");var i=!1;for(var o in e.body.edges)if(e.body.edges.hasOwnProperty(o)){var n=e.body.edges[o],s=e.body.data.edges._data[o];if(void 0!==s){var r=s.smooth;void 0!==r&&r.enabled===!0&&"dynamic"===r.type&&(void 0===t?n.setOptions({smooth:!1}):n.setOptions({smooth:{type:t}}),i=!0)}}i===!0&&e.body.emitter.emit("_dataChanged")}),this.body.emitter.on("_dataUpdated",function(){e.reconnectEdges(),e.markAllEdgesAsDirty()}),this.body.emitter.on("refreshEdges",this.refresh.bind(this)),this.body.emitter.on("refresh",this.refresh.bind(this)),this.body.emitter.on("destroy",function(){l.forEach(e.edgesListeners,function(t,i){e.body.data.edges&&e.body.data.edges.off(i,t)}),delete e.body.functions.createEdge,delete e.edgesListeners.add,delete e.edgesListeners.update,delete e.edgesListeners.remove,delete e.edgesListeners})}},{key:"setOptions",value:function(e){if(void 0!==e){a["default"].parseOptions(this.options,e),void 0!==e.color&&this.markAllEdgesAsDirty();var t=!1;if(void 0!==e.smooth)for(var i in this.body.edges)this.body.edges.hasOwnProperty(i)&&(t=this.body.edges[i].updateEdgeType()||t);if(void 0!==e.font){d["default"].parseOptions(this.options.font,e);for(var o in this.body.edges)this.body.edges.hasOwnProperty(o)&&this.body.edges[o].updateLabelModule()}void 0===e.hidden&&void 0===e.physics&&t!==!0||this.body.emitter.emit("_dataChanged")}}},{key:"setData",value:function(e){var t=this,i=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],o=this.body.data.edges;if(e instanceof c||e instanceof u)this.body.data.edges=e;else if(Array.isArray(e))this.body.data.edges=new c,this.body.data.edges.add(e);else{if(e)throw new TypeError("Array or DataSet expected");this.body.data.edges=new c}if(o&&l.forEach(this.edgesListeners,function(e,t){o.off(t,e)}),this.body.edges={},this.body.data.edges){l.forEach(this.edgesListeners,function(e,i){t.body.data.edges.on(i,e)});var n=this.body.data.edges.getIds();this.add(n,!0)}i===!1&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(e){for(var t=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],i=this.body.edges,o=this.body.data.edges,n=0;n<e.length;n++){var s=e[n],r=i[s];r&&r.disconnect();var a=o.get(s,{showInternalIds:!0});i[s]=this.create(a)}t===!1&&this.body.emitter.emit("_dataChanged")}},{key:"update",value:function(e){for(var t=this.body.edges,i=this.body.data.edges,o=!1,n=0;n<e.length;n++){var s=e[n],r=i.get(s),a=t[s];void 0!==a?(a.disconnect(),o=a.setOptions(r)||o,a.connect()):(this.body.edges[s]=this.create(r),o=!0)}o===!0?this.body.emitter.emit("_dataChanged"):this.body.emitter.emit("_dataUpdated")}},{key:"remove",value:function(e){for(var t=this.body.edges,i=0;i<e.length;i++){var o=e[i],n=t[o];void 0!==n&&(n.cleanup(),n.disconnect(),delete t[o])}this.body.emitter.emit("_dataChanged")}},{key:"refresh",value:function(){var e=this.body.edges;for(var t in e){var i=void 0;e.hasOwnProperty(t)&&(i=e[t]);var o=this.body.data.edges._data[t];void 0!==i&&void 0!==o&&i.setOptions(o)}}},{key:"create",value:function(e){return new a["default"](e,this.body,this.options)}},{key:"markAllEdgesAsDirty",value:function(){for(var e in this.body.edges)this.body.edges[e].edgeType.colorDirty=!0}},{key:"reconnectEdges",value:function(){var e,t=this.body.nodes,i=this.body.edges;for(e in t)t.hasOwnProperty(e)&&(t[e].edges=[]);for(e in i)if(i.hasOwnProperty(e)){var o=i[e];o.from=null,o.to=null,o.connect()}}},{key:"getConnectedNodes",value:function(e){var t=[];if(void 0!==this.body.edges[e]){var i=this.body.edges[e];i.fromId&&t.push(i.fromId),i.toId&&t.push(i.toId)}return t}}]),e}();t["default"]=f},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},r=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),a=i(16),h=o(a),d=i(37),l=o(d),c=i(41),u=o(c),f=i(42),p=o(f),v=i(43),y=o(v),g=i(1),b=function(){function e(t,i,o){if(n(this,e),void 0===i)throw"No body provided";this.options=g.bridgeObject(o),this.globalOptions=o,this.body=i,this.id=void 0,this.fromId=void 0,this.toId=void 0,this.selected=!1,this.hover=!1,this.labelDirty=!0,this.colorDirty=!0,this.baseWidth=this.options.width,this.baseFontSize=this.options.font.size,this.from=void 0,this.to=void 0,this.edgeType=void 0,this.connected=!1,this.labelModule=new h["default"](this.body,this.options,!0),this.setOptions(t)}return r(e,[{key:"setOptions",value:function(t){if(t){this.colorDirty=!0,e.parseOptions(this.options,t,!0,this.globalOptions),void 0!==t.id&&(this.id=t.id),void 0!==t.from&&(this.fromId=t.from),void 0!==t.to&&(this.toId=t.to),void 0!==t.title&&(this.title=t.title),
-void 0!==t.value&&(t.value=parseFloat(t.value)),this.updateLabelModule();var i=this.updateEdgeType();return this._setInteractionWidths(),this.connect(),void 0===t.hidden&&void 0===t.physics||(i=!0),i}}},{key:"updateLabelModule",value:function(){this.labelModule.setOptions(this.options,!0),void 0!==this.labelModule.baseSize&&(this.baseFontSize=this.labelModule.baseSize)}},{key:"updateEdgeType",value:function(){var e=!1,t=!0,i=this.options.smooth;return void 0!==this.edgeType&&(this.edgeType instanceof u["default"]&&i.enabled===!0&&"dynamic"===i.type&&(t=!1),this.edgeType instanceof l["default"]&&i.enabled===!0&&"cubicBezier"===i.type&&(t=!1),this.edgeType instanceof p["default"]&&i.enabled===!0&&"dynamic"!==i.type&&"cubicBezier"!==i.type&&(t=!1),this.edgeType instanceof y["default"]&&i.enabled===!1&&(t=!1),t===!0&&(e=this.cleanup())),t===!0?this.options.smooth.enabled===!0?"dynamic"===this.options.smooth.type?(e=!0,this.edgeType=new u["default"](this.options,this.body,this.labelModule)):"cubicBezier"===this.options.smooth.type?this.edgeType=new l["default"](this.options,this.body,this.labelModule):this.edgeType=new p["default"](this.options,this.body,this.labelModule):this.edgeType=new y["default"](this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),e}},{key:"connect",value:function(){this.disconnect(),this.from=this.body.nodes[this.fromId]||void 0,this.to=this.body.nodes[this.toId]||void 0,this.connected=void 0!==this.from&&void 0!==this.to,this.connected===!0?(this.from.attachEdge(this),this.to.attachEdge(this)):(this.from&&this.from.detachEdge(this),this.to&&this.to.detachEdge(this)),this.edgeType.connect()}},{key:"disconnect",value:function(){this.from&&(this.from.detachEdge(this),this.from=void 0),this.to&&(this.to.detachEdge(this),this.to=void 0),this.connected=!1}},{key:"getTitle",value:function(){return this.title}},{key:"isSelected",value:function(){return this.selected}},{key:"getValue",value:function(){return this.options.value}},{key:"setValueRange",value:function(e,t,i){if(void 0!==this.options.value){var o=this.options.scaling.customScalingFunction(e,t,i,this.options.value),n=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){var s=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+o*s}this.options.width=this.options.scaling.min+o*n}else this.options.width=this.baseWidth,this.options.font.size=this.baseFontSize;this._setInteractionWidths(),this.updateLabelModule()}},{key:"_setInteractionWidths",value:function(){"function"==typeof this.options.hoverWidth?this.edgeType.hoverWidth=this.options.hoverWidth(this.options.width):this.edgeType.hoverWidth=this.options.hoverWidth+this.options.width,"function"==typeof this.options.selectionWidth?this.edgeType.selectionWidth=this.options.selectionWidth(this.options.width):this.edgeType.selectionWidth=this.options.selectionWidth+this.options.width}},{key:"draw",value:function(e){var t=this.edgeType.getViaNode(),i={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,this.options.arrows.from.enabled===!0&&(i.from=this.edgeType.getArrowData(e,"from",t,this.selected,this.hover),this.options.arrowStrikethrough===!1&&(this.edgeType.fromPoint=i.from.core)),this.options.arrows.to.enabled===!0&&(i.to=this.edgeType.getArrowData(e,"to",t,this.selected,this.hover),this.options.arrowStrikethrough===!1&&(this.edgeType.toPoint=i.to.core)),this.options.arrows.middle.enabled===!0&&(i.middle=this.edgeType.getArrowData(e,"middle",t,this.selected,this.hover)),this.edgeType.drawLine(e,this.selected,this.hover,t),this.drawArrows(e,i),this.drawLabel(e,t)}},{key:"drawArrows",value:function(e,t){this.options.arrows.from.enabled===!0&&this.edgeType.drawArrowHead(e,this.selected,this.hover,t.from),this.options.arrows.middle.enabled===!0&&this.edgeType.drawArrowHead(e,this.selected,this.hover,t.middle),this.options.arrows.to.enabled===!0&&this.edgeType.drawArrowHead(e,this.selected,this.hover,t.to)}},{key:"drawLabel",value:function(e,t){if(void 0!==this.options.label){var i=this.from,o=this.to,n=this.from.selected||this.to.selected||this.selected;if(i.id!=o.id){this.labelModule.pointToSelf=!1;var s=this.edgeType.getPoint(.5,t);e.save(),"horizontal"!==this.options.font.align&&(this.labelModule.calculateLabelSize(e,n,s.x,s.y),e.translate(s.x,this.labelModule.size.yLine),this._rotateForLabelAlignment(e)),this.labelModule.draw(e,s.x,s.y,n),e.restore()}else{this.labelModule.pointToSelf=!0;var r,a,h=this.options.selfReferenceSize;i.shape.width>i.shape.height?(r=i.x+.5*i.shape.width,a=i.y-h):(r=i.x+h,a=i.y-.5*i.shape.height),s=this._pointOnCircle(r,a,h,.125),this.labelModule.draw(e,s.x,s.y,n)}}}},{key:"isOverlappingWith",value:function(e){if(this.connected){var t=10,i=this.from.x,o=this.from.y,n=this.to.x,s=this.to.y,r=e.left,a=e.top,h=this.edgeType.getDistanceToEdge(i,o,n,s,r,a);return t>h}return!1}},{key:"_rotateForLabelAlignment",value:function(e){var t=this.from.y-this.to.y,i=this.from.x-this.to.x,o=Math.atan2(t,i);(-1>o&&0>i||o>0&&0>i)&&(o+=Math.PI),e.rotate(o)}},{key:"_pointOnCircle",value:function(e,t,i,o){var n=2*o*Math.PI;return{x:e+i*Math.cos(n),y:t-i*Math.sin(n)}}},{key:"select",value:function(){this.selected=!0}},{key:"unselect",value:function(){this.selected=!1}},{key:"cleanup",value:function(){return this.edgeType.cleanup()}}],[{key:"parseOptions",value:function(e,t){var i=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],o=arguments.length<=3||void 0===arguments[3]?{}:arguments[3],n=["arrowStrikethrough","id","from","hidden","hoverWidth","label","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","to","title","value","width"];if(g.selectiveDeepExtend(n,e,t,i),g.mergeOptions(e,t,"smooth",i,o),g.mergeOptions(e,t,"shadow",i,o),void 0!==t.dashes&&null!==t.dashes?e.dashes=t.dashes:i===!0&&null===t.dashes&&(e.dashes=Object.create(o.dashes)),void 0!==t.scaling&&null!==t.scaling?(void 0!==t.scaling.min&&(e.scaling.min=t.scaling.min),void 0!==t.scaling.max&&(e.scaling.max=t.scaling.max),g.mergeOptions(e.scaling,t.scaling,"label",i,o.scaling)):i===!0&&null===t.scaling&&(e.scaling=Object.create(o.scaling)),void 0!==t.arrows&&null!==t.arrows)if("string"==typeof t.arrows){var r=t.arrows.toLowerCase();e.arrows.to.enabled=-1!=r.indexOf("to"),e.arrows.middle.enabled=-1!=r.indexOf("middle"),e.arrows.from.enabled=-1!=r.indexOf("from")}else{if("object"!==s(t.arrows))throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+JSON.stringify(t.arrows));g.mergeOptions(e.arrows,t.arrows,"to",i,o.arrows),g.mergeOptions(e.arrows,t.arrows,"middle",i,o.arrows),g.mergeOptions(e.arrows,t.arrows,"from",i,o.arrows)}else i===!0&&null===t.arrows&&(e.arrows=Object.create(o.arrows));if(void 0!==t.color&&null!==t.color)if(e.color=g.deepExtend({},e.color,!0),g.isString(t.color))e.color.color=t.color,e.color.highlight=t.color,e.color.hover=t.color,e.color.inherit=!1;else{var a=!1;void 0!==t.color.color&&(e.color.color=t.color.color,a=!0),void 0!==t.color.highlight&&(e.color.highlight=t.color.highlight,a=!0),void 0!==t.color.hover&&(e.color.hover=t.color.hover,a=!0),void 0!==t.color.inherit&&(e.color.inherit=t.color.inherit),void 0!==t.color.opacity&&(e.color.opacity=Math.min(1,Math.max(0,t.color.opacity))),void 0===t.color.inherit&&a===!0&&(e.color.inherit=!1)}else i===!0&&null===t.color&&(e.color=g.bridgeObject(o.color));void 0!==t.font&&null!==t.font?h["default"].parseOptions(e.font,t):i===!0&&null===t.font&&(e.font=g.bridgeObject(o.font))}}]),e}();t["default"]=b},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){var i=[],o=!0,n=!1,s=void 0;try{for(var r,a=e[Symbol.iterator]();!(o=(r=a.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(h){n=!0,s=h}finally{try{!o&&a["return"]&&a["return"]()}finally{if(n)throw s}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),h=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),d=i(38),l=o(d),c=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),h(t,[{key:"_line",value:function(e,t){var i=t[0],o=t[1];e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),void 0===t||void 0===i.x?e.lineTo(this.toPoint.x,this.toPoint.y):e.bezierCurveTo(i.x,i.y,o.x,o.y,this.toPoint.x,this.toPoint.y),this.enableShadow(e),e.stroke(),this.disableShadow(e)}},{key:"_getViaCoordinates",value:function(){var e=this.from.x-this.to.x,t=this.from.y-this.to.y,i=void 0,o=void 0,n=void 0,s=void 0,r=this.options.smooth.roundness;return(Math.abs(e)>Math.abs(t)||this.options.smooth.forceDirection===!0||"horizontal"===this.options.smooth.forceDirection)&&"vertical"!==this.options.smooth.forceDirection?(o=this.from.y,s=this.to.y,i=this.from.x-r*e,n=this.to.x+r*e):(o=this.from.y-r*t,s=this.to.y+r*t,i=this.from.x,n=this.to.x),[{x:i,y:o},{x:n,y:s}]}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_findBorderPosition",value:function(e,t){return this._findBorderPositionBezier(e,t)}},{key:"_getDistanceToEdge",value:function(e,t,i,o,n,s){var r=arguments.length<=6||void 0===arguments[6]?this._getViaCoordinates():arguments[6],h=a(r,2),d=h[0],l=h[1];return this._getDistanceToBezierEdge(e,t,i,o,n,s,d,l)}},{key:"getPoint",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?this._getViaCoordinates():arguments[1],i=a(t,2),o=i[0],n=i[1],s=e,r=[];r[0]=Math.pow(1-s,3),r[1]=3*s*Math.pow(1-s,2),r[2]=3*Math.pow(s,2)*(1-s),r[3]=Math.pow(s,3);var h=r[0]*this.fromPoint.x+r[1]*o.x+r[2]*n.x+r[3]*this.toPoint.x,d=r[0]*this.fromPoint.y+r[1]*o.y+r[2]*n.y+r[3]*this.toPoint.y;return{x:h,y:d}}}]),t}(l["default"]);t["default"]=c},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(39),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"_getDistanceToBezierEdge",value:function(e,t,i,o,n,s,r,a){var h=1e9,d=void 0,l=void 0,c=void 0,u=void 0,f=void 0,p=e,v=t,y=[0,0,0,0];for(l=1;10>l;l++)c=.1*l,y[0]=Math.pow(1-c,3),y[1]=3*c*Math.pow(1-c,2),y[2]=3*Math.pow(c,2)*(1-c),y[3]=Math.pow(c,3),u=y[0]*e+y[1]*r.x+y[2]*a.x+y[3]*i,f=y[0]*t+y[1]*r.y+y[2]*a.y+y[3]*o,l>0&&(d=this._getDistanceToLine(p,v,u,f,n,s),h=h>d?d:h),p=u,v=f;return h}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(40),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"_findBorderPositionBezier",value:function(e,t){var i,o,n,s,r,a=arguments.length<=2||void 0===arguments[2]?this._getViaCoordinates():arguments[2],h=10,d=0,l=0,c=1,u=.2,f=this.to,p=!1;for(e.id===this.from.id&&(f=this.from,p=!0);c>=l&&h>d;){var v=.5*(l+c);if(i=this.getPoint(v,a),o=Math.atan2(f.y-i.y,f.x-i.x),n=f.distanceToBorder(t,o),s=Math.sqrt(Math.pow(i.x-f.x,2)+Math.pow(i.y-f.y,2)),r=n-s,Math.abs(r)<u)break;0>r?p===!1?l=v:c=v:p===!1?c=v:l=v,d++}return i.t=v,i}},{key:"_getDistanceToBezierEdge",value:function(e,t,i,o,n,s,r){var a=1e9,h=void 0,d=void 0,l=void 0,c=void 0,u=void 0,f=e,p=t;for(d=1;10>d;d++)l=.1*d,c=Math.pow(1-l,2)*e+2*l*(1-l)*r.x+Math.pow(l,2)*i,u=Math.pow(1-l,2)*t+2*l*(1-l)*r.y+Math.pow(l,2)*o,d>0&&(h=this._getDistanceToLine(f,p,c,u,n,s),a=a>h?h:a),f=c,p=u;return a}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){var i=[],o=!0,n=!1,s=void 0;try{for(var r,a=e[Symbol.iterator]();!(o=(r=a.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(h){n=!0,s=h}finally{try{!o&&a["return"]&&a["return"]()}finally{if(n)throw s}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),r=i(1),a=function(){function e(t,i,n){o(this,e),this.body=i,this.labelModule=n,this.options={},this.setOptions(t),this.colorDirty=!0,this.color={},this.selectionWidth=2,this.hoverWidth=1.5,this.fromPoint=this.from,this.toPoint=this.to}return s(e,[{key:"connect",value:function(){this.from=this.body.nodes[this.options.from],this.to=this.body.nodes[this.options.to]}},{key:"cleanup",value:function(){return!1}},{key:"setOptions",value:function(e){this.options=e,this.from=this.body.nodes[this.options.from],this.to=this.body.nodes[this.options.to],this.id=this.options.id}},{key:"drawLine",value:function(e,t,i,o){e.strokeStyle=this.getColor(e,t,i),e.lineWidth=this.getLineWidth(t,i),this.options.dashes!==!1?this._drawDashedLine(e,o):this._drawLine(e,o)}},{key:"_drawLine",value:function(e,t,i,o){if(this.from!=this.to)this._line(e,t,i,o);else{var s=this._getCircleData(e),r=n(s,3),a=r[0],h=r[1],d=r[2];this._circle(e,a,h,d)}}},{key:"_drawDashedLine",value:function(e,t,i,o){e.lineCap="round";var s=[5,5];if(Array.isArray(this.options.dashes)===!0&&(s=this.options.dashes),void 0!==e.setLineDash){if(e.save(),e.setLineDash(s),e.lineDashOffset=0,this.from!=this.to)this._line(e,t);else{var r=this._getCircleData(e),a=n(r,3),h=a[0],d=a[1],l=a[2];this._circle(e,h,d,l)}e.setLineDash([0]),e.lineDashOffset=0,e.restore()}else{if(this.from!=this.to)e.dashedLine(this.from.x,this.from.y,this.to.x,this.to.y,s);else{var c=this._getCircleData(e),u=n(c,3),f=u[0],p=u[1],v=u[2];this._circle(e,f,p,v)}this.enableShadow(e),e.stroke(),this.disableShadow(e)}}},{key:"findBorderPosition",value:function(e,t,i){return this.from!=this.to?this._findBorderPosition(e,t,i):this._findBorderPositionCircle(e,t,i)}},{key:"findBorderPositions",value:function(e){var t={},i={};if(this.from!=this.to)t=this._findBorderPosition(this.from,e),i=this._findBorderPosition(this.to,e);else{var o=this._getCircleData(e),s=n(o,3),r=s[0],a=s[1];s[2];t=this._findBorderPositionCircle(this.from,e,{x:r,y:a,low:.25,high:.6,direction:-1}),i=this._findBorderPositionCircle(this.from,e,{x:r,y:a,low:.6,high:.8,direction:1})}return{from:t,to:i}}},{key:"_getCircleData",value:function(e){var t=void 0,i=void 0,o=this.from,n=this.options.selfReferenceSize;return void 0!==e&&void 0===o.shape.width&&o.shape.resize(e),o.shape.width>o.shape.height?(t=o.x+.5*o.shape.width,i=o.y-n):(t=o.x+n,i=o.y-.5*o.shape.height),[t,i,n]}},{key:"_pointOnCircle",value:function(e,t,i,o){var n=2*o*Math.PI;return{x:e+i*Math.cos(n),y:t-i*Math.sin(n)}}},{key:"_findBorderPositionCircle",value:function(e,t,i){for(var o=i.x,n=i.y,s=i.low,r=i.high,a=i.direction,h=10,d=0,l=this.options.selfReferenceSize,c=void 0,u=void 0,f=void 0,p=void 0,v=void 0,y=.05,g=.5*(s+r);r>=s&&h>d&&(g=.5*(s+r),c=this._pointOnCircle(o,n,l,g),u=Math.atan2(e.y-c.y,e.x-c.x),f=e.distanceToBorder(t,u),p=Math.sqrt(Math.pow(c.x-e.x,2)+Math.pow(c.y-e.y,2)),v=f-p,!(Math.abs(v)<y));)v>0?a>0?s=g:r=g:a>0?r=g:s=g,d++;return c.t=g,c}},{key:"getLineWidth",value:function(e,t){return e===!0?Math.max(this.selectionWidth,.3/this.body.view.scale):t===!0?Math.max(this.hoverWidth,.3/this.body.view.scale):Math.max(this.options.width,.3/this.body.view.scale)}},{key:"getColor",value:function(e,t,i){var o=this.options.color;if(o.inherit!==!1){if("both"===o.inherit&&this.from.id!==this.to.id){var n=e.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y),s=void 0,a=void 0;return s=this.from.options.color.highlight.border,a=this.to.options.color.highlight.border,this.from.selected===!1&&this.to.selected===!1?(s=r.overrideOpacity(this.from.options.color.border,this.options.color.opacity),a=r.overrideOpacity(this.to.options.color.border,this.options.color.opacity)):this.from.selected===!0&&this.to.selected===!1?a=this.to.options.color.border:this.from.selected===!1&&this.to.selected===!0&&(s=this.from.options.color.border),n.addColorStop(0,s),n.addColorStop(1,a),n}this.colorDirty===!0&&("to"===o.inherit?(this.color.highlight=this.to.options.color.highlight.border,this.color.hover=this.to.options.color.hover.border,this.color.color=r.overrideOpacity(this.to.options.color.border,o.opacity)):(this.color.highlight=this.from.options.color.highlight.border,this.color.hover=this.from.options.color.hover.border,this.color.color=r.overrideOpacity(this.from.options.color.border,o.opacity)))}else this.colorDirty===!0&&(this.color.highlight=o.highlight,this.color.hover=o.hover,this.color.color=r.overrideOpacity(o.color,o.opacity));return this.colorDirty=!1,t===!0?this.color.highlight:i===!0?this.color.hover:this.color.color}},{key:"_circle",value:function(e,t,i,o){this.enableShadow(e),e.beginPath(),e.arc(t,i,o,0,2*Math.PI,!1),e.stroke(),this.disableShadow(e)}},{key:"getDistanceToEdge",value:function(e,t,i,o,s,r,a){var h=0;if(this.from!=this.to)h=this._getDistanceToEdge(e,t,i,o,s,r,a);else{var d=this._getCircleData(),l=n(d,3),c=l[0],u=l[1],f=l[2],p=c-s,v=u-r;h=Math.abs(Math.sqrt(p*p+v*v)-f)}return this.labelModule.size.left<s&&this.labelModule.size.left+this.labelModule.size.width>s&&this.labelModule.size.top<r&&this.labelModule.size.top+this.labelModule.size.height>r?0:h}},{key:"_getDistanceToLine",value:function(e,t,i,o,n,s){var r=i-e,a=o-t,h=r*r+a*a,d=((n-e)*r+(s-t)*a)/h;d>1?d=1:0>d&&(d=0);var l=e+d*r,c=t+d*a,u=l-n,f=c-s;return Math.sqrt(u*u+f*f)}},{key:"getArrowData",value:function(e,t,i,o,s){var r=void 0,a=void 0,h=void 0,d=void 0,l=void 0,c=void 0,u=this.getLineWidth(o,s);if("from"===t?(h=this.from,d=this.to,l=.1,c=this.options.arrows.from.scaleFactor):"to"===t?(h=this.to,d=this.from,l=-.1,c=this.options.arrows.to.scaleFactor):(h=this.to,d=this.from,c=this.options.arrows.middle.scaleFactor),h!=d)if("middle"!==t)if(this.options.smooth.enabled===!0){a=this.findBorderPosition(h,e,{via:i});var f=this.getPoint(Math.max(0,Math.min(1,a.t+l)),i);r=Math.atan2(a.y-f.y,a.x-f.x)}else r=Math.atan2(h.y-d.y,h.x-d.x),a=this.findBorderPosition(h,e);else r=Math.atan2(h.y-d.y,h.x-d.x),a=this.getPoint(.5,i);else{var p=this._getCircleData(e),v=n(p,3),y=v[0],g=v[1],b=v[2];"from"===t?(a=this.findBorderPosition(this.from,e,{x:y,y:g,low:.25,high:.6,direction:-1}),r=-2*a.t*Math.PI+1.5*Math.PI+.1*Math.PI):"to"===t?(a=this.findBorderPosition(this.from,e,{x:y,y:g,low:.6,high:1,direction:1}),r=-2*a.t*Math.PI+1.5*Math.PI-1.1*Math.PI):(a=this._pointOnCircle(y,g,b,.175),r=3.9269908169872414)}var m=15*c+3*u,_=a.x-.9*m*Math.cos(r),w=a.y-.9*m*Math.sin(r),k={x:_,y:w};return{point:a,core:k,angle:r,length:m}}},{key:"drawArrowHead",value:function(e,t,i,o){e.strokeStyle=this.getColor(e,t,i),e.fillStyle=e.strokeStyle,e.lineWidth=this.getLineWidth(t,i),e.arrow(o.point.x,o.point.y,o.angle,o.length),this.enableShadow(e),e.fill(),this.disableShadow(e)}},{key:"enableShadow",value:function(e){this.options.shadow.enabled===!0&&(e.shadowColor=this.options.shadow.color,e.shadowBlur=this.options.shadow.size,e.shadowOffsetX=this.options.shadow.x,e.shadowOffsetY=this.options.shadow.y)}},{key:"disableShadow",value:function(e){this.options.shadow.enabled===!0&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}}]),e}();t["default"]=a},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(39),d=o(h),l=function(e){function t(e,i,o){n(this,t);var r=s(this,Object.getPrototypeOf(t).call(this,e,i,o));return r._boundFunction=function(){r.positionBezierNode()},r.body.emitter.on("_repositionBezierNodes",r._boundFunction),r}return r(t,e),a(t,[{key:"setOptions",value:function(e){var t=!1;this.options.physics!==e.physics&&(t=!0),this.options=e,this.id=this.options.id,this.from=this.body.nodes[this.options.from],this.to=this.body.nodes[this.options.to],this.setupSupportNode(),this.connect(),t===!0&&(this.via.setOptions({physics:this.options.physics}),this.positionBezierNode())}},{key:"connect",value:function(){this.from=this.body.nodes[this.options.from],this.to=this.body.nodes[this.options.to],void 0===this.from||void 0===this.to||this.options.physics===!1?this.via.setOptions({physics:!1}):this.from.id===this.to.id?this.via.setOptions({physics:!1}):this.via.setOptions({physics:!0})}},{key:"cleanup",value:function(){return this.body.emitter.off("_repositionBezierNodes",this._boundFunction),void 0!==this.via?(delete this.body.nodes[this.via.id],this.via=void 0,!0):!1}},{key:"setupSupportNode",value:function(){if(void 0===this.via){var e="edgeId:"+this.id,t=this.body.functions.createNode({id:e,shape:"circle",physics:!0,hidden:!0});this.body.nodes[e]=t,this.via=t,this.via.parentEdgeId=this.id,this.positionBezierNode()}}},{key:"positionBezierNode",value:function(){void 0!==this.via&&void 0!==this.from&&void 0!==this.to?(this.via.x=.5*(this.from.x+this.to.x),this.via.y=.5*(this.from.y+this.to.y)):void 0!==this.via&&(this.via.x=0,this.via.y=0)}},{key:"_line",value:function(e,t){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),void 0===t.x?e.lineTo(this.toPoint.x,this.toPoint.y):e.quadraticCurveTo(t.x,t.y,this.toPoint.x,this.toPoint.y),this.enableShadow(e),e.stroke(),this.disableShadow(e)}},{key:"getViaNode",value:function(){return this.via}},{key:"getPoint",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?this.via:arguments[1],i=e,o=Math.pow(1-i,2)*this.fromPoint.x+2*i*(1-i)*t.x+Math.pow(i,2)*this.toPoint.x,n=Math.pow(1-i,2)*this.fromPoint.y+2*i*(1-i)*t.y+Math.pow(i,2)*this.toPoint.y;return{x:o,y:n}}},{key:"_findBorderPosition",value:function(e,t){return this._findBorderPositionBezier(e,t,this.via)}},{key:"_getDistanceToEdge",value:function(e,t,i,o,n,s){return this._getDistanceToBezierEdge(e,t,i,o,n,s,this.via)}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(39),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"_line",value:function(e,t){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),void 0===t.x?e.lineTo(this.toPoint.x,this.toPoint.y):e.quadraticCurveTo(t.x,t.y,this.toPoint.x,this.toPoint.y),this.enableShadow(e),e.stroke(),this.disableShadow(e)}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_getViaCoordinates",value:function(){var e=void 0,t=void 0,i=this.options.smooth.roundness,o=this.options.smooth.type,n=Math.abs(this.from.x-this.to.x),s=Math.abs(this.from.y-this.to.y);if("discrete"===o||"diagonalCross"===o)Math.abs(this.from.x-this.to.x)<=Math.abs(this.from.y-this.to.y)?(this.from.y>=this.to.y?this.from.x<=this.to.x?(e=this.from.x+i*s,t=this.from.y-i*s):this.from.x>this.to.x&&(e=this.from.x-i*s,t=this.from.y-i*s):this.from.y<this.to.y&&(this.from.x<=this.to.x?(e=this.from.x+i*s,t=this.from.y+i*s):this.from.x>this.to.x&&(e=this.from.x-i*s,t=this.from.y+i*s)),"discrete"===o&&(e=i*s>n?this.from.x:e)):Math.abs(this.from.x-this.to.x)>Math.abs(this.from.y-this.to.y)&&(this.from.y>=this.to.y?this.from.x<=this.to.x?(e=this.from.x+i*n,t=this.from.y-i*n):this.from.x>this.to.x&&(e=this.from.x-i*n,t=this.from.y-i*n):this.from.y<this.to.y&&(this.from.x<=this.to.x?(e=this.from.x+i*n,t=this.from.y+i*n):this.from.x>this.to.x&&(e=this.from.x-i*n,t=this.from.y+i*n)),"discrete"===o&&(t=i*n>s?this.from.y:t));else if("straightCross"===o)Math.abs(this.from.x-this.to.x)<=Math.abs(this.from.y-this.to.y)?(e=this.from.x,t=this.from.y<this.to.y?this.to.y-(1-i)*s:this.to.y+(1-i)*s):Math.abs(this.from.x-this.to.x)>Math.abs(this.from.y-this.to.y)&&(e=this.from.x<this.to.x?this.to.x-(1-i)*n:this.to.x+(1-i)*n,t=this.from.y);else if("horizontal"===o)e=this.from.x<this.to.x?this.to.x-(1-i)*n:this.to.x+(1-i)*n,t=this.from.y;else if("vertical"===o)e=this.from.x,t=this.from.y<this.to.y?this.to.y-(1-i)*s:this.to.y+(1-i)*s;else if("curvedCW"===o){n=this.to.x-this.from.x,s=this.from.y-this.to.y;var r=Math.sqrt(n*n+s*s),a=Math.PI,h=Math.atan2(s,n),d=(h+(.5*i+.5)*a)%(2*a);e=this.from.x+(.5*i+.5)*r*Math.sin(d),t=this.from.y+(.5*i+.5)*r*Math.cos(d)}else if("curvedCCW"===o){n=this.to.x-this.from.x,s=this.from.y-this.to.y;var l=Math.sqrt(n*n+s*s),c=Math.PI,u=Math.atan2(s,n),f=(u+(.5*-i+.5)*c)%(2*c);e=this.from.x+(.5*i+.5)*l*Math.sin(f),t=this.from.y+(.5*i+.5)*l*Math.cos(f)}else Math.abs(this.from.x-this.to.x)<=Math.abs(this.from.y-this.to.y)?this.from.y>=this.to.y?this.from.x<=this.to.x?(e=this.from.x+i*s,t=this.from.y-i*s,e=this.to.x<e?this.to.x:e):this.from.x>this.to.x&&(e=this.from.x-i*s,t=this.from.y-i*s,e=this.to.x>e?this.to.x:e):this.from.y<this.to.y&&(this.from.x<=this.to.x?(e=this.from.x+i*s,t=this.from.y+i*s,e=this.to.x<e?this.to.x:e):this.from.x>this.to.x&&(e=this.from.x-i*s,t=this.from.y+i*s,e=this.to.x>e?this.to.x:e)):Math.abs(this.from.x-this.to.x)>Math.abs(this.from.y-this.to.y)&&(this.from.y>=this.to.y?this.from.x<=this.to.x?(e=this.from.x+i*n,t=this.from.y-i*n,t=this.to.y>t?this.to.y:t):this.from.x>this.to.x&&(e=this.from.x-i*n,t=this.from.y-i*n,t=this.to.y>t?this.to.y:t):this.from.y<this.to.y&&(this.from.x<=this.to.x?(e=this.from.x+i*n,t=this.from.y+i*n,t=this.to.y<t?this.to.y:t):this.from.x>this.to.x&&(e=this.from.x-i*n,t=this.from.y+i*n,t=this.to.y<t?this.to.y:t)));return{x:e,y:t}}},{key:"_findBorderPosition",value:function(e,t){var i=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return this._findBorderPositionBezier(e,t,i.via)}},{key:"_getDistanceToEdge",value:function(e,t,i,o,n,s){var r=arguments.length<=6||void 0===arguments[6]?this._getViaCoordinates():arguments[6];return this._getDistanceToBezierEdge(e,t,i,o,n,s,r)}},{key:"getPoint",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?this._getViaCoordinates():arguments[1],i=e,o=Math.pow(1-i,2)*this.fromPoint.x+2*i*(1-i)*t.x+Math.pow(i,2)*this.toPoint.x,n=Math.pow(1-i,2)*this.fromPoint.y+2*i*(1-i)*t.y+Math.pow(i,2)*this.toPoint.y;return{x:o,y:n}}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(40),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"_line",value:function(e){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),e.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(e),e.stroke(),this.disableShadow(e)}},{key:"getViaNode",value:function(){}},{key:"getPoint",value:function(e){return{x:(1-e)*this.fromPoint.x+e*this.toPoint.x,y:(1-e)*this.fromPoint.y+e*this.toPoint.y}}},{key:"_findBorderPosition",value:function(e,t){var i=this.to,o=this.from;e.id===this.from.id&&(i=this.from,
-o=this.to);var n=Math.atan2(i.y-o.y,i.x-o.x),s=i.x-o.x,r=i.y-o.y,a=Math.sqrt(s*s+r*r),h=e.distanceToBorder(t,n),d=(a-h)/a,l={};return l.x=(1-d)*o.x+d*i.x,l.y=(1-d)*o.y+d*i.y,l}},{key:"_getDistanceToEdge",value:function(e,t,i,o,n,s){return this._getDistanceToLine(e,t,i,o,n,s)}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),r=i(45),a=o(r),h=i(46),d=o(h),l=i(47),c=o(l),u=i(48),f=o(u),p=i(49),v=o(p),y=i(50),g=o(y),b=i(51),m=o(b),_=i(52),w=o(_),k=i(1),x=function(){function e(t){n(this,e),this.body=t,this.physicsBody={physicsNodeIndices:[],physicsEdgeIndices:[],forces:{},velocities:{}},this.physicsEnabled=!0,this.simulationInterval=1e3/60,this.requiresTimeout=!0,this.previousStates={},this.referenceState={},this.freezeCache={},this.renderTimer=void 0,this.adaptiveTimestep=!1,this.adaptiveTimestepEnabled=!1,this.adaptiveCounter=0,this.adaptiveInterval=3,this.stabilized=!1,this.startedStabilization=!1,this.stabilizationIterations=0,this.ready=!1,this.options={},this.defaultOptions={enabled:!0,barnesHut:{theta:.5,gravitationalConstant:-2e3,centralGravity:.3,springLength:95,springConstant:.04,damping:.09,avoidOverlap:0},forceAtlas2Based:{theta:.5,gravitationalConstant:-50,centralGravity:.01,springConstant:.08,springLength:100,damping:.4,avoidOverlap:0},repulsion:{centralGravity:.2,springLength:200,springConstant:.05,nodeDistance:100,damping:.09,avoidOverlap:0},hierarchicalRepulsion:{centralGravity:0,springLength:100,springConstant:.01,nodeDistance:120,damping:.09},maxVelocity:50,minVelocity:.75,solver:"barnesHut",stabilization:{enabled:!0,iterations:1e3,updateInterval:50,onlyDynamicEdges:!1,fit:!0},timestep:.5,adaptiveTimestep:!0},k.extend(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}return s(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("initPhysics",function(){e.initPhysics()}),this.body.emitter.on("_layoutFailed",function(){e.layoutFailed=!0}),this.body.emitter.on("resetPhysics",function(){e.stopSimulation(),e.ready=!1}),this.body.emitter.on("disablePhysics",function(){e.physicsEnabled=!1,e.stopSimulation()}),this.body.emitter.on("restorePhysics",function(){e.setOptions(e.options),e.ready===!0&&e.startSimulation()}),this.body.emitter.on("startSimulation",function(){e.ready===!0&&e.startSimulation()}),this.body.emitter.on("stopSimulation",function(){e.stopSimulation()}),this.body.emitter.on("destroy",function(){e.stopSimulation(!1),e.body.emitter.off()}),this.body.emitter.on("_dataChanged",function(){e.updatePhysicsData()})}},{key:"setOptions",value:function(e){void 0!==e&&(e===!1?(this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation()):(this.physicsEnabled=!0,k.selectiveNotDeepExtend(["stabilization"],this.options,e),k.mergeOptions(this.options,e,"stabilization"),void 0===e.enabled&&(this.options.enabled=!0),this.options.enabled===!1&&(this.physicsEnabled=!1,this.stopSimulation()),this.timestep=this.options.timestep)),this.init()}},{key:"init",value:function(){var e;"forceAtlas2Based"===this.options.solver?(e=this.options.forceAtlas2Based,this.nodesSolver=new m["default"](this.body,this.physicsBody,e),this.edgesSolver=new f["default"](this.body,this.physicsBody,e),this.gravitySolver=new w["default"](this.body,this.physicsBody,e)):"repulsion"===this.options.solver?(e=this.options.repulsion,this.nodesSolver=new d["default"](this.body,this.physicsBody,e),this.edgesSolver=new f["default"](this.body,this.physicsBody,e),this.gravitySolver=new g["default"](this.body,this.physicsBody,e)):"hierarchicalRepulsion"===this.options.solver?(e=this.options.hierarchicalRepulsion,this.nodesSolver=new c["default"](this.body,this.physicsBody,e),this.edgesSolver=new v["default"](this.body,this.physicsBody,e),this.gravitySolver=new g["default"](this.body,this.physicsBody,e)):(e=this.options.barnesHut,this.nodesSolver=new a["default"](this.body,this.physicsBody,e),this.edgesSolver=new f["default"](this.body,this.physicsBody,e),this.gravitySolver=new g["default"](this.body,this.physicsBody,e)),this.modelOptions=e}},{key:"initPhysics",value:function(){this.physicsEnabled===!0&&this.options.enabled===!0?this.options.stabilization.enabled===!0?this.stabilize():(this.stabilized=!1,this.ready=!0,this.body.emitter.emit("fit",{},this.layoutFailed),this.startSimulation()):(this.ready=!0,this.body.emitter.emit("fit"))}},{key:"startSimulation",value:function(){this.physicsEnabled===!0&&this.options.enabled===!0?(this.stabilized=!1,this.adaptiveTimestep=!1,this.body.emitter.emit("_resizeNodes"),void 0===this.viewFunction&&(this.viewFunction=this.simulationStep.bind(this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering"))):this.body.emitter.emit("_redraw")}},{key:"stopSimulation",value:function(){var e=arguments.length<=0||void 0===arguments[0]?!0:arguments[0];this.stabilized=!0,e===!0&&this._emitStabilized(),void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.viewFunction=void 0,e===!0&&this.body.emitter.emit("_stopRendering"))}},{key:"simulationStep",value:function(){var e=Date.now();this.physicsTick();var t=Date.now()-e;(t<.4*this.simulationInterval||this.runDoubleSpeed===!0)&&this.stabilized===!1&&(this.physicsTick(),this.runDoubleSpeed=!0),this.stabilized===!0&&this.stopSimulation()}},{key:"_emitStabilized",value:function(){var e=this,t=arguments.length<=0||void 0===arguments[0]?this.stabilizationIterations:arguments[0];(this.stabilizationIterations>1||this.startedStabilization===!0)&&setTimeout(function(){e.body.emitter.emit("stabilized",{iterations:t}),e.startedStabilization=!1,e.stabilizationIterations=0},0)}},{key:"physicsTick",value:function(){if(this.startedStabilization===!1&&(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0),this.stabilized===!1){if(this.adaptiveTimestep===!0&&this.adaptiveTimestepEnabled===!0){var e=1.2;this.adaptiveCounter%this.adaptiveInterval===0?(this.timestep=2*this.timestep,this.calculateForces(),this.moveNodes(),this.revert(),this.timestep=.5*this.timestep,this.calculateForces(),this.moveNodes(),this.calculateForces(),this.moveNodes(),this._evaluateStepQuality()===!0?this.timestep=e*this.timestep:this.timestep/e<this.options.timestep?this.timestep=this.options.timestep:(this.adaptiveCounter=-1,this.timestep=Math.max(this.options.timestep,this.timestep/e))):(this.calculateForces(),this.moveNodes()),this.adaptiveCounter+=1}else this.timestep=this.options.timestep,this.calculateForces(),this.moveNodes();this.stabilized===!0&&this.revert(),this.stabilizationIterations++}}},{key:"updatePhysicsData",value:function(){this.physicsBody.forces={},this.physicsBody.physicsNodeIndices=[],this.physicsBody.physicsEdgeIndices=[];var e=this.body.nodes,t=this.body.edges;for(var i in e)e.hasOwnProperty(i)&&e[i].options.physics===!0&&this.physicsBody.physicsNodeIndices.push(e[i].id);for(var o in t)t.hasOwnProperty(o)&&t[o].options.physics===!0&&this.physicsBody.physicsEdgeIndices.push(t[o].id);for(var n=0;n<this.physicsBody.physicsNodeIndices.length;n++){var s=this.physicsBody.physicsNodeIndices[n];this.physicsBody.forces[s]={x:0,y:0},void 0===this.physicsBody.velocities[s]&&(this.physicsBody.velocities[s]={x:0,y:0})}for(var r in this.physicsBody.velocities)void 0===e[r]&&delete this.physicsBody.velocities[r]}},{key:"revert",value:function(){var e=Object.keys(this.previousStates),t=this.body.nodes,i=this.physicsBody.velocities;this.referenceState={};for(var o=0;o<e.length;o++){var n=e[o];void 0!==t[n]?t[n].options.physics===!0&&(this.referenceState[n]={positions:{x:t[n].x,y:t[n].y}},i[n].x=this.previousStates[n].vx,i[n].y=this.previousStates[n].vy,t[n].x=this.previousStates[n].x,t[n].y=this.previousStates[n].y):delete this.previousStates[n]}}},{key:"_evaluateStepQuality",value:function(){var e=void 0,t=void 0,i=void 0,o=this.body.nodes,n=this.referenceState,s=.3;for(var r in this.referenceState)if(this.referenceState.hasOwnProperty(r)&&void 0!==o[r]&&(e=o[r].x-n[r].positions.x,t=o[r].y-n[r].positions.y,i=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),i>s))return!1;return!0}},{key:"moveNodes",value:function(){for(var e=this.physicsBody.physicsNodeIndices,t=this.options.maxVelocity?this.options.maxVelocity:1e9,i=0,o=0,n=5,s=0;s<e.length;s++){var r=e[s],a=this._performStep(r,t);i=Math.max(i,a),o+=a}this.adaptiveTimestepEnabled=o/e.length<n,this.stabilized=i<this.options.minVelocity}},{key:"_performStep",value:function(e,t){var i=this.body.nodes[e],o=this.timestep,n=this.physicsBody.forces,s=this.physicsBody.velocities;if(this.previousStates[e]={x:i.x,y:i.y,vx:s[e].x,vy:s[e].y},i.options.fixed.x===!1){var r=this.modelOptions.damping*s[e].x,a=(n[e].x-r)/i.options.mass;s[e].x+=a*o,s[e].x=Math.abs(s[e].x)>t?s[e].x>0?t:-t:s[e].x,i.x+=s[e].x*o}else n[e].x=0,s[e].x=0;if(i.options.fixed.y===!1){var h=this.modelOptions.damping*s[e].y,d=(n[e].y-h)/i.options.mass;s[e].y+=d*o,s[e].y=Math.abs(s[e].y)>t?s[e].y>0?t:-t:s[e].y,i.y+=s[e].y*o}else n[e].y=0,s[e].y=0;var l=Math.sqrt(Math.pow(s[e].x,2)+Math.pow(s[e].y,2));return l}},{key:"calculateForces",value:function(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve()}},{key:"_freezeNodes",value:function(){var e=this.body.nodes;for(var t in e)e.hasOwnProperty(t)&&e[t].x&&e[t].y&&(this.freezeCache[t]={x:e[t].options.fixed.x,y:e[t].options.fixed.y},e[t].options.fixed.x=!0,e[t].options.fixed.y=!0)}},{key:"_restoreFrozenNodes",value:function(){var e=this.body.nodes;for(var t in e)e.hasOwnProperty(t)&&void 0!==this.freezeCache[t]&&(e[t].options.fixed.x=this.freezeCache[t].x,e[t].options.fixed.y=this.freezeCache[t].y);this.freezeCache={}}},{key:"stabilize",value:function(){var e=this,t=arguments.length<=0||void 0===arguments[0]?this.options.stabilization.iterations:arguments[0];return"number"!=typeof t&&(console.log("The stabilize method needs a numeric amount of iterations. Switching to default: ",this.options.stabilization.iterations),t=this.options.stabilization.iterations),0===this.physicsBody.physicsNodeIndices.length?void(this.ready=!0):(this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=t,this.options.stabilization.onlyDynamicEdges===!0&&this._freezeNodes(),this.stabilizationIterations=0,void setTimeout(function(){return e._stabilizationBatch()},0))}},{key:"_stabilizationBatch",value:function(){this.startedStabilization===!1&&(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0);for(var e=0;this.stabilized===!1&&e<this.options.stabilization.updateInterval&&this.stabilizationIterations<this.targetIterations;)this.physicsTick(),e++;this.stabilized===!1&&this.stabilizationIterations<this.targetIterations?(this.body.emitter.emit("stabilizationProgress",{iterations:this.stabilizationIterations,total:this.targetIterations}),setTimeout(this._stabilizationBatch.bind(this),0)):this._finalizeStabilization()}},{key:"_finalizeStabilization",value:function(){this.body.emitter.emit("_allowRedraw"),this.options.stabilization.fit===!0&&this.body.emitter.emit("fit"),this.options.stabilization.onlyDynamicEdges===!0&&this._restoreFrozenNodes(),this.body.emitter.emit("stabilizationIterationsDone"),this.body.emitter.emit("_requestRedraw"),this.stabilized===!0?this._emitStabilized():this.startSimulation(),this.ready=!0}},{key:"_drawForces",value:function(e){for(var t=0;t<this.physicsBody.physicsNodeIndices.length;t++){var i=this.body.nodes[this.physicsBody.physicsNodeIndices[t]],o=this.physicsBody.forces[this.physicsBody.physicsNodeIndices[t]],n=20,s=.03,r=Math.sqrt(Math.pow(o.x,2)+Math.pow(o.x,2)),a=Math.min(Math.max(5,r),15),h=3*a,d=k.HSVToHex((180-180*Math.min(1,Math.max(0,s*r)))/360,1,1);e.lineWidth=a,e.strokeStyle=d,e.beginPath(),e.moveTo(i.x,i.y),e.lineTo(i.x+n*o.x,i.y+n*o.y),e.stroke();var l=Math.atan2(o.y,o.x);e.fillStyle=d,e.arrow(i.x+n*o.x+Math.cos(l)*h,i.y+n*o.y+Math.sin(l)*h,l,h),e.fill()}}}]),e}();t["default"]=x},function(e,t){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),n=function(){function e(t,o,n){i(this,e),this.body=t,this.physicsBody=o,this.barnesHutTree,this.setOptions(n),this.randomSeed=5}return o(e,[{key:"setOptions",value:function(e){this.options=e,this.thetaInversed=1/this.options.theta,this.overlapAvoidanceFactor=1-Math.max(0,Math.min(1,this.options.avoidOverlap))}},{key:"seededRandom",value:function(){var e=1e4*Math.sin(this.randomSeed++);return e-Math.floor(e)}},{key:"solve",value:function(){if(0!==this.options.gravitationalConstant&&this.physicsBody.physicsNodeIndices.length>0){var e=void 0,t=this.body.nodes,i=this.physicsBody.physicsNodeIndices,o=i.length,n=this._formBarnesHutTree(t,i);this.barnesHutTree=n;for(var s=0;o>s;s++)e=t[i[s]],e.options.mass>0&&(this._getForceContribution(n.root.children.NW,e),this._getForceContribution(n.root.children.NE,e),this._getForceContribution(n.root.children.SW,e),this._getForceContribution(n.root.children.SE,e))}}},{key:"_getForceContribution",value:function(e,t){if(e.childrenCount>0){var i=void 0,o=void 0,n=void 0;i=e.centerOfMass.x-t.x,o=e.centerOfMass.y-t.y,n=Math.sqrt(i*i+o*o),n*e.calcSize>this.thetaInversed?this._calculateForces(n,i,o,t,e):4===e.childrenCount?(this._getForceContribution(e.children.NW,t),this._getForceContribution(e.children.NE,t),this._getForceContribution(e.children.SW,t),this._getForceContribution(e.children.SE,t)):e.children.data.id!=t.id&&this._calculateForces(n,i,o,t,e)}}},{key:"_calculateForces",value:function(e,t,i,o,n){0===e&&(e=.1,t=e),this.overlapAvoidanceFactor<1&&(e=Math.max(.1+this.overlapAvoidanceFactor*o.shape.radius,e-o.shape.radius));var s=this.options.gravitationalConstant*n.mass*o.options.mass/Math.pow(e,3),r=t*s,a=i*s;this.physicsBody.forces[o.id].x+=r,this.physicsBody.forces[o.id].y+=a}},{key:"_formBarnesHutTree",value:function(e,t){for(var i=void 0,o=t.length,n=e[t[0]].x,s=e[t[0]].y,r=e[t[0]].x,a=e[t[0]].y,h=1;o>h;h++){var d=e[t[h]].x,l=e[t[h]].y;e[t[h]].options.mass>0&&(n>d&&(n=d),d>r&&(r=d),s>l&&(s=l),l>a&&(a=l))}var c=Math.abs(r-n)-Math.abs(a-s);c>0?(s-=.5*c,a+=.5*c):(n+=.5*c,r-=.5*c);var u=1e-5,f=Math.max(u,Math.abs(r-n)),p=.5*f,v=.5*(n+r),y=.5*(s+a),g={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:v-p,maxX:v+p,minY:y-p,maxY:y+p},size:f,calcSize:1/f,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(g.root);for(var b=0;o>b;b++)i=e[t[b]],i.options.mass>0&&this._placeInTree(g.root,i);return g}},{key:"_updateBranchMass",value:function(e,t){var i=e.mass+t.options.mass,o=1/i;e.centerOfMass.x=e.centerOfMass.x*e.mass+t.x*t.options.mass,e.centerOfMass.x*=o,e.centerOfMass.y=e.centerOfMass.y*e.mass+t.y*t.options.mass,e.centerOfMass.y*=o,e.mass=i;var n=Math.max(Math.max(t.height,t.radius),t.width);e.maxWidth=e.maxWidth<n?n:e.maxWidth}},{key:"_placeInTree",value:function(e,t,i){1==i&&void 0!==i||this._updateBranchMass(e,t),e.children.NW.range.maxX>t.x?e.children.NW.range.maxY>t.y?this._placeInRegion(e,t,"NW"):this._placeInRegion(e,t,"SW"):e.children.NW.range.maxY>t.y?this._placeInRegion(e,t,"NE"):this._placeInRegion(e,t,"SE")}},{key:"_placeInRegion",value:function(e,t,i){switch(e.children[i].childrenCount){case 0:e.children[i].children.data=t,e.children[i].childrenCount=1,this._updateBranchMass(e.children[i],t);break;case 1:e.children[i].children.data.x===t.x&&e.children[i].children.data.y===t.y?(t.x+=this.seededRandom(),t.y+=this.seededRandom()):(this._splitBranch(e.children[i]),this._placeInTree(e.children[i],t));break;case 4:this._placeInTree(e.children[i],t)}}},{key:"_splitBranch",value:function(e){var t=null;1===e.childrenCount&&(t=e.children.data,e.mass=0,e.centerOfMass.x=0,e.centerOfMass.y=0),e.childrenCount=4,e.children.data=null,this._insertRegion(e,"NW"),this._insertRegion(e,"NE"),this._insertRegion(e,"SW"),this._insertRegion(e,"SE"),null!=t&&this._placeInTree(e,t)}},{key:"_insertRegion",value:function(e,t){var i=void 0,o=void 0,n=void 0,s=void 0,r=.5*e.size;switch(t){case"NW":i=e.range.minX,o=e.range.minX+r,n=e.range.minY,s=e.range.minY+r;break;case"NE":i=e.range.minX+r,o=e.range.maxX,n=e.range.minY,s=e.range.minY+r;break;case"SW":i=e.range.minX,o=e.range.minX+r,n=e.range.minY+r,s=e.range.maxY;break;case"SE":i=e.range.minX+r,o=e.range.maxX,n=e.range.minY+r,s=e.range.maxY}e.children[t]={centerOfMass:{x:0,y:0},mass:0,range:{minX:i,maxX:o,minY:n,maxY:s},size:.5*e.size,calcSize:2*e.calcSize,children:{data:null},maxWidth:0,level:e.level+1,childrenCount:0}}},{key:"_debug",value:function(e,t){void 0!==this.barnesHutTree&&(e.lineWidth=1,this._drawBranch(this.barnesHutTree.root,e,t))}},{key:"_drawBranch",value:function(e,t,i){void 0===i&&(i="#FF0000"),4===e.childrenCount&&(this._drawBranch(e.children.NW,t),this._drawBranch(e.children.NE,t),this._drawBranch(e.children.SE,t),this._drawBranch(e.children.SW,t)),t.strokeStyle=i,t.beginPath(),t.moveTo(e.range.minX,e.range.minY),t.lineTo(e.range.maxX,e.range.minY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.minY),t.lineTo(e.range.maxX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.maxY),t.lineTo(e.range.minX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.minX,e.range.maxY),t.lineTo(e.range.minX,e.range.minY),t.stroke()}}]),e}();t["default"]=n},function(e,t){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),n=function(){function e(t,o,n){i(this,e),this.body=t,this.physicsBody=o,this.setOptions(n)}return o(e,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e,t,i,o,n,s,r,a,h=this.body.nodes,d=this.physicsBody.physicsNodeIndices,l=this.physicsBody.forces,c=this.options.nodeDistance,u=-2/3/c,f=4/3,p=0;p<d.length-1;p++){r=h[d[p]];for(var v=p+1;v<d.length;v++)a=h[d[v]],e=a.x-r.x,t=a.y-r.y,i=Math.sqrt(e*e+t*t),0===i&&(i=.1*Math.random(),e=i),2*c>i&&(s=.5*c>i?1:u*i+f,s/=i,o=e*s,n=t*s,l[r.id].x-=o,l[r.id].y-=n,l[a.id].x+=o,l[a.id].y+=n)}}}]),e}();t["default"]=n},function(e,t){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),n=function(){function e(t,o,n){i(this,e),this.body=t,this.physicsBody=o,this.setOptions(n)}return o(e,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){var e,t,i,o,n,s,r,a,h,d,l=this.body.nodes,c=this.physicsBody.physicsNodeIndices,u=this.physicsBody.forces,f=this.options.nodeDistance;for(h=0;h<c.length-1;h++)for(r=l[c[h]],d=h+1;d<c.length;d++)if(a=l[c[d]],r.level===a.level){e=a.x-r.x,t=a.y-r.y,i=Math.sqrt(e*e+t*t);var p=.05;s=f>i?-Math.pow(p*i,2)+Math.pow(p*f,2):0,0===i?i=.01:s/=i,o=e*s,n=t*s,u[r.id].x-=o,u[r.id].y-=n,u[a.id].x+=o,u[a.id].y+=n}}}]),e}();t["default"]=n},function(e,t){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),n=function(){function e(t,o,n){i(this,e),this.body=t,this.physicsBody=o,this.setOptions(n)}return o(e,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e=void 0,t=void 0,i=this.physicsBody.physicsEdgeIndices,o=this.body.edges,n=void 0,s=void 0,r=void 0,a=0;a<i.length;a++)t=o[i[a]],t.connected===!0&&t.toId!==t.fromId&&void 0!==this.body.nodes[t.toId]&&void 0!==this.body.nodes[t.fromId]&&(void 0!==t.edgeType.via?(e=void 0===t.options.length?this.options.springLength:t.options.length,n=t.to,s=t.edgeType.via,r=t.from,this._calculateSpringForce(n,s,.5*e),this._calculateSpringForce(s,r,.5*e)):(e=void 0===t.options.length?1.5*this.options.springLength:t.options.length,this._calculateSpringForce(t.from,t.to,e)))}},{key:"_calculateSpringForce",value:function(e,t,i){var o=e.x-t.x,n=e.y-t.y,s=Math.max(Math.sqrt(o*o+n*n),.01),r=this.options.springConstant*(i-s)/s,a=o*r,h=n*r;void 0!==this.physicsBody.forces[e.id]&&(this.physicsBody.forces[e.id].x+=a,this.physicsBody.forces[e.id].y+=h),void 0!==this.physicsBody.forces[t.id]&&(this.physicsBody.forces[t.id].x-=a,this.physicsBody.forces[t.id].y-=h)}}]),e}();t["default"]=n},function(e,t){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),n=function(){function e(t,o,n){i(this,e),this.body=t,this.physicsBody=o,this.setOptions(n)}return o(e,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e,t,i,o,n,s,r,a,h=this.body.edges,d=.5,l=this.physicsBody.physicsEdgeIndices,c=this.physicsBody.physicsNodeIndices,u=this.physicsBody.forces,f=0;f<c.length;f++){var p=c[f];u[p].springFx=0,u[p].springFy=0}for(var v=0;v<l.length;v++)t=h[l[v]],t.connected===!0&&(e=void 0===t.options.length?this.options.springLength:t.options.length,i=t.from.x-t.to.x,o=t.from.y-t.to.y,a=Math.sqrt(i*i+o*o),a=0===a?.01:a,r=this.options.springConstant*(e-a)/a,n=i*r,s=o*r,t.to.level!=t.from.level?(void 0!==u[t.toId]&&(u[t.toId].springFx-=n,u[t.toId].springFy-=s),void 0!==u[t.fromId]&&(u[t.fromId].springFx+=n,u[t.fromId].springFy+=s)):(void 0!==u[t.toId]&&(u[t.toId].x-=d*n,u[t.toId].y-=d*s),void 0!==u[t.fromId]&&(u[t.fromId].x+=d*n,u[t.fromId].y+=d*s)));for(var y,g,r=1,b=0;b<c.length;b++){var m=c[b];y=Math.min(r,Math.max(-r,u[m].springFx)),g=Math.min(r,Math.max(-r,u[m].springFy)),u[m].x+=y,u[m].y+=g}for(var _=0,w=0,k=0;k<c.length;k++){var x=c[k];_+=u[x].x,w+=u[x].y}for(var O=_/c.length,E=w/c.length,M=0;M<c.length;M++){var D=c[M];u[D].x-=O,u[D].y-=E}}}]),e}();t["default"]=n},function(e,t){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),n=function(){function e(t,o,n){i(this,e),this.body=t,this.physicsBody=o,this.setOptions(n)}return o(e,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e=void 0,t=void 0,i=void 0,o=void 0,n=this.body.nodes,s=this.physicsBody.physicsNodeIndices,r=this.physicsBody.forces,a=0;a<s.length;a++){var h=s[a];o=n[h],e=-o.x,t=-o.y,i=Math.sqrt(e*e+t*t),this._calculateForces(i,e,t,r,o)}}},{key:"_calculateForces",value:function(e,t,i,o,n){var s=0===e?0:this.options.centralGravity/e;o[n.id].x=t*s,o[n.id].y=i*s}}]),e}();t["default"]=n},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(45),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"_calculateForces",value:function(e,t,i,o,n){0===e&&(e=.1*Math.random(),t=e),this.overlapAvoidanceFactor<1&&(e=Math.max(.1+this.overlapAvoidanceFactor*o.shape.radius,e-o.shape.radius));var s=o.edges.length+1,r=this.options.gravitationalConstant*n.mass*o.options.mass*s/Math.pow(e,2),a=t*r,h=i*r;this.physicsBody.forces[o.id].x+=a,this.physicsBody.forces[o.id].y+=h}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(50),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"_calculateForces",value:function(e,t,i,o,n){if(e>0){var s=n.edges.length+1,r=this.options.centralGravity*s*n.options.mass;o[n.id].x=t*r,o[n.id].y=i*r}}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},r=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),a=i(54),h=o(a),d=i(55),l=o(d),c=i(1),u=function(){function e(t){var i=this;n(this,e),this.body=t,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},c.extend(this.options,this.defaultOptions),this.body.emitter.on("_resetData",function(){i.clusteredNodes={},i.clusteredEdges={}})}return r(e,[{key:"setOptions",value:function(e){}},{key:"clusterByHubsize",value:function(e,t){void 0===e?e=this._getHubSize():"object"===("undefined"==typeof e?"undefined":s(e))&&(t=this._checkOptions(e),e=this._getHubSize());for(var i=[],o=0;o<this.body.nodeIndices.length;o++){var n=this.body.nodes[this.body.nodeIndices[o]];n.edges.length>=e&&i.push(n.id)}for(var r=0;r<i.length;r++)this.clusterByConnection(i[r],t,!0);this.body.emitter.emit("_dataChanged")}},{key:"cluster",value:function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=arguments.length<=1||void 0===arguments[1]?!0:arguments[1];if(void 0===e.joinCondition)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");e=this._checkOptions(e);for(var i={},o={},n=0;n<this.body.nodeIndices.length;n++){var s=this.body.nodeIndices[n],r=this.body.nodes[s],a=h["default"].cloneOptions(r);if(e.joinCondition(a)===!0){i[s]=this.body.nodes[s];for(var d=0;d<r.edges.length;d++){var l=r.edges[d];void 0===this.clusteredEdges[l.id]&&(o[l.id]=l)}}}this._cluster(i,o,e,t)}},{key:"clusterByEdgeCount",value:function(e,t){var i=arguments.length<=2||void 0===arguments[2]?!0:arguments[2];t=this._checkOptions(t);for(var o=[],n={},s=void 0,r=void 0,a=void 0,d=void 0,l=void 0,c=0;c<this.body.nodeIndices.length;c++){var u={},f={};if(d=this.body.nodeIndices[c],void 0===n[d]){l=0,a=this.body.nodes[d],r=[];for(var p=0;p<a.edges.length;p++)s=a.edges[p],void 0===this.clusteredEdges[s.id]&&(s.toId!==s.fromId&&l++,r.push(s));if(l===e){for(var v=!0,y=0;y<r.length;y++){s=r[y];var g=this._getConnectedId(s,d);if(void 0===t.joinCondition)f[s.id]=s,u[d]=this.body.nodes[d],u[g]=this.body.nodes[g],n[d]=!0;else{var b=h["default"].cloneOptions(this.body.nodes[d]);if(t.joinCondition(b)!==!0){v=!1;break}f[s.id]=s,u[d]=this.body.nodes[d],n[d]=!0}}Object.keys(u).length>0&&Object.keys(f).length>0&&v===!0&&o.push({nodes:u,edges:f})}}}for(var m=0;m<o.length;m++)this._cluster(o[m].nodes,o[m].edges,t,!1);i===!0&&this.body.emitter.emit("_dataChanged")}},{key:"clusterOutliers",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?!0:arguments[1];this.clusterByEdgeCount(1,e,t)}},{key:"clusterBridges",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?!0:arguments[1];this.clusterByEdgeCount(2,e,t)}},{key:"clusterByConnection",value:function(e,t){var i=arguments.length<=2||void 0===arguments[2]?!0:arguments[2];if(void 0===e)throw new Error("No nodeId supplied to clusterByConnection!");if(void 0===this.body.nodes[e])throw new Error("The nodeId given to clusterByConnection does not exist!");var o=this.body.nodes[e];t=this._checkOptions(t,o),void 0===t.clusterNodeProperties.x&&(t.clusterNodeProperties.x=o.x),void 0===t.clusterNodeProperties.y&&(t.clusterNodeProperties.y=o.y),void 0===t.clusterNodeProperties.fixed&&(t.clusterNodeProperties.fixed={},t.clusterNodeProperties.fixed.x=o.options.fixed.x,t.clusterNodeProperties.fixed.y=o.options.fixed.y);var n={},s={},r=o.id,a=h["default"].cloneOptions(o);n[r]=o;for(var d=0;d<o.edges.length;d++){var l=o.edges[d];if(void 0===this.clusteredEdges[l.id]){var c=this._getConnectedId(l,r);if(void 0===this.clusteredNodes[c])if(c!==r)if(void 0===t.joinCondition)s[l.id]=l,n[c]=this.body.nodes[c];else{var u=h["default"].cloneOptions(this.body.nodes[c]);t.joinCondition(a,u)===!0&&(s[l.id]=l,n[c]=this.body.nodes[c])}else s[l.id]=l}}this._cluster(n,s,t,i)}},{key:"_createClusterEdges",value:function(e,t,i,o){for(var n=void 0,s=void 0,r=void 0,a=void 0,d=void 0,l=void 0,u=Object.keys(e),f=[],p=0;p<u.length;p++){s=u[p],r=e[s];for(var v=0;v<r.edges.length;v++)n=r.edges[v],void 0===this.clusteredEdges[n.id]&&(n.toId==n.fromId?t[n.id]=n:n.toId==s?(a=i.id,d=n.fromId,l=d):(a=n.toId,d=i.id,l=a),void 0===e[l]&&f.push({edge:n,fromId:d,toId:a}))}for(var y=0;y<f.length;y++){var g=f[y].edge,b=h["default"].cloneOptions(g,"edge");c.deepExtend(b,o),b.from=f[y].fromId,b.to=f[y].toId,b.id="clusterEdge:"+c.randomUUID();var m=this.body.functions.createEdge(b);
-m.clusteringEdgeReplacingId=g.id,this.body.edges[m.id]=m,m.connect(),this._backupEdgeOptions(g),g.setOptions({physics:!1,hidden:!0})}}},{key:"_checkOptions",value:function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return void 0===e.clusterEdgeProperties&&(e.clusterEdgeProperties={}),void 0===e.clusterNodeProperties&&(e.clusterNodeProperties={}),e}},{key:"_cluster",value:function(e,t,i){var o=arguments.length<=3||void 0===arguments[3]?!0:arguments[3];if(!(Object.keys(e).length<2)){for(var n in e)if(e.hasOwnProperty(n)&&void 0!==this.clusteredNodes[n])return;var s=c.deepExtend({},i.clusterNodeProperties);if(void 0!==i.processProperties){var r=[];for(var a in e)if(e.hasOwnProperty(a)){var d=h["default"].cloneOptions(e[a]);r.push(d)}var u=[];for(var f in t)if(t.hasOwnProperty(f)&&"clusterEdge:"!==f.substr(0,12)){var p=h["default"].cloneOptions(t[f],"edge");u.push(p)}if(s=i.processProperties(s,r,u),!s)throw new Error("The processProperties function does not return properties!")}void 0===s.id&&(s.id="cluster:"+c.randomUUID());var v=s.id;void 0===s.label&&(s.label="cluster");var y=void 0;void 0===s.x&&(y=this._getClusterPosition(e),s.x=y.x),void 0===s.y&&(void 0===y&&(y=this._getClusterPosition(e)),s.y=y.y),s.id=v;var g=this.body.functions.createNode(s,l["default"]);g.isCluster=!0,g.containedNodes=e,g.containedEdges=t,g.clusterEdgeProperties=i.clusterEdgeProperties,this.body.nodes[s.id]=g,this._createClusterEdges(e,t,s,i.clusterEdgeProperties);for(var b in t)if(t.hasOwnProperty(b)&&void 0!==this.body.edges[b]){var m=this.body.edges[b];this._backupEdgeOptions(m),m.setOptions({physics:!1,hidden:!0})}for(var _ in e)e.hasOwnProperty(_)&&(this.clusteredNodes[_]={clusterId:s.id,node:this.body.nodes[_]},this.body.nodes[_].setOptions({hidden:!0,physics:!1}));s.id=void 0,o===!0&&this.body.emitter.emit("_dataChanged")}}},{key:"_backupEdgeOptions",value:function(e){void 0===this.clusteredEdges[e.id]&&(this.clusteredEdges[e.id]={physics:e.options.physics,hidden:e.options.hidden})}},{key:"_restoreEdge",value:function(e){var t=this.clusteredEdges[e.id];void 0!==t&&(e.setOptions({physics:t.physics,hidden:t.hidden}),delete this.clusteredEdges[e.id])}},{key:"isCluster",value:function(e){return void 0!==this.body.nodes[e]?this.body.nodes[e].isCluster===!0:(console.log("Node does not exist."),!1)}},{key:"_getClusterPosition",value:function(e){for(var t=Object.keys(e),i=e[t[0]].x,o=e[t[0]].x,n=e[t[0]].y,s=e[t[0]].y,r=void 0,a=1;a<t.length;a++)r=e[t[a]],i=r.x<i?r.x:i,o=r.x>o?r.x:o,n=r.y<n?r.y:n,s=r.y>s?r.y:s;return{x:.5*(i+o),y:.5*(n+s)}}},{key:"openCluster",value:function(e,t){var i=arguments.length<=2||void 0===arguments[2]?!0:arguments[2];if(void 0===e)throw new Error("No clusterNodeId supplied to openCluster.");if(void 0===this.body.nodes[e])throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(void 0===this.body.nodes[e].containedNodes)return void console.log("The node:"+e+" is not a cluster.");var o=this.body.nodes[e],n=o.containedNodes,s=o.containedEdges;if(void 0!==t&&void 0!==t.releaseFunction&&"function"==typeof t.releaseFunction){var r={},a={x:o.x,y:o.y};for(var d in n)if(n.hasOwnProperty(d)){var l=this.body.nodes[d];r[d]={x:l.x,y:l.y}}var u=t.releaseFunction(a,r);for(var f in n)if(n.hasOwnProperty(f)){var p=this.body.nodes[f];void 0!==u[f]&&(p.x=void 0===u[f].x?o.x:u[f].x,p.y=void 0===u[f].y?o.y:u[f].y)}}else for(var v in n)if(n.hasOwnProperty(v)){var y=this.body.nodes[v];y=n[v],y.options.fixed.x===!1&&(y.x=o.x),y.options.fixed.y===!1&&(y.y=o.y)}for(var g in n)if(n.hasOwnProperty(g)){var b=this.body.nodes[g];b.vx=o.vx,b.vy=o.vy,b.setOptions({hidden:!1,physics:!0}),delete this.clusteredNodes[g]}for(var m=[],_=0;_<o.edges.length;_++)m.push(o.edges[_]);for(var w=0;w<m.length;w++){var k=m[w],x=this._getConnectedId(k,e);if(void 0!==this.clusteredNodes[x]){var O=this.body.nodes[this.clusteredNodes[x].clusterId],E=this.body.edges[k.clusteringEdgeReplacingId];if(void 0!==E){O.containedEdges[E.id]=E,delete s[E.id];var M=E.fromId,D=E.toId;E.toId==x?D=this.clusteredNodes[x].clusterId:M=this.clusteredNodes[x].clusterId;var S=h["default"].cloneOptions(E,"edge");c.deepExtend(S,O.clusterEdgeProperties);var C="clusterEdge:"+c.randomUUID();c.deepExtend(S,{from:M,to:D,hidden:!1,physics:!0,id:C});var T=this.body.functions.createEdge(S);T.clusteringEdgeReplacingId=E.id,this.body.edges[C]=T,this.body.edges[C].connect()}}else{var P=this.body.edges[k.clusteringEdgeReplacingId];void 0!==P&&this._restoreEdge(P)}k.cleanup(),k.disconnect(),delete this.body.edges[k.id]}for(var B in s)s.hasOwnProperty(B)&&this._restoreEdge(s[B]);delete this.body.nodes[e],i===!0&&this.body.emitter.emit("_dataChanged")}},{key:"getNodesInCluster",value:function(e){var t=[];if(this.isCluster(e)===!0){var i=this.body.nodes[e].containedNodes;for(var o in i)i.hasOwnProperty(o)&&t.push(this.body.nodes[o].id)}return t}},{key:"findNode",value:function(e){for(var t=[],i=100,o=0;void 0!==this.clusteredNodes[e]&&i>o;)t.push(this.body.nodes[e].id),e=this.clusteredNodes[e].clusterId,o++;return t.push(this.body.nodes[e].id),t.reverse(),t}},{key:"_getConnectedId",value:function(e,t){return e.toId!=t?e.toId:e.fromId!=t?e.fromId:e.fromId}},{key:"_getHubSize",value:function(){for(var e=0,t=0,i=0,o=0,n=0;n<this.body.nodeIndices.length;n++){var s=this.body.nodes[this.body.nodeIndices[n]];s.edges.length>o&&(o=s.edges.length),e+=s.edges.length,t+=Math.pow(s.edges.length,2),i+=1}e/=i,t/=i;var r=t-Math.pow(e,2),a=Math.sqrt(r),h=Math.floor(e+2*a);return h>o&&(h=o),h}}]),e}();t["default"]=u},function(e,t,i){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),s=i(1),r=function(){function e(){o(this,e)}return n(e,null,[{key:"getRange",value:function(e){var t,i=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],o=1e9,n=-1e9,s=1e9,r=-1e9;if(i.length>0)for(var a=0;a<i.length;a++)t=e[i[a]],s>t.shape.boundingBox.left&&(s=t.shape.boundingBox.left),r<t.shape.boundingBox.right&&(r=t.shape.boundingBox.right),o>t.shape.boundingBox.top&&(o=t.shape.boundingBox.top),n<t.shape.boundingBox.bottom&&(n=t.shape.boundingBox.bottom);return 1e9===s&&-1e9===r&&1e9===o&&-1e9===n&&(o=0,n=0,s=0,r=0),{minX:s,maxX:r,minY:o,maxY:n}}},{key:"getRangeCore",value:function(e){var t,i=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],o=1e9,n=-1e9,s=1e9,r=-1e9;if(i.length>0)for(var a=0;a<i.length;a++)t=e[i[a]],s>t.x&&(s=t.x),r<t.x&&(r=t.x),o>t.y&&(o=t.y),n<t.y&&(n=t.y);return 1e9===s&&-1e9===r&&1e9===o&&-1e9===n&&(o=0,n=0,s=0,r=0),{minX:s,maxX:r,minY:o,maxY:n}}},{key:"findCenter",value:function(e){return{x:.5*(e.maxX+e.minX),y:.5*(e.maxY+e.minY)}}},{key:"cloneOptions",value:function(e,t){var i={};return void 0===t||"node"===t?(s.deepExtend(i,e.options,!0),i.x=e.x,i.y=e.y,i.amountOfConnections=e.edges.length):s.deepExtend(i,e.options,!0),i}}]),e}();t["default"]=r},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=i(15),h=o(a),d=function(e){function t(e,i,o,r,a){n(this,t);var h=s(this,Object.getPrototypeOf(t).call(this,e,i,o,r,a));return h.isCluster=!0,h.containedNodes={},h.containedEdges={},h}return r(t,e),t}(h["default"]);t["default"]=d},function(e,t,i){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}();"undefined"!=typeof window&&(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame);var s=i(1),r=function(){function e(t,i){o(this,e),this.body=t,this.canvas=i,this.redrawRequested=!1,this.renderTimer=void 0,this.requiresTimeout=!0,this.renderingActive=!1,this.renderRequests=0,this.pixelRatio=void 0,this.allowRedraw=!0,this.dragging=!1,this.options={},this.defaultOptions={hideEdgesOnDrag:!1,hideNodesOnDrag:!1},s.extend(this.options,this.defaultOptions),this._determineBrowserMethod(),this.bindEventListeners()}return n(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("dragStart",function(){e.dragging=!0}),this.body.emitter.on("dragEnd",function(){return e.dragging=!1}),this.body.emitter.on("_resizeNodes",function(){return e._resizeNodes()}),this.body.emitter.on("_redraw",function(){e.renderingActive===!1&&e._redraw()}),this.body.emitter.on("_blockRedraw",function(){e.allowRedraw=!1}),this.body.emitter.on("_allowRedraw",function(){e.allowRedraw=!0,e.redrawRequested=!1}),this.body.emitter.on("_requestRedraw",this._requestRedraw.bind(this)),this.body.emitter.on("_startRendering",function(){e.renderRequests+=1,e.renderingActive=!0,e._startRendering()}),this.body.emitter.on("_stopRendering",function(){e.renderRequests-=1,e.renderingActive=e.renderRequests>0,e.renderTimer=void 0}),this.body.emitter.on("destroy",function(){e.renderRequests=0,e.allowRedraw=!1,e.renderingActive=!1,e.requiresTimeout===!0?clearTimeout(e.renderTimer):cancelAnimationFrame(e.renderTimer),e.body.emitter.off()})}},{key:"setOptions",value:function(e){if(void 0!==e){var t=["hideEdgesOnDrag","hideNodesOnDrag"];s.selectiveDeepExtend(t,this.options,e)}}},{key:"_startRendering",value:function(){this.renderingActive===!0&&void 0===this.renderTimer&&(this.requiresTimeout===!0?this.renderTimer=window.setTimeout(this._renderStep.bind(this),this.simulationInterval):this.renderTimer=window.requestAnimationFrame(this._renderStep.bind(this)))}},{key:"_renderStep",value:function(){this.renderingActive===!0&&(this.renderTimer=void 0,this.requiresTimeout===!0&&this._startRendering(),this._redraw(),this.requiresTimeout===!1&&this._startRendering())}},{key:"redraw",value:function(){this.body.emitter.emit("setSize"),this._redraw()}},{key:"_requestRedraw",value:function(){var e=this;this.redrawRequested!==!0&&this.renderingActive===!1&&this.allowRedraw===!0&&(this.redrawRequested=!0,this.requiresTimeout===!0?window.setTimeout(function(){e._redraw(!1)},0):window.requestAnimationFrame(function(){e._redraw(!1)}))}},{key:"_redraw",value:function(){var e=arguments.length<=0||void 0===arguments[0]?!1:arguments[0];if(this.allowRedraw===!0){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1;var t=this.canvas.frame.canvas.getContext("2d");0!==this.canvas.frame.canvas.width&&0!==this.canvas.frame.canvas.height||this.canvas.setSize(),this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1),t.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var i=this.canvas.frame.canvas.clientWidth,o=this.canvas.frame.canvas.clientHeight;if(t.clearRect(0,0,i,o),0===this.canvas.frame.clientWidth)return;t.save(),t.translate(this.body.view.translation.x,this.body.view.translation.y),t.scale(this.body.view.scale,this.body.view.scale),t.beginPath(),this.body.emitter.emit("beforeDrawing",t),t.closePath(),e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&this._drawEdges(t),(this.dragging===!1||this.dragging===!0&&this.options.hideNodesOnDrag===!1)&&this._drawNodes(t,e),t.beginPath(),this.body.emitter.emit("afterDrawing",t),t.closePath(),t.restore(),e===!0&&t.clearRect(0,0,i,o)}}},{key:"_resizeNodes",value:function(){var e=this.canvas.frame.canvas.getContext("2d");void 0===this.pixelRatio&&(this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)),e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0),e.save(),e.translate(this.body.view.translation.x,this.body.view.translation.y),e.scale(this.body.view.scale,this.body.view.scale);var t=this.body.nodes,i=void 0;for(var o in t)t.hasOwnProperty(o)&&(i=t[o],i.resize(e),i.updateBoundingBox(e,i.selected));e.restore()}},{key:"_drawNodes",value:function(e){for(var t=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],i=this.body.nodes,o=this.body.nodeIndices,n=void 0,s=[],r=20,a=this.canvas.DOMtoCanvas({x:-r,y:-r}),h=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+r,y:this.canvas.frame.canvas.clientHeight+r}),d={top:a.y,left:a.x,bottom:h.y,right:h.x},l=0;l<o.length;l++)n=i[o[l]],n.isSelected()?s.push(o[l]):t===!0?n.draw(e):n.isBoundingBoxOverlappingWith(d)===!0?n.draw(e):n.updateBoundingBox(e,n.selected);for(var c=0;c<s.length;c++)n=i[s[c]],n.draw(e)}},{key:"_drawEdges",value:function(e){for(var t=this.body.edges,i=this.body.edgeIndices,o=void 0,n=0;n<i.length;n++)o=t[i[n]],o.connected===!0&&o.draw(e)}},{key:"_determineBrowserMethod",value:function(){if("undefined"!=typeof window){var e=navigator.userAgent.toLowerCase();this.requiresTimeout=!1,-1!=e.indexOf("msie 9.0")?this.requiresTimeout=!0:-1!=e.indexOf("safari")&&e.indexOf("chrome")<=-1&&(this.requiresTimeout=!0)}else this.requiresTimeout=!0}}]),e}();t["default"]=r},function(e,t,i){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),s=i(58),r=i(61),a=i(1),h=function(){function e(t){o(this,e),this.body=t,this.pixelRatio=1,this.resizeTimer=void 0,this.resizeFunction=this._onResize.bind(this),this.cameraState={},this.initialized=!1,this.options={},this.defaultOptions={autoResize:!0,height:"100%",width:"100%"},a.extend(this.options,this.defaultOptions),this.bindEventListeners()}return n(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.once("resize",function(t){0!==t.width&&(e.body.view.translation.x=.5*t.width),0!==t.height&&(e.body.view.translation.y=.5*t.height)}),this.body.emitter.on("setSize",this.setSize.bind(this)),this.body.emitter.on("destroy",function(){e.hammerFrame.destroy(),e.hammer.destroy(),e._cleanUp()})}},{key:"setOptions",value:function(e){var t=this;if(void 0!==e){var i=["width","height","autoResize"];a.selectiveDeepExtend(i,this.options,e)}this.options.autoResize===!0&&(this._cleanUp(),this.resizeTimer=setInterval(function(){var e=t.setSize();e===!0&&t.body.emitter.emit("_requestRedraw")},1e3),this.resizeFunction=this._onResize.bind(this),a.addEventListener(window,"resize",this.resizeFunction))}},{key:"_cleanUp",value:function(){void 0!==this.resizeTimer&&clearInterval(this.resizeTimer),a.removeEventListener(window,"resize",this.resizeFunction),this.resizeFunction=void 0}},{key:"_onResize",value:function(){this.setSize(),this.body.emitter.emit("_redraw")}},{key:"_getCameraState",value:function(){var e=arguments.length<=0||void 0===arguments[0]?this.pixelRatio:arguments[0];this.initialized===!0&&(this.cameraState.previousWidth=this.frame.canvas.width/e,this.cameraState.previousHeight=this.frame.canvas.height/e,this.cameraState.scale=this.body.view.scale,this.cameraState.position=this.DOMtoCanvas({x:.5*this.frame.canvas.width/e,y:.5*this.frame.canvas.height/e}))}},{key:"_setCameraState",value:function(){if(void 0!==this.cameraState.scale&&0!==this.frame.canvas.clientWidth&&0!==this.frame.canvas.clientHeight&&0!==this.pixelRatio&&this.cameraState.previousWidth>0){var e=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,t=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight,i=this.cameraState.scale;1!=e&&1!=t?i=.5*this.cameraState.scale*(e+t):1!=e?i=this.cameraState.scale*e:1!=t&&(i=this.cameraState.scale*t),this.body.view.scale=i;var o=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),n={x:o.x-this.cameraState.position.x,y:o.y-this.cameraState.position.y};this.body.view.translation.x+=n.x*this.body.view.scale,this.body.view.translation.y+=n.y*this.body.view.scale}}},{key:"_prepareValue",value:function(e){if("number"==typeof e)return e+"px";if("string"==typeof e){if(-1!==e.indexOf("%")||-1!==e.indexOf("px"))return e;if(-1===e.indexOf("%"))return e+"px"}throw new Error("Could not use the value supplied for width or height:"+e)}},{key:"_create",value:function(){for(;this.body.container.hasChildNodes();)this.body.container.removeChild(this.body.container.firstChild);if(this.frame=document.createElement("div"),this.frame.className="vis-network",this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.tabIndex=900,this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas),this.frame.canvas.getContext){var e=this.frame.canvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1),this.frame.canvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{var t=document.createElement("DIV");t.style.color="red",t.style.fontWeight="bold",t.style.padding="10px",t.innerHTML="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(t)}this.body.container.appendChild(this.frame),this.body.view.scale=1,this.body.view.translation={x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight},this._bindHammer()}},{key:"_bindHammer",value:function(){var e=this;void 0!==this.hammer&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new s(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:s.DIRECTION_ALL}),r.onTouch(this.hammer,function(t){e.body.eventListeners.onTouch(t)}),this.hammer.on("tap",function(t){e.body.eventListeners.onTap(t)}),this.hammer.on("doubletap",function(t){e.body.eventListeners.onDoubleTap(t)}),this.hammer.on("press",function(t){e.body.eventListeners.onHold(t)}),this.hammer.on("panstart",function(t){e.body.eventListeners.onDragStart(t)}),this.hammer.on("panmove",function(t){e.body.eventListeners.onDrag(t)}),this.hammer.on("panend",function(t){e.body.eventListeners.onDragEnd(t)}),this.hammer.on("pinch",function(t){e.body.eventListeners.onPinch(t)}),this.frame.canvas.addEventListener("mousewheel",function(t){e.body.eventListeners.onMouseWheel(t)}),this.frame.canvas.addEventListener("DOMMouseScroll",function(t){e.body.eventListeners.onMouseWheel(t)}),this.frame.canvas.addEventListener("mousemove",function(t){e.body.eventListeners.onMouseMove(t)}),this.frame.canvas.addEventListener("contextmenu",function(t){e.body.eventListeners.onContext(t)}),this.hammerFrame=new s(this.frame),r.onRelease(this.hammerFrame,function(t){e.body.eventListeners.onRelease(t)})}},{key:"setSize",value:function(){var e=arguments.length<=0||void 0===arguments[0]?this.options.width:arguments[0],t=arguments.length<=1||void 0===arguments[1]?this.options.height:arguments[1];e=this._prepareValue(e),t=this._prepareValue(t);var i=!1,o=this.frame.canvas.width,n=this.frame.canvas.height,s=this.frame.canvas.getContext("2d"),r=this.pixelRatio;return this.pixelRatio=(window.devicePixelRatio||1)/(s.webkitBackingStorePixelRatio||s.mozBackingStorePixelRatio||s.msBackingStorePixelRatio||s.oBackingStorePixelRatio||s.backingStorePixelRatio||1),e!=this.options.width||t!=this.options.height||this.frame.style.width!=e||this.frame.style.height!=t?(this._getCameraState(r),this.frame.style.width=e,this.frame.style.height=t,this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),this.options.width=e,this.options.height=t,i=!0):(this.frame.canvas.width==Math.round(this.frame.canvas.clientWidth*this.pixelRatio)&&this.frame.canvas.height==Math.round(this.frame.canvas.clientHeight*this.pixelRatio)||this._getCameraState(r),this.frame.canvas.width!=Math.round(this.frame.canvas.clientWidth*this.pixelRatio)&&(this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),i=!0),this.frame.canvas.height!=Math.round(this.frame.canvas.clientHeight*this.pixelRatio)&&(this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),i=!0)),i===!0&&(this.body.emitter.emit("resize",{width:Math.round(this.frame.canvas.width/this.pixelRatio),height:Math.round(this.frame.canvas.height/this.pixelRatio),oldWidth:Math.round(o/this.pixelRatio),oldHeight:Math.round(n/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,i}},{key:"_XconvertDOMtoCanvas",value:function(e){return(e-this.body.view.translation.x)/this.body.view.scale}},{key:"_XconvertCanvasToDOM",value:function(e){return e*this.body.view.scale+this.body.view.translation.x}},{key:"_YconvertDOMtoCanvas",value:function(e){return(e-this.body.view.translation.y)/this.body.view.scale}},{key:"_YconvertCanvasToDOM",value:function(e){return e*this.body.view.scale+this.body.view.translation.y}},{key:"canvasToDOM",value:function(e){return{x:this._XconvertCanvasToDOM(e.x),y:this._YconvertCanvasToDOM(e.y)}}},{key:"DOMtoCanvas",value:function(e){return{x:this._XconvertDOMtoCanvas(e.x),y:this._YconvertDOMtoCanvas(e.y)}}}]),e}();t["default"]=h},function(e,t,i){if("undefined"!=typeof window){var o=i(59),n=window.Hammer||i(60);e.exports=o(n,{preventDefault:"mouse"})}else e.exports=function(){throw Error("hammer.js is only available in a browser, not in node.js.")}},function(e,t,i){var o,n,s;!function(i){n=[],o=i,s="function"==typeof o?o.apply(t,n):o,!(void 0!==s&&(e.exports=s))}(function(){var e=null;return function t(i,o){function n(e){return e.match(/[^ ]+/g)}function s(t){if("hammer.input"!==t.type){if(t.srcEvent._handled||(t.srcEvent._handled={}),t.srcEvent._handled[t.type])return;t.srcEvent._handled[t.type]=!0}var i=!1;t.stopPropagation=function(){i=!0};var o=t.srcEvent.stopPropagation.bind(t.srcEvent);"function"==typeof o&&(t.srcEvent.stopPropagation=function(){o(),t.stopPropagation()}),t.firstTarget=e;for(var n=e;n&&!i;){var s=n.hammer;if(s)for(var r,a=0;a<s.length;a++)if(r=s[a]._handlers[t.type])for(var h=0;h<r.length&&!i;h++)r[h](t);n=n.parentNode}}var r=o||{preventDefault:!1};if(i.Manager){var a=i,h=function(e,i){var o=Object.create(r);return i&&a.assign(o,i),t(new a(e,o),o)};return a.assign(h,a),h.Manager=function(e,i){var o=Object.create(r);return i&&a.assign(o,i),t(new a.Manager(e,o),o)},h}var d=Object.create(i),l=i.element;return l.hammer||(l.hammer=[]),l.hammer.push(d),i.on("hammer.input",function(t){r.preventDefault!==!0&&r.preventDefault!==t.pointerType||t.preventDefault(),t.isFirst&&(e=t.target)}),d._handlers={},d.on=function(e,t){return n(e).forEach(function(e){var o=d._handlers[e];o||(d._handlers[e]=o=[],i.on(e,s)),o.push(t)}),d},d.off=function(e,t){return n(e).forEach(function(e){var o=d._handlers[e];o&&(o=t?o.filter(function(e){return e!==t}):[],o.length>0?d._handlers[e]=o:(i.off(e,s),delete d._handlers[e]))}),d},d.emit=function(t,o){e=o.target,i.emit(t,o)},d.destroy=function(){var e=i.element.hammer,t=e.indexOf(d);-1!==t&&e.splice(t,1),e.length||delete i.element.hammer,d._handlers={},i.destroy()},d}})},function(e,t,i){var o;/*! Hammer.JS - v2.0.6 - 2015-12-23
- * http://hammerjs.github.io/
- *
- * Copyright (c) 2015 Jorik Tangelder;
- * Licensed under the license */
-!function(n,s,r,a){function h(e,t,i){return setTimeout(f(e,i),t)}function d(e,t,i){return Array.isArray(e)?(l(e,i[t],i),!0):!1}function l(e,t,i){var o;if(e)if(e.forEach)e.forEach(t,i);else if(e.length!==a)for(o=0;o<e.length;)t.call(i,e[o],o,e),o++;else for(o in e)e.hasOwnProperty(o)&&t.call(i,e[o],o,e)}function c(e,t,i){var o="DEPRECATED METHOD: "+t+"\n"+i+" AT \n";return function(){var t=new Error("get-stack-trace"),i=t&&t.stack?t.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",s=n.console&&(n.console.warn||n.console.log);return s&&s.call(n.console,o,i),e.apply(this,arguments)}}function u(e,t,i){var o,n=t.prototype;o=e.prototype=Object.create(n),o.constructor=e,o._super=n,i&&ce(o,i)}function f(e,t){return function(){return e.apply(t,arguments)}}function p(e,t){return typeof e==pe?e.apply(t?t[0]||a:a,t):e}function v(e,t){return e===a?t:e}function y(e,t,i){l(_(t),function(t){e.addEventListener(t,i,!1)})}function g(e,t,i){l(_(t),function(t){e.removeEventListener(t,i,!1)})}function b(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function m(e,t){return e.indexOf(t)>-1}function _(e){return e.trim().split(/\s+/g)}function w(e,t,i){if(e.indexOf&&!i)return e.indexOf(t);for(var o=0;o<e.length;){if(i&&e[o][i]==t||!i&&e[o]===t)return o;o++}return-1}function k(e){return Array.prototype.slice.call(e,0)}function x(e,t,i){for(var o=[],n=[],s=0;s<e.length;){var r=t?e[s][t]:e[s];w(n,r)<0&&o.push(e[s]),n[s]=r,s++}return i&&(o=t?o.sort(function(e,i){return e[t]>i[t]}):o.sort()),o}function O(e,t){for(var i,o,n=t[0].toUpperCase()+t.slice(1),s=0;s<ue.length;){if(i=ue[s],o=i?i+n:t,o in e)return o;s++}return a}function E(){return _e++}function M(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||n}function D(e,t){var i=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){p(e.options.enable,[e])&&i.handler(t)},this.init()}function S(e){var t,i=e.options.inputClass;return new(t=i?i:xe?W:Oe?V:ke?G:H)(e,C)}function C(e,t,i){var o=i.pointers.length,n=i.changedPointers.length,s=t&Te&&o-n===0,r=t&(Be|Fe)&&o-n===0;i.isFirst=!!s,i.isFinal=!!r,s&&(e.session={}),i.eventType=t,T(e,i),e.emit("hammer.input",i),e.recognize(i),e.session.prevInput=i}function T(e,t){var i=e.session,o=t.pointers,n=o.length;i.firstInput||(i.firstInput=F(t)),n>1&&!i.firstMultiple?i.firstMultiple=F(t):1===n&&(i.firstMultiple=!1);var s=i.firstInput,r=i.firstMultiple,a=r?r.center:s.center,h=t.center=I(o);t.timeStamp=ge(),t.deltaTime=t.timeStamp-s.timeStamp,t.angle=R(a,h),t.distance=z(a,h),P(i,t),t.offsetDirection=N(t.deltaX,t.deltaY);var d=j(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=d.x,t.overallVelocityY=d.y,t.overallVelocity=ye(d.x)>ye(d.y)?d.x:d.y,t.scale=r?L(r.pointers,o):1,t.rotation=r?A(r.pointers,o):0,t.maxPointers=i.prevInput?t.pointers.length>i.prevInput.maxPointers?t.pointers.length:i.prevInput.maxPointers:t.pointers.length,B(i,t);var l=e.element;b(t.srcEvent.target,l)&&(l=t.srcEvent.target),t.target=l}function P(e,t){var i=t.center,o=e.offsetDelta||{},n=e.prevDelta||{},s=e.prevInput||{};t.eventType!==Te&&s.eventType!==Be||(n=e.prevDelta={x:s.deltaX||0,y:s.deltaY||0},o=e.offsetDelta={x:i.x,y:i.y}),t.deltaX=n.x+(i.x-o.x),t.deltaY=n.y+(i.y-o.y)}function B(e,t){var i,o,n,s,r=e.lastInterval||t,h=t.timeStamp-r.timeStamp;if(t.eventType!=Fe&&(h>Ce||r.velocity===a)){var d=t.deltaX-r.deltaX,l=t.deltaY-r.deltaY,c=j(h,d,l);o=c.x,n=c.y,i=ye(c.x)>ye(c.y)?c.x:c.y,s=N(d,l),e.lastInterval=t}else i=r.velocity,o=r.velocityX,n=r.velocityY,s=r.direction;t.velocity=i,t.velocityX=o,t.velocityY=n,t.direction=s}function F(e){for(var t=[],i=0;i<e.pointers.length;)t[i]={clientX:ve(e.pointers[i].clientX),clientY:ve(e.pointers[i].clientY)},i++;return{timeStamp:ge(),pointers:t,center:I(t),deltaX:e.deltaX,deltaY:e.deltaY}}function I(e){var t=e.length;if(1===t)return{x:ve(e[0].clientX),y:ve(e[0].clientY)};for(var i=0,o=0,n=0;t>n;)i+=e[n].clientX,o+=e[n].clientY,n++;return{x:ve(i/t),y:ve(o/t)}}function j(e,t,i){return{x:t/e||0,y:i/e||0}}function N(e,t){return e===t?Ie:ye(e)>=ye(t)?0>e?je:Ne:0>t?ze:Re}function z(e,t,i){i||(i=We);var o=t[i[0]]-e[i[0]],n=t[i[1]]-e[i[1]];return Math.sqrt(o*o+n*n)}function R(e,t,i){i||(i=We);var o=t[i[0]]-e[i[0]],n=t[i[1]]-e[i[1]];return 180*Math.atan2(n,o)/Math.PI}function A(e,t){return R(t[1],t[0],Ye)+R(e[1],e[0],Ye)}function L(e,t){return z(t[0],t[1],Ye)/z(e[0],e[1],Ye)}function H(){this.evEl=Ve,this.evWin=qe,this.allow=!0,this.pressed=!1,D.apply(this,arguments)}function W(){this.evEl=Ke,this.evWin=Ze,D.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function Y(){this.evTarget=Je,this.evWin=$e,this.started=!1,D.apply(this,arguments)}function U(e,t){var i=k(e.touches),o=k(e.changedTouches);return t&(Be|Fe)&&(i=x(i.concat(o),"identifier",!0)),[i,o]}function V(){this.evTarget=tt,this.targetIds={},D.apply(this,arguments)}function q(e,t){var i=k(e.touches),o=this.targetIds;if(t&(Te|Pe)&&1===i.length)return o[i[0].identifier]=!0,[i,i];var n,s,r=k(e.changedTouches),a=[],h=this.target;if(s=i.filter(function(e){return b(e.target,h)}),t===Te)for(n=0;n<s.length;)o[s[n].identifier]=!0,n++;for(n=0;n<r.length;)o[r[n].identifier]&&a.push(r[n]),t&(Be|Fe)&&delete o[r[n].identifier],n++;return a.length?[x(s.concat(a),"identifier",!0),a]:void 0}function G(){D.apply(this,arguments);var e=f(this.handler,this);this.touch=new V(this.manager,e),this.mouse=new H(this.manager,e)}function X(e,t){this.manager=e,this.set(t)}function K(e){if(m(e,at))return at;var t=m(e,ht),i=m(e,dt);return t&&i?at:t||i?t?ht:dt:m(e,rt)?rt:st}function Z(e){this.options=ce({},this.defaults,e||{}),this.id=E(),this.manager=null,this.options.enable=v(this.options.enable,!0),this.state=lt,this.simultaneous={},this.requireFail=[]}function Q(e){return e&vt?"cancel":e&ft?"end":e&ut?"move":e&ct?"start":""}function J(e){return e==Re?"down":e==ze?"up":e==je?"left":e==Ne?"right":""}function $(e,t){var i=t.manager;return i?i.get(e):e}function ee(){Z.apply(this,arguments)}function te(){ee.apply(this,arguments),this.pX=null,this.pY=null}function ie(){ee.apply(this,arguments)}function oe(){Z.apply(this,arguments),this._timer=null,this._input=null}function ne(){ee.apply(this,arguments)}function se(){ee.apply(this,arguments)}function re(){Z.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function ae(e,t){return t=t||{},t.recognizers=v(t.recognizers,ae.defaults.preset),new he(e,t)}function he(e,t){this.options=ce({},ae.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.element=e,this.input=S(this),this.touchAction=new X(this,this.options.touchAction),de(this,!0),l(this.options.recognizers,function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])},this)}function de(e,t){var i=e.element;i.style&&l(e.options.cssProps,function(e,o){i.style[O(i.style,o)]=t?e:""})}function le(e,t){var i=s.createEvent("Event");i.initEvent(e,!0,!0),i.gesture=t,t.target.dispatchEvent(i)}var ce,ue=["","webkit","Moz","MS","ms","o"],fe=s.createElement("div"),pe="function",ve=Math.round,ye=Math.abs,ge=Date.now;ce="function"!=typeof Object.assign?function(e){if(e===a||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),i=1;i<arguments.length;i++){var o=arguments[i];if(o!==a&&null!==o)for(var n in o)o.hasOwnProperty(n)&&(t[n]=o[n])}return t}:Object.assign;var be=c(function(e,t,i){for(var o=Object.keys(t),n=0;n<o.length;)(!i||i&&e[o[n]]===a)&&(e[o[n]]=t[o[n]]),n++;return e},"extend","Use `assign`."),me=c(function(e,t){return be(e,t,!0)},"merge","Use `assign`."),_e=1,we=/mobile|tablet|ip(ad|hone|od)|android/i,ke="ontouchstart"in n,xe=O(n,"PointerEvent")!==a,Oe=ke&&we.test(navigator.userAgent),Ee="touch",Me="pen",De="mouse",Se="kinect",Ce=25,Te=1,Pe=2,Be=4,Fe=8,Ie=1,je=2,Ne=4,ze=8,Re=16,Ae=je|Ne,Le=ze|Re,He=Ae|Le,We=["x","y"],Ye=["clientX","clientY"];D.prototype={handler:function(){},init:function(){this.evEl&&y(this.element,this.evEl,this.domHandler),this.evTarget&&y(this.target,this.evTarget,this.domHandler),this.evWin&&y(M(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&g(this.element,this.evEl,this.domHandler),this.evTarget&&g(this.target,this.evTarget,this.domHandler),this.evWin&&g(M(this.element),this.evWin,this.domHandler)}};var Ue={mousedown:Te,mousemove:Pe,mouseup:Be},Ve="mousedown",qe="mousemove mouseup";u(H,D,{handler:function(e){var t=Ue[e.type];t&Te&&0===e.button&&(this.pressed=!0),t&Pe&&1!==e.which&&(t=Be),this.pressed&&this.allow&&(t&Be&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:De,srcEvent:e}))}});var Ge={pointerdown:Te,pointermove:Pe,pointerup:Be,pointercancel:Fe,pointerout:Fe},Xe={2:Ee,3:Me,4:De,5:Se},Ke="pointerdown",Ze="pointermove pointerup pointercancel";n.MSPointerEvent&&!n.PointerEvent&&(Ke="MSPointerDown",Ze="MSPointerMove MSPointerUp MSPointerCancel"),u(W,D,{handler:function(e){var t=this.store,i=!1,o=e.type.toLowerCase().replace("ms",""),n=Ge[o],s=Xe[e.pointerType]||e.pointerType,r=s==Ee,a=w(t,e.pointerId,"pointerId");n&Te&&(0===e.button||r)?0>a&&(t.push(e),a=t.length-1):n&(Be|Fe)&&(i=!0),0>a||(t[a]=e,this.callback(this.manager,n,{pointers:t,changedPointers:[e],pointerType:s,srcEvent:e}),i&&t.splice(a,1))}});var Qe={touchstart:Te,touchmove:Pe,touchend:Be,touchcancel:Fe},Je="touchstart",$e="touchstart touchmove touchend touchcancel";u(Y,D,{handler:function(e){var t=Qe[e.type];if(t===Te&&(this.started=!0),this.started){var i=U.call(this,e,t);t&(Be|Fe)&&i[0].length-i[1].length===0&&(this.started=!1),this.callback(this.manager,t,{pointers:i[0],changedPointers:i[1],pointerType:Ee,srcEvent:e})}}});var et={touchstart:Te,touchmove:Pe,touchend:Be,touchcancel:Fe},tt="touchstart touchmove touchend touchcancel";u(V,D,{handler:function(e){var t=et[e.type],i=q.call(this,e,t);i&&this.callback(this.manager,t,{pointers:i[0],changedPointers:i[1],pointerType:Ee,srcEvent:e})}}),u(G,D,{handler:function(e,t,i){var o=i.pointerType==Ee,n=i.pointerType==De;if(o)this.mouse.allow=!1;else if(n&&!this.mouse.allow)return;t&(Be|Fe)&&(this.mouse.allow=!0),this.callback(e,t,i)},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var it=O(fe.style,"touchAction"),ot=it!==a,nt="compute",st="auto",rt="manipulation",at="none",ht="pan-x",dt="pan-y";X.prototype={set:function(e){e==nt&&(e=this.compute()),ot&&this.manager.element.style&&(this.manager.element.style[it]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return l(this.manager.recognizers,function(t){p(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),K(e.join(" "))},preventDefaults:function(e){if(!ot){var t=e.srcEvent,i=e.offsetDirection;if(this.manager.session.prevented)return void t.preventDefault();var o=this.actions,n=m(o,at),s=m(o,dt),r=m(o,ht);if(n){var a=1===e.pointers.length,h=e.distance<2,d=e.deltaTime<250;if(a&&h&&d)return}if(!r||!s)return n||s&&i&Ae||r&&i&Le?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var lt=1,ct=2,ut=4,ft=8,pt=ft,vt=16,yt=32;Z.prototype={defaults:{},set:function(e){return ce(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(d(e,"recognizeWith",this))return this;var t=this.simultaneous;return e=$(e,this),t[e.id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return d(e,"dropRecognizeWith",this)?this:(e=$(e,this),delete this.simultaneous[e.id],this)},requireFailure:function(e){if(d(e,"requireFailure",this))return this;var t=this.requireFail;return e=$(e,this),-1===w(t,e)&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(d(e,"dropRequireFailure",this))return this;e=$(e,this);var t=w(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){function t(t){i.manager.emit(t,e)}var i=this,o=this.state;ft>o&&t(i.options.event+Q(o)),t(i.options.event),e.additionalEvent&&t(e.additionalEvent),o>=ft&&t(i.options.event+Q(o))},tryEmit:function(e){return this.canEmit()?this.emit(e):void(this.state=yt)},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(yt|lt)))return!1;e++}return!0},recognize:function(e){var t=ce({},e);return p(this.options.enable,[this,t])?(this.state&(pt|vt|yt)&&(this.state=lt),this.state=this.process(t),void(this.state&(ct|ut|ft|vt)&&this.tryEmit(t))):(this.reset(),void(this.state=yt))},process:function(e){},getTouchAction:function(){},reset:function(){}},u(ee,Z,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,i=e.eventType,o=t&(ct|ut),n=this.attrTest(e);return o&&(i&Fe||!n)?t|vt:o||n?i&Be?t|ft:t&ct?t|ut:ct:yt}}),u(te,ee,{defaults:{event:"pan",threshold:10,pointers:1,direction:He},getTouchAction:function(){var e=this.options.direction,t=[];return e&Ae&&t.push(dt),e&Le&&t.push(ht),t},directionTest:function(e){var t=this.options,i=!0,o=e.distance,n=e.direction,s=e.deltaX,r=e.deltaY;return n&t.direction||(t.direction&Ae?(n=0===s?Ie:0>s?je:Ne,i=s!=this.pX,o=Math.abs(e.deltaX)):(n=0===r?Ie:0>r?ze:Re,i=r!=this.pY,o=Math.abs(e.deltaY))),e.direction=n,i&&o>t.threshold&&n&t.direction},attrTest:function(e){return ee.prototype.attrTest.call(this,e)&&(this.state&ct||!(this.state&ct)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=J(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),u(ie,ee,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[at]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&ct)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),u(oe,Z,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[st]},process:function(e){var t=this.options,i=e.pointers.length===t.pointers,o=e.distance<t.threshold,n=e.deltaTime>t.time;if(this._input=e,!o||!i||e.eventType&(Be|Fe)&&!n)this.reset();else if(e.eventType&Te)this.reset(),this._timer=h(function(){this.state=pt,this.tryEmit()},t.time,this);else if(e.eventType&Be)return pt;return yt},reset:function(){clearTimeout(this._timer)},emit:function(e){this.state===pt&&(e&&e.eventType&Be?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=ge(),this.manager.emit(this.options.event,this._input)))}}),u(ne,ee,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[at]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&ct)}}),u(se,ee,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Ae|Le,pointers:1},getTouchAction:function(){return te.prototype.getTouchAction.call(this)},attrTest:function(e){var t,i=this.options.direction;return i&(Ae|Le)?t=e.overallVelocity:i&Ae?t=e.overallVelocityX:i&Le&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&i&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&ye(t)>this.options.velocity&&e.eventType&Be},emit:function(e){var t=J(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),u(re,Z,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[rt]},process:function(e){var t=this.options,i=e.pointers.length===t.pointers,o=e.distance<t.threshold,n=e.deltaTime<t.time;if(this.reset(),e.eventType&Te&&0===this.count)return this.failTimeout();if(o&&n&&i){if(e.eventType!=Be)return this.failTimeout();var s=this.pTime?e.timeStamp-this.pTime<t.interval:!0,r=!this.pCenter||z(this.pCenter,e.center)<t.posThreshold;this.pTime=e.timeStamp,this.pCenter=e.center,r&&s?this.count+=1:this.count=1,this._input=e;var a=this.count%t.taps;if(0===a)return this.hasRequireFailures()?(this._timer=h(function(){this.state=pt,this.tryEmit()},t.interval,this),ct):pt}return yt},failTimeout:function(){return this._timer=h(function(){this.state=yt},this.options.interval,this),yt},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==pt&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),ae.VERSION="2.0.6",ae.defaults={domEvents:!1,touchAction:nt,enable:!0,inputTarget:null,inputClass:null,preset:[[ne,{enable:!1}],[ie,{enable:!1},["rotate"]],[se,{direction:Ae}],[te,{direction:Ae},["swipe"]],[re],[re,{event:"doubletap",taps:2},["tap"]],[oe]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var gt=1,bt=2;he.prototype={set:function(e){return ce(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?bt:gt},recognize:function(e){var t=this.session;if(!t.stopped){this.touchAction.preventDefaults(e);var i,o=this.recognizers,n=t.curRecognizer;(!n||n&&n.state&pt)&&(n=t.curRecognizer=null);for(var s=0;s<o.length;)i=o[s],t.stopped===bt||n&&i!=n&&!i.canRecognizeWith(n)?i.reset():i.recognize(e),!n&&i.state&(ct|ut|ft)&&(n=t.curRecognizer=i),s++}},get:function(e){if(e instanceof Z)return e;for(var t=this.recognizers,i=0;i<t.length;i++)if(t[i].options.event==e)return t[i];return null},add:function(e){if(d(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(d(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,i=w(t,e);-1!==i&&(t.splice(i,1),this.touchAction.update())}return this},on:function(e,t){var i=this.handlers;return l(_(e),function(e){i[e]=i[e]||[],i[e].push(t)}),this},off:function(e,t){var i=this.handlers;return l(_(e),function(e){t?i[e]&&i[e].splice(w(i[e],t),1):delete i[e]}),this},emit:function(e,t){this.options.domEvents&&le(e,t);var i=this.handlers[e]&&this.handlers[e].slice();if(i&&i.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var o=0;o<i.length;)i[o](t),o++}},destroy:function(){this.element&&de(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},ce(ae,{INPUT_START:Te,INPUT_MOVE:Pe,INPUT_END:Be,INPUT_CANCEL:Fe,STATE_POSSIBLE:lt,STATE_BEGAN:ct,STATE_CHANGED:ut,STATE_ENDED:ft,STATE_RECOGNIZED:pt,STATE_CANCELLED:vt,STATE_FAILED:yt,DIRECTION_NONE:Ie,DIRECTION_LEFT:je,DIRECTION_RIGHT:Ne,DIRECTION_UP:ze,DIRECTION_DOWN:Re,DIRECTION_HORIZONTAL:Ae,DIRECTION_VERTICAL:Le,DIRECTION_ALL:He,Manager:he,Input:D,TouchAction:X,TouchInput:V,MouseInput:H,PointerEventInput:W,TouchMouseInput:G,SingleTouchInput:Y,Recognizer:Z,AttrRecognizer:ee,Tap:re,Pan:te,Swipe:se,Pinch:ie,Rotate:ne,Press:oe,on:y,off:g,each:l,merge:me,extend:be,assign:ce,inherit:u,bindFn:f,prefixed:O});var mt="undefined"!=typeof n?n:"undefined"!=typeof self?self:{};mt.Hammer=ae,o=function(){return ae}.call(t,i,t,e),!(o!==a&&(e.exports=o))}(window,document,"Hammer")},function(e,t,i){i(58);t.onTouch=function(e,t){t.inputHandler=function(e){e.isFirst&&t(e)},e.on("hammer.input",t.inputHandler)},t.onRelease=function(e,t){return t.inputHandler=function(e){e.isFinal&&t(e)},e.on("hammer.input",t.inputHandler)},t.offTouch=function(e,t){e.off("hammer.input",t.inputHandler)},t.offRelease=t.offTouch,t.disablePreventDefaultVertically=function(e){var t="pan-y";return e.getTouchAction=function(){return[t]},e}},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),r=i(54),a=o(r),h=i(1),d=function(){function e(t,i){var o=this;n(this,e),this.body=t,this.canvas=i,this.animationSpeed=1/this.renderRefreshRate,this.animationEasingFunction="easeInOutQuint",this.easingTime=0,this.sourceScale=0,this.targetScale=0,this.sourceTranslation=0,this.targetTranslation=0,this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0,this.touchTime=0,this.viewFunction=void 0,this.body.emitter.on("fit",this.fit.bind(this)),this.body.emitter.on("animationFinished",function(){o.body.emitter.emit("_stopRendering")}),this.body.emitter.on("unlockNode",this.releaseNode.bind(this))}return s(e,[{key:"setOptions",value:function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.options=e}},{key:"fit",value:function(){var e=arguments.length<=0||void 0===arguments[0]?{nodes:[]}:arguments[0],t=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],i=void 0,o=void 0;if(void 0!==e.nodes&&0!==e.nodes.length||(e.nodes=this.body.nodeIndices),t===!0){var n=0;for(var s in this.body.nodes)if(this.body.nodes.hasOwnProperty(s)){var r=this.body.nodes[s];r.predefinedPosition===!0&&(n+=1)}if(n>.5*this.body.nodeIndices.length)return void this.fit(e,!1);i=a["default"].getRange(this.body.nodes,e.nodes);var h=this.body.nodeIndices.length;o=12.662/(h+7.4147)+.0964822;var d=Math.min(this.canvas.frame.canvas.clientWidth/600,this.canvas.frame.canvas.clientHeight/600);o*=d}else{this.body.emitter.emit("_resizeNodes"),i=a["default"].getRange(this.body.nodes,e.nodes);var l=1.1*Math.abs(i.maxX-i.minX),c=1.1*Math.abs(i.maxY-i.minY),u=this.canvas.frame.canvas.clientWidth/l,f=this.canvas.frame.canvas.clientHeight/c;o=f>=u?u:f}o>1?o=1:0===o&&(o=1);var p=a["default"].findCenter(i),v={position:p,scale:o,animation:e.animation};this.moveTo(v)}},{key:"focus",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];if(void 0!==this.body.nodes[e]){var i={x:this.body.nodes[e].x,y:this.body.nodes[e].y};t.position=i,t.lockedOnNode=e,this.moveTo(t)}else console.log("Node: "+e+" cannot be found.")}},{key:"moveTo",value:function(e){return void 0===e?void(e={}):(void 0===e.offset&&(e.offset={x:0,y:0}),void 0===e.offset.x&&(e.offset.x=0),void 0===e.offset.y&&(e.offset.y=0),void 0===e.scale&&(e.scale=this.body.view.scale),void 0===e.position&&(e.position=this.getViewPosition()),void 0===e.animation&&(e.animation={duration:0}),e.animation===!1&&(e.animation={duration:0}),e.animation===!0&&(e.animation={}),void 0===e.animation.duration&&(e.animation.duration=1e3),void 0===e.animation.easingFunction&&(e.animation.easingFunction="easeInOutQuad"),void this.animateView(e))}},{key:"animateView",value:function(e){if(void 0!==e){this.animationEasingFunction=e.animation.easingFunction,this.releaseNode(),e.locked===!0&&(this.lockedOnNodeId=e.lockedOnNode,this.lockedOnNodeOffset=e.offset),0!=this.easingTime&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=e.scale,this.body.view.scale=this.targetScale;var t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),i={x:t.x-e.position.x,y:t.y-e.position.y};this.targetTranslation={x:this.sourceTranslation.x+i.x*this.targetScale+e.offset.x,y:this.sourceTranslation.y+i.y*this.targetScale+e.offset.y},0===e.animation.duration?void 0!=this.lockedOnNodeId?(this.viewFunction=this._lockedRedraw.bind(this),this.body.emitter.on("initRedraw",this.viewFunction)):(this.body.view.scale=this.targetScale,this.body.view.translation=this.targetTranslation,this.body.emitter.emit("_requestRedraw")):(this.animationSpeed=1/(60*e.animation.duration*.001)||1/60,this.animationEasingFunction=e.animation.easingFunction,this.viewFunction=this._transitionRedraw.bind(this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering"))}}},{key:"_lockedRedraw",value:function(){var e={x:this.body.nodes[this.lockedOnNodeId].x,y:this.body.nodes[this.lockedOnNodeId].y},t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),i={x:t.x-e.x,y:t.y-e.y},o=this.body.view.translation,n={x:o.x+i.x*this.body.view.scale+this.lockedOnNodeOffset.x,y:o.y+i.y*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=n}},{key:"releaseNode",value:function(){void 0!==this.lockedOnNodeId&&void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}},{key:"_transitionRedraw",value:function(){var e=arguments.length<=0||void 0===arguments[0]?!1:arguments[0];this.easingTime+=this.animationSpeed,this.easingTime=e===!0?1:this.easingTime;var t=h.easingFunctions[this.animationEasingFunction](this.easingTime);this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*t,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*t,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*t},this.easingTime>=1&&(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,void 0!=this.lockedOnNodeId&&(this.viewFunction=this._lockedRedraw.bind(this),this.body.emitter.on("initRedraw",this.viewFunction)),this.body.emitter.emit("animationFinished"))}},{key:"getScale",value:function(){return this.body.view.scale}},{key:"getViewPosition",value:function(){return this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight})}}]),e}();t["default"]=d},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),r=i(64),a=o(r),h=i(66),d=o(h),l=i(1),c=function(){function e(t,i,o){n(this,e),this.body=t,this.canvas=i,this.selectionHandler=o,this.navigationHandler=new a["default"](t,i),this.body.eventListeners.onTap=this.onTap.bind(this),this.body.eventListeners.onTouch=this.onTouch.bind(this),this.body.eventListeners.onDoubleTap=this.onDoubleTap.bind(this),this.body.eventListeners.onHold=this.onHold.bind(this),this.body.eventListeners.onDragStart=this.onDragStart.bind(this),this.body.eventListeners.onDrag=this.onDrag.bind(this),this.body.eventListeners.onDragEnd=this.onDragEnd.bind(this),this.body.eventListeners.onMouseWheel=this.onMouseWheel.bind(this),this.body.eventListeners.onPinch=this.onPinch.bind(this),this.body.eventListeners.onMouseMove=this.onMouseMove.bind(this),this.body.eventListeners.onRelease=this.onRelease.bind(this),this.body.eventListeners.onContext=this.onContext.bind(this),this.touchTime=0,this.drag={},this.pinch={},this.popup=void 0,this.popupObj=void 0,this.popupTimer=void 0,this.body.functions.getPointer=this.getPointer.bind(this),this.options={},this.defaultOptions={dragNodes:!0,dragView:!0,hover:!1,keyboard:{enabled:!1,speed:{x:10,y:10,zoom:.02},bindToWindow:!0},navigationButtons:!1,tooltipDelay:300,zoomView:!0},l.extend(this.options,this.defaultOptions),this.bindEventListeners()}return s(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("destroy",function(){clearTimeout(e.popupTimer),delete e.body.functions.getPointer})}},{key:"setOptions",value:function(e){if(void 0!==e){var t=["hideEdgesOnDrag","hideNodesOnDrag","keyboard","multiselect","selectable","selectConnectedEdges"];l.selectiveNotDeepExtend(t,this.options,e),l.mergeOptions(this.options,e,"keyboard"),e.tooltip&&(l.extend(this.options.tooltip,e.tooltip),e.tooltip.color&&(this.options.tooltip.color=l.parseColor(e.tooltip.color)))}this.navigationHandler.setOptions(this.options)}},{key:"getPointer",value:function(e){return{x:e.x-l.getAbsoluteLeft(this.canvas.frame.canvas),y:e.y-l.getAbsoluteTop(this.canvas.frame.canvas)}}},{key:"onTouch",value:function(e){(new Date).valueOf()-this.touchTime>50&&(this.drag.pointer=this.getPointer(e.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=(new Date).valueOf())}},{key:"onTap",value:function(e){var t=this.getPointer(e.center),i=this.selectionHandler.options.multiselect&&(e.changedPointers[0].ctrlKey||e.changedPointers[0].metaKey);this.checkSelectionChanges(t,e,i),this.selectionHandler._generateClickEvent("click",e,t)}},{key:"onDoubleTap",value:function(e){var t=this.getPointer(e.center);this.selectionHandler._generateClickEvent("doubleClick",e,t)}},{key:"onHold",value:function(e){var t=this.getPointer(e.center),i=this.selectionHandler.options.multiselect;this.checkSelectionChanges(t,e,i),this.selectionHandler._generateClickEvent("click",e,t),this.selectionHandler._generateClickEvent("hold",e,t)}},{key:"onRelease",value:function(e){if((new Date).valueOf()-this.touchTime>10){var t=this.getPointer(e.center);this.selectionHandler._generateClickEvent("release",e,t),this.touchTime=(new Date).valueOf()}}},{key:"onContext",value:function(e){var t=this.getPointer({x:e.clientX,y:e.clientY});this.selectionHandler._generateClickEvent("oncontext",e,t)}},{key:"checkSelectionChanges",value:function(e,t){var i=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],o=this.selectionHandler._getSelectedEdgeCount(),n=this.selectionHandler._getSelectedNodeCount(),s=this.selectionHandler.getSelection(),r=void 0;r=i===!0?this.selectionHandler.selectAdditionalOnPoint(e):this.selectionHandler.selectOnPoint(e);var a=this.selectionHandler._getSelectedEdgeCount(),h=this.selectionHandler._getSelectedNodeCount(),d=this.selectionHandler.getSelection(),l=this._determineIfDifferent(s,d),c=l.nodesChanged,u=l.edgesChanged,f=!1;h-n>0?(this.selectionHandler._generateClickEvent("selectNode",t,e),r=!0,f=!0):c===!0&&h>0?(this.selectionHandler._generateClickEvent("deselectNode",t,e,s),this.selectionHandler._generateClickEvent("selectNode",t,e),f=!0,r=!0):0>h-n&&(this.selectionHandler._generateClickEvent("deselectNode",t,e,s),r=!0),a-o>0&&f===!1?(this.selectionHandler._generateClickEvent("selectEdge",t,e),r=!0):a>0&&u===!0?(this.selectionHandler._generateClickEvent("deselectEdge",t,e,s),this.selectionHandler._generateClickEvent("selectEdge",t,e),r=!0):0>a-o&&(this.selectionHandler._generateClickEvent("deselectEdge",t,e,s),r=!0),r===!0&&this.selectionHandler._generateClickEvent("select",t,e)}},{key:"_determineIfDifferent",value:function(e,t){for(var i=!1,o=!1,n=0;n<e.nodes.length;n++)-1===t.nodes.indexOf(e.nodes[n])&&(i=!0);for(var s=0;s<t.nodes.length;s++)-1===e.nodes.indexOf(e.nodes[s])&&(i=!0);for(var r=0;r<e.edges.length;r++)-1===t.edges.indexOf(e.edges[r])&&(o=!0);for(var a=0;a<t.edges.length;a++)-1===e.edges.indexOf(e.edges[a])&&(o=!0);return{nodesChanged:i,edgesChanged:o}}},{key:"onDragStart",value:function(e){void 0===this.drag.pointer&&this.onTouch(e);var t=this.selectionHandler.getNodeAt(this.drag.pointer);if(this.drag.dragging=!0,this.drag.selection=[],this.drag.translation=l.extend({},this.body.view.translation),this.drag.nodeId=void 0,void 0!==t&&this.options.dragNodes===!0){this.drag.nodeId=t.id,t.isSelected()===!1&&(this.selectionHandler.unselectAll(),this.selectionHandler.selectObject(t)),this.selectionHandler._generateClickEvent("dragStart",e,this.drag.pointer);var i=this.selectionHandler.selectionObj.nodes;for(var o in i)if(i.hasOwnProperty(o)){var n=i[o],s={id:n.id,node:n,x:n.x,y:n.y,xFixed:n.options.fixed.x,
-yFixed:n.options.fixed.y};n.options.fixed.x=!0,n.options.fixed.y=!0,this.drag.selection.push(s)}}else this.selectionHandler._generateClickEvent("dragStart",e,this.drag.pointer,void 0,!0)}},{key:"onDrag",value:function(e){var t=this;if(this.drag.pinched!==!0){this.body.emitter.emit("unlockNode");var i=this.getPointer(e.center),o=this.drag.selection;if(o&&o.length&&this.options.dragNodes===!0)!function(){t.selectionHandler._generateClickEvent("dragging",e,i);var n=i.x-t.drag.pointer.x,s=i.y-t.drag.pointer.y;o.forEach(function(e){var i=e.node;e.xFixed===!1&&(i.x=t.canvas._XconvertDOMtoCanvas(t.canvas._XconvertCanvasToDOM(e.x)+n)),e.yFixed===!1&&(i.y=t.canvas._YconvertDOMtoCanvas(t.canvas._YconvertCanvasToDOM(e.y)+s))}),t.body.emitter.emit("startSimulation")}();else if(this.options.dragView===!0){if(this.selectionHandler._generateClickEvent("dragging",e,i,void 0,!0),void 0===this.drag.pointer)return void this.onDragStart(e);var n=i.x-this.drag.pointer.x,s=i.y-this.drag.pointer.y;this.body.view.translation={x:this.drag.translation.x+n,y:this.drag.translation.y+s},this.body.emitter.emit("_redraw")}}}},{key:"onDragEnd",value:function(e){this.drag.dragging=!1;var t=this.drag.selection;t&&t.length?(t.forEach(function(e){e.node.options.fixed.x=e.xFixed,e.node.options.fixed.y=e.yFixed}),this.selectionHandler._generateClickEvent("dragEnd",e,this.getPointer(e.center)),this.body.emitter.emit("startSimulation")):(this.selectionHandler._generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw"))}},{key:"onPinch",value:function(e){var t=this.getPointer(e.center);this.drag.pinched=!0,void 0===this.pinch.scale&&(this.pinch.scale=1);var i=this.pinch.scale*e.scale;this.zoom(i,t)}},{key:"zoom",value:function(e,t){if(this.options.zoomView===!0){var i=this.body.view.scale;1e-5>e&&(e=1e-5),e>10&&(e=10);var o=void 0;void 0!==this.drag&&this.drag.dragging===!0&&(o=this.canvas.DOMtoCanvas(this.drag.pointer));var n=this.body.view.translation,s=e/i,r=(1-s)*t.x+n.x*s,a=(1-s)*t.y+n.y*s;if(this.body.view.scale=e,this.body.view.translation={x:r,y:a},void 0!=o){var h=this.canvas.canvasToDOM(o);this.drag.pointer.x=h.x,this.drag.pointer.y=h.y}this.body.emitter.emit("_requestRedraw"),e>i?this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale}):this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale})}}},{key:"onMouseWheel",value:function(e){if(this.options.zoomView===!0){var t=0;if(e.wheelDelta?t=e.wheelDelta/120:e.detail&&(t=-e.detail/3),0!==t){var i=this.body.view.scale,o=t/10;0>t&&(o/=1-o),i*=1+o;var n=this.getPointer({x:e.clientX,y:e.clientY});this.zoom(i,n)}e.preventDefault()}}},{key:"onMouseMove",value:function(e){var t=this,i=this.getPointer({x:e.clientX,y:e.clientY}),o=!1;if(void 0!==this.popup&&(this.popup.hidden===!1&&this._checkHidePopup(i),this.popup.hidden===!1&&(o=!0,this.popup.setPosition(i.x+3,i.y-5),this.popup.show())),this.options.keyboard.bindToWindow===!1&&this.options.keyboard.enabled===!0&&this.canvas.frame.focus(),o===!1&&(void 0!==this.popupTimer&&(clearInterval(this.popupTimer),this.popupTimer=void 0),this.drag.dragging||(this.popupTimer=setTimeout(function(){return t._checkShowPopup(i)},this.options.tooltipDelay))),this.options.hover===!0){var n=this.selectionHandler.getNodeAt(i);void 0===n&&(n=this.selectionHandler.getEdgeAt(i)),this.selectionHandler.hoverObject(n)}}},{key:"_checkShowPopup",value:function(e){var t=this.canvas._XconvertDOMtoCanvas(e.x),i=this.canvas._YconvertDOMtoCanvas(e.y),o={left:t,top:i,right:t,bottom:i},n=void 0===this.popupObj?void 0:this.popupObj.id,s=!1,r="node";if(void 0===this.popupObj){for(var a=this.body.nodeIndices,h=this.body.nodes,l=void 0,c=[],u=0;u<a.length;u++)l=h[a[u]],l.isOverlappingWith(o)===!0&&void 0!==l.getTitle()&&c.push(a[u]);c.length>0&&(this.popupObj=h[c[c.length-1]],s=!0)}if(void 0===this.popupObj&&s===!1){for(var f=this.body.edgeIndices,p=this.body.edges,v=void 0,y=[],g=0;g<f.length;g++)v=p[f[g]],v.isOverlappingWith(o)===!0&&v.connected===!0&&void 0!==v.getTitle()&&y.push(f[g]);y.length>0&&(this.popupObj=p[y[y.length-1]],r="edge")}void 0!==this.popupObj?this.popupObj.id!==n&&(void 0===this.popup&&(this.popup=new d["default"](this.canvas.frame)),this.popup.popupTargetType=r,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(e.x+3,e.y-5),this.popup.setText(this.popupObj.getTitle()),this.popup.show(),this.body.emitter.emit("showPopup",this.popupObj.id)):void 0!==this.popup&&(this.popup.hide(),this.body.emitter.emit("hidePopup"))}},{key:"_checkHidePopup",value:function(e){var t=this.selectionHandler._pointerToPositionObject(e),i=!1;if("node"===this.popup.popupTargetType){if(void 0!==this.body.nodes[this.popup.popupTargetId]&&(i=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(t),i===!0)){var o=this.selectionHandler.getNodeAt(e);i=o.id===this.popup.popupTargetId}}else void 0===this.selectionHandler.getNodeAt(e)&&void 0!==this.body.edges[this.popup.popupTargetId]&&(i=this.body.edges[this.popup.popupTargetId].isOverlappingWith(t));i===!1&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}}]),e}();t["default"]=c},function(e,t,i){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),s=(i(1),i(58)),r=i(61),a=i(65),h=function(){function e(t,i){var n=this;o(this,e),this.body=t,this.canvas=i,this.iconsCreated=!1,this.navigationHammers=[],this.boundFunctions={},this.touchTime=0,this.activated=!1,this.body.emitter.on("activate",function(){n.activated=!0,n.configureKeyboardBindings()}),this.body.emitter.on("deactivate",function(){n.activated=!1,n.configureKeyboardBindings()}),this.body.emitter.on("destroy",function(){void 0!==n.keycharm&&n.keycharm.destroy()}),this.options={}}return n(e,[{key:"setOptions",value:function(e){void 0!==e&&(this.options=e,this.create())}},{key:"create",value:function(){this.options.navigationButtons===!0?this.iconsCreated===!1&&this.loadNavigationElements():this.iconsCreated===!0&&this.cleanNavigation(),this.configureKeyboardBindings()}},{key:"cleanNavigation",value:function(){if(0!=this.navigationHammers.length){for(var e=0;e<this.navigationHammers.length;e++)this.navigationHammers[e].destroy();this.navigationHammers=[]}this.navigationDOM&&this.navigationDOM.wrapper&&this.navigationDOM.wrapper.parentNode&&this.navigationDOM.wrapper.parentNode.removeChild(this.navigationDOM.wrapper),this.iconsCreated=!1}},{key:"loadNavigationElements",value:function(){var e=this;this.cleanNavigation(),this.navigationDOM={};var t=["up","down","left","right","zoomIn","zoomOut","zoomExtends"],i=["_moveUp","_moveDown","_moveLeft","_moveRight","_zoomIn","_zoomOut","_fit"];this.navigationDOM.wrapper=document.createElement("div"),this.navigationDOM.wrapper.className="vis-navigation",this.canvas.frame.appendChild(this.navigationDOM.wrapper);for(var o=0;o<t.length;o++){this.navigationDOM[t[o]]=document.createElement("div"),this.navigationDOM[t[o]].className="vis-button vis-"+t[o],this.navigationDOM.wrapper.appendChild(this.navigationDOM[t[o]]);var n=new s(this.navigationDOM[t[o]]);"_fit"===i[o]?r.onTouch(n,this._fit.bind(this)):r.onTouch(n,this.bindToRedraw.bind(this,i[o])),this.navigationHammers.push(n)}var a=new s(this.canvas.frame);r.onRelease(a,function(){e._stopMovement()}),this.navigationHammers.push(a),this.iconsCreated=!0}},{key:"bindToRedraw",value:function(e){void 0===this.boundFunctions[e]&&(this.boundFunctions[e]=this[e].bind(this),this.body.emitter.on("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_startRendering"))}},{key:"unbindFromRedraw",value:function(e){void 0!==this.boundFunctions[e]&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"),delete this.boundFunctions[e])}},{key:"_fit",value:function(){(new Date).valueOf()-this.touchTime>700&&(this.body.emitter.emit("fit",{duration:700}),this.touchTime=(new Date).valueOf())}},{key:"_stopMovement",value:function(){for(var e in this.boundFunctions)this.boundFunctions.hasOwnProperty(e)&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"));this.boundFunctions={}}},{key:"_moveUp",value:function(){this.body.view.translation.y+=this.options.keyboard.speed.y}},{key:"_moveDown",value:function(){this.body.view.translation.y-=this.options.keyboard.speed.y}},{key:"_moveLeft",value:function(){this.body.view.translation.x+=this.options.keyboard.speed.x}},{key:"_moveRight",value:function(){this.body.view.translation.x-=this.options.keyboard.speed.x}},{key:"_zoomIn",value:function(){this.body.view.scale*=1+this.options.keyboard.speed.zoom,this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale})}},{key:"_zoomOut",value:function(){this.body.view.scale/=1+this.options.keyboard.speed.zoom,this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale})}},{key:"configureKeyboardBindings",value:function(){var e=this;void 0!==this.keycharm&&this.keycharm.destroy(),this.options.keyboard.enabled===!0&&(this.options.keyboard.bindToWindow===!0?this.keycharm=a({container:window,preventDefault:!0}):this.keycharm=a({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),this.activated===!0&&(this.keycharm.bind("up",function(){e.bindToRedraw("_moveUp")},"keydown"),this.keycharm.bind("down",function(){e.bindToRedraw("_moveDown")},"keydown"),this.keycharm.bind("left",function(){e.bindToRedraw("_moveLeft")},"keydown"),this.keycharm.bind("right",function(){e.bindToRedraw("_moveRight")},"keydown"),this.keycharm.bind("=",function(){e.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("num+",function(){e.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("num-",function(){e.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("-",function(){e.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("[",function(){e.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("]",function(){e.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("pageup",function(){e.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("pagedown",function(){e.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("up",function(){e.unbindFromRedraw("_moveUp")},"keyup"),this.keycharm.bind("down",function(){e.unbindFromRedraw("_moveDown")},"keyup"),this.keycharm.bind("left",function(){e.unbindFromRedraw("_moveLeft")},"keyup"),this.keycharm.bind("right",function(){e.unbindFromRedraw("_moveRight")},"keyup"),this.keycharm.bind("=",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("num+",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("num-",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),this.keycharm.bind("-",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),this.keycharm.bind("[",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),this.keycharm.bind("]",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("pageup",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("pagedown",function(){e.unbindFromRedraw("_zoomOut")},"keyup")))}}]),e}();t["default"]=h},function(e,t,i){var o,n,s;!function(i,r){n=[],o=r,s="function"==typeof o?o.apply(t,n):o,!(void 0!==s&&(e.exports=s))}(this,function(){function e(e){var t,i=e&&e.preventDefault||!1,o=e&&e.container||window,n={},s={keydown:{},keyup:{}},r={};for(t=97;122>=t;t++)r[String.fromCharCode(t)]={code:65+(t-97),shift:!1};for(t=65;90>=t;t++)r[String.fromCharCode(t)]={code:t,shift:!0};for(t=0;9>=t;t++)r[""+t]={code:48+t,shift:!1};for(t=1;12>=t;t++)r["F"+t]={code:111+t,shift:!1};for(t=0;9>=t;t++)r["num"+t]={code:96+t,shift:!1};r["num*"]={code:106,shift:!1},r["num+"]={code:107,shift:!1},r["num-"]={code:109,shift:!1},r["num/"]={code:111,shift:!1},r["num."]={code:110,shift:!1},r.left={code:37,shift:!1},r.up={code:38,shift:!1},r.right={code:39,shift:!1},r.down={code:40,shift:!1},r.space={code:32,shift:!1},r.enter={code:13,shift:!1},r.shift={code:16,shift:void 0},r.esc={code:27,shift:!1},r.backspace={code:8,shift:!1},r.tab={code:9,shift:!1},r.ctrl={code:17,shift:!1},r.alt={code:18,shift:!1},r["delete"]={code:46,shift:!1},r.pageup={code:33,shift:!1},r.pagedown={code:34,shift:!1},r["="]={code:187,shift:!1},r["-"]={code:189,shift:!1},r["]"]={code:221,shift:!1},r["["]={code:219,shift:!1};var a=function(e){d(e,"keydown")},h=function(e){d(e,"keyup")},d=function(e,t){if(void 0!==s[t][e.keyCode]){for(var o=s[t][e.keyCode],n=0;n<o.length;n++)void 0===o[n].shift?o[n].fn(e):1==o[n].shift&&1==e.shiftKey?o[n].fn(e):0==o[n].shift&&0==e.shiftKey&&o[n].fn(e);1==i&&e.preventDefault()}};return n.bind=function(e,t,i){if(void 0===i&&(i="keydown"),void 0===r[e])throw new Error("unsupported key: "+e);void 0===s[i][r[e].code]&&(s[i][r[e].code]=[]),s[i][r[e].code].push({fn:t,shift:r[e].shift})},n.bindAll=function(e,t){void 0===t&&(t="keydown");for(var i in r)r.hasOwnProperty(i)&&n.bind(i,e,t)},n.getKey=function(e){for(var t in r)if(r.hasOwnProperty(t)){if(1==e.shiftKey&&1==r[t].shift&&e.keyCode==r[t].code)return t;if(0==e.shiftKey&&0==r[t].shift&&e.keyCode==r[t].code)return t;if(e.keyCode==r[t].code&&"shift"==t)return t}return"unknown key, currently not supported"},n.unbind=function(e,t,i){if(void 0===i&&(i="keydown"),void 0===r[e])throw new Error("unsupported key: "+e);if(void 0!==t){var o=[],n=s[i][r[e].code];if(void 0!==n)for(var a=0;a<n.length;a++)n[a].fn==t&&n[a].shift==r[e].shift||o.push(s[i][r[e].code][a]);s[i][r[e].code]=o}else s[i][r[e].code]=[]},n.reset=function(){s={keydown:{},keyup:{}}},n.destroy=function(){s={keydown:{},keyup:{}},o.removeEventListener("keydown",a,!0),o.removeEventListener("keyup",h,!0)},o.addEventListener("keydown",a,!0),o.addEventListener("keyup",h,!0),n}return e})},function(e,t){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),n=function(){function e(t){i(this,e),this.container=t,this.x=0,this.y=0,this.padding=5,this.hidden=!1,this.frame=document.createElement("div"),this.frame.className="vis-network-tooltip",this.container.appendChild(this.frame)}return o(e,[{key:"setPosition",value:function(e,t){this.x=parseInt(e),this.y=parseInt(t)}},{key:"setText",value:function(e){e instanceof Element?(this.frame.innerHTML="",this.frame.appendChild(e)):this.frame.innerHTML=e}},{key:"show",value:function(e){if(void 0===e&&(e=!0),e===!0){var t=this.frame.clientHeight,i=this.frame.clientWidth,o=this.frame.parentNode.clientHeight,n=this.frame.parentNode.clientWidth,s=this.y-t;s+t+this.padding>o&&(s=o-t-this.padding),s<this.padding&&(s=this.padding);var r=this.x;r+i+this.padding>n&&(r=n-i-this.padding),r<this.padding&&(r=this.padding),this.frame.style.left=r+"px",this.frame.style.top=s+"px",this.frame.style.visibility="visible",this.hidden=!1}else this.hide()}},{key:"hide",value:function(){this.hidden=!0,this.frame.style.visibility="hidden"}}]),e}();t["default"]=n},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),r=i(15),a=o(r),h=i(36),d=o(h),l=i(1),c=function(){function e(t,i){var o=this;n(this,e),this.body=t,this.canvas=i,this.selectionObj={nodes:[],edges:[]},this.hoverObj={nodes:{},edges:{}},this.options={},this.defaultOptions={multiselect:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0},l.extend(this.options,this.defaultOptions),this.body.emitter.on("_dataChanged",function(){o.updateSelection()})}return s(e,[{key:"setOptions",value:function(e){if(void 0!==e){var t=["multiselect","hoverConnectedEdges","selectable","selectConnectedEdges"];l.selectiveDeepExtend(t,this.options,e)}}},{key:"selectOnPoint",value:function(e){var t=!1;if(this.options.selectable===!0){var i=this.getNodeAt(e)||this.getEdgeAt(e);this.unselectAll(),void 0!==i&&(t=this.selectObject(i)),this.body.emitter.emit("_requestRedraw")}return t}},{key:"selectAdditionalOnPoint",value:function(e){var t=!1;if(this.options.selectable===!0){var i=this.getNodeAt(e)||this.getEdgeAt(e);void 0!==i&&(t=!0,i.isSelected()===!0?this.deselectObject(i):this.selectObject(i),this.body.emitter.emit("_requestRedraw"))}return t}},{key:"_generateClickEvent",value:function(e,t,i,o){var n=arguments.length<=4||void 0===arguments[4]?!1:arguments[4],s=void 0;s=n===!0?{nodes:[],edges:[]}:this.getSelection(),s.pointer={DOM:{x:i.x,y:i.y},canvas:this.canvas.DOMtoCanvas(i)},s.event=t,void 0!==o&&(s.previousSelection=o),this.body.emitter.emit(e,s)}},{key:"selectObject",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?this.options.selectConnectedEdges:arguments[1];return void 0!==e?(e instanceof a["default"]&&t===!0&&this._selectConnectedEdges(e),e.select(),this._addToSelection(e),!0):!1}},{key:"deselectObject",value:function(e){e.isSelected()===!0&&(e.selected=!1,this._removeFromSelection(e))}},{key:"_getAllNodesOverlappingWith",value:function(e){for(var t=[],i=this.body.nodes,o=0;o<this.body.nodeIndices.length;o++){var n=this.body.nodeIndices[o];i[n].isOverlappingWith(e)&&t.push(n)}return t}},{key:"_pointerToPositionObject",value:function(e){var t=this.canvas.DOMtoCanvas(e);return{left:t.x-1,top:t.y+1,right:t.x+1,bottom:t.y-1}}},{key:"getNodeAt",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?!0:arguments[1],i=this._pointerToPositionObject(e),o=this._getAllNodesOverlappingWith(i);return o.length>0?t===!0?this.body.nodes[o[o.length-1]]:o[o.length-1]:void 0}},{key:"_getEdgesOverlappingWith",value:function(e,t){for(var i=this.body.edges,o=0;o<this.body.edgeIndices.length;o++){var n=this.body.edgeIndices[o];i[n].isOverlappingWith(e)&&t.push(n)}}},{key:"_getAllEdgesOverlappingWith",value:function(e){var t=[];return this._getEdgesOverlappingWith(e,t),t}},{key:"getEdgeAt",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?!0:arguments[1],i=this._pointerToPositionObject(e),o=this._getAllEdgesOverlappingWith(i);return o.length>0?t===!0?this.body.edges[o[o.length-1]]:o[o.length-1]:void 0}},{key:"_addToSelection",value:function(e){e instanceof a["default"]?this.selectionObj.nodes[e.id]=e:this.selectionObj.edges[e.id]=e}},{key:"_addToHover",value:function(e){e instanceof a["default"]?this.hoverObj.nodes[e.id]=e:this.hoverObj.edges[e.id]=e}},{key:"_removeFromSelection",value:function(e){e instanceof a["default"]?(delete this.selectionObj.nodes[e.id],this._unselectConnectedEdges(e)):delete this.selectionObj.edges[e.id]}},{key:"unselectAll",value:function(){for(var e in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(e)&&this.selectionObj.nodes[e].unselect();for(var t in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(t)&&this.selectionObj.edges[t].unselect();this.selectionObj={nodes:{},edges:{}}}},{key:"_getSelectedNodeCount",value:function(){var e=0;for(var t in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(t)&&(e+=1);return e}},{key:"_getSelectedNode",value:function(){for(var e in this.selectionObj.nodes)if(this.selectionObj.nodes.hasOwnProperty(e))return this.selectionObj.nodes[e]}},{key:"_getSelectedEdge",value:function(){for(var e in this.selectionObj.edges)if(this.selectionObj.edges.hasOwnProperty(e))return this.selectionObj.edges[e]}},{key:"_getSelectedEdgeCount",value:function(){var e=0;for(var t in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(t)&&(e+=1);return e}},{key:"_getSelectedObjectCount",value:function(){var e=0;for(var t in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(t)&&(e+=1);for(var i in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(i)&&(e+=1);return e}},{key:"_selectionIsEmpty",value:function(){for(var e in this.selectionObj.nodes)if(this.selectionObj.nodes.hasOwnProperty(e))return!1;for(var t in this.selectionObj.edges)if(this.selectionObj.edges.hasOwnProperty(t))return!1;return!0}},{key:"_clusterInSelection",value:function(){for(var e in this.selectionObj.nodes)if(this.selectionObj.nodes.hasOwnProperty(e)&&this.selectionObj.nodes[e].clusterSize>1)return!0;return!1}},{key:"_selectConnectedEdges",value:function(e){for(var t=0;t<e.edges.length;t++){var i=e.edges[t];i.select(),this._addToSelection(i)}}},{key:"_hoverConnectedEdges",value:function(e){for(var t=0;t<e.edges.length;t++){var i=e.edges[t];i.hover=!0,this._addToHover(i)}}},{key:"_unselectConnectedEdges",value:function(e){for(var t=0;t<e.edges.length;t++){var i=e.edges[t];i.unselect(),this._removeFromSelection(i)}}},{key:"blurObject",value:function(e){e.hover===!0&&(e.hover=!1,e instanceof a["default"]?this.body.emitter.emit("blurNode",{node:e.id}):this.body.emitter.emit("blurEdge",{edge:e.id}))}},{key:"hoverObject",value:function(e){var t=!1;for(var i in this.hoverObj.nodes)this.hoverObj.nodes.hasOwnProperty(i)&&(void 0===e||e instanceof a["default"]&&e.id!=i||e instanceof d["default"])&&(this.blurObject(this.hoverObj.nodes[i]),delete this.hoverObj.nodes[i],t=!0);for(var o in this.hoverObj.edges)this.hoverObj.edges.hasOwnProperty(o)&&(t===!0?(this.hoverObj.edges[o].hover=!1,delete this.hoverObj.edges[o]):void 0===e&&(this.blurObject(this.hoverObj.edges[o]),delete this.hoverObj.edges[o],t=!0));void 0!==e&&(e.hover===!1&&(e.hover=!0,this._addToHover(e),t=!0,e instanceof a["default"]?this.body.emitter.emit("hoverNode",{node:e.id}):this.body.emitter.emit("hoverEdge",{edge:e.id})),e instanceof a["default"]&&this.options.hoverConnectedEdges===!0&&this._hoverConnectedEdges(e)),t===!0&&this.body.emitter.emit("_requestRedraw")}},{key:"getSelection",value:function(){var e=this.getSelectedNodes(),t=this.getSelectedEdges();return{nodes:e,edges:t}}},{key:"getSelectedNodes",value:function(){var e=[];if(this.options.selectable===!0)for(var t in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(t)&&e.push(this.selectionObj.nodes[t].id);return e}},{key:"getSelectedEdges",value:function(){var e=[];if(this.options.selectable===!0)for(var t in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(t)&&e.push(this.selectionObj.edges[t].id);return e}},{key:"setSelection",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=void 0,o=void 0;if(!e||!e.nodes&&!e.edges)throw"Selection must be an object with nodes and/or edges properties";if((t.unselectAll||void 0===t.unselectAll)&&this.unselectAll(),e.nodes)for(i=0;i<e.nodes.length;i++){o=e.nodes[i];var n=this.body.nodes[o];if(!n)throw new RangeError('Node with id "'+o+'" not found');this.selectObject(n,t.highlightEdges)}if(e.edges)for(i=0;i<e.edges.length;i++){o=e.edges[i];var s=this.body.edges[o];if(!s)throw new RangeError('Edge with id "'+o+'" not found');this.selectObject(s)}this.body.emitter.emit("_requestRedraw")}},{key:"selectNodes",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?!0:arguments[1];if(!e||void 0===e.length)throw"Selection must be an array with ids";this.setSelection({nodes:e},{highlightEdges:t})}},{key:"selectEdges",value:function(e){if(!e||void 0===e.length)throw"Selection must be an array with ids";this.setSelection({edges:e})}},{key:"updateSelection",value:function(){for(var e in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(e)&&(this.body.nodes.hasOwnProperty(e)||delete this.selectionObj.nodes[e]);for(var t in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(t)&&(this.body.edges.hasOwnProperty(t)||delete this.selectionObj.edges[t])}}]),e}();t["default"]=c},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){var i=[],o=!0,n=!1,s=void 0;try{for(var r,a=e[Symbol.iterator]();!(o=(r=a.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(h){n=!0,s=h}finally{try{!o&&a["return"]&&a["return"]()}finally{if(n)throw s}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},a=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(54),d=o(h),l=i(1),c=function(){function e(t){n(this,e),this.body=t,this.initialRandomSeed=Math.round(1e6*Math.random()),this.randomSeed=this.initialRandomSeed,this.setPhysics=!1,this.options={},this.optionsBackup={physics:{}},this.defaultOptions={randomSeed:void 0,improvedLayout:!0,hierarchical:{enabled:!1,levelSeparation:150,nodeSpacing:100,treeSpacing:200,blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:"UD",sortMethod:"hubsize"}},l.extend(this.options,this.defaultOptions),this.bindEventListeners()}return a(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("_dataChanged",function(){e.setupHierarchicalLayout()}),this.body.emitter.on("_dataLoaded",function(){e.layoutNetwork()}),this.body.emitter.on("_resetHierarchicalLayout",function(){e.setupHierarchicalLayout()})}},{key:"setOptions",value:function(e,t){if(void 0!==e){var i=this.options.hierarchical.enabled;if(l.selectiveDeepExtend(["randomSeed","improvedLayout"],this.options,e),l.mergeOptions(this.options,e,"hierarchical"),void 0!==e.randomSeed&&(this.initialRandomSeed=e.randomSeed),this.options.hierarchical.enabled===!0)return i===!0&&this.body.emitter.emit("refresh",!0),"RL"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?this.options.hierarchical.levelSeparation>0&&(this.options.hierarchical.levelSeparation*=-1):this.options.hierarchical.levelSeparation<0&&(this.options.hierarchical.levelSeparation*=-1),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(t);if(i===!0)return this.body.emitter.emit("refresh"),l.deepExtend(t,this.optionsBackup)}return t}},{key:"adaptAllOptionsForHierarchicalLayout",value:function(e){if(this.options.hierarchical.enabled===!0){void 0===e.physics||e.physics===!0?(e.physics={enabled:void 0===this.optionsBackup.physics.enabled?!0:this.optionsBackup.physics.enabled,solver:"hierarchicalRepulsion"},this.optionsBackup.physics.enabled=void 0===this.optionsBackup.physics.enabled?!0:this.optionsBackup.physics.enabled,this.optionsBackup.physics.solver=this.optionsBackup.physics.solver||"barnesHut"):"object"===r(e.physics)?(this.optionsBackup.physics.enabled=void 0===e.physics.enabled?!0:e.physics.enabled,this.optionsBackup.physics.solver=e.physics.solver||"barnesHut",e.physics.solver="hierarchicalRepulsion"):e.physics!==!1&&(this.optionsBackup.physics.solver="barnesHut",e.physics={solver:"hierarchicalRepulsion"});var t="horizontal";"RL"!==this.options.hierarchical.direction&&"LR"!==this.options.hierarchical.direction||(t="vertical"),void 0===e.edges?(this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges={smooth:!1}):void 0===e.edges.smooth?(this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges.smooth=!1):"boolean"==typeof e.edges.smooth?(this.optionsBackup.edges={smooth:e.edges.smooth},e.edges.smooth={enabled:e.edges.smooth,type:t}):(void 0!==e.edges.smooth.type&&"dynamic"!==e.edges.smooth.type&&(t=e.edges.smooth.type),this.optionsBackup.edges={smooth:void 0===e.edges.smooth.enabled?!0:e.edges.smooth.enabled,type:void 0===e.edges.smooth.type?"dynamic":e.edges.smooth.type,roundness:void 0===e.edges.smooth.roundness?.5:e.edges.smooth.roundness,forceDirection:void 0===e.edges.smooth.forceDirection?!1:e.edges.smooth.forceDirection},e.edges.smooth={enabled:void 0===e.edges.smooth.enabled?!0:e.edges.smooth.enabled,type:t,roundness:void 0===e.edges.smooth.roundness?.5:e.edges.smooth.roundness,forceDirection:void 0===e.edges.smooth.forceDirection?!1:e.edges.smooth.forceDirection}),this.body.emitter.emit("_forceDisableDynamicCurves",t)}return e}},{key:"seededRandom",value:function(){var e=1e4*Math.sin(this.randomSeed++);return e-Math.floor(e)}},{key:"positionInitially",value:function(e){if(this.options.hierarchical.enabled!==!0){this.randomSeed=this.initialRandomSeed;for(var t=0;t<e.length;t++){var i=e[t],o=1*e.length+10,n=2*Math.PI*this.seededRandom();void 0===i.x&&(i.x=o*Math.cos(n)),void 0===i.y&&(i.y=o*Math.sin(n))}}}},{key:"layoutNetwork",value:function(){if(this.options.hierarchical.enabled!==!0&&this.options.improvedLayout===!0){for(var e=0,t=0;t<this.body.nodeIndices.length;t++){var i=this.body.nodes[this.body.nodeIndices[t]];i.predefinedPosition===!0&&(e+=1)}if(e<.5*this.body.nodeIndices.length){var o=10,n=0,s=100;if(this.body.nodeIndices.length>s){for(var r=this.body.nodeIndices.length;this.body.nodeIndices.length>s;){n+=1;var a=this.body.nodeIndices.length;n%3===0?this.body.modules.clustering.clusterBridges():this.body.modules.clustering.clusterOutliers();var h=this.body.nodeIndices.length;if(a==h&&n%3!==0||n>o)return this._declusterAll(),this.body.emitter.emit("_layoutFailed"),void console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.")}this.body.modules.kamadaKawai.setOptions({springLength:Math.max(150,2*r)})}this.body.modules.kamadaKawai.solve(this.body.nodeIndices,this.body.edgeIndices,!0),this._shiftToCenter();for(var d=70,l=0;l<this.body.nodeIndices.length;l++)this.body.nodes[this.body.nodeIndices[l]].x+=(.5-this.seededRandom())*d,this.body.nodes[this.body.nodeIndices[l]].y+=(.5-this.seededRandom())*d;this._declusterAll(),this.body.emitter.emit("_repositionBezierNodes")}}}},{key:"_shiftToCenter",value:function(){for(var e=d["default"].getRangeCore(this.body.nodes,this.body.nodeIndices),t=d["default"].findCenter(e),i=0;i<this.body.nodeIndices.length;i++)this.body.nodes[this.body.nodeIndices[i]].x-=t.x,this.body.nodes[this.body.nodeIndices[i]].y-=t.y}},{key:"_declusterAll",value:function(){for(var e=!0;e===!0;){e=!1;for(var t=0;t<this.body.nodeIndices.length;t++)this.body.nodes[this.body.nodeIndices[t]].isCluster===!0&&(e=!0,this.body.modules.clustering.openCluster(this.body.nodeIndices[t],{},!1));e===!0&&this.body.emitter.emit("_dataChanged")}}},{key:"getSeed",value:function(){return this.initialRandomSeed}},{key:"setupHierarchicalLayout",value:function(){if(this.options.hierarchical.enabled===!0&&this.body.nodeIndices.length>0){var e=void 0,t=void 0,i=!1,o=!0,n=!1;this.hierarchicalLevels={},this.lastNodeOnLevel={},this.hierarchicalChildrenReference={},this.hierarchicalParentReference={},this.hierarchicalTrees={},this.treeIndex=-1,this.distributionOrdering={},this.distributionIndex={},this.distributionOrderingPresence={};for(t in this.body.nodes)this.body.nodes.hasOwnProperty(t)&&(e=this.body.nodes[t],void 0===e.options.x&&void 0===e.options.y&&(o=!1),void 0!==e.options.level?(i=!0,this.hierarchicalLevels[t]=e.options.level):n=!0);if(n===!0&&i===!0)throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");
-n===!0&&("hubsize"===this.options.hierarchical.sortMethod?this._determineLevelsByHubsize():"directed"===this.options.hierarchical.sortMethod?this._determineLevelsDirected():"custom"===this.options.hierarchical.sortMethod&&this._determineLevelsCustomCallback());for(var s in this.body.nodes)this.body.nodes.hasOwnProperty(s)&&void 0===this.hierarchicalLevels[s]&&(this.hierarchicalLevels[s]=0);var r=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(r),this._condenseHierarchy(),this._shiftToCenter()}}},{key:"_condenseHierarchy",value:function(){var e=this,t=!1,i={},o=function(){for(var t=a(),i=0;i<t.length-1;i++){var o=t[i].max-t[i+1].min;n(i+1,o+e.options.hierarchical.treeSpacing)}},n=function(t,i){for(var o in e.hierarchicalTrees)if(e.hierarchicalTrees.hasOwnProperty(o)&&e.hierarchicalTrees[o]===t){var n=e.body.nodes[o],s=e._getPositionForHierarchy(n);e._setPositionForHierarchy(n,s+i,void 0,!0)}},r=function(t){var i=1e9,o=-1e9;for(var n in e.hierarchicalTrees)if(e.hierarchicalTrees.hasOwnProperty(n)&&e.hierarchicalTrees[n]===t){var s=e._getPositionForHierarchy(e.body.nodes[n]);i=Math.min(s,i),o=Math.max(s,o)}return{min:i,max:o}},a=function(){for(var t=[],i=0;i<=e.treeIndex;i++)t.push(r(i));return t},h=function _(t,i){if(i[t.id]=!0,e.hierarchicalChildrenReference[t.id]){var o=e.hierarchicalChildrenReference[t.id];if(o.length>0)for(var n=0;n<o.length;n++)_(e.body.nodes[o[n]],i)}},d=function(t){var i=arguments.length<=1||void 0===arguments[1]?1e9:arguments[1],o=1e9,n=1e9,r=1e9,a=-1e9;for(var h in t)if(t.hasOwnProperty(h)){var d=e.body.nodes[h],l=e.hierarchicalLevels[d.id],c=e._getPositionForHierarchy(d),u=e._getSpaceAroundNode(d,t),f=s(u,2),p=f[0],v=f[1];o=Math.min(p,o),n=Math.min(v,n),i>=l&&(r=Math.min(c,r),a=Math.max(c,a))}return[r,a,o,n]},l=function w(t){var i=e.hierarchicalLevels[t];if(e.hierarchicalChildrenReference[t]){var o=e.hierarchicalChildrenReference[t];if(o.length>0)for(var n=0;n<o.length;n++)i=Math.max(i,w(o[n]))}return i},c=function(e,t){var i=l(e.id),o=l(t.id);return Math.min(i,o)},u=function(t,i){var o=e.hierarchicalParentReference[t.id],n=e.hierarchicalParentReference[i.id];if(void 0===o||void 0===n)return!1;for(var s=0;s<o.length;s++)for(var r=0;r<n.length;r++)if(o[s]==n[r])return!0;return!1},f=function(t,i,o){for(var n=0;n<i.length;n++){var s=i[n],r=e.distributionOrdering[s];if(r.length>1)for(var a=0;a<r.length-1;a++)u(r[a],r[a+1])===!0&&e.hierarchicalTrees[r[a].id]===e.hierarchicalTrees[r[a+1].id]&&t(r[a],r[a+1],o)}},p=function(i,o){var n=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],r=e._getPositionForHierarchy(i),a=e._getPositionForHierarchy(o),l=Math.abs(a-r);if(l>e.options.hierarchical.nodeSpacing){var u={};u[i.id]=!0;var f={};f[o.id]=!0,h(i,u),h(o,f);var p=c(i,o),v=d(u,p),y=s(v,4),g=(y[0],y[1]),b=(y[2],y[3],d(f,p)),m=s(b,4),_=m[0],w=(m[1],m[2]),k=(m[3],Math.abs(g-_));if(k>e.options.hierarchical.nodeSpacing){var x=g-_+e.options.hierarchical.nodeSpacing;x<-w+e.options.hierarchical.nodeSpacing&&(x=-w+e.options.hierarchical.nodeSpacing),0>x&&(e._shiftBlock(o.id,x),t=!0,n===!0&&e._centerParent(o))}}},v=function(o,n){for(var r=n.id,a=n.edges,l=e.hierarchicalLevels[n.id],c=e.options.hierarchical.levelSeparation*e.options.hierarchical.levelSeparation,u={},f=[],p=0;p<a.length;p++){var v=a[p];if(v.toId!=v.fromId){var y=v.toId==r?v.from:v.to;u[a[p].id]=y,e.hierarchicalLevels[y.id]<l&&f.push(v)}}var g=function(t,i){for(var o=0,n=0;n<i.length;n++)if(void 0!==u[i[n].id]){var s=e._getPositionForHierarchy(u[i[n].id])-t;o+=s/Math.sqrt(s*s+c)}return o},b=function(t,i){for(var o=0,n=0;n<i.length;n++)if(void 0!==u[i[n].id]){var s=e._getPositionForHierarchy(u[i[n].id])-t;o-=c*Math.pow(s*s+c,-1.5)}return o},m=function(t,i){for(var o=e._getPositionForHierarchy(n),s={},r=0;t>r;r++){var a=g(o,i),h=b(o,i),d=40,l=Math.max(-d,Math.min(d,Math.round(a/h)));if(o-=l,void 0!==s[o])break;s[o]=r}return o},_=function(o){var r=e._getPositionForHierarchy(n);if(void 0===i[n.id]){var a={};a[n.id]=!0,h(n,a),i[n.id]=a}var l=d(i[n.id]),c=s(l,4),u=(c[0],c[1],c[2]),f=c[3],p=o-r,v=0;p>0?v=Math.min(p,f-e.options.hierarchical.nodeSpacing):0>p&&(v=-Math.min(-p,u-e.options.hierarchical.nodeSpacing)),0!=v&&(e._shiftBlock(n.id,v),t=!0)},w=function(i){var o=e._getPositionForHierarchy(n),r=e._getSpaceAroundNode(n),a=s(r,2),h=a[0],d=a[1],l=i-o,c=o;l>0?c=Math.min(o+(d-e.options.hierarchical.nodeSpacing),i):0>l&&(c=Math.max(o-(h-e.options.hierarchical.nodeSpacing),i)),c!==o&&(e._setPositionForHierarchy(n,c,void 0,!0),t=!0)},k=m(o,f);_(k),k=m(o,a),w(k)},y=function(i){var o=Object.keys(e.distributionOrdering);o=o.reverse();for(var n=0;i>n;n++){t=!1;for(var s=0;s<o.length;s++)for(var r=o[s],a=e.distributionOrdering[r],h=0;h<a.length;h++)v(1e3,a[h]);if(t!==!0)break}},g=function(i){var o=Object.keys(e.distributionOrdering);o=o.reverse();for(var n=0;i>n&&(t=!1,f(p,o,!0),t===!0);n++);},b=function(){for(var t in e.body.nodes)e.body.nodes.hasOwnProperty(t)&&e._centerParent(e.body.nodes[t])},m=function(){var t=Object.keys(e.distributionOrdering);t=t.reverse();for(var i=0;i<t.length;i++)for(var o=t[i],n=e.distributionOrdering[o],s=0;s<n.length;s++)e._centerParent(n[s])};this.options.hierarchical.blockShifting===!0&&(g(5),b()),this.options.hierarchical.edgeMinimization===!0&&y(20),this.options.hierarchical.parentCentralization===!0&&m(),o()}},{key:"_getSpaceAroundNode",value:function(e,t){var i=!0;void 0===t&&(i=!1);var o=this.hierarchicalLevels[e.id];if(void 0!==o){var n=this.distributionIndex[e.id],s=this._getPositionForHierarchy(e),r=1e9,a=1e9;if(0!==n){var h=this.distributionOrdering[o][n-1];if(i===!0&&void 0===t[h.id]||i===!1){var d=this._getPositionForHierarchy(h);r=s-d}}if(n!=this.distributionOrdering[o].length-1){var l=this.distributionOrdering[o][n+1];if(i===!0&&void 0===t[l.id]||i===!1){var c=this._getPositionForHierarchy(l);a=Math.min(a,c-s)}}return[r,a]}return[0,0]}},{key:"_centerParent",value:function(e){if(this.hierarchicalParentReference[e.id])for(var t=this.hierarchicalParentReference[e.id],i=0;i<t.length;i++){var o=t[i],n=this.body.nodes[o];if(this.hierarchicalChildrenReference[o]){var r=1e9,a=-1e9,h=this.hierarchicalChildrenReference[o];if(h.length>0)for(var d=0;d<h.length;d++){var l=this.body.nodes[h[d]];r=Math.min(r,this._getPositionForHierarchy(l)),a=Math.max(a,this._getPositionForHierarchy(l))}var c=this._getPositionForHierarchy(n),u=this._getSpaceAroundNode(n),f=s(u,2),p=f[0],v=f[1],y=.5*(r+a),g=c-y;(0>g&&Math.abs(g)<v-this.options.hierarchical.nodeSpacing||g>0&&Math.abs(g)<p-this.options.hierarchical.nodeSpacing)&&this._setPositionForHierarchy(n,y,void 0,!0)}}}},{key:"_placeNodesByHierarchy",value:function(e){this.positionedNodes={};for(var t in e)if(e.hasOwnProperty(t)){var i=Object.keys(e[t]);i=this._indexArrayToNodes(i),this._sortNodeArray(i);for(var o=0,n=0;n<i.length;n++){var s=i[n];if(void 0===this.positionedNodes[s.id]){var r=this.options.hierarchical.nodeSpacing*o;o>0&&(r=this._getPositionForHierarchy(i[n-1])+this.options.hierarchical.nodeSpacing),this._setPositionForHierarchy(s,r,t),this._validataPositionAndContinue(s,t,r),o++}}}}},{key:"_placeBranchNodes",value:function(e,t){if(void 0!==this.hierarchicalChildrenReference[e]){for(var i=[],o=0;o<this.hierarchicalChildrenReference[e].length;o++)i.push(this.body.nodes[this.hierarchicalChildrenReference[e][o]]);this._sortNodeArray(i);for(var n=0;n<i.length;n++){var s=i[n],r=this.hierarchicalLevels[s.id];if(!(r>t&&void 0===this.positionedNodes[s.id]))return;var a=void 0;a=0===n?this._getPositionForHierarchy(this.body.nodes[e]):this._getPositionForHierarchy(i[n-1])+this.options.hierarchical.nodeSpacing,this._setPositionForHierarchy(s,a,r),this._validataPositionAndContinue(s,r,a)}for(var h=1e9,d=-1e9,l=0;l<i.length;l++){var c=i[l].id;h=Math.min(h,this._getPositionForHierarchy(this.body.nodes[c])),d=Math.max(d,this._getPositionForHierarchy(this.body.nodes[c]))}this._setPositionForHierarchy(this.body.nodes[e],.5*(h+d),t)}}},{key:"_validataPositionAndContinue",value:function(e,t,i){if(void 0!==this.lastNodeOnLevel[t]){var o=this._getPositionForHierarchy(this.body.nodes[this.lastNodeOnLevel[t]]);if(i-o<this.options.hierarchical.nodeSpacing){var n=o+this.options.hierarchical.nodeSpacing-i,s=this._findCommonParent(this.lastNodeOnLevel[t],e.id);this._shiftBlock(s.withChild,n)}}this.lastNodeOnLevel[t]=e.id,this.positionedNodes[e.id]=!0,this._placeBranchNodes(e.id,t)}},{key:"_indexArrayToNodes",value:function(e){for(var t=[],i=0;i<e.length;i++)t.push(this.body.nodes[e[i]]);return t}},{key:"_getDistribution",value:function(){var e={},t=void 0,i=void 0;for(t in this.body.nodes)if(this.body.nodes.hasOwnProperty(t)){i=this.body.nodes[t];var o=void 0===this.hierarchicalLevels[t]?0:this.hierarchicalLevels[t];"UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?(i.y=this.options.hierarchical.levelSeparation*o,i.options.fixed.y=!0):(i.x=this.options.hierarchical.levelSeparation*o,i.options.fixed.x=!0),void 0===e[o]&&(e[o]={}),e[o][t]=i}return e}},{key:"_getHubSize",value:function(){var e=0;for(var t in this.body.nodes)if(this.body.nodes.hasOwnProperty(t)){var i=this.body.nodes[t];void 0===this.hierarchicalLevels[t]&&(e=i.edges.length<e?e:i.edges.length)}return e}},{key:"_determineLevelsByHubsize",value:function(){for(var e=this,t=1,i=function(t,i){void 0===e.hierarchicalLevels[i.id]&&(void 0===e.hierarchicalLevels[t.id]&&(e.hierarchicalLevels[t.id]=0),e.hierarchicalLevels[i.id]=e.hierarchicalLevels[t.id]+1)};t>0&&(t=this._getHubSize(),0!==t);)for(var o in this.body.nodes)if(this.body.nodes.hasOwnProperty(o)){var n=this.body.nodes[o];n.edges.length===t&&this._crawlNetwork(i,o)}}},{key:"_determineLevelsCustomCallback",value:function(){var e=this,t=1e5,i=function(e,t,i){},o=function(o,n,s){var r=e.hierarchicalLevels[o.id];void 0===r&&(e.hierarchicalLevels[o.id]=t);var a=i(d["default"].cloneOptions(o,"node"),d["default"].cloneOptions(n,"node"),d["default"].cloneOptions(s,"edge"));e.hierarchicalLevels[n.id]=e.hierarchicalLevels[o.id]+a};this._crawlNetwork(o),this._setMinLevelToZero()}},{key:"_determineLevelsDirected",value:function(){var e=this,t=1e4,i=function(i,o,n){var s=e.hierarchicalLevels[i.id];void 0===s&&(e.hierarchicalLevels[i.id]=t),n.toId==o.id?e.hierarchicalLevels[o.id]=e.hierarchicalLevels[i.id]+1:e.hierarchicalLevels[o.id]=e.hierarchicalLevels[i.id]-1};this._crawlNetwork(i),this._setMinLevelToZero()}},{key:"_setMinLevelToZero",value:function(){var e=1e9;for(var t in this.body.nodes)this.body.nodes.hasOwnProperty(t)&&void 0!==this.hierarchicalLevels[t]&&(e=Math.min(this.hierarchicalLevels[t],e));for(var i in this.body.nodes)this.body.nodes.hasOwnProperty(i)&&void 0!==this.hierarchicalLevels[i]&&(this.hierarchicalLevels[i]-=e)}},{key:"_generateMap",value:function(){var e=this,t=function(t,i){if(e.hierarchicalLevels[i.id]>e.hierarchicalLevels[t.id]){var o=t.id,n=i.id;void 0===e.hierarchicalChildrenReference[o]&&(e.hierarchicalChildrenReference[o]=[]),e.hierarchicalChildrenReference[o].push(n),void 0===e.hierarchicalParentReference[n]&&(e.hierarchicalParentReference[n]=[]),e.hierarchicalParentReference[n].push(o)}};this._crawlNetwork(t)}},{key:"_crawlNetwork",value:function(){var e=this,t=arguments.length<=0||void 0===arguments[0]?function(){}:arguments[0],i=arguments[1],o={},n=0,s=function d(i,n){if(void 0===o[i.id]){void 0===e.hierarchicalTrees[i.id]&&(e.hierarchicalTrees[i.id]=n,e.treeIndex=Math.max(n,e.treeIndex)),o[i.id]=!0;for(var s=void 0,r=0;r<i.edges.length;r++)i.edges[r].connected===!0&&(s=i.edges[r].toId===i.id?i.edges[r].from:i.edges[r].to,i.id!==s.id&&(t(i,s,i.edges[r]),d(s,n)))}};if(void 0===i)for(var r=0;r<this.body.nodeIndices.length;r++){var a=this.body.nodes[this.body.nodeIndices[r]];void 0===o[a.id]&&(s(a,n),n+=1)}else{var h=this.body.nodes[i];if(void 0===h)return void console.error("Node not found:",i);s(h)}}},{key:"_shiftBlock",value:function(e,t){if("UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?this.body.nodes[e].x+=t:this.body.nodes[e].y+=t,void 0!==this.hierarchicalChildrenReference[e])for(var i=0;i<this.hierarchicalChildrenReference[e].length;i++)this._shiftBlock(this.hierarchicalChildrenReference[e][i],t)}},{key:"_findCommonParent",value:function(e,t){var i=this,o={},n=function r(e,t){if(void 0!==i.hierarchicalParentReference[t])for(var o=0;o<i.hierarchicalParentReference[t].length;o++){var n=i.hierarchicalParentReference[t][o];e[n]=!0,r(e,n)}},s=function a(e,t){if(void 0!==i.hierarchicalParentReference[t])for(var o=0;o<i.hierarchicalParentReference[t].length;o++){var n=i.hierarchicalParentReference[t][o];if(void 0!==e[n])return{foundParent:n,withChild:t};var s=a(e,n);if(null!==s.foundParent)return s}return{foundParent:null,withChild:t}};return n(o,e),s(o,t)}},{key:"_setPositionForHierarchy",value:function(e,t,i){var o=arguments.length<=3||void 0===arguments[3]?!1:arguments[3];o!==!0&&(void 0===this.distributionOrdering[i]&&(this.distributionOrdering[i]=[],this.distributionOrderingPresence[i]={}),void 0===this.distributionOrderingPresence[i][e.id]&&(this.distributionOrdering[i].push(e),this.distributionIndex[e.id]=this.distributionOrdering[i].length-1),this.distributionOrderingPresence[i][e.id]=!0),"UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?e.x=t:e.y=t}},{key:"_getPositionForHierarchy",value:function(e){return"UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?e.x:e.y}},{key:"_sortNodeArray",value:function(e){e.length>1&&("UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?e.sort(function(e,t){return e.x-t.x}):e.sort(function(e,t){return e.y-t.y}))}}]),e}();t["default"]=c},function(e,t,i){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),s=i(1),r=i(58),a=i(61),h=function(){function e(t,i,n){var r=this;o(this,e),this.body=t,this.canvas=i,this.selectionHandler=n,this.editMode=!1,this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0,this.manipulationHammers=[],this.temporaryUIFunctions={},this.temporaryEventFunctions=[],this.touchTime=0,this.temporaryIds={nodes:[],edges:[]},this.guiEnabled=!1,this.inMode=!1,this.selectedControlNode=void 0,this.options={},this.defaultOptions={enabled:!1,initiallyActive:!1,addNode:!0,addEdge:!0,editNode:void 0,editEdge:!0,deleteNode:!0,deleteEdge:!0,controlNodeStyle:{shape:"dot",size:6,color:{background:"#ff0000",border:"#3c3c3c",highlight:{background:"#07f968",border:"#3c3c3c"}},borderWidth:2,borderWidthSelected:2}},s.extend(this.options,this.defaultOptions),this.body.emitter.on("destroy",function(){r._clean()}),this.body.emitter.on("_dataChanged",this._restore.bind(this)),this.body.emitter.on("_resetData",this._restore.bind(this))}return n(e,[{key:"_restore",value:function(){this.inMode!==!1&&(this.options.initiallyActive===!0?this.enableEditMode():this.disableEditMode())}},{key:"setOptions",value:function(e,t,i){void 0!==t&&(void 0!==t.locale?this.options.locale=t.locale:this.options.locale=i.locale,void 0!==t.locales?this.options.locales=t.locales:this.options.locales=i.locales),void 0!==e&&("boolean"==typeof e?this.options.enabled=e:(this.options.enabled=!0,s.deepExtend(this.options,e)),this.options.initiallyActive===!0&&(this.editMode=!0),this._setup())}},{key:"toggleEditMode",value:function(){this.editMode===!0?this.disableEditMode():this.enableEditMode()}},{key:"enableEditMode",value:function(){this.editMode=!0,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="block",this.closeDiv.style.display="block",this.editModeDiv.style.display="none",this.showManipulatorToolbar())}},{key:"disableEditMode",value:function(){this.editMode=!1,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="none",this.closeDiv.style.display="none",this.editModeDiv.style.display="block",this._createEditButton())}},{key:"showManipulatorToolbar",value:function(){if(this._clean(),this.manipulationDOM={},this.guiEnabled===!0){this.editMode=!0,this.manipulationDiv.style.display="block",this.closeDiv.style.display="block";var e=this.selectionHandler._getSelectedNodeCount(),t=this.selectionHandler._getSelectedEdgeCount(),i=e+t,o=this.options.locales[this.options.locale],n=!1;this.options.addNode!==!1&&(this._createAddNodeButton(o),n=!0),this.options.addEdge!==!1&&(n===!0?this._createSeperator(1):n=!0,this._createAddEdgeButton(o)),1===e&&"function"==typeof this.options.editNode?(n===!0?this._createSeperator(2):n=!0,this._createEditNodeButton(o)):1===t&&0===e&&this.options.editEdge!==!1&&(n===!0?this._createSeperator(3):n=!0,this._createEditEdgeButton(o)),0!==i&&(e>0&&this.options.deleteNode!==!1?(n===!0&&this._createSeperator(4),this._createDeleteButton(o)):0===e&&this.options.deleteEdge!==!1&&(n===!0&&this._createSeperator(4),this._createDeleteButton(o))),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this)),this._temporaryBindEvent("select",this.showManipulatorToolbar.bind(this))}this.body.emitter.emit("_redraw")}},{key:"addNodeMode",value:function(){if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addNode",this.guiEnabled===!0){var e=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(e),this._createSeperator(),this._createDescription(e.addDescription||this.options.locales.en.addDescription),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this))}this._temporaryBindEvent("click",this._performAddNode.bind(this))}},{key:"editNode",value:function(){var e=this;this.editMode!==!0&&this.enableEditMode(),this._clean();var t=this.selectionHandler._getSelectedNode();if(void 0!==t){if(this.inMode="editNode","function"!=typeof this.options.editNode)throw new Error("No function has been configured to handle the editing of nodes.");if(t.isCluster!==!0){var i=s.deepExtend({},t.options,!1);if(i.x=t.x,i.y=t.y,2!==this.options.editNode.length)throw new Error("The function for edit does not support two arguments (data, callback)");this.options.editNode(i,function(t){null!==t&&void 0!==t&&"editNode"===e.inMode&&e.body.data.nodes.getDataSet().update(t),e.showManipulatorToolbar()})}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError)}else this.showManipulatorToolbar()}},{key:"addEdgeMode",value:function(){if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addEdge",this.guiEnabled===!0){var e=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(e),this._createSeperator(),this._createDescription(e.edgeDescription||this.options.locales.en.edgeDescription),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this))}this._temporaryBindUI("onTouch",this._handleConnect.bind(this)),this._temporaryBindUI("onDragEnd",this._finishConnect.bind(this)),this._temporaryBindUI("onDrag",this._dragControlNode.bind(this)),this._temporaryBindUI("onRelease",this._finishConnect.bind(this)),this._temporaryBindUI("onDragStart",function(){}),this._temporaryBindUI("onHold",function(){})}},{key:"editEdgeMode",value:function(){var e=this;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="editEdge",this.guiEnabled===!0){var t=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(t),this._createSeperator(),this._createDescription(t.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this))}this.edgeBeingEditedId=this.selectionHandler.getSelectedEdges()[0],void 0!==this.edgeBeingEditedId?!function(){var t=e.body.edges[e.edgeBeingEditedId],i=e._getNewTargetNode(t.from.x,t.from.y),o=e._getNewTargetNode(t.to.x,t.to.y);e.temporaryIds.nodes.push(i.id),e.temporaryIds.nodes.push(o.id),e.body.nodes[i.id]=i,e.body.nodeIndices.push(i.id),e.body.nodes[o.id]=o,e.body.nodeIndices.push(o.id),e._temporaryBindUI("onTouch",e._controlNodeTouch.bind(e)),e._temporaryBindUI("onTap",function(){}),e._temporaryBindUI("onHold",function(){}),e._temporaryBindUI("onDragStart",e._controlNodeDragStart.bind(e)),e._temporaryBindUI("onDrag",e._controlNodeDrag.bind(e)),e._temporaryBindUI("onDragEnd",e._controlNodeDragEnd.bind(e)),e._temporaryBindUI("onMouseMove",function(){}),e._temporaryBindEvent("beforeDrawing",function(e){var n=t.edgeType.findBorderPositions(e);i.selected===!1&&(i.x=n.from.x,i.y=n.from.y),o.selected===!1&&(o.x=n.to.x,o.y=n.to.y)}),e.body.emitter.emit("_redraw")}():this.showManipulatorToolbar()}},{key:"deleteSelected",value:function(){var e=this;this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="delete";var t=this.selectionHandler.getSelectedNodes(),i=this.selectionHandler.getSelectedEdges(),o=void 0;if(t.length>0){for(var n=0;n<t.length;n++)if(this.body.nodes[t[n]].isCluster===!0)return void alert(this.options.locales[this.options.locale].deleteClusterError||this.options.locales.en.deleteClusterError);"function"==typeof this.options.deleteNode&&(o=this.options.deleteNode)}else i.length>0&&"function"==typeof this.options.deleteEdge&&(o=this.options.deleteEdge);if("function"==typeof o){var s={nodes:t,edges:i};if(2!==o.length)throw new Error("The function for delete does not support two arguments (data, callback)");o(s,function(t){null!==t&&void 0!==t&&"delete"===e.inMode?(e.body.data.edges.getDataSet().remove(t.edges),e.body.data.nodes.getDataSet().remove(t.nodes),e.body.emitter.emit("startSimulation"),e.showManipulatorToolbar()):(e.body.emitter.emit("startSimulation"),e.showManipulatorToolbar())})}else this.body.data.edges.getDataSet().remove(i),this.body.data.nodes.getDataSet().remove(t),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()}},{key:"_setup",value:function(){this.options.enabled===!0?(this.guiEnabled=!0,this._createWrappers(),this.editMode===!1?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}},{key:"_createWrappers",value:function(){void 0===this.manipulationDiv&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",this.editMode===!0?this.manipulationDiv.style.display="block":this.manipulationDiv.style.display="none",this.canvas.frame.appendChild(this.manipulationDiv)),void 0===this.editModeDiv&&(this.editModeDiv=document.createElement("div"),this.editModeDiv.className="vis-edit-mode",this.editMode===!0?this.editModeDiv.style.display="none":this.editModeDiv.style.display="block",this.canvas.frame.appendChild(this.editModeDiv)),void 0===this.closeDiv&&(this.closeDiv=document.createElement("div"),this.closeDiv.className="vis-close",this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv))}},{key:"_getNewTargetNode",value:function(e,t){var i=s.deepExtend({},this.options.controlNodeStyle);i.id="targetNode"+s.randomUUID(),i.hidden=!1,i.physics=!1,i.x=e,i.y=t;var o=this.body.functions.createNode(i);return o.shape.boundingBox={left:e,right:e,top:t,bottom:t},o}},{key:"_createEditButton",value:function(){this._clean(),this.manipulationDOM={},s.recursiveDOMDelete(this.editModeDiv);var e=this.options.locales[this.options.locale],t=this._createButton("editMode","vis-button vis-edit vis-edit-mode",e.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(t),this._bindHammerToDiv(t,this.toggleEditMode.bind(this))}},{key:"_clean",value:function(){this.inMode=!1,this.guiEnabled===!0&&(s.recursiveDOMDelete(this.editModeDiv),s.recursiveDOMDelete(this.manipulationDiv),this._cleanManipulatorHammers()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}},{key:"_cleanManipulatorHammers",value:function(){if(0!=this.manipulationHammers.length){for(var e=0;e<this.manipulationHammers.length;e++)this.manipulationHammers[e].destroy();this.manipulationHammers=[]}}},{key:"_removeManipulationDOM",value:function(){this._clean(),s.recursiveDOMDelete(this.manipulationDiv),s.recursiveDOMDelete(this.editModeDiv),s.recursiveDOMDelete(this.closeDiv),this.manipulationDiv&&this.canvas.frame.removeChild(this.manipulationDiv),this.editModeDiv&&this.canvas.frame.removeChild(this.editModeDiv),this.closeDiv&&this.canvas.frame.removeChild(this.closeDiv),this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0}},{key:"_createSeperator",value:function(){var e=arguments.length<=0||void 0===arguments[0]?1:arguments[0];this.manipulationDOM["seperatorLineDiv"+e]=document.createElement("div"),this.manipulationDOM["seperatorLineDiv"+e].className="vis-separator-line",this.manipulationDiv.appendChild(this.manipulationDOM["seperatorLineDiv"+e])}},{key:"_createAddNodeButton",value:function(e){var t=this._createButton("addNode","vis-button vis-add",e.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(t),this._bindHammerToDiv(t,this.addNodeMode.bind(this))}},{key:"_createAddEdgeButton",value:function(e){var t=this._createButton("addEdge","vis-button vis-connect",e.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(t),this._bindHammerToDiv(t,this.addEdgeMode.bind(this))}},{key:"_createEditNodeButton",value:function(e){var t=this._createButton("editNode","vis-button vis-edit",e.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(t),this._bindHammerToDiv(t,this.editNode.bind(this))}},{key:"_createEditEdgeButton",value:function(e){var t=this._createButton("editEdge","vis-button vis-edit",e.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(t),this._bindHammerToDiv(t,this.editEdgeMode.bind(this))}},{key:"_createDeleteButton",value:function(e){if(this.options.rtl)var t="vis-button vis-delete-rtl";else var t="vis-button vis-delete";var i=this._createButton("delete",t,e.del||this.options.locales.en.del);this.manipulationDiv.appendChild(i),this._bindHammerToDiv(i,this.deleteSelected.bind(this))}},{key:"_createBackButton",value:function(e){var t=this._createButton("back","vis-button vis-back",e.back||this.options.locales.en.back);this.manipulationDiv.appendChild(t),this._bindHammerToDiv(t,this.showManipulatorToolbar.bind(this))}},{key:"_createButton",value:function(e,t,i){var o=arguments.length<=3||void 0===arguments[3]?"vis-label":arguments[3];return this.manipulationDOM[e+"Div"]=document.createElement("div"),this.manipulationDOM[e+"Div"].className=t,this.manipulationDOM[e+"Label"]=document.createElement("div"),this.manipulationDOM[e+"Label"].className=o,this.manipulationDOM[e+"Label"].innerHTML=i,this.manipulationDOM[e+"Div"].appendChild(this.manipulationDOM[e+"Label"]),this.manipulationDOM[e+"Div"]}},{key:"_createDescription",value:function(e){this.manipulationDiv.appendChild(this._createButton("description","vis-button vis-none",e))}},{key:"_temporaryBindEvent",value:function(e,t){this.temporaryEventFunctions.push({event:e,boundFunction:t}),this.body.emitter.on(e,t)}},{key:"_temporaryBindUI",value:function(e,t){if(void 0===this.body.eventListeners[e])throw new Error("This UI function does not exist. Typo? You tried: "+e+" possible are: "+JSON.stringify(Object.keys(this.body.eventListeners)));this.temporaryUIFunctions[e]=this.body.eventListeners[e],this.body.eventListeners[e]=t}},{key:"_unbindTemporaryUIs",value:function(){for(var e in this.temporaryUIFunctions)this.temporaryUIFunctions.hasOwnProperty(e)&&(this.body.eventListeners[e]=this.temporaryUIFunctions[e],delete this.temporaryUIFunctions[e]);this.temporaryUIFunctions={}}},{key:"_unbindTemporaryEvents",value:function(){for(var e=0;e<this.temporaryEventFunctions.length;e++){var t=this.temporaryEventFunctions[e].event,i=this.temporaryEventFunctions[e].boundFunction;this.body.emitter.off(t,i)}this.temporaryEventFunctions=[]}},{key:"_bindHammerToDiv",value:function(e,t){var i=new r(e,{});a.onTouch(i,t),this.manipulationHammers.push(i)}},{key:"_cleanupTemporaryNodesAndEdges",value:function(){for(var e=0;e<this.temporaryIds.edges.length;e++){this.body.edges[this.temporaryIds.edges[e]].disconnect(),delete this.body.edges[this.temporaryIds.edges[e]];var t=this.body.edgeIndices.indexOf(this.temporaryIds.edges[e]);-1!==t&&this.body.edgeIndices.splice(t,1)}for(var i=0;i<this.temporaryIds.nodes.length;i++){delete this.body.nodes[this.temporaryIds.nodes[i]];var o=this.body.nodeIndices.indexOf(this.temporaryIds.nodes[i]);-1!==o&&this.body.nodeIndices.splice(o,1)}this.temporaryIds={nodes:[],edges:[]}}},{key:"_controlNodeTouch",value:function(e){this.selectionHandler.unselectAll(),this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=s.extend({},this.body.view.translation)}},{key:"_controlNodeDragStart",value:function(e){var t=this.lastTouch,i=this.selectionHandler._pointerToPositionObject(t),o=this.body.nodes[this.temporaryIds.nodes[0]],n=this.body.nodes[this.temporaryIds.nodes[1]],s=this.body.edges[this.edgeBeingEditedId];this.selectedControlNode=void 0;var r=o.isOverlappingWith(i),a=n.isOverlappingWith(i);r===!0?(this.selectedControlNode=o,s.edgeType.from=o):a===!0&&(this.selectedControlNode=n,s.edgeType.to=n),void 0!==this.selectedControlNode&&this.selectionHandler.selectObject(this.selectedControlNode),this.body.emitter.emit("_redraw")}},{key:"_controlNodeDrag",value:function(e){this.body.emitter.emit("disablePhysics");var t=this.body.functions.getPointer(e.center),i=this.canvas.DOMtoCanvas(t);if(void 0!==this.selectedControlNode)this.selectedControlNode.x=i.x,this.selectedControlNode.y=i.y;else{var o=t.x-this.lastTouch.x,n=t.y-this.lastTouch.y;this.body.view.translation={x:this.lastTouch.translation.x+o,y:this.lastTouch.translation.y+n}}this.body.emitter.emit("_redraw")}},{key:"_controlNodeDragEnd",value:function(e){var t=this.body.functions.getPointer(e.center),i=this.selectionHandler._pointerToPositionObject(t),o=this.body.edges[this.edgeBeingEditedId];if(void 0!==this.selectedControlNode){this.selectionHandler.unselectAll();for(var n=this.selectionHandler._getAllNodesOverlappingWith(i),s=void 0,r=n.length-1;r>=0;r--)if(n[r]!==this.selectedControlNode.id){s=this.body.nodes[n[r]];break}if(void 0!==s&&void 0!==this.selectedControlNode)if(s.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var a=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===a.id?this._performEditEdge(s.id,o.to.id):this._performEditEdge(o.from.id,s.id)}else o.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}}},{key:"_handleConnect",value:function(e){if((new Date).valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=s.extend({},this.body.view.translation);var t=this.lastTouch,i=this.selectionHandler.getNodeAt(t);if(void 0!==i)if(i.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var o=this._getNewTargetNode(i.x,i.y);this.body.nodes[o.id]=o,this.body.nodeIndices.push(o.id);var n=this.body.functions.createEdge({id:"connectionEdge"+s.randomUUID(),from:i.id,to:o.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[n.id]=n,this.body.edgeIndices.push(n.id),this.temporaryIds.nodes.push(o.id),this.temporaryIds.edges.push(n.id)}this.touchTime=(new Date).valueOf()}}},{key:"_dragControlNode",value:function(e){var t=this.body.functions.getPointer(e.center);if(void 0!==this.temporaryIds.nodes[0]){var i=this.body.nodes[this.temporaryIds.nodes[0]];i.x=this.canvas._XconvertDOMtoCanvas(t.x),i.y=this.canvas._YconvertDOMtoCanvas(t.y),this.body.emitter.emit("_redraw")}else{var o=t.x-this.lastTouch.x,n=t.y-this.lastTouch.y;
-this.body.view.translation={x:this.lastTouch.translation.x+o,y:this.lastTouch.translation.y+n}}}},{key:"_finishConnect",value:function(e){var t=this.body.functions.getPointer(e.center),i=this.selectionHandler._pointerToPositionObject(t),o=void 0;void 0!==this.temporaryIds.edges[0]&&(o=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var n=this.selectionHandler._getAllNodesOverlappingWith(i),s=void 0,r=n.length-1;r>=0;r--)if(-1===this.temporaryIds.nodes.indexOf(n[r])){s=this.body.nodes[n[r]];break}this._cleanupTemporaryNodesAndEdges(),void 0!==s&&(s.isCluster===!0?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):void 0!==this.body.nodes[o]&&void 0!==this.body.nodes[s.id]&&this._performAddEdge(o,s.id)),this.body.emitter.emit("_redraw")}},{key:"_performAddNode",value:function(e){var t=this,i={id:s.randomUUID(),x:e.pointer.canvas.x,y:e.pointer.canvas.y,label:"new"};if("function"==typeof this.options.addNode){if(2!==this.options.addNode.length)throw new Error("The function for add does not support two arguments (data,callback)");this.options.addNode(i,function(e){null!==e&&void 0!==e&&"addNode"===t.inMode&&(t.body.data.nodes.getDataSet().add(e),t.showManipulatorToolbar())})}else this.body.data.nodes.getDataSet().add(i),this.showManipulatorToolbar()}},{key:"_performAddEdge",value:function(e,t){var i=this,o={from:e,to:t};if("function"==typeof this.options.addEdge){if(2!==this.options.addEdge.length)throw new Error("The function for connect does not support two arguments (data,callback)");this.options.addEdge(o,function(e){null!==e&&void 0!==e&&"addEdge"===i.inMode&&(i.body.data.edges.getDataSet().add(e),i.selectionHandler.unselectAll(),i.showManipulatorToolbar())})}else this.body.data.edges.getDataSet().add(o),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}},{key:"_performEditEdge",value:function(e,t){var i=this,o={id:this.edgeBeingEditedId,from:e,to:t};if("function"==typeof this.options.editEdge){if(2!==this.options.editEdge.length)throw new Error("The function for edit does not support two arguments (data, callback)");this.options.editEdge(o,function(e){null===e||void 0===e||"editEdge"!==i.inMode?(i.body.edges[o.id].updateEdgeType(),i.body.emitter.emit("_redraw")):(i.body.data.edges.getDataSet().update(e),i.selectionHandler.unselectAll(),i.showManipulatorToolbar())})}else this.body.data.edges.getDataSet().update(o),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}]),e}();t["default"]=h},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},r=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),a=i(71),h=o(a),d=i(1),l=function(){function e(t,i,o){var s=arguments.length<=3||void 0===arguments[3]?1:arguments[3];n(this,e),this.parent=t,this.changedOptions=[],this.container=i,this.allowCreation=!1,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},d.extend(this.options,this.defaultOptions),this.configureOptions=o,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new h["default"](s),this.wrapper=void 0}return r(e,[{key:"setOptions",value:function(e){if(void 0!==e){this.popupHistory={},this._removePopup();var t=!0;"string"==typeof e?this.options.filter=e:e instanceof Array?this.options.filter=e.join():"object"===("undefined"==typeof e?"undefined":s(e))?(void 0!==e.container&&(this.options.container=e.container),void 0!==e.filter&&(this.options.filter=e.filter),void 0!==e.showButton&&(this.options.showButton=e.showButton),void 0!==e.enabled&&(t=e.enabled)):"boolean"==typeof e?(this.options.filter=!0,t=e):"function"==typeof e&&(this.options.filter=e,t=!0),this.options.filter===!1&&(t=!1),this.options.enabled=t}this._clean()}},{key:"setModuleOptions",value:function(e){this.moduleOptions=e,this.options.enabled===!0&&(this._clean(),void 0!==this.options.container&&(this.container=this.options.container),this._create())}},{key:"_create",value:function(){var e=this;this._clean(),this.changedOptions=[];var t=this.options.filter,i=0,o=!1;for(var n in this.configureOptions)this.configureOptions.hasOwnProperty(n)&&(this.allowCreation=!1,o=!1,"function"==typeof t?(o=t(n,[]),o=o||this._handleObject(this.configureOptions[n],[n],!0)):t!==!0&&-1===t.indexOf(n)||(o=!0),o!==!1&&(this.allowCreation=!0,i>0&&this._makeItem([]),this._makeHeader(n),this._handleObject(this.configureOptions[n],[n])),i++);this.options.showButton===!0&&!function(){var t=document.createElement("div");t.className="vis-configuration vis-config-button",t.innerHTML="generate options",t.onclick=function(){e._printOptions()},t.onmouseover=function(){t.className="vis-configuration vis-config-button hover"},t.onmouseout=function(){t.className="vis-configuration vis-config-button"},e.optionsContainer=document.createElement("div"),e.optionsContainer.className="vis-configuration vis-config-option-container",e.domElements.push(e.optionsContainer),e.domElements.push(t)}(),this._push()}},{key:"_push",value:function(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(var e=0;e<this.domElements.length;e++)this.wrapper.appendChild(this.domElements[e]);this._showPopupIfNeeded()}},{key:"_clean",value:function(){for(var e=0;e<this.domElements.length;e++)this.wrapper.removeChild(this.domElements[e]);void 0!==this.wrapper&&(this.container.removeChild(this.wrapper),this.wrapper=void 0),this.domElements=[],this._removePopup()}},{key:"_getValue",value:function(e){for(var t=this.moduleOptions,i=0;i<e.length;i++){if(void 0===t[e[i]]){t=void 0;break}t=t[e[i]]}return t}},{key:"_makeItem",value:function(e){var t=arguments,i=this;if(this.allowCreation===!0){var o,n,r,a=function(){var s=document.createElement("div");for(s.className="vis-configuration vis-config-item vis-config-s"+e.length,o=t.length,n=Array(o>1?o-1:0),r=1;o>r;r++)n[r-1]=t[r];return n.forEach(function(e){s.appendChild(e)}),i.domElements.push(s),{v:i.domElements.length}}();if("object"===("undefined"==typeof a?"undefined":s(a)))return a.v}return 0}},{key:"_makeHeader",value:function(e){var t=document.createElement("div");t.className="vis-configuration vis-config-header",t.innerHTML=e,this._makeItem([],t)}},{key:"_makeLabel",value:function(e,t){var i=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],o=document.createElement("div");return o.className="vis-configuration vis-config-label vis-config-s"+t.length,i===!0?o.innerHTML="<i><b>"+e+":</b></i>":o.innerHTML=e+":",o}},{key:"_makeDropdown",value:function(e,t,i){var o=document.createElement("select");o.className="vis-configuration vis-config-select";var n=0;void 0!==t&&-1!==e.indexOf(t)&&(n=e.indexOf(t));for(var s=0;s<e.length;s++){var r=document.createElement("option");r.value=e[s],s===n&&(r.selected="selected"),r.innerHTML=e[s],o.appendChild(r)}var a=this;o.onchange=function(){a._update(this.value,i)};var h=this._makeLabel(i[i.length-1],i);this._makeItem(i,h,o)}},{key:"_makeRange",value:function(e,t,i){var o=e[0],n=e[1],s=e[2],r=e[3],a=document.createElement("input");a.className="vis-configuration vis-config-range";try{a.type="range",a.min=n,a.max=s}catch(h){}a.step=r;var d="",l=0;if(void 0!==t){var c=1.2;0>t&&n>t*c?(a.min=Math.ceil(t*c),l=a.min,d="range increased"):n>t/c&&(a.min=Math.ceil(t/c),l=a.min,d="range increased"),t*c>s&&1!==s&&(a.max=Math.ceil(t*c),l=a.max,d="range increased"),a.value=t}else a.value=o;var u=document.createElement("input");u.className="vis-configuration vis-config-rangeinput",u.value=a.value;var f=this;a.onchange=function(){u.value=this.value,f._update(Number(this.value),i)},a.oninput=function(){u.value=this.value};var p=this._makeLabel(i[i.length-1],i),v=this._makeItem(i,p,a,u);""!==d&&this.popupHistory[v]!==l&&(this.popupHistory[v]=l,this._setupPopup(d,v))}},{key:"_setupPopup",value:function(e,t){var i=this;if(this.initialized===!0&&this.allowCreation===!0&&this.popupCounter<this.popupLimit){var o=document.createElement("div");o.id="vis-configuration-popup",o.className="vis-configuration-popup",o.innerHTML=e,o.onclick=function(){i._removePopup()},this.popupCounter+=1,this.popupDiv={html:o,index:t}}}},{key:"_removePopup",value:function(){void 0!==this.popupDiv.html&&(this.popupDiv.html.parentNode.removeChild(this.popupDiv.html),clearTimeout(this.popupDiv.hideTimeout),clearTimeout(this.popupDiv.deleteTimeout),this.popupDiv={})}},{key:"_showPopupIfNeeded",value:function(){var e=this;if(void 0!==this.popupDiv.html){var t=this.domElements[this.popupDiv.index],i=t.getBoundingClientRect();this.popupDiv.html.style.left=i.left+"px",this.popupDiv.html.style.top=i.top-30+"px",document.body.appendChild(this.popupDiv.html),this.popupDiv.hideTimeout=setTimeout(function(){e.popupDiv.html.style.opacity=0},1500),this.popupDiv.deleteTimeout=setTimeout(function(){e._removePopup()},1800)}}},{key:"_makeCheckbox",value:function(e,t,i){var o=document.createElement("input");o.type="checkbox",o.className="vis-configuration vis-config-checkbox",o.checked=e,void 0!==t&&(o.checked=t,t!==e&&("object"===("undefined"==typeof e?"undefined":s(e))?t!==e.enabled&&this.changedOptions.push({path:i,value:t}):this.changedOptions.push({path:i,value:t})));var n=this;o.onchange=function(){n._update(this.checked,i)};var r=this._makeLabel(i[i.length-1],i);this._makeItem(i,r,o)}},{key:"_makeTextInput",value:function(e,t,i){var o=document.createElement("input");o.type="text",o.className="vis-configuration vis-config-text",o.value=t,t!==e&&this.changedOptions.push({path:i,value:t});var n=this;o.onchange=function(){n._update(this.value,i)};var s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,o)}},{key:"_makeColorField",value:function(e,t,i){var o=this,n=e[1],s=document.createElement("div");t=void 0===t?n:t,"none"!==t?(s.className="vis-configuration vis-config-colorBlock",s.style.backgroundColor=t):s.className="vis-configuration vis-config-colorBlock none",t=void 0===t?n:t,s.onclick=function(){o._showColorPicker(t,s,i)};var r=this._makeLabel(i[i.length-1],i);this._makeItem(i,r,s)}},{key:"_showColorPicker",value:function(e,t,i){var o=this;t.onclick=function(){},this.colorPicker.insertTo(t),this.colorPicker.show(),this.colorPicker.setColor(e),this.colorPicker.setUpdateCallback(function(e){var n="rgba("+e.r+","+e.g+","+e.b+","+e.a+")";t.style.backgroundColor=n,o._update(n,i)}),this.colorPicker.setCloseCallback(function(){t.onclick=function(){o._showColorPicker(e,t,i)}})}},{key:"_handleObject",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],i=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],o=!1,n=this.options.filter,s=!1;for(var r in e)if(e.hasOwnProperty(r)){o=!0;var a=e[r],h=d.copyAndExtendArray(t,r);if("function"==typeof n&&(o=n(r,t),o===!1&&!(a instanceof Array)&&"string"!=typeof a&&"boolean"!=typeof a&&a instanceof Object&&(this.allowCreation=!1,o=this._handleObject(a,h,!0),this.allowCreation=i===!1)),o!==!1){s=!0;var l=this._getValue(h);if(a instanceof Array)this._handleArray(a,l,h);else if("string"==typeof a)this._makeTextInput(a,l,h);else if("boolean"==typeof a)this._makeCheckbox(a,l,h);else if(a instanceof Object){var c=!0;if(-1!==t.indexOf("physics")&&this.moduleOptions.physics.solver!==r&&(c=!1),c===!0)if(void 0!==a.enabled){var u=d.copyAndExtendArray(h,"enabled"),f=this._getValue(u);if(f===!0){var p=this._makeLabel(r,h,!0);this._makeItem(h,p),s=this._handleObject(a,h)||s}else this._makeCheckbox(a,f,h)}else{var v=this._makeLabel(r,h,!0);this._makeItem(h,v),s=this._handleObject(a,h)||s}}else console.error("dont know how to handle",a,r,h)}}return s}},{key:"_handleArray",value:function(e,t,i){"string"==typeof e[0]&&"color"===e[0]?(this._makeColorField(e,t,i),e[1]!==t&&this.changedOptions.push({path:i,value:t})):"string"==typeof e[0]?(this._makeDropdown(e,t,i),e[0]!==t&&this.changedOptions.push({path:i,value:t})):"number"==typeof e[0]&&(this._makeRange(e,t,i),e[0]!==t&&this.changedOptions.push({path:i,value:Number(t)}))}},{key:"_update",value:function(e,t){var i=this._constructOptions(e,t);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",i),this.initialized=!0,this.parent.setOptions(i)}},{key:"_constructOptions",value:function(e,t){var i=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],o=i;e="true"===e?!0:e,e="false"===e?!1:e;for(var n=0;n<t.length;n++)"global"!==t[n]&&(void 0===o[t[n]]&&(o[t[n]]={}),n!==t.length-1?o=o[t[n]]:o[t[n]]=e);return i}},{key:"_printOptions",value:function(){var e=this.getOptions();this.optionsContainer.innerHTML="<pre>var options = "+JSON.stringify(e,null,2)+"</pre>"}},{key:"getOptions",value:function(){for(var e={},t=0;t<this.changedOptions.length;t++)this._constructOptions(this.changedOptions[t].value,this.changedOptions[t].path,e);return e}}]),e}();t["default"]=l},function(e,t,i){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),s=i(58),r=i(61),a=i(1),h=function(){function e(){var t=arguments.length<=0||void 0===arguments[0]?1:arguments[0];o(this,e),this.pixelRatio=t,this.generated=!1,this.centerCoordinates={x:144.5,y:144.5},this.r=289*.49,this.color={r:255,g:255,b:255,a:1},this.hueCircle=void 0,this.initialColor={r:255,g:255,b:255,a:1},this.previousColor=void 0,this.applied=!1,this.updateCallback=function(){},this.closeCallback=function(){},this._create()}return n(e,[{key:"insertTo",value:function(e){void 0!==this.hammer&&(this.hammer.destroy(),this.hammer=void 0),this.container=e,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}},{key:"setUpdateCallback",value:function(e){if("function"!=typeof e)throw new Error("Function attempted to set as colorPicker update callback is not a function.");this.updateCallback=e}},{key:"setCloseCallback",value:function(e){if("function"!=typeof e)throw new Error("Function attempted to set as colorPicker closing callback is not a function.");this.closeCallback=e}},{key:"_isColorString",value:function(e){var t={black:"#000000",navy:"#000080",darkblue:"#00008B",mediumblue:"#0000CD",blue:"#0000FF",darkgreen:"#006400",green:"#008000",teal:"#008080",darkcyan:"#008B8B",deepskyblue:"#00BFFF",darkturquoise:"#00CED1",mediumspringgreen:"#00FA9A",lime:"#00FF00",springgreen:"#00FF7F",aqua:"#00FFFF",cyan:"#00FFFF",midnightblue:"#191970",dodgerblue:"#1E90FF",lightseagreen:"#20B2AA",forestgreen:"#228B22",seagreen:"#2E8B57",darkslategray:"#2F4F4F",limegreen:"#32CD32",mediumseagreen:"#3CB371",turquoise:"#40E0D0",royalblue:"#4169E1",steelblue:"#4682B4",darkslateblue:"#483D8B",mediumturquoise:"#48D1CC",indigo:"#4B0082",darkolivegreen:"#556B2F",cadetblue:"#5F9EA0",cornflowerblue:"#6495ED",mediumaquamarine:"#66CDAA",dimgray:"#696969",slateblue:"#6A5ACD",olivedrab:"#6B8E23",slategray:"#708090",lightslategray:"#778899",mediumslateblue:"#7B68EE",lawngreen:"#7CFC00",chartreuse:"#7FFF00",aquamarine:"#7FFFD4",maroon:"#800000",purple:"#800080",olive:"#808000",gray:"#808080",skyblue:"#87CEEB",lightskyblue:"#87CEFA",blueviolet:"#8A2BE2",darkred:"#8B0000",darkmagenta:"#8B008B",saddlebrown:"#8B4513",darkseagreen:"#8FBC8F",lightgreen:"#90EE90",mediumpurple:"#9370D8",darkviolet:"#9400D3",palegreen:"#98FB98",darkorchid:"#9932CC",yellowgreen:"#9ACD32",sienna:"#A0522D",brown:"#A52A2A",darkgray:"#A9A9A9",lightblue:"#ADD8E6",greenyellow:"#ADFF2F",paleturquoise:"#AFEEEE",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",firebrick:"#B22222",darkgoldenrod:"#B8860B",mediumorchid:"#BA55D3",rosybrown:"#BC8F8F",darkkhaki:"#BDB76B",silver:"#C0C0C0",mediumvioletred:"#C71585",indianred:"#CD5C5C",peru:"#CD853F",chocolate:"#D2691E",tan:"#D2B48C",lightgrey:"#D3D3D3",palevioletred:"#D87093",thistle:"#D8BFD8",orchid:"#DA70D6",goldenrod:"#DAA520",crimson:"#DC143C",gainsboro:"#DCDCDC",plum:"#DDA0DD",burlywood:"#DEB887",lightcyan:"#E0FFFF",lavender:"#E6E6FA",darksalmon:"#E9967A",violet:"#EE82EE",palegoldenrod:"#EEE8AA",lightcoral:"#F08080",khaki:"#F0E68C",aliceblue:"#F0F8FF",honeydew:"#F0FFF0",azure:"#F0FFFF",sandybrown:"#F4A460",wheat:"#F5DEB3",beige:"#F5F5DC",whitesmoke:"#F5F5F5",mintcream:"#F5FFFA",ghostwhite:"#F8F8FF",salmon:"#FA8072",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lightgoldenrodyellow:"#FAFAD2",oldlace:"#FDF5E6",red:"#FF0000",fuchsia:"#FF00FF",magenta:"#FF00FF",deeppink:"#FF1493",orangered:"#FF4500",tomato:"#FF6347",hotpink:"#FF69B4",coral:"#FF7F50",darkorange:"#FF8C00",lightsalmon:"#FFA07A",orange:"#FFA500",lightpink:"#FFB6C1",pink:"#FFC0CB",gold:"#FFD700",peachpuff:"#FFDAB9",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",mistyrose:"#FFE4E1",blanchedalmond:"#FFEBCD",papayawhip:"#FFEFD5",lavenderblush:"#FFF0F5",seashell:"#FFF5EE",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",floralwhite:"#FFFAF0",snow:"#FFFAFA",yellow:"#FFFF00",lightyellow:"#FFFFE0",ivory:"#FFFFF0",white:"#FFFFFF"};return"string"==typeof e?t[e]:void 0}},{key:"setColor",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?!0:arguments[1];if("none"!==e){var i=void 0,o=this._isColorString(e);if(void 0!==o&&(e=o),a.isString(e)===!0){if(a.isValidRGB(e)===!0){var n=e.substr(4).substr(0,e.length-5).split(",");i={r:n[0],g:n[1],b:n[2],a:1}}else if(a.isValidRGBA(e)===!0){var s=e.substr(5).substr(0,e.length-6).split(",");i={r:s[0],g:s[1],b:s[2],a:s[3]}}else if(a.isValidHex(e)===!0){var r=a.hexToRGB(e);i={r:r.r,g:r.g,b:r.b,a:1}}}else if(e instanceof Object&&void 0!==e.r&&void 0!==e.g&&void 0!==e.b){var h=void 0!==e.a?e.a:"1.0";i={r:e.r,g:e.g,b:e.b,a:h}}if(void 0===i)throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: "+JSON.stringify(e));this._setColor(i,t)}}},{key:"show",value:function(){void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}},{key:"_hide",value:function(){var e=this,t=arguments.length<=0||void 0===arguments[0]?!0:arguments[0];t===!0&&(this.previousColor=a.extend({},this.color)),this.applied===!0&&this.updateCallback(this.initialColor),this.frame.style.display="none",setTimeout(function(){void 0!==e.closeCallback&&(e.closeCallback(),e.closeCallback=void 0)},0)}},{key:"_save",value:function(){this.updateCallback(this.color),this.applied=!1,this._hide()}},{key:"_apply",value:function(){this.applied=!0,this.updateCallback(this.color),this._updatePicker(this.color)}},{key:"_loadLast",value:function(){void 0!==this.previousColor?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}},{key:"_setColor",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?!0:arguments[1];t===!0&&(this.initialColor=a.extend({},e)),this.color=e;var i=a.RGBToHSV(e.r,e.g,e.b),o=2*Math.PI,n=this.r*i.s,s=this.centerCoordinates.x+n*Math.sin(o*i.h),r=this.centerCoordinates.y+n*Math.cos(o*i.h);this.colorPickerSelector.style.left=s-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=r-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(e)}},{key:"_setOpacity",value:function(e){this.color.a=e/100,this._updatePicker(this.color)}},{key:"_setBrightness",value:function(e){var t=a.RGBToHSV(this.color.r,this.color.g,this.color.b);t.v=e/100;var i=a.HSVToRGB(t.h,t.s,t.v);i.a=this.color.a,this.color=i,this._updatePicker()}},{key:"_updatePicker",value:function(){var e=arguments.length<=0||void 0===arguments[0]?this.color:arguments[0],t=a.RGBToHSV(e.r,e.g,e.b),i=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1)),i.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var o=this.colorPickerCanvas.clientWidth,n=this.colorPickerCanvas.clientHeight;i.clearRect(0,0,o,n),i.putImageData(this.hueCircle,0,0),i.fillStyle="rgba(0,0,0,"+(1-t.v)+")",i.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),i.fill(),this.brightnessRange.value=100*t.v,this.opacityRange.value=100*e.a,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}},{key:"_setSize",value:function(){this.colorPickerCanvas.style.width="100%",this.colorPickerCanvas.style.height="100%",this.colorPickerCanvas.width=289*this.pixelRatio,this.colorPickerCanvas.height=289*this.pixelRatio}},{key:"_create",value:function(){if(this.frame=document.createElement("div"),this.frame.className="vis-color-picker",this.colorPickerDiv=document.createElement("div"),this.colorPickerSelector=document.createElement("div"),this.colorPickerSelector.className="vis-selector",this.colorPickerDiv.appendChild(this.colorPickerSelector),this.colorPickerCanvas=document.createElement("canvas"),this.colorPickerDiv.appendChild(this.colorPickerCanvas),this.colorPickerCanvas.getContext){var e=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{var t=document.createElement("DIV");t.style.color="red",t.style.fontWeight="bold",t.style.padding="10px",t.innerHTML="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(t)}this.colorPickerDiv.className="vis-color",this.opacityDiv=document.createElement("div"),this.opacityDiv.className="vis-opacity",this.brightnessDiv=document.createElement("div"),this.brightnessDiv.className="vis-brightness",this.arrowDiv=document.createElement("div"),this.arrowDiv.className="vis-arrow",this.opacityRange=document.createElement("input");try{this.opacityRange.type="range",this.opacityRange.min="0",this.opacityRange.max="100"}catch(i){}this.opacityRange.value="100",this.opacityRange.className="vis-range",this.brightnessRange=document.createElement("input");try{this.brightnessRange.type="range",this.brightnessRange.min="0",this.brightnessRange.max="100"}catch(i){}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);var o=this;this.opacityRange.onchange=function(){o._setOpacity(this.value)},this.opacityRange.oninput=function(){o._setOpacity(this.value)},this.brightnessRange.onchange=function(){o._setBrightness(this.value)},this.brightnessRange.oninput=function(){o._setBrightness(this.value)},this.brightnessLabel=document.createElement("div"),this.brightnessLabel.className="vis-label vis-brightness",this.brightnessLabel.innerHTML="brightness:",this.opacityLabel=document.createElement("div"),this.opacityLabel.className="vis-label vis-opacity",this.opacityLabel.innerHTML="opacity:",this.newColorDiv=document.createElement("div"),this.newColorDiv.className="vis-new-color",this.newColorDiv.innerHTML="new",this.initialColorDiv=document.createElement("div"),this.initialColorDiv.className="vis-initial-color",this.initialColorDiv.innerHTML="initial",this.cancelButton=document.createElement("div"),this.cancelButton.className="vis-button vis-cancel",this.cancelButton.innerHTML="cancel",this.cancelButton.onclick=this._hide.bind(this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerHTML="apply",this.applyButton.onclick=this._apply.bind(this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerHTML="save",this.saveButton.onclick=this._save.bind(this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerHTML="load last",this.loadButton.onclick=this._loadLast.bind(this),this.frame.appendChild(this.colorPickerDiv),this.frame.appendChild(this.arrowDiv),this.frame.appendChild(this.brightnessLabel),this.frame.appendChild(this.brightnessDiv),this.frame.appendChild(this.opacityLabel),this.frame.appendChild(this.opacityDiv),this.frame.appendChild(this.newColorDiv),this.frame.appendChild(this.initialColorDiv),this.frame.appendChild(this.cancelButton),this.frame.appendChild(this.applyButton),this.frame.appendChild(this.saveButton),this.frame.appendChild(this.loadButton)}},{key:"_bindHammer",value:function(){var e=this;this.drag={},this.pinch={},this.hammer=new s(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),r.onTouch(this.hammer,function(t){e._moveSelector(t)}),this.hammer.on("tap",function(t){e._moveSelector(t)}),this.hammer.on("panstart",function(t){e._moveSelector(t)}),this.hammer.on("panmove",function(t){e._moveSelector(t)}),this.hammer.on("panend",function(t){e._moveSelector(t)})}},{key:"_generateHueCircle",value:function(){if(this.generated===!1){var e=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)),e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var t=this.colorPickerCanvas.clientWidth,i=this.colorPickerCanvas.clientHeight;e.clearRect(0,0,t,i);var o=void 0,n=void 0,s=void 0,r=void 0;this.centerCoordinates={x:.5*t,y:.5*i},this.r=.49*t;var h=2*Math.PI/360,d=1/360,l=1/this.r,c=void 0;for(s=0;360>s;s++)for(r=0;r<this.r;r++)o=this.centerCoordinates.x+r*Math.sin(h*s),n=this.centerCoordinates.y+r*Math.cos(h*s),c=a.HSVToRGB(s*d,r*l,1),e.fillStyle="rgb("+c.r+","+c.g+","+c.b+")",e.fillRect(o-.5,n-.5,2,2);e.strokeStyle="rgba(0,0,0,1)",e.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),e.stroke(),this.hueCircle=e.getImageData(0,0,t,i)}this.generated=!0}},{key:"_moveSelector",value:function(e){var t=this.colorPickerDiv.getBoundingClientRect(),i=e.center.x-t.left,o=e.center.y-t.top,n=.5*this.colorPickerDiv.clientHeight,s=.5*this.colorPickerDiv.clientWidth,r=i-s,h=o-n,d=Math.atan2(r,h),l=.98*Math.min(Math.sqrt(r*r+h*h),s),c=Math.cos(d)*l+n,u=Math.sin(d)*l+s;this.colorPickerSelector.style.top=c-.5*this.colorPickerSelector.clientHeight+"px",this.colorPickerSelector.style.left=u-.5*this.colorPickerSelector.clientWidth+"px";var f=d/(2*Math.PI);f=0>f?f+1:f;var p=l/this.r,v=a.RGBToHSV(this.color.r,this.color.g,this.color.b);v.h=f,v.s=p;var y=a.HSVToRGB(v.h,v.s,v.v);y.a=this.color.a,this.color=y,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}}]),e}();t["default"]=h},function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var i="string",o="boolean",n="number",s="array",r="object",a="dom",h="any",d={configure:{enabled:{"boolean":o},filter:{"boolean":o,string:i,array:s,"function":"function"},container:{dom:a},showButton:{"boolean":o},__type__:{object:r,"boolean":o,string:i,array:s,"function":"function"}},edges:{arrows:{to:{enabled:{"boolean":o},scaleFactor:{number:n},__type__:{object:r,"boolean":o}},middle:{enabled:{"boolean":o},scaleFactor:{number:n},__type__:{object:r,"boolean":o}},from:{enabled:{"boolean":o},scaleFactor:{number:n},__type__:{object:r,"boolean":o}},__type__:{string:["from","to","middle"],object:r}},arrowStrikethrough:{"boolean":o},color:{color:{string:i},highlight:{string:i},hover:{string:i},inherit:{string:["from","to","both"],"boolean":o},opacity:{number:n},__type__:{object:r,string:i}},dashes:{"boolean":o,array:s},font:{color:{string:i},size:{number:n},face:{string:i},background:{string:i},strokeWidth:{number:n},strokeColor:{string:i},align:{string:["horizontal","top","middle","bottom"]},__type__:{object:r,string:i}},hidden:{"boolean":o},hoverWidth:{"function":"function",number:n},label:{string:i,undefined:"undefined"},labelHighlightBold:{"boolean":o},length:{number:n,undefined:"undefined"},physics:{"boolean":o},scaling:{min:{number:n},max:{number:n},label:{enabled:{"boolean":o},min:{number:n},max:{number:n},maxVisible:{number:n},drawThreshold:{number:n},__type__:{object:r,"boolean":o}},customScalingFunction:{"function":"function"},__type__:{object:r}},selectionWidth:{"function":"function",number:n},selfReferenceSize:{number:n},shadow:{enabled:{"boolean":o},color:{string:i},size:{number:n},x:{number:n},y:{number:n},__type__:{object:r,"boolean":o}},smooth:{enabled:{"boolean":o},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:n},forceDirection:{string:["horizontal","vertical","none"],"boolean":o},__type__:{object:r,"boolean":o}},title:{string:i,undefined:"undefined"},width:{number:n},value:{number:n,undefined:"undefined"},__type__:{object:r}},groups:{useDefaultGroups:{"boolean":o},__any__:"get from nodes, will be overwritten below",__type__:{object:r}},interaction:{dragNodes:{"boolean":o},dragView:{"boolean":o},hideEdgesOnDrag:{"boolean":o},hideNodesOnDrag:{"boolean":o},hover:{"boolean":o},keyboard:{enabled:{"boolean":o},speed:{x:{number:n},y:{number:n},zoom:{number:n},__type__:{object:r}},bindToWindow:{"boolean":o},__type__:{object:r,"boolean":o}},multiselect:{"boolean":o},navigationButtons:{"boolean":o},selectable:{"boolean":o},selectConnectedEdges:{"boolean":o},hoverConnectedEdges:{"boolean":o},tooltipDelay:{number:n},zoomView:{"boolean":o},__type__:{object:r}},layout:{randomSeed:{undefined:"undefined",number:n},improvedLayout:{"boolean":o},hierarchical:{enabled:{"boolean":o},levelSeparation:{number:n},nodeSpacing:{number:n},treeSpacing:{number:n},blockShifting:{"boolean":o},edgeMinimization:{"boolean":o},parentCentralization:{"boolean":o},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},__type__:{object:r,"boolean":o}},__type__:{object:r}},manipulation:{enabled:{"boolean":o},initiallyActive:{"boolean":o},addNode:{"boolean":o,"function":"function"},addEdge:{"boolean":o,"function":"function"},editNode:{"function":"function"},editEdge:{"boolean":o,"function":"function"},deleteNode:{"boolean":o,"function":"function"},deleteEdge:{"boolean":o,"function":"function"},controlNodeStyle:"get from nodes, will be overwritten below",__type__:{object:r,"boolean":o}},nodes:{borderWidth:{number:n},borderWidthSelected:{number:n,undefined:"undefined"},brokenImage:{string:i,undefined:"undefined"},color:{border:{string:i},background:{string:i},highlight:{border:{string:i},background:{string:i},__type__:{object:r,string:i}},hover:{border:{string:i},background:{string:i},__type__:{object:r,string:i}},__type__:{object:r,string:i}},fixed:{x:{"boolean":o},y:{"boolean":o},__type__:{object:r,"boolean":o}},font:{align:{string:i},color:{string:i},size:{number:n},face:{string:i},background:{string:i},strokeWidth:{number:n},strokeColor:{string:i},__type__:{object:r,
-string:i}},group:{string:i,number:n,undefined:"undefined"},hidden:{"boolean":o},icon:{face:{string:i},code:{string:i},size:{number:n},color:{string:i},__type__:{object:r}},id:{string:i,number:n},image:{string:i,undefined:"undefined"},label:{string:i,undefined:"undefined"},labelHighlightBold:{"boolean":o},level:{number:n,undefined:"undefined"},mass:{number:n},physics:{"boolean":o},scaling:{min:{number:n},max:{number:n},label:{enabled:{"boolean":o},min:{number:n},max:{number:n},maxVisible:{number:n},drawThreshold:{number:n},__type__:{object:r,"boolean":o}},customScalingFunction:{"function":"function"},__type__:{object:r}},shadow:{enabled:{"boolean":o},color:{string:i},size:{number:n},x:{number:n},y:{number:n},__type__:{object:r,"boolean":o}},shape:{string:["ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon"]},shapeProperties:{borderDashes:{"boolean":o,array:s},borderRadius:{number:n},interpolation:{"boolean":o},useImageSize:{"boolean":o},useBorderWithImage:{"boolean":o},__type__:{object:r}},size:{number:n},title:{string:i,undefined:"undefined"},value:{number:n,undefined:"undefined"},x:{number:n},y:{number:n},__type__:{object:r}},physics:{enabled:{"boolean":o},barnesHut:{gravitationalConstant:{number:n},centralGravity:{number:n},springLength:{number:n},springConstant:{number:n},damping:{number:n},avoidOverlap:{number:n},__type__:{object:r}},forceAtlas2Based:{gravitationalConstant:{number:n},centralGravity:{number:n},springLength:{number:n},springConstant:{number:n},damping:{number:n},avoidOverlap:{number:n},__type__:{object:r}},repulsion:{centralGravity:{number:n},springLength:{number:n},springConstant:{number:n},nodeDistance:{number:n},damping:{number:n},__type__:{object:r}},hierarchicalRepulsion:{centralGravity:{number:n},springLength:{number:n},springConstant:{number:n},nodeDistance:{number:n},damping:{number:n},__type__:{object:r}},maxVelocity:{number:n},minVelocity:{number:n},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{"boolean":o},iterations:{number:n},updateInterval:{number:n},onlyDynamicEdges:{"boolean":o},fit:{"boolean":o},__type__:{object:r,"boolean":o}},timestep:{number:n},adaptiveTimestep:{"boolean":o},__type__:{object:r,"boolean":o}},autoResize:{"boolean":o},clickToUse:{"boolean":o},locale:{string:i},locales:{__any__:{any:h},__type__:{object:r}},height:{string:i},width:{string:i},__type__:{object:r}};d.groups.__any__=d.nodes,d.manipulation.controlNodeStyle=d.nodes;var l={nodes:{borderWidth:[1,0,10,1],borderWidthSelected:[2,0,10,1],color:{border:["color","#2B7CE9"],background:["color","#97C2FC"],highlight:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]},hover:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]}},fixed:{x:!1,y:!1},font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[0,0,50,1],strokeColor:["color","#ffffff"]},hidden:!1,labelHighlightBold:!0,physics:!0,scaling:{min:[10,0,200,1],max:[30,0,200,1],label:{enabled:!1,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},shape:["ellipse","box","circle","database","diamond","dot","square","star","text","triangle","triangleDown"],shapeProperties:{borderDashes:!1,borderRadius:[6,0,20,1],interpolation:!0,useImageSize:!1},size:[25,0,200,1]},edges:{arrows:{to:{enabled:!1,scaleFactor:[1,0,3,.05]},middle:{enabled:!1,scaleFactor:[1,0,3,.05]},from:{enabled:!1,scaleFactor:[1,0,3,.05]}},arrowStrikethrough:!0,color:{color:["color","#848484"],highlight:["color","#848484"],hover:["color","#848484"],inherit:["from","to","both",!0,!1],opacity:[1,0,1,.05]},dashes:!1,font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[2,0,50,1],strokeColor:["color","#ffffff"],align:["horizontal","top","middle","bottom"]},hidden:!1,hoverWidth:[1.5,0,5,.1],labelHighlightBold:!0,physics:!0,scaling:{min:[1,0,100,1],max:[15,0,100,1],label:{enabled:!0,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},selectionWidth:[1.5,0,5,.1],selfReferenceSize:[20,0,200,1],shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},smooth:{enabled:!0,type:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"],forceDirection:["horizontal","vertical","none"],roundness:[.5,0,1,.05]},width:[1,0,30,1]},layout:{hierarchical:{enabled:!1,levelSeparation:[150,20,500,5],nodeSpacing:[100,20,500,5],treeSpacing:[200,20,500,5],blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:["UD","DU","LR","RL"],sortMethod:["hubsize","directed"]}},interaction:{dragNodes:!0,dragView:!0,hideEdgesOnDrag:!1,hideNodesOnDrag:!1,hover:!1,keyboard:{enabled:!1,speed:{x:[10,0,40,1],y:[10,0,40,1],zoom:[.02,0,.1,.005]},bindToWindow:!0},multiselect:!1,navigationButtons:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0,tooltipDelay:[300,0,1e3,25],zoomView:!0},manipulation:{enabled:!1,initiallyActive:!1},physics:{enabled:!0,barnesHut:{gravitationalConstant:[-2e3,-3e4,0,50],centralGravity:[.3,0,10,.05],springLength:[95,0,500,5],springConstant:[.04,0,1.2,.005],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},forceAtlas2Based:{gravitationalConstant:[-50,-500,0,1],centralGravity:[.01,0,1,.005],springLength:[95,0,500,5],springConstant:[.08,0,1.2,.005],damping:[.4,0,1,.01],avoidOverlap:[0,0,1,.01]},repulsion:{centralGravity:[.2,0,10,.05],springLength:[200,0,500,5],springConstant:[.05,0,1.2,.005],nodeDistance:[100,0,500,5],damping:[.09,0,1,.01]},hierarchicalRepulsion:{centralGravity:[.2,0,10,.05],springLength:[100,0,500,5],springConstant:[.01,0,1.2,.005],nodeDistance:[120,0,500,5],damping:[.09,0,1,.01]},maxVelocity:[50,0,150,1],minVelocity:[.1,.01,.5,.01],solver:["barnesHut","forceAtlas2Based","repulsion","hierarchicalRepulsion"],timestep:[.5,.01,1,.01]},global:{locale:["en","nl"]}};t.allOptions=d,t.configureOptions=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){var i=[],o=!0,n=!1,s=void 0;try{for(var r,a=e[Symbol.iterator]();!(o=(r=a.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(h){n=!0,s=h}finally{try{!o&&a["return"]&&a["return"]()}finally{if(n)throw s}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),a=i(74),h=o(a),d=function(){function e(t,i,o){n(this,e),this.body=t,this.springLength=i,this.springConstant=o,this.distanceSolver=new h["default"]}return r(e,[{key:"setOptions",value:function(e){e&&(e.springLength&&(this.springLength=e.springLength),e.springConstant&&(this.springConstant=e.springConstant))}},{key:"solve",value:function(e,t){var i=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],o=this.distanceSolver.getDistances(this.body,e,t);this._createL_matrix(o),this._createK_matrix(o);for(var n=.01,r=1,a=0,h=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),d=5,l=1e9,c=0,u=0,f=0,p=0,v=0;l>n&&h>a;){a+=1;var y=this._getHighestEnergyNode(i),g=s(y,4);for(c=g[0],l=g[1],u=g[2],f=g[3],p=l,v=0;p>r&&d>v;){v+=1,this._moveNode(c,u,f);var b=this._getEnergy(c),m=s(b,3);p=m[0],u=m[1],f=m[2]}}}},{key:"_getHighestEnergyNode",value:function(e){for(var t=this.body.nodeIndices,i=this.body.nodes,o=0,n=t[0],r=0,a=0,h=0;h<t.length;h++){var d=t[h];if(i[d].predefinedPosition===!1||i[d].isCluster===!0&&e===!0||i[d].options.fixed.x===!0||i[d].options.fixed.y===!0){var l=this._getEnergy(d),c=s(l,3),u=c[0],f=c[1],p=c[2];u>o&&(o=u,n=d,r=f,a=p)}}return[n,o,r,a]}},{key:"_getEnergy",value:function(e){for(var t=this.body.nodeIndices,i=this.body.nodes,o=i[e].x,n=i[e].y,s=0,r=0,a=0;a<t.length;a++){var h=t[a];if(h!==e){var d=i[h].x,l=i[h].y,c=1/Math.sqrt(Math.pow(o-d,2)+Math.pow(n-l,2));s+=this.K_matrix[e][h]*(o-d-this.L_matrix[e][h]*(o-d)*c),r+=this.K_matrix[e][h]*(n-l-this.L_matrix[e][h]*(n-l)*c)}}var u=Math.sqrt(Math.pow(s,2)+Math.pow(r,2));return[u,s,r]}},{key:"_moveNode",value:function(e,t,i){for(var o=this.body.nodeIndices,n=this.body.nodes,s=0,r=0,a=0,h=n[e].x,d=n[e].y,l=0;l<o.length;l++){var c=o[l];if(c!==e){var u=n[c].x,f=n[c].y,p=1/Math.pow(Math.pow(h-u,2)+Math.pow(d-f,2),1.5);s+=this.K_matrix[e][c]*(1-this.L_matrix[e][c]*Math.pow(d-f,2)*p),r+=this.K_matrix[e][c]*(this.L_matrix[e][c]*(h-u)*(d-f)*p),a+=this.K_matrix[e][c]*(1-this.L_matrix[e][c]*Math.pow(h-u,2)*p)}}var v=s,y=r,g=t,b=a,m=i,_=(g/v+m/y)/(y/v-b/y),w=-(y*_+g)/v;n[e].x+=w,n[e].y+=_}},{key:"_createL_matrix",value:function(e){var t=this.body.nodeIndices,i=this.springLength;this.L_matrix=[];for(var o=0;o<t.length;o++){this.L_matrix[t[o]]={};for(var n=0;n<t.length;n++)this.L_matrix[t[o]][t[n]]=i*e[t[o]][t[n]]}}},{key:"_createK_matrix",value:function(e){var t=this.body.nodeIndices,i=this.springConstant;this.K_matrix=[];for(var o=0;o<t.length;o++){this.K_matrix[t[o]]={};for(var n=0;n<t.length;n++)this.K_matrix[t[o]][t[n]]=i*Math.pow(e[t[o]][t[n]],-2)}}}]),e}();t["default"]=d},function(e,t){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),n=function(){function e(){i(this,e)}return o(e,[{key:"getDistances",value:function(e,t,i){for(var o={},n=e.edges,s=0;s<t.length;s++){o[t[s]]={},o[t[s]]={};for(var r=0;r<t.length;r++)o[t[s]][t[r]]=s==r?0:1e9,o[t[s]][t[r]]=s==r?0:1e9}for(var a=0;a<i.length;a++){var h=n[i[a]];h.connected===!0&&void 0!==o[h.fromId]&&void 0!==o[h.toId]&&(o[h.fromId][h.toId]=1,o[h.toId][h.fromId]=1)}for(var d=t.length,l=0;d>l;l++)for(var c=0;d-1>c;c++)for(var u=c+1;d>u;u++)o[t[c]][t[u]]=Math.min(o[t[c]][t[u]],o[t[c]][t[l]]+o[t[l]][t[u]]),o[t[u]][t[c]]=o[t[c]][t[u]];return o}}]),e}();t["default"]=n},function(e,t){"undefined"!=typeof CanvasRenderingContext2D&&(CanvasRenderingContext2D.prototype.circle=function(e,t,i){this.beginPath(),this.arc(e,t,i,0,2*Math.PI,!1),this.closePath()},CanvasRenderingContext2D.prototype.square=function(e,t,i){this.beginPath(),this.rect(e-i,t-i,2*i,2*i),this.closePath()},CanvasRenderingContext2D.prototype.triangle=function(e,t,i){this.beginPath(),i*=1.15,t+=.275*i;var o=2*i,n=o/2,s=Math.sqrt(3)/6*o,r=Math.sqrt(o*o-n*n);this.moveTo(e,t-(r-s)),this.lineTo(e+n,t+s),this.lineTo(e-n,t+s),this.lineTo(e,t-(r-s)),this.closePath()},CanvasRenderingContext2D.prototype.triangleDown=function(e,t,i){this.beginPath(),i*=1.15,t-=.275*i;var o=2*i,n=o/2,s=Math.sqrt(3)/6*o,r=Math.sqrt(o*o-n*n);this.moveTo(e,t+(r-s)),this.lineTo(e+n,t-s),this.lineTo(e-n,t-s),this.lineTo(e,t+(r-s)),this.closePath()},CanvasRenderingContext2D.prototype.star=function(e,t,i){this.beginPath(),i*=.82,t+=.1*i;for(var o=0;10>o;o++){var n=o%2===0?1.3*i:.5*i;this.lineTo(e+n*Math.sin(2*o*Math.PI/10),t-n*Math.cos(2*o*Math.PI/10))}this.closePath()},CanvasRenderingContext2D.prototype.diamond=function(e,t,i){this.beginPath(),this.lineTo(e,t+i),this.lineTo(e+i,t),this.lineTo(e,t-i),this.lineTo(e-i,t),this.closePath()},CanvasRenderingContext2D.prototype.roundRect=function(e,t,i,o,n){var s=Math.PI/180;0>i-2*n&&(n=i/2),0>o-2*n&&(n=o/2),this.beginPath(),this.moveTo(e+n,t),this.lineTo(e+i-n,t),this.arc(e+i-n,t+n,n,270*s,360*s,!1),this.lineTo(e+i,t+o-n),this.arc(e+i-n,t+o-n,n,0,90*s,!1),this.lineTo(e+n,t+o),this.arc(e+n,t+o-n,n,90*s,180*s,!1),this.lineTo(e,t+n),this.arc(e+n,t+n,n,180*s,270*s,!1),this.closePath()},CanvasRenderingContext2D.prototype.ellipse=function(e,t,i,o){var n=.5522848,s=i/2*n,r=o/2*n,a=e+i,h=t+o,d=e+i/2,l=t+o/2;this.beginPath(),this.moveTo(e,l),this.bezierCurveTo(e,l-r,d-s,t,d,t),this.bezierCurveTo(d+s,t,a,l-r,a,l),this.bezierCurveTo(a,l+r,d+s,h,d,h),this.bezierCurveTo(d-s,h,e,l+r,e,l),this.closePath()},CanvasRenderingContext2D.prototype.database=function(e,t,i,o){var n=1/3,s=i,r=o*n,a=.5522848,h=s/2*a,d=r/2*a,l=e+s,c=t+r,u=e+s/2,f=t+r/2,p=t+(o-r/2),v=t+o;this.beginPath(),this.moveTo(l,f),this.bezierCurveTo(l,f+d,u+h,c,u,c),this.bezierCurveTo(u-h,c,e,f+d,e,f),this.bezierCurveTo(e,f-d,u-h,t,u,t),this.bezierCurveTo(u+h,t,l,f-d,l,f),this.lineTo(l,p),this.bezierCurveTo(l,p+d,u+h,v,u,v),this.bezierCurveTo(u-h,v,e,p+d,e,p),this.lineTo(e,f)},CanvasRenderingContext2D.prototype.arrow=function(e,t,i,o){var n=e-o*Math.cos(i),s=t-o*Math.sin(i),r=e-.9*o*Math.cos(i),a=t-.9*o*Math.sin(i),h=n+o/3*Math.cos(i+.5*Math.PI),d=s+o/3*Math.sin(i+.5*Math.PI),l=n+o/3*Math.cos(i-.5*Math.PI),c=s+o/3*Math.sin(i-.5*Math.PI);this.beginPath(),this.moveTo(e,t),this.lineTo(h,d),this.lineTo(r,a),this.lineTo(l,c),this.closePath()},CanvasRenderingContext2D.prototype.dashedLine=function(e,t,i,o,n){this.beginPath(),this.moveTo(e,t);for(var s=n.length,r=i-e,a=o-t,h=a/r,d=Math.sqrt(r*r+a*a),l=0,c=!0,u=0,f=n[0];d>=.1;)f=n[l++%s],f>d&&(f=d),u=Math.sqrt(f*f/(1+h*h)),u=0>r?-u:u,e+=u,t+=h*u,c===!0?this.lineTo(e,t):this.moveTo(e,t),d-=f,c=!c})},function(e,t){function i(e){return e?o(e):void 0}function o(e){for(var t in i.prototype)e[t]=i.prototype[t];return e}e.exports=i,i.prototype.on=i.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[e]=this._callbacks[e]||[]).push(t),this},i.prototype.once=function(e,t){function i(){o.off(e,i),t.apply(this,arguments)}var o=this;return this._callbacks=this._callbacks||{},i.fn=t,this.on(e,i),this},i.prototype.off=i.prototype.removeListener=i.prototype.removeAllListeners=i.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var i=this._callbacks[e];if(!i)return this;if(1==arguments.length)return delete this._callbacks[e],this;for(var o,n=0;n<i.length;n++)if(o=i[n],o===t||o.fn===t){i.splice(n,1);break}return this},i.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),i=this._callbacks[e];if(i){i=i.slice(0);for(var o=0,n=i.length;n>o;++o)i[o].apply(this,t)}return this},i.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[e]||[]},i.prototype.hasListeners=function(e){return!!this.listeners(e).length}},function(e,t){function i(e){return P=e,f()}function o(){B=0,F=P.charAt(0)}function n(){B++,F=P.charAt(B)}function s(){return P.charAt(B+1)}function r(e){return N.test(e)}function a(e,t){if(e||(e={}),t)for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}function h(e,t,i){for(var o=t.split("."),n=e;o.length;){var s=o.shift();o.length?(n[s]||(n[s]={}),n=n[s]):n[s]=i}}function d(e,t){for(var i,o,n=null,s=[e],r=e;r.parent;)s.push(r.parent),r=r.parent;if(r.nodes)for(i=0,o=r.nodes.length;o>i;i++)if(t.id===r.nodes[i].id){n=r.nodes[i];break}for(n||(n={id:t.id},e.node&&(n.attr=a(n.attr,e.node))),i=s.length-1;i>=0;i--){var h=s[i];h.nodes||(h.nodes=[]),-1===h.nodes.indexOf(n)&&h.nodes.push(n)}t.attr&&(n.attr=a(n.attr,t.attr))}function l(e,t){if(e.edges||(e.edges=[]),e.edges.push(t),e.edge){var i=a({},e.edge);t.attr=a(i,t.attr)}}function c(e,t,i,o,n){var s={from:t,to:i,type:o};return e.edge&&(s.attr=a({},e.edge)),s.attr=a(s.attr||{},n),s}function u(){for(j=C.NULL,I="";" "===F||" "===F||"\n"===F||"\r"===F;)n();do{var e=!1;if("#"===F){for(var t=B-1;" "===P.charAt(t)||" "===P.charAt(t);)t--;if("\n"===P.charAt(t)||""===P.charAt(t)){for(;""!=F&&"\n"!=F;)n();e=!0}}if("/"===F&&"/"===s()){for(;""!=F&&"\n"!=F;)n();e=!0}if("/"===F&&"*"===s()){for(;""!=F;){if("*"===F&&"/"===s()){n(),n();break}n()}e=!0}for(;" "===F||" "===F||"\n"===F||"\r"===F;)n()}while(e);if(""===F)return void(j=C.DELIMITER);var i=F+s();if(T[i])return j=C.DELIMITER,I=i,n(),void n();if(T[F])return j=C.DELIMITER,I=F,void n();if(r(F)||"-"===F){for(I+=F,n();r(F);)I+=F,n();return"false"===I?I=!1:"true"===I?I=!0:isNaN(Number(I))||(I=Number(I)),void(j=C.IDENTIFIER)}if('"'===F){for(n();""!=F&&('"'!=F||'"'===F&&'"'===s());)I+=F,'"'===F&&n(),n();if('"'!=F)throw w('End of string " expected');return n(),void(j=C.IDENTIFIER)}for(j=C.UNKNOWN;""!=F;)I+=F,n();throw new SyntaxError('Syntax error in part "'+k(I,30)+'"')}function f(){var e={};if(o(),u(),"strict"===I&&(e.strict=!0,u()),"graph"!==I&&"digraph"!==I||(e.type=I,u()),j===C.IDENTIFIER&&(e.id=I,u()),"{"!=I)throw w("Angle bracket { expected");if(u(),p(e),"}"!=I)throw w("Angle bracket } expected");if(u(),""!==I)throw w("End of file expected");return u(),delete e.node,delete e.edge,delete e.graph,e}function p(e){for(;""!==I&&"}"!=I;)v(e),";"===I&&u()}function v(e){var t=y(e);if(t)return void m(e,t);var i=g(e);if(!i){if(j!=C.IDENTIFIER)throw w("Identifier expected");var o=I;if(u(),"="===I){if(u(),j!=C.IDENTIFIER)throw w("Identifier expected");e[o]=I,u()}else b(e,o)}}function y(e){var t=null;if("subgraph"===I&&(t={},t.type="subgraph",u(),j===C.IDENTIFIER&&(t.id=I,u())),"{"===I){if(u(),t||(t={}),t.parent=e,t.node=e.node,t.edge=e.edge,t.graph=e.graph,p(t),"}"!=I)throw w("Angle bracket } expected");u(),delete t.node,delete t.edge,delete t.graph,delete t.parent,e.subgraphs||(e.subgraphs=[]),e.subgraphs.push(t)}return t}function g(e){return"node"===I?(u(),e.node=_(),"node"):"edge"===I?(u(),e.edge=_(),"edge"):"graph"===I?(u(),e.graph=_(),"graph"):null}function b(e,t){var i={id:t},o=_();o&&(i.attr=o),d(e,i),m(e,t)}function m(e,t){for(;"->"===I||"--"===I;){var i,o=I;u();var n=y(e);if(n)i=n;else{if(j!=C.IDENTIFIER)throw w("Identifier or subgraph expected");i=I,d(e,{id:i}),u()}var s=_(),r=c(e,t,i,o,s);l(e,r),t=i}}function _(){for(var e=null;"["===I;){for(u(),e={};""!==I&&"]"!=I;){if(j!=C.IDENTIFIER)throw w("Attribute name expected");var t=I;if(u(),"="!=I)throw w("Equal sign = expected");if(u(),j!=C.IDENTIFIER)throw w("Attribute value expected");var i=I;h(e,t,i),u(),","==I&&u()}if("]"!=I)throw w("Bracket ] expected");u()}return e}function w(e){return new SyntaxError(e+', got "'+k(I,30)+'" (char '+B+")")}function k(e,t){return e.length<=t?e:e.substr(0,27)+"..."}function x(e,t,i){Array.isArray(e)?e.forEach(function(e){Array.isArray(t)?t.forEach(function(t){i(e,t)}):i(e,t)}):Array.isArray(t)?t.forEach(function(t){i(e,t)}):i(e,t)}function O(e,t,i){for(var o=t.split("."),n=o.pop(),s=e,r=0;r<o.length;r++){var a=o[r];a in s||(s[a]={}),s=s[a]}return s[n]=i,e}function E(e,t){var i={};for(var o in e)if(e.hasOwnProperty(o)){var n=t[o];Array.isArray(n)?n.forEach(function(t){O(i,t,e[o])}):"string"==typeof n?O(i,n,e[o]):O(i,o,e[o])}return i}function M(e){var t=i(e),o={nodes:[],edges:[],options:{}};if(t.nodes&&t.nodes.forEach(function(e){var t={id:e.id,label:String(e.label||e.id)};a(t,E(e.attr,D)),t.image&&(t.shape="image"),o.nodes.push(t)}),t.edges){var n=function(e){var t={from:e.from,to:e.to};return a(t,E(e.attr,S)),t.arrows="->"===e.type?"to":void 0,t};t.edges.forEach(function(e){var t,i;t=e.from instanceof Object?e.from.nodes:{id:e.from},i=e.to instanceof Object?e.to.nodes:{id:e.to},e.from instanceof Object&&e.from.edges&&e.from.edges.forEach(function(e){var t=n(e);o.edges.push(t)}),x(t,i,function(t,i){var s=c(o,t.id,i.id,e.type,e.attr),r=n(s);o.edges.push(r)}),e.to instanceof Object&&e.to.edges&&e.to.edges.forEach(function(e){var t=n(e);o.edges.push(t)})})}return t.attr&&(o.options=t.attr),o}var D={fontsize:"font.size",fontcolor:"font.color",labelfontcolor:"font.color",fontname:"font.face",color:["color.border","color.background"],fillcolor:"color.background",tooltip:"title",labeltooltip:"title"},S=Object.create(D);S.color="color.color";var C={NULL:0,DELIMITER:1,IDENTIFIER:2,UNKNOWN:3},T={"{":!0,"}":!0,"[":!0,"]":!0,";":!0,"=":!0,",":!0,"->":!0,"--":!0},P="",B=0,F="",I="",j=C.NULL,N=/[a-zA-Z_0-9.:#]/;t.parseDOT=i,t.DOTToGraph=M},function(e,t){function i(e,t){var i=[],o=[],n={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};void 0!==t&&(void 0!==t.fixed&&(n.nodes.fixed=t.fixed),void 0!==t.parseColor&&(n.nodes.parseColor=t.parseColor),void 0!==t.inheritColor&&(n.edges.inheritColor=t.inheritColor));for(var s=e.edges,r=e.nodes,a=0;a<s.length;a++){var h={},d=s[a];h.id=d.id,h.from=d.source,h.to=d.target,h.attributes=d.attributes,h.label=d.label,h.title=void 0!==d.attributes?d.attributes.title:void 0,"Directed"===d.type&&(h.arrows="to"),d.color&&n.inheritColor===!1&&(h.color=d.color),i.push(h)}for(var a=0;a<r.length;a++){var l={},c=r[a];l.id=c.id,l.attributes=c.attributes,l.title=c.title,l.x=c.x,l.y=c.y,l.label=c.label,l.title=void 0!==c.attributes?c.attributes.title:void 0,n.nodes.parseColor===!0?l.color=c.color:l.color=void 0!==c.color?{background:c.color,border:c.color,highlight:{background:c.color,border:c.color},hover:{background:c.color,border:c.color}}:void 0,l.size=c.size,l.fixed=n.nodes.fixed&&void 0!==c.x&&void 0!==c.y,o.push(l)}return{nodes:o,edges:i}}t.parseGephi=i},function(e,t,i){function o(e){this.active=!1,this.dom={container:e},this.dom.overlay=document.createElement("div"),this.dom.overlay.className="vis-overlay",this.dom.container.appendChild(this.dom.overlay),this.hammer=a(this.dom.overlay),this.hammer.on("tap",this._onTapOverlay.bind(this));var t=this,i=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];i.forEach(function(e){t.hammer.on(e,function(e){e.stopPropagation()})}),document&&document.body&&(this.onClick=function(i){n(i.target,e)||t.deactivate()},document.body.addEventListener("click",this.onClick)),void 0!==this.keycharm&&this.keycharm.destroy(),this.keycharm=s(),this.escListener=this.deactivate.bind(this)}function n(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}var s=i(65),r=i(76),a=i(58),h=i(1);r(o.prototype),o.current=null,o.prototype.destroy=function(){this.deactivate(),this.dom.overlay.parentNode.removeChild(this.dom.overlay),this.onClick&&document.body.removeEventListener("click",this.onClick),this.hammer.destroy(),this.hammer=null},o.prototype.activate=function(){o.current&&o.current.deactivate(),o.current=this,this.active=!0,this.dom.overlay.style.display="none",h.addClassName(this.dom.container,"vis-active"),this.emit("change"),this.emit("activate"),this.keycharm.bind("esc",this.escListener)},o.prototype.deactivate=function(){this.active=!1,this.dom.overlay.style.display="",h.removeClassName(this.dom.container,"vis-active"),this.keycharm.unbind("esc",this.escListener),this.emit("change"),this.emit("deactivate")},o.prototype._onTapOverlay=function(e){this.activate(),e.stopPropagation()},e.exports=o},function(e,t){t.en={edit:"Edit",del:"Delete selected",back:"Back",addNode:"Add Node",addEdge:"Add Edge",editNode:"Edit Node",editEdge:"Edit Edge",addDescription:"Click in an empty space to place a new node.",edgeDescription:"Click on a node and drag the edge to another node to connect them.",editEdgeDescription:"Click on the control points and drag them to a node to connect to it.",createEdgeError:"Cannot link edges to a cluster.",deleteClusterError:"Clusters cannot be deleted.",editClusterError:"Clusters cannot be edited."},t.en_EN=t.en,t.en_US=t.en,t.de={edit:"Editieren",del:"Lösche Auswahl",back:"Zurück",addNode:"Knoten hinzufügen",addEdge:"Kante hinzufügen",editNode:"Knoten editieren",editEdge:"Kante editieren",addDescription:"Klicke auf eine freie Stelle, um einen neuen Knoten zu plazieren.",edgeDescription:"Klicke auf einen Knoten und ziehe die Kante zu einem anderen Knoten, um diese zu verbinden.",editEdgeDescription:"Klicke auf die Verbindungspunkte und ziehe diese auf einen Knoten, um sie zu verbinden.",createEdgeError:"Es ist nicht möglich, Kanten mit Clustern zu verbinden.",deleteClusterError:"Cluster können nicht gelöscht werden.",editClusterError:"Cluster können nicht editiert werden."},t.de_DE=t.de,t.es={edit:"Editar",del:"Eliminar selección",back:"Átras",addNode:"Añadir nodo",addEdge:"Añadir arista",editNode:"Editar nodo",editEdge:"Editar arista",addDescription:"Haga clic en un lugar vacío para colocar un nuevo nodo.",edgeDescription:"Haga clic en un nodo y arrastre la arista hacia otro nodo para conectarlos.",editEdgeDescription:"Haga clic en un punto de control y arrastrelo a un nodo para conectarlo.",createEdgeError:"No se puede conectar una arista a un grupo.",deleteClusterError:"No es posible eliminar grupos.",editClusterError:"No es posible editar grupos."},t.es_ES=t.es,t.nl={edit:"Wijzigen",del:"Selectie verwijderen",back:"Terug",addNode:"Node toevoegen",addEdge:"Link toevoegen",editNode:"Node wijzigen",editEdge:"Link wijzigen",addDescription:"Klik op een leeg gebied om een nieuwe node te maken.",edgeDescription:"Klik op een node en sleep de link naar een andere node om ze te verbinden.",editEdgeDescription:"Klik op de verbindingspunten en sleep ze naar een node om daarmee te verbinden.",createEdgeError:"Kan geen link maken naar een cluster.",deleteClusterError:"Clusters kunnen niet worden verwijderd.",editClusterError:"Clusters kunnen niet worden aangepast."},t.nl_NL=t.nl,t.nl_BE=t.nl}])});
+"use strict";!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.vis=t():e.vis=t()}(this,function(){return function(e){function t(n){if(i[n])return i[n].exports;var o=i[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var i={};return t.m=e,t.c=i,t.d=function(e,i,n){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=83)}([function(e,t,i){t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,i){t.__esModule=!0;var n=i(127),o=function(e){return e&&e.__esModule?e:{default:e}}(n);t.default=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),(0,o.default)(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}()},function(e,t,i){e.exports={default:i(143),__esModule:!0}},function(e,t,i){t.__esModule=!0;var n=i(7),o=function(e){return e&&e.__esModule?e:{default:e}}(n);t.default=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":(0,o.default)(t))&&"function"!=typeof t?e:t}},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=i(145),s=n(o),r=i(30),a=n(r),d=i(7),h=n(d);t.default=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":(0,h.default)(t)));e.prototype=(0,a.default)(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(s.default?(0,s.default)(e,t):e.__proto__=t)}},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t,i,n){var o=!1;!0===n&&(o=null===t[i]&&void 0!==e[i]),o?delete e[i]:e[i]=t[i]}var s=i(58),r=n(s),a=i(30),d=n(a),h=i(10),l=n(h),u=i(7),c=n(u),f=i(71),p=i(117);t.isNumber=function(e){return e instanceof Number||"number"==typeof e},t.recursiveDOMDelete=function(e){if(e)for(;!0===e.hasChildNodes();)t.recursiveDOMDelete(e.firstChild),e.removeChild(e.firstChild)},t.giveRange=function(e,t,i,n){if(t==e)return.5;var o=1/(t-e);return Math.max(0,(n-e)*o)},t.isString=function(e){return e instanceof String||"string"==typeof e},t.isDate=function(e){if(e instanceof Date)return!0;if(t.isString(e)){if(v.exec(e))return!0;if(!isNaN(Date.parse(e)))return!0}return!1},t.randomUUID=function(){return p.v4()},t.assignAllKeys=function(e,t){for(var i in e)e.hasOwnProperty(i)&&"object"!==(0,c.default)(e[i])&&(e[i]=t)},t.fillIfDefined=function(e,i){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(var s in e)void 0!==i[s]&&(null===i[s]||"object"!==(0,c.default)(i[s])?o(e,i,s,n):"object"===(0,c.default)(e[s])&&t.fillIfDefined(e[s],i[s],n))},t.extend=function(e,t){for(var i=1;i<arguments.length;i++){var n=arguments[i];for(var o in n)n.hasOwnProperty(o)&&(e[o]=n[o])}return e},t.selectiveExtend=function(e,t,i){if(!Array.isArray(e))throw new Error("Array with property names expected as first argument");for(var n=2;n<arguments.length;n++)for(var o=arguments[n],s=0;s<e.length;s++){var r=e[s];o&&o.hasOwnProperty(r)&&(t[r]=o[r])}return t},t.selectiveDeepExtend=function(e,i,n){var s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Array.isArray(n))throw new TypeError("Arrays are not supported by deepExtend");for(var r=0;r<e.length;r++){var a=e[r];if(n.hasOwnProperty(a))if(n[a]&&n[a].constructor===Object)void 0===i[a]&&(i[a]={}),i[a].constructor===Object?t.deepExtend(i[a],n[a],!1,s):o(i,n,a,s);else{if(Array.isArray(n[a]))throw new TypeError("Arrays are not supported by deepExtend");o(i,n,a,s)}}return i},t.selectiveNotDeepExtend=function(e,i,n){var s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Array.isArray(n))throw new TypeError("Arrays are not supported by deepExtend");for(var r in n)if(n.hasOwnProperty(r)&&-1===e.indexOf(r))if(n[r]&&n[r].constructor===Object)void 0===i[r]&&(i[r]={}),i[r].constructor===Object?t.deepExtend(i[r],n[r]):o(i,n,r,s);else if(Array.isArray(n[r])){i[r]=[];for(var a=0;a<n[r].length;a++)i[r].push(n[r][a])}else o(i,n,r,s);return i},t.deepExtend=function(e,i){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];for(var r in i)if(i.hasOwnProperty(r)||!0===n)if(i[r]&&i[r].constructor===Object)void 0===e[r]&&(e[r]={}),e[r].constructor===Object?t.deepExtend(e[r],i[r],n):o(e,i,r,s);else if(Array.isArray(i[r])){e[r]=[];for(var a=0;a<i[r].length;a++)e[r].push(i[r][a])}else o(e,i,r,s);return e},t.equalArray=function(e,t){if(e.length!=t.length)return!1;for(var i=0,n=e.length;i<n;i++)if(e[i]!=t[i])return!1;return!0},t.convert=function(e,i){var n;if(void 0!==e){if(null===e)return null;if(!i)return e;if("string"!=typeof i&&!(i instanceof String))throw new Error("Type must be a string");switch(i){case"boolean":case"Boolean":return Boolean(e);case"number":case"Number":return t.isString(e)&&!isNaN(Date.parse(e))?f(e).valueOf():Number(e.valueOf());case"string":case"String":return String(e);case"Date":if(t.isNumber(e))return new Date(e);if(e instanceof Date)return new Date(e.valueOf());if(f.isMoment(e))return new Date(e.valueOf());if(t.isString(e))return n=v.exec(e),n?new Date(Number(n[1])):f(new Date(e)).toDate();throw new Error("Cannot convert object of type "+t.getType(e)+" to type Date");case"Moment":if(t.isNumber(e))return f(e);if(e instanceof Date)return f(e.valueOf());if(f.isMoment(e))return f(e);if(t.isString(e))return n=v.exec(e),f(n?Number(n[1]):e);throw new Error("Cannot convert object of type "+t.getType(e)+" to type Date");case"ISODate":if(t.isNumber(e))return new Date(e);if(e instanceof Date)return e.toISOString();if(f.isMoment(e))return e.toDate().toISOString();if(t.isString(e))return n=v.exec(e),n?new Date(Number(n[1])).toISOString():f(e).format();throw new Error("Cannot convert object of type "+t.getType(e)+" to type ISODate");case"ASPDate":if(t.isNumber(e))return"/Date("+e+")/";if(e instanceof Date)return"/Date("+e.valueOf()+")/";if(t.isString(e)){n=v.exec(e);return"/Date("+(n?new Date(Number(n[1])).valueOf():new Date(e).valueOf())+")/"}throw new Error("Cannot convert object of type "+t.getType(e)+" to type ASPDate");default:throw new Error('Unknown type "'+i+'"')}}};var v=/^\/?Date\((\-?\d+)/i;t.getType=function(e){var t=void 0===e?"undefined":(0,c.default)(e);return"object"==t?null===e?"null":e instanceof Boolean?"Boolean":e instanceof Number?"Number":e instanceof String?"String":Array.isArray(e)?"Array":e instanceof Date?"Date":"Object":"number"==t?"Number":"boolean"==t?"Boolean":"string"==t?"String":void 0===t?"undefined":t},t.copyAndExtendArray=function(e,t){for(var i=[],n=0;n<e.length;n++)i.push(e[n]);return i.push(t),i},t.copyArray=function(e){for(var t=[],i=0;i<e.length;i++)t.push(e[i]);return t},t.getAbsoluteLeft=function(e){return e.getBoundingClientRect().left},t.getAbsoluteRight=function(e){return e.getBoundingClientRect().right},t.getAbsoluteTop=function(e){return e.getBoundingClientRect().top},t.addClassName=function(e,t){var i=e.className.split(" "),n=t.split(" ");i=i.concat(n.filter(function(e){return i.indexOf(e)<0})),e.className=i.join(" ")},t.removeClassName=function(e,t){var i=e.className.split(" "),n=t.split(" ");i=i.filter(function(e){return n.indexOf(e)<0}),e.className=i.join(" ")},t.forEach=function(e,t){var i,n;if(Array.isArray(e))for(i=0,n=e.length;i<n;i++)t(e[i],i,e);else for(i in e)e.hasOwnProperty(i)&&t(e[i],i,e)},t.toArray=function(e){var t=[];for(var i in e)e.hasOwnProperty(i)&&t.push(e[i]);return t},t.updateProperty=function(e,t,i){return e[t]!==i&&(e[t]=i,!0)},t.throttle=function(e){var t=!1;return function(){t||(t=!0,requestAnimationFrame(function(){t=!1,e()}))}},t.addEventListener=function(e,t,i,n){e.addEventListener?(void 0===n&&(n=!1),"mousewheel"===t&&navigator.userAgent.indexOf("Firefox")>=0&&(t="DOMMouseScroll"),e.addEventListener(t,i,n)):e.attachEvent("on"+t,i)},t.removeEventListener=function(e,t,i,n){e.removeEventListener?(void 0===n&&(n=!1),"mousewheel"===t&&navigator.userAgent.indexOf("Firefox")>=0&&(t="DOMMouseScroll"),e.removeEventListener(t,i,n)):e.detachEvent("on"+t,i)},t.preventDefault=function(e){e||(e=window.event),e.preventDefault?e.preventDefault():e.returnValue=!1},t.getTarget=function(e){e||(e=window.event);var t;return e.target?t=e.target:e.srcElement&&(t=e.srcElement),void 0!=t.nodeType&&3==t.nodeType&&(t=t.parentNode),t},t.hasParent=function(e,t){for(var i=e;i;){if(i===t)return!0;i=i.parentNode}return!1},t.option={},t.option.asBoolean=function(e,t){return"function"==typeof e&&(e=e()),null!=e?0!=e:t||null},t.option.asNumber=function(e,t){return"function"==typeof e&&(e=e()),null!=e?Number(e)||t||null:t||null},t.option.asString=function(e,t){return"function"==typeof e&&(e=e()),null!=e?String(e):t||null},t.option.asSize=function(e,i){return"function"==typeof e&&(e=e()),t.isString(e)?e:t.isNumber(e)?e+"px":i||null},t.option.asElement=function(e,t){return"function"==typeof e&&(e=e()),e||t||null},t.hexToRGB=function(e){var t=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;e=e.replace(t,function(e,t,i,n){return t+t+i+i+n+n});var i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return i?{r:parseInt(i[1],16),g:parseInt(i[2],16),b:parseInt(i[3],16)}:null},t.overrideOpacity=function(e,i){var n;return-1!=e.indexOf("rgba")?e:-1!=e.indexOf("rgb")?(n=e.substr(e.indexOf("(")+1).replace(")","").split(","),"rgba("+n[0]+","+n[1]+","+n[2]+","+i+")"):(n=t.hexToRGB(e),null==n?e:"rgba("+n.r+","+n.g+","+n.b+","+i+")")},t.RGBToHex=function(e,t,i){return"#"+((1<<24)+(e<<16)+(t<<8)+i).toString(16).slice(1)},t.parseColor=function(e){var i;if(!0===t.isString(e)){if(!0===t.isValidRGB(e)){var n=e.substr(4).substr(0,e.length-5).split(",").map(function(e){return parseInt(e)});e=t.RGBToHex(n[0],n[1],n[2])}if(!0===t.isValidHex(e)){var o=t.hexToHSV(e),s={h:o.h,s:.8*o.s,v:Math.min(1,1.02*o.v)},r={h:o.h,s:Math.min(1,1.25*o.s),v:.8*o.v},a=t.HSVToHex(r.h,r.s,r.v),d=t.HSVToHex(s.h,s.s,s.v);i={background:e,border:a,highlight:{background:d,border:a},hover:{background:d,border:a}}}else i={background:e,border:e,highlight:{background:e,border:e},hover:{background:e,border:e}}}else i={},i.background=e.background||void 0,i.border=e.border||void 0,t.isString(e.highlight)?i.highlight={border:e.highlight,background:e.highlight}:(i.highlight={},i.highlight.background=e.highlight&&e.highlight.background||void 0,i.highlight.border=e.highlight&&e.highlight.border||void 0),t.isString(e.hover)?i.hover={border:e.hover,background:e.hover}:(i.hover={},i.hover.background=e.hover&&e.hover.background||void 0,i.hover.border=e.hover&&e.hover.border||void 0);return i},t.RGBToHSV=function(e,t,i){e/=255,t/=255,i/=255;var n=Math.min(e,Math.min(t,i)),o=Math.max(e,Math.max(t,i));if(n==o)return{h:0,s:0,v:n};var s=e==n?t-i:i==n?e-t:i-e;return{h:60*((e==n?3:i==n?1:5)-s/(o-n))/360,s:(o-n)/o,v:o}};var g={split:function(e){var t={};return e.split(";").forEach(function(e){if(""!=e.trim()){var i=e.split(":"),n=i[0].trim(),o=i[1].trim();t[n]=o}}),t},join:function(e){return(0,l.default)(e).map(function(t){return t+": "+e[t]}).join("; ")}};t.addCssText=function(e,i){var n=g.split(e.style.cssText),o=g.split(i),s=t.extend(n,o);e.style.cssText=g.join(s)},t.removeCssText=function(e,t){var i=g.split(e.style.cssText),n=g.split(t);for(var o in n)n.hasOwnProperty(o)&&delete i[o];e.style.cssText=g.join(i)},t.HSVToRGB=function(e,t,i){var n,o,s,r=Math.floor(6*e),a=6*e-r,d=i*(1-t),h=i*(1-a*t),l=i*(1-(1-a)*t);switch(r%6){case 0:n=i,o=l,s=d;break;case 1:n=h,o=i,s=d;break;case 2:n=d,o=i,s=l;break;case 3:n=d,o=h,s=i;break;case 4:n=l,o=d,s=i;break;case 5:n=i,o=d,s=h}return{r:Math.floor(255*n),g:Math.floor(255*o),b:Math.floor(255*s)}},t.HSVToHex=function(e,i,n){var o=t.HSVToRGB(e,i,n);return t.RGBToHex(o.r,o.g,o.b)},t.hexToHSV=function(e){var i=t.hexToRGB(e);return t.RGBToHSV(i.r,i.g,i.b)},t.isValidHex=function(e){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(e)},t.isValidRGB=function(e){return e=e.replace(" ",""),/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/i.test(e)},t.isValidRGBA=function(e){return e=e.replace(" ",""),/rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(.{1,3})\)/i.test(e)},t.selectiveBridgeObject=function(e,i){if(null!==i&&"object"===(void 0===i?"undefined":(0,c.default)(i))){for(var n=(0,d.default)(i),o=0;o<e.length;o++)i.hasOwnProperty(e[o])&&"object"==(0,c.default)(i[e[o]])&&(n[e[o]]=t.bridgeObject(i[e[o]]));return n}return null},t.bridgeObject=function(e){if(null!==e&&"object"===(void 0===e?"undefined":(0,c.default)(e))){var i=(0,d.default)(e);if(e instanceof Element)i=e;else{i=(0,d.default)(e);for(var n in e)e.hasOwnProperty(n)&&"object"==(0,c.default)(e[n])&&(i[n]=t.bridgeObject(e[n]))}return i}return null},t.insertSort=function(e,t){for(var i=0;i<e.length;i++){for(var n=e[i],o=i;o>0&&t(n,e[o-1])<0;o--)e[o]=e[o-1];e[o]=n}return e},t.mergeOptions=function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=function(e){return null!==e&&void 0!==e},s=function(e){return null!==e&&"object"===(void 0===e?"undefined":(0,c.default)(e))};if(!s(e))throw new Error("Parameter mergeTarget must be an object");if(!s(t))throw new Error("Parameter options must be an object");if(!o(i))throw new Error("Parameter option must have a value");if(!s(n))throw new Error("Parameter globalOptions must be an object");var r=t[i],a=s(n)&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(n),h=a?n[i]:void 0,l=h?h.enabled:void 0;if(void 0!==r){if("boolean"==typeof r)return s(e[i])||(e[i]={}),void(e[i].enabled=r);if(null===r&&!s(e[i])){if(!o(h))return;e[i]=(0,d.default)(h)}if(s(r)){var u=!0;void 0!==r.enabled?u=r.enabled:void 0!==l&&(u=h.enabled),function(e,t,i){s(e[i])||(e[i]={});var n=t[i],o=e[i];for(var r in n)n.hasOwnProperty(r)&&(o[r]=n[r])}(e,t,i),e[i].enabled=u}}},t.binarySearchCustom=function(e,t,i,n){for(var o=0,s=0,r=e.length-1;s<=r&&o<1e4;){var a=Math.floor((s+r)/2),d=e[a],h=void 0===n?d[i]:d[i][n],l=t(h);if(0==l)return a;-1==l?s=a+1:r=a-1,o++}return-1},t.binarySearchValue=function(e,t,i,n,o){var s,r,a,d,h=0,l=0,u=e.length-1;for(o=void 0!=o?o:function(e,t){return e==t?0:e<t?-1:1};l<=u&&h<1e4;){if(d=Math.floor(.5*(u+l)),s=e[Math.max(0,d-1)][i],r=e[d][i],a=e[Math.min(e.length-1,d+1)][i],0==o(r,t))return d;if(o(s,t)<0&&o(r,t)>0)return"before"==n?Math.max(0,d-1):d;if(o(r,t)<0&&o(a,t)>0)return"before"==n?d:Math.min(e.length-1,d+1);o(r,t)<0?l=d+1:u=d-1,h++}return-1},t.easingFunctions={linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return e*(2-e)},easeInOutQuad:function(e){return e<.5?2*e*e:(4-2*e)*e-1},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return--e*e*e+1},easeInOutCubic:function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return 1- --e*e*e*e},easeInOutQuart:function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return 1+--e*e*e*e*e},easeInOutQuint:function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e}},t.getScrollBarWidth=function(){var e=document.createElement("p");e.style.width="100%",e.style.height="200px";var t=document.createElement("div");t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.appendChild(e),document.body.appendChild(t);var i=e.offsetWidth;t.style.overflow="scroll";var n=e.offsetWidth;return i==n&&(n=t.clientWidth),document.body.removeChild(t),i-n},t.topMost=function(e,t){var i=void 0;Array.isArray(t)||(t=[t]);var n=!0,o=!1,s=void 0;try{for(var a,d=(0,r.default)(e);!(n=(a=d.next()).done);n=!0){var h=a.value;if(h){i=h[t[0]];for(var l=1;l<t.length;l++)i&&(i=i[t[l]]);if(void 0!==i)break}}}catch(e){o=!0,s=e}finally{try{!n&&d.return&&d.return()}finally{if(o)throw s}}return i}},function(e,t){var i=e.exports={version:"2.5.1"};"number"==typeof __e&&(__e=i)},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=i(102),s=n(o),r=i(104),a=n(r),d="function"==typeof a.default&&"symbol"==typeof s.default?function(e){return typeof e}:function(e){return e&&"function"==typeof a.default&&e.constructor===a.default&&e!==a.default.prototype?"symbol":typeof e};t.default="function"==typeof a.default&&"symbol"===d(s.default)?function(e){return void 0===e?"undefined":d(e)}:function(e){return e&&"function"==typeof a.default&&e.constructor===a.default&&e!==a.default.prototype?"symbol":void 0===e?"undefined":d(e)}},function(e,t,i){var n=i(44)("wks"),o=i(28),s=i(9).Symbol,r="function"==typeof s;(e.exports=function(e){return n[e]||(n[e]=r&&s[e]||(r?s:o)("Symbol."+e))}).store=n},function(e,t){var i=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},function(e,t,i){e.exports={default:i(100),__esModule:!0}},function(e,t,i){var n=i(9),o=i(6),s=i(61),r=i(18),a=function(e,t,i){var d,h,l,u=e&a.F,c=e&a.G,f=e&a.S,p=e&a.P,v=e&a.B,g=e&a.W,y=c?o:o[t]||(o[t]={}),m=y.prototype,b=c?n:f?n[t]:(n[t]||{}).prototype;c&&(i=t);for(d in i)(h=!u&&b&&void 0!==b[d])&&d in y||(l=h?b[d]:i[d],y[d]=c&&"function"!=typeof b[d]?i[d]:v&&h?s(l,n):g&&b[d]==l?function(e){var t=function(t,i,n){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,i)}return new e(t,i,n)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(l):p&&"function"==typeof l?s(Function.call,l):l,p&&((y.virtual||(y.virtual={}))[d]=l,e&a.R&&m&&!m[d]&&r(m,d,l)))};a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,e.exports=a},function(e,t,i){var n=i(19),o=i(62),s=i(40),r=Object.defineProperty;t.f=i(13)?Object.defineProperty:function(e,t,i){if(n(e),t=s(t,!0),n(i),o)try{return r(e,t,i)}catch(e){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(e[t]=i.value),e}},function(e,t,i){e.exports=!i(20)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){var i={}.hasOwnProperty;e.exports=function(e,t){return i.call(e,t)}},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(7),s=n(o),r=i(0),a=n(r),d=i(1),h=n(d),l=function(){function e(t,i,n){(0,a.default)(this,e),this.body=i,this.labelModule=n,this.setOptions(t),this.top=void 0,this.left=void 0,this.height=void 0,this.width=void 0,this.radius=void 0,this.margin=void 0,this.refreshNeeded=!0,this.boundingBox={top:0,left:0,right:0,bottom:0}}return(0,h.default)(e,[{key:"setOptions",value:function(e){this.options=e}},{key:"_setMargins",value:function(e){this.margin={},this.options.margin&&("object"==(0,s.default)(this.options.margin)?(this.margin.top=this.options.margin.top,this.margin.right=this.options.margin.right,this.margin.bottom=this.options.margin.bottom,this.margin.left=this.options.margin.left):(this.margin.top=this.options.margin,this.margin.right=this.options.margin,this.margin.bottom=this.options.margin,this.margin.left=this.options.margin)),e.adjustSizes(this.margin)}},{key:"_distanceToBorder",value:function(e,t){var i=this.options.borderWidth;return this.resize(e),Math.min(Math.abs(this.width/2/Math.cos(t)),Math.abs(this.height/2/Math.sin(t)))+i}},{key:"enableShadow",value:function(e,t){t.shadow&&(e.shadowColor=t.shadowColor,e.shadowBlur=t.shadowSize,e.shadowOffsetX=t.shadowX,e.shadowOffsetY=t.shadowY)}},{key:"disableShadow",value:function(e,t){t.shadow&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}},{key:"enableBorderDashes",value:function(e,t){if(!1!==t.borderDashes)if(void 0!==e.setLineDash){var i=t.borderDashes;!0===i&&(i=[5,15]),e.setLineDash(i)}else console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,t.borderDashes=!1}},{key:"disableBorderDashes",value:function(e,t){!1!==t.borderDashes&&(void 0!==e.setLineDash?e.setLineDash([0]):(console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,t.borderDashes=!1))}},{key:"needsRefresh",value:function(e,t){return!0===this.refreshNeeded?(this.refreshNeeded=!1,!0):void 0===this.width||this.labelModule.differentState(e,t)}},{key:"initContextForDraw",value:function(e,t){var i=t.borderWidth/this.body.view.scale;e.lineWidth=Math.min(this.width,i),e.strokeStyle=t.borderColor,e.fillStyle=t.color}},{key:"performStroke",value:function(e,t){var i=t.borderWidth/this.body.view.scale;e.save(),i>0&&(this.enableBorderDashes(e,t),e.stroke(),this.disableBorderDashes(e,t)),e.restore()}},{key:"performFill",value:function(e,t){this.enableShadow(e,t),e.fill(),this.disableShadow(e,t),this.performStroke(e,t)}},{key:"_addBoundingBoxMargin",value:function(e){this.boundingBox.left-=e,this.boundingBox.top-=e,this.boundingBox.bottom+=e,this.boundingBox.right+=e}},{key:"_updateBoundingBox",value:function(e,t,i,n,o){void 0!==i&&this.resize(i,n,o),this.left=e-this.width/2,this.top=t-this.height/2,this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width}},{key:"updateBoundingBox",value:function(e,t,i,n,o){this._updateBoundingBox(e,t,i,n,o)}},{key:"getDimensionsFromLabel",value:function(e,t,i){this.textSize=this.labelModule.getTextSize(e,t,i);var n=this.textSize.width,o=this.textSize.height;return 0===n&&(n=14,o=14),{width:n,height:o}}}]),e}();t.default=l},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(2),s=n(o),r=i(0),a=n(r),d=i(1),h=n(d),l=i(3),u=n(l),c=i(4),f=n(c),p=i(15),v=n(p),g=function(e){function t(e,i,n){return(0,a.default)(this,t),(0,u.default)(this,(t.__proto__||(0,s.default)(t)).call(this,e,i,n))}return(0,f.default)(t,e),(0,h.default)(t,[{key:"resize",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{size:this.options.size};if(this.needsRefresh(t,i)){this.labelModule.getTextSize(e,t,i);var o=2*n.size;this.width=o,this.height=o,this.radius=.5*this.width}}},{key:"_drawShape",value:function(e,t,i,n,o,s,r,a){if(this.resize(e,s,r,a),this.left=n-this.width/2,this.top=o-this.height/2,this.initContextForDraw(e,a),e[t](n,o,a.size),this.performFill(e,a),void 0!==this.options.label){this.labelModule.calculateLabelSize(e,s,r,n,o,"hanging");var d=o+.5*this.height+.5*this.labelModule.size.height;this.labelModule.draw(e,n,d,s,r,"hanging")}this.updateBoundingBox(n,o)}},{key:"updateBoundingBox",value:function(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size,void 0!==this.options.label&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height))}}]),t}(v.default);t.default=g},function(e,t,i){var n=i(59),o=i(38);e.exports=function(e){return n(o(e))}},function(e,t,i){var n=i(12),o=i(27);e.exports=i(13)?function(e,t,i){return n.f(e,t,o(1,i))}:function(e,t,i){return e[t]=i,e}},function(e,t,i){var n=i(25);e.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,i){e.exports={default:i(120),__esModule:!0}},function(e,t,i){function n(){var e=function(){};return{on:e,off:e,destroy:e,emit:e,get:function(t){return{set:e}}}}if("undefined"!=typeof window){var o=i(124),s=window.Hammer||i(125);e.exports=o(s,{preventDefault:"mouse"})}else e.exports=function(){return n()}},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=i(133),s=n(o),r=i(58),a=n(r);t.default=function(){function e(e,t){var i=[],n=!0,o=!1,s=void 0;try{for(var r,d=(0,a.default)(e);!(n=(r=d.next()).done)&&(i.push(r.value),!t||i.length!==t);n=!0);}catch(e){o=!0,s=e}finally{try{!n&&d.return&&d.return()}finally{if(o)throw s}}return i}return function(t,i){if(Array.isArray(t))return t;if((0,s.default)(Object(t)))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()},function(e,t){e.exports={}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,i){var n=i(65),o=i(45);e.exports=Object.keys||function(e){return n(e,o)}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){var i=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++i+n).toString(36))}},function(e,t,i){var n=i(38);e.exports=function(e){return Object(n(e))}},function(e,t,i){e.exports={default:i(98),__esModule:!0}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(e&&!Array.isArray(e)&&(t=e,e=null),this._options=t||{},this._data={},this.length=0,this._fieldId=this._options.fieldId||"id",this._type={},this._options.type)for(var i=(0,l.default)(this._options.type),n=0,o=i.length;n<o;n++){var s=i[n],r=this._options.type[s];this._type[s]="Date"==r||"ISODate"==r||"ASPDate"==r?"Date":r}this._subscribers={},e&&this.add(e),this.setOptions(t)}var s=i(21),r=n(s),a=i(7),d=n(a),h=i(10),l=n(h),u=i(5),c=i(72);o.prototype.setOptions=function(e){e&&void 0!==e.queue&&(!1===e.queue?this._queue&&(this._queue.destroy(),delete this._queue):(this._queue||(this._queue=c.extend(this,{replace:["add","update","remove"]})),"object"===(0,d.default)(e.queue)&&this._queue.setOptions(e.queue)))},o.prototype.on=function(e,t){var i=this._subscribers[e];i||(i=[],this._subscribers[e]=i),i.push({callback:t})},o.prototype.off=function(e,t){var i=this._subscribers[e];i&&(this._subscribers[e]=i.filter(function(e){return e.callback!=t}))},o.prototype._trigger=function(e,t,i){if("*"==e)throw new Error("Cannot trigger event *");var n=[];e in this._subscribers&&(n=n.concat(this._subscribers[e])),"*"in this._subscribers&&(n=n.concat(this._subscribers["*"]));for(var o=0,s=n.length;o<s;o++){var r=n[o];r.callback&&r.callback(e,t,i||null)}},o.prototype.add=function(e,t){var i,n=[],o=this;if(Array.isArray(e))for(var s=0,r=e.length;s<r;s++)i=o._addItem(e[s]),n.push(i);else{if(!e||"object"!==(void 0===e?"undefined":(0,d.default)(e)))throw new Error("Unknown dataType");i=o._addItem(e),n.push(i)}return n.length&&this._trigger("add",{items:n},t),n},o.prototype.update=function(e,t){var i=[],n=[],o=[],s=[],r=this,a=r._fieldId,h=function(e){var t=e[a];if(r._data[t]){var d=u.extend({},r._data[t]);t=r._updateItem(e),n.push(t),s.push(e),o.push(d)}else t=r._addItem(e),i.push(t)};if(Array.isArray(e))for(var l=0,c=e.length;l<c;l++)e[l]&&"object"===(0,d.default)(e[l])?h(e[l]):console.warn("Ignoring input item, which is not an object at index "+l);else{if(!e||"object"!==(void 0===e?"undefined":(0,d.default)(e)))throw new Error("Unknown dataType");h(e)}if(i.length&&this._trigger("add",{items:i},t),n.length){var f={items:n,oldData:o,data:s};this._trigger("update",f,t)}return i.concat(n)},o.prototype.get=function(e){var t,i,n,o=this,s=u.getType(arguments[0]);"String"==s||"Number"==s?(t=arguments[0],n=arguments[1]):"Array"==s?(i=arguments[0],n=arguments[1]):n=arguments[0];var r;if(n&&n.returnType){r=-1==["Array","Object"].indexOf(n.returnType)?"Array":n.returnType}else r="Array";var a,d,h,c,f,p=n&&n.type||this._options.type,v=n&&n.filter,g=[];if(void 0!=t)(a=o._getItem(t,p))&&v&&!v(a)&&(a=null);else if(void 0!=i)for(c=0,f=i.length;c<f;c++)a=o._getItem(i[c],p),v&&!v(a)||g.push(a);else for(d=(0,l.default)(this._data),c=0,f=d.length;c<f;c++)h=d[c],a=o._getItem(h,p),v&&!v(a)||g.push(a);if(n&&n.order&&void 0==t&&this._sort(g,n.order),n&&n.fields){var y=n.fields;if(void 0!=t)a=this._filterFields(a,y);else for(c=0,f=g.length;c<f;c++)g[c]=this._filterFields(g[c],y)}if("Object"==r){var m,b={};for(c=0,f=g.length;c<f;c++)m=g[c],b[m.id]=m;return b}return void 0!=t?a:g},o.prototype.getIds=function(e){var t,i,n,o,s,r=this._data,a=e&&e.filter,d=e&&e.order,h=e&&e.type||this._options.type,u=(0,l.default)(r),c=[];if(a)if(d){for(s=[],t=0,i=u.length;t<i;t++)n=u[t],o=this._getItem(n,h),a(o)&&s.push(o);for(this._sort(s,d),t=0,i=s.length;t<i;t++)c.push(s[t][this._fieldId])}else for(t=0,i=u.length;t<i;t++)n=u[t],o=this._getItem(n,h),a(o)&&c.push(o[this._fieldId]);else if(d){for(s=[],t=0,i=u.length;t<i;t++)n=u[t],s.push(r[n]);for(this._sort(s,d),t=0,i=s.length;t<i;t++)c.push(s[t][this._fieldId])}else for(t=0,i=u.length;t<i;t++)n=u[t],o=r[n],c.push(o[this._fieldId]);return c},o.prototype.getDataSet=function(){return this},o.prototype.forEach=function(e,t){var i,n,o,s,r=t&&t.filter,a=t&&t.type||this._options.type,d=this._data,h=(0,l.default)(d);if(t&&t.order){var u=this.get(t);for(i=0,n=u.length;i<n;i++)o=u[i],s=o[this._fieldId],e(o,s)}else for(i=0,n=h.length;i<n;i++)s=h[i],o=this._getItem(s,a),r&&!r(o)||e(o,s)},o.prototype.map=function(e,t){var i,n,o,s,r=t&&t.filter,a=t&&t.type||this._options.type,d=[],h=this._data,u=(0,l.default)(h);for(i=0,n=u.length;i<n;i++)o=u[i],s=this._getItem(o,a),r&&!r(s)||d.push(e(s,o));return t&&t.order&&this._sort(d,t.order),d},o.prototype._filterFields=function(e,t){if(!e)return e;var i,n,o={},s=(0,l.default)(e),r=s.length;if(Array.isArray(t))for(i=0;i<r;i++)n=s[i],-1!=t.indexOf(n)&&(o[n]=e[n]);else for(i=0;i<r;i++)n=s[i],t.hasOwnProperty(n)&&(o[t[n]]=e[n]);return o},o.prototype._sort=function(e,t){if(u.isString(t)){var i=t;e.sort(function(e,t){var n=e[i],o=t[i];return n>o?1:n<o?-1:0})}else{if("function"!=typeof t)throw new TypeError("Order must be a function or a string");e.sort(t)}},o.prototype.remove=function(e,t){var i,n,o,s,r=[],a=[],d=[];for(d=Array.isArray(e)?e:[e],i=0,n=d.length;i<n;i++)(s=this._remove(d[i]))&&void 0!=(o=s[this._fieldId])&&(r.push(o),a.push(s));return r.length&&this._trigger("remove",{items:r,oldData:a},t),r},o.prototype._remove=function(e){var t,i;return u.isNumber(e)||u.isString(e)?i=e:e&&"object"===(void 0===e?"undefined":(0,d.default)(e))&&(i=e[this._fieldId]),void 0!==i&&this._data[i]?(t=this._data[i],delete this._data[i],this.length--,t):null},o.prototype.clear=function(e){var t,i,n=(0,l.default)(this._data),o=[];for(t=0,i=n.length;t<i;t++)o.push(this._data[n[t]]);return this._data={},this.length=0,this._trigger("remove",{items:n,oldData:o},e),n},o.prototype.max=function(e){var t,i,n=this._data,o=(0,l.default)(n),s=null,r=null;for(t=0,i=o.length;t<i;t++){var a=o[t],d=n[a],h=d[e];null!=h&&(!s||h>r)&&(s=d,r=h)}return s},o.prototype.min=function(e){var t,i,n=this._data,o=(0,l.default)(n),s=null,r=null;for(t=0,i=o.length;t<i;t++){var a=o[t],d=n[a],h=d[e];null!=h&&(!s||h<r)&&(s=d,r=h)}return s},o.prototype.distinct=function(e){var t,i,n,o=this._data,s=(0,l.default)(o),r=[],a=this._options.type&&this._options.type[e]||null,d=0;for(t=0,n=s.length;t<n;t++){var h=s[t],c=o[h],f=c[e],p=!1;for(i=0;i<d;i++)if(r[i]==f){p=!0;break}p||void 0===f||(r[d]=f,d++)}if(a)for(t=0,n=r.length;t<n;t++)r[t]=u.convert(r[t],a);return r},o.prototype._addItem=function(e){var t=e[this._fieldId];if(void 0!=t){if(this._data[t])throw new Error("Cannot add item: item with id "+t+" already exists")}else t=u.randomUUID(),e[this._fieldId]=t;var i,n,o={},s=(0,l.default)(e);for(i=0,n=s.length;i<n;i++){var r=s[i],a=this._type[r];o[r]=u.convert(e[r],a)}return this._data[t]=o,this.length++,t},o.prototype._getItem=function(e,t){var i,n,o,s,r=this._data[e];if(!r)return null;var a={},d=(0,l.default)(r);if(t)for(o=0,s=d.length;o<s;o++)i=d[o],n=r[i],a[i]=u.convert(n,t[i]);else for(o=0,s=d.length;o<s;o++)i=d[o],n=r[i],a[i]=n;return a[this._fieldId]||(a[this._fieldId]=r.id),a},o.prototype._updateItem=function(e){var t=e[this._fieldId];if(void 0==t)throw new Error("Cannot update item: item has no id (item: "+(0,r.default)(e)+")");var i=this._data[t];if(!i)throw new Error("Cannot update item: no item with id "+t+" found");for(var n=(0,l.default)(e),o=0,s=n.length;o<s;o++){var a=n[o],d=this._type[a];i[a]=u.convert(e[a],d)}return t},e.exports=o},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(0),s=n(o),r=i(1),a=n(r),d=i(5),h=i(77).default,l=i(34).default,u=i(142).default,c=i(149).default,f=i(150).default,p=i(151).default,v=i(152).default,g=i(153).default,y=i(154).default,m=i(155).default,b=i(156).default,_=i(157).default,w=i(158).default,k=i(159).default,x=i(160).default,O=i(161).default,M=i(162).default,E=i(54),S=E.printStyle,D=function(){function e(t,i,n,o,r,a){(0,s.default)(this,e),this.options=d.bridgeObject(r),this.globalOptions=r,this.defaultOptions=a,this.body=i,this.edges=[],this.id=void 0,this.imagelist=n,this.grouplist=o,this.x=void 0,this.y=void 0,this.baseSize=this.options.size,this.baseFontSize=this.options.font.size,this.predefinedPosition=!1,this.selected=!1,this.hover=!1,this.labelModule=new h(this.body,this.options,!1),this.setOptions(t)}return(0,a.default)(e,[{key:"attachEdge",value:function(e){-1===this.edges.indexOf(e)&&this.edges.push(e)}},{key:"detachEdge",value:function(e){var t=this.edges.indexOf(e);-1!=t&&this.edges.splice(t,1)}},{key:"setOptions",value:function(t){var i=this.options.shape;if(t){if(void 0!==t.id&&(this.id=t.id),void 0===this.id)throw new Error("Node must have an id");e.checkMass(t,this.id),void 0!==t.x&&(null===t.x?(this.x=void 0,this.predefinedPosition=!1):(this.x=parseInt(t.x),this.predefinedPosition=!0)),void 0!==t.y&&(null===t.y?(this.y=void 0,this.predefinedPosition=!1):(this.y=parseInt(t.y),this.predefinedPosition=!0)),void 0!==t.size&&(this.baseSize=t.size),void 0!==t.value&&(t.value=parseFloat(t.value)),e.parseOptions(this.options,t,!0,this.globalOptions,this.grouplist);var n=[t,this.options,this.defaultOptions];return this.chooser=l.choosify("node",n),this._load_images(),this.updateLabelModule(t),this.updateShape(i),void 0!==t.hidden||void 0!==t.physics}}},{key:"_load_images",value:function(){if("circularImage"===this.options.shape||"image"===this.options.shape){if(void 0===this.options.image)throw new Error("Option image must be defined for node type '"+this.options.shape+"'");if(void 0===this.imagelist)throw new Error("Internal Error: No images provided");if("string"==typeof this.options.image)this.imageObj=this.imagelist.load(this.options.image,this.options.brokenImage,this.id);else{if(void 0===this.options.image.unselected)throw new Error("No unselected image provided");this.imageObj=this.imagelist.load(this.options.image.unselected,this.options.brokenImage,this.id),void 0!==this.options.image.selected?this.imageObjAlt=this.imagelist.load(this.options.image.selected,this.options.brokenImage,this.id):this.imageObjAlt=void 0}}}},{key:"getFormattingValues",value:function(){var e={color:this.options.color.background,borderWidth:this.options.borderWidth,borderColor:this.options.color.border,size:this.options.size,borderDashes:this.options.shapeProperties.borderDashes,borderRadius:this.options.shapeProperties.borderRadius,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y};return this.selected||this.hover?!0===this.chooser?this.selected?(e.borderWidth*=2,e.color=this.options.color.highlight.background,e.borderColor=this.options.color.highlight.border,e.shadow=this.options.shadow.enabled):this.hover&&(e.color=this.options.color.hover.background,e.borderColor=this.options.color.hover.border,e.shadow=this.options.shadow.enabled):"function"==typeof this.chooser&&(this.chooser(e,this.options.id,this.selected,this.hover),!1===e.shadow&&(e.shadowColor===this.options.shadow.color&&e.shadowSize===this.options.shadow.size&&e.shadowX===this.options.shadow.x&&e.shadowY===this.options.shadow.y||(e.shadow=!0))):e.shadow=this.options.shadow.enabled,e}},{key:"updateLabelModule",value:function(t){void 0!==this.options.label&&null!==this.options.label||(this.options.label=""),e.updateGroupOptions(this.options,t,this.grouplist);var i=this.grouplist.get(this.options.group,!1),n=[t,this.options,i,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,n),void 0!==this.labelModule.baseSize&&(this.baseFontSize=this.labelModule.baseSize)}},{key:"updateShape",value:function(e){if(e===this.options.shape&&this.shape)this.shape.setOptions(this.options,this.imageObj,this.imageObjAlt);else switch(this.options.shape){case"box":this.shape=new u(this.options,this.body,this.labelModule);break;case"circle":this.shape=new c(this.options,this.body,this.labelModule);break;case"circularImage":this.shape=new f(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"database":this.shape=new p(this.options,this.body,this.labelModule);break;case"diamond":this.shape=new v(this.options,this.body,this.labelModule);break;case"dot":this.shape=new g(this.options,this.body,this.labelModule);break;case"ellipse":this.shape=new y(this.options,this.body,this.labelModule);break;case"icon":this.shape=new m(this.options,this.body,this.labelModule);break;case"image":this.shape=new b(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"square":this.shape=new _(this.options,this.body,this.labelModule);break;case"hexagon":this.shape=new w(this.options,this.body,this.labelModule);break;case"star":this.shape=new k(this.options,this.body,this.labelModule);break;case"text":this.shape=new x(this.options,this.body,this.labelModule);break;case"triangle":this.shape=new O(this.options,this.body,this.labelModule);break;case"triangleDown":this.shape=new M(this.options,this.body,this.labelModule);break;default:this.shape=new y(this.options,this.body,this.labelModule)}this.needsRefresh()}},{key:"select",value:function(){this.selected=!0,this.needsRefresh()}},{key:"unselect",value:function(){this.selected=!1,this.needsRefresh()}},{key:"needsRefresh",value:function(){this.shape.refreshNeeded=!0}},{key:"getTitle",value:function(){return this.options.title}},{key:"distanceToBorder",value:function(e,t){return this.shape.distanceToBorder(e,t)}},{key:"isFixed",value:function(){return this.options.fixed.x&&this.options.fixed.y}},{key:"isSelected",value:function(){return this.selected}},{key:"getValue",value:function(){return this.options.value}},{key:"getLabelSize",value:function(){return this.labelModule.size()}},{key:"setValueRange",value:function(e,t,i){if(void 0!==this.options.value){var n=this.options.scaling.customScalingFunction(e,t,i,this.options.value),o=this.options.scaling.max-this.options.scaling.min;if(!0===this.options.scaling.label.enabled){var s=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+n*s}this.options.size=this.options.scaling.min+n*o}else this.options.size=this.baseSize,this.options.font.size=this.baseFontSize;this.updateLabelModule()}},{key:"draw",value:function(e){var t=this.getFormattingValues();this.shape.draw(e,this.x,this.y,this.selected,this.hover,t)}},{key:"updateBoundingBox",value:function(e){this.shape.updateBoundingBox(this.x,this.y,e)}},{key:"resize",value:function(e){var t=this.getFormattingValues();this.shape.resize(e,this.selected,this.hover,t)}},{key:"getItemsOnPoint",value:function(e){var t=[];return this.labelModule.visible()&&l.pointInRect(this.labelModule.getSize(),e)&&t.push({nodeId:this.id,labelId:0}),l.pointInRect(this.shape.boundingBox,e)&&t.push({nodeId:this.id}),t}},{key:"isOverlappingWith",value:function(e){return this.shape.left<e.right&&this.shape.left+this.shape.width>e.left&&this.shape.top<e.bottom&&this.shape.top+this.shape.height>e.top}},{key:"isBoundingBoxOverlappingWith",value:function(e){return this.shape.boundingBox.left<e.right&&this.shape.boundingBox.right>e.left&&this.shape.boundingBox.top<e.bottom&&this.shape.boundingBox.bottom>e.top}}],[{key:"updateGroupOptions",value:function(e,t,i){if(void 0!==i){var n=e.group;if(void 0!==t&&void 0!==t.group&&n!==t.group)throw new Error("updateGroupOptions: group values in options don't match.");if("number"==typeof n||"string"==typeof n&&""!=n){var o=i.get(n);d.selectiveNotDeepExtend(["font"],e,o),e.color=d.parseColor(e.color)}}}},{key:"parseOptions",value:function(t,i){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=arguments[4],r=["color","fixed","shadow"];if(d.selectiveNotDeepExtend(r,t,i,n),e.checkMass(i),d.mergeOptions(t,i,"shadow",o),void 0!==i.color&&null!==i.color){var a=d.parseColor(i.color);d.fillIfDefined(t.color,a)}else!0===n&&null===i.color&&(t.color=d.bridgeObject(o.color));void 0!==i.fixed&&null!==i.fixed&&("boolean"==typeof i.fixed?(t.fixed.x=i.fixed,t.fixed.y=i.fixed):(void 0!==i.fixed.x&&"boolean"==typeof i.fixed.x&&(t.fixed.x=i.fixed.x),void 0!==i.fixed.y&&"boolean"==typeof i.fixed.y&&(t.fixed.y=i.fixed.y))),!0===n&&null===i.font&&(t.font=d.bridgeObject(o.font)),e.updateGroupOptions(t,i,s),void 0!==i.scaling&&d.mergeOptions(t.scaling,i.scaling,"label",o.scaling)}},{key:"checkMass",value:function(e,t){if(void 0!==e.mass&&e.mass<=0){var i="";void 0!==t&&(i=" in node id: "+t),console.log("%cNegative or zero mass disallowed"+i+", setting mass to 1.",S),e.mass=1}}}]),e}();t.default=D},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(7),s=n(o),r=i(0),a=n(r),d=i(1),h=n(d),l=i(5),u=function(){function e(){(0,a.default)(this,e)}return(0,h.default)(e,null,[{key:"choosify",value:function(e,t){var i=["node","edge","label"],n=!0,o=l.topMost(t,"chosen");if("boolean"==typeof o)n=o;else if("object"===(void 0===o?"undefined":(0,s.default)(o))){if(-1===i.indexOf(e))throw new Error("choosify: subOption '"+e+"' should be one of '"+i.join("', '")+"'");var r=l.topMost(t,["chosen",e]);"boolean"!=typeof r&&"function"!=typeof r||(n=r)}return n}},{key:"pointInRect",value:function(e,t,i){if(e.width<=0||e.height<=0)return!1;if(void 0!==i){var n={x:t.x-i.x,y:t.y-i.y};if(0!==i.angle){var o=-i.angle;t={x:Math.cos(o)*n.x-Math.sin(o)*n.y,y:Math.sin(o)*n.x+Math.cos(o)*n.y}}else t=n}var s=e.x+e.width,r=e.y+e.width;return e.left<t.x&&s>t.x&&e.top<t.y&&r>t.y}},{key:"isValidLabel",value:function(e){return"string"==typeof e&&""!==e}}]),e}();t.default=u},function(e,t,i){t.onTouch=function(e,t){t.inputHandler=function(e){e.isFirst&&t(e)},e.on("hammer.input",t.inputHandler)},t.onRelease=function(e,t){return t.inputHandler=function(e){e.isFinal&&t(e)},e.on("hammer.input",t.inputHandler)},t.offTouch=function(e,t){e.off("hammer.input",t.inputHandler)},t.offRelease=t.offTouch,t.disablePreventDefaultVertically=function(e){return e.getTouchAction=function(){return["pan-y"]},e}},function(e,t,i){i(85);for(var n=i(9),o=i(18),s=i(24),r=i(8)("toStringTag"),a="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),d=0;d<a.length;d++){var h=a[d],l=n[h],u=l&&l.prototype;u&&!u[r]&&o(u,r,h),s[h]=s.Array}},function(e,t){var i={}.toString;e.exports=function(e){return i.call(e).slice(8,-1)}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t){e.exports=!0},function(e,t,i){var n=i(25);e.exports=function(e,t){if(!n(e))return e;var i,o;if(t&&"function"==typeof(i=e.toString)&&!n(o=i.call(e)))return o;if("function"==typeof(i=e.valueOf)&&!n(o=i.call(e)))return o;if(!t&&"function"==typeof(i=e.toString)&&!n(o=i.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t,i){var n=i(19),o=i(90),s=i(45),r=i(43)("IE_PROTO"),a=function(){},d=function(){var e,t=i(63)("iframe"),n=s.length;for(t.style.display="none",i(94).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write("<script>document.F=Object<\/script>"),e.close(),d=e.F;n--;)delete d.prototype[s[n]];return d()};e.exports=Object.create||function(e,t){var i;return null!==e?(a.prototype=n(e),i=new a,a.prototype=null,i[r]=e):i=d(),void 0===t?i:o(i,t)}},function(e,t){var i=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:i)(e)}},function(e,t,i){var n=i(44)("keys"),o=i(28);e.exports=function(e){return n[e]||(n[e]=o(e))}},function(e,t,i){var n=i(9),o=n["__core-js_shared__"]||(n["__core-js_shared__"]={});e.exports=function(e){return o[e]||(o[e]={})}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,i){var n=i(12).f,o=i(14),s=i(8)("toStringTag");e.exports=function(e,t,i){e&&!o(e=i?e:e.prototype,s)&&n(e,s,{configurable:!0,value:t})}},function(e,t,i){var n=i(95)(!0);i(60)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,i=this._i;return i>=t.length?{value:void 0,done:!0}:(e=n(t,i),this._i+=e.length,{value:e,done:!1})})},function(e,t,i){t.f=i(8)},function(e,t,i){var n=i(9),o=i(6),s=i(39),r=i(48),a=i(12).f;e.exports=function(e){var t=o.Symbol||(o.Symbol=s?{}:n.Symbol||{});"_"==e.charAt(0)||e in t||a(t,e,{value:r.f(e)})}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,i){function n(e,t){this._data=null,this._ids={},this.length=0,this._options=t||{},this._fieldId="id",this._subscribers={};var i=this;this.listener=function(){i._onEvent.apply(i,arguments)},this.setData(e)}var o=i(10),s=function(e){return e&&e.__esModule?e:{default:e}}(o),r=i(5),a=i(32);n.prototype.setData=function(e){var t,i,n,o,s;if(this._data){for(this._data.off&&this._data.off("*",this.listener),t=this._data.getIds({filter:this._options&&this._options.filter}),s=[],n=0,o=t.length;n<o;n++)s.push(this._data._data[t[n]]);this._ids={},this.length=0,this._trigger("remove",{items:t,oldData:s})}if(this._data=e,this._data){for(this._fieldId=this._options.fieldId||this._data&&this._data.options&&this._data.options.fieldId||"id",t=this._data.getIds({filter:this._options&&this._options.filter}),n=0,o=t.length;n<o;n++)i=t[n],this._ids[i]=!0;this.length=t.length,this._trigger("add",{items:t}),this._data.on&&this._data.on("*",this.listener)}},n.prototype.refresh=function(){var e,t,i,n=this._data.getIds({filter:this._options&&this._options.filter}),o=(0,s.default)(this._ids),r={},a=[],d=[],h=[];for(t=0,i=n.length;t<i;t++)e=n[t],r[e]=!0,this._ids[e]||(a.push(e),this._ids[e]=!0);for(t=0,i=o.length;t<i;t++)e=o[t],r[e]||(d.push(e),h.push(this._data._data[e]),delete this._ids[e]);this.length+=a.length-d.length,a.length&&this._trigger("add",{items:a}),d.length&&this._trigger("remove",{items:d,oldData:h})},n.prototype.get=function(e){var t,i,n,o=this,s=r.getType(arguments[0]);"String"==s||"Number"==s||"Array"==s?(t=arguments[0],i=arguments[1],n=arguments[2]):(i=arguments[0],n=arguments[1]);var a=r.extend({},this._options,i);this._options.filter&&i&&i.filter&&(a.filter=function(e){return o._options.filter(e)&&i.filter(e)});var d=[];return void 0!=t&&d.push(t),d.push(a),d.push(n),this._data&&this._data.get.apply(this._data,d)},n.prototype.getIds=function(e){var t;if(this._data){var i,n=this._options.filter;i=e&&e.filter?n?function(t){return n(t)&&e.filter(t)}:e.filter:n,t=this._data.getIds({filter:i,order:e&&e.order})}else t=[];return t},n.prototype.map=function(e,t){var i=[];if(this._data){var n,o=this._options.filter;n=t&&t.filter?o?function(e){return o(e)&&t.filter(e)}:t.filter:o,i=this._data.map(e,{filter:n,order:t&&t.order})}else i=[];return i},n.prototype.getDataSet=function(){for(var e=this;e instanceof n;)e=e._data;return e||null},n.prototype._onEvent=function(e,t,i){var n,o,s,r,a=t&&t.items,d=[],h=[],l=[],u=[],c=[],f=[];if(a&&this._data){switch(e){case"add":for(n=0,o=a.length;n<o;n++)s=a[n],(r=this.get(s))&&(this._ids[s]=!0,d.push(s));break;case"update":for(n=0,o=a.length;n<o;n++)s=a[n],r=this.get(s),r?this._ids[s]?(h.push(s),c.push(t.data[n]),u.push(t.oldData[n])):(this._ids[s]=!0,d.push(s)):this._ids[s]&&(delete this._ids[s],l.push(s),f.push(t.oldData[n]));break;case"remove":for(n=0,o=a.length;n<o;n++)s=a[n],this._ids[s]&&(delete this._ids[s],l.push(s),f.push(t.oldData[n]))}this.length+=d.length-l.length,d.length&&this._trigger("add",{items:d},i),h.length&&this._trigger("update",{items:h,oldData:u,data:c},i),l.length&&this._trigger("remove",{items:l,oldData:f},i)}},n.prototype.on=a.prototype.on,n.prototype.off=a.prototype.off,n.prototype._trigger=a.prototype._trigger,n.prototype.subscribe=n.prototype.on,n.prototype.unsubscribe=n.prototype.off,e.exports=n},function(e,t,i){var n,o,s;!function(i,r){o=[],n=r,void 0!==(s="function"==typeof n?n.apply(t,o):n)&&(e.exports=s)}(0,function(){function e(e){var t,i=e&&e.preventDefault||!1,n=e&&e.container||window,o={},s={keydown:{},keyup:{}},r={};for(t=97;t<=122;t++)r[String.fromCharCode(t)]={code:t-97+65,shift:!1};for(t=65;t<=90;t++)r[String.fromCharCode(t)]={code:t,shift:!0};for(t=0;t<=9;t++)r[""+t]={code:48+t,shift:!1};for(t=1;t<=12;t++)r["F"+t]={code:111+t,shift:!1};for(t=0;t<=9;t++)r["num"+t]={code:96+t,shift:!1};r["num*"]={code:106,shift:!1},r["num+"]={code:107,shift:!1},r["num-"]={code:109,shift:!1},r["num/"]={code:111,shift:!1},r["num."]={code:110,shift:!1},r.left={code:37,shift:!1},r.up={code:38,shift:!1},r.right={code:39,shift:!1},r.down={code:40,shift:!1},r.space={code:32,shift:!1},r.enter={code:13,shift:!1},r.shift={code:16,shift:void 0},r.esc={code:27,shift:!1},r.backspace={code:8,shift:!1},r.tab={code:9,shift:!1},r.ctrl={code:17,shift:!1},r.alt={code:18,shift:!1},r.delete={code:46,shift:!1},r.pageup={code:33,shift:!1},r.pagedown={code:34,shift:!1},r["="]={code:187,shift:!1},r["-"]={code:189,shift:!1},r["]"]={code:221,shift:!1},r["["]={code:219,shift:!1};var a=function(e){h(e,"keydown")},d=function(e){h(e,"keyup")},h=function(e,t){if(void 0!==s[t][e.keyCode]){for(var n=s[t][e.keyCode],o=0;o<n.length;o++)void 0===n[o].shift?n[o].fn(e):1==n[o].shift&&1==e.shiftKey?n[o].fn(e):0==n[o].shift&&0==e.shiftKey&&n[o].fn(e);1==i&&e.preventDefault()}};return o.bind=function(e,t,i){if(void 0===i&&(i="keydown"),void 0===r[e])throw new Error("unsupported key: "+e);void 0===s[i][r[e].code]&&(s[i][r[e].code]=[]),s[i][r[e].code].push({fn:t,shift:r[e].shift})},o.bindAll=function(e,t){void 0===t&&(t="keydown");for(var i in r)r.hasOwnProperty(i)&&o.bind(i,e,t)},o.getKey=function(e){for(var t in r)if(r.hasOwnProperty(t)){if(1==e.shiftKey&&1==r[t].shift&&e.keyCode==r[t].code)return t;if(0==e.shiftKey&&0==r[t].shift&&e.keyCode==r[t].code)return t;if(e.keyCode==r[t].code&&"shift"==t)return t}return"unknown key, currently not supported"},o.unbind=function(e,t,i){if(void 0===i&&(i="keydown"),void 0===r[e])throw new Error("unsupported key: "+e);if(void 0!==t){var n=[],o=s[i][r[e].code];if(void 0!==o)for(var a=0;a<o.length;a++)o[a].fn==t&&o[a].shift==r[e].shift||n.push(s[i][r[e].code][a]);s[i][r[e].code]=n}else s[i][r[e].code]=[]},o.reset=function(){s={keydown:{},keyup:{}}},o.destroy=function(){s={keydown:{},keyup:{}},n.removeEventListener("keydown",a,!0),n.removeEventListener("keyup",d,!0)},n.addEventListener("keydown",a,!0),n.addEventListener("keyup",d,!0),o}return e})},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(2),s=n(o),r=i(0),a=n(r),d=i(1),h=n(d),l=i(3),u=n(l),c=i(4),f=n(c),p=i(15),v=n(p),g=function(e){function t(e,i,n){(0,a.default)(this,t);var o=(0,u.default)(this,(t.__proto__||(0,s.default)(t)).call(this,e,i,n));return o.labelOffset=0,o.selected=!1,o}return(0,f.default)(t,e),(0,h.default)(t,[{key:"setOptions",value:function(e,t,i){this.options=e,void 0===t&&void 0===i||this.setImages(t,i)}},{key:"setImages",value:function(e,t){t&&this.selected?(this.imageObj=t,this.imageObjAlt=e):(this.imageObj=e,this.imageObjAlt=t)}},{key:"switchImages",value:function(e){var t=e&&!this.selected||!e&&this.selected;if(this.selected=e,void 0!==this.imageObjAlt&&t){var i=this.imageObj;this.imageObj=this.imageObjAlt,this.imageObjAlt=i}}},{key:"_resizeImage",value:function(){var e,t;if(!1===this.options.shapeProperties.useImageSize){var i=1,n=1;this.imageObj.width&&this.imageObj.height&&(this.imageObj.width>this.imageObj.height?i=this.imageObj.width/this.imageObj.height:n=this.imageObj.height/this.imageObj.width),e=2*this.options.size*i,t=2*this.options.size*n}else e=this.imageObj.width,t=this.imageObj.height;this.width=e,this.height=t,this.radius=.5*this.width}},{key:"_drawRawCircle",value:function(e,t,i,n){this.initContextForDraw(e,n),e.circle(t,i,n.size),this.performFill(e,n)}},{key:"_drawImageAtPosition",value:function(e,t){if(0!=this.imageObj.width){e.globalAlpha=1,this.enableShadow(e,t);var i=1;!0===this.options.shapeProperties.interpolation&&(i=this.imageObj.width/this.width/this.body.view.scale),this.imageObj.drawImageAtPosition(e,i,this.left,this.top,this.width,this.height),this.disableShadow(e,t)}}},{key:"_drawImageLabel",value:function(e,t,i,n,o){var s,r=0;if(void 0!==this.height){r=.5*this.height;var a=this.labelModule.getTextSize(e,n,o);a.lineCount>=1&&(r+=a.height/2)}s=i+r,this.options.label&&(this.labelOffset=r),this.labelModule.draw(e,t,s,n,o,"hanging")}}]),t}(v.default);t.default=g},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.printStyle=void 0;var o=i(21),s=n(o),r=i(7),a=n(r),d=i(10),h=n(d),l=i(0),u=n(l),c=i(1),f=n(c),p=i(5),v=!1,g=void 0,y="background: #FFeeee; color: #dd0000",m=function(){function e(){(0,u.default)(this,e)}return(0,f.default)(e,null,[{key:"validate",value:function(t,i,n){v=!1,g=i;var o=i;return void 0!==n&&(o=i[n]),e.parse(t,o,[]),v}},{key:"parse",value:function(t,i,n){for(var o in t)t.hasOwnProperty(o)&&e.check(o,t,i,n)}},{key:"check",value:function(t,i,n,o){if(void 0===n[t]&&void 0===n.__any__)return void e.getSuggestion(t,n,o);var s=t,r=!0;void 0===n[t]&&void 0!==n.__any__&&(s="__any__",r="object"===e.getType(i[t]));var a=n[s];r&&void 0!==a.__type__&&(a=a.__type__),e.checkFields(t,i,n,s,a,o)}},{key:"checkFields",value:function(t,i,n,o,s,r){var a=function(i){console.log("%c"+i+e.printLocation(r,t),y)},d=e.getType(i[t]),l=s[d];void 0!==l?"array"===e.getType(l)&&-1===l.indexOf(i[t])?(a('Invalid option detected in "'+t+'". Allowed values are:'+e.print(l)+' not "'+i[t]+'". '),v=!0):"object"===d&&"__any__"!==o&&(r=p.copyAndExtendArray(r,t),e.parse(i[t],n[o],r)):void 0===s.any&&(a('Invalid type received for "'+t+'". Expected: '+e.print((0,h.default)(s))+". Received ["+d+'] "'+i[t]+'"'),v=!0)}},{key:"getType",value:function(e){var t=void 0===e?"undefined":(0,a.default)(e);return"object"===t?null===e?"null":e instanceof Boolean?"boolean":e instanceof Number?"number":e instanceof String?"string":Array.isArray(e)?"array":e instanceof Date?"date":void 0!==e.nodeType?"dom":!0===e._isAMomentObject?"moment":"object":"number"===t?"number":"boolean"===t?"boolean":"string"===t?"string":void 0===t?"undefined":t}},{key:"getSuggestion",value:function(t,i,n){var o=e.findInOptions(t,i,n,!1),s=e.findInOptions(t,g,[],!0),r=void 0;r=void 0!==o.indexMatch?" in "+e.printLocation(o.path,t,"")+'Perhaps it was incomplete? Did you mean: "'+o.indexMatch+'"?\n\n':s.distance<=4&&o.distance>s.distance?" in "+e.printLocation(o.path,t,"")+"Perhaps it was misplaced? Matching option found at: "+e.printLocation(s.path,s.closestMatch,""):o.distance<=8?'. Did you mean "'+o.closestMatch+'"?'+e.printLocation(o.path,t):". Did you mean one of these: "+e.print((0,h.default)(i))+e.printLocation(n,t),console.log('%cUnknown option detected: "'+t+'"'+r,y),v=!0}},{key:"findInOptions",value:function(t,i,n){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=1e9,r="",a=[],d=t.toLowerCase(),h=void 0;for(var l in i){var u=void 0;if(void 0!==i[l].__type__&&!0===o){var c=e.findInOptions(t,i[l],p.copyAndExtendArray(n,l));s>c.distance&&(r=c.closestMatch,a=c.path,s=c.distance,h=c.indexMatch)}else-1!==l.toLowerCase().indexOf(d)&&(h=l),u=e.levenshteinDistance(t,l),s>u&&(r=l,a=p.copyArray(n),s=u)}return{closestMatch:r,path:a,distance:s,indexMatch:h}}},{key:"printLocation",value:function(e,t){for(var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Problem value found at: \n",n="\n\n"+i+"options = {\n",o=0;o<e.length;o++){for(var s=0;s<o+1;s++)n+=" ";n+=e[o]+": {\n"}for(var r=0;r<e.length+1;r++)n+=" ";n+=t+"\n";for(var a=0;a<e.length+1;a++){for(var d=0;d<e.length-a;d++)n+=" ";n+="}\n"}return n+"\n\n"}},{key:"print",value:function(e){return(0,s.default)(e).replace(/(\")|(\[)|(\])|(,"__type__")/g,"").replace(/(\,)/g,", ")}},{key:"levenshteinDistance",value:function(e,t){if(0===e.length)return t.length;if(0===t.length)return e.length;var i,n=[];for(i=0;i<=t.length;i++)n[i]=[i];var o;for(o=0;o<=e.length;o++)n[0][o]=o;for(i=1;i<=t.length;i++)for(o=1;o<=e.length;o++)t.charAt(i-1)==e.charAt(o-1)?n[i][o]=n[i-1][o-1]:n[i][o]=Math.min(n[i-1][o-1]+1,Math.min(n[i][o-1]+1,n[i-1][o]+1));return n[t.length][e.length]}}]),e}();t.default=m,t.printStyle=y},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(21),s=n(o),r=i(7),a=n(r),d=i(30),h=n(d),l=i(0),u=n(l),c=i(1),f=n(c),p=i(5),v=i(77).default,g=i(34).default,y=i(164).default,m=i(166).default,b=i(167).default,_=i(168).default,w=function(){function e(t,i,n,o){if((0,u.default)(this,e),void 0===i)throw new Error("No body provided");this.options=p.bridgeObject(n),this.globalOptions=n,this.defaultOptions=o,this.body=i,this.id=void 0,this.fromId=void 0,this.toId=void 0,this.selected=!1,this.hover=!1,this.labelDirty=!0,this.baseWidth=this.options.width,this.baseFontSize=this.options.font.size,this.from=void 0,this.to=void 0,this.edgeType=void 0,this.connected=!1,this.labelModule=new v(this.body,this.options,!0),this.setOptions(t)}return(0,f.default)(e,[{key:"setOptions",value:function(t){if(t){e.parseOptions(this.options,t,!0,this.globalOptions),void 0!==t.id&&(this.id=t.id),void 0!==t.from&&(this.fromId=t.from),void 0!==t.to&&(this.toId=t.to),void 0!==t.title&&(this.title=t.title),void 0!==t.value&&(t.value=parseFloat(t.value));var i=[t,this.options,this.defaultOptions];this.chooser=g.choosify("edge",i),this.updateLabelModule(t);var n=this.updateEdgeType();return this._setInteractionWidths(),this.connect(),void 0===t.hidden&&void 0===t.physics||(n=!0),n}}},{key:"getFormattingValues",value:function(){var e=!0===this.options.arrows.to||!0===this.options.arrows.to.enabled,t=!0===this.options.arrows.from||!0===this.options.arrows.from.enabled,i=!0===this.options.arrows.middle||!0===this.options.arrows.middle.enabled,n=this.options.color.inherit,o={toArrow:e,toArrowScale:this.options.arrows.to.scaleFactor,toArrowType:this.options.arrows.to.type,middleArrow:i,middleArrowScale:this.options.arrows.middle.scaleFactor,middleArrowType:this.options.arrows.middle.type,fromArrow:t,fromArrowScale:this.options.arrows.from.scaleFactor,fromArrowType:this.options.arrows.from.type,arrowStrikethrough:this.options.arrowStrikethrough,color:n?void 0:this.options.color.color,inheritsColor:n,opacity:this.options.color.opacity,hidden:this.options.hidden,length:this.options.length,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y,dashes:this.options.dashes,width:this.options.width};if(this.selected||this.hover)if(!0===this.chooser){if(this.selected){var s=this.options.selectionWidth;"function"==typeof s?o.width=s(o.width):"number"==typeof s&&(o.width+=s),o.width=Math.max(o.width,.3/this.body.view.scale),o.color=this.options.color.highlight,o.shadow=this.options.shadow.enabled}else if(this.hover){var r=this.options.hoverWidth;"function"==typeof r?o.width=r(o.width):"number"==typeof r&&(o.width+=r),o.width=Math.max(o.width,.3/this.body.view.scale),o.color=this.options.color.hover,o.shadow=this.options.shadow.enabled}}else"function"==typeof this.chooser&&(this.chooser(o,this.options.id,this.selected,this.hover),void 0!==o.color&&(o.inheritsColor=!1),!1===o.shadow&&(o.shadowColor===this.options.shadow.color&&o.shadowSize===this.options.shadow.size&&o.shadowX===this.options.shadow.x&&o.shadowY===this.options.shadow.y||(o.shadow=!0)));else o.shadow=this.options.shadow.enabled,o.width=Math.max(o.width,.3/this.body.view.scale);return o}},{key:"updateLabelModule",value:function(e){var t=[e,this.options,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,t),void 0!==this.labelModule.baseSize&&(this.baseFontSize=this.labelModule.baseSize)}},{key:"updateEdgeType",value:function(){var e=this.options.smooth,t=!1,i=!0;return void 0!==this.edgeType&&((this.edgeType instanceof m&&!0===e.enabled&&"dynamic"===e.type||this.edgeType instanceof y&&!0===e.enabled&&"cubicBezier"===e.type||this.edgeType instanceof b&&!0===e.enabled&&"dynamic"!==e.type&&"cubicBezier"!==e.type||this.edgeType instanceof _&&!1===e.type.enabled)&&(i=!1),!0===i&&(t=this.cleanup())),!0===i?!0===e.enabled?"dynamic"===e.type?(t=!0,this.edgeType=new m(this.options,this.body,this.labelModule)):"cubicBezier"===e.type?this.edgeType=new y(this.options,this.body,this.labelModule):this.edgeType=new b(this.options,this.body,this.labelModule):this.edgeType=new _(this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),t}},{key:"connect",value:function(){this.disconnect(),this.from=this.body.nodes[this.fromId]||void 0,this.to=this.body.nodes[this.toId]||void 0,this.connected=void 0!==this.from&&void 0!==this.to,!0===this.connected?(this.from.attachEdge(this),this.to.attachEdge(this)):(this.from&&this.from.detachEdge(this),this.to&&this.to.detachEdge(this)),this.edgeType.connect()}},{key:"disconnect",value:function(){this.from&&(this.from.detachEdge(this),this.from=void 0),this.to&&(this.to.detachEdge(this),this.to=void 0),this.connected=!1}},{key:"getTitle",value:function(){return this.title}},{key:"isSelected",value:function(){return this.selected}},{key:"getValue",value:function(){return this.options.value}},{key:"setValueRange",value:function(e,t,i){if(void 0!==this.options.value){var n=this.options.scaling.customScalingFunction(e,t,i,this.options.value),o=this.options.scaling.max-this.options.scaling.min;if(!0===this.options.scaling.label.enabled){var s=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+n*s}this.options.width=this.options.scaling.min+n*o}else this.options.width=this.baseWidth,this.options.font.size=this.baseFontSize;this._setInteractionWidths(),this.updateLabelModule()}},{key:"_setInteractionWidths",value:function(){"function"==typeof this.options.hoverWidth?this.edgeType.hoverWidth=this.options.hoverWidth(this.options.width):this.edgeType.hoverWidth=this.options.hoverWidth+this.options.width,"function"==typeof this.options.selectionWidth?this.edgeType.selectionWidth=this.options.selectionWidth(this.options.width):this.edgeType.selectionWidth=this.options.selectionWidth+this.options.width}},{key:"draw",value:function(e){var t=this.getFormattingValues();if(!t.hidden){var i=this.edgeType.getViaNode(),n={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,t.fromArrow&&(n.from=this.edgeType.getArrowData(e,"from",i,this.selected,this.hover,t),!1===t.arrowStrikethrough&&(this.edgeType.fromPoint=n.from.core)),t.toArrow&&(n.to=this.edgeType.getArrowData(e,"to",i,this.selected,this.hover,t),!1===t.arrowStrikethrough&&(this.edgeType.toPoint=n.to.core)),t.middleArrow&&(n.middle=this.edgeType.getArrowData(e,"middle",i,this.selected,this.hover,t)),this.edgeType.drawLine(e,t,this.selected,this.hover,i),this.drawArrows(e,n,t),this.drawLabel(e,i)}}},{key:"drawArrows",value:function(e,t,i){i.fromArrow&&this.edgeType.drawArrowHead(e,i,this.selected,this.hover,t.from),i.middleArrow&&this.edgeType.drawArrowHead(e,i,this.selected,this.hover,t.middle),i.toArrow&&this.edgeType.drawArrowHead(e,i,this.selected,this.hover,t.to)}},{key:"drawLabel",value:function(e,t){if(void 0!==this.options.label){var i=this.from,n=this.to;if(this.labelModule.differentState(this.selected,this.hover)&&this.labelModule.getTextSize(e,this.selected,this.hover),i.id!=n.id){this.labelModule.pointToSelf=!1;var o=this.edgeType.getPoint(.5,t);e.save();var s=this._getRotation(e);0!=s.angle&&(e.translate(s.x,s.y),e.rotate(s.angle)),this.labelModule.draw(e,o.x,o.y,this.selected,this.hover),e.restore()}else{this.labelModule.pointToSelf=!0;var r,a,d=this.options.selfReferenceSize;i.shape.width>i.shape.height?(r=i.x+.5*i.shape.width,a=i.y-d):(r=i.x+d,a=i.y-.5*i.shape.height),o=this._pointOnCircle(r,a,d,.125),this.labelModule.draw(e,o.x,o.y,this.selected,this.hover)}}}},{key:"getItemsOnPoint",value:function(e){var t=[];if(this.labelModule.visible()){var i=this._getRotation();g.pointInRect(this.labelModule.getSize(),e,i)&&t.push({edgeId:this.id,labelId:0})}var n={left:e.x,top:e.y};return this.isOverlappingWith(n)&&t.push({edgeId:this.id}),t}},{key:"isOverlappingWith",value:function(e){if(this.connected){var t=this.from.x,i=this.from.y,n=this.to.x,o=this.to.y,s=e.left,r=e.top;return this.edgeType.getDistanceToEdge(t,i,n,o,s,r)<10}return!1}},{key:"_getRotation",value:function(e){var t=this.edgeType.getViaNode(),i=this.edgeType.getPoint(.5,t);void 0!==e&&this.labelModule.calculateLabelSize(e,this.selected,this.hover,i.x,i.y);var n={x:i.x,y:this.labelModule.size.yLine,angle:0};if(!this.labelModule.visible())return n;if("horizontal"===this.options.font.align)return n;var o=this.from.y-this.to.y,s=this.from.x-this.to.x,r=Math.atan2(o,s);return(r<-1&&s<0||r>0&&s<0)&&(r+=Math.PI),n.angle=r,n}},{key:"_pointOnCircle",value:function(e,t,i,n){var o=2*n*Math.PI;return{x:e+i*Math.cos(o),y:t-i*Math.sin(o)}}},{key:"select",value:function(){this.selected=!0}},{key:"unselect",value:function(){this.selected=!1}},{key:"cleanup",value:function(){return this.edgeType.cleanup()}},{key:"remove",value:function(){this.cleanup(),this.disconnect(),delete this.body.edges[this.id]}},{key:"endPointsValid",value:function(){return void 0!==this.body.nodes[this.fromId]&&void 0!==this.body.nodes[this.toId]}}],[{key:"parseOptions",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=["arrowStrikethrough","id","from","hidden","hoverWidth","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","to","title","value","width","font","chosen","widthConstraint"];if(p.selectiveDeepExtend(r,e,t,i),g.isValidLabel(t.label)?e.label=t.label:e.label=void 0,p.mergeOptions(e,t,"smooth",n),p.mergeOptions(e,t,"shadow",n),void 0!==t.dashes&&null!==t.dashes?e.dashes=t.dashes:!0===i&&null===t.dashes&&(e.dashes=(0,h.default)(n.dashes)),void 0!==t.scaling&&null!==t.scaling?(void 0!==t.scaling.min&&(e.scaling.min=t.scaling.min),void 0!==t.scaling.max&&(e.scaling.max=t.scaling.max),p.mergeOptions(e.scaling,t.scaling,"label",n.scaling)):!0===i&&null===t.scaling&&(e.scaling=(0,h.default)(n.scaling)),void 0!==t.arrows&&null!==t.arrows)if("string"==typeof t.arrows){var d=t.arrows.toLowerCase();e.arrows.to.enabled=-1!=d.indexOf("to"),e.arrows.middle.enabled=-1!=d.indexOf("middle"),e.arrows.from.enabled=-1!=d.indexOf("from")}else{if("object"!==(0,a.default)(t.arrows))throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+(0,s.default)(t.arrows));p.mergeOptions(e.arrows,t.arrows,"to",n.arrows),p.mergeOptions(e.arrows,t.arrows,"middle",n.arrows),p.mergeOptions(e.arrows,t.arrows,"from",n.arrows)}else!0===i&&null===t.arrows&&(e.arrows=(0,h.default)(n.arrows));if(void 0!==t.color&&null!==t.color){var l=t.color,u=e.color;if(o)p.deepExtend(u,n.color,!1,i);else for(var c in u)u.hasOwnProperty(c)&&delete u[c];if(p.isString(u))u.color=u,u.highlight=u,u.hover=u,u.inherit=!1,void 0===l.opacity&&(u.opacity=1);else{var f=!1;void 0!==l.color&&(u.color=l.color,f=!0),void 0!==l.highlight&&(u.highlight=l.highlight,f=!0),void 0!==l.hover&&(u.hover=l.hover,f=!0),void 0!==l.inherit&&(u.inherit=l.inherit),void 0!==l.opacity&&(u.opacity=Math.min(1,Math.max(0,l.opacity))),!0===f?u.inherit=!1:void 0===u.inherit&&(u.inherit="from")}}else!0===i&&null===t.color&&(e.color=p.bridgeObject(n.color));!0===i&&null===t.font&&(e.font=p.bridgeObject(n.font))}}]),e}();t.default=w},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(2),s=n(o),r=i(0),a=n(r),d=i(1),h=n(d),l=i(3),u=n(l),c=i(4),f=n(c),p=i(78),v=n(p),g=function(e){function t(e,i,n){return(0,a.default)(this,t),(0,u.default)(this,(t.__proto__||(0,s.default)(t)).call(this,e,i,n))}return(0,f.default)(t,e),(0,h.default)(t,[{key:"_findBorderPositionBezier",value:function(e,t){var i,n,o,s,r,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this._getViaCoordinates(),d=0,h=0,l=1,u=this.to,c=!1;for(e.id===this.from.id&&(u=this.from,c=!0);h<=l&&d<10;){var f=.5*(h+l);if(i=this.getPoint(f,a),n=Math.atan2(u.y-i.y,u.x-i.x),o=u.distanceToBorder(t,n),s=Math.sqrt(Math.pow(i.x-u.x,2)+Math.pow(i.y-u.y,2)),r=o-s,Math.abs(r)<.2)break;r<0?!1===c?h=f:l=f:!1===c?l=f:h=f,d++}return i.t=f,i}},{key:"_getDistanceToBezierEdge",value:function(e,t,i,n,o,s,r){var a=1e9,d=void 0,h=void 0,l=void 0,u=void 0,c=void 0,f=e,p=t;for(h=1;h<10;h++)l=.1*h,u=Math.pow(1-l,2)*e+2*l*(1-l)*r.x+Math.pow(l,2)*i,c=Math.pow(1-l,2)*t+2*l*(1-l)*r.y+Math.pow(l,2)*n,h>0&&(d=this._getDistanceToLine(f,p,u,c,o,s),a=d<a?d:a),f=u,p=c;return a}},{key:"_bezierCurve",value:function(e,t,i,n){var o=void 0!==i&&void 0!==i.x,s=void 0!==n&&void 0!==n.x;e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),o&&s?e.bezierCurveTo(i.x,i.y,n.x,n.y,this.toPoint.x,this.toPoint.y):o?e.quadraticCurveTo(i.x,i.y,this.toPoint.x,this.toPoint.y):e.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}}]),t}(v.default);t.default=g},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(0),s=n(o),r=i(1),a=n(r),d=i(5),h=function(){function e(){(0,s.default)(this,e)}return(0,a.default)(e,null,[{key:"getRange",value:function(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=1e9,o=-1e9,s=1e9,r=-1e9;if(i.length>0)for(var a=0;a<i.length;a++)t=e[i[a]],s>t.shape.boundingBox.left&&(s=t.shape.boundingBox.left),r<t.shape.boundingBox.right&&(r=t.shape.boundingBox.right),n>t.shape.boundingBox.top&&(n=t.shape.boundingBox.top),o<t.shape.boundingBox.bottom&&(o=t.shape.boundingBox.bottom);return 1e9===s&&-1e9===r&&1e9===n&&-1e9===o&&(n=0,o=0,s=0,r=0),{minX:s,maxX:r,minY:n,maxY:o}}},{key:"getRangeCore",value:function(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=1e9,o=-1e9,s=1e9,r=-1e9;if(i.length>0)for(var a=0;a<i.length;a++)t=e[i[a]],s>t.x&&(s=t.x),r<t.x&&(r=t.x),n>t.y&&(n=t.y),o<t.y&&(o=t.y);return 1e9===s&&-1e9===r&&1e9===n&&-1e9===o&&(n=0,o=0,s=0,r=0),{minX:s,maxX:r,minY:n,maxY:o}}},{key:"findCenter",value:function(e){return{x:.5*(e.maxX+e.minX),y:.5*(e.maxY+e.minY)}}},{key:"cloneOptions",value:function(e,t){var i={};return void 0===t||"node"===t?(d.deepExtend(i,e.options,!0),i.x=e.x,i.y=e.y,i.amountOfConnections=e.edges.length):d.deepExtend(i,e.options,!0),i}}]),e}();t.default=h},function(e,t,i){e.exports={default:i(84),__esModule:!0}},function(e,t,i){var n=i(37);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==n(e)?e.split(""):Object(e)}},function(e,t,i){var n=i(39),o=i(11),s=i(64),r=i(18),a=i(14),d=i(24),h=i(89),l=i(46),u=i(66),c=i(8)("iterator"),f=!([].keys&&"next"in[].keys()),p=function(){return this};e.exports=function(e,t,i,v,g,y,m){h(i,t,v);var b,_,w,k=function(e){if(!f&&e in E)return E[e];switch(e){case"keys":case"values":return function(){return new i(this,e)}}return function(){return new i(this,e)}},x=t+" Iterator",O="values"==g,M=!1,E=e.prototype,S=E[c]||E["@@iterator"]||g&&E[g],D=S||k(g),C=g?O?k("entries"):D:void 0,T="Array"==t?E.entries||S:S;if(T&&(w=u(T.call(new e)))!==Object.prototype&&w.next&&(l(w,x,!0),n||a(w,c)||r(w,c,p)),O&&S&&"values"!==S.name&&(M=!0,D=function(){return S.call(this)}),n&&!m||!f&&!M&&E[c]||r(E,c,D),d[t]=D,d[x]=p,g)if(b={values:O?D:k("values"),keys:y?D:k("keys"),entries:C},m)for(_ in b)_ in E||s(E,_,b[_]);else o(o.P+o.F*(f||M),t,b);return b}},function(e,t,i){var n=i(88);e.exports=function(e,t,i){if(n(e),void 0===t)return e;switch(i){case 1:return function(i){return e.call(t,i)};case 2:return function(i,n){return e.call(t,i,n)};case 3:return function(i,n,o){return e.call(t,i,n,o)}}return function(){return e.apply(t,arguments)}}},function(e,t,i){e.exports=!i(13)&&!i(20)(function(){return 7!=Object.defineProperty(i(63)("div"),"a",{get:function(){return 7}}).a})},function(e,t,i){var n=i(25),o=i(9).document,s=n(o)&&n(o.createElement);e.exports=function(e){return s?o.createElement(e):{}}},function(e,t,i){e.exports=i(18)},function(e,t,i){var n=i(14),o=i(17),s=i(91)(!1),r=i(43)("IE_PROTO");e.exports=function(e,t){var i,a=o(e),d=0,h=[];for(i in a)i!=r&&n(a,i)&&h.push(i);for(;t.length>d;)n(a,i=t[d++])&&(~s(h,i)||h.push(i));return h}},function(e,t,i){var n=i(14),o=i(29),s=i(43)("IE_PROTO"),r=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),n(e,s)?e[s]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?r:null}},function(e,t,i){var n=i(37),o=i(8)("toStringTag"),s="Arguments"==n(function(){return arguments}()),r=function(e,t){try{return e[t]}catch(e){}};e.exports=function(e){var t,i,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=r(t=Object(e),o))?i:s?n(t):"Object"==(a=n(t))&&"function"==typeof t.callee?"Arguments":a}},function(e,t,i){var n=i(11),o=i(6),s=i(20);e.exports=function(e,t){var i=(o.Object||{})[e]||Object[e],r={};r[e]=t(i),n(n.S+n.F*s(function(){i(1)}),"Object",r)}},function(e,t,i){var n=i(65),o=i(45).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,o)}},function(e,t,i){var n=i(31),o=i(27),s=i(17),r=i(40),a=i(14),d=i(62),h=Object.getOwnPropertyDescriptor;t.f=i(13)?h:function(e,t){if(e=s(e),t=r(t,!0),d)try{return h(e,t)}catch(e){}if(a(e,t))return o(!n.f.call(e,t),e[t])}},function(e,t,i){e.exports="undefined"!=typeof window&&window.moment||i(114)},function(e,t,i){function n(e){this.delay=null,this.max=1/0,this._queue=[],this._timeout=null,this._extended=null,this.setOptions(e)}n.prototype.setOptions=function(e){e&&void 0!==e.delay&&(this.delay=e.delay),e&&void 0!==e.max&&(this.max=e.max),this._flushIfNeeded()},n.extend=function(e,t){var i=new n(t);if(void 0!==e.flush)throw new Error("Target object already has a property flush");e.flush=function(){i.flush()};var o=[{name:"flush",original:void 0}];if(t&&t.replace)for(var s=0;s<t.replace.length;s++){var r=t.replace[s];o.push({name:r,original:e[r]}),i.replace(e,r)}return i._extended={object:e,methods:o},i},n.prototype.destroy=function(){if(this.flush(),this._extended){for(var e=this._extended.object,t=this._extended.methods,i=0;i<t.length;i++){var n=t[i];n.original?e[n.name]=n.original:delete e[n.name]}this._extended=null}},n.prototype.replace=function(e,t){var i=this,n=e[t];if(!n)throw new Error("Method "+t+" undefined");e[t]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];i.queue({args:e,fn:n,context:this})}},n.prototype.queue=function(e){"function"==typeof e?this._queue.push({fn:e}):this._queue.push(e),this._flushIfNeeded()},n.prototype._flushIfNeeded=function(){if(this._queue.length>this.max&&this.flush(),clearTimeout(this._timeout),this.queue.length>0&&"number"==typeof this.delay){var e=this;this._timeout=setTimeout(function(){e.flush()},this.delay)}},n.prototype.flush=function(){for(;this._queue.length>0;){var e=this._queue.shift();e.fn.apply(e.context||e.fn,e.args||[])}},e.exports=n},function(e,t){function i(e){if(e)return n(e)}function n(e){for(var t in i.prototype)e[t]=i.prototype[t];return e}e.exports=i,i.prototype.on=i.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[e]=this._callbacks[e]||[]).push(t),this},i.prototype.once=function(e,t){function i(){n.off(e,i),t.apply(this,arguments)}var n=this;return this._callbacks=this._callbacks||{},i.fn=t,this.on(e,i),this},i.prototype.off=i.prototype.removeListener=i.prototype.removeAllListeners=i.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var i=this._callbacks[e];if(!i)return this;if(1==arguments.length)return delete this._callbacks[e],this;for(var n,o=0;o<i.length;o++)if((n=i[o])===t||n.fn===t){i.splice(o,1);break}return this},i.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),i=this._callbacks[e];if(i){i=i.slice(0);for(var n=0,o=i.length;n<o;++n)i[n].apply(this,t)}return this},i.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[e]||[]},i.prototype.hasListeners=function(e){return!!this.listeners(e).length}},function(e,t,i){function n(e){return N=e,p()}function o(){B=0,z=N.charAt(0)}function s(){B++,z=N.charAt(B)}function r(){return N.charAt(B+1)}function a(e){return j.test(e)}function d(e,t){if(e||(e={}),t)for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}function h(e,t,i){for(var n=t.split("."),o=e;n.length;){var s=n.shift();n.length?(o[s]||(o[s]={}),o=o[s]):o[s]=i}}function l(e,t){for(var i,n,o=null,s=[e],r=e;r.parent;)s.push(r.parent),r=r.parent;if(r.nodes)for(i=0,n=r.nodes.length;i<n;i++)if(t.id===r.nodes[i].id){o=r.nodes[i];break}for(o||(o={id:t.id},e.node&&(o.attr=d(o.attr,e.node))),i=s.length-1;i>=0;i--){var a=s[i];a.nodes||(a.nodes=[]),-1===a.nodes.indexOf(o)&&a.nodes.push(o)}t.attr&&(o.attr=d(o.attr,t.attr))}function u(e,t){if(e.edges||(e.edges=[]),e.edges.push(t),e.edge){var i=d({},e.edge);t.attr=d(i,t.attr)}}function c(e,t,i,n,o){var s={from:t,to:i,type:n};return e.edge&&(s.attr=d({},e.edge)),s.attr=d(s.attr||{},o),s}function f(){for(A=I.NULL,R="";" "===z||"\t"===z||"\n"===z||"\r"===z;)s();do{var e=!1;if("#"===z){for(var t=B-1;" "===N.charAt(t)||"\t"===N.charAt(t);)t--;if("\n"===N.charAt(t)||""===N.charAt(t)){for(;""!=z&&"\n"!=z;)s();e=!0}}if("/"===z&&"/"===r()){for(;""!=z&&"\n"!=z;)s();e=!0}if("/"===z&&"*"===r()){for(;""!=z;){if("*"===z&&"/"===r()){s(),s();break}s()}e=!0}for(;" "===z||"\t"===z||"\n"===z||"\r"===z;)s()}while(e);if(""===z)return void(A=I.DELIMITER);var i=z+r();if(F[i])return A=I.DELIMITER,R=i,s(),void s();if(F[z])return A=I.DELIMITER,R=z,void s();if(a(z)||"-"===z){for(R+=z,s();a(z);)R+=z,s();return"false"===R?R=!1:"true"===R?R=!0:isNaN(Number(R))||(R=Number(R)),void(A=I.IDENTIFIER)}if('"'===z){for(s();""!=z&&('"'!=z||'"'===z&&'"'===r());)'"'===z?(R+=z,s()):"\\"===z&&"n"===r()?(R+="\n",s()):R+=z,s();if('"'!=z)throw k('End of string " expected');return s(),void(A=I.IDENTIFIER)}for(A=I.UNKNOWN;""!=z;)R+=z,s();throw new SyntaxError('Syntax error in part "'+x(R,30)+'"')}function p(){var e={};if(o(),f(),"strict"===R&&(e.strict=!0,f()),"graph"!==R&&"digraph"!==R||(e.type=R,f()),A===I.IDENTIFIER&&(e.id=R,f()),"{"!=R)throw k("Angle bracket { expected");if(f(),v(e),"}"!=R)throw k("Angle bracket } expected");if(f(),""!==R)throw k("End of file expected");return f(),delete e.node,delete e.edge,delete e.graph,e}function v(e){for(;""!==R&&"}"!=R;)g(e),";"===R&&f()}function g(e){var t=y(e);if(t)return void _(e,t);if(!m(e)){if(A!=I.IDENTIFIER)throw k("Identifier expected");var i=R;if(f(),"="===R){if(f(),A!=I.IDENTIFIER)throw k("Identifier expected");e[i]=R,f()}else b(e,i)}}function y(e){var t=null;if("subgraph"===R&&(t={},t.type="subgraph",f(),A===I.IDENTIFIER&&(t.id=R,f())),"{"===R){if(f(),t||(t={}),t.parent=e,t.node=e.node,t.edge=e.edge,t.graph=e.graph,v(t),"}"!=R)throw k("Angle bracket } expected");f(),delete t.node,delete t.edge,delete t.graph,delete t.parent,e.subgraphs||(e.subgraphs=[]),e.subgraphs.push(t)}return t}function m(e){return"node"===R?(f(),e.node=w(),"node"):"edge"===R?(f(),e.edge=w(),"edge"):"graph"===R?(f(),e.graph=w(),"graph"):null}function b(e,t){var i={id:t},n=w();n&&(i.attr=n),l(e,i),_(e,t)}function _(e,t){for(;"->"===R||"--"===R;){var i,n=R;f();var o=y(e);if(o)i=o;else{if(A!=I.IDENTIFIER)throw k("Identifier or subgraph expected");i=R,l(e,{id:i}),f()}u(e,c(e,t,i,n,w())),t=i}}function w(){for(var e=null,t={dashed:!0,solid:!1,dotted:[1,5]};"["===R;){for(f(),e={};""!==R&&"]"!=R;){if(A!=I.IDENTIFIER)throw k("Attribute name expected");var i=R;if(f(),"="!=R)throw k("Equal sign = expected");if(f(),A!=I.IDENTIFIER)throw k("Attribute value expected");var n=R;"style"===i&&(n=t[n]),h(e,i,n),f(),","==R&&f()}if("]"!=R)throw k("Bracket ] expected");f()}return e}function k(e){return new SyntaxError(e+', got "'+x(R,30)+'" (char '+B+")")}function x(e,t){return e.length<=t?e:e.substr(0,27)+"..."}function O(e,t,i){Array.isArray(e)?e.forEach(function(e){Array.isArray(t)?t.forEach(function(t){i(e,t)}):i(e,t)}):Array.isArray(t)?t.forEach(function(t){i(e,t)}):i(e,t)}function M(e,t,i){for(var n=t.split("."),o=n.pop(),s=e,r=0;r<n.length;r++){var a=n[r];a in s||(s[a]={}),s=s[a]}return s[o]=i,e}function E(e,t){var i={};for(var n in e)if(e.hasOwnProperty(n)){var o=t[n];Array.isArray(o)?o.forEach(function(t){M(i,t,e[n])}):"string"==typeof o?M(i,o,e[n]):M(i,n,e[n])}return i}function S(e){var t=n(e),i={nodes:[],edges:[],options:{}};if(t.nodes&&t.nodes.forEach(function(e){var t={id:e.id,label:String(e.label||e.id)};d(t,E(e.attr,T)),t.image&&(t.shape="image"),i.nodes.push(t)}),t.edges){var o=function(e){var t={from:e.from,to:e.to};return d(t,E(e.attr,P)),t.arrows="->"===e.type?"to":void 0,t};t.edges.forEach(function(e){var t,n;t=e.from instanceof Object?e.from.nodes:{id:e.from},n=e.to instanceof Object?e.to.nodes:{id:e.to},e.from instanceof Object&&e.from.edges&&e.from.edges.forEach(function(e){var t=o(e);i.edges.push(t)}),O(t,n,function(t,n){var s=c(i,t.id,n.id,e.type,e.attr),r=o(s);i.edges.push(r)}),e.to instanceof Object&&e.to.edges&&e.to.edges.forEach(function(e){var t=o(e);i.edges.push(t)})})}return t.attr&&(i.options=t.attr),i}var D=i(30),C=function(e){return e&&e.__esModule?e:{default:e}}(D),T={fontsize:"font.size",fontcolor:"font.color",labelfontcolor:"font.color",fontname:"font.face",color:["color.border","color.background"],fillcolor:"color.background",tooltip:"title",labeltooltip:"title"},P=(0,C.default)(T);P.color="color.color",P.style="dashes";var I={NULL:0,DELIMITER:1,IDENTIFIER:2,UNKNOWN:3},F={"{":!0,"}":!0,"[":!0,"]":!0,";":!0,"=":!0,",":!0,"->":!0,"--":!0},N="",B=0,z="",R="",A=I.NULL,j=/[a-zA-Z_0-9.:#]/;t.parseDOT=n,t.DOTToGraph=S},function(e,t,i){function n(e,t){var i=[],n=[],o={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};void 0!==t&&(void 0!==t.fixed&&(o.nodes.fixed=t.fixed),void 0!==t.parseColor&&(o.nodes.parseColor=t.parseColor),void 0!==t.inheritColor&&(o.edges.inheritColor=t.inheritColor));for(var s=e.edges,r=e.nodes,a=0;a<s.length;a++){var d={},h=s[a];d.id=h.id,d.from=h.source,d.to=h.target,d.attributes=h.attributes,d.label=h.label,d.title=void 0!==h.attributes?h.attributes.title:void 0,"Directed"===h.type&&(d.arrows="to"),h.color&&!1===o.inheritColor&&(d.color=h.color),i.push(d)}for(var l=0;l<r.length;l++){var u={},c=r[l];u.id=c.id,u.attributes=c.attributes,u.x=c.x,u.y=c.y,u.label=c.label,u.title=void 0!==c.attributes?c.attributes.title:c.title,!0===o.nodes.parseColor?u.color=c.color:u.color=void 0!==c.color?{background:c.color,border:c.color,highlight:{background:c.color,border:c.color},hover:{background:c.color,border:c.color}}:void 0,u.size=c.size,u.fixed=o.nodes.fixed&&void 0!==c.x&&void 0!==c.y,n.push(u)}return{nodes:n,edges:i}}t.parseGephi=n},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(0),s=n(o),r=i(1),a=n(r),d=i(130),h=n(d),l=function(){function e(t){(0,s.default)(this,e),this.images={},this.imageBroken={},this.callback=t}return(0,a.default)(e,[{key:"_tryloadBrokenUrl",value:function(e,t,i){if(void 0!==e&&void 0!==i){if(void 0===t)return void console.warn("No broken url image defined");i.onerror=function(){console.error("Could not load brokenImage:",t)},i.image.src=t}}},{key:"_redrawWithImage",value:function(e){this.callback&&this.callback(e)}},{key:"load",value:function(e,t){var i=this,n=this.images[e];if(n)return n;var o=new h.default;return this.images[e]=o,o.image.onload=function(){i._fixImageCoordinates(o.image),o.init(),i._redrawWithImage(o)},o.image.onerror=function(){console.error("Could not load image:",e),i._tryloadBrokenUrl(e,t,o)},o.image.src=e,o}},{key:"_fixImageCoordinates",value:function(e){0===e.width&&(document.body.appendChild(e),e.width=e.offsetWidth,e.height=e.offsetHeight,document.body.removeChild(e))}}]),e}();t.default=l},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(23),s=n(o),r=i(7),a=n(r),d=i(0),h=n(d),l=i(1),u=n(l),c=i(5),f=i(34).default,p=i(136).default,v=["bold","ital","boldital","mono"],g=function(){function e(t,i){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,h.default)(this,e),this.body=t,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(i),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=n}return(0,u.default)(e,[{key:"setOptions",value:function(e){if(this.elementOptions=e,this.initFontOptions(e.font),f.isValidLabel(e.label)?this.labelDirty=!0:e.label="",void 0!==e.font&&null!==e.font)if("string"==typeof e.font)this.baseSize=this.fontOptions.size;else if("object"===(0,a.default)(e.font)){var t=e.font.size;void 0!==t&&(this.baseSize=t)}}},{key:"initFontOptions",value:function(t){var i=this;if(c.forEach(v,function(e){i.fontOptions[e]={}}),e.parseFontString(this.fontOptions,t))return void(this.fontOptions.vadjust=0);c.forEach(t,function(e,t){void 0!==e&&null!==e&&"object"!==(void 0===e?"undefined":(0,a.default)(e))&&(i.fontOptions[t]=e)})}},{key:"constrain",value:function(e){var t={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},i=c.topMost(e,"widthConstraint");if("number"==typeof i)t.maxWdt=Number(i),t.minWdt=Number(i);else if("object"===(void 0===i?"undefined":(0,a.default)(i))){var n=c.topMost(e,["widthConstraint","maximum"]);"number"==typeof n&&(t.maxWdt=Number(n));var o=c.topMost(e,["widthConstraint","minimum"]);"number"==typeof o&&(t.minWdt=Number(o))}var s=c.topMost(e,"heightConstraint");if("number"==typeof s)t.minHgt=Number(s);else if("object"===(void 0===s?"undefined":(0,a.default)(s))){var r=c.topMost(e,["heightConstraint","minimum"]);"number"==typeof r&&(t.minHgt=Number(r));var d=c.topMost(e,["heightConstraint","valign"]);"string"==typeof d&&("top"!==d&&"bottom"!==d||(t.valign=d))}return t}},{key:"update",value:function(e,t){this.setOptions(e,!0),this.propagateFonts(t),c.deepExtend(this.fontOptions,this.constrain(t)),this.fontOptions.chooser=f.choosify("label",t)}},{key:"adjustSizes",value:function(e){var t=e?e.right+e.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=t,this.fontOptions.minWdt-=t);var i=e?e.top+e.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=i)}},{key:"addFontOptionsToPile",value:function(e,t){for(var i=0;i<t.length;++i)this.addFontToPile(e,t[i])}},{key:"addFontToPile",value:function(e,t){if(void 0!==t&&void 0!==t.font&&null!==t.font){var i=t.font;e.push(i)}}},{key:"getBasicOptions",value:function(t){for(var i={},n=0;n<t.length;++n){var o=t[n],s={};e.parseFontString(s,o)&&(o=s),c.forEach(o,function(e,t){void 0!==e&&(i.hasOwnProperty(t)||(-1!==v.indexOf(t)?i[t]={}:i[t]=e))})}return i}},{key:"getFontOption",value:function(t,i,n){for(var o=void 0,s=0;s<t.length;++s){var r=t[s];if(r.hasOwnProperty(i)){if(void 0===(o=r[i])||null===o)continue;var a={};if(e.parseFontString(a,o)&&(o=a),o.hasOwnProperty(n))return o[n]}}if(this.fontOptions.hasOwnProperty(n))return this.fontOptions[n];throw new Error("Did not find value for multi-font for property: '"+n+"'")}},{key:"getFontOptions",value:function(e,t){for(var i={},n=["color","size","face","mod","vadjust"],o=0;o<n.length;++o){var s=n[o];i[s]=this.getFontOption(e,t,s)}return i}},{key:"propagateFonts",value:function(e){var t=this,i=[];this.addFontOptionsToPile(i,e),this.fontOptions=this.getBasicOptions(i);for(var n=0;n<v.length;++n)!function(e){var n=v[e],o=t.fontOptions[n],s=t.getFontOptions(i,n);c.forEach(s,function(e,t){o[t]=e}),o.size=Number(o.size),o.vadjust=Number(o.vadjust)}(n)}},{key:"draw",value:function(e,t,i,n,o){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"middle";if(void 0!==this.elementOptions.label){var r=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&r<this.elementOptions.scaling.label.drawThreshold-1||(r>=this.elementOptions.scaling.label.maxVisible&&(r=Number(this.elementOptions.scaling.label.maxVisible)/this.body.view.scale),this.calculateLabelSize(e,n,o,t,i,s),this._drawBackground(e),this._drawText(e,t,this.size.yLine,s,r))}}},{key:"_drawBackground",value:function(e){if(void 0!==this.fontOptions.background&&"none"!==this.fontOptions.background){e.fillStyle=this.fontOptions.background;var t=this.getSize();e.fillRect(t.left,t.top,t.width,t.height)}}},{key:"_drawText",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"middle",o=arguments[4],r=this._setAlignment(e,t,i,n),a=(0,s.default)(r,2);t=a[0],i=a[1],e.textAlign="left",t-=this.size.width/2,this.fontOptions.valign&&this.size.height>this.size.labelHeight&&("top"===this.fontOptions.valign&&(i-=(this.size.height-this.size.labelHeight)/2),"bottom"===this.fontOptions.valign&&(i+=(this.size.height-this.size.labelHeight)/2));for(var d=0;d<this.lineCount;d++){var h=this.lines[d];if(h&&h.blocks){var l=0;this.isEdgeLabel||"center"===this.fontOptions.align?l+=(this.size.width-h.width)/2:"right"===this.fontOptions.align&&(l+=this.size.width-h.width);for(var u=0;u<h.blocks.length;u++){var c=h.blocks[u];e.font=c.font;var f=this._getColor(c.color,o,c.strokeColor),p=(0,s.default)(f,2),v=p[0],g=p[1];c.strokeWidth>0&&(e.lineWidth=c.strokeWidth,e.strokeStyle=g,e.lineJoin="round"),e.fillStyle=v,c.strokeWidth>0&&e.strokeText(c.text,t+l,i+c.vadjust),e.fillText(c.text,t+l,i+c.vadjust),l+=c.width}i+=h.height}}}},{key:"_setAlignment",value:function(e,t,i,n){if(this.isEdgeLabel&&"horizontal"!==this.fontOptions.align&&!1===this.pointToSelf){t=0,i=0;"top"===this.fontOptions.align?(e.textBaseline="alphabetic",i-=4):"bottom"===this.fontOptions.align?(e.textBaseline="hanging",i+=4):e.textBaseline="middle"}else e.textBaseline=n;return[t,i]}},{key:"_getColor",value:function(e,t,i){var n=e||"#000000",o=i||"#ffffff";if(t<=this.elementOptions.scaling.label.drawThreshold){var s=Math.max(0,Math.min(1,1-(this.elementOptions.scaling.label.drawThreshold-t)));n=c.overrideOpacity(n,s),o=c.overrideOpacity(o,s)}return[n,o]}},{key:"getTextSize",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this._processLabel(e,t,i),{width:this.size.width,height:this.size.height,lineCount:this.lineCount}}},{key:"getSize",value:function(){var e=this.size.left,t=this.size.top-1;if(this.isEdgeLabel){var i=.5*-this.size.width;switch(this.fontOptions.align){case"middle":e=i,t=.5*-this.size.height;break;case"top":e=i,t=-(this.size.height+2);break;case"bottom":e=i,t=2}}return{left:e,top:t,width:this.size.width,height:this.size.height}}},{key:"calculateLabelSize",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"middle";this._processLabel(e,t,i),this.size.left=n-.5*this.size.width,this.size.top=o-.5*this.size.height,this.size.yLine=o+.5*(1-this.lineCount)*this.fontOptions.size,"hanging"===s&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4)}},{key:"getFormattingValues",value:function(e,t,i,n){var o=function(e,t,i){return"normal"===t?"mod"===i?"":e[i]:void 0!==e[t][i]?e[t][i]:e[i]},s={color:o(this.fontOptions,n,"color"),size:o(this.fontOptions,n,"size"),face:o(this.fontOptions,n,"face"),mod:o(this.fontOptions,n,"mod"),vadjust:o(this.fontOptions,n,"vadjust"),strokeWidth:this.fontOptions.strokeWidth,strokeColor:this.fontOptions.strokeColor};(t||i)&&("normal"===n&&!0===this.fontOptions.chooser&&this.elementOptions.labelHighlightBold?s.mod="bold":"function"==typeof this.fontOptions.chooser&&this.fontOptions.chooser(s,this.elementOptions.id,t,i));var r="";return void 0!==s.mod&&""!==s.mod&&(r+=s.mod+" "),r+=s.size+"px "+s.face,e.font=r.replace(/"/g,""),s.font=e.font,s.height=s.size,s}},{key:"differentState",value:function(e,t){return e!==this.selectedState||t!==this.hoverState}},{key:"_processLabelText",value:function(e,t,i,n){return new p(e,this,t,i).process(n)}},{key:"_processLabel",value:function(e,t,i){if(!1!==this.labelDirty||this.differentState(t,i)){var n=this._processLabelText(e,t,i,this.elementOptions.label);this.fontOptions.minWdt>0&&n.width<this.fontOptions.minWdt&&(n.width=this.fontOptions.minWdt),this.size.labelHeight=n.height,this.fontOptions.minHgt>0&&n.height<this.fontOptions.minHgt&&(n.height=this.fontOptions.minHgt),this.lines=n.lines,this.lineCount=n.lines.length,this.size.width=n.width,this.size.height=n.height,this.selectedState=t,this.hoverState=i,this.labelDirty=!1}}},{key:"visible",value:function(){return 0!==this.size.width&&0!==this.size.height&&void 0!==this.elementOptions.label&&!(this.fontOptions.size*this.body.view.scale<this.elementOptions.scaling.label.drawThreshold-1)}}],[{key:"parseFontString",value:function(e,t){if(!t||"string"!=typeof t)return!1;var i=t.split(" ");return e.size=i[0].replace("px",""),e.face=i[1],e.color=i[2],!0}}]),e}();t.default=g},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(23),s=n(o),r=i(0),a=n(r),d=i(1),h=n(d),l=i(5),u=i(79).default,c=function(){function e(t,i,n){(0,a.default)(this,e),this.body=i,this.labelModule=n,this.options={},this.setOptions(t),this.colorDirty=!0,this.color={},this.selectionWidth=2,this.hoverWidth=1.5,this.fromPoint=this.from,this.toPoint=this.to}return(0,h.default)(e,[{key:"connect",value:function(){this.from=this.body.nodes[this.options.from],this.to=this.body.nodes[this.options.to]}},{key:"cleanup",value:function(){return!1}},{key:"setOptions",value:function(e){this.options=e,this.from=this.body.nodes[this.options.from],this.to=this.body.nodes[this.options.to],this.id=this.options.id}},{key:"drawLine",value:function(e,t,i,n,o){e.strokeStyle=this.getColor(e,t,i,n),e.lineWidth=t.width,!1!==t.dashes?this._drawDashedLine(e,t,o):this._drawLine(e,t,o)}},{key:"_drawLine",value:function(e,t,i,n,o){if(this.from!=this.to)this._line(e,t,i,n,o);else{var r=this._getCircleData(e),a=(0,s.default)(r,3),d=a[0],h=a[1],l=a[2];this._circle(e,t,d,h,l)}}},{key:"_drawDashedLine",value:function(e,t,i,n,o){e.lineCap="round";var r=[5,5];if(!0===Array.isArray(t.dashes)&&(r=t.dashes),void 0!==e.setLineDash){if(e.save(),e.setLineDash(r),e.lineDashOffset=0,this.from!=this.to)this._line(e,t,i);else{var a=this._getCircleData(e),d=(0,s.default)(a,3),h=d[0],l=d[1],u=d[2];this._circle(e,t,h,l,u)}e.setLineDash([0]),e.lineDashOffset=0,e.restore()}else{if(this.from!=this.to)e.dashedLine(this.from.x,this.from.y,this.to.x,this.to.y,r);else{var c=this._getCircleData(e),f=(0,s.default)(c,3),p=f[0],v=f[1],g=f[2];this._circle(e,t,p,v,g)}this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}}},{key:"findBorderPosition",value:function(e,t,i){return this.from!=this.to?this._findBorderPosition(e,t,i):this._findBorderPositionCircle(e,t,i)}},{key:"findBorderPositions",value:function(e){var t={},i={};if(this.from!=this.to)t=this._findBorderPosition(this.from,e),i=this._findBorderPosition(this.to,e);else{var n=this._getCircleData(e).slice(0,2),o=(0,s.default)(n,2),r=o[0],a=o[1];t=this._findBorderPositionCircle(this.from,e,{x:r,y:a,low:.25,high:.6,direction:-1}),i=this._findBorderPositionCircle(this.from,e,{x:r,y:a,low:.6,high:.8,direction:1})}return{from:t,to:i}}},{key:"_getCircleData",value:function(e){var t=void 0,i=void 0,n=this.from,o=this.options.selfReferenceSize;return void 0!==e&&void 0===n.shape.width&&n.shape.resize(e),n.shape.width>n.shape.height?(t=n.x+.5*n.shape.width,i=n.y-o):(t=n.x+o,i=n.y-.5*n.shape.height),[t,i,o]}},{key:"_pointOnCircle",value:function(e,t,i,n){var o=2*n*Math.PI;return{x:e+i*Math.cos(o),y:t-i*Math.sin(o)}}},{key:"_findBorderPositionCircle",value:function(e,t,i){for(var n=i.x,o=i.y,s=i.low,r=i.high,a=i.direction,d=0,h=this.options.selfReferenceSize,l=void 0,u=void 0,c=void 0,f=void 0,p=void 0,v=.5*(s+r);s<=r&&d<10&&(v=.5*(s+r),l=this._pointOnCircle(n,o,h,v),u=Math.atan2(e.y-l.y,e.x-l.x),c=e.distanceToBorder(t,u),f=Math.sqrt(Math.pow(l.x-e.x,2)+Math.pow(l.y-e.y,2)),p=c-f,!(Math.abs(p)<.05));)p>0?a>0?s=v:r=v:a>0?r=v:s=v,d++;return l.t=v,l}},{key:"getLineWidth",value:function(e,t){return!0===e?Math.max(this.selectionWidth,.3/this.body.view.scale):!0===t?Math.max(this.hoverWidth,.3/this.body.view.scale):Math.max(this.options.width,.3/this.body.view.scale)}},{key:"getColor",value:function(e,t,i,n){if(!1!==t.inheritsColor){if("both"===t.inheritsColor&&this.from.id!==this.to.id){var o=e.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y),s=void 0,r=void 0;return s=this.from.options.color.highlight.border,r=this.to.options.color.highlight.border,!1===this.from.selected&&!1===this.to.selected?(s=l.overrideOpacity(this.from.options.color.border,t.opacity),r=l.overrideOpacity(this.to.options.color.border,t.opacity)):!0===this.from.selected&&!1===this.to.selected?r=this.to.options.color.border:!1===this.from.selected&&!0===this.to.selected&&(s=this.from.options.color.border),o.addColorStop(0,s),o.addColorStop(1,r),o}return"to"===t.inheritsColor?l.overrideOpacity(this.to.options.color.border,t.opacity):l.overrideOpacity(this.from.options.color.border,t.opacity)}return l.overrideOpacity(t.color,t.opacity)}},{key:"_circle",value:function(e,t,i,n,o){this.enableShadow(e,t),e.beginPath(),e.arc(i,n,o,0,2*Math.PI,!1),e.stroke(),this.disableShadow(e,t)}},{key:"getDistanceToEdge",value:function(e,t,i,n,o,r,a,d){var h=0;if(this.from!=this.to)h=this._getDistanceToEdge(e,t,i,n,o,r,a);else{var l=this._getCircleData(void 0),u=(0,s.default)(l,3),c=u[0],f=u[1],p=u[2],v=c-o,g=f-r;h=Math.abs(Math.sqrt(v*v+g*g)-p)}return h}},{key:"_getDistanceToLine",value:function(e,t,i,n,o,s){var r=i-e,a=n-t,d=r*r+a*a,h=((o-e)*r+(s-t)*a)/d;h>1?h=1:h<0&&(h=0);var l=e+h*r,u=t+h*a,c=l-o,f=u-s;return Math.sqrt(c*c+f*f)}},{key:"getArrowData",value:function(e,t,i,n,o,r){var a=void 0,d=void 0,h=void 0,l=void 0,u=void 0,c=void 0,f=void 0,p=r.width;if("from"===t?(h=this.from,l=this.to,u=.1,c=r.fromArrowScale,f=r.fromArrowType):"to"===t?(h=this.to,l=this.from,u=-.1,c=r.toArrowScale,f=r.toArrowType):(h=this.to,l=this.from,c=r.middleArrowScale,f=r.middleArrowType),h!=l)if("middle"!==t)if(!0===this.options.smooth.enabled){d=this.findBorderPosition(h,e,{via:i});var v=this.getPoint(Math.max(0,Math.min(1,d.t+u)),i);a=Math.atan2(d.y-v.y,d.x-v.x)}else a=Math.atan2(h.y-l.y,h.x-l.x),d=this.findBorderPosition(h,e);else a=Math.atan2(h.y-l.y,h.x-l.x),d=this.getPoint(.5,i);else{var g=this._getCircleData(e),y=(0,s.default)(g,3),m=y[0],b=y[1],_=y[2];"from"===t?(d=this.findBorderPosition(this.from,e,{x:m,y:b,low:.25,high:.6,direction:-1}),a=-2*d.t*Math.PI+1.5*Math.PI+.1*Math.PI):"to"===t?(d=this.findBorderPosition(this.from,e,{x:m,y:b,low:.6,high:1,direction:1}),a=-2*d.t*Math.PI+1.5*Math.PI-1.1*Math.PI):(d=this._pointOnCircle(m,b,_,.175),a=3.9269908169872414)}"middle"===t&&c<0&&(p*=-1);var w=15*c+3*p;return{point:d,core:{x:d.x-.9*w*Math.cos(a),y:d.y-.9*w*Math.sin(a)},angle:a,length:w,type:f}}},{key:"drawArrowHead",value:function(e,t,i,n,o){e.strokeStyle=this.getColor(e,t,i,n),e.fillStyle=e.strokeStyle,e.lineWidth=t.width,u.draw(e,o),this.enableShadow(e,t),e.fill(),this.disableShadow(e,t)}},{key:"enableShadow",value:function(e,t){!0===t.shadow&&(e.shadowColor=t.shadowColor,e.shadowBlur=t.shadowSize,e.shadowOffsetX=t.shadowX,e.shadowOffsetY=t.shadowY)}},{key:"disableShadow",value:function(e,t){!0===t.shadow&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}}]),e}();t.default=c},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(2),s=n(o),r=i(3),a=n(r),d=i(4),h=n(d),l=i(0),u=n(l),c=i(1),f=n(c),p=function(){function e(){(0,u.default)(this,e)}return(0,f.default)(e,null,[{key:"transform",value:function(e,t){e instanceof Array||(e=[e]);for(var i=t.point.x,n=t.point.y,o=t.angle,s=t.length,r=0;r<e.length;++r){var a=e[r],d=a.x*Math.cos(o)-a.y*Math.sin(o),h=a.x*Math.sin(o)+a.y*Math.cos(o);a.x=i+s*d,a.y=n+s*h}}},{key:"drawPath",value:function(e,t){e.beginPath(),e.moveTo(t[0].x,t[0].y);for(var i=1;i<t.length;++i)e.lineTo(t[i].x,t[i].y);e.closePath()}}]),e}(),v=function(e){function t(){return(0,u.default)(this,t),(0,a.default)(this,(t.__proto__||(0,s.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),(0,f.default)(t,null,[{key:"draw",value:function(e,t){var i=[{x:0,y:0},{x:-1,y:.3},{x:-.9,y:0},{x:-1,y:-.3}];p.transform(i,t),p.drawPath(e,i)}}]),t}(p),g=function(){function e(){(0,u.default)(this,e)}return(0,f.default)(e,null,[{key:"draw",value:function(e,t){var i={x:-.4,y:0};p.transform(i,t),e.circle(i.x,i.y,.4*t.length)}}]),e}(),y=function(){function e(){(0,u.default)(this,e)}return(0,f.default)(e,null,[{key:"draw",value:function(e,t){var i=[{x:0,y:.5},{x:0,y:-.5},{x:-.15,y:-.5},{x:-.15,y:.5}];p.transform(i,t),p.drawPath(e,i)}}]),e}(),m=function(){function e(){(0,u.default)(this,e)}return(0,f.default)(e,null,[{key:"draw",value:function(e,t){var i;switch(t.type&&(i=t.type.toLowerCase()),i){case"circle":g.draw(e,t);break;case"bar":y.draw(e,t);break;case"arrow":default:v.draw(e,t)}}}]),e}();t.default=m},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(0),s=n(o),r=i(1),a=n(r),d=function(){function e(t,i,n){(0,s.default)(this,e),this.body=t,this.physicsBody=i,this.barnesHutTree,this.setOptions(n),this.randomSeed=5}return(0,a.default)(e,[{key:"setOptions",value:function(e){this.options=e,this.thetaInversed=1/this.options.theta,this.overlapAvoidanceFactor=1-Math.max(0,Math.min(1,this.options.avoidOverlap))}},{key:"seededRandom",value:function(){var e=1e4*Math.sin(this.randomSeed++);return e-Math.floor(e)}},{key:"solve",value:function(){if(0!==this.options.gravitationalConstant&&this.physicsBody.physicsNodeIndices.length>0){var e=void 0,t=this.body.nodes,i=this.physicsBody.physicsNodeIndices,n=i.length,o=this._formBarnesHutTree(t,i);this.barnesHutTree=o;for(var s=0;s<n;s++)e=t[i[s]],e.options.mass>0&&this._getForceContributions(o.root,e)}}},{key:"_getForceContributions",value:function(e,t){this._getForceContribution(e.children.NW,t),this._getForceContribution(e.children.NE,t),this._getForceContribution(e.children.SW,t),this._getForceContribution(e.children.SE,t)}},{key:"_getForceContribution",value:function(e,t){if(e.childrenCount>0){var i=void 0,n=void 0,o=void 0;i=e.centerOfMass.x-t.x,n=e.centerOfMass.y-t.y,o=Math.sqrt(i*i+n*n),o*e.calcSize>this.thetaInversed?this._calculateForces(o,i,n,t,e):4===e.childrenCount?this._getForceContributions(e,t):e.children.data.id!=t.id&&this._calculateForces(o,i,n,t,e)}}},{key:"_calculateForces",value:function(e,t,i,n,o){0===e&&(e=.1,t=e),this.overlapAvoidanceFactor<1&&n.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*n.shape.radius,e-n.shape.radius));var s=this.options.gravitationalConstant*o.mass*n.options.mass/Math.pow(e,3),r=t*s,a=i*s;this.physicsBody.forces[n.id].x+=r,this.physicsBody.forces[n.id].y+=a}},{key:"_formBarnesHutTree",value:function(e,t){for(var i=void 0,n=t.length,o=e[t[0]].x,s=e[t[0]].y,r=e[t[0]].x,a=e[t[0]].y,d=1;d<n;d++){var h=e[t[d]],l=h.x,u=h.y;h.options.mass>0&&(l<o&&(o=l),l>r&&(r=l),u<s&&(s=u),u>a&&(a=u))}var c=Math.abs(r-o)-Math.abs(a-s);c>0?(s-=.5*c,a+=.5*c):(o+=.5*c,r-=.5*c);var f=Math.max(1e-5,Math.abs(r-o)),p=.5*f,v=.5*(o+r),g=.5*(s+a),y={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:v-p,maxX:v+p,minY:g-p,maxY:g+p},size:f,calcSize:1/f,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(y.root);for(var m=0;m<n;m++)i=e[t[m]],i.options.mass>0&&this._placeInTree(y.root,i);return y}},{key:"_updateBranchMass",value:function(e,t){var i=e.centerOfMass,n=e.mass+t.options.mass,o=1/n;i.x=i.x*e.mass+t.x*t.options.mass,i.x*=o,i.y=i.y*e.mass+t.y*t.options.mass,i.y*=o,e.mass=n;var s=Math.max(Math.max(t.height,t.radius),t.width);e.maxWidth=e.maxWidth<s?s:e.maxWidth}},{key:"_placeInTree",value:function(e,t,i){1==i&&void 0!==i||this._updateBranchMass(e,t);var n=e.children.NW.range,o=void 0;o=n.maxX>t.x?n.maxY>t.y?"NW":"SW":n.maxY>t.y?"NE":"SE",this._placeInRegion(e,t,o)}},{key:"_placeInRegion",value:function(e,t,i){var n=e.children[i];switch(n.childrenCount){case 0:n.children.data=t,n.childrenCount=1,this._updateBranchMass(n,t);break;case 1:n.children.data.x===t.x&&n.children.data.y===t.y?(t.x+=this.seededRandom(),t.y+=this.seededRandom()):(this._splitBranch(n),this._placeInTree(n,t));break;case 4:this._placeInTree(n,t)}}},{key:"_splitBranch",value:function(e){var t=null;1===e.childrenCount&&(t=e.children.data,e.mass=0,e.centerOfMass.x=0,e.centerOfMass.y=0),e.childrenCount=4,e.children.data=null,this._insertRegion(e,"NW"),this._insertRegion(e,"NE"),this._insertRegion(e,"SW"),this._insertRegion(e,"SE"),null!=t&&this._placeInTree(e,t)}},{key:"_insertRegion",value:function(e,t){var i=void 0,n=void 0,o=void 0,s=void 0,r=.5*e.size;switch(t){case"NW":i=e.range.minX,n=e.range.minX+r,o=e.range.minY,s=e.range.minY+r;break;case"NE":i=e.range.minX+r,n=e.range.maxX,o=e.range.minY,s=e.range.minY+r;break;case"SW":i=e.range.minX,n=e.range.minX+r,o=e.range.minY+r,s=e.range.maxY;break;case"SE":i=e.range.minX+r,n=e.range.maxX,o=e.range.minY+r,s=e.range.maxY}e.children[t]={centerOfMass:{x:0,y:0},mass:0,range:{minX:i,maxX:n,minY:o,maxY:s},size:.5*e.size,calcSize:2*e.calcSize,children:{data:null},maxWidth:0,level:e.level+1,childrenCount:0}}},{key:"_debug",value:function(e,t){void 0!==this.barnesHutTree&&(e.lineWidth=1,this._drawBranch(this.barnesHutTree.root,e,t))}},{key:"_drawBranch",value:function(e,t,i){void 0===i&&(i="#FF0000"),4===e.childrenCount&&(this._drawBranch(e.children.NW,t),this._drawBranch(e.children.NE,t),this._drawBranch(e.children.SE,t),this._drawBranch(e.children.SW,t)),t.strokeStyle=i,t.beginPath(),t.moveTo(e.range.minX,e.range.minY),t.lineTo(e.range.maxX,e.range.minY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.minY),t.lineTo(e.range.maxX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.maxY),t.lineTo(e.range.minX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.minX,e.range.maxY),t.lineTo(e.range.minX,e.range.minY),t.stroke()}}]),e}();t.default=d},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(0),s=n(o),r=i(1),a=n(r),d=function(){function e(t,i,n){(0,s.default)(this,e),this.body=t,this.physicsBody=i,this.setOptions(n)}return(0,a.default)(e,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e=void 0,t=void 0,i=void 0,n=void 0,o=this.body.nodes,s=this.physicsBody.physicsNodeIndices,r=this.physicsBody.forces,a=0;a<s.length;a++){n=o[s[a]],e=-n.x,t=-n.y,i=Math.sqrt(e*e+t*t),this._calculateForces(i,e,t,r,n)}}},{key:"_calculateForces",value:function(e,t,i,n,o){var s=0===e?0:this.options.centralGravity/e;n[o.id].x=t*s,n[o.id].y=i*s}}]),e}();t.default=d},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});var n="string",o="boolean",s="number",r="object",a=["arrow","circle","bar"],d={configure:{enabled:{boolean:o},filter:{boolean:o,string:n,array:"array",function:"function"},container:{dom:"dom"},showButton:{boolean:o},__type__:{object:r,boolean:o,string:n,array:"array",function:"function"}},edges:{arrows:{to:{enabled:{boolean:o},scaleFactor:{number:s},type:{string:a},__type__:{object:r,boolean:o}},middle:{enabled:{boolean:o},scaleFactor:{number:s},type:{string:a},__type__:{object:r,boolean:o}},from:{enabled:{boolean:o},scaleFactor:{number:s},type:{string:a},__type__:{object:r,boolean:o}},__type__:{string:["from","to","middle"],object:r}},arrowStrikethrough:{boolean:o},chosen:{label:{boolean:o,function:"function"},edge:{boolean:o,function:"function"},__type__:{object:r,boolean:o}},color:{color:{string:n},highlight:{string:n},hover:{string:n},inherit:{string:["from","to","both"],boolean:o},opacity:{number:s},__type__:{object:r,string:n}},dashes:{boolean:o,array:"array"},font:{color:{string:n},size:{number:s},face:{string:n},background:{string:n},strokeWidth:{number:s},strokeColor:{string:n},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:s},multi:{boolean:o,string:n},bold:{color:{string:n},size:{number:s},face:{string:n},mod:{string:n},vadjust:{number:s},__type__:{object:r,string:n}},boldital:{color:{string:n},size:{number:s},face:{string:n},mod:{string:n},vadjust:{number:s},__type__:{object:r,string:n}},ital:{color:{string:n},size:{number:s},face:{string:n},mod:{string:n},vadjust:{number:s},__type__:{object:r,string:n}},mono:{color:{string:n},size:{number:s},face:{string:n},mod:{string:n},vadjust:{number:s},__type__:{object:r,string:n}},__type__:{object:r,string:n}},hidden:{boolean:o},hoverWidth:{function:"function",number:s},label:{string:n,undefined:"undefined"},labelHighlightBold:{boolean:o},length:{number:s,undefined:"undefined"},physics:{boolean:o},scaling:{min:{number:s},max:{number:s},label:{enabled:{boolean:o},min:{number:s},max:{number:s},maxVisible:{number:s},drawThreshold:{number:s},__type__:{object:r,boolean:o}},customScalingFunction:{function:"function"},__type__:{object:r}},selectionWidth:{function:"function",number:s},selfReferenceSize:{number:s},shadow:{enabled:{boolean:o},color:{string:n},size:{number:s},x:{number:s},y:{number:s},__type__:{object:r,boolean:o}},smooth:{enabled:{boolean:o},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:s},forceDirection:{string:["horizontal","vertical","none"],boolean:o},__type__:{object:r,boolean:o}},title:{string:n,undefined:"undefined"},width:{number:s},widthConstraint:{maximum:{number:s},__type__:{object:r,boolean:o,number:s}},value:{number:s,undefined:"undefined"},__type__:{object:r}},groups:{useDefaultGroups:{boolean:o},__any__:"get from nodes, will be overwritten below",__type__:{object:r}},interaction:{dragNodes:{boolean:o},dragView:{boolean:o},hideEdgesOnDrag:{boolean:o},hideNodesOnDrag:{boolean:o},hover:{boolean:o},keyboard:{enabled:{boolean:o},speed:{x:{number:s},y:{number:s},zoom:{number:s},__type__:{object:r}},bindToWindow:{boolean:o},__type__:{object:r,boolean:o}},multiselect:{boolean:o},navigationButtons:{boolean:o},selectable:{boolean:o},selectConnectedEdges:{boolean:o},hoverConnectedEdges:{boolean:o},tooltipDelay:{number:s},zoomView:{boolean:o},__type__:{object:r}},layout:{randomSeed:{undefined:"undefined",number:s},improvedLayout:{boolean:o},hierarchical:{enabled:{boolean:o},levelSeparation:{number:s},nodeSpacing:{number:s},treeSpacing:{number:s},blockShifting:{boolean:o},edgeMinimization:{boolean:o},parentCentralization:{boolean:o},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},__type__:{object:r,boolean:o}},__type__:{object:r}},manipulation:{enabled:{boolean:o},initiallyActive:{boolean:o},addNode:{boolean:o,function:"function"},addEdge:{boolean:o,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:r,boolean:o,function:"function"}},deleteNode:{boolean:o,function:"function"},deleteEdge:{boolean:o,function:"function"},controlNodeStyle:"get from nodes, will be overwritten below",__type__:{object:r,boolean:o}},nodes:{borderWidth:{number:s},borderWidthSelected:{number:s,undefined:"undefined"},brokenImage:{string:n,undefined:"undefined"},chosen:{label:{boolean:o,function:"function"},node:{boolean:o,function:"function"},__type__:{object:r,boolean:o}},color:{border:{string:n},background:{string:n},highlight:{border:{string:n},background:{string:n},__type__:{object:r,string:n}},hover:{border:{string:n},background:{string:n},__type__:{object:r,string:n}},__type__:{object:r,string:n}},fixed:{x:{boolean:o},y:{boolean:o},__type__:{object:r,boolean:o}},font:{align:{string:n},color:{string:n},size:{number:s},face:{string:n},background:{string:n},strokeWidth:{number:s},strokeColor:{string:n},vadjust:{number:s},multi:{boolean:o,string:n},bold:{color:{string:n},size:{number:s},face:{string:n},mod:{string:n},vadjust:{number:s},__type__:{object:r,string:n}},boldital:{color:{string:n},size:{number:s},face:{string:n},mod:{string:n},vadjust:{number:s},__type__:{object:r,string:n}},ital:{color:{string:n},size:{number:s},face:{string:n},mod:{string:n},vadjust:{number:s},__type__:{object:r,string:n}},mono:{color:{string:n},size:{number:s},face:{string:n},mod:{string:n},vadjust:{number:s},__type__:{object:r,string:n}},__type__:{object:r,string:n}},group:{string:n,number:s,undefined:"undefined"},heightConstraint:{minimum:{number:s},valign:{string:n},__type__:{object:r,boolean:o,number:s}},hidden:{boolean:o},icon:{face:{string:n},code:{string:n},size:{number:s},color:{string:n},__type__:{object:r}},id:{string:n,number:s},image:{selected:{string:n,undefined:"undefined"},unselected:{string:n,undefined:"undefined"},__type__:{object:r,string:n}},label:{string:n,undefined:"undefined"},labelHighlightBold:{boolean:o},level:{number:s,undefined:"undefined"},margin:{top:{number:s},right:{number:s},bottom:{number:s},left:{number:s},__type__:{object:r,number:s}},mass:{number:s},physics:{boolean:o},scaling:{min:{number:s},max:{number:s},label:{enabled:{boolean:o},min:{number:s},max:{number:s},maxVisible:{number:s},drawThreshold:{number:s},__type__:{object:r,boolean:o}},customScalingFunction:{function:"function"},__type__:{object:r}},shadow:{enabled:{boolean:o},color:{string:n},size:{number:s},x:{number:s},y:{number:s},__type__:{object:r,boolean:o}},shape:{string:["ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon","hexagon"]},shapeProperties:{borderDashes:{boolean:o,array:"array"},borderRadius:{number:s},interpolation:{boolean:o},useImageSize:{boolean:o},useBorderWithImage:{boolean:o},__type__:{object:r}},size:{number:s},title:{string:n,dom:"dom",undefined:"undefined"},value:{number:s,undefined:"undefined"},widthConstraint:{minimum:{number:s},maximum:{number:s},__type__:{object:r,boolean:o,number:s}},x:{number:s},y:{number:s},__type__:{object:r}},physics:{enabled:{boolean:o},barnesHut:{gravitationalConstant:{number:s},centralGravity:{number:s},springLength:{number:s},springConstant:{number:s},damping:{number:s},avoidOverlap:{number:s},__type__:{object:r}},forceAtlas2Based:{gravitationalConstant:{number:s},centralGravity:{number:s},springLength:{number:s},springConstant:{number:s},damping:{number:s},avoidOverlap:{number:s},__type__:{object:r}},repulsion:{centralGravity:{number:s},springLength:{number:s},springConstant:{number:s},nodeDistance:{number:s},damping:{number:s},__type__:{object:r}},hierarchicalRepulsion:{centralGravity:{number:s},springLength:{number:s},springConstant:{number:s},nodeDistance:{number:s},damping:{number:s},__type__:{object:r}},maxVelocity:{number:s},minVelocity:{number:s},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:o},iterations:{number:s},updateInterval:{number:s},onlyDynamicEdges:{boolean:o},fit:{boolean:o},__type__:{object:r,boolean:o}},timestep:{number:s},adaptiveTimestep:{boolean:o},__type__:{object:r,boolean:o}},autoResize:{boolean:o},clickToUse:{boolean:o},locale:{string:n},locales:{__any__:{any:"any"},__type__:{object:r}},height:{string:n},width:{string:n},__type__:{object:r}};d.groups.__any__=d.nodes,d.manipulation.controlNodeStyle=d.nodes;var h={nodes:{borderWidth:[1,0,10,1],borderWidthSelected:[2,0,10,1],color:{border:["color","#2B7CE9"],background:["color","#97C2FC"],highlight:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]},hover:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]}},fixed:{x:!1,y:!1},font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[0,0,50,1],strokeColor:["color","#ffffff"]},hidden:!1,labelHighlightBold:!0,physics:!0,scaling:{min:[10,0,200,1],max:[30,0,200,1],label:{enabled:!1,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},shape:["ellipse","box","circle","database","diamond","dot","square","star","text","triangle","triangleDown","hexagon"],shapeProperties:{borderDashes:!1,borderRadius:[6,0,20,1],interpolation:!0,useImageSize:!1},size:[25,0,200,1]},edges:{arrows:{to:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},middle:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},from:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"}},arrowStrikethrough:!0,color:{color:["color","#848484"],highlight:["color","#848484"],hover:["color","#848484"],inherit:["from","to","both",!0,!1],opacity:[1,0,1,.05]},dashes:!1,font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[2,0,50,1],strokeColor:["color","#ffffff"],align:["horizontal","top","middle","bottom"]},hidden:!1,hoverWidth:[1.5,0,5,.1],labelHighlightBold:!0,physics:!0,scaling:{min:[1,0,100,1],max:[15,0,100,1],label:{enabled:!0,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},selectionWidth:[1.5,0,5,.1],selfReferenceSize:[20,0,200,1],shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},smooth:{enabled:!0,type:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"],forceDirection:["horizontal","vertical","none"],roundness:[.5,0,1,.05]},width:[1,0,30,1]},layout:{hierarchical:{enabled:!1,levelSeparation:[150,20,500,5],nodeSpacing:[100,20,500,5],treeSpacing:[200,20,500,5],blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:["UD","DU","LR","RL"],sortMethod:["hubsize","directed"]}},interaction:{dragNodes:!0,dragView:!0,hideEdgesOnDrag:!1,hideNodesOnDrag:!1,hover:!1,keyboard:{enabled:!1,speed:{x:[10,0,40,1],y:[10,0,40,1],zoom:[.02,0,.1,.005]},bindToWindow:!0},multiselect:!1,navigationButtons:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0,tooltipDelay:[300,0,1e3,25],zoomView:!0},manipulation:{enabled:!1,initiallyActive:!1},physics:{enabled:!0,barnesHut:{gravitationalConstant:[-2e3,-3e4,0,50],centralGravity:[.3,0,10,.05],springLength:[95,0,500,5],springConstant:[.04,0,1.2,.005],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},forceAtlas2Based:{gravitationalConstant:[-50,-500,0,1],centralGravity:[.01,0,1,.005],springLength:[95,0,500,5],springConstant:[.08,0,1.2,.005],damping:[.4,0,1,.01],avoidOverlap:[0,0,1,.01]},repulsion:{centralGravity:[.2,0,10,.05],springLength:[200,0,500,5],springConstant:[.05,0,1.2,.005],nodeDistance:[100,0,500,5],damping:[.09,0,1,.01]},hierarchicalRepulsion:{centralGravity:[.2,0,10,.05],springLength:[100,0,500,5],springConstant:[.01,0,1.2,.005],nodeDistance:[120,0,500,5],damping:[.09,0,1,.01]},maxVelocity:[50,0,150,1],minVelocity:[.1,.01,.5,.01],solver:["barnesHut","forceAtlas2Based","repulsion","hierarchicalRepulsion"],timestep:[.5,.01,1,.01]}};t.allOptions=d,t.configureOptions=h},function(e,t,i){t.util=i(5),t.DOMutil=i(119),t.DataSet=i(32),t.DataView=i(51),t.Queue=i(72),t.Network=i(121),t.network={Images:i(76),dotparser:i(74),gephiParser:i(75),allOptions:i(82)},t.network.convertDot=function(e){return t.network.dotparser.DOTToGraph(e)},t.network.convertGephi=function(e,i){return t.network.gephiParser.parseGephi(e,i)},t.moment=i(71),t.Hammer=i(22),t.keycharm=i(52)},function(e,t,i){i(36),i(47),e.exports=i(96)},function(e,t,i){var n=i(86),o=i(87),s=i(24),r=i(17);e.exports=i(60)(Array,"Array",function(e,t){this._t=r(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,i=this._i++;return!e||i>=e.length?(this._t=void 0,o(1)):"keys"==t?o(0,i):"values"==t?o(0,e[i]):o(0,[i,e[i]])},"values"),s.Arguments=s.Array,n("keys"),n("values"),n("entries")},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,i){var n=i(41),o=i(27),s=i(46),r={};i(18)(r,i(8)("iterator"),function(){return this}),e.exports=function(e,t,i){e.prototype=n(r,{next:o(1,i)}),s(e,t+" Iterator")}},function(e,t,i){var n=i(12),o=i(19),s=i(26);e.exports=i(13)?Object.defineProperties:function(e,t){o(e);for(var i,r=s(t),a=r.length,d=0;a>d;)n.f(e,i=r[d++],t[i]);return e}},function(e,t,i){var n=i(17),o=i(92),s=i(93);e.exports=function(e){return function(t,i,r){var a,d=n(t),h=o(d.length),l=s(r,h);if(e&&i!=i){for(;h>l;)if((a=d[l++])!=a)return!0}else for(;h>l;l++)if((e||l in d)&&d[l]===i)return e||l||0;return!e&&-1}}},function(e,t,i){var n=i(42),o=Math.min;e.exports=function(e){return e>0?o(n(e),9007199254740991):0}},function(e,t,i){var n=i(42),o=Math.max,s=Math.min;e.exports=function(e,t){return e=n(e),e<0?o(e+t,0):s(e,t)}},function(e,t,i){var n=i(9).document;e.exports=n&&n.documentElement},function(e,t,i){var n=i(42),o=i(38);e.exports=function(e){return function(t,i){var s,r,a=String(o(t)),d=n(i),h=a.length;return d<0||d>=h?e?"":void 0:(s=a.charCodeAt(d),s<55296||s>56319||d+1===h||(r=a.charCodeAt(d+1))<56320||r>57343?e?a.charAt(d):s:e?a.slice(d,d+2):r-56320+(s-55296<<10)+65536)}}},function(e,t,i){var n=i(19),o=i(97);e.exports=i(6).getIterator=function(e){var t=o(e);if("function"!=typeof t)throw TypeError(e+" is not iterable!");return n(t.call(e))}},function(e,t,i){var n=i(67),o=i(8)("iterator"),s=i(24);e.exports=i(6).getIteratorMethod=function(e){if(void 0!=e)return e[o]||e["@@iterator"]||s[n(e)]}},function(e,t,i){i(99);var n=i(6).Object;e.exports=function(e,t){return n.create(e,t)}},function(e,t,i){var n=i(11);n(n.S,"Object",{create:i(41)})},function(e,t,i){i(101),e.exports=i(6).Object.keys},function(e,t,i){var n=i(29),o=i(26);i(68)("keys",function(){return function(e){return o(n(e))}})},function(e,t,i){e.exports={default:i(103),__esModule:!0}},function(e,t,i){i(47),i(36),e.exports=i(48).f("iterator")},function(e,t,i){e.exports={default:i(105),__esModule:!0}},function(e,t,i){i(106),i(111),i(112),i(113),e.exports=i(6).Symbol},function(e,t,i){var n=i(9),o=i(14),s=i(13),r=i(11),a=i(64),d=i(107).KEY,h=i(20),l=i(44),u=i(46),c=i(28),f=i(8),p=i(48),v=i(49),g=i(108),y=i(109),m=i(19),b=i(17),_=i(40),w=i(27),k=i(41),x=i(110),O=i(70),M=i(12),E=i(26),S=O.f,D=M.f,C=x.f,T=n.Symbol,P=n.JSON,I=P&&P.stringify,F=f("_hidden"),N=f("toPrimitive"),B={}.propertyIsEnumerable,z=l("symbol-registry"),R=l("symbols"),A=l("op-symbols"),j=Object.prototype,L="function"==typeof T,H=n.QObject,W=!H||!H.prototype||!H.prototype.findChild,Y=s&&h(function(){return 7!=k(D({},"a",{get:function(){return D(this,"a",{value:7}).a}})).a})?function(e,t,i){var n=S(j,t);n&&delete j[t],D(e,t,i),n&&e!==j&&D(j,t,n)}:D,V=function(e){var t=R[e]=k(T.prototype);return t._k=e,t},U=L&&"symbol"==typeof T.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof T},q=function(e,t,i){return e===j&&q(A,t,i),m(e),t=_(t,!0),m(i),o(R,t)?(i.enumerable?(o(e,F)&&e[F][t]&&(e[F][t]=!1),i=k(i,{enumerable:w(0,!1)})):(o(e,F)||D(e,F,w(1,{})),e[F][t]=!0),Y(e,t,i)):D(e,t,i)},G=function(e,t){m(e);for(var i,n=g(t=b(t)),o=0,s=n.length;s>o;)q(e,i=n[o++],t[i]);return e},X=function(e,t){return void 0===t?k(e):G(k(e),t)},K=function(e){var t=B.call(this,e=_(e,!0));return!(this===j&&o(R,e)&&!o(A,e))&&(!(t||!o(this,e)||!o(R,e)||o(this,F)&&this[F][e])||t)},Z=function(e,t){if(e=b(e),t=_(t,!0),e!==j||!o(R,t)||o(A,t)){var i=S(e,t);return!i||!o(R,t)||o(e,F)&&e[F][t]||(i.enumerable=!0),i}},$=function(e){for(var t,i=C(b(e)),n=[],s=0;i.length>s;)o(R,t=i[s++])||t==F||t==d||n.push(t);return n},Q=function(e){for(var t,i=e===j,n=C(i?A:b(e)),s=[],r=0;n.length>r;)!o(R,t=n[r++])||i&&!o(j,t)||s.push(R[t]);return s};L||(T=function(){if(this instanceof T)throw TypeError("Symbol is not a constructor!");var e=c(arguments.length>0?arguments[0]:void 0),t=function(i){this===j&&t.call(A,i),o(this,F)&&o(this[F],e)&&(this[F][e]=!1),Y(this,e,w(1,i))};return s&&W&&Y(j,e,{configurable:!0,set:t}),V(e)},a(T.prototype,"toString",function(){return this._k}),O.f=Z,M.f=q,i(69).f=x.f=$,i(31).f=K,i(50).f=Q,s&&!i(39)&&a(j,"propertyIsEnumerable",K,!0),p.f=function(e){return V(f(e))}),r(r.G+r.W+r.F*!L,{Symbol:T});for(var J="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ee=0;J.length>ee;)f(J[ee++]);for(var te=E(f.store),ie=0;te.length>ie;)v(te[ie++]);r(r.S+r.F*!L,"Symbol",{for:function(e){return o(z,e+="")?z[e]:z[e]=T(e)},keyFor:function(e){if(!U(e))throw TypeError(e+" is not a symbol!");for(var t in z)if(z[t]===e)return t},useSetter:function(){W=!0},useSimple:function(){W=!1}}),r(r.S+r.F*!L,"Object",{create:X,defineProperty:q,defineProperties:G,getOwnPropertyDescriptor:Z,getOwnPropertyNames:$,getOwnPropertySymbols:Q}),P&&r(r.S+r.F*(!L||h(function(){var e=T();return"[null]"!=I([e])||"{}"!=I({a:e})||"{}"!=I(Object(e))})),"JSON",{stringify:function(e){if(void 0!==e&&!U(e)){for(var t,i,n=[e],o=1;arguments.length>o;)n.push(arguments[o++]);return t=n[1],"function"==typeof t&&(i=t),!i&&y(t)||(t=function(e,t){if(i&&(t=i.call(this,e,t)),!U(t))return t}),n[1]=t,I.apply(P,n)}}}),T.prototype[N]||i(18)(T.prototype,N,T.prototype.valueOf),u(T,"Symbol"),u(Math,"Math",!0),u(n.JSON,"JSON",!0)},function(e,t,i){var n=i(28)("meta"),o=i(25),s=i(14),r=i(12).f,a=0,d=Object.isExtensible||function(){return!0},h=!i(20)(function(){return d(Object.preventExtensions({}))}),l=function(e){r(e,n,{value:{i:"O"+ ++a,w:{}}})},u=function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!s(e,n)){if(!d(e))return"F";if(!t)return"E";l(e)}return e[n].i},c=function(e,t){if(!s(e,n)){if(!d(e))return!0;if(!t)return!1;l(e)}return e[n].w},f=function(e){return h&&p.NEED&&d(e)&&!s(e,n)&&l(e),e},p=e.exports={KEY:n,NEED:!1,fastKey:u,getWeak:c,onFreeze:f}},function(e,t,i){var n=i(26),o=i(50),s=i(31);e.exports=function(e){var t=n(e),i=o.f;if(i)for(var r,a=i(e),d=s.f,h=0;a.length>h;)d.call(e,r=a[h++])&&t.push(r);return t}},function(e,t,i){var n=i(37);e.exports=Array.isArray||function(e){return"Array"==n(e)}},function(e,t,i){var n=i(17),o=i(69).f,s={}.toString,r="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(e){try{return o(e)}catch(e){return r.slice()}};e.exports.f=function(e){return r&&"[object Window]"==s.call(e)?a(e):o(n(e))}},function(e,t){},function(e,t,i){i(49)("asyncIterator")},function(e,t,i){i(49)("observable")},function(e,t,i){(function(e){!function(t,i){e.exports=i()}(0,function(){function t(){return Sn.apply(null,arguments)}function i(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function n(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function o(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0}function s(e){return void 0===e}function r(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function a(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function d(e,t){var i,n=[];for(i=0;i<e.length;++i)n.push(t(e[i],i));return n}function h(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function l(e,t){for(var i in t)h(t,i)&&(e[i]=t[i]);return h(t,"toString")&&(e.toString=t.toString),h(t,"valueOf")&&(e.valueOf=t.valueOf),e}function u(e,t,i,n){return Ot(e,t,i,n,!0).utc()}function c(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function f(e){return null==e._pf&&(e._pf=c()),e._pf}function p(e){if(null==e._isValid){var t=f(e),i=Dn.call(t.parsedDateParts,function(e){return null!=e}),n=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&i);if(e._strict&&(n=n&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return n;e._isValid=n}return e._isValid}function v(e){var t=u(NaN);return null!=e?l(f(t),e):f(t).userInvalidated=!0,t}function g(e,t){var i,n,o;if(s(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),s(t._i)||(e._i=t._i),s(t._f)||(e._f=t._f),s(t._l)||(e._l=t._l),s(t._strict)||(e._strict=t._strict),s(t._tzm)||(e._tzm=t._tzm),s(t._isUTC)||(e._isUTC=t._isUTC),s(t._offset)||(e._offset=t._offset),s(t._pf)||(e._pf=f(t)),s(t._locale)||(e._locale=t._locale),Cn.length>0)for(i=0;i<Cn.length;i++)n=Cn[i],o=t[n],s(o)||(e[n]=o);return e}function y(e){g(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===Tn&&(Tn=!0,t.updateOffset(this),Tn=!1)}function m(e){return e instanceof y||null!=e&&null!=e._isAMomentObject}function b(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function _(e){var t=+e,i=0;return 0!==t&&isFinite(t)&&(i=b(t)),i}function w(e,t,i){var n,o=Math.min(e.length,t.length),s=Math.abs(e.length-t.length),r=0;for(n=0;n<o;n++)(i&&e[n]!==t[n]||!i&&_(e[n])!==_(t[n]))&&r++;return r+s}function k(e){!1===t.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function x(e,i){var n=!0;return l(function(){if(null!=t.deprecationHandler&&t.deprecationHandler(null,e),n){for(var o,s=[],r=0;r<arguments.length;r++){if(o="","object"==typeof arguments[r]){o+="\n["+r+"] ";for(var a in arguments[0])o+=a+": "+arguments[0][a]+", ";o=o.slice(0,-2)}else o=arguments[r];s.push(o)}k(e+"\nArguments: "+Array.prototype.slice.call(s).join("")+"\n"+(new Error).stack),n=!1}return i.apply(this,arguments)},i)}function O(e,i){null!=t.deprecationHandler&&t.deprecationHandler(e,i),Pn[e]||(k(i),Pn[e]=!0)}function M(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function E(e){var t,i;for(i in e)t=e[i],M(t)?this[i]=t:this["_"+i]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function S(e,t){var i,o=l({},e);for(i in t)h(t,i)&&(n(e[i])&&n(t[i])?(o[i]={},l(o[i],e[i]),l(o[i],t[i])):null!=t[i]?o[i]=t[i]:delete o[i]);for(i in e)h(e,i)&&!h(t,i)&&n(e[i])&&(o[i]=l({},o[i]));return o}function D(e){null!=e&&this.set(e)}function C(e,t,i){var n=this._calendar[e]||this._calendar.sameElse;return M(n)?n.call(t,i):n}function T(e){var t=this._longDateFormat[e],i=this._longDateFormat[e.toUpperCase()];return t||!i?t:(this._longDateFormat[e]=i.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])}function P(){return this._invalidDate}function I(e){return this._ordinal.replace("%d",e)}function F(e,t,i,n){var o=this._relativeTime[i];return M(o)?o(e,t,i,n):o.replace(/%d/i,e)}function N(e,t){var i=this._relativeTime[e>0?"future":"past"];return M(i)?i(t):i.replace(/%s/i,t)}function B(e,t){var i=e.toLowerCase();Rn[i]=Rn[i+"s"]=Rn[t]=e}function z(e){return"string"==typeof e?Rn[e]||Rn[e.toLowerCase()]:void 0}function R(e){var t,i,n={};for(i in e)h(e,i)&&(t=z(i))&&(n[t]=e[i]);return n}function A(e,t){An[e]=t}function j(e){var t=[];for(var i in e)t.push({unit:i,priority:An[i]});return t.sort(function(e,t){return e.priority-t.priority}),t}function L(e,t,i){var n=""+Math.abs(e),o=t-n.length;return(e>=0?i?"+":"":"-")+Math.pow(10,Math.max(0,o)).toString().substr(1)+n}function H(e,t,i,n){var o=n;"string"==typeof n&&(o=function(){return this[n]()}),e&&(Wn[e]=o),t&&(Wn[t[0]]=function(){return L(o.apply(this,arguments),t[1],t[2])}),i&&(Wn[i]=function(){return this.localeData().ordinal(o.apply(this,arguments),e)})}function W(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function Y(e){var t,i,n=e.match(jn);for(t=0,i=n.length;t<i;t++)Wn[n[t]]?n[t]=Wn[n[t]]:n[t]=W(n[t]);return function(t){var o,s="";for(o=0;o<i;o++)s+=M(n[o])?n[o].call(t,e):n[o];return s}}function V(e,t){return e.isValid()?(t=U(t,e.localeData()),Hn[t]=Hn[t]||Y(t),Hn[t](e)):e.localeData().invalidDate()}function U(e,t){function i(e){return t.longDateFormat(e)||e}var n=5;for(Ln.lastIndex=0;n>=0&&Ln.test(e);)e=e.replace(Ln,i),Ln.lastIndex=0,n-=1;return e}function q(e,t,i){ro[e]=M(t)?t:function(e,n){return e&&i?i:t}}function G(e,t){return h(ro,e)?ro[e](t._strict,t._locale):new RegExp(X(e))}function X(e){return K(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,i,n,o){return t||i||n||o}))}function K(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Z(e,t){var i,n=t;for("string"==typeof e&&(e=[e]),r(t)&&(n=function(e,i){i[t]=_(e)}),i=0;i<e.length;i++)ao[e[i]]=n}function $(e,t){Z(e,function(e,i,n,o){n._w=n._w||{},t(e,n._w,n,o)})}function Q(e,t,i){null!=t&&h(ao,e)&&ao[e](t,i._a,i,e)}function J(e){return ee(e)?366:365}function ee(e){return e%4==0&&e%100!=0||e%400==0}function te(){return ee(this.year())}function ie(e,i){return function(n){return null!=n?(oe(this,e,n),t.updateOffset(this,i),this):ne(this,e)}}function ne(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function oe(e,t,i){e.isValid()&&!isNaN(i)&&("FullYear"===t&&ee(e.year())?e._d["set"+(e._isUTC?"UTC":"")+t](i,e.month(),de(i,e.month())):e._d["set"+(e._isUTC?"UTC":"")+t](i))}function se(e){return e=z(e),M(this[e])?this[e]():this}function re(e,t){if("object"==typeof e){e=R(e);for(var i=j(e),n=0;n<i.length;n++)this[i[n].unit](e[i[n].unit])}else if(e=z(e),M(this[e]))return this[e](t);return this}function ae(e,t){return(e%t+t)%t}function de(e,t){if(isNaN(e)||isNaN(t))return NaN;var i=ae(t,12);return e+=(t-i)/12,1===i?ee(e)?29:28:31-i%7%2}function he(e,t){return e?i(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||_o).test(t)?"format":"standalone"][e.month()]:i(this._months)?this._months:this._months.standalone}function le(e,t){return e?i(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[_o.test(t)?"format":"standalone"][e.month()]:i(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function ue(e,t,i){var n,o,s,r=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)s=u([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(s,"").toLocaleLowerCase();return i?"MMM"===t?(o=mo.call(this._shortMonthsParse,r),-1!==o?o:null):(o=mo.call(this._longMonthsParse,r),-1!==o?o:null):"MMM"===t?-1!==(o=mo.call(this._shortMonthsParse,r))?o:(o=mo.call(this._longMonthsParse,r),-1!==o?o:null):-1!==(o=mo.call(this._longMonthsParse,r))?o:(o=mo.call(this._shortMonthsParse,r),-1!==o?o:null)}function ce(e,t,i){var n,o,s;if(this._monthsParseExact)return ue.call(this,e,t,i);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(o=u([2e3,n]),i&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(o,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(o,"").replace(".","")+"$","i")),i||this._monthsParse[n]||(s="^"+this.months(o,"")+"|^"+this.monthsShort(o,""),this._monthsParse[n]=new RegExp(s.replace(".",""),"i")),i&&"MMMM"===t&&this._longMonthsParse[n].test(e))return n;if(i&&"MMM"===t&&this._shortMonthsParse[n].test(e))return n;if(!i&&this._monthsParse[n].test(e))return n}}function fe(e,t){var i;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=_(t);else if(t=e.localeData().monthsParse(t),!r(t))return e;return i=Math.min(e.date(),de(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,i),e}function pe(e){return null!=e?(fe(this,e),t.updateOffset(this,!0),this):ne(this,"Month")}function ve(){return de(this.year(),this.month())}function ge(e){return this._monthsParseExact?(h(this,"_monthsRegex")||me.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(h(this,"_monthsShortRegex")||(this._monthsShortRegex=xo),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function ye(e){return this._monthsParseExact?(h(this,"_monthsRegex")||me.call(this),e?this._monthsStrictRegex:this._monthsRegex):(h(this,"_monthsRegex")||(this._monthsRegex=Oo),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function me(){function e(e,t){return t.length-e.length}var t,i,n=[],o=[],s=[];for(t=0;t<12;t++)i=u([2e3,t]),n.push(this.monthsShort(i,"")),o.push(this.months(i,"")),s.push(this.months(i,"")),s.push(this.monthsShort(i,""));for(n.sort(e),o.sort(e),s.sort(e),t=0;t<12;t++)n[t]=K(n[t]),o[t]=K(o[t]);for(t=0;t<24;t++)s[t]=K(s[t]);this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+n.join("|")+")","i")}function be(e,t,i,n,o,s,r){var a=new Date(e,t,i,n,o,s,r);return e<100&&e>=0&&isFinite(a.getFullYear())&&a.setFullYear(e),a}function _e(e){var t=new Date(Date.UTC.apply(null,arguments));return e<100&&e>=0&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function we(e,t,i){var n=7+t-i;return-(7+_e(e,0,n).getUTCDay()-t)%7+n-1}function ke(e,t,i,n,o){var s,r,a=(7+i-n)%7,d=we(e,n,o),h=1+7*(t-1)+a+d;return h<=0?(s=e-1,r=J(s)+h):h>J(e)?(s=e+1,r=h-J(e)):(s=e,r=h),{year:s,dayOfYear:r}}function xe(e,t,i){var n,o,s=we(e.year(),t,i),r=Math.floor((e.dayOfYear()-s-1)/7)+1;return r<1?(o=e.year()-1,n=r+Oe(o,t,i)):r>Oe(e.year(),t,i)?(n=r-Oe(e.year(),t,i),o=e.year()+1):(o=e.year(),n=r),{week:n,year:o}}function Oe(e,t,i){var n=we(e,t,i),o=we(e+1,t,i);return(J(e)-n+o)/7}function Me(e){return xe(e,this._week.dow,this._week.doy).week}function Ee(){return this._week.dow}function Se(){return this._week.doy}function De(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function Ce(e){var t=xe(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function Te(e,t){return"string"!=typeof e?e:isNaN(e)?(e=t.weekdaysParse(e),"number"==typeof e?e:null):parseInt(e,10)}function Pe(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Ie(e,t){return e?i(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(t)?"format":"standalone"][e.day()]:i(this._weekdays)?this._weekdays:this._weekdays.standalone}function Fe(e){return e?this._weekdaysShort[e.day()]:this._weekdaysShort}function Ne(e){return e?this._weekdaysMin[e.day()]:this._weekdaysMin}function Be(e,t,i){var n,o,s,r=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)s=u([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(s,"").toLocaleLowerCase();return i?"dddd"===t?(o=mo.call(this._weekdaysParse,r),-1!==o?o:null):"ddd"===t?(o=mo.call(this._shortWeekdaysParse,r),-1!==o?o:null):(o=mo.call(this._minWeekdaysParse,r),-1!==o?o:null):"dddd"===t?-1!==(o=mo.call(this._weekdaysParse,r))?o:-1!==(o=mo.call(this._shortWeekdaysParse,r))?o:(o=mo.call(this._minWeekdaysParse,r),-1!==o?o:null):"ddd"===t?-1!==(o=mo.call(this._shortWeekdaysParse,r))?o:-1!==(o=mo.call(this._weekdaysParse,r))?o:(o=mo.call(this._minWeekdaysParse,r),-1!==o?o:null):-1!==(o=mo.call(this._minWeekdaysParse,r))?o:-1!==(o=mo.call(this._weekdaysParse,r))?o:(o=mo.call(this._shortWeekdaysParse,r),-1!==o?o:null)}function ze(e,t,i){var n,o,s;if(this._weekdaysParseExact)return Be.call(this,e,t,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(o=u([2e3,1]).day(n),i&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(o,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(o,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(o,"").replace(".",".?")+"$","i")),this._weekdaysParse[n]||(s="^"+this.weekdays(o,"")+"|^"+this.weekdaysShort(o,"")+"|^"+this.weekdaysMin(o,""),this._weekdaysParse[n]=new RegExp(s.replace(".",""),"i")),i&&"dddd"===t&&this._fullWeekdaysParse[n].test(e))return n;if(i&&"ddd"===t&&this._shortWeekdaysParse[n].test(e))return n;if(i&&"dd"===t&&this._minWeekdaysParse[n].test(e))return n;if(!i&&this._weekdaysParse[n].test(e))return n}}function Re(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=Te(e,this.localeData()),this.add(e-t,"d")):t}function Ae(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function je(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=Pe(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7}function Le(e){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||Ye.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(h(this,"_weekdaysRegex")||(this._weekdaysRegex=Co),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function He(e){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||Ye.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(h(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=To),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function We(e){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||Ye.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(h(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Po),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Ye(){function e(e,t){return t.length-e.length}var t,i,n,o,s,r=[],a=[],d=[],h=[];for(t=0;t<7;t++)i=u([2e3,1]).day(t),n=this.weekdaysMin(i,""),o=this.weekdaysShort(i,""),s=this.weekdays(i,""),r.push(n),a.push(o),d.push(s),h.push(n),h.push(o),h.push(s);for(r.sort(e),a.sort(e),d.sort(e),h.sort(e),t=0;t<7;t++)a[t]=K(a[t]),d[t]=K(d[t]),h[t]=K(h[t]);this._weekdaysRegex=new RegExp("^("+h.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+r.join("|")+")","i")}function Ve(){return this.hours()%12||12}function Ue(){return this.hours()||24}function qe(e,t){H(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function Ge(e,t){return t._meridiemParse}function Xe(e){return"p"===(e+"").toLowerCase().charAt(0)}function Ke(e,t,i){return e>11?i?"pm":"PM":i?"am":"AM"}function Ze(e){return e?e.toLowerCase().replace("_","-"):e}function $e(e){for(var t,i,n,o,s=0;s<e.length;){for(o=Ze(e[s]).split("-"),t=o.length,i=Ze(e[s+1]),i=i?i.split("-"):null;t>0;){if(n=Qe(o.slice(0,t).join("-")))return n;if(i&&i.length>=t&&w(o,i,!0)>=t-1)break;t--}s++}return null}function Qe(t){var i=null;if(!zo[t]&&void 0!==e&&e&&e.exports)try{i=Io._abbr;!function(){var e=new Error('Cannot find module "./locale"');throw e.code="MODULE_NOT_FOUND",e}(),Je(i)}catch(e){}return zo[t]}function Je(e,t){var i;return e&&(i=s(t)?it(e):et(e,t))&&(Io=i),Io._abbr}function et(e,t){if(null!==t){var i=Bo;if(t.abbr=e,null!=zo[e])O("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=zo[e]._config;else if(null!=t.parentLocale){if(null==zo[t.parentLocale])return Ro[t.parentLocale]||(Ro[t.parentLocale]=[]),Ro[t.parentLocale].push({name:e,config:t}),null;i=zo[t.parentLocale]._config}return zo[e]=new D(S(i,t)),Ro[e]&&Ro[e].forEach(function(e){et(e.name,e.config)}),Je(e),zo[e]}return delete zo[e],null}function tt(e,t){if(null!=t){var i,n=Bo;null!=zo[e]&&(n=zo[e]._config),t=S(n,t),i=new D(t),i.parentLocale=zo[e],zo[e]=i,Je(e)}else null!=zo[e]&&(null!=zo[e].parentLocale?zo[e]=zo[e].parentLocale:null!=zo[e]&&delete zo[e]);return zo[e]}function it(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Io;if(!i(e)){if(t=Qe(e))return t;e=[e]}return $e(e)}function nt(){return In(zo)}function ot(e){var t,i=e._a;return i&&-2===f(e).overflow&&(t=i[lo]<0||i[lo]>11?lo:i[uo]<1||i[uo]>de(i[ho],i[lo])?uo:i[co]<0||i[co]>24||24===i[co]&&(0!==i[fo]||0!==i[po]||0!==i[vo])?co:i[fo]<0||i[fo]>59?fo:i[po]<0||i[po]>59?po:i[vo]<0||i[vo]>999?vo:-1,f(e)._overflowDayOfYear&&(t<ho||t>uo)&&(t=uo),f(e)._overflowWeeks&&-1===t&&(t=go),f(e)._overflowWeekday&&-1===t&&(t=yo),f(e).overflow=t),e}function st(e,t,i){return null!=e?e:null!=t?t:i}function rt(e){var i=new Date(t.now());return e._useUTC?[i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()]:[i.getFullYear(),i.getMonth(),i.getDate()]}function at(e){var t,i,n,o,s=[];if(!e._d){for(n=rt(e),e._w&&null==e._a[uo]&&null==e._a[lo]&&dt(e),null!=e._dayOfYear&&(o=st(e._a[ho],n[ho]),(e._dayOfYear>J(o)||0===e._dayOfYear)&&(f(e)._overflowDayOfYear=!0),i=_e(o,0,e._dayOfYear),e._a[lo]=i.getUTCMonth(),e._a[uo]=i.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=s[t]=n[t];for(;t<7;t++)e._a[t]=s[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[co]&&0===e._a[fo]&&0===e._a[po]&&0===e._a[vo]&&(e._nextDay=!0,e._a[co]=0),e._d=(e._useUTC?_e:be).apply(null,s),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[co]=24),e._w&&void 0!==e._w.d&&e._w.d!==e._d.getDay()&&(f(e).weekdayMismatch=!0)}}function dt(e){var t,i,n,o,s,r,a,d;if(t=e._w,null!=t.GG||null!=t.W||null!=t.E)s=1,r=4,i=st(t.GG,e._a[ho],xe(Mt(),1,4).year),n=st(t.W,1),((o=st(t.E,1))<1||o>7)&&(d=!0);else{s=e._locale._week.dow,r=e._locale._week.doy;var h=xe(Mt(),s,r);i=st(t.gg,e._a[ho],h.year),n=st(t.w,h.week),null!=t.d?((o=t.d)<0||o>6)&&(d=!0):null!=t.e?(o=t.e+s,(t.e<0||t.e>6)&&(d=!0)):o=s}n<1||n>Oe(i,s,r)?f(e)._overflowWeeks=!0:null!=d?f(e)._overflowWeekday=!0:(a=ke(i,n,o,s,r),e._a[ho]=a.year,e._dayOfYear=a.dayOfYear)}function ht(e){var t,i,n,o,s,r,a=e._i,d=Ao.exec(a)||jo.exec(a);if(d){for(f(e).iso=!0,t=0,i=Ho.length;t<i;t++)if(Ho[t][1].exec(d[1])){o=Ho[t][0],n=!1!==Ho[t][2];break}if(null==o)return void(e._isValid=!1);if(d[3]){for(t=0,i=Wo.length;t<i;t++)if(Wo[t][1].exec(d[3])){s=(d[2]||" ")+Wo[t][0];break}if(null==s)return void(e._isValid=!1)}if(!n&&null!=s)return void(e._isValid=!1);if(d[4]){if(!Lo.exec(d[4]))return void(e._isValid=!1);r="Z"}e._f=o+(s||"")+(r||""),yt(e)}else e._isValid=!1}function lt(e,t,i,n,o,s){var r=[ut(e),ko.indexOf(t),parseInt(i,10),parseInt(n,10),parseInt(o,10)];return s&&r.push(parseInt(s,10)),r}function ut(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function ct(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}function ft(e,t,i){if(e){if(So.indexOf(e)!==new Date(t[0],t[1],t[2]).getDay())return f(i).weekdayMismatch=!0,i._isValid=!1,!1}return!0}function pt(e,t,i){if(e)return Uo[e];if(t)return 0;var n=parseInt(i,10),o=n%100;return(n-o)/100*60+o}function vt(e){var t=Vo.exec(ct(e._i));if(t){var i=lt(t[4],t[3],t[2],t[5],t[6],t[7]);if(!ft(t[1],i,e))return;e._a=i,e._tzm=pt(t[8],t[9],t[10]),e._d=_e.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),f(e).rfc2822=!0}else e._isValid=!1}function gt(e){var i=Yo.exec(e._i);if(null!==i)return void(e._d=new Date(+i[1]));ht(e),!1===e._isValid&&(delete e._isValid,vt(e),!1===e._isValid&&(delete e._isValid,t.createFromInputFallback(e)))}function yt(e){if(e._f===t.ISO_8601)return void ht(e);if(e._f===t.RFC_2822)return void vt(e);e._a=[],f(e).empty=!0;var i,n,o,s,r,a=""+e._i,d=a.length,h=0;for(o=U(e._f,e._locale).match(jn)||[],i=0;i<o.length;i++)s=o[i],n=(a.match(G(s,e))||[])[0],n&&(r=a.substr(0,a.indexOf(n)),r.length>0&&f(e).unusedInput.push(r),a=a.slice(a.indexOf(n)+n.length),h+=n.length),Wn[s]?(n?f(e).empty=!1:f(e).unusedTokens.push(s),Q(s,n,e)):e._strict&&!n&&f(e).unusedTokens.push(s);f(e).charsLeftOver=d-h,a.length>0&&f(e).unusedInput.push(a),e._a[co]<=12&&!0===f(e).bigHour&&e._a[co]>0&&(f(e).bigHour=void 0),f(e).parsedDateParts=e._a.slice(0),f(e).meridiem=e._meridiem,e._a[co]=mt(e._locale,e._a[co],e._meridiem),at(e),ot(e)}function mt(e,t,i){var n;return null==i?t:null!=e.meridiemHour?e.meridiemHour(t,i):null!=e.isPM?(n=e.isPM(i),n&&t<12&&(t+=12),n||12!==t||(t=0),t):t}function bt(e){var t,i,n,o,s;if(0===e._f.length)return f(e).invalidFormat=!0,void(e._d=new Date(NaN));for(o=0;o<e._f.length;o++)s=0,t=g({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[o],yt(t),p(t)&&(s+=f(t).charsLeftOver,s+=10*f(t).unusedTokens.length,f(t).score=s,(null==n||s<n)&&(n=s,i=t));l(e,i||t)}function _t(e){if(!e._d){var t=R(e._i);e._a=d([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),at(e)}}function wt(e){var t=new y(ot(kt(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function kt(e){var t=e._i,n=e._f;return e._locale=e._locale||it(e._l),null===t||void 0===n&&""===t?v({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),m(t)?new y(ot(t)):(a(t)?e._d=t:i(n)?bt(e):n?yt(e):xt(e),p(e)||(e._d=null),e))}function xt(e){var o=e._i;s(o)?e._d=new Date(t.now()):a(o)?e._d=new Date(o.valueOf()):"string"==typeof o?gt(e):i(o)?(e._a=d(o.slice(0),function(e){return parseInt(e,10)}),at(e)):n(o)?_t(e):r(o)?e._d=new Date(o):t.createFromInputFallback(e)}function Ot(e,t,s,r,a){var d={};return!0!==s&&!1!==s||(r=s,s=void 0),(n(e)&&o(e)||i(e)&&0===e.length)&&(e=void 0),d._isAMomentObject=!0,d._useUTC=d._isUTC=a,d._l=s,d._i=e,d._f=t,d._strict=r,wt(d)}function Mt(e,t,i,n){return Ot(e,t,i,n,!1)}function Et(e,t){var n,o;if(1===t.length&&i(t[0])&&(t=t[0]),!t.length)return Mt();for(n=t[0],o=1;o<t.length;++o)t[o].isValid()&&!t[o][e](n)||(n=t[o]);return n}function St(){return Et("isBefore",[].slice.call(arguments,0))}function Dt(){return Et("isAfter",[].slice.call(arguments,0))}function Ct(e){for(var t in e)if(-1===mo.call(Ko,t)||null!=e[t]&&isNaN(e[t]))return!1;for(var i=!1,n=0;n<Ko.length;++n)if(e[Ko[n]]){if(i)return!1;parseFloat(e[Ko[n]])!==_(e[Ko[n]])&&(i=!0)}return!0}function Tt(){return this._isValid}function Pt(){return Zt(NaN)}function It(e){var t=R(e),i=t.year||0,n=t.quarter||0,o=t.month||0,s=t.week||0,r=t.day||0,a=t.hour||0,d=t.minute||0,h=t.second||0,l=t.millisecond||0;this._isValid=Ct(t),this._milliseconds=+l+1e3*h+6e4*d+1e3*a*60*60,this._days=+r+7*s,this._months=+o+3*n+12*i,this._data={},this._locale=it(),this._bubble()}function Ft(e){return e instanceof It}function Nt(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Bt(e,t){H(e,0,0,function(){var e=this.utcOffset(),i="+";return e<0&&(e=-e,i="-"),i+L(~~(e/60),2)+t+L(~~e%60,2)})}function zt(e,t){var i=(t||"").match(e);if(null===i)return null;var n=i[i.length-1]||[],o=(n+"").match(Zo)||["-",0,0],s=60*o[1]+_(o[2]);return 0===s?0:"+"===o[0]?s:-s}function Rt(e,i){var n,o;return i._isUTC?(n=i.clone(),o=(m(e)||a(e)?e.valueOf():Mt(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+o),t.updateOffset(n,!1),n):Mt(e).local()}function At(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function jt(e,i,n){var o,s=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=zt(no,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&i&&(o=At(this)),this._offset=e,this._isUTC=!0,null!=o&&this.add(o,"m"),s!==e&&(!i||this._changeInProgress?ti(this,Zt(e-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,t.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?s:At(this)}function Lt(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function Ht(e){return this.utcOffset(0,e)}function Wt(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(At(this),"m")),this}function Yt(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=zt(io,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this}function Vt(e){return!!this.isValid()&&(e=e?Mt(e).utcOffset():0,(this.utcOffset()-e)%60==0)}function Ut(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function qt(){if(!s(this._isDSTShifted))return this._isDSTShifted;var e={};if(g(e,this),e=kt(e),e._a){var t=e._isUTC?u(e._a):Mt(e._a);this._isDSTShifted=this.isValid()&&w(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Gt(){return!!this.isValid()&&!this._isUTC}function Xt(){return!!this.isValid()&&this._isUTC}function Kt(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function Zt(e,t){var i,n,o,s=e,a=null;return Ft(e)?s={ms:e._milliseconds,d:e._days,M:e._months}:r(e)?(s={},t?s[t]=e:s.milliseconds=e):(a=$o.exec(e))?(i="-"===a[1]?-1:1,s={y:0,d:_(a[uo])*i,h:_(a[co])*i,m:_(a[fo])*i,s:_(a[po])*i,ms:_(Nt(1e3*a[vo]))*i}):(a=Qo.exec(e))?(i="-"===a[1]?-1:(a[1],1),s={y:$t(a[2],i),M:$t(a[3],i),w:$t(a[4],i),d:$t(a[5],i),h:$t(a[6],i),m:$t(a[7],i),s:$t(a[8],i)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(o=Jt(Mt(s.from),Mt(s.to)),s={},s.ms=o.milliseconds,s.M=o.months),n=new It(s),Ft(e)&&h(e,"_locale")&&(n._locale=e._locale),n}function $t(e,t){var i=e&&parseFloat(e.replace(",","."));return(isNaN(i)?0:i)*t}function Qt(e,t){var i={milliseconds:0,months:0};return i.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(i.months,"M").isAfter(t)&&--i.months,i.milliseconds=+t-+e.clone().add(i.months,"M"),i}function Jt(e,t){var i;return e.isValid()&&t.isValid()?(t=Rt(t,e),e.isBefore(t)?i=Qt(e,t):(i=Qt(t,e),i.milliseconds=-i.milliseconds,i.months=-i.months),i):{milliseconds:0,months:0}}function ei(e,t){return function(i,n){var o,s;return null===n||isNaN(+n)||(O(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),s=i,i=n,n=s),i="string"==typeof i?+i:i,o=Zt(i,n),ti(this,o,e),this}}function ti(e,i,n,o){var s=i._milliseconds,r=Nt(i._days),a=Nt(i._months);e.isValid()&&(o=null==o||o,a&&fe(e,ne(e,"Month")+a*n),r&&oe(e,"Date",ne(e,"Date")+r*n),s&&e._d.setTime(e._d.valueOf()+s*n),o&&t.updateOffset(e,r||a))}function ii(e,t){var i=e.diff(t,"days",!0);return i<-6?"sameElse":i<-1?"lastWeek":i<0?"lastDay":i<1?"sameDay":i<2?"nextDay":i<7?"nextWeek":"sameElse"}function ni(e,i){var n=e||Mt(),o=Rt(n,this).startOf("day"),s=t.calendarFormat(this,o)||"sameElse",r=i&&(M(i[s])?i[s].call(this,n):i[s]);return this.format(r||this.localeData().calendar(s,this,Mt(n)))}function oi(){return new y(this)}function si(e,t){var i=m(e)?e:Mt(e);return!(!this.isValid()||!i.isValid())&&(t=z(s(t)?"millisecond":t),"millisecond"===t?this.valueOf()>i.valueOf():i.valueOf()<this.clone().startOf(t).valueOf())}function ri(e,t){var i=m(e)?e:Mt(e);return!(!this.isValid()||!i.isValid())&&(t=z(s(t)?"millisecond":t),"millisecond"===t?this.valueOf()<i.valueOf():this.clone().endOf(t).valueOf()<i.valueOf())}function ai(e,t,i,n){return n=n||"()",("("===n[0]?this.isAfter(e,i):!this.isBefore(e,i))&&(")"===n[1]?this.isBefore(t,i):!this.isAfter(t,i))}function di(e,t){var i,n=m(e)?e:Mt(e);return!(!this.isValid()||!n.isValid())&&(t=z(t||"millisecond"),"millisecond"===t?this.valueOf()===n.valueOf():(i=n.valueOf(),this.clone().startOf(t).valueOf()<=i&&i<=this.clone().endOf(t).valueOf()))}function hi(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function li(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function ui(e,t,i){var n,o,s;if(!this.isValid())return NaN;if(n=Rt(e,this),!n.isValid())return NaN;switch(o=6e4*(n.utcOffset()-this.utcOffset()),t=z(t)){case"year":s=ci(this,n)/12;break;case"month":s=ci(this,n);break;case"quarter":s=ci(this,n)/3;break;case"second":s=(this-n)/1e3;break;case"minute":s=(this-n)/6e4;break;case"hour":s=(this-n)/36e5;break;case"day":s=(this-n-o)/864e5;break;case"week":s=(this-n-o)/6048e5;break;default:s=this-n}return i?s:b(s)}function ci(e,t){var i,n,o=12*(t.year()-e.year())+(t.month()-e.month()),s=e.clone().add(o,"months");return t-s<0?(i=e.clone().add(o-1,"months"),n=(t-s)/(s-i)):(i=e.clone().add(o+1,"months"),n=(t-s)/(i-s)),-(o+n)||0}function fi(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function pi(){if(!this.isValid())return null;var e=this.clone().utc();return e.year()<0||e.year()>9999?V(e,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):M(Date.prototype.toISOString)?this.toDate().toISOString():V(e,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function vi(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");var i="["+e+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",o=t+'[")]';return this.format(i+n+"-MM-DD[T]HH:mm:ss.SSS"+o)}function gi(e){e||(e=this.isUtc()?t.defaultFormatUtc:t.defaultFormat);var i=V(this,e);return this.localeData().postformat(i)}function yi(e,t){return this.isValid()&&(m(e)&&e.isValid()||Mt(e).isValid())?Zt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function mi(e){return this.from(Mt(),e)}function bi(e,t){return this.isValid()&&(m(e)&&e.isValid()||Mt(e).isValid())?Zt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function _i(e){return this.to(Mt(),e)}function wi(e){var t;return void 0===e?this._locale._abbr:(t=it(e),null!=t&&(this._locale=t),this)}function ki(){return this._locale}function xi(e){switch(e=z(e)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===e&&this.weekday(0),"isoWeek"===e&&this.isoWeekday(1),"quarter"===e&&this.month(3*Math.floor(this.month()/3)),this}function Oi(e){return void 0===(e=z(e))||"millisecond"===e?this:("date"===e&&(e="day"),this.startOf(e).add(1,"isoWeek"===e?"week":e).subtract(1,"ms"))}function Mi(){return this._d.valueOf()-6e4*(this._offset||0)}function Ei(){return Math.floor(this.valueOf()/1e3)}function Si(){return new Date(this.valueOf())}function Di(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function Ci(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function Ti(){return this.isValid()?this.toISOString():null}function Pi(){return p(this)}function Ii(){return l({},f(this))}function Fi(){return f(this).overflow}function Ni(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Bi(e,t){H(0,[e,e.length],0,t)}function zi(e){return Li.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Ri(e){return Li.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function Ai(){return Oe(this.year(),1,4)}function ji(){var e=this.localeData()._week;return Oe(this.year(),e.dow,e.doy)}function Li(e,t,i,n,o){var s;return null==e?xe(this,n,o).year:(s=Oe(e,n,o),t>s&&(t=s),Hi.call(this,e,t,i,n,o))}function Hi(e,t,i,n,o){var s=ke(e,t,i,n,o),r=_e(s.year,0,s.dayOfYear);return this.year(r.getUTCFullYear()),this.month(r.getUTCMonth()),this.date(r.getUTCDate()),this}function Wi(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}function Yi(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}function Vi(e,t){t[vo]=_(1e3*("0."+e))}function Ui(){return this._isUTC?"UTC":""}function qi(){return this._isUTC?"Coordinated Universal Time":""}function Gi(e){return Mt(1e3*e)}function Xi(){return Mt.apply(null,arguments).parseZone()}function Ki(e){return e}function Zi(e,t,i,n){var o=it(),s=u().set(n,t);return o[i](s,e)}function $i(e,t,i){if(r(e)&&(t=e,e=void 0),e=e||"",null!=t)return Zi(e,t,i,"month");var n,o=[];for(n=0;n<12;n++)o[n]=Zi(e,n,i,"month");return o}function Qi(e,t,i,n){"boolean"==typeof e?(r(t)&&(i=t,t=void 0),t=t||""):(t=e,i=t,e=!1,r(t)&&(i=t,t=void 0),t=t||"");var o=it(),s=e?o._week.dow:0;if(null!=i)return Zi(t,(i+s)%7,n,"day");var a,d=[];for(a=0;a<7;a++)d[a]=Zi(t,(a+s)%7,n,"day");return d}function Ji(e,t){return $i(e,t,"months")}function en(e,t){return $i(e,t,"monthsShort")}function tn(e,t,i){return Qi(e,t,i,"weekdays")}function nn(e,t,i){return Qi(e,t,i,"weekdaysShort")}function on(e,t,i){return Qi(e,t,i,"weekdaysMin")}function sn(){var e=this._data;return this._milliseconds=hs(this._milliseconds),this._days=hs(this._days),this._months=hs(this._months),e.milliseconds=hs(e.milliseconds),e.seconds=hs(e.seconds),e.minutes=hs(e.minutes),e.hours=hs(e.hours),e.months=hs(e.months),e.years=hs(e.years),this}function rn(e,t,i,n){var o=Zt(t,i);return e._milliseconds+=n*o._milliseconds,e._days+=n*o._days,e._months+=n*o._months,e._bubble()}function an(e,t){return rn(this,e,t,1)}function dn(e,t){return rn(this,e,t,-1)}function hn(e){return e<0?Math.floor(e):Math.ceil(e)}function ln(){var e,t,i,n,o,s=this._milliseconds,r=this._days,a=this._months,d=this._data;return s>=0&&r>=0&&a>=0||s<=0&&r<=0&&a<=0||(s+=864e5*hn(cn(a)+r),r=0,a=0),d.milliseconds=s%1e3,e=b(s/1e3),d.seconds=e%60,t=b(e/60),d.minutes=t%60,i=b(t/60),d.hours=i%24,r+=b(i/24),o=b(un(r)),a+=o,r-=hn(cn(o)),n=b(a/12),a%=12,d.days=r,d.months=a,d.years=n,this}function un(e){return 4800*e/146097}function cn(e){return 146097*e/4800}function fn(e){if(!this.isValid())return NaN;var t,i,n=this._milliseconds;if("month"===(e=z(e))||"year"===e)return t=this._days+n/864e5,i=this._months+un(t),"month"===e?i:i/12;switch(t=this._days+Math.round(cn(this._months)),e){case"week":return t/7+n/6048e5;case"day":return t+n/864e5;case"hour":return 24*t+n/36e5;case"minute":return 1440*t+n/6e4;case"second":return 86400*t+n/1e3;case"millisecond":return Math.floor(864e5*t)+n;default:throw new Error("Unknown unit "+e)}}function pn(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*_(this._months/12):NaN}function vn(e){return function(){return this.as(e)}}function gn(){return Zt(this)}function yn(e){return e=z(e),this.isValid()?this[e+"s"]():NaN}function mn(e){return function(){return this.isValid()?this._data[e]:NaN}}function bn(){return b(this.days()/7)}function _n(e,t,i,n,o){return o.relativeTime(t||1,!!i,e,n)}function wn(e,t,i){var n=Zt(e).abs(),o=Ms(n.as("s")),s=Ms(n.as("m")),r=Ms(n.as("h")),a=Ms(n.as("d")),d=Ms(n.as("M")),h=Ms(n.as("y")),l=o<=Es.ss&&["s",o]||o<Es.s&&["ss",o]||s<=1&&["m"]||s<Es.m&&["mm",s]||r<=1&&["h"]||r<Es.h&&["hh",r]||a<=1&&["d"]||a<Es.d&&["dd",a]||d<=1&&["M"]||d<Es.M&&["MM",d]||h<=1&&["y"]||["yy",h];return l[2]=t,l[3]=+e>0,l[4]=i,_n.apply(null,l)}function kn(e){return void 0===e?Ms:"function"==typeof e&&(Ms=e,!0)}function xn(e,t){return void 0!==Es[e]&&(void 0===t?Es[e]:(Es[e]=t,"s"===e&&(Es.ss=t-1),!0))}function On(e){if(!this.isValid())return this.localeData().invalidDate();var t=this.localeData(),i=wn(this,!e,t);return e&&(i=t.pastFuture(+this,i)),t.postformat(i)}function Mn(e){return(e>0)-(e<0)||+e}function En(){if(!this.isValid())return this.localeData().invalidDate();var e,t,i,n=Ss(this._milliseconds)/1e3,o=Ss(this._days),s=Ss(this._months);e=b(n/60),t=b(e/60),n%=60,e%=60,i=b(s/12),s%=12;var r=i,a=s,d=o,h=t,l=e,u=n?n.toFixed(3).replace(/\.?0+$/,""):"",c=this.asSeconds();if(!c)return"P0D";var f=c<0?"-":"",p=Mn(this._months)!==Mn(c)?"-":"",v=Mn(this._days)!==Mn(c)?"-":"",g=Mn(this._milliseconds)!==Mn(c)?"-":"";return f+"P"+(r?p+r+"Y":"")+(a?p+a+"M":"")+(d?v+d+"D":"")+(h||l||u?"T":"")+(h?g+h+"H":"")+(l?g+l+"M":"")+(u?g+u+"S":"")}var Sn,Dn;Dn=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),i=t.length>>>0,n=0;n<i;n++)if(n in t&&e.call(this,t[n],n,t))return!0;return!1};var Cn=t.momentProperties=[],Tn=!1,Pn={};t.suppressDeprecationWarnings=!1,t.deprecationHandler=null;var In;In=Object.keys?Object.keys:function(e){var t,i=[];for(t in e)h(e,t)&&i.push(t);return i};var Fn={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Nn={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},Bn=/\d{1,2}/,zn={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Rn={},An={},jn=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Ln=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Hn={},Wn={},Yn=/\d/,Vn=/\d\d/,Un=/\d{3}/,qn=/\d{4}/,Gn=/[+-]?\d{6}/,Xn=/\d\d?/,Kn=/\d\d\d\d?/,Zn=/\d\d\d\d\d\d?/,$n=/\d{1,3}/,Qn=/\d{1,4}/,Jn=/[+-]?\d{1,6}/,eo=/\d+/,to=/[+-]?\d+/,io=/Z|[+-]\d\d:?\d\d/gi,no=/Z|[+-]\d\d(?::?\d\d)?/gi,oo=/[+-]?\d+(\.\d{1,3})?/,so=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,ro={},ao={},ho=0,lo=1,uo=2,co=3,fo=4,po=5,vo=6,go=7,yo=8;H("Y",0,0,function(){var e=this.year();return e<=9999?""+e:"+"+e}),H(0,["YY",2],0,function(){return this.year()%100}),H(0,["YYYY",4],0,"year"),H(0,["YYYYY",5],0,"year"),H(0,["YYYYYY",6,!0],0,"year"),B("year","y"),A("year",1),q("Y",to),q("YY",Xn,Vn),q("YYYY",Qn,qn),q("YYYYY",Jn,Gn),q("YYYYYY",Jn,Gn),Z(["YYYYY","YYYYYY"],ho),Z("YYYY",function(e,i){i[ho]=2===e.length?t.parseTwoDigitYear(e):_(e)}),Z("YY",function(e,i){i[ho]=t.parseTwoDigitYear(e)}),Z("Y",function(e,t){t[ho]=parseInt(e,10)}),t.parseTwoDigitYear=function(e){return _(e)+(_(e)>68?1900:2e3)};var mo,bo=ie("FullYear",!0);mo=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},H("M",["MM",2],"Mo",function(){return this.month()+1}),H("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),H("MMMM",0,0,function(e){return this.localeData().months(this,e)}),B("month","M"),A("month",8),q("M",Xn),q("MM",Xn,Vn),q("MMM",function(e,t){return t.monthsShortRegex(e)}),q("MMMM",function(e,t){return t.monthsRegex(e)}),Z(["M","MM"],function(e,t){t[lo]=_(e)-1}),Z(["MMM","MMMM"],function(e,t,i,n){var o=i._locale.monthsParse(e,n,i._strict);null!=o?t[lo]=o:f(i).invalidMonth=e});var _o=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,wo="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ko="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),xo=so,Oo=so;H("w",["ww",2],"wo","week"),H("W",["WW",2],"Wo","isoWeek"),B("week","w"),B("isoWeek","W"),A("week",5),A("isoWeek",5),q("w",Xn),q("ww",Xn,Vn),q("W",Xn),q("WW",Xn,Vn),$(["w","ww","W","WW"],function(e,t,i,n){t[n.substr(0,1)]=_(e)});var Mo={dow:0,doy:6};H("d",0,"do","day"),H("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),H("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),H("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),H("e",0,0,"weekday"),H("E",0,0,"isoWeekday"),B("day","d"),B("weekday","e"),B("isoWeekday","E"),A("day",11),A("weekday",11),A("isoWeekday",11),q("d",Xn),q("e",Xn),q("E",Xn),q("dd",function(e,t){return t.weekdaysMinRegex(e)}),q("ddd",function(e,t){return t.weekdaysShortRegex(e)}),q("dddd",function(e,t){return t.weekdaysRegex(e)}),$(["dd","ddd","dddd"],function(e,t,i,n){var o=i._locale.weekdaysParse(e,n,i._strict);null!=o?t.d=o:f(i).invalidWeekday=e}),$(["d","e","E"],function(e,t,i,n){t[n]=_(e)});var Eo="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),So="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Do="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Co=so,To=so,Po=so;H("H",["HH",2],0,"hour"),H("h",["hh",2],0,Ve),H("k",["kk",2],0,Ue),H("hmm",0,0,function(){return""+Ve.apply(this)+L(this.minutes(),2)}),H("hmmss",0,0,function(){return""+Ve.apply(this)+L(this.minutes(),2)+L(this.seconds(),2)}),H("Hmm",0,0,function(){return""+this.hours()+L(this.minutes(),2)}),H("Hmmss",0,0,function(){return""+this.hours()+L(this.minutes(),2)+L(this.seconds(),2)}),qe("a",!0),qe("A",!1),B("hour","h"),A("hour",13),q("a",Ge),q("A",Ge),q("H",Xn),q("h",Xn),q("k",Xn),q("HH",Xn,Vn),q("hh",Xn,Vn),q("kk",Xn,Vn),q("hmm",Kn),q("hmmss",Zn),q("Hmm",Kn),q("Hmmss",Zn),Z(["H","HH"],co),Z(["k","kk"],function(e,t,i){var n=_(e);t[co]=24===n?0:n}),Z(["a","A"],function(e,t,i){i._isPm=i._locale.isPM(e),i._meridiem=e}),Z(["h","hh"],function(e,t,i){t[co]=_(e),f(i).bigHour=!0}),Z("hmm",function(e,t,i){var n=e.length-2;t[co]=_(e.substr(0,n)),t[fo]=_(e.substr(n)),f(i).bigHour=!0}),Z("hmmss",function(e,t,i){var n=e.length-4,o=e.length-2;t[co]=_(e.substr(0,n)),t[fo]=_(e.substr(n,2)),t[po]=_(e.substr(o)),f(i).bigHour=!0}),Z("Hmm",function(e,t,i){var n=e.length-2;t[co]=_(e.substr(0,n)),t[fo]=_(e.substr(n))}),Z("Hmmss",function(e,t,i){var n=e.length-4,o=e.length-2;t[co]=_(e.substr(0,n)),t[fo]=_(e.substr(n,2)),t[po]=_(e.substr(o))});var Io,Fo=/[ap]\.?m?\.?/i,No=ie("Hours",!0),Bo={calendar:Fn,longDateFormat:Nn,invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:Bn,relativeTime:zn,months:wo,monthsShort:ko,week:Mo,weekdays:Eo,weekdaysMin:Do,weekdaysShort:So,meridiemParse:Fo},zo={},Ro={},Ao=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,jo=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Lo=/Z|[+-]\d\d(?::?\d\d)?/,Ho=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Wo=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Yo=/^\/?Date\((\-?\d+)/i,Vo=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Uo={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};t.createFromInputFallback=x("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),t.ISO_8601=function(){},t.RFC_2822=function(){};var qo=x("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Mt.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:v()}),Go=x("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Mt.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:v()}),Xo=function(){return Date.now?Date.now():+new Date},Ko=["year","quarter","month","week","day","hour","minute","second","millisecond"];Bt("Z",":"),Bt("ZZ",""),q("Z",no),q("ZZ",no),Z(["Z","ZZ"],function(e,t,i){i._useUTC=!0,i._tzm=zt(no,e)});var Zo=/([\+\-]|\d\d)/gi;t.updateOffset=function(){};var $o=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Qo=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;Zt.fn=It.prototype,Zt.invalid=Pt;var Jo=ei(1,"add"),es=ei(-1,"subtract");t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",t.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var ts=x("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});H(0,["gg",2],0,function(){return this.weekYear()%100}),H(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Bi("gggg","weekYear"),Bi("ggggg","weekYear"),Bi("GGGG","isoWeekYear"),Bi("GGGGG","isoWeekYear"),B("weekYear","gg"),B("isoWeekYear","GG"),A("weekYear",1),A("isoWeekYear",1),q("G",to),q("g",to),q("GG",Xn,Vn),q("gg",Xn,Vn),q("GGGG",Qn,qn),q("gggg",Qn,qn),q("GGGGG",Jn,Gn),q("ggggg",Jn,Gn),$(["gggg","ggggg","GGGG","GGGGG"],function(e,t,i,n){t[n.substr(0,2)]=_(e)}),$(["gg","GG"],function(e,i,n,o){i[o]=t.parseTwoDigitYear(e)}),H("Q",0,"Qo","quarter"),B("quarter","Q"),A("quarter",7),q("Q",Yn),Z("Q",function(e,t){t[lo]=3*(_(e)-1)}),H("D",["DD",2],"Do","date"),B("date","D"),A("date",9),q("D",Xn),q("DD",Xn,Vn),q("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),Z(["D","DD"],uo),Z("Do",function(e,t){t[uo]=_(e.match(Xn)[0],10)});var is=ie("Date",!0);H("DDD",["DDDD",3],"DDDo","dayOfYear"),B("dayOfYear","DDD"),A("dayOfYear",4),q("DDD",$n),q("DDDD",Un),Z(["DDD","DDDD"],function(e,t,i){i._dayOfYear=_(e)}),H("m",["mm",2],0,"minute"),B("minute","m"),A("minute",14),q("m",Xn),q("mm",Xn,Vn),Z(["m","mm"],fo);var ns=ie("Minutes",!1);H("s",["ss",2],0,"second"),B("second","s"),A("second",15),q("s",Xn),q("ss",Xn,Vn),Z(["s","ss"],po);var os=ie("Seconds",!1);H("S",0,0,function(){return~~(this.millisecond()/100)}),H(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),H(0,["SSS",3],0,"millisecond"),H(0,["SSSS",4],0,function(){return 10*this.millisecond()}),H(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),H(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),H(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),H(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),H(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),B("millisecond","ms"),A("millisecond",16),q("S",$n,Yn),q("SS",$n,Vn),q("SSS",$n,Un);var ss;for(ss="SSSS";ss.length<=9;ss+="S")q(ss,eo);for(ss="S";ss.length<=9;ss+="S")Z(ss,Vi);var rs=ie("Milliseconds",!1);H("z",0,0,"zoneAbbr"),H("zz",0,0,"zoneName");var as=y.prototype;as.add=Jo,as.calendar=ni,as.clone=oi,as.diff=ui,as.endOf=Oi,as.format=gi,as.from=yi,as.fromNow=mi,as.to=bi,as.toNow=_i,as.get=se,as.invalidAt=Fi,as.isAfter=si,as.isBefore=ri,as.isBetween=ai,as.isSame=di,as.isSameOrAfter=hi,as.isSameOrBefore=li,as.isValid=Pi,as.lang=ts,as.locale=wi,as.localeData=ki,as.max=Go,as.min=qo,as.parsingFlags=Ii,as.set=re,as.startOf=xi,as.subtract=es,as.toArray=Di,as.toObject=Ci,as.toDate=Si,as.toISOString=pi,as.inspect=vi,as.toJSON=Ti,as.toString=fi,as.unix=Ei,as.valueOf=Mi,as.creationData=Ni,as.year=bo,as.isLeapYear=te,as.weekYear=zi,as.isoWeekYear=Ri,as.quarter=as.quarters=Wi,as.month=pe,as.daysInMonth=ve,as.week=as.weeks=De,as.isoWeek=as.isoWeeks=Ce,as.weeksInYear=ji,as.isoWeeksInYear=Ai,as.date=is,as.day=as.days=Re,as.weekday=Ae,as.isoWeekday=je,as.dayOfYear=Yi,as.hour=as.hours=No,as.minute=as.minutes=ns,as.second=as.seconds=os,as.millisecond=as.milliseconds=rs,as.utcOffset=jt,as.utc=Ht,as.local=Wt,as.parseZone=Yt,as.hasAlignedHourOffset=Vt,as.isDST=Ut,as.isLocal=Gt,as.isUtcOffset=Xt,as.isUtc=Kt,as.isUTC=Kt,as.zoneAbbr=Ui,as.zoneName=qi,as.dates=x("dates accessor is deprecated. Use date instead.",is),as.months=x("months accessor is deprecated. Use month instead",pe),as.years=x("years accessor is deprecated. Use year instead",bo),as.zone=x("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Lt),as.isDSTShifted=x("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",qt);var ds=D.prototype;ds.calendar=C,ds.longDateFormat=T,ds.invalidDate=P,ds.ordinal=I,ds.preparse=Ki,ds.postformat=Ki,ds.relativeTime=F,ds.pastFuture=N,ds.set=E,ds.months=he,ds.monthsShort=le,ds.monthsParse=ce,ds.monthsRegex=ye,ds.monthsShortRegex=ge,ds.week=Me,ds.firstDayOfYear=Se,ds.firstDayOfWeek=Ee,ds.weekdays=Ie,ds.weekdaysMin=Ne,ds.weekdaysShort=Fe,ds.weekdaysParse=ze,ds.weekdaysRegex=Le,ds.weekdaysShortRegex=He,ds.weekdaysMinRegex=We,ds.isPM=Xe,ds.meridiem=Ke,Je("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===_(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),t.lang=x("moment.lang is deprecated. Use moment.locale instead.",Je),t.langData=x("moment.langData is deprecated. Use moment.localeData instead.",it);var hs=Math.abs,ls=vn("ms"),us=vn("s"),cs=vn("m"),fs=vn("h"),ps=vn("d"),vs=vn("w"),gs=vn("M"),ys=vn("y"),ms=mn("milliseconds"),bs=mn("seconds"),_s=mn("minutes"),ws=mn("hours"),ks=mn("days"),xs=mn("months"),Os=mn("years"),Ms=Math.round,Es={ss:44,s:45,m:45,h:22,d:26,M:11},Ss=Math.abs,Ds=It.prototype;return Ds.isValid=Tt,Ds.abs=sn,Ds.add=an,Ds.subtract=dn,Ds.as=fn,Ds.asMilliseconds=ls,Ds.asSeconds=us,Ds.asMinutes=cs,Ds.asHours=fs,Ds.asDays=ps,Ds.asWeeks=vs,Ds.asMonths=gs,Ds.asYears=ys,Ds.valueOf=pn,Ds._bubble=ln,Ds.clone=gn,Ds.get=yn,Ds.milliseconds=ms,Ds.seconds=bs,Ds.minutes=_s,Ds.hours=ws,Ds.days=ks,Ds.weeks=bn,Ds.months=xs,Ds.years=Os,Ds.humanize=On,Ds.toISOString=En,Ds.toString=En,Ds.toJSON=En,Ds.locale=wi,Ds.localeData=ki,Ds.toIsoString=x("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",En),Ds.lang=ts,H("X",0,0,"unix"),H("x",0,0,"valueOf"),q("x",to),q("X",oo),Z("X",function(e,t,i){i._d=new Date(1e3*parseFloat(e,10))}),Z("x",function(e,t,i){i._d=new Date(_(e))}),t.version="2.19.1",function(e){Sn=e}(Mt),t.fn=as,t.min=St,t.max=Dt,t.now=Xo,t.utc=u,t.unix=Gi,t.months=Ji,t.isDate=a,t.locale=Je,t.invalid=v,t.duration=Zt,t.isMoment=m,t.weekdays=tn,t.parseZone=Xi,t.localeData=it,t.isDuration=Ft,t.monthsShort=en,t.weekdaysMin=on,t.defineLocale=et,t.updateLocale=tt,t.locales=nt,t.weekdaysShort=nn,t.normalizeUnits=z,t.relativeTimeRounding=kn,t.relativeTimeThreshold=xn,t.calendarFormat=ii,t.prototype=as,t})}).call(t,i(115)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){function i(e){throw new Error("Cannot find module '"+e+"'.")}i.keys=function(){return[]},i.resolve=i,e.exports=i,i.id=116},function(e,t,i){(function(t){function i(e,t,i){var n=t&&i||0,o=0;for(t=t||[],e.toLowerCase().replace(/[0-9a-f]{2}/g,function(e){o<16&&(t[n+o++]=u[e])});o<16;)t[n+o++]=0;return t}function n(e,t){var i=t||0,n=l;return n[e[i++]]+n[e[i++]]+n[e[i++]]+n[e[i++]]+"-"+n[e[i++]]+n[e[i++]]+"-"+n[e[i++]]+n[e[i++]]+"-"+n[e[i++]]+n[e[i++]]+"-"+n[e[i++]]+n[e[i++]]+n[e[i++]]+n[e[i++]]+n[e[i++]]+n[e[i++]]}function o(e,t,i){var o=t&&i||0,s=t||[];e=e||{};var r=void 0!==e.clockseq?e.clockseq:v,a=void 0!==e.msecs?e.msecs:(new Date).getTime(),d=void 0!==e.nsecs?e.nsecs:y+1,h=a-g+(d-y)/1e4;if(h<0&&void 0===e.clockseq&&(r=r+1&16383),(h<0||a>g)&&void 0===e.nsecs&&(d=0),d>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");g=a,y=d,v=r,a+=122192928e5;var l=(1e4*(268435455&a)+d)%4294967296;s[o++]=l>>>24&255,s[o++]=l>>>16&255,s[o++]=l>>>8&255,s[o++]=255&l;var u=a/4294967296*1e4&268435455;s[o++]=u>>>8&255,s[o++]=255&u,s[o++]=u>>>24&15|16,s[o++]=u>>>16&255,s[o++]=r>>>8|128,s[o++]=255&r;for(var c=e.node||p,f=0;f<6;f++)s[o+f]=c[f];return t||n(s)}function s(e,t,i){var o=t&&i||0;"string"==typeof e&&(t="binary"==e?new Array(16):null,e=null),e=e||{};var s=e.random||(e.rng||r)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t)for(var a=0;a<16;a++)t[o+a]=s[a];return t||n(s)}var r,a="undefined"!=typeof window?window:void 0!==t?t:null;if(a&&a.crypto&&crypto.getRandomValues){var d=new Uint8Array(16);r=function(){return crypto.getRandomValues(d),d}}if(!r){var h=new Array(16);r=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),h[t]=e>>>((3&t)<<3)&255;return h}}for(var l=[],u={},c=0;c<256;c++)l[c]=(c+256).toString(16).substr(1),u[l[c]]=c;var f=r(),p=[1|f[0],f[1],f[2],f[3],f[4],f[5]],v=16383&(f[6]<<8|f[7]),g=0,y=0,m=s;m.v1=o,m.v4=s,m.parse=i,m.unparse=n,e.exports=m}).call(t,i(118))},function(e,t){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(i=window)}e.exports=i},function(e,t,i){t.prepareElements=function(e){for(var t in e)e.hasOwnProperty(t)&&(e[t].redundant=e[t].used,e[t].used=[])},t.cleanupElements=function(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t].redundant){for(var i=0;i<e[t].redundant.length;i++)e[t].redundant[i].parentNode.removeChild(e[t].redundant[i]);e[t].redundant=[]}},t.resetElements=function(e){t.prepareElements(e),t.cleanupElements(e),t.prepareElements(e)},t.getSVGElement=function(e,t,i){var n;return t.hasOwnProperty(e)?t[e].redundant.length>0?(n=t[e].redundant[0],t[e].redundant.shift()):(n=document.createElementNS("http://www.w3.org/2000/svg",e),i.appendChild(n)):(n=document.createElementNS("http://www.w3.org/2000/svg",e),t[e]={used:[],redundant:[]},i.appendChild(n)),t[e].used.push(n),n},t.getDOMElement=function(e,t,i,n){var o;return t.hasOwnProperty(e)?t[e].redundant.length>0?(o=t[e].redundant[0],t[e].redundant.shift()):(o=document.createElement(e),void 0!==n?i.insertBefore(o,n):i.appendChild(o)):(o=document.createElement(e),t[e]={used:[],redundant:[]},void 0!==n?i.insertBefore(o,n):i.appendChild(o)),t[e].used.push(o),o},t.drawPoint=function(e,i,n,o,s,r){var a;if("circle"==n.style?(a=t.getSVGElement("circle",o,s),a.setAttributeNS(null,"cx",e),a.setAttributeNS(null,"cy",i),a.setAttributeNS(null,"r",.5*n.size)):(a=t.getSVGElement("rect",o,s),a.setAttributeNS(null,"x",e-.5*n.size),a.setAttributeNS(null,"y",i-.5*n.size),a.setAttributeNS(null,"width",n.size),a.setAttributeNS(null,"height",n.size)),void 0!==n.styles&&a.setAttributeNS(null,"style",n.styles),a.setAttributeNS(null,"class",n.className+" vis-point"),r){var d=t.getSVGElement("text",o,s);r.xOffset&&(e+=r.xOffset),r.yOffset&&(i+=r.yOffset),r.content&&(d.textContent=r.content),r.className&&d.setAttributeNS(null,"class",r.className+" vis-label"),d.setAttributeNS(null,"x",e),d.setAttributeNS(null,"y",i)}return a},t.drawBar=function(e,i,n,o,s,r,a,d){if(0!=o){o<0&&(o*=-1,i-=o);var h=t.getSVGElement("rect",r,a);h.setAttributeNS(null,"x",e-.5*n),h.setAttributeNS(null,"y",i),h.setAttributeNS(null,"width",n),h.setAttributeNS(null,"height",o),h.setAttributeNS(null,"class",s),d&&h.setAttributeNS(null,"style",d)}}},function(e,t,i){var n=i(6),o=n.JSON||(n.JSON={stringify:JSON.stringify});e.exports=function(e){return o.stringify.apply(o,arguments)}},function(e,t,i){function n(e,t,i){var o=this;if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this.options={},this.defaultOptions={locale:"en",locales:h,clickToUse:!1},s.extend(this.options,this.defaultOptions),this.body={container:e,nodes:{},nodeIndices:[],edges:{},edgeIndices:[],emitter:{on:this.on.bind(this),off:this.off.bind(this),emit:this.emit.bind(this),once:this.once.bind(this)},eventListeners:{onTap:function(){},onTouch:function(){},onDoubleTap:function(){},onHold:function(){},onDragStart:function(){},onDrag:function(){},onDragEnd:function(){},onMouseWheel:function(){},onPinch:function(){},onMouseMove:function(){},onRelease:function(){},onContext:function(){}},data:{nodes:null,edges:null},functions:{createNode:function(){},createEdge:function(){},getPointer:function(){}},modules:{},view:{scale:1,translation:{x:0,y:0}}},this.bindEventListeners(),this.images=new l(function(){return o.body.emitter.emit("_requestRedraw")}),this.groups=new u,this.canvas=new y(this.body),this.selectionHandler=new _(this.body,this.canvas),this.interactionHandler=new b(this.body,this.canvas,this.selectionHandler),this.view=new m(this.body,this.canvas),this.renderer=new g(this.body,this.canvas),this.physics=new p(this.body),this.layoutEngine=new w(this.body),this.clustering=new v(this.body),this.manipulation=new k(this.body,this.canvas,this.selectionHandler),this.nodesHandler=new c(this.body,this.images,this.groups,this.layoutEngine),this.edgesHandler=new f(this.body,this.images,this.groups),this.body.modules.kamadaKawai=new T(this.body,150,.05),this.body.modules.clustering=this.clustering,this.canvas._create(),this.setOptions(i),this.setData(t)}i(122);var o=i(73),s=i(5),r=i(74),a=i(75),d=i(123),h=i(126),l=i(76).default,u=i(131).default,c=i(132).default,f=i(163).default,p=i(169).default,v=i(176).default,g=i(178).default,y=i(179).default,m=i(180).default,b=i(181).default,_=i(184).default,w=i(185).default,k=i(187).default,x=i(188).default,O=i(54).default,M=i(54),E=M.printStyle,S=i(82),D=S.allOptions,C=S.configureOptions,T=i(190).default;o(n.prototype),n.prototype.setOptions=function(e){var t=this;if(void 0!==e){!0===O.validate(e,D)&&console.log("%cErrors have been found in the supplied options object.",E);var i=["locale","locales","clickToUse"];if(s.selectiveDeepExtend(i,this.options,e),e=this.layoutEngine.setOptions(e.layout,e),this.canvas.setOptions(e),this.groups.setOptions(e.groups),this.nodesHandler.setOptions(e.nodes),this.edgesHandler.setOptions(e.edges),this.physics.setOptions(e.physics),this.manipulation.setOptions(e.manipulation,e,this.options),this.interactionHandler.setOptions(e.interaction),this.renderer.setOptions(e.interaction),this.selectionHandler.setOptions(e.interaction),void 0!==e.groups&&this.body.emitter.emit("refreshNodes"),"configure"in e&&(this.configurator||(this.configurator=new x(this,this.body.container,C,this.canvas.pixelRatio)),this.configurator.setOptions(e.configure)),this.configurator&&!0===this.configurator.options.enabled){var n={nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};s.deepExtend(n.nodes,this.nodesHandler.options),s.deepExtend(n.edges,this.edgesHandler.options),s.deepExtend(n.layout,this.layoutEngine.options),s.deepExtend(n.interaction,this.selectionHandler.options),s.deepExtend(n.interaction,this.renderer.options),s.deepExtend(n.interaction,this.interactionHandler.options),s.deepExtend(n.manipulation,this.manipulation.options),s.deepExtend(n.physics,this.physics.options),s.deepExtend(n.global,this.canvas.options),s.deepExtend(n.global,this.options),this.configurator.setModuleOptions(n)}void 0!==e.clickToUse?!0===e.clickToUse?void 0===this.activator&&(this.activator=new d(this.canvas.frame),this.activator.on("change",function(){t.body.emitter.emit("activate")})):(void 0!==this.activator&&(this.activator.destroy(),delete this.activator),this.body.emitter.emit("activate")):this.body.emitter.emit("activate"),this.canvas.setSize(),this.body.emitter.emit("startSimulation")}},n.prototype._updateVisibleIndices=function(){var e=this.body.nodes,t=this.body.edges;this.body.nodeIndices=[],this.body.edgeIndices=[];for(var i in e)e.hasOwnProperty(i)&&(this.clustering._isClusteredNode(i)||!1!==e[i].options.hidden||this.body.nodeIndices.push(e[i].id));for(var n in t)if(t.hasOwnProperty(n)){var o=t[n],s=e[o.fromId],r=e[o.toId],a=void 0!==s&&void 0!==r,d=!this.clustering._isClusteredEdge(n)&&!1===o.options.hidden&&a&&!1===s.options.hidden&&!1===r.options.hidden;d&&this.body.edgeIndices.push(o.id)}},n.prototype.bindEventListeners=function(){var e=this;this.body.emitter.on("_dataChanged",function(){e.edgesHandler._updateState(),e.body.emitter.emit("_dataUpdated")}),this.body.emitter.on("_dataUpdated",function(){e.clustering._updateState(),e._updateVisibleIndices(),e._updateValueRange(e.body.nodes),e._updateValueRange(e.body.edges),e.body.emitter.emit("startSimulation"),e.body.emitter.emit("_requestRedraw")})},n.prototype.setData=function(e){if(this.body.emitter.emit("resetPhysics"),this.body.emitter.emit("_resetData"),this.selectionHandler.unselectAll(),e&&e.dot&&(e.nodes||e.edges))throw new SyntaxError('Data must contain either parameter "dot" or parameter pair "nodes" and "edges", but not both.');if(this.setOptions(e&&e.options),e&&e.dot){console.log("The dot property has been deprecated. Please use the static convertDot method to convert DOT into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertDot(dotString);");var t=r.DOTToGraph(e.dot);return void this.setData(t)}if(e&&e.gephi){console.log("The gephi property has been deprecated. Please use the static convertGephi method to convert gephi into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertGephi(gephiJson);");var i=a.parseGephi(e.gephi);return void this.setData(i)}this.nodesHandler.setData(e&&e.nodes,!0),this.edgesHandler.setData(e&&e.edges,!0),this.body.emitter.emit("_dataChanged"),this.body.emitter.emit("_dataLoaded"),this.body.emitter.emit("initPhysics")},n.prototype.destroy=function(){this.body.emitter.emit("destroy"),this.body.emitter.off(),this.off(),delete this.groups,delete this.canvas,delete this.selectionHandler,delete this.interactionHandler,delete this.view,delete this.renderer,delete this.physics,delete this.layoutEngine,delete this.clustering,delete this.manipulation,delete this.nodesHandler,delete this.edgesHandler,delete this.configurator,delete this.images;for(var e in this.body.nodes)this.body.nodes.hasOwnProperty(e)&&delete this.body.nodes[e];for(var t in this.body.edges)this.body.edges.hasOwnProperty(t)&&delete this.body.edges[t];s.recursiveDOMDelete(this.body.container)},n.prototype._updateValueRange=function(e){var t,i=void 0,n=void 0,o=0;for(t in e)if(e.hasOwnProperty(t)){var s=e[t].getValue();void 0!==s&&(i=void 0===i?s:Math.min(s,i),n=void 0===n?s:Math.max(s,n),o+=s)}if(void 0!==i&&void 0!==n)for(t in e)e.hasOwnProperty(t)&&e[t].setValueRange(i,n,o)},n.prototype.isActive=function(){return!this.activator||this.activator.active},n.prototype.setSize=function(){return this.canvas.setSize.apply(this.canvas,arguments)},n.prototype.canvasToDOM=function(){return this.canvas.canvasToDOM.apply(this.canvas,arguments)},n.prototype.DOMtoCanvas=function(){return this.canvas.DOMtoCanvas.apply(this.canvas,arguments)},n.prototype.findNode=function(){return this.clustering.findNode.apply(this.clustering,arguments)},n.prototype.isCluster=function(){return this.clustering.isCluster.apply(this.clustering,arguments)},n.prototype.openCluster=function(){return this.clustering.openCluster.apply(this.clustering,arguments)},n.prototype.cluster=function(){return this.clustering.cluster.apply(this.clustering,arguments)},n.prototype.getNodesInCluster=function(){return this.clustering.getNodesInCluster.apply(this.clustering,arguments)},n.prototype.clusterByConnection=function(){return this.clustering.clusterByConnection.apply(this.clustering,arguments)},n.prototype.clusterByHubsize=function(){return this.clustering.clusterByHubsize.apply(this.clustering,arguments)},n.prototype.clusterOutliers=function(){return this.clustering.clusterOutliers.apply(this.clustering,arguments)},n.prototype.getSeed=function(){return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments)},n.prototype.enableEditMode=function(){return this.manipulation.enableEditMode.apply(this.manipulation,arguments)},n.prototype.disableEditMode=function(){return this.manipulation.disableEditMode.apply(this.manipulation,arguments)},n.prototype.addNodeMode=function(){return this.manipulation.addNodeMode.apply(this.manipulation,arguments)},n.prototype.editNode=function(){return this.manipulation.editNode.apply(this.manipulation,arguments)},n.prototype.editNodeMode=function(){return console.log("Deprecated: Please use editNode instead of editNodeMode."),this.manipulation.editNode.apply(this.manipulation,arguments)},n.prototype.addEdgeMode=function(){return this.manipulation.addEdgeMode.apply(this.manipulation,arguments)},n.prototype.editEdgeMode=function(){return this.manipulation.editEdgeMode.apply(this.manipulation,arguments)},n.prototype.deleteSelected=function(){return this.manipulation.deleteSelected.apply(this.manipulation,arguments)},n.prototype.getPositions=function(){return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments)},n.prototype.storePositions=function(){return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments)},n.prototype.moveNode=function(){return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments)},n.prototype.getBoundingBox=function(){return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments)},n.prototype.getConnectedNodes=function(e){return void 0!==this.body.nodes[e]?this.nodesHandler.getConnectedNodes.apply(this.nodesHandler,arguments):this.edgesHandler.getConnectedNodes.apply(this.edgesHandler,arguments)},n.prototype.getConnectedEdges=function(){return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments)},n.prototype.startSimulation=function(){return this.physics.startSimulation.apply(this.physics,arguments)},n.prototype.stopSimulation=function(){return this.physics.stopSimulation.apply(this.physics,arguments)},n.prototype.stabilize=function(){return this.physics.stabilize.apply(this.physics,arguments)},n.prototype.getSelection=function(){return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments)},n.prototype.setSelection=function(){return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments)},n.prototype.getSelectedNodes=function(){return this.selectionHandler.getSelectedNodes.apply(this.selectionHandler,arguments)},n.prototype.getSelectedEdges=function(){return this.selectionHandler.getSelectedEdges.apply(this.selectionHandler,arguments)},n.prototype.getNodeAt=function(){var e=this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);return void 0!==e&&void 0!==e.id?e.id:e},n.prototype.getEdgeAt=function(){var e=this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);return void 0!==e&&void 0!==e.id?e.id:e},n.prototype.selectNodes=function(){return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments)},n.prototype.selectEdges=function(){return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments)},n.prototype.unselectAll=function(){this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments),this.redraw()},n.prototype.redraw=function(){return this.renderer.redraw.apply(this.renderer,arguments)},n.prototype.getScale=function(){return this.view.getScale.apply(this.view,arguments)},n.prototype.getViewPosition=function(){return this.view.getViewPosition.apply(this.view,arguments)},n.prototype.fit=function(){return this.view.fit.apply(this.view,arguments)},n.prototype.moveTo=function(){return this.view.moveTo.apply(this.view,arguments)},n.prototype.focus=function(){return this.view.focus.apply(this.view,arguments)},n.prototype.releaseNode=function(){return this.view.releaseNode.apply(this.view,arguments)},n.prototype.getOptionsFromConfigurator=function(){var e={};return this.configurator&&(e=this.configurator.getOptions.apply(this.configurator)),e},e.exports=n},function(e,t,i){"undefined"!=typeof CanvasRenderingContext2D&&(CanvasRenderingContext2D.prototype.circle=function(e,t,i){this.beginPath(),this.arc(e,t,i,0,2*Math.PI,!1),this.closePath()},CanvasRenderingContext2D.prototype.square=function(e,t,i){this.beginPath(),this.rect(e-i,t-i,2*i,2*i),this.closePath()},CanvasRenderingContext2D.prototype.triangle=function(e,t,i){this.beginPath(),i*=1.15,t+=.275*i;var n=2*i,o=n/2,s=Math.sqrt(3)/6*n,r=Math.sqrt(n*n-o*o);this.moveTo(e,t-(r-s)),this.lineTo(e+o,t+s),this.lineTo(e-o,t+s),this.lineTo(e,t-(r-s)),this.closePath()},CanvasRenderingContext2D.prototype.triangleDown=function(e,t,i){this.beginPath(),i*=1.15,t-=.275*i;var n=2*i,o=n/2,s=Math.sqrt(3)/6*n,r=Math.sqrt(n*n-o*o);this.moveTo(e,t+(r-s)),this.lineTo(e+o,t-s),this.lineTo(e-o,t-s),this.lineTo(e,t+(r-s)),this.closePath()},CanvasRenderingContext2D.prototype.star=function(e,t,i){this.beginPath(),i*=.82,t+=.1*i;for(var n=0;n<10;n++){var o=n%2==0?1.3*i:.5*i;this.lineTo(e+o*Math.sin(2*n*Math.PI/10),t-o*Math.cos(2*n*Math.PI/10))}this.closePath()},CanvasRenderingContext2D.prototype.diamond=function(e,t,i){this.beginPath(),this.lineTo(e,t+i),this.lineTo(e+i,t),this.lineTo(e,t-i),this.lineTo(e-i,t),this.closePath()},CanvasRenderingContext2D.prototype.roundRect=function(e,t,i,n,o){var s=Math.PI/180;i-2*o<0&&(o=i/2),n-2*o<0&&(o=n/2),this.beginPath(),this.moveTo(e+o,t),this.lineTo(e+i-o,t),this.arc(e+i-o,t+o,o,270*s,360*s,!1),this.lineTo(e+i,t+n-o),this.arc(e+i-o,t+n-o,o,0,90*s,!1),this.lineTo(e+o,t+n),this.arc(e+o,t+n-o,o,90*s,180*s,!1),this.lineTo(e,t+o),this.arc(e+o,t+o,o,180*s,270*s,!1),this.closePath()},CanvasRenderingContext2D.prototype.ellipse_vis=function(e,t,i,n){var o=i/2*.5522848,s=n/2*.5522848,r=e+i,a=t+n,d=e+i/2,h=t+n/2;this.beginPath(),this.moveTo(e,h),this.bezierCurveTo(e,h-s,d-o,t,d,t),this.bezierCurveTo(d+o,t,r,h-s,r,h),this.bezierCurveTo(r,h+s,d+o,a,d,a),this.bezierCurveTo(d-o,a,e,h+s,e,h),this.closePath()},CanvasRenderingContext2D.prototype.database=function(e,t,i,n){var o=i,s=n*(1/3),r=o/2*.5522848,a=s/2*.5522848,d=e+o,h=t+s,l=e+o/2,u=t+s/2,c=t+(n-s/2),f=t+n;this.beginPath(),this.moveTo(d,u),this.bezierCurveTo(d,u+a,l+r,h,l,h),this.bezierCurveTo(l-r,h,e,u+a,e,u),this.bezierCurveTo(e,u-a,l-r,t,l,t),this.bezierCurveTo(l+r,t,d,u-a,d,u),this.lineTo(d,c),this.bezierCurveTo(d,c+a,l+r,f,l,f),this.bezierCurveTo(l-r,f,e,c+a,e,c),this.lineTo(e,u)},CanvasRenderingContext2D.prototype.dashedLine=function(e,t,i,n,o){this.beginPath(),this.moveTo(e,t);for(var s=o.length,r=i-e,a=n-t,d=a/r,h=Math.sqrt(r*r+a*a),l=0,u=!0,c=0,f=o[0];h>=.1;)f=o[l++%s],f>h&&(f=h),c=Math.sqrt(f*f/(1+d*d)),c=r<0?-c:c,e+=c,t+=d*c,!0===u?this.lineTo(e,t):this.moveTo(e,t),h-=f,u=!u},CanvasRenderingContext2D.prototype.hexagon=function(e,t,i){this.beginPath();var n=2*Math.PI/6;this.moveTo(e+i,t);for(var o=1;o<6;o++)this.lineTo(e+i*Math.cos(n*o),t+i*Math.sin(n*o));this.closePath()})},function(e,t,i){function n(e){this.active=!1,this.dom={container:e},this.dom.overlay=document.createElement("div"),this.dom.overlay.className="vis-overlay",this.dom.container.appendChild(this.dom.overlay),this.hammer=a(this.dom.overlay),this.hammer.on("tap",this._onTapOverlay.bind(this));var t=this;["tap","doubletap","press","pinch","pan","panstart","panmove","panend"].forEach(function(e){t.hammer.on(e,function(e){e.stopPropagation()})}),document&&document.body&&(this.onClick=function(i){o(i.target,e)||t.deactivate()},document.body.addEventListener("click",this.onClick)),void 0!==this.keycharm&&this.keycharm.destroy(),this.keycharm=s(),this.escListener=this.deactivate.bind(this)}function o(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}var s=i(52),r=i(73),a=i(22),d=i(5);r(n.prototype),n.current=null,n.prototype.destroy=function(){this.deactivate(),this.dom.overlay.parentNode.removeChild(this.dom.overlay),this.onClick&&document.body.removeEventListener("click",this.onClick),this.hammer.destroy(),this.hammer=null},n.prototype.activate=function(){n.current&&n.current.deactivate(),n.current=this,this.active=!0,this.dom.overlay.style.display="none",d.addClassName(this.dom.container,"vis-active"),this.emit("change"),this.emit("activate"),this.keycharm.bind("esc",this.escListener)},n.prototype.deactivate=function(){this.active=!1,this.dom.overlay.style.display="",d.removeClassName(this.dom.container,"vis-active"),this.keycharm.unbind("esc",this.escListener),this.emit("change"),this.emit("deactivate")},n.prototype._onTapOverlay=function(e){this.activate(),e.stopPropagation()},e.exports=n},function(e,t,i){var n,o,s;!function(i){o=[],n=i,void 0!==(s="function"==typeof n?n.apply(t,o):n)&&(e.exports=s)}(function(){var e=null;return function t(i,n){function o(e){return e.match(/[^ ]+/g)}function s(t){if("hammer.input"!==t.type){if(t.srcEvent._handled||(t.srcEvent._handled={}),t.srcEvent._handled[t.type])return;t.srcEvent._handled[t.type]=!0}var i=!1;t.stopPropagation=function(){i=!0};var n=t.srcEvent.stopPropagation.bind(t.srcEvent);"function"==typeof n&&(t.srcEvent.stopPropagation=function(){n(),t.stopPropagation()}),t.firstTarget=e;for(var o=e;o&&!i;){var s=o.hammer;if(s)for(var r,a=0;a<s.length;a++)if(r=s[a]._handlers[t.type])for(var d=0;d<r.length&&!i;d++)r[d](t);o=o.parentNode}}var r=n||{preventDefault:!1};if(i.Manager){var a=i,d=function(e,i){var n=Object.create(r);return i&&a.assign(n,i),t(new a(e,n),n)};return a.assign(d,a),d.Manager=function(e,i){var n=Object.create(r);return i&&a.assign(n,i),t(new a.Manager(e,n),n)},d}var h=Object.create(i),l=i.element;return l.hammer||(l.hammer=[]),l.hammer.push(h),i.on("hammer.input",function(t){!0!==r.preventDefault&&r.preventDefault!==t.pointerType||t.preventDefault(),t.isFirst&&(e=t.target)}),h._handlers={},h.on=function(e,t){return o(e).forEach(function(e){var n=h._handlers[e];n||(h._handlers[e]=n=[],i.on(e,s)),n.push(t)}),h},h.off=function(e,t){return o(e).forEach(function(e){var n=h._handlers[e];n&&(n=t?n.filter(function(e){return e!==t}):[],n.length>0?h._handlers[e]=n:(i.off(e,s),delete h._handlers[e]))}),h},h.emit=function(t,n){e=n.target,i.emit(t,n)},h.destroy=function(){var e=i.element.hammer,t=e.indexOf(h);-1!==t&&e.splice(t,1),e.length||delete i.element.hammer,h._handlers={},i.destroy()},h}})},function(e,t,i){var n;/*! Hammer.JS - v2.0.7 - 2016-04-22
+ * http://hammerjs.github.io/
+ *
+ * Copyright (c) 2016 Jorik Tangelder;
+ * Licensed under the MIT license */
+!function(o,s,r,a){function d(e,t,i){return setTimeout(f(e,i),t)}function h(e,t,i){return!!Array.isArray(e)&&(l(e,i[t],i),!0)}function l(e,t,i){var n;if(e)if(e.forEach)e.forEach(t,i);else if(e.length!==a)for(n=0;n<e.length;)t.call(i,e[n],n,e),n++;else for(n in e)e.hasOwnProperty(n)&&t.call(i,e[n],n,e)}function u(e,t,i){var n="DEPRECATED METHOD: "+t+"\n"+i+" AT \n";return function(){var t=new Error("get-stack-trace"),i=t&&t.stack?t.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",s=o.console&&(o.console.warn||o.console.log);return s&&s.call(o.console,n,i),e.apply(this,arguments)}}function c(e,t,i){var n,o=t.prototype;n=e.prototype=Object.create(o),n.constructor=e,n._super=o,i&&pe(n,i)}function f(e,t){return function(){return e.apply(t,arguments)}}function p(e,t){return typeof e==ye?e.apply(t?t[0]||a:a,t):e}function v(e,t){return e===a?t:e}function g(e,t,i){l(_(t),function(t){e.addEventListener(t,i,!1)})}function y(e,t,i){l(_(t),function(t){e.removeEventListener(t,i,!1)})}function m(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function b(e,t){return e.indexOf(t)>-1}function _(e){return e.trim().split(/\s+/g)}function w(e,t,i){if(e.indexOf&&!i)return e.indexOf(t);for(var n=0;n<e.length;){if(i&&e[n][i]==t||!i&&e[n]===t)return n;n++}return-1}function k(e){return Array.prototype.slice.call(e,0)}function x(e,t,i){for(var n=[],o=[],s=0;s<e.length;){var r=t?e[s][t]:e[s];w(o,r)<0&&n.push(e[s]),o[s]=r,s++}return i&&(n=t?n.sort(function(e,i){return e[t]>i[t]}):n.sort()),n}function O(e,t){for(var i,n,o=t[0].toUpperCase()+t.slice(1),s=0;s<ve.length;){if(i=ve[s],(n=i?i+o:t)in e)return n;s++}return a}function M(){return xe++}function E(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||o}function S(e,t){var i=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){p(e.options.enable,[e])&&i.handler(t)},this.init()}function D(e){var t=e.options.inputClass;return new(t||(Ee?W:Se?U:Me?G:H))(e,C)}function C(e,t,i){var n=i.pointers.length,o=i.changedPointers.length,s=t&Ce&&n-o==0,r=t&(Pe|Ie)&&n-o==0;i.isFirst=!!s,i.isFinal=!!r,s&&(e.session={}),i.eventType=t,T(e,i),e.emit("hammer.input",i),e.recognize(i),e.session.prevInput=i}function T(e,t){var i=e.session,n=t.pointers,o=n.length;i.firstInput||(i.firstInput=F(t)),o>1&&!i.firstMultiple?i.firstMultiple=F(t):1===o&&(i.firstMultiple=!1);var s=i.firstInput,r=i.firstMultiple,a=r?r.center:s.center,d=t.center=N(n);t.timeStamp=_e(),t.deltaTime=t.timeStamp-s.timeStamp,t.angle=A(a,d),t.distance=R(a,d),P(i,t),t.offsetDirection=z(t.deltaX,t.deltaY);var h=B(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=h.x,t.overallVelocityY=h.y,t.overallVelocity=be(h.x)>be(h.y)?h.x:h.y,t.scale=r?L(r.pointers,n):1,t.rotation=r?j(r.pointers,n):0,t.maxPointers=i.prevInput?t.pointers.length>i.prevInput.maxPointers?t.pointers.length:i.prevInput.maxPointers:t.pointers.length,I(i,t);var l=e.element;m(t.srcEvent.target,l)&&(l=t.srcEvent.target),t.target=l}function P(e,t){var i=t.center,n=e.offsetDelta||{},o=e.prevDelta||{},s=e.prevInput||{};t.eventType!==Ce&&s.eventType!==Pe||(o=e.prevDelta={x:s.deltaX||0,y:s.deltaY||0},n=e.offsetDelta={x:i.x,y:i.y}),t.deltaX=o.x+(i.x-n.x),t.deltaY=o.y+(i.y-n.y)}function I(e,t){var i,n,o,s,r=e.lastInterval||t,d=t.timeStamp-r.timeStamp;if(t.eventType!=Ie&&(d>De||r.velocity===a)){var h=t.deltaX-r.deltaX,l=t.deltaY-r.deltaY,u=B(d,h,l);n=u.x,o=u.y,i=be(u.x)>be(u.y)?u.x:u.y,s=z(h,l),e.lastInterval=t}else i=r.velocity,n=r.velocityX,o=r.velocityY,s=r.direction;t.velocity=i,t.velocityX=n,t.velocityY=o,t.direction=s}function F(e){for(var t=[],i=0;i<e.pointers.length;)t[i]={clientX:me(e.pointers[i].clientX),clientY:me(e.pointers[i].clientY)},i++;return{timeStamp:_e(),pointers:t,center:N(t),deltaX:e.deltaX,deltaY:e.deltaY}}function N(e){var t=e.length;if(1===t)return{x:me(e[0].clientX),y:me(e[0].clientY)};for(var i=0,n=0,o=0;o<t;)i+=e[o].clientX,n+=e[o].clientY,o++;return{x:me(i/t),y:me(n/t)}}function B(e,t,i){return{x:t/e||0,y:i/e||0}}function z(e,t){return e===t?Fe:be(e)>=be(t)?e<0?Ne:Be:t<0?ze:Re}function R(e,t,i){i||(i=He);var n=t[i[0]]-e[i[0]],o=t[i[1]]-e[i[1]];return Math.sqrt(n*n+o*o)}function A(e,t,i){i||(i=He);var n=t[i[0]]-e[i[0]],o=t[i[1]]-e[i[1]];return 180*Math.atan2(o,n)/Math.PI}function j(e,t){return A(t[1],t[0],We)+A(e[1],e[0],We)}function L(e,t){return R(t[0],t[1],We)/R(e[0],e[1],We)}function H(){this.evEl=Ve,this.evWin=Ue,this.pressed=!1,S.apply(this,arguments)}function W(){this.evEl=Xe,this.evWin=Ke,S.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function Y(){this.evTarget=$e,this.evWin=Qe,this.started=!1,S.apply(this,arguments)}function V(e,t){var i=k(e.touches),n=k(e.changedTouches);return t&(Pe|Ie)&&(i=x(i.concat(n),"identifier",!0)),[i,n]}function U(){this.evTarget=et,this.targetIds={},S.apply(this,arguments)}function q(e,t){var i=k(e.touches),n=this.targetIds;if(t&(Ce|Te)&&1===i.length)return n[i[0].identifier]=!0,[i,i];var o,s,r=k(e.changedTouches),a=[],d=this.target;if(s=i.filter(function(e){return m(e.target,d)}),t===Ce)for(o=0;o<s.length;)n[s[o].identifier]=!0,o++;for(o=0;o<r.length;)n[r[o].identifier]&&a.push(r[o]),t&(Pe|Ie)&&delete n[r[o].identifier],o++;return a.length?[x(s.concat(a),"identifier",!0),a]:void 0}function G(){S.apply(this,arguments);var e=f(this.handler,this);this.touch=new U(this.manager,e),this.mouse=new H(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function X(e,t){e&Ce?(this.primaryTouch=t.changedPointers[0].identifier,K.call(this,t)):e&(Pe|Ie)&&K.call(this,t)}function K(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var i={x:t.clientX,y:t.clientY};this.lastTouches.push(i);var n=this.lastTouches,o=function(){var e=n.indexOf(i);e>-1&&n.splice(e,1)};setTimeout(o,tt)}}function Z(e){for(var t=e.srcEvent.clientX,i=e.srcEvent.clientY,n=0;n<this.lastTouches.length;n++){var o=this.lastTouches[n],s=Math.abs(t-o.x),r=Math.abs(i-o.y);if(s<=it&&r<=it)return!0}return!1}function $(e,t){this.manager=e,this.set(t)}function Q(e){if(b(e,at))return at;var t=b(e,dt),i=b(e,ht);return t&&i?at:t||i?t?dt:ht:b(e,rt)?rt:st}function J(e){this.options=pe({},this.defaults,e||{}),this.id=M(),this.manager=null,this.options.enable=v(this.options.enable,!0),this.state=ut,this.simultaneous={},this.requireFail=[]}function ee(e){return e>?"cancel":e&pt?"end":e&ft?"move":e&ct?"start":""}function te(e){return e==Re?"down":e==ze?"up":e==Ne?"left":e==Be?"right":""}function ie(e,t){var i=t.manager;return i?i.get(e):e}function ne(){J.apply(this,arguments)}function oe(){ne.apply(this,arguments),this.pX=null,this.pY=null}function se(){ne.apply(this,arguments)}function re(){J.apply(this,arguments),this._timer=null,this._input=null}function ae(){ne.apply(this,arguments)}function de(){ne.apply(this,arguments)}function he(){J.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function le(e,t){return t=t||{},t.recognizers=v(t.recognizers,le.defaults.preset),new ue(e,t)}function ue(e,t){this.options=pe({},le.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=D(this),this.touchAction=new $(this,this.options.touchAction),ce(this,!0),l(this.options.recognizers,function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])},this)}function ce(e,t){var i=e.element;if(i.style){var n;l(e.options.cssProps,function(o,s){n=O(i.style,s),t?(e.oldCssProps[n]=i.style[n],i.style[n]=o):i.style[n]=e.oldCssProps[n]||""}),t||(e.oldCssProps={})}}function fe(e,t){var i=s.createEvent("Event");i.initEvent(e,!0,!0),i.gesture=t,t.target.dispatchEvent(i)}var pe,ve=["","webkit","Moz","MS","ms","o"],ge=s.createElement("div"),ye="function",me=Math.round,be=Math.abs,_e=Date.now;pe="function"!=typeof Object.assign?function(e){if(e===a||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),i=1;i<arguments.length;i++){var n=arguments[i];if(n!==a&&null!==n)for(var o in n)n.hasOwnProperty(o)&&(t[o]=n[o])}return t}:Object.assign;var we=u(function(e,t,i){for(var n=Object.keys(t),o=0;o<n.length;)(!i||i&&e[n[o]]===a)&&(e[n[o]]=t[n[o]]),o++;return e},"extend","Use `assign`."),ke=u(function(e,t){return we(e,t,!0)},"merge","Use `assign`."),xe=1,Oe=/mobile|tablet|ip(ad|hone|od)|android/i,Me="ontouchstart"in o,Ee=O(o,"PointerEvent")!==a,Se=Me&&Oe.test(navigator.userAgent),De=25,Ce=1,Te=2,Pe=4,Ie=8,Fe=1,Ne=2,Be=4,ze=8,Re=16,Ae=Ne|Be,je=ze|Re,Le=Ae|je,He=["x","y"],We=["clientX","clientY"];S.prototype={handler:function(){},init:function(){this.evEl&&g(this.element,this.evEl,this.domHandler),this.evTarget&&g(this.target,this.evTarget,this.domHandler),this.evWin&&g(E(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&y(this.element,this.evEl,this.domHandler),this.evTarget&&y(this.target,this.evTarget,this.domHandler),this.evWin&&y(E(this.element),this.evWin,this.domHandler)}};var Ye={mousedown:Ce,mousemove:Te,mouseup:Pe},Ve="mousedown",Ue="mousemove mouseup";c(H,S,{handler:function(e){var t=Ye[e.type];t&Ce&&0===e.button&&(this.pressed=!0),t&Te&&1!==e.which&&(t=Pe),this.pressed&&(t&Pe&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))}});var qe={pointerdown:Ce,pointermove:Te,pointerup:Pe,pointercancel:Ie,pointerout:Ie},Ge={2:"touch",3:"pen",4:"mouse",5:"kinect"},Xe="pointerdown",Ke="pointermove pointerup pointercancel";o.MSPointerEvent&&!o.PointerEvent&&(Xe="MSPointerDown",Ke="MSPointerMove MSPointerUp MSPointerCancel"),c(W,S,{handler:function(e){var t=this.store,i=!1,n=e.type.toLowerCase().replace("ms",""),o=qe[n],s=Ge[e.pointerType]||e.pointerType,r="touch"==s,a=w(t,e.pointerId,"pointerId");o&Ce&&(0===e.button||r)?a<0&&(t.push(e),a=t.length-1):o&(Pe|Ie)&&(i=!0),a<0||(t[a]=e,this.callback(this.manager,o,{pointers:t,changedPointers:[e],pointerType:s,srcEvent:e}),i&&t.splice(a,1))}});var Ze={touchstart:Ce,touchmove:Te,touchend:Pe,touchcancel:Ie},$e="touchstart",Qe="touchstart touchmove touchend touchcancel";c(Y,S,{handler:function(e){var t=Ze[e.type];if(t===Ce&&(this.started=!0),this.started){var i=V.call(this,e,t);t&(Pe|Ie)&&i[0].length-i[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:i[0],changedPointers:i[1],pointerType:"touch",srcEvent:e})}}});var Je={touchstart:Ce,touchmove:Te,touchend:Pe,touchcancel:Ie},et="touchstart touchmove touchend touchcancel";c(U,S,{handler:function(e){var t=Je[e.type],i=q.call(this,e,t);i&&this.callback(this.manager,t,{pointers:i[0],changedPointers:i[1],pointerType:"touch",srcEvent:e})}});var tt=2500,it=25;c(G,S,{handler:function(e,t,i){var n="touch"==i.pointerType,o="mouse"==i.pointerType;if(!(o&&i.sourceCapabilities&&i.sourceCapabilities.firesTouchEvents)){if(n)X.call(this,t,i);else if(o&&Z.call(this,i))return;this.callback(e,t,i)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var nt=O(ge.style,"touchAction"),ot=nt!==a,st="auto",rt="manipulation",at="none",dt="pan-x",ht="pan-y",lt=function(){if(!ot)return!1;var e={},t=o.CSS&&o.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(i){e[i]=!t||o.CSS.supports("touch-action",i)}),e}();$.prototype={set:function(e){"compute"==e&&(e=this.compute()),ot&&this.manager.element.style&<[e]&&(this.manager.element.style[nt]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return l(this.manager.recognizers,function(t){p(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),Q(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,i=e.offsetDirection;if(this.manager.session.prevented)return void t.preventDefault();var n=this.actions,o=b(n,at)&&!lt[at],s=b(n,ht)&&!lt[ht],r=b(n,dt)&&!lt[dt];if(o){var a=1===e.pointers.length,d=e.distance<2,h=e.deltaTime<250;if(a&&d&&h)return}return r&&s?void 0:o||s&&i&Ae||r&&i&je?this.preventSrc(t):void 0},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var ut=1,ct=2,ft=4,pt=8,vt=pt,gt=16;J.prototype={defaults:{},set:function(e){return pe(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(h(e,"recognizeWith",this))return this;var t=this.simultaneous;return e=ie(e,this),t[e.id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return h(e,"dropRecognizeWith",this)?this:(e=ie(e,this),delete this.simultaneous[e.id],this)},requireFailure:function(e){if(h(e,"requireFailure",this))return this;var t=this.requireFail;return e=ie(e,this),-1===w(t,e)&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(h(e,"dropRequireFailure",this))return this;e=ie(e,this);var t=w(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){function t(t){i.manager.emit(t,e)}var i=this,n=this.state;n<pt&&t(i.options.event+ee(n)),t(i.options.event),e.additionalEvent&&t(e.additionalEvent),n>=pt&&t(i.options.event+ee(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=32},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(32|ut)))return!1;e++}return!0},recognize:function(e){var t=pe({},e);if(!p(this.options.enable,[this,t]))return this.reset(),void(this.state=32);this.state&(vt|gt|32)&&(this.state=ut),this.state=this.process(t),this.state&(ct|ft|pt|gt)&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},c(ne,J,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,i=e.eventType,n=t&(ct|ft),o=this.attrTest(e);return n&&(i&Ie||!o)?t|gt:n||o?i&Pe?t|pt:t&ct?t|ft:ct:32}}),c(oe,ne,{defaults:{event:"pan",threshold:10,pointers:1,direction:Le},getTouchAction:function(){var e=this.options.direction,t=[];return e&Ae&&t.push(ht),e&je&&t.push(dt),t},directionTest:function(e){var t=this.options,i=!0,n=e.distance,o=e.direction,s=e.deltaX,r=e.deltaY;return o&t.direction||(t.direction&Ae?(o=0===s?Fe:s<0?Ne:Be,i=s!=this.pX,n=Math.abs(e.deltaX)):(o=0===r?Fe:r<0?ze:Re,i=r!=this.pY,n=Math.abs(e.deltaY))),e.direction=o,i&&n>t.threshold&&o&t.direction},attrTest:function(e){return ne.prototype.attrTest.call(this,e)&&(this.state&ct||!(this.state&ct)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=te(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),c(se,ne,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[at]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&ct)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),c(re,J,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[st]},process:function(e){var t=this.options,i=e.pointers.length===t.pointers,n=e.distance<t.threshold,o=e.deltaTime>t.time;if(this._input=e,!n||!i||e.eventType&(Pe|Ie)&&!o)this.reset();else if(e.eventType&Ce)this.reset(),this._timer=d(function(){this.state=vt,this.tryEmit()},t.time,this);else if(e.eventType&Pe)return vt;return 32},reset:function(){clearTimeout(this._timer)},emit:function(e){this.state===vt&&(e&&e.eventType&Pe?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=_e(),this.manager.emit(this.options.event,this._input)))}}),c(ae,ne,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[at]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&ct)}}),c(de,ne,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Ae|je,pointers:1},getTouchAction:function(){return oe.prototype.getTouchAction.call(this)},attrTest:function(e){var t,i=this.options.direction;return i&(Ae|je)?t=e.overallVelocity:i&Ae?t=e.overallVelocityX:i&je&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&i&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&be(t)>this.options.velocity&&e.eventType&Pe},emit:function(e){var t=te(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),c(he,J,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[rt]},process:function(e){var t=this.options,i=e.pointers.length===t.pointers,n=e.distance<t.threshold,o=e.deltaTime<t.time;if(this.reset(),e.eventType&Ce&&0===this.count)return this.failTimeout();if(n&&o&&i){if(e.eventType!=Pe)return this.failTimeout();var s=!this.pTime||e.timeStamp-this.pTime<t.interval,r=!this.pCenter||R(this.pCenter,e.center)<t.posThreshold;this.pTime=e.timeStamp,this.pCenter=e.center,r&&s?this.count+=1:this.count=1,this._input=e;if(0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=d(function(){this.state=vt,this.tryEmit()},t.interval,this),ct):vt}return 32},failTimeout:function(){return this._timer=d(function(){this.state=32},this.options.interval,this),32},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==vt&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),le.VERSION="2.0.7",le.defaults={domEvents:!1,touchAction:"compute",enable:!0,inputTarget:null,inputClass:null,preset:[[ae,{enable:!1}],[se,{enable:!1},["rotate"]],[de,{direction:Ae}],[oe,{direction:Ae},["swipe"]],[he],[he,{event:"doubletap",taps:2},["tap"]],[re]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};ue.prototype={set:function(e){return pe(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){this.touchAction.preventDefaults(e);var i,n=this.recognizers,o=t.curRecognizer;(!o||o&&o.state&vt)&&(o=t.curRecognizer=null);for(var s=0;s<n.length;)i=n[s],2===t.stopped||o&&i!=o&&!i.canRecognizeWith(o)?i.reset():i.recognize(e),!o&&i.state&(ct|ft|pt)&&(o=t.curRecognizer=i),s++}},get:function(e){if(e instanceof J)return e;for(var t=this.recognizers,i=0;i<t.length;i++)if(t[i].options.event==e)return t[i];return null},add:function(e){if(h(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(h(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,i=w(t,e);-1!==i&&(t.splice(i,1),this.touchAction.update())}return this},on:function(e,t){if(e!==a&&t!==a){var i=this.handlers;return l(_(e),function(e){i[e]=i[e]||[],i[e].push(t)}),this}},off:function(e,t){if(e!==a){var i=this.handlers;return l(_(e),function(e){t?i[e]&&i[e].splice(w(i[e],t),1):delete i[e]}),this}},emit:function(e,t){this.options.domEvents&&fe(e,t);var i=this.handlers[e]&&this.handlers[e].slice();if(i&&i.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var n=0;n<i.length;)i[n](t),n++}},destroy:function(){this.element&&ce(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},pe(le,{INPUT_START:Ce,INPUT_MOVE:Te,INPUT_END:Pe,INPUT_CANCEL:Ie,STATE_POSSIBLE:ut,STATE_BEGAN:ct,STATE_CHANGED:ft,STATE_ENDED:pt,STATE_RECOGNIZED:vt,STATE_CANCELLED:gt,STATE_FAILED:32,DIRECTION_NONE:Fe,DIRECTION_LEFT:Ne,DIRECTION_RIGHT:Be,DIRECTION_UP:ze,DIRECTION_DOWN:Re,DIRECTION_HORIZONTAL:Ae,DIRECTION_VERTICAL:je,DIRECTION_ALL:Le,Manager:ue,Input:S,TouchAction:$,TouchInput:U,MouseInput:H,PointerEventInput:W,TouchMouseInput:G,SingleTouchInput:Y,Recognizer:J,AttrRecognizer:ne,Tap:he,Pan:oe,Swipe:de,Pinch:se,Rotate:ae,Press:re,on:g,off:y,each:l,merge:ke,extend:we,assign:pe,inherit:c,bindFn:f,prefixed:O}),(void 0!==o?o:"undefined"!=typeof self?self:{}).Hammer=le,(n=function(){return le}.call(t,i,t,e))!==a&&(e.exports=n)}(window,document)},function(e,t,i){t.en={edit:"Edit",del:"Delete selected",back:"Back",addNode:"Add Node",addEdge:"Add Edge",editNode:"Edit Node",editEdge:"Edit Edge",addDescription:"Click in an empty space to place a new node.",edgeDescription:"Click on a node and drag the edge to another node to connect them.",editEdgeDescription:"Click on the control points and drag them to a node to connect to it.",createEdgeError:"Cannot link edges to a cluster.",deleteClusterError:"Clusters cannot be deleted.",editClusterError:"Clusters cannot be edited."},t.en_EN=t.en,t.en_US=t.en,t.de={edit:"Editieren",del:"Lösche Auswahl",back:"Zurück",addNode:"Knoten hinzufügen",addEdge:"Kante hinzufügen",editNode:"Knoten editieren",editEdge:"Kante editieren",addDescription:"Klicke auf eine freie Stelle, um einen neuen Knoten zu plazieren.",edgeDescription:"Klicke auf einen Knoten und ziehe die Kante zu einem anderen Knoten, um diese zu verbinden.",editEdgeDescription:"Klicke auf die Verbindungspunkte und ziehe diese auf einen Knoten, um sie zu verbinden.",createEdgeError:"Es ist nicht möglich, Kanten mit Clustern zu verbinden.",deleteClusterError:"Cluster können nicht gelöscht werden.",editClusterError:"Cluster können nicht editiert werden."},t.de_DE=t.de,t.es={edit:"Editar",del:"Eliminar selección",back:"Átras",addNode:"Añadir nodo",addEdge:"Añadir arista",editNode:"Editar nodo",editEdge:"Editar arista",addDescription:"Haga clic en un lugar vacío para colocar un nuevo nodo.",edgeDescription:"Haga clic en un nodo y arrastre la arista hacia otro nodo para conectarlos.",editEdgeDescription:"Haga clic en un punto de control y arrastrelo a un nodo para conectarlo.",createEdgeError:"No se puede conectar una arista a un grupo.",deleteClusterError:"No es posible eliminar grupos.",editClusterError:"No es posible editar grupos."},t.es_ES=t.es,t.it={edit:"Modifica",del:"Cancella la selezione",back:"Indietro",addNode:"Aggiungi un nodo",addEdge:"Aggiungi un vertice",editNode:"Modifica il nodo",editEdge:"Modifica il vertice",addDescription:"Clicca per aggiungere un nuovo nodo",edgeDescription:"Clicca su un nodo e trascinalo ad un altro nodo per connetterli.",editEdgeDescription:"Clicca sui Punti di controllo e trascinali ad un nodo per connetterli.",createEdgeError:"Non si possono collegare vertici ad un cluster",deleteClusterError:"I cluster non possono essere cancellati",editClusterError:"I clusters non possono essere modificati."},t.it_IT=t.it,t.nl={edit:"Wijzigen",del:"Selectie verwijderen",back:"Terug",addNode:"Node toevoegen",addEdge:"Link toevoegen",editNode:"Node wijzigen",editEdge:"Link wijzigen",addDescription:"Klik op een leeg gebied om een nieuwe node te maken.",edgeDescription:"Klik op een node en sleep de link naar een andere node om ze te verbinden.",editEdgeDescription:"Klik op de verbindingspunten en sleep ze naar een node om daarmee te verbinden.",createEdgeError:"Kan geen link maken naar een cluster.",deleteClusterError:"Clusters kunnen niet worden verwijderd.",editClusterError:"Clusters kunnen niet worden aangepast."},t.nl_NL=t.nl,t.nl_BE=t.nl,t["pt-br"]={edit:"Editar",del:"Remover selecionado",back:"Voltar",addNode:"Adicionar nó",addEdge:"Adicionar aresta",editNode:"Editar nó",editEdge:"Editar aresta",addDescription:"Clique em um espaço em branco para adicionar um novo nó",edgeDescription:"Clique em um nó e arraste a aresta até outro nó para conectá-los",editEdgeDescription:"Clique nos pontos de controle e os arraste para um nó para conectá-los",createEdgeError:"Não foi possível linkar arestas a um cluster.",deleteClusterError:"Clusters não puderam ser removidos.",editClusterError:"Clusters não puderam ser editados."},t["pt-BR"]=t["pt-br"],t.pt_BR=t["pt-br"],t.pt_br=t["pt-br"],t.ru={edit:"Редактировать",del:"Удалить выбранное",back:"Назад",addNode:"Добавить узел",addEdge:"Добавить ребро",editNode:"Редактировать узел",editEdge:"Редактировать ребро",addDescription:"Кликните в свободное место, чтобы добавить новый узел.",edgeDescription:"Кликните на узел и протяните ребро к другому узлу, чтобы соединить их.",editEdgeDescription:"Кликните на контрольные точки и перетащите их в узел, чтобы подключиться к нему.",createEdgeError:"Невозможно соединить ребра в кластер.",deleteClusterError:"Кластеры не могут быть удалены",editClusterError:"Кластеры недоступны для редактирования."},t.ru_RU=t.ru,t.cn={edit:"编辑",del:"删除选定",back:"返回",addNode:"添加节点",addEdge:"添加连接线",editNode:"编辑节点",editEdge:"编辑连接线",addDescription:"单击空白处放置新节点。",edgeDescription:"单击某个节点并将该连接线拖动到另一个节点以连接它们。",editEdgeDescription:"单击控制节点并将它们拖到节点上连接。",createEdgeError:"无法将连接线连接到群集。",deleteClusterError:"无法删除群集。",editClusterError:"无法编辑群集。"},t.zh_CN=t.cn},function(e,t,i){e.exports={default:i(128),__esModule:!0}},function(e,t,i){i(129);var n=i(6).Object;e.exports=function(e,t,i){return n.defineProperty(e,t,i)}},function(e,t,i){var n=i(11);n(n.S+n.F*!i(13),"Object",{defineProperty:i(12).f})},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(0),s=n(o),r=i(1),a=n(r),d=function(){function e(){(0,s.default)(this,e),this.NUM_ITERATIONS=4,this.image=new Image,this.canvas=document.createElement("canvas")}return(0,a.default)(e,[{key:"init",value:function(){if(!this.initialized()){this.src=this.image.src;var e=this.image.width,t=this.image.height;this.width=e,this.height=t;var i=Math.floor(t/2),n=Math.floor(t/4),o=Math.floor(t/8),s=Math.floor(t/16),r=Math.floor(e/2),a=Math.floor(e/4),d=Math.floor(e/8),h=Math.floor(e/16);this.canvas.width=3*a,this.canvas.height=i,this.coordinates=[[0,0,r,i],[r,0,a,n],[r,n,d,o],[5*d,n,h,s]],this._fillMipMap()}}},{key:"initialized",value:function(){return void 0!==this.coordinates}},{key:"_fillMipMap",value:function(){var e=this.canvas.getContext("2d"),t=this.coordinates[0];e.drawImage(this.image,t[0],t[1],t[2],t[3]);for(var i=1;i<this.NUM_ITERATIONS;i++){var n=this.coordinates[i-1],o=this.coordinates[i];e.drawImage(this.canvas,n[0],n[1],n[2],n[3],o[0],o[1],o[2],o[3])}}},{key:"drawImageAtPosition",value:function(e,t,i,n,o,s){if(this.initialized())if(t>2){t*=.5;for(var r=0;t>2&&r<this.NUM_ITERATIONS;)t*=.5,r+=1;r>=this.NUM_ITERATIONS&&(r=this.NUM_ITERATIONS-1);var a=this.coordinates[r];e.drawImage(this.canvas,a[0],a[1],a[2],a[3],i,n,o,s)}else e.drawImage(this.image,i,n,o,s)}}]),e}();t.default=d},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(0),s=n(o),r=i(1),a=n(r),d=i(5),h=function(){function e(){(0,s.default)(this,e),this.clear(),this.defaultIndex=0,this.groupsArray=[],this.groupIndex=0,this.defaultGroups=[{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},{border:"#FFA500",background:"#FFFF00",highlight:{border:"#FFA500",background:"#FFFFA3"},hover:{border:"#FFA500",background:"#FFFFA3"}},{border:"#FA0A10",background:"#FB7E81",highlight:{border:"#FA0A10",background:"#FFAFB1"},hover:{border:"#FA0A10",background:"#FFAFB1"}},{border:"#41A906",background:"#7BE141",highlight:{border:"#41A906",background:"#A1EC76"},hover:{border:"#41A906",background:"#A1EC76"}},{border:"#E129F0",background:"#EB7DF4",highlight:{border:"#E129F0",background:"#F0B3F5"},hover:{border:"#E129F0",background:"#F0B3F5"}},{border:"#7C29F0",background:"#AD85E4",highlight:{border:"#7C29F0",background:"#D3BDF0"},hover:{border:"#7C29F0",background:"#D3BDF0"}},{border:"#C37F00",background:"#FFA807",highlight:{border:"#C37F00",background:"#FFCA66"},hover:{border:"#C37F00",background:"#FFCA66"}},{border:"#4220FB",background:"#6E6EFD",highlight:{border:"#4220FB",background:"#9B9BFD"},hover:{border:"#4220FB",background:"#9B9BFD"}},{border:"#FD5A77",background:"#FFC0CB",highlight:{border:"#FD5A77",background:"#FFD1D9"},hover:{border:"#FD5A77",background:"#FFD1D9"}},{border:"#4AD63A",background:"#C2FABC",highlight:{border:"#4AD63A",background:"#E6FFE3"},hover:{border:"#4AD63A",background:"#E6FFE3"}},{border:"#990000",background:"#EE0000",highlight:{border:"#BB0000",background:"#FF3333"},hover:{border:"#BB0000",background:"#FF3333"}},{border:"#FF6000",background:"#FF6000",highlight:{border:"#FF6000",background:"#FF6000"},hover:{border:"#FF6000",background:"#FF6000"}},{border:"#97C2FC",background:"#2B7CE9",highlight:{border:"#D2E5FF",background:"#2B7CE9"},hover:{border:"#D2E5FF",background:"#2B7CE9"}},{border:"#399605",background:"#255C03",highlight:{border:"#399605",background:"#255C03"},hover:{border:"#399605",background:"#255C03"}},{border:"#B70054",background:"#FF007E",highlight:{border:"#B70054",background:"#FF007E"},hover:{border:"#B70054",background:"#FF007E"}},{border:"#AD85E4",background:"#7C29F0",highlight:{border:"#D3BDF0",background:"#7C29F0"},hover:{border:"#D3BDF0",background:"#7C29F0"}},{border:"#4557FA",background:"#000EA1",highlight:{border:"#6E6EFD",background:"#000EA1"},hover:{border:"#6E6EFD",background:"#000EA1"}},{border:"#FFC0CB",background:"#FD5A77",highlight:{border:"#FFD1D9",background:"#FD5A77"},hover:{border:"#FFD1D9",background:"#FD5A77"}},{border:"#C2FABC",background:"#74D66A",highlight:{border:"#E6FFE3",background:"#74D66A"},hover:{border:"#E6FFE3",background:"#74D66A"}},{border:"#EE0000",background:"#990000",highlight:{border:"#FF3333",background:"#BB0000"},hover:{border:"#FF3333",background:"#BB0000"}}],this.options={},this.defaultOptions={useDefaultGroups:!0},d.extend(this.options,this.defaultOptions)}return(0,a.default)(e,[{key:"setOptions",value:function(e){var t=["useDefaultGroups"];if(void 0!==e)for(var i in e)if(e.hasOwnProperty(i)&&-1===t.indexOf(i)){var n=e[i];this.add(i,n)}}},{key:"clear",value:function(){this.groups={},this.groupsArray=[]}},{key:"get",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.groups[e];if(void 0===i&&t)if(!1===this.options.useDefaultGroups&&this.groupsArray.length>0){var n=this.groupIndex%this.groupsArray.length;this.groupIndex++,i={},i.color=this.groups[this.groupsArray[n]],this.groups[e]=i}else{var o=this.defaultIndex%this.defaultGroups.length;this.defaultIndex++,i={},i.color=this.defaultGroups[o],this.groups[e]=i}return i}},{key:"add",value:function(e,t){return this.groups[e]=t,this.groupsArray.push(e),t}}]),e}();t.default=h},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(0),s=n(o),r=i(1),a=n(r),d=i(5),h=i(32),l=i(51),u=i(33).default,c=function(){function e(t,i,n,o){var r=this;if((0,s.default)(this,e),this.body=t,this.images=i,this.groups=n,this.layoutEngine=o,this.body.functions.createNode=this.create.bind(this),this.nodesListeners={add:function(e,t){r.add(t.items)},update:function(e,t){r.update(t.items,t.data,t.oldData)},remove:function(e,t){r.remove(t.items)}},this.defaultOptions={borderWidth:1,borderWidthSelected:2,brokenImage:void 0,color:{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},fixed:{x:!1,y:!1},font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:0,strokeColor:"#ffffff",align:"center",vadjust:0,multi:!1,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"monospace",vadjust:2}},group:void 0,hidden:!1,icon:{face:"FontAwesome",code:void 0,size:50,color:"#2B7CE9"},image:void 0,label:void 0,labelHighlightBold:!0,level:void 0,margin:{top:5,right:5,bottom:5,left:5},mass:1,physics:!0,scaling:{min:10,max:30,label:{enabled:!1,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(e,t,i,n){if(t===e)return.5;var o=1/(t-e);return Math.max(0,(n-e)*o)}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},shape:"ellipse",shapeProperties:{borderDashes:!1,borderRadius:6,interpolation:!0,useImageSize:!1,useBorderWithImage:!1},size:25,title:void 0,value:void 0,x:void 0,y:void 0},this.defaultOptions.mass<=0)throw"Internal error: mass in defaultOptions of NodesHandler may not be zero or negative";this.options=d.bridgeObject(this.defaultOptions),this.bindEventListeners()}return(0,a.default)(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("refreshNodes",this.refresh.bind(this)),this.body.emitter.on("refresh",this.refresh.bind(this)),this.body.emitter.on("destroy",function(){d.forEach(e.nodesListeners,function(t,i){e.body.data.nodes&&e.body.data.nodes.off(i,t)}),delete e.body.functions.createNode,delete e.nodesListeners.add,delete e.nodesListeners.update,delete e.nodesListeners.remove,delete e.nodesListeners})}},{key:"setOptions",value:function(e){if(void 0!==e){if(u.parseOptions(this.options,e),void 0!==e.shape)for(var t in this.body.nodes)this.body.nodes.hasOwnProperty(t)&&this.body.nodes[t].updateShape();if(void 0!==e.font)for(var i in this.body.nodes)this.body.nodes.hasOwnProperty(i)&&(this.body.nodes[i].updateLabelModule(),this.body.nodes[i].needsRefresh());if(void 0!==e.size)for(var n in this.body.nodes)this.body.nodes.hasOwnProperty(n)&&this.body.nodes[n].needsRefresh();void 0===e.hidden&&void 0===e.physics||this.body.emitter.emit("_dataChanged")}}},{key:"setData",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.body.data.nodes;if(e instanceof h||e instanceof l)this.body.data.nodes=e;else if(Array.isArray(e))this.body.data.nodes=new h,this.body.data.nodes.add(e);else{if(e)throw new TypeError("Array or DataSet expected");this.body.data.nodes=new h}if(i&&d.forEach(this.nodesListeners,function(e,t){i.off(t,e)}),this.body.nodes={},this.body.data.nodes){var n=this;d.forEach(this.nodesListeners,function(e,t){n.body.data.nodes.on(t,e)});var o=this.body.data.nodes.getIds();this.add(o,!0)}!1===t&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=void 0,n=[],o=0;o<e.length;o++){i=e[o];var s=this.body.data.nodes.get(i),r=this.create(s);n.push(r),this.body.nodes[i]=r}this.layoutEngine.positionInitially(n),!1===t&&this.body.emitter.emit("_dataChanged")}},{key:"update",value:function(e,t,i){for(var n=this.body.nodes,o=!1,s=0;s<e.length;s++){var r=e[s],a=n[r],d=t[s];void 0!==a?a.setOptions(d)&&(o=!0):(o=!0,a=this.create(d),n[r]=a)}o||void 0===i||(o=t.some(function(e,t){var n=i[t];return n&&n.level!==e.level})),!0===o?this.body.emitter.emit("_dataChanged"):this.body.emitter.emit("_dataUpdated")}},{key:"remove",value:function(e){for(var t=this.body.nodes,i=0;i<e.length;i++){delete t[e[i]]}this.body.emitter.emit("_dataChanged")}},{key:"create",value:function(e){return new(arguments.length>1&&void 0!==arguments[1]?arguments[1]:u)(e,this.body,this.images,this.groups,this.options,this.defaultOptions)}},{key:"refresh",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];d.forEach(this.body.nodes,function(i,n){var o=e.body.data.nodes.get(n);void 0!==o&&(!0===t&&i.setOptions({x:null,y:null}),i.setOptions({fixed:!1}),i.setOptions(o))})}},{key:"getPositions",value:function(e){var t={};if(void 0!==e){if(!0===Array.isArray(e)){for(var i=0;i<e.length;i++)if(void 0!==this.body.nodes[e[i]]){var n=this.body.nodes[e[i]];t[e[i]]={x:Math.round(n.x),y:Math.round(n.y)}}}else if(void 0!==this.body.nodes[e]){var o=this.body.nodes[e];t[e]={x:Math.round(o.x),y:Math.round(o.y)}}}else for(var s=0;s<this.body.nodeIndices.length;s++){var r=this.body.nodes[this.body.nodeIndices[s]];t[this.body.nodeIndices[s]]={x:Math.round(r.x),y:Math.round(r.y)}}return t}},{key:"storePositions",value:function(){var e=[],t=this.body.data.nodes.getDataSet();for(var i in t._data)if(t._data.hasOwnProperty(i)){var n=this.body.nodes[i];t._data[i].x==Math.round(n.x)&&t._data[i].y==Math.round(n.y)||e.push({id:n.id,x:Math.round(n.x),y:Math.round(n.y)})}t.update(e)}},{key:"getBoundingBox",value:function(e){if(void 0!==this.body.nodes[e])return this.body.nodes[e].shape.boundingBox}},{key:"getConnectedNodes",value:function(e,t){var i=[];if(void 0!==this.body.nodes[e])for(var n=this.body.nodes[e],o={},s=0;s<n.edges.length;s++){var r=n.edges[s];"to"!==t&&r.toId==n.id?void 0===o[r.fromId]&&(i.push(r.fromId),o[r.fromId]=!0):"from"!==t&&r.fromId==n.id&&void 0===o[r.toId]&&(i.push(r.toId),o[r.toId]=!0)}return i}},{key:"getConnectedEdges",value:function(e){var t=[];if(void 0!==this.body.nodes[e])for(var i=this.body.nodes[e],n=0;n<i.edges.length;n++)t.push(i.edges[n].id);else console.log("NodeId provided for getConnectedEdges does not exist. Provided: ",e);return t}},{key:"moveNode",value:function(e,t,i){var n=this;void 0!==this.body.nodes[e]?(this.body.nodes[e].x=Number(t),this.body.nodes[e].y=Number(i),setTimeout(function(){n.body.emitter.emit("startSimulation")},0)):console.log("Node id supplied to moveNode does not exist. Provided: ",e)}}]),e}();t.default=c},function(e,t,i){e.exports={default:i(134),__esModule:!0}},function(e,t,i){i(36),i(47),e.exports=i(135)},function(e,t,i){var n=i(67),o=i(8)("iterator"),s=i(24);e.exports=i(6).isIterable=function(e){var t=Object(e);return void 0!==t[o]||"@@iterator"in t||s.hasOwnProperty(n(t))}},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(0),s=n(o),r=i(1),a=n(r),d=i(137).default,h=i(34).default,l=function(){function e(t,i,n,o){var r=this;(0,s.default)(this,e),this.ctx=t,this.parent=i;var a=function(e,i){if(void 0===e)return 0;var s=r.parent.getFormattingValues(t,n,o,i),a=0;if(""!==e){a=r.ctx.measureText(e).width}return{width:a,values:s}};this.lines=new d(a)}return(0,a.default)(e,[{key:"process",value:function(e){if(!h.isValidLabel(e))return this.lines.finalize();var t=this.parent.fontOptions;e=e.replace(/\r\n/g,"\n"),e=e.replace(/\r/g,"\n");var i=String(e).split("\n"),n=i.length;if(t.multi)for(var o=0;o<n;o++){var s=this.splitBlocks(i[o],t.multi);if(void 0!==s)if(0!==s.length){if(t.maxWdt>0)for(var r=0;r<s.length;r++){var a=s[r].mod,d=s[r].text;this.splitStringIntoLines(d,a,!0)}else for(var l=0;l<s.length;l++){var u=s[l].mod,c=s[l].text;this.lines.append(c,u)}this.lines.newLine()}else this.lines.newLine("")}else if(t.maxWdt>0)for(var f=0;f<n;f++)this.splitStringIntoLines(i[f]);else for(var p=0;p<n;p++)this.lines.newLine(i[p]);return this.lines.finalize()}},{key:"decodeMarkupSystem",value:function(e){var t="none";return"markdown"===e||"md"===e?t="markdown":!0!==e&&"html"!==e||(t="html"),t}},{key:"splitHtmlBlocks",value:function(e){var t=[],i={bold:!1,ital:!1,mono:!1,spacing:!1,position:0,buffer:"",modStack:[]};for(i.mod=function(){return 0===this.modStack.length?"normal":this.modStack[0]},i.modName=function(){return 0===this.modStack.length?"normal":"mono"===this.modStack[0]?"mono":i.bold&&i.ital?"boldital":i.bold?"bold":i.ital?"ital":void 0},i.emitBlock=function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.spacing&&(this.add(" "),this.spacing=!1),this.buffer.length>0&&(t.push({text:this.buffer,mod:this.modName()}),this.buffer="")},i.add=function(e){" "===e&&(i.spacing=!0),i.spacing&&(this.buffer+=" ",this.spacing=!1)," "!=e&&(this.buffer+=e)};i.position<e.length;){var n=e.charAt(i.position);/[ \t]/.test(n)?i.mono?i.add(n):i.spacing=!0:/</.test(n)?i.mono||i.bold||!/<b>/.test(e.substr(i.position,3))?i.mono||i.ital||!/<i>/.test(e.substr(i.position,3))?!i.mono&&/<code>/.test(e.substr(i.position,6))?(i.emitBlock(),i.mono=!0,i.modStack.unshift("mono"),i.position+=5):!i.mono&&"bold"===i.mod()&&/<\/b>/.test(e.substr(i.position,4))?(i.emitBlock(),i.bold=!1,i.modStack.shift(),i.position+=3):!i.mono&&"ital"===i.mod()&&/<\/i>/.test(e.substr(i.position,4))?(i.emitBlock(),i.ital=!1,i.modStack.shift(),i.position+=3):"mono"===i.mod()&&/<\/code>/.test(e.substr(i.position,7))?(i.emitBlock(),i.mono=!1,i.modStack.shift(),i.position+=6):i.add(n):(i.emitBlock(),i.ital=!0,i.modStack.unshift("ital"),i.position+=2):(i.emitBlock(),i.bold=!0,i.modStack.unshift("bold"),i.position+=2):/&/.test(n)?/</.test(e.substr(i.position,4))?(i.add("<"),i.position+=3):/&/.test(e.substr(i.position,5))?(i.add("&"),i.position+=4):i.add("&"):i.add(n),i.position++}return i.emitBlock(),t}},{key:"splitMarkdownBlocks",value:function(e){var t=[],i={bold:!1,ital:!1,mono:!1,beginable:!0,spacing:!1,position:0,buffer:"",modStack:[]};for(i.mod=function(){return 0===this.modStack.length?"normal":this.modStack[0]},i.modName=function(){return 0===this.modStack.length?"normal":"mono"===this.modStack[0]?"mono":i.bold&&i.ital?"boldital":i.bold?"bold":i.ital?"ital":void 0},i.emitBlock=function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.spacing&&(this.add(" "),this.spacing=!1),this.buffer.length>0&&(t.push({text:this.buffer,mod:this.modName()}),this.buffer="")},i.add=function(e){" "===e&&(i.spacing=!0),i.spacing&&(this.buffer+=" ",this.spacing=!1)," "!=e&&(this.buffer+=e)};i.position<e.length;){var n=e.charAt(i.position);/[ \t]/.test(n)?(i.mono?i.add(n):i.spacing=!0,i.beginable=!0):/\\/.test(n)?i.position<e.length+1&&(i.position++,n=e.charAt(i.position),/ \t/.test(n)?i.spacing=!0:(i.add(n),i.beginable=!1)):i.mono||i.bold||!i.beginable&&!i.spacing||!/\*/.test(n)?i.mono||i.ital||!i.beginable&&!i.spacing||!/\_/.test(n)?!i.mono&&(i.beginable||i.spacing)&&/`/.test(n)?(i.emitBlock(),i.mono=!0,i.modStack.unshift("mono")):!i.mono&&"bold"===i.mod()&&/\*/.test(n)?i.position===e.length-1||/[.,_` \t\n]/.test(e.charAt(i.position+1))?(i.emitBlock(),i.bold=!1,i.modStack.shift()):i.add(n):!i.mono&&"ital"===i.mod()&&/\_/.test(n)?i.position===e.length-1||/[.,*` \t\n]/.test(e.charAt(i.position+1))?(i.emitBlock(),i.ital=!1,i.modStack.shift()):i.add(n):i.mono&&"mono"===i.mod()&&/`/.test(n)?i.position===e.length-1||/[.,*_ \t\n]/.test(e.charAt(i.position+1))?(i.emitBlock(),i.mono=!1,i.modStack.shift()):i.add(n):(i.add(n),i.beginable=!1):(i.emitBlock(),i.ital=!0,i.modStack.unshift("ital")):(i.emitBlock(),i.bold=!0,i.modStack.unshift("bold")),i.position++}return i.emitBlock(),t}},{key:"splitBlocks",value:function(e,t){var i=this.decodeMarkupSystem(t);return"none"===i?[{text:e,mod:"normal"}]:"markdown"===i?this.splitMarkdownBlocks(e):"html"===i?this.splitHtmlBlocks(e):void 0}},{key:"overMaxWidth",value:function(e){var t=this.ctx.measureText(e).width;return this.lines.curWidth()+t>this.parent.fontOptions.maxWdt}},{key:"getLongestFit",value:function(e){for(var t="",i=0;i<e.length;){var n=""===t?"":" ",o=t+n+e[i];if(this.overMaxWidth(o))break;t=o,i++}return i}},{key:"getLongestFitWord",value:function(e){for(var t=0;t<e.length&&!this.overMaxWidth(e.slice(0,t));)t++;return t}},{key:"splitStringIntoLines",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"normal",i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e=e.replace(/^( +)/g,"$1\r"),e=e.replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r");for(var n=e.split("\r");n.length>0;){var o=this.getLongestFit(n);if(0===o){var s=n[0],r=this.getLongestFitWord(s);this.lines.newLine(s.slice(0,r),t),n[0]=s.slice(r)}else{var a=o;" "===n[o-1]?o--:" "===n[a]&&a++;var d=n.slice(0,o).join("");o==n.length&&i?this.lines.append(d,t):this.lines.newLine(d,t),n=n.slice(a)}}}}]),e}();t.default=l},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(138),s=n(o),r=i(0),a=n(r),d=i(1),h=n(d),l=function(){function e(t){(0,a.default)(this,e),this.measureText=t,this.current=0,this.width=0,this.height=0,this.lines=[]}return(0,h.default)(e,[{key:"_add",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"normal";void 0===this.lines[e]&&(this.lines[e]={width:0,height:0,blocks:[]});var n=t;void 0!==t&&""!==t||(n=" ");var o=this.measureText(n,i),r=(0,s.default)({},o.values);r.text=t,r.width=o.width,r.mod=i,void 0!==t&&""!==t||(r.width=0),this.lines[e].blocks.push(r),this.lines[e].width+=r.width}},{key:"curWidth",value:function(){var e=this.lines[this.current];return void 0===e?0:e.width}},{key:"append",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"normal";this._add(this.current,e,t)}},{key:"newLine",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"normal";this._add(this.current,e,t),this.current++}},{key:"determineLineHeights",value:function(){for(var e=0;e<this.lines.length;e++){var t=this.lines[e],i=0;if(void 0!==t.blocks)for(var n=0;n<t.blocks.length;n++){var o=t.blocks[n];i<o.height&&(i=o.height)}t.height=i}}},{key:"determineLabelSize",value:function(){for(var e=0,t=0,i=0;i<this.lines.length;i++){var n=this.lines[i];n.width>e&&(e=n.width),t+=n.height}this.width=e,this.height=t}},{key:"removeEmptyBlocks",value:function(){for(var e=[],t=0;t<this.lines.length;t++){var i=this.lines[t];if(0!==i.blocks.length&&(t!==this.lines.length-1||0!==i.width)){var n={};(0,s.default)(n,i),n.blocks=[];for(var o=void 0,r=[],a=0;a<i.blocks.length;a++){var d=i.blocks[a];0!==d.width?r.push(d):void 0===o&&(o=d)}0===r.length&&void 0!==o&&r.push(o),n.blocks=r,e.push(n)}}return e}},{key:"finalize",value:function(){this.determineLineHeights(),this.determineLabelSize();var e=this.removeEmptyBlocks();return{width:this.width,height:this.height,lines:e}}}]),e}();t.default=l},function(e,t,i){e.exports={default:i(139),__esModule:!0}},function(e,t,i){i(140),e.exports=i(6).Object.assign},function(e,t,i){var n=i(11);n(n.S+n.F,"Object",{assign:i(141)})},function(e,t,i){var n=i(26),o=i(50),s=i(31),r=i(29),a=i(59),d=Object.assign;e.exports=!d||i(20)(function(){var e={},t={},i=Symbol(),n="abcdefghijklmnopqrst";return e[i]=7,n.split("").forEach(function(e){t[e]=e}),7!=d({},e)[i]||Object.keys(d({},t)).join("")!=n})?function(e,t){for(var i=r(e),d=arguments.length,h=1,l=o.f,u=s.f;d>h;)for(var c,f=a(arguments[h++]),p=l?n(f).concat(l(f)):n(f),v=p.length,g=0;v>g;)u.call(f,c=p[g++])&&(i[c]=f[c]);return i}:d},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(2),s=n(o),r=i(0),a=n(r),d=i(1),h=n(d),l=i(3),u=n(l),c=i(4),f=n(c),p=i(15),v=n(p),g=function(e){function t(e,i,n){(0,a.default)(this,t);var o=(0,u.default)(this,(t.__proto__||(0,s.default)(t)).call(this,e,i,n));return o._setMargins(n),o}return(0,f.default)(t,e),(0,h.default)(t,[{key:"resize",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(this.needsRefresh(t,i)){var n=this.getDimensionsFromLabel(e,t,i);this.width=n.width+this.margin.right+this.margin.left,this.height=n.height+this.margin.top+this.margin.bottom,this.radius=this.width/2}}},{key:"draw",value:function(e,t,i,n,o,s){this.resize(e,n,o),this.left=t-this.width/2,this.top=i-this.height/2,this.initContextForDraw(e,s),e.roundRect(this.left,this.top,this.width,this.height,s.borderRadius),this.performFill(e,s),this.updateBoundingBox(t,i,e,n,o),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,n,o)}},{key:"updateBoundingBox",value:function(e,t,i,n,o){this._updateBoundingBox(e,t,i,n,o);var s=this.options.shapeProperties.borderRadius;this._addBoundingBoxMargin(s)}},{key:"distanceToBorder",value:function(e,t){this.resize(e);var i=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(t)),Math.abs(this.height/2/Math.sin(t)))+i}}]),t}(v.default);t.default=g},function(e,t,i){i(144),e.exports=i(6).Object.getPrototypeOf},function(e,t,i){var n=i(29),o=i(66);i(68)("getPrototypeOf",function(){return function(e){return o(n(e))}})},function(e,t,i){e.exports={default:i(146),__esModule:!0}},function(e,t,i){i(147),e.exports=i(6).Object.setPrototypeOf},function(e,t,i){var n=i(11);n(n.S,"Object",{setPrototypeOf:i(148).set})},function(e,t,i){var n=i(25),o=i(19),s=function(e,t){if(o(e),!n(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,n){try{n=i(61)(Function.call,i(70).f(Object.prototype,"__proto__").set,2),n(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,i){return s(e,i),t?e.__proto__=i:n(e,i),e}}({},!1):void 0),check:s}},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(2),s=n(o),r=i(0),a=n(r),d=i(1),h=n(d),l=i(3),u=n(l),c=i(4),f=n(c),p=i(53),v=n(p),g=function(e){function t(e,i,n){(0,a.default)(this,t);var o=(0,u.default)(this,(t.__proto__||(0,s.default)(t)).call(this,e,i,n));return o._setMargins(n),o}return(0,f.default)(t,e),(0,h.default)(t,[{key:"resize",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(this.needsRefresh(t,i)){var n=this.getDimensionsFromLabel(e,t,i),o=Math.max(n.width+this.margin.right+this.margin.left,n.height+this.margin.top+this.margin.bottom);this.options.size=o/2,this.width=o,this.height=o,this.radius=this.width/2}}},{key:"draw",value:function(e,t,i,n,o,s){this.resize(e,n,o),this.left=t-this.width/2,this.top=i-this.height/2,this._drawRawCircle(e,t,i,s),this.updateBoundingBox(t,i),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,i,n,o)}},{key:"updateBoundingBox",value:function(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size}},{key:"distanceToBorder",value:function(e,t){return this.resize(e),.5*this.width}}]),t}(v.default);t.default=g},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(2),s=n(o),r=i(0),a=n(r),d=i(1),h=n(d),l=i(3),u=n(l),c=i(4),f=n(c),p=i(53),v=n(p),g=function(e){function t(e,i,n,o,r){(0,a.default)(this,t);var d=(0,u.default)(this,(t.__proto__||(0,s.default)(t)).call(this,e,i,n));return d.setImages(o,r),d}return(0,f.default)(t,e),(0,h.default)(t,[{key:"resize",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(void 0===this.imageObj.src||void 0===this.imageObj.width||void 0===this.imageObj.height){var n=2*this.options.size;return this.width=n,this.height=n,void(this.radius=.5*this.width)}this.needsRefresh(t,i)&&this._resizeImage()}},{key:"draw",value:function(e,t,i,n,o,s){this.switchImages(n),this.resize(),this.left=t-this.width/2,this.top=i-this.height/2,this._drawRawCircle(e,t,i,s),e.save(),e.clip(),this._drawImageAtPosition(e,s),e.restore(),this._drawImageLabel(e,t,i,n,o),this.updateBoundingBox(t,i)}},{key:"updateBoundingBox",value:function(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size,this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset)}},{key:"distanceToBorder",value:function(e,t){return this.resize(e),.5*this.width}}]),t}(v.default);t.default=g},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(2),s=n(o),r=i(0),a=n(r),d=i(1),h=n(d),l=i(3),u=n(l),c=i(4),f=n(c),p=i(15),v=n(p),g=function(e){function t(e,i,n){(0,a.default)(this,t);var o=(0,u.default)(this,(t.__proto__||(0,s.default)(t)).call(this,e,i,n));return o._setMargins(n),o}return(0,f.default)(t,e),(0,h.default)(t,[{key:"resize",value:function(e,t,i){if(this.needsRefresh(t,i)){var n=this.getDimensionsFromLabel(e,t,i),o=n.width+this.margin.right+this.margin.left;this.width=o,this.height=o,this.radius=this.width/2}}},{key:"draw",value:function(e,t,i,n,o,s){this.resize(e,n,o),this.left=t-this.width/2,this.top=i-this.height/2,this.initContextForDraw(e,s),e.database(t-this.width/2,i-this.height/2,this.width,this.height),this.performFill(e,s),this.updateBoundingBox(t,i,e,n,o),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,n,o)}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(v.default);t.default=g},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(2),s=n(o),r=i(0),a=n(r),d=i(1),h=n(d),l=i(3),u=n(l),c=i(4),f=n(c),p=i(16),v=n(p),g=function(e){function t(e,i,n){return(0,a.default)(this,t),(0,u.default)(this,(t.__proto__||(0,s.default)(t)).call(this,e,i,n))}return(0,f.default)(t,e),(0,h.default)(t,[{key:"draw",value:function(e,t,i,n,o,s){this._drawShape(e,"diamond",4,t,i,n,o,s)}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(v.default);t.default=g},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(2),s=n(o),r=i(0),a=n(r),d=i(1),h=n(d),l=i(3),u=n(l),c=i(4),f=n(c),p=i(16),v=n(p),g=function(e){function t(e,i,n){return(0,a.default)(this,t),(0,u.default)(this,(t.__proto__||(0,s.default)(t)).call(this,e,i,n))}return(0,f.default)(t,e),(0,h.default)(t,[{key:"draw",value:function(e,t,i,n,o,s){this._drawShape(e,"circle",2,t,i,n,o,s)}},{key:"distanceToBorder",value:function(e,t){return this.resize(e),this.options.size}}]),t}(v.default);t.default=g},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(2),s=n(o),r=i(0),a=n(r),d=i(1),h=n(d),l=i(3),u=n(l),c=i(4),f=n(c),p=i(15),v=n(p),g=function(e){function t(e,i,n){return(0,a.default)(this,t),(0,u.default)(this,(t.__proto__||(0,s.default)(t)).call(this,e,i,n))}return(0,f.default)(t,e),(0,h.default)(t,[{key:"resize",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(this.needsRefresh(t,i)){var n=this.getDimensionsFromLabel(e,t,i);this.height=2*n.height,this.width=n.width+n.height,this.radius=.5*this.width}}},{key:"draw",value:function(e,t,i,n,o,s){this.resize(e,n,o),this.left=t-.5*this.width,this.top=i-.5*this.height,this.initContextForDraw(e,s),e.ellipse_vis(this.left,this.top,this.width,this.height),this.performFill(e,s),this.updateBoundingBox(t,i,e,n,o),this.labelModule.draw(e,t,i,n,o)}},{key:"distanceToBorder",value:function(e,t){this.resize(e);var i=.5*this.width,n=.5*this.height,o=Math.sin(t)*i,s=Math.cos(t)*n;return i*n/Math.sqrt(o*o+s*s)}}]),t}(v.default);t.default=g},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(2),s=n(o),r=i(0),a=n(r),d=i(1),h=n(d),l=i(3),u=n(l),c=i(4),f=n(c),p=i(15),v=n(p),g=function(e){function t(e,i,n){(0,a.default)(this,t);var o=(0,u.default)(this,(t.__proto__||(0,s.default)(t)).call(this,e,i,n));return o._setMargins(n),o}return(0,f.default)(t,e),(0,h.default)(t,[{key:"resize",value:function(e,t,i){this.needsRefresh(t,i)&&(this.iconSize={width:Number(this.options.icon.size),height:Number(this.options.icon.size)},this.width=this.iconSize.width+this.margin.right+this.margin.left,this.height=this.iconSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}},{key:"draw",value:function(e,t,i,n,o,s){if(this.resize(e,n,o),this.options.icon.size=this.options.icon.size||50,this.left=t-this.width/2,this.top=i-this.height/2,this._icon(e,t,i,n,o,s),void 0!==this.options.label){this.labelModule.draw(e,this.left+this.iconSize.width/2+this.margin.left,i+this.height/2+5,n)}this.updateBoundingBox(t,i)}},{key:"updateBoundingBox",value:function(e,t){if(this.boundingBox.top=t-.5*this.options.icon.size,this.boundingBox.left=e-.5*this.options.icon.size,this.boundingBox.right=e+.5*this.options.icon.size,this.boundingBox.bottom=t+.5*this.options.icon.size,void 0!==this.options.label&&this.labelModule.size.width>0){this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+5)}}},{key:"_icon",value:function(e,t,i,n,o,s){var r=Number(this.options.icon.size);void 0!==this.options.icon.code?(e.font=(n?"bold ":"")+r+"px "+this.options.icon.face,e.fillStyle=this.options.icon.color||"black",e.textAlign="center",e.textBaseline="middle",this.enableShadow(e,s),e.fillText(this.options.icon.code,t,i),this.disableShadow(e,s)):console.error("When using the icon shape, you need to define the code in the icon options object. This can be done per node or globally.")}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(v.default);t.default=g},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(2),s=n(o),r=i(0),a=n(r),d=i(1),h=n(d),l=i(3),u=n(l),c=i(4),f=n(c),p=i(53),v=n(p),g=function(e){function t(e,i,n,o,r){(0,a.default)(this,t);var d=(0,u.default)(this,(t.__proto__||(0,s.default)(t)).call(this,e,i,n));return d.setImages(o,r),d}return(0,f.default)(t,e),(0,h.default)(t,[{key:"resize",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(void 0===this.imageObj.src||void 0===this.imageObj.width||void 0===this.imageObj.height){var n=2*this.options.size;return this.width=n,void(this.height=n)}this.needsRefresh(t,i)&&this._resizeImage()}},{key:"draw",value:function(e,t,i,n,o,s){if(this.switchImages(n),this.resize(),this.left=t-this.width/2,this.top=i-this.height/2,!0===this.options.shapeProperties.useBorderWithImage){var r=this.options.borderWidth,a=this.options.borderWidthSelected||2*this.options.borderWidth,d=(n?a:r)/this.body.view.scale;e.lineWidth=Math.min(this.width,d),e.beginPath(),e.strokeStyle=n?this.options.color.highlight.border:o?this.options.color.hover.border:this.options.color.border,e.fillStyle=n?this.options.color.highlight.background:o?this.options.color.hover.background:this.options.color.background,e.rect(this.left-.5*e.lineWidth,this.top-.5*e.lineWidth,this.width+e.lineWidth,this.height+e.lineWidth),e.fill(),this.performStroke(e,s),e.closePath()}this._drawImageAtPosition(e,s),this._drawImageLabel(e,t,i,n,o),this.updateBoundingBox(t,i)}},{key:"updateBoundingBox",value:function(e,t){this.resize(),this._updateBoundingBox(e,t),void 0!==this.options.label&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset))}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(v.default);t.default=g},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(2),s=n(o),r=i(0),a=n(r),d=i(1),h=n(d),l=i(3),u=n(l),c=i(4),f=n(c),p=i(16),v=n(p),g=function(e){function t(e,i,n){return(0,a.default)(this,t),(0,u.default)(this,(t.__proto__||(0,s.default)(t)).call(this,e,i,n))}return(0,f.default)(t,e),(0,h.default)(t,[{key:"draw",value:function(e,t,i,n,o,s){this._drawShape(e,"square",2,t,i,n,o,s)}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(v.default);t.default=g},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(2),s=n(o),r=i(0),a=n(r),d=i(1),h=n(d),l=i(3),u=n(l),c=i(4),f=n(c),p=i(16),v=n(p),g=function(e){function t(e,i,n){return(0,a.default)(this,t),(0,u.default)(this,(t.__proto__||(0,s.default)(t)).call(this,e,i,n))}return(0,f.default)(t,e),(0,h.default)(t,[{key:"draw",value:function(e,t,i,n,o,s){this._drawShape(e,"hexagon",4,t,i,n,o,s)}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(v.default);t.default=g},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(2),s=n(o),r=i(0),a=n(r),d=i(1),h=n(d),l=i(3),u=n(l),c=i(4),f=n(c),p=i(16),v=n(p),g=function(e){function t(e,i,n){return(0,a.default)(this,t),(0,u.default)(this,(t.__proto__||(0,s.default)(t)).call(this,e,i,n))}return(0,f.default)(t,e),(0,h.default)(t,[{key:"draw",value:function(e,t,i,n,o,s){this._drawShape(e,"star",4,t,i,n,o,s)}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(v.default);t.default=g},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(2),s=n(o),r=i(0),a=n(r),d=i(1),h=n(d),l=i(3),u=n(l),c=i(4),f=n(c),p=i(15),v=n(p),g=function(e){function t(e,i,n){(0,a.default)(this,t);var o=(0,u.default)(this,(t.__proto__||(0,s.default)(t)).call(this,e,i,n));return o._setMargins(n),o}return(0,f.default)(t,e),(0,h.default)(t,[{key:"resize",value:function(e,t,i){this.needsRefresh(t,i)&&(this.textSize=this.labelModule.getTextSize(e,t,i),this.width=this.textSize.width+this.margin.right+this.margin.left,this.height=this.textSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}},{key:"draw",value:function(e,t,i,n,o,s){this.resize(e,n,o),this.left=t-this.width/2,this.top=i-this.height/2,this.enableShadow(e,s),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,n,o),this.disableShadow(e,s),this.updateBoundingBox(t,i,e,n,o)}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(v.default);t.default=g},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(2),s=n(o),r=i(0),a=n(r),d=i(1),h=n(d),l=i(3),u=n(l),c=i(4),f=n(c),p=i(16),v=n(p),g=function(e){function t(e,i,n){return(0,a.default)(this,t),(0,u.default)(this,(t.__proto__||(0,s.default)(t)).call(this,e,i,n))}return(0,f.default)(t,e),(0,h.default)(t,[{key:"draw",value:function(e,t,i,n,o,s){this._drawShape(e,"triangle",3,t,i,n,o,s)}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(v.default);t.default=g},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(2),s=n(o),r=i(0),a=n(r),d=i(1),h=n(d),l=i(3),u=n(l),c=i(4),f=n(c),p=i(16),v=n(p),g=function(e){function t(e,i,n){return(0,a.default)(this,t),(0,u.default)(this,(t.__proto__||(0,s.default)(t)).call(this,e,i,n))}return(0,f.default)(t,e),(0,h.default)(t,[{key:"draw",value:function(e,t,i,n,o,s){this._drawShape(e,"triangleDown",3,t,i,n,o,s)}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(v.default);t.default=g},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(0),s=n(o),r=i(1),a=n(r),d=i(5),h=i(32),l=i(51),u=i(55).default,c=function(){function e(t,i,n){var o=this;(0,s.default)(this,e),this.body=t,this.images=i,this.groups=n,this.body.functions.createEdge=this.create.bind(this),this.edgesListeners={add:function(e,t){o.add(t.items)},update:function(e,t){o.update(t.items)},remove:function(e,t){o.remove(t.items)}},this.options={},this.defaultOptions={arrows:{to:{enabled:!1,scaleFactor:1,type:"arrow"},middle:{enabled:!1,scaleFactor:1,type:"arrow"},from:{enabled:!1,scaleFactor:1,type:"arrow"}},arrowStrikethrough:!0,color:{color:"#848484",highlight:"#848484",hover:"#848484",inherit:"from",opacity:1},dashes:!1,font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:2,strokeColor:"#ffffff",align:"horizontal",multi:!1,vadjust:0,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"courier new",vadjust:2}},hidden:!1,hoverWidth:1.5,label:void 0,labelHighlightBold:!0,length:void 0,physics:!0,scaling:{min:1,max:15,label:{enabled:!0,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(e,t,i,n){if(t===e)return.5;var o=1/(t-e);return Math.max(0,(n-e)*o)}},selectionWidth:1.5,selfReferenceSize:20,shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},smooth:{enabled:!0,type:"dynamic",forceDirection:"none",roundness:.5},title:void 0,width:1,value:void 0},d.deepExtend(this.options,this.defaultOptions),this.bindEventListeners()}return(0,a.default)(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("_forceDisableDynamicCurves",function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];"dynamic"===t&&(t="continuous");var n=!1;for(var o in e.body.edges)if(e.body.edges.hasOwnProperty(o)){var s=e.body.edges[o],r=e.body.data.edges._data[o];if(void 0!==r){var a=r.smooth;void 0!==a&&!0===a.enabled&&"dynamic"===a.type&&(void 0===t?s.setOptions({smooth:!1}):s.setOptions({smooth:{type:t}}),n=!0)}}!0===i&&!0===n&&e.body.emitter.emit("_dataChanged")}),this.body.emitter.on("_dataUpdated",function(){e.reconnectEdges()}),this.body.emitter.on("refreshEdges",this.refresh.bind(this)),this.body.emitter.on("refresh",this.refresh.bind(this)),this.body.emitter.on("destroy",function(){d.forEach(e.edgesListeners,function(t,i){e.body.data.edges&&e.body.data.edges.off(i,t)}),delete e.body.functions.createEdge,delete e.edgesListeners.add,delete e.edgesListeners.update,delete e.edgesListeners.remove,delete e.edgesListeners})}},{key:"setOptions",value:function(e){if(void 0!==e){u.parseOptions(this.options,e,!0,this.defaultOptions,!0);var t=!1;if(void 0!==e.smooth)for(var i in this.body.edges)this.body.edges.hasOwnProperty(i)&&(t=this.body.edges[i].updateEdgeType()||t);if(void 0!==e.font)for(var n in this.body.edges)this.body.edges.hasOwnProperty(n)&&this.body.edges[n].updateLabelModule();void 0===e.hidden&&void 0===e.physics&&!0!==t||this.body.emitter.emit("_dataChanged")}}},{key:"setData",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.body.data.edges;if(e instanceof h||e instanceof l)this.body.data.edges=e;else if(Array.isArray(e))this.body.data.edges=new h,this.body.data.edges.add(e);else{if(e)throw new TypeError("Array or DataSet expected");this.body.data.edges=new h}if(n&&d.forEach(this.edgesListeners,function(e,t){n.off(t,e)}),this.body.edges={},this.body.data.edges){d.forEach(this.edgesListeners,function(e,i){t.body.data.edges.on(i,e)});var o=this.body.data.edges.getIds();this.add(o,!0)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),!1===i&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.body.edges,n=this.body.data.edges,o=0;o<e.length;o++){var s=e[o],r=i[s];r&&r.disconnect();var a=n.get(s,{showInternalIds:!0});i[s]=this.create(a)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),!1===t&&this.body.emitter.emit("_dataChanged")}},{key:"update",value:function(e){for(var t=this.body.edges,i=this.body.data.edges,n=!1,o=0;o<e.length;o++){var s=e[o],r=i.get(s),a=t[s];void 0!==a?(a.disconnect(),n=a.setOptions(r)||n,a.connect()):(this.body.edges[s]=this.create(r),n=!0)}!0===n?(this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),this.body.emitter.emit("_dataChanged")):this.body.emitter.emit("_dataUpdated")}},{key:"remove",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(0!==e.length){var i=this.body.edges;d.forEach(e,function(e){var t=i[e];void 0!==t&&t.remove()}),t&&this.body.emitter.emit("_dataChanged")}}},{key:"refresh",value:function(){var e=this;d.forEach(this.body.edges,function(t,i){var n=e.body.data.edges._data[i];void 0!==n&&t.setOptions(n)})}},{key:"create",value:function(e){return new u(e,this.body,this.options,this.defaultOptions)}},{key:"reconnectEdges",value:function(){var e,t=this.body.nodes,i=this.body.edges;for(e in t)t.hasOwnProperty(e)&&(t[e].edges=[]);for(e in i)if(i.hasOwnProperty(e)){var n=i[e];n.from=null,n.to=null,n.connect()}}},{key:"getConnectedNodes",value:function(e){var t=[];if(void 0!==this.body.edges[e]){var i=this.body.edges[e];void 0!==i.fromId&&t.push(i.fromId),void 0!==i.toId&&t.push(i.toId)}return t}},{key:"_updateState",value:function(){this._addMissingEdges(),this._removeInvalidEdges()}},{key:"_removeInvalidEdges",value:function(){var e=this,t=[];d.forEach(this.body.edges,function(i,n){var o=e.body.nodes[i.toId],s=e.body.nodes[i.fromId];void 0!==o&&!0===o.isCluster||void 0!==s&&!0===s.isCluster||void 0!==o&&void 0!==s||t.push(n)}),this.remove(t,!1)}},{key:"_addMissingEdges",value:function(){var e=this.body.edges,t=this.body.data.edges,i=[];t.forEach(function(t,n){void 0===e[n]&&i.push(n)}),this.add(i,!0)}}]),e}();t.default=c},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(23),s=n(o),r=i(2),a=n(r),d=i(0),h=n(d),l=i(1),u=n(l),c=i(3),f=n(c),p=i(4),v=n(p),g=i(165),y=n(g),m=function(e){function t(e,i,n){return(0,h.default)(this,t),(0,f.default)(this,(t.__proto__||(0,a.default)(t)).call(this,e,i,n))}return(0,v.default)(t,e),(0,u.default)(t,[{key:"_line",value:function(e,t,i){var n=i[0],o=i[1];this._bezierCurve(e,t,n,o)}},{key:"_getViaCoordinates",value:function(){var e=this.from.x-this.to.x,t=this.from.y-this.to.y,i=void 0,n=void 0,o=void 0,s=void 0,r=this.options.smooth.roundness;return(Math.abs(e)>Math.abs(t)||!0===this.options.smooth.forceDirection||"horizontal"===this.options.smooth.forceDirection)&&"vertical"!==this.options.smooth.forceDirection?(n=this.from.y,s=this.to.y,i=this.from.x-r*e,o=this.to.x+r*e):(n=this.from.y-r*t,s=this.to.y+r*t,i=this.from.x,o=this.to.x),[{x:i,y:n},{x:o,y:s}]}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_findBorderPosition",value:function(e,t){return this._findBorderPositionBezier(e,t)}},{key:"_getDistanceToEdge",value:function(e,t,i,n,o,r){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:this._getViaCoordinates(),d=(0,s.default)(a,2),h=d[0],l=d[1];return this._getDistanceToBezierEdge(e,t,i,n,o,r,h,l)}},{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._getViaCoordinates(),i=(0,s.default)(t,2),n=i[0],o=i[1],r=e,a=[];return a[0]=Math.pow(1-r,3),a[1]=3*r*Math.pow(1-r,2),a[2]=3*Math.pow(r,2)*(1-r),a[3]=Math.pow(r,3),{x:a[0]*this.fromPoint.x+a[1]*n.x+a[2]*o.x+a[3]*this.toPoint.x,y:a[0]*this.fromPoint.y+a[1]*n.y+a[2]*o.y+a[3]*this.toPoint.y}}}]),t}(y.default);t.default=m},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(2),s=n(o),r=i(0),a=n(r),d=i(1),h=n(d),l=i(3),u=n(l),c=i(4),f=n(c),p=i(56),v=n(p),g=function(e){function t(e,i,n){return(0,a.default)(this,t),(0,u.default)(this,(t.__proto__||(0,s.default)(t)).call(this,e,i,n))}return(0,f.default)(t,e),(0,h.default)(t,[{key:"_getDistanceToBezierEdge",value:function(e,t,i,n,o,s,r,a){var d=1e9,h=void 0,l=void 0,u=void 0,c=void 0,f=void 0,p=e,v=t,g=[0,0,0,0];for(l=1;l<10;l++)u=.1*l,g[0]=Math.pow(1-u,3),g[1]=3*u*Math.pow(1-u,2),g[2]=3*Math.pow(u,2)*(1-u),g[3]=Math.pow(u,3),c=g[0]*e+g[1]*r.x+g[2]*a.x+g[3]*i,f=g[0]*t+g[1]*r.y+g[2]*a.y+g[3]*n,l>0&&(h=this._getDistanceToLine(p,v,c,f,o,s),d=h<d?h:d),p=c,v=f;return d}}]),t}(v.default);t.default=g},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(23),s=n(o),r=i(2),a=n(r),d=i(0),h=n(d),l=i(1),u=n(l),c=i(3),f=n(c),p=i(4),v=n(p),g=i(56),y=n(g),m=function(e){function t(e,i,n){(0,h.default)(this,t);var o=(0,f.default)(this,(t.__proto__||(0,a.default)(t)).call(this,e,i,n));return o._boundFunction=function(){o.positionBezierNode()},o.body.emitter.on("_repositionBezierNodes",o._boundFunction),o}return(0,v.default)(t,e),(0,u.default)(t,[{key:"setOptions",value:function(e){var t=!1;this.options.physics!==e.physics&&(t=!0),this.options=e,this.id=this.options.id,this.from=this.body.nodes[this.options.from],this.to=this.body.nodes[this.options.to],this.setupSupportNode(),this.connect(),!0===t&&(this.via.setOptions({physics:this.options.physics}),this.positionBezierNode())}},{key:"connect",value:function(){this.from=this.body.nodes[this.options.from],this.to=this.body.nodes[this.options.to],void 0===this.from||void 0===this.to||!1===this.options.physics?this.via.setOptions({physics:!1}):this.from.id===this.to.id?this.via.setOptions({physics:!1}):this.via.setOptions({physics:!0})}},{key:"cleanup",value:function(){return this.body.emitter.off("_repositionBezierNodes",this._boundFunction),void 0!==this.via&&(delete this.body.nodes[this.via.id],this.via=void 0,!0)}},{key:"setupSupportNode",value:function(){if(void 0===this.via){var e="edgeId:"+this.id,t=this.body.functions.createNode({id:e,shape:"circle",physics:!0,hidden:!0});this.body.nodes[e]=t,this.via=t,this.via.parentEdgeId=this.id,this.positionBezierNode()}}},{key:"positionBezierNode",value:function(){void 0!==this.via&&void 0!==this.from&&void 0!==this.to?(this.via.x=.5*(this.from.x+this.to.x),this.via.y=.5*(this.from.y+this.to.y)):void 0!==this.via&&(this.via.x=0,this.via.y=0)}},{key:"_line",value:function(e,t,i){this._bezierCurve(e,t,i)}},{key:"getViaNode",value:function(){return this.via}},{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.via,i=e,n=void 0,o=void 0;if(this.from===this.to){var r=this._getCircleData(this.from),a=(0,s.default)(r,3),d=a[0],h=a[1],l=a[2],u=2*Math.PI*(1-i);n=d+l*Math.sin(u),o=h+l-l*(1-Math.cos(u))}else n=Math.pow(1-i,2)*this.fromPoint.x+2*i*(1-i)*t.x+Math.pow(i,2)*this.toPoint.x,o=Math.pow(1-i,2)*this.fromPoint.y+2*i*(1-i)*t.y+Math.pow(i,2)*this.toPoint.y;return{x:n,y:o}}},{key:"_findBorderPosition",value:function(e,t){return this._findBorderPositionBezier(e,t,this.via)}},{key:"_getDistanceToEdge",value:function(e,t,i,n,o,s){return this._getDistanceToBezierEdge(e,t,i,n,o,s,this.via)}}]),t}(y.default);t.default=m},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(2),s=n(o),r=i(0),a=n(r),d=i(1),h=n(d),l=i(3),u=n(l),c=i(4),f=n(c),p=i(56),v=n(p),g=function(e){function t(e,i,n){return(0,a.default)(this,t),(0,u.default)(this,(t.__proto__||(0,s.default)(t)).call(this,e,i,n))}return(0,f.default)(t,e),(0,h.default)(t,[{key:"_line",value:function(e,t,i){this._bezierCurve(e,t,i)}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_getViaCoordinates",value:function(){var e=void 0,t=void 0,i=this.options.smooth.roundness,n=this.options.smooth.type,o=Math.abs(this.from.x-this.to.x),s=Math.abs(this.from.y-this.to.y);if("discrete"===n||"diagonalCross"===n){var r=void 0,a=void 0;r=a=o<=s?i*s:i*o,this.from.x>this.to.x&&(r=-r),this.from.y>=this.to.y&&(a=-a),e=this.from.x+r,t=this.from.y+a,"discrete"===n&&(o<=s?e=o<i*s?this.from.x:e:t=s<i*o?this.from.y:t)}else if("straightCross"===n){var d=(1-i)*o,h=(1-i)*s;o<=s?(d=0,this.from.y<this.to.y&&(h=-h)):(this.from.x<this.to.x&&(d=-d),h=0),e=this.to.x+d,t=this.to.y+h}else if("horizontal"===n){var l=(1-i)*o;this.from.x<this.to.x&&(l=-l),e=this.to.x+l,t=this.from.y}else if("vertical"===n){var u=(1-i)*s;this.from.y<this.to.y&&(u=-u),e=this.from.x,t=this.to.y+u}else if("curvedCW"===n){o=this.to.x-this.from.x,s=this.from.y-this.to.y;var c=Math.sqrt(o*o+s*s),f=Math.PI,p=Math.atan2(s,o),v=(p+(.5*i+.5)*f)%(2*f);e=this.from.x+(.5*i+.5)*c*Math.sin(v),t=this.from.y+(.5*i+.5)*c*Math.cos(v)}else if("curvedCCW"===n){o=this.to.x-this.from.x,s=this.from.y-this.to.y;var g=Math.sqrt(o*o+s*s),y=Math.PI,m=Math.atan2(s,o),b=(m+(.5*-i+.5)*y)%(2*y);e=this.from.x+(.5*i+.5)*g*Math.sin(b),t=this.from.y+(.5*i+.5)*g*Math.cos(b)}else{var _=void 0,w=void 0;_=w=o<=s?i*s:i*o,this.from.x>this.to.x&&(_=-_),this.from.y>=this.to.y&&(w=-w),e=this.from.x+_,t=this.from.y+w,o<=s?e=this.from.x<=this.to.x?this.to.x<e?this.to.x:e:this.to.x>e?this.to.x:e:t=this.from.y>=this.to.y?this.to.y>t?this.to.y:t:this.to.y<t?this.to.y:t}return{x:e,y:t}}},{key:"_findBorderPosition",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._findBorderPositionBezier(e,t,i.via)}},{key:"_getDistanceToEdge",value:function(e,t,i,n,o,s){var r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(e,t,i,n,o,s,r)}},{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._getViaCoordinates(),i=e;return{x:Math.pow(1-i,2)*this.fromPoint.x+2*i*(1-i)*t.x+Math.pow(i,2)*this.toPoint.x,y:Math.pow(1-i,2)*this.fromPoint.y+2*i*(1-i)*t.y+Math.pow(i,2)*this.toPoint.y}}}]),t}(v.default);t.default=g},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(2),s=n(o),r=i(0),a=n(r),d=i(1),h=n(d),l=i(3),u=n(l),c=i(4),f=n(c),p=i(78),v=n(p),g=function(e){function t(e,i,n){return(0,a.default)(this,t),(0,u.default)(this,(t.__proto__||(0,s.default)(t)).call(this,e,i,n))}return(0,f.default)(t,e),(0,h.default)(t,[{key:"_line",value:function(e,t){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),e.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}},{key:"getViaNode",value:function(){}},{key:"getPoint",value:function(e){return{x:(1-e)*this.fromPoint.x+e*this.toPoint.x,y:(1-e)*this.fromPoint.y+e*this.toPoint.y}}},{key:"_findBorderPosition",value:function(e,t){var i=this.to,n=this.from;e.id===this.from.id&&(i=this.from,n=this.to);var o=Math.atan2(i.y-n.y,i.x-n.x),s=i.x-n.x,r=i.y-n.y,a=Math.sqrt(s*s+r*r),d=e.distanceToBorder(t,o),h=(a-d)/a,l={};return l.x=(1-h)*n.x+h*i.x,l.y=(1-h)*n.y+h*i.y,l}},{key:"_getDistanceToEdge",value:function(e,t,i,n,o,s){return this._getDistanceToLine(e,t,i,n,o,s)}}]),t}(v.default);t.default=g},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(10),s=n(o),r=i(0),a=n(r),d=i(1),h=n(d),l=i(80).default,u=i(170).default,c=i(171).default,f=i(172).default,p=i(173).default,v=i(81).default,g=i(174).default,y=i(175).default,m=i(5),b=i(79).default,_=function(){function e(t){(0,a.default)(this,e),this.body=t,this.physicsBody={physicsNodeIndices:[],physicsEdgeIndices:[],forces:{},velocities:{}},this.physicsEnabled=!0,this.simulationInterval=1e3/60,this.requiresTimeout=!0,this.previousStates={},this.referenceState={},this.freezeCache={},this.renderTimer=void 0,this.adaptiveTimestep=!1,this.adaptiveTimestepEnabled=!1,this.adaptiveCounter=0,this.adaptiveInterval=3,this.stabilized=!1,this.startedStabilization=!1,this.stabilizationIterations=0,this.ready=!1,this.options={},this.defaultOptions={enabled:!0,barnesHut:{theta:.5,gravitationalConstant:-2e3,centralGravity:.3,springLength:95,springConstant:.04,damping:.09,avoidOverlap:0},forceAtlas2Based:{theta:.5,gravitationalConstant:-50,centralGravity:.01,springConstant:.08,springLength:100,damping:.4,avoidOverlap:0},repulsion:{centralGravity:.2,springLength:200,springConstant:.05,nodeDistance:100,damping:.09,avoidOverlap:0},hierarchicalRepulsion:{centralGravity:0,springLength:100,springConstant:.01,nodeDistance:120,damping:.09},maxVelocity:50,minVelocity:.75,solver:"barnesHut",stabilization:{enabled:!0,iterations:1e3,updateInterval:50,onlyDynamicEdges:!1,fit:!0},timestep:.5,adaptiveTimestep:!0},m.extend(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}return(0,h.default)(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("initPhysics",function(){e.initPhysics()}),this.body.emitter.on("_layoutFailed",function(){e.layoutFailed=!0}),this.body.emitter.on("resetPhysics",function(){e.stopSimulation(),e.ready=!1}),this.body.emitter.on("disablePhysics",function(){e.physicsEnabled=!1,e.stopSimulation()}),this.body.emitter.on("restorePhysics",function(){e.setOptions(e.options),!0===e.ready&&e.startSimulation()}),this.body.emitter.on("startSimulation",function(){!0===e.ready&&e.startSimulation()}),this.body.emitter.on("stopSimulation",function(){e.stopSimulation()}),this.body.emitter.on("destroy",function(){e.stopSimulation(!1),e.body.emitter.off()}),this.body.emitter.on("_dataChanged",function(){e.updatePhysicsData()})}},{key:"setOptions",value:function(e){void 0!==e&&(!1===e?(this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation()):!0===e?(this.options.enabled=!0,this.physicsEnabled=!0,this.startSimulation()):(this.physicsEnabled=!0,m.selectiveNotDeepExtend(["stabilization"],this.options,e),m.mergeOptions(this.options,e,"stabilization"),void 0===e.enabled&&(this.options.enabled=!0),!1===this.options.enabled&&(this.physicsEnabled=!1,this.stopSimulation()),this.timestep=this.options.timestep)),this.init()}},{key:"init",value:function(){var e;"forceAtlas2Based"===this.options.solver?(e=this.options.forceAtlas2Based,this.nodesSolver=new g(this.body,this.physicsBody,e),this.edgesSolver=new f(this.body,this.physicsBody,e),this.gravitySolver=new y(this.body,this.physicsBody,e)):"repulsion"===this.options.solver?(e=this.options.repulsion,this.nodesSolver=new u(this.body,this.physicsBody,e),this.edgesSolver=new f(this.body,this.physicsBody,e),this.gravitySolver=new v(this.body,this.physicsBody,e)):"hierarchicalRepulsion"===this.options.solver?(e=this.options.hierarchicalRepulsion,this.nodesSolver=new c(this.body,this.physicsBody,e),this.edgesSolver=new p(this.body,this.physicsBody,e),this.gravitySolver=new v(this.body,this.physicsBody,e)):(e=this.options.barnesHut,this.nodesSolver=new l(this.body,this.physicsBody,e),this.edgesSolver=new f(this.body,this.physicsBody,e),this.gravitySolver=new v(this.body,this.physicsBody,e)),this.modelOptions=e}},{key:"initPhysics",value:function(){!0===this.physicsEnabled&&!0===this.options.enabled?!0===this.options.stabilization.enabled?this.stabilize():(this.stabilized=!1,this.ready=!0,this.body.emitter.emit("fit",{},this.layoutFailed),this.startSimulation()):(this.ready=!0,this.body.emitter.emit("fit"))}},{key:"startSimulation",value:function(){!0===this.physicsEnabled&&!0===this.options.enabled?(this.stabilized=!1,this.adaptiveTimestep=!1,this.body.emitter.emit("_resizeNodes"),void 0===this.viewFunction&&(this.viewFunction=this.simulationStep.bind(this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering"))):this.body.emitter.emit("_redraw")}},{key:"stopSimulation",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.stabilized=!0,!0===e&&this._emitStabilized(),void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.viewFunction=void 0,!0===e&&this.body.emitter.emit("_stopRendering"))}},{key:"simulationStep",value:function(){var e=Date.now();this.physicsTick(),(Date.now()-e<.4*this.simulationInterval||!0===this.runDoubleSpeed)&&!1===this.stabilized&&(this.physicsTick(),this.runDoubleSpeed=!0),!0===this.stabilized&&this.stopSimulation()}},{key:"_emitStabilized",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.stabilizationIterations;(this.stabilizationIterations>1||!0===this.startedStabilization)&&setTimeout(function(){e.body.emitter.emit("stabilized",{iterations:t}),e.startedStabilization=!1,e.stabilizationIterations=0},0)}},{key:"physicsStep",value:function(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve(),this.moveNodes()}},{key:"adjustTimeStep",value:function(){!0===this._evaluateStepQuality()?this.timestep=1.2*this.timestep:this.timestep/1.2<this.options.timestep?this.timestep=this.options.timestep:(this.adaptiveCounter=-1,this.timestep=Math.max(this.options.timestep,this.timestep/1.2))}},{key:"physicsTick",value:function(){if(this._startStabilizing(),!0!==this.stabilized){if(!0===this.adaptiveTimestep&&!0===this.adaptiveTimestepEnabled){this.adaptiveCounter%this.adaptiveInterval==0?(this.timestep=2*this.timestep,this.physicsStep(),this.revert(),this.timestep=.5*this.timestep,this.physicsStep(),this.physicsStep(),this.adjustTimeStep()):this.physicsStep(),this.adaptiveCounter+=1}else this.timestep=this.options.timestep,this.physicsStep();!0===this.stabilized&&this.revert(),this.stabilizationIterations++}}},{key:"updatePhysicsData",value:function(){this.physicsBody.forces={},this.physicsBody.physicsNodeIndices=[],this.physicsBody.physicsEdgeIndices=[];var e=this.body.nodes,t=this.body.edges;for(var i in e)e.hasOwnProperty(i)&&!0===e[i].options.physics&&this.physicsBody.physicsNodeIndices.push(e[i].id);for(var n in t)t.hasOwnProperty(n)&&!0===t[n].options.physics&&this.physicsBody.physicsEdgeIndices.push(t[n].id);for(var o=0;o<this.physicsBody.physicsNodeIndices.length;o++){var s=this.physicsBody.physicsNodeIndices[o];this.physicsBody.forces[s]={x:0,y:0},void 0===this.physicsBody.velocities[s]&&(this.physicsBody.velocities[s]={x:0,y:0})}for(var r in this.physicsBody.velocities)void 0===e[r]&&delete this.physicsBody.velocities[r]}},{key:"revert",value:function(){var e=(0,s.default)(this.previousStates),t=this.body.nodes,i=this.physicsBody.velocities;this.referenceState={};for(var n=0;n<e.length;n++){var o=e[n];void 0!==t[o]?!0===t[o].options.physics&&(this.referenceState[o]={positions:{x:t[o].x,y:t[o].y}},i[o].x=this.previousStates[o].vx,i[o].y=this.previousStates[o].vy,t[o].x=this.previousStates[o].x,t[o].y=this.previousStates[o].y):delete this.previousStates[o]}}},{key:"_evaluateStepQuality",value:function(){var e=void 0,t=void 0,i=this.body.nodes,n=this.referenceState;for(var o in this.referenceState)if(this.referenceState.hasOwnProperty(o)&&void 0!==i[o]&&(e=i[o].x-n[o].positions.x,t=i[o].y-n[o].positions.y,Math.sqrt(Math.pow(e,2)+Math.pow(t,2))>.3))return!1;return!0}},{key:"moveNodes",value:function(){for(var e=this.physicsBody.physicsNodeIndices,t=0,i=0,n=0;n<e.length;n++){var o=e[n],s=this._performStep(o);t=Math.max(t,s),i+=s}this.adaptiveTimestepEnabled=i/e.length<5,this.stabilized=t<this.options.minVelocity}},{key:"calculateComponentVelocity",value:function(e,t,i){e+=(t-this.modelOptions.damping*e)/i*this.timestep;var n=this.options.maxVelocity||1e9;return Math.abs(e)>n&&(e=e>0?n:-n),e}},{key:"_performStep",value:function(e){var t=this.body.nodes[e],i=this.physicsBody.forces[e],n=this.physicsBody.velocities[e];return this.previousStates[e]={x:t.x,y:t.y,vx:n.x,vy:n.y},!1===t.options.fixed.x?(n.x=this.calculateComponentVelocity(n.x,i.x,t.options.mass),t.x+=n.x*this.timestep):(i.x=0,n.x=0),!1===t.options.fixed.y?(n.y=this.calculateComponentVelocity(n.y,i.y,t.options.mass),t.y+=n.y*this.timestep):(i.y=0,n.y=0),Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2))}},{key:"_freezeNodes",value:function(){var e=this.body.nodes;for(var t in e)if(e.hasOwnProperty(t)&&e[t].x&&e[t].y){var i=e[t].options.fixed;this.freezeCache[t]={x:i.x,y:i.y},i.x=!0,i.y=!0}}},{key:"_restoreFrozenNodes",value:function(){var e=this.body.nodes;for(var t in e)e.hasOwnProperty(t)&&void 0!==this.freezeCache[t]&&(e[t].options.fixed.x=this.freezeCache[t].x,e[t].options.fixed.y=this.freezeCache[t].y);this.freezeCache={}}},{key:"stabilize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.stabilization.iterations;if("number"!=typeof t&&(t=this.options.stabilization.iterations,console.log("The stabilize method needs a numeric amount of iterations. Switching to default: ",t)),0===this.physicsBody.physicsNodeIndices.length)return void(this.ready=!0);this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=t,!0===this.options.stabilization.onlyDynamicEdges&&this._freezeNodes(),this.stabilizationIterations=0,setTimeout(function(){return e._stabilizationBatch()},0)}},{key:"_startStabilizing",value:function(){return!0!==this.startedStabilization&&(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0,!0)}},{key:"_stabilizationBatch",value:function(){var e=this,t=function(){return!1===e.stabilized&&e.stabilizationIterations<e.targetIterations},i=function(){e.body.emitter.emit("stabilizationProgress",{iterations:e.stabilizationIterations,total:e.targetIterations})};this._startStabilizing()&&i();for(var n=0;t()&&n<this.options.stabilization.updateInterval;)this.physicsTick(),n++;i(),t()?setTimeout(this._stabilizationBatch.bind(this),0):this._finalizeStabilization()}},{key:"_finalizeStabilization",value:function(){this.body.emitter.emit("_allowRedraw"),!0===this.options.stabilization.fit&&this.body.emitter.emit("fit"),!0===this.options.stabilization.onlyDynamicEdges&&this._restoreFrozenNodes(),this.body.emitter.emit("stabilizationIterationsDone"),this.body.emitter.emit("_requestRedraw"),!0===this.stabilized?this._emitStabilized():this.startSimulation(),this.ready=!0}},{key:"_drawForces",value:function(e){for(var t=0;t<this.physicsBody.physicsNodeIndices.length;t++){var i=this.physicsBody.physicsNodeIndices[t],n=this.body.nodes[i],o=this.physicsBody.forces[i],s=Math.sqrt(Math.pow(o.x,2)+Math.pow(o.x,2)),r=Math.min(Math.max(5,s),15),a=3*r,d=m.HSVToHex((180-180*Math.min(1,Math.max(0,.03*s)))/360,1,1),h={x:n.x+20*o.x,y:n.y+20*o.y};e.lineWidth=r,e.strokeStyle=d,e.beginPath(),e.moveTo(n.x,n.y),e.lineTo(h.x,h.y),e.stroke();var l=Math.atan2(o.y,o.x);e.fillStyle=d,b.draw(e,{type:"arrow",point:h,angle:l,length:a}),e.fill()}}}]),e}();t.default=_},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(0),s=n(o),r=i(1),a=n(r),d=function(){function e(t,i,n){(0,s.default)(this,e),this.body=t,this.physicsBody=i,this.setOptions(n)}return(0,a.default)(e,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e,t,i,n,o,s,r,a,d=this.body.nodes,h=this.physicsBody.physicsNodeIndices,l=this.physicsBody.forces,u=this.options.nodeDistance,c=-2/3/u,f=0;f<h.length-1;f++){r=d[h[f]];for(var p=f+1;p<h.length;p++)a=d[h[p]],e=a.x-r.x,t=a.y-r.y,i=Math.sqrt(e*e+t*t),0===i&&(i=.1*Math.random(),e=i),i<2*u&&(s=i<.5*u?1:c*i+4/3,s/=i,n=e*s,o=t*s,l[r.id].x-=n,l[r.id].y-=o,l[a.id].x+=n,l[a.id].y+=o)}}}]),e}();t.default=d},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(0),s=n(o),r=i(1),a=n(r),d=function(){function e(t,i,n){(0,s.default)(this,e),this.body=t,this.physicsBody=i,this.setOptions(n)}return(0,a.default)(e,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){var e,t,i,n,o,s,r,a,d,h,l=this.body.nodes,u=this.physicsBody.physicsNodeIndices,c=this.physicsBody.forces,f=this.options.nodeDistance;for(d=0;d<u.length-1;d++)for(r=l[u[d]],h=d+1;h<u.length;h++)if(a=l[u[h]],r.level===a.level){e=a.x-r.x,t=a.y-r.y,i=Math.sqrt(e*e+t*t);s=i<f?-Math.pow(.05*i,2)+Math.pow(.05*f,2):0,0===i?i=.01:s/=i,n=e*s,o=t*s,c[r.id].x-=n,c[r.id].y-=o,c[a.id].x+=n,c[a.id].y+=o}}}]),e}();t.default=d},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(0),s=n(o),r=i(1),a=n(r),d=function(){function e(t,i,n){(0,s.default)(this,e),this.body=t,this.physicsBody=i,this.setOptions(n)}return(0,a.default)(e,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e=void 0,t=void 0,i=this.physicsBody.physicsEdgeIndices,n=this.body.edges,o=void 0,s=void 0,r=void 0,a=0;a<i.length;a++)t=n[i[a]],!0===t.connected&&t.toId!==t.fromId&&void 0!==this.body.nodes[t.toId]&&void 0!==this.body.nodes[t.fromId]&&(void 0!==t.edgeType.via?(e=void 0===t.options.length?this.options.springLength:t.options.length,o=t.to,s=t.edgeType.via,r=t.from,this._calculateSpringForce(o,s,.5*e),this._calculateSpringForce(s,r,.5*e)):(e=void 0===t.options.length?1.5*this.options.springLength:t.options.length,this._calculateSpringForce(t.from,t.to,e)))}},{key:"_calculateSpringForce",value:function(e,t,i){var n=e.x-t.x,o=e.y-t.y,s=Math.max(Math.sqrt(n*n+o*o),.01),r=this.options.springConstant*(i-s)/s,a=n*r,d=o*r;void 0!==this.physicsBody.forces[e.id]&&(this.physicsBody.forces[e.id].x+=a,this.physicsBody.forces[e.id].y+=d),void 0!==this.physicsBody.forces[t.id]&&(this.physicsBody.forces[t.id].x-=a,this.physicsBody.forces[t.id].y-=d)}}]),e}();t.default=d},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(0),s=n(o),r=i(1),a=n(r),d=function(){function e(t,i,n){(0,s.default)(this,e),this.body=t,this.physicsBody=i,this.setOptions(n)}return(0,a.default)(e,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e,t,i,n,o,s,r,a,d=this.body.edges,h=this.physicsBody.physicsEdgeIndices,l=this.physicsBody.physicsNodeIndices,u=this.physicsBody.forces,c=0;c<l.length;c++){var f=l[c];u[f].springFx=0,u[f].springFy=0}for(var p=0;p<h.length;p++)t=d[h[p]],!0===t.connected&&(e=void 0===t.options.length?this.options.springLength:t.options.length,i=t.from.x-t.to.x,n=t.from.y-t.to.y,a=Math.sqrt(i*i+n*n),a=0===a?.01:a,r=this.options.springConstant*(e-a)/a,o=i*r,s=n*r,t.to.level!=t.from.level?(void 0!==u[t.toId]&&(u[t.toId].springFx-=o,u[t.toId].springFy-=s),void 0!==u[t.fromId]&&(u[t.fromId].springFx+=o,u[t.fromId].springFy+=s)):(void 0!==u[t.toId]&&(u[t.toId].x-=.5*o,u[t.toId].y-=.5*s),void 0!==u[t.fromId]&&(u[t.fromId].x+=.5*o,u[t.fromId].y+=.5*s)));r=1;for(var v,g,y=0;y<l.length;y++){var m=l[y];v=Math.min(r,Math.max(-r,u[m].springFx)),g=Math.min(r,Math.max(-r,u[m].springFy)),u[m].x+=v,u[m].y+=g}for(var b=0,_=0,w=0;w<l.length;w++){var k=l[w];b+=u[k].x,_+=u[k].y}for(var x=b/l.length,O=_/l.length,M=0;M<l.length;M++){var E=l[M];u[E].x-=x,u[E].y-=O}}}]),e}();t.default=d},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(2),s=n(o),r=i(0),a=n(r),d=i(1),h=n(d),l=i(3),u=n(l),c=i(4),f=n(c),p=i(80),v=n(p),g=function(e){function t(e,i,n){return(0,a.default)(this,t),(0,u.default)(this,(t.__proto__||(0,s.default)(t)).call(this,e,i,n))}return(0,f.default)(t,e),(0,h.default)(t,[{key:"_calculateForces",value:function(e,t,i,n,o){0===e&&(e=.1*Math.random(),t=e),this.overlapAvoidanceFactor<1&&n.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*n.shape.radius,e-n.shape.radius));var s=n.edges.length+1,r=this.options.gravitationalConstant*o.mass*n.options.mass*s/Math.pow(e,2),a=t*r,d=i*r;this.physicsBody.forces[n.id].x+=a,this.physicsBody.forces[n.id].y+=d}}]),t}(v.default);t.default=g},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(2),s=n(o),r=i(0),a=n(r),d=i(1),h=n(d),l=i(3),u=n(l),c=i(4),f=n(c),p=i(81),v=n(p),g=function(e){function t(e,i,n){return(0,a.default)(this,t),(0,u.default)(this,(t.__proto__||(0,s.default)(t)).call(this,e,i,n))}return(0,f.default)(t,e),(0,h.default)(t,[{key:"_calculateForces",value:function(e,t,i,n,o){if(e>0){var s=o.edges.length+1,r=this.options.centralGravity*s*o.options.mass;n[o.id].x=t*r,n[o.id].y=i*r}}}]),t}(v.default);t.default=g},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(10),s=n(o),r=i(7),a=n(r),d=i(0),h=n(d),l=i(1),u=n(l),c=i(5),f=i(57).default,p=i(177).default,v=i(55).default,g=i(33).default,y=function(){function e(t){var i=this;(0,h.default)(this,e),this.body=t,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},c.extend(this.options,this.defaultOptions),this.body.emitter.on("_resetData",function(){i.clusteredNodes={},i.clusteredEdges={}})}return(0,u.default)(e,[{key:"clusterByHubsize",value:function(e,t){void 0===e?e=this._getHubSize():"object"===(void 0===e?"undefined":(0,a.default)(e))&&(t=this._checkOptions(e),e=this._getHubSize());for(var i=[],n=0;n<this.body.nodeIndices.length;n++){var o=this.body.nodes[this.body.nodeIndices[n]];o.edges.length>=e&&i.push(o.id)}for(var s=0;s<i.length;s++)this.clusterByConnection(i[s],t,!0);this.body.emitter.emit("_dataChanged")}},{key:"cluster",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(void 0===t.joinCondition)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");t=this._checkOptions(t);var n={},o={};c.forEach(this.body.nodes,function(i,s){var r=f.cloneOptions(i);!0===t.joinCondition(r)&&(n[s]=i,c.forEach(i.edges,function(t){void 0===e.clusteredEdges[t.id]&&(o[t.id]=t)}))}),this._cluster(n,o,t,i)}},{key:"clusterByEdgeCount",value:function(e,t){var i=this,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];t=this._checkOptions(t);for(var o=[],r={},a=void 0,d=void 0,h=void 0,l=0;l<this.body.nodeIndices.length;l++){var u,c,p;!function(n){var l={},v={},g=i.body.nodeIndices[n],y=i.body.nodes[g];if(void 0===r[g]){h=0,d=[];for(var m=0;m<y.edges.length;m++)a=y.edges[m],void 0===i.clusteredEdges[a.id]&&(a.toId!==a.fromId&&h++,d.push(a));if(h===e){u=function(e){if(void 0===t.joinCondition||null===t.joinCondition)return!0;var i=f.cloneOptions(e);return t.joinCondition(i)};for(var b=!0,_=0;_<d.length;_++){a=d[_];var w=i._getConnectedId(a,g);if(!u(y)){b=!1;break}v[a.id]=a,l[g]=y,l[w]=i.body.nodes[w],r[g]=!0}if((0,s.default)(l).length>0&&(0,s.default)(v).length>0&&!0===b)if(c=function(){for(var e=0;e<o.length;++e)for(var t in l)if(void 0!==o[e].nodes[t])return o[e]},void 0!==(p=c())){for(var k in l)void 0===p.nodes[k]&&(p.nodes[k]=l[k]);for(var x in v)void 0===p.edges[x]&&(p.edges[x]=v[x])}else o.push({nodes:l,edges:v})}}}(l)}for(var l=0;l<o.length;l++)this._cluster(o[l].nodes,o[l].edges,t,!1);!0===n&&this.body.emitter.emit("_dataChanged")}},{key:"clusterOutliers",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.clusterByEdgeCount(1,e,t)}},{key:"clusterBridges",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.clusterByEdgeCount(2,e,t)}},{key:"clusterByConnection",value:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0===e)throw new Error("No nodeId supplied to clusterByConnection!");if(void 0===this.body.nodes[e])throw new Error("The nodeId given to clusterByConnection does not exist!");var n=this.body.nodes[e];t=this._checkOptions(t,n),void 0===t.clusterNodeProperties.x&&(t.clusterNodeProperties.x=n.x),void 0===t.clusterNodeProperties.y&&(t.clusterNodeProperties.y=n.y),void 0===t.clusterNodeProperties.fixed&&(t.clusterNodeProperties.fixed={},t.clusterNodeProperties.fixed.x=n.options.fixed.x,t.clusterNodeProperties.fixed.y=n.options.fixed.y);var o={},r={},a=n.id,d=f.cloneOptions(n);o[a]=n;for(var h=0;h<n.edges.length;h++){var l=n.edges[h];if(void 0===this.clusteredEdges[l.id]){var u=this._getConnectedId(l,a);if(void 0===this.clusteredNodes[u])if(u!==a)if(void 0===t.joinCondition)r[l.id]=l,o[u]=this.body.nodes[u];else{var c=f.cloneOptions(this.body.nodes[u]);!0===t.joinCondition(d,c)&&(r[l.id]=l,o[u]=this.body.nodes[u])}else r[l.id]=l}}var p=(0,s.default)(o).map(function(e){return o[e].id});for(v in o)if(o.hasOwnProperty(v))for(var v=o[v],g=0;g<v.edges.length;g++){var y=v.edges[g];p.indexOf(this._getConnectedId(y,v.id))>-1&&(r[y.id]=y)}this._cluster(o,r,t,i)}},{key:"_createClusterEdges",value:function(e,t,i,n){for(var o=void 0,r=void 0,a=void 0,d=void 0,h=void 0,l=void 0,u=(0,s.default)(e),c=[],f=0;f<u.length;f++){r=u[f],a=e[r];for(var p=0;p<a.edges.length;p++)o=a.edges[p],void 0===this.clusteredEdges[o.id]&&(o.toId==o.fromId?t[o.id]=o:o.toId==r?(d=i.id,h=o.fromId,l=h):(d=o.toId,h=i.id,l=d),void 0===e[l]&&c.push({edge:o,fromId:h,toId:d}))}for(var v=[],g=0;g<c.length;g++){var y=c[g],m=y.edge,b=function(e){for(var t=0;t<v.length;t++){var i=v[t],n=e.fromId===i.fromId&&e.toId===i.toId,o=e.fromId===i.toId&&e.toId===i.fromId;if(n||o)return i}return null}(y);null===b?(b=this._createClusteredEdge(y.fromId,y.toId,m,n),v.push(b)):b.clusteringEdgeReplacingIds.push(m.id),this.body.edges[m.id].edgeReplacedById=b.id,this._backupEdgeOptions(m),m.setOptions({physics:!1})}}},{key:"_checkOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return void 0===e.clusterEdgeProperties&&(e.clusterEdgeProperties={}),void 0===e.clusterNodeProperties&&(e.clusterNodeProperties={}),e}},{key:"_cluster",value:function(e,t,i){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=[];for(var r in e)e.hasOwnProperty(r)&&void 0!==this.clusteredNodes[r]&&o.push(r);for(var a=0;a<o.length;++a)delete e[o[a]];if(0!=(0,s.default)(e).length&&(1!=(0,s.default)(e).length||1==i.clusterNodeProperties.allowSingleNodeCluster)){var d=c.deepExtend({},i.clusterNodeProperties);if(void 0!==i.processProperties){var h=[];for(var l in e)if(e.hasOwnProperty(l)){var u=f.cloneOptions(e[l]);h.push(u)}var v=[];for(var g in t)if(t.hasOwnProperty(g)&&"clusterEdge:"!==g.substr(0,12)){var y=f.cloneOptions(t[g],"edge");v.push(y)}if(!(d=i.processProperties(d,h,v)))throw new Error("The processProperties function does not return properties!")}void 0===d.id&&(d.id="cluster:"+c.randomUUID());var m=d.id;void 0===d.label&&(d.label="cluster");var b=void 0;void 0===d.x&&(b=this._getClusterPosition(e),d.x=b.x),void 0===d.y&&(void 0===b&&(b=this._getClusterPosition(e)),d.y=b.y),d.id=m;var _=this.body.functions.createNode(d,p);_.containedNodes=e,_.containedEdges=t,_.clusterEdgeProperties=i.clusterEdgeProperties,this.body.nodes[d.id]=_,this._clusterEdges(e,t,d,i.clusterEdgeProperties),d.id=void 0,!0===n&&this.body.emitter.emit("_dataChanged")}}},{key:"_backupEdgeOptions",value:function(e){void 0===this.clusteredEdges[e.id]&&(this.clusteredEdges[e.id]={physics:e.options.physics})}},{key:"_restoreEdge",value:function(e){var t=this.clusteredEdges[e.id];void 0!==t&&(e.setOptions({physics:t.physics}),delete this.clusteredEdges[e.id])}},{key:"isCluster",value:function(e){return void 0!==this.body.nodes[e]?!0===this.body.nodes[e].isCluster:(console.log("Node does not exist."),!1)}},{key:"_getClusterPosition",value:function(e){for(var t=(0,s.default)(e),i=e[t[0]].x,n=e[t[0]].x,o=e[t[0]].y,r=e[t[0]].y,a=void 0,d=1;d<t.length;d++)a=e[t[d]],i=a.x<i?a.x:i,n=a.x>n?a.x:n,o=a.y<o?a.y:o,r=a.y>r?a.y:r;return{x:.5*(i+n),y:.5*(o+r)}}},{key:"openCluster",value:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0===e)throw new Error("No clusterNodeId supplied to openCluster.");var n=this.body.nodes[e];if(void 0===n)throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(!0!==n.isCluster||void 0===n.containedNodes||void 0===n.containedEdges)throw new Error("The node:"+e+" is not a valid cluster.");var o=this.findNode(e),s=o.indexOf(e)-1;if(s>=0){var r=o[s];return this.body.nodes[r]._openChildCluster(e),delete this.body.nodes[e],void(!0===i&&this.body.emitter.emit("_dataChanged"))}var a=n.containedNodes,d=n.containedEdges;if(void 0!==t&&void 0!==t.releaseFunction&&"function"==typeof t.releaseFunction){var h={},l={x:n.x,y:n.y};for(var u in a)if(a.hasOwnProperty(u)){var f=this.body.nodes[u];h[u]={x:f.x,y:f.y}}var p=t.releaseFunction(l,h);for(var v in a)if(a.hasOwnProperty(v)){var g=this.body.nodes[v];void 0!==p[v]&&(g.x=void 0===p[v].x?n.x:p[v].x,g.y=void 0===p[v].y?n.y:p[v].y)}}else c.forEach(a,function(e){!1===e.options.fixed.x&&(e.x=n.x),!1===e.options.fixed.y&&(e.y=n.y)});for(var y in a)if(a.hasOwnProperty(y)){var m=this.body.nodes[y];m.vx=n.vx,m.vy=n.vy,m.setOptions({physics:!0}),delete this.clusteredNodes[y]}for(var b=[],_=0;_<n.edges.length;_++)b.push(n.edges[_]);for(var w=0;w<b.length;w++){for(var k=b[w],x=this._getConnectedId(k,e),O=this.clusteredNodes[x],M=0;M<k.clusteringEdgeReplacingIds.length;M++){var E=k.clusteringEdgeReplacingIds[M],S=this.body.edges[E];if(void 0!==S)if(void 0!==O){var D=this.body.nodes[O.clusterId];D.containedEdges[S.id]=S,delete d[S.id];var C=S.fromId,T=S.toId;S.toId==x?T=O.clusterId:C=O.clusterId,this._createClusteredEdge(C,T,S,D.clusterEdgeProperties,{hidden:!1,physics:!0})}else this._restoreEdge(S)}k.remove()}for(var P in d)d.hasOwnProperty(P)&&this._restoreEdge(d[P]);delete this.body.nodes[e],!0===i&&this.body.emitter.emit("_dataChanged")}},{key:"getNodesInCluster",value:function(e){var t=[];if(!0===this.isCluster(e)){var i=this.body.nodes[e].containedNodes;for(var n in i)i.hasOwnProperty(n)&&t.push(this.body.nodes[n].id)}return t}},{key:"findNode",value:function(e){for(var t=[],i=0,n=void 0;void 0!==this.clusteredNodes[e]&&i<100;){if(void 0===(n=this.body.nodes[e]))return[];t.push(n.id),e=this.clusteredNodes[e].clusterId,i++}return void 0===(n=this.body.nodes[e])?[]:(t.push(n.id),t.reverse(),t)}},{key:"updateClusteredNode",value:function(e,t){if(void 0===e)throw new Error("No clusteredNodeId supplied to updateClusteredNode.");if(void 0===t)throw new Error("No newOptions supplied to updateClusteredNode.");if(void 0===this.body.nodes[e])throw new Error("The clusteredNodeId supplied to updateClusteredNode does not exist.");this.body.nodes[e].setOptions(t),this.body.emitter.emit("_dataChanged")}},{key:"updateEdge",value:function(e,t){if(void 0===e)throw new Error("No startEdgeId supplied to updateEdge.");if(void 0===t)throw new Error("No newOptions supplied to updateEdge.");if(void 0===this.body.edges[e])throw new Error("The startEdgeId supplied to updateEdge does not exist.");for(var i=this.getClusteredEdges(e),n=0;n<i.length;n++){this.body.edges[i[n]].setOptions(t)}this.body.emitter.emit("_dataChanged")}},{key:"getClusteredEdges",value:function(e){for(var t=[],i=0;void 0!==e&&void 0!==this.body.edges[e]&&i<100;)t.push(this.body.edges[e].id),e=this.body.edges[e].edgeReplacedById,i++;return t.reverse(),t}},{key:"getBaseEdge",value:function(e){return this.getBaseEdges(e)[0]}},{key:"getBaseEdges",value:function(e){for(var t=[e],i=[],n=[],o=0;t.length>0&&o<100;){var s=t.pop();if(void 0!==s){var r=this.body.edges[s];if(void 0!==r){o++;var a=r.clusteringEdgeReplacingIds;if(void 0===a)n.push(s);else for(var d=0;d<a.length;++d){var h=a[d];-1===t.indexOf(a)&&-1===i.indexOf(a)&&t.push(h)}i.push(s)}}}return n}},{key:"_getConnectedId",value:function(e,t){return e.toId!=t?e.toId:(e.fromId,e.fromId)}},{key:"_getHubSize",value:function(){for(var e=0,t=0,i=0,n=0,o=0;o<this.body.nodeIndices.length;o++){var s=this.body.nodes[this.body.nodeIndices[o]];s.edges.length>n&&(n=s.edges.length),e+=s.edges.length,t+=Math.pow(s.edges.length,2),i+=1}e/=i,t/=i;var r=t-Math.pow(e,2),a=Math.sqrt(r),d=Math.floor(e+2*a);return d>n&&(d=n),d}},{key:"_createClusteredEdge",value:function(e,t,i,n,o){var s=f.cloneOptions(i,"edge");c.deepExtend(s,n),s.from=e,s.to=t,s.id="clusterEdge:"+c.randomUUID(),void 0!==o&&c.deepExtend(s,o);var r=this.body.functions.createEdge(s);return r.clusteringEdgeReplacingIds=[i.id],r.connect(),this.body.edges[r.id]=r,r}},{key:"_clusterEdges",value:function(e,t,i,n){if(t instanceof v){var o=t,s={};s[o.id]=o,t=s}if(e instanceof g){var r=e,a={};a[r.id]=r,e=a}if(void 0===i||null===i)throw new Error("_clusterEdges: parameter clusterNode required");void 0===n&&(n=i.clusterEdgeProperties),this._createClusterEdges(e,t,i,n);for(var d in t)if(t.hasOwnProperty(d)&&void 0!==this.body.edges[d]){var h=this.body.edges[d];this._backupEdgeOptions(h),h.setOptions({physics:!1})}for(var l in e)e.hasOwnProperty(l)&&(this.clusteredNodes[l]={clusterId:i.id,node:this.body.nodes[l]},this.body.nodes[l].setOptions({physics:!1}))}},{key:"_getClusterNodeForNode",value:function(e){if(void 0!==e){var t=this.clusteredNodes[e];if(void 0!==t){var i=t.clusterId;if(void 0!==i)return this.body.nodes[i]}}}},{key:"_filter",value:function(e,t){var i=[];return c.forEach(e,function(e){t(e)&&i.push(e)}),i}},{key:"_updateState",value:function(){var e=this,t=void 0,i=[],n=[],o=function(t){c.forEach(e.body.nodes,function(e){!0===e.isCluster&&t(e)})};for(t in this.clusteredNodes)if(this.clusteredNodes.hasOwnProperty(t)){var r=this.body.nodes[t];void 0===r&&i.push(t)}o(function(e){for(var t=0;t<i.length;t++)delete e.containedNodes[i[t]]});for(var a=0;a<i.length;a++)delete this.clusteredNodes[i[a]];c.forEach(this.clusteredEdges,function(t){var i=e.body.edges[t];void 0!==i&&i.endPointsValid()||n.push(t)}),o(function(e){c.forEach(e.containedEdges,function(e,t){e.endPointsValid()||-1!==n.indexOf(t)||n.push(t)})}),c.forEach(this.body.edges,function(t,i){var o=!0,s=t.clusteringEdgeReplacingIds;if(void 0!==s){var r=0;c.forEach(s,function(t){var i=e.body.edges[t];void 0!==i&&i.endPointsValid()&&(r+=1)}),o=r>0}t.endPointsValid()&&o||n.push(i)}),o(function(t){c.forEach(n,function(i){delete t.containedEdges[i],c.forEach(t.edges,function(o,s){if(o.id===i)return void(t.edges[s]=null);o.clusteringEdgeReplacingIds=e._filter(o.clusteringEdgeReplacingIds,function(e){return-1===n.indexOf(e)})}),t.edges=e._filter(t.edges,function(e){return null!==e})})}),c.forEach(n,function(t){delete e.clusteredEdges[t]}),c.forEach(n,function(t){delete e.body.edges[t]});var d=(0,s.default)(this.body.edges);c.forEach(d,function(t){var i=e.body.edges[t],n=e._isClusteredNode(i.fromId)||e._isClusteredNode(i.toId);if(n!==e._isClusteredEdge(i.id)){if(!n)throw new Error("remove edge from clustering not implemented!");var o=e._getClusterNodeForNode(i.fromId);void 0!==o&&e._clusterEdges(e.body.nodes[i.fromId],i,o);var s=e._getClusterNodeForNode(i.toId);void 0!==s&&e._clusterEdges(e.body.nodes[i.toId],i,s)}});for(var h=!1,l=!0;l;)!function(){var t=[];o(function(e){var i=(0,s.default)(e.containedNodes).length,n=!0===e.options.allowSingleNodeCluster;(n&&i<1||!n&&i<2)&&t.push(e.id)});for(var i=0;i<t.length;++i)e.openCluster(t[i],{},!1);l=t.length>0,h=h||l}();h&&this._updateState()}},{key:"_isClusteredNode",value:function(e){return void 0!==this.clusteredNodes[e]}},{key:"_isClusteredEdge",value:function(e){return void 0!==this.clusteredEdges[e]}}]),e}();t.default=y},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(2),s=n(o),r=i(0),a=n(r),d=i(1),h=n(d),l=i(3),u=n(l),c=i(4),f=n(c),p=i(5),v=i(33).default,g=function(e){function t(e,i,n,o,r,d){(0,a.default)(this,t);var h=(0,u.default)(this,(t.__proto__||(0,s.default)(t)).call(this,e,i,n,o,r,d));return h.isCluster=!0,h.containedNodes={},h.containedEdges={},h}return(0,f.default)(t,e),(0,h.default)(t,[{key:"_openChildCluster",value:function(e){var t=this,i=this.body.nodes[e];if(void 0===this.containedNodes[e])throw new Error("node with id: "+e+" not in current cluster");if(!i.isCluster)throw new Error("node with id: "+e+" is not a cluster");delete this.containedNodes[e],p.forEach(i.edges,function(e){delete t.containedEdges[e.id]}),p.forEach(i.containedNodes,function(e,i){t.containedNodes[i]=e}),i.containedNodes={},p.forEach(i.containedEdges,function(e,i){t.containedEdges[i]=e}),i.containedEdges={},p.forEach(i.edges,function(e){p.forEach(t.edges,function(i){var n=i.clusteringEdgeReplacingIds.indexOf(e.id);-1!==n&&(p.forEach(e.clusteringEdgeReplacingIds,function(e){i.clusteringEdgeReplacingIds.push(e),t.body.edges[e].edgeReplacedById=i.id}),i.clusteringEdgeReplacingIds.splice(n,1))})}),i.edges=[]}}]),t}(v);t.default=g},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}function o(){var e;void 0!==window&&(e=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame),window.requestAnimationFrame=void 0===e?function(e){e()}:e}Object.defineProperty(t,"__esModule",{value:!0});var s=i(0),r=n(s),a=i(1),d=n(a),h=i(5),l=function(){function e(t,i){(0,r.default)(this,e),o(),this.body=t,this.canvas=i,this.redrawRequested=!1,this.renderTimer=void 0,this.requiresTimeout=!0,this.renderingActive=!1,this.renderRequests=0,this.allowRedraw=!0,this.dragging=!1,this.options={},this.defaultOptions={hideEdgesOnDrag:!1,hideNodesOnDrag:!1},h.extend(this.options,this.defaultOptions),this._determineBrowserMethod(),this.bindEventListeners()}return(0,d.default)(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("dragStart",function(){e.dragging=!0}),this.body.emitter.on("dragEnd",function(){e.dragging=!1}),this.body.emitter.on("_resizeNodes",function(){e._resizeNodes()}),this.body.emitter.on("_redraw",function(){!1===e.renderingActive&&e._redraw()}),this.body.emitter.on("_blockRedraw",function(){e.allowRedraw=!1}),this.body.emitter.on("_allowRedraw",function(){e.allowRedraw=!0,e.redrawRequested=!1}),this.body.emitter.on("_requestRedraw",this._requestRedraw.bind(this)),this.body.emitter.on("_startRendering",function(){e.renderRequests+=1,e.renderingActive=!0,e._startRendering()}),this.body.emitter.on("_stopRendering",function(){e.renderRequests-=1,e.renderingActive=e.renderRequests>0,e.renderTimer=void 0}),this.body.emitter.on("destroy",function(){e.renderRequests=0,e.allowRedraw=!1,e.renderingActive=!1,!0===e.requiresTimeout?clearTimeout(e.renderTimer):window.cancelAnimationFrame(e.renderTimer),e.body.emitter.off()})}},{key:"setOptions",value:function(e){if(void 0!==e){var t=["hideEdgesOnDrag","hideNodesOnDrag"];h.selectiveDeepExtend(t,this.options,e)}}},{key:"_requestNextFrame",value:function(e,t){if("undefined"!=typeof window){var i=void 0,n=window;return!0===this.requiresTimeout?i=n.setTimeout(e,t):n.requestAnimationFrame&&(i=n.requestAnimationFrame(e)),i}}},{key:"_startRendering",value:function(){!0===this.renderingActive&&void 0===this.renderTimer&&(this.renderTimer=this._requestNextFrame(this._renderStep.bind(this),this.simulationInterval))}},{key:"_renderStep",value:function(){!0===this.renderingActive&&(this.renderTimer=void 0,!0===this.requiresTimeout&&this._startRendering(),this._redraw(),!1===this.requiresTimeout&&this._startRendering())}},{key:"redraw",value:function(){this.body.emitter.emit("setSize"),this._redraw()}},{key:"_requestRedraw",value:function(){var e=this;!0!==this.redrawRequested&&!1===this.renderingActive&&!0===this.allowRedraw&&(this.redrawRequested=!0,this._requestNextFrame(function(){e._redraw(!1)},0))}},{key:"_redraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!0===this.allowRedraw){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1,0!==this.canvas.frame.canvas.width&&0!==this.canvas.frame.canvas.height||this.canvas.setSize(),this.canvas.setTransform();var t=this.canvas.getContext(),i=this.canvas.frame.canvas.clientWidth,n=this.canvas.frame.canvas.clientHeight;if(t.clearRect(0,0,i,n),0===this.canvas.frame.clientWidth)return;t.save(),t.translate(this.body.view.translation.x,this.body.view.translation.y),t.scale(this.body.view.scale,this.body.view.scale),t.beginPath(),this.body.emitter.emit("beforeDrawing",t),t.closePath(),!1===e&&(!1===this.dragging||!0===this.dragging&&!1===this.options.hideEdgesOnDrag)&&this._drawEdges(t),(!1===this.dragging||!0===this.dragging&&!1===this.options.hideNodesOnDrag)&&this._drawNodes(t,e),t.beginPath(),this.body.emitter.emit("afterDrawing",t),t.closePath(),t.restore(),!0===e&&t.clearRect(0,0,i,n)}}},{key:"_resizeNodes",value:function(){this.canvas.setTransform();var e=this.canvas.getContext();e.save(),e.translate(this.body.view.translation.x,this.body.view.translation.y),e.scale(this.body.view.scale,this.body.view.scale);var t=this.body.nodes,i=void 0;for(var n in t)t.hasOwnProperty(n)&&(i=t[n],i.resize(e),i.updateBoundingBox(e,i.selected));e.restore()}},{key:"_drawNodes",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.body.nodes,n=this.body.nodeIndices,o=void 0,s=[],r=this.canvas.DOMtoCanvas({x:-20,y:-20}),a=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+20,y:this.canvas.frame.canvas.clientHeight+20}),d={top:r.y,left:r.x,bottom:a.y,right:a.x},h=0;h<n.length;h++)o=i[n[h]],o.isSelected()?s.push(n[h]):!0===t?o.draw(e):!0===o.isBoundingBoxOverlappingWith(d)?o.draw(e):o.updateBoundingBox(e,o.selected);for(var l=0;l<s.length;l++)o=i[s[l]],o.draw(e)}},{key:"_drawEdges",value:function(e){for(var t=this.body.edges,i=this.body.edgeIndices,n=void 0,o=0;o<i.length;o++)n=t[i[o]],!0===n.connected&&n.draw(e)}},{key:"_determineBrowserMethod",value:function(){if("undefined"!=typeof window){var e=navigator.userAgent.toLowerCase();this.requiresTimeout=!1,-1!=e.indexOf("msie 9.0")?this.requiresTimeout=!0:-1!=e.indexOf("safari")&&e.indexOf("chrome")<=-1&&(this.requiresTimeout=!0)}else this.requiresTimeout=!0}}]),e}();t.default=l},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(0),s=n(o),r=i(1),a=n(r),d=i(22),h=i(35),l=i(5),u=function(){function e(t){(0,s.default)(this,e),this.body=t,this.pixelRatio=1,this.resizeTimer=void 0,this.resizeFunction=this._onResize.bind(this),this.cameraState={},this.initialized=!1,this.canvasViewCenter={},this.options={},this.defaultOptions={autoResize:!0,height:"100%",width:"100%"},l.extend(this.options,this.defaultOptions),this.bindEventListeners()}return(0,a.default)(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.once("resize",function(t){0!==t.width&&(e.body.view.translation.x=.5*t.width),0!==t.height&&(e.body.view.translation.y=.5*t.height)}),this.body.emitter.on("setSize",this.setSize.bind(this)),this.body.emitter.on("destroy",function(){e.hammerFrame.destroy(),e.hammer.destroy(),e._cleanUp()})}},{key:"setOptions",value:function(e){var t=this;if(void 0!==e){var i=["width","height","autoResize"];l.selectiveDeepExtend(i,this.options,e)}!0===this.options.autoResize&&(this._cleanUp(),this.resizeTimer=setInterval(function(){!0===t.setSize()&&t.body.emitter.emit("_requestRedraw")},1e3),this.resizeFunction=this._onResize.bind(this),l.addEventListener(window,"resize",this.resizeFunction))}},{key:"_cleanUp",value:function(){void 0!==this.resizeTimer&&clearInterval(this.resizeTimer),l.removeEventListener(window,"resize",this.resizeFunction),this.resizeFunction=void 0}},{key:"_onResize",value:function(){this.setSize(),this.body.emitter.emit("_redraw")}},{key:"_getCameraState",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.pixelRatio;!0===this.initialized&&(this.cameraState.previousWidth=this.frame.canvas.width/e,this.cameraState.previousHeight=this.frame.canvas.height/e,this.cameraState.scale=this.body.view.scale,this.cameraState.position=this.DOMtoCanvas({x:.5*this.frame.canvas.width/e,y:.5*this.frame.canvas.height/e}))}},{key:"_setCameraState",value:function(){if(void 0!==this.cameraState.scale&&0!==this.frame.canvas.clientWidth&&0!==this.frame.canvas.clientHeight&&0!==this.pixelRatio&&this.cameraState.previousWidth>0){var e=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,t=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight,i=this.cameraState.scale;1!=e&&1!=t?i=.5*this.cameraState.scale*(e+t):1!=e?i=this.cameraState.scale*e:1!=t&&(i=this.cameraState.scale*t),this.body.view.scale=i;var n=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),o={x:n.x-this.cameraState.position.x,y:n.y-this.cameraState.position.y};this.body.view.translation.x+=o.x*this.body.view.scale,this.body.view.translation.y+=o.y*this.body.view.scale}}},{key:"_prepareValue",value:function(e){if("number"==typeof e)return e+"px";if("string"==typeof e){if(-1!==e.indexOf("%")||-1!==e.indexOf("px"))return e;if(-1===e.indexOf("%"))return e+"px"}throw new Error("Could not use the value supplied for width or height:"+e)}},{key:"_create",value:function(){for(;this.body.container.hasChildNodes();)this.body.container.removeChild(this.body.container.firstChild);if(this.frame=document.createElement("div"),this.frame.className="vis-network",this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.tabIndex=900,this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas),this.frame.canvas.getContext)this._setPixelRatio(),this.setTransform();else{var e=document.createElement("DIV");e.style.color="red",e.style.fontWeight="bold",e.style.padding="10px",e.innerHTML="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(e)}this.body.container.appendChild(this.frame),this.body.view.scale=1,this.body.view.translation={x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight},this._bindHammer()}},{key:"_bindHammer",value:function(){var e=this;void 0!==this.hammer&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new d(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:d.DIRECTION_ALL}),h.onTouch(this.hammer,function(t){e.body.eventListeners.onTouch(t)}),this.hammer.on("tap",function(t){e.body.eventListeners.onTap(t)}),this.hammer.on("doubletap",function(t){e.body.eventListeners.onDoubleTap(t)}),this.hammer.on("press",function(t){e.body.eventListeners.onHold(t)}),this.hammer.on("panstart",function(t){e.body.eventListeners.onDragStart(t)}),this.hammer.on("panmove",function(t){e.body.eventListeners.onDrag(t)}),this.hammer.on("panend",function(t){e.body.eventListeners.onDragEnd(t)}),this.hammer.on("pinch",function(t){e.body.eventListeners.onPinch(t)}),this.frame.canvas.addEventListener("mousewheel",function(t){e.body.eventListeners.onMouseWheel(t)}),this.frame.canvas.addEventListener("DOMMouseScroll",function(t){e.body.eventListeners.onMouseWheel(t)}),this.frame.canvas.addEventListener("mousemove",function(t){e.body.eventListeners.onMouseMove(t)}),this.frame.canvas.addEventListener("contextmenu",function(t){e.body.eventListeners.onContext(t)}),this.hammerFrame=new d(this.frame),h.onRelease(this.hammerFrame,function(t){e.body.eventListeners.onRelease(t)})}},{key:"setSize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.width,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.height;e=this._prepareValue(e),t=this._prepareValue(t);var i=!1,n=this.frame.canvas.width,o=this.frame.canvas.height,s=this.pixelRatio;if(this._setPixelRatio(),e!=this.options.width||t!=this.options.height||this.frame.style.width!=e||this.frame.style.height!=t)this._getCameraState(s),this.frame.style.width=e,this.frame.style.height=t,this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),this.options.width=e,this.options.height=t,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},i=!0;else{var r=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),a=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);this.frame.canvas.width===r&&this.frame.canvas.height===a||this._getCameraState(s),this.frame.canvas.width!==r&&(this.frame.canvas.width=r,i=!0),this.frame.canvas.height!==a&&(this.frame.canvas.height=a,i=!0)}return!0===i&&(this.body.emitter.emit("resize",{width:Math.round(this.frame.canvas.width/this.pixelRatio),height:Math.round(this.frame.canvas.height/this.pixelRatio),oldWidth:Math.round(n/this.pixelRatio),oldHeight:Math.round(o/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,i}},{key:"getContext",value:function(){return this.frame.canvas.getContext("2d")}},{key:"_determinePixelRatio",value:function(){var e=this.getContext();if(void 0===e)throw new Error("Could not get canvax context");var t=1;return"undefined"!=typeof window&&(t=window.devicePixelRatio||1),t/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}},{key:"_setPixelRatio",value:function(){this.pixelRatio=this._determinePixelRatio()}},{key:"setTransform",value:function(){var e=this.getContext();if(void 0===e)throw new Error("Could not get canvax context");e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}},{key:"_XconvertDOMtoCanvas",value:function(e){return(e-this.body.view.translation.x)/this.body.view.scale}},{key:"_XconvertCanvasToDOM",value:function(e){return e*this.body.view.scale+this.body.view.translation.x}},{key:"_YconvertDOMtoCanvas",value:function(e){return(e-this.body.view.translation.y)/this.body.view.scale}},{key:"_YconvertCanvasToDOM",value:function(e){return e*this.body.view.scale+this.body.view.translation.y}},{key:"canvasToDOM",value:function(e){return{x:this._XconvertCanvasToDOM(e.x),y:this._YconvertCanvasToDOM(e.y)}}},{key:"DOMtoCanvas",value:function(e){return{x:this._XconvertDOMtoCanvas(e.x),y:this._YconvertDOMtoCanvas(e.y)}}}]),e}();t.default=u},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(0),s=n(o),r=i(1),a=n(r),d=i(5),h=i(57).default,l=function(){function e(t,i){var n=this;(0,s.default)(this,e),this.body=t,this.canvas=i,this.animationSpeed=1/this.renderRefreshRate,this.animationEasingFunction="easeInOutQuint",this.easingTime=0,this.sourceScale=0,this.targetScale=0,this.sourceTranslation=0,this.targetTranslation=0,this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0,this.touchTime=0,this.viewFunction=void 0,this.body.emitter.on("fit",this.fit.bind(this)),this.body.emitter.on("animationFinished",function(){n.body.emitter.emit("_stopRendering")}),this.body.emitter.on("unlockNode",this.releaseNode.bind(this))}return(0,a.default)(e,[{key:"setOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=e}},{key:"fit",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{nodes:[]},t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=void 0,n=void 0;if(void 0!==e.nodes&&0!==e.nodes.length||(e.nodes=this.body.nodeIndices),!0===t){var o=0;for(var s in this.body.nodes)if(this.body.nodes.hasOwnProperty(s)){var r=this.body.nodes[s];!0===r.predefinedPosition&&(o+=1)}if(o>.5*this.body.nodeIndices.length)return void this.fit(e,!1);i=h.getRange(this.body.nodes,e.nodes);n=12.662/(this.body.nodeIndices.length+7.4147)+.0964822;n*=Math.min(this.canvas.frame.canvas.clientWidth/600,this.canvas.frame.canvas.clientHeight/600)}else{this.body.emitter.emit("_resizeNodes"),i=h.getRange(this.body.nodes,e.nodes);var a=1.1*Math.abs(i.maxX-i.minX),d=1.1*Math.abs(i.maxY-i.minY),l=this.canvas.frame.canvas.clientWidth/a,u=this.canvas.frame.canvas.clientHeight/d;n=l<=u?l:u}n>1?n=1:0===n&&(n=1);var c=h.findCenter(i),f={position:c,scale:n,animation:e.animation};this.moveTo(f)}},{key:"focus",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(void 0!==this.body.nodes[e]){var i={x:this.body.nodes[e].x,y:this.body.nodes[e].y};t.position=i,t.lockedOnNode=e,this.moveTo(t)}else console.log("Node: "+e+" cannot be found.")}},{key:"moveTo",value:function(e){if(void 0===e)return void(e={});void 0===e.offset&&(e.offset={x:0,y:0}),void 0===e.offset.x&&(e.offset.x=0),void 0===e.offset.y&&(e.offset.y=0),void 0===e.scale&&(e.scale=this.body.view.scale),void 0===e.position&&(e.position=this.getViewPosition()),void 0===e.animation&&(e.animation={duration:0}),!1===e.animation&&(e.animation={duration:0}),!0===e.animation&&(e.animation={}),void 0===e.animation.duration&&(e.animation.duration=1e3),void 0===e.animation.easingFunction&&(e.animation.easingFunction="easeInOutQuad"),this.animateView(e)}},{key:"animateView",value:function(e){if(void 0!==e){this.animationEasingFunction=e.animation.easingFunction,this.releaseNode(),!0===e.locked&&(this.lockedOnNodeId=e.lockedOnNode,this.lockedOnNodeOffset=e.offset),0!=this.easingTime&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=e.scale,this.body.view.scale=this.targetScale;var t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),i={x:t.x-e.position.x,y:t.y-e.position.y};this.targetTranslation={x:this.sourceTranslation.x+i.x*this.targetScale+e.offset.x,y:this.sourceTranslation.y+i.y*this.targetScale+e.offset.y},0===e.animation.duration?void 0!=this.lockedOnNodeId?(this.viewFunction=this._lockedRedraw.bind(this),this.body.emitter.on("initRedraw",this.viewFunction)):(this.body.view.scale=this.targetScale,this.body.view.translation=this.targetTranslation,this.body.emitter.emit("_requestRedraw")):(this.animationSpeed=1/(60*e.animation.duration*.001)||1/60,this.animationEasingFunction=e.animation.easingFunction,this.viewFunction=this._transitionRedraw.bind(this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering"))}}},{key:"_lockedRedraw",value:function(){var e={x:this.body.nodes[this.lockedOnNodeId].x,y:this.body.nodes[this.lockedOnNodeId].y},t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),i={x:t.x-e.x,y:t.y-e.y},n=this.body.view.translation,o={x:n.x+i.x*this.body.view.scale+this.lockedOnNodeOffset.x,y:n.y+i.y*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=o}},{key:"releaseNode",value:function(){void 0!==this.lockedOnNodeId&&void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}},{key:"_transitionRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.easingTime+=this.animationSpeed,this.easingTime=!0===e?1:this.easingTime;var t=d.easingFunctions[this.animationEasingFunction](this.easingTime);this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*t,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*t,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*t},this.easingTime>=1&&(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,void 0!=this.lockedOnNodeId&&(this.viewFunction=this._lockedRedraw.bind(this),this.body.emitter.on("initRedraw",this.viewFunction)),this.body.emitter.emit("animationFinished"))}},{key:"getScale",value:function(){return this.body.view.scale}},{key:"getViewPosition",value:function(){return this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight})}}]),e}();t.default=l},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(0),s=n(o),r=i(1),a=n(r),d=i(5),h=i(182).default,l=i(183).default,u=function(){function e(t,i,n){(0,s.default)(this,e),this.body=t,this.canvas=i,this.selectionHandler=n,this.navigationHandler=new h(t,i),this.body.eventListeners.onTap=this.onTap.bind(this),this.body.eventListeners.onTouch=this.onTouch.bind(this),this.body.eventListeners.onDoubleTap=this.onDoubleTap.bind(this),this.body.eventListeners.onHold=this.onHold.bind(this),this.body.eventListeners.onDragStart=this.onDragStart.bind(this),this.body.eventListeners.onDrag=this.onDrag.bind(this),this.body.eventListeners.onDragEnd=this.onDragEnd.bind(this),this.body.eventListeners.onMouseWheel=this.onMouseWheel.bind(this),this.body.eventListeners.onPinch=this.onPinch.bind(this),this.body.eventListeners.onMouseMove=this.onMouseMove.bind(this),this.body.eventListeners.onRelease=this.onRelease.bind(this),this.body.eventListeners.onContext=this.onContext.bind(this),this.touchTime=0,this.drag={},this.pinch={},this.popup=void 0,this.popupObj=void 0,this.popupTimer=void 0,this.body.functions.getPointer=this.getPointer.bind(this),this.options={},this.defaultOptions={dragNodes:!0,dragView:!0,hover:!1,keyboard:{enabled:!1,speed:{x:10,y:10,zoom:.02},bindToWindow:!0},navigationButtons:!1,tooltipDelay:300,zoomView:!0},d.extend(this.options,this.defaultOptions),this.bindEventListeners()}return(0,a.default)(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("destroy",function(){clearTimeout(e.popupTimer),delete e.body.functions.getPointer})}},{key:"setOptions",value:function(e){if(void 0!==e){var t=["hideEdgesOnDrag","hideNodesOnDrag","keyboard","multiselect","selectable","selectConnectedEdges"];d.selectiveNotDeepExtend(t,this.options,e),d.mergeOptions(this.options,e,"keyboard"),e.tooltip&&(d.extend(this.options.tooltip,e.tooltip),e.tooltip.color&&(this.options.tooltip.color=d.parseColor(e.tooltip.color)))}this.navigationHandler.setOptions(this.options)}},{key:"getPointer",value:function(e){return{x:e.x-d.getAbsoluteLeft(this.canvas.frame.canvas),y:e.y-d.getAbsoluteTop(this.canvas.frame.canvas)}}},{key:"onTouch",value:function(e){(new Date).valueOf()-this.touchTime>50&&(this.drag.pointer=this.getPointer(e.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=(new Date).valueOf())}},{key:"onTap",value:function(e){var t=this.getPointer(e.center),i=this.selectionHandler.options.multiselect&&(e.changedPointers[0].ctrlKey||e.changedPointers[0].metaKey);this.checkSelectionChanges(t,e,i),this.selectionHandler._generateClickEvent("click",e,t)}},{key:"onDoubleTap",value:function(e){var t=this.getPointer(e.center);this.selectionHandler._generateClickEvent("doubleClick",e,t)}},{key:"onHold",value:function(e){var t=this.getPointer(e.center),i=this.selectionHandler.options.multiselect;this.checkSelectionChanges(t,e,i),this.selectionHandler._generateClickEvent("click",e,t),this.selectionHandler._generateClickEvent("hold",e,t)}},{key:"onRelease",value:function(e){if((new Date).valueOf()-this.touchTime>10){var t=this.getPointer(e.center);this.selectionHandler._generateClickEvent("release",e,t),this.touchTime=(new Date).valueOf()}}},{key:"onContext",value:function(e){var t=this.getPointer({x:e.clientX,y:e.clientY});this.selectionHandler._generateClickEvent("oncontext",e,t)}},{key:"checkSelectionChanges",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=this.selectionHandler.getSelection(),o=!1;o=!0===i?this.selectionHandler.selectAdditionalOnPoint(e):this.selectionHandler.selectOnPoint(e);var s=this.selectionHandler.getSelection(),r=this._determineDifference(n,s),a=this._determineDifference(s,n);r.edges.length>0&&(this.selectionHandler._generateClickEvent("deselectEdge",t,e,n),o=!0),r.nodes.length>0&&(this.selectionHandler._generateClickEvent("deselectNode",t,e,n),o=!0),a.nodes.length>0&&(this.selectionHandler._generateClickEvent("selectNode",t,e),o=!0),a.edges.length>0&&(this.selectionHandler._generateClickEvent("selectEdge",t,e),o=!0),!0===o&&this.selectionHandler._generateClickEvent("select",t,e)}},{key:"_determineDifference",value:function(e,t){var i=function(e,t){for(var i=[],n=0;n<e.length;n++){var o=e[n];-1===t.indexOf(o)&&i.push(o)}return i};return{nodes:i(e.nodes,t.nodes),edges:i(e.edges,t.edges)}}},{key:"onDragStart",value:function(e){void 0===this.drag.pointer&&this.onTouch(e);var t=this.selectionHandler.getNodeAt(this.drag.pointer);if(this.drag.dragging=!0,this.drag.selection=[],this.drag.translation=d.extend({},this.body.view.translation),this.drag.nodeId=void 0,void 0!==t&&!0===this.options.dragNodes){this.drag.nodeId=t.id,!1===t.isSelected()&&(this.selectionHandler.unselectAll(),this.selectionHandler.selectObject(t)),this.selectionHandler._generateClickEvent("dragStart",e,this.drag.pointer);var i=this.selectionHandler.selectionObj.nodes;for(var n in i)if(i.hasOwnProperty(n)){var o=i[n],s={id:o.id,node:o,x:o.x,y:o.y,xFixed:o.options.fixed.x,yFixed:o.options.fixed.y};o.options.fixed.x=!0,o.options.fixed.y=!0,this.drag.selection.push(s)}}else this.selectionHandler._generateClickEvent("dragStart",e,this.drag.pointer,void 0,!0)}},{key:"onDrag",value:function(e){var t=this;if(!0!==this.drag.pinched){this.body.emitter.emit("unlockNode");var i=this.getPointer(e.center),n=this.drag.selection;if(n&&n.length&&!0===this.options.dragNodes){this.selectionHandler._generateClickEvent("dragging",e,i);var o=i.x-this.drag.pointer.x,s=i.y-this.drag.pointer.y;n.forEach(function(e){var i=e.node;!1===e.xFixed&&(i.x=t.canvas._XconvertDOMtoCanvas(t.canvas._XconvertCanvasToDOM(e.x)+o)),!1===e.yFixed&&(i.y=t.canvas._YconvertDOMtoCanvas(t.canvas._YconvertCanvasToDOM(e.y)+s))}),this.body.emitter.emit("startSimulation")}else if(!0===this.options.dragView){if(this.selectionHandler._generateClickEvent("dragging",e,i,void 0,!0),void 0===this.drag.pointer)return void this.onDragStart(e);var r=i.x-this.drag.pointer.x,a=i.y-this.drag.pointer.y;this.body.view.translation={x:this.drag.translation.x+r,y:this.drag.translation.y+a},this.body.emitter.emit("_requestRedraw")}}}},{key:"onDragEnd",value:function(e){this.drag.dragging=!1;var t=this.drag.selection;t&&t.length?(t.forEach(function(e){e.node.options.fixed.x=e.xFixed,e.node.options.fixed.y=e.yFixed}),this.selectionHandler._generateClickEvent("dragEnd",e,this.getPointer(e.center)),this.body.emitter.emit("startSimulation")):(this.selectionHandler._generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw"))}},{key:"onPinch",value:function(e){var t=this.getPointer(e.center);this.drag.pinched=!0,void 0===this.pinch.scale&&(this.pinch.scale=1);var i=this.pinch.scale*e.scale;this.zoom(i,t)}},{key:"zoom",value:function(e,t){if(!0===this.options.zoomView){var i=this.body.view.scale;e<1e-5&&(e=1e-5),e>10&&(e=10);var n=void 0;void 0!==this.drag&&!0===this.drag.dragging&&(n=this.canvas.DOMtoCanvas(this.drag.pointer));var o=this.body.view.translation,s=e/i,r=(1-s)*t.x+o.x*s,a=(1-s)*t.y+o.y*s;if(this.body.view.scale=e,this.body.view.translation={x:r,y:a},void 0!=n){var d=this.canvas.canvasToDOM(n);this.drag.pointer.x=d.x,this.drag.pointer.y=d.y}this.body.emitter.emit("_requestRedraw"),i<e?this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:t}):this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:t})}}},{key:"onMouseWheel",value:function(e){if(!0===this.options.zoomView){var t=0;if(e.wheelDelta?t=e.wheelDelta/120:e.detail&&(t=-e.detail/3),0!==t){var i=this.body.view.scale,n=t/10;t<0&&(n/=1-n),i*=1+n;var o=this.getPointer({x:e.clientX,y:e.clientY});this.zoom(i,o)}e.preventDefault()}}},{key:"onMouseMove",value:function(e){var t=this,i=this.getPointer({x:e.clientX,y:e.clientY}),n=!1;void 0!==this.popup&&(!1===this.popup.hidden&&this._checkHidePopup(i),!1===this.popup.hidden&&(n=!0,this.popup.setPosition(i.x+3,i.y-5),this.popup.show())),!1===this.options.keyboard.bindToWindow&&!0===this.options.keyboard.enabled&&this.canvas.frame.focus(),!1===n&&(void 0!==this.popupTimer&&(clearInterval(this.popupTimer),this.popupTimer=void 0),this.drag.dragging||(this.popupTimer=setTimeout(function(){return t._checkShowPopup(i)},this.options.tooltipDelay))),!0===this.options.hover&&this.selectionHandler.hoverObject(e,i)}},{key:"_checkShowPopup",value:function(e){var t=this.canvas._XconvertDOMtoCanvas(e.x),i=this.canvas._YconvertDOMtoCanvas(e.y),n={left:t,top:i,right:t,bottom:i},o=void 0===this.popupObj?void 0:this.popupObj.id,s=!1,r="node";if(void 0===this.popupObj){for(var a=this.body.nodeIndices,d=this.body.nodes,h=void 0,u=[],c=0;c<a.length;c++)h=d[a[c]],!0===h.isOverlappingWith(n)&&void 0!==h.getTitle()&&u.push(a[c]);u.length>0&&(this.popupObj=d[u[u.length-1]],s=!0)}if(void 0===this.popupObj&&!1===s){for(var f=this.body.edgeIndices,p=this.body.edges,v=void 0,g=[],y=0;y<f.length;y++)v=p[f[y]],!0===v.isOverlappingWith(n)&&!0===v.connected&&void 0!==v.getTitle()&&g.push(f[y]);g.length>0&&(this.popupObj=p[g[g.length-1]],r="edge")}void 0!==this.popupObj?this.popupObj.id!==o&&(void 0===this.popup&&(this.popup=new l(this.canvas.frame)),this.popup.popupTargetType=r,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(e.x+3,e.y-5),this.popup.setText(this.popupObj.getTitle()),this.popup.show(),this.body.emitter.emit("showPopup",this.popupObj.id)):void 0!==this.popup&&(this.popup.hide(),this.body.emitter.emit("hidePopup"))}},{key:"_checkHidePopup",value:function(e){var t=this.selectionHandler._pointerToPositionObject(e),i=!1;if("node"===this.popup.popupTargetType){if(void 0!==this.body.nodes[this.popup.popupTargetId]&&!0===(i=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(t))){var n=this.selectionHandler.getNodeAt(e);i=void 0!==n&&n.id===this.popup.popupTargetId}}else void 0===this.selectionHandler.getNodeAt(e)&&void 0!==this.body.edges[this.popup.popupTargetId]&&(i=this.body.edges[this.popup.popupTargetId].isOverlappingWith(t));!1===i&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}}]),e}();t.default=u},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(0),s=n(o),r=i(1),a=n(r),d=i(22),h=i(35),l=i(52),u=function(){function e(t,i){var n=this;(0,s.default)(this,e),this.body=t,this.canvas=i,this.iconsCreated=!1,this.navigationHammers=[],this.boundFunctions={},this.touchTime=0,this.activated=!1,this.body.emitter.on("activate",function(){n.activated=!0,n.configureKeyboardBindings()}),this.body.emitter.on("deactivate",function(){n.activated=!1,n.configureKeyboardBindings()}),this.body.emitter.on("destroy",function(){void 0!==n.keycharm&&n.keycharm.destroy()}),this.options={}}return(0,a.default)(e,[{key:"setOptions",value:function(e){void 0!==e&&(this.options=e,this.create())}},{key:"create",value:function(){!0===this.options.navigationButtons?!1===this.iconsCreated&&this.loadNavigationElements():!0===this.iconsCreated&&this.cleanNavigation(),this.configureKeyboardBindings()}},{key:"cleanNavigation",value:function(){if(0!=this.navigationHammers.length){for(var e=0;e<this.navigationHammers.length;e++)this.navigationHammers[e].destroy();this.navigationHammers=[]}this.navigationDOM&&this.navigationDOM.wrapper&&this.navigationDOM.wrapper.parentNode&&this.navigationDOM.wrapper.parentNode.removeChild(this.navigationDOM.wrapper),this.iconsCreated=!1}},{key:"loadNavigationElements",value:function(){var e=this;this.cleanNavigation(),this.navigationDOM={};var t=["up","down","left","right","zoomIn","zoomOut","zoomExtends"],i=["_moveUp","_moveDown","_moveLeft","_moveRight","_zoomIn","_zoomOut","_fit"];this.navigationDOM.wrapper=document.createElement("div"),this.navigationDOM.wrapper.className="vis-navigation",this.canvas.frame.appendChild(this.navigationDOM.wrapper);for(var n=0;n<t.length;n++){this.navigationDOM[t[n]]=document.createElement("div"),this.navigationDOM[t[n]].className="vis-button vis-"+t[n],this.navigationDOM.wrapper.appendChild(this.navigationDOM[t[n]]);var o=new d(this.navigationDOM[t[n]]);"_fit"===i[n]?h.onTouch(o,this._fit.bind(this)):h.onTouch(o,this.bindToRedraw.bind(this,i[n])),this.navigationHammers.push(o)}var s=new d(this.canvas.frame);h.onRelease(s,function(){e._stopMovement()}),this.navigationHammers.push(s),this.iconsCreated=!0}},{key:"bindToRedraw",value:function(e){void 0===this.boundFunctions[e]&&(this.boundFunctions[e]=this[e].bind(this),this.body.emitter.on("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_startRendering"))}},{key:"unbindFromRedraw",value:function(e){void 0!==this.boundFunctions[e]&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"),delete this.boundFunctions[e])}},{key:"_fit",value:function(){(new Date).valueOf()-this.touchTime>700&&(this.body.emitter.emit("fit",{duration:700}),this.touchTime=(new Date).valueOf())}},{key:"_stopMovement",value:function(){for(var e in this.boundFunctions)this.boundFunctions.hasOwnProperty(e)&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"));this.boundFunctions={}}},{key:"_moveUp",value:function(){this.body.view.translation.y+=this.options.keyboard.speed.y}},{key:"_moveDown",value:function(){this.body.view.translation.y-=this.options.keyboard.speed.y}},{key:"_moveLeft",value:function(){this.body.view.translation.x+=this.options.keyboard.speed.x}},{key:"_moveRight",value:function(){this.body.view.translation.x-=this.options.keyboard.speed.x}},{key:"_zoomIn",value:function(){var e=this.body.view.scale,t=this.body.view.scale*(1+this.options.keyboard.speed.zoom),i=this.body.view.translation,n=t/e,o=(1-n)*this.canvas.canvasViewCenter.x+i.x*n,s=(1-n)*this.canvas.canvasViewCenter.y+i.y*n;this.body.view.scale=t,this.body.view.translation={x:o,y:s},this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:null})}},{key:"_zoomOut",value:function(){var e=this.body.view.scale,t=this.body.view.scale/(1+this.options.keyboard.speed.zoom),i=this.body.view.translation,n=t/e,o=(1-n)*this.canvas.canvasViewCenter.x+i.x*n,s=(1-n)*this.canvas.canvasViewCenter.y+i.y*n;this.body.view.scale=t,this.body.view.translation={x:o,y:s},this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:null})}},{key:"configureKeyboardBindings",value:function(){var e=this;void 0!==this.keycharm&&this.keycharm.destroy(),!0===this.options.keyboard.enabled&&(!0===this.options.keyboard.bindToWindow?this.keycharm=l({container:window,preventDefault:!0}):this.keycharm=l({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),!0===this.activated&&(this.keycharm.bind("up",function(){e.bindToRedraw("_moveUp")},"keydown"),this.keycharm.bind("down",function(){e.bindToRedraw("_moveDown")},"keydown"),this.keycharm.bind("left",function(){e.bindToRedraw("_moveLeft")},"keydown"),this.keycharm.bind("right",function(){e.bindToRedraw("_moveRight")},"keydown"),this.keycharm.bind("=",function(){e.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("num+",function(){e.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("num-",function(){e.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("-",function(){e.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("[",function(){e.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("]",function(){e.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("pageup",function(){e.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("pagedown",function(){e.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("up",function(){e.unbindFromRedraw("_moveUp")},"keyup"),this.keycharm.bind("down",function(){e.unbindFromRedraw("_moveDown")},"keyup"),this.keycharm.bind("left",function(){e.unbindFromRedraw("_moveLeft")},"keyup"),this.keycharm.bind("right",function(){e.unbindFromRedraw("_moveRight")},"keyup"),this.keycharm.bind("=",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("num+",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("num-",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),this.keycharm.bind("-",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),this.keycharm.bind("[",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),this.keycharm.bind("]",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("pageup",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("pagedown",function(){e.unbindFromRedraw("_zoomOut")},"keyup")))}}]),e}();t.default=u},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(0),s=n(o),r=i(1),a=n(r),d=function(){function e(t,i){(0,s.default)(this,e),this.container=t,this.overflowMethod=i||"cap",this.x=0,this.y=0,this.padding=5,this.hidden=!1,this.frame=document.createElement("div"),this.frame.className="vis-tooltip",this.container.appendChild(this.frame)}return(0,a.default)(e,[{key:"setPosition",value:function(e,t){this.x=parseInt(e),this.y=parseInt(t)}},{key:"setText",value:function(e){e instanceof Element?(this.frame.innerHTML="",this.frame.appendChild(e)):this.frame.innerHTML=e}},{key:"show",value:function(e){if(void 0===e&&(e=!0),!0===e){var t=this.frame.clientHeight,i=this.frame.clientWidth,n=this.frame.parentNode.clientHeight,o=this.frame.parentNode.clientWidth,s=0,r=0;if("flip"==this.overflowMethod){var a=!1,d=!0;this.y-t<this.padding&&(d=!1),this.x+i>o-this.padding&&(a=!0),s=a?this.x-i:this.x,r=d?this.y-t:this.y}else r=this.y-t,r+t+this.padding>n&&(r=n-t-this.padding),r<this.padding&&(r=this.padding),s=this.x,s+i+this.padding>o&&(s=o-i-this.padding),s<this.padding&&(s=this.padding);this.frame.style.left=s+"px",this.frame.style.top=r+"px",this.frame.style.visibility="visible",this.hidden=!1}else this.hide()}},{key:"hide",value:function(){this.hidden=!0,this.frame.style.left="0",this.frame.style.top="0",this.frame.style.visibility="hidden"}},{key:"destroy",value:function(){this.frame.parentNode.removeChild(this.frame)}}]),e}();t.default=d},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(0),s=n(o),r=i(1),a=n(r),d=i(33).default,h=i(55).default,l=i(5),u=function(){function e(t,i){var n=this;(0,s.default)(this,e),this.body=t,this.canvas=i,this.selectionObj={nodes:[],edges:[]},this.hoverObj={nodes:{},edges:{}},this.options={},this.defaultOptions={multiselect:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0},l.extend(this.options,this.defaultOptions),this.body.emitter.on("_dataChanged",function(){n.updateSelection()})}return(0,a.default)(e,[{key:"setOptions",value:function(e){if(void 0!==e){var t=["multiselect","hoverConnectedEdges","selectable","selectConnectedEdges"];l.selectiveDeepExtend(t,this.options,e)}}},{key:"selectOnPoint",value:function(e){var t=!1;if(!0===this.options.selectable){var i=this.getNodeAt(e)||this.getEdgeAt(e);this.unselectAll(),void 0!==i&&(t=this.selectObject(i)),this.body.emitter.emit("_requestRedraw")}return t}},{key:"selectAdditionalOnPoint",value:function(e){var t=!1;if(!0===this.options.selectable){var i=this.getNodeAt(e)||this.getEdgeAt(e);void 0!==i&&(t=!0,!0===i.isSelected()?this.deselectObject(i):this.selectObject(i),this.body.emitter.emit("_requestRedraw"))}return t}},{key:"_initBaseEvent",value:function(e,t){var i={};return i.pointer={DOM:{x:t.x,y:t.y},canvas:this.canvas.DOMtoCanvas(t)},i.event=e,i}},{key:"_generateClickEvent",value:function(e,t,i,n){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=this._initBaseEvent(t,i);if(!0===o)s.nodes=[],s.edges=[];else{var r=this.getSelection();s.nodes=r.nodes,s.edges=r.edges}void 0!==n&&(s.previousSelection=n),"click"==e&&(s.items=this.getClickedItems(i)),this.body.emitter.emit(e,s)}},{key:"selectObject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.selectConnectedEdges;return void 0!==e&&(e instanceof d&&!0===t&&this._selectConnectedEdges(e),e.select(),this._addToSelection(e),!0)}},{key:"deselectObject",value:function(e){!0===e.isSelected()&&(e.selected=!1,this._removeFromSelection(e))}},{key:"_getAllNodesOverlappingWith",value:function(e){for(var t=[],i=this.body.nodes,n=0;n<this.body.nodeIndices.length;n++){var o=this.body.nodeIndices[n];i[o].isOverlappingWith(e)&&t.push(o)}return t}},{key:"_pointerToPositionObject",value:function(e){var t=this.canvas.DOMtoCanvas(e);return{left:t.x-1,top:t.y+1,right:t.x+1,bottom:t.y-1}}},{key:"getNodeAt",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this._pointerToPositionObject(e),n=this._getAllNodesOverlappingWith(i);return n.length>0?!0===t?this.body.nodes[n[n.length-1]]:n[n.length-1]:void 0}},{key:"_getEdgesOverlappingWith",value:function(e,t){for(var i=this.body.edges,n=0;n<this.body.edgeIndices.length;n++){var o=this.body.edgeIndices[n];i[o].isOverlappingWith(e)&&t.push(o)}}},{key:"_getAllEdgesOverlappingWith",value:function(e){var t=[];return this._getEdgesOverlappingWith(e,t),t}},{key:"getEdgeAt",value:function(e){for(var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.canvas.DOMtoCanvas(e),n=10,o=null,s=this.body.edges,r=0;r<this.body.edgeIndices.length;r++){var a=this.body.edgeIndices[r],d=s[a];if(d.connected){var h=d.from.x,l=d.from.y,u=d.to.x,c=d.to.y,f=d.edgeType.getDistanceToEdge(h,l,u,c,i.x,i.y);f<n&&(o=a,n=f)}}return null!==o?!0===t?this.body.edges[o]:o:void 0}},{key:"_addToSelection",value:function(e){e instanceof d?this.selectionObj.nodes[e.id]=e:this.selectionObj.edges[e.id]=e}},{key:"_addToHover",value:function(e){e instanceof d?this.hoverObj.nodes[e.id]=e:this.hoverObj.edges[e.id]=e}},{key:"_removeFromSelection",value:function(e){e instanceof d?(delete this.selectionObj.nodes[e.id],this._unselectConnectedEdges(e)):delete this.selectionObj.edges[e.id]}},{key:"unselectAll",value:function(){for(var e in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(e)&&this.selectionObj.nodes[e].unselect();for(var t in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(t)&&this.selectionObj.edges[t].unselect();this.selectionObj={nodes:{},edges:{}}}},{key:"_getSelectedNodeCount",value:function(){var e=0;for(var t in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(t)&&(e+=1);return e}},{key:"_getSelectedNode",value:function(){for(var e in this.selectionObj.nodes)if(this.selectionObj.nodes.hasOwnProperty(e))return this.selectionObj.nodes[e]}},{key:"_getSelectedEdge",value:function(){for(var e in this.selectionObj.edges)if(this.selectionObj.edges.hasOwnProperty(e))return this.selectionObj.edges[e]}},{key:"_getSelectedEdgeCount",value:function(){var e=0;for(var t in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(t)&&(e+=1);return e}},{key:"_getSelectedObjectCount",value:function(){var e=0;for(var t in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(t)&&(e+=1);for(var i in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(i)&&(e+=1);return e}},{key:"_selectionIsEmpty",value:function(){for(var e in this.selectionObj.nodes)if(this.selectionObj.nodes.hasOwnProperty(e))return!1;for(var t in this.selectionObj.edges)if(this.selectionObj.edges.hasOwnProperty(t))return!1;return!0}},{key:"_clusterInSelection",value:function(){for(var e in this.selectionObj.nodes)if(this.selectionObj.nodes.hasOwnProperty(e)&&this.selectionObj.nodes[e].clusterSize>1)return!0;return!1}},{key:"_selectConnectedEdges",value:function(e){for(var t=0;t<e.edges.length;t++){var i=e.edges[t];i.select(),this._addToSelection(i)}}},{key:"_hoverConnectedEdges",value:function(e){for(var t=0;t<e.edges.length;t++){var i=e.edges[t];i.hover=!0,this._addToHover(i)}}},{key:"_unselectConnectedEdges",value:function(e){for(var t=0;t<e.edges.length;t++){var i=e.edges[t];i.unselect(),this._removeFromSelection(i)}}},{key:"emitBlurEvent",value:function(e,t,i){var n=this._initBaseEvent(e,t);!0===i.hover&&(i.hover=!1,i instanceof d?(n.node=i.id,this.body.emitter.emit("blurNode",n)):(n.edge=i.id,this.body.emitter.emit("blurEdge",n)))}},{key:"emitHoverEvent",value:function(e,t,i){var n=this._initBaseEvent(e,t),o=!1;return!1===i.hover&&(i.hover=!0,this._addToHover(i),o=!0,i instanceof d?(n.node=i.id,this.body.emitter.emit("hoverNode",n)):(n.edge=i.id,this.body.emitter.emit("hoverEdge",n))),o}},{key:"hoverObject",value:function(e,t){var i=this.getNodeAt(t);void 0===i&&(i=this.getEdgeAt(t));var n=!1;for(var o in this.hoverObj.nodes)this.hoverObj.nodes.hasOwnProperty(o)&&(void 0===i||i instanceof d&&i.id!=o||i instanceof h)&&(this.emitBlurEvent(e,t,this.hoverObj.nodes[o]),delete this.hoverObj.nodes[o],n=!0);for(var s in this.hoverObj.edges)this.hoverObj.edges.hasOwnProperty(s)&&(!0===n?(this.hoverObj.edges[s].hover=!1,delete this.hoverObj.edges[s]):(void 0===i||i instanceof h&&i.id!=s||i instanceof d&&!i.hover)&&(this.emitBlurEvent(e,t,this.hoverObj.edges[s]),delete this.hoverObj.edges[s],n=!0));void 0!==i&&(n=n||this.emitHoverEvent(e,t,i),i instanceof d&&!0===this.options.hoverConnectedEdges&&this._hoverConnectedEdges(i)),!0===n&&this.body.emitter.emit("_requestRedraw")}},{key:"getSelection",value:function(){return{nodes:this.getSelectedNodes(),edges:this.getSelectedEdges()}}},{key:"getSelectedNodes",value:function(){var e=[];if(!0===this.options.selectable)for(var t in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(t)&&e.push(this.selectionObj.nodes[t].id);return e}},{key:"getSelectedEdges",value:function(){var e=[];if(!0===this.options.selectable)for(var t in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(t)&&e.push(this.selectionObj.edges[t].id);return e}},{key:"setSelection",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=void 0,n=void 0;if(!e||!e.nodes&&!e.edges)throw"Selection must be an object with nodes and/or edges properties";if((t.unselectAll||void 0===t.unselectAll)&&this.unselectAll(),e.nodes)for(i=0;i<e.nodes.length;i++){n=e.nodes[i];var o=this.body.nodes[n];if(!o)throw new RangeError('Node with id "'+n+'" not found');this.selectObject(o,t.highlightEdges)}if(e.edges)for(i=0;i<e.edges.length;i++){n=e.edges[i];var s=this.body.edges[n];if(!s)throw new RangeError('Edge with id "'+n+'" not found');this.selectObject(s)}this.body.emitter.emit("_requestRedraw")}},{key:"selectNodes",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!e||void 0===e.length)throw"Selection must be an array with ids";this.setSelection({nodes:e},{highlightEdges:t})}},{key:"selectEdges",value:function(e){if(!e||void 0===e.length)throw"Selection must be an array with ids";this.setSelection({edges:e})}},{key:"updateSelection",value:function(){for(var e in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(e)&&(this.body.nodes.hasOwnProperty(e)||delete this.selectionObj.nodes[e]);for(var t in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(t)&&(this.body.edges.hasOwnProperty(t)||delete this.selectionObj.edges[t])}},{key:"getClickedItems",value:function(e){for(var t=this.canvas.DOMtoCanvas(e),i=[],n=this.body.nodeIndices,o=this.body.nodes,s=n.length-1;s>=0;s--){var r=o[n[s]],a=r.getItemsOnPoint(t);i.push.apply(i,a)}for(var d=this.body.edgeIndices,h=this.body.edges,l=d.length-1;l>=0;l--){var u=h[d[l]],c=u.getItemsOnPoint(t);i.push.apply(i,c)}return i}}]),e}();t.default=u},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(23),s=n(o),r=i(7),a=n(r),d=i(10),h=n(d),l=i(0),u=n(l),c=i(1),f=n(c),p=i(5),v=i(57).default,g=i(186),y=g.HorizontalStrategy,m=g.VerticalStrategy,b=function(){function e(){(0,u.default)(this,e),this.childrenReference={},this.parentReference={},this.trees={},this.distributionOrdering={},this.levels={},this.distributionIndex={},this.isTree=!1,this.treeIndex=-1}return(0,f.default)(e,[{key:"addRelation",value:function(e,t){void 0===this.childrenReference[e]&&(this.childrenReference[e]=[]),this.childrenReference[e].push(t),void 0===this.parentReference[t]&&(this.parentReference[t]=[]),this.parentReference[t].push(e)}},{key:"checkIfTree",value:function(){for(var e in this.parentReference)if(this.parentReference[e].length>1)return void(this.isTree=!1);this.isTree=!0}},{key:"numTrees",value:function(){return this.treeIndex+1}},{key:"setTreeIndex",value:function(e,t){void 0!==t&&void 0===this.trees[e.id]&&(this.trees[e.id]=t,this.treeIndex=Math.max(t,this.treeIndex))}},{key:"ensureLevel",value:function(e){void 0===this.levels[e]&&(this.levels[e]=0)}},{key:"getMaxLevel",value:function(e){var t=this,i={};return function e(n){if(void 0!==i[n])return i[n];var o=t.levels[n];if(t.childrenReference[n]){var s=t.childrenReference[n];if(s.length>0)for(var r=0;r<s.length;r++)o=Math.max(o,e(s[r]))}return i[n]=o,o}(e)}},{key:"levelDownstream",value:function(e,t){void 0===this.levels[t.id]&&(void 0===this.levels[e.id]&&(this.levels[e.id]=0),this.levels[t.id]=this.levels[e.id]+1)}},{key:"setMinLevelToZero",value:function(e){var t=1e9;for(var i in e)e.hasOwnProperty(i)&&void 0!==this.levels[i]&&(t=Math.min(this.levels[i],t));for(var n in e)e.hasOwnProperty(n)&&void 0!==this.levels[n]&&(this.levels[n]-=t)}},{key:"getTreeSize",value:function(e,t){var i=1e9,n=-1e9,o=1e9,s=-1e9;for(var r in this.trees)if(this.trees.hasOwnProperty(r)&&this.trees[r]===t){var a=e[r];i=Math.min(a.x,i),n=Math.max(a.x,n),o=Math.min(a.y,o),s=Math.max(a.y,s)}return{min_x:i,max_x:n,min_y:o,max_y:s}}},{key:"hasSameParent",value:function(e,t){var i=this.parentReference[e.id],n=this.parentReference[t.id];if(void 0===i||void 0===n)return!1;for(var o=0;o<i.length;o++)for(var s=0;s<n.length;s++)if(i[o]==n[s])return!0;return!1}},{key:"inSameSubNetwork",value:function(e,t){return this.trees[e.id]===this.trees[t.id]}},{key:"getLevels",value:function(){return(0,h.default)(this.distributionOrdering)}},{key:"addToOrdering",value:function(e,t){void 0===this.distributionOrdering[t]&&(this.distributionOrdering[t]=[]);var i=!1,n=this.distributionOrdering[t];for(var o in n)if(n[o]===e){i=!0;break}i||(this.distributionOrdering[t].push(e),this.distributionIndex[e.id]=this.distributionOrdering[t].length-1)}}]),e}(),_=function(){function e(t){(0,u.default)(this,e),this.body=t,this.initialRandomSeed=Math.round(1e6*Math.random()),this.randomSeed=this.initialRandomSeed,this.setPhysics=!1,this.options={},this.optionsBackup={physics:{}},this.defaultOptions={randomSeed:void 0,improvedLayout:!0,hierarchical:{enabled:!1,levelSeparation:150,nodeSpacing:100,treeSpacing:200,blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:"UD",sortMethod:"hubsize"}},p.extend(this.options,this.defaultOptions),this.bindEventListeners()}return(0,f.default)(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("_dataChanged",function(){e.setupHierarchicalLayout()}),this.body.emitter.on("_dataLoaded",function(){e.layoutNetwork()}),this.body.emitter.on("_resetHierarchicalLayout",function(){e.setupHierarchicalLayout()}),this.body.emitter.on("_adjustEdgesForHierarchicalLayout",function(){if(!0===e.options.hierarchical.enabled){var t=e.direction.curveType();e.body.emitter.emit("_forceDisableDynamicCurves",t,!1)}})}},{key:"setOptions",value:function(e,t){if(void 0!==e){var i=this.options.hierarchical,n=i.enabled;if(p.selectiveDeepExtend(["randomSeed","improvedLayout"],this.options,e),p.mergeOptions(this.options,e,"hierarchical"),void 0!==e.randomSeed&&(this.initialRandomSeed=e.randomSeed),!0===i.enabled)return!0===n&&this.body.emitter.emit("refresh",!0),"RL"===i.direction||"DU"===i.direction?i.levelSeparation>0&&(i.levelSeparation*=-1):i.levelSeparation<0&&(i.levelSeparation*=-1),this.setDirectionStrategy(),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(t);if(!0===n)return this.body.emitter.emit("refresh"),p.deepExtend(t,this.optionsBackup)}return t}},{key:"adaptAllOptionsForHierarchicalLayout",value:function(e){if(!0===this.options.hierarchical.enabled){var t=this.optionsBackup.physics;void 0===e.physics||!0===e.physics?(e.physics={enabled:void 0===t.enabled||t.enabled,solver:"hierarchicalRepulsion"},t.enabled=void 0===t.enabled||t.enabled,t.solver=t.solver||"barnesHut"):"object"===(0,a.default)(e.physics)?(t.enabled=void 0===e.physics.enabled||e.physics.enabled,t.solver=e.physics.solver||"barnesHut",e.physics.solver="hierarchicalRepulsion"):!1!==e.physics&&(t.solver="barnesHut",e.physics={solver:"hierarchicalRepulsion"});var i=this.direction.curveType();if(void 0===e.edges)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges={smooth:!1};else if(void 0===e.edges.smooth)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges.smooth=!1;else if("boolean"==typeof e.edges.smooth)this.optionsBackup.edges={smooth:e.edges.smooth},e.edges.smooth={enabled:e.edges.smooth,type:i};else{var n=e.edges.smooth;void 0!==n.type&&"dynamic"!==n.type&&(i=n.type),this.optionsBackup.edges={smooth:void 0===n.enabled||n.enabled,type:void 0===n.type?"dynamic":n.type,roundness:void 0===n.roundness?.5:n.roundness,forceDirection:void 0!==n.forceDirection&&n.forceDirection},e.edges.smooth={enabled:void 0===n.enabled||n.enabled,type:i,roundness:void 0===n.roundness?.5:n.roundness,forceDirection:void 0!==n.forceDirection&&n.forceDirection}}this.body.emitter.emit("_forceDisableDynamicCurves",i)}return e}},{key:"seededRandom",value:function(){var e=1e4*Math.sin(this.randomSeed++);return e-Math.floor(e)}},{key:"positionInitially",value:function(e){if(!0!==this.options.hierarchical.enabled){this.randomSeed=this.initialRandomSeed;for(var t=e.length+50,i=0;i<e.length;i++){var n=e[i],o=2*Math.PI*this.seededRandom();void 0===n.x&&(n.x=t*Math.cos(o)),void 0===n.y&&(n.y=t*Math.sin(o))}}}},{key:"layoutNetwork",value:function(){if(!0!==this.options.hierarchical.enabled&&!0===this.options.improvedLayout){for(var e=this.body.nodeIndices,t=0,i=0;i<e.length;i++){!0===this.body.nodes[e[i]].predefinedPosition&&(t+=1)}if(t<.5*e.length){var n=0,o={clusterNodeProperties:{shape:"ellipse",label:"",group:"",font:{multi:!1}},clusterEdgeProperties:{label:"",font:{multi:!1},smooth:{enabled:!1}}};if(e.length>150){for(var s=e.length;e.length>150&&n<=10;){n+=1;var r=e.length;n%3==0?this.body.modules.clustering.clusterBridges(o):this.body.modules.clustering.clusterOutliers(o);if(r==e.length&&n%3!=0)return this._declusterAll(),this.body.emitter.emit("_layoutFailed"),void console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.")}this.body.modules.kamadaKawai.setOptions({springLength:Math.max(150,2*s)})}n>10&&console.info("The clustering didn't succeed within the amount of interations allowed, progressing with partial result."),this.body.modules.kamadaKawai.solve(e,this.body.edgeIndices,!0),this._shiftToCenter();for(var a=0;a<e.length;a++){var d=this.body.nodes[e[a]];!1===d.predefinedPosition&&(d.x+=70*(.5-this.seededRandom()),d.y+=70*(.5-this.seededRandom()))}this._declusterAll(),this.body.emitter.emit("_repositionBezierNodes")}}}},{key:"_shiftToCenter",value:function(){for(var e=v.getRangeCore(this.body.nodes,this.body.nodeIndices),t=v.findCenter(e),i=0;i<this.body.nodeIndices.length;i++){var n=this.body.nodes[this.body.nodeIndices[i]];n.x-=t.x,n.y-=t.y}}},{key:"_declusterAll",value:function(){for(var e=!0;!0===e;){e=!1;for(var t=0;t<this.body.nodeIndices.length;t++)!0===this.body.nodes[this.body.nodeIndices[t]].isCluster&&(e=!0,this.body.modules.clustering.openCluster(this.body.nodeIndices[t],{},!1));!0===e&&this.body.emitter.emit("_dataChanged")}}},{key:"getSeed",value:function(){return this.initialRandomSeed}},{key:"setupHierarchicalLayout",value:function(){if(!0===this.options.hierarchical.enabled&&this.body.nodeIndices.length>0){var e=void 0,t=void 0,i=!1,n=!1;this.lastNodeOnLevel={},this.hierarchical=new b;for(t in this.body.nodes)this.body.nodes.hasOwnProperty(t)&&(e=this.body.nodes[t],void 0!==e.options.level?(i=!0,this.hierarchical.levels[t]=e.options.level):n=!0);if(!0===n&&!0===i)throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");if(!0===n){var o=this.options.hierarchical.sortMethod;"hubsize"===o?this._determineLevelsByHubsize():"directed"===o?this._determineLevelsDirected():"custom"===o&&this._determineLevelsCustomCallback()}for(var s in this.body.nodes)this.body.nodes.hasOwnProperty(s)&&this.hierarchical.ensureLevel(s);var r=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(r),this._condenseHierarchy(),this._shiftToCenter()}}},{key:"_condenseHierarchy",value:function(){var e=this,t=!1,i={},n=function(t,i){var n=e.hierarchical.trees;for(var o in n)n.hasOwnProperty(o)&&n[o]===t&&e.direction.shift(o,i)},o=function(){for(var t=[],i=0;i<e.hierarchical.numTrees();i++)t.push(e.direction.getTreeSize(i));return t},r=function t(i,n){if(!n[i.id]&&(n[i.id]=!0,e.hierarchical.childrenReference[i.id])){var o=e.hierarchical.childrenReference[i.id];if(o.length>0)for(var s=0;s<o.length;s++)t(e.body.nodes[o[s]],n)}},a=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e9,n=1e9,o=1e9,r=1e9,a=-1e9;for(var d in t)if(t.hasOwnProperty(d)){var h=e.body.nodes[d],l=e.hierarchical.levels[h.id],u=e.direction.getPosition(h),c=e._getSpaceAroundNode(h,t),f=(0,s.default)(c,2),p=f[0],v=f[1];n=Math.min(p,n),o=Math.min(v,o),l<=i&&(r=Math.min(u,r),a=Math.max(u,a))}return[r,a,n,o]},d=function(t,i){var n=e.hierarchical.getMaxLevel(t.id),o=e.hierarchical.getMaxLevel(i.id);return Math.min(n,o)},h=function(t,i,n){for(var o=e.hierarchical,s=0;s<i.length;s++){var r=i[s],a=o.distributionOrdering[r];if(a.length>1)for(var d=0;d<a.length-1;d++){var h=a[d],l=a[d+1];o.hasSameParent(h,l)&&o.inSameSubNetwork(h,l)&&t(h,l,n)}}},l=function(i,n){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=e.direction.getPosition(i),h=e.direction.getPosition(n),l=Math.abs(h-s),u=e.options.hierarchical.nodeSpacing;if(l>u){var c={},f={};r(i,c),r(n,f);var p=d(i,n),v=a(c,p),g=a(f,p),y=v[1],m=g[0],b=g[2];if(Math.abs(y-m)>u){var _=y-m+u;_<-b+u&&(_=-b+u),_<0&&(e._shiftBlock(n.id,_),t=!0,!0===o&&e._centerParent(n))}}},u=function(n,o){for(var d=o.id,h=o.edges,l=e.hierarchical.levels[o.id],u=e.options.hierarchical.levelSeparation*e.options.hierarchical.levelSeparation,c={},f=[],p=0;p<h.length;p++){var v=h[p];if(v.toId!=v.fromId){var g=v.toId==d?v.from:v.to;c[h[p].id]=g,e.hierarchical.levels[g.id]<l&&f.push(v)}}var y=function(t,i){for(var n=0,o=0;o<i.length;o++)if(void 0!==c[i[o].id]){var s=e.direction.getPosition(c[i[o].id])-t;n+=s/Math.sqrt(s*s+u)}return n},m=function(t,i){for(var n=0,o=0;o<i.length;o++)if(void 0!==c[i[o].id]){var s=e.direction.getPosition(c[i[o].id])-t;n-=u*Math.pow(s*s+u,-1.5)}return n},b=function(t,i){for(var n=e.direction.getPosition(o),s={},r=0;r<t;r++){var a=y(n,i),d=m(n,i);if(n-=Math.max(-40,Math.min(40,Math.round(a/d))),void 0!==s[n])break;s[n]=r}return n},_=b(n,f);!function(n){var s=e.direction.getPosition(o);if(void 0===i[o.id]){var d={};r(o,d),i[o.id]=d}var h=a(i[o.id]),l=h[2],u=h[3],c=n-s,f=0;c>0?f=Math.min(c,u-e.options.hierarchical.nodeSpacing):c<0&&(f=-Math.min(-c,l-e.options.hierarchical.nodeSpacing)),0!=f&&(e._shiftBlock(o.id,f),t=!0)}(_),_=b(n,h),function(i){var n=e.direction.getPosition(o),r=e._getSpaceAroundNode(o),a=(0,s.default)(r,2),d=a[0],h=a[1],l=i-n,u=n;l>0?u=Math.min(n+(h-e.options.hierarchical.nodeSpacing),i):l<0&&(u=Math.max(n-(d-e.options.hierarchical.nodeSpacing),i)),u!==n&&(e.direction.setPosition(o,u),t=!0)}(_)};!0===this.options.hierarchical.blockShifting&&(function(i){var n=e.hierarchical.getLevels();n=n.reverse();for(var o=0;o<i&&(t=!1,h(l,n,!0),!0===t);o++);}(5),function(){for(var t in e.body.nodes)e.body.nodes.hasOwnProperty(t)&&e._centerParent(e.body.nodes[t])}()),!0===this.options.hierarchical.edgeMinimization&&function(i){var n=e.hierarchical.getLevels();n=n.reverse();for(var o=0;o<i;o++){t=!1;for(var s=0;s<n.length;s++)for(var r=n[s],a=e.hierarchical.distributionOrdering[r],d=0;d<a.length;d++)u(1e3,a[d]);if(!0!==t)break}}(20),!0===this.options.hierarchical.parentCentralization&&function(){var t=e.hierarchical.getLevels();t=t.reverse();for(var i=0;i<t.length;i++)for(var n=t[i],o=e.hierarchical.distributionOrdering[n],s=0;s<o.length;s++)e._centerParent(o[s])}(),function(){for(var t=o(),i=0,s=0;s<t.length-1;s++){i+=t[s].max-t[s+1].min+e.options.hierarchical.treeSpacing,n(s+1,i)}}()}},{key:"_getSpaceAroundNode",value:function(e,t){var i=!0;void 0===t&&(i=!1);var n=this.hierarchical.levels[e.id];if(void 0!==n){var o=this.hierarchical.distributionIndex[e.id],s=this.direction.getPosition(e),r=this.hierarchical.distributionOrdering[n],a=1e9,d=1e9;if(0!==o){var h=r[o-1];if(!0===i&&void 0===t[h.id]||!1===i){a=s-this.direction.getPosition(h)}}if(o!=r.length-1){var l=r[o+1];if(!0===i&&void 0===t[l.id]||!1===i){var u=this.direction.getPosition(l);d=Math.min(d,u-s)}}return[a,d]}return[0,0]}},{key:"_centerParent",value:function(e){if(this.hierarchical.parentReference[e.id])for(var t=this.hierarchical.parentReference[e.id],i=0;i<t.length;i++){var n=t[i],o=this.body.nodes[n],r=this.hierarchical.childrenReference[n];if(void 0!==r){var a=this._getCenterPosition(r),d=this.direction.getPosition(o),h=this._getSpaceAroundNode(o),l=(0,s.default)(h,2),u=l[0],c=l[1],f=d-a;(f<0&&Math.abs(f)<c-this.options.hierarchical.nodeSpacing||f>0&&Math.abs(f)<u-this.options.hierarchical.nodeSpacing)&&this.direction.setPosition(o,a)}}}},{key:"_placeNodesByHierarchy",value:function(e){this.positionedNodes={};for(var t in e)if(e.hasOwnProperty(t)){var i=(0,h.default)(e[t]);i=this._indexArrayToNodes(i),this.direction.sort(i);for(var n=0,o=0;o<i.length;o++){var s=i[o];if(void 0===this.positionedNodes[s.id]){var r=this.options.hierarchical.nodeSpacing,a=r*n;n>0&&(a=this.direction.getPosition(i[o-1])+r),this.direction.setPosition(s,a,t),this._validatePositionAndContinue(s,t,a),n++}}}}},{key:"_placeBranchNodes",value:function(e,t){var i=this.hierarchical.childrenReference[e];if(void 0!==i){for(var n=[],o=0;o<i.length;o++)n.push(this.body.nodes[i[o]]);this.direction.sort(n);for(var s=0;s<n.length;s++){var r=n[s],a=this.hierarchical.levels[r.id];if(!(a>t&&void 0===this.positionedNodes[r.id]))return;var d=this.options.hierarchical.nodeSpacing,h=void 0;h=0===s?this.direction.getPosition(this.body.nodes[e]):this.direction.getPosition(n[s-1])+d,this.direction.setPosition(r,h,a),this._validatePositionAndContinue(r,a,h)}var l=this._getCenterPosition(n);this.direction.setPosition(this.body.nodes[e],l,t)}}},{key:"_validatePositionAndContinue",value:function(e,t,i){if(this.hierarchical.isTree){if(void 0!==this.lastNodeOnLevel[t]){var n=this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[t]]);if(i-n<this.options.hierarchical.nodeSpacing){var o=n+this.options.hierarchical.nodeSpacing-i,s=this._findCommonParent(this.lastNodeOnLevel[t],e.id);this._shiftBlock(s.withChild,o)}}this.lastNodeOnLevel[t]=e.id,this.positionedNodes[e.id]=!0,this._placeBranchNodes(e.id,t)}}},{key:"_indexArrayToNodes",value:function(e){for(var t=[],i=0;i<e.length;i++)t.push(this.body.nodes[e[i]]);return t}},{key:"_getDistribution",value:function(){var e={},t=void 0,i=void 0;for(t in this.body.nodes)if(this.body.nodes.hasOwnProperty(t)){i=this.body.nodes[t];var n=void 0===this.hierarchical.levels[t]?0:this.hierarchical.levels[t];this.direction.fix(i,n),void 0===e[n]&&(e[n]={}),e[n][t]=i}return e}},{key:"_getActiveEdges",value:function(e){var t=this,i=[];return p.forEach(e.edges,function(e){-1!==t.body.edgeIndices.indexOf(e.id)&&i.push(e)}),i}},{key:"_getHubSizes",value:function(){var e=this,t={},i=this.body.nodeIndices;p.forEach(i,function(i){var n=e.body.nodes[i],o=e._getActiveEdges(n).length;t[o]=!0});var n=[];return p.forEach(t,function(e){n.push(Number(e))}),n.sort(function(e,t){return t-e}),n}},{key:"_determineLevelsByHubsize",value:function(){for(var e=this,t=function(t,i){e.hierarchical.levelDownstream(t,i)},i=this._getHubSizes(),n=0;n<i.length;++n){if("break"===function(n){var o=i[n];if(0===o)return"break";p.forEach(e.body.nodeIndices,function(i){var n=e.body.nodes[i];o===e._getActiveEdges(n).length&&e._crawlNetwork(t,i)})}(n))break}}},{key:"_determineLevelsCustomCallback",value:function(){var e=this,t=function(t,i,n){var o=e.hierarchical.levels[t.id];void 0===o&&(o=e.hierarchical.levels[t.id]=1e5);var s=(v.cloneOptions(t,"node"),v.cloneOptions(i,"node"),void v.cloneOptions(n,"edge"));e.hierarchical.levels[i.id]=o+s};this._crawlNetwork(t),this.hierarchical.setMinLevelToZero(this.body.nodes)}},{key:"_determineLevelsDirected",value:function(){var e=this,t=function(t){return p.forEach(e.body.edges,function(e){if(e.toId===t.fromId&&e.fromId===t.toId)return!0}),!1},i=function(i,n,o){var s=e.hierarchical.levels[i.id],r=e.hierarchical.levels[n.id];t(o)&&void 0!==s&&void 0!==r||(void 0===s&&(s=e.hierarchical.levels[i.id]=1e4),o.toId==n.id?e.hierarchical.levels[n.id]=s+1:e.hierarchical.levels[n.id]=s-1)};this._crawlNetwork(i),this.hierarchical.setMinLevelToZero(this.body.nodes)}},{key:"_generateMap",value:function(){var e=this,t=function(t,i){e.hierarchical.levels[i.id]>e.hierarchical.levels[t.id]&&e.hierarchical.addRelation(t.id,i.id)};this._crawlNetwork(t),this.hierarchical.checkIfTree()}},{key:"_crawlNetwork",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},i=arguments[1],n={},o=function i(o,s){if(void 0===n[o.id]){e.hierarchical.setTreeIndex(o,s),n[o.id]=!0;for(var r=void 0,a=e._getActiveEdges(o),d=0;d<a.length;d++){var h=a[d];!0===h.connected&&(r=h.toId==o.id?h.from:h.to,o.id!=r.id&&(t(o,r,h),i(r,s)))}}};if(void 0===i)for(var s=0,r=0;r<this.body.nodeIndices.length;r++){var a=this.body.nodeIndices[r];if(void 0===n[a]){var d=this.body.nodes[a];o(d,s),s+=1}}else{var h=this.body.nodes[i];if(void 0===h)return void console.error("Node not found:",i);o(h)}}},{key:"_shiftBlock",value:function(e,t){var i=this,n={};!function e(o){if(!n[o]){n[o]=!0,i.direction.shift(o,t);var s=i.hierarchical.childrenReference[o];if(void 0!==s)for(var r=0;r<s.length;r++)e(s[r])}}(e)}},{key:"_findCommonParent",value:function(e,t){var i=this,n={};return function e(t,n){var o=i.hierarchical.parentReference[n];if(void 0!==o)for(var s=0;s<o.length;s++){var r=o[s];t[r]=!0,e(t,r)}}(n,e),function e(t,n){var o=i.hierarchical.parentReference[n];if(void 0!==o)for(var s=0;s<o.length;s++){var r=o[s];if(void 0!==t[r])return{foundParent:r,withChild:n};var a=e(t,r);if(null!==a.foundParent)return a}return{foundParent:null,withChild:n}}(n,t)}},{key:"setDirectionStrategy",value:function(){var e="UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction;this.direction=e?new m(this):new y(this)}},{key:"_getCenterPosition",value:function(e){for(var t=1e9,i=-1e9,n=0;n<e.length;n++){var o=void 0;if(void 0!==e[n].id)o=e[n];else{var s=e[n];o=this.body.nodes[s]}var r=this.direction.getPosition(o);t=Math.min(t,r),i=Math.max(i,r)}return.5*(t+i)}}]),e}();t.default=_},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.VerticalStrategy=t.HorizontalStrategy=void 0;var o=i(2),s=n(o),r=i(3),a=n(r),d=i(4),h=n(d),l=i(0),u=n(l),c=i(1),f=n(c),p=function(){function e(){(0,u.default)(this,e)}return(0,f.default)(e,[{key:"abstract",value:function(){throw new Error("Can't instantiate abstract class!")}},{key:"fake_use",value:function(){}},{key:"curveType",value:function(){return this.abstract()}},{key:"getPosition",value:function(e){return this.fake_use(e),this.abstract()}},{key:"setPosition",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;this.fake_use(e,t,i),this.abstract()}},{key:"getTreeSize",value:function(e){return this.fake_use(e),this.abstract()}},{key:"sort",value:function(e){this.fake_use(e),this.abstract()}},{key:"fix",value:function(e,t){this.fake_use(e,t),this.abstract()}},{key:"shift",value:function(e,t){this.fake_use(e,t),this.abstract()}}]),e}(),v=function(e){function t(e){(0,u.default)(this,t);var i=(0,a.default)(this,(t.__proto__||(0,s.default)(t)).call(this));return i.layout=e,i}return(0,h.default)(t,e),(0,f.default)(t,[{key:"curveType",value:function(){return"horizontal"}},{key:"getPosition",value:function(e){return e.x}},{key:"setPosition",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;void 0!==i&&this.layout.hierarchical.addToOrdering(e,i),e.x=t}},{key:"getTreeSize",value:function(e){var t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:t.min_x,max:t.max_x}}},{key:"sort",value:function(e){e.sort(function(e,t){return void 0===e.x||void 0===t.x?0:e.x-t.x})}},{key:"fix",value:function(e,t){e.y=this.layout.options.hierarchical.levelSeparation*t,e.options.fixed.y=!0}},{key:"shift",value:function(e,t){this.layout.body.nodes[e].x+=t}}]),t}(p),g=function(e){function t(e){(0,u.default)(this,t);var i=(0,a.default)(this,(t.__proto__||(0,s.default)(t)).call(this));return i.layout=e,i}return(0,h.default)(t,e),(0,f.default)(t,[{key:"curveType",value:function(){return"vertical"}},{key:"getPosition",value:function(e){return e.y}},{key:"setPosition",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;void 0!==i&&this.layout.hierarchical.addToOrdering(e,i),e.y=t}},{key:"getTreeSize",value:function(e){var t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:t.min_y,max:t.max_y}}},{key:"sort",value:function(e){e.sort(function(e,t){return void 0===e.y||void 0===t.y?0:e.y-t.y})}},{key:"fix",value:function(e,t){e.x=this.layout.options.hierarchical.levelSeparation*t,e.options.fixed.x=!0}},{key:"shift",value:function(e,t){this.layout.body.nodes[e].y+=t}}]),t}(p);t.HorizontalStrategy=g,t.VerticalStrategy=v},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(10),s=n(o),r=i(21),a=n(r),d=i(7),h=n(d),l=i(0),u=n(l),c=i(1),f=n(c),p=i(5),v=i(22),g=i(35),y=function(){function e(t,i,n){var o=this;(0,u.default)(this,e),this.body=t,this.canvas=i,this.selectionHandler=n,this.editMode=!1,this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0,this.manipulationHammers=[],this.temporaryUIFunctions={},this.temporaryEventFunctions=[],this.touchTime=0,this.temporaryIds={nodes:[],edges:[]},this.guiEnabled=!1,this.inMode=!1,this.selectedControlNode=void 0,this.options={},this.defaultOptions={enabled:!1,initiallyActive:!1,addNode:!0,addEdge:!0,editNode:void 0,editEdge:!0,deleteNode:!0,deleteEdge:!0,controlNodeStyle:{shape:"dot",size:6,color:{background:"#ff0000",border:"#3c3c3c",highlight:{background:"#07f968",border:"#3c3c3c"}},borderWidth:2,borderWidthSelected:2}},p.extend(this.options,this.defaultOptions),this.body.emitter.on("destroy",function(){o._clean()}),this.body.emitter.on("_dataChanged",this._restore.bind(this)),this.body.emitter.on("_resetData",this._restore.bind(this))}return(0,f.default)(e,[{key:"_restore",value:function(){!1!==this.inMode&&(!0===this.options.initiallyActive?this.enableEditMode():this.disableEditMode())}},{key:"setOptions",value:function(e,t,i){void 0!==t&&(void 0!==t.locale?this.options.locale=t.locale:this.options.locale=i.locale,void 0!==t.locales?this.options.locales=t.locales:this.options.locales=i.locales),void 0!==e&&("boolean"==typeof e?this.options.enabled=e:(this.options.enabled=!0,p.deepExtend(this.options,e)),!0===this.options.initiallyActive&&(this.editMode=!0),this._setup())}},{key:"toggleEditMode",value:function(){!0===this.editMode?this.disableEditMode():this.enableEditMode()}},{key:"enableEditMode",value:function(){this.editMode=!0,this._clean(),!0===this.guiEnabled&&(this.manipulationDiv.style.display="block",this.closeDiv.style.display="block",this.editModeDiv.style.display="none",this.showManipulatorToolbar())}},{key:"disableEditMode",value:function(){this.editMode=!1,this._clean(),!0===this.guiEnabled&&(this.manipulationDiv.style.display="none",this.closeDiv.style.display="none",this.editModeDiv.style.display="block",this._createEditButton())}},{key:"showManipulatorToolbar",value:function(){if(this._clean(),this.manipulationDOM={},!0===this.guiEnabled){this.editMode=!0,this.manipulationDiv.style.display="block",this.closeDiv.style.display="block";var e=this.selectionHandler._getSelectedNodeCount(),t=this.selectionHandler._getSelectedEdgeCount(),i=e+t,n=this.options.locales[this.options.locale],o=!1;!1!==this.options.addNode&&(this._createAddNodeButton(n),o=!0),!1!==this.options.addEdge&&(!0===o?this._createSeperator(1):o=!0,this._createAddEdgeButton(n)),1===e&&"function"==typeof this.options.editNode?(!0===o?this._createSeperator(2):o=!0,this._createEditNodeButton(n)):1===t&&0===e&&!1!==this.options.editEdge&&(!0===o?this._createSeperator(3):o=!0,this._createEditEdgeButton(n)),0!==i&&(e>0&&!1!==this.options.deleteNode?(!0===o&&this._createSeperator(4),this._createDeleteButton(n)):0===e&&!1!==this.options.deleteEdge&&(!0===o&&this._createSeperator(4),this._createDeleteButton(n))),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this)),this._temporaryBindEvent("select",this.showManipulatorToolbar.bind(this))}this.body.emitter.emit("_redraw")}},{key:"addNodeMode",value:function(){if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="addNode",!0===this.guiEnabled){var e=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(e),this._createSeperator(),this._createDescription(e.addDescription||this.options.locales.en.addDescription),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this))}this._temporaryBindEvent("click",this._performAddNode.bind(this))}},{key:"editNode",value:function(){var e=this;!0!==this.editMode&&this.enableEditMode(),this._clean();var t=this.selectionHandler._getSelectedNode();if(void 0!==t){if(this.inMode="editNode","function"!=typeof this.options.editNode)throw new Error("No function has been configured to handle the editing of nodes.");if(!0!==t.isCluster){var i=p.deepExtend({},t.options,!1);if(i.x=t.x,i.y=t.y,2!==this.options.editNode.length)throw new Error("The function for edit does not support two arguments (data, callback)");this.options.editNode(i,function(t){null!==t&&void 0!==t&&"editNode"===e.inMode&&e.body.data.nodes.getDataSet().update(t),e.showManipulatorToolbar()})}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError)}else this.showManipulatorToolbar()}},{key:"addEdgeMode",value:function(){if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="addEdge",!0===this.guiEnabled){var e=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(e),this._createSeperator(),this._createDescription(e.edgeDescription||this.options.locales.en.edgeDescription),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this))}this._temporaryBindUI("onTouch",this._handleConnect.bind(this)),this._temporaryBindUI("onDragEnd",this._finishConnect.bind(this)),this._temporaryBindUI("onDrag",this._dragControlNode.bind(this)),this._temporaryBindUI("onRelease",this._finishConnect.bind(this)),this._temporaryBindUI("onDragStart",this._dragStartEdge.bind(this)),this._temporaryBindUI("onHold",function(){})}},{key:"editEdgeMode",value:function(){if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="editEdge","object"===(0,h.default)(this.options.editEdge)&&"function"==typeof this.options.editEdge.editWithoutDrag&&(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdges()[0],void 0!==this.edgeBeingEditedId)){var e=this.body.edges[this.edgeBeingEditedId];return void this._performEditEdge(e.from,e.to)}if(!0===this.guiEnabled){var t=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(t),this._createSeperator(),this._createDescription(t.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdges()[0],void 0!==this.edgeBeingEditedId){var i=this.body.edges[this.edgeBeingEditedId],n=this._getNewTargetNode(i.from.x,i.from.y),o=this._getNewTargetNode(i.to.x,i.to.y);this.temporaryIds.nodes.push(n.id),this.temporaryIds.nodes.push(o.id),this.body.nodes[n.id]=n,this.body.nodeIndices.push(n.id),this.body.nodes[o.id]=o,this.body.nodeIndices.push(o.id),this._temporaryBindUI("onTouch",this._controlNodeTouch.bind(this)),this._temporaryBindUI("onTap",function(){}),this._temporaryBindUI("onHold",function(){}),this._temporaryBindUI("onDragStart",this._controlNodeDragStart.bind(this)),this._temporaryBindUI("onDrag",this._controlNodeDrag.bind(this)),this._temporaryBindUI("onDragEnd",this._controlNodeDragEnd.bind(this)),this._temporaryBindUI("onMouseMove",function(){}),this._temporaryBindEvent("beforeDrawing",function(e){var t=i.edgeType.findBorderPositions(e);!1===n.selected&&(n.x=t.from.x,n.y=t.from.y),!1===o.selected&&(o.x=t.to.x,o.y=t.to.y)}),this.body.emitter.emit("_redraw")}else this.showManipulatorToolbar()}},{key:"deleteSelected",value:function(){var e=this;!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="delete";var t=this.selectionHandler.getSelectedNodes(),i=this.selectionHandler.getSelectedEdges(),n=void 0;if(t.length>0){for(var o=0;o<t.length;o++)if(!0===this.body.nodes[t[o]].isCluster)return void alert(this.options.locales[this.options.locale].deleteClusterError||this.options.locales.en.deleteClusterError);"function"==typeof this.options.deleteNode&&(n=this.options.deleteNode)}else i.length>0&&"function"==typeof this.options.deleteEdge&&(n=this.options.deleteEdge);if("function"==typeof n){var s={nodes:t,edges:i};if(2!==n.length)throw new Error("The function for delete does not support two arguments (data, callback)");n(s,function(t){null!==t&&void 0!==t&&"delete"===e.inMode?(e.body.data.edges.getDataSet().remove(t.edges),e.body.data.nodes.getDataSet().remove(t.nodes),e.body.emitter.emit("startSimulation"),e.showManipulatorToolbar()):(e.body.emitter.emit("startSimulation"),e.showManipulatorToolbar())})}else this.body.data.edges.getDataSet().remove(i),this.body.data.nodes.getDataSet().remove(t),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()}},{key:"_setup",value:function(){!0===this.options.enabled?(this.guiEnabled=!0,this._createWrappers(),!1===this.editMode?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}},{key:"_createWrappers",value:function(){void 0===this.manipulationDiv&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",!0===this.editMode?this.manipulationDiv.style.display="block":this.manipulationDiv.style.display="none",this.canvas.frame.appendChild(this.manipulationDiv)),void 0===this.editModeDiv&&(this.editModeDiv=document.createElement("div"),this.editModeDiv.className="vis-edit-mode",!0===this.editMode?this.editModeDiv.style.display="none":this.editModeDiv.style.display="block",this.canvas.frame.appendChild(this.editModeDiv)),void 0===this.closeDiv&&(this.closeDiv=document.createElement("div"),this.closeDiv.className="vis-close",this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv))}},{key:"_getNewTargetNode",value:function(e,t){var i=p.deepExtend({},this.options.controlNodeStyle);i.id="targetNode"+p.randomUUID(),i.hidden=!1,i.physics=!1,i.x=e,i.y=t;var n=this.body.functions.createNode(i);return n.shape.boundingBox={left:e,right:e,top:t,bottom:t},n}},{key:"_createEditButton",value:function(){this._clean(),this.manipulationDOM={},p.recursiveDOMDelete(this.editModeDiv);var e=this.options.locales[this.options.locale],t=this._createButton("editMode","vis-button vis-edit vis-edit-mode",e.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(t),this._bindHammerToDiv(t,this.toggleEditMode.bind(this))}},{key:"_clean",value:function(){this.inMode=!1,!0===this.guiEnabled&&(p.recursiveDOMDelete(this.editModeDiv),p.recursiveDOMDelete(this.manipulationDiv),this._cleanManipulatorHammers()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}},{key:"_cleanManipulatorHammers",value:function(){if(0!=this.manipulationHammers.length){for(var e=0;e<this.manipulationHammers.length;e++)this.manipulationHammers[e].destroy();this.manipulationHammers=[]}}},{key:"_removeManipulationDOM",value:function(){this._clean(),p.recursiveDOMDelete(this.manipulationDiv),p.recursiveDOMDelete(this.editModeDiv),p.recursiveDOMDelete(this.closeDiv),this.manipulationDiv&&this.canvas.frame.removeChild(this.manipulationDiv),this.editModeDiv&&this.canvas.frame.removeChild(this.editModeDiv),this.closeDiv&&this.canvas.frame.removeChild(this.closeDiv),this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0}},{key:"_createSeperator",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.manipulationDOM["seperatorLineDiv"+e]=document.createElement("div"),this.manipulationDOM["seperatorLineDiv"+e].className="vis-separator-line",this.manipulationDiv.appendChild(this.manipulationDOM["seperatorLineDiv"+e])}},{key:"_createAddNodeButton",value:function(e){var t=this._createButton("addNode","vis-button vis-add",e.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(t),this._bindHammerToDiv(t,this.addNodeMode.bind(this))}},{key:"_createAddEdgeButton",value:function(e){var t=this._createButton("addEdge","vis-button vis-connect",e.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(t),this._bindHammerToDiv(t,this.addEdgeMode.bind(this))}},{key:"_createEditNodeButton",value:function(e){var t=this._createButton("editNode","vis-button vis-edit",e.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(t),this._bindHammerToDiv(t,this.editNode.bind(this))}},{key:"_createEditEdgeButton",value:function(e){var t=this._createButton("editEdge","vis-button vis-edit",e.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(t),this._bindHammerToDiv(t,this.editEdgeMode.bind(this))}},{key:"_createDeleteButton",value:function(e){var t;t=this.options.rtl?"vis-button vis-delete-rtl":"vis-button vis-delete";var i=this._createButton("delete",t,e.del||this.options.locales.en.del);this.manipulationDiv.appendChild(i),this._bindHammerToDiv(i,this.deleteSelected.bind(this))}},{key:"_createBackButton",value:function(e){var t=this._createButton("back","vis-button vis-back",e.back||this.options.locales.en.back);this.manipulationDiv.appendChild(t),this._bindHammerToDiv(t,this.showManipulatorToolbar.bind(this))}},{key:"_createButton",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"vis-label";return this.manipulationDOM[e+"Div"]=document.createElement("div"),this.manipulationDOM[e+"Div"].className=t,this.manipulationDOM[e+"Label"]=document.createElement("div"),this.manipulationDOM[e+"Label"].className=n,this.manipulationDOM[e+"Label"].innerHTML=i,this.manipulationDOM[e+"Div"].appendChild(this.manipulationDOM[e+"Label"]),this.manipulationDOM[e+"Div"]}},{key:"_createDescription",value:function(e){this.manipulationDiv.appendChild(this._createButton("description","vis-button vis-none",e))}},{key:"_temporaryBindEvent",value:function(e,t){this.temporaryEventFunctions.push({event:e,boundFunction:t}),this.body.emitter.on(e,t)}},{key:"_temporaryBindUI",value:function(e,t){if(void 0===this.body.eventListeners[e])throw new Error("This UI function does not exist. Typo? You tried: "+e+" possible are: "+(0,a.default)((0,s.default)(this.body.eventListeners)));this.temporaryUIFunctions[e]=this.body.eventListeners[e],this.body.eventListeners[e]=t}},{key:"_unbindTemporaryUIs",value:function(){for(var e in this.temporaryUIFunctions)this.temporaryUIFunctions.hasOwnProperty(e)&&(this.body.eventListeners[e]=this.temporaryUIFunctions[e],delete this.temporaryUIFunctions[e]);this.temporaryUIFunctions={}}},{key:"_unbindTemporaryEvents",value:function(){for(var e=0;e<this.temporaryEventFunctions.length;e++){var t=this.temporaryEventFunctions[e].event,i=this.temporaryEventFunctions[e].boundFunction;this.body.emitter.off(t,i)}this.temporaryEventFunctions=[]}},{key:"_bindHammerToDiv",value:function(e,t){var i=new v(e,{});g.onTouch(i,t),this.manipulationHammers.push(i)}},{key:"_cleanupTemporaryNodesAndEdges",value:function(){for(var e=0;e<this.temporaryIds.edges.length;e++){this.body.edges[this.temporaryIds.edges[e]].disconnect(),delete this.body.edges[this.temporaryIds.edges[e]];var t=this.body.edgeIndices.indexOf(this.temporaryIds.edges[e]);-1!==t&&this.body.edgeIndices.splice(t,1)}for(var i=0;i<this.temporaryIds.nodes.length;i++){delete this.body.nodes[this.temporaryIds.nodes[i]];var n=this.body.nodeIndices.indexOf(this.temporaryIds.nodes[i]);-1!==n&&this.body.nodeIndices.splice(n,1)}this.temporaryIds={nodes:[],edges:[]}}},{key:"_controlNodeTouch",value:function(e){this.selectionHandler.unselectAll(),this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=p.extend({},this.body.view.translation)}},{key:"_controlNodeDragStart",value:function(e){var t=this.lastTouch,i=this.selectionHandler._pointerToPositionObject(t),n=this.body.nodes[this.temporaryIds.nodes[0]],o=this.body.nodes[this.temporaryIds.nodes[1]],s=this.body.edges[this.edgeBeingEditedId];this.selectedControlNode=void 0;var r=n.isOverlappingWith(i),a=o.isOverlappingWith(i);!0===r?(this.selectedControlNode=n,s.edgeType.from=n):!0===a&&(this.selectedControlNode=o,s.edgeType.to=o),void 0!==this.selectedControlNode&&this.selectionHandler.selectObject(this.selectedControlNode),this.body.emitter.emit("_redraw")}},{key:"_controlNodeDrag",value:function(e){this.body.emitter.emit("disablePhysics");var t=this.body.functions.getPointer(e.center),i=this.canvas.DOMtoCanvas(t);if(void 0!==this.selectedControlNode)this.selectedControlNode.x=i.x,this.selectedControlNode.y=i.y;else{var n=t.x-this.lastTouch.x,o=t.y-this.lastTouch.y;this.body.view.translation={x:this.lastTouch.translation.x+n,y:this.lastTouch.translation.y+o}}this.body.emitter.emit("_redraw")}},{key:"_controlNodeDragEnd",value:function(e){var t=this.body.functions.getPointer(e.center),i=this.selectionHandler._pointerToPositionObject(t),n=this.body.edges[this.edgeBeingEditedId];if(void 0!==this.selectedControlNode){this.selectionHandler.unselectAll();for(var o=this.selectionHandler._getAllNodesOverlappingWith(i),s=void 0,r=o.length-1;r>=0;r--)if(o[r]!==this.selectedControlNode.id){s=this.body.nodes[o[r]];break}if(void 0!==s&&void 0!==this.selectedControlNode)if(!0===s.isCluster)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var a=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===a.id?this._performEditEdge(s.id,n.to.id):this._performEditEdge(n.from.id,s.id)}else n.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}}},{key:"_handleConnect",value:function(e){if((new Date).valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=p.extend({},this.body.view.translation);var t=this.lastTouch,i=this.selectionHandler.getNodeAt(t);if(void 0!==i)if(!0===i.isCluster)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var n=this._getNewTargetNode(i.x,i.y);this.body.nodes[n.id]=n,this.body.nodeIndices.push(n.id);var o=this.body.functions.createEdge({id:"connectionEdge"+p.randomUUID(),from:i.id,to:n.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[o.id]=o,this.body.edgeIndices.push(o.id),this.temporaryIds.nodes.push(n.id),this.temporaryIds.edges.push(o.id)}this.touchTime=(new Date).valueOf()}}},{key:"_dragControlNode",value:function(e){var t=this.body.functions.getPointer(e.center);if(void 0!==this.temporaryIds.nodes[0]){var i=this.body.nodes[this.temporaryIds.nodes[0]];i.x=this.canvas._XconvertDOMtoCanvas(t.x),i.y=this.canvas._YconvertDOMtoCanvas(t.y),this.body.emitter.emit("_redraw")}else{var n=t.x-this.lastTouch.x,o=t.y-this.lastTouch.y;this.body.view.translation={x:this.lastTouch.translation.x+n,y:this.lastTouch.translation.y+o}}}},{key:"_finishConnect",value:function(e){var t=this.body.functions.getPointer(e.center),i=this.selectionHandler._pointerToPositionObject(t),n=void 0;void 0!==this.temporaryIds.edges[0]&&(n=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var o=this.selectionHandler._getAllNodesOverlappingWith(i),s=void 0,r=o.length-1;r>=0;r--)if(-1===this.temporaryIds.nodes.indexOf(o[r])){s=this.body.nodes[o[r]];break}this._cleanupTemporaryNodesAndEdges(),void 0!==s&&(!0===s.isCluster?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):void 0!==this.body.nodes[n]&&void 0!==this.body.nodes[s.id]&&this._performAddEdge(n,s.id)),this.body.emitter.emit("_redraw")}},{key:"_dragStartEdge",value:function(e){var t=this.lastTouch;this.selectionHandler._generateClickEvent("dragStart",e,t,void 0,!0)}},{key:"_performAddNode",value:function(e){var t=this,i={id:p.randomUUID(),x:e.pointer.canvas.x,y:e.pointer.canvas.y,label:"new"};if("function"==typeof this.options.addNode){if(2!==this.options.addNode.length)throw this.showManipulatorToolbar(),new Error("The function for add does not support two arguments (data,callback)");this.options.addNode(i,function(e){null!==e&&void 0!==e&&"addNode"===t.inMode&&(t.body.data.nodes.getDataSet().add(e),t.showManipulatorToolbar())})}else this.body.data.nodes.getDataSet().add(i),this.showManipulatorToolbar()}},{key:"_performAddEdge",value:function(e,t){var i=this,n={from:e,to:t};if("function"==typeof this.options.addEdge){if(2!==this.options.addEdge.length)throw new Error("The function for connect does not support two arguments (data,callback)");this.options.addEdge(n,function(e){null!==e&&void 0!==e&&"addEdge"===i.inMode&&(i.body.data.edges.getDataSet().add(e),i.selectionHandler.unselectAll(),i.showManipulatorToolbar())})}else this.body.data.edges.getDataSet().add(n),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}},{key:"_performEditEdge",value:function(e,t){var i=this,n={id:this.edgeBeingEditedId,from:e,to:t,label:this.body.data.edges._data[this.edgeBeingEditedId].label},o=this.options.editEdge;if("object"===(void 0===o?"undefined":(0,h.default)(o))&&(o=o.editWithoutDrag),"function"==typeof o){if(2!==o.length)throw new Error("The function for edit does not support two arguments (data, callback)");o(n,function(e){null===e||void 0===e||"editEdge"!==i.inMode?(i.body.edges[n.id].updateEdgeType(),i.body.emitter.emit("_redraw"),i.showManipulatorToolbar()):(i.body.data.edges.getDataSet().update(e),i.selectionHandler.unselectAll(),i.showManipulatorToolbar())})}else this.body.data.edges.getDataSet().update(n),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}]),e}();t.default=y},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(21),s=n(o),r=i(7),a=n(r),d=i(0),h=n(d),l=i(1),u=n(l),c=i(5),f=i(189).default,p=function(){function e(t,i,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;(0,h.default)(this,e),this.parent=t,this.changedOptions=[],this.container=i,this.allowCreation=!1,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},c.extend(this.options,this.defaultOptions),this.configureOptions=n,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new f(o),this.wrapper=void 0}return(0,u.default)(e,[{key:"setOptions",value:function(e){if(void 0!==e){this.popupHistory={},this._removePopup();var t=!0;"string"==typeof e?this.options.filter=e:e instanceof Array?this.options.filter=e.join():"object"===(void 0===e?"undefined":(0,a.default)(e))?(void 0!==e.container&&(this.options.container=e.container),void 0!==e.filter&&(this.options.filter=e.filter),void 0!==e.showButton&&(this.options.showButton=e.showButton),void 0!==e.enabled&&(t=e.enabled)):"boolean"==typeof e?(this.options.filter=!0,t=e):"function"==typeof e&&(this.options.filter=e,t=!0),!1===this.options.filter&&(t=!1),this.options.enabled=t}this._clean()}},{key:"setModuleOptions",value:function(e){this.moduleOptions=e,!0===this.options.enabled&&(this._clean(),void 0!==this.options.container&&(this.container=this.options.container),this._create())}},{key:"_create",value:function(){var e=this;this._clean(),this.changedOptions=[];var t=this.options.filter,i=0,n=!1;for(var o in this.configureOptions)this.configureOptions.hasOwnProperty(o)&&(this.allowCreation=!1,n=!1,"function"==typeof t?(n=t(o,[]),n=n||this._handleObject(this.configureOptions[o],[o],!0)):!0!==t&&-1===t.indexOf(o)||(n=!0),!1!==n&&(this.allowCreation=!0,i>0&&this._makeItem([]),this._makeHeader(o),this._handleObject(this.configureOptions[o],[o])),i++);if(!0===this.options.showButton){var s=document.createElement("div");s.className="vis-configuration vis-config-button",s.innerHTML="generate options",s.onclick=function(){e._printOptions()},s.onmouseover=function(){s.className="vis-configuration vis-config-button hover"},s.onmouseout=function(){s.className="vis-configuration vis-config-button"},this.optionsContainer=document.createElement("div"),this.optionsContainer.className="vis-configuration vis-config-option-container",this.domElements.push(this.optionsContainer),this.domElements.push(s)}this._push()}},{key:"_push",value:function(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(var e=0;e<this.domElements.length;e++)this.wrapper.appendChild(this.domElements[e]);this._showPopupIfNeeded()}},{key:"_clean",value:function(){for(var e=0;e<this.domElements.length;e++)this.wrapper.removeChild(this.domElements[e]);void 0!==this.wrapper&&(this.container.removeChild(this.wrapper),this.wrapper=void 0),this.domElements=[],this._removePopup()}},{key:"_getValue",value:function(e){for(var t=this.moduleOptions,i=0;i<e.length;i++){if(void 0===t[e[i]]){t=void 0;break}t=t[e[i]]}return t}},{key:"_makeItem",value:function(e){if(!0===this.allowCreation){var t=document.createElement("div");t.className="vis-configuration vis-config-item vis-config-s"+e.length;for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];return n.forEach(function(e){t.appendChild(e)}),this.domElements.push(t),this.domElements.length}return 0}},{key:"_makeHeader",value:function(e){var t=document.createElement("div");t.className="vis-configuration vis-config-header",t.innerHTML=e,this._makeItem([],t)}},{key:"_makeLabel",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=document.createElement("div");return n.className="vis-configuration vis-config-label vis-config-s"+t.length,n.innerHTML=!0===i?"<i><b>"+e+":</b></i>":e+":",n}},{key:"_makeDropdown",value:function(e,t,i){var n=document.createElement("select");n.className="vis-configuration vis-config-select";var o=0;void 0!==t&&-1!==e.indexOf(t)&&(o=e.indexOf(t));for(var s=0;s<e.length;s++){var r=document.createElement("option");r.value=e[s],s===o&&(r.selected="selected"),r.innerHTML=e[s],n.appendChild(r)}var a=this;n.onchange=function(){a._update(this.value,i)};var d=this._makeLabel(i[i.length-1],i);this._makeItem(i,d,n)}},{key:"_makeRange",value:function(e,t,i){var n=e[0],o=e[1],s=e[2],r=e[3],a=document.createElement("input");a.className="vis-configuration vis-config-range";try{a.type="range",a.min=o,a.max=s}catch(e){}a.step=r;var d="",h=0;if(void 0!==t){t<0&&1.2*t<o?(a.min=Math.ceil(1.2*t),h=a.min,d="range increased"):t/1.2<o&&(a.min=Math.ceil(t/1.2),h=a.min,d="range increased"),1.2*t>s&&1!==s&&(a.max=Math.ceil(1.2*t),h=a.max,d="range increased"),a.value=t}else a.value=n;var l=document.createElement("input");l.className="vis-configuration vis-config-rangeinput",l.value=a.value;var u=this;a.onchange=function(){l.value=this.value,u._update(Number(this.value),i)},a.oninput=function(){l.value=this.value};var c=this._makeLabel(i[i.length-1],i),f=this._makeItem(i,c,a,l);""!==d&&this.popupHistory[f]!==h&&(this.popupHistory[f]=h,this._setupPopup(d,f))}},{key:"_setupPopup",value:function(e,t){var i=this;if(!0===this.initialized&&!0===this.allowCreation&&this.popupCounter<this.popupLimit){var n=document.createElement("div");n.id="vis-configuration-popup",n.className="vis-configuration-popup",n.innerHTML=e,n.onclick=function(){i._removePopup()},this.popupCounter+=1,this.popupDiv={html:n,index:t}}}},{key:"_removePopup",value:function(){void 0!==this.popupDiv.html&&(this.popupDiv.html.parentNode.removeChild(this.popupDiv.html),clearTimeout(this.popupDiv.hideTimeout),clearTimeout(this.popupDiv.deleteTimeout),this.popupDiv={})}},{key:"_showPopupIfNeeded",value:function(){var e=this;if(void 0!==this.popupDiv.html){var t=this.domElements[this.popupDiv.index],i=t.getBoundingClientRect();this.popupDiv.html.style.left=i.left+"px",this.popupDiv.html.style.top=i.top-30+"px",document.body.appendChild(this.popupDiv.html),this.popupDiv.hideTimeout=setTimeout(function(){e.popupDiv.html.style.opacity=0},1500),this.popupDiv.deleteTimeout=setTimeout(function(){e._removePopup()},1800)}}},{key:"_makeCheckbox",value:function(e,t,i){var n=document.createElement("input");n.type="checkbox",n.className="vis-configuration vis-config-checkbox",n.checked=e,void 0!==t&&(n.checked=t,t!==e&&("object"===(void 0===e?"undefined":(0,a.default)(e))?t!==e.enabled&&this.changedOptions.push({path:i,value:t}):this.changedOptions.push({path:i,value:t})));var o=this;n.onchange=function(){o._update(this.checked,i)};var s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,n)}},{key:"_makeTextInput",value:function(e,t,i){var n=document.createElement("input");n.type="text",n.className="vis-configuration vis-config-text",n.value=t,t!==e&&this.changedOptions.push({path:i,value:t});var o=this;n.onchange=function(){o._update(this.value,i)};var s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,n)}},{key:"_makeColorField",value:function(e,t,i){var n=this,o=e[1],s=document.createElement("div");t=void 0===t?o:t,"none"!==t?(s.className="vis-configuration vis-config-colorBlock",s.style.backgroundColor=t):s.className="vis-configuration vis-config-colorBlock none",t=void 0===t?o:t,s.onclick=function(){n._showColorPicker(t,s,i)};var r=this._makeLabel(i[i.length-1],i);this._makeItem(i,r,s)}},{key:"_showColorPicker",value:function(e,t,i){var n=this;t.onclick=function(){},this.colorPicker.insertTo(t),this.colorPicker.show(),this.colorPicker.setColor(e),this.colorPicker.setUpdateCallback(function(e){var o="rgba("+e.r+","+e.g+","+e.b+","+e.a+")";t.style.backgroundColor=o,n._update(o,i)}),this.colorPicker.setCloseCallback(function(){t.onclick=function(){n._showColorPicker(e,t,i)}})}},{key:"_handleObject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=!1,o=this.options.filter,s=!1;for(var r in e)if(e.hasOwnProperty(r)){n=!0;var a=e[r],d=c.copyAndExtendArray(t,r);if("function"==typeof o&&!1===(n=o(r,t))&&!(a instanceof Array)&&"string"!=typeof a&&"boolean"!=typeof a&&a instanceof Object&&(this.allowCreation=!1,n=this._handleObject(a,d,!0),this.allowCreation=!1===i),!1!==n){s=!0;var h=this._getValue(d);if(a instanceof Array)this._handleArray(a,h,d);else if("string"==typeof a)this._makeTextInput(a,h,d);else if("boolean"==typeof a)this._makeCheckbox(a,h,d);else if(a instanceof Object){var l=!0;if(-1!==t.indexOf("physics")&&this.moduleOptions.physics.solver!==r&&(l=!1),!0===l)if(void 0!==a.enabled){var u=c.copyAndExtendArray(d,"enabled"),f=this._getValue(u);if(!0===f){var p=this._makeLabel(r,d,!0);this._makeItem(d,p),s=this._handleObject(a,d)||s}else this._makeCheckbox(a,f,d)}else{var v=this._makeLabel(r,d,!0);this._makeItem(d,v),s=this._handleObject(a,d)||s}}else console.error("dont know how to handle",a,r,d)}}return s}},{key:"_handleArray",value:function(e,t,i){"string"==typeof e[0]&&"color"===e[0]?(this._makeColorField(e,t,i),e[1]!==t&&this.changedOptions.push({path:i,value:t})):"string"==typeof e[0]?(this._makeDropdown(e,t,i),e[0]!==t&&this.changedOptions.push({path:i,value:t})):"number"==typeof e[0]&&(this._makeRange(e,t,i),e[0]!==t&&this.changedOptions.push({path:i,value:Number(t)}))}},{key:"_update",value:function(e,t){var i=this._constructOptions(e,t);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",i),this.initialized=!0,this.parent.setOptions(i)}},{key:"_constructOptions",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i;e="true"===e||e,e="false"!==e&&e;for(var o=0;o<t.length;o++)"global"!==t[o]&&(void 0===n[t[o]]&&(n[t[o]]={}),o!==t.length-1?n=n[t[o]]:n[t[o]]=e);return i}},{key:"_printOptions",value:function(){var e=this.getOptions();this.optionsContainer.innerHTML="<pre>var options = "+(0,s.default)(e,null,2)+"</pre>"}},{key:"getOptions",value:function(){for(var e={},t=0;t<this.changedOptions.length;t++)this._constructOptions(this.changedOptions[t].value,this.changedOptions[t].path,e);return e}}]),e}();t.default=p},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(21),s=n(o),r=i(0),a=n(r),d=i(1),h=n(d),l=i(22),u=i(35),c=i(5),f=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;(0,a.default)(this,e),this.pixelRatio=t,this.generated=!1,this.centerCoordinates={x:144.5,y:144.5},this.r=289*.49,this.color={r:255,g:255,b:255,a:1},this.hueCircle=void 0,this.initialColor={r:255,g:255,b:255,a:1},this.previousColor=void 0,this.applied=!1,this.updateCallback=function(){},this.closeCallback=function(){},this._create()}return(0,h.default)(e,[{key:"insertTo",value:function(e){void 0!==this.hammer&&(this.hammer.destroy(),this.hammer=void 0),this.container=e,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}},{key:"setUpdateCallback",value:function(e){if("function"!=typeof e)throw new Error("Function attempted to set as colorPicker update callback is not a function.");this.updateCallback=e}},{key:"setCloseCallback",value:function(e){if("function"!=typeof e)throw new Error("Function attempted to set as colorPicker closing callback is not a function.");this.closeCallback=e}},{key:"_isColorString",value:function(e){var t={black:"#000000",navy:"#000080",darkblue:"#00008B",mediumblue:"#0000CD",blue:"#0000FF",darkgreen:"#006400",green:"#008000",teal:"#008080",darkcyan:"#008B8B",deepskyblue:"#00BFFF",darkturquoise:"#00CED1",mediumspringgreen:"#00FA9A",lime:"#00FF00",springgreen:"#00FF7F",aqua:"#00FFFF",cyan:"#00FFFF",midnightblue:"#191970",dodgerblue:"#1E90FF",lightseagreen:"#20B2AA",forestgreen:"#228B22",seagreen:"#2E8B57",darkslategray:"#2F4F4F",limegreen:"#32CD32",mediumseagreen:"#3CB371",turquoise:"#40E0D0",royalblue:"#4169E1",steelblue:"#4682B4",darkslateblue:"#483D8B",mediumturquoise:"#48D1CC",indigo:"#4B0082",darkolivegreen:"#556B2F",cadetblue:"#5F9EA0",cornflowerblue:"#6495ED",mediumaquamarine:"#66CDAA",dimgray:"#696969",slateblue:"#6A5ACD",olivedrab:"#6B8E23",slategray:"#708090",lightslategray:"#778899",mediumslateblue:"#7B68EE",lawngreen:"#7CFC00",chartreuse:"#7FFF00",aquamarine:"#7FFFD4",maroon:"#800000",purple:"#800080",olive:"#808000",gray:"#808080",skyblue:"#87CEEB",lightskyblue:"#87CEFA",blueviolet:"#8A2BE2",darkred:"#8B0000",darkmagenta:"#8B008B",saddlebrown:"#8B4513",darkseagreen:"#8FBC8F",lightgreen:"#90EE90",mediumpurple:"#9370D8",darkviolet:"#9400D3",palegreen:"#98FB98",darkorchid:"#9932CC",yellowgreen:"#9ACD32",sienna:"#A0522D",brown:"#A52A2A",darkgray:"#A9A9A9",lightblue:"#ADD8E6",greenyellow:"#ADFF2F",paleturquoise:"#AFEEEE",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",firebrick:"#B22222",darkgoldenrod:"#B8860B",mediumorchid:"#BA55D3",rosybrown:"#BC8F8F",darkkhaki:"#BDB76B",silver:"#C0C0C0",mediumvioletred:"#C71585",indianred:"#CD5C5C",peru:"#CD853F",chocolate:"#D2691E",tan:"#D2B48C",lightgrey:"#D3D3D3",palevioletred:"#D87093",thistle:"#D8BFD8",orchid:"#DA70D6",goldenrod:"#DAA520",crimson:"#DC143C",gainsboro:"#DCDCDC",plum:"#DDA0DD",burlywood:"#DEB887",lightcyan:"#E0FFFF",lavender:"#E6E6FA",darksalmon:"#E9967A",violet:"#EE82EE",palegoldenrod:"#EEE8AA",lightcoral:"#F08080",khaki:"#F0E68C",aliceblue:"#F0F8FF",honeydew:"#F0FFF0",azure:"#F0FFFF",sandybrown:"#F4A460",wheat:"#F5DEB3",beige:"#F5F5DC",whitesmoke:"#F5F5F5",mintcream:"#F5FFFA",ghostwhite:"#F8F8FF",salmon:"#FA8072",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lightgoldenrodyellow:"#FAFAD2",oldlace:"#FDF5E6",red:"#FF0000",fuchsia:"#FF00FF",magenta:"#FF00FF",deeppink:"#FF1493",orangered:"#FF4500",tomato:"#FF6347",hotpink:"#FF69B4",coral:"#FF7F50",darkorange:"#FF8C00",lightsalmon:"#FFA07A",orange:"#FFA500",lightpink:"#FFB6C1",pink:"#FFC0CB",gold:"#FFD700",peachpuff:"#FFDAB9",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",mistyrose:"#FFE4E1",blanchedalmond:"#FFEBCD",papayawhip:"#FFEFD5",lavenderblush:"#FFF0F5",seashell:"#FFF5EE",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",floralwhite:"#FFFAF0",snow:"#FFFAFA",yellow:"#FFFF00",lightyellow:"#FFFFE0",ivory:"#FFFFF0",white:"#FFFFFF"};if("string"==typeof e)return t[e]}},{key:"setColor",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("none"!==e){var i=void 0,n=this._isColorString(e);if(void 0!==n&&(e=n),!0===c.isString(e)){if(!0===c.isValidRGB(e)){var o=e.substr(4).substr(0,e.length-5).split(",");i={r:o[0],g:o[1],b:o[2],a:1}}else if(!0===c.isValidRGBA(e)){var r=e.substr(5).substr(0,e.length-6).split(",");i={r:r[0],g:r[1],b:r[2],a:r[3]}}else if(!0===c.isValidHex(e)){var a=c.hexToRGB(e);i={r:a.r,g:a.g,b:a.b,a:1}}}else if(e instanceof Object&&void 0!==e.r&&void 0!==e.g&&void 0!==e.b){var d=void 0!==e.a?e.a:"1.0";i={r:e.r,g:e.g,b:e.b,a:d}}if(void 0===i)throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: "+(0,s.default)(e));this._setColor(i,t)}}},{key:"show",value:function(){void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}},{key:"_hide",value:function(){var e=this;!0===(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&(this.previousColor=c.extend({},this.color)),!0===this.applied&&this.updateCallback(this.initialColor),this.frame.style.display="none",setTimeout(function(){void 0!==e.closeCallback&&(e.closeCallback(),e.closeCallback=void 0)},0)}},{key:"_save",value:function(){this.updateCallback(this.color),this.applied=!1,this._hide()}},{key:"_apply",value:function(){this.applied=!0,this.updateCallback(this.color),this._updatePicker(this.color)}},{key:"_loadLast",value:function(){void 0!==this.previousColor?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}},{key:"_setColor",value:function(e){!0===(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&(this.initialColor=c.extend({},e)),this.color=e;var t=c.RGBToHSV(e.r,e.g,e.b),i=2*Math.PI,n=this.r*t.s,o=this.centerCoordinates.x+n*Math.sin(i*t.h),s=this.centerCoordinates.y+n*Math.cos(i*t.h);this.colorPickerSelector.style.left=o-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=s-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(e)}},{key:"_setOpacity",value:function(e){this.color.a=e/100,this._updatePicker(this.color)}},{key:"_setBrightness",value:function(e){var t=c.RGBToHSV(this.color.r,this.color.g,this.color.b);t.v=e/100;var i=c.HSVToRGB(t.h,t.s,t.v);i.a=this.color.a,this.color=i,this._updatePicker()}},{key:"_updatePicker",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color,t=c.RGBToHSV(e.r,e.g,e.b),i=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1)),i.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var n=this.colorPickerCanvas.clientWidth,o=this.colorPickerCanvas.clientHeight;i.clearRect(0,0,n,o),i.putImageData(this.hueCircle,0,0),i.fillStyle="rgba(0,0,0,"+(1-t.v)+")",i.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),i.fill(),this.brightnessRange.value=100*t.v,this.opacityRange.value=100*e.a,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}},{key:"_setSize",value:function(){this.colorPickerCanvas.style.width="100%",this.colorPickerCanvas.style.height="100%",this.colorPickerCanvas.width=289*this.pixelRatio,this.colorPickerCanvas.height=289*this.pixelRatio}},{key:"_create",value:function(){if(this.frame=document.createElement("div"),this.frame.className="vis-color-picker",this.colorPickerDiv=document.createElement("div"),this.colorPickerSelector=document.createElement("div"),this.colorPickerSelector.className="vis-selector",this.colorPickerDiv.appendChild(this.colorPickerSelector),this.colorPickerCanvas=document.createElement("canvas"),this.colorPickerDiv.appendChild(this.colorPickerCanvas),this.colorPickerCanvas.getContext){var e=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{var t=document.createElement("DIV");t.style.color="red",t.style.fontWeight="bold",t.style.padding="10px",t.innerHTML="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(t)}this.colorPickerDiv.className="vis-color",this.opacityDiv=document.createElement("div"),this.opacityDiv.className="vis-opacity",this.brightnessDiv=document.createElement("div"),this.brightnessDiv.className="vis-brightness",this.arrowDiv=document.createElement("div"),this.arrowDiv.className="vis-arrow",this.opacityRange=document.createElement("input");try{this.opacityRange.type="range",this.opacityRange.min="0",this.opacityRange.max="100"}catch(e){}this.opacityRange.value="100",this.opacityRange.className="vis-range",this.brightnessRange=document.createElement("input");try{this.brightnessRange.type="range",this.brightnessRange.min="0",this.brightnessRange.max="100"}catch(e){}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);var i=this;this.opacityRange.onchange=function(){i._setOpacity(this.value)},this.opacityRange.oninput=function(){i._setOpacity(this.value)},this.brightnessRange.onchange=function(){i._setBrightness(this.value)},this.brightnessRange.oninput=function(){i._setBrightness(this.value)},this.brightnessLabel=document.createElement("div"),this.brightnessLabel.className="vis-label vis-brightness",this.brightnessLabel.innerHTML="brightness:",this.opacityLabel=document.createElement("div"),this.opacityLabel.className="vis-label vis-opacity",this.opacityLabel.innerHTML="opacity:",this.newColorDiv=document.createElement("div"),this.newColorDiv.className="vis-new-color",this.newColorDiv.innerHTML="new",this.initialColorDiv=document.createElement("div"),this.initialColorDiv.className="vis-initial-color",this.initialColorDiv.innerHTML="initial",this.cancelButton=document.createElement("div"),this.cancelButton.className="vis-button vis-cancel",this.cancelButton.innerHTML="cancel",this.cancelButton.onclick=this._hide.bind(this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerHTML="apply",this.applyButton.onclick=this._apply.bind(this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerHTML="save",this.saveButton.onclick=this._save.bind(this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerHTML="load last",this.loadButton.onclick=this._loadLast.bind(this),this.frame.appendChild(this.colorPickerDiv),this.frame.appendChild(this.arrowDiv),this.frame.appendChild(this.brightnessLabel),this.frame.appendChild(this.brightnessDiv),this.frame.appendChild(this.opacityLabel),this.frame.appendChild(this.opacityDiv),this.frame.appendChild(this.newColorDiv),this.frame.appendChild(this.initialColorDiv),this.frame.appendChild(this.cancelButton),this.frame.appendChild(this.applyButton),this.frame.appendChild(this.saveButton),this.frame.appendChild(this.loadButton)}},{key:"_bindHammer",value:function(){var e=this;this.drag={},this.pinch={},this.hammer=new l(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),u.onTouch(this.hammer,function(t){e._moveSelector(t)}),this.hammer.on("tap",function(t){e._moveSelector(t)}),this.hammer.on("panstart",function(t){e._moveSelector(t)}),this.hammer.on("panmove",function(t){e._moveSelector(t)}),this.hammer.on("panend",function(t){e._moveSelector(t)})}},{key:"_generateHueCircle",value:function(){if(!1===this.generated){var e=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)),e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var t=this.colorPickerCanvas.clientWidth,i=this.colorPickerCanvas.clientHeight;e.clearRect(0,0,t,i);var n=void 0,o=void 0,s=void 0,r=void 0;this.centerCoordinates={x:.5*t,y:.5*i},this.r=.49*t;var a=2*Math.PI/360,d=1/this.r,h=void 0;for(s=0;s<360;s++)for(r=0;r<this.r;r++)n=this.centerCoordinates.x+r*Math.sin(a*s),o=this.centerCoordinates.y+r*Math.cos(a*s),h=c.HSVToRGB(s*(1/360),r*d,1),e.fillStyle="rgb("+h.r+","+h.g+","+h.b+")",e.fillRect(n-.5,o-.5,2,2);e.strokeStyle="rgba(0,0,0,1)",e.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),e.stroke(),this.hueCircle=e.getImageData(0,0,t,i)}this.generated=!0}},{key:"_moveSelector",value:function(e){var t=this.colorPickerDiv.getBoundingClientRect(),i=e.center.x-t.left,n=e.center.y-t.top,o=.5*this.colorPickerDiv.clientHeight,s=.5*this.colorPickerDiv.clientWidth,r=i-s,a=n-o,d=Math.atan2(r,a),h=.98*Math.min(Math.sqrt(r*r+a*a),s),l=Math.cos(d)*h+o,u=Math.sin(d)*h+s;this.colorPickerSelector.style.top=l-.5*this.colorPickerSelector.clientHeight+"px",this.colorPickerSelector.style.left=u-.5*this.colorPickerSelector.clientWidth+"px";var f=d/(2*Math.PI);f=f<0?f+1:f;var p=h/this.r,v=c.RGBToHSV(this.color.r,this.color.g,this.color.b);v.h=f,v.s=p;var g=c.HSVToRGB(v.h,v.s,v.v);g.a=this.color.a,this.color=g,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}}]),e}();t.default=f},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(23),s=n(o),r=i(0),a=n(r),d=i(1),h=n(d),l=i(191),u=n(l),c=function(){function e(t,i,n){(0,a.default)(this,e),this.body=t,this.springLength=i,this.springConstant=n,this.distanceSolver=new u.default}return(0,h.default)(e,[{key:"setOptions",value:function(e){e&&(e.springLength&&(this.springLength=e.springLength),e.springConstant&&(this.springConstant=e.springConstant))}},{key:"solve",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=this.distanceSolver.getDistances(this.body,e,t);this._createL_matrix(n),this._createK_matrix(n),this._createE_matrix();for(var o=0,r=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),a=1e9,d=0,h=0,l=0,u=0,c=0;a>.01&&o<r;){o+=1;var f=this._getHighestEnergyNode(i),p=(0,s.default)(f,4);for(d=p[0],a=p[1],h=p[2],l=p[3],u=a,c=0;u>1&&c<5;){c+=1,this._moveNode(d,h,l);var v=this._getEnergy(d),g=(0,s.default)(v,3);u=g[0],h=g[1],l=g[2]}}}},{key:"_getHighestEnergyNode",value:function(e){for(var t=this.body.nodeIndices,i=this.body.nodes,n=0,o=t[0],r=0,a=0,d=0;d<t.length;d++){var h=t[d];if(!1===i[h].predefinedPosition||!0===i[h].isCluster&&!0===e||!0===i[h].options.fixed.x||!0===i[h].options.fixed.y){var l=this._getEnergy(h),u=(0,s.default)(l,3),c=u[0],f=u[1],p=u[2];n<c&&(n=c,o=h,r=f,a=p)}}return[o,n,r,a]}},{key:"_getEnergy",value:function(e){var t=(0,s.default)(this.E_sums[e],2),i=t[0],n=t[1];return[Math.sqrt(Math.pow(i,2)+Math.pow(n,2)),i,n]}},{key:"_moveNode",value:function(e,t,i){for(var n=this.body.nodeIndices,o=this.body.nodes,s=0,r=0,a=0,d=o[e].x,h=o[e].y,l=this.K_matrix[e],u=this.L_matrix[e],c=0;c<n.length;c++){var f=n[c];if(f!==e){var p=o[f].x,v=o[f].y,g=l[f],y=u[f],m=1/Math.pow(Math.pow(d-p,2)+Math.pow(h-v,2),1.5);s+=g*(1-y*Math.pow(h-v,2)*m),r+=g*(y*(d-p)*(h-v)*m),a+=g*(1-y*Math.pow(d-p,2)*m)}}var b=s,_=r,w=t,k=a,x=i,O=(w/b+x/_)/(_/b-k/_),M=-(_*O+w)/b;o[e].x+=M,o[e].y+=O,this._updateE_matrix(e)}},{key:"_createL_matrix",value:function(e){var t=this.body.nodeIndices,i=this.springLength;this.L_matrix=[];for(var n=0;n<t.length;n++){this.L_matrix[t[n]]={};for(var o=0;o<t.length;o++)this.L_matrix[t[n]][t[o]]=i*e[t[n]][t[o]]}}},{key:"_createK_matrix",value:function(e){var t=this.body.nodeIndices,i=this.springConstant;this.K_matrix=[];for(var n=0;n<t.length;n++){this.K_matrix[t[n]]={};for(var o=0;o<t.length;o++)this.K_matrix[t[n]][t[o]]=i*Math.pow(e[t[n]][t[o]],-2)}}},{key:"_createE_matrix",value:function(){var e=this.body.nodeIndices,t=this.body.nodes;this.E_matrix={},this.E_sums={};for(var i=0;i<e.length;i++)this.E_matrix[e[i]]=[];for(var n=0;n<e.length;n++){for(var o=e[n],s=t[o].x,r=t[o].y,a=0,d=0,h=n;h<e.length;h++){var l=e[h];if(l!==o){var u=t[l].x,c=t[l].y,f=1/Math.sqrt(Math.pow(s-u,2)+Math.pow(r-c,2));this.E_matrix[o][h]=[this.K_matrix[o][l]*(s-u-this.L_matrix[o][l]*(s-u)*f),this.K_matrix[o][l]*(r-c-this.L_matrix[o][l]*(r-c)*f)],this.E_matrix[l][n]=this.E_matrix[o][h],a+=this.E_matrix[o][h][0],d+=this.E_matrix[o][h][1]}}this.E_sums[o]=[a,d]}}},{key:"_updateE_matrix",value:function(e){for(var t=this.body.nodeIndices,i=this.body.nodes,n=this.E_matrix[e],o=this.K_matrix[e],s=this.L_matrix[e],r=i[e].x,a=i[e].y,d=0,h=0,l=0;l<t.length;l++){var u=t[l];if(u!==e){var c=n[l],f=c[0],p=c[1],v=i[u].x,g=i[u].y,y=1/Math.sqrt(Math.pow(r-v,2)+Math.pow(a-g,2)),m=o[u]*(r-v-s[u]*(r-v)*y),b=o[u]*(a-g-s[u]*(a-g)*y);n[l]=[m,b],d+=m,h+=b;var _=this.E_sums[u];_[0]+=m-f,_[1]+=b-p}}this.E_sums[e]=[d,h]}}]),e}();t.default=c},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(0),s=n(o),r=i(1),a=n(r),d=function(){function e(){(0,s.default)(this,e)}return(0,a.default)(e,[{key:"getDistances",value:function(e,t,i){for(var n={},o=e.edges,s=0;s<t.length;s++){var r=t[s],a={};n[r]=a;for(var d=0;d<t.length;d++)a[t[d]]=s==d?0:1e9}for(var h=0;h<i.length;h++){var l=o[i[h]];!0===l.connected&&void 0!==n[l.fromId]&&void 0!==n[l.toId]&&(n[l.fromId][l.toId]=1,n[l.toId][l.fromId]=1)}for(var u=t.length,c=0;c<u;c++)for(var f=t[c],p=n[f],v=0;v<u-1;v++)for(var g=t[v],y=n[g],m=v+1;m<u;m++){var b=t[m],_=n[b],w=Math.min(y[b],y[f]+p[b]);y[b]=w,_[g]=w}return n}}]),e}();t.default=d}])});
\ No newline at end of file