You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wanijo/resources/public/js/vis-network.min.js

27 lines
509 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/**
* vis - network
* http://visjs.org/
*
* A dynamic, browser-based visualization library.
*
* @version 5.0.0
* @date 2019-07-16T20:12:25Z
*
* @copyright (c) 2011-2017 Almende B.V, http://almende.com
* @copyright (c) 2018-2019 visjs contributors, https://github.com/visjs
*
* @license
* vis.js is dual licensed under both
*
* 1. The Apache 2.0 License
* http://www.apache.org/licenses/LICENSE-2.0
*
* and
*
* 2. The MIT License
* http://opensource.org/licenses/MIT
*
* vis.js may be distributed under either license.
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).vis={})}(this,function(e){"use strict";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function en(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function t(e,t){return e(t={exports:{}},t.exports),t.exports}function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(t,e){var i=Object.keys(t);return Object.getOwnPropertySymbols&&i.push.apply(i,Object.getOwnPropertySymbols(t)),e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i}function i(e){return function(e){if(Array.isArray(e)){for(var t=0,i=new Array(e.length);t<e.length;t++)i[t]=e[t];return i}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function tn(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}for(var o,s=(function(Ji,e){Ji.exports=function(){var t,o;function d(){return t.apply(null,arguments)}function r(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function a(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function s(e){return void 0===e}function h(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function l(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function n(e,t){var i,n=[];for(i=0;i<e.length;++i)n.push(t(e[i],i));return n}function u(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function c(e,t){for(var i in t)u(t,i)&&(e[i]=t[i]);return u(t,"toString")&&(e.toString=t.toString),u(t,"valueOf")&&(e.valueOf=t.valueOf),e}function f(e,t,i,n){return Ft(e,t,i,n,!0).utc()}function p(e){return null==e._pf&&(e._pf={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}),e._pf}function v(e){if(null==e._isValid){var t=p(e),i=o.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 g(e){var t=f(NaN);return null!=e?c(p(t),e):p(t).userInvalidated=!0,t}o=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 m=d.momentProperties=[];function y(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=p(t)),s(t._locale)||(e._locale=t._locale),0<m.length)for(i=0;i<m.length;i++)n=m[i],s(o=t[n])||(e[n]=o);return e}var i=!1;function b(e){y(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===i&&(i=!0,d.updateOffset(this),i=!1)}function _(e){return e instanceof b||null!=e&&null!=e._isAMomentObject}function w(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function k(e){var t=+e,i=0;return 0!=t&&isFinite(t)&&(i=w(t)),i}function x(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&&k(e[n])!==k(t[n]))&&r++;return r+s}function S(e){!1===d.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function e(o,s){var r=!0;return c(function(){if(null!=d.deprecationHandler&&d.deprecationHandler(null,o),r){for(var e,t=[],i=0;i<arguments.length;i++){if(e="","object"==typeof arguments[i]){for(var n in e+="\n["+i+"] ",arguments[0])e+=n+": "+arguments[0][n]+", ";e=e.slice(0,-2)}else e=arguments[i];t.push(e)}S(o+"\nArguments: "+Array.prototype.slice.call(t).join("")+"\n"+(new Error).stack),r=!1}return s.apply(this,arguments)},s)}var D,M={};function O(e,t){null!=d.deprecationHandler&&d.deprecationHandler(e,t),M[e]||(S(t),M[e]=!0)}function E(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function T(e,t){var i,n=c({},e);for(i in t)u(t,i)&&(a(e[i])&&a(t[i])?(n[i]={},c(n[i],e[i]),c(n[i],t[i])):null!=t[i]?n[i]=t[i]:delete n[i]);for(i in e)u(e,i)&&!u(t,i)&&a(e[i])&&(n[i]=c({},n[i]));return n}function C(e){null!=e&&this.set(e)}d.suppressDeprecationWarnings=!1,d.deprecationHandler=null,D=Object.keys?Object.keys:function(e){var t,i=[];for(t in e)u(e,t)&&i.push(t);return i};var P={};function F(e,t){var i=e.toLowerCase();P[i]=P[i+"s"]=P[t]=e}function N(e){return"string"==typeof e?P[e]||P[e.toLowerCase()]:void 0}function I(e){var t,i,n={};for(i in e)u(e,i)&&(t=N(i))&&(n[t]=e[i]);return n}var Y={};function R(e,t){Y[e]=t}function z(e){var t=[];for(var i in e)t.push({unit:i,priority:Y[i]});return t.sort(function(e,t){return e.priority-t.priority}),t}function B(e,t,i){var n=""+Math.abs(e),o=t-n.length,s=0<=e;return(s?i?"+":"":"-")+Math.pow(10,Math.max(0,o)).toString().substr(1)+n}var A=/(\[[^\[]*\])|(\\)?([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,L=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,H={},j={};function W(e,t,i,n){var o=n;"string"==typeof n&&(o=function(){return this[n]()}),e&&(j[e]=o),t&&(j[t[0]]=function(){return B(o.apply(this,arguments),t[1],t[2])}),i&&(j[i]=function(){return this.localeData().ordinal(o.apply(this,arguments),e)})}function V(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function U(e,t){return e.isValid()?(t=G(t,e.localeData()),H[t]=H[t]||function(n){var e,o,s=n.match(A);for(e=0,o=s.length;e<o;e++)j[s[e]]?s[e]=j[s[e]]:s[e]=V(s[e]);return function(e){var t,i="";for(t=0;t<o;t++)i+=E(s[t])?s[t].call(e,n):s[t];return i}}(t),H[t](e)):e.localeData().invalidDate()}function G(e,t){var i=5;function n(e){return t.longDateFormat(e)||e}for(L.lastIndex=0;0<=i&&L.test(e);)e=e.replace(L,n),L.lastIndex=0,i-=1;return e}var q=/\d/,Z=/\d\d/,X=/\d{3}/,$=/\d{4}/,K=/[+-]?\d{6}/,Q=/\d\d?/,J=/\d\d\d\d?/,ee=/\d\d\d\d\d\d?/,te=/\d{1,3}/,ie=/\d{1,4}/,ne=/[+-]?\d{1,6}/,oe=/\d+/,se=/[+-]?\d+/,re=/Z|[+-]\d\d:?\d\d/gi,ae=/Z|[+-]\d\d(?::?\d\d)?/gi,he=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,de={};function le(e,i,n){de[e]=E(i)?i:function(e,t){return e&&n?n:i}}function ue(e,t){return u(de,e)?de[e](t._strict,t._locale):new RegExp(function(e){return ce(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,i,n,o){return t||i||n||o}))}(e))}function ce(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var fe={};function pe(e,i){var t,n=i;for("string"==typeof e&&(e=[e]),h(i)&&(n=function(e,t){t[i]=k(e)}),t=0;t<e.length;t++)fe[e[t]]=n}function ve(e,o){pe(e,function(e,t,i,n){i._w=i._w||{},o(e,i._w,i,n)})}function ge(e,t,i){null!=t&&u(fe,e)&&fe[e](t,i._a,i,e)}var me=0,ye=1,be=2,_e=3,we=4,ke=5,xe=6,Se=7,De=8;function Me(e){return Oe(e)?366:365}function Oe(e){return e%4==0&&e%100!=0||e%400==0}W("Y",0,0,function(){var e=this.year();return e<=9999?""+e:"+"+e}),W(0,["YY",2],0,function(){return this.year()%100}),W(0,["YYYY",4],0,"year"),W(0,["YYYYY",5],0,"year"),W(0,["YYYYYY",6,!0],0,"year"),F("year","y"),R("year",1),le("Y",se),le("YY",Q,Z),le("YYYY",ie,$),le("YYYYY",ne,K),le("YYYYYY",ne,K),pe(["YYYYY","YYYYYY"],me),pe("YYYY",function(e,t){t[me]=2===e.length?d.parseTwoDigitYear(e):k(e)}),pe("YY",function(e,t){t[me]=d.parseTwoDigitYear(e)}),pe("Y",function(e,t){t[me]=parseInt(e,10)}),d.parseTwoDigitYear=function(e){return k(e)+(68<k(e)?1900:2e3)};var Ee,Te=Ce("FullYear",!0);function Ce(t,i){return function(e){return null!=e?(Fe(this,t,e),d.updateOffset(this,i),this):Pe(this,t)}}function Pe(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function Fe(e,t,i){e.isValid()&&!isNaN(i)&&("FullYear"===t&&Oe(e.year())&&1===e.month()&&29===e.date()?e._d["set"+(e._isUTC?"UTC":"")+t](i,e.month(),Ne(i,e.month())):e._d["set"+(e._isUTC?"UTC":"")+t](i))}function Ne(e,t){if(isNaN(e)||isNaN(t))return NaN;var i=function(e,t){return(e%t+t)%t}(t,12);return e+=(t-i)/12,1===i?Oe(e)?29:28:31-i%7%2}Ee=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},W("M",["MM",2],"Mo",function(){return this.month()+1}),W("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),W("MMMM",0,0,function(e){return this.localeData().months(this,e)}),F("month","M"),R("month",8),le("M",Q),le("MM",Q,Z),le("MMM",function(e,t){return t.monthsShortRegex(e)}),le("MMMM",function(e,t){return t.monthsRegex(e)}),pe(["M","MM"],function(e,t){t[ye]=k(e)-1}),pe(["MMM","MMMM"],function(e,t,i,n){var o=i._locale.monthsParse(e,n,i._strict);null!=o?t[ye]=o:p(i).invalidMonth=e});var Ie=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Ye="January_February_March_April_May_June_July_August_September_October_November_December".split("_");var Re="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");function ze(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=f([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(s,"").toLocaleLowerCase();return i?"MMM"===t?-1!==(o=Ee.call(this._shortMonthsParse,r))?o:null:-1!==(o=Ee.call(this._longMonthsParse,r))?o:null:"MMM"===t?-1!==(o=Ee.call(this._shortMonthsParse,r))?o:-1!==(o=Ee.call(this._longMonthsParse,r))?o:null:-1!==(o=Ee.call(this._longMonthsParse,r))?o:-1!==(o=Ee.call(this._shortMonthsParse,r))?o:null}function Be(e,t){var i;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=k(t);else if(!h(t=e.localeData().monthsParse(t)))return e;return i=Math.min(e.date(),Ne(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,i),e}function Ae(e){return null!=e?(Be(this,e),d.updateOffset(this,!0),this):Pe(this,"Month")}var Le=he;var He=he;function je(){function e(e,t){return t.length-e.length}var t,i,n=[],o=[],s=[];for(t=0;t<12;t++)i=f([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]=ce(n[t]),o[t]=ce(o[t]);for(t=0;t<24;t++)s[t]=ce(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 We(e){var t;if(e<100&&0<=e){var i=Array.prototype.slice.call(arguments);i[0]=e+400,t=new Date(Date.UTC.apply(null,i)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)}else t=new Date(Date.UTC.apply(null,arguments));return t}function Ve(e,t,i){var n=7+t-i,o=(7+We(e,0,n).getUTCDay()-t)%7;return n-o-1}function Ue(e,t,i,n,o){var s,r,a=(7+i-n)%7,h=Ve(e,n,o),d=1+7*(t-1)+a+h;return r=d<=0?Me(s=e-1)+d:d>Me(e)?(s=e+1,d-Me(e)):(s=e,d),{year:s,dayOfYear:r}}function Ge(e,t,i){var n,o,s=Ve(e.year(),t,i),r=Math.floor((e.dayOfYear()-s-1)/7)+1;return r<1?(o=e.year()-1,n=r+qe(o,t,i)):r>qe(e.year(),t,i)?(n=r-qe(e.year(),t,i),o=e.year()+1):(o=e.year(),n=r),{week:n,year:o}}function qe(e,t,i){var n=Ve(e,t,i),o=Ve(e+1,t,i);return(Me(e)-n+o)/7}W("w",["ww",2],"wo","week"),W("W",["WW",2],"Wo","isoWeek"),F("week","w"),F("isoWeek","W"),R("week",5),R("isoWeek",5),le("w",Q),le("ww",Q,Z),le("W",Q),le("WW",Q,Z),ve(["w","ww","W","WW"],function(e,t,i,n){t[n.substr(0,1)]=k(e)});function Ze(e,t){return e.slice(t,7).concat(e.slice(0,t))}W("d",0,"do","day"),W("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),W("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),W("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),W("e",0,0,"weekday"),W("E",0,0,"isoWeekday"),F("day","d"),F("weekday","e"),F("isoWeekday","E"),R("day",11),R("weekday",11),R("isoWeekday",11),le("d",Q),le("e",Q),le("E",Q),le("dd",function(e,t){return t.weekdaysMinRegex(e)}),le("ddd",function(e,t){return t.weekdaysShortRegex(e)}),le("dddd",function(e,t){return t.weekdaysRegex(e)}),ve(["dd","ddd","dddd"],function(e,t,i,n){var o=i._locale.weekdaysParse(e,n,i._strict);null!=o?t.d=o:p(i).invalidWeekday=e}),ve(["d","e","E"],function(e,t,i,n){t[n]=k(e)});var Xe="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");var $e="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");var Ke="Su_Mo_Tu_We_Th_Fr_Sa".split("_");function Qe(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=f([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?-1!==(o=Ee.call(this._weekdaysParse,r))?o:null:"ddd"===t?-1!==(o=Ee.call(this._shortWeekdaysParse,r))?o:null:-1!==(o=Ee.call(this._minWeekdaysParse,r))?o:null:"dddd"===t?-1!==(o=Ee.call(this._weekdaysParse,r))?o:-1!==(o=Ee.call(this._shortWeekdaysParse,r))?o:-1!==(o=Ee.call(this._minWeekdaysParse,r))?o:null:"ddd"===t?-1!==(o=Ee.call(this._shortWeekdaysParse,r))?o:-1!==(o=Ee.call(this._weekdaysParse,r))?o:-1!==(o=Ee.call(this._minWeekdaysParse,r))?o:null:-1!==(o=Ee.call(this._minWeekdaysParse,r))?o:-1!==(o=Ee.call(this._weekdaysParse,r))?o:-1!==(o=Ee.call(this._shortWeekdaysParse,r))?o:null}var Je=he;var et=he;var tt=he;function it(){function e(e,t){return t.length-e.length}var t,i,n,o,s,r=[],a=[],h=[],d=[];for(t=0;t<7;t++)i=f([2e3,1]).day(t),n=this.weekdaysMin(i,""),o=this.weekdaysShort(i,""),s=this.weekdays(i,""),r.push(n),a.push(o),h.push(s),d.push(n),d.push(o),d.push(s);for(r.sort(e),a.sort(e),h.sort(e),d.sort(e),t=0;t<7;t++)a[t]=ce(a[t]),h[t]=ce(h[t]),d[t]=ce(d[t]);this._weekdaysRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+h.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+r.join("|")+")","i")}function nt(){return this.hours()%12||12}function ot(e,t){W(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function st(e,t){return t._meridiemParse}W("H",["HH",2],0,"hour"),W("h",["hh",2],0,nt),W("k",["kk",2],0,function(){return this.hours()||24}),W("hmm",0,0,function(){return""+nt.apply(this)+B(this.minutes(),2)}),W("hmmss",0,0,function(){return""+nt.apply(this)+B(this.minutes(),2)+B(this.seconds(),2)}),W("Hmm",0,0,function(){return""+this.hours()+B(this.minutes(),2)}),W("Hmmss",0,0,function(){return""+this.hours()+B(this.minutes(),2)+B(this.seconds(),2)}),ot("a",!0),ot("A",!1),F("hour","h"),R("hour",13),le("a",st),le("A",st),le("H",Q),le("h",Q),le("k",Q),le("HH",Q,Z),le("hh",Q,Z),le("kk",Q,Z),le("hmm",J),le("hmmss",ee),le("Hmm",J),le("Hmmss",ee),pe(["H","HH"],_e),pe(["k","kk"],function(e,t,i){var n=k(e);t[_e]=24===n?0:n}),pe(["a","A"],function(e,t,i){i._isPm=i._locale.isPM(e),i._meridiem=e}),pe(["h","hh"],function(e,t,i){t[_e]=k(e),p(i).bigHour=!0}),pe("hmm",function(e,t,i){var n=e.length-2;t[_e]=k(e.substr(0,n)),t[we]=k(e.substr(n)),p(i).bigHour=!0}),pe("hmmss",function(e,t,i){var n=e.length-4,o=e.length-2;t[_e]=k(e.substr(0,n)),t[we]=k(e.substr(n,2)),t[ke]=k(e.substr(o)),p(i).bigHour=!0}),pe("Hmm",function(e,t,i){var n=e.length-2;t[_e]=k(e.substr(0,n)),t[we]=k(e.substr(n))}),pe("Hmmss",function(e,t,i){var n=e.length-4,o=e.length-2;t[_e]=k(e.substr(0,n)),t[we]=k(e.substr(n,2)),t[ke]=k(e.substr(o))});var rt,at=Ce("Hours",!0),ht={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{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"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{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"},months:Ye,monthsShort:Re,week:{dow:0,doy:6},weekdays:Xe,weekdaysMin:Ke,weekdaysShort:$e,meridiemParse:/[ap]\.?m?\.?/i},dt={},lt={};function ut(e){return e?e.toLowerCase().replace("_","-"):e}function ct(e){var t=null;if(!dt[e]&&Ji&&Ji.exports)try{t=rt._abbr;var i=tn;i("./locale/"+e),ft(t)}catch(e){}return dt[e]}function ft(e,t){var i;return e&&((i=s(t)?vt(e):pt(e,t))?rt=i:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),rt._abbr}function pt(e,t){if(null===t)return delete dt[e],null;var i,n=ht;if(t.abbr=e,null!=dt[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."),n=dt[e]._config;else if(null!=t.parentLocale)if(null!=dt[t.parentLocale])n=dt[t.parentLocale]._config;else{if(null==(i=ct(t.parentLocale)))return lt[t.parentLocale]||(lt[t.parentLocale]=[]),lt[t.parentLocale].push({name:e,config:t}),null;n=i._config}return dt[e]=new C(T(n,t)),lt[e]&&lt[e].forEach(function(e){pt(e.name,e.config)}),ft(e),dt[e]}function vt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return rt;if(!r(e)){if(t=ct(e))return t;e=[e]}return function(e){var t,i,n,o,s=0;for(;s<e.length;){for(o=ut(e[s]).split("-"),t=o.length,i=(i=ut(e[s+1]))?i.split("-"):null;0<t;){if(n=ct(o.slice(0,t).join("-")))return n;if(i&&i.length>=t&&x(o,i,!0)>=t-1)break;t--}s++}return rt}(e)}function gt(e){var t,i=e._a;return i&&-2===p(e).overflow&&(t=i[ye]<0||11<i[ye]?ye:i[be]<1||i[be]>Ne(i[me],i[ye])?be:i[_e]<0||24<i[_e]||24===i[_e]&&(0!==i[we]||0!==i[ke]||0!==i[xe])?_e:i[we]<0||59<i[we]?we:i[ke]<0||59<i[ke]?ke:i[xe]<0||999<i[xe]?xe:-1,p(e)._overflowDayOfYear&&(t<me||be<t)&&(t=be),p(e)._overflowWeeks&&-1===t&&(t=Se),p(e)._overflowWeekday&&-1===t&&(t=De),p(e).overflow=t),e}function mt(e,t,i){return null!=e?e:null!=t?t:i}function yt(e){var t,i,n,o,s,r=[];if(!e._d){for(n=function(e){var t=new Date(d.now());if(e._useUTC)return[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()];return[t.getFullYear(),t.getMonth(),t.getDate()]}(e),e._w&&null==e._a[be]&&null==e._a[ye]&&function(e){var t,i,n,o,s,r,a,h;if(null!=(t=e._w).GG||null!=t.W||null!=t.E)s=1,r=4,i=mt(t.GG,e._a[me],Ge(Nt(),1,4).year),n=mt(t.W,1),((o=mt(t.E,1))<1||7<o)&&(h=!0);else{s=e._locale._week.dow,r=e._locale._week.doy;var d=Ge(Nt(),s,r);i=mt(t.gg,e._a[me],d.year),n=mt(t.w,d.week),null!=t.d?((o=t.d)<0||6<o)&&(h=!0):null!=t.e?(o=t.e+s,(t.e<0||6<t.e)&&(h=!0)):o=s}n<1||n>qe(i,s,r)?p(e)._overflowWeeks=!0:null!=h?p(e)._overflowWeekday=!0:(a=Ue(i,n,o,s,r),e._a[me]=a.year,e._dayOfYear=a.dayOfYear)}(e),null!=e._dayOfYear&&(s=mt(e._a[me],n[me]),(e._dayOfYear>Me(s)||0===e._dayOfYear)&&(p(e)._overflowDayOfYear=!0),i=We(s,0,e._dayOfYear),e._a[ye]=i.getUTCMonth(),e._a[be]=i.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=r[t]=n[t];for(;t<7;t++)e._a[t]=r[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[_e]&&0===e._a[we]&&0===e._a[ke]&&0===e._a[xe]&&(e._nextDay=!0,e._a[_e]=0),e._d=(e._useUTC?We:function(e,t,i,n,o,s,r){var a;e<100&&0<=e?(a=new Date(e+400,t,i,n,o,s,r),isFinite(a.getFullYear())&&a.setFullYear(e)):a=new Date(e,t,i,n,o,s,r);return a}).apply(null,r),o=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[_e]=24),e._w&&void 0!==e._w.d&&e._w.d!==o&&(p(e).weekdayMismatch=!0)}}var bt=/^\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)?)?$/,_t=/^\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)?)?$/,wt=/Z|[+-]\d\d(?::?\d\d)?/,kt=[["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}/]],xt=[["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/]],St=/^\/?Date\((\-?\d+)/i;function Dt(e){var t,i,n,o,s,r,a=e._i,h=bt.exec(a)||_t.exec(a);if(h){for(p(e).iso=!0,t=0,i=kt.length;t<i;t++)if(kt[t][1].exec(h[1])){o=kt[t][0],n=!1!==kt[t][2];break}if(null==o)return void(e._isValid=!1);if(h[3]){for(t=0,i=xt.length;t<i;t++)if(xt[t][1].exec(h[3])){s=(h[2]||" ")+xt[t][0];break}if(null==s)return void(e._isValid=!1)}if(!n&&null!=s)return void(e._isValid=!1);if(h[4]){if(!wt.exec(h[4]))return void(e._isValid=!1);r="Z"}e._f=o+(s||"")+(r||""),Ct(e)}else e._isValid=!1}var Mt=/^(?:(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}))$/;function Ot(e,t,i,n,o,s){var r=[function(e){var t=parseInt(e,10);{if(t<=49)return 2e3+t;if(t<=999)return 1900+t}return t}(e),Re.indexOf(t),parseInt(i,10),parseInt(n,10),parseInt(o,10)];return s&&r.push(parseInt(s,10)),r}var Et={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Tt(e){var t=Mt.exec(function(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}(e._i));if(t){var i=Ot(t[4],t[3],t[2],t[5],t[6],t[7]);if(!function(e,t,i){if(e){var n=$e.indexOf(e),o=new Date(t[0],t[1],t[2]).getDay();if(n!==o)return p(i).weekdayMismatch=!0,i._isValid=!1}return!0}(t[1],i,e))return;e._a=i,e._tzm=function(e,t,i){{if(e)return Et[e];if(t)return 0;var n=parseInt(i,10),o=n%100;return 60*((n-o)/100)+o}}(t[8],t[9],t[10]),e._d=We.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),p(e).rfc2822=!0}else e._isValid=!1}function Ct(e){if(e._f!==d.ISO_8601)if(e._f!==d.RFC_2822){e._a=[],p(e).empty=!0;var t,i,n,o,s,r=""+e._i,a=r.length,h=0;for(n=G(e._f,e._locale).match(A)||[],t=0;t<n.length;t++)o=n[t],(i=(r.match(ue(o,e))||[])[0])&&(0<(s=r.substr(0,r.indexOf(i))).length&&p(e).unusedInput.push(s),r=r.slice(r.indexOf(i)+i.length),h+=i.length),j[o]?(i?p(e).empty=!1:p(e).unusedTokens.push(o),ge(o,i,e)):e._strict&&!i&&p(e).unusedTokens.push(o);p(e).charsLeftOver=a-h,0<r.length&&p(e).unusedInput.push(r),e._a[_e]<=12&&!0===p(e).bigHour&&0<e._a[_e]&&(p(e).bigHour=void 0),p(e).parsedDateParts=e._a.slice(0),p(e).meridiem=e._meridiem,e._a[_e]=function(e,t,i){var n;if(null==i)return t;return null!=e.meridiemHour?e.meridiemHour(t,i):(null!=e.isPM&&((n=e.isPM(i))&&t<12&&(t+=12),n||12!==t||(t=0)),t)}(e._locale,e._a[_e],e._meridiem),yt(e),gt(e)}else Tt(e);else Dt(e)}function Pt(e){var t=e._i,i=e._f;return e._locale=e._locale||vt(e._l),null===t||void 0===i&&""===t?g({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),_(t)?new b(gt(t)):(l(t)?e._d=t:r(i)?function(e){var t,i,n,o,s;if(0===e._f.length)return p(e).invalidFormat=!0,e._d=new Date(NaN);for(o=0;o<e._f.length;o++)s=0,t=y({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[o],Ct(t),v(t)&&(s+=p(t).charsLeftOver,s+=10*p(t).unusedTokens.length,p(t).score=s,(null==n||s<n)&&(n=s,i=t));c(e,i||t)}(e):i?Ct(e):function(e){var t=e._i;s(t)?e._d=new Date(d.now()):l(t)?e._d=new Date(t.valueOf()):"string"==typeof t?function(e){var t=St.exec(e._i);if(null!==t)return e._d=new Date(+t[1]);{if(Dt(e),!1!==e._isValid)return;delete e._isValid}{if(Tt(e),!1!==e._isValid)return;delete e._isValid}d.createFromInputFallback(e)}(e):r(t)?(e._a=n(t.slice(0),function(e){return parseInt(e,10)}),yt(e)):a(t)?function(e){if(e._d)return;var t=I(e._i);e._a=n([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),yt(e)}(e):h(t)?e._d=new Date(t):d.createFromInputFallback(e)}(e),v(e)||(e._d=null),e))}function Ft(e,t,i,n,o){var s={};return!0!==i&&!1!==i||(n=i,i=void 0),(a(e)&&function(e){{if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0}}(e)||r(e)&&0===e.length)&&(e=void 0),s._isAMomentObject=!0,s._useUTC=s._isUTC=o,s._l=i,s._i=e,s._f=t,s._strict=n,function(e){var t=new b(gt(Pt(e)));t._nextDay&&(t.add(1,"d"),t._nextDay=void 0);return t}(s)}function Nt(e,t,i,n){return Ft(e,t,i,n,!1)}d.createFromInputFallback=e("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":""))}),d.ISO_8601=function(){},d.RFC_2822=function(){};var It=e("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Nt.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:g()}),Yt=e("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Nt.apply(null,arguments);return this.isValid()&&e.isValid()?this<e?this:e:g()});function Rt(e,t){var i,n;if(1===t.length&&r(t[0])&&(t=t[0]),!t.length)return Nt();for(i=t[0],n=1;n<t.length;++n)t[n].isValid()&&!t[n][e](i)||(i=t[n]);return i}var zt=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Bt(e){var t=I(e),i=t.year||0,n=t.quarter||0,o=t.month||0,s=t.week||t.isoWeek||0,r=t.day||0,a=t.hour||0,h=t.minute||0,d=t.second||0,l=t.millisecond||0;this._isValid=function(e){for(var t in e)if(-1===Ee.call(zt,t)||null!=e[t]&&isNaN(e[t]))return!1;for(var i=!1,n=0;n<zt.length;++n)if(e[zt[n]]){if(i)return!1;parseFloat(e[zt[n]])!==k(e[zt[n]])&&(i=!0)}return!0}(t),this._milliseconds=+l+1e3*d+6e4*h+1e3*a*60*60,this._days=+r+7*s,this._months=+o+3*n+12*i,this._data={},this._locale=vt(),this._bubble()}function At(e){return e instanceof Bt}function Lt(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Ht(e,i){W(e,0,0,function(){var e=this.utcOffset(),t="+";return e<0&&(e=-e,t="-"),t+B(~~(e/60),2)+i+B(~~e%60,2)})}Ht("Z",":"),Ht("ZZ",""),le("Z",ae),le("ZZ",ae),pe(["Z","ZZ"],function(e,t,i){i._useUTC=!0,i._tzm=Wt(ae,e)});var jt=/([\+\-]|\d\d)/gi;function Wt(e,t){var i=(t||"").match(e);if(null===i)return null;var n=i[i.length-1]||[],o=(n+"").match(jt)||["-",0,0],s=60*o[1]+k(o[2]);return 0===s?0:"+"===o[0]?s:-s}function Vt(e,t){var i,n;return t._isUTC?(i=t.clone(),n=(_(e)||l(e)?e.valueOf():Nt(e).valueOf())-i.valueOf(),i._d.setTime(i._d.valueOf()+n),d.updateOffset(i,!1),i):Nt(e).local()}function Ut(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Gt(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}d.updateOffset=function(){};var qt=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Zt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Xt(e,t){var i,n,o,s=e,r=null;return At(e)?s={ms:e._milliseconds,d:e._days,M:e._months}:h(e)?(s={},t?s[t]=e:s.milliseconds=e):(r=qt.exec(e))?(i="-"===r[1]?-1:1,s={y:0,d:k(r[be])*i,h:k(r[_e])*i,m:k(r[we])*i,s:k(r[ke])*i,ms:k(Lt(1e3*r[xe]))*i}):(r=Zt.exec(e))?(i="-"===r[1]?-1:1,s={y:$t(r[2],i),M:$t(r[3],i),w:$t(r[4],i),d:$t(r[5],i),h:$t(r[6],i),m:$t(r[7],i),s:$t(r[8],i)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(o=function(e,t){var i;if(!e.isValid()||!t.isValid())return{milliseconds:0,months:0};t=Vt(t,e),e.isBefore(t)?i=Kt(e,t):((i=Kt(t,e)).milliseconds=-i.milliseconds,i.months=-i.months);return i}(Nt(s.from),Nt(s.to)),(s={}).ms=o.milliseconds,s.M=o.months),n=new Bt(s),At(e)&&u(e,"_locale")&&(n._locale=e._locale),n}function $t(e,t){var i=e&&parseFloat(e.replace(",","."));return(isNaN(i)?0:i)*t}function Kt(e,t){var i={};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 Qt(n,o){return function(e,t){var i;return null===t||isNaN(+t)||(O(o,"moment()."+o+"(period, number) is deprecated. Please use moment()."+o+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=e,e=t,t=i),Jt(this,Xt(e="string"==typeof e?+e:e,t),n),this}}function Jt(e,t,i,n){var o=t._milliseconds,s=Lt(t._days),r=Lt(t._months);e.isValid()&&(n=null==n||n,r&&Be(e,Pe(e,"Month")+r*i),s&&Fe(e,"Date",Pe(e,"Date")+s*i),o&&e._d.setTime(e._d.valueOf()+o*i),n&&d.updateOffset(e,s||r))}Xt.fn=Bt.prototype,Xt.invalid=function(){return Xt(NaN)};var ei=Qt(1,"add"),ti=Qt(-1,"subtract");function ii(e,t){var i,n,o=12*(t.year()-e.year())+(t.month()-e.month()),s=e.clone().add(o,"months");return n=t-s<0?(i=e.clone().add(o-1,"months"),(t-s)/(s-i)):(i=e.clone().add(1+o,"months"),(t-s)/(i-s)),-(o+n)||0}function ni(e){var t;return void 0===e?this._locale._abbr:(null!=(t=vt(e))&&(this._locale=t),this)}d.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",d.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var oi=e("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)});function si(){return this._locale}var ri=126227808e5;function ai(e,t){return(e%t+t)%t}function hi(e,t,i){return e<100&&0<=e?new Date(e+400,t,i)-ri:new Date(e,t,i).valueOf()}function di(e,t,i){return e<100&&0<=e?Date.UTC(e+400,t,i)-ri:Date.UTC(e,t,i)}function li(e,t){W(0,[e,e.length],0,t)}function ui(e,t,i,n,o){var s;return null==e?Ge(this,n,o).year:((s=qe(e,n,o))<t&&(t=s),function(e,t,i,n,o){var s=Ue(e,t,i,n,o),r=We(s.year,0,s.dayOfYear);return this.year(r.getUTCFullYear()),this.month(r.getUTCMonth()),this.date(r.getUTCDate()),this}.call(this,e,t,i,n,o))}W(0,["gg",2],0,function(){return this.weekYear()%100}),W(0,["GG",2],0,function(){return this.isoWeekYear()%100}),li("gggg","weekYear"),li("ggggg","weekYear"),li("GGGG","isoWeekYear"),li("GGGGG","isoWeekYear"),F("weekYear","gg"),F("isoWeekYear","GG"),R("weekYear",1),R("isoWeekYear",1),le("G",se),le("g",se),le("GG",Q,Z),le("gg",Q,Z),le("GGGG",ie,$),le("gggg",ie,$),le("GGGGG",ne,K),le("ggggg",ne,K),ve(["gggg","ggggg","GGGG","GGGGG"],function(e,t,i,n){t[n.substr(0,2)]=k(e)}),ve(["gg","GG"],function(e,t,i,n){t[n]=d.parseTwoDigitYear(e)}),W("Q",0,"Qo","quarter"),F("quarter","Q"),R("quarter",7),le("Q",q),pe("Q",function(e,t){t[ye]=3*(k(e)-1)}),W("D",["DD",2],"Do","date"),F("date","D"),R("date",9),le("D",Q),le("DD",Q,Z),le("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),pe(["D","DD"],be),pe("Do",function(e,t){t[be]=k(e.match(Q)[0])});var ci=Ce("Date",!0);W("DDD",["DDDD",3],"DDDo","dayOfYear"),F("dayOfYear","DDD"),R("dayOfYear",4),le("DDD",te),le("DDDD",X),pe(["DDD","DDDD"],function(e,t,i){i._dayOfYear=k(e)}),W("m",["mm",2],0,"minute"),F("minute","m"),R("minute",14),le("m",Q),le("mm",Q,Z),pe(["m","mm"],we);var fi=Ce("Minutes",!1);W("s",["ss",2],0,"second"),F("second","s"),R("second",15),le("s",Q),le("ss",Q,Z),pe(["s","ss"],ke);var pi,vi=Ce("Seconds",!1);for(W("S",0,0,function(){return~~(this.millisecond()/100)}),W(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),W(0,["SSS",3],0,"millisecond"),W(0,["SSSS",4],0,function(){return 10*this.millisecond()}),W(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),W(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),W(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),W(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),W(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),F("millisecond","ms"),R("millisecond",16),le("S",te,q),le("SS",te,Z),le("SSS",te,X),pi="SSSS";pi.length<=9;pi+="S")le(pi,oe);function gi(e,t){t[xe]=k(1e3*("0."+e))}for(pi="S";pi.length<=9;pi+="S")pe(pi,gi);var mi=Ce("Milliseconds",!1);W("z",0,0,"zoneAbbr"),W("zz",0,0,"zoneName");var yi=b.prototype;function bi(e){return e}yi.add=ei,yi.calendar=function(e,t){var i=e||Nt(),n=Vt(i,this).startOf("day"),o=d.calendarFormat(this,n)||"sameElse",s=t&&(E(t[o])?t[o].call(this,i):t[o]);return this.format(s||this.localeData().calendar(o,this,Nt(i)))},yi.clone=function(){return new b(this)},yi.diff=function(e,t,i){var n,o,s;if(!this.isValid())return NaN;if(!(n=Vt(e,this)).isValid())return NaN;switch(o=6e4*(n.utcOffset()-this.utcOffset()),t=N(t)){case"year":s=ii(this,n)/12;break;case"month":s=ii(this,n);break;case"quarter":s=ii(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:w(s)},yi.endOf=function(e){var t;if(void 0===(e=N(e))||"millisecond"===e||!this.isValid())return this;var i=this._isUTC?di:hi;switch(e){case"year":t=i(this.year()+1,0,1)-1;break;case"quarter":t=i(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=i(this.year(),this.month()+1,1)-1;break;case"week":t=i(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=i(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=i(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=36e5-ai(t+(this._isUTC?0:6e4*this.utcOffset()),36e5)-1;break;case"minute":t=this._d.valueOf(),t+=6e4-ai(t,6e4)-1;break;case"second":t=this._d.valueOf(),t+=1e3-ai(t,1e3)-1}return this._d.setTime(t),d.updateOffset(this,!0),this},yi.format=function(e){e=e||(this.isUtc()?d.defaultFormatUtc:d.defaultFormat);var t=U(this,e);return this.localeData().postformat(t)},yi.from=function(e,t){return this.isValid()&&(_(e)&&e.isValid()||Nt(e).isValid())?Xt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},yi.fromNow=function(e){return this.from(Nt(),e)},yi.to=function(e,t){return this.isValid()&&(_(e)&&e.isValid()||Nt(e).isValid())?Xt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},yi.toNow=function(e){return this.to(Nt(),e)},yi.get=function(e){if(E(this[e=N(e)]))return this[e]();return this},yi.invalidAt=function(){return p(this).overflow},yi.isAfter=function(e,t){var i=_(e)?e:Nt(e);if(!this.isValid()||!i.isValid())return!1;return"millisecond"===(t=N(t)||"millisecond")?this.valueOf()>i.valueOf():i.valueOf()<this.clone().startOf(t).valueOf()},yi.isBefore=function(e,t){var i=_(e)?e:Nt(e);if(!this.isValid()||!i.isValid())return!1;return"millisecond"===(t=N(t)||"millisecond")?this.valueOf()<i.valueOf():this.clone().endOf(t).valueOf()<i.valueOf()},yi.isBetween=function(e,t,i,n){var o=_(e)?e:Nt(e),s=_(t)?t:Nt(t);return!!(this.isValid()&&o.isValid()&&s.isValid())&&(("("===(n=n||"()")[0]?this.isAfter(o,i):!this.isBefore(o,i))&&(")"===n[1]?this.isBefore(s,i):!this.isAfter(s,i)))},yi.isSame=function(e,t){var i,n=_(e)?e:Nt(e);if(!this.isValid()||!n.isValid())return!1;return"millisecond"===(t=N(t)||"millisecond")?this.valueOf()===n.valueOf():(i=n.valueOf(),this.clone().startOf(t).valueOf()<=i&&i<=this.clone().endOf(t).valueOf())},yi.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},yi.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},yi.isValid=function(){return v(this)},yi.lang=oi,yi.locale=ni,yi.localeData=si,yi.max=Yt,yi.min=It,yi.parsingFlags=function(){return c({},p(this))},yi.set=function(e,t){if("object"==typeof e)for(var i=z(e=I(e)),n=0;n<i.length;n++)this[i[n].unit](e[i[n].unit]);else if(E(this[e=N(e)]))return this[e](t);return this},yi.startOf=function(e){var t;if(void 0===(e=N(e))||"millisecond"===e||!this.isValid())return this;var i=this._isUTC?di:hi;switch(e){case"year":t=i(this.year(),0,1);break;case"quarter":t=i(this.year(),this.month()-this.month()%3,1);break;case"month":t=i(this.year(),this.month(),1);break;case"week":t=i(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=i(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=i(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=ai(t+(this._isUTC?0:6e4*this.utcOffset()),36e5);break;case"minute":t=this._d.valueOf(),t-=ai(t,6e4);break;case"second":t=this._d.valueOf(),t-=ai(t,1e3)}return this._d.setTime(t),d.updateOffset(this,!0),this},yi.subtract=ti,yi.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},yi.toObject=function(){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()}},yi.toDate=function(){return new Date(this.valueOf())},yi.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,i=t?this.clone().utc():this;if(i.year()<0||9999<i.year())return U(i,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ");if(E(Date.prototype.toISOString))return t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",U(i,"Z"));return U(i,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},yi.inspect=function(){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)},yi.toJSON=function(){return this.isValid()?this.toISOString():null},yi.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},yi.unix=function(){return Math.floor(this.valueOf()/1e3)},yi.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},yi.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},yi.year=Te,yi.isLeapYear=function(){return Oe(this.year())},yi.weekYear=function(e){return ui.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},yi.isoWeekYear=function(e){return ui.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},yi.quarter=yi.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},yi.month=Ae,yi.daysInMonth=function(){return Ne(this.year(),this.month())},yi.week=yi.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},yi.isoWeek=yi.isoWeeks=function(e){var t=Ge(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},yi.weeksInYear=function(){var e=this.localeData()._week;return qe(this.year(),e.dow,e.doy)},yi.isoWeeksInYear=function(){return qe(this.year(),1,4)},yi.date=ci,yi.day=yi.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(i=e,n=this.localeData(),e="string"==typeof i?isNaN(i)?"number"!=typeof(i=n.weekdaysParse(i))?null:i:parseInt(i,10):i,this.add(e-t,"d")):t;var i,n},yi.weekday=function(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")},yi.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;{if(null==e)return this.day()||7;var t=(i=e,n=this.localeData(),"string"!=typeof i?isNaN(i)?null:i:n.weekdaysParse(i)%7||7);return this.day(this.day()%7?t:t-7)}var i,n},yi.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},yi.hour=yi.hours=at,yi.minute=yi.minutes=fi,yi.second=yi.seconds=vi,yi.millisecond=yi.milliseconds=mi,yi.utcOffset=function(e,t,i){var n,o=this._offset||0;if(!this.isValid())return null!=e?this:NaN;{if(null==e)return this._isUTC?o:Ut(this);if("string"==typeof e){if(null===(e=Wt(ae,e)))return this}else Math.abs(e)<16&&!i&&(e*=60);return!this._isUTC&&t&&(n=Ut(this)),this._offset=e,this._isUTC=!0,null!=n&&this.add(n,"m"),o!==e&&(!t||this._changeInProgress?Jt(this,Xt(e-o,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,d.updateOffset(this,!0),this._changeInProgress=null)),this}},yi.utc=function(e){return this.utcOffset(0,e)},yi.local=function(e){this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Ut(this),"m"));return this},yi.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=Wt(re,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},yi.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Nt(e).utcOffset():0,(this.utcOffset()-e)%60==0)},yi.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},yi.isLocal=function(){return!!this.isValid()&&!this._isUTC},yi.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},yi.isUtc=Gt,yi.isUTC=Gt,yi.zoneAbbr=function(){return this._isUTC?"UTC":""},yi.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},yi.dates=e("dates accessor is deprecated. Use date instead.",ci),yi.months=e("months accessor is deprecated. Use month instead",Ae),yi.years=e("years accessor is deprecated. Use year instead",Te),yi.zone=e("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),yi.isDSTShifted=e("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!s(this._isDSTShifted))return this._isDSTShifted;var e={};if(y(e,this),(e=Pt(e))._a){var t=e._isUTC?f(e._a):Nt(e._a);this._isDSTShifted=this.isValid()&&0<x(e._a,t.toArray())}else this._isDSTShifted=!1;return this._isDSTShifted});var _i=C.prototype;function wi(e,t,i,n){var o=vt(),s=f().set(n,t);return o[i](s,e)}function ki(e,t,i){if(h(e)&&(t=e,e=void 0),e=e||"",null!=t)return wi(e,t,i,"month");var n,o=[];for(n=0;n<12;n++)o[n]=wi(e,n,i,"month");return o}function xi(e,t,i,n){t=("boolean"==typeof e?h(t)&&(i=t,t=void 0):(t=e,e=!1,h(i=t)&&(i=t,t=void 0)),t||"");var o,s=vt(),r=e?s._week.dow:0;if(null!=i)return wi(t,(i+r)%7,n,"day");var a=[];for(o=0;o<7;o++)a[o]=wi(t,(o+r)%7,n,"day");return a}_i.calendar=function(e,t,i){var n=this._calendar[e]||this._calendar.sameElse;return E(n)?n.call(t,i):n},_i.longDateFormat=function(e){var t=this._longDateFormat[e],i=this._longDateFormat[e.toUpperCase()];return!t&&i?(this._longDateFormat[e]=i.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e]):t},_i.invalidDate=function(){return this._invalidDate},_i.ordinal=function(e){return this._ordinal.replace("%d",e)},_i.preparse=bi,_i.postformat=bi,_i.relativeTime=function(e,t,i,n){var o=this._relativeTime[i];return E(o)?o(e,t,i,n):o.replace(/%d/i,e)},_i.pastFuture=function(e,t){var i=this._relativeTime[0<e?"future":"past"];return E(i)?i(t):i.replace(/%s/i,t)},_i.set=function(e){var t,i;for(i in e)E(t=e[i])?this[i]=t:this["_"+i]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},_i.months=function(e,t){return e?r(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Ie).test(t)?"format":"standalone"][e.month()]:r(this._months)?this._months:this._months.standalone},_i.monthsShort=function(e,t){return e?r(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Ie.test(t)?"format":"standalone"][e.month()]:r(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},_i.monthsParse=function(e,t,i){var n,o,s;if(this._monthsParseExact)return ze.call(this,e,t,i);this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]);for(n=0;n<12;n++){if(o=f([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}},_i.monthsRegex=function(e){return this._monthsParseExact?(u(this,"_monthsRegex")||je.call(this),e?this._monthsStrictRegex:this._monthsRegex):(u(this,"_monthsRegex")||(this._monthsRegex=He),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},_i.monthsShortRegex=function(e){return this._monthsParseExact?(u(this,"_monthsRegex")||je.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(u(this,"_monthsShortRegex")||(this._monthsShortRegex=Le),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},_i.week=function(e){return Ge(e,this._week.dow,this._week.doy).week},_i.firstDayOfYear=function(){return this._week.doy},_i.firstDayOfWeek=function(){return this._week.dow},_i.weekdays=function(e,t){var i=r(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Ze(i,this._week.dow):e?i[e.day()]:i},_i.weekdaysMin=function(e){return!0===e?Ze(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},_i.weekdaysShort=function(e){return!0===e?Ze(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},_i.weekdaysParse=function(e,t,i){var n,o,s;if(this._weekdaysParseExact)return Qe.call(this,e,t,i);this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]);for(n=0;n<7;n++){if(o=f([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}},_i.weekdaysRegex=function(e){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||it.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(u(this,"_weekdaysRegex")||(this._weekdaysRegex=Je),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},_i.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||it.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(u(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=et),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},_i.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||it.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(u(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=tt),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},_i.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},_i.meridiem=function(e,t,i){return 11<e?i?"pm":"PM":i?"am":"AM"},ft("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,i=1===k(e%100/10)?"th":1==t?"st":2==t?"nd":3==t?"rd":"th";return e+i}}),d.lang=e("moment.lang is deprecated. Use moment.locale instead.",ft),d.langData=e("moment.langData is deprecated. Use moment.localeData instead.",vt);var Si=Math.abs;function Di(e,t,i,n){var o=Xt(t,i);return e._milliseconds+=n*o._milliseconds,e._days+=n*o._days,e._months+=n*o._months,e._bubble()}function Mi(e){return e<0?Math.floor(e):Math.ceil(e)}function Oi(e){return 4800*e/146097}function Ei(e){return 146097*e/4800}function Ti(e){return function(){return this.as(e)}}var Ci=Ti("ms"),Pi=Ti("s"),Fi=Ti("m"),Ni=Ti("h"),Ii=Ti("d"),Yi=Ti("w"),Ri=Ti("M"),zi=Ti("Q"),Bi=Ti("y");function Ai(e){return function(){return this.isValid()?this._data[e]:NaN}}var Li=Ai("milliseconds"),Hi=Ai("seconds"),ji=Ai("minutes"),Wi=Ai("hours"),Vi=Ai("days"),Ui=Ai("months"),Gi=Ai("years");var qi=Math.round,Zi={ss:44,s:45,m:45,h:22,d:26,M:11};var Xi=Math.abs;function $i(e){return(0<e)-(e<0)||+e}function Ki(){if(!this.isValid())return this.localeData().invalidDate();var e,t,i=Xi(this._milliseconds)/1e3,n=Xi(this._days),o=Xi(this._months);e=w(i/60),t=w(e/60),i%=60,e%=60;var s=w(o/12),r=o%=12,a=n,h=t,d=e,l=i?i.toFixed(3).replace(/\.?0+$/,""):"",u=this.asSeconds();if(!u)return"P0D";var c=u<0?"-":"",f=$i(this._months)!==$i(u)?"-":"",p=$i(this._days)!==$i(u)?"-":"",v=$i(this._milliseconds)!==$i(u)?"-":"";return c+"P"+(s?f+s+"Y":"")+(r?f+r+"M":"")+(a?p+a+"D":"")+(h||d||l?"T":"")+(h?v+h+"H":"")+(d?v+d+"M":"")+(l?v+l+"S":"")}var Qi=Bt.prototype;return Qi.isValid=function(){return this._isValid},Qi.abs=function(){var e=this._data;return this._milliseconds=Si(this._milliseconds),this._days=Si(this._days),this._months=Si(this._months),e.milliseconds=Si(e.milliseconds),e.seconds=Si(e.seconds),e.minutes=Si(e.minutes),e.hours=Si(e.hours),e.months=Si(e.months),e.years=Si(e.years),this},Qi.add=function(e,t){return Di(this,e,t,1)},Qi.subtract=function(e,t){return Di(this,e,t,-1)},Qi.as=function(e){if(!this.isValid())return NaN;var t,i,n=this._milliseconds;if("month"===(e=N(e))||"quarter"===e||"year"===e)switch(t=this._days+n/864e5,i=this._months+Oi(t),e){case"month":return i;case"quarter":return i/3;case"year":return i/12}else switch(t=this._days+Math.round(Ei(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)}},Qi.asMilliseconds=Ci,Qi.asSeconds=Pi,Qi.asMinutes=Fi,Qi.asHours=Ni,Qi.asDays=Ii,Qi.asWeeks=Yi,Qi.asMonths=Ri,Qi.asQuarters=zi,Qi.asYears=Bi,Qi.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*k(this._months/12):NaN},Qi._bubble=function(){var e,t,i,n,o,s=this._milliseconds,r=this._days,a=this._months,h=this._data;return 0<=s&&0<=r&&0<=a||s<=0&&r<=0&&a<=0||(s+=864e5*Mi(Ei(a)+r),a=r=0),h.milliseconds=s%1e3,e=w(s/1e3),h.seconds=e%60,t=w(e/60),h.minutes=t%60,i=w(t/60),h.hours=i%24,r+=w(i/24),o=w(Oi(r)),a+=o,r-=Mi(Ei(o)),n=w(a/12),a%=12,h.days=r,h.months=a,h.years=n,this},Qi.clone=function(){return Xt(this)},Qi.get=function(e){return e=N(e),this.isValid()?this[e+"s"]():NaN},Qi.milliseconds=Li,Qi.seconds=Hi,Qi.minutes=ji,Qi.hours=Wi,Qi.days=Vi,Qi.weeks=function(){return w(this.days()/7)},Qi.months=Ui,Qi.years=Gi,Qi.humanize=function(e){if(!this.isValid())return this.localeData().invalidDate();var t=this.localeData(),i=function(e,t,i){var n=Xt(e).abs(),o=qi(n.as("s")),s=qi(n.as("m")),r=qi(n.as("h")),a=qi(n.as("d")),h=qi(n.as("M")),d=qi(n.as("y")),l=o<=Zi.ss&&["s",o]||o<Zi.s&&["ss",o]||s<=1&&["m"]||s<Zi.m&&["mm",s]||r<=1&&["h"]||r<Zi.h&&["hh",r]||a<=1&&["d"]||a<Zi.d&&["dd",a]||h<=1&&["M"]||h<Zi.M&&["MM",h]||d<=1&&["y"]||["yy",d];return l[2]=t,l[3]=0<+e,l[4]=i,function(e,t,i,n,o){return o.relativeTime(t||1,!!i,e,n)}.apply(null,l)}(this,!e,t);return e&&(i=t.pastFuture(+this,i)),t.postformat(i)},Qi.toISOString=Ki,Qi.toString=Ki,Qi.toJSON=Ki,Qi.locale=ni,Qi.localeData=si,Qi.toIsoString=e("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ki),Qi.lang=oi,W("X",0,0,"unix"),W("x",0,0,"valueOf"),le("x",se),le("X",/[+-]?\d+(\.\d{1,3})?/),pe("X",function(e,t,i){i._d=new Date(1e3*parseFloat(e,10))}),pe("x",function(e,t,i){i._d=new Date(k(e))}),d.version="2.24.0",function(e){t=e}(Nt),d.fn=yi,d.min=function(){return Rt("isBefore",[].slice.call(arguments,0))},d.max=function(){return Rt("isAfter",[].slice.call(arguments,0))},d.now=function(){return Date.now?Date.now():+new Date},d.utc=f,d.unix=function(e){return Nt(1e3*e)},d.months=function(e,t){return ki(e,t,"months")},d.isDate=l,d.locale=ft,d.invalid=g,d.duration=Xt,d.isMoment=_,d.weekdays=function(e,t,i){return xi(e,t,i,"weekdays")},d.parseZone=function(){return Nt.apply(null,arguments).parseZone()},d.localeData=vt,d.isDuration=At,d.monthsShort=function(e,t){return ki(e,t,"monthsShort")},d.weekdaysMin=function(e,t,i){return xi(e,t,i,"weekdaysMin")},d.defineLocale=pt,d.updateLocale=function(e,t){if(null!=t){var i,n,o=ht;null!=(n=ct(e))&&(o=n._config),t=T(o,t),(i=new C(t)).parentLocale=dt[e],dt[e]=i,ft(e)}else null!=dt[e]&&(null!=dt[e].parentLocale?dt[e]=dt[e].parentLocale:null!=dt[e]&&delete dt[e]);return dt[e]},d.locales=function(){return D(dt)},d.weekdaysShort=function(e,t,i){return xi(e,t,i,"weekdaysShort")},d.normalizeUnits=N,d.relativeTimeRounding=function(e){return void 0!==e?"function"==typeof e&&(qi=e,!0):qi},d.relativeTimeThreshold=function(e,t){return void 0!==Zi[e]&&(void 0===t?Zi[e]:(Zi[e]=t,"s"===e&&(Zi.ss=t-1),!0))},d.calendarFormat=function(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"},d.prototype=yi,d.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},d}()}(o={exports:{}},o.exports),o.exports),r=[],a=0;a<256;a++)r[a]=(a+256).toString(16).substr(1);for(var h=function(){if("undefined"!=typeof crypto&&crypto.getRandomValues){var e=new Uint8Array(16);return function(){return crypto.getRandomValues(e),e}}var i=new Array(16);return function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),i[t]=e>>>((3&t)<<3)&255;return i}}(),d=[],u=0;u<256;u++)d[u]=(u+256).toString(16).substr(1);var c=h();c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7];var f=/^\/?Date\((-?\d+)/i,p=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,v=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;function g(e){return e instanceof Number||"number"==typeof e}function m(e){return e instanceof String||"string"==typeof e}function y(e){return"object"===l(e)&&null!==e}function b(e){return s.isMoment(e)}function _(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 w=Object.assign;function k(e,t){var i=2<arguments.length&&void 0!==arguments[2]&&arguments[2],n=3<arguments.length&&void 0!==arguments[3]&&arguments[3];for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)||!0===i)if(t[o]&&t[o].constructor===Object)void 0===e[o]&&(e[o]={}),e[o].constructor===Object?k(e[o],t[o],i):_(e,t,o,n);else if(Array.isArray(t[o])){e[o]=[];for(var s=0;s<t[o].length;s++)e[o].push(t[o][s])}else _(e,t,o,n);return e}function x(e){var t=l(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}var S=Object.values;var D={asBoolean:function(e,t){return"function"==typeof e&&(e=e()),null!=e?0!=e:t||null},asNumber:function(e,t){return"function"==typeof e&&(e=e()),null!=e?Number(e)||t||null:t||null},asString:function(e,t){return"function"==typeof e&&(e=e()),null!=e?String(e):t||null},asSize:function(e,t){return"function"==typeof e&&(e=e()),m(e)?e:g(e)?e+"px":t||null},asElement:function(e,t){return"function"==typeof e&&(e=e()),e||t||null}};function M(e){var t;switch(e.length){case 3:case 4:return(t=v.exec(e))?{r:parseInt(t[1]+t[1],16),g:parseInt(t[2]+t[2],16),b:parseInt(t[3]+t[3],16)}:null;case 6:case 7:return(t=p.exec(e))?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null;default:return null}}function O(e,t,i){return"#"+((1<<24)+(e<<16)+(t<<8)+i).toString(16).slice(1)}function E(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));return n===o?{h:0,s:0,v:n}:{h:60*((e===n?3:i===n?1:5)-(e===n?t-i:i===n?e-t:i-e)/(o-n))/360,s:(o-n)/o,v:o}}var T=function(e){var o={};return e.split(";").forEach(function(e){if(""!=e.trim()){var t=e.split(":"),i=t[0].trim(),n=t[1].trim();o[i]=n}}),o},C=function(t){return Object.keys(t).map(function(e){return e+": "+t[e]}).join("; ")};function P(e,t,i){var n,o,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:n=i,o=l,s=h;break;case 1:n=d,o=i,s=h;break;case 2:n=h,o=i,s=l;break;case 3:n=h,o=d,s=i;break;case 4:n=l,o=h,s=i;break;case 5:n=i,o=h,s=d}return{r:Math.floor(255*n),g:Math.floor(255*o),b:Math.floor(255*s)}}function F(e,t,i){var n=P(e,t,i);return O(n.r,n.g,n.b)}function N(e){var t=M(e);if(!t)throw new TypeError("'".concat(e,"' is not a valid color."));return E(t.r,t.g,t.b)}function I(e){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(e)}function Y(e){return e=e.replace(" ",""),/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/i.test(e)}function R(e){if(null===e||"object"!==l(e))return null;if(e instanceof Element)return e;var t=Object.create(e);for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&"object"==l(e[i])&&(t[i]=R(e[i]));return t}var z=Object.freeze({isNumber:g,recursiveDOMDelete:function e(t){if(t)for(;!0===t.hasChildNodes();){var i=t.firstChild;i&&(e(i),t.removeChild(i))}},isString:m,isObject:y,isDate:function(e){if(e instanceof Date)return!0;if(m(e)){if(f.exec(e))return!0;if(!isNaN(Date.parse(e)))return!0}return!1},isMoment:b,fillIfDefined:function e(t,i){var n=2<arguments.length&&void 0!==arguments[2]&&arguments[2];for(var o in t)if(void 0!==i[o])if(null===i[o]||"object"!==l(i[o]))_(t,i,o,n);else{var s=t[o],r=i[o];y(s)&&y(r)&&e(s,r,n)}},extend:w,selectiveExtend:function(e,t){if(!Array.isArray(e))throw new Error("Array with property names expected as first argument");for(var i=2;i<(arguments.length<=2?0:arguments.length-2);i++)for(var n=i+2<2||arguments.length<=i+2?void 0:arguments[i+2],o=0;o<e.length;o++){var s=e[o];n&&Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},selectiveDeepExtend:function(e,t,i){var n=3<arguments.length&&void 0!==arguments[3]&&arguments[3];if(Array.isArray(i))throw new TypeError("Arrays are not supported by deepExtend");for(var o=0;o<e.length;o++){var s=e[o];if(Object.prototype.hasOwnProperty.call(i,s))if(i[s]&&i[s].constructor===Object)void 0===t[s]&&(t[s]={}),t[s].constructor===Object?k(t[s],i[s],!1,n):_(t,i,s,n);else{if(Array.isArray(i[s]))throw new TypeError("Arrays are not supported by deepExtend");_(t,i,s,n)}}return t},selectiveNotDeepExtend:function(e,t,i){var n=3<arguments.length&&void 0!==arguments[3]&&arguments[3];if(Array.isArray(i))throw new TypeError("Arrays are not supported by deepExtend");for(var o in i)if(Object.prototype.hasOwnProperty.call(i,o)&&-1===e.indexOf(o))if(i[o]&&i[o].constructor===Object)void 0===t[o]&&(t[o]={}),t[o].constructor===Object?k(t[o],i[o]):_(t,i,o,n);else if(Array.isArray(i[o])){t[o]=[];for(var s=0;s<i[o].length;s++)t[o].push(i[o][s])}else _(t,i,o,n);return t},deepExtend:k,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},convert:function(e,t){var i;if(void 0!==e){if(null===e)return null;if(!t)return e;if("string"!=typeof t&&!(t instanceof String))throw new Error("Type must be a string");switch(t){case"boolean":case"Boolean":return Boolean(e);case"number":case"Number":return m(e)&&!isNaN(Date.parse(e))?s(e).valueOf():Number(e.valueOf());case"string":case"String":return String(e);case"Date":if(g(e))return new Date(e);if(e instanceof Date)return new Date(e.valueOf());if(b(e))return new Date(e.valueOf());if(m(e))return(i=f.exec(e))?new Date(Number(i[1])):s(new Date(e)).toDate();throw new Error("Cannot convert object of type "+x(e)+" to type Date");case"Moment":if(g(e))return s(e);if(e instanceof Date)return s(e.valueOf());if(b(e))return s(e);if(m(e))return i=f.exec(e),s(i?Number(i[1]):e);throw new Error("Cannot convert object of type "+x(e)+" to type Date");case"ISODate":if(g(e))return new Date(e);if(e instanceof Date)return e.toISOString();if(b(e))return e.toDate().toISOString();if(m(e))return(i=f.exec(e))?new Date(Number(i[1])).toISOString():s(e).format();throw new Error("Cannot convert object of type "+x(e)+" to type ISODate");case"ASPDate":if(g(e))return"/Date("+e+")/";if(e instanceof Date)return"/Date("+e.valueOf()+")/";if(m(e))return"/Date("+((i=f.exec(e))?new Date(Number(i[1])).valueOf():new Date(e).valueOf())+")/";throw new Error("Cannot convert object of type "+x(e)+" to type ASPDate");default:throw new Error("Unknown type ".concat(t))}}},getType:x,copyAndExtendArray:function(e,t){return[].concat(i(e),[t])},copyArray:function(e){return e.slice()},getAbsoluteLeft:function(e){return e.getBoundingClientRect().left},getAbsoluteRight:function(e){return e.getBoundingClientRect().right},getAbsoluteTop:function(e){return e.getBoundingClientRect().top},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(" ")},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(" ")},forEach:function(e,t){if(Array.isArray(e))for(var i=e.length,n=0;n<i;n++)t(e[n],n,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t(e[o],o,e)},toArray:S,updateProperty:function(e,t,i){return e[t]!==i&&(e[t]=i,!0)},throttle:function(e){var t=!1;return function(){t||(t=!0,requestAnimationFrame(function(){t=!1,e()}))}},addEventListener:function(e,t,i,n){e.addEventListener?(void 0===n&&(n=!1),"mousewheel"===t&&0<=navigator.userAgent.indexOf("Firefox")&&(t="DOMMouseScroll"),e.addEventListener(t,i,n)):e.attachEvent("on"+t,i)},removeEventListener:function(e,t,i,n){e.removeEventListener?(void 0===n&&(n=!1),"mousewheel"===t&&0<=navigator.userAgent.indexOf("Firefox")&&(t="DOMMouseScroll"),e.removeEventListener(t,i,n)):e.detachEvent("on"+t,i)},preventDefault:function(e){(e=e||window.event)&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},getTarget:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:window.event,t=null;return e&&(e.target?t=e.target:e.srcElement&&(t=e.srcElement)),t instanceof Element&&(null==t.nodeType||3!=t.nodeType||(t=t.parentNode)instanceof Element)?t:null},hasParent:function(e,t){for(var i=e;i;){if(i===t)return!0;if(!i.parentNode)return!1;i=i.parentNode}return!1},option:D,hexToRGB:M,overrideOpacity:function(e,t){if(-1!==e.indexOf("rgba"))return e;if(-1!==e.indexOf("rgb")){var i=e.substr(e.indexOf("(")+1).replace(")","").split(",");return"rgba("+i[0]+","+i[1]+","+i[2]+","+t+")"}var n=M(e);return null==n?e:"rgba("+n.r+","+n.g+","+n.b+","+t+")"},RGBToHex:O,parseColor:function(e,t){if(m(e)){var i=e;if(Y(i)){var n=i.substr(4).substr(0,i.length-5).split(",").map(function(e){return parseInt(e)});i=O(n[0],n[1],n[2])}if(!0!==I(i))return{background:i,border:i,highlight:{background:i,border:i},hover:{background:i,border:i}};var o=N(i),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=F(r.h,r.s,r.v),h=F(s.h,s.s,s.v);return{background:i,border:a,highlight:{background:h,border:a},hover:{background:h,border:a}}}return t?{background:e.background||t.background,border:e.border||t.border,highlight:m(e.highlight)?{border:e.highlight,background:e.highlight}:{background:e.highlight&&e.highlight.background||t.highlight.background,border:e.highlight&&e.highlight.border||t.highlight.border},hover:m(e.hover)?{border:e.hover,background:e.hover}:{border:e.hover&&e.hover.border||t.hover.border,background:e.hover&&e.hover.background||t.hover.background}}:{background:e.background||void 0,border:e.border||void 0,highlight:m(e.highlight)?{border:e.highlight,background:e.highlight}:{background:e.highlight&&e.highlight.background||void 0,border:e.highlight&&e.highlight.border||void 0},hover:m(e.hover)?{border:e.hover,background:e.hover}:{border:e.hover&&e.hover.border||void 0,background:e.hover&&e.hover.background||void 0}}},RGBToHSV:E,addCssText:function(e,t){var i=function(o){for(var e=1;e<arguments.length;e++){var s=null!=arguments[e]?arguments[e]:{};e%2?n(s,!0).forEach(function(e){var t,i,n;t=o,n=s[i=e],i in t?Object.defineProperty(t,i,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[i]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(s)):n(s).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(s,e))})}return o}({},T(e.style.cssText),{},T(t));e.style.cssText=C(i)},removeCssText:function(e,t){var i=T(e.style.cssText),n=T(t);for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&delete i[o];e.style.cssText=C(i)},HSVToRGB:P,HSVToHex:F,hexToHSV:N,isValidHex:I,isValidRGB:Y,isValidRGBA:function(e){return e=e.replace(" ",""),/rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(0?.{1,3})\)/i.test(e)},selectiveBridgeObject:function(e,t){if(null===t||"object"!==l(t))return null;for(var i=Object.create(t),n=0;n<e.length;n++)Object.prototype.hasOwnProperty.call(t,e[n])&&"object"==l(t[e[n]])&&(i[e[n]]=R(t[e[n]]));return i},bridgeObject:R,insertSort:function(e,t){for(var i=0;i<e.length;i++){var n=e[i],o=void 0;for(o=i;0<o&&t(n,e[o-1])<0;o--)e[o]=e[o-1];e[o]=n}return e},mergeOptions:function(e,t,i){function n(e){return null!=e}function r(e){return null!==e&&"object"===l(e)}var o=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{};if(!r(e))throw new Error("Parameter mergeTarget must be an object");if(!r(t))throw new Error("Parameter options must be an object");if(!n(i))throw new Error("Parameter option must have a value");if(!r(o))throw new Error("Parameter globalOptions must be an object");var s=t[i],a=r(o)&&!function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}(o)?o[i]:void 0,h=a?a.enabled:void 0;if(void 0!==s){if("boolean"==typeof s)return r(e[i])||(e[i]={}),void(e[i].enabled=s);if(null===s&&!r(e[i])){if(!n(a))return;e[i]=Object.create(a)}if(r(s)){var d=!0;void 0!==s.enabled?d=s.enabled:void 0!==h&&(d=a.enabled),function(e,t,i){r(e[i])||(e[i]={});var n=t[i],o=e[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(o[s]=n[s])}(e,t,i),e[i].enabled=d}}},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),h=e[a],d=t(void 0===n?h[i]:h[i][n]);if(0==d)return a;-1==d?s=a+1:r=a-1,o++}return-1},binarySearchValue:function(e,t,i,n,o){var s,r,a,h,d=0,l=0,u=e.length-1;for(o=null!=o?o:function(e,t){return e==t?0:e<t?-1:1};l<=u&&d<1e4;){if(h=Math.floor(.5*(u+l)),s=e[Math.max(0,h-1)][i],r=e[h][i],a=e[Math.min(e.length-1,h+1)][i],0==o(r,t))return h;if(o(s,t)<0&&0<o(r,t))return"before"==n?Math.max(0,h-1):h;if(o(r,t)<0&&0<o(a,t))return"before"==n?h:Math.min(e.length-1,h+1);o(r,t)<0?l=h+1:u=h-1,d++}return-1},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}},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},topMost:function(e,t){var i;Array.isArray(t)||(t=[t]);var n=!0,o=!1,s=void 0;try{for(var r,a=e[Symbol.iterator]();!(n=(r=a.next()).done);n=!0){var h=r.value;if(h){i=h[t[0]];for(var d=1;d<t.length;d++)i=i&&i[t[d]];if(void 0!==i)break}}}catch(e){o=!0,s=e}finally{try{n||null==a.return||a.return()}finally{if(o)throw s}}return i},randomUUID:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=1<arguments.length?arguments[1]:void 0,i=t&&(2<arguments.length?arguments[2]:void 0)||0;"string"==typeof e&&(t="binary"===e?new Array(16):void 0,e={});var n=e.random||(e.rng||h)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t)for(var o=0;o<16;o++)t[i+o]=n[o];return t||function(e,t){var i=t||0,n=r;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++]]}(n)}}),B=t(function(e,d){d.prepareElements=function(e){for(var t in e)e.hasOwnProperty(t)&&(e[t].redundant=e[t].used,e[t].used=[])},d.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=[]}},d.resetElements=function(e){d.prepareElements(e),d.cleanupElements(e),d.prepareElements(e)},d.getSVGElement=function(e,t,i){var n;return t.hasOwnProperty(e)?0<t[e].redundant.length?(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},d.getDOMElement=function(e,t,i,n){var o;return t.hasOwnProperty(e)?0<t[e].redundant.length?(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},d.drawPoint=function(e,t,i,n,o,s){var r;if("circle"==i.style?((r=d.getSVGElement("circle",n,o)).setAttributeNS(null,"cx",e),r.setAttributeNS(null,"cy",t),r.setAttributeNS(null,"r",.5*i.size)):((r=d.getSVGElement("rect",n,o)).setAttributeNS(null,"x",e-.5*i.size),r.setAttributeNS(null,"y",t-.5*i.size),r.setAttributeNS(null,"width",i.size),r.setAttributeNS(null,"height",i.size)),void 0!==i.styles&&r.setAttributeNS(null,"style",i.styles),r.setAttributeNS(null,"class",i.className+" vis-point"),s){var a=d.getSVGElement("text",n,o);s.xOffset&&(e+=s.xOffset),s.yOffset&&(t+=s.yOffset),s.content&&(a.textContent=s.content),s.className&&a.setAttributeNS(null,"class",s.className+" vis-label"),a.setAttributeNS(null,"x",e),a.setAttributeNS(null,"y",t)}return r},d.drawBar=function(e,t,i,n,o,s,r,a){if(0!=n){n<0&&(t-=n*=-1);var h=d.getSVGElement("rect",s,r);h.setAttributeNS(null,"x",e-.5*i),h.setAttributeNS(null,"y",t),h.setAttributeNS(null,"width",i),h.setAttributeNS(null,"height",n),h.setAttributeNS(null,"class",o),a&&h.setAttributeNS(null,"style",a)}}});B.prepareElements,B.cleanupElements,B.resetElements,B.getSVGElement,B.getDOMElement,B.drawPoint,B.drawBar;var A=function(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e};function L(e,t){return e(t={exports:{}},t.exports),t.exports}var H=L(function(t){function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e){return"function"==typeof Symbol&&"symbol"===i(Symbol.iterator)?t.exports=n=function(e){return i(e)}:t.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":i(e)},n(e)}t.exports=n});var j=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};function W(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),Object.defineProperty(e,n.key,n)}}var V=function(e,t,i){return t&&W(e.prototype,t),i&&W(e,i),e};var U=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e};var G=function(e,t){return!t||"object"!==H(t)&&"function"!=typeof t?U(e):t},q=L(function(t){function i(e){return t.exports=i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}t.exports=i}),Z=L(function(i){function n(e,t){return i.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(e,t)}i.exports=n});for(var X=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Z(e,t)},$=[],K=0;K<256;K++)$[K]=(K+256).toString(16).substr(1);for(var Q=function(){if("undefined"!=typeof crypto&&crypto.getRandomValues){var e=new Uint8Array(16);return function(){return crypto.getRandomValues(e),e}}var i=new Array(16);return function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),i[t]=e>>>((3&t)<<3)&255;return i}}(),J=[],ee=0;ee<256;ee++)J[ee]=(ee+256).toString(16).substr(1);var te=Q();te[0],te[1],te[2],te[3],te[4],te[5],te[6],te[7];function ie(e,t,i){var n=0<arguments.length&&void 0!==e?e:{},o=1<arguments.length?t:void 0,s=o&&(2<arguments.length?i:void 0)||0;"string"==typeof n&&(o="binary"===n?new Array(16):void 0,n={});var r=n.random||(n.rng||Q)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,o)for(var a=0;a<16;a++)o[s+a]=r[a];return o||function(e,t){var i=t||0,n=$;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++]]}(r)}function ne(e){return(ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function nn(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}for(var oe,se=(function(Ji,e){Ji.exports=function(){var t,o;function d(){return t.apply(null,arguments)}function r(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function a(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function s(e){return void 0===e}function h(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function l(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function n(e,t){var i,n=[];for(i=0;i<e.length;++i)n.push(t(e[i],i));return n}function u(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function c(e,t){for(var i in t)u(t,i)&&(e[i]=t[i]);return u(t,"toString")&&(e.toString=t.toString),u(t,"valueOf")&&(e.valueOf=t.valueOf),e}function f(e,t,i,n){return Ft(e,t,i,n,!0).utc()}function p(e){return null==e._pf&&(e._pf={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}),e._pf}function v(e){if(null==e._isValid){var t=p(e),i=o.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 g(e){var t=f(NaN);return null!=e?c(p(t),e):p(t).userInvalidated=!0,t}o=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 m=d.momentProperties=[];function y(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=p(t)),s(t._locale)||(e._locale=t._locale),0<m.length)for(i=0;i<m.length;i++)n=m[i],s(o=t[n])||(e[n]=o);return e}var i=!1;function b(e){y(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===i&&(i=!0,d.updateOffset(this),i=!1)}function _(e){return e instanceof b||null!=e&&null!=e._isAMomentObject}function w(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function k(e){var t=+e,i=0;return 0!=t&&isFinite(t)&&(i=w(t)),i}function x(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&&k(e[n])!==k(t[n]))&&r++;return r+s}function S(e){!1===d.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function e(o,s){var r=!0;return c(function(){if(null!=d.deprecationHandler&&d.deprecationHandler(null,o),r){for(var e,t=[],i=0;i<arguments.length;i++){if(e="","object"==typeof arguments[i]){for(var n in e+="\n["+i+"] ",arguments[0])e+=n+": "+arguments[0][n]+", ";e=e.slice(0,-2)}else e=arguments[i];t.push(e)}S(o+"\nArguments: "+Array.prototype.slice.call(t).join("")+"\n"+(new Error).stack),r=!1}return s.apply(this,arguments)},s)}var D,M={};function O(e,t){null!=d.deprecationHandler&&d.deprecationHandler(e,t),M[e]||(S(t),M[e]=!0)}function E(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function T(e,t){var i,n=c({},e);for(i in t)u(t,i)&&(a(e[i])&&a(t[i])?(n[i]={},c(n[i],e[i]),c(n[i],t[i])):null!=t[i]?n[i]=t[i]:delete n[i]);for(i in e)u(e,i)&&!u(t,i)&&a(e[i])&&(n[i]=c({},n[i]));return n}function C(e){null!=e&&this.set(e)}d.suppressDeprecationWarnings=!1,d.deprecationHandler=null,D=Object.keys?Object.keys:function(e){var t,i=[];for(t in e)u(e,t)&&i.push(t);return i};var P={};function F(e,t){var i=e.toLowerCase();P[i]=P[i+"s"]=P[t]=e}function N(e){return"string"==typeof e?P[e]||P[e.toLowerCase()]:void 0}function I(e){var t,i,n={};for(i in e)u(e,i)&&(t=N(i))&&(n[t]=e[i]);return n}var Y={};function R(e,t){Y[e]=t}function z(e){var t=[];for(var i in e)t.push({unit:i,priority:Y[i]});return t.sort(function(e,t){return e.priority-t.priority}),t}function B(e,t,i){var n=""+Math.abs(e),o=t-n.length,s=0<=e;return(s?i?"+":"":"-")+Math.pow(10,Math.max(0,o)).toString().substr(1)+n}var A=/(\[[^\[]*\])|(\\)?([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,L=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,H={},j={};function W(e,t,i,n){var o=n;"string"==typeof n&&(o=function(){return this[n]()}),e&&(j[e]=o),t&&(j[t[0]]=function(){return B(o.apply(this,arguments),t[1],t[2])}),i&&(j[i]=function(){return this.localeData().ordinal(o.apply(this,arguments),e)})}function V(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function U(e,t){return e.isValid()?(t=G(t,e.localeData()),H[t]=H[t]||function(n){var e,o,s=n.match(A);for(e=0,o=s.length;e<o;e++)j[s[e]]?s[e]=j[s[e]]:s[e]=V(s[e]);return function(e){var t,i="";for(t=0;t<o;t++)i+=E(s[t])?s[t].call(e,n):s[t];return i}}(t),H[t](e)):e.localeData().invalidDate()}function G(e,t){var i=5;function n(e){return t.longDateFormat(e)||e}for(L.lastIndex=0;0<=i&&L.test(e);)e=e.replace(L,n),L.lastIndex=0,i-=1;return e}var q=/\d/,Z=/\d\d/,X=/\d{3}/,$=/\d{4}/,K=/[+-]?\d{6}/,Q=/\d\d?/,J=/\d\d\d\d?/,ee=/\d\d\d\d\d\d?/,te=/\d{1,3}/,ie=/\d{1,4}/,ne=/[+-]?\d{1,6}/,oe=/\d+/,se=/[+-]?\d+/,re=/Z|[+-]\d\d:?\d\d/gi,ae=/Z|[+-]\d\d(?::?\d\d)?/gi,he=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,de={};function le(e,i,n){de[e]=E(i)?i:function(e,t){return e&&n?n:i}}function ue(e,t){return u(de,e)?de[e](t._strict,t._locale):new RegExp(function(e){return ce(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,i,n,o){return t||i||n||o}))}(e))}function ce(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var fe={};function pe(e,i){var t,n=i;for("string"==typeof e&&(e=[e]),h(i)&&(n=function(e,t){t[i]=k(e)}),t=0;t<e.length;t++)fe[e[t]]=n}function ve(e,o){pe(e,function(e,t,i,n){i._w=i._w||{},o(e,i._w,i,n)})}function ge(e,t,i){null!=t&&u(fe,e)&&fe[e](t,i._a,i,e)}var me=0,ye=1,be=2,_e=3,we=4,ke=5,xe=6,Se=7,De=8;function Me(e){return Oe(e)?366:365}function Oe(e){return e%4==0&&e%100!=0||e%400==0}W("Y",0,0,function(){var e=this.year();return e<=9999?""+e:"+"+e}),W(0,["YY",2],0,function(){return this.year()%100}),W(0,["YYYY",4],0,"year"),W(0,["YYYYY",5],0,"year"),W(0,["YYYYYY",6,!0],0,"year"),F("year","y"),R("year",1),le("Y",se),le("YY",Q,Z),le("YYYY",ie,$),le("YYYYY",ne,K),le("YYYYYY",ne,K),pe(["YYYYY","YYYYYY"],me),pe("YYYY",function(e,t){t[me]=2===e.length?d.parseTwoDigitYear(e):k(e)}),pe("YY",function(e,t){t[me]=d.parseTwoDigitYear(e)}),pe("Y",function(e,t){t[me]=parseInt(e,10)}),d.parseTwoDigitYear=function(e){return k(e)+(68<k(e)?1900:2e3)};var Ee,Te=Ce("FullYear",!0);function Ce(t,i){return function(e){return null!=e?(Fe(this,t,e),d.updateOffset(this,i),this):Pe(this,t)}}function Pe(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function Fe(e,t,i){e.isValid()&&!isNaN(i)&&("FullYear"===t&&Oe(e.year())&&1===e.month()&&29===e.date()?e._d["set"+(e._isUTC?"UTC":"")+t](i,e.month(),Ne(i,e.month())):e._d["set"+(e._isUTC?"UTC":"")+t](i))}function Ne(e,t){if(isNaN(e)||isNaN(t))return NaN;var i=function(e,t){return(e%t+t)%t}(t,12);return e+=(t-i)/12,1===i?Oe(e)?29:28:31-i%7%2}Ee=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},W("M",["MM",2],"Mo",function(){return this.month()+1}),W("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),W("MMMM",0,0,function(e){return this.localeData().months(this,e)}),F("month","M"),R("month",8),le("M",Q),le("MM",Q,Z),le("MMM",function(e,t){return t.monthsShortRegex(e)}),le("MMMM",function(e,t){return t.monthsRegex(e)}),pe(["M","MM"],function(e,t){t[ye]=k(e)-1}),pe(["MMM","MMMM"],function(e,t,i,n){var o=i._locale.monthsParse(e,n,i._strict);null!=o?t[ye]=o:p(i).invalidMonth=e});var Ie=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Ye="January_February_March_April_May_June_July_August_September_October_November_December".split("_");var Re="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");function ze(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=f([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(s,"").toLocaleLowerCase();return i?"MMM"===t?-1!==(o=Ee.call(this._shortMonthsParse,r))?o:null:-1!==(o=Ee.call(this._longMonthsParse,r))?o:null:"MMM"===t?-1!==(o=Ee.call(this._shortMonthsParse,r))?o:-1!==(o=Ee.call(this._longMonthsParse,r))?o:null:-1!==(o=Ee.call(this._longMonthsParse,r))?o:-1!==(o=Ee.call(this._shortMonthsParse,r))?o:null}function Be(e,t){var i;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=k(t);else if(!h(t=e.localeData().monthsParse(t)))return e;return i=Math.min(e.date(),Ne(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,i),e}function Ae(e){return null!=e?(Be(this,e),d.updateOffset(this,!0),this):Pe(this,"Month")}var Le=he;var He=he;function je(){function e(e,t){return t.length-e.length}var t,i,n=[],o=[],s=[];for(t=0;t<12;t++)i=f([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]=ce(n[t]),o[t]=ce(o[t]);for(t=0;t<24;t++)s[t]=ce(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 We(e){var t;if(e<100&&0<=e){var i=Array.prototype.slice.call(arguments);i[0]=e+400,t=new Date(Date.UTC.apply(null,i)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)}else t=new Date(Date.UTC.apply(null,arguments));return t}function Ve(e,t,i){var n=7+t-i,o=(7+We(e,0,n).getUTCDay()-t)%7;return n-o-1}function Ue(e,t,i,n,o){var s,r,a=(7+i-n)%7,h=Ve(e,n,o),d=1+7*(t-1)+a+h;return r=d<=0?Me(s=e-1)+d:d>Me(e)?(s=e+1,d-Me(e)):(s=e,d),{year:s,dayOfYear:r}}function Ge(e,t,i){var n,o,s=Ve(e.year(),t,i),r=Math.floor((e.dayOfYear()-s-1)/7)+1;return r<1?(o=e.year()-1,n=r+qe(o,t,i)):r>qe(e.year(),t,i)?(n=r-qe(e.year(),t,i),o=e.year()+1):(o=e.year(),n=r),{week:n,year:o}}function qe(e,t,i){var n=Ve(e,t,i),o=Ve(e+1,t,i);return(Me(e)-n+o)/7}W("w",["ww",2],"wo","week"),W("W",["WW",2],"Wo","isoWeek"),F("week","w"),F("isoWeek","W"),R("week",5),R("isoWeek",5),le("w",Q),le("ww",Q,Z),le("W",Q),le("WW",Q,Z),ve(["w","ww","W","WW"],function(e,t,i,n){t[n.substr(0,1)]=k(e)});function Ze(e,t){return e.slice(t,7).concat(e.slice(0,t))}W("d",0,"do","day"),W("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),W("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),W("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),W("e",0,0,"weekday"),W("E",0,0,"isoWeekday"),F("day","d"),F("weekday","e"),F("isoWeekday","E"),R("day",11),R("weekday",11),R("isoWeekday",11),le("d",Q),le("e",Q),le("E",Q),le("dd",function(e,t){return t.weekdaysMinRegex(e)}),le("ddd",function(e,t){return t.weekdaysShortRegex(e)}),le("dddd",function(e,t){return t.weekdaysRegex(e)}),ve(["dd","ddd","dddd"],function(e,t,i,n){var o=i._locale.weekdaysParse(e,n,i._strict);null!=o?t.d=o:p(i).invalidWeekday=e}),ve(["d","e","E"],function(e,t,i,n){t[n]=k(e)});var Xe="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");var $e="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");var Ke="Su_Mo_Tu_We_Th_Fr_Sa".split("_");function Qe(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=f([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?-1!==(o=Ee.call(this._weekdaysParse,r))?o:null:"ddd"===t?-1!==(o=Ee.call(this._shortWeekdaysParse,r))?o:null:-1!==(o=Ee.call(this._minWeekdaysParse,r))?o:null:"dddd"===t?-1!==(o=Ee.call(this._weekdaysParse,r))?o:-1!==(o=Ee.call(this._shortWeekdaysParse,r))?o:-1!==(o=Ee.call(this._minWeekdaysParse,r))?o:null:"ddd"===t?-1!==(o=Ee.call(this._shortWeekdaysParse,r))?o:-1!==(o=Ee.call(this._weekdaysParse,r))?o:-1!==(o=Ee.call(this._minWeekdaysParse,r))?o:null:-1!==(o=Ee.call(this._minWeekdaysParse,r))?o:-1!==(o=Ee.call(this._weekdaysParse,r))?o:-1!==(o=Ee.call(this._shortWeekdaysParse,r))?o:null}var Je=he;var et=he;var tt=he;function it(){function e(e,t){return t.length-e.length}var t,i,n,o,s,r=[],a=[],h=[],d=[];for(t=0;t<7;t++)i=f([2e3,1]).day(t),n=this.weekdaysMin(i,""),o=this.weekdaysShort(i,""),s=this.weekdays(i,""),r.push(n),a.push(o),h.push(s),d.push(n),d.push(o),d.push(s);for(r.sort(e),a.sort(e),h.sort(e),d.sort(e),t=0;t<7;t++)a[t]=ce(a[t]),h[t]=ce(h[t]),d[t]=ce(d[t]);this._weekdaysRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+h.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+r.join("|")+")","i")}function nt(){return this.hours()%12||12}function ot(e,t){W(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function st(e,t){return t._meridiemParse}W("H",["HH",2],0,"hour"),W("h",["hh",2],0,nt),W("k",["kk",2],0,function(){return this.hours()||24}),W("hmm",0,0,function(){return""+nt.apply(this)+B(this.minutes(),2)}),W("hmmss",0,0,function(){return""+nt.apply(this)+B(this.minutes(),2)+B(this.seconds(),2)}),W("Hmm",0,0,function(){return""+this.hours()+B(this.minutes(),2)}),W("Hmmss",0,0,function(){return""+this.hours()+B(this.minutes(),2)+B(this.seconds(),2)}),ot("a",!0),ot("A",!1),F("hour","h"),R("hour",13),le("a",st),le("A",st),le("H",Q),le("h",Q),le("k",Q),le("HH",Q,Z),le("hh",Q,Z),le("kk",Q,Z),le("hmm",J),le("hmmss",ee),le("Hmm",J),le("Hmmss",ee),pe(["H","HH"],_e),pe(["k","kk"],function(e,t,i){var n=k(e);t[_e]=24===n?0:n}),pe(["a","A"],function(e,t,i){i._isPm=i._locale.isPM(e),i._meridiem=e}),pe(["h","hh"],function(e,t,i){t[_e]=k(e),p(i).bigHour=!0}),pe("hmm",function(e,t,i){var n=e.length-2;t[_e]=k(e.substr(0,n)),t[we]=k(e.substr(n)),p(i).bigHour=!0}),pe("hmmss",function(e,t,i){var n=e.length-4,o=e.length-2;t[_e]=k(e.substr(0,n)),t[we]=k(e.substr(n,2)),t[ke]=k(e.substr(o)),p(i).bigHour=!0}),pe("Hmm",function(e,t,i){var n=e.length-2;t[_e]=k(e.substr(0,n)),t[we]=k(e.substr(n))}),pe("Hmmss",function(e,t,i){var n=e.length-4,o=e.length-2;t[_e]=k(e.substr(0,n)),t[we]=k(e.substr(n,2)),t[ke]=k(e.substr(o))});var rt,at=Ce("Hours",!0),ht={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{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"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{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"},months:Ye,monthsShort:Re,week:{dow:0,doy:6},weekdays:Xe,weekdaysMin:Ke,weekdaysShort:$e,meridiemParse:/[ap]\.?m?\.?/i},dt={},lt={};function ut(e){return e?e.toLowerCase().replace("_","-"):e}function ct(e){var t=null;if(!dt[e]&&Ji&&Ji.exports)try{t=rt._abbr;var i=nn;i("./locale/"+e),ft(t)}catch(e){}return dt[e]}function ft(e,t){var i;return e&&((i=s(t)?vt(e):pt(e,t))?rt=i:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),rt._abbr}function pt(e,t){if(null===t)return delete dt[e],null;var i,n=ht;if(t.abbr=e,null!=dt[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."),n=dt[e]._config;else if(null!=t.parentLocale)if(null!=dt[t.parentLocale])n=dt[t.parentLocale]._config;else{if(null==(i=ct(t.parentLocale)))return lt[t.parentLocale]||(lt[t.parentLocale]=[]),lt[t.parentLocale].push({name:e,config:t}),null;n=i._config}return dt[e]=new C(T(n,t)),lt[e]&&lt[e].forEach(function(e){pt(e.name,e.config)}),ft(e),dt[e]}function vt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return rt;if(!r(e)){if(t=ct(e))return t;e=[e]}return function(e){var t,i,n,o,s=0;for(;s<e.length;){for(o=ut(e[s]).split("-"),t=o.length,i=(i=ut(e[s+1]))?i.split("-"):null;0<t;){if(n=ct(o.slice(0,t).join("-")))return n;if(i&&i.length>=t&&x(o,i,!0)>=t-1)break;t--}s++}return rt}(e)}function gt(e){var t,i=e._a;return i&&-2===p(e).overflow&&(t=i[ye]<0||11<i[ye]?ye:i[be]<1||i[be]>Ne(i[me],i[ye])?be:i[_e]<0||24<i[_e]||24===i[_e]&&(0!==i[we]||0!==i[ke]||0!==i[xe])?_e:i[we]<0||59<i[we]?we:i[ke]<0||59<i[ke]?ke:i[xe]<0||999<i[xe]?xe:-1,p(e)._overflowDayOfYear&&(t<me||be<t)&&(t=be),p(e)._overflowWeeks&&-1===t&&(t=Se),p(e)._overflowWeekday&&-1===t&&(t=De),p(e).overflow=t),e}function mt(e,t,i){return null!=e?e:null!=t?t:i}function yt(e){var t,i,n,o,s,r=[];if(!e._d){for(n=function(e){var t=new Date(d.now());if(e._useUTC)return[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()];return[t.getFullYear(),t.getMonth(),t.getDate()]}(e),e._w&&null==e._a[be]&&null==e._a[ye]&&function(e){var t,i,n,o,s,r,a,h;if(null!=(t=e._w).GG||null!=t.W||null!=t.E)s=1,r=4,i=mt(t.GG,e._a[me],Ge(Nt(),1,4).year),n=mt(t.W,1),((o=mt(t.E,1))<1||7<o)&&(h=!0);else{s=e._locale._week.dow,r=e._locale._week.doy;var d=Ge(Nt(),s,r);i=mt(t.gg,e._a[me],d.year),n=mt(t.w,d.week),null!=t.d?((o=t.d)<0||6<o)&&(h=!0):null!=t.e?(o=t.e+s,(t.e<0||6<t.e)&&(h=!0)):o=s}n<1||n>qe(i,s,r)?p(e)._overflowWeeks=!0:null!=h?p(e)._overflowWeekday=!0:(a=Ue(i,n,o,s,r),e._a[me]=a.year,e._dayOfYear=a.dayOfYear)}(e),null!=e._dayOfYear&&(s=mt(e._a[me],n[me]),(e._dayOfYear>Me(s)||0===e._dayOfYear)&&(p(e)._overflowDayOfYear=!0),i=We(s,0,e._dayOfYear),e._a[ye]=i.getUTCMonth(),e._a[be]=i.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=r[t]=n[t];for(;t<7;t++)e._a[t]=r[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[_e]&&0===e._a[we]&&0===e._a[ke]&&0===e._a[xe]&&(e._nextDay=!0,e._a[_e]=0),e._d=(e._useUTC?We:function(e,t,i,n,o,s,r){var a;e<100&&0<=e?(a=new Date(e+400,t,i,n,o,s,r),isFinite(a.getFullYear())&&a.setFullYear(e)):a=new Date(e,t,i,n,o,s,r);return a}).apply(null,r),o=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[_e]=24),e._w&&void 0!==e._w.d&&e._w.d!==o&&(p(e).weekdayMismatch=!0)}}var bt=/^\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)?)?$/,_t=/^\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)?)?$/,wt=/Z|[+-]\d\d(?::?\d\d)?/,kt=[["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}/]],xt=[["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/]],St=/^\/?Date\((\-?\d+)/i;function Dt(e){var t,i,n,o,s,r,a=e._i,h=bt.exec(a)||_t.exec(a);if(h){for(p(e).iso=!0,t=0,i=kt.length;t<i;t++)if(kt[t][1].exec(h[1])){o=kt[t][0],n=!1!==kt[t][2];break}if(null==o)return void(e._isValid=!1);if(h[3]){for(t=0,i=xt.length;t<i;t++)if(xt[t][1].exec(h[3])){s=(h[2]||" ")+xt[t][0];break}if(null==s)return void(e._isValid=!1)}if(!n&&null!=s)return void(e._isValid=!1);if(h[4]){if(!wt.exec(h[4]))return void(e._isValid=!1);r="Z"}e._f=o+(s||"")+(r||""),Ct(e)}else e._isValid=!1}var Mt=/^(?:(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}))$/;function Ot(e,t,i,n,o,s){var r=[function(e){var t=parseInt(e,10);{if(t<=49)return 2e3+t;if(t<=999)return 1900+t}return t}(e),Re.indexOf(t),parseInt(i,10),parseInt(n,10),parseInt(o,10)];return s&&r.push(parseInt(s,10)),r}var Et={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Tt(e){var t=Mt.exec(function(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}(e._i));if(t){var i=Ot(t[4],t[3],t[2],t[5],t[6],t[7]);if(!function(e,t,i){if(e){var n=$e.indexOf(e),o=new Date(t[0],t[1],t[2]).getDay();if(n!==o)return p(i).weekdayMismatch=!0,i._isValid=!1}return!0}(t[1],i,e))return;e._a=i,e._tzm=function(e,t,i){{if(e)return Et[e];if(t)return 0;var n=parseInt(i,10),o=n%100;return 60*((n-o)/100)+o}}(t[8],t[9],t[10]),e._d=We.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),p(e).rfc2822=!0}else e._isValid=!1}function Ct(e){if(e._f!==d.ISO_8601)if(e._f!==d.RFC_2822){e._a=[],p(e).empty=!0;var t,i,n,o,s,r=""+e._i,a=r.length,h=0;for(n=G(e._f,e._locale).match(A)||[],t=0;t<n.length;t++)o=n[t],(i=(r.match(ue(o,e))||[])[0])&&(0<(s=r.substr(0,r.indexOf(i))).length&&p(e).unusedInput.push(s),r=r.slice(r.indexOf(i)+i.length),h+=i.length),j[o]?(i?p(e).empty=!1:p(e).unusedTokens.push(o),ge(o,i,e)):e._strict&&!i&&p(e).unusedTokens.push(o);p(e).charsLeftOver=a-h,0<r.length&&p(e).unusedInput.push(r),e._a[_e]<=12&&!0===p(e).bigHour&&0<e._a[_e]&&(p(e).bigHour=void 0),p(e).parsedDateParts=e._a.slice(0),p(e).meridiem=e._meridiem,e._a[_e]=function(e,t,i){var n;if(null==i)return t;return null!=e.meridiemHour?e.meridiemHour(t,i):(null!=e.isPM&&((n=e.isPM(i))&&t<12&&(t+=12),n||12!==t||(t=0)),t)}(e._locale,e._a[_e],e._meridiem),yt(e),gt(e)}else Tt(e);else Dt(e)}function Pt(e){var t=e._i,i=e._f;return e._locale=e._locale||vt(e._l),null===t||void 0===i&&""===t?g({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),_(t)?new b(gt(t)):(l(t)?e._d=t:r(i)?function(e){var t,i,n,o,s;if(0===e._f.length)return p(e).invalidFormat=!0,e._d=new Date(NaN);for(o=0;o<e._f.length;o++)s=0,t=y({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[o],Ct(t),v(t)&&(s+=p(t).charsLeftOver,s+=10*p(t).unusedTokens.length,p(t).score=s,(null==n||s<n)&&(n=s,i=t));c(e,i||t)}(e):i?Ct(e):function(e){var t=e._i;s(t)?e._d=new Date(d.now()):l(t)?e._d=new Date(t.valueOf()):"string"==typeof t?function(e){var t=St.exec(e._i);if(null!==t)return e._d=new Date(+t[1]);{if(Dt(e),!1!==e._isValid)return;delete e._isValid}{if(Tt(e),!1!==e._isValid)return;delete e._isValid}d.createFromInputFallback(e)}(e):r(t)?(e._a=n(t.slice(0),function(e){return parseInt(e,10)}),yt(e)):a(t)?function(e){if(e._d)return;var t=I(e._i);e._a=n([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),yt(e)}(e):h(t)?e._d=new Date(t):d.createFromInputFallback(e)}(e),v(e)||(e._d=null),e))}function Ft(e,t,i,n,o){var s={};return!0!==i&&!1!==i||(n=i,i=void 0),(a(e)&&function(e){{if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0}}(e)||r(e)&&0===e.length)&&(e=void 0),s._isAMomentObject=!0,s._useUTC=s._isUTC=o,s._l=i,s._i=e,s._f=t,s._strict=n,function(e){var t=new b(gt(Pt(e)));t._nextDay&&(t.add(1,"d"),t._nextDay=void 0);return t}(s)}function Nt(e,t,i,n){return Ft(e,t,i,n,!1)}d.createFromInputFallback=e("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":""))}),d.ISO_8601=function(){},d.RFC_2822=function(){};var It=e("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Nt.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:g()}),Yt=e("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Nt.apply(null,arguments);return this.isValid()&&e.isValid()?this<e?this:e:g()});function Rt(e,t){var i,n;if(1===t.length&&r(t[0])&&(t=t[0]),!t.length)return Nt();for(i=t[0],n=1;n<t.length;++n)t[n].isValid()&&!t[n][e](i)||(i=t[n]);return i}var zt=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Bt(e){var t=I(e),i=t.year||0,n=t.quarter||0,o=t.month||0,s=t.week||t.isoWeek||0,r=t.day||0,a=t.hour||0,h=t.minute||0,d=t.second||0,l=t.millisecond||0;this._isValid=function(e){for(var t in e)if(-1===Ee.call(zt,t)||null!=e[t]&&isNaN(e[t]))return!1;for(var i=!1,n=0;n<zt.length;++n)if(e[zt[n]]){if(i)return!1;parseFloat(e[zt[n]])!==k(e[zt[n]])&&(i=!0)}return!0}(t),this._milliseconds=+l+1e3*d+6e4*h+1e3*a*60*60,this._days=+r+7*s,this._months=+o+3*n+12*i,this._data={},this._locale=vt(),this._bubble()}function At(e){return e instanceof Bt}function Lt(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Ht(e,i){W(e,0,0,function(){var e=this.utcOffset(),t="+";return e<0&&(e=-e,t="-"),t+B(~~(e/60),2)+i+B(~~e%60,2)})}Ht("Z",":"),Ht("ZZ",""),le("Z",ae),le("ZZ",ae),pe(["Z","ZZ"],function(e,t,i){i._useUTC=!0,i._tzm=Wt(ae,e)});var jt=/([\+\-]|\d\d)/gi;function Wt(e,t){var i=(t||"").match(e);if(null===i)return null;var n=i[i.length-1]||[],o=(n+"").match(jt)||["-",0,0],s=60*o[1]+k(o[2]);return 0===s?0:"+"===o[0]?s:-s}function Vt(e,t){var i,n;return t._isUTC?(i=t.clone(),n=(_(e)||l(e)?e.valueOf():Nt(e).valueOf())-i.valueOf(),i._d.setTime(i._d.valueOf()+n),d.updateOffset(i,!1),i):Nt(e).local()}function Ut(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Gt(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}d.updateOffset=function(){};var qt=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Zt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Xt(e,t){var i,n,o,s=e,r=null;return At(e)?s={ms:e._milliseconds,d:e._days,M:e._months}:h(e)?(s={},t?s[t]=e:s.milliseconds=e):(r=qt.exec(e))?(i="-"===r[1]?-1:1,s={y:0,d:k(r[be])*i,h:k(r[_e])*i,m:k(r[we])*i,s:k(r[ke])*i,ms:k(Lt(1e3*r[xe]))*i}):(r=Zt.exec(e))?(i="-"===r[1]?-1:1,s={y:$t(r[2],i),M:$t(r[3],i),w:$t(r[4],i),d:$t(r[5],i),h:$t(r[6],i),m:$t(r[7],i),s:$t(r[8],i)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(o=function(e,t){var i;if(!e.isValid()||!t.isValid())return{milliseconds:0,months:0};t=Vt(t,e),e.isBefore(t)?i=Kt(e,t):((i=Kt(t,e)).milliseconds=-i.milliseconds,i.months=-i.months);return i}(Nt(s.from),Nt(s.to)),(s={}).ms=o.milliseconds,s.M=o.months),n=new Bt(s),At(e)&&u(e,"_locale")&&(n._locale=e._locale),n}function $t(e,t){var i=e&&parseFloat(e.replace(",","."));return(isNaN(i)?0:i)*t}function Kt(e,t){var i={};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 Qt(n,o){return function(e,t){var i;return null===t||isNaN(+t)||(O(o,"moment()."+o+"(period, number) is deprecated. Please use moment()."+o+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=e,e=t,t=i),Jt(this,Xt(e="string"==typeof e?+e:e,t),n),this}}function Jt(e,t,i,n){var o=t._milliseconds,s=Lt(t._days),r=Lt(t._months);e.isValid()&&(n=null==n||n,r&&Be(e,Pe(e,"Month")+r*i),s&&Fe(e,"Date",Pe(e,"Date")+s*i),o&&e._d.setTime(e._d.valueOf()+o*i),n&&d.updateOffset(e,s||r))}Xt.fn=Bt.prototype,Xt.invalid=function(){return Xt(NaN)};var ei=Qt(1,"add"),ti=Qt(-1,"subtract");function ii(e,t){var i,n,o=12*(t.year()-e.year())+(t.month()-e.month()),s=e.clone().add(o,"months");return n=t-s<0?(i=e.clone().add(o-1,"months"),(t-s)/(s-i)):(i=e.clone().add(1+o,"months"),(t-s)/(i-s)),-(o+n)||0}function ni(e){var t;return void 0===e?this._locale._abbr:(null!=(t=vt(e))&&(this._locale=t),this)}d.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",d.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var oi=e("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)});function si(){return this._locale}var ri=126227808e5;function ai(e,t){return(e%t+t)%t}function hi(e,t,i){return e<100&&0<=e?new Date(e+400,t,i)-ri:new Date(e,t,i).valueOf()}function di(e,t,i){return e<100&&0<=e?Date.UTC(e+400,t,i)-ri:Date.UTC(e,t,i)}function li(e,t){W(0,[e,e.length],0,t)}function ui(e,t,i,n,o){var s;return null==e?Ge(this,n,o).year:((s=qe(e,n,o))<t&&(t=s),function(e,t,i,n,o){var s=Ue(e,t,i,n,o),r=We(s.year,0,s.dayOfYear);return this.year(r.getUTCFullYear()),this.month(r.getUTCMonth()),this.date(r.getUTCDate()),this}.call(this,e,t,i,n,o))}W(0,["gg",2],0,function(){return this.weekYear()%100}),W(0,["GG",2],0,function(){return this.isoWeekYear()%100}),li("gggg","weekYear"),li("ggggg","weekYear"),li("GGGG","isoWeekYear"),li("GGGGG","isoWeekYear"),F("weekYear","gg"),F("isoWeekYear","GG"),R("weekYear",1),R("isoWeekYear",1),le("G",se),le("g",se),le("GG",Q,Z),le("gg",Q,Z),le("GGGG",ie,$),le("gggg",ie,$),le("GGGGG",ne,K),le("ggggg",ne,K),ve(["gggg","ggggg","GGGG","GGGGG"],function(e,t,i,n){t[n.substr(0,2)]=k(e)}),ve(["gg","GG"],function(e,t,i,n){t[n]=d.parseTwoDigitYear(e)}),W("Q",0,"Qo","quarter"),F("quarter","Q"),R("quarter",7),le("Q",q),pe("Q",function(e,t){t[ye]=3*(k(e)-1)}),W("D",["DD",2],"Do","date"),F("date","D"),R("date",9),le("D",Q),le("DD",Q,Z),le("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),pe(["D","DD"],be),pe("Do",function(e,t){t[be]=k(e.match(Q)[0])});var ci=Ce("Date",!0);W("DDD",["DDDD",3],"DDDo","dayOfYear"),F("dayOfYear","DDD"),R("dayOfYear",4),le("DDD",te),le("DDDD",X),pe(["DDD","DDDD"],function(e,t,i){i._dayOfYear=k(e)}),W("m",["mm",2],0,"minute"),F("minute","m"),R("minute",14),le("m",Q),le("mm",Q,Z),pe(["m","mm"],we);var fi=Ce("Minutes",!1);W("s",["ss",2],0,"second"),F("second","s"),R("second",15),le("s",Q),le("ss",Q,Z),pe(["s","ss"],ke);var pi,vi=Ce("Seconds",!1);for(W("S",0,0,function(){return~~(this.millisecond()/100)}),W(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),W(0,["SSS",3],0,"millisecond"),W(0,["SSSS",4],0,function(){return 10*this.millisecond()}),W(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),W(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),W(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),W(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),W(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),F("millisecond","ms"),R("millisecond",16),le("S",te,q),le("SS",te,Z),le("SSS",te,X),pi="SSSS";pi.length<=9;pi+="S")le(pi,oe);function gi(e,t){t[xe]=k(1e3*("0."+e))}for(pi="S";pi.length<=9;pi+="S")pe(pi,gi);var mi=Ce("Milliseconds",!1);W("z",0,0,"zoneAbbr"),W("zz",0,0,"zoneName");var yi=b.prototype;function bi(e){return e}yi.add=ei,yi.calendar=function(e,t){var i=e||Nt(),n=Vt(i,this).startOf("day"),o=d.calendarFormat(this,n)||"sameElse",s=t&&(E(t[o])?t[o].call(this,i):t[o]);return this.format(s||this.localeData().calendar(o,this,Nt(i)))},yi.clone=function(){return new b(this)},yi.diff=function(e,t,i){var n,o,s;if(!this.isValid())return NaN;if(!(n=Vt(e,this)).isValid())return NaN;switch(o=6e4*(n.utcOffset()-this.utcOffset()),t=N(t)){case"year":s=ii(this,n)/12;break;case"month":s=ii(this,n);break;case"quarter":s=ii(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:w(s)},yi.endOf=function(e){var t;if(void 0===(e=N(e))||"millisecond"===e||!this.isValid())return this;var i=this._isUTC?di:hi;switch(e){case"year":t=i(this.year()+1,0,1)-1;break;case"quarter":t=i(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=i(this.year(),this.month()+1,1)-1;break;case"week":t=i(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=i(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=i(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=36e5-ai(t+(this._isUTC?0:6e4*this.utcOffset()),36e5)-1;break;case"minute":t=this._d.valueOf(),t+=6e4-ai(t,6e4)-1;break;case"second":t=this._d.valueOf(),t+=1e3-ai(t,1e3)-1}return this._d.setTime(t),d.updateOffset(this,!0),this},yi.format=function(e){e=e||(this.isUtc()?d.defaultFormatUtc:d.defaultFormat);var t=U(this,e);return this.localeData().postformat(t)},yi.from=function(e,t){return this.isValid()&&(_(e)&&e.isValid()||Nt(e).isValid())?Xt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},yi.fromNow=function(e){return this.from(Nt(),e)},yi.to=function(e,t){return this.isValid()&&(_(e)&&e.isValid()||Nt(e).isValid())?Xt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},yi.toNow=function(e){return this.to(Nt(),e)},yi.get=function(e){if(E(this[e=N(e)]))return this[e]();return this},yi.invalidAt=function(){return p(this).overflow},yi.isAfter=function(e,t){var i=_(e)?e:Nt(e);if(!this.isValid()||!i.isValid())return!1;return"millisecond"===(t=N(t)||"millisecond")?this.valueOf()>i.valueOf():i.valueOf()<this.clone().startOf(t).valueOf()},yi.isBefore=function(e,t){var i=_(e)?e:Nt(e);if(!this.isValid()||!i.isValid())return!1;return"millisecond"===(t=N(t)||"millisecond")?this.valueOf()<i.valueOf():this.clone().endOf(t).valueOf()<i.valueOf()},yi.isBetween=function(e,t,i,n){var o=_(e)?e:Nt(e),s=_(t)?t:Nt(t);return!!(this.isValid()&&o.isValid()&&s.isValid())&&(("("===(n=n||"()")[0]?this.isAfter(o,i):!this.isBefore(o,i))&&(")"===n[1]?this.isBefore(s,i):!this.isAfter(s,i)))},yi.isSame=function(e,t){var i,n=_(e)?e:Nt(e);if(!this.isValid()||!n.isValid())return!1;return"millisecond"===(t=N(t)||"millisecond")?this.valueOf()===n.valueOf():(i=n.valueOf(),this.clone().startOf(t).valueOf()<=i&&i<=this.clone().endOf(t).valueOf())},yi.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},yi.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},yi.isValid=function(){return v(this)},yi.lang=oi,yi.locale=ni,yi.localeData=si,yi.max=Yt,yi.min=It,yi.parsingFlags=function(){return c({},p(this))},yi.set=function(e,t){if("object"==typeof e)for(var i=z(e=I(e)),n=0;n<i.length;n++)this[i[n].unit](e[i[n].unit]);else if(E(this[e=N(e)]))return this[e](t);return this},yi.startOf=function(e){var t;if(void 0===(e=N(e))||"millisecond"===e||!this.isValid())return this;var i=this._isUTC?di:hi;switch(e){case"year":t=i(this.year(),0,1);break;case"quarter":t=i(this.year(),this.month()-this.month()%3,1);break;case"month":t=i(this.year(),this.month(),1);break;case"week":t=i(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=i(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=i(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=ai(t+(this._isUTC?0:6e4*this.utcOffset()),36e5);break;case"minute":t=this._d.valueOf(),t-=ai(t,6e4);break;case"second":t=this._d.valueOf(),t-=ai(t,1e3)}return this._d.setTime(t),d.updateOffset(this,!0),this},yi.subtract=ti,yi.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},yi.toObject=function(){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()}},yi.toDate=function(){return new Date(this.valueOf())},yi.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,i=t?this.clone().utc():this;if(i.year()<0||9999<i.year())return U(i,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ");if(E(Date.prototype.toISOString))return t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",U(i,"Z"));return U(i,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},yi.inspect=function(){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)},yi.toJSON=function(){return this.isValid()?this.toISOString():null},yi.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},yi.unix=function(){return Math.floor(this.valueOf()/1e3)},yi.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},yi.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},yi.year=Te,yi.isLeapYear=function(){return Oe(this.year())},yi.weekYear=function(e){return ui.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},yi.isoWeekYear=function(e){return ui.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},yi.quarter=yi.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},yi.month=Ae,yi.daysInMonth=function(){return Ne(this.year(),this.month())},yi.week=yi.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},yi.isoWeek=yi.isoWeeks=function(e){var t=Ge(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},yi.weeksInYear=function(){var e=this.localeData()._week;return qe(this.year(),e.dow,e.doy)},yi.isoWeeksInYear=function(){return qe(this.year(),1,4)},yi.date=ci,yi.day=yi.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(i=e,n=this.localeData(),e="string"==typeof i?isNaN(i)?"number"!=typeof(i=n.weekdaysParse(i))?null:i:parseInt(i,10):i,this.add(e-t,"d")):t;var i,n},yi.weekday=function(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")},yi.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;{if(null==e)return this.day()||7;var t=(i=e,n=this.localeData(),"string"!=typeof i?isNaN(i)?null:i:n.weekdaysParse(i)%7||7);return this.day(this.day()%7?t:t-7)}var i,n},yi.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},yi.hour=yi.hours=at,yi.minute=yi.minutes=fi,yi.second=yi.seconds=vi,yi.millisecond=yi.milliseconds=mi,yi.utcOffset=function(e,t,i){var n,o=this._offset||0;if(!this.isValid())return null!=e?this:NaN;{if(null==e)return this._isUTC?o:Ut(this);if("string"==typeof e){if(null===(e=Wt(ae,e)))return this}else Math.abs(e)<16&&!i&&(e*=60);return!this._isUTC&&t&&(n=Ut(this)),this._offset=e,this._isUTC=!0,null!=n&&this.add(n,"m"),o!==e&&(!t||this._changeInProgress?Jt(this,Xt(e-o,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,d.updateOffset(this,!0),this._changeInProgress=null)),this}},yi.utc=function(e){return this.utcOffset(0,e)},yi.local=function(e){this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Ut(this),"m"));return this},yi.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=Wt(re,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},yi.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Nt(e).utcOffset():0,(this.utcOffset()-e)%60==0)},yi.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},yi.isLocal=function(){return!!this.isValid()&&!this._isUTC},yi.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},yi.isUtc=Gt,yi.isUTC=Gt,yi.zoneAbbr=function(){return this._isUTC?"UTC":""},yi.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},yi.dates=e("dates accessor is deprecated. Use date instead.",ci),yi.months=e("months accessor is deprecated. Use month instead",Ae),yi.years=e("years accessor is deprecated. Use year instead",Te),yi.zone=e("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),yi.isDSTShifted=e("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!s(this._isDSTShifted))return this._isDSTShifted;var e={};if(y(e,this),(e=Pt(e))._a){var t=e._isUTC?f(e._a):Nt(e._a);this._isDSTShifted=this.isValid()&&0<x(e._a,t.toArray())}else this._isDSTShifted=!1;return this._isDSTShifted});var _i=C.prototype;function wi(e,t,i,n){var o=vt(),s=f().set(n,t);return o[i](s,e)}function ki(e,t,i){if(h(e)&&(t=e,e=void 0),e=e||"",null!=t)return wi(e,t,i,"month");var n,o=[];for(n=0;n<12;n++)o[n]=wi(e,n,i,"month");return o}function xi(e,t,i,n){t=("boolean"==typeof e?h(t)&&(i=t,t=void 0):(t=e,e=!1,h(i=t)&&(i=t,t=void 0)),t||"");var o,s=vt(),r=e?s._week.dow:0;if(null!=i)return wi(t,(i+r)%7,n,"day");var a=[];for(o=0;o<7;o++)a[o]=wi(t,(o+r)%7,n,"day");return a}_i.calendar=function(e,t,i){var n=this._calendar[e]||this._calendar.sameElse;return E(n)?n.call(t,i):n},_i.longDateFormat=function(e){var t=this._longDateFormat[e],i=this._longDateFormat[e.toUpperCase()];return!t&&i?(this._longDateFormat[e]=i.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e]):t},_i.invalidDate=function(){return this._invalidDate},_i.ordinal=function(e){return this._ordinal.replace("%d",e)},_i.preparse=bi,_i.postformat=bi,_i.relativeTime=function(e,t,i,n){var o=this._relativeTime[i];return E(o)?o(e,t,i,n):o.replace(/%d/i,e)},_i.pastFuture=function(e,t){var i=this._relativeTime[0<e?"future":"past"];return E(i)?i(t):i.replace(/%s/i,t)},_i.set=function(e){var t,i;for(i in e)E(t=e[i])?this[i]=t:this["_"+i]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},_i.months=function(e,t){return e?r(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Ie).test(t)?"format":"standalone"][e.month()]:r(this._months)?this._months:this._months.standalone},_i.monthsShort=function(e,t){return e?r(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Ie.test(t)?"format":"standalone"][e.month()]:r(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},_i.monthsParse=function(e,t,i){var n,o,s;if(this._monthsParseExact)return ze.call(this,e,t,i);this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]);for(n=0;n<12;n++){if(o=f([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}},_i.monthsRegex=function(e){return this._monthsParseExact?(u(this,"_monthsRegex")||je.call(this),e?this._monthsStrictRegex:this._monthsRegex):(u(this,"_monthsRegex")||(this._monthsRegex=He),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},_i.monthsShortRegex=function(e){return this._monthsParseExact?(u(this,"_monthsRegex")||je.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(u(this,"_monthsShortRegex")||(this._monthsShortRegex=Le),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},_i.week=function(e){return Ge(e,this._week.dow,this._week.doy).week},_i.firstDayOfYear=function(){return this._week.doy},_i.firstDayOfWeek=function(){return this._week.dow},_i.weekdays=function(e,t){var i=r(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Ze(i,this._week.dow):e?i[e.day()]:i},_i.weekdaysMin=function(e){return!0===e?Ze(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},_i.weekdaysShort=function(e){return!0===e?Ze(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},_i.weekdaysParse=function(e,t,i){var n,o,s;if(this._weekdaysParseExact)return Qe.call(this,e,t,i);this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]);for(n=0;n<7;n++){if(o=f([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}},_i.weekdaysRegex=function(e){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||it.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(u(this,"_weekdaysRegex")||(this._weekdaysRegex=Je),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},_i.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||it.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(u(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=et),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},_i.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||it.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(u(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=tt),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},_i.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},_i.meridiem=function(e,t,i){return 11<e?i?"pm":"PM":i?"am":"AM"},ft("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,i=1===k(e%100/10)?"th":1==t?"st":2==t?"nd":3==t?"rd":"th";return e+i}}),d.lang=e("moment.lang is deprecated. Use moment.locale instead.",ft),d.langData=e("moment.langData is deprecated. Use moment.localeData instead.",vt);var Si=Math.abs;function Di(e,t,i,n){var o=Xt(t,i);return e._milliseconds+=n*o._milliseconds,e._days+=n*o._days,e._months+=n*o._months,e._bubble()}function Mi(e){return e<0?Math.floor(e):Math.ceil(e)}function Oi(e){return 4800*e/146097}function Ei(e){return 146097*e/4800}function Ti(e){return function(){return this.as(e)}}var Ci=Ti("ms"),Pi=Ti("s"),Fi=Ti("m"),Ni=Ti("h"),Ii=Ti("d"),Yi=Ti("w"),Ri=Ti("M"),zi=Ti("Q"),Bi=Ti("y");function Ai(e){return function(){return this.isValid()?this._data[e]:NaN}}var Li=Ai("milliseconds"),Hi=Ai("seconds"),ji=Ai("minutes"),Wi=Ai("hours"),Vi=Ai("days"),Ui=Ai("months"),Gi=Ai("years");var qi=Math.round,Zi={ss:44,s:45,m:45,h:22,d:26,M:11};var Xi=Math.abs;function $i(e){return(0<e)-(e<0)||+e}function Ki(){if(!this.isValid())return this.localeData().invalidDate();var e,t,i=Xi(this._milliseconds)/1e3,n=Xi(this._days),o=Xi(this._months);e=w(i/60),t=w(e/60),i%=60,e%=60;var s=w(o/12),r=o%=12,a=n,h=t,d=e,l=i?i.toFixed(3).replace(/\.?0+$/,""):"",u=this.asSeconds();if(!u)return"P0D";var c=u<0?"-":"",f=$i(this._months)!==$i(u)?"-":"",p=$i(this._days)!==$i(u)?"-":"",v=$i(this._milliseconds)!==$i(u)?"-":"";return c+"P"+(s?f+s+"Y":"")+(r?f+r+"M":"")+(a?p+a+"D":"")+(h||d||l?"T":"")+(h?v+h+"H":"")+(d?v+d+"M":"")+(l?v+l+"S":"")}var Qi=Bt.prototype;return Qi.isValid=function(){return this._isValid},Qi.abs=function(){var e=this._data;return this._milliseconds=Si(this._milliseconds),this._days=Si(this._days),this._months=Si(this._months),e.milliseconds=Si(e.milliseconds),e.seconds=Si(e.seconds),e.minutes=Si(e.minutes),e.hours=Si(e.hours),e.months=Si(e.months),e.years=Si(e.years),this},Qi.add=function(e,t){return Di(this,e,t,1)},Qi.subtract=function(e,t){return Di(this,e,t,-1)},Qi.as=function(e){if(!this.isValid())return NaN;var t,i,n=this._milliseconds;if("month"===(e=N(e))||"quarter"===e||"year"===e)switch(t=this._days+n/864e5,i=this._months+Oi(t),e){case"month":return i;case"quarter":return i/3;case"year":return i/12}else switch(t=this._days+Math.round(Ei(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)}},Qi.asMilliseconds=Ci,Qi.asSeconds=Pi,Qi.asMinutes=Fi,Qi.asHours=Ni,Qi.asDays=Ii,Qi.asWeeks=Yi,Qi.asMonths=Ri,Qi.asQuarters=zi,Qi.asYears=Bi,Qi.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*k(this._months/12):NaN},Qi._bubble=function(){var e,t,i,n,o,s=this._milliseconds,r=this._days,a=this._months,h=this._data;return 0<=s&&0<=r&&0<=a||s<=0&&r<=0&&a<=0||(s+=864e5*Mi(Ei(a)+r),a=r=0),h.milliseconds=s%1e3,e=w(s/1e3),h.seconds=e%60,t=w(e/60),h.minutes=t%60,i=w(t/60),h.hours=i%24,r+=w(i/24),o=w(Oi(r)),a+=o,r-=Mi(Ei(o)),n=w(a/12),a%=12,h.days=r,h.months=a,h.years=n,this},Qi.clone=function(){return Xt(this)},Qi.get=function(e){return e=N(e),this.isValid()?this[e+"s"]():NaN},Qi.milliseconds=Li,Qi.seconds=Hi,Qi.minutes=ji,Qi.hours=Wi,Qi.days=Vi,Qi.weeks=function(){return w(this.days()/7)},Qi.months=Ui,Qi.years=Gi,Qi.humanize=function(e){if(!this.isValid())return this.localeData().invalidDate();var t=this.localeData(),i=function(e,t,i){var n=Xt(e).abs(),o=qi(n.as("s")),s=qi(n.as("m")),r=qi(n.as("h")),a=qi(n.as("d")),h=qi(n.as("M")),d=qi(n.as("y")),l=o<=Zi.ss&&["s",o]||o<Zi.s&&["ss",o]||s<=1&&["m"]||s<Zi.m&&["mm",s]||r<=1&&["h"]||r<Zi.h&&["hh",r]||a<=1&&["d"]||a<Zi.d&&["dd",a]||h<=1&&["M"]||h<Zi.M&&["MM",h]||d<=1&&["y"]||["yy",d];return l[2]=t,l[3]=0<+e,l[4]=i,function(e,t,i,n,o){return o.relativeTime(t||1,!!i,e,n)}.apply(null,l)}(this,!e,t);return e&&(i=t.pastFuture(+this,i)),t.postformat(i)},Qi.toISOString=Ki,Qi.toString=Ki,Qi.toJSON=Ki,Qi.locale=ni,Qi.localeData=si,Qi.toIsoString=e("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ki),Qi.lang=oi,W("X",0,0,"unix"),W("x",0,0,"valueOf"),le("x",se),le("X",/[+-]?\d+(\.\d{1,3})?/),pe("X",function(e,t,i){i._d=new Date(1e3*parseFloat(e,10))}),pe("x",function(e,t,i){i._d=new Date(k(e))}),d.version="2.24.0",function(e){t=e}(Nt),d.fn=yi,d.min=function(){return Rt("isBefore",[].slice.call(arguments,0))},d.max=function(){return Rt("isAfter",[].slice.call(arguments,0))},d.now=function(){return Date.now?Date.now():+new Date},d.utc=f,d.unix=function(e){return Nt(1e3*e)},d.months=function(e,t){return ki(e,t,"months")},d.isDate=l,d.locale=ft,d.invalid=g,d.duration=Xt,d.isMoment=_,d.weekdays=function(e,t,i){return xi(e,t,i,"weekdays")},d.parseZone=function(){return Nt.apply(null,arguments).parseZone()},d.localeData=vt,d.isDuration=At,d.monthsShort=function(e,t){return ki(e,t,"monthsShort")},d.weekdaysMin=function(e,t,i){return xi(e,t,i,"weekdaysMin")},d.defineLocale=pt,d.updateLocale=function(e,t){if(null!=t){var i,n,o=ht;null!=(n=ct(e))&&(o=n._config),t=T(o,t),(i=new C(t)).parentLocale=dt[e],dt[e]=i,ft(e)}else null!=dt[e]&&(null!=dt[e].parentLocale?dt[e]=dt[e].parentLocale:null!=dt[e]&&delete dt[e]);return dt[e]},d.locales=function(){return D(dt)},d.weekdaysShort=function(e,t,i){return xi(e,t,i,"weekdaysShort")},d.normalizeUnits=N,d.relativeTimeRounding=function(e){return void 0!==e?"function"==typeof e&&(qi=e,!0):qi},d.relativeTimeThreshold=function(e,t){return void 0!==Zi[e]&&(void 0===t?Zi[e]:(Zi[e]=t,"s"===e&&(Zi.ss=t-1),!0))},d.calendarFormat=function(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"},d.prototype=yi,d.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},d}()}(oe={exports:{}},oe.exports),oe.exports),re=[],ae=0;ae<256;ae++)re[ae]=(ae+256).toString(16).substr(1);for(var he=function(){if("undefined"!=typeof crypto&&crypto.getRandomValues){var e=new Uint8Array(16);return function(){return crypto.getRandomValues(e),e}}var i=new Array(16);return function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),i[t]=e>>>((3&t)<<3)&255;return i}}(),de=[],le=0;le<256;le++)de[le]=(le+256).toString(16).substr(1);var ue=he(),ce=(ue[0],ue[1],ue[2],ue[3],ue[4],ue[5],ue[6],ue[7],/^\/?Date\((-?\d+)/i);function fe(e){return e instanceof Number||"number"==typeof e}function pe(e){return e instanceof String||"string"==typeof e}function ve(e){return se.isMoment(e)}function ge(e,t){var i;if(void 0!==e){if(null===e)return null;if(!t)return e;if("string"!=typeof t&&!(t instanceof String))throw new Error("Type must be a string");switch(t){case"boolean":case"Boolean":return Boolean(e);case"number":case"Number":return pe(e)&&!isNaN(Date.parse(e))?se(e).valueOf():Number(e.valueOf());case"string":case"String":return String(e);case"Date":if(fe(e))return new Date(e);if(e instanceof Date)return new Date(e.valueOf());if(ve(e))return new Date(e.valueOf());if(pe(e))return(i=ce.exec(e))?new Date(Number(i[1])):se(new Date(e)).toDate();throw new Error("Cannot convert object of type "+me(e)+" to type Date");case"Moment":if(fe(e))return se(e);if(e instanceof Date)return se(e.valueOf());if(ve(e))return se(e);if(pe(e))return i=ce.exec(e),se(i?Number(i[1]):e);throw new Error("Cannot convert object of type "+me(e)+" to type Date");case"ISODate":if(fe(e))return new Date(e);if(e instanceof Date)return e.toISOString();if(ve(e))return e.toDate().toISOString();if(pe(e))return(i=ce.exec(e))?new Date(Number(i[1])).toISOString():se(e).format();throw new Error("Cannot convert object of type "+me(e)+" to type ISODate");case"ASPDate":if(fe(e))return"/Date("+e+")/";if(e instanceof Date)return"/Date("+e.valueOf()+")/";if(pe(e))return"/Date("+((i=ce.exec(e))?new Date(Number(i[1])).valueOf():new Date(e).valueOf())+")/";throw new Error("Cannot convert object of type "+me(e)+" to type ASPDate");default:throw new Error("Unknown type ".concat(t))}}}function me(e){var t=ne(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}function ye(e){return"string"==typeof e||"number"==typeof e}var be=function(){function r(e){j(this,r),this._queue=[],this._timeout=null,this._extended=null,this.delay=null,this.max=1/0,this.setOptions(e)}return V(r,[{key:"setOptions",value:function(e){e&&void 0!==e.delay&&(this.delay=e.delay),e&&void 0!==e.max&&(this.max=e.max),this._flushIfNeeded()}},{key:"destroy",value: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}}},{key:"replace",value:function(e,t){var n=this,o=e[t];if(!o)throw new Error("Method "+t+" undefined");e[t]=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];n.queue({args:t,fn:o,context:this})}}},{key:"queue",value:function(e){"function"==typeof e?this._queue.push({fn:e}):this._queue.push(e),this._flushIfNeeded()}},{key:"_flushIfNeeded",value:function(){var e=this;this._queue.length>this.max&&this.flush(),null!=this._timeout&&(clearTimeout(this._timeout),this._timeout=null),0<this.queue.length&&"number"==typeof this.delay&&(this._timeout=setTimeout(function(){e.flush()},this.delay))}},{key:"flush",value:function(){this._queue.splice(0).forEach(function(e){e.fn.apply(e.context||e.fn,e.args||[])})}}],[{key:"extend",value:function(e,t){var i=new r(t);if(void 0!==e.flush)throw new Error("Target object already has a property flush");e.flush=function(){i.flush()};var n=[{name:"flush",original:void 0}];if(t&&t.replace)for(var o=0;o<t.replace.length;o++){var s=t.replace[o];n.push({name:s,original:e[s]}),i.replace(e,s)}return i._extended={object:e,methods:n},i}}]),r}();var _e=function(e){if(Array.isArray(e)){for(var t=0,i=new Array(e.length);t<e.length;t++)i[t]=e[t];return i}};var we=function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)};var ke=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")};var xe=function(e){return _e(e)||we(e)||ke()},Se=function(){function e(){j(this,e),this._subscribers={"*":[],add:[],remove:[],update:[]},this.subscribe=e.prototype.on,this.unsubscribe=e.prototype.off}return V(e,[{key:"_trigger",value:function(e,t,i){if("*"===e)throw new Error("Cannot trigger event *");for(var n=[].concat(xe(this._subscribers[e]),xe(this._subscribers["*"])),o=0,s=n.length;o<s;o++){var r=n[o];r.callback&&r.callback(e,t,null!=i?i:null)}}},{key:"on",value:function(e,t){this._subscribers[e].push({callback:t})}},{key:"off",value:function(e,t){this._subscribers[e]=this._subscribers[e].filter(function(e){return e.callback!==t})}}]),e}();function De(t,e){var i=Object.keys(t);return Object.getOwnPropertySymbols&&i.push.apply(i,Object.getOwnPropertySymbols(t)),e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i}var Me=function(){function h(e,t){var i;if(j(this,h),i=G(this,q(h).call(this)),e&&!Array.isArray(e)&&(t=e,e=[]),i._options=t||{},i._data=Object.create({}),i.length=0,i._idProp=i._options.fieldId||"id",i._type={},i._options.type)for(var n=Object.keys(i._options.type),o=0,s=n.length;o<s;o++){var r=n[o],a=i._options.type[r];i._type[r]="Date"==a||"ISODate"==a||"ASPDate"==a?"Date":a}return e&&e.length&&i.add(e),i.setOptions(t),i}return X(h,Se),V(h,[{key:"setOptions",value:function(e){e&&void 0!==e.queue&&(!1===e.queue?this._queue&&(this._queue.destroy(),delete this._queue):(this._queue||(this._queue=be.extend(this,{replace:["add","update","remove"]})),e.queue&&"object"===H(e.queue)&&this._queue.setOptions(e.queue)))}},{key:"add",value:function(e,t){var i,n=[];if(Array.isArray(e))for(var o=0,s=e.length;o<s;o++)i=this._addItem(e[o]),n.push(i);else{if(!e||"object"!==H(e))throw new Error("Unknown dataType");i=this._addItem(e),n.push(i)}return n.length&&this._trigger("add",{items:n},t),n}},{key:"update",value:function(e,t){function i(e){var t=e[u];if(null!=t&&r._data[t]){var i=e,n=Object.assign({},r._data[t]),o=r._updateItem(i);h.push(o),l.push(i),d.push(n)}else{var s=r._addItem(e);a.push(s)}}var r=this,a=[],h=[],d=[],l=[],u=this._idProp;if(Array.isArray(e))for(var n=0,o=e.length;n<o;n++)e[n]&&"object"===H(e[n])?i(e[n]):console.warn("Ignoring input item, which is not an object at index "+n);else{if(!e||"object"!==H(e))throw new Error("Unknown dataType");i(e)}if(a.length&&this._trigger("add",{items:a},t),h.length){var s={items:h,oldData:d,data:l};this._trigger("update",s,t)}return a.concat(h)}},{key:"get",value:function(e,t){var i=void 0,n=void 0,o=void 0,s=(o=ye(e)?(i=e,t):Array.isArray(e)?(n=e,t):e)&&"Object"===o.returnType?"Object":"Array",r=o&&o.type||this._options.type,a=o&&o.filter,h=[],d=null,l=null,u=null;if(null!=i)(d=this._getItem(i,r))&&a&&!a(d)&&(d=null);else if(null!=n)for(var c=0,f=n.length;c<f;c++)null==(d=this._getItem(n[c],r))||a&&!a(d)||h.push(d);else for(var p=0,v=(l=Object.keys(this._data)).length;p<v;p++)u=l[p],null==(d=this._getItem(u,r))||a&&!a(d)||h.push(d);if(o&&o.order&&null==i&&this._sort(h,o.order),o&&o.fields){var g=o.fields;if(null!=i&&null!=d)d=this._filterFields(d,g);else for(var m=0,y=h.length;m<y;m++)h[m]=this._filterFields(h[m],g)}if("Object"!=s)return null!=i?d:h;for(var b={},_=0,w=h.length;_<w;_++){var k=h[_];b[k[this._idProp]]=k}return b}},{key:"getIds",value:function(e){var t,i,n=this._data,o=e&&e.filter,s=e&&e.order,r=e&&e.type||this._options.type,a=Object.keys(n),h=[];if(o)if(s){i=[];for(var d=0,l=a.length;d<l;d++){var u=a[d];o(t=this._getItem(u,r))&&i.push(t)}this._sort(i,s);for(var c=0,f=i.length;c<f;c++)h.push(i[c][this._idProp])}else for(var p=0,v=a.length;p<v;p++){var g=a[p];o(t=this._getItem(g,r))&&h.push(t[this._idProp])}else if(s){i=[];for(var m=0,y=a.length;m<y;m++){var b=a[m];i.push(n[b])}this._sort(i,s);for(var _=0,w=i.length;_<w;_++)h.push(i[_][this._idProp])}else for(var k=0,x=a.length;k<x;k++){t=n[a[k]],h.push(t[this._idProp])}return h}},{key:"getDataSet",value:function(){return this}},{key:"forEach",value:function(e,t){var i=t&&t.filter,n=t&&t.type||this._options.type,o=this._data,s=Object.keys(o);if(t&&t.order)for(var r=this.get(t),a=0,h=r.length;a<h;a++){var d=r[a];e(d,d[this._idProp])}else for(var l=0,u=s.length;l<u;l++){var c=s[l],f=this._getItem(c,n);i&&!i(f)||e(f,c)}}},{key:"map",value:function(e,t){for(var i=t&&t.filter,n=t&&t.type||this._options.type,o=[],s=this._data,r=Object.keys(s),a=0,h=r.length;a<h;a++){var d=r[a],l=this._getItem(d,n);i&&!i(l)||o.push(e(l,d))}return t&&t.order&&this._sort(o,t.order),o}},{key:"_filterFields",value:function(i,e){return i?(Array.isArray(e)?e:Object.keys(e)).reduce(function(e,t){return e[t]=i[t],e},{}):i}},{key:"_sort",value:function(e,t){if("string"==typeof t){var o=t;e.sort(function(e,t){var i=e[o],n=t[o];return n<i?1:i<n?-1:0})}else{if("function"!=typeof t)throw new TypeError("Order must be a function or a string");e.sort(t)}}},{key:"remove",value:function(e,t){for(var i=[],n=[],o=Array.isArray(e)?e:[e],s=0,r=o.length;s<r;s++){var a=this._remove(o[s]);if(a){var h=a[this._idProp];null!=h&&(i.push(h),n.push(a))}}return i.length&&this._trigger("remove",{items:i,oldData:n},t),i}},{key:"_remove",value:function(e){var t;if(ye(e)?t=e:e&&"object"===H(e)&&(t=e[this._idProp]),null!=t&&this._data[t]){var i=this._data[t];return delete this._data[t],--this.length,i}return null}},{key:"clear",value:function(e){for(var t=Object.keys(this._data),i=[],n=0,o=t.length;n<o;n++)i.push(this._data[t[n]]);return this._data={},this.length=0,this._trigger("remove",{items:t,oldData:i},e),t}},{key:"max",value:function(e){for(var t=this._data,i=Object.keys(t),n=null,o=null,s=0,r=i.length;s<r;s++){var a=t[i[s]],h=a[e];null!=h&&(null==o||o<h)&&(n=a,o=h)}return n}},{key:"min",value:function(e){for(var t=this._data,i=Object.keys(t),n=null,o=null,s=0,r=i.length;s<r;s++){var a=t[i[s]],h=a[e];null!=h&&(null==o||h<o)&&(n=a,o=h)}return n}},{key:"distinct",value:function(e){for(var t=this._data,i=Object.keys(t),n=[],o=this._options.type&&this._options.type[e]||null,s=0,r=0,a=i.length;r<a;r++){for(var h=t[i[r]][e],d=!1,l=0;l<s;l++)if(n[l]==h){d=!0;break}d||void 0===h||(n[s]=h,s++)}if(o)for(var u=0,c=n.length;u<c;u++)n[u]=ge(n[u],o);return n}},{key:"_addItem",value:function(e){var t=e[this._idProp];if(null!=t){if(this._data[t])throw new Error("Cannot add item: item with id "+t+" already exists")}else t=ie(),e[this._idProp]=t;for(var i={},n=Object.keys(e),o=0,s=n.length;o<s;o++){var r=n[o],a=this._type[r];i[r]=ge(e[r],a)}return this._data[t]=i,this.length++,t}},{key:"_getItem",value:function(e,t){var i,n=this._data[e];if(!n)return null;var o=Object.keys(n);if(t){i={};for(var s=0,r=o.length;s<r;s++){var a=o[s],h=n[a];i[a]=ge(h,t[a])}}else i=function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?De(i,!0).forEach(function(e){A(t,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):De(i).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}({},n);return null==i[this._idProp]&&(i[this._idProp]=n.id),i}},{key:"_updateItem",value:function(e){var t=e[this._idProp];if(null==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 n=Object.keys(e),o=0,s=n.length;o<s;o++){var r=n[o],a=this._type[r];i[r]=ge(e[r],a)}return t}}]),h}(),Oe=function(){function n(e,t){var i;return j(this,n),(i=G(this,q(n).call(this))).length=0,i._ids={},i._options=t||{},i.listener=i._onEvent.bind(U(i)),i.setData(e),i}return X(n,Se),V(n,[{key:"setData",value:function(e){if(this._data){this._data.off&&this._data.off("*",this.listener);var t=this._data.getIds({filter:this._options.filter}),i=this._data.get(t);this._ids={},this.length=0,this._trigger("remove",{items:t,oldData:i})}if(null!=e){this._data=e;for(var n=this._data.getIds({filter:this._options.filter}),o=0,s=n.length;o<s;o++){var r=n[o];this._ids[r]=!0}this.length=n.length,this._trigger("add",{items:n})}else this._data=new Me;this._data.on&&this._data.on("*",this.listener)}},{key:"refresh",value:function(){for(var e=this._data.getIds({filter:this._options.filter}),t=Object.keys(this._ids),i={},n=[],o=[],s=[],r=0,a=e.length;r<a;r++){var h=e[r];i[h]=!0,this._ids[h]||(n.push(h),this._ids[h]=!0)}for(var d=0,l=t.length;d<l;d++){var u=t[d],c=this._data.get(u);null==c?console.error("If you see this, report it please."):i[u]||(o.push(u),s.push(c),delete this._ids[u])}this.length+=n.length-o.length,n.length&&this._trigger("add",{items:n}),o.length&&this._trigger("remove",{items:o,oldData:s})}},{key:"get",value:function(e,t){if(null==this._data)return null;var i,n=null;i=ye(e)||Array.isArray(e)?(n=e,t):e;var o=Object.assign({},this._options,i),s=this._options.filter,r=i&&i.filter;return s&&r&&(o.filter=function(e){return s(e)&&r(e)}),null==n?this._data.get(o):this._data.get(n,o)}},{key:"getIds",value:function(e){if(this._data.length){var t,i=this._options.filter,n=null!=e?e.filter:null;return t=n?i?function(e){return i(e)&&n(e)}:n:i,this._data.getIds({filter:t,order:e&&e.order})}return[]}},{key:"forEach",value:function(e,t){if(this._data){var i,n=this._options.filter,o=t&&t.filter;i=o?n?function(e){return n(e)&&o(e)}:o:n,this._data.forEach(e,{filter:i,order:t&&t.order})}}},{key:"map",value:function(e,t){if(this._data){var i,n=this._options.filter,o=t&&t.filter;return i=o?n?function(e){return n(e)&&o(e)}:o:n,this._data.map(e,{filter:i,order:t&&t.order})}return[]}},{key:"getDataSet",value:function(){return this._data.getDataSet()}},{key:"_onEvent",value:function(e,t,i){if(t&&t.items&&this._data){var n=t.items,o=[],s=[],r=[],a=[],h=[],d=[];switch(e){case"add":for(var l=0,u=n.length;l<u;l++){var c=n[l];this.get(c)&&(this._ids[c]=!0,o.push(c))}break;case"update":for(var f=0,p=n.length;f<p;f++){var v=n[f];this.get(v)?this._ids[v]?(s.push(v),h.push(t.data[f]),a.push(t.oldData[f])):(this._ids[v]=!0,o.push(v)):this._ids[v]&&(delete this._ids[v],r.push(v),d.push(t.oldData[f]))}break;case"remove":for(var g=0,m=n.length;g<m;g++){var y=n[g];this._ids[y]&&(delete this._ids[y],r.push(y),d.push(t.oldData[g]))}}this.length+=o.length-r.length,o.length&&this._trigger("add",{items:o},i),s.length&&this._trigger("update",{items:s,oldData:a,data:h},i),r.length&&this._trigger("remove",{items:r,oldData:d},i)}}}]),n}(),Ee={DataSet:Me,DataView:Oe,Queue:be};"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(),t+=.275*(i*=1.15);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(),t-=.275*(i*=1.15);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(),t+=.1*(i*=.82);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,h=e+i/2,d=t+n/2;this.beginPath(),this.moveTo(e,d),this.bezierCurveTo(e,d-s,h-o,t,h,t),this.bezierCurveTo(h+o,t,r,d-s,r,d),this.bezierCurveTo(r,d+s,h+o,a,h,a),this.bezierCurveTo(h-o,a,e,d+s,e,d),this.closePath()},CanvasRenderingContext2D.prototype.database=function(e,t,i,n){var o=n*(1/3),s=i/2*.5522848,r=o/2*.5522848,a=e+i,h=t+o,d=e+i/2,l=t+o/2,u=t+(n-o/2),c=t+n;this.beginPath(),this.moveTo(a,l),this.bezierCurveTo(a,l+r,d+s,h,d,h),this.bezierCurveTo(d-s,h,e,l+r,e,l),this.bezierCurveTo(e,l-r,d-s,t,d,t),this.bezierCurveTo(d+s,t,a,l-r,a,l),this.lineTo(a,u),this.bezierCurveTo(a,u+r,d+s,c,d,c),this.bezierCurveTo(d-s,c,e,u+r,e,u),this.lineTo(e,l)},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,h=a/r,d=Math.sqrt(r*r+a*a),l=0,u=!0,c=0,f=o[0];.1<=d;)d<(f=o[l++%s])&&(f=d),c=Math.sqrt(f*f/(1+h*h)),e+=c=r<0?-c:c,t+=h*c,!0===u?this.lineTo(e,t):this.moveTo(e,t),d-=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()});var Te=Ce;function Ce(e){if(e)return function(e){for(var t in Ce.prototype)e[t]=Ce.prototype[t];return e}(e)}function Pe(e){return Re=e,function(){var e={};ze=0,Be=Re.charAt(0),$e(),"strict"===Ae&&(e.strict=!0,$e());"graph"!==Ae&&"digraph"!==Ae||(e.type=Ae,$e());Le===Ie.IDENTIFIER&&(e.id=Ae,$e());if("{"!=Ae)throw it("Angle bracket { expected");if($e(),Ke(e),"}"!=Ae)throw it("Angle bracket } expected");if($e(),""===Ae)return $e(),delete e.node,delete e.edge,delete e.graph,e;throw it("End of file expected")}()}Ce.prototype.on=Ce.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[e]=this._callbacks[e]||[]).push(t),this},Ce.prototype.once=function(e,t){var i=this;function n(){i.off(e,n),t.apply(this,arguments)}return this._callbacks=this._callbacks||{},n.fn=t,this.on(e,n),this},Ce.prototype.off=Ce.prototype.removeListener=Ce.prototype.removeAllListeners=Ce.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var i,n=this._callbacks[e];if(!n)return this;if(1==arguments.length)return delete this._callbacks[e],this;for(var o=0;o<n.length;o++)if((i=n[o])===t||i.fn===t){n.splice(o,1);break}return this},Ce.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),i=this._callbacks[e];if(i)for(var n=0,o=(i=i.slice(0)).length;n<o;++n)i[n].apply(this,t);return this},Ce.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[e]||[]},Ce.prototype.hasListeners=function(e){return!!this.listeners(e).length};var Fe={fontsize:"font.size",fontcolor:"font.color",labelfontcolor:"font.color",fontname:"font.face",color:["color.border","color.background"],fillcolor:"color.background",tooltip:"title",labeltooltip:"title"},Ne=Object.create(Fe);Ne.color="color.color",Ne.style="dashes";var Ie={NULL:0,DELIMITER:1,IDENTIFIER:2,UNKNOWN:3},Ye={"{":!0,"}":!0,"[":!0,"]":!0,";":!0,"=":!0,",":!0,"->":!0,"--":!0},Re="",ze=0,Be="",Ae="",Le=Ie.NULL;function He(){ze++,Be=Re.charAt(ze)}function je(){return Re.charAt(ze+1)}var We=/[a-zA-Z_0-9.:#]/;function Ve(e){return We.test(e)}function Ue(e,t){if(e=e||{},t)for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}function Ge(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 qe(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=Ue(o.attr,e.node))),i=s.length-1;0<=i;i--){var a=s[i];a.nodes||(a.nodes=[]),-1===a.nodes.indexOf(o)&&a.nodes.push(o)}t.attr&&(o.attr=Ue(o.attr,t.attr))}function Ze(e,t){if(e.edges||(e.edges=[]),e.edges.push(t),e.edge){var i=Ue({},e.edge);t.attr=Ue(i,t.attr)}}function Xe(e,t,i,n,o){var s={from:t,to:i,type:n};return e.edge&&(s.attr=Ue({},e.edge)),s.attr=Ue(s.attr||{},o),null!=o&&o.hasOwnProperty("arrows")&&(s.arrows={to:{enabled:!0,type:o.arrows.type}},o.arrows=null),s}function $e(){for(Le=Ie.NULL,Ae="";" "===Be||"\t"===Be||"\n"===Be||"\r"===Be;)He();do{var e=!1;if("#"===Be){for(var t=ze-1;" "===Re.charAt(t)||"\t"===Re.charAt(t);)t--;if("\n"===Re.charAt(t)||""===Re.charAt(t)){for(;""!=Be&&"\n"!=Be;)He();e=!0}}if("/"===Be&&"/"===je()){for(;""!=Be&&"\n"!=Be;)He();e=!0}if("/"===Be&&"*"===je()){for(;""!=Be;){if("*"===Be&&"/"===je()){He(),He();break}He()}e=!0}for(;" "===Be||"\t"===Be||"\n"===Be||"\r"===Be;)He()}while(e);if(""!==Be){var i=Be+je();if(Ye[i])return Le=Ie.DELIMITER,Ae=i,He(),void He();if(Ye[Be])return Le=Ie.DELIMITER,Ae=Be,void He();if(Ve(Be)||"-"===Be){for(Ae+=Be,He();Ve(Be);)Ae+=Be,He();return"false"===Ae?Ae=!1:"true"===Ae?Ae=!0:isNaN(Number(Ae))||(Ae=Number(Ae)),void(Le=Ie.IDENTIFIER)}if('"'===Be){for(He();""!=Be&&('"'!=Be||'"'===Be&&'"'===je());)'"'===Be?(Ae+=Be,He()):"\\"===Be&&"n"===je()?(Ae+="\n",He()):Ae+=Be,He();if('"'!=Be)throw it('End of string " expected');return He(),void(Le=Ie.IDENTIFIER)}for(Le=Ie.UNKNOWN;""!=Be;)Ae+=Be,He();throw new SyntaxError('Syntax error in part "'+nt(Ae,30)+'"')}Le=Ie.DELIMITER}function Ke(e){for(;""!==Ae&&"}"!=Ae;)Qe(e),";"===Ae&&$e()}function Qe(e){var t=Je(e);if(t)et(e,t);else if(!function(e){{if("node"===Ae)return $e(),e.node=tt(),"node";if("edge"===Ae)return $e(),e.edge=tt(),"edge";if("graph"===Ae)return $e(),e.graph=tt(),"graph"}return null}(e)){if(Le!=Ie.IDENTIFIER)throw it("Identifier expected");var i=Ae;if($e(),"="===Ae){if($e(),Le!=Ie.IDENTIFIER)throw it("Identifier expected");e[i]=Ae,$e()}else!function(e,t){var i={id:t},n=tt();n&&(i.attr=n);qe(e,i),et(e,t)}(e,i)}}function Je(e){var t=null;if("subgraph"===Ae&&(t={type:"subgraph"},$e(),Le===Ie.IDENTIFIER&&(t.id=Ae,$e())),"{"===Ae){if($e(),(t=t||{}).parent=e,t.node=e.node,t.edge=e.edge,t.graph=e.graph,Ke(t),"}"!=Ae)throw it("Angle bracket } expected");$e(),delete t.node,delete t.edge,delete t.graph,delete t.parent,e.subgraphs||(e.subgraphs=[]),e.subgraphs.push(t)}return t}function et(e,t){for(;"->"===Ae||"--"===Ae;){var i,n=Ae;$e();var o=Je(e);if(o)i=o;else{if(Le!=Ie.IDENTIFIER)throw it("Identifier or subgraph expected");qe(e,{id:i=Ae}),$e()}Ze(e,Xe(e,t,i,n,tt())),t=i}}function tt(){for(var e=null,t={dashed:!0,solid:!1,dotted:[1,5]};"["===Ae;){for($e(),e={};""!==Ae&&"]"!=Ae;){if(Le!=Ie.IDENTIFIER)throw it("Attribute name expected");var i=Ae;if($e(),"="!=Ae)throw it("Equal sign = expected");if($e(),Le!=Ie.IDENTIFIER)throw it("Attribute value expected");var n=Ae;"style"===i&&(n=t[n]);if("arrowhead"===i)i="arrows",n={to:{enabled:!0,type:{dot:"circle",box:"box",crow:"crow",curve:"curve",icurve:"inv_curve",normal:"triangle",inv:"inv_triangle",diamond:"diamond",tee:"bar",vee:"vee"}[n]}};Ge(e,i,n),$e(),","==Ae&&$e()}if("]"!=Ae)throw it("Bracket ] expected");$e()}return e}function it(e){return new SyntaxError(e+', got "'+nt(Ae,30)+'" (char '+ze+")")}function nt(e,t){return e.length<=t?e:e.substr(0,27)+"..."}function ot(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 st(t,e){var i={};for(var n in t)if(t.hasOwnProperty(n)){var o=e[n];Array.isArray(o)?o.forEach(function(e){ot(i,e,t[n])}):ot(i,"string"==typeof o?o:n,t[n])}return i}var rt={parseDOT:Pe,DOTToGraph:function(e){var t=Pe(e),s={nodes:[],edges:[],options:{}};if(t.nodes&&t.nodes.forEach(function(e){var t={id:e.id,label:String(e.label||e.id)};Ue(t,st(e.attr,Fe)),t.image&&(t.shape="image"),s.nodes.push(t)}),t.edges){var r=function(e){var t={from:e.from,to:e.to};return Ue(t,st(e.attr,Ne)),null==t.arrows&&"->"===e.type&&(t.arrows="to"),t};t.edges.forEach(function(o){var e,t;e=o.from instanceof Object?o.from.nodes:{id:o.from},t=o.to instanceof Object?o.to.nodes:{id:o.to},o.from instanceof Object&&o.from.edges&&o.from.edges.forEach(function(e){var t=r(e);s.edges.push(t)}),function(t,e,i){Array.isArray(t)?t.forEach(function(t){Array.isArray(e)?e.forEach(function(e){i(t,e)}):i(t,e)}):Array.isArray(e)?e.forEach(function(e){i(t,e)}):i(t,e)}(e,t,function(e,t){var i=Xe(s,e.id,t.id,o.type,o.attr),n=r(i);s.edges.push(n)}),o.to instanceof Object&&o.to.edges&&o.to.edges.forEach(function(e){var t=r(e);s.edges.push(t)})})}return t.attr&&(s.options=t.attr),s}};var at={parseGephi:function(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 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&&!1===o.inheritColor&&(h.color=d.color),i.push(h)}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}}},ht=t(function(e,t){e.exports=function(e){var t,o=e&&e.preventDefault||!1,i=e&&e.container||window,n={},r={keydown:{},keyup:{}},a={};for(t=97;t<=122;t++)a[String.fromCharCode(t)]={code:t-97+65,shift:!1};for(t=65;t<=90;t++)a[String.fromCharCode(t)]={code:t,shift:!0};for(t=0;t<=9;t++)a[""+t]={code:48+t,shift:!1};for(t=1;t<=12;t++)a["F"+t]={code:111+t,shift:!1};for(t=0;t<=9;t++)a["num"+t]={code:96+t,shift:!1};function s(e){d(e,"keydown")}function h(e){d(e,"keyup")}a["num*"]={code:106,shift:!1},a["num+"]={code:107,shift:!1},a["num-"]={code:109,shift:!1},a["num/"]={code:111,shift:!1},a["num."]={code:110,shift:!1},a.left={code:37,shift:!1},a.up={code:38,shift:!1},a.right={code:39,shift:!1},a.down={code:40,shift:!1},a.space={code:32,shift:!1},a.enter={code:13,shift:!1},a.shift={code:16,shift:void 0},a.esc={code:27,shift:!1},a.backspace={code:8,shift:!1},a.tab={code:9,shift:!1},a.ctrl={code:17,shift:!1},a.alt={code:18,shift:!1},a.delete={code:46,shift:!1},a.pageup={code:33,shift:!1},a.pagedown={code:34,shift:!1},a["="]={code:187,shift:!1},a["-"]={code:189,shift:!1},a["]"]={code:221,shift:!1},a["["]={code:219,shift:!1};var d=function(e,t){if(void 0!==r[t][e.keyCode]){for(var i=r[t][e.keyCode],n=0;n<i.length;n++)void 0===i[n].shift?i[n].fn(e):1==i[n].shift&&1==e.shiftKey?i[n].fn(e):0==i[n].shift&&0==e.shiftKey&&i[n].fn(e);1==o&&e.preventDefault()}};return n.bind=function(e,t,i){if(void 0===i&&(i="keydown"),void 0===a[e])throw new Error("unsupported key: "+e);void 0===r[i][a[e].code]&&(r[i][a[e].code]=[]),r[i][a[e].code].push({fn:t,shift:a[e].shift})},n.bindAll=function(e,t){for(var i in void 0===t&&(t="keydown"),a)a.hasOwnProperty(i)&&n.bind(i,e,t)},n.getKey=function(e){for(var t in a)if(a.hasOwnProperty(t)){if(1==e.shiftKey&&1==a[t].shift&&e.keyCode==a[t].code)return t;if(0==e.shiftKey&&0==a[t].shift&&e.keyCode==a[t].code)return t;if(e.keyCode==a[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===a[e])throw new Error("unsupported key: "+e);if(void 0!==t){var n=[],o=r[i][a[e].code];if(void 0!==o)for(var s=0;s<o.length;s++)o[s].fn==t&&o[s].shift==a[e].shift||n.push(r[i][a[e].code][s]);r[i][a[e].code]=n}else r[i][a[e].code]=[]},n.reset=function(){r={keydown:{},keyup:{}}},n.destroy=function(){r={keydown:{},keyup:{}},i.removeEventListener("keydown",s,!0),i.removeEventListener("keyup",h,!0)},i.addEventListener("keydown",s,!0),i.addEventListener("keyup",h,!0),n}}),dt=t(function(e,t){var l;e.exports=(l=null,function n(o,e){var s=e||{preventDefault:!1};if(o.Manager){var r=o,t=function(e,t){var i=Object.create(s);return t&&r.assign(i,t),n(new r(e,i),i)};return r.assign(t,r),t.Manager=function(e,t){var i=Object.create(s);return t&&r.assign(i,t),n(new r.Manager(e,i),i)},t}var a=Object.create(o),i=o.element;function h(e){return e.match(/[^ ]+/g)}function d(e){if("hammer.input"!==e.type){if(e.srcEvent._handled||(e.srcEvent._handled={}),e.srcEvent._handled[e.type])return;e.srcEvent._handled[e.type]=!0}var t=!1;e.stopPropagation=function(){t=!0};var i=e.srcEvent.stopPropagation.bind(e.srcEvent);"function"==typeof i&&(e.srcEvent.stopPropagation=function(){i(),e.stopPropagation()});for(var n=e.firstTarget=l;n&&!t;){var o=n.hammer;if(o)for(var s,r=0;r<o.length;r++)if(s=o[r]._handlers[e.type])for(var a=0;a<s.length&&!t;a++)s[a](e);n=n.parentNode}}return i.hammer||(i.hammer=[]),i.hammer.push(a),o.on("hammer.input",function(e){!0!==s.preventDefault&&s.preventDefault!==e.pointerType||e.preventDefault(),e.isFirst&&(l=e.target)}),a._handlers={},a.on=function(e,i){return h(e).forEach(function(e){var t=a._handlers[e];t||(a._handlers[e]=t=[],o.on(e,d)),t.push(i)}),a},a.off=function(e,i){return h(e).forEach(function(e){var t=a._handlers[e];t&&(0<(t=i?t.filter(function(e){return e!==i}):[]).length?a._handlers[e]=t:(o.off(e,d),delete a._handlers[e]))}),a},a.emit=function(e,t){l=t.target,o.emit(e,t)},a.destroy=function(){var e=o.element.hammer,t=e.indexOf(a);-1!==t&&e.splice(t,1),e.length||delete o.element.hammer,a._handlers={},o.destroy()},a})}),lt=t(function(Ve){!function(s,o,e,u){var r,a=["","webkit","Moz","MS","ms","o"],t=o.createElement("div"),i="function",h=Math.round,c=Math.abs,f=Date.now;function d(e,t,i){return setTimeout(y(e,i),t)}function n(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!==u)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 p(n,e,t){var o="DEPRECATED METHOD: "+e+"\n"+t+" AT \n";return function(){var e=new Error("get-stack-trace"),t=e&&e.stack?e.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",i=s.console&&(s.console.warn||s.console.log);return i&&i.call(s.console,o,t),n.apply(this,arguments)}}r="function"!=typeof Object.assign?function(e){if(e===u||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!==u&&null!==n)for(var o in n)n.hasOwnProperty(o)&&(t[o]=n[o])}return t}:Object.assign;var v=p(function(e,t,i){for(var n=Object.keys(t),o=0;o<n.length;)(!i||i&&e[n[o]]===u)&&(e[n[o]]=t[n[o]]),o++;return e},"extend","Use `assign`."),g=p(function(e,t){return v(e,t,!0)},"merge","Use `assign`.");function m(e,t,i){var n,o=t.prototype;(n=e.prototype=Object.create(o)).constructor=e,n._super=o,i&&r(n,i)}function y(e,t){return function(){return e.apply(t,arguments)}}function b(e,t){return typeof e==i?e.apply(t&&t[0]||u,t):e}function _(e,t){return e===u?t:e}function w(t,e,i){l(D(e),function(e){t.addEventListener(e,i,!1)})}function k(t,e,i){l(D(e),function(e){t.removeEventListener(e,i,!1)})}function x(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function S(e,t){return-1<e.indexOf(t)}function D(e){return e.trim().split(/\s+/g)}function M(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 O(e){return Array.prototype.slice.call(e,0)}function E(e,i,t){for(var n=[],o=[],s=0;s<e.length;){var r=i?e[s][i]:e[s];M(o,r)<0&&n.push(e[s]),o[s]=r,s++}return t&&(n=i?n.sort(function(e,t){return e[i]>t[i]}):n.sort()),n}function T(e,t){for(var i,n,o=t[0].toUpperCase()+t.slice(1),s=0;s<a.length;){if((n=(i=a[s])?i+o:t)in e)return n;s++}return u}var C=1;function P(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||s}var F="ontouchstart"in s,N=T(s,"PointerEvent")!==u,I=F&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),Y="touch",R=25,z=1,B=4,A=8,L=1,H=2,j=4,W=8,V=16,U=H|j,G=W|V,q=U|G,Z=["x","y"],X=["clientX","clientY"];function $(t,e){var i=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){b(t.options.enable,[t])&&i.handler(e)},this.init()}function K(e,t,i){var n=i.pointers.length,o=i.changedPointers.length,s=t&z&&n-o==0,r=t&(B|A)&&n-o==0;i.isFirst=!!s,i.isFinal=!!r,s&&(e.session={}),i.eventType=t,function(e,t){var i=e.session,n=t.pointers,o=n.length;i.firstInput||(i.firstInput=Q(t));1<o&&!i.firstMultiple?i.firstMultiple=Q(t):1===o&&(i.firstMultiple=!1);var s=i.firstInput,r=i.firstMultiple,a=r?r.center:s.center,h=t.center=J(n);t.timeStamp=f(),t.deltaTime=t.timeStamp-s.timeStamp,t.angle=ne(a,h),t.distance=ie(a,h),function(e,t){var i=t.center,n=e.offsetDelta||{},o=e.prevDelta||{},s=e.prevInput||{};t.eventType!==z&&s.eventType!==B||(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)}(i,t),t.offsetDirection=te(t.deltaX,t.deltaY);var d=ee(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=d.x,t.overallVelocityY=d.y,t.overallVelocity=c(d.x)>c(d.y)?d.x:d.y,t.scale=r?function(e,t){return ie(t[0],t[1],X)/ie(e[0],e[1],X)}(r.pointers,n):1,t.rotation=r?function(e,t){return ne(t[1],t[0],X)+ne(e[1],e[0],X)}(r.pointers,n):0,t.maxPointers=i.prevInput?t.pointers.length>i.prevInput.maxPointers?t.pointers.length:i.prevInput.maxPointers:t.pointers.length,function(e,t){var i,n,o,s,r=e.lastInterval||t,a=t.timeStamp-r.timeStamp;if(t.eventType!=A&&(R<a||r.velocity===u)){var h=t.deltaX-r.deltaX,d=t.deltaY-r.deltaY,l=ee(a,h,d);n=l.x,o=l.y,i=c(l.x)>c(l.y)?l.x:l.y,s=te(h,d),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}(i,t);var l=e.element;x(t.srcEvent.target,l)&&(l=t.srcEvent.target);t.target=l}(e,i),e.emit("hammer.input",i),e.recognize(i),e.session.prevInput=i}function Q(e){for(var t=[],i=0;i<e.pointers.length;)t[i]={clientX:h(e.pointers[i].clientX),clientY:h(e.pointers[i].clientY)},i++;return{timeStamp:f(),pointers:t,center:J(t),deltaX:e.deltaX,deltaY:e.deltaY}}function J(e){var t=e.length;if(1===t)return{x:h(e[0].clientX),y:h(e[0].clientY)};for(var i=0,n=0,o=0;o<t;)i+=e[o].clientX,n+=e[o].clientY,o++;return{x:h(i/t),y:h(n/t)}}function ee(e,t,i){return{x:t/e||0,y:i/e||0}}function te(e,t){return e===t?L:c(e)>=c(t)?e<0?H:j:t<0?W:V}function ie(e,t,i){var n=t[(i=i||Z)[0]]-e[i[0]],o=t[i[1]]-e[i[1]];return Math.sqrt(n*n+o*o)}function ne(e,t,i){var n=t[(i=i||Z)[0]]-e[i[0]],o=t[i[1]]-e[i[1]];return 180*Math.atan2(o,n)/Math.PI}$.prototype={handler:function(){},init:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(P(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&k(this.element,this.evEl,this.domHandler),this.evTarget&&k(this.target,this.evTarget,this.domHandler),this.evWin&&k(P(this.element),this.evWin,this.domHandler)}};var oe={mousedown:z,mousemove:2,mouseup:B},se="mousedown",re="mousemove mouseup";function ae(){this.evEl=se,this.evWin=re,this.pressed=!1,$.apply(this,arguments)}m(ae,$,{handler:function(e){var t=oe[e.type];t&z&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=B),this.pressed&&(t&B&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))}});var he={pointerdown:z,pointermove:2,pointerup:B,pointercancel:A,pointerout:A},de={2:Y,3:"pen",4:"mouse",5:"kinect"},le="pointerdown",ue="pointermove pointerup pointercancel";function ce(){this.evEl=le,this.evWin=ue,$.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}s.MSPointerEvent&&!s.PointerEvent&&(le="MSPointerDown",ue="MSPointerMove MSPointerUp MSPointerCancel"),m(ce,$,{handler:function(e){var t=this.store,i=!1,n=e.type.toLowerCase().replace("ms",""),o=he[n],s=de[e.pointerType]||e.pointerType,r=s==Y,a=M(t,e.pointerId,"pointerId");o&z&&(0===e.button||r)?a<0&&(t.push(e),a=t.length-1):o&(B|A)&&(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 fe={touchstart:z,touchmove:2,touchend:B,touchcancel:A};function pe(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,$.apply(this,arguments)}m(pe,$,{handler:function(e){var t=fe[e.type];if(t===z&&(this.started=!0),this.started){var i=function(e,t){var i=O(e.touches),n=O(e.changedTouches);t&(B|A)&&(i=E(i.concat(n),"identifier",!0));return[i,n]}.call(this,e,t);t&(B|A)&&i[0].length-i[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:i[0],changedPointers:i[1],pointerType:Y,srcEvent:e})}}});var ve={touchstart:z,touchmove:2,touchend:B,touchcancel:A},ge="touchstart touchmove touchend touchcancel";function me(){this.evTarget=ge,this.targetIds={},$.apply(this,arguments)}m(me,$,{handler:function(e){var t=ve[e.type],i=function(e,t){var i=O(e.touches),n=this.targetIds;if(t&(2|z)&&1===i.length)return n[i[0].identifier]=!0,[i,i];var o,s,r=O(e.changedTouches),a=[],h=this.target;if(s=i.filter(function(e){return x(e.target,h)}),t===z)for(o=0;o<s.length;)n[s[o].identifier]=!0,o++;o=0;for(;o<r.length;)n[r[o].identifier]&&a.push(r[o]),t&(B|A)&&delete n[r[o].identifier],o++;return a.length?[E(s.concat(a),"identifier",!0),a]:void 0}.call(this,e,t);i&&this.callback(this.manager,t,{pointers:i[0],changedPointers:i[1],pointerType:Y,srcEvent:e})}});var ye=2500;function be(){$.apply(this,arguments);var e=y(this.handler,this);this.touch=new me(this.manager,e),this.mouse=new ae(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function _e(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;setTimeout(function(){var e=n.indexOf(i);-1<e&&n.splice(e,1)},ye)}}m(be,$,{handler:function(e,t,i){var n=i.pointerType==Y,o="mouse"==i.pointerType;if(!(o&&i.sourceCapabilities&&i.sourceCapabilities.firesTouchEvents)){if(n)(function(e,t){e&z?(this.primaryTouch=t.changedPointers[0].identifier,_e.call(this,t)):e&(B|A)&&_e.call(this,t)}).call(this,t,i);else if(o&&function(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<=25&&r<=25)return!0}return!1}.call(this,i))return;this.callback(e,t,i)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var we=T(t.style,"touchAction"),ke=we!==u,xe="manipulation",Se="none",De="pan-x",Me="pan-y",Oe=function(){if(!ke)return!1;var t={},i=s.CSS&&s.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(e){t[e]=!i||s.CSS.supports("touch-action",e)}),t}();function Ee(e,t){this.manager=e,this.set(t)}Ee.prototype={set:function(e){"compute"==e&&(e=this.compute()),ke&&this.manager.element.style&&Oe[e]&&(this.manager.element.style[we]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return l(this.manager.recognizers,function(e){b(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),function(e){if(S(e,Se))return Se;var t=S(e,De),i=S(e,Me);if(t&&i)return Se;if(t||i)return t?De:Me;if(S(e,xe))return xe;return"auto"}(t.join(" "))},preventDefaults:function(e){var t=e.srcEvent,i=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var n=this.actions,o=S(n,Se)&&!Oe.none,s=S(n,Me)&&!Oe[Me],r=S(n,De)&&!Oe[De];if(o){var a=1===e.pointers.length,h=e.distance<2,d=e.deltaTime<250;if(a&&h&&d)return}if(!r||!s)return o||s&&i&U||r&&i&G?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var Te=1;function Ce(e){this.options=r({},this.defaults,e||{}),this.id=C++,this.manager=null,this.options.enable=_(this.options.enable,!0),this.state=Te,this.simultaneous={},this.requireFail=[]}function Pe(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function Fe(e){return e==V?"down":e==W?"up":e==H?"left":e==j?"right":""}function Ne(e,t){var i=t.manager;return i?i.get(e):e}function Ie(){Ce.apply(this,arguments)}function Ye(){Ie.apply(this,arguments),this.pX=null,this.pY=null}function Re(){Ie.apply(this,arguments)}function ze(){Ce.apply(this,arguments),this._timer=null,this._input=null}function Be(){Ie.apply(this,arguments)}function Ae(){Ie.apply(this,arguments)}function Le(){Ce.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function He(e,t){return(t=t||{}).recognizers=_(t.recognizers,He.defaults.preset),new je(e,t)}Ce.prototype={defaults:{},set:function(e){return r(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(n(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=Ne(e,this)).id]||(t[e.id]=e).recognizeWith(this),this},dropRecognizeWith:function(e){return n(e,"dropRecognizeWith",this)||(e=Ne(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(n(e,"requireFailure",this))return this;var t=this.requireFail;return-1===M(t,e=Ne(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(n(e,"dropRequireFailure",this))return this;e=Ne(e,this);var t=M(this.requireFail,e);return-1<t&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return 0<this.requireFail.length},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(t){var i=this,e=this.state;function n(e){i.manager.emit(e,t)}e<8&&n(i.options.event+Pe(e)),n(i.options.event),t.additionalEvent&&n(t.additionalEvent),8<=e&&n(i.options.event+Pe(e))},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|Te)))return!1;e++}return!0},recognize:function(e){var t=r({},e);if(!b(this.options.enable,[this,t]))return this.reset(),void(this.state=32);56&this.state&&(this.state=Te),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},m(Ie,Ce,{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=6&t,o=this.attrTest(e);return n&&(i&A||!o)?16|t:n||o?i&B?8|t:2&t?4|t:2:32}}),m(Ye,Ie,{defaults:{event:"pan",threshold:10,pointers:1,direction:q},getTouchAction:function(){var e=this.options.direction,t=[];return e&U&&t.push(Me),e&G&&t.push(De),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||(n=t.direction&U?(o=0===s?L:s<0?H:j,i=s!=this.pX,Math.abs(e.deltaX)):(o=0===r?L:r<0?W:V,i=r!=this.pY,Math.abs(e.deltaY))),e.direction=o,i&&n>t.threshold&&o&t.direction},attrTest:function(e){return Ie.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=Fe(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),m(Re,Ie,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Se]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},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)}}),m(ze,Ce,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},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&(B|A)&&!o)this.reset();else if(e.eventType&z)this.reset(),this._timer=d(function(){this.state=8,this.tryEmit()},t.time,this);else if(e.eventType&B)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&e.eventType&B?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=f(),this.manager.emit(this.options.event,this._input)))}}),m(Be,Ie,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Se]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),m(Ae,Ie,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:U|G,pointers:1},getTouchAction:function(){return Ye.prototype.getTouchAction.call(this)},attrTest:function(e){var t,i=this.options.direction;return i&(U|G)?t=e.overallVelocity:i&U?t=e.overallVelocityX:i&G&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&i&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&c(t)>this.options.velocity&&e.eventType&B},emit:function(e){var t=Fe(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),m(Le,Ce,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[xe]},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&z&&0===this.count)return this.failTimeout();if(n&&o&&i){if(e.eventType!=B)return this.failTimeout();var s=!this.pTime||e.timeStamp-this.pTime<t.interval,r=!this.pCenter||ie(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,r&&s?this.count+=1:this.count=1,this._input=e,0==this.count%t.taps)return this.hasRequireFailures()?(this._timer=d(function(){this.state=8,this.tryEmit()},t.interval,this),2):8}return 32},failTimeout:function(){return this._timer=d(function(){this.state=32},this.options.interval,this),32},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),He.VERSION="2.0.7",He.defaults={domEvents:!1,touchAction:"compute",enable:!0,inputTarget:null,inputClass:null,preset:[[Be,{enable:!1}],[Re,{enable:!1},["rotate"]],[Ae,{direction:U}],[Ye,{direction:U},["swipe"]],[Le],[Le,{event:"doubletap",taps:2},["tap"]],[ze]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function je(e,t){this.options=r({},He.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=function(e){var t=e.options.inputClass;return new(t||(N?ce:I?me:F?be:ae))(e,K)}(this),this.touchAction=new Ee(this,this.options.touchAction),We(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 We(i,n){var o,s=i.element;s.style&&(l(i.options.cssProps,function(e,t){o=T(s.style,t),n?(i.oldCssProps[o]=s.style[o],s.style[o]=e):s.style[o]=i.oldCssProps[o]||""}),n||(i.oldCssProps={}))}je.prototype={set:function(e){return r(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){var i;this.touchAction.preventDefaults(e);var n=this.recognizers,o=t.curRecognizer;(!o||o&&8&o.state)&&(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&&14&i.state&&(o=t.curRecognizer=i),s++}},get:function(e){if(e instanceof Ce)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(n(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),(e.manager=this).touchAction.update(),e},remove:function(e){if(n(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,i=M(t,e);-1!==i&&(t.splice(i,1),this.touchAction.update())}return this},on:function(e,t){if(e!==u&&t!==u){var i=this.handlers;return l(D(e),function(e){i[e]=i[e]||[],i[e].push(t)}),this}},off:function(e,t){if(e!==u){var i=this.handlers;return l(D(e),function(e){t?i[e]&&i[e].splice(M(i[e],t),1):delete i[e]}),this}},emit:function(e,t){this.options.domEvents&&function(e,t){var i=o.createEvent("Event");i.initEvent(e,!0,!0),(i.gesture=t).target.dispatchEvent(i)}(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&&We(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},r(He,{INPUT_START:z,INPUT_MOVE:2,INPUT_END:B,INPUT_CANCEL:A,STATE_POSSIBLE:Te,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:32,DIRECTION_NONE:L,DIRECTION_LEFT:H,DIRECTION_RIGHT:j,DIRECTION_UP:W,DIRECTION_DOWN:V,DIRECTION_HORIZONTAL:U,DIRECTION_VERTICAL:G,DIRECTION_ALL:q,Manager:je,Input:$,TouchAction:Ee,TouchInput:me,MouseInput:ae,PointerEventInput:ce,TouchMouseInput:be,SingleTouchInput:pe,Recognizer:Ce,AttrRecognizer:Ie,Tap:Le,Pan:Ye,Swipe:Ae,Pinch:Re,Rotate:Be,Press:ze,on:w,off:k,each:l,merge:g,extend:v,assign:r,inherit:m,bindFn:y,prefixed:T}),(void 0!==s?s:"undefined"!=typeof self?self:{}).Hammer=He,"function"==typeof u&&u.amd?u(function(){return He}):Ve.exports?Ve.exports=He:s.Hammer=He}(window,document)}),ut=t(function(e){if("undefined"!=typeof window){var t=dt,i=window.Hammer||lt;e.exports=t(i,{preventDefault:"mouse"})}else e.exports=function(){return function(){function t(){}return{on:t,off:t,destroy:t,emit:t,get:function(e){return{set:t}}}}()}});function ct(t){this.active=!1,this.dom={container:t},this.dom.overlay=document.createElement("div"),this.dom.overlay.className="vis-overlay",this.dom.container.appendChild(this.dom.overlay),this.hammer=ut(this.dom.overlay),this.hammer.on("tap",this._onTapOverlay.bind(this));var i=this;["tap","doubletap","press","pinch","pan","panstart","panmove","panend"].forEach(function(e){i.hammer.on(e,function(e){e.stopPropagation()})}),document&&document.body&&(this.onClick=function(e){!function(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}(e.target,t)&&i.deactivate()},document.body.addEventListener("click",this.onClick)),void 0!==this.keycharm&&this.keycharm.destroy(),this.keycharm=ht(),this.escListener=this.deactivate.bind(this)}Te(ct.prototype),ct.current=null,ct.prototype.destroy=function(){this.deactivate(),this.dom.overlay.parentNode.removeChild(this.dom.overlay),this.onClick&&document.body.removeEventListener("click",this.onClick),void 0!==this.keycharm&&this.keycharm.destroy(),this.keycharm=null,this.hammer.destroy(),this.hammer=null},ct.prototype.activate=function(){ct.current&&ct.current.deactivate(),(ct.current=this).active=!0,this.dom.overlay.style.display="none",z.addClassName(this.dom.container,"vis-active"),this.emit("change"),this.emit("activate"),this.keycharm.bind("esc",this.escListener)},ct.prototype.deactivate=function(){this.active=!1,this.dom.overlay.style.display="",z.removeClassName(this.dom.container,"vis-active"),this.keycharm.unbind("esc",this.escListener),this.emit("change"),this.emit("deactivate")},ct.prototype._onTapOverlay=function(e){this.activate(),e.stopPropagation()};var ft=ct,pt=t(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:"Atrás",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,t.uk={edit:"Редагувати",del:"Видалити обране",back:"Назад",addNode:"Додати вузол",addEdge:"Додати край",editNode:"Редагувати вузол",editEdge:"Редагувати край",addDescription:"Kлікніть на вільне місце, щоб додати новий вузол.",edgeDescription:"Клікніть на вузол і перетягніть край до іншого вузла, щоб їх з'єднати.",editEdgeDescription:"Клікніть на контрольні точки і перетягніть їх у вузол, щоб підключитися до нього.",createEdgeError:"Не можливо об'єднати краї в групу.",deleteClusterError:"Групи не можуть бути видалені.",editClusterError:"Групи недоступні для редагування."},t.uk_UA=t.uk});function vt(e){return(vt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function gt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mt(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),Object.defineProperty(e,n.key,n)}}function yt(e,t,i){return t&&mt(e.prototype,t),i&&mt(e,i),e}function bt(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&wt(e,t)}function _t(e){return(_t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function wt(e,t){return(wt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function kt(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function xt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=[],n=!0,o=!1,s=void 0;try{for(var r,a=e[Symbol.iterator]();!(n=(r=a.next()).done)&&(i.push(r.value),!t||i.length!==t);n=!0);}catch(e){o=!0,s=e}finally{try{n||null==a.return||a.return()}finally{if(o)throw s}}return i}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var St,Dt=function(){function e(){gt(this,e),this.NUM_ITERATIONS=4,this.image=new Image,this.canvas=document.createElement("canvas")}return yt(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),h=Math.floor(e/8),d=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,h,o],[5*h,n,d,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(2<t){t*=.5;for(var r=0;2<t&&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}(),Mt=function(){function t(e){gt(this,t),this.images={},this.imageBroken={},this.callback=e}return yt(t,[{key:"_tryloadBrokenUrl",value:function(e,t,i){void 0!==e&&void 0!==i&&(void 0!==t?(i.image.onerror=function(){console.error("Could not load brokenImage:",t)},i.image.src=t):console.warn("No broken url image defined"))}},{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 Dt;return(this.images[e]=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))}}]),t}(),Ot=function(){function e(){gt(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},z.extend(this.options,this.defaultOptions)}return yt(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,t){var i=!(1<arguments.length&&void 0!==t)||t,n=this.groups[e];if(void 0===n&&i)if(!1===this.options.useDefaultGroups&&0<this.groupsArray.length){var o=this.groupIndex%this.groupsArray.length;this.groupIndex++,(n={}).color=this.groups[this.groupsArray[o]],this.groups[e]=n}else{var s=this.defaultIndex%this.defaultGroups.length;this.defaultIndex++,(n={}).color=this.defaultGroups[s],this.groups[e]=n}return n}},{key:"add",value:function(e,t){return this.groups[e]=t,this.groupsArray.push(e),t}}]),e}(),Et=function(){function e(){gt(this,e)}return yt(e,null,[{key:"choosify",value:function(e,t){var i=["node","edge","label"],n=!0,o=z.topMost(t,"chosen");if("boolean"==typeof o)n=o;else if("object"===vt(o)){if(-1===i.indexOf(e))throw new Error("choosify: subOption '"+e+"' should be one of '"+i.join("', '")+"'");var s=z.topMost(t,["chosen",e]);"boolean"!=typeof s&&"function"!=typeof s||(n=s)}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}(),Tt=function(){function t(e){gt(this,t),this.measureText=e,this.current=0,this.width=0,this.height=0,this.lines=[]}return yt(t,[{key:"_add",value:function(e,t,i){var n=2<arguments.length&&void 0!==i?i:"normal";void 0===this.lines[e]&&(this.lines[e]={width:0,height:0,blocks:[]});var o=t;void 0!==t&&""!==t||(o=" ");var s=this.measureText(o,n),r=Object.assign({},s.values);r.text=t,r.width=s.width,r.mod=n,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,t){var i=1<arguments.length&&void 0!==t?t:"normal";this._add(this.current,e,i)}},{key:"newLine",value:function(e,t){var i=1<arguments.length&&void 0!==t?t:"normal";this._add(this.current,e,i),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={};Object.assign(n,i),n.blocks=[];for(var o=void 0,s=[],r=0;r<i.blocks.length;r++){var a=i.blocks[r];0!==a.width?s.push(a):void 0===o&&(o=a)}0===s.length&&void 0!==o&&s.push(o),n.blocks=s,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}}}]),t}(),Ct={"<b>":/<b>/,"<i>":/<i>/,"<code>":/<code>/,"</b>":/<\/b>/,"</i>":/<\/i>/,"</code>":/<\/code>/,"*":/\*/,_:/\_/,"`":/`/,afterBold:/[^\*]/,afterItal:/[^_]/,afterMono:/[^`]/},Pt=function(){function t(e){gt(this,t),this.text=e,this.bold=!1,this.ital=!1,this.mono=!1,this.spacing=!1,this.position=0,this.buffer="",this.modStack=[],this.blocks=[]}return yt(t,[{key:"mod",value:function(){return 0===this.modStack.length?"normal":this.modStack[0]}},{key:"modName",value:function(){return 0===this.modStack.length?"normal":"mono"===this.modStack[0]?"mono":this.bold&&this.ital?"boldital":this.bold?"bold":this.ital?"ital":void 0}},{key:"emitBlock",value:function(){this.spacing&&(this.add(" "),this.spacing=!1),0<this.buffer.length&&(this.blocks.push({text:this.buffer,mod:this.modName()}),this.buffer="")}},{key:"add",value:function(e){" "===e&&(this.spacing=!0),this.spacing&&(this.buffer+=" ",this.spacing=!1)," "!=e&&(this.buffer+=e)}},{key:"parseWS",value:function(e){return!!/[ \t]/.test(e)&&(this.mono?this.add(e):this.spacing=!0,!0)}},{key:"setTag",value:function(e){this.emitBlock(),this[e]=!0,this.modStack.unshift(e)}},{key:"unsetTag",value:function(e){this.emitBlock(),this[e]=!1,this.modStack.shift()}},{key:"parseStartTag",value:function(e,t){return!(this.mono||this[e]||!this.match(t))&&(this.setTag(e),!0)}},{key:"match",value:function(e,t){var i=!(1<arguments.length&&void 0!==t)||t,n=xt(this.prepareRegExp(e),2),o=n[0],s=n[1],r=o.test(this.text.substr(this.position,s));return r&&i&&(this.position+=s-1),r}},{key:"parseEndTag",value:function(e,t,i){var n=this.mod()===e;return!(!(n="mono"===e?n&&this.mono:n&&!this.mono)||!this.match(t))&&(void 0!==i&&this.position!==this.text.length-1&&!this.match(i,!1)||this.unsetTag(e),!0)}},{key:"replace",value:function(e,t){return!!this.match(e)&&(this.add(t),this.position+=length-1,!0)}},{key:"prepareRegExp",value:function(e){var t,i;if(e instanceof RegExp)i=e,t=1;else{var n=Ct[e];i=void 0!==n?n:new RegExp(e),t=e.length}return[i,t]}}]),t}(),Ft=function(){function t(o,e,s,r){var a=this;gt(this,t),this.ctx=o,this.parent=e;this.lines=new Tt(function(e,t){if(void 0===e)return 0;var i=a.parent.getFormattingValues(o,s,r,t),n=0;""!==e&&(n=a.ctx.measureText(e).width);return{width:n,values:i}})}return yt(t,[{key:"process",value:function(e){if(!Et.isValidLabel(e))return this.lines.finalize();var t=this.parent.fontOptions;e=(e=e.replace(/\r\n/g,"\n")).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(0<t.maxWdt)for(var r=0;r<s.length;r++){var a=s[r].mod,h=s[r].text;this.splitStringIntoLines(h,a,!0)}else for(var d=0;d<s.length;d++){var l=s[d].mod,u=s[d].text;this.lines.append(u,l)}this.lines.newLine()}else this.lines.newLine("")}else if(0<t.maxWdt)for(var c=0;c<n;c++)this.splitStringIntoLines(i[c]);else for(var f=0;f<n;f++)this.lines.newLine(i[f]);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){for(var t=new Pt(e);t.position<t.text.length;){var i=t.text.charAt(t.position);t.parseWS(i)||/</.test(i)&&(t.parseStartTag("bold","<b>")||t.parseStartTag("ital","<i>")||t.parseStartTag("mono","<code>")||t.parseEndTag("bold","</b>")||t.parseEndTag("ital","</i>")||t.parseEndTag("mono","</code>"))||!!/&/.test(i)&&(t.replace(t.text,"&lt;","<")||t.replace(t.text,"&amp;","&")||t.add("&"),!0)||t.add(i),t.position++}return t.emitBlock(),t.blocks}},{key:"splitMarkdownBlocks",value:function(e){for(var t,i=this,n=new Pt(e),o=!0;n.position<n.text.length;){var s=n.text.charAt(n.position);n.parseWS(s)||!!/\\/.test(t=s)&&(n.position<i.text.length+1&&(n.position++,t=i.text.charAt(n.position),/ \t/.test(t)?n.spacing=!0:(n.add(t),o=!1)),!0)||(o||n.spacing)&&(n.parseStartTag("bold","*")||n.parseStartTag("ital","_")||n.parseStartTag("mono","`"))||n.parseEndTag("bold","*","afterBold")||n.parseEndTag("ital","_","afterItal")||n.parseEndTag("mono","`","afterMono")||(n.add(s),o=!1),n.position++}return n.emitBlock(),n.blocks}},{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+(""===t?"":" ")+e[i];if(this.overMaxWidth(n))break;t=n,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,t,i){for(var n=1<arguments.length&&void 0!==t?t:"normal",o=2<arguments.length&&void 0!==i&&i,s=(e=(e=e.replace(/^( +)/g,"$1\r")).replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r")).split("\r");0<s.length;){var r=this.getLongestFit(s);if(0===r){var a=s[0],h=this.getLongestFitWord(a);this.lines.newLine(a.slice(0,h),n),s[0]=a.slice(h)}else{var d=r;" "===s[r-1]?r--:" "===s[d]&&d++;var l=s.slice(0,r).join("");r==s.length&&o?this.lines.append(l,n):this.lines.newLine(l,n),s=s.slice(d)}}}}]),t}(),Nt=["bold","ital","boldital","mono"],It=function(){function a(e,t){var i=2<arguments.length&&void 0!==arguments[2]&&arguments[2];gt(this,a),this.body=e,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(t),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=i}return yt(a,[{key:"setOptions",value:function(e){if(this.elementOptions=e,this.initFontOptions(e.font),Et.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"===vt(e.font)){var t=e.font.size;void 0!==t&&(this.baseSize=t)}}},{key:"initFontOptions",value:function(e){var i=this;z.forEach(Nt,function(e){i.fontOptions[e]={}}),a.parseFontString(this.fontOptions,e)?this.fontOptions.vadjust=0:z.forEach(e,function(e,t){null!=e&&"object"!==vt(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=z.topMost(e,"widthConstraint");if("number"==typeof i)t.maxWdt=Number(i),t.minWdt=Number(i);else if("object"===vt(i)){var n=z.topMost(e,["widthConstraint","maximum"]);"number"==typeof n&&(t.maxWdt=Number(n));var o=z.topMost(e,["widthConstraint","minimum"]);"number"==typeof o&&(t.minWdt=Number(o))}var s=z.topMost(e,"heightConstraint");if("number"==typeof s)t.minHgt=Number(s);else if("object"===vt(s)){var r=z.topMost(e,["heightConstraint","minimum"]);"number"==typeof r&&(t.minHgt=Number(r));var a=z.topMost(e,["heightConstraint","valign"]);"string"==typeof a&&("top"!==a&&"bottom"!==a||(t.valign=a))}return t}},{key:"update",value:function(e,t){this.setOptions(e,!0),this.propagateFonts(t),z.deepExtend(this.fontOptions,this.constrain(t)),this.fontOptions.chooser=Et.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(e){for(var i={},t=0;t<e.length;++t){var n=e[t],o={};a.parseFontString(o,n)&&(n=o),z.forEach(n,function(e,t){void 0!==e&&(i.hasOwnProperty(t)||(-1!==Nt.indexOf(t)?i[t]={}:i[t]=e))})}return i}},{key:"getFontOption",value:function(e,t,i){for(var n,o=0;o<e.length;++o){var s=e[o];if(s.hasOwnProperty(t)){if(null==(n=s[t]))continue;var r={};if(a.parseFontString(r,n)&&(n=r),n.hasOwnProperty(i))return n[i]}}if(this.fontOptions.hasOwnProperty(i))return this.fontOptions[i];throw new Error("Did not find value for multi-font for property: '"+i+"'")}},{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 o=this,s=[];this.addFontOptionsToPile(s,e),this.fontOptions=this.getBasicOptions(s);for(var t=function(e){var t=Nt[e],i=o.fontOptions[t],n=o.getFontOptions(s,t);z.forEach(n,function(e,t){i[t]=e}),i.size=Number(i.size),i.vadjust=Number(i.vadjust)},i=0;i<Nt.length;++i)t(i)}},{key:"draw",value:function(e,t,i,n,o,s){var r=5<arguments.length&&void 0!==s?s:"middle";if(void 0!==this.elementOptions.label){var a=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&a<this.elementOptions.scaling.label.drawThreshold-1||(a>=this.elementOptions.scaling.label.maxVisible&&(a=Number(this.elementOptions.scaling.label.maxVisible)/this.body.view.scale),this.calculateLabelSize(e,n,o,t,i,r),this._drawBackground(e),this._drawText(e,t,this.size.yLine,r,a))}}},{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,n,o){var s=3<arguments.length&&void 0!==n?n:"middle",r=4<arguments.length?o:void 0,a=xt(this._setAlignment(e,t,i,s),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 h=0;h<this.lineCount;h++){var d=this.lines[h];if(d&&d.blocks){var l=0;this.isEdgeLabel||"center"===this.fontOptions.align?l+=(this.size.width-d.width)/2:"right"===this.fontOptions.align&&(l+=this.size.width-d.width);for(var u=0;u<d.blocks.length;u++){var c=d.blocks[u];e.font=c.font;var f=xt(this._getColor(c.color,r,c.strokeColor),2),p=f[0],v=f[1];0<c.strokeWidth&&(e.lineWidth=c.strokeWidth,e.strokeStyle=v,e.lineJoin="round"),e.fillStyle=p,0<c.strokeWidth&&e.strokeText(c.text,t+l,i+c.vadjust),e.fillText(c.text,t+l,i+c.vadjust),l+=c.width}i+=d.height}}}},{key:"_setAlignment",value:function(e,t,i,n){if(this.isEdgeLabel&&"horizontal"!==this.fontOptions.align&&!1===this.pointToSelf){i=t=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=z.overrideOpacity(n,s),o=z.overrideOpacity(o,s)}return[n,o]}},{key:"getTextSize",value:function(e,t,i){var n=1<arguments.length&&void 0!==t&&t,o=2<arguments.length&&void 0!==i&&i;return this._processLabel(e,n,o),{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,n,o,s){var r=3<arguments.length&&void 0!==n?n:0,a=4<arguments.length&&void 0!==o?o:0,h=5<arguments.length&&void 0!==s?s:"middle";this._processLabel(e,t,i),this.size.left=r-.5*this.size.width,this.size.top=a-.5*this.size.height,this.size.yLine=a+.5*(1-this.lineCount)*this.fontOptions.size,"hanging"===h&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4)}},{key:"getFormattingValues",value:function(e,t,i,n){function o(e,t,i){return"normal"===t?"mod"===i?"":e[i]:void 0!==e[t][i]?e[t][i]:e[i]}var 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 Ft(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);0<this.fontOptions.minWdt&&n.width<this.fontOptions.minWdt&&(n.width=this.fontOptions.minWdt),this.size.labelHeight=n.height,0<this.fontOptions.minHgt&&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}}]),a}(),Yt=function(){function n(e,t,i){gt(this,n),this.body=t,this.labelModule=i,this.setOptions(e),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 yt(n,[{key:"setOptions",value:function(e){this.options=e}},{key:"_setMargins",value:function(e){this.margin={},this.options.margin&&("object"==vt(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):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(),0<i&&(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&&(o=n=14),{width:n,height:o}}}]),n}(),Rt=function(){function o(e,t,i){var n;return gt(this,o),(n=kt(this,_t(o).call(this,e,t,i)))._setMargins(i),n}return bt(o,Yt),yt(o,[{key:"resize",value:function(e,t,i){var n=1<arguments.length&&void 0!==t?t:this.selected,o=2<arguments.length&&void 0!==i?i:this.hover;if(this.needsRefresh(n,o)){var s=this.getDimensionsFromLabel(e,n,o);this.width=s.width+this.margin.right+this.margin.left,this.height=s.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}}]),o}(),zt=function(){function o(e,t,i){var n;return gt(this,o),(n=kt(this,_t(o).call(this,e,t,i))).labelOffset=0,n.selected=!1,n}return bt(o,Yt),yt(o,[{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);1<=a.lineCount&&(r+=a.height/2)}s=i+r,this.options.label&&(this.labelOffset=r),this.labelModule.draw(e,t,s,n,o,"hanging")}}]),o}(),Bt=function(){function o(e,t,i){var n;return gt(this,o),(n=kt(this,_t(o).call(this,e,t,i)))._setMargins(i),n}return bt(o,zt),yt(o,[{key:"resize",value:function(e,t,i){var n=1<arguments.length&&void 0!==t?t:this.selected,o=2<arguments.length&&void 0!==i?i:this.hover;if(this.needsRefresh(n,o)){var s=this.getDimensionsFromLabel(e,n,o),r=Math.max(s.width+this.margin.right+this.margin.left,s.height+this.margin.top+this.margin.bottom);this.options.size=r/2,this.width=r,this.height=r,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}}]),o}(),At=function(){function r(e,t,i,n,o){var s;return gt(this,r),(s=kt(this,_t(r).call(this,e,t,i))).setImages(n,o),s}return bt(r,zt),yt(r,[{key:"resize",value:function(e,t,i){var n=1<arguments.length&&void 0!==t?t:this.selected,o=2<arguments.length&&void 0!==i?i:this.hover;if(void 0===this.imageObj.src||void 0===this.imageObj.width||void 0===this.imageObj.height){var s=2*this.options.size;return this.width=s,this.height=s,void(this.radius=.5*this.width)}this.needsRefresh(n,o)&&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}}]),r}(),Lt=function(){function o(e,t,i){var n;return gt(this,o),(n=kt(this,_t(o).call(this,e,t,i)))._setMargins(i),n}return bt(o,Yt),yt(o,[{key:"resize",value:function(e,t,i){if(this.needsRefresh(t,i)){var n=this.getDimensionsFromLabel(e,t,i).width+this.margin.right+this.margin.left;this.width=n,this.height=n,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)}}]),o}(),Ht=function(){function n(e,t,i){return gt(this,n),kt(this,_t(n).call(this,e,t,i))}return bt(n,Yt),yt(n,[{key:"resize",value:function(e,t,i,n){var o=1<arguments.length&&void 0!==t?t:this.selected,s=2<arguments.length&&void 0!==i?i:this.hover,r=3<arguments.length&&void 0!==n?n:{size:this.options.size};if(this.needsRefresh(o,s)){this.labelModule.getTextSize(e,o,s);var a=2*r.size;this.width=a,this.height=a,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.icon&&void 0!==this.options.icon.code&&(e.font=(s?"bold ":"")+this.height/2+"px "+(this.options.icon.face||"FontAwesome"),e.fillStyle=this.options.icon.color||"black",e.textAlign="center",e.textBaseline="middle",e.fillText(this.options.icon.code,n,o)),void 0!==this.options.label){this.labelModule.calculateLabelSize(e,s,r,n,o,"hanging");var h=o+.5*this.height+.5*this.labelModule.size.height;this.labelModule.draw(e,n,h,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&&0<this.labelModule.size.width&&(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))}}]),n}(),jt=function(){function n(e,t,i){return gt(this,n),kt(this,_t(n).call(this,e,t,i))}return bt(n,Ht),yt(n,[{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)}}]),n}(),Wt=function(){function n(e,t,i){return gt(this,n),kt(this,_t(n).call(this,e,t,i))}return bt(n,Ht),yt(n,[{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}}]),n}(),Vt=function(){function n(e,t,i){return gt(this,n),kt(this,_t(n).call(this,e,t,i))}return bt(n,Yt),yt(n,[{key:"resize",value:function(e,t,i){var n=1<arguments.length&&void 0!==t?t:this.selected,o=2<arguments.length&&void 0!==i?i:this.hover;if(this.needsRefresh(n,o)){var s=this.getDimensionsFromLabel(e,n,o);this.height=2*s.height,this.width=s.width+s.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)}}]),n}(),Ut=function(){function o(e,t,i){var n;return gt(this,o),(n=kt(this,_t(o).call(this,e,t,i)))._setMargins(i),n}return bt(o,Yt),yt(o,[{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&&0<this.labelModule.size.width){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)}}]),o}(),Gt=function(){function r(e,t,i,n,o){var s;return gt(this,r),(s=kt(this,_t(r).call(this,e,t,i))).setImages(n,o),s}return bt(r,zt),yt(r,[{key:"resize",value:function(e,t,i){var n=1<arguments.length&&void 0!==t?t:this.selected,o=2<arguments.length&&void 0!==i?i:this.hover;if(void 0===this.imageObj.src||void 0===this.imageObj.width||void 0===this.imageObj.height){var s=2*this.options.size;return this.width=s,void(this.height=s)}this.needsRefresh(n,o)&&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,h=(n?a:r)/this.body.view.scale;e.lineWidth=Math.min(this.width,h),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&&0<this.labelModule.size.width&&(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)}}]),r}(),qt=function(){function n(e,t,i){return gt(this,n),kt(this,_t(n).call(this,e,t,i))}return bt(n,Ht),yt(n,[{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)}}]),n}(),Zt=function(){function n(e,t,i){return gt(this,n),kt(this,_t(n).call(this,e,t,i))}return bt(n,Ht),yt(n,[{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)}}]),n}(),Xt=function(){function n(e,t,i){return gt(this,n),kt(this,_t(n).call(this,e,t,i))}return bt(n,Ht),yt(n,[{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)}}]),n}(),$t=function(){function o(e,t,i){var n;return gt(this,o),(n=kt(this,_t(o).call(this,e,t,i)))._setMargins(i),n}return bt(o,Yt),yt(o,[{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)}}]),o}(),Kt=function(){function n(e,t,i){return gt(this,n),kt(this,_t(n).call(this,e,t,i))}return bt(n,Ht),yt(n,[{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)}}]),n}(),Qt=function(){function n(e,t,i){return gt(this,n),kt(this,_t(n).call(this,e,t,i))}return bt(n,Ht),yt(n,[{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)}}]),n}(),Jt=!1,ei="background: #FFeeee; color: #dd0000",ti=function(){function f(){gt(this,f)}return yt(f,null,[{key:"validate",value:function(e,t,i){Jt=!1;var n=St=t;return void 0!==i&&(n=t[i]),f.parse(e,n,[]),Jt}},{key:"parse",value:function(e,t,i){for(var n in e)e.hasOwnProperty(n)&&f.check(n,e,t,i)}},{key:"check",value:function(e,t,i,n){if(void 0!==i[e]||void 0!==i.__any__){var o=e,s=!0;void 0===i[e]&&void 0!==i.__any__&&(o="__any__",s="object"===f.getType(t[e]));var r=i[o];s&&void 0!==r.__type__&&(r=r.__type__),f.checkFields(e,t,i,o,r,n)}else f.getSuggestion(e,i,n)}},{key:"checkFields",value:function(t,e,i,n,o,s){function r(e){console.log("%c"+e+f.printLocation(s,t),ei)}var a=f.getType(e[t]),h=o[a];void 0!==h?"array"===f.getType(h)&&-1===h.indexOf(e[t])?(r('Invalid option detected in "'+t+'". Allowed values are:'+f.print(h)+' not "'+e[t]+'". '),Jt=!0):"object"===a&&"__any__"!==n&&(s=z.copyAndExtendArray(s,t),f.parse(e[t],i[n],s)):void 0===o.any&&(r('Invalid type received for "'+t+'". Expected: '+f.print(Object.keys(o))+". Received ["+a+'] "'+e[t]+'"'),Jt=!0)}},{key:"getType",value:function(e){var t=vt(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(e,t,i){var n,o=f.findInOptions(e,t,i,!1),s=f.findInOptions(e,St,[],!0);n=void 0!==o.indexMatch?" in "+f.printLocation(o.path,e,"")+'Perhaps it was incomplete? Did you mean: "'+o.indexMatch+'"?\n\n':s.distance<=4&&o.distance>s.distance?" in "+f.printLocation(o.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+f.printLocation(s.path,s.closestMatch,""):o.distance<=8?'. Did you mean "'+o.closestMatch+'"?'+f.printLocation(o.path,e):". Did you mean one of these: "+f.print(Object.keys(t))+f.printLocation(i,e),console.log('%cUnknown option detected: "'+e+'"'+n,ei),Jt=!0}},{key:"findInOptions",value:function(e,t,i,n){var o=3<arguments.length&&void 0!==n&&n,s=1e9,r="",a=[],h=e.toLowerCase(),d=void 0;for(var l in t){var u=void 0;if(void 0!==t[l].__type__&&!0===o){var c=f.findInOptions(e,t[l],z.copyAndExtendArray(i,l));s>c.distance&&(r=c.closestMatch,a=c.path,s=c.distance,d=c.indexMatch)}else-1!==l.toLowerCase().indexOf(h)&&(d=l),(u=f.levenshteinDistance(e,l))<s&&(r=l,a=z.copyArray(i),s=u)}return{closestMatch:r,path:a,distance:s,indexMatch:d}}},{key:"printLocation",value:function(e,t,i){for(var n="\n\n"+(2<arguments.length&&void 0!==i?i:"Problem value found at: \n")+"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 h=0;h<e.length-a;h++)n+=" ";n+="}\n"}return n+"\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,n,o=[];for(i=0;i<=t.length;i++)o[i]=[i];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]}}]),f}(),ii=function(){function d(e,t,i,n,o,s){gt(this,d),this.options=z.bridgeObject(o),this.globalOptions=o,this.defaultOptions=s,this.body=t,this.edges=[],this.id=void 0,this.imagelist=i,this.grouplist=n,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 It(this.body,this.options,!1),this.setOptions(e)}return yt(d,[{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(e){var t=this.options.shape;if(e){if(void 0!==e.id&&(this.id=e.id),void 0===this.id)throw new Error("Node must have an id");d.checkMass(e,this.id),void 0!==e.x&&(null===e.x?(this.x=void 0,this.predefinedPosition=!1):(this.x=parseInt(e.x),this.predefinedPosition=!0)),void 0!==e.y&&(null===e.y?(this.y=void 0,this.predefinedPosition=!1):(this.y=parseInt(e.y),this.predefinedPosition=!0)),void 0!==e.size&&(this.baseSize=e.size),void 0!==e.value&&(e.value=parseFloat(e.value)),d.parseOptions(this.options,e,!0,this.globalOptions,this.grouplist);var i=[e,this.options,this.defaultOptions];return this.chooser=Et.choosify("node",i),this._load_images(),this.updateLabelModule(e),this.updateShape(t),void 0!==e.hidden||void 0!==e.physics}}},{key:"_load_images",value:function(){if(("circularImage"===this.options.shape||"image"===this.options.shape)&&void 0===this.options.image)throw new Error("Option image must be defined for node type '"+this.options.shape+"'");if(void 0!==this.options.image){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(e){void 0!==this.options.label&&null!==this.options.label||(this.options.label=""),d.updateGroupOptions(this.options,e,this.grouplist);var t=this.grouplist.get(this.options.group,!1),i=[e,this.options,t,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,i),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 Rt(this.options,this.body,this.labelModule);break;case"circle":this.shape=new Bt(this.options,this.body,this.labelModule);break;case"circularImage":this.shape=new At(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"database":this.shape=new Lt(this.options,this.body,this.labelModule);break;case"diamond":this.shape=new jt(this.options,this.body,this.labelModule);break;case"dot":this.shape=new Wt(this.options,this.body,this.labelModule);break;case"ellipse":this.shape=new Vt(this.options,this.body,this.labelModule);break;case"icon":this.shape=new Ut(this.options,this.body,this.labelModule);break;case"image":this.shape=new Gt(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"square":this.shape=new qt(this.options,this.body,this.labelModule);break;case"hexagon":this.shape=new Zt(this.options,this.body,this.labelModule);break;case"star":this.shape=new Xt(this.options,this.body,this.labelModule);break;case"text":this.shape=new $t(this.options,this.body,this.labelModule);break;case"triangle":this.shape=new Kt(this.options,this.body,this.labelModule);break;case"triangleDown":this.shape=new Qt(this.options,this.body,this.labelModule);break;default:this.shape=new Vt(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()&&Et.pointInRect(this.labelModule.getSize(),e)&&t.push({nodeId:this.id,labelId:0}),Et.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),s=["font"];void 0!==t&&void 0!==t.color&&null!=t.color&&s.push("color"),z.selectiveNotDeepExtend(s,e,o),e.color=z.parseColor(e.color)}}}},{key:"parseOptions",value:function(e,t,i,n,o){var s=2<arguments.length&&void 0!==i&&i,r=3<arguments.length&&void 0!==n?n:{},a=4<arguments.length?o:void 0;if(z.selectiveNotDeepExtend(["color","fixed","shadow"],e,t,s),d.checkMass(t),z.mergeOptions(e,t,"shadow",r),void 0!==t.color&&null!==t.color){var h=z.parseColor(t.color);z.fillIfDefined(e.color,h)}else!0===s&&null===t.color&&(e.color=z.bridgeObject(r.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))),!0===s&&null===t.font&&(e.font=z.bridgeObject(r.font)),d.updateGroupOptions(e,t,a),void 0!==t.scaling&&z.mergeOptions(e.scaling,t.scaling,"label",r.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.",ei),e.mass=1}}}]),d}(),ni=function(){function s(e,t,i,n){var o=this;if(gt(this,s),this.body=e,this.images=t,this.groups=i,this.layoutEngine=n,this.body.functions.createNode=this.create.bind(this),this.nodesListeners={add:function(e,t){o.add(t.items)},update:function(e,t){o.update(t.items,t.data,t.oldData)},remove:function(e,t){o.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=z.bridgeObject(this.defaultOptions),this.bindEventListeners()}return yt(s,[{key:"bindEventListeners",value:function(){var i=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(){z.forEach(i.nodesListeners,function(e,t){i.body.data.nodes&&i.body.data.nodes.off(t,e)}),delete i.body.functions.createNode,delete i.nodesListeners.add,delete i.nodesListeners.update,delete i.nodesListeners.remove,delete i.nodesListeners})}},{key:"setOptions",value:function(e){if(void 0!==e){if(ii.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,t){var i=1<arguments.length&&void 0!==t&&t,n=this.body.data.nodes;if(e instanceof Me||e instanceof Oe)this.body.data.nodes=e;else if(Array.isArray(e))this.body.data.nodes=new Me,this.body.data.nodes.add(e);else{if(e)throw new TypeError("Array or DataSet expected");this.body.data.nodes=new Me}if(n&&z.forEach(this.nodesListeners,function(e,t){n.off(t,e)}),this.body.nodes={},this.body.data.nodes){var o=this;z.forEach(this.nodesListeners,function(e,t){o.body.data.nodes.on(t,e)});var s=this.body.data.nodes.getIds();this.add(s,!0)}!1===i&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(e,t){for(var i,n=1<arguments.length&&void 0!==t&&t,o=[],s=0;s<e.length;s++){i=e[s];var r=this.body.data.nodes.get(i),a=this.create(r);o.push(a),this.body.nodes[i]=a}this.layoutEngine.positionInitially(o),!1===n&&this.body.emitter.emit("_dataChanged")}},{key:"update",value:function(e,t,n){for(var i=this.body.nodes,o=!1,s=0;s<e.length;s++){var r=e[s],a=i[r],h=t[s];void 0!==a?a.setOptions(h)&&(o=!0):(o=!0,a=this.create(h),i[r]=a)}o||void 0===n||(o=t.some(function(e,t){var i=n[t];return i&&i.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,t){return new(1<arguments.length&&void 0!==t?t:ii)(e,this.body,this.images,this.groups,this.options,this.defaultOptions)}},{key:"refresh",value:function(e){var n=this,o=0<arguments.length&&void 0!==e&&e;z.forEach(this.body.nodes,function(e,t){var i=n.body.data.nodes.get(t);void 0!==i&&(!0===o&&e.setOptions({x:null,y:null}),e.setOptions({fixed:!1}),e.setOptions(i))})}},{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)}}]),s}(),oi=function(){function e(){gt(this,e)}return yt(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],h=a.x*Math.cos(o)-a.y*Math.sin(o),d=a.x*Math.sin(o)+a.y*Math.cos(o);a.x=i+s*h,a.y=n+s*d}}},{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}(),si=function(){function e(){return gt(this,e),kt(this,_t(e).apply(this,arguments))}return bt(e,oi),yt(e,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}];oi.transform(i,t),oi.drawPath(e,i)}}]),e}(),ri=function(){function e(){gt(this,e)}return yt(e,null,[{key:"draw",value:function(e,t){var i=[{x:-1,y:0},{x:0,y:.3},{x:-.4,y:0},{x:0,y:-.3}];oi.transform(i,t),oi.drawPath(e,i)}}]),e}(),ai=function(){function e(){gt(this,e)}return yt(e,null,[{key:"draw",value:function(e,t){var i={x:-.4,y:0};oi.transform(i,t),e.strokeStyle=e.fillStyle,e.fillStyle="rgba(0, 0, 0, 0)";var n=Math.PI,o=t.angle-n/2,s=t.angle+n/2;e.beginPath(),e.arc(i.x,i.y,.4*t.length,o,s,!1),e.stroke()}}]),e}(),hi=function(){function e(){gt(this,e)}return yt(e,null,[{key:"draw",value:function(e,t){var i={x:-.3,y:0};oi.transform(i,t),e.strokeStyle=e.fillStyle,e.fillStyle="rgba(0, 0, 0, 0)";var n=Math.PI,o=t.angle+n/2,s=t.angle+3*n/2;e.beginPath(),e.arc(i.x,i.y,.4*t.length,o,s,!1),e.stroke()}}]),e}(),di=function(){function e(){gt(this,e)}return yt(e,null,[{key:"draw",value:function(e,t){var i=[{x:.02,y:0},{x:-1,y:.3},{x:-1,y:-.3}];oi.transform(i,t),oi.drawPath(e,i)}}]),e}(),li=function(){function e(){gt(this,e)}return yt(e,null,[{key:"draw",value:function(e,t){var i=[{x:0,y:.3},{x:0,y:-.3},{x:-1,y:0}];oi.transform(i,t),oi.drawPath(e,i)}}]),e}(),ui=function(){function e(){gt(this,e)}return yt(e,null,[{key:"draw",value:function(e,t){var i={x:-.4,y:0};oi.transform(i,t),e.circle(i.x,i.y,.4*t.length)}}]),e}(),ci=function(){function e(){gt(this,e)}return yt(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}];oi.transform(i,t),oi.drawPath(e,i)}}]),e}(),fi=function(){function e(){gt(this,e)}return yt(e,null,[{key:"draw",value:function(e,t){var i=[{x:0,y:.3},{x:0,y:-.3},{x:-.6,y:-.3},{x:-.6,y:.3}];oi.transform(i,t),oi.drawPath(e,i)}}]),e}(),pi=function(){function e(){gt(this,e)}return yt(e,null,[{key:"draw",value:function(e,t){var i=[{x:0,y:0},{x:-.5,y:-.3},{x:-1,y:0},{x:-.5,y:.3}];oi.transform(i,t),oi.drawPath(e,i)}}]),e}(),vi=function(){function e(){gt(this,e)}return yt(e,null,[{key:"draw",value:function(e,t){var i=[{x:-1,y:.3},{x:-.5,y:0},{x:-1,y:-.3},{x:0,y:0}];oi.transform(i,t),oi.drawPath(e,i)}}]),e}(),gi=function(){function e(){gt(this,e)}return yt(e,null,[{key:"draw",value:function(e,t){var i;switch(t.type&&(i=t.type.toLowerCase()),i){case"circle":ui.draw(e,t);break;case"box":fi.draw(e,t);break;case"crow":ri.draw(e,t);break;case"curve":ai.draw(e,t);break;case"diamond":pi.draw(e,t);break;case"inv_curve":hi.draw(e,t);break;case"triangle":di.draw(e,t);break;case"inv_triangle":li.draw(e,t);break;case"bar":ci.draw(e,t);break;case"vee":vi.draw(e,t);break;case"arrow":default:si.draw(e,t)}}}]),e}(),mi=function(){function n(e,t,i){gt(this,n),this.body=t,this.labelModule=i,this.options={},this.setOptions(e),this.colorDirty=!0,this.color={},this.selectionWidth=2,this.hoverWidth=1.5,this.fromPoint=this.from,this.toPoint=this.to}return yt(n,[{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 s=xt(this._getCircleData(e),3),r=s[0],a=s[1],h=s[2];this._circle(e,t,r,a,h)}}},{key:"_drawDashedLine",value:function(e,t,i,n,o){e.lineCap="round";var s=[5,5];if(!0===Array.isArray(t.dashes)&&(s=t.dashes),void 0!==e.setLineDash){if(e.save(),e.setLineDash(s),e.lineDashOffset=0,this.from!=this.to)this._line(e,t,i);else{var r=xt(this._getCircleData(e),3),a=r[0],h=r[1],d=r[2];this._circle(e,t,a,h,d)}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 l=xt(this._getCircleData(e),3),u=l[0],c=l[1],f=l[2];this._circle(e,t,u,c,f)}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=xt(this._getCircleData(e).slice(0,2),2),o=n[0],s=n[1];t=this._findBorderPositionCircle(this.from,e,{x:o,y:s,low:.25,high:.6,direction:-1}),i=this._findBorderPositionCircle(this.from,e,{x:o,y:s,low:.6,high:.8,direction:1})}return{from:t,to:i}}},{key:"_getCircleData",value:function(e){var t,i,n=this.from,o=this.options.selfReferenceSize;return void 0!==e&&void 0===n.shape.width&&n.shape.resize(e),i=n.shape.width>n.shape.height?(t=n.x+.5*n.shape.width,n.y-o):(t=n.x+o,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,o,s,r=i.x,a=i.y,h=i.low,d=i.high,l=i.direction,u=0,c=this.options.selfReferenceSize,f=.5*(h+d);h<=d&&u<10&&(f=.5*(h+d),n=this._pointOnCircle(r,a,c,f),o=Math.atan2(e.y-n.y,e.x-n.x),s=e.distanceToBorder(t,o)-Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2)),!(Math.abs(s)<.05));)0<s?0<l?h=f:d=f:0<l?d=f:h=f,u++;return n.t=f,n}},{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)return z.overrideOpacity(t.color,t.opacity);if("both"!==t.inheritsColor||this.from.id===this.to.id)return"to"===t.inheritsColor?z.overrideOpacity(this.to.options.color.border,t.opacity):z.overrideOpacity(this.from.options.color.border,t.opacity);var o,s,r=e.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y);return o=this.from.options.color.highlight.border,s=this.to.options.color.highlight.border,!1===this.from.selected&&!1===this.to.selected?(o=z.overrideOpacity(this.from.options.color.border,t.opacity),s=z.overrideOpacity(this.to.options.color.border,t.opacity)):!0===this.from.selected&&!1===this.to.selected?s=this.to.options.color.border:!1===this.from.selected&&!0===this.to.selected&&(o=this.from.options.color.border),r.addColorStop(0,o),r.addColorStop(1,s),r}},{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,s,r,a){var h=0;if(this.from!=this.to)h=this._getDistanceToEdge(e,t,i,n,o,s,r);else{var d=xt(this._getCircleData(void 0),3),l=d[0],u=d[1],c=d[2],f=l-o,p=u-s;h=Math.abs(Math.sqrt(f*f+p*p)-c)}return h}},{key:"_getDistanceToLine",value:function(e,t,i,n,o,s){var r=i-e,a=n-t,h=((o-e)*r+(s-t)*a)/(r*r+a*a);1<h?h=1:h<0&&(h=0);var d=e+h*r-o,l=t+h*a-s;return Math.sqrt(d*d+l*l)}},{key:"getArrowData",value:function(e,t,i,n,o,s){var r,a,h,d,l,u,c,f=s.width;if(c="from"===t?(h=this.from,d=this.to,l=.1,u=s.fromArrowScale,s.fromArrowType):"to"===t?(h=this.to,d=this.from,l=-.1,u=s.toArrowScale,s.toArrowType):(h=this.to,d=this.from,u=s.middleArrowScale,s.middleArrowType),h!=d)if("middle"!==t)if(!0===this.options.smooth.enabled){a=this.findBorderPosition(h,e,{via:i});var p=this.getPoint(Math.max(0,Math.min(1,a.t+l)),i);r=Math.atan2(a.y-p.y,a.x-p.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 v=xt(this._getCircleData(e),3),g=v[0],m=v[1],y=v[2];r="from"===t?-2*(a=this.findBorderPosition(this.from,e,{x:g,y:m,low:.25,high:.6,direction:-1})).t*Math.PI+1.5*Math.PI+.1*Math.PI:"to"===t?-2*(a=this.findBorderPosition(this.from,e,{x:g,y:m,low:.6,high:1,direction:1})).t*Math.PI+1.5*Math.PI-1.1*Math.PI:(a=this._pointOnCircle(g,m,y,.175),3.9269908169872414)}"middle"===t&&u<0&&(f*=-1);var b=15*u+3*f;return{point:a,core:{x:a.x-.9*b*Math.cos(r),y:a.y-.9*b*Math.sin(r)},angle:r,length:b,type:c}}},{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,gi.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)}},{key:"drawBackground",value:function(t,e){if(!1!==e.background){var i=["strokeStyle","lineWidth","dashes"],n={};i.forEach(function(e){n[e]=t[e]}),t.strokeStyle=e.backgroundColor,t.lineWidth=e.backgroundSize,this.setStrokeDashed(t,e.backgroundDashes),t.stroke(),i.forEach(function(e){t[e]=n[e]}),this.setStrokeDashed(t,e.dashes)}}},{key:"setStrokeDashed",value:function(e,t){if(!1!==t)if(void 0!==e.setLineDash){var i=[5,5];!0===Array.isArray(t)&&(i=t),e.setLineDash(i)}else console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.");else void 0!==e.setLineDash?e.setLineDash([]):console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.")}}]),n}(),yi=function(){function n(e,t,i){return gt(this,n),kt(this,_t(n).call(this,e,t,i))}return bt(n,mi),yt(n,[{key:"_findBorderPositionBezier",value:function(e,t,i){var n,o,s,r=2<arguments.length&&void 0!==i?i:this._getViaCoordinates(),a=0,h=0,d=1,l=this.to,u=!1;for(e.id===this.from.id&&(l=this.from,u=!0);h<=d&&a<10;){var c=.5*(h+d);if(n=this.getPoint(c,r),o=Math.atan2(l.y-n.y,l.x-n.x),s=l.distanceToBorder(t,o)-Math.sqrt(Math.pow(n.x-l.x,2)+Math.pow(n.y-l.y,2)),Math.abs(s)<.2)break;s<0?!1===u?h=c:d=c:!1===u?d=c:h=c,a++}return n.t=c,n}},{key:"_getDistanceToBezierEdge",value:function(e,t,i,n,o,s,r){var a,h,d,l,u,c=1e9,f=e,p=t;for(h=1;h<10;h++)d=.1*h,l=Math.pow(1-d,2)*e+2*d*(1-d)*r.x+Math.pow(d,2)*i,u=Math.pow(1-d,2)*t+2*d*(1-d)*r.y+Math.pow(d,2)*n,0<h&&(c=(a=this._getDistanceToLine(f,p,l,u,o,s))<c?a:c),f=l,p=u;return c}},{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.drawBackground(e,t),this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}}]),n}(),bi=function(){function n(e,t,i){return gt(this,n),kt(this,_t(n).call(this,e,t,i))}return bt(n,yi),yt(n,[{key:"_getDistanceToBezierEdge",value:function(e,t,i,n,o,s,r,a){var h,d,l,u,c,f=1e9,p=e,v=t,g=[0,0,0,0];for(d=1;d<10;d++)l=.1*d,g[0]=Math.pow(1-l,3),g[1]=3*l*Math.pow(1-l,2),g[2]=3*Math.pow(l,2)*(1-l),g[3]=Math.pow(l,3),u=g[0]*e+g[1]*r.x+g[2]*a.x+g[3]*i,c=g[0]*t+g[1]*r.y+g[2]*a.y+g[3]*n,0<d&&(f=(h=this._getDistanceToLine(p,v,u,c,o,s))<f?h:f),p=u,v=c;return f}}]),n}(),_i=function(){function n(e,t,i){return gt(this,n),kt(this,_t(n).call(this,e,t,i))}return bt(n,bi),yt(n,[{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,t,i,n,o=this.from.x-this.to.x,s=this.from.y-this.to.y,r=this.options.smooth.roundness;return i=(Math.abs(o)>Math.abs(s)||!0===this.options.smooth.forceDirection||"horizontal"===this.options.smooth.forceDirection)&&"vertical"!==this.options.smooth.forceDirection?(t=this.from.y,n=this.to.y,e=this.from.x-r*o,this.to.x+r*o):(t=this.from.y-r*s,n=this.to.y+r*s,e=this.from.x,this.to.x),[{x:e,y:t},{x:i,y:n}]}},{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,s,r){var a=xt(6<arguments.length&&void 0!==r?r:this._getViaCoordinates(),2),h=a[0],d=a[1];return this._getDistanceToBezierEdge(e,t,i,n,o,s,h,d)}},{key:"getPoint",value:function(e,t){var i=xt(1<arguments.length&&void 0!==t?t:this._getViaCoordinates(),2),n=i[0],o=i[1],s=e,r=[];return 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),{x:r[0]*this.fromPoint.x+r[1]*n.x+r[2]*o.x+r[3]*this.toPoint.x,y:r[0]*this.fromPoint.y+r[1]*n.y+r[2]*o.y+r[3]*this.toPoint.y}}}]),n}(),wi=function(){function o(e,t,i){var n;return gt(this,o),(n=kt(this,_t(o).call(this,e,t,i)))._boundFunction=function(){n.positionBezierNode()},n.body.emitter.on("_repositionBezierNodes",n._boundFunction),n}return bt(o,yi),yt(o,[{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))}},{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,t){var i,n,o=1<arguments.length&&void 0!==t?t:this.via,s=e;if(this.from===this.to){var r=xt(this._getCircleData(this.from),3),a=r[0],h=r[1],d=r[2],l=2*Math.PI*(1-s);i=a+d*Math.sin(l),n=h+d-d*(1-Math.cos(l))}else i=Math.pow(1-s,2)*this.fromPoint.x+2*s*(1-s)*o.x+Math.pow(s,2)*this.toPoint.x,n=Math.pow(1-s,2)*this.fromPoint.y+2*s*(1-s)*o.y+Math.pow(s,2)*this.toPoint.y;return{x:i,y:n}}},{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)}}]),o}(),ki=function(){function n(e,t,i){return gt(this,n),kt(this,_t(n).call(this,e,t,i))}return bt(n,yi),yt(n,[{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,t,i=void 0,n=void 0,o=this.options.smooth.roundness,s=this.options.smooth.type,r=Math.abs(this.from.x-this.to.x),a=Math.abs(this.from.y-this.to.y);if("discrete"===s||"diagonalCross"===s)e=t=r<=a?o*a:o*r,this.from.x>this.to.x&&(e=-e),this.from.y>=this.to.y&&(t=-t),i=this.from.x+e,n=this.from.y+t,"discrete"===s&&(r<=a?i=r<o*a?this.from.x:i:n=a<o*r?this.from.y:n);else if("straightCross"===s){var h=(1-o)*r,d=(1-o)*a;r<=a?(h=0,this.from.y<this.to.y&&(d=-d)):(this.from.x<this.to.x&&(h=-h),d=0),i=this.to.x+h,n=this.to.y+d}else if("horizontal"===s){var l=(1-o)*r;this.from.x<this.to.x&&(l=-l),i=this.to.x+l,n=this.from.y}else if("vertical"===s){var u=(1-o)*a;this.from.y<this.to.y&&(u=-u),i=this.from.x,n=this.to.y+u}else if("curvedCW"===s){r=this.to.x-this.from.x,a=this.from.y-this.to.y;var c=Math.sqrt(r*r+a*a),f=Math.PI,p=(Math.atan2(a,r)+(.5*o+.5)*f)%(2*f);i=this.from.x+(.5*o+.5)*c*Math.sin(p),n=this.from.y+(.5*o+.5)*c*Math.cos(p)}else if("curvedCCW"===s){r=this.to.x-this.from.x,a=this.from.y-this.to.y;var v=Math.sqrt(r*r+a*a),g=Math.PI,m=(Math.atan2(a,r)+(.5*-o+.5)*g)%(2*g);i=this.from.x+(.5*o+.5)*v*Math.sin(m),n=this.from.y+(.5*o+.5)*v*Math.cos(m)}else{var y,b;y=b=r<=a?o*a:o*r,this.from.x>this.to.x&&(y=-y),this.from.y>=this.to.y&&(b=-b),i=this.from.x+y,n=this.from.y+b,r<=a?i=this.from.x<=this.to.x?this.to.x<i?this.to.x:i:this.to.x>i?this.to.x:i:n=this.from.y>=this.to.y?this.to.y>n?this.to.y:n:this.to.y<n?this.to.y:n}return{x:i,y:n}}},{key:"_findBorderPosition",value:function(e,t,i){var n=2<arguments.length&&void 0!==i?i:{};return this._findBorderPositionBezier(e,t,n.via)}},{key:"_getDistanceToEdge",value:function(e,t,i,n,o,s,r){var a=6<arguments.length&&void 0!==r?r:this._getViaCoordinates();return this._getDistanceToBezierEdge(e,t,i,n,o,s,a)}},{key:"getPoint",value:function(e,t){var i=1<arguments.length&&void 0!==t?t:this._getViaCoordinates(),n=e;return{x:Math.pow(1-n,2)*this.fromPoint.x+2*n*(1-n)*i.x+Math.pow(n,2)*this.toPoint.x,y:Math.pow(1-n,2)*this.fromPoint.y+2*n*(1-n)*i.y+Math.pow(n,2)*this.toPoint.y}}}]),n}(),xi=function(){function n(e,t,i){return gt(this,n),kt(this,_t(n).call(this,e,t,i))}return bt(n,mi),yt(n,[{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),h=(a-e.distanceToBorder(t,o))/a,d={};return d.x=(1-h)*n.x+h*i.x,d.y=(1-h)*n.y+h*i.y,d}},{key:"_getDistanceToEdge",value:function(e,t,i,n,o,s){return this._getDistanceToLine(e,t,i,n,o,s)}}]),n}(),Si=function(){function o(e,t,i,n){if(gt(this,o),void 0===t)throw new Error("No body provided");this.options=z.bridgeObject(i),this.globalOptions=i,this.defaultOptions=n,this.body=t,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 It(this.body,this.options,!0),this.setOptions(e)}return yt(o,[{key:"setOptions",value:function(e){if(e){o.parseOptions(this.options,e,!0,this.globalOptions),void 0!==e.id&&(this.id=e.id),void 0!==e.from&&(this.fromId=e.from),void 0!==e.to&&(this.toId=e.to),void 0!==e.title&&(this.title=e.title),void 0!==e.value&&(e.value=parseFloat(e.value));var t=[e,this.options,this.defaultOptions];this.chooser=Et.choosify("edge",t),this.updateLabelModule(e);var i=this.updateEdgeType();return this._setInteractionWidths(),this.connect(),void 0===e.hidden&&void 0===e.physics||(i=!0),i}}},{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,background:this.options.background.enabled,backgroundColor:this.options.background.color,backgroundSize:this.options.background.size,backgroundDashes:this.options.background.dashes};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 wi&&!0===e.enabled&&"dynamic"===e.type||this.edgeType instanceof _i&&!0===e.enabled&&"cubicBezier"===e.type||this.edgeType instanceof ki&&!0===e.enabled&&"dynamic"!==e.type&&"cubicBezier"!==e.type||this.edgeType instanceof xi&&!1===e.type.enabled)&&(i=!1),!0===i&&(t=this.cleanup())),!0===i?!0===e.enabled?"dynamic"===e.type?(t=!0,this.edgeType=new wi(this.options,this.body,this.labelModule)):"cubicBezier"===e.type?this.edgeType=new _i(this.options,this.body,this.labelModule):this.edgeType=new ki(this.options,this.body,this.labelModule):this.edgeType=new xi(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{var r,a;this.labelModule.pointToSelf=!0;var h=this.options.selfReferenceSize;a=i.shape.width>i.shape.height?(r=i.x+.5*i.shape.width,i.y-h):(r=i.x+h,i.y-.5*i.shape.height),o=this._pointOnCircle(r,a,h,.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();Et.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||0<r&&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,i,n,o){var s=2<arguments.length&&void 0!==i&&i,r=3<arguments.length&&void 0!==n?n:{},a=4<arguments.length&&void 0!==o&&o;if(z.selectiveDeepExtend(["arrowStrikethrough","id","from","hidden","hoverWidth","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","to","title","value","width","font","chosen","widthConstraint"],e,t,s),Et.isValidLabel(t.label)?e.label=t.label:e.label=void 0,z.mergeOptions(e,t,"smooth",r),z.mergeOptions(e,t,"shadow",r),z.mergeOptions(e,t,"background",r),void 0!==t.dashes&&null!==t.dashes?e.dashes=t.dashes:!0===s&&null===t.dashes&&(e.dashes=Object.create(r.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),z.mergeOptions(e.scaling,t.scaling,"label",r.scaling)):!0===s&&null===t.scaling&&(e.scaling=Object.create(r.scaling)),void 0!==t.arrows&&null!==t.arrows)if("string"==typeof t.arrows){var h=t.arrows.toLowerCase();e.arrows.to.enabled=-1!=h.indexOf("to"),e.arrows.middle.enabled=-1!=h.indexOf("middle"),e.arrows.from.enabled=-1!=h.indexOf("from")}else{if("object"!==vt(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));z.mergeOptions(e.arrows,t.arrows,"to",r.arrows),z.mergeOptions(e.arrows,t.arrows,"middle",r.arrows),z.mergeOptions(e.arrows,t.arrows,"from",r.arrows)}else!0===s&&null===t.arrows&&(e.arrows=Object.create(r.arrows));if(void 0!==t.color&&null!==t.color){var d=t.color,l=e.color;if(a)z.deepExtend(l,r.color,!1,s);else for(var u in l)l.hasOwnProperty(u)&&delete l[u];if(z.isString(l))(((l.color=l).highlight=l).hover=l).inherit=!1,void 0===d.opacity&&(l.opacity=1);else{var c=!1;void 0!==d.color&&(l.color=d.color,c=!0),void 0!==d.highlight&&(l.highlight=d.highlight,c=!0),void 0!==d.hover&&(l.hover=d.hover,c=!0),void 0!==d.inherit&&(l.inherit=d.inherit),void 0!==d.opacity&&(l.opacity=Math.min(1,Math.max(0,d.opacity))),!0===c?l.inherit=!1:void 0===l.inherit&&(l.inherit="from")}}else!0===s&&null===t.color&&(e.color=z.bridgeObject(r.color));!0===s&&null===t.font&&(e.font=z.bridgeObject(r.font))}}]),o}(),Di=function(){function o(e,t,i){var n=this;gt(this,o),this.body=e,this.images=t,this.groups=i,this.body.functions.createEdge=this.create.bind(this),this.edgesListeners={add:function(e,t){n.add(t.items)},update:function(e,t){n.update(t.items)},remove:function(e,t){n.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},background:{enabled:!1,color:"rgba(111,111,111,1)",size:10,dashes:!1},smooth:{enabled:!0,type:"dynamic",forceDirection:"none",roundness:.5},title:void 0,width:1,value:void 0},z.deepExtend(this.options,this.defaultOptions),this.bindEventListeners()}return yt(o,[{key:"bindEventListeners",value:function(){var a=this;this.body.emitter.on("_forceDisableDynamicCurves",function(e){var t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];"dynamic"===e&&(e="continuous");var i=!1;for(var n in a.body.edges)if(a.body.edges.hasOwnProperty(n)){var o=a.body.edges[n],s=a.body.data.edges._data[n];if(void 0!==s){var r=s.smooth;void 0!==r&&!0===r.enabled&&"dynamic"===r.type&&(void 0===e?o.setOptions({smooth:!1}):o.setOptions({smooth:{type:e}}),i=!0)}}!0===t&&!0===i&&a.body.emitter.emit("_dataChanged")}),this.body.emitter.on("_dataUpdated",function(){a.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(){z.forEach(a.edgesListeners,function(e,t){a.body.data.edges&&a.body.data.edges.off(t,e)}),delete a.body.functions.createEdge,delete a.edgesListeners.add,delete a.edgesListeners.update,delete a.edgesListeners.remove,delete a.edgesListeners})}},{key:"setOptions",value:function(e){if(void 0!==e){Si.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,t){var i=this,n=1<arguments.length&&void 0!==t&&t,o=this.body.data.edges;if(e instanceof Me||e instanceof Oe)this.body.data.edges=e;else if(Array.isArray(e))this.body.data.edges=new Me,this.body.data.edges.add(e);else{if(e)throw new TypeError("Array or DataSet expected");this.body.data.edges=new Me}if(o&&z.forEach(this.edgesListeners,function(e,t){o.off(t,e)}),this.body.edges={},this.body.data.edges){z.forEach(this.edgesListeners,function(e,t){i.body.data.edges.on(t,e)});var s=this.body.data.edges.getIds();this.add(s,!0)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),!1===n&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(e,t){for(var i=1<arguments.length&&void 0!==t&&t,n=this.body.edges,o=this.body.data.edges,s=0;s<e.length;s++){var r=e[s],a=n[r];a&&a.disconnect();var h=o.get(r,{showInternalIds:!0});n[r]=this.create(h)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),!1===i&&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,t){var i=!(1<arguments.length&&void 0!==t)||t;if(0!==e.length){var n=this.body.edges;z.forEach(e,function(e){var t=n[e];void 0!==t&&t.remove()}),i&&this.body.emitter.emit("_dataChanged")}}},{key:"refresh",value:function(){var n=this;z.forEach(this.body.edges,function(e,t){var i=n.body.data.edges._data[t];void 0!==i&&e.setOptions(i)})}},{key:"create",value:function(e){return new Si(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 o=this,s=[];z.forEach(this.body.edges,function(e,t){var i=o.body.nodes[e.toId],n=o.body.nodes[e.fromId];void 0!==i&&!0===i.isCluster||void 0!==n&&!0===n.isCluster||void 0!==i&&void 0!==n||s.push(t)}),this.remove(s,!1)}},{key:"_addMissingEdges",value:function(){var e=this.body.data.edges;if(null!=e){var i=this.body.edges,n=[];e.forEach(function(e,t){void 0===i[t]&&n.push(t)}),this.add(n,!0)}}}]),o}(),Mi=function(){function n(e,t,i){gt(this,n),this.body=e,this.physicsBody=t,this.barnesHutTree,this.setOptions(i),this.randomSeed=5}return yt(n,[{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&&0<this.physicsBody.physicsNodeIndices.length){var e,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++)0<(e=t[i[s]]).options.mass&&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){var i,n,o;0<e.childrenCount&&(i=e.centerOfMass.x-t.x,n=e.centerOfMass.y-t.y,(o=Math.sqrt(i*i+n*n))*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&&(t=e=.1),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,n=t.length,o=e[t[0]].x,s=e[t[0]].y,r=e[t[0]].x,a=e[t[0]].y,h=1;h<n;h++){var d=e[t[h]],l=d.x,u=d.y;0<d.options.mass&&(l<o&&(o=l),r<l&&(r=l),u<s&&(s=u),a<u&&(a=u))}var c=Math.abs(r-o)-Math.abs(a-s);0<c?(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),m={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(m.root);for(var y=0;y<n;y++)0<(i=e[t[y]]).options.mass&&this._placeInTree(m.root,i);return m}},{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,o=e.children.NW.range;n=o.maxX>t.x?o.maxY>t.y?"NW":"SW":o.maxY>t.y?"NE":"SE",this._placeInRegion(e,t,n)}},{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,n,o,s,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()}}]),n}(),Oi=function(){function n(e,t,i){gt(this,n),this.body=e,this.physicsBody=t,this.setOptions(i)}return yt(n,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e,t,i,n,o,s,r,a,h=this.body.nodes,d=this.physicsBody.physicsNodeIndices,l=this.physicsBody.forces,u=this.options.nodeDistance,c=-2/3/u,f=0;f<d.length-1;f++){r=h[d[f]];for(var p=f+1;p<d.length;p++)e=(a=h[d[p]]).x-r.x,t=a.y-r.y,0===(i=Math.sqrt(e*e+t*t))&&(e=i=.1*Math.random()),i<2*u&&(s=i<.5*u?1:c*i+4/3,n=e*(s/=i),o=t*s,l[r.id].x-=n,l[r.id].y-=o,l[a.id].x+=n,l[a.id].y+=o)}}}]),n}(),Ei=function(){function n(e,t,i){gt(this,n),this.body=e,this.physicsBody=t,this.setOptions(i)}return yt(n,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){var e,t,i,n,o,s,r,a,h,d,l=this.body.nodes,u=this.physicsBody.physicsNodeIndices,c=this.physicsBody.forces,f=this.options.nodeDistance;for(h=0;h<u.length-1;h++)for(r=l[u[h]],d=h+1;d<u.length;d++)if(a=l[u[d]],r.level===a.level){e=a.x-r.x,t=a.y-r.y;s=(i=Math.sqrt(e*e+t*t))<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}}}]),n}(),Ti=function(){function n(e,t,i){gt(this,n),this.body=e,this.physicsBody=t,this.setOptions(i)}return yt(n,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e,t,i,n,o,s=this.physicsBody.physicsEdgeIndices,r=this.body.edges,a=0;a<s.length;a++)!0===(t=r[s[a]]).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,i=t.to,n=t.edgeType.via,o=t.from,this._calculateSpringForce(i,n,.5*e),this._calculateSpringForce(n,o,.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,h=o*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)}}]),n}(),Ci=function(){function n(e,t,i){gt(this,n),this.body=e,this.physicsBody=t,this.setOptions(i)}return yt(n,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e,t,i,n,o,s,r,a,h,d,l=this.body.edges,u=this.physicsBody.physicsEdgeIndices,c=this.physicsBody.physicsNodeIndices,f=this.physicsBody.forces,p=0;p<c.length;p++){var v=c[p];f[v].springFx=0,f[v].springFy=0}for(var g=0;g<u.length;g++)!0===(t=l[u[g]]).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=0===(a=Math.sqrt(i*i+n*n))?.01:a,o=i*(r=this.options.springConstant*(e-a)/a),s=n*r,t.to.level!=t.from.level?(void 0!==f[t.toId]&&(f[t.toId].springFx-=o,f[t.toId].springFy-=s),void 0!==f[t.fromId]&&(f[t.fromId].springFx+=o,f[t.fromId].springFy+=s)):(void 0!==f[t.toId]&&(f[t.toId].x-=.5*o,f[t.toId].y-=.5*s),void 0!==f[t.fromId]&&(f[t.fromId].x+=.5*o,f[t.fromId].y+=.5*s)));r=1;for(var m=0;m<c.length;m++){var y=c[m];h=Math.min(r,Math.max(-r,f[y].springFx)),d=Math.min(r,Math.max(-r,f[y].springFy)),f[y].x+=h,f[y].y+=d}for(var b=0,_=0,w=0;w<c.length;w++){var k=c[w];b+=f[k].x,_+=f[k].y}for(var x=b/c.length,S=_/c.length,D=0;D<c.length;D++){var M=c[D];f[M].x-=x,f[M].y-=S}}}]),n}(),Pi=function(){function n(e,t,i){gt(this,n),this.body=e,this.physicsBody=t,this.setOptions(i)}return yt(n,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e,t,i,n,o=this.body.nodes,s=this.physicsBody.physicsNodeIndices,r=this.physicsBody.forces,a=0;a<s.length;a++){e=-(n=o[s[a]]).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}}]),n}(),Fi=function(){function n(e,t,i){return gt(this,n),kt(this,_t(n).call(this,e,t,i))}return bt(n,Mi),yt(n,[{key:"_calculateForces",value:function(e,t,i,n,o){0===e&&(t=e=.1*Math.random()),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,h=i*r;this.physicsBody.forces[n.id].x+=a,this.physicsBody.forces[n.id].y+=h}}]),n}(),Ni=function(){function n(e,t,i){return gt(this,n),kt(this,_t(n).call(this,e,t,i))}return bt(n,Pi),yt(n,[{key:"_calculateForces",value:function(e,t,i,n,o){if(0<e){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}}}]),n}(),Ii=function(){function t(e){gt(this,t),this.body=e,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},z.extend(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}return yt(t,[{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,z.selectiveNotDeepExtend(["stabilization"],this.options,e),z.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 Fi(this.body,this.physicsBody,e),this.edgesSolver=new Ti(this.body,this.physicsBody,e),this.gravitySolver=new Ni(this.body,this.physicsBody,e)):("repulsion"===this.options.solver?(e=this.options.repulsion,this.nodesSolver=new Oi(this.body,this.physicsBody,e),this.edgesSolver=new Ti(this.body,this.physicsBody,e)):"hierarchicalRepulsion"===this.options.solver?(e=this.options.hierarchicalRepulsion,this.nodesSolver=new Ei(this.body,this.physicsBody,e),this.edgesSolver=new Ci(this.body,this.physicsBody,e)):(e=this.options.barnesHut,this.nodesSolver=new Mi(this.body,this.physicsBody,e),this.edgesSolver=new Ti(this.body,this.physicsBody,e)),this.gravitySolver=new Pi(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(e){var t=!(0<arguments.length&&void 0!==e)||e;(this.stabilized=!0)===t&&this._emitStabilized(),void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),!(this.viewFunction=void 0)===t&&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(e){var t=this,i=0<arguments.length&&void 0!==e?e:this.stabilizationIterations;(1<this.stabilizationIterations||!0===this.startedStabilization)&&setTimeout(function(){t.body.emitter.emit("stabilized",{iterations:i}),t.startedStabilization=!1,t.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=Object.keys(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,t,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,.3<Math.sqrt(Math.pow(e,2)+Math.pow(t,2))))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=0<e?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})===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(e){var t=this,i=0<arguments.length&&void 0!==e?e:this.options.stabilization.iterations;"number"!=typeof i&&(i=this.options.stabilization.iterations,console.log("The stabilize method needs a numeric amount of iterations. Switching to default: ",i)),0!==this.physicsBody.physicsNodeIndices.length?(this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=i,!0===this.options.stabilization.onlyDynamicEdges&&this._freezeNodes(),this.stabilizationIterations=0,setTimeout(function(){return t._stabilizationBatch()},0)):this.ready=!0}},{key:"_startStabilizing",value:function(){return!0!==this.startedStabilization&&(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0)}},{key:"_stabilizationBatch",value:function(){function e(){return!1===i.stabilized&&i.stabilizationIterations<i.targetIterations}function t(){i.body.emitter.emit("stabilizationProgress",{iterations:i.stabilizationIterations,total:i.targetIterations})}var i=this;this._startStabilizing()&&t();for(var n=0;e()&&n<this.options.stabilization.updateInterval;)this.physicsTick(),n++;t(),e()?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,h=z.HSVToHex((180-180*Math.min(1,Math.max(0,.03*s)))/360,1,1),d={x:n.x+20*o.x,y:n.y+20*o.y};e.lineWidth=r,e.strokeStyle=h,e.beginPath(),e.moveTo(n.x,n.y),e.lineTo(d.x,d.y),e.stroke();var l=Math.atan2(o.y,o.x);e.fillStyle=h,gi.draw(e,{type:"arrow",point:d,angle:l,length:a}),e.fill()}}}]),t}(),Yi=function(){function e(){gt(this,e)}return yt(e,null,[{key:"getRange",value:function(e,t){var i,n=1<arguments.length&&void 0!==t?t:[],o=1e9,s=-1e9,r=1e9,a=-1e9;if(0<n.length)for(var h=0;h<n.length;h++)r>(i=e[n[h]]).shape.boundingBox.left&&(r=i.shape.boundingBox.left),a<i.shape.boundingBox.right&&(a=i.shape.boundingBox.right),o>i.shape.boundingBox.top&&(o=i.shape.boundingBox.top),s<i.shape.boundingBox.bottom&&(s=i.shape.boundingBox.bottom);return 1e9===r&&-1e9===a&&1e9===o&&-1e9===s&&(a=r=s=o=0),{minX:r,maxX:a,minY:o,maxY:s}}},{key:"getRangeCore",value:function(e,t){var i,n=1<arguments.length&&void 0!==t?t:[],o=1e9,s=-1e9,r=1e9,a=-1e9;if(0<n.length)for(var h=0;h<n.length;h++)r>(i=e[n[h]]).x&&(r=i.x),a<i.x&&(a=i.x),o>i.y&&(o=i.y),s<i.y&&(s=i.y);return 1e9===r&&-1e9===a&&1e9===o&&-1e9===s&&(a=r=s=o=0),{minX:r,maxX:a,minY:o,maxY:s}}},{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?(z.deepExtend(i,e.options,!0),i.x=e.x,i.y=e.y,i.amountOfConnections=e.edges.length):z.deepExtend(i,e.options,!0),i}}]),e}(),Ri=function(){function a(e,t,i,n,o,s){var r;return gt(this,a),(r=kt(this,_t(a).call(this,e,t,i,n,o,s))).isCluster=!0,r.containedNodes={},r.containedEdges={},r}return bt(a,ii),yt(a,[{key:"_openChildCluster",value:function(e){var n=this,t=this.body.nodes[e];if(void 0===this.containedNodes[e])throw new Error("node with id: "+e+" not in current cluster");if(!t.isCluster)throw new Error("node with id: "+e+" is not a cluster");delete this.containedNodes[e],z.forEach(t.edges,function(e){delete n.containedEdges[e.id]}),z.forEach(t.containedNodes,function(e,t){n.containedNodes[t]=e}),t.containedNodes={},z.forEach(t.containedEdges,function(e,t){n.containedEdges[t]=e}),t.containedEdges={},z.forEach(t.edges,function(i){z.forEach(n.edges,function(t){var e=t.clusteringEdgeReplacingIds.indexOf(i.id);-1!==e&&(z.forEach(i.clusteringEdgeReplacingIds,function(e){t.clusteringEdgeReplacingIds.push(e),n.body.edges[e].edgeReplacedById=t.id}),t.clusteringEdgeReplacingIds.splice(e,1))})}),t.edges=[]}}]),a}(),zi=function(){function i(e){var t=this;gt(this,i),this.body=e,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},z.extend(this.options,this.defaultOptions),this.body.emitter.on("_resetData",function(){t.clusteredNodes={},t.clusteredEdges={}})}return yt(i,[{key:"clusterByHubsize",value:function(e,t){void 0===e?e=this._getHubSize():"object"===vt(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(e,t){var i=this,n=0<arguments.length&&void 0!==e?e:{},o=!(1<arguments.length&&void 0!==t)||t;if(void 0===n.joinCondition)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");n=this._checkOptions(n);var s={},r={};z.forEach(this.body.nodes,function(e,t){e.options&&!0===n.joinCondition(e.options)&&(s[t]=e,z.forEach(e.edges,function(e){void 0===i.clusteredEdges[e.id]&&(r[e.id]=e)}))}),this._cluster(s,r,n,o)}},{key:"clusterByEdgeCount",value:function(u,c,e){var f=this,t=!(2<arguments.length&&void 0!==e)||e;c=this._checkOptions(c);for(var p,v,g,m=[],y={},i=function(e){var i={},t={},n=f.body.nodeIndices[e],o=f.body.nodes[n];if(void 0===y[n]){v=[];for(var s=g=0;s<o.edges.length;s++)p=o.edges[s],void 0===f.clusteredEdges[p.id]&&(p.toId!==p.fromId&&g++,v.push(p));if(g===u){b=function(e){if(void 0===c.joinCondition||null===c.joinCondition)return!0;var t=Yi.cloneOptions(e);return c.joinCondition(t)};for(var r=!0,a=0;a<v.length;a++){p=v[a];var h=f._getConnectedId(p,n);if(!b(o)){r=!1;break}t[p.id]=p,i[n]=o,i[h]=f.body.nodes[h],y[n]=!0}if(0<Object.keys(i).length&&0<Object.keys(t).length&&!0===r)if(void 0!==(_=function(){for(var e=0;e<m.length;++e)for(var t in i)if(void 0!==m[e].nodes[t])return m[e]}())){for(var d in i)void 0===_.nodes[d]&&(_.nodes[d]=i[d]);for(var l in t)void 0===_.edges[l]&&(_.edges[l]=t[l])}else m.push({nodes:i,edges:t})}}},n=0;n<this.body.nodeIndices.length;n++){var b,_;i(n)}for(n=0;n<m.length;n++)this._cluster(m[n].nodes,m[n].edges,c,!1);!0===t&&this.body.emitter.emit("_dataChanged")}},{key:"clusterOutliers",value:function(e,t){var i=!(1<arguments.length&&void 0!==t)||t;this.clusterByEdgeCount(1,e,i)}},{key:"clusterBridges",value:function(e,t){var i=!(1<arguments.length&&void 0!==t)||t;this.clusterByEdgeCount(2,e,i)}},{key:"clusterByConnection",value:function(e,t,i){var n=!(2<arguments.length&&void 0!==i)||i;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];void 0===(t=this._checkOptions(t,o)).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 s={},r={},a=o.id,h=Yi.cloneOptions(o);s[a]=o;for(var d=0;d<o.edges.length;d++){var l=o.edges[d];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,s[u]=this.body.nodes[u];else{var c=Yi.cloneOptions(this.body.nodes[u]);!0===t.joinCondition(h,c)&&(r[l.id]=l,s[u]=this.body.nodes[u])}else r[l.id]=l}}var f=Object.keys(s).map(function(e){return s[e].id});for(p in s)if(s.hasOwnProperty(p))for(var p=s[p],v=0;v<p.edges.length;v++){var g=p.edges[v];-1<f.indexOf(this._getConnectedId(g,p.id))&&(r[g.id]=g)}this._cluster(s,r,t,n)}},{key:"_createClusterEdges",value:function(e,t,i,n){for(var o,s,r,a,h,d,l=Object.keys(e),u=[],c=0;c<l.length;c++){r=e[s=l[c]];for(var f=0;f<r.edges.length;f++)o=r.edges[f],void 0===this.clusteredEdges[o.id]&&(o.toId==o.fromId?t[o.id]=o:d=o.toId==s?(a=i.id,h=o.fromId):(a=o.toId,h=i.id,a),void 0===e[d]&&u.push({edge:o,fromId:h,toId:a}))}for(var p=[],v=function(e){for(var t=0;t<p.length;t++){var i=p[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},g=0;g<u.length;g++){var m=u[g],y=m.edge,b=v(m);null===b?(b=this._createClusteredEdge(m.fromId,m.toId,y,n),p.push(b)):b.clusteringEdgeReplacingIds.push(y.id),this.body.edges[y.id].edgeReplacedById=b.id,this._backupEdgeOptions(y),y.setOptions({physics:!1})}}},{key:"_checkOptions",value:function(e){var t=0<arguments.length&&void 0!==e?e:{};return void 0===t.clusterEdgeProperties&&(t.clusterEdgeProperties={}),void 0===t.clusterNodeProperties&&(t.clusterNodeProperties={}),t}},{key:"_cluster",value:function(e,t,i,n){var o=!(3<arguments.length&&void 0!==n)||n,s=[];for(var r in e)e.hasOwnProperty(r)&&void 0!==this.clusteredNodes[r]&&s.push(r);for(var a=0;a<s.length;++a)delete e[s[a]];if(0!=Object.keys(e).length&&(1!=Object.keys(e).length||1==i.clusterNodeProperties.allowSingleNodeCluster)){var h=z.deepExtend({},i.clusterNodeProperties);if(void 0!==i.processProperties){var d=[];for(var l in e)if(e.hasOwnProperty(l)){var u=Yi.cloneOptions(e[l]);d.push(u)}var c=[];for(var f in t)if(t.hasOwnProperty(f)&&"clusterEdge:"!==f.substr(0,12)){var p=Yi.cloneOptions(t[f],"edge");c.push(p)}if(!(h=i.processProperties(h,d,c)))throw new Error("The processProperties function does not return properties!")}void 0===h.id&&(h.id="cluster:"+z.randomUUID());var v=h.id;void 0===h.label&&(h.label="cluster");var g=void 0;void 0===h.x&&(g=this._getClusterPosition(e),h.x=g.x),void 0===h.y&&(void 0===g&&(g=this._getClusterPosition(e)),h.y=g.y),h.id=v;var m=this.body.functions.createNode(h,Ri);m.containedNodes=e,m.containedEdges=t,m.clusterEdgeProperties=i.clusterEdgeProperties,this.body.nodes[h.id]=m,this._clusterEdges(e,t,h,i.clusterEdgeProperties),!(h.id=void 0)===o&&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,i=Object.keys(e),n=e[i[0]].x,o=e[i[0]].x,s=e[i[0]].y,r=e[i[0]].y,a=1;a<i.length;a++)n=(t=e[i[a]]).x<n?t.x:n,o=t.x>o?t.x:o,s=t.y<s?t.y:s,r=t.y>r?t.y:r;return{x:.5*(n+o),y:.5*(s+r)}}},{key:"openCluster",value:function(e,t,i){var n=!(2<arguments.length&&void 0!==i)||i;if(void 0===e)throw new Error("No clusterNodeId supplied to openCluster.");var o=this.body.nodes[e];if(void 0===o)throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(!0!==o.isCluster||void 0===o.containedNodes||void 0===o.containedEdges)throw new Error("The node:"+e+" is not a valid cluster.");var s=this.findNode(e),r=s.indexOf(e)-1;if(0<=r){var a=s[r];return this.body.nodes[a]._openChildCluster(e),delete this.body.nodes[e],void(!0===n&&this.body.emitter.emit("_dataChanged"))}var h=o.containedNodes,d=o.containedEdges;if(void 0!==t&&void 0!==t.releaseFunction&&"function"==typeof t.releaseFunction){var l={},u={x:o.x,y:o.y};for(var c in h)if(h.hasOwnProperty(c)){var f=this.body.nodes[c];l[c]={x:f.x,y:f.y}}var p=t.releaseFunction(u,l);for(var v in h)if(h.hasOwnProperty(v)){var g=this.body.nodes[v];void 0!==p[v]&&(g.x=void 0===p[v].x?o.x:p[v].x,g.y=void 0===p[v].y?o.y:p[v].y)}}else z.forEach(h,function(e){!1===e.options.fixed.x&&(e.x=o.x),!1===e.options.fixed.y&&(e.y=o.y)});for(var m in h)if(h.hasOwnProperty(m)){var y=this.body.nodes[m];y.vx=o.vx,y.vy=o.vy,y.setOptions({physics:!0}),delete this.clusteredNodes[m]}for(var b=[],_=0;_<o.edges.length;_++)b.push(o.edges[_]);for(var w=0;w<b.length;w++){for(var k=b[w],x=this._getConnectedId(k,e),S=this.clusteredNodes[x],D=0;D<k.clusteringEdgeReplacingIds.length;D++){var M=k.clusteringEdgeReplacingIds[D],O=this.body.edges[M];if(void 0!==O)if(void 0!==S){var E=this.body.nodes[S.clusterId];delete d[(E.containedEdges[O.id]=O).id];var T=O.fromId,C=O.toId;O.toId==x?C=S.clusterId:T=S.clusterId,this._createClusteredEdge(T,C,O,E.clusterEdgeProperties,{hidden:!1,physics:!0})}else this._restoreEdge(O)}k.remove()}for(var P in d)d.hasOwnProperty(P)&&this._restoreEdge(d[P]);delete this.body.nodes[e],!0===n&&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=[],n=0;void 0!==this.clusteredNodes[e]&&n<100;){if(void 0===(t=this.body.nodes[e]))return[];i.push(t.id),e=this.clusteredNodes[e].clusterId,n++}return void 0===(t=this.body.nodes[e])?[]:(i.push(t.id),i.reverse(),i)}},{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;0<t.length&&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 h=0;h<a.length;++h){var d=a[h];-1===t.indexOf(a)&&-1===i.indexOf(a)&&t.push(d)}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;var r=(t/=i)-Math.pow(e,2),a=Math.sqrt(r),h=Math.floor(e+2*a);return n<h&&(h=n),h}},{key:"_createClusteredEdge",value:function(e,t,i,n,o){var s=Yi.cloneOptions(i,"edge");z.deepExtend(s,n),s.from=e,s.to=t,s.id="clusterEdge:"+z.randomUUID(),void 0!==o&&z.deepExtend(s,o);var r=this.body.functions.createEdge(s);return r.clusteringEdgeReplacingIds=[i.id],r.connect(),this.body.edges[r.id]=r}},{key:"_clusterEdges",value:function(e,t,i,n){if(t instanceof Si){var o=t,s={};s[o.id]=o,t=s}if(e instanceof ii){var r=e,a={};a[r.id]=r,e=a}if(null==i)throw new Error("_clusterEdges: parameter clusterNode required");for(var h in void 0===n&&(n=i.clusterEdgeProperties),this._createClusterEdges(e,t,i,n),t)if(t.hasOwnProperty(h)&&void 0!==this.body.edges[h]){var d=this.body.edges[h];this._backupEdgeOptions(d),d.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 z.forEach(e,function(e){t(e)&&i.push(e)}),i}},{key:"_updateState",value:function(){function t(t){z.forEach(s.body.nodes,function(e){!0===e.isCluster&&t(e)})}var e,s=this,i=[],r={};for(e in this.clusteredNodes){if(this.clusteredNodes.hasOwnProperty(e))void 0===this.body.nodes[e]&&i.push(e)}t(function(e){for(var t=0;t<i.length;t++)delete e.containedNodes[i[t]]});for(var n=0;n<i.length;n++)delete this.clusteredNodes[i[n]];z.forEach(this.clusteredEdges,function(e){var t=s.body.edges[e];void 0!==t&&t.endPointsValid()||(r[e]=e)}),t(function(e){z.forEach(e.containedEdges,function(e,t){e.endPointsValid()||r[t]||(r[t]=t)})}),z.forEach(this.body.edges,function(e,t){var i=!0,n=e.clusteringEdgeReplacingIds;if(void 0!==n){var o=0;z.forEach(n,function(e){var t=s.body.edges[e];void 0!==t&&t.endPointsValid()&&(o+=1)}),i=0<o}e.endPointsValid()&&i||(r[t]=t)}),t(function(n){z.forEach(r,function(i){delete n.containedEdges[i],z.forEach(n.edges,function(e,t){e.id!==i?e.clusteringEdgeReplacingIds=s._filter(e.clusteringEdgeReplacingIds,function(e){return!r[e]}):n.edges[t]=null}),n.edges=s._filter(n.edges,function(e){return null!==e})})}),z.forEach(r,function(e){delete s.clusteredEdges[e]}),z.forEach(r,function(e){delete s.body.edges[e]});var o=Object.keys(this.body.edges);z.forEach(o,function(e){var t=s.body.edges[e],i=s._isClusteredNode(t.fromId)||s._isClusteredNode(t.toId);if(i!==s._isClusteredEdge(t.id)){if(!i)throw new Error("remove edge from clustering not implemented!");var n=s._getClusterNodeForNode(t.fromId);void 0!==n&&s._clusterEdges(s.body.nodes[t.fromId],t,n);var o=s._getClusterNodeForNode(t.toId);void 0!==o&&s._clusterEdges(s.body.nodes[t.toId],t,o)}});for(var a=!1,h=!0,d=function(){var n=[];t(function(e){var t=Object.keys(e.containedNodes).length,i=!0===e.options.allowSingleNodeCluster;(i&&t<1||!i&&t<2)&&n.push(e.id)});for(var e=0;e<n.length;++e)s.openCluster(n[e],{},!1);h=0<n.length,a=a||h};h;)d();a&&this._updateState()}},{key:"_isClusteredNode",value:function(e){return void 0!==this.clusteredNodes[e]}},{key:"_isClusteredEdge",value:function(e){return void 0!==this.clusteredEdges[e]}}]),i}();var Bi,Ai=function(){function i(e,t){gt(this,i),function(){var e;void 0!==window&&(e=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame),window.requestAnimationFrame=void 0===e?function(e){e()}:e}(),this.body=e,this.canvas=t,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},z.extend(this.options,this.defaultOptions),this._determineBrowserMethod(),this.bindEventListeners()}return yt(i,[{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=0<e.renderRequests,e.renderTimer=void 0}),this.body.emitter.on("destroy",function(){e.renderRequests=0,e.allowRedraw=!1,!(e.renderingActive=!1)===e.requiresTimeout?clearTimeout(e.renderTimer):window.cancelAnimationFrame(e.renderTimer),e.body.emitter.off()})}},{key:"setOptions",value:function(e){if(void 0!==e){z.selectiveDeepExtend(["hideEdgesOnDrag","hideNodesOnDrag"],this.options,e)}}},{key:"_requestNextFrame",value:function(e,t){if("undefined"!=typeof window){var i,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)===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(e){var t=0<arguments.length&&void 0!==e&&e;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 i=this.canvas.getContext(),n=this.canvas.frame.canvas.clientWidth,o=this.canvas.frame.canvas.clientHeight;if(i.clearRect(0,0,n,o),0===this.canvas.frame.clientWidth)return;i.save(),i.translate(this.body.view.translation.x,this.body.view.translation.y),i.scale(this.body.view.scale,this.body.view.scale),i.beginPath(),this.body.emitter.emit("beforeDrawing",i),i.closePath(),!1===t&&(!1===this.dragging||!0===this.dragging&&!1===this.options.hideEdgesOnDrag)&&this._drawEdges(i),(!1===this.dragging||!0===this.dragging&&!1===this.options.hideNodesOnDrag)&&this._drawNodes(i,t),i.beginPath(),this.body.emitter.emit("afterDrawing",i),i.closePath(),i.restore(),!0===t&&i.clearRect(0,0,n,o)}}},{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,i=this.body.nodes;for(var n in i)i.hasOwnProperty(n)&&((t=i[n]).resize(e),t.updateBoundingBox(e,t.selected));e.restore()}},{key:"_drawNodes",value:function(e,t){for(var i,n=1<arguments.length&&void 0!==t&&t,o=this.body.nodes,s=this.body.nodeIndices,r=[],a=this.canvas.DOMtoCanvas({x:-20,y:-20}),h=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+20,y:this.canvas.frame.canvas.clientHeight+20}),d={top:a.y,left:a.x,bottom:h.y,right:h.x},l=0;l<s.length;l++)(i=o[s[l]]).isSelected()?r.push(s[l]):!0===n?i.draw(e):!0===i.isBoundingBoxOverlappingWith(d)?i.draw(e):i.updateBoundingBox(e,i.selected);for(var u=0;u<r.length;u++)(i=o[r[u]]).draw(e)}},{key:"_drawEdges",value:function(e){for(var t,i=this.body.edges,n=this.body.edgeIndices,o=0;o<n.length;o++)!0===(t=i[n[o]]).connected&&t.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}}]),i}(),Li=t(function(e,t){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}}),Hi=(Li.onTouch,Li.onRelease,Li.offTouch,Li.offRelease,Li.disablePreventDefaultVertically,function(){function t(e){gt(this,t),this.body=e,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%"},z.extend(this.options,this.defaultOptions),this.bindEventListeners()}return yt(t,[{key:"bindEventListeners",value:function(){var t=this;this.body.emitter.once("resize",function(e){0!==e.width&&(t.body.view.translation.x=.5*e.width),0!==e.height&&(t.body.view.translation.y=.5*e.height)}),this.body.emitter.on("setSize",this.setSize.bind(this)),this.body.emitter.on("destroy",function(){t.hammerFrame.destroy(),t.hammer.destroy(),t._cleanUp()})}},{key:"setOptions",value:function(e){var t=this;if(void 0!==e){z.selectiveDeepExtend(["width","height","autoResize"],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),z.addEventListener(window,"resize",this.resizeFunction))}},{key:"_cleanUp",value:function(){void 0!==this.resizeTimer&&clearInterval(this.resizeTimer),z.removeEventListener(window,"resize",this.resizeFunction),this.resizeFunction=void 0}},{key:"_onResize",value:function(){this.setSize(),this.body.emitter.emit("_redraw")}},{key:"_getCameraState",value:function(e){var t=0<arguments.length&&void 0!==e?e:this.pixelRatio;!0===this.initialized&&(this.cameraState.previousWidth=this.frame.canvas.width/t,this.cameraState.previousHeight=this.frame.canvas.height/t,this.cameraState.scale=this.body.view.scale,this.cameraState.position=this.DOMtoCanvas({x:.5*this.frame.canvas.width/t,y:.5*this.frame.canvas.height/t}))}},{key:"_setCameraState",value:function(){if(void 0!==this.cameraState.scale&&0!==this.frame.canvas.clientWidth&&0!==this.frame.canvas.clientHeight&&0!==this.pixelRatio&&0<this.cameraState.previousWidth){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=n.x-this.cameraState.position.x,s=n.y-this.cameraState.position.y;this.body.view.translation.x+=o*this.body.view.scale,this.body.view.translation.y+=s*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 t=this;void 0!==this.hammer&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new ut(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:ut.DIRECTION_ALL}),Li.onTouch(this.hammer,function(e){t.body.eventListeners.onTouch(e)}),this.hammer.on("tap",function(e){t.body.eventListeners.onTap(e)}),this.hammer.on("doubletap",function(e){t.body.eventListeners.onDoubleTap(e)}),this.hammer.on("press",function(e){t.body.eventListeners.onHold(e)}),this.hammer.on("panstart",function(e){t.body.eventListeners.onDragStart(e)}),this.hammer.on("panmove",function(e){t.body.eventListeners.onDrag(e)}),this.hammer.on("panend",function(e){t.body.eventListeners.onDragEnd(e)}),this.hammer.on("pinch",function(e){t.body.eventListeners.onPinch(e)}),this.frame.canvas.addEventListener("mousewheel",function(e){t.body.eventListeners.onMouseWheel(e)}),this.frame.canvas.addEventListener("DOMMouseScroll",function(e){t.body.eventListeners.onMouseWheel(e)}),this.frame.canvas.addEventListener("mousemove",function(e){t.body.eventListeners.onMouseMove(e)}),this.frame.canvas.addEventListener("contextmenu",function(e){t.body.eventListeners.onContext(e)}),this.hammerFrame=new ut(this.frame),Li.onRelease(this.hammerFrame,function(e){t.body.eventListeners.onRelease(e)})}},{key:"setSize",value:function(e,t){var i=0<arguments.length&&void 0!==e?e:this.options.width,n=1<arguments.length&&void 0!==t?t:this.options.height;i=this._prepareValue(i),n=this._prepareValue(n);var o=!1,s=this.frame.canvas.width,r=this.frame.canvas.height,a=this.pixelRatio;if(this._setPixelRatio(),i!=this.options.width||n!=this.options.height||this.frame.style.width!=i||this.frame.style.height!=n)this._getCameraState(a),this.frame.style.width=i,this.frame.style.height=n,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=i,this.options.height=n,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},o=!0;else{var h=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),d=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);this.frame.canvas.width===h&&this.frame.canvas.height===d||this._getCameraState(a),this.frame.canvas.width!==h&&(this.frame.canvas.width=h,o=!0),this.frame.canvas.height!==d&&(this.frame.canvas.height=d,o=!0)}return!0===o&&(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(s/this.pixelRatio),oldHeight:Math.round(r/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,o}},{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)}}}]),t}()),ji=function(){function n(e,t){var i=this;gt(this,n),this.body=e,this.canvas=t,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(){i.body.emitter.emit("_stopRendering")}),this.body.emitter.on("unlockNode",this.releaseNode.bind(this))}return yt(n,[{key:"setOptions",value:function(e){var t=0<arguments.length&&void 0!==e?e:{};this.options=t}},{key:"fit",value:function(e,t){var i,n,o=0<arguments.length&&void 0!==e?e:{nodes:[]},s=1<arguments.length&&void 0!==t&&t;if(void 0!==(o=Object.assign({},o)).nodes&&0!==o.nodes.length||(o.nodes=this.body.nodeIndices),!0===s){var r=0;for(var a in this.body.nodes){if(this.body.nodes.hasOwnProperty(a))!0===this.body.nodes[a].predefinedPosition&&(r+=1)}if(r>.5*this.body.nodeIndices.length)return void this.fit(o,!1);i=Yi.getRange(this.body.nodes,o.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=Yi.getRange(this.body.nodes,o.nodes);var h=1.1*Math.abs(i.maxX-i.minX),d=1.1*Math.abs(i.maxY-i.minY),l=this.canvas.frame.canvas.clientWidth/h,u=this.canvas.frame.canvas.clientHeight/d;n=l<=u?l:u}1<n?n=1:0===n&&(n=1);var c={position:Yi.findCenter(i),scale:n,animation:o.animation};this.moveTo(c)}},{key:"focus",value:function(e,t){var i=1<arguments.length&&void 0!==t?t:{};if(void 0!==this.body.nodes[e]){var n={x:this.body.nodes[e].x,y:this.body.nodes[e].y};i.position=n,i.lockedOnNode=e,this.moveTo(i)}else console.log("Node: "+e+" cannot be found.")}},{key:"moveTo",value:function(e){void 0!==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)):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=t.x-e.position.x,n=t.y-e.position.y;this.targetTranslation={x:this.sourceTranslation.x+i*this.targetScale+e.offset.x,y:this.sourceTranslation.y+n*this.targetScale+e.offset.y},0===e.animation.duration?null!=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=this.body.nodes[this.lockedOnNodeId].x,t=this.body.nodes[this.lockedOnNodeId].y,i=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),n=i.x-e,o=i.y-t,s=this.body.view.translation,r={x:s.x+n*this.body.view.scale+this.lockedOnNodeOffset.x,y:s.y+o*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=r}},{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(e){var t=0<arguments.length&&void 0!==e&&e;this.easingTime+=this.animationSpeed,this.easingTime=!0===t?1:this.easingTime;var i=z.easingFunctions[this.animationEasingFunction](this.easingTime);this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*i,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*i,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*i},1<=this.easingTime&&(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,null!=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})}}]),n}(),Wi=function(){function n(e,t){var i=this;gt(this,n),this.body=e,this.canvas=t,this.iconsCreated=!1,this.navigationHammers=[],this.boundFunctions={},this.touchTime=0,this.activated=!1,this.body.emitter.on("activate",function(){i.activated=!0,i.configureKeyboardBindings()}),this.body.emitter.on("deactivate",function(){i.activated=!1,i.configureKeyboardBindings()}),this.body.emitter.on("destroy",function(){void 0!==i.keycharm&&i.keycharm.destroy()}),this.options={}}return yt(n,[{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 ut(this.navigationDOM[t[n]]);"_fit"===i[n]?Li.onTouch(o,this._fit.bind(this)):Li.onTouch(o,this.bindToRedraw.bind(this,i[n])),this.navigationHammers.push(o)}var s=new ut(this.canvas.frame);Li.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(){700<(new Date).valueOf()-this.touchTime&&(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=ht({container:window,preventDefault:!0}):this.keycharm=ht({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")))}}]),n}(),Vi=function(){function i(e,t){gt(this,i),this.container=e,this.overflowMethod=t||"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 yt(i,[{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,h=!0;this.y-t<this.padding&&(h=!1),this.x+i>o-this.padding&&(a=!0),s=a?this.x-i:this.x,r=h?this.y-t:this.y}else(r=this.y-t)+t+this.padding>n&&(r=n-t-this.padding),r<this.padding&&(r=this.padding),(s=this.x)+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)}}]),i}(),Ui=function(){function n(e,t,i){gt(this,n),this.body=e,this.canvas=t,this.selectionHandler=i,this.navigationHandler=new Wi(e,t),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,zoomSpeed:1},z.extend(this.options,this.defaultOptions),this.bindEventListeners()}return yt(n,[{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){z.selectiveNotDeepExtend(["hideEdgesOnDrag","hideNodesOnDrag","keyboard","multiselect","selectable","selectConnectedEdges"],this.options,e),z.mergeOptions(this.options,e,"keyboard"),e.tooltip&&(z.extend(this.options.tooltip,e.tooltip),e.tooltip.color&&(this.options.tooltip.color=z.parseColor(e.tooltip.color)))}this.navigationHandler.setOptions(this.options)}},{key:"getPointer",value:function(e){return{x:e.x-z.getAbsoluteLeft(this.canvas.frame.canvas),y:e.y-z.getAbsoluteTop(this.canvas.frame.canvas)}}},{key:"onTouch",value:function(e){50<(new Date).valueOf()-this.touchTime&&(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(10<(new Date).valueOf()-this.touchTime){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,i){var n=2<arguments.length&&void 0!==i&&i,o=this.selectionHandler.getSelection(),s=!1;s=!0===n?this.selectionHandler.selectAdditionalOnPoint(e):this.selectionHandler.selectOnPoint(e);var r=this.selectionHandler.getSelection(),a=this._determineDifference(o,r),h=this._determineDifference(r,o);0<a.edges.length&&(this.selectionHandler._generateClickEvent("deselectEdge",t,e,o),s=!0),0<a.nodes.length&&(this.selectionHandler._generateClickEvent("deselectNode",t,e,o),s=!0),0<h.nodes.length&&(this.selectionHandler._generateClickEvent("selectNode",t,e),s=!0),0<h.edges.length&&(this.selectionHandler._generateClickEvent("selectEdge",t,e),s=!0),!0===s&&this.selectionHandler._generateClickEvent("select",t,e)}},{key:"_determineDifference",value:function(e,t){function i(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=z.extend({},this.body.view.translation),(this.drag.nodeId=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 i=this;if(!0!==this.drag.pinched){this.body.emitter.emit("unlockNode");var t=this.getPointer(e.center),n=this.drag.selection;if(n&&n.length&&!0===this.options.dragNodes){this.selectionHandler._generateClickEvent("dragging",e,t);var o=t.x-this.drag.pointer.x,s=t.y-this.drag.pointer.y;n.forEach(function(e){var t=e.node;!1===e.xFixed&&(t.x=i.canvas._XconvertDOMtoCanvas(i.canvas._XconvertCanvasToDOM(e.x)+o)),!1===e.yFixed&&(t.y=i.canvas._YconvertDOMtoCanvas(i.canvas._YconvertCanvasToDOM(e.y)+s))}),this.body.emitter.emit("startSimulation")}else if(!0===this.options.dragView){if(this.selectionHandler._generateClickEvent("dragging",e,t,void 0,!0),void 0===this.drag.pointer)return void this.onDragStart(e);var r=t.x-this.drag.pointer.x,a=t.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),10<e&&(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},null!=n){var h=this.canvas.canvasToDOM(n);this.drag.pointer.x=h.x,this.drag.pointer.y=h.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*(this.options.zoomSpeed/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,h=this.body.nodeIndices,d=this.body.nodes,l=[],u=0;u<h.length;u++)!0===(a=d[h[u]]).isOverlappingWith(n)&&void 0!==a.getTitle()&&l.push(h[u]);0<l.length&&(this.popupObj=d[l[l.length-1]],s=!0)}if(void 0===this.popupObj&&!1===s){for(var c,f=this.body.edgeIndices,p=this.body.edges,v=[],g=0;g<f.length;g++)!0===(c=p[f[g]]).isOverlappingWith(n)&&!0===c.connected&&void 0!==c.getTitle()&&v.push(f[g]);0<v.length&&(this.popupObj=p[v[v.length-1]],r="edge")}void 0!==this.popupObj?this.popupObj.id!==o&&(void 0===this.popup&&(this.popup=new Vi(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"))}}]),n}(),Gi=function(){function n(e,t){var i=this;gt(this,n),this.body=e,this.canvas=t,this.selectionObj={nodes:[],edges:[]},this.hoverObj={nodes:{},edges:{}},this.options={},this.defaultOptions={multiselect:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0},z.extend(this.options,this.defaultOptions),this.body.emitter.on("_dataChanged",function(){i.updateSelection()})}return yt(n,[{key:"setOptions",value:function(e){if(void 0!==e){z.selectiveDeepExtend(["multiselect","hoverConnectedEdges","selectable","selectConnectedEdges"],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)===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,o){var s=4<arguments.length&&void 0!==o&&o,r=this._initBaseEvent(t,i);if(!0===s)r.nodes=[],r.edges=[];else{var a=this.getSelection();r.nodes=a.nodes,r.edges=a.edges}void 0!==n&&(r.previousSelection=n),"click"==e&&(r.items=this.getClickedItems(i)),this.body.emitter.emit(e,r)}},{key:"selectObject",value:function(e,t){var i=1<arguments.length&&void 0!==t?t:this.options.selectConnectedEdges;return void 0!==e&&(e instanceof ii&&!0===i&&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,t){var i=!(1<arguments.length&&void 0!==t)||t,n=this._pointerToPositionObject(e),o=this._getAllNodesOverlappingWith(n);return 0<o.length?!0===i?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,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,t){for(var i=!(1<arguments.length&&void 0!==t)||t,n=this.canvas.DOMtoCanvas(e),o=10,s=null,r=this.body.edges,a=0;a<this.body.edgeIndices.length;a++){var h=this.body.edgeIndices[a],d=r[h];if(d.connected){var l=d.from.x,u=d.from.y,c=d.to.x,f=d.to.y,p=d.edgeType.getDistanceToEdge(l,u,c,f,n.x,n.y);p<o&&(s=h,o=p)}}return null!==s?!0===i?this.body.edges[s]:s:void 0}},{key:"_addToSelection",value:function(e){e instanceof ii?this.selectionObj.nodes[e.id]=e:this.selectionObj.edges[e.id]=e}},{key:"_addToHover",value:function(e){e instanceof ii?this.hoverObj.nodes[e.id]=e:this.hoverObj.edges[e.id]=e}},{key:"_removeFromSelection",value:function(e){e instanceof ii?(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)&&1<this.selectionObj.nodes[e].clusterSize)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 ii?(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 ii?(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 ii&&i.id!=o||i instanceof Si)&&(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 Si&&i.id!=s||i instanceof ii&&!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 ii&&!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,t){var i,n,o=1<arguments.length&&void 0!==t?t:{};if(!e||!e.nodes&&!e.edges)throw"Selection must be an object with nodes and/or edges properties";if(!o.unselectAll&&void 0!==o.unselectAll||this.unselectAll(),e.nodes)for(i=0;i<e.nodes.length;i++){n=e.nodes[i];var s=this.body.nodes[n];if(!s)throw new RangeError('Node with id "'+n+'" not found');this.selectObject(s,o.highlightEdges)}if(e.edges)for(i=0;i<e.edges.length;i++){n=e.edges[i];var r=this.body.edges[n];if(!r)throw new RangeError('Edge with id "'+n+'" not found');this.selectObject(r)}this.body.emitter.emit("_requestRedraw")}},{key:"selectNodes",value:function(e,t){var i=!(1<arguments.length&&void 0!==t)||t;if(!e||void 0===e.length)throw"Selection must be an array with ids";this.setSelection({nodes:e},{highlightEdges:i})}},{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;0<=s;s--){var r=o[n[s]].getItemsOnPoint(t);i.push.apply(i,r)}for(var a=this.body.edgeIndices,h=this.body.edges,d=a.length-1;0<=d;d--){var l=h[a[d]].getItemsOnPoint(t);i.push.apply(i,l)}return i}}]),n}(),qi=t(function(e,t){!function(e){e.__esModule=!0,e.sort=function(e,t,i,n){if(!Array.isArray(e))throw new TypeError("Can only sort arrays");t?"function"!=typeof t&&(n=i,i=t,t=l):t=l;i=i||0;n=n||e.length;var o=n-i;if(o<2)return;var s=0;if(o<d)return s=u(e,i,n,t),void c(e,i,n,i+s,t);var r=new f(e,t),a=function(e){var t=0;for(;d<=e;)t|=1&e,e>>=1;return e+t}(o);do{if((s=u(e,i,n,t))<a){var h=o;a<h&&(h=a),c(e,i,i+h,i+s,t),s=h}r.pushRun(i,s),r.mergeRuns(),o-=s,i+=s}while(0!==o);r.forceMergeRuns()};var d=32,a=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9];function h(e){return e<1e5?e<100?e<10?0:1:e<1e4?e<1e3?2:3:4:e<1e7?e<1e6?5:6:e<1e9?e<1e8?7:8:9}function l(e,t){if(e===t)return 0;if(~~e===e&&~~t===t){if(0===e||0===t)return e<t?-1:1;if(e<0||t<0){if(0<=t)return-1;if(0<=e)return 1;e=-e,t=-t}var i=h(e),n=h(t),o=0;return i<n?(e*=a[n-i-1],t/=10,o=-1):n<i&&(t*=a[i-n-1],e/=10,o=1),e===t?o:e<t?-1:1}var s=String(e),r=String(t);return s===r?0:s<r?-1:1}function u(e,t,i,n){var o=t+1;if(o===i)return 1;if(n(e[o++],e[t])<0){for(;o<i&&n(e[o],e[o-1])<0;)o++;!function(e,t,i){i--;for(;t<i;){var n=e[t];e[t++]=e[i],e[i--]=n}}(e,t,o)}else for(;o<i&&0<=n(e[o],e[o-1]);)o++;return o-t}function c(e,t,i,n,o){for(n===t&&n++;n<i;n++){for(var s=e[n],r=t,a=n;r<a;){var h=r+a>>>1;o(s,e[h])<0?a=h:r=1+h}var d=n-r;switch(d){case 3:e[r+3]=e[r+2];case 2:e[r+2]=e[r+1];case 1:e[r+1]=e[r];break;default:for(;0<d;)e[r+d]=e[r+d-1],d--}e[r]=s}}function m(e,t,i,n,o,s){var r=0,a=0,h=1;if(0<s(e,t[i+o])){for(a=n-o;h<a&&0<s(e,t[i+o+h]);)(h=1+((r=h)<<1))<=0&&(h=a);a<h&&(h=a),r+=o,h+=o}else{for(a=o+1;h<a&&s(e,t[i+o-h])<=0;)(h=1+((r=h)<<1))<=0&&(h=a);a<h&&(h=a);var d=r;r=o-h,h=o-d}for(r++;r<h;){var l=r+(h-r>>>1);0<s(e,t[i+l])?r=l+1:h=l}return h}function y(e,t,i,n,o,s){var r=0,a=0,h=1;if(s(e,t[i+o])<0){for(a=o+1;h<a&&s(e,t[i+o-h])<0;)(h=1+((r=h)<<1))<=0&&(h=a);a<h&&(h=a);var d=r;r=o-h,h=o-d}else{for(a=n-o;h<a&&0<=s(e,t[i+o+h]);)(h=1+((r=h)<<1))<=0&&(h=a);a<h&&(h=a),r+=o,h+=o}for(r++;r<h;){var l=r+(h-r>>>1);s(e,t[i+l])<0?h=l:r=l+1}return h}var f=function(){function i(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),this.array=null,this.compare=null,this.minGallop=7,this.length=0,this.tmpStorageLength=256,this.stackLength=0,this.runStart=null,this.runLength=null,this.stackSize=0,this.array=e,this.compare=t,this.length=e.length,this.length<512&&(this.tmpStorageLength=this.length>>>1),this.tmp=new Array(this.tmpStorageLength),this.stackLength=this.length<120?5:this.length<1542?10:this.length<119151?19:40,this.runStart=new Array(this.stackLength),this.runLength=new Array(this.stackLength)}return i.prototype.pushRun=function(e,t){this.runStart[this.stackSize]=e,this.runLength[this.stackSize]=t,this.stackSize+=1},i.prototype.mergeRuns=function(){for(;1<this.stackSize;){var e=this.stackSize-2;if(1<=e&&this.runLength[e-1]<=this.runLength[e]+this.runLength[e+1]||2<=e&&this.runLength[e-2]<=this.runLength[e]+this.runLength[e-1])this.runLength[e-1]<this.runLength[e+1]&&e--;else if(this.runLength[e]>this.runLength[e+1])break;this.mergeAt(e)}},i.prototype.forceMergeRuns=function(){for(;1<this.stackSize;){var e=this.stackSize-2;0<e&&this.runLength[e-1]<this.runLength[e+1]&&e--,this.mergeAt(e)}},i.prototype.mergeAt=function(e){var t=this.compare,i=this.array,n=this.runStart[e],o=this.runLength[e],s=this.runStart[e+1],r=this.runLength[e+1];this.runLength[e]=o+r,e===this.stackSize-3&&(this.runStart[e+1]=this.runStart[e+2],this.runLength[e+1]=this.runLength[e+2]),this.stackSize--;var a=y(i[s],i,n,o,0,t);n+=a,0!==(o-=a)&&0!==(r=m(i[n+o-1],i,s,r,r-1,t))&&(o<=r?this.mergeLow(n,o,s,r):this.mergeHigh(n,o,s,r))},i.prototype.mergeLow=function(e,t,i,n){var o=this.compare,s=this.array,r=this.tmp,a=0;for(a=0;a<t;a++)r[a]=s[e+a];var h=0,d=i,l=e;if(s[l++]=s[d++],0!=--n)if(1!==t){for(var u=this.minGallop;;){var c=0,f=0,p=!1;do{if(o(s[d],r[h])<0){if(s[l++]=s[d++],f++,(c=0)==--n){p=!0;break}}else if(s[l++]=r[h++],c++,f=0,1==--t){p=!0;break}}while((c|f)<u);if(p)break;do{if(0!==(c=y(s[d],r,h,t,0,o))){for(a=0;a<c;a++)s[l+a]=r[h+a];if(l+=c,h+=c,(t-=c)<=1){p=!0;break}}if(s[l++]=s[d++],0==--n){p=!0;break}if(0!==(f=m(r[h],s,d,n,0,o))){for(a=0;a<f;a++)s[l+a]=s[d+a];if(l+=f,d+=f,0===(n-=f)){p=!0;break}}if(s[l++]=r[h++],1==--t){p=!0;break}u--}while(7<=c||7<=f);if(p)break;u<0&&(u=0),u+=2}if((this.minGallop=u)<1&&(this.minGallop=1),1===t){for(a=0;a<n;a++)s[l+a]=s[d+a];s[l+n]=r[h]}else{if(0===t)throw new Error("mergeLow preconditions were not respected");for(a=0;a<t;a++)s[l+a]=r[h+a]}}else{for(a=0;a<n;a++)s[l+a]=s[d+a];s[l+n]=r[h]}else for(a=0;a<t;a++)s[l+a]=r[h+a]},i.prototype.mergeHigh=function(e,t,i,n){var o=this.compare,s=this.array,r=this.tmp,a=0;for(a=0;a<n;a++)r[a]=s[i+a];var h=e+t-1,d=n-1,l=i+n-1,u=0,c=0;if(s[l--]=s[h--],0!=--t)if(1!==n){for(var f=this.minGallop;;){var p=0,v=0,g=!1;do{if(o(r[d],s[h])<0){if(s[l--]=s[h--],p++,(v=0)==--t){g=!0;break}}else if(s[l--]=r[d--],v++,p=0,1==--n){g=!0;break}}while((p|v)<f);if(g)break;do{if(0!==(p=t-y(r[d],s,e,t,t-1,o))){for(t-=p,c=(l-=p)+1,u=(h-=p)+1,a=p-1;0<=a;a--)s[c+a]=s[u+a];if(0===t){g=!0;break}}if(s[l--]=r[d--],1==--n){g=!0;break}if(0!==(v=n-m(s[h],r,0,n,n-1,o))){for(n-=v,c=(l-=v)+1,u=(d-=v)+1,a=0;a<v;a++)s[c+a]=r[u+a];if(n<=1){g=!0;break}}if(s[l--]=s[h--],0==--t){g=!0;break}f--}while(7<=p||7<=v);if(g)break;f<0&&(f=0),f+=2}if((this.minGallop=f)<1&&(this.minGallop=1),1===n){for(c=(l-=t)+1,u=(h-=t)+1,a=t-1;0<=a;a--)s[c+a]=s[u+a];s[l]=r[d]}else{if(0===n)throw new Error("mergeHigh preconditions were not respected");for(u=l-(n-1),a=0;a<n;a++)s[u+a]=r[a]}}else{for(c=(l-=t)+1,u=(h-=t)+1,a=t-1;0<=a;a--)s[c+a]=s[u+a];s[l]=r[d]}else for(u=l-(n-1),a=0;a<n;a++)s[u+a]=r[a]},i}()}(t)});(Bi=qi)&&Bi.__esModule&&Object.prototype.hasOwnProperty.call(Bi,"default")&&Bi.default;var Zi=qi,Xi=function(){function e(){gt(this,e)}return yt(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,i){var n=2<arguments.length&&void 0!==i?i:void 0;this.fake_use(e,t,n),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}(),$i=function(){function i(e){var t;return gt(this,i),(t=kt(this,_t(i).call(this))).layout=e,t}return bt(i,Xi),yt(i,[{key:"curveType",value:function(){return"horizontal"}},{key:"getPosition",value:function(e){return e.x}},{key:"setPosition",value:function(e,t,i){var n=2<arguments.length&&void 0!==i?i:void 0;void 0!==n&&this.layout.hierarchical.addToOrdering(e,n),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){Zi.sort(e,function(e,t){return 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}}]),i}(),Ki=function(){function i(e){var t;return gt(this,i),(t=kt(this,_t(i).call(this))).layout=e,t}return bt(i,Xi),yt(i,[{key:"curveType",value:function(){return"vertical"}},{key:"getPosition",value:function(e){return e.y}},{key:"setPosition",value:function(e,t,i){var n=2<arguments.length&&void 0!==i?i:void 0;void 0!==n&&this.layout.hierarchical.addToOrdering(e,n),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){Zi.sort(e,function(e,t){return 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}}]),i}(),Qi=function(){function e(){gt(this,e),this.childrenReference={},this.parentReference={},this.trees={},this.distributionOrdering={},this.levels={},this.distributionIndex={},this.isTree=!1,this.treeIndex=-1}return yt(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(1<this.parentReference[e].length)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 s=this,r={};return function e(t){if(void 0!==r[t])return r[t];var i=s.levels[t];if(s.childrenReference[t]){var n=s.childrenReference[t];if(0<n.length)for(var o=0;o<n.length;o++)i=Math.max(i,e(n[o]))}return r[t]=i}(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 Object.keys(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}(),Ji=function(){function t(e){gt(this,t),this.body=e,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"}},z.extend(this.options,this.defaultOptions),this.bindEventListeners()}return yt(t,[{key:"bindEventListeners",value:function(){var t=this;this.body.emitter.on("_dataChanged",function(){t.setupHierarchicalLayout()}),this.body.emitter.on("_dataLoaded",function(){t.layoutNetwork()}),this.body.emitter.on("_resetHierarchicalLayout",function(){t.setupHierarchicalLayout()}),this.body.emitter.on("_adjustEdgesForHierarchicalLayout",function(){if(!0===t.options.hierarchical.enabled){var e=t.direction.curveType();t.body.emitter.emit("_forceDisableDynamicCurves",e,!1)}})}},{key:"setOptions",value:function(e,t){if(void 0!==e){var i=this.options.hierarchical,n=i.enabled;if(z.selectiveDeepExtend(["randomSeed","improvedLayout"],this.options,e),z.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?0<i.levelSeparation&&(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"),z.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"===vt(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(150<e.length){for(var s=e.length;150<e.length&&n<=10;){n+=1;var r=e.length;if(n%3==0?this.body.modules.clustering.clusterBridges(o):this.body.modules.clustering.clusterOutliers(o),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)})}10<n&&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 h=this.body.nodes[e[a]];!1===h.predefinedPosition&&(h.x+=70*(.5-this.seededRandom()),h.y+=70*(.5-this.seededRandom()))}this._declusterAll(),this.body.emitter.emit("_repositionBezierNodes")}}}},{key:"_shiftToCenter",value:function(){for(var e=Yi.getRangeCore(this.body.nodes,this.body.nodeIndices),t=Yi.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&&0<this.body.nodeIndices.length){var e,t,i=!1,n=!1;for(t in this.lastNodeOnLevel={},this.hierarchical=new Qi,this.body.nodes)this.body.nodes.hasOwnProperty(t)&&(void 0!==(e=this.body.nodes[t]).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(){function k(e,t){if(!t[e.id]&&(t[e.id]=!0,S.hierarchical.childrenReference[e.id])){var i=S.hierarchical.childrenReference[e.id];if(0<i.length)for(var n=0;n<i.length;n++)k(S.body.nodes[i[n]],t)}}function x(e,t){var i=1<arguments.length&&void 0!==t?t:1e9,n=1e9,o=1e9,s=1e9,r=-1e9;for(var a in e)if(e.hasOwnProperty(a)){var h=S.body.nodes[a],d=S.hierarchical.levels[h.id],l=S.direction.getPosition(h),u=xt(S._getSpaceAroundNode(h,e),2),c=u[0],f=u[1];n=Math.min(c,n),o=Math.min(f,o),d<=i&&(s=Math.min(l,s),r=Math.max(l,r))}return[s,r,n,o]}function n(e,t,i){for(var n=S.hierarchical,o=0;o<t.length;o++){var s=t[o],r=n.distributionOrdering[s];if(1<r.length)for(var a=0;a<r.length-1;a++){var h=r[a],d=r[a+1];n.hasSameParent(h,d)&&n.inSameSubNetwork(h,d)&&e(h,d,i)}}}function o(e,t,i){var n=2<arguments.length&&void 0!==i&&i,o=S.direction.getPosition(e),s=S.direction.getPosition(t),r=Math.abs(s-o),a=S.options.hierarchical.nodeSpacing;if(a<r){var h={},d={};k(e,h),k(t,d);var l=function(e,t){var i=S.hierarchical.getMaxLevel(e.id),n=S.hierarchical.getMaxLevel(t.id);return Math.min(i,n)}(e,t),u=x(h,l),c=x(d,l),f=u[1],p=c[0],v=c[2];if(a<Math.abs(f-p)){var g=f-p+a;g<-v+a&&(g=-v+a),g<0&&(S._shiftBlock(t.id,g),(D=!0)===n&&S._centerParent(t))}}}function a(e,h){for(var t=h.id,i=h.edges,n=S.hierarchical.levels[h.id],s=S.options.hierarchical.levelSeparation*S.options.hierarchical.levelSeparation,r={},o=[],a=0;a<i.length;a++){var d=i[a];if(d.toId!=d.fromId){var l=d.toId==t?d.from:d.to;r[i[a].id]=l,S.hierarchical.levels[l.id]<n&&o.push(d)}}function u(e,t){for(var i=0,n=0;n<t.length;n++)if(void 0!==r[t[n].id]){var o=S.direction.getPosition(r[t[n].id])-e;i+=o/Math.sqrt(o*o+s)}return i}function c(e,t){for(var i=0,n=0;n<t.length;n++)if(void 0!==r[t[n].id]){var o=S.direction.getPosition(r[t[n].id])-e;i-=s*Math.pow(o*o+s,-1.5)}return i}function f(e,t){for(var i=S.direction.getPosition(h),n={},o=0;o<e;o++){var s=u(i,t),r=c(i,t);if(void 0!==n[i-=Math.max(-40,Math.min(40,Math.round(s/r)))])break;n[i]=o}return i}var p,v,g,m,y,b,_,w=f(e,o);!function(e){var t=S.direction.getPosition(h);if(void 0===M[h.id]){var i={};k(h,i),M[h.id]=i}var n=x(M[h.id]),o=n[2],s=n[3],r=e-t,a=0;0<r?a=Math.min(r,s-S.options.hierarchical.nodeSpacing):r<0&&(a=-Math.min(-r,o-S.options.hierarchical.nodeSpacing)),0!=a&&(S._shiftBlock(h.id,a),D=!0)}(w),w=f(e,i),p=w,v=S.direction.getPosition(h),g=xt(S._getSpaceAroundNode(h),2),m=g[0],y=g[1],0<(b=p-(_=v))?_=Math.min(v+(y-S.options.hierarchical.nodeSpacing),p):b<0&&(_=Math.max(v-(m-S.options.hierarchical.nodeSpacing),p)),_!==v&&(S.direction.setPosition(h,_),D=!0)}var S=this,D=!1,M={},s=function(e,t){var i=S.hierarchical.trees;for(var n in i)i.hasOwnProperty(n)&&i[n]===e&&S.direction.shift(n,t)},r=function(){for(var e=[],t=0;t<S.hierarchical.numTrees();t++)e.push(S.direction.getTreeSize(t));return e};!0===this.options.hierarchical.blockShifting&&(function(e){var t=S.hierarchical.getLevels();t=t.reverse();for(var i=0;i<e&&(n(o,t,!(D=!1)),!0===D);i++);}(5),function(){for(var e in S.body.nodes)S.body.nodes.hasOwnProperty(e)&&S._centerParent(S.body.nodes[e])}()),!0===this.options.hierarchical.edgeMinimization&&function(e){var t=S.hierarchical.getLevels();t=t.reverse();for(var i=0;i<e;i++){D=!1;for(var n=0;n<t.length;n++)for(var o=t[n],s=S.hierarchical.distributionOrdering[o],r=0;r<s.length;r++)a(1e3,s[r]);if(!0!==D)break}}(20),!0===this.options.hierarchical.parentCentralization&&function(){var e=S.hierarchical.getLevels();e=e.reverse();for(var t=0;t<e.length;t++)for(var i=e[t],n=S.hierarchical.distributionOrdering[i],o=0;o<n.length;o++)S._centerParent(n[o])}(),function(){for(var e=r(),t=0,i=0;i<e.length-1;i++){t+=e[i].max-e[i+1].min+S.options.hierarchical.treeSpacing,s(i+1,t)}}()}},{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)return[0,0];var o=this.hierarchical.distributionIndex[e.id],s=this.direction.getPosition(e),r=this.hierarchical.distributionOrdering[n],a=1e9,h=1e9;if(0!==o){var d=r[o-1];if(!0===i&&void 0===t[d.id]||!1===i)a=s-this.direction.getPosition(d)}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);h=Math.min(h,u-s)}}return[a,h]}},{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],s=this.hierarchical.childrenReference[n];if(void 0!==s){var r=this._getCenterPosition(s),a=this.direction.getPosition(o),h=xt(this._getSpaceAroundNode(o),2),d=h[0],l=h[1],u=a-r;(u<0&&Math.abs(u)<l-this.options.hierarchical.nodeSpacing||0<u&&Math.abs(u)<d-this.options.hierarchical.nodeSpacing)&&this.direction.setPosition(o,r)}}}},{key:"_placeNodesByHierarchy",value:function(e){for(var t in this.positionedNodes={},e)if(e.hasOwnProperty(t)){var i=Object.keys(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;0<n&&(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(!(t<a&&void 0===this.positionedNodes[r.id]))return;var h=this.options.hierarchical.nodeSpacing,d=void 0;d=0===s?this.direction.getPosition(this.body.nodes[e]):this.direction.getPosition(n[s-1])+h,this.direction.setPosition(r,d,a),this._validatePositionAndContinue(r,a,d)}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,i={};for(e in this.body.nodes)if(this.body.nodes.hasOwnProperty(e)){t=this.body.nodes[e];var n=void 0===this.hierarchical.levels[e]?0:this.hierarchical.levels[e];this.direction.fix(t,n),void 0===i[n]&&(i[n]={}),i[n][e]=t}return i}},{key:"_getActiveEdges",value:function(e){var t=this,i=[];return z.forEach(e.edges,function(e){-1!==t.body.edgeIndices.indexOf(e.id)&&i.push(e)}),i}},{key:"_getHubSizes",value:function(){var n=this,o={},e=this.body.nodeIndices;z.forEach(e,function(e){var t=n.body.nodes[e],i=n._getActiveEdges(t).length;o[i]=!0});var t=[];return z.forEach(o,function(e){t.push(Number(e))}),Zi.sort(t,function(e,t){return t-e}),t}},{key:"_determineLevelsByHubsize",value:function(){for(var n=this,o=function(e,t){n.hierarchical.levelDownstream(e,t)},t=this._getHubSizes(),e=function(e){var i=t[e];if(0===i)return"break";z.forEach(n.body.nodeIndices,function(e){var t=n.body.nodes[e];i===n._getActiveEdges(t).length&&n._crawlNetwork(o,e)})},i=0;i<t.length;++i){if("break"===e(i))break}}},{key:"_determineLevelsCustomCallback",value:function(){var s=this;this._crawlNetwork(function(e,t,i){var n=s.hierarchical.levels[e.id];void 0===n&&(n=s.hierarchical.levels[e.id]=1e5);var o=(Yi.cloneOptions(e,"node"),Yi.cloneOptions(t,"node"),void Yi.cloneOptions(i,"edge"));s.hierarchical.levels[t.id]=n+o}),this.hierarchical.setMinLevelToZero(this.body.nodes)}},{key:"_determineLevelsDirected",value:function(){var o=this;this._crawlNetwork(function(e,t,i){var n=o.hierarchical.levels[e.id];o.hierarchical.levels[t.id];!function(t){z.forEach(o.body.edges,function(e){if(e.toId===t.fromId&&e.fromId===t.toId)return!0})}(i),void 0===n&&(n=o.hierarchical.levels[e.id]=1e4),i.toId==t.id?o.hierarchical.levels[t.id]=n+1:o.hierarchical.levels[t.id]=n-1}),this.hierarchical.setMinLevelToZero(this.body.nodes)}},{key:"_generateMap",value:function(){var i=this;this._crawlNetwork(function(e,t){i.hierarchical.levels[t.id]>i.hierarchical.levels[e.id]&&i.hierarchical.addRelation(e.id,t.id)}),this.hierarchical.checkIfTree()}},{key:"_crawlNetwork",value:function(e,t){function r(e,t){if(void 0===d[e.id]){var i;a.hierarchical.setTreeIndex(e,t),d[e.id]=!0;for(var n=a._getActiveEdges(e),o=0;o<n.length;o++){var s=n[o];!0===s.connected&&(i=s.toId==e.id?s.from:s.to,e.id!=i.id&&(h(e,i,s),r(i,t)))}}}var a=this,h=0<arguments.length&&void 0!==e?e:function(){},i=1<arguments.length?t:void 0,d={};if(void 0===i)for(var n=0,o=0;o<this.body.nodeIndices.length;o++){var s=this.body.nodeIndices[o];if(void 0===d[s])r(this.body.nodes[s],n),n+=1}else{var l=this.body.nodes[i];if(void 0===l)return void console.error("Node not found:",i);r(l)}}},{key:"_shiftBlock",value:function(e,o){var s=this,r={};!function e(t){if(!r[t]){r[t]=!0,s.direction.shift(t,o);var i=s.hierarchical.childrenReference[t];if(void 0!==i)for(var n=0;n<i.length;n++)e(i[n])}}(e)}},{key:"_findCommonParent",value:function(e,t){var a=this,i={};return function e(t,i){var n=a.hierarchical.parentReference[i];if(void 0!==n)for(var o=0;o<n.length;o++){var s=n[o];t[s]=!0,e(t,s)}}(i,e),function e(t,i){var n=a.hierarchical.parentReference[i];if(void 0!==n)for(var o=0;o<n.length;o++){var s=n[o];if(void 0!==t[s])return{foundParent:s,withChild:i};var r=e(t,s);if(null!==r.foundParent)return r}return{foundParent:null,withChild:i}}(i,t)}},{key:"setDirectionStrategy",value:function(){var e="UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction;this.direction=e?new $i(this):new Ki(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)}}]),t}(),on=function(){function o(e,t,i){var n=this;gt(this,o),this.body=e,this.canvas=t,this.selectionHandler=i,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}},z.extend(this.options,this.defaultOptions),this.body.emitter.on("destroy",function(){n._clean()}),this.body.emitter.on("_dataChanged",this._restore.bind(this)),this.body.emitter.on("_resetData",this._restore.bind(this))}return yt(o,[{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,z.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&&(0<e&&!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 t=this;!0!==this.editMode&&this.enableEditMode(),this._clean();var e=this.selectionHandler._getSelectedNode();if(void 0!==e){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!==e.isCluster){var i=z.deepExtend({},e.options,!1);if(i.x=e.x,i.y=e.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(e){null!=e&&"editNode"===t.inMode&&t.body.data.nodes.getDataSet().update(e),t.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"!==vt(this.options.editEdge)||"function"!=typeof this.options.editEdge.editWithoutDrag||(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdges()[0],void 0===this.edgeBeingEditedId)){if(!0===this.guiEnabled){var e=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(e),this._createSeperator(),this._createDescription(e.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()}else{var t=this.body.edges[this.edgeBeingEditedId];this._performEditEdge(t.from,t.to)}}},{key:"deleteSelected",value:function(){var t=this;!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="delete";var e=this.selectionHandler.getSelectedNodes(),i=this.selectionHandler.getSelectedEdges(),n=void 0;if(0<e.length){for(var o=0;o<e.length;o++)if(!0===this.body.nodes[e[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 0<i.length&&"function"==typeof this.options.deleteEdge&&(n=this.options.deleteEdge);if("function"==typeof n){var s={nodes:e,edges:i};if(2!==n.length)throw new Error("The function for delete does not support two arguments (data, callback)");n(s,function(e){null!=e&&"delete"===t.inMode&&(t.body.data.edges.getDataSet().remove(e.edges),t.body.data.nodes.getDataSet().remove(e.nodes)),t.body.emitter.emit("startSimulation"),t.showManipulatorToolbar()})}else this.body.data.edges.getDataSet().remove(i),this.body.data.nodes.getDataSet().remove(e),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=z.deepExtend({},this.options.controlNodeStyle);i.id="targetNode"+z.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={},z.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&&(z.recursiveDOMDelete(this.editModeDiv),z.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(),z.recursiveDOMDelete(this.manipulationDiv),z.recursiveDOMDelete(this.editModeDiv),z.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(e){var t=0<arguments.length&&void 0!==e?e:1;this.manipulationDOM["seperatorLineDiv"+t]=document.createElement("div"),this.manipulationDOM["seperatorLineDiv"+t].className="vis-separator-line",this.manipulationDiv.appendChild(this.manipulationDOM["seperatorLineDiv"+t])}},{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,n){var o=3<arguments.length&&void 0!==n?n:"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=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 ut(e,{});Li.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=z.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;0<=r;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(100<(new Date).valueOf()-this.touchTime){this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=z.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"+z.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;0<=r;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:z.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&&"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&&"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"===vt(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||"editEdge"!==i.inMode?(i.body.edges[n.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(n),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}]),o}(),sn={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"},rn=function(){function t(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1;gt(this,t),this.pixelRatio=e,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 yt(t,[{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){if("string"==typeof e)return sn[e]}},{key:"setColor",value:function(e,t){var i=!(1<arguments.length&&void 0!==t)||t;if("none"!==e){var n,o=this._isColorString(e);if(void 0!==o&&(e=o),!0===z.isString(e)){if(!0===z.isValidRGB(e)){var s=e.substr(4).substr(0,e.length-5).split(",");n={r:s[0],g:s[1],b:s[2],a:1}}else if(!0===z.isValidRGBA(e)){var r=e.substr(5).substr(0,e.length-6).split(",");n={r:r[0],g:r[1],b:r[2],a:r[3]}}else if(!0===z.isValidHex(e)){var a=z.hexToRGB(e);n={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 h=void 0!==e.a?e.a:"1.0";n={r:e.r,g:e.g,b:e.b,a:h}}if(void 0===n)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(n,i)}}},{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(e){var t=this;!0===(!(0<arguments.length&&void 0!==e)||e)&&(this.previousColor=z.extend({},this.color)),!0===this.applied&&this.updateCallback(this.initialColor),this.frame.style.display="none",setTimeout(function(){void 0!==t.closeCallback&&(t.closeCallback(),t.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,t){!0===(!(1<arguments.length&&void 0!==t)||t)&&(this.initialColor=z.extend({},e)),this.color=e;var i=z.RGBToHSV(e.r,e.g,e.b),n=2*Math.PI,o=this.r*i.s,s=this.centerCoordinates.x+o*Math.sin(n*i.h),r=this.centerCoordinates.y+o*Math.cos(n*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=z.RGBToHSV(this.color.r,this.color.g,this.color.b);t.v=e/100;var i=z.HSVToRGB(t.h,t.s,t.v);i.a=this.color.a,this.color=i,this._updatePicker()}},{key:"_updatePicker",value:function(e){var t=0<arguments.length&&void 0!==e?e:this.color,i=z.RGBToHSV(t.r,t.g,t.b),n=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(n.webkitBackingStorePixelRatio||n.mozBackingStorePixelRatio||n.msBackingStorePixelRatio||n.oBackingStorePixelRatio||n.backingStorePixelRatio||1)),n.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var o=this.colorPickerCanvas.clientWidth,s=this.colorPickerCanvas.clientHeight;n.clearRect(0,0,o,s),n.putImageData(this.hueCircle,0,0),n.fillStyle="rgba(0,0,0,"+(1-i.v)+")",n.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),n.fill(),this.brightnessRange.value=100*i.v,this.opacityRange.value=100*t.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 t=this;this.drag={},this.pinch={},this.hammer=new ut(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),Li.onTouch(this.hammer,function(e){t._moveSelector(e)}),this.hammer.on("tap",function(e){t._moveSelector(e)}),this.hammer.on("panstart",function(e){t._moveSelector(e)}),this.hammer.on("panmove",function(e){t._moveSelector(e)}),this.hammer.on("panend",function(e){t._moveSelector(e)})}},{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,i,n,o,s=this.colorPickerCanvas.clientWidth,r=this.colorPickerCanvas.clientHeight;e.clearRect(0,0,s,r),this.centerCoordinates={x:.5*s,y:.5*r},this.r=.49*s;var a,h=2*Math.PI/360,d=1/this.r;for(n=0;n<360;n++)for(o=0;o<this.r;o++)t=this.centerCoordinates.x+o*Math.sin(h*n),i=this.centerCoordinates.y+o*Math.cos(h*n),a=z.HSVToRGB(n*(1/360),o*d,1),e.fillStyle="rgb("+a.r+","+a.g+","+a.b+")",e.fillRect(t-.5,i-.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,s,r)}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,h=Math.atan2(r,a),d=.98*Math.min(Math.sqrt(r*r+a*a),s),l=Math.cos(h)*d+o,u=Math.sin(h)*d+s;this.colorPickerSelector.style.top=l-.5*this.colorPickerSelector.clientHeight+"px",this.colorPickerSelector.style.left=u-.5*this.colorPickerSelector.clientWidth+"px";var c=h/(2*Math.PI);c=c<0?c+1:c;var f=d/this.r,p=z.RGBToHSV(this.color.r,this.color.g,this.color.b);p.h=c,p.s=f;var v=z.HSVToRGB(p.h,p.s,p.v);v.a=this.color.a,this.color=v,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+")"}}]),t}(),an=function(){function o(e,t,i){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:1;gt(this,o),this.parent=e,this.changedOptions=[],this.container=t,this.allowCreation=!1,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},z.extend(this.options,this.defaultOptions),this.configureOptions=i,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new rn(n),this.wrapper=void 0}return yt(o,[{key:"setOptions",value:function(e){if(void 0!==e){this.popupHistory={},this._removePopup();var t=!0;if("string"==typeof e)this.options.filter=e;else if(e instanceof Array)this.options.filter=e.join();else if("object"===vt(e)){if(null==e)throw new TypeError("options cannot be null");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)}else"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(){this._clean(),this.changedOptions=[];var e=this.options.filter,t=0,i=!1;for(var n in this.configureOptions)this.configureOptions.hasOwnProperty(n)&&(i=this.allowCreation=!1,"function"==typeof e?i=(i=e(n,[]))||this._handleObject(this.configureOptions[n],[n],!0):!0!==e&&-1===e.indexOf(n)||(i=!0),!1!==i&&(this.allowCreation=!0,0<t&&this._makeItem([]),this._makeHeader(n),this._handleObject(this.configureOptions[n],[n])),t++);this._makeButton(),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)return 0;var t=document.createElement("div");t.className="vis-configuration vis-config-item vis-config-s"+e.length;for(var i=arguments.length,n=new Array(1<i?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}},{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,i){var n=2<arguments.length&&void 0!==i&&i,o=document.createElement("div");return o.className="vis-configuration vis-config-label vis-config-s"+t.length,o.innerHTML=!0===n?"<i><b>"+e+":</b></i>":e+":",o}},{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 h=this._makeLabel(i[i.length-1],i);this._makeItem(i,h,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 h="",d=0;if(void 0!==t){t<0&&1.2*t<o?(a.min=Math.ceil(1.2*t),d=a.min,h="range increased"):t/1.2<o&&(a.min=Math.ceil(t/1.2),d=a.min,h="range increased"),s<1.2*t&&1!==s&&(a.max=Math.ceil(1.2*t),d=a.max,h="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);""!==h&&this.popupHistory[f]!==d&&(this.popupHistory[f]=d,this._setupPopup(h,f))}},{key:"_makeButton",value:function(){var e=this;if(!0===this.options.showButton){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"},this.optionsContainer=document.createElement("div"),this.optionsContainer.className="vis-configuration vis-config-option-container",this.domElements.push(this.optionsContainer),this.domElements.push(t)}}},{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].getBoundingClientRect();this.popupDiv.html.style.left=t.left+"px",this.popupDiv.html.style.top=t.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)!==e&&("object"===vt(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)!==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");"none"!==(t=void 0===t?o: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,i,n){var o=this;i.onclick=function(){},this.colorPicker.insertTo(i),this.colorPicker.show(),this.colorPicker.setColor(e),this.colorPicker.setUpdateCallback(function(e){var t="rgba("+e.r+","+e.g+","+e.b+","+e.a+")";i.style.backgroundColor=t,o._update(t,n)}),this.colorPicker.setCloseCallback(function(){i.onclick=function(){o._showColorPicker(e,i,n)}})}},{key:"_handleObject",value:function(e,t,i){var n=1<arguments.length&&void 0!==t?t:[],o=2<arguments.length&&void 0!==i&&i,s=!1,r=this.options.filter,a=!1;for(var h in e)if(e.hasOwnProperty(h)){s=!0;var d=e[h],l=z.copyAndExtendArray(n,h);if("function"==typeof r&&!1===(s=r(h,n))&&!(d instanceof Array)&&"string"!=typeof d&&"boolean"!=typeof d&&d instanceof Object&&(this.allowCreation=!1,s=this._handleObject(d,l,!0),this.allowCreation=!1===o),!1!==s){a=!0;var u=this._getValue(l);if(d instanceof Array)this._handleArray(d,u,l);else if("string"==typeof d)this._makeTextInput(d,u,l);else if("boolean"==typeof d)this._makeCheckbox(d,u,l);else if(d instanceof Object){var c=!0;if(-1!==n.indexOf("physics")&&this.moduleOptions.physics.solver!==h&&(c=!1),!0===c)if(void 0!==d.enabled){var f=z.copyAndExtendArray(l,"enabled"),p=this._getValue(f);if(!0===p){var v=this._makeLabel(h,l,!0);this._makeItem(l,v),a=this._handleObject(d,l)||a}else this._makeCheckbox(d,p,l)}else{var g=this._makeLabel(h,l,!0);this._makeItem(l,g),a=this._handleObject(d,l)||a}}else console.error("dont know how to handle",d,h,l)}}return a}},{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,i){var n=2<arguments.length&&void 0!==i?i:{},o=n;e="false"!==(e="true"===e||e)&&e;for(var s=0;s<t.length;s++)"global"!==t[s]&&(void 0===o[t[s]]&&(o[t[s]]={}),s!==t.length-1?o=o[t[s]]:o[t[s]]=e);return n}},{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}}]),o}(),hn="string",dn="boolean",ln="number",un="array",cn="object",fn=["arrow","circle","bar"],pn={configure:{enabled:{boolean:dn},filter:{boolean:dn,string:hn,array:un,function:"function"},container:{dom:"dom"},showButton:{boolean:dn},__type__:{object:cn,boolean:dn,string:hn,array:un,function:"function"}},edges:{arrows:{to:{enabled:{boolean:dn},scaleFactor:{number:ln},type:{string:fn},__type__:{object:cn,boolean:dn}},middle:{enabled:{boolean:dn},scaleFactor:{number:ln},type:{string:fn},__type__:{object:cn,boolean:dn}},from:{enabled:{boolean:dn},scaleFactor:{number:ln},type:{string:fn},__type__:{object:cn,boolean:dn}},__type__:{string:["from","to","middle"],object:cn}},arrowStrikethrough:{boolean:dn},background:{enabled:{boolean:dn},color:{string:hn},size:{number:ln},dashes:{boolean:dn,array:un},__type__:{object:cn,boolean:dn}},chosen:{label:{boolean:dn,function:"function"},edge:{boolean:dn,function:"function"},__type__:{object:cn,boolean:dn}},color:{color:{string:hn},highlight:{string:hn},hover:{string:hn},inherit:{string:["from","to","both"],boolean:dn},opacity:{number:ln},__type__:{object:cn,string:hn}},dashes:{boolean:dn,array:un},font:{color:{string:hn},size:{number:ln},face:{string:hn},background:{string:hn},strokeWidth:{number:ln},strokeColor:{string:hn},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:ln},multi:{boolean:dn,string:hn},bold:{color:{string:hn},size:{number:ln},face:{string:hn},mod:{string:hn},vadjust:{number:ln},__type__:{object:cn,string:hn}},boldital:{color:{string:hn},size:{number:ln},face:{string:hn},mod:{string:hn},vadjust:{number:ln},__type__:{object:cn,string:hn}},ital:{color:{string:hn},size:{number:ln},face:{string:hn},mod:{string:hn},vadjust:{number:ln},__type__:{object:cn,string:hn}},mono:{color:{string:hn},size:{number:ln},face:{string:hn},mod:{string:hn},vadjust:{number:ln},__type__:{object:cn,string:hn}},__type__:{object:cn,string:hn}},hidden:{boolean:dn},hoverWidth:{function:"function",number:ln},label:{string:hn,undefined:"undefined"},labelHighlightBold:{boolean:dn},length:{number:ln,undefined:"undefined"},physics:{boolean:dn},scaling:{min:{number:ln},max:{number:ln},label:{enabled:{boolean:dn},min:{number:ln},max:{number:ln},maxVisible:{number:ln},drawThreshold:{number:ln},__type__:{object:cn,boolean:dn}},customScalingFunction:{function:"function"},__type__:{object:cn}},selectionWidth:{function:"function",number:ln},selfReferenceSize:{number:ln},shadow:{enabled:{boolean:dn},color:{string:hn},size:{number:ln},x:{number:ln},y:{number:ln},__type__:{object:cn,boolean:dn}},smooth:{enabled:{boolean:dn},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:ln},forceDirection:{string:["horizontal","vertical","none"],boolean:dn},__type__:{object:cn,boolean:dn}},title:{string:hn,undefined:"undefined"},width:{number:ln},widthConstraint:{maximum:{number:ln},__type__:{object:cn,boolean:dn,number:ln}},value:{number:ln,undefined:"undefined"},__type__:{object:cn}},groups:{useDefaultGroups:{boolean:dn},__any__:"get from nodes, will be overwritten below",__type__:{object:cn}},interaction:{dragNodes:{boolean:dn},dragView:{boolean:dn},hideEdgesOnDrag:{boolean:dn},hideNodesOnDrag:{boolean:dn},hover:{boolean:dn},keyboard:{enabled:{boolean:dn},speed:{x:{number:ln},y:{number:ln},zoom:{number:ln},__type__:{object:cn}},bindToWindow:{boolean:dn},__type__:{object:cn,boolean:dn}},multiselect:{boolean:dn},navigationButtons:{boolean:dn},selectable:{boolean:dn},selectConnectedEdges:{boolean:dn},hoverConnectedEdges:{boolean:dn},tooltipDelay:{number:ln},zoomView:{boolean:dn},zoomSpeed:{number:ln},__type__:{object:cn}},layout:{randomSeed:{undefined:"undefined",number:ln},improvedLayout:{boolean:dn},hierarchical:{enabled:{boolean:dn},levelSeparation:{number:ln},nodeSpacing:{number:ln},treeSpacing:{number:ln},blockShifting:{boolean:dn},edgeMinimization:{boolean:dn},parentCentralization:{boolean:dn},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},__type__:{object:cn,boolean:dn}},__type__:{object:cn}},manipulation:{enabled:{boolean:dn},initiallyActive:{boolean:dn},addNode:{boolean:dn,function:"function"},addEdge:{boolean:dn,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:cn,boolean:dn,function:"function"}},deleteNode:{boolean:dn,function:"function"},deleteEdge:{boolean:dn,function:"function"},controlNodeStyle:"get from nodes, will be overwritten below",__type__:{object:cn,boolean:dn}},nodes:{borderWidth:{number:ln},borderWidthSelected:{number:ln,undefined:"undefined"},brokenImage:{string:hn,undefined:"undefined"},chosen:{label:{boolean:dn,function:"function"},node:{boolean:dn,function:"function"},__type__:{object:cn,boolean:dn}},color:{border:{string:hn},background:{string:hn},highlight:{border:{string:hn},background:{string:hn},__type__:{object:cn,string:hn}},hover:{border:{string:hn},background:{string:hn},__type__:{object:cn,string:hn}},__type__:{object:cn,string:hn}},fixed:{x:{boolean:dn},y:{boolean:dn},__type__:{object:cn,boolean:dn}},font:{align:{string:hn},color:{string:hn},size:{number:ln},face:{string:hn},background:{string:hn},strokeWidth:{number:ln},strokeColor:{string:hn},vadjust:{number:ln},multi:{boolean:dn,string:hn},bold:{color:{string:hn},size:{number:ln},face:{string:hn},mod:{string:hn},vadjust:{number:ln},__type__:{object:cn,string:hn}},boldital:{color:{string:hn},size:{number:ln},face:{string:hn},mod:{string:hn},vadjust:{number:ln},__type__:{object:cn,string:hn}},ital:{color:{string:hn},size:{number:ln},face:{string:hn},mod:{string:hn},vadjust:{number:ln},__type__:{object:cn,string:hn}},mono:{color:{string:hn},size:{number:ln},face:{string:hn},mod:{string:hn},vadjust:{number:ln},__type__:{object:cn,string:hn}},__type__:{object:cn,string:hn}},group:{string:hn,number:ln,undefined:"undefined"},heightConstraint:{minimum:{number:ln},valign:{string:hn},__type__:{object:cn,boolean:dn,number:ln}},hidden:{boolean:dn},icon:{face:{string:hn},code:{string:hn},size:{number:ln},color:{string:hn},__type__:{object:cn}},id:{string:hn,number:ln},image:{selected:{string:hn,undefined:"undefined"},unselected:{string:hn,undefined:"undefined"},__type__:{object:cn,string:hn}},label:{string:hn,undefined:"undefined"},labelHighlightBold:{boolean:dn},level:{number:ln,undefined:"undefined"},margin:{top:{number:ln},right:{number:ln},bottom:{number:ln},left:{number:ln},__type__:{object:cn,number:ln}},mass:{number:ln},physics:{boolean:dn},scaling:{min:{number:ln},max:{number:ln},label:{enabled:{boolean:dn},min:{number:ln},max:{number:ln},maxVisible:{number:ln},drawThreshold:{number:ln},__type__:{object:cn,boolean:dn}},customScalingFunction:{function:"function"},__type__:{object:cn}},shadow:{enabled:{boolean:dn},color:{string:hn},size:{number:ln},x:{number:ln},y:{number:ln},__type__:{object:cn,boolean:dn}},shape:{string:["ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon","hexagon"]},shapeProperties:{borderDashes:{boolean:dn,array:un},borderRadius:{number:ln},interpolation:{boolean:dn},useImageSize:{boolean:dn},useBorderWithImage:{boolean:dn},__type__:{object:cn}},size:{number:ln},title:{string:hn,dom:"dom",undefined:"undefined"},value:{number:ln,undefined:"undefined"},widthConstraint:{minimum:{number:ln},maximum:{number:ln},__type__:{object:cn,boolean:dn,number:ln}},x:{number:ln},y:{number:ln},__type__:{object:cn}},physics:{enabled:{boolean:dn},barnesHut:{gravitationalConstant:{number:ln},centralGravity:{number:ln},springLength:{number:ln},springConstant:{number:ln},damping:{number:ln},avoidOverlap:{number:ln},__type__:{object:cn}},forceAtlas2Based:{gravitationalConstant:{number:ln},centralGravity:{number:ln},springLength:{number:ln},springConstant:{number:ln},damping:{number:ln},avoidOverlap:{number:ln},__type__:{object:cn}},repulsion:{centralGravity:{number:ln},springLength:{number:ln},springConstant:{number:ln},nodeDistance:{number:ln},damping:{number:ln},__type__:{object:cn}},hierarchicalRepulsion:{centralGravity:{number:ln},springLength:{number:ln},springConstant:{number:ln},nodeDistance:{number:ln},damping:{number:ln},__type__:{object:cn}},maxVelocity:{number:ln},minVelocity:{number:ln},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:dn},iterations:{number:ln},updateInterval:{number:ln},onlyDynamicEdges:{boolean:dn},fit:{boolean:dn},__type__:{object:cn,boolean:dn}},timestep:{number:ln},adaptiveTimestep:{boolean:dn},__type__:{object:cn,boolean:dn}},autoResize:{boolean:dn},clickToUse:{boolean:dn},locale:{string:hn},locales:{__any__:{any:"any"},__type__:{object:cn}},height:{string:hn},width:{string:hn},__type__:{object:cn}};pn.groups.__any__=pn.nodes,pn.manipulation.controlNodeStyle=pn.nodes;var vn={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,zoomSpeed:1},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]}},gn=Object.freeze({allOptions:pn,configureOptions:vn}),mn=function(){function e(){gt(this,e)}return yt(e,[{key:"getDistances",value:function(e,t,i){for(var n={},o=e.edges,s=0;s<t.length;s++){var r={};n[t[s]]=r;for(var a=0;a<t.length;a++)r[t[a]]=s==a?0:1e9}for(var h=0;h<i.length;h++){var d=o[i[h]];!0===d.connected&&void 0!==n[d.fromId]&&void 0!==n[d.toId]&&(n[d.fromId][d.toId]=1,n[d.toId][d.fromId]=1)}for(var l=t.length,u=0;u<l;u++)for(var c=t[u],f=n[c],p=0;p<l-1;p++)for(var v=t[p],g=n[v],m=p+1;m<l;m++){var y=t[m],b=n[y],_=Math.min(g[y],g[c]+f[y]);g[y]=_,b[v]=_}return n}}]),e}(),yn=function(){function n(e,t,i){gt(this,n),this.body=e,this.springLength=t,this.springConstant=i,this.distanceSolver=new mn}return yt(n,[{key:"setOptions",value:function(e){e&&(e.springLength&&(this.springLength=e.springLength),e.springConstant&&(this.springConstant=e.springConstant))}},{key:"solve",value:function(e,t,i){var n=2<arguments.length&&void 0!==i&&i,o=this.distanceSolver.getDistances(this.body,e,t);this._createL_matrix(o),this._createK_matrix(o),this._createE_matrix();for(var s=0,r=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),a=1e9,h=0,d=0,l=0,u=0,c=0;.01<a&&s<r;){s+=1;var f=xt(this._getHighestEnergyNode(n),4);for(h=f[0],a=f[1],d=f[2],l=f[3],u=a,c=0;1<u&&c<5;){c+=1,this._moveNode(h,d,l);var p=xt(this._getEnergy(h),3);u=p[0],d=p[1],l=p[2]}}}},{key:"_getHighestEnergyNode",value:function(e){for(var t=this.body.nodeIndices,i=this.body.nodes,n=0,o=t[0],s=0,r=0,a=0;a<t.length;a++){var h=t[a];if(!1===i[h].predefinedPosition||!0===i[h].isCluster&&!0===e||!0===i[h].options.fixed.x||!0===i[h].options.fixed.y){var d=xt(this._getEnergy(h),3),l=d[0],u=d[1],c=d[2];n<l&&(n=l,o=h,s=u,r=c)}}return[o,n,s,r]}},{key:"_getEnergy",value:function(e){var t=xt(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,h=o[e].x,d=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],m=u[f],y=1/Math.pow(Math.pow(h-p,2)+Math.pow(d-v,2),1.5);s+=g*(1-m*Math.pow(d-v,2)*y),r+=g*(m*(h-p)*(d-v)*y),a+=g*(1-m*Math.pow(h-p,2)*y)}}var b=(t/s+i/r)/(r/s-a/r),_=-(r*b+t)/s;o[e].x+=_,o[e].y+=b,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,h=0,d=n;d<e.length;d++){var l=e[d];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][d]=[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][d],a+=this.E_matrix[o][d][0],h+=this.E_matrix[o][d][1]}}this.E_sums[o]=[a,h]}}},{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,h=0,d=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,m=1/Math.sqrt(Math.pow(r-v,2)+Math.pow(a-g,2)),y=o[u]*(r-v-s[u]*(r-v)*m),b=o[u]*(a-g-s[u]*(a-g)*m);n[l]=[y,b],h+=y,d+=b;var _=this.E_sums[u];_[0]+=y-f,_[1]+=b-p}}this.E_sums[e]=[h,d]}}]),n}();function bn(e,t,i){var n=this;if(!(this instanceof bn))throw new SyntaxError("Constructor must be called with the new operator");this.options={},this.defaultOptions={locale:"en",locales:pt,clickToUse:!1},z.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 Mt(function(){return n.body.emitter.emit("_requestRedraw")}),this.groups=new Ot,this.canvas=new Hi(this.body),this.selectionHandler=new Gi(this.body,this.canvas),this.interactionHandler=new Ui(this.body,this.canvas,this.selectionHandler),this.view=new ji(this.body,this.canvas),this.renderer=new Ai(this.body,this.canvas),this.physics=new Ii(this.body),this.layoutEngine=new Ji(this.body),this.clustering=new zi(this.body),this.manipulation=new on(this.body,this.canvas,this.selectionHandler),this.nodesHandler=new ni(this.body,this.images,this.groups,this.layoutEngine),this.edgesHandler=new Di(this.body,this.images,this.groups),this.body.modules.kamadaKawai=new yn(this.body,150,.05),this.body.modules.clustering=this.clustering,this.canvas._create(),this.setOptions(i),this.setData(t)}Te(bn.prototype),bn.prototype.setOptions=function(e){var t=this;if(null===e&&(e=void 0),void 0!==e){!0===ti.validate(e,pn)&&console.log("%cErrors have been found in the supplied options object.",ei);if(z.selectiveDeepExtend(["locale","locales","clickToUse"],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 an(this,this.body.container,vn,this.canvas.pixelRatio)),this.configurator.setOptions(e.configure)),this.configurator&&!0===this.configurator.options.enabled){var i={nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};z.deepExtend(i.nodes,this.nodesHandler.options),z.deepExtend(i.edges,this.edgesHandler.options),z.deepExtend(i.layout,this.layoutEngine.options),z.deepExtend(i.interaction,this.selectionHandler.options),z.deepExtend(i.interaction,this.renderer.options),z.deepExtend(i.interaction,this.interactionHandler.options),z.deepExtend(i.manipulation,this.manipulation.options),z.deepExtend(i.physics,this.physics.options),z.deepExtend(i.global,this.canvas.options),z.deepExtend(i.global,this.options),this.configurator.setModuleOptions(i)}void 0!==e.clickToUse?!0===e.clickToUse?void 0===this.activator&&(this.activator=new ft(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")}},bn.prototype._updateVisibleIndices=function(){var e=this.body.nodes,t=this.body.edges;for(var i in this.body.nodeIndices=[],this.body.edgeIndices=[],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;!this.clustering._isClusteredEdge(n)&&!1===o.options.hidden&&a&&!1===s.options.hidden&&!1===r.options.hidden&&this.body.edgeIndices.push(o.id)}},bn.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")})},bn.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=rt.DOTToGraph(e.dot);this.setData(t)}else 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=at.parseGephi(e.gephi);this.setData(i)}else 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")},bn.prototype.destroy=function(){for(var e in 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,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];z.recursiveDOMDelete(this.body.container)},bn.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)},bn.prototype.isActive=function(){return!this.activator||this.activator.active},bn.prototype.setSize=function(){return this.canvas.setSize.apply(this.canvas,arguments)},bn.prototype.canvasToDOM=function(){return this.canvas.canvasToDOM.apply(this.canvas,arguments)},bn.prototype.DOMtoCanvas=function(){return this.canvas.DOMtoCanvas.apply(this.canvas,arguments)},bn.prototype.findNode=function(){return this.clustering.findNode.apply(this.clustering,arguments)},bn.prototype.isCluster=function(){return this.clustering.isCluster.apply(this.clustering,arguments)},bn.prototype.openCluster=function(){return this.clustering.openCluster.apply(this.clustering,arguments)},bn.prototype.cluster=function(){return this.clustering.cluster.apply(this.clustering,arguments)},bn.prototype.getNodesInCluster=function(){return this.clustering.getNodesInCluster.apply(this.clustering,arguments)},bn.prototype.clusterByConnection=function(){return this.clustering.clusterByConnection.apply(this.clustering,arguments)},bn.prototype.clusterByHubsize=function(){return this.clustering.clusterByHubsize.apply(this.clustering,arguments)},bn.prototype.clusterOutliers=function(){return this.clustering.clusterOutliers.apply(this.clustering,arguments)},bn.prototype.getSeed=function(){return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments)},bn.prototype.enableEditMode=function(){return this.manipulation.enableEditMode.apply(this.manipulation,arguments)},bn.prototype.disableEditMode=function(){return this.manipulation.disableEditMode.apply(this.manipulation,arguments)},bn.prototype.addNodeMode=function(){return this.manipulation.addNodeMode.apply(this.manipulation,arguments)},bn.prototype.editNode=function(){return this.manipulation.editNode.apply(this.manipulation,arguments)},bn.prototype.editNodeMode=function(){return console.log("Deprecated: Please use editNode instead of editNodeMode."),this.manipulation.editNode.apply(this.manipulation,arguments)},bn.prototype.addEdgeMode=function(){return this.manipulation.addEdgeMode.apply(this.manipulation,arguments)},bn.prototype.editEdgeMode=function(){return this.manipulation.editEdgeMode.apply(this.manipulation,arguments)},bn.prototype.deleteSelected=function(){return this.manipulation.deleteSelected.apply(this.manipulation,arguments)},bn.prototype.getPositions=function(){return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments)},bn.prototype.storePositions=function(){return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments)},bn.prototype.moveNode=function(){return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments)},bn.prototype.getBoundingBox=function(){return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments)},bn.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)},bn.prototype.getConnectedEdges=function(){return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments)},bn.prototype.startSimulation=function(){return this.physics.startSimulation.apply(this.physics,arguments)},bn.prototype.stopSimulation=function(){return this.physics.stopSimulation.apply(this.physics,arguments)},bn.prototype.stabilize=function(){return this.physics.stabilize.apply(this.physics,arguments)},bn.prototype.getSelection=function(){return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments)},bn.prototype.setSelection=function(){return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments)},bn.prototype.getSelectedNodes=function(){return this.selectionHandler.getSelectedNodes.apply(this.selectionHandler,arguments)},bn.prototype.getSelectedEdges=function(){return this.selectionHandler.getSelectedEdges.apply(this.selectionHandler,arguments)},bn.prototype.getNodeAt=function(){var e=this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);return void 0!==e&&void 0!==e.id?e.id:e},bn.prototype.getEdgeAt=function(){var e=this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);return void 0!==e&&void 0!==e.id?e.id:e},bn.prototype.selectNodes=function(){return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments)},bn.prototype.selectEdges=function(){return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments)},bn.prototype.unselectAll=function(){this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments),this.redraw()},bn.prototype.redraw=function(){return this.renderer.redraw.apply(this.renderer,arguments)},bn.prototype.getScale=function(){return this.view.getScale.apply(this.view,arguments)},bn.prototype.getViewPosition=function(){return this.view.getViewPosition.apply(this.view,arguments)},bn.prototype.fit=function(){return this.view.fit.apply(this.view,arguments)},bn.prototype.moveTo=function(){return this.view.moveTo.apply(this.view,arguments)},bn.prototype.focus=function(){return this.view.focus.apply(this.view,arguments)},bn.prototype.releaseNode=function(){return this.view.releaseNode.apply(this.view,arguments)},bn.prototype.getOptionsFromConfigurator=function(){var e={};return this.configurator&&(e=this.configurator.getOptions.apply(this.configurator)),e};var _n=t(function(Ji,e){Ji.exports=function(){var t,o;function d(){return t.apply(null,arguments)}function r(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function a(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function s(e){return void 0===e}function h(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function l(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function n(e,t){var i,n=[];for(i=0;i<e.length;++i)n.push(t(e[i],i));return n}function u(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function c(e,t){for(var i in t)u(t,i)&&(e[i]=t[i]);return u(t,"toString")&&(e.toString=t.toString),u(t,"valueOf")&&(e.valueOf=t.valueOf),e}function f(e,t,i,n){return Ft(e,t,i,n,!0).utc()}function p(e){return null==e._pf&&(e._pf={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}),e._pf}function v(e){if(null==e._isValid){var t=p(e),i=o.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 g(e){var t=f(NaN);return null!=e?c(p(t),e):p(t).userInvalidated=!0,t}o=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 m=d.momentProperties=[];function y(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=p(t)),s(t._locale)||(e._locale=t._locale),0<m.length)for(i=0;i<m.length;i++)n=m[i],s(o=t[n])||(e[n]=o);return e}var i=!1;function b(e){y(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===i&&(i=!0,d.updateOffset(this),i=!1)}function _(e){return e instanceof b||null!=e&&null!=e._isAMomentObject}function w(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function k(e){var t=+e,i=0;return 0!=t&&isFinite(t)&&(i=w(t)),i}function x(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&&k(e[n])!==k(t[n]))&&r++;return r+s}function S(e){!1===d.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function e(o,s){var r=!0;return c(function(){if(null!=d.deprecationHandler&&d.deprecationHandler(null,o),r){for(var e,t=[],i=0;i<arguments.length;i++){if(e="","object"==typeof arguments[i]){for(var n in e+="\n["+i+"] ",arguments[0])e+=n+": "+arguments[0][n]+", ";e=e.slice(0,-2)}else e=arguments[i];t.push(e)}S(o+"\nArguments: "+Array.prototype.slice.call(t).join("")+"\n"+(new Error).stack),r=!1}return s.apply(this,arguments)},s)}var D,M={};function O(e,t){null!=d.deprecationHandler&&d.deprecationHandler(e,t),M[e]||(S(t),M[e]=!0)}function E(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function T(e,t){var i,n=c({},e);for(i in t)u(t,i)&&(a(e[i])&&a(t[i])?(n[i]={},c(n[i],e[i]),c(n[i],t[i])):null!=t[i]?n[i]=t[i]:delete n[i]);for(i in e)u(e,i)&&!u(t,i)&&a(e[i])&&(n[i]=c({},n[i]));return n}function C(e){null!=e&&this.set(e)}d.suppressDeprecationWarnings=!1,d.deprecationHandler=null,D=Object.keys?Object.keys:function(e){var t,i=[];for(t in e)u(e,t)&&i.push(t);return i};var P={};function F(e,t){var i=e.toLowerCase();P[i]=P[i+"s"]=P[t]=e}function N(e){return"string"==typeof e?P[e]||P[e.toLowerCase()]:void 0}function I(e){var t,i,n={};for(i in e)u(e,i)&&(t=N(i))&&(n[t]=e[i]);return n}var Y={};function R(e,t){Y[e]=t}function z(e){var t=[];for(var i in e)t.push({unit:i,priority:Y[i]});return t.sort(function(e,t){return e.priority-t.priority}),t}function B(e,t,i){var n=""+Math.abs(e),o=t-n.length,s=0<=e;return(s?i?"+":"":"-")+Math.pow(10,Math.max(0,o)).toString().substr(1)+n}var A=/(\[[^\[]*\])|(\\)?([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,L=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,H={},j={};function W(e,t,i,n){var o=n;"string"==typeof n&&(o=function(){return this[n]()}),e&&(j[e]=o),t&&(j[t[0]]=function(){return B(o.apply(this,arguments),t[1],t[2])}),i&&(j[i]=function(){return this.localeData().ordinal(o.apply(this,arguments),e)})}function V(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function U(e,t){return e.isValid()?(t=G(t,e.localeData()),H[t]=H[t]||function(n){var e,o,s=n.match(A);for(e=0,o=s.length;e<o;e++)j[s[e]]?s[e]=j[s[e]]:s[e]=V(s[e]);return function(e){var t,i="";for(t=0;t<o;t++)i+=E(s[t])?s[t].call(e,n):s[t];return i}}(t),H[t](e)):e.localeData().invalidDate()}function G(e,t){var i=5;function n(e){return t.longDateFormat(e)||e}for(L.lastIndex=0;0<=i&&L.test(e);)e=e.replace(L,n),L.lastIndex=0,i-=1;return e}var q=/\d/,Z=/\d\d/,X=/\d{3}/,$=/\d{4}/,K=/[+-]?\d{6}/,Q=/\d\d?/,J=/\d\d\d\d?/,ee=/\d\d\d\d\d\d?/,te=/\d{1,3}/,ie=/\d{1,4}/,ne=/[+-]?\d{1,6}/,oe=/\d+/,se=/[+-]?\d+/,re=/Z|[+-]\d\d:?\d\d/gi,ae=/Z|[+-]\d\d(?::?\d\d)?/gi,he=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,de={};function le(e,i,n){de[e]=E(i)?i:function(e,t){return e&&n?n:i}}function ue(e,t){return u(de,e)?de[e](t._strict,t._locale):new RegExp(function(e){return ce(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,i,n,o){return t||i||n||o}))}(e))}function ce(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var fe={};function pe(e,i){var t,n=i;for("string"==typeof e&&(e=[e]),h(i)&&(n=function(e,t){t[i]=k(e)}),t=0;t<e.length;t++)fe[e[t]]=n}function ve(e,o){pe(e,function(e,t,i,n){i._w=i._w||{},o(e,i._w,i,n)})}function ge(e,t,i){null!=t&&u(fe,e)&&fe[e](t,i._a,i,e)}var me=0,ye=1,be=2,_e=3,we=4,ke=5,xe=6,Se=7,De=8;function Me(e){return Oe(e)?366:365}function Oe(e){return e%4==0&&e%100!=0||e%400==0}W("Y",0,0,function(){var e=this.year();return e<=9999?""+e:"+"+e}),W(0,["YY",2],0,function(){return this.year()%100}),W(0,["YYYY",4],0,"year"),W(0,["YYYYY",5],0,"year"),W(0,["YYYYYY",6,!0],0,"year"),F("year","y"),R("year",1),le("Y",se),le("YY",Q,Z),le("YYYY",ie,$),le("YYYYY",ne,K),le("YYYYYY",ne,K),pe(["YYYYY","YYYYYY"],me),pe("YYYY",function(e,t){t[me]=2===e.length?d.parseTwoDigitYear(e):k(e)}),pe("YY",function(e,t){t[me]=d.parseTwoDigitYear(e)}),pe("Y",function(e,t){t[me]=parseInt(e,10)}),d.parseTwoDigitYear=function(e){return k(e)+(68<k(e)?1900:2e3)};var Ee,Te=Ce("FullYear",!0);function Ce(t,i){return function(e){return null!=e?(Fe(this,t,e),d.updateOffset(this,i),this):Pe(this,t)}}function Pe(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function Fe(e,t,i){e.isValid()&&!isNaN(i)&&("FullYear"===t&&Oe(e.year())&&1===e.month()&&29===e.date()?e._d["set"+(e._isUTC?"UTC":"")+t](i,e.month(),Ne(i,e.month())):e._d["set"+(e._isUTC?"UTC":"")+t](i))}function Ne(e,t){if(isNaN(e)||isNaN(t))return NaN;var i=function(e,t){return(e%t+t)%t}(t,12);return e+=(t-i)/12,1===i?Oe(e)?29:28:31-i%7%2}Ee=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},W("M",["MM",2],"Mo",function(){return this.month()+1}),W("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),W("MMMM",0,0,function(e){return this.localeData().months(this,e)}),F("month","M"),R("month",8),le("M",Q),le("MM",Q,Z),le("MMM",function(e,t){return t.monthsShortRegex(e)}),le("MMMM",function(e,t){return t.monthsRegex(e)}),pe(["M","MM"],function(e,t){t[ye]=k(e)-1}),pe(["MMM","MMMM"],function(e,t,i,n){var o=i._locale.monthsParse(e,n,i._strict);null!=o?t[ye]=o:p(i).invalidMonth=e});var Ie=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Ye="January_February_March_April_May_June_July_August_September_October_November_December".split("_");var Re="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");function ze(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=f([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(s,"").toLocaleLowerCase();return i?"MMM"===t?-1!==(o=Ee.call(this._shortMonthsParse,r))?o:null:-1!==(o=Ee.call(this._longMonthsParse,r))?o:null:"MMM"===t?-1!==(o=Ee.call(this._shortMonthsParse,r))?o:-1!==(o=Ee.call(this._longMonthsParse,r))?o:null:-1!==(o=Ee.call(this._longMonthsParse,r))?o:-1!==(o=Ee.call(this._shortMonthsParse,r))?o:null}function Be(e,t){var i;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=k(t);else if(!h(t=e.localeData().monthsParse(t)))return e;return i=Math.min(e.date(),Ne(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,i),e}function Ae(e){return null!=e?(Be(this,e),d.updateOffset(this,!0),this):Pe(this,"Month")}var Le=he;var He=he;function je(){function e(e,t){return t.length-e.length}var t,i,n=[],o=[],s=[];for(t=0;t<12;t++)i=f([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]=ce(n[t]),o[t]=ce(o[t]);for(t=0;t<24;t++)s[t]=ce(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 We(e){var t;if(e<100&&0<=e){var i=Array.prototype.slice.call(arguments);i[0]=e+400,t=new Date(Date.UTC.apply(null,i)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)}else t=new Date(Date.UTC.apply(null,arguments));return t}function Ve(e,t,i){var n=7+t-i,o=(7+We(e,0,n).getUTCDay()-t)%7;return n-o-1}function Ue(e,t,i,n,o){var s,r,a=(7+i-n)%7,h=Ve(e,n,o),d=1+7*(t-1)+a+h;return r=d<=0?Me(s=e-1)+d:d>Me(e)?(s=e+1,d-Me(e)):(s=e,d),{year:s,dayOfYear:r}}function Ge(e,t,i){var n,o,s=Ve(e.year(),t,i),r=Math.floor((e.dayOfYear()-s-1)/7)+1;return r<1?(o=e.year()-1,n=r+qe(o,t,i)):r>qe(e.year(),t,i)?(n=r-qe(e.year(),t,i),o=e.year()+1):(o=e.year(),n=r),{week:n,year:o}}function qe(e,t,i){var n=Ve(e,t,i),o=Ve(e+1,t,i);return(Me(e)-n+o)/7}W("w",["ww",2],"wo","week"),W("W",["WW",2],"Wo","isoWeek"),F("week","w"),F("isoWeek","W"),R("week",5),R("isoWeek",5),le("w",Q),le("ww",Q,Z),le("W",Q),le("WW",Q,Z),ve(["w","ww","W","WW"],function(e,t,i,n){t[n.substr(0,1)]=k(e)});function Ze(e,t){return e.slice(t,7).concat(e.slice(0,t))}W("d",0,"do","day"),W("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),W("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),W("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),W("e",0,0,"weekday"),W("E",0,0,"isoWeekday"),F("day","d"),F("weekday","e"),F("isoWeekday","E"),R("day",11),R("weekday",11),R("isoWeekday",11),le("d",Q),le("e",Q),le("E",Q),le("dd",function(e,t){return t.weekdaysMinRegex(e)}),le("ddd",function(e,t){return t.weekdaysShortRegex(e)}),le("dddd",function(e,t){return t.weekdaysRegex(e)}),ve(["dd","ddd","dddd"],function(e,t,i,n){var o=i._locale.weekdaysParse(e,n,i._strict);null!=o?t.d=o:p(i).invalidWeekday=e}),ve(["d","e","E"],function(e,t,i,n){t[n]=k(e)});var Xe="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");var $e="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");var Ke="Su_Mo_Tu_We_Th_Fr_Sa".split("_");function Qe(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=f([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?-1!==(o=Ee.call(this._weekdaysParse,r))?o:null:"ddd"===t?-1!==(o=Ee.call(this._shortWeekdaysParse,r))?o:null:-1!==(o=Ee.call(this._minWeekdaysParse,r))?o:null:"dddd"===t?-1!==(o=Ee.call(this._weekdaysParse,r))?o:-1!==(o=Ee.call(this._shortWeekdaysParse,r))?o:-1!==(o=Ee.call(this._minWeekdaysParse,r))?o:null:"ddd"===t?-1!==(o=Ee.call(this._shortWeekdaysParse,r))?o:-1!==(o=Ee.call(this._weekdaysParse,r))?o:-1!==(o=Ee.call(this._minWeekdaysParse,r))?o:null:-1!==(o=Ee.call(this._minWeekdaysParse,r))?o:-1!==(o=Ee.call(this._weekdaysParse,r))?o:-1!==(o=Ee.call(this._shortWeekdaysParse,r))?o:null}var Je=he;var et=he;var tt=he;function it(){function e(e,t){return t.length-e.length}var t,i,n,o,s,r=[],a=[],h=[],d=[];for(t=0;t<7;t++)i=f([2e3,1]).day(t),n=this.weekdaysMin(i,""),o=this.weekdaysShort(i,""),s=this.weekdays(i,""),r.push(n),a.push(o),h.push(s),d.push(n),d.push(o),d.push(s);for(r.sort(e),a.sort(e),h.sort(e),d.sort(e),t=0;t<7;t++)a[t]=ce(a[t]),h[t]=ce(h[t]),d[t]=ce(d[t]);this._weekdaysRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+h.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+r.join("|")+")","i")}function nt(){return this.hours()%12||12}function ot(e,t){W(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function st(e,t){return t._meridiemParse}W("H",["HH",2],0,"hour"),W("h",["hh",2],0,nt),W("k",["kk",2],0,function(){return this.hours()||24}),W("hmm",0,0,function(){return""+nt.apply(this)+B(this.minutes(),2)}),W("hmmss",0,0,function(){return""+nt.apply(this)+B(this.minutes(),2)+B(this.seconds(),2)}),W("Hmm",0,0,function(){return""+this.hours()+B(this.minutes(),2)}),W("Hmmss",0,0,function(){return""+this.hours()+B(this.minutes(),2)+B(this.seconds(),2)}),ot("a",!0),ot("A",!1),F("hour","h"),R("hour",13),le("a",st),le("A",st),le("H",Q),le("h",Q),le("k",Q),le("HH",Q,Z),le("hh",Q,Z),le("kk",Q,Z),le("hmm",J),le("hmmss",ee),le("Hmm",J),le("Hmmss",ee),pe(["H","HH"],_e),pe(["k","kk"],function(e,t,i){var n=k(e);t[_e]=24===n?0:n}),pe(["a","A"],function(e,t,i){i._isPm=i._locale.isPM(e),i._meridiem=e}),pe(["h","hh"],function(e,t,i){t[_e]=k(e),p(i).bigHour=!0}),pe("hmm",function(e,t,i){var n=e.length-2;t[_e]=k(e.substr(0,n)),t[we]=k(e.substr(n)),p(i).bigHour=!0}),pe("hmmss",function(e,t,i){var n=e.length-4,o=e.length-2;t[_e]=k(e.substr(0,n)),t[we]=k(e.substr(n,2)),t[ke]=k(e.substr(o)),p(i).bigHour=!0}),pe("Hmm",function(e,t,i){var n=e.length-2;t[_e]=k(e.substr(0,n)),t[we]=k(e.substr(n))}),pe("Hmmss",function(e,t,i){var n=e.length-4,o=e.length-2;t[_e]=k(e.substr(0,n)),t[we]=k(e.substr(n,2)),t[ke]=k(e.substr(o))});var rt,at=Ce("Hours",!0),ht={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{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"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{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"},months:Ye,monthsShort:Re,week:{dow:0,doy:6},weekdays:Xe,weekdaysMin:Ke,weekdaysShort:$e,meridiemParse:/[ap]\.?m?\.?/i},dt={},lt={};function ut(e){return e?e.toLowerCase().replace("_","-"):e}function ct(e){var t=null;if(!dt[e]&&Ji&&Ji.exports)try{t=rt._abbr;var i=en;i("./locale/"+e),ft(t)}catch(e){}return dt[e]}function ft(e,t){var i;return e&&((i=s(t)?vt(e):pt(e,t))?rt=i:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),rt._abbr}function pt(e,t){if(null===t)return delete dt[e],null;var i,n=ht;if(t.abbr=e,null!=dt[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."),n=dt[e]._config;else if(null!=t.parentLocale)if(null!=dt[t.parentLocale])n=dt[t.parentLocale]._config;else{if(null==(i=ct(t.parentLocale)))return lt[t.parentLocale]||(lt[t.parentLocale]=[]),lt[t.parentLocale].push({name:e,config:t}),null;n=i._config}return dt[e]=new C(T(n,t)),lt[e]&&lt[e].forEach(function(e){pt(e.name,e.config)}),ft(e),dt[e]}function vt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return rt;if(!r(e)){if(t=ct(e))return t;e=[e]}return function(e){var t,i,n,o,s=0;for(;s<e.length;){for(o=ut(e[s]).split("-"),t=o.length,i=(i=ut(e[s+1]))?i.split("-"):null;0<t;){if(n=ct(o.slice(0,t).join("-")))return n;if(i&&i.length>=t&&x(o,i,!0)>=t-1)break;t--}s++}return rt}(e)}function gt(e){var t,i=e._a;return i&&-2===p(e).overflow&&(t=i[ye]<0||11<i[ye]?ye:i[be]<1||i[be]>Ne(i[me],i[ye])?be:i[_e]<0||24<i[_e]||24===i[_e]&&(0!==i[we]||0!==i[ke]||0!==i[xe])?_e:i[we]<0||59<i[we]?we:i[ke]<0||59<i[ke]?ke:i[xe]<0||999<i[xe]?xe:-1,p(e)._overflowDayOfYear&&(t<me||be<t)&&(t=be),p(e)._overflowWeeks&&-1===t&&(t=Se),p(e)._overflowWeekday&&-1===t&&(t=De),p(e).overflow=t),e}function mt(e,t,i){return null!=e?e:null!=t?t:i}function yt(e){var t,i,n,o,s,r=[];if(!e._d){for(n=function(e){var t=new Date(d.now());if(e._useUTC)return[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()];return[t.getFullYear(),t.getMonth(),t.getDate()]}(e),e._w&&null==e._a[be]&&null==e._a[ye]&&function(e){var t,i,n,o,s,r,a,h;if(null!=(t=e._w).GG||null!=t.W||null!=t.E)s=1,r=4,i=mt(t.GG,e._a[me],Ge(Nt(),1,4).year),n=mt(t.W,1),((o=mt(t.E,1))<1||7<o)&&(h=!0);else{s=e._locale._week.dow,r=e._locale._week.doy;var d=Ge(Nt(),s,r);i=mt(t.gg,e._a[me],d.year),n=mt(t.w,d.week),null!=t.d?((o=t.d)<0||6<o)&&(h=!0):null!=t.e?(o=t.e+s,(t.e<0||6<t.e)&&(h=!0)):o=s}n<1||n>qe(i,s,r)?p(e)._overflowWeeks=!0:null!=h?p(e)._overflowWeekday=!0:(a=Ue(i,n,o,s,r),e._a[me]=a.year,e._dayOfYear=a.dayOfYear)}(e),null!=e._dayOfYear&&(s=mt(e._a[me],n[me]),(e._dayOfYear>Me(s)||0===e._dayOfYear)&&(p(e)._overflowDayOfYear=!0),i=We(s,0,e._dayOfYear),e._a[ye]=i.getUTCMonth(),e._a[be]=i.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=r[t]=n[t];for(;t<7;t++)e._a[t]=r[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[_e]&&0===e._a[we]&&0===e._a[ke]&&0===e._a[xe]&&(e._nextDay=!0,e._a[_e]=0),e._d=(e._useUTC?We:function(e,t,i,n,o,s,r){var a;e<100&&0<=e?(a=new Date(e+400,t,i,n,o,s,r),isFinite(a.getFullYear())&&a.setFullYear(e)):a=new Date(e,t,i,n,o,s,r);return a}).apply(null,r),o=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[_e]=24),e._w&&void 0!==e._w.d&&e._w.d!==o&&(p(e).weekdayMismatch=!0)}}var bt=/^\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)?)?$/,_t=/^\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)?)?$/,wt=/Z|[+-]\d\d(?::?\d\d)?/,kt=[["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}/]],xt=[["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/]],St=/^\/?Date\((\-?\d+)/i;function Dt(e){var t,i,n,o,s,r,a=e._i,h=bt.exec(a)||_t.exec(a);if(h){for(p(e).iso=!0,t=0,i=kt.length;t<i;t++)if(kt[t][1].exec(h[1])){o=kt[t][0],n=!1!==kt[t][2];break}if(null==o)return void(e._isValid=!1);if(h[3]){for(t=0,i=xt.length;t<i;t++)if(xt[t][1].exec(h[3])){s=(h[2]||" ")+xt[t][0];break}if(null==s)return void(e._isValid=!1)}if(!n&&null!=s)return void(e._isValid=!1);if(h[4]){if(!wt.exec(h[4]))return void(e._isValid=!1);r="Z"}e._f=o+(s||"")+(r||""),Ct(e)}else e._isValid=!1}var Mt=/^(?:(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}))$/;function Ot(e,t,i,n,o,s){var r=[function(e){var t=parseInt(e,10);{if(t<=49)return 2e3+t;if(t<=999)return 1900+t}return t}(e),Re.indexOf(t),parseInt(i,10),parseInt(n,10),parseInt(o,10)];return s&&r.push(parseInt(s,10)),r}var Et={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Tt(e){var t=Mt.exec(function(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}(e._i));if(t){var i=Ot(t[4],t[3],t[2],t[5],t[6],t[7]);if(!function(e,t,i){if(e){var n=$e.indexOf(e),o=new Date(t[0],t[1],t[2]).getDay();if(n!==o)return p(i).weekdayMismatch=!0,i._isValid=!1}return!0}(t[1],i,e))return;e._a=i,e._tzm=function(e,t,i){{if(e)return Et[e];if(t)return 0;var n=parseInt(i,10),o=n%100;return 60*((n-o)/100)+o}}(t[8],t[9],t[10]),e._d=We.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),p(e).rfc2822=!0}else e._isValid=!1}function Ct(e){if(e._f!==d.ISO_8601)if(e._f!==d.RFC_2822){e._a=[],p(e).empty=!0;var t,i,n,o,s,r=""+e._i,a=r.length,h=0;for(n=G(e._f,e._locale).match(A)||[],t=0;t<n.length;t++)o=n[t],(i=(r.match(ue(o,e))||[])[0])&&(0<(s=r.substr(0,r.indexOf(i))).length&&p(e).unusedInput.push(s),r=r.slice(r.indexOf(i)+i.length),h+=i.length),j[o]?(i?p(e).empty=!1:p(e).unusedTokens.push(o),ge(o,i,e)):e._strict&&!i&&p(e).unusedTokens.push(o);p(e).charsLeftOver=a-h,0<r.length&&p(e).unusedInput.push(r),e._a[_e]<=12&&!0===p(e).bigHour&&0<e._a[_e]&&(p(e).bigHour=void 0),p(e).parsedDateParts=e._a.slice(0),p(e).meridiem=e._meridiem,e._a[_e]=function(e,t,i){var n;if(null==i)return t;return null!=e.meridiemHour?e.meridiemHour(t,i):(null!=e.isPM&&((n=e.isPM(i))&&t<12&&(t+=12),n||12!==t||(t=0)),t)}(e._locale,e._a[_e],e._meridiem),yt(e),gt(e)}else Tt(e);else Dt(e)}function Pt(e){var t=e._i,i=e._f;return e._locale=e._locale||vt(e._l),null===t||void 0===i&&""===t?g({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),_(t)?new b(gt(t)):(l(t)?e._d=t:r(i)?function(e){var t,i,n,o,s;if(0===e._f.length)return p(e).invalidFormat=!0,e._d=new Date(NaN);for(o=0;o<e._f.length;o++)s=0,t=y({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[o],Ct(t),v(t)&&(s+=p(t).charsLeftOver,s+=10*p(t).unusedTokens.length,p(t).score=s,(null==n||s<n)&&(n=s,i=t));c(e,i||t)}(e):i?Ct(e):function(e){var t=e._i;s(t)?e._d=new Date(d.now()):l(t)?e._d=new Date(t.valueOf()):"string"==typeof t?function(e){var t=St.exec(e._i);if(null!==t)return e._d=new Date(+t[1]);{if(Dt(e),!1!==e._isValid)return;delete e._isValid}{if(Tt(e),!1!==e._isValid)return;delete e._isValid}d.createFromInputFallback(e)}(e):r(t)?(e._a=n(t.slice(0),function(e){return parseInt(e,10)}),yt(e)):a(t)?function(e){if(e._d)return;var t=I(e._i);e._a=n([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),yt(e)}(e):h(t)?e._d=new Date(t):d.createFromInputFallback(e)}(e),v(e)||(e._d=null),e))}function Ft(e,t,i,n,o){var s={};return!0!==i&&!1!==i||(n=i,i=void 0),(a(e)&&function(e){{if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0}}(e)||r(e)&&0===e.length)&&(e=void 0),s._isAMomentObject=!0,s._useUTC=s._isUTC=o,s._l=i,s._i=e,s._f=t,s._strict=n,function(e){var t=new b(gt(Pt(e)));t._nextDay&&(t.add(1,"d"),t._nextDay=void 0);return t}(s)}function Nt(e,t,i,n){return Ft(e,t,i,n,!1)}d.createFromInputFallback=e("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":""))}),d.ISO_8601=function(){},d.RFC_2822=function(){};var It=e("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Nt.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:g()}),Yt=e("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Nt.apply(null,arguments);return this.isValid()&&e.isValid()?this<e?this:e:g()});function Rt(e,t){var i,n;if(1===t.length&&r(t[0])&&(t=t[0]),!t.length)return Nt();for(i=t[0],n=1;n<t.length;++n)t[n].isValid()&&!t[n][e](i)||(i=t[n]);return i}var zt=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Bt(e){var t=I(e),i=t.year||0,n=t.quarter||0,o=t.month||0,s=t.week||t.isoWeek||0,r=t.day||0,a=t.hour||0,h=t.minute||0,d=t.second||0,l=t.millisecond||0;this._isValid=function(e){for(var t in e)if(-1===Ee.call(zt,t)||null!=e[t]&&isNaN(e[t]))return!1;for(var i=!1,n=0;n<zt.length;++n)if(e[zt[n]]){if(i)return!1;parseFloat(e[zt[n]])!==k(e[zt[n]])&&(i=!0)}return!0}(t),this._milliseconds=+l+1e3*d+6e4*h+1e3*a*60*60,this._days=+r+7*s,this._months=+o+3*n+12*i,this._data={},this._locale=vt(),this._bubble()}function At(e){return e instanceof Bt}function Lt(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Ht(e,i){W(e,0,0,function(){var e=this.utcOffset(),t="+";return e<0&&(e=-e,t="-"),t+B(~~(e/60),2)+i+B(~~e%60,2)})}Ht("Z",":"),Ht("ZZ",""),le("Z",ae),le("ZZ",ae),pe(["Z","ZZ"],function(e,t,i){i._useUTC=!0,i._tzm=Wt(ae,e)});var jt=/([\+\-]|\d\d)/gi;function Wt(e,t){var i=(t||"").match(e);if(null===i)return null;var n=i[i.length-1]||[],o=(n+"").match(jt)||["-",0,0],s=60*o[1]+k(o[2]);return 0===s?0:"+"===o[0]?s:-s}function Vt(e,t){var i,n;return t._isUTC?(i=t.clone(),n=(_(e)||l(e)?e.valueOf():Nt(e).valueOf())-i.valueOf(),i._d.setTime(i._d.valueOf()+n),d.updateOffset(i,!1),i):Nt(e).local()}function Ut(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Gt(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}d.updateOffset=function(){};var qt=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Zt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Xt(e,t){var i,n,o,s=e,r=null;return At(e)?s={ms:e._milliseconds,d:e._days,M:e._months}:h(e)?(s={},t?s[t]=e:s.milliseconds=e):(r=qt.exec(e))?(i="-"===r[1]?-1:1,s={y:0,d:k(r[be])*i,h:k(r[_e])*i,m:k(r[we])*i,s:k(r[ke])*i,ms:k(Lt(1e3*r[xe]))*i}):(r=Zt.exec(e))?(i="-"===r[1]?-1:1,s={y:$t(r[2],i),M:$t(r[3],i),w:$t(r[4],i),d:$t(r[5],i),h:$t(r[6],i),m:$t(r[7],i),s:$t(r[8],i)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(o=function(e,t){var i;if(!e.isValid()||!t.isValid())return{milliseconds:0,months:0};t=Vt(t,e),e.isBefore(t)?i=Kt(e,t):((i=Kt(t,e)).milliseconds=-i.milliseconds,i.months=-i.months);return i}(Nt(s.from),Nt(s.to)),(s={}).ms=o.milliseconds,s.M=o.months),n=new Bt(s),At(e)&&u(e,"_locale")&&(n._locale=e._locale),n}function $t(e,t){var i=e&&parseFloat(e.replace(",","."));return(isNaN(i)?0:i)*t}function Kt(e,t){var i={};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 Qt(n,o){return function(e,t){var i;return null===t||isNaN(+t)||(O(o,"moment()."+o+"(period, number) is deprecated. Please use moment()."+o+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=e,e=t,t=i),Jt(this,Xt(e="string"==typeof e?+e:e,t),n),this}}function Jt(e,t,i,n){var o=t._milliseconds,s=Lt(t._days),r=Lt(t._months);e.isValid()&&(n=null==n||n,r&&Be(e,Pe(e,"Month")+r*i),s&&Fe(e,"Date",Pe(e,"Date")+s*i),o&&e._d.setTime(e._d.valueOf()+o*i),n&&d.updateOffset(e,s||r))}Xt.fn=Bt.prototype,Xt.invalid=function(){return Xt(NaN)};var ei=Qt(1,"add"),ti=Qt(-1,"subtract");function ii(e,t){var i,n,o=12*(t.year()-e.year())+(t.month()-e.month()),s=e.clone().add(o,"months");return n=t-s<0?(i=e.clone().add(o-1,"months"),(t-s)/(s-i)):(i=e.clone().add(1+o,"months"),(t-s)/(i-s)),-(o+n)||0}function ni(e){var t;return void 0===e?this._locale._abbr:(null!=(t=vt(e))&&(this._locale=t),this)}d.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",d.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var oi=e("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)});function si(){return this._locale}var ri=126227808e5;function ai(e,t){return(e%t+t)%t}function hi(e,t,i){return e<100&&0<=e?new Date(e+400,t,i)-ri:new Date(e,t,i).valueOf()}function di(e,t,i){return e<100&&0<=e?Date.UTC(e+400,t,i)-ri:Date.UTC(e,t,i)}function li(e,t){W(0,[e,e.length],0,t)}function ui(e,t,i,n,o){var s;return null==e?Ge(this,n,o).year:((s=qe(e,n,o))<t&&(t=s),function(e,t,i,n,o){var s=Ue(e,t,i,n,o),r=We(s.year,0,s.dayOfYear);return this.year(r.getUTCFullYear()),this.month(r.getUTCMonth()),this.date(r.getUTCDate()),this}.call(this,e,t,i,n,o))}W(0,["gg",2],0,function(){return this.weekYear()%100}),W(0,["GG",2],0,function(){return this.isoWeekYear()%100}),li("gggg","weekYear"),li("ggggg","weekYear"),li("GGGG","isoWeekYear"),li("GGGGG","isoWeekYear"),F("weekYear","gg"),F("isoWeekYear","GG"),R("weekYear",1),R("isoWeekYear",1),le("G",se),le("g",se),le("GG",Q,Z),le("gg",Q,Z),le("GGGG",ie,$),le("gggg",ie,$),le("GGGGG",ne,K),le("ggggg",ne,K),ve(["gggg","ggggg","GGGG","GGGGG"],function(e,t,i,n){t[n.substr(0,2)]=k(e)}),ve(["gg","GG"],function(e,t,i,n){t[n]=d.parseTwoDigitYear(e)}),W("Q",0,"Qo","quarter"),F("quarter","Q"),R("quarter",7),le("Q",q),pe("Q",function(e,t){t[ye]=3*(k(e)-1)}),W("D",["DD",2],"Do","date"),F("date","D"),R("date",9),le("D",Q),le("DD",Q,Z),le("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),pe(["D","DD"],be),pe("Do",function(e,t){t[be]=k(e.match(Q)[0])});var ci=Ce("Date",!0);W("DDD",["DDDD",3],"DDDo","dayOfYear"),F("dayOfYear","DDD"),R("dayOfYear",4),le("DDD",te),le("DDDD",X),pe(["DDD","DDDD"],function(e,t,i){i._dayOfYear=k(e)}),W("m",["mm",2],0,"minute"),F("minute","m"),R("minute",14),le("m",Q),le("mm",Q,Z),pe(["m","mm"],we);var fi=Ce("Minutes",!1);W("s",["ss",2],0,"second"),F("second","s"),R("second",15),le("s",Q),le("ss",Q,Z),pe(["s","ss"],ke);var pi,vi=Ce("Seconds",!1);for(W("S",0,0,function(){return~~(this.millisecond()/100)}),W(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),W(0,["SSS",3],0,"millisecond"),W(0,["SSSS",4],0,function(){return 10*this.millisecond()}),W(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),W(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),W(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),W(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),W(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),F("millisecond","ms"),R("millisecond",16),le("S",te,q),le("SS",te,Z),le("SSS",te,X),pi="SSSS";pi.length<=9;pi+="S")le(pi,oe);function gi(e,t){t[xe]=k(1e3*("0."+e))}for(pi="S";pi.length<=9;pi+="S")pe(pi,gi);var mi=Ce("Milliseconds",!1);W("z",0,0,"zoneAbbr"),W("zz",0,0,"zoneName");var yi=b.prototype;function bi(e){return e}yi.add=ei,yi.calendar=function(e,t){var i=e||Nt(),n=Vt(i,this).startOf("day"),o=d.calendarFormat(this,n)||"sameElse",s=t&&(E(t[o])?t[o].call(this,i):t[o]);return this.format(s||this.localeData().calendar(o,this,Nt(i)))},yi.clone=function(){return new b(this)},yi.diff=function(e,t,i){var n,o,s;if(!this.isValid())return NaN;if(!(n=Vt(e,this)).isValid())return NaN;switch(o=6e4*(n.utcOffset()-this.utcOffset()),t=N(t)){case"year":s=ii(this,n)/12;break;case"month":s=ii(this,n);break;case"quarter":s=ii(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:w(s)},yi.endOf=function(e){var t;if(void 0===(e=N(e))||"millisecond"===e||!this.isValid())return this;var i=this._isUTC?di:hi;switch(e){case"year":t=i(this.year()+1,0,1)-1;break;case"quarter":t=i(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=i(this.year(),this.month()+1,1)-1;break;case"week":t=i(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=i(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=i(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=36e5-ai(t+(this._isUTC?0:6e4*this.utcOffset()),36e5)-1;break;case"minute":t=this._d.valueOf(),t+=6e4-ai(t,6e4)-1;break;case"second":t=this._d.valueOf(),t+=1e3-ai(t,1e3)-1}return this._d.setTime(t),d.updateOffset(this,!0),this},yi.format=function(e){e=e||(this.isUtc()?d.defaultFormatUtc:d.defaultFormat);var t=U(this,e);return this.localeData().postformat(t)},yi.from=function(e,t){return this.isValid()&&(_(e)&&e.isValid()||Nt(e).isValid())?Xt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},yi.fromNow=function(e){return this.from(Nt(),e)},yi.to=function(e,t){return this.isValid()&&(_(e)&&e.isValid()||Nt(e).isValid())?Xt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},yi.toNow=function(e){return this.to(Nt(),e)},yi.get=function(e){if(E(this[e=N(e)]))return this[e]();return this},yi.invalidAt=function(){return p(this).overflow},yi.isAfter=function(e,t){var i=_(e)?e:Nt(e);if(!this.isValid()||!i.isValid())return!1;return"millisecond"===(t=N(t)||"millisecond")?this.valueOf()>i.valueOf():i.valueOf()<this.clone().startOf(t).valueOf()},yi.isBefore=function(e,t){var i=_(e)?e:Nt(e);if(!this.isValid()||!i.isValid())return!1;return"millisecond"===(t=N(t)||"millisecond")?this.valueOf()<i.valueOf():this.clone().endOf(t).valueOf()<i.valueOf()},yi.isBetween=function(e,t,i,n){var o=_(e)?e:Nt(e),s=_(t)?t:Nt(t);return!!(this.isValid()&&o.isValid()&&s.isValid())&&(("("===(n=n||"()")[0]?this.isAfter(o,i):!this.isBefore(o,i))&&(")"===n[1]?this.isBefore(s,i):!this.isAfter(s,i)))},yi.isSame=function(e,t){var i,n=_(e)?e:Nt(e);if(!this.isValid()||!n.isValid())return!1;return"millisecond"===(t=N(t)||"millisecond")?this.valueOf()===n.valueOf():(i=n.valueOf(),this.clone().startOf(t).valueOf()<=i&&i<=this.clone().endOf(t).valueOf())},yi.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},yi.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},yi.isValid=function(){return v(this)},yi.lang=oi,yi.locale=ni,yi.localeData=si,yi.max=Yt,yi.min=It,yi.parsingFlags=function(){return c({},p(this))},yi.set=function(e,t){if("object"==typeof e)for(var i=z(e=I(e)),n=0;n<i.length;n++)this[i[n].unit](e[i[n].unit]);else if(E(this[e=N(e)]))return this[e](t);return this},yi.startOf=function(e){var t;if(void 0===(e=N(e))||"millisecond"===e||!this.isValid())return this;var i=this._isUTC?di:hi;switch(e){case"year":t=i(this.year(),0,1);break;case"quarter":t=i(this.year(),this.month()-this.month()%3,1);break;case"month":t=i(this.year(),this.month(),1);break;case"week":t=i(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=i(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=i(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=ai(t+(this._isUTC?0:6e4*this.utcOffset()),36e5);break;case"minute":t=this._d.valueOf(),t-=ai(t,6e4);break;case"second":t=this._d.valueOf(),t-=ai(t,1e3)}return this._d.setTime(t),d.updateOffset(this,!0),this},yi.subtract=ti,yi.toArray=function(){return[this.year(),this.month(),this.date(),this.hour(),this.minute(),this.second(),this.millisecond()]},yi.toObject=function(){return{years:this.year(),months:this.month(),date:this.date(),hours:this.hours(),minutes:this.minutes(),seconds:this.seconds(),milliseconds:this.milliseconds()}},yi.toDate=function(){return new Date(this.valueOf())},yi.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,i=t?this.clone().utc():this;if(i.year()<0||9999<i.year())return U(i,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ");if(E(Date.prototype.toISOString))return t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",U(i,"Z"));return U(i,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},yi.inspect=function(){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)},yi.toJSON=function(){return this.isValid()?this.toISOString():null},yi.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},yi.unix=function(){return Math.floor(this.valueOf()/1e3)},yi.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},yi.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},yi.year=Te,yi.isLeapYear=function(){return Oe(this.year())},yi.weekYear=function(e){return ui.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},yi.isoWeekYear=function(e){return ui.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},yi.quarter=yi.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},yi.month=Ae,yi.daysInMonth=function(){return Ne(this.year(),this.month())},yi.week=yi.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},yi.isoWeek=yi.isoWeeks=function(e){var t=Ge(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},yi.weeksInYear=function(){var e=this.localeData()._week;return qe(this.year(),e.dow,e.doy)},yi.isoWeeksInYear=function(){return qe(this.year(),1,4)},yi.date=ci,yi.day=yi.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(i=e,n=this.localeData(),e="string"==typeof i?isNaN(i)?"number"!=typeof(i=n.weekdaysParse(i))?null:i:parseInt(i,10):i,this.add(e-t,"d")):t;var i,n},yi.weekday=function(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")},yi.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;{if(null==e)return this.day()||7;var t=(i=e,n=this.localeData(),"string"!=typeof i?isNaN(i)?null:i:n.weekdaysParse(i)%7||7);return this.day(this.day()%7?t:t-7)}var i,n},yi.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},yi.hour=yi.hours=at,yi.minute=yi.minutes=fi,yi.second=yi.seconds=vi,yi.millisecond=yi.milliseconds=mi,yi.utcOffset=function(e,t,i){var n,o=this._offset||0;if(!this.isValid())return null!=e?this:NaN;{if(null==e)return this._isUTC?o:Ut(this);if("string"==typeof e){if(null===(e=Wt(ae,e)))return this}else Math.abs(e)<16&&!i&&(e*=60);return!this._isUTC&&t&&(n=Ut(this)),this._offset=e,this._isUTC=!0,null!=n&&this.add(n,"m"),o!==e&&(!t||this._changeInProgress?Jt(this,Xt(e-o,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,d.updateOffset(this,!0),this._changeInProgress=null)),this}},yi.utc=function(e){return this.utcOffset(0,e)},yi.local=function(e){this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Ut(this),"m"));return this},yi.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=Wt(re,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},yi.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Nt(e).utcOffset():0,(this.utcOffset()-e)%60==0)},yi.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},yi.isLocal=function(){return!!this.isValid()&&!this._isUTC},yi.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},yi.isUtc=Gt,yi.isUTC=Gt,yi.zoneAbbr=function(){return this._isUTC?"UTC":""},yi.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},yi.dates=e("dates accessor is deprecated. Use date instead.",ci),yi.months=e("months accessor is deprecated. Use month instead",Ae),yi.years=e("years accessor is deprecated. Use year instead",Te),yi.zone=e("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),yi.isDSTShifted=e("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!s(this._isDSTShifted))return this._isDSTShifted;var e={};if(y(e,this),(e=Pt(e))._a){var t=e._isUTC?f(e._a):Nt(e._a);this._isDSTShifted=this.isValid()&&0<x(e._a,t.toArray())}else this._isDSTShifted=!1;return this._isDSTShifted});var _i=C.prototype;function wi(e,t,i,n){var o=vt(),s=f().set(n,t);return o[i](s,e)}function ki(e,t,i){if(h(e)&&(t=e,e=void 0),e=e||"",null!=t)return wi(e,t,i,"month");var n,o=[];for(n=0;n<12;n++)o[n]=wi(e,n,i,"month");return o}function xi(e,t,i,n){t=("boolean"==typeof e?h(t)&&(i=t,t=void 0):(t=e,e=!1,h(i=t)&&(i=t,t=void 0)),t||"");var o,s=vt(),r=e?s._week.dow:0;if(null!=i)return wi(t,(i+r)%7,n,"day");var a=[];for(o=0;o<7;o++)a[o]=wi(t,(o+r)%7,n,"day");return a}_i.calendar=function(e,t,i){var n=this._calendar[e]||this._calendar.sameElse;return E(n)?n.call(t,i):n},_i.longDateFormat=function(e){var t=this._longDateFormat[e],i=this._longDateFormat[e.toUpperCase()];return!t&&i?(this._longDateFormat[e]=i.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e]):t},_i.invalidDate=function(){return this._invalidDate},_i.ordinal=function(e){return this._ordinal.replace("%d",e)},_i.preparse=bi,_i.postformat=bi,_i.relativeTime=function(e,t,i,n){var o=this._relativeTime[i];return E(o)?o(e,t,i,n):o.replace(/%d/i,e)},_i.pastFuture=function(e,t){var i=this._relativeTime[0<e?"future":"past"];return E(i)?i(t):i.replace(/%s/i,t)},_i.set=function(e){var t,i;for(i in e)E(t=e[i])?this[i]=t:this["_"+i]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},_i.months=function(e,t){return e?r(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Ie).test(t)?"format":"standalone"][e.month()]:r(this._months)?this._months:this._months.standalone},_i.monthsShort=function(e,t){return e?r(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Ie.test(t)?"format":"standalone"][e.month()]:r(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},_i.monthsParse=function(e,t,i){var n,o,s;if(this._monthsParseExact)return ze.call(this,e,t,i);this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]);for(n=0;n<12;n++){if(o=f([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}},_i.monthsRegex=function(e){return this._monthsParseExact?(u(this,"_monthsRegex")||je.call(this),e?this._monthsStrictRegex:this._monthsRegex):(u(this,"_monthsRegex")||(this._monthsRegex=He),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},_i.monthsShortRegex=function(e){return this._monthsParseExact?(u(this,"_monthsRegex")||je.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(u(this,"_monthsShortRegex")||(this._monthsShortRegex=Le),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},_i.week=function(e){return Ge(e,this._week.dow,this._week.doy).week},_i.firstDayOfYear=function(){return this._week.doy},_i.firstDayOfWeek=function(){return this._week.dow},_i.weekdays=function(e,t){var i=r(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Ze(i,this._week.dow):e?i[e.day()]:i},_i.weekdaysMin=function(e){return!0===e?Ze(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},_i.weekdaysShort=function(e){return!0===e?Ze(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},_i.weekdaysParse=function(e,t,i){var n,o,s;if(this._weekdaysParseExact)return Qe.call(this,e,t,i);this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]);for(n=0;n<7;n++){if(o=f([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}},_i.weekdaysRegex=function(e){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||it.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(u(this,"_weekdaysRegex")||(this._weekdaysRegex=Je),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},_i.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||it.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(u(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=et),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},_i.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||it.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(u(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=tt),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},_i.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},_i.meridiem=function(e,t,i){return 11<e?i?"pm":"PM":i?"am":"AM"},ft("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,i=1===k(e%100/10)?"th":1==t?"st":2==t?"nd":3==t?"rd":"th";return e+i}}),d.lang=e("moment.lang is deprecated. Use moment.locale instead.",ft),d.langData=e("moment.langData is deprecated. Use moment.localeData instead.",vt);var Si=Math.abs;function Di(e,t,i,n){var o=Xt(t,i);return e._milliseconds+=n*o._milliseconds,e._days+=n*o._days,e._months+=n*o._months,e._bubble()}function Mi(e){return e<0?Math.floor(e):Math.ceil(e)}function Oi(e){return 4800*e/146097}function Ei(e){return 146097*e/4800}function Ti(e){return function(){return this.as(e)}}var Ci=Ti("ms"),Pi=Ti("s"),Fi=Ti("m"),Ni=Ti("h"),Ii=Ti("d"),Yi=Ti("w"),Ri=Ti("M"),zi=Ti("Q"),Bi=Ti("y");function Ai(e){return function(){return this.isValid()?this._data[e]:NaN}}var Li=Ai("milliseconds"),Hi=Ai("seconds"),ji=Ai("minutes"),Wi=Ai("hours"),Vi=Ai("days"),Ui=Ai("months"),Gi=Ai("years");var qi=Math.round,Zi={ss:44,s:45,m:45,h:22,d:26,M:11};var Xi=Math.abs;function $i(e){return(0<e)-(e<0)||+e}function Ki(){if(!this.isValid())return this.localeData().invalidDate();var e,t,i=Xi(this._milliseconds)/1e3,n=Xi(this._days),o=Xi(this._months);e=w(i/60),t=w(e/60),i%=60,e%=60;var s=w(o/12),r=o%=12,a=n,h=t,d=e,l=i?i.toFixed(3).replace(/\.?0+$/,""):"",u=this.asSeconds();if(!u)return"P0D";var c=u<0?"-":"",f=$i(this._months)!==$i(u)?"-":"",p=$i(this._days)!==$i(u)?"-":"",v=$i(this._milliseconds)!==$i(u)?"-":"";return c+"P"+(s?f+s+"Y":"")+(r?f+r+"M":"")+(a?p+a+"D":"")+(h||d||l?"T":"")+(h?v+h+"H":"")+(d?v+d+"M":"")+(l?v+l+"S":"")}var Qi=Bt.prototype;return Qi.isValid=function(){return this._isValid},Qi.abs=function(){var e=this._data;return this._milliseconds=Si(this._milliseconds),this._days=Si(this._days),this._months=Si(this._months),e.milliseconds=Si(e.milliseconds),e.seconds=Si(e.seconds),e.minutes=Si(e.minutes),e.hours=Si(e.hours),e.months=Si(e.months),e.years=Si(e.years),this},Qi.add=function(e,t){return Di(this,e,t,1)},Qi.subtract=function(e,t){return Di(this,e,t,-1)},Qi.as=function(e){if(!this.isValid())return NaN;var t,i,n=this._milliseconds;if("month"===(e=N(e))||"quarter"===e||"year"===e)switch(t=this._days+n/864e5,i=this._months+Oi(t),e){case"month":return i;case"quarter":return i/3;case"year":return i/12}else switch(t=this._days+Math.round(Ei(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)}},Qi.asMilliseconds=Ci,Qi.asSeconds=Pi,Qi.asMinutes=Fi,Qi.asHours=Ni,Qi.asDays=Ii,Qi.asWeeks=Yi,Qi.asMonths=Ri,Qi.asQuarters=zi,Qi.asYears=Bi,Qi.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*k(this._months/12):NaN},Qi._bubble=function(){var e,t,i,n,o,s=this._milliseconds,r=this._days,a=this._months,h=this._data;return 0<=s&&0<=r&&0<=a||s<=0&&r<=0&&a<=0||(s+=864e5*Mi(Ei(a)+r),a=r=0),h.milliseconds=s%1e3,e=w(s/1e3),h.seconds=e%60,t=w(e/60),h.minutes=t%60,i=w(t/60),h.hours=i%24,r+=w(i/24),o=w(Oi(r)),a+=o,r-=Mi(Ei(o)),n=w(a/12),a%=12,h.days=r,h.months=a,h.years=n,this},Qi.clone=function(){return Xt(this)},Qi.get=function(e){return e=N(e),this.isValid()?this[e+"s"]():NaN},Qi.milliseconds=Li,Qi.seconds=Hi,Qi.minutes=ji,Qi.hours=Wi,Qi.days=Vi,Qi.weeks=function(){return w(this.days()/7)},Qi.months=Ui,Qi.years=Gi,Qi.humanize=function(e){if(!this.isValid())return this.localeData().invalidDate();var t=this.localeData(),i=function(e,t,i){var n=Xt(e).abs(),o=qi(n.as("s")),s=qi(n.as("m")),r=qi(n.as("h")),a=qi(n.as("d")),h=qi(n.as("M")),d=qi(n.as("y")),l=o<=Zi.ss&&["s",o]||o<Zi.s&&["ss",o]||s<=1&&["m"]||s<Zi.m&&["mm",s]||r<=1&&["h"]||r<Zi.h&&["hh",r]||a<=1&&["d"]||a<Zi.d&&["dd",a]||h<=1&&["M"]||h<Zi.M&&["MM",h]||d<=1&&["y"]||["yy",d];return l[2]=t,l[3]=0<+e,l[4]=i,function(e,t,i,n,o){return o.relativeTime(t||1,!!i,e,n)}.apply(null,l)}(this,!e,t);return e&&(i=t.pastFuture(+this,i)),t.postformat(i)},Qi.toISOString=Ki,Qi.toString=Ki,Qi.toJSON=Ki,Qi.locale=ni,Qi.localeData=si,Qi.toIsoString=e("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ki),Qi.lang=oi,W("X",0,0,"unix"),W("x",0,0,"valueOf"),le("x",se),le("X",/[+-]?\d+(\.\d{1,3})?/),pe("X",function(e,t,i){i._d=new Date(1e3*parseFloat(e,10))}),pe("x",function(e,t,i){i._d=new Date(k(e))}),d.version="2.24.0",function(e){t=e}(Nt),d.fn=yi,d.min=function(){return Rt("isBefore",[].slice.call(arguments,0))},d.max=function(){return Rt("isAfter",[].slice.call(arguments,0))},d.now=function(){return Date.now?Date.now():+new Date},d.utc=f,d.unix=function(e){return Nt(1e3*e)},d.months=function(e,t){return ki(e,t,"months")},d.isDate=l,d.locale=ft,d.invalid=g,d.duration=Xt,d.isMoment=_,d.weekdays=function(e,t,i){return xi(e,t,i,"weekdays")},d.parseZone=function(){return Nt.apply(null,arguments).parseZone()},d.localeData=vt,d.isDuration=At,d.monthsShort=function(e,t){return ki(e,t,"monthsShort")},d.weekdaysMin=function(e,t,i){return xi(e,t,i,"weekdaysMin")},d.defineLocale=pt,d.updateLocale=function(e,t){if(null!=t){var i,n,o=ht;null!=(n=ct(e))&&(o=n._config),t=T(o,t),(i=new C(t)).parentLocale=dt[e],dt[e]=i,ft(e)}else null!=dt[e]&&(null!=dt[e].parentLocale?dt[e]=dt[e].parentLocale:null!=dt[e]&&delete dt[e]);return dt[e]},d.locales=function(){return D(dt)},d.weekdaysShort=function(e,t,i){return xi(e,t,i,"weekdaysShort")},d.normalizeUnits=N,d.relativeTimeRounding=function(e){return void 0!==e?"function"==typeof e&&(qi=e,!0):qi},d.relativeTimeThreshold=function(e,t){return void 0!==Zi[e]&&(void 0===t?Zi[e]:(Zi[e]=t,"s"===e&&(Zi.ss=t-1),!0))},d.calendarFormat=function(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"},d.prototype=yi,d.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},d}()}),wn="undefined"!=typeof window&&window.moment||_n,kn=t(function(e,i){i.util=z,i.DOMutil=B;var t=Ee.DataSet,n=Ee.DataView,o=Ee.Queue;i.DataSet=t,i.DataView=n,i.Queue=o,i.Network=bn,i.network={Images:Mt,dotparser:rt,gephiParser:at,allOptions:gn},i.network.convertDot=function(e){return i.network.dotparser.DOTToGraph(e)},i.network.convertGephi=function(e,t){return i.network.gephiParser.parseGephi(e,t)},i.moment=wn,i.Hammer=ut,i.keycharm=ht}),xn=kn.util,Sn=kn.DOMutil,Dn=kn.DataSet,Mn=kn.DataView,On=kn.Queue,En=kn.Network,Tn=kn.network,Cn=kn.moment,Pn=kn.Hammer,Fn=kn.keycharm;e.DOMutil=Sn,e.DataSet=Dn,e.DataView=Mn,e.Hammer=Pn,e.Network=En,e.Queue=On,e.default=kn,e.keycharm=Fn,e.moment=Cn,e.network=Tn,e.util=xn,Object.defineProperty(e,"__esModule",{value:!0})});