diff --git a/dist/vis-graph3d.min.js b/dist/vis-graph3d.min.js index 04da1297..4047cbdf 100644 --- a/dist/vis-graph3d.min.js +++ b/dist/vis-graph3d.min.js @@ -4,8 +4,8 @@ * * A dynamic, browser-based visualization library. * - * @version 4.17.0 - * @date 2016-11-05 + * @version 4.18.0 + * @date 2017-01-15 * * @license * Copyright (C) 2011-2016 Almende B.V, http://almende.com @@ -22,12 +22,13 @@ * * Vis.js may be distributed under either license. */ -"use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.vis=e():t.vis=e()}(this,function(){return function(t){function e(n){if(i[n])return i[n].exports;var r=i[n]={exports:{},id:n,loaded:!1};return t[n].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){e.util=i(1),e.DOMutil=i(7),e.DataSet=i(8),e.DataView=i(10),e.Queue=i(9),e.Graph3d=i(11),e.graph3d={Camera:i(15),Filter:i(16),Point2d:i(14),Point3d:i(13),Slider:i(17),StepNumber:i(18)},e.moment=i(2),e.Hammer=i(21),e.keycharm=i(24)},function(t,e,i){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=i(2),o=i(6);e.isNumber=function(t){return t instanceof Number||"number"==typeof t},e.recursiveDOMDelete=function(t){if(t)for(;t.hasChildNodes()===!0;)e.recursiveDOMDelete(t.firstChild),t.removeChild(t.firstChild)},e.giveRange=function(t,e,i,n){if(e==t)return.5;var r=1/(e-t);return Math.max(0,(n-t)*r)},e.isString=function(t){return t instanceof String||"string"==typeof t},e.isDate=function(t){if(t instanceof Date)return!0;if(e.isString(t)){var i=s.exec(t);if(i)return!0;if(!isNaN(Date.parse(t)))return!0}return!1},e.randomUUID=function(){return o.v4()},e.assignAllKeys=function(t,e){for(var i in t)t.hasOwnProperty(i)&&"object"!==n(t[i])&&(t[i]=e)},e.fillIfDefined=function(t,i){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(var o in t)void 0!==i[o]&&("object"!==n(i[o])?void 0!==i[o]&&null!==i[o]||void 0===t[o]||r!==!0?t[o]=i[o]:delete t[o]:"object"===n(t[o])&&e.fillIfDefined(t[o],i[o],r))},e.protoExtend=function(t,e){for(var i=1;i3&&void 0!==arguments[3]&&arguments[3];if(Array.isArray(n))throw new TypeError("Arrays are not supported by deepExtend");for(var o=2;o3&&void 0!==arguments[3]&&arguments[3];if(Array.isArray(n))throw new TypeError("Arrays are not supported by deepExtend");for(var o in n)if(n.hasOwnProperty(o)&&t.indexOf(o)==-1)if(n[o]&&n[o].constructor===Object)void 0===i[o]&&(i[o]={}),i[o].constructor===Object?e.deepExtend(i[o],n[o]):null===n[o]&&void 0!==i[o]&&r===!0?delete i[o]:i[o]=n[o];else if(Array.isArray(n[o])){i[o]=[];for(var s=0;s=0&&(e="DOMMouseScroll"),t.addEventListener(e,i,n)):t.attachEvent("on"+e,i)},e.removeEventListener=function(t,e,i,n){t.removeEventListener?(void 0===n&&(n=!1),"mousewheel"===e&&navigator.userAgent.indexOf("Firefox")>=0&&(e="DOMMouseScroll"),t.removeEventListener(e,i,n)):t.detachEvent("on"+e,i)},e.preventDefault=function(t){t||(t=window.event),t.preventDefault?t.preventDefault():t.returnValue=!1},e.getTarget=function(t){t||(t=window.event);var e;return t.target?e=t.target:t.srcElement&&(e=t.srcElement),void 0!=e.nodeType&&3==e.nodeType&&(e=e.parentNode),e},e.hasParent=function(t,e){for(var i=t;i;){if(i===e)return!0;i=i.parentNode}return!1},e.option={},e.option.asBoolean=function(t,e){return"function"==typeof t&&(t=t()),null!=t?0!=t:e||null},e.option.asNumber=function(t,e){return"function"==typeof t&&(t=t()),null!=t?Number(t)||e||null:e||null},e.option.asString=function(t,e){return"function"==typeof t&&(t=t()),null!=t?String(t):e||null},e.option.asSize=function(t,i){return"function"==typeof t&&(t=t()),e.isString(t)?t:e.isNumber(t)?t+"px":i||null},e.option.asElement=function(t,e){return"function"==typeof t&&(t=t()),t||e||null},e.hexToRGB=function(t){var e=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;t=t.replace(e,function(t,e,i,n){return e+e+i+i+n+n});var i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return i?{r:parseInt(i[1],16),g:parseInt(i[2],16),b:parseInt(i[3],16)}:null},e.overrideOpacity=function(t,i){if(t.indexOf("rgba")!=-1)return t;if(t.indexOf("rgb")!=-1){var n=t.substr(t.indexOf("(")+1).replace(")","").split(",");return"rgba("+n[0]+","+n[1]+","+n[2]+","+i+")"}var n=e.hexToRGB(t);return null==n?t:"rgba("+n.r+","+n.g+","+n.b+","+i+")"},e.RGBToHex=function(t,e,i){return"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1)},e.parseColor=function(t){var i;if(e.isString(t)===!0){if(e.isValidRGB(t)===!0){var n=t.substr(4).substr(0,t.length-5).split(",").map(function(t){return parseInt(t)});t=e.RGBToHex(n[0],n[1],n[2])}if(e.isValidHex(t)===!0){var r=e.hexToHSV(t),o={h:r.h,s:.8*r.s,v:Math.min(1,1.02*r.v)},s={h:r.h,s:Math.min(1,1.25*r.s),v:.8*r.v},a=e.HSVToHex(s.h,s.s,s.v),h=e.HSVToHex(o.h,o.s,o.v);i={background:t,border:a,highlight:{background:h,border:a},hover:{background:h,border:a}}}else i={background:t,border:t,highlight:{background:t,border:t},hover:{background:t,border:t}}}else i={},i.background=t.background||void 0,i.border=t.border||void 0,e.isString(t.highlight)?i.highlight={border:t.highlight,background:t.highlight}:(i.highlight={},i.highlight.background=t.highlight&&t.highlight.background||void 0,i.highlight.border=t.highlight&&t.highlight.border||void 0),e.isString(t.hover)?i.hover={border:t.hover,background:t.hover}:(i.hover={},i.hover.background=t.hover&&t.hover.background||void 0,i.hover.border=t.hover&&t.hover.border||void 0);return i},e.RGBToHSV=function(t,e,i){t/=255,e/=255,i/=255;var n=Math.min(t,Math.min(e,i)),r=Math.max(t,Math.max(e,i));if(n==r)return{h:0,s:0,v:n};var o=t==n?e-i:i==n?t-e:i-t,s=t==n?3:i==n?1:5,a=60*(s-o/(r-n))/360,h=(r-n)/r,l=r;return{h:a,s:h,v:l}};var a={split:function(t){var e={};return t.split(";").forEach(function(t){if(""!=t.trim()){var i=t.split(":"),n=i[0].trim(),r=i[1].trim();e[n]=r}}),e},join:function(t){return Object.keys(t).map(function(e){return e+": "+t[e]}).join("; ")}};e.addCssText=function(t,i){var n=a.split(t.style.cssText),r=a.split(i),o=e.extend(n,r);t.style.cssText=a.join(o)},e.removeCssText=function(t,e){var i=a.split(t.style.cssText),n=a.split(e);for(var r in n)n.hasOwnProperty(r)&&delete i[r];t.style.cssText=a.join(i)},e.HSVToRGB=function(t,e,i){var n,r,o,s=Math.floor(6*t),a=6*t-s,h=i*(1-e),l=i*(1-a*e),u=i*(1-(1-a)*e);switch(s%6){case 0:n=i,r=u,o=h;break;case 1:n=l,r=i,o=h;break;case 2:n=h,r=i,o=u;break;case 3:n=h,r=l,o=i;break;case 4:n=u,r=h,o=i;break;case 5:n=i,r=h,o=l}return{r:Math.floor(255*n),g:Math.floor(255*r),b:Math.floor(255*o)}},e.HSVToHex=function(t,i,n){var r=e.HSVToRGB(t,i,n);return e.RGBToHex(r.r,r.g,r.b)},e.hexToHSV=function(t){var i=e.hexToRGB(t);return e.RGBToHSV(i.r,i.g,i.b)},e.isValidHex=function(t){var e=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t);return e},e.isValidRGB=function(t){t=t.replace(" ","");var e=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/i.test(t);return e},e.isValidRGBA=function(t){t=t.replace(" ","");var e=/rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(.{1,3})\)/i.test(t);return e},e.selectiveBridgeObject=function(t,i){if("object"==("undefined"==typeof i?"undefined":n(i))){for(var r=Object.create(i),o=0;o0&&e(n,t[r-1])<0;r--)t[r]=t[r-1];t[r]=n}return t},e.mergeOptions=function(t,e,i){var n=(arguments.length>3&&void 0!==arguments[3]&&arguments[3],arguments.length>4&&void 0!==arguments[4]?arguments[4]:{});if(null===e[i])t[i]=Object.create(n[i]);else if(void 0!==e[i])if("boolean"==typeof e[i])t[i].enabled=e[i];else{void 0===e[i].enabled&&(t[i].enabled=!0);for(var r in e[i])e[i].hasOwnProperty(r)&&(t[i][r]=e[i][r])}},e.binarySearchCustom=function(t,e,i,n){for(var r=1e4,o=0,s=0,a=t.length-1;s<=a&&o0)return"before"==n?Math.max(0,h-1):h;if(r(s,e)<0&&r(a,e)>0)return"before"==n?h:Math.min(t.length-1,h+1);r(s,e)<0?d=h+1:c=h-1,u++}return-1},e.easingFunctions={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return t*(2-t)},easeInOutQuad:function(t){return t<.5?2*t*t:-1+(4-2*t)*t},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return--t*t*t+1},easeInOutCubic:function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return 1- --t*t*t*t},easeInOutQuart:function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return 1+--t*t*t*t*t},easeInOutQuint:function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t}},e.getScrollBarWidth=function(){var t=document.createElement("p");t.style.width="100%",t.style.height="200px";var e=document.createElement("div");e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.visibility="hidden",e.style.width="200px",e.style.height="150px",e.style.overflow="hidden",e.appendChild(t),document.body.appendChild(e);var i=t.offsetWidth;e.style.overflow="scroll";var n=t.offsetWidth;return i==n&&(n=e.clientWidth),document.body.removeChild(e),i-n}},function(t,e,i){t.exports="undefined"!=typeof window&&window.moment||i(3)},function(t,e,i){(function(t){!function(e,i){t.exports=i()}(this,function(){function e(){return pn.apply(null,arguments)}function i(t){pn=t}function n(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function r(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function o(t){var e;for(e in t)return!1;return!0}function s(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function a(t,e){var i,n=[];for(i=0;i0)for(i in vn)n=vn[i],r=e[n],m(r)||(t[n]=r);return t}function y(t){v(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),yn===!1&&(yn=!0,e.updateOffset(this),yn=!1)}function g(t){return t instanceof y||null!=t&&null!=t._isAMomentObject}function _(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function w(t){var e=+t,i=0;return 0!==e&&isFinite(e)&&(i=_(e)),i}function x(t,e,i){var n,r=Math.min(t.length,e.length),o=Math.abs(t.length-e.length),s=0;for(n=0;n0?"future":"past"];return D(i)?i(e):i.replace(/%s/i,e)}function A(t,e){var i=t.toLowerCase();Mn[i]=Mn[i+"s"]=Mn[e]=t}function I(t){return"string"==typeof t?Mn[t]||Mn[t.toLowerCase()]:void 0}function W(t){var e,i,n={};for(i in t)h(t,i)&&(e=I(i),e&&(n[e]=t[i]));return n}function z(t,e){Cn[t]=e}function N(t){var e=[];for(var i in t)e.push({unit:i,priority:Cn[i]});return e.sort(function(t,e){return t.priority-e.priority}),e}function F(t,i){return function(n){return null!=n?(j(this,t,n),e.updateOffset(this,i),this):G(this,t)}}function G(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function j(t,e,i){t.isValid()&&t._d["set"+(t._isUTC?"UTC":"")+e](i)}function V(t){return t=I(t),D(this[t])?this[t]():this}function B(t,e){if("object"==typeof t){t=W(t);for(var i=N(t),n=0;n=0;return(o?i?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+n}function H(t,e,i,n){var r=n;"string"==typeof n&&(r=function(){return this[n]()}),t&&(Ln[t]=r),e&&(Ln[e[0]]=function(){return U(r.apply(this,arguments),e[1],e[2])}),i&&(Ln[i]=function(){return this.localeData().ordinal(r.apply(this,arguments),t)})}function X(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function Z(t){var e,i,n=t.match(En);for(e=0,i=n.length;e=0&&On.test(t);)t=t.replace(On,i),On.lastIndex=0,n-=1;return t}function $(t,e,i){Qn[t]=D(e)?e:function(t,n){return t&&i?i:e}}function J(t,e){return h(Qn,t)?Qn[t](e._strict,e._locale):new RegExp(K(t))}function K(t){return tt(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,i,n,r){return e||i||n||r}))}function tt(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function et(t,e){var i,n=e;for("string"==typeof t&&(t=[t]),"number"==typeof e&&(n=function(t,i){i[e]=w(t)}),i=0;i=0&&isFinite(a.getFullYear())&&a.setFullYear(t),a}function _t(t){var e=new Date(Date.UTC.apply(null,arguments));return t<100&&t>=0&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function wt(t,e,i){var n=7+e-i,r=(7+_t(t,0,n).getUTCDay()-e)%7;return-r+n-1}function xt(t,e,i,n,r){var o,s,a=(7+i-n)%7,h=wt(t,n,r),l=1+7*(e-1)+a+h;return l<=0?(o=t-1,s=mt(o)+l):l>mt(t)?(o=t+1,s=l-mt(t)):(o=t,s=l),{year:o,dayOfYear:s}}function bt(t,e,i){var n,r,o=wt(t.year(),e,i),s=Math.floor((t.dayOfYear()-o-1)/7)+1;return s<1?(r=t.year()-1,n=s+St(r,e,i)):s>St(t.year(),e,i)?(n=s-St(t.year(),e,i),r=t.year()+1):(r=t.year(),n=s),{week:n,year:r}}function St(t,e,i){var n=wt(t,e,i),r=wt(t+1,e,i);return(mt(t)-n+r)/7}function Tt(t){return bt(t,this._week.dow,this._week.doy).week}function Dt(){return this._week.dow}function kt(){return this._week.doy}function Mt(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function Ct(t){var e=bt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function Et(t,e){return"string"!=typeof t?t:isNaN(t)?(t=e.weekdaysParse(t),"number"==typeof t?t:null):parseInt(t,10)}function Ot(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function Pt(t,e){return t?n(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(e)?"format":"standalone"][t.day()]:this._weekdays}function Lt(t){return t?this._weekdaysShort[t.day()]:this._weekdaysShort}function Rt(t){return t?this._weekdaysMin[t.day()]:this._weekdaysMin}function Yt(t,e,i){var n,r,o,s=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)o=u([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(o,"").toLocaleLowerCase();return i?"dddd"===e?(r=wn.call(this._weekdaysParse,s),r!==-1?r:null):"ddd"===e?(r=wn.call(this._shortWeekdaysParse,s),r!==-1?r:null):(r=wn.call(this._minWeekdaysParse,s),r!==-1?r:null):"dddd"===e?(r=wn.call(this._weekdaysParse,s),r!==-1?r:(r=wn.call(this._shortWeekdaysParse,s),r!==-1?r:(r=wn.call(this._minWeekdaysParse,s),r!==-1?r:null))):"ddd"===e?(r=wn.call(this._shortWeekdaysParse,s),r!==-1?r:(r=wn.call(this._weekdaysParse,s),r!==-1?r:(r=wn.call(this._minWeekdaysParse,s),r!==-1?r:null))):(r=wn.call(this._minWeekdaysParse,s),r!==-1?r:(r=wn.call(this._weekdaysParse,s),r!==-1?r:(r=wn.call(this._shortWeekdaysParse,s),r!==-1?r:null)))}function At(t,e,i){var n,r,o;if(this._weekdaysParseExact)return Yt.call(this,t,e,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(r=u([2e3,1]).day(n),i&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(r,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(r,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(r,"").replace(".",".?")+"$","i")),this._weekdaysParse[n]||(o="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[n]=new RegExp(o.replace(".",""),"i")),i&&"dddd"===e&&this._fullWeekdaysParse[n].test(t))return n;if(i&&"ddd"===e&&this._shortWeekdaysParse[n].test(t))return n;if(i&&"dd"===e&&this._minWeekdaysParse[n].test(t))return n;if(!i&&this._weekdaysParse[n].test(t))return n}}function It(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=Et(t,this.localeData()),this.add(t-e,"d")):e}function Wt(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function zt(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=Ot(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7}function Nt(t){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||jt.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(h(this,"_weekdaysRegex")||(this._weekdaysRegex=yr),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function Ft(t){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||jt.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(h(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=gr),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Gt(t){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||jt.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(h(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=_r),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function jt(){function t(t,e){return e.length-t.length}var e,i,n,r,o,s=[],a=[],h=[],l=[];for(e=0;e<7;e++)i=u([2e3,1]).day(e),n=this.weekdaysMin(i,""),r=this.weekdaysShort(i,""),o=this.weekdays(i,""),s.push(n),a.push(r),h.push(o),l.push(n),l.push(r),l.push(o);for(s.sort(t),a.sort(t),h.sort(t),l.sort(t),e=0;e<7;e++)a[e]=tt(a[e]),h[e]=tt(h[e]),l[e]=tt(l[e]);this._weekdaysRegex=new RegExp("^("+l.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("^("+s.join("|")+")","i")}function Vt(){return this.hours()%12||12}function Bt(){return this.hours()||24}function Ut(t,e){H(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function Ht(t,e){return e._meridiemParse}function Xt(t){return"p"===(t+"").toLowerCase().charAt(0)}function Zt(t,e,i){return t>11?i?"pm":"PM":i?"am":"AM"}function qt(t){return t?t.toLowerCase().replace("_","-"):t}function Qt(t){for(var e,i,n,r,o=0;o0;){if(n=$t(r.slice(0,e).join("-")))return n;if(i&&i.length>=e&&x(r,i,!0)>=e-1)break;e--}o++}return null}function $t(e){var i=null;if(!Tr[e]&&"undefined"!=typeof t&&t&&t.exports)try{i=wr._abbr,!function(){var t=new Error('Cannot find module "./locale"');throw t.code="MODULE_NOT_FOUND",t}(),Jt(i)}catch(t){}return Tr[e]}function Jt(t,e){var i;return t&&(i=m(e)?ee(t):Kt(t,e),i&&(wr=i)),wr._abbr}function Kt(t,e){if(null!==e){var i=Sr;return e.abbr=t,null!=Tr[t]?(T("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=Tr[t]._config):null!=e.parentLocale&&(null!=Tr[e.parentLocale]?i=Tr[e.parentLocale]._config:T("parentLocaleUndefined","specified parentLocale is not defined yet. See http://momentjs.com/guides/#/warnings/parent-locale/")),Tr[t]=new C(M(i,e)),Jt(t),Tr[t]}return delete Tr[t],null}function te(t,e){if(null!=e){var i,n=Sr;null!=Tr[t]&&(n=Tr[t]._config),e=M(n,e),i=new C(e),i.parentLocale=Tr[t],Tr[t]=i,Jt(t)}else null!=Tr[t]&&(null!=Tr[t].parentLocale?Tr[t]=Tr[t].parentLocale:null!=Tr[t]&&delete Tr[t]);return Tr[t]}function ee(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return wr;if(!n(t)){if(e=$t(t))return e;t=[t]}return Qt(t)}function ie(){return _n(Tr)}function ne(t){var e,i=t._a;return i&&c(t).overflow===-2&&(e=i[Kn]<0||i[Kn]>11?Kn:i[tr]<1||i[tr]>rt(i[Jn],i[Kn])?tr:i[er]<0||i[er]>24||24===i[er]&&(0!==i[ir]||0!==i[nr]||0!==i[rr])?er:i[ir]<0||i[ir]>59?ir:i[nr]<0||i[nr]>59?nr:i[rr]<0||i[rr]>999?rr:-1,c(t)._overflowDayOfYear&&(etr)&&(e=tr),c(t)._overflowWeeks&&e===-1&&(e=or), -c(t)._overflowWeekday&&e===-1&&(e=sr),c(t).overflow=e),t}function re(t){var e,i,n,r,o,s,a=t._i,h=Dr.exec(a)||kr.exec(a);if(h){for(c(t).iso=!0,e=0,i=Cr.length;emt(r)&&(c(t)._overflowDayOfYear=!0),i=_t(r,0,t._dayOfYear),t._a[Kn]=i.getUTCMonth(),t._a[tr]=i.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=o[e]=n[e];for(;e<7;e++)t._a[e]=o[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[er]&&0===t._a[ir]&&0===t._a[nr]&&0===t._a[rr]&&(t._nextDay=!0,t._a[er]=0),t._d=(t._useUTC?_t:gt).apply(null,o),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[er]=24)}}function le(t){var e,i,n,r,o,s,a,h;e=t._w,null!=e.GG||null!=e.W||null!=e.E?(o=1,s=4,i=se(e.GG,t._a[Jn],bt(ge(),1,4).year),n=se(e.W,1),r=se(e.E,1),(r<1||r>7)&&(h=!0)):(o=t._locale._week.dow,s=t._locale._week.doy,i=se(e.gg,t._a[Jn],bt(ge(),o,s).year),n=se(e.w,1),null!=e.d?(r=e.d,(r<0||r>6)&&(h=!0)):null!=e.e?(r=e.e+o,(e.e<0||e.e>6)&&(h=!0)):r=o),n<1||n>St(i,o,s)?c(t)._overflowWeeks=!0:null!=h?c(t)._overflowWeekday=!0:(a=xt(i,n,r,o,s),t._a[Jn]=a.year,t._dayOfYear=a.dayOfYear)}function ue(t){if(t._f===e.ISO_8601)return void re(t);t._a=[],c(t).empty=!0;var i,n,r,o,s,a=""+t._i,h=a.length,l=0;for(r=Q(t._f,t._locale).match(En)||[],i=0;i0&&c(t).unusedInput.push(s),a=a.slice(a.indexOf(n)+n.length),l+=n.length),Ln[o]?(n?c(t).empty=!1:c(t).unusedTokens.push(o),nt(o,n,t)):t._strict&&!n&&c(t).unusedTokens.push(o);c(t).charsLeftOver=h-l,a.length>0&&c(t).unusedInput.push(a),t._a[er]<=12&&c(t).bigHour===!0&&t._a[er]>0&&(c(t).bigHour=void 0),c(t).parsedDateParts=t._a.slice(0),c(t).meridiem=t._meridiem,t._a[er]=de(t._locale,t._a[er],t._meridiem),he(t),ne(t)}function de(t,e,i){var n;return null==i?e:null!=t.meridiemHour?t.meridiemHour(e,i):null!=t.isPM?(n=t.isPM(i),n&&e<12&&(e+=12),n||12!==e||(e=0),e):e}function ce(t){var e,i,n,r,o;if(0===t._f.length)return c(t).invalidFormat=!0,void(t._d=new Date(NaN));for(r=0;rthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ie(){if(!m(this._isDSTShifted))return this._isDSTShifted;var t={};if(v(t,this),t=me(t),t._a){var e=t._isUTC?u(t._a):ge(t._a);this._isDSTShifted=this.isValid()&&x(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function We(){return!!this.isValid()&&!this._isUTC}function ze(){return!!this.isValid()&&this._isUTC}function Ne(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function Fe(t,e){var i,n,r,o=t,s=null;return Se(t)?o={ms:t._milliseconds,d:t._days,M:t._months}:"number"==typeof t?(o={},e?o[e]=t:o.milliseconds=t):(s=Ar.exec(t))?(i="-"===s[1]?-1:1,o={y:0,d:w(s[tr])*i,h:w(s[er])*i,m:w(s[ir])*i,s:w(s[nr])*i,ms:w(Te(1e3*s[rr]))*i}):(s=Ir.exec(t))?(i="-"===s[1]?-1:1,o={y:Ge(s[2],i),M:Ge(s[3],i),w:Ge(s[4],i),d:Ge(s[5],i),h:Ge(s[6],i),m:Ge(s[7],i),s:Ge(s[8],i)}):null==o?o={}:"object"==typeof o&&("from"in o||"to"in o)&&(r=Ve(ge(o.from),ge(o.to)),o={},o.ms=r.milliseconds,o.M=r.months),n=new be(o),Se(t)&&h(t,"_locale")&&(n._locale=t._locale),n}function Ge(t,e){var i=t&&parseFloat(t.replace(",","."));return(isNaN(i)?0:i)*e}function je(t,e){var i={milliseconds:0,months:0};return i.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(i.months,"M").isAfter(e)&&--i.months,i.milliseconds=+e-+t.clone().add(i.months,"M"),i}function Ve(t,e){var i;return t.isValid()&&e.isValid()?(e=Me(e,t),t.isBefore(e)?i=je(t,e):(i=je(e,t),i.milliseconds=-i.milliseconds,i.months=-i.months),i):{milliseconds:0,months:0}}function Be(t,e){return function(i,n){var r,o;return null===n||isNaN(+n)||(T(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=i,i=n,n=o),i="string"==typeof i?+i:i,r=Fe(i,n),Ue(this,r,t),this}}function Ue(t,i,n,r){var o=i._milliseconds,s=Te(i._days),a=Te(i._months);t.isValid()&&(r=null==r||r,o&&t._d.setTime(t._d.valueOf()+o*n),s&&j(t,"Date",G(t,"Date")+s*n),a&<(t,G(t,"Month")+a*n),r&&e.updateOffset(t,s||a))}function He(t,e){var i=t.diff(e,"days",!0);return i<-6?"sameElse":i<-1?"lastWeek":i<0?"lastDay":i<1?"sameDay":i<2?"nextDay":i<7?"nextWeek":"sameElse"}function Xe(t,i){var n=t||ge(),r=Me(n,this).startOf("day"),o=e.calendarFormat(this,r)||"sameElse",s=i&&(D(i[o])?i[o].call(this,n):i[o]);return this.format(s||this.localeData().calendar(o,this,ge(n)))}function Ze(){return new y(this)}function qe(t,e){var i=g(t)?t:ge(t);return!(!this.isValid()||!i.isValid())&&(e=I(m(e)?"millisecond":e),"millisecond"===e?this.valueOf()>i.valueOf():i.valueOf()o&&(e=o),Oi.call(this,t,e,i,n,r))}function Oi(t,e,i,n,r){var o=xt(t,e,i,n,r),s=_t(o.year,0,o.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}function Pi(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}function Li(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function Ri(t,e){e[rr]=w(1e3*("0."+t))}function Yi(){return this._isUTC?"UTC":""}function Ai(){return this._isUTC?"Coordinated Universal Time":""}function Ii(t){return ge(1e3*t)}function Wi(){return ge.apply(null,arguments).parseZone()}function zi(t){return t}function Ni(t,e,i,n){var r=ee(),o=u().set(n,e);return r[i](o,t)}function Fi(t,e,i){if("number"==typeof t&&(e=t,t=void 0),t=t||"",null!=e)return Ni(t,e,i,"month");var n,r=[];for(n=0;n<12;n++)r[n]=Ni(t,n,i,"month");return r}function Gi(t,e,i,n){"boolean"==typeof t?("number"==typeof e&&(i=e,e=void 0),e=e||""):(e=t,i=e,t=!1,"number"==typeof e&&(i=e,e=void 0),e=e||"");var r=ee(),o=t?r._week.dow:0;if(null!=i)return Ni(e,(i+o)%7,n,"day");var s,a=[];for(s=0;s<7;s++)a[s]=Ni(e,(s+o)%7,n,"day");return a}function ji(t,e){return Fi(t,e,"months")}function Vi(t,e){return Fi(t,e,"monthsShort")}function Bi(t,e,i){return Gi(t,e,i,"weekdays")}function Ui(t,e,i){return Gi(t,e,i,"weekdaysShort")}function Hi(t,e,i){return Gi(t,e,i,"weekdaysMin")}function Xi(){var t=this._data;return this._milliseconds=Zr(this._milliseconds),this._days=Zr(this._days),this._months=Zr(this._months),t.milliseconds=Zr(t.milliseconds),t.seconds=Zr(t.seconds),t.minutes=Zr(t.minutes),t.hours=Zr(t.hours),t.months=Zr(t.months),t.years=Zr(t.years),this}function Zi(t,e,i,n){var r=Fe(e,i);return t._milliseconds+=n*r._milliseconds,t._days+=n*r._days,t._months+=n*r._months,t._bubble()}function qi(t,e){return Zi(this,t,e,1)}function Qi(t,e){return Zi(this,t,e,-1)}function $i(t){return t<0?Math.floor(t):Math.ceil(t)}function Ji(){var t,e,i,n,r,o=this._milliseconds,s=this._days,a=this._months,h=this._data;return o>=0&&s>=0&&a>=0||o<=0&&s<=0&&a<=0||(o+=864e5*$i(tn(a)+s),s=0,a=0),h.milliseconds=o%1e3,t=_(o/1e3),h.seconds=t%60,e=_(t/60),h.minutes=e%60,i=_(e/60),h.hours=i%24,s+=_(i/24),r=_(Ki(s)),a+=r,s-=$i(tn(r)),n=_(a/12),a%=12,h.days=s,h.months=a,h.years=n,this}function Ki(t){return 4800*t/146097}function tn(t){return 146097*t/4800}function en(t){var e,i,n=this._milliseconds;if(t=I(t),"month"===t||"year"===t)return e=this._days+n/864e5,i=this._months+Ki(e),"month"===t?i:i/12;switch(e=this._days+Math.round(tn(this._months)),t){case"week":return e/7+n/6048e5;case"day":return e+n/864e5;case"hour":return 24*e+n/36e5;case"minute":return 1440*e+n/6e4;case"second":return 86400*e+n/1e3;case"millisecond":return Math.floor(864e5*e)+n;default:throw new Error("Unknown unit "+t)}}function nn(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*w(this._months/12)}function rn(t){return function(){return this.as(t)}}function on(t){return t=I(t),this[t+"s"]()}function sn(t){return function(){return this._data[t]}}function an(){return _(this.days()/7)}function hn(t,e,i,n,r){return r.relativeTime(e||1,!!i,t,n)}function ln(t,e,i){var n=Fe(t).abs(),r=uo(n.as("s")),o=uo(n.as("m")),s=uo(n.as("h")),a=uo(n.as("d")),h=uo(n.as("M")),l=uo(n.as("y")),u=r0,u[4]=i,hn.apply(null,u)}function un(t){return void 0===t?uo:"function"==typeof t&&(uo=t,!0)}function dn(t,e){return void 0!==co[t]&&(void 0===e?co[t]:(co[t]=e,!0))}function cn(t){var e=this.localeData(),i=ln(this,!t,e);return t&&(i=e.pastFuture(+this,i)),e.postformat(i)}function fn(){var t,e,i,n=fo(this._milliseconds)/1e3,r=fo(this._days),o=fo(this._months);t=_(n/60),e=_(t/60),n%=60,t%=60,i=_(o/12),o%=12;var s=i,a=o,h=r,l=e,u=t,d=n,c=this.asSeconds();return c?(c<0?"-":"")+"P"+(s?s+"Y":"")+(a?a+"M":"")+(h?h+"D":"")+(l||u||d?"T":"")+(l?l+"H":"")+(u?u+"M":"")+(d?d+"S":""):"P0D"}var pn,mn;mn=Array.prototype.some?Array.prototype.some:function(t){for(var e=Object(this),i=e.length>>>0,n=0;n68?1900:2e3)};var cr=F("FullYear",!0);H("w",["ww",2],"wo","week"),H("W",["WW",2],"Wo","isoWeek"),A("week","w"),A("isoWeek","W"),z("week",5),z("isoWeek",5),$("w",zn),$("ww",zn,Yn),$("W",zn),$("WW",zn,Yn),it(["w","ww","W","WW"],function(t,e,i,n){e[n.substr(0,1)]=w(t)});var fr={dow:0,doy:6};H("d",0,"do","day"),H("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),H("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),H("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),H("e",0,0,"weekday"),H("E",0,0,"isoWeekday"),A("day","d"),A("weekday","e"),A("isoWeekday","E"),z("day",11),z("weekday",11),z("isoWeekday",11),$("d",zn),$("e",zn),$("E",zn),$("dd",function(t,e){return e.weekdaysMinRegex(t)}),$("ddd",function(t,e){return e.weekdaysShortRegex(t)}),$("dddd",function(t,e){return e.weekdaysRegex(t)}),it(["dd","ddd","dddd"],function(t,e,i,n){var r=i._locale.weekdaysParse(t,n,i._strict);null!=r?e.d=r:c(i).invalidWeekday=t}),it(["d","e","E"],function(t,e,i,n){e[n]=w(t)});var pr="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),mr="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),vr="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),yr=qn,gr=qn,_r=qn;H("H",["HH",2],0,"hour"),H("h",["hh",2],0,Vt),H("k",["kk",2],0,Bt),H("hmm",0,0,function(){return""+Vt.apply(this)+U(this.minutes(),2)}),H("hmmss",0,0,function(){return""+Vt.apply(this)+U(this.minutes(),2)+U(this.seconds(),2)}),H("Hmm",0,0,function(){return""+this.hours()+U(this.minutes(),2)}),H("Hmmss",0,0,function(){return""+this.hours()+U(this.minutes(),2)+U(this.seconds(),2)}),Ut("a",!0),Ut("A",!1),A("hour","h"),z("hour",13),$("a",Ht),$("A",Ht),$("H",zn),$("h",zn),$("HH",zn,Yn),$("hh",zn,Yn),$("hmm",Nn),$("hmmss",Fn),$("Hmm",Nn),$("Hmmss",Fn),et(["H","HH"],er),et(["a","A"],function(t,e,i){i._isPm=i._locale.isPM(t),i._meridiem=t}),et(["h","hh"],function(t,e,i){e[er]=w(t),c(i).bigHour=!0}),et("hmm",function(t,e,i){var n=t.length-2;e[er]=w(t.substr(0,n)),e[ir]=w(t.substr(n)),c(i).bigHour=!0}),et("hmmss",function(t,e,i){var n=t.length-4,r=t.length-2;e[er]=w(t.substr(0,n)),e[ir]=w(t.substr(n,2)),e[nr]=w(t.substr(r)),c(i).bigHour=!0}),et("Hmm",function(t,e,i){var n=t.length-2;e[er]=w(t.substr(0,n)),e[ir]=w(t.substr(n))}),et("Hmmss",function(t,e,i){var n=t.length-4,r=t.length-2;e[er]=w(t.substr(0,n)),e[ir]=w(t.substr(n,2)),e[nr]=w(t.substr(r))});var wr,xr=/[ap]\.?m?\.?/i,br=F("Hours",!0),Sr={calendar:xn,longDateFormat:bn,invalidDate:Sn,ordinal:Tn,ordinalParse:Dn,relativeTime:kn,months:hr,monthsShort:lr,week:fr,weekdays:pr,weekdaysMin:vr,weekdaysShort:mr,meridiemParse:xr},Tr={},Dr=/^\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)?)?/,kr=/^\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)?)?/,Mr=/Z|[+-]\d\d(?::?\d\d)?/,Cr=[["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}/]],Er=[["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/]],Or=/^\/?Date\((\-?\d+)/i;e.createFromInputFallback=S("value provided is not in a recognized ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non 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(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),e.ISO_8601=function(){};var Pr=S("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=ge.apply(null,arguments);return this.isValid()&&t.isValid()?tthis?this:t:p()}),Rr=function(){return Date.now?Date.now():+new Date};De("Z",":"),De("ZZ",""),$("Z",Xn),$("ZZ",Xn),et(["Z","ZZ"],function(t,e,i){i._useUTC=!0,i._tzm=ke(Xn,t)});var Yr=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var Ar=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Ir=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;Fe.fn=be.prototype;var Wr=Be(1,"add"),zr=Be(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Nr=S("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});H(0,["gg",2],0,function(){return this.weekYear()%100}),H(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Ti("gggg","weekYear"),Ti("ggggg","weekYear"),Ti("GGGG","isoWeekYear"),Ti("GGGGG","isoWeekYear"),A("weekYear","gg"),A("isoWeekYear","GG"),z("weekYear",1),z("isoWeekYear",1),$("G",Un),$("g",Un),$("GG",zn,Yn),$("gg",zn,Yn),$("GGGG",jn,In),$("gggg",jn,In),$("GGGGG",Vn,Wn),$("ggggg",Vn,Wn),it(["gggg","ggggg","GGGG","GGGGG"],function(t,e,i,n){e[n.substr(0,2)]=w(t)}),it(["gg","GG"],function(t,i,n,r){i[r]=e.parseTwoDigitYear(t)}),H("Q",0,"Qo","quarter"),A("quarter","Q"),z("quarter",7),$("Q",Rn),et("Q",function(t,e){e[Kn]=3*(w(t)-1)}),H("D",["DD",2],"Do","date"),A("date","D"),z("date",9),$("D",zn),$("DD",zn,Yn),$("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),et(["D","DD"],tr),et("Do",function(t,e){e[tr]=w(t.match(zn)[0],10)});var Fr=F("Date",!0);H("DDD",["DDDD",3],"DDDo","dayOfYear"),A("dayOfYear","DDD"),z("dayOfYear",4),$("DDD",Gn),$("DDDD",An),et(["DDD","DDDD"],function(t,e,i){i._dayOfYear=w(t)}),H("m",["mm",2],0,"minute"),A("minute","m"),z("minute",14),$("m",zn),$("mm",zn,Yn),et(["m","mm"],ir);var Gr=F("Minutes",!1);H("s",["ss",2],0,"second"),A("second","s"),z("second",15),$("s",zn),$("ss",zn,Yn),et(["s","ss"],nr);var jr=F("Seconds",!1);H("S",0,0,function(){return~~(this.millisecond()/100)}),H(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),H(0,["SSS",3],0,"millisecond"),H(0,["SSSS",4],0,function(){return 10*this.millisecond()}),H(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),H(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),H(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),H(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),H(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),A("millisecond","ms"),z("millisecond",16),$("S",Gn,Rn),$("SS",Gn,Yn),$("SSS",Gn,An);var Vr;for(Vr="SSSS";Vr.length<=9;Vr+="S")$(Vr,Bn);for(Vr="S";Vr.length<=9;Vr+="S")et(Vr,Ri);var Br=F("Milliseconds",!1);H("z",0,0,"zoneAbbr"),H("zz",0,0,"zoneName");var Ur=y.prototype;Ur.add=Wr,Ur.calendar=Xe,Ur.clone=Ze,Ur.diff=ei,Ur.endOf=fi,Ur.format=oi,Ur.from=si,Ur.fromNow=ai,Ur.to=hi,Ur.toNow=li,Ur.get=V,Ur.invalidAt=bi,Ur.isAfter=qe,Ur.isBefore=Qe,Ur.isBetween=$e,Ur.isSame=Je,Ur.isSameOrAfter=Ke,Ur.isSameOrBefore=ti,Ur.isValid=wi,Ur.lang=Nr,Ur.locale=ui,Ur.localeData=di,Ur.max=Lr,Ur.min=Pr,Ur.parsingFlags=xi,Ur.set=B,Ur.startOf=ci,Ur.subtract=zr,Ur.toArray=yi,Ur.toObject=gi,Ur.toDate=vi,Ur.toISOString=ri,Ur.toJSON=_i,Ur.toString=ni,Ur.unix=mi,Ur.valueOf=pi,Ur.creationData=Si,Ur.year=cr,Ur.isLeapYear=yt,Ur.weekYear=Di,Ur.isoWeekYear=ki,Ur.quarter=Ur.quarters=Pi,Ur.month=ut,Ur.daysInMonth=dt,Ur.week=Ur.weeks=Mt,Ur.isoWeek=Ur.isoWeeks=Ct,Ur.weeksInYear=Ci,Ur.isoWeeksInYear=Mi,Ur.date=Fr,Ur.day=Ur.days=It,Ur.weekday=Wt,Ur.isoWeekday=zt,Ur.dayOfYear=Li,Ur.hour=Ur.hours=br,Ur.minute=Ur.minutes=Gr,Ur.second=Ur.seconds=jr,Ur.millisecond=Ur.milliseconds=Br,Ur.utcOffset=Ee,Ur.utc=Pe,Ur.local=Le,Ur.parseZone=Re,Ur.hasAlignedHourOffset=Ye,Ur.isDST=Ae,Ur.isLocal=We,Ur.isUtcOffset=ze,Ur.isUtc=Ne,Ur.isUTC=Ne,Ur.zoneAbbr=Yi,Ur.zoneName=Ai,Ur.dates=S("dates accessor is deprecated. Use date instead.",Fr),Ur.months=S("months accessor is deprecated. Use month instead",ut),Ur.years=S("years accessor is deprecated. Use year instead",cr),Ur.zone=S("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Oe),Ur.isDSTShifted=S("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Ie);var Hr=Ur,Xr=C.prototype;Xr.calendar=E,Xr.longDateFormat=O,Xr.invalidDate=P,Xr.ordinal=L,Xr.preparse=zi,Xr.postformat=zi,Xr.relativeTime=R,Xr.pastFuture=Y,Xr.set=k,Xr.months=ot,Xr.monthsShort=st,Xr.monthsParse=ht,Xr.monthsRegex=ft,Xr.monthsShortRegex=ct,Xr.week=Tt,Xr.firstDayOfYear=kt,Xr.firstDayOfWeek=Dt,Xr.weekdays=Pt,Xr.weekdaysMin=Rt,Xr.weekdaysShort=Lt,Xr.weekdaysParse=At,Xr.weekdaysRegex=Nt,Xr.weekdaysShortRegex=Ft,Xr.weekdaysMinRegex=Gt,Xr.isPM=Xt,Xr.meridiem=Zt,Jt("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,i=1===w(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+i}}),e.lang=S("moment.lang is deprecated. Use moment.locale instead.",Jt),e.langData=S("moment.langData is deprecated. Use moment.localeData instead.",ee);var Zr=Math.abs,qr=rn("ms"),Qr=rn("s"),$r=rn("m"),Jr=rn("h"),Kr=rn("d"),to=rn("w"),eo=rn("M"),io=rn("y"),no=sn("milliseconds"),ro=sn("seconds"),oo=sn("minutes"),so=sn("hours"),ao=sn("days"),ho=sn("months"),lo=sn("years"),uo=Math.round,co={s:45,m:45,h:22,d:26,M:11},fo=Math.abs,po=be.prototype;po.abs=Xi,po.add=qi,po.subtract=Qi,po.as=en,po.asMilliseconds=qr,po.asSeconds=Qr,po.asMinutes=$r,po.asHours=Jr,po.asDays=Kr,po.asWeeks=to,po.asMonths=eo,po.asYears=io,po.valueOf=nn,po._bubble=Ji,po.get=on,po.milliseconds=no,po.seconds=ro,po.minutes=oo,po.hours=so,po.days=ao,po.weeks=an,po.months=ho,po.years=lo,po.humanize=cn,po.toISOString=fn,po.toString=fn,po.toJSON=fn,po.locale=ui,po.localeData=di,po.toIsoString=S("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",fn),po.lang=Nr,H("X",0,0,"unix"),H("x",0,0,"valueOf"),$("x",Un),$("X",Zn),et("X",function(t,e,i){i._d=new Date(1e3*parseFloat(t,10))}),et("x",function(t,e,i){i._d=new Date(w(t))}),e.version="2.15.2",i(ge),e.fn=Hr,e.min=we,e.max=xe,e.now=Rr,e.utc=u,e.unix=Ii,e.months=ji,e.isDate=s,e.locale=Jt,e.invalid=p,e.duration=Fe,e.isMoment=g,e.weekdays=Bi,e.parseZone=Wi,e.localeData=ee,e.isDuration=Se,e.monthsShort=Vi,e.weekdaysMin=Hi,e.defineLocale=Kt,e.updateLocale=te,e.locales=ie,e.weekdaysShort=Ui,e.normalizeUnits=I,e.relativeTimeRounding=un,e.relativeTimeThreshold=dn,e.calendarFormat=He,e.prototype=Hr;var mo=e;return mo})}).call(e,i(4)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e){function i(t){throw new Error("Cannot find module '"+t+"'.")}i.keys=function(){return[]},i.resolve=i,t.exports=i,i.id=5},function(t,e){(function(e){function i(t,e,i){var n=e&&i||0,r=0;for(e=e||[],t.toLowerCase().replace(/[0-9a-f]{2}/g,function(t){r<16&&(e[n+r++]=d[t])});r<16;)e[n+r++]=0;return e}function n(t,e){var i=e||0,n=u;return n[t[i++]]+n[t[i++]]+n[t[i++]]+n[t[i++]]+"-"+n[t[i++]]+n[t[i++]]+"-"+n[t[i++]]+n[t[i++]]+"-"+n[t[i++]]+n[t[i++]]+"-"+n[t[i++]]+n[t[i++]]+n[t[i++]]+n[t[i++]]+n[t[i++]]+n[t[i++]]}function r(t,e,i){var r=e&&i||0,o=e||[];t=t||{};var s=void 0!==t.clockseq?t.clockseq:m,a=void 0!==t.msecs?t.msecs:(new Date).getTime(),h=void 0!==t.nsecs?t.nsecs:y+1,l=a-v+(h-y)/1e4;if(l<0&&void 0===t.clockseq&&(s=s+1&16383),(l<0||a>v)&&void 0===t.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");v=a,y=h,m=s,a+=122192928e5;var u=(1e4*(268435455&a)+h)%4294967296;o[r++]=u>>>24&255,o[r++]=u>>>16&255,o[r++]=u>>>8&255,o[r++]=255&u;var d=a/4294967296*1e4&268435455;o[r++]=d>>>8&255,o[r++]=255&d,o[r++]=d>>>24&15|16, -o[r++]=d>>>16&255,o[r++]=s>>>8|128,o[r++]=255&s;for(var c=t.node||p,f=0;f<6;f++)o[r+f]=c[f];return e?e:n(o)}function o(t,e,i){var r=e&&i||0;"string"==typeof t&&(e="binary"==t?new Array(16):null,t=null),t=t||{};var o=t.random||(t.rng||s)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e)for(var a=0;a<16;a++)e[r+a]=o[a];return e||n(o)}var s,a="undefined"!=typeof window?window:"undefined"!=typeof e?e:null;if(a&&a.crypto&&crypto.getRandomValues){var h=new Uint8Array(16);s=function(){return crypto.getRandomValues(h),h}}if(!s){var l=new Array(16);s=function(){for(var t,e=0;e<16;e++)0===(3&e)&&(t=4294967296*Math.random()),l[e]=t>>>((3&e)<<3)&255;return l}}for(var u=[],d={},c=0;c<256;c++)u[c]=(c+256).toString(16).substr(1),d[u[c]]=c;var f=s(),p=[1|f[0],f[1],f[2],f[3],f[4],f[5]],m=16383&(f[6]<<8|f[7]),v=0,y=0,g=o;g.v1=r,g.v4=o,g.parse=i,g.unparse=n,t.exports=g}).call(e,function(){return this}())},function(t,e){e.prepareElements=function(t){for(var e in t)t.hasOwnProperty(e)&&(t[e].redundant=t[e].used,t[e].used=[])},e.cleanupElements=function(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e].redundant){for(var i=0;i0?(n=e[t].redundant[0],e[t].redundant.shift()):(n=document.createElementNS("http://www.w3.org/2000/svg",t),i.appendChild(n)):(n=document.createElementNS("http://www.w3.org/2000/svg",t),e[t]={used:[],redundant:[]},i.appendChild(n)),e[t].used.push(n),n},e.getDOMElement=function(t,e,i,n){var r;return e.hasOwnProperty(t)?e[t].redundant.length>0?(r=e[t].redundant[0],e[t].redundant.shift()):(r=document.createElement(t),void 0!==n?i.insertBefore(r,n):i.appendChild(r)):(r=document.createElement(t),e[t]={used:[],redundant:[]},void 0!==n?i.insertBefore(r,n):i.appendChild(r)),e[t].used.push(r),r},e.drawPoint=function(t,i,n,r,o,s){var a;if("circle"==n.style?(a=e.getSVGElement("circle",r,o),a.setAttributeNS(null,"cx",t),a.setAttributeNS(null,"cy",i),a.setAttributeNS(null,"r",.5*n.size)):(a=e.getSVGElement("rect",r,o),a.setAttributeNS(null,"x",t-.5*n.size),a.setAttributeNS(null,"y",i-.5*n.size),a.setAttributeNS(null,"width",n.size),a.setAttributeNS(null,"height",n.size)),void 0!==n.styles&&a.setAttributeNS(null,"style",n.styles),a.setAttributeNS(null,"class",n.className+" vis-point"),s){var h=e.getSVGElement("text",r,o);s.xOffset&&(t+=s.xOffset),s.yOffset&&(i+=s.yOffset),s.content&&(h.textContent=s.content),s.className&&h.setAttributeNS(null,"class",s.className+" vis-label"),h.setAttributeNS(null,"x",t),h.setAttributeNS(null,"y",i)}return a},e.drawBar=function(t,i,n,r,o,s,a,h){if(0!=r){r<0&&(r*=-1,i-=r);var l=e.getSVGElement("rect",s,a);l.setAttributeNS(null,"x",t-.5*n),l.setAttributeNS(null,"y",i),l.setAttributeNS(null,"width",n),l.setAttributeNS(null,"height",r),l.setAttributeNS(null,"class",o),h&&l.setAttributeNS(null,"style",h)}}},function(t,e,i){function n(t,e){if(t&&!Array.isArray(t)&&(e=t,t=null),this._options=e||{},this._data={},this.length=0,this._fieldId=this._options.fieldId||"id",this._type={},this._options.type)for(var i=Object.keys(this._options.type),n=0,r=i.length;nr?1:ns)&&(o=h,s=l)}return o},n.prototype.min=function(t){var e,i,n=this._data,r=Object.keys(n),o=null,s=null;for(e=0,i=r.length;ethis.max&&this.flush(),clearTimeout(this._timeout),this.queue.length>0&&"number"==typeof this.delay){var t=this;this._timeout=setTimeout(function(){t.flush()},this.delay)}},i.prototype.flush=function(){for(;this._queue.length>0;){var t=this._queue.shift();t.fn.apply(t.context||t.fn,t.args||[])}},t.exports=i},function(t,e,i){function n(t,e){this._data=null,this._ids={},this.length=0,this._options=e||{},this._fieldId="id",this._subscribers={};var i=this;this.listener=function(){i._onEvent.apply(i,arguments)},this.setData(t)}var r=i(1),o=i(8);n.prototype.setData=function(t){var e,i,n,r,o;if(this._data){for(this._data.off&&this._data.off("*",this.listener),e=this._data.getIds({filter:this._options&&this._options.filter}),o=[],n=0,r=e.length;n0&&(h[r-1].pointNext=s),h.push(s);return h},n.prototype.create=function(){for(;this.containerElement.hasChildNodes();)this.containerElement.removeChild(this.containerElement.firstChild);this.frame=document.createElement("div"),this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas);var t=document.createElement("DIV");t.style.color="red",t.style.fontWeight="bold",t.style.padding="10px",t.innerHTML="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(t),this.frame.filter=document.createElement("div"),this.frame.filter.style.position="absolute",this.frame.filter.style.bottom="0px",this.frame.filter.style.left="0px",this.frame.filter.style.width="100%",this.frame.appendChild(this.frame.filter);var e=this,i=function(t){e._onMouseDown(t)},n=function(t){e._onTouchStart(t)},r=function(t){e._onWheel(t)},o=function(t){e._onTooltip(t)};l.addEventListener(this.frame.canvas,"keydown",onkeydown),l.addEventListener(this.frame.canvas,"mousedown",i),l.addEventListener(this.frame.canvas,"touchstart",n),l.addEventListener(this.frame.canvas,"mousewheel",r),l.addEventListener(this.frame.canvas,"mousemove",o),this.containerElement.appendChild(this.frame)},n.prototype.setSize=function(t,e){this.frame.style.width=t,this.frame.style.height=e,this._resizeCanvas()},n.prototype._resizeCanvas=function(){this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=this.frame.canvas.clientWidth,this.frame.canvas.height=this.frame.canvas.clientHeight,this.frame.filter.style.width=this.frame.canvas.clientWidth-20+"px"},n.prototype.animationStart=function(){if(!this.frame.filter||!this.frame.filter.slider)throw new Error("No animation available");this.frame.filter.slider.play()},n.prototype.animationStop=function(){this.frame.filter&&this.frame.filter.slider&&this.frame.filter.slider.stop()},n.prototype._resizeCenter=function(){"%"===this.xCenter.charAt(this.xCenter.length-1)?this.currentXCenter=parseFloat(this.xCenter)/100*this.frame.canvas.clientWidth:this.currentXCenter=parseFloat(this.xCenter),"%"===this.yCenter.charAt(this.yCenter.length-1)?this.currentYCenter=parseFloat(this.yCenter)/100*(this.frame.canvas.clientHeight-this.frame.filter.clientHeight):this.currentYCenter=parseFloat(this.yCenter)},n.prototype.getCameraPosition=function(){var t=this.camera.getArmRotation();return t.distance=this.camera.getArmLength(),t},n.prototype._readData=function(t){this._dataInitialize(t,this.style),this.dataFilter?this.dataPoints=this.dataFilter._getDataPoints():this.dataPoints=this._getDataPoints(this.dataTable),this._redrawFilter()},n.prototype.setData=function(t){this._readData(t),this.redraw(),this.animationAutoStart&&this.dataFilter&&this.animationStart()},n.prototype.setOptions=function(t){this.animationStop(),v.setOptions(t,this),this.setPointDrawingMethod(),this.setSize(this.width,this.height),this.dataTable&&this.setData(this.dataTable),this.animationAutoStart&&this.dataFilter&&this.animationStart()},n.prototype.setPointDrawingMethod=function(){var t=void 0;switch(this.style){case n.STYLE.BAR:t=n.prototype._redrawBarGraphPoint;break;case n.STYLE.BARCOLOR:t=n.prototype._redrawBarColorGraphPoint;break;case n.STYLE.BARSIZE:t=n.prototype._redrawBarSizeGraphPoint;break;case n.STYLE.DOT:t=n.prototype._redrawDotGraphPoint;break;case n.STYLE.DOTLINE:t=n.prototype._redrawDotLineGraphPoint;break;case n.STYLE.DOTCOLOR:t=n.prototype._redrawDotColorGraphPoint;break;case n.STYLE.DOTSIZE:t=n.prototype._redrawDotSizeGraphPoint;break;case n.STYLE.SURFACE:t=n.prototype._redrawSurfaceGraphPoint;break;case n.STYLE.GRID:t=n.prototype._redrawGridGraphPoint;break;case n.STYLE.LINE:t=n.prototype._redrawLineGraphPoint;break;default:throw new Error("Can not determine point drawing method for graph style '"+this.style+"'")}this._pointDrawingMethod=t},n.prototype.redraw=function(){if(void 0===this.dataPoints)throw new Error("Graph data not initialized");this._resizeCanvas(),this._resizeCenter(),this._redrawSlider(),this._redrawClear(),this._redrawAxis(),this._redrawDataGraph(),this._redrawInfo(),this._redrawLegend()},n.prototype._getContext=function(){var t=this.frame.canvas,e=t.getContext("2d");return e.lineJoin="round",e.lineCap="round",e},n.prototype._redrawClear=function(){var t=this.frame.canvas,e=t.getContext("2d");e.clearRect(0,0,t.width,t.height)},n.prototype._dotSize=function(){return this.frame.clientWidth*this.dotSizeRatio},n.prototype._getLegendWidth=function(){var t;if(this.style===n.STYLE.DOTSIZE){var e=this._dotSize();t=e/2+2*e}else t=this.style===n.STYLE.BARSIZE?this.xBarWidth:20;return t},n.prototype._redrawLegend=function(){if(this.showLegend===!0&&this.style!==n.STYLE.LINE&&this.style!==n.STYLE.BARSIZE){var t=this.style===n.STYLE.BARSIZE||this.style===n.STYLE.DOTSIZE,e=this.style===n.STYLE.DOTSIZE||this.style===n.STYLE.DOTCOLOR||this.style===n.STYLE.BARCOLOR,i=Math.max(.25*this.frame.clientHeight,100),r=this.margin,o=this._getLegendWidth(),s=this.frame.clientWidth-this.margin,a=s-o,h=r+i,l=this._getContext();if(l.lineWidth=1,l.font="14px arial",t===!1){var u,c=0,f=i;for(u=c;u0?(t.textAlign="center",t.textBaseline="top",o.y+=r):Math.sin(2*n)<0?(t.textAlign="right",t.textBaseline="middle"):(t.textAlign="left",t.textBaseline="middle"),t.fillStyle=this.axisColor,t.fillText(i,o.x,o.y)},n.prototype.drawAxisLabelY=function(t,e,i,n,r){void 0===r&&(r=0);var o=this._convert3Dto2D(e);Math.cos(2*n)<0?(t.textAlign="center",t.textBaseline="top",o.y+=r):Math.sin(2*n)>0?(t.textAlign="right",t.textBaseline="middle"):(t.textAlign="left",t.textBaseline="middle"),t.fillStyle=this.axisColor,t.fillText(i,o.x,o.y)},n.prototype.drawAxisLabelZ=function(t,e,i,n){void 0===n&&(n=0);var r=this._convert3Dto2D(e);t.textAlign="right",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(i,r.x-n,r.y)},n.prototype._line3d=function(t,e,i,n){var r=this._convert3Dto2D(e),o=this._convert3Dto2D(i);this._line(t,r,o,n)},n.prototype._redrawAxis=function(){var t,e,i,n,r,o,s,a,h,l,c,f=this._getContext();f.font=24/this.camera.getArmLength()+"px arial";var m=.025/this.scale.x,v=.025/this.scale.y,y=5/this.camera.getArmLength(),g=this.camera.getArmRotation().horizontal,_=new d(Math.cos(g),Math.sin(g)),w=this.xRange,x=this.yRange,b=this.zRange;for(f.lineWidth=1,n=void 0===this.defaultXStep,i=new p(w.min,w.max,this.xStep,n),i.start(!0);!i.end();){var S=i.getCurrent();this.showGrid?(t=new u(S,x.min,b.min),e=new u(S,x.max,b.min),this._line3d(f,t,e,this.gridColor)):(t=new u(S,x.min,b.min),e=new u(S,x.min+m,b.min),this._line3d(f,t,e,this.axisColor),t=new u(S,x.max,b.min),e=new u(S,x.max-m,b.min),this._line3d(f,t,e,this.axisColor)),s=_.x>0?x.min:x.max;var T=new u(S,s,b.min),D=" "+this.xValueLabel(S)+" ";this.drawAxisLabelX(f,T,D,g,y),i.next()}for(f.lineWidth=1,n=void 0===this.defaultYStep,i=new p(x.min,x.max,this.yStep,n),i.start(!0);!i.end();){var k=i.getCurrent();this.showGrid?(t=new u(w.min,k,b.min),e=new u(w.max,k,b.min),this._line3d(f,t,e,this.gridColor)):(t=new u(w.min,k,b.min),e=new u(w.min+v,k,b.min),this._line3d(f,t,e,this.axisColor),t=new u(w.max,k,b.min),e=new u(w.max-v,k,b.min),this._line3d(f,t,e,this.axisColor)),o=_.y>0?w.min:w.max,T=new u(o,k,b.min);var D=" "+this.yValueLabel(k)+" ";this.drawAxisLabelY(f,T,D,g,y),i.next()}for(f.lineWidth=1,n=void 0===this.defaultZStep,i=new p(b.min,b.max,this.zStep,n),i.start(!0),o=_.x>0?w.min:w.max,s=_.y<0?x.min:x.max;!i.end();){ -var M=i.getCurrent(),C=new u(o,s,M),E=this._convert3Dto2D(C);e=new d(E.x-y,E.y),this._line(f,E,e,this.axisColor);var D=this.zValueLabel(M)+" ";this.drawAxisLabelZ(f,C,D,5),i.next()}f.lineWidth=1,t=new u(o,s,b.min),e=new u(o,s,b.max),this._line3d(f,t,e,this.axisColor);var O,P;f.lineWidth=1,O=new u(w.min,x.min,b.min),P=new u(w.max,x.min,b.min),this._line3d(f,O,P,this.axisColor),O=new u(w.min,x.max,b.min),P=new u(w.max,x.max,b.min),this._line3d(f,O,P,this.axisColor),f.lineWidth=1,t=new u(w.min,x.min,b.min),e=new u(w.min,x.max,b.min),this._line3d(f,t,e,this.axisColor),t=new u(w.max,x.min,b.min),e=new u(w.max,x.max,b.min),this._line3d(f,t,e,this.axisColor);var L=this.xLabel;L.length>0&&(c=.1/this.scale.y,o=w.center()/2,s=_.x>0?x.min-c:x.max+c,r=new u(o,s,b.min),this.drawAxisLabelX(f,r,L,g));var R=this.yLabel;R.length>0&&(l=.1/this.scale.x,o=_.y>0?w.min-l:w.max+l,s=x.center()/2,r=new u(o,s,b.min),this.drawAxisLabelY(f,r,R,g));var Y=this.zLabel;Y.length>0&&(h=30,o=_.x>0?w.min:w.max,s=_.y<0?x.min:x.max,a=b.center()/2,r=new u(o,s,a),this.drawAxisLabelZ(f,r,Y,h))},n.prototype._hsv2rgb=function(t,e,i){var n,r,o,s,a,h;switch(s=i*e,a=Math.floor(t/60),h=s*(1-Math.abs(t/60%2-1)),a){case 0:n=s,r=h,o=0;break;case 1:n=h,r=s,o=0;break;case 2:n=0,r=s,o=h;break;case 3:n=0,r=h,o=s;break;case 4:n=h,r=0,o=s;break;case 5:n=s,r=0,o=h;break;default:n=0,r=0,o=0}return"RGB("+parseInt(255*n)+","+parseInt(255*r)+","+parseInt(255*o)+")"},n.prototype._getStrokeWidth=function(t){return void 0!==t?this.showPerspective?1/-t.trans.z*this.dataColor.strokeWidth:-(this.eye.z/this.camera.getArmLength())*this.dataColor.strokeWidth:this.dataColor.strokeWidth},n.prototype._redrawBar=function(t,e,i,n,r,o){var s,a,h=this,l=e.point,d=this.zRange.min,c=[{point:new u(l.x-i,l.y-n,l.z)},{point:new u(l.x+i,l.y-n,l.z)},{point:new u(l.x+i,l.y+n,l.z)},{point:new u(l.x-i,l.y+n,l.z)}],f=[{point:new u(l.x-i,l.y-n,d)},{point:new u(l.x+i,l.y-n,d)},{point:new u(l.x+i,l.y+n,d)},{point:new u(l.x-i,l.y+n,d)}];c.forEach(function(t){t.screen=h._convert3Dto2D(t.point)}),f.forEach(function(t){t.screen=h._convert3Dto2D(t.point)});var p=[{corners:c,center:u.avg(f[0].point,f[2].point)},{corners:[c[0],c[1],f[1],f[0]],center:u.avg(f[1].point,f[0].point)},{corners:[c[1],c[2],f[2],f[1]],center:u.avg(f[2].point,f[1].point)},{corners:[c[2],c[3],f[3],f[2]],center:u.avg(f[3].point,f[2].point)},{corners:[c[3],c[0],f[0],f[3]],center:u.avg(f[0].point,f[3].point)}];for(e.surfaces=p,s=0;s0}if(a){var f,p=(e.point.z+i.point.z+n.point.z+r.point.z)/4,m=240*(1-(p-this.zRange.min)*this.scale.z/this.verticalRatio),v=1;this.showShadow?(f=Math.min(1+d.x/c/2,1),o=this._hsv2rgb(m,v,f),s=o):(f=1,o=this._hsv2rgb(m,v,f),s=this.axisColor)}else o="gray",s=this.axisColor;t.lineWidth=this._getStrokeWidth(e);var y=[e,i,r,n];this._polygon(t,y,o,s)}},n.prototype._drawGridLine=function(t,e,i){if(void 0!==e&&void 0!==i){var n=(e.point.z+i.point.z)/2,r=240*(1-(n-this.zRange.min)*this.scale.z/this.verticalRatio);t.lineWidth=2*this._getStrokeWidth(e),t.strokeStyle=this._hsv2rgb(r,1,1),this._line(t,e.screen,i.screen)}},n.prototype._redrawGridGraphPoint=function(t,e){this._drawGridLine(t,e,e.pointRight),this._drawGridLine(t,e,e.pointTop)},n.prototype._redrawLineGraphPoint=function(t,e){void 0!==e.pointNext&&(t.lineWidth=this._getStrokeWidth(e),t.strokeStyle=this.dataColor.stroke,this._line(t,e.screen,e.pointNext.screen))},n.prototype._redrawDataGraph=function(){var t,e=this._getContext();if(!(void 0===this.dataPoints||this.dataPoints.length<=0))for(this._calcTranslations(this.dataPoints),t=0;t0?1:t<0?-1:0}var n=e[0],r=e[1],o=e[2],s=i((r.x-n.x)*(t.y-n.y)-(r.y-n.y)*(t.x-n.x)),a=i((o.x-r.x)*(t.y-r.y)-(o.y-r.y)*(t.x-r.x)),h=i((n.x-o.x)*(t.y-o.y)-(n.y-o.y)*(t.x-o.x));return!(0!=s&&0!=a&&s!=a||0!=a&&0!=h&&a!=h||0!=s&&0!=h&&s!=h)},n.prototype._dataPointFromXY=function(t,e){var i,r=100,o=null,s=null,a=null,h=new d(t,e);if(this.style===n.STYLE.BAR||this.style===n.STYLE.BARCOLOR||this.style===n.STYLE.BARSIZE)for(i=this.dataPoints.length-1;i>=0;i--){o=this.dataPoints[i];var l=o.surfaces;if(l)for(var u=l.length-1;u>=0;u--){var c=l[u],f=c.corners,p=[f[0].screen,f[1].screen,f[2].screen],m=[f[2].screen,f[3].screen,f[0].screen];if(this._insideTriangle(h,p)||this._insideTriangle(h,m))return o}}else for(i=0;i"+this.xLabel+":"+t.point.x+""+this.yLabel+":"+t.point.y+""+this.zLabel+":"+t.point.z+"",e.style.left="0",e.style.top="0",this.frame.appendChild(e),this.frame.appendChild(i),this.frame.appendChild(n);var r=e.offsetWidth,o=e.offsetHeight,s=i.offsetHeight,a=n.offsetWidth,h=n.offsetHeight,l=t.screen.x-r/2;l=Math.min(Math.max(l,10),this.frame.clientWidth-10-r),i.style.left=t.screen.x+"px",i.style.top=t.screen.y-s+"px",e.style.left=l+"px",e.style.top=t.screen.y-s-o+"px",n.style.left=t.screen.x-a/2+"px",n.style.top=t.screen.y-h/2+"px"},n.prototype._hideTooltip=function(){if(this.tooltip){this.tooltip.dataPoint=null;for(var t in this.tooltip.dom)if(this.tooltip.dom.hasOwnProperty(t)){var e=this.tooltip.dom[t];e&&e.parentNode&&e.parentNode.removeChild(e)}}},n.prototype.setCameraPosition=function(t){v.setCameraPosition(t,this),this.redraw()},t.exports=n},function(t,e){function i(t){if(t)return n(t)}function n(t){for(var e in i.prototype)t[e]=i.prototype[e];return t}t.exports=i,i.prototype.on=i.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks[t]=this._callbacks[t]||[]).push(e),this},i.prototype.once=function(t,e){function i(){n.off(t,i),e.apply(this,arguments)}var n=this;return this._callbacks=this._callbacks||{},i.fn=e,this.on(t,i),this},i.prototype.off=i.prototype.removeListener=i.prototype.removeAllListeners=i.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var i=this._callbacks[t];if(!i)return this;if(1==arguments.length)return delete this._callbacks[t],this;for(var n,r=0;r.5*Math.PI&&(this.armRotation.vertical=.5*Math.PI)),void 0===t&&void 0===e||this.calculateCameraOrientation()},n.prototype.getArmRotation=function(){var t={};return t.horizontal=this.armRotation.horizontal,t.vertical=this.armRotation.vertical,t},n.prototype.setArmLength=function(t){void 0!==t&&(this.armLength=t,this.armLength<.71&&(this.armLength=.71),this.armLength>5&&(this.armLength=5),this.calculateCameraOrientation())},n.prototype.getArmLength=function(){return this.armLength},n.prototype.getCameraLocation=function(){return this.cameraLocation},n.prototype.getCameraRotation=function(){return this.cameraRotation},n.prototype.calculateCameraOrientation=function(){this.cameraLocation.x=this.armLocation.x-this.armLength*Math.sin(this.armRotation.horizontal)*Math.cos(this.armRotation.vertical),this.cameraLocation.y=this.armLocation.y-this.armLength*Math.cos(this.armRotation.horizontal)*Math.cos(this.armRotation.vertical),this.cameraLocation.z=this.armLocation.z+this.armLength*Math.sin(this.armRotation.vertical),this.cameraRotation.x=Math.PI/2-this.armRotation.vertical,this.cameraRotation.y=0,this.cameraRotation.z=-this.armRotation.horizontal},t.exports=n},function(t,e,i){function n(t,e,i){this.data=t,this.column=e,this.graph=i,this.index=void 0,this.value=void 0,this.values=i.getDistinctValues(t.get(),this.column),this.values.sort(function(t,e){return t>e?1:t0&&this.selectValue(0),this.dataPoints=[],this.loaded=!1,this.onLoadCallback=void 0,i.animationPreload?(this.loaded=!1,this.loadInBackground()):this.loaded=!0}var r=i(10);n.prototype.isLoaded=function(){return this.loaded},n.prototype.getLoadedProgress=function(){for(var t=this.values.length,e=0;this.dataPoints[e];)e++;return Math.round(e/t*100)},n.prototype.getLabel=function(){return this.graph.filterLabel},n.prototype.getColumn=function(){return this.column},n.prototype.getSelectedValue=function(){if(void 0!==this.index)return this.values[this.index]},n.prototype.getValues=function(){return this.values},n.prototype.getValue=function(t){if(t>=this.values.length)throw new Error("Index out of range");return this.values[t]},n.prototype._getDataPoints=function(t){if(void 0===t&&(t=this.index),void 0===t)return[];var e;if(this.dataPoints[t])e=this.dataPoints[t];else{var i={};i.column=this.column,i.value=this.values[t];var n=new r(this.data,{filter:function(t){return t[i.column]==i.value}}).get();e=this.graph._getDataPoints(n),this.dataPoints[t]=e}return e},n.prototype.setOnLoadCallback=function(t){this.onLoadCallback=t},n.prototype.selectValue=function(t){if(t>=this.values.length)throw new Error("Index out of range");this.index=t,this.value=this.values[t]},n.prototype.loadInBackground=function(t){void 0===t&&(t=0);var e=this.graph.frame;if(t0&&(t--,this.setIndex(t))},n.prototype.next=function(){var t=this.getIndex();t0?this.setIndex(0):this.index=void 0},n.prototype.setIndex=function(t){if(!(tthis.values.length-1&&(n=this.values.length-1),n},n.prototype.indexToLeft=function(t){var e=parseFloat(this.frame.bar.style.width)-this.frame.slide.clientWidth-10,i=t/(this.values.length-1)*e,n=i+3;return n},n.prototype._onMouseMove=function(t){var e=t.clientX-this.startClientX,i=this.startSlideX+e,n=this.leftToIndex(i);this.setIndex(n),r.preventDefault()},n.prototype._onMouseUp=function(t){this.frame.style.cursor="auto",r.removeEventListener(document,"mousemove",this.onmousemove),r.removeEventListener(document,"mouseup",this.onmouseup),r.preventDefault()},t.exports=n},function(t,e){function i(t,e,i,n){this._start=0,this._end=0,this._step=1,this.prettyStep=!0,this.precision=5,this._current=0,this.setRange(t,e,i,n)}i.prototype.isNumeric=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},i.prototype.setRange=function(t,e,i,n){if(!this.isNumeric(t))throw new Error("Parameter 'start' is not numeric; value: "+t);if(!this.isNumeric(e))throw new Error("Parameter 'end' is not numeric; value: "+t);if(!this.isNumeric(i))throw new Error("Parameter 'step' is not numeric; value: "+t);this._start=t?t:0,this._end=e?e:0,this.setStep(i,n)},i.prototype.setStep=function(t,e){void 0===t||t<=0||(void 0!==e&&(this.prettyStep=e),this.prettyStep===!0?this._step=i.calculatePrettyStep(t):this._step=t)},i.calculatePrettyStep=function(t){var e=function(t){return Math.log(t)/Math.LN10},i=Math.pow(10,Math.round(e(t))),n=2*Math.pow(10,Math.round(e(t/2))),r=5*Math.pow(10,Math.round(e(t/5))),o=i;return Math.abs(n-t)<=Math.abs(o-t)&&(o=n),Math.abs(r-t)<=Math.abs(o-t)&&(o=r),o<=0&&(o=1),o},i.prototype.getCurrent=function(){return parseFloat(this._current.toPrecision(this.precision))},i.prototype.getStep=function(){return this._step},i.prototype.start=function(t){void 0===t&&(t=!1),this._current=this._start-this._start%this._step,t&&this.getCurrent()this._end},t.exports=i},function(t,e){function i(){this.min=void 0,this.max=void 0}i.prototype.adjust=function(t){void 0!==t&&((void 0===this.min||this.min>t)&&(this.min=t),(void 0===this.max||this.maxi)throw new Error("Passed expansion value makes range invalid");this.min=e,this.max=i}},i.prototype.range=function(){return this.max-this.min},i.prototype.center=function(){return(this.min+this.max)/2},t.exports=i},function(t,e,i){function n(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}function r(t){return void 0===t||""===t?t:t.charAt(0).toUpperCase()+t.slice(1)}function o(t,e){return void 0===t||""===t?e:t+r(e)}function s(t,e,i,n){var r,s;for(var a in i)r=i[a],s=o(n,r),e[s]=t[r]}function a(t,e,i,n){var r,s;for(var a in i)r=i[a],void 0!==t[r]&&(s=o(n,r),e[s]=t[r])}function h(t,e){if(void 0===t||n(t))throw new Error("No DEFAULTS passed");if(void 0===e)throw new Error("No dst passed");D=t,s(t,e,S),s(t,e,T,"default"),u(t,e),e.margin=10,e.showGrayBottom=!1,e.showTooltip=!1,e.eye=new w(0,0,-1)}function l(t,e){if(void 0!==t){if(void 0===e)throw new Error("No dst passed");if(void 0===D||n(D))throw new Error("DEFAULTS not set for module Settings");a(t,e,S),a(t,e,T,"default"),u(t,e)}}function u(t,e){void 0!==t.backgroundColor&&m(t.backgroundColor,e),v(t.dataColor,e),p(t.style,e),d(t.showLegend,e),y(t.cameraPosition,e),void 0!==t.tooltip&&(e.showTooltip=t.tooltip)}function d(t,e){if(void 0===t){var i=void 0===D.showLegend;if(i){var n=e.style===x.DOTCOLOR||e.style===x.DOTSIZE;e.showLegend=n}}else e.showLegend=t}function c(t){var e=b[t];return void 0===e?-1:e}function f(t){var e=!1;for(var i in x)if(x[i]===t){e=!0;break}return e}function p(t,e){if(void 0!==t){var i;if("string"==typeof t){if(i=c(t),i===-1)throw new Error("Style '"+t+"' is invalid")}else{if(!f(t))throw new Error("Style '"+t+"' is invalid");i=t}e.style=i}}function m(t,e){var i="white",n="gray",r=1;if("string"==typeof t)i=t,n="none",r=0;else{if("object"!==("undefined"==typeof t?"undefined":g(t)))throw new Error("Unsupported type of backgroundColor");void 0!==t.fill&&(i=t.fill),void 0!==t.stroke&&(n=t.stroke),void 0!==t.strokeWidth&&(r=t.strokeWidth)}e.frame.style.backgroundColor=i,e.frame.style.borderColor=n,e.frame.style.borderWidth=r+"px",e.frame.style.borderStyle="solid"}function v(t,e){void 0!==t&&(void 0===e.dataColor&&(e.dataColor={}),"string"==typeof t?(e.dataColor.fill=t,e.dataColor.stroke=t):(t.fill&&(e.dataColor.fill=t.fill),t.stroke&&(e.dataColor.stroke=t.stroke),void 0!==t.strokeWidth&&(e.dataColor.strokeWidth=t.strokeWidth)))}function y(t,e){var i=t;void 0!==i&&(void 0===e.camera&&(e.camera=new _),e.camera.setArmRotation(i.horizontal,i.vertical),e.camera.setArmLength(i.distance))}var g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_=i(15),w=i(13),x={BAR:0,BARCOLOR:1,BARSIZE:2,DOT:3,DOTLINE:4,DOTCOLOR:5,DOTSIZE:6,GRID:7,LINE:8,SURFACE:9},b={dot:x.DOT,"dot-line":x.DOTLINE,"dot-color":x.DOTCOLOR,"dot-size":x.DOTSIZE,line:x.LINE,grid:x.GRID,surface:x.SURFACE,bar:x.BAR,"bar-color":x.BARCOLOR,"bar-size":x.BARSIZE},S=["width","height","filterLabel","legendLabel","xLabel","yLabel","zLabel","xValueLabel","yValueLabel","zValueLabel","showGrid","showPerspective","showShadow","keepAspectRatio","verticalRatio","dotSizeRatio","showAnimationControls","animationInterval","animationPreload","animationAutoStart","axisColor","gridColor","xCenter","yCenter"],T=["xBarWidth","yBarWidth","valueMin","valueMax","xMin","xMax","xStep","yMin","yMax","yStep","zMin","zMax","zStep"],D=void 0;t.exports.STYLE=x,t.exports.setDefaults=h,t.exports.setOptions=l,t.exports.setCameraPosition=y},function(t,e,i){if("undefined"!=typeof window){var n=i(22),r=window.Hammer||i(23);t.exports=n(r,{preventDefault:"mouse"})}else t.exports=function(){throw Error("hammer.js is only available in a browser, not in node.js.")}},function(t,e,i){var n,r,o;!function(i){r=[],n=i,o="function"==typeof n?n.apply(e,r):n,!(void 0!==o&&(t.exports=o))}(function(){var t=null;return function e(i,n){function r(t){return t.match(/[^ ]+/g)}function o(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 i=!1;e.stopPropagation=function(){i=!0};var n=e.srcEvent.stopPropagation.bind(e.srcEvent);"function"==typeof n&&(e.srcEvent.stopPropagation=function(){n(),e.stopPropagation()}),e.firstTarget=t;for(var r=t;r&&!i;){var o=r.hammer;if(o)for(var s,a=0;a0?l._handlers[t]=n:(i.off(t,o),delete l._handlers[t]))}),l},l.emit=function(e,n){t=n.target,i.emit(e,n)},l.destroy=function(){var t=i.element.hammer,e=t.indexOf(l);e!==-1&&t.splice(e,1),t.length||delete i.element.hammer,l._handlers={},i.destroy()},l}})},function(t,e,i){var n;/*! Hammer.JS - v2.0.7 - 2016-04-22 +"use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.vis=e():t.vis=e()}(this,function(){return function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return t[i].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){e.util=n(1),e.DOMutil=n(89),e.DataSet=n(90),e.DataView=n(92),e.Queue=n(91),e.Graph3d=n(93),e.graph3d={Camera:n(97),Filter:n(102),Point2d:n(96),Point3d:n(95),Slider:n(103),StepNumber:n(104)},e.moment=n(84),e.Hammer=n(107),e.keycharm=n(110)},function(t,e,n){function i(t){return t&&t.__esModule?t:{default:t}}var r=n(2),o=i(r),s=n(55),a=i(s),h=n(58),u=i(h),l=n(62),c=i(l),f=n(82),d=i(f),p=n(84),m=n(88);e.isNumber=function(t){return t instanceof Number||"number"==typeof t},e.elementsCensor=function(t){if(t){var e=function(t,e){return e instanceof Element?"DOM Element":e};return JSON.parse((0,d.default)(t,e))}},e.recursiveDOMDelete=function(t){if(t)for(;t.hasChildNodes()===!0;)e.recursiveDOMDelete(t.firstChild),t.removeChild(t.firstChild)},e.giveRange=function(t,e,n,i){if(e==t)return.5;var r=1/(e-t);return Math.max(0,(i-t)*r)},e.isString=function(t){return t instanceof String||"string"==typeof t},e.isDate=function(t){if(t instanceof Date)return!0;if(e.isString(t)){var n=v.exec(t);if(n)return!0;if(!isNaN(Date.parse(t)))return!0}return!1},e.randomUUID=function(){return m.v4()},e.assignAllKeys=function(t,e){for(var n in t)t.hasOwnProperty(n)&&"object"!==(0,c.default)(t[n])&&(t[n]=e)},e.fillIfDefined=function(t,n){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(var r in t)void 0!==n[r]&&("object"!==(0,c.default)(n[r])?void 0!==n[r]&&null!==n[r]||void 0===t[r]||i!==!0?t[r]=n[r]:delete t[r]:"object"===(0,c.default)(t[r])&&e.fillIfDefined(t[r],n[r],i))},e.protoExtend=function(t,e){for(var n=1;n3&&void 0!==arguments[3]&&arguments[3];if(Array.isArray(i))throw new TypeError("Arrays are not supported by deepExtend");for(var o=2;o3&&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(i.hasOwnProperty(o)&&t.indexOf(o)==-1)if(i[o]&&i[o].constructor===Object)void 0===n[o]&&(n[o]={}),n[o].constructor===Object?e.deepExtend(n[o],i[o]):null===i[o]&&void 0!==n[o]&&r===!0?delete n[o]:n[o]=i[o];else if(Array.isArray(i[o])){n[o]=[];for(var s=0;s=0&&(e="DOMMouseScroll"),t.addEventListener(e,n,i)):t.attachEvent("on"+e,n)},e.removeEventListener=function(t,e,n,i){t.removeEventListener?(void 0===i&&(i=!1),"mousewheel"===e&&navigator.userAgent.indexOf("Firefox")>=0&&(e="DOMMouseScroll"),t.removeEventListener(e,n,i)):t.detachEvent("on"+e,n)},e.preventDefault=function(t){t||(t=window.event),t.preventDefault?t.preventDefault():t.returnValue=!1},e.getTarget=function(t){t||(t=window.event);var e;return t.target?e=t.target:t.srcElement&&(e=t.srcElement),void 0!=e.nodeType&&3==e.nodeType&&(e=e.parentNode),e},e.hasParent=function(t,e){for(var n=t;n;){if(n===e)return!0;n=n.parentNode}return!1},e.option={},e.option.asBoolean=function(t,e){return"function"==typeof t&&(t=t()),null!=t?0!=t:e||null},e.option.asNumber=function(t,e){return"function"==typeof t&&(t=t()),null!=t?Number(t)||e||null:e||null},e.option.asString=function(t,e){return"function"==typeof t&&(t=t()),null!=t?String(t):e||null},e.option.asSize=function(t,n){return"function"==typeof t&&(t=t()),e.isString(t)?t:e.isNumber(t)?t+"px":n||null},e.option.asElement=function(t,e){return"function"==typeof t&&(t=t()),t||e||null},e.hexToRGB=function(t){var e=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;t=t.replace(e,function(t,e,n,i){return e+e+n+n+i+i});var n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return n?{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16)}:null},e.overrideOpacity=function(t,n){if(t.indexOf("rgba")!=-1)return t;if(t.indexOf("rgb")!=-1){var i=t.substr(t.indexOf("(")+1).replace(")","").split(",");return"rgba("+i[0]+","+i[1]+","+i[2]+","+n+")"}var i=e.hexToRGB(t);return null==i?t:"rgba("+i.r+","+i.g+","+i.b+","+n+")"},e.RGBToHex=function(t,e,n){return"#"+((1<<24)+(t<<16)+(e<<8)+n).toString(16).slice(1)},e.parseColor=function(t){var n;if(e.isString(t)===!0){if(e.isValidRGB(t)===!0){var i=t.substr(4).substr(0,t.length-5).split(",").map(function(t){return parseInt(t)});t=e.RGBToHex(i[0],i[1],i[2])}if(e.isValidHex(t)===!0){var r=e.hexToHSV(t),o={h:r.h,s:.8*r.s,v:Math.min(1,1.02*r.v)},s={h:r.h,s:Math.min(1,1.25*r.s),v:.8*r.v},a=e.HSVToHex(s.h,s.s,s.v),h=e.HSVToHex(o.h,o.s,o.v);n={background:t,border:a,highlight:{background:h,border:a},hover:{background:h,border:a}}}else n={background:t,border:t,highlight:{background:t,border:t},hover:{background:t,border:t}}}else n={},n.background=t.background||void 0,n.border=t.border||void 0,e.isString(t.highlight)?n.highlight={border:t.highlight,background:t.highlight}:(n.highlight={},n.highlight.background=t.highlight&&t.highlight.background||void 0,n.highlight.border=t.highlight&&t.highlight.border||void 0),e.isString(t.hover)?n.hover={border:t.hover,background:t.hover}:(n.hover={},n.hover.background=t.hover&&t.hover.background||void 0,n.hover.border=t.hover&&t.hover.border||void 0);return n},e.RGBToHSV=function(t,e,n){t/=255,e/=255,n/=255;var i=Math.min(t,Math.min(e,n)),r=Math.max(t,Math.max(e,n));if(i==r)return{h:0,s:0,v:i};var o=t==i?e-n:n==i?t-e:n-t,s=t==i?3:n==i?1:5,a=60*(s-o/(r-i))/360,h=(r-i)/r,u=r;return{h:a,s:h,v:u}};var y={split:function(t){var e={};return t.split(";").forEach(function(t){if(""!=t.trim()){var n=t.split(":"),i=n[0].trim(),r=n[1].trim();e[i]=r}}),e},join:function(t){return(0,u.default)(t).map(function(e){return e+": "+t[e]}).join("; ")}};e.addCssText=function(t,n){var i=y.split(t.style.cssText),r=y.split(n),o=e.extend(i,r);t.style.cssText=y.join(o)},e.removeCssText=function(t,e){var n=y.split(t.style.cssText),i=y.split(e);for(var r in i)i.hasOwnProperty(r)&&delete n[r];t.style.cssText=y.join(n)},e.HSVToRGB=function(t,e,n){var i,r,o,s=Math.floor(6*t),a=6*t-s,h=n*(1-e),u=n*(1-a*e),l=n*(1-(1-a)*e);switch(s%6){case 0:i=n,r=l,o=h;break;case 1:i=u,r=n,o=h;break;case 2:i=h,r=n,o=l;break;case 3:i=h,r=u,o=n;break;case 4:i=l,r=h,o=n;break;case 5:i=n,r=h,o=u}return{r:Math.floor(255*i),g:Math.floor(255*r),b:Math.floor(255*o)}},e.HSVToHex=function(t,n,i){var r=e.HSVToRGB(t,n,i);return e.RGBToHex(r.r,r.g,r.b)},e.hexToHSV=function(t){var n=e.hexToRGB(t);return e.RGBToHSV(n.r,n.g,n.b)},e.isValidHex=function(t){var e=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t);return e},e.isValidRGB=function(t){t=t.replace(" ","");var e=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/i.test(t);return e},e.isValidRGBA=function(t){t=t.replace(" ","");var e=/rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(.{1,3})\)/i.test(t);return e},e.selectiveBridgeObject=function(t,n){if("object"==("undefined"==typeof n?"undefined":(0,c.default)(n))){for(var i=(0,a.default)(n),r=0;r0&&e(i,t[r-1])<0;r--)t[r]=t[r-1];t[r]=i}return t},e.mergeOptions=function(t,e,n){var i=(arguments.length>3&&void 0!==arguments[3]&&arguments[3],arguments.length>4&&void 0!==arguments[4]?arguments[4]:{});if(null===e[n])t[n]=(0,a.default)(i[n]);else if(void 0!==e[n])if("boolean"==typeof e[n])t[n].enabled=e[n];else{void 0===e[n].enabled&&(t[n].enabled=!0);for(var r in e[n])e[n].hasOwnProperty(r)&&(t[n][r]=e[n][r])}},e.binarySearchCustom=function(t,e,n,i){for(var r=1e4,o=0,s=0,a=t.length-1;s<=a&&o0)return"before"==i?Math.max(0,h-1):h;if(r(s,e)<0&&r(a,e)>0)return"before"==i?h:Math.min(t.length-1,h+1);r(s,e)<0?c=h+1:f=h-1,l++}return-1},e.easingFunctions={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return t*(2-t)},easeInOutQuad:function(t){return t<.5?2*t*t:-1+(4-2*t)*t},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return--t*t*t+1},easeInOutCubic:function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return 1- --t*t*t*t},easeInOutQuart:function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return 1+--t*t*t*t*t},easeInOutQuint:function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t}},e.getScrollBarWidth=function(){var t=document.createElement("p");t.style.width="100%",t.style.height="200px";var e=document.createElement("div");e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.visibility="hidden",e.style.width="200px",e.style.height="150px",e.style.overflow="hidden",e.appendChild(t),document.body.appendChild(e);var n=t.offsetWidth;e.style.overflow="scroll";var i=t.offsetWidth;return n==i&&(i=e.clientWidth),document.body.removeChild(e),n-i},e.topMost=function(t,e){var n=void 0;Array.isArray(e)||(e=[e]);var i=!0,r=!1,s=void 0;try{for(var a,h=(0,o.default)(t);!(i=(a=h.next()).done);i=!0){var u=a.value;if(u){n=u[e[0]];for(var l=1;l=t.length?(this._t=void 0,r(1)):"keys"==e?r(0,n):"values"==e?r(0,t[n]):r(0,[n,t[n]])},"values"),o.Arguments=o.Array,i("keys"),i("values"),i("entries")},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e){t.exports={}},function(t,e,n){var i=n(10),r=n(12);t.exports=function(t){return i(r(t))}},function(t,e,n){var i=n(11);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==i(t)?t.split(""):Object(t)}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var i=n(14),r=n(15),o=n(30),s=n(20),a=n(31),h=n(8),u=n(32),l=n(46),c=n(48),f=n(47)("iterator"),d=!([].keys&&"next"in[].keys()),p="@@iterator",m="keys",v="values",y=function(){return this};t.exports=function(t,e,n,g,_,w,x){u(n,e,g);var b,S,T,D=function(t){if(!d&&t in E)return E[t];switch(t){case m:return function(){return new n(this,t)};case v:return function(){return new n(this,t)}}return function(){return new n(this,t)}},M=e+" Iterator",k=_==v,O=!1,E=t.prototype,C=E[f]||E[p]||_&&E[_],P=C||D(_),L=_?k?D("entries"):P:void 0,Y="Array"==e?E.entries||C:C;if(Y&&(T=c(Y.call(new t)),T!==Object.prototype&&(l(T,M,!0),i||a(T,f)||s(T,f,y))),k&&C&&C.name!==v&&(O=!0,P=function(){return C.call(this)}),i&&!x||!d&&!O&&E[f]||s(E,f,P),h[e]=P,h[M]=y,_)if(b={values:k?P:D(v),keys:w?P:D(m),entries:L},x)for(S in b)S in E||o(E,S,b[S]);else r(r.P+r.F*(d||O),e,b);return b}},function(t,e){t.exports=!0},function(t,e,n){var i=n(16),r=n(17),o=n(18),s=n(20),a="prototype",h=function(t,e,n){var u,l,c,f=t&h.F,d=t&h.G,p=t&h.S,m=t&h.P,v=t&h.B,y=t&h.W,g=d?r:r[e]||(r[e]={}),_=g[a],w=d?i:p?i[e]:(i[e]||{})[a];d&&(n=e);for(u in n)l=!f&&w&&void 0!==w[u],l&&u in g||(c=l?w[u]:n[u],g[u]=d&&"function"!=typeof w[u]?n[u]:v&&l?o(c,i):y&&w[u]==c?function(t){var e=function(e,n,i){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,i)}return t.apply(this,arguments)};return e[a]=t[a],e}(c):m&&"function"==typeof c?o(Function.call,c):c,m&&((g.virtual||(g.virtual={}))[u]=c,t&h.R&&_&&!_[u]&&s(_,u,c)))};h.F=1,h.G=2,h.S=4,h.P=8,h.B=16,h.W=32,h.U=64,h.R=128,t.exports=h},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){var n=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=n)},function(t,e,n){var i=n(19);t.exports=function(t,e,n){if(i(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,r){return t.call(e,n,i,r)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){var i=n(21),r=n(29);t.exports=n(25)?function(t,e,n){return i.f(t,e,r(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var i=n(22),r=n(24),o=n(28),s=Object.defineProperty;e.f=n(25)?Object.defineProperty:function(t,e,n){if(i(t),e=o(e,!0),i(n),r)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var i=n(23);t.exports=function(t){if(!i(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){t.exports=!n(25)&&!n(26)(function(){return 7!=Object.defineProperty(n(27)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){t.exports=!n(26)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){var i=n(23),r=n(16).document,o=i(r)&&i(r.createElement);t.exports=function(t){return o?r.createElement(t):{}}},function(t,e,n){var i=n(23);t.exports=function(t,e){if(!i(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!i(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){t.exports=n(20)},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var i=n(33),r=n(29),o=n(46),s={};n(20)(s,n(47)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=i(s,{next:r(1,n)}),o(t,e+" Iterator")}},function(t,e,n){var i=n(22),r=n(34),o=n(44),s=n(41)("IE_PROTO"),a=function(){},h="prototype",u=function(){var t,e=n(27)("iframe"),i=o.length,r="<",s=">";for(e.style.display="none",n(45).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(r+"script"+s+"document.F=Object"+r+"/script"+s),t.close(),u=t.F;i--;)delete u[h][o[i]];return u()};t.exports=Object.create||function(t,e){var n;return null!==t?(a[h]=i(t),n=new a,a[h]=null,n[s]=t):n=u(),void 0===e?n:r(n,e)}},function(t,e,n){var i=n(21),r=n(22),o=n(35);t.exports=n(25)?Object.defineProperties:function(t,e){r(t);for(var n,s=o(e),a=s.length,h=0;a>h;)i.f(t,n=s[h++],e[n]);return t}},function(t,e,n){var i=n(36),r=n(44);t.exports=Object.keys||function(t){return i(t,r)}},function(t,e,n){var i=n(31),r=n(9),o=n(37)(!1),s=n(41)("IE_PROTO");t.exports=function(t,e){var n,a=r(t),h=0,u=[];for(n in a)n!=s&&i(a,n)&&u.push(n);for(;e.length>h;)i(a,n=e[h++])&&(~o(u,n)||u.push(n));return u}},function(t,e,n){var i=n(9),r=n(38),o=n(40);t.exports=function(t){return function(e,n,s){var a,h=i(e),u=r(h.length),l=o(s,u);if(t&&n!=n){for(;u>l;)if(a=h[l++],a!=a)return!0}else for(;u>l;l++)if((t||l in h)&&h[l]===n)return t||l||0;return!t&&-1}}},function(t,e,n){var i=n(39),r=Math.min;t.exports=function(t){return t>0?r(i(t),9007199254740991):0}},function(t,e){var n=Math.ceil,i=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?i:n)(t)}},function(t,e,n){var i=n(39),r=Math.max,o=Math.min;t.exports=function(t,e){return t=i(t),t<0?r(t+e,0):o(t,e)}},function(t,e,n){var i=n(42)("keys"),r=n(43);t.exports=function(t){return i[t]||(i[t]=r(t))}},function(t,e,n){var i=n(16),r="__core-js_shared__",o=i[r]||(i[r]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,e){var n=0,i=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+i).toString(36))}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){t.exports=n(16).document&&document.documentElement},function(t,e,n){var i=n(21).f,r=n(31),o=n(47)("toStringTag");t.exports=function(t,e,n){t&&!r(t=n?t:t.prototype,o)&&i(t,o,{configurable:!0,value:e})}},function(t,e,n){var i=n(42)("wks"),r=n(43),o=n(16).Symbol,s="function"==typeof o,a=t.exports=function(t){return i[t]||(i[t]=s&&o[t]||(s?o:r)("Symbol."+t))};a.store=i},function(t,e,n){var i=n(31),r=n(49),o=n(41)("IE_PROTO"),s=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=r(t),i(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?s:null}},function(t,e,n){var i=n(12);t.exports=function(t){return Object(i(t))}},function(t,e,n){var i=n(51)(!0);n(13)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=i(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){var i=n(39),r=n(12);t.exports=function(t){return function(e,n){var o,s,a=String(r(e)),h=i(n),u=a.length;return h<0||h>=u?t?"":void 0:(o=a.charCodeAt(h),o<55296||o>56319||h+1===u||(s=a.charCodeAt(h+1))<56320||s>57343?t?a.charAt(h):o:t?a.slice(h,h+2):(o-55296<<10)+(s-56320)+65536)}}},function(t,e,n){var i=n(22),r=n(53);t.exports=n(17).getIterator=function(t){var e=r(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return i(e.call(t))}},function(t,e,n){var i=n(54),r=n(47)("iterator"),o=n(8);t.exports=n(17).getIteratorMethod=function(t){if(void 0!=t)return t[r]||t["@@iterator"]||o[i(t)]}},function(t,e,n){var i=n(11),r=n(47)("toStringTag"),o="Arguments"==i(function(){return arguments}()),s=function(t,e){try{return t[e]}catch(t){}};t.exports=function(t){var e,n,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=s(e=Object(t),r))?n:o?i(e):"Object"==(a=i(e))&&"function"==typeof e.callee?"Arguments":a}},function(t,e,n){t.exports={default:n(56),__esModule:!0}},function(t,e,n){n(57);var i=n(17).Object;t.exports=function(t,e){return i.create(t,e)}},function(t,e,n){var i=n(15);i(i.S,"Object",{create:n(33)})},function(t,e,n){t.exports={default:n(59),__esModule:!0}},function(t,e,n){n(60),t.exports=n(17).Object.keys},function(t,e,n){var i=n(49),r=n(35);n(61)("keys",function(){return function(t){return r(i(t))}})},function(t,e,n){var i=n(15),r=n(17),o=n(26);t.exports=function(t,e){var n=(r.Object||{})[t]||Object[t],s={};s[t]=e(n),i(i.S+i.F*o(function(){n(1)}),"Object",s)}},function(t,e,n){function i(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var r=n(63),o=i(r),s=n(66),a=i(s),h="function"==typeof a.default&&"symbol"==typeof o.default?function(t){return typeof t}:function(t){return t&&"function"==typeof a.default&&t.constructor===a.default&&t!==a.default.prototype?"symbol":typeof t};e.default="function"==typeof a.default&&"symbol"===h(o.default)?function(t){return"undefined"==typeof t?"undefined":h(t)}:function(t){return t&&"function"==typeof a.default&&t.constructor===a.default&&t!==a.default.prototype?"symbol":"undefined"==typeof t?"undefined":h(t)}},function(t,e,n){t.exports={default:n(64),__esModule:!0}},function(t,e,n){n(50),n(4),t.exports=n(65).f("iterator")},function(t,e,n){e.f=n(47)},function(t,e,n){t.exports={default:n(67),__esModule:!0}},function(t,e,n){n(68),n(79),n(80),n(81),t.exports=n(17).Symbol},function(t,e,n){var i=n(16),r=n(31),o=n(25),s=n(15),a=n(30),h=n(69).KEY,u=n(26),l=n(42),c=n(46),f=n(43),d=n(47),p=n(65),m=n(70),v=n(71),y=n(72),g=n(75),_=n(22),w=n(9),x=n(28),b=n(29),S=n(33),T=n(76),D=n(78),M=n(21),k=n(35),O=D.f,E=M.f,C=T.f,P=i.Symbol,L=i.JSON,Y=L&&L.stringify,R="prototype",A=d("_hidden"),I=d("toPrimitive"),N={}.propertyIsEnumerable,W=l("symbol-registry"),z=l("symbols"),F=l("op-symbols"),j=Object[R],G="function"==typeof P,B=i.QObject,V=!B||!B[R]||!B[R].findChild,U=o&&u(function(){return 7!=S(E({},"a",{get:function(){return E(this,"a",{value:7}).a}})).a})?function(t,e,n){var i=O(j,e);i&&delete j[e],E(t,e,n),i&&t!==j&&E(j,e,i)}:E,H=function(t){var e=z[t]=S(P[R]);return e._k=t,e},X=G&&"symbol"==typeof P.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof P},Z=function(t,e,n){return t===j&&Z(F,e,n),_(t),e=x(e,!0),_(n),r(z,e)?(n.enumerable?(r(t,A)&&t[A][e]&&(t[A][e]=!1),n=S(n,{enumerable:b(0,!1)})):(r(t,A)||E(t,A,b(1,{})),t[A][e]=!0),U(t,e,n)):E(t,e,n)},q=function(t,e){_(t);for(var n,i=y(e=w(e)),r=0,o=i.length;o>r;)Z(t,n=i[r++],e[n]);return t},$=function(t,e){return void 0===e?S(t):q(S(t),e)},J=function(t){var e=N.call(this,t=x(t,!0));return!(this===j&&r(z,t)&&!r(F,t))&&(!(e||!r(this,t)||!r(z,t)||r(this,A)&&this[A][t])||e)},Q=function(t,e){if(t=w(t),e=x(e,!0),t!==j||!r(z,e)||r(F,e)){var n=O(t,e);return!n||!r(z,e)||r(t,A)&&t[A][e]||(n.enumerable=!0),n}},K=function(t){for(var e,n=C(w(t)),i=[],o=0;n.length>o;)r(z,e=n[o++])||e==A||e==h||i.push(e);return i},tt=function(t){for(var e,n=t===j,i=C(n?F:w(t)),o=[],s=0;i.length>s;)!r(z,e=i[s++])||n&&!r(j,e)||o.push(z[e]);return o};G||(P=function(){if(this instanceof P)throw TypeError("Symbol is not a constructor!");var t=f(arguments.length>0?arguments[0]:void 0),e=function(n){this===j&&e.call(F,n),r(this,A)&&r(this[A],t)&&(this[A][t]=!1),U(this,t,b(1,n))};return o&&V&&U(j,t,{configurable:!0,set:e}),H(t)},a(P[R],"toString",function(){return this._k}),D.f=Q,M.f=Z,n(77).f=T.f=K,n(74).f=J,n(73).f=tt,o&&!n(14)&&a(j,"propertyIsEnumerable",J,!0),p.f=function(t){return H(d(t))}),s(s.G+s.W+s.F*!G,{Symbol:P});for(var et="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),nt=0;et.length>nt;)d(et[nt++]);for(var et=k(d.store),nt=0;et.length>nt;)m(et[nt++]);s(s.S+s.F*!G,"Symbol",{for:function(t){return r(W,t+="")?W[t]:W[t]=P(t)},keyFor:function(t){if(X(t))return v(W,t);throw TypeError(t+" is not a symbol!")},useSetter:function(){V=!0},useSimple:function(){V=!1}}),s(s.S+s.F*!G,"Object",{create:$,defineProperty:Z,defineProperties:q,getOwnPropertyDescriptor:Q,getOwnPropertyNames:K,getOwnPropertySymbols:tt}),L&&s(s.S+s.F*(!G||u(function(){var t=P();return"[null]"!=Y([t])||"{}"!=Y({a:t})||"{}"!=Y(Object(t))})),"JSON",{stringify:function(t){if(void 0!==t&&!X(t)){for(var e,n,i=[t],r=1;arguments.length>r;)i.push(arguments[r++]);return e=i[1],"function"==typeof e&&(n=e),!n&&g(e)||(e=function(t,e){if(n&&(e=n.call(this,t,e)),!X(e))return e}),i[1]=e,Y.apply(L,i)}}}),P[R][I]||n(20)(P[R],I,P[R].valueOf),c(P,"Symbol"),c(Math,"Math",!0),c(i.JSON,"JSON",!0)},function(t,e,n){var i=n(43)("meta"),r=n(23),o=n(31),s=n(21).f,a=0,h=Object.isExtensible||function(){return!0},u=!n(26)(function(){return h(Object.preventExtensions({}))}),l=function(t){s(t,i,{value:{i:"O"+ ++a,w:{}}})},c=function(t,e){if(!r(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,i)){if(!h(t))return"F";if(!e)return"E";l(t)}return t[i].i},f=function(t,e){if(!o(t,i)){if(!h(t))return!0;if(!e)return!1;l(t)}return t[i].w},d=function(t){return u&&p.NEED&&h(t)&&!o(t,i)&&l(t),t},p=t.exports={KEY:i,NEED:!1,fastKey:c,getWeak:f,onFreeze:d}},function(t,e,n){var i=n(16),r=n(17),o=n(14),s=n(65),a=n(21).f;t.exports=function(t){var e=r.Symbol||(r.Symbol=o?{}:i.Symbol||{});"_"==t.charAt(0)||t in e||a(e,t,{value:s.f(t)})}},function(t,e,n){var i=n(35),r=n(9);t.exports=function(t,e){for(var n,o=r(t),s=i(o),a=s.length,h=0;a>h;)if(o[n=s[h++]]===e)return n}},function(t,e,n){var i=n(35),r=n(73),o=n(74);t.exports=function(t){var e=i(t),n=r.f;if(n)for(var s,a=n(t),h=o.f,u=0;a.length>u;)h.call(t,s=a[u++])&&e.push(s);return e}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){var i=n(11);t.exports=Array.isArray||function(t){return"Array"==i(t)}},function(t,e,n){var i=n(9),r=n(77).f,o={}.toString,s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(t){try{return r(t)}catch(t){return s.slice()}};t.exports.f=function(t){return s&&"[object Window]"==o.call(t)?a(t):r(i(t))}},function(t,e,n){var i=n(36),r=n(44).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return i(t,r)}},function(t,e,n){var i=n(74),r=n(29),o=n(9),s=n(28),a=n(31),h=n(24),u=Object.getOwnPropertyDescriptor;e.f=n(25)?u:function(t,e){if(t=o(t),e=s(e,!0),h)try{return u(t,e)}catch(t){}if(a(t,e))return r(!i.f.call(t,e),t[e])}},function(t,e){},function(t,e,n){n(70)("asyncIterator")},function(t,e,n){n(70)("observable")},function(t,e,n){t.exports={default:n(83),__esModule:!0}},function(t,e,n){var i=n(17),r=i.JSON||(i.JSON={stringify:JSON.stringify});t.exports=function(t){return r.stringify.apply(r,arguments)}},function(t,e,n){t.exports="undefined"!=typeof window&&window.moment||n(85)},function(t,e,n){(function(t){!function(e,n){t.exports=n()}(this,function(){function e(){return vi.apply(null,arguments)}function n(t){vi=t}function i(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function r(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function o(t){var e;for(e in t)return!1;return!0}function s(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function a(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function h(t,e){var n,i=[];for(n=0;n0)for(n in _i)i=_i[n],r=e[i],v(r)||(t[i]=r);return t}function g(t){y(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),wi===!1&&(wi=!0,e.updateOffset(this),wi=!1)}function _(t){return t instanceof g||null!=t&&null!=t._isAMomentObject}function w(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function x(t){var e=+t,n=0;return 0!==e&&isFinite(e)&&(n=w(e)),n}function b(t,e,n){var i,r=Math.min(t.length,e.length),o=Math.abs(t.length-e.length),s=0;for(i=0;i0?"future":"past"];return M(n)?n(e):n.replace(/%s/i,e)}function I(t,e){var n=t.toLowerCase();Pi[n]=Pi[n+"s"]=Pi[e]=t}function N(t){return"string"==typeof t?Pi[t]||Pi[t.toLowerCase()]:void 0}function W(t){var e,n,i={};for(n in t)u(t,n)&&(e=N(n),e&&(i[e]=t[n]));return i}function z(t,e){Li[t]=e}function F(t){var e=[];for(var n in t)e.push({unit:n,priority:Li[n]});return e.sort(function(t,e){return t.priority-e.priority}),e}function j(t,n){return function(i){return null!=i?(B(this,t,i),e.updateOffset(this,n),this):G(this,t)}}function G(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function B(t,e,n){t.isValid()&&t._d["set"+(t._isUTC?"UTC":"")+e](n)}function V(t){return t=N(t),M(this[t])?this[t]():this}function U(t,e){if("object"==typeof t){t=W(t);for(var n=F(t),i=0;i=0;return(o?n?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+i}function X(t,e,n,i){var r=i;"string"==typeof i&&(r=function(){return this[i]()}),t&&(Ii[t]=r),e&&(Ii[e[0]]=function(){return H(r.apply(this,arguments),e[1],e[2])}),n&&(Ii[n]=function(){return this.localeData().ordinal(r.apply(this,arguments),t)})}function Z(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function q(t){var e,n,i=t.match(Yi);for(e=0,n=i.length;e=0&&Ri.test(t);)t=t.replace(Ri,n),Ri.lastIndex=0,i-=1;return t}function Q(t,e,n){tr[t]=M(e)?e:function(t,i){return t&&n?n:e}}function K(t,e){return u(tr,t)?tr[t](e._strict,e._locale):new RegExp(tt(t))}function tt(t){return et(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,i,r){return e||n||i||r}))}function et(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function nt(t,e){var n,i=e;for("string"==typeof t&&(t=[t]),s(e)&&(i=function(t,n){n[e]=x(t)}),n=0;n=0&&isFinite(a.getFullYear())&&a.setFullYear(t),a}function wt(t){var e=new Date(Date.UTC.apply(null,arguments));return t<100&&t>=0&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function xt(t,e,n){var i=7+e-n,r=(7+wt(t,0,i).getUTCDay()-e)%7;return-r+i-1}function bt(t,e,n,i,r){var o,s,a=(7+n-i)%7,h=xt(t,i,r),u=1+7*(e-1)+a+h;return u<=0?(o=t-1,s=vt(o)+u):u>vt(t)?(o=t+1,s=u-vt(t)):(o=t,s=u),{year:o,dayOfYear:s}}function St(t,e,n){var i,r,o=xt(t.year(),e,n),s=Math.floor((t.dayOfYear()-o-1)/7)+1;return s<1?(r=t.year()-1,i=s+Tt(r,e,n)):s>Tt(t.year(),e,n)?(i=s-Tt(t.year(),e,n),r=t.year()+1):(r=t.year(),i=s),{week:i,year:r}}function Tt(t,e,n){var i=xt(t,e,n),r=xt(t+1,e,n);return(vt(t)-i+r)/7}function Dt(t){return St(t,this._week.dow,this._week.doy).week}function Mt(){return this._week.dow}function kt(){return this._week.doy}function Ot(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function Et(t){var e=St(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function Ct(t,e){return"string"!=typeof t?t:isNaN(t)?(t=e.weekdaysParse(t),"number"==typeof t?t:null):parseInt(t,10)}function Pt(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function Lt(t,e){return t?i(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(e)?"format":"standalone"][t.day()]:this._weekdays}function Yt(t){return t?this._weekdaysShort[t.day()]:this._weekdaysShort}function Rt(t){return t?this._weekdaysMin[t.day()]:this._weekdaysMin}function At(t,e,n){var i,r,o,s=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],i=0;i<7;++i)o=c([2e3,1]).day(i),this._minWeekdaysParse[i]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[i]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[i]=this.weekdays(o,"").toLocaleLowerCase();return n?"dddd"===e?(r=cr.call(this._weekdaysParse,s),r!==-1?r:null):"ddd"===e?(r=cr.call(this._shortWeekdaysParse,s),r!==-1?r:null):(r=cr.call(this._minWeekdaysParse,s),r!==-1?r:null):"dddd"===e?(r=cr.call(this._weekdaysParse,s),r!==-1?r:(r=cr.call(this._shortWeekdaysParse,s),r!==-1?r:(r=cr.call(this._minWeekdaysParse,s),r!==-1?r:null))):"ddd"===e?(r=cr.call(this._shortWeekdaysParse,s),r!==-1?r:(r=cr.call(this._weekdaysParse,s),r!==-1?r:(r=cr.call(this._minWeekdaysParse,s),r!==-1?r:null))):(r=cr.call(this._minWeekdaysParse,s),r!==-1?r:(r=cr.call(this._weekdaysParse,s),r!==-1?r:(r=cr.call(this._shortWeekdaysParse,s),r!==-1?r:null)))}function It(t,e,n){var i,r,o;if(this._weekdaysParseExact)return At.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;i<7;i++){if(r=c([2e3,1]).day(i),n&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(r,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(r,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(r,"").replace(".",".?")+"$","i")),this._weekdaysParse[i]||(o="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[i]=new RegExp(o.replace(".",""),"i")),n&&"dddd"===e&&this._fullWeekdaysParse[i].test(t))return i;if(n&&"ddd"===e&&this._shortWeekdaysParse[i].test(t))return i;if(n&&"dd"===e&&this._minWeekdaysParse[i].test(t))return i;if(!n&&this._weekdaysParse[i].test(t))return i}}function Nt(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=Ct(t,this.localeData()),this.add(t-e,"d")):e}function Wt(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function zt(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=Pt(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7}function Ft(t){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||Bt.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(u(this,"_weekdaysRegex")||(this._weekdaysRegex=br),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function jt(t){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||Bt.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(u(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Sr),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Gt(t){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||Bt.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(u(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Tr),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Bt(){function t(t,e){return e.length-t.length}var e,n,i,r,o,s=[],a=[],h=[],u=[];for(e=0;e<7;e++)n=c([2e3,1]).day(e),i=this.weekdaysMin(n,""),r=this.weekdaysShort(n,""),o=this.weekdays(n,""),s.push(i),a.push(r),h.push(o),u.push(i),u.push(r),u.push(o);for(s.sort(t),a.sort(t),h.sort(t),u.sort(t),e=0;e<7;e++)a[e]=et(a[e]),h[e]=et(h[e]),u[e]=et(u[e]);this._weekdaysRegex=new RegExp("^("+u.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("^("+s.join("|")+")","i")}function Vt(){return this.hours()%12||12}function Ut(){return this.hours()||24}function Ht(t,e){X(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function Xt(t,e){return e._meridiemParse}function Zt(t){return"p"===(t+"").toLowerCase().charAt(0)}function qt(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}function $t(t){return t?t.toLowerCase().replace("_","-"):t}function Jt(t){for(var e,n,i,r,o=0;o0;){if(i=Qt(r.slice(0,e).join("-")))return i;if(n&&n.length>=e&&b(r,n,!0)>=e-1)break;e--}o++}return null}function Qt(e){var n=null;if(!Er[e]&&"undefined"!=typeof t&&t&&t.exports)try{n=Dr._abbr,!function(){var t=new Error('Cannot find module "./locale"');throw t.code="MODULE_NOT_FOUND",t}(),Kt(n)}catch(t){}return Er[e]}function Kt(t,e){var n;return t&&(n=v(e)?ne(t):te(t,e),n&&(Dr=n)),Dr._abbr}function te(t,e){if(null!==e){var n=Or;if(e.abbr=t,null!=Er[t])D("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=Er[t]._config;else if(null!=e.parentLocale){if(null==Er[e.parentLocale])return Cr[e.parentLocale]||(Cr[e.parentLocale]=[]),Cr[e.parentLocale].push({name:t,config:e}),null;n=Er[e.parentLocale]._config}return Er[t]=new E(O(n,e)),Cr[t]&&Cr[t].forEach(function(t){te(t.name,t.config)}),Kt(t),Er[t]}return delete Er[t],null}function ee(t,e){if(null!=e){var n,i=Or;null!=Er[t]&&(i=Er[t]._config),e=O(i,e),n=new E(e),n.parentLocale=Er[t],Er[t]=n,Kt(t)}else null!=Er[t]&&(null!=Er[t].parentLocale?Er[t]=Er[t].parentLocale:null!=Er[t]&&delete Er[t]);return Er[t]}function ne(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Dr;if(!i(t)){if(e=Qt(t))return e;t=[t]}return Jt(t)}function ie(){return Ti(Er)}function re(t){var e,n=t._a;return n&&d(t).overflow===-2&&(e=n[ir]<0||n[ir]>11?ir:n[rr]<1||n[rr]>ot(n[nr],n[ir])?rr:n[or]<0||n[or]>24||24===n[or]&&(0!==n[sr]||0!==n[ar]||0!==n[hr])?or:n[sr]<0||n[sr]>59?sr:n[ar]<0||n[ar]>59?ar:n[hr]<0||n[hr]>999?hr:-1,d(t)._overflowDayOfYear&&(err)&&(e=rr),d(t)._overflowWeeks&&e===-1&&(e=ur),d(t)._overflowWeekday&&e===-1&&(e=lr),d(t).overflow=e),t}function oe(t){var e,n,i,r,o,s,a=t._i,h=Pr.exec(a)||Lr.exec(a);if(h){for(d(t).iso=!0,e=0,n=Rr.length;evt(r)&&(d(t)._overflowDayOfYear=!0),n=wt(r,0,t._dayOfYear),t._a[ir]=n.getUTCMonth(),t._a[rr]=n.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=o[e]=i[e];for(;e<7;e++)t._a[e]=o[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[or]&&0===t._a[sr]&&0===t._a[ar]&&0===t._a[hr]&&(t._nextDay=!0,t._a[or]=0),t._d=(t._useUTC?wt:_t).apply(null,o),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[or]=24)}}function le(t){var e,n,i,r,o,s,a,h;if(e=t._w,null!=e.GG||null!=e.W||null!=e.E)o=1,s=4,n=ae(e.GG,t._a[nr],St(_e(),1,4).year),i=ae(e.W,1),r=ae(e.E,1),(r<1||r>7)&&(h=!0);else{o=t._locale._week.dow,s=t._locale._week.doy;var u=St(_e(),o,s);n=ae(e.gg,t._a[nr],u.year),i=ae(e.w,u.week),null!=e.d?(r=e.d,(r<0||r>6)&&(h=!0)):null!=e.e?(r=e.e+o,(e.e<0||e.e>6)&&(h=!0)):r=o}i<1||i>Tt(n,o,s)?d(t)._overflowWeeks=!0:null!=h?d(t)._overflowWeekday=!0:(a=bt(n,i,r,o,s),t._a[nr]=a.year,t._dayOfYear=a.dayOfYear)}function ce(t){if(t._f===e.ISO_8601)return void oe(t);t._a=[],d(t).empty=!0;var n,i,r,o,s,a=""+t._i,h=a.length,u=0;for(r=J(t._f,t._locale).match(Yi)||[],n=0;n0&&d(t).unusedInput.push(s),a=a.slice(a.indexOf(i)+i.length),u+=i.length),Ii[o]?(i?d(t).empty=!1:d(t).unusedTokens.push(o),rt(o,i,t)):t._strict&&!i&&d(t).unusedTokens.push(o);d(t).charsLeftOver=h-u,a.length>0&&d(t).unusedInput.push(a),t._a[or]<=12&&d(t).bigHour===!0&&t._a[or]>0&&(d(t).bigHour=void 0),d(t).parsedDateParts=t._a.slice(0),d(t).meridiem=t._meridiem,t._a[or]=fe(t._locale,t._a[or],t._meridiem),ue(t),re(t)}function fe(t,e,n){var i;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?(i=t.isPM(n),i&&e<12&&(e+=12),i||12!==e||(e=0),e):e}function de(t){var e,n,i,r,o;if(0===t._f.length)return d(t).invalidFormat=!0,void(t._d=new Date(NaN));for(r=0;rthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ne(){if(!v(this._isDSTShifted))return this._isDSTShifted;var t={};if(y(t,this),t=ve(t),t._a){var e=t._isUTC?c(t._a):_e(t._a);this._isDSTShifted=this.isValid()&&b(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function We(){return!!this.isValid()&&!this._isUTC}function ze(){return!!this.isValid()&&this._isUTC}function Fe(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function je(t,e){var n,i,r,o=t,a=null;return Te(t)?o={ms:t._milliseconds,d:t._days,M:t._months}:s(t)?(o={},e?o[e]=t:o.milliseconds=t):(a=jr.exec(t))?(n="-"===a[1]?-1:1,o={y:0,d:x(a[rr])*n,h:x(a[or])*n,m:x(a[sr])*n,s:x(a[ar])*n,ms:x(De(1e3*a[hr]))*n}):(a=Gr.exec(t))?(n="-"===a[1]?-1:1,o={y:Ge(a[2],n),M:Ge(a[3],n),w:Ge(a[4],n),d:Ge(a[5],n),h:Ge(a[6],n),m:Ge(a[7],n),s:Ge(a[8],n)}):null==o?o={}:"object"==typeof o&&("from"in o||"to"in o)&&(r=Ve(_e(o.from),_e(o.to)),o={},o.ms=r.milliseconds,o.M=r.months),i=new Se(o),Te(t)&&u(t,"_locale")&&(i._locale=t._locale),i}function Ge(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function Be(t,e){var n={milliseconds:0,months:0};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function Ve(t,e){var n;return t.isValid()&&e.isValid()?(e=Oe(e,t),t.isBefore(e)?n=Be(t,e):(n=Be(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Ue(t,e){return function(n,i){var r,o;return null===i||isNaN(+i)||(D(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=n,n=i,i=o),n="string"==typeof n?+n:n,r=je(n,i),He(this,r,t),this}}function He(t,n,i,r){var o=n._milliseconds,s=De(n._days),a=De(n._months);t.isValid()&&(r=null==r||r,o&&t._d.setTime(t._d.valueOf()+o*i),s&&B(t,"Date",G(t,"Date")+s*i),a&<(t,G(t,"Month")+a*i),r&&e.updateOffset(t,s||a))}function Xe(t,e){var n=t.diff(e,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function Ze(t,n){var i=t||_e(),r=Oe(i,this).startOf("day"),o=e.calendarFormat(this,r)||"sameElse",s=n&&(M(n[o])?n[o].call(this,i):n[o]);return this.format(s||this.localeData().calendar(o,this,_e(i)))}function qe(){return new g(this)}function $e(t,e){var n=_(t)?t:_e(t);return!(!this.isValid()||!n.isValid())&&(e=N(v(e)?"millisecond":e),"millisecond"===e?this.valueOf()>n.valueOf():n.valueOf()o&&(e=o),Yn.call(this,t,e,n,i,r))}function Yn(t,e,n,i,r){var o=bt(t,e,n,i,r),s=wt(o.year,0,o.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}function Rn(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}function An(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function In(t,e){e[hr]=x(1e3*("0."+t))}function Nn(){return this._isUTC?"UTC":""}function Wn(){return this._isUTC?"Coordinated Universal Time":""}function zn(t){return _e(1e3*t)}function Fn(){return _e.apply(null,arguments).parseZone()}function jn(t){return t}function Gn(t,e,n,i){var r=ne(),o=c().set(i,e);return r[n](o,t)}function Bn(t,e,n){if(s(t)&&(e=t,t=void 0),t=t||"",null!=e)return Gn(t,e,n,"month");var i,r=[];for(i=0;i<12;i++)r[i]=Gn(t,i,n,"month");return r}function Vn(t,e,n,i){"boolean"==typeof t?(s(e)&&(n=e,e=void 0),e=e||""):(e=t,n=e,t=!1,s(e)&&(n=e,e=void 0),e=e||"");var r=ne(),o=t?r._week.dow:0;if(null!=n)return Gn(e,(n+o)%7,i,"day");var a,h=[];for(a=0;a<7;a++)h[a]=Gn(e,(a+o)%7,i,"day");return h}function Un(t,e){return Bn(t,e,"months")}function Hn(t,e){return Bn(t,e,"monthsShort")}function Xn(t,e,n){return Vn(t,e,n,"weekdays")}function Zn(t,e,n){return Vn(t,e,n,"weekdaysShort")}function qn(t,e,n){return Vn(t,e,n,"weekdaysMin")}function $n(){var t=this._data;return this._milliseconds=Kr(this._milliseconds),this._days=Kr(this._days),this._months=Kr(this._months),t.milliseconds=Kr(t.milliseconds),t.seconds=Kr(t.seconds),t.minutes=Kr(t.minutes),t.hours=Kr(t.hours),t.months=Kr(t.months),t.years=Kr(t.years),this}function Jn(t,e,n,i){var r=je(e,n);return t._milliseconds+=i*r._milliseconds,t._days+=i*r._days,t._months+=i*r._months,t._bubble()}function Qn(t,e){return Jn(this,t,e,1)}function Kn(t,e){return Jn(this,t,e,-1)}function ti(t){return t<0?Math.floor(t):Math.ceil(t)}function ei(){var t,e,n,i,r,o=this._milliseconds,s=this._days,a=this._months,h=this._data;return o>=0&&s>=0&&a>=0||o<=0&&s<=0&&a<=0||(o+=864e5*ti(ii(a)+s),s=0,a=0),h.milliseconds=o%1e3,t=w(o/1e3),h.seconds=t%60,e=w(t/60),h.minutes=e%60,n=w(e/60),h.hours=n%24,s+=w(n/24),r=w(ni(s)),a+=r,s-=ti(ii(r)),i=w(a/12),a%=12,h.days=s,h.months=a,h.years=i,this}function ni(t){return 4800*t/146097}function ii(t){return 146097*t/4800; +}function ri(t){var e,n,i=this._milliseconds;if(t=N(t),"month"===t||"year"===t)return e=this._days+i/864e5,n=this._months+ni(e),"month"===t?n:n/12;switch(e=this._days+Math.round(ii(this._months)),t){case"week":return e/7+i/6048e5;case"day":return e+i/864e5;case"hour":return 24*e+i/36e5;case"minute":return 1440*e+i/6e4;case"second":return 86400*e+i/1e3;case"millisecond":return Math.floor(864e5*e)+i;default:throw new Error("Unknown unit "+t)}}function oi(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*x(this._months/12)}function si(t){return function(){return this.as(t)}}function ai(t){return t=N(t),this[t+"s"]()}function hi(t){return function(){return this._data[t]}}function ui(){return w(this.days()/7)}function li(t,e,n,i,r){return r.relativeTime(e||1,!!n,t,i)}function ci(t,e,n){var i=je(t).abs(),r=vo(i.as("s")),o=vo(i.as("m")),s=vo(i.as("h")),a=vo(i.as("d")),h=vo(i.as("M")),u=vo(i.as("y")),l=r0,l[4]=n,li.apply(null,l)}function fi(t){return void 0===t?vo:"function"==typeof t&&(vo=t,!0)}function di(t,e){return void 0!==yo[t]&&(void 0===e?yo[t]:(yo[t]=e,!0))}function pi(t){var e=this.localeData(),n=ci(this,!t,e);return t&&(n=e.pastFuture(+this,n)),e.postformat(n)}function mi(){var t,e,n,i=go(this._milliseconds)/1e3,r=go(this._days),o=go(this._months);t=w(i/60),e=w(t/60),i%=60,t%=60,n=w(o/12),o%=12;var s=n,a=o,h=r,u=e,l=t,c=i,f=this.asSeconds();return f?(f<0?"-":"")+"P"+(s?s+"Y":"")+(a?a+"M":"")+(h?h+"D":"")+(u||l||c?"T":"")+(u?u+"H":"")+(l?l+"M":"")+(c?c+"S":""):"P0D"}var vi,yi;yi=Array.prototype.some?Array.prototype.some:function(t){for(var e=Object(this),n=e.length>>>0,i=0;i68?1900:2e3)};var yr=j("FullYear",!0);X("w",["ww",2],"wo","week"),X("W",["WW",2],"Wo","isoWeek"),I("week","w"),I("isoWeek","W"),z("week",5),z("isoWeek",5),Q("w",Gi),Q("ww",Gi,Wi),Q("W",Gi),Q("WW",Gi,Wi),it(["w","ww","W","WW"],function(t,e,n,i){e[i.substr(0,1)]=x(t)});var gr={dow:0,doy:6};X("d",0,"do","day"),X("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),X("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),X("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),X("e",0,0,"weekday"),X("E",0,0,"isoWeekday"),I("day","d"),I("weekday","e"),I("isoWeekday","E"),z("day",11),z("weekday",11),z("isoWeekday",11),Q("d",Gi),Q("e",Gi),Q("E",Gi),Q("dd",function(t,e){return e.weekdaysMinRegex(t)}),Q("ddd",function(t,e){return e.weekdaysShortRegex(t)}),Q("dddd",function(t,e){return e.weekdaysRegex(t)}),it(["dd","ddd","dddd"],function(t,e,n,i){var r=n._locale.weekdaysParse(t,i,n._strict);null!=r?e.d=r:d(n).invalidWeekday=t}),it(["d","e","E"],function(t,e,n,i){e[i]=x(t)});var _r="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),wr="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),xr="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),br=Ki,Sr=Ki,Tr=Ki;X("H",["HH",2],0,"hour"),X("h",["hh",2],0,Vt),X("k",["kk",2],0,Ut),X("hmm",0,0,function(){return""+Vt.apply(this)+H(this.minutes(),2)}),X("hmmss",0,0,function(){return""+Vt.apply(this)+H(this.minutes(),2)+H(this.seconds(),2)}),X("Hmm",0,0,function(){return""+this.hours()+H(this.minutes(),2)}),X("Hmmss",0,0,function(){return""+this.hours()+H(this.minutes(),2)+H(this.seconds(),2)}),Ht("a",!0),Ht("A",!1),I("hour","h"),z("hour",13),Q("a",Xt),Q("A",Xt),Q("H",Gi),Q("h",Gi),Q("HH",Gi,Wi),Q("hh",Gi,Wi),Q("hmm",Bi),Q("hmmss",Vi),Q("Hmm",Bi),Q("Hmmss",Vi),nt(["H","HH"],or),nt(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),nt(["h","hh"],function(t,e,n){e[or]=x(t),d(n).bigHour=!0}),nt("hmm",function(t,e,n){var i=t.length-2;e[or]=x(t.substr(0,i)),e[sr]=x(t.substr(i)),d(n).bigHour=!0}),nt("hmmss",function(t,e,n){var i=t.length-4,r=t.length-2;e[or]=x(t.substr(0,i)),e[sr]=x(t.substr(i,2)),e[ar]=x(t.substr(r)),d(n).bigHour=!0}),nt("Hmm",function(t,e,n){var i=t.length-2;e[or]=x(t.substr(0,i)),e[sr]=x(t.substr(i))}),nt("Hmmss",function(t,e,n){var i=t.length-4,r=t.length-2;e[or]=x(t.substr(0,i)),e[sr]=x(t.substr(i,2)),e[ar]=x(t.substr(r))});var Dr,Mr=/[ap]\.?m?\.?/i,kr=j("Hours",!0),Or={calendar:Di,longDateFormat:Mi,invalidDate:ki,ordinal:Oi,ordinalParse:Ei,relativeTime:Ci,months:dr,monthsShort:pr,week:gr,weekdays:_r,weekdaysMin:xr,weekdaysShort:wr,meridiemParse:Mr},Er={},Cr={},Pr=/^\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)?)?$/,Lr=/^\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)?)?$/,Yr=/Z|[+-]\d\d(?::?\d\d)?/,Rr=[["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}/]],Ar=[["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/]],Ir=/^\/?Date\((\-?\d+)/i;e.createFromInputFallback=T("value provided is not in a recognized ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non 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(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),e.ISO_8601=function(){};var Nr=T("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=_e.apply(null,arguments);return this.isValid()&&t.isValid()?tthis?this:t:m()}),zr=function(){return Date.now?Date.now():+new Date};Me("Z",":"),Me("ZZ",""),Q("Z",Ji),Q("ZZ",Ji),nt(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=ke(Ji,t)});var Fr=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var jr=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Gr=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;je.fn=Se.prototype;var Br=Ue(1,"add"),Vr=Ue(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Ur=T("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});X(0,["gg",2],0,function(){return this.weekYear()%100}),X(0,["GG",2],0,function(){return this.isoWeekYear()%100}),kn("gggg","weekYear"),kn("ggggg","weekYear"),kn("GGGG","isoWeekYear"),kn("GGGGG","isoWeekYear"),I("weekYear","gg"),I("isoWeekYear","GG"),z("weekYear",1),z("isoWeekYear",1),Q("G",qi),Q("g",qi),Q("GG",Gi,Wi),Q("gg",Gi,Wi),Q("GGGG",Hi,Fi),Q("gggg",Hi,Fi),Q("GGGGG",Xi,ji),Q("ggggg",Xi,ji),it(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,i){e[i.substr(0,2)]=x(t)}),it(["gg","GG"],function(t,n,i,r){n[r]=e.parseTwoDigitYear(t)}),X("Q",0,"Qo","quarter"),I("quarter","Q"),z("quarter",7),Q("Q",Ni),nt("Q",function(t,e){e[ir]=3*(x(t)-1)}),X("D",["DD",2],"Do","date"),I("date","D"),z("date",9),Q("D",Gi),Q("DD",Gi,Wi),Q("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),nt(["D","DD"],rr),nt("Do",function(t,e){e[rr]=x(t.match(Gi)[0],10)});var Hr=j("Date",!0);X("DDD",["DDDD",3],"DDDo","dayOfYear"),I("dayOfYear","DDD"),z("dayOfYear",4),Q("DDD",Ui),Q("DDDD",zi),nt(["DDD","DDDD"],function(t,e,n){n._dayOfYear=x(t)}),X("m",["mm",2],0,"minute"),I("minute","m"),z("minute",14),Q("m",Gi),Q("mm",Gi,Wi),nt(["m","mm"],sr);var Xr=j("Minutes",!1);X("s",["ss",2],0,"second"),I("second","s"),z("second",15),Q("s",Gi),Q("ss",Gi,Wi),nt(["s","ss"],ar);var Zr=j("Seconds",!1);X("S",0,0,function(){return~~(this.millisecond()/100)}),X(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),X(0,["SSS",3],0,"millisecond"),X(0,["SSSS",4],0,function(){return 10*this.millisecond()}),X(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),X(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),X(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),X(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),X(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),I("millisecond","ms"),z("millisecond",16),Q("S",Ui,Ni),Q("SS",Ui,Wi),Q("SSS",Ui,zi);var qr;for(qr="SSSS";qr.length<=9;qr+="S")Q(qr,Zi);for(qr="S";qr.length<=9;qr+="S")nt(qr,In);var $r=j("Milliseconds",!1);X("z",0,0,"zoneAbbr"),X("zz",0,0,"zoneName");var Jr=g.prototype;Jr.add=Br,Jr.calendar=Ze,Jr.clone=qe,Jr.diff=nn,Jr.endOf=vn,Jr.format=hn,Jr.from=un,Jr.fromNow=ln,Jr.to=cn,Jr.toNow=fn,Jr.get=V,Jr.invalidAt=Dn,Jr.isAfter=$e,Jr.isBefore=Je,Jr.isBetween=Qe,Jr.isSame=Ke,Jr.isSameOrAfter=tn,Jr.isSameOrBefore=en,Jr.isValid=Sn,Jr.lang=Ur,Jr.locale=dn,Jr.localeData=pn,Jr.max=Wr,Jr.min=Nr,Jr.parsingFlags=Tn,Jr.set=U,Jr.startOf=mn,Jr.subtract=Vr,Jr.toArray=wn,Jr.toObject=xn,Jr.toDate=_n,Jr.toISOString=sn,Jr.inspect=an,Jr.toJSON=bn,Jr.toString=on,Jr.unix=gn,Jr.valueOf=yn,Jr.creationData=Mn,Jr.year=yr,Jr.isLeapYear=gt,Jr.weekYear=On,Jr.isoWeekYear=En,Jr.quarter=Jr.quarters=Rn,Jr.month=ct,Jr.daysInMonth=ft,Jr.week=Jr.weeks=Ot,Jr.isoWeek=Jr.isoWeeks=Et,Jr.weeksInYear=Pn,Jr.isoWeeksInYear=Cn,Jr.date=Hr,Jr.day=Jr.days=Nt,Jr.weekday=Wt,Jr.isoWeekday=zt,Jr.dayOfYear=An,Jr.hour=Jr.hours=kr,Jr.minute=Jr.minutes=Xr,Jr.second=Jr.seconds=Zr,Jr.millisecond=Jr.milliseconds=$r,Jr.utcOffset=Ce,Jr.utc=Le,Jr.local=Ye,Jr.parseZone=Re,Jr.hasAlignedHourOffset=Ae,Jr.isDST=Ie,Jr.isLocal=We,Jr.isUtcOffset=ze,Jr.isUtc=Fe,Jr.isUTC=Fe,Jr.zoneAbbr=Nn,Jr.zoneName=Wn,Jr.dates=T("dates accessor is deprecated. Use date instead.",Hr),Jr.months=T("months accessor is deprecated. Use month instead",ct),Jr.years=T("years accessor is deprecated. Use year instead",yr),Jr.zone=T("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Pe),Jr.isDSTShifted=T("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Ne);var Qr=E.prototype;Qr.calendar=C,Qr.longDateFormat=P,Qr.invalidDate=L,Qr.ordinal=Y,Qr.preparse=jn,Qr.postformat=jn,Qr.relativeTime=R,Qr.pastFuture=A,Qr.set=k,Qr.months=st,Qr.monthsShort=at,Qr.monthsParse=ut,Qr.monthsRegex=pt,Qr.monthsShortRegex=dt,Qr.week=Dt,Qr.firstDayOfYear=kt,Qr.firstDayOfWeek=Mt,Qr.weekdays=Lt,Qr.weekdaysMin=Rt,Qr.weekdaysShort=Yt,Qr.weekdaysParse=It,Qr.weekdaysRegex=Ft,Qr.weekdaysShortRegex=jt,Qr.weekdaysMinRegex=Gt,Qr.isPM=Zt,Qr.meridiem=qt,Kt("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,n=1===x(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+n}}),e.lang=T("moment.lang is deprecated. Use moment.locale instead.",Kt),e.langData=T("moment.langData is deprecated. Use moment.localeData instead.",ne);var Kr=Math.abs,to=si("ms"),eo=si("s"),no=si("m"),io=si("h"),ro=si("d"),oo=si("w"),so=si("M"),ao=si("y"),ho=hi("milliseconds"),uo=hi("seconds"),lo=hi("minutes"),co=hi("hours"),fo=hi("days"),po=hi("months"),mo=hi("years"),vo=Math.round,yo={s:45,m:45,h:22,d:26,M:11},go=Math.abs,_o=Se.prototype;return _o.abs=$n,_o.add=Qn,_o.subtract=Kn,_o.as=ri,_o.asMilliseconds=to,_o.asSeconds=eo,_o.asMinutes=no,_o.asHours=io,_o.asDays=ro,_o.asWeeks=oo,_o.asMonths=so,_o.asYears=ao,_o.valueOf=oi,_o._bubble=ei,_o.get=ai,_o.milliseconds=ho,_o.seconds=uo,_o.minutes=lo,_o.hours=co,_o.days=fo,_o.weeks=ui,_o.months=po,_o.years=mo,_o.humanize=pi,_o.toISOString=mi,_o.toString=mi,_o.toJSON=mi,_o.locale=dn,_o.localeData=pn,_o.toIsoString=T("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",mi),_o.lang=Ur,X("X",0,0,"unix"),X("x",0,0,"valueOf"),Q("x",qi),Q("X",Qi),nt("X",function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))}),nt("x",function(t,e,n){n._d=new Date(x(t))}),e.version="2.17.1",n(_e),e.fn=Jr,e.min=xe,e.max=be,e.now=zr,e.utc=c,e.unix=zn,e.months=Un,e.isDate=a,e.locale=Kt,e.invalid=m,e.duration=je,e.isMoment=_,e.weekdays=Xn,e.parseZone=Fn,e.localeData=ne,e.isDuration=Te,e.monthsShort=Hn,e.weekdaysMin=qn,e.defineLocale=te,e.updateLocale=ee,e.locales=ie,e.weekdaysShort=Zn,e.normalizeUnits=N,e.relativeTimeRounding=fi,e.relativeTimeThreshold=di,e.calendarFormat=Xe,e.prototype=Jr,e})}).call(e,n(86)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e){function n(t){throw new Error("Cannot find module '"+t+"'.")}n.keys=function(){return[]},n.resolve=n,t.exports=n,n.id=87},function(t,e){(function(e){function n(t,e,n){var i=e&&n||0,r=0;for(e=e||[],t.toLowerCase().replace(/[0-9a-f]{2}/g,function(t){r<16&&(e[i+r++]=c[t])});r<16;)e[i+r++]=0;return e}function i(t,e){var n=e||0,i=l;return i[t[n++]]+i[t[n++]]+i[t[n++]]+i[t[n++]]+"-"+i[t[n++]]+i[t[n++]]+"-"+i[t[n++]]+i[t[n++]]+"-"+i[t[n++]]+i[t[n++]]+"-"+i[t[n++]]+i[t[n++]]+i[t[n++]]+i[t[n++]]+i[t[n++]]+i[t[n++]]}function r(t,e,n){var r=e&&n||0,o=e||[];t=t||{};var s=void 0!==t.clockseq?t.clockseq:m,a=void 0!==t.msecs?t.msecs:(new Date).getTime(),h=void 0!==t.nsecs?t.nsecs:y+1,u=a-v+(h-y)/1e4;if(u<0&&void 0===t.clockseq&&(s=s+1&16383),(u<0||a>v)&&void 0===t.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");v=a,y=h,m=s,a+=122192928e5;var l=(1e4*(268435455&a)+h)%4294967296;o[r++]=l>>>24&255,o[r++]=l>>>16&255,o[r++]=l>>>8&255,o[r++]=255&l;var c=a/4294967296*1e4&268435455;o[r++]=c>>>8&255,o[r++]=255&c,o[r++]=c>>>24&15|16,o[r++]=c>>>16&255,o[r++]=s>>>8|128,o[r++]=255&s;for(var f=t.node||p,d=0;d<6;d++)o[r+d]=f[d];return e?e:i(o)}function o(t,e,n){var r=e&&n||0;"string"==typeof t&&(e="binary"==t?new Array(16):null,t=null),t=t||{};var o=t.random||(t.rng||s)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e)for(var a=0;a<16;a++)e[r+a]=o[a];return e||i(o)}var s,a="undefined"!=typeof window?window:"undefined"!=typeof e?e:null;if(a&&a.crypto&&crypto.getRandomValues){var h=new Uint8Array(16);s=function(){return crypto.getRandomValues(h),h}}if(!s){var u=new Array(16);s=function(){for(var t,e=0;e<16;e++)0===(3&e)&&(t=4294967296*Math.random()),u[e]=t>>>((3&e)<<3)&255;return u}}for(var l=[],c={},f=0;f<256;f++)l[f]=(f+256).toString(16).substr(1),c[l[f]]=f;var d=s(),p=[1|d[0],d[1],d[2],d[3],d[4],d[5]],m=16383&(d[6]<<8|d[7]),v=0,y=0,g=o;g.v1=r,g.v4=o,g.parse=n,g.unparse=i,t.exports=g}).call(e,function(){return this}())},function(t,e){e.prepareElements=function(t){for(var e in t)t.hasOwnProperty(e)&&(t[e].redundant=t[e].used,t[e].used=[])},e.cleanupElements=function(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e].redundant){for(var n=0;n0?(i=e[t].redundant[0],e[t].redundant.shift()):(i=document.createElementNS("http://www.w3.org/2000/svg",t),n.appendChild(i)):(i=document.createElementNS("http://www.w3.org/2000/svg",t),e[t]={used:[],redundant:[]},n.appendChild(i)),e[t].used.push(i),i},e.getDOMElement=function(t,e,n,i){var r;return e.hasOwnProperty(t)?e[t].redundant.length>0?(r=e[t].redundant[0],e[t].redundant.shift()):(r=document.createElement(t),void 0!==i?n.insertBefore(r,i):n.appendChild(r)):(r=document.createElement(t),e[t]={used:[],redundant:[]},void 0!==i?n.insertBefore(r,i):n.appendChild(r)),e[t].used.push(r),r},e.drawPoint=function(t,n,i,r,o,s){var a;if("circle"==i.style?(a=e.getSVGElement("circle",r,o),a.setAttributeNS(null,"cx",t),a.setAttributeNS(null,"cy",n),a.setAttributeNS(null,"r",.5*i.size)):(a=e.getSVGElement("rect",r,o),a.setAttributeNS(null,"x",t-.5*i.size),a.setAttributeNS(null,"y",n-.5*i.size),a.setAttributeNS(null,"width",i.size),a.setAttributeNS(null,"height",i.size)),void 0!==i.styles&&a.setAttributeNS(null,"style",i.styles),a.setAttributeNS(null,"class",i.className+" vis-point"),s){var h=e.getSVGElement("text",r,o);s.xOffset&&(t+=s.xOffset),s.yOffset&&(n+=s.yOffset),s.content&&(h.textContent=s.content),s.className&&h.setAttributeNS(null,"class",s.className+" vis-label"),h.setAttributeNS(null,"x",t),h.setAttributeNS(null,"y",n)}return a},e.drawBar=function(t,n,i,r,o,s,a,h){if(0!=r){r<0&&(r*=-1,n-=r);var u=e.getSVGElement("rect",s,a);u.setAttributeNS(null,"x",t-.5*i),u.setAttributeNS(null,"y",n),u.setAttributeNS(null,"width",i),u.setAttributeNS(null,"height",r),u.setAttributeNS(null,"class",o),h&&u.setAttributeNS(null,"style",h)}}},function(t,e,n){function i(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(t&&!Array.isArray(t)&&(e=t,t=null),this._options=e||{},this._data={},this.length=0,this._fieldId=this._options.fieldId||"id",this._type={},this._options.type)for(var n=(0,l.default)(this._options.type),i=0,r=n.length;ir?1:is)&&(o=h,s=u)}return o},r.prototype.min=function(t){var e,n,i=this._data,r=(0,l.default)(i),o=null,s=null;for(e=0,n=r.length;ethis.max&&this.flush(),clearTimeout(this._timeout),this.queue.length>0&&"number"==typeof this.delay){var t=this;this._timeout=setTimeout(function(){t.flush()},this.delay)}},n.prototype.flush=function(){for(;this._queue.length>0;){var t=this._queue.shift();t.fn.apply(t.context||t.fn,t.args||[])}},t.exports=n},function(t,e,n){function i(t){return t&&t.__esModule?t:{default:t}}function r(t,e){this._data=null,this._ids={},this.length=0,this._options=e||{},this._fieldId="id",this._subscribers={};var n=this;this.listener=function(){n._onEvent.apply(n,arguments)},this.setData(t)}var o=n(58),s=i(o),a=n(1),h=n(90);r.prototype.setData=function(t){var e,n,i,r,o;if(this._data){for(this._data.off&&this._data.off("*",this.listener),e=this._data.getIds({filter:this._options&&this._options.filter}),o=[],i=0,r=e.length;i0&&(h[r-1].pointNext=s),h.push(s);return h},i.prototype.create=function(){for(;this.containerElement.hasChildNodes();)this.containerElement.removeChild(this.containerElement.firstChild);this.frame=document.createElement("div"),this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas);var t=document.createElement("DIV");t.style.color="red",t.style.fontWeight="bold",t.style.padding="10px",t.innerHTML="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(t),this.frame.filter=document.createElement("div"),this.frame.filter.style.position="absolute",this.frame.filter.style.bottom="0px",this.frame.filter.style.left="0px",this.frame.filter.style.width="100%",this.frame.appendChild(this.frame.filter);var e=this,n=function(t){e._onMouseDown(t)},i=function(t){e._onTouchStart(t)},r=function(t){e._onWheel(t)},o=function(t){e._onTooltip(t)},s=function(t){e._onClick(t)};u.addEventListener(this.frame.canvas,"keydown",onkeydown),u.addEventListener(this.frame.canvas,"mousedown",n),u.addEventListener(this.frame.canvas,"touchstart",i),u.addEventListener(this.frame.canvas,"mousewheel",r),u.addEventListener(this.frame.canvas,"mousemove",o),u.addEventListener(this.frame.canvas,"click",s),this.containerElement.appendChild(this.frame)},i.prototype._setSize=function(t,e){this.frame.style.width=t,this.frame.style.height=e,this._resizeCanvas()},i.prototype._resizeCanvas=function(){this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=this.frame.canvas.clientWidth,this.frame.canvas.height=this.frame.canvas.clientHeight,this.frame.filter.style.width=this.frame.canvas.clientWidth-20+"px"},i.prototype.animationStart=function(){if(!this.frame.filter||!this.frame.filter.slider)throw new Error("No animation available");this.frame.filter.slider.play()},i.prototype.animationStop=function(){this.frame.filter&&this.frame.filter.slider&&this.frame.filter.slider.stop()},i.prototype._resizeCenter=function(){"%"===this.xCenter.charAt(this.xCenter.length-1)?this.currentXCenter=parseFloat(this.xCenter)/100*this.frame.canvas.clientWidth:this.currentXCenter=parseFloat(this.xCenter),"%"===this.yCenter.charAt(this.yCenter.length-1)?this.currentYCenter=parseFloat(this.yCenter)/100*(this.frame.canvas.clientHeight-this.frame.filter.clientHeight):this.currentYCenter=parseFloat(this.yCenter)},i.prototype.getCameraPosition=function(){var t=this.camera.getArmRotation();return t.distance=this.camera.getArmLength(),t},i.prototype._readData=function(t){this._dataInitialize(t,this.style),this.dataFilter?this.dataPoints=this.dataFilter._getDataPoints():this.dataPoints=this._getDataPoints(this.dataTable),this._redrawFilter()},i.prototype.setData=function(t){this._readData(t),this.redraw(),this.animationAutoStart&&this.dataFilter&&this.animationStart()},i.prototype.setOptions=function(t){this.animationStop(),v.setOptions(t,this),this.setPointDrawingMethod(),this._setSize(this.width,this.height),this.dataTable&&this.setData(this.dataTable),this.animationAutoStart&&this.dataFilter&&this.animationStart()},i.prototype.setPointDrawingMethod=function(){var t=void 0;switch(this.style){case i.STYLE.BAR:t=i.prototype._redrawBarGraphPoint;break;case i.STYLE.BARCOLOR:t=i.prototype._redrawBarColorGraphPoint;break;case i.STYLE.BARSIZE:t=i.prototype._redrawBarSizeGraphPoint;break;case i.STYLE.DOT:t=i.prototype._redrawDotGraphPoint;break;case i.STYLE.DOTLINE:t=i.prototype._redrawDotLineGraphPoint;break;case i.STYLE.DOTCOLOR:t=i.prototype._redrawDotColorGraphPoint;break;case i.STYLE.DOTSIZE:t=i.prototype._redrawDotSizeGraphPoint;break;case i.STYLE.SURFACE:t=i.prototype._redrawSurfaceGraphPoint;break;case i.STYLE.GRID:t=i.prototype._redrawGridGraphPoint;break;case i.STYLE.LINE:t=i.prototype._redrawLineGraphPoint;break;default:throw new Error("Can not determine point drawing method for graph style '"+this.style+"'")}this._pointDrawingMethod=t},i.prototype.redraw=function(){if(void 0===this.dataPoints)throw new Error("Graph data not initialized");this._resizeCanvas(),this._resizeCenter(),this._redrawSlider(),this._redrawClear(),this._redrawAxis(),this._redrawDataGraph(),this._redrawInfo(),this._redrawLegend()},i.prototype._getContext=function(){var t=this.frame.canvas,e=t.getContext("2d");return e.lineJoin="round",e.lineCap="round",e},i.prototype._redrawClear=function(){var t=this.frame.canvas,e=t.getContext("2d");e.clearRect(0,0,t.width,t.height)},i.prototype._dotSize=function(){return this.frame.clientWidth*this.dotSizeRatio},i.prototype._getLegendWidth=function(){var t;if(this.style===i.STYLE.DOTSIZE){var e=this._dotSize();t=e/2+2*e}else t=this.style===i.STYLE.BARSIZE?this.xBarWidth:20;return t},i.prototype._redrawLegend=function(){if(this.showLegend===!0&&this.style!==i.STYLE.LINE&&this.style!==i.STYLE.BARSIZE){var t=this.style===i.STYLE.BARSIZE||this.style===i.STYLE.DOTSIZE,e=this.style===i.STYLE.DOTSIZE||this.style===i.STYLE.DOTCOLOR||this.style===i.STYLE.BARCOLOR,n=Math.max(.25*this.frame.clientHeight,100),r=this.margin,o=this._getLegendWidth(),s=this.frame.clientWidth-this.margin,a=s-o,h=r+n,u=this._getContext();if(u.lineWidth=1,u.font="14px arial",t===!1){var l,f=0,d=n;for(l=f;l0?(t.textAlign="center",t.textBaseline="top",o.y+=r):Math.sin(2*i)<0?(t.textAlign="right",t.textBaseline="middle"):(t.textAlign="left",t.textBaseline="middle"),t.fillStyle=this.axisColor,t.fillText(n,o.x,o.y)},i.prototype.drawAxisLabelY=function(t,e,n,i,r){void 0===r&&(r=0);var o=this._convert3Dto2D(e);Math.cos(2*i)<0?(t.textAlign="center",t.textBaseline="top",o.y+=r):Math.sin(2*i)>0?(t.textAlign="right",t.textBaseline="middle"):(t.textAlign="left",t.textBaseline="middle"),t.fillStyle=this.axisColor,t.fillText(n,o.x,o.y)},i.prototype.drawAxisLabelZ=function(t,e,n,i){void 0===i&&(i=0);var r=this._convert3Dto2D(e);t.textAlign="right",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(n,r.x-i,r.y)},i.prototype._line3d=function(t,e,n,i){var r=this._convert3Dto2D(e),o=this._convert3Dto2D(n);this._line(t,r,o,i)},i.prototype._redrawAxis=function(){var t,e,n,i,r,o,s,a,h,u,f,d=this._getContext();d.font=24/this.camera.getArmLength()+"px arial";var m=.025/this.scale.x,v=.025/this.scale.y,y=5/this.camera.getArmLength(),g=this.camera.getArmRotation().horizontal,_=new c(Math.cos(g),Math.sin(g)),w=this.xRange,x=this.yRange,b=this.zRange;for(d.lineWidth=1,i=void 0===this.defaultXStep,n=new p(w.min,w.max,this.xStep,i),n.start(!0);!n.end();){var S=n.getCurrent();this.showGrid?(t=new l(S,x.min,b.min),e=new l(S,x.max,b.min),this._line3d(d,t,e,this.gridColor)):(t=new l(S,x.min,b.min),e=new l(S,x.min+m,b.min),this._line3d(d,t,e,this.axisColor),t=new l(S,x.max,b.min),e=new l(S,x.max-m,b.min),this._line3d(d,t,e,this.axisColor)),s=_.x>0?x.min:x.max;var T=new l(S,s,b.min),D=" "+this.xValueLabel(S)+" ";this.drawAxisLabelX(d,T,D,g,y),n.next()}for(d.lineWidth=1,i=void 0===this.defaultYStep,n=new p(x.min,x.max,this.yStep,i),n.start(!0);!n.end();){var M=n.getCurrent();this.showGrid?(t=new l(w.min,M,b.min),e=new l(w.max,M,b.min),this._line3d(d,t,e,this.gridColor)):(t=new l(w.min,M,b.min),e=new l(w.min+v,M,b.min),this._line3d(d,t,e,this.axisColor),t=new l(w.max,M,b.min),e=new l(w.max-v,M,b.min),this._line3d(d,t,e,this.axisColor)),o=_.y>0?w.min:w.max,T=new l(o,M,b.min);var D=" "+this.yValueLabel(M)+" ";this.drawAxisLabelY(d,T,D,g,y),n.next()}for(d.lineWidth=1,i=void 0===this.defaultZStep,n=new p(b.min,b.max,this.zStep,i),n.start(!0),o=_.x>0?w.min:w.max,s=_.y<0?x.min:x.max;!n.end();){var k=n.getCurrent(),O=new l(o,s,k),E=this._convert3Dto2D(O);e=new c(E.x-y,E.y),this._line(d,E,e,this.axisColor);var D=this.zValueLabel(k)+" ";this.drawAxisLabelZ(d,O,D,5),n.next()}d.lineWidth=1,t=new l(o,s,b.min),e=new l(o,s,b.max),this._line3d(d,t,e,this.axisColor);var C,P;d.lineWidth=1,C=new l(w.min,x.min,b.min),P=new l(w.max,x.min,b.min),this._line3d(d,C,P,this.axisColor),C=new l(w.min,x.max,b.min),P=new l(w.max,x.max,b.min),this._line3d(d,C,P,this.axisColor),d.lineWidth=1,t=new l(w.min,x.min,b.min),e=new l(w.min,x.max,b.min),this._line3d(d,t,e,this.axisColor),t=new l(w.max,x.min,b.min),e=new l(w.max,x.max,b.min),this._line3d(d,t,e,this.axisColor);var L=this.xLabel;L.length>0&&(f=.1/this.scale.y,o=(w.max+3*w.min)/4,s=_.x>0?x.min-f:x.max+f,r=new l(o,s,b.min),this.drawAxisLabelX(d,r,L,g));var Y=this.yLabel;Y.length>0&&(u=.1/this.scale.x,o=_.y>0?w.min-u:w.max+u,s=(x.max+3*x.min)/4,r=new l(o,s,b.min),this.drawAxisLabelY(d,r,Y,g));var R=this.zLabel;R.length>0&&(h=30,o=_.x>0?w.min:w.max,s=_.y<0?x.min:x.max,a=(b.max+3*b.min)/4,r=new l(o,s,a),this.drawAxisLabelZ(d,r,R,h))},i.prototype._hsv2rgb=function(t,e,n){var i,r,o,s,a,h;switch(s=n*e,a=Math.floor(t/60),h=s*(1-Math.abs(t/60%2-1)),a){case 0:i=s,r=h,o=0;break;case 1:i=h,r=s,o=0;break;case 2:i=0,r=s,o=h;break;case 3:i=0,r=h,o=s;break;case 4:i=h,r=0,o=s;break;case 5:i=s,r=0,o=h;break;default:i=0,r=0,o=0}return"RGB("+parseInt(255*i)+","+parseInt(255*r)+","+parseInt(255*o)+")"},i.prototype._getStrokeWidth=function(t){return void 0!==t?this.showPerspective?1/-t.trans.z*this.dataColor.strokeWidth:-(this.eye.z/this.camera.getArmLength())*this.dataColor.strokeWidth:this.dataColor.strokeWidth},i.prototype._redrawBar=function(t,e,n,i,r,o){var s,a,h=this,u=e.point,c=this.zRange.min,f=[{point:new l(u.x-n,u.y-i,u.z)},{point:new l(u.x+n,u.y-i,u.z)},{point:new l(u.x+n,u.y+i,u.z)},{point:new l(u.x-n,u.y+i,u.z)}],d=[{point:new l(u.x-n,u.y-i,c)},{point:new l(u.x+n,u.y-i,c)},{point:new l(u.x+n,u.y+i,c)},{point:new l(u.x-n,u.y+i,c)}];f.forEach(function(t){t.screen=h._convert3Dto2D(t.point)}),d.forEach(function(t){t.screen=h._convert3Dto2D(t.point)});var p=[{corners:f,center:l.avg(d[0].point,d[2].point)},{corners:[f[0],f[1],d[1],d[0]],center:l.avg(d[1].point,d[0].point)},{corners:[f[1],f[2],d[2],d[1]],center:l.avg(d[2].point,d[1].point)},{corners:[f[2],f[3],d[3],d[2]],center:l.avg(d[3].point,d[2].point)},{corners:[f[3],f[0],d[0],d[3]],center:l.avg(d[0].point,d[3].point)}];for(e.surfaces=p,s=0;s0}if(a){var d,p=(e.point.z+n.point.z+i.point.z+r.point.z)/4,m=240*(1-(p-this.zRange.min)*this.scale.z/this.verticalRatio),v=1;this.showShadow?(d=Math.min(1+c.x/f/2,1),o=this._hsv2rgb(m,v,d),s=o):(d=1,o=this._hsv2rgb(m,v,d),s=this.axisColor)}else o="gray",s=this.axisColor;t.lineWidth=this._getStrokeWidth(e);var y=[e,n,r,i];this._polygon(t,y,o,s)}},i.prototype._drawGridLine=function(t,e,n){if(void 0!==e&&void 0!==n){var i=(e.point.z+n.point.z)/2,r=240*(1-(i-this.zRange.min)*this.scale.z/this.verticalRatio);t.lineWidth=2*this._getStrokeWidth(e),t.strokeStyle=this._hsv2rgb(r,1,1),this._line(t,e.screen,n.screen)}},i.prototype._redrawGridGraphPoint=function(t,e){this._drawGridLine(t,e,e.pointRight),this._drawGridLine(t,e,e.pointTop)},i.prototype._redrawLineGraphPoint=function(t,e){void 0!==e.pointNext&&(t.lineWidth=this._getStrokeWidth(e),t.strokeStyle=this.dataColor.stroke,this._line(t,e.screen,e.pointNext.screen))},i.prototype._redrawDataGraph=function(){var t,e=this._getContext();if(!(void 0===this.dataPoints||this.dataPoints.length<=0))for(this._calcTranslations(this.dataPoints),t=0;t0?1:t<0?-1:0}var i=e[0],r=e[1],o=e[2],s=n((r.x-i.x)*(t.y-i.y)-(r.y-i.y)*(t.x-i.x)),a=n((o.x-r.x)*(t.y-r.y)-(o.y-r.y)*(t.x-r.x)),h=n((i.x-o.x)*(t.y-o.y)-(i.y-o.y)*(t.x-o.x));return!(0!=s&&0!=a&&s!=a||0!=a&&0!=h&&a!=h||0!=s&&0!=h&&s!=h)},i.prototype._dataPointFromXY=function(t,e){var n,r=100,o=null,s=null,a=null,h=new c(t,e);if(this.style===i.STYLE.BAR||this.style===i.STYLE.BARCOLOR||this.style===i.STYLE.BARSIZE)for(n=this.dataPoints.length-1;n>=0;n--){o=this.dataPoints[n];var u=o.surfaces;if(u)for(var l=u.length-1;l>=0;l--){var f=u[l],d=f.corners,p=[d[0].screen,d[1].screen,d[2].screen],m=[d[2].screen,d[3].screen,d[0].screen];if(this._insideTriangle(h,p)||this._insideTriangle(h,m))return o}}else for(n=0;n"+this.xLabel+":"+t.point.x+""+this.yLabel+":"+t.point.y+""+this.zLabel+":"+t.point.z+"",e.style.left="0",e.style.top="0",this.frame.appendChild(e),this.frame.appendChild(n),this.frame.appendChild(i);var r=e.offsetWidth,o=e.offsetHeight,s=n.offsetHeight,a=i.offsetWidth,h=i.offsetHeight,u=t.screen.x-r/2;u=Math.min(Math.max(u,10),this.frame.clientWidth-10-r),n.style.left=t.screen.x+"px",n.style.top=t.screen.y-s+"px",e.style.left=u+"px",e.style.top=t.screen.y-s-o+"px",i.style.left=t.screen.x-a/2+"px",i.style.top=t.screen.y-h/2+"px"},i.prototype._hideTooltip=function(){if(this.tooltip){this.tooltip.dataPoint=null;for(var t in this.tooltip.dom)if(this.tooltip.dom.hasOwnProperty(t)){var e=this.tooltip.dom[t];e&&e.parentNode&&e.parentNode.removeChild(e)}}},i.prototype.setCameraPosition=function(t){v.setCameraPosition(t,this),this.redraw()},i.prototype.setSize=function(t,e){this._setSize(t,e),this.redraw()},t.exports=i},function(t,e){function n(t){if(t)return i(t)}function i(t){for(var e in n.prototype)t[e]=n.prototype[e];return t}t.exports=n,n.prototype.on=n.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks[t]=this._callbacks[t]||[]).push(e),this},n.prototype.once=function(t,e){function n(){i.off(t,n),e.apply(this,arguments)}var i=this;return this._callbacks=this._callbacks||{},n.fn=e,this.on(t,n),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n=this._callbacks[t];if(!n)return this;if(1==arguments.length)return delete this._callbacks[t],this;for(var i,r=0;ro&&(t=i(t)*o),n(e)>o&&(e=i(e)*o),this.cameraOffset.x=t,this.cameraOffset.y=e,this.calculateCameraOrientation()},r.prototype.getOffset=function(t,e){return this.cameraOffset},r.prototype.setArmLocation=function(t,e,n){this.armLocation.x=t,this.armLocation.y=e,this.armLocation.z=n,this.calculateCameraOrientation()},r.prototype.setArmRotation=function(t,e){void 0!==t&&(this.armRotation.horizontal=t),void 0!==e&&(this.armRotation.vertical=e,this.armRotation.vertical<0&&(this.armRotation.vertical=0),this.armRotation.vertical>.5*Math.PI&&(this.armRotation.vertical=.5*Math.PI)),void 0===t&&void 0===e||this.calculateCameraOrientation()},r.prototype.getArmRotation=function(){var t={};return t.horizontal=this.armRotation.horizontal,t.vertical=this.armRotation.vertical,t},r.prototype.setArmLength=function(t){void 0!==t&&(this.armLength=t,this.armLength<.71&&(this.armLength=.71),this.armLength>5&&(this.armLength=5),this.setOffset(this.cameraOffset.x,this.cameraOffset.y),this.calculateCameraOrientation())},r.prototype.getArmLength=function(){return this.armLength},r.prototype.getCameraLocation=function(){return this.cameraLocation},r.prototype.getCameraRotation=function(){return this.cameraRotation},r.prototype.calculateCameraOrientation=function(){this.cameraLocation.x=this.armLocation.x-this.armLength*Math.sin(this.armRotation.horizontal)*Math.cos(this.armRotation.vertical),this.cameraLocation.y=this.armLocation.y-this.armLength*Math.cos(this.armRotation.horizontal)*Math.cos(this.armRotation.vertical),this.cameraLocation.z=this.armLocation.z+this.armLength*Math.sin(this.armRotation.vertical),this.cameraRotation.x=Math.PI/2-this.armRotation.vertical,this.cameraRotation.y=0,this.cameraRotation.z=-this.armRotation.horizontal;var t=this.cameraRotation.x,e=(this.cameraRotation.y,this.cameraRotation.z),n=this.cameraOffset.x,i=this.cameraOffset.y,r=Math.sin,o=Math.cos;this.cameraLocation.x=this.cameraLocation.x+n*o(e)+i*-r(e)*o(t),this.cameraLocation.y=this.cameraLocation.y+n*r(e)+i*o(e)*o(t),this.cameraLocation.z=this.cameraLocation.z+i*r(t)},t.exports=r},function(t,e,n){t.exports={default:n(99),__esModule:!0}},function(t,e,n){n(100),t.exports=n(17).Math.sign},function(t,e,n){var i=n(15);i(i.S,"Math",{sign:n(101)})},function(t,e){t.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},function(t,e,n){function i(t,e,n){this.data=t,this.column=e,this.graph=n,this.index=void 0,this.value=void 0,this.values=n.getDistinctValues(t.get(),this.column),this.values.sort(function(t,e){return t>e?1:t0&&this.selectValue(0),this.dataPoints=[],this.loaded=!1,this.onLoadCallback=void 0,n.animationPreload?(this.loaded=!1,this.loadInBackground()):this.loaded=!0}var r=n(92);i.prototype.isLoaded=function(){return this.loaded},i.prototype.getLoadedProgress=function(){for(var t=this.values.length,e=0;this.dataPoints[e];)e++;return Math.round(e/t*100)},i.prototype.getLabel=function(){return this.graph.filterLabel},i.prototype.getColumn=function(){return this.column},i.prototype.getSelectedValue=function(){if(void 0!==this.index)return this.values[this.index]},i.prototype.getValues=function(){return this.values},i.prototype.getValue=function(t){if(t>=this.values.length)throw new Error("Index out of range");return this.values[t]},i.prototype._getDataPoints=function(t){if(void 0===t&&(t=this.index),void 0===t)return[];var e;if(this.dataPoints[t])e=this.dataPoints[t];else{var n={};n.column=this.column,n.value=this.values[t];var i=new r(this.data,{filter:function(t){return t[n.column]==n.value}}).get();e=this.graph._getDataPoints(i),this.dataPoints[t]=e}return e},i.prototype.setOnLoadCallback=function(t){this.onLoadCallback=t},i.prototype.selectValue=function(t){if(t>=this.values.length)throw new Error("Index out of range");this.index=t,this.value=this.values[t]},i.prototype.loadInBackground=function(t){void 0===t&&(t=0);var e=this.graph.frame;if(t0&&(t--,this.setIndex(t))},i.prototype.next=function(){var t=this.getIndex();t0?this.setIndex(0):this.index=void 0},i.prototype.setIndex=function(t){if(!(tthis.values.length-1&&(i=this.values.length-1),i},i.prototype.indexToLeft=function(t){var e=parseFloat(this.frame.bar.style.width)-this.frame.slide.clientWidth-10,n=t/(this.values.length-1)*e,i=n+3;return i},i.prototype._onMouseMove=function(t){var e=t.clientX-this.startClientX,n=this.startSlideX+e,i=this.leftToIndex(n);this.setIndex(i),r.preventDefault()},i.prototype._onMouseUp=function(t){this.frame.style.cursor="auto",r.removeEventListener(document,"mousemove",this.onmousemove),r.removeEventListener(document,"mouseup",this.onmouseup),r.preventDefault()},t.exports=i},function(t,e){function n(t,e,n,i){this._start=0,this._end=0,this._step=1,this.prettyStep=!0,this.precision=5,this._current=0,this.setRange(t,e,n,i)}n.prototype.isNumeric=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},n.prototype.setRange=function(t,e,n,i){if(!this.isNumeric(t))throw new Error("Parameter 'start' is not numeric; value: "+t);if(!this.isNumeric(e))throw new Error("Parameter 'end' is not numeric; value: "+t);if(!this.isNumeric(n))throw new Error("Parameter 'step' is not numeric; value: "+t);this._start=t?t:0,this._end=e?e:0,this.setStep(n,i)},n.prototype.setStep=function(t,e){void 0===t||t<=0||(void 0!==e&&(this.prettyStep=e),this.prettyStep===!0?this._step=n.calculatePrettyStep(t):this._step=t)},n.calculatePrettyStep=function(t){var e=function(t){return Math.log(t)/Math.LN10},n=Math.pow(10,Math.round(e(t))),i=2*Math.pow(10,Math.round(e(t/2))),r=5*Math.pow(10,Math.round(e(t/5))),o=n;return Math.abs(i-t)<=Math.abs(o-t)&&(o=i),Math.abs(r-t)<=Math.abs(o-t)&&(o=r),o<=0&&(o=1),o},n.prototype.getCurrent=function(){return parseFloat(this._current.toPrecision(this.precision))},n.prototype.getStep=function(){return this._step},n.prototype.start=function(t){void 0===t&&(t=!1),this._current=this._start-this._start%this._step,t&&this.getCurrent()this._end},t.exports=n},function(t,e){function n(){this.min=void 0,this.max=void 0}n.prototype.adjust=function(t){void 0!==t&&((void 0===this.min||this.min>t)&&(this.min=t),(void 0===this.max||this.maxn)throw new Error("Passed expansion value makes range invalid");this.min=e,this.max=n}},n.prototype.range=function(){return this.max-this.min},n.prototype.center=function(){return(this.min+this.max)/2},t.exports=n},function(t,e,n){function i(t){return t&&t.__esModule?t:{default:t}}function r(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}function o(t){return void 0===t||""===t||"string"!=typeof t?t:t.charAt(0).toUpperCase()+t.slice(1)}function s(t,e){return void 0===t||""===t?e:t+o(e)}function a(t,e,n,i){var r,o;for(var a in n)r=n[a],o=s(i,r),e[o]=t[r]}function h(t,e,n,i){var r,o;for(var a in n)r=n[a],void 0!==t[r]&&(o=s(i,r),e[o]=t[r])}function u(t,e){if(void 0===t||r(t))throw new Error("No DEFAULTS passed");if(void 0===e)throw new Error("No dst passed");k=t,a(t,e,D),a(t,e,M,"default"),c(t,e),e.margin=10,e.showGrayBottom=!1,e.showTooltip=!1,e.onclick_callback=null,e.eye=new b(0,0,-1)}function l(t,e){if(void 0!==t){if(void 0===e)throw new Error("No dst passed");if(void 0===k||r(k))throw new Error("DEFAULTS not set for module Settings");h(t,e,D),h(t,e,M,"default"),c(t,e)}}function c(t,e){void 0!==t.backgroundColor&&v(t.backgroundColor,e),y(t.dataColor,e),m(t.style,e),f(t.showLegend,e),g(t.cameraPosition,e),void 0!==t.tooltip&&(e.showTooltip=t.tooltip),void 0!=t.onclick&&(e.onclick_callback=t.onclick)}function f(t,e){if(void 0===t){var n=void 0===k.showLegend;if(n){var i=e.style===S.DOTCOLOR||e.style===S.DOTSIZE;e.showLegend=i}}else e.showLegend=t}function d(t){var e=T[t];return void 0===e?-1:e}function p(t){var e=!1;for(var n in S)if(S[n]===t){e=!0;break}return e}function m(t,e){if(void 0!==t){var n;if("string"==typeof t){if(n=d(t),n===-1)throw new Error("Style '"+t+"' is invalid")}else{if(!p(t))throw new Error("Style '"+t+"' is invalid");n=t}e.style=n}}function v(t,e){var n="white",i="gray",r=1;if("string"==typeof t)n=t,i="none",r=0;else{if("object"!==("undefined"==typeof t?"undefined":(0,w.default)(t)))throw new Error("Unsupported type of backgroundColor");void 0!==t.fill&&(n=t.fill),void 0!==t.stroke&&(i=t.stroke),void 0!==t.strokeWidth&&(r=t.strokeWidth)}e.frame.style.backgroundColor=n,e.frame.style.borderColor=i,e.frame.style.borderWidth=r+"px",e.frame.style.borderStyle="solid"}function y(t,e){void 0!==t&&(void 0===e.dataColor&&(e.dataColor={}),"string"==typeof t?(e.dataColor.fill=t,e.dataColor.stroke=t):(t.fill&&(e.dataColor.fill=t.fill),t.stroke&&(e.dataColor.stroke=t.stroke),void 0!==t.strokeWidth&&(e.dataColor.strokeWidth=t.strokeWidth)))}function g(t,e){var n=t;void 0!==n&&(void 0===e.camera&&(e.camera=new x),e.camera.setArmRotation(n.horizontal,n.vertical),e.camera.setArmLength(n.distance))}var _=n(62),w=i(_),x=n(97),b=n(95),S={BAR:0,BARCOLOR:1,BARSIZE:2,DOT:3,DOTLINE:4,DOTCOLOR:5,DOTSIZE:6,GRID:7,LINE:8,SURFACE:9},T={dot:S.DOT,"dot-line":S.DOTLINE,"dot-color":S.DOTCOLOR,"dot-size":S.DOTSIZE,line:S.LINE,grid:S.GRID,surface:S.SURFACE,bar:S.BAR,"bar-color":S.BARCOLOR,"bar-size":S.BARSIZE},D=["width","height","filterLabel","legendLabel","xLabel","yLabel","zLabel","xValueLabel","yValueLabel","zValueLabel","showGrid","showPerspective","showShadow","keepAspectRatio","verticalRatio","dotSizeRatio","showAnimationControls","animationInterval","animationPreload","animationAutoStart","axisColor","gridColor","xCenter","yCenter"],M=["xBarWidth","yBarWidth","valueMin","valueMax","xMin","xMax","xStep","yMin","yMax","yStep","zMin","zMax","zStep"],k=void 0;t.exports.STYLE=S,t.exports.setDefaults=u,t.exports.setOptions=l,t.exports.setCameraPosition=g},function(t,e,n){if("undefined"!=typeof window){var i=n(108),r=window.Hammer||n(109);t.exports=i(r,{preventDefault:"mouse"})}else t.exports=function(){throw Error("hammer.js is only available in a browser, not in node.js.")}},function(t,e,n){var i,r,o;!function(n){r=[],i=n,o="function"==typeof i?i.apply(e,r):i,!(void 0!==o&&(t.exports=o))}(function(){var t=null;return function e(n,i){function r(t){return t.match(/[^ ]+/g)}function o(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 n=!1;e.stopPropagation=function(){n=!0};var i=e.srcEvent.stopPropagation.bind(e.srcEvent);"function"==typeof i&&(e.srcEvent.stopPropagation=function(){i(),e.stopPropagation()}),e.firstTarget=t;for(var r=t;r&&!n;){var o=r.hammer;if(o)for(var s,a=0;a0?u._handlers[t]=i:(n.off(t,o),delete u._handlers[t]))}),u},u.emit=function(e,i){t=i.target,n.emit(e,i)},u.destroy=function(){var t=n.element.hammer,e=t.indexOf(u);e!==-1&&t.splice(e,1),t.length||delete n.element.hammer,u._handlers={},n.destroy()},u}})},function(t,e,n){var i;/*! Hammer.JS - v2.0.7 - 2016-04-22 * http://hammerjs.github.io/ * * Copyright (c) 2016 Jorik Tangelder; * Licensed under the MIT license */ -!function(r,o,s,a){function h(t,e,i){return setTimeout(f(t,i),e)}function l(t,e,i){return!!Array.isArray(t)&&(u(t,i[e],i),!0)}function u(t,e,i){var n;if(t)if(t.forEach)t.forEach(e,i);else if(t.length!==a)for(n=0;n\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=r.console&&(r.console.warn||r.console.log);return o&&o.call(r.console,n,i),t.apply(this,arguments)}}function c(t,e,i){var n,r=e.prototype;n=t.prototype=Object.create(r),n.constructor=t,n._super=r,i&&mt(n,i)}function f(t,e){return function(){return t.apply(e,arguments)}}function p(t,e){return typeof t==gt?t.apply(e?e[0]||a:a,e):t}function m(t,e){return t===a?e:t}function v(t,e,i){u(w(e),function(e){t.addEventListener(e,i,!1)})}function y(t,e,i){u(w(e),function(e){t.removeEventListener(e,i,!1)})}function g(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function _(t,e){return t.indexOf(e)>-1}function w(t){return t.trim().split(/\s+/g)}function x(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var n=0;ni[e]}):n.sort()),n}function T(t,e){for(var i,n,r=e[0].toUpperCase()+e.slice(1),o=0;o1&&!i.firstMultiple?i.firstMultiple=R(e):1===r&&(i.firstMultiple=!1);var o=i.firstInput,s=i.firstMultiple,a=s?s.center:o.center,h=e.center=Y(n);e.timeStamp=xt(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=z(a,h),e.distance=W(a,h),P(i,e),e.offsetDirection=I(e.deltaX,e.deltaY);var l=A(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=l.x,e.overallVelocityY=l.y,e.overallVelocity=wt(l.x)>wt(l.y)?l.x:l.y,e.scale=s?F(s.pointers,n):1,e.rotation=s?N(s.pointers,n):0,e.maxPointers=i.prevInput?e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers:e.pointers.length,L(i,e);var u=t.element;g(e.srcEvent.target,u)&&(u=e.srcEvent.target),e.target=u}function P(t,e){var i=e.center,n=t.offsetDelta||{},r=t.prevDelta||{},o=t.prevInput||{};e.eventType!==Yt&&o.eventType!==It||(r=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},n=t.offsetDelta={x:i.x,y:i.y}),e.deltaX=r.x+(i.x-n.x),e.deltaY=r.y+(i.y-n.y)}function L(t,e){var i,n,r,o,s=t.lastInterval||e,h=e.timeStamp-s.timeStamp;if(e.eventType!=Wt&&(h>Rt||s.velocity===a)){var l=e.deltaX-s.deltaX,u=e.deltaY-s.deltaY,d=A(h,l,u);n=d.x,r=d.y,i=wt(d.x)>wt(d.y)?d.x:d.y,o=I(l,u),t.lastInterval=e}else i=s.velocity,n=s.velocityX,r=s.velocityY,o=s.direction;e.velocity=i,e.velocityX=n,e.velocityY=r,e.direction=o}function R(t){for(var e=[],i=0;i=wt(e)?t<0?Nt:Ft:e<0?Gt:jt}function W(t,e,i){i||(i=Ht);var n=e[i[0]]-t[i[0]],r=e[i[1]]-t[i[1]];return Math.sqrt(n*n+r*r)}function z(t,e,i){i||(i=Ht);var n=e[i[0]]-t[i[0]],r=e[i[1]]-t[i[1]];return 180*Math.atan2(r,n)/Math.PI}function N(t,e){return z(e[1],e[0],Xt)+z(t[1],t[0],Xt)}function F(t,e){return W(e[0],e[1],Xt)/W(t[0],t[1],Xt)}function G(){this.evEl=qt,this.evWin=Qt,this.pressed=!1,M.apply(this,arguments)}function j(){this.evEl=Kt,this.evWin=te,M.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function V(){this.evTarget=ie,this.evWin=ne,this.started=!1,M.apply(this,arguments)}function B(t,e){var i=b(t.touches),n=b(t.changedTouches);return e&(It|Wt)&&(i=S(i.concat(n),"identifier",!0)),[i,n]}function U(){this.evTarget=oe,this.targetIds={},M.apply(this,arguments)}function H(t,e){var i=b(t.touches),n=this.targetIds;if(e&(Yt|At)&&1===i.length)return n[i[0].identifier]=!0,[i,i];var r,o,s=b(t.changedTouches),a=[],h=this.target;if(o=i.filter(function(t){return g(t.target,h)}),e===Yt)for(r=0;r-1&&n.splice(t,1)};setTimeout(r,se)}}function Q(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,n=0;n-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){function e(e){i.manager.emit(e,t)}var i=this,n=this.state;n=we&&e(i.options.event+et(n))},tryEmit:function(t){return this.canEmit()?this.emit(t):void(this.state=Se)},canEmit:function(){for(var t=0;te.threshold&&r&e.direction},attrTest:function(t){return rt.prototype.attrTest.call(this,t)&&(this.state&ge||!(this.state&ge)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=it(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),c(st,rt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[fe]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&ge)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),c(at,tt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[de]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distancee.time;if(this._input=t,!n||!i||t.eventType&(It|Wt)&&!r)this.reset();else if(t.eventType&Yt)this.reset(),this._timer=h(function(){this.state=xe,this.tryEmit()},e.time,this);else if(t.eventType&It)return xe;return Se},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===xe&&(t&&t.eventType&It?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=xt(),this.manager.emit(this.options.event,this._input)))}}),c(ht,rt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[fe]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&ge)}}),c(lt,rt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Vt|Bt,pointers:1},getTouchAction:function(){return ot.prototype.getTouchAction.call(this)},attrTest:function(t){var e,i=this.options.direction;return i&(Vt|Bt)?e=t.overallVelocity:i&Vt?e=t.overallVelocityX:i&Bt&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&i&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&wt(e)>this.options.velocity&&t.eventType&It},emit:function(t){var e=it(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),c(ut,tt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ce]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distance\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=r.console&&(r.console.warn||r.console.log);return o&&o.call(r.console,i,n),t.apply(this,arguments)}}function f(t,e,n){var i,r=e.prototype;i=t.prototype=Object.create(r),i.constructor=t,i._super=r,n&&mt(i,n)}function d(t,e){return function(){return t.apply(e,arguments)}}function p(t,e){return typeof t==gt?t.apply(e?e[0]||a:a,e):t}function m(t,e){return t===a?e:t}function v(t,e,n){l(w(e),function(e){t.addEventListener(e,n,!1)})}function y(t,e,n){l(w(e),function(e){t.removeEventListener(e,n,!1)})}function g(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function _(t,e){return t.indexOf(e)>-1}function w(t){return t.trim().split(/\s+/g)}function x(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var i=0;in[e]}):i.sort()),i}function T(t,e){for(var n,i,r=e[0].toUpperCase()+e.slice(1),o=0;o1&&!n.firstMultiple?n.firstMultiple=Y(e):1===r&&(n.firstMultiple=!1);var o=n.firstInput,s=n.firstMultiple,a=s?s.center:o.center,h=e.center=R(i);e.timeStamp=xt(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=W(a,h),e.distance=N(a,h),P(n,e),e.offsetDirection=I(e.deltaX,e.deltaY);var u=A(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=u.x,e.overallVelocityY=u.y,e.overallVelocity=wt(u.x)>wt(u.y)?u.x:u.y,e.scale=s?F(s.pointers,i):1,e.rotation=s?z(s.pointers,i):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length,L(n,e);var l=t.element;g(e.srcEvent.target,l)&&(l=e.srcEvent.target),e.target=l}function P(t,e){var n=e.center,i=t.offsetDelta||{},r=t.prevDelta||{},o=t.prevInput||{};e.eventType!==Rt&&o.eventType!==It||(r=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},i=t.offsetDelta={x:n.x,y:n.y}),e.deltaX=r.x+(n.x-i.x),e.deltaY=r.y+(n.y-i.y)}function L(t,e){var n,i,r,o,s=t.lastInterval||e,h=e.timeStamp-s.timeStamp;if(e.eventType!=Nt&&(h>Yt||s.velocity===a)){var u=e.deltaX-s.deltaX,l=e.deltaY-s.deltaY,c=A(h,u,l);i=c.x,r=c.y,n=wt(c.x)>wt(c.y)?c.x:c.y,o=I(u,l),t.lastInterval=e}else n=s.velocity,i=s.velocityX,r=s.velocityY,o=s.direction;e.velocity=n,e.velocityX=i,e.velocityY=r,e.direction=o}function Y(t){for(var e=[],n=0;n=wt(e)?t<0?zt:Ft:e<0?jt:Gt}function N(t,e,n){n||(n=Ht);var i=e[n[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return Math.sqrt(i*i+r*r)}function W(t,e,n){n||(n=Ht);var i=e[n[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return 180*Math.atan2(r,i)/Math.PI}function z(t,e){return W(e[1],e[0],Xt)+W(t[1],t[0],Xt)}function F(t,e){return N(e[0],e[1],Xt)/N(t[0],t[1],Xt)}function j(){this.evEl=qt,this.evWin=$t,this.pressed=!1,k.apply(this,arguments)}function G(){this.evEl=Kt,this.evWin=te,k.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function B(){this.evTarget=ne,this.evWin=ie,this.started=!1,k.apply(this,arguments)}function V(t,e){var n=b(t.touches),i=b(t.changedTouches);return e&(It|Nt)&&(n=S(n.concat(i),"identifier",!0)),[n,i]}function U(){this.evTarget=oe,this.targetIds={},k.apply(this,arguments)}function H(t,e){var n=b(t.touches),i=this.targetIds;if(e&(Rt|At)&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,o,s=b(t.changedTouches),a=[],h=this.target;if(o=n.filter(function(t){return g(t.target,h)}),e===Rt)for(r=0;r-1&&i.splice(t,1)};setTimeout(r,se)}}function $(t){for(var e=t.srcEvent.clientX,n=t.srcEvent.clientY,i=0;i-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){function e(e){n.manager.emit(e,t)}var n=this,i=this.state;i=we&&e(n.options.event+et(i))},tryEmit:function(t){return this.canEmit()?this.emit(t):void(this.state=Se)},canEmit:function(){for(var t=0;te.threshold&&r&e.direction},attrTest:function(t){return rt.prototype.attrTest.call(this,t)&&(this.state&ge||!(this.state&ge)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=nt(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),f(st,rt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[de]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&ge)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),f(at,tt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ce]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,i=t.distancee.time;if(this._input=t,!i||!n||t.eventType&(It|Nt)&&!r)this.reset();else if(t.eventType&Rt)this.reset(),this._timer=h(function(){this.state=xe,this.tryEmit()},e.time,this);else if(t.eventType&It)return xe;return Se},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===xe&&(t&&t.eventType&It?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=xt(),this.manager.emit(this.options.event,this._input)))}}),f(ht,rt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[de]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&ge)}}),f(ut,rt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Bt|Vt,pointers:1},getTouchAction:function(){return ot.prototype.getTouchAction.call(this)},attrTest:function(t){var e,n=this.options.direction;return n&(Bt|Vt)?e=t.overallVelocity:n&Bt?e=t.overallVelocityX:n&Vt&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&wt(e)>this.options.velocity&&t.eventType&It},emit:function(t){var e=nt(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),f(lt,tt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[fe]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,i=t.distance2&&void 0!==arguments[2]&&arguments[2];for(var s in e)void 0!==i[s]&&("object"!==o(i[s])?void 0!==i[s]&&null!==i[s]||void 0===e[s]||n!==!0?e[s]=i[s]:delete e[s]:"object"===o(e[s])&&t.fillIfDefined(e[s],i[s],n))},t.protoExtend=function(e,t){for(var i=1;i3&&void 0!==arguments[3]&&arguments[3];if(Array.isArray(o))throw new TypeError("Arrays are not supported by deepExtend");for(var s=2;s3&&void 0!==arguments[3]&&arguments[3];if(Array.isArray(o))throw new TypeError("Arrays are not supported by deepExtend");for(var s in o)if(o.hasOwnProperty(s)&&e.indexOf(s)==-1)if(o[s]&&o[s].constructor===Object)void 0===i[s]&&(i[s]={}),i[s].constructor===Object?t.deepExtend(i[s],o[s]):null===o[s]&&void 0!==i[s]&&n===!0?delete i[s]:i[s]=o[s];else if(Array.isArray(o[s])){i[s]=[];for(var r=0;r=0&&(t="DOMMouseScroll"),e.addEventListener(t,i,o)):e.attachEvent("on"+t,i)},t.removeEventListener=function(e,t,i,o){e.removeEventListener?(void 0===o&&(o=!1),"mousewheel"===t&&navigator.userAgent.indexOf("Firefox")>=0&&(t="DOMMouseScroll"),e.removeEventListener(t,i,o)):e.detachEvent("on"+t,i)},t.preventDefault=function(e){e||(e=window.event),e.preventDefault?e.preventDefault():e.returnValue=!1},t.getTarget=function(e){e||(e=window.event);var t;return e.target?t=e.target:e.srcElement&&(t=e.srcElement),void 0!=t.nodeType&&3==t.nodeType&&(t=t.parentNode),t},t.hasParent=function(e,t){for(var i=e;i;){if(i===t)return!0;i=i.parentNode}return!1},t.option={},t.option.asBoolean=function(e,t){return"function"==typeof e&&(e=e()),null!=e?0!=e:t||null},t.option.asNumber=function(e,t){return"function"==typeof e&&(e=e()),null!=e?Number(e)||t||null:t||null},t.option.asString=function(e,t){return"function"==typeof e&&(e=e()),null!=e?String(e):t||null},t.option.asSize=function(e,i){return"function"==typeof e&&(e=e()),t.isString(e)?e:t.isNumber(e)?e+"px":i||null},t.option.asElement=function(e,t){return"function"==typeof e&&(e=e()),e||t||null},t.hexToRGB=function(e){var t=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;e=e.replace(t,function(e,t,i,o){return t+t+i+i+o+o});var i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return i?{r:parseInt(i[1],16),g:parseInt(i[2],16),b:parseInt(i[3],16)}:null},t.overrideOpacity=function(e,i){if(e.indexOf("rgba")!=-1)return e;if(e.indexOf("rgb")!=-1){var o=e.substr(e.indexOf("(")+1).replace(")","").split(",");return"rgba("+o[0]+","+o[1]+","+o[2]+","+i+")"}var o=t.hexToRGB(e);return null==o?e:"rgba("+o.r+","+o.g+","+o.b+","+i+")"},t.RGBToHex=function(e,t,i){return"#"+((1<<24)+(e<<16)+(t<<8)+i).toString(16).slice(1)},t.parseColor=function(e){var i;if(t.isString(e)===!0){if(t.isValidRGB(e)===!0){var o=e.substr(4).substr(0,e.length-5).split(",").map(function(e){return parseInt(e)});e=t.RGBToHex(o[0],o[1],o[2])}if(t.isValidHex(e)===!0){var n=t.hexToHSV(e),s={h:n.h,s:.8*n.s,v:Math.min(1,1.02*n.v)},r={h:n.h,s:Math.min(1,1.25*n.s),v:.8*n.v},a=t.HSVToHex(r.h,r.s,r.v),h=t.HSVToHex(s.h,s.s,s.v);i={background:e,border:a,highlight:{background:h,border:a},hover:{background:h,border:a}}}else i={background:e,border:e,highlight:{background:e,border:e},hover:{background:e,border:e}}}else i={},i.background=e.background||void 0,i.border=e.border||void 0,t.isString(e.highlight)?i.highlight={border:e.highlight,background:e.highlight}:(i.highlight={},i.highlight.background=e.highlight&&e.highlight.background||void 0,i.highlight.border=e.highlight&&e.highlight.border||void 0),t.isString(e.hover)?i.hover={border:e.hover,background:e.hover}:(i.hover={},i.hover.background=e.hover&&e.hover.background||void 0,i.hover.border=e.hover&&e.hover.border||void 0);return i},t.RGBToHSV=function(e,t,i){e/=255,t/=255,i/=255;var o=Math.min(e,Math.min(t,i)),n=Math.max(e,Math.max(t,i));if(o==n)return{h:0,s:0,v:o};var s=e==o?t-i:i==o?e-t:i-e,r=e==o?3:i==o?1:5,a=60*(r-s/(n-o))/360,h=(n-o)/n,d=n;return{h:a,s:h,v:d}};var a={split:function(e){var t={};return e.split(";").forEach(function(e){if(""!=e.trim()){var i=e.split(":"),o=i[0].trim(),n=i[1].trim();t[o]=n}}),t},join:function(e){return Object.keys(e).map(function(t){return t+": "+e[t]}).join("; ")}};t.addCssText=function(e,i){var o=a.split(e.style.cssText),n=a.split(i),s=t.extend(o,n);e.style.cssText=a.join(s)},t.removeCssText=function(e,t){var i=a.split(e.style.cssText),o=a.split(t);for(var n in o)o.hasOwnProperty(n)&&delete i[n];e.style.cssText=a.join(i)},t.HSVToRGB=function(e,t,i){var o,n,s,r=Math.floor(6*e),a=6*e-r,h=i*(1-t),d=i*(1-a*t),l=i*(1-(1-a)*t);switch(r%6){case 0:o=i,n=l,s=h;break;case 1:o=d,n=i,s=h;break;case 2:o=h,n=i,s=l;break;case 3:o=h,n=d,s=i;break;case 4:o=l,n=h,s=i;break;case 5:o=i,n=h,s=d}return{r:Math.floor(255*o),g:Math.floor(255*n),b:Math.floor(255*s)}},t.HSVToHex=function(e,i,o){var n=t.HSVToRGB(e,i,o);return t.RGBToHex(n.r,n.g,n.b)},t.hexToHSV=function(e){var i=t.hexToRGB(e);return t.RGBToHSV(i.r,i.g,i.b)},t.isValidHex=function(e){var t=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(e);return t},t.isValidRGB=function(e){e=e.replace(" ","");var t=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/i.test(e);return t},t.isValidRGBA=function(e){e=e.replace(" ","");var t=/rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(.{1,3})\)/i.test(e);return t},t.selectiveBridgeObject=function(e,i){if("object"==("undefined"==typeof i?"undefined":o(i))){for(var n=Object.create(i),s=0;s0&&t(o,e[n-1])<0;n--)e[n]=e[n-1];e[n]=o}return e},t.mergeOptions=function(e,t,i){var o=(arguments.length>3&&void 0!==arguments[3]&&arguments[3],arguments.length>4&&void 0!==arguments[4]?arguments[4]:{});if(null===t[i])e[i]=Object.create(o[i]);else if(void 0!==t[i])if("boolean"==typeof t[i])e[i].enabled=t[i];else{void 0===t[i].enabled&&(e[i].enabled=!0);for(var n in t[i])t[i].hasOwnProperty(n)&&(e[i][n]=t[i][n])}},t.binarySearchCustom=function(e,t,i,o){for(var n=1e4,s=0,r=0,a=e.length-1;r<=a&&s0)return"before"==o?Math.max(0,h-1):h;if(n(r,t)<0&&n(a,t)>0)return"before"==o?h:Math.min(e.length-1,h+1);n(r,t)<0?c=h+1:u=h-1,l++}return-1},t.easingFunctions={linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return e*(2-e)},easeInOutQuad:function(e){return e<.5?2*e*e:-1+(4-2*e)*e},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return--e*e*e+1},easeInOutCubic:function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return 1- --e*e*e*e},easeInOutQuart:function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return 1+--e*e*e*e*e},easeInOutQuint:function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e}},t.getScrollBarWidth=function(){var e=document.createElement("p");e.style.width="100%",e.style.height="200px";var t=document.createElement("div");t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.appendChild(e),document.body.appendChild(t);var i=e.offsetWidth;t.style.overflow="scroll";var o=e.offsetWidth;return i==o&&(o=t.clientWidth),document.body.removeChild(t),i-o}},function(e,t,i){e.exports="undefined"!=typeof window&&window.moment||i(3)},function(e,t,i){(function(e){!function(t,i){e.exports=i()}(this,function(){function t(){return po.apply(null,arguments)}function i(e){po=e}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function n(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function s(e){var t;for(t in e)return!1;return!0}function r(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function a(e,t){var i,o=[];for(i=0;i0)for(i in yo)o=yo[i],n=t[o],v(n)||(e[o]=n);return e}function g(e){y(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),go===!1&&(go=!0,t.updateOffset(this),go=!1)}function b(e){return e instanceof g||null!=e&&null!=e._isAMomentObject}function m(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function _(e){var t=+e,i=0;return 0!==t&&isFinite(t)&&(i=m(t)),i}function w(e,t,i){var o,n=Math.min(e.length,t.length),s=Math.abs(e.length-t.length),r=0;for(o=0;o0?"future":"past"];return E(i)?i(t):i.replace(/%s/i,t)}function j(e,t){var i=e.toLowerCase();Co[i]=Co[i+"s"]=Co[t]=e}function N(e){return"string"==typeof e?Co[e]||Co[e.toLowerCase()]:void 0}function z(e){var t,i,o={};for(i in e)h(e,i)&&(t=N(i),t&&(o[t]=e[i]));return o}function R(e,t){So[e]=t}function A(e){var t=[];for(var i in e)t.push({unit:i,priority:So[i]});return t.sort(function(e,t){return e.priority-t.priority}),t}function L(e,i){return function(o){return null!=o?(W(this,e,o),t.updateOffset(this,i),this):H(this,e)}}function H(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function W(e,t,i){e.isValid()&&e._d["set"+(e._isUTC?"UTC":"")+t](i)}function Y(e){return e=N(e),E(this[e])?this[e]():this}function U(e,t){if("object"==typeof e){e=z(e);for(var i=A(e),o=0;o=0;return(s?i?"+":"":"-")+Math.pow(10,Math.max(0,n)).toString().substr(1)+o}function q(e,t,i,o){var n=o;"string"==typeof o&&(n=function(){return this[o]()}),e&&(Bo[e]=n),t&&(Bo[t[0]]=function(){return V(n.apply(this,arguments),t[1],t[2])}),i&&(Bo[i]=function(){return this.localeData().ordinal(n.apply(this,arguments),e)})}function G(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function X(e){var t,i,o=e.match(Do);for(t=0,i=o.length;t=0&&To.test(e);)e=e.replace(To,i),To.lastIndex=0,o-=1;return e}function Q(e,t,i){Zo[e]=E(t)?t:function(e,o){return e&&i?i:t}}function J(e,t){return h(Zo,e)?Zo[e](t._strict,t._locale):new RegExp($(e))}function $(e){return ee(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,i,o,n){return t||i||o||n}))}function ee(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function te(e,t){var i,o=t;for("string"==typeof e&&(e=[e]),"number"==typeof t&&(o=function(e,i){i[t]=_(e)}),i=0;i=0&&isFinite(a.getFullYear())&&a.setFullYear(e),a}function me(e){var t=new Date(Date.UTC.apply(null,arguments));return e<100&&e>=0&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function _e(e,t,i){var o=7+t-i,n=(7+me(e,0,o).getUTCDay()-t)%7;return-n+o-1}function we(e,t,i,o,n){var s,r,a=(7+i-o)%7,h=_e(e,o,n),d=1+7*(t-1)+a+h;return d<=0?(s=e-1,r=ve(s)+d):d>ve(e)?(s=e+1,r=d-ve(e)):(s=e,r=d),{year:s,dayOfYear:r}}function ke(e,t,i){var o,n,s=_e(e.year(),t,i),r=Math.floor((e.dayOfYear()-s-1)/7)+1;return r<1?(n=e.year()-1,o=r+xe(n,t,i)):r>xe(e.year(),t,i)?(o=r-xe(e.year(),t,i),n=e.year()+1):(n=e.year(),o=r),{week:o,year:n}}function xe(e,t,i){var o=_e(e,t,i),n=_e(e+1,t,i);return(ve(e)-o+n)/7}function Oe(e){return ke(e,this._week.dow,this._week.doy).week}function Ee(){return this._week.dow}function Me(){return this._week.doy}function Ce(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function Se(e){var t=ke(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function De(e,t){return"string"!=typeof e?e:isNaN(e)?(e=t.weekdaysParse(e),"number"==typeof e?e:null):parseInt(e,10)}function Te(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Pe(e,t){return e?o(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(t)?"format":"standalone"][e.day()]:this._weekdays}function Be(e){return e?this._weekdaysShort[e.day()]:this._weekdaysShort}function Fe(e){return e?this._weekdaysMin[e.day()]:this._weekdaysMin}function Ie(e,t,i){var o,n,s,r=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],o=0;o<7;++o)s=l([2e3,1]).day(o),this._minWeekdaysParse[o]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[o]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[o]=this.weekdays(s,"").toLocaleLowerCase();return i?"dddd"===t?(n=_o.call(this._weekdaysParse,r),n!==-1?n:null):"ddd"===t?(n=_o.call(this._shortWeekdaysParse,r),n!==-1?n:null):(n=_o.call(this._minWeekdaysParse,r),n!==-1?n:null):"dddd"===t?(n=_o.call(this._weekdaysParse,r),n!==-1?n:(n=_o.call(this._shortWeekdaysParse,r),n!==-1?n:(n=_o.call(this._minWeekdaysParse,r),n!==-1?n:null))):"ddd"===t?(n=_o.call(this._shortWeekdaysParse,r),n!==-1?n:(n=_o.call(this._weekdaysParse,r),n!==-1?n:(n=_o.call(this._minWeekdaysParse,r),n!==-1?n:null))):(n=_o.call(this._minWeekdaysParse,r),n!==-1?n:(n=_o.call(this._weekdaysParse,r),n!==-1?n:(n=_o.call(this._shortWeekdaysParse,r),n!==-1?n:null)))}function je(e,t,i){var o,n,s;if(this._weekdaysParseExact)return Ie.call(this,e,t,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),o=0;o<7;o++){if(n=l([2e3,1]).day(o),i&&!this._fullWeekdaysParse[o]&&(this._fullWeekdaysParse[o]=new RegExp("^"+this.weekdays(n,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[o]=new RegExp("^"+this.weekdaysShort(n,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[o]=new RegExp("^"+this.weekdaysMin(n,"").replace(".",".?")+"$","i")),this._weekdaysParse[o]||(s="^"+this.weekdays(n,"")+"|^"+this.weekdaysShort(n,"")+"|^"+this.weekdaysMin(n,""),this._weekdaysParse[o]=new RegExp(s.replace(".",""),"i")),i&&"dddd"===t&&this._fullWeekdaysParse[o].test(e))return o;if(i&&"ddd"===t&&this._shortWeekdaysParse[o].test(e))return o;if(i&&"dd"===t&&this._minWeekdaysParse[o].test(e))return o;if(!i&&this._weekdaysParse[o].test(e))return o}}function Ne(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=De(e,this.localeData()),this.add(e-t,"d")):t}function ze(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function Re(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=Te(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7}function Ae(e){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||We.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(h(this,"_weekdaysRegex")||(this._weekdaysRegex=bn),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function Le(e){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||We.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(h(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=mn),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function He(e){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||We.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(h(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=_n),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function We(){function e(e,t){return t.length-e.length}var t,i,o,n,s,r=[],a=[],h=[],d=[];for(t=0;t<7;t++)i=l([2e3,1]).day(t),o=this.weekdaysMin(i,""),n=this.weekdaysShort(i,""),s=this.weekdays(i,""),r.push(o),a.push(n),h.push(s),d.push(o),d.push(n),d.push(s);for(r.sort(e),a.sort(e),h.sort(e),d.sort(e),t=0;t<7;t++)a[t]=ee(a[t]),h[t]=ee(h[t]),d[t]=ee(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 Ye(){return this.hours()%12||12}function Ue(){return this.hours()||24}function Ve(e,t){q(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function qe(e,t){return t._meridiemParse}function Ge(e){return"p"===(e+"").toLowerCase().charAt(0)}function Xe(e,t,i){return e>11?i?"pm":"PM":i?"am":"AM"}function Ke(e){return e?e.toLowerCase().replace("_","-"):e}function Ze(e){for(var t,i,o,n,s=0;s0;){if(o=Qe(n.slice(0,t).join("-")))return o;if(i&&i.length>=t&&w(n,i,!0)>=t-1)break;t--}s++}return null}function Qe(t){var i=null;if(!En[t]&&"undefined"!=typeof e&&e&&e.exports)try{i=wn._abbr,!function(){var e=new Error('Cannot find module "./locale"');throw e.code="MODULE_NOT_FOUND",e}(),Je(i)}catch(e){}return En[t]}function Je(e,t){var i;return e&&(i=v(t)?tt(e):$e(e,t),i&&(wn=i)),wn._abbr}function $e(e,t){if(null!==t){var i=On;return t.abbr=e,null!=En[e]?(O("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=En[e]._config):null!=t.parentLocale&&(null!=En[t.parentLocale]?i=En[t.parentLocale]._config:O("parentLocaleUndefined","specified parentLocale is not defined yet. See http://momentjs.com/guides/#/warnings/parent-locale/")),En[e]=new S(C(i,t)),Je(e),En[e]}return delete En[e],null}function et(e,t){if(null!=t){var i,o=On;null!=En[e]&&(o=En[e]._config),t=C(o,t),i=new S(t),i.parentLocale=En[e],En[e]=i,Je(e)}else null!=En[e]&&(null!=En[e].parentLocale?En[e]=En[e].parentLocale:null!=En[e]&&delete En[e]);return En[e]}function tt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return wn;if(!o(e)){if(t=Qe(e))return t;e=[e]}return Ze(e)}function it(){return mo(En)}function ot(e){var t,i=e._a;return i&&u(e).overflow===-2&&(t=i[$o]<0||i[$o]>11?$o:i[en]<1||i[en]>ne(i[Jo],i[$o])?en:i[tn]<0||i[tn]>24||24===i[tn]&&(0!==i[on]||0!==i[nn]||0!==i[sn])?tn:i[on]<0||i[on]>59?on:i[nn]<0||i[nn]>59?nn:i[sn]<0||i[sn]>999?sn:-1, -u(e)._overflowDayOfYear&&(ten)&&(t=en),u(e)._overflowWeeks&&t===-1&&(t=rn),u(e)._overflowWeekday&&t===-1&&(t=an),u(e).overflow=t),e}function nt(e){var t,i,o,n,s,r,a=e._i,h=Mn.exec(a)||Cn.exec(a);if(h){for(u(e).iso=!0,t=0,i=Dn.length;tve(n)&&(u(e)._overflowDayOfYear=!0),i=me(n,0,e._dayOfYear),e._a[$o]=i.getUTCMonth(),e._a[en]=i.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=s[t]=o[t];for(;t<7;t++)e._a[t]=s[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[tn]&&0===e._a[on]&&0===e._a[nn]&&0===e._a[sn]&&(e._nextDay=!0,e._a[tn]=0),e._d=(e._useUTC?me:be).apply(null,s),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[tn]=24)}}function dt(e){var t,i,o,n,s,r,a,h;t=e._w,null!=t.GG||null!=t.W||null!=t.E?(s=1,r=4,i=rt(t.GG,e._a[Jo],ke(bt(),1,4).year),o=rt(t.W,1),n=rt(t.E,1),(n<1||n>7)&&(h=!0)):(s=e._locale._week.dow,r=e._locale._week.doy,i=rt(t.gg,e._a[Jo],ke(bt(),s,r).year),o=rt(t.w,1),null!=t.d?(n=t.d,(n<0||n>6)&&(h=!0)):null!=t.e?(n=t.e+s,(t.e<0||t.e>6)&&(h=!0)):n=s),o<1||o>xe(i,s,r)?u(e)._overflowWeeks=!0:null!=h?u(e)._overflowWeekday=!0:(a=we(i,o,n,s,r),e._a[Jo]=a.year,e._dayOfYear=a.dayOfYear)}function lt(e){if(e._f===t.ISO_8601)return void nt(e);e._a=[],u(e).empty=!0;var i,o,n,s,r,a=""+e._i,h=a.length,d=0;for(n=Z(e._f,e._locale).match(Do)||[],i=0;i0&&u(e).unusedInput.push(r),a=a.slice(a.indexOf(o)+o.length),d+=o.length),Bo[s]?(o?u(e).empty=!1:u(e).unusedTokens.push(s),oe(s,o,e)):e._strict&&!o&&u(e).unusedTokens.push(s);u(e).charsLeftOver=h-d,a.length>0&&u(e).unusedInput.push(a),e._a[tn]<=12&&u(e).bigHour===!0&&e._a[tn]>0&&(u(e).bigHour=void 0),u(e).parsedDateParts=e._a.slice(0),u(e).meridiem=e._meridiem,e._a[tn]=ct(e._locale,e._a[tn],e._meridiem),ht(e),ot(e)}function ct(e,t,i){var o;return null==i?t:null!=e.meridiemHour?e.meridiemHour(t,i):null!=e.isPM?(o=e.isPM(i),o&&t<12&&(t+=12),o||12!==t||(t=0),t):t}function ut(e){var t,i,o,n,s;if(0===e._f.length)return u(e).invalidFormat=!0,void(e._d=new Date(NaN));for(n=0;nthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Nt(){if(!v(this._isDSTShifted))return this._isDSTShifted;var e={};if(y(e,this),e=vt(e),e._a){var t=e._isUTC?l(e._a):bt(e._a);this._isDSTShifted=this.isValid()&&w(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function zt(){return!!this.isValid()&&!this._isUTC}function Rt(){return!!this.isValid()&&this._isUTC}function At(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function Lt(e,t){var i,o,n,s=e,r=null;return xt(e)?s={ms:e._milliseconds,d:e._days,M:e._months}:"number"==typeof e?(s={},t?s[t]=e:s.milliseconds=e):(r=Nn.exec(e))?(i="-"===r[1]?-1:1,s={y:0,d:_(r[en])*i,h:_(r[tn])*i,m:_(r[on])*i,s:_(r[nn])*i,ms:_(Ot(1e3*r[sn]))*i}):(r=zn.exec(e))?(i="-"===r[1]?-1:1,s={y:Ht(r[2],i),M:Ht(r[3],i),w:Ht(r[4],i),d:Ht(r[5],i),h:Ht(r[6],i),m:Ht(r[7],i),s:Ht(r[8],i)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(n=Yt(bt(s.from),bt(s.to)),s={},s.ms=n.milliseconds,s.M=n.months),o=new kt(s),xt(e)&&h(e,"_locale")&&(o._locale=e._locale),o}function Ht(e,t){var i=e&&parseFloat(e.replace(",","."));return(isNaN(i)?0:i)*t}function Wt(e,t){var i={milliseconds:0,months:0};return i.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(i.months,"M").isAfter(t)&&--i.months,i.milliseconds=+t-+e.clone().add(i.months,"M"),i}function Yt(e,t){var i;return e.isValid()&&t.isValid()?(t=Ct(t,e),e.isBefore(t)?i=Wt(e,t):(i=Wt(t,e),i.milliseconds=-i.milliseconds,i.months=-i.months),i):{milliseconds:0,months:0}}function Ut(e,t){return function(i,o){var n,s;return null===o||isNaN(+o)||(O(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),s=i,i=o,o=s),i="string"==typeof i?+i:i,n=Lt(i,o),Vt(this,n,e),this}}function Vt(e,i,o,n){var s=i._milliseconds,r=Ot(i._days),a=Ot(i._months);e.isValid()&&(n=null==n||n,s&&e._d.setTime(e._d.valueOf()+s*o),r&&W(e,"Date",H(e,"Date")+r*o),a&&de(e,H(e,"Month")+a*o),n&&t.updateOffset(e,r||a))}function qt(e,t){var i=e.diff(t,"days",!0);return i<-6?"sameElse":i<-1?"lastWeek":i<0?"lastDay":i<1?"sameDay":i<2?"nextDay":i<7?"nextWeek":"sameElse"}function Gt(e,i){var o=e||bt(),n=Ct(o,this).startOf("day"),s=t.calendarFormat(this,n)||"sameElse",r=i&&(E(i[s])?i[s].call(this,o):i[s]);return this.format(r||this.localeData().calendar(s,this,bt(o)))}function Xt(){return new g(this)}function Kt(e,t){var i=b(e)?e:bt(e);return!(!this.isValid()||!i.isValid())&&(t=N(v(t)?"millisecond":t),"millisecond"===t?this.valueOf()>i.valueOf():i.valueOf()s&&(t=s),Ti.call(this,e,t,i,o,n))}function Ti(e,t,i,o,n){var s=we(e,t,i,o,n),r=me(s.year,0,s.dayOfYear);return this.year(r.getUTCFullYear()),this.month(r.getUTCMonth()),this.date(r.getUTCDate()),this}function Pi(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}function Bi(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}function Fi(e,t){t[sn]=_(1e3*("0."+e))}function Ii(){return this._isUTC?"UTC":""}function ji(){return this._isUTC?"Coordinated Universal Time":""}function Ni(e){return bt(1e3*e)}function zi(){return bt.apply(null,arguments).parseZone()}function Ri(e){return e}function Ai(e,t,i,o){var n=tt(),s=l().set(o,t);return n[i](s,e)}function Li(e,t,i){if("number"==typeof e&&(t=e,e=void 0),e=e||"",null!=t)return Ai(e,t,i,"month");var o,n=[];for(o=0;o<12;o++)n[o]=Ai(e,o,i,"month");return n}function Hi(e,t,i,o){"boolean"==typeof e?("number"==typeof t&&(i=t,t=void 0),t=t||""):(t=e,i=t,e=!1,"number"==typeof t&&(i=t,t=void 0),t=t||"");var n=tt(),s=e?n._week.dow:0;if(null!=i)return Ai(t,(i+s)%7,o,"day");var r,a=[];for(r=0;r<7;r++)a[r]=Ai(t,(r+s)%7,o,"day");return a}function Wi(e,t){return Li(e,t,"months")}function Yi(e,t){return Li(e,t,"monthsShort")}function Ui(e,t,i){return Hi(e,t,i,"weekdays")}function Vi(e,t,i){return Hi(e,t,i,"weekdaysShort")}function qi(e,t,i){return Hi(e,t,i,"weekdaysMin")}function Gi(){var e=this._data;return this._milliseconds=Kn(this._milliseconds),this._days=Kn(this._days),this._months=Kn(this._months),e.milliseconds=Kn(e.milliseconds),e.seconds=Kn(e.seconds),e.minutes=Kn(e.minutes),e.hours=Kn(e.hours),e.months=Kn(e.months),e.years=Kn(e.years),this}function Xi(e,t,i,o){var n=Lt(t,i);return e._milliseconds+=o*n._milliseconds,e._days+=o*n._days,e._months+=o*n._months,e._bubble()}function Ki(e,t){return Xi(this,e,t,1)}function Zi(e,t){return Xi(this,e,t,-1)}function Qi(e){return e<0?Math.floor(e):Math.ceil(e)}function Ji(){var e,t,i,o,n,s=this._milliseconds,r=this._days,a=this._months,h=this._data;return s>=0&&r>=0&&a>=0||s<=0&&r<=0&&a<=0||(s+=864e5*Qi(eo(a)+r),r=0,a=0),h.milliseconds=s%1e3,e=m(s/1e3),h.seconds=e%60,t=m(e/60),h.minutes=t%60,i=m(t/60),h.hours=i%24,r+=m(i/24),n=m($i(r)),a+=n,r-=Qi(eo(n)),o=m(a/12),a%=12,h.days=r,h.months=a,h.years=o,this}function $i(e){return 4800*e/146097}function eo(e){return 146097*e/4800}function to(e){var t,i,o=this._milliseconds;if(e=N(e),"month"===e||"year"===e)return t=this._days+o/864e5,i=this._months+$i(t),"month"===e?i:i/12;switch(t=this._days+Math.round(eo(this._months)),e){case"week":return t/7+o/6048e5;case"day":return t+o/864e5;case"hour":return 24*t+o/36e5;case"minute":return 1440*t+o/6e4;case"second":return 86400*t+o/1e3;case"millisecond":return Math.floor(864e5*t)+o;default:throw new Error("Unknown unit "+e)}}function io(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*_(this._months/12)}function oo(e){return function(){return this.as(e)}}function no(e){return e=N(e),this[e+"s"]()}function so(e){return function(){return this._data[e]}}function ro(){return m(this.days()/7)}function ao(e,t,i,o,n){return n.relativeTime(t||1,!!i,e,o)}function ho(e,t,i){var o=Lt(e).abs(),n=cs(o.as("s")),s=cs(o.as("m")),r=cs(o.as("h")),a=cs(o.as("d")),h=cs(o.as("M")),d=cs(o.as("y")),l=n0,l[4]=i,ao.apply(null,l)}function lo(e){return void 0===e?cs:"function"==typeof e&&(cs=e,!0)}function co(e,t){return void 0!==us[e]&&(void 0===t?us[e]:(us[e]=t,!0))}function uo(e){var t=this.localeData(),i=ho(this,!e,t);return e&&(i=t.pastFuture(+this,i)),t.postformat(i)}function fo(){var e,t,i,o=fs(this._milliseconds)/1e3,n=fs(this._days),s=fs(this._months);e=m(o/60),t=m(e/60),o%=60,e%=60,i=m(s/12),s%=12;var r=i,a=s,h=n,d=t,l=e,c=o,u=this.asSeconds();return u?(u<0?"-":"")+"P"+(r?r+"Y":"")+(a?a+"M":"")+(h?h+"D":"")+(d||l||c?"T":"")+(d?d+"H":"")+(l?l+"M":"")+(c?c+"S":""):"P0D"}var po,vo;vo=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),i=t.length>>>0,o=0;o68?1900:2e3)};var fn=L("FullYear",!0);q("w",["ww",2],"wo","week"),q("W",["WW",2],"Wo","isoWeek"),j("week","w"),j("isoWeek","W"),R("week",5),R("isoWeek",5),Q("w",Ro),Q("ww",Ro,Io),Q("W",Ro),Q("WW",Ro,Io),ie(["w","ww","W","WW"],function(e,t,i,o){t[o.substr(0,1)]=_(e)});var pn={dow:0,doy:6};q("d",0,"do","day"),q("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),q("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),q("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),q("e",0,0,"weekday"),q("E",0,0,"isoWeekday"),j("day","d"),j("weekday","e"),j("isoWeekday","E"),R("day",11),R("weekday",11),R("isoWeekday",11),Q("d",Ro),Q("e",Ro),Q("E",Ro),Q("dd",function(e,t){return t.weekdaysMinRegex(e)}),Q("ddd",function(e,t){return t.weekdaysShortRegex(e)}),Q("dddd",function(e,t){return t.weekdaysRegex(e)}),ie(["dd","ddd","dddd"],function(e,t,i,o){var n=i._locale.weekdaysParse(e,o,i._strict);null!=n?t.d=n:u(i).invalidWeekday=e}),ie(["d","e","E"],function(e,t,i,o){t[o]=_(e)});var vn="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),yn="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),gn="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),bn=Ko,mn=Ko,_n=Ko;q("H",["HH",2],0,"hour"),q("h",["hh",2],0,Ye),q("k",["kk",2],0,Ue),q("hmm",0,0,function(){return""+Ye.apply(this)+V(this.minutes(),2)}),q("hmmss",0,0,function(){return""+Ye.apply(this)+V(this.minutes(),2)+V(this.seconds(),2)}),q("Hmm",0,0,function(){return""+this.hours()+V(this.minutes(),2)}),q("Hmmss",0,0,function(){return""+this.hours()+V(this.minutes(),2)+V(this.seconds(),2)}),Ve("a",!0),Ve("A",!1),j("hour","h"),R("hour",13),Q("a",qe),Q("A",qe),Q("H",Ro),Q("h",Ro),Q("HH",Ro,Io),Q("hh",Ro,Io),Q("hmm",Ao),Q("hmmss",Lo),Q("Hmm",Ao),Q("Hmmss",Lo),te(["H","HH"],tn),te(["a","A"],function(e,t,i){i._isPm=i._locale.isPM(e),i._meridiem=e}),te(["h","hh"],function(e,t,i){t[tn]=_(e),u(i).bigHour=!0}),te("hmm",function(e,t,i){var o=e.length-2;t[tn]=_(e.substr(0,o)),t[on]=_(e.substr(o)),u(i).bigHour=!0}),te("hmmss",function(e,t,i){var o=e.length-4,n=e.length-2;t[tn]=_(e.substr(0,o)),t[on]=_(e.substr(o,2)),t[nn]=_(e.substr(n)),u(i).bigHour=!0}),te("Hmm",function(e,t,i){var o=e.length-2;t[tn]=_(e.substr(0,o)),t[on]=_(e.substr(o))}),te("Hmmss",function(e,t,i){var o=e.length-4,n=e.length-2;t[tn]=_(e.substr(0,o)),t[on]=_(e.substr(o,2)),t[nn]=_(e.substr(n))});var wn,kn=/[ap]\.?m?\.?/i,xn=L("Hours",!0),On={calendar:wo,longDateFormat:ko,invalidDate:xo,ordinal:Oo,ordinalParse:Eo,relativeTime:Mo,months:dn,monthsShort:ln,week:pn,weekdays:vn,weekdaysMin:gn,weekdaysShort:yn,meridiemParse:kn},En={},Mn=/^\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)?)?/,Cn=/^\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)?)?/,Sn=/Z|[+-]\d\d(?::?\d\d)?/,Dn=[["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}/]],Tn=[["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/]],Pn=/^\/?Date\((\-?\d+)/i;t.createFromInputFallback=x("value provided is not in a recognized ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),t.ISO_8601=function(){};var Bn=x("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=bt.apply(null,arguments);return this.isValid()&&e.isValid()?ethis?this:e:p()}),In=function(){return Date.now?Date.now():+new Date};Et("Z",":"),Et("ZZ",""),Q("Z",Go),Q("ZZ",Go),te(["Z","ZZ"],function(e,t,i){i._useUTC=!0,i._tzm=Mt(Go,e)});var jn=/([\+\-]|\d\d)/gi;t.updateOffset=function(){};var Nn=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,zn=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;Lt.fn=kt.prototype;var Rn=Ut(1,"add"),An=Ut(-1,"subtract");t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",t.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Ln=x("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});q(0,["gg",2],0,function(){return this.weekYear()%100}),q(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Oi("gggg","weekYear"),Oi("ggggg","weekYear"),Oi("GGGG","isoWeekYear"),Oi("GGGGG","isoWeekYear"),j("weekYear","gg"),j("isoWeekYear","GG"),R("weekYear",1),R("isoWeekYear",1),Q("G",Vo),Q("g",Vo),Q("GG",Ro,Io),Q("gg",Ro,Io),Q("GGGG",Wo,No),Q("gggg",Wo,No),Q("GGGGG",Yo,zo),Q("ggggg",Yo,zo),ie(["gggg","ggggg","GGGG","GGGGG"],function(e,t,i,o){t[o.substr(0,2)]=_(e)}),ie(["gg","GG"],function(e,i,o,n){i[n]=t.parseTwoDigitYear(e)}),q("Q",0,"Qo","quarter"),j("quarter","Q"),R("quarter",7),Q("Q",Fo),te("Q",function(e,t){t[$o]=3*(_(e)-1)}),q("D",["DD",2],"Do","date"),j("date","D"),R("date",9),Q("D",Ro),Q("DD",Ro,Io),Q("Do",function(e,t){return e?t._ordinalParse:t._ordinalParseLenient}),te(["D","DD"],en),te("Do",function(e,t){t[en]=_(e.match(Ro)[0],10)});var Hn=L("Date",!0);q("DDD",["DDDD",3],"DDDo","dayOfYear"),j("dayOfYear","DDD"),R("dayOfYear",4),Q("DDD",Ho),Q("DDDD",jo),te(["DDD","DDDD"],function(e,t,i){i._dayOfYear=_(e)}),q("m",["mm",2],0,"minute"),j("minute","m"),R("minute",14),Q("m",Ro),Q("mm",Ro,Io),te(["m","mm"],on);var Wn=L("Minutes",!1);q("s",["ss",2],0,"second"),j("second","s"),R("second",15),Q("s",Ro),Q("ss",Ro,Io),te(["s","ss"],nn);var Yn=L("Seconds",!1);q("S",0,0,function(){return~~(this.millisecond()/100)}),q(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),q(0,["SSS",3],0,"millisecond"),q(0,["SSSS",4],0,function(){return 10*this.millisecond()}),q(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),q(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),q(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),q(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),q(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),j("millisecond","ms"),R("millisecond",16),Q("S",Ho,Fo),Q("SS",Ho,Io),Q("SSS",Ho,jo);var Un;for(Un="SSSS";Un.length<=9;Un+="S")Q(Un,Uo);for(Un="S";Un.length<=9;Un+="S")te(Un,Fi);var Vn=L("Milliseconds",!1);q("z",0,0,"zoneAbbr"),q("zz",0,0,"zoneName");var qn=g.prototype;qn.add=Rn,qn.calendar=Gt,qn.clone=Xt,qn.diff=ti,qn.endOf=fi,qn.format=si,qn.from=ri,qn.fromNow=ai,qn.to=hi,qn.toNow=di,qn.get=Y,qn.invalidAt=ki,qn.isAfter=Kt,qn.isBefore=Zt,qn.isBetween=Qt,qn.isSame=Jt,qn.isSameOrAfter=$t,qn.isSameOrBefore=ei,qn.isValid=_i,qn.lang=Ln,qn.locale=li,qn.localeData=ci,qn.max=Fn,qn.min=Bn,qn.parsingFlags=wi,qn.set=U,qn.startOf=ui,qn.subtract=An,qn.toArray=gi,qn.toObject=bi,qn.toDate=yi,qn.toISOString=ni,qn.toJSON=mi,qn.toString=oi,qn.unix=vi,qn.valueOf=pi,qn.creationData=xi,qn.year=fn,qn.isLeapYear=ge,qn.weekYear=Ei,qn.isoWeekYear=Mi,qn.quarter=qn.quarters=Pi,qn.month=le,qn.daysInMonth=ce,qn.week=qn.weeks=Ce,qn.isoWeek=qn.isoWeeks=Se,qn.weeksInYear=Si,qn.isoWeeksInYear=Ci,qn.date=Hn,qn.day=qn.days=Ne,qn.weekday=ze,qn.isoWeekday=Re,qn.dayOfYear=Bi,qn.hour=qn.hours=xn,qn.minute=qn.minutes=Wn,qn.second=qn.seconds=Yn,qn.millisecond=qn.milliseconds=Vn,qn.utcOffset=Dt,qn.utc=Pt,qn.local=Bt,qn.parseZone=Ft,qn.hasAlignedHourOffset=It,qn.isDST=jt,qn.isLocal=zt,qn.isUtcOffset=Rt,qn.isUtc=At,qn.isUTC=At,qn.zoneAbbr=Ii,qn.zoneName=ji,qn.dates=x("dates accessor is deprecated. Use date instead.",Hn),qn.months=x("months accessor is deprecated. Use month instead",le),qn.years=x("years accessor is deprecated. Use year instead",fn),qn.zone=x("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Tt),qn.isDSTShifted=x("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Nt);var Gn=qn,Xn=S.prototype;Xn.calendar=D,Xn.longDateFormat=T,Xn.invalidDate=P,Xn.ordinal=B,Xn.preparse=Ri,Xn.postformat=Ri,Xn.relativeTime=F,Xn.pastFuture=I,Xn.set=M,Xn.months=se,Xn.monthsShort=re,Xn.monthsParse=he,Xn.monthsRegex=fe,Xn.monthsShortRegex=ue,Xn.week=Oe,Xn.firstDayOfYear=Me,Xn.firstDayOfWeek=Ee,Xn.weekdays=Pe,Xn.weekdaysMin=Fe,Xn.weekdaysShort=Be,Xn.weekdaysParse=je,Xn.weekdaysRegex=Ae,Xn.weekdaysShortRegex=Le,Xn.weekdaysMinRegex=He,Xn.isPM=Ge,Xn.meridiem=Xe,Je("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,i=1===_(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+i}}),t.lang=x("moment.lang is deprecated. Use moment.locale instead.",Je),t.langData=x("moment.langData is deprecated. Use moment.localeData instead.",tt);var Kn=Math.abs,Zn=oo("ms"),Qn=oo("s"),Jn=oo("m"),$n=oo("h"),es=oo("d"),ts=oo("w"),is=oo("M"),os=oo("y"),ns=so("milliseconds"),ss=so("seconds"),rs=so("minutes"),as=so("hours"),hs=so("days"),ds=so("months"),ls=so("years"),cs=Math.round,us={s:45,m:45,h:22,d:26,M:11},fs=Math.abs,ps=kt.prototype;ps.abs=Gi,ps.add=Ki,ps.subtract=Zi,ps.as=to,ps.asMilliseconds=Zn,ps.asSeconds=Qn,ps.asMinutes=Jn,ps.asHours=$n,ps.asDays=es,ps.asWeeks=ts,ps.asMonths=is,ps.asYears=os,ps.valueOf=io,ps._bubble=Ji,ps.get=no,ps.milliseconds=ns,ps.seconds=ss,ps.minutes=rs,ps.hours=as,ps.days=hs,ps.weeks=ro,ps.months=ds,ps.years=ls,ps.humanize=uo,ps.toISOString=fo,ps.toString=fo,ps.toJSON=fo,ps.locale=li,ps.localeData=ci,ps.toIsoString=x("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",fo),ps.lang=Ln,q("X",0,0,"unix"),q("x",0,0,"valueOf"),Q("x",Vo),Q("X",Xo),te("X",function(e,t,i){i._d=new Date(1e3*parseFloat(e,10))}),te("x",function(e,t,i){i._d=new Date(_(e))}),t.version="2.15.2",i(bt),t.fn=Gn,t.min=_t,t.max=wt,t.now=In,t.utc=l,t.unix=Ni,t.months=Wi,t.isDate=r,t.locale=Je,t.invalid=p,t.duration=Lt,t.isMoment=b,t.weekdays=Ui,t.parseZone=zi,t.localeData=tt,t.isDuration=xt,t.monthsShort=Yi,t.weekdaysMin=qi,t.defineLocale=$e,t.updateLocale=et,t.locales=it,t.weekdaysShort=Vi,t.normalizeUnits=N,t.relativeTimeRounding=lo,t.relativeTimeThreshold=co,t.calendarFormat=qt,t.prototype=Gn;var vs=t;return vs})}).call(t,i(4)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t){function i(e){throw new Error("Cannot find module '"+e+"'.")}i.keys=function(){return[]},i.resolve=i,e.exports=i,i.id=5},function(e,t){(function(t){function i(e,t,i){var o=t&&i||0,n=0;for(t=t||[],e.toLowerCase().replace(/[0-9a-f]{2}/g,function(e){n<16&&(t[o+n++]=c[e])});n<16;)t[o+n++]=0;return t}function o(e,t){var i=t||0,o=l;return o[e[i++]]+o[e[i++]]+o[e[i++]]+o[e[i++]]+"-"+o[e[i++]]+o[e[i++]]+"-"+o[e[i++]]+o[e[i++]]+"-"+o[e[i++]]+o[e[i++]]+"-"+o[e[i++]]+o[e[i++]]+o[e[i++]]+o[e[i++]]+o[e[i++]]+o[e[i++]]}function n(e,t,i){var n=t&&i||0,s=t||[];e=e||{};var r=void 0!==e.clockseq?e.clockseq:v,a=void 0!==e.msecs?e.msecs:(new Date).getTime(),h=void 0!==e.nsecs?e.nsecs:g+1,d=a-y+(h-g)/1e4;if(d<0&&void 0===e.clockseq&&(r=r+1&16383),(d<0||a>y)&&void 0===e.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");y=a,g=h,v=r,a+=122192928e5;var l=(1e4*(268435455&a)+h)%4294967296;s[n++]=l>>>24&255,s[n++]=l>>>16&255,s[n++]=l>>>8&255,s[n++]=255&l; -var c=a/4294967296*1e4&268435455;s[n++]=c>>>8&255,s[n++]=255&c,s[n++]=c>>>24&15|16,s[n++]=c>>>16&255,s[n++]=r>>>8|128,s[n++]=255&r;for(var u=e.node||p,f=0;f<6;f++)s[n+f]=u[f];return t?t:o(s)}function s(e,t,i){var n=t&&i||0;"string"==typeof e&&(t="binary"==e?new Array(16):null,e=null),e=e||{};var s=e.random||(e.rng||r)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t)for(var a=0;a<16;a++)t[n+a]=s[a];return t||o(s)}var r,a="undefined"!=typeof window?window:"undefined"!=typeof t?t:null;if(a&&a.crypto&&crypto.getRandomValues){var h=new Uint8Array(16);r=function(){return crypto.getRandomValues(h),h}}if(!r){var d=new Array(16);r=function(){for(var e,t=0;t<16;t++)0===(3&t)&&(e=4294967296*Math.random()),d[t]=e>>>((3&t)<<3)&255;return d}}for(var l=[],c={},u=0;u<256;u++)l[u]=(u+256).toString(16).substr(1),c[l[u]]=u;var f=r(),p=[1|f[0],f[1],f[2],f[3],f[4],f[5]],v=16383&(f[6]<<8|f[7]),y=0,g=0,b=s;b.v1=n,b.v4=s,b.parse=i,b.unparse=o,e.exports=b}).call(t,function(){return this}())},function(e,t){t.prepareElements=function(e){for(var t in e)e.hasOwnProperty(t)&&(e[t].redundant=e[t].used,e[t].used=[])},t.cleanupElements=function(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t].redundant){for(var i=0;i0?(o=t[e].redundant[0],t[e].redundant.shift()):(o=document.createElementNS("http://www.w3.org/2000/svg",e),i.appendChild(o)):(o=document.createElementNS("http://www.w3.org/2000/svg",e),t[e]={used:[],redundant:[]},i.appendChild(o)),t[e].used.push(o),o},t.getDOMElement=function(e,t,i,o){var n;return t.hasOwnProperty(e)?t[e].redundant.length>0?(n=t[e].redundant[0],t[e].redundant.shift()):(n=document.createElement(e),void 0!==o?i.insertBefore(n,o):i.appendChild(n)):(n=document.createElement(e),t[e]={used:[],redundant:[]},void 0!==o?i.insertBefore(n,o):i.appendChild(n)),t[e].used.push(n),n},t.drawPoint=function(e,i,o,n,s,r){var a;if("circle"==o.style?(a=t.getSVGElement("circle",n,s),a.setAttributeNS(null,"cx",e),a.setAttributeNS(null,"cy",i),a.setAttributeNS(null,"r",.5*o.size)):(a=t.getSVGElement("rect",n,s),a.setAttributeNS(null,"x",e-.5*o.size),a.setAttributeNS(null,"y",i-.5*o.size),a.setAttributeNS(null,"width",o.size),a.setAttributeNS(null,"height",o.size)),void 0!==o.styles&&a.setAttributeNS(null,"style",o.styles),a.setAttributeNS(null,"class",o.className+" vis-point"),r){var h=t.getSVGElement("text",n,s);r.xOffset&&(e+=r.xOffset),r.yOffset&&(i+=r.yOffset),r.content&&(h.textContent=r.content),r.className&&h.setAttributeNS(null,"class",r.className+" vis-label"),h.setAttributeNS(null,"x",e),h.setAttributeNS(null,"y",i)}return a},t.drawBar=function(e,i,o,n,s,r,a,h){if(0!=n){n<0&&(n*=-1,i-=n);var d=t.getSVGElement("rect",r,a);d.setAttributeNS(null,"x",e-.5*o),d.setAttributeNS(null,"y",i),d.setAttributeNS(null,"width",o),d.setAttributeNS(null,"height",n),d.setAttributeNS(null,"class",s),h&&d.setAttributeNS(null,"style",h)}}},function(e,t,i){function o(e,t){if(e&&!Array.isArray(e)&&(t=e,e=null),this._options=t||{},this._data={},this.length=0,this._fieldId=this._options.fieldId||"id",this._type={},this._options.type)for(var i=Object.keys(this._options.type),o=0,n=i.length;on?1:or)&&(s=h,r=d)}return s},o.prototype.min=function(e){var t,i,o=this._data,n=Object.keys(o),s=null,r=null;for(t=0,i=n.length;tthis.max&&this.flush(),clearTimeout(this._timeout),this.queue.length>0&&"number"==typeof this.delay){var e=this;this._timeout=setTimeout(function(){e.flush()},this.delay)}},i.prototype.flush=function(){for(;this._queue.length>0;){var e=this._queue.shift();e.fn.apply(e.context||e.fn,e.args||[])}},e.exports=i},function(e,t,i){function o(e,t){this._data=null,this._ids={},this.length=0,this._options=t||{},this._fieldId="id",this._subscribers={};var i=this;this.listener=function(){i._onEvent.apply(i,arguments)},this.setData(e)}var n=i(1),s=i(8);o.prototype.setData=function(e){var t,i,o,n,s;if(this._data){for(this._data.off&&this._data.off("*",this.listener),t=this._data.getIds({filter:this._options&&this._options.filter}),s=[],o=0,n=t.length;o0){var i=this.groupIndex%this.groupsArray.length;this.groupIndex++,t={},t.color=this.groups[this.groupsArray[i]],this.groups[e]=t}else{var o=this.defaultIndex%this.defaultGroups.length;this.defaultIndex++,t={},t.color=this.defaultGroups[o],this.groups[e]=t}return t}},{key:"add",value:function(e,t){return this.groups[e]=t,this.groupsArray.push(e),t}}]),e}();t.default=r},function(e,t,i){function o(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var i=0;i1&&void 0!==arguments[1]&&arguments[1],o=this.body.data.nodes;if(e instanceof c||e instanceof u)this.body.data.nodes=e;else if(Array.isArray(e))this.body.data.nodes=new c,this.body.data.nodes.add(e);else{if(e)throw new TypeError("Array or DataSet expected");this.body.data.nodes=new c}o&&l.forEach(this.nodesListeners,function(e,t){o.off(t,e)}),this.body.nodes={},this.body.data.nodes&&!function(){var e=t;l.forEach(t.nodesListeners,function(t,i){e.body.data.nodes.on(i,t)});var i=t.body.data.nodes.getIds();t.add(i,!0)}(),i===!1&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=void 0,o=[],n=0;n1&&void 0!==arguments[1]?arguments[1]:a.default;return new t(e,this.body,this.images,this.groups,this.options)}},{key:"refresh",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.body.nodes;for(var i in t){var o=void 0;t.hasOwnProperty(i)&&(o=t[i]);var n=this.body.data.nodes._data[i];void 0!==o&&void 0!==n&&(e===!0&&o.setOptions({x:null,y:null}),o.setOptions({fixed:!1}),o.setOptions(n))}}},{key:"getPositions",value:function(e){var t={};if(void 0!==e){if(Array.isArray(e)===!0){for(var i=0;ie.left&&this.shape.tope.top}},{key:"isBoundingBoxOverlappingWith",value:function(e){return this.shape.boundingBox.lefte.left&&this.shape.boundingBox.tope.top}}],[{key:"parseOptions",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=["color","font","fixed","shadow"];if(z.selectiveNotDeepExtend(n,e,t,i),z.mergeOptions(e,t,"shadow",i,o),void 0!==t.color&&null!==t.color){var s=z.parseColor(t.color);z.fillIfDefined(e.color,s)}else i===!0&&null===t.color&&(e.color=z.bridgeObject(o.color));void 0!==t.fixed&&null!==t.fixed&&("boolean"==typeof t.fixed?(e.fixed.x=t.fixed,e.fixed.y=t.fixed):(void 0!==t.fixed.x&&"boolean"==typeof t.fixed.x&&(e.fixed.x=t.fixed.x),void 0!==t.fixed.y&&"boolean"==typeof t.fixed.y&&(e.fixed.y=t.fixed.y))),void 0!==t.font&&null!==t.font?a.default.parseOptions(e.font,t):i===!0&&null===t.font&&(e.font=z.bridgeObject(o.font)),void 0!==t.scaling&&z.mergeOptions(e.scaling,t.scaling,"label",i,o.scaling)}}]),e}();t.default=R},function(e,t,i){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){var i=[],o=!0,n=!1,s=void 0;try{for(var r,a=e[Symbol.iterator]();!(o=(r=a.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){n=!0,s=e}finally{try{!o&&a.return&&a.return()}finally{if(n)throw s}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r=function(){function e(e,t){for(var i=0;i2&&void 0!==arguments[2]&&arguments[2];o(this,e),this.body=t,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(i),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=n}return r(e,[{key:"setOptions",value:function(t){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.nodeOptions=t,this.fontOptions=a.deepExtend({},t.font,!0),void 0!==t.label&&(this.labelDirty=!0),void 0!==t.font&&(e.parseOptions(this.fontOptions,t,i),"string"==typeof t.font?this.baseSize=this.fontOptions.size:"object"===s(t.font)&&void 0!==t.font.size&&(this.baseSize=t.font.size))}},{key:"draw",value:function(e,t,i,o){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"middle";if(void 0!==this.nodeOptions.label){var s=this.fontOptions.size*this.body.view.scale;this.nodeOptions.label&&s4&&void 0!==arguments[4]?arguments[4]:"middle",r=this.fontOptions.size,a=r*this.body.view.scale;a>=this.nodeOptions.scaling.label.maxVisible&&(r=Number(this.nodeOptions.scaling.label.maxVisible)/this.body.view.scale);var h=this.size.yLine,d=this._getColor(a),l=n(d,2),c=l[0],u=l[1],f=this._setAlignment(e,i,h,s),p=n(f,2);i=p[0],h=p[1],e.font=(t&&this.nodeOptions.labelHighlightBold?"bold ":"")+r+"px "+this.fontOptions.face,e.fillStyle=c,this.isEdgeLabel||"left"!==this.fontOptions.align?e.textAlign="center":(e.textAlign=this.fontOptions.align,i-=.5*this.size.width),this.fontOptions.strokeWidth>0&&(e.lineWidth=this.fontOptions.strokeWidth,e.strokeStyle=u,e.lineJoin="round");for(var v=0;v0&&e.strokeText(this.lines[v],i,h),e.fillText(this.lines[v],i,h),h+=r}},{key:"_setAlignment",value:function(e,t,i,o){if(this.isEdgeLabel&&"horizontal"!==this.fontOptions.align&&this.pointToSelf===!1){t=0,i=0;var n=2;"top"===this.fontOptions.align?(e.textBaseline="alphabetic",i-=2*n):"bottom"===this.fontOptions.align?(e.textBaseline="hanging",i+=2*n):e.textBaseline="middle"}else e.textBaseline=o;return[t,i]}},{key:"_getColor",value:function(e){var t=this.fontOptions.color||"#000000",i=this.fontOptions.strokeColor||"#ffffff";if(e<=this.nodeOptions.scaling.label.drawThreshold){var o=Math.max(0,Math.min(1,1-(this.nodeOptions.scaling.label.drawThreshold-e)));t=a.overrideOpacity(t,o),i=a.overrideOpacity(i,o)}return[t,i]}},{key:"getTextSize",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i={width:this._processLabel(e,t),height:this.fontOptions.size*this.lineCount,lineCount:this.lineCount};return i}},{key:"calculateLabelSize",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"middle";this.labelDirty===!0&&(this.size.width=this._processLabel(e,t)),this.size.height=this.fontOptions.size*this.lineCount,this.size.left=i-.5*this.size.width,this.size.top=o-.5*this.size.height,this.size.yLine=o+.5*(1-this.lineCount)*this.fontOptions.size,"hanging"===n&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4),this.labelDirty=!1}},{key:"_processLabel",value:function(e,t){var i=0,o=[""],n=0;if(void 0!==this.nodeOptions.label){o=String(this.nodeOptions.label).split("\n"),n=o.length,e.font=(t&&this.nodeOptions.labelHighlightBold?"bold ":"")+this.fontOptions.size+"px "+this.fontOptions.face,i=e.measureText(o[0]).width;for(var s=1;si?r:i}}return this.lines=o,this.lineCount=n,i}}],[{key:"parseOptions",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"==typeof t.font){var o=t.font.split(" ");e.size=o[0].replace("px",""),e.face=o[1],e.color=o[2]}else"object"===s(t.font)&&a.fillIfDefined(e,t.font,i);e.size=Number(e.size)}}]),e}();t.default=h},function(e,t,i){function o(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i0&&(this.enableBorderDashes(e),e.stroke(),this.disableBorderDashes(e)),e.restore(),this.updateBoundingBox(t,i,e,o),this.labelModule.draw(e,t,i,o)}},{key:"updateBoundingBox",value:function(e,t,i,o){this.resize(i,o),this.left=e-.5*this.width,this.top=t-.5*this.height;var n=this.options.shapeProperties.borderRadius;this.boundingBox.left=this.left-n,this.boundingBox.top=this.top-n,this.boundingBox.bottom=this.top+this.height+n,this.boundingBox.right=this.left+this.width+n}},{key:"distanceToBorder",value:function(e,t){this.resize(e);var i=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(t)),Math.abs(this.height/2/Math.sin(t)))+i}}]),t}(d.default);t.default=l},function(e,t){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var i=0;ithis.imageObj.height?(o=this.imageObj.width/this.imageObj.height,t=2*this.options.size*o||this.imageObj.width,i=2*this.options.size||this.imageObj.height):(o=this.imageObj.width&&this.imageObj.height?this.imageObj.height/this.imageObj.width:1,t=2*this.options.size,i=2*this.options.size*o):(t=this.imageObj.width,i=this.imageObj.height),this.width=t,this.height=i,this.radius=.5*this.width}}},{key:"_drawRawCircle",value:function(e,t,i,o,n,s){var r=this.options.borderWidth,a=this.options.borderWidthSelected||2*this.options.borderWidth,h=(o?a:r)/this.body.view.scale;e.lineWidth=Math.min(this.width,h),e.strokeStyle=o?this.options.color.highlight.border:n?this.options.color.hover.border:this.options.color.border,e.fillStyle=o?this.options.color.highlight.background:n?this.options.color.hover.background:this.options.color.background,e.circle(t,i,s),this.enableShadow(e),e.fill(),this.disableShadow(e),e.save(),h>0&&(this.enableBorderDashes(e),e.stroke(),this.disableBorderDashes(e)),e.restore()}},{key:"_drawImageAtPosition",value:function(e){if(0!=this.imageObj.width){e.globalAlpha=1,this.enableShadow(e);var t=this.imageObj.width/this.width/this.body.view.scale;if(t>2&&this.options.shapeProperties.interpolation===!0){var i=this.imageObj.width,o=this.imageObj.height,n=document.createElement("canvas");n.width=i,n.height=i;var s=n.getContext("2d");t*=.5,i*=.5,o*=.5,s.drawImage(this.imageObj,0,0,i,o);for(var r=0,a=1;t>2&&a<4;)s.drawImage(n,r,0,i,o,r+i,0,i/2,o/2),r+=i,t*=.5,i*=.5,o*=.5,a+=1;e.drawImage(n,r,0,i,o,this.left,this.top,this.width,this.height)}else e.drawImage(this.imageObj,this.left,this.top,this.width,this.height);this.disableShadow(e)}}},{key:"_drawImageLabel",value:function(e,t,i,o){var n,s=0;if(void 0!==this.height){s=.5*this.height;var r=this.labelModule.getTextSize(e);r.lineCount>=1&&(s+=r.height/2)}n=i+s,this.options.label&&(this.labelOffset=s),this.labelModule.draw(e,t,n,o,"hanging")}}]),t}(d.default);t.default=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i0&&(this.enableBorderDashes(e),e.stroke(),this.disableBorderDashes(e)),e.restore(),this.updateBoundingBox(t,i,e,o),this.labelModule.draw(e,t,i,o)}},{key:"updateBoundingBox",value:function(e,t,i,o){this.resize(i,o),this.left=e-.5*this.width,this.top=t-.5*this.height,this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(d.default);t.default=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i0&&(this.enableBorderDashes(e),e.stroke(),this.disableBorderDashes(e)),e.restore(),void 0!==this.options.label){var l=n+.5*this.height+3;this.labelModule.draw(e,o,l,s,"hanging")}this.updateBoundingBox(o,n)}},{key:"updateBoundingBox",value:function(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size,void 0!==this.options.label&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+3))}}]),t}(d.default);t.default=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i0&&(this.enableBorderDashes(e),e.stroke(),this.disableBorderDashes(e)),e.restore(),this.updateBoundingBox(t,i,e,o),this.labelModule.draw(e,t,i,o)}},{key:"updateBoundingBox",value:function(e,t,i,o){this.resize(i,o),this.left=e-.5*this.width,this.top=t-.5*this.height,this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width}},{key:"distanceToBorder",value:function(e,t){this.resize(e);var i=.5*this.width,o=.5*this.height,n=Math.sin(t)*i,s=Math.cos(t)*o;return i*o/Math.sqrt(n*n+s*s)}}]),t}(d.default);t.default=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i0){var i=5;this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+i)}}},{key:"_icon",value:function(e,t,i,o){var n=Number(this.options.icon.size);void 0!==this.options.icon.code?(e.font=(o?"bold ":"")+n+"px "+this.options.icon.face,e.fillStyle=this.options.icon.color||"black",e.textAlign="center",e.textBaseline="middle",this.enableShadow(e),e.fillText(this.options.icon.code,t,i),this.disableShadow(e)):console.error("When using the icon shape, you need to define the code in the icon options object. This can be done per node or globally.")}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(d.default);t.default=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i0&&(this.enableBorderDashes(e),e.stroke(),this.disableBorderDashes(e)),e.restore(),e.closePath()}this._drawImageAtPosition(e),this._drawImageLabel(e,t,i,o||n),this.updateBoundingBox(t,i)}},{key:"updateBoundingBox",value:function(e,t){this.resize(),this.left=e-this.width/2,this.top=t-this.height/2,this.boundingBox.top=this.top,this.boundingBox.left=this.left,this.boundingBox.right=this.left+this.width,this.boundingBox.bottom=this.top+this.height,void 0!==this.options.label&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset))}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(d.default);t.default=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;is.distance?console.log('%cUnknown option detected: "'+t+'" in '+e.printLocation(n.path,t,"")+"Perhaps it was misplaced? Matching option found at: "+e.printLocation(s.path,s.closestMatch,""),d):n.distance<=r?console.log('%cUnknown option detected: "'+t+'". Did you mean "'+n.closestMatch+'"?'+e.printLocation(n.path,t),d):console.log('%cUnknown option detected: "'+t+'". Did you mean one of these: '+e.print(Object.keys(i))+e.printLocation(o,t),d),a=!0}},{key:"findInOptions",value:function(t,i,o){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=1e9,a="",h=[],d=t.toLowerCase(),l=void 0;for(var c in i){var u=void 0;if(void 0!==i[c].__type__&&n===!0){var f=e.findInOptions(t,i[c],r.copyAndExtendArray(o,c));s>f.distance&&(a=f.closestMatch,h=f.path,s=f.distance,l=f.indexMatch)}else c.toLowerCase().indexOf(d)!==-1&&(l=c),u=e.levenshteinDistance(t,c),s>u&&(a=c,h=r.copyArray(o),s=u)}return{closestMatch:a,path:h,distance:s,indexMatch:l}}},{key:"printLocation",value:function(e,t){for(var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Problem value found at: \n",o="\n\n"+i+"options = {\n",n=0;n1&&void 0!==arguments[1]&&arguments[1],o=this.body.data.edges;if(e instanceof c||e instanceof u)this.body.data.edges=e;else if(Array.isArray(e))this.body.data.edges=new c,this.body.data.edges.add(e);else{if(e)throw new TypeError("Array or DataSet expected");this.body.data.edges=new c}if(o&&l.forEach(this.edgesListeners,function(e,t){o.off(t,e)}),this.body.edges={},this.body.data.edges){l.forEach(this.edgesListeners,function(e,i){t.body.data.edges.on(i,e)});var n=this.body.data.edges.getIds();this.add(n,!0)}i===!1&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.body.edges,o=this.body.data.edges,n=0;ni.shape.height?(r=i.x+.5*i.shape.width,a=i.y-h):(r=i.x+h,a=i.y-.5*i.shape.height),s=this._pointOnCircle(r,a,h,.125),this.labelModule.draw(e,s.x,s.y,n)}}}},{key:"isOverlappingWith",value:function(e){if(this.connected){var t=10,i=this.from.x,o=this.from.y,n=this.to.x,s=this.to.y,r=e.left,a=e.top,h=this.edgeType.getDistanceToEdge(i,o,n,s,r,a);return h0&&i<0)&&(o+=Math.PI),e.rotate(o)}},{key:"_pointOnCircle",value:function(e,t,i,o){var n=2*o*Math.PI;return{x:e+i*Math.cos(n),y:t-i*Math.sin(n)}}},{key:"select",value:function(){this.selected=!0}},{key:"unselect",value:function(){this.selected=!1}},{key:"cleanup",value:function(){return this.edgeType.cleanup()}}],[{key:"parseOptions",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=["arrowStrikethrough","id","from","hidden","hoverWidth","label","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","to","title","value","width"];if(g.selectiveDeepExtend(n,e,t,i),g.mergeOptions(e,t,"smooth",i,o),g.mergeOptions(e,t,"shadow",i,o),void 0!==t.dashes&&null!==t.dashes?e.dashes=t.dashes:i===!0&&null===t.dashes&&(e.dashes=Object.create(o.dashes)),void 0!==t.scaling&&null!==t.scaling?(void 0!==t.scaling.min&&(e.scaling.min=t.scaling.min),void 0!==t.scaling.max&&(e.scaling.max=t.scaling.max),g.mergeOptions(e.scaling,t.scaling,"label",i,o.scaling)):i===!0&&null===t.scaling&&(e.scaling=Object.create(o.scaling)),void 0!==t.arrows&&null!==t.arrows)if("string"==typeof t.arrows){var r=t.arrows.toLowerCase();e.arrows.to.enabled=r.indexOf("to")!=-1,e.arrows.middle.enabled=r.indexOf("middle")!=-1,e.arrows.from.enabled=r.indexOf("from")!=-1}else{if("object"!==s(t.arrows))throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+JSON.stringify(t.arrows));g.mergeOptions(e.arrows,t.arrows,"to",i,o.arrows),g.mergeOptions(e.arrows,t.arrows,"middle",i,o.arrows),g.mergeOptions(e.arrows,t.arrows,"from",i,o.arrows)}else i===!0&&null===t.arrows&&(e.arrows=Object.create(o.arrows));if(void 0!==t.color&&null!==t.color)if(e.color=g.deepExtend({},e.color,!0),g.isString(t.color))e.color.color=t.color,e.color.highlight=t.color,e.color.hover=t.color,e.color.inherit=!1;else{var a=!1;void 0!==t.color.color&&(e.color.color=t.color.color,a=!0),void 0!==t.color.highlight&&(e.color.highlight=t.color.highlight,a=!0),void 0!==t.color.hover&&(e.color.hover=t.color.hover,a=!0),void 0!==t.color.inherit&&(e.color.inherit=t.color.inherit),void 0!==t.color.opacity&&(e.color.opacity=Math.min(1,Math.max(0,t.color.opacity))),void 0===t.color.inherit&&a===!0&&(e.color.inherit=!1)}else i===!0&&null===t.color&&(e.color=g.bridgeObject(o.color));void 0!==t.font&&null!==t.font?h.default.parseOptions(e.font,t):i===!0&&null===t.font&&(e.font=g.bridgeObject(o.font))}}]),e}();t.default=b},function(e,t,i){function o(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){var i=[],o=!0,n=!1,s=void 0;try{for(var r,a=e[Symbol.iterator]();!(o=(r=a.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){n=!0,s=e}finally{try{!o&&a.return&&a.return()}finally{if(n)throw s}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),h=function(){function e(e,t){for(var i=0;iMath.abs(t)||this.options.smooth.forceDirection===!0||"horizontal"===this.options.smooth.forceDirection)&&"vertical"!==this.options.smooth.forceDirection?(o=this.from.y,s=this.to.y,i=this.from.x-r*e,n=this.to.x+r*e):(o=this.from.y-r*t,s=this.to.y+r*t,i=this.from.x,n=this.to.x),[{x:i,y:o},{x:n,y:s}]}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_findBorderPosition",value:function(e,t){return this._findBorderPositionBezier(e,t)}},{key:"_getDistanceToEdge",value:function(e,t,i,o,n,s){var r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:this._getViaCoordinates(),h=a(r,2),d=h[0],l=h[1];return this._getDistanceToBezierEdge(e,t,i,o,n,s,d,l)}},{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._getViaCoordinates(),i=a(t,2),o=i[0],n=i[1],s=e,r=[];r[0]=Math.pow(1-s,3),r[1]=3*s*Math.pow(1-s,2),r[2]=3*Math.pow(s,2)*(1-s),r[3]=Math.pow(s,3);var h=r[0]*this.fromPoint.x+r[1]*o.x+r[2]*n.x+r[3]*this.toPoint.x,d=r[0]*this.fromPoint.y+r[1]*o.y+r[2]*n.y+r[3]*this.toPoint.y;return{x:h,y:d}}}]),t}(l.default);t.default=c},function(e,t,i){function o(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i0&&(d=this._getDistanceToLine(p,v,u,f,n,s),h=d2&&void 0!==arguments[2]?arguments[2]:this._getViaCoordinates(),h=10,d=0,l=0,c=1,u=.2,f=this.to,p=!1;for(e.id===this.from.id&&(f=this.from,p=!0);l<=c&&d0&&(h=this._getDistanceToLine(f,p,c,u,n,s),a=ho.shape.height?(t=o.x+.5*o.shape.width,i=o.y-n):(t=o.x+n,i=o.y-.5*o.shape.height),[t,i,n]}},{key:"_pointOnCircle",value:function(e,t,i,o){var n=2*o*Math.PI;return{x:e+i*Math.cos(n),y:t-i*Math.sin(n)}}},{key:"_findBorderPositionCircle",value:function(e,t,i){for(var o=i.x,n=i.y,s=i.low,r=i.high,a=i.direction,h=10,d=0,l=this.options.selfReferenceSize,c=void 0,u=void 0,f=void 0,p=void 0,v=void 0,y=.05,g=.5*(s+r);s<=r&&d0?a>0?s=g:r=g:a>0?r=g:s=g,d++;return c.t=g,c}},{key:"getLineWidth",value:function(e,t){return e===!0?Math.max(this.selectionWidth,.3/this.body.view.scale):t===!0?Math.max(this.hoverWidth,.3/this.body.view.scale):Math.max(this.options.width,.3/this.body.view.scale)}},{key:"getColor",value:function(e,t,i){var o=this.options.color;if(o.inherit!==!1){if("both"===o.inherit&&this.from.id!==this.to.id){var n=e.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y),s=void 0,a=void 0;return s=this.from.options.color.highlight.border,a=this.to.options.color.highlight.border,this.from.selected===!1&&this.to.selected===!1?(s=r.overrideOpacity(this.from.options.color.border,this.options.color.opacity),a=r.overrideOpacity(this.to.options.color.border,this.options.color.opacity)):this.from.selected===!0&&this.to.selected===!1?a=this.to.options.color.border:this.from.selected===!1&&this.to.selected===!0&&(s=this.from.options.color.border),n.addColorStop(0,s),n.addColorStop(1,a),n}this.colorDirty===!0&&("to"===o.inherit?(this.color.highlight=this.to.options.color.highlight.border,this.color.hover=this.to.options.color.hover.border,this.color.color=r.overrideOpacity(this.to.options.color.border,o.opacity)):(this.color.highlight=this.from.options.color.highlight.border,this.color.hover=this.from.options.color.hover.border,this.color.color=r.overrideOpacity(this.from.options.color.border,o.opacity)))}else this.colorDirty===!0&&(this.color.highlight=o.highlight,this.color.hover=o.hover,this.color.color=r.overrideOpacity(o.color,o.opacity));return this.colorDirty=!1,t===!0?this.color.highlight:i===!0?this.color.hover:this.color.color}},{key:"_circle",value:function(e,t,i,o){this.enableShadow(e),e.beginPath(),e.arc(t,i,o,0,2*Math.PI,!1),e.stroke(),this.disableShadow(e)}},{key:"getDistanceToEdge",value:function(e,t,i,o,s,r,a){var h=0;if(this.from!=this.to)h=this._getDistanceToEdge(e,t,i,o,s,r,a);else{var d=this._getCircleData(),l=n(d,3),c=l[0],u=l[1],f=l[2],p=c-s,v=u-r;h=Math.abs(Math.sqrt(p*p+v*v)-f)}return this.labelModule.size.lefts&&this.labelModule.size.topr?0:h}},{key:"_getDistanceToLine",value:function(e,t,i,o,n,s){var r=i-e,a=o-t,h=r*r+a*a,d=((n-e)*r+(s-t)*a)/h;d>1?d=1:d<0&&(d=0);var l=e+d*r,c=t+d*a,u=l-n,f=c-s;return Math.sqrt(u*u+f*f)}},{key:"getArrowData",value:function(e,t,i,o,s){var r=void 0,a=void 0,h=void 0,d=void 0,l=void 0,c=void 0,u=void 0,f=this.getLineWidth(o,s);if("from"===t?(h=this.from,d=this.to,l=.1,c=this.options.arrows.from.scaleFactor,u=this.options.arrows.from.type):"to"===t?(h=this.to,d=this.from,l=-.1,c=this.options.arrows.to.scaleFactor,u=this.options.arrows.to.type):(h=this.to,d=this.from,c=this.options.arrows.middle.scaleFactor,u=this.options.arrows.middle.type),h!=d)if("middle"!==t)if(this.options.smooth.enabled===!0){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=this._getCircleData(e),y=n(v,3),g=y[0],b=y[1],m=y[2];"from"===t?(a=this.findBorderPosition(this.from,e,{x:g,y:b,low:.25,high:.6,direction:-1}),r=a.t*-2*Math.PI+1.5*Math.PI+.1*Math.PI):"to"===t?(a=this.findBorderPosition(this.from,e,{x:g,y:b,low:.6,high:1,direction:1}),r=a.t*-2*Math.PI+1.5*Math.PI-1.1*Math.PI):(a=this._pointOnCircle(g,b,m,.175),r=3.9269908169872414)}var _=15*c+3*f,w=a.x-.9*_*Math.cos(r),k=a.y-.9*_*Math.sin(r),x={x:w,y:k};return{point:a,core:x,angle:r,length:_,type:u}}},{key:"drawArrowHead",value:function(e,t,i,o){e.strokeStyle=this.getColor(e,t,i),e.fillStyle=e.strokeStyle,e.lineWidth=this.getLineWidth(t,i),o.type&&"circle"===o.type.toLowerCase()?e.circleEndpoint(o.point.x,o.point.y,o.angle,o.length):e.arrowEndpoint(o.point.x,o.point.y,o.angle,o.length),this.enableShadow(e),e.fill(),this.disableShadow(e)}},{key:"enableShadow",value:function(e){this.options.shadow.enabled===!0&&(e.shadowColor=this.options.shadow.color,e.shadowBlur=this.options.shadow.size,e.shadowOffsetX=this.options.shadow.x,e.shadowOffsetY=this.options.shadow.y)}},{key:"disableShadow",value:function(e){this.options.shadow.enabled===!0&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}}]),e}();t.default=a},function(e,t,i){function o(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){var i=[],o=!0,n=!1,s=void 0;try{for(var r,a=e[Symbol.iterator]();!(o=(r=a.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){n=!0,s=e}finally{try{!o&&a.return&&a.return()}finally{if(n)throw s}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),h=function(){function e(e,t){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:this.via,i=e,o=void 0,n=void 0;if(this.from===this.to){var s=this._getCircleData(this.from),r=a(s,3),h=r[0],d=r[1],l=r[2],c=2*Math.PI*(1-i);o=h+l*Math.sin(c),n=d+l-l*(1-Math.cos(c))}else o=Math.pow(1-i,2)*this.fromPoint.x+2*i*(1-i)*t.x+Math.pow(i,2)*this.toPoint.x,n=Math.pow(1-i,2)*this.fromPoint.y+2*i*(1-i)*t.y+Math.pow(i,2)*this.toPoint.y;return{x:o,y:n}}},{key:"_findBorderPosition",value:function(e,t){return this._findBorderPositionBezier(e,t,this.via)}},{key:"_getDistanceToEdge",value:function(e,t,i,o,n,s){return this._getDistanceToBezierEdge(e,t,i,o,n,s,this.via)}}]),t}(l.default);t.default=c},function(e,t,i){function o(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i=this.to.y?this.from.x<=this.to.x?(e=this.from.x+i*s,t=this.from.y-i*s):this.from.x>this.to.x&&(e=this.from.x-i*s,t=this.from.y-i*s):this.from.ythis.to.x&&(e=this.from.x-i*s,t=this.from.y+i*s)),"discrete"===o&&(e=nMath.abs(this.from.y-this.to.y)&&(this.from.y>=this.to.y?this.from.x<=this.to.x?(e=this.from.x+i*n,t=this.from.y-i*n):this.from.x>this.to.x&&(e=this.from.x-i*n,t=this.from.y-i*n):this.from.ythis.to.x&&(e=this.from.x-i*n,t=this.from.y+i*n)),"discrete"===o&&(t=sMath.abs(this.from.y-this.to.y)&&(e=this.from.x=this.to.y?this.from.x<=this.to.x?(e=this.from.x+i*s,t=this.from.y-i*s,e=this.to.xthis.to.x&&(e=this.from.x-i*s,t=this.from.y-i*s,e=this.to.x>e?this.to.x:e):this.from.ythis.to.x&&(e=this.from.x-i*s,t=this.from.y+i*s,e=this.to.x>e?this.to.x:e)):Math.abs(this.from.x-this.to.x)>Math.abs(this.from.y-this.to.y)&&(this.from.y>=this.to.y?this.from.x<=this.to.x?(e=this.from.x+i*n,t=this.from.y-i*n,t=this.to.y>t?this.to.y:t):this.from.x>this.to.x&&(e=this.from.x-i*n,t=this.from.y-i*n,t=this.to.y>t?this.to.y:t):this.from.ythis.to.x&&(e=this.from.x-i*n,t=this.from.y+i*n,t=this.to.y2&&void 0!==arguments[2]?arguments[2]:{};return this._findBorderPositionBezier(e,t,i.via)}},{key:"_getDistanceToEdge",value:function(e,t,i,o,n,s){var r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(e,t,i,o,n,s,r)}},{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._getViaCoordinates(),i=e,o=Math.pow(1-i,2)*this.fromPoint.x+2*i*(1-i)*t.x+Math.pow(i,2)*this.toPoint.x,n=Math.pow(1-i,2)*this.fromPoint.y+2*i*(1-i)*t.y+Math.pow(i,2)*this.toPoint.y;return{x:o,y:n}}}]),t}(d.default);t.default=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i0&&void 0!==arguments[0])||arguments[0];this.stabilized=!0,e===!0&&this._emitStabilized(),void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.viewFunction=void 0,e===!0&&this.body.emitter.emit("_stopRendering"))}},{key:"simulationStep",value:function(){var e=Date.now();this.physicsTick();var t=Date.now()-e;(t<.4*this.simulationInterval||this.runDoubleSpeed===!0)&&this.stabilized===!1&&(this.physicsTick(),this.runDoubleSpeed=!0),this.stabilized===!0&&this.stopSimulation()}},{key:"_emitStabilized",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.stabilizationIterations;(this.stabilizationIterations>1||this.startedStabilization===!0)&&setTimeout(function(){e.body.emitter.emit("stabilized",{iterations:t}),e.startedStabilization=!1,e.stabilizationIterations=0},0)}},{key:"physicsTick",value:function(){if(this.startedStabilization===!1&&(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0),this.stabilized===!1){if(this.adaptiveTimestep===!0&&this.adaptiveTimestepEnabled===!0){var e=1.2;this.adaptiveCounter%this.adaptiveInterval===0?(this.timestep=2*this.timestep,this.calculateForces(),this.moveNodes(),this.revert(),this.timestep=.5*this.timestep,this.calculateForces(),this.moveNodes(),this.calculateForces(),this.moveNodes(),this._evaluateStepQuality()===!0?this.timestep=e*this.timestep:this.timestep/es))return!1;return!0}},{key:"moveNodes",value:function(){for(var e=this.physicsBody.physicsNodeIndices,t=this.options.maxVelocity?this.options.maxVelocity:1e9,i=0,o=0,n=5,s=0;st?s[e].x>0?t:-t:s[e].x,i.x+=s[e].x*o}else n[e].x=0,s[e].x=0;if(i.options.fixed.y===!1){var h=this.modelOptions.damping*s[e].y,d=(n[e].y-h)/i.options.mass;s[e].y+=d*o,s[e].y=Math.abs(s[e].y)>t?s[e].y>0?t:-t:s[e].y,i.y+=s[e].y*o}else n[e].y=0,s[e].y=0;var l=Math.sqrt(Math.pow(s[e].x,2)+Math.pow(s[e].y,2));return l}},{key:"calculateForces",value:function(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve()}},{key:"_freezeNodes",value:function(){var e=this.body.nodes;for(var t in e)e.hasOwnProperty(t)&&e[t].x&&e[t].y&&(this.freezeCache[t]={x:e[t].options.fixed.x,y:e[t].options.fixed.y},e[t].options.fixed.x=!0,e[t].options.fixed.y=!0)}},{key:"_restoreFrozenNodes",value:function(){var e=this.body.nodes;for(var t in e)e.hasOwnProperty(t)&&void 0!==this.freezeCache[t]&&(e[t].options.fixed.x=this.freezeCache[t].x,e[t].options.fixed.y=this.freezeCache[t].y);this.freezeCache={}}},{key:"stabilize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.stabilization.iterations;return"number"!=typeof t&&(console.log("The stabilize method needs a numeric amount of iterations. Switching to default: ",this.options.stabilization.iterations),t=this.options.stabilization.iterations),0===this.physicsBody.physicsNodeIndices.length?void(this.ready=!0):(this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=t,this.options.stabilization.onlyDynamicEdges===!0&&this._freezeNodes(),this.stabilizationIterations=0,void setTimeout(function(){return e._stabilizationBatch()},0))}},{key:"_stabilizationBatch",value:function(){this.startedStabilization===!1&&(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0);for(var e=0;this.stabilized===!1&&e0){var e=void 0,t=this.body.nodes,i=this.physicsBody.physicsNodeIndices,o=i.length,n=this._formBarnesHutTree(t,i);this.barnesHutTree=n;for(var s=0;s0&&(this._getForceContribution(n.root.children.NW,e),this._getForceContribution(n.root.children.NE,e),this._getForceContribution(n.root.children.SW,e),this._getForceContribution(n.root.children.SE,e))}}},{key:"_getForceContribution",value:function(e,t){if(e.childrenCount>0){var i=void 0,o=void 0,n=void 0;i=e.centerOfMass.x-t.x,o=e.centerOfMass.y-t.y,n=Math.sqrt(i*i+o*o),n*e.calcSize>this.thetaInversed?this._calculateForces(n,i,o,t,e):4===e.childrenCount?(this._getForceContribution(e.children.NW,t),this._getForceContribution(e.children.NE,t),this._getForceContribution(e.children.SW,t),this._getForceContribution(e.children.SE,t)):e.children.data.id!=t.id&&this._calculateForces(n,i,o,t,e)}}},{key:"_calculateForces",value:function(e,t,i,o,n){0===e&&(e=.1,t=e),this.overlapAvoidanceFactor<1&&o.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*o.shape.radius,e-o.shape.radius));var s=this.options.gravitationalConstant*n.mass*o.options.mass/Math.pow(e,3),r=t*s,a=i*s;this.physicsBody.forces[o.id].x+=r,this.physicsBody.forces[o.id].y+=a}},{key:"_formBarnesHutTree",value:function(e,t){for(var i=void 0,o=t.length,n=e[t[0]].x,s=e[t[0]].y,r=e[t[0]].x,a=e[t[0]].y,h=1;h0&&(dr&&(r=d),la&&(a=l))}var c=Math.abs(r-n)-Math.abs(a-s);c>0?(s-=.5*c,a+=.5*c):(n+=.5*c,r-=.5*c);var u=1e-5,f=Math.max(u,Math.abs(r-n)),p=.5*f,v=.5*(n+r),y=.5*(s+a),g={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:v-p,maxX:v+p,minY:y-p,maxY:y+p},size:f,calcSize:1/f,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(g.root);for(var b=0;b0&&this._placeInTree(g.root,i);return g}},{key:"_updateBranchMass",value:function(e,t){var i=e.mass+t.options.mass,o=1/i;e.centerOfMass.x=e.centerOfMass.x*e.mass+t.x*t.options.mass,e.centerOfMass.x*=o,e.centerOfMass.y=e.centerOfMass.y*e.mass+t.y*t.options.mass,e.centerOfMass.y*=o,e.mass=i;var n=Math.max(Math.max(t.height,t.radius),t.width);e.maxWidth=e.maxWidtht.x?e.children.NW.range.maxY>t.y?this._placeInRegion(e,t,"NW"):this._placeInRegion(e,t,"SW"):e.children.NW.range.maxY>t.y?this._placeInRegion(e,t,"NE"):this._placeInRegion(e,t,"SE")}},{key:"_placeInRegion",value:function(e,t,i){switch(e.children[i].childrenCount){case 0:e.children[i].children.data=t,e.children[i].childrenCount=1,this._updateBranchMass(e.children[i],t);break;case 1:e.children[i].children.data.x===t.x&&e.children[i].children.data.y===t.y?(t.x+=this.seededRandom(),t.y+=this.seededRandom()):(this._splitBranch(e.children[i]),this._placeInTree(e.children[i],t));break;case 4:this._placeInTree(e.children[i],t)}}},{key:"_splitBranch",value:function(e){var t=null;1===e.childrenCount&&(t=e.children.data,e.mass=0,e.centerOfMass.x=0,e.centerOfMass.y=0),e.childrenCount=4,e.children.data=null,this._insertRegion(e,"NW"),this._insertRegion(e,"NE"),this._insertRegion(e,"SW"),this._insertRegion(e,"SE"),null!=t&&this._placeInTree(e,t)}},{key:"_insertRegion",value:function(e,t){var i=void 0,o=void 0,n=void 0,s=void 0,r=.5*e.size;switch(t){case"NW":i=e.range.minX,o=e.range.minX+r,n=e.range.minY,s=e.range.minY+r;break;case"NE":i=e.range.minX+r,o=e.range.maxX,n=e.range.minY,s=e.range.minY+r;break;case"SW":i=e.range.minX,o=e.range.minX+r,n=e.range.minY+r,s=e.range.maxY;break;case"SE":i=e.range.minX+r,o=e.range.maxX,n=e.range.minY+r,s=e.range.maxY}e.children[t]={centerOfMass:{x:0,y:0},mass:0,range:{minX:i,maxX:o,minY:n,maxY:s},size:.5*e.size,calcSize:2*e.calcSize,children:{data:null},maxWidth:0,level:e.level+1,childrenCount:0}}},{key:"_debug",value:function(e,t){void 0!==this.barnesHutTree&&(e.lineWidth=1,this._drawBranch(this.barnesHutTree.root,e,t))}},{key:"_drawBranch",value:function(e,t,i){void 0===i&&(i="#FF0000"),4===e.childrenCount&&(this._drawBranch(e.children.NW,t),this._drawBranch(e.children.NE,t),this._drawBranch(e.children.SE,t),this._drawBranch(e.children.SW,t)),t.strokeStyle=i,t.beginPath(),t.moveTo(e.range.minX,e.range.minY),t.lineTo(e.range.maxX,e.range.minY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.minY),t.lineTo(e.range.maxX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.maxY),t.lineTo(e.range.minX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.minX,e.range.maxY),t.lineTo(e.range.minX,e.range.minY),t.stroke()}}]),e}();t.default=n},function(e,t){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var i=0;i0){var s=n.edges.length+1,r=this.options.centralGravity*s*n.options.mass;o[n.id].x=t*r,o[n.id].y=i*r}}}]),t}(d.default);t.default=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r=function(){function e(e,t){for(var i=0;i=e&&i.push(n.id)}for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{},t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(void 0===e.joinCondition)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");e=this._checkOptions(e);for(var i={},o={},n=0;n2&&void 0!==arguments[2])||arguments[2];t=this._checkOptions(t);for(var o=[],n={},s=void 0,r=void 0,a=void 0,d=void 0,l=void 0,c=0;c0&&Object.keys(f).length>0&&v===!0&&o.push({nodes:u,edges:f})}}}for(var m=0;m1&&void 0!==arguments[1])||arguments[1];this.clusterByEdgeCount(1,e,t)}},{key:"clusterBridges",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.clusterByEdgeCount(2,e,t)}},{key:"clusterByConnection",value:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0===e)throw new Error("No nodeId supplied to clusterByConnection!");if(void 0===this.body.nodes[e])throw new Error("The nodeId given to clusterByConnection does not exist!");var o=this.body.nodes[e];t=this._checkOptions(t,o),void 0===t.clusterNodeProperties.x&&(t.clusterNodeProperties.x=o.x),void 0===t.clusterNodeProperties.y&&(t.clusterNodeProperties.y=o.y),void 0===t.clusterNodeProperties.fixed&&(t.clusterNodeProperties.fixed={},t.clusterNodeProperties.fixed.x=o.options.fixed.x,t.clusterNodeProperties.fixed.y=o.options.fixed.y);var n={},s={},r=o.id,a=h.default.cloneOptions(o);n[r]=o;for(var d=0;d-1&&(s[y.id]=y)}this._cluster(n,s,t,i)}},{key:"_createClusterEdges",value:function(e,t,i,o){for(var n=void 0,s=void 0,r=void 0,a=void 0,d=void 0,l=void 0,u=Object.keys(e),f=[],p=0;p0&&void 0!==arguments[0]?arguments[0]:{};return void 0===e.clusterEdgeProperties&&(e.clusterEdgeProperties={}),void 0===e.clusterNodeProperties&&(e.clusterNodeProperties={}),e}},{key:"_cluster",value:function(e,t,i){var o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(0!=Object.keys(e).length&&(1!=Object.keys(e).length||1==i.clusterNodeProperties.allowSingleNodeCluster)){for(var n in e)if(e.hasOwnProperty(n)&&void 0!==this.clusteredNodes[n])return;var s=c.deepExtend({},i.clusterNodeProperties);if(void 0!==i.processProperties){var r=[];for(var a in e)if(e.hasOwnProperty(a)){var d=h.default.cloneOptions(e[a]);r.push(d)}var u=[];for(var f in t)if(t.hasOwnProperty(f)&&"clusterEdge:"!==f.substr(0,12)){var p=h.default.cloneOptions(t[f],"edge");u.push(p)}if(s=i.processProperties(s,r,u),!s)throw new Error("The processProperties function does not return properties!")}void 0===s.id&&(s.id="cluster:"+c.randomUUID());var v=s.id;void 0===s.label&&(s.label="cluster");var y=void 0;void 0===s.x&&(y=this._getClusterPosition(e),s.x=y.x),void 0===s.y&&(void 0===y&&(y=this._getClusterPosition(e)),s.y=y.y),s.id=v;var g=this.body.functions.createNode(s,l.default);g.isCluster=!0,g.containedNodes=e,g.containedEdges=t,g.clusterEdgeProperties=i.clusterEdgeProperties,this.body.nodes[s.id]=g,this._createClusterEdges(e,t,s,i.clusterEdgeProperties);for(var b in t)if(t.hasOwnProperty(b)&&void 0!==this.body.edges[b]){var m=this.body.edges[b];this._backupEdgeOptions(m),m.setOptions({physics:!1,hidden:!0})}for(var _ in e)e.hasOwnProperty(_)&&(this.clusteredNodes[_]={clusterId:s.id,node:this.body.nodes[_]},this.body.nodes[_].setOptions({hidden:!0,physics:!1}));s.id=void 0,o===!0&&this.body.emitter.emit("_dataChanged")}}},{key:"_backupEdgeOptions",value:function(e){void 0===this.clusteredEdges[e.id]&&(this.clusteredEdges[e.id]={physics:e.options.physics,hidden:e.options.hidden})}},{key:"_restoreEdge",value:function(e){var t=this.clusteredEdges[e.id];void 0!==t&&(e.setOptions({physics:t.physics,hidden:t.hidden}),delete this.clusteredEdges[e.id])}},{key:"isCluster",value:function(e){return void 0!==this.body.nodes[e]?this.body.nodes[e].isCluster===!0:(console.log("Node does not exist."),!1)}},{key:"_getClusterPosition",value:function(e){for(var t=Object.keys(e),i=e[t[0]].x,o=e[t[0]].x,n=e[t[0]].y,s=e[t[0]].y,r=void 0,a=1;ao?r.x:o,n=r.ys?r.y:s;return{x:.5*(i+o),y:.5*(n+s)}}},{key:"openCluster",value:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0===e)throw new Error("No clusterNodeId supplied to openCluster.");if(void 0===this.body.nodes[e])throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(void 0===this.body.nodes[e].containedNodes)return void console.log("The node:"+e+" is not a cluster.");var o=this.body.nodes[e],n=o.containedNodes,s=o.containedEdges;if(void 0!==t&&void 0!==t.releaseFunction&&"function"==typeof t.releaseFunction){var r={},a={x:o.x,y:o.y};for(var d in n)if(n.hasOwnProperty(d)){var l=this.body.nodes[d];r[d]={x:l.x,y:l.y}}var u=t.releaseFunction(a,r);for(var f in n)if(n.hasOwnProperty(f)){var p=this.body.nodes[f];void 0!==u[f]&&(p.x=void 0===u[f].x?o.x:u[f].x,p.y=void 0===u[f].y?o.y:u[f].y)}}else for(var v in n)if(n.hasOwnProperty(v)){var y=this.body.nodes[v];y=n[v],y.options.fixed.x===!1&&(y.x=o.x),y.options.fixed.y===!1&&(y.y=o.y)}for(var g in n)if(n.hasOwnProperty(g)){var b=this.body.nodes[g];b.vx=o.vx,b.vy=o.vy,b.setOptions({hidden:!1,physics:!0}),delete this.clusteredNodes[g]}for(var m=[],_=0;_o&&(o=s.edges.length),e+=s.edges.length,t+=Math.pow(s.edges.length,2),i+=1}e/=i,t/=i;var r=t-Math.pow(e,2),a=Math.sqrt(r),h=Math.floor(e+2*a);return h>o&&(h=o),h}}]),e}();t.default=u},function(e,t,i){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:[],o=1e9,n=-1e9,s=1e9,r=-1e9;if(i.length>0)for(var a=0;at.shape.boundingBox.left&&(s=t.shape.boundingBox.left),rt.shape.boundingBox.top&&(o=t.shape.boundingBox.top),n1&&void 0!==arguments[1]?arguments[1]:[],o=1e9,n=-1e9,s=1e9,r=-1e9;if(i.length>0)for(var a=0;at.x&&(s=t.x),rt.y&&(o=t.y),n0,e.renderTimer=void 0}),this.body.emitter.on("destroy",function(){e.renderRequests=0,e.allowRedraw=!1,e.renderingActive=!1,e.requiresTimeout===!0?clearTimeout(e.renderTimer):cancelAnimationFrame(e.renderTimer),e.body.emitter.off()})}},{key:"setOptions",value:function(e){if(void 0!==e){var t=["hideEdgesOnDrag","hideNodesOnDrag"];s.selectiveDeepExtend(t,this.options,e)}}},{key:"_startRendering",value:function(){this.renderingActive===!0&&void 0===this.renderTimer&&(this.requiresTimeout===!0?this.renderTimer=window.setTimeout(this._renderStep.bind(this),this.simulationInterval):this.renderTimer=window.requestAnimationFrame(this._renderStep.bind(this)))}},{key:"_renderStep",value:function(){this.renderingActive===!0&&(this.renderTimer=void 0,this.requiresTimeout===!0&&this._startRendering(),this._redraw(),this.requiresTimeout===!1&&this._startRendering())}},{key:"redraw",value:function(){this.body.emitter.emit("setSize"),this._redraw()}},{key:"_requestRedraw",value:function(){var e=this;this.redrawRequested!==!0&&this.renderingActive===!1&&this.allowRedraw===!0&&(this.redrawRequested=!0,this.requiresTimeout===!0?window.setTimeout(function(){e._redraw(!1)},0):window.requestAnimationFrame(function(){e._redraw(!1)}))}},{key:"_redraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.allowRedraw===!0){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1;var t=this.canvas.frame.canvas.getContext("2d");0!==this.canvas.frame.canvas.width&&0!==this.canvas.frame.canvas.height||this.canvas.setSize(),this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1),t.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var i=this.canvas.frame.canvas.clientWidth,o=this.canvas.frame.canvas.clientHeight;if(t.clearRect(0,0,i,o),0===this.canvas.frame.clientWidth)return;t.save(),t.translate(this.body.view.translation.x,this.body.view.translation.y),t.scale(this.body.view.scale,this.body.view.scale),t.beginPath(),this.body.emitter.emit("beforeDrawing",t),t.closePath(),e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&this._drawEdges(t),(this.dragging===!1||this.dragging===!0&&this.options.hideNodesOnDrag===!1)&&this._drawNodes(t,e),t.beginPath(),this.body.emitter.emit("afterDrawing",t),t.closePath(),t.restore(),e===!0&&t.clearRect(0,0,i,o)}}},{key:"_resizeNodes",value:function(){var e=this.canvas.frame.canvas.getContext("2d");void 0===this.pixelRatio&&(this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)),e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0),e.save(),e.translate(this.body.view.translation.x,this.body.view.translation.y),e.scale(this.body.view.scale,this.body.view.scale);var t=this.body.nodes,i=void 0;for(var o in t)t.hasOwnProperty(o)&&(i=t[o],i.resize(e),i.updateBoundingBox(e,i.selected));e.restore()}},{key:"_drawNodes",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.body.nodes,o=this.body.nodeIndices,n=void 0,s=[],r=20,a=this.canvas.DOMtoCanvas({x:-r,y:-r}),h=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+r,y:this.canvas.frame.canvas.clientHeight+r}),d={top:a.y,left:a.x,bottom:h.y,right:h.x},l=0;l0&&void 0!==arguments[0]?arguments[0]:this.pixelRatio;this.initialized===!0&&(this.cameraState.previousWidth=this.frame.canvas.width/e,this.cameraState.previousHeight=this.frame.canvas.height/e,this.cameraState.scale=this.body.view.scale,this.cameraState.position=this.DOMtoCanvas({x:.5*this.frame.canvas.width/e,y:.5*this.frame.canvas.height/e}))}},{key:"_setCameraState",value:function(){if(void 0!==this.cameraState.scale&&0!==this.frame.canvas.clientWidth&&0!==this.frame.canvas.clientHeight&&0!==this.pixelRatio&&this.cameraState.previousWidth>0){var e=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,t=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight,i=this.cameraState.scale;1!=e&&1!=t?i=.5*this.cameraState.scale*(e+t):1!=e?i=this.cameraState.scale*e:1!=t&&(i=this.cameraState.scale*t),this.body.view.scale=i;var o=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),n={x:o.x-this.cameraState.position.x,y:o.y-this.cameraState.position.y};this.body.view.translation.x+=n.x*this.body.view.scale,this.body.view.translation.y+=n.y*this.body.view.scale}}},{key:"_prepareValue",value:function(e){if("number"==typeof e)return e+"px";if("string"==typeof e){if(e.indexOf("%")!==-1||e.indexOf("px")!==-1)return e;if(e.indexOf("%")===-1)return e+"px"}throw new Error("Could not use the value supplied for width or height:"+e)}},{key:"_create",value:function(){for(;this.body.container.hasChildNodes();)this.body.container.removeChild(this.body.container.firstChild);if(this.frame=document.createElement("div"),this.frame.className="vis-network",this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.tabIndex=900,this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas),this.frame.canvas.getContext){var e=this.frame.canvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1),this.frame.canvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{var t=document.createElement("DIV");t.style.color="red",t.style.fontWeight="bold",t.style.padding="10px",t.innerHTML="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(t)}this.body.container.appendChild(this.frame),this.body.view.scale=1,this.body.view.translation={x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight},this._bindHammer()}},{key:"_bindHammer",value:function(){var e=this;void 0!==this.hammer&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new s(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:s.DIRECTION_ALL}),r.onTouch(this.hammer,function(t){e.body.eventListeners.onTouch(t)}),this.hammer.on("tap",function(t){e.body.eventListeners.onTap(t)}),this.hammer.on("doubletap",function(t){e.body.eventListeners.onDoubleTap(t)}),this.hammer.on("press",function(t){e.body.eventListeners.onHold(t)}),this.hammer.on("panstart",function(t){e.body.eventListeners.onDragStart(t)}),this.hammer.on("panmove",function(t){e.body.eventListeners.onDrag(t)}),this.hammer.on("panend",function(t){e.body.eventListeners.onDragEnd(t)}),this.hammer.on("pinch",function(t){e.body.eventListeners.onPinch(t)}),this.frame.canvas.addEventListener("mousewheel",function(t){e.body.eventListeners.onMouseWheel(t)}),this.frame.canvas.addEventListener("DOMMouseScroll",function(t){e.body.eventListeners.onMouseWheel(t)}),this.frame.canvas.addEventListener("mousemove",function(t){e.body.eventListeners.onMouseMove(t)}),this.frame.canvas.addEventListener("contextmenu",function(t){e.body.eventListeners.onContext(t)}),this.hammerFrame=new s(this.frame),r.onRelease(this.hammerFrame,function(t){e.body.eventListeners.onRelease(t)})}},{key:"setSize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.width,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.height;e=this._prepareValue(e),t=this._prepareValue(t);var i=!1,o=this.frame.canvas.width,n=this.frame.canvas.height,s=this.frame.canvas.getContext("2d"),r=this.pixelRatio;return this.pixelRatio=(window.devicePixelRatio||1)/(s.webkitBackingStorePixelRatio||s.mozBackingStorePixelRatio||s.msBackingStorePixelRatio||s.oBackingStorePixelRatio||s.backingStorePixelRatio||1),e!=this.options.width||t!=this.options.height||this.frame.style.width!=e||this.frame.style.height!=t?(this._getCameraState(r),this.frame.style.width=e,this.frame.style.height=t,this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),this.options.width=e,this.options.height=t,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},i=!0):(this.frame.canvas.width==Math.round(this.frame.canvas.clientWidth*this.pixelRatio)&&this.frame.canvas.height==Math.round(this.frame.canvas.clientHeight*this.pixelRatio)||this._getCameraState(r),this.frame.canvas.width!=Math.round(this.frame.canvas.clientWidth*this.pixelRatio)&&(this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),i=!0),this.frame.canvas.height!=Math.round(this.frame.canvas.clientHeight*this.pixelRatio)&&(this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),i=!0)),i===!0&&(this.body.emitter.emit("resize",{width:Math.round(this.frame.canvas.width/this.pixelRatio),height:Math.round(this.frame.canvas.height/this.pixelRatio),oldWidth:Math.round(o/this.pixelRatio),oldHeight:Math.round(n/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,i}},{key:"_XconvertDOMtoCanvas",value:function(e){return(e-this.body.view.translation.x)/this.body.view.scale}},{key:"_XconvertCanvasToDOM",value:function(e){return e*this.body.view.scale+this.body.view.translation.x}},{key:"_YconvertDOMtoCanvas",value:function(e){return(e-this.body.view.translation.y)/this.body.view.scale}},{key:"_YconvertCanvasToDOM",value:function(e){return e*this.body.view.scale+this.body.view.translation.y}},{key:"canvasToDOM",value:function(e){return{x:this._XconvertCanvasToDOM(e.x),y:this._YconvertCanvasToDOM(e.y)}}},{key:"DOMtoCanvas",value:function(e){return{x:this._XconvertDOMtoCanvas(e.x),y:this._YconvertDOMtoCanvas(e.y)}}}]),e}();t.default=h},function(e,t,i){if("undefined"!=typeof window){var o=i(59),n=window.Hammer||i(60);e.exports=o(n,{preventDefault:"mouse"})}else e.exports=function(){throw Error("hammer.js is only available in a browser, not in node.js.")}},function(e,t,i){var o,n,s;!function(i){n=[],o=i,s="function"==typeof o?o.apply(t,n):o,!(void 0!==s&&(e.exports=s))}(function(){var e=null;return function t(i,o){function n(e){return e.match(/[^ ]+/g)}function s(t){if("hammer.input"!==t.type){if(t.srcEvent._handled||(t.srcEvent._handled={}),t.srcEvent._handled[t.type])return;t.srcEvent._handled[t.type]=!0}var i=!1;t.stopPropagation=function(){i=!0};var o=t.srcEvent.stopPropagation.bind(t.srcEvent);"function"==typeof o&&(t.srcEvent.stopPropagation=function(){o(),t.stopPropagation()}),t.firstTarget=e;for(var n=e;n&&!i;){var s=n.hammer;if(s)for(var r,a=0;a0?d._handlers[e]=o:(i.off(e,s),delete d._handlers[e]))}),d},d.emit=function(t,o){e=o.target,i.emit(t,o)},d.destroy=function(){var e=i.element.hammer,t=e.indexOf(d);t!==-1&&e.splice(t,1),e.length||delete i.element.hammer,d._handlers={},i.destroy()},d}})},function(e,t,i){var o;/*! Hammer.JS - v2.0.7 - 2016-04-22 +"use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.vis=e():t.vis=e()}(this,function(){return function(t){function e(o){if(i[o])return i[o].exports;var n=i[o]={exports:{},id:o,loaded:!1};return t[o].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){e.util=i(1),e.DOMutil=i(89),e.DataSet=i(90),e.DataView=i(92),e.Queue=i(91),e.Network=i(93),e.network={Images:i(94),dotparser:i(177),gephiParser:i(178),allOptions:i(172)},e.network.convertDot=function(t){return e.network.dotparser.DOTToGraph(t)},e.network.convertGephi=function(t,i){return e.network.gephiParser.parseGephi(t,i)},e.moment=i(84),e.Hammer=i(158),e.keycharm=i(165)},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}var n=i(2),s=o(n),r=i(55),a=o(r),d=i(58),h=o(d),l=i(62),u=o(l),c=i(82),f=o(c),p=i(84),v=i(88);e.isNumber=function(t){return t instanceof Number||"number"==typeof t},e.elementsCensor=function(t){if(t){var e=function(t,e){return e instanceof Element?"DOM Element":e};return JSON.parse((0,f.default)(t,e))}},e.recursiveDOMDelete=function(t){if(t)for(;t.hasChildNodes()===!0;)e.recursiveDOMDelete(t.firstChild),t.removeChild(t.firstChild)},e.giveRange=function(t,e,i,o){if(e==t)return.5;var n=1/(e-t);return Math.max(0,(o-t)*n)},e.isString=function(t){return t instanceof String||"string"==typeof t},e.isDate=function(t){if(t instanceof Date)return!0;if(e.isString(t)){var i=g.exec(t);if(i)return!0;if(!isNaN(Date.parse(t)))return!0}return!1},e.randomUUID=function(){return v.v4()},e.assignAllKeys=function(t,e){for(var i in t)t.hasOwnProperty(i)&&"object"!==(0,u.default)(t[i])&&(t[i]=e)},e.fillIfDefined=function(t,i){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(var n in t)void 0!==i[n]&&("object"!==(0,u.default)(i[n])?void 0!==i[n]&&null!==i[n]||void 0===t[n]||o!==!0?t[n]=i[n]:delete t[n]:"object"===(0,u.default)(t[n])&&e.fillIfDefined(t[n],i[n],o))},e.protoExtend=function(t,e){for(var i=1;i3&&void 0!==arguments[3]&&arguments[3];if(Array.isArray(o))throw new TypeError("Arrays are not supported by deepExtend");for(var s=2;s3&&void 0!==arguments[3]&&arguments[3];if(Array.isArray(o))throw new TypeError("Arrays are not supported by deepExtend");for(var s in o)if(o.hasOwnProperty(s)&&t.indexOf(s)==-1)if(o[s]&&o[s].constructor===Object)void 0===i[s]&&(i[s]={}),i[s].constructor===Object?e.deepExtend(i[s],o[s]):null===o[s]&&void 0!==i[s]&&n===!0?delete i[s]:i[s]=o[s];else if(Array.isArray(o[s])){i[s]=[];for(var r=0;r=0&&(e="DOMMouseScroll"),t.addEventListener(e,i,o)):t.attachEvent("on"+e,i)},e.removeEventListener=function(t,e,i,o){t.removeEventListener?(void 0===o&&(o=!1),"mousewheel"===e&&navigator.userAgent.indexOf("Firefox")>=0&&(e="DOMMouseScroll"),t.removeEventListener(e,i,o)):t.detachEvent("on"+e,i)},e.preventDefault=function(t){t||(t=window.event),t.preventDefault?t.preventDefault():t.returnValue=!1},e.getTarget=function(t){t||(t=window.event);var e;return t.target?e=t.target:t.srcElement&&(e=t.srcElement),void 0!=e.nodeType&&3==e.nodeType&&(e=e.parentNode),e},e.hasParent=function(t,e){for(var i=t;i;){if(i===e)return!0;i=i.parentNode}return!1},e.option={},e.option.asBoolean=function(t,e){return"function"==typeof t&&(t=t()),null!=t?0!=t:e||null},e.option.asNumber=function(t,e){return"function"==typeof t&&(t=t()),null!=t?Number(t)||e||null:e||null},e.option.asString=function(t,e){return"function"==typeof t&&(t=t()),null!=t?String(t):e||null},e.option.asSize=function(t,i){return"function"==typeof t&&(t=t()),e.isString(t)?t:e.isNumber(t)?t+"px":i||null},e.option.asElement=function(t,e){return"function"==typeof t&&(t=t()),t||e||null},e.hexToRGB=function(t){var e=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;t=t.replace(e,function(t,e,i,o){return e+e+i+i+o+o});var i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return i?{r:parseInt(i[1],16),g:parseInt(i[2],16),b:parseInt(i[3],16)}:null},e.overrideOpacity=function(t,i){if(t.indexOf("rgba")!=-1)return t;if(t.indexOf("rgb")!=-1){var o=t.substr(t.indexOf("(")+1).replace(")","").split(",");return"rgba("+o[0]+","+o[1]+","+o[2]+","+i+")"}var o=e.hexToRGB(t);return null==o?t:"rgba("+o.r+","+o.g+","+o.b+","+i+")"},e.RGBToHex=function(t,e,i){return"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1)},e.parseColor=function(t){var i;if(e.isString(t)===!0){if(e.isValidRGB(t)===!0){var o=t.substr(4).substr(0,t.length-5).split(",").map(function(t){return parseInt(t)});t=e.RGBToHex(o[0],o[1],o[2])}if(e.isValidHex(t)===!0){var n=e.hexToHSV(t),s={h:n.h,s:.8*n.s,v:Math.min(1,1.02*n.v)},r={h:n.h,s:Math.min(1,1.25*n.s),v:.8*n.v},a=e.HSVToHex(r.h,r.s,r.v),d=e.HSVToHex(s.h,s.s,s.v);i={background:t,border:a,highlight:{background:d,border:a},hover:{background:d,border:a}}}else i={background:t,border:t,highlight:{background:t,border:t},hover:{background:t,border:t}}}else i={},i.background=t.background||void 0,i.border=t.border||void 0,e.isString(t.highlight)?i.highlight={border:t.highlight,background:t.highlight}:(i.highlight={},i.highlight.background=t.highlight&&t.highlight.background||void 0,i.highlight.border=t.highlight&&t.highlight.border||void 0),e.isString(t.hover)?i.hover={border:t.hover,background:t.hover}:(i.hover={},i.hover.background=t.hover&&t.hover.background||void 0,i.hover.border=t.hover&&t.hover.border||void 0);return i},e.RGBToHSV=function(t,e,i){t/=255,e/=255,i/=255;var o=Math.min(t,Math.min(e,i)),n=Math.max(t,Math.max(e,i));if(o==n)return{h:0,s:0,v:o};var s=t==o?e-i:i==o?t-e:i-t,r=t==o?3:i==o?1:5,a=60*(r-s/(n-o))/360,d=(n-o)/n,h=n;return{h:a,s:d,v:h}};var y={split:function(t){var e={};return t.split(";").forEach(function(t){if(""!=t.trim()){var i=t.split(":"),o=i[0].trim(),n=i[1].trim();e[o]=n}}),e},join:function(t){return(0,h.default)(t).map(function(e){return e+": "+t[e]}).join("; ")}};e.addCssText=function(t,i){var o=y.split(t.style.cssText),n=y.split(i),s=e.extend(o,n);t.style.cssText=y.join(s)},e.removeCssText=function(t,e){var i=y.split(t.style.cssText),o=y.split(e);for(var n in o)o.hasOwnProperty(n)&&delete i[n];t.style.cssText=y.join(i)},e.HSVToRGB=function(t,e,i){var o,n,s,r=Math.floor(6*t),a=6*t-r,d=i*(1-e),h=i*(1-a*e),l=i*(1-(1-a)*e);switch(r%6){case 0:o=i,n=l,s=d;break;case 1:o=h,n=i,s=d;break;case 2:o=d,n=i,s=l;break;case 3:o=d,n=h,s=i;break;case 4:o=l,n=d,s=i;break;case 5:o=i,n=d,s=h}return{r:Math.floor(255*o),g:Math.floor(255*n),b:Math.floor(255*s)}},e.HSVToHex=function(t,i,o){var n=e.HSVToRGB(t,i,o);return e.RGBToHex(n.r,n.g,n.b)},e.hexToHSV=function(t){var i=e.hexToRGB(t);return e.RGBToHSV(i.r,i.g,i.b)},e.isValidHex=function(t){var e=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t);return e},e.isValidRGB=function(t){t=t.replace(" ","");var e=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/i.test(t);return e},e.isValidRGBA=function(t){t=t.replace(" ","");var e=/rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(.{1,3})\)/i.test(t);return e},e.selectiveBridgeObject=function(t,i){if("object"==("undefined"==typeof i?"undefined":(0,u.default)(i))){for(var o=(0,a.default)(i),n=0;n0&&e(o,t[n-1])<0;n--)t[n]=t[n-1];t[n]=o}return t},e.mergeOptions=function(t,e,i){var o=(arguments.length>3&&void 0!==arguments[3]&&arguments[3],arguments.length>4&&void 0!==arguments[4]?arguments[4]:{});if(null===e[i])t[i]=(0,a.default)(o[i]);else if(void 0!==e[i])if("boolean"==typeof e[i])t[i].enabled=e[i];else{void 0===e[i].enabled&&(t[i].enabled=!0);for(var n in e[i])e[i].hasOwnProperty(n)&&(t[i][n]=e[i][n])}},e.binarySearchCustom=function(t,e,i,o){for(var n=1e4,s=0,r=0,a=t.length-1;r<=a&&s0)return"before"==o?Math.max(0,d-1):d;if(n(r,e)<0&&n(a,e)>0)return"before"==o?d:Math.min(t.length-1,d+1);n(r,e)<0?u=d+1:c=d-1,l++}return-1},e.easingFunctions={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return t*(2-t)},easeInOutQuad:function(t){return t<.5?2*t*t:-1+(4-2*t)*t},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return--t*t*t+1},easeInOutCubic:function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return 1- --t*t*t*t},easeInOutQuart:function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return 1+--t*t*t*t*t},easeInOutQuint:function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t}},e.getScrollBarWidth=function(){var t=document.createElement("p");t.style.width="100%",t.style.height="200px";var e=document.createElement("div");e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.visibility="hidden",e.style.width="200px",e.style.height="150px",e.style.overflow="hidden",e.appendChild(t),document.body.appendChild(e);var i=t.offsetWidth;e.style.overflow="scroll";var o=t.offsetWidth;return i==o&&(o=e.clientWidth),document.body.removeChild(e),i-o},e.topMost=function(t,e){var i=void 0;Array.isArray(e)||(e=[e]);var o=!0,n=!1,r=void 0;try{for(var a,d=(0,s.default)(t);!(o=(a=d.next()).done);o=!0){var h=a.value;if(h){i=h[e[0]];for(var l=1;l=t.length?(this._t=void 0,n(1)):"keys"==e?n(0,i):"values"==e?n(0,t[i]):n(0,[i,t[i]])},"values"),s.Arguments=s.Array,o("keys"),o("values"),o("entries")},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e){t.exports={}},function(t,e,i){var o=i(10),n=i(12);t.exports=function(t){return o(n(t))}},function(t,e,i){var o=i(11);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==o(t)?t.split(""):Object(t)}},function(t,e){var i={}.toString;t.exports=function(t){return i.call(t).slice(8,-1)}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,i){var o=i(14),n=i(15),s=i(30),r=i(20),a=i(31),d=i(8),h=i(32),l=i(46),u=i(48),c=i(47)("iterator"),f=!([].keys&&"next"in[].keys()),p="@@iterator",v="keys",g="values",y=function(){return this};t.exports=function(t,e,i,m,b,_,w){h(i,e,m);var k,x,O,M=function(t){if(!f&&t in C)return C[t];switch(t){case v:return function(){return new i(this,t)};case g:return function(){return new i(this,t)}}return function(){return new i(this,t)}},S=e+" Iterator",E=b==g,D=!1,C=t.prototype,T=C[c]||C[p]||b&&C[b],P=T||M(b),B=b?E?M("entries"):P:void 0,F="Array"==e?C.entries||T:T;if(F&&(O=u(F.call(new t)),O!==Object.prototype&&(l(O,S,!0),o||a(O,c)||r(O,c,y))),E&&T&&T.name!==g&&(D=!0,P=function(){return T.call(this)}),o&&!w||!f&&!D&&C[c]||r(C,c,P),d[e]=P,d[S]=y,b)if(k={values:E?P:M(g),keys:_?P:M(v),entries:B},w)for(x in k)x in C||s(C,x,k[x]);else n(n.P+n.F*(f||D),e,k);return k}},function(t,e){t.exports=!0},function(t,e,i){var o=i(16),n=i(17),s=i(18),r=i(20),a="prototype",d=function(t,e,i){var h,l,u,c=t&d.F,f=t&d.G,p=t&d.S,v=t&d.P,g=t&d.B,y=t&d.W,m=f?n:n[e]||(n[e]={}),b=m[a],_=f?o:p?o[e]:(o[e]||{})[a];f&&(i=e);for(h in i)l=!c&&_&&void 0!==_[h],l&&h in m||(u=l?_[h]:i[h],m[h]=f&&"function"!=typeof _[h]?i[h]:g&&l?s(u,o):y&&_[h]==u?function(t){var e=function(e,i,o){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,i)}return new t(e,i,o)}return t.apply(this,arguments)};return e[a]=t[a],e}(u):v&&"function"==typeof u?s(Function.call,u):u,v&&((m.virtual||(m.virtual={}))[h]=u,t&d.R&&b&&!b[h]&&r(b,h,u)))};d.F=1,d.G=2,d.S=4,d.P=8,d.B=16,d.W=32,d.U=64,d.R=128,t.exports=d},function(t,e){var i=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},function(t,e){var i=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=i)},function(t,e,i){var o=i(19);t.exports=function(t,e,i){if(o(t),void 0===e)return t;switch(i){case 1:return function(i){return t.call(e,i)};case 2:return function(i,o){return t.call(e,i,o)};case 3:return function(i,o,n){return t.call(e,i,o,n)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,i){var o=i(21),n=i(29);t.exports=i(25)?function(t,e,i){return o.f(t,e,n(1,i))}:function(t,e,i){return t[e]=i,t}},function(t,e,i){var o=i(22),n=i(24),s=i(28),r=Object.defineProperty;e.f=i(25)?Object.defineProperty:function(t,e,i){if(o(t),e=s(e,!0),o(i),n)try{return r(t,e,i)}catch(t){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(t[e]=i.value),t}},function(t,e,i){var o=i(23);t.exports=function(t){if(!o(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,i){t.exports=!i(25)&&!i(26)(function(){return 7!=Object.defineProperty(i(27)("div"),"a",{get:function(){return 7}}).a})},function(t,e,i){t.exports=!i(26)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,i){var o=i(23),n=i(16).document,s=o(n)&&o(n.createElement);t.exports=function(t){return s?n.createElement(t):{}}},function(t,e,i){var o=i(23);t.exports=function(t,e){if(!o(t))return t;var i,n;if(e&&"function"==typeof(i=t.toString)&&!o(n=i.call(t)))return n;if("function"==typeof(i=t.valueOf)&&!o(n=i.call(t)))return n;if(!e&&"function"==typeof(i=t.toString)&&!o(n=i.call(t)))return n;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,i){t.exports=i(20)},function(t,e){var i={}.hasOwnProperty;t.exports=function(t,e){return i.call(t,e)}},function(t,e,i){var o=i(33),n=i(29),s=i(46),r={};i(20)(r,i(47)("iterator"),function(){return this}),t.exports=function(t,e,i){t.prototype=o(r,{next:n(1,i)}),s(t,e+" Iterator")}},function(t,e,i){var o=i(22),n=i(34),s=i(44),r=i(41)("IE_PROTO"),a=function(){},d="prototype",h=function(){var t,e=i(27)("iframe"),o=s.length,n="<",r=">";for(e.style.display="none",i(45).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(n+"script"+r+"document.F=Object"+n+"/script"+r),t.close(),h=t.F;o--;)delete h[d][s[o]];return h()};t.exports=Object.create||function(t,e){var i;return null!==t?(a[d]=o(t),i=new a,a[d]=null,i[r]=t):i=h(),void 0===e?i:n(i,e)}},function(t,e,i){var o=i(21),n=i(22),s=i(35);t.exports=i(25)?Object.defineProperties:function(t,e){n(t);for(var i,r=s(e),a=r.length,d=0;a>d;)o.f(t,i=r[d++],e[i]);return t}},function(t,e,i){var o=i(36),n=i(44);t.exports=Object.keys||function(t){return o(t,n)}},function(t,e,i){var o=i(31),n=i(9),s=i(37)(!1),r=i(41)("IE_PROTO");t.exports=function(t,e){var i,a=n(t),d=0,h=[];for(i in a)i!=r&&o(a,i)&&h.push(i);for(;e.length>d;)o(a,i=e[d++])&&(~s(h,i)||h.push(i));return h}},function(t,e,i){var o=i(9),n=i(38),s=i(40);t.exports=function(t){return function(e,i,r){var a,d=o(e),h=n(d.length),l=s(r,h);if(t&&i!=i){for(;h>l;)if(a=d[l++],a!=a)return!0}else for(;h>l;l++)if((t||l in d)&&d[l]===i)return t||l||0;return!t&&-1}}},function(t,e,i){var o=i(39),n=Math.min;t.exports=function(t){return t>0?n(o(t),9007199254740991):0}},function(t,e){var i=Math.ceil,o=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?o:i)(t)}},function(t,e,i){var o=i(39),n=Math.max,s=Math.min;t.exports=function(t,e){return t=o(t),t<0?n(t+e,0):s(t,e)}},function(t,e,i){var o=i(42)("keys"),n=i(43);t.exports=function(t){return o[t]||(o[t]=n(t))}},function(t,e,i){var o=i(16),n="__core-js_shared__",s=o[n]||(o[n]={});t.exports=function(t){return s[t]||(s[t]={})}},function(t,e){var i=0,o=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++i+o).toString(36))}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,i){t.exports=i(16).document&&document.documentElement},function(t,e,i){var o=i(21).f,n=i(31),s=i(47)("toStringTag");t.exports=function(t,e,i){t&&!n(t=i?t:t.prototype,s)&&o(t,s,{configurable:!0,value:e})}},function(t,e,i){var o=i(42)("wks"),n=i(43),s=i(16).Symbol,r="function"==typeof s,a=t.exports=function(t){return o[t]||(o[t]=r&&s[t]||(r?s:n)("Symbol."+t))};a.store=o},function(t,e,i){var o=i(31),n=i(49),s=i(41)("IE_PROTO"),r=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=n(t),o(t,s)?t[s]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?r:null}},function(t,e,i){var o=i(12);t.exports=function(t){return Object(o(t))}},function(t,e,i){var o=i(51)(!0);i(13)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,i=this._i;return i>=e.length?{value:void 0,done:!0}:(t=o(e,i),this._i+=t.length,{value:t,done:!1})})},function(t,e,i){var o=i(39),n=i(12);t.exports=function(t){return function(e,i){var s,r,a=String(n(e)),d=o(i),h=a.length;return d<0||d>=h?t?"":void 0:(s=a.charCodeAt(d),s<55296||s>56319||d+1===h||(r=a.charCodeAt(d+1))<56320||r>57343?t?a.charAt(d):s:t?a.slice(d,d+2):(s-55296<<10)+(r-56320)+65536)}}},function(t,e,i){var o=i(22),n=i(53);t.exports=i(17).getIterator=function(t){var e=n(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return o(e.call(t))}},function(t,e,i){var o=i(54),n=i(47)("iterator"),s=i(8);t.exports=i(17).getIteratorMethod=function(t){if(void 0!=t)return t[n]||t["@@iterator"]||s[o(t)]}},function(t,e,i){var o=i(11),n=i(47)("toStringTag"),s="Arguments"==o(function(){return arguments}()),r=function(t,e){try{return t[e]}catch(t){}};t.exports=function(t){var e,i,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=r(e=Object(t),n))?i:s?o(e):"Object"==(a=o(e))&&"function"==typeof e.callee?"Arguments":a}},function(t,e,i){t.exports={default:i(56),__esModule:!0}},function(t,e,i){i(57);var o=i(17).Object;t.exports=function(t,e){return o.create(t,e)}},function(t,e,i){var o=i(15);o(o.S,"Object",{create:i(33)})},function(t,e,i){t.exports={default:i(59),__esModule:!0}},function(t,e,i){i(60),t.exports=i(17).Object.keys},function(t,e,i){var o=i(49),n=i(35);i(61)("keys",function(){return function(t){return n(o(t))}})},function(t,e,i){var o=i(15),n=i(17),s=i(26);t.exports=function(t,e){var i=(n.Object||{})[t]||Object[t],r={};r[t]=e(i),o(o.S+o.F*s(function(){i(1)}),"Object",r)}},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var n=i(63),s=o(n),r=i(66),a=o(r),d="function"==typeof a.default&&"symbol"==typeof s.default?function(t){return typeof t}:function(t){return t&&"function"==typeof a.default&&t.constructor===a.default&&t!==a.default.prototype?"symbol":typeof t};e.default="function"==typeof a.default&&"symbol"===d(s.default)?function(t){return"undefined"==typeof t?"undefined":d(t)}:function(t){return t&&"function"==typeof a.default&&t.constructor===a.default&&t!==a.default.prototype?"symbol":"undefined"==typeof t?"undefined":d(t)}},function(t,e,i){t.exports={default:i(64),__esModule:!0}},function(t,e,i){i(50),i(4),t.exports=i(65).f("iterator")},function(t,e,i){e.f=i(47)},function(t,e,i){t.exports={default:i(67),__esModule:!0}},function(t,e,i){i(68),i(79),i(80),i(81),t.exports=i(17).Symbol},function(t,e,i){var o=i(16),n=i(31),s=i(25),r=i(15),a=i(30),d=i(69).KEY,h=i(26),l=i(42),u=i(46),c=i(43),f=i(47),p=i(65),v=i(70),g=i(71),y=i(72),m=i(75),b=i(22),_=i(9),w=i(28),k=i(29),x=i(33),O=i(76),M=i(78),S=i(21),E=i(35),D=M.f,C=S.f,T=O.f,P=o.Symbol,B=o.JSON,F=B&&B.stringify,I="prototype",z=f("_hidden"),N=f("toPrimitive"),R={}.propertyIsEnumerable,A=l("symbol-registry"),j=l("symbols"),H=l("op-symbols"),L=Object[I],W="function"==typeof P,Y=o.QObject,U=!Y||!Y[I]||!Y[I].findChild,V=s&&h(function(){return 7!=x(C({},"a",{get:function(){return C(this,"a",{value:7}).a}})).a})?function(t,e,i){var o=D(L,e);o&&delete L[e],C(t,e,i),o&&t!==L&&C(L,e,o)}:C,q=function(t){var e=j[t]=x(P[I]);return e._k=t,e},G=W&&"symbol"==typeof P.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof P},X=function(t,e,i){return t===L&&X(H,e,i),b(t),e=w(e,!0),b(i),n(j,e)?(i.enumerable?(n(t,z)&&t[z][e]&&(t[z][e]=!1),i=x(i,{enumerable:k(0,!1)})):(n(t,z)||C(t,z,k(1,{})),t[z][e]=!0),V(t,e,i)):C(t,e,i)},K=function(t,e){b(t);for(var i,o=y(e=_(e)),n=0,s=o.length;s>n;)X(t,i=o[n++],e[i]);return t},Z=function(t,e){return void 0===e?x(t):K(x(t),e)},Q=function(t){var e=R.call(this,t=w(t,!0));return!(this===L&&n(j,t)&&!n(H,t))&&(!(e||!n(this,t)||!n(j,t)||n(this,z)&&this[z][t])||e)},J=function(t,e){if(t=_(t),e=w(e,!0),t!==L||!n(j,e)||n(H,e)){var i=D(t,e);return!i||!n(j,e)||n(t,z)&&t[z][e]||(i.enumerable=!0),i}},$=function(t){for(var e,i=T(_(t)),o=[],s=0;i.length>s;)n(j,e=i[s++])||e==z||e==d||o.push(e);return o},tt=function(t){for(var e,i=t===L,o=T(i?H:_(t)),s=[],r=0;o.length>r;)!n(j,e=o[r++])||i&&!n(L,e)||s.push(j[e]);return s};W||(P=function(){if(this instanceof P)throw TypeError("Symbol is not a constructor!");var t=c(arguments.length>0?arguments[0]:void 0),e=function(i){this===L&&e.call(H,i),n(this,z)&&n(this[z],t)&&(this[z][t]=!1),V(this,t,k(1,i))};return s&&U&&V(L,t,{configurable:!0,set:e}),q(t)},a(P[I],"toString",function(){return this._k}),M.f=J,S.f=X,i(77).f=O.f=$,i(74).f=Q,i(73).f=tt,s&&!i(14)&&a(L,"propertyIsEnumerable",Q,!0),p.f=function(t){return q(f(t))}),r(r.G+r.W+r.F*!W,{Symbol:P});for(var et="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),it=0;et.length>it;)f(et[it++]);for(var et=E(f.store),it=0;et.length>it;)v(et[it++]);r(r.S+r.F*!W,"Symbol",{for:function(t){return n(A,t+="")?A[t]:A[t]=P(t)},keyFor:function(t){if(G(t))return g(A,t);throw TypeError(t+" is not a symbol!")},useSetter:function(){U=!0},useSimple:function(){U=!1}}),r(r.S+r.F*!W,"Object",{create:Z,defineProperty:X,defineProperties:K,getOwnPropertyDescriptor:J,getOwnPropertyNames:$,getOwnPropertySymbols:tt}),B&&r(r.S+r.F*(!W||h(function(){var t=P();return"[null]"!=F([t])||"{}"!=F({a:t})||"{}"!=F(Object(t))})),"JSON",{stringify:function(t){if(void 0!==t&&!G(t)){for(var e,i,o=[t],n=1;arguments.length>n;)o.push(arguments[n++]);return e=o[1],"function"==typeof e&&(i=e),!i&&m(e)||(e=function(t,e){if(i&&(e=i.call(this,t,e)),!G(e))return e}),o[1]=e,F.apply(B,o)}}}),P[I][N]||i(20)(P[I],N,P[I].valueOf),u(P,"Symbol"),u(Math,"Math",!0),u(o.JSON,"JSON",!0)},function(t,e,i){var o=i(43)("meta"),n=i(23),s=i(31),r=i(21).f,a=0,d=Object.isExtensible||function(){return!0},h=!i(26)(function(){return d(Object.preventExtensions({}))}),l=function(t){r(t,o,{value:{i:"O"+ ++a,w:{}}})},u=function(t,e){if(!n(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!s(t,o)){if(!d(t))return"F";if(!e)return"E";l(t)}return t[o].i},c=function(t,e){if(!s(t,o)){if(!d(t))return!0;if(!e)return!1;l(t)}return t[o].w},f=function(t){return h&&p.NEED&&d(t)&&!s(t,o)&&l(t),t},p=t.exports={KEY:o,NEED:!1,fastKey:u,getWeak:c,onFreeze:f}},function(t,e,i){var o=i(16),n=i(17),s=i(14),r=i(65),a=i(21).f;t.exports=function(t){var e=n.Symbol||(n.Symbol=s?{}:o.Symbol||{});"_"==t.charAt(0)||t in e||a(e,t,{value:r.f(t)})}},function(t,e,i){var o=i(35),n=i(9);t.exports=function(t,e){for(var i,s=n(t),r=o(s),a=r.length,d=0;a>d;)if(s[i=r[d++]]===e)return i}},function(t,e,i){var o=i(35),n=i(73),s=i(74);t.exports=function(t){var e=o(t),i=n.f;if(i)for(var r,a=i(t),d=s.f,h=0;a.length>h;)d.call(t,r=a[h++])&&e.push(r);return e}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,i){var o=i(11);t.exports=Array.isArray||function(t){return"Array"==o(t)}},function(t,e,i){var o=i(9),n=i(77).f,s={}.toString,r="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(t){try{return n(t)}catch(t){return r.slice()}};t.exports.f=function(t){return r&&"[object Window]"==s.call(t)?a(t):n(o(t))}},function(t,e,i){var o=i(36),n=i(44).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return o(t,n)}},function(t,e,i){var o=i(74),n=i(29),s=i(9),r=i(28),a=i(31),d=i(24),h=Object.getOwnPropertyDescriptor;e.f=i(25)?h:function(t,e){if(t=s(t),e=r(e,!0),d)try{return h(t,e)}catch(t){}if(a(t,e))return n(!o.f.call(t,e),t[e])}},function(t,e){},function(t,e,i){i(70)("asyncIterator")},function(t,e,i){i(70)("observable")},function(t,e,i){t.exports={default:i(83),__esModule:!0}},function(t,e,i){var o=i(17),n=o.JSON||(o.JSON={stringify:JSON.stringify});t.exports=function(t){return n.stringify.apply(n,arguments)}},function(t,e,i){t.exports="undefined"!=typeof window&&window.moment||i(85)},function(t,e,i){(function(t){!function(e,i){t.exports=i()}(this,function(){function e(){return go.apply(null,arguments)}function i(t){go=t}function o(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function n(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function s(t){var e;for(e in t)return!1;return!0}function r(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function a(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function d(t,e){var i,o=[];for(i=0;i0)for(i in bo)o=bo[i],n=e[o],g(n)||(t[o]=n);return t}function m(t){y(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),_o===!1&&(_o=!0,e.updateOffset(this),_o=!1)}function b(t){return t instanceof m||null!=t&&null!=t._isAMomentObject}function _(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function w(t){var e=+t,i=0;return 0!==e&&isFinite(e)&&(i=_(e)),i}function k(t,e,i){var o,n=Math.min(t.length,e.length),s=Math.abs(t.length-e.length),r=0;for(o=0;o0?"future":"past"];return S(i)?i(e):i.replace(/%s/i,e)}function N(t,e){var i=t.toLowerCase();Po[i]=Po[i+"s"]=Po[e]=t}function R(t){return"string"==typeof t?Po[t]||Po[t.toLowerCase()]:void 0}function A(t){var e,i,o={};for(i in t)h(t,i)&&(e=R(i),e&&(o[e]=t[i]));return o}function j(t,e){Bo[t]=e}function H(t){var e=[];for(var i in t)e.push({unit:i,priority:Bo[i]});return e.sort(function(t,e){return t.priority-e.priority}),e}function L(t,i){return function(o){return null!=o?(Y(this,t,o),e.updateOffset(this,i),this):W(this,t)}}function W(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function Y(t,e,i){t.isValid()&&t._d["set"+(t._isUTC?"UTC":"")+e](i)}function U(t){return t=R(t),S(this[t])?this[t]():this}function V(t,e){if("object"==typeof t){t=A(t);for(var i=H(t),o=0;o=0;return(s?i?"+":"":"-")+Math.pow(10,Math.max(0,n)).toString().substr(1)+o}function G(t,e,i,o){var n=o;"string"==typeof o&&(n=function(){return this[o]()}),t&&(No[t]=n),e&&(No[e[0]]=function(){return q(n.apply(this,arguments),e[1],e[2])}),i&&(No[i]=function(){return this.localeData().ordinal(n.apply(this,arguments),t)})}function X(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function K(t){var e,i,o=t.match(Fo);for(e=0,i=o.length;e=0&&Io.test(t);)t=t.replace(Io,i),Io.lastIndex=0,o-=1;return t}function J(t,e,i){tn[t]=S(e)?e:function(t,o){return t&&i?i:e}}function $(t,e){return h(tn,t)?tn[t](e._strict,e._locale):new RegExp(tt(t))}function tt(t){return et(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,i,o,n){return e||i||o||n}))}function et(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function it(t,e){var i,o=e;for("string"==typeof t&&(t=[t]),r(e)&&(o=function(t,i){i[e]=w(t)}),i=0;i=0&&isFinite(a.getFullYear())&&a.setFullYear(t),a}function _t(t){var e=new Date(Date.UTC.apply(null,arguments));return t<100&&t>=0&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function wt(t,e,i){var o=7+e-i,n=(7+_t(t,0,o).getUTCDay()-e)%7;return-n+o-1}function kt(t,e,i,o,n){var s,r,a=(7+i-o)%7,d=wt(t,o,n),h=1+7*(e-1)+a+d;return h<=0?(s=t-1,r=gt(s)+h):h>gt(t)?(s=t+1,r=h-gt(t)):(s=t,r=h),{year:s,dayOfYear:r}}function xt(t,e,i){var o,n,s=wt(t.year(),e,i),r=Math.floor((t.dayOfYear()-s-1)/7)+1;return r<1?(n=t.year()-1,o=r+Ot(n,e,i)):r>Ot(t.year(),e,i)?(o=r-Ot(t.year(),e,i),n=t.year()+1):(n=t.year(),o=r),{week:o,year:n}}function Ot(t,e,i){var o=wt(t,e,i),n=wt(t+1,e,i);return(gt(t)-o+n)/7}function Mt(t){return xt(t,this._week.dow,this._week.doy).week}function St(){return this._week.dow}function Et(){return this._week.doy}function Dt(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function Ct(t){var e=xt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function Tt(t,e){return"string"!=typeof t?t:isNaN(t)?(t=e.weekdaysParse(t),"number"==typeof t?t:null):parseInt(t,10)}function Pt(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function Bt(t,e){return t?o(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(e)?"format":"standalone"][t.day()]:this._weekdays}function Ft(t){return t?this._weekdaysShort[t.day()]:this._weekdaysShort}function It(t){return t?this._weekdaysMin[t.day()]:this._weekdaysMin}function zt(t,e,i){var o,n,s,r=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],o=0;o<7;++o)s=u([2e3,1]).day(o),this._minWeekdaysParse[o]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[o]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[o]=this.weekdays(s,"").toLocaleLowerCase();return i?"dddd"===e?(n=cn.call(this._weekdaysParse,r),n!==-1?n:null):"ddd"===e?(n=cn.call(this._shortWeekdaysParse,r),n!==-1?n:null):(n=cn.call(this._minWeekdaysParse,r),n!==-1?n:null):"dddd"===e?(n=cn.call(this._weekdaysParse,r),n!==-1?n:(n=cn.call(this._shortWeekdaysParse,r),n!==-1?n:(n=cn.call(this._minWeekdaysParse,r),n!==-1?n:null))):"ddd"===e?(n=cn.call(this._shortWeekdaysParse,r),n!==-1?n:(n=cn.call(this._weekdaysParse,r),n!==-1?n:(n=cn.call(this._minWeekdaysParse,r),n!==-1?n:null))):(n=cn.call(this._minWeekdaysParse,r),n!==-1?n:(n=cn.call(this._weekdaysParse,r),n!==-1?n:(n=cn.call(this._shortWeekdaysParse,r),n!==-1?n:null)))}function Nt(t,e,i){var o,n,s;if(this._weekdaysParseExact)return zt.call(this,t,e,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),o=0;o<7;o++){if(n=u([2e3,1]).day(o),i&&!this._fullWeekdaysParse[o]&&(this._fullWeekdaysParse[o]=new RegExp("^"+this.weekdays(n,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[o]=new RegExp("^"+this.weekdaysShort(n,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[o]=new RegExp("^"+this.weekdaysMin(n,"").replace(".",".?")+"$","i")),this._weekdaysParse[o]||(s="^"+this.weekdays(n,"")+"|^"+this.weekdaysShort(n,"")+"|^"+this.weekdaysMin(n,""),this._weekdaysParse[o]=new RegExp(s.replace(".",""),"i")),i&&"dddd"===e&&this._fullWeekdaysParse[o].test(t))return o;if(i&&"ddd"===e&&this._shortWeekdaysParse[o].test(t))return o;if(i&&"dd"===e&&this._minWeekdaysParse[o].test(t))return o;if(!i&&this._weekdaysParse[o].test(t))return o}}function Rt(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=Tt(t,this.localeData()),this.add(t-e,"d")):e}function At(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function jt(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=Pt(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7}function Ht(t){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||Yt.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(h(this,"_weekdaysRegex")||(this._weekdaysRegex=xn),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function Lt(t){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||Yt.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(h(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=On),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Wt(t){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||Yt.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(h(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Mn),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Yt(){function t(t,e){return e.length-t.length}var e,i,o,n,s,r=[],a=[],d=[],h=[];for(e=0;e<7;e++)i=u([2e3,1]).day(e),o=this.weekdaysMin(i,""),n=this.weekdaysShort(i,""),s=this.weekdays(i,""),r.push(o),a.push(n),d.push(s),h.push(o),h.push(n),h.push(s);for(r.sort(t),a.sort(t),d.sort(t),h.sort(t),e=0;e<7;e++)a[e]=et(a[e]),d[e]=et(d[e]),h[e]=et(h[e]);this._weekdaysRegex=new RegExp("^("+h.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+r.join("|")+")","i")}function Ut(){return this.hours()%12||12}function Vt(){return this.hours()||24}function qt(t,e){G(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function Gt(t,e){return e._meridiemParse}function Xt(t){return"p"===(t+"").toLowerCase().charAt(0)}function Kt(t,e,i){return t>11?i?"pm":"PM":i?"am":"AM"}function Zt(t){return t?t.toLowerCase().replace("_","-"):t}function Qt(t){for(var e,i,o,n,s=0;s0;){if(o=Jt(n.slice(0,e).join("-")))return o;if(i&&i.length>=e&&k(n,i,!0)>=e-1)break;e--}s++}return null}function Jt(e){var i=null;if(!Tn[e]&&"undefined"!=typeof t&&t&&t.exports)try{i=Sn._abbr,!function(){var t=new Error('Cannot find module "./locale"');throw t.code="MODULE_NOT_FOUND",t}(),$t(i)}catch(t){}return Tn[e]}function $t(t,e){var i;return t&&(i=g(e)?ie(t):te(t,e),i&&(Sn=i)),Sn._abbr}function te(t,e){if(null!==e){var i=Cn;if(e.abbr=t,null!=Tn[t])M("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=Tn[t]._config;else if(null!=e.parentLocale){if(null==Tn[e.parentLocale])return Pn[e.parentLocale]||(Pn[e.parentLocale]=[]),Pn[e.parentLocale].push({name:t,config:e}),null;i=Tn[e.parentLocale]._config}return Tn[t]=new C(D(i,e)),Pn[t]&&Pn[t].forEach(function(t){te(t.name,t.config)}),$t(t),Tn[t]}return delete Tn[t],null}function ee(t,e){if(null!=e){var i,o=Cn;null!=Tn[t]&&(o=Tn[t]._config),e=D(o,e),i=new C(e),i.parentLocale=Tn[t],Tn[t]=i,$t(t)}else null!=Tn[t]&&(null!=Tn[t].parentLocale?Tn[t]=Tn[t].parentLocale:null!=Tn[t]&&delete Tn[t]);return Tn[t]}function ie(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Sn;if(!o(t)){if(e=Jt(t))return e;t=[t]}return Qt(t)}function oe(){return Oo(Tn)}function ne(t){var e,i=t._a;return i&&f(t).overflow===-2&&(e=i[nn]<0||i[nn]>11?nn:i[sn]<1||i[sn]>st(i[on],i[nn])?sn:i[rn]<0||i[rn]>24||24===i[rn]&&(0!==i[an]||0!==i[dn]||0!==i[hn])?rn:i[an]<0||i[an]>59?an:i[dn]<0||i[dn]>59?dn:i[hn]<0||i[hn]>999?hn:-1,f(t)._overflowDayOfYear&&(esn)&&(e=sn),f(t)._overflowWeeks&&e===-1&&(e=ln),f(t)._overflowWeekday&&e===-1&&(e=un),f(t).overflow=e),t}function se(t){var e,i,o,n,s,r,a=t._i,d=Bn.exec(a)||Fn.exec(a);if(d){for(f(t).iso=!0,e=0,i=zn.length;egt(n)&&(f(t)._overflowDayOfYear=!0),i=_t(n,0,t._dayOfYear),t._a[nn]=i.getUTCMonth(),t._a[sn]=i.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=s[e]=o[e];for(;e<7;e++)t._a[e]=s[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[rn]&&0===t._a[an]&&0===t._a[dn]&&0===t._a[hn]&&(t._nextDay=!0,t._a[rn]=0),t._d=(t._useUTC?_t:bt).apply(null,s),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[rn]=24)}}function le(t){var e,i,o,n,s,r,a,d;if(e=t._w,null!=e.GG||null!=e.W||null!=e.E)s=1,r=4,i=ae(e.GG,t._a[on],xt(be(),1,4).year),o=ae(e.W,1),n=ae(e.E,1),(n<1||n>7)&&(d=!0);else{s=t._locale._week.dow,r=t._locale._week.doy;var h=xt(be(),s,r);i=ae(e.gg,t._a[on],h.year),o=ae(e.w,h.week),null!=e.d?(n=e.d,(n<0||n>6)&&(d=!0)):null!=e.e?(n=e.e+s,(e.e<0||e.e>6)&&(d=!0)):n=s}o<1||o>Ot(i,s,r)?f(t)._overflowWeeks=!0:null!=d?f(t)._overflowWeekday=!0:(a=kt(i,o,n,s,r),t._a[on]=a.year,t._dayOfYear=a.dayOfYear)}function ue(t){if(t._f===e.ISO_8601)return void se(t);t._a=[],f(t).empty=!0;var i,o,n,s,r,a=""+t._i,d=a.length,h=0;for(n=Q(t._f,t._locale).match(Fo)||[],i=0;i0&&f(t).unusedInput.push(r),a=a.slice(a.indexOf(o)+o.length),h+=o.length),No[s]?(o?f(t).empty=!1:f(t).unusedTokens.push(s),nt(s,o,t)):t._strict&&!o&&f(t).unusedTokens.push(s);f(t).charsLeftOver=d-h,a.length>0&&f(t).unusedInput.push(a),t._a[rn]<=12&&f(t).bigHour===!0&&t._a[rn]>0&&(f(t).bigHour=void 0),f(t).parsedDateParts=t._a.slice(0),f(t).meridiem=t._meridiem,t._a[rn]=ce(t._locale,t._a[rn],t._meridiem),he(t),ne(t)}function ce(t,e,i){var o;return null==i?e:null!=t.meridiemHour?t.meridiemHour(e,i):null!=t.isPM?(o=t.isPM(i),o&&e<12&&(e+=12),o||12!==e||(e=0),e):e}function fe(t){var e,i,o,n,s;if(0===t._f.length)return f(t).invalidFormat=!0,void(t._d=new Date(NaN));for(n=0;nthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Re(){if(!g(this._isDSTShifted))return this._isDSTShifted;var t={};if(y(t,this),t=ge(t),t._a){var e=t._isUTC?u(t._a):be(t._a);this._isDSTShifted=this.isValid()&&k(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Ae(){return!!this.isValid()&&!this._isUTC}function je(){return!!this.isValid()&&this._isUTC}function He(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function Le(t,e){var i,o,n,s=t,a=null;return Oe(t)?s={ms:t._milliseconds,d:t._days,M:t._months}:r(t)?(s={},e?s[e]=t:s.milliseconds=t):(a=Wn.exec(t))?(i="-"===a[1]?-1:1,s={y:0,d:w(a[sn])*i,h:w(a[rn])*i,m:w(a[an])*i,s:w(a[dn])*i,ms:w(Me(1e3*a[hn]))*i}):(a=Yn.exec(t))?(i="-"===a[1]?-1:1,s={y:We(a[2],i),M:We(a[3],i),w:We(a[4],i),d:We(a[5],i),h:We(a[6],i),m:We(a[7],i),s:We(a[8],i)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(n=Ue(be(s.from),be(s.to)),s={},s.ms=n.milliseconds,s.M=n.months),o=new xe(s),Oe(t)&&h(t,"_locale")&&(o._locale=t._locale),o}function We(t,e){var i=t&&parseFloat(t.replace(",","."));return(isNaN(i)?0:i)*e}function Ye(t,e){var i={milliseconds:0,months:0};return i.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(i.months,"M").isAfter(e)&&--i.months,i.milliseconds=+e-+t.clone().add(i.months,"M"),i}function Ue(t,e){var i;return t.isValid()&&e.isValid()?(e=De(e,t),t.isBefore(e)?i=Ye(t,e):(i=Ye(e,t),i.milliseconds=-i.milliseconds,i.months=-i.months),i):{milliseconds:0,months:0}}function Ve(t,e){return function(i,o){var n,s;return null===o||isNaN(+o)||(M(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),s=i,i=o,o=s),i="string"==typeof i?+i:i,n=Le(i,o),qe(this,n,t),this}}function qe(t,i,o,n){var s=i._milliseconds,r=Me(i._days),a=Me(i._months);t.isValid()&&(n=null==n||n,s&&t._d.setTime(t._d.valueOf()+s*o),r&&Y(t,"Date",W(t,"Date")+r*o),a&<(t,W(t,"Month")+a*o),n&&e.updateOffset(t,r||a))}function Ge(t,e){var i=t.diff(e,"days",!0);return i<-6?"sameElse":i<-1?"lastWeek":i<0?"lastDay":i<1?"sameDay":i<2?"nextDay":i<7?"nextWeek":"sameElse"}function Xe(t,i){var o=t||be(),n=De(o,this).startOf("day"),s=e.calendarFormat(this,n)||"sameElse",r=i&&(S(i[s])?i[s].call(this,o):i[s]);return this.format(r||this.localeData().calendar(s,this,be(o)))}function Ke(){return new m(this)}function Ze(t,e){var i=b(t)?t:be(t);return!(!this.isValid()||!i.isValid())&&(e=R(g(e)?"millisecond":e),"millisecond"===e?this.valueOf()>i.valueOf():i.valueOf()s&&(e=s),Bi.call(this,t,e,i,o,n))}function Bi(t,e,i,o,n){var s=kt(t,e,i,o,n),r=_t(s.year,0,s.dayOfYear);return this.year(r.getUTCFullYear()),this.month(r.getUTCMonth()),this.date(r.getUTCDate()),this}function Fi(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}function Ii(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function zi(t,e){e[hn]=w(1e3*("0."+t))}function Ni(){return this._isUTC?"UTC":""}function Ri(){return this._isUTC?"Coordinated Universal Time":""}function Ai(t){return be(1e3*t)}function ji(){return be.apply(null,arguments).parseZone()}function Hi(t){return t}function Li(t,e,i,o){var n=ie(),s=u().set(o,e);return n[i](s,t)}function Wi(t,e,i){if(r(t)&&(e=t,t=void 0),t=t||"",null!=e)return Li(t,e,i,"month");var o,n=[];for(o=0;o<12;o++)n[o]=Li(t,o,i,"month");return n}function Yi(t,e,i,o){"boolean"==typeof t?(r(e)&&(i=e,e=void 0),e=e||""):(e=t,i=e,t=!1,r(e)&&(i=e,e=void 0),e=e||"");var n=ie(),s=t?n._week.dow:0;if(null!=i)return Li(e,(i+s)%7,o,"day");var a,d=[];for(a=0;a<7;a++)d[a]=Li(e,(a+s)%7,o,"day");return d}function Ui(t,e){return Wi(t,e,"months")}function Vi(t,e){return Wi(t,e,"monthsShort")}function qi(t,e,i){return Yi(t,e,i,"weekdays")}function Gi(t,e,i){return Yi(t,e,i,"weekdaysShort")}function Xi(t,e,i){return Yi(t,e,i,"weekdaysMin")}function Ki(){var t=this._data;return this._milliseconds=ts(this._milliseconds),this._days=ts(this._days),this._months=ts(this._months),t.milliseconds=ts(t.milliseconds),t.seconds=ts(t.seconds),t.minutes=ts(t.minutes),t.hours=ts(t.hours),t.months=ts(t.months),t.years=ts(t.years),this}function Zi(t,e,i,o){var n=Le(e,i);return t._milliseconds+=o*n._milliseconds,t._days+=o*n._days,t._months+=o*n._months,t._bubble()}function Qi(t,e){return Zi(this,t,e,1)}function Ji(t,e){return Zi(this,t,e,-1)}function $i(t){return t<0?Math.floor(t):Math.ceil(t)}function to(){var t,e,i,o,n,s=this._milliseconds,r=this._days,a=this._months,d=this._data;return s>=0&&r>=0&&a>=0||s<=0&&r<=0&&a<=0||(s+=864e5*$i(io(a)+r),r=0,a=0),d.milliseconds=s%1e3,t=_(s/1e3),d.seconds=t%60,e=_(t/60),d.minutes=e%60, +i=_(e/60),d.hours=i%24,r+=_(i/24),n=_(eo(r)),a+=n,r-=$i(io(n)),o=_(a/12),a%=12,d.days=r,d.months=a,d.years=o,this}function eo(t){return 4800*t/146097}function io(t){return 146097*t/4800}function oo(t){var e,i,o=this._milliseconds;if(t=R(t),"month"===t||"year"===t)return e=this._days+o/864e5,i=this._months+eo(e),"month"===t?i:i/12;switch(e=this._days+Math.round(io(this._months)),t){case"week":return e/7+o/6048e5;case"day":return e+o/864e5;case"hour":return 24*e+o/36e5;case"minute":return 1440*e+o/6e4;case"second":return 86400*e+o/1e3;case"millisecond":return Math.floor(864e5*e)+o;default:throw new Error("Unknown unit "+t)}}function no(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*w(this._months/12)}function so(t){return function(){return this.as(t)}}function ro(t){return t=R(t),this[t+"s"]()}function ao(t){return function(){return this._data[t]}}function ho(){return _(this.days()/7)}function lo(t,e,i,o,n){return n.relativeTime(e||1,!!i,t,o)}function uo(t,e,i){var o=Le(t).abs(),n=gs(o.as("s")),s=gs(o.as("m")),r=gs(o.as("h")),a=gs(o.as("d")),d=gs(o.as("M")),h=gs(o.as("y")),l=n0,l[4]=i,lo.apply(null,l)}function co(t){return void 0===t?gs:"function"==typeof t&&(gs=t,!0)}function fo(t,e){return void 0!==ys[t]&&(void 0===e?ys[t]:(ys[t]=e,!0))}function po(t){var e=this.localeData(),i=uo(this,!t,e);return t&&(i=e.pastFuture(+this,i)),e.postformat(i)}function vo(){var t,e,i,o=ms(this._milliseconds)/1e3,n=ms(this._days),s=ms(this._months);t=_(o/60),e=_(t/60),o%=60,t%=60,i=_(s/12),s%=12;var r=i,a=s,d=n,h=e,l=t,u=o,c=this.asSeconds();return c?(c<0?"-":"")+"P"+(r?r+"Y":"")+(a?a+"M":"")+(d?d+"D":"")+(h||l||u?"T":"")+(h?h+"H":"")+(l?l+"M":"")+(u?u+"S":""):"P0D"}var go,yo;yo=Array.prototype.some?Array.prototype.some:function(t){for(var e=Object(this),i=e.length>>>0,o=0;o68?1900:2e3)};var mn=L("FullYear",!0);G("w",["ww",2],"wo","week"),G("W",["WW",2],"Wo","isoWeek"),N("week","w"),N("isoWeek","W"),j("week",5),j("isoWeek",5),J("w",Wo),J("ww",Wo,Ao),J("W",Wo),J("WW",Wo,Ao),ot(["w","ww","W","WW"],function(t,e,i,o){e[o.substr(0,1)]=w(t)});var bn={dow:0,doy:6};G("d",0,"do","day"),G("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),G("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),G("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),G("e",0,0,"weekday"),G("E",0,0,"isoWeekday"),N("day","d"),N("weekday","e"),N("isoWeekday","E"),j("day",11),j("weekday",11),j("isoWeekday",11),J("d",Wo),J("e",Wo),J("E",Wo),J("dd",function(t,e){return e.weekdaysMinRegex(t)}),J("ddd",function(t,e){return e.weekdaysShortRegex(t)}),J("dddd",function(t,e){return e.weekdaysRegex(t)}),ot(["dd","ddd","dddd"],function(t,e,i,o){var n=i._locale.weekdaysParse(t,o,i._strict);null!=n?e.d=n:f(i).invalidWeekday=t}),ot(["d","e","E"],function(t,e,i,o){e[o]=w(t)});var _n="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),wn="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),kn="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),xn=$o,On=$o,Mn=$o;G("H",["HH",2],0,"hour"),G("h",["hh",2],0,Ut),G("k",["kk",2],0,Vt),G("hmm",0,0,function(){return""+Ut.apply(this)+q(this.minutes(),2)}),G("hmmss",0,0,function(){return""+Ut.apply(this)+q(this.minutes(),2)+q(this.seconds(),2)}),G("Hmm",0,0,function(){return""+this.hours()+q(this.minutes(),2)}),G("Hmmss",0,0,function(){return""+this.hours()+q(this.minutes(),2)+q(this.seconds(),2)}),qt("a",!0),qt("A",!1),N("hour","h"),j("hour",13),J("a",Gt),J("A",Gt),J("H",Wo),J("h",Wo),J("HH",Wo,Ao),J("hh",Wo,Ao),J("hmm",Yo),J("hmmss",Uo),J("Hmm",Yo),J("Hmmss",Uo),it(["H","HH"],rn),it(["a","A"],function(t,e,i){i._isPm=i._locale.isPM(t),i._meridiem=t}),it(["h","hh"],function(t,e,i){e[rn]=w(t),f(i).bigHour=!0}),it("hmm",function(t,e,i){var o=t.length-2;e[rn]=w(t.substr(0,o)),e[an]=w(t.substr(o)),f(i).bigHour=!0}),it("hmmss",function(t,e,i){var o=t.length-4,n=t.length-2;e[rn]=w(t.substr(0,o)),e[an]=w(t.substr(o,2)),e[dn]=w(t.substr(n)),f(i).bigHour=!0}),it("Hmm",function(t,e,i){var o=t.length-2;e[rn]=w(t.substr(0,o)),e[an]=w(t.substr(o))}),it("Hmmss",function(t,e,i){var o=t.length-4,n=t.length-2;e[rn]=w(t.substr(0,o)),e[an]=w(t.substr(o,2)),e[dn]=w(t.substr(n))});var Sn,En=/[ap]\.?m?\.?/i,Dn=L("Hours",!0),Cn={calendar:Mo,longDateFormat:So,invalidDate:Eo,ordinal:Do,ordinalParse:Co,relativeTime:To,months:pn,monthsShort:vn,week:bn,weekdays:_n,weekdaysMin:kn,weekdaysShort:wn,meridiemParse:En},Tn={},Pn={},Bn=/^\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)?)?$/,Fn=/^\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)?)?$/,In=/Z|[+-]\d\d(?::?\d\d)?/,zn=[["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}/]],Nn=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Rn=/^\/?Date\((\-?\d+)/i;e.createFromInputFallback=O("value provided is not in a recognized ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non 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(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),e.ISO_8601=function(){};var An=O("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=be.apply(null,arguments);return this.isValid()&&t.isValid()?tthis?this:t:v()}),Hn=function(){return Date.now?Date.now():+new Date};Se("Z",":"),Se("ZZ",""),J("Z",Qo),J("ZZ",Qo),it(["Z","ZZ"],function(t,e,i){i._useUTC=!0,i._tzm=Ee(Qo,t)});var Ln=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var Wn=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Yn=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;Le.fn=xe.prototype;var Un=Ve(1,"add"),Vn=Ve(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var qn=O("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});G(0,["gg",2],0,function(){return this.weekYear()%100}),G(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Si("gggg","weekYear"),Si("ggggg","weekYear"),Si("GGGG","isoWeekYear"),Si("GGGGG","isoWeekYear"),N("weekYear","gg"),N("isoWeekYear","GG"),j("weekYear",1),j("isoWeekYear",1),J("G",Ko),J("g",Ko),J("GG",Wo,Ao),J("gg",Wo,Ao),J("GGGG",qo,Ho),J("gggg",qo,Ho),J("GGGGG",Go,Lo),J("ggggg",Go,Lo),ot(["gggg","ggggg","GGGG","GGGGG"],function(t,e,i,o){e[o.substr(0,2)]=w(t)}),ot(["gg","GG"],function(t,i,o,n){i[n]=e.parseTwoDigitYear(t)}),G("Q",0,"Qo","quarter"),N("quarter","Q"),j("quarter",7),J("Q",Ro),it("Q",function(t,e){e[nn]=3*(w(t)-1)}),G("D",["DD",2],"Do","date"),N("date","D"),j("date",9),J("D",Wo),J("DD",Wo,Ao),J("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),it(["D","DD"],sn),it("Do",function(t,e){e[sn]=w(t.match(Wo)[0],10)});var Gn=L("Date",!0);G("DDD",["DDDD",3],"DDDo","dayOfYear"),N("dayOfYear","DDD"),j("dayOfYear",4),J("DDD",Vo),J("DDDD",jo),it(["DDD","DDDD"],function(t,e,i){i._dayOfYear=w(t)}),G("m",["mm",2],0,"minute"),N("minute","m"),j("minute",14),J("m",Wo),J("mm",Wo,Ao),it(["m","mm"],an);var Xn=L("Minutes",!1);G("s",["ss",2],0,"second"),N("second","s"),j("second",15),J("s",Wo),J("ss",Wo,Ao),it(["s","ss"],dn);var Kn=L("Seconds",!1);G("S",0,0,function(){return~~(this.millisecond()/100)}),G(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),G(0,["SSS",3],0,"millisecond"),G(0,["SSSS",4],0,function(){return 10*this.millisecond()}),G(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),G(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),G(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),G(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),G(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),N("millisecond","ms"),j("millisecond",16),J("S",Vo,Ro),J("SS",Vo,Ao),J("SSS",Vo,jo);var Zn;for(Zn="SSSS";Zn.length<=9;Zn+="S")J(Zn,Xo);for(Zn="S";Zn.length<=9;Zn+="S")it(Zn,zi);var Qn=L("Milliseconds",!1);G("z",0,0,"zoneAbbr"),G("zz",0,0,"zoneName");var Jn=m.prototype;Jn.add=Un,Jn.calendar=Xe,Jn.clone=Ke,Jn.diff=ii,Jn.endOf=vi,Jn.format=ai,Jn.from=di,Jn.fromNow=hi,Jn.to=li,Jn.toNow=ui,Jn.get=U,Jn.invalidAt=Oi,Jn.isAfter=Ze,Jn.isBefore=Qe,Jn.isBetween=Je,Jn.isSame=$e,Jn.isSameOrAfter=ti,Jn.isSameOrBefore=ei,Jn.isValid=ki,Jn.lang=qn,Jn.locale=ci,Jn.localeData=fi,Jn.max=jn,Jn.min=An,Jn.parsingFlags=xi,Jn.set=V,Jn.startOf=pi,Jn.subtract=Vn,Jn.toArray=bi,Jn.toObject=_i,Jn.toDate=mi,Jn.toISOString=si,Jn.inspect=ri,Jn.toJSON=wi,Jn.toString=ni,Jn.unix=yi,Jn.valueOf=gi,Jn.creationData=Mi,Jn.year=mn,Jn.isLeapYear=mt,Jn.weekYear=Ei,Jn.isoWeekYear=Di,Jn.quarter=Jn.quarters=Fi,Jn.month=ut,Jn.daysInMonth=ct,Jn.week=Jn.weeks=Dt,Jn.isoWeek=Jn.isoWeeks=Ct,Jn.weeksInYear=Ti,Jn.isoWeeksInYear=Ci,Jn.date=Gn,Jn.day=Jn.days=Rt,Jn.weekday=At,Jn.isoWeekday=jt,Jn.dayOfYear=Ii,Jn.hour=Jn.hours=Dn,Jn.minute=Jn.minutes=Xn,Jn.second=Jn.seconds=Kn,Jn.millisecond=Jn.milliseconds=Qn,Jn.utcOffset=Te,Jn.utc=Be,Jn.local=Fe,Jn.parseZone=Ie,Jn.hasAlignedHourOffset=ze,Jn.isDST=Ne,Jn.isLocal=Ae,Jn.isUtcOffset=je,Jn.isUtc=He,Jn.isUTC=He,Jn.zoneAbbr=Ni,Jn.zoneName=Ri,Jn.dates=O("dates accessor is deprecated. Use date instead.",Gn),Jn.months=O("months accessor is deprecated. Use month instead",ut),Jn.years=O("years accessor is deprecated. Use year instead",mn),Jn.zone=O("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Pe),Jn.isDSTShifted=O("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Re);var $n=C.prototype;$n.calendar=T,$n.longDateFormat=P,$n.invalidDate=B,$n.ordinal=F,$n.preparse=Hi,$n.postformat=Hi,$n.relativeTime=I,$n.pastFuture=z,$n.set=E,$n.months=rt,$n.monthsShort=at,$n.monthsParse=ht,$n.monthsRegex=pt,$n.monthsShortRegex=ft,$n.week=Mt,$n.firstDayOfYear=Et,$n.firstDayOfWeek=St,$n.weekdays=Bt,$n.weekdaysMin=It,$n.weekdaysShort=Ft,$n.weekdaysParse=Nt,$n.weekdaysRegex=Ht,$n.weekdaysShortRegex=Lt,$n.weekdaysMinRegex=Wt,$n.isPM=Xt,$n.meridiem=Kt,$t("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,i=1===w(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+i}}),e.lang=O("moment.lang is deprecated. Use moment.locale instead.",$t),e.langData=O("moment.langData is deprecated. Use moment.localeData instead.",ie);var ts=Math.abs,es=so("ms"),is=so("s"),os=so("m"),ns=so("h"),ss=so("d"),rs=so("w"),as=so("M"),ds=so("y"),hs=ao("milliseconds"),ls=ao("seconds"),us=ao("minutes"),cs=ao("hours"),fs=ao("days"),ps=ao("months"),vs=ao("years"),gs=Math.round,ys={s:45,m:45,h:22,d:26,M:11},ms=Math.abs,bs=xe.prototype;return bs.abs=Ki,bs.add=Qi,bs.subtract=Ji,bs.as=oo,bs.asMilliseconds=es,bs.asSeconds=is,bs.asMinutes=os,bs.asHours=ns,bs.asDays=ss,bs.asWeeks=rs,bs.asMonths=as,bs.asYears=ds,bs.valueOf=no,bs._bubble=to,bs.get=ro,bs.milliseconds=hs,bs.seconds=ls,bs.minutes=us,bs.hours=cs,bs.days=fs,bs.weeks=ho,bs.months=ps,bs.years=vs,bs.humanize=po,bs.toISOString=vo,bs.toString=vo,bs.toJSON=vo,bs.locale=ci,bs.localeData=fi,bs.toIsoString=O("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",vo),bs.lang=qn,G("X",0,0,"unix"),G("x",0,0,"valueOf"),J("x",Ko),J("X",Jo),it("X",function(t,e,i){i._d=new Date(1e3*parseFloat(t,10))}),it("x",function(t,e,i){i._d=new Date(w(t))}),e.version="2.17.1",i(be),e.fn=Jn,e.min=we,e.max=ke,e.now=Hn,e.utc=u,e.unix=Ai,e.months=Ui,e.isDate=a,e.locale=$t,e.invalid=v,e.duration=Le,e.isMoment=b,e.weekdays=qi,e.parseZone=ji,e.localeData=ie,e.isDuration=Oe,e.monthsShort=Vi,e.weekdaysMin=Xi,e.defineLocale=te,e.updateLocale=ee,e.locales=oe,e.weekdaysShort=Gi,e.normalizeUnits=R,e.relativeTimeRounding=co,e.relativeTimeThreshold=fo,e.calendarFormat=Ge,e.prototype=Jn,e})}).call(e,i(86)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e){function i(t){throw new Error("Cannot find module '"+t+"'.")}i.keys=function(){return[]},i.resolve=i,t.exports=i,i.id=87},function(t,e){(function(e){function i(t,e,i){var o=e&&i||0,n=0;for(e=e||[],t.toLowerCase().replace(/[0-9a-f]{2}/g,function(t){n<16&&(e[o+n++]=u[t])});n<16;)e[o+n++]=0;return e}function o(t,e){var i=e||0,o=l;return o[t[i++]]+o[t[i++]]+o[t[i++]]+o[t[i++]]+"-"+o[t[i++]]+o[t[i++]]+"-"+o[t[i++]]+o[t[i++]]+"-"+o[t[i++]]+o[t[i++]]+"-"+o[t[i++]]+o[t[i++]]+o[t[i++]]+o[t[i++]]+o[t[i++]]+o[t[i++]]}function n(t,e,i){var n=e&&i||0,s=e||[];t=t||{};var r=void 0!==t.clockseq?t.clockseq:v,a=void 0!==t.msecs?t.msecs:(new Date).getTime(),d=void 0!==t.nsecs?t.nsecs:y+1,h=a-g+(d-y)/1e4;if(h<0&&void 0===t.clockseq&&(r=r+1&16383),(h<0||a>g)&&void 0===t.nsecs&&(d=0),d>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");g=a,y=d,v=r,a+=122192928e5;var l=(1e4*(268435455&a)+d)%4294967296;s[n++]=l>>>24&255,s[n++]=l>>>16&255,s[n++]=l>>>8&255,s[n++]=255&l;var u=a/4294967296*1e4&268435455;s[n++]=u>>>8&255,s[n++]=255&u,s[n++]=u>>>24&15|16,s[n++]=u>>>16&255,s[n++]=r>>>8|128,s[n++]=255&r;for(var c=t.node||p,f=0;f<6;f++)s[n+f]=c[f];return e?e:o(s)}function s(t,e,i){var n=e&&i||0;"string"==typeof t&&(e="binary"==t?new Array(16):null,t=null),t=t||{};var s=t.random||(t.rng||r)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,e)for(var a=0;a<16;a++)e[n+a]=s[a];return e||o(s)}var r,a="undefined"!=typeof window?window:"undefined"!=typeof e?e:null;if(a&&a.crypto&&crypto.getRandomValues){var d=new Uint8Array(16);r=function(){return crypto.getRandomValues(d),d}}if(!r){var h=new Array(16);r=function(){for(var t,e=0;e<16;e++)0===(3&e)&&(t=4294967296*Math.random()),h[e]=t>>>((3&e)<<3)&255;return h}}for(var l=[],u={},c=0;c<256;c++)l[c]=(c+256).toString(16).substr(1),u[l[c]]=c;var f=r(),p=[1|f[0],f[1],f[2],f[3],f[4],f[5]],v=16383&(f[6]<<8|f[7]),g=0,y=0,m=s;m.v1=n,m.v4=s,m.parse=i,m.unparse=o,t.exports=m}).call(e,function(){return this}())},function(t,e){e.prepareElements=function(t){for(var e in t)t.hasOwnProperty(e)&&(t[e].redundant=t[e].used,t[e].used=[])},e.cleanupElements=function(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e].redundant){for(var i=0;i0?(o=e[t].redundant[0],e[t].redundant.shift()):(o=document.createElementNS("http://www.w3.org/2000/svg",t),i.appendChild(o)):(o=document.createElementNS("http://www.w3.org/2000/svg",t),e[t]={used:[],redundant:[]},i.appendChild(o)),e[t].used.push(o),o},e.getDOMElement=function(t,e,i,o){var n;return e.hasOwnProperty(t)?e[t].redundant.length>0?(n=e[t].redundant[0],e[t].redundant.shift()):(n=document.createElement(t),void 0!==o?i.insertBefore(n,o):i.appendChild(n)):(n=document.createElement(t),e[t]={used:[],redundant:[]},void 0!==o?i.insertBefore(n,o):i.appendChild(n)),e[t].used.push(n),n},e.drawPoint=function(t,i,o,n,s,r){var a;if("circle"==o.style?(a=e.getSVGElement("circle",n,s),a.setAttributeNS(null,"cx",t),a.setAttributeNS(null,"cy",i),a.setAttributeNS(null,"r",.5*o.size)):(a=e.getSVGElement("rect",n,s),a.setAttributeNS(null,"x",t-.5*o.size),a.setAttributeNS(null,"y",i-.5*o.size),a.setAttributeNS(null,"width",o.size),a.setAttributeNS(null,"height",o.size)),void 0!==o.styles&&a.setAttributeNS(null,"style",o.styles),a.setAttributeNS(null,"class",o.className+" vis-point"),r){var d=e.getSVGElement("text",n,s);r.xOffset&&(t+=r.xOffset),r.yOffset&&(i+=r.yOffset),r.content&&(d.textContent=r.content),r.className&&d.setAttributeNS(null,"class",r.className+" vis-label"),d.setAttributeNS(null,"x",t),d.setAttributeNS(null,"y",i)}return a},e.drawBar=function(t,i,o,n,s,r,a,d){if(0!=n){n<0&&(n*=-1,i-=n);var h=e.getSVGElement("rect",r,a);h.setAttributeNS(null,"x",t-.5*o),h.setAttributeNS(null,"y",i),h.setAttributeNS(null,"width",o),h.setAttributeNS(null,"height",n),h.setAttributeNS(null,"class",s),d&&h.setAttributeNS(null,"style",d)}}},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(t&&!Array.isArray(t)&&(e=t,t=null),this._options=e||{},this._data={},this.length=0,this._fieldId=this._options.fieldId||"id",this._type={},this._options.type)for(var i=(0,l.default)(this._options.type),o=0,n=i.length;on?1:or)&&(s=d,r=h)}return s},n.prototype.min=function(t){var e,i,o=this._data,n=(0,l.default)(o),s=null,r=null;for(e=0,i=n.length;ethis.max&&this.flush(),clearTimeout(this._timeout),this.queue.length>0&&"number"==typeof this.delay){var t=this;this._timeout=setTimeout(function(){t.flush()},this.delay)}},i.prototype.flush=function(){for(;this._queue.length>0;){var t=this._queue.shift();t.fn.apply(t.context||t.fn,t.args||[])}},t.exports=i},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){this._data=null,this._ids={},this.length=0,this._options=e||{},this._fieldId="id",this._subscribers={};var i=this;this.listener=function(){i._onEvent.apply(i,arguments)},this.setData(t)}var s=i(58),r=o(s),a=i(1),d=i(90);n.prototype.setData=function(t){var e,i,o,n,s;if(this._data){for(this._data.off&&this._data.off("*",this.listener),e=this._data.getIds({filter:this._options&&this._options.filter}),s=[],o=0,n=e.length;o0){var i=this.groupIndex%this.groupsArray.length;this.groupIndex++,e={},e.color=this.groups[this.groupsArray[i]],this.groups[t]=e}else{var o=this.defaultIndex%this.defaultGroups.length;this.defaultIndex++,e={},e.color=this.defaultGroups[o],this.groups[t]=e}return e}},{key:"add",value:function(t,e){return this.groups[t]=e,this.groupsArray.push(t),e}}]),t}();e.default=h},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(95),s=o(n),r=i(96),a=o(r),d=i(102),h=o(d),l=i(103),u=o(l),c=i(1),f=i(90),p=i(92),v=function(){function t(e,i,o,n){var r=this;(0,s.default)(this,t),this.body=e,this.images=i,this.groups=o,this.layoutEngine=n,this.body.functions.createNode=this.create.bind(this),this.nodesListeners={add:function(t,e){r.add(e.items)},update:function(t,e){r.update(e.items,e.data)},remove:function(t,e){r.remove(e.items)}},this.options={},this.defaultOptions={borderWidth:1,borderWidthSelected:2,brokenImage:void 0,color:{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},fixed:{x:!1,y:!1},font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:0,strokeColor:"#ffffff",align:"center",vadjust:0,multi:!1,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"courier new",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(t,e,i,o){if(e===t)return.5;var n=1/(e-t);return Math.max(0,(o-t)*n)}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},shape:"ellipse",shapeProperties:{borderDashes:!1,borderRadius:6,interpolation:!0,useImageSize:!1,useBorderWithImage:!1},size:25,title:void 0,value:void 0,x:void 0,y:void 0},c.extend(this.options,this.defaultOptions),this.bindEventListeners()}return(0,a.default)(t,[{key:"bindEventListeners",value:function(){var t=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(){c.forEach(t.nodesListeners,function(e,i){t.body.data.nodes&&t.body.data.nodes.off(i,e)}),delete t.body.functions.createNode,delete t.nodesListeners.add,delete t.nodesListeners.update,delete t.nodesListeners.remove,delete t.nodesListeners})}},{key:"setOptions",value:function(t){if(this.nodeOptions=t,void 0!==t){if(h.default.parseOptions(this.options,t),void 0!==t.shape)for(var e in this.body.nodes)this.body.nodes.hasOwnProperty(e)&&this.body.nodes[e].updateShape();if(void 0!==t.font){u.default.parseOptions(this.options.font,t);for(var i in this.body.nodes)this.body.nodes.hasOwnProperty(i)&&(this.body.nodes[i].updateLabelModule(),this.body.nodes[i]._reset())}if(void 0!==t.size)for(var o in this.body.nodes)this.body.nodes.hasOwnProperty(o)&&this.body.nodes[o]._reset();void 0===t.hidden&&void 0===t.physics||this.body.emitter.emit("_dataChanged")}}},{key:"setData",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=this.body.data.nodes;if(t instanceof f||t instanceof p)this.body.data.nodes=t;else if(Array.isArray(t))this.body.data.nodes=new f,this.body.data.nodes.add(t);else{if(t)throw new TypeError("Array or DataSet expected");this.body.data.nodes=new f}o&&c.forEach(this.nodesListeners,function(t,e){o.off(e,t)}),this.body.nodes={},this.body.data.nodes&&!function(){var t=e;c.forEach(e.nodesListeners,function(e,i){t.body.data.nodes.on(i,e)});var i=e.body.data.nodes.getIds();e.add(i,!0)}(),i===!1&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=void 0,o=[],n=0;n1&&void 0!==arguments[1]?arguments[1]:h.default;return new e(t,this.body,this.images,this.groups,this.options,this.defaultOptions,this.nodeOptions)}},{key:"refresh",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.body.nodes;for(var i in e){var o=void 0;e.hasOwnProperty(i)&&(o=e[i]);var n=this.body.data.nodes._data[i];void 0!==o&&void 0!==n&&(t===!0&&o.setOptions({x:null,y:null}),o.setOptions({fixed:!1}),o.setOptions(n))}}},{key:"getPositions",value:function(t){var e={};if(void 0!==t){if(Array.isArray(t)===!0){for(var i=0;it.left&&this.shape.topt.top}},{key:"isBoundingBoxOverlappingWith",value:function(t){return this.shape.boundingBox.leftt.left&&this.shape.boundingBox.topt.top; +}}],[{key:"parseOptions",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=["color","font","fixed","shadow"];if(L.selectiveNotDeepExtend(n,t,e,i),L.mergeOptions(t,e,"shadow",i,o),void 0!==e.color&&null!==e.color){var s=L.parseColor(e.color);L.fillIfDefined(t.color,s)}else i===!0&&null===e.color&&(t.color=L.bridgeObject(o.color));void 0!==e.fixed&&null!==e.fixed&&("boolean"==typeof e.fixed?(t.fixed.x=e.fixed,t.fixed.y=e.fixed):(void 0!==e.fixed.x&&"boolean"==typeof e.fixed.x&&(t.fixed.x=e.fixed.x),void 0!==e.fixed.y&&"boolean"==typeof e.fixed.y&&(t.fixed.y=e.fixed.y))),void 0!==e.font&&null!==e.font?u.default.parseOptions(t.font,e):i===!0&&null===e.font&&(t.font=L.bridgeObject(o.font)),void 0!==e.scaling&&L.mergeOptions(t.scaling,e.scaling,"label",i,o.scaling)}}]),t}();e.default=W},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(104),s=o(n),r=i(2),a=o(r),d=i(62),h=o(d),l=i(95),u=o(l),c=i(96),f=o(c),p=i(1),v=function(){function t(e,i){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,u.default)(this,t),this.body=e,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(i),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=o}return(0,f.default)(t,[{key:"setOptions",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.elementOptions=e,this.fontOptions=p.deepExtend({},e.font,!0),void 0!==e.label&&(this.labelDirty=!0),void 0!==e.font&&(t.parseOptions(this.fontOptions,e,i),"string"==typeof e.font?this.baseSize=this.fontOptions.size:"object"===(0,h.default)(e.font)&&void 0!==e.font.size&&(this.baseSize=e.font.size))}},{key:"constrain",value:function(t,e,i){this.fontOptions.constrainWidth=!1,this.fontOptions.maxWdt=-1,this.fontOptions.minWdt=-1;var o=[e,t,i],n=p.topMost(o,"widthConstraint");if("number"==typeof n)this.fontOptions.maxWdt=Number(n),this.fontOptions.minWdt=Number(n);else if("object"===("undefined"==typeof n?"undefined":(0,h.default)(n))){var s=p.topMost(o,["widthConstraint","maximum"]);"number"==typeof s&&(this.fontOptions.maxWdt=Number(s));var r=p.topMost(o,["widthConstraint","minimum"]);"number"==typeof r&&(this.fontOptions.minWdt=Number(r))}this.fontOptions.constrainHeight=!1,this.fontOptions.minHgt=-1,this.fontOptions.valign="middle";var a=p.topMost(o,"heightConstraint");if("number"==typeof a)this.fontOptions.minHgt=Number(a);else if("object"===("undefined"==typeof a?"undefined":(0,h.default)(a))){var d=p.topMost(o,["heightConstraint","minimum"]);"number"==typeof d&&(this.fontOptions.minHgt=Number(d));var l=p.topMost(o,["heightConstraint","valign"]);"string"==typeof l&&("top"!==l&&"bottom"!==l||(this.fontOptions.valign=l))}}},{key:"choosify",value:function(t,e,i){this.fontOptions.chooser=!0;var o=[e,t,i],n=p.topMost(o,"chosen");if("boolean"==typeof n)this.fontOptions.chooser=n;else if("object"===("undefined"==typeof n?"undefined":(0,h.default)(n))){var s=p.topMost(o,["chosen","label"]);"boolean"!=typeof s&&"function"!=typeof s||(this.fontOptions.chooser=s)}}},{key:"adjustSizes",value:function(t){var e=t?t.right+t.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=e,this.fontOptions.minWdt-=e);var i=t?t.top+t.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=i)}},{key:"propagateFonts",value:function(t,e,i){if(this.fontOptions.multi){var o=["bold","ital","boldital","mono"],n=!0,s=!1,r=void 0;try{for(var d,h=(0,a.default)(o);!(n=(d=h.next()).done);n=!0){var l=d.value,u=void 0;if(t.font&&(u=t.font[l]),"string"==typeof u){var c=u.split(" ");this.fontOptions[l].size=c[0].replace("px",""),this.fontOptions[l].face=c[1],this.fontOptions[l].color=c[2],this.fontOptions[l].vadjust=this.fontOptions.vadjust,this.fontOptions[l].mod=i.font[l].mod}else{if(u&&u.hasOwnProperty("face")?this.fontOptions[l].face=u.face:e.font&&e.font[l]&&e.font[l].hasOwnProperty("face")?this.fontOptions[l].face=e.font[l].face:"mono"===l?this.fontOptions[l].face=i.font[l].face:e.font&&e.font.hasOwnProperty("face")?this.fontOptions[l].face=e.font.face:this.fontOptions[l].face=this.fontOptions.face,u&&u.hasOwnProperty("color")?this.fontOptions[l].color=u.color:e.font&&e.font[l]&&e.font[l].hasOwnProperty("color")?this.fontOptions[l].color=e.font[l].color:e.font&&e.font.hasOwnProperty("color")?this.fontOptions[l].color=e.font.color:this.fontOptions[l].color=this.fontOptions.color,u&&u.hasOwnProperty("mod")?this.fontOptions[l].mod=u.mod:e.font&&e.font[l]&&e.font[l].hasOwnProperty("mod")?this.fontOptions[l].mod=e.font[l].mod:e.font&&e.font.hasOwnProperty("mod")?this.fontOptions[l].mod=e.font.mod:this.fontOptions[l].mod=i.font[l].mod,u&&u.hasOwnProperty("size"))this.fontOptions[l].size=u.size;else if(e.font&&e.font[l]&&e.font[l].hasOwnProperty("size"))this.fontOptions[l].size=e.font[l].size;else if(this.fontOptions[l].face===i.font[l].face&&this.fontOptions.face===i.font.face){var f=this.fontOptions.size/Number(i.font.size);this.fontOptions[l].size=i.font[l].size*f}else e.font&&e.font.hasOwnProperty("size")?this.fontOptions[l].size=e.font.size:this.fontOptions[l].size=this.fontOptions.size;if(u&&u.hasOwnProperty("vadjust"))this.fontOptions[l].vadjust=u.vadjust;else if(e.font&&e.font[l]&&e.font[l].hasOwnProperty("vadjust"))this.fontOptions[l].vadjust=e.font[l].vadjust;else if(this.fontOptions[l].face===i.font[l].face&&this.fontOptions.face===i.font.face){var p=this.fontOptions.size/Number(i.font.size);this.fontOptions[l].vadjust=i.font[l].vadjust*Math.round(p)}else e.font&&e.font.hasOwnProperty("vadjust")?this.fontOptions[l].vadjust=e.font.vadjust:this.fontOptions[l].vadjust=this.fontOptions.vadjust}this.fontOptions[l].size=Number(this.fontOptions[l].size),this.fontOptions[l].vadjust=Number(this.fontOptions[l].vadjust)}}catch(t){s=!0,r=t}finally{try{!n&&h.return&&h.return()}finally{if(s)throw r}}}}},{key:"draw",value:function(t,e,i,o,n){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"middle";if(void 0!==this.elementOptions.label){var r=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&r5&&void 0!==arguments[5]?arguments[5]:"middle",a=this.fontOptions.size,d=a*this.body.view.scale;d>=this.elementOptions.scaling.label.maxVisible&&(a=Number(this.elementOptions.scaling.label.maxVisible)/this.body.view.scale);var h=this.size.yLine,l=this._setAlignment(t,o,h,r),u=(0,s.default)(l,2);o=u[0],h=u[1],t.textAlign="left",o-=this.size.width/2,this.fontOptions.valign&&this.size.height>this.size.labelHeight&&("top"===this.fontOptions.valign&&(h-=(this.size.height-this.size.labelHeight)/2),"bottom"===this.fontOptions.valign&&(h+=(this.size.height-this.size.labelHeight)/2));for(var c=0;c0&&(t.lineWidth=v.strokeWidth,t.strokeStyle=b,t.lineJoin="round"),t.fillStyle=m,v.strokeWidth>0&&t.strokeText(v.text,o+f,h+v.vadjust),t.fillText(v.text,o+f,h+v.vadjust),f+=v.width}h+=this.lines[c].height}}},{key:"_setAlignment",value:function(t,e,i,o){if(this.isEdgeLabel&&"horizontal"!==this.fontOptions.align&&this.pointToSelf===!1){e=0,i=0;var n=2;"top"===this.fontOptions.align?(t.textBaseline="alphabetic",i-=2*n):"bottom"===this.fontOptions.align?(t.textBaseline="hanging",i+=2*n):t.textBaseline="middle"}else t.textBaseline=o;return[e,i]}},{key:"_getColor",value:function(t,e,i){var o=t||"#000000",n=i||"#ffffff";if(e<=this.elementOptions.scaling.label.drawThreshold){var s=Math.max(0,Math.min(1,1-(this.elementOptions.scaling.label.drawThreshold-e)));o=p.overrideOpacity(o,s),n=p.overrideOpacity(n,s)}return[o,n]}},{key:"getTextSize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this._processLabel(t,e,i),{width:this.size.width,height:this.size.height,lineCount:this.lineCount}}},{key:"calculateLabelSize",value:function(t,e,i){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"middle";this.labelDirty===!0&&this._processLabel(t,e,i),this.size.left=o-.5*this.size.width,this.size.top=n-.5*this.size.height,this.size.yLine=n+.5*(1-this.lineCount)*this.fontOptions.size,"hanging"===s&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4),this.labelDirty=!1}},{key:"decodeMarkupSystem",value:function(t){var e="none";return"markdown"===t||"md"===t?e="markdown":t!==!0&&"html"!==t||(e="html"),e}},{key:"splitBlocks",value:function(t,e){var i=this.decodeMarkupSystem(e);return"none"===i?[{text:t,mod:"normal"}]:"markdown"===i?this.splitMarkdownBlocks(t):"html"===i?this.splitHtmlBlocks(t):void 0}},{key:"splitMarkdownBlocks",value:function(t){var e=[],i={bold:!1,ital:!1,mono:!1,beginable:!0,spacing:!1,position:0,buffer:"",modStack:[]};for(i.mod=function(){return 0===this.modStack.length?"normal":this.modStack[0]},i.modName=function(){return 0===this.modStack.length?"normal":"mono"===this.modStack[0]?"mono":i.bold&&i.ital?"boldital":i.bold?"bold":i.ital?"ital":void 0},i.emitBlock=function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.spacing&&(this.add(" "),this.spacing=!1),this.buffer.length>0&&(e.push({text:this.buffer,mod:this.modName()}),this.buffer="")},i.add=function(t){" "===t&&(i.spacing=!0),i.spacing&&(this.buffer+=" ",this.spacing=!1)," "!=t&&(this.buffer+=t)};i.position0&&void 0!==arguments[0]&&arguments[0];this.spacing&&(this.add(" "),this.spacing=!1),this.buffer.length>0&&(e.push({text:this.buffer,mod:this.modName()}),this.buffer="")},i.add=function(t){" "===t&&(i.spacing=!0),i.spacing&&(this.buffer+=" ",this.spacing=!1)," "!=t&&(this.buffer+=t)};i.position/.test(t.substr(i.position,3))?i.mono||i.ital||!//.test(t.substr(i.position,3))?!i.mono&&//.test(t.substr(i.position,6))?(i.emitBlock(),i.mono=!0,i.modStack.unshift("mono"),i.position+=5):!i.mono&&"bold"===i.mod()&&/<\/b>/.test(t.substr(i.position,4))?(i.emitBlock(),i.bold=!1,i.modStack.shift(),i.position+=3):!i.mono&&"ital"===i.mod()&&/<\/i>/.test(t.substr(i.position,4))?(i.emitBlock(),i.ital=!1,i.modStack.shift(),i.position+=3):"mono"===i.mod()&&/<\/code>/.test(t.substr(i.position,7))?(i.emitBlock(),i.mono=!1,i.modStack.shift(),i.position+=6):i.add(o):(i.emitBlock(),i.ital=!0,i.modStack.unshift("ital"),i.position+=2):(i.emitBlock(),i.bold=!0,i.modStack.unshift("bold"),i.position+=2):/&/.test(o)?/</.test(t.substr(i.position,4))?(i.add("<"),i.position+=3):/&/.test(t.substr(i.position,5))?(i.add("&"),i.position+=4):i.add("&"):i.add(o),i.position++}return i.emitBlock(),e}},{key:"getFormattingValues",value:function(t,e,i,o){var n={color:"normal"===o?this.fontOptions.color:this.fontOptions[o].color,size:"normal"===o?this.fontOptions.size:this.fontOptions[o].size,face:"normal"===o?this.fontOptions.face:this.fontOptions[o].face,mod:"normal"===o?"":this.fontOptions[o].mod,vadjust:"normal"===o?this.fontOptions.vadjust:this.fontOptions[o].vadjust,strokeWidth:this.fontOptions.strokeWidth,strokeColor:this.fontOptions.strokeColor};return"normal"===o?(e||i)&&(this.fontOptions.chooser===!0&&this.elementOptions.labelHighlightBold?n.mod="bold":"function"==typeof this.fontOptions.chooser&&this.fontOptions.chooser(t,n,this.elementOptions.id,e,i)):(e||i)&&"function"==typeof this.fontOptions.chooser&&this.fontOptions.chooser(t,n,this.elementOptions.id,e,i),t.font=(n.mod+" "+n.size+"px "+n.face).replace(/"/g,""),n.font=t.font,n.height=n.size,n}},{key:"differentState",value:function(t,e){return t!==this.fontOptions.selectedState&&e!==this.fontOptions.hoverState}},{key:"_processLabel",value:function(t,e,i){var o=0,n=0,s=[],r=0;if(s.add=function(t,e,i,o,n,s,r,a,d,h){this.length==t&&(this[t]={width:0,height:0,blocks:[]}),this[t].blocks.push({text:e,font:i,color:o,width:n,height:s,vadjust:r,mod:a,strokeWidth:d,strokeColor:h})},s.accumulate=function(t,e,i){this[t].width+=e,this[t].height=i>this[t].height?i:this[t].height},s.addAndAccumulate=function(t,e,i,o,n,s,r,a,d,h){this.add(t,e,i,o,n,s,r,a,d,h),this.accumulate(t,n,s)},void 0!==this.elementOptions.label){var a=String(this.elementOptions.label).split("\n"),d=a.length;if(this.elementOptions.font.multi)for(var h=0;h0)for(var v=this.getFormattingValues(t,e,i,l[p].mod),g=l[p].text.split(" "),y=!0,m="",b=void 0,_=void 0,w=0;wthis.fontOptions.maxWdt?(c=v.height>c?v.height:c,s.add(r,m,v.font,v.color,_.width,v.height,v.vadjust,l[p].mod,v.strokeWidth,v.strokeColor),s.accumulate(r,_.width,c),m="",y=!0,u=0,o=s[r].width>o?s[r].width:o,n+=s[r].height,r++):(m=m+k+g[w],w===g.length-1&&(c=v.height>c?v.height:c,u+=b.width,s.add(r,m,v.font,v.color,b.width,v.height,v.vadjust,l[p].mod,v.strokeWidth,v.strokeColor),s.accumulate(r,b.width,c),p===l.length-1&&(o=s[r].width>o?s[r].width:o,n+=s[r].height,r++)),w++,y=!1)}else{var x=this.getFormattingValues(t,e,i,l[p].mod),O=t.measureText(l[p].text);s.addAndAccumulate(r,l[p].text,x.font,x.color,O.width,x.height,x.vadjust,l[p].mod,x.strokeWidth,x.strokeColor),o=s[r].width>o?s[r].width:o,l.length-1===p&&(n+=s[r].height,r++)}}}else for(var M=0;M0)for(var E=a[M].split(" "),D="",C=void 0,T=void 0,P=0;Pthis.fontOptions.maxWdt?(s.addAndAccumulate(r,D,S.font,S.color,T.width,S.size,S.vadjust,"normal",S.strokeWidth,S.strokeColor),o=s[r].width>o?s[r].width:o,n+=s[r].height,D="",r++):(D=D+B+E[P],P===E.length-1&&(s.addAndAccumulate(r,D,S.font,S.color,C.width,S.size,S.vadjust,"normal",S.strokeWidth,S.strokeColor),o=s[r].width>o?s[r].width:o,n+=s[r].height,r++),P++)}else{var F=a[M],I=t.measureText(F);s.addAndAccumulate(r,F,S.font,S.color,I.width,S.size,S.vadjust,"normal",S.strokeWidth,S.strokeColor),o=s[r].width>o?s[r].width:o,n+=s[r].height,r++}}}this.fontOptions.minWdt>0&&o0&&n2&&void 0!==arguments[2]&&arguments[2];if("string"==typeof e.font){var o=e.font.split(" ");t.size=o[0].replace("px",""),t.face=o[1],t.color=o[2],t.vadjust=0}else"object"===(0,h.default)(e.font)&&p.fillIfDefined(t,e.font,i);t.size=Number(t.size),t.vadjust=Number(t.vadjust)}}]),t}();e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var n=i(105),s=o(n),r=i(2),a=o(r);e.default=function(){function t(t,e){var i=[],o=!0,n=!1,s=void 0;try{for(var r,d=(0,a.default)(t);!(o=(r=d.next()).done)&&(i.push(r.value),!e||i.length!==e);o=!0);}catch(t){n=!0,s=t}finally{try{!o&&d.return&&d.return()}finally{if(n)throw s}}return i}return function(e,i){if(Array.isArray(e))return e;if((0,s.default)(Object(e)))return t(e,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()},function(t,e,i){t.exports={default:i(106),__esModule:!0}},function(t,e,i){i(4),i(50),t.exports=i(107)},function(t,e,i){var o=i(54),n=i(47)("iterator"),s=i(8);t.exports=i(17).isIterable=function(t){var e=Object(t);return void 0!==e[n]||"@@iterator"in e||s.hasOwnProperty(o(e))}},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(109),s=o(n),r=i(95),a=o(r),d=i(96),h=o(d),l=i(112),u=o(l),c=i(113),f=o(c),p=i(118),v=o(p),g=function(t){function e(t,i,o){(0,a.default)(this,e);var n=(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o));return n._setMargins(o),n}return(0,f.default)(e,t),(0,h.default)(e,[{key:"resize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;(void 0===this.width||this.labelModule.differentState(e,i))&&(this.textSize=this.labelModule.getTextSize(t,e,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=this.width/2)}},{key:"draw",value:function(t,e,i,o,n,s){this.resize(t,o,n),this.left=e-this.width/2,this.top=i-this.height/2,t.strokeStyle=s.borderColor,t.lineWidth=s.borderWidth,t.lineWidth/=this.body.view.scale,t.lineWidth=Math.min(this.width,t.lineWidth),t.fillStyle=s.color,t.roundRect(this.left,this.top,this.width,this.height,s.borderRadius),this.enableShadow(t,s),t.fill(),this.disableShadow(t,s),t.save(),s.borderWidth>0&&(this.enableBorderDashes(t,s),t.stroke(),this.disableBorderDashes(t,s)),t.restore(),this.updateBoundingBox(e,i,t,o,n),this.labelModule.draw(t,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,o,n)}},{key:"updateBoundingBox",value:function(t,e,i,o,n){this.resize(i,o,n),this.left=t-this.width/2,this.top=e-this.height/2;var s=this.options.shapeProperties.borderRadius;this.boundingBox.left=this.left-s,this.boundingBox.top=this.top-s,this.boundingBox.bottom=this.top+this.height+s,this.boundingBox.right=this.left+this.width+s}},{key:"distanceToBorder",value:function(t,e){this.resize(t);var i=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(e)),Math.abs(this.height/2/Math.sin(e)))+i}}]),e}(v.default);e.default=g},function(t,e,i){t.exports={default:i(110),__esModule:!0}},function(t,e,i){i(111),t.exports=i(17).Object.getPrototypeOf},function(t,e,i){var o=i(49),n=i(48);i(61)("getPrototypeOf",function(){return function(t){return n(o(t))}})},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var n=i(62),s=o(n);e.default=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==("undefined"==typeof e?"undefined":(0,s.default)(e))&&"function"!=typeof e?t:e}},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var n=i(114),s=o(n),r=i(55),a=o(r),d=i(62),h=o(d);e.default=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof e?"undefined":(0,h.default)(e)));t.prototype=(0,a.default)(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(s.default?(0,s.default)(t,e):t.__proto__=e)}},function(t,e,i){t.exports={default:i(115),__esModule:!0}},function(t,e,i){i(116),t.exports=i(17).Object.setPrototypeOf},function(t,e,i){var o=i(15);o(o.S,"Object",{setPrototypeOf:i(117).set})},function(t,e,i){var o=i(23),n=i(22),s=function(t,e){if(n(t),!o(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,o){try{o=i(18)(Function.call,i(78).f(Object.prototype,"__proto__").set,2),o(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,i){return s(t,i),e?t.__proto__=i:o(t,i),t}}({},!1):void 0),check:s}},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(62),s=o(n),r=i(95),a=o(r),d=i(96),h=o(d),l=function(){function t(e,i,o){(0,a.default)(this,t),this.body=i,this.labelModule=o,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.boundingBox={top:0,left:0,right:0,bottom:0}}return(0,h.default)(t,[{key:"setOptions",value:function(t){this.options=t}},{key:"_setMargins",value:function(t){this.margin={},this.options.margin&&("object"==(0,s.default)(this.options.margin)?(this.margin.top=this.options.margin.top,this.margin.right=this.options.margin.right,this.margin.bottom=this.options.margin.bottom,this.margin.left=this.options.margin.left):(this.margin.top=this.options.margin,this.margin.right=this.options.margin,this.margin.bottom=this.options.margin,this.margin.left=this.options.margin)),t.adjustSizes(this.margin)}},{key:"_distanceToBorder",value:function(t,e){var i=this.options.borderWidth;return this.resize(t),Math.min(Math.abs(this.width/2/Math.cos(e)),Math.abs(this.height/2/Math.sin(e)))+i}},{key:"enableShadow",value:function(t,e){e.shadow&&(t.shadowColor=e.shadowColor,t.shadowBlur=e.shadowSize,t.shadowOffsetX=e.shadowX,t.shadowOffsetY=e.shadowY)}},{key:"disableShadow",value:function(t,e){e.shadow&&(t.shadowColor="rgba(0,0,0,0)",t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0)}},{key:"enableBorderDashes",value:function(t,e){if(e.borderDashes!==!1)if(void 0!==t.setLineDash){var i=e.borderDashes;i===!0&&(i=[5,15]),t.setLineDash(i)}else console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,e.borderDashes=!1}},{key:"disableBorderDashes",value:function(t,e){e.borderDashes!==!1&&(void 0!==t.setLineDash?t.setLineDash([0]):(console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,e.borderDashes=!1))}}]),t}();e.default=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(109),s=o(n),r=i(95),a=o(r),d=i(96),h=o(d),l=i(112),u=o(l),c=i(113),f=o(c),p=i(120),v=o(p),g=function(t){function e(t,i,o){(0,a.default)(this,e);var n=(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o));return n._setMargins(o),n}return(0,f.default)(e,t),(0,h.default)(e,[{key:"resize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;arguments.length>3&&void 0!==arguments[3]?arguments[3]:{size:this.options.size};if(void 0===this.width||this.labelModule.differentState(e,i)){this.textSize=this.labelModule.getTextSize(t,e,i);var o=Math.max(this.textSize.width+this.margin.right+this.margin.left,this.textSize.height+this.margin.top+this.margin.bottom);this.options.size=o/2,this.width=o,this.height=o,this.radius=this.width/2}}},{key:"draw",value:function(t,e,i,o,n,s){this.resize(t,o,n),this.left=e-this.width/2,this.top=i-this.height/2,this._drawRawCircle(t,e,i,o,n,s),this.boundingBox.top=i-s.size,this.boundingBox.left=e-s.size,this.boundingBox.right=e+s.size,this.boundingBox.bottom=i+s.size,this.updateBoundingBox(e,i),this.labelModule.draw(t,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,o,n)}},{key:"updateBoundingBox",value:function(t,e){this.boundingBox.top=e-this.options.size,this.boundingBox.left=t-this.options.size,this.boundingBox.right=t+this.options.size,this.boundingBox.bottom=e+this.options.size}},{key:"distanceToBorder",value:function(t,e){return this.resize(t),.5*this.width}}]),e}(v.default);e.default=g},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(109),s=o(n),r=i(95),a=o(r),d=i(96),h=o(d),l=i(112),u=o(l),c=i(113),f=o(c),p=i(118),v=o(p),g=function(t){function e(t,i,o){(0,a.default)(this,e);var n=(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o));return n.labelOffset=0,n.imageLoaded=!1,n}return(0,f.default)(e,t),(0,h.default)(e,[{key:"setOptions",value:function(t,e){this.options=t,e&&(this.imageObj=e)}},{key:"_resizeImage",value:function(){var t=!1;if(this.imageObj.width&&this.imageObj.height?this.imageLoaded===!1&&(this.imageLoaded=!0,t=!0):this.imageLoaded=!1,!this.width||!this.height||t===!0){var e,i,o;this.imageObj.width&&this.imageObj.height&&(e=0,i=0),this.options.shapeProperties.useImageSize===!1?this.imageObj.width>this.imageObj.height?(o=this.imageObj.width/this.imageObj.height,e=2*this.options.size*o||this.imageObj.width,i=2*this.options.size||this.imageObj.height):(o=this.imageObj.width&&this.imageObj.height?this.imageObj.height/this.imageObj.width:1,e=2*this.options.size,i=2*this.options.size*o):(e=this.imageObj.width,i=this.imageObj.height),this.width=e,this.height=i,this.radius=.5*this.width}}},{key:"_drawRawCircle",value:function(t,e,i,o,n,s){var r=s.borderWidth/this.body.view.scale;t.lineWidth=Math.min(this.width,r),t.strokeStyle=s.borderColor,t.fillStyle=s.color,t.circle(e,i,s.size),this.enableShadow(t,s),t.fill(),this.disableShadow(t,s),t.save(),r>0&&(this.enableBorderDashes(t,s),t.stroke(),this.disableBorderDashes(t,s)),t.restore()}},{key:"_drawImageAtPosition",value:function(t,e){if(0!=this.imageObj.width){t.globalAlpha=1,this.enableShadow(t,e);var i=this.imageObj.width/this.width/this.body.view.scale;if(i>2&&this.options.shapeProperties.interpolation===!0){var o=this.imageObj.width,n=this.imageObj.height,s=document.createElement("canvas");s.width=o,s.height=o;var r=s.getContext("2d");i*=.5,o*=.5,n*=.5,r.drawImage(this.imageObj,0,0,o,n);for(var a=0,d=1;i>2&&d<4;)r.drawImage(s,a,0,o,n,a+o,0,o/2,n/2),a+=o,i*=.5,o*=.5,n*=.5,d+=1;t.drawImage(s,a,0,o,n,this.left,this.top,this.width,this.height)}else t.drawImage(this.imageObj,this.left,this.top,this.width,this.height);this.disableShadow(t,e)}}},{key:"_drawImageLabel",value:function(t,e,i,o,n){var s,r=0;if(void 0!==this.height){r=.5*this.height;var a=this.labelModule.getTextSize(t,o,n);a.lineCount>=1&&(r+=a.height/2)}s=i+r,this.options.label&&(this.labelOffset=r),this.labelModule.draw(t,e,s,o,n,"hanging")}}]),e}(v.default);e.default=g},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(109),s=o(n),r=i(95),a=o(r),d=i(96),h=o(d),l=i(112),u=o(l),c=i(113),f=o(c),p=i(120),v=o(p),g=function(t){function e(t,i,o,n){(0,a.default)(this,e);var r=(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o));return r.imageObj=n,r._swapToImageResizeWhenImageLoaded=!0,r}return(0,f.default)(e,t),(0,h.default)(e,[{key:"resize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(void 0===this.imageObj.src||void 0===this.imageObj.width||void 0===this.imageObj.height||this.labelModule.differentState(e,i)){var o=2*this.options.size;this.width=o,this.height=o,this._swapToImageResizeWhenImageLoaded=!0,this.radius=.5*this.width}else this._swapToImageResizeWhenImageLoaded&&(this.width=void 0,this.height=void 0,this._swapToImageResizeWhenImageLoaded=!1),this._resizeImage()}},{key:"draw",value:function(t,e,i,o,n,s){this.resize(),this.left=e-this.width/2,this.top=i-this.height/2;Math.min(.5*this.height,.5*this.width);this._drawRawCircle(t,e,i,o,n,s),t.save(),t.clip(),this._drawImageAtPosition(t,s),t.restore(),this._drawImageLabel(t,e,i,o,n),this.updateBoundingBox(e,i)}},{key:"updateBoundingBox",value:function(t,e){this.boundingBox.top=e-this.options.size,this.boundingBox.left=t-this.options.size,this.boundingBox.right=t+this.options.size,this.boundingBox.bottom=e+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(t,e){return this.resize(t),.5*this.width}}]),e}(v.default);e.default=g},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(109),s=o(n),r=i(95),a=o(r),d=i(96),h=o(d),l=i(112),u=o(l),c=i(113),f=o(c),p=i(118),v=o(p),g=function(t){function e(t,i,o){(0,a.default)(this,e);var n=(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o));return n._setMargins(o),n}return(0,f.default)(e,t),(0,h.default)(e,[{key:"resize",value:function(t,e,i){if(void 0===this.width||this.labelModule.differentState(e,i)){this.textSize=this.labelModule.getTextSize(t,e,i);var o=this.textSize.width+this.margin.right+this.margin.left;this.width=o,this.height=o,this.radius=this.width/2}}},{key:"draw",value:function(t,e,i,o,n,s){this.resize(t,o,n),this.left=e-this.width/2,this.top=i-this.height/2;var r=s.borderWidth/this.body.view.scale;t.lineWidth=Math.min(this.width,r),t.strokeStyle=s.borderColor,t.fillStyle=s.color,t.database(e-this.width/2,i-this.height/2,this.width,this.height),this.enableShadow(t,s),t.fill(),this.disableShadow(t,s),t.save(),r>0&&(this.enableBorderDashes(t,s),t.stroke(),this.disableBorderDashes(t,s)),t.restore(),this.updateBoundingBox(e,i,t,o,n),this.labelModule.draw(t,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,o,n)}},{key:"updateBoundingBox",value:function(t,e,i,o,n){this.resize(i,o,n),this.left=t-.5*this.width, +this.top=e-.5*this.height,this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(v.default);e.default=g},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(109),s=o(n),r=i(95),a=o(r),d=i(96),h=o(d),l=i(112),u=o(l),c=i(113),f=o(c),p=i(124),v=o(p),g=function(t){function e(t,i,o){return(0,a.default)(this,e),(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o))}return(0,f.default)(e,t),(0,h.default)(e,[{key:"resize",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.selected,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.hover;this._resizeShape(i,o,e)}},{key:"draw",value:function(t,e,i,o,n,s){this._drawShape(t,"diamond",4,e,i,o,n,s)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(v.default);e.default=g},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(109),s=o(n),r=i(95),a=o(r),d=i(96),h=o(d),l=i(112),u=o(l),c=i(113),f=o(c),p=i(118),v=o(p),g=function(t){function e(t,i,o){return(0,a.default)(this,e),(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o))}return(0,f.default)(e,t),(0,h.default)(e,[{key:"_resizeShape",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.selected,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.hover,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{size:this.options.size};if(void 0===this.width||this.labelModule.differentState(t,e)){var o=2*i.size;this.width=o,this.height=o,this.radius=.5*this.width}}},{key:"_drawShape",value:function(t,e,i,o,n,s,r,a){this._resizeShape(s,r,a),this.left=o-this.width/2,this.top=n-this.height/2;var d=a.borderWidth/this.body.view.scale;if(t.lineWidth=Math.min(this.width,d),t.strokeStyle=a.borderColor,t.fillStyle=a.color,t[e](o,n,a.size),this.enableShadow(t,a),t.fill(),this.disableShadow(t,a),t.save(),d>0&&(this.enableBorderDashes(t,a),t.stroke(),this.disableBorderDashes(t,a)),t.restore(),void 0!==this.options.label){var h=n+.5*this.height+3;this.labelModule.draw(t,o,h,s,r,"hanging")}this.updateBoundingBox(o,n)}},{key:"updateBoundingBox",value:function(t,e){this.boundingBox.top=e-this.options.size,this.boundingBox.left=t-this.options.size,this.boundingBox.right=t+this.options.size,this.boundingBox.bottom=e+this.options.size,void 0!==this.options.label&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+3))}}]),e}(v.default);e.default=g},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(109),s=o(n),r=i(95),a=o(r),d=i(96),h=o(d),l=i(112),u=o(l),c=i(113),f=o(c),p=i(124),v=o(p),g=function(t){function e(t,i,o){return(0,a.default)(this,e),(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o))}return(0,f.default)(e,t),(0,h.default)(e,[{key:"resize",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.selected,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.hover;this._resizeShape(i,o,e)}},{key:"draw",value:function(t,e,i,o,n,s){this._drawShape(t,"circle",2,e,i,o,n,s)}},{key:"distanceToBorder",value:function(t,e){return this.resize(t),this.options.size}}]),e}(v.default);e.default=g},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(109),s=o(n),r=i(95),a=o(r),d=i(96),h=o(d),l=i(112),u=o(l),c=i(113),f=o(c),p=i(118),v=o(p),g=function(t){function e(t,i,o){return(0,a.default)(this,e),(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o))}return(0,f.default)(e,t),(0,h.default)(e,[{key:"resize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(void 0===this.width||this.labelModule.differentState(e,i)){var o=this.labelModule.getTextSize(t,e,i);this.height=2*o.height,this.width=o.width+this.height,this.radius=.5*this.width}}},{key:"draw",value:function(t,e,i,o,n,s){this.resize(t,o,n),this.left=e-.5*this.width,this.top=i-.5*this.height;var r=s.borderWidth/this.body.view.scale;t.lineWidth=Math.min(this.width,r),t.strokeStyle=s.borderColor,t.fillStyle=s.color,t.ellipse(this.left,this.top,this.width,this.height),this.enableShadow(t,s),t.fill(),this.disableShadow(t,s),t.save(),r>0&&(this.enableBorderDashes(t,s),t.stroke(),this.disableBorderDashes(t,s)),t.restore(),this.updateBoundingBox(e,i,t,o,n),this.labelModule.draw(t,e,i,o,n)}},{key:"updateBoundingBox",value:function(t,e,i,o,n){this.resize(i,o,n),this.left=t-.5*this.width,this.top=e-.5*this.height,this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width}},{key:"distanceToBorder",value:function(t,e){this.resize(t);var i=.5*this.width,o=.5*this.height,n=Math.sin(e)*i,s=Math.cos(e)*o;return i*o/Math.sqrt(n*n+s*s)}}]),e}(v.default);e.default=g},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(109),s=o(n),r=i(95),a=o(r),d=i(96),h=o(d),l=i(112),u=o(l),c=i(113),f=o(c),p=i(118),v=o(p),g=function(t){function e(t,i,o){(0,a.default)(this,e);var n=(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o));return n._setMargins(o),n}return(0,f.default)(e,t),(0,h.default)(e,[{key:"resize",value:function(t,e,i){(void 0===this.width||this.labelModule.differentState(e,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(t,e,i,o,n,s){if(this.resize(t,o,n),this.options.icon.size=this.options.icon.size||50,this.left=e-this.width/2,this.top=i-this.height/2,this._icon(t,e,i,o,n,s),void 0!==this.options.label){var r=5;this.labelModule.draw(t,this.left+this.iconSize.width/2+this.margin.left,i+this.height/2+r,o)}this.updateBoundingBox(e,i)}},{key:"updateBoundingBox",value:function(t,e){if(this.boundingBox.top=e-.5*this.options.icon.size,this.boundingBox.left=t-.5*this.options.icon.size,this.boundingBox.right=t+.5*this.options.icon.size,this.boundingBox.bottom=e+.5*this.options.icon.size,void 0!==this.options.label&&this.labelModule.size.width>0){var i=5;this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+i)}}},{key:"_icon",value:function(t,e,i,o,n,s){var r=Number(this.options.icon.size);void 0!==this.options.icon.code?(t.font=(o?"bold ":"")+r+"px "+this.options.icon.face,t.fillStyle=this.options.icon.color||"black",t.textAlign="center",t.textBaseline="middle",this.enableShadow(t,s),t.fillText(this.options.icon.code,e,i),this.disableShadow(t,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(t,e){return this._distanceToBorder(t,e)}}]),e}(v.default);e.default=g},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(109),s=o(n),r=i(95),a=o(r),d=i(96),h=o(d),l=i(112),u=o(l),c=i(113),f=o(c),p=i(120),v=o(p),g=function(t){function e(t,i,o,n){(0,a.default)(this,e);var r=(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o));return r.imageObj=n,r}return(0,f.default)(e,t),(0,h.default)(e,[{key:"resize",value:function(){this._resizeImage()}},{key:"draw",value:function(t,e,i,o,n,s){if(this.resize(),this.left=e-this.width/2,this.top=i-this.height/2,this.options.shapeProperties.useBorderWithImage===!0){var r=this.options.borderWidth,a=this.options.borderWidthSelected||2*this.options.borderWidth,d=(o?a:r)/this.body.view.scale;t.lineWidth=Math.min(this.width,d),t.beginPath(),t.strokeStyle=o?this.options.color.highlight.border:n?this.options.color.hover.border:this.options.color.border,t.fillStyle=o?this.options.color.highlight.background:n?this.options.color.hover.background:this.options.color.background,t.rect(this.left-.5*t.lineWidth,this.top-.5*t.lineWidth,this.width+t.lineWidth,this.height+t.lineWidth),t.fill(),t.save(),d>0&&(this.enableBorderDashes(t),t.stroke(),this.disableBorderDashes(t)),t.restore(),t.closePath()}this._drawImageAtPosition(t,s),this._drawImageLabel(t,e,i,o,n),this.updateBoundingBox(e,i)}},{key:"updateBoundingBox",value:function(t,e){this.resize(),this.left=t-this.width/2,this.top=e-this.height/2,this.boundingBox.top=this.top,this.boundingBox.left=this.left,this.boundingBox.right=this.left+this.width,this.boundingBox.bottom=this.top+this.height,void 0!==this.options.label&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset))}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(v.default);e.default=g},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(109),s=o(n),r=i(95),a=o(r),d=i(96),h=o(d),l=i(112),u=o(l),c=i(113),f=o(c),p=i(124),v=o(p),g=function(t){function e(t,i,o){return(0,a.default)(this,e),(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o))}return(0,f.default)(e,t),(0,h.default)(e,[{key:"resize",value:function(){this._resizeShape()}},{key:"draw",value:function(t,e,i,o,n,s){this._drawShape(t,"square",2,e,i,o,n,s)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(v.default);e.default=g},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(109),s=o(n),r=i(95),a=o(r),d=i(96),h=o(d),l=i(112),u=o(l),c=i(113),f=o(c),p=i(124),v=o(p),g=function(t){function e(t,i,o){return(0,a.default)(this,e),(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o))}return(0,f.default)(e,t),(0,h.default)(e,[{key:"resize",value:function(t,e,i,o){this._resizeShape(i,o,e)}},{key:"draw",value:function(t,e,i,o,n,s){this._drawShape(t,"star",4,e,i,o,n,s)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(v.default);e.default=g},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(109),s=o(n),r=i(95),a=o(r),d=i(96),h=o(d),l=i(112),u=o(l),c=i(113),f=o(c),p=i(118),v=o(p),g=function(t){function e(t,i,o){(0,a.default)(this,e);var n=(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o));return n._setMargins(o),n}return(0,f.default)(e,t),(0,h.default)(e,[{key:"resize",value:function(t,e,i){(void 0===this.width||this.labelModule.differentState(e,i))&&(this.textSize=this.labelModule.getTextSize(t,e,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(t,e,i,o,n,s){this.resize(t,o,n),this.left=e-this.width/2,this.top=i-this.height/2,this.enableShadow(t,s),this.labelModule.draw(t,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,o,n),this.disableShadow(t,s),this.updateBoundingBox(e,i,t,o,n)}},{key:"updateBoundingBox",value:function(t,e,i,o,n){this.resize(i,o,n),this.left=t-this.width/2,this.top=e-this.height/2,this.boundingBox.top=this.top,this.boundingBox.left=this.left,this.boundingBox.right=this.left+this.width,this.boundingBox.bottom=this.top+this.height}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(v.default);e.default=g},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(109),s=o(n),r=i(95),a=o(r),d=i(96),h=o(d),l=i(112),u=o(l),c=i(113),f=o(c),p=i(124),v=o(p),g=function(t){function e(t,i,o){return(0,a.default)(this,e),(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o))}return(0,f.default)(e,t),(0,h.default)(e,[{key:"resize",value:function(t){this._resizeShape()}},{key:"draw",value:function(t,e,i,o,n,s){this._drawShape(t,"triangle",3,e,i,o,n,s)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(v.default);e.default=g},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(109),s=o(n),r=i(95),a=o(r),d=i(96),h=o(d),l=i(112),u=o(l),c=i(113),f=o(c),p=i(124),v=o(p),g=function(t){function e(t,i,o){return(0,a.default)(this,e),(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o))}return(0,f.default)(e,t),(0,h.default)(e,[{key:"resize",value:function(t){this._resizeShape()}},{key:"draw",value:function(t,e,i,o,n,s){this._drawShape(t,"triangleDown",3,e,i,o,n,s)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(v.default);e.default=g},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.printStyle=void 0;var n=i(82),s=o(n),r=i(62),a=o(r),d=i(58),h=o(d),l=i(95),u=o(l),c=i(96),f=o(c),p=i(1),v=!1,g=void 0,y="background: #FFeeee; color: #dd0000",m=function(){function t(){(0,u.default)(this,t)}return(0,f.default)(t,null,[{key:"validate",value:function(e,i,o){v=!1,g=i;var n=i;return void 0!==o&&(n=i[o]),t.parse(e,n,[]),v}},{key:"parse",value:function(e,i,o){for(var n in e)e.hasOwnProperty(n)&&t.check(n,e,i,o)}},{key:"check",value:function(e,i,o,n){void 0===o[e]&&void 0===o.__any__?t.getSuggestion(e,o,n):void 0===o[e]&&void 0!==o.__any__?"object"===t.getType(i[e])&&void 0!==o.__any__.__type__?t.checkFields(e,i,o,"__any__",o.__any__.__type__,n):t.checkFields(e,i,o,"__any__",o.__any__,n):void 0!==o[e].__type__?t.checkFields(e,i,o,e,o[e].__type__,n):t.checkFields(e,i,o,e,o[e],n)}},{key:"checkFields",value:function(e,i,o,n,s,r){var a=t.getType(i[e]),d=s[a];void 0!==d?"array"===t.getType(d)&&d.indexOf(i[e])===-1?(console.log('%cInvalid option detected in "'+e+'". Allowed values are:'+t.print(d)+' not "'+i[e]+'". '+t.printLocation(r,e),y),v=!0):"object"===a&&"__any__"!==n&&(r=p.copyAndExtendArray(r,e),t.parse(i[e],o[n],r)):void 0===s.any&&(console.log('%cInvalid type received for "'+e+'". Expected: '+t.print((0,h.default)(s))+". Received ["+a+'] "'+i[e]+'"'+t.printLocation(r,e),y),v=!0)}},{key:"getType",value:function(t){var e="undefined"==typeof t?"undefined":(0,a.default)(t);return"object"===e?null===t?"null":t instanceof Boolean?"boolean":t instanceof Number?"number":t instanceof String?"string":Array.isArray(t)?"array":t instanceof Date?"date":void 0!==t.nodeType?"dom":t._isAMomentObject===!0?"moment":"object":"number"===e?"number":"boolean"===e?"boolean":"string"===e?"string":void 0===e?"undefined":e}},{key:"getSuggestion",value:function(e,i,o){var n=t.findInOptions(e,i,o,!1),s=t.findInOptions(e,g,[],!0),r=8,a=4;void 0!==n.indexMatch?console.log('%cUnknown option detected: "'+e+'" in '+t.printLocation(n.path,e,"")+'Perhaps it was incomplete? Did you mean: "'+n.indexMatch+'"?\n\n',y):s.distance<=a&&n.distance>s.distance?console.log('%cUnknown option detected: "'+e+'" in '+t.printLocation(n.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+t.printLocation(s.path,s.closestMatch,""),y):n.distance<=r?console.log('%cUnknown option detected: "'+e+'". Did you mean "'+n.closestMatch+'"?'+t.printLocation(n.path,e),y):console.log('%cUnknown option detected: "'+e+'". Did you mean one of these: '+t.print((0,h.default)(i))+t.printLocation(o,e),y),v=!0}},{key:"findInOptions",value:function(e,i,o){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=1e9,r="",a=[],d=e.toLowerCase(),h=void 0;for(var l in i){var u=void 0;if(void 0!==i[l].__type__&&n===!0){var c=t.findInOptions(e,i[l],p.copyAndExtendArray(o,l));s>c.distance&&(r=c.closestMatch,a=c.path,s=c.distance,h=c.indexMatch)}else l.toLowerCase().indexOf(d)!==-1&&(h=l),u=t.levenshteinDistance(e,l),s>u&&(r=l,a=p.copyArray(o),s=u)}return{closestMatch:r,path:a,distance:s,indexMatch:h}}},{key:"printLocation",value:function(t,e){for(var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Problem value found at: \n",o="\n\n"+i+"options = {\n",n=0;n1&&void 0!==arguments[1]&&arguments[1],o=this.body.data.edges;if(t instanceof f||t instanceof p)this.body.data.edges=t;else if(Array.isArray(t))this.body.data.edges=new f,this.body.data.edges.add(t);else{if(t)throw new TypeError("Array or DataSet expected");this.body.data.edges=new f}if(o&&c.forEach(this.edgesListeners,function(t,e){o.off(e,t)}),this.body.edges={},this.body.data.edges){c.forEach(this.edgesListeners,function(t,i){e.body.data.edges.on(i,t)});var n=this.body.data.edges.getIds();this.add(n,!0)}i===!1&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.body.edges,o=this.body.data.edges,n=0;ni.shape.height?(r=i.x+.5*i.shape.width,a=i.y-d):(r=i.x+d,a=i.y-.5*i.shape.height),s=this._pointOnCircle(r,a,d,.125),this.labelModule.draw(t,s.x,s.y,n,this.hover)}}}},{key:"isOverlappingWith",value:function(t){if(this.connected){var e=10,i=this.from.x,o=this.from.y,n=this.to.x,s=this.to.y,r=t.left,a=t.top,d=this.edgeType.getDistanceToEdge(i,o,n,s,r,a);return d0&&i<0)&&(o+=Math.PI),t.rotate(o)}},{key:"_pointOnCircle",value:function(t,e,i,o){var n=2*o*Math.PI;return{x:t+i*Math.cos(n),y:e-i*Math.sin(n)}}},{key:"select",value:function(){this.selected=!0}},{key:"unselect",value:function(){this.selected=!1}},{key:"cleanup",value:function(){return this.edgeType.cleanup()}}],[{ +key:"parseOptions",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=["arrowStrikethrough","id","from","hidden","hoverWidth","label","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","to","title","value","width"];if(O.selectiveDeepExtend(n,t,e,i),O.mergeOptions(t,e,"smooth",i,o),O.mergeOptions(t,e,"shadow",i,o),void 0!==e.dashes&&null!==e.dashes?t.dashes=e.dashes:i===!0&&null===e.dashes&&(t.dashes=(0,a.default)(o.dashes)),void 0!==e.scaling&&null!==e.scaling?(void 0!==e.scaling.min&&(t.scaling.min=e.scaling.min),void 0!==e.scaling.max&&(t.scaling.max=e.scaling.max),O.mergeOptions(t.scaling,e.scaling,"label",i,o.scaling)):i===!0&&null===e.scaling&&(t.scaling=(0,a.default)(o.scaling)),void 0!==e.arrows&&null!==e.arrows)if("string"==typeof e.arrows){var r=e.arrows.toLowerCase();t.arrows.to.enabled=r.indexOf("to")!=-1,t.arrows.middle.enabled=r.indexOf("middle")!=-1,t.arrows.from.enabled=r.indexOf("from")!=-1}else{if("object"!==(0,h.default)(e.arrows))throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+(0,s.default)(e.arrows));O.mergeOptions(t.arrows,e.arrows,"to",i,o.arrows),O.mergeOptions(t.arrows,e.arrows,"middle",i,o.arrows),O.mergeOptions(t.arrows,e.arrows,"from",i,o.arrows)}else i===!0&&null===e.arrows&&(t.arrows=(0,a.default)(o.arrows));if(void 0!==e.color&&null!==e.color)if(t.color=O.deepExtend({},t.color,!0),O.isString(e.color))t.color.color=e.color,t.color.highlight=e.color,t.color.hover=e.color,t.color.inherit=!1;else{var d=!1;void 0!==e.color.color&&(t.color.color=e.color.color,d=!0),void 0!==e.color.highlight&&(t.color.highlight=e.color.highlight,d=!0),void 0!==e.color.hover&&(t.color.hover=e.color.hover,d=!0),void 0!==e.color.inherit&&(t.color.inherit=e.color.inherit),void 0!==e.color.opacity&&(t.color.opacity=Math.min(1,Math.max(0,e.color.opacity))),void 0===e.color.inherit&&d===!0&&(t.color.inherit=!1)}else i===!0&&null===e.color&&(t.color=O.bridgeObject(o.color));void 0!==e.font&&null!==e.font?v.default.parseOptions(t.font,e):i===!0&&null===e.font&&(t.font=O.bridgeObject(o.font))}}]),t}();e.default=M},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(104),s=o(n),r=i(109),a=o(r),d=i(95),h=o(d),l=i(96),u=o(l),c=i(112),f=o(c),p=i(113),v=o(p),g=i(138),y=o(g),m=function(t){function e(t,i,o){return(0,h.default)(this,e),(0,f.default)(this,(e.__proto__||(0,a.default)(e)).call(this,t,i,o))}return(0,v.default)(e,t),(0,u.default)(e,[{key:"_line",value:function(t,e,i){var o=i[0],n=i[1];t.beginPath(),t.moveTo(this.fromPoint.x,this.fromPoint.y),void 0===i||void 0===o.x?t.lineTo(this.toPoint.x,this.toPoint.y):t.bezierCurveTo(o.x,o.y,n.x,n.y,this.toPoint.x,this.toPoint.y),this.enableShadow(t,e),t.stroke(),this.disableShadow(t,e)}},{key:"_getViaCoordinates",value:function(){var t=this.from.x-this.to.x,e=this.from.y-this.to.y,i=void 0,o=void 0,n=void 0,s=void 0,r=this.options.smooth.roundness;return(Math.abs(t)>Math.abs(e)||this.options.smooth.forceDirection===!0||"horizontal"===this.options.smooth.forceDirection)&&"vertical"!==this.options.smooth.forceDirection?(o=this.from.y,s=this.to.y,i=this.from.x-r*t,n=this.to.x+r*t):(o=this.from.y-r*e,s=this.to.y+r*e,i=this.from.x,n=this.to.x),[{x:i,y:o},{x:n,y:s}]}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_findBorderPosition",value:function(t,e){return this._findBorderPositionBezier(t,e)}},{key:"_getDistanceToEdge",value:function(t,e,i,o,n,r){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:this._getViaCoordinates(),d=(0,s.default)(a,2),h=d[0],l=d[1];return this._getDistanceToBezierEdge(t,e,i,o,n,r,h,l)}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._getViaCoordinates(),i=(0,s.default)(e,2),o=i[0],n=i[1],r=t,a=[];a[0]=Math.pow(1-r,3),a[1]=3*r*Math.pow(1-r,2),a[2]=3*Math.pow(r,2)*(1-r),a[3]=Math.pow(r,3);var d=a[0]*this.fromPoint.x+a[1]*o.x+a[2]*n.x+a[3]*this.toPoint.x,h=a[0]*this.fromPoint.y+a[1]*o.y+a[2]*n.y+a[3]*this.toPoint.y;return{x:d,y:h}}}]),e}(y.default);e.default=m},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(109),s=o(n),r=i(95),a=o(r),d=i(96),h=o(d),l=i(112),u=o(l),c=i(113),f=o(c),p=i(139),v=o(p),g=function(t){function e(t,i,o){return(0,a.default)(this,e),(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o))}return(0,f.default)(e,t),(0,h.default)(e,[{key:"_getDistanceToBezierEdge",value:function(t,e,i,o,n,s,r,a){var d=1e9,h=void 0,l=void 0,u=void 0,c=void 0,f=void 0,p=t,v=e,g=[0,0,0,0];for(l=1;l<10;l++)u=.1*l,g[0]=Math.pow(1-u,3),g[1]=3*u*Math.pow(1-u,2),g[2]=3*Math.pow(u,2)*(1-u),g[3]=Math.pow(u,3),c=g[0]*t+g[1]*r.x+g[2]*a.x+g[3]*i,f=g[0]*e+g[1]*r.y+g[2]*a.y+g[3]*o,l>0&&(h=this._getDistanceToLine(p,v,c,f,n,s),d=h2&&void 0!==arguments[2]?arguments[2]:this._getViaCoordinates(),d=10,h=0,l=0,u=1,c=.2,f=this.to,p=!1;for(t.id===this.from.id&&(f=this.from,p=!0);l<=u&&h0&&(d=this._getDistanceToLine(f,p,u,c,n,s),a=do.shape.height?(e=o.x+.5*o.shape.width,i=o.y-n):(e=o.x+n,i=o.y-.5*o.shape.height),[e,i,n]}},{key:"_pointOnCircle",value:function(t,e,i,o){var n=2*o*Math.PI;return{x:t+i*Math.cos(n),y:e-i*Math.sin(n)}}},{key:"_findBorderPositionCircle",value:function(t,e,i){for(var o=i.x,n=i.y,s=i.low,r=i.high,a=i.direction,d=10,h=0,l=this.options.selfReferenceSize,u=void 0,c=void 0,f=void 0,p=void 0,v=void 0,g=.05,y=.5*(s+r);s<=r&&h0?a>0?s=y:r=y:a>0?r=y:s=y,h++;return u.t=y,u}},{key:"getLineWidth",value:function(t,e){return t===!0?Math.max(this.selectionWidth,.3/this.body.view.scale):e===!0?Math.max(this.hoverWidth,.3/this.body.view.scale):Math.max(this.options.width,.3/this.body.view.scale)}},{key:"getColor",value:function(t,e,i,o){if(e.inheritsColor!==!1){if("both"===e.inheritsColor&&this.from.id!==this.to.id){var n=t.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y),s=void 0,r=void 0;return s=this.from.options.color.highlight.border,r=this.to.options.color.highlight.border,this.from.selected===!1&&this.to.selected===!1?(s=l.overrideOpacity(this.from.options.color.border,e.opacity),r=l.overrideOpacity(this.to.options.color.border,e.opacity)):this.from.selected===!0&&this.to.selected===!1?r=this.to.options.color.border:this.from.selected===!1&&this.to.selected===!0&&(s=this.from.options.color.border),n.addColorStop(0,s),n.addColorStop(1,r),n}return"to"===e.inheritsColor?l.overrideOpacity(this.to.options.color.border,e.opacity):l.overrideOpacity(this.from.options.color.border,e.opacity)}return l.overrideOpacity(e.color,e.opacity)}},{key:"_circle",value:function(t,e,i,o,n){this.enableShadow(t,e),t.beginPath(),t.arc(i,o,n,0,2*Math.PI,!1),t.stroke(),this.disableShadow(t,e)}},{key:"getDistanceToEdge",value:function(t,e,i,o,n,r,a,d){var h=0;if(this.from!=this.to)h=this._getDistanceToEdge(t,e,i,o,n,r,a);else{var l=this._getCircleData(void 0,d),u=(0,s.default)(l,3),c=u[0],f=u[1],p=u[2],v=c-n,g=f-r;h=Math.abs(Math.sqrt(v*v+g*g)-p)}return this.labelModule.size.leftn&&this.labelModule.size.topr?0:h}},{key:"_getDistanceToLine",value:function(t,e,i,o,n,s){var r=i-t,a=o-e,d=r*r+a*a,h=((n-t)*r+(s-e)*a)/d;h>1?h=1:h<0&&(h=0);var l=t+h*r,u=e+h*a,c=l-n,f=u-s;return Math.sqrt(c*c+f*f)}},{key:"getArrowData",value:function(t,e,i,o,n,r){var a=void 0,d=void 0,h=void 0,l=void 0,u=void 0,c=void 0,f=void 0,p=r.width;if("from"===e?(h=this.from,l=this.to,u=.1,c=r.fromArrowScale,f=r.fromArrowType):"to"===e?(h=this.to,l=this.from,u=-.1,c=r.toArrowScale,f=r.toArrowType):(h=this.to,l=this.from,c=r.middleArrowScale,f=r.middleArrowType),h!=l)if("middle"!==e)if(this.options.smooth.enabled===!0){d=this.findBorderPosition(h,t,{via:i});var v=this.getPoint(Math.max(0,Math.min(1,d.t+u)),i);a=Math.atan2(d.y-v.y,d.x-v.x)}else a=Math.atan2(h.y-l.y,h.x-l.x),d=this.findBorderPosition(h,t);else a=Math.atan2(h.y-l.y,h.x-l.x),d=this.getPoint(.5,i);else{var g=this._getCircleData(t),y=(0,s.default)(g,3),m=y[0],b=y[1],_=y[2];"from"===e?(d=this.findBorderPosition(this.from,t,{x:m,y:b,low:.25,high:.6,direction:-1}),a=d.t*-2*Math.PI+1.5*Math.PI+.1*Math.PI):"to"===e?(d=this.findBorderPosition(this.from,t,{x:m,y:b,low:.6,high:1,direction:1}),a=d.t*-2*Math.PI+1.5*Math.PI-1.1*Math.PI):(d=this._pointOnCircle(m,b,_,.175),a=3.9269908169872414)}var w=15*c+3*p,k=d.x-.9*w*Math.cos(a),x=d.y-.9*w*Math.sin(a),O={x:k,y:x};return{point:d,core:O,angle:a,length:w,type:f}}},{key:"drawArrowHead",value:function(t,e,i,o,n){t.strokeStyle=this.getColor(t,e,i,o),t.fillStyle=t.strokeStyle,t.lineWidth=e.width,n.type&&"circle"===n.type.toLowerCase()?t.circleEndpoint(n.point.x,n.point.y,n.angle,n.length):t.arrowEndpoint(n.point.x,n.point.y,n.angle,n.length),this.enableShadow(t,e),t.fill(),this.disableShadow(t,e)}},{key:"enableShadow",value:function(t,e){e.shadow===!0&&(t.shadowColor=e.shadowColor,t.shadowBlur=e.shadowSize,t.shadowOffsetX=e.shadowX,t.shadowOffsetY=e.shadowY)}},{key:"disableShadow",value:function(t,e){e.shadow===!0&&(t.shadowColor="rgba(0,0,0,0)",t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0)}}]),t}();e.default=u},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(104),s=o(n),r=i(109),a=o(r),d=i(95),h=o(d),l=i(96),u=o(l),c=i(112),f=o(c),p=i(113),v=o(p),g=i(139),y=o(g),m=function(t){function e(t,i,o){(0,h.default)(this,e);var n=(0,f.default)(this,(e.__proto__||(0,a.default)(e)).call(this,t,i,o));return n._boundFunction=function(){n.positionBezierNode()},n.body.emitter.on("_repositionBezierNodes",n._boundFunction),n}return(0,v.default)(e,t),(0,u.default)(e,[{key:"setOptions",value:function(t){var e=!1;this.options.physics!==t.physics&&(e=!0),this.options=t,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(),e===!0&&(this.via.setOptions({physics:this.options.physics}),this.positionBezierNode())}},{key:"connect",value:function(){this.from=this.body.nodes[this.options.from],this.to=this.body.nodes[this.options.to],void 0===this.from||void 0===this.to||this.options.physics===!1?this.via.setOptions({physics:!1}):this.from.id===this.to.id?this.via.setOptions({physics:!1}):this.via.setOptions({physics:!0})}},{key:"cleanup",value:function(){return this.body.emitter.off("_repositionBezierNodes",this._boundFunction),void 0!==this.via&&(delete this.body.nodes[this.via.id],this.via=void 0,!0)}},{key:"setupSupportNode",value:function(){if(void 0===this.via){var t="edgeId:"+this.id,e=this.body.functions.createNode({id:t,shape:"circle",physics:!0,hidden:!0});this.body.nodes[t]=e,this.via=e,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(t,e,i){t.beginPath(),t.moveTo(this.fromPoint.x,this.fromPoint.y),void 0===i.x?t.lineTo(this.toPoint.x,this.toPoint.y):t.quadraticCurveTo(i.x,i.y,this.toPoint.x,this.toPoint.y),this.enableShadow(t,e),t.stroke(),this.disableShadow(t,e)}},{key:"getViaNode",value:function(){return this.via}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.via,i=t,o=void 0,n=void 0;if(this.from===this.to){var r=this._getCircleData(this.from),a=(0,s.default)(r,3),d=a[0],h=a[1],l=a[2],u=2*Math.PI*(1-i);o=d+l*Math.sin(u),n=h+l-l*(1-Math.cos(u))}else o=Math.pow(1-i,2)*this.fromPoint.x+2*i*(1-i)*e.x+Math.pow(i,2)*this.toPoint.x,n=Math.pow(1-i,2)*this.fromPoint.y+2*i*(1-i)*e.y+Math.pow(i,2)*this.toPoint.y;return{x:o,y:n}}},{key:"_findBorderPosition",value:function(t,e){return this._findBorderPositionBezier(t,e,this.via)}},{key:"_getDistanceToEdge",value:function(t,e,i,o,n,s){return this._getDistanceToBezierEdge(t,e,i,o,n,s,this.via)}}]),e}(y.default);e.default=m},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(109),s=o(n),r=i(95),a=o(r),d=i(96),h=o(d),l=i(112),u=o(l),c=i(113),f=o(c),p=i(139),v=o(p),g=function(t){function e(t,i,o){return(0,a.default)(this,e),(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o))}return(0,f.default)(e,t),(0,h.default)(e,[{key:"_line",value:function(t,e,i){t.beginPath(),t.moveTo(this.fromPoint.x,this.fromPoint.y),void 0===i.x?t.lineTo(this.toPoint.x,this.toPoint.y):t.quadraticCurveTo(i.x,i.y,this.toPoint.x,this.toPoint.y),this.enableShadow(t,e),t.stroke(),this.disableShadow(t,e)}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_getViaCoordinates",value:function(){var t=void 0,e=void 0,i=this.options.smooth.roundness,o=this.options.smooth.type,n=Math.abs(this.from.x-this.to.x),s=Math.abs(this.from.y-this.to.y);if("discrete"===o||"diagonalCross"===o)Math.abs(this.from.x-this.to.x)<=Math.abs(this.from.y-this.to.y)?(this.from.y>=this.to.y?this.from.x<=this.to.x?(t=this.from.x+i*s,e=this.from.y-i*s):this.from.x>this.to.x&&(t=this.from.x-i*s,e=this.from.y-i*s):this.from.ythis.to.x&&(t=this.from.x-i*s,e=this.from.y+i*s)),"discrete"===o&&(t=nMath.abs(this.from.y-this.to.y)&&(this.from.y>=this.to.y?this.from.x<=this.to.x?(t=this.from.x+i*n,e=this.from.y-i*n):this.from.x>this.to.x&&(t=this.from.x-i*n,e=this.from.y-i*n):this.from.ythis.to.x&&(t=this.from.x-i*n,e=this.from.y+i*n)),"discrete"===o&&(e=sMath.abs(this.from.y-this.to.y)&&(t=this.from.x=this.to.y?this.from.x<=this.to.x?(t=this.from.x+i*s,e=this.from.y-i*s,t=this.to.xthis.to.x&&(t=this.from.x-i*s,e=this.from.y-i*s,t=this.to.x>t?this.to.x:t):this.from.ythis.to.x&&(t=this.from.x-i*s,e=this.from.y+i*s,t=this.to.x>t?this.to.x:t)):Math.abs(this.from.x-this.to.x)>Math.abs(this.from.y-this.to.y)&&(this.from.y>=this.to.y?this.from.x<=this.to.x?(t=this.from.x+i*n,e=this.from.y-i*n,e=this.to.y>e?this.to.y:e):this.from.x>this.to.x&&(t=this.from.x-i*n,e=this.from.y-i*n,e=this.to.y>e?this.to.y:e):this.from.ythis.to.x&&(t=this.from.x-i*n,e=this.from.y+i*n,e=this.to.y2&&void 0!==arguments[2]?arguments[2]:{};return this._findBorderPositionBezier(t,e,i.via)}},{key:"_getDistanceToEdge",value:function(t,e,i,o,n,s){var r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(t,e,i,o,n,s,r)}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._getViaCoordinates(),i=t,o=Math.pow(1-i,2)*this.fromPoint.x+2*i*(1-i)*e.x+Math.pow(i,2)*this.toPoint.x,n=Math.pow(1-i,2)*this.fromPoint.y+2*i*(1-i)*e.y+Math.pow(i,2)*this.toPoint.y;return{x:o,y:n}}}]),e}(v.default);e.default=g},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(109),s=o(n),r=i(95),a=o(r),d=i(96),h=o(d),l=i(112),u=o(l),c=i(113),f=o(c),p=i(140),v=o(p),g=function(t){function e(t,i,o){return(0,a.default)(this,e),(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o))}return(0,f.default)(e,t),(0,h.default)(e,[{key:"_line",value:function(t,e){t.beginPath(),t.moveTo(this.fromPoint.x,this.fromPoint.y),t.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(t,e),t.stroke(),this.disableShadow(t,e)}},{key:"getViaNode",value:function(){}},{key:"getPoint",value:function(t){return{x:(1-t)*this.fromPoint.x+t*this.toPoint.x,y:(1-t)*this.fromPoint.y+t*this.toPoint.y}}},{key:"_findBorderPosition",value:function(t,e){var i=this.to,o=this.from;t.id===this.from.id&&(i=this.from,o=this.to);var n=Math.atan2(i.y-o.y,i.x-o.x),s=i.x-o.x,r=i.y-o.y,a=Math.sqrt(s*s+r*r),d=t.distanceToBorder(e,n),h=(a-d)/a,l={};return l.x=(1-h)*o.x+h*i.x,l.y=(1-h)*o.y+h*i.y,l}},{key:"_getDistanceToEdge",value:function(t,e,i,o,n,s){return this._getDistanceToLine(t,e,i,o,n,s)}}]),e}(v.default);e.default=g},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(58),s=o(n),r=i(95),a=o(r),d=i(96),h=o(d),l=i(145),u=o(l),c=i(146),f=o(c),p=i(147),v=o(p),g=i(148),y=o(g),m=i(149),b=o(m),_=i(150),w=o(_),k=i(151),x=o(k),O=i(152),M=o(O),S=i(1),E=function(){function t(e){(0,a.default)(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},S.extend(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}return(0,h.default)(t,[{key:"bindEventListeners",value:function(){var t=this;this.body.emitter.on("initPhysics",function(){t.initPhysics()}),this.body.emitter.on("_layoutFailed",function(){t.layoutFailed=!0}),this.body.emitter.on("resetPhysics",function(){t.stopSimulation(),t.ready=!1}),this.body.emitter.on("disablePhysics",function(){t.physicsEnabled=!1,t.stopSimulation()}),this.body.emitter.on("restorePhysics",function(){t.setOptions(t.options),t.ready===!0&&t.startSimulation()}),this.body.emitter.on("startSimulation",function(){t.ready===!0&&t.startSimulation()}),this.body.emitter.on("stopSimulation",function(){t.stopSimulation()}),this.body.emitter.on("destroy",function(){t.stopSimulation(!1),t.body.emitter.off()}),this.body.emitter.on("_dataChanged",function(){t.updatePhysicsData()})}},{key:"setOptions",value:function(t){void 0!==t&&(t===!1?(this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation()):(this.physicsEnabled=!0,S.selectiveNotDeepExtend(["stabilization"],this.options,t),S.mergeOptions(this.options,t,"stabilization"),void 0===t.enabled&&(this.options.enabled=!0),this.options.enabled===!1&&(this.physicsEnabled=!1,this.stopSimulation()),this.timestep=this.options.timestep)),this.init()}},{key:"init",value:function(){var t;"forceAtlas2Based"===this.options.solver?(t=this.options.forceAtlas2Based,this.nodesSolver=new x.default(this.body,this.physicsBody,t),this.edgesSolver=new y.default(this.body,this.physicsBody,t),this.gravitySolver=new M.default(this.body,this.physicsBody,t)):"repulsion"===this.options.solver?(t=this.options.repulsion,this.nodesSolver=new f.default(this.body,this.physicsBody,t),this.edgesSolver=new y.default(this.body,this.physicsBody,t),this.gravitySolver=new w.default(this.body,this.physicsBody,t)):"hierarchicalRepulsion"===this.options.solver?(t=this.options.hierarchicalRepulsion,this.nodesSolver=new v.default(this.body,this.physicsBody,t),this.edgesSolver=new b.default(this.body,this.physicsBody,t),this.gravitySolver=new w.default(this.body,this.physicsBody,t)):(t=this.options.barnesHut,this.nodesSolver=new u.default(this.body,this.physicsBody,t),this.edgesSolver=new y.default(this.body,this.physicsBody,t),this.gravitySolver=new w.default(this.body,this.physicsBody,t)),this.modelOptions=t}},{key:"initPhysics",value:function(){this.physicsEnabled===!0&&this.options.enabled===!0?this.options.stabilization.enabled===!0?this.stabilize():(this.stabilized=!1,this.ready=!0,this.body.emitter.emit("fit",{},this.layoutFailed),this.startSimulation()):(this.ready=!0,this.body.emitter.emit("fit"))}},{key:"startSimulation",value:function(){this.physicsEnabled===!0&&this.options.enabled===!0?(this.stabilized=!1,this.adaptiveTimestep=!1,this.body.emitter.emit("_resizeNodes"),void 0===this.viewFunction&&(this.viewFunction=this.simulationStep.bind(this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering"))):this.body.emitter.emit("_redraw")}},{key:"stopSimulation",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.stabilized=!0,t===!0&&this._emitStabilized(),void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.viewFunction=void 0,t===!0&&this.body.emitter.emit("_stopRendering"))}},{key:"simulationStep",value:function(){var t=Date.now();this.physicsTick();var e=Date.now()-t;(e<.4*this.simulationInterval||this.runDoubleSpeed===!0)&&this.stabilized===!1&&(this.physicsTick(),this.runDoubleSpeed=!0),this.stabilized===!0&&this.stopSimulation()}},{key:"_emitStabilized",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.stabilizationIterations;(this.stabilizationIterations>1||this.startedStabilization===!0)&&setTimeout(function(){t.body.emitter.emit("stabilized",{iterations:e}),t.startedStabilization=!1,t.stabilizationIterations=0},0)}},{key:"physicsTick",value:function(){if(this.startedStabilization===!1&&(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0),this.stabilized===!1){if(this.adaptiveTimestep===!0&&this.adaptiveTimestepEnabled===!0){var t=1.2;this.adaptiveCounter%this.adaptiveInterval===0?(this.timestep=2*this.timestep,this.calculateForces(),this.moveNodes(),this.revert(),this.timestep=.5*this.timestep,this.calculateForces(),this.moveNodes(),this.calculateForces(),this.moveNodes(),this._evaluateStepQuality()===!0?this.timestep=t*this.timestep:this.timestep/ts))return!1;return!0}},{key:"moveNodes",value:function(){for(var t=this.physicsBody.physicsNodeIndices,e=this.options.maxVelocity?this.options.maxVelocity:1e9,i=0,o=0,n=5,s=0;se?s[t].x>0?e:-e:s[t].x,i.x+=s[t].x*o}else n[t].x=0,s[t].x=0;if(i.options.fixed.y===!1){var d=this.modelOptions.damping*s[t].y,h=(n[t].y-d)/i.options.mass;s[t].y+=h*o,s[t].y=Math.abs(s[t].y)>e?s[t].y>0?e:-e:s[t].y,i.y+=s[t].y*o}else n[t].y=0,s[t].y=0;var l=Math.sqrt(Math.pow(s[t].x,2)+Math.pow(s[t].y,2));return l}},{key:"calculateForces",value:function(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve()}},{key:"_freezeNodes",value:function(){var t=this.body.nodes;for(var e in t)t.hasOwnProperty(e)&&t[e].x&&t[e].y&&(this.freezeCache[e]={x:t[e].options.fixed.x,y:t[e].options.fixed.y},t[e].options.fixed.x=!0,t[e].options.fixed.y=!0)}},{key:"_restoreFrozenNodes",value:function(){var t=this.body.nodes;for(var e in t)t.hasOwnProperty(e)&&void 0!==this.freezeCache[e]&&(t[e].options.fixed.x=this.freezeCache[e].x,t[e].options.fixed.y=this.freezeCache[e].y);this.freezeCache={}}},{key:"stabilize",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.stabilization.iterations;return"number"!=typeof e&&(console.log("The stabilize method needs a numeric amount of iterations. Switching to default: ",this.options.stabilization.iterations),e=this.options.stabilization.iterations),0===this.physicsBody.physicsNodeIndices.length?void(this.ready=!0):(this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=e,this.options.stabilization.onlyDynamicEdges===!0&&this._freezeNodes(),this.stabilizationIterations=0,void setTimeout(function(){return t._stabilizationBatch()},0))}},{key:"_stabilizationBatch",value:function(){this.startedStabilization===!1&&(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0);for(var t=0;this.stabilized===!1&&t0){var t=void 0,e=this.body.nodes,i=this.physicsBody.physicsNodeIndices,o=i.length,n=this._formBarnesHutTree(e,i);this.barnesHutTree=n;for(var s=0;s0&&(this._getForceContribution(n.root.children.NW,t),this._getForceContribution(n.root.children.NE,t),this._getForceContribution(n.root.children.SW,t),this._getForceContribution(n.root.children.SE,t))}}},{key:"_getForceContribution",value:function(t,e){if(t.childrenCount>0){var i=void 0,o=void 0,n=void 0;i=t.centerOfMass.x-e.x,o=t.centerOfMass.y-e.y,n=Math.sqrt(i*i+o*o),n*t.calcSize>this.thetaInversed?this._calculateForces(n,i,o,e,t):4===t.childrenCount?(this._getForceContribution(t.children.NW,e),this._getForceContribution(t.children.NE,e),this._getForceContribution(t.children.SW,e),this._getForceContribution(t.children.SE,e)):t.children.data.id!=e.id&&this._calculateForces(n,i,o,e,t)}}},{key:"_calculateForces",value:function(t,e,i,o,n){0===t&&(t=.1,e=t),this.overlapAvoidanceFactor<1&&o.shape.radius&&(t=Math.max(.1+this.overlapAvoidanceFactor*o.shape.radius,t-o.shape.radius));var s=this.options.gravitationalConstant*n.mass*o.options.mass/Math.pow(t,3),r=e*s,a=i*s;this.physicsBody.forces[o.id].x+=r,this.physicsBody.forces[o.id].y+=a}},{key:"_formBarnesHutTree",value:function(t,e){for(var i=void 0,o=e.length,n=t[e[0]].x,s=t[e[0]].y,r=t[e[0]].x,a=t[e[0]].y,d=1;d0&&(hr&&(r=h),la&&(a=l))}var u=Math.abs(r-n)-Math.abs(a-s);u>0?(s-=.5*u,a+=.5*u):(n+=.5*u,r-=.5*u);var c=1e-5,f=Math.max(c,Math.abs(r-n)),p=.5*f,v=.5*(n+r),g=.5*(s+a),y={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:v-p,maxX:v+p,minY:g-p,maxY:g+p},size:f,calcSize:1/f,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(y.root);for(var m=0;m0&&this._placeInTree(y.root,i);return y}},{key:"_updateBranchMass",value:function(t,e){var i=t.mass+e.options.mass,o=1/i;t.centerOfMass.x=t.centerOfMass.x*t.mass+e.x*e.options.mass,t.centerOfMass.x*=o,t.centerOfMass.y=t.centerOfMass.y*t.mass+e.y*e.options.mass,t.centerOfMass.y*=o,t.mass=i;var n=Math.max(Math.max(e.height,e.radius),e.width);t.maxWidth=t.maxWidthe.x?t.children.NW.range.maxY>e.y?this._placeInRegion(t,e,"NW"):this._placeInRegion(t,e,"SW"):t.children.NW.range.maxY>e.y?this._placeInRegion(t,e,"NE"):this._placeInRegion(t,e,"SE")}},{key:"_placeInRegion",value:function(t,e,i){switch(t.children[i].childrenCount){case 0:t.children[i].children.data=e,t.children[i].childrenCount=1,this._updateBranchMass(t.children[i],e);break;case 1:t.children[i].children.data.x===e.x&&t.children[i].children.data.y===e.y?(e.x+=this.seededRandom(),e.y+=this.seededRandom()):(this._splitBranch(t.children[i]),this._placeInTree(t.children[i],e));break;case 4:this._placeInTree(t.children[i],e)}}},{key:"_splitBranch",value:function(t){var e=null;1===t.childrenCount&&(e=t.children.data,t.mass=0,t.centerOfMass.x=0,t.centerOfMass.y=0),t.childrenCount=4,t.children.data=null,this._insertRegion(t,"NW"),this._insertRegion(t,"NE"),this._insertRegion(t,"SW"),this._insertRegion(t,"SE"),null!=e&&this._placeInTree(t,e)}},{key:"_insertRegion",value:function(t,e){var i=void 0,o=void 0,n=void 0,s=void 0,r=.5*t.size;switch(e){case"NW":i=t.range.minX,o=t.range.minX+r,n=t.range.minY,s=t.range.minY+r;break;case"NE":i=t.range.minX+r,o=t.range.maxX,n=t.range.minY,s=t.range.minY+r;break;case"SW":i=t.range.minX,o=t.range.minX+r,n=t.range.minY+r,s=t.range.maxY;break;case"SE":i=t.range.minX+r,o=t.range.maxX,n=t.range.minY+r,s=t.range.maxY}t.children[e]={centerOfMass:{x:0,y:0},mass:0,range:{minX:i,maxX:o,minY:n,maxY:s},size:.5*t.size,calcSize:2*t.calcSize,children:{data:null},maxWidth:0,level:t.level+1,childrenCount:0}}},{key:"_debug",value:function(t,e){void 0!==this.barnesHutTree&&(t.lineWidth=1,this._drawBranch(this.barnesHutTree.root,t,e))}},{key:"_drawBranch",value:function(t,e,i){void 0===i&&(i="#FF0000"),4===t.childrenCount&&(this._drawBranch(t.children.NW,e),this._drawBranch(t.children.NE,e),this._drawBranch(t.children.SE,e),this._drawBranch(t.children.SW,e)),e.strokeStyle=i,e.beginPath(),e.moveTo(t.range.minX,t.range.minY),e.lineTo(t.range.maxX,t.range.minY),e.stroke(),e.beginPath(),e.moveTo(t.range.maxX,t.range.minY),e.lineTo(t.range.maxX,t.range.maxY),e.stroke(),e.beginPath(),e.moveTo(t.range.maxX,t.range.maxY),e.lineTo(t.range.minX,t.range.maxY),e.stroke(),e.beginPath(),e.moveTo(t.range.minX,t.range.maxY),e.lineTo(t.range.minX,t.range.minY),e.stroke()}}]),t}();e.default=d},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(95),s=o(n),r=i(96),a=o(r),d=function(){function t(e,i,o){(0,s.default)(this,t),this.body=e,this.physicsBody=i,this.setOptions(o)}return(0,a.default)(t,[{key:"setOptions",value:function(t){this.options=t}},{key:"solve",value:function(){for(var t,e,i,o,n,s,r,a,d=this.body.nodes,h=this.physicsBody.physicsNodeIndices,l=this.physicsBody.forces,u=this.options.nodeDistance,c=-2/3/u,f=4/3,p=0;p0){var s=n.edges.length+1,r=this.options.centralGravity*s*n.options.mass;o[n.id].x=e*r,o[n.id].y=i*r}}}]),e}(v.default);e.default=g},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(58),s=o(n),r=i(62),a=o(r),d=i(95),h=o(d),l=i(96),u=o(l),c=i(154),f=o(c),p=i(155),v=o(p),g=i(1),y=function(){function t(e){var i=this;(0,h.default)(this,t),this.body=e,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},g.extend(this.options,this.defaultOptions),this.body.emitter.on("_resetData",function(){i.clusteredNodes={},i.clusteredEdges={}})}return(0,u.default)(t,[{key:"clusterByHubsize",value:function(t,e){void 0===t?t=this._getHubSize():"object"===("undefined"==typeof t?"undefined":(0,a.default)(t))&&(e=this._checkOptions(t),t=this._getHubSize());for(var i=[],o=0;o=t&&i.push(n.id)}for(var s=0;s0&&void 0!==arguments[0]?arguments[0]:{},e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(void 0===t.joinCondition)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");t=this._checkOptions(t);for(var i={},o={},n=0;n2&&void 0!==arguments[2])||arguments[2];e=this._checkOptions(e);for(var o=[],n={},r=void 0,a=void 0,d=void 0,h=void 0,l=void 0,u=0;u0&&(0,s.default)(p).length>0&&g===!0&&o.push({nodes:c,edges:p})}}}for(var _=0;_1&&void 0!==arguments[1])||arguments[1];this.clusterByEdgeCount(1,t,e)}},{key:"clusterBridges",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.clusterByEdgeCount(2,t,e)}},{key:"clusterByConnection",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0===t)throw new Error("No nodeId supplied to clusterByConnection!");if(void 0===this.body.nodes[t])throw new Error("The nodeId given to clusterByConnection does not exist!");var o=this.body.nodes[t];e=this._checkOptions(e,o),void 0===e.clusterNodeProperties.x&&(e.clusterNodeProperties.x=o.x),void 0===e.clusterNodeProperties.y&&(e.clusterNodeProperties.y=o.y),void 0===e.clusterNodeProperties.fixed&&(e.clusterNodeProperties.fixed={},e.clusterNodeProperties.fixed.x=o.options.fixed.x,e.clusterNodeProperties.fixed.y=o.options.fixed.y);var n={},r={},a=o.id,d=f.default.cloneOptions(o);n[a]=o;for(var h=0;h-1&&(r[y.id]=y)}this._cluster(n,r,e,i)}},{key:"_createClusterEdges",value:function(t,e,i,o){for(var n=void 0,r=void 0,a=void 0,d=void 0,h=void 0,l=void 0,u=(0,s.default)(t),c=[],p=0;p0&&void 0!==arguments[0]?arguments[0]:{};return void 0===t.clusterEdgeProperties&&(t.clusterEdgeProperties={}),void 0===t.clusterNodeProperties&&(t.clusterNodeProperties={}),t}},{key:"_cluster",value:function(t,e,i){var o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(0!=(0,s.default)(t).length&&(1!=(0,s.default)(t).length||1==i.clusterNodeProperties.allowSingleNodeCluster)){for(var n in t)if(t.hasOwnProperty(n)&&void 0!==this.clusteredNodes[n])return;var r=g.deepExtend({},i.clusterNodeProperties);if(void 0!==i.processProperties){var a=[];for(var d in t)if(t.hasOwnProperty(d)){var h=f.default.cloneOptions(t[d]);a.push(h)}var l=[];for(var u in e)if(e.hasOwnProperty(u)&&"clusterEdge:"!==u.substr(0,12)){var c=f.default.cloneOptions(e[u],"edge");l.push(c)}if(r=i.processProperties(r,a,l),!r)throw new Error("The processProperties function does not return properties!")}void 0===r.id&&(r.id="cluster:"+g.randomUUID());var p=r.id;void 0===r.label&&(r.label="cluster");var y=void 0;void 0===r.x&&(y=this._getClusterPosition(t),r.x=y.x),void 0===r.y&&(void 0===y&&(y=this._getClusterPosition(t)),r.y=y.y),r.id=p;var m=this.body.functions.createNode(r,v.default);m.isCluster=!0,m.containedNodes=t,m.containedEdges=e,m.clusterEdgeProperties=i.clusterEdgeProperties,this.body.nodes[r.id]=m,this._createClusterEdges(t,e,r,i.clusterEdgeProperties);for(var b in e)if(e.hasOwnProperty(b)&&void 0!==this.body.edges[b]){var _=this.body.edges[b];this._backupEdgeOptions(_),_.setOptions({physics:!1,hidden:!0})}for(var w in t)t.hasOwnProperty(w)&&(this.clusteredNodes[w]={clusterId:r.id,node:this.body.nodes[w]},this.body.nodes[w].setOptions({hidden:!0,physics:!1}));r.id=void 0,o===!0&&this.body.emitter.emit("_dataChanged")}}},{key:"_backupEdgeOptions",value:function(t){void 0===this.clusteredEdges[t.id]&&(this.clusteredEdges[t.id]={physics:t.options.physics,hidden:t.options.hidden})}},{key:"_restoreEdge",value:function(t){var e=this.clusteredEdges[t.id];void 0!==e&&(t.setOptions({physics:e.physics,hidden:e.hidden}),delete this.clusteredEdges[t.id])}},{key:"isCluster",value:function(t){return void 0!==this.body.nodes[t]?this.body.nodes[t].isCluster===!0:(console.log("Node does not exist."),!1)}},{key:"_getClusterPosition",value:function(t){for(var e=(0,s.default)(t),i=t[e[0]].x,o=t[e[0]].x,n=t[e[0]].y,r=t[e[0]].y,a=void 0,d=1;do?a.x:o,n=a.yr?a.y:r;return{x:.5*(i+o),y:.5*(n+r)}}},{key:"openCluster",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0===t)throw new Error("No clusterNodeId supplied to openCluster.");if(void 0===this.body.nodes[t])throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(void 0===this.body.nodes[t].containedNodes)return void console.log("The node:"+t+" is not a cluster.");var o=this.body.nodes[t],n=o.containedNodes,s=o.containedEdges;if(void 0!==e&&void 0!==e.releaseFunction&&"function"==typeof e.releaseFunction){var r={},a={x:o.x,y:o.y};for(var d in n)if(n.hasOwnProperty(d)){var h=this.body.nodes[d];r[d]={x:h.x,y:h.y}}var l=e.releaseFunction(a,r);for(var u in n)if(n.hasOwnProperty(u)){var c=this.body.nodes[u];void 0!==l[u]&&(c.x=void 0===l[u].x?o.x:l[u].x,c.y=void 0===l[u].y?o.y:l[u].y)}}else for(var p in n)if(n.hasOwnProperty(p)){var v=this.body.nodes[p];v=n[p],v.options.fixed.x===!1&&(v.x=o.x),v.options.fixed.y===!1&&(v.y=o.y)}for(var y in n)if(n.hasOwnProperty(y)){var m=this.body.nodes[y];m.vx=o.vx,m.vy=o.vy,m.setOptions({hidden:!1,physics:!0}),delete this.clusteredNodes[y]}for(var b=[],_=0;_o&&(o=s.edges.length),t+=s.edges.length,e+=Math.pow(s.edges.length,2),i+=1}t/=i,e/=i;var r=e-Math.pow(t,2),a=Math.sqrt(r),d=Math.floor(t+2*a);return d>o&&(d=o),d}}]),t}();e.default=y},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(95),s=o(n),r=i(96),a=o(r),d=i(1),h=function(){function t(){(0,s.default)(this,t)}return(0,a.default)(t,null,[{key:"getRange",value:function(t){var e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=1e9,n=-1e9,s=1e9,r=-1e9;if(i.length>0)for(var a=0;ae.shape.boundingBox.left&&(s=e.shape.boundingBox.left),re.shape.boundingBox.top&&(o=e.shape.boundingBox.top),n1&&void 0!==arguments[1]?arguments[1]:[],o=1e9,n=-1e9,s=1e9,r=-1e9;if(i.length>0)for(var a=0;ae.x&&(s=e.x),re.y&&(o=e.y),n0,t.renderTimer=void 0}),this.body.emitter.on("destroy",function(){t.renderRequests=0,t.allowRedraw=!1,t.renderingActive=!1,t.requiresTimeout===!0?clearTimeout(t.renderTimer):cancelAnimationFrame(t.renderTimer),t.body.emitter.off()})}},{key:"setOptions",value:function(t){if(void 0!==t){var e=["hideEdgesOnDrag","hideNodesOnDrag"];d.selectiveDeepExtend(e,this.options,t)}}},{key:"_startRendering",value:function(){this.renderingActive===!0&&void 0===this.renderTimer&&(this.requiresTimeout===!0?this.renderTimer=window.setTimeout(this._renderStep.bind(this),this.simulationInterval):this.renderTimer=window.requestAnimationFrame(this._renderStep.bind(this)))}},{key:"_renderStep",value:function(){this.renderingActive===!0&&(this.renderTimer=void 0,this.requiresTimeout===!0&&this._startRendering(),this._redraw(),this.requiresTimeout===!1&&this._startRendering())}},{key:"redraw",value:function(){this.body.emitter.emit("setSize"),this._redraw()}},{key:"_requestRedraw",value:function(){var t=this;this.redrawRequested!==!0&&this.renderingActive===!1&&this.allowRedraw===!0&&(this.redrawRequested=!0,this.requiresTimeout===!0?window.setTimeout(function(){t._redraw(!1)},0):window.requestAnimationFrame(function(){t._redraw(!1)}))}},{key:"_redraw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.allowRedraw===!0){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1;var e=this.canvas.frame.canvas.getContext("2d");0!==this.canvas.frame.canvas.width&&0!==this.canvas.frame.canvas.height||this.canvas.setSize(),this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1),e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var i=this.canvas.frame.canvas.clientWidth,o=this.canvas.frame.canvas.clientHeight;if(e.clearRect(0,0,i,o),0===this.canvas.frame.clientWidth)return;e.save(),e.translate(this.body.view.translation.x,this.body.view.translation.y),e.scale(this.body.view.scale,this.body.view.scale),e.beginPath(),this.body.emitter.emit("beforeDrawing",e),e.closePath(),t===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&this._drawEdges(e),(this.dragging===!1||this.dragging===!0&&this.options.hideNodesOnDrag===!1)&&this._drawNodes(e,t),e.beginPath(),this.body.emitter.emit("afterDrawing",e),e.closePath(),e.restore(),t===!0&&e.clearRect(0,0,i,o)}}},{key:"_resizeNodes",value:function(){var t=this.canvas.frame.canvas.getContext("2d");void 0===this.pixelRatio&&(this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)),t.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0),t.save(),t.translate(this.body.view.translation.x,this.body.view.translation.y),t.scale(this.body.view.scale,this.body.view.scale);var e=this.body.nodes,i=void 0;for(var o in e)e.hasOwnProperty(o)&&(i=e[o],i.resize(t),i.updateBoundingBox(t,i.selected));t.restore()}},{key:"_drawNodes",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.body.nodes,o=this.body.nodeIndices,n=void 0,s=[],r=20,a=this.canvas.DOMtoCanvas({x:-r,y:-r}),d=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+r,y:this.canvas.frame.canvas.clientHeight+r}),h={top:a.y,left:a.x,bottom:d.y,right:d.x},l=0;l0&&void 0!==arguments[0]?arguments[0]:this.pixelRatio;this.initialized===!0&&(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&&this.cameraState.previousWidth>0){var t=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,e=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight,i=this.cameraState.scale;1!=t&&1!=e?i=.5*this.cameraState.scale*(t+e):1!=t?i=this.cameraState.scale*t:1!=e&&(i=this.cameraState.scale*e),this.body.view.scale=i;var o=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),n={x:o.x-this.cameraState.position.x,y:o.y-this.cameraState.position.y};this.body.view.translation.x+=n.x*this.body.view.scale,this.body.view.translation.y+=n.y*this.body.view.scale}}},{key:"_prepareValue",value:function(t){if("number"==typeof t)return t+"px";if("string"==typeof t){if(t.indexOf("%")!==-1||t.indexOf("px")!==-1)return t;if(t.indexOf("%")===-1)return t+"px"}throw new Error("Could not use the value supplied for width or height:"+t)}},{key:"_create",value:function(){for(;this.body.container.hasChildNodes();)this.body.container.removeChild(this.body.container.firstChild);if(this.frame=document.createElement("div"),this.frame.className="vis-network",this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.tabIndex=900,this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas),this.frame.canvas.getContext){var t=this.frame.canvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1),this.frame.canvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}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 d(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:d.DIRECTION_ALL}),h.onTouch(this.hammer,function(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 d(this.frame),h.onRelease(this.hammerFrame,function(e){t.body.eventListeners.onRelease(e)})}},{key:"setSize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.width,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.height;t=this._prepareValue(t),e=this._prepareValue(e);var i=!1,o=this.frame.canvas.width,n=this.frame.canvas.height,s=this.frame.canvas.getContext("2d"),r=this.pixelRatio;return this.pixelRatio=(window.devicePixelRatio||1)/(s.webkitBackingStorePixelRatio||s.mozBackingStorePixelRatio||s.msBackingStorePixelRatio||s.oBackingStorePixelRatio||s.backingStorePixelRatio||1),t!=this.options.width||e!=this.options.height||this.frame.style.width!=t||this.frame.style.height!=e?(this._getCameraState(r),this.frame.style.width=t,this.frame.style.height=e,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=t,this.options.height=e,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},i=!0):(this.frame.canvas.width==Math.round(this.frame.canvas.clientWidth*this.pixelRatio)&&this.frame.canvas.height==Math.round(this.frame.canvas.clientHeight*this.pixelRatio)||this._getCameraState(r),this.frame.canvas.width!=Math.round(this.frame.canvas.clientWidth*this.pixelRatio)&&(this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),i=!0),this.frame.canvas.height!=Math.round(this.frame.canvas.clientHeight*this.pixelRatio)&&(this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),i=!0)),i===!0&&(this.body.emitter.emit("resize",{width:Math.round(this.frame.canvas.width/this.pixelRatio),height:Math.round(this.frame.canvas.height/this.pixelRatio),oldWidth:Math.round(o/this.pixelRatio),oldHeight:Math.round(n/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,i}},{key:"_XconvertDOMtoCanvas",value:function(t){return(t-this.body.view.translation.x)/this.body.view.scale}},{key:"_XconvertCanvasToDOM",value:function(t){return t*this.body.view.scale+this.body.view.translation.x}},{key:"_YconvertDOMtoCanvas",value:function(t){return(t-this.body.view.translation.y)/this.body.view.scale}},{key:"_YconvertCanvasToDOM",value:function(t){return t*this.body.view.scale+this.body.view.translation.y}},{key:"canvasToDOM",value:function(t){return{x:this._XconvertCanvasToDOM(t.x),y:this._YconvertCanvasToDOM(t.y)}}},{key:"DOMtoCanvas",value:function(t){return{x:this._XconvertDOMtoCanvas(t.x),y:this._YconvertDOMtoCanvas(t.y)}}}]),t}();e.default=u},function(t,e,i){if("undefined"!=typeof window){var o=i(159),n=window.Hammer||i(160);t.exports=o(n,{preventDefault:"mouse"})}else t.exports=function(){throw Error("hammer.js is only available in a browser, not in node.js.")}},function(t,e,i){var o,n,s;!function(i){n=[],o=i,s="function"==typeof o?o.apply(e,n):o,!(void 0!==s&&(t.exports=s))}(function(){var t=null;return function e(i,o){function n(t){return t.match(/[^ ]+/g)}function s(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 i=!1;e.stopPropagation=function(){i=!0};var o=e.srcEvent.stopPropagation.bind(e.srcEvent);"function"==typeof o&&(e.srcEvent.stopPropagation=function(){o(),e.stopPropagation()}),e.firstTarget=t;for(var n=t;n&&!i;){var s=n.hammer;if(s)for(var r,a=0;a0?h._handlers[t]=o:(i.off(t,s),delete h._handlers[t]))}),h},h.emit=function(e,o){t=o.target,i.emit(e,o)},h.destroy=function(){var t=i.element.hammer,e=t.indexOf(h);e!==-1&&t.splice(e,1),t.length||delete i.element.hammer,h._handlers={},i.destroy()},h}})},function(t,e,i){var o;/*! Hammer.JS - v2.0.7 - 2016-04-22 * http://hammerjs.github.io/ * * Copyright (c) 2016 Jorik Tangelder; * Licensed under the MIT license */ -!function(n,s,r,a){function h(e,t,i){return setTimeout(f(e,i),t)}function d(e,t,i){return!!Array.isArray(e)&&(l(e,i[t],i),!0)}function l(e,t,i){var o;if(e)if(e.forEach)e.forEach(t,i);else if(e.length!==a)for(o=0;o\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",s=n.console&&(n.console.warn||n.console.log);return s&&s.call(n.console,o,i),e.apply(this,arguments)}}function u(e,t,i){var o,n=t.prototype;o=e.prototype=Object.create(n),o.constructor=e,o._super=n,i&&ve(o,i)}function f(e,t){return function(){return e.apply(t,arguments)}}function p(e,t){return typeof e==be?e.apply(t?t[0]||a:a,t):e}function v(e,t){return e===a?t:e}function y(e,t,i){l(_(t),function(t){e.addEventListener(t,i,!1)})}function g(e,t,i){l(_(t),function(t){e.removeEventListener(t,i,!1)})}function b(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function m(e,t){return e.indexOf(t)>-1}function _(e){return e.trim().split(/\s+/g)}function w(e,t,i){if(e.indexOf&&!i)return e.indexOf(t);for(var o=0;oi[t]}):o.sort()),o}function O(e,t){for(var i,o,n=t[0].toUpperCase()+t.slice(1),s=0;s1&&!i.firstMultiple?i.firstMultiple=F(t):1===n&&(i.firstMultiple=!1);var s=i.firstInput,r=i.firstMultiple,a=r?r.center:s.center,h=t.center=I(o);t.timeStamp=we(),t.deltaTime=t.timeStamp-s.timeStamp,t.angle=R(a,h),t.distance=z(a,h),P(i,t),t.offsetDirection=N(t.deltaX,t.deltaY);var d=j(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=d.x,t.overallVelocityY=d.y,t.overallVelocity=_e(d.x)>_e(d.y)?d.x:d.y,t.scale=r?L(r.pointers,o):1,t.rotation=r?A(r.pointers,o):0,t.maxPointers=i.prevInput?t.pointers.length>i.prevInput.maxPointers?t.pointers.length:i.prevInput.maxPointers:t.pointers.length,B(i,t);var l=e.element;b(t.srcEvent.target,l)&&(l=t.srcEvent.target),t.target=l}function P(e,t){var i=t.center,o=e.offsetDelta||{},n=e.prevDelta||{},s=e.prevInput||{};t.eventType!==Ie&&s.eventType!==Ne||(n=e.prevDelta={x:s.deltaX||0,y:s.deltaY||0},o=e.offsetDelta={x:i.x,y:i.y}),t.deltaX=n.x+(i.x-o.x),t.deltaY=n.y+(i.y-o.y)}function B(e,t){var i,o,n,s,r=e.lastInterval||t,h=t.timeStamp-r.timeStamp;if(t.eventType!=ze&&(h>Fe||r.velocity===a)){var d=t.deltaX-r.deltaX,l=t.deltaY-r.deltaY,c=j(h,d,l);o=c.x,n=c.y,i=_e(c.x)>_e(c.y)?c.x:c.y,s=N(d,l),e.lastInterval=t}else i=r.velocity,o=r.velocityX,n=r.velocityY,s=r.direction;t.velocity=i,t.velocityX=o,t.velocityY=n,t.direction=s}function F(e){for(var t=[],i=0;i=_e(t)?e<0?Ae:Le:t<0?He:We}function z(e,t,i){i||(i=qe);var o=t[i[0]]-e[i[0]],n=t[i[1]]-e[i[1]];return Math.sqrt(o*o+n*n)}function R(e,t,i){i||(i=qe);var o=t[i[0]]-e[i[0]],n=t[i[1]]-e[i[1]];return 180*Math.atan2(n,o)/Math.PI}function A(e,t){return R(t[1],t[0],Ge)+R(e[1],e[0],Ge)}function L(e,t){return z(t[0],t[1],Ge)/z(e[0],e[1],Ge)}function H(){this.evEl=Ke,this.evWin=Ze,this.pressed=!1,C.apply(this,arguments)}function W(){this.evEl=$e,this.evWin=et,C.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function Y(){this.evTarget=it,this.evWin=ot,this.started=!1,C.apply(this,arguments)}function U(e,t){var i=k(e.touches),o=k(e.changedTouches);return t&(Ne|ze)&&(i=x(i.concat(o),"identifier",!0)),[i,o]}function V(){this.evTarget=st,this.targetIds={},C.apply(this,arguments)}function q(e,t){var i=k(e.touches),o=this.targetIds;if(t&(Ie|je)&&1===i.length)return o[i[0].identifier]=!0,[i,i];var n,s,r=k(e.changedTouches),a=[],h=this.target;if(s=i.filter(function(e){return b(e.target,h)}),t===Ie)for(n=0;n-1&&o.splice(e,1)};setTimeout(n,rt)}}function Z(e){for(var t=e.srcEvent.clientX,i=e.srcEvent.clientY,o=0;o-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){function t(t){i.manager.emit(t,e)}var i=this,o=this.state;o<_t&&t(i.options.event+te(o)),t(i.options.event),e.additionalEvent&&t(e.additionalEvent),o>=_t&&t(i.options.event+te(o))},tryEmit:function(e){return this.canEmit()?this.emit(e):void(this.state=xt)},canEmit:function(){for(var e=0;et.threshold&&n&t.direction},attrTest:function(e){return ne.prototype.attrTest.call(this,e)&&(this.state&bt||!(this.state&bt)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=ie(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),u(re,ne,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ft]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&bt)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),u(ae,ee,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ct]},process:function(e){var t=this.options,i=e.pointers.length===t.pointers,o=e.distancet.time;if(this._input=e,!o||!i||e.eventType&(Ne|ze)&&!n)this.reset();else if(e.eventType&Ie)this.reset(),this._timer=h(function(){this.state=wt,this.tryEmit()},t.time,this);else if(e.eventType&Ne)return wt;return xt},reset:function(){clearTimeout(this._timer)},emit:function(e){this.state===wt&&(e&&e.eventType&Ne?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=we(),this.manager.emit(this.options.event,this._input)))}}),u(he,ne,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ft]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&bt)}}),u(de,ne,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Ye|Ue,pointers:1},getTouchAction:function(){return se.prototype.getTouchAction.call(this)},attrTest:function(e){var t,i=this.options.direction;return i&(Ye|Ue)?t=e.overallVelocity:i&Ye?t=e.overallVelocityX:i&Ue&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&i&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&_e(t)>this.options.velocity&&e.eventType&Ne},emit:function(e){var t=ie(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),u(le,ee,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ut]},process:function(e){var t=this.options,i=e.pointers.length===t.pointers,o=e.distance0&&void 0!==arguments[0]?arguments[0]:{};this.options=e}},{key:"fit",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{nodes:[]},t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=void 0,o=void 0;if(void 0!==e.nodes&&0!==e.nodes.length||(e.nodes=this.body.nodeIndices),t===!0){var n=0;for(var s in this.body.nodes)if(this.body.nodes.hasOwnProperty(s)){var r=this.body.nodes[s];r.predefinedPosition===!0&&(n+=1)}if(n>.5*this.body.nodeIndices.length)return void this.fit(e,!1);i=a.default.getRange(this.body.nodes,e.nodes);var h=this.body.nodeIndices.length;o=12.662/(h+7.4147)+.0964822;var d=Math.min(this.canvas.frame.canvas.clientWidth/600,this.canvas.frame.canvas.clientHeight/600);o*=d}else{this.body.emitter.emit("_resizeNodes"),i=a.default.getRange(this.body.nodes,e.nodes);var l=1.1*Math.abs(i.maxX-i.minX),c=1.1*Math.abs(i.maxY-i.minY),u=this.canvas.frame.canvas.clientWidth/l,f=this.canvas.frame.canvas.clientHeight/c;o=u<=f?u:f}o>1?o=1:0===o&&(o=1);var p=a.default.findCenter(i),v={position:p,scale:o,animation:e.animation};this.moveTo(v)}},{key:"focus",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(void 0!==this.body.nodes[e]){var i={x:this.body.nodes[e].x,y:this.body.nodes[e].y};t.position=i,t.lockedOnNode=e,this.moveTo(t)}else console.log("Node: "+e+" cannot be found.")}},{key:"moveTo",value:function(e){return void 0===e?void(e={}):(void 0===e.offset&&(e.offset={x:0,y:0}),void 0===e.offset.x&&(e.offset.x=0),void 0===e.offset.y&&(e.offset.y=0),void 0===e.scale&&(e.scale=this.body.view.scale),void 0===e.position&&(e.position=this.getViewPosition()),void 0===e.animation&&(e.animation={duration:0}),e.animation===!1&&(e.animation={duration:0}),e.animation===!0&&(e.animation={}),void 0===e.animation.duration&&(e.animation.duration=1e3),void 0===e.animation.easingFunction&&(e.animation.easingFunction="easeInOutQuad"),void this.animateView(e))}},{key:"animateView",value:function(e){if(void 0!==e){this.animationEasingFunction=e.animation.easingFunction,this.releaseNode(),e.locked===!0&&(this.lockedOnNodeId=e.lockedOnNode,this.lockedOnNodeOffset=e.offset),0!=this.easingTime&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=e.scale,this.body.view.scale=this.targetScale;var t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),i={x:t.x-e.position.x,y:t.y-e.position.y};this.targetTranslation={x:this.sourceTranslation.x+i.x*this.targetScale+e.offset.x,y:this.sourceTranslation.y+i.y*this.targetScale+e.offset.y},0===e.animation.duration?void 0!=this.lockedOnNodeId?(this.viewFunction=this._lockedRedraw.bind(this),this.body.emitter.on("initRedraw",this.viewFunction)):(this.body.view.scale=this.targetScale,this.body.view.translation=this.targetTranslation,this.body.emitter.emit("_requestRedraw")):(this.animationSpeed=1/(60*e.animation.duration*.001)||1/60,this.animationEasingFunction=e.animation.easingFunction,this.viewFunction=this._transitionRedraw.bind(this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering"))}}},{key:"_lockedRedraw",value:function(){var e={x:this.body.nodes[this.lockedOnNodeId].x,y:this.body.nodes[this.lockedOnNodeId].y},t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),i={x:t.x-e.x,y:t.y-e.y},o=this.body.view.translation,n={x:o.x+i.x*this.body.view.scale+this.lockedOnNodeOffset.x,y:o.y+i.y*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=n}},{key:"releaseNode",value:function(){void 0!==this.lockedOnNodeId&&void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}},{key:"_transitionRedraw",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.easingTime+=this.animationSpeed,this.easingTime=e===!0?1:this.easingTime;var t=h.easingFunctions[this.animationEasingFunction](this.easingTime);this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*t,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*t,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*t},this.easingTime>=1&&(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,void 0!=this.lockedOnNodeId&&(this.viewFunction=this._lockedRedraw.bind(this),this.body.emitter.on("initRedraw",this.viewFunction)),this.body.emitter.emit("animationFinished"))}},{key:"getScale",value:function(){return this.body.view.scale}},{key:"getViewPosition",value:function(){return this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight})}}]),e}();t.default=d},function(e,t,i){function o(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var i=0;i50&&(this.drag.pointer=this.getPointer(e.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=(new Date).valueOf())}},{key:"onTap",value:function(e){var t=this.getPointer(e.center),i=this.selectionHandler.options.multiselect&&(e.changedPointers[0].ctrlKey||e.changedPointers[0].metaKey);this.checkSelectionChanges(t,e,i),this.selectionHandler._generateClickEvent("click",e,t)}},{key:"onDoubleTap",value:function(e){var t=this.getPointer(e.center);this.selectionHandler._generateClickEvent("doubleClick",e,t)}},{key:"onHold",value:function(e){var t=this.getPointer(e.center),i=this.selectionHandler.options.multiselect;this.checkSelectionChanges(t,e,i),this.selectionHandler._generateClickEvent("click",e,t),this.selectionHandler._generateClickEvent("hold",e,t)}},{key:"onRelease",value:function(e){if((new Date).valueOf()-this.touchTime>10){var t=this.getPointer(e.center);this.selectionHandler._generateClickEvent("release",e,t),this.touchTime=(new Date).valueOf()}}},{key:"onContext",value:function(e){var t=this.getPointer({x:e.clientX,y:e.clientY});this.selectionHandler._generateClickEvent("oncontext",e,t)}},{key:"checkSelectionChanges",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=this.selectionHandler._getSelectedEdgeCount(),n=this.selectionHandler._getSelectedNodeCount(),s=this.selectionHandler.getSelection(),r=void 0;r=i===!0?this.selectionHandler.selectAdditionalOnPoint(e):this.selectionHandler.selectOnPoint(e);var a=this.selectionHandler._getSelectedEdgeCount(),h=this.selectionHandler._getSelectedNodeCount(),d=this.selectionHandler.getSelection(),l=this._determineIfDifferent(s,d),c=l.nodesChanged,u=l.edgesChanged,f=!1;h-n>0?(this.selectionHandler._generateClickEvent("selectNode",t,e),r=!0,f=!0):c===!0&&h>0?(this.selectionHandler._generateClickEvent("deselectNode",t,e,s),this.selectionHandler._generateClickEvent("selectNode",t,e),f=!0,r=!0):h-n<0&&(this.selectionHandler._generateClickEvent("deselectNode",t,e,s),r=!0),a-o>0&&f===!1?(this.selectionHandler._generateClickEvent("selectEdge",t,e),r=!0):a>0&&u===!0?(this.selectionHandler._generateClickEvent("deselectEdge",t,e,s),this.selectionHandler._generateClickEvent("selectEdge",t,e),r=!0):a-o<0&&(this.selectionHandler._generateClickEvent("deselectEdge",t,e,s),r=!0),r===!0&&this.selectionHandler._generateClickEvent("select",t,e)}},{key:"_determineIfDifferent",value:function(e,t){for(var i=!1,o=!1,n=0;n10&&(e=10);var o=void 0;void 0!==this.drag&&this.drag.dragging===!0&&(o=this.canvas.DOMtoCanvas(this.drag.pointer));var n=this.body.view.translation,s=e/i,r=(1-s)*t.x+n.x*s,a=(1-s)*t.y+n.y*s;if(this.body.view.scale=e,this.body.view.translation={x:r,y:a},void 0!=o){var h=this.canvas.canvasToDOM(o);this.drag.pointer.x=h.x,this.drag.pointer.y=h.y}this.body.emitter.emit("_requestRedraw"),i0&&(this.popupObj=h[c[c.length-1]],s=!0)}if(void 0===this.popupObj&&s===!1){for(var f=this.body.edgeIndices,p=this.body.edges,v=void 0,y=[],g=0;g0&&(this.popupObj=p[y[y.length-1]],r="edge")}void 0!==this.popupObj?this.popupObj.id!==n&&(void 0===this.popup&&(this.popup=new d.default(this.canvas.frame)),this.popup.popupTargetType=r,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(e.x+3,e.y-5),this.popup.setText(this.popupObj.getTitle()),this.popup.show(),this.body.emitter.emit("showPopup",this.popupObj.id)):void 0!==this.popup&&(this.popup.hide(),this.body.emitter.emit("hidePopup"))}},{key:"_checkHidePopup",value:function(e){var t=this.selectionHandler._pointerToPositionObject(e),i=!1;if("node"===this.popup.popupTargetType){if(void 0!==this.body.nodes[this.popup.popupTargetId]&&(i=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(t),i===!0)){var o=this.selectionHandler.getNodeAt(e);i=o.id===this.popup.popupTargetId}}else void 0===this.selectionHandler.getNodeAt(e)&&void 0!==this.body.edges[this.popup.popupTargetId]&&(i=this.body.edges[this.popup.popupTargetId].isOverlappingWith(t));i===!1&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}}]),e}();t.default=c},function(e,t,i){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i700&&(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,o=t/e,n=(1-o)*this.canvas.canvasViewCenter.x+i.x*o,s=(1-o)*this.canvas.canvasViewCenter.y+i.y*o;this.body.view.scale=t,this.body.view.translation={x:n,y:s},this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale})}},{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,o=t/e,n=(1-o)*this.canvas.canvasViewCenter.x+i.x*o,s=(1-o)*this.canvas.canvasViewCenter.y+i.y*o;this.body.view.scale=t,this.body.view.translation={x:n,y:s},this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale})}},{key:"configureKeyboardBindings",value:function(){var e=this;void 0!==this.keycharm&&this.keycharm.destroy(),this.options.keyboard.enabled===!0&&(this.options.keyboard.bindToWindow===!0?this.keycharm=a({container:window,preventDefault:!0}):this.keycharm=a({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),this.activated===!0&&(this.keycharm.bind("up",function(){e.bindToRedraw("_moveUp")},"keydown"),this.keycharm.bind("down",function(){e.bindToRedraw("_moveDown")},"keydown"),this.keycharm.bind("left",function(){e.bindToRedraw("_moveLeft")},"keydown"),this.keycharm.bind("right",function(){e.bindToRedraw("_moveRight")},"keydown"),this.keycharm.bind("=",function(){e.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("num+",function(){e.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("num-",function(){e.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("-",function(){e.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("[",function(){e.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("]",function(){e.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("pageup",function(){e.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("pagedown",function(){e.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("up",function(){e.unbindFromRedraw("_moveUp")},"keyup"),this.keycharm.bind("down",function(){e.unbindFromRedraw("_moveDown")},"keyup"),this.keycharm.bind("left",function(){e.unbindFromRedraw("_moveLeft")},"keyup"),this.keycharm.bind("right",function(){e.unbindFromRedraw("_moveRight")},"keyup"),this.keycharm.bind("=",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("num+",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("num-",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),this.keycharm.bind("-",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),this.keycharm.bind("[",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),this.keycharm.bind("]",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("pageup",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("pagedown",function(){e.unbindFromRedraw("_zoomOut")},"keyup")))}}]),e}();t.default=h},function(e,t,i){var o,n,s;!function(i,r){n=[],o=r,s="function"==typeof o?o.apply(t,n):o,!(void 0!==s&&(e.exports=s))}(this,function(){function e(e){var t,i=e&&e.preventDefault||!1,o=e&&e.container||window,n={},s={keydown:{},keyup:{}},r={};for(t=97;t<=122;t++)r[String.fromCharCode(t)]={code:65+(t-97),shift:!1};for(t=65;t<=90;t++)r[String.fromCharCode(t)]={code:t,shift:!0};for(t=0;t<=9;t++)r[""+t]={code:48+t,shift:!1};for(t=1;t<=12;t++)r["F"+t]={code:111+t,shift:!1};for(t=0;t<=9;t++)r["num"+t]={code:96+t,shift:!1};r["num*"]={code:106,shift:!1},r["num+"]={code:107,shift:!1},r["num-"]={code:109,shift:!1},r["num/"]={code:111,shift:!1},r["num."]={code:110,shift:!1},r.left={code:37,shift:!1},r.up={code:38,shift:!1},r.right={code:39,shift:!1},r.down={code:40,shift:!1},r.space={code:32,shift:!1},r.enter={code:13,shift:!1},r.shift={code:16,shift:void 0},r.esc={code:27,shift:!1},r.backspace={code:8,shift:!1},r.tab={code:9,shift:!1},r.ctrl={code:17,shift:!1},r.alt={code:18,shift:!1},r.delete={code:46,shift:!1},r.pageup={code:33,shift:!1},r.pagedown={code:34,shift:!1},r["="]={code:187,shift:!1},r["-"]={code:189,shift:!1},r["]"]={code:221,shift:!1},r["["]={code:219,shift:!1};var a=function(e){d(e,"keydown")},h=function(e){d(e,"keyup")},d=function(e,t){if(void 0!==s[t][e.keyCode]){for(var o=s[t][e.keyCode],n=0;no&&(s=o-t-this.padding),sn&&(r=n-i-this.padding),r4&&void 0!==arguments[4]&&arguments[4],s=void 0;s=n===!0?{nodes:[],edges:[]}:this.getSelection(),s.pointer={DOM:{x:i.x,y:i.y},canvas:this.canvas.DOMtoCanvas(i)},s.event=t,void 0!==o&&(s.previousSelection=o),this.body.emitter.emit(e,s)}},{key:"selectObject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.selectConnectedEdges;return void 0!==e&&(e instanceof a.default&&t===!0&&this._selectConnectedEdges(e),e.select(),this._addToSelection(e),!0)}},{key:"deselectObject",value:function(e){e.isSelected()===!0&&(e.selected=!1,this._removeFromSelection(e))}},{key:"_getAllNodesOverlappingWith",value:function(e){for(var t=[],i=this.body.nodes,o=0;o1&&void 0!==arguments[1])||arguments[1],i=this._pointerToPositionObject(e),o=this._getAllNodesOverlappingWith(i);return o.length>0?t===!0?this.body.nodes[o[o.length-1]]:o[o.length-1]:void 0}},{key:"_getEdgesOverlappingWith",value:function(e,t){for(var i=this.body.edges,o=0;o1&&void 0!==arguments[1])||arguments[1],i=this.canvas.DOMtoCanvas(e),o=10,n=null,s=this.body.edges,r=0;r1)return!0;return!1}},{key:"_selectConnectedEdges",value:function(e){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:{},i=void 0,o=void 0;if(!e||!e.nodes&&!e.edges)throw"Selection must be an object with nodes and/or edges properties";if((t.unselectAll||void 0===t.unselectAll)&&this.unselectAll(),e.nodes)for(i=0;i1&&void 0!==arguments[1])||arguments[1];if(!e||void 0===e.length)throw"Selection must be an array with ids";this.setSelection({nodes:e},{highlightEdges:t})}},{key:"selectEdges",value:function(e){if(!e||void 0===e.length)throw"Selection must be an array with ids";this.setSelection({edges:e})}},{key:"updateSelection",value:function(){for(var e in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(e)&&(this.body.nodes.hasOwnProperty(e)||delete this.selectionObj.nodes[e]);for(var t in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(t)&&(this.body.edges.hasOwnProperty(t)||delete this.selectionObj.edges[t])}}]),e}();t.default=c},function(e,t,i){function o(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){var i=[],o=!0,n=!1,s=void 0;try{for(var r,a=e[Symbol.iterator]();!(o=(r=a.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){n=!0,s=e}finally{try{!o&&a.return&&a.return()}finally{if(n)throw s}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=function(){function e(e,t){for(var i=0;i0&&(this.options.hierarchical.levelSeparation*=-1):this.options.hierarchical.levelSeparation<0&&(this.options.hierarchical.levelSeparation*=-1),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(t);if(i===!0)return this.body.emitter.emit("refresh"),l.deepExtend(t,this.optionsBackup)}return t}},{key:"adaptAllOptionsForHierarchicalLayout",value:function(e){if(this.options.hierarchical.enabled===!0){void 0===e.physics||e.physics===!0?(e.physics={enabled:void 0===this.optionsBackup.physics.enabled||this.optionsBackup.physics.enabled,solver:"hierarchicalRepulsion"},this.optionsBackup.physics.enabled=void 0===this.optionsBackup.physics.enabled||this.optionsBackup.physics.enabled,this.optionsBackup.physics.solver=this.optionsBackup.physics.solver||"barnesHut"):"object"===r(e.physics)?(this.optionsBackup.physics.enabled=void 0===e.physics.enabled||e.physics.enabled,this.optionsBackup.physics.solver=e.physics.solver||"barnesHut",e.physics.solver="hierarchicalRepulsion"):e.physics!==!1&&(this.optionsBackup.physics.solver="barnesHut",e.physics={solver:"hierarchicalRepulsion"});var t="horizontal";"RL"!==this.options.hierarchical.direction&&"LR"!==this.options.hierarchical.direction||(t="vertical"),void 0===e.edges?(this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges={smooth:!1}):void 0===e.edges.smooth?(this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges.smooth=!1):"boolean"==typeof e.edges.smooth?(this.optionsBackup.edges={smooth:e.edges.smooth},e.edges.smooth={enabled:e.edges.smooth,type:t}):(void 0!==e.edges.smooth.type&&"dynamic"!==e.edges.smooth.type&&(t=e.edges.smooth.type),this.optionsBackup.edges={smooth:void 0===e.edges.smooth.enabled||e.edges.smooth.enabled,type:void 0===e.edges.smooth.type?"dynamic":e.edges.smooth.type,roundness:void 0===e.edges.smooth.roundness?.5:e.edges.smooth.roundness,forceDirection:void 0!==e.edges.smooth.forceDirection&&e.edges.smooth.forceDirection},e.edges.smooth={enabled:void 0===e.edges.smooth.enabled||e.edges.smooth.enabled,type:t,roundness:void 0===e.edges.smooth.roundness?.5:e.edges.smooth.roundness,forceDirection:void 0!==e.edges.smooth.forceDirection&&e.edges.smooth.forceDirection}),this.body.emitter.emit("_forceDisableDynamicCurves",t)}return e}},{key:"seededRandom",value:function(){var e=1e4*Math.sin(this.randomSeed++);return e-Math.floor(e)}},{key:"positionInitially",value:function(e){if(this.options.hierarchical.enabled!==!0){this.randomSeed=this.initialRandomSeed;for(var t=0;ts){for(var r=this.body.nodeIndices.length;this.body.nodeIndices.length>s;){n+=1;var a=this.body.nodeIndices.length;n%3===0?this.body.modules.clustering.clusterBridges():this.body.modules.clustering.clusterOutliers();var h=this.body.nodeIndices.length;if(a==h&&n%3!==0||n>o)return this._declusterAll(),this.body.emitter.emit("_layoutFailed"),void console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.")}this.body.modules.kamadaKawai.setOptions({springLength:Math.max(150,2*r)})}this.body.modules.kamadaKawai.solve(this.body.nodeIndices,this.body.edgeIndices,!0),this._shiftToCenter();for(var d=70,l=0;l0){var e=void 0,t=void 0,i=!1,o=!0,n=!1;this.hierarchicalLevels={},this.lastNodeOnLevel={},this.hierarchicalChildrenReference={},this.hierarchicalParentReference={},this.hierarchicalTrees={},this.treeIndex=-1,this.distributionOrdering={},this.distributionIndex={},this.distributionOrderingPresence={};for(t in this.body.nodes)this.body.nodes.hasOwnProperty(t)&&(e=this.body.nodes[t],void 0===e.options.x&&void 0===e.options.y&&(o=!1),void 0!==e.options.level?(i=!0,this.hierarchicalLevels[t]=e.options.level):n=!0);if(n===!0&&i===!0)throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");n===!0&&("hubsize"===this.options.hierarchical.sortMethod?this._determineLevelsByHubsize():"directed"===this.options.hierarchical.sortMethod?this._determineLevelsDirected():"custom"===this.options.hierarchical.sortMethod&&this._determineLevelsCustomCallback());for(var s in this.body.nodes)this.body.nodes.hasOwnProperty(s)&&void 0===this.hierarchicalLevels[s]&&(this.hierarchicalLevels[s]=0);var r=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(r),this._condenseHierarchy(),this._shiftToCenter()}}},{key:"_condenseHierarchy",value:function(){var e=this,t=!1,i={},o=function(){for(var t=a(),i=0;i0)for(var s=0;s1&&void 0!==arguments[1]?arguments[1]:1e9,o=1e9,n=1e9,r=1e9,a=-1e9;for(var h in t)if(t.hasOwnProperty(h)){var d=e.body.nodes[h],l=e.hierarchicalLevels[d.id],c=e._getPositionForHierarchy(d),u=e._getSpaceAroundNode(d,t),f=s(u,2),p=f[0],v=f[1];o=Math.min(p,o),n=Math.min(v,n),l<=i&&(r=Math.min(c,r),a=Math.max(c,a))}return[r,a,o,n]},l=function t(i){var o=e.hierarchicalLevels[i];if(e.hierarchicalChildrenReference[i]){var n=e.hierarchicalChildrenReference[i];if(n.length>0)for(var s=0;s1)for(var a=0;a2&&void 0!==arguments[2]&&arguments[2],r=e._getPositionForHierarchy(i),a=e._getPositionForHierarchy(o),l=Math.abs(a-r);if(l>e.options.hierarchical.nodeSpacing){var u={};u[i.id]=!0;var f={};f[o.id]=!0,h(i,u),h(o,f);var p=c(i,o),v=d(u,p),y=s(v,4),g=(y[0],y[1]),b=(y[2],y[3],d(f,p)),m=s(b,4),_=m[0],w=(m[1],m[2]),k=(m[3],Math.abs(g-_));if(k>e.options.hierarchical.nodeSpacing){var x=g-_+e.options.hierarchical.nodeSpacing;x<-w+e.options.hierarchical.nodeSpacing&&(x=-w+e.options.hierarchical.nodeSpacing),x<0&&(e._shiftBlock(o.id,x),t=!0,n===!0&&e._centerParent(o))}}},v=function(o,n){for(var r=n.id,a=n.edges,l=e.hierarchicalLevels[n.id],c=e.options.hierarchical.levelSeparation*e.options.hierarchical.levelSeparation,u={},f=[],p=0;p0?v=Math.min(p,f-e.options.hierarchical.nodeSpacing):p<0&&(v=-Math.min(-p,u-e.options.hierarchical.nodeSpacing)),0!=v&&(e._shiftBlock(n.id,v),t=!0)},w=function(i){var o=e._getPositionForHierarchy(n),r=e._getSpaceAroundNode(n),a=s(r,2),h=a[0],d=a[1],l=i-o,c=o;l>0?c=Math.min(o+(d-e.options.hierarchical.nodeSpacing),i):l<0&&(c=Math.max(o-(h-e.options.hierarchical.nodeSpacing),i)),c!==o&&(e._setPositionForHierarchy(n,c,void 0,!0),t=!0)},k=m(o,f);_(k),k=m(o,a),w(k)},y=function(i){var o=Object.keys(e.distributionOrdering);o=o.reverse();for(var n=0;n0)for(var d=0;d0&&Math.abs(g)0&&(r=this._getPositionForHierarchy(i[n-1])+this.options.hierarchical.nodeSpacing),this._setPositionForHierarchy(s,r,t),this._validataPositionAndContinue(s,t,r),o++}}}}},{key:"_placeBranchNodes",value:function(e,t){if(void 0!==this.hierarchicalChildrenReference[e]){for(var i=[],o=0;ot&&void 0===this.positionedNodes[s.id]))return;var a=void 0;a=0===n?this._getPositionForHierarchy(this.body.nodes[e]):this._getPositionForHierarchy(i[n-1])+this.options.hierarchical.nodeSpacing,this._setPositionForHierarchy(s,a,r),this._validataPositionAndContinue(s,r,a)}for(var h=1e9,d=-1e9,l=0;l0&&(t=this._getHubSize(),0!==t);)for(var o in this.body.nodes)if(this.body.nodes.hasOwnProperty(o)){var n=this.body.nodes[o];n.edges.length===t&&this._crawlNetwork(i,o)}}},{key:"_determineLevelsCustomCallback",value:function(){var e=this,t=1e5,i=function(e,t,i){},o=function(o,n,s){var r=e.hierarchicalLevels[o.id];void 0===r&&(e.hierarchicalLevels[o.id]=t);var a=i(d.default.cloneOptions(o,"node"),d.default.cloneOptions(n,"node"),d.default.cloneOptions(s,"edge"));e.hierarchicalLevels[n.id]=e.hierarchicalLevels[o.id]+a};this._crawlNetwork(o),this._setMinLevelToZero()}},{key:"_determineLevelsDirected",value:function(){var e=this,t=1e4,i=function(i,o,n){var s=e.hierarchicalLevels[i.id];void 0===s&&(e.hierarchicalLevels[i.id]=t),n.toId==o.id?e.hierarchicalLevels[o.id]=e.hierarchicalLevels[i.id]+1:e.hierarchicalLevels[o.id]=e.hierarchicalLevels[i.id]-1};this._crawlNetwork(i),this._setMinLevelToZero()}},{key:"_setMinLevelToZero",value:function(){var e=1e9;for(var t in this.body.nodes)this.body.nodes.hasOwnProperty(t)&&void 0!==this.hierarchicalLevels[t]&&(e=Math.min(this.hierarchicalLevels[t],e));for(var i in this.body.nodes)this.body.nodes.hasOwnProperty(i)&&void 0!==this.hierarchicalLevels[i]&&(this.hierarchicalLevels[i]-=e)}},{key:"_generateMap",value:function(){var e=this,t=function(t,i){if(e.hierarchicalLevels[i.id]>e.hierarchicalLevels[t.id]){var o=t.id,n=i.id;void 0===e.hierarchicalChildrenReference[o]&&(e.hierarchicalChildrenReference[o]=[]),e.hierarchicalChildrenReference[o].push(n),void 0===e.hierarchicalParentReference[n]&&(e.hierarchicalParentReference[n]=[]),e.hierarchicalParentReference[n].push(o)}};this._crawlNetwork(t)}},{key:"_crawlNetwork",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},i=arguments[1],o={},n=0,s=function i(n,s){if(void 0===o[n.id]){void 0===e.hierarchicalTrees[n.id]&&(e.hierarchicalTrees[n.id]=s,e.treeIndex=Math.max(s,e.treeIndex)),o[n.id]=!0;for(var r=void 0,a=0;a3&&void 0!==arguments[3]&&arguments[3];o!==!0&&(void 0===this.distributionOrdering[i]&&(this.distributionOrdering[i]=[],this.distributionOrderingPresence[i]={}),void 0===this.distributionOrderingPresence[i][e.id]&&(this.distributionOrdering[i].push(e),this.distributionIndex[e.id]=this.distributionOrdering[i].length-1),this.distributionOrderingPresence[i][e.id]=!0),"UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?e.x=t:e.y=t}},{key:"_getPositionForHierarchy",value:function(e){return"UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?e.x:e.y}},{key:"_sortNodeArray",value:function(e){e.length>1&&("UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?e.sort(function(e,t){return e.x-t.x}):e.sort(function(e,t){return e.y-t.y}))}}]),e}();t.default=c},function(e,t,i){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i0&&this.options.deleteNode!==!1?(n===!0&&this._createSeperator(4),this._createDeleteButton(o)):0===e&&this.options.deleteEdge!==!1&&(n===!0&&this._createSeperator(4),this._createDeleteButton(o))),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this)),this._temporaryBindEvent("select",this.showManipulatorToolbar.bind(this))}this.body.emitter.emit("_redraw")}},{key:"addNodeMode",value:function(){if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addNode",this.guiEnabled===!0){var e=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(e),this._createSeperator(),this._createDescription(e.addDescription||this.options.locales.en.addDescription),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this))}this._temporaryBindEvent("click",this._performAddNode.bind(this))}},{key:"editNode",value:function(){var e=this;this.editMode!==!0&&this.enableEditMode(),this._clean();var t=this.selectionHandler._getSelectedNode();if(void 0!==t){if(this.inMode="editNode","function"!=typeof this.options.editNode)throw new Error("No function has been configured to handle the editing of nodes.");if(t.isCluster!==!0){var i=s.deepExtend({},t.options,!1);if(i.x=t.x,i.y=t.y,2!==this.options.editNode.length)throw new Error("The function for edit does not support two arguments (data, callback)");this.options.editNode(i,function(t){null!==t&&void 0!==t&&"editNode"===e.inMode&&e.body.data.nodes.getDataSet().update(t),e.showManipulatorToolbar()})}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError)}else this.showManipulatorToolbar()}},{key:"addEdgeMode",value:function(){if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addEdge",this.guiEnabled===!0){var e=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(e),this._createSeperator(),this._createDescription(e.edgeDescription||this.options.locales.en.edgeDescription),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this))}this._temporaryBindUI("onTouch",this._handleConnect.bind(this)),this._temporaryBindUI("onDragEnd",this._finishConnect.bind(this)),this._temporaryBindUI("onDrag",this._dragControlNode.bind(this)),this._temporaryBindUI("onRelease",this._finishConnect.bind(this)),this._temporaryBindUI("onDragStart",function(){}),this._temporaryBindUI("onHold",function(){})}},{key:"editEdgeMode",value:function(){var e=this;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="editEdge",this.guiEnabled===!0){var t=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(t),this._createSeperator(),this._createDescription(t.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this))}this.edgeBeingEditedId=this.selectionHandler.getSelectedEdges()[0],void 0!==this.edgeBeingEditedId?!function(){var t=e.body.edges[e.edgeBeingEditedId],i=e._getNewTargetNode(t.from.x,t.from.y),o=e._getNewTargetNode(t.to.x,t.to.y);e.temporaryIds.nodes.push(i.id),e.temporaryIds.nodes.push(o.id),e.body.nodes[i.id]=i,e.body.nodeIndices.push(i.id),e.body.nodes[o.id]=o,e.body.nodeIndices.push(o.id),e._temporaryBindUI("onTouch",e._controlNodeTouch.bind(e)),e._temporaryBindUI("onTap",function(){}),e._temporaryBindUI("onHold",function(){}),e._temporaryBindUI("onDragStart",e._controlNodeDragStart.bind(e)),e._temporaryBindUI("onDrag",e._controlNodeDrag.bind(e)),e._temporaryBindUI("onDragEnd",e._controlNodeDragEnd.bind(e)),e._temporaryBindUI("onMouseMove",function(){}),e._temporaryBindEvent("beforeDrawing",function(e){var n=t.edgeType.findBorderPositions(e);i.selected===!1&&(i.x=n.from.x,i.y=n.from.y),o.selected===!1&&(o.x=n.to.x,o.y=n.to.y)}),e.body.emitter.emit("_redraw")}():this.showManipulatorToolbar()}},{key:"deleteSelected",value:function(){var e=this;this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="delete";var t=this.selectionHandler.getSelectedNodes(),i=this.selectionHandler.getSelectedEdges(),o=void 0;if(t.length>0){for(var n=0;n0&&"function"==typeof this.options.deleteEdge&&(o=this.options.deleteEdge);if("function"==typeof o){var s={nodes:t,edges:i};if(2!==o.length)throw new Error("The function for delete does not support two arguments (data, callback)");o(s,function(t){null!==t&&void 0!==t&&"delete"===e.inMode?(e.body.data.edges.getDataSet().remove(t.edges),e.body.data.nodes.getDataSet().remove(t.nodes),e.body.emitter.emit("startSimulation"),e.showManipulatorToolbar()):(e.body.emitter.emit("startSimulation"),e.showManipulatorToolbar())})}else this.body.data.edges.getDataSet().remove(i),this.body.data.nodes.getDataSet().remove(t),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()}},{key:"_setup",value:function(){this.options.enabled===!0?(this.guiEnabled=!0,this._createWrappers(),this.editMode===!1?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}},{key:"_createWrappers",value:function(){void 0===this.manipulationDiv&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",this.editMode===!0?this.manipulationDiv.style.display="block":this.manipulationDiv.style.display="none",this.canvas.frame.appendChild(this.manipulationDiv)),void 0===this.editModeDiv&&(this.editModeDiv=document.createElement("div"),this.editModeDiv.className="vis-edit-mode",this.editMode===!0?this.editModeDiv.style.display="none":this.editModeDiv.style.display="block",this.canvas.frame.appendChild(this.editModeDiv)),void 0===this.closeDiv&&(this.closeDiv=document.createElement("div"),this.closeDiv.className="vis-close",this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv))}},{key:"_getNewTargetNode",value:function(e,t){var i=s.deepExtend({},this.options.controlNodeStyle);i.id="targetNode"+s.randomUUID(),i.hidden=!1,i.physics=!1,i.x=e,i.y=t;var o=this.body.functions.createNode(i);return o.shape.boundingBox={left:e,right:e,top:t,bottom:t},o}},{key:"_createEditButton",value:function(){this._clean(),this.manipulationDOM={},s.recursiveDOMDelete(this.editModeDiv);var e=this.options.locales[this.options.locale],t=this._createButton("editMode","vis-button vis-edit vis-edit-mode",e.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(t),this._bindHammerToDiv(t,this.toggleEditMode.bind(this))}},{key:"_clean",value:function(){this.inMode=!1,this.guiEnabled===!0&&(s.recursiveDOMDelete(this.editModeDiv),s.recursiveDOMDelete(this.manipulationDiv),this._cleanManipulatorHammers()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}},{key:"_cleanManipulatorHammers",value:function(){if(0!=this.manipulationHammers.length){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:1;this.manipulationDOM["seperatorLineDiv"+e]=document.createElement("div"),this.manipulationDOM["seperatorLineDiv"+e].className="vis-separator-line",this.manipulationDiv.appendChild(this.manipulationDOM["seperatorLineDiv"+e])}},{key:"_createAddNodeButton",value:function(e){var t=this._createButton("addNode","vis-button vis-add",e.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(t),this._bindHammerToDiv(t,this.addNodeMode.bind(this))}},{key:"_createAddEdgeButton",value:function(e){var t=this._createButton("addEdge","vis-button vis-connect",e.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(t),this._bindHammerToDiv(t,this.addEdgeMode.bind(this))}},{key:"_createEditNodeButton",value:function(e){var t=this._createButton("editNode","vis-button vis-edit",e.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(t),this._bindHammerToDiv(t,this.editNode.bind(this))}},{key:"_createEditEdgeButton",value:function(e){var t=this._createButton("editEdge","vis-button vis-edit",e.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(t),this._bindHammerToDiv(t,this.editEdgeMode.bind(this))}},{key:"_createDeleteButton",value:function(e){if(this.options.rtl)var t="vis-button vis-delete-rtl";else var t="vis-button vis-delete";var i=this._createButton("delete",t,e.del||this.options.locales.en.del);this.manipulationDiv.appendChild(i),this._bindHammerToDiv(i,this.deleteSelected.bind(this))}},{key:"_createBackButton",value:function(e){var t=this._createButton("back","vis-button vis-back",e.back||this.options.locales.en.back);this.manipulationDiv.appendChild(t),this._bindHammerToDiv(t,this.showManipulatorToolbar.bind(this))}},{key:"_createButton",value:function(e,t,i){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"vis-label";return this.manipulationDOM[e+"Div"]=document.createElement("div"),this.manipulationDOM[e+"Div"].className=t,this.manipulationDOM[e+"Label"]=document.createElement("div"),this.manipulationDOM[e+"Label"].className=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=0;r--)if(n[r]!==this.selectedControlNode.id){s=this.body.nodes[n[r]];break}if(void 0!==s&&void 0!==this.selectedControlNode)if(s.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{ -var a=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===a.id?this._performEditEdge(s.id,o.to.id):this._performEditEdge(o.from.id,s.id)}else o.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}}},{key:"_handleConnect",value:function(e){if((new Date).valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=s.extend({},this.body.view.translation);var t=this.lastTouch,i=this.selectionHandler.getNodeAt(t);if(void 0!==i)if(i.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var o=this._getNewTargetNode(i.x,i.y);this.body.nodes[o.id]=o,this.body.nodeIndices.push(o.id);var n=this.body.functions.createEdge({id:"connectionEdge"+s.randomUUID(),from:i.id,to:o.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[n.id]=n,this.body.edgeIndices.push(n.id),this.temporaryIds.nodes.push(o.id),this.temporaryIds.edges.push(n.id)}this.touchTime=(new Date).valueOf()}}},{key:"_dragControlNode",value:function(e){var t=this.body.functions.getPointer(e.center);if(void 0!==this.temporaryIds.nodes[0]){var i=this.body.nodes[this.temporaryIds.nodes[0]];i.x=this.canvas._XconvertDOMtoCanvas(t.x),i.y=this.canvas._YconvertDOMtoCanvas(t.y),this.body.emitter.emit("_redraw")}else{var o=t.x-this.lastTouch.x,n=t.y-this.lastTouch.y;this.body.view.translation={x:this.lastTouch.translation.x+o,y:this.lastTouch.translation.y+n}}}},{key:"_finishConnect",value:function(e){var t=this.body.functions.getPointer(e.center),i=this.selectionHandler._pointerToPositionObject(t),o=void 0;void 0!==this.temporaryIds.edges[0]&&(o=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var n=this.selectionHandler._getAllNodesOverlappingWith(i),s=void 0,r=n.length-1;r>=0;r--)if(this.temporaryIds.nodes.indexOf(n[r])===-1){s=this.body.nodes[n[r]];break}this._cleanupTemporaryNodesAndEdges(),void 0!==s&&(s.isCluster===!0?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):void 0!==this.body.nodes[o]&&void 0!==this.body.nodes[s.id]&&this._performAddEdge(o,s.id)),this.body.emitter.emit("_redraw")}},{key:"_performAddNode",value:function(e){var t=this,i={id:s.randomUUID(),x:e.pointer.canvas.x,y:e.pointer.canvas.y,label:"new"};if("function"==typeof this.options.addNode){if(2!==this.options.addNode.length)throw new Error("The function for add does not support two arguments (data,callback)");this.options.addNode(i,function(e){null!==e&&void 0!==e&&"addNode"===t.inMode&&(t.body.data.nodes.getDataSet().add(e),t.showManipulatorToolbar())})}else this.body.data.nodes.getDataSet().add(i),this.showManipulatorToolbar()}},{key:"_performAddEdge",value:function(e,t){var i=this,o={from:e,to:t};if("function"==typeof this.options.addEdge){if(2!==this.options.addEdge.length)throw new Error("The function for connect does not support two arguments (data,callback)");this.options.addEdge(o,function(e){null!==e&&void 0!==e&&"addEdge"===i.inMode&&(i.body.data.edges.getDataSet().add(e),i.selectionHandler.unselectAll(),i.showManipulatorToolbar())})}else this.body.data.edges.getDataSet().add(o),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}},{key:"_performEditEdge",value:function(e,t){var i=this,o={id:this.edgeBeingEditedId,from:e,to:t};if("function"==typeof this.options.editEdge){if(2!==this.options.editEdge.length)throw new Error("The function for edit does not support two arguments (data, callback)");this.options.editEdge(o,function(e){null===e||void 0===e||"editEdge"!==i.inMode?(i.body.edges[o.id].updateEdgeType(),i.body.emitter.emit("_redraw")):(i.body.data.edges.getDataSet().update(e),i.selectionHandler.unselectAll(),i.showManipulatorToolbar())})}else this.body.data.edges.getDataSet().update(o),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}]),e}();t.default=h},function(e,t,i){function o(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r=function(){function e(e,t){for(var i=0;i3&&void 0!==arguments[3]?arguments[3]:1;n(this,e),this.parent=t,this.changedOptions=[],this.container=i,this.allowCreation=!1,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},d.extend(this.options,this.defaultOptions),this.configureOptions=o,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new h.default(s),this.wrapper=void 0}return r(e,[{key:"setOptions",value:function(e){if(void 0!==e){this.popupHistory={},this._removePopup();var t=!0;"string"==typeof e?this.options.filter=e:e instanceof Array?this.options.filter=e.join():"object"===("undefined"==typeof e?"undefined":s(e))?(void 0!==e.container&&(this.options.container=e.container),void 0!==e.filter&&(this.options.filter=e.filter),void 0!==e.showButton&&(this.options.showButton=e.showButton),void 0!==e.enabled&&(t=e.enabled)):"boolean"==typeof e?(this.options.filter=!0,t=e):"function"==typeof e&&(this.options.filter=e,t=!0),this.options.filter===!1&&(t=!1),this.options.enabled=t}this._clean()}},{key:"setModuleOptions",value:function(e){this.moduleOptions=e,this.options.enabled===!0&&(this._clean(),void 0!==this.options.container&&(this.container=this.options.container),this._create())}},{key:"_create",value:function(){var e=this;this._clean(),this.changedOptions=[];var t=this.options.filter,i=0,o=!1;for(var n in this.configureOptions)this.configureOptions.hasOwnProperty(n)&&(this.allowCreation=!1,o=!1,"function"==typeof t?(o=t(n,[]),o=o||this._handleObject(this.configureOptions[n],[n],!0)):t!==!0&&t.indexOf(n)===-1||(o=!0),o!==!1&&(this.allowCreation=!0,i>0&&this._makeItem([]),this._makeHeader(n),this._handleObject(this.configureOptions[n],[n])),i++);this.options.showButton===!0&&!function(){var t=document.createElement("div");t.className="vis-configuration vis-config-button",t.innerHTML="generate options",t.onclick=function(){e._printOptions()},t.onmouseover=function(){t.className="vis-configuration vis-config-button hover"},t.onmouseout=function(){t.className="vis-configuration vis-config-button"},e.optionsContainer=document.createElement("div"),e.optionsContainer.className="vis-configuration vis-config-option-container",e.domElements.push(e.optionsContainer),e.domElements.push(t)}(),this._push()}},{key:"_push",value:function(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(var e=0;e1?o-1:0),r=1;r2&&void 0!==arguments[2]&&arguments[2],o=document.createElement("div");return o.className="vis-configuration vis-config-label vis-config-s"+t.length,i===!0?o.innerHTML=""+e+":":o.innerHTML=e+":",o}},{key:"_makeDropdown",value:function(e,t,i){var o=document.createElement("select");o.className="vis-configuration vis-config-select";var n=0;void 0!==t&&e.indexOf(t)!==-1&&(n=e.indexOf(t));for(var s=0;ss&&1!==s&&(a.max=Math.ceil(t*l),d=a.max,h="range increased"),a.value=t}else a.value=o;var c=document.createElement("input");c.className="vis-configuration vis-config-rangeinput",c.value=a.value;var u=this;a.onchange=function(){c.value=this.value,u._update(Number(this.value),i)},a.oninput=function(){c.value=this.value};var f=this._makeLabel(i[i.length-1],i),p=this._makeItem(i,f,a,c);""!==h&&this.popupHistory[p]!==d&&(this.popupHistory[p]=d,this._setupPopup(h,p))}},{key:"_setupPopup",value:function(e,t){var i=this;if(this.initialized===!0&&this.allowCreation===!0&&this.popupCounter1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=!1,n=this.options.filter,s=!1;for(var r in e)if(e.hasOwnProperty(r)){o=!0;var a=e[r],h=d.copyAndExtendArray(t,r);if("function"==typeof n&&(o=n(r,t),o===!1&&!(a instanceof Array)&&"string"!=typeof a&&"boolean"!=typeof a&&a instanceof Object&&(this.allowCreation=!1,o=this._handleObject(a,h,!0),this.allowCreation=i===!1)),o!==!1){s=!0;var l=this._getValue(h);if(a instanceof Array)this._handleArray(a,l,h);else if("string"==typeof a)this._makeTextInput(a,l,h);else if("boolean"==typeof a)this._makeCheckbox(a,l,h);else if(a instanceof Object){var c=!0;if(t.indexOf("physics")!==-1&&this.moduleOptions.physics.solver!==r&&(c=!1),c===!0)if(void 0!==a.enabled){var u=d.copyAndExtendArray(h,"enabled"),f=this._getValue(u);if(f===!0){var p=this._makeLabel(r,h,!0);this._makeItem(h,p),s=this._handleObject(a,h)||s}else this._makeCheckbox(a,f,h)}else{var v=this._makeLabel(r,h,!0);this._makeItem(h,v),s=this._handleObject(a,h)||s}}else console.error("dont know how to handle",a,r,h)}}return s}},{key:"_handleArray",value:function(e,t,i){"string"==typeof e[0]&&"color"===e[0]?(this._makeColorField(e,t,i),e[1]!==t&&this.changedOptions.push({path:i,value:t})):"string"==typeof e[0]?(this._makeDropdown(e,t,i),e[0]!==t&&this.changedOptions.push({path:i,value:t})):"number"==typeof e[0]&&(this._makeRange(e,t,i),e[0]!==t&&this.changedOptions.push({path:i,value:Number(t)}))}},{key:"_update",value:function(e,t){var i=this._constructOptions(e,t);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",i),this.initialized=!0,this.parent.setOptions(i)}},{key:"_constructOptions",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=i;e="true"===e||e,e="false"!==e&&e;for(var n=0;nvar options = "+JSON.stringify(e,null,2)+""}},{key:"getOptions",value:function(){for(var e={},t=0;t0&&void 0!==arguments[0]?arguments[0]:1;o(this,e),this.pixelRatio=t,this.generated=!1,this.centerCoordinates={x:144.5,y:144.5},this.r=289*.49,this.color={r:255,g:255,b:255,a:1},this.hueCircle=void 0,this.initialColor={r:255,g:255,b:255,a:1},this.previousColor=void 0,this.applied=!1,this.updateCallback=function(){},this.closeCallback=function(){},this._create()}return n(e,[{key:"insertTo",value:function(e){void 0!==this.hammer&&(this.hammer.destroy(),this.hammer=void 0),this.container=e,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}},{key:"setUpdateCallback",value:function(e){if("function"!=typeof e)throw new Error("Function attempted to set as colorPicker update callback is not a function.");this.updateCallback=e}},{key:"setCloseCallback",value:function(e){if("function"!=typeof e)throw new Error("Function attempted to set as colorPicker closing callback is not a function.");this.closeCallback=e}},{key:"_isColorString",value:function(e){var t={black:"#000000",navy:"#000080",darkblue:"#00008B",mediumblue:"#0000CD",blue:"#0000FF",darkgreen:"#006400",green:"#008000",teal:"#008080",darkcyan:"#008B8B",deepskyblue:"#00BFFF",darkturquoise:"#00CED1",mediumspringgreen:"#00FA9A",lime:"#00FF00",springgreen:"#00FF7F",aqua:"#00FFFF",cyan:"#00FFFF",midnightblue:"#191970",dodgerblue:"#1E90FF",lightseagreen:"#20B2AA",forestgreen:"#228B22",seagreen:"#2E8B57",darkslategray:"#2F4F4F",limegreen:"#32CD32",mediumseagreen:"#3CB371",turquoise:"#40E0D0",royalblue:"#4169E1",steelblue:"#4682B4",darkslateblue:"#483D8B",mediumturquoise:"#48D1CC",indigo:"#4B0082",darkolivegreen:"#556B2F",cadetblue:"#5F9EA0",cornflowerblue:"#6495ED",mediumaquamarine:"#66CDAA",dimgray:"#696969",slateblue:"#6A5ACD",olivedrab:"#6B8E23",slategray:"#708090",lightslategray:"#778899",mediumslateblue:"#7B68EE",lawngreen:"#7CFC00",chartreuse:"#7FFF00",aquamarine:"#7FFFD4",maroon:"#800000",purple:"#800080",olive:"#808000",gray:"#808080",skyblue:"#87CEEB",lightskyblue:"#87CEFA",blueviolet:"#8A2BE2",darkred:"#8B0000",darkmagenta:"#8B008B",saddlebrown:"#8B4513",darkseagreen:"#8FBC8F",lightgreen:"#90EE90",mediumpurple:"#9370D8",darkviolet:"#9400D3",palegreen:"#98FB98",darkorchid:"#9932CC",yellowgreen:"#9ACD32",sienna:"#A0522D",brown:"#A52A2A",darkgray:"#A9A9A9",lightblue:"#ADD8E6",greenyellow:"#ADFF2F",paleturquoise:"#AFEEEE",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",firebrick:"#B22222",darkgoldenrod:"#B8860B",mediumorchid:"#BA55D3",rosybrown:"#BC8F8F",darkkhaki:"#BDB76B",silver:"#C0C0C0",mediumvioletred:"#C71585",indianred:"#CD5C5C",peru:"#CD853F",chocolate:"#D2691E",tan:"#D2B48C",lightgrey:"#D3D3D3",palevioletred:"#D87093",thistle:"#D8BFD8",orchid:"#DA70D6",goldenrod:"#DAA520",crimson:"#DC143C",gainsboro:"#DCDCDC",plum:"#DDA0DD",burlywood:"#DEB887",lightcyan:"#E0FFFF",lavender:"#E6E6FA",darksalmon:"#E9967A",violet:"#EE82EE",palegoldenrod:"#EEE8AA",lightcoral:"#F08080",khaki:"#F0E68C",aliceblue:"#F0F8FF",honeydew:"#F0FFF0",azure:"#F0FFFF",sandybrown:"#F4A460",wheat:"#F5DEB3",beige:"#F5F5DC",whitesmoke:"#F5F5F5",mintcream:"#F5FFFA",ghostwhite:"#F8F8FF",salmon:"#FA8072",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lightgoldenrodyellow:"#FAFAD2",oldlace:"#FDF5E6",red:"#FF0000",fuchsia:"#FF00FF",magenta:"#FF00FF",deeppink:"#FF1493",orangered:"#FF4500",tomato:"#FF6347",hotpink:"#FF69B4",coral:"#FF7F50",darkorange:"#FF8C00",lightsalmon:"#FFA07A",orange:"#FFA500",lightpink:"#FFB6C1",pink:"#FFC0CB",gold:"#FFD700",peachpuff:"#FFDAB9",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",mistyrose:"#FFE4E1",blanchedalmond:"#FFEBCD",papayawhip:"#FFEFD5",lavenderblush:"#FFF0F5",seashell:"#FFF5EE",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",floralwhite:"#FFFAF0",snow:"#FFFAFA",yellow:"#FFFF00",lightyellow:"#FFFFE0",ivory:"#FFFFF0",white:"#FFFFFF"};if("string"==typeof e)return t[e]}},{key:"setColor",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("none"!==e){var i=void 0,o=this._isColorString(e);if(void 0!==o&&(e=o),a.isString(e)===!0){if(a.isValidRGB(e)===!0){var n=e.substr(4).substr(0,e.length-5).split(",");i={r:n[0],g:n[1],b:n[2],a:1}}else if(a.isValidRGBA(e)===!0){var s=e.substr(5).substr(0,e.length-6).split(",");i={r:s[0],g:s[1],b:s[2],a:s[3]}}else if(a.isValidHex(e)===!0){var r=a.hexToRGB(e);i={r:r.r,g:r.g,b:r.b,a:1}}}else if(e instanceof Object&&void 0!==e.r&&void 0!==e.g&&void 0!==e.b){var h=void 0!==e.a?e.a:"1.0";i={r:e.r,g:e.g,b:e.b,a:h}}if(void 0===i)throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: "+JSON.stringify(e));this._setColor(i,t)}}},{key:"show",value:function(){void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}},{key:"_hide",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t===!0&&(this.previousColor=a.extend({},this.color)),this.applied===!0&&this.updateCallback(this.initialColor),this.frame.style.display="none",setTimeout(function(){void 0!==e.closeCallback&&(e.closeCallback(),e.closeCallback=void 0)},0)}},{key:"_save",value:function(){this.updateCallback(this.color),this.applied=!1,this._hide()}},{key:"_apply",value:function(){this.applied=!0,this.updateCallback(this.color),this._updatePicker(this.color)}},{key:"_loadLast",value:function(){void 0!==this.previousColor?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}},{key:"_setColor",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t===!0&&(this.initialColor=a.extend({},e)),this.color=e;var i=a.RGBToHSV(e.r,e.g,e.b),o=2*Math.PI,n=this.r*i.s,s=this.centerCoordinates.x+n*Math.sin(o*i.h),r=this.centerCoordinates.y+n*Math.cos(o*i.h);this.colorPickerSelector.style.left=s-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=r-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(e)}},{key:"_setOpacity",value:function(e){this.color.a=e/100,this._updatePicker(this.color)}},{key:"_setBrightness",value:function(e){var t=a.RGBToHSV(this.color.r,this.color.g,this.color.b);t.v=e/100;var i=a.HSVToRGB(t.h,t.s,t.v);i.a=this.color.a,this.color=i,this._updatePicker()}},{key:"_updatePicker",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color,t=a.RGBToHSV(e.r,e.g,e.b),i=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1)),i.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var o=this.colorPickerCanvas.clientWidth,n=this.colorPickerCanvas.clientHeight;i.clearRect(0,0,o,n),i.putImageData(this.hueCircle,0,0),i.fillStyle="rgba(0,0,0,"+(1-t.v)+")",i.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),i.fill(),this.brightnessRange.value=100*t.v,this.opacityRange.value=100*e.a,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}},{key:"_setSize",value:function(){this.colorPickerCanvas.style.width="100%",this.colorPickerCanvas.style.height="100%",this.colorPickerCanvas.width=289*this.pixelRatio,this.colorPickerCanvas.height=289*this.pixelRatio}},{key:"_create",value:function(){if(this.frame=document.createElement("div"),this.frame.className="vis-color-picker",this.colorPickerDiv=document.createElement("div"),this.colorPickerSelector=document.createElement("div"),this.colorPickerSelector.className="vis-selector",this.colorPickerDiv.appendChild(this.colorPickerSelector),this.colorPickerCanvas=document.createElement("canvas"),this.colorPickerDiv.appendChild(this.colorPickerCanvas),this.colorPickerCanvas.getContext){var e=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{var t=document.createElement("DIV");t.style.color="red",t.style.fontWeight="bold",t.style.padding="10px",t.innerHTML="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(t)}this.colorPickerDiv.className="vis-color",this.opacityDiv=document.createElement("div"),this.opacityDiv.className="vis-opacity",this.brightnessDiv=document.createElement("div"),this.brightnessDiv.className="vis-brightness",this.arrowDiv=document.createElement("div"),this.arrowDiv.className="vis-arrow",this.opacityRange=document.createElement("input");try{this.opacityRange.type="range",this.opacityRange.min="0",this.opacityRange.max="100"}catch(e){}this.opacityRange.value="100",this.opacityRange.className="vis-range",this.brightnessRange=document.createElement("input");try{this.brightnessRange.type="range",this.brightnessRange.min="0",this.brightnessRange.max="100"}catch(e){}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);var i=this;this.opacityRange.onchange=function(){i._setOpacity(this.value)},this.opacityRange.oninput=function(){i._setOpacity(this.value)},this.brightnessRange.onchange=function(){i._setBrightness(this.value)},this.brightnessRange.oninput=function(){i._setBrightness(this.value)},this.brightnessLabel=document.createElement("div"),this.brightnessLabel.className="vis-label vis-brightness",this.brightnessLabel.innerHTML="brightness:",this.opacityLabel=document.createElement("div"),this.opacityLabel.className="vis-label vis-opacity",this.opacityLabel.innerHTML="opacity:",this.newColorDiv=document.createElement("div"),this.newColorDiv.className="vis-new-color",this.newColorDiv.innerHTML="new",this.initialColorDiv=document.createElement("div"),this.initialColorDiv.className="vis-initial-color",this.initialColorDiv.innerHTML="initial",this.cancelButton=document.createElement("div"),this.cancelButton.className="vis-button vis-cancel",this.cancelButton.innerHTML="cancel",this.cancelButton.onclick=this._hide.bind(this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerHTML="apply",this.applyButton.onclick=this._apply.bind(this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerHTML="save",this.saveButton.onclick=this._save.bind(this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerHTML="load last",this.loadButton.onclick=this._loadLast.bind(this),this.frame.appendChild(this.colorPickerDiv),this.frame.appendChild(this.arrowDiv),this.frame.appendChild(this.brightnessLabel),this.frame.appendChild(this.brightnessDiv),this.frame.appendChild(this.opacityLabel),this.frame.appendChild(this.opacityDiv),this.frame.appendChild(this.newColorDiv),this.frame.appendChild(this.initialColorDiv),this.frame.appendChild(this.cancelButton),this.frame.appendChild(this.applyButton),this.frame.appendChild(this.saveButton),this.frame.appendChild(this.loadButton)}},{key:"_bindHammer",value:function(){var e=this;this.drag={},this.pinch={},this.hammer=new s(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),r.onTouch(this.hammer,function(t){e._moveSelector(t)}),this.hammer.on("tap",function(t){e._moveSelector(t)}),this.hammer.on("panstart",function(t){e._moveSelector(t)}),this.hammer.on("panmove",function(t){e._moveSelector(t)}),this.hammer.on("panend",function(t){e._moveSelector(t)})}},{key:"_generateHueCircle",value:function(){if(this.generated===!1){var e=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)),e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var t=this.colorPickerCanvas.clientWidth,i=this.colorPickerCanvas.clientHeight;e.clearRect(0,0,t,i);var o=void 0,n=void 0,s=void 0,r=void 0;this.centerCoordinates={x:.5*t,y:.5*i},this.r=.49*t;var h=2*Math.PI/360,d=1/360,l=1/this.r,c=void 0;for(s=0;s<360;s++)for(r=0;r2&&void 0!==arguments[2]&&arguments[2],o=this.distanceSolver.getDistances(this.body,e,t);this._createL_matrix(o),this._createK_matrix(o);for(var n=.01,r=1,a=0,h=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),d=5,l=1e9,c=0,u=0,f=0,p=0,v=0;l>n&&ar&&v=.1;)f=n[l++%s],f>d&&(f=d),u=Math.sqrt(f*f/(1+h*h)),u=r<0?-u:u,e+=u,t+=h*u,c===!0?this.lineTo(e,t):this.moveTo(e,t),d-=f,c=!c})},function(e,t){function i(e){if(e)return o(e)}function o(e){for(var t in i.prototype)e[t]=i.prototype[t];return e}e.exports=i,i.prototype.on=i.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[e]=this._callbacks[e]||[]).push(t),this},i.prototype.once=function(e,t){function i(){o.off(e,i),t.apply(this,arguments)}var o=this;return this._callbacks=this._callbacks||{},i.fn=t,this.on(e,i),this},i.prototype.off=i.prototype.removeListener=i.prototype.removeAllListeners=i.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var i=this._callbacks[e];if(!i)return this;if(1==arguments.length)return delete this._callbacks[e],this;for(var o,n=0;n=0;i--){var h=s[i];h.nodes||(h.nodes=[]),h.nodes.indexOf(n)===-1&&h.nodes.push(n)}t.attr&&(n.attr=a(n.attr,t.attr))}function l(e,t){if(e.edges||(e.edges=[]),e.edges.push(t),e.edge){var i=a({},e.edge);t.attr=a(i,t.attr)}}function c(e,t,i,o,n){var s={from:t,to:i,type:o};return e.edge&&(s.attr=a({},e.edge)),s.attr=a(s.attr||{},n),s}function u(){for(j=D.NULL,I="";" "===F||"\t"===F||"\n"===F||"\r"===F;)n();do{var e=!1;if("#"===F){for(var t=B-1;" "===P.charAt(t)||"\t"===P.charAt(t);)t--;if("\n"===P.charAt(t)||""===P.charAt(t)){for(;""!=F&&"\n"!=F;)n();e=!0}}if("/"===F&&"/"===s()){for(;""!=F&&"\n"!=F;)n();e=!0}if("/"===F&&"*"===s()){for(;""!=F;){if("*"===F&&"/"===s()){n(),n();break}n()}e=!0}for(;" "===F||"\t"===F||"\n"===F||"\r"===F;)n()}while(e);if(""===F)return void(j=D.DELIMITER);var i=F+s();if(T[i])return j=D.DELIMITER,I=i,n(),void n();if(T[F])return j=D.DELIMITER,I=F,void n();if(r(F)||"-"===F){for(I+=F,n();r(F);)I+=F,n();return"false"===I?I=!1:"true"===I?I=!0:isNaN(Number(I))||(I=Number(I)),void(j=D.IDENTIFIER)}if('"'===F){for(n();""!=F&&('"'!=F||'"'===F&&'"'===s());)I+=F,'"'===F&&n(),n();if('"'!=F)throw w('End of string " expected');return n(),void(j=D.IDENTIFIER)}for(j=D.UNKNOWN;""!=F;)I+=F,n();throw new SyntaxError('Syntax error in part "'+k(I,30)+'"')}function f(){var e={};if(o(),u(),"strict"===I&&(e.strict=!0,u()),"graph"!==I&&"digraph"!==I||(e.type=I,u()),j===D.IDENTIFIER&&(e.id=I,u()),"{"!=I)throw w("Angle bracket { expected");if(u(),p(e),"}"!=I)throw w("Angle bracket } expected");if(u(),""!==I)throw w("End of file expected");return u(),delete e.node,delete e.edge,delete e.graph,e}function p(e){for(;""!==I&&"}"!=I;)v(e),";"===I&&u()}function v(e){var t=y(e);if(t)return void m(e,t);var i=g(e);if(!i){if(j!=D.IDENTIFIER)throw w("Identifier expected");var o=I;if(u(),"="===I){if(u(),j!=D.IDENTIFIER)throw w("Identifier expected");e[o]=I,u()}else b(e,o)}}function y(e){var t=null;if("subgraph"===I&&(t={},t.type="subgraph",u(),j===D.IDENTIFIER&&(t.id=I,u())),"{"===I){if(u(),t||(t={}),t.parent=e,t.node=e.node,t.edge=e.edge,t.graph=e.graph,p(t),"}"!=I)throw w("Angle bracket } expected");u(),delete t.node,delete t.edge,delete t.graph,delete t.parent,e.subgraphs||(e.subgraphs=[]),e.subgraphs.push(t)}return t}function g(e){return"node"===I?(u(),e.node=_(),"node"):"edge"===I?(u(),e.edge=_(),"edge"):"graph"===I?(u(),e.graph=_(),"graph"):null}function b(e,t){var i={id:t},o=_();o&&(i.attr=o),d(e,i),m(e,t)}function m(e,t){for(;"->"===I||"--"===I;){var i,o=I;u();var n=y(e);if(n)i=n;else{if(j!=D.IDENTIFIER)throw w("Identifier or subgraph expected");i=I,d(e,{id:i}),u()}var s=_(),r=c(e,t,i,o,s);l(e,r),t=i}}function _(){for(var e=null;"["===I;){for(u(),e={};""!==I&&"]"!=I;){if(j!=D.IDENTIFIER)throw w("Attribute name expected");var t=I;if(u(),"="!=I)throw w("Equal sign = expected");if(u(),j!=D.IDENTIFIER)throw w("Attribute value expected");var i=I;h(e,t,i),u(),","==I&&u()}if("]"!=I)throw w("Bracket ] expected");u()}return e}function w(e){return new SyntaxError(e+', got "'+k(I,30)+'" (char '+B+")")}function k(e,t){return e.length<=t?e:e.substr(0,27)+"..."}function x(e,t,i){Array.isArray(e)?e.forEach(function(e){Array.isArray(t)?t.forEach(function(t){i(e,t)}):i(e,t)}):Array.isArray(t)?t.forEach(function(t){i(e,t)}):i(e,t)}function O(e,t,i){for(var o=t.split("."),n=o.pop(),s=e,r=0;r":!0,"--":!0},P="",B=0,F="",I="",j=D.NULL,N=/[a-zA-Z_0-9.:#]/;t.parseDOT=i,t.DOTToGraph=M},function(e,t){function i(e,t){var i=[],o=[],n={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};void 0!==t&&(void 0!==t.fixed&&(n.nodes.fixed=t.fixed),void 0!==t.parseColor&&(n.nodes.parseColor=t.parseColor),void 0!==t.inheritColor&&(n.edges.inheritColor=t.inheritColor));for(var s=e.edges,r=e.nodes,a=0;a\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",s=n.console&&(n.console.warn||n.console.log);return s&&s.call(n.console,o,i),t.apply(this,arguments)}}function c(t,e,i){var o,n=e.prototype;o=t.prototype=Object.create(n),o.constructor=t,o._super=n,i&&vt(o,i)}function f(t,e){return function(){return t.apply(e,arguments)}}function p(t,e){return typeof t==mt?t.apply(e?e[0]||a:a,e):t}function v(t,e){return t===a?e:t}function g(t,e,i){l(_(e),function(e){t.addEventListener(e,i,!1)})}function y(t,e,i){l(_(e),function(e){t.removeEventListener(e,i,!1)})}function m(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function b(t,e){return t.indexOf(e)>-1}function _(t){return t.trim().split(/\s+/g)}function w(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var o=0;oi[e]}):o.sort()),o}function O(t,e){for(var i,o,n=e[0].toUpperCase()+e.slice(1),s=0;s1&&!i.firstMultiple?i.firstMultiple=F(e):1===n&&(i.firstMultiple=!1);var s=i.firstInput,r=i.firstMultiple,a=r?r.center:s.center,d=e.center=I(o);e.timeStamp=wt(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=A(a,d),e.distance=R(a,d),P(i,e),e.offsetDirection=N(e.deltaX,e.deltaY);var h=z(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=h.x,e.overallVelocityY=h.y,e.overallVelocity=_t(h.x)>_t(h.y)?h.x:h.y,e.scale=r?H(r.pointers,o):1,e.rotation=r?j(r.pointers,o):0,e.maxPointers=i.prevInput?e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers:e.pointers.length,B(i,e);var l=t.element;m(e.srcEvent.target,l)&&(l=e.srcEvent.target),e.target=l}function P(t,e){var i=e.center,o=t.offsetDelta||{},n=t.prevDelta||{},s=t.prevInput||{};e.eventType!==It&&s.eventType!==Nt||(n=t.prevDelta={x:s.deltaX||0,y:s.deltaY||0},o=t.offsetDelta={x:i.x,y:i.y}),e.deltaX=n.x+(i.x-o.x),e.deltaY=n.y+(i.y-o.y)}function B(t,e){var i,o,n,s,r=t.lastInterval||e,d=e.timeStamp-r.timeStamp;if(e.eventType!=Rt&&(d>Ft||r.velocity===a)){var h=e.deltaX-r.deltaX,l=e.deltaY-r.deltaY,u=z(d,h,l);o=u.x,n=u.y,i=_t(u.x)>_t(u.y)?u.x:u.y,s=N(h,l),t.lastInterval=e}else i=r.velocity,o=r.velocityX,n=r.velocityY,s=r.direction;e.velocity=i,e.velocityX=o,e.velocityY=n,e.direction=s}function F(t){for(var e=[],i=0;i=_t(e)?t<0?jt:Ht:e<0?Lt:Wt}function R(t,e,i){i||(i=qt);var o=e[i[0]]-t[i[0]],n=e[i[1]]-t[i[1]];return Math.sqrt(o*o+n*n)}function A(t,e,i){i||(i=qt);var o=e[i[0]]-t[i[0]],n=e[i[1]]-t[i[1]];return 180*Math.atan2(n,o)/Math.PI}function j(t,e){return A(e[1],e[0],Gt)+A(t[1],t[0],Gt)}function H(t,e){return R(e[0],e[1],Gt)/R(t[0],t[1],Gt)}function L(){this.evEl=Kt,this.evWin=Zt,this.pressed=!1,E.apply(this,arguments)}function W(){this.evEl=$t,this.evWin=te,E.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function Y(){this.evTarget=ie,this.evWin=oe,this.started=!1,E.apply(this,arguments)}function U(t,e){var i=k(t.touches),o=k(t.changedTouches);return e&(Nt|Rt)&&(i=x(i.concat(o),"identifier",!0)),[i,o]}function V(){this.evTarget=se,this.targetIds={},E.apply(this,arguments)}function q(t,e){var i=k(t.touches),o=this.targetIds;if(e&(It|zt)&&1===i.length)return o[i[0].identifier]=!0,[i,i];var n,s,r=k(t.changedTouches),a=[],d=this.target;if(s=i.filter(function(t){return m(t.target,d)}),e===It)for(n=0;n-1&&o.splice(t,1)};setTimeout(n,re)}}function Z(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,o=0;o-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){function e(e){i.manager.emit(e,t)}var i=this,o=this.state;o<_e&&e(i.options.event+et(o)),e(i.options.event),t.additionalEvent&&e(t.additionalEvent),o>=_e&&e(i.options.event+et(o))},tryEmit:function(t){return this.canEmit()?this.emit(t):void(this.state=xe)},canEmit:function(){for(var t=0;te.threshold&&n&e.direction},attrTest:function(t){return nt.prototype.attrTest.call(this,t)&&(this.state&me||!(this.state&me)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=it(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),c(rt,nt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[fe]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&me)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),c(at,tt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ue]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,o=t.distancee.time;if(this._input=t,!o||!i||t.eventType&(Nt|Rt)&&!n)this.reset();else if(t.eventType&It)this.reset(),this._timer=d(function(){this.state=we,this.tryEmit()},e.time,this);else if(t.eventType&Nt)return we;return xe},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===we&&(t&&t.eventType&Nt?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=wt(),this.manager.emit(this.options.event,this._input)))}}),c(dt,nt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[fe]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&me)}}),c(ht,nt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Yt|Ut,pointers:1},getTouchAction:function(){return st.prototype.getTouchAction.call(this)},attrTest:function(t){var e,i=this.options.direction;return i&(Yt|Ut)?e=t.overallVelocity:i&Yt?e=t.overallVelocityX:i&Ut&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&i&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&_t(e)>this.options.velocity&&t.eventType&Nt},emit:function(t){var e=it(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),c(lt,tt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ce]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,o=t.distance0&&void 0!==arguments[0]?arguments[0]:{};this.options=t}},{key:"fit",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{nodes:[]},e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=void 0,o=void 0;if(void 0!==t.nodes&&0!==t.nodes.length||(t.nodes=this.body.nodeIndices),e===!0){var n=0;for(var s in this.body.nodes)if(this.body.nodes.hasOwnProperty(s)){var r=this.body.nodes[s];r.predefinedPosition===!0&&(n+=1)}if(n>.5*this.body.nodeIndices.length)return void this.fit(t,!1);i=h.default.getRange(this.body.nodes,t.nodes);var a=this.body.nodeIndices.length;o=12.662/(a+7.4147)+.0964822;var d=Math.min(this.canvas.frame.canvas.clientWidth/600,this.canvas.frame.canvas.clientHeight/600);o*=d}else{this.body.emitter.emit("_resizeNodes"),i=h.default.getRange(this.body.nodes,t.nodes);var l=1.1*Math.abs(i.maxX-i.minX),u=1.1*Math.abs(i.maxY-i.minY),c=this.canvas.frame.canvas.clientWidth/l,f=this.canvas.frame.canvas.clientHeight/u;o=c<=f?c:f}o>1?o=1:0===o&&(o=1);var p=h.default.findCenter(i),v={position:p,scale:o,animation:t.animation};this.moveTo(v)}},{key:"focus",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(void 0!==this.body.nodes[t]){var i={x:this.body.nodes[t].x,y:this.body.nodes[t].y};e.position=i,e.lockedOnNode=t,this.moveTo(e)}else console.log("Node: "+t+" cannot be found.")}},{key:"moveTo",value:function(t){return void 0===t?void(t={}):(void 0===t.offset&&(t.offset={x:0,y:0}),void 0===t.offset.x&&(t.offset.x=0),void 0===t.offset.y&&(t.offset.y=0),void 0===t.scale&&(t.scale=this.body.view.scale),void 0===t.position&&(t.position=this.getViewPosition()),void 0===t.animation&&(t.animation={duration:0}),t.animation===!1&&(t.animation={duration:0}),t.animation===!0&&(t.animation={}),void 0===t.animation.duration&&(t.animation.duration=1e3),void 0===t.animation.easingFunction&&(t.animation.easingFunction="easeInOutQuad"),void this.animateView(t))}},{key:"animateView",value:function(t){if(void 0!==t){this.animationEasingFunction=t.animation.easingFunction,this.releaseNode(),t.locked===!0&&(this.lockedOnNodeId=t.lockedOnNode,this.lockedOnNodeOffset=t.offset),0!=this.easingTime&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=t.scale,this.body.view.scale=this.targetScale;var e=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),i={x:e.x-t.position.x,y:e.y-t.position.y};this.targetTranslation={x:this.sourceTranslation.x+i.x*this.targetScale+t.offset.x,y:this.sourceTranslation.y+i.y*this.targetScale+t.offset.y},0===t.animation.duration?void 0!=this.lockedOnNodeId?(this.viewFunction=this._lockedRedraw.bind(this),this.body.emitter.on("initRedraw",this.viewFunction)):(this.body.view.scale=this.targetScale,this.body.view.translation=this.targetTranslation,this.body.emitter.emit("_requestRedraw")):(this.animationSpeed=1/(60*t.animation.duration*.001)||1/60,this.animationEasingFunction=t.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 t={x:this.body.nodes[this.lockedOnNodeId].x,y:this.body.nodes[this.lockedOnNodeId].y},e=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),i={x:e.x-t.x,y:e.y-t.y},o=this.body.view.translation,n={x:o.x+i.x*this.body.view.scale+this.lockedOnNodeOffset.x,y:o.y+i.y*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=n}},{key:"releaseNode",value:function(){void 0!==this.lockedOnNodeId&&void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}},{key:"_transitionRedraw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.easingTime+=this.animationSpeed,this.easingTime=t===!0?1:this.easingTime;var e=l.easingFunctions[this.animationEasingFunction](this.easingTime);this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*e,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*e,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*e},this.easingTime>=1&&(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,void 0!=this.lockedOnNodeId&&(this.viewFunction=this._lockedRedraw.bind(this),this.body.emitter.on("initRedraw",this.viewFunction)),this.body.emitter.emit("animationFinished"))}},{key:"getScale",value:function(){return this.body.view.scale}},{key:"getViewPosition",value:function(){return this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight})}}]),t}();e.default=u},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(95),s=o(n),r=i(96),a=o(r),d=i(164),h=o(d),l=i(166),u=o(l),c=i(1),f=function(){function t(e,i,o){(0,s.default)(this,t),this.body=e,this.canvas=i,this.selectionHandler=o,this.navigationHandler=new h.default(e,i),this.body.eventListeners.onTap=this.onTap.bind(this),this.body.eventListeners.onTouch=this.onTouch.bind(this),this.body.eventListeners.onDoubleTap=this.onDoubleTap.bind(this),this.body.eventListeners.onHold=this.onHold.bind(this),this.body.eventListeners.onDragStart=this.onDragStart.bind(this),this.body.eventListeners.onDrag=this.onDrag.bind(this),this.body.eventListeners.onDragEnd=this.onDragEnd.bind(this),this.body.eventListeners.onMouseWheel=this.onMouseWheel.bind(this),this.body.eventListeners.onPinch=this.onPinch.bind(this),this.body.eventListeners.onMouseMove=this.onMouseMove.bind(this),this.body.eventListeners.onRelease=this.onRelease.bind(this),this.body.eventListeners.onContext=this.onContext.bind(this),this.touchTime=0,this.drag={},this.pinch={},this.popup=void 0,this.popupObj=void 0,this.popupTimer=void 0,this.body.functions.getPointer=this.getPointer.bind(this),this.options={},this.defaultOptions={dragNodes:!0,dragView:!0,hover:!1,keyboard:{enabled:!1,speed:{x:10,y:10,zoom:.02},bindToWindow:!0},navigationButtons:!1,tooltipDelay:300,zoomView:!0},c.extend(this.options,this.defaultOptions),this.bindEventListeners()}return(0,a.default)(t,[{key:"bindEventListeners",value:function(){var t=this;this.body.emitter.on("destroy",function(){clearTimeout(t.popupTimer),delete t.body.functions.getPointer})}},{key:"setOptions",value:function(t){if(void 0!==t){var e=["hideEdgesOnDrag","hideNodesOnDrag","keyboard","multiselect","selectable","selectConnectedEdges"];c.selectiveNotDeepExtend(e,this.options,t),c.mergeOptions(this.options,t,"keyboard"),t.tooltip&&(c.extend(this.options.tooltip,t.tooltip),t.tooltip.color&&(this.options.tooltip.color=c.parseColor(t.tooltip.color)))}this.navigationHandler.setOptions(this.options)}},{key:"getPointer",value:function(t){return{x:t.x-c.getAbsoluteLeft(this.canvas.frame.canvas),y:t.y-c.getAbsoluteTop(this.canvas.frame.canvas)}}},{key:"onTouch",value:function(t){(new Date).valueOf()-this.touchTime>50&&(this.drag.pointer=this.getPointer(t.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=(new Date).valueOf())}},{key:"onTap",value:function(t){var e=this.getPointer(t.center),i=this.selectionHandler.options.multiselect&&(t.changedPointers[0].ctrlKey||t.changedPointers[0].metaKey);this.checkSelectionChanges(e,t,i),this.selectionHandler._generateClickEvent("click",t,e)}},{key:"onDoubleTap",value:function(t){var e=this.getPointer(t.center);this.selectionHandler._generateClickEvent("doubleClick",t,e)}},{key:"onHold",value:function(t){var e=this.getPointer(t.center),i=this.selectionHandler.options.multiselect;this.checkSelectionChanges(e,t,i),this.selectionHandler._generateClickEvent("click",t,e),this.selectionHandler._generateClickEvent("hold",t,e)}},{key:"onRelease",value:function(t){if((new Date).valueOf()-this.touchTime>10){var e=this.getPointer(t.center);this.selectionHandler._generateClickEvent("release",t,e),this.touchTime=(new Date).valueOf()}}},{key:"onContext",value:function(t){var e=this.getPointer({x:t.clientX,y:t.clientY});this.selectionHandler._generateClickEvent("oncontext",t,e)}},{key:"checkSelectionChanges",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=this.selectionHandler._getSelectedEdgeCount(),n=this.selectionHandler._getSelectedNodeCount(),s=this.selectionHandler.getSelection(),r=void 0;r=i===!0?this.selectionHandler.selectAdditionalOnPoint(t):this.selectionHandler.selectOnPoint(t);var a=this.selectionHandler._getSelectedEdgeCount(),d=this.selectionHandler._getSelectedNodeCount(),h=this.selectionHandler.getSelection(),l=this._determineIfDifferent(s,h),u=l.nodesChanged,c=l.edgesChanged,f=!1;d-n>0?(this.selectionHandler._generateClickEvent("selectNode",e,t),r=!0,f=!0):u===!0&&d>0?(this.selectionHandler._generateClickEvent("deselectNode",e,t,s),this.selectionHandler._generateClickEvent("selectNode",e,t),f=!0,r=!0):d-n<0&&(this.selectionHandler._generateClickEvent("deselectNode",e,t,s),r=!0),a-o>0&&f===!1?(this.selectionHandler._generateClickEvent("selectEdge",e,t),r=!0):a>0&&c===!0?(this.selectionHandler._generateClickEvent("deselectEdge",e,t,s),this.selectionHandler._generateClickEvent("selectEdge",e,t),r=!0):a-o<0&&(this.selectionHandler._generateClickEvent("deselectEdge",e,t,s),r=!0),r===!0&&this.selectionHandler._generateClickEvent("select",e,t)}},{key:"_determineIfDifferent",value:function(t,e){for(var i=!1,o=!1,n=0;n10&&(t=10);var o=void 0;void 0!==this.drag&&this.drag.dragging===!0&&(o=this.canvas.DOMtoCanvas(this.drag.pointer));var n=this.body.view.translation,s=t/i,r=(1-s)*e.x+n.x*s,a=(1-s)*e.y+n.y*s;if(this.body.view.scale=t,this.body.view.translation={x:r,y:a},void 0!=o){var d=this.canvas.canvasToDOM(o);this.drag.pointer.x=d.x,this.drag.pointer.y=d.y}this.body.emitter.emit("_requestRedraw"),i0&&(this.popupObj=d[l[l.length-1]],s=!0)}if(void 0===this.popupObj&&s===!1){for(var f=this.body.edgeIndices,p=this.body.edges,v=void 0,g=[],y=0;y0&&(this.popupObj=p[g[g.length-1]],r="edge")}void 0!==this.popupObj?this.popupObj.id!==n&&(void 0===this.popup&&(this.popup=new u.default(this.canvas.frame)),this.popup.popupTargetType=r,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(t.x+3,t.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(t){var e=this.selectionHandler._pointerToPositionObject(t),i=!1;if("node"===this.popup.popupTargetType){if(void 0!==this.body.nodes[this.popup.popupTargetId]&&(i=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(e),i===!0)){var o=this.selectionHandler.getNodeAt(t);i=void 0!==o&&o.id===this.popup.popupTargetId}}else void 0===this.selectionHandler.getNodeAt(t)&&void 0!==this.body.edges[this.popup.popupTargetId]&&(i=this.body.edges[this.popup.popupTargetId].isOverlappingWith(e));i===!1&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}}]),t}();e.default=f},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(95),s=o(n),r=i(96),a=o(r),d=(i(1),i(158)),h=i(161),l=i(165),u=function(){function t(e,i){var o=this;(0,s.default)(this,t),this.body=e,this.canvas=i,this.iconsCreated=!1,this.navigationHammers=[],this.boundFunctions={},this.touchTime=0,this.activated=!1,this.body.emitter.on("activate",function(){o.activated=!0,o.configureKeyboardBindings()}),this.body.emitter.on("deactivate",function(){o.activated=!1,o.configureKeyboardBindings()}),this.body.emitter.on("destroy",function(){void 0!==o.keycharm&&o.keycharm.destroy()}),this.options={}}return(0,a.default)(t,[{key:"setOptions",value:function(t){void 0!==t&&(this.options=t,this.create())}},{key:"create",value:function(){this.options.navigationButtons===!0?this.iconsCreated===!1&&this.loadNavigationElements():this.iconsCreated===!0&&this.cleanNavigation(),this.configureKeyboardBindings()}},{key:"cleanNavigation",value:function(){if(0!=this.navigationHammers.length){for(var t=0;t700&&(this.body.emitter.emit("fit",{duration:700}),this.touchTime=(new Date).valueOf())}},{key:"_stopMovement",value:function(){for(var t in this.boundFunctions)this.boundFunctions.hasOwnProperty(t)&&(this.body.emitter.off("initRedraw",this.boundFunctions[t]),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 t=this.body.view.scale,e=this.body.view.scale*(1+this.options.keyboard.speed.zoom),i=this.body.view.translation,o=e/t,n=(1-o)*this.canvas.canvasViewCenter.x+i.x*o,s=(1-o)*this.canvas.canvasViewCenter.y+i.y*o;this.body.view.scale=e,this.body.view.translation={x:n,y:s},this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:pointer})}},{key:"_zoomOut",value:function(){var t=this.body.view.scale,e=this.body.view.scale/(1+this.options.keyboard.speed.zoom),i=this.body.view.translation,o=e/t,n=(1-o)*this.canvas.canvasViewCenter.x+i.x*o,s=(1-o)*this.canvas.canvasViewCenter.y+i.y*o;this.body.view.scale=e,this.body.view.translation={x:n,y:s},this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:pointer})}},{key:"configureKeyboardBindings",value:function(){var t=this;void 0!==this.keycharm&&this.keycharm.destroy(),this.options.keyboard.enabled===!0&&(this.options.keyboard.bindToWindow===!0?this.keycharm=l({container:window,preventDefault:!0}):this.keycharm=l({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),this.activated===!0&&(this.keycharm.bind("up",function(){t.bindToRedraw("_moveUp")},"keydown"),this.keycharm.bind("down",function(){t.bindToRedraw("_moveDown")},"keydown"),this.keycharm.bind("left",function(){t.bindToRedraw("_moveLeft")},"keydown"),this.keycharm.bind("right",function(){t.bindToRedraw("_moveRight")},"keydown"),this.keycharm.bind("=",function(){t.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("num+",function(){t.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("num-",function(){t.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("-",function(){t.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("[",function(){t.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("]",function(){t.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("pageup",function(){t.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("pagedown",function(){t.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("up",function(){t.unbindFromRedraw("_moveUp")},"keyup"),this.keycharm.bind("down",function(){t.unbindFromRedraw("_moveDown")},"keyup"),this.keycharm.bind("left",function(){t.unbindFromRedraw("_moveLeft")},"keyup"),this.keycharm.bind("right",function(){t.unbindFromRedraw("_moveRight")},"keyup"),this.keycharm.bind("=",function(){t.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("num+",function(){t.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("num-",function(){t.unbindFromRedraw("_zoomOut")},"keyup"),this.keycharm.bind("-",function(){t.unbindFromRedraw("_zoomOut")},"keyup"),this.keycharm.bind("[",function(){t.unbindFromRedraw("_zoomOut")},"keyup"),this.keycharm.bind("]",function(){t.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("pageup",function(){t.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("pagedown",function(){t.unbindFromRedraw("_zoomOut")},"keyup")))}}]),t}();e.default=u},function(t,e,i){var o,n,s;!function(i,r){n=[],o=r,s="function"==typeof o?o.apply(e,n):o,!(void 0!==s&&(t.exports=s))}(this,function(){function t(t){var e,i=t&&t.preventDefault||!1,o=t&&t.container||window,n={},s={keydown:{},keyup:{}},r={};for(e=97;e<=122;e++)r[String.fromCharCode(e)]={code:65+(e-97),shift:!1};for(e=65;e<=90;e++)r[String.fromCharCode(e)]={code:e,shift:!0};for(e=0;e<=9;e++)r[""+e]={code:48+e,shift:!1};for(e=1;e<=12;e++)r["F"+e]={code:111+e,shift:!1};for(e=0;e<=9;e++)r["num"+e]={code:96+e,shift:!1};r["num*"]={code:106,shift:!1},r["num+"]={code:107,shift:!1},r["num-"]={code:109,shift:!1},r["num/"]={code:111,shift:!1},r["num."]={code:110,shift:!1},r.left={code:37,shift:!1},r.up={code:38,shift:!1},r.right={code:39,shift:!1},r.down={code:40,shift:!1},r.space={code:32,shift:!1},r.enter={code:13,shift:!1},r.shift={code:16,shift:void 0},r.esc={code:27,shift:!1},r.backspace={code:8,shift:!1},r.tab={code:9,shift:!1},r.ctrl={code:17,shift:!1},r.alt={code:18,shift:!1},r.delete={code:46,shift:!1},r.pageup={code:33,shift:!1},r.pagedown={code:34,shift:!1},r["="]={code:187,shift:!1},r["-"]={code:189,shift:!1},r["]"]={code:221,shift:!1},r["["]={code:219,shift:!1};var a=function(t){h(t,"keydown")},d=function(t){h(t,"keyup")},h=function(t,e){if(void 0!==s[e][t.keyCode]){for(var o=s[e][t.keyCode],n=0;nn-this.padding&&(a=!0),s=a?this.x-i:this.x,r=d?this.y-e:this.y}else r=this.y-e,r+e+this.padding>o&&(r=o-e-this.padding),rn&&(s=n-i-this.padding),s4&&void 0!==arguments[4]&&arguments[4],s=void 0;s=n===!0?{nodes:[],edges:[]}:this.getSelection(),s.pointer={DOM:{x:i.x,y:i.y},canvas:this.canvas.DOMtoCanvas(i)},s.event=e,void 0!==o&&(s.previousSelection=o),this.body.emitter.emit(t,s)}},{key:"selectObject",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.selectConnectedEdges;return void 0!==t&&(t instanceof h.default&&e===!0&&this._selectConnectedEdges(t),t.select(),this._addToSelection(t),!0)}},{key:"deselectObject",value:function(t){t.isSelected()===!0&&(t.selected=!1,this._removeFromSelection(t))}},{key:"_getAllNodesOverlappingWith",value:function(t){for(var e=[],i=this.body.nodes,o=0;o1&&void 0!==arguments[1])||arguments[1],i=this._pointerToPositionObject(t),o=this._getAllNodesOverlappingWith(i);return o.length>0?e===!0?this.body.nodes[o[o.length-1]]:o[o.length-1]:void 0}},{key:"_getEdgesOverlappingWith",value:function(t,e){for(var i=this.body.edges,o=0;o1&&void 0!==arguments[1])||arguments[1],i=this.canvas.DOMtoCanvas(t),o=10,n=null,s=this.body.edges,r=0;r1)return!0;return!1}},{key:"_selectConnectedEdges",value:function(t){for(var e=0;e1&&void 0!==arguments[1]?arguments[1]:{},i=void 0,o=void 0;if(!t||!t.nodes&&!t.edges)throw"Selection must be an object with nodes and/or edges properties";if((e.unselectAll||void 0===e.unselectAll)&&this.unselectAll(),t.nodes)for(i=0;i1&&void 0!==arguments[1])||arguments[1];if(!t||void 0===t.length)throw"Selection must be an array with ids";this.setSelection({nodes:t},{highlightEdges:e})}},{key:"selectEdges",value:function(t){if(!t||void 0===t.length)throw"Selection must be an array with ids";this.setSelection({edges:t})}},{key:"updateSelection",value:function(){for(var t in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(t)&&(this.body.nodes.hasOwnProperty(t)||delete this.selectionObj.nodes[t]);for(var e in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(e)&&(this.body.edges.hasOwnProperty(e)||delete this.selectionObj.edges[e])}}]),t}();e.default=f},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(58),s=o(n),r=i(104),a=o(r),d=i(62),h=o(d),l=i(95),u=o(l),c=i(96),f=o(c),p=i(154),v=o(p),g=i(1),y=function(){function t(e){(0,u.default)(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"}},g.extend(this.options,this.defaultOptions),this.bindEventListeners()}return(0,f.default)(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()})}},{key:"setOptions",value:function(t,e){if(void 0!==t){var i=this.options.hierarchical.enabled;if(g.selectiveDeepExtend(["randomSeed","improvedLayout"],this.options,t),g.mergeOptions(this.options,t,"hierarchical"),void 0!==t.randomSeed&&(this.initialRandomSeed=t.randomSeed),this.options.hierarchical.enabled===!0)return i===!0&&this.body.emitter.emit("refresh",!0),"RL"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?this.options.hierarchical.levelSeparation>0&&(this.options.hierarchical.levelSeparation*=-1):this.options.hierarchical.levelSeparation<0&&(this.options.hierarchical.levelSeparation*=-1),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(e);if(i===!0)return this.body.emitter.emit("refresh"),g.deepExtend(e,this.optionsBackup)}return e}},{key:"adaptAllOptionsForHierarchicalLayout",value:function(t){if(this.options.hierarchical.enabled===!0){void 0===t.physics||t.physics===!0?(t.physics={enabled:void 0===this.optionsBackup.physics.enabled||this.optionsBackup.physics.enabled,solver:"hierarchicalRepulsion"},this.optionsBackup.physics.enabled=void 0===this.optionsBackup.physics.enabled||this.optionsBackup.physics.enabled,this.optionsBackup.physics.solver=this.optionsBackup.physics.solver||"barnesHut"):"object"===(0,h.default)(t.physics)?(this.optionsBackup.physics.enabled=void 0===t.physics.enabled||t.physics.enabled,this.optionsBackup.physics.solver=t.physics.solver||"barnesHut",t.physics.solver="hierarchicalRepulsion"):t.physics!==!1&&(this.optionsBackup.physics.solver="barnesHut",t.physics={solver:"hierarchicalRepulsion"});var e="horizontal";"RL"!==this.options.hierarchical.direction&&"LR"!==this.options.hierarchical.direction||(e="vertical"),void 0===t.edges?(this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},t.edges={smooth:!1}):void 0===t.edges.smooth?(this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},t.edges.smooth=!1):"boolean"==typeof t.edges.smooth?(this.optionsBackup.edges={smooth:t.edges.smooth},t.edges.smooth={enabled:t.edges.smooth,type:e}):(void 0!==t.edges.smooth.type&&"dynamic"!==t.edges.smooth.type&&(e=t.edges.smooth.type),this.optionsBackup.edges={smooth:void 0===t.edges.smooth.enabled||t.edges.smooth.enabled,type:void 0===t.edges.smooth.type?"dynamic":t.edges.smooth.type,roundness:void 0===t.edges.smooth.roundness?.5:t.edges.smooth.roundness,forceDirection:void 0!==t.edges.smooth.forceDirection&&t.edges.smooth.forceDirection},t.edges.smooth={enabled:void 0===t.edges.smooth.enabled||t.edges.smooth.enabled,type:e,roundness:void 0===t.edges.smooth.roundness?.5:t.edges.smooth.roundness,forceDirection:void 0!==t.edges.smooth.forceDirection&&t.edges.smooth.forceDirection}),this.body.emitter.emit("_forceDisableDynamicCurves",e)}return t}},{key:"seededRandom",value:function(){var t=1e4*Math.sin(this.randomSeed++);return t-Math.floor(t)}},{key:"positionInitially",value:function(t){if(this.options.hierarchical.enabled!==!0){this.randomSeed=this.initialRandomSeed;for(var e=0;es){for(var r=this.body.nodeIndices.length;this.body.nodeIndices.length>s;){n+=1;var a=this.body.nodeIndices.length;n%3===0?this.body.modules.clustering.clusterBridges():this.body.modules.clustering.clusterOutliers();var d=this.body.nodeIndices.length;if(a==d&&n%3!==0||n>o)return this._declusterAll(),this.body.emitter.emit("_layoutFailed"),void console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.")}this.body.modules.kamadaKawai.setOptions({springLength:Math.max(150,2*r)})}this.body.modules.kamadaKawai.solve(this.body.nodeIndices,this.body.edgeIndices,!0),this._shiftToCenter();for(var h=70,l=0;l0){var t=void 0,e=void 0,i=!1,o=!0,n=!1;this.hierarchicalLevels={},this.lastNodeOnLevel={},this.hierarchicalChildrenReference={},this.hierarchicalParentReference={},this.hierarchicalTrees={},this.treeIndex=-1,this.distributionOrdering={},this.distributionIndex={},this.distributionOrderingPresence={};for(e in this.body.nodes)this.body.nodes.hasOwnProperty(e)&&(t=this.body.nodes[e],void 0===t.options.x&&void 0===t.options.y&&(o=!1),void 0!==t.options.level?(i=!0,this.hierarchicalLevels[e]=t.options.level):n=!0);if(n===!0&&i===!0)throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");n===!0&&("hubsize"===this.options.hierarchical.sortMethod?this._determineLevelsByHubsize():"directed"===this.options.hierarchical.sortMethod?this._determineLevelsDirected():"custom"===this.options.hierarchical.sortMethod&&this._determineLevelsCustomCallback()); +for(var s in this.body.nodes)this.body.nodes.hasOwnProperty(s)&&void 0===this.hierarchicalLevels[s]&&(this.hierarchicalLevels[s]=0);var r=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(r),this._condenseHierarchy(),this._shiftToCenter()}}},{key:"_condenseHierarchy",value:function(){var t=this,e=!1,i={},o=function(){for(var e=d(),i=0;i0)for(var s=0;s1&&void 0!==arguments[1]?arguments[1]:1e9,o=1e9,n=1e9,s=1e9,r=-1e9;for(var d in e)if(e.hasOwnProperty(d)){var h=t.body.nodes[d],l=t.hierarchicalLevels[h.id],u=t._getPositionForHierarchy(h),c=t._getSpaceAroundNode(h,e),f=(0,a.default)(c,2),p=f[0],v=f[1];o=Math.min(p,o),n=Math.min(v,n),l<=i&&(s=Math.min(u,s),r=Math.max(u,r))}return[s,r,o,n]},u=function e(i){var o=t.hierarchicalLevels[i];if(t.hierarchicalChildrenReference[i]){var n=t.hierarchicalChildrenReference[i];if(n.length>0)for(var s=0;s1)for(var a=0;a2&&void 0!==arguments[2]&&arguments[2],s=t._getPositionForHierarchy(i),r=t._getPositionForHierarchy(o),d=Math.abs(r-s);if(d>t.options.hierarchical.nodeSpacing){var u={};u[i.id]=!0;var f={};f[o.id]=!0,h(i,u),h(o,f);var p=c(i,o),v=l(u,p),g=(0,a.default)(v,4),y=(g[0],g[1]),m=(g[2],g[3],l(f,p)),b=(0,a.default)(m,4),_=b[0],w=(b[1],b[2]),k=(b[3],Math.abs(y-_));if(k>t.options.hierarchical.nodeSpacing){var x=y-_+t.options.hierarchical.nodeSpacing;x<-w+t.options.hierarchical.nodeSpacing&&(x=-w+t.options.hierarchical.nodeSpacing),x<0&&(t._shiftBlock(o.id,x),e=!0,n===!0&&t._centerParent(o))}}},g=function(o,n){for(var s=n.id,r=n.edges,d=t.hierarchicalLevels[n.id],u=t.options.hierarchical.levelSeparation*t.options.hierarchical.levelSeparation,c={},f=[],p=0;p0?v=Math.min(p,f-t.options.hierarchical.nodeSpacing):p<0&&(v=-Math.min(-p,c-t.options.hierarchical.nodeSpacing)),0!=v&&(t._shiftBlock(n.id,v),e=!0)},w=function(i){var o=t._getPositionForHierarchy(n),s=t._getSpaceAroundNode(n),r=(0,a.default)(s,2),d=r[0],h=r[1],l=i-o,u=o;l>0?u=Math.min(o+(h-t.options.hierarchical.nodeSpacing),i):l<0&&(u=Math.max(o-(d-t.options.hierarchical.nodeSpacing),i)),u!==o&&(t._setPositionForHierarchy(n,u,void 0,!0),e=!0)},k=b(o,f);_(k),k=b(o,r),w(k)},y=function(i){var o=(0,s.default)(t.distributionOrdering);o=o.reverse();for(var n=0;n0)for(var h=0;h0&&Math.abs(y)0&&(a=this._getPositionForHierarchy(i[n-1])+this.options.hierarchical.nodeSpacing),this._setPositionForHierarchy(r,a,e),this._validataPositionAndContinue(r,e,a),o++}}}}},{key:"_placeBranchNodes",value:function(t,e){if(void 0!==this.hierarchicalChildrenReference[t]){for(var i=[],o=0;oe&&void 0===this.positionedNodes[s.id]))return;var a=void 0;a=0===n?this._getPositionForHierarchy(this.body.nodes[t]):this._getPositionForHierarchy(i[n-1])+this.options.hierarchical.nodeSpacing,this._setPositionForHierarchy(s,a,r),this._validataPositionAndContinue(s,r,a)}for(var d=1e9,h=-1e9,l=0;l0&&(e=this._getHubSize(),0!==e);)for(var o in this.body.nodes)if(this.body.nodes.hasOwnProperty(o)){var n=this.body.nodes[o];n.edges.length===e&&this._crawlNetwork(i,o)}}},{key:"_determineLevelsCustomCallback",value:function(){var t=this,e=1e5,i=function(t,e,i){},o=function(o,n,s){var r=t.hierarchicalLevels[o.id];void 0===r&&(t.hierarchicalLevels[o.id]=e);var a=i(v.default.cloneOptions(o,"node"),v.default.cloneOptions(n,"node"),v.default.cloneOptions(s,"edge"));t.hierarchicalLevels[n.id]=t.hierarchicalLevels[o.id]+a};this._crawlNetwork(o),this._setMinLevelToZero()}},{key:"_determineLevelsDirected",value:function(){var t=this,e=1e4,i=function(i,o,n){var s=t.hierarchicalLevels[i.id];void 0===s&&(t.hierarchicalLevels[i.id]=e),n.toId==o.id?t.hierarchicalLevels[o.id]=t.hierarchicalLevels[i.id]+1:t.hierarchicalLevels[o.id]=t.hierarchicalLevels[i.id]-1};this._crawlNetwork(i),this._setMinLevelToZero()}},{key:"_setMinLevelToZero",value:function(){var t=1e9;for(var e in this.body.nodes)this.body.nodes.hasOwnProperty(e)&&void 0!==this.hierarchicalLevels[e]&&(t=Math.min(this.hierarchicalLevels[e],t));for(var i in this.body.nodes)this.body.nodes.hasOwnProperty(i)&&void 0!==this.hierarchicalLevels[i]&&(this.hierarchicalLevels[i]-=t)}},{key:"_generateMap",value:function(){var t=this,e=function(e,i){if(t.hierarchicalLevels[i.id]>t.hierarchicalLevels[e.id]){var o=e.id,n=i.id;void 0===t.hierarchicalChildrenReference[o]&&(t.hierarchicalChildrenReference[o]=[]),t.hierarchicalChildrenReference[o].push(n),void 0===t.hierarchicalParentReference[n]&&(t.hierarchicalParentReference[n]=[]),t.hierarchicalParentReference[n].push(o)}};this._crawlNetwork(e)}},{key:"_crawlNetwork",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},i=arguments[1],o={},n=0,s=function i(n,s){if(void 0===o[n.id]){void 0===t.hierarchicalTrees[n.id]&&(t.hierarchicalTrees[n.id]=s,t.treeIndex=Math.max(s,t.treeIndex)),o[n.id]=!0;for(var r=void 0,a=0;a3&&void 0!==arguments[3]&&arguments[3];o!==!0&&(void 0===this.distributionOrdering[i]&&(this.distributionOrdering[i]=[],this.distributionOrderingPresence[i]={}),void 0===this.distributionOrderingPresence[i][t.id]&&(this.distributionOrdering[i].push(t),this.distributionIndex[t.id]=this.distributionOrdering[i].length-1),this.distributionOrderingPresence[i][t.id]=!0),"UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?t.x=e:t.y=e}},{key:"_getPositionForHierarchy",value:function(t){return"UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?t.x:t.y}},{key:"_sortNodeArray",value:function(t){t.length>1&&("UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?t.sort(function(t,e){return t.x-e.x}):t.sort(function(t,e){return t.y-e.y}))}}]),t}();e.default=y},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(58),s=o(n),r=i(82),a=o(r),d=i(62),h=o(d),l=i(95),u=o(l),c=i(96),f=o(c),p=i(1),v=i(158),g=i(161),y=function(){function t(e,i,o){var n=this;(0,u.default)(this,t),this.body=e,this.canvas=i,this.selectionHandler=o,this.editMode=!1,this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0,this.manipulationHammers=[],this.temporaryUIFunctions={},this.temporaryEventFunctions=[],this.touchTime=0,this.temporaryIds={nodes:[],edges:[]},this.guiEnabled=!1,this.inMode=!1,this.selectedControlNode=void 0,this.options={},this.defaultOptions={enabled:!1,initiallyActive:!1,addNode:!0,addEdge:!0,editNode:void 0,editEdge:!0,deleteNode:!0,deleteEdge:!0,controlNodeStyle:{shape:"dot",size:6,color:{background:"#ff0000",border:"#3c3c3c",highlight:{background:"#07f968",border:"#3c3c3c"}},borderWidth:2,borderWidthSelected:2}},p.extend(this.options,this.defaultOptions),this.body.emitter.on("destroy",function(){n._clean()}),this.body.emitter.on("_dataChanged",this._restore.bind(this)),this.body.emitter.on("_resetData",this._restore.bind(this))}return(0,f.default)(t,[{key:"_restore",value:function(){this.inMode!==!1&&(this.options.initiallyActive===!0?this.enableEditMode():this.disableEditMode())}},{key:"setOptions",value:function(t,e,i){void 0!==e&&(void 0!==e.locale?this.options.locale=e.locale:this.options.locale=i.locale,void 0!==e.locales?this.options.locales=e.locales:this.options.locales=i.locales),void 0!==t&&("boolean"==typeof t?this.options.enabled=t:(this.options.enabled=!0,p.deepExtend(this.options,t)),this.options.initiallyActive===!0&&(this.editMode=!0),this._setup())}},{key:"toggleEditMode",value:function(){this.editMode===!0?this.disableEditMode():this.enableEditMode()}},{key:"enableEditMode",value:function(){this.editMode=!0,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="block",this.closeDiv.style.display="block",this.editModeDiv.style.display="none",this.showManipulatorToolbar())}},{key:"disableEditMode",value:function(){this.editMode=!1,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="none",this.closeDiv.style.display="none",this.editModeDiv.style.display="block",this._createEditButton())}},{key:"showManipulatorToolbar",value:function(){if(this._clean(),this.manipulationDOM={},this.guiEnabled===!0){this.editMode=!0,this.manipulationDiv.style.display="block",this.closeDiv.style.display="block";var t=this.selectionHandler._getSelectedNodeCount(),e=this.selectionHandler._getSelectedEdgeCount(),i=t+e,o=this.options.locales[this.options.locale],n=!1;this.options.addNode!==!1&&(this._createAddNodeButton(o),n=!0),this.options.addEdge!==!1&&(n===!0?this._createSeperator(1):n=!0,this._createAddEdgeButton(o)),1===t&&"function"==typeof this.options.editNode?(n===!0?this._createSeperator(2):n=!0,this._createEditNodeButton(o)):1===e&&0===t&&this.options.editEdge!==!1&&(n===!0?this._createSeperator(3):n=!0,this._createEditEdgeButton(o)),0!==i&&(t>0&&this.options.deleteNode!==!1?(n===!0&&this._createSeperator(4),this._createDeleteButton(o)):0===t&&this.options.deleteEdge!==!1&&(n===!0&&this._createSeperator(4),this._createDeleteButton(o))),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this)),this._temporaryBindEvent("select",this.showManipulatorToolbar.bind(this))}this.body.emitter.emit("_redraw")}},{key:"addNodeMode",value:function(){if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addNode",this.guiEnabled===!0){var t=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(t),this._createSeperator(),this._createDescription(t.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;this.editMode!==!0&&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(e.isCluster!==!0){var i=p.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&&void 0!==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(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addEdge",this.guiEnabled===!0){var t=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(t),this._createSeperator(),this._createDescription(t.edgeDescription||this.options.locales.en.edgeDescription),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this))}this._temporaryBindUI("onTouch",this._handleConnect.bind(this)),this._temporaryBindUI("onDragEnd",this._finishConnect.bind(this)),this._temporaryBindUI("onDrag",this._dragControlNode.bind(this)),this._temporaryBindUI("onRelease",this._finishConnect.bind(this)),this._temporaryBindUI("onDragStart",function(){}),this._temporaryBindUI("onHold",function(){})}},{key:"editEdgeMode",value:function(){var t=this;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="editEdge","object"===(0,h.default)(this.options.editEdge)&&"function"==typeof this.options.editEdge.editWithoutDrag&&(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdges()[0],void 0!==this.edgeBeingEditedId)){var e=this.body.edges[this.edgeBeingEditedId];return void this._performEditEdge(e.from,e.to)}if(this.guiEnabled===!0){var i=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(i),this._createSeperator(),this._createDescription(i.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this))}this.edgeBeingEditedId=this.selectionHandler.getSelectedEdges()[0],void 0!==this.edgeBeingEditedId?!function(){var e=t.body.edges[t.edgeBeingEditedId],i=t._getNewTargetNode(e.from.x,e.from.y),o=t._getNewTargetNode(e.to.x,e.to.y);t.temporaryIds.nodes.push(i.id),t.temporaryIds.nodes.push(o.id),t.body.nodes[i.id]=i,t.body.nodeIndices.push(i.id),t.body.nodes[o.id]=o,t.body.nodeIndices.push(o.id),t._temporaryBindUI("onTouch",t._controlNodeTouch.bind(t)),t._temporaryBindUI("onTap",function(){}),t._temporaryBindUI("onHold",function(){}),t._temporaryBindUI("onDragStart",t._controlNodeDragStart.bind(t)),t._temporaryBindUI("onDrag",t._controlNodeDrag.bind(t)),t._temporaryBindUI("onDragEnd",t._controlNodeDragEnd.bind(t)),t._temporaryBindUI("onMouseMove",function(){}),t._temporaryBindEvent("beforeDrawing",function(t){var n=e.edgeType.findBorderPositions(t);i.selected===!1&&(i.x=n.from.x,i.y=n.from.y),o.selected===!1&&(o.x=n.to.x,o.y=n.to.y)}),t.body.emitter.emit("_redraw")}():this.showManipulatorToolbar()}},{key:"deleteSelected",value:function(){var t=this;this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="delete";var e=this.selectionHandler.getSelectedNodes(),i=this.selectionHandler.getSelectedEdges(),o=void 0;if(e.length>0){for(var n=0;n0&&"function"==typeof this.options.deleteEdge&&(o=this.options.deleteEdge);if("function"==typeof o){var s={nodes:e,edges:i};if(2!==o.length)throw new Error("The function for delete does not support two arguments (data, callback)");o(s,function(e){null!==e&&void 0!==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()):(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(){this.options.enabled===!0?(this.guiEnabled=!0,this._createWrappers(),this.editMode===!1?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}},{key:"_createWrappers",value:function(){void 0===this.manipulationDiv&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",this.editMode===!0?this.manipulationDiv.style.display="block":this.manipulationDiv.style.display="none",this.canvas.frame.appendChild(this.manipulationDiv)),void 0===this.editModeDiv&&(this.editModeDiv=document.createElement("div"),this.editModeDiv.className="vis-edit-mode",this.editMode===!0?this.editModeDiv.style.display="none":this.editModeDiv.style.display="block",this.canvas.frame.appendChild(this.editModeDiv)),void 0===this.closeDiv&&(this.closeDiv=document.createElement("div"),this.closeDiv.className="vis-close",this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv))}},{key:"_getNewTargetNode",value:function(t,e){var i=p.deepExtend({},this.options.controlNodeStyle);i.id="targetNode"+p.randomUUID(),i.hidden=!1,i.physics=!1,i.x=t,i.y=e;var o=this.body.functions.createNode(i);return o.shape.boundingBox={left:t,right:t,top:e,bottom:e},o}},{key:"_createEditButton",value:function(){this._clean(),this.manipulationDOM={},p.recursiveDOMDelete(this.editModeDiv);var t=this.options.locales[this.options.locale],e=this._createButton("editMode","vis-button vis-edit vis-edit-mode",t.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(e),this._bindHammerToDiv(e,this.toggleEditMode.bind(this))}},{key:"_clean",value:function(){this.inMode=!1,this.guiEnabled===!0&&(p.recursiveDOMDelete(this.editModeDiv),p.recursiveDOMDelete(this.manipulationDiv),this._cleanManipulatorHammers()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}},{key:"_cleanManipulatorHammers",value:function(){if(0!=this.manipulationHammers.length){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]: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(t){var e=this._createButton("addNode","vis-button vis-add",t.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(e),this._bindHammerToDiv(e,this.addNodeMode.bind(this))}},{key:"_createAddEdgeButton",value:function(t){var e=this._createButton("addEdge","vis-button vis-connect",t.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(e),this._bindHammerToDiv(e,this.addEdgeMode.bind(this))}},{key:"_createEditNodeButton",value:function(t){var e=this._createButton("editNode","vis-button vis-edit",t.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(e),this._bindHammerToDiv(e,this.editNode.bind(this))}},{key:"_createEditEdgeButton",value:function(t){var e=this._createButton("editEdge","vis-button vis-edit",t.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(e),this._bindHammerToDiv(e,this.editEdgeMode.bind(this))}},{key:"_createDeleteButton",value:function(t){if(this.options.rtl)var e="vis-button vis-delete-rtl";else var e="vis-button vis-delete";var i=this._createButton("delete",e,t.del||this.options.locales.en.del);this.manipulationDiv.appendChild(i),this._bindHammerToDiv(i,this.deleteSelected.bind(this))}},{key:"_createBackButton",value:function(t){var e=this._createButton("back","vis-button vis-back",t.back||this.options.locales.en.back);this.manipulationDiv.appendChild(e),this._bindHammerToDiv(e,this.showManipulatorToolbar.bind(this))}},{key:"_createButton",value:function(t,e,i){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"vis-label";return this.manipulationDOM[t+"Div"]=document.createElement("div"),this.manipulationDOM[t+"Div"].className=e,this.manipulationDOM[t+"Label"]=document.createElement("div"),this.manipulationDOM[t+"Label"].className=o,this.manipulationDOM[t+"Label"].innerHTML=i,this.manipulationDOM[t+"Div"].appendChild(this.manipulationDOM[t+"Label"]),this.manipulationDOM[t+"Div"]}},{key:"_createDescription",value:function(t){this.manipulationDiv.appendChild(this._createButton("description","vis-button vis-none",t))}},{key:"_temporaryBindEvent",value:function(t,e){this.temporaryEventFunctions.push({event:t,boundFunction:e}),this.body.emitter.on(t,e)}},{key:"_temporaryBindUI",value:function(t,e){if(void 0===this.body.eventListeners[t])throw new Error("This UI function does not exist. Typo? You tried: "+t+" possible are: "+(0,a.default)((0,s.default)(this.body.eventListeners)));this.temporaryUIFunctions[t]=this.body.eventListeners[t],this.body.eventListeners[t]=e}},{key:"_unbindTemporaryUIs",value:function(){for(var t in this.temporaryUIFunctions)this.temporaryUIFunctions.hasOwnProperty(t)&&(this.body.eventListeners[t]=this.temporaryUIFunctions[t],delete this.temporaryUIFunctions[t]);this.temporaryUIFunctions={}}},{key:"_unbindTemporaryEvents",value:function(){for(var t=0;t=0;r--)if(n[r]!==this.selectedControlNode.id){s=this.body.nodes[n[r]];break}if(void 0!==s&&void 0!==this.selectedControlNode)if(s.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var a=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===a.id?this._performEditEdge(s.id,o.to.id):this._performEditEdge(o.from.id,s.id)}else o.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}}},{key:"_handleConnect",value:function(t){if((new Date).valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(t.center),this.lastTouch.translation=p.extend({},this.body.view.translation);var e=this.lastTouch,i=this.selectionHandler.getNodeAt(e);if(void 0!==i)if(i.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var o=this._getNewTargetNode(i.x,i.y);this.body.nodes[o.id]=o,this.body.nodeIndices.push(o.id);var n=this.body.functions.createEdge({id:"connectionEdge"+p.randomUUID(),from:i.id,to:o.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[n.id]=n,this.body.edgeIndices.push(n.id),this.temporaryIds.nodes.push(o.id),this.temporaryIds.edges.push(n.id)}this.touchTime=(new Date).valueOf()}}},{key:"_dragControlNode",value:function(t){var e=this.body.functions.getPointer(t.center);if(void 0!==this.temporaryIds.nodes[0]){var i=this.body.nodes[this.temporaryIds.nodes[0]];i.x=this.canvas._XconvertDOMtoCanvas(e.x),i.y=this.canvas._YconvertDOMtoCanvas(e.y),this.body.emitter.emit("_redraw")}else{var o=e.x-this.lastTouch.x,n=e.y-this.lastTouch.y;this.body.view.translation={x:this.lastTouch.translation.x+o, +y:this.lastTouch.translation.y+n}}}},{key:"_finishConnect",value:function(t){var e=this.body.functions.getPointer(t.center),i=this.selectionHandler._pointerToPositionObject(e),o=void 0;void 0!==this.temporaryIds.edges[0]&&(o=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var n=this.selectionHandler._getAllNodesOverlappingWith(i),s=void 0,r=n.length-1;r>=0;r--)if(this.temporaryIds.nodes.indexOf(n[r])===-1){s=this.body.nodes[n[r]];break}this._cleanupTemporaryNodesAndEdges(),void 0!==s&&(s.isCluster===!0?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):void 0!==this.body.nodes[o]&&void 0!==this.body.nodes[s.id]&&this._performAddEdge(o,s.id)),this.body.emitter.emit("_redraw")}},{key:"_performAddNode",value:function(t){var e=this,i={id:p.randomUUID(),x:t.pointer.canvas.x,y:t.pointer.canvas.y,label:"new"};if("function"==typeof this.options.addNode){if(2!==this.options.addNode.length)throw new Error("The function for add does not support two arguments (data,callback)");this.options.addNode(i,function(t){null!==t&&void 0!==t&&"addNode"===e.inMode&&(e.body.data.nodes.getDataSet().add(t),e.showManipulatorToolbar())})}else this.body.data.nodes.getDataSet().add(i),this.showManipulatorToolbar()}},{key:"_performAddEdge",value:function(t,e){var i=this,o={from:t,to:e};if("function"==typeof this.options.addEdge){if(2!==this.options.addEdge.length)throw new Error("The function for connect does not support two arguments (data,callback)");this.options.addEdge(o,function(t){null!==t&&void 0!==t&&"addEdge"===i.inMode&&(i.body.data.edges.getDataSet().add(t),i.selectionHandler.unselectAll(),i.showManipulatorToolbar())})}else this.body.data.edges.getDataSet().add(o),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}},{key:"_performEditEdge",value:function(t,e){var i=this,o={id:this.edgeBeingEditedId,from:t,to:e,label:this.body.data.edges._data[this.edgeBeingEditedId].label},n=this.options.editEdge;if("object"===("undefined"==typeof n?"undefined":(0,h.default)(n))&&(n=n.editWithoutDrag),"function"==typeof n){if(2!==n.length)throw new Error("The function for edit does not support two arguments (data, callback)");n(o,function(t){null===t||void 0===t||"editEdge"!==i.inMode?(i.body.edges[o.id].updateEdgeType(),i.body.emitter.emit("_redraw"),i.showManipulatorToolbar()):(i.body.data.edges.getDataSet().update(t),i.selectionHandler.unselectAll(),i.showManipulatorToolbar())})}else this.body.data.edges.getDataSet().update(o),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}]),t}();e.default=y},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(82),s=o(n),r=i(62),a=o(r),d=i(95),h=o(d),l=i(96),u=o(l),c=i(171),f=o(c),p=i(1),v=function(){function t(e,i,o){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;(0,h.default)(this,t),this.parent=e,this.changedOptions=[],this.container=i,this.allowCreation=!1,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},p.extend(this.options,this.defaultOptions),this.configureOptions=o,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new f.default(n),this.wrapper=void 0}return(0,u.default)(t,[{key:"setOptions",value:function(t){if(void 0!==t){this.popupHistory={},this._removePopup();var e=!0;"string"==typeof t?this.options.filter=t:t instanceof Array?this.options.filter=t.join():"object"===("undefined"==typeof t?"undefined":(0,a.default)(t))?(void 0!==t.container&&(this.options.container=t.container),void 0!==t.filter&&(this.options.filter=t.filter),void 0!==t.showButton&&(this.options.showButton=t.showButton),void 0!==t.enabled&&(e=t.enabled)):"boolean"==typeof t?(this.options.filter=!0,e=t):"function"==typeof t&&(this.options.filter=t,e=!0),this.options.filter===!1&&(e=!1),this.options.enabled=e}this._clean()}},{key:"setModuleOptions",value:function(t){this.moduleOptions=t,this.options.enabled===!0&&(this._clean(),void 0!==this.options.container&&(this.container=this.options.container),this._create())}},{key:"_create",value:function(){var t=this;this._clean(),this.changedOptions=[];var e=this.options.filter,i=0,o=!1;for(var n in this.configureOptions)this.configureOptions.hasOwnProperty(n)&&(this.allowCreation=!1,o=!1,"function"==typeof e?(o=e(n,[]),o=o||this._handleObject(this.configureOptions[n],[n],!0)):e!==!0&&e.indexOf(n)===-1||(o=!0),o!==!1&&(this.allowCreation=!0,i>0&&this._makeItem([]),this._makeHeader(n),this._handleObject(this.configureOptions[n],[n])),i++);this.options.showButton===!0&&!function(){var e=document.createElement("div");e.className="vis-configuration vis-config-button",e.innerHTML="generate options",e.onclick=function(){t._printOptions()},e.onmouseover=function(){e.className="vis-configuration vis-config-button hover"},e.onmouseout=function(){e.className="vis-configuration vis-config-button"},t.optionsContainer=document.createElement("div"),t.optionsContainer.className="vis-configuration vis-config-option-container",t.domElements.push(t.optionsContainer),t.domElements.push(e)}(),this._push()}},{key:"_push",value:function(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(var t=0;t1?o-1:0),s=1;s2&&void 0!==arguments[2]&&arguments[2],o=document.createElement("div");return o.className="vis-configuration vis-config-label vis-config-s"+e.length,i===!0?o.innerHTML=""+t+":":o.innerHTML=t+":",o}},{key:"_makeDropdown",value:function(t,e,i){var o=document.createElement("select");o.className="vis-configuration vis-config-select";var n=0;void 0!==e&&t.indexOf(e)!==-1&&(n=t.indexOf(e));for(var s=0;ss&&1!==s&&(a.max=Math.ceil(e*l),h=a.max,d="range increased"),a.value=e}else a.value=o;var u=document.createElement("input");u.className="vis-configuration vis-config-rangeinput",u.value=a.value;var c=this;a.onchange=function(){u.value=this.value,c._update(Number(this.value),i)},a.oninput=function(){u.value=this.value};var f=this._makeLabel(i[i.length-1],i),p=this._makeItem(i,f,a,u);""!==d&&this.popupHistory[p]!==h&&(this.popupHistory[p]=h,this._setupPopup(d,p))}},{key:"_setupPopup",value:function(t,e){var i=this;if(this.initialized===!0&&this.allowCreation===!0&&this.popupCounter1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=!1,n=this.options.filter,s=!1;for(var r in t)if(t.hasOwnProperty(r)){o=!0;var a=t[r],d=p.copyAndExtendArray(e,r);if("function"==typeof n&&(o=n(r,e),o===!1&&!(a instanceof Array)&&"string"!=typeof a&&"boolean"!=typeof a&&a instanceof Object&&(this.allowCreation=!1,o=this._handleObject(a,d,!0),this.allowCreation=i===!1)),o!==!1){s=!0;var h=this._getValue(d);if(a instanceof Array)this._handleArray(a,h,d);else if("string"==typeof a)this._makeTextInput(a,h,d);else if("boolean"==typeof a)this._makeCheckbox(a,h,d);else if(a instanceof Object){var l=!0;if(e.indexOf("physics")!==-1&&this.moduleOptions.physics.solver!==r&&(l=!1),l===!0)if(void 0!==a.enabled){var u=p.copyAndExtendArray(d,"enabled"),c=this._getValue(u);if(c===!0){var f=this._makeLabel(r,d,!0);this._makeItem(d,f),s=this._handleObject(a,d)||s}else this._makeCheckbox(a,c,d)}else{var v=this._makeLabel(r,d,!0);this._makeItem(d,v),s=this._handleObject(a,d)||s}}else console.error("dont know how to handle",a,r,d)}}return s}},{key:"_handleArray",value:function(t,e,i){"string"==typeof t[0]&&"color"===t[0]?(this._makeColorField(t,e,i),t[1]!==e&&this.changedOptions.push({path:i,value:e})):"string"==typeof t[0]?(this._makeDropdown(t,e,i),t[0]!==e&&this.changedOptions.push({path:i,value:e})):"number"==typeof t[0]&&(this._makeRange(t,e,i),t[0]!==e&&this.changedOptions.push({path:i,value:Number(e)}))}},{key:"_update",value:function(t,e){var i=this._constructOptions(t,e);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(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=i;t="true"===t||t,t="false"!==t&&t;for(var n=0;nvar options = "+(0,s.default)(t,null,2)+""}},{key:"getOptions",value:function(){for(var t={},e=0;e0&&void 0!==arguments[0]?arguments[0]:1;(0,a.default)(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(0,h.default)(t,[{key:"insertTo",value:function(t){void 0!==this.hammer&&(this.hammer.destroy(),this.hammer=void 0),this.container=t,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}},{key:"setUpdateCallback",value:function(t){if("function"!=typeof t)throw new Error("Function attempted to set as colorPicker update callback is not a function.");this.updateCallback=t}},{key:"setCloseCallback",value:function(t){if("function"!=typeof t)throw new Error("Function attempted to set as colorPicker closing callback is not a function.");this.closeCallback=t}},{key:"_isColorString",value:function(t){var e={black:"#000000",navy:"#000080",darkblue:"#00008B",mediumblue:"#0000CD",blue:"#0000FF",darkgreen:"#006400",green:"#008000",teal:"#008080",darkcyan:"#008B8B",deepskyblue:"#00BFFF",darkturquoise:"#00CED1",mediumspringgreen:"#00FA9A",lime:"#00FF00",springgreen:"#00FF7F",aqua:"#00FFFF",cyan:"#00FFFF",midnightblue:"#191970",dodgerblue:"#1E90FF",lightseagreen:"#20B2AA",forestgreen:"#228B22",seagreen:"#2E8B57",darkslategray:"#2F4F4F",limegreen:"#32CD32",mediumseagreen:"#3CB371",turquoise:"#40E0D0",royalblue:"#4169E1",steelblue:"#4682B4",darkslateblue:"#483D8B",mediumturquoise:"#48D1CC",indigo:"#4B0082",darkolivegreen:"#556B2F",cadetblue:"#5F9EA0",cornflowerblue:"#6495ED",mediumaquamarine:"#66CDAA",dimgray:"#696969",slateblue:"#6A5ACD",olivedrab:"#6B8E23",slategray:"#708090",lightslategray:"#778899",mediumslateblue:"#7B68EE",lawngreen:"#7CFC00",chartreuse:"#7FFF00",aquamarine:"#7FFFD4",maroon:"#800000",purple:"#800080",olive:"#808000",gray:"#808080",skyblue:"#87CEEB",lightskyblue:"#87CEFA",blueviolet:"#8A2BE2",darkred:"#8B0000",darkmagenta:"#8B008B",saddlebrown:"#8B4513",darkseagreen:"#8FBC8F",lightgreen:"#90EE90",mediumpurple:"#9370D8",darkviolet:"#9400D3",palegreen:"#98FB98",darkorchid:"#9932CC",yellowgreen:"#9ACD32",sienna:"#A0522D",brown:"#A52A2A",darkgray:"#A9A9A9",lightblue:"#ADD8E6",greenyellow:"#ADFF2F",paleturquoise:"#AFEEEE",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",firebrick:"#B22222",darkgoldenrod:"#B8860B",mediumorchid:"#BA55D3",rosybrown:"#BC8F8F",darkkhaki:"#BDB76B",silver:"#C0C0C0",mediumvioletred:"#C71585",indianred:"#CD5C5C",peru:"#CD853F",chocolate:"#D2691E",tan:"#D2B48C",lightgrey:"#D3D3D3",palevioletred:"#D87093",thistle:"#D8BFD8",orchid:"#DA70D6",goldenrod:"#DAA520",crimson:"#DC143C",gainsboro:"#DCDCDC",plum:"#DDA0DD",burlywood:"#DEB887",lightcyan:"#E0FFFF",lavender:"#E6E6FA",darksalmon:"#E9967A",violet:"#EE82EE",palegoldenrod:"#EEE8AA",lightcoral:"#F08080",khaki:"#F0E68C",aliceblue:"#F0F8FF",honeydew:"#F0FFF0",azure:"#F0FFFF",sandybrown:"#F4A460",wheat:"#F5DEB3",beige:"#F5F5DC",whitesmoke:"#F5F5F5",mintcream:"#F5FFFA",ghostwhite:"#F8F8FF",salmon:"#FA8072",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lightgoldenrodyellow:"#FAFAD2",oldlace:"#FDF5E6",red:"#FF0000",fuchsia:"#FF00FF",magenta:"#FF00FF",deeppink:"#FF1493",orangered:"#FF4500",tomato:"#FF6347",hotpink:"#FF69B4",coral:"#FF7F50",darkorange:"#FF8C00",lightsalmon:"#FFA07A",orange:"#FFA500",lightpink:"#FFB6C1",pink:"#FFC0CB",gold:"#FFD700",peachpuff:"#FFDAB9",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",mistyrose:"#FFE4E1",blanchedalmond:"#FFEBCD",papayawhip:"#FFEFD5",lavenderblush:"#FFF0F5",seashell:"#FFF5EE",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",floralwhite:"#FFFAF0",snow:"#FFFAFA",yellow:"#FFFF00",lightyellow:"#FFFFE0",ivory:"#FFFFF0",white:"#FFFFFF"};if("string"==typeof t)return e[t]}},{key:"setColor",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("none"!==t){var i=void 0,o=this._isColorString(t);if(void 0!==o&&(t=o),c.isString(t)===!0){if(c.isValidRGB(t)===!0){var n=t.substr(4).substr(0,t.length-5).split(",");i={r:n[0],g:n[1],b:n[2],a:1}}else if(c.isValidRGBA(t)===!0){var r=t.substr(5).substr(0,t.length-6).split(",");i={r:r[0],g:r[1],b:r[2],a:r[3]}}else if(c.isValidHex(t)===!0){var a=c.hexToRGB(t);i={r:a.r,g:a.g,b:a.b,a:1}}}else if(t instanceof Object&&void 0!==t.r&&void 0!==t.g&&void 0!==t.b){var d=void 0!==t.a?t.a:"1.0";i={r:t.r,g:t.g,b:t.b,a:d}}if(void 0===i)throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: "+(0,s.default)(t));this._setColor(i,e)}}},{key:"show",value:function(){void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}},{key:"_hide",value:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e===!0&&(this.previousColor=c.extend({},this.color)),this.applied===!0&&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(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e===!0&&(this.initialColor=c.extend({},t)),this.color=t;var i=c.RGBToHSV(t.r,t.g,t.b),o=2*Math.PI,n=this.r*i.s,s=this.centerCoordinates.x+n*Math.sin(o*i.h),r=this.centerCoordinates.y+n*Math.cos(o*i.h);this.colorPickerSelector.style.left=s-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=r-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(t)}},{key:"_setOpacity",value:function(t){this.color.a=t/100,this._updatePicker(this.color)}},{key:"_setBrightness",value:function(t){var e=c.RGBToHSV(this.color.r,this.color.g,this.color.b);e.v=t/100;var i=c.HSVToRGB(e.h,e.s,e.v);i.a=this.color.a,this.color=i,this._updatePicker()}},{key:"_updatePicker",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color,e=c.RGBToHSV(t.r,t.g,t.b),i=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1)),i.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var o=this.colorPickerCanvas.clientWidth,n=this.colorPickerCanvas.clientHeight;i.clearRect(0,0,o,n),i.putImageData(this.hueCircle,0,0),i.fillStyle="rgba(0,0,0,"+(1-e.v)+")",i.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),i.fill(),this.brightnessRange.value=100*e.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 t=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}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.colorPickerCanvas.appendChild(e)}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(t){}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(t){}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 l(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),u.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(this.generated===!1){var t=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)),t.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var e=this.colorPickerCanvas.clientWidth,i=this.colorPickerCanvas.clientHeight;t.clearRect(0,0,e,i);var o=void 0,n=void 0,s=void 0,r=void 0;this.centerCoordinates={x:.5*e,y:.5*i},this.r=.49*e;var a=2*Math.PI/360,d=1/360,h=1/this.r,l=void 0;for(s=0;s<360;s++)for(r=0;r2&&void 0!==arguments[2]&&arguments[2],o=this.distanceSolver.getDistances(this.body,t,e);this._createL_matrix(o),this._createK_matrix(o);for(var n=.01,r=1,a=0,d=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),h=5,l=1e9,u=0,c=0,f=0,p=0,v=0;l>n&&ar&&v=.1;)f=n[l++%s],f>h&&(f=h),c=Math.sqrt(f*f/(1+d*d)),c=r<0?-c:c,t+=c,e+=d*c,u===!0?this.lineTo(t,e):this.moveTo(t,e),h-=f,u=!u})},function(t,e){function i(t){if(t)return o(t)}function o(t){for(var e in i.prototype)t[e]=i.prototype[e];return t}t.exports=i,i.prototype.on=i.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks[t]=this._callbacks[t]||[]).push(e),this},i.prototype.once=function(t,e){function i(){o.off(t,i),e.apply(this,arguments)}var o=this;return this._callbacks=this._callbacks||{},i.fn=e,this.on(t,i),this},i.prototype.off=i.prototype.removeListener=i.prototype.removeAllListeners=i.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var i=this._callbacks[t];if(!i)return this;if(1==arguments.length)return delete this._callbacks[t],this;for(var o,n=0;n=0;i--){var a=s[i];a.nodes||(a.nodes=[]),a.nodes.indexOf(n)===-1&&a.nodes.push(n)}e.attr&&(n.attr=h(n.attr,e.attr))}function c(t,e){if(t.edges||(t.edges=[]),t.edges.push(e),t.edge){var i=h({},t.edge);e.attr=h(i,e.attr)}}function f(t,e,i,o,n){var s={from:e,to:i,type:o};return t.edge&&(s.attr=h({},t.edge)),s.attr=h(s.attr||{},n),s}function p(){for(j=F.NULL,A="";" "===R||"\t"===R||"\n"===R||"\r"===R;)r();do{var t=!1;if("#"===R){for(var e=N-1;" "===z.charAt(e)||"\t"===z.charAt(e);)e--;if("\n"===z.charAt(e)||""===z.charAt(e)){for(;""!=R&&"\n"!=R;)r();t=!0}}if("/"===R&&"/"===a()){for(;""!=R&&"\n"!=R;)r();t=!0}if("/"===R&&"*"===a()){for(;""!=R;){if("*"===R&&"/"===a()){r(),r();break}r()}t=!0}for(;" "===R||"\t"===R||"\n"===R||"\r"===R;)r()}while(t);if(""===R)return void(j=F.DELIMITER);var i=R+a();if(I[i])return j=F.DELIMITER,A=i,r(),void r();if(I[R])return j=F.DELIMITER,A=R,void r();if(d(R)||"-"===R){for(A+=R,r();d(R);)A+=R,r();return"false"===A?A=!1:"true"===A?A=!0:isNaN(Number(A))||(A=Number(A)),void(j=F.IDENTIFIER)}if('"'===R){for(r();""!=R&&('"'!=R||'"'===R&&'"'===a());)A+=R,'"'===R&&r(),r();if('"'!=R)throw x('End of string " expected');return r(),void(j=F.IDENTIFIER)}for(j=F.UNKNOWN;""!=R;)A+=R,r();throw new SyntaxError('Syntax error in part "'+O(A,30)+'"')}function v(){var t={};if(s(),p(),"strict"===A&&(t.strict=!0,p()),"graph"!==A&&"digraph"!==A||(t.type=A,p()),j===F.IDENTIFIER&&(t.id=A,p()),"{"!=A)throw x("Angle bracket { expected");if(p(),g(t),"}"!=A)throw x("Angle bracket } expected");if(p(),""!==A)throw x("End of file expected");return p(),delete t.node,delete t.edge,delete t.graph,t}function g(t){for(;""!==A&&"}"!=A;)y(t),";"===A&&p()}function y(t){var e=m(t);if(e)return void w(t,e);var i=b(t);if(!i){if(j!=F.IDENTIFIER)throw x("Identifier expected");var o=A;if(p(),"="===A){if(p(),j!=F.IDENTIFIER)throw x("Identifier expected");t[o]=A,p()}else _(t,o)}}function m(t){var e=null;if("subgraph"===A&&(e={},e.type="subgraph",p(),j===F.IDENTIFIER&&(e.id=A,p())),"{"===A){if(p(),e||(e={}),e.parent=t,e.node=t.node,e.edge=t.edge,e.graph=t.graph,g(e),"}"!=A)throw x("Angle bracket } expected");p(),delete e.node,delete e.edge,delete e.graph,delete e.parent,t.subgraphs||(t.subgraphs=[]),t.subgraphs.push(e)}return e}function b(t){return"node"===A?(p(),t.node=k(),"node"):"edge"===A?(p(),t.edge=k(),"edge"):"graph"===A?(p(),t.graph=k(),"graph"):null}function _(t,e){var i={id:e},o=k();o&&(i.attr=o),u(t,i),w(t,e)}function w(t,e){for(;"->"===A||"--"===A;){var i,o=A;p();var n=m(t);if(n)i=n;else{if(j!=F.IDENTIFIER)throw x("Identifier or subgraph expected");i=A,u(t,{id:i}),p()}var s=k(),r=f(t,e,i,o,s);c(t,r),e=i}}function k(){for(var t=null;"["===A;){for(p(),t={};""!==A&&"]"!=A;){if(j!=F.IDENTIFIER)throw x("Attribute name expected");var e=A;if(p(),"="!=A)throw x("Equal sign = expected");if(p(),j!=F.IDENTIFIER)throw x("Attribute value expected");var i=A;l(t,e,i),p(),","==A&&p()}if("]"!=A)throw x("Bracket ] expected");p()}return t}function x(t){return new SyntaxError(t+', got "'+O(A,30)+'" (char '+N+")")}function O(t,e){return t.length<=e?t:t.substr(0,27)+"..."}function M(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)}function S(t,e,i){for(var o=e.split("."),n=o.pop(),s=t,r=0;r":!0,"--":!0},z="",N=0,R="",A="",j=F.NULL,H=/[a-zA-Z_0-9.:#]/;e.parseDOT=n,e.DOTToGraph=D},function(t,e){function i(t,e){var i=[],o=[],n={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};void 0!==e&&(void 0!==e.fixed&&(n.nodes.fixed=e.fixed),void 0!==e.parseColor&&(n.nodes.parseColor=e.parseColor),void 0!==e.inheritColor&&(n.edges.inheritColor=e.inheritColor));for(var s=t.edges,r=t.nodes,a=0;a.vis-content{position:relative}.vis-panel .vis-shadow{position:absolute;width:100%;height:1px;box-shadow:0 0 10px rgba(0,0,0,.8)}.vis-panel .vis-shadow.vis-top{top:-1px;left:0}.vis-panel .vis-shadow.vis-bottom{bottom:-1px;left:0}.vis-graph-group0{fill:#4f81bd;fill-opacity:0;stroke-width:2px;stroke:#4f81bd}.vis-graph-group1{fill:#f79646;fill-opacity:0;stroke-width:2px;stroke:#f79646}.vis-graph-group2{fill:#8c51cf;fill-opacity:0;stroke-width:2px;stroke:#8c51cf}.vis-graph-group3{fill:#75c841;fill-opacity:0;stroke-width:2px;stroke:#75c841}.vis-graph-group4{fill:#ff0100;fill-opacity:0;stroke-width:2px;stroke:#ff0100}.vis-graph-group5{fill:#37d8e6;fill-opacity:0;stroke-width:2px;stroke:#37d8e6}.vis-graph-group6{fill:#042662;fill-opacity:0;stroke-width:2px;stroke:#042662}.vis-graph-group7{fill:#00ff26;fill-opacity:0;stroke-width:2px;stroke:#00ff26}.vis-graph-group8{fill:#f0f;fill-opacity:0;stroke-width:2px;stroke:#f0f}.vis-graph-group9{fill:#8f3938;fill-opacity:0;stroke-width:2px;stroke:#8f3938}.vis-timeline .vis-fill{fill-opacity:.1;stroke:none}.vis-timeline .vis-bar{fill-opacity:.5;stroke-width:1px}.vis-timeline .vis-point{stroke-width:2px;fill-opacity:1}.vis-timeline .vis-legend-background{stroke-width:1px;fill-opacity:.9;fill:#fff;stroke:#c2c2c2}.vis-timeline .vis-outline{stroke-width:1px;fill-opacity:1;fill:#fff;stroke:#e5e5e5}.vis-timeline .vis-icon-fill{fill-opacity:.3;stroke:none}.vis-time-axis{position:relative}.vis-time-axis.vis-foreground{top:0;left:0;width:100%}.vis-time-axis.vis-background{position:absolute;top:0;left:0;width:100%;height:100%}.vis-time-axis .vis-text{position:absolute;color:#4d4d4d;padding:3px;overflow:hidden;box-sizing:border-box;white-space:nowrap}.vis-time-axis .vis-text.vis-measure{position:absolute;padding-left:0;padding-right:0;margin-left:0;margin-right:0;visibility:hidden}.vis-time-axis .vis-grid.vis-vertical{position:absolute;border-left:1px solid}.vis-time-axis .vis-grid.vis-vertical-rtl{position:absolute;border-right:1px solid}.vis-time-axis .vis-grid.vis-minor{border-color:#e5e5e5}.vis-time-axis .vis-grid.vis-major{border-color:#bfbfbf}.vis-timeline{position:relative;border:1px solid #bfbfbf;padding:0;margin:0;box-sizing:border-box} \ No newline at end of file +.vis .overlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:10}.vis-active{box-shadow:0 0 10px #86d5f8}.vis [class*=span]{min-height:0;width:auto}div.vis-configuration{position:relative;display:block;float:left;font-size:12px}div.vis-configuration-wrapper{display:block;width:700px}div.vis-configuration-wrapper::after{clear:both;content:"";display:block}div.vis-configuration.vis-config-option-container{display:block;width:495px;background-color:#fff;border:2px solid #f7f8fa;border-radius:4px;margin-top:20px;left:10px;padding-left:5px}div.vis-configuration.vis-config-button{display:block;width:495px;height:25px;vertical-align:middle;line-height:25px;background-color:#f7f8fa;border:2px solid #ceced0;border-radius:4px;margin-top:20px;left:10px;padding-left:5px;cursor:pointer;margin-bottom:30px}div.vis-configuration.vis-config-button.hover{background-color:#4588e6;border:2px solid #214373;color:#fff}div.vis-configuration.vis-config-item{display:block;float:left;width:495px;height:25px;vertical-align:middle;line-height:25px}div.vis-configuration.vis-config-item.vis-config-s2{left:10px;background-color:#f7f8fa;padding-left:5px;border-radius:3px}div.vis-configuration.vis-config-item.vis-config-s3{left:20px;background-color:#e4e9f0;padding-left:5px;border-radius:3px}div.vis-configuration.vis-config-item.vis-config-s4{left:30px;background-color:#cfd8e6;padding-left:5px;border-radius:3px}div.vis-configuration.vis-config-header{font-size:18px;font-weight:700}div.vis-configuration.vis-config-label{width:120px;height:25px;line-height:25px}div.vis-configuration.vis-config-label.vis-config-s3{width:110px}div.vis-configuration.vis-config-label.vis-config-s4{width:100px}div.vis-configuration.vis-config-colorBlock{top:1px;width:30px;height:19px;border:1px solid #444;border-radius:2px;padding:0;margin:0;cursor:pointer}input.vis-configuration.vis-config-checkbox{left:-5px}input.vis-configuration.vis-config-rangeinput{position:relative;top:-5px;width:60px;padding:1px;margin:0;pointer-events:none}input.vis-configuration.vis-config-range{-webkit-appearance:none;border:0 solid #fff;background-color:rgba(0,0,0,0);width:300px;height:20px}input.vis-configuration.vis-config-range::-webkit-slider-runnable-track{width:300px;height:5px;background:#dedede;background:-moz-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#dedede),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-o-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:linear-gradient(to bottom,#dedede 0,#c8c8c8 99%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#dedede', endColorstr='#c8c8c8', GradientType=0 );border:1px solid #999;box-shadow:#aaa 0 0 3px 0;border-radius:3px}input.vis-configuration.vis-config-range::-webkit-slider-thumb{-webkit-appearance:none;border:1px solid #14334b;height:17px;width:17px;border-radius:50%;background:#3876c2;background:-moz-linear-gradient(top,#3876c2 0,#385380 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#3876c2),color-stop(100%,#385380));background:-webkit-linear-gradient(top,#3876c2 0,#385380 100%);background:-o-linear-gradient(top,#3876c2 0,#385380 100%);background:-ms-linear-gradient(top,#3876c2 0,#385380 100%);background:linear-gradient(to bottom,#3876c2 0,#385380 100%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#3876c2', endColorstr='#385380', GradientType=0 );box-shadow:#111927 0 0 1px 0;margin-top:-7px}input.vis-configuration.vis-config-range:focus{outline:0}input.vis-configuration.vis-config-range:focus::-webkit-slider-runnable-track{background:#9d9d9d;background:-moz-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#9d9d9d),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-o-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:linear-gradient(to bottom,#9d9d9d 0,#c8c8c8 99%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#9d9d9d', endColorstr='#c8c8c8', GradientType=0 )}input.vis-configuration.vis-config-range::-moz-range-track{width:300px;height:10px;background:#dedede;background:-moz-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#dedede),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-o-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:linear-gradient(to bottom,#dedede 0,#c8c8c8 99%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#dedede', endColorstr='#c8c8c8', GradientType=0 );border:1px solid #999;box-shadow:#aaa 0 0 3px 0;border-radius:3px}input.vis-configuration.vis-config-range::-moz-range-thumb{border:none;height:16px;width:16px;border-radius:50%;background:#385380}input.vis-configuration.vis-config-range:-moz-focusring{outline:#fff solid 1px;outline-offset:-1px}input.vis-configuration.vis-config-range::-ms-track{width:300px;height:5px;background:0 0;border-color:transparent;border-width:6px 0;color:transparent}input.vis-configuration.vis-config-range::-ms-fill-lower{background:#777;border-radius:10px}input.vis-configuration.vis-config-range::-ms-fill-upper{background:#ddd;border-radius:10px}input.vis-configuration.vis-config-range::-ms-thumb{border:none;height:16px;width:16px;border-radius:50%;background:#385380}input.vis-configuration.vis-config-range:focus::-ms-fill-lower{background:#888}input.vis-configuration.vis-config-range:focus::-ms-fill-upper{background:#ccc}.vis-configuration-popup{position:absolute;background:rgba(57,76,89,.85);border:2px solid #f2faff;line-height:30px;height:30px;width:150px;text-align:center;color:#fff;font-size:14px;border-radius:4px;-webkit-transition:opacity .3s ease-in-out;-moz-transition:opacity .3s ease-in-out;transition:opacity .3s ease-in-out}.vis-configuration-popup:after,.vis-configuration-popup:before{left:100%;top:50%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}.vis-configuration-popup:after{border-color:rgba(136,183,213,0);border-left-color:rgba(57,76,89,.85);border-width:8px;margin-top:-8px}.vis-configuration-popup:before{border-color:rgba(194,225,245,0);border-left-color:#f2faff;border-width:12px;margin-top:-12px}div.vis-tooltip{position:absolute;visibility:hidden;padding:5px;white-space:nowrap;font-family:verdana;font-size:14px;color:#000;background-color:#f5f4ed;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;border:1px solid #808074;box-shadow:3px 3px 10px rgba(0,0,0,.2);pointer-events:none;z-index:5}.vis-current-time{background-color:#FF7F6E;width:2px;z-index:1;pointer-events:none}.vis-rolling-mode-btn{height:40px;width:40px;position:absolute;top:7px;right:20px;border-radius:50%;font-size:28px;cursor:pointer;opacity:.8;color:#fff;font-weight:700;text-align:center;background:#3876c2}.vis-rolling-mode-btn:before{content:"\26F6"}.vis-rolling-mode-btn:hover{opacity:1}.vis-custom-time{background-color:#6E94FF;width:2px;cursor:move;z-index:1}.vis-panel.vis-background.vis-horizontal .vis-grid.vis-horizontal{position:absolute;width:100%;height:0;border-bottom:1px solid}.vis-panel.vis-background.vis-horizontal .vis-grid.vis-minor{border-color:#e5e5e5}.vis-panel.vis-background.vis-horizontal .vis-grid.vis-major{border-color:#bfbfbf}.vis-data-axis .vis-y-axis.vis-major{width:100%;position:absolute;color:#4d4d4d;white-space:nowrap}.vis-data-axis .vis-y-axis.vis-major.vis-measure{padding:0;margin:0;border:0;visibility:hidden;width:auto}.vis-data-axis .vis-y-axis.vis-minor{position:absolute;width:100%;color:#bebebe;white-space:nowrap}.vis-data-axis .vis-y-axis.vis-minor.vis-measure{padding:0;margin:0;border:0;visibility:hidden;width:auto}.vis-data-axis .vis-y-axis.vis-title{position:absolute;color:#4d4d4d;white-space:nowrap;bottom:20px;text-align:center}.vis-data-axis .vis-y-axis.vis-title.vis-measure{padding:0;margin:0;visibility:hidden;width:auto}.vis-data-axis .vis-y-axis.vis-title.vis-left{bottom:0;-webkit-transform-origin:left top;-moz-transform-origin:left top;-ms-transform-origin:left top;-o-transform-origin:left top;transform-origin:left bottom;-webkit-transform:rotate(-90deg);-moz-transform:rotate(-90deg);-ms-transform:rotate(-90deg);-o-transform:rotate(-90deg);transform:rotate(-90deg)}.vis-data-axis .vis-y-axis.vis-title.vis-right{bottom:0;-webkit-transform-origin:right bottom;-moz-transform-origin:right bottom;-ms-transform-origin:right bottom;-o-transform-origin:right bottom;transform-origin:right bottom;-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.vis-legend{background-color:rgba(247,252,255,.65);padding:5px;border:1px solid #b3b3b3;box-shadow:2px 2px 10px rgba(154,154,154,.55)}.vis-legend-text{white-space:nowrap;display:inline-block}.vis-item{position:absolute;color:#1A1A1A;border-color:#97B0F8;border-width:1px;background-color:#D5DDF6;display:inline-block}.vis-item.vis-point.vis-selected,.vis-item.vis-selected{background-color:#FFF785}.vis-item.vis-selected{border-color:#FFC200;z-index:2}.vis-editable.vis-selected{cursor:move}.vis-item.vis-box{text-align:center;border-style:solid;border-radius:2px}.vis-item.vis-point{background:0 0}.vis-item.vis-dot{position:absolute;padding:0;border-width:4px;border-style:solid;border-radius:4px}.vis-item.vis-range{border-style:solid;border-radius:2px;box-sizing:border-box}.vis-item.vis-background{border:none;background-color:rgba(213,221,246,.4);box-sizing:border-box;padding:0;margin:0}.vis-item .vis-item-overflow{position:relative;width:100%;height:100%;padding:0;margin:0;overflow:hidden}.vis-item-visible-frame{white-space:nowrap}.vis-item.vis-range .vis-item-content{position:relative;display:inline-block}.vis-item.vis-background .vis-item-content{position:absolute;display:inline-block}.vis-item.vis-line{padding:0;position:absolute;width:0;border-left-width:1px;border-left-style:solid}.vis-item .vis-item-content{white-space:nowrap;box-sizing:border-box;padding:5px}.vis-item .vis-onUpdateTime-tooltip{position:absolute;background:#4f81bd;color:#fff;width:200px;text-align:center;white-space:nowrap;padding:5px;border-radius:1px}.vis-item .vis-delete,.vis-item .vis-delete-rtl{position:absolute;top:0;width:24px;height:24px;box-sizing:border-box;padding:0 5px;cursor:pointer;-webkit-transition:background .2s linear;-moz-transition:background .2s linear;-ms-transition:background .2s linear;-o-transition:background .2s linear;transition:background .2s linear}.vis-item .vis-delete{right:-24px}.vis-item .vis-delete-rtl{left:-24px}.vis-item .vis-delete-rtl:after,.vis-item .vis-delete:after{content:"\00D7";color:red;font-family:arial,sans-serif;font-size:22px;font-weight:700;-webkit-transition:color .2s linear;-moz-transition:color .2s linear;-ms-transition:color .2s linear;-o-transition:color .2s linear;transition:color .2s linear}.vis-item .vis-delete-rtl:hover,.vis-item .vis-delete:hover{background:red}.vis-item .vis-delete-rtl:hover:after,.vis-item .vis-delete:hover:after{color:#fff}.vis-item .vis-drag-center{position:absolute;width:100%;height:100%;top:0;left:0;cursor:move}.vis-item.vis-range .vis-drag-left,.vis-item.vis-range .vis-drag-right{position:absolute;width:24px;max-width:20%;min-width:2px;height:100%;top:0}.vis-item.vis-range .vis-drag-left{left:-4px;cursor:w-resize}.vis-item.vis-range .vis-drag-right{right:-4px;cursor:e-resize}.vis-range.vis-item.vis-readonly .vis-drag-left,.vis-range.vis-item.vis-readonly .vis-drag-right{cursor:auto}.vis-labelset .vis-label.draggable,.vis-nesting-group{cursor:pointer}.vis-itemset{position:relative;padding:0;margin:0;box-sizing:border-box}.vis-itemset .vis-background,.vis-itemset .vis-foreground{position:absolute;width:100%;height:100%;overflow:visible}.vis-axis{position:absolute;width:100%;height:0;left:0;z-index:1}.vis-foreground .vis-group{position:relative;box-sizing:border-box;border-bottom:1px solid #bfbfbf}.vis-foreground .vis-group:last-child{border-bottom:none}.vis-nested-group{background:#f5f5f5}.vis-label.vis-nesting-group.expanded:before{content:"\25BC"}.vis-label.vis-nesting-group.collapsed-rtl:before{content:"\25C0"}.vis-label.vis-nesting-group.collapsed:before{content:"\25B6"}.vis-overlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:10}.vis-labelset,.vis-labelset .vis-label{position:relative;box-sizing:border-box}.vis-labelset{overflow:hidden}.vis-labelset .vis-label{left:0;top:0;width:100%;color:#4d4d4d;border-bottom:1px solid #bfbfbf}.vis-labelset .vis-label:last-child{border-bottom:none}.vis-labelset .vis-label .vis-inner{display:inline-block;padding:5px}.vis-labelset .vis-label .vis-inner.vis-hidden{padding:0}.vis-panel{position:absolute;padding:0;margin:0;box-sizing:border-box}.vis-panel.vis-bottom,.vis-panel.vis-center,.vis-panel.vis-left,.vis-panel.vis-right,.vis-panel.vis-top{border:1px #bfbfbf}.vis-panel.vis-center,.vis-panel.vis-left,.vis-panel.vis-right{border-top-style:solid;border-bottom-style:solid;overflow:hidden}.vis-left.vis-panel.vis-vertical-scroll,.vis-right.vis-panel.vis-vertical-scroll{height:100%;overflow-x:hidden;overflow-y:scroll}.vis-background,.vis-time-axis,.vis-timeline{overflow:hidden}.vis-left.vis-panel.vis-vertical-scroll{direction:rtl}.vis-left.vis-panel.vis-vertical-scroll .vis-content,.vis-right.vis-panel.vis-vertical-scroll{direction:ltr}.vis-right.vis-panel.vis-vertical-scroll .vis-content{direction:rtl}.vis-panel.vis-bottom,.vis-panel.vis-center,.vis-panel.vis-top{border-left-style:solid;border-right-style:solid}.vis-panel>.vis-content{position:relative}.vis-panel .vis-shadow{position:absolute;width:100%;height:1px;box-shadow:0 0 10px rgba(0,0,0,.8)}.vis-panel .vis-shadow.vis-top{top:-1px;left:0}.vis-panel .vis-shadow.vis-bottom{bottom:-1px;left:0}.vis-graph-group0{fill:#4f81bd;fill-opacity:0;stroke-width:2px;stroke:#4f81bd}.vis-graph-group1{fill:#f79646;fill-opacity:0;stroke-width:2px;stroke:#f79646}.vis-graph-group2{fill:#8c51cf;fill-opacity:0;stroke-width:2px;stroke:#8c51cf}.vis-graph-group3{fill:#75c841;fill-opacity:0;stroke-width:2px;stroke:#75c841}.vis-graph-group4{fill:#ff0100;fill-opacity:0;stroke-width:2px;stroke:#ff0100}.vis-graph-group5{fill:#37d8e6;fill-opacity:0;stroke-width:2px;stroke:#37d8e6}.vis-graph-group6{fill:#042662;fill-opacity:0;stroke-width:2px;stroke:#042662}.vis-graph-group7{fill:#00ff26;fill-opacity:0;stroke-width:2px;stroke:#00ff26}.vis-graph-group8{fill:#f0f;fill-opacity:0;stroke-width:2px;stroke:#f0f}.vis-graph-group9{fill:#8f3938;fill-opacity:0;stroke-width:2px;stroke:#8f3938}.vis-timeline .vis-fill{fill-opacity:.1;stroke:none}.vis-timeline .vis-bar{fill-opacity:.5;stroke-width:1px}.vis-timeline .vis-point{stroke-width:2px;fill-opacity:1}.vis-timeline .vis-legend-background{stroke-width:1px;fill-opacity:.9;fill:#fff;stroke:#c2c2c2}.vis-timeline .vis-outline{stroke-width:1px;fill-opacity:1;fill:#fff;stroke:#e5e5e5}.vis-timeline .vis-icon-fill{fill-opacity:.3;stroke:none}.vis-time-axis{position:relative}.vis-time-axis.vis-foreground{top:0;left:0;width:100%}.vis-time-axis.vis-background{position:absolute;top:0;left:0;width:100%;height:100%}.vis-time-axis .vis-text{position:absolute;color:#4d4d4d;padding:3px;overflow:hidden;box-sizing:border-box;white-space:nowrap}.vis-time-axis .vis-text.vis-measure{position:absolute;padding-left:0;padding-right:0;margin-left:0;margin-right:0;visibility:hidden}.vis-time-axis .vis-grid.vis-vertical{position:absolute;border-left:1px solid}.vis-time-axis .vis-grid.vis-vertical-rtl{position:absolute;border-right:1px solid}.vis-time-axis .vis-grid.vis-minor{border-color:#e5e5e5}.vis-time-axis .vis-grid.vis-major{border-color:#bfbfbf}.vis-timeline{position:relative;border:1px solid #bfbfbf;padding:0;margin:0;box-sizing:border-box} \ No newline at end of file diff --git a/dist/vis-timeline-graph2d.min.js b/dist/vis-timeline-graph2d.min.js index c02bb516..44be5f38 100644 --- a/dist/vis-timeline-graph2d.min.js +++ b/dist/vis-timeline-graph2d.min.js @@ -4,8 +4,8 @@ * * A dynamic, browser-based visualization library. * - * @version 4.17.0 - * @date 2016-11-05 + * @version 4.18.0 + * @date 2017-01-15 * * @license * Copyright (C) 2011-2016 Almende B.V, http://almende.com @@ -22,18 +22,19 @@ * * Vis.js may be distributed under either license. */ -"use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.vis=e():t.vis=e()}(this,function(){return function(t){function e(o){if(i[o])return i[o].exports;var n=i[o]={exports:{},id:o,loaded:!1};return t[o].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){e.util=i(1),e.DOMutil=i(7),e.DataSet=i(8),e.DataView=i(10),e.Queue=i(9),e.Timeline=i(11),e.Graph2d=i(41),e.timeline={Core:i(23),DateUtil:i(22),Range:i(20),stack:i(27),TimeStep:i(25),components:{items:{Item:i(29),BackgroundItem:i(33),BoxItem:i(31),PointItem:i(32),RangeItem:i(28)},BackgroundGroup:i(30),Component:i(21),CurrentTime:i(39),CustomTime:i(37),DataAxis:i(43),DataScale:i(44),GraphGroup:i(45),Group:i(26),ItemSet:i(24),Legend:i(49),LineGraph:i(42),TimeAxis:i(34)}},e.moment=i(2),e.Hammer=i(14),e.keycharm=i(36)},function(t,e,i){var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n=i(2),s=i(6);e.isNumber=function(t){return t instanceof Number||"number"==typeof t},e.recursiveDOMDelete=function(t){if(t)for(;t.hasChildNodes()===!0;)e.recursiveDOMDelete(t.firstChild),t.removeChild(t.firstChild)},e.giveRange=function(t,e,i,o){if(e==t)return.5;var n=1/(e-t);return Math.max(0,(o-t)*n)},e.isString=function(t){return t instanceof String||"string"==typeof t},e.isDate=function(t){if(t instanceof Date)return!0;if(e.isString(t)){var i=r.exec(t);if(i)return!0;if(!isNaN(Date.parse(t)))return!0}return!1},e.randomUUID=function(){return s.v4()},e.assignAllKeys=function(t,e){for(var i in t)t.hasOwnProperty(i)&&"object"!==o(t[i])&&(t[i]=e)},e.fillIfDefined=function(t,i){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(var s in t)void 0!==i[s]&&("object"!==o(i[s])?void 0!==i[s]&&null!==i[s]||void 0===t[s]||n!==!0?t[s]=i[s]:delete t[s]:"object"===o(t[s])&&e.fillIfDefined(t[s],i[s],n))},e.protoExtend=function(t,e){for(var i=1;i3&&void 0!==arguments[3]&&arguments[3];if(Array.isArray(o))throw new TypeError("Arrays are not supported by deepExtend");for(var s=2;s3&&void 0!==arguments[3]&&arguments[3];if(Array.isArray(o))throw new TypeError("Arrays are not supported by deepExtend");for(var s in o)if(o.hasOwnProperty(s)&&t.indexOf(s)==-1)if(o[s]&&o[s].constructor===Object)void 0===i[s]&&(i[s]={}),i[s].constructor===Object?e.deepExtend(i[s],o[s]):null===o[s]&&void 0!==i[s]&&n===!0?delete i[s]:i[s]=o[s];else if(Array.isArray(o[s])){i[s]=[];for(var r=0;r=0&&(e="DOMMouseScroll"),t.addEventListener(e,i,o)):t.attachEvent("on"+e,i)},e.removeEventListener=function(t,e,i,o){t.removeEventListener?(void 0===o&&(o=!1),"mousewheel"===e&&navigator.userAgent.indexOf("Firefox")>=0&&(e="DOMMouseScroll"),t.removeEventListener(e,i,o)):t.detachEvent("on"+e,i)},e.preventDefault=function(t){t||(t=window.event),t.preventDefault?t.preventDefault():t.returnValue=!1},e.getTarget=function(t){t||(t=window.event);var e;return t.target?e=t.target:t.srcElement&&(e=t.srcElement),void 0!=e.nodeType&&3==e.nodeType&&(e=e.parentNode),e},e.hasParent=function(t,e){for(var i=t;i;){if(i===e)return!0;i=i.parentNode}return!1},e.option={},e.option.asBoolean=function(t,e){return"function"==typeof t&&(t=t()),null!=t?0!=t:e||null},e.option.asNumber=function(t,e){return"function"==typeof t&&(t=t()),null!=t?Number(t)||e||null:e||null},e.option.asString=function(t,e){return"function"==typeof t&&(t=t()),null!=t?String(t):e||null},e.option.asSize=function(t,i){return"function"==typeof t&&(t=t()),e.isString(t)?t:e.isNumber(t)?t+"px":i||null},e.option.asElement=function(t,e){return"function"==typeof t&&(t=t()),t||e||null},e.hexToRGB=function(t){var e=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;t=t.replace(e,function(t,e,i,o){return e+e+i+i+o+o});var i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return i?{r:parseInt(i[1],16),g:parseInt(i[2],16),b:parseInt(i[3],16)}:null},e.overrideOpacity=function(t,i){if(t.indexOf("rgba")!=-1)return t;if(t.indexOf("rgb")!=-1){var o=t.substr(t.indexOf("(")+1).replace(")","").split(",");return"rgba("+o[0]+","+o[1]+","+o[2]+","+i+")"}var o=e.hexToRGB(t);return null==o?t:"rgba("+o.r+","+o.g+","+o.b+","+i+")"},e.RGBToHex=function(t,e,i){return"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1)},e.parseColor=function(t){var i;if(e.isString(t)===!0){if(e.isValidRGB(t)===!0){var o=t.substr(4).substr(0,t.length-5).split(",").map(function(t){return parseInt(t)});t=e.RGBToHex(o[0],o[1],o[2])}if(e.isValidHex(t)===!0){var n=e.hexToHSV(t),s={h:n.h,s:.8*n.s,v:Math.min(1,1.02*n.v)},r={h:n.h,s:Math.min(1,1.25*n.s),v:.8*n.v},a=e.HSVToHex(r.h,r.s,r.v),h=e.HSVToHex(s.h,s.s,s.v);i={background:t,border:a,highlight:{background:h,border:a},hover:{background:h,border:a}}}else i={background:t,border:t,highlight:{background:t,border:t},hover:{background:t,border:t}}}else i={},i.background=t.background||void 0,i.border=t.border||void 0,e.isString(t.highlight)?i.highlight={border:t.highlight,background:t.highlight}:(i.highlight={},i.highlight.background=t.highlight&&t.highlight.background||void 0,i.highlight.border=t.highlight&&t.highlight.border||void 0),e.isString(t.hover)?i.hover={border:t.hover,background:t.hover}:(i.hover={},i.hover.background=t.hover&&t.hover.background||void 0,i.hover.border=t.hover&&t.hover.border||void 0);return i},e.RGBToHSV=function(t,e,i){t/=255,e/=255,i/=255;var o=Math.min(t,Math.min(e,i)),n=Math.max(t,Math.max(e,i));if(o==n)return{h:0,s:0,v:o};var s=t==o?e-i:i==o?t-e:i-t,r=t==o?3:i==o?1:5,a=60*(r-s/(n-o))/360,h=(n-o)/n,d=n;return{h:a,s:h,v:d}};var a={split:function(t){var e={};return t.split(";").forEach(function(t){if(""!=t.trim()){var i=t.split(":"),o=i[0].trim(),n=i[1].trim();e[o]=n}}),e},join:function(t){return Object.keys(t).map(function(e){return e+": "+t[e]}).join("; ")}};e.addCssText=function(t,i){var o=a.split(t.style.cssText),n=a.split(i),s=e.extend(o,n);t.style.cssText=a.join(s)},e.removeCssText=function(t,e){var i=a.split(t.style.cssText),o=a.split(e);for(var n in o)o.hasOwnProperty(n)&&delete i[n];t.style.cssText=a.join(i)},e.HSVToRGB=function(t,e,i){var o,n,s,r=Math.floor(6*t),a=6*t-r,h=i*(1-e),d=i*(1-a*e),l=i*(1-(1-a)*e);switch(r%6){case 0:o=i,n=l,s=h;break;case 1:o=d,n=i,s=h;break;case 2:o=h,n=i,s=l;break;case 3:o=h,n=d,s=i;break;case 4:o=l,n=h,s=i;break;case 5:o=i,n=h,s=d}return{r:Math.floor(255*o),g:Math.floor(255*n),b:Math.floor(255*s)}},e.HSVToHex=function(t,i,o){var n=e.HSVToRGB(t,i,o);return e.RGBToHex(n.r,n.g,n.b)},e.hexToHSV=function(t){var i=e.hexToRGB(t);return e.RGBToHSV(i.r,i.g,i.b)},e.isValidHex=function(t){var e=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t);return e},e.isValidRGB=function(t){t=t.replace(" ","");var e=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/i.test(t);return e},e.isValidRGBA=function(t){t=t.replace(" ","");var e=/rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(.{1,3})\)/i.test(t);return e},e.selectiveBridgeObject=function(t,i){if("object"==("undefined"==typeof i?"undefined":o(i))){for(var n=Object.create(i),s=0;s0&&e(o,t[n-1])<0;n--)t[n]=t[n-1];t[n]=o}return t},e.mergeOptions=function(t,e,i){var o=(arguments.length>3&&void 0!==arguments[3]&&arguments[3],arguments.length>4&&void 0!==arguments[4]?arguments[4]:{});if(null===e[i])t[i]=Object.create(o[i]);else if(void 0!==e[i])if("boolean"==typeof e[i])t[i].enabled=e[i];else{void 0===e[i].enabled&&(t[i].enabled=!0);for(var n in e[i])e[i].hasOwnProperty(n)&&(t[i][n]=e[i][n])}},e.binarySearchCustom=function(t,e,i,o){for(var n=1e4,s=0,r=0,a=t.length-1;r<=a&&s0)return"before"==o?Math.max(0,h-1):h;if(n(r,e)<0&&n(a,e)>0)return"before"==o?h:Math.min(t.length-1,h+1);n(r,e)<0?u=h+1:p=h-1,l++}return-1},e.easingFunctions={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return t*(2-t)},easeInOutQuad:function(t){return t<.5?2*t*t:-1+(4-2*t)*t},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return--t*t*t+1},easeInOutCubic:function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return 1- --t*t*t*t},easeInOutQuart:function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return 1+--t*t*t*t*t},easeInOutQuint:function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t}},e.getScrollBarWidth=function(){var t=document.createElement("p");t.style.width="100%",t.style.height="200px";var e=document.createElement("div");e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.visibility="hidden",e.style.width="200px",e.style.height="150px",e.style.overflow="hidden",e.appendChild(t),document.body.appendChild(e);var i=t.offsetWidth;e.style.overflow="scroll";var o=t.offsetWidth;return i==o&&(o=e.clientWidth),document.body.removeChild(e),i-o}},function(t,e,i){t.exports="undefined"!=typeof window&&window.moment||i(3)},function(t,e,i){(function(t){!function(e,i){t.exports=i()}(this,function(){function e(){return mo.apply(null,arguments)}function i(t){mo=t}function o(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function n(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function s(t){var e;for(e in t)return!1;return!0}function r(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function a(t,e){var i,o=[];for(i=0;i0)for(i in go)o=go[i],n=e[o],f(n)||(t[o]=n);return t}function v(t){g(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),vo===!1&&(vo=!0,e.updateOffset(this),vo=!1)}function y(t){return t instanceof v||null!=t&&null!=t._isAMomentObject}function b(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function _(t){var e=+t,i=0;return 0!==e&&isFinite(e)&&(i=b(e)),i}function w(t,e,i){var o,n=Math.min(t.length,e.length),s=Math.abs(t.length-e.length),r=0;for(o=0;o0?"future":"past"];return k(i)?i(e):i.replace(/%s/i,e)}function R(t,e){var i=t.toLowerCase();To[i]=To[i+"s"]=To[e]=t}function L(t){return"string"==typeof t?To[t]||To[t.toLowerCase()]:void 0}function F(t){var e,i,o={};for(i in t)h(t,i)&&(e=L(i),e&&(o[e]=t[i]));return o}function H(t,e){Oo[t]=e}function Y(t){var e=[];for(var i in t)e.push({unit:i,priority:Oo[i]});return e.sort(function(t,e){return t.priority-e.priority}),e}function j(t,i){return function(o){return null!=o?(z(this,t,o),e.updateOffset(this,i),this):G(this,t)}}function G(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function z(t,e,i){t.isValid()&&t._d["set"+(t._isUTC?"UTC":"")+e](i)}function W(t){return t=L(t),k(this[t])?this[t]():this}function U(t,e){if("object"==typeof t){t=F(t);for(var i=Y(t),o=0;o=0;return(s?i?"+":"":"-")+Math.pow(10,Math.max(0,n)).toString().substr(1)+o}function B(t,e,i,o){var n=o;"string"==typeof o&&(n=function(){return this[o]()}),t&&(Ao[t]=n),e&&(Ao[e[0]]=function(){return V(n.apply(this,arguments),e[1],e[2])}),i&&(Ao[i]=function(){return this.localeData().ordinal(n.apply(this,arguments),t)})}function q(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function X(t){var e,i,o=t.match(Mo);for(e=0,i=o.length;e=0&&Eo.test(t);)t=t.replace(Eo,i),Eo.lastIndex=0,o-=1;return t}function J(t,e,i){Ko[t]=k(e)?e:function(t,o){return t&&i?i:e}}function Q(t,e){return h(Ko,t)?Ko[t](e._strict,e._locale):new RegExp($(t))}function $(t){return tt(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,i,o,n){return e||i||o||n}))}function tt(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function et(t,e){var i,o=e;for("string"==typeof t&&(t=[t]),"number"==typeof e&&(o=function(t,i){i[e]=_(t)}),i=0;i=0&&isFinite(a.getFullYear())&&a.setFullYear(t),a}function bt(t){var e=new Date(Date.UTC.apply(null,arguments));return t<100&&t>=0&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function _t(t,e,i){var o=7+e-i,n=(7+bt(t,0,o).getUTCDay()-e)%7;return-n+o-1}function wt(t,e,i,o,n){var s,r,a=(7+i-o)%7,h=_t(t,o,n),d=1+7*(e-1)+a+h;return d<=0?(s=t-1,r=ft(s)+d):d>ft(t)?(s=t+1,r=d-ft(t)):(s=t,r=d),{year:s,dayOfYear:r}}function xt(t,e,i){var o,n,s=_t(t.year(),e,i),r=Math.floor((t.dayOfYear()-s-1)/7)+1;return r<1?(n=t.year()-1,o=r+Dt(n,e,i)):r>Dt(t.year(),e,i)?(o=r-Dt(t.year(),e,i),n=t.year()+1):(n=t.year(),o=r),{week:o,year:n}}function Dt(t,e,i){var o=_t(t,e,i),n=_t(t+1,e,i);return(ft(t)-o+n)/7}function St(t){return xt(t,this._week.dow,this._week.doy).week}function kt(){return this._week.dow}function Ct(){return this._week.doy}function Tt(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function Ot(t){var e=xt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function Mt(t,e){return"string"!=typeof t?t:isNaN(t)?(t=e.weekdaysParse(t),"number"==typeof t?t:null):parseInt(t,10)}function Et(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function Pt(t,e){return t?o(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(e)?"format":"standalone"][t.day()]:this._weekdays}function At(t){return t?this._weekdaysShort[t.day()]:this._weekdaysShort}function Nt(t){return t?this._weekdaysMin[t.day()]:this._weekdaysMin}function It(t,e,i){var o,n,s,r=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],o=0;o<7;++o)s=l([2e3,1]).day(o),this._minWeekdaysParse[o]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[o]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[o]=this.weekdays(s,"").toLocaleLowerCase();return i?"dddd"===e?(n=_o.call(this._weekdaysParse,r),n!==-1?n:null):"ddd"===e?(n=_o.call(this._shortWeekdaysParse,r),n!==-1?n:null):(n=_o.call(this._minWeekdaysParse,r),n!==-1?n:null):"dddd"===e?(n=_o.call(this._weekdaysParse,r),n!==-1?n:(n=_o.call(this._shortWeekdaysParse,r),n!==-1?n:(n=_o.call(this._minWeekdaysParse,r),n!==-1?n:null))):"ddd"===e?(n=_o.call(this._shortWeekdaysParse,r),n!==-1?n:(n=_o.call(this._weekdaysParse,r),n!==-1?n:(n=_o.call(this._minWeekdaysParse,r),n!==-1?n:null))):(n=_o.call(this._minWeekdaysParse,r),n!==-1?n:(n=_o.call(this._weekdaysParse,r),n!==-1?n:(n=_o.call(this._shortWeekdaysParse,r),n!==-1?n:null)))}function Rt(t,e,i){var o,n,s;if(this._weekdaysParseExact)return It.call(this,t,e,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),o=0;o<7;o++){if(n=l([2e3,1]).day(o),i&&!this._fullWeekdaysParse[o]&&(this._fullWeekdaysParse[o]=new RegExp("^"+this.weekdays(n,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[o]=new RegExp("^"+this.weekdaysShort(n,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[o]=new RegExp("^"+this.weekdaysMin(n,"").replace(".",".?")+"$","i")),this._weekdaysParse[o]||(s="^"+this.weekdays(n,"")+"|^"+this.weekdaysShort(n,"")+"|^"+this.weekdaysMin(n,""),this._weekdaysParse[o]=new RegExp(s.replace(".",""),"i")),i&&"dddd"===e&&this._fullWeekdaysParse[o].test(t))return o;if(i&&"ddd"===e&&this._shortWeekdaysParse[o].test(t))return o;if(i&&"dd"===e&&this._minWeekdaysParse[o].test(t))return o;if(!i&&this._weekdaysParse[o].test(t))return o}}function Lt(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=Mt(t,this.localeData()),this.add(t-e,"d")):e}function Ft(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function Ht(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=Et(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7}function Yt(t){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||zt.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(h(this,"_weekdaysRegex")||(this._weekdaysRegex=yn),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function jt(t){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||zt.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(h(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=bn),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Gt(t){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||zt.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(h(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=_n),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function zt(){function t(t,e){return e.length-t.length}var e,i,o,n,s,r=[],a=[],h=[],d=[];for(e=0;e<7;e++)i=l([2e3,1]).day(e),o=this.weekdaysMin(i,""),n=this.weekdaysShort(i,""),s=this.weekdays(i,""),r.push(o),a.push(n),h.push(s),d.push(o),d.push(n),d.push(s);for(r.sort(t),a.sort(t),h.sort(t),d.sort(t),e=0;e<7;e++)a[e]=tt(a[e]),h[e]=tt(h[e]),d[e]=tt(d[e]);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 Wt(){return this.hours()%12||12}function Ut(){return this.hours()||24}function Vt(t,e){B(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function Bt(t,e){return e._meridiemParse}function qt(t){return"p"===(t+"").toLowerCase().charAt(0)}function Xt(t,e,i){return t>11?i?"pm":"PM":i?"am":"AM"}function Zt(t){return t?t.toLowerCase().replace("_","-"):t}function Kt(t){for(var e,i,o,n,s=0;s0;){if(o=Jt(n.slice(0,e).join("-")))return o;if(i&&i.length>=e&&w(n,i,!0)>=e-1)break;e--}s++}return null}function Jt(e){var i=null;if(!kn[e]&&"undefined"!=typeof t&&t&&t.exports)try{i=wn._abbr,!function(){var t=new Error('Cannot find module "./locale"');throw t.code="MODULE_NOT_FOUND",t}(),Qt(i)}catch(t){}return kn[e]}function Qt(t,e){var i;return t&&(i=f(e)?ee(t):$t(t,e),i&&(wn=i)),wn._abbr}function $t(t,e){if(null!==e){var i=Sn;return e.abbr=t,null!=kn[t]?(S("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=kn[t]._config):null!=e.parentLocale&&(null!=kn[e.parentLocale]?i=kn[e.parentLocale]._config:S("parentLocaleUndefined","specified parentLocale is not defined yet. See http://momentjs.com/guides/#/warnings/parent-locale/")),kn[t]=new O(T(i,e)),Qt(t),kn[t]}return delete kn[t],null}function te(t,e){if(null!=e){var i,o=Sn;null!=kn[t]&&(o=kn[t]._config),e=T(o,e),i=new O(e),i.parentLocale=kn[t],kn[t]=i,Qt(t)}else null!=kn[t]&&(null!=kn[t].parentLocale?kn[t]=kn[t].parentLocale:null!=kn[t]&&delete kn[t]);return kn[t]}function ee(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return wn;if(!o(t)){if(e=Jt(t))return e;t=[t]}return Kt(t)}function ie(){return bo(kn)}function oe(t){var e,i=t._a;return i&&p(t).overflow===-2&&(e=i[$o]<0||i[$o]>11?$o:i[tn]<1||i[tn]>nt(i[Qo],i[$o])?tn:i[en]<0||i[en]>24||24===i[en]&&(0!==i[on]||0!==i[nn]||0!==i[sn])?en:i[on]<0||i[on]>59?on:i[nn]<0||i[nn]>59?nn:i[sn]<0||i[sn]>999?sn:-1, -p(t)._overflowDayOfYear&&(etn)&&(e=tn),p(t)._overflowWeeks&&e===-1&&(e=rn),p(t)._overflowWeekday&&e===-1&&(e=an),p(t).overflow=e),t}function ne(t){var e,i,o,n,s,r,a=t._i,h=Cn.exec(a)||Tn.exec(a);if(h){for(p(t).iso=!0,e=0,i=Mn.length;eft(n)&&(p(t)._overflowDayOfYear=!0),i=bt(n,0,t._dayOfYear),t._a[$o]=i.getUTCMonth(),t._a[tn]=i.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=s[e]=o[e];for(;e<7;e++)t._a[e]=s[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[en]&&0===t._a[on]&&0===t._a[nn]&&0===t._a[sn]&&(t._nextDay=!0,t._a[en]=0),t._d=(t._useUTC?bt:yt).apply(null,s),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[en]=24)}}function de(t){var e,i,o,n,s,r,a,h;e=t._w,null!=e.GG||null!=e.W||null!=e.E?(s=1,r=4,i=re(e.GG,t._a[Qo],xt(ye(),1,4).year),o=re(e.W,1),n=re(e.E,1),(n<1||n>7)&&(h=!0)):(s=t._locale._week.dow,r=t._locale._week.doy,i=re(e.gg,t._a[Qo],xt(ye(),s,r).year),o=re(e.w,1),null!=e.d?(n=e.d,(n<0||n>6)&&(h=!0)):null!=e.e?(n=e.e+s,(e.e<0||e.e>6)&&(h=!0)):n=s),o<1||o>Dt(i,s,r)?p(t)._overflowWeeks=!0:null!=h?p(t)._overflowWeekday=!0:(a=wt(i,o,n,s,r),t._a[Qo]=a.year,t._dayOfYear=a.dayOfYear)}function le(t){if(t._f===e.ISO_8601)return void ne(t);t._a=[],p(t).empty=!0;var i,o,n,s,r,a=""+t._i,h=a.length,d=0;for(n=K(t._f,t._locale).match(Mo)||[],i=0;i0&&p(t).unusedInput.push(r),a=a.slice(a.indexOf(o)+o.length),d+=o.length),Ao[s]?(o?p(t).empty=!1:p(t).unusedTokens.push(s),ot(s,o,t)):t._strict&&!o&&p(t).unusedTokens.push(s);p(t).charsLeftOver=h-d,a.length>0&&p(t).unusedInput.push(a),t._a[en]<=12&&p(t).bigHour===!0&&t._a[en]>0&&(p(t).bigHour=void 0),p(t).parsedDateParts=t._a.slice(0),p(t).meridiem=t._meridiem,t._a[en]=ue(t._locale,t._a[en],t._meridiem),he(t),oe(t)}function ue(t,e,i){var o;return null==i?e:null!=t.meridiemHour?t.meridiemHour(e,i):null!=t.isPM?(o=t.isPM(i),o&&e<12&&(e+=12),o||12!==e||(e=0),e):e}function pe(t){var e,i,o,n,s;if(0===t._f.length)return p(t).invalidFormat=!0,void(t._d=new Date(NaN));for(n=0;nthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Le(){if(!f(this._isDSTShifted))return this._isDSTShifted;var t={};if(g(t,this),t=fe(t),t._a){var e=t._isUTC?l(t._a):ye(t._a);this._isDSTShifted=this.isValid()&&w(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Fe(){return!!this.isValid()&&!this._isUTC}function He(){return!!this.isValid()&&this._isUTC}function Ye(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function je(t,e){var i,o,n,s=t,r=null;return De(t)?s={ms:t._milliseconds,d:t._days,M:t._months}:"number"==typeof t?(s={},e?s[e]=t:s.milliseconds=t):(r=Ln.exec(t))?(i="-"===r[1]?-1:1,s={y:0,d:_(r[tn])*i,h:_(r[en])*i,m:_(r[on])*i,s:_(r[nn])*i,ms:_(Se(1e3*r[sn]))*i}):(r=Fn.exec(t))?(i="-"===r[1]?-1:1,s={y:Ge(r[2],i),M:Ge(r[3],i),w:Ge(r[4],i),d:Ge(r[5],i),h:Ge(r[6],i),m:Ge(r[7],i),s:Ge(r[8],i)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(n=We(ye(s.from),ye(s.to)),s={},s.ms=n.milliseconds,s.M=n.months),o=new xe(s),De(t)&&h(t,"_locale")&&(o._locale=t._locale),o}function Ge(t,e){var i=t&&parseFloat(t.replace(",","."));return(isNaN(i)?0:i)*e}function ze(t,e){var i={milliseconds:0,months:0};return i.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(i.months,"M").isAfter(e)&&--i.months,i.milliseconds=+e-+t.clone().add(i.months,"M"),i}function We(t,e){var i;return t.isValid()&&e.isValid()?(e=Te(e,t),t.isBefore(e)?i=ze(t,e):(i=ze(e,t),i.milliseconds=-i.milliseconds,i.months=-i.months),i):{milliseconds:0,months:0}}function Ue(t,e){return function(i,o){var n,s;return null===o||isNaN(+o)||(S(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),s=i,i=o,o=s),i="string"==typeof i?+i:i,n=je(i,o),Ve(this,n,t),this}}function Ve(t,i,o,n){var s=i._milliseconds,r=Se(i._days),a=Se(i._months);t.isValid()&&(n=null==n||n,s&&t._d.setTime(t._d.valueOf()+s*o),r&&z(t,"Date",G(t,"Date")+r*o),a&&dt(t,G(t,"Month")+a*o),n&&e.updateOffset(t,r||a))}function Be(t,e){var i=t.diff(e,"days",!0);return i<-6?"sameElse":i<-1?"lastWeek":i<0?"lastDay":i<1?"sameDay":i<2?"nextDay":i<7?"nextWeek":"sameElse"}function qe(t,i){var o=t||ye(),n=Te(o,this).startOf("day"),s=e.calendarFormat(this,n)||"sameElse",r=i&&(k(i[s])?i[s].call(this,o):i[s]);return this.format(r||this.localeData().calendar(s,this,ye(o)))}function Xe(){return new v(this)}function Ze(t,e){var i=y(t)?t:ye(t);return!(!this.isValid()||!i.isValid())&&(e=L(f(e)?"millisecond":e),"millisecond"===e?this.valueOf()>i.valueOf():i.valueOf()s&&(e=s),Ei.call(this,t,e,i,o,n))}function Ei(t,e,i,o,n){var s=wt(t,e,i,o,n),r=bt(s.year,0,s.dayOfYear);return this.year(r.getUTCFullYear()),this.month(r.getUTCMonth()),this.date(r.getUTCDate()),this}function Pi(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}function Ai(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function Ni(t,e){e[sn]=_(1e3*("0."+t))}function Ii(){return this._isUTC?"UTC":""}function Ri(){return this._isUTC?"Coordinated Universal Time":""}function Li(t){return ye(1e3*t)}function Fi(){return ye.apply(null,arguments).parseZone()}function Hi(t){return t}function Yi(t,e,i,o){var n=ee(),s=l().set(o,e);return n[i](s,t)}function ji(t,e,i){if("number"==typeof t&&(e=t,t=void 0),t=t||"",null!=e)return Yi(t,e,i,"month");var o,n=[];for(o=0;o<12;o++)n[o]=Yi(t,o,i,"month");return n}function Gi(t,e,i,o){"boolean"==typeof t?("number"==typeof e&&(i=e,e=void 0),e=e||""):(e=t,i=e,t=!1,"number"==typeof e&&(i=e,e=void 0),e=e||"");var n=ee(),s=t?n._week.dow:0;if(null!=i)return Yi(e,(i+s)%7,o,"day");var r,a=[];for(r=0;r<7;r++)a[r]=Yi(e,(r+s)%7,o,"day");return a}function zi(t,e){return ji(t,e,"months")}function Wi(t,e){return ji(t,e,"monthsShort")}function Ui(t,e,i){return Gi(t,e,i,"weekdays")}function Vi(t,e,i){return Gi(t,e,i,"weekdaysShort")}function Bi(t,e,i){return Gi(t,e,i,"weekdaysMin")}function qi(){var t=this._data;return this._milliseconds=Zn(this._milliseconds),this._days=Zn(this._days),this._months=Zn(this._months),t.milliseconds=Zn(t.milliseconds),t.seconds=Zn(t.seconds),t.minutes=Zn(t.minutes),t.hours=Zn(t.hours),t.months=Zn(t.months),t.years=Zn(t.years),this}function Xi(t,e,i,o){var n=je(e,i);return t._milliseconds+=o*n._milliseconds,t._days+=o*n._days,t._months+=o*n._months,t._bubble()}function Zi(t,e){return Xi(this,t,e,1)}function Ki(t,e){return Xi(this,t,e,-1)}function Ji(t){return t<0?Math.floor(t):Math.ceil(t)}function Qi(){var t,e,i,o,n,s=this._milliseconds,r=this._days,a=this._months,h=this._data;return s>=0&&r>=0&&a>=0||s<=0&&r<=0&&a<=0||(s+=864e5*Ji(to(a)+r),r=0,a=0),h.milliseconds=s%1e3,t=b(s/1e3),h.seconds=t%60,e=b(t/60),h.minutes=e%60,i=b(e/60),h.hours=i%24,r+=b(i/24),n=b($i(r)),a+=n,r-=Ji(to(n)),o=b(a/12),a%=12,h.days=r,h.months=a,h.years=o,this}function $i(t){return 4800*t/146097}function to(t){return 146097*t/4800}function eo(t){var e,i,o=this._milliseconds;if(t=L(t),"month"===t||"year"===t)return e=this._days+o/864e5,i=this._months+$i(e),"month"===t?i:i/12;switch(e=this._days+Math.round(to(this._months)),t){case"week":return e/7+o/6048e5;case"day":return e+o/864e5;case"hour":return 24*e+o/36e5;case"minute":return 1440*e+o/6e4;case"second":return 86400*e+o/1e3;case"millisecond":return Math.floor(864e5*e)+o;default:throw new Error("Unknown unit "+t)}}function io(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*_(this._months/12)}function oo(t){return function(){return this.as(t)}}function no(t){return t=L(t),this[t+"s"]()}function so(t){return function(){return this._data[t]}}function ro(){return b(this.days()/7)}function ao(t,e,i,o,n){return n.relativeTime(e||1,!!i,t,o)}function ho(t,e,i){var o=je(t).abs(),n=us(o.as("s")),s=us(o.as("m")),r=us(o.as("h")),a=us(o.as("d")),h=us(o.as("M")),d=us(o.as("y")),l=n0,l[4]=i,ao.apply(null,l)}function lo(t){return void 0===t?us:"function"==typeof t&&(us=t,!0)}function uo(t,e){return void 0!==ps[t]&&(void 0===e?ps[t]:(ps[t]=e,!0))}function po(t){var e=this.localeData(),i=ho(this,!t,e);return t&&(i=e.pastFuture(+this,i)),e.postformat(i)}function co(){var t,e,i,o=cs(this._milliseconds)/1e3,n=cs(this._days),s=cs(this._months);t=b(o/60),e=b(t/60),o%=60,t%=60,i=b(s/12),s%=12;var r=i,a=s,h=n,d=e,l=t,u=o,p=this.asSeconds();return p?(p<0?"-":"")+"P"+(r?r+"Y":"")+(a?a+"M":"")+(h?h+"D":"")+(d||l||u?"T":"")+(d?d+"H":"")+(l?l+"M":"")+(u?u+"S":""):"P0D"}var mo,fo;fo=Array.prototype.some?Array.prototype.some:function(t){for(var e=Object(this),i=e.length>>>0,o=0;o68?1900:2e3)};var cn=j("FullYear",!0);B("w",["ww",2],"wo","week"),B("W",["WW",2],"Wo","isoWeek"),R("week","w"),R("isoWeek","W"),H("week",5),H("isoWeek",5),J("w",Ho),J("ww",Ho,Io),J("W",Ho),J("WW",Ho,Io),it(["w","ww","W","WW"],function(t,e,i,o){e[o.substr(0,1)]=_(t)});var mn={dow:0,doy:6};B("d",0,"do","day"),B("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),B("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),B("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),B("e",0,0,"weekday"),B("E",0,0,"isoWeekday"),R("day","d"),R("weekday","e"),R("isoWeekday","E"),H("day",11),H("weekday",11),H("isoWeekday",11),J("d",Ho),J("e",Ho),J("E",Ho),J("dd",function(t,e){return e.weekdaysMinRegex(t)}),J("ddd",function(t,e){return e.weekdaysShortRegex(t)}),J("dddd",function(t,e){return e.weekdaysRegex(t)}),it(["dd","ddd","dddd"],function(t,e,i,o){var n=i._locale.weekdaysParse(t,o,i._strict);null!=n?e.d=n:p(i).invalidWeekday=t}),it(["d","e","E"],function(t,e,i,o){e[o]=_(t)});var fn="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),gn="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),vn="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),yn=Zo,bn=Zo,_n=Zo;B("H",["HH",2],0,"hour"),B("h",["hh",2],0,Wt),B("k",["kk",2],0,Ut),B("hmm",0,0,function(){return""+Wt.apply(this)+V(this.minutes(),2)}),B("hmmss",0,0,function(){return""+Wt.apply(this)+V(this.minutes(),2)+V(this.seconds(),2)}),B("Hmm",0,0,function(){return""+this.hours()+V(this.minutes(),2)}),B("Hmmss",0,0,function(){return""+this.hours()+V(this.minutes(),2)+V(this.seconds(),2)}),Vt("a",!0),Vt("A",!1),R("hour","h"),H("hour",13),J("a",Bt),J("A",Bt),J("H",Ho),J("h",Ho),J("HH",Ho,Io),J("hh",Ho,Io),J("hmm",Yo),J("hmmss",jo),J("Hmm",Yo),J("Hmmss",jo),et(["H","HH"],en),et(["a","A"],function(t,e,i){i._isPm=i._locale.isPM(t),i._meridiem=t}),et(["h","hh"],function(t,e,i){e[en]=_(t),p(i).bigHour=!0}),et("hmm",function(t,e,i){var o=t.length-2;e[en]=_(t.substr(0,o)),e[on]=_(t.substr(o)),p(i).bigHour=!0}),et("hmmss",function(t,e,i){var o=t.length-4,n=t.length-2;e[en]=_(t.substr(0,o)),e[on]=_(t.substr(o,2)),e[nn]=_(t.substr(n)),p(i).bigHour=!0}),et("Hmm",function(t,e,i){var o=t.length-2;e[en]=_(t.substr(0,o)),e[on]=_(t.substr(o))}),et("Hmmss",function(t,e,i){var o=t.length-4,n=t.length-2;e[en]=_(t.substr(0,o)),e[on]=_(t.substr(o,2)),e[nn]=_(t.substr(n))});var wn,xn=/[ap]\.?m?\.?/i,Dn=j("Hours",!0),Sn={calendar:wo,longDateFormat:xo,invalidDate:Do,ordinal:So,ordinalParse:ko,relativeTime:Co,months:dn,monthsShort:ln,week:mn,weekdays:fn,weekdaysMin:vn,weekdaysShort:gn,meridiemParse:xn},kn={},Cn=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Tn=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,On=/Z|[+-]\d\d(?::?\d\d)?/,Mn=[["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}/]],En=[["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/]],Pn=/^\/?Date\((\-?\d+)/i;e.createFromInputFallback=D("value provided is not in a recognized ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non 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(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),e.ISO_8601=function(){};var An=D("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=ye.apply(null,arguments);return this.isValid()&&t.isValid()?tthis?this:t:m()}),In=function(){return Date.now?Date.now():+new Date};ke("Z",":"),ke("ZZ",""),J("Z",qo),J("ZZ",qo),et(["Z","ZZ"],function(t,e,i){i._useUTC=!0,i._tzm=Ce(qo,t)});var Rn=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var Ln=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Fn=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;je.fn=xe.prototype;var Hn=Ue(1,"add"),Yn=Ue(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var jn=D("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});B(0,["gg",2],0,function(){return this.weekYear()%100}),B(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Si("gggg","weekYear"),Si("ggggg","weekYear"),Si("GGGG","isoWeekYear"),Si("GGGGG","isoWeekYear"),R("weekYear","gg"),R("isoWeekYear","GG"),H("weekYear",1),H("isoWeekYear",1),J("G",Vo),J("g",Vo),J("GG",Ho,Io),J("gg",Ho,Io),J("GGGG",zo,Lo),J("gggg",zo,Lo),J("GGGGG",Wo,Fo),J("ggggg",Wo,Fo),it(["gggg","ggggg","GGGG","GGGGG"],function(t,e,i,o){e[o.substr(0,2)]=_(t)}),it(["gg","GG"],function(t,i,o,n){i[n]=e.parseTwoDigitYear(t)}),B("Q",0,"Qo","quarter"),R("quarter","Q"),H("quarter",7),J("Q",No),et("Q",function(t,e){e[$o]=3*(_(t)-1)}),B("D",["DD",2],"Do","date"),R("date","D"),H("date",9),J("D",Ho),J("DD",Ho,Io),J("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),et(["D","DD"],tn),et("Do",function(t,e){e[tn]=_(t.match(Ho)[0],10)});var Gn=j("Date",!0);B("DDD",["DDDD",3],"DDDo","dayOfYear"),R("dayOfYear","DDD"),H("dayOfYear",4),J("DDD",Go),J("DDDD",Ro),et(["DDD","DDDD"],function(t,e,i){i._dayOfYear=_(t)}),B("m",["mm",2],0,"minute"),R("minute","m"),H("minute",14),J("m",Ho),J("mm",Ho,Io),et(["m","mm"],on);var zn=j("Minutes",!1);B("s",["ss",2],0,"second"),R("second","s"),H("second",15),J("s",Ho),J("ss",Ho,Io),et(["s","ss"],nn);var Wn=j("Seconds",!1);B("S",0,0,function(){return~~(this.millisecond()/100)}),B(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),B(0,["SSS",3],0,"millisecond"),B(0,["SSSS",4],0,function(){return 10*this.millisecond()}),B(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),B(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),B(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),B(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),B(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),R("millisecond","ms"),H("millisecond",16),J("S",Go,No),J("SS",Go,Io),J("SSS",Go,Ro);var Un;for(Un="SSSS";Un.length<=9;Un+="S")J(Un,Uo);for(Un="S";Un.length<=9;Un+="S")et(Un,Ni);var Vn=j("Milliseconds",!1);B("z",0,0,"zoneAbbr"),B("zz",0,0,"zoneName");var Bn=v.prototype;Bn.add=Hn,Bn.calendar=qe,Bn.clone=Xe,Bn.diff=ei,Bn.endOf=ci,Bn.format=si,Bn.from=ri,Bn.fromNow=ai,Bn.to=hi,Bn.toNow=di,Bn.get=W,Bn.invalidAt=xi,Bn.isAfter=Ze,Bn.isBefore=Ke,Bn.isBetween=Je,Bn.isSame=Qe,Bn.isSameOrAfter=$e,Bn.isSameOrBefore=ti,Bn.isValid=_i,Bn.lang=jn,Bn.locale=li,Bn.localeData=ui,Bn.max=Nn,Bn.min=An,Bn.parsingFlags=wi,Bn.set=U,Bn.startOf=pi,Bn.subtract=Yn,Bn.toArray=vi,Bn.toObject=yi,Bn.toDate=gi,Bn.toISOString=ni,Bn.toJSON=bi,Bn.toString=oi,Bn.unix=fi,Bn.valueOf=mi,Bn.creationData=Di,Bn.year=cn,Bn.isLeapYear=vt,Bn.weekYear=ki,Bn.isoWeekYear=Ci,Bn.quarter=Bn.quarters=Pi,Bn.month=lt,Bn.daysInMonth=ut,Bn.week=Bn.weeks=Tt,Bn.isoWeek=Bn.isoWeeks=Ot,Bn.weeksInYear=Oi,Bn.isoWeeksInYear=Ti,Bn.date=Gn,Bn.day=Bn.days=Lt,Bn.weekday=Ft,Bn.isoWeekday=Ht,Bn.dayOfYear=Ai,Bn.hour=Bn.hours=Dn,Bn.minute=Bn.minutes=zn,Bn.second=Bn.seconds=Wn,Bn.millisecond=Bn.milliseconds=Vn,Bn.utcOffset=Me,Bn.utc=Pe,Bn.local=Ae,Bn.parseZone=Ne,Bn.hasAlignedHourOffset=Ie,Bn.isDST=Re,Bn.isLocal=Fe,Bn.isUtcOffset=He,Bn.isUtc=Ye,Bn.isUTC=Ye,Bn.zoneAbbr=Ii,Bn.zoneName=Ri,Bn.dates=D("dates accessor is deprecated. Use date instead.",Gn),Bn.months=D("months accessor is deprecated. Use month instead",lt),Bn.years=D("years accessor is deprecated. Use year instead",cn),Bn.zone=D("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Ee),Bn.isDSTShifted=D("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Le);var qn=Bn,Xn=O.prototype;Xn.calendar=M,Xn.longDateFormat=E,Xn.invalidDate=P,Xn.ordinal=A,Xn.preparse=Hi,Xn.postformat=Hi,Xn.relativeTime=N,Xn.pastFuture=I,Xn.set=C,Xn.months=st,Xn.monthsShort=rt,Xn.monthsParse=ht,Xn.monthsRegex=ct,Xn.monthsShortRegex=pt,Xn.week=St,Xn.firstDayOfYear=Ct,Xn.firstDayOfWeek=kt,Xn.weekdays=Pt,Xn.weekdaysMin=Nt,Xn.weekdaysShort=At,Xn.weekdaysParse=Rt,Xn.weekdaysRegex=Yt,Xn.weekdaysShortRegex=jt,Xn.weekdaysMinRegex=Gt,Xn.isPM=qt,Xn.meridiem=Xt,Qt("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,i=1===_(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+i}}),e.lang=D("moment.lang is deprecated. Use moment.locale instead.",Qt),e.langData=D("moment.langData is deprecated. Use moment.localeData instead.",ee);var Zn=Math.abs,Kn=oo("ms"),Jn=oo("s"),Qn=oo("m"),$n=oo("h"),ts=oo("d"),es=oo("w"),is=oo("M"),os=oo("y"),ns=so("milliseconds"),ss=so("seconds"),rs=so("minutes"),as=so("hours"),hs=so("days"),ds=so("months"),ls=so("years"),us=Math.round,ps={s:45,m:45,h:22,d:26,M:11},cs=Math.abs,ms=xe.prototype;ms.abs=qi,ms.add=Zi,ms.subtract=Ki,ms.as=eo,ms.asMilliseconds=Kn,ms.asSeconds=Jn,ms.asMinutes=Qn,ms.asHours=$n,ms.asDays=ts,ms.asWeeks=es,ms.asMonths=is,ms.asYears=os,ms.valueOf=io,ms._bubble=Qi,ms.get=no,ms.milliseconds=ns,ms.seconds=ss,ms.minutes=rs,ms.hours=as,ms.days=hs,ms.weeks=ro,ms.months=ds,ms.years=ls,ms.humanize=po,ms.toISOString=co,ms.toString=co,ms.toJSON=co,ms.locale=li,ms.localeData=ui,ms.toIsoString=D("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",co),ms.lang=jn,B("X",0,0,"unix"),B("x",0,0,"valueOf"),J("x",Vo),J("X",Xo),et("X",function(t,e,i){i._d=new Date(1e3*parseFloat(t,10))}),et("x",function(t,e,i){i._d=new Date(_(t))}),e.version="2.15.2",i(ye),e.fn=qn,e.min=_e,e.max=we,e.now=In,e.utc=l,e.unix=Li,e.months=zi,e.isDate=r,e.locale=Qt,e.invalid=m,e.duration=je,e.isMoment=y,e.weekdays=Ui,e.parseZone=Fi,e.localeData=ee,e.isDuration=De,e.monthsShort=Wi,e.weekdaysMin=Bi,e.defineLocale=$t,e.updateLocale=te,e.locales=ie,e.weekdaysShort=Vi,e.normalizeUnits=L,e.relativeTimeRounding=lo,e.relativeTimeThreshold=uo,e.calendarFormat=Be,e.prototype=qn;var fs=e;return fs})}).call(e,i(4)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e){function i(t){throw new Error("Cannot find module '"+t+"'.")}i.keys=function(){return[]},i.resolve=i,t.exports=i,i.id=5},function(t,e){(function(e){function i(t,e,i){var o=e&&i||0,n=0;for(e=e||[],t.toLowerCase().replace(/[0-9a-f]{2}/g,function(t){n<16&&(e[o+n++]=u[t])});n<16;)e[o+n++]=0;return e}function o(t,e){var i=e||0,o=l;return o[t[i++]]+o[t[i++]]+o[t[i++]]+o[t[i++]]+"-"+o[t[i++]]+o[t[i++]]+"-"+o[t[i++]]+o[t[i++]]+"-"+o[t[i++]]+o[t[i++]]+"-"+o[t[i++]]+o[t[i++]]+o[t[i++]]+o[t[i++]]+o[t[i++]]+o[t[i++]]}function n(t,e,i){var n=e&&i||0,s=e||[];t=t||{};var r=void 0!==t.clockseq?t.clockseq:f,a=void 0!==t.msecs?t.msecs:(new Date).getTime(),h=void 0!==t.nsecs?t.nsecs:v+1,d=a-g+(h-v)/1e4;if(d<0&&void 0===t.clockseq&&(r=r+1&16383),(d<0||a>g)&&void 0===t.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");g=a,v=h,f=r,a+=122192928e5;var l=(1e4*(268435455&a)+h)%4294967296;s[n++]=l>>>24&255,s[n++]=l>>>16&255,s[n++]=l>>>8&255,s[n++]=255&l; -var u=a/4294967296*1e4&268435455;s[n++]=u>>>8&255,s[n++]=255&u,s[n++]=u>>>24&15|16,s[n++]=u>>>16&255,s[n++]=r>>>8|128,s[n++]=255&r;for(var p=t.node||m,c=0;c<6;c++)s[n+c]=p[c];return e?e:o(s)}function s(t,e,i){var n=e&&i||0;"string"==typeof t&&(e="binary"==t?new Array(16):null,t=null),t=t||{};var s=t.random||(t.rng||r)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,e)for(var a=0;a<16;a++)e[n+a]=s[a];return e||o(s)}var r,a="undefined"!=typeof window?window:"undefined"!=typeof e?e:null;if(a&&a.crypto&&crypto.getRandomValues){var h=new Uint8Array(16);r=function(){return crypto.getRandomValues(h),h}}if(!r){var d=new Array(16);r=function(){for(var t,e=0;e<16;e++)0===(3&e)&&(t=4294967296*Math.random()),d[e]=t>>>((3&e)<<3)&255;return d}}for(var l=[],u={},p=0;p<256;p++)l[p]=(p+256).toString(16).substr(1),u[l[p]]=p;var c=r(),m=[1|c[0],c[1],c[2],c[3],c[4],c[5]],f=16383&(c[6]<<8|c[7]),g=0,v=0,y=s;y.v1=n,y.v4=s,y.parse=i,y.unparse=o,t.exports=y}).call(e,function(){return this}())},function(t,e){e.prepareElements=function(t){for(var e in t)t.hasOwnProperty(e)&&(t[e].redundant=t[e].used,t[e].used=[])},e.cleanupElements=function(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e].redundant){for(var i=0;i0?(o=e[t].redundant[0],e[t].redundant.shift()):(o=document.createElementNS("http://www.w3.org/2000/svg",t),i.appendChild(o)):(o=document.createElementNS("http://www.w3.org/2000/svg",t),e[t]={used:[],redundant:[]},i.appendChild(o)),e[t].used.push(o),o},e.getDOMElement=function(t,e,i,o){var n;return e.hasOwnProperty(t)?e[t].redundant.length>0?(n=e[t].redundant[0],e[t].redundant.shift()):(n=document.createElement(t),void 0!==o?i.insertBefore(n,o):i.appendChild(n)):(n=document.createElement(t),e[t]={used:[],redundant:[]},void 0!==o?i.insertBefore(n,o):i.appendChild(n)),e[t].used.push(n),n},e.drawPoint=function(t,i,o,n,s,r){var a;if("circle"==o.style?(a=e.getSVGElement("circle",n,s),a.setAttributeNS(null,"cx",t),a.setAttributeNS(null,"cy",i),a.setAttributeNS(null,"r",.5*o.size)):(a=e.getSVGElement("rect",n,s),a.setAttributeNS(null,"x",t-.5*o.size),a.setAttributeNS(null,"y",i-.5*o.size),a.setAttributeNS(null,"width",o.size),a.setAttributeNS(null,"height",o.size)),void 0!==o.styles&&a.setAttributeNS(null,"style",o.styles),a.setAttributeNS(null,"class",o.className+" vis-point"),r){var h=e.getSVGElement("text",n,s);r.xOffset&&(t+=r.xOffset),r.yOffset&&(i+=r.yOffset),r.content&&(h.textContent=r.content),r.className&&h.setAttributeNS(null,"class",r.className+" vis-label"),h.setAttributeNS(null,"x",t),h.setAttributeNS(null,"y",i)}return a},e.drawBar=function(t,i,o,n,s,r,a,h){if(0!=n){n<0&&(n*=-1,i-=n);var d=e.getSVGElement("rect",r,a);d.setAttributeNS(null,"x",t-.5*o),d.setAttributeNS(null,"y",i),d.setAttributeNS(null,"width",o),d.setAttributeNS(null,"height",n),d.setAttributeNS(null,"class",s),h&&d.setAttributeNS(null,"style",h)}}},function(t,e,i){function o(t,e){if(t&&!Array.isArray(t)&&(e=t,t=null),this._options=e||{},this._data={},this.length=0,this._fieldId=this._options.fieldId||"id",this._type={},this._options.type)for(var i=Object.keys(this._options.type),o=0,n=i.length;on?1:or)&&(s=h,r=d)}return s},o.prototype.min=function(t){var e,i,o=this._data,n=Object.keys(o),s=null,r=null;for(e=0,i=n.length;ethis.max&&this.flush(),clearTimeout(this._timeout),this.queue.length>0&&"number"==typeof this.delay){var t=this;this._timeout=setTimeout(function(){t.flush()},this.delay)}},i.prototype.flush=function(){for(;this._queue.length>0;){var t=this._queue.shift();t.fn.apply(t.context||t.fn,t.args||[])}},t.exports=i},function(t,e,i){function o(t,e){this._data=null,this._ids={},this.length=0,this._options=e||{},this._fieldId="id",this._subscribers={};var i=this;this.listener=function(){i._onEvent.apply(i,arguments)},this.setData(t)}var n=i(1),s=i(8);o.prototype.setData=function(t){var e,i,o,n,s;if(this._data){for(this._data.off&&this._data.off("*",this.listener),e=this._data.getIds({filter:this._options&&this._options.filter}),s=[],o=0,n=e.length;os)&&(s=i)}),null!==n&&null!==s){var r=(n+s)/2,a=Math.max(this.range.end-this.range.start,1.1*(s-n)),h=!e||void 0===e.animation||e.animation;this.range.setRange(r-a/2,r+a/2,h)}}},n.prototype.fit=function(t){var e,i=!t||void 0===t.animation||t.animation,o=this.itemsData&&this.itemsData.getDataSet();1===o.length&&void 0===o.get()[0].end?(e=this.getDataRange(),this.moveTo(e.min.valueOf(),{animation:i})):(e=this.getItemRange(),this.range.setRange(e.min,e.max,i))},n.prototype.getItemRange=function(){var t=this,e=this.getDataRange(),i=null!==e.min?e.min.valueOf():null,o=null!==e.max?e.max.valueOf():null,n=null,s=null;if(null!=i&&null!=o){var r,a,h,d,u;!function(){var e=function(t){return l.convert(t.data.start,"Date").valueOf()},p=function(t){var e=void 0!=t.data.end?t.data.end:t.data.start;return l.convert(e,"Date").valueOf()};r=o-i,r<=0&&(r=10),a=r/t.props.center.width,l.forEach(t.itemSet.items,function(t){t.show(),t.repositionX();var r=e(t),h=p(t);if(this.options.rtl)var d=r-(t.getWidthRight()+10)*a,l=h+(t.getWidthLeft()+10)*a;else var d=r-(t.getWidthLeft()+10)*a,l=h+(t.getWidthRight()+10)*a;do&&(o=l,s=t)}.bind(t)),n&&s&&(h=n.getWidthLeft()+10,d=s.getWidthRight()+10,u=t.props.center.width-h-d,u>0&&(t.options.rtl?(i=e(n)-d*r/u,o=p(s)+h*r/u):(i=e(n)-h*r/u,o=p(s)+d*r/u)))}()}return{min:null!=i?new Date(i):null,max:null!=o?new Date(o):null}},n.prototype.getDataRange=function(){var t=null,e=null,i=this.itemsData&&this.itemsData.getDataSet();return i&&i.forEach(function(i){var o=l.convert(i.start,"Date").valueOf(),n=l.convert(void 0!=i.end?i.end:i.start,"Date").valueOf();(null===t||oe)&&(e=n)}),{min:null!=t?new Date(t):null,max:null!=e?new Date(e):null}},n.prototype.getEventProperties=function(t){var e=t.center?t.center.x:t.clientX,i=t.center?t.center.y:t.clientY;if(this.options.rtl)var o=l.getAbsoluteRight(this.dom.centerContainer)-e;else var o=e-l.getAbsoluteLeft(this.dom.centerContainer);var n=i-l.getAbsoluteTop(this.dom.centerContainer),s=this.itemSet.itemFromTarget(t),r=this.itemSet.groupFromTarget(t),a=v.customTimeFromTarget(t),h=this.itemSet.options.snap||null,d=this.body.util.getScale(),u=this.body.util.getStep(),p=this._toTime(o),c=h?h(p,d,u):p,m=l.getTarget(t),f=null;return null!=s?f="item":null!=a?f="custom-time":l.hasParent(m,this.timeAxis.dom.foreground)?f="axis":this.timeAxis2&&l.hasParent(m,this.timeAxis2.dom.foreground)?f="axis":l.hasParent(m,this.itemSet.dom.labelSet)?f="group-label":l.hasParent(m,this.currentTime.bar)?f="current-time":l.hasParent(m,this.dom.center)&&(f="background"),{event:t,item:s?s.id:null,group:r?r.groupId:null,what:f,pageX:t.srcEvent?t.srcEvent.pageX:t.pageX,pageY:t.srcEvent?t.srcEvent.pageY:t.pageY,x:o,y:n,time:p,snappedTime:c}},t.exports=n},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(){function t(t,e){for(var i=0;i3&&void 0!==arguments[3]?arguments[3]:1;n(this,t),this.parent=e,this.changedOptions=[],this.container=i,this.allowCreation=!1,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},d.extend(this.options,this.defaultOptions),this.configureOptions=o,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new h.default(s),this.wrapper=void 0}return r(t,[{key:"setOptions",value:function(t){if(void 0!==t){this.popupHistory={},this._removePopup();var e=!0;"string"==typeof t?this.options.filter=t:t instanceof Array?this.options.filter=t.join():"object"===("undefined"==typeof t?"undefined":s(t))?(void 0!==t.container&&(this.options.container=t.container),void 0!==t.filter&&(this.options.filter=t.filter),void 0!==t.showButton&&(this.options.showButton=t.showButton),void 0!==t.enabled&&(e=t.enabled)):"boolean"==typeof t?(this.options.filter=!0,e=t):"function"==typeof t&&(this.options.filter=t,e=!0),this.options.filter===!1&&(e=!1),this.options.enabled=e}this._clean()}},{key:"setModuleOptions",value:function(t){this.moduleOptions=t,this.options.enabled===!0&&(this._clean(),void 0!==this.options.container&&(this.container=this.options.container),this._create())}},{key:"_create",value:function(){var t=this;this._clean(),this.changedOptions=[];var e=this.options.filter,i=0,o=!1;for(var n in this.configureOptions)this.configureOptions.hasOwnProperty(n)&&(this.allowCreation=!1,o=!1,"function"==typeof e?(o=e(n,[]),o=o||this._handleObject(this.configureOptions[n],[n],!0)):e!==!0&&e.indexOf(n)===-1||(o=!0),o!==!1&&(this.allowCreation=!0,i>0&&this._makeItem([]),this._makeHeader(n),this._handleObject(this.configureOptions[n],[n])),i++);this.options.showButton===!0&&!function(){var e=document.createElement("div");e.className="vis-configuration vis-config-button",e.innerHTML="generate options",e.onclick=function(){t._printOptions()},e.onmouseover=function(){e.className="vis-configuration vis-config-button hover"},e.onmouseout=function(){e.className="vis-configuration vis-config-button"},t.optionsContainer=document.createElement("div"),t.optionsContainer.className="vis-configuration vis-config-option-container",t.domElements.push(t.optionsContainer),t.domElements.push(e)}(),this._push()}},{key:"_push",value:function(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(var t=0;t1?o-1:0),r=1;r2&&void 0!==arguments[2]&&arguments[2],o=document.createElement("div");return o.className="vis-configuration vis-config-label vis-config-s"+e.length,i===!0?o.innerHTML=""+t+":":o.innerHTML=t+":",o}},{key:"_makeDropdown",value:function(t,e,i){var o=document.createElement("select");o.className="vis-configuration vis-config-select";var n=0;void 0!==e&&t.indexOf(e)!==-1&&(n=t.indexOf(e));for(var s=0;ss&&1!==s&&(a.max=Math.ceil(e*l),d=a.max,h="range increased"),a.value=e}else a.value=o;var u=document.createElement("input");u.className="vis-configuration vis-config-rangeinput",u.value=a.value;var p=this;a.onchange=function(){u.value=this.value,p._update(Number(this.value),i)},a.oninput=function(){u.value=this.value};var c=this._makeLabel(i[i.length-1],i),m=this._makeItem(i,c,a,u);""!==h&&this.popupHistory[m]!==d&&(this.popupHistory[m]=d,this._setupPopup(h,m))}},{key:"_setupPopup",value:function(t,e){var i=this;if(this.initialized===!0&&this.allowCreation===!0&&this.popupCounter1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=!1,n=this.options.filter,s=!1;for(var r in t)if(t.hasOwnProperty(r)){o=!0;var a=t[r],h=d.copyAndExtendArray(e,r);if("function"==typeof n&&(o=n(r,e),o===!1&&!(a instanceof Array)&&"string"!=typeof a&&"boolean"!=typeof a&&a instanceof Object&&(this.allowCreation=!1,o=this._handleObject(a,h,!0),this.allowCreation=i===!1)),o!==!1){s=!0;var l=this._getValue(h);if(a instanceof Array)this._handleArray(a,l,h);else if("string"==typeof a)this._makeTextInput(a,l,h);else if("boolean"==typeof a)this._makeCheckbox(a,l,h);else if(a instanceof Object){var u=!0;if(e.indexOf("physics")!==-1&&this.moduleOptions.physics.solver!==r&&(u=!1),u===!0)if(void 0!==a.enabled){var p=d.copyAndExtendArray(h,"enabled"),c=this._getValue(p);if(c===!0){var m=this._makeLabel(r,h,!0);this._makeItem(h,m),s=this._handleObject(a,h)||s}else this._makeCheckbox(a,c,h)}else{var f=this._makeLabel(r,h,!0);this._makeItem(h,f),s=this._handleObject(a,h)||s}}else console.error("dont know how to handle",a,r,h)}}return s}},{key:"_handleArray",value:function(t,e,i){"string"==typeof t[0]&&"color"===t[0]?(this._makeColorField(t,e,i),t[1]!==e&&this.changedOptions.push({path:i,value:e})):"string"==typeof t[0]?(this._makeDropdown(t,e,i),t[0]!==e&&this.changedOptions.push({ -path:i,value:e})):"number"==typeof t[0]&&(this._makeRange(t,e,i),t[0]!==e&&this.changedOptions.push({path:i,value:Number(e)}))}},{key:"_update",value:function(t,e){var i=this._constructOptions(t,e);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(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=i;t="true"===t||t,t="false"!==t&&t;for(var n=0;nvar options = "+JSON.stringify(t,null,2)+""}},{key:"getOptions",value:function(){for(var t={},e=0;e0&&void 0!==arguments[0]?arguments[0]:1;o(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 n(t,[{key:"insertTo",value:function(t){void 0!==this.hammer&&(this.hammer.destroy(),this.hammer=void 0),this.container=t,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}},{key:"setUpdateCallback",value:function(t){if("function"!=typeof t)throw new Error("Function attempted to set as colorPicker update callback is not a function.");this.updateCallback=t}},{key:"setCloseCallback",value:function(t){if("function"!=typeof t)throw new Error("Function attempted to set as colorPicker closing callback is not a function.");this.closeCallback=t}},{key:"_isColorString",value:function(t){var e={black:"#000000",navy:"#000080",darkblue:"#00008B",mediumblue:"#0000CD",blue:"#0000FF",darkgreen:"#006400",green:"#008000",teal:"#008080",darkcyan:"#008B8B",deepskyblue:"#00BFFF",darkturquoise:"#00CED1",mediumspringgreen:"#00FA9A",lime:"#00FF00",springgreen:"#00FF7F",aqua:"#00FFFF",cyan:"#00FFFF",midnightblue:"#191970",dodgerblue:"#1E90FF",lightseagreen:"#20B2AA",forestgreen:"#228B22",seagreen:"#2E8B57",darkslategray:"#2F4F4F",limegreen:"#32CD32",mediumseagreen:"#3CB371",turquoise:"#40E0D0",royalblue:"#4169E1",steelblue:"#4682B4",darkslateblue:"#483D8B",mediumturquoise:"#48D1CC",indigo:"#4B0082",darkolivegreen:"#556B2F",cadetblue:"#5F9EA0",cornflowerblue:"#6495ED",mediumaquamarine:"#66CDAA",dimgray:"#696969",slateblue:"#6A5ACD",olivedrab:"#6B8E23",slategray:"#708090",lightslategray:"#778899",mediumslateblue:"#7B68EE",lawngreen:"#7CFC00",chartreuse:"#7FFF00",aquamarine:"#7FFFD4",maroon:"#800000",purple:"#800080",olive:"#808000",gray:"#808080",skyblue:"#87CEEB",lightskyblue:"#87CEFA",blueviolet:"#8A2BE2",darkred:"#8B0000",darkmagenta:"#8B008B",saddlebrown:"#8B4513",darkseagreen:"#8FBC8F",lightgreen:"#90EE90",mediumpurple:"#9370D8",darkviolet:"#9400D3",palegreen:"#98FB98",darkorchid:"#9932CC",yellowgreen:"#9ACD32",sienna:"#A0522D",brown:"#A52A2A",darkgray:"#A9A9A9",lightblue:"#ADD8E6",greenyellow:"#ADFF2F",paleturquoise:"#AFEEEE",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",firebrick:"#B22222",darkgoldenrod:"#B8860B",mediumorchid:"#BA55D3",rosybrown:"#BC8F8F",darkkhaki:"#BDB76B",silver:"#C0C0C0",mediumvioletred:"#C71585",indianred:"#CD5C5C",peru:"#CD853F",chocolate:"#D2691E",tan:"#D2B48C",lightgrey:"#D3D3D3",palevioletred:"#D87093",thistle:"#D8BFD8",orchid:"#DA70D6",goldenrod:"#DAA520",crimson:"#DC143C",gainsboro:"#DCDCDC",plum:"#DDA0DD",burlywood:"#DEB887",lightcyan:"#E0FFFF",lavender:"#E6E6FA",darksalmon:"#E9967A",violet:"#EE82EE",palegoldenrod:"#EEE8AA",lightcoral:"#F08080",khaki:"#F0E68C",aliceblue:"#F0F8FF",honeydew:"#F0FFF0",azure:"#F0FFFF",sandybrown:"#F4A460",wheat:"#F5DEB3",beige:"#F5F5DC",whitesmoke:"#F5F5F5",mintcream:"#F5FFFA",ghostwhite:"#F8F8FF",salmon:"#FA8072",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lightgoldenrodyellow:"#FAFAD2",oldlace:"#FDF5E6",red:"#FF0000",fuchsia:"#FF00FF",magenta:"#FF00FF",deeppink:"#FF1493",orangered:"#FF4500",tomato:"#FF6347",hotpink:"#FF69B4",coral:"#FF7F50",darkorange:"#FF8C00",lightsalmon:"#FFA07A",orange:"#FFA500",lightpink:"#FFB6C1",pink:"#FFC0CB",gold:"#FFD700",peachpuff:"#FFDAB9",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",mistyrose:"#FFE4E1",blanchedalmond:"#FFEBCD",papayawhip:"#FFEFD5",lavenderblush:"#FFF0F5",seashell:"#FFF5EE",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",floralwhite:"#FFFAF0",snow:"#FFFAFA",yellow:"#FFFF00",lightyellow:"#FFFFE0",ivory:"#FFFFF0",white:"#FFFFFF"};if("string"==typeof t)return e[t]}},{key:"setColor",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("none"!==t){var i=void 0,o=this._isColorString(t);if(void 0!==o&&(t=o),a.isString(t)===!0){if(a.isValidRGB(t)===!0){var n=t.substr(4).substr(0,t.length-5).split(",");i={r:n[0],g:n[1],b:n[2],a:1}}else if(a.isValidRGBA(t)===!0){var s=t.substr(5).substr(0,t.length-6).split(",");i={r:s[0],g:s[1],b:s[2],a:s[3]}}else if(a.isValidHex(t)===!0){var r=a.hexToRGB(t);i={r:r.r,g:r.g,b:r.b,a:1}}}else if(t instanceof Object&&void 0!==t.r&&void 0!==t.g&&void 0!==t.b){var h=void 0!==t.a?t.a:"1.0";i={r:t.r,g:t.g,b:t.b,a:h}}if(void 0===i)throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: "+JSON.stringify(t));this._setColor(i,e)}}},{key:"show",value:function(){void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}},{key:"_hide",value:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e===!0&&(this.previousColor=a.extend({},this.color)),this.applied===!0&&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(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e===!0&&(this.initialColor=a.extend({},t)),this.color=t;var i=a.RGBToHSV(t.r,t.g,t.b),o=2*Math.PI,n=this.r*i.s,s=this.centerCoordinates.x+n*Math.sin(o*i.h),r=this.centerCoordinates.y+n*Math.cos(o*i.h);this.colorPickerSelector.style.left=s-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=r-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(t)}},{key:"_setOpacity",value:function(t){this.color.a=t/100,this._updatePicker(this.color)}},{key:"_setBrightness",value:function(t){var e=a.RGBToHSV(this.color.r,this.color.g,this.color.b);e.v=t/100;var i=a.HSVToRGB(e.h,e.s,e.v);i.a=this.color.a,this.color=i,this._updatePicker()}},{key:"_updatePicker",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color,e=a.RGBToHSV(t.r,t.g,t.b),i=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1)),i.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var o=this.colorPickerCanvas.clientWidth,n=this.colorPickerCanvas.clientHeight;i.clearRect(0,0,o,n),i.putImageData(this.hueCircle,0,0),i.fillStyle="rgba(0,0,0,"+(1-e.v)+")",i.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),i.fill(),this.brightnessRange.value=100*e.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 t=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}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.colorPickerCanvas.appendChild(e)}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(t){}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(t){}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 s(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),r.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(this.generated===!1){var t=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)),t.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var e=this.colorPickerCanvas.clientWidth,i=this.colorPickerCanvas.clientHeight;t.clearRect(0,0,e,i);var o=void 0,n=void 0,s=void 0,r=void 0;this.centerCoordinates={x:.5*e,y:.5*i},this.r=.49*e;var h=2*Math.PI/360,d=1/360,l=1/this.r,u=void 0;for(s=0;s<360;s++)for(r=0;r0?d._handlers[t]=o:(i.off(t,s),delete d._handlers[t]))}),d},d.emit=function(e,o){t=o.target,i.emit(e,o)},d.destroy=function(){var t=i.element.hammer,e=t.indexOf(d);e!==-1&&t.splice(e,1),t.length||delete i.element.hammer,d._handlers={},i.destroy()},d}})},function(t,e,i){var o;/*! Hammer.JS - v2.0.7 - 2016-04-22 +"use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.vis=e():t.vis=e()}(this,function(){return function(t){function e(o){if(i[o])return i[o].exports;var n=i[o]={exports:{},id:o,loaded:!1};return t[o].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){e.util=i(1),e.DOMutil=i(89),e.DataSet=i(90),e.DataView=i(92),e.Queue=i(91),e.Timeline=i(93),e.Graph2d=i(129),e.timeline={Core:i(110),DateUtil:i(109),Range:i(107),stack:i(115),TimeStep:i(113),components:{items:{Item:i(117),BackgroundItem:i(121),BoxItem:i(119),PointItem:i(120),RangeItem:i(116)},BackgroundGroup:i(118),Component:i(108),CurrentTime:i(127),CustomTime:i(125),DataAxis:i(131),DataScale:i(132),GraphGroup:i(133),Group:i(114),ItemSet:i(111),Legend:i(137),LineGraph:i(130),TimeAxis:i(122)}},e.moment=i(84),e.Hammer=i(101),e.keycharm=i(124)},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}var n=i(2),s=o(n),r=i(55),a=o(r),h=i(58),d=o(h),l=i(62),u=o(l),p=i(82),c=o(p),f=i(84),m=i(88);e.isNumber=function(t){return t instanceof Number||"number"==typeof t},e.elementsCensor=function(t){if(t){var e=function(t,e){return e instanceof Element?"DOM Element":e};return JSON.parse((0,c.default)(t,e))}},e.recursiveDOMDelete=function(t){if(t)for(;t.hasChildNodes()===!0;)e.recursiveDOMDelete(t.firstChild),t.removeChild(t.firstChild)},e.giveRange=function(t,e,i,o){if(e==t)return.5;var n=1/(e-t);return Math.max(0,(o-t)*n)},e.isString=function(t){return t instanceof String||"string"==typeof t},e.isDate=function(t){if(t instanceof Date)return!0;if(e.isString(t)){var i=g.exec(t);if(i)return!0;if(!isNaN(Date.parse(t)))return!0}return!1},e.randomUUID=function(){return m.v4()},e.assignAllKeys=function(t,e){for(var i in t)t.hasOwnProperty(i)&&"object"!==(0,u.default)(t[i])&&(t[i]=e)},e.fillIfDefined=function(t,i){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(var n in t)void 0!==i[n]&&("object"!==(0,u.default)(i[n])?void 0!==i[n]&&null!==i[n]||void 0===t[n]||o!==!0?t[n]=i[n]:delete t[n]:"object"===(0,u.default)(t[n])&&e.fillIfDefined(t[n],i[n],o))},e.protoExtend=function(t,e){for(var i=1;i3&&void 0!==arguments[3]&&arguments[3];if(Array.isArray(o))throw new TypeError("Arrays are not supported by deepExtend");for(var s=2;s3&&void 0!==arguments[3]&&arguments[3];if(Array.isArray(o))throw new TypeError("Arrays are not supported by deepExtend");for(var s in o)if(o.hasOwnProperty(s)&&t.indexOf(s)==-1)if(o[s]&&o[s].constructor===Object)void 0===i[s]&&(i[s]={}),i[s].constructor===Object?e.deepExtend(i[s],o[s]):null===o[s]&&void 0!==i[s]&&n===!0?delete i[s]:i[s]=o[s];else if(Array.isArray(o[s])){i[s]=[];for(var r=0;r=0&&(e="DOMMouseScroll"),t.addEventListener(e,i,o)):t.attachEvent("on"+e,i)},e.removeEventListener=function(t,e,i,o){t.removeEventListener?(void 0===o&&(o=!1),"mousewheel"===e&&navigator.userAgent.indexOf("Firefox")>=0&&(e="DOMMouseScroll"),t.removeEventListener(e,i,o)):t.detachEvent("on"+e,i)},e.preventDefault=function(t){t||(t=window.event),t.preventDefault?t.preventDefault():t.returnValue=!1},e.getTarget=function(t){t||(t=window.event);var e;return t.target?e=t.target:t.srcElement&&(e=t.srcElement),void 0!=e.nodeType&&3==e.nodeType&&(e=e.parentNode),e},e.hasParent=function(t,e){for(var i=t;i;){if(i===e)return!0;i=i.parentNode}return!1},e.option={},e.option.asBoolean=function(t,e){return"function"==typeof t&&(t=t()),null!=t?0!=t:e||null},e.option.asNumber=function(t,e){return"function"==typeof t&&(t=t()),null!=t?Number(t)||e||null:e||null},e.option.asString=function(t,e){return"function"==typeof t&&(t=t()),null!=t?String(t):e||null},e.option.asSize=function(t,i){return"function"==typeof t&&(t=t()),e.isString(t)?t:e.isNumber(t)?t+"px":i||null},e.option.asElement=function(t,e){return"function"==typeof t&&(t=t()),t||e||null},e.hexToRGB=function(t){var e=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;t=t.replace(e,function(t,e,i,o){return e+e+i+i+o+o});var i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return i?{r:parseInt(i[1],16),g:parseInt(i[2],16),b:parseInt(i[3],16)}:null},e.overrideOpacity=function(t,i){if(t.indexOf("rgba")!=-1)return t;if(t.indexOf("rgb")!=-1){var o=t.substr(t.indexOf("(")+1).replace(")","").split(",");return"rgba("+o[0]+","+o[1]+","+o[2]+","+i+")"}var o=e.hexToRGB(t);return null==o?t:"rgba("+o.r+","+o.g+","+o.b+","+i+")"},e.RGBToHex=function(t,e,i){return"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1)},e.parseColor=function(t){var i;if(e.isString(t)===!0){if(e.isValidRGB(t)===!0){var o=t.substr(4).substr(0,t.length-5).split(",").map(function(t){return parseInt(t)});t=e.RGBToHex(o[0],o[1],o[2])}if(e.isValidHex(t)===!0){var n=e.hexToHSV(t),s={h:n.h,s:.8*n.s,v:Math.min(1,1.02*n.v)},r={h:n.h,s:Math.min(1,1.25*n.s),v:.8*n.v},a=e.HSVToHex(r.h,r.s,r.v),h=e.HSVToHex(s.h,s.s,s.v);i={background:t,border:a,highlight:{background:h,border:a},hover:{background:h,border:a}}}else i={background:t,border:t,highlight:{background:t,border:t},hover:{background:t,border:t}}}else i={},i.background=t.background||void 0,i.border=t.border||void 0,e.isString(t.highlight)?i.highlight={border:t.highlight,background:t.highlight}:(i.highlight={},i.highlight.background=t.highlight&&t.highlight.background||void 0,i.highlight.border=t.highlight&&t.highlight.border||void 0),e.isString(t.hover)?i.hover={border:t.hover,background:t.hover}:(i.hover={},i.hover.background=t.hover&&t.hover.background||void 0,i.hover.border=t.hover&&t.hover.border||void 0);return i},e.RGBToHSV=function(t,e,i){t/=255,e/=255,i/=255;var o=Math.min(t,Math.min(e,i)),n=Math.max(t,Math.max(e,i));if(o==n)return{h:0,s:0,v:o};var s=t==o?e-i:i==o?t-e:i-t,r=t==o?3:i==o?1:5,a=60*(r-s/(n-o))/360,h=(n-o)/n,d=n;return{h:a,s:h,v:d}};var v={split:function(t){var e={};return t.split(";").forEach(function(t){if(""!=t.trim()){var i=t.split(":"),o=i[0].trim(),n=i[1].trim();e[o]=n}}),e},join:function(t){return(0,d.default)(t).map(function(e){return e+": "+t[e]}).join("; ")}};e.addCssText=function(t,i){var o=v.split(t.style.cssText),n=v.split(i),s=e.extend(o,n);t.style.cssText=v.join(s)},e.removeCssText=function(t,e){var i=v.split(t.style.cssText),o=v.split(e);for(var n in o)o.hasOwnProperty(n)&&delete i[n];t.style.cssText=v.join(i)},e.HSVToRGB=function(t,e,i){var o,n,s,r=Math.floor(6*t),a=6*t-r,h=i*(1-e),d=i*(1-a*e),l=i*(1-(1-a)*e);switch(r%6){case 0:o=i,n=l,s=h;break;case 1:o=d,n=i,s=h;break;case 2:o=h,n=i,s=l;break;case 3:o=h,n=d,s=i;break;case 4:o=l,n=h,s=i;break;case 5:o=i,n=h,s=d}return{r:Math.floor(255*o),g:Math.floor(255*n),b:Math.floor(255*s)}},e.HSVToHex=function(t,i,o){var n=e.HSVToRGB(t,i,o);return e.RGBToHex(n.r,n.g,n.b)},e.hexToHSV=function(t){var i=e.hexToRGB(t);return e.RGBToHSV(i.r,i.g,i.b)},e.isValidHex=function(t){var e=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t);return e},e.isValidRGB=function(t){t=t.replace(" ","");var e=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/i.test(t);return e},e.isValidRGBA=function(t){t=t.replace(" ","");var e=/rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(.{1,3})\)/i.test(t);return e},e.selectiveBridgeObject=function(t,i){if("object"==("undefined"==typeof i?"undefined":(0,u.default)(i))){for(var o=(0,a.default)(i),n=0;n0&&e(o,t[n-1])<0;n--)t[n]=t[n-1];t[n]=o}return t},e.mergeOptions=function(t,e,i){var o=(arguments.length>3&&void 0!==arguments[3]&&arguments[3],arguments.length>4&&void 0!==arguments[4]?arguments[4]:{});if(null===e[i])t[i]=(0,a.default)(o[i]);else if(void 0!==e[i])if("boolean"==typeof e[i])t[i].enabled=e[i];else{void 0===e[i].enabled&&(t[i].enabled=!0);for(var n in e[i])e[i].hasOwnProperty(n)&&(t[i][n]=e[i][n])}},e.binarySearchCustom=function(t,e,i,o){for(var n=1e4,s=0,r=0,a=t.length-1;r<=a&&s0)return"before"==o?Math.max(0,h-1):h;if(n(r,e)<0&&n(a,e)>0)return"before"==o?h:Math.min(t.length-1,h+1);n(r,e)<0?u=h+1:p=h-1,l++}return-1},e.easingFunctions={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return t*(2-t)},easeInOutQuad:function(t){return t<.5?2*t*t:-1+(4-2*t)*t},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return--t*t*t+1},easeInOutCubic:function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return 1- --t*t*t*t},easeInOutQuart:function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return 1+--t*t*t*t*t},easeInOutQuint:function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t}},e.getScrollBarWidth=function(){var t=document.createElement("p");t.style.width="100%",t.style.height="200px";var e=document.createElement("div");e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.visibility="hidden",e.style.width="200px",e.style.height="150px",e.style.overflow="hidden",e.appendChild(t),document.body.appendChild(e);var i=t.offsetWidth;e.style.overflow="scroll";var o=t.offsetWidth;return i==o&&(o=e.clientWidth),document.body.removeChild(e),i-o},e.topMost=function(t,e){var i=void 0;Array.isArray(e)||(e=[e]);var o=!0,n=!1,r=void 0;try{for(var a,h=(0,s.default)(t);!(o=(a=h.next()).done);o=!0){var d=a.value;if(d){i=d[e[0]];for(var l=1;l=t.length?(this._t=void 0,n(1)):"keys"==e?n(0,i):"values"==e?n(0,t[i]):n(0,[i,t[i]])},"values"),s.Arguments=s.Array,o("keys"),o("values"),o("entries")},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e){t.exports={}},function(t,e,i){var o=i(10),n=i(12);t.exports=function(t){return o(n(t))}},function(t,e,i){var o=i(11);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==o(t)?t.split(""):Object(t)}},function(t,e){var i={}.toString;t.exports=function(t){return i.call(t).slice(8,-1)}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,i){var o=i(14),n=i(15),s=i(30),r=i(20),a=i(31),h=i(8),d=i(32),l=i(46),u=i(48),p=i(47)("iterator"),c=!([].keys&&"next"in[].keys()),f="@@iterator",m="keys",g="values",v=function(){return this};t.exports=function(t,e,i,y,b,_,w){d(i,e,y);var x,D,S,k=function(t){if(!c&&t in O)return O[t];switch(t){case m:return function(){return new i(this,t)};case g:return function(){return new i(this,t)}}return function(){return new i(this,t)}},C=e+" Iterator",T=b==g,M=!1,O=t.prototype,E=O[p]||O[f]||b&&O[b],P=E||k(b),I=b?T?k("entries"):P:void 0,N="Array"==e?O.entries||E:E;if(N&&(S=u(N.call(new t)),S!==Object.prototype&&(l(S,C,!0),o||a(S,p)||r(S,p,v))),T&&E&&E.name!==g&&(M=!0,P=function(){return E.call(this)}),o&&!w||!c&&!M&&O[p]||r(O,p,P),h[e]=P,h[C]=v,b)if(x={values:T?P:k(g),keys:_?P:k(m),entries:I},w)for(D in x)D in O||s(O,D,x[D]);else n(n.P+n.F*(c||M),e,x);return x}},function(t,e){t.exports=!0},function(t,e,i){var o=i(16),n=i(17),s=i(18),r=i(20),a="prototype",h=function(t,e,i){var d,l,u,p=t&h.F,c=t&h.G,f=t&h.S,m=t&h.P,g=t&h.B,v=t&h.W,y=c?n:n[e]||(n[e]={}),b=y[a],_=c?o:f?o[e]:(o[e]||{})[a];c&&(i=e);for(d in i)l=!p&&_&&void 0!==_[d],l&&d in y||(u=l?_[d]:i[d],y[d]=c&&"function"!=typeof _[d]?i[d]:g&&l?s(u,o):v&&_[d]==u?function(t){var e=function(e,i,o){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,i)}return new t(e,i,o)}return t.apply(this,arguments)};return e[a]=t[a],e}(u):m&&"function"==typeof u?s(Function.call,u):u,m&&((y.virtual||(y.virtual={}))[d]=u,t&h.R&&b&&!b[d]&&r(b,d,u)))};h.F=1,h.G=2,h.S=4,h.P=8,h.B=16,h.W=32,h.U=64,h.R=128,t.exports=h},function(t,e){var i=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},function(t,e){var i=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=i)},function(t,e,i){var o=i(19);t.exports=function(t,e,i){if(o(t),void 0===e)return t;switch(i){case 1:return function(i){return t.call(e,i)};case 2:return function(i,o){return t.call(e,i,o)};case 3:return function(i,o,n){return t.call(e,i,o,n)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,i){var o=i(21),n=i(29);t.exports=i(25)?function(t,e,i){return o.f(t,e,n(1,i))}:function(t,e,i){return t[e]=i,t}},function(t,e,i){var o=i(22),n=i(24),s=i(28),r=Object.defineProperty;e.f=i(25)?Object.defineProperty:function(t,e,i){if(o(t),e=s(e,!0),o(i),n)try{return r(t,e,i)}catch(t){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(t[e]=i.value),t}},function(t,e,i){var o=i(23);t.exports=function(t){if(!o(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,i){t.exports=!i(25)&&!i(26)(function(){return 7!=Object.defineProperty(i(27)("div"),"a",{get:function(){return 7}}).a})},function(t,e,i){t.exports=!i(26)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,i){var o=i(23),n=i(16).document,s=o(n)&&o(n.createElement);t.exports=function(t){return s?n.createElement(t):{}}},function(t,e,i){var o=i(23);t.exports=function(t,e){if(!o(t))return t;var i,n;if(e&&"function"==typeof(i=t.toString)&&!o(n=i.call(t)))return n;if("function"==typeof(i=t.valueOf)&&!o(n=i.call(t)))return n;if(!e&&"function"==typeof(i=t.toString)&&!o(n=i.call(t)))return n;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,i){t.exports=i(20)},function(t,e){var i={}.hasOwnProperty;t.exports=function(t,e){return i.call(t,e)}},function(t,e,i){var o=i(33),n=i(29),s=i(46),r={};i(20)(r,i(47)("iterator"),function(){return this}),t.exports=function(t,e,i){t.prototype=o(r,{next:n(1,i)}),s(t,e+" Iterator")}},function(t,e,i){var o=i(22),n=i(34),s=i(44),r=i(41)("IE_PROTO"),a=function(){},h="prototype",d=function(){var t,e=i(27)("iframe"),o=s.length,n="<",r=">";for(e.style.display="none",i(45).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(n+"script"+r+"document.F=Object"+n+"/script"+r),t.close(),d=t.F;o--;)delete d[h][s[o]];return d()};t.exports=Object.create||function(t,e){var i;return null!==t?(a[h]=o(t),i=new a,a[h]=null,i[r]=t):i=d(),void 0===e?i:n(i,e)}},function(t,e,i){var o=i(21),n=i(22),s=i(35);t.exports=i(25)?Object.defineProperties:function(t,e){n(t);for(var i,r=s(e),a=r.length,h=0;a>h;)o.f(t,i=r[h++],e[i]);return t}},function(t,e,i){var o=i(36),n=i(44);t.exports=Object.keys||function(t){return o(t,n)}},function(t,e,i){var o=i(31),n=i(9),s=i(37)(!1),r=i(41)("IE_PROTO");t.exports=function(t,e){var i,a=n(t),h=0,d=[];for(i in a)i!=r&&o(a,i)&&d.push(i);for(;e.length>h;)o(a,i=e[h++])&&(~s(d,i)||d.push(i));return d}},function(t,e,i){var o=i(9),n=i(38),s=i(40);t.exports=function(t){return function(e,i,r){var a,h=o(e),d=n(h.length),l=s(r,d);if(t&&i!=i){for(;d>l;)if(a=h[l++],a!=a)return!0}else for(;d>l;l++)if((t||l in h)&&h[l]===i)return t||l||0;return!t&&-1}}},function(t,e,i){var o=i(39),n=Math.min;t.exports=function(t){return t>0?n(o(t),9007199254740991):0}},function(t,e){var i=Math.ceil,o=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?o:i)(t)}},function(t,e,i){var o=i(39),n=Math.max,s=Math.min;t.exports=function(t,e){return t=o(t),t<0?n(t+e,0):s(t,e)}},function(t,e,i){var o=i(42)("keys"),n=i(43);t.exports=function(t){return o[t]||(o[t]=n(t))}},function(t,e,i){var o=i(16),n="__core-js_shared__",s=o[n]||(o[n]={});t.exports=function(t){return s[t]||(s[t]={})}},function(t,e){var i=0,o=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++i+o).toString(36))}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,i){t.exports=i(16).document&&document.documentElement},function(t,e,i){var o=i(21).f,n=i(31),s=i(47)("toStringTag");t.exports=function(t,e,i){t&&!n(t=i?t:t.prototype,s)&&o(t,s,{configurable:!0,value:e})}},function(t,e,i){var o=i(42)("wks"),n=i(43),s=i(16).Symbol,r="function"==typeof s,a=t.exports=function(t){return o[t]||(o[t]=r&&s[t]||(r?s:n)("Symbol."+t))};a.store=o},function(t,e,i){var o=i(31),n=i(49),s=i(41)("IE_PROTO"),r=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=n(t),o(t,s)?t[s]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?r:null}},function(t,e,i){var o=i(12);t.exports=function(t){return Object(o(t))}},function(t,e,i){var o=i(51)(!0);i(13)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,i=this._i;return i>=e.length?{value:void 0,done:!0}:(t=o(e,i),this._i+=t.length,{value:t,done:!1})})},function(t,e,i){var o=i(39),n=i(12);t.exports=function(t){return function(e,i){var s,r,a=String(n(e)),h=o(i),d=a.length;return h<0||h>=d?t?"":void 0:(s=a.charCodeAt(h),s<55296||s>56319||h+1===d||(r=a.charCodeAt(h+1))<56320||r>57343?t?a.charAt(h):s:t?a.slice(h,h+2):(s-55296<<10)+(r-56320)+65536)}}},function(t,e,i){var o=i(22),n=i(53);t.exports=i(17).getIterator=function(t){var e=n(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return o(e.call(t))}},function(t,e,i){var o=i(54),n=i(47)("iterator"),s=i(8);t.exports=i(17).getIteratorMethod=function(t){if(void 0!=t)return t[n]||t["@@iterator"]||s[o(t)]}},function(t,e,i){var o=i(11),n=i(47)("toStringTag"),s="Arguments"==o(function(){return arguments}()),r=function(t,e){try{return t[e]}catch(t){}};t.exports=function(t){var e,i,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=r(e=Object(t),n))?i:s?o(e):"Object"==(a=o(e))&&"function"==typeof e.callee?"Arguments":a}},function(t,e,i){t.exports={default:i(56),__esModule:!0}},function(t,e,i){i(57);var o=i(17).Object;t.exports=function(t,e){return o.create(t,e)}},function(t,e,i){var o=i(15);o(o.S,"Object",{create:i(33)})},function(t,e,i){t.exports={default:i(59),__esModule:!0}},function(t,e,i){i(60),t.exports=i(17).Object.keys},function(t,e,i){var o=i(49),n=i(35);i(61)("keys",function(){return function(t){return n(o(t))}})},function(t,e,i){var o=i(15),n=i(17),s=i(26);t.exports=function(t,e){var i=(n.Object||{})[t]||Object[t],r={};r[t]=e(i),o(o.S+o.F*s(function(){i(1)}),"Object",r)}},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var n=i(63),s=o(n),r=i(66),a=o(r),h="function"==typeof a.default&&"symbol"==typeof s.default?function(t){return typeof t}:function(t){return t&&"function"==typeof a.default&&t.constructor===a.default&&t!==a.default.prototype?"symbol":typeof t};e.default="function"==typeof a.default&&"symbol"===h(s.default)?function(t){return"undefined"==typeof t?"undefined":h(t)}:function(t){return t&&"function"==typeof a.default&&t.constructor===a.default&&t!==a.default.prototype?"symbol":"undefined"==typeof t?"undefined":h(t)}},function(t,e,i){t.exports={default:i(64),__esModule:!0}},function(t,e,i){i(50),i(4),t.exports=i(65).f("iterator")},function(t,e,i){e.f=i(47)},function(t,e,i){t.exports={default:i(67),__esModule:!0}},function(t,e,i){i(68),i(79),i(80),i(81),t.exports=i(17).Symbol},function(t,e,i){var o=i(16),n=i(31),s=i(25),r=i(15),a=i(30),h=i(69).KEY,d=i(26),l=i(42),u=i(46),p=i(43),c=i(47),f=i(65),m=i(70),g=i(71),v=i(72),y=i(75),b=i(22),_=i(9),w=i(28),x=i(29),D=i(33),S=i(76),k=i(78),C=i(21),T=i(35),M=k.f,O=C.f,E=S.f,P=o.Symbol,I=o.JSON,N=I&&I.stringify,A="prototype",R=c("_hidden"),L=c("toPrimitive"),F={}.propertyIsEnumerable,H=l("symbol-registry"),Y=l("symbols"),j=l("op-symbols"),G=Object[A],z="function"==typeof P,W=o.QObject,B=!W||!W[A]||!W[A].findChild,U=s&&d(function(){return 7!=D(O({},"a",{get:function(){return O(this,"a",{value:7}).a}})).a})?function(t,e,i){var o=M(G,e);o&&delete G[e],O(t,e,i),o&&t!==G&&O(G,e,o)}:O,V=function(t){var e=Y[t]=D(P[A]);return e._k=t,e},q=z&&"symbol"==typeof P.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof P},X=function(t,e,i){return t===G&&X(j,e,i),b(t),e=w(e,!0),b(i),n(Y,e)?(i.enumerable?(n(t,R)&&t[R][e]&&(t[R][e]=!1),i=D(i,{enumerable:x(0,!1)})):(n(t,R)||O(t,R,x(1,{})),t[R][e]=!0),U(t,e,i)):O(t,e,i)},Z=function(t,e){b(t);for(var i,o=v(e=_(e)),n=0,s=o.length;s>n;)X(t,i=o[n++],e[i]);return t},K=function(t,e){return void 0===e?D(t):Z(D(t),e)},J=function(t){var e=F.call(this,t=w(t,!0));return!(this===G&&n(Y,t)&&!n(j,t))&&(!(e||!n(this,t)||!n(Y,t)||n(this,R)&&this[R][t])||e)},$=function(t,e){if(t=_(t),e=w(e,!0),t!==G||!n(Y,e)||n(j,e)){var i=M(t,e);return!i||!n(Y,e)||n(t,R)&&t[R][e]||(i.enumerable=!0),i}},Q=function(t){for(var e,i=E(_(t)),o=[],s=0;i.length>s;)n(Y,e=i[s++])||e==R||e==h||o.push(e);return o},tt=function(t){for(var e,i=t===G,o=E(i?j:_(t)),s=[],r=0;o.length>r;)!n(Y,e=o[r++])||i&&!n(G,e)||s.push(Y[e]);return s};z||(P=function(){if(this instanceof P)throw TypeError("Symbol is not a constructor!");var t=p(arguments.length>0?arguments[0]:void 0),e=function(i){this===G&&e.call(j,i),n(this,R)&&n(this[R],t)&&(this[R][t]=!1),U(this,t,x(1,i))};return s&&B&&U(G,t,{configurable:!0,set:e}),V(t)},a(P[A],"toString",function(){return this._k}),k.f=$,C.f=X,i(77).f=S.f=Q,i(74).f=J,i(73).f=tt,s&&!i(14)&&a(G,"propertyIsEnumerable",J,!0),f.f=function(t){return V(c(t))}),r(r.G+r.W+r.F*!z,{Symbol:P});for(var et="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),it=0;et.length>it;)c(et[it++]);for(var et=T(c.store),it=0;et.length>it;)m(et[it++]);r(r.S+r.F*!z,"Symbol",{for:function(t){return n(H,t+="")?H[t]:H[t]=P(t)},keyFor:function(t){if(q(t))return g(H,t);throw TypeError(t+" is not a symbol!")},useSetter:function(){B=!0},useSimple:function(){B=!1}}),r(r.S+r.F*!z,"Object",{create:K,defineProperty:X,defineProperties:Z,getOwnPropertyDescriptor:$,getOwnPropertyNames:Q,getOwnPropertySymbols:tt}),I&&r(r.S+r.F*(!z||d(function(){var t=P();return"[null]"!=N([t])||"{}"!=N({a:t})||"{}"!=N(Object(t))})),"JSON",{stringify:function(t){if(void 0!==t&&!q(t)){for(var e,i,o=[t],n=1;arguments.length>n;)o.push(arguments[n++]);return e=o[1],"function"==typeof e&&(i=e),!i&&y(e)||(e=function(t,e){if(i&&(e=i.call(this,t,e)),!q(e))return e}),o[1]=e,N.apply(I,o)}}}),P[A][L]||i(20)(P[A],L,P[A].valueOf),u(P,"Symbol"),u(Math,"Math",!0),u(o.JSON,"JSON",!0)},function(t,e,i){var o=i(43)("meta"),n=i(23),s=i(31),r=i(21).f,a=0,h=Object.isExtensible||function(){return!0},d=!i(26)(function(){return h(Object.preventExtensions({}))}),l=function(t){r(t,o,{value:{i:"O"+ ++a,w:{}}})},u=function(t,e){if(!n(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!s(t,o)){if(!h(t))return"F";if(!e)return"E";l(t)}return t[o].i},p=function(t,e){if(!s(t,o)){if(!h(t))return!0;if(!e)return!1;l(t)}return t[o].w},c=function(t){return d&&f.NEED&&h(t)&&!s(t,o)&&l(t),t},f=t.exports={KEY:o,NEED:!1,fastKey:u,getWeak:p,onFreeze:c}},function(t,e,i){var o=i(16),n=i(17),s=i(14),r=i(65),a=i(21).f;t.exports=function(t){var e=n.Symbol||(n.Symbol=s?{}:o.Symbol||{});"_"==t.charAt(0)||t in e||a(e,t,{value:r.f(t)})}},function(t,e,i){var o=i(35),n=i(9);t.exports=function(t,e){for(var i,s=n(t),r=o(s),a=r.length,h=0;a>h;)if(s[i=r[h++]]===e)return i}},function(t,e,i){var o=i(35),n=i(73),s=i(74);t.exports=function(t){var e=o(t),i=n.f;if(i)for(var r,a=i(t),h=s.f,d=0;a.length>d;)h.call(t,r=a[d++])&&e.push(r);return e}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,i){var o=i(11);t.exports=Array.isArray||function(t){return"Array"==o(t)}},function(t,e,i){var o=i(9),n=i(77).f,s={}.toString,r="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(t){try{return n(t)}catch(t){return r.slice()}};t.exports.f=function(t){return r&&"[object Window]"==s.call(t)?a(t):n(o(t))}},function(t,e,i){var o=i(36),n=i(44).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return o(t,n)}},function(t,e,i){var o=i(74),n=i(29),s=i(9),r=i(28),a=i(31),h=i(24),d=Object.getOwnPropertyDescriptor;e.f=i(25)?d:function(t,e){if(t=s(t),e=r(e,!0),h)try{return d(t,e)}catch(t){}if(a(t,e))return n(!o.f.call(t,e),t[e])}},function(t,e){},function(t,e,i){i(70)("asyncIterator")},function(t,e,i){i(70)("observable")},function(t,e,i){t.exports={default:i(83),__esModule:!0}},function(t,e,i){var o=i(17),n=o.JSON||(o.JSON={stringify:JSON.stringify});t.exports=function(t){return n.stringify.apply(n,arguments)}},function(t,e,i){t.exports="undefined"!=typeof window&&window.moment||i(85)},function(t,e,i){(function(t){!function(e,i){t.exports=i()}(this,function(){function e(){return go.apply(null,arguments)}function i(t){go=t}function o(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function n(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function s(t){var e;for(e in t)return!1;return!0}function r(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function a(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function h(t,e){var i,o=[];for(i=0;i0)for(i in bo)o=bo[i],n=e[o],g(n)||(t[o]=n);return t}function y(t){v(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),_o===!1&&(_o=!0,e.updateOffset(this),_o=!1)}function b(t){return t instanceof y||null!=t&&null!=t._isAMomentObject}function _(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function w(t){var e=+t,i=0;return 0!==e&&isFinite(e)&&(i=_(e)),i}function x(t,e,i){var o,n=Math.min(t.length,e.length),s=Math.abs(t.length-e.length),r=0;for(o=0;o0?"future":"past"];return C(i)?i(e):i.replace(/%s/i,e)}function L(t,e){var i=t.toLowerCase();Po[i]=Po[i+"s"]=Po[e]=t}function F(t){return"string"==typeof t?Po[t]||Po[t.toLowerCase()]:void 0}function H(t){var e,i,o={};for(i in t)d(t,i)&&(e=F(i),e&&(o[e]=t[i]));return o}function Y(t,e){Io[t]=e}function j(t){var e=[];for(var i in t)e.push({unit:i,priority:Io[i]});return e.sort(function(t,e){return t.priority-e.priority}),e}function G(t,i){return function(o){return null!=o?(W(this,t,o),e.updateOffset(this,i),this):z(this,t)}}function z(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function W(t,e,i){t.isValid()&&t._d["set"+(t._isUTC?"UTC":"")+e](i)}function B(t){return t=F(t),C(this[t])?this[t]():this}function U(t,e){if("object"==typeof t){t=H(t);for(var i=j(t),o=0;o=0;return(s?i?"+":"":"-")+Math.pow(10,Math.max(0,n)).toString().substr(1)+o}function q(t,e,i,o){var n=o;"string"==typeof o&&(n=function(){return this[o]()}),t&&(Lo[t]=n),e&&(Lo[e[0]]=function(){return V(n.apply(this,arguments),e[1],e[2])}),i&&(Lo[i]=function(){return this.localeData().ordinal(n.apply(this,arguments),t)})}function X(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function Z(t){var e,i,o=t.match(No);for(e=0,i=o.length;e=0&&Ao.test(t);)t=t.replace(Ao,i),Ao.lastIndex=0,o-=1;return t}function $(t,e,i){tn[t]=C(e)?e:function(t,o){return t&&i?i:e}}function Q(t,e){return d(tn,t)?tn[t](e._strict,e._locale):new RegExp(tt(t))}function tt(t){return et(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,i,o,n){return e||i||o||n}))}function et(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function it(t,e){var i,o=e;for("string"==typeof t&&(t=[t]),r(e)&&(o=function(t,i){i[e]=w(t)}),i=0;i=0&&isFinite(a.getFullYear())&&a.setFullYear(t),a}function _t(t){var e=new Date(Date.UTC.apply(null,arguments));return t<100&&t>=0&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function wt(t,e,i){var o=7+e-i,n=(7+_t(t,0,o).getUTCDay()-e)%7;return-n+o-1}function xt(t,e,i,o,n){var s,r,a=(7+i-o)%7,h=wt(t,o,n),d=1+7*(e-1)+a+h;return d<=0?(s=t-1,r=gt(s)+d):d>gt(t)?(s=t+1,r=d-gt(t)):(s=t,r=d),{year:s,dayOfYear:r}}function Dt(t,e,i){var o,n,s=wt(t.year(),e,i),r=Math.floor((t.dayOfYear()-s-1)/7)+1;return r<1?(n=t.year()-1,o=r+St(n,e,i)):r>St(t.year(),e,i)?(o=r-St(t.year(),e,i),n=t.year()+1):(n=t.year(),o=r),{week:o,year:n}}function St(t,e,i){var o=wt(t,e,i),n=wt(t+1,e,i);return(gt(t)-o+n)/7}function kt(t){return Dt(t,this._week.dow,this._week.doy).week}function Ct(){return this._week.dow}function Tt(){return this._week.doy}function Mt(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function Ot(t){var e=Dt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function Et(t,e){return"string"!=typeof t?t:isNaN(t)?(t=e.weekdaysParse(t),"number"==typeof t?t:null):parseInt(t,10)}function Pt(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function It(t,e){return t?o(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(e)?"format":"standalone"][t.day()]:this._weekdays}function Nt(t){return t?this._weekdaysShort[t.day()]:this._weekdaysShort}function At(t){return t?this._weekdaysMin[t.day()]:this._weekdaysMin}function Rt(t,e,i){var o,n,s,r=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],o=0;o<7;++o)s=u([2e3,1]).day(o),this._minWeekdaysParse[o]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[o]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[o]=this.weekdays(s,"").toLocaleLowerCase();return i?"dddd"===e?(n=pn.call(this._weekdaysParse,r),n!==-1?n:null):"ddd"===e?(n=pn.call(this._shortWeekdaysParse,r),n!==-1?n:null):(n=pn.call(this._minWeekdaysParse,r),n!==-1?n:null):"dddd"===e?(n=pn.call(this._weekdaysParse,r),n!==-1?n:(n=pn.call(this._shortWeekdaysParse,r),n!==-1?n:(n=pn.call(this._minWeekdaysParse,r),n!==-1?n:null))):"ddd"===e?(n=pn.call(this._shortWeekdaysParse,r),n!==-1?n:(n=pn.call(this._weekdaysParse,r),n!==-1?n:(n=pn.call(this._minWeekdaysParse,r),n!==-1?n:null))):(n=pn.call(this._minWeekdaysParse,r),n!==-1?n:(n=pn.call(this._weekdaysParse,r),n!==-1?n:(n=pn.call(this._shortWeekdaysParse,r),n!==-1?n:null)))}function Lt(t,e,i){var o,n,s;if(this._weekdaysParseExact)return Rt.call(this,t,e,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),o=0;o<7;o++){if(n=u([2e3,1]).day(o),i&&!this._fullWeekdaysParse[o]&&(this._fullWeekdaysParse[o]=new RegExp("^"+this.weekdays(n,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[o]=new RegExp("^"+this.weekdaysShort(n,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[o]=new RegExp("^"+this.weekdaysMin(n,"").replace(".",".?")+"$","i")),this._weekdaysParse[o]||(s="^"+this.weekdays(n,"")+"|^"+this.weekdaysShort(n,"")+"|^"+this.weekdaysMin(n,""),this._weekdaysParse[o]=new RegExp(s.replace(".",""),"i")),i&&"dddd"===e&&this._fullWeekdaysParse[o].test(t))return o;if(i&&"ddd"===e&&this._shortWeekdaysParse[o].test(t))return o;if(i&&"dd"===e&&this._minWeekdaysParse[o].test(t))return o;if(!i&&this._weekdaysParse[o].test(t))return o}}function Ft(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=Et(t,this.localeData()),this.add(t-e,"d")):e}function Ht(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function Yt(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=Pt(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7}function jt(t){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||Wt.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(d(this,"_weekdaysRegex")||(this._weekdaysRegex=Dn),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function Gt(t){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||Wt.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(d(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Sn),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function zt(t){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||Wt.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(d(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=kn),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Wt(){function t(t,e){return e.length-t.length}var e,i,o,n,s,r=[],a=[],h=[],d=[];for(e=0;e<7;e++)i=u([2e3,1]).day(e),o=this.weekdaysMin(i,""),n=this.weekdaysShort(i,""),s=this.weekdays(i,""),r.push(o),a.push(n),h.push(s),d.push(o),d.push(n),d.push(s);for(r.sort(t),a.sort(t),h.sort(t),d.sort(t),e=0;e<7;e++)a[e]=et(a[e]),h[e]=et(h[e]),d[e]=et(d[e]);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 Bt(){return this.hours()%12||12}function Ut(){return this.hours()||24}function Vt(t,e){q(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function qt(t,e){return e._meridiemParse}function Xt(t){return"p"===(t+"").toLowerCase().charAt(0)}function Zt(t,e,i){return t>11?i?"pm":"PM":i?"am":"AM"}function Kt(t){return t?t.toLowerCase().replace("_","-"):t}function Jt(t){for(var e,i,o,n,s=0;s0;){if(o=$t(n.slice(0,e).join("-")))return o;if(i&&i.length>=e&&x(n,i,!0)>=e-1)break;e--}s++}return null}function $t(e){var i=null;if(!En[e]&&"undefined"!=typeof t&&t&&t.exports)try{i=Cn._abbr,!function(){var t=new Error('Cannot find module "./locale"');throw t.code="MODULE_NOT_FOUND",t}(),Qt(i)}catch(t){}return En[e]}function Qt(t,e){var i;return t&&(i=g(e)?ie(t):te(t,e),i&&(Cn=i)),Cn._abbr}function te(t,e){if(null!==e){var i=On;if(e.abbr=t,null!=En[t])k("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=En[t]._config;else if(null!=e.parentLocale){if(null==En[e.parentLocale])return Pn[e.parentLocale]||(Pn[e.parentLocale]=[]),Pn[e.parentLocale].push({name:t,config:e}),null;i=En[e.parentLocale]._config}return En[t]=new O(M(i,e)),Pn[t]&&Pn[t].forEach(function(t){te(t.name,t.config)}),Qt(t),En[t]}return delete En[t],null}function ee(t,e){if(null!=e){var i,o=On;null!=En[t]&&(o=En[t]._config),e=M(o,e),i=new O(e),i.parentLocale=En[t],En[t]=i,Qt(t)}else null!=En[t]&&(null!=En[t].parentLocale?En[t]=En[t].parentLocale:null!=En[t]&&delete En[t]);return En[t]}function ie(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Cn;if(!o(t)){if(e=$t(t))return e;t=[t]}return Jt(t)}function oe(){return So(En)}function ne(t){var e,i=t._a;return i&&c(t).overflow===-2&&(e=i[nn]<0||i[nn]>11?nn:i[sn]<1||i[sn]>st(i[on],i[nn])?sn:i[rn]<0||i[rn]>24||24===i[rn]&&(0!==i[an]||0!==i[hn]||0!==i[dn])?rn:i[an]<0||i[an]>59?an:i[hn]<0||i[hn]>59?hn:i[dn]<0||i[dn]>999?dn:-1,c(t)._overflowDayOfYear&&(esn)&&(e=sn),c(t)._overflowWeeks&&e===-1&&(e=ln),c(t)._overflowWeekday&&e===-1&&(e=un),c(t).overflow=e),t}function se(t){var e,i,o,n,s,r,a=t._i,h=In.exec(a)||Nn.exec(a);if(h){for(c(t).iso=!0,e=0,i=Rn.length;egt(n)&&(c(t)._overflowDayOfYear=!0),i=_t(n,0,t._dayOfYear),t._a[nn]=i.getUTCMonth(),t._a[sn]=i.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=s[e]=o[e];for(;e<7;e++)t._a[e]=s[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[rn]&&0===t._a[an]&&0===t._a[hn]&&0===t._a[dn]&&(t._nextDay=!0,t._a[rn]=0),t._d=(t._useUTC?_t:bt).apply(null,s),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[rn]=24)}}function le(t){var e,i,o,n,s,r,a,h;if(e=t._w,null!=e.GG||null!=e.W||null!=e.E)s=1,r=4,i=ae(e.GG,t._a[on],Dt(be(),1,4).year),o=ae(e.W,1),n=ae(e.E,1),(n<1||n>7)&&(h=!0);else{s=t._locale._week.dow,r=t._locale._week.doy;var d=Dt(be(),s,r);i=ae(e.gg,t._a[on],d.year),o=ae(e.w,d.week),null!=e.d?(n=e.d,(n<0||n>6)&&(h=!0)):null!=e.e?(n=e.e+s,(e.e<0||e.e>6)&&(h=!0)):n=s}o<1||o>St(i,s,r)?c(t)._overflowWeeks=!0:null!=h?c(t)._overflowWeekday=!0:(a=xt(i,o,n,s,r),t._a[on]=a.year,t._dayOfYear=a.dayOfYear)}function ue(t){if(t._f===e.ISO_8601)return void se(t);t._a=[],c(t).empty=!0;var i,o,n,s,r,a=""+t._i,h=a.length,d=0;for(n=J(t._f,t._locale).match(No)||[],i=0;i0&&c(t).unusedInput.push(r),a=a.slice(a.indexOf(o)+o.length),d+=o.length),Lo[s]?(o?c(t).empty=!1:c(t).unusedTokens.push(s),nt(s,o,t)):t._strict&&!o&&c(t).unusedTokens.push(s);c(t).charsLeftOver=h-d,a.length>0&&c(t).unusedInput.push(a),t._a[rn]<=12&&c(t).bigHour===!0&&t._a[rn]>0&&(c(t).bigHour=void 0),c(t).parsedDateParts=t._a.slice(0),c(t).meridiem=t._meridiem,t._a[rn]=pe(t._locale,t._a[rn],t._meridiem),de(t),ne(t)}function pe(t,e,i){var o;return null==i?e:null!=t.meridiemHour?t.meridiemHour(e,i):null!=t.isPM?(o=t.isPM(i),o&&e<12&&(e+=12),o||12!==e||(e=0),e):e}function ce(t){var e,i,o,n,s;if(0===t._f.length)return c(t).invalidFormat=!0,void(t._d=new Date(NaN));for(n=0;nthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Fe(){if(!g(this._isDSTShifted))return this._isDSTShifted;var t={};if(v(t,this),t=ge(t),t._a){var e=t._isUTC?u(t._a):be(t._a);this._isDSTShifted=this.isValid()&&x(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function He(){return!!this.isValid()&&!this._isUTC}function Ye(){return!!this.isValid()&&this._isUTC}function je(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function Ge(t,e){var i,o,n,s=t,a=null;return Se(t)?s={ms:t._milliseconds,d:t._days,M:t._months}:r(t)?(s={},e?s[e]=t:s.milliseconds=t):(a=zn.exec(t))?(i="-"===a[1]?-1:1,s={y:0,d:w(a[sn])*i,h:w(a[rn])*i,m:w(a[an])*i,s:w(a[hn])*i,ms:w(ke(1e3*a[dn]))*i}):(a=Wn.exec(t))?(i="-"===a[1]?-1:1,s={y:ze(a[2],i),M:ze(a[3],i),w:ze(a[4],i),d:ze(a[5],i),h:ze(a[6],i),m:ze(a[7],i),s:ze(a[8],i)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(n=Be(be(s.from),be(s.to)),s={},s.ms=n.milliseconds,s.M=n.months),o=new De(s),Se(t)&&d(t,"_locale")&&(o._locale=t._locale),o}function ze(t,e){var i=t&&parseFloat(t.replace(",","."));return(isNaN(i)?0:i)*e}function We(t,e){var i={milliseconds:0,months:0};return i.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(i.months,"M").isAfter(e)&&--i.months,i.milliseconds=+e-+t.clone().add(i.months,"M"),i}function Be(t,e){var i;return t.isValid()&&e.isValid()?(e=Me(e,t),t.isBefore(e)?i=We(t,e):(i=We(e,t),i.milliseconds=-i.milliseconds,i.months=-i.months),i):{milliseconds:0,months:0}}function Ue(t,e){return function(i,o){var n,s;return null===o||isNaN(+o)||(k(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),s=i,i=o,o=s),i="string"==typeof i?+i:i,n=Ge(i,o),Ve(this,n,t),this}}function Ve(t,i,o,n){var s=i._milliseconds,r=ke(i._days),a=ke(i._months);t.isValid()&&(n=null==n||n,s&&t._d.setTime(t._d.valueOf()+s*o),r&&W(t,"Date",z(t,"Date")+r*o),a&<(t,z(t,"Month")+a*o),n&&e.updateOffset(t,r||a))}function qe(t,e){var i=t.diff(e,"days",!0);return i<-6?"sameElse":i<-1?"lastWeek":i<0?"lastDay":i<1?"sameDay":i<2?"nextDay":i<7?"nextWeek":"sameElse"}function Xe(t,i){var o=t||be(),n=Me(o,this).startOf("day"),s=e.calendarFormat(this,n)||"sameElse",r=i&&(C(i[s])?i[s].call(this,o):i[s]);return this.format(r||this.localeData().calendar(s,this,be(o)))}function Ze(){return new y(this)}function Ke(t,e){var i=b(t)?t:be(t);return!(!this.isValid()||!i.isValid())&&(e=F(g(e)?"millisecond":e),"millisecond"===e?this.valueOf()>i.valueOf():i.valueOf()s&&(e=s),Ii.call(this,t,e,i,o,n))}function Ii(t,e,i,o,n){var s=xt(t,e,i,o,n),r=_t(s.year,0,s.dayOfYear);return this.year(r.getUTCFullYear()),this.month(r.getUTCMonth()),this.date(r.getUTCDate()),this}function Ni(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}function Ai(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function Ri(t,e){e[dn]=w(1e3*("0."+t))}function Li(){return this._isUTC?"UTC":""}function Fi(){return this._isUTC?"Coordinated Universal Time":""}function Hi(t){return be(1e3*t)}function Yi(){return be.apply(null,arguments).parseZone()}function ji(t){return t}function Gi(t,e,i,o){var n=ie(),s=u().set(o,e);return n[i](s,t)}function zi(t,e,i){if(r(t)&&(e=t,t=void 0),t=t||"",null!=e)return Gi(t,e,i,"month");var o,n=[];for(o=0;o<12;o++)n[o]=Gi(t,o,i,"month");return n}function Wi(t,e,i,o){"boolean"==typeof t?(r(e)&&(i=e,e=void 0),e=e||""):(e=t,i=e,t=!1,r(e)&&(i=e,e=void 0),e=e||"");var n=ie(),s=t?n._week.dow:0;if(null!=i)return Gi(e,(i+s)%7,o,"day");var a,h=[];for(a=0;a<7;a++)h[a]=Gi(e,(a+s)%7,o,"day");return h}function Bi(t,e){return zi(t,e,"months")}function Ui(t,e){return zi(t,e,"monthsShort")}function Vi(t,e,i){return Wi(t,e,i,"weekdays")}function qi(t,e,i){return Wi(t,e,i,"weekdaysShort")}function Xi(t,e,i){return Wi(t,e,i,"weekdaysMin")}function Zi(){var t=this._data;return this._milliseconds=ts(this._milliseconds),this._days=ts(this._days),this._months=ts(this._months),t.milliseconds=ts(t.milliseconds),t.seconds=ts(t.seconds),t.minutes=ts(t.minutes),t.hours=ts(t.hours),t.months=ts(t.months),t.years=ts(t.years),this}function Ki(t,e,i,o){var n=Ge(e,i);return t._milliseconds+=o*n._milliseconds,t._days+=o*n._days,t._months+=o*n._months,t._bubble()}function Ji(t,e){return Ki(this,t,e,1)}function $i(t,e){return Ki(this,t,e,-1)}function Qi(t){return t<0?Math.floor(t):Math.ceil(t)}function to(){var t,e,i,o,n,s=this._milliseconds,r=this._days,a=this._months,h=this._data; +return s>=0&&r>=0&&a>=0||s<=0&&r<=0&&a<=0||(s+=864e5*Qi(io(a)+r),r=0,a=0),h.milliseconds=s%1e3,t=_(s/1e3),h.seconds=t%60,e=_(t/60),h.minutes=e%60,i=_(e/60),h.hours=i%24,r+=_(i/24),n=_(eo(r)),a+=n,r-=Qi(io(n)),o=_(a/12),a%=12,h.days=r,h.months=a,h.years=o,this}function eo(t){return 4800*t/146097}function io(t){return 146097*t/4800}function oo(t){var e,i,o=this._milliseconds;if(t=F(t),"month"===t||"year"===t)return e=this._days+o/864e5,i=this._months+eo(e),"month"===t?i:i/12;switch(e=this._days+Math.round(io(this._months)),t){case"week":return e/7+o/6048e5;case"day":return e+o/864e5;case"hour":return 24*e+o/36e5;case"minute":return 1440*e+o/6e4;case"second":return 86400*e+o/1e3;case"millisecond":return Math.floor(864e5*e)+o;default:throw new Error("Unknown unit "+t)}}function no(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*w(this._months/12)}function so(t){return function(){return this.as(t)}}function ro(t){return t=F(t),this[t+"s"]()}function ao(t){return function(){return this._data[t]}}function ho(){return _(this.days()/7)}function lo(t,e,i,o,n){return n.relativeTime(e||1,!!i,t,o)}function uo(t,e,i){var o=Ge(t).abs(),n=gs(o.as("s")),s=gs(o.as("m")),r=gs(o.as("h")),a=gs(o.as("d")),h=gs(o.as("M")),d=gs(o.as("y")),l=n0,l[4]=i,lo.apply(null,l)}function po(t){return void 0===t?gs:"function"==typeof t&&(gs=t,!0)}function co(t,e){return void 0!==vs[t]&&(void 0===e?vs[t]:(vs[t]=e,!0))}function fo(t){var e=this.localeData(),i=uo(this,!t,e);return t&&(i=e.pastFuture(+this,i)),e.postformat(i)}function mo(){var t,e,i,o=ys(this._milliseconds)/1e3,n=ys(this._days),s=ys(this._months);t=_(o/60),e=_(t/60),o%=60,t%=60,i=_(s/12),s%=12;var r=i,a=s,h=n,d=e,l=t,u=o,p=this.asSeconds();return p?(p<0?"-":"")+"P"+(r?r+"Y":"")+(a?a+"M":"")+(h?h+"D":"")+(d||l||u?"T":"")+(d?d+"H":"")+(l?l+"M":"")+(u?u+"S":""):"P0D"}var go,vo;vo=Array.prototype.some?Array.prototype.some:function(t){for(var e=Object(this),i=e.length>>>0,o=0;o68?1900:2e3)};var yn=G("FullYear",!0);q("w",["ww",2],"wo","week"),q("W",["WW",2],"Wo","isoWeek"),L("week","w"),L("isoWeek","W"),Y("week",5),Y("isoWeek",5),$("w",zo),$("ww",zo,Ho),$("W",zo),$("WW",zo,Ho),ot(["w","ww","W","WW"],function(t,e,i,o){e[o.substr(0,1)]=w(t)});var bn={dow:0,doy:6};q("d",0,"do","day"),q("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),q("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),q("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),q("e",0,0,"weekday"),q("E",0,0,"isoWeekday"),L("day","d"),L("weekday","e"),L("isoWeekday","E"),Y("day",11),Y("weekday",11),Y("isoWeekday",11),$("d",zo),$("e",zo),$("E",zo),$("dd",function(t,e){return e.weekdaysMinRegex(t)}),$("ddd",function(t,e){return e.weekdaysShortRegex(t)}),$("dddd",function(t,e){return e.weekdaysRegex(t)}),ot(["dd","ddd","dddd"],function(t,e,i,o){var n=i._locale.weekdaysParse(t,o,i._strict);null!=n?e.d=n:c(i).invalidWeekday=t}),ot(["d","e","E"],function(t,e,i,o){e[o]=w(t)});var _n="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),wn="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),xn="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Dn=Qo,Sn=Qo,kn=Qo;q("H",["HH",2],0,"hour"),q("h",["hh",2],0,Bt),q("k",["kk",2],0,Ut),q("hmm",0,0,function(){return""+Bt.apply(this)+V(this.minutes(),2)}),q("hmmss",0,0,function(){return""+Bt.apply(this)+V(this.minutes(),2)+V(this.seconds(),2)}),q("Hmm",0,0,function(){return""+this.hours()+V(this.minutes(),2)}),q("Hmmss",0,0,function(){return""+this.hours()+V(this.minutes(),2)+V(this.seconds(),2)}),Vt("a",!0),Vt("A",!1),L("hour","h"),Y("hour",13),$("a",qt),$("A",qt),$("H",zo),$("h",zo),$("HH",zo,Ho),$("hh",zo,Ho),$("hmm",Wo),$("hmmss",Bo),$("Hmm",Wo),$("Hmmss",Bo),it(["H","HH"],rn),it(["a","A"],function(t,e,i){i._isPm=i._locale.isPM(t),i._meridiem=t}),it(["h","hh"],function(t,e,i){e[rn]=w(t),c(i).bigHour=!0}),it("hmm",function(t,e,i){var o=t.length-2;e[rn]=w(t.substr(0,o)),e[an]=w(t.substr(o)),c(i).bigHour=!0}),it("hmmss",function(t,e,i){var o=t.length-4,n=t.length-2;e[rn]=w(t.substr(0,o)),e[an]=w(t.substr(o,2)),e[hn]=w(t.substr(n)),c(i).bigHour=!0}),it("Hmm",function(t,e,i){var o=t.length-2;e[rn]=w(t.substr(0,o)),e[an]=w(t.substr(o))}),it("Hmmss",function(t,e,i){var o=t.length-4,n=t.length-2;e[rn]=w(t.substr(0,o)),e[an]=w(t.substr(o,2)),e[hn]=w(t.substr(n))});var Cn,Tn=/[ap]\.?m?\.?/i,Mn=G("Hours",!0),On={calendar:ko,longDateFormat:Co,invalidDate:To,ordinal:Mo,ordinalParse:Oo,relativeTime:Eo,months:fn,monthsShort:mn,week:bn,weekdays:_n,weekdaysMin:xn,weekdaysShort:wn,meridiemParse:Tn},En={},Pn={},In=/^\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)?)?$/,Nn=/^\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)?)?$/,An=/Z|[+-]\d\d(?::?\d\d)?/,Rn=[["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}/]],Ln=[["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/]],Fn=/^\/?Date\((\-?\d+)/i;e.createFromInputFallback=S("value provided is not in a recognized ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non 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(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),e.ISO_8601=function(){};var Hn=S("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=be.apply(null,arguments);return this.isValid()&&t.isValid()?tthis?this:t:m()}),jn=function(){return Date.now?Date.now():+new Date};Ce("Z",":"),Ce("ZZ",""),$("Z",Jo),$("ZZ",Jo),it(["Z","ZZ"],function(t,e,i){i._useUTC=!0,i._tzm=Te(Jo,t)});var Gn=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var zn=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Wn=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;Ge.fn=De.prototype;var Bn=Ue(1,"add"),Un=Ue(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Vn=S("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});q(0,["gg",2],0,function(){return this.weekYear()%100}),q(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Ci("gggg","weekYear"),Ci("ggggg","weekYear"),Ci("GGGG","isoWeekYear"),Ci("GGGGG","isoWeekYear"),L("weekYear","gg"),L("isoWeekYear","GG"),Y("weekYear",1),Y("isoWeekYear",1),$("G",Zo),$("g",Zo),$("GG",zo,Ho),$("gg",zo,Ho),$("GGGG",Vo,jo),$("gggg",Vo,jo),$("GGGGG",qo,Go),$("ggggg",qo,Go),ot(["gggg","ggggg","GGGG","GGGGG"],function(t,e,i,o){e[o.substr(0,2)]=w(t)}),ot(["gg","GG"],function(t,i,o,n){i[n]=e.parseTwoDigitYear(t)}),q("Q",0,"Qo","quarter"),L("quarter","Q"),Y("quarter",7),$("Q",Fo),it("Q",function(t,e){e[nn]=3*(w(t)-1)}),q("D",["DD",2],"Do","date"),L("date","D"),Y("date",9),$("D",zo),$("DD",zo,Ho),$("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),it(["D","DD"],sn),it("Do",function(t,e){e[sn]=w(t.match(zo)[0],10)});var qn=G("Date",!0);q("DDD",["DDDD",3],"DDDo","dayOfYear"),L("dayOfYear","DDD"),Y("dayOfYear",4),$("DDD",Uo),$("DDDD",Yo),it(["DDD","DDDD"],function(t,e,i){i._dayOfYear=w(t)}),q("m",["mm",2],0,"minute"),L("minute","m"),Y("minute",14),$("m",zo),$("mm",zo,Ho),it(["m","mm"],an);var Xn=G("Minutes",!1);q("s",["ss",2],0,"second"),L("second","s"),Y("second",15),$("s",zo),$("ss",zo,Ho),it(["s","ss"],hn);var Zn=G("Seconds",!1);q("S",0,0,function(){return~~(this.millisecond()/100)}),q(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),q(0,["SSS",3],0,"millisecond"),q(0,["SSSS",4],0,function(){return 10*this.millisecond()}),q(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),q(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),q(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),q(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),q(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),L("millisecond","ms"),Y("millisecond",16),$("S",Uo,Fo),$("SS",Uo,Ho),$("SSS",Uo,Yo);var Kn;for(Kn="SSSS";Kn.length<=9;Kn+="S")$(Kn,Xo);for(Kn="S";Kn.length<=9;Kn+="S")it(Kn,Ri);var Jn=G("Milliseconds",!1);q("z",0,0,"zoneAbbr"),q("zz",0,0,"zoneName");var $n=y.prototype;$n.add=Bn,$n.calendar=Xe,$n.clone=Ze,$n.diff=ii,$n.endOf=mi,$n.format=ai,$n.from=hi,$n.fromNow=di,$n.to=li,$n.toNow=ui,$n.get=B,$n.invalidAt=Si,$n.isAfter=Ke,$n.isBefore=Je,$n.isBetween=$e,$n.isSame=Qe,$n.isSameOrAfter=ti,$n.isSameOrBefore=ei,$n.isValid=xi,$n.lang=Vn,$n.locale=pi,$n.localeData=ci,$n.max=Yn,$n.min=Hn,$n.parsingFlags=Di,$n.set=U,$n.startOf=fi,$n.subtract=Un,$n.toArray=bi,$n.toObject=_i,$n.toDate=yi,$n.toISOString=si,$n.inspect=ri,$n.toJSON=wi,$n.toString=ni,$n.unix=vi,$n.valueOf=gi,$n.creationData=ki,$n.year=yn,$n.isLeapYear=yt,$n.weekYear=Ti,$n.isoWeekYear=Mi,$n.quarter=$n.quarters=Ni,$n.month=ut,$n.daysInMonth=pt,$n.week=$n.weeks=Mt,$n.isoWeek=$n.isoWeeks=Ot,$n.weeksInYear=Ei,$n.isoWeeksInYear=Oi,$n.date=qn,$n.day=$n.days=Ft,$n.weekday=Ht,$n.isoWeekday=Yt,$n.dayOfYear=Ai,$n.hour=$n.hours=Mn,$n.minute=$n.minutes=Xn,$n.second=$n.seconds=Zn,$n.millisecond=$n.milliseconds=Jn,$n.utcOffset=Ee,$n.utc=Ie,$n.local=Ne,$n.parseZone=Ae,$n.hasAlignedHourOffset=Re,$n.isDST=Le,$n.isLocal=He,$n.isUtcOffset=Ye,$n.isUtc=je,$n.isUTC=je,$n.zoneAbbr=Li,$n.zoneName=Fi,$n.dates=S("dates accessor is deprecated. Use date instead.",qn),$n.months=S("months accessor is deprecated. Use month instead",ut),$n.years=S("years accessor is deprecated. Use year instead",yn),$n.zone=S("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Pe),$n.isDSTShifted=S("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Fe);var Qn=O.prototype;Qn.calendar=E,Qn.longDateFormat=P,Qn.invalidDate=I,Qn.ordinal=N,Qn.preparse=ji,Qn.postformat=ji,Qn.relativeTime=A,Qn.pastFuture=R,Qn.set=T,Qn.months=rt,Qn.monthsShort=at,Qn.monthsParse=dt,Qn.monthsRegex=ft,Qn.monthsShortRegex=ct,Qn.week=kt,Qn.firstDayOfYear=Tt,Qn.firstDayOfWeek=Ct,Qn.weekdays=It,Qn.weekdaysMin=At,Qn.weekdaysShort=Nt,Qn.weekdaysParse=Lt,Qn.weekdaysRegex=jt,Qn.weekdaysShortRegex=Gt,Qn.weekdaysMinRegex=zt,Qn.isPM=Xt,Qn.meridiem=Zt,Qt("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,i=1===w(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+i}}),e.lang=S("moment.lang is deprecated. Use moment.locale instead.",Qt),e.langData=S("moment.langData is deprecated. Use moment.localeData instead.",ie);var ts=Math.abs,es=so("ms"),is=so("s"),os=so("m"),ns=so("h"),ss=so("d"),rs=so("w"),as=so("M"),hs=so("y"),ds=ao("milliseconds"),ls=ao("seconds"),us=ao("minutes"),ps=ao("hours"),cs=ao("days"),fs=ao("months"),ms=ao("years"),gs=Math.round,vs={s:45,m:45,h:22,d:26,M:11},ys=Math.abs,bs=De.prototype;return bs.abs=Zi,bs.add=Ji,bs.subtract=$i,bs.as=oo,bs.asMilliseconds=es,bs.asSeconds=is,bs.asMinutes=os,bs.asHours=ns,bs.asDays=ss,bs.asWeeks=rs,bs.asMonths=as,bs.asYears=hs,bs.valueOf=no,bs._bubble=to,bs.get=ro,bs.milliseconds=ds,bs.seconds=ls,bs.minutes=us,bs.hours=ps,bs.days=cs,bs.weeks=ho,bs.months=fs,bs.years=ms,bs.humanize=fo,bs.toISOString=mo,bs.toString=mo,bs.toJSON=mo,bs.locale=pi,bs.localeData=ci,bs.toIsoString=S("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",mo),bs.lang=Vn,q("X",0,0,"unix"),q("x",0,0,"valueOf"),$("x",Zo),$("X",$o),it("X",function(t,e,i){i._d=new Date(1e3*parseFloat(t,10))}),it("x",function(t,e,i){i._d=new Date(w(t))}),e.version="2.17.1",i(be),e.fn=$n,e.min=we,e.max=xe,e.now=jn,e.utc=u,e.unix=Hi,e.months=Bi,e.isDate=a,e.locale=Qt,e.invalid=m,e.duration=Ge,e.isMoment=b,e.weekdays=Vi,e.parseZone=Yi,e.localeData=ie,e.isDuration=Se,e.monthsShort=Ui,e.weekdaysMin=Xi,e.defineLocale=te,e.updateLocale=ee,e.locales=oe,e.weekdaysShort=qi,e.normalizeUnits=F,e.relativeTimeRounding=po,e.relativeTimeThreshold=co,e.calendarFormat=qe,e.prototype=$n,e})}).call(e,i(86)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e){function i(t){throw new Error("Cannot find module '"+t+"'.")}i.keys=function(){return[]},i.resolve=i,t.exports=i,i.id=87},function(t,e){(function(e){function i(t,e,i){var o=e&&i||0,n=0;for(e=e||[],t.toLowerCase().replace(/[0-9a-f]{2}/g,function(t){n<16&&(e[o+n++]=u[t])});n<16;)e[o+n++]=0;return e}function o(t,e){var i=e||0,o=l;return o[t[i++]]+o[t[i++]]+o[t[i++]]+o[t[i++]]+"-"+o[t[i++]]+o[t[i++]]+"-"+o[t[i++]]+o[t[i++]]+"-"+o[t[i++]]+o[t[i++]]+"-"+o[t[i++]]+o[t[i++]]+o[t[i++]]+o[t[i++]]+o[t[i++]]+o[t[i++]]}function n(t,e,i){var n=e&&i||0,s=e||[];t=t||{};var r=void 0!==t.clockseq?t.clockseq:m,a=void 0!==t.msecs?t.msecs:(new Date).getTime(),h=void 0!==t.nsecs?t.nsecs:v+1,d=a-g+(h-v)/1e4;if(d<0&&void 0===t.clockseq&&(r=r+1&16383),(d<0||a>g)&&void 0===t.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");g=a,v=h,m=r,a+=122192928e5;var l=(1e4*(268435455&a)+h)%4294967296;s[n++]=l>>>24&255,s[n++]=l>>>16&255,s[n++]=l>>>8&255,s[n++]=255&l;var u=a/4294967296*1e4&268435455;s[n++]=u>>>8&255,s[n++]=255&u,s[n++]=u>>>24&15|16,s[n++]=u>>>16&255,s[n++]=r>>>8|128,s[n++]=255&r;for(var p=t.node||f,c=0;c<6;c++)s[n+c]=p[c];return e?e:o(s)}function s(t,e,i){var n=e&&i||0;"string"==typeof t&&(e="binary"==t?new Array(16):null,t=null),t=t||{};var s=t.random||(t.rng||r)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,e)for(var a=0;a<16;a++)e[n+a]=s[a];return e||o(s)}var r,a="undefined"!=typeof window?window:"undefined"!=typeof e?e:null;if(a&&a.crypto&&crypto.getRandomValues){var h=new Uint8Array(16);r=function(){return crypto.getRandomValues(h),h}}if(!r){var d=new Array(16);r=function(){for(var t,e=0;e<16;e++)0===(3&e)&&(t=4294967296*Math.random()),d[e]=t>>>((3&e)<<3)&255;return d}}for(var l=[],u={},p=0;p<256;p++)l[p]=(p+256).toString(16).substr(1),u[l[p]]=p;var c=r(),f=[1|c[0],c[1],c[2],c[3],c[4],c[5]],m=16383&(c[6]<<8|c[7]),g=0,v=0,y=s;y.v1=n,y.v4=s,y.parse=i,y.unparse=o,t.exports=y}).call(e,function(){return this}())},function(t,e){e.prepareElements=function(t){for(var e in t)t.hasOwnProperty(e)&&(t[e].redundant=t[e].used,t[e].used=[])},e.cleanupElements=function(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e].redundant){for(var i=0;i0?(o=e[t].redundant[0],e[t].redundant.shift()):(o=document.createElementNS("http://www.w3.org/2000/svg",t),i.appendChild(o)):(o=document.createElementNS("http://www.w3.org/2000/svg",t),e[t]={used:[],redundant:[]},i.appendChild(o)),e[t].used.push(o),o},e.getDOMElement=function(t,e,i,o){var n;return e.hasOwnProperty(t)?e[t].redundant.length>0?(n=e[t].redundant[0],e[t].redundant.shift()):(n=document.createElement(t),void 0!==o?i.insertBefore(n,o):i.appendChild(n)):(n=document.createElement(t),e[t]={used:[],redundant:[]},void 0!==o?i.insertBefore(n,o):i.appendChild(n)),e[t].used.push(n),n},e.drawPoint=function(t,i,o,n,s,r){var a;if("circle"==o.style?(a=e.getSVGElement("circle",n,s),a.setAttributeNS(null,"cx",t),a.setAttributeNS(null,"cy",i),a.setAttributeNS(null,"r",.5*o.size)):(a=e.getSVGElement("rect",n,s),a.setAttributeNS(null,"x",t-.5*o.size),a.setAttributeNS(null,"y",i-.5*o.size),a.setAttributeNS(null,"width",o.size),a.setAttributeNS(null,"height",o.size)),void 0!==o.styles&&a.setAttributeNS(null,"style",o.styles),a.setAttributeNS(null,"class",o.className+" vis-point"),r){var h=e.getSVGElement("text",n,s);r.xOffset&&(t+=r.xOffset),r.yOffset&&(i+=r.yOffset),r.content&&(h.textContent=r.content),r.className&&h.setAttributeNS(null,"class",r.className+" vis-label"),h.setAttributeNS(null,"x",t),h.setAttributeNS(null,"y",i)}return a},e.drawBar=function(t,i,o,n,s,r,a,h){if(0!=n){n<0&&(n*=-1,i-=n);var d=e.getSVGElement("rect",r,a);d.setAttributeNS(null,"x",t-.5*o),d.setAttributeNS(null,"y",i),d.setAttributeNS(null,"width",o),d.setAttributeNS(null,"height",n),d.setAttributeNS(null,"class",s),h&&d.setAttributeNS(null,"style",h)}}},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(t&&!Array.isArray(t)&&(e=t,t=null),this._options=e||{},this._data={},this.length=0,this._fieldId=this._options.fieldId||"id",this._type={},this._options.type)for(var i=(0,l.default)(this._options.type),o=0,n=i.length;on?1:or)&&(s=h,r=d)}return s},n.prototype.min=function(t){var e,i,o=this._data,n=(0,l.default)(o),s=null,r=null;for(e=0,i=n.length;ethis.max&&this.flush(),clearTimeout(this._timeout),this.queue.length>0&&"number"==typeof this.delay){var t=this;this._timeout=setTimeout(function(){t.flush()},this.delay)}},i.prototype.flush=function(){for(;this._queue.length>0;){var t=this._queue.shift();t.fn.apply(t.context||t.fn,t.args||[])}},t.exports=i},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){this._data=null,this._ids={},this.length=0,this._options=e||{},this._fieldId="id",this._subscribers={};var i=this;this.listener=function(){i._onEvent.apply(i,arguments)},this.setData(t)}var s=i(58),r=o(s),a=i(1),h=i(90);n.prototype.setData=function(t){var e,i,o,n,s;if(this._data){for(this._data.off&&this._data.off("*",this.listener),e=this._data.getIds({filter:this._options&&this._options.filter}),s=[],o=0,n=e.length;os)&&(s=i)}),null!==n&&null!==s){var r=(n+s)/2,a=Math.max(this.range.end-this.range.start,1.1*(s-n)),h=!e||void 0===e.animation||e.animation;this.range.setRange(r-a/2,r+a/2,h)}}},n.prototype.fit=function(t){var e,i=!t||void 0===t.animation||t.animation,o=this.itemsData&&this.itemsData.getDataSet();1===o.length&&void 0===o.get()[0].end?(e=this.getDataRange(),this.moveTo(e.min.valueOf(),{animation:i})):(e=this.getItemRange(),this.range.setRange(e.min,e.max,i))},n.prototype.getItemRange=function(){var t=this,e=this.getDataRange(),i=null!==e.min?e.min.valueOf():null,o=null!==e.max?e.max.valueOf():null,n=null,s=null;if(null!=i&&null!=o){var r,a,h,d,u;!function(){var e=function(t){return l.convert(t.data.start,"Date").valueOf()},p=function(t){var e=void 0!=t.data.end?t.data.end:t.data.start;return l.convert(e,"Date").valueOf()};r=o-i,r<=0&&(r=10),a=r/t.props.center.width,l.forEach(t.itemSet.items,function(t){t.groupShowing&&(t.show(),t.repositionX());var r=e(t),h=p(t);if(this.options.rtl)var d=r-(t.getWidthRight()+10)*a,l=h+(t.getWidthLeft()+10)*a;else var d=r-(t.getWidthLeft()+10)*a,l=h+(t.getWidthRight()+10)*a;do&&(o=l,s=t)}.bind(t)),n&&s&&(h=n.getWidthLeft()+10,d=s.getWidthRight()+10,u=t.props.center.width-h-d,u>0&&(t.options.rtl?(i=e(n)-d*r/u,o=p(s)+h*r/u):(i=e(n)-h*r/u,o=p(s)+d*r/u)))}()}return{min:null!=i?new Date(i):null,max:null!=o?new Date(o):null}},n.prototype.getDataRange=function(){var t=null,e=null,i=this.itemsData&&this.itemsData.getDataSet();return i&&i.forEach(function(i){var o=l.convert(i.start,"Date").valueOf(),n=l.convert(void 0!=i.end?i.end:i.start,"Date").valueOf();(null===t||oe)&&(e=n)}),{min:null!=t?new Date(t):null,max:null!=e?new Date(e):null}},n.prototype.getEventProperties=function(t){var e=t.center?t.center.x:t.clientX,i=t.center?t.center.y:t.clientY;if(this.options.rtl)var o=l.getAbsoluteRight(this.dom.centerContainer)-e;else var o=e-l.getAbsoluteLeft(this.dom.centerContainer);var n=i-l.getAbsoluteTop(this.dom.centerContainer),s=this.itemSet.itemFromTarget(t),r=this.itemSet.groupFromTarget(t),a=v.customTimeFromTarget(t),h=this.itemSet.options.snap||null,d=this.body.util.getScale(),u=this.body.util.getStep(),p=this._toTime(o),c=h?h(p,d,u):p,f=l.getTarget(t),m=null;return null!=s?m="item":null!=a?m="custom-time":l.hasParent(f,this.timeAxis.dom.foreground)?m="axis":this.timeAxis2&&l.hasParent(f,this.timeAxis2.dom.foreground)?m="axis":l.hasParent(f,this.itemSet.dom.labelSet)?m="group-label":l.hasParent(f,this.currentTime.bar)?m="current-time":l.hasParent(f,this.dom.center)&&(m="background"),{event:t,item:s?s.id:null,group:r?r.groupId:null,what:m,pageX:t.srcEvent?t.srcEvent.pageX:t.pageX,pageY:t.srcEvent?t.srcEvent.pageY:t.pageY,x:o,y:n,time:p,snappedTime:c}},t.exports=n},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(82),s=o(n),r=i(62),a=o(r),h=i(95),d=o(h),l=i(96),u=o(l),p=i(100),c=o(p),f=i(1),m=function(){function t(e,i,o){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;(0,d.default)(this,t),this.parent=e,this.changedOptions=[],this.container=i,this.allowCreation=!1,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},f.extend(this.options,this.defaultOptions),this.configureOptions=o,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new c.default(n),this.wrapper=void 0}return(0,u.default)(t,[{key:"setOptions",value:function(t){if(void 0!==t){this.popupHistory={},this._removePopup();var e=!0;"string"==typeof t?this.options.filter=t:t instanceof Array?this.options.filter=t.join():"object"===("undefined"==typeof t?"undefined":(0,a.default)(t))?(void 0!==t.container&&(this.options.container=t.container),void 0!==t.filter&&(this.options.filter=t.filter),void 0!==t.showButton&&(this.options.showButton=t.showButton),void 0!==t.enabled&&(e=t.enabled)):"boolean"==typeof t?(this.options.filter=!0,e=t):"function"==typeof t&&(this.options.filter=t,e=!0),this.options.filter===!1&&(e=!1),this.options.enabled=e}this._clean()}},{key:"setModuleOptions",value:function(t){this.moduleOptions=t,this.options.enabled===!0&&(this._clean(),void 0!==this.options.container&&(this.container=this.options.container),this._create())}},{key:"_create",value:function(){var t=this;this._clean(),this.changedOptions=[];var e=this.options.filter,i=0,o=!1;for(var n in this.configureOptions)this.configureOptions.hasOwnProperty(n)&&(this.allowCreation=!1,o=!1,"function"==typeof e?(o=e(n,[]),o=o||this._handleObject(this.configureOptions[n],[n],!0)):e!==!0&&e.indexOf(n)===-1||(o=!0),o!==!1&&(this.allowCreation=!0,i>0&&this._makeItem([]),this._makeHeader(n),this._handleObject(this.configureOptions[n],[n])),i++);this.options.showButton===!0&&!function(){var e=document.createElement("div");e.className="vis-configuration vis-config-button",e.innerHTML="generate options",e.onclick=function(){t._printOptions()},e.onmouseover=function(){e.className="vis-configuration vis-config-button hover"},e.onmouseout=function(){e.className="vis-configuration vis-config-button"},t.optionsContainer=document.createElement("div"),t.optionsContainer.className="vis-configuration vis-config-option-container",t.domElements.push(t.optionsContainer),t.domElements.push(e)}(),this._push()}},{key:"_push",value:function(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(var t=0;t1?o-1:0),s=1;s2&&void 0!==arguments[2]&&arguments[2],o=document.createElement("div");return o.className="vis-configuration vis-config-label vis-config-s"+e.length,i===!0?o.innerHTML=""+t+":":o.innerHTML=t+":",o}},{key:"_makeDropdown",value:function(t,e,i){var o=document.createElement("select");o.className="vis-configuration vis-config-select";var n=0;void 0!==e&&t.indexOf(e)!==-1&&(n=t.indexOf(e));for(var s=0;ss&&1!==s&&(a.max=Math.ceil(e*l),d=a.max,h="range increased"),a.value=e}else a.value=o;var u=document.createElement("input");u.className="vis-configuration vis-config-rangeinput",u.value=a.value;var p=this;a.onchange=function(){u.value=this.value,p._update(Number(this.value),i)},a.oninput=function(){u.value=this.value};var c=this._makeLabel(i[i.length-1],i),f=this._makeItem(i,c,a,u);""!==h&&this.popupHistory[f]!==d&&(this.popupHistory[f]=d,this._setupPopup(h,f))}},{key:"_setupPopup",value:function(t,e){var i=this;if(this.initialized===!0&&this.allowCreation===!0&&this.popupCounter1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=!1,n=this.options.filter,s=!1;for(var r in t)if(t.hasOwnProperty(r)){o=!0;var a=t[r],h=f.copyAndExtendArray(e,r);if("function"==typeof n&&(o=n(r,e),o===!1&&!(a instanceof Array)&&"string"!=typeof a&&"boolean"!=typeof a&&a instanceof Object&&(this.allowCreation=!1,o=this._handleObject(a,h,!0),this.allowCreation=i===!1)),o!==!1){s=!0;var d=this._getValue(h);if(a instanceof Array)this._handleArray(a,d,h);else if("string"==typeof a)this._makeTextInput(a,d,h);else if("boolean"==typeof a)this._makeCheckbox(a,d,h);else if(a instanceof Object){var l=!0;if(e.indexOf("physics")!==-1&&this.moduleOptions.physics.solver!==r&&(l=!1),l===!0)if(void 0!==a.enabled){var u=f.copyAndExtendArray(h,"enabled"),p=this._getValue(u);if(p===!0){var c=this._makeLabel(r,h,!0);this._makeItem(h,c),s=this._handleObject(a,h)||s}else this._makeCheckbox(a,p,h)}else{var m=this._makeLabel(r,h,!0);this._makeItem(h,m),s=this._handleObject(a,h)||s}}else console.error("dont know how to handle",a,r,h)}}return s}},{key:"_handleArray",value:function(t,e,i){"string"==typeof t[0]&&"color"===t[0]?(this._makeColorField(t,e,i),t[1]!==e&&this.changedOptions.push({path:i,value:e})):"string"==typeof t[0]?(this._makeDropdown(t,e,i),t[0]!==e&&this.changedOptions.push({path:i,value:e})):"number"==typeof t[0]&&(this._makeRange(t,e,i),t[0]!==e&&this.changedOptions.push({path:i,value:Number(e)}))}},{key:"_update",value:function(t,e){var i=this._constructOptions(t,e);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(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=i;t="true"===t||t,t="false"!==t&&t;for(var n=0;nvar options = "+(0,s.default)(t,null,2)+""}},{key:"getOptions",value:function(){for(var t={},e=0;e0&&void 0!==arguments[0]?arguments[0]:1;(0,a.default)(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(0,d.default)(t,[{key:"insertTo",value:function(t){void 0!==this.hammer&&(this.hammer.destroy(),this.hammer=void 0),this.container=t,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}},{key:"setUpdateCallback",value:function(t){if("function"!=typeof t)throw new Error("Function attempted to set as colorPicker update callback is not a function.");this.updateCallback=t}},{key:"setCloseCallback",value:function(t){if("function"!=typeof t)throw new Error("Function attempted to set as colorPicker closing callback is not a function.");this.closeCallback=t}},{key:"_isColorString",value:function(t){var e={black:"#000000",navy:"#000080",darkblue:"#00008B",mediumblue:"#0000CD",blue:"#0000FF",darkgreen:"#006400",green:"#008000",teal:"#008080",darkcyan:"#008B8B",deepskyblue:"#00BFFF",darkturquoise:"#00CED1",mediumspringgreen:"#00FA9A",lime:"#00FF00",springgreen:"#00FF7F",aqua:"#00FFFF",cyan:"#00FFFF",midnightblue:"#191970",dodgerblue:"#1E90FF",lightseagreen:"#20B2AA",forestgreen:"#228B22",seagreen:"#2E8B57",darkslategray:"#2F4F4F",limegreen:"#32CD32",mediumseagreen:"#3CB371",turquoise:"#40E0D0",royalblue:"#4169E1",steelblue:"#4682B4",darkslateblue:"#483D8B",mediumturquoise:"#48D1CC",indigo:"#4B0082",darkolivegreen:"#556B2F",cadetblue:"#5F9EA0",cornflowerblue:"#6495ED",mediumaquamarine:"#66CDAA",dimgray:"#696969",slateblue:"#6A5ACD",olivedrab:"#6B8E23",slategray:"#708090",lightslategray:"#778899",mediumslateblue:"#7B68EE",lawngreen:"#7CFC00",chartreuse:"#7FFF00",aquamarine:"#7FFFD4",maroon:"#800000",purple:"#800080",olive:"#808000",gray:"#808080",skyblue:"#87CEEB",lightskyblue:"#87CEFA",blueviolet:"#8A2BE2",darkred:"#8B0000",darkmagenta:"#8B008B",saddlebrown:"#8B4513",darkseagreen:"#8FBC8F",lightgreen:"#90EE90",mediumpurple:"#9370D8",darkviolet:"#9400D3",palegreen:"#98FB98",darkorchid:"#9932CC",yellowgreen:"#9ACD32",sienna:"#A0522D",brown:"#A52A2A",darkgray:"#A9A9A9",lightblue:"#ADD8E6",greenyellow:"#ADFF2F",paleturquoise:"#AFEEEE",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",firebrick:"#B22222",darkgoldenrod:"#B8860B",mediumorchid:"#BA55D3",rosybrown:"#BC8F8F",darkkhaki:"#BDB76B",silver:"#C0C0C0",mediumvioletred:"#C71585",indianred:"#CD5C5C",peru:"#CD853F",chocolate:"#D2691E",tan:"#D2B48C",lightgrey:"#D3D3D3",palevioletred:"#D87093",thistle:"#D8BFD8",orchid:"#DA70D6",goldenrod:"#DAA520",crimson:"#DC143C",gainsboro:"#DCDCDC",plum:"#DDA0DD",burlywood:"#DEB887",lightcyan:"#E0FFFF",lavender:"#E6E6FA",darksalmon:"#E9967A",violet:"#EE82EE",palegoldenrod:"#EEE8AA",lightcoral:"#F08080",khaki:"#F0E68C",aliceblue:"#F0F8FF",honeydew:"#F0FFF0",azure:"#F0FFFF",sandybrown:"#F4A460",wheat:"#F5DEB3",beige:"#F5F5DC",whitesmoke:"#F5F5F5",mintcream:"#F5FFFA",ghostwhite:"#F8F8FF",salmon:"#FA8072",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lightgoldenrodyellow:"#FAFAD2",oldlace:"#FDF5E6",red:"#FF0000",fuchsia:"#FF00FF",magenta:"#FF00FF",deeppink:"#FF1493",orangered:"#FF4500",tomato:"#FF6347",hotpink:"#FF69B4",coral:"#FF7F50",darkorange:"#FF8C00",lightsalmon:"#FFA07A",orange:"#FFA500",lightpink:"#FFB6C1",pink:"#FFC0CB",gold:"#FFD700",peachpuff:"#FFDAB9",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",mistyrose:"#FFE4E1",blanchedalmond:"#FFEBCD",papayawhip:"#FFEFD5",lavenderblush:"#FFF0F5",seashell:"#FFF5EE",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",floralwhite:"#FFFAF0",snow:"#FFFAFA",yellow:"#FFFF00",lightyellow:"#FFFFE0",ivory:"#FFFFF0",white:"#FFFFFF"};if("string"==typeof t)return e[t]}},{key:"setColor",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("none"!==t){var i=void 0,o=this._isColorString(t);if(void 0!==o&&(t=o),p.isString(t)===!0){if(p.isValidRGB(t)===!0){var n=t.substr(4).substr(0,t.length-5).split(",");i={r:n[0],g:n[1],b:n[2],a:1}}else if(p.isValidRGBA(t)===!0){var r=t.substr(5).substr(0,t.length-6).split(",");i={r:r[0],g:r[1],b:r[2],a:r[3]}}else if(p.isValidHex(t)===!0){var a=p.hexToRGB(t);i={r:a.r,g:a.g,b:a.b,a:1}}}else if(t instanceof Object&&void 0!==t.r&&void 0!==t.g&&void 0!==t.b){var h=void 0!==t.a?t.a:"1.0";i={r:t.r,g:t.g,b:t.b,a:h}}if(void 0===i)throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: "+(0,s.default)(t));this._setColor(i,e)}}},{key:"show",value:function(){void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}},{key:"_hide",value:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e===!0&&(this.previousColor=p.extend({},this.color)),this.applied===!0&&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(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e===!0&&(this.initialColor=p.extend({},t)),this.color=t;var i=p.RGBToHSV(t.r,t.g,t.b),o=2*Math.PI,n=this.r*i.s,s=this.centerCoordinates.x+n*Math.sin(o*i.h),r=this.centerCoordinates.y+n*Math.cos(o*i.h);this.colorPickerSelector.style.left=s-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=r-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(t)}},{key:"_setOpacity",value:function(t){this.color.a=t/100,this._updatePicker(this.color)}},{key:"_setBrightness",value:function(t){var e=p.RGBToHSV(this.color.r,this.color.g,this.color.b);e.v=t/100;var i=p.HSVToRGB(e.h,e.s,e.v);i.a=this.color.a,this.color=i,this._updatePicker()}},{key:"_updatePicker",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color,e=p.RGBToHSV(t.r,t.g,t.b),i=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1)),i.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var o=this.colorPickerCanvas.clientWidth,n=this.colorPickerCanvas.clientHeight;i.clearRect(0,0,o,n),i.putImageData(this.hueCircle,0,0),i.fillStyle="rgba(0,0,0,"+(1-e.v)+")",i.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),i.fill(),this.brightnessRange.value=100*e.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 t=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}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.colorPickerCanvas.appendChild(e)}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(t){}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(t){}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 l(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),u.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(this.generated===!1){var t=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)),t.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var e=this.colorPickerCanvas.clientWidth,i=this.colorPickerCanvas.clientHeight;t.clearRect(0,0,e,i);var o=void 0,n=void 0,s=void 0,r=void 0;this.centerCoordinates={x:.5*e,y:.5*i},this.r=.49*e;var a=2*Math.PI/360,h=1/360,d=1/this.r,l=void 0;for(s=0;s<360;s++)for(r=0;r0?d._handlers[t]=o:(i.off(t,s),delete d._handlers[t]))}),d},d.emit=function(e,o){t=o.target,i.emit(e,o)},d.destroy=function(){var t=i.element.hammer,e=t.indexOf(d);e!==-1&&t.splice(e,1),t.length||delete i.element.hammer,d._handlers={},i.destroy()},d}})},function(t,e,i){var o;/*! Hammer.JS - v2.0.7 - 2016-04-22 * http://hammerjs.github.io/ * * Copyright (c) 2016 Jorik Tangelder; * Licensed under the MIT license */ -!function(n,s,r,a){function h(t,e,i){return setTimeout(c(t,i),e)}function d(t,e,i){return!!Array.isArray(t)&&(l(t,i[e],i),!0)}function l(t,e,i){var o;if(t)if(t.forEach)t.forEach(e,i);else if(t.length!==a)for(o=0;o\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",s=n.console&&(n.console.warn||n.console.log);return s&&s.call(n.console,o,i),t.apply(this,arguments)}}function p(t,e,i){var o,n=e.prototype;o=t.prototype=Object.create(n),o.constructor=t,o._super=n,i&&ft(o,i)}function c(t,e){return function(){return t.apply(e,arguments)}}function m(t,e){return typeof t==yt?t.apply(e?e[0]||a:a,e):t}function f(t,e){return t===a?e:t}function g(t,e,i){l(_(e),function(e){t.addEventListener(e,i,!1)})}function v(t,e,i){l(_(e),function(e){t.removeEventListener(e,i,!1)})}function y(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function b(t,e){return t.indexOf(e)>-1}function _(t){return t.trim().split(/\s+/g)}function w(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var o=0;oi[e]}):o.sort()),o}function S(t,e){for(var i,o,n=e[0].toUpperCase()+e.slice(1),s=0;s1&&!i.firstMultiple?i.firstMultiple=N(e):1===n&&(i.firstMultiple=!1);var s=i.firstInput,r=i.firstMultiple,a=r?r.center:s.center,h=e.center=I(o);e.timeStamp=wt(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=H(a,h),e.distance=F(a,h),P(i,e),e.offsetDirection=L(e.deltaX,e.deltaY);var d=R(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=d.x,e.overallVelocityY=d.y,e.overallVelocity=_t(d.x)>_t(d.y)?d.x:d.y,e.scale=r?j(r.pointers,o):1,e.rotation=r?Y(r.pointers,o):0,e.maxPointers=i.prevInput?e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers:e.pointers.length,A(i,e);var l=t.element;y(e.srcEvent.target,l)&&(l=e.srcEvent.target),e.target=l}function P(t,e){var i=e.center,o=t.offsetDelta||{},n=t.prevDelta||{},s=t.prevInput||{};e.eventType!==It&&s.eventType!==Lt||(n=t.prevDelta={x:s.deltaX||0,y:s.deltaY||0},o=t.offsetDelta={x:i.x,y:i.y}),e.deltaX=n.x+(i.x-o.x),e.deltaY=n.y+(i.y-o.y)}function A(t,e){var i,o,n,s,r=t.lastInterval||e,h=e.timeStamp-r.timeStamp;if(e.eventType!=Ft&&(h>Nt||r.velocity===a)){var d=e.deltaX-r.deltaX,l=e.deltaY-r.deltaY,u=R(h,d,l);o=u.x,n=u.y,i=_t(u.x)>_t(u.y)?u.x:u.y,s=L(d,l),t.lastInterval=e}else i=r.velocity,o=r.velocityX,n=r.velocityY,s=r.direction;e.velocity=i,e.velocityX=o,e.velocityY=n,e.direction=s}function N(t){for(var e=[],i=0;i=_t(e)?t<0?Yt:jt:e<0?Gt:zt}function F(t,e,i){i||(i=Bt);var o=e[i[0]]-t[i[0]],n=e[i[1]]-t[i[1]];return Math.sqrt(o*o+n*n)}function H(t,e,i){i||(i=Bt);var o=e[i[0]]-t[i[0]],n=e[i[1]]-t[i[1]];return 180*Math.atan2(n,o)/Math.PI}function Y(t,e){return H(e[1],e[0],qt)+H(t[1],t[0],qt)}function j(t,e){return F(e[0],e[1],qt)/F(t[0],t[1],qt)}function G(){this.evEl=Zt,this.evWin=Kt,this.pressed=!1,T.apply(this,arguments)}function z(){this.evEl=$t,this.evWin=te,T.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function W(){this.evTarget=ie,this.evWin=oe,this.started=!1,T.apply(this,arguments)}function U(t,e){var i=x(t.touches),o=x(t.changedTouches);return e&(Lt|Ft)&&(i=D(i.concat(o),"identifier",!0)),[i,o]}function V(){this.evTarget=se,this.targetIds={},T.apply(this,arguments)}function B(t,e){var i=x(t.touches),o=this.targetIds;if(e&(It|Rt)&&1===i.length)return o[i[0].identifier]=!0,[i,i];var n,s,r=x(t.changedTouches),a=[],h=this.target;if(s=i.filter(function(t){return y(t.target,h)}),e===It)for(n=0;n-1&&o.splice(t,1)};setTimeout(n,re)}}function K(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,o=0;o-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){function e(e){i.manager.emit(e,t)}var i=this,o=this.state;o<_e&&e(i.options.event+et(o)),e(i.options.event),t.additionalEvent&&e(t.additionalEvent),o>=_e&&e(i.options.event+et(o))},tryEmit:function(t){return this.canEmit()?this.emit(t):void(this.state=De)},canEmit:function(){for(var t=0;te.threshold&&n&e.direction},attrTest:function(t){return nt.prototype.attrTest.call(this,t)&&(this.state&ye||!(this.state&ye)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=it(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),p(rt,nt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ce]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&ye)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),p(at,tt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ue]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,o=t.distancee.time;if(this._input=t,!o||!i||t.eventType&(Lt|Ft)&&!n)this.reset();else if(t.eventType&It)this.reset(),this._timer=h(function(){this.state=we,this.tryEmit()},e.time,this);else if(t.eventType&Lt)return we;return De},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===we&&(t&&t.eventType&Lt?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=wt(),this.manager.emit(this.options.event,this._input)))}}),p(ht,nt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ce]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&ye)}}),p(dt,nt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Wt|Ut,pointers:1},getTouchAction:function(){return st.prototype.getTouchAction.call(this)},attrTest:function(t){var e,i=this.options.direction;return i&(Wt|Ut)?e=t.overallVelocity:i&Wt?e=t.overallVelocityX:i&Ut&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&i&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&_t(e)>this.options.velocity&&t.eventType&Lt},emit:function(t){var e=it(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),p(lt,tt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[pe]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,o=t.distances.distance?console.log('%cUnknown option detected: "'+e+'" in '+t.printLocation(n.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+t.printLocation(s.path,s.closestMatch,""),d):n.distance<=r?console.log('%cUnknown option detected: "'+e+'". Did you mean "'+n.closestMatch+'"?'+t.printLocation(n.path,e),d):console.log('%cUnknown option detected: "'+e+'". Did you mean one of these: '+t.print(Object.keys(i))+t.printLocation(o,e),d),a=!0}},{key:"findInOptions",value:function(e,i,o){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=1e9,a="",h=[],d=e.toLowerCase(),l=void 0;for(var u in i){var p=void 0;if(void 0!==i[u].__type__&&n===!0){var c=t.findInOptions(e,i[u],r.copyAndExtendArray(o,u));s>c.distance&&(a=c.closestMatch,h=c.path,s=c.distance,l=c.indexMatch)}else u.toLowerCase().indexOf(d)!==-1&&(l=u),p=t.levenshteinDistance(e,u),s>p&&(a=u,h=r.copyArray(o),s=p)}return{closestMatch:a,path:h,distance:s,indexMatch:l}}},{key:"printLocation",value:function(t,e){for(var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Problem value found at: \n",o="\n\n"+i+"options = {\n",n=0;np,c=r||null===n?n:l+(n-l)*s,v=r||null===a?a:u+(a-u)*s;y=h._applyRange(c,v),d.updateHiddenDates(h.options.moment,h.body,h.options.hiddenDates),g=g||y,y&&h.body.emitter.emit("rangechange",{start:new Date(h.start),end:new Date(h.end),byUser:o}),r?g&&h.body.emitter.emit("rangechanged",{start:new Date(h.start),end:new Date(h.end),byUser:o}):h.animationTimer=setTimeout(t,20)}};return v()}var y=this._applyRange(n,a);if(d.updateHiddenDates(this.options.moment,this.body,this.options.hiddenDates),y){var b={start:new Date(this.start),end:new Date(this.end),byUser:o};this.body.emitter.emit("rangechange",b),this.body.emitter.emit("rangechanged",b)}},o.prototype._cancelAnimation=function(){this.animationTimer&&(clearTimeout(this.animationTimer),this.animationTimer=null)},o.prototype._applyRange=function(t,e){var i,o=null!=t?r.convert(t,"Date").valueOf():this.start,n=null!=e?r.convert(e,"Date").valueOf():this.end,s=null!=this.options.max?r.convert(this.options.max,"Date").valueOf():null,a=null!=this.options.min?r.convert(this.options.min,"Date").valueOf():null;if(isNaN(o)||null===o)throw new Error('Invalid start "'+t+'"');if(isNaN(n)||null===n)throw new Error('Invalid end "'+e+'"');if(ns&&(n=s)),null!==s&&n>s&&(i=n-s,o-=i,n-=i,null!=a&&othis.start&&nd&&(this.end-this.start===d&&othis.end?(o=this.start,n=this.end):(i=n-o-d,o+=i/2,n-=i/2))}var l=this.start!=o||this.end!=n;return o>=this.start&&o<=this.end||n>=this.start&&n<=this.end||this.start>=o&&this.start<=n||this.end>=o&&this.end<=n||this.body.emitter.emit("checkRangedItems"),this.start=o,this.end=n,l},o.prototype.getRange=function(){return{start:this.start,end:this.end}},o.prototype.conversion=function(t,e){return o.conversion(this.start,this.end,t,e)},o.conversion=function(t,e,i,o){return void 0===o&&(o=0),0!=i&&e-t!=0?{offset:t,scale:i/(e-t-o)}:{offset:0,scale:1}},o.prototype._onDragStart=function(t){this.deltaDifference=0,this.previousDelta=0,this.options.moveable&&this._isInsideRange(t)&&this.props.touch.allowDragging&&(this.props.touch.start=this.start,this.props.touch.end=this.end,this.props.touch.dragging=!0,this.body.dom.root&&(this.body.dom.root.style.cursor="move"))},o.prototype._onDrag=function(t){if(t&&this.props.touch.dragging&&this.options.moveable&&this.props.touch.allowDragging){var e=this.options.direction;n(e);var i="horizontal"==e?t.deltaX:t.deltaY;i-=this.deltaDifference;var o=this.props.touch.end-this.props.touch.start,s=d.getHiddenDurationBetween(this.body.hiddenDates,this.start,this.end);o-=s;var r="horizontal"==e?this.body.domProps.center.width:this.body.domProps.center.height;if(this.options.rtl)var a=i/r*o;else var a=-i/r*o;var h=this.props.touch.start+a,l=this.props.touch.end+a,u=d.snapAwayFromHidden(this.body.hiddenDates,h,this.previousDelta-i,!0),p=d.snapAwayFromHidden(this.body.hiddenDates,l,this.previousDelta-i,!0);if(u!=h||p!=l)return this.deltaDifference+=i, -this.props.touch.start=u,this.props.touch.end=p,void this._onDrag(t);this.previousDelta=i,this._applyRange(h,l);var c=new Date(this.start),m=new Date(this.end);this.body.emitter.emit("rangechange",{start:c,end:m,byUser:!0}),this.body.emitter.emit("panmove")}},o.prototype._onDragEnd=function(t){this.props.touch.dragging&&this.options.moveable&&this.props.touch.allowDragging&&(this.props.touch.dragging=!1,this.body.dom.root&&(this.body.dom.root.style.cursor="auto"),this.body.emitter.emit("rangechanged",{start:new Date(this.start),end:new Date(this.end),byUser:!0}))},o.prototype._onMouseWheel=function(t){t.preventDefault();var e=0;if(t.wheelDelta?e=t.wheelDelta/120:t.detail&&(e=-t.detail/3),this.options.zoomKey&&!t[this.options.zoomKey]&&this.options.zoomable||!this.options.zoomable&&this.options.moveable){if(this.options.horizontalScroll){var i=e*(this.end-this.start)/20,o=this.start-i,n=this.end-i;this.setRange(o,n)}}else if(this.options.zoomable&&this.options.moveable&&this._isInsideRange(t)&&e){var s;s=e<0?1-e/5:1/(1+e/5);var r=this.getPointer({x:t.clientX,y:t.clientY},this.body.dom.center),a=this._pointerToDate(r);this.zoom(s,a,e)}},o.prototype._onTouch=function(t){this.props.touch.start=this.start,this.props.touch.end=this.end,this.props.touch.allowDragging=!0,this.props.touch.center=null,this.scaleOffset=0,this.deltaDifference=0},o.prototype._onPinch=function(t){if(this.options.zoomable&&this.options.moveable){this.props.touch.allowDragging=!1,this.props.touch.center||(this.props.touch.center=this.getPointer(t.center,this.body.dom.center));var e=1/(t.scale+this.scaleOffset),i=this._pointerToDate(this.props.touch.center),o=d.getHiddenDurationBetween(this.body.hiddenDates,this.start,this.end),n=d.getHiddenDurationBefore(this.options.moment,this.body.hiddenDates,this,i),s=o-n,r=i-n+(this.props.touch.start-(i-n))*e,a=i+s+(this.props.touch.end-(i+s))*e;this.startToFront=1-e<=0,this.endToFront=e-1<=0;var h=d.snapAwayFromHidden(this.body.hiddenDates,r,1-e,!0),l=d.snapAwayFromHidden(this.body.hiddenDates,a,e-1,!0);h==r&&l==a||(this.props.touch.start=h,this.props.touch.end=l,this.scaleOffset=1-t.scale,r=h,a=l),this.setRange(r,a,!1,!0),this.startToFront=!1,this.endToFront=!0}},o.prototype._isInsideRange=function(t){var e=t.center?t.center.x:t.clientX;if(this.options.rtl)var i=e-r.getAbsoluteLeft(this.body.dom.centerContainer);else var i=r.getAbsoluteRight(this.body.dom.centerContainer)-e;var o=this.body.util.toTime(i);return o>=this.start&&o<=this.end},o.prototype._pointerToDate=function(t){var e,i=this.options.direction;if(n(i),"horizontal"==i)return this.body.util.toTime(t.x).valueOf();var o=this.body.domProps.center.height;return e=this.conversion(o),t.y/e.scale+e.offset},o.prototype.getPointer=function(t,e){return this.options.rtl?{x:r.getAbsoluteRight(e)-t.x,y:t.y-r.getAbsoluteTop(e)}:{x:t.x-r.getAbsoluteLeft(e),y:t.y-r.getAbsoluteTop(e)}},o.prototype.zoom=function(t,e,i){null==e&&(e=(this.start+this.end)/2);var o=d.getHiddenDurationBetween(this.body.hiddenDates,this.start,this.end),n=d.getHiddenDurationBefore(this.options.moment,this.body.hiddenDates,this,e),s=o-n,r=e-n+(this.start-(e-n))*t,a=e+s+(this.end-(e+s))*t;this.startToFront=!(i>0),this.endToFront=!(-i>0);var h=d.snapAwayFromHidden(this.body.hiddenDates,r,i,!0),l=d.snapAwayFromHidden(this.body.hiddenDates,a,-i,!0);h==r&&l==a||(r=h,a=l),this.setRange(r,a,!1,!0),this.startToFront=!1,this.endToFront=!0},o.prototype.move=function(t){var e=this.end-this.start,i=this.start+e*t,o=this.end+e*t;this.start=i,this.end=o},o.prototype.moveTo=function(t){var e=(this.start+this.end)/2,i=e-t,o=this.start-i,n=this.end-i;this.setRange(o,n)},t.exports=o},function(t,e,i){function o(t,e){this.options=null,this.props=null}var n=i(1);o.prototype.setOptions=function(t){t&&n.extend(this.options,t)},o.prototype.redraw=function(){return!1},o.prototype.destroy=function(){},o.prototype._isResized=function(){var t=this.props._previousWidth!==this.props.width||this.props._previousHeight!==this.props.height;return this.props._previousWidth=this.props.width,this.props._previousHeight=this.props.height,t},t.exports=o},function(t,e){e.convertHiddenOptions=function(t,i,o){if(o&&!Array.isArray(o))return e.convertHiddenOptions(t,i,[o]);if(i.hiddenDates=[],o&&1==Array.isArray(o)){for(var n=0;n=4*a){var p=0,c=s.clone();switch(o[h].repeat){case"daily":d.day()!=l.day()&&(p=1),d.dayOfYear(n.dayOfYear()),d.year(n.year()),d.subtract(7,"days"),l.dayOfYear(n.dayOfYear()),l.year(n.year()),l.subtract(7-p,"days"),c.add(1,"weeks");break;case"weekly":var m=l.diff(d,"days"),f=d.day();d.date(n.date()),d.month(n.month()),d.year(n.year()),l=d.clone(),d.day(f),l.day(f),l.add(m,"days"),d.subtract(1,"weeks"),l.subtract(1,"weeks"),c.add(1,"weeks");break;case"monthly":d.month()!=l.month()&&(p=1),d.month(n.month()),d.year(n.year()),d.subtract(1,"months"),l.month(n.month()),l.year(n.year()),l.subtract(1,"months"),l.add(p,"months"),c.add(1,"months");break;case"yearly":d.year()!=l.year()&&(p=1),d.year(n.year()),d.subtract(1,"years"),l.year(n.year()),l.subtract(1,"years"),l.add(p,"years"),c.add(1,"years");break;default:return void console.log("Wrong repeat format, allowed are: daily, weekly, monthly, yearly. Given:",o[h].repeat)}for(;d=e[o].start&&e[n].end<=e[o].end?e[n].remove=!0:e[n].start>=e[o].start&&e[n].start<=e[o].end?(e[o].end=e[n].end,e[n].remove=!0):e[n].end>=e[o].start&&e[n].end<=e[o].end&&(e[o].start=e[n].start,e[n].remove=!0));for(var o=0;o=r&&nt.range.end){var h={start:t.range.start,end:i};i=e.correctTimeForHidden(t.options.moment,t.body.hiddenDates,h,i);var n=t.range.conversion(o,r);return(i.valueOf()-n.offset)*n.scale}i=e.correctTimeForHidden(t.options.moment,t.body.hiddenDates,t.range,i);var n=t.range.conversion(o,r);return(i.valueOf()-n.offset)*n.scale},e.toTime=function(t,i,o){if(0==t.body.hiddenDates.length){var n=t.range.conversion(o);return new Date(i/n.scale+n.offset)}var s=e.getHiddenDurationBetween(t.body.hiddenDates,t.range.start,t.range.end),r=t.range.end-t.range.start-s,a=r*i/o,h=e.getAccumulatedHiddenDuration(t.body.hiddenDates,t.range,a),d=new Date(h+a+t.range.start);return d},e.getHiddenDurationBetween=function(t,e,i){for(var o=0,n=0;n=e&&r=e&&r<=i&&(o+=r-s)}return o},e.correctTimeForHidden=function(t,i,o,n){return n=t(n).toDate().valueOf(),n-=e.getHiddenDurationBefore(t,i,o,n)},e.getHiddenDurationBefore=function(t,e,i,o){var n=0;o=t(o).toDate().valueOf();for(var s=0;s=i.start&&a=a&&(n+=a-r)}return n},e.getAccumulatedHiddenDuration=function(t,e,i){for(var o=0,n=0,s=e.start,r=0;r=e.start&&h=i)break;o+=h-a}}return o},e.snapAwayFromHidden=function(t,i,o,n){var s=e.isHidden(i,t);return 1==s.hidden?o<0?1==n?s.startDate-(s.endDate-i)-1:s.startDate-1:1==n?s.endDate+(i-s.startDate)+1:s.endDate+1:i},e.isHidden=function(t,e){for(var i=0;i=o&&t0&&i[0].setCustomTime(t)},o.prototype.getCustomTime=function(t){var e=this.customTimes.filter(function(e){return e.options.id===t});if(0===e.length)throw new Error("No custom time bar found with id "+JSON.stringify(t));return e[0].getCustomTime()},o.prototype.setCustomTimeTitle=function(t,e){var i=this.customTimes.filter(function(t){return t.options.id===e});if(0===i.length)throw new Error("No custom time bar found with id "+JSON.stringify(e));if(i.length>0)return i[0].setCustomTitle(t)},o.prototype.getEventProperties=function(t){return{event:t}},o.prototype.addCustomTime=function(t,e){var i=void 0!==t?h.convert(t,"Date").valueOf():new Date,o=this.customTimes.some(function(t){return t.options.id===e});if(o)throw new Error("A custom time with id "+JSON.stringify(e)+" already exists");var n=new p(this.body,h.extend({},this.options,{time:i,id:e}));return this.customTimes.push(n),this.components.push(n),this._redraw(),e},o.prototype.removeCustomTime=function(t){var e=this.customTimes.filter(function(e){return e.options.id===t});if(0===e.length)throw new Error("No custom time bar found with id "+JSON.stringify(t));e.forEach(function(t){this.customTimes.splice(this.customTimes.indexOf(t),1),this.components.splice(this.components.indexOf(t),1),t.destroy()}.bind(this))},o.prototype.getVisibleItems=function(){return this.itemSet&&this.itemSet.getVisibleItems()||[]},o.prototype.fit=function(t){var e=this.getDataRange();if(null!==e.min||null!==e.max){var i=e.max-e.min,o=new Date(e.min.valueOf()-.01*i),n=new Date(e.max.valueOf()+.01*i),s=!t||void 0===t.animation||t.animation;this.range.setRange(o,n,s)}},o.prototype.getDataRange=function(){throw new Error("Cannot invoke abstract method getDataRange")},o.prototype.setWindow=function(t,e,i){var o;if(1==arguments.length){var n=arguments[0];o=void 0===n.animation||n.animation,this.range.setRange(n.start,n.end,o)}else o=!i||void 0===i.animation||i.animation,this.range.setRange(t,e,o)},o.prototype.moveTo=function(t,e){var i=this.range.end-this.range.start,o=h.convert(t,"Date").valueOf(),n=o-i/2,s=o+i/2,r=!e||void 0===e.animation||e.animation;this.range.setRange(n,s,r)},o.prototype.getWindow=function(){var t=this.range.getRange();return{start:new Date(t.start),end:new Date(t.end)}},o.prototype.zoomIn=function(t){if(!(!t||t<0||t>1)){var e=this.getWindow(),i=e.start.valueOf(),o=e.end.valueOf(),n=o-i,s=n/(1+t),r=(n-s)/2,a=i+r,h=o-r;this.setWindow({start:a,end:h})}},o.prototype.zoomOut=function(t){if(!(!t||t<0||t>1)){var e=this.getWindow(),i=e.start.valueOf(),o=e.end.valueOf(),n=o-i,s=i-n*t/2,r=o+n*t/2;this.setWindow({start:s,end:r})}},o.prototype.redraw=function(){this._redraw()},o.prototype._redraw=function(){this.redrawCount++;var t=!1,e=this.options,i=this.props,o=this.dom;if(o&&o.container&&0!=o.root.offsetWidth){u.updateHiddenDates(this.options.moment,this.body,this.options.hiddenDates),"top"==e.orientation?(h.addClassName(o.root,"vis-top"),h.removeClassName(o.root,"vis-bottom")):(h.removeClassName(o.root,"vis-top"),h.addClassName(o.root,"vis-bottom")),o.root.style.maxHeight=h.option.asSize(e.maxHeight,""),o.root.style.minHeight=h.option.asSize(e.minHeight,""),o.root.style.width=h.option.asSize(e.width,""),i.border.left=(o.centerContainer.offsetWidth-o.centerContainer.clientWidth)/2,i.border.right=i.border.left,i.border.top=(o.centerContainer.offsetHeight-o.centerContainer.clientHeight)/2,i.border.bottom=i.border.top;var n=o.root.offsetHeight-o.root.clientHeight,s=o.root.offsetWidth-o.root.clientWidth;0===o.centerContainer.clientHeight&&(i.border.left=i.border.top,i.border.right=i.border.left),0===o.root.clientHeight&&(s=n),i.center.height=o.center.offsetHeight,i.left.height=o.left.offsetHeight,i.right.height=o.right.offsetHeight,i.top.height=o.top.clientHeight||-i.border.top,i.bottom.height=o.bottom.clientHeight||-i.border.bottom;var a=Math.max(i.left.height,i.center.height,i.right.height),d=i.top.height+a+i.bottom.height+n+i.border.top+i.border.bottom;o.root.style.height=h.option.asSize(e.height,d+"px"),i.root.height=o.root.offsetHeight,i.background.height=i.root.height-n;var l=i.root.height-i.top.height-i.bottom.height-n;i.centerContainer.height=l,i.leftContainer.height=l,i.rightContainer.height=i.leftContainer.height,i.root.width=o.root.offsetWidth,i.background.width=i.root.width-s,this.initialDrawDone||(i.scrollbarWidth=h.getScrollBarWidth()),this.options.verticalScroll?this.options.rtl?(i.left.width=o.leftContainer.clientWidth||-i.border.left,i.right.width=o.rightContainer.clientWidth+i.scrollbarWidth||-i.border.right):(i.left.width=o.leftContainer.clientWidth+i.scrollbarWidth||-i.border.left,i.right.width=o.rightContainer.clientWidth||-i.border.right):(i.left.width=o.leftContainer.clientWidth||-i.border.left,i.right.width=o.rightContainer.clientWidth||-i.border.right),i.leftContainer.width=i.left.width,i.rightContainer.width=i.right.width;var p=i.root.width-i.left.width-i.right.width-s;i.center.width=p,i.centerContainer.width=p,i.top.width=p,i.bottom.width=p,o.background.style.height=i.background.height+"px",o.backgroundVertical.style.height=i.background.height+"px",o.backgroundHorizontal.style.height=i.centerContainer.height+"px",o.centerContainer.style.height=i.centerContainer.height+"px",o.leftContainer.style.height=i.leftContainer.height+"px",o.rightContainer.style.height=i.rightContainer.height+"px",o.background.style.width=i.background.width+"px",o.backgroundVertical.style.width=i.centerContainer.width+"px",o.backgroundHorizontal.style.width=i.background.width+"px",o.centerContainer.style.width=i.center.width+"px",o.top.style.width=i.top.width+"px",o.bottom.style.width=i.bottom.width+"px",o.background.style.left="0",o.background.style.top="0",o.backgroundVertical.style.left=i.left.width+i.border.left+"px",o.backgroundVertical.style.top="0",o.backgroundHorizontal.style.left="0",o.backgroundHorizontal.style.top=i.top.height+"px",o.centerContainer.style.left=i.left.width+"px",o.centerContainer.style.top=i.top.height+"px",o.leftContainer.style.left="0",o.leftContainer.style.top=i.top.height+"px",o.rightContainer.style.left=i.left.width+i.center.width+"px",o.rightContainer.style.top=i.top.height+"px",o.top.style.left=i.left.width+"px",o.top.style.top="0",o.bottom.style.left=i.left.width+"px",o.bottom.style.top=i.top.height+i.centerContainer.height+"px";var c=this._updateScrollTop();"top"!=e.orientation.item&&(c+=Math.max(this.props.centerContainer.height-this.props.center.height-this.props.border.top-this.props.border.bottom,0)),o.center.style.left="0",o.center.style.top=c+"px",o.left.style.left="0",o.right.style.left="0";var m=0==this.props.scrollTop?"hidden":"",f=this.props.scrollTop==this.props.scrollTopMin?"hidden":"";o.shadowTop.style.visibility=m,o.shadowBottom.style.visibility=f,o.shadowTopLeft.style.visibility=m,o.shadowBottomLeft.style.visibility=f,o.shadowTopRight.style.visibility=m,o.shadowBottomRight.style.visibility=f,this.options.verticalScroll?(o.shadowTopRight.style.visibility="hidden",o.shadowBottomRight.style.visibility="hidden",o.shadowTopLeft.style.visibility="hidden",o.shadowBottomLeft.style.visibility="hidden"):(o.left.style.top=c+"px",o.right.style.top=c+"px");var g=this.props.center.height>this.props.centerContainer.height;this.hammer.get("pan").set({direction:g?r.DIRECTION_ALL:r.DIRECTION_HORIZONTAL}),this.components.forEach(function(e){t=e.redraw()||t});var v=5;if(t){if(this.redrawCount0&&(this.props.scrollTop=0),this.props.scrollTope&&o.push(h.id):h.lefti&&o.push(h.id)}return o},o.prototype._deselect=function(t){for(var e=this.selection,i=0,o=e.length;io)return}}if(e&&e!=this.groupTouchParams.group){var h=this.groupsData,d=h.get(e.groupId),l=h.get(this.groupTouchParams.group.groupId);l&&d&&(this.options.groupOrderSwap(l,d,this.groupsData),this.groupsData.update(l),this.groupsData.update(d));var u=this.groupsData.getIds({order:this.options.groupOrder});if(!r.equalArray(u,this.groupTouchParams.originalOrder))for(var h=this.groupsData,p=this.groupTouchParams.originalOrder,c=this.groupTouchParams.group.groupId,m=Math.min(p.length,u.length),f=0,g=0,v=0;f=m)break;if(u[f+g]!=c)if(p[f+v]!=c){var y=u.indexOf(p[f+v]),b=h.get(u[f+g]),_=h.get(p[f+v]);this.options.groupOrderSwap(b,_,h),h.update(b),h.update(_);var w=u[f+g];u[f+g]=p[f+v],u[y]=w,f++}else v=1;else g=1}}}},o.prototype._onGroupDragEnd=function(t){if(this.options.groupEditable.order&&this.groupTouchParams.group){t.stopPropagation();var e=this,i=e.groupTouchParams.group.groupId,o=e.groupsData.getDataSet(),n=r.extend({},o.get(i));e.options.onMoveGroup(n,function(t){if(t)t[o._fieldId]=i,o.update(t);else{var n=o.getIds({order:e.options.groupOrder});if(!r.equalArray(n,e.groupTouchParams.originalOrder))for(var s=e.groupTouchParams.originalOrder,a=Math.min(s.length,n.length),h=0;h=a)break;var d=n.indexOf(s[h]),l=o.get(n[h]),u=o.get(s[h]);e.options.groupOrderSwap(l,u,o),groupsData.update(l),groupsData.update(u);var p=n[h];n[h]=s[h],n[d]=p,h++}}}),e.body.emitter.emit("groupDragged",{groupId:i})}},o.prototype._onSelectItem=function(t){if(this.options.selectable){var e=t.srcEvent&&(t.srcEvent.ctrlKey||t.srcEvent.metaKey),i=t.srcEvent&&t.srcEvent.shiftKey;if(e||i)return void this._onMultiSelectItem(t);var o=this.getSelection(),n=this.itemFromTarget(t),s=n?[n.id]:[];this.setSelection(s);var r=this.getSelection();(r.length>0||o.length>0)&&this.body.emitter.emit("select",{items:r,event:t})}},o.prototype._onMouseOver=function(t){var e=this.itemFromTarget(t);e&&this.body.emitter.emit("itemover",{item:e.id,event:t})},o.prototype._onMouseOut=function(t){var e=this.itemFromTarget(t);e&&this.body.emitter.emit("itemout",{item:e.id,event:t})},o.prototype._onAddItem=function(t){if(this.options.selectable&&this.options.editable.add){var e=this,i=this.options.snap||null,o=this.itemFromTarget(t);if(o){var n=e.itemsData.get(o.id);this.options.onUpdate(n,function(t){t&&e.itemsData.getDataSet().update(t)})}else{if(this.options.rtl)var s=r.getAbsoluteRight(this.dom.frame),a=s-t.center.x;else var s=r.getAbsoluteLeft(this.dom.frame),a=t.center.x-s;var h=this.body.util.toTime(a),d=this.body.util.getScale(),l=this.body.util.getStep(),u={start:i?i(h,d,l):h,content:"new item"};if("drop"==t.type){var n=JSON.parse(t.dataTransfer.getData("text/plain"));if(u.content=n.content,u.type=n.type||"box",u[this.itemsData._fieldId]=n.id||r.randomUUID(),"range"==n.type||n.end&&n.start)if(n.end)u.end=new Date(u.start._i).getTime()+new Date(n.end).getTime()-new Date(n.start).getTime();else{var p=this.body.util.toTime(a+this.props.width/5);u.end=i?i(p,d,l):p}}else if(u[this.itemsData._fieldId]=r.randomUUID(),"range"===this.options.type){var p=this.body.util.toTime(a+this.props.width/5);u.end=i?i(p,d,l):p}var c=this.groupFromTarget(t);c&&(u.group=c.groupId),u=this._cloneItemData(u),this.options.onAdd(u,function(i){i&&(e.itemsData.getDataSet().add(i),"drop"==t.type&&e.setSelection([i.id]))})}}},o.prototype._onMultiSelectItem=function(t){if(this.options.selectable){var e=this.itemFromTarget(t);if(e){var i=this.options.multiselect?this.getSelection():[],n=t.srcEvent&&t.srcEvent.shiftKey||!1;if(n&&this.options.multiselect){var s=this.itemsData.get(e.id).group,r=void 0;this.options.multiselectPerGroup&&i.length>0&&(r=this.itemsData.get(i[0]).group),this.options.multiselectPerGroup&&void 0!=r&&r!=s||i.push(e.id);var a=o._getItemRange(this.itemsData.get(i,this.itemOptions));if(!this.options.multiselectPerGroup||r==s){i=[];for(var h in this.items)if(this.items.hasOwnProperty(h)){var d=this.items[h],l=d.data.start,u=void 0!==d.data.end?d.data.end:l;!(l>=a.min&&u<=a.max)||this.options.multiselectPerGroup&&r!=this.itemsData.get(d.id).group||d instanceof g||i.push(d.id)}}}else{var p=i.indexOf(e.id);p==-1?i.push(e.id):i.splice(p,1)}this.setSelection(i),this.body.emitter.emit("select",{items:this.getSelection(),event:t})}}},o._getItemRange=function(t){var e=null,i=null;return t.forEach(function(t){(null==i||t.starte)&&(e=t.end):(null==e||t.start>e)&&(e=t.start)}),{min:i,max:e}},o.prototype.itemFromTarget=function(t){for(var e=t.target;e;){if(e.hasOwnProperty("timeline-item"))return e["timeline-item"];e=e.parentNode}return null},o.prototype.groupFromTarget=function(t){for(var e=t.center?t.center.y:t.clientY,i=0;ia&&ea)return n}else if(0===i&&e0?t.step:1,this.autoScale=!1)},o.prototype.setAutoScale=function(t){this.autoScale=t},o.prototype.setMinimumStep=function(t){if(void 0!=t){var e=31104e6,i=2592e6,o=864e5,n=36e5,s=6e4,r=1e3,a=1;1e3*e>t&&(this.scale="year",this.step=1e3),500*e>t&&(this.scale="year",this.step=500),100*e>t&&(this.scale="year",this.step=100),50*e>t&&(this.scale="year",this.step=50),10*e>t&&(this.scale="year",this.step=10),5*e>t&&(this.scale="year",this.step=5),e>t&&(this.scale="year",this.step=1),3*i>t&&(this.scale="month",this.step=3),i>t&&(this.scale="month",this.step=1),5*o>t&&(this.scale="day",this.step=5),2*o>t&&(this.scale="day",this.step=2),o>t&&(this.scale="day",this.step=1),o/2>t&&(this.scale="weekday",this.step=1),4*n>t&&(this.scale="hour",this.step=4),n>t&&(this.scale="hour",this.step=1),15*s>t&&(this.scale="minute",this.step=15),10*s>t&&(this.scale="minute",this.step=10),5*s>t&&(this.scale="minute",this.step=5),s>t&&(this.scale="minute",this.step=1),15*r>t&&(this.scale="second",this.step=15),10*r>t&&(this.scale="second",this.step=10),5*r>t&&(this.scale="second",this.step=5),r>t&&(this.scale="second",this.step=1),200*a>t&&(this.scale="millisecond",this.step=200),100*a>t&&(this.scale="millisecond",this.step=100),50*a>t&&(this.scale="millisecond",this.step=50),10*a>t&&(this.scale="millisecond",this.step=10),5*a>t&&(this.scale="millisecond",this.step=5),a>t&&(this.scale="millisecond",this.step=1)}},o.snap=function(t,e,i){var o=n(t);if("year"==e){var s=o.year()+Math.round(o.month()/12);o.year(Math.round(s/i)*i),o.month(0),o.date(0),o.hours(0),o.minutes(0),o.seconds(0),o.milliseconds(0)}else if("month"==e)o.date()>15?(o.date(1),o.add(1,"month")):o.date(1),o.hours(0),o.minutes(0),o.seconds(0),o.milliseconds(0);else if("day"==e){switch(i){case 5:case 2:o.hours(24*Math.round(o.hours()/24));break;default:o.hours(12*Math.round(o.hours()/12))}o.minutes(0),o.seconds(0),o.milliseconds(0)}else if("weekday"==e){switch(i){case 5:case 2:o.hours(12*Math.round(o.hours()/12));break;default:o.hours(6*Math.round(o.hours()/6))}o.minutes(0),o.seconds(0),o.milliseconds(0)}else if("hour"==e){switch(i){case 4:o.minutes(60*Math.round(o.minutes()/60));break;default:o.minutes(30*Math.round(o.minutes()/30))}o.seconds(0),o.milliseconds(0)}else if("minute"==e){switch(i){case 15:case 10:o.minutes(5*Math.round(o.minutes()/5)),o.seconds(0);break;case 5:o.seconds(60*Math.round(o.seconds()/60));break;default:o.seconds(30*Math.round(o.seconds()/30))}o.milliseconds(0)}else if("second"==e)switch(i){case 15:case 10:o.seconds(5*Math.round(o.seconds()/5)),o.milliseconds(0);break;case 5:o.milliseconds(1e3*Math.round(o.milliseconds()/1e3));break;default:o.milliseconds(500*Math.round(o.milliseconds()/500))}else if("millisecond"==e){var r=i>5?i/2:1;o.milliseconds(Math.round(o.milliseconds()/r)*r)}return o},o.prototype.isMajor=function(){if(1==this.switchedYear)switch(this.scale){case"year":case"month":case"weekday":case"day":case"hour":case"minute":case"second":case"millisecond":return!0;default:return!1}else if(1==this.switchedMonth)switch(this.scale){case"weekday":case"day":case"hour":case"minute":case"second":case"millisecond":return!0;default:return!1}else if(1==this.switchedDay)switch(this.scale){case"millisecond":case"second":case"minute":case"hour":return!0;default:return!1}var t=this.moment(this.current);switch(this.scale){case"millisecond":return 0==t.milliseconds();case"second":return 0==t.seconds();case"minute":return 0==t.hours()&&0==t.minutes();case"hour":return 0==t.hours();case"weekday":case"day":return 1==t.date();case"month":return 0==t.month();case"year":return!1;default:return!1}},o.prototype.getLabelMinor=function(t){if(void 0==t&&(t=this.current),"function"==typeof this.format.minorLabels)return this.format.minorLabels(t,this.scale,this.step);var e=this.format.minorLabels[this.scale];return e&&e.length>0?this.moment(t).format(e):""},o.prototype.getLabelMajor=function(t){if(void 0==t&&(t=this.current),"function"==typeof this.format.majorLabels)return this.format.majorLabels(t,this.scale,this.step);var e=this.format.majorLabels[this.scale];return e&&e.length>0?this.moment(t).format(e):""},o.prototype.getClassName=function(){function t(t){return t/h%2==0?" vis-even":" vis-odd"}function e(t){return t.isSame(new Date,"day")?" vis-today":t.isSame(s().add(1,"day"),"day")?" vis-tomorrow":t.isSame(s().add(-1,"day"),"day")?" vis-yesterday":""}function i(t){return t.isSame(new Date,"week")?" vis-current-week":""}function o(t){return t.isSame(new Date,"month")?" vis-current-month":""}function n(t){return t.isSame(new Date,"year")?" vis-current-year":""}var s=this.moment,r=this.moment(this.current),a=r.locale?r.locale("en"):r.lang("en"),h=this.step;switch(this.scale){case"millisecond":return e(a)+t(a.milliseconds()).trim();case"second":return e(a)+t(a.seconds()).trim();case"minute":return e(a)+t(a.minutes()).trim();case"hour":return"vis-h"+a.hours()+(4==this.step?"-h"+(a.hours()+4):"")+e(a)+t(a.hours());case"weekday":return"vis-"+a.format("dddd").toLowerCase()+e(a)+i(a)+t(a.date());case"day":return"vis-day"+a.date()+" vis-"+a.format("MMMM").toLowerCase()+e(a)+o(a)+this.step<=2?e(a):""+this.step<=2?" vis-"+a.format("dddd").toLowerCase():""+t(a.date()-1);case"month":return"vis-"+a.format("MMMM").toLowerCase()+o(a)+t(a.month());case"year":var d=a.year();return"vis-year"+d+n(a)+t(d);default:return""}},t.exports=o},function(t,e,i){function o(t,e,i){this.groupId=t,this.subgroups={},this.subgroupIndex=0,this.subgroupOrderer=e&&e.subgroupOrder,this.itemSet=i,this.isVisible=null,this.dom={},this.props={label:{width:0,height:0}},this.className=null,this.items={},this.visibleItems=[],this.orderedItems={byStart:[],byEnd:[]},this.checkRangedItems=!1;var o=this;this.itemSet.body.emitter.on("checkRangedItems",function(){o.checkRangedItems=!0}),this._create(),this.setData(e)}var n=i(1),s=i(27);i(28);o.prototype._create=function(){var t=document.createElement("div"); -this.itemSet.options.groupEditable.order?t.className="vis-label draggable":t.className="vis-label",this.dom.label=t;var e=document.createElement("div");e.className="vis-inner",t.appendChild(e),this.dom.inner=e;var i=document.createElement("div");i.className="vis-group",i["timeline-group"]=this,this.dom.foreground=i,this.dom.background=document.createElement("div"),this.dom.background.className="vis-group",this.dom.axis=document.createElement("div"),this.dom.axis.className="vis-group",this.dom.marker=document.createElement("div"),this.dom.marker.style.visibility="hidden",this.dom.marker.innerHTML="?",this.dom.background.appendChild(this.dom.marker)},o.prototype.setData=function(t){var e,i;if(this.itemSet.options&&this.itemSet.options.groupTemplate?(i=this.itemSet.options.groupTemplate.bind(this),e=i(t,this.dom.inner)):e=t&&t.content,e instanceof Element){for(this.dom.inner.appendChild(e);this.dom.inner.firstChild;)this.dom.inner.removeChild(this.dom.inner.firstChild);this.dom.inner.appendChild(e)}else e instanceof Object?i(t,this.dom.inner):void 0!==e&&null!==e?this.dom.inner.innerHTML=e:this.dom.inner.innerHTML=this.groupId||"";this.dom.label.title=t&&t.title||"",this.dom.inner.firstChild?n.removeClassName(this.dom.inner,"vis-hidden"):n.addClassName(this.dom.inner,"vis-hidden");var o=t&&t.className||null;o!=this.className&&(this.className&&(n.removeClassName(this.dom.label,this.className),n.removeClassName(this.dom.foreground,this.className),n.removeClassName(this.dom.background,this.className),n.removeClassName(this.dom.axis,this.className)),n.addClassName(this.dom.label,o),n.addClassName(this.dom.foreground,o),n.addClassName(this.dom.background,o),n.addClassName(this.dom.axis,o),this.className=o),this.style&&(n.removeCssText(this.dom.label,this.style),this.style=null),t&&t.style&&(n.addCssText(this.dom.label,t.style),this.style=t.style)},o.prototype.getLabelWidth=function(){return this.props.label.width},o.prototype.redraw=function(t,e,i){var o=!1,r=this.dom.marker.clientHeight;r!=this.lastMarkerHeight&&(this.lastMarkerHeight=r,n.forEach(this.items,function(t){t.dirty=!0,t.displayed&&t.redraw()}),i=!0),this._calculateSubGroupHeights(),this.isVisible=this._isGroupVisible(t,e);var a=this.dom.foreground;if(this.top=a.offsetTop,this.right=a.offsetLeft,this.width=a.offsetWidth,this.isVisible=this._isGroupVisible(t,e),"function"==typeof this.itemSet.options.order){if(i){var h=this,d=!1;n.forEach(this.items,function(t){t.displayed||(t.redraw(),h.visibleItems.push(t)),t.repositionX(d)});var l=this.orderedItems.byStart.slice().sort(function(t,e){return h.itemSet.options.order(t.data,e.data)});s.stack(l,e,!0)}this.visibleItems=this._updateVisibleItems(this.orderedItems,this.visibleItems,t)}else this.visibleItems=this._updateVisibleItems(this.orderedItems,this.visibleItems,t),this.itemSet.options.stack?s.stack(this.visibleItems,e,i):s.nostack(this.visibleItems,e,this.subgroups);if(!this.isVisible&&this.height)return o=!1;var u=this._calculateHeight(e),a=this.dom.foreground;this.top=a.offsetTop,this.right=a.offsetLeft,this.width=a.offsetWidth,o=n.updateProperty(this,"height",u)||o,o=n.updateProperty(this.props.label,"width",this.dom.inner.clientWidth)||o,o=n.updateProperty(this.props.label,"height",this.dom.inner.clientHeight)||o,this.dom.background.style.height=u+"px",this.dom.foreground.style.height=u+"px",this.dom.label.style.height=u+"px";for(var p=0,c=this.visibleItems.length;p0){var t=this;this.resetSubgroups(),n.forEach(this.visibleItems,function(e){void 0!==e.data.subgroup&&(t.subgroups[e.data.subgroup].height=Math.max(t.subgroups[e.data.subgroup].height,e.height),t.subgroups[e.data.subgroup].visible=!0)})}},o.prototype._isGroupVisible=function(t,e){var i=this.top<=t.body.domProps.centerContainer.height-t.body.domProps.scrollTop+e.axis&&this.top+this.height+e.axis>=-t.body.domProps.scrollTop;return i},o.prototype._calculateHeight=function(t){var e,i=this.visibleItems;if(i.length>0){var o=i[0].top,s=i[0].top+i[0].height;if(n.forEach(i,function(t){o=Math.min(o,t.top),s=Math.max(s,t.top+t.height)}),o>t.axis){var r=o-t.axis;s-=r,n.forEach(i,function(t){t.top-=r})}e=s+t.item.vertical/2}else e=0;return e=Math.max(e,this.props.label.height)},o.prototype.show=function(){this.dom.label.parentNode||this.itemSet.dom.labelSet.appendChild(this.dom.label),this.dom.foreground.parentNode||this.itemSet.dom.foreground.appendChild(this.dom.foreground),this.dom.background.parentNode||this.itemSet.dom.background.appendChild(this.dom.background),this.dom.axis.parentNode||this.itemSet.dom.axis.appendChild(this.dom.axis)},o.prototype.hide=function(){var t=this.dom.label;t.parentNode&&t.parentNode.removeChild(t);var e=this.dom.foreground;e.parentNode&&e.parentNode.removeChild(e);var i=this.dom.background;i.parentNode&&i.parentNode.removeChild(i);var o=this.dom.axis;o.parentNode&&o.parentNode.removeChild(o)},o.prototype.add=function(t){if(this.items[t.id]=t,t.setParent(this),void 0!==t.data.subgroup&&(void 0===this.subgroups[t.data.subgroup]&&(this.subgroups[t.data.subgroup]={height:0,visible:!1,index:this.subgroupIndex,items:[]},this.subgroupIndex++),this.subgroups[t.data.subgroup].items.push(t)),this.orderSubgroups(),this.visibleItems.indexOf(t)==-1){var e=this.itemSet.body.range;this._checkIfVisible(t,this.visibleItems,e)}},o.prototype.orderSubgroups=function(){if(void 0!==this.subgroupOrderer){var t=[];if("string"==typeof this.subgroupOrderer){for(var e in this.subgroups)t.push({subgroup:e,sortField:this.subgroups[e].items[0].data[this.subgroupOrderer]});t.sort(function(t,e){return t.sortField-e.sortField})}else if("function"==typeof this.subgroupOrderer){for(var e in this.subgroups)t.push(this.subgroups[e].items[0].data);t.sort(this.subgroupOrderer)}if(t.length>0)for(var i=0;i0)for(var r=0;rl}),1==this.checkRangedItems)for(this.checkRangedItems=!1,r=0;rl})}for(var r=0;r=0;s--){var r=e[s];if(n(r))break;void 0===o[r.id]&&(o[r.id]=!0,i.push(r))}for(var s=t+1;se.right&&t.top-o.vertical+ie.top:t.left-o.horizontal+ie.left&&t.top-o.vertical+ie.top}},function(t,e,i){function o(t,e,i){if(this.props={content:{width:0}},this.overflow=!1,this.options=i,t){if(void 0==t.start)throw new Error('Property "start" missing in item '+t.id);if(void 0==t.end)throw new Error('Property "end" missing in item '+t.id)}n.call(this,t,e,i)}var n=(i(14),i(29));o.prototype=new n(null,null,null),o.prototype.baseClassName="vis-item vis-range",o.prototype.isVisible=function(t){return this.data.startt.start},o.prototype.redraw=function(){var t=this.dom;if(t||(this.dom={},t=this.dom,t.box=document.createElement("div"),t.frame=document.createElement("div"),t.frame.className="vis-item-overflow",t.box.appendChild(t.frame),t.content=document.createElement("div"),t.content.className="vis-item-content",t.frame.appendChild(t.content),t.box["timeline-item"]=this,this.dirty=!0),!this.parent)throw new Error("Cannot redraw item: no parent attached");if(!t.box.parentNode){var e=this.parent.dom.foreground;if(!e)throw new Error("Cannot redraw item: parent has no foreground container element");e.appendChild(t.box)}if(this.displayed=!0,this.dirty){this._updateContents(this.dom.content),this._updateTitle(this.dom.box),this._updateDataAttributes(this.dom.box),this._updateStyle(this.dom.box);var i=(this.options.editable.updateTime||this.options.editable.updateGroup||this.editable===!0)&&this.editable!==!1,o=(this.data.className?" "+this.data.className:"")+(this.selected?" vis-selected":"")+(i?" vis-editable":" vis-readonly");t.box.className=this.baseClassName+o,this.overflow="hidden"!==window.getComputedStyle(t.frame).overflow,this.dom.content.style.maxWidth="none",this.props.content.width=this.dom.content.offsetWidth,this.height=this.dom.box.offsetHeight,this.dom.content.style.maxWidth="",this.dirty=!1}this._repaintOnItemUpdateTimeTooltip(t.box),this._repaintDeleteButton(t.box),this._repaintDragCenter(),this._repaintDragLeft(),this._repaintDragRight()},o.prototype.show=function(){this.displayed||this.redraw()},o.prototype.hide=function(){if(this.displayed){var t=this.dom.box;t.parentNode&&t.parentNode.removeChild(t),this.displayed=!1}},o.prototype.repositionX=function(t){var e,i,o=this.parent.width,n=this.conversion.toScreen(this.data.start),s=this.conversion.toScreen(this.data.end);void 0!==t&&t!==!0||(n<-o&&(n=-o),s>2*o&&(s=2*o));var r=Math.max(s-n+.5,1);switch(this.overflow?(this.options.rtl?this.right=n:this.left=n,this.width=r+this.props.content.width,i=this.props.content.width):(this.options.rtl?this.right=n:this.left=n,this.width=r,i=Math.min(s-n,this.props.content.width)),this.options.rtl?this.dom.box.style.right=this.right+"px":this.dom.box.style.left=this.left+"px",this.dom.box.style.width=r+"px",this.options.align){case"left":this.options.rtl?this.dom.content.style.right="0":this.dom.content.style.left="0";break;case"right":this.options.rtl?this.dom.content.style.right=Math.max(r-i,0)+"px":this.dom.content.style.left=Math.max(r-i,0)+"px";break;case"center":this.options.rtl?this.dom.content.style.right=Math.max((r-i)/2,0)+"px":this.dom.content.style.left=Math.max((r-i)/2,0)+"px";break;default:e=this.overflow?s>0?Math.max(-n,0):-i:n<0?-n:0,this.options.rtl?this.dom.content.style.right=e+"px":(this.dom.content.style.left=e+"px",this.dom.content.style.width="calc(100% - "+e+"px)")}},o.prototype.repositionY=function(){var t=this.options.orientation.item,e=this.dom.box;"top"==t?e.style.top=this.top+"px":e.style.top=this.parent.height-this.top-this.height+"px"},o.prototype._repaintDragLeft=function(){if(this.selected&&this.options.editable.updateTime&&!this.dom.dragLeft){var t=document.createElement("div");t.className="vis-drag-left",t.dragLeftItem=this,this.dom.box.appendChild(t),this.dom.dragLeft=t}else!this.selected&&this.dom.dragLeft&&(this.dom.dragLeft.parentNode&&this.dom.dragLeft.parentNode.removeChild(this.dom.dragLeft),this.dom.dragLeft=null)},o.prototype._repaintDragRight=function(){if(this.selected&&this.options.editable.updateTime&&!this.dom.dragRight){var t=document.createElement("div");t.className="vis-drag-right",t.dragRightItem=this,this.dom.box.appendChild(t),this.dom.dragRight=t}else!this.selected&&this.dom.dragRight&&(this.dom.dragRight.parentNode&&this.dom.dragRight.parentNode.removeChild(this.dom.dragRight),this.dom.dragRight=null)},t.exports=o},function(t,e,i){function o(t,e,i){this.id=null,this.parent=null,this.data=t,this.dom=null,this.conversion=e||{},this.options=i||{},this.selected=!1,this.displayed=!1,this.dirty=!0,this.top=null,this.right=null,this.left=null,this.width=null,this.height=null,this.editable=null,this.data&&this.data.hasOwnProperty("editable")&&"boolean"==typeof this.data.editable&&(this.editable=t.editable)}var n=i(14),s=i(1),r=i(2);o.prototype.stack=!0,o.prototype.select=function(){this.selected=!0,this.dirty=!0,this.displayed&&this.redraw()},o.prototype.unselect=function(){this.selected=!1,this.dirty=!0,this.displayed&&this.redraw()},o.prototype.setData=function(t){var e=void 0!=t.group&&this.data.group!=t.group;e&&this.parent.itemSet._moveToGroup(this,t.group),t.hasOwnProperty("editable")&&"boolean"==typeof t.editable&&(this.editable=t.editable),this.data=t,this.dirty=!0,this.displayed&&this.redraw()},o.prototype.setParent=function(t){this.displayed?(this.hide(),this.parent=t,this.parent&&this.show()):this.parent=t},o.prototype.isVisible=function(t){return!1},o.prototype.show=function(){return!1},o.prototype.hide=function(){return!1},o.prototype.redraw=function(){},o.prototype.repositionX=function(){},o.prototype.repositionY=function(){},o.prototype._repaintDeleteButton=function(t){var e=(this.options.editable.remove||this.data.editable===!0)&&this.data.editable!==!1;if(this.selected&&e&&!this.dom.deleteButton){var i=this,o=document.createElement("div");this.options.rtl?o.className="vis-delete-rtl":o.className="vis-delete",o.title="Delete this item",new n(o).on("tap",function(t){t.stopPropagation(),i.parent.removeFromDataSet(i)}),t.appendChild(o),this.dom.deleteButton=o}else!this.selected&&this.dom.deleteButton&&(this.dom.deleteButton.parentNode&&this.dom.deleteButton.parentNode.removeChild(this.dom.deleteButton),this.dom.deleteButton=null)},o.prototype._repaintOnItemUpdateTimeTooltip=function(t){if(this.options.tooltipOnItemUpdateTime){var e=(this.options.editable.updateTime||this.data.editable===!0)&&this.data.editable!==!1;if(this.selected&&e&&!this.dom.onItemUpdateTimeTooltip){var i=document.createElement("div");i.className="vis-onUpdateTime-tooltip",t.appendChild(i),this.dom.onItemUpdateTimeTooltip=i}else!this.selected&&this.dom.onItemUpdateTimeTooltip&&(this.dom.onItemUpdateTimeTooltip.parentNode&&this.dom.onItemUpdateTimeTooltip.parentNode.removeChild(this.dom.onItemUpdateTimeTooltip),this.dom.onItemUpdateTimeTooltip=null);if(this.dom.onItemUpdateTimeTooltip){this.dom.onItemUpdateTimeTooltip.style.visibility=this.parent.itemSet.touchParams.itemIsDragging?"visible":"hidden",this.options.rtl?this.dom.onItemUpdateTimeTooltip.style.right=this.dom.content.style.right:this.dom.onItemUpdateTimeTooltip.style.left=this.dom.content.style.left;var o,n=50,s=this.parent.itemSet.body.domProps.scrollTop;o="top"==this.options.orientation.item?this.top:this.parent.height-this.top-this.height;var a=o+this.parent.top-n<-s;a?(this.dom.onItemUpdateTimeTooltip.style.bottom="",this.dom.onItemUpdateTimeTooltip.style.top=this.height+2+"px"):(this.dom.onItemUpdateTimeTooltip.style.top="",this.dom.onItemUpdateTimeTooltip.style.bottom=this.height+2+"px");var h,d;this.options.tooltipOnItemUpdateTime&&this.options.tooltipOnItemUpdateTime.template?(d=this.options.tooltipOnItemUpdateTime.template.bind(this),h=d(this.data)):(h="start: "+r(this.data.start).format("MM/DD/YYYY hh:mm"),this.data.end&&(h+="
end: "+r(this.data.end).format("MM/DD/YYYY hh:mm"))),this.dom.onItemUpdateTimeTooltip.innerHTML=h}}},o.prototype._updateContents=function(t){var e,i;if(this.options.template){var o=this.parent.itemSet.itemsData.get(this.id);i=this.options.template.bind(this),e=i(o,t)}else e=this.data.content;if(e instanceof Object&&!(e instanceof Element))i(o,t);else{var n=this._contentToString(this.content)!==this._contentToString(e);if(n){if(e instanceof Element)t.innerHTML="",t.appendChild(e);else if(void 0!=e)t.innerHTML=e;else if("background"!=this.data.type||void 0!==this.data.content)throw new Error('Property "content" missing in item '+this.id);this.content=e}}},o.prototype._updateTitle=function(t){null!=this.data.title?t.title=this.data.title||"":t.removeAttribute("vis-title")},o.prototype._updateDataAttributes=function(t){if(this.options.dataAttributes&&this.options.dataAttributes.length>0){var e=[];if(Array.isArray(this.options.dataAttributes))e=this.options.dataAttributes;else{if("all"!=this.options.dataAttributes)return;e=Object.keys(this.data)}for(var i=0;it.start&&this.data.start.getTime()-nt.start&&this.data.start.getTime()t.start&&this.data.start.getTime()-n/2t.start&&this.data.startt.start},o.prototype.redraw=function(){var t=this.dom;if(t||(this.dom={},t=this.dom,t.box=document.createElement("div"),t.frame=document.createElement("div"),t.frame.className="vis-item-overflow",t.box.appendChild(t.frame),t.content=document.createElement("div"),t.content.className="vis-item-content",t.frame.appendChild(t.content),this.dirty=!0),!this.parent)throw new Error("Cannot redraw item: no parent attached");if(!t.box.parentNode){var e=this.parent.dom.background;if(!e)throw new Error("Cannot redraw item: parent has no background container element");e.appendChild(t.box)}if(this.displayed=!0,this.dirty){this._updateContents(this.dom.content),this._updateTitle(this.dom.content),this._updateDataAttributes(this.dom.content),this._updateStyle(this.dom.box);var i=(this.data.className?" "+this.data.className:"")+(this.selected?" vis-selected":"");t.box.className=this.baseClassName+i,this.overflow="hidden"!==window.getComputedStyle(t.content).overflow,this.props.content.width=this.dom.content.offsetWidth,this.height=0,this.dirty=!1}},o.prototype.show=r.prototype.show,o.prototype.hide=r.prototype.hide,o.prototype.repositionX=r.prototype.repositionX,o.prototype.repositionY=function(t){var e="top"===this.options.orientation.item;this.dom.content.style.top=e?"":"0",this.dom.content.style.bottom=e?"0":"";var i;if(void 0!==this.data.subgroup){var o=this.data.subgroup,n=this.parent.subgroups,r=n[o].index;if(1==e){i=this.parent.subgroups[o].height+t.item.vertical,i+=0==r?t.axis-.5*t.item.vertical:0;var a=this.parent.top;for(var h in n)n.hasOwnProperty(h)&&1==n[h].visible&&n[h].indexr&&(a+=l)}i=this.parent.subgroups[o].height+t.item.vertical,this.dom.box.style.top=this.parent.height-d+a+"px",this.dom.box.style.bottom=""}}else this.parent instanceof s?(i=Math.max(this.parent.height,this.parent.itemSet.body.domProps.center.height,this.parent.itemSet.body.domProps.centerContainer.height),this.dom.box.style.top=e?"0":"",this.dom.box.style.bottom=e?"":"0"):(i=this.parent.height,this.dom.box.style.top=this.parent.top+"px",this.dom.box.style.bottom="");this.dom.box.style.height=i+"px"},t.exports=o},function(t,e,i){function o(t,e){this.dom={foreground:null,lines:[],majorTexts:[],minorTexts:[],redundant:{lines:[],majorTexts:[],minorTexts:[]}},this.props={range:{start:0,end:0,minimumStep:0},lineTop:0},this.defaultOptions={orientation:{axis:"bottom"},showMinorLabels:!0,showMajorLabels:!0,maxMinorChars:7,format:a.FORMAT,moment:d,timeAxis:null},this.options=s.extend({},this.defaultOptions),this.body=t,this._create(),this.setOptions(e)}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s=i(1),r=i(21),a=i(25),h=i(22),d=i(2);o.prototype=new r,o.prototype.setOptions=function(t){t&&(s.selectiveExtend(["showMinorLabels","showMajorLabels","maxMinorChars","hiddenDates","timeAxis","moment","rtl"],this.options,t),s.selectiveDeepExtend(["format"],this.options,t),"orientation"in t&&("string"==typeof t.orientation?this.options.orientation.axis=t.orientation:"object"===n(t.orientation)&&"axis"in t.orientation&&(this.options.orientation.axis=t.orientation.axis)),"locale"in t&&("function"==typeof d.locale?d.locale(t.locale):d.lang(t.locale)))},o.prototype._create=function(){this.dom.foreground=document.createElement("div"),this.dom.background=document.createElement("div"),this.dom.foreground.className="vis-time-axis vis-foreground",this.dom.background.className="vis-time-axis vis-background"},o.prototype.destroy=function(){this.dom.foreground.parentNode&&this.dom.foreground.parentNode.removeChild(this.dom.foreground),this.dom.background.parentNode&&this.dom.background.parentNode.removeChild(this.dom.background),this.body=null},o.prototype.redraw=function(){var t=this.props,e=this.dom.foreground,i=this.dom.background,o="top"==this.options.orientation.axis?this.body.dom.top:this.body.dom.bottom,n=e.parentNode!==o; -this._calculateCharSize();var s=this.options.showMinorLabels&&"none"!==this.options.orientation.axis,r=this.options.showMajorLabels&&"none"!==this.options.orientation.axis;t.minorLabelHeight=s?t.minorCharHeight:0,t.majorLabelHeight=r?t.majorCharHeight:0,t.height=t.minorLabelHeight+t.majorLabelHeight,t.width=e.offsetWidth,t.minorLineHeight=this.body.domProps.root.height-t.majorLabelHeight-("top"==this.options.orientation.axis?this.body.domProps.bottom.height:this.body.domProps.top.height),t.minorLineWidth=1,t.majorLineHeight=t.minorLineHeight+t.majorLabelHeight,t.majorLineWidth=1;var a=e.nextSibling,h=i.nextSibling;return e.parentNode&&e.parentNode.removeChild(e),i.parentNode&&i.parentNode.removeChild(i),e.style.height=this.props.height+"px",this._repaintLabels(),a?o.insertBefore(e,a):o.appendChild(e),h?this.body.dom.backgroundVertical.insertBefore(i,h):this.body.dom.backgroundVertical.appendChild(i),this._isResized()||n},o.prototype._repaintLabels=function(){var t=this.options.orientation.axis,e=s.convert(this.body.range.start,"Number"),i=s.convert(this.body.range.end,"Number"),o=this.body.util.toTime((this.props.minorCharWidth||10)*this.options.maxMinorChars).valueOf(),n=o-h.getHiddenDurationBefore(this.options.moment,this.body.hiddenDates,this.body.range,o);n-=this.body.util.toTime(0).valueOf();var r=new a(new Date(e),new Date(i),n,this.body.hiddenDates);r.setMoment(this.options.moment),this.options.format&&r.setFormat(this.options.format),this.options.timeAxis&&r.setScale(this.options.timeAxis),this.step=r;var d=this.dom;d.redundant.lines=d.lines,d.redundant.majorTexts=d.majorTexts,d.redundant.minorTexts=d.minorTexts,d.lines=[],d.majorTexts=[],d.minorTexts=[];var u,p,c,m,f,g,v,y,b,_,w=0,x=void 0,D=0,S=1e3;for(r.start(),p=r.getCurrent(),m=this.body.util.toScreen(p);r.hasNext()&&D=.4*v;if(this.options.showMinorLabels&&k){var C=this._repaintMinorText(c,b,t,_);C.style.width=w+"px"}f&&this.options.showMajorLabels?(c>0&&(void 0==x&&(x=c),C=this._repaintMajorText(c,r.getLabelMajor(),t,_)),y=this._repaintMajorLine(c,w,t,_)):k?y=this._repaintMinorLine(c,w,t,_):y&&(y.style.width=parseInt(y.style.width)+w+"px")}if(D!==S||l||(console.warn("Something is wrong with the Timeline scale. Limited drawing of grid lines to "+S+" lines."),l=!0),this.options.showMajorLabels){var T=this.body.util.toTime(0),O=r.getLabelMajor(T),M=O.length*(this.props.majorCharWidth||10)+10;(void 0==x||M1e3&&(o=1e3),e.redraw(),e.body.emitter.emit("currentTimeTick"),e.currentTimeTimer=setTimeout(t,o)}var e=this;t()},o.prototype.stop=function(){void 0!==this.currentTimeTimer&&(clearTimeout(this.currentTimeTimer),delete this.currentTimeTimer)},o.prototype.setCurrentTime=function(t){var e=n.convert(t,"Date").valueOf(),i=(new Date).valueOf();this.offset=e-i,this.redraw()},o.prototype.getCurrentTime=function(){return new Date((new Date).valueOf()+this.offset)},t.exports=o},function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i="string",o="boolean",n="number",s="array",r="date",a="object",h="dom",d="moment",l="any",u={configure:{enabled:{boolean:o},filter:{boolean:o,function:"function"},container:{dom:h},__type__:{object:a,boolean:o,function:"function"}},align:{string:i},rtl:{boolean:o,undefined:"undefined"},verticalScroll:{boolean:o,undefined:"undefined"},horizontalScroll:{boolean:o,undefined:"undefined"},autoResize:{boolean:o},clickToUse:{boolean:o},dataAttributes:{string:i,array:s},editable:{add:{boolean:o,undefined:"undefined"},remove:{boolean:o,undefined:"undefined"},updateGroup:{boolean:o,undefined:"undefined"},updateTime:{boolean:o,undefined:"undefined"},__type__:{boolean:o,object:a}},end:{number:n,date:r,string:i,moment:d},format:{minorLabels:{millisecond:{string:i,undefined:"undefined"},second:{string:i,undefined:"undefined"},minute:{string:i,undefined:"undefined"},hour:{string:i,undefined:"undefined"},weekday:{string:i,undefined:"undefined"},day:{string:i,undefined:"undefined"},month:{string:i,undefined:"undefined"},year:{string:i,undefined:"undefined"},__type__:{object:a,function:"function"}},majorLabels:{millisecond:{string:i,undefined:"undefined"},second:{string:i,undefined:"undefined"},minute:{string:i,undefined:"undefined"},hour:{string:i,undefined:"undefined"},weekday:{string:i,undefined:"undefined"},day:{string:i,undefined:"undefined"},month:{string:i,undefined:"undefined"},year:{string:i,undefined:"undefined"},__type__:{object:a,function:"function"}},__type__:{object:a}},moment:{function:"function"},groupOrder:{string:i,function:"function"},groupEditable:{add:{boolean:o,undefined:"undefined"},remove:{boolean:o,undefined:"undefined"},order:{boolean:o,undefined:"undefined"},__type__:{boolean:o,object:a}},groupOrderSwap:{function:"function"},height:{string:i,number:n},hiddenDates:{start:{date:r,number:n,string:i,moment:d},end:{date:r,number:n,string:i,moment:d},repeat:{string:i},__type__:{object:a,array:s}},itemsAlwaysDraggable:{boolean:o},locale:{string:i},locales:{__any__:{any:l},__type__:{object:a}},margin:{axis:{number:n},item:{horizontal:{number:n,undefined:"undefined"},vertical:{number:n,undefined:"undefined"},__type__:{object:a,number:n}},__type__:{object:a,number:n}},max:{date:r,number:n,string:i,moment:d},maxHeight:{number:n,string:i},maxMinorChars:{number:n},min:{date:r,number:n,string:i,moment:d},minHeight:{number:n,string:i},moveable:{boolean:o},multiselect:{boolean:o},multiselectPerGroup:{boolean:o},onAdd:{function:"function"},onUpdate:{function:"function"},onMove:{function:"function"},onMoving:{function:"function"},onRemove:{function:"function"},onAddGroup:{function:"function"},onMoveGroup:{function:"function"},onRemoveGroup:{function:"function"},order:{function:"function"},orientation:{axis:{string:i,undefined:"undefined"},item:{string:i,undefined:"undefined"},__type__:{string:i,object:a}},selectable:{boolean:o},showCurrentTime:{boolean:o},showMajorLabels:{boolean:o},showMinorLabels:{boolean:o},stack:{boolean:o},snap:{function:"function",null:"null"},start:{date:r,number:n,string:i,moment:d},template:{function:"function"},groupTemplate:{function:"function"},tooltipOnItemUpdateTime:{template:{function:"function"},__type__:{boolean:o,object:a}},timeAxis:{scale:{string:i,undefined:"undefined"},step:{number:n,undefined:"undefined"},__type__:{object:a}},type:{string:i},width:{string:i,number:n},zoomable:{boolean:o},zoomKey:{string:["ctrlKey","altKey","metaKey",""]},zoomMax:{number:n},zoomMin:{number:n},__type__:{object:a}},p={global:{align:["center","left","right"],direction:!1,autoResize:!0,clickToUse:!1,editable:{add:!1,remove:!1,updateGroup:!1,updateTime:!1},end:"",format:{minorLabels:{millisecond:"SSS",second:"s",minute:"HH:mm",hour:"HH:mm",weekday:"ddd D",day:"D",month:"MMM",year:"YYYY"},majorLabels:{millisecond:"HH:mm:ss",second:"D MMMM HH:mm",minute:"ddd D MMMM",hour:"ddd D MMMM",weekday:"MMMM YYYY",day:"MMMM YYYY",month:"YYYY",year:""}},groupsDraggable:!1,height:"",locale:"",margin:{axis:[20,0,100,1],item:{horizontal:[10,0,100,1],vertical:[10,0,100,1]}},max:"",maxHeight:"",maxMinorChars:[7,0,20,1],min:"",minHeight:"",moveable:!1,multiselect:!1,multiselectPerGroup:!1,orientation:{axis:["both","bottom","top"],item:["bottom","top"]},selectable:!0,showCurrentTime:!1,showMajorLabels:!0,showMinorLabels:!0,stack:!0,start:"",tooltipOnItemUpdateTime:!1,type:["box","point","range","background"],width:"100%",zoomable:!0,zoomKey:["ctrlKey","altKey","metaKey",""],zoomMax:[31536e10,10,31536e10,1],zoomMin:[10,10,31536e10,1]}};e.allOptions=u,e.configureOptions=p},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e,i,o){if(!(Array.isArray(i)||i instanceof u||i instanceof p)&&i instanceof Object){var n=o;o=i,i=n}var s=this;this.defaultOptions={start:null,end:null,autoResize:!0,orientation:{axis:"bottom",item:"bottom"},moment:d,width:null,height:null,maxHeight:null,minHeight:null},this.options=l.deepExtend({},this.defaultOptions),this._create(t),this.components=[],this.body={dom:this.dom,domProps:this.props,emitter:{on:this.on.bind(this),off:this.off.bind(this),emit:this.emit.bind(this)},hiddenDates:[],util:{toScreen:s._toScreen.bind(s),toGlobalScreen:s._toGlobalScreen.bind(s),toTime:s._toTime.bind(s),toGlobalTime:s._toGlobalTime.bind(s)}},this.range=new c(this.body),this.components.push(this.range),this.body.range=this.range,this.timeAxis=new f(this.body),this.components.push(this.timeAxis),this.currentTime=new g(this.body),this.components.push(this.currentTime),this.linegraph=new y(this.body),this.components.push(this.linegraph),this.itemsData=null,this.groupsData=null,this.on("tap",function(t){s.emit("click",s.getEventProperties(t))}),this.on("doubletap",function(t){s.emit("doubleClick",s.getEventProperties(t))}),this.dom.root.oncontextmenu=function(t){s.emit("contextmenu",s.getEventProperties(t))},o&&this.setOptions(o),i&&this.setGroups(i),e&&this.setItems(e),this._redraw()}var s=i(12),r=o(s),a=i(18),h=o(a),d=(i(19),i(14),i(2)),l=i(1),u=i(8),p=i(10),c=i(20),m=i(23),f=i(34),g=i(39),v=i(37),y=i(42),b=i(18).printStyle,_=i(50).allOptions,w=i(50).configureOptions;n.prototype=new m,n.prototype.setOptions=function(t){var e=h.default.validate(t,_);e===!0&&console.log("%cErrors have been found in the supplied options object.",b),m.prototype.setOptions.call(this,t)},n.prototype.setItems=function(t){var e,i=null==this.itemsData;if(e=t?t instanceof u||t instanceof p?t:new u(t,{type:{start:"Date",end:"Date"}}):null,this.itemsData=e,this.linegraph&&this.linegraph.setItems(e),i)if(void 0!=this.options.start||void 0!=this.options.end){var o=void 0!=this.options.start?this.options.start:null,n=void 0!=this.options.end?this.options.end:null;this.setWindow(o,n,{animation:!1})}else this.fit({animation:!1})},n.prototype.setGroups=function(t){var e;e=t?t instanceof u||t instanceof p?t:new u(t):null,this.groupsData=e,this.linegraph.setGroups(e)},n.prototype.getLegend=function(t,e,i){return void 0===e&&(e=15),void 0===i&&(i=15),void 0!==this.linegraph.groups[t]?this.linegraph.groups[t].getLegend(e,i):"cannot find group:'"+t+"'"},n.prototype.isGroupVisible=function(t){return void 0!==this.linegraph.groups[t]&&(this.linegraph.groups[t].visible&&(void 0===this.linegraph.options.groups.visibility[t]||1==this.linegraph.options.groups.visibility[t]))},n.prototype.getDataRange=function(){var t=null,e=null;for(var i in this.linegraph.groups)if(this.linegraph.groups.hasOwnProperty(i)&&1==this.linegraph.groups[i].visible)for(var o=0;os?s:t,e=null==e?s:e0){var h={};for(this._getRelevantData(a,h,n,s),this._applySampling(a,h),e=0;e0)switch(t.options.style){case"line":l.hasOwnProperty(a[e])||(l[a[e]]=m.calcPath(h[a[e]],t)),m.draw(l[a[e]],t,this.framework);case"point":case"points":"point"!=t.options.style&&"points"!=t.options.style&&1!=t.options.drawPoints.enabled||f.draw(h[a[e]],t,this.framework);break;case"bar":}}}return r.cleanupElements(this.svgElements),!1},o.prototype._stack=function(t,e){var i,o,n,s,r;i=0;for(var a=0;at[a].x){r=e[h],s=0==h?r:e[h-1],i=h;break}}void 0===r&&(s=e[e.length-1],r=e[e.length-1]),o=r.x-s.x,n=r.y-s.y,0==o?t[a].y=t[a].orginalY+r.y:t[a].y=t[a].orginalY+n/o*(t[a].x-s.x)+s.y}},o.prototype._getRelevantData=function(t,e,i,o){var n,r,a,h;if(t.length>0)for(r=0;r0)for(var o=0;o0){var s=1,r=n.length,a=this.body.util.toGlobalScreen(n[n.length-1].x)-this.body.util.toGlobalScreen(n[0].x),h=r/a;s=Math.min(Math.ceil(.2*r),Math.max(1,Math.round(h)));for(var d=new Array(r),l=0;l0){for(s=0;s0&&(n=this.groups[t[s]],r.stack===!0&&"bar"===r.style?"left"===r.yAxisOrientation?a=a.concat(n.getItems()):h=h.concat(n.getItems()):i[t[s]]=n.getYRange(o,t[s]));c.getStackedYRange(a,i,t,"__barStackLeft","left"),c.getStackedYRange(h,i,t,"__barStackRight","right")}},o.prototype._updateYAxis=function(t,e){var i,o,n=!1,s=!1,r=!1,a=1e9,h=1e9,d=-1e9,l=-1e9;if(t.length>0){for(var u=0;ui?i:a,d=di?i:h,l=l=0&&t._redrawLabel(o-2,e.val,i,"vis-y-axis vis-major",t.props.majorCharHeight),t.master===!0&&(n?t._redrawLine(o,i,"vis-grid vis-horizontal vis-major",t.options.majorLinesOffset,t.props.majorLineWidth):t._redrawLine(o,i,"vis-grid vis-horizontal vis-minor",t.options.minorLinesOffset,t.props.minorLineWidth))});var d=0;void 0!==this.options[i].title&&void 0!==this.options[i].title.text&&(d=this.props.titleCharHeight);var l=this.options.icons===!0?Math.max(this.options.iconWidth,d)+this.options.labelOffsetX+15:d+this.options.labelOffsetX+15;return this.maxLabelSize>this.width-l&&this.options.visible===!0?(this.width=this.maxLabelSize+l,this.options.width=this.width+"px",s.cleanupElements(this.DOMelements.lines),s.cleanupElements(this.DOMelements.labels),this.redraw(),e=!0):this.maxLabelSizethis.minWidth?(this.width=Math.max(this.minWidth,this.maxLabelSize+l),this.options.width=this.width+"px",s.cleanupElements(this.DOMelements.lines),s.cleanupElements(this.DOMelements.labels),this.redraw(),e=!0):(s.cleanupElements(this.DOMelements.lines),s.cleanupElements(this.DOMelements.labels),e=!1),e},o.prototype.convertValue=function(t){return this.scale.convertValue(t)},o.prototype.screenToValue=function(t){return this.scale.screenToValue(t)},o.prototype._redrawLabel=function(t,e,i,o,n){var r=s.getDOMElement("div",this.DOMelements.labels,this.dom.frame);r.className=o,r.innerHTML=e,"left"===i?(r.style.left="-"+this.options.labelOffsetX+"px",r.style.textAlign="right"):(r.style.right="-"+this.options.labelOffsetX+"px",r.style.textAlign="left"),r.style.top=t-.5*n+this.options.labelOffsetY+"px",e+="";var a=Math.max(this.props.majorCharWidth,this.props.minorCharWidth);this.maxLabelSize6&&void 0!==arguments[6]&&arguments[6],a=arguments.length>7&&void 0!==arguments[7]&&arguments[7];if(this.majorSteps=[1,2,5,10],this.minorSteps=[.25,.5,1,2],this.customLines=null,this.containerHeight=n,this.majorCharHeight=s,this._start=t,this._end=e,this.scale=1,this.minorStepIdx=-1,this.magnitudefactor=1,this.determineScale(),this.zeroAlign=r,this.autoScaleStart=i,this.autoScaleEnd=o,this.formattingFunction=a,i||o){var h=this,d=function(t){var e=t-t%(h.magnitudefactor*h.minorSteps[h.minorStepIdx]);return t%(h.magnitudefactor*h.minorSteps[h.minorStepIdx])>.5*(h.magnitudefactor*h.minorSteps[h.minorStepIdx])?e+h.magnitudefactor*h.minorSteps[h.minorStepIdx]:e};i&&(this._start-=2*this.magnitudefactor*this.minorSteps[this.minorStepIdx],this._start=d(this._start)),o&&(this._end+=this.magnitudefactor*this.minorSteps[this.minorStepIdx],this._end=d(this._end)),this.determineScale()}}i.prototype.setCharHeight=function(t){this.majorCharHeight=t},i.prototype.setHeight=function(t){this.containerHeight=t},i.prototype.determineScale=function(){var t=this._end-this._start;this.scale=this.containerHeight/t;var e=this.majorCharHeight/this.scale,i=t>0?Math.round(Math.log(t)/Math.LN10):0;this.minorStepIdx=-1,this.magnitudefactor=Math.pow(10,i);var o=0;i<0&&(o=i);for(var n=!1,s=o;Math.abs(s)<=Math.abs(i);s++){this.magnitudefactor=Math.pow(10,s);for(var r=0;r=e){n=!0,this.minorStepIdx=r;break}}if(n===!0)break}},i.prototype.is_major=function(t){return t%(this.magnitudefactor*this.majorSteps[this.minorStepIdx])===0},i.prototype.getStep=function(){return this.magnitudefactor*this.minorSteps[this.minorStepIdx]},i.prototype.getFirstMajor=function(){var t=this.magnitudefactor*this.majorSteps[this.minorStepIdx];return this.convertValue(this._start+(t-this._start%t)%t)},i.prototype.formatValue=function(t){var e=t.toPrecision(5);return"function"==typeof this.formattingFunction&&(e=this.formattingFunction(t)),"number"==typeof e?""+e:"string"==typeof e?e:t.toPrecision(5)},i.prototype.getLines=function(){for(var t=[],e=this.getStep(),i=(e-this._start%e)%e,o=this._start+i;this._end-o>1e-5;o+=e)o!=this._start&&t.push({major:this.is_major(o),y:this.convertValue(o),val:this.formatValue(o)});return t},i.prototype.followScale=function(t){var e=this.minorStepIdx,i=this._start,o=this._end,n=this,s=function(){n.magnitudefactor*=2},r=function(){n.magnitudefactor/=2};t.minorStepIdx<=1&&this.minorStepIdx<=1||t.minorStepIdx>1&&this.minorStepIdx>1||(t.minorStepIdxo+1e-5)r(),d=!1;else{if(!this.autoScaleStart&&this._start=0)){r(),d=!1;continue}console.warn("Can't adhere to given 'min' range, due to zeroalign")}this.autoScaleStart&&this.autoScaleEnd&&ue.x?1:-1})):this.itemsData=[]},o.prototype.getItems=function(){return this.itemsData},o.prototype.setZeroPosition=function(t){this.zeroPosition=t},o.prototype.setOptions=function(t){if(void 0!==t){var e=["sampling","style","sort","yAxisOrientation","barChart","zIndex","excludeFromStacking","excludeFromLegend"];s.selectiveDeepExtend(e,this.options,t),"function"==typeof t.drawPoints&&(t.drawPoints={onRender:t.drawPoints}),s.mergeOptions(this.options,t,"interpolation"),s.mergeOptions(this.options,t,"drawPoints"),s.mergeOptions(this.options,t,"shaded"),t.interpolation&&"object"==n(t.interpolation)&&t.interpolation.parametrization&&("uniform"==t.interpolation.parametrization?this.options.interpolation.alpha=0:"chordal"==t.interpolation.parametrization?this.options.interpolation.alpha=1:(this.options.interpolation.parametrization="centripetal",this.options.interpolation.alpha=.5))}},o.prototype.update=function(t){this.group=t,this.content=t.content||"graph",this.className=t.className||this.className||"vis-graph-group"+this.groupsUsingDefaultStyles[0]%10,this.visible=void 0===t.visible||t.visible,this.style=t.style,this.setOptions(t.options)},o.prototype.getLegend=function(t,e,i,o,n){if(void 0==i||null==i){var s=document.createElementNS("http://www.w3.org/2000/svg","svg");i={svg:s,svgElements:{},options:this.options,groups:[this]}}switch(void 0!=o&&null!=o||(o=0),void 0!=n&&null!=n||(n=.5*e),this.options.style){case"line":a.drawIcon(this,o,n,t,e,i);break;case"points":case"point":h.drawIcon(this,o,n,t,e,i);break;case"bar":r.drawIcon(this,o,n,t,e,i)}return{icon:i.svg,label:this.content,orientation:this.options.yAxisOrientation}},o.prototype.getYRange=function(t){for(var e=t[0].y,i=t[0].y,o=0;ot[o].y?t[o].y:e,i=i0&&(i=Math.min(i,Math.abs(e[o-1].screen_x-e[o].screen_x))),0===i&&(void 0===t[e[o].screen_x]&&(t[e[o].screen_x]={amount:0,resolved:0,accumulatedPositive:0,accumulatedNegative:0}),t[e[o].screen_x].amount+=1)},o._getSafeDrawData=function(t,e,i){var o,n;return t0?(o=t0){t.sort(function(t,e){return t.screen_x===e.screen_x?t.groupIde[s].screen_y?e[s].screen_y:o,n=nt[r].accumulatedNegative?t[r].accumulatedNegative:o,o=o>t[r].accumulatedPositive?t[r].accumulatedPositive:o,n=n0){var i=[];return i=1==e.options.interpolation.enabled?o._catmullRom(t,e):o._linear(t)}},o.drawIcon=function(t,e,i,o,s,r){var a,h,d=.5*s,l=n.getSVGElement("rect",r.svgElements,r.svg);if(l.setAttributeNS(null,"x",e),l.setAttributeNS(null,"y",i-d),l.setAttributeNS(null,"width",o),l.setAttributeNS(null,"height",2*d),l.setAttributeNS(null,"class","vis-outline"),a=n.getSVGElement("path",r.svgElements,r.svg),a.setAttributeNS(null,"class",t.className),void 0!==t.style&&a.setAttributeNS(null,"style",t.style),a.setAttributeNS(null,"d","M"+e+","+i+" L"+(e+o)+","+i),1==t.options.shaded.enabled&&(h=n.getSVGElement("path",r.svgElements,r.svg),"top"==t.options.shaded.orientation?h.setAttributeNS(null,"d","M"+e+", "+(i-d)+"L"+e+","+i+" L"+(e+o)+","+i+" L"+(e+o)+","+(i-d)):h.setAttributeNS(null,"d","M"+e+","+i+" L"+e+","+(i+d)+" L"+(e+o)+","+(i+d)+"L"+(e+o)+","+i),h.setAttributeNS(null,"class",t.className+" vis-icon-fill"),void 0!==t.options.shaded.style&&""!==t.options.shaded.style&&h.setAttributeNS(null,"style",t.options.shaded.style)),1==t.options.drawPoints.enabled){var u={style:t.options.drawPoints.style,styles:t.options.drawPoints.styles,size:t.options.drawPoints.size,className:t.className};n.drawPoint(e+.5*o,i,u,r.svgElements,r.svg)}},o.drawShading=function(t,e,i,o){if(1==e.options.shaded.enabled){var s=Number(o.svg.style.height.replace("px","")),r=n.getSVGElement("path",o.svgElements,o.svg),a="L";1==e.options.interpolation.enabled&&(a="C");var h,d=0;d="top"==e.options.shaded.orientation?0:"bottom"==e.options.shaded.orientation?s:Math.min(Math.max(0,e.zeroPosition),s),h="group"==e.options.shaded.orientation&&null!=i&&void 0!=i?"M"+t[0][0]+","+t[0][1]+" "+this.serializePath(t,a,!1)+" L"+i[i.length-1][0]+","+i[i.length-1][1]+" "+this.serializePath(i,a,!0)+i[0][0]+","+i[0][1]+" Z":"M"+t[0][0]+","+t[0][1]+" "+this.serializePath(t,a,!1)+" V"+d+" H"+t[0][0]+" Z",r.setAttributeNS(null,"class",e.className+" vis-fill"),void 0!==e.options.shaded.style&&r.setAttributeNS(null,"style",e.options.shaded.style),r.setAttributeNS(null,"d",h)}},o.draw=function(t,e,i){if(null!=t&&void 0!=t){var o=n.getSVGElement("path",i.svgElements,i.svg);o.setAttributeNS(null,"class",e.className),void 0!==e.style&&o.setAttributeNS(null,"style",e.style);var s="L";1==e.options.interpolation.enabled&&(s="C"),o.setAttributeNS(null,"d","M"+t[0][0]+","+t[0][1]+" "+this.serializePath(t,s,!1))}},o.serializePath=function(t,e,i){if(t.length<2)return"";var o=e;if(i)for(var n=t.length-2;n>0;n--)o+=t[n][0]+","+t[n][1]+" ";else for(var n=1;n0&&(m=1/m),f=3*g*(g+v),f>0&&(f=1/f),a={screen_x:(-b*o.screen_x+p*n.screen_x+_*s.screen_x)*m,screen_y:(-b*o.screen_y+p*n.screen_y+_*s.screen_y)*m},h={screen_x:(y*n.screen_x+c*s.screen_x-b*r.screen_x)*f,screen_y:(y*n.screen_y+c*s.screen_y-b*r.screen_y)*f},0==a.screen_x&&0==a.screen_y&&(a=n),0==h.screen_x&&0==h.screen_y&&(h=s),x.push([a.screen_x,a.screen_y]),x.push([h.screen_x,h.screen_y]),x.push([s.screen_x,s.screen_y]);return x},o._linear=function(t){for(var e=[],i=0;i")}this.dom.textArea.innerHTML=s,this.dom.textArea.style.lineHeight=.75*this.options.iconSize+this.options.iconSpacing+"px"}},o.prototype.drawLegendIcons=function(){if(this.dom.frame.parentNode){var t=Object.keys(this.groups);t.sort(function(t,e){return t\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",s=n.console&&(n.console.warn||n.console.log);return s&&s.call(n.console,o,i),t.apply(this,arguments)}}function p(t,e,i){var o,n=e.prototype;o=t.prototype=Object.create(n),o.constructor=t,o._super=n,i&&mt(o,i)}function c(t,e){return function(){return t.apply(e,arguments)}}function f(t,e){return typeof t==yt?t.apply(e?e[0]||a:a,e):t}function m(t,e){return t===a?e:t}function g(t,e,i){l(_(e),function(e){t.addEventListener(e,i,!1)})}function v(t,e,i){l(_(e),function(e){t.removeEventListener(e,i,!1)})}function y(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function b(t,e){return t.indexOf(e)>-1}function _(t){return t.trim().split(/\s+/g)}function w(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var o=0;oi[e]}):o.sort()),o}function S(t,e){for(var i,o,n=e[0].toUpperCase()+e.slice(1),s=0;s1&&!i.firstMultiple?i.firstMultiple=N(e):1===n&&(i.firstMultiple=!1);var s=i.firstInput,r=i.firstMultiple,a=r?r.center:s.center,h=e.center=A(o);e.timeStamp=wt(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=H(a,h),e.distance=F(a,h),P(i,e),e.offsetDirection=L(e.deltaX,e.deltaY);var d=R(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=d.x,e.overallVelocityY=d.y,e.overallVelocity=_t(d.x)>_t(d.y)?d.x:d.y,e.scale=r?j(r.pointers,o):1,e.rotation=r?Y(r.pointers,o):0,e.maxPointers=i.prevInput?e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers:e.pointers.length,I(i,e);var l=t.element;y(e.srcEvent.target,l)&&(l=e.srcEvent.target),e.target=l}function P(t,e){var i=e.center,o=t.offsetDelta||{},n=t.prevDelta||{},s=t.prevInput||{};e.eventType!==At&&s.eventType!==Lt||(n=t.prevDelta={x:s.deltaX||0,y:s.deltaY||0},o=t.offsetDelta={x:i.x,y:i.y}),e.deltaX=n.x+(i.x-o.x),e.deltaY=n.y+(i.y-o.y)}function I(t,e){var i,o,n,s,r=t.lastInterval||e,h=e.timeStamp-r.timeStamp;if(e.eventType!=Ft&&(h>Nt||r.velocity===a)){var d=e.deltaX-r.deltaX,l=e.deltaY-r.deltaY,u=R(h,d,l);o=u.x,n=u.y,i=_t(u.x)>_t(u.y)?u.x:u.y,s=L(d,l),t.lastInterval=e}else i=r.velocity,o=r.velocityX,n=r.velocityY,s=r.direction;e.velocity=i,e.velocityX=o,e.velocityY=n,e.direction=s}function N(t){for(var e=[],i=0;i=_t(e)?t<0?Yt:jt:e<0?Gt:zt}function F(t,e,i){i||(i=Vt);var o=e[i[0]]-t[i[0]],n=e[i[1]]-t[i[1]];return Math.sqrt(o*o+n*n)}function H(t,e,i){i||(i=Vt);var o=e[i[0]]-t[i[0]],n=e[i[1]]-t[i[1]];return 180*Math.atan2(n,o)/Math.PI}function Y(t,e){return H(e[1],e[0],qt)+H(t[1],t[0],qt)}function j(t,e){return F(e[0],e[1],qt)/F(t[0],t[1],qt)}function G(){this.evEl=Zt,this.evWin=Kt,this.pressed=!1,T.apply(this,arguments)}function z(){this.evEl=Qt,this.evWin=te,T.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function W(){this.evTarget=ie,this.evWin=oe,this.started=!1,T.apply(this,arguments)}function B(t,e){var i=x(t.touches),o=x(t.changedTouches);return e&(Lt|Ft)&&(i=D(i.concat(o),"identifier",!0)),[i,o]}function U(){this.evTarget=se,this.targetIds={},T.apply(this,arguments)}function V(t,e){var i=x(t.touches),o=this.targetIds;if(e&(At|Rt)&&1===i.length)return o[i[0].identifier]=!0,[i,i];var n,s,r=x(t.changedTouches),a=[],h=this.target;if(s=i.filter(function(t){return y(t.target,h)}),e===At)for(n=0;n-1&&o.splice(t,1)};setTimeout(n,re)}}function K(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,o=0;o-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){function e(e){i.manager.emit(e,t)}var i=this,o=this.state;o<_e&&e(i.options.event+et(o)),e(i.options.event),t.additionalEvent&&e(t.additionalEvent),o>=_e&&e(i.options.event+et(o))},tryEmit:function(t){return this.canEmit()?this.emit(t):void(this.state=De)},canEmit:function(){for(var t=0;te.threshold&&n&e.direction},attrTest:function(t){return nt.prototype.attrTest.call(this,t)&&(this.state&ye||!(this.state&ye)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=it(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),p(rt,nt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ce]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&ye)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),p(at,tt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ue]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,o=t.distancee.time;if(this._input=t,!o||!i||t.eventType&(Lt|Ft)&&!n)this.reset();else if(t.eventType&At)this.reset(),this._timer=h(function(){this.state=we,this.tryEmit()},e.time,this);else if(t.eventType&Lt)return we;return De},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===we&&(t&&t.eventType&Lt?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=wt(),this.manager.emit(this.options.event,this._input)))}}),p(ht,nt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ce]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&ye)}}),p(dt,nt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Wt|Bt,pointers:1},getTouchAction:function(){return st.prototype.getTouchAction.call(this)},attrTest:function(t){var e,i=this.options.direction;return i&(Wt|Bt)?e=t.overallVelocity:i&Wt?e=t.overallVelocityX:i&Bt&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&i&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&_t(e)>this.options.velocity&&t.eventType&Lt},emit:function(t){var e=it(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),p(lt,tt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[pe]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,o=t.distances.distance?console.log('%cUnknown option detected: "'+e+'" in '+t.printLocation(n.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+t.printLocation(s.path,s.closestMatch,""),v):n.distance<=r?console.log('%cUnknown option detected: "'+e+'". Did you mean "'+n.closestMatch+'"?'+t.printLocation(n.path,e),v):console.log('%cUnknown option detected: "'+e+'". Did you mean one of these: '+t.print((0,d.default)(i))+t.printLocation(o,e),v),m=!0}},{key:"findInOptions",value:function(e,i,o){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=1e9,r="",a=[],h=e.toLowerCase(),d=void 0;for(var l in i){var u=void 0;if(void 0!==i[l].__type__&&n===!0){var p=t.findInOptions(e,i[l],f.copyAndExtendArray(o,l));s>p.distance&&(r=p.closestMatch,a=p.path,s=p.distance,d=p.indexMatch)}else l.toLowerCase().indexOf(h)!==-1&&(d=l),u=t.levenshteinDistance(e,l),s>u&&(r=l,a=f.copyArray(o),s=u)}return{closestMatch:r,path:a,distance:s,indexMatch:d}}},{key:"printLocation",value:function(t,e){for(var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Problem value found at: \n",o="\n\n"+i+"options = {\n",n=0;n1e3&&(i=1e3),e.body.dom.rollingModeBtn.style.visibility="hidden",e.currentTimeTimer=setTimeout(t,i)}var e=this;t()},n.prototype.stopRolling=function(){void 0!==this.currentTimeTimer&&(clearTimeout(this.currentTimeTimer),this.rolling=!1,this.body.dom.rollingModeBtn.style.visibility="visible")},n.prototype.setRange=function(t,e,i,o,n){o!==!0&&(o=!1);var s=void 0!=t?p.convert(t,"Date").valueOf():null,r=void 0!=e?p.convert(e,"Date").valueOf():null;if(this._cancelAnimation(),i){var h=this,l=this.start,c=this.end,f="object"===("undefined"==typeof i?"undefined":(0,u.default)(i))&&"duration"in i?i.duration:500,g="object"===("undefined"==typeof i?"undefined":(0,u.default)(i))&&"easingFunction"in i?i.easingFunction:"easeInOutQuad",v=p.easingFunctions[g];if(!v)throw new Error("Unknown easing function "+(0,d.default)(g)+". Choose from: "+(0,a.default)(p.easingFunctions).join(", "));var y=(new Date).valueOf(),b=!1,_=function t(){if(!h.props.touch.dragging){var e=(new Date).valueOf(),i=e-y,a=v(i/f),d=i>f,u=d||null===s?s:l+(s-l)*a,g=d||null===r?r:c+(r-c)*a;w=h._applyRange(u,g),m.updateHiddenDates(h.options.moment,h.body,h.options.hiddenDates),b=b||w;var _={start:new Date(h.start),end:new Date(h.end),byUser:o,event:p.elementsCensor(n)};w&&h.body.emitter.emit("rangechange",_),d?b&&h.body.emitter.emit("rangechanged",_):h.animationTimer=setTimeout(t,20)}};return _()}var w=this._applyRange(s,r);if(m.updateHiddenDates(this.options.moment,this.body,this.options.hiddenDates),w){var x={start:new Date(this.start),end:new Date(this.end),byUser:o,event:p.elementsCensor(n)};this.body.emitter.emit("rangechange",x),this.body.emitter.emit("rangechanged",x)}},n.prototype._cancelAnimation=function(){this.animationTimer&&(clearTimeout(this.animationTimer),this.animationTimer=null)},n.prototype._applyRange=function(t,e){var i,o=null!=t?p.convert(t,"Date").valueOf():this.start,n=null!=e?p.convert(e,"Date").valueOf():this.end,s=null!=this.options.max?p.convert(this.options.max,"Date").valueOf():null,r=null!=this.options.min?p.convert(this.options.min,"Date").valueOf():null;if(isNaN(o)||null===o)throw new Error('Invalid start "'+t+'"');if(isNaN(n)||null===n)throw new Error('Invalid end "'+e+'"');if(ns&&(n=s)),null!==s&&n>s&&(i=n-s,o-=i,n-=i,null!=r&&othis.start&&nh&&(this.end-this.start===h&&othis.end?(o=this.start,n=this.end):(i=n-o-h,o+=i/2,n-=i/2))}var d=this.start!=o||this.end!=n;return o>=this.start&&o<=this.end||n>=this.start&&n<=this.end||this.start>=o&&this.start<=n||this.end>=o&&this.end<=n||this.body.emitter.emit("checkRangedItems"),this.start=o,this.end=n,d},n.prototype.getRange=function(){return{start:this.start,end:this.end}},n.prototype.conversion=function(t,e){return n.conversion(this.start,this.end,t,e)},n.conversion=function(t,e,i,o){return void 0===o&&(o=0),0!=i&&e-t!=0?{offset:t,scale:i/(e-t-o)}:{offset:0,scale:1}},n.prototype._onDragStart=function(t){this.deltaDifference=0,this.previousDelta=0,this.options.moveable&&this._isInsideRange(t)&&this.props.touch.allowDragging&&(this.stopRolling(),this.props.touch.start=this.start,this.props.touch.end=this.end,this.props.touch.dragging=!0,this.body.dom.root&&(this.body.dom.root.style.cursor="move"))},n.prototype._onDrag=function(t){if(t&&this.props.touch.dragging&&this.options.moveable&&this.props.touch.allowDragging){var e=this.options.direction;s(e);var i="horizontal"==e?t.deltaX:t.deltaY;i-=this.deltaDifference;var o=this.props.touch.end-this.props.touch.start,n=m.getHiddenDurationBetween(this.body.hiddenDates,this.start,this.end); +o-=n;var r="horizontal"==e?this.body.domProps.center.width:this.body.domProps.center.height;if(this.options.rtl)var a=i/r*o;else var a=-i/r*o;var h=this.props.touch.start+a,d=this.props.touch.end+a,l=m.snapAwayFromHidden(this.body.hiddenDates,h,this.previousDelta-i,!0),u=m.snapAwayFromHidden(this.body.hiddenDates,d,this.previousDelta-i,!0);if(l!=h||u!=d)return this.deltaDifference+=i,this.props.touch.start=l,this.props.touch.end=u,void this._onDrag(t);this.previousDelta=i,this._applyRange(h,d);var c=new Date(this.start),f=new Date(this.end);this.body.emitter.emit("rangechange",{start:c,end:f,byUser:!0,event:p.elementsCensor(t)}),this.body.emitter.emit("panmove")}},n.prototype._onDragEnd=function(t){this.props.touch.dragging&&this.options.moveable&&this.props.touch.allowDragging&&(this.props.touch.dragging=!1,this.body.dom.root&&(this.body.dom.root.style.cursor="auto"),this.body.emitter.emit("rangechanged",{start:new Date(this.start),end:new Date(this.end),byUser:!0,event:p.elementsCensor(t)}))},n.prototype._onMouseWheel=function(t){var e=0;if(t.wheelDelta?e=t.wheelDelta/120:t.detail&&(e=-t.detail/3),this.options.zoomKey&&!t[this.options.zoomKey]&&this.options.zoomable||!this.options.zoomable&&this.options.moveable){if(this.options.horizontalScroll){t.preventDefault();var i=e*(this.end-this.start)/20,o=this.start-i,n=this.end-i;this.setRange(o,n,!1,!0,t)}}else if(this.options.zoomable&&this.options.moveable&&this._isInsideRange(t)&&e){var s;s=e<0?1-e/5:1/(1+e/5);var r;if(this.rolling)r=(this.start+this.end)/2;else{var a=this.getPointer({x:t.clientX,y:t.clientY},this.body.dom.center);r=this._pointerToDate(a)}this.zoom(s,r,e,t),t.preventDefault()}},n.prototype._onTouch=function(t){this.props.touch.start=this.start,this.props.touch.end=this.end,this.props.touch.allowDragging=!0,this.props.touch.center=null,this.scaleOffset=0,this.deltaDifference=0},n.prototype._onPinch=function(t){if(this.options.zoomable&&this.options.moveable){this.props.touch.allowDragging=!1,this.props.touch.center||(this.props.touch.center=this.getPointer(t.center,this.body.dom.center)),this.stopRolling();var e=1/(t.scale+this.scaleOffset),i=this._pointerToDate(this.props.touch.center),o=m.getHiddenDurationBetween(this.body.hiddenDates,this.start,this.end),n=m.getHiddenDurationBefore(this.options.moment,this.body.hiddenDates,this,i),s=o-n,r=i-n+(this.props.touch.start-(i-n))*e,a=i+s+(this.props.touch.end-(i+s))*e;this.startToFront=1-e<=0,this.endToFront=e-1<=0;var h=m.snapAwayFromHidden(this.body.hiddenDates,r,1-e,!0),d=m.snapAwayFromHidden(this.body.hiddenDates,a,e-1,!0);h==r&&d==a||(this.props.touch.start=h,this.props.touch.end=d,this.scaleOffset=1-t.scale,r=h,a=d),this.setRange(r,a,!1,!0,t),this.startToFront=!1,this.endToFront=!0}},n.prototype._isInsideRange=function(t){var e=t.center?t.center.x:t.clientX;if(this.options.rtl)var i=e-p.getAbsoluteLeft(this.body.dom.centerContainer);else var i=p.getAbsoluteRight(this.body.dom.centerContainer)-e;var o=this.body.util.toTime(i);return o>=this.start&&o<=this.end},n.prototype._pointerToDate=function(t){var e,i=this.options.direction;if(s(i),"horizontal"==i)return this.body.util.toTime(t.x).valueOf();var o=this.body.domProps.center.height;return e=this.conversion(o),t.y/e.scale+e.offset},n.prototype.getPointer=function(t,e){return this.options.rtl?{x:p.getAbsoluteRight(e)-t.x,y:t.y-p.getAbsoluteTop(e)}:{x:t.x-p.getAbsoluteLeft(e),y:t.y-p.getAbsoluteTop(e)}},n.prototype.zoom=function(t,e,i,o){null==e&&(e=(this.start+this.end)/2);var n=m.getHiddenDurationBetween(this.body.hiddenDates,this.start,this.end),s=m.getHiddenDurationBefore(this.options.moment,this.body.hiddenDates,this,e),r=n-s,a=e-s+(this.start-(e-s))*t,h=e+r+(this.end-(e+r))*t;this.startToFront=!(i>0),this.endToFront=!(-i>0);var d=m.snapAwayFromHidden(this.body.hiddenDates,a,i,!0),l=m.snapAwayFromHidden(this.body.hiddenDates,h,-i,!0);d==a&&l==h||(a=d,h=l),this.setRange(a,h,!1,!0,o),this.startToFront=!1,this.endToFront=!0},n.prototype.move=function(t){var e=this.end-this.start,i=this.start+e*t,o=this.end+e*t;this.start=i,this.end=o},n.prototype.moveTo=function(t){var e=(this.start+this.end)/2,i=e-t,o=this.start-i,n=this.end-i;this.setRange(o,n,!1,!0,event)},t.exports=n},function(t,e,i){function o(t,e){this.options=null,this.props=null}var n=i(1);o.prototype.setOptions=function(t){t&&n.extend(this.options,t)},o.prototype.redraw=function(){return!1},o.prototype.destroy=function(){},o.prototype._isResized=function(){var t=this.props._previousWidth!==this.props.width||this.props._previousHeight!==this.props.height;return this.props._previousWidth=this.props.width,this.props._previousHeight=this.props.height,t},t.exports=o},function(t,e){e.convertHiddenOptions=function(t,i,o){if(o&&!Array.isArray(o))return e.convertHiddenOptions(t,i,[o]);if(i.hiddenDates=[],o&&1==Array.isArray(o)){for(var n=0;n=4*a){var p=0,c=s.clone();switch(o[h].repeat){case"daily":d.day()!=l.day()&&(p=1),d.dayOfYear(n.dayOfYear()),d.year(n.year()),d.subtract(7,"days"),l.dayOfYear(n.dayOfYear()),l.year(n.year()),l.subtract(7-p,"days"),c.add(1,"weeks");break;case"weekly":var f=l.diff(d,"days"),m=d.day();d.date(n.date()),d.month(n.month()),d.year(n.year()),l=d.clone(),d.day(m),l.day(m),l.add(f,"days"),d.subtract(1,"weeks"),l.subtract(1,"weeks"),c.add(1,"weeks");break;case"monthly":d.month()!=l.month()&&(p=1),d.month(n.month()),d.year(n.year()),d.subtract(1,"months"),l.month(n.month()),l.year(n.year()),l.subtract(1,"months"),l.add(p,"months"),c.add(1,"months");break;case"yearly":d.year()!=l.year()&&(p=1),d.year(n.year()),d.subtract(1,"years"),l.year(n.year()),l.subtract(1,"years"),l.add(p,"years"),c.add(1,"years");break;default:return void console.log("Wrong repeat format, allowed are: daily, weekly, monthly, yearly. Given:",o[h].repeat)}for(;d=e[o].start&&e[n].end<=e[o].end?e[n].remove=!0:e[n].start>=e[o].start&&e[n].start<=e[o].end?(e[o].end=e[n].end,e[n].remove=!0):e[n].end>=e[o].start&&e[n].end<=e[o].end&&(e[o].start=e[n].start,e[n].remove=!0));for(var o=0;o=r&&nt.range.end){var h={start:t.range.start,end:i};i=e.correctTimeForHidden(t.options.moment,t.body.hiddenDates,h,i);var n=t.range.conversion(o,r);return(i.valueOf()-n.offset)*n.scale}i=e.correctTimeForHidden(t.options.moment,t.body.hiddenDates,t.range,i);var n=t.range.conversion(o,r);return(i.valueOf()-n.offset)*n.scale},e.toTime=function(t,i,o){if(0==t.body.hiddenDates.length){var n=t.range.conversion(o);return new Date(i/n.scale+n.offset)}var s=e.getHiddenDurationBetween(t.body.hiddenDates,t.range.start,t.range.end),r=t.range.end-t.range.start-s,a=r*i/o,h=e.getAccumulatedHiddenDuration(t.body.hiddenDates,t.range,a),d=new Date(h+a+t.range.start);return d},e.getHiddenDurationBetween=function(t,e,i){for(var o=0,n=0;n=e&&r=e&&r<=i&&(o+=r-s)}return o},e.correctTimeForHidden=function(t,i,o,n){return n=t(n).toDate().valueOf(),n-=e.getHiddenDurationBefore(t,i,o,n)},e.getHiddenDurationBefore=function(t,e,i,o){var n=0;o=t(o).toDate().valueOf();for(var s=0;s=i.start&&a=a&&(n+=a-r)}return n},e.getAccumulatedHiddenDuration=function(t,e,i){for(var o=0,n=0,s=e.start,r=0;r=e.start&&h=i)break;o+=h-a}}return o},e.snapAwayFromHidden=function(t,i,o,n){var s=e.isHidden(i,t);return 1==s.hidden?o<0?1==n?s.startDate-(s.endDate-i)-1:s.startDate-1:1==n?s.endDate+(i-s.startDate)+1:s.endDate+1:i},e.isHidden=function(t,e){for(var i=0;i=o&&t-1||h))return t.dataTransfer.dropEffect="move",h=!0,!1}function n(t){try{var e=JSON.parse(t.dataTransfer.getData("text"));if(!e.content)return}catch(t){return!1}return h=!1,t.center={x:t.clientX,y:t.clientY},s.itemSet._onAddItem(t),!1}this.dom={},this.dom.container=t,this.dom.root=document.createElement("div"),this.dom.background=document.createElement("div"),this.dom.backgroundVertical=document.createElement("div"),this.dom.backgroundHorizontal=document.createElement("div"),this.dom.centerContainer=document.createElement("div"),this.dom.leftContainer=document.createElement("div"),this.dom.rightContainer=document.createElement("div"),this.dom.center=document.createElement("div"),this.dom.left=document.createElement("div"),this.dom.right=document.createElement("div"),this.dom.top=document.createElement("div"),this.dom.bottom=document.createElement("div"),this.dom.shadowTop=document.createElement("div"),this.dom.shadowBottom=document.createElement("div"),this.dom.shadowTopLeft=document.createElement("div"),this.dom.shadowBottomLeft=document.createElement("div"),this.dom.shadowTopRight=document.createElement("div"),this.dom.shadowBottomRight=document.createElement("div"),this.dom.rollingModeBtn=document.createElement("div"),this.dom.root.className="vis-timeline",this.dom.background.className="vis-panel vis-background",this.dom.backgroundVertical.className="vis-panel vis-background vis-vertical",this.dom.backgroundHorizontal.className="vis-panel vis-background vis-horizontal",this.dom.centerContainer.className="vis-panel vis-center",this.dom.leftContainer.className="vis-panel vis-left",this.dom.rightContainer.className="vis-panel vis-right",this.dom.top.className="vis-panel vis-top",this.dom.bottom.className="vis-panel vis-bottom",this.dom.left.className="vis-content",this.dom.center.className="vis-content",this.dom.right.className="vis-content",this.dom.shadowTop.className="vis-shadow vis-top",this.dom.shadowBottom.className="vis-shadow vis-bottom",this.dom.shadowTopLeft.className="vis-shadow vis-top",this.dom.shadowBottomLeft.className="vis-shadow vis-bottom",this.dom.shadowTopRight.className="vis-shadow vis-top",this.dom.shadowBottomRight.className="vis-shadow vis-bottom",this.dom.rollingModeBtn.className="vis-rolling-mode-btn",this.dom.root.appendChild(this.dom.background),this.dom.root.appendChild(this.dom.backgroundVertical),this.dom.root.appendChild(this.dom.backgroundHorizontal),this.dom.root.appendChild(this.dom.centerContainer),this.dom.root.appendChild(this.dom.leftContainer),this.dom.root.appendChild(this.dom.rightContainer),this.dom.root.appendChild(this.dom.top),this.dom.root.appendChild(this.dom.bottom),this.dom.root.appendChild(this.dom.bottom),this.dom.root.appendChild(this.dom.rollingModeBtn),this.dom.centerContainer.appendChild(this.dom.center),this.dom.leftContainer.appendChild(this.dom.left),this.dom.rightContainer.appendChild(this.dom.right),this.dom.centerContainer.appendChild(this.dom.shadowTop),this.dom.centerContainer.appendChild(this.dom.shadowBottom),this.dom.leftContainer.appendChild(this.dom.shadowTopLeft),this.dom.leftContainer.appendChild(this.dom.shadowBottomLeft),this.dom.rightContainer.appendChild(this.dom.shadowTopRight),this.dom.rightContainer.appendChild(this.dom.shadowBottomRight),this.props={root:{},background:{},centerContainer:{},leftContainer:{},rightContainer:{},center:{},left:{},right:{},top:{},bottom:{},border:{},scrollTop:0,scrollTopMin:0},this.on("rangechange",function(){this.initialDrawDone===!0&&this._redraw()}.bind(this)),this.on("touch",this._onTouch.bind(this)),this.on("panmove",this._onDrag.bind(this));var s=this;this._origRedraw=this._redraw.bind(this),this._redraw=p.throttle(this._origRedraw),this.on("_change",function(t){s.itemSet&&s.itemSet.initialItemSetDrawn&&t&&1==t.queue?s._redraw():s._origRedraw()}),this.hammer=new l(this.dom.root);var r=this.hammer.get("pinch").set({enable:!0});u.disablePreventDefaultVertically(r),this.hammer.get("pan").set({threshold:5,direction:l.DIRECTION_HORIZONTAL}),this.listeners={};var a=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];a.forEach(function(t){var e=function(e){s.isActive()&&s.emit(t,e)};s.hammer.on(t,e),s.listeners[t]=e}),u.onTouch(this.hammer,function(t){s.emit("touch",t)}.bind(this)),u.onRelease(this.hammer,function(t){s.emit("release",t)}.bind(this)),this.dom.centerContainer.addEventListener?(this.dom.centerContainer.addEventListener("mousewheel",e.bind(this),!1),this.dom.centerContainer.addEventListener("DOMMouseScroll",e.bind(this),!1)):this.dom.centerContainer.attachEvent("onmousewheel",e.bind(this)),this.dom.left.parentNode.addEventListener("scroll",i.bind(this)),this.dom.right.parentNode.addEventListener("scroll",i.bind(this));var h=!1;if(this.dom.center.addEventListener("dragover",o.bind(this),!1),this.dom.center.addEventListener("drop",n.bind(this),!1),this.customTimes=[],this.touch={},this.redrawCount=0,this.initialDrawDone=!1,!t)throw new Error("No container provided");t.appendChild(this.dom.root)},n.prototype.setOptions=function(t){if(t){var e=["width","height","minHeight","maxHeight","autoResize","start","end","clickToUse","dataAttributes","hiddenDates","locale","locales","moment","rtl","zoomKey","horizontalScroll","verticalScroll"];if(p.selectiveExtend(e,this.options,t),this.dom.rollingModeBtn.style.visibility="hidden",this.options.rtl&&(this.dom.container.style.direction="rtl",this.dom.backgroundVertical.className="vis-panel vis-background vis-vertical-rtl"),this.options.verticalScroll&&(this.options.rtl?this.dom.rightContainer.className="vis-panel vis-right vis-vertical-scroll":this.dom.leftContainer.className="vis-panel vis-left vis-vertical-scroll"),this.options.orientation={item:void 0,axis:void 0},"orientation"in t&&("string"==typeof t.orientation?this.options.orientation={item:t.orientation,axis:t.orientation}:"object"===(0,h.default)(t.orientation)&&("item"in t.orientation&&(this.options.orientation.item=t.orientation.item),"axis"in t.orientation&&(this.options.orientation.axis=t.orientation.axis))),"both"===this.options.orientation.axis){if(!this.timeAxis2){var i=this.timeAxis2=new c(this.body);i.setOptions=function(t){var e=t?p.extend({},t):{};e.orientation="top",c.prototype.setOptions.call(i,e)},this.components.push(i)}}else if(this.timeAxis2){var o=this.components.indexOf(this.timeAxis2);o!==-1&&this.components.splice(o,1),this.timeAxis2.destroy(),this.timeAxis2=null}if("function"==typeof t.drawPoints&&(t.drawPoints={onRender:t.drawPoints}),"hiddenDates"in this.options&&m.convertHiddenOptions(this.options.moment,this.body,this.options.hiddenDates),"clickToUse"in t&&(t.clickToUse?this.activator||(this.activator=new f(this.dom.root)):this.activator&&(this.activator.destroy(),delete this.activator)),"showCustomTime"in t)throw new Error("Option `showCustomTime` is deprecated. Create a custom time bar via timeline.addCustomTime(time [, id])");this._initAutoResize()}if(this.components.forEach(function(e){return e.setOptions(t)}),"configure"in t){this.configurator||(this.configurator=this._createConfigurator()),this.configurator.setOptions(t.configure);var n=p.deepExtend({},this.options);this.components.forEach(function(t){p.deepExtend(n,t.options)}),this.configurator.setModuleOptions({global:n})}this._redraw()},n.prototype.isActive=function(){return!this.activator||this.activator.active},n.prototype.destroy=function(){this.setItems(null),this.setGroups(null),this.off(),this._stopAutoResize(),this.dom.root.parentNode&&this.dom.root.parentNode.removeChild(this.dom.root),this.dom=null,this.activator&&(this.activator.destroy(),delete this.activator);for(var t in this.listeners)this.listeners.hasOwnProperty(t)&&delete this.listeners[t];this.listeners=null,this.hammer=null,this.components.forEach(function(t){return t.destroy()}),this.body=null},n.prototype.setCustomTime=function(t,e){var i=this.customTimes.filter(function(t){return e===t.options.id});if(0===i.length)throw new Error("No custom time bar found with id "+(0,r.default)(e));i.length>0&&i[0].setCustomTime(t)},n.prototype.getCustomTime=function(t){var e=this.customTimes.filter(function(e){return e.options.id===t});if(0===e.length)throw new Error("No custom time bar found with id "+(0,r.default)(t));return e[0].getCustomTime()},n.prototype.setCustomTimeTitle=function(t,e){var i=this.customTimes.filter(function(t){return t.options.id===e});if(0===i.length)throw new Error("No custom time bar found with id "+(0,r.default)(e));if(i.length>0)return i[0].setCustomTitle(t)},n.prototype.getEventProperties=function(t){return{event:t}},n.prototype.addCustomTime=function(t,e){var i=void 0!==t?p.convert(t,"Date").valueOf():new Date,o=this.customTimes.some(function(t){return t.options.id===e});if(o)throw new Error("A custom time with id "+(0,r.default)(e)+" already exists");var n=new g(this.body,p.extend({},this.options,{time:i,id:e}));return this.customTimes.push(n),this.components.push(n),this._redraw(),e},n.prototype.removeCustomTime=function(t){var e=this.customTimes.filter(function(e){return e.options.id===t});if(0===e.length)throw new Error("No custom time bar found with id "+(0,r.default)(t));e.forEach(function(t){this.customTimes.splice(this.customTimes.indexOf(t),1),this.components.splice(this.components.indexOf(t),1),t.destroy()}.bind(this))},n.prototype.getVisibleItems=function(){return this.itemSet&&this.itemSet.getVisibleItems()||[]},n.prototype.fit=function(t){var e=this.getDataRange();if(null!==e.min||null!==e.max){var i=e.max-e.min,o=new Date(e.min.valueOf()-.01*i),n=new Date(e.max.valueOf()+.01*i),s=!t||void 0===t.animation||t.animation;this.range.setRange(o,n,s)}},n.prototype.getDataRange=function(){throw new Error("Cannot invoke abstract method getDataRange")},n.prototype.setWindow=function(t,e,i){var o;if(1==arguments.length){var n=arguments[0];o=void 0===n.animation||n.animation,this.range.setRange(n.start,n.end,o)}else o=!i||void 0===i.animation||i.animation,this.range.setRange(t,e,o)},n.prototype.moveTo=function(t,e){var i=this.range.end-this.range.start,o=p.convert(t,"Date").valueOf(),n=o-i/2,s=o+i/2,r=!e||void 0===e.animation||e.animation;this.range.setRange(n,s,r)},n.prototype.getWindow=function(){var t=this.range.getRange();return{start:new Date(t.start),end:new Date(t.end)}},n.prototype.zoomIn=function(t){if(!(!t||t<0||t>1)){var e=this.getWindow(),i=e.start.valueOf(),o=e.end.valueOf(),n=o-i,s=n/(1+t),r=(n-s)/2,a=i+r,h=o-r;this.setWindow({start:a,end:h})}},n.prototype.zoomOut=function(t){if(!(!t||t<0||t>1)){var e=this.getWindow(),i=e.start.valueOf(),o=e.end.valueOf(),n=o-i,s=i-n*t/2,r=o+n*t/2;this.setWindow({start:s,end:r})}},n.prototype.redraw=function(){this._redraw()},n.prototype._redraw=function(){this.redrawCount++;var t=!1,e=this.options,i=this.props,o=this.dom;if(o&&o.container&&0!=o.root.offsetWidth){m.updateHiddenDates(this.options.moment,this.body,this.options.hiddenDates),"top"==e.orientation?(p.addClassName(o.root,"vis-top"),p.removeClassName(o.root,"vis-bottom")):(p.removeClassName(o.root,"vis-top"),p.addClassName(o.root,"vis-bottom")),o.root.style.maxHeight=p.option.asSize(e.maxHeight,""),o.root.style.minHeight=p.option.asSize(e.minHeight,""),o.root.style.width=p.option.asSize(e.width,""),i.border.left=(o.centerContainer.offsetWidth-o.centerContainer.clientWidth)/2,i.border.right=i.border.left,i.border.top=(o.centerContainer.offsetHeight-o.centerContainer.clientHeight)/2,i.border.bottom=i.border.top,i.borderRootHeight=o.root.offsetHeight-o.root.clientHeight,i.borderRootWidth=o.root.offsetWidth-o.root.clientWidth,0===o.centerContainer.clientHeight&&(i.border.left=i.border.top,i.border.right=i.border.left),0===o.root.clientHeight&&(i.borderRootWidth=i.borderRootHeight),i.center.height=o.center.offsetHeight,i.left.height=o.left.offsetHeight,i.right.height=o.right.offsetHeight,i.top.height=o.top.clientHeight||-i.border.top,i.bottom.height=o.bottom.clientHeight||-i.border.bottom;var n=Math.max(i.left.height,i.center.height,i.right.height),s=i.top.height+n+i.bottom.height+i.borderRootHeight+i.border.top+i.border.bottom;o.root.style.height=p.option.asSize(e.height,s+"px"),i.root.height=o.root.offsetHeight,i.background.height=i.root.height-i.borderRootHeight;var r=i.root.height-i.top.height-i.bottom.height-i.borderRootHeight;i.centerContainer.height=r,i.leftContainer.height=r,i.rightContainer.height=i.leftContainer.height,i.root.width=o.root.offsetWidth,i.background.width=i.root.width-i.borderRootWidth,this.initialDrawDone||(i.scrollbarWidth=p.getScrollBarWidth()),e.verticalScroll?e.rtl?(i.left.width=o.leftContainer.clientWidth||-i.border.left,i.right.width=o.rightContainer.clientWidth+i.scrollbarWidth||-i.border.right):(i.left.width=o.leftContainer.clientWidth+i.scrollbarWidth||-i.border.left,i.right.width=o.rightContainer.clientWidth||-i.border.right):(i.left.width=o.leftContainer.clientWidth||-i.border.left,i.right.width=o.rightContainer.clientWidth||-i.border.right),this._setDOM();var a=this._updateScrollTop();"top"!=e.orientation.item&&(a+=Math.max(i.centerContainer.height-i.center.height-i.border.top-i.border.bottom,0)),o.center.style.top=a+"px";var h=0==i.scrollTop?"hidden":"",d=i.scrollTop==i.scrollTopMin?"hidden":"";o.shadowTop.style.visibility=h,o.shadowBottom.style.visibility=d,o.shadowTopLeft.style.visibility=h,o.shadowBottomLeft.style.visibility=d,o.shadowTopRight.style.visibility=h,o.shadowBottomRight.style.visibility=d,e.verticalScroll&&(o.rightContainer.className="vis-panel vis-right vis-vertical-scroll",o.leftContainer.className="vis-panel vis-left vis-vertical-scroll",o.shadowTopRight.style.visibility="hidden",o.shadowBottomRight.style.visibility="hidden",o.shadowTopLeft.style.visibility="hidden",o.shadowBottomLeft.style.visibility="hidden",o.left.style.top="0px",o.right.style.top="0px"),(!e.verticalScroll||i.center.heighti.centerContainer.height;this.hammer.get("pan").set({direction:u?l.DIRECTION_ALL:l.DIRECTION_HORIZONTAL}),this.components.forEach(function(e){t=e.redraw()||t});var c=5;if(t){if(this.redrawCount0&&(this.props.scrollTop=0),this.props.scrollTope&&o.push(h.id):h.lefti&&o.push(h.id)}return o},n.prototype._deselect=function(t){for(var e=this.selection,i=0,o=e.length;in)return}}if(i&&i!=this.groupTouchParams.group){var h=e.get(i.groupId),d=e.get(this.groupTouchParams.group.groupId);d&&h&&(this.options.groupOrderSwap(d,h,e),e.update(d),e.update(h));var l=e.getIds({order:this.options.groupOrder});if(!p.equalArray(l,this.groupTouchParams.originalOrder))for(var u=this.groupTouchParams.originalOrder,c=this.groupTouchParams.group.groupId,m=Math.min(u.length,l.length),g=0,v=0,y=0;g=m)break;if(l[g+v]!=c)if(u[g+y]!=c){var b=l.indexOf(u[g+y]),_=e.get(l[g+v]),w=e.get(u[g+y]);this.options.groupOrderSwap(_,w,e),e.update(_),e.update(w);var x=l[g+v];l[g+v]=u[g+y],l[b]=x,g++}else y=1;else v=1}}}},n.prototype._onGroupDragEnd=function(t){if(this.options.groupEditable.order&&this.groupTouchParams.group){t.stopPropagation();var e=this,i=e.groupTouchParams.group.groupId,o=e.groupsData.getDataSet(),n=p.extend({},o.get(i));e.options.onMoveGroup(n,function(t){if(t)t[o._fieldId]=i,o.update(t);else{var n=o.getIds({order:e.options.groupOrder});if(!p.equalArray(n,e.groupTouchParams.originalOrder))for(var s=e.groupTouchParams.originalOrder,r=Math.min(s.length,n.length),a=0;a=r)break;var h=n.indexOf(s[a]),d=o.get(n[a]),l=o.get(s[a]);e.options.groupOrderSwap(d,l,o),groupsData.update(d),groupsData.update(l);var u=n[a];n[a]=s[a],n[h]=u,a++}}}),e.body.emitter.emit("groupDragged",{groupId:i})}},n.prototype._onSelectItem=function(t){if(this.options.selectable){var e=t.srcEvent&&(t.srcEvent.ctrlKey||t.srcEvent.metaKey),i=t.srcEvent&&t.srcEvent.shiftKey;if(e||i)return void this._onMultiSelectItem(t);var o=this.getSelection(),n=this.itemFromTarget(t),s=n?[n.id]:[];this.setSelection(s);var r=this.getSelection();(r.length>0||o.length>0)&&this.body.emitter.emit("select",{items:r,event:p.elementsCensor(t)})}},n.prototype._onMouseOver=function(t){var e=this.itemFromTarget(t);if(e){var i=this.itemFromRelatedTarget(t);if(e!==i){if(e.getTitle()){null==e.popup&&e.setPopup(new l.default(this.body.dom.root,this.options.tooltip.overflowMethod||"flip"));var o=this.body.dom.centerContainer;e.popup.setPosition(t.clientX-p.getAbsoluteLeft(o)+o.offsetLeft,t.clientY-p.getAbsoluteTop(o)+o.offsetTop),e.popup.show()}this.body.emitter.emit("itemover",{item:e.id,event:p.elementsCensor(t)})}}},n.prototype._onMouseOut=function(t){var e=this.itemFromTarget(t);if(e){var i=this.itemFromRelatedTarget(t);e!==i&&(null!=e.popup&&e.popup.hide(),this.body.emitter.emit("itemout",{item:e.id,event:p.elementsCensor(t)}))}},n.prototype._onMouseMove=function(t){var e=this.itemFromTarget(t);if(e&&this.options.tooltip.followMouse&&e.popup&&!e.popup.hidden){var i=this.body.dom.centerContainer;e.popup.setPosition(t.clientX-p.getAbsoluteLeft(i)+i.offsetLeft,t.clientY-p.getAbsoluteTop(i)+i.offsetTop),e.popup.show()}},n.prototype._onUpdateItem=function(t){if(this.options.selectable&&this.options.editable.add){var e=this;if(t){var i=e.itemsData.get(t.id);this.options.onUpdate(i,function(t){t&&e.itemsData.getDataSet().update(t)})}}},n.prototype._onAddItem=function(t){if(this.options.selectable&&this.options.editable.add){var e=this,i=this.options.snap||null,o=this.itemFromTarget(t);if(!o){if(this.options.rtl)var n=p.getAbsoluteRight(this.dom.frame),s=n-t.center.x;else var n=p.getAbsoluteLeft(this.dom.frame),s=t.center.x-n;var r=this.body.util.toTime(s),a=this.body.util.getScale(),h=this.body.util.getStep(),d={start:i?i(r,a,h):r,content:"new item"};if("drop"==t.type){var l=JSON.parse(t.dataTransfer.getData("text"));if(d.content=l.content,d.type=l.type||"box",d[this.itemsData._fieldId]=l.id||p.randomUUID(),"range"==l.type||l.end&&l.start)if(l.end)d.end=l.end,d.start=l.start;else{var u=this.body.util.toTime(s+this.props.width/5);d.end=i?i(u,a,h):u}}else if(d[this.itemsData._fieldId]=p.randomUUID(),"range"===this.options.type){var u=this.body.util.toTime(s+this.props.width/5);d.end=i?i(u,a,h):u}var c=this.groupFromTarget(t);c&&(d.group=c.groupId),d=this._cloneItemData(d),this.options.onAdd(d,function(i){i&&(e.itemsData.getDataSet().add(i),"drop"==t.type&&e.setSelection([i.id]))})}}},n.prototype._onMultiSelectItem=function(t){if(this.options.selectable){var e=this.itemFromTarget(t);if(e){var i=this.options.multiselect?this.getSelection():[],o=t.srcEvent&&t.srcEvent.shiftKey||!1;if(o&&this.options.multiselect){var s=this.itemsData.get(e.id).group,r=void 0;this.options.multiselectPerGroup&&i.length>0&&(r=this.itemsData.get(i[0]).group),this.options.multiselectPerGroup&&void 0!=r&&r!=s||i.push(e.id);var a=n._getItemRange(this.itemsData.get(i,this.itemOptions));if(!this.options.multiselectPerGroup||r==s){i=[];for(var h in this.items)if(this.items.hasOwnProperty(h)){var d=this.items[h],l=d.data.start,u=void 0!==d.data.end?d.data.end:l;!(l>=a.min&&u<=a.max)||this.options.multiselectPerGroup&&r!=this.itemsData.get(d.id).group||d instanceof x||i.push(d.id)}}}else{var c=i.indexOf(e.id);c==-1?i.push(e.id):i.splice(c,1)}this.setSelection(i),this.body.emitter.emit("select",{items:this.getSelection(),event:p.elementsCensor(t)})}}},n._getItemRange=function(t){var e=null,i=null;return t.forEach(function(t){(null==i||t.starte)&&(e=t.end):(null==e||t.start>e)&&(e=t.start)}),{min:i,max:e}},n.prototype.itemFromElement=function(t){for(var e=t;e;){if(e.hasOwnProperty("timeline-item"))return e["timeline-item"];e=e.parentNode}return null},n.prototype.itemFromTarget=function(t){return this.itemFromElement(t.target)},n.prototype.itemFromRelatedTarget=function(t){return this.itemFromElement(t.relatedTarget)},n.prototype.groupFromTarget=function(t){for(var e=t.center?t.center.y:t.clientY,i=0;ir&&er)return n}else if(0===i&&en-this.padding&&(a=!0),s=a?this.x-i:this.x,r=h?this.y-e:this.y}else r=this.y-e,r+e+this.padding>o&&(r=o-e-this.padding),rn&&(s=n-i-this.padding),s0&&this.current.milliseconds()0&&this.current.seconds()0&&this.current.minutes()0&&this.current.hours()0?t.step:1,this.autoScale=!1)},o.prototype.setAutoScale=function(t){this.autoScale=t},o.prototype.setMinimumStep=function(t){if(void 0!=t){var e=31104e6,i=2592e6,o=864e5,n=36e5,s=6e4,r=1e3,a=1;1e3*e>t&&(this.scale="year",this.step=1e3),500*e>t&&(this.scale="year",this.step=500),100*e>t&&(this.scale="year",this.step=100),50*e>t&&(this.scale="year",this.step=50),10*e>t&&(this.scale="year",this.step=10),5*e>t&&(this.scale="year",this.step=5),e>t&&(this.scale="year",this.step=1),3*i>t&&(this.scale="month",this.step=3),i>t&&(this.scale="month",this.step=1),5*o>t&&(this.scale="day",this.step=5),2*o>t&&(this.scale="day",this.step=2),o>t&&(this.scale="day",this.step=1),o/2>t&&(this.scale="weekday",this.step=1),4*n>t&&(this.scale="hour",this.step=4),n>t&&(this.scale="hour",this.step=1),15*s>t&&(this.scale="minute",this.step=15),10*s>t&&(this.scale="minute",this.step=10),5*s>t&&(this.scale="minute",this.step=5),s>t&&(this.scale="minute",this.step=1),15*r>t&&(this.scale="second",this.step=15),10*r>t&&(this.scale="second",this.step=10),5*r>t&&(this.scale="second",this.step=5),r>t&&(this.scale="second",this.step=1),200*a>t&&(this.scale="millisecond",this.step=200),100*a>t&&(this.scale="millisecond",this.step=100),50*a>t&&(this.scale="millisecond",this.step=50),10*a>t&&(this.scale="millisecond",this.step=10),5*a>t&&(this.scale="millisecond",this.step=5),a>t&&(this.scale="millisecond",this.step=1)}},o.snap=function(t,e,i){var o=n(t);if("year"==e){var s=o.year()+Math.round(o.month()/12);o.year(Math.round(s/i)*i),o.month(0),o.date(0),o.hours(0),o.minutes(0),o.seconds(0),o.milliseconds(0)}else if("month"==e)o.date()>15?(o.date(1),o.add(1,"month")):o.date(1),o.hours(0),o.minutes(0),o.seconds(0),o.milliseconds(0);else if("day"==e){switch(i){case 5:case 2:o.hours(24*Math.round(o.hours()/24));break;default:o.hours(12*Math.round(o.hours()/12))}o.minutes(0),o.seconds(0),o.milliseconds(0)}else if("weekday"==e){switch(i){case 5:case 2:o.hours(12*Math.round(o.hours()/12));break;default:o.hours(6*Math.round(o.hours()/6))}o.minutes(0),o.seconds(0),o.milliseconds(0)}else if("hour"==e){switch(i){case 4:o.minutes(60*Math.round(o.minutes()/60));break;default:o.minutes(30*Math.round(o.minutes()/30))}o.seconds(0),o.milliseconds(0)}else if("minute"==e){switch(i){case 15:case 10:o.minutes(5*Math.round(o.minutes()/5)),o.seconds(0);break;case 5:o.seconds(60*Math.round(o.seconds()/60));break;default:o.seconds(30*Math.round(o.seconds()/30))}o.milliseconds(0)}else if("second"==e)switch(i){case 15:case 10:o.seconds(5*Math.round(o.seconds()/5)),o.milliseconds(0);break;case 5:o.milliseconds(1e3*Math.round(o.milliseconds()/1e3));break;default:o.milliseconds(500*Math.round(o.milliseconds()/500))}else if("millisecond"==e){var r=i>5?i/2:1;o.milliseconds(Math.round(o.milliseconds()/r)*r)}return o},o.prototype.isMajor=function(){if(1==this.switchedYear)switch(this.scale){case"year":case"month":case"weekday":case"day":case"hour":case"minute":case"second":case"millisecond":return!0;default:return!1}else if(1==this.switchedMonth)switch(this.scale){case"weekday":case"day":case"hour":case"minute":case"second":case"millisecond":return!0;default:return!1}else if(1==this.switchedDay)switch(this.scale){case"millisecond":case"second":case"minute":case"hour":return!0;default:return!1}var t=this.moment(this.current);switch(this.scale){case"millisecond":return 0==t.milliseconds();case"second":return 0==t.seconds();case"minute":return 0==t.hours()&&0==t.minutes();case"hour":return 0==t.hours();case"weekday":case"day":return 1==t.date();case"month":return 0==t.month();case"year":return!1;default:return!1}},o.prototype.getLabelMinor=function(t){if(void 0==t&&(t=this.current),"function"==typeof this.format.minorLabels)return this.format.minorLabels(t,this.scale,this.step);var e=this.format.minorLabels[this.scale];return e&&e.length>0?this.moment(t).format(e):""},o.prototype.getLabelMajor=function(t){if(void 0==t&&(t=this.current),"function"==typeof this.format.majorLabels)return this.format.majorLabels(t,this.scale,this.step);var e=this.format.majorLabels[this.scale];return e&&e.length>0?this.moment(t).format(e):""},o.prototype.getClassName=function(){function t(t){return t/h%2==0?" vis-even":" vis-odd"}function e(t){return t.isSame(new Date,"day")?" vis-today":t.isSame(s().add(1,"day"),"day")?" vis-tomorrow":t.isSame(s().add(-1,"day"),"day")?" vis-yesterday":""}function i(t){return t.isSame(new Date,"week")?" vis-current-week":""}function o(t){return t.isSame(new Date,"month")?" vis-current-month":""}function n(t){return t.isSame(new Date,"year")?" vis-current-year":""}var s=this.moment,r=this.moment(this.current),a=r.locale?r.locale("en"):r.lang("en"),h=this.step;switch(this.scale){case"millisecond":return e(a)+t(a.milliseconds()).trim();case"second":return e(a)+t(a.seconds()).trim();case"minute":return e(a)+t(a.minutes()).trim();case"hour":return"vis-h"+a.hours()+(4==this.step?"-h"+(a.hours()+4):"")+e(a)+t(a.hours());case"weekday":return"vis-"+a.format("dddd").toLowerCase()+e(a)+i(a)+t(a.date());case"day":return"vis-day"+a.date()+" vis-"+a.format("MMMM").toLowerCase()+e(a)+o(a)+(this.step<=2?e(a):"")+(this.step<=2?" vis-"+a.format("dddd").toLowerCase():""+t(a.date()-1));case"month":return"vis-"+a.format("MMMM").toLowerCase()+o(a)+t(a.month());case"year":var d=a.year();return"vis-year"+d+n(a)+t(d);default:return""}},t.exports=o},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e,i){this.groupId=t,this.subgroups={},this.subgroupIndex=0,this.subgroupOrderer=e&&e.subgroupOrder,this.itemSet=i,this.isVisible=null,e&&e.nestedGroups&&(this.nestedGroups=e.nestedGroups,0==e.showNested?this.showNested=!1:this.showNested=!0),this.nestedInGroup=null,this.dom={},this.props={label:{width:0,height:0}},this.className=null,this.items={},this.visibleItems=[],this.itemsInRange=[],this.orderedItems={byStart:[],byEnd:[]},this.checkRangedItems=!1;var o=this;this.itemSet.body.emitter.on("checkRangedItems",function(){o.checkRangedItems=!0}),this._create(),this.setData(e)}var s=i(58),r=o(s),a=i(1),h=i(115);i(116);n.prototype._create=function(){var t=document.createElement("div");this.itemSet.options.groupEditable.order?t.className="vis-label draggable":t.className="vis-label",this.dom.label=t;var e=document.createElement("div");e.className="vis-inner",t.appendChild(e),this.dom.inner=e;var i=document.createElement("div");i.className="vis-group",i["timeline-group"]=this,this.dom.foreground=i,this.dom.background=document.createElement("div"),this.dom.background.className="vis-group",this.dom.axis=document.createElement("div"),this.dom.axis.className="vis-group",this.dom.marker=document.createElement("div"),this.dom.marker.style.visibility="hidden",this.dom.marker.style.position="absolute",this.dom.marker.innerHTML="",this.dom.background.appendChild(this.dom.marker)},n.prototype.setData=function(t){var e,i;if(this.itemSet.options&&this.itemSet.options.groupTemplate?(i=this.itemSet.options.groupTemplate.bind(this),e=i(t,this.dom.inner)):e=t&&t.content,e instanceof Element){for(this.dom.inner.appendChild(e);this.dom.inner.firstChild;)this.dom.inner.removeChild(this.dom.inner.firstChild);this.dom.inner.appendChild(e)}else e instanceof Object?i(t,this.dom.inner):void 0!==e&&null!==e?this.dom.inner.innerHTML=e:this.dom.inner.innerHTML=this.groupId||"";if(this.dom.label.title=t&&t.title||"",this.dom.inner.firstChild?a.removeClassName(this.dom.inner,"vis-hidden"):a.addClassName(this.dom.inner,"vis-hidden"),t&&t.nestedGroups)if(0==t.showNested?this.showNested=!1:this.showNested=!0,a.addClassName(this.dom.label,"vis-nesting-group"),this.showNested)a.removeClassName(this.dom.label,"collapsed"),a.addClassName(this.dom.label,"expanded");else{a.removeClassName(this.dom.label,"expanded");var o=this.itemSet.options.rtl?"collapsed-rtl":"collapsed";a.addClassName(this.dom.label,o)}t&&t.nestedInGroup&&(a.addClassName(this.dom.label,"vis-nested-group"),this.itemSet.options&&this.itemSet.options.rtl?this.dom.inner.style.paddingRight="30px":this.dom.inner.style.paddingLeft="30px");var n=t&&t.className||null;n!=this.className&&(this.className&&(a.removeClassName(this.dom.label,this.className),a.removeClassName(this.dom.foreground,this.className),a.removeClassName(this.dom.background,this.className),a.removeClassName(this.dom.axis,this.className)),a.addClassName(this.dom.label,n),a.addClassName(this.dom.foreground,n),a.addClassName(this.dom.background,n),a.addClassName(this.dom.axis,n),this.className=n),this.style&&(a.removeCssText(this.dom.label,this.style),this.style=null),t&&t.style&&(a.addCssText(this.dom.label,t.style),this.style=t.style)},n.prototype.getLabelWidth=function(){return this.props.label.width},n.prototype.redraw=function(t,e,i){var o=!1,n=this.dom.marker.clientHeight;n!=this.lastMarkerHeight&&(this.lastMarkerHeight=n,a.forEach(this.items,function(t){t.dirty=!0,t.displayed&&t.redraw()}),i=!0),this._calculateSubGroupHeights(e);var s=this.dom.foreground;if(this.top=s.offsetTop,this.right=s.offsetLeft,this.width=s.offsetWidth,this.isVisible=this._isGroupVisible(t,e),"function"==typeof this.itemSet.options.order){if(i){var r=this,d=!1;a.forEach(this.items,function(t){t.displayed||(t.redraw(),r.visibleItems.push(t)),t.repositionX(d)});var l=this.orderedItems.byStart.slice().sort(function(t,e){return r.itemSet.options.order(t.data,e.data)});h.stack(l,e,!0)}this.visibleItems=this._updateItemsInRange(this.orderedItems,this.visibleItems,t)}else this.visibleItems=this._updateItemsInRange(this.orderedItems,this.visibleItems,t),this.itemSet.options.stack?h.stack(this.visibleItems,e,i):h.nostack(this.visibleItems,e,this.subgroups,this.itemSet.options.stackSubgroups);this._updateSubgroupsSizes();var u=this._calculateHeight(e),s=this.dom.foreground;this.top=s.offsetTop,this.right=s.offsetLeft,this.width=s.offsetWidth,o=a.updateProperty(this,"height",u)||o,o=a.updateProperty(this.props.label,"width",this.dom.inner.clientWidth)||o,o=a.updateProperty(this.props.label,"height",this.dom.inner.clientHeight)||o,this.dom.background.style.height=u+"px",this.dom.foreground.style.height=u+"px",this.dom.label.style.height=u+"px";for(var p=0,c=this.visibleItems.length;p0){var e=this;this.resetSubgroups(),a.forEach(this.visibleItems,function(i){void 0!==i.data.subgroup&&(e.subgroups[i.data.subgroup].height=Math.max(e.subgroups[i.data.subgroup].height,i.height+t.item.vertical),e.subgroups[i.data.subgroup].visible=!0)})}},n.prototype._isGroupVisible=function(t,e){var i=this.top<=t.body.domProps.centerContainer.height-t.body.domProps.scrollTop+e.axis&&this.top+this.height+e.axis>=-t.body.domProps.scrollTop;return i},n.prototype._calculateHeight=function(t){var e,i=this.visibleItems;if(i.length>0){var o=i[0].top,n=i[0].top+i[0].height;if(a.forEach(i,function(t){o=Math.min(o,t.top),n=Math.max(n,t.top+t.height)}),o>t.axis){var s=o-t.axis;n-=s,a.forEach(i,function(t){t.top-=s})}e=n+t.item.vertical/2}else e=0;return e=Math.max(e,this.props.label.height)},n.prototype.show=function(){this.dom.label.parentNode||this.itemSet.dom.labelSet.appendChild(this.dom.label),this.dom.foreground.parentNode||this.itemSet.dom.foreground.appendChild(this.dom.foreground),this.dom.background.parentNode||this.itemSet.dom.background.appendChild(this.dom.background),this.dom.axis.parentNode||this.itemSet.dom.axis.appendChild(this.dom.axis)},n.prototype.hide=function(){var t=this.dom.label;t.parentNode&&t.parentNode.removeChild(t);var e=this.dom.foreground;e.parentNode&&e.parentNode.removeChild(e);var i=this.dom.background;i.parentNode&&i.parentNode.removeChild(i);var o=this.dom.axis;o.parentNode&&o.parentNode.removeChild(o)},n.prototype.add=function(t){if(this.items[t.id]=t,t.setParent(this),void 0!==t.data.subgroup&&(void 0===this.subgroups[t.data.subgroup]&&(this.subgroups[t.data.subgroup]={height:0,top:0,start:t.data.start,end:t.data.end,visible:!1,index:this.subgroupIndex,items:[]},this.subgroupIndex++),new Date(t.data.start)new Date(this.subgroups[t.data.subgroup].end)&&(this.subgroups[t.data.subgroup].end=t.data.end),this.subgroups[t.data.subgroup].items.push(t)),this.orderSubgroups(),this.visibleItems.indexOf(t)==-1){var e=this.itemSet.body.range;this._checkIfVisible(t,this.visibleItems,e)}},n.prototype._updateSubgroupsSizes=function(){var t=this;if(t.subgroups)for(var e in t.subgroups){var i=t.subgroups[e].items[0].data.start,o=t.subgroups[e].items[0].data.end;t.subgroups[e].items.forEach(function(t){new Date(t.data.start)new Date(o)&&(o=t.data.end)}),t.subgroups[e].start=i,t.subgroups[e].end=o}},n.prototype.orderSubgroups=function(){if(void 0!==this.subgroupOrderer){var t=[];if("string"==typeof this.subgroupOrderer){for(var e in this.subgroups)t.push({subgroup:e,sortField:this.subgroups[e].items[0].data[this.subgroupOrderer]});t.sort(function(t,e){return t.sortField-e.sortField})}else if("function"==typeof this.subgroupOrderer){for(var e in this.subgroups)t.push(this.subgroups[e].items[0].data);t.sort(this.subgroupOrderer)}if(t.length>0)for(var i=0;i0)for(var l=0;lh}),1==this.checkRangedItems)for(this.checkRangedItems=!1,l=0;lh})}for(var l=0;l=0;s--){var r=e[s];if(n(r))break;void 0===o[r.id]&&(o[r.id]=!0,i.push(r))}for(var s=t+1;so[r].index&&e.collisionByTimes(o[n],o[r])){s=o[r];break}null!=s&&(o[n].top=s.top+s.height)}while(s)}for(var a=0;ae.right&&t.top-o.vertical+ie.top:t.left-o.horizontal+ie.left&&t.top-o.vertical+ie.top},e.collisionByTimes=function(t,e){return t.start<=e.start&&t.end>=e.start&&t.tope.top||e.start<=t.start&&e.end>=t.start&&e.topt.top}},function(t,e,i){function o(t,e,i){if(this.props={content:{width:0}},this.overflow=!1,this.options=i,t){if(void 0==t.start)throw new Error('Property "start" missing in item '+t.id);if(void 0==t.end)throw new Error('Property "end" missing in item '+t.id)}n.call(this,t,e,i)}var n=(i(101),i(117));o.prototype=new n(null,null,null),o.prototype.baseClassName="vis-item vis-range",o.prototype.isVisible=function(t){return this.data.startt.start},o.prototype.redraw=function(){var t=this.dom;if(t||(this.dom={},t=this.dom,t.box=document.createElement("div"),t.frame=document.createElement("div"),t.frame.className="vis-item-overflow",t.box.appendChild(t.frame),t.visibleFrame=document.createElement("div"),t.visibleFrame.className="vis-item-visible-frame",t.box.appendChild(t.visibleFrame),t.content=document.createElement("div"),t.content.className="vis-item-content",t.frame.appendChild(t.content),t.box["timeline-item"]=this,this.dirty=!0),!this.parent)throw new Error("Cannot redraw item: no parent attached");if(!t.box.parentNode){var e=this.parent.dom.foreground;if(!e)throw new Error("Cannot redraw item: parent has no foreground container element");e.appendChild(t.box)}if(this.displayed=!0,this.dirty){this._updateContents(this.dom.content),this._updateTitle(),this._updateDataAttributes(this.dom.box),this._updateStyle(this.dom.box);var i=(this.options.editable.updateTime||this.options.editable.updateGroup||this.editable===!0)&&this.editable!==!1,o=(this.data.className?" "+this.data.className:"")+(this.selected?" vis-selected":"")+(i?" vis-editable":" vis-readonly");t.box.className=this.baseClassName+o,this.overflow="hidden"!==window.getComputedStyle(t.frame).overflow,this.dom.content.style.maxWidth="none",this.props.content.width=this.dom.content.offsetWidth,this.height=this.dom.box.offsetHeight,this.dom.content.style.maxWidth="",this.dirty=!1}this._repaintOnItemUpdateTimeTooltip(t.box),this._repaintDeleteButton(t.box),this._repaintDragCenter(),this._repaintDragLeft(),this._repaintDragRight()},o.prototype.show=function(){this.displayed||this.redraw()},o.prototype.hide=function(){if(this.displayed){var t=this.dom.box;t.parentNode&&t.parentNode.removeChild(t),this.displayed=!1}},o.prototype.repositionX=function(t){var e,i,o=this.parent.width,n=this.conversion.toScreen(this.data.start),s=this.conversion.toScreen(this.data.end);void 0!==t&&t!==!0||(n<-o&&(n=-o),s>2*o&&(s=2*o));var r=Math.max(s-n+.5,1);switch(this.overflow?(this.options.rtl?this.right=n:this.left=n,this.width=r+this.props.content.width,i=this.props.content.width):(this.options.rtl?this.right=n:this.left=n,this.width=r,i=Math.min(s-n,this.props.content.width)),this.options.rtl?this.dom.box.style.right=this.right+"px":this.dom.box.style.left=this.left+"px",this.dom.box.style.width=r+"px",this.options.align){case"left":this.options.rtl?this.dom.content.style.right="0":this.dom.content.style.left="0";break;case"right":this.options.rtl?this.dom.content.style.right=Math.max(r-i,0)+"px":this.dom.content.style.left=Math.max(r-i,0)+"px";break;case"center":this.options.rtl?this.dom.content.style.right=Math.max((r-i)/2,0)+"px":this.dom.content.style.left=Math.max((r-i)/2,0)+"px";break;default:e=this.overflow?s>0?Math.max(-n,0):-i:n<0?-n:0,this.options.rtl?this.dom.content.style.right=e+"px":(this.dom.content.style.left=e+"px",this.dom.content.style.width="calc(100% - "+e+"px)")}},o.prototype.repositionY=function(){var t=this.options.orientation.item,e=this.dom.box;"top"==t?e.style.top=this.top+"px":e.style.top=this.parent.height-this.top-this.height+"px"},o.prototype._repaintDragLeft=function(){if(this.selected&&this.options.editable.updateTime&&!this.dom.dragLeft){var t=document.createElement("div");t.className="vis-drag-left",t.dragLeftItem=this,this.dom.box.appendChild(t),this.dom.dragLeft=t}else!this.selected&&this.dom.dragLeft&&(this.dom.dragLeft.parentNode&&this.dom.dragLeft.parentNode.removeChild(this.dom.dragLeft),this.dom.dragLeft=null)},o.prototype._repaintDragRight=function(){if(this.selected&&this.options.editable.updateTime&&!this.dom.dragRight){var t=document.createElement("div");t.className="vis-drag-right",t.dragRightItem=this,this.dom.box.appendChild(t),this.dom.dragRight=t}else!this.selected&&this.dom.dragRight&&(this.dom.dragRight.parentNode&&this.dom.dragRight.parentNode.removeChild(this.dom.dragRight),this.dom.dragRight=null)},t.exports=o},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e,i){this.id=null,this.parent=null,this.data=t,this.dom=null,this.conversion=e||{},this.options=i||{},this.selected=!1,this.displayed=!1,this.groupShowing=!0,this.dirty=!0,this.popup=null,this.top=null,this.right=null,this.left=null,this.width=null,this.height=null,this.editable=null,this.data&&this.data.hasOwnProperty("editable")&&("boolean"==typeof this.data.editable?this.editable={updateTime:this.data.editable,updateGroup:this.data.editable,remove:this.data.editable}:"object"===(0,h.default)(i.editable)&&(this.editable={},l.selectiveExtend(["updateTime","updateGroup","remove"],this.editable,t.editable)))}var s=i(58),r=o(s),a=i(62),h=o(a),d=i(101),l=i(1),u=i(84);n.prototype.stack=!0,n.prototype.select=function(){this.selected=!0,this.dirty=!0,this.displayed&&this.redraw()},n.prototype.unselect=function(){this.selected=!1,this.dirty=!0,this.displayed&&this.redraw()},n.prototype.setData=function(t){var e=void 0!=t.group&&this.data.group!=t.group;e&&this.parent.itemSet._moveToGroup(this,t.group),t.hasOwnProperty("editable")&&("boolean"==typeof t.editable?this.editable={updateTime:this.data.editable,updateGroup:this.data.editable,remove:this.data.editable}:"object"===(0,h.default)(options.editable)&&(this.editable={},l.selectiveExtend(["updateTime","updateGroup","remove"],this.editable,t.editable))),this.data=t,this.dirty=!0,this.displayed&&this.redraw()},n.prototype.setParent=function(t){this.displayed?(this.hide(),this.parent=t,this.parent&&this.show()):this.parent=t},n.prototype.isVisible=function(t){return!1},n.prototype.show=function(){return!1},n.prototype.hide=function(){return!1},n.prototype.redraw=function(){},n.prototype.repositionX=function(){},n.prototype.repositionY=function(){},n.prototype._repaintDragCenter=function(){if(this.selected&&this.options.editable.updateTime&&!this.dom.dragCenter){var t=this,e=document.createElement("div");e.className="vis-drag-center",e.dragCenterItem=this,new d(e).on("doubletap",function(e){e.stopPropagation(),t.parent.itemSet._onUpdateItem(t)}),this.dom.box?this.dom.box.appendChild(e):this.dom.point&&this.dom.point.appendChild(e),this.dom.dragCenter=e}else!this.selected&&this.dom.dragCenter&&(this.dom.dragCenter.parentNode&&this.dom.dragCenter.parentNode.removeChild(this.dom.dragCenter),this.dom.dragCenter=null)},n.prototype._repaintDeleteButton=function(t){var e=(this.options.editable.overrideItems||null==this.editable)&&this.options.editable.remove||!this.options.editable.overrideItems&&null!=this.editable&&this.editable.remove;if(this.selected&&e&&!this.dom.deleteButton){var i=this,o=document.createElement("div");this.options.rtl?o.className="vis-delete-rtl":o.className="vis-delete",o.title="Delete this item",new d(o).on("tap",function(t){t.stopPropagation(),i.parent.removeFromDataSet(i)}),t.appendChild(o),this.dom.deleteButton=o}else!this.selected&&this.dom.deleteButton&&(this.dom.deleteButton.parentNode&&this.dom.deleteButton.parentNode.removeChild(this.dom.deleteButton),this.dom.deleteButton=null)},n.prototype._repaintOnItemUpdateTimeTooltip=function(t){if(this.options.tooltipOnItemUpdateTime){var e=(this.options.editable.updateTime||this.data.editable===!0)&&this.data.editable!==!1;if(this.selected&&e&&!this.dom.onItemUpdateTimeTooltip){var i=document.createElement("div");i.className="vis-onUpdateTime-tooltip",t.appendChild(i),this.dom.onItemUpdateTimeTooltip=i}else!this.selected&&this.dom.onItemUpdateTimeTooltip&&(this.dom.onItemUpdateTimeTooltip.parentNode&&this.dom.onItemUpdateTimeTooltip.parentNode.removeChild(this.dom.onItemUpdateTimeTooltip),this.dom.onItemUpdateTimeTooltip=null);if(this.dom.onItemUpdateTimeTooltip){this.dom.onItemUpdateTimeTooltip.style.visibility=this.parent.itemSet.touchParams.itemIsDragging?"visible":"hidden",this.options.rtl?this.dom.onItemUpdateTimeTooltip.style.right=this.dom.content.style.right:this.dom.onItemUpdateTimeTooltip.style.left=this.dom.content.style.left;var o,n=50,s=this.parent.itemSet.body.domProps.scrollTop;o="top"==this.options.orientation.item?this.top:this.parent.height-this.top-this.height;var r=o+this.parent.top-n<-s;r?(this.dom.onItemUpdateTimeTooltip.style.bottom="",this.dom.onItemUpdateTimeTooltip.style.top=this.height+2+"px"):(this.dom.onItemUpdateTimeTooltip.style.top="",this.dom.onItemUpdateTimeTooltip.style.bottom=this.height+2+"px");var a,h;this.options.tooltipOnItemUpdateTime&&this.options.tooltipOnItemUpdateTime.template?(h=this.options.tooltipOnItemUpdateTime.template.bind(this),a=h(this.data)):(a="start: "+u(this.data.start).format("MM/DD/YYYY hh:mm"),this.data.end&&(a+="
end: "+u(this.data.end).format("MM/DD/YYYY hh:mm"))),this.dom.onItemUpdateTimeTooltip.innerHTML=a}}},n.prototype._updateContents=function(t){var e,i,o,n,s=this.parent.itemSet.itemsData.get(this.id),r=this.dom.box||this.dom.point,a=r.getElementsByClassName("vis-item-visible-frame")[0];if(this.options.visibleFrameTemplate?(n=this.options.visibleFrameTemplate.bind(this),o=n(s,r)):o="",a)if(o instanceof Object&&!(o instanceof Element))n(s,a);else{var h=this._contentToString(this.itemVisibleFrameContent)!==this._contentToString(o);if(h){if(o instanceof Element)a.innerHTML="",a.appendChild(o);else if(void 0!=o)a.innerHTML=o;else if("background"!=this.data.type||void 0!==this.data.content)throw new Error('Property "content" missing in item '+this.id);this.itemVisibleFrameContent=o}}if(this.options.template?(i=this.options.template.bind(this),e=i(s,t)):e=this.data.content,e instanceof Object&&!(e instanceof Element))i(s,t);else{var h=this._contentToString(this.content)!==this._contentToString(e);if(h){if(e instanceof Element)t.innerHTML="",t.appendChild(e);else if(void 0!=e)t.innerHTML=e;else if("background"!=this.data.type||void 0!==this.data.content)throw new Error('Property "content" missing in item '+this.id);this.content=e}}},n.prototype._updateTitle=function(){null!=this.data.title&&null!=this.popup&&this.popup.setText(this.data.title||"")},n.prototype._updateDataAttributes=function(t){if(this.options.dataAttributes&&this.options.dataAttributes.length>0){var e=[];if(Array.isArray(this.options.dataAttributes))e=this.options.dataAttributes;else{if("all"!=this.options.dataAttributes)return;e=(0,r.default)(this.data)}for(var i=0;it.start&&this.data.start.getTime()-nt.start&&this.data.start.getTime()t.start&&this.data.start.getTime()-n/2t.start&&this.data.startt.start},o.prototype.redraw=function(){var t=this.dom;if(t||(this.dom={},t=this.dom,t.box=document.createElement("div"),t.frame=document.createElement("div"),t.frame.className="vis-item-overflow",t.box.appendChild(t.frame),t.content=document.createElement("div"),t.content.className="vis-item-content",t.frame.appendChild(t.content),this.dirty=!0),!this.parent)throw new Error("Cannot redraw item: no parent attached");if(!t.box.parentNode){var e=this.parent.dom.background;if(!e)throw new Error("Cannot redraw item: parent has no background container element");e.appendChild(t.box)}if(this.displayed=!0,this.dirty){this._updateContents(this.dom.content),this._updateTitle(),this._updateDataAttributes(this.dom.content),this._updateStyle(this.dom.box);var i=(this.data.className?" "+this.data.className:"")+(this.selected?" vis-selected":"");t.box.className=this.baseClassName+i,this.overflow="hidden"!==window.getComputedStyle(t.content).overflow,this.props.content.width=this.dom.content.offsetWidth,this.height=0,this.dirty=!1}},o.prototype.show=r.prototype.show,o.prototype.hide=r.prototype.hide,o.prototype.repositionX=r.prototype.repositionX,o.prototype.repositionY=function(t){var e;if(void 0!==this.data.subgroup){var i=this.data.subgroup,o=this.parent.subgroups;o[i].index;this.dom.box.style.height=this.parent.subgroups[i].height+"px";var n=this.options.orientation.item;"top"==n?this.dom.box.style.top=this.parent.top+this.parent.subgroups[i].top+"px":this.dom.box.style.top=this.parent.top+this.parent.height-this.parent.subgroups[i].top-this.parent.subgroups[i].height+"px",this.dom.box.style.bottom=""}else this.parent instanceof s?(e=Math.max(this.parent.height,this.parent.itemSet.body.domProps.center.height,this.parent.itemSet.body.domProps.centerContainer.height),this.dom.box.style.top="top"==n?"0":"",this.dom.box.style.bottom="top"==n?"":"0"):(e=this.parent.height,this.dom.box.style.top=this.parent.top+"px",this.dom.box.style.bottom="");this.dom.box.style.height=e+"px"},t.exports=o},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){this.dom={foreground:null,lines:[],majorTexts:[],minorTexts:[],redundant:{lines:[],majorTexts:[],minorTexts:[]}},this.props={range:{start:0,end:0,minimumStep:0},lineTop:0},this.defaultOptions={orientation:{axis:"bottom"},showMinorLabels:!0,showMajorLabels:!0,maxMinorChars:7,format:d.FORMAT,moment:u,timeAxis:null},this.options=a.extend({},this.defaultOptions),this.body=t,this._create(),this.setOptions(e)}var s=i(62),r=o(s),a=i(1),h=i(108),d=i(113),l=i(109),u=i(84);n.prototype=new h,n.prototype.setOptions=function(t){t&&(a.selectiveExtend(["showMinorLabels","showMajorLabels","maxMinorChars","hiddenDates","timeAxis","moment","rtl"],this.options,t),a.selectiveDeepExtend(["format"],this.options,t),"orientation"in t&&("string"==typeof t.orientation?this.options.orientation.axis=t.orientation:"object"===(0,r.default)(t.orientation)&&"axis"in t.orientation&&(this.options.orientation.axis=t.orientation.axis)),"locale"in t&&("function"==typeof u.locale?u.locale(t.locale):u.lang(t.locale)))},n.prototype._create=function(){this.dom.foreground=document.createElement("div"),this.dom.background=document.createElement("div"),this.dom.foreground.className="vis-time-axis vis-foreground",this.dom.background.className="vis-time-axis vis-background"},n.prototype.destroy=function(){this.dom.foreground.parentNode&&this.dom.foreground.parentNode.removeChild(this.dom.foreground),this.dom.background.parentNode&&this.dom.background.parentNode.removeChild(this.dom.background),this.body=null},n.prototype.redraw=function(){var t=this.props,e=this.dom.foreground,i=this.dom.background,o="top"==this.options.orientation.axis?this.body.dom.top:this.body.dom.bottom,n=e.parentNode!==o;this._calculateCharSize();var s=this.options.showMinorLabels&&"none"!==this.options.orientation.axis,r=this.options.showMajorLabels&&"none"!==this.options.orientation.axis;t.minorLabelHeight=s?t.minorCharHeight:0,t.majorLabelHeight=r?t.majorCharHeight:0,t.height=t.minorLabelHeight+t.majorLabelHeight,t.width=e.offsetWidth,t.minorLineHeight=this.body.domProps.root.height-t.majorLabelHeight-("top"==this.options.orientation.axis?this.body.domProps.bottom.height:this.body.domProps.top.height),t.minorLineWidth=1,t.majorLineHeight=t.minorLineHeight+t.majorLabelHeight,t.majorLineWidth=1;var a=e.nextSibling,h=i.nextSibling;return e.parentNode&&e.parentNode.removeChild(e),i.parentNode&&i.parentNode.removeChild(i),e.style.height=this.props.height+"px",this._repaintLabels(),a?o.insertBefore(e,a):o.appendChild(e),h?this.body.dom.backgroundVertical.insertBefore(i,h):this.body.dom.backgroundVertical.appendChild(i),this._isResized()||n},n.prototype._repaintLabels=function(){var t=this.options.orientation.axis,e=a.convert(this.body.range.start,"Number"),i=a.convert(this.body.range.end,"Number"),o=this.body.util.toTime((this.props.minorCharWidth||10)*this.options.maxMinorChars).valueOf(),n=o-l.getHiddenDurationBefore(this.options.moment,this.body.hiddenDates,this.body.range,o);n-=this.body.util.toTime(0).valueOf();var s=new d(new Date(e),new Date(i),n,this.body.hiddenDates);s.setMoment(this.options.moment),this.options.format&&s.setFormat(this.options.format),this.options.timeAxis&&s.setScale(this.options.timeAxis),this.step=s;var r=this.dom;r.redundant.lines=r.lines,r.redundant.majorTexts=r.majorTexts,r.redundant.minorTexts=r.minorTexts,r.lines=[],r.majorTexts=[],r.minorTexts=[];var h,u,c,f,m,g,v,y,b,_,w=0,x=void 0,D=0,S=1e3;for(s.start(),u=s.getCurrent(),f=this.body.util.toScreen(u);s.hasNext()&&D=.4*v;if(this.options.showMinorLabels&&k){var C=this._repaintMinorText(c,b,t,_);C.style.width=w+"px"}m&&this.options.showMajorLabels?(c>0&&(void 0==x&&(x=c),C=this._repaintMajorText(c,s.getLabelMajor(),t,_)),y=this._repaintMajorLine(c,w,t,_)):k?y=this._repaintMinorLine(c,w,t,_):y&&(y.style.width=parseInt(y.style.width)+w+"px")}if(D!==S||p||(console.warn("Something is wrong with the Timeline scale. Limited drawing of grid lines to "+S+" lines."),p=!0),this.options.showMajorLabels){var T=this.body.util.toTime(0),M=s.getLabelMajor(T),O=M.length*(this.props.majorCharWidth||10)+10;(void 0==x||O1e3&&(o=1e3),e.redraw(),e.body.emitter.emit("currentTimeTick"),e.currentTimeTimer=setTimeout(t,o)}var e=this;t()},o.prototype.stop=function(){void 0!==this.currentTimeTimer&&(clearTimeout(this.currentTimeTimer),delete this.currentTimeTimer)},o.prototype.setCurrentTime=function(t){var e=n.convert(t,"Date").valueOf(),i=(new Date).valueOf();this.offset=e-i,this.redraw()},o.prototype.getCurrentTime=function(){return new Date((new Date).valueOf()+this.offset)},t.exports=o},function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i="string",o="boolean",n="number",s="array",r="date",a="object",h="dom",d="moment",l="any",u={configure:{enabled:{boolean:o},filter:{boolean:o,function:"function"},container:{dom:h},__type__:{object:a,boolean:o,function:"function"}},align:{string:i},rtl:{boolean:o,undefined:"undefined"},rollingMode:{boolean:o,undefined:"undefined"},verticalScroll:{boolean:o,undefined:"undefined"},horizontalScroll:{boolean:o,undefined:"undefined"},autoResize:{boolean:o},throttleRedraw:{number:n},clickToUse:{boolean:o},dataAttributes:{string:i,array:s},editable:{add:{boolean:o,undefined:"undefined"},remove:{boolean:o,undefined:"undefined"},updateGroup:{boolean:o,undefined:"undefined"},updateTime:{boolean:o,undefined:"undefined"},overrideItems:{boolean:o,undefined:"undefined"},__type__:{boolean:o,object:a}},end:{number:n,date:r,string:i,moment:d},format:{minorLabels:{millisecond:{string:i,undefined:"undefined"},second:{string:i,undefined:"undefined"},minute:{string:i,undefined:"undefined"},hour:{string:i,undefined:"undefined"},weekday:{string:i,undefined:"undefined"},day:{string:i,undefined:"undefined"},month:{string:i,undefined:"undefined"},year:{string:i,undefined:"undefined"},__type__:{object:a,function:"function"}},majorLabels:{millisecond:{string:i,undefined:"undefined"},second:{string:i,undefined:"undefined"},minute:{string:i,undefined:"undefined"},hour:{string:i,undefined:"undefined"},weekday:{string:i,undefined:"undefined"},day:{string:i,undefined:"undefined"},month:{string:i,undefined:"undefined"},year:{string:i,undefined:"undefined"},__type__:{object:a,function:"function"}},__type__:{object:a}},moment:{function:"function"},groupOrder:{string:i,function:"function"},groupEditable:{add:{boolean:o,undefined:"undefined"},remove:{boolean:o,undefined:"undefined"},order:{boolean:o,undefined:"undefined"},__type__:{boolean:o,object:a}},groupOrderSwap:{function:"function"},height:{string:i,number:n},hiddenDates:{start:{date:r,number:n,string:i,moment:d},end:{date:r,number:n,string:i,moment:d},repeat:{string:i},__type__:{object:a,array:s}},itemsAlwaysDraggable:{boolean:o},locale:{string:i},locales:{__any__:{any:l},__type__:{object:a}},margin:{axis:{number:n},item:{horizontal:{number:n,undefined:"undefined"},vertical:{number:n,undefined:"undefined"},__type__:{object:a,number:n}},__type__:{object:a,number:n}},max:{date:r,number:n,string:i,moment:d},maxHeight:{number:n,string:i},maxMinorChars:{number:n},min:{date:r,number:n,string:i,moment:d},minHeight:{number:n,string:i},moveable:{boolean:o},multiselect:{boolean:o},multiselectPerGroup:{boolean:o},onAdd:{function:"function"},onUpdate:{function:"function"},onMove:{function:"function"},onMoving:{function:"function"},onRemove:{function:"function"},onAddGroup:{function:"function"},onMoveGroup:{function:"function"},onRemoveGroup:{function:"function"},order:{function:"function"},orientation:{axis:{string:i,undefined:"undefined"},item:{string:i,undefined:"undefined"},__type__:{string:i,object:a}},selectable:{boolean:o},showCurrentTime:{boolean:o},showMajorLabels:{boolean:o},showMinorLabels:{boolean:o},stack:{boolean:o},stackSubgroups:{boolean:o},snap:{function:"function",null:"null"},start:{date:r,number:n,string:i,moment:d},template:{function:"function"},groupTemplate:{function:"function"},visibleFrameTemplate:{string:i,function:"function"},tooltip:{followMouse:{boolean:o},overflowMethod:{string:["cap","flip"]},__type__:{object:a}},tooltipOnItemUpdateTime:{template:{function:"function"},__type__:{boolean:o,object:a}},timeAxis:{scale:{string:i,undefined:"undefined"},step:{number:n,undefined:"undefined"},__type__:{object:a}},type:{string:i},width:{string:i,number:n},zoomable:{boolean:o},zoomKey:{string:["ctrlKey","altKey","metaKey",""]},zoomMax:{number:n},zoomMin:{number:n},__type__:{object:a}},p={global:{align:["center","left","right"],direction:!1,autoResize:!0,clickToUse:!1,editable:{add:!1,remove:!1,updateGroup:!1,updateTime:!1},end:"",format:{minorLabels:{millisecond:"SSS",second:"s",minute:"HH:mm",hour:"HH:mm",weekday:"ddd D",day:"D",month:"MMM",year:"YYYY"},majorLabels:{millisecond:"HH:mm:ss",second:"D MMMM HH:mm",minute:"ddd D MMMM",hour:"ddd D MMMM",weekday:"MMMM YYYY",day:"MMMM YYYY",month:"YYYY",year:""}},groupsDraggable:!1,height:"",locale:"",margin:{axis:[20,0,100,1],item:{horizontal:[10,0,100,1],vertical:[10,0,100,1]}},max:"",maxHeight:"",maxMinorChars:[7,0,20,1],min:"",minHeight:"",moveable:!1,multiselect:!1,multiselectPerGroup:!1,orientation:{axis:["both","bottom","top"],item:["bottom","top"]},selectable:!0,showCurrentTime:!1,showMajorLabels:!0,showMinorLabels:!0,stack:!0,stackSubgroups:!0,start:"",tooltip:{followMouse:!1,overflowMethod:"flip"},tooltipOnItemUpdateTime:!1,type:["box","point","range","background"],width:"100%",zoomable:!0,zoomKey:["ctrlKey","altKey","metaKey",""],zoomMax:[31536e10,10,31536e10,1],zoomMin:[10,10,31536e10,1]}};e.allOptions=u,e.configureOptions=p},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e,i,o){if(!(Array.isArray(i)||i instanceof u||i instanceof p)&&i instanceof Object){var n=o;o=i,i=n}o&&o.throttleRedraw&&console.warn('Graph2d option "throttleRedraw" is DEPRICATED and no longer supported. It will be removed in the next MAJOR release.');var s=this;this.defaultOptions={start:null,end:null,autoResize:!0,orientation:{axis:"bottom",item:"bottom"},moment:d,width:null,height:null,maxHeight:null,minHeight:null},this.options=l.deepExtend({},this.defaultOptions),this._create(t),this.components=[],this.body={dom:this.dom,domProps:this.props,emitter:{on:this.on.bind(this),off:this.off.bind(this),emit:this.emit.bind(this)},hiddenDates:[],util:{toScreen:s._toScreen.bind(s),toGlobalScreen:s._toGlobalScreen.bind(s),toTime:s._toTime.bind(s),toGlobalTime:s._toGlobalTime.bind(s)}},this.range=new c(this.body),this.components.push(this.range),this.body.range=this.range,this.timeAxis=new m(this.body),this.components.push(this.timeAxis),this.currentTime=new g(this.body),this.components.push(this.currentTime),this.linegraph=new y(this.body),this.components.push(this.linegraph),this.itemsData=null,this.groupsData=null,this.on("tap",function(t){s.emit("click",s.getEventProperties(t))}),this.on("doubletap",function(t){s.emit("doubleClick",s.getEventProperties(t))}),this.dom.root.oncontextmenu=function(t){s.emit("contextmenu",s.getEventProperties(t))},o&&this.setOptions(o),i&&this.setGroups(i),e&&this.setItems(e),this._redraw()}var s=i(94),r=o(s),a=i(105),h=o(a),d=(i(106),i(101),i(84)),l=i(1),u=i(90),p=i(92),c=i(107),f=i(110),m=i(122),g=i(127),v=i(125),y=i(130),b=i(105).printStyle,_=i(138).allOptions,w=i(138).configureOptions; +n.prototype=new f,n.prototype.setOptions=function(t){var e=h.default.validate(t,_);e===!0&&console.log("%cErrors have been found in the supplied options object.",b),f.prototype.setOptions.call(this,t)},n.prototype.setItems=function(t){var e,i=null==this.itemsData;if(e=t?t instanceof u||t instanceof p?t:new u(t,{type:{start:"Date",end:"Date"}}):null,this.itemsData=e,this.linegraph&&this.linegraph.setItems(e),i)if(void 0!=this.options.start||void 0!=this.options.end){var o=void 0!=this.options.start?this.options.start:null,n=void 0!=this.options.end?this.options.end:null;this.setWindow(o,n,{animation:!1})}else this.fit({animation:!1})},n.prototype.setGroups=function(t){var e;e=t?t instanceof u||t instanceof p?t:new u(t):null,this.groupsData=e,this.linegraph.setGroups(e)},n.prototype.getLegend=function(t,e,i){return void 0===e&&(e=15),void 0===i&&(i=15),void 0!==this.linegraph.groups[t]?this.linegraph.groups[t].getLegend(e,i):"cannot find group:'"+t+"'"},n.prototype.isGroupVisible=function(t){return void 0!==this.linegraph.groups[t]&&(this.linegraph.groups[t].visible&&(void 0===this.linegraph.options.groups.visibility[t]||1==this.linegraph.options.groups.visibility[t]))},n.prototype.getDataRange=function(){var t=null,e=null;for(var i in this.linegraph.groups)if(this.linegraph.groups.hasOwnProperty(i)&&1==this.linegraph.groups[i].visible)for(var o=0;os?s:t,e=null==e?s:e0&&d.push(u.screenToValue(n)),!p.hidden&&this.itemsData.length>0&&d.push(p.screenToValue(n)),{event:t,what:h,pageX:t.srcEvent?t.srcEvent.pageX:t.pageX,pageY:t.srcEvent?t.srcEvent.pageY:t.pageY,x:o,y:n,time:s,value:d}},n.prototype._createConfigurator=function(){return new r.default(this,this.dom.container,w)},t.exports=n},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){this.id=a.randomUUID(),this.body=t,this.defaultOptions={yAxisOrientation:"left",defaultGroup:"default",sort:!0,sampling:!0,stack:!1,graphHeight:"400px",shaded:{enabled:!1,orientation:"bottom"},style:"line",barChart:{width:50,sideBySide:!1,align:"center"},interpolation:{enabled:!0,parametrization:"centripetal",alpha:.5},drawPoints:{enabled:!0,size:6,style:"square"},dataAxis:{},legend:{},groups:{visibility:{}}},this.options=a.extend({},this.defaultOptions),this.dom={},this.props={},this.hammer=null,this.groups={},this.abortedGraphUpdate=!1,this.updateSVGheight=!1,this.updateSVGheightOnResize=!1,this.forceGraphUpdate=!0;var i=this;this.itemsData=null,this.groupsData=null,this.itemListeners={add:function(t,e,o){i._onAdd(e.items)},update:function(t,e,o){i._onUpdate(e.items)},remove:function(t,e,o){i._onRemove(e.items)}},this.groupListeners={add:function(t,e,o){i._onAddGroups(e.items)},update:function(t,e,o){i._onUpdateGroups(e.items)},remove:function(t,e,o){i._onRemoveGroups(e.items)}},this.items={},this.selection=[],this.lastStart=this.body.range.start,this.touchParams={},this.svgElements={},this.setOptions(e),this.groupsUsingDefaultStyles=[0],this.body.emitter.on("rangechanged",function(){i.lastStart=i.body.range.start,i.svg.style.left=a.option.asSize(-i.props.width),i.forceGraphUpdate=!0,i.redraw.call(i)}),this._create(),this.framework={svg:this.svg,svgElements:this.svgElements,options:this.options,groups:this.groups}}var s=i(62),r=o(s),a=i(1),h=i(89),d=i(90),l=i(92),u=i(108),p=i(131),c=i(133),f=i(137),m=i(134),g=i(136),v=i(135),y="__ungrouped__";n.prototype=new u,n.prototype._create=function(){var t=document.createElement("div");t.className="vis-line-graph",this.dom.frame=t,this.svg=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.svg.style.position="relative",this.svg.style.height=(""+this.options.graphHeight).replace("px","")+"px",this.svg.style.display="block",t.appendChild(this.svg),this.options.dataAxis.orientation="left",this.yAxisLeft=new p(this.body,this.options.dataAxis,this.svg,this.options.groups),this.options.dataAxis.orientation="right",this.yAxisRight=new p(this.body,this.options.dataAxis,this.svg,this.options.groups),delete this.options.dataAxis.orientation,this.legendLeft=new f(this.body,this.options.legend,"left",this.options.groups),this.legendRight=new f(this.body,this.options.legend,"right",this.options.groups),this.show()},n.prototype.setOptions=function(t){if(t){var e=["sampling","defaultGroup","stack","height","graphHeight","yAxisOrientation","style","barChart","dataAxis","sort","groups"];void 0===t.graphHeight&&void 0!==t.height?(this.updateSVGheight=!0,this.updateSVGheightOnResize=!0):void 0!==this.body.domProps.centerContainer.height&&void 0!==t.graphHeight&&parseInt((t.graphHeight+"").replace("px",""))0){var a={};for(this._getRelevantData(r,a,n,s),this._applySampling(r,a),e=0;e0)switch(t.options.style){case"line":l.hasOwnProperty(r[e])||(l[r[e]]=g.calcPath(a[r[e]],t)),g.draw(l[r[e]],t,this.framework);case"point":case"points":"point"!=t.options.style&&"points"!=t.options.style&&1!=t.options.drawPoints.enabled||v.draw(a[r[e]],t,this.framework);break;case"bar":}}}return h.cleanupElements(this.svgElements),!1},n.prototype._stack=function(t,e){var i,o,n,s,r;i=0;for(var a=0;at[a].x){r=e[h],s=0==h?r:e[h-1],i=h;break}}void 0===r&&(s=e[e.length-1],r=e[e.length-1]),o=r.x-s.x,n=r.y-s.y,0==o?t[a].y=t[a].orginalY+r.y:t[a].y=t[a].orginalY+n/o*(t[a].x-s.x)+s.y}},n.prototype._getRelevantData=function(t,e,i,o){var n,s,r,h;if(t.length>0)for(s=0;s0)for(var o=0;o0){var s=1,r=n.length,a=this.body.util.toGlobalScreen(n[n.length-1].x)-this.body.util.toGlobalScreen(n[0].x),h=r/a;s=Math.min(Math.ceil(.2*r),Math.max(1,Math.round(h)));for(var d=new Array(r),l=0;l0){for(s=0;s0&&(n=this.groups[t[s]],r.stack===!0&&"bar"===r.style?"left"===r.yAxisOrientation?a=a.concat(n.getItems()):h=h.concat(n.getItems()):i[t[s]]=n.getYRange(o,t[s]));m.getStackedYRange(a,i,t,"__barStackLeft","left"),m.getStackedYRange(h,i,t,"__barStackRight","right")}},n.prototype._updateYAxis=function(t,e){var i,o,n=!1,s=!1,r=!1,a=1e9,h=1e9,d=-1e9,l=-1e9;if(t.length>0){for(var u=0;ui?i:a,d=di?i:h,l=l=0&&t._redrawLabel(o-2,e.val,i,"vis-y-axis vis-major",t.props.majorCharHeight),t.master===!0&&(n?t._redrawLine(o,i,"vis-grid vis-horizontal vis-major",t.options.majorLinesOffset,t.props.majorLineWidth):t._redrawLine(o,i,"vis-grid vis-horizontal vis-minor",t.options.minorLinesOffset,t.props.minorLineWidth))});var a=0;void 0!==this.options[i].title&&void 0!==this.options[i].title.text&&(a=this.props.titleCharHeight);var d=this.options.icons===!0?Math.max(this.options.iconWidth,a)+this.options.labelOffsetX+15:a+this.options.labelOffsetX+15;return this.maxLabelSize>this.width-d&&this.options.visible===!0?(this.width=this.maxLabelSize+d,this.options.width=this.width+"px",h.cleanupElements(this.DOMelements.lines),h.cleanupElements(this.DOMelements.labels),this.redraw(),e=!0):this.maxLabelSizethis.minWidth?(this.width=Math.max(this.minWidth,this.maxLabelSize+d),this.options.width=this.width+"px",h.cleanupElements(this.DOMelements.lines),h.cleanupElements(this.DOMelements.labels),this.redraw(),e=!0):(h.cleanupElements(this.DOMelements.lines),h.cleanupElements(this.DOMelements.labels),e=!1),e},n.prototype.convertValue=function(t){return this.scale.convertValue(t)},n.prototype.screenToValue=function(t){return this.scale.screenToValue(t)},n.prototype._redrawLabel=function(t,e,i,o,n){var s=h.getDOMElement("div",this.DOMelements.labels,this.dom.frame);s.className=o,s.innerHTML=e,"left"===i?(s.style.left="-"+this.options.labelOffsetX+"px",s.style.textAlign="right"):(s.style.right="-"+this.options.labelOffsetX+"px",s.style.textAlign="left"),s.style.top=t-.5*n+this.options.labelOffsetY+"px",e+="";var r=Math.max(this.props.majorCharWidth,this.props.minorCharWidth);this.maxLabelSize6&&void 0!==arguments[6]&&arguments[6],a=arguments.length>7&&void 0!==arguments[7]&&arguments[7];if(this.majorSteps=[1,2,5,10],this.minorSteps=[.25,.5,1,2],this.customLines=null,this.containerHeight=n,this.majorCharHeight=s,this._start=t,this._end=e,this.scale=1,this.minorStepIdx=-1,this.magnitudefactor=1,this.determineScale(),this.zeroAlign=r,this.autoScaleStart=i,this.autoScaleEnd=o,this.formattingFunction=a,i||o){var h=this,d=function(t){var e=t-t%(h.magnitudefactor*h.minorSteps[h.minorStepIdx]);return t%(h.magnitudefactor*h.minorSteps[h.minorStepIdx])>.5*(h.magnitudefactor*h.minorSteps[h.minorStepIdx])?e+h.magnitudefactor*h.minorSteps[h.minorStepIdx]:e};i&&(this._start-=2*this.magnitudefactor*this.minorSteps[this.minorStepIdx],this._start=d(this._start)),o&&(this._end+=this.magnitudefactor*this.minorSteps[this.minorStepIdx],this._end=d(this._end)),this.determineScale()}}i.prototype.setCharHeight=function(t){this.majorCharHeight=t},i.prototype.setHeight=function(t){this.containerHeight=t},i.prototype.determineScale=function(){var t=this._end-this._start;this.scale=this.containerHeight/t;var e=this.majorCharHeight/this.scale,i=t>0?Math.round(Math.log(t)/Math.LN10):0;this.minorStepIdx=-1,this.magnitudefactor=Math.pow(10,i);var o=0;i<0&&(o=i);for(var n=!1,s=o;Math.abs(s)<=Math.abs(i);s++){this.magnitudefactor=Math.pow(10,s);for(var r=0;r=e){n=!0,this.minorStepIdx=r;break}}if(n===!0)break}},i.prototype.is_major=function(t){return t%(this.magnitudefactor*this.majorSteps[this.minorStepIdx])===0},i.prototype.getStep=function(){return this.magnitudefactor*this.minorSteps[this.minorStepIdx]},i.prototype.getFirstMajor=function(){var t=this.magnitudefactor*this.majorSteps[this.minorStepIdx];return this.convertValue(this._start+(t-this._start%t)%t)},i.prototype.formatValue=function(t){var e=t.toPrecision(5);return"function"==typeof this.formattingFunction&&(e=this.formattingFunction(t)),"number"==typeof e?""+e:"string"==typeof e?e:t.toPrecision(5)},i.prototype.getLines=function(){for(var t=[],e=this.getStep(),i=(e-this._start%e)%e,o=this._start+i;this._end-o>1e-5;o+=e)o!=this._start&&t.push({major:this.is_major(o),y:this.convertValue(o),val:this.formatValue(o)});return t},i.prototype.followScale=function(t){var e=this.minorStepIdx,i=this._start,o=this._end,n=this,s=function(){n.magnitudefactor*=2},r=function(){n.magnitudefactor/=2};t.minorStepIdx<=1&&this.minorStepIdx<=1||t.minorStepIdx>1&&this.minorStepIdx>1||(t.minorStepIdxo+1e-5)r(),d=!1;else{if(!this.autoScaleStart&&this._start=0)){r(),d=!1;continue}console.warn("Can't adhere to given 'min' range, due to zeroalign")}this.autoScaleStart&&this.autoScaleEnd&&ue.x?1:-1})):this.itemsData=[]},n.prototype.getItems=function(){return this.itemsData},n.prototype.setZeroPosition=function(t){this.zeroPosition=t},n.prototype.setOptions=function(t){if(void 0!==t){var e=["sampling","style","sort","yAxisOrientation","barChart","zIndex","excludeFromStacking","excludeFromLegend"];a.selectiveDeepExtend(e,this.options,t),"function"==typeof t.drawPoints&&(t.drawPoints={onRender:t.drawPoints}),a.mergeOptions(this.options,t,"interpolation"),a.mergeOptions(this.options,t,"drawPoints"),a.mergeOptions(this.options,t,"shaded"),t.interpolation&&"object"==(0,r.default)(t.interpolation)&&t.interpolation.parametrization&&("uniform"==t.interpolation.parametrization?this.options.interpolation.alpha=0:"chordal"==t.interpolation.parametrization?this.options.interpolation.alpha=1:(this.options.interpolation.parametrization="centripetal",this.options.interpolation.alpha=.5))}},n.prototype.update=function(t){this.group=t,this.content=t.content||"graph",this.className=t.className||this.className||"vis-graph-group"+this.groupsUsingDefaultStyles[0]%10,this.visible=void 0===t.visible||t.visible,this.style=t.style,this.setOptions(t.options)},n.prototype.getLegend=function(t,e,i,o,n){if(void 0==i||null==i){var s=document.createElementNS("http://www.w3.org/2000/svg","svg");i={svg:s,svgElements:{},options:this.options,groups:[this]}}switch(void 0!=o&&null!=o||(o=0),void 0!=n&&null!=n||(n=.5*e),this.options.style){case"line":d.drawIcon(this,o,n,t,e,i);break;case"points":case"point":l.drawIcon(this,o,n,t,e,i);break;case"bar":h.drawIcon(this,o,n,t,e,i)}return{icon:i.svg,label:this.content,orientation:this.options.yAxisOrientation}},n.prototype.getYRange=function(t){for(var e=t[0].y,i=t[0].y,o=0;ot[o].y?t[o].y:e,i=i0&&(i=Math.min(i,Math.abs(e[o-1].screen_x-e[o].screen_x))),0===i&&(void 0===t[e[o].screen_x]&&(t[e[o].screen_x]={amount:0,resolved:0,accumulatedPositive:0,accumulatedNegative:0}),t[e[o].screen_x].amount+=1)},o._getSafeDrawData=function(t,e,i){var o,n;return t0?(o=t0){t.sort(function(t,e){return t.screen_x===e.screen_x?t.groupIde[s].screen_y?e[s].screen_y:o,n=nt[r].accumulatedNegative?t[r].accumulatedNegative:o,o=o>t[r].accumulatedPositive?t[r].accumulatedPositive:o,n=n0){var i=[];return i=1==e.options.interpolation.enabled?o._catmullRom(t,e):o._linear(t)}},o.drawIcon=function(t,e,i,o,s,r){var a,h,d=.5*s,l=n.getSVGElement("rect",r.svgElements,r.svg);if(l.setAttributeNS(null,"x",e),l.setAttributeNS(null,"y",i-d),l.setAttributeNS(null,"width",o),l.setAttributeNS(null,"height",2*d),l.setAttributeNS(null,"class","vis-outline"),a=n.getSVGElement("path",r.svgElements,r.svg),a.setAttributeNS(null,"class",t.className),void 0!==t.style&&a.setAttributeNS(null,"style",t.style),a.setAttributeNS(null,"d","M"+e+","+i+" L"+(e+o)+","+i),1==t.options.shaded.enabled&&(h=n.getSVGElement("path",r.svgElements,r.svg),"top"==t.options.shaded.orientation?h.setAttributeNS(null,"d","M"+e+", "+(i-d)+"L"+e+","+i+" L"+(e+o)+","+i+" L"+(e+o)+","+(i-d)):h.setAttributeNS(null,"d","M"+e+","+i+" L"+e+","+(i+d)+" L"+(e+o)+","+(i+d)+"L"+(e+o)+","+i),h.setAttributeNS(null,"class",t.className+" vis-icon-fill"),void 0!==t.options.shaded.style&&""!==t.options.shaded.style&&h.setAttributeNS(null,"style",t.options.shaded.style)),1==t.options.drawPoints.enabled){var u={style:t.options.drawPoints.style,styles:t.options.drawPoints.styles,size:t.options.drawPoints.size,className:t.className};n.drawPoint(e+.5*o,i,u,r.svgElements,r.svg)}},o.drawShading=function(t,e,i,o){if(1==e.options.shaded.enabled){var s=Number(o.svg.style.height.replace("px","")),r=n.getSVGElement("path",o.svgElements,o.svg),a="L";1==e.options.interpolation.enabled&&(a="C");var h,d=0;d="top"==e.options.shaded.orientation?0:"bottom"==e.options.shaded.orientation?s:Math.min(Math.max(0,e.zeroPosition),s),h="group"==e.options.shaded.orientation&&null!=i&&void 0!=i?"M"+t[0][0]+","+t[0][1]+" "+this.serializePath(t,a,!1)+" L"+i[i.length-1][0]+","+i[i.length-1][1]+" "+this.serializePath(i,a,!0)+i[0][0]+","+i[0][1]+" Z":"M"+t[0][0]+","+t[0][1]+" "+this.serializePath(t,a,!1)+" V"+d+" H"+t[0][0]+" Z",r.setAttributeNS(null,"class",e.className+" vis-fill"),void 0!==e.options.shaded.style&&r.setAttributeNS(null,"style",e.options.shaded.style),r.setAttributeNS(null,"d",h)}},o.draw=function(t,e,i){if(null!=t&&void 0!=t){var o=n.getSVGElement("path",i.svgElements,i.svg);o.setAttributeNS(null,"class",e.className),void 0!==e.style&&o.setAttributeNS(null,"style",e.style);var s="L";1==e.options.interpolation.enabled&&(s="C"),o.setAttributeNS(null,"d","M"+t[0][0]+","+t[0][1]+" "+this.serializePath(t,s,!1))}},o.serializePath=function(t,e,i){if(t.length<2)return"";var o=e;if(i)for(var n=t.length-2;n>0;n--)o+=t[n][0]+","+t[n][1]+" ";else for(var n=1;n0&&(f=1/f),m=3*g*(g+v),m>0&&(m=1/m),a={screen_x:(-b*o.screen_x+p*n.screen_x+_*s.screen_x)*f,screen_y:(-b*o.screen_y+p*n.screen_y+_*s.screen_y)*f},h={screen_x:(y*n.screen_x+c*s.screen_x-b*r.screen_x)*m,screen_y:(y*n.screen_y+c*s.screen_y-b*r.screen_y)*m},0==a.screen_x&&0==a.screen_y&&(a=n),0==h.screen_x&&0==h.screen_y&&(h=s),x.push([a.screen_x,a.screen_y]),x.push([h.screen_x,h.screen_y]),x.push([s.screen_x,s.screen_y]);return x},o._linear=function(t){for(var e=[],i=0;i")}this.dom.textArea.innerHTML=s,this.dom.textArea.style.lineHeight=.75*this.options.iconSize+this.options.iconSpacing+"px"}},n.prototype.drawLegendIcons=function(){if(this.dom.frame.parentNode){var t=(0,r.default)(this.groups);t.sort(function(t,e){return t 4 && arguments[4] !== undefined ? arguments[4] : {}; if (options[option] === null) { - mergeTarget[option] = Object.create(globalOptions[option]); + mergeTarget[option] = (0, _create2['default'])(globalOptions[option]); } else { if (options[option] !== undefined) { if (typeof options[option] === 'boolean') { @@ -1532,4274 +1569,5819 @@ return /******/ (function(modules) { // webpackBootstrap return w1 - w2; }; + exports.topMost = function (pile, accessors) { + var candidate = void 0; + if (!Array.isArray(accessors)) { + accessors = [accessors]; + } + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = (0, _getIterator3['default'])(pile), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var member = _step.value; + + if (member) { + candidate = member[accessors[0]]; + for (var i = 1; i < accessors.length; i++) { + if (candidate) { + candidate = candidate[accessors[i]]; + } else { + continue; + } + } + if (typeof candidate != 'undefined') { + break; + } + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator['return']) { + _iterator['return'](); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return candidate; + }; + /***/ }, /* 2 */ /***/ function(module, exports, __webpack_require__) { - 'use strict'; - - // first check if moment.js is already loaded in the browser window, if so, - // use this instance. Else, load via commonjs. - module.exports = typeof window !== 'undefined' && window['moment'] || __webpack_require__(3); + module.exports = { "default": __webpack_require__(3), __esModule: true }; /***/ }, /* 3 */ /***/ function(module, exports, __webpack_require__) { - /* WEBPACK VAR INJECTION */(function(module) {//! moment.js - //! version : 2.15.2 - //! authors : Tim Wood, Iskren Chernev, Moment.js contributors - //! license : MIT - //! momentjs.com + __webpack_require__(4); + __webpack_require__(50); + module.exports = __webpack_require__(52); - ;(function (global, factory) { - true ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - global.moment = factory() - }(this, function () { 'use strict'; +/***/ }, +/* 4 */ +/***/ function(module, exports, __webpack_require__) { - var hookCallback; + __webpack_require__(5); + var global = __webpack_require__(16) + , hide = __webpack_require__(20) + , Iterators = __webpack_require__(8) + , TO_STRING_TAG = __webpack_require__(47)('toStringTag'); + + for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++){ + var NAME = collections[i] + , Collection = global[NAME] + , proto = Collection && Collection.prototype; + if(proto && !proto[TO_STRING_TAG])hide(proto, TO_STRING_TAG, NAME); + Iterators[NAME] = Iterators.Array; + } - function utils_hooks__hooks () { - return hookCallback.apply(null, arguments); - } +/***/ }, +/* 5 */ +/***/ function(module, exports, __webpack_require__) { - // This is done to register the method called with moment() - // without creating circular dependencies. - function setHookCallback (callback) { - hookCallback = callback; - } + 'use strict'; + var addToUnscopables = __webpack_require__(6) + , step = __webpack_require__(7) + , Iterators = __webpack_require__(8) + , toIObject = __webpack_require__(9); + + // 22.1.3.4 Array.prototype.entries() + // 22.1.3.13 Array.prototype.keys() + // 22.1.3.29 Array.prototype.values() + // 22.1.3.30 Array.prototype[@@iterator]() + module.exports = __webpack_require__(13)(Array, 'Array', function(iterated, kind){ + this._t = toIObject(iterated); // target + this._i = 0; // next index + this._k = kind; // kind + // 22.1.5.2.1 %ArrayIteratorPrototype%.next() + }, function(){ + var O = this._t + , kind = this._k + , index = this._i++; + if(!O || index >= O.length){ + this._t = undefined; + return step(1); + } + if(kind == 'keys' )return step(0, index); + if(kind == 'values')return step(0, O[index]); + return step(0, [index, O[index]]); + }, 'values'); + + // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) + Iterators.Arguments = Iterators.Array; + + addToUnscopables('keys'); + addToUnscopables('values'); + addToUnscopables('entries'); - function isArray(input) { - return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]'; - } +/***/ }, +/* 6 */ +/***/ function(module, exports) { - function isObject(input) { - // IE8 will treat undefined and null as object if it wasn't for - // input != null - return input != null && Object.prototype.toString.call(input) === '[object Object]'; - } + module.exports = function(){ /* empty */ }; - function isObjectEmpty(obj) { - var k; - for (k in obj) { - // even if its not own property I'd still call it non-empty - return false; - } - return true; - } +/***/ }, +/* 7 */ +/***/ function(module, exports) { - function isDate(input) { - return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]'; - } + module.exports = function(done, value){ + return {value: value, done: !!done}; + }; - function map(arr, fn) { - var res = [], i; - for (i = 0; i < arr.length; ++i) { - res.push(fn(arr[i], i)); - } - return res; - } +/***/ }, +/* 8 */ +/***/ function(module, exports) { - function hasOwnProp(a, b) { - return Object.prototype.hasOwnProperty.call(a, b); - } + module.exports = {}; - function extend(a, b) { - for (var i in b) { - if (hasOwnProp(b, i)) { - a[i] = b[i]; - } - } +/***/ }, +/* 9 */ +/***/ function(module, exports, __webpack_require__) { - if (hasOwnProp(b, 'toString')) { - a.toString = b.toString; - } + // to indexed object, toObject with fallback for non-array-like ES3 strings + var IObject = __webpack_require__(10) + , defined = __webpack_require__(12); + module.exports = function(it){ + return IObject(defined(it)); + }; - if (hasOwnProp(b, 'valueOf')) { - a.valueOf = b.valueOf; - } +/***/ }, +/* 10 */ +/***/ function(module, exports, __webpack_require__) { - return a; - } + // fallback for non-array-like ES3 and non-enumerable old V8 strings + var cof = __webpack_require__(11); + module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){ + return cof(it) == 'String' ? it.split('') : Object(it); + }; - function create_utc__createUTC (input, format, locale, strict) { - return createLocalOrUTC(input, format, locale, strict, true).utc(); - } +/***/ }, +/* 11 */ +/***/ function(module, exports) { - function defaultParsingFlags() { - // We need to deep clone this object. - return { - empty : false, - unusedTokens : [], - unusedInput : [], - overflow : -2, - charsLeftOver : 0, - nullInput : false, - invalidMonth : null, - invalidFormat : false, - userInvalidated : false, - iso : false, - parsedDateParts : [], - meridiem : null - }; - } + var toString = {}.toString; - function getParsingFlags(m) { - if (m._pf == null) { - m._pf = defaultParsingFlags(); - } - return m._pf; - } + module.exports = function(it){ + return toString.call(it).slice(8, -1); + }; - var some; - if (Array.prototype.some) { - some = Array.prototype.some; - } else { - some = function (fun) { - var t = Object(this); - var len = t.length >>> 0; +/***/ }, +/* 12 */ +/***/ function(module, exports) { - for (var i = 0; i < len; i++) { - if (i in t && fun.call(this, t[i], i, t)) { - return true; - } - } + // 7.2.1 RequireObjectCoercible(argument) + module.exports = function(it){ + if(it == undefined)throw TypeError("Can't call method on " + it); + return it; + }; - return false; - }; - } +/***/ }, +/* 13 */ +/***/ function(module, exports, __webpack_require__) { - function valid__isValid(m) { - if (m._isValid == null) { - var flags = getParsingFlags(m); - var parsedParts = some.call(flags.parsedDateParts, function (i) { - return i != null; - }); - var isNowValid = !isNaN(m._d.getTime()) && - flags.overflow < 0 && - !flags.empty && - !flags.invalidMonth && - !flags.invalidWeekday && - !flags.nullInput && - !flags.invalidFormat && - !flags.userInvalidated && - (!flags.meridiem || (flags.meridiem && parsedParts)); - - if (m._strict) { - isNowValid = isNowValid && - flags.charsLeftOver === 0 && - flags.unusedTokens.length === 0 && - flags.bigHour === undefined; - } + 'use strict'; + var LIBRARY = __webpack_require__(14) + , $export = __webpack_require__(15) + , redefine = __webpack_require__(30) + , hide = __webpack_require__(20) + , has = __webpack_require__(31) + , Iterators = __webpack_require__(8) + , $iterCreate = __webpack_require__(32) + , setToStringTag = __webpack_require__(46) + , getPrototypeOf = __webpack_require__(48) + , ITERATOR = __webpack_require__(47)('iterator') + , BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next` + , FF_ITERATOR = '@@iterator' + , KEYS = 'keys' + , VALUES = 'values'; + + var returnThis = function(){ return this; }; + + module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){ + $iterCreate(Constructor, NAME, next); + var getMethod = function(kind){ + if(!BUGGY && kind in proto)return proto[kind]; + switch(kind){ + case KEYS: return function keys(){ return new Constructor(this, kind); }; + case VALUES: return function values(){ return new Constructor(this, kind); }; + } return function entries(){ return new Constructor(this, kind); }; + }; + var TAG = NAME + ' Iterator' + , DEF_VALUES = DEFAULT == VALUES + , VALUES_BUG = false + , proto = Base.prototype + , $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT] + , $default = $native || getMethod(DEFAULT) + , $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined + , $anyNative = NAME == 'Array' ? proto.entries || $native : $native + , methods, key, IteratorPrototype; + // Fix native + if($anyNative){ + IteratorPrototype = getPrototypeOf($anyNative.call(new Base)); + if(IteratorPrototype !== Object.prototype){ + // Set @@toStringTag to native iterators + setToStringTag(IteratorPrototype, TAG, true); + // fix for some old engines + if(!LIBRARY && !has(IteratorPrototype, ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis); + } + } + // fix Array#{values, @@iterator}.name in V8 / FF + if(DEF_VALUES && $native && $native.name !== VALUES){ + VALUES_BUG = true; + $default = function values(){ return $native.call(this); }; + } + // Define iterator + if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){ + hide(proto, ITERATOR, $default); + } + // Plug for library + Iterators[NAME] = $default; + Iterators[TAG] = returnThis; + if(DEFAULT){ + methods = { + values: DEF_VALUES ? $default : getMethod(VALUES), + keys: IS_SET ? $default : getMethod(KEYS), + entries: $entries + }; + if(FORCED)for(key in methods){ + if(!(key in proto))redefine(proto, key, methods[key]); + } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); + } + return methods; + }; - if (Object.isFrozen == null || !Object.isFrozen(m)) { - m._isValid = isNowValid; - } - else { - return isNowValid; - } - } - return m._isValid; - } +/***/ }, +/* 14 */ +/***/ function(module, exports) { - function valid__createInvalid (flags) { - var m = create_utc__createUTC(NaN); - if (flags != null) { - extend(getParsingFlags(m), flags); - } - else { - getParsingFlags(m).userInvalidated = true; - } + module.exports = true; - return m; - } +/***/ }, +/* 15 */ +/***/ function(module, exports, __webpack_require__) { - function isUndefined(input) { - return input === void 0; - } + var global = __webpack_require__(16) + , core = __webpack_require__(17) + , ctx = __webpack_require__(18) + , hide = __webpack_require__(20) + , PROTOTYPE = 'prototype'; + + var $export = function(type, name, source){ + var IS_FORCED = type & $export.F + , IS_GLOBAL = type & $export.G + , IS_STATIC = type & $export.S + , IS_PROTO = type & $export.P + , IS_BIND = type & $export.B + , IS_WRAP = type & $export.W + , exports = IS_GLOBAL ? core : core[name] || (core[name] = {}) + , expProto = exports[PROTOTYPE] + , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE] + , key, own, out; + if(IS_GLOBAL)source = name; + for(key in source){ + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + if(own && key in exports)continue; + // export native or passed + out = own ? target[key] : source[key]; + // prevent global pollution for namespaces + exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] + // bind timers to global for call from export context + : IS_BIND && own ? ctx(out, global) + // wrap global constructors for prevent change them in library + : IS_WRAP && target[key] == out ? (function(C){ + var F = function(a, b, c){ + if(this instanceof C){ + switch(arguments.length){ + case 0: return new C; + case 1: return new C(a); + case 2: return new C(a, b); + } return new C(a, b, c); + } return C.apply(this, arguments); + }; + F[PROTOTYPE] = C[PROTOTYPE]; + return F; + // make static versions for prototype methods + })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; + // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% + if(IS_PROTO){ + (exports.virtual || (exports.virtual = {}))[key] = out; + // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% + if(type & $export.R && expProto && !expProto[key])hide(expProto, key, out); + } + } + }; + // type bitmap + $export.F = 1; // forced + $export.G = 2; // global + $export.S = 4; // static + $export.P = 8; // proto + $export.B = 16; // bind + $export.W = 32; // wrap + $export.U = 64; // safe + $export.R = 128; // real proto method for `library` + module.exports = $export; - // Plugins that add properties should also add the key here (null value), - // so we can properly clone ourselves. - var momentProperties = utils_hooks__hooks.momentProperties = []; +/***/ }, +/* 16 */ +/***/ function(module, exports) { - function copyConfig(to, from) { - var i, prop, val; + // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 + var global = module.exports = typeof window != 'undefined' && window.Math == Math + ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); + if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef - if (!isUndefined(from._isAMomentObject)) { - to._isAMomentObject = from._isAMomentObject; - } - if (!isUndefined(from._i)) { - to._i = from._i; - } - if (!isUndefined(from._f)) { - to._f = from._f; - } - if (!isUndefined(from._l)) { - to._l = from._l; - } - if (!isUndefined(from._strict)) { - to._strict = from._strict; - } - if (!isUndefined(from._tzm)) { - to._tzm = from._tzm; - } - if (!isUndefined(from._isUTC)) { - to._isUTC = from._isUTC; - } - if (!isUndefined(from._offset)) { - to._offset = from._offset; - } - if (!isUndefined(from._pf)) { - to._pf = getParsingFlags(from); - } - if (!isUndefined(from._locale)) { - to._locale = from._locale; - } +/***/ }, +/* 17 */ +/***/ function(module, exports) { - if (momentProperties.length > 0) { - for (i in momentProperties) { - prop = momentProperties[i]; - val = from[prop]; - if (!isUndefined(val)) { - to[prop] = val; - } - } - } + var core = module.exports = {version: '2.4.0'}; + if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef - return to; - } +/***/ }, +/* 18 */ +/***/ function(module, exports, __webpack_require__) { - var updateInProgress = false; + // optional / simple context binding + var aFunction = __webpack_require__(19); + module.exports = function(fn, that, length){ + aFunction(fn); + if(that === undefined)return fn; + switch(length){ + case 1: return function(a){ + return fn.call(that, a); + }; + case 2: return function(a, b){ + return fn.call(that, a, b); + }; + case 3: return function(a, b, c){ + return fn.call(that, a, b, c); + }; + } + return function(/* ...args */){ + return fn.apply(that, arguments); + }; + }; - // Moment prototype object - function Moment(config) { - copyConfig(this, config); - this._d = new Date(config._d != null ? config._d.getTime() : NaN); - // Prevent infinite loop in case updateOffset creates new moment - // objects. - if (updateInProgress === false) { - updateInProgress = true; - utils_hooks__hooks.updateOffset(this); - updateInProgress = false; - } - } +/***/ }, +/* 19 */ +/***/ function(module, exports) { - function isMoment (obj) { - return obj instanceof Moment || (obj != null && obj._isAMomentObject != null); - } + module.exports = function(it){ + if(typeof it != 'function')throw TypeError(it + ' is not a function!'); + return it; + }; - function absFloor (number) { - if (number < 0) { - // -0 -> 0 - return Math.ceil(number) || 0; - } else { - return Math.floor(number); - } - } +/***/ }, +/* 20 */ +/***/ function(module, exports, __webpack_require__) { - function toInt(argumentForCoercion) { - var coercedNumber = +argumentForCoercion, - value = 0; + var dP = __webpack_require__(21) + , createDesc = __webpack_require__(29); + module.exports = __webpack_require__(25) ? function(object, key, value){ + return dP.f(object, key, createDesc(1, value)); + } : function(object, key, value){ + object[key] = value; + return object; + }; - if (coercedNumber !== 0 && isFinite(coercedNumber)) { - value = absFloor(coercedNumber); - } +/***/ }, +/* 21 */ +/***/ function(module, exports, __webpack_require__) { - return value; - } + var anObject = __webpack_require__(22) + , IE8_DOM_DEFINE = __webpack_require__(24) + , toPrimitive = __webpack_require__(28) + , dP = Object.defineProperty; - // compare two arrays, return the number of differences - function compareArrays(array1, array2, dontConvert) { - var len = Math.min(array1.length, array2.length), - lengthDiff = Math.abs(array1.length - array2.length), - diffs = 0, - i; - for (i = 0; i < len; i++) { - if ((dontConvert && array1[i] !== array2[i]) || - (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) { - diffs++; - } - } - return diffs + lengthDiff; - } + exports.f = __webpack_require__(25) ? Object.defineProperty : function defineProperty(O, P, Attributes){ + anObject(O); + P = toPrimitive(P, true); + anObject(Attributes); + if(IE8_DOM_DEFINE)try { + return dP(O, P, Attributes); + } catch(e){ /* empty */ } + if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!'); + if('value' in Attributes)O[P] = Attributes.value; + return O; + }; - function warn(msg) { - if (utils_hooks__hooks.suppressDeprecationWarnings === false && - (typeof console !== 'undefined') && console.warn) { - console.warn('Deprecation warning: ' + msg); - } - } +/***/ }, +/* 22 */ +/***/ function(module, exports, __webpack_require__) { - function deprecate(msg, fn) { - var firstTime = true; + var isObject = __webpack_require__(23); + module.exports = function(it){ + if(!isObject(it))throw TypeError(it + ' is not an object!'); + return it; + }; - return extend(function () { - if (utils_hooks__hooks.deprecationHandler != null) { - utils_hooks__hooks.deprecationHandler(null, msg); - } - if (firstTime) { - var args = []; - var arg; - for (var i = 0; i < arguments.length; i++) { - arg = ''; - if (typeof arguments[i] === 'object') { - arg += '\n[' + i + '] '; - for (var key in arguments[0]) { - arg += key + ': ' + arguments[0][key] + ', '; - } - arg = arg.slice(0, -2); // Remove trailing comma and space - } else { - arg = arguments[i]; - } - args.push(arg); - } - warn(msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + (new Error()).stack); - firstTime = false; - } - return fn.apply(this, arguments); - }, fn); - } +/***/ }, +/* 23 */ +/***/ function(module, exports) { - var deprecations = {}; + module.exports = function(it){ + return typeof it === 'object' ? it !== null : typeof it === 'function'; + }; - function deprecateSimple(name, msg) { - if (utils_hooks__hooks.deprecationHandler != null) { - utils_hooks__hooks.deprecationHandler(name, msg); - } - if (!deprecations[name]) { - warn(msg); - deprecations[name] = true; - } - } +/***/ }, +/* 24 */ +/***/ function(module, exports, __webpack_require__) { - utils_hooks__hooks.suppressDeprecationWarnings = false; - utils_hooks__hooks.deprecationHandler = null; + module.exports = !__webpack_require__(25) && !__webpack_require__(26)(function(){ + return Object.defineProperty(__webpack_require__(27)('div'), 'a', {get: function(){ return 7; }}).a != 7; + }); - function isFunction(input) { - return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]'; - } +/***/ }, +/* 25 */ +/***/ function(module, exports, __webpack_require__) { - function locale_set__set (config) { - var prop, i; - for (i in config) { - prop = config[i]; - if (isFunction(prop)) { - this[i] = prop; - } else { - this['_' + i] = prop; - } - } - this._config = config; - // Lenient ordinal parsing accepts just a number in addition to - // number + (possibly) stuff coming from _ordinalParseLenient. - this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + (/\d{1,2}/).source); - } - - function mergeConfigs(parentConfig, childConfig) { - var res = extend({}, parentConfig), prop; - for (prop in childConfig) { - if (hasOwnProp(childConfig, prop)) { - if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) { - res[prop] = {}; - extend(res[prop], parentConfig[prop]); - extend(res[prop], childConfig[prop]); - } else if (childConfig[prop] != null) { - res[prop] = childConfig[prop]; - } else { - delete res[prop]; - } - } - } - for (prop in parentConfig) { - if (hasOwnProp(parentConfig, prop) && - !hasOwnProp(childConfig, prop) && - isObject(parentConfig[prop])) { - // make sure changes to properties don't modify parent config - res[prop] = extend({}, res[prop]); - } - } - return res; - } + // Thank's IE8 for his funny defineProperty + module.exports = !__webpack_require__(26)(function(){ + return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7; + }); - function Locale(config) { - if (config != null) { - this.set(config); - } - } +/***/ }, +/* 26 */ +/***/ function(module, exports) { - var keys; + module.exports = function(exec){ + try { + return !!exec(); + } catch(e){ + return true; + } + }; - if (Object.keys) { - keys = Object.keys; - } else { - keys = function (obj) { - var i, res = []; - for (i in obj) { - if (hasOwnProp(obj, i)) { - res.push(i); - } - } - return res; - }; - } +/***/ }, +/* 27 */ +/***/ function(module, exports, __webpack_require__) { - var defaultCalendar = { - sameDay : '[Today at] LT', - nextDay : '[Tomorrow at] LT', - nextWeek : 'dddd [at] LT', - lastDay : '[Yesterday at] LT', - lastWeek : '[Last] dddd [at] LT', - sameElse : 'L' - }; + var isObject = __webpack_require__(23) + , document = __webpack_require__(16).document + // in old IE typeof document.createElement is 'object' + , is = isObject(document) && isObject(document.createElement); + module.exports = function(it){ + return is ? document.createElement(it) : {}; + }; - function locale_calendar__calendar (key, mom, now) { - var output = this._calendar[key] || this._calendar['sameElse']; - return isFunction(output) ? output.call(mom, now) : output; - } +/***/ }, +/* 28 */ +/***/ function(module, exports, __webpack_require__) { - var defaultLongDateFormat = { - 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' - }; + // 7.1.1 ToPrimitive(input [, PreferredType]) + var isObject = __webpack_require__(23); + // instead of the ES6 spec version, we didn't implement @@toPrimitive case + // and the second argument - flag - preferred type is a string + module.exports = function(it, S){ + if(!isObject(it))return it; + var fn, val; + if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; + if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val; + if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; + throw TypeError("Can't convert object to primitive value"); + }; - function longDateFormat (key) { - var format = this._longDateFormat[key], - formatUpper = this._longDateFormat[key.toUpperCase()]; +/***/ }, +/* 29 */ +/***/ function(module, exports) { - if (format || !formatUpper) { - return format; - } + module.exports = function(bitmap, value){ + return { + enumerable : !(bitmap & 1), + configurable: !(bitmap & 2), + writable : !(bitmap & 4), + value : value + }; + }; - this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) { - return val.slice(1); - }); +/***/ }, +/* 30 */ +/***/ function(module, exports, __webpack_require__) { - return this._longDateFormat[key]; - } + module.exports = __webpack_require__(20); - var defaultInvalidDate = 'Invalid date'; +/***/ }, +/* 31 */ +/***/ function(module, exports) { - function invalidDate () { - return this._invalidDate; - } + var hasOwnProperty = {}.hasOwnProperty; + module.exports = function(it, key){ + return hasOwnProperty.call(it, key); + }; - var defaultOrdinal = '%d'; - var defaultOrdinalParse = /\d{1,2}/; +/***/ }, +/* 32 */ +/***/ function(module, exports, __webpack_require__) { - function ordinal (number) { - return this._ordinal.replace('%d', number); - } + 'use strict'; + var create = __webpack_require__(33) + , descriptor = __webpack_require__(29) + , setToStringTag = __webpack_require__(46) + , IteratorPrototype = {}; - var defaultRelativeTime = { - future : 'in %s', - past : '%s ago', - s : 'a few seconds', - m : 'a minute', - mm : '%d minutes', - h : 'an hour', - hh : '%d hours', - d : 'a day', - dd : '%d days', - M : 'a month', - MM : '%d months', - y : 'a year', - yy : '%d years' - }; + // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() + __webpack_require__(20)(IteratorPrototype, __webpack_require__(47)('iterator'), function(){ return this; }); - function relative__relativeTime (number, withoutSuffix, string, isFuture) { - var output = this._relativeTime[string]; - return (isFunction(output)) ? - output(number, withoutSuffix, string, isFuture) : - output.replace(/%d/i, number); - } + module.exports = function(Constructor, NAME, next){ + Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)}); + setToStringTag(Constructor, NAME + ' Iterator'); + }; - function pastFuture (diff, output) { - var format = this._relativeTime[diff > 0 ? 'future' : 'past']; - return isFunction(format) ? format(output) : format.replace(/%s/i, output); - } +/***/ }, +/* 33 */ +/***/ function(module, exports, __webpack_require__) { - var aliases = {}; + // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) + var anObject = __webpack_require__(22) + , dPs = __webpack_require__(34) + , enumBugKeys = __webpack_require__(44) + , IE_PROTO = __webpack_require__(41)('IE_PROTO') + , Empty = function(){ /* empty */ } + , PROTOTYPE = 'prototype'; + + // Create object with fake `null` prototype: use iframe Object with cleared prototype + var createDict = function(){ + // Thrash, waste and sodomy: IE GC bug + var iframe = __webpack_require__(27)('iframe') + , i = enumBugKeys.length + , lt = '<' + , gt = '>' + , iframeDocument; + iframe.style.display = 'none'; + __webpack_require__(45).appendChild(iframe); + iframe.src = 'javascript:'; // eslint-disable-line no-script-url + // createDict = iframe.contentWindow.Object; + // html.removeChild(iframe); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); + iframeDocument.close(); + createDict = iframeDocument.F; + while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]]; + return createDict(); + }; + + module.exports = Object.create || function create(O, Properties){ + var result; + if(O !== null){ + Empty[PROTOTYPE] = anObject(O); + result = new Empty; + Empty[PROTOTYPE] = null; + // add "__proto__" for Object.getPrototypeOf polyfill + result[IE_PROTO] = O; + } else result = createDict(); + return Properties === undefined ? result : dPs(result, Properties); + }; - function addUnitAlias (unit, shorthand) { - var lowerCase = unit.toLowerCase(); - aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit; - } - function normalizeUnits(units) { - return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined; - } +/***/ }, +/* 34 */ +/***/ function(module, exports, __webpack_require__) { - function normalizeObjectUnits(inputObject) { - var normalizedInput = {}, - normalizedProp, - prop; + var dP = __webpack_require__(21) + , anObject = __webpack_require__(22) + , getKeys = __webpack_require__(35); - for (prop in inputObject) { - if (hasOwnProp(inputObject, prop)) { - normalizedProp = normalizeUnits(prop); - if (normalizedProp) { - normalizedInput[normalizedProp] = inputObject[prop]; - } - } - } + module.exports = __webpack_require__(25) ? Object.defineProperties : function defineProperties(O, Properties){ + anObject(O); + var keys = getKeys(Properties) + , length = keys.length + , i = 0 + , P; + while(length > i)dP.f(O, P = keys[i++], Properties[P]); + return O; + }; - return normalizedInput; - } +/***/ }, +/* 35 */ +/***/ function(module, exports, __webpack_require__) { - var priorities = {}; + // 19.1.2.14 / 15.2.3.14 Object.keys(O) + var $keys = __webpack_require__(36) + , enumBugKeys = __webpack_require__(44); - function addUnitPriority(unit, priority) { - priorities[unit] = priority; - } + module.exports = Object.keys || function keys(O){ + return $keys(O, enumBugKeys); + }; - function getPrioritizedUnits(unitsObj) { - var units = []; - for (var u in unitsObj) { - units.push({unit: u, priority: priorities[u]}); - } - units.sort(function (a, b) { - return a.priority - b.priority; - }); - return units; - } +/***/ }, +/* 36 */ +/***/ function(module, exports, __webpack_require__) { - function makeGetSet (unit, keepTime) { - return function (value) { - if (value != null) { - get_set__set(this, unit, value); - utils_hooks__hooks.updateOffset(this, keepTime); - return this; - } else { - return get_set__get(this, unit); - } - }; - } + var has = __webpack_require__(31) + , toIObject = __webpack_require__(9) + , arrayIndexOf = __webpack_require__(37)(false) + , IE_PROTO = __webpack_require__(41)('IE_PROTO'); - function get_set__get (mom, unit) { - return mom.isValid() ? - mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN; - } + module.exports = function(object, names){ + var O = toIObject(object) + , i = 0 + , result = [] + , key; + for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key); + // Don't enum bug & hidden keys + while(names.length > i)if(has(O, key = names[i++])){ + ~arrayIndexOf(result, key) || result.push(key); + } + return result; + }; - function get_set__set (mom, unit, value) { - if (mom.isValid()) { - mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); - } - } +/***/ }, +/* 37 */ +/***/ function(module, exports, __webpack_require__) { - // MOMENTS + // false -> Array#indexOf + // true -> Array#includes + var toIObject = __webpack_require__(9) + , toLength = __webpack_require__(38) + , toIndex = __webpack_require__(40); + module.exports = function(IS_INCLUDES){ + return function($this, el, fromIndex){ + var O = toIObject($this) + , length = toLength(O.length) + , index = toIndex(fromIndex, length) + , value; + // Array#includes uses SameValueZero equality algorithm + if(IS_INCLUDES && el != el)while(length > index){ + value = O[index++]; + if(value != value)return true; + // Array#toIndex ignores holes, Array#includes - not + } else for(;length > index; index++)if(IS_INCLUDES || index in O){ + if(O[index] === el)return IS_INCLUDES || index || 0; + } return !IS_INCLUDES && -1; + }; + }; - function stringGet (units) { - units = normalizeUnits(units); - if (isFunction(this[units])) { - return this[units](); - } - return this; - } +/***/ }, +/* 38 */ +/***/ function(module, exports, __webpack_require__) { + // 7.1.15 ToLength + var toInteger = __webpack_require__(39) + , min = Math.min; + module.exports = function(it){ + return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 + }; - function stringSet (units, value) { - if (typeof units === 'object') { - units = normalizeObjectUnits(units); - var prioritized = getPrioritizedUnits(units); - for (var i = 0; i < prioritized.length; i++) { - this[prioritized[i].unit](units[prioritized[i].unit]); - } - } else { - units = normalizeUnits(units); - if (isFunction(this[units])) { - return this[units](value); - } - } - return this; - } +/***/ }, +/* 39 */ +/***/ function(module, exports) { - function zeroFill(number, targetLength, forceSign) { - var absNumber = '' + Math.abs(number), - zerosToFill = targetLength - absNumber.length, - sign = number >= 0; - return (sign ? (forceSign ? '+' : '') : '-') + - Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber; - } + // 7.1.4 ToInteger + var ceil = Math.ceil + , floor = Math.floor; + module.exports = function(it){ + return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); + }; - var formattingTokens = /(\[[^\[]*\])|(\\)?([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; +/***/ }, +/* 40 */ +/***/ function(module, exports, __webpack_require__) { - var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g; + var toInteger = __webpack_require__(39) + , max = Math.max + , min = Math.min; + module.exports = function(index, length){ + index = toInteger(index); + return index < 0 ? max(index + length, 0) : min(index, length); + }; - var formatFunctions = {}; +/***/ }, +/* 41 */ +/***/ function(module, exports, __webpack_require__) { - var formatTokenFunctions = {}; + var shared = __webpack_require__(42)('keys') + , uid = __webpack_require__(43); + module.exports = function(key){ + return shared[key] || (shared[key] = uid(key)); + }; - // token: 'M' - // padded: ['MM', 2] - // ordinal: 'Mo' - // callback: function () { this.month() + 1 } - function addFormatToken (token, padded, ordinal, callback) { - var func = callback; - if (typeof callback === 'string') { - func = function () { - return this[callback](); - }; - } - if (token) { - formatTokenFunctions[token] = func; - } - if (padded) { - formatTokenFunctions[padded[0]] = function () { - return zeroFill(func.apply(this, arguments), padded[1], padded[2]); - }; - } - if (ordinal) { - formatTokenFunctions[ordinal] = function () { - return this.localeData().ordinal(func.apply(this, arguments), token); - }; - } - } +/***/ }, +/* 42 */ +/***/ function(module, exports, __webpack_require__) { - function removeFormattingTokens(input) { - if (input.match(/\[[\s\S]/)) { - return input.replace(/^\[|\]$/g, ''); - } - return input.replace(/\\/g, ''); - } + var global = __webpack_require__(16) + , SHARED = '__core-js_shared__' + , store = global[SHARED] || (global[SHARED] = {}); + module.exports = function(key){ + return store[key] || (store[key] = {}); + }; - function makeFormatFunction(format) { - var array = format.match(formattingTokens), i, length; +/***/ }, +/* 43 */ +/***/ function(module, exports) { - for (i = 0, length = array.length; i < length; i++) { - if (formatTokenFunctions[array[i]]) { - array[i] = formatTokenFunctions[array[i]]; - } else { - array[i] = removeFormattingTokens(array[i]); - } - } + var id = 0 + , px = Math.random(); + module.exports = function(key){ + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); + }; - return function (mom) { - var output = '', i; - for (i = 0; i < length; i++) { - output += array[i] instanceof Function ? array[i].call(mom, format) : array[i]; - } - return output; - }; - } +/***/ }, +/* 44 */ +/***/ function(module, exports) { - // format date using native date object - function formatMoment(m, format) { - if (!m.isValid()) { - return m.localeData().invalidDate(); - } + // IE 8- don't enum bug keys + module.exports = ( + 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' + ).split(','); - format = expandFormat(format, m.localeData()); - formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format); +/***/ }, +/* 45 */ +/***/ function(module, exports, __webpack_require__) { - return formatFunctions[format](m); - } + module.exports = __webpack_require__(16).document && document.documentElement; - function expandFormat(format, locale) { - var i = 5; +/***/ }, +/* 46 */ +/***/ function(module, exports, __webpack_require__) { - function replaceLongDateFormatTokens(input) { - return locale.longDateFormat(input) || input; - } + var def = __webpack_require__(21).f + , has = __webpack_require__(31) + , TAG = __webpack_require__(47)('toStringTag'); - localFormattingTokens.lastIndex = 0; - while (i >= 0 && localFormattingTokens.test(format)) { - format = format.replace(localFormattingTokens, replaceLongDateFormatTokens); - localFormattingTokens.lastIndex = 0; - i -= 1; - } + module.exports = function(it, tag, stat){ + if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag}); + }; - return format; - } +/***/ }, +/* 47 */ +/***/ function(module, exports, __webpack_require__) { - var match1 = /\d/; // 0 - 9 - var match2 = /\d\d/; // 00 - 99 - var match3 = /\d{3}/; // 000 - 999 - var match4 = /\d{4}/; // 0000 - 9999 - var match6 = /[+-]?\d{6}/; // -999999 - 999999 - var match1to2 = /\d\d?/; // 0 - 99 - var match3to4 = /\d\d\d\d?/; // 999 - 9999 - var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999 - var match1to3 = /\d{1,3}/; // 0 - 999 - var match1to4 = /\d{1,4}/; // 0 - 9999 - var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999 + var store = __webpack_require__(42)('wks') + , uid = __webpack_require__(43) + , Symbol = __webpack_require__(16).Symbol + , USE_SYMBOL = typeof Symbol == 'function'; - var matchUnsigned = /\d+/; // 0 - inf - var matchSigned = /[+-]?\d+/; // -inf - inf + var $exports = module.exports = function(name){ + return store[name] || (store[name] = + USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); + }; - var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z - var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z + $exports.store = store; - var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123 +/***/ }, +/* 48 */ +/***/ function(module, exports, __webpack_require__) { - // any word (or two) characters or numbers including two/three word month in arabic. - // includes scottish gaelic two word and hyphenated months - var matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i; + // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) + var has = __webpack_require__(31) + , toObject = __webpack_require__(49) + , IE_PROTO = __webpack_require__(41)('IE_PROTO') + , ObjectProto = Object.prototype; + module.exports = Object.getPrototypeOf || function(O){ + O = toObject(O); + if(has(O, IE_PROTO))return O[IE_PROTO]; + if(typeof O.constructor == 'function' && O instanceof O.constructor){ + return O.constructor.prototype; + } return O instanceof Object ? ObjectProto : null; + }; - var regexes = {}; +/***/ }, +/* 49 */ +/***/ function(module, exports, __webpack_require__) { - function addRegexToken (token, regex, strictRegex) { - regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) { - return (isStrict && strictRegex) ? strictRegex : regex; - }; - } + // 7.1.13 ToObject(argument) + var defined = __webpack_require__(12); + module.exports = function(it){ + return Object(defined(it)); + }; - function getParseRegexForToken (token, config) { - if (!hasOwnProp(regexes, token)) { - return new RegExp(unescapeFormat(token)); - } +/***/ }, +/* 50 */ +/***/ function(module, exports, __webpack_require__) { - return regexes[token](config._strict, config._locale); - } + 'use strict'; + var $at = __webpack_require__(51)(true); + + // 21.1.3.27 String.prototype[@@iterator]() + __webpack_require__(13)(String, 'String', function(iterated){ + this._t = String(iterated); // target + this._i = 0; // next index + // 21.1.5.2.1 %StringIteratorPrototype%.next() + }, function(){ + var O = this._t + , index = this._i + , point; + if(index >= O.length)return {value: undefined, done: true}; + point = $at(O, index); + this._i += point.length; + return {value: point, done: false}; + }); - // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript - function unescapeFormat(s) { - return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { - return p1 || p2 || p3 || p4; - })); - } +/***/ }, +/* 51 */ +/***/ function(module, exports, __webpack_require__) { - function regexEscape(s) { - return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); - } + var toInteger = __webpack_require__(39) + , defined = __webpack_require__(12); + // true -> String#at + // false -> String#codePointAt + module.exports = function(TO_STRING){ + return function(that, pos){ + var s = String(defined(that)) + , i = toInteger(pos) + , l = s.length + , a, b; + if(i < 0 || i >= l)return TO_STRING ? '' : undefined; + a = s.charCodeAt(i); + return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff + ? TO_STRING ? s.charAt(i) : a + : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; + }; + }; - var tokens = {}; +/***/ }, +/* 52 */ +/***/ function(module, exports, __webpack_require__) { - function addParseToken (token, callback) { - var i, func = callback; - if (typeof token === 'string') { - token = [token]; - } - if (typeof callback === 'number') { - func = function (input, array) { - array[callback] = toInt(input); - }; - } - for (i = 0; i < token.length; i++) { - tokens[token[i]] = func; - } - } + var anObject = __webpack_require__(22) + , get = __webpack_require__(53); + module.exports = __webpack_require__(17).getIterator = function(it){ + var iterFn = get(it); + if(typeof iterFn != 'function')throw TypeError(it + ' is not iterable!'); + return anObject(iterFn.call(it)); + }; - function addWeekParseToken (token, callback) { - addParseToken(token, function (input, array, config, token) { - config._w = config._w || {}; - callback(input, config._w, config, token); - }); - } +/***/ }, +/* 53 */ +/***/ function(module, exports, __webpack_require__) { - function addTimeToArrayFromToken(token, input, config) { - if (input != null && hasOwnProp(tokens, token)) { - tokens[token](input, config._a, config, token); - } - } + var classof = __webpack_require__(54) + , ITERATOR = __webpack_require__(47)('iterator') + , Iterators = __webpack_require__(8); + module.exports = __webpack_require__(17).getIteratorMethod = function(it){ + if(it != undefined)return it[ITERATOR] + || it['@@iterator'] + || Iterators[classof(it)]; + }; - var YEAR = 0; - var MONTH = 1; - var DATE = 2; - var HOUR = 3; - var MINUTE = 4; - var SECOND = 5; - var MILLISECOND = 6; - var WEEK = 7; - var WEEKDAY = 8; +/***/ }, +/* 54 */ +/***/ function(module, exports, __webpack_require__) { - var indexOf; + // getting tag from 19.1.3.6 Object.prototype.toString() + var cof = __webpack_require__(11) + , TAG = __webpack_require__(47)('toStringTag') + // ES3 wrong here + , ARG = cof(function(){ return arguments; }()) == 'Arguments'; - if (Array.prototype.indexOf) { - indexOf = Array.prototype.indexOf; - } else { - indexOf = function (o) { - // I know - var i; - for (i = 0; i < this.length; ++i) { - if (this[i] === o) { - return i; - } - } - return -1; - }; - } + // fallback for IE11 Script Access Denied error + var tryGet = function(it, key){ + try { + return it[key]; + } catch(e){ /* empty */ } + }; - function daysInMonth(year, month) { - return new Date(Date.UTC(year, month + 1, 0)).getUTCDate(); - } + module.exports = function(it){ + var O, T, B; + return it === undefined ? 'Undefined' : it === null ? 'Null' + // @@toStringTag case + : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T + // builtinTag case + : ARG ? cof(O) + // ES3 arguments fallback + : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; + }; - // FORMATTING +/***/ }, +/* 55 */ +/***/ function(module, exports, __webpack_require__) { - addFormatToken('M', ['MM', 2], 'Mo', function () { - return this.month() + 1; - }); + module.exports = { "default": __webpack_require__(56), __esModule: true }; - addFormatToken('MMM', 0, 0, function (format) { - return this.localeData().monthsShort(this, format); - }); +/***/ }, +/* 56 */ +/***/ function(module, exports, __webpack_require__) { - addFormatToken('MMMM', 0, 0, function (format) { - return this.localeData().months(this, format); - }); + __webpack_require__(57); + var $Object = __webpack_require__(17).Object; + module.exports = function create(P, D){ + return $Object.create(P, D); + }; - // ALIASES +/***/ }, +/* 57 */ +/***/ function(module, exports, __webpack_require__) { - addUnitAlias('month', 'M'); + var $export = __webpack_require__(15) + // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) + $export($export.S, 'Object', {create: __webpack_require__(33)}); - // PRIORITY +/***/ }, +/* 58 */ +/***/ function(module, exports, __webpack_require__) { - addUnitPriority('month', 8); + module.exports = { "default": __webpack_require__(59), __esModule: true }; - // PARSING +/***/ }, +/* 59 */ +/***/ function(module, exports, __webpack_require__) { - addRegexToken('M', match1to2); - addRegexToken('MM', match1to2, match2); - addRegexToken('MMM', function (isStrict, locale) { - return locale.monthsShortRegex(isStrict); - }); - addRegexToken('MMMM', function (isStrict, locale) { - return locale.monthsRegex(isStrict); - }); + __webpack_require__(60); + module.exports = __webpack_require__(17).Object.keys; - addParseToken(['M', 'MM'], function (input, array) { - array[MONTH] = toInt(input) - 1; - }); +/***/ }, +/* 60 */ +/***/ function(module, exports, __webpack_require__) { - addParseToken(['MMM', 'MMMM'], function (input, array, config, token) { - var month = config._locale.monthsParse(input, token, config._strict); - // if we didn't find a month name, mark the date as invalid. - if (month != null) { - array[MONTH] = month; - } else { - getParsingFlags(config).invalidMonth = input; - } - }); + // 19.1.2.14 Object.keys(O) + var toObject = __webpack_require__(49) + , $keys = __webpack_require__(35); - // LOCALES + __webpack_require__(61)('keys', function(){ + return function keys(it){ + return $keys(toObject(it)); + }; + }); - var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/; - var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'); - function localeMonths (m, format) { - if (!m) { - return this._months; - } - return isArray(this._months) ? this._months[m.month()] : - this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()]; - } +/***/ }, +/* 61 */ +/***/ function(module, exports, __webpack_require__) { - var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'); - function localeMonthsShort (m, format) { - if (!m) { - return this._monthsShort; - } - return isArray(this._monthsShort) ? this._monthsShort[m.month()] : - this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()]; - } + // most Object methods by ES6 should accept primitives + var $export = __webpack_require__(15) + , core = __webpack_require__(17) + , fails = __webpack_require__(26); + module.exports = function(KEY, exec){ + var fn = (core.Object || {})[KEY] || Object[KEY] + , exp = {}; + exp[KEY] = exec(fn); + $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp); + }; - function units_month__handleStrictParse(monthName, format, strict) { - var i, ii, mom, llc = monthName.toLocaleLowerCase(); - if (!this._monthsParse) { - // this is not used - this._monthsParse = []; - this._longMonthsParse = []; - this._shortMonthsParse = []; - for (i = 0; i < 12; ++i) { - mom = create_utc__createUTC([2000, i]); - this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase(); - this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase(); - } - } +/***/ }, +/* 62 */ +/***/ function(module, exports, __webpack_require__) { - if (strict) { - if (format === 'MMM') { - ii = indexOf.call(this._shortMonthsParse, llc); - return ii !== -1 ? ii : null; - } else { - ii = indexOf.call(this._longMonthsParse, llc); - return ii !== -1 ? ii : null; - } - } else { - if (format === 'MMM') { - ii = indexOf.call(this._shortMonthsParse, llc); - if (ii !== -1) { - return ii; - } - ii = indexOf.call(this._longMonthsParse, llc); - return ii !== -1 ? ii : null; - } else { - ii = indexOf.call(this._longMonthsParse, llc); - if (ii !== -1) { - return ii; - } - ii = indexOf.call(this._shortMonthsParse, llc); - return ii !== -1 ? ii : null; - } - } - } + "use strict"; - function localeMonthsParse (monthName, format, strict) { - var i, mom, regex; + exports.__esModule = true; - if (this._monthsParseExact) { - return units_month__handleStrictParse.call(this, monthName, format, strict); - } + var _iterator = __webpack_require__(63); - if (!this._monthsParse) { - this._monthsParse = []; - this._longMonthsParse = []; - this._shortMonthsParse = []; - } + var _iterator2 = _interopRequireDefault(_iterator); - // TODO: add sorting - // Sorting makes sure if one month (or abbr) is a prefix of another - // see sorting in computeMonthsParse - for (i = 0; i < 12; i++) { - // make the regex if we don't have it already - mom = create_utc__createUTC([2000, i]); - if (strict && !this._longMonthsParse[i]) { - this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i'); - this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i'); - } - if (!strict && !this._monthsParse[i]) { - regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, ''); - this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i'); - } - // test the regex - if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) { - return i; - } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) { - return i; - } else if (!strict && this._monthsParse[i].test(monthName)) { - return i; - } - } - } + var _symbol = __webpack_require__(66); - // MOMENTS + var _symbol2 = _interopRequireDefault(_symbol); - function setMonth (mom, value) { - var dayOfMonth; + var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; }; - if (!mom.isValid()) { - // No op - return mom; + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) { + return typeof obj === "undefined" ? "undefined" : _typeof(obj); + } : function (obj) { + return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj); + }; + +/***/ }, +/* 63 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = { "default": __webpack_require__(64), __esModule: true }; + +/***/ }, +/* 64 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(50); + __webpack_require__(4); + module.exports = __webpack_require__(65).f('iterator'); + +/***/ }, +/* 65 */ +/***/ function(module, exports, __webpack_require__) { + + exports.f = __webpack_require__(47); + +/***/ }, +/* 66 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = { "default": __webpack_require__(67), __esModule: true }; + +/***/ }, +/* 67 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(68); + __webpack_require__(79); + __webpack_require__(80); + __webpack_require__(81); + module.exports = __webpack_require__(17).Symbol; + +/***/ }, +/* 68 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // ECMAScript 6 symbols shim + var global = __webpack_require__(16) + , has = __webpack_require__(31) + , DESCRIPTORS = __webpack_require__(25) + , $export = __webpack_require__(15) + , redefine = __webpack_require__(30) + , META = __webpack_require__(69).KEY + , $fails = __webpack_require__(26) + , shared = __webpack_require__(42) + , setToStringTag = __webpack_require__(46) + , uid = __webpack_require__(43) + , wks = __webpack_require__(47) + , wksExt = __webpack_require__(65) + , wksDefine = __webpack_require__(70) + , keyOf = __webpack_require__(71) + , enumKeys = __webpack_require__(72) + , isArray = __webpack_require__(75) + , anObject = __webpack_require__(22) + , toIObject = __webpack_require__(9) + , toPrimitive = __webpack_require__(28) + , createDesc = __webpack_require__(29) + , _create = __webpack_require__(33) + , gOPNExt = __webpack_require__(76) + , $GOPD = __webpack_require__(78) + , $DP = __webpack_require__(21) + , $keys = __webpack_require__(35) + , gOPD = $GOPD.f + , dP = $DP.f + , gOPN = gOPNExt.f + , $Symbol = global.Symbol + , $JSON = global.JSON + , _stringify = $JSON && $JSON.stringify + , PROTOTYPE = 'prototype' + , HIDDEN = wks('_hidden') + , TO_PRIMITIVE = wks('toPrimitive') + , isEnum = {}.propertyIsEnumerable + , SymbolRegistry = shared('symbol-registry') + , AllSymbols = shared('symbols') + , OPSymbols = shared('op-symbols') + , ObjectProto = Object[PROTOTYPE] + , USE_NATIVE = typeof $Symbol == 'function' + , QObject = global.QObject; + // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 + var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; + + // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 + var setSymbolDesc = DESCRIPTORS && $fails(function(){ + return _create(dP({}, 'a', { + get: function(){ return dP(this, 'a', {value: 7}).a; } + })).a != 7; + }) ? function(it, key, D){ + var protoDesc = gOPD(ObjectProto, key); + if(protoDesc)delete ObjectProto[key]; + dP(it, key, D); + if(protoDesc && it !== ObjectProto)dP(ObjectProto, key, protoDesc); + } : dP; + + var wrap = function(tag){ + var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); + sym._k = tag; + return sym; + }; + + var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function(it){ + return typeof it == 'symbol'; + } : function(it){ + return it instanceof $Symbol; + }; + + var $defineProperty = function defineProperty(it, key, D){ + if(it === ObjectProto)$defineProperty(OPSymbols, key, D); + anObject(it); + key = toPrimitive(key, true); + anObject(D); + if(has(AllSymbols, key)){ + if(!D.enumerable){ + if(!has(it, HIDDEN))dP(it, HIDDEN, createDesc(1, {})); + it[HIDDEN][key] = true; + } else { + if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false; + D = _create(D, {enumerable: createDesc(0, false)}); + } return setSymbolDesc(it, key, D); + } return dP(it, key, D); + }; + var $defineProperties = function defineProperties(it, P){ + anObject(it); + var keys = enumKeys(P = toIObject(P)) + , i = 0 + , l = keys.length + , key; + while(l > i)$defineProperty(it, key = keys[i++], P[key]); + return it; + }; + var $create = function create(it, P){ + return P === undefined ? _create(it) : $defineProperties(_create(it), P); + }; + var $propertyIsEnumerable = function propertyIsEnumerable(key){ + var E = isEnum.call(this, key = toPrimitive(key, true)); + if(this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return false; + return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; + }; + var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key){ + it = toIObject(it); + key = toPrimitive(key, true); + if(it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return; + var D = gOPD(it, key); + if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true; + return D; + }; + var $getOwnPropertyNames = function getOwnPropertyNames(it){ + var names = gOPN(toIObject(it)) + , result = [] + , i = 0 + , key; + while(names.length > i){ + if(!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META)result.push(key); + } return result; + }; + var $getOwnPropertySymbols = function getOwnPropertySymbols(it){ + var IS_OP = it === ObjectProto + , names = gOPN(IS_OP ? OPSymbols : toIObject(it)) + , result = [] + , i = 0 + , key; + while(names.length > i){ + if(has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true))result.push(AllSymbols[key]); + } return result; + }; + + // 19.4.1.1 Symbol([description]) + if(!USE_NATIVE){ + $Symbol = function Symbol(){ + if(this instanceof $Symbol)throw TypeError('Symbol is not a constructor!'); + var tag = uid(arguments.length > 0 ? arguments[0] : undefined); + var $set = function(value){ + if(this === ObjectProto)$set.call(OPSymbols, value); + if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false; + setSymbolDesc(this, tag, createDesc(1, value)); + }; + if(DESCRIPTORS && setter)setSymbolDesc(ObjectProto, tag, {configurable: true, set: $set}); + return wrap(tag); + }; + redefine($Symbol[PROTOTYPE], 'toString', function toString(){ + return this._k; + }); + + $GOPD.f = $getOwnPropertyDescriptor; + $DP.f = $defineProperty; + __webpack_require__(77).f = gOPNExt.f = $getOwnPropertyNames; + __webpack_require__(74).f = $propertyIsEnumerable; + __webpack_require__(73).f = $getOwnPropertySymbols; + + if(DESCRIPTORS && !__webpack_require__(14)){ + redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); + } + + wksExt.f = function(name){ + return wrap(wks(name)); + } + } + + $export($export.G + $export.W + $export.F * !USE_NATIVE, {Symbol: $Symbol}); + + for(var symbols = ( + // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 + 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' + ).split(','), i = 0; symbols.length > i; )wks(symbols[i++]); + + for(var symbols = $keys(wks.store), i = 0; symbols.length > i; )wksDefine(symbols[i++]); + + $export($export.S + $export.F * !USE_NATIVE, 'Symbol', { + // 19.4.2.1 Symbol.for(key) + 'for': function(key){ + return has(SymbolRegistry, key += '') + ? SymbolRegistry[key] + : SymbolRegistry[key] = $Symbol(key); + }, + // 19.4.2.5 Symbol.keyFor(sym) + keyFor: function keyFor(key){ + if(isSymbol(key))return keyOf(SymbolRegistry, key); + throw TypeError(key + ' is not a symbol!'); + }, + useSetter: function(){ setter = true; }, + useSimple: function(){ setter = false; } + }); + + $export($export.S + $export.F * !USE_NATIVE, 'Object', { + // 19.1.2.2 Object.create(O [, Properties]) + create: $create, + // 19.1.2.4 Object.defineProperty(O, P, Attributes) + defineProperty: $defineProperty, + // 19.1.2.3 Object.defineProperties(O, Properties) + defineProperties: $defineProperties, + // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) + getOwnPropertyDescriptor: $getOwnPropertyDescriptor, + // 19.1.2.7 Object.getOwnPropertyNames(O) + getOwnPropertyNames: $getOwnPropertyNames, + // 19.1.2.8 Object.getOwnPropertySymbols(O) + getOwnPropertySymbols: $getOwnPropertySymbols + }); + + // 24.3.2 JSON.stringify(value [, replacer [, space]]) + $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function(){ + var S = $Symbol(); + // MS Edge converts symbol values to JSON as {} + // WebKit converts symbol values to JSON as null + // V8 throws on boxed symbols + return _stringify([S]) != '[null]' || _stringify({a: S}) != '{}' || _stringify(Object(S)) != '{}'; + })), 'JSON', { + stringify: function stringify(it){ + if(it === undefined || isSymbol(it))return; // IE8 returns string on undefined + var args = [it] + , i = 1 + , replacer, $replacer; + while(arguments.length > i)args.push(arguments[i++]); + replacer = args[1]; + if(typeof replacer == 'function')$replacer = replacer; + if($replacer || !isArray(replacer))replacer = function(key, value){ + if($replacer)value = $replacer.call(this, key, value); + if(!isSymbol(value))return value; + }; + args[1] = replacer; + return _stringify.apply($JSON, args); + } + }); + + // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) + $Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(20)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); + // 19.4.3.5 Symbol.prototype[@@toStringTag] + setToStringTag($Symbol, 'Symbol'); + // 20.2.1.9 Math[@@toStringTag] + setToStringTag(Math, 'Math', true); + // 24.3.3 JSON[@@toStringTag] + setToStringTag(global.JSON, 'JSON', true); + +/***/ }, +/* 69 */ +/***/ function(module, exports, __webpack_require__) { + + var META = __webpack_require__(43)('meta') + , isObject = __webpack_require__(23) + , has = __webpack_require__(31) + , setDesc = __webpack_require__(21).f + , id = 0; + var isExtensible = Object.isExtensible || function(){ + return true; + }; + var FREEZE = !__webpack_require__(26)(function(){ + return isExtensible(Object.preventExtensions({})); + }); + var setMeta = function(it){ + setDesc(it, META, {value: { + i: 'O' + ++id, // object ID + w: {} // weak collections IDs + }}); + }; + var fastKey = function(it, create){ + // return primitive with prefix + if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; + if(!has(it, META)){ + // can't set metadata to uncaught frozen object + if(!isExtensible(it))return 'F'; + // not necessary to add metadata + if(!create)return 'E'; + // add missing metadata + setMeta(it); + // return object ID + } return it[META].i; + }; + var getWeak = function(it, create){ + if(!has(it, META)){ + // can't set metadata to uncaught frozen object + if(!isExtensible(it))return true; + // not necessary to add metadata + if(!create)return false; + // add missing metadata + setMeta(it); + // return hash weak collections IDs + } return it[META].w; + }; + // add metadata on freeze-family methods calling + var onFreeze = function(it){ + if(FREEZE && meta.NEED && isExtensible(it) && !has(it, META))setMeta(it); + return it; + }; + var meta = module.exports = { + KEY: META, + NEED: false, + fastKey: fastKey, + getWeak: getWeak, + onFreeze: onFreeze + }; + +/***/ }, +/* 70 */ +/***/ function(module, exports, __webpack_require__) { + + var global = __webpack_require__(16) + , core = __webpack_require__(17) + , LIBRARY = __webpack_require__(14) + , wksExt = __webpack_require__(65) + , defineProperty = __webpack_require__(21).f; + module.exports = function(name){ + var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); + if(name.charAt(0) != '_' && !(name in $Symbol))defineProperty($Symbol, name, {value: wksExt.f(name)}); + }; + +/***/ }, +/* 71 */ +/***/ function(module, exports, __webpack_require__) { + + var getKeys = __webpack_require__(35) + , toIObject = __webpack_require__(9); + module.exports = function(object, el){ + var O = toIObject(object) + , keys = getKeys(O) + , length = keys.length + , index = 0 + , key; + while(length > index)if(O[key = keys[index++]] === el)return key; + }; + +/***/ }, +/* 72 */ +/***/ function(module, exports, __webpack_require__) { + + // all enumerable object keys, includes symbols + var getKeys = __webpack_require__(35) + , gOPS = __webpack_require__(73) + , pIE = __webpack_require__(74); + module.exports = function(it){ + var result = getKeys(it) + , getSymbols = gOPS.f; + if(getSymbols){ + var symbols = getSymbols(it) + , isEnum = pIE.f + , i = 0 + , key; + while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))result.push(key); + } return result; + }; + +/***/ }, +/* 73 */ +/***/ function(module, exports) { + + exports.f = Object.getOwnPropertySymbols; + +/***/ }, +/* 74 */ +/***/ function(module, exports) { + + exports.f = {}.propertyIsEnumerable; + +/***/ }, +/* 75 */ +/***/ function(module, exports, __webpack_require__) { + + // 7.2.2 IsArray(argument) + var cof = __webpack_require__(11); + module.exports = Array.isArray || function isArray(arg){ + return cof(arg) == 'Array'; + }; + +/***/ }, +/* 76 */ +/***/ function(module, exports, __webpack_require__) { + + // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window + var toIObject = __webpack_require__(9) + , gOPN = __webpack_require__(77).f + , toString = {}.toString; + + var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames + ? Object.getOwnPropertyNames(window) : []; + + var getWindowNames = function(it){ + try { + return gOPN(it); + } catch(e){ + return windowNames.slice(); + } + }; + + module.exports.f = function getOwnPropertyNames(it){ + return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); + }; + + +/***/ }, +/* 77 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) + var $keys = __webpack_require__(36) + , hiddenKeys = __webpack_require__(44).concat('length', 'prototype'); + + exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O){ + return $keys(O, hiddenKeys); + }; + +/***/ }, +/* 78 */ +/***/ function(module, exports, __webpack_require__) { + + var pIE = __webpack_require__(74) + , createDesc = __webpack_require__(29) + , toIObject = __webpack_require__(9) + , toPrimitive = __webpack_require__(28) + , has = __webpack_require__(31) + , IE8_DOM_DEFINE = __webpack_require__(24) + , gOPD = Object.getOwnPropertyDescriptor; + + exports.f = __webpack_require__(25) ? gOPD : function getOwnPropertyDescriptor(O, P){ + O = toIObject(O); + P = toPrimitive(P, true); + if(IE8_DOM_DEFINE)try { + return gOPD(O, P); + } catch(e){ /* empty */ } + if(has(O, P))return createDesc(!pIE.f.call(O, P), O[P]); + }; + +/***/ }, +/* 79 */ +/***/ function(module, exports) { + + + +/***/ }, +/* 80 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(70)('asyncIterator'); + +/***/ }, +/* 81 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(70)('observable'); + +/***/ }, +/* 82 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = { "default": __webpack_require__(83), __esModule: true }; + +/***/ }, +/* 83 */ +/***/ function(module, exports, __webpack_require__) { + + var core = __webpack_require__(17) + , $JSON = core.JSON || (core.JSON = {stringify: JSON.stringify}); + module.exports = function stringify(it){ // eslint-disable-line no-unused-vars + return $JSON.stringify.apply($JSON, arguments); + }; + +/***/ }, +/* 84 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + // first check if moment.js is already loaded in the browser window, if so, + // use this instance. Else, load via commonjs. + module.exports = typeof window !== 'undefined' && window['moment'] || __webpack_require__(85); + +/***/ }, +/* 85 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(module) {//! moment.js + //! version : 2.17.1 + //! authors : Tim Wood, Iskren Chernev, Moment.js contributors + //! license : MIT + //! momentjs.com + + ;(function (global, factory) { + true ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + global.moment = factory() + }(this, (function () { 'use strict'; + + var hookCallback; + + function hooks () { + return hookCallback.apply(null, arguments); + } + + // This is done to register the method called with moment() + // without creating circular dependencies. + function setHookCallback (callback) { + hookCallback = callback; + } + + function isArray(input) { + return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]'; + } + + function isObject(input) { + // IE8 will treat undefined and null as object if it wasn't for + // input != null + return input != null && Object.prototype.toString.call(input) === '[object Object]'; + } + + function isObjectEmpty(obj) { + var k; + for (k in obj) { + // even if its not own property I'd still call it non-empty + return false; + } + return true; + } + + function isNumber(input) { + return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]'; + } + + function isDate(input) { + return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]'; + } + + function map(arr, fn) { + var res = [], i; + for (i = 0; i < arr.length; ++i) { + res.push(fn(arr[i], i)); + } + return res; + } + + function hasOwnProp(a, b) { + return Object.prototype.hasOwnProperty.call(a, b); + } + + function extend(a, b) { + for (var i in b) { + if (hasOwnProp(b, i)) { + a[i] = b[i]; } + } - if (typeof value === 'string') { - if (/^\d+$/.test(value)) { - value = toInt(value); - } else { - value = mom.localeData().monthsParse(value); - // TODO: Another silent failure? - if (typeof value !== 'number') { - return mom; - } + if (hasOwnProp(b, 'toString')) { + a.toString = b.toString; + } + + if (hasOwnProp(b, 'valueOf')) { + a.valueOf = b.valueOf; + } + + return a; + } + + function createUTC (input, format, locale, strict) { + return createLocalOrUTC(input, format, locale, strict, true).utc(); + } + + function defaultParsingFlags() { + // We need to deep clone this object. + return { + empty : false, + unusedTokens : [], + unusedInput : [], + overflow : -2, + charsLeftOver : 0, + nullInput : false, + invalidMonth : null, + invalidFormat : false, + userInvalidated : false, + iso : false, + parsedDateParts : [], + meridiem : null + }; + } + + function getParsingFlags(m) { + if (m._pf == null) { + m._pf = defaultParsingFlags(); + } + return m._pf; + } + + var some; + if (Array.prototype.some) { + some = Array.prototype.some; + } else { + some = function (fun) { + var t = Object(this); + var len = t.length >>> 0; + + for (var i = 0; i < len; i++) { + if (i in t && fun.call(this, t[i], i, t)) { + return true; } } - dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value)); - mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth); - return mom; - } + return false; + }; + } - function getSetMonth (value) { - if (value != null) { - setMonth(this, value); - utils_hooks__hooks.updateOffset(this, true); - return this; - } else { - return get_set__get(this, 'Month'); + var some$1 = some; + + function isValid(m) { + if (m._isValid == null) { + var flags = getParsingFlags(m); + var parsedParts = some$1.call(flags.parsedDateParts, function (i) { + return i != null; + }); + var isNowValid = !isNaN(m._d.getTime()) && + flags.overflow < 0 && + !flags.empty && + !flags.invalidMonth && + !flags.invalidWeekday && + !flags.nullInput && + !flags.invalidFormat && + !flags.userInvalidated && + (!flags.meridiem || (flags.meridiem && parsedParts)); + + if (m._strict) { + isNowValid = isNowValid && + flags.charsLeftOver === 0 && + flags.unusedTokens.length === 0 && + flags.bigHour === undefined; + } + + if (Object.isFrozen == null || !Object.isFrozen(m)) { + m._isValid = isNowValid; + } + else { + return isNowValid; } } + return m._isValid; + } + + function createInvalid (flags) { + var m = createUTC(NaN); + if (flags != null) { + extend(getParsingFlags(m), flags); + } + else { + getParsingFlags(m).userInvalidated = true; + } + + return m; + } + + function isUndefined(input) { + return input === void 0; + } + + // Plugins that add properties should also add the key here (null value), + // so we can properly clone ourselves. + var momentProperties = hooks.momentProperties = []; + + function copyConfig(to, from) { + var i, prop, val; - function getDaysInMonth () { - return daysInMonth(this.year(), this.month()); + if (!isUndefined(from._isAMomentObject)) { + to._isAMomentObject = from._isAMomentObject; + } + if (!isUndefined(from._i)) { + to._i = from._i; + } + if (!isUndefined(from._f)) { + to._f = from._f; + } + if (!isUndefined(from._l)) { + to._l = from._l; + } + if (!isUndefined(from._strict)) { + to._strict = from._strict; + } + if (!isUndefined(from._tzm)) { + to._tzm = from._tzm; + } + if (!isUndefined(from._isUTC)) { + to._isUTC = from._isUTC; + } + if (!isUndefined(from._offset)) { + to._offset = from._offset; + } + if (!isUndefined(from._pf)) { + to._pf = getParsingFlags(from); + } + if (!isUndefined(from._locale)) { + to._locale = from._locale; } - var defaultMonthsShortRegex = matchWord; - function monthsShortRegex (isStrict) { - if (this._monthsParseExact) { - if (!hasOwnProp(this, '_monthsRegex')) { - computeMonthsParse.call(this); - } - if (isStrict) { - return this._monthsShortStrictRegex; - } else { - return this._monthsShortRegex; + if (momentProperties.length > 0) { + for (i in momentProperties) { + prop = momentProperties[i]; + val = from[prop]; + if (!isUndefined(val)) { + to[prop] = val; } - } else { - if (!hasOwnProp(this, '_monthsShortRegex')) { - this._monthsShortRegex = defaultMonthsShortRegex; - } - return this._monthsShortStrictRegex && isStrict ? - this._monthsShortStrictRegex : this._monthsShortRegex; } } - var defaultMonthsRegex = matchWord; - function monthsRegex (isStrict) { - if (this._monthsParseExact) { - if (!hasOwnProp(this, '_monthsRegex')) { - computeMonthsParse.call(this); - } - if (isStrict) { - return this._monthsStrictRegex; - } else { - return this._monthsRegex; - } - } else { - if (!hasOwnProp(this, '_monthsRegex')) { - this._monthsRegex = defaultMonthsRegex; - } - return this._monthsStrictRegex && isStrict ? - this._monthsStrictRegex : this._monthsRegex; + return to; + } + + var updateInProgress = false; + + // Moment prototype object + function Moment(config) { + copyConfig(this, config); + this._d = new Date(config._d != null ? config._d.getTime() : NaN); + if (!this.isValid()) { + this._d = new Date(NaN); + } + // Prevent infinite loop in case updateOffset creates new moment + // objects. + if (updateInProgress === false) { + updateInProgress = true; + hooks.updateOffset(this); + updateInProgress = false; + } + } + + function isMoment (obj) { + return obj instanceof Moment || (obj != null && obj._isAMomentObject != null); + } + + function absFloor (number) { + if (number < 0) { + // -0 -> 0 + return Math.ceil(number) || 0; + } else { + return Math.floor(number); + } + } + + function toInt(argumentForCoercion) { + var coercedNumber = +argumentForCoercion, + value = 0; + + if (coercedNumber !== 0 && isFinite(coercedNumber)) { + value = absFloor(coercedNumber); + } + + return value; + } + + // compare two arrays, return the number of differences + function compareArrays(array1, array2, dontConvert) { + var len = Math.min(array1.length, array2.length), + lengthDiff = Math.abs(array1.length - array2.length), + diffs = 0, + i; + for (i = 0; i < len; i++) { + if ((dontConvert && array1[i] !== array2[i]) || + (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) { + diffs++; } } + return diffs + lengthDiff; + } - function computeMonthsParse () { - function cmpLenRev(a, b) { - return b.length - a.length; + function warn(msg) { + if (hooks.suppressDeprecationWarnings === false && + (typeof console !== 'undefined') && console.warn) { + console.warn('Deprecation warning: ' + msg); + } + } + + function deprecate(msg, fn) { + var firstTime = true; + + return extend(function () { + if (hooks.deprecationHandler != null) { + hooks.deprecationHandler(null, msg); + } + if (firstTime) { + var args = []; + var arg; + for (var i = 0; i < arguments.length; i++) { + arg = ''; + if (typeof arguments[i] === 'object') { + arg += '\n[' + i + '] '; + for (var key in arguments[0]) { + arg += key + ': ' + arguments[0][key] + ', '; + } + arg = arg.slice(0, -2); // Remove trailing comma and space + } else { + arg = arguments[i]; + } + args.push(arg); + } + warn(msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + (new Error()).stack); + firstTime = false; } + return fn.apply(this, arguments); + }, fn); + } + + var deprecations = {}; + + function deprecateSimple(name, msg) { + if (hooks.deprecationHandler != null) { + hooks.deprecationHandler(name, msg); + } + if (!deprecations[name]) { + warn(msg); + deprecations[name] = true; + } + } + + hooks.suppressDeprecationWarnings = false; + hooks.deprecationHandler = null; + + function isFunction(input) { + return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]'; + } - var shortPieces = [], longPieces = [], mixedPieces = [], - i, mom; - for (i = 0; i < 12; i++) { - // make the regex if we don't have it already - mom = create_utc__createUTC([2000, i]); - shortPieces.push(this.monthsShort(mom, '')); - longPieces.push(this.months(mom, '')); - mixedPieces.push(this.months(mom, '')); - mixedPieces.push(this.monthsShort(mom, '')); + function set (config) { + var prop, i; + for (i in config) { + prop = config[i]; + if (isFunction(prop)) { + this[i] = prop; + } else { + this['_' + i] = prop; } - // Sorting makes sure if one month (or abbr) is a prefix of another it - // will match the longer piece. - shortPieces.sort(cmpLenRev); - longPieces.sort(cmpLenRev); - mixedPieces.sort(cmpLenRev); - for (i = 0; i < 12; i++) { - shortPieces[i] = regexEscape(shortPieces[i]); - longPieces[i] = regexEscape(longPieces[i]); + } + this._config = config; + // Lenient ordinal parsing accepts just a number in addition to + // number + (possibly) stuff coming from _ordinalParseLenient. + this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + (/\d{1,2}/).source); + } + + function mergeConfigs(parentConfig, childConfig) { + var res = extend({}, parentConfig), prop; + for (prop in childConfig) { + if (hasOwnProp(childConfig, prop)) { + if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) { + res[prop] = {}; + extend(res[prop], parentConfig[prop]); + extend(res[prop], childConfig[prop]); + } else if (childConfig[prop] != null) { + res[prop] = childConfig[prop]; + } else { + delete res[prop]; + } } - for (i = 0; i < 24; i++) { - mixedPieces[i] = regexEscape(mixedPieces[i]); + } + for (prop in parentConfig) { + if (hasOwnProp(parentConfig, prop) && + !hasOwnProp(childConfig, prop) && + isObject(parentConfig[prop])) { + // make sure changes to properties don't modify parent config + res[prop] = extend({}, res[prop]); } + } + return res; + } - this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); - this._monthsShortRegex = this._monthsRegex; - this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i'); - this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i'); + function Locale(config) { + if (config != null) { + this.set(config); } + } - // FORMATTING + var keys; - addFormatToken('Y', 0, 0, function () { - var y = this.year(); - return y <= 9999 ? '' + y : '+' + y; - }); + if (Object.keys) { + keys = Object.keys; + } else { + keys = function (obj) { + var i, res = []; + for (i in obj) { + if (hasOwnProp(obj, i)) { + res.push(i); + } + } + return res; + }; + } - addFormatToken(0, ['YY', 2], 0, function () { - return this.year() % 100; - }); + var keys$1 = keys; - addFormatToken(0, ['YYYY', 4], 0, 'year'); - addFormatToken(0, ['YYYYY', 5], 0, 'year'); - addFormatToken(0, ['YYYYYY', 6, true], 0, 'year'); + var defaultCalendar = { + sameDay : '[Today at] LT', + nextDay : '[Tomorrow at] LT', + nextWeek : 'dddd [at] LT', + lastDay : '[Yesterday at] LT', + lastWeek : '[Last] dddd [at] LT', + sameElse : 'L' + }; - // ALIASES + function calendar (key, mom, now) { + var output = this._calendar[key] || this._calendar['sameElse']; + return isFunction(output) ? output.call(mom, now) : output; + } - addUnitAlias('year', 'y'); + var defaultLongDateFormat = { + 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' + }; - // PRIORITIES + function longDateFormat (key) { + var format = this._longDateFormat[key], + formatUpper = this._longDateFormat[key.toUpperCase()]; - addUnitPriority('year', 1); + if (format || !formatUpper) { + return format; + } - // PARSING + this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) { + return val.slice(1); + }); - addRegexToken('Y', matchSigned); - addRegexToken('YY', match1to2, match2); - addRegexToken('YYYY', match1to4, match4); - addRegexToken('YYYYY', match1to6, match6); - addRegexToken('YYYYYY', match1to6, match6); + return this._longDateFormat[key]; + } - addParseToken(['YYYYY', 'YYYYYY'], YEAR); - addParseToken('YYYY', function (input, array) { - array[YEAR] = input.length === 2 ? utils_hooks__hooks.parseTwoDigitYear(input) : toInt(input); - }); - addParseToken('YY', function (input, array) { - array[YEAR] = utils_hooks__hooks.parseTwoDigitYear(input); - }); - addParseToken('Y', function (input, array) { - array[YEAR] = parseInt(input, 10); - }); + var defaultInvalidDate = 'Invalid date'; - // HELPERS + function invalidDate () { + return this._invalidDate; + } - function daysInYear(year) { - return isLeapYear(year) ? 366 : 365; - } + var defaultOrdinal = '%d'; + var defaultOrdinalParse = /\d{1,2}/; - function isLeapYear(year) { - return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; - } + function ordinal (number) { + return this._ordinal.replace('%d', number); + } - // HOOKS + var defaultRelativeTime = { + future : 'in %s', + past : '%s ago', + s : 'a few seconds', + m : 'a minute', + mm : '%d minutes', + h : 'an hour', + hh : '%d hours', + d : 'a day', + dd : '%d days', + M : 'a month', + MM : '%d months', + y : 'a year', + yy : '%d years' + }; + + function relativeTime (number, withoutSuffix, string, isFuture) { + var output = this._relativeTime[string]; + return (isFunction(output)) ? + output(number, withoutSuffix, string, isFuture) : + output.replace(/%d/i, number); + } - utils_hooks__hooks.parseTwoDigitYear = function (input) { - return toInt(input) + (toInt(input) > 68 ? 1900 : 2000); - }; + function pastFuture (diff, output) { + var format = this._relativeTime[diff > 0 ? 'future' : 'past']; + return isFunction(format) ? format(output) : format.replace(/%s/i, output); + } - // MOMENTS + var aliases = {}; - var getSetYear = makeGetSet('FullYear', true); + function addUnitAlias (unit, shorthand) { + var lowerCase = unit.toLowerCase(); + aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit; + } - function getIsLeapYear () { - return isLeapYear(this.year()); - } + function normalizeUnits(units) { + return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined; + } - function createDate (y, m, d, h, M, s, ms) { - //can't just apply() to create a date: - //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply - var date = new Date(y, m, d, h, M, s, ms); + function normalizeObjectUnits(inputObject) { + var normalizedInput = {}, + normalizedProp, + prop; - //the date constructor remaps years 0-99 to 1900-1999 - if (y < 100 && y >= 0 && isFinite(date.getFullYear())) { - date.setFullYear(y); + for (prop in inputObject) { + if (hasOwnProp(inputObject, prop)) { + normalizedProp = normalizeUnits(prop); + if (normalizedProp) { + normalizedInput[normalizedProp] = inputObject[prop]; + } } - return date; } - function createUTCDate (y) { - var date = new Date(Date.UTC.apply(null, arguments)); + return normalizedInput; + } - //the Date.UTC function remaps years 0-99 to 1900-1999 - if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) { - date.setUTCFullYear(y); + var priorities = {}; + + function addUnitPriority(unit, priority) { + priorities[unit] = priority; + } + + function getPrioritizedUnits(unitsObj) { + var units = []; + for (var u in unitsObj) { + units.push({unit: u, priority: priorities[u]}); + } + units.sort(function (a, b) { + return a.priority - b.priority; + }); + return units; + } + + function makeGetSet (unit, keepTime) { + return function (value) { + if (value != null) { + set$1(this, unit, value); + hooks.updateOffset(this, keepTime); + return this; + } else { + return get(this, unit); } - return date; + }; + } + + function get (mom, unit) { + return mom.isValid() ? + mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN; + } + + function set$1 (mom, unit, value) { + if (mom.isValid()) { + mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); } + } - // start-of-first-week - start-of-year - function firstWeekOffset(year, dow, doy) { - var // first-week day -- which january is always in the first week (4 for iso, 1 for other) - fwd = 7 + dow - doy, - // first-week day local weekday -- which local weekday is fwd - fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7; + // MOMENTS - return -fwdlw + fwd - 1; + function stringGet (units) { + units = normalizeUnits(units); + if (isFunction(this[units])) { + return this[units](); } + return this; + } - //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday - function dayOfYearFromWeeks(year, week, weekday, dow, doy) { - var localWeekday = (7 + weekday - dow) % 7, - weekOffset = firstWeekOffset(year, dow, doy), - dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, - resYear, resDayOfYear; - if (dayOfYear <= 0) { - resYear = year - 1; - resDayOfYear = daysInYear(resYear) + dayOfYear; - } else if (dayOfYear > daysInYear(year)) { - resYear = year + 1; - resDayOfYear = dayOfYear - daysInYear(year); - } else { - resYear = year; - resDayOfYear = dayOfYear; + function stringSet (units, value) { + if (typeof units === 'object') { + units = normalizeObjectUnits(units); + var prioritized = getPrioritizedUnits(units); + for (var i = 0; i < prioritized.length; i++) { + this[prioritized[i].unit](units[prioritized[i].unit]); } + } else { + units = normalizeUnits(units); + if (isFunction(this[units])) { + return this[units](value); + } + } + return this; + } - return { - year: resYear, - dayOfYear: resDayOfYear + function zeroFill(number, targetLength, forceSign) { + var absNumber = '' + Math.abs(number), + zerosToFill = targetLength - absNumber.length, + sign = number >= 0; + return (sign ? (forceSign ? '+' : '') : '-') + + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber; + } + + var formattingTokens = /(\[[^\[]*\])|(\\)?([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; + + var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g; + + var formatFunctions = {}; + + var formatTokenFunctions = {}; + + // token: 'M' + // padded: ['MM', 2] + // ordinal: 'Mo' + // callback: function () { this.month() + 1 } + function addFormatToken (token, padded, ordinal, callback) { + var func = callback; + if (typeof callback === 'string') { + func = function () { + return this[callback](); }; } + if (token) { + formatTokenFunctions[token] = func; + } + if (padded) { + formatTokenFunctions[padded[0]] = function () { + return zeroFill(func.apply(this, arguments), padded[1], padded[2]); + }; + } + if (ordinal) { + formatTokenFunctions[ordinal] = function () { + return this.localeData().ordinal(func.apply(this, arguments), token); + }; + } + } - function weekOfYear(mom, dow, doy) { - var weekOffset = firstWeekOffset(mom.year(), dow, doy), - week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, - resWeek, resYear; + function removeFormattingTokens(input) { + if (input.match(/\[[\s\S]/)) { + return input.replace(/^\[|\]$/g, ''); + } + return input.replace(/\\/g, ''); + } - if (week < 1) { - resYear = mom.year() - 1; - resWeek = week + weeksInYear(resYear, dow, doy); - } else if (week > weeksInYear(mom.year(), dow, doy)) { - resWeek = week - weeksInYear(mom.year(), dow, doy); - resYear = mom.year() + 1; + function makeFormatFunction(format) { + var array = format.match(formattingTokens), i, length; + + for (i = 0, length = array.length; i < length; i++) { + if (formatTokenFunctions[array[i]]) { + array[i] = formatTokenFunctions[array[i]]; } else { - resYear = mom.year(); - resWeek = week; + array[i] = removeFormattingTokens(array[i]); } - - return { - week: resWeek, - year: resYear - }; } - function weeksInYear(year, dow, doy) { - var weekOffset = firstWeekOffset(year, dow, doy), - weekOffsetNext = firstWeekOffset(year + 1, dow, doy); - return (daysInYear(year) - weekOffset + weekOffsetNext) / 7; + return function (mom) { + var output = '', i; + for (i = 0; i < length; i++) { + output += array[i] instanceof Function ? array[i].call(mom, format) : array[i]; + } + return output; + }; + } + + // format date using native date object + function formatMoment(m, format) { + if (!m.isValid()) { + return m.localeData().invalidDate(); } - // FORMATTING + format = expandFormat(format, m.localeData()); + formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format); - addFormatToken('w', ['ww', 2], 'wo', 'week'); - addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); + return formatFunctions[format](m); + } - // ALIASES + function expandFormat(format, locale) { + var i = 5; - addUnitAlias('week', 'w'); - addUnitAlias('isoWeek', 'W'); + function replaceLongDateFormatTokens(input) { + return locale.longDateFormat(input) || input; + } - // PRIORITIES + localFormattingTokens.lastIndex = 0; + while (i >= 0 && localFormattingTokens.test(format)) { + format = format.replace(localFormattingTokens, replaceLongDateFormatTokens); + localFormattingTokens.lastIndex = 0; + i -= 1; + } - addUnitPriority('week', 5); - addUnitPriority('isoWeek', 5); + return format; + } - // PARSING + var match1 = /\d/; // 0 - 9 + var match2 = /\d\d/; // 00 - 99 + var match3 = /\d{3}/; // 000 - 999 + var match4 = /\d{4}/; // 0000 - 9999 + var match6 = /[+-]?\d{6}/; // -999999 - 999999 + var match1to2 = /\d\d?/; // 0 - 99 + var match3to4 = /\d\d\d\d?/; // 999 - 9999 + var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999 + var match1to3 = /\d{1,3}/; // 0 - 999 + var match1to4 = /\d{1,4}/; // 0 - 9999 + var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999 - addRegexToken('w', match1to2); - addRegexToken('ww', match1to2, match2); - addRegexToken('W', match1to2); - addRegexToken('WW', match1to2, match2); + var matchUnsigned = /\d+/; // 0 - inf + var matchSigned = /[+-]?\d+/; // -inf - inf - addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) { - week[token.substr(0, 1)] = toInt(input); - }); + var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z + var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z - // HELPERS + var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123 - // LOCALES + // any word (or two) characters or numbers including two/three word month in arabic. + // includes scottish gaelic two word and hyphenated months + var matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i; - function localeWeek (mom) { - return weekOfYear(mom, this._week.dow, this._week.doy).week; - } - var defaultLocaleWeek = { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 1st is the first week of the year. + var regexes = {}; + + function addRegexToken (token, regex, strictRegex) { + regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) { + return (isStrict && strictRegex) ? strictRegex : regex; }; + } - function localeFirstDayOfWeek () { - return this._week.dow; + function getParseRegexForToken (token, config) { + if (!hasOwnProp(regexes, token)) { + return new RegExp(unescapeFormat(token)); } - function localeFirstDayOfYear () { - return this._week.doy; - } + return regexes[token](config._strict, config._locale); + } - // MOMENTS + // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript + function unescapeFormat(s) { + return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { + return p1 || p2 || p3 || p4; + })); + } - function getSetWeek (input) { - var week = this.localeData().week(this); - return input == null ? week : this.add((input - week) * 7, 'd'); - } + function regexEscape(s) { + return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); + } + + var tokens = {}; - function getSetISOWeek (input) { - var week = weekOfYear(this, 1, 4).week; - return input == null ? week : this.add((input - week) * 7, 'd'); + function addParseToken (token, callback) { + var i, func = callback; + if (typeof token === 'string') { + token = [token]; + } + if (isNumber(callback)) { + func = function (input, array) { + array[callback] = toInt(input); + }; + } + for (i = 0; i < token.length; i++) { + tokens[token[i]] = func; } + } - // FORMATTING + function addWeekParseToken (token, callback) { + addParseToken(token, function (input, array, config, token) { + config._w = config._w || {}; + callback(input, config._w, config, token); + }); + } - addFormatToken('d', 0, 'do', 'day'); + function addTimeToArrayFromToken(token, input, config) { + if (input != null && hasOwnProp(tokens, token)) { + tokens[token](input, config._a, config, token); + } + } - addFormatToken('dd', 0, 0, function (format) { - return this.localeData().weekdaysMin(this, format); - }); + var YEAR = 0; + var MONTH = 1; + var DATE = 2; + var HOUR = 3; + var MINUTE = 4; + var SECOND = 5; + var MILLISECOND = 6; + var WEEK = 7; + var WEEKDAY = 8; - addFormatToken('ddd', 0, 0, function (format) { - return this.localeData().weekdaysShort(this, format); - }); + var indexOf; - addFormatToken('dddd', 0, 0, function (format) { - return this.localeData().weekdays(this, format); - }); + if (Array.prototype.indexOf) { + indexOf = Array.prototype.indexOf; + } else { + indexOf = function (o) { + // I know + var i; + for (i = 0; i < this.length; ++i) { + if (this[i] === o) { + return i; + } + } + return -1; + }; + } - addFormatToken('e', 0, 0, 'weekday'); - addFormatToken('E', 0, 0, 'isoWeekday'); + var indexOf$1 = indexOf; - // ALIASES + function daysInMonth(year, month) { + return new Date(Date.UTC(year, month + 1, 0)).getUTCDate(); + } - addUnitAlias('day', 'd'); - addUnitAlias('weekday', 'e'); - addUnitAlias('isoWeekday', 'E'); + // FORMATTING - // PRIORITY - addUnitPriority('day', 11); - addUnitPriority('weekday', 11); - addUnitPriority('isoWeekday', 11); + addFormatToken('M', ['MM', 2], 'Mo', function () { + return this.month() + 1; + }); - // PARSING + addFormatToken('MMM', 0, 0, function (format) { + return this.localeData().monthsShort(this, format); + }); - addRegexToken('d', match1to2); - addRegexToken('e', match1to2); - addRegexToken('E', match1to2); - addRegexToken('dd', function (isStrict, locale) { - return locale.weekdaysMinRegex(isStrict); - }); - addRegexToken('ddd', function (isStrict, locale) { - return locale.weekdaysShortRegex(isStrict); - }); - addRegexToken('dddd', function (isStrict, locale) { - return locale.weekdaysRegex(isStrict); - }); + addFormatToken('MMMM', 0, 0, function (format) { + return this.localeData().months(this, format); + }); - addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) { - var weekday = config._locale.weekdaysParse(input, token, config._strict); - // if we didn't get a weekday name, mark the date as invalid - if (weekday != null) { - week.d = weekday; - } else { - getParsingFlags(config).invalidWeekday = input; - } - }); + // ALIASES - addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) { - week[token] = toInt(input); - }); + addUnitAlias('month', 'M'); - // HELPERS + // PRIORITY - function parseWeekday(input, locale) { - if (typeof input !== 'string') { - return input; - } + addUnitPriority('month', 8); - if (!isNaN(input)) { - return parseInt(input, 10); - } + // PARSING - input = locale.weekdaysParse(input); - if (typeof input === 'number') { - return input; - } + addRegexToken('M', match1to2); + addRegexToken('MM', match1to2, match2); + addRegexToken('MMM', function (isStrict, locale) { + return locale.monthsShortRegex(isStrict); + }); + addRegexToken('MMMM', function (isStrict, locale) { + return locale.monthsRegex(isStrict); + }); - return null; - } + addParseToken(['M', 'MM'], function (input, array) { + array[MONTH] = toInt(input) - 1; + }); - function parseIsoWeekday(input, locale) { - if (typeof input === 'string') { - return locale.weekdaysParse(input) % 7 || 7; - } - return isNaN(input) ? null : input; + addParseToken(['MMM', 'MMMM'], function (input, array, config, token) { + var month = config._locale.monthsParse(input, token, config._strict); + // if we didn't find a month name, mark the date as invalid. + if (month != null) { + array[MONTH] = month; + } else { + getParsingFlags(config).invalidMonth = input; } + }); - // LOCALES + // LOCALES - var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'); - function localeWeekdays (m, format) { - if (!m) { - return this._weekdays; - } - return isArray(this._weekdays) ? this._weekdays[m.day()] : - this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()]; + var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/; + var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'); + function localeMonths (m, format) { + if (!m) { + return this._months; } + return isArray(this._months) ? this._months[m.month()] : + this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()]; + } - var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'); - function localeWeekdaysShort (m) { - return (m) ? this._weekdaysShort[m.day()] : this._weekdaysShort; + var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'); + function localeMonthsShort (m, format) { + if (!m) { + return this._monthsShort; } + return isArray(this._monthsShort) ? this._monthsShort[m.month()] : + this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()]; + } - var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'); - function localeWeekdaysMin (m) { - return (m) ? this._weekdaysMin[m.day()] : this._weekdaysMin; + function handleStrictParse(monthName, format, strict) { + var i, ii, mom, llc = monthName.toLocaleLowerCase(); + if (!this._monthsParse) { + // this is not used + this._monthsParse = []; + this._longMonthsParse = []; + this._shortMonthsParse = []; + for (i = 0; i < 12; ++i) { + mom = createUTC([2000, i]); + this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase(); + this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase(); + } } - function day_of_week__handleStrictParse(weekdayName, format, strict) { - var i, ii, mom, llc = weekdayName.toLocaleLowerCase(); - if (!this._weekdaysParse) { - this._weekdaysParse = []; - this._shortWeekdaysParse = []; - this._minWeekdaysParse = []; - - for (i = 0; i < 7; ++i) { - mom = create_utc__createUTC([2000, 1]).day(i); - this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase(); - this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase(); - this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase(); - } + if (strict) { + if (format === 'MMM') { + ii = indexOf$1.call(this._shortMonthsParse, llc); + return ii !== -1 ? ii : null; + } else { + ii = indexOf$1.call(this._longMonthsParse, llc); + return ii !== -1 ? ii : null; } - - if (strict) { - if (format === 'dddd') { - ii = indexOf.call(this._weekdaysParse, llc); - return ii !== -1 ? ii : null; - } else if (format === 'ddd') { - ii = indexOf.call(this._shortWeekdaysParse, llc); - return ii !== -1 ? ii : null; - } else { - ii = indexOf.call(this._minWeekdaysParse, llc); - return ii !== -1 ? ii : null; + } else { + if (format === 'MMM') { + ii = indexOf$1.call(this._shortMonthsParse, llc); + if (ii !== -1) { + return ii; } + ii = indexOf$1.call(this._longMonthsParse, llc); + return ii !== -1 ? ii : null; } else { - if (format === 'dddd') { - ii = indexOf.call(this._weekdaysParse, llc); - if (ii !== -1) { - return ii; - } - ii = indexOf.call(this._shortWeekdaysParse, llc); - if (ii !== -1) { - return ii; - } - ii = indexOf.call(this._minWeekdaysParse, llc); - return ii !== -1 ? ii : null; - } else if (format === 'ddd') { - ii = indexOf.call(this._shortWeekdaysParse, llc); - if (ii !== -1) { - return ii; - } - ii = indexOf.call(this._weekdaysParse, llc); - if (ii !== -1) { - return ii; - } - ii = indexOf.call(this._minWeekdaysParse, llc); - return ii !== -1 ? ii : null; - } else { - ii = indexOf.call(this._minWeekdaysParse, llc); - if (ii !== -1) { - return ii; - } - ii = indexOf.call(this._weekdaysParse, llc); - if (ii !== -1) { - return ii; - } - ii = indexOf.call(this._shortWeekdaysParse, llc); - return ii !== -1 ? ii : null; + ii = indexOf$1.call(this._longMonthsParse, llc); + if (ii !== -1) { + return ii; } + ii = indexOf$1.call(this._shortMonthsParse, llc); + return ii !== -1 ? ii : null; } } + } - function localeWeekdaysParse (weekdayName, format, strict) { - var i, mom, regex; - - if (this._weekdaysParseExact) { - return day_of_week__handleStrictParse.call(this, weekdayName, format, strict); - } - - if (!this._weekdaysParse) { - this._weekdaysParse = []; - this._minWeekdaysParse = []; - this._shortWeekdaysParse = []; - this._fullWeekdaysParse = []; - } - - for (i = 0; i < 7; i++) { - // make the regex if we don't have it already + function localeMonthsParse (monthName, format, strict) { + var i, mom, regex; - mom = create_utc__createUTC([2000, 1]).day(i); - if (strict && !this._fullWeekdaysParse[i]) { - this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\.?') + '$', 'i'); - this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\.?') + '$', 'i'); - this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\.?') + '$', 'i'); - } - if (!this._weekdaysParse[i]) { - regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, ''); - this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); - } - // test the regex - if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) { - return i; - } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) { - return i; - } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) { - return i; - } else if (!strict && this._weekdaysParse[i].test(weekdayName)) { - return i; - } - } + if (this._monthsParseExact) { + return handleStrictParse.call(this, monthName, format, strict); } - // MOMENTS + if (!this._monthsParse) { + this._monthsParse = []; + this._longMonthsParse = []; + this._shortMonthsParse = []; + } - function getSetDayOfWeek (input) { - if (!this.isValid()) { - return input != null ? this : NaN; + // TODO: add sorting + // Sorting makes sure if one month (or abbr) is a prefix of another + // see sorting in computeMonthsParse + for (i = 0; i < 12; i++) { + // make the regex if we don't have it already + mom = createUTC([2000, i]); + if (strict && !this._longMonthsParse[i]) { + this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i'); + this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i'); } - var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); - if (input != null) { - input = parseWeekday(input, this.localeData()); - return this.add(input - day, 'd'); - } else { - return day; + if (!strict && !this._monthsParse[i]) { + regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, ''); + this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i'); } - } - - function getSetLocaleDayOfWeek (input) { - if (!this.isValid()) { - return input != null ? this : NaN; + // test the regex + if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) { + return i; + } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) { + return i; + } else if (!strict && this._monthsParse[i].test(monthName)) { + return i; } - var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; - return input == null ? weekday : this.add(input - weekday, 'd'); } + } - function getSetISODayOfWeek (input) { - if (!this.isValid()) { - return input != null ? this : NaN; - } + // MOMENTS - // behaves the same as moment#day except - // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) - // as a setter, sunday should belong to the previous week. + function setMonth (mom, value) { + var dayOfMonth; - if (input != null) { - var weekday = parseIsoWeekday(input, this.localeData()); - return this.day(this.day() % 7 ? weekday : weekday - 7); - } else { - return this.day() || 7; - } + if (!mom.isValid()) { + // No op + return mom; } - var defaultWeekdaysRegex = matchWord; - function weekdaysRegex (isStrict) { - if (this._weekdaysParseExact) { - if (!hasOwnProp(this, '_weekdaysRegex')) { - computeWeekdaysParse.call(this); - } - if (isStrict) { - return this._weekdaysStrictRegex; - } else { - return this._weekdaysRegex; - } + if (typeof value === 'string') { + if (/^\d+$/.test(value)) { + value = toInt(value); } else { - if (!hasOwnProp(this, '_weekdaysRegex')) { - this._weekdaysRegex = defaultWeekdaysRegex; + value = mom.localeData().monthsParse(value); + // TODO: Another silent failure? + if (!isNumber(value)) { + return mom; } - return this._weekdaysStrictRegex && isStrict ? - this._weekdaysStrictRegex : this._weekdaysRegex; } } - var defaultWeekdaysShortRegex = matchWord; - function weekdaysShortRegex (isStrict) { - if (this._weekdaysParseExact) { - if (!hasOwnProp(this, '_weekdaysRegex')) { - computeWeekdaysParse.call(this); - } - if (isStrict) { - return this._weekdaysShortStrictRegex; - } else { - return this._weekdaysShortRegex; - } + dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value)); + mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth); + return mom; + } + + function getSetMonth (value) { + if (value != null) { + setMonth(this, value); + hooks.updateOffset(this, true); + return this; + } else { + return get(this, 'Month'); + } + } + + function getDaysInMonth () { + return daysInMonth(this.year(), this.month()); + } + + var defaultMonthsShortRegex = matchWord; + function monthsShortRegex (isStrict) { + if (this._monthsParseExact) { + if (!hasOwnProp(this, '_monthsRegex')) { + computeMonthsParse.call(this); + } + if (isStrict) { + return this._monthsShortStrictRegex; } else { - if (!hasOwnProp(this, '_weekdaysShortRegex')) { - this._weekdaysShortRegex = defaultWeekdaysShortRegex; - } - return this._weekdaysShortStrictRegex && isStrict ? - this._weekdaysShortStrictRegex : this._weekdaysShortRegex; + return this._monthsShortRegex; + } + } else { + if (!hasOwnProp(this, '_monthsShortRegex')) { + this._monthsShortRegex = defaultMonthsShortRegex; } + return this._monthsShortStrictRegex && isStrict ? + this._monthsShortStrictRegex : this._monthsShortRegex; } + } - var defaultWeekdaysMinRegex = matchWord; - function weekdaysMinRegex (isStrict) { - if (this._weekdaysParseExact) { - if (!hasOwnProp(this, '_weekdaysRegex')) { - computeWeekdaysParse.call(this); - } - if (isStrict) { - return this._weekdaysMinStrictRegex; - } else { - return this._weekdaysMinRegex; - } + var defaultMonthsRegex = matchWord; + function monthsRegex (isStrict) { + if (this._monthsParseExact) { + if (!hasOwnProp(this, '_monthsRegex')) { + computeMonthsParse.call(this); + } + if (isStrict) { + return this._monthsStrictRegex; } else { - if (!hasOwnProp(this, '_weekdaysMinRegex')) { - this._weekdaysMinRegex = defaultWeekdaysMinRegex; - } - return this._weekdaysMinStrictRegex && isStrict ? - this._weekdaysMinStrictRegex : this._weekdaysMinRegex; + return this._monthsRegex; } + } else { + if (!hasOwnProp(this, '_monthsRegex')) { + this._monthsRegex = defaultMonthsRegex; + } + return this._monthsStrictRegex && isStrict ? + this._monthsStrictRegex : this._monthsRegex; } + } + function computeMonthsParse () { + function cmpLenRev(a, b) { + return b.length - a.length; + } + + var shortPieces = [], longPieces = [], mixedPieces = [], + i, mom; + for (i = 0; i < 12; i++) { + // make the regex if we don't have it already + mom = createUTC([2000, i]); + shortPieces.push(this.monthsShort(mom, '')); + longPieces.push(this.months(mom, '')); + mixedPieces.push(this.months(mom, '')); + mixedPieces.push(this.monthsShort(mom, '')); + } + // Sorting makes sure if one month (or abbr) is a prefix of another it + // will match the longer piece. + shortPieces.sort(cmpLenRev); + longPieces.sort(cmpLenRev); + mixedPieces.sort(cmpLenRev); + for (i = 0; i < 12; i++) { + shortPieces[i] = regexEscape(shortPieces[i]); + longPieces[i] = regexEscape(longPieces[i]); + } + for (i = 0; i < 24; i++) { + mixedPieces[i] = regexEscape(mixedPieces[i]); + } + + this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); + this._monthsShortRegex = this._monthsRegex; + this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i'); + this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i'); + } - function computeWeekdaysParse () { - function cmpLenRev(a, b) { - return b.length - a.length; - } + // FORMATTING - var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [], - i, mom, minp, shortp, longp; - for (i = 0; i < 7; i++) { - // make the regex if we don't have it already - mom = create_utc__createUTC([2000, 1]).day(i); - minp = this.weekdaysMin(mom, ''); - shortp = this.weekdaysShort(mom, ''); - longp = this.weekdays(mom, ''); - minPieces.push(minp); - shortPieces.push(shortp); - longPieces.push(longp); - mixedPieces.push(minp); - mixedPieces.push(shortp); - mixedPieces.push(longp); - } - // Sorting makes sure if one weekday (or abbr) is a prefix of another it - // will match the longer piece. - minPieces.sort(cmpLenRev); - shortPieces.sort(cmpLenRev); - longPieces.sort(cmpLenRev); - mixedPieces.sort(cmpLenRev); - for (i = 0; i < 7; i++) { - shortPieces[i] = regexEscape(shortPieces[i]); - longPieces[i] = regexEscape(longPieces[i]); - mixedPieces[i] = regexEscape(mixedPieces[i]); - } + addFormatToken('Y', 0, 0, function () { + var y = this.year(); + return y <= 9999 ? '' + y : '+' + y; + }); + + addFormatToken(0, ['YY', 2], 0, function () { + return this.year() % 100; + }); + + addFormatToken(0, ['YYYY', 4], 0, 'year'); + addFormatToken(0, ['YYYYY', 5], 0, 'year'); + addFormatToken(0, ['YYYYYY', 6, true], 0, 'year'); + + // ALIASES + + addUnitAlias('year', 'y'); + + // PRIORITIES + + addUnitPriority('year', 1); + + // PARSING + + addRegexToken('Y', matchSigned); + addRegexToken('YY', match1to2, match2); + addRegexToken('YYYY', match1to4, match4); + addRegexToken('YYYYY', match1to6, match6); + addRegexToken('YYYYYY', match1to6, match6); + + addParseToken(['YYYYY', 'YYYYYY'], YEAR); + addParseToken('YYYY', function (input, array) { + array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input); + }); + addParseToken('YY', function (input, array) { + array[YEAR] = hooks.parseTwoDigitYear(input); + }); + addParseToken('Y', function (input, array) { + array[YEAR] = parseInt(input, 10); + }); + + // HELPERS + + function daysInYear(year) { + return isLeapYear(year) ? 366 : 365; + } + + function isLeapYear(year) { + return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; + } + + // HOOKS + + hooks.parseTwoDigitYear = function (input) { + return toInt(input) + (toInt(input) > 68 ? 1900 : 2000); + }; + + // MOMENTS + + var getSetYear = makeGetSet('FullYear', true); + + function getIsLeapYear () { + return isLeapYear(this.year()); + } - this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); - this._weekdaysShortRegex = this._weekdaysRegex; - this._weekdaysMinRegex = this._weekdaysRegex; + function createDate (y, m, d, h, M, s, ms) { + //can't just apply() to create a date: + //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply + var date = new Date(y, m, d, h, M, s, ms); - this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i'); - this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i'); - this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i'); + //the date constructor remaps years 0-99 to 1900-1999 + if (y < 100 && y >= 0 && isFinite(date.getFullYear())) { + date.setFullYear(y); } + return date; + } - // FORMATTING + function createUTCDate (y) { + var date = new Date(Date.UTC.apply(null, arguments)); - function hFormat() { - return this.hours() % 12 || 12; + //the Date.UTC function remaps years 0-99 to 1900-1999 + if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) { + date.setUTCFullYear(y); } + return date; + } + + // start-of-first-week - start-of-year + function firstWeekOffset(year, dow, doy) { + var // first-week day -- which january is always in the first week (4 for iso, 1 for other) + fwd = 7 + dow - doy, + // first-week day local weekday -- which local weekday is fwd + fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7; + + return -fwdlw + fwd - 1; + } - function kFormat() { - return this.hours() || 24; + //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday + function dayOfYearFromWeeks(year, week, weekday, dow, doy) { + var localWeekday = (7 + weekday - dow) % 7, + weekOffset = firstWeekOffset(year, dow, doy), + dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, + resYear, resDayOfYear; + + if (dayOfYear <= 0) { + resYear = year - 1; + resDayOfYear = daysInYear(resYear) + dayOfYear; + } else if (dayOfYear > daysInYear(year)) { + resYear = year + 1; + resDayOfYear = dayOfYear - daysInYear(year); + } else { + resYear = year; + resDayOfYear = dayOfYear; } - addFormatToken('H', ['HH', 2], 0, 'hour'); - addFormatToken('h', ['hh', 2], 0, hFormat); - addFormatToken('k', ['kk', 2], 0, kFormat); + return { + year: resYear, + dayOfYear: resDayOfYear + }; + } - addFormatToken('hmm', 0, 0, function () { - return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2); - }); + function weekOfYear(mom, dow, doy) { + var weekOffset = firstWeekOffset(mom.year(), dow, doy), + week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, + resWeek, resYear; + + if (week < 1) { + resYear = mom.year() - 1; + resWeek = week + weeksInYear(resYear, dow, doy); + } else if (week > weeksInYear(mom.year(), dow, doy)) { + resWeek = week - weeksInYear(mom.year(), dow, doy); + resYear = mom.year() + 1; + } else { + resYear = mom.year(); + resWeek = week; + } - addFormatToken('hmmss', 0, 0, function () { - return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) + - zeroFill(this.seconds(), 2); - }); + return { + week: resWeek, + year: resYear + }; + } - addFormatToken('Hmm', 0, 0, function () { - return '' + this.hours() + zeroFill(this.minutes(), 2); - }); + function weeksInYear(year, dow, doy) { + var weekOffset = firstWeekOffset(year, dow, doy), + weekOffsetNext = firstWeekOffset(year + 1, dow, doy); + return (daysInYear(year) - weekOffset + weekOffsetNext) / 7; + } - addFormatToken('Hmmss', 0, 0, function () { - return '' + this.hours() + zeroFill(this.minutes(), 2) + - zeroFill(this.seconds(), 2); - }); + // FORMATTING - function meridiem (token, lowercase) { - addFormatToken(token, 0, 0, function () { - return this.localeData().meridiem(this.hours(), this.minutes(), lowercase); - }); - } + addFormatToken('w', ['ww', 2], 'wo', 'week'); + addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); - meridiem('a', true); - meridiem('A', false); + // ALIASES - // ALIASES + addUnitAlias('week', 'w'); + addUnitAlias('isoWeek', 'W'); - addUnitAlias('hour', 'h'); + // PRIORITIES - // PRIORITY - addUnitPriority('hour', 13); + addUnitPriority('week', 5); + addUnitPriority('isoWeek', 5); - // PARSING + // PARSING - function matchMeridiem (isStrict, locale) { - return locale._meridiemParse; - } + addRegexToken('w', match1to2); + addRegexToken('ww', match1to2, match2); + addRegexToken('W', match1to2); + addRegexToken('WW', match1to2, match2); - addRegexToken('a', matchMeridiem); - addRegexToken('A', matchMeridiem); - addRegexToken('H', match1to2); - addRegexToken('h', match1to2); - addRegexToken('HH', match1to2, match2); - addRegexToken('hh', match1to2, match2); + addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) { + week[token.substr(0, 1)] = toInt(input); + }); - addRegexToken('hmm', match3to4); - addRegexToken('hmmss', match5to6); - addRegexToken('Hmm', match3to4); - addRegexToken('Hmmss', match5to6); + // HELPERS - addParseToken(['H', 'HH'], HOUR); - addParseToken(['a', 'A'], function (input, array, config) { - config._isPm = config._locale.isPM(input); - config._meridiem = input; - }); - addParseToken(['h', 'hh'], function (input, array, config) { - array[HOUR] = toInt(input); - getParsingFlags(config).bigHour = true; - }); - addParseToken('hmm', function (input, array, config) { - var pos = input.length - 2; - array[HOUR] = toInt(input.substr(0, pos)); - array[MINUTE] = toInt(input.substr(pos)); - getParsingFlags(config).bigHour = true; - }); - addParseToken('hmmss', function (input, array, config) { - var pos1 = input.length - 4; - var pos2 = input.length - 2; - array[HOUR] = toInt(input.substr(0, pos1)); - array[MINUTE] = toInt(input.substr(pos1, 2)); - array[SECOND] = toInt(input.substr(pos2)); - getParsingFlags(config).bigHour = true; - }); - addParseToken('Hmm', function (input, array, config) { - var pos = input.length - 2; - array[HOUR] = toInt(input.substr(0, pos)); - array[MINUTE] = toInt(input.substr(pos)); - }); - addParseToken('Hmmss', function (input, array, config) { - var pos1 = input.length - 4; - var pos2 = input.length - 2; - array[HOUR] = toInt(input.substr(0, pos1)); - array[MINUTE] = toInt(input.substr(pos1, 2)); - array[SECOND] = toInt(input.substr(pos2)); - }); + // LOCALES - // LOCALES + function localeWeek (mom) { + return weekOfYear(mom, this._week.dow, this._week.doy).week; + } - function localeIsPM (input) { - // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays - // Using charAt should be more compatible. - return ((input + '').toLowerCase().charAt(0) === 'p'); - } + var defaultLocaleWeek = { + dow : 0, // Sunday is the first day of the week. + doy : 6 // The week that contains Jan 1st is the first week of the year. + }; - var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i; - function localeMeridiem (hours, minutes, isLower) { - if (hours > 11) { - return isLower ? 'pm' : 'PM'; - } else { - return isLower ? 'am' : 'AM'; - } + function localeFirstDayOfWeek () { + return this._week.dow; + } + + function localeFirstDayOfYear () { + return this._week.doy; + } + + // MOMENTS + + function getSetWeek (input) { + var week = this.localeData().week(this); + return input == null ? week : this.add((input - week) * 7, 'd'); + } + + function getSetISOWeek (input) { + var week = weekOfYear(this, 1, 4).week; + return input == null ? week : this.add((input - week) * 7, 'd'); + } + + // FORMATTING + + addFormatToken('d', 0, 'do', 'day'); + + addFormatToken('dd', 0, 0, function (format) { + return this.localeData().weekdaysMin(this, format); + }); + + addFormatToken('ddd', 0, 0, function (format) { + return this.localeData().weekdaysShort(this, format); + }); + + addFormatToken('dddd', 0, 0, function (format) { + return this.localeData().weekdays(this, format); + }); + + addFormatToken('e', 0, 0, 'weekday'); + addFormatToken('E', 0, 0, 'isoWeekday'); + + // ALIASES + + addUnitAlias('day', 'd'); + addUnitAlias('weekday', 'e'); + addUnitAlias('isoWeekday', 'E'); + + // PRIORITY + addUnitPriority('day', 11); + addUnitPriority('weekday', 11); + addUnitPriority('isoWeekday', 11); + + // PARSING + + addRegexToken('d', match1to2); + addRegexToken('e', match1to2); + addRegexToken('E', match1to2); + addRegexToken('dd', function (isStrict, locale) { + return locale.weekdaysMinRegex(isStrict); + }); + addRegexToken('ddd', function (isStrict, locale) { + return locale.weekdaysShortRegex(isStrict); + }); + addRegexToken('dddd', function (isStrict, locale) { + return locale.weekdaysRegex(isStrict); + }); + + addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) { + var weekday = config._locale.weekdaysParse(input, token, config._strict); + // if we didn't get a weekday name, mark the date as invalid + if (weekday != null) { + week.d = weekday; + } else { + getParsingFlags(config).invalidWeekday = input; } + }); + addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) { + week[token] = toInt(input); + }); - // MOMENTS + // HELPERS - // Setting the hour should keep the time, because the user explicitly - // specified which hour he wants. So trying to maintain the same hour (in - // a new timezone) makes sense. Adding/subtracting hours does not follow - // this rule. - var getSetHour = makeGetSet('Hours', true); + function parseWeekday(input, locale) { + if (typeof input !== 'string') { + return input; + } - var baseConfig = { - calendar: defaultCalendar, - longDateFormat: defaultLongDateFormat, - invalidDate: defaultInvalidDate, - ordinal: defaultOrdinal, - ordinalParse: defaultOrdinalParse, - relativeTime: defaultRelativeTime, + if (!isNaN(input)) { + return parseInt(input, 10); + } - months: defaultLocaleMonths, - monthsShort: defaultLocaleMonthsShort, + input = locale.weekdaysParse(input); + if (typeof input === 'number') { + return input; + } - week: defaultLocaleWeek, + return null; + } - weekdays: defaultLocaleWeekdays, - weekdaysMin: defaultLocaleWeekdaysMin, - weekdaysShort: defaultLocaleWeekdaysShort, + function parseIsoWeekday(input, locale) { + if (typeof input === 'string') { + return locale.weekdaysParse(input) % 7 || 7; + } + return isNaN(input) ? null : input; + } - meridiemParse: defaultLocaleMeridiemParse - }; + // LOCALES - // internal storage for locale config files - var locales = {}; - var globalLocale; - - function normalizeLocale(key) { - return key ? key.toLowerCase().replace('_', '-') : key; - } - - // pick the locale from the array - // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each - // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root - function chooseLocale(names) { - var i = 0, j, next, locale, split; - - while (i < names.length) { - split = normalizeLocale(names[i]).split('-'); - j = split.length; - next = normalizeLocale(names[i + 1]); - next = next ? next.split('-') : null; - while (j > 0) { - locale = loadLocale(split.slice(0, j).join('-')); - if (locale) { - return locale; - } - if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) { - //the next array item is better than a shallower substring of this one - break; - } - j--; - } - i++; - } - return null; + var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'); + function localeWeekdays (m, format) { + if (!m) { + return this._weekdays; } + return isArray(this._weekdays) ? this._weekdays[m.day()] : + this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()]; + } + + var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'); + function localeWeekdaysShort (m) { + return (m) ? this._weekdaysShort[m.day()] : this._weekdaysShort; + } - function loadLocale(name) { - var oldLocale = null; - // TODO: Find a better way to register and load all the locales in Node - if (!locales[name] && (typeof module !== 'undefined') && - module && module.exports) { - try { - oldLocale = globalLocale._abbr; - !(function webpackMissingModule() { var e = new Error("Cannot find module \"./locale\""); e.code = 'MODULE_NOT_FOUND'; throw e; }()); - // because defineLocale currently also sets the global locale, we - // want to undo that for lazy loaded locales - locale_locales__getSetGlobalLocale(oldLocale); - } catch (e) { } + var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'); + function localeWeekdaysMin (m) { + return (m) ? this._weekdaysMin[m.day()] : this._weekdaysMin; + } + + function handleStrictParse$1(weekdayName, format, strict) { + var i, ii, mom, llc = weekdayName.toLocaleLowerCase(); + if (!this._weekdaysParse) { + this._weekdaysParse = []; + this._shortWeekdaysParse = []; + this._minWeekdaysParse = []; + + for (i = 0; i < 7; ++i) { + mom = createUTC([2000, 1]).day(i); + this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase(); + this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase(); + this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase(); } - return locales[name]; } - // This function will load locale and then set the global locale. If - // no arguments are passed in, it will simply return the current global - // locale key. - function locale_locales__getSetGlobalLocale (key, values) { - var data; - if (key) { - if (isUndefined(values)) { - data = locale_locales__getLocale(key); + if (strict) { + if (format === 'dddd') { + ii = indexOf$1.call(this._weekdaysParse, llc); + return ii !== -1 ? ii : null; + } else if (format === 'ddd') { + ii = indexOf$1.call(this._shortWeekdaysParse, llc); + return ii !== -1 ? ii : null; + } else { + ii = indexOf$1.call(this._minWeekdaysParse, llc); + return ii !== -1 ? ii : null; + } + } else { + if (format === 'dddd') { + ii = indexOf$1.call(this._weekdaysParse, llc); + if (ii !== -1) { + return ii; } - else { - data = defineLocale(key, values); + ii = indexOf$1.call(this._shortWeekdaysParse, llc); + if (ii !== -1) { + return ii; } - - if (data) { - // moment.duration._locale = moment._locale = data; - globalLocale = data; + ii = indexOf$1.call(this._minWeekdaysParse, llc); + return ii !== -1 ? ii : null; + } else if (format === 'ddd') { + ii = indexOf$1.call(this._shortWeekdaysParse, llc); + if (ii !== -1) { + return ii; } + ii = indexOf$1.call(this._weekdaysParse, llc); + if (ii !== -1) { + return ii; + } + ii = indexOf$1.call(this._minWeekdaysParse, llc); + return ii !== -1 ? ii : null; + } else { + ii = indexOf$1.call(this._minWeekdaysParse, llc); + if (ii !== -1) { + return ii; + } + ii = indexOf$1.call(this._weekdaysParse, llc); + if (ii !== -1) { + return ii; + } + ii = indexOf$1.call(this._shortWeekdaysParse, llc); + return ii !== -1 ? ii : null; } + } + } + + function localeWeekdaysParse (weekdayName, format, strict) { + var i, mom, regex; - return globalLocale._abbr; + if (this._weekdaysParseExact) { + return handleStrictParse$1.call(this, weekdayName, format, strict); } - function defineLocale (name, config) { - if (config !== null) { - var parentConfig = baseConfig; - config.abbr = name; - if (locales[name] != null) { - deprecateSimple('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.'); - parentConfig = locales[name]._config; - } else if (config.parentLocale != null) { - if (locales[config.parentLocale] != null) { - parentConfig = locales[config.parentLocale]._config; - } else { - // treat as if there is no base config - deprecateSimple('parentLocaleUndefined', - 'specified parentLocale is not defined yet. See http://momentjs.com/guides/#/warnings/parent-locale/'); - } - } - locales[name] = new Locale(mergeConfigs(parentConfig, config)); + if (!this._weekdaysParse) { + this._weekdaysParse = []; + this._minWeekdaysParse = []; + this._shortWeekdaysParse = []; + this._fullWeekdaysParse = []; + } - // backwards compat for now: also set the locale - locale_locales__getSetGlobalLocale(name); + for (i = 0; i < 7; i++) { + // make the regex if we don't have it already - return locales[name]; - } else { - // useful for testing - delete locales[name]; - return null; + mom = createUTC([2000, 1]).day(i); + if (strict && !this._fullWeekdaysParse[i]) { + this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\.?') + '$', 'i'); + this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\.?') + '$', 'i'); + this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\.?') + '$', 'i'); + } + if (!this._weekdaysParse[i]) { + regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, ''); + this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); + } + // test the regex + if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (!strict && this._weekdaysParse[i].test(weekdayName)) { + return i; } } + } - function updateLocale(name, config) { - if (config != null) { - var locale, parentConfig = baseConfig; - // MERGE - if (locales[name] != null) { - parentConfig = locales[name]._config; - } - config = mergeConfigs(parentConfig, config); - locale = new Locale(config); - locale.parentLocale = locales[name]; - locales[name] = locale; + // MOMENTS - // backwards compat for now: also set the locale - locale_locales__getSetGlobalLocale(name); - } else { - // pass null for config to unupdate, useful for tests - if (locales[name] != null) { - if (locales[name].parentLocale != null) { - locales[name] = locales[name].parentLocale; - } else if (locales[name] != null) { - delete locales[name]; - } - } - } - return locales[name]; + function getSetDayOfWeek (input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } + var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); + if (input != null) { + input = parseWeekday(input, this.localeData()); + return this.add(input - day, 'd'); + } else { + return day; } + } - // returns locale data - function locale_locales__getLocale (key) { - var locale; + function getSetLocaleDayOfWeek (input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } + var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; + return input == null ? weekday : this.add(input - weekday, 'd'); + } - if (key && key._locale && key._locale._abbr) { - key = key._locale._abbr; - } + function getSetISODayOfWeek (input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } - if (!key) { - return globalLocale; - } + // behaves the same as moment#day except + // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) + // as a setter, sunday should belong to the previous week. - if (!isArray(key)) { - //short-circuit everything else - locale = loadLocale(key); - if (locale) { - return locale; - } - key = [key]; + if (input != null) { + var weekday = parseIsoWeekday(input, this.localeData()); + return this.day(this.day() % 7 ? weekday : weekday - 7); + } else { + return this.day() || 7; + } + } + + var defaultWeekdaysRegex = matchWord; + function weekdaysRegex (isStrict) { + if (this._weekdaysParseExact) { + if (!hasOwnProp(this, '_weekdaysRegex')) { + computeWeekdaysParse.call(this); + } + if (isStrict) { + return this._weekdaysStrictRegex; + } else { + return this._weekdaysRegex; } + } else { + if (!hasOwnProp(this, '_weekdaysRegex')) { + this._weekdaysRegex = defaultWeekdaysRegex; + } + return this._weekdaysStrictRegex && isStrict ? + this._weekdaysStrictRegex : this._weekdaysRegex; + } + } - return chooseLocale(key); + var defaultWeekdaysShortRegex = matchWord; + function weekdaysShortRegex (isStrict) { + if (this._weekdaysParseExact) { + if (!hasOwnProp(this, '_weekdaysRegex')) { + computeWeekdaysParse.call(this); + } + if (isStrict) { + return this._weekdaysShortStrictRegex; + } else { + return this._weekdaysShortRegex; + } + } else { + if (!hasOwnProp(this, '_weekdaysShortRegex')) { + this._weekdaysShortRegex = defaultWeekdaysShortRegex; + } + return this._weekdaysShortStrictRegex && isStrict ? + this._weekdaysShortStrictRegex : this._weekdaysShortRegex; } + } - function locale_locales__listLocales() { - return keys(locales); + var defaultWeekdaysMinRegex = matchWord; + function weekdaysMinRegex (isStrict) { + if (this._weekdaysParseExact) { + if (!hasOwnProp(this, '_weekdaysRegex')) { + computeWeekdaysParse.call(this); + } + if (isStrict) { + return this._weekdaysMinStrictRegex; + } else { + return this._weekdaysMinRegex; + } + } else { + if (!hasOwnProp(this, '_weekdaysMinRegex')) { + this._weekdaysMinRegex = defaultWeekdaysMinRegex; + } + return this._weekdaysMinStrictRegex && isStrict ? + this._weekdaysMinStrictRegex : this._weekdaysMinRegex; } + } - function checkOverflow (m) { - var overflow; - var a = m._a; - if (a && getParsingFlags(m).overflow === -2) { - overflow = - a[MONTH] < 0 || a[MONTH] > 11 ? MONTH : - a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE : - a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR : - a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE : - a[SECOND] < 0 || a[SECOND] > 59 ? SECOND : - a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND : - -1; + function computeWeekdaysParse () { + function cmpLenRev(a, b) { + return b.length - a.length; + } + + var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [], + i, mom, minp, shortp, longp; + for (i = 0; i < 7; i++) { + // make the regex if we don't have it already + mom = createUTC([2000, 1]).day(i); + minp = this.weekdaysMin(mom, ''); + shortp = this.weekdaysShort(mom, ''); + longp = this.weekdays(mom, ''); + minPieces.push(minp); + shortPieces.push(shortp); + longPieces.push(longp); + mixedPieces.push(minp); + mixedPieces.push(shortp); + mixedPieces.push(longp); + } + // Sorting makes sure if one weekday (or abbr) is a prefix of another it + // will match the longer piece. + minPieces.sort(cmpLenRev); + shortPieces.sort(cmpLenRev); + longPieces.sort(cmpLenRev); + mixedPieces.sort(cmpLenRev); + for (i = 0; i < 7; i++) { + shortPieces[i] = regexEscape(shortPieces[i]); + longPieces[i] = regexEscape(longPieces[i]); + mixedPieces[i] = regexEscape(mixedPieces[i]); + } + + this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); + this._weekdaysShortRegex = this._weekdaysRegex; + this._weekdaysMinRegex = this._weekdaysRegex; + + this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i'); + this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i'); + this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i'); + } - if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) { - overflow = DATE; - } - if (getParsingFlags(m)._overflowWeeks && overflow === -1) { - overflow = WEEK; - } - if (getParsingFlags(m)._overflowWeekday && overflow === -1) { - overflow = WEEKDAY; - } + // FORMATTING - getParsingFlags(m).overflow = overflow; - } + function hFormat() { + return this.hours() % 12 || 12; + } + + function kFormat() { + return this.hours() || 24; + } + + addFormatToken('H', ['HH', 2], 0, 'hour'); + addFormatToken('h', ['hh', 2], 0, hFormat); + addFormatToken('k', ['kk', 2], 0, kFormat); + + addFormatToken('hmm', 0, 0, function () { + return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2); + }); + + addFormatToken('hmmss', 0, 0, function () { + return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) + + zeroFill(this.seconds(), 2); + }); + + addFormatToken('Hmm', 0, 0, function () { + return '' + this.hours() + zeroFill(this.minutes(), 2); + }); + + addFormatToken('Hmmss', 0, 0, function () { + return '' + this.hours() + zeroFill(this.minutes(), 2) + + zeroFill(this.seconds(), 2); + }); + + function meridiem (token, lowercase) { + addFormatToken(token, 0, 0, function () { + return this.localeData().meridiem(this.hours(), this.minutes(), lowercase); + }); + } + + meridiem('a', true); + meridiem('A', false); + + // ALIASES + + addUnitAlias('hour', 'h'); + + // PRIORITY + addUnitPriority('hour', 13); + + // PARSING + + function matchMeridiem (isStrict, locale) { + return locale._meridiemParse; + } + + addRegexToken('a', matchMeridiem); + addRegexToken('A', matchMeridiem); + addRegexToken('H', match1to2); + addRegexToken('h', match1to2); + addRegexToken('HH', match1to2, match2); + addRegexToken('hh', match1to2, match2); + + addRegexToken('hmm', match3to4); + addRegexToken('hmmss', match5to6); + addRegexToken('Hmm', match3to4); + addRegexToken('Hmmss', match5to6); + + addParseToken(['H', 'HH'], HOUR); + addParseToken(['a', 'A'], function (input, array, config) { + config._isPm = config._locale.isPM(input); + config._meridiem = input; + }); + addParseToken(['h', 'hh'], function (input, array, config) { + array[HOUR] = toInt(input); + getParsingFlags(config).bigHour = true; + }); + addParseToken('hmm', function (input, array, config) { + var pos = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos)); + array[MINUTE] = toInt(input.substr(pos)); + getParsingFlags(config).bigHour = true; + }); + addParseToken('hmmss', function (input, array, config) { + var pos1 = input.length - 4; + var pos2 = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos1)); + array[MINUTE] = toInt(input.substr(pos1, 2)); + array[SECOND] = toInt(input.substr(pos2)); + getParsingFlags(config).bigHour = true; + }); + addParseToken('Hmm', function (input, array, config) { + var pos = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos)); + array[MINUTE] = toInt(input.substr(pos)); + }); + addParseToken('Hmmss', function (input, array, config) { + var pos1 = input.length - 4; + var pos2 = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos1)); + array[MINUTE] = toInt(input.substr(pos1, 2)); + array[SECOND] = toInt(input.substr(pos2)); + }); + + // LOCALES - return m; + function localeIsPM (input) { + // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays + // Using charAt should be more compatible. + return ((input + '').toLowerCase().charAt(0) === 'p'); + } + + var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i; + function localeMeridiem (hours, minutes, isLower) { + if (hours > 11) { + return isLower ? 'pm' : 'PM'; + } else { + return isLower ? 'am' : 'AM'; } + } - // iso 8601 regex - // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) - var extendedIsoRegex = /^\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)?)?/; - var basicIsoRegex = /^\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)?)?/; - var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/; + // MOMENTS - var isoDates = [ - ['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/, false], - ['YYYY-DDD', /\d{4}-\d{3}/], - ['YYYY-MM', /\d{4}-\d\d/, false], - ['YYYYYYMMDD', /[+-]\d{10}/], - ['YYYYMMDD', /\d{8}/], - // YYYYMM is NOT allowed by the standard - ['GGGG[W]WWE', /\d{4}W\d{3}/], - ['GGGG[W]WW', /\d{4}W\d{2}/, false], - ['YYYYDDD', /\d{7}/] - ]; + // Setting the hour should keep the time, because the user explicitly + // specified which hour he wants. So trying to maintain the same hour (in + // a new timezone) makes sense. Adding/subtracting hours does not follow + // this rule. + var getSetHour = makeGetSet('Hours', true); - // iso time formats and regexes - var isoTimes = [ - ['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/] - ]; + // months + // week + // weekdays + // meridiem + var baseConfig = { + calendar: defaultCalendar, + longDateFormat: defaultLongDateFormat, + invalidDate: defaultInvalidDate, + ordinal: defaultOrdinal, + ordinalParse: defaultOrdinalParse, + relativeTime: defaultRelativeTime, - var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i; + months: defaultLocaleMonths, + monthsShort: defaultLocaleMonthsShort, - // date from iso format - function configFromISO(config) { - var i, l, - string = config._i, - match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), - allowTime, dateFormat, timeFormat, tzFormat; + week: defaultLocaleWeek, - if (match) { - getParsingFlags(config).iso = true; + weekdays: defaultLocaleWeekdays, + weekdaysMin: defaultLocaleWeekdaysMin, + weekdaysShort: defaultLocaleWeekdaysShort, - for (i = 0, l = isoDates.length; i < l; i++) { - if (isoDates[i][1].exec(match[1])) { - dateFormat = isoDates[i][0]; - allowTime = isoDates[i][2] !== false; - break; - } - } - if (dateFormat == null) { - config._isValid = false; - return; - } - if (match[3]) { - for (i = 0, l = isoTimes.length; i < l; i++) { - if (isoTimes[i][1].exec(match[3])) { - // match[2] should be 'T' or space - timeFormat = (match[2] || ' ') + isoTimes[i][0]; - break; - } - } - if (timeFormat == null) { - config._isValid = false; - return; - } - } - if (!allowTime && timeFormat != null) { - config._isValid = false; - return; + meridiemParse: defaultLocaleMeridiemParse + }; + + // internal storage for locale config files + var locales = {}; + var localeFamilies = {}; + var globalLocale; + + function normalizeLocale(key) { + return key ? key.toLowerCase().replace('_', '-') : key; + } + + // pick the locale from the array + // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each + // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root + function chooseLocale(names) { + var i = 0, j, next, locale, split; + + while (i < names.length) { + split = normalizeLocale(names[i]).split('-'); + j = split.length; + next = normalizeLocale(names[i + 1]); + next = next ? next.split('-') : null; + while (j > 0) { + locale = loadLocale(split.slice(0, j).join('-')); + if (locale) { + return locale; } - if (match[4]) { - if (tzRegex.exec(match[4])) { - tzFormat = 'Z'; - } else { - config._isValid = false; - return; - } + if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) { + //the next array item is better than a shallower substring of this one + break; } - config._f = dateFormat + (timeFormat || '') + (tzFormat || ''); - configFromStringAndFormat(config); - } else { - config._isValid = false; + j--; } + i++; } + return null; + } - // date from iso format or fallback - function configFromString(config) { - var matched = aspNetJsonRegex.exec(config._i); + function loadLocale(name) { + var oldLocale = null; + // TODO: Find a better way to register and load all the locales in Node + if (!locales[name] && (typeof module !== 'undefined') && + module && module.exports) { + try { + oldLocale = globalLocale._abbr; + !(function webpackMissingModule() { var e = new Error("Cannot find module \"./locale\""); e.code = 'MODULE_NOT_FOUND'; throw e; }()); + // because defineLocale currently also sets the global locale, we + // want to undo that for lazy loaded locales + getSetGlobalLocale(oldLocale); + } catch (e) { } + } + return locales[name]; + } - if (matched !== null) { - config._d = new Date(+matched[1]); - return; + // This function will load locale and then set the global locale. If + // no arguments are passed in, it will simply return the current global + // locale key. + function getSetGlobalLocale (key, values) { + var data; + if (key) { + if (isUndefined(values)) { + data = getLocale(key); + } + else { + data = defineLocale(key, values); } - configFromISO(config); - if (config._isValid === false) { - delete config._isValid; - utils_hooks__hooks.createFromInputFallback(config); + if (data) { + // moment.duration._locale = moment._locale = data; + globalLocale = data; } } - utils_hooks__hooks.createFromInputFallback = deprecate( - 'value provided is not in a recognized ISO format. moment construction falls back to js Date(), ' + - 'which is not reliable across all browsers and versions. Non 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 (config) { - config._d = new Date(config._i + (config._useUTC ? ' UTC' : '')); - } - ); + return globalLocale._abbr; + } - // Pick the first defined of two or three arguments. - function defaults(a, b, c) { - if (a != null) { - return a; + function defineLocale (name, config) { + if (config !== null) { + var parentConfig = baseConfig; + config.abbr = name; + if (locales[name] != null) { + deprecateSimple('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.'); + parentConfig = locales[name]._config; + } else if (config.parentLocale != null) { + if (locales[config.parentLocale] != null) { + parentConfig = locales[config.parentLocale]._config; + } else { + if (!localeFamilies[config.parentLocale]) { + localeFamilies[config.parentLocale] = []; + } + localeFamilies[config.parentLocale].push({ + name: name, + config: config + }); + return null; + } } - if (b != null) { - return b; + locales[name] = new Locale(mergeConfigs(parentConfig, config)); + + if (localeFamilies[name]) { + localeFamilies[name].forEach(function (x) { + defineLocale(x.name, x.config); + }); } - return c; + + // backwards compat for now: also set the locale + // make sure we set the locale AFTER all child locales have been + // created, so we won't end up with the child locale set. + getSetGlobalLocale(name); + + + return locales[name]; + } else { + // useful for testing + delete locales[name]; + return null; } + } + + function updateLocale(name, config) { + if (config != null) { + var locale, parentConfig = baseConfig; + // MERGE + if (locales[name] != null) { + parentConfig = locales[name]._config; + } + config = mergeConfigs(parentConfig, config); + locale = new Locale(config); + locale.parentLocale = locales[name]; + locales[name] = locale; - function currentDateArray(config) { - // hooks is actually the exported moment object - var nowValue = new Date(utils_hooks__hooks.now()); - if (config._useUTC) { - return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()]; + // backwards compat for now: also set the locale + getSetGlobalLocale(name); + } else { + // pass null for config to unupdate, useful for tests + if (locales[name] != null) { + if (locales[name].parentLocale != null) { + locales[name] = locales[name].parentLocale; + } else if (locales[name] != null) { + delete locales[name]; + } } - return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()]; } + return locales[name]; + } - // convert an array to a date. - // the array should mirror the parameters below - // note: all values past the year are optional and will default to the lowest possible value. - // [year, month, day , hour, minute, second, millisecond] - function configFromArray (config) { - var i, date, input = [], currentDate, yearToUse; + // returns locale data + function getLocale (key) { + var locale; - if (config._d) { - return; - } + if (key && key._locale && key._locale._abbr) { + key = key._locale._abbr; + } - currentDate = currentDateArray(config); + if (!key) { + return globalLocale; + } - //compute day of the year from weeks and weekdays - if (config._w && config._a[DATE] == null && config._a[MONTH] == null) { - dayOfYearFromWeekInfo(config); + if (!isArray(key)) { + //short-circuit everything else + locale = loadLocale(key); + if (locale) { + return locale; } + key = [key]; + } - //if the day of the year is set, figure out what it is - if (config._dayOfYear) { - yearToUse = defaults(config._a[YEAR], currentDate[YEAR]); + return chooseLocale(key); + } - if (config._dayOfYear > daysInYear(yearToUse)) { - getParsingFlags(config)._overflowDayOfYear = true; - } + function listLocales() { + return keys$1(locales); + } - date = createUTCDate(yearToUse, 0, config._dayOfYear); - config._a[MONTH] = date.getUTCMonth(); - config._a[DATE] = date.getUTCDate(); - } + function checkOverflow (m) { + var overflow; + var a = m._a; - // Default to current date. - // * if no year, month, day of month are given, default to today - // * if day of month is given, default month and year - // * if month is given, default only year - // * if year is given, don't default anything - for (i = 0; i < 3 && config._a[i] == null; ++i) { - config._a[i] = input[i] = currentDate[i]; - } + if (a && getParsingFlags(m).overflow === -2) { + overflow = + a[MONTH] < 0 || a[MONTH] > 11 ? MONTH : + a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE : + a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR : + a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE : + a[SECOND] < 0 || a[SECOND] > 59 ? SECOND : + a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND : + -1; - // Zero out whatever was not defaulted, including time - for (; i < 7; i++) { - config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i]; + if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) { + overflow = DATE; } - - // Check for 24:00:00.000 - if (config._a[HOUR] === 24 && - config._a[MINUTE] === 0 && - config._a[SECOND] === 0 && - config._a[MILLISECOND] === 0) { - config._nextDay = true; - config._a[HOUR] = 0; + if (getParsingFlags(m)._overflowWeeks && overflow === -1) { + overflow = WEEK; } - - config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input); - // Apply timezone offset from input. The actual utcOffset can be changed - // with parseZone. - if (config._tzm != null) { - config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); + if (getParsingFlags(m)._overflowWeekday && overflow === -1) { + overflow = WEEKDAY; } - if (config._nextDay) { - config._a[HOUR] = 24; - } + getParsingFlags(m).overflow = overflow; } - function dayOfYearFromWeekInfo(config) { - var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow; - - w = config._w; - if (w.GG != null || w.W != null || w.E != null) { - dow = 1; - doy = 4; + return m; + } - // TODO: We need to take the current isoWeekYear, but that depends on - // how we interpret now (local, utc, fixed offset). So create - // a now version of current config (take local/utc/offset flags, and - // create now). - weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(local__createLocal(), 1, 4).year); - week = defaults(w.W, 1); - weekday = defaults(w.E, 1); - if (weekday < 1 || weekday > 7) { - weekdayOverflow = true; - } - } else { - dow = config._locale._week.dow; - doy = config._locale._week.doy; + // iso 8601 regex + // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) + var extendedIsoRegex = /^\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)?)?$/; + var basicIsoRegex = /^\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)?)?$/; + + var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/; + + var isoDates = [ + ['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/, false], + ['YYYY-DDD', /\d{4}-\d{3}/], + ['YYYY-MM', /\d{4}-\d\d/, false], + ['YYYYYYMMDD', /[+-]\d{10}/], + ['YYYYMMDD', /\d{8}/], + // YYYYMM is NOT allowed by the standard + ['GGGG[W]WWE', /\d{4}W\d{3}/], + ['GGGG[W]WW', /\d{4}W\d{2}/, false], + ['YYYYDDD', /\d{7}/] + ]; + + // iso time formats and regexes + var isoTimes = [ + ['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/] + ]; + + var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i; + + // date from iso format + function configFromISO(config) { + var i, l, + string = config._i, + match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), + allowTime, dateFormat, timeFormat, tzFormat; - weekYear = defaults(w.gg, config._a[YEAR], weekOfYear(local__createLocal(), dow, doy).year); - week = defaults(w.w, 1); + if (match) { + getParsingFlags(config).iso = true; - if (w.d != null) { - // weekday -- low day numbers are considered next week - weekday = w.d; - if (weekday < 0 || weekday > 6) { - weekdayOverflow = true; - } - } else if (w.e != null) { - // local weekday -- counting starts from begining of week - weekday = w.e + dow; - if (w.e < 0 || w.e > 6) { - weekdayOverflow = true; + for (i = 0, l = isoDates.length; i < l; i++) { + if (isoDates[i][1].exec(match[1])) { + dateFormat = isoDates[i][0]; + allowTime = isoDates[i][2] !== false; + break; + } + } + if (dateFormat == null) { + config._isValid = false; + return; + } + if (match[3]) { + for (i = 0, l = isoTimes.length; i < l; i++) { + if (isoTimes[i][1].exec(match[3])) { + // match[2] should be 'T' or space + timeFormat = (match[2] || ' ') + isoTimes[i][0]; + break; } - } else { - // default to begining of week - weekday = dow; + } + if (timeFormat == null) { + config._isValid = false; + return; } } - if (week < 1 || week > weeksInYear(weekYear, dow, doy)) { - getParsingFlags(config)._overflowWeeks = true; - } else if (weekdayOverflow != null) { - getParsingFlags(config)._overflowWeekday = true; - } else { - temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy); - config._a[YEAR] = temp.year; - config._dayOfYear = temp.dayOfYear; + if (!allowTime && timeFormat != null) { + config._isValid = false; + return; } + if (match[4]) { + if (tzRegex.exec(match[4])) { + tzFormat = 'Z'; + } else { + config._isValid = false; + return; + } + } + config._f = dateFormat + (timeFormat || '') + (tzFormat || ''); + configFromStringAndFormat(config); + } else { + config._isValid = false; } + } - // constant that refers to the ISO standard - utils_hooks__hooks.ISO_8601 = function () {}; + // date from iso format or fallback + function configFromString(config) { + var matched = aspNetJsonRegex.exec(config._i); - // date from string and format string - function configFromStringAndFormat(config) { - // TODO: Move this to another part of the creation flow to prevent circular deps - if (config._f === utils_hooks__hooks.ISO_8601) { - configFromISO(config); - return; - } + if (matched !== null) { + config._d = new Date(+matched[1]); + return; + } - config._a = []; - getParsingFlags(config).empty = true; + configFromISO(config); + if (config._isValid === false) { + delete config._isValid; + hooks.createFromInputFallback(config); + } + } - // This array is used to make a Date, either with `new Date` or `Date.UTC` - var string = '' + config._i, - i, parsedInput, tokens, token, skipped, - stringLength = string.length, - totalParsedInputLength = 0; + hooks.createFromInputFallback = deprecate( + 'value provided is not in a recognized ISO format. moment construction falls back to js Date(), ' + + 'which is not reliable across all browsers and versions. Non 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 (config) { + config._d = new Date(config._i + (config._useUTC ? ' UTC' : '')); + } + ); - tokens = expandFormat(config._f, config._locale).match(formattingTokens) || []; + // Pick the first defined of two or three arguments. + function defaults(a, b, c) { + if (a != null) { + return a; + } + if (b != null) { + return b; + } + return c; + } - for (i = 0; i < tokens.length; i++) { - token = tokens[i]; - parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; - // console.log('token', token, 'parsedInput', parsedInput, - // 'regex', getParseRegexForToken(token, config)); - if (parsedInput) { - skipped = string.substr(0, string.indexOf(parsedInput)); - if (skipped.length > 0) { - getParsingFlags(config).unusedInput.push(skipped); - } - string = string.slice(string.indexOf(parsedInput) + parsedInput.length); - totalParsedInputLength += parsedInput.length; - } - // don't parse if it's not a known token - if (formatTokenFunctions[token]) { - if (parsedInput) { - getParsingFlags(config).empty = false; - } - else { - getParsingFlags(config).unusedTokens.push(token); - } - addTimeToArrayFromToken(token, parsedInput, config); - } - else if (config._strict && !parsedInput) { - getParsingFlags(config).unusedTokens.push(token); - } - } + function currentDateArray(config) { + // hooks is actually the exported moment object + var nowValue = new Date(hooks.now()); + if (config._useUTC) { + return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()]; + } + return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()]; + } - // add remaining unparsed input length to the string - getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength; - if (string.length > 0) { - getParsingFlags(config).unusedInput.push(string); - } + // convert an array to a date. + // the array should mirror the parameters below + // note: all values past the year are optional and will default to the lowest possible value. + // [year, month, day , hour, minute, second, millisecond] + function configFromArray (config) { + var i, date, input = [], currentDate, yearToUse; + + if (config._d) { + return; + } + + currentDate = currentDateArray(config); + + //compute day of the year from weeks and weekdays + if (config._w && config._a[DATE] == null && config._a[MONTH] == null) { + dayOfYearFromWeekInfo(config); + } - // clear _12h flag if hour is <= 12 - if (config._a[HOUR] <= 12 && - getParsingFlags(config).bigHour === true && - config._a[HOUR] > 0) { - getParsingFlags(config).bigHour = undefined; + //if the day of the year is set, figure out what it is + if (config._dayOfYear) { + yearToUse = defaults(config._a[YEAR], currentDate[YEAR]); + + if (config._dayOfYear > daysInYear(yearToUse)) { + getParsingFlags(config)._overflowDayOfYear = true; } - getParsingFlags(config).parsedDateParts = config._a.slice(0); - getParsingFlags(config).meridiem = config._meridiem; - // handle meridiem - config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem); + date = createUTCDate(yearToUse, 0, config._dayOfYear); + config._a[MONTH] = date.getUTCMonth(); + config._a[DATE] = date.getUTCDate(); + } - configFromArray(config); - checkOverflow(config); + // Default to current date. + // * if no year, month, day of month are given, default to today + // * if day of month is given, default month and year + // * if month is given, default only year + // * if year is given, don't default anything + for (i = 0; i < 3 && config._a[i] == null; ++i) { + config._a[i] = input[i] = currentDate[i]; } + // Zero out whatever was not defaulted, including time + for (; i < 7; i++) { + config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i]; + } - function meridiemFixWrap (locale, hour, meridiem) { - var isPm; + // Check for 24:00:00.000 + if (config._a[HOUR] === 24 && + config._a[MINUTE] === 0 && + config._a[SECOND] === 0 && + config._a[MILLISECOND] === 0) { + config._nextDay = true; + config._a[HOUR] = 0; + } - if (meridiem == null) { - // nothing to do - return hour; - } - if (locale.meridiemHour != null) { - return locale.meridiemHour(hour, meridiem); - } else if (locale.isPM != null) { - // Fallback - isPm = locale.isPM(meridiem); - if (isPm && hour < 12) { - hour += 12; - } - if (!isPm && hour === 12) { - hour = 0; - } - return hour; - } else { - // this is not supposed to happen - return hour; - } + config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input); + // Apply timezone offset from input. The actual utcOffset can be changed + // with parseZone. + if (config._tzm != null) { + config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); } - // date from string and array of format strings - function configFromStringAndArray(config) { - var tempConfig, - bestMoment, + if (config._nextDay) { + config._a[HOUR] = 24; + } + } - scoreToBeat, - i, - currentScore; + function dayOfYearFromWeekInfo(config) { + var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow; - if (config._f.length === 0) { - getParsingFlags(config).invalidFormat = true; - config._d = new Date(NaN); - return; + w = config._w; + if (w.GG != null || w.W != null || w.E != null) { + dow = 1; + doy = 4; + + // TODO: We need to take the current isoWeekYear, but that depends on + // how we interpret now (local, utc, fixed offset). So create + // a now version of current config (take local/utc/offset flags, and + // create now). + weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year); + week = defaults(w.W, 1); + weekday = defaults(w.E, 1); + if (weekday < 1 || weekday > 7) { + weekdayOverflow = true; } + } else { + dow = config._locale._week.dow; + doy = config._locale._week.doy; - for (i = 0; i < config._f.length; i++) { - currentScore = 0; - tempConfig = copyConfig({}, config); - if (config._useUTC != null) { - tempConfig._useUTC = config._useUTC; - } - tempConfig._f = config._f[i]; - configFromStringAndFormat(tempConfig); + var curWeek = weekOfYear(createLocal(), dow, doy); - if (!valid__isValid(tempConfig)) { - continue; + weekYear = defaults(w.gg, config._a[YEAR], curWeek.year); + + // Default to current week. + week = defaults(w.w, curWeek.week); + + if (w.d != null) { + // weekday -- low day numbers are considered next week + weekday = w.d; + if (weekday < 0 || weekday > 6) { + weekdayOverflow = true; + } + } else if (w.e != null) { + // local weekday -- counting starts from begining of week + weekday = w.e + dow; + if (w.e < 0 || w.e > 6) { + weekdayOverflow = true; } + } else { + // default to begining of week + weekday = dow; + } + } + if (week < 1 || week > weeksInYear(weekYear, dow, doy)) { + getParsingFlags(config)._overflowWeeks = true; + } else if (weekdayOverflow != null) { + getParsingFlags(config)._overflowWeekday = true; + } else { + temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy); + config._a[YEAR] = temp.year; + config._dayOfYear = temp.dayOfYear; + } + } + + // constant that refers to the ISO standard + hooks.ISO_8601 = function () {}; - // if there is any input that was not parsed add a penalty for that format - currentScore += getParsingFlags(tempConfig).charsLeftOver; + // date from string and format string + function configFromStringAndFormat(config) { + // TODO: Move this to another part of the creation flow to prevent circular deps + if (config._f === hooks.ISO_8601) { + configFromISO(config); + return; + } + + config._a = []; + getParsingFlags(config).empty = true; - //or tokens - currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10; + // This array is used to make a Date, either with `new Date` or `Date.UTC` + var string = '' + config._i, + i, parsedInput, tokens, token, skipped, + stringLength = string.length, + totalParsedInputLength = 0; - getParsingFlags(tempConfig).score = currentScore; + tokens = expandFormat(config._f, config._locale).match(formattingTokens) || []; - if (scoreToBeat == null || currentScore < scoreToBeat) { - scoreToBeat = currentScore; - bestMoment = tempConfig; + for (i = 0; i < tokens.length; i++) { + token = tokens[i]; + parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; + // console.log('token', token, 'parsedInput', parsedInput, + // 'regex', getParseRegexForToken(token, config)); + if (parsedInput) { + skipped = string.substr(0, string.indexOf(parsedInput)); + if (skipped.length > 0) { + getParsingFlags(config).unusedInput.push(skipped); } + string = string.slice(string.indexOf(parsedInput) + parsedInput.length); + totalParsedInputLength += parsedInput.length; } + // don't parse if it's not a known token + if (formatTokenFunctions[token]) { + if (parsedInput) { + getParsingFlags(config).empty = false; + } + else { + getParsingFlags(config).unusedTokens.push(token); + } + addTimeToArrayFromToken(token, parsedInput, config); + } + else if (config._strict && !parsedInput) { + getParsingFlags(config).unusedTokens.push(token); + } + } - extend(config, bestMoment || tempConfig); + // add remaining unparsed input length to the string + getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength; + if (string.length > 0) { + getParsingFlags(config).unusedInput.push(string); } - function configFromObject(config) { - if (config._d) { - return; - } + // clear _12h flag if hour is <= 12 + if (config._a[HOUR] <= 12 && + getParsingFlags(config).bigHour === true && + config._a[HOUR] > 0) { + getParsingFlags(config).bigHour = undefined; + } - var i = normalizeObjectUnits(config._i); - config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) { - return obj && parseInt(obj, 10); - }); + getParsingFlags(config).parsedDateParts = config._a.slice(0); + getParsingFlags(config).meridiem = config._meridiem; + // handle meridiem + config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem); - configFromArray(config); - } + configFromArray(config); + checkOverflow(config); + } - function createFromConfig (config) { - var res = new Moment(checkOverflow(prepareConfig(config))); - if (res._nextDay) { - // Adding is smart enough around DST - res.add(1, 'd'); - res._nextDay = undefined; - } - return res; + function meridiemFixWrap (locale, hour, meridiem) { + var isPm; + + if (meridiem == null) { + // nothing to do + return hour; } + if (locale.meridiemHour != null) { + return locale.meridiemHour(hour, meridiem); + } else if (locale.isPM != null) { + // Fallback + isPm = locale.isPM(meridiem); + if (isPm && hour < 12) { + hour += 12; + } + if (!isPm && hour === 12) { + hour = 0; + } + return hour; + } else { + // this is not supposed to happen + return hour; + } + } - function prepareConfig (config) { - var input = config._i, - format = config._f; + // date from string and array of format strings + function configFromStringAndArray(config) { + var tempConfig, + bestMoment, - config._locale = config._locale || locale_locales__getLocale(config._l); + scoreToBeat, + i, + currentScore; - if (input === null || (format === undefined && input === '')) { - return valid__createInvalid({nullInput: true}); - } + if (config._f.length === 0) { + getParsingFlags(config).invalidFormat = true; + config._d = new Date(NaN); + return; + } - if (typeof input === 'string') { - config._i = input = config._locale.preparse(input); + for (i = 0; i < config._f.length; i++) { + currentScore = 0; + tempConfig = copyConfig({}, config); + if (config._useUTC != null) { + tempConfig._useUTC = config._useUTC; } + tempConfig._f = config._f[i]; + configFromStringAndFormat(tempConfig); - if (isMoment(input)) { - return new Moment(checkOverflow(input)); - } else if (isArray(format)) { - configFromStringAndArray(config); - } else if (isDate(input)) { - config._d = input; - } else if (format) { - configFromStringAndFormat(config); - } else { - configFromInput(config); + if (!isValid(tempConfig)) { + continue; } - if (!valid__isValid(config)) { - config._d = null; - } + // if there is any input that was not parsed add a penalty for that format + currentScore += getParsingFlags(tempConfig).charsLeftOver; - return config; - } + //or tokens + currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10; - function configFromInput(config) { - var input = config._i; - if (input === undefined) { - config._d = new Date(utils_hooks__hooks.now()); - } else if (isDate(input)) { - config._d = new Date(input.valueOf()); - } else if (typeof input === 'string') { - configFromString(config); - } else if (isArray(input)) { - config._a = map(input.slice(0), function (obj) { - return parseInt(obj, 10); - }); - configFromArray(config); - } else if (typeof(input) === 'object') { - configFromObject(config); - } else if (typeof(input) === 'number') { - // from milliseconds - config._d = new Date(input); - } else { - utils_hooks__hooks.createFromInputFallback(config); + getParsingFlags(tempConfig).score = currentScore; + + if (scoreToBeat == null || currentScore < scoreToBeat) { + scoreToBeat = currentScore; + bestMoment = tempConfig; } } - function createLocalOrUTC (input, format, locale, strict, isUTC) { - var c = {}; + extend(config, bestMoment || tempConfig); + } - if (typeof(locale) === 'boolean') { - strict = locale; - locale = undefined; - } + function configFromObject(config) { + if (config._d) { + return; + } - if ((isObject(input) && isObjectEmpty(input)) || - (isArray(input) && input.length === 0)) { - input = undefined; - } - // object construction must be done this way. - // https://github.com/moment/moment/issues/1423 - c._isAMomentObject = true; - c._useUTC = c._isUTC = isUTC; - c._l = locale; - c._i = input; - c._f = format; - c._strict = strict; + var i = normalizeObjectUnits(config._i); + config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) { + return obj && parseInt(obj, 10); + }); - return createFromConfig(c); - } + configFromArray(config); + } - function local__createLocal (input, format, locale, strict) { - return createLocalOrUTC(input, format, locale, strict, false); + function createFromConfig (config) { + var res = new Moment(checkOverflow(prepareConfig(config))); + if (res._nextDay) { + // Adding is smart enough around DST + res.add(1, 'd'); + res._nextDay = undefined; } - var prototypeMin = deprecate( - 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/', - function () { - var other = local__createLocal.apply(null, arguments); - if (this.isValid() && other.isValid()) { - return other < this ? this : other; - } else { - return valid__createInvalid(); - } - } - ); + return res; + } - var prototypeMax = deprecate( - 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/', - function () { - var other = local__createLocal.apply(null, arguments); - if (this.isValid() && other.isValid()) { - return other > this ? this : other; - } else { - return valid__createInvalid(); - } - } - ); + function prepareConfig (config) { + var input = config._i, + format = config._f; + + config._locale = config._locale || getLocale(config._l); + + if (input === null || (format === undefined && input === '')) { + return createInvalid({nullInput: true}); + } + + if (typeof input === 'string') { + config._i = input = config._locale.preparse(input); + } - // Pick a moment m from moments so that m[fn](other) is true for all - // other. This relies on the function fn to be transitive. - // - // moments should either be an array of moment objects or an array, whose - // first element is an array of moment objects. - function pickBy(fn, moments) { - var res, i; - if (moments.length === 1 && isArray(moments[0])) { - moments = moments[0]; - } - if (!moments.length) { - return local__createLocal(); - } - res = moments[0]; - for (i = 1; i < moments.length; ++i) { - if (!moments[i].isValid() || moments[i][fn](res)) { - res = moments[i]; - } - } - return res; + if (isMoment(input)) { + return new Moment(checkOverflow(input)); + } else if (isDate(input)) { + config._d = input; + } else if (isArray(format)) { + configFromStringAndArray(config); + } else if (format) { + configFromStringAndFormat(config); + } else { + configFromInput(config); + } + + if (!isValid(config)) { + config._d = null; } - // TODO: Use [].sort instead? - function min () { - var args = [].slice.call(arguments, 0); + return config; + } - return pickBy('isBefore', args); + function configFromInput(config) { + var input = config._i; + if (input === undefined) { + config._d = new Date(hooks.now()); + } else if (isDate(input)) { + config._d = new Date(input.valueOf()); + } else if (typeof input === 'string') { + configFromString(config); + } else if (isArray(input)) { + config._a = map(input.slice(0), function (obj) { + return parseInt(obj, 10); + }); + configFromArray(config); + } else if (typeof(input) === 'object') { + configFromObject(config); + } else if (isNumber(input)) { + // from milliseconds + config._d = new Date(input); + } else { + hooks.createFromInputFallback(config); } + } - function max () { - var args = [].slice.call(arguments, 0); + function createLocalOrUTC (input, format, locale, strict, isUTC) { + var c = {}; - return pickBy('isAfter', args); + if (locale === true || locale === false) { + strict = locale; + locale = undefined; } - var now = function () { - return Date.now ? Date.now() : +(new Date()); - }; + if ((isObject(input) && isObjectEmpty(input)) || + (isArray(input) && input.length === 0)) { + input = undefined; + } + // object construction must be done this way. + // https://github.com/moment/moment/issues/1423 + c._isAMomentObject = true; + c._useUTC = c._isUTC = isUTC; + c._l = locale; + c._i = input; + c._f = format; + c._strict = strict; + + return createFromConfig(c); + } + + function createLocal (input, format, locale, strict) { + return createLocalOrUTC(input, format, locale, strict, false); + } - function Duration (duration) { - var normalizedInput = normalizeObjectUnits(duration), - years = normalizedInput.year || 0, - quarters = normalizedInput.quarter || 0, - months = normalizedInput.month || 0, - weeks = normalizedInput.week || 0, - days = normalizedInput.day || 0, - hours = normalizedInput.hour || 0, - minutes = normalizedInput.minute || 0, - seconds = normalizedInput.second || 0, - milliseconds = normalizedInput.millisecond || 0; - - // representation for dateAddRemove - this._milliseconds = +milliseconds + - seconds * 1e3 + // 1000 - minutes * 6e4 + // 1000 * 60 - hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978 - // Because of dateAddRemove treats 24 hours as different from a - // day when working around DST, we need to store them separately - this._days = +days + - weeks * 7; - // It is impossible translate months into days without knowing - // which months you are are talking about, so we have to store - // it separately. - this._months = +months + - quarters * 3 + - years * 12; - - this._data = {}; - - this._locale = locale_locales__getLocale(); - - this._bubble(); - } - - function isDuration (obj) { - return obj instanceof Duration; - } - - function absRound (number) { - if (number < 0) { - return Math.round(-1 * number) * -1; + var prototypeMin = deprecate( + 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/', + function () { + var other = createLocal.apply(null, arguments); + if (this.isValid() && other.isValid()) { + return other < this ? this : other; } else { - return Math.round(number); + return createInvalid(); } } + ); - // FORMATTING + var prototypeMax = deprecate( + 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/', + function () { + var other = createLocal.apply(null, arguments); + if (this.isValid() && other.isValid()) { + return other > this ? this : other; + } else { + return createInvalid(); + } + } + ); - function offset (token, separator) { - addFormatToken(token, 0, 0, function () { - var offset = this.utcOffset(); - var sign = '+'; - if (offset < 0) { - offset = -offset; - sign = '-'; - } - return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2); - }); + // Pick a moment m from moments so that m[fn](other) is true for all + // other. This relies on the function fn to be transitive. + // + // moments should either be an array of moment objects or an array, whose + // first element is an array of moment objects. + function pickBy(fn, moments) { + var res, i; + if (moments.length === 1 && isArray(moments[0])) { + moments = moments[0]; + } + if (!moments.length) { + return createLocal(); } + res = moments[0]; + for (i = 1; i < moments.length; ++i) { + if (!moments[i].isValid() || moments[i][fn](res)) { + res = moments[i]; + } + } + return res; + } - offset('Z', ':'); - offset('ZZ', ''); + // TODO: Use [].sort instead? + function min () { + var args = [].slice.call(arguments, 0); - // PARSING + return pickBy('isBefore', args); + } - addRegexToken('Z', matchShortOffset); - addRegexToken('ZZ', matchShortOffset); - addParseToken(['Z', 'ZZ'], function (input, array, config) { - config._useUTC = true; - config._tzm = offsetFromString(matchShortOffset, input); - }); + function max () { + var args = [].slice.call(arguments, 0); - // HELPERS + return pickBy('isAfter', args); + } - // timezone chunker - // '+10:00' > ['10', '00'] - // '-1530' > ['-15', '30'] - var chunkOffset = /([\+\-]|\d\d)/gi; + var now = function () { + return Date.now ? Date.now() : +(new Date()); + }; + + function Duration (duration) { + var normalizedInput = normalizeObjectUnits(duration), + years = normalizedInput.year || 0, + quarters = normalizedInput.quarter || 0, + months = normalizedInput.month || 0, + weeks = normalizedInput.week || 0, + days = normalizedInput.day || 0, + hours = normalizedInput.hour || 0, + minutes = normalizedInput.minute || 0, + seconds = normalizedInput.second || 0, + milliseconds = normalizedInput.millisecond || 0; + + // representation for dateAddRemove + this._milliseconds = +milliseconds + + seconds * 1e3 + // 1000 + minutes * 6e4 + // 1000 * 60 + hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978 + // Because of dateAddRemove treats 24 hours as different from a + // day when working around DST, we need to store them separately + this._days = +days + + weeks * 7; + // It is impossible translate months into days without knowing + // which months you are are talking about, so we have to store + // it separately. + this._months = +months + + quarters * 3 + + years * 12; + + this._data = {}; + + this._locale = getLocale(); + + this._bubble(); + } - function offsetFromString(matcher, string) { - var matches = ((string || '').match(matcher) || []); - var chunk = matches[matches.length - 1] || []; - var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0]; - var minutes = +(parts[1] * 60) + toInt(parts[2]); + function isDuration (obj) { + return obj instanceof Duration; + } - return parts[0] === '+' ? minutes : -minutes; + function absRound (number) { + if (number < 0) { + return Math.round(-1 * number) * -1; + } else { + return Math.round(number); } + } - // Return a moment from input, that is local/utc/zone equivalent to model. - function cloneWithOffset(input, model) { - var res, diff; - if (model._isUTC) { - res = model.clone(); - diff = (isMoment(input) || isDate(input) ? input.valueOf() : local__createLocal(input).valueOf()) - res.valueOf(); - // Use low-level api, because this fn is low-level api. - res._d.setTime(res._d.valueOf() + diff); - utils_hooks__hooks.updateOffset(res, false); - return res; - } else { - return local__createLocal(input).local(); + // FORMATTING + + function offset (token, separator) { + addFormatToken(token, 0, 0, function () { + var offset = this.utcOffset(); + var sign = '+'; + if (offset < 0) { + offset = -offset; + sign = '-'; } - } + return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2); + }); + } - function getDateOffset (m) { - // On Firefox.24 Date#getTimezoneOffset returns a floating point. - // https://github.com/moment/moment/pull/1871 - return -Math.round(m._d.getTimezoneOffset() / 15) * 15; - } + offset('Z', ':'); + offset('ZZ', ''); - // HOOKS + // PARSING - // This function will be called whenever a moment is mutated. - // It is intended to keep the offset in sync with the timezone. - utils_hooks__hooks.updateOffset = function () {}; + addRegexToken('Z', matchShortOffset); + addRegexToken('ZZ', matchShortOffset); + addParseToken(['Z', 'ZZ'], function (input, array, config) { + config._useUTC = true; + config._tzm = offsetFromString(matchShortOffset, input); + }); - // MOMENTS + // HELPERS - // keepLocalTime = true means only change the timezone, without - // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]--> - // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset - // +0200, so we adjust the time as needed, to be valid. - // - // Keeping the time actually adds/subtracts (one hour) - // from the actual represented time. That is why we call updateOffset - // a second time. In case it wants us to change the offset again - // _changeInProgress == true case, then we have to adjust, because - // there is no such time in the given timezone. - function getSetOffset (input, keepLocalTime) { - var offset = this._offset || 0, - localAdjust; - if (!this.isValid()) { - return input != null ? this : NaN; - } - if (input != null) { - if (typeof input === 'string') { - input = offsetFromString(matchShortOffset, input); - } else if (Math.abs(input) < 16) { - input = input * 60; - } - if (!this._isUTC && keepLocalTime) { - localAdjust = getDateOffset(this); - } - this._offset = input; - this._isUTC = true; - if (localAdjust != null) { - this.add(localAdjust, 'm'); - } - if (offset !== input) { - if (!keepLocalTime || this._changeInProgress) { - add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false); - } else if (!this._changeInProgress) { - this._changeInProgress = true; - utils_hooks__hooks.updateOffset(this, true); - this._changeInProgress = null; - } - } - return this; - } else { - return this._isUTC ? offset : getDateOffset(this); - } + // timezone chunker + // '+10:00' > ['10', '00'] + // '-1530' > ['-15', '30'] + var chunkOffset = /([\+\-]|\d\d)/gi; + + function offsetFromString(matcher, string) { + var matches = (string || '').match(matcher); + + if (matches === null) { + return null; } - function getSetZone (input, keepLocalTime) { - if (input != null) { - if (typeof input !== 'string') { - input = -input; - } + var chunk = matches[matches.length - 1] || []; + var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0]; + var minutes = +(parts[1] * 60) + toInt(parts[2]); - this.utcOffset(input, keepLocalTime); + return minutes === 0 ? + 0 : + parts[0] === '+' ? minutes : -minutes; + } - return this; - } else { - return -this.utcOffset(); - } + // Return a moment from input, that is local/utc/zone equivalent to model. + function cloneWithOffset(input, model) { + var res, diff; + if (model._isUTC) { + res = model.clone(); + diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf(); + // Use low-level api, because this fn is low-level api. + res._d.setTime(res._d.valueOf() + diff); + hooks.updateOffset(res, false); + return res; + } else { + return createLocal(input).local(); } + } - function setOffsetToUTC (keepLocalTime) { - return this.utcOffset(0, keepLocalTime); - } + function getDateOffset (m) { + // On Firefox.24 Date#getTimezoneOffset returns a floating point. + // https://github.com/moment/moment/pull/1871 + return -Math.round(m._d.getTimezoneOffset() / 15) * 15; + } - function setOffsetToLocal (keepLocalTime) { - if (this._isUTC) { - this.utcOffset(0, keepLocalTime); - this._isUTC = false; + // HOOKS - if (keepLocalTime) { - this.subtract(getDateOffset(this), 'm'); - } - } - return this; - } + // This function will be called whenever a moment is mutated. + // It is intended to keep the offset in sync with the timezone. + hooks.updateOffset = function () {}; - function setOffsetToParsedOffset () { - if (this._tzm) { - this.utcOffset(this._tzm); - } else if (typeof this._i === 'string') { - var tZone = offsetFromString(matchOffset, this._i); + // MOMENTS - if (tZone === 0) { - this.utcOffset(0, true); - } else { - this.utcOffset(offsetFromString(matchOffset, this._i)); + // keepLocalTime = true means only change the timezone, without + // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]--> + // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset + // +0200, so we adjust the time as needed, to be valid. + // + // Keeping the time actually adds/subtracts (one hour) + // from the actual represented time. That is why we call updateOffset + // a second time. In case it wants us to change the offset again + // _changeInProgress == true case, then we have to adjust, because + // there is no such time in the given timezone. + function getSetOffset (input, keepLocalTime) { + var offset = this._offset || 0, + localAdjust; + if (!this.isValid()) { + return input != null ? this : NaN; + } + if (input != null) { + if (typeof input === 'string') { + input = offsetFromString(matchShortOffset, input); + if (input === null) { + return this; + } + } else if (Math.abs(input) < 16) { + input = input * 60; + } + if (!this._isUTC && keepLocalTime) { + localAdjust = getDateOffset(this); + } + this._offset = input; + this._isUTC = true; + if (localAdjust != null) { + this.add(localAdjust, 'm'); + } + if (offset !== input) { + if (!keepLocalTime || this._changeInProgress) { + addSubtract(this, createDuration(input - offset, 'm'), 1, false); + } else if (!this._changeInProgress) { + this._changeInProgress = true; + hooks.updateOffset(this, true); + this._changeInProgress = null; } } return this; + } else { + return this._isUTC ? offset : getDateOffset(this); } + } - function hasAlignedHourOffset (input) { - if (!this.isValid()) { - return false; + function getSetZone (input, keepLocalTime) { + if (input != null) { + if (typeof input !== 'string') { + input = -input; } - input = input ? local__createLocal(input).utcOffset() : 0; - return (this.utcOffset() - input) % 60 === 0; - } + this.utcOffset(input, keepLocalTime); - function isDaylightSavingTime () { - return ( - this.utcOffset() > this.clone().month(0).utcOffset() || - this.utcOffset() > this.clone().month(5).utcOffset() - ); + return this; + } else { + return -this.utcOffset(); } + } - function isDaylightSavingTimeShifted () { - if (!isUndefined(this._isDSTShifted)) { - return this._isDSTShifted; - } - - var c = {}; + function setOffsetToUTC (keepLocalTime) { + return this.utcOffset(0, keepLocalTime); + } - copyConfig(c, this); - c = prepareConfig(c); + function setOffsetToLocal (keepLocalTime) { + if (this._isUTC) { + this.utcOffset(0, keepLocalTime); + this._isUTC = false; - if (c._a) { - var other = c._isUTC ? create_utc__createUTC(c._a) : local__createLocal(c._a); - this._isDSTShifted = this.isValid() && - compareArrays(c._a, other.toArray()) > 0; - } else { - this._isDSTShifted = false; + if (keepLocalTime) { + this.subtract(getDateOffset(this), 'm'); } - - return this._isDSTShifted; } + return this; + } - function isLocal () { - return this.isValid() ? !this._isUTC : false; + function setOffsetToParsedOffset () { + if (this._tzm != null) { + this.utcOffset(this._tzm); + } else if (typeof this._i === 'string') { + var tZone = offsetFromString(matchOffset, this._i); + if (tZone != null) { + this.utcOffset(tZone); + } + else { + this.utcOffset(0, true); + } } + return this; + } - function isUtcOffset () { - return this.isValid() ? this._isUTC : false; + function hasAlignedHourOffset (input) { + if (!this.isValid()) { + return false; } + input = input ? createLocal(input).utcOffset() : 0; + + return (this.utcOffset() - input) % 60 === 0; + } - function isUtc () { - return this.isValid() ? this._isUTC && this._offset === 0 : false; + function isDaylightSavingTime () { + return ( + this.utcOffset() > this.clone().month(0).utcOffset() || + this.utcOffset() > this.clone().month(5).utcOffset() + ); + } + + function isDaylightSavingTimeShifted () { + if (!isUndefined(this._isDSTShifted)) { + return this._isDSTShifted; } - // ASP.NET json date format regex - var aspNetRegex = /^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/; + var c = {}; - // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html - // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere - // and further modified to allow for strings containing both week and day - var isoRegex = /^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/; + copyConfig(c, this); + c = prepareConfig(c); - function create__createDuration (input, key) { - var duration = input, - // matching against regexp is expensive, do it on demand - match = null, - sign, - ret, - diffRes; + if (c._a) { + var other = c._isUTC ? createUTC(c._a) : createLocal(c._a); + this._isDSTShifted = this.isValid() && + compareArrays(c._a, other.toArray()) > 0; + } else { + this._isDSTShifted = false; + } - if (isDuration(input)) { - duration = { - ms : input._milliseconds, - d : input._days, - M : input._months - }; - } else if (typeof input === 'number') { - duration = {}; - if (key) { - duration[key] = input; - } else { - duration.milliseconds = input; - } - } else if (!!(match = aspNetRegex.exec(input))) { - sign = (match[1] === '-') ? -1 : 1; - duration = { - y : 0, - d : toInt(match[DATE]) * sign, - h : toInt(match[HOUR]) * sign, - m : toInt(match[MINUTE]) * sign, - s : toInt(match[SECOND]) * sign, - ms : toInt(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match - }; - } else if (!!(match = isoRegex.exec(input))) { - sign = (match[1] === '-') ? -1 : 1; - duration = { - y : parseIso(match[2], sign), - M : parseIso(match[3], sign), - w : parseIso(match[4], sign), - d : parseIso(match[5], sign), - h : parseIso(match[6], sign), - m : parseIso(match[7], sign), - s : parseIso(match[8], sign) - }; - } else if (duration == null) {// checks for null or undefined - duration = {}; - } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) { - diffRes = momentsDifference(local__createLocal(duration.from), local__createLocal(duration.to)); + return this._isDSTShifted; + } - duration = {}; - duration.ms = diffRes.milliseconds; - duration.M = diffRes.months; - } + function isLocal () { + return this.isValid() ? !this._isUTC : false; + } - ret = new Duration(duration); + function isUtcOffset () { + return this.isValid() ? this._isUTC : false; + } - if (isDuration(input) && hasOwnProp(input, '_locale')) { - ret._locale = input._locale; - } + function isUtc () { + return this.isValid() ? this._isUTC && this._offset === 0 : false; + } + + // ASP.NET json date format regex + var aspNetRegex = /^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/; + + // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html + // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere + // and further modified to allow for strings containing both week and day + var isoRegex = /^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/; + + function createDuration (input, key) { + var duration = input, + // matching against regexp is expensive, do it on demand + match = null, + sign, + ret, + diffRes; + + if (isDuration(input)) { + duration = { + ms : input._milliseconds, + d : input._days, + M : input._months + }; + } else if (isNumber(input)) { + duration = {}; + if (key) { + duration[key] = input; + } else { + duration.milliseconds = input; + } + } else if (!!(match = aspNetRegex.exec(input))) { + sign = (match[1] === '-') ? -1 : 1; + duration = { + y : 0, + d : toInt(match[DATE]) * sign, + h : toInt(match[HOUR]) * sign, + m : toInt(match[MINUTE]) * sign, + s : toInt(match[SECOND]) * sign, + ms : toInt(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match + }; + } else if (!!(match = isoRegex.exec(input))) { + sign = (match[1] === '-') ? -1 : 1; + duration = { + y : parseIso(match[2], sign), + M : parseIso(match[3], sign), + w : parseIso(match[4], sign), + d : parseIso(match[5], sign), + h : parseIso(match[6], sign), + m : parseIso(match[7], sign), + s : parseIso(match[8], sign) + }; + } else if (duration == null) {// checks for null or undefined + duration = {}; + } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) { + diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to)); - return ret; + duration = {}; + duration.ms = diffRes.milliseconds; + duration.M = diffRes.months; } - create__createDuration.fn = Duration.prototype; + ret = new Duration(duration); - function parseIso (inp, sign) { - // We'd normally use ~~inp for this, but unfortunately it also - // converts floats to ints. - // inp may be undefined, so careful calling replace on it. - var res = inp && parseFloat(inp.replace(',', '.')); - // apply sign while we're at it - return (isNaN(res) ? 0 : res) * sign; + if (isDuration(input) && hasOwnProp(input, '_locale')) { + ret._locale = input._locale; } - function positiveMomentsDifference(base, other) { - var res = {milliseconds: 0, months: 0}; + return ret; + } + + createDuration.fn = Duration.prototype; - res.months = other.month() - base.month() + - (other.year() - base.year()) * 12; - if (base.clone().add(res.months, 'M').isAfter(other)) { - --res.months; - } + function parseIso (inp, sign) { + // We'd normally use ~~inp for this, but unfortunately it also + // converts floats to ints. + // inp may be undefined, so careful calling replace on it. + var res = inp && parseFloat(inp.replace(',', '.')); + // apply sign while we're at it + return (isNaN(res) ? 0 : res) * sign; + } - res.milliseconds = +other - +(base.clone().add(res.months, 'M')); + function positiveMomentsDifference(base, other) { + var res = {milliseconds: 0, months: 0}; - return res; + res.months = other.month() - base.month() + + (other.year() - base.year()) * 12; + if (base.clone().add(res.months, 'M').isAfter(other)) { + --res.months; } - function momentsDifference(base, other) { - var res; - if (!(base.isValid() && other.isValid())) { - return {milliseconds: 0, months: 0}; - } + res.milliseconds = +other - +(base.clone().add(res.months, 'M')); - other = cloneWithOffset(other, base); - if (base.isBefore(other)) { - res = positiveMomentsDifference(base, other); - } else { - res = positiveMomentsDifference(other, base); - res.milliseconds = -res.milliseconds; - res.months = -res.months; - } + return res; + } - return res; + function momentsDifference(base, other) { + var res; + if (!(base.isValid() && other.isValid())) { + return {milliseconds: 0, months: 0}; } - // TODO: remove 'name' arg after deprecation is removed - function createAdder(direction, name) { - return function (val, period) { - var dur, tmp; - //invert the arguments, but complain about it - if (period !== null && !isNaN(+period)) { - deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' + - 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'); - tmp = val; val = period; period = tmp; - } - - val = typeof val === 'string' ? +val : val; - dur = create__createDuration(val, period); - add_subtract__addSubtract(this, dur, direction); - return this; - }; + other = cloneWithOffset(other, base); + if (base.isBefore(other)) { + res = positiveMomentsDifference(base, other); + } else { + res = positiveMomentsDifference(other, base); + res.milliseconds = -res.milliseconds; + res.months = -res.months; } - function add_subtract__addSubtract (mom, duration, isAdding, updateOffset) { - var milliseconds = duration._milliseconds, - days = absRound(duration._days), - months = absRound(duration._months); + return res; + } - if (!mom.isValid()) { - // No op - return; + // TODO: remove 'name' arg after deprecation is removed + function createAdder(direction, name) { + return function (val, period) { + var dur, tmp; + //invert the arguments, but complain about it + if (period !== null && !isNaN(+period)) { + deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' + + 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'); + tmp = val; val = period; period = tmp; } - updateOffset = updateOffset == null ? true : updateOffset; + val = typeof val === 'string' ? +val : val; + dur = createDuration(val, period); + addSubtract(this, dur, direction); + return this; + }; + } - if (milliseconds) { - mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding); - } - if (days) { - get_set__set(mom, 'Date', get_set__get(mom, 'Date') + days * isAdding); - } - if (months) { - setMonth(mom, get_set__get(mom, 'Month') + months * isAdding); - } - if (updateOffset) { - utils_hooks__hooks.updateOffset(mom, days || months); - } + function addSubtract (mom, duration, isAdding, updateOffset) { + var milliseconds = duration._milliseconds, + days = absRound(duration._days), + months = absRound(duration._months); + + if (!mom.isValid()) { + // No op + return; } - var add_subtract__add = createAdder(1, 'add'); - var add_subtract__subtract = createAdder(-1, 'subtract'); + updateOffset = updateOffset == null ? true : updateOffset; - function getCalendarFormat(myMoment, now) { - var diff = myMoment.diff(now, 'days', true); - return diff < -6 ? 'sameElse' : - diff < -1 ? 'lastWeek' : - diff < 0 ? 'lastDay' : - diff < 1 ? 'sameDay' : - diff < 2 ? 'nextDay' : - diff < 7 ? 'nextWeek' : 'sameElse'; + if (milliseconds) { + mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding); + } + if (days) { + set$1(mom, 'Date', get(mom, 'Date') + days * isAdding); + } + if (months) { + setMonth(mom, get(mom, 'Month') + months * isAdding); + } + if (updateOffset) { + hooks.updateOffset(mom, days || months); } + } - function moment_calendar__calendar (time, formats) { - // We want to compare the start of today, vs this. - // Getting start-of-today depends on whether we're local/utc/offset or not. - var now = time || local__createLocal(), - sod = cloneWithOffset(now, this).startOf('day'), - format = utils_hooks__hooks.calendarFormat(this, sod) || 'sameElse'; + var add = createAdder(1, 'add'); + var subtract = createAdder(-1, 'subtract'); + + function getCalendarFormat(myMoment, now) { + var diff = myMoment.diff(now, 'days', true); + return diff < -6 ? 'sameElse' : + diff < -1 ? 'lastWeek' : + diff < 0 ? 'lastDay' : + diff < 1 ? 'sameDay' : + diff < 2 ? 'nextDay' : + diff < 7 ? 'nextWeek' : 'sameElse'; + } - var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]); + function calendar$1 (time, formats) { + // We want to compare the start of today, vs this. + // Getting start-of-today depends on whether we're local/utc/offset or not. + var now = time || createLocal(), + sod = cloneWithOffset(now, this).startOf('day'), + format = hooks.calendarFormat(this, sod) || 'sameElse'; - return this.format(output || this.localeData().calendar(format, this, local__createLocal(now))); - } + var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]); - function clone () { - return new Moment(this); - } + return this.format(output || this.localeData().calendar(format, this, createLocal(now))); + } - function isAfter (input, units) { - var localInput = isMoment(input) ? input : local__createLocal(input); - if (!(this.isValid() && localInput.isValid())) { - return false; - } - units = normalizeUnits(!isUndefined(units) ? units : 'millisecond'); - if (units === 'millisecond') { - return this.valueOf() > localInput.valueOf(); - } else { - return localInput.valueOf() < this.clone().startOf(units).valueOf(); - } - } + function clone () { + return new Moment(this); + } - function isBefore (input, units) { - var localInput = isMoment(input) ? input : local__createLocal(input); - if (!(this.isValid() && localInput.isValid())) { - return false; - } - units = normalizeUnits(!isUndefined(units) ? units : 'millisecond'); - if (units === 'millisecond') { - return this.valueOf() < localInput.valueOf(); - } else { - return this.clone().endOf(units).valueOf() < localInput.valueOf(); - } + function isAfter (input, units) { + var localInput = isMoment(input) ? input : createLocal(input); + if (!(this.isValid() && localInput.isValid())) { + return false; } - - function isBetween (from, to, units, inclusivity) { - inclusivity = inclusivity || '()'; - return (inclusivity[0] === '(' ? this.isAfter(from, units) : !this.isBefore(from, units)) && - (inclusivity[1] === ')' ? this.isBefore(to, units) : !this.isAfter(to, units)); + units = normalizeUnits(!isUndefined(units) ? units : 'millisecond'); + if (units === 'millisecond') { + return this.valueOf() > localInput.valueOf(); + } else { + return localInput.valueOf() < this.clone().startOf(units).valueOf(); } + } - function isSame (input, units) { - var localInput = isMoment(input) ? input : local__createLocal(input), - inputMs; - if (!(this.isValid() && localInput.isValid())) { - return false; - } - units = normalizeUnits(units || 'millisecond'); - if (units === 'millisecond') { - return this.valueOf() === localInput.valueOf(); - } else { - inputMs = localInput.valueOf(); - return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf(); - } + function isBefore (input, units) { + var localInput = isMoment(input) ? input : createLocal(input); + if (!(this.isValid() && localInput.isValid())) { + return false; } - - function isSameOrAfter (input, units) { - return this.isSame(input, units) || this.isAfter(input,units); + units = normalizeUnits(!isUndefined(units) ? units : 'millisecond'); + if (units === 'millisecond') { + return this.valueOf() < localInput.valueOf(); + } else { + return this.clone().endOf(units).valueOf() < localInput.valueOf(); } + } + + function isBetween (from, to, units, inclusivity) { + inclusivity = inclusivity || '()'; + return (inclusivity[0] === '(' ? this.isAfter(from, units) : !this.isBefore(from, units)) && + (inclusivity[1] === ')' ? this.isBefore(to, units) : !this.isAfter(to, units)); + } - function isSameOrBefore (input, units) { - return this.isSame(input, units) || this.isBefore(input,units); + function isSame (input, units) { + var localInput = isMoment(input) ? input : createLocal(input), + inputMs; + if (!(this.isValid() && localInput.isValid())) { + return false; + } + units = normalizeUnits(units || 'millisecond'); + if (units === 'millisecond') { + return this.valueOf() === localInput.valueOf(); + } else { + inputMs = localInput.valueOf(); + return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf(); } + } - function diff (input, units, asFloat) { - var that, - zoneDelta, - delta, output; + function isSameOrAfter (input, units) { + return this.isSame(input, units) || this.isAfter(input,units); + } - if (!this.isValid()) { - return NaN; - } + function isSameOrBefore (input, units) { + return this.isSame(input, units) || this.isBefore(input,units); + } - that = cloneWithOffset(input, this); + function diff (input, units, asFloat) { + var that, + zoneDelta, + delta, output; - if (!that.isValid()) { - return NaN; - } + if (!this.isValid()) { + return NaN; + } - zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4; + that = cloneWithOffset(input, this); - units = normalizeUnits(units); + if (!that.isValid()) { + return NaN; + } - if (units === 'year' || units === 'month' || units === 'quarter') { - output = monthDiff(this, that); - if (units === 'quarter') { - output = output / 3; - } else if (units === 'year') { - output = output / 12; - } - } else { - delta = this - that; - output = units === 'second' ? delta / 1e3 : // 1000 - units === 'minute' ? delta / 6e4 : // 1000 * 60 - units === 'hour' ? delta / 36e5 : // 1000 * 60 * 60 - units === 'day' ? (delta - zoneDelta) / 864e5 : // 1000 * 60 * 60 * 24, negate dst - units === 'week' ? (delta - zoneDelta) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst - delta; - } - return asFloat ? output : absFloor(output); - } - - function monthDiff (a, b) { - // difference in months - var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()), - // b is in (anchor - 1 month, anchor + 1 month) - anchor = a.clone().add(wholeMonthDiff, 'months'), - anchor2, adjust; - - if (b - anchor < 0) { - anchor2 = a.clone().add(wholeMonthDiff - 1, 'months'); - // linear across the month - adjust = (b - anchor) / (anchor - anchor2); - } else { - anchor2 = a.clone().add(wholeMonthDiff + 1, 'months'); - // linear across the month - adjust = (b - anchor) / (anchor2 - anchor); + zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4; + + units = normalizeUnits(units); + + if (units === 'year' || units === 'month' || units === 'quarter') { + output = monthDiff(this, that); + if (units === 'quarter') { + output = output / 3; + } else if (units === 'year') { + output = output / 12; } + } else { + delta = this - that; + output = units === 'second' ? delta / 1e3 : // 1000 + units === 'minute' ? delta / 6e4 : // 1000 * 60 + units === 'hour' ? delta / 36e5 : // 1000 * 60 * 60 + units === 'day' ? (delta - zoneDelta) / 864e5 : // 1000 * 60 * 60 * 24, negate dst + units === 'week' ? (delta - zoneDelta) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst + delta; + } + return asFloat ? output : absFloor(output); + } - //check for negative zero, return zero if negative zero - return -(wholeMonthDiff + adjust) || 0; + function monthDiff (a, b) { + // difference in months + var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()), + // b is in (anchor - 1 month, anchor + 1 month) + anchor = a.clone().add(wholeMonthDiff, 'months'), + anchor2, adjust; + + if (b - anchor < 0) { + anchor2 = a.clone().add(wholeMonthDiff - 1, 'months'); + // linear across the month + adjust = (b - anchor) / (anchor - anchor2); + } else { + anchor2 = a.clone().add(wholeMonthDiff + 1, 'months'); + // linear across the month + adjust = (b - anchor) / (anchor2 - anchor); } - utils_hooks__hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ'; - utils_hooks__hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]'; + //check for negative zero, return zero if negative zero + return -(wholeMonthDiff + adjust) || 0; + } - function toString () { - return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ'); - } + hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ'; + hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]'; - function moment_format__toISOString () { - var m = this.clone().utc(); - if (0 < m.year() && m.year() <= 9999) { - if (isFunction(Date.prototype.toISOString)) { - // native implementation is ~50x faster, use it when we can - return this.toDate().toISOString(); - } else { - return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); - } + function toString () { + return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ'); + } + + function toISOString () { + var m = this.clone().utc(); + if (0 < m.year() && m.year() <= 9999) { + if (isFunction(Date.prototype.toISOString)) { + // native implementation is ~50x faster, use it when we can + return this.toDate().toISOString(); } else { - return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); + return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); } + } else { + return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); } + } - function format (inputString) { - if (!inputString) { - inputString = this.isUtc() ? utils_hooks__hooks.defaultFormatUtc : utils_hooks__hooks.defaultFormat; - } - var output = formatMoment(this, inputString); - return this.localeData().postformat(output); + /** + * Return a human readable representation of a moment that can + * also be evaluated to get a new moment which is the same + * + * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects + */ + function inspect () { + if (!this.isValid()) { + return 'moment.invalid(/* ' + this._i + ' */)'; } - - function from (time, withoutSuffix) { - if (this.isValid() && - ((isMoment(time) && time.isValid()) || - local__createLocal(time).isValid())) { - return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix); - } else { - return this.localeData().invalidDate(); - } + var func = 'moment'; + var zone = ''; + if (!this.isLocal()) { + func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone'; + zone = 'Z'; } + var prefix = '[' + func + '("]'; + var year = (0 < this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY'; + var datetime = '-MM-DD[T]HH:mm:ss.SSS'; + var suffix = zone + '[")]'; - function fromNow (withoutSuffix) { - return this.from(local__createLocal(), withoutSuffix); - } + return this.format(prefix + year + datetime + suffix); + } - function to (time, withoutSuffix) { - if (this.isValid() && - ((isMoment(time) && time.isValid()) || - local__createLocal(time).isValid())) { - return create__createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix); - } else { - return this.localeData().invalidDate(); - } + function format (inputString) { + if (!inputString) { + inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat; } + var output = formatMoment(this, inputString); + return this.localeData().postformat(output); + } - function toNow (withoutSuffix) { - return this.to(local__createLocal(), withoutSuffix); + function from (time, withoutSuffix) { + if (this.isValid() && + ((isMoment(time) && time.isValid()) || + createLocal(time).isValid())) { + return createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix); + } else { + return this.localeData().invalidDate(); } + } - // If passed a locale key, it will set the locale for this - // instance. Otherwise, it will return the locale configuration - // variables for this instance. - function locale (key) { - var newLocaleData; + function fromNow (withoutSuffix) { + return this.from(createLocal(), withoutSuffix); + } - if (key === undefined) { - return this._locale._abbr; - } else { - newLocaleData = locale_locales__getLocale(key); - if (newLocaleData != null) { - this._locale = newLocaleData; - } - return this; - } + function to (time, withoutSuffix) { + if (this.isValid() && + ((isMoment(time) && time.isValid()) || + createLocal(time).isValid())) { + return createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix); + } else { + return this.localeData().invalidDate(); } + } - var lang = deprecate( - 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.', - function (key) { - if (key === undefined) { - return this.localeData(); - } else { - return this.locale(key); - } - } - ); + function toNow (withoutSuffix) { + return this.to(createLocal(), withoutSuffix); + } - function localeData () { - return this._locale; - } + // If passed a locale key, it will set the locale for this + // instance. Otherwise, it will return the locale configuration + // variables for this instance. + function locale (key) { + var newLocaleData; - function startOf (units) { - units = normalizeUnits(units); - // the following switch intentionally omits break keywords - // to utilize falling through the cases. - switch (units) { - case 'year': - this.month(0); - /* falls through */ - case 'quarter': - case 'month': - this.date(1); - /* falls through */ - case 'week': - case 'isoWeek': - case 'day': - case 'date': - this.hours(0); - /* falls through */ - case 'hour': - this.minutes(0); - /* falls through */ - case 'minute': - this.seconds(0); - /* falls through */ - case 'second': - this.milliseconds(0); - } - - // weeks are a special case - if (units === 'week') { - this.weekday(0); - } - if (units === 'isoWeek') { - this.isoWeekday(1); - } - - // quarters are also special - if (units === 'quarter') { - this.month(Math.floor(this.month() / 3) * 3); + if (key === undefined) { + return this._locale._abbr; + } else { + newLocaleData = getLocale(key); + if (newLocaleData != null) { + this._locale = newLocaleData; } - return this; } + } - function endOf (units) { - units = normalizeUnits(units); - if (units === undefined || units === 'millisecond') { - return this; + var lang = deprecate( + 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.', + function (key) { + if (key === undefined) { + return this.localeData(); + } else { + return this.locale(key); } + } + ); - // 'date' is an alias for 'day', so it should be considered as such. - if (units === 'date') { - units = 'day'; - } + function localeData () { + return this._locale; + } - return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms'); + function startOf (units) { + units = normalizeUnits(units); + // the following switch intentionally omits break keywords + // to utilize falling through the cases. + switch (units) { + case 'year': + this.month(0); + /* falls through */ + case 'quarter': + case 'month': + this.date(1); + /* falls through */ + case 'week': + case 'isoWeek': + case 'day': + case 'date': + this.hours(0); + /* falls through */ + case 'hour': + this.minutes(0); + /* falls through */ + case 'minute': + this.seconds(0); + /* falls through */ + case 'second': + this.milliseconds(0); + } + + // weeks are a special case + if (units === 'week') { + this.weekday(0); + } + if (units === 'isoWeek') { + this.isoWeekday(1); + } + + // quarters are also special + if (units === 'quarter') { + this.month(Math.floor(this.month() / 3) * 3); } - function to_type__valueOf () { - return this._d.valueOf() - ((this._offset || 0) * 60000); - } + return this; + } - function unix () { - return Math.floor(this.valueOf() / 1000); + function endOf (units) { + units = normalizeUnits(units); + if (units === undefined || units === 'millisecond') { + return this; } - function toDate () { - return new Date(this.valueOf()); + // 'date' is an alias for 'day', so it should be considered as such. + if (units === 'date') { + units = 'day'; } - function toArray () { - var m = this; - return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()]; - } + return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms'); + } - function toObject () { - var m = this; - return { - years: m.year(), - months: m.month(), - date: m.date(), - hours: m.hours(), - minutes: m.minutes(), - seconds: m.seconds(), - milliseconds: m.milliseconds() - }; - } + function valueOf () { + return this._d.valueOf() - ((this._offset || 0) * 60000); + } - function toJSON () { - // new Date(NaN).toJSON() === null - return this.isValid() ? this.toISOString() : null; - } + function unix () { + return Math.floor(this.valueOf() / 1000); + } - function moment_valid__isValid () { - return valid__isValid(this); - } + function toDate () { + return new Date(this.valueOf()); + } - function parsingFlags () { - return extend({}, getParsingFlags(this)); - } + function toArray () { + var m = this; + return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()]; + } - function invalidAt () { - return getParsingFlags(this).overflow; - } + function toObject () { + var m = this; + return { + years: m.year(), + months: m.month(), + date: m.date(), + hours: m.hours(), + minutes: m.minutes(), + seconds: m.seconds(), + milliseconds: m.milliseconds() + }; + } - function creationData() { - return { - input: this._i, - format: this._f, - locale: this._locale, - isUTC: this._isUTC, - strict: this._strict - }; - } + function toJSON () { + // new Date(NaN).toJSON() === null + return this.isValid() ? this.toISOString() : null; + } - // FORMATTING + function isValid$1 () { + return isValid(this); + } - addFormatToken(0, ['gg', 2], 0, function () { - return this.weekYear() % 100; - }); + function parsingFlags () { + return extend({}, getParsingFlags(this)); + } - addFormatToken(0, ['GG', 2], 0, function () { - return this.isoWeekYear() % 100; - }); + function invalidAt () { + return getParsingFlags(this).overflow; + } - function addWeekYearFormatToken (token, getter) { - addFormatToken(0, [token, token.length], 0, getter); - } + function creationData() { + return { + input: this._i, + format: this._f, + locale: this._locale, + isUTC: this._isUTC, + strict: this._strict + }; + } - addWeekYearFormatToken('gggg', 'weekYear'); - addWeekYearFormatToken('ggggg', 'weekYear'); - addWeekYearFormatToken('GGGG', 'isoWeekYear'); - addWeekYearFormatToken('GGGGG', 'isoWeekYear'); + // FORMATTING - // ALIASES + addFormatToken(0, ['gg', 2], 0, function () { + return this.weekYear() % 100; + }); - addUnitAlias('weekYear', 'gg'); - addUnitAlias('isoWeekYear', 'GG'); + addFormatToken(0, ['GG', 2], 0, function () { + return this.isoWeekYear() % 100; + }); - // PRIORITY + function addWeekYearFormatToken (token, getter) { + addFormatToken(0, [token, token.length], 0, getter); + } - addUnitPriority('weekYear', 1); - addUnitPriority('isoWeekYear', 1); + addWeekYearFormatToken('gggg', 'weekYear'); + addWeekYearFormatToken('ggggg', 'weekYear'); + addWeekYearFormatToken('GGGG', 'isoWeekYear'); + addWeekYearFormatToken('GGGGG', 'isoWeekYear'); + // ALIASES - // PARSING + addUnitAlias('weekYear', 'gg'); + addUnitAlias('isoWeekYear', 'GG'); - addRegexToken('G', matchSigned); - addRegexToken('g', matchSigned); - addRegexToken('GG', match1to2, match2); - addRegexToken('gg', match1to2, match2); - addRegexToken('GGGG', match1to4, match4); - addRegexToken('gggg', match1to4, match4); - addRegexToken('GGGGG', match1to6, match6); - addRegexToken('ggggg', match1to6, match6); + // PRIORITY - addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) { - week[token.substr(0, 2)] = toInt(input); - }); + addUnitPriority('weekYear', 1); + addUnitPriority('isoWeekYear', 1); - addWeekParseToken(['gg', 'GG'], function (input, week, config, token) { - week[token] = utils_hooks__hooks.parseTwoDigitYear(input); - }); - // MOMENTS + // PARSING - function getSetWeekYear (input) { - return getSetWeekYearHelper.call(this, - input, - this.week(), - this.weekday(), - this.localeData()._week.dow, - this.localeData()._week.doy); - } + addRegexToken('G', matchSigned); + addRegexToken('g', matchSigned); + addRegexToken('GG', match1to2, match2); + addRegexToken('gg', match1to2, match2); + addRegexToken('GGGG', match1to4, match4); + addRegexToken('gggg', match1to4, match4); + addRegexToken('GGGGG', match1to6, match6); + addRegexToken('ggggg', match1to6, match6); - function getSetISOWeekYear (input) { - return getSetWeekYearHelper.call(this, - input, this.isoWeek(), this.isoWeekday(), 1, 4); - } + addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) { + week[token.substr(0, 2)] = toInt(input); + }); - function getISOWeeksInYear () { - return weeksInYear(this.year(), 1, 4); - } + addWeekParseToken(['gg', 'GG'], function (input, week, config, token) { + week[token] = hooks.parseTwoDigitYear(input); + }); - function getWeeksInYear () { - var weekInfo = this.localeData()._week; - return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); - } + // MOMENTS - function getSetWeekYearHelper(input, week, weekday, dow, doy) { - var weeksTarget; - if (input == null) { - return weekOfYear(this, dow, doy).year; - } else { - weeksTarget = weeksInYear(input, dow, doy); - if (week > weeksTarget) { - week = weeksTarget; - } - return setWeekAll.call(this, input, week, weekday, dow, doy); + function getSetWeekYear (input) { + return getSetWeekYearHelper.call(this, + input, + this.week(), + this.weekday(), + this.localeData()._week.dow, + this.localeData()._week.doy); + } + + function getSetISOWeekYear (input) { + return getSetWeekYearHelper.call(this, + input, this.isoWeek(), this.isoWeekday(), 1, 4); + } + + function getISOWeeksInYear () { + return weeksInYear(this.year(), 1, 4); + } + + function getWeeksInYear () { + var weekInfo = this.localeData()._week; + return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); + } + + function getSetWeekYearHelper(input, week, weekday, dow, doy) { + var weeksTarget; + if (input == null) { + return weekOfYear(this, dow, doy).year; + } else { + weeksTarget = weeksInYear(input, dow, doy); + if (week > weeksTarget) { + week = weeksTarget; } + return setWeekAll.call(this, input, week, weekday, dow, doy); } + } - function setWeekAll(weekYear, week, weekday, dow, doy) { - var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), - date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear); + function setWeekAll(weekYear, week, weekday, dow, doy) { + var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), + date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear); - this.year(date.getUTCFullYear()); - this.month(date.getUTCMonth()); - this.date(date.getUTCDate()); - return this; - } + this.year(date.getUTCFullYear()); + this.month(date.getUTCMonth()); + this.date(date.getUTCDate()); + return this; + } - // FORMATTING + // FORMATTING - addFormatToken('Q', 0, 'Qo', 'quarter'); + addFormatToken('Q', 0, 'Qo', 'quarter'); - // ALIASES + // ALIASES - addUnitAlias('quarter', 'Q'); + addUnitAlias('quarter', 'Q'); - // PRIORITY + // PRIORITY - addUnitPriority('quarter', 7); + addUnitPriority('quarter', 7); - // PARSING + // PARSING - addRegexToken('Q', match1); - addParseToken('Q', function (input, array) { - array[MONTH] = (toInt(input) - 1) * 3; - }); + addRegexToken('Q', match1); + addParseToken('Q', function (input, array) { + array[MONTH] = (toInt(input) - 1) * 3; + }); - // MOMENTS + // MOMENTS - function getSetQuarter (input) { - return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3); - } + function getSetQuarter (input) { + return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3); + } - // FORMATTING + // FORMATTING - addFormatToken('D', ['DD', 2], 'Do', 'date'); + addFormatToken('D', ['DD', 2], 'Do', 'date'); - // ALIASES + // ALIASES - addUnitAlias('date', 'D'); + addUnitAlias('date', 'D'); - // PRIOROITY - addUnitPriority('date', 9); + // PRIOROITY + addUnitPriority('date', 9); - // PARSING + // PARSING - addRegexToken('D', match1to2); - addRegexToken('DD', match1to2, match2); - addRegexToken('Do', function (isStrict, locale) { - return isStrict ? locale._ordinalParse : locale._ordinalParseLenient; - }); + addRegexToken('D', match1to2); + addRegexToken('DD', match1to2, match2); + addRegexToken('Do', function (isStrict, locale) { + return isStrict ? locale._ordinalParse : locale._ordinalParseLenient; + }); - addParseToken(['D', 'DD'], DATE); - addParseToken('Do', function (input, array) { - array[DATE] = toInt(input.match(match1to2)[0], 10); - }); + addParseToken(['D', 'DD'], DATE); + addParseToken('Do', function (input, array) { + array[DATE] = toInt(input.match(match1to2)[0], 10); + }); - // MOMENTS + // MOMENTS - var getSetDayOfMonth = makeGetSet('Date', true); + var getSetDayOfMonth = makeGetSet('Date', true); - // FORMATTING + // FORMATTING - addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); + addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); - // ALIASES + // ALIASES - addUnitAlias('dayOfYear', 'DDD'); + addUnitAlias('dayOfYear', 'DDD'); - // PRIORITY - addUnitPriority('dayOfYear', 4); + // PRIORITY + addUnitPriority('dayOfYear', 4); - // PARSING + // PARSING - addRegexToken('DDD', match1to3); - addRegexToken('DDDD', match3); - addParseToken(['DDD', 'DDDD'], function (input, array, config) { - config._dayOfYear = toInt(input); - }); + addRegexToken('DDD', match1to3); + addRegexToken('DDDD', match3); + addParseToken(['DDD', 'DDDD'], function (input, array, config) { + config._dayOfYear = toInt(input); + }); - // HELPERS + // HELPERS - // MOMENTS + // MOMENTS - function getSetDayOfYear (input) { - var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1; - return input == null ? dayOfYear : this.add((input - dayOfYear), 'd'); - } + function getSetDayOfYear (input) { + var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1; + return input == null ? dayOfYear : this.add((input - dayOfYear), 'd'); + } - // FORMATTING + // FORMATTING - addFormatToken('m', ['mm', 2], 0, 'minute'); + addFormatToken('m', ['mm', 2], 0, 'minute'); - // ALIASES + // ALIASES - addUnitAlias('minute', 'm'); + addUnitAlias('minute', 'm'); - // PRIORITY + // PRIORITY - addUnitPriority('minute', 14); + addUnitPriority('minute', 14); - // PARSING + // PARSING - addRegexToken('m', match1to2); - addRegexToken('mm', match1to2, match2); - addParseToken(['m', 'mm'], MINUTE); + addRegexToken('m', match1to2); + addRegexToken('mm', match1to2, match2); + addParseToken(['m', 'mm'], MINUTE); - // MOMENTS + // MOMENTS - var getSetMinute = makeGetSet('Minutes', false); + var getSetMinute = makeGetSet('Minutes', false); - // FORMATTING + // FORMATTING - addFormatToken('s', ['ss', 2], 0, 'second'); + addFormatToken('s', ['ss', 2], 0, 'second'); - // ALIASES + // ALIASES - addUnitAlias('second', 's'); + addUnitAlias('second', 's'); - // PRIORITY + // PRIORITY - addUnitPriority('second', 15); + addUnitPriority('second', 15); - // PARSING + // PARSING - addRegexToken('s', match1to2); - addRegexToken('ss', match1to2, match2); - addParseToken(['s', 'ss'], SECOND); + addRegexToken('s', match1to2); + addRegexToken('ss', match1to2, match2); + addParseToken(['s', 'ss'], SECOND); - // MOMENTS + // MOMENTS - var getSetSecond = makeGetSet('Seconds', false); + var getSetSecond = makeGetSet('Seconds', false); - // FORMATTING + // FORMATTING - addFormatToken('S', 0, 0, function () { - return ~~(this.millisecond() / 100); - }); + addFormatToken('S', 0, 0, function () { + return ~~(this.millisecond() / 100); + }); - addFormatToken(0, ['SS', 2], 0, function () { - return ~~(this.millisecond() / 10); - }); + addFormatToken(0, ['SS', 2], 0, function () { + return ~~(this.millisecond() / 10); + }); - addFormatToken(0, ['SSS', 3], 0, 'millisecond'); - addFormatToken(0, ['SSSS', 4], 0, function () { - return this.millisecond() * 10; - }); - addFormatToken(0, ['SSSSS', 5], 0, function () { - return this.millisecond() * 100; - }); - addFormatToken(0, ['SSSSSS', 6], 0, function () { - return this.millisecond() * 1000; - }); - addFormatToken(0, ['SSSSSSS', 7], 0, function () { - return this.millisecond() * 10000; - }); - addFormatToken(0, ['SSSSSSSS', 8], 0, function () { - return this.millisecond() * 100000; - }); - addFormatToken(0, ['SSSSSSSSS', 9], 0, function () { - return this.millisecond() * 1000000; - }); + addFormatToken(0, ['SSS', 3], 0, 'millisecond'); + addFormatToken(0, ['SSSS', 4], 0, function () { + return this.millisecond() * 10; + }); + addFormatToken(0, ['SSSSS', 5], 0, function () { + return this.millisecond() * 100; + }); + addFormatToken(0, ['SSSSSS', 6], 0, function () { + return this.millisecond() * 1000; + }); + addFormatToken(0, ['SSSSSSS', 7], 0, function () { + return this.millisecond() * 10000; + }); + addFormatToken(0, ['SSSSSSSS', 8], 0, function () { + return this.millisecond() * 100000; + }); + addFormatToken(0, ['SSSSSSSSS', 9], 0, function () { + return this.millisecond() * 1000000; + }); - // ALIASES + // ALIASES - addUnitAlias('millisecond', 'ms'); + addUnitAlias('millisecond', 'ms'); - // PRIORITY + // PRIORITY - addUnitPriority('millisecond', 16); + addUnitPriority('millisecond', 16); - // PARSING + // PARSING - addRegexToken('S', match1to3, match1); - addRegexToken('SS', match1to3, match2); - addRegexToken('SSS', match1to3, match3); + addRegexToken('S', match1to3, match1); + addRegexToken('SS', match1to3, match2); + addRegexToken('SSS', match1to3, match3); - var token; - for (token = 'SSSS'; token.length <= 9; token += 'S') { - addRegexToken(token, matchUnsigned); - } + var token; + for (token = 'SSSS'; token.length <= 9; token += 'S') { + addRegexToken(token, matchUnsigned); + } - function parseMs(input, array) { - array[MILLISECOND] = toInt(('0.' + input) * 1000); - } + function parseMs(input, array) { + array[MILLISECOND] = toInt(('0.' + input) * 1000); + } - for (token = 'S'; token.length <= 9; token += 'S') { - addParseToken(token, parseMs); - } - // MOMENTS + for (token = 'S'; token.length <= 9; token += 'S') { + addParseToken(token, parseMs); + } + // MOMENTS - var getSetMillisecond = makeGetSet('Milliseconds', false); + var getSetMillisecond = makeGetSet('Milliseconds', false); - // FORMATTING + // FORMATTING - addFormatToken('z', 0, 0, 'zoneAbbr'); - addFormatToken('zz', 0, 0, 'zoneName'); + addFormatToken('z', 0, 0, 'zoneAbbr'); + addFormatToken('zz', 0, 0, 'zoneName'); - // MOMENTS + // MOMENTS - function getZoneAbbr () { - return this._isUTC ? 'UTC' : ''; - } + function getZoneAbbr () { + return this._isUTC ? 'UTC' : ''; + } - function getZoneName () { - return this._isUTC ? 'Coordinated Universal Time' : ''; - } + function getZoneName () { + return this._isUTC ? 'Coordinated Universal Time' : ''; + } - var momentPrototype__proto = Moment.prototype; - - momentPrototype__proto.add = add_subtract__add; - momentPrototype__proto.calendar = moment_calendar__calendar; - momentPrototype__proto.clone = clone; - momentPrototype__proto.diff = diff; - momentPrototype__proto.endOf = endOf; - momentPrototype__proto.format = format; - momentPrototype__proto.from = from; - momentPrototype__proto.fromNow = fromNow; - momentPrototype__proto.to = to; - momentPrototype__proto.toNow = toNow; - momentPrototype__proto.get = stringGet; - momentPrototype__proto.invalidAt = invalidAt; - momentPrototype__proto.isAfter = isAfter; - momentPrototype__proto.isBefore = isBefore; - momentPrototype__proto.isBetween = isBetween; - momentPrototype__proto.isSame = isSame; - momentPrototype__proto.isSameOrAfter = isSameOrAfter; - momentPrototype__proto.isSameOrBefore = isSameOrBefore; - momentPrototype__proto.isValid = moment_valid__isValid; - momentPrototype__proto.lang = lang; - momentPrototype__proto.locale = locale; - momentPrototype__proto.localeData = localeData; - momentPrototype__proto.max = prototypeMax; - momentPrototype__proto.min = prototypeMin; - momentPrototype__proto.parsingFlags = parsingFlags; - momentPrototype__proto.set = stringSet; - momentPrototype__proto.startOf = startOf; - momentPrototype__proto.subtract = add_subtract__subtract; - momentPrototype__proto.toArray = toArray; - momentPrototype__proto.toObject = toObject; - momentPrototype__proto.toDate = toDate; - momentPrototype__proto.toISOString = moment_format__toISOString; - momentPrototype__proto.toJSON = toJSON; - momentPrototype__proto.toString = toString; - momentPrototype__proto.unix = unix; - momentPrototype__proto.valueOf = to_type__valueOf; - momentPrototype__proto.creationData = creationData; + var proto = Moment.prototype; + + proto.add = add; + proto.calendar = calendar$1; + proto.clone = clone; + proto.diff = diff; + proto.endOf = endOf; + proto.format = format; + proto.from = from; + proto.fromNow = fromNow; + proto.to = to; + proto.toNow = toNow; + proto.get = stringGet; + proto.invalidAt = invalidAt; + proto.isAfter = isAfter; + proto.isBefore = isBefore; + proto.isBetween = isBetween; + proto.isSame = isSame; + proto.isSameOrAfter = isSameOrAfter; + proto.isSameOrBefore = isSameOrBefore; + proto.isValid = isValid$1; + proto.lang = lang; + proto.locale = locale; + proto.localeData = localeData; + proto.max = prototypeMax; + proto.min = prototypeMin; + proto.parsingFlags = parsingFlags; + proto.set = stringSet; + proto.startOf = startOf; + proto.subtract = subtract; + proto.toArray = toArray; + proto.toObject = toObject; + proto.toDate = toDate; + proto.toISOString = toISOString; + proto.inspect = inspect; + proto.toJSON = toJSON; + proto.toString = toString; + proto.unix = unix; + proto.valueOf = valueOf; + proto.creationData = creationData; + + // Year + proto.year = getSetYear; + proto.isLeapYear = getIsLeapYear; + + // Week Year + proto.weekYear = getSetWeekYear; + proto.isoWeekYear = getSetISOWeekYear; + + // Quarter + proto.quarter = proto.quarters = getSetQuarter; + + // Month + proto.month = getSetMonth; + proto.daysInMonth = getDaysInMonth; + + // Week + proto.week = proto.weeks = getSetWeek; + proto.isoWeek = proto.isoWeeks = getSetISOWeek; + proto.weeksInYear = getWeeksInYear; + proto.isoWeeksInYear = getISOWeeksInYear; + + // Day + proto.date = getSetDayOfMonth; + proto.day = proto.days = getSetDayOfWeek; + proto.weekday = getSetLocaleDayOfWeek; + proto.isoWeekday = getSetISODayOfWeek; + proto.dayOfYear = getSetDayOfYear; + + // Hour + proto.hour = proto.hours = getSetHour; + + // Minute + proto.minute = proto.minutes = getSetMinute; + + // Second + proto.second = proto.seconds = getSetSecond; + + // Millisecond + proto.millisecond = proto.milliseconds = getSetMillisecond; + + // Offset + proto.utcOffset = getSetOffset; + proto.utc = setOffsetToUTC; + proto.local = setOffsetToLocal; + proto.parseZone = setOffsetToParsedOffset; + proto.hasAlignedHourOffset = hasAlignedHourOffset; + proto.isDST = isDaylightSavingTime; + proto.isLocal = isLocal; + proto.isUtcOffset = isUtcOffset; + proto.isUtc = isUtc; + proto.isUTC = isUtc; + + // Timezone + proto.zoneAbbr = getZoneAbbr; + proto.zoneName = getZoneName; + + // Deprecations + proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth); + proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth); + proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear); + proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone); + proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted); + + function createUnix (input) { + return createLocal(input * 1000); + } + + function createInZone () { + return createLocal.apply(null, arguments).parseZone(); + } + + function preParsePostFormat (string) { + return string; + } - // Year - momentPrototype__proto.year = getSetYear; - momentPrototype__proto.isLeapYear = getIsLeapYear; + var proto$1 = Locale.prototype; + + proto$1.calendar = calendar; + proto$1.longDateFormat = longDateFormat; + proto$1.invalidDate = invalidDate; + proto$1.ordinal = ordinal; + proto$1.preparse = preParsePostFormat; + proto$1.postformat = preParsePostFormat; + proto$1.relativeTime = relativeTime; + proto$1.pastFuture = pastFuture; + proto$1.set = set; + + // Month + proto$1.months = localeMonths; + proto$1.monthsShort = localeMonthsShort; + proto$1.monthsParse = localeMonthsParse; + proto$1.monthsRegex = monthsRegex; + proto$1.monthsShortRegex = monthsShortRegex; + + // Week + proto$1.week = localeWeek; + proto$1.firstDayOfYear = localeFirstDayOfYear; + proto$1.firstDayOfWeek = localeFirstDayOfWeek; + + // Day of Week + proto$1.weekdays = localeWeekdays; + proto$1.weekdaysMin = localeWeekdaysMin; + proto$1.weekdaysShort = localeWeekdaysShort; + proto$1.weekdaysParse = localeWeekdaysParse; + + proto$1.weekdaysRegex = weekdaysRegex; + proto$1.weekdaysShortRegex = weekdaysShortRegex; + proto$1.weekdaysMinRegex = weekdaysMinRegex; + + // Hours + proto$1.isPM = localeIsPM; + proto$1.meridiem = localeMeridiem; + + function get$1 (format, index, field, setter) { + var locale = getLocale(); + var utc = createUTC().set(setter, index); + return locale[field](utc, format); + } - // Week Year - momentPrototype__proto.weekYear = getSetWeekYear; - momentPrototype__proto.isoWeekYear = getSetISOWeekYear; + function listMonthsImpl (format, index, field) { + if (isNumber(format)) { + index = format; + format = undefined; + } - // Quarter - momentPrototype__proto.quarter = momentPrototype__proto.quarters = getSetQuarter; + format = format || ''; - // Month - momentPrototype__proto.month = getSetMonth; - momentPrototype__proto.daysInMonth = getDaysInMonth; + if (index != null) { + return get$1(format, index, field, 'month'); + } - // Week - momentPrototype__proto.week = momentPrototype__proto.weeks = getSetWeek; - momentPrototype__proto.isoWeek = momentPrototype__proto.isoWeeks = getSetISOWeek; - momentPrototype__proto.weeksInYear = getWeeksInYear; - momentPrototype__proto.isoWeeksInYear = getISOWeeksInYear; - - // Day - momentPrototype__proto.date = getSetDayOfMonth; - momentPrototype__proto.day = momentPrototype__proto.days = getSetDayOfWeek; - momentPrototype__proto.weekday = getSetLocaleDayOfWeek; - momentPrototype__proto.isoWeekday = getSetISODayOfWeek; - momentPrototype__proto.dayOfYear = getSetDayOfYear; - - // Hour - momentPrototype__proto.hour = momentPrototype__proto.hours = getSetHour; - - // Minute - momentPrototype__proto.minute = momentPrototype__proto.minutes = getSetMinute; - - // Second - momentPrototype__proto.second = momentPrototype__proto.seconds = getSetSecond; - - // Millisecond - momentPrototype__proto.millisecond = momentPrototype__proto.milliseconds = getSetMillisecond; - - // Offset - momentPrototype__proto.utcOffset = getSetOffset; - momentPrototype__proto.utc = setOffsetToUTC; - momentPrototype__proto.local = setOffsetToLocal; - momentPrototype__proto.parseZone = setOffsetToParsedOffset; - momentPrototype__proto.hasAlignedHourOffset = hasAlignedHourOffset; - momentPrototype__proto.isDST = isDaylightSavingTime; - momentPrototype__proto.isLocal = isLocal; - momentPrototype__proto.isUtcOffset = isUtcOffset; - momentPrototype__proto.isUtc = isUtc; - momentPrototype__proto.isUTC = isUtc; - - // Timezone - momentPrototype__proto.zoneAbbr = getZoneAbbr; - momentPrototype__proto.zoneName = getZoneName; - - // Deprecations - momentPrototype__proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth); - momentPrototype__proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth); - momentPrototype__proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear); - momentPrototype__proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone); - momentPrototype__proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted); - - var momentPrototype = momentPrototype__proto; - - function moment__createUnix (input) { - return local__createLocal(input * 1000); - } - - function moment__createInZone () { - return local__createLocal.apply(null, arguments).parseZone(); - } - - function preParsePostFormat (string) { - return string; - } - - var prototype__proto = Locale.prototype; - - prototype__proto.calendar = locale_calendar__calendar; - prototype__proto.longDateFormat = longDateFormat; - prototype__proto.invalidDate = invalidDate; - prototype__proto.ordinal = ordinal; - prototype__proto.preparse = preParsePostFormat; - prototype__proto.postformat = preParsePostFormat; - prototype__proto.relativeTime = relative__relativeTime; - prototype__proto.pastFuture = pastFuture; - prototype__proto.set = locale_set__set; - - // Month - prototype__proto.months = localeMonths; - prototype__proto.monthsShort = localeMonthsShort; - prototype__proto.monthsParse = localeMonthsParse; - prototype__proto.monthsRegex = monthsRegex; - prototype__proto.monthsShortRegex = monthsShortRegex; - - // Week - prototype__proto.week = localeWeek; - prototype__proto.firstDayOfYear = localeFirstDayOfYear; - prototype__proto.firstDayOfWeek = localeFirstDayOfWeek; - - // Day of Week - prototype__proto.weekdays = localeWeekdays; - prototype__proto.weekdaysMin = localeWeekdaysMin; - prototype__proto.weekdaysShort = localeWeekdaysShort; - prototype__proto.weekdaysParse = localeWeekdaysParse; - - prototype__proto.weekdaysRegex = weekdaysRegex; - prototype__proto.weekdaysShortRegex = weekdaysShortRegex; - prototype__proto.weekdaysMinRegex = weekdaysMinRegex; - - // Hours - prototype__proto.isPM = localeIsPM; - prototype__proto.meridiem = localeMeridiem; - - function lists__get (format, index, field, setter) { - var locale = locale_locales__getLocale(); - var utc = create_utc__createUTC().set(setter, index); - return locale[field](utc, format); - } + var i; + var out = []; + for (i = 0; i < 12; i++) { + out[i] = get$1(format, i, field, 'month'); + } + return out; + } - function listMonthsImpl (format, index, field) { - if (typeof format === 'number') { + // () + // (5) + // (fmt, 5) + // (fmt) + // (true) + // (true, 5) + // (true, fmt, 5) + // (true, fmt) + function listWeekdaysImpl (localeSorted, format, index, field) { + if (typeof localeSorted === 'boolean') { + if (isNumber(format)) { index = format; format = undefined; } format = format || ''; + } else { + format = localeSorted; + index = format; + localeSorted = false; - if (index != null) { - return lists__get(format, index, field, 'month'); + if (isNumber(format)) { + index = format; + format = undefined; } - var i; - var out = []; - for (i = 0; i < 12; i++) { - out[i] = lists__get(format, i, field, 'month'); - } - return out; - } - - // () - // (5) - // (fmt, 5) - // (fmt) - // (true) - // (true, 5) - // (true, fmt, 5) - // (true, fmt) - function listWeekdaysImpl (localeSorted, format, index, field) { - if (typeof localeSorted === 'boolean') { - if (typeof format === 'number') { - index = format; - format = undefined; - } + format = format || ''; + } - format = format || ''; - } else { - format = localeSorted; - index = format; - localeSorted = false; + var locale = getLocale(), + shift = localeSorted ? locale._week.dow : 0; - if (typeof format === 'number') { - index = format; - format = undefined; - } + if (index != null) { + return get$1(format, (index + shift) % 7, field, 'day'); + } - format = format || ''; - } + var i; + var out = []; + for (i = 0; i < 7; i++) { + out[i] = get$1(format, (i + shift) % 7, field, 'day'); + } + return out; + } - var locale = locale_locales__getLocale(), - shift = localeSorted ? locale._week.dow : 0; + function listMonths (format, index) { + return listMonthsImpl(format, index, 'months'); + } - if (index != null) { - return lists__get(format, (index + shift) % 7, field, 'day'); - } + function listMonthsShort (format, index) { + return listMonthsImpl(format, index, 'monthsShort'); + } - var i; - var out = []; - for (i = 0; i < 7; i++) { - out[i] = lists__get(format, (i + shift) % 7, field, 'day'); - } - return out; - } + function listWeekdays (localeSorted, format, index) { + return listWeekdaysImpl(localeSorted, format, index, 'weekdays'); + } - function lists__listMonths (format, index) { - return listMonthsImpl(format, index, 'months'); - } + function listWeekdaysShort (localeSorted, format, index) { + return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort'); + } - function lists__listMonthsShort (format, index) { - return listMonthsImpl(format, index, 'monthsShort'); - } + function listWeekdaysMin (localeSorted, format, index) { + return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin'); + } - function lists__listWeekdays (localeSorted, format, index) { - return listWeekdaysImpl(localeSorted, format, index, 'weekdays'); + getSetGlobalLocale('en', { + ordinalParse: /\d{1,2}(th|st|nd|rd)/, + ordinal : function (number) { + var b = number % 10, + output = (toInt(number % 100 / 10) === 1) ? 'th' : + (b === 1) ? 'st' : + (b === 2) ? 'nd' : + (b === 3) ? 'rd' : 'th'; + return number + output; } + }); - function lists__listWeekdaysShort (localeSorted, format, index) { - return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort'); - } + // Side effect imports + hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale); + hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale); - function lists__listWeekdaysMin (localeSorted, format, index) { - return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin'); - } + var mathAbs = Math.abs; - locale_locales__getSetGlobalLocale('en', { - ordinalParse: /\d{1,2}(th|st|nd|rd)/, - ordinal : function (number) { - var b = number % 10, - output = (toInt(number % 100 / 10) === 1) ? 'th' : - (b === 1) ? 'st' : - (b === 2) ? 'nd' : - (b === 3) ? 'rd' : 'th'; - return number + output; - } - }); + function abs () { + var data = this._data; - // Side effect imports - utils_hooks__hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', locale_locales__getSetGlobalLocale); - utils_hooks__hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', locale_locales__getLocale); + this._milliseconds = mathAbs(this._milliseconds); + this._days = mathAbs(this._days); + this._months = mathAbs(this._months); - var mathAbs = Math.abs; + data.milliseconds = mathAbs(data.milliseconds); + data.seconds = mathAbs(data.seconds); + data.minutes = mathAbs(data.minutes); + data.hours = mathAbs(data.hours); + data.months = mathAbs(data.months); + data.years = mathAbs(data.years); - function duration_abs__abs () { - var data = this._data; + return this; + } - this._milliseconds = mathAbs(this._milliseconds); - this._days = mathAbs(this._days); - this._months = mathAbs(this._months); + function addSubtract$1 (duration, input, value, direction) { + var other = createDuration(input, value); - data.milliseconds = mathAbs(data.milliseconds); - data.seconds = mathAbs(data.seconds); - data.minutes = mathAbs(data.minutes); - data.hours = mathAbs(data.hours); - data.months = mathAbs(data.months); - data.years = mathAbs(data.years); + duration._milliseconds += direction * other._milliseconds; + duration._days += direction * other._days; + duration._months += direction * other._months; - return this; - } + return duration._bubble(); + } - function duration_add_subtract__addSubtract (duration, input, value, direction) { - var other = create__createDuration(input, value); + // supports only 2.0-style add(1, 's') or add(duration) + function add$1 (input, value) { + return addSubtract$1(this, input, value, 1); + } - duration._milliseconds += direction * other._milliseconds; - duration._days += direction * other._days; - duration._months += direction * other._months; + // supports only 2.0-style subtract(1, 's') or subtract(duration) + function subtract$1 (input, value) { + return addSubtract$1(this, input, value, -1); + } - return duration._bubble(); + function absCeil (number) { + if (number < 0) { + return Math.floor(number); + } else { + return Math.ceil(number); } + } - // supports only 2.0-style add(1, 's') or add(duration) - function duration_add_subtract__add (input, value) { - return duration_add_subtract__addSubtract(this, input, value, 1); - } + function bubble () { + var milliseconds = this._milliseconds; + var days = this._days; + var months = this._months; + var data = this._data; + var seconds, minutes, hours, years, monthsFromDays; - // supports only 2.0-style subtract(1, 's') or subtract(duration) - function duration_add_subtract__subtract (input, value) { - return duration_add_subtract__addSubtract(this, input, value, -1); + // if we have a mix of positive and negative values, bubble down first + // check: https://github.com/moment/moment/issues/2166 + if (!((milliseconds >= 0 && days >= 0 && months >= 0) || + (milliseconds <= 0 && days <= 0 && months <= 0))) { + milliseconds += absCeil(monthsToDays(months) + days) * 864e5; + days = 0; + months = 0; } - function absCeil (number) { - if (number < 0) { - return Math.floor(number); - } else { - return Math.ceil(number); - } - } + // The following code bubbles up values, see the tests for + // examples of what that means. + data.milliseconds = milliseconds % 1000; - function bubble () { - var milliseconds = this._milliseconds; - var days = this._days; - var months = this._months; - var data = this._data; - var seconds, minutes, hours, years, monthsFromDays; + seconds = absFloor(milliseconds / 1000); + data.seconds = seconds % 60; - // if we have a mix of positive and negative values, bubble down first - // check: https://github.com/moment/moment/issues/2166 - if (!((milliseconds >= 0 && days >= 0 && months >= 0) || - (milliseconds <= 0 && days <= 0 && months <= 0))) { - milliseconds += absCeil(monthsToDays(months) + days) * 864e5; - days = 0; - months = 0; - } + minutes = absFloor(seconds / 60); + data.minutes = minutes % 60; - // The following code bubbles up values, see the tests for - // examples of what that means. - data.milliseconds = milliseconds % 1000; + hours = absFloor(minutes / 60); + data.hours = hours % 24; - seconds = absFloor(milliseconds / 1000); - data.seconds = seconds % 60; + days += absFloor(hours / 24); - minutes = absFloor(seconds / 60); - data.minutes = minutes % 60; + // convert days to months + monthsFromDays = absFloor(daysToMonths(days)); + months += monthsFromDays; + days -= absCeil(monthsToDays(monthsFromDays)); - hours = absFloor(minutes / 60); - data.hours = hours % 24; + // 12 months -> 1 year + years = absFloor(months / 12); + months %= 12; - days += absFloor(hours / 24); + data.days = days; + data.months = months; + data.years = years; - // convert days to months - monthsFromDays = absFloor(daysToMonths(days)); - months += monthsFromDays; - days -= absCeil(monthsToDays(monthsFromDays)); + return this; + } - // 12 months -> 1 year - years = absFloor(months / 12); - months %= 12; + function daysToMonths (days) { + // 400 years have 146097 days (taking into account leap year rules) + // 400 years have 12 months === 4800 + return days * 4800 / 146097; + } - data.days = days; - data.months = months; - data.years = years; + function monthsToDays (months) { + // the reverse of daysToMonths + return months * 146097 / 4800; + } - return this; - } + function as (units) { + var days; + var months; + var milliseconds = this._milliseconds; - function daysToMonths (days) { - // 400 years have 146097 days (taking into account leap year rules) - // 400 years have 12 months === 4800 - return days * 4800 / 146097; - } + units = normalizeUnits(units); - function monthsToDays (months) { - // the reverse of daysToMonths - return months * 146097 / 4800; + if (units === 'month' || units === 'year') { + days = this._days + milliseconds / 864e5; + months = this._months + daysToMonths(days); + return units === 'month' ? months : months / 12; + } else { + // handle milliseconds separately because of floating point math errors (issue #1867) + days = this._days + Math.round(monthsToDays(this._months)); + switch (units) { + case 'week' : return days / 7 + milliseconds / 6048e5; + case 'day' : return days + milliseconds / 864e5; + case 'hour' : return days * 24 + milliseconds / 36e5; + case 'minute' : return days * 1440 + milliseconds / 6e4; + case 'second' : return days * 86400 + milliseconds / 1000; + // Math.floor prevents floating point math errors here + case 'millisecond': return Math.floor(days * 864e5) + milliseconds; + default: throw new Error('Unknown unit ' + units); + } } + } - function as (units) { - var days; - var months; - var milliseconds = this._milliseconds; + // TODO: Use this.as('ms')? + function valueOf$1 () { + return ( + this._milliseconds + + this._days * 864e5 + + (this._months % 12) * 2592e6 + + toInt(this._months / 12) * 31536e6 + ); + } - units = normalizeUnits(units); + function makeAs (alias) { + return function () { + return this.as(alias); + }; + } - if (units === 'month' || units === 'year') { - days = this._days + milliseconds / 864e5; - months = this._months + daysToMonths(days); - return units === 'month' ? months : months / 12; - } else { - // handle milliseconds separately because of floating point math errors (issue #1867) - days = this._days + Math.round(monthsToDays(this._months)); - switch (units) { - case 'week' : return days / 7 + milliseconds / 6048e5; - case 'day' : return days + milliseconds / 864e5; - case 'hour' : return days * 24 + milliseconds / 36e5; - case 'minute' : return days * 1440 + milliseconds / 6e4; - case 'second' : return days * 86400 + milliseconds / 1000; - // Math.floor prevents floating point math errors here - case 'millisecond': return Math.floor(days * 864e5) + milliseconds; - default: throw new Error('Unknown unit ' + units); - } - } - } + var asMilliseconds = makeAs('ms'); + var asSeconds = makeAs('s'); + var asMinutes = makeAs('m'); + var asHours = makeAs('h'); + var asDays = makeAs('d'); + var asWeeks = makeAs('w'); + var asMonths = makeAs('M'); + var asYears = makeAs('y'); + + function get$2 (units) { + units = normalizeUnits(units); + return this[units + 's'](); + } - // TODO: Use this.as('ms')? - function duration_as__valueOf () { - return ( - this._milliseconds + - this._days * 864e5 + - (this._months % 12) * 2592e6 + - toInt(this._months / 12) * 31536e6 - ); - } + function makeGetter(name) { + return function () { + return this._data[name]; + }; + } - function makeAs (alias) { - return function () { - return this.as(alias); - }; - } + var milliseconds = makeGetter('milliseconds'); + var seconds = makeGetter('seconds'); + var minutes = makeGetter('minutes'); + var hours = makeGetter('hours'); + var days = makeGetter('days'); + var months = makeGetter('months'); + var years = makeGetter('years'); - var asMilliseconds = makeAs('ms'); - var asSeconds = makeAs('s'); - var asMinutes = makeAs('m'); - var asHours = makeAs('h'); - var asDays = makeAs('d'); - var asWeeks = makeAs('w'); - var asMonths = makeAs('M'); - var asYears = makeAs('y'); + function weeks () { + return absFloor(this.days() / 7); + } - function duration_get__get (units) { - units = normalizeUnits(units); - return this[units + 's'](); - } + var round = Math.round; + var thresholds = { + s: 45, // seconds to minute + m: 45, // minutes to hour + h: 22, // hours to day + d: 26, // days to month + M: 11 // months to year + }; - function makeGetter(name) { - return function () { - return this._data[name]; - }; - } + // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize + function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) { + return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture); + } - var milliseconds = makeGetter('milliseconds'); - var seconds = makeGetter('seconds'); - var minutes = makeGetter('minutes'); - var hours = makeGetter('hours'); - var days = makeGetter('days'); - var months = makeGetter('months'); - var years = makeGetter('years'); + function relativeTime$1 (posNegDuration, withoutSuffix, locale) { + var duration = createDuration(posNegDuration).abs(); + var seconds = round(duration.as('s')); + var minutes = round(duration.as('m')); + var hours = round(duration.as('h')); + var days = round(duration.as('d')); + var months = round(duration.as('M')); + var years = round(duration.as('y')); + + var a = seconds < thresholds.s && ['s', seconds] || + minutes <= 1 && ['m'] || + minutes < thresholds.m && ['mm', minutes] || + hours <= 1 && ['h'] || + hours < thresholds.h && ['hh', hours] || + days <= 1 && ['d'] || + days < thresholds.d && ['dd', days] || + months <= 1 && ['M'] || + months < thresholds.M && ['MM', months] || + years <= 1 && ['y'] || ['yy', years]; + + a[2] = withoutSuffix; + a[3] = +posNegDuration > 0; + a[4] = locale; + return substituteTimeAgo.apply(null, a); + } - function weeks () { - return absFloor(this.days() / 7); + // This function allows you to set the rounding function for relative time strings + function getSetRelativeTimeRounding (roundingFunction) { + if (roundingFunction === undefined) { + return round; } + if (typeof(roundingFunction) === 'function') { + round = roundingFunction; + return true; + } + return false; + } - var round = Math.round; - var thresholds = { - s: 45, // seconds to minute - m: 45, // minutes to hour - h: 22, // hours to day - d: 26, // days to month - M: 11 // months to year - }; - - // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize - function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) { - return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture); - } - - function duration_humanize__relativeTime (posNegDuration, withoutSuffix, locale) { - var duration = create__createDuration(posNegDuration).abs(); - var seconds = round(duration.as('s')); - var minutes = round(duration.as('m')); - var hours = round(duration.as('h')); - var days = round(duration.as('d')); - var months = round(duration.as('M')); - var years = round(duration.as('y')); - - var a = seconds < thresholds.s && ['s', seconds] || - minutes <= 1 && ['m'] || - minutes < thresholds.m && ['mm', minutes] || - hours <= 1 && ['h'] || - hours < thresholds.h && ['hh', hours] || - days <= 1 && ['d'] || - days < thresholds.d && ['dd', days] || - months <= 1 && ['M'] || - months < thresholds.M && ['MM', months] || - years <= 1 && ['y'] || ['yy', years]; - - a[2] = withoutSuffix; - a[3] = +posNegDuration > 0; - a[4] = locale; - return substituteTimeAgo.apply(null, a); - } - - // This function allows you to set the rounding function for relative time strings - function duration_humanize__getSetRelativeTimeRounding (roundingFunction) { - if (roundingFunction === undefined) { - return round; - } - if (typeof(roundingFunction) === 'function') { - round = roundingFunction; - return true; - } + // This function allows you to set a threshold for relative time strings + function getSetRelativeTimeThreshold (threshold, limit) { + if (thresholds[threshold] === undefined) { return false; } + if (limit === undefined) { + return thresholds[threshold]; + } + thresholds[threshold] = limit; + return true; + } - // This function allows you to set a threshold for relative time strings - function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) { - if (thresholds[threshold] === undefined) { - return false; - } - if (limit === undefined) { - return thresholds[threshold]; - } - thresholds[threshold] = limit; - return true; + function humanize (withSuffix) { + var locale = this.localeData(); + var output = relativeTime$1(this, !withSuffix, locale); + + if (withSuffix) { + output = locale.pastFuture(+this, output); } - function humanize (withSuffix) { - var locale = this.localeData(); - var output = duration_humanize__relativeTime(this, !withSuffix, locale); - - if (withSuffix) { - output = locale.pastFuture(+this, output); - } - - return locale.postformat(output); - } - - var iso_string__abs = Math.abs; - - function iso_string__toISOString() { - // for ISO strings we do not use the normal bubbling rules: - // * milliseconds bubble up until they become hours - // * days do not bubble at all - // * months bubble up until they become years - // This is because there is no context-free conversion between hours and days - // (think of clock changes) - // and also not between days and months (28-31 days per month) - var seconds = iso_string__abs(this._milliseconds) / 1000; - var days = iso_string__abs(this._days); - var months = iso_string__abs(this._months); - var minutes, hours, years; - - // 3600 seconds -> 60 minutes -> 1 hour - minutes = absFloor(seconds / 60); - hours = absFloor(minutes / 60); - seconds %= 60; - minutes %= 60; - - // 12 months -> 1 year - years = absFloor(months / 12); - months %= 12; - - - // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js - var Y = years; - var M = months; - var D = days; - var h = hours; - var m = minutes; - var s = seconds; - var total = this.asSeconds(); - - if (!total) { - // this is the same as C#'s (Noda) and python (isodate)... - // but not other JS (goog.date) - return 'P0D'; - } - - return (total < 0 ? '-' : '') + - 'P' + - (Y ? Y + 'Y' : '') + - (M ? M + 'M' : '') + - (D ? D + 'D' : '') + - ((h || m || s) ? 'T' : '') + - (h ? h + 'H' : '') + - (m ? m + 'M' : '') + - (s ? s + 'S' : ''); - } - - var duration_prototype__proto = Duration.prototype; - - duration_prototype__proto.abs = duration_abs__abs; - duration_prototype__proto.add = duration_add_subtract__add; - duration_prototype__proto.subtract = duration_add_subtract__subtract; - duration_prototype__proto.as = as; - duration_prototype__proto.asMilliseconds = asMilliseconds; - duration_prototype__proto.asSeconds = asSeconds; - duration_prototype__proto.asMinutes = asMinutes; - duration_prototype__proto.asHours = asHours; - duration_prototype__proto.asDays = asDays; - duration_prototype__proto.asWeeks = asWeeks; - duration_prototype__proto.asMonths = asMonths; - duration_prototype__proto.asYears = asYears; - duration_prototype__proto.valueOf = duration_as__valueOf; - duration_prototype__proto._bubble = bubble; - duration_prototype__proto.get = duration_get__get; - duration_prototype__proto.milliseconds = milliseconds; - duration_prototype__proto.seconds = seconds; - duration_prototype__proto.minutes = minutes; - duration_prototype__proto.hours = hours; - duration_prototype__proto.days = days; - duration_prototype__proto.weeks = weeks; - duration_prototype__proto.months = months; - duration_prototype__proto.years = years; - duration_prototype__proto.humanize = humanize; - duration_prototype__proto.toISOString = iso_string__toISOString; - duration_prototype__proto.toString = iso_string__toISOString; - duration_prototype__proto.toJSON = iso_string__toISOString; - duration_prototype__proto.locale = locale; - duration_prototype__proto.localeData = localeData; - - // Deprecations - duration_prototype__proto.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', iso_string__toISOString); - duration_prototype__proto.lang = lang; - - // Side effect imports - - // FORMATTING - - addFormatToken('X', 0, 0, 'unix'); - addFormatToken('x', 0, 0, 'valueOf'); - - // PARSING - - addRegexToken('x', matchSigned); - addRegexToken('X', matchTimestamp); - addParseToken('X', function (input, array, config) { - config._d = new Date(parseFloat(input, 10) * 1000); - }); - addParseToken('x', function (input, array, config) { - config._d = new Date(toInt(input)); - }); + return locale.postformat(output); + } - // Side effect imports - - - utils_hooks__hooks.version = '2.15.2'; - - setHookCallback(local__createLocal); - - utils_hooks__hooks.fn = momentPrototype; - utils_hooks__hooks.min = min; - utils_hooks__hooks.max = max; - utils_hooks__hooks.now = now; - utils_hooks__hooks.utc = create_utc__createUTC; - utils_hooks__hooks.unix = moment__createUnix; - utils_hooks__hooks.months = lists__listMonths; - utils_hooks__hooks.isDate = isDate; - utils_hooks__hooks.locale = locale_locales__getSetGlobalLocale; - utils_hooks__hooks.invalid = valid__createInvalid; - utils_hooks__hooks.duration = create__createDuration; - utils_hooks__hooks.isMoment = isMoment; - utils_hooks__hooks.weekdays = lists__listWeekdays; - utils_hooks__hooks.parseZone = moment__createInZone; - utils_hooks__hooks.localeData = locale_locales__getLocale; - utils_hooks__hooks.isDuration = isDuration; - utils_hooks__hooks.monthsShort = lists__listMonthsShort; - utils_hooks__hooks.weekdaysMin = lists__listWeekdaysMin; - utils_hooks__hooks.defineLocale = defineLocale; - utils_hooks__hooks.updateLocale = updateLocale; - utils_hooks__hooks.locales = locale_locales__listLocales; - utils_hooks__hooks.weekdaysShort = lists__listWeekdaysShort; - utils_hooks__hooks.normalizeUnits = normalizeUnits; - utils_hooks__hooks.relativeTimeRounding = duration_humanize__getSetRelativeTimeRounding; - utils_hooks__hooks.relativeTimeThreshold = duration_humanize__getSetRelativeTimeThreshold; - utils_hooks__hooks.calendarFormat = getCalendarFormat; - utils_hooks__hooks.prototype = momentPrototype; - - var _moment = utils_hooks__hooks; - - return _moment; + var abs$1 = Math.abs; + + function toISOString$1() { + // for ISO strings we do not use the normal bubbling rules: + // * milliseconds bubble up until they become hours + // * days do not bubble at all + // * months bubble up until they become years + // This is because there is no context-free conversion between hours and days + // (think of clock changes) + // and also not between days and months (28-31 days per month) + var seconds = abs$1(this._milliseconds) / 1000; + var days = abs$1(this._days); + var months = abs$1(this._months); + var minutes, hours, years; + + // 3600 seconds -> 60 minutes -> 1 hour + minutes = absFloor(seconds / 60); + hours = absFloor(minutes / 60); + seconds %= 60; + minutes %= 60; + + // 12 months -> 1 year + years = absFloor(months / 12); + months %= 12; + + + // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js + var Y = years; + var M = months; + var D = days; + var h = hours; + var m = minutes; + var s = seconds; + var total = this.asSeconds(); + + if (!total) { + // this is the same as C#'s (Noda) and python (isodate)... + // but not other JS (goog.date) + return 'P0D'; + } + + return (total < 0 ? '-' : '') + + 'P' + + (Y ? Y + 'Y' : '') + + (M ? M + 'M' : '') + + (D ? D + 'D' : '') + + ((h || m || s) ? 'T' : '') + + (h ? h + 'H' : '') + + (m ? m + 'M' : '') + + (s ? s + 'S' : ''); + } - })); - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)(module))) + var proto$2 = Duration.prototype; + + proto$2.abs = abs; + proto$2.add = add$1; + proto$2.subtract = subtract$1; + proto$2.as = as; + proto$2.asMilliseconds = asMilliseconds; + proto$2.asSeconds = asSeconds; + proto$2.asMinutes = asMinutes; + proto$2.asHours = asHours; + proto$2.asDays = asDays; + proto$2.asWeeks = asWeeks; + proto$2.asMonths = asMonths; + proto$2.asYears = asYears; + proto$2.valueOf = valueOf$1; + proto$2._bubble = bubble; + proto$2.get = get$2; + proto$2.milliseconds = milliseconds; + proto$2.seconds = seconds; + proto$2.minutes = minutes; + proto$2.hours = hours; + proto$2.days = days; + proto$2.weeks = weeks; + proto$2.months = months; + proto$2.years = years; + proto$2.humanize = humanize; + proto$2.toISOString = toISOString$1; + proto$2.toString = toISOString$1; + proto$2.toJSON = toISOString$1; + proto$2.locale = locale; + proto$2.localeData = localeData; + + // Deprecations + proto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1); + proto$2.lang = lang; + + // Side effect imports + + // FORMATTING + + addFormatToken('X', 0, 0, 'unix'); + addFormatToken('x', 0, 0, 'valueOf'); + + // PARSING + + addRegexToken('x', matchSigned); + addRegexToken('X', matchTimestamp); + addParseToken('X', function (input, array, config) { + config._d = new Date(parseFloat(input, 10) * 1000); + }); + addParseToken('x', function (input, array, config) { + config._d = new Date(toInt(input)); + }); + + // Side effect imports + + + hooks.version = '2.17.1'; + + setHookCallback(createLocal); + + hooks.fn = proto; + hooks.min = min; + hooks.max = max; + hooks.now = now; + hooks.utc = createUTC; + hooks.unix = createUnix; + hooks.months = listMonths; + hooks.isDate = isDate; + hooks.locale = getSetGlobalLocale; + hooks.invalid = createInvalid; + hooks.duration = createDuration; + hooks.isMoment = isMoment; + hooks.weekdays = listWeekdays; + hooks.parseZone = createInZone; + hooks.localeData = getLocale; + hooks.isDuration = isDuration; + hooks.monthsShort = listMonthsShort; + hooks.weekdaysMin = listWeekdaysMin; + hooks.defineLocale = defineLocale; + hooks.updateLocale = updateLocale; + hooks.locales = listLocales; + hooks.weekdaysShort = listWeekdaysShort; + hooks.normalizeUnits = normalizeUnits; + hooks.relativeTimeRounding = getSetRelativeTimeRounding; + hooks.relativeTimeThreshold = getSetRelativeTimeThreshold; + hooks.calendarFormat = getCalendarFormat; + hooks.prototype = proto; + + return hooks; + + }))); + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(86)(module))) /***/ }, -/* 4 */ +/* 86 */ /***/ function(module, exports) { - module.exports = function(module) { - if(!module.webpackPolyfill) { - module.deprecate = function() {}; - module.paths = []; - // module.parent = undefined by default - module.children = []; - module.webpackPolyfill = 1; - } - return module; - } + module.exports = function(module) { + if(!module.webpackPolyfill) { + module.deprecate = function() {}; + module.paths = []; + // module.parent = undefined by default + module.children = []; + module.webpackPolyfill = 1; + } + return module; + } /***/ }, -/* 5 */ +/* 87 */ /***/ function(module, exports) { function webpackContext(req) { @@ -5808,11 +7390,11 @@ return /******/ (function(modules) { // webpackBootstrap webpackContext.keys = function() { return []; }; webpackContext.resolve = webpackContext; module.exports = webpackContext; - webpackContext.id = 5; + webpackContext.id = 87; /***/ }, -/* 6 */ +/* 88 */ /***/ function(module, exports) { /* WEBPACK VAR INJECTION */(function(global) {'use strict'; @@ -6028,38 +7610,38 @@ return /******/ (function(modules) { // webpackBootstrap /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) /***/ }, -/* 7 */ +/* 89 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; // utils exports.util = __webpack_require__(1); - exports.DOMutil = __webpack_require__(8); + exports.DOMutil = __webpack_require__(90); // data - exports.DataSet = __webpack_require__(9); - exports.DataView = __webpack_require__(11); - exports.Queue = __webpack_require__(10); + exports.DataSet = __webpack_require__(91); + exports.DataView = __webpack_require__(93); + exports.Queue = __webpack_require__(92); // Graph3d - exports.Graph3d = __webpack_require__(12); + exports.Graph3d = __webpack_require__(94); exports.graph3d = { - Camera: __webpack_require__(16), - Filter: __webpack_require__(17), - Point2d: __webpack_require__(15), - Point3d: __webpack_require__(14), - Slider: __webpack_require__(18), - StepNumber: __webpack_require__(19) + Camera: __webpack_require__(98), + Filter: __webpack_require__(103), + Point2d: __webpack_require__(97), + Point3d: __webpack_require__(96), + Slider: __webpack_require__(104), + StepNumber: __webpack_require__(105) }; // bundled external libraries - exports.moment = __webpack_require__(2); - exports.Hammer = __webpack_require__(22); - exports.keycharm = __webpack_require__(25); + exports.moment = __webpack_require__(84); + exports.Hammer = __webpack_require__(108); + exports.keycharm = __webpack_require__(111); /***/ }, -/* 8 */ +/* 90 */ /***/ function(module, exports) { 'use strict'; @@ -6272,15 +7854,27 @@ return /******/ (function(modules) { // webpackBootstrap }; /***/ }, -/* 9 */ +/* 91 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + var _stringify = __webpack_require__(82); + + var _stringify2 = _interopRequireDefault(_stringify); + + var _typeof2 = __webpack_require__(62); + + var _typeof3 = _interopRequireDefault(_typeof2); + + var _keys = __webpack_require__(58); + + var _keys2 = _interopRequireDefault(_keys); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var util = __webpack_require__(1); - var Queue = __webpack_require__(10); + var Queue = __webpack_require__(92); /** * DataSet @@ -6341,7 +7935,7 @@ return /******/ (function(modules) { // webpackBootstrap // all variants of a Date are internally stored as Date, so we can convert // from everything to everything (also from ISODate to Number for example) if (this._options.type) { - var fields = Object.keys(this._options.type); + var fields = (0, _keys2['default'])(this._options.type); for (var i = 0, len = fields.length; i < len; i++) { var field = fields[i]; var value = this._options.type[field]; @@ -6393,7 +7987,7 @@ return /******/ (function(modules) { // webpackBootstrap }); } - if (_typeof(options.queue) === 'object') { + if ((0, _typeof3['default'])(options.queue) === 'object') { this._queue.setOptions(options.queue); } } @@ -6652,7 +8246,7 @@ return /******/ (function(modules) { // webpackBootstrap } } else { // return all items - itemIds = Object.keys(this._data); + itemIds = (0, _keys2['default'])(this._data); for (i = 0, len = itemIds.length; i < len; i++) { itemId = itemIds[i]; item = me._getItem(itemId, type); @@ -6712,7 +8306,7 @@ return /******/ (function(modules) { // webpackBootstrap filter = options && options.filter, order = options && options.order, type = options && options.type || this._options.type, - itemIds = Object.keys(data), + itemIds = (0, _keys2['default'])(data), i, len, id, @@ -6798,7 +8392,7 @@ return /******/ (function(modules) { // webpackBootstrap var filter = options && options.filter, type = options && options.type || this._options.type, data = this._data, - itemIds = Object.keys(data), + itemIds = (0, _keys2['default'])(data), i, len, item, @@ -6841,7 +8435,7 @@ return /******/ (function(modules) { // webpackBootstrap type = options && options.type || this._options.type, mappedItems = [], data = this._data, - itemIds = Object.keys(data), + itemIds = (0, _keys2['default'])(data), i, len, id, @@ -6878,7 +8472,7 @@ return /******/ (function(modules) { // webpackBootstrap } var filteredItem = {}, - itemFields = Object.keys(item), + itemFields = (0, _keys2['default'])(item), len = itemFields.length, i, field; @@ -6951,7 +8545,7 @@ return /******/ (function(modules) { // webpackBootstrap item = this._remove(ids[i]); if (item) { itemId = item[this._fieldId]; - if (itemId) { + if (itemId != undefined) { removedIds.push(itemId); removedItems.push(item); } @@ -6998,7 +8592,7 @@ return /******/ (function(modules) { // webpackBootstrap */ DataSet.prototype.clear = function (senderId) { var i, len; - var ids = Object.keys(this._data); + var ids = (0, _keys2['default'])(this._data); var items = []; for (i = 0, len = ids.length; i < len; i++) { @@ -7020,7 +8614,7 @@ return /******/ (function(modules) { // webpackBootstrap */ DataSet.prototype.max = function (field) { var data = this._data, - itemIds = Object.keys(data), + itemIds = (0, _keys2['default'])(data), max = null, maxField = null, i, @@ -7046,7 +8640,7 @@ return /******/ (function(modules) { // webpackBootstrap */ DataSet.prototype.min = function (field) { var data = this._data, - itemIds = Object.keys(data), + itemIds = (0, _keys2['default'])(data), min = null, minField = null, i, @@ -7074,7 +8668,7 @@ return /******/ (function(modules) { // webpackBootstrap */ DataSet.prototype.distinct = function (field) { var data = this._data; - var itemIds = Object.keys(data); + var itemIds = (0, _keys2['default'])(data); var values = []; var fieldType = this._options.type && this._options.type[field] || null; var count = 0; @@ -7128,7 +8722,7 @@ return /******/ (function(modules) { // webpackBootstrap } var d = {}, - fields = Object.keys(item), + fields = (0, _keys2['default'])(item), i, len; for (i = 0, len = fields.length; i < len; i++) { @@ -7160,7 +8754,7 @@ return /******/ (function(modules) { // webpackBootstrap // convert the items field types var converted = {}, - fields = Object.keys(raw); + fields = (0, _keys2['default'])(raw); if (types) { for (i = 0, len = fields.length; i < len; i++) { @@ -7176,6 +8770,11 @@ return /******/ (function(modules) { // webpackBootstrap converted[field] = value; } } + + if (!converted[this._fieldId]) { + converted[this._fieldId] = raw.id; + } + return converted; }; @@ -7190,7 +8789,7 @@ return /******/ (function(modules) { // webpackBootstrap DataSet.prototype._updateItem = function (item) { var id = item[this._fieldId]; if (id == undefined) { - throw new Error('Cannot update item: item has no id (item: ' + JSON.stringify(item) + ')'); + throw new Error('Cannot update item: item has no id (item: ' + (0, _stringify2['default'])(item) + ')'); } var d = this._data[id]; if (!d) { @@ -7199,7 +8798,7 @@ return /******/ (function(modules) { // webpackBootstrap } // merge with current item - var fields = Object.keys(item); + var fields = (0, _keys2['default'])(item); for (var i = 0, len = fields.length; i < len; i++) { var field = fields[i]; var fieldType = this._type[field]; // type may be undefined @@ -7212,7 +8811,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = DataSet; /***/ }, -/* 10 */ +/* 92 */ /***/ function(module, exports) { 'use strict'; @@ -7417,13 +9016,19 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = Queue; /***/ }, -/* 11 */ +/* 93 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; + var _keys = __webpack_require__(58); + + var _keys2 = _interopRequireDefault(_keys); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + var util = __webpack_require__(1); - var DataSet = __webpack_require__(9); + var DataSet = __webpack_require__(91); /** * DataView @@ -7509,7 +9114,7 @@ return /******/ (function(modules) { // webpackBootstrap DataView.prototype.refresh = function () { var id, i, len; var ids = this._data.getIds({ filter: this._options && this._options.filter }), - oldIds = Object.keys(this._ids), + oldIds = (0, _keys2['default'])(this._ids), newIds = {}, addedIds = [], removedIds = [], @@ -7530,7 +9135,7 @@ return /******/ (function(modules) { // webpackBootstrap id = oldIds[i]; if (!newIds[id]) { removedIds.push(id); - removedItems.push(this._data[id]); + removedItems.push(this._data._data[id]); delete this._ids[id]; } } @@ -7812,22 +9417,22 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = DataView; /***/ }, -/* 12 */ +/* 94 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var Emitter = __webpack_require__(13);var DataSet = __webpack_require__(9); - var DataView = __webpack_require__(11); + var Emitter = __webpack_require__(95);var DataSet = __webpack_require__(91); + var DataView = __webpack_require__(93); var util = __webpack_require__(1); - var Point3d = __webpack_require__(14); - var Point2d = __webpack_require__(15); - var Camera = __webpack_require__(16); - var Filter = __webpack_require__(17); - var Slider = __webpack_require__(18); - var StepNumber = __webpack_require__(19); - var Range = __webpack_require__(20); - var Settings = __webpack_require__(21); + var Point3d = __webpack_require__(96); + var Point2d = __webpack_require__(97); + var Camera = __webpack_require__(98); + var Filter = __webpack_require__(103); + var Slider = __webpack_require__(104); + var StepNumber = __webpack_require__(105); + var Range = __webpack_require__(106); + var Settings = __webpack_require__(107); /// enumerate the available styles Graph3d.STYLE = Settings.STYLE; @@ -8483,6 +10088,9 @@ return /******/ (function(modules) { // webpackBootstrap var ontooltip = function ontooltip(event) { me._onTooltip(event); }; + var onclick = function onclick(event) { + me._onClick(event); + }; // TODO: these events are never cleaned up... can give a 'memory leakage' util.addEventListener(this.frame.canvas, 'keydown', onkeydown); @@ -8490,6 +10098,7 @@ return /******/ (function(modules) { // webpackBootstrap util.addEventListener(this.frame.canvas, 'touchstart', ontouchstart); util.addEventListener(this.frame.canvas, 'mousewheel', onmousewheel); util.addEventListener(this.frame.canvas, 'mousemove', ontooltip); + util.addEventListener(this.frame.canvas, 'click', onclick); // add the new graph to the container element this.containerElement.appendChild(this.frame); @@ -8497,13 +10106,8 @@ return /******/ (function(modules) { // webpackBootstrap /** * Set a new size for the graph - * - * @param {string} width Width in pixels or percentage (for example '800px' - * or '50%') - * @param {string} height Height in pixels or percentage (for example '400px' - * or '30%') */ - Graph3d.prototype.setSize = function (width, height) { + Graph3d.prototype._setSize = function (width, height) { this.frame.style.width = width; this.frame.style.height = height; @@ -8623,7 +10227,7 @@ return /******/ (function(modules) { // webpackBootstrap Settings.setOptions(options, this); this.setPointDrawingMethod(); - this.setSize(this.width, this.height); + this._setSize(this.width, this.height); // re-load the data if (this.dataTable) { @@ -8729,7 +10333,7 @@ return /******/ (function(modules) { // webpackBootstrap }; /** - * Get legend width + * Get legend width */ Graph3d.prototype._getLegendWidth = function () { var width; @@ -8746,30 +10350,30 @@ return /******/ (function(modules) { // webpackBootstrap }; /** - * Redraw the legend based on size, dot color, or surface height + * Redraw the legend based on size, dot color, or surface height */ Graph3d.prototype._redrawLegend = function () { - //Return without drawing anything, if no legend is specified + //Return without drawing anything, if no legend is specified if (this.showLegend !== true) { return; } // Do not draw legend when graph style does not support - if (this.style === Graph3d.STYLE.LINE || this.style === Graph3d.STYLE.BARSIZE //TODO add legend support for BARSIZE + if (this.style === Graph3d.STYLE.LINE || this.style === Graph3d.STYLE.BARSIZE //TODO add legend support for BARSIZE ) { return; } - // Legend types - size and color. Determine if size legend. + // Legend types - size and color. Determine if size legend. var isSizeLegend = this.style === Graph3d.STYLE.BARSIZE || this.style === Graph3d.STYLE.DOTSIZE; - // Legend is either tracking z values or style values. This flag if false means use z values. + // Legend is either tracking z values or style values. This flag if false means use z values. var isValueLegend = this.style === Graph3d.STYLE.DOTSIZE || this.style === Graph3d.STYLE.DOTCOLOR || this.style === Graph3d.STYLE.BARCOLOR; var height = Math.max(this.frame.clientHeight * 0.25, 100); var top = this.margin; - var width = this._getLegendWidth(); // px - overwritten by size legend + var width = this._getLegendWidth(); // px - overwritten by size legend var right = this.frame.clientWidth - this.margin; var left = right - width; var bottom = top + height; @@ -8799,13 +10403,13 @@ return /******/ (function(modules) { // webpackBootstrap ctx.strokeRect(left, top, width, height); } else { - // draw the size legend box + // draw the size legend box var widthMin; if (this.style === Graph3d.STYLE.DOTSIZE) { var dotSize = this._dotSize(); widthMin = dotSize / 2; // px } else if (this.style === Graph3d.STYLE.BARSIZE) { - //widthMin = this.xBarWidth * 0.2 this is wrong - barwidth measures in terms of xvalues + //widthMin = this.xBarWidth * 0.2 this is wrong - barwidth measures in terms of xvalues } ctx.strokeStyle = this.axisColor; ctx.fillStyle = this.dataColor.fill; @@ -8819,7 +10423,7 @@ return /******/ (function(modules) { // webpackBootstrap ctx.stroke(); } - // print value text along the legend edge + // print value text along the legend edge var gridLineLen = 5; // px var legendMin = isValueLegend ? this.valueRange.min : this.zRange.min; @@ -9155,7 +10759,7 @@ return /******/ (function(modules) { // webpackBootstrap var xLabel = this.xLabel; if (xLabel.length > 0) { yOffset = 0.1 / this.scale.y; - xText = xRange.center() / 2; + xText = (xRange.max + 3 * xRange.min) / 4; yText = armVector.x > 0 ? yRange.min - yOffset : yRange.max + yOffset; text = new Point3d(xText, yText, zRange.min); this.drawAxisLabelX(ctx, text, xLabel, armAngle); @@ -9166,7 +10770,7 @@ return /******/ (function(modules) { // webpackBootstrap if (yLabel.length > 0) { xOffset = 0.1 / this.scale.x; xText = armVector.y > 0 ? xRange.min - xOffset : xRange.max + xOffset; - yText = yRange.center() / 2; + yText = (yRange.max + 3 * yRange.min) / 4; text = new Point3d(xText, yText, zRange.min); this.drawAxisLabelY(ctx, text, yLabel, armAngle); @@ -9178,7 +10782,7 @@ return /******/ (function(modules) { // webpackBootstrap offset = 30; // pixels. // TODO: relate to the max width of the values on the z axis? xText = armVector.x > 0 ? xRange.min : xRange.max; yText = armVector.y < 0 ? yRange.min : yRange.max; - zText = zRange.center() / 2; + zText = (zRange.max + 3 * zRange.min) / 4; text = new Point3d(xText, yText, zText); this.drawAxisLabelZ(ctx, text, zLabel, offset); @@ -9298,7 +10902,7 @@ return /******/ (function(modules) { // webpackBootstrap /** * Draw a polygon using the passed points and fill it with the passed style and stroke. * - * @param points an array of points. + * @param points an array of points. * @param fillStyle optional; the fill style to set * @param strokeStyle optional; the stroke style to set */ @@ -9359,13 +10963,24 @@ return /******/ (function(modules) { // webpackBootstrap /** * Get the colors for the 'color' graph styles. * These styles are currently: 'bar-color' and 'dot-color' + * Color may be set as a string representation of HTML color, like #ff00ff, + * or calculated from a number, for example, distance from this point + * The first option is useful when we have some pre-given legend, to which we have to adjust ourselves + * The second option is useful when we are interested in automatically setting the color, from some value, + * using some color scale */ Graph3d.prototype._getColorsColor = function (point) { // calculate the color based on the value - var hue = (1 - (point.point.value - this.valueRange.min) * this.scale.value) * 240; - var color = this._hsv2rgb(hue, 1, 1); - var borderColor = this._hsv2rgb(hue, 1, 0.8); + var color, borderColor; + if (typeof point.point.value === "string") { + color = point.point.value; + borderColor = point.point.value; + } else { + var hue = (1 - (point.point.value - this.valueRange.min) * this.scale.value) * 240; + color = this._hsv2rgb(hue, 1, 1); + borderColor = this._hsv2rgb(hue, 1, 0.8); + } return { fill: color, border: borderColor @@ -9614,6 +11229,18 @@ return /******/ (function(modules) { // webpackBootstrap // End methods for drawing points per graph style. // ----------------------------------------------------------------------------- + /** + * Store startX, startY and startOffset for mouse operations + * + * @param {Event} event The event that occurred + */ + Graph3d.prototype._storeMousePosition = function (event) { + // get mouse position (different code for IE and all other browsers) + this.startMouseX = getMouseX(event); + this.startMouseY = getMouseY(event); + + this._startCameraOffset = this.camera.getOffset(); + }; /** * Start a moving operation inside the provided parent element @@ -9633,9 +11260,7 @@ return /******/ (function(modules) { // webpackBootstrap this.leftButtonDown = event.which ? event.which === 1 : event.button === 1; if (!this.leftButtonDown && !this.touchDown) return; - // get mouse position (different code for IE and all other browsers) - this.startMouseX = getMouseX(event); - this.startMouseY = getMouseY(event); + this._storeMousePosition(event); this.startStart = new Date(this.start); this.startEnd = new Date(this.end); @@ -9664,36 +11289,50 @@ return /******/ (function(modules) { // webpackBootstrap * @param {Event} event Well, eehh, the event */ Graph3d.prototype._onMouseMove = function (event) { + this.moving = true; event = event || window.event; // calculate change in mouse position var diffX = parseFloat(getMouseX(event)) - this.startMouseX; var diffY = parseFloat(getMouseY(event)) - this.startMouseY; - var horizontalNew = this.startArmRotation.horizontal + diffX / 200; - var verticalNew = this.startArmRotation.vertical + diffY / 200; + // move with ctrl or rotate by other + if (event && event.ctrlKey === true) { + // calculate change in mouse position + var scaleX = this.frame.clientWidth * 0.5; + var scaleY = this.frame.clientHeight * 0.5; - var snapAngle = 4; // degrees - var snapValue = Math.sin(snapAngle / 360 * 2 * Math.PI); + var offXNew = (this._startCameraOffset.x || 0) - diffX / scaleX * this.camera.armLength * 0.8; + var offYNew = (this._startCameraOffset.y || 0) + diffY / scaleY * this.camera.armLength * 0.8; - // snap horizontally to nice angles at 0pi, 0.5pi, 1pi, 1.5pi, etc... - // the -0.001 is to take care that the vertical axis is always drawn at the left front corner - if (Math.abs(Math.sin(horizontalNew)) < snapValue) { - horizontalNew = Math.round(horizontalNew / Math.PI) * Math.PI - 0.001; - } - if (Math.abs(Math.cos(horizontalNew)) < snapValue) { - horizontalNew = (Math.round(horizontalNew / Math.PI - 0.5) + 0.5) * Math.PI - 0.001; - } + this.camera.setOffset(offXNew, offYNew); + this._storeMousePosition(event); + } else { + var horizontalNew = this.startArmRotation.horizontal + diffX / 200; + var verticalNew = this.startArmRotation.vertical + diffY / 200; - // snap vertically to nice angles - if (Math.abs(Math.sin(verticalNew)) < snapValue) { - verticalNew = Math.round(verticalNew / Math.PI) * Math.PI; - } - if (Math.abs(Math.cos(verticalNew)) < snapValue) { - verticalNew = (Math.round(verticalNew / Math.PI - 0.5) + 0.5) * Math.PI; + var snapAngle = 4; // degrees + var snapValue = Math.sin(snapAngle / 360 * 2 * Math.PI); + + // snap horizontally to nice angles at 0pi, 0.5pi, 1pi, 1.5pi, etc... + // the -0.001 is to take care that the vertical axis is always drawn at the left front corner + if (Math.abs(Math.sin(horizontalNew)) < snapValue) { + horizontalNew = Math.round(horizontalNew / Math.PI) * Math.PI - 0.001; + } + if (Math.abs(Math.cos(horizontalNew)) < snapValue) { + horizontalNew = (Math.round(horizontalNew / Math.PI - 0.5) + 0.5) * Math.PI - 0.001; + } + + // snap vertically to nice angles + if (Math.abs(Math.sin(verticalNew)) < snapValue) { + verticalNew = Math.round(verticalNew / Math.PI) * Math.PI; + } + if (Math.abs(Math.cos(verticalNew)) < snapValue) { + verticalNew = (Math.round(verticalNew / Math.PI - 0.5) + 0.5) * Math.PI; + } + this.camera.setArmRotation(horizontalNew, verticalNew); } - this.camera.setArmRotation(horizontalNew, verticalNew); this.redraw(); // fire a cameraPositionChange event @@ -9718,6 +11357,24 @@ return /******/ (function(modules) { // webpackBootstrap util.preventDefault(event); }; + /** + * @param {event} event The event + */ + Graph3d.prototype._onClick = function (event) { + if (!this.onclick_callback) return; + if (!this.moving) { + var boundingRect = this.frame.getBoundingClientRect(); + var mouseX = getMouseX(event) - boundingRect.left; + var mouseY = getMouseY(event) - boundingRect.top; + var dataPoint = this._dataPointFromXY(mouseX, mouseY); + if (dataPoint) this.onclick_callback(dataPoint.point.data); + } else { + // disable onclick callback, if it came immediately after rotate/pan + this.moving = false; + } + util.preventDefault(event); + }; + /** * After having moved the mouse, a tooltip should pop up when the mouse is resting on a data point * @param {Event} event A mouse move event @@ -10077,6 +11734,19 @@ return /******/ (function(modules) { // webpackBootstrap this.redraw(); }; + /** + * Set a new size for the graph + * + * @param {string} width Width in pixels or percentage (for example '800px' + * or '50%') + * @param {string} height Height in pixels or percentage (for example '400px' + * or '30%') + */ + Graph3d.prototype.setSize = function (width, height) { + this._setSize(width, height); + this.redraw(); + }; + // ----------------------------------------------------------------------------- // End public methods for specific settings // ----------------------------------------------------------------------------- @@ -10085,7 +11755,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = Graph3d; /***/ }, -/* 13 */ +/* 95 */ /***/ function(module, exports) { @@ -10255,7 +11925,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 14 */ +/* 96 */ /***/ function(module, exports) { "use strict"; @@ -10338,7 +12008,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = Point3d; /***/ }, -/* 15 */ +/* 97 */ /***/ function(module, exports) { "use strict"; @@ -10356,12 +12026,18 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = Point2d; /***/ }, -/* 16 */ +/* 98 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var Point3d = __webpack_require__(14); + var _sign = __webpack_require__(99); + + var _sign2 = _interopRequireDefault(_sign); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var Point3d = __webpack_require__(96); /** * @class Camera @@ -10379,6 +12055,8 @@ return /******/ (function(modules) { // webpackBootstrap this.armRotation.horizontal = 0; this.armRotation.vertical = 0; this.armLength = 1.7; + this.cameraOffset = new Point3d(); + this.offsetMultiplier = 0.6; this.cameraLocation = new Point3d(); this.cameraRotation = new Point3d(0.5 * Math.PI, 0, 0); @@ -10386,6 +12064,36 @@ return /******/ (function(modules) { // webpackBootstrap this.calculateCameraOrientation(); } + /** + * Set offset camera in camera coordinates + * @param {Number} x offset by camera horisontal + * @param {Number} y offset by camera vertical + */ + Camera.prototype.setOffset = function (x, y) { + var abs = Math.abs, + sign = _sign2['default'], + mul = this.offsetMultiplier, + border = this.armLength * mul; + + if (abs(x) > border) { + x = sign(x) * border; + } + if (abs(y) > border) { + y = sign(y) * border; + } + this.cameraOffset.x = x; + this.cameraOffset.y = y; + this.calculateCameraOrientation(); + }; + + /** + * Get camera offset by horizontal and vertical + * @return {Point3d} x - horizontal offset, y - vertical offset, z - not used + */ + Camera.prototype.getOffset = function (x, y) { + return this.cameraOffset; + }; + /** * Set the location (origin) of the arm * @param {Number} x Normalized value of x @@ -10451,6 +12159,7 @@ return /******/ (function(modules) { // webpackBootstrap if (this.armLength < 0.71) this.armLength = 0.71; if (this.armLength > 5.0) this.armLength = 5.0; + this.setOffset(this.cameraOffset.x, this.cameraOffset.y); this.calculateCameraOrientation(); }; @@ -10492,17 +12201,60 @@ return /******/ (function(modules) { // webpackBootstrap this.cameraRotation.x = Math.PI / 2 - this.armRotation.vertical; this.cameraRotation.y = 0; this.cameraRotation.z = -this.armRotation.horizontal; + + var xa = this.cameraRotation.x; + var ya = this.cameraRotation.y; + var za = this.cameraRotation.z; + var dx = this.cameraOffset.x; + var dy = this.cameraOffset.y; + var sin = Math.sin, + cos = Math.cos; + + this.cameraLocation.x = this.cameraLocation.x + dx * cos(za) + dy * -sin(za) * cos(xa); + this.cameraLocation.y = this.cameraLocation.y + dx * sin(za) + dy * cos(za) * cos(xa); + this.cameraLocation.z = this.cameraLocation.z + dy * sin(xa); }; module.exports = Camera; /***/ }, -/* 17 */ +/* 99 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = { "default": __webpack_require__(100), __esModule: true }; + +/***/ }, +/* 100 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(101); + module.exports = __webpack_require__(17).Math.sign; + +/***/ }, +/* 101 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.28 Math.sign(x) + var $export = __webpack_require__(15); + + $export($export.S, 'Math', {sign: __webpack_require__(102)}); + +/***/ }, +/* 102 */ +/***/ function(module, exports) { + + // 20.2.2.28 Math.sign(x) + module.exports = Math.sign || function sign(x){ + return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; + }; + +/***/ }, +/* 103 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var DataView = __webpack_require__(11); + var DataView = __webpack_require__(93); /** * @class Filter @@ -10708,7 +12460,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = Filter; /***/ }, -/* 18 */ +/* 104 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -11056,7 +12808,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = Slider; /***/ }, -/* 19 */ +/* 105 */ /***/ function(module, exports) { 'use strict'; @@ -11234,7 +12986,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = StepNumber; /***/ }, -/* 20 */ +/* 106 */ /***/ function(module, exports) { 'use strict'; @@ -11332,19 +13084,23 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = Range; /***/ }, -/* 21 */ +/* 107 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + var _typeof2 = __webpack_require__(62); + + var _typeof3 = _interopRequireDefault(_typeof2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } //////////////////////////////////////////////////////////////////////////////// // This modules handles the options for Graph3d. // //////////////////////////////////////////////////////////////////////////////// - var Camera = __webpack_require__(16); - var Point3d = __webpack_require__(14); + var Camera = __webpack_require__(98); + var Point3d = __webpack_require__(96); // enumerate the available styles var STYLE = { @@ -11412,7 +13168,7 @@ return /******/ (function(modules) { // webpackBootstrap * Source: http://stackoverflow.com/a/1026087 */ function capitalize(str) { - if (str === undefined || str === "") { + if (str === undefined || str === "" || typeof str != "string") { return str; } @@ -11510,6 +13266,7 @@ return /******/ (function(modules) { // webpackBootstrap dst.margin = 10; // px dst.showGrayBottom = false; // TODO: this does not work correctly dst.showTooltip = false; + dst.onclick_callback = null; dst.eye = new Point3d(0, 0, -1); // TODO: set eye.z about 3/4 of the width of the window? } @@ -11553,6 +13310,9 @@ return /******/ (function(modules) { // webpackBootstrap if (src.tooltip !== undefined) { dst.showTooltip = src.tooltip; } + if (src.onclick != undefined) { + dst.onclick_callback = src.onclick; + } } /** @@ -11651,7 +13411,7 @@ return /******/ (function(modules) { // webpackBootstrap fill = backgroundColor; stroke = 'none'; strokeWidth = 0; - } else if ((typeof backgroundColor === 'undefined' ? 'undefined' : _typeof(backgroundColor)) === 'object') { + } else if ((typeof backgroundColor === 'undefined' ? 'undefined' : (0, _typeof3['default'])(backgroundColor)) === 'object') { if (backgroundColor.fill !== undefined) fill = backgroundColor.fill; if (backgroundColor.stroke !== undefined) stroke = backgroundColor.stroke; if (backgroundColor.strokeWidth !== undefined) strokeWidth = backgroundColor.strokeWidth; @@ -11710,7 +13470,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports.setCameraPosition = setCameraPosition; /***/ }, -/* 22 */ +/* 108 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -11718,8 +13478,8 @@ return /******/ (function(modules) { // webpackBootstrap // Only load hammer.js when in a browser environment // (loading hammer.js in a node.js environment gives errors) if (typeof window !== 'undefined') { - var propagating = __webpack_require__(23); - var Hammer = window['Hammer'] || __webpack_require__(24); + var propagating = __webpack_require__(109); + var Hammer = window['Hammer'] || __webpack_require__(110); module.exports = propagating(Hammer, { preventDefault: 'mouse' }); @@ -11730,7 +13490,7 @@ return /******/ (function(modules) { // webpackBootstrap } /***/ }, -/* 23 */ +/* 109 */ /***/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;'use strict'; @@ -11967,7 +13727,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 24 */ +/* 110 */ /***/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__;/*! Hammer.JS - v2.0.7 - 2016-04-22 @@ -14616,7 +16376,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 25 */ +/* 111 */ /***/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;"use strict"; @@ -14815,91 +16575,91 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 26 */ +/* 112 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; // utils exports.util = __webpack_require__(1); - exports.DOMutil = __webpack_require__(8); + exports.DOMutil = __webpack_require__(90); // data - exports.DataSet = __webpack_require__(9); - exports.DataView = __webpack_require__(11); - exports.Queue = __webpack_require__(10); + exports.DataSet = __webpack_require__(91); + exports.DataView = __webpack_require__(93); + exports.Queue = __webpack_require__(92); // Timeline - exports.Timeline = __webpack_require__(27); - exports.Graph2d = __webpack_require__(52); + exports.Timeline = __webpack_require__(113); + exports.Graph2d = __webpack_require__(144); exports.timeline = { - Core: __webpack_require__(35), - DateUtil: __webpack_require__(34), - Range: __webpack_require__(32), - stack: __webpack_require__(39), - TimeStep: __webpack_require__(37), + Core: __webpack_require__(126), + DateUtil: __webpack_require__(125), + Range: __webpack_require__(123), + stack: __webpack_require__(131), + TimeStep: __webpack_require__(129), components: { items: { - Item: __webpack_require__(41), - BackgroundItem: __webpack_require__(45), - BoxItem: __webpack_require__(43), - PointItem: __webpack_require__(44), - RangeItem: __webpack_require__(40) + Item: __webpack_require__(133), + BackgroundItem: __webpack_require__(137), + BoxItem: __webpack_require__(135), + PointItem: __webpack_require__(136), + RangeItem: __webpack_require__(132) }, - BackgroundGroup: __webpack_require__(42), - Component: __webpack_require__(33), - CurrentTime: __webpack_require__(50), - CustomTime: __webpack_require__(48), - DataAxis: __webpack_require__(54), - DataScale: __webpack_require__(55), - GraphGroup: __webpack_require__(56), - Group: __webpack_require__(38), - ItemSet: __webpack_require__(36), - Legend: __webpack_require__(60), - LineGraph: __webpack_require__(53), - TimeAxis: __webpack_require__(46) + BackgroundGroup: __webpack_require__(134), + Component: __webpack_require__(124), + CurrentTime: __webpack_require__(142), + CustomTime: __webpack_require__(140), + DataAxis: __webpack_require__(146), + DataScale: __webpack_require__(147), + GraphGroup: __webpack_require__(148), + Group: __webpack_require__(130), + ItemSet: __webpack_require__(127), + Legend: __webpack_require__(152), + LineGraph: __webpack_require__(145), + TimeAxis: __webpack_require__(138) } }; // bundled external libraries - exports.moment = __webpack_require__(2); - exports.Hammer = __webpack_require__(22); - exports.keycharm = __webpack_require__(25); + exports.moment = __webpack_require__(84); + exports.Hammer = __webpack_require__(108); + exports.keycharm = __webpack_require__(111); /***/ }, -/* 27 */ +/* 113 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var _Configurator = __webpack_require__(28); + var _Configurator = __webpack_require__(114); var _Configurator2 = _interopRequireDefault(_Configurator); - var _Validator = __webpack_require__(31); + var _Validator = __webpack_require__(122); var _Validator2 = _interopRequireDefault(_Validator); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - var Emitter = __webpack_require__(13); - var Hammer = __webpack_require__(22); - var moment = __webpack_require__(2); + var Emitter = __webpack_require__(95); + var Hammer = __webpack_require__(108); + var moment = __webpack_require__(84); var util = __webpack_require__(1); - var DataSet = __webpack_require__(9); - var DataView = __webpack_require__(11); - var Range = __webpack_require__(32); - var Core = __webpack_require__(35); - var TimeAxis = __webpack_require__(46); - var CurrentTime = __webpack_require__(50); - var CustomTime = __webpack_require__(48); - var ItemSet = __webpack_require__(36); + var DataSet = __webpack_require__(91); + var DataView = __webpack_require__(93); + var Range = __webpack_require__(123); + var Core = __webpack_require__(126); + var TimeAxis = __webpack_require__(138); + var CurrentTime = __webpack_require__(142); + var CustomTime = __webpack_require__(140); + var ItemSet = __webpack_require__(127); - var printStyle = __webpack_require__(31).printStyle; - var allOptions = __webpack_require__(51).allOptions; - var configureOptions = __webpack_require__(51).configureOptions; + var printStyle = __webpack_require__(122).printStyle; + var allOptions = __webpack_require__(143).allOptions; + var configureOptions = __webpack_require__(143).configureOptions; /** * Create a timeline visualization @@ -14923,6 +16683,12 @@ return /******/ (function(modules) { // webpackBootstrap groups = forthArgument; } + // TODO: REMOVE THIS in the next MAJOR release + // see https://github.com/almende/vis/issues/2511 + if (options && options.throttleRedraw) { + console.warn("Timeline option \"throttleRedraw\" is DEPRICATED and no longer supported. It will be removed in the next MAJOR release."); + } + var me = this; this.defaultOptions = { start: null, @@ -14942,7 +16708,6 @@ return /******/ (function(modules) { // webpackBootstrap // Create the DOM, props, and emitter this._create(container); - if (!options || options && typeof options.rtl == "undefined") { var directionFromDom, domNode = this.dom.root; @@ -14955,6 +16720,8 @@ return /******/ (function(modules) { // webpackBootstrap this.options.rtl = options.rtl; } + this.options.rollingMode = options && options.rollingMode; + // all components listed here will be repainted automatically this.components = []; @@ -15003,20 +16770,26 @@ return /******/ (function(modules) { // webpackBootstrap this.itemsData = null; // DataSet this.groupsData = null; // DataSet - this.on('tap', function (event) { + this.dom.root.onclick = function (event) { me.emit('click', me.getEventProperties(event)); - }); - this.on('doubletap', function (event) { + }; + this.dom.root.ondblclick = function (event) { me.emit('doubleClick', me.getEventProperties(event)); - }); + }; this.dom.root.oncontextmenu = function (event) { me.emit('contextmenu', me.getEventProperties(event)); }; + this.dom.root.onmouseover = function (event) { + me.emit('mouseOver', me.getEventProperties(event)); + }; + this.dom.root.onmousemove = function (event) { + me.emit('mouseMove', me.getEventProperties(event)); + }; //Single time autoscale/fit this.fitDone = false; this.on('changed', function () { - if (this.itemsData == null) return; + if (this.itemsData == null || this.options.rollingMode) return; if (!me.fitDone) { me.fitDone = true; if (me.options.start != undefined || me.options.end != undefined) { @@ -15026,7 +16799,6 @@ return /******/ (function(modules) { // webpackBootstrap var start = me.options.start != undefined ? me.options.start : range.min; var end = me.options.end != undefined ? me.options.end : range.max; - me.setWindow(start, end, { animation: false }); } else { me.fit({ animation: false }); @@ -15062,7 +16834,7 @@ return /******/ (function(modules) { // webpackBootstrap * @private */ Timeline.prototype._createConfigurator = function () { - return new _Configurator2.default(this, this.dom.container, configureOptions); + return new _Configurator2['default'](this, this.dom.container, configureOptions); }; /** @@ -15079,7 +16851,7 @@ return /******/ (function(modules) { // webpackBootstrap Timeline.prototype.setOptions = function (options) { // validate options - var errorFound = _Validator2.default.validate(options, allOptions); + var errorFound = _Validator2['default'].validate(options, allOptions); if (errorFound === true) { console.log('%cErrors have been found in the supplied options object.', printStyle); @@ -15137,11 +16909,16 @@ return /******/ (function(modules) { // webpackBootstrap var newDataSet; if (!groups) { newDataSet = null; - } else if (groups instanceof DataSet || groups instanceof DataView) { - newDataSet = groups; } else { - // turn an array into a dataset - newDataSet = new DataSet(groups); + var filter = function filter(group) { + return group.visible !== false; + }; + if (groups instanceof DataSet || groups instanceof DataView) { + newDataSet = new DataView(groups, { filter: filter }); + } else { + // turn an array into a dataset + newDataSet = new DataSet(groups.filter(filter)); + } } this.groupsData = newDataSet; @@ -15314,8 +17091,10 @@ return /******/ (function(modules) { // webpackBootstrap } factor = interval / _this.props.center.width; util.forEach(_this.itemSet.items, function (item) { - item.show(); - item.repositionX(); + if (item.groupShowing) { + item.show(); + item.repositionX(); + } var start = getStart(item); var end = getEnd(item); @@ -15451,7 +17230,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = Timeline; /***/ }, -/* 28 */ +/* 114 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -15460,17 +17239,27 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + var _stringify = __webpack_require__(82); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _stringify2 = _interopRequireDefault(_stringify); - var _ColorPicker = __webpack_require__(29); + var _typeof2 = __webpack_require__(62); - var _ColorPicker2 = _interopRequireDefault(_ColorPicker); + var _typeof3 = _interopRequireDefault(_typeof2); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var _classCallCheck2 = __webpack_require__(115); + + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _createClass2 = __webpack_require__(116); + + var _createClass3 = _interopRequireDefault(_createClass2); + + var _ColorPicker = __webpack_require__(120); + + var _ColorPicker2 = _interopRequireDefault(_ColorPicker); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var util = __webpack_require__(1); @@ -15491,8 +17280,7 @@ return /******/ (function(modules) { // webpackBootstrap var Configurator = function () { function Configurator(parentModule, defaultContainer, configureOptions) { var pixelRatio = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1; - - _classCallCheck(this, Configurator); + (0, _classCallCheck3['default'])(this, Configurator); this.parent = parentModule; this.changedOptions = []; @@ -15516,7 +17304,7 @@ return /******/ (function(modules) { // webpackBootstrap this.popupDiv = {}; this.popupLimit = 5; this.popupHistory = {}; - this.colorPicker = new _ColorPicker2.default(pixelRatio); + this.colorPicker = new _ColorPicker2['default'](pixelRatio); this.wrapper = undefined; } @@ -15528,7 +17316,7 @@ return /******/ (function(modules) { // webpackBootstrap */ - _createClass(Configurator, [{ + (0, _createClass3['default'])(Configurator, [{ key: 'setOptions', value: function setOptions(options) { if (options !== undefined) { @@ -15541,7 +17329,7 @@ return /******/ (function(modules) { // webpackBootstrap this.options.filter = options; } else if (options instanceof Array) { this.options.filter = options.join(); - } else if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) === 'object') { + } else if ((typeof options === 'undefined' ? 'undefined' : (0, _typeof3['default'])(options)) === 'object') { if (options.container !== undefined) { this.options.container = options.container; } @@ -15747,7 +17535,7 @@ return /******/ (function(modules) { // webpackBootstrap }; }(); - if ((typeof _ret2 === 'undefined' ? 'undefined' : _typeof(_ret2)) === "object") return _ret2.v; + if ((typeof _ret2 === 'undefined' ? 'undefined' : (0, _typeof3['default'])(_ret2)) === "object") return _ret2.v; } return 0; } @@ -15985,7 +17773,7 @@ return /******/ (function(modules) { // webpackBootstrap if (value !== undefined) { checkbox.checked = value; if (value !== defaultValue) { - if ((typeof defaultValue === 'undefined' ? 'undefined' : _typeof(defaultValue)) === 'object') { + if ((typeof defaultValue === 'undefined' ? 'undefined' : (0, _typeof3['default'])(defaultValue)) === 'object') { if (value !== defaultValue.enabled) { this.changedOptions.push({ path: path, value: value }); } @@ -16257,7 +18045,7 @@ return /******/ (function(modules) { // webpackBootstrap key: '_printOptions', value: function _printOptions() { var options = this.getOptions(); - this.optionsContainer.innerHTML = '
var options = ' + JSON.stringify(options, null, 2) + '
'; + this.optionsContainer.innerHTML = '
var options = ' + (0, _stringify2['default'])(options, null, 2) + '
'; } }, { key: 'getOptions', @@ -16269,14 +18057,83 @@ return /******/ (function(modules) { // webpackBootstrap return options; } }]); - return Configurator; }(); - exports.default = Configurator; + exports['default'] = Configurator; /***/ }, -/* 29 */ +/* 115 */ +/***/ function(module, exports) { + + "use strict"; + + exports.__esModule = true; + + exports.default = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + }; + +/***/ }, +/* 116 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + exports.__esModule = true; + + var _defineProperty = __webpack_require__(117); + + var _defineProperty2 = _interopRequireDefault(_defineProperty); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + exports.default = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + (0, _defineProperty2.default)(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + +/***/ }, +/* 117 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = { "default": __webpack_require__(118), __esModule: true }; + +/***/ }, +/* 118 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(119); + var $Object = __webpack_require__(17).Object; + module.exports = function defineProperty(it, key, desc){ + return $Object.defineProperty(it, key, desc); + }; + +/***/ }, +/* 119 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(15); + // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) + $export($export.S + $export.F * !__webpack_require__(25), 'Object', {defineProperty: __webpack_require__(21).f}); + +/***/ }, +/* 120 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -16285,19 +18142,28 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _stringify = __webpack_require__(82); + + var _stringify2 = _interopRequireDefault(_stringify); + + var _classCallCheck2 = __webpack_require__(115); + + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _createClass3 = _interopRequireDefault(_createClass2); - var Hammer = __webpack_require__(22); - var hammerUtil = __webpack_require__(30); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var Hammer = __webpack_require__(108); + var hammerUtil = __webpack_require__(121); var util = __webpack_require__(1); var ColorPicker = function () { function ColorPicker() { var pixelRatio = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; - - _classCallCheck(this, ColorPicker); + (0, _classCallCheck3['default'])(this, ColorPicker); this.pixelRatio = pixelRatio; this.generated = false; @@ -16323,7 +18189,7 @@ return /******/ (function(modules) { // webpackBootstrap */ - _createClass(ColorPicker, [{ + (0, _createClass3['default'])(ColorPicker, [{ key: 'insertTo', value: function insertTo(container) { if (this.hammer !== undefined) { @@ -16428,7 +18294,7 @@ return /******/ (function(modules) { // webpackBootstrap // set color if (rgba === undefined) { - 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(color)); + throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: " + (0, _stringify2['default'])(color)); } else { this._setColor(rgba, setInitial); } @@ -16898,19 +18764,18 @@ return /******/ (function(modules) { // webpackBootstrap this.newColorDiv.style.backgroundColor = 'rgba(' + this.color.r + ',' + this.color.g + ',' + this.color.b + ',' + this.color.a + ')'; } }]); - return ColorPicker; }(); - exports.default = ColorPicker; + exports['default'] = ColorPicker; /***/ }, -/* 30 */ +/* 121 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var Hammer = __webpack_require__(22); + var Hammer = __webpack_require__(108); /** * Register a touch event, taking place before a gesture @@ -16979,7 +18844,7 @@ return /******/ (function(modules) { // webpackBootstrap }; /***/ }, -/* 31 */ +/* 122 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -16987,12 +18852,29 @@ return /******/ (function(modules) { // webpackBootstrap Object.defineProperty(exports, "__esModule", { value: true }); + exports.printStyle = undefined; + + var _stringify = __webpack_require__(82); - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + var _stringify2 = _interopRequireDefault(_stringify); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _typeof2 = __webpack_require__(62); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _typeof3 = _interopRequireDefault(_typeof2); + + var _keys = __webpack_require__(58); + + var _keys2 = _interopRequireDefault(_keys); + + var _classCallCheck2 = __webpack_require__(115); + + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); + + var _createClass3 = _interopRequireDefault(_createClass2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var util = __webpack_require__(1); @@ -17005,7 +18887,7 @@ return /******/ (function(modules) { // webpackBootstrap var Validator = function () { function Validator() { - _classCallCheck(this, Validator); + (0, _classCallCheck3['default'])(this, Validator); } /** @@ -17016,7 +18898,7 @@ return /******/ (function(modules) { // webpackBootstrap */ - _createClass(Validator, null, [{ + (0, _createClass3['default'])(Validator, null, [{ key: 'validate', value: function validate(options, referenceOptions, subObject) { errorFound = false; @@ -17109,14 +18991,14 @@ return /******/ (function(modules) { // webpackBootstrap } } else if (refOptionObj['any'] === undefined) { // type of the field is incorrect and the field cannot be any - console.log('%cInvalid type received for "' + option + '". Expected: ' + Validator.print(Object.keys(refOptionObj)) + '. Received [' + optionType + '] "' + options[option] + '"' + Validator.printLocation(path, option), printStyle); + console.log('%cInvalid type received for "' + option + '". Expected: ' + Validator.print((0, _keys2['default'])(refOptionObj)) + '. Received [' + optionType + '] "' + options[option] + '"' + Validator.printLocation(path, option), printStyle); errorFound = true; } } }, { key: 'getType', value: function getType(object) { - var type = typeof object === 'undefined' ? 'undefined' : _typeof(object); + var type = typeof object === 'undefined' ? 'undefined' : (0, _typeof3['default'])(object); if (type === 'object') { if (object === null) { @@ -17171,7 +19053,7 @@ return /******/ (function(modules) { // webpackBootstrap } else if (localSearch.distance <= localSearchThreshold) { console.log('%cUnknown option detected: "' + option + '". Did you mean "' + localSearch.closestMatch + '"?' + Validator.printLocation(localSearch.path, option), printStyle); } else { - console.log('%cUnknown option detected: "' + option + '". Did you mean one of these: ' + Validator.print(Object.keys(options)) + Validator.printLocation(path, option), printStyle); + console.log('%cUnknown option detected: "' + option + '". Did you mean one of these: ' + Validator.print((0, _keys2['default'])(options)) + Validator.printLocation(path, option), printStyle); } errorFound = true; @@ -17247,7 +19129,7 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: 'print', value: function print(options) { - return JSON.stringify(options).replace(/(\")|(\[)|(\])|(,"__type__")/g, "").replace(/(\,)/g, ', '); + return (0, _stringify2['default'])(options).replace(/(\")|(\[)|(\])|(,"__type__")/g, "").replace(/(\,)/g, ', '); } // Compute the edit distance between the two given strings @@ -17295,26 +19177,37 @@ return /******/ (function(modules) { // webpackBootstrap return matrix[b.length][a.length]; } }]); - return Validator; }(); - exports.default = Validator; + exports['default'] = Validator; exports.printStyle = printStyle; /***/ }, -/* 32 */ +/* 123 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + var _keys = __webpack_require__(58); + + var _keys2 = _interopRequireDefault(_keys); + + var _stringify = __webpack_require__(82); + + var _stringify2 = _interopRequireDefault(_stringify); + + var _typeof2 = __webpack_require__(62); + + var _typeof3 = _interopRequireDefault(_typeof2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var util = __webpack_require__(1); - var hammerUtil = __webpack_require__(30); - var moment = __webpack_require__(2); - var Component = __webpack_require__(33); - var DateUtil = __webpack_require__(34); + var hammerUtil = __webpack_require__(121); + var moment = __webpack_require__(84); + var Component = __webpack_require__(124); + var DateUtil = __webpack_require__(125); /** * @constructor Range @@ -17326,8 +19219,18 @@ return /******/ (function(modules) { // webpackBootstrap */ function Range(body, options) { var now = moment().hours(0).minutes(0).seconds(0).milliseconds(0); - this.start = now.clone().add(-3, 'days').valueOf(); // Number - this.end = now.clone().add(4, 'days').valueOf(); // Number + var start = now.clone().add(-3, 'days').valueOf(); + var end = now.clone().add(-3, 'days').valueOf(); + + if (options === undefined) { + this.start = start; + this.end = end; + } else { + this.start = options.start || start; + this.end = options.end || end; + } + + this.rolling = false; this.body = body; this.deltaDifference = 0; @@ -17367,6 +19270,9 @@ return /******/ (function(modules) { // webpackBootstrap this.body.emitter.on('touch', this._onTouch.bind(this)); this.body.emitter.on('pinch', this._onPinch.bind(this)); + // on click of rolling mode button + this.body.dom.rollingModeBtn.addEventListener('click', this.startRolling.bind(this)); + this.setOptions(options); } @@ -17391,9 +19297,12 @@ return /******/ (function(modules) { // webpackBootstrap Range.prototype.setOptions = function (options) { if (options) { // copy the options that we know - var fields = ['direction', 'min', 'max', 'zoomMin', 'zoomMax', 'moveable', 'zoomable', 'moment', 'activate', 'hiddenDates', 'zoomKey', 'rtl', 'horizontalScroll']; + var fields = ['animation', 'direction', 'min', 'max', 'zoomMin', 'zoomMax', 'moveable', 'zoomable', 'moment', 'activate', 'hiddenDates', 'zoomKey', 'rtl', 'showCurrentTime', 'rollMode', 'horizontalScroll']; util.selectiveExtend(fields, this.options, options); + if (options.rollingMode) { + this.startRolling(); + } if ('start' in options || 'end' in options) { // apply a new range. both start and end are optional this.setRange(options.start, options.end); @@ -17411,6 +19320,50 @@ return /******/ (function(modules) { // webpackBootstrap } } + /** + * Start auto refreshing the current time bar + */ + Range.prototype.startRolling = function () { + var me = this; + + function update() { + me.stopRolling(); + me.rolling = true; + + var interval = me.end - me.start; + var t = util.convert(new Date(), 'Date').valueOf(); + + var start = t - interval / 2; + var end = t + interval / 2; + var animation = me.options && me.options.animation !== undefined ? me.options.animation : true; + + me.setRange(start, end, false); + + // determine interval to refresh + var scale = me.conversion(me.body.domProps.center.width).scale; + var interval = 1 / scale / 10; + if (interval < 30) interval = 30; + if (interval > 1000) interval = 1000; + + me.body.dom.rollingModeBtn.style.visibility = "hidden"; + // start a renderTimer to adjust for the new time + me.currentTimeTimer = setTimeout(update, interval); + } + + update(); + }; + + /** + * Stop auto refreshing the current time bar + */ + Range.prototype.stopRolling = function () { + if (this.currentTimeTimer !== undefined) { + clearTimeout(this.currentTimeTimer); + this.rolling = false; + this.body.dom.rollingModeBtn.style.visibility = "visible"; + } + }; + /** * Set a new start and end range * @param {Date | Number | String} [start] @@ -17424,7 +19377,7 @@ return /******/ (function(modules) { // webpackBootstrap * @param {Boolean} [byUser=false] * */ - Range.prototype.setRange = function (start, end, animation, byUser) { + Range.prototype.setRange = function (start, end, animation, byUser, event) { if (byUser !== true) { byUser = false; } @@ -17437,11 +19390,11 @@ return /******/ (function(modules) { // webpackBootstrap var me = this; var initStart = this.start; var initEnd = this.end; - var duration = (typeof animation === 'undefined' ? 'undefined' : _typeof(animation)) === 'object' && 'duration' in animation ? animation.duration : 500; - var easingName = (typeof animation === 'undefined' ? 'undefined' : _typeof(animation)) === 'object' && 'easingFunction' in animation ? animation.easingFunction : 'easeInOutQuad'; + var duration = (typeof animation === 'undefined' ? 'undefined' : (0, _typeof3['default'])(animation)) === 'object' && 'duration' in animation ? animation.duration : 500; + var easingName = (typeof animation === 'undefined' ? 'undefined' : (0, _typeof3['default'])(animation)) === 'object' && 'easingFunction' in animation ? animation.easingFunction : 'easeInOutQuad'; var easingFunction = util.easingFunctions[easingName]; if (!easingFunction) { - throw new Error('Unknown easing function ' + JSON.stringify(easingName) + '. ' + 'Choose from: ' + Object.keys(util.easingFunctions).join(', ')); + throw new Error('Unknown easing function ' + (0, _stringify2['default'])(easingName) + '. ' + 'Choose from: ' + (0, _keys2['default'])(util.easingFunctions).join(', ')); } var initTime = new Date().valueOf(); @@ -17459,13 +19412,21 @@ return /******/ (function(modules) { // webpackBootstrap changed = me._applyRange(s, e); DateUtil.updateHiddenDates(me.options.moment, me.body, me.options.hiddenDates); anyChanged = anyChanged || changed; + + var params = { + start: new Date(me.start), + end: new Date(me.end), + byUser: byUser, + event: util.elementsCensor(event) + }; + if (changed) { - me.body.emitter.emit('rangechange', { start: new Date(me.start), end: new Date(me.end), byUser: byUser }); + me.body.emitter.emit('rangechange', params); } if (done) { if (anyChanged) { - me.body.emitter.emit('rangechanged', { start: new Date(me.start), end: new Date(me.end), byUser: byUser }); + me.body.emitter.emit('rangechanged', params); } } else { // animate with as high as possible frame rate, leave 20 ms in between @@ -17480,7 +19441,12 @@ return /******/ (function(modules) { // webpackBootstrap var changed = this._applyRange(finalStart, finalEnd); DateUtil.updateHiddenDates(this.options.moment, this.body, this.options.hiddenDates); if (changed) { - var params = { start: new Date(this.start), end: new Date(this.end), byUser: byUser }; + var params = { + start: new Date(this.start), + end: new Date(this.end), + byUser: byUser, + event: util.elementsCensor(event) + }; this.body.emitter.emit('rangechange', params); this.body.emitter.emit('rangechanged', params); } @@ -17677,6 +19643,8 @@ return /******/ (function(modules) { // webpackBootstrap // when releasing the fingers in opposite order from the touch screen if (!this.props.touch.allowDragging) return; + this.stopRolling(); + this.props.touch.start = this.start; this.props.touch.end = this.end; this.props.touch.dragging = true; @@ -17746,7 +19714,8 @@ return /******/ (function(modules) { // webpackBootstrap this.body.emitter.emit('rangechange', { start: startDate, end: endDate, - byUser: true + byUser: true, + event: util.elementsCensor(event) }); // fire a panmove event @@ -17778,7 +19747,8 @@ return /******/ (function(modules) { // webpackBootstrap this.body.emitter.emit('rangechanged', { start: new Date(this.start), end: new Date(this.end), - byUser: true + byUser: true, + event: util.elementsCensor(event) }); }; @@ -17789,10 +19759,6 @@ return /******/ (function(modules) { // webpackBootstrap * @private */ Range.prototype._onMouseWheel = function (event) { - // Prevent default actions caused by mouse wheel - // (else the page and timeline both zoom and scroll) - event.preventDefault(); - // retrieve delta var delta = 0; if (event.wheelDelta) { @@ -17808,13 +19774,17 @@ return /******/ (function(modules) { // webpackBootstrap // don't allow zoom when the according key is pressed and the zoomKey option or not zoomable but movable if (this.options.zoomKey && !event[this.options.zoomKey] && this.options.zoomable || !this.options.zoomable && this.options.moveable) { if (this.options.horizontalScroll) { + // Prevent default actions caused by mouse wheel + // (else the page and timeline both scroll) + event.preventDefault(); + // calculate a single scroll jump relative to the range scale var diff = delta * (this.end - this.start) / 20; // calculate new start and end var newStart = this.start - diff; var newEnd = this.end - diff; - this.setRange(newStart, newEnd); + this.setRange(newStart, newEnd, false, true, event); } return; } @@ -17841,10 +19811,18 @@ return /******/ (function(modules) { // webpackBootstrap } // calculate center, the date to zoom around - var pointer = this.getPointer({ x: event.clientX, y: event.clientY }, this.body.dom.center); - var pointerDate = this._pointerToDate(pointer); + var pointerDate; + if (this.rolling) { + pointerDate = (this.start + this.end) / 2; + } else { + var pointer = this.getPointer({ x: event.clientX, y: event.clientY }, this.body.dom.center); + pointerDate = this._pointerToDate(pointer); + } + this.zoom(scale, pointerDate, delta, event); - this.zoom(scale, pointerDate, delta); + // Prevent default actions caused by mouse wheel + // (else the page and timeline both scroll) + event.preventDefault(); } }; @@ -17876,6 +19854,8 @@ return /******/ (function(modules) { // webpackBootstrap this.props.touch.center = this.getPointer(event.center, this.body.dom.center); } + this.stopRolling(); + var scale = 1 / (event.scale + this.scaleOffset); var centerDate = this._pointerToDate(this.props.touch.center); @@ -17901,7 +19881,7 @@ return /******/ (function(modules) { // webpackBootstrap newEnd = safeEnd; } - this.setRange(newStart, newEnd, false, true); + this.setRange(newStart, newEnd, false, true, event); this.startToFront = false; // revert to default this.endToFront = true; // revert to default @@ -17980,7 +19960,7 @@ return /******/ (function(modules) { // webpackBootstrap * @param {Number} [center] Value representing a date around which will * be zoomed. */ - Range.prototype.zoom = function (scale, center, delta) { + Range.prototype.zoom = function (scale, center, delta, event) { // if centerDate is not provided, take it half between start Date and end Date if (center == null) { center = (this.start + this.end) / 2; @@ -18004,7 +19984,7 @@ return /******/ (function(modules) { // webpackBootstrap newEnd = safeEnd; } - this.setRange(newStart, newEnd, false, true); + this.setRange(newStart, newEnd, false, true, event); this.startToFront = false; // revert to default this.endToFront = true; // revert to default @@ -18043,13 +20023,13 @@ return /******/ (function(modules) { // webpackBootstrap var newStart = this.start - diff; var newEnd = this.end - diff; - this.setRange(newStart, newEnd); + this.setRange(newStart, newEnd, false, true, event); }; module.exports = Range; /***/ }, -/* 33 */ +/* 124 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -18111,7 +20091,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = Component; /***/ }, -/* 34 */ +/* 125 */ /***/ function(module, exports) { "use strict"; @@ -18615,25 +20595,33 @@ return /******/ (function(modules) { // webpackBootstrap }; /***/ }, -/* 35 */ +/* 126 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + var _stringify = __webpack_require__(82); + + var _stringify2 = _interopRequireDefault(_stringify); - var Emitter = __webpack_require__(13); - var Hammer = __webpack_require__(22); - var hammerUtil = __webpack_require__(30); + var _typeof2 = __webpack_require__(62); + + var _typeof3 = _interopRequireDefault(_typeof2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var Emitter = __webpack_require__(95); + var Hammer = __webpack_require__(108); + var hammerUtil = __webpack_require__(121); var util = __webpack_require__(1); - var DataSet = __webpack_require__(9); - var DataView = __webpack_require__(11); - var Range = __webpack_require__(32); - var ItemSet = __webpack_require__(36); - var TimeAxis = __webpack_require__(46); - var Activator = __webpack_require__(47); - var DateUtil = __webpack_require__(34); - var CustomTime = __webpack_require__(48); + var DataSet = __webpack_require__(91); + var DataView = __webpack_require__(93); + var Range = __webpack_require__(123); + var ItemSet = __webpack_require__(127); + var TimeAxis = __webpack_require__(138); + var Activator = __webpack_require__(139); + var DateUtil = __webpack_require__(125); + var CustomTime = __webpack_require__(140); /** * Create a timeline visualization @@ -18674,6 +20662,7 @@ return /******/ (function(modules) { // webpackBootstrap this.dom.shadowBottomLeft = document.createElement('div'); this.dom.shadowTopRight = document.createElement('div'); this.dom.shadowBottomRight = document.createElement('div'); + this.dom.rollingModeBtn = document.createElement('div'); this.dom.root.className = 'vis-timeline'; this.dom.background.className = 'vis-panel vis-background'; @@ -18693,6 +20682,7 @@ return /******/ (function(modules) { // webpackBootstrap this.dom.shadowBottomLeft.className = 'vis-shadow vis-bottom'; this.dom.shadowTopRight.className = 'vis-shadow vis-top'; this.dom.shadowBottomRight.className = 'vis-shadow vis-bottom'; + this.dom.rollingModeBtn.className = 'vis-rolling-mode-btn'; this.dom.root.appendChild(this.dom.background); this.dom.root.appendChild(this.dom.backgroundVertical); @@ -18702,6 +20692,8 @@ return /******/ (function(modules) { // webpackBootstrap this.dom.root.appendChild(this.dom.rightContainer); this.dom.root.appendChild(this.dom.top); this.dom.root.appendChild(this.dom.bottom); + this.dom.root.appendChild(this.dom.bottom); + this.dom.root.appendChild(this.dom.rollingModeBtn); this.dom.centerContainer.appendChild(this.dom.center); this.dom.leftContainer.appendChild(this.dom.left); @@ -18739,18 +20731,14 @@ return /******/ (function(modules) { // webpackBootstrap this.on('panmove', this._onDrag.bind(this)); var me = this; + this._origRedraw = this._redraw.bind(this); + this._redraw = util.throttle(this._origRedraw); + this.on('_change', function (properties) { - if (properties && properties.queue == true) { - // redraw once on next tick - if (!me._redrawTimer) { - me._redrawTimer = setTimeout(function () { - me._redrawTimer = null; - me._redraw(); - }, 0); - } - } else { - // redraw immediately + if (me.itemSet && me.itemSet.initialItemSetDrawn && properties && properties.queue == true) { me._redraw(); + } else { + me._origRedraw(); } }); @@ -18794,11 +20782,15 @@ return /******/ (function(modules) { // webpackBootstrap this.emit('mousewheel', event); } + // prevent scrolling if not specified explicitly or when horizontalScroll is true + if (!this.options.verticalScroll || this.options.horizontalScroll) return; + // prevent scrolling when zoomKey defined or activated if (!this.options.zoomKey || event[this.options.zoomKey]) return; - // prevent scrolling vertically when horizontalScroll is true - if (this.options.horizontalScroll) return; + // Prevent default actions caused by mouse wheel + // (else the page and timeline both scroll) + event.preventDefault(); var delta = 0; if (event.wheelDelta) { @@ -18816,17 +20808,9 @@ return /******/ (function(modules) { // webpackBootstrap if (this.isActive()) { this._setScrollTop(adjusted); - if (this.options.verticalScroll) { - this.dom.left.parentNode.scrollTop = -adjusted; - this.dom.right.parentNode.scrollTop = -adjusted; - } this._redraw(); this.emit('scroll', event); } - - // Prevent default actions caused by mouse wheel - // (else the page and timeline both scroll) - event.preventDefault(); } if (this.dom.centerContainer.addEventListener) { @@ -18861,7 +20845,7 @@ return /******/ (function(modules) { // webpackBootstrap } // make sure your target is a vis element - if (!event.target.className.includes('vis')) return; + if (!event.target.className.indexOf("vis") > -1) return; // make sure only one item is added every time you're over the timeline if (itemAddedToTimeline) return; @@ -18874,7 +20858,7 @@ return /******/ (function(modules) { // webpackBootstrap function handleDrop(event) { // return when dropping non-vis items try { - var itemData = JSON.parse(event.dataTransfer.getData("text/plain")); + var itemData = JSON.parse(event.dataTransfer.getData("text")); if (!itemData.content) return; } catch (err) { return false; @@ -18882,8 +20866,8 @@ return /******/ (function(modules) { // webpackBootstrap itemAddedToTimeline = false; event.center = { - x: event.x, - y: event.y + x: event.clientX, + y: event.clientY }; me.itemSet._onAddItem(event); @@ -18937,6 +20921,8 @@ return /******/ (function(modules) { // webpackBootstrap var fields = ['width', 'height', 'minHeight', 'maxHeight', 'autoResize', 'start', 'end', 'clickToUse', 'dataAttributes', 'hiddenDates', 'locale', 'locales', 'moment', 'rtl', 'zoomKey', 'horizontalScroll', 'verticalScroll']; util.selectiveExtend(fields, this.options, options); + this.dom.rollingModeBtn.style.visibility = 'hidden'; + if (this.options.rtl) { this.dom.container.style.direction = "rtl"; this.dom.backgroundVertical.className = 'vis-panel vis-background vis-vertical-rtl'; @@ -18957,7 +20943,7 @@ return /******/ (function(modules) { // webpackBootstrap item: options.orientation, axis: options.orientation }; - } else if (_typeof(options.orientation) === 'object') { + } else if ((0, _typeof3['default'])(options.orientation) === 'object') { if ('item' in options.orientation) { this.options.orientation.item = options.orientation.item; } @@ -19041,14 +21027,7 @@ return /******/ (function(modules) { // webpackBootstrap this.configurator.setModuleOptions({ global: appliedOptions }); } - // override redraw with a throttled version - if (!this._origRedraw) { - this._origRedraw = this._redraw.bind(this); - this._redraw = util.throttle(this._origRedraw); - } else { - // Not the initial run: redraw everything - this._redraw(); - } + this._redraw(); }; /** @@ -19113,7 +21092,7 @@ return /******/ (function(modules) { // webpackBootstrap }); if (customTimes.length === 0) { - throw new Error('No custom time bar found with id ' + JSON.stringify(id)); + throw new Error('No custom time bar found with id ' + (0, _stringify2['default'])(id)); } if (customTimes.length > 0) { @@ -19132,7 +21111,7 @@ return /******/ (function(modules) { // webpackBootstrap }); if (customTimes.length === 0) { - throw new Error('No custom time bar found with id ' + JSON.stringify(id)); + throw new Error('No custom time bar found with id ' + (0, _stringify2['default'])(id)); } return customTimes[0].getCustomTime(); }; @@ -19148,7 +21127,7 @@ return /******/ (function(modules) { // webpackBootstrap }); if (customTimes.length === 0) { - throw new Error('No custom time bar found with id ' + JSON.stringify(id)); + throw new Error('No custom time bar found with id ' + (0, _stringify2['default'])(id)); } if (customTimes.length > 0) { return customTimes[0].setCustomTitle(title); @@ -19182,7 +21161,7 @@ return /******/ (function(modules) { // webpackBootstrap return customTime.options.id === id; }); if (exists) { - throw new Error('A custom time with id ' + JSON.stringify(id) + ' already exists'); + throw new Error('A custom time with id ' + (0, _stringify2['default'])(id) + ' already exists'); } var customTime = new CustomTime(this.body, util.extend({}, this.options, { @@ -19208,7 +21187,7 @@ return /******/ (function(modules) { // webpackBootstrap }); if (customTimes.length === 0) { - throw new Error('No custom time bar found with id ' + JSON.stringify(id)); + throw new Error('No custom time bar found with id ' + (0, _stringify2['default'])(id)); } customTimes.forEach(function (customTime) { @@ -19413,8 +21392,8 @@ return /******/ (function(modules) { // webpackBootstrap props.border.right = props.border.left; props.border.top = (dom.centerContainer.offsetHeight - dom.centerContainer.clientHeight) / 2; props.border.bottom = props.border.top; - var borderRootHeight = dom.root.offsetHeight - dom.root.clientHeight; - var borderRootWidth = dom.root.offsetWidth - dom.root.clientWidth; + props.borderRootHeight = dom.root.offsetHeight - dom.root.clientHeight; + props.borderRootWidth = dom.root.offsetWidth - dom.root.clientWidth; // workaround for a bug in IE: the clientWidth of an element with // a height:0px and overflow:hidden is not calculated and always has value 0 @@ -19423,7 +21402,7 @@ return /******/ (function(modules) { // webpackBootstrap props.border.right = props.border.left; } if (dom.root.clientHeight === 0) { - borderRootWidth = borderRootHeight; + props.borderRootWidth = props.borderRootHeight; } // calculate the heights. If any of the side panels is empty, we set the height to @@ -19439,27 +21418,27 @@ return /******/ (function(modules) { // webpackBootstrap // apply auto height // TODO: only calculate autoHeight when needed (else we cause an extra reflow/repaint of the DOM) var contentHeight = Math.max(props.left.height, props.center.height, props.right.height); - var autoHeight = props.top.height + contentHeight + props.bottom.height + borderRootHeight + props.border.top + props.border.bottom; + var autoHeight = props.top.height + contentHeight + props.bottom.height + props.borderRootHeight + props.border.top + props.border.bottom; dom.root.style.height = util.option.asSize(options.height, autoHeight + 'px'); // calculate heights of the content panels props.root.height = dom.root.offsetHeight; - props.background.height = props.root.height - borderRootHeight; - var containerHeight = props.root.height - props.top.height - props.bottom.height - borderRootHeight; + props.background.height = props.root.height - props.borderRootHeight; + var containerHeight = props.root.height - props.top.height - props.bottom.height - props.borderRootHeight; props.centerContainer.height = containerHeight; props.leftContainer.height = containerHeight; props.rightContainer.height = props.leftContainer.height; // calculate the widths of the panels props.root.width = dom.root.offsetWidth; - props.background.width = props.root.width - borderRootWidth; + props.background.width = props.root.width - props.borderRootWidth; if (!this.initialDrawDone) { props.scrollbarWidth = util.getScrollBarWidth(); } - if (this.options.verticalScroll) { - if (this.options.rtl) { + if (options.verticalScroll) { + if (options.rtl) { props.left.width = dom.leftContainer.clientWidth || -props.border.left; props.right.width = dom.rightContainer.clientWidth + props.scrollbarWidth || -props.border.right; } else { @@ -19471,46 +21450,7 @@ return /******/ (function(modules) { // webpackBootstrap props.right.width = dom.rightContainer.clientWidth || -props.border.right; } - props.leftContainer.width = props.left.width; - props.rightContainer.width = props.right.width; - var centerWidth = props.root.width - props.left.width - props.right.width - borderRootWidth; - props.center.width = centerWidth; - props.centerContainer.width = centerWidth; - props.top.width = centerWidth; - props.bottom.width = centerWidth; - - // resize the panels - dom.background.style.height = props.background.height + 'px'; - dom.backgroundVertical.style.height = props.background.height + 'px'; - dom.backgroundHorizontal.style.height = props.centerContainer.height + 'px'; - dom.centerContainer.style.height = props.centerContainer.height + 'px'; - dom.leftContainer.style.height = props.leftContainer.height + 'px'; - dom.rightContainer.style.height = props.rightContainer.height + 'px'; - - dom.background.style.width = props.background.width + 'px'; - dom.backgroundVertical.style.width = props.centerContainer.width + 'px'; - dom.backgroundHorizontal.style.width = props.background.width + 'px'; - dom.centerContainer.style.width = props.center.width + 'px'; - dom.top.style.width = props.top.width + 'px'; - dom.bottom.style.width = props.bottom.width + 'px'; - - // reposition the panels - dom.background.style.left = '0'; - dom.background.style.top = '0'; - dom.backgroundVertical.style.left = props.left.width + props.border.left + 'px'; - dom.backgroundVertical.style.top = '0'; - dom.backgroundHorizontal.style.left = '0'; - dom.backgroundHorizontal.style.top = props.top.height + 'px'; - dom.centerContainer.style.left = props.left.width + 'px'; - dom.centerContainer.style.top = props.top.height + 'px'; - dom.leftContainer.style.left = '0'; - dom.leftContainer.style.top = props.top.height + 'px'; - dom.rightContainer.style.left = props.left.width + props.center.width + 'px'; - dom.rightContainer.style.top = props.top.height + 'px'; - dom.top.style.left = props.left.width + 'px'; - dom.top.style.top = '0'; - dom.bottom.style.left = props.left.width + 'px'; - dom.bottom.style.top = props.top.height + props.centerContainer.height + 'px'; + this._setDOM(); // update the scrollTop, feasible range for the offset can be changed // when the height of the Core or of the contents of the center changed @@ -19518,16 +21458,13 @@ return /******/ (function(modules) { // webpackBootstrap // reposition the scrollable contents if (options.orientation.item != 'top') { - offset += Math.max(this.props.centerContainer.height - this.props.center.height - this.props.border.top - this.props.border.bottom, 0); + offset += Math.max(props.centerContainer.height - props.center.height - props.border.top - props.border.bottom, 0); } - dom.center.style.left = '0'; dom.center.style.top = offset + 'px'; - dom.left.style.left = '0'; - dom.right.style.left = '0'; // show shadows when vertical scrolling is available - var visibilityTop = this.props.scrollTop == 0 ? 'hidden' : ''; - var visibilityBottom = this.props.scrollTop == this.props.scrollTopMin ? 'hidden' : ''; + var visibilityTop = props.scrollTop == 0 ? 'hidden' : ''; + var visibilityBottom = props.scrollTop == props.scrollTopMin ? 'hidden' : ''; dom.shadowTop.style.visibility = visibilityTop; dom.shadowBottom.style.visibility = visibilityBottom; dom.shadowTopLeft.style.visibility = visibilityTop; @@ -19535,18 +21472,31 @@ return /******/ (function(modules) { // webpackBootstrap dom.shadowTopRight.style.visibility = visibilityTop; dom.shadowBottomRight.style.visibility = visibilityBottom; - if (this.options.verticalScroll) { + if (options.verticalScroll) { + dom.rightContainer.className = 'vis-panel vis-right vis-vertical-scroll'; + dom.leftContainer.className = 'vis-panel vis-left vis-vertical-scroll'; + dom.shadowTopRight.style.visibility = "hidden"; dom.shadowBottomRight.style.visibility = "hidden"; dom.shadowTopLeft.style.visibility = "hidden"; dom.shadowBottomLeft.style.visibility = "hidden"; - } else { + + dom.left.style.top = '0px'; + dom.right.style.top = '0px'; + } + + if (!options.verticalScroll || props.center.height < props.centerContainer.height) { dom.left.style.top = offset + 'px'; dom.right.style.top = offset + 'px'; + dom.rightContainer.className = dom.rightContainer.className.replace(new RegExp('(?:^|\\s)' + 'vis-vertical-scroll' + '(?:\\s|$)'), ' '); + dom.leftContainer.className = dom.leftContainer.className.replace(new RegExp('(?:^|\\s)' + 'vis-vertical-scroll' + '(?:\\s|$)'), ' '); + props.left.width = dom.leftContainer.clientWidth || -props.border.left; + props.right.width = dom.rightContainer.clientWidth || -props.border.right; + this._setDOM(); } // enable/disable vertical panning - var contentsOverflow = this.props.center.height > this.props.centerContainer.height; + var contentsOverflow = props.center.height > props.centerContainer.height; this.hammer.get('pan').set({ direction: contentsOverflow ? Hammer.DIRECTION_ALL : Hammer.DIRECTION_HORIZONTAL }); @@ -19566,13 +21516,61 @@ return /******/ (function(modules) { // webpackBootstrap } else { this.redrawCount = 0; } - this.initialDrawDone = true; //Emit public 'changed' event for UI updates, see issue #1592 this.body.emitter.emit("changed"); }; + Core.prototype._setDOM = function () { + var props = this.props; + var dom = this.dom; + + props.leftContainer.width = props.left.width; + props.rightContainer.width = props.right.width; + var centerWidth = props.root.width - props.left.width - props.right.width - props.borderRootWidth; + props.center.width = centerWidth; + props.centerContainer.width = centerWidth; + props.top.width = centerWidth; + props.bottom.width = centerWidth; + + // resize the panels + dom.background.style.height = props.background.height + 'px'; + dom.backgroundVertical.style.height = props.background.height + 'px'; + dom.backgroundHorizontal.style.height = props.centerContainer.height + 'px'; + dom.centerContainer.style.height = props.centerContainer.height + 'px'; + dom.leftContainer.style.height = props.leftContainer.height + 'px'; + dom.rightContainer.style.height = props.rightContainer.height + 'px'; + + dom.background.style.width = props.background.width + 'px'; + dom.backgroundVertical.style.width = props.centerContainer.width + 'px'; + dom.backgroundHorizontal.style.width = props.background.width + 'px'; + dom.centerContainer.style.width = props.center.width + 'px'; + dom.top.style.width = props.top.width + 'px'; + dom.bottom.style.width = props.bottom.width + 'px'; + + // reposition the panels + dom.background.style.left = '0'; + dom.background.style.top = '0'; + dom.backgroundVertical.style.left = props.left.width + props.border.left + 'px'; + dom.backgroundVertical.style.top = '0'; + dom.backgroundHorizontal.style.left = '0'; + dom.backgroundHorizontal.style.top = props.top.height + 'px'; + dom.centerContainer.style.left = props.left.width + 'px'; + dom.centerContainer.style.top = props.top.height + 'px'; + dom.leftContainer.style.left = '0'; + dom.leftContainer.style.top = props.top.height + 'px'; + dom.rightContainer.style.left = props.left.width + props.center.width + 'px'; + dom.rightContainer.style.top = props.top.height + 'px'; + dom.top.style.left = props.left.width + 'px'; + dom.top.style.top = '0'; + dom.bottom.style.left = props.left.width + 'px'; + dom.bottom.style.top = props.top.height + props.centerContainer.height + 'px'; + dom.center.style.left = '0'; + dom.left.style.left = '0'; + dom.right.style.left = '0'; + }; + // TODO: deprecated since version 1.1.0, remove some day Core.prototype.repaint = function () { throw new Error('Function repaint is deprecated. Use redraw instead.'); @@ -19694,6 +21692,7 @@ return /******/ (function(modules) { // webpackBootstrap if (me.dom.root.offsetWidth != me.props.lastWidth || me.dom.root.offsetHeight != me.props.lastHeight) { me.props.lastWidth = me.dom.root.offsetWidth; me.props.lastHeight = me.dom.root.offsetHeight; + me.props.scrollbarWidth = util.getScrollBarWidth(); me.body.emitter.emit('_change'); } @@ -19807,6 +21806,11 @@ return /******/ (function(modules) { // webpackBootstrap if (this.props.scrollTop > 0) this.props.scrollTop = 0; if (this.props.scrollTop < scrollTopMin) this.props.scrollTop = scrollTopMin; + if (this.options.verticalScroll) { + this.dom.left.parentNode.scrollTop = -this.props.scrollTop; + this.dom.right.parentNode.scrollTop = -this.props.scrollTop; + } + return this.props.scrollTop; }; @@ -19831,25 +21835,38 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = Core; /***/ }, -/* 36 */ +/* 127 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + var _create = __webpack_require__(55); + + var _create2 = _interopRequireDefault(_create); + + var _typeof2 = __webpack_require__(62); + + var _typeof3 = _interopRequireDefault(_typeof2); + + var _Popup = __webpack_require__(128); - var Hammer = __webpack_require__(22); + var _Popup2 = _interopRequireDefault(_Popup); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var Hammer = __webpack_require__(108); var util = __webpack_require__(1); - var DataSet = __webpack_require__(9); - var DataView = __webpack_require__(11); - var TimeStep = __webpack_require__(37); - var Component = __webpack_require__(33); - var Group = __webpack_require__(38); - var BackgroundGroup = __webpack_require__(42); - var BoxItem = __webpack_require__(43); - var PointItem = __webpack_require__(44); - var RangeItem = __webpack_require__(40); - var BackgroundItem = __webpack_require__(45); + var DataSet = __webpack_require__(91); + var DataView = __webpack_require__(93); + var TimeStep = __webpack_require__(129); + var Component = __webpack_require__(124); + var Group = __webpack_require__(130); + var BackgroundGroup = __webpack_require__(134); + var BoxItem = __webpack_require__(135); + var PointItem = __webpack_require__(136); + var RangeItem = __webpack_require__(132); + var BackgroundItem = __webpack_require__(137); + var UNGROUPED = '__ungrouped__'; // reserved group id for ungrouped items var BACKGROUND = '__background__'; // reserved group id for background items without group @@ -19872,6 +21889,7 @@ return /******/ (function(modules) { // webpackBootstrap }, align: 'auto', // alignment of box items stack: true, + stackSubgroups: true, groupOrderSwap: function groupOrderSwap(fromGroup, toGroup, groups) { var targetOrder = toGroup.order; toGroup.order = fromGroup.order; @@ -19887,7 +21905,8 @@ return /******/ (function(modules) { // webpackBootstrap updateTime: false, updateGroup: false, add: false, - remove: false + remove: false, + overrideItems: false }, groupEditable: { @@ -19931,6 +21950,11 @@ return /******/ (function(modules) { // webpackBootstrap axis: 20 }, + tooltip: { + followMouse: false, + overflowMethod: 'flip' + }, + tooltipOnItemUpdateTime: false }; @@ -20078,13 +22102,17 @@ return /******/ (function(modules) { // webpackBootstrap this.groupHammer = new Hammer(this.body.dom.leftContainer); } + this.groupHammer.on('tap', this._onGroupClick.bind(this)); this.groupHammer.on('panstart', this._onGroupDragStart.bind(this)); this.groupHammer.on('panmove', this._onGroupDrag.bind(this)); this.groupHammer.on('panend', this._onGroupDragEnd.bind(this)); - this.groupHammer.get('pan').set({ threshold: 5, direction: Hammer.DIRECTION_HORIZONTAL }); + this.groupHammer.get('pan').set({ threshold: 5, direction: Hammer.DIRECTION_VERTICAL }); this.body.dom.centerContainer.addEventListener('mouseover', this._onMouseOver.bind(this)); this.body.dom.centerContainer.addEventListener('mouseout', this._onMouseOut.bind(this)); + this.body.dom.centerContainer.addEventListener('mousemove', this._onMouseMove.bind(this)); + // right-click on timeline + this.body.dom.centerContainer.addEventListener('contextmenu', this._onDragEnd.bind(this)); // attach to the DOM this.show(); @@ -20157,13 +22185,13 @@ return /******/ (function(modules) { // webpackBootstrap ItemSet.prototype.setOptions = function (options) { if (options) { // copy all options that we know - var fields = ['type', 'rtl', 'align', 'order', 'stack', 'selectable', 'multiselect', 'itemsAlwaysDraggable', 'multiselectPerGroup', 'groupOrder', 'dataAttributes', 'template', 'groupTemplate', 'hide', 'snap', 'groupOrderSwap', 'tooltipOnItemUpdateTime']; + var fields = ['type', 'rtl', 'align', 'order', 'stack', 'stackSubgroups', 'selectable', 'multiselect', 'itemsAlwaysDraggable', 'multiselectPerGroup', 'groupOrder', 'dataAttributes', 'template', 'groupTemplate', 'visibleFrameTemplate', 'hide', 'snap', 'groupOrderSwap', 'tooltip', 'tooltipOnItemUpdateTime']; util.selectiveExtend(fields, this.options, options); if ('orientation' in options) { if (typeof options.orientation === 'string') { this.options.orientation.item = options.orientation === 'top' ? 'top' : 'bottom'; - } else if (_typeof(options.orientation) === 'object' && 'item' in options.orientation) { + } else if ((0, _typeof3['default'])(options.orientation) === 'object' && 'item' in options.orientation) { this.options.orientation.item = options.orientation.item; } } @@ -20173,13 +22201,13 @@ return /******/ (function(modules) { // webpackBootstrap this.options.margin.axis = options.margin; this.options.margin.item.horizontal = options.margin; this.options.margin.item.vertical = options.margin; - } else if (_typeof(options.margin) === 'object') { + } else if ((0, _typeof3['default'])(options.margin) === 'object') { util.selectiveExtend(['axis'], this.options.margin, options.margin); if ('item' in options.margin) { if (typeof options.margin.item === 'number') { this.options.margin.item.horizontal = options.margin.item; this.options.margin.item.vertical = options.margin.item; - } else if (_typeof(options.margin.item) === 'object') { + } else if ((0, _typeof3['default'])(options.margin.item) === 'object') { util.selectiveExtend(['horizontal', 'vertical'], this.options.margin.item, options.margin.item); } } @@ -20192,8 +22220,9 @@ return /******/ (function(modules) { // webpackBootstrap this.options.editable.updateGroup = options.editable; this.options.editable.add = options.editable; this.options.editable.remove = options.editable; - } else if (_typeof(options.editable) === 'object') { - util.selectiveExtend(['updateTime', 'updateGroup', 'add', 'remove'], this.options.editable, options.editable); + this.options.editable.overrideItems = false; + } else if ((0, _typeof3['default'])(options.editable) === 'object') { + util.selectiveExtend(['updateTime', 'updateGroup', 'add', 'remove', 'overrideItems'], this.options.editable, options.editable); } } @@ -20202,7 +22231,7 @@ return /******/ (function(modules) { // webpackBootstrap this.options.groupEditable.order = options.groupEditable; this.options.groupEditable.add = options.groupEditable; this.options.groupEditable.remove = options.groupEditable; - } else if (_typeof(options.groupEditable) === 'object') { + } else if ((0, _typeof3['default'])(options.groupEditable) === 'object') { util.selectiveExtend(['order', 'add', 'remove'], this.options.groupEditable, options.groupEditable); } } @@ -20475,6 +22504,7 @@ return /******/ (function(modules) { // webpackBootstrap this.dom.axis.style.left = '0'; } + this.initialItemSetDrawn = true; // check if this component is resized resized = this._isResized() || resized; @@ -20633,6 +22663,25 @@ return /******/ (function(modules) { // webpackBootstrap } if (this.groupsData) { + // go over all groups nesting + var groupsData = this.groupsData; + if (this.groupsData instanceof DataView) { + groupsData = this.groupsData.getDataSet(); + } + + groupsData.get().forEach(function (group) { + if (group.nestedGroups) { + group.nestedGroups.forEach(function (nestedGroupId) { + var updatedNestedGroup = groupsData.get(nestedGroupId); + updatedNestedGroup.nestedInGroup = group.id; + if (group.showNested == false) { + updatedNestedGroup.visible = false; + } + groupsData.update(updatedNestedGroup); + }); + } + }); + // subscribe to new dataset var id = this.id; util.forEach(this.groupListeners, function (callback, event) { @@ -20667,7 +22716,8 @@ return /******/ (function(modules) { // webpackBootstrap */ ItemSet.prototype.removeItem = function (id) { var item = this.itemsData.get(id), - dataset = this.itemsData.getDataSet(); + dataset = this.itemsData.getDataSet(), + itemObj = this.items[id]; if (item) { // confirm deletion @@ -20676,6 +22726,12 @@ return /******/ (function(modules) { // webpackBootstrap // remove by id here, it is possible that an item has no id defined // itself, so better not delete by the item itself dataset.remove(id); + + // Remove it's popup + if (itemObj.popup) { + itemObj.popup.destroy(); + itemObj.popup = null; + } } }); } @@ -20723,7 +22779,7 @@ return /******/ (function(modules) { // webpackBootstrap var selected; if (item) { - // update item + // update item if (!constructor || !(item instanceof constructor)) { // item type has changed, delete the item and recreate it selected = item.selected; // preserve selection of this item @@ -20739,6 +22795,7 @@ return /******/ (function(modules) { // webpackBootstrap if (constructor) { item = new constructor(itemData, me.conversion, me.options); item.id = id; // TODO: not so nice setting id afterwards + me._addItem(item); if (selected) { this.selection.push(id); @@ -20828,7 +22885,7 @@ return /******/ (function(modules) { // webpackBootstrap throw new Error('Illegal group id. ' + id + ' is a reserved id.'); } - var groupOptions = Object.create(me.options); + var groupOptions = (0, _create2['default'])(me.options); util.extend(groupOptions, { height: null }); @@ -20890,6 +22947,8 @@ return /******/ (function(modules) { // webpackBootstrap order: this.options.groupOrder }); + groupIds = this._orderNestedGroups(groupIds); + var changed = !util.equalArray(groupIds, this.groupIds); if (changed) { // hide all groups, removes them from the DOM @@ -20912,6 +22971,34 @@ return /******/ (function(modules) { // webpackBootstrap } }; + /** + * Reorder the nested groups + * @return {boolean} changed + * @private + */ + ItemSet.prototype._orderNestedGroups = function (groupIds) { + var newGroupIdsOrder = []; + + groupIds.forEach(function (groupId) { + var groupData = this.groupsData.get(groupId); + if (!groupData.nestedInGroup) { + newGroupIdsOrder.push(groupId); + } + if (groupData.nestedGroups) { + var nestedGroups = this.groupsData.get({ + filter: function filter(nestedGroup) { + return nestedGroup.nestedInGroup == groupId; + } + }); + var nestedGroupIds = nestedGroups.map(function (nestedGroup) { + return nestedGroup.id; + }); + newGroupIdsOrder = newGroupIdsOrder.concat(nestedGroupIds); + } + }, this); + return newGroupIdsOrder; + }; + /** * Add a new item * @param {Item} item @@ -20923,6 +23010,13 @@ return /******/ (function(modules) { // webpackBootstrap // add to group var groupId = this._getGroupId(item.data); var group = this.groups[groupId]; + + if (!group) { + item.groupShowing = false; + } else if (group && group.data && group.data.showNested) { + item.groupShowing = true; + } + if (group) group.add(item); }; @@ -20939,13 +23033,17 @@ return /******/ (function(modules) { // webpackBootstrap // update the items data (will redraw the item when displayed) item.setData(itemData); + var groupId = this._getGroupId(item.data); + var group = this.groups[groupId]; + if (!group) { + item.groupShowing = false; + } else if (group && group.data && group.data.showNested) { + item.groupShowing = true; + } // update group if (oldGroupId != item.data.group || oldSubGroupId != item.data.subgroup) { var oldGroup = this.groups[oldGroupId]; if (oldGroup) oldGroup.remove(item); - - var groupId = this._getGroupId(item.data); - var group = this.groups[groupId]; if (group) group.add(item); } }; @@ -21024,24 +23122,28 @@ return /******/ (function(modules) { // webpackBootstrap * @private */ ItemSet.prototype._onDragStart = function (event) { + if (this.touchParams.itemIsDragging) { + return; + } var item = this.touchParams.item || null; var me = this; var props; if (item && (item.selected || this.options.itemsAlwaysDraggable)) { - if (!this.options.editable.updateTime && !this.options.editable.updateGroup && !item.editable) { + if (this.options.editable.overrideItems && !this.options.editable.updateTime && !this.options.editable.updateGroup) { return; } // override options.editable - if (item.editable === false) { + if (item.editable != null && !item.editable.updateTime && !item.editable.updateGroup && !this.options.editable.overrideItems) { return; } var dragLeftItem = this.touchParams.dragLeftItem; var dragRightItem = this.touchParams.dragRightItem; this.touchParams.itemIsDragging = true; + this.touchParams.selectedItem = item; if (dragLeftItem) { props = { @@ -21062,8 +23164,6 @@ return /******/ (function(modules) { // webpackBootstrap this.touchParams.itemProps = [props]; } else { - this.touchParams.selectedItem = item; - var baseGroupIndex = this._getGroupIndex(item.data.group); var itemsToDrag = this.options.itemsAlwaysDraggable && !item.selected ? [item.id] : this.getSelection(); @@ -21127,6 +23227,7 @@ return /******/ (function(modules) { // webpackBootstrap newItem.id = id; // TODO: not so nice setting id afterwards newItem.data = this._cloneItemData(itemData); this._addItem(newItem); + this.touchParams.selectedItem = newItem; var props = { item: newItem, @@ -21167,7 +23268,7 @@ return /******/ (function(modules) { // webpackBootstrap //only calculate the new group for the item that's actually dragged var selectedItem = this.touchParams.selectedItem; - var updateGroupAllowed = me.options.editable.updateGroup; + var updateGroupAllowed = (this.options.editable.overrideItems || selectedItem.editable == null) && this.options.editable.updateGroup || !this.options.editable.overrideItems && selectedItem.editable != null && selectedItem.editable.updateGroup; var newGroupBase = null; if (updateGroupAllowed && selectedItem) { if (selectedItem.data.group != undefined) { @@ -21193,11 +23294,11 @@ return /******/ (function(modules) { // webpackBootstrap } var itemData = this._cloneItemData(props.item.data); // clone the data - if (props.item.editable === false) { + if (props.item.editable != null && !props.item.editable.updateTime && !props.item.editable.updateGroup && !me.options.editable.overrideItems) { return; } - var updateTimeAllowed = me.options.editable.updateTime || props.item.editable === true; + var updateTimeAllowed = (this.options.editable.overrideItems || selectedItem.editable == null) && this.options.editable.updateTime || !this.options.editable.overrideItems && selectedItem.editable != null && selectedItem.editable.updateTime; if (updateTimeAllowed) { if (props.dragLeft) { // drag left side of a range item @@ -21255,8 +23356,6 @@ return /******/ (function(modules) { // webpackBootstrap } } - var updateGroupAllowed = me.options.editable.updateGroup || props.item.editable === true; - if (updateGroupAllowed && !props.dragLeft && !props.dragRight && newGroupBase != null) { if (itemData.group != undefined) { var newOffset = newGroupBase - props.groupOffset; @@ -21308,6 +23407,7 @@ return /******/ (function(modules) { // webpackBootstrap * @private */ ItemSet.prototype._onDragEnd = function (event) { + this.touchParams.itemIsDragging = false; if (this.touchParams.itemProps) { event.stopPropagation(); @@ -21315,7 +23415,6 @@ return /******/ (function(modules) { // webpackBootstrap var dataset = this.itemsData.getDataSet(); var itemProps = this.touchParams.itemProps; this.touchParams.itemProps = null; - this.touchParams.itemIsDragging = false; itemProps.forEach(function (props) { var id = props.item.id; @@ -21354,6 +23453,37 @@ return /******/ (function(modules) { // webpackBootstrap } }; + ItemSet.prototype._onGroupClick = function (event) { + var group = this.groupFromTarget(event); + + if (!group.nestedGroups) return; + + var groupsData = this.groupsData; + if (this.groupsData instanceof DataView) { + groupsData = this.groupsData.getDataSet(); + } + + group.showNested = !group.showNested; + + var nestedGroups = groupsData.get(group.nestedGroups).map(function (nestedGroup) { + if (nestedGroup.visible == undefined) { + nestedGroup.visible = true; + } + nestedGroup.visible = !!group.showNested; + return nestedGroup; + }); + groupsData.update(nestedGroups); + + if (group.showNested) { + util.removeClassName(group.dom.label, 'collapsed'); + util.addClassName(group.dom.label, 'expanded'); + } else { + util.removeClassName(group.dom.label, 'expanded'); + var collapsedDirClassName = this.options.rtl ? 'collapsed-rtl' : 'collapsed'; + util.addClassName(group.dom.label, collapsedDirClassName); + } + }; + ItemSet.prototype._onGroupDragStart = function (event) { if (this.options.groupEditable.order) { this.groupTouchParams.group = this.groupFromTarget(event); @@ -21372,6 +23502,10 @@ return /******/ (function(modules) { // webpackBootstrap if (this.options.groupEditable.order && this.groupTouchParams.group) { event.stopPropagation(); + var groupsData = this.groupsData; + if (this.groupsData instanceof DataView) { + groupsData = this.groupsData.getDataSet(); + } // drag from one group to another var group = this.groupFromTarget(event); @@ -21396,25 +23530,23 @@ return /******/ (function(modules) { // webpackBootstrap } if (group && group != this.groupTouchParams.group) { - var groupsData = this.groupsData; var targetGroup = groupsData.get(group.groupId); var draggedGroup = groupsData.get(this.groupTouchParams.group.groupId); // switch groups if (draggedGroup && targetGroup) { - this.options.groupOrderSwap(draggedGroup, targetGroup, this.groupsData); - this.groupsData.update(draggedGroup); - this.groupsData.update(targetGroup); + this.options.groupOrderSwap(draggedGroup, targetGroup, groupsData); + groupsData.update(draggedGroup); + groupsData.update(targetGroup); } // fetch current order of groups - var newOrder = this.groupsData.getIds({ + var newOrder = groupsData.getIds({ order: this.options.groupOrder }); // in case of changes since _onGroupDragStart if (!util.equalArray(newOrder, this.groupTouchParams.originalOrder)) { - var groupsData = this.groupsData; var origOrder = this.groupTouchParams.originalOrder; var draggedId = this.groupTouchParams.group.groupId; var numGroups = Math.min(origOrder.length, newOrder.length); @@ -21553,7 +23685,7 @@ return /******/ (function(modules) { // webpackBootstrap if (newSelection.length > 0 || oldSelection.length > 0) { this.body.emitter.emit('select', { items: newSelection, - event: event + event: util.elementsCensor(event) }); } }; @@ -21566,36 +23698,76 @@ return /******/ (function(modules) { // webpackBootstrap ItemSet.prototype._onMouseOver = function (event) { var item = this.itemFromTarget(event); if (!item) return; + + // Item we just left + var related = this.itemFromRelatedTarget(event); + if (item === related) { + // We haven't changed item, just element in the item + return; + } + + if (item.getTitle()) { + if (item.popup == null) { + item.setPopup(new _Popup2['default'](this.body.dom.root, this.options.tooltip.overflowMethod || 'flip')); + } + + var container = this.body.dom.centerContainer; + item.popup.setPosition(event.clientX - util.getAbsoluteLeft(container) + container.offsetLeft, event.clientY - util.getAbsoluteTop(container) + container.offsetTop); + item.popup.show(); + } + this.body.emitter.emit('itemover', { item: item.id, - event: event + event: util.elementsCensor(event) }); }; ItemSet.prototype._onMouseOut = function (event) { var item = this.itemFromTarget(event); if (!item) return; + + // Item we are going to + var related = this.itemFromRelatedTarget(event); + if (item === related) { + // We aren't changing item, just element in the item + return; + } + + if (item.popup != null) { + item.popup.hide(); + } + this.body.emitter.emit('itemout', { item: item.id, - event: event + event: util.elementsCensor(event) }); }; + ItemSet.prototype._onMouseMove = function (event) { + var item = this.itemFromTarget(event); + if (!item) return; + + if (this.options.tooltip.followMouse) { + if (item.popup) { + if (!item.popup.hidden) { + var container = this.body.dom.centerContainer; + item.popup.setPosition(event.clientX - util.getAbsoluteLeft(container) + container.offsetLeft, event.clientY - util.getAbsoluteTop(container) + container.offsetTop); + item.popup.show(); // Redraw + } + } + } + }; /** - * Handle creation and updates of an item on double tap + * Handle updates of an item on double tap * @param event * @private */ - ItemSet.prototype._onAddItem = function (event) { + ItemSet.prototype._onUpdateItem = function (item) { if (!this.options.selectable) return; if (!this.options.editable.add) return; var me = this; - var snap = this.options.snap || null; - var item = this.itemFromTarget(event); if (item) { - // update item - // execute async handler to update the item (or cancel it) var itemData = me.itemsData.get(item.id); // get a clone of the data from the dataset this.options.onUpdate(itemData, function (itemData) { @@ -21603,7 +23775,23 @@ return /******/ (function(modules) { // webpackBootstrap me.itemsData.getDataSet().update(itemData); } }); - } else { + } + }; + + /** + * Handle creation of an item on double tap + * @param event + * @private + */ + ItemSet.prototype._onAddItem = function (event) { + if (!this.options.selectable) return; + if (!this.options.editable.add) return; + + var me = this; + var snap = this.options.snap || null; + var item = this.itemFromTarget(event); + + if (!item) { // add item if (this.options.rtl) { var xAbs = util.getAbsoluteRight(this.dom.frame); @@ -21624,18 +23812,18 @@ return /******/ (function(modules) { // webpackBootstrap }; if (event.type == 'drop') { - var itemData = JSON.parse(event.dataTransfer.getData("text/plain")); + var itemData = JSON.parse(event.dataTransfer.getData("text")); newItemData.content = itemData.content; // content is required newItemData.type = itemData.type || 'box'; newItemData[this.itemsData._fieldId] = itemData.id || util.randomUUID(); if (itemData.type == 'range' || itemData.end && itemData.start) { - if (!itemData.end) { var end = this.body.util.toTime(x + this.props.width / 5); newItemData.end = snap ? snap(end, scale, step) : end; } else { - newItemData.end = new Date(newItemData.start._i).getTime() + new Date(itemData.end).getTime() - new Date(itemData.start).getTime(); + newItemData.end = itemData.end; + newItemData.start = itemData.start; } } } else { @@ -21734,7 +23922,7 @@ return /******/ (function(modules) { // webpackBootstrap this.body.emitter.emit('select', { items: this.getSelection(), - event: event + event: util.elementsCensor(event) }); } }; @@ -21771,6 +23959,24 @@ return /******/ (function(modules) { // webpackBootstrap }; }; + /** + * Find an item from an element: + * searches for the attribute 'timeline-item' in the element's tree + * @param {HTMLElement} element + * @return {Item | null} item + */ + ItemSet.prototype.itemFromElement = function (element) { + var cur = element; + while (cur) { + if (cur.hasOwnProperty('timeline-item')) { + return cur['timeline-item']; + } + cur = cur.parentNode; + } + + return null; + }; + /** * Find an item from an event target: * searches for the attribute 'timeline-item' in the event target's element tree @@ -21778,15 +23984,17 @@ return /******/ (function(modules) { // webpackBootstrap * @return {Item | null} item */ ItemSet.prototype.itemFromTarget = function (event) { - var target = event.target; - while (target) { - if (target.hasOwnProperty('timeline-item')) { - return target['timeline-item']; - } - target = target.parentNode; - } + return this.itemFromElement(event.target); + }; - return null; + /** + * Find an item from an event's related target: + * searches for the attribute 'timeline-item' in the related target's element tree + * @param {Event} event + * @return {Item | null} item + */ + ItemSet.prototype.itemFromRelatedTarget = function (event) { + return this.itemFromElement(event.relatedTarget); }; /** @@ -21868,13 +24076,182 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = ItemSet; /***/ }, -/* 37 */ +/* 128 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var moment = __webpack_require__(2); - var DateUtil = __webpack_require__(34); + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _classCallCheck2 = __webpack_require__(115); + + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); + + var _createClass3 = _interopRequireDefault(_createClass2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + /** + * Popup is a class to create a popup window with some text + * @param {Element} container The container object. + * @param {string} overflowMethod How the popup should act to overflowing ('flip' or 'cap') + */ + var Popup = function () { + function Popup(container, overflowMethod) { + (0, _classCallCheck3['default'])(this, Popup); + + this.container = container; + this.overflowMethod = overflowMethod || 'cap'; + + this.x = 0; + this.y = 0; + this.padding = 5; + this.hidden = false; + + // create the frame + this.frame = document.createElement('div'); + this.frame.className = 'vis-tooltip'; + this.container.appendChild(this.frame); + } + + /** + * @param {number} x Horizontal position of the popup window + * @param {number} y Vertical position of the popup window + */ + + + (0, _createClass3['default'])(Popup, [{ + key: 'setPosition', + value: function setPosition(x, y) { + this.x = parseInt(x); + this.y = parseInt(y); + } + + /** + * Set the content for the popup window. This can be HTML code or text. + * @param {string | Element} content + */ + + }, { + key: 'setText', + value: function setText(content) { + if (content instanceof Element) { + this.frame.innerHTML = ''; + this.frame.appendChild(content); + } else { + this.frame.innerHTML = content; // string containing text or HTML + } + } + + /** + * Show the popup window + * @param {boolean} [doShow] Show or hide the window + */ + + }, { + key: 'show', + value: function show(doShow) { + if (doShow === undefined) { + doShow = true; + } + + if (doShow === true) { + var height = this.frame.clientHeight; + var width = this.frame.clientWidth; + var maxHeight = this.frame.parentNode.clientHeight; + var maxWidth = this.frame.parentNode.clientWidth; + + var left = 0, + top = 0; + + if (this.overflowMethod == 'flip') { + var isLeft = false, + isTop = true; // Where around the position it's located + + if (this.y - height < this.padding) { + isTop = false; + } + + if (this.x + width > maxWidth - this.padding) { + isLeft = true; + } + + if (isLeft) { + left = this.x - width; + } else { + left = this.x; + } + + if (isTop) { + top = this.y - height; + } else { + top = this.y; + } + } else { + top = this.y - height; + if (top + height + this.padding > maxHeight) { + top = maxHeight - height - this.padding; + } + if (top < this.padding) { + top = this.padding; + } + + left = this.x; + if (left + width + this.padding > maxWidth) { + left = maxWidth - width - this.padding; + } + if (left < this.padding) { + left = this.padding; + } + } + + this.frame.style.left = left + "px"; + this.frame.style.top = top + "px"; + this.frame.style.visibility = "visible"; + this.hidden = false; + } else { + this.hide(); + } + } + + /** + * Hide the popup window + */ + + }, { + key: 'hide', + value: function hide() { + this.hidden = true; + this.frame.style.visibility = "hidden"; + } + + /** + * Remove the popup window + */ + + }, { + key: 'destroy', + value: function destroy() { + this.frame.parentNode.removeChild(this.frame); // Remove element from DOM + } + }]); + return Popup; + }(); + + exports['default'] = Popup; + +/***/ }, +/* 129 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var moment = __webpack_require__(84); + var DateUtil = __webpack_require__(125); var util = __webpack_require__(1); /** @@ -22112,7 +24489,16 @@ return /******/ (function(modules) { // webpackBootstrap case 'minute': this.current.add(this.step, 'minute');break; case 'hour': - this.current.add(this.step, 'hour');break; + this.current.add(this.moment.duration(this.step, 'hour')); + + // correct for daylight saving + // FIXME: use this.current.add(moment.duration(this.step, 'hour')) + // see http://momentjs.com/docs/#special-considerations-for-months-and-years + if (this.current.hours() % this.step !== 0) { + this.current.add(this.step - this.current.hours() % this.step, 'hour'); + } + + break; case 'weekday': // intentional fall through case 'day': this.current.add(this.step, 'day');break; @@ -22129,13 +24515,13 @@ return /******/ (function(modules) { // webpackBootstrap // round down to the correct major value switch (this.scale) { case 'millisecond': - if (this.current.milliseconds() < this.step) this.current.milliseconds(0);break; + if (this.current.milliseconds() > 0 && this.current.milliseconds() < this.step) this.current.milliseconds(0);break; case 'second': - if (this.current.seconds() < this.step) this.current.seconds(0);break; + if (this.current.seconds() > 0 && this.current.seconds() < this.step) this.current.seconds(0);break; case 'minute': - if (this.current.minutes() < this.step) this.current.minutes(0);break; + if (this.current.minutes() > 0 && this.current.minutes() < this.step) this.current.minutes(0);break; case 'hour': - if (this.current.hours() < this.step) this.current.hours(0);break; + if (this.current.hours() > 0 && this.current.hours() < this.step) this.current.hours(0);break; case 'weekday': // intentional fall through case 'day': if (this.current.date() < this.step + 1) this.current.date(1);break; @@ -22565,7 +24951,7 @@ return /******/ (function(modules) { // webpackBootstrap return 'vis-' + current.format('dddd').toLowerCase() + today(current) + currentWeek(current) + even(current.date()); case 'day': - return 'vis-day' + current.date() + ' vis-' + current.format('MMMM').toLowerCase() + today(current) + currentMonth(current) + this.step <= 2 ? today(current) : '' + this.step <= 2 ? ' vis-' + current.format('dddd').toLowerCase() : '' + even(current.date() - 1); + return 'vis-day' + current.date() + ' vis-' + current.format('MMMM').toLowerCase() + today(current) + currentMonth(current) + (this.step <= 2 ? today(current) : '') + (this.step <= 2 ? ' vis-' + current.format('dddd').toLowerCase() : '' + even(current.date() - 1)); case 'month': return 'vis-' + current.format('MMMM').toLowerCase() + currentMonth(current) + even(current.month()); @@ -22582,14 +24968,20 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = TimeStep; /***/ }, -/* 38 */ +/* 130 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; + var _keys = __webpack_require__(58); + + var _keys2 = _interopRequireDefault(_keys); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + var util = __webpack_require__(1); - var stack = __webpack_require__(39); - var RangeItem = __webpack_require__(40); + var stack = __webpack_require__(131); + var RangeItem = __webpack_require__(132); /** * @constructor Group @@ -22605,6 +24997,17 @@ return /******/ (function(modules) { // webpackBootstrap this.itemSet = itemSet; this.isVisible = null; + if (data && data.nestedGroups) { + this.nestedGroups = data.nestedGroups; + if (data.showNested == false) { + this.showNested = false; + } else { + this.showNested = true; + } + } + + this.nestedInGroup = null; + this.dom = {}; this.props = { label: { @@ -22616,6 +25019,7 @@ return /******/ (function(modules) { // webpackBootstrap this.items = {}; // items filtered by groupId of this group this.visibleItems = []; // items currently visible in window + this.itemsInRange = []; // items currently in range this.orderedItems = { byStart: [], byEnd: [] @@ -22665,7 +25069,8 @@ return /******/ (function(modules) { // webpackBootstrap // display:none is changed to visible. this.dom.marker = document.createElement('div'); this.dom.marker.style.visibility = 'hidden'; - this.dom.marker.innerHTML = '?'; + this.dom.marker.style.position = 'absolute'; + this.dom.marker.innerHTML = ''; this.dom.background.appendChild(this.dom.marker); }; @@ -22701,13 +25106,39 @@ return /******/ (function(modules) { // webpackBootstrap // update title this.dom.label.title = data && data.title || ''; - if (!this.dom.inner.firstChild) { util.addClassName(this.dom.inner, 'vis-hidden'); } else { util.removeClassName(this.dom.inner, 'vis-hidden'); } + if (data && data.nestedGroups) { + if (data.showNested == false) { + this.showNested = false; + } else { + this.showNested = true; + } + + util.addClassName(this.dom.label, 'vis-nesting-group'); + if (this.showNested) { + util.removeClassName(this.dom.label, 'collapsed'); + util.addClassName(this.dom.label, 'expanded'); + } else { + util.removeClassName(this.dom.label, 'expanded'); + var collapsedDirClassName = this.itemSet.options.rtl ? 'collapsed-rtl' : 'collapsed'; + util.addClassName(this.dom.label, collapsedDirClassName); + } + } + + if (data && data.nestedInGroup) { + util.addClassName(this.dom.label, 'vis-nested-group'); + if (this.itemSet.options && this.itemSet.options.rtl) { + this.dom.inner.style.paddingRight = '30px'; + } else { + this.dom.inner.style.paddingLeft = '30px'; + } + } + // update className var className = data && data.className || null; if (className != this.className) { @@ -22758,7 +25189,6 @@ return /******/ (function(modules) { // webpackBootstrap var markerHeight = this.dom.marker.clientHeight; if (markerHeight != this.lastMarkerHeight) { this.lastMarkerHeight = markerHeight; - util.forEach(this.items, function (item) { item.dirty = true; if (item.displayed) item.redraw(); @@ -22768,9 +25198,7 @@ return /******/ (function(modules) { // webpackBootstrap } // recalculate the height of the subgroups - this._calculateSubGroupHeights(); - - this.isVisible = this._isGroupVisible(range, margin); + this._calculateSubGroupHeights(margin); // calculate actual size and position var foreground = this.dom.foreground; @@ -22804,23 +25232,22 @@ return /******/ (function(modules) { // webpackBootstrap stack.stack(customOrderedItems, margin, true /* restack=true */); } - this.visibleItems = this._updateVisibleItems(this.orderedItems, this.visibleItems, range); + this.visibleItems = this._updateItemsInRange(this.orderedItems, this.visibleItems, range); } else { // no custom order function, lazy stacking - this.visibleItems = this._updateVisibleItems(this.orderedItems, this.visibleItems, range); + this.visibleItems = this._updateItemsInRange(this.orderedItems, this.visibleItems, range); + if (this.itemSet.options.stack) { // TODO: ugly way to access options... stack.stack(this.visibleItems, margin, restack); } else { // no stacking - stack.nostack(this.visibleItems, margin, this.subgroups); + stack.nostack(this.visibleItems, margin, this.subgroups, this.itemSet.options.stackSubgroups); } } - if (!this.isVisible && this.height) { - return resized = false; - } + this._updateSubgroupsSizes(); // recalculate the height of the group var height = this._calculateHeight(margin); @@ -22844,6 +25271,13 @@ return /******/ (function(modules) { // webpackBootstrap for (var i = 0, ii = this.visibleItems.length; i < ii; i++) { var item = this.visibleItems[i]; item.repositionY(margin); + if (!this.isVisible && this.groupId != "__background__") { + if (item.displayed) item.hide(); + } + } + + if (!this.isVisible && this.height) { + return resized = false; } return resized; @@ -22853,15 +25287,15 @@ return /******/ (function(modules) { // webpackBootstrap * recalculate the height of the subgroups * @private */ - Group.prototype._calculateSubGroupHeights = function () { - if (Object.keys(this.subgroups).length > 0) { + Group.prototype._calculateSubGroupHeights = function (margin) { + if ((0, _keys2['default'])(this.subgroups).length > 0) { var me = this; this.resetSubgroups(); util.forEach(this.visibleItems, function (item) { if (item.data.subgroup !== undefined) { - me.subgroups[item.data.subgroup].height = Math.max(me.subgroups[item.data.subgroup].height, item.height); + me.subgroups[item.data.subgroup].height = Math.max(me.subgroups[item.data.subgroup].height, item.height + margin.item.vertical); me.subgroups[item.data.subgroup].visible = true; } }); @@ -22886,11 +25320,11 @@ return /******/ (function(modules) { // webpackBootstrap Group.prototype._calculateHeight = function (margin) { // recalculate the height of the group var height; - var visibleItems = this.visibleItems; - if (visibleItems.length > 0) { - var min = visibleItems[0].top; - var max = visibleItems[0].top + visibleItems[0].height; - util.forEach(visibleItems, function (item) { + var itemsInRange = this.visibleItems; + if (itemsInRange.length > 0) { + var min = itemsInRange[0].top; + var max = itemsInRange[0].top + itemsInRange[0].height; + util.forEach(itemsInRange, function (item) { min = Math.min(min, item.top); max = Math.max(max, item.top + item.height); }); @@ -22898,7 +25332,7 @@ return /******/ (function(modules) { // webpackBootstrap // there is an empty gap between the lowest item and the axis var offset = min - margin.axis; max -= offset; - util.forEach(visibleItems, function (item) { + util.forEach(itemsInRange, function (item) { item.top -= offset; }); } @@ -22968,9 +25402,25 @@ return /******/ (function(modules) { // webpackBootstrap // add to if (item.data.subgroup !== undefined) { if (this.subgroups[item.data.subgroup] === undefined) { - this.subgroups[item.data.subgroup] = { height: 0, visible: false, index: this.subgroupIndex, items: [] }; + this.subgroups[item.data.subgroup] = { + height: 0, + top: 0, + start: item.data.start, + end: item.data.end, + visible: false, + index: this.subgroupIndex, + items: [] + }; this.subgroupIndex++; } + + if (new Date(item.data.start) < new Date(this.subgroups[item.data.subgroup].start)) { + this.subgroups[item.data.subgroup].start = item.data.start; + } + if (new Date(item.data.end) > new Date(this.subgroups[item.data.subgroup].end)) { + this.subgroups[item.data.subgroup].end = item.data.end; + } + this.subgroups[item.data.subgroup].items.push(item); } this.orderSubgroups(); @@ -22981,6 +25431,28 @@ return /******/ (function(modules) { // webpackBootstrap } }; + Group.prototype._updateSubgroupsSizes = function () { + var me = this; + if (me.subgroups) { + for (var subgroup in me.subgroups) { + var newStart = me.subgroups[subgroup].items[0].data.start; + var newEnd = me.subgroups[subgroup].items[0].data.end; + + me.subgroups[subgroup].items.forEach(function (item) { + if (new Date(item.data.start) < new Date(newStart)) { + newStart = item.data.start; + } + if (new Date(item.data.end) > new Date(newEnd)) { + newEnd = item.data.end; + } + }); + + me.subgroups[subgroup].start = newStart; + me.subgroups[subgroup].end = newEnd; + } + } + }; + Group.prototype.orderSubgroups = function () { if (this.subgroupOrderer !== undefined) { var sortArray = []; @@ -23034,6 +25506,8 @@ return /******/ (function(modules) { // webpackBootstrap if (!subgroup.items.length) { delete this.subgroups[item.data.subgroup]; this.subgroupIndex--; + } else { + this._updateSubgroupsSizes(); } this.orderSubgroups(); } @@ -23079,16 +25553,9 @@ return /******/ (function(modules) { // webpackBootstrap * @return {Item[]} visibleItems The new visible items. * @private */ - Group.prototype._updateVisibleItems = function (orderedItems, oldVisibleItems, range) { + Group.prototype._updateItemsInRange = function (orderedItems, oldVisibleItems, range) { var visibleItems = []; var visibleItemsLookup = {}; // we keep this to quickly look up if an item already exists in the list without using indexOf on visibleItems - if (!this.isVisible && this.groupId != "__background__") { - for (var i = 0; i < oldVisibleItems.length; i++) { - var item = oldVisibleItems[i]; - if (item.displayed) item.hide(); - } - return visibleItems; - } var interval = (range.end - range.start) / 4; var lowerBound = range.start - interval; @@ -23225,7 +25692,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = Group; /***/ }, -/* 39 */ +/* 131 */ /***/ function(module, exports) { 'use strict'; @@ -23269,16 +25736,15 @@ return /******/ (function(modules) { // webpackBootstrap * items having a top===null will be re-stacked */ exports.stack = function (items, margin, force) { - var i, iMax; if (force) { // reset top position of all items - for (i = 0, iMax = items.length; i < iMax; i++) { + for (var i = 0; i < items.length; i++) { items[i].top = null; } } // calculate new, non-overlapping positions - for (i = 0, iMax = items.length; i < iMax; i++) { + for (var i = 0; i < items.length; i++) { var item = items[i]; if (item.stack && item.top === null) { // initialize top position @@ -23311,24 +25777,65 @@ return /******/ (function(modules) { // webpackBootstrap * All visible items * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin * Margins between items and between items and the axis. - */ - exports.nostack = function (items, margin, subgroups) { - var i, iMax, newTop; - - // reset top position of all items - for (i = 0, iMax = items.length; i < iMax; i++) { - if (items[i].data.subgroup !== undefined) { - newTop = margin.axis; + * @param {subgroups[]} subgroups + * All subgroups + */ + exports.nostack = function (items, margin, subgroups, stackSubgroups) { + for (var i = 0; i < items.length; i++) { + if (items[i].data.subgroup == undefined) { + items[i].top = margin.item.vertical; + } else if (items[i].data.subgroup !== undefined && stackSubgroups) { + var newTop = 0; for (var subgroup in subgroups) { if (subgroups.hasOwnProperty(subgroup)) { if (subgroups[subgroup].visible == true && subgroups[subgroup].index < subgroups[items[i].data.subgroup].index) { - newTop += subgroups[subgroup].height + margin.item.vertical; + newTop += subgroups[subgroup].height; + subgroups[items[i].data.subgroup].top = newTop; } } } - items[i].top = newTop; - } else { - items[i].top = margin.axis; + items[i].top = newTop + 0.5 * margin.item.vertical; + } + } + if (!stackSubgroups) { + exports.stackSubgroups(items, margin, subgroups); + } + }; + + /** + * Adjust vertical positions of the subgroups such that they don't overlap each + * other. + * @param {subgroups[]} subgroups + * All subgroups + * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin + * Margins between items and between items and the axis. + */ + exports.stackSubgroups = function (items, margin, subgroups) { + for (var subgroup in subgroups) { + if (subgroups.hasOwnProperty(subgroup)) { + + subgroups[subgroup].top = 0; + do { + // TODO: optimize checking for overlap. when there is a gap without items, + // you only need to check for items from the next item on, not from zero + var collidingItem = null; + for (var otherSubgroup in subgroups) { + if (subgroups[otherSubgroup].top !== null && otherSubgroup !== subgroup && subgroups[subgroup].index > subgroups[otherSubgroup].index && exports.collisionByTimes(subgroups[subgroup], subgroups[otherSubgroup])) { + collidingItem = subgroups[otherSubgroup]; + break; + } + } + + if (collidingItem != null) { + // There is a collision. Reposition the subgroups above the colliding element + subgroups[subgroup].top = collidingItem.top + collidingItem.height; + } + } while (collidingItem); + } + } + for (var i = 0; i < items.length; i++) { + if (items[i].data.subgroup !== undefined) { + items[i].top = subgroups[items[i].data.subgroup].top + 0.5 * margin.item.vertical; } } }; @@ -23352,14 +25859,25 @@ return /******/ (function(modules) { // webpackBootstrap } }; + /** + * Test if the two provided objects collide + * The objects must have parameters start, end, top, and height. + * @param {Object} a The first Object + * @param {Object} b The second Object + * @return {boolean} true if a and b collide, else false + */ + exports.collisionByTimes = function (a, b) { + return a.start <= b.start && a.end >= b.start && a.top < b.top + b.height && a.top + a.height > b.top || b.start <= a.start && b.end >= a.start && b.top < a.top + a.height && b.top + b.height > a.top; + }; + /***/ }, -/* 40 */ +/* 132 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var Hammer = __webpack_require__(22); - var Item = __webpack_require__(41); + var Hammer = __webpack_require__(108); + var Item = __webpack_require__(133); /** * @constructor RangeItem @@ -23420,11 +25938,16 @@ return /******/ (function(modules) { // webpackBootstrap dom.box = document.createElement('div'); // className is updated in redraw() - // frame box (to prevent the item contents from overflowing + // frame box (to prevent the item contents from overflowing) dom.frame = document.createElement('div'); dom.frame.className = 'vis-item-overflow'; dom.box.appendChild(dom.frame); + // visible frame box (showing the frame that is always visible) + dom.visibleFrame = document.createElement('div'); + dom.visibleFrame.className = 'vis-item-visible-frame'; + dom.box.appendChild(dom.visibleFrame); + // contents box dom.content = document.createElement('div'); dom.content.className = 'vis-item-content'; @@ -23455,7 +25978,7 @@ return /******/ (function(modules) { // webpackBootstrap // - the item is selected/deselected if (this.dirty) { this._updateContents(this.dom.content); - this._updateTitle(this.dom.box); + this._updateTitle(); this._updateDataAttributes(this.dom.box); this._updateStyle(this.dom.box); @@ -23683,14 +26206,24 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = RangeItem; /***/ }, -/* 41 */ +/* 133 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var Hammer = __webpack_require__(22); + var _keys = __webpack_require__(58); + + var _keys2 = _interopRequireDefault(_keys); + + var _typeof2 = __webpack_require__(62); + + var _typeof3 = _interopRequireDefault(_typeof2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var Hammer = __webpack_require__(108); var util = __webpack_require__(1); - var moment = __webpack_require__(2); + var moment = __webpack_require__(84); /** * @constructor Item @@ -23710,7 +26243,9 @@ return /******/ (function(modules) { // webpackBootstrap this.options = options || {}; this.selected = false; this.displayed = false; + this.groupShowing = true; this.dirty = true; + this.popup = null; this.top = null; this.right = null; @@ -23719,8 +26254,17 @@ return /******/ (function(modules) { // webpackBootstrap this.height = null; this.editable = null; - if (this.data && this.data.hasOwnProperty('editable') && typeof this.data.editable === 'boolean') { - this.editable = data.editable; + if (this.data && this.data.hasOwnProperty('editable')) { + if (typeof this.data.editable === 'boolean') { + this.editable = { + updateTime: this.data.editable, + updateGroup: this.data.editable, + remove: this.data.editable + }; + } else if ((0, _typeof3['default'])(options.editable) === 'object') { + this.editable = {}; + util.selectiveExtend(['updateTime', 'updateGroup', 'remove'], this.editable, data.editable); + }; } } @@ -23755,8 +26299,17 @@ return /******/ (function(modules) { // webpackBootstrap this.parent.itemSet._moveToGroup(this, data.group); } - if (data.hasOwnProperty('editable') && typeof data.editable === 'boolean') { - this.editable = data.editable; + if (data.hasOwnProperty('editable')) { + if (typeof data.editable === 'boolean') { + this.editable = { + updateTime: this.data.editable, + updateGroup: this.data.editable, + remove: this.data.editable + }; + } else if ((0, _typeof3['default'])(options.editable) === 'object') { + this.editable = {}; + util.selectiveExtend(['updateTime', 'updateGroup', 'remove'], this.editable, data.editable); + } } this.data = data; @@ -23826,13 +26379,47 @@ return /******/ (function(modules) { // webpackBootstrap // should be implemented by the item }; + /** + * Repaint a drag area on the center of the item when the item is selected + * @protected + */ + Item.prototype._repaintDragCenter = function () { + if (this.selected && this.options.editable.updateTime && !this.dom.dragCenter) { + var me = this; + + // create and show drag area + var dragCenter = document.createElement('div'); + dragCenter.className = 'vis-drag-center'; + dragCenter.dragCenterItem = this; + + new Hammer(dragCenter).on('doubletap', function (event) { + event.stopPropagation(); + me.parent.itemSet._onUpdateItem(me); + }); + + if (this.dom.box) { + this.dom.box.appendChild(dragCenter); + } else if (this.dom.point) { + this.dom.point.appendChild(dragCenter); + } + + this.dom.dragCenter = dragCenter; + } else if (!this.selected && this.dom.dragCenter) { + // delete drag area + if (this.dom.dragCenter.parentNode) { + this.dom.dragCenter.parentNode.removeChild(this.dom.dragCenter); + } + this.dom.dragCenter = null; + } + }; + /** * Repaint a delete button on the top right of the item when the item is selected * @param {HTMLElement} anchor * @protected */ Item.prototype._repaintDeleteButton = function (anchor) { - var editable = (this.options.editable.remove || this.data.editable === true) && this.data.editable !== false; + var editable = (this.options.editable.overrideItems || this.editable == null) && this.options.editable.remove || !this.options.editable.overrideItems && this.editable != null && this.editable.remove; if (this.selected && editable && !this.dom.deleteButton) { // create and show button @@ -23951,9 +26538,44 @@ return /******/ (function(modules) { // webpackBootstrap Item.prototype._updateContents = function (element) { var content; var templateFunction; + var itemVisibleFrameContent; + var visibleFrameTemplateFunction; + var itemData = this.parent.itemSet.itemsData.get(this.id); // get a clone of the data from the dataset + + var frameElement = this.dom.box || this.dom.point; + var itemVisibleFrameContentElement = frameElement.getElementsByClassName('vis-item-visible-frame')[0]; + + if (this.options.visibleFrameTemplate) { + visibleFrameTemplateFunction = this.options.visibleFrameTemplate.bind(this); + itemVisibleFrameContent = visibleFrameTemplateFunction(itemData, frameElement); + } else { + itemVisibleFrameContent = ''; + } + + if (itemVisibleFrameContentElement) { + if (itemVisibleFrameContent instanceof Object && !(itemVisibleFrameContent instanceof Element)) { + visibleFrameTemplateFunction(itemData, itemVisibleFrameContentElement); + } else { + var changed = this._contentToString(this.itemVisibleFrameContent) !== this._contentToString(itemVisibleFrameContent); + if (changed) { + // only replace the content when changed + if (itemVisibleFrameContent instanceof Element) { + itemVisibleFrameContentElement.innerHTML = ''; + itemVisibleFrameContentElement.appendChild(itemVisibleFrameContent); + } else if (itemVisibleFrameContent != undefined) { + itemVisibleFrameContentElement.innerHTML = itemVisibleFrameContent; + } else { + if (!(this.data.type == 'background' && this.data.content === undefined)) { + throw new Error('Property "content" missing in item ' + this.id); + } + } + + this.itemVisibleFrameContent = itemVisibleFrameContent; + } + } + } if (this.options.template) { - var itemData = this.parent.itemSet.itemsData.get(this.id); // get a clone of the data from the dataset templateFunction = this.options.template.bind(this); content = templateFunction(itemData, element); } else { @@ -23984,14 +26606,13 @@ return /******/ (function(modules) { // webpackBootstrap /** * Set HTML contents for the item - * @param {Element} element HTML element to fill with the contents * @private */ - Item.prototype._updateTitle = function (element) { + Item.prototype._updateTitle = function () { if (this.data.title != null) { - element.title = this.data.title || ''; - } else { - element.removeAttribute('vis-title'); + if (this.popup != null) { + this.popup.setText(this.data.title || ''); + } } }; @@ -24007,7 +26628,7 @@ return /******/ (function(modules) { // webpackBootstrap if (Array.isArray(this.options.dataAttributes)) { attributes = this.options.dataAttributes; } else if (this.options.dataAttributes == 'all') { - attributes = Object.keys(this.data); + attributes = (0, _keys2['default'])(this.data); } else { return; } @@ -24073,42 +26694,38 @@ return /******/ (function(modules) { // webpackBootstrap }; /** - * Repaint a drag area on the center of the item when the item is selected - * @protected + * Return the title of the item + * @return {string | undefined} */ - Item.prototype._repaintDragCenter = function () { - if (this.selected && this.options.editable.updateTime && !this.dom.dragCenter) { - // create and show drag area - var dragCenter = document.createElement('div'); - dragCenter.className = 'vis-drag-center'; - dragCenter.dragCenterItem = this; - - if (this.dom.box) { - this.dom.box.appendChild(dragCenter); - } else if (this.dom.point) { - this.dom.point.appendChild(dragCenter); - } + Item.prototype.getTitle = function () { + return this.data.title; + }; - this.dom.dragCenter = dragCenter; - } else if (!this.selected && this.dom.dragCenter) { - // delete drag area - if (this.dom.dragCenter.parentNode) { - this.dom.dragCenter.parentNode.removeChild(this.dom.dragCenter); - } - this.dom.dragCenter = null; - } + /** + * Set the popup object, and update the title + * @param {Popup} popup + */ + Item.prototype.setPopup = function (popup) { + this.popup = popup; + this._updateTitle(); }; module.exports = Item; /***/ }, -/* 42 */ +/* 134 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; + var _create = __webpack_require__(55); + + var _create2 = _interopRequireDefault(_create); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + var util = __webpack_require__(1); - var Group = __webpack_require__(38); + var Group = __webpack_require__(130); /** * @constructor BackgroundGroup @@ -24125,7 +26742,7 @@ return /******/ (function(modules) { // webpackBootstrap this.left = 0; } - BackgroundGroup.prototype = Object.create(Group.prototype); + BackgroundGroup.prototype = (0, _create2['default'])(Group.prototype); /** * Repaint this group @@ -24137,7 +26754,7 @@ return /******/ (function(modules) { // webpackBootstrap BackgroundGroup.prototype.redraw = function (range, margin, restack) { var resized = false; - this.visibleItems = this._updateVisibleItems(this.orderedItems, this.visibleItems, range); + this.visibleItems = this._updateItemsInRange(this.orderedItems, this.visibleItems, range); // calculate actual size this.width = this.dom.background.offsetWidth; @@ -24166,12 +26783,12 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = BackgroundGroup; /***/ }, -/* 43 */ +/* 135 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var Item = __webpack_require__(41); + var Item = __webpack_require__(133); var util = __webpack_require__(1); /** @@ -24290,7 +26907,7 @@ return /******/ (function(modules) { // webpackBootstrap // - the item is selected/deselected if (this.dirty) { this._updateContents(this.dom.content); - this._updateTitle(this.dom.box); + this._updateTitle(); this._updateDataAttributes(this.dom.box); this._updateStyle(this.dom.box); @@ -24469,12 +27086,12 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = BoxItem; /***/ }, -/* 44 */ +/* 136 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var Item = __webpack_require__(41); + var Item = __webpack_require__(133); /** * @constructor PointItem @@ -24573,7 +27190,7 @@ return /******/ (function(modules) { // webpackBootstrap // - the item is selected/deselected if (this.dirty) { this._updateContents(this.dom.content); - this._updateTitle(this.dom.point); + this._updateTitle(); this._updateDataAttributes(this.dom.point); this._updateStyle(this.dom.point); @@ -24693,15 +27310,15 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = PointItem; /***/ }, -/* 45 */ +/* 137 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var Hammer = __webpack_require__(22); - var Item = __webpack_require__(41); - var BackgroundGroup = __webpack_require__(42); - var RangeItem = __webpack_require__(40); + var Hammer = __webpack_require__(108); + var Item = __webpack_require__(133); + var BackgroundGroup = __webpack_require__(134); + var RangeItem = __webpack_require__(132); /** * @constructor BackgroundItem @@ -24800,7 +27417,7 @@ return /******/ (function(modules) { // webpackBootstrap // - the item is selected/deselected if (this.dirty) { this._updateContents(this.dom.content); - this._updateTitle(this.dom.content); + this._updateTitle(); this._updateDataAttributes(this.dom.content); this._updateStyle(this.dom.box); @@ -24842,9 +27459,6 @@ return /******/ (function(modules) { // webpackBootstrap * @Override */ BackgroundItem.prototype.repositionY = function (margin) { - var onTop = this.options.orientation.item === 'top'; - this.dom.content.style.top = onTop ? '' : '0'; - this.dom.content.style.bottom = onTop ? '0' : ''; var height; // special positioning for subgroups @@ -24854,44 +27468,16 @@ return /******/ (function(modules) { // webpackBootstrap var itemSubgroup = this.data.subgroup; var subgroups = this.parent.subgroups; var subgroupIndex = subgroups[itemSubgroup].index; - // if the orientation is top, we need to take the difference in height into account. - if (onTop == true) { - // the first subgroup will have to account for the distance from the top to the first item. - height = this.parent.subgroups[itemSubgroup].height + margin.item.vertical; - height += subgroupIndex == 0 ? margin.axis - 0.5 * margin.item.vertical : 0; - var newTop = this.parent.top; - for (var subgroup in subgroups) { - if (subgroups.hasOwnProperty(subgroup)) { - if (subgroups[subgroup].visible == true && subgroups[subgroup].index < subgroupIndex) { - newTop += subgroups[subgroup].height + margin.item.vertical; - } - } - } - // the others will have to be offset downwards with this same distance. - newTop += subgroupIndex != 0 ? margin.axis - 0.5 * margin.item.vertical : 0; - this.dom.box.style.top = newTop + 'px'; - this.dom.box.style.bottom = ''; + this.dom.box.style.height = this.parent.subgroups[itemSubgroup].height + 'px'; + + var orientation = this.options.orientation.item; + if (orientation == 'top') { + this.dom.box.style.top = this.parent.top + this.parent.subgroups[itemSubgroup].top + 'px'; + } else { + this.dom.box.style.top = this.parent.top + this.parent.height - this.parent.subgroups[itemSubgroup].top - this.parent.subgroups[itemSubgroup].height + 'px'; } - // and when the orientation is bottom: - else { - var newTop = this.parent.top; - var totalHeight = 0; - for (var subgroup in subgroups) { - if (subgroups.hasOwnProperty(subgroup)) { - if (subgroups[subgroup].visible == true) { - var newHeight = subgroups[subgroup].height + margin.item.vertical; - totalHeight += newHeight; - if (subgroups[subgroup].index > subgroupIndex) { - newTop += newHeight; - } - } - } - } - height = this.parent.subgroups[itemSubgroup].height + margin.item.vertical; - this.dom.box.style.top = this.parent.height - totalHeight + newTop + 'px'; - this.dom.box.style.bottom = ''; - } + this.dom.box.style.bottom = ''; } // and in the case of no subgroups: else { @@ -24899,8 +27485,8 @@ return /******/ (function(modules) { // webpackBootstrap if (this.parent instanceof BackgroundGroup) { // if the item is not in a group: height = Math.max(this.parent.height, this.parent.itemSet.body.domProps.center.height, this.parent.itemSet.body.domProps.centerContainer.height); - this.dom.box.style.top = onTop ? '0' : ''; - this.dom.box.style.bottom = onTop ? '' : '0'; + this.dom.box.style.top = orientation == 'top' ? '0' : ''; + this.dom.box.style.bottom = orientation == 'top' ? '' : '0'; } else { height = this.parent.height; // same alignment for items when orientation is top or bottom @@ -24914,18 +27500,22 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = BackgroundItem; /***/ }, -/* 46 */ +/* 138 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + var _typeof2 = __webpack_require__(62); + + var _typeof3 = _interopRequireDefault(_typeof2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var util = __webpack_require__(1); - var Component = __webpack_require__(33); - var TimeStep = __webpack_require__(37); - var DateUtil = __webpack_require__(34); - var moment = __webpack_require__(2); + var Component = __webpack_require__(124); + var TimeStep = __webpack_require__(129); + var DateUtil = __webpack_require__(125); + var moment = __webpack_require__(84); /** * A horizontal time axis @@ -24998,7 +27588,7 @@ return /******/ (function(modules) { // webpackBootstrap if ('orientation' in options) { if (typeof options.orientation === 'string') { this.options.orientation.axis = options.orientation; - } else if (_typeof(options.orientation) === 'object' && 'axis' in options.orientation) { + } else if ((0, _typeof3['default'])(options.orientation) === 'object' && 'axis' in options.orientation) { this.options.orientation.axis = options.orientation.axis; } } @@ -25242,8 +27832,7 @@ return /******/ (function(modules) { // webpackBootstrap this.dom.foreground.appendChild(label); } this.dom.minorTexts.push(label); - - label.childNodes[0].nodeValue = text; + label.innerHTML = text; label.style.top = orientation == 'top' ? this.props.majorLabelHeight + 'px' : '0'; @@ -25274,14 +27863,13 @@ return /******/ (function(modules) { // webpackBootstrap if (!label) { // create label - var content = document.createTextNode(text); + var content = document.createElement('div'); label = document.createElement('div'); label.appendChild(content); this.dom.foreground.appendChild(label); } - this.dom.majorTexts.push(label); - label.childNodes[0].nodeValue = text; + label.childNodes[0].innerHTML = text; label.className = 'vis-text vis-major ' + className; //label.title = title; // TODO: this is a heavy operation @@ -25293,6 +27881,7 @@ return /******/ (function(modules) { // webpackBootstrap label.style.left = x + 'px'; }; + this.dom.majorTexts.push(label); return label; }; @@ -25415,14 +28004,14 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = TimeAxis; /***/ }, -/* 47 */ +/* 139 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var keycharm = __webpack_require__(25); - var Emitter = __webpack_require__(13); - var Hammer = __webpack_require__(22); + var keycharm = __webpack_require__(111); + var Emitter = __webpack_require__(95); + var Hammer = __webpack_require__(108); var util = __webpack_require__(1); /** @@ -25574,16 +28163,16 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = Activator; /***/ }, -/* 48 */ +/* 140 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var Hammer = __webpack_require__(22); + var Hammer = __webpack_require__(108); var util = __webpack_require__(1); - var Component = __webpack_require__(33); - var moment = __webpack_require__(2); - var locales = __webpack_require__(49); + var Component = __webpack_require__(124); + var moment = __webpack_require__(84); + var locales = __webpack_require__(141); /** * A custom time bar @@ -25658,8 +28247,22 @@ return /******/ (function(modules) { // webpackBootstrap drag.style.left = '-10px'; drag.style.height = '100%'; drag.style.width = '20px'; - bar.appendChild(drag); + function onMouseWheel(e) { + this.body.range._onMouseWheel(e); + } + + if (drag.addEventListener) { + // IE9, Chrome, Safari, Opera + drag.addEventListener("mousewheel", onMouseWheel.bind(this), false); + // Firefox + drag.addEventListener("DOMMouseScroll", onMouseWheel.bind(this), false); + } else { + // IE 6/7/8 + drag.attachEvent("onmousewheel", onMouseWheel.bind(this)); + } + + bar.appendChild(drag); // attach event listeners this.hammer = new Hammer(drag); this.hammer.on('panstart', this._onDragStart.bind(this)); @@ -25781,7 +28384,8 @@ return /******/ (function(modules) { // webpackBootstrap // fire a timechange event this.body.emitter.emit('timechange', { id: this.options.id, - time: new Date(this.customTime.valueOf()) + time: new Date(this.customTime.valueOf()), + event: util.elementsCensor(event) }); event.stopPropagation(); @@ -25798,7 +28402,8 @@ return /******/ (function(modules) { // webpackBootstrap // fire a timechanged event this.body.emitter.emit('timechanged', { id: this.options.id, - time: new Date(this.customTime.valueOf()) + time: new Date(this.customTime.valueOf()), + event: util.elementsCensor(event) }); event.stopPropagation(); @@ -25825,7 +28430,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = CustomTime; /***/ }, -/* 49 */ +/* 141 */ /***/ function(module, exports) { 'use strict'; @@ -25862,15 +28467,15 @@ return /******/ (function(modules) { // webpackBootstrap exports['de_DE'] = exports['de']; /***/ }, -/* 50 */ +/* 142 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var util = __webpack_require__(1); - var Component = __webpack_require__(33); - var moment = __webpack_require__(2); - var locales = __webpack_require__(49); + var Component = __webpack_require__(124); + var moment = __webpack_require__(84); + var locales = __webpack_require__(141); /** * A current time bar @@ -26045,7 +28650,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = CurrentTime; /***/ }, -/* 51 */ +/* 143 */ /***/ function(module, exports) { 'use strict'; @@ -26061,7 +28666,7 @@ return /******/ (function(modules) { // webpackBootstrap * __type__ is a required field for all objects and contains the allowed types of all objects */ var string = 'string'; - var boolean = 'boolean'; + var bool = 'boolean'; var number = 'number'; var array = 'array'; var date = 'date'; @@ -26072,26 +28677,29 @@ return /******/ (function(modules) { // webpackBootstrap var allOptions = { configure: { - enabled: { boolean: boolean }, - filter: { boolean: boolean, 'function': 'function' }, + enabled: { 'boolean': bool }, + filter: { 'boolean': bool, 'function': 'function' }, container: { dom: dom }, - __type__: { object: object, boolean: boolean, 'function': 'function' } + __type__: { object: object, 'boolean': bool, 'function': 'function' } }, //globals : align: { string: string }, - rtl: { boolean: boolean, 'undefined': 'undefined' }, - verticalScroll: { boolean: boolean, 'undefined': 'undefined' }, - horizontalScroll: { boolean: boolean, 'undefined': 'undefined' }, - autoResize: { boolean: boolean }, - clickToUse: { boolean: boolean }, + rtl: { 'boolean': bool, 'undefined': 'undefined' }, + rollingMode: { 'boolean': bool, 'undefined': 'undefined' }, + verticalScroll: { 'boolean': bool, 'undefined': 'undefined' }, + horizontalScroll: { 'boolean': bool, 'undefined': 'undefined' }, + autoResize: { 'boolean': bool }, + throttleRedraw: { number: number }, // TODO: DEPRICATED see https://github.com/almende/vis/issues/2511 + clickToUse: { 'boolean': bool }, dataAttributes: { string: string, array: array }, editable: { - add: { boolean: boolean, 'undefined': 'undefined' }, - remove: { boolean: boolean, 'undefined': 'undefined' }, - updateGroup: { boolean: boolean, 'undefined': 'undefined' }, - updateTime: { boolean: boolean, 'undefined': 'undefined' }, - __type__: { boolean: boolean, object: object } + add: { 'boolean': bool, 'undefined': 'undefined' }, + remove: { 'boolean': bool, 'undefined': 'undefined' }, + updateGroup: { 'boolean': bool, 'undefined': 'undefined' }, + updateTime: { 'boolean': bool, 'undefined': 'undefined' }, + overrideItems: { 'boolean': bool, 'undefined': 'undefined' }, + __type__: { 'boolean': bool, object: object } }, end: { number: number, date: date, string: string, moment: moment }, format: { @@ -26122,10 +28730,10 @@ return /******/ (function(modules) { // webpackBootstrap moment: { 'function': 'function' }, groupOrder: { string: string, 'function': 'function' }, groupEditable: { - add: { boolean: boolean, 'undefined': 'undefined' }, - remove: { boolean: boolean, 'undefined': 'undefined' }, - order: { boolean: boolean, 'undefined': 'undefined' }, - __type__: { boolean: boolean, object: object } + add: { 'boolean': bool, 'undefined': 'undefined' }, + remove: { 'boolean': bool, 'undefined': 'undefined' }, + order: { 'boolean': bool, 'undefined': 'undefined' }, + __type__: { 'boolean': bool, object: object } }, groupOrderSwap: { 'function': 'function' }, height: { string: string, number: number }, @@ -26135,7 +28743,7 @@ return /******/ (function(modules) { // webpackBootstrap repeat: { string: string }, __type__: { object: object, array: array } }, - itemsAlwaysDraggable: { boolean: boolean }, + itemsAlwaysDraggable: { 'boolean': bool }, locale: { string: string }, locales: { __any__: { any: any }, @@ -26155,9 +28763,9 @@ return /******/ (function(modules) { // webpackBootstrap maxMinorChars: { number: number }, min: { date: date, number: number, string: string, moment: moment }, minHeight: { number: number, string: string }, - moveable: { boolean: boolean }, - multiselect: { boolean: boolean }, - multiselectPerGroup: { boolean: boolean }, + moveable: { 'boolean': bool }, + multiselect: { 'boolean': bool }, + multiselectPerGroup: { 'boolean': bool }, onAdd: { 'function': 'function' }, onUpdate: { 'function': 'function' }, onMove: { 'function': 'function' }, @@ -26172,18 +28780,25 @@ return /******/ (function(modules) { // webpackBootstrap item: { string: string, 'undefined': 'undefined' }, __type__: { string: string, object: object } }, - selectable: { boolean: boolean }, - showCurrentTime: { boolean: boolean }, - showMajorLabels: { boolean: boolean }, - showMinorLabels: { boolean: boolean }, - stack: { boolean: boolean }, + selectable: { 'boolean': bool }, + showCurrentTime: { 'boolean': bool }, + showMajorLabels: { 'boolean': bool }, + showMinorLabels: { 'boolean': bool }, + stack: { 'boolean': bool }, + stackSubgroups: { 'boolean': bool }, snap: { 'function': 'function', 'null': 'null' }, start: { date: date, number: number, string: string, moment: moment }, template: { 'function': 'function' }, groupTemplate: { 'function': 'function' }, + visibleFrameTemplate: { string: string, 'function': 'function' }, + tooltip: { + followMouse: { 'boolean': bool }, + overflowMethod: { 'string': ['cap', 'flip'] }, + __type__: { object: object } + }, tooltipOnItemUpdateTime: { template: { 'function': 'function' }, - __type__: { boolean: boolean, object: object } + __type__: { 'boolean': bool, object: object } }, timeAxis: { scale: { string: string, 'undefined': 'undefined' }, @@ -26192,7 +28807,7 @@ return /******/ (function(modules) { // webpackBootstrap }, type: { string: string }, width: { string: string, number: number }, - zoomable: { boolean: boolean }, + zoomable: { 'boolean': bool }, zoomKey: { string: ['ctrlKey', 'altKey', 'metaKey', ''] }, zoomMax: { number: number }, zoomMin: { number: number }, @@ -26272,6 +28887,7 @@ return /******/ (function(modules) { // webpackBootstrap showMajorLabels: true, showMinorLabels: true, stack: true, + stackSubgroups: true, //snap: {'function': 'function', nada}, start: '', //template: {'function': 'function'}, @@ -26279,6 +28895,10 @@ return /******/ (function(modules) { // webpackBootstrap // scale: ['millisecond', 'second', 'minute', 'hour', 'weekday', 'day', 'month', 'year'], // step: [1, 1, 10, 1] //}, + tooltip: { + followMouse: false, + overflowMethod: 'flip' + }, tooltipOnItemUpdateTime: false, type: ['box', 'point', 'range', 'background'], width: '100%', @@ -26293,37 +28913,37 @@ return /******/ (function(modules) { // webpackBootstrap exports.configureOptions = configureOptions; /***/ }, -/* 52 */ +/* 144 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var _Configurator = __webpack_require__(28); + var _Configurator = __webpack_require__(114); var _Configurator2 = _interopRequireDefault(_Configurator); - var _Validator = __webpack_require__(31); + var _Validator = __webpack_require__(122); var _Validator2 = _interopRequireDefault(_Validator); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - var Emitter = __webpack_require__(13); - var Hammer = __webpack_require__(22); - var moment = __webpack_require__(2); + var Emitter = __webpack_require__(95); + var Hammer = __webpack_require__(108); + var moment = __webpack_require__(84); var util = __webpack_require__(1); - var DataSet = __webpack_require__(9); - var DataView = __webpack_require__(11); - var Range = __webpack_require__(32); - var Core = __webpack_require__(35); - var TimeAxis = __webpack_require__(46); - var CurrentTime = __webpack_require__(50); - var CustomTime = __webpack_require__(48); - var LineGraph = __webpack_require__(53); + var DataSet = __webpack_require__(91); + var DataView = __webpack_require__(93); + var Range = __webpack_require__(123); + var Core = __webpack_require__(126); + var TimeAxis = __webpack_require__(138); + var CurrentTime = __webpack_require__(142); + var CustomTime = __webpack_require__(140); + var LineGraph = __webpack_require__(145); - var printStyle = __webpack_require__(31).printStyle; - var allOptions = __webpack_require__(61).allOptions; - var configureOptions = __webpack_require__(61).configureOptions; + var printStyle = __webpack_require__(122).printStyle; + var allOptions = __webpack_require__(153).allOptions; + var configureOptions = __webpack_require__(153).configureOptions; /** * Create a timeline visualization @@ -26341,6 +28961,12 @@ return /******/ (function(modules) { // webpackBootstrap groups = forthArgument; } + // TODO: REMOVE THIS in the next MAJOR release + // see https://github.com/almende/vis/issues/2511 + if (options && options.throttleRedraw) { + console.warn("Graph2d option \"throttleRedraw\" is DEPRICATED and no longer supported. It will be removed in the next MAJOR release."); + } + var me = this; this.defaultOptions = { start: null, @@ -26442,7 +29068,7 @@ return /******/ (function(modules) { // webpackBootstrap Graph2d.prototype.setOptions = function (options) { // validate options - var errorFound = _Validator2.default.validate(options, allOptions); + var errorFound = _Validator2['default'].validate(options, allOptions); if (errorFound === true) { console.log('%cErrors have been found in the supplied options object.', printStyle); } @@ -26611,10 +29237,10 @@ return /******/ (function(modules) { // webpackBootstrap var value = []; var yAxisLeft = this.linegraph.yAxisLeft; var yAxisRight = this.linegraph.yAxisRight; - if (!yAxisLeft.hidden) { + if (!yAxisLeft.hidden && this.itemsData.length > 0) { value.push(yAxisLeft.screenToValue(y)); } - if (!yAxisRight.hidden) { + if (!yAxisRight.hidden && this.itemsData.length > 0) { value.push(yAxisRight.screenToValue(y)); } @@ -26636,30 +29262,34 @@ return /******/ (function(modules) { // webpackBootstrap * @private */ Graph2d.prototype._createConfigurator = function () { - return new _Configurator2.default(this, this.dom.container, configureOptions); + return new _Configurator2['default'](this, this.dom.container, configureOptions); }; module.exports = Graph2d; /***/ }, -/* 53 */ +/* 145 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + var _typeof2 = __webpack_require__(62); + + var _typeof3 = _interopRequireDefault(_typeof2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var util = __webpack_require__(1); - var DOMutil = __webpack_require__(8); - var DataSet = __webpack_require__(9); - var DataView = __webpack_require__(11); - var Component = __webpack_require__(33); - var DataAxis = __webpack_require__(54); - var GraphGroup = __webpack_require__(56); - var Legend = __webpack_require__(60); - var Bars = __webpack_require__(57); - var Lines = __webpack_require__(59); - var Points = __webpack_require__(58); + var DOMutil = __webpack_require__(90); + var DataSet = __webpack_require__(91); + var DataView = __webpack_require__(93); + var Component = __webpack_require__(124); + var DataAxis = __webpack_require__(146); + var GraphGroup = __webpack_require__(148); + var Legend = __webpack_require__(152); + var Bars = __webpack_require__(149); + var Lines = __webpack_require__(151); + var Points = __webpack_require__(150); var UNGROUPED = '__ungrouped__'; // reserved group id for ungrouped items @@ -26825,7 +29455,7 @@ return /******/ (function(modules) { // webpackBootstrap util.mergeOptions(this.options, options, 'legend'); if (options.interpolation) { - if (_typeof(options.interpolation) == 'object') { + if ((0, _typeof3['default'])(options.interpolation) == 'object') { if (options.interpolation.parametrization) { if (options.interpolation.parametrization == 'uniform') { this.options.interpolation.alpha = 0; @@ -26974,7 +29604,7 @@ return /******/ (function(modules) { // webpackBootstrap }; LineGraph.prototype._onUpdate = function (ids) { - this._updateAllGroupData(); + this._updateAllGroupData(ids); }; LineGraph.prototype._onAdd = function (ids) { this._onUpdate(ids); @@ -26983,7 +29613,7 @@ return /******/ (function(modules) { // webpackBootstrap this._onUpdate(ids); }; LineGraph.prototype._onUpdateGroups = function (groupIds) { - this._updateAllGroupData(); + this._updateAllGroupData(null, groupIds); }; LineGraph.prototype._onAddGroups = function (groupIds) { this._onUpdateGroups(groupIds); @@ -27062,12 +29692,22 @@ return /******/ (function(modules) { // webpackBootstrap /** * this updates all groups, it is used when there is an update the the itemset. * + * @param {Array} ids + * @param {Array} groupIds * @private */ - LineGraph.prototype._updateAllGroupData = function () { + LineGraph.prototype._updateAllGroupData = function (ids, groupIds) { if (this.itemsData != null) { var groupsContent = {}; var items = this.itemsData.get(); + var fieldId = this.itemsData._fieldId; + var idMap = {}; + if (ids) { + ids.map(function (id) { + idMap[id] = id; + }); + } + //pre-Determine array sizes, for more efficient memory claim var groupCounts = {}; for (var i = 0; i < items.length; i++) { @@ -27078,6 +29718,26 @@ return /******/ (function(modules) { // webpackBootstrap } groupCounts.hasOwnProperty(groupId) ? groupCounts[groupId]++ : groupCounts[groupId] = 1; } + + //Pre-load arrays from existing groups if items are not changed (not in ids) + if (!groupIds && ids) { + for (var groupId in this.groups) { + if (this.groups.hasOwnProperty(groupId)) { + var group = this.groups[groupId]; + var existing_items = group.getItems(); + + groupsContent[groupId] = existing_items.filter(function (item) { + return item[fieldId] !== idMap[item[fieldId]]; + }); + var newLength = groupCounts[groupId]; + groupCounts[groupId] -= groupsContent[groupId].length; + if (groupsContent[groupId].length < newLength) { + groupsContent[groupId][newLength - 1] = {}; + } + } + } + } + //Now insert data into the arrays. for (var i = 0; i < items.length; i++) { var item = items[i]; @@ -27085,6 +29745,9 @@ return /******/ (function(modules) { // webpackBootstrap if (groupId === null || groupId === undefined) { groupId = UNGROUPED; } + if (!groupIds && ids && item[fieldId] !== idMap[item[fieldId]]) { + continue; + } if (!groupsContent.hasOwnProperty(groupId)) { groupsContent[groupId] = new Array(groupCounts[groupId]); } @@ -27093,6 +29756,7 @@ return /******/ (function(modules) { // webpackBootstrap extended.x = util.convert(item.x, 'Date'); extended.orginalY = item.y; //real Y extended.y = Number(item.y); + extended[fieldId] = item[fieldId]; var index = groupsContent[groupId].length - groupCounts[groupId]--; groupsContent[groupId][index] = extended; @@ -27458,6 +30122,7 @@ return /******/ (function(modules) { // webpackBootstrap // the global screen is used because changing the width of the yAxis may affect the increment, resulting in an endless loop // of width changing of the yAxis. + //TODO: This assumes sorted data, but that's not guaranteed! var xDistance = this.body.util.toGlobalScreen(dataContainer[dataContainer.length - 1].x) - this.body.util.toGlobalScreen(dataContainer[0].x); var pointsPerPixel = amountOfPoints / xDistance; increment = Math.min(Math.ceil(0.2 * amountOfPoints), Math.max(1, Math.round(pointsPerPixel))); @@ -27674,15 +30339,21 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = LineGraph; /***/ }, -/* 54 */ +/* 146 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; + var _keys = __webpack_require__(58); + + var _keys2 = _interopRequireDefault(_keys); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + var util = __webpack_require__(1); - var DOMutil = __webpack_require__(8); - var Component = __webpack_require__(33); - var DataScale = __webpack_require__(55); + var DOMutil = __webpack_require__(90); + var Component = __webpack_require__(124); + var DataScale = __webpack_require__(147); /** * A horizontal time axis * @param {Object} [options] See DataAxis.setOptions for the available @@ -27847,7 +30518,7 @@ return /******/ (function(modules) { // webpackBootstrap x = this.width - iconWidth - iconOffset; } - var groupArray = Object.keys(this.groups); + var groupArray = (0, _keys2['default'])(this.groups); groupArray.sort(function (a, b) { return a < b ? -1 : 1; }); @@ -28234,7 +30905,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = DataAxis; /***/ }, -/* 55 */ +/* 147 */ /***/ function(module, exports) { 'use strict'; @@ -28476,18 +31147,22 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = DataScale; /***/ }, -/* 56 */ +/* 148 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + var _typeof2 = __webpack_require__(62); + + var _typeof3 = _interopRequireDefault(_typeof2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var util = __webpack_require__(1); - var DOMutil = __webpack_require__(8); - var Bars = __webpack_require__(57); - var Lines = __webpack_require__(59); - var Points = __webpack_require__(58); + var DOMutil = __webpack_require__(90); + var Bars = __webpack_require__(149); + var Lines = __webpack_require__(151); + var Points = __webpack_require__(150); /** * /** @@ -28564,7 +31239,7 @@ return /******/ (function(modules) { // webpackBootstrap util.mergeOptions(this.options, options, 'shaded'); if (options.interpolation) { - if (_typeof(options.interpolation) == 'object') { + if ((0, _typeof3['default'])(options.interpolation) == 'object') { if (options.interpolation.parametrization) { if (options.interpolation.parametrization == 'uniform') { this.options.interpolation.alpha = 0; @@ -28639,13 +31314,13 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = GraphGroup; /***/ }, -/* 57 */ +/* 149 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var DOMutil = __webpack_require__(8); - var Points = __webpack_require__(58); + var DOMutil = __webpack_require__(90); + var Points = __webpack_require__(150); function Bargraph(groupId, options) {} @@ -28900,14 +31575,18 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = Bargraph; /***/ }, -/* 58 */ +/* 150 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + var _typeof2 = __webpack_require__(62); + + var _typeof3 = _interopRequireDefault(_typeof2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - var DOMutil = __webpack_require__(8); + var DOMutil = __webpack_require__(90); function Points(groupId, options) {} @@ -28930,7 +31609,7 @@ return /******/ (function(modules) { // webpackBootstrap DOMutil.drawPoint(dataset[i].screen_x + offset, dataset[i].screen_y, getGroupTemplate(group), framework.svgElements, framework.svg, dataset[i].label); } else { var callbackResult = callback(dataset[i], group); // result might be true, false or an object - if (callbackResult === true || (typeof callbackResult === 'undefined' ? 'undefined' : _typeof(callbackResult)) === 'object') { + if (callbackResult === true || (typeof callbackResult === 'undefined' ? 'undefined' : (0, _typeof3['default'])(callbackResult)) === 'object') { DOMutil.drawPoint(dataset[i].screen_x + offset, dataset[i].screen_y, getGroupTemplate(group, callbackResult), framework.svgElements, framework.svg, dataset[i].label); } } @@ -28979,12 +31658,12 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = Points; /***/ }, -/* 59 */ +/* 151 */ /***/ function(module, exports, __webpack_require__) { "use strict"; - var DOMutil = __webpack_require__(8); + var DOMutil = __webpack_require__(90); function Line(groupId, options) {} @@ -29268,14 +31947,20 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = Line; /***/ }, -/* 60 */ +/* 152 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; + var _keys = __webpack_require__(58); + + var _keys2 = _interopRequireDefault(_keys); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + var util = __webpack_require__(1); - var DOMutil = __webpack_require__(8); - var Component = __webpack_require__(33); + var DOMutil = __webpack_require__(90); + var Component = __webpack_require__(124); /** * Legend for Graph2d @@ -29390,7 +32075,7 @@ return /******/ (function(modules) { // webpackBootstrap Legend.prototype.redraw = function () { var activeGroups = 0; - var groupArray = Object.keys(this.groups); + var groupArray = (0, _keys2['default'])(this.groups); groupArray.sort(function (a, b) { return a < b ? -1 : 1; }); @@ -29457,7 +32142,7 @@ return /******/ (function(modules) { // webpackBootstrap Legend.prototype.drawLegendIcons = function () { if (this.dom.frame.parentNode) { - var groupArray = Object.keys(this.groups); + var groupArray = (0, _keys2['default'])(this.groups); groupArray.sort(function (a, b) { return a < b ? -1 : 1; }); @@ -29487,7 +32172,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = Legend; /***/ }, -/* 61 */ +/* 153 */ /***/ function(module, exports) { 'use strict'; @@ -29503,7 +32188,7 @@ return /******/ (function(modules) { // webpackBootstrap * __type__ is a required field for all objects and contains the allowed types of all objects */ var string = 'string'; - var boolean = 'boolean'; + var bool = 'boolean'; var number = 'number'; var array = 'array'; var date = 'date'; @@ -29514,53 +32199,53 @@ return /******/ (function(modules) { // webpackBootstrap var allOptions = { configure: { - enabled: { boolean: boolean }, - filter: { boolean: boolean, 'function': 'function' }, + enabled: { 'boolean': bool }, + filter: { 'boolean': bool, 'function': 'function' }, container: { dom: dom }, - __type__: { object: object, boolean: boolean, 'function': 'function' } + __type__: { object: object, 'boolean': bool, 'function': 'function' } }, //globals : yAxisOrientation: { string: ['left', 'right'] }, defaultGroup: { string: string }, - sort: { boolean: boolean }, - sampling: { boolean: boolean }, - stack: { boolean: boolean }, + sort: { 'boolean': bool }, + sampling: { 'boolean': bool }, + stack: { 'boolean': bool }, graphHeight: { string: string, number: number }, shaded: { - enabled: { boolean: boolean }, + enabled: { 'boolean': bool }, orientation: { string: ['bottom', 'top', 'zero', 'group'] }, // top, bottom, zero, group groupId: { object: object }, - __type__: { boolean: boolean, object: object } + __type__: { 'boolean': bool, object: object } }, style: { string: ['line', 'bar', 'points'] }, // line, bar barChart: { width: { number: number }, minWidth: { number: number }, - sideBySide: { boolean: boolean }, + sideBySide: { 'boolean': bool }, align: { string: ['left', 'center', 'right'] }, __type__: { object: object } }, interpolation: { - enabled: { boolean: boolean }, + enabled: { 'boolean': bool }, parametrization: { string: ['centripetal', 'chordal', 'uniform'] }, // uniform (alpha = 0.0), chordal (alpha = 1.0), centripetal (alpha = 0.5) alpha: { number: number }, - __type__: { object: object, boolean: boolean } + __type__: { object: object, 'boolean': bool } }, drawPoints: { - enabled: { boolean: boolean }, + enabled: { 'boolean': bool }, onRender: { 'function': 'function' }, size: { number: number }, style: { string: ['square', 'circle'] }, // square, circle - __type__: { object: object, boolean: boolean, 'function': 'function' } + __type__: { object: object, 'boolean': bool, 'function': 'function' } }, dataAxis: { - showMinorLabels: { boolean: boolean }, - showMajorLabels: { boolean: boolean }, - icons: { boolean: boolean }, + showMinorLabels: { 'boolean': bool }, + showMajorLabels: { 'boolean': bool }, + icons: { 'boolean': bool }, width: { string: string, number: number }, - visible: { boolean: boolean }, - alignZeros: { boolean: boolean }, + visible: { 'boolean': bool }, + alignZeros: { 'boolean': bool }, left: { range: { min: { number: number }, max: { number: number }, __type__: { object: object } }, format: { 'function': 'function' }, @@ -29576,27 +32261,28 @@ return /******/ (function(modules) { // webpackBootstrap __type__: { object: object } }, legend: { - enabled: { boolean: boolean }, - icons: { boolean: boolean }, + enabled: { 'boolean': bool }, + icons: { 'boolean': bool }, left: { - visible: { boolean: boolean }, + visible: { 'boolean': bool }, position: { string: ['top-right', 'bottom-right', 'top-left', 'bottom-left'] }, __type__: { object: object } }, right: { - visible: { boolean: boolean }, + visible: { 'boolean': bool }, position: { string: ['top-right', 'bottom-right', 'top-left', 'bottom-left'] }, __type__: { object: object } }, - __type__: { object: object, boolean: boolean } + __type__: { object: object, 'boolean': bool } }, groups: { visibility: { any: any }, __type__: { object: object } }, - autoResize: { boolean: boolean }, - clickToUse: { boolean: boolean }, + autoResize: { 'boolean': bool }, + throttleRedraw: { number: number }, // TODO: DEPRICATED see https://github.com/almende/vis/issues/2511 + clickToUse: { 'boolean': bool }, end: { number: number, date: date, string: string, moment: moment }, format: { minorLabels: { @@ -29641,12 +32327,12 @@ return /******/ (function(modules) { // webpackBootstrap maxMinorChars: { number: number }, min: { date: date, number: number, string: string, moment: moment }, minHeight: { number: number, string: string }, - moveable: { boolean: boolean }, - multiselect: { boolean: boolean }, + moveable: { 'boolean': bool }, + multiselect: { 'boolean': bool }, orientation: { string: string }, - showCurrentTime: { boolean: boolean }, - showMajorLabels: { boolean: boolean }, - showMinorLabels: { boolean: boolean }, + showCurrentTime: { 'boolean': bool }, + showMajorLabels: { 'boolean': bool }, + showMinorLabels: { 'boolean': bool }, start: { date: date, number: number, string: string, moment: moment }, timeAxis: { scale: { string: string, 'undefined': 'undefined' }, @@ -29654,7 +32340,7 @@ return /******/ (function(modules) { // webpackBootstrap __type__: { object: object } }, width: { string: string, number: number }, - zoomable: { boolean: boolean }, + zoomable: { 'boolean': bool }, zoomKey: { string: ['ctrlKey', 'altKey', 'metaKey', ''] }, zoomMax: { number: number }, zoomMin: { number: number }, @@ -29771,27 +32457,27 @@ return /******/ (function(modules) { // webpackBootstrap exports.configureOptions = configureOptions; /***/ }, -/* 62 */ +/* 154 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; // utils exports.util = __webpack_require__(1); - exports.DOMutil = __webpack_require__(8); + exports.DOMutil = __webpack_require__(90); // data - exports.DataSet = __webpack_require__(9); - exports.DataView = __webpack_require__(11); - exports.Queue = __webpack_require__(10); + exports.DataSet = __webpack_require__(91); + exports.DataView = __webpack_require__(93); + exports.Queue = __webpack_require__(92); // Network - exports.Network = __webpack_require__(63); + exports.Network = __webpack_require__(155); exports.network = { - Images: __webpack_require__(64), - dotparser: __webpack_require__(120), - gephiParser: __webpack_require__(121), - allOptions: __webpack_require__(116) + Images: __webpack_require__(156), + dotparser: __webpack_require__(224), + gephiParser: __webpack_require__(225), + allOptions: __webpack_require__(220) }; exports.network.convertDot = function (input) { return exports.network.dotparser.DOTToGraph(input); @@ -29801,95 +32487,95 @@ return /******/ (function(modules) { // webpackBootstrap }; // bundled external libraries - exports.moment = __webpack_require__(2); - exports.Hammer = __webpack_require__(22); - exports.keycharm = __webpack_require__(25); + exports.moment = __webpack_require__(84); + exports.Hammer = __webpack_require__(108); + exports.keycharm = __webpack_require__(111); /***/ }, -/* 63 */ +/* 155 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var _Images = __webpack_require__(64); + var _Images = __webpack_require__(156); var _Images2 = _interopRequireDefault(_Images); - var _Groups = __webpack_require__(65); + var _Groups = __webpack_require__(157); var _Groups2 = _interopRequireDefault(_Groups); - var _NodesHandler = __webpack_require__(66); + var _NodesHandler = __webpack_require__(158); var _NodesHandler2 = _interopRequireDefault(_NodesHandler); - var _EdgesHandler = __webpack_require__(86); + var _EdgesHandler = __webpack_require__(191); var _EdgesHandler2 = _interopRequireDefault(_EdgesHandler); - var _PhysicsEngine = __webpack_require__(95); + var _PhysicsEngine = __webpack_require__(200); var _PhysicsEngine2 = _interopRequireDefault(_PhysicsEngine); - var _Clustering = __webpack_require__(104); + var _Clustering = __webpack_require__(209); var _Clustering2 = _interopRequireDefault(_Clustering); - var _CanvasRenderer = __webpack_require__(107); + var _CanvasRenderer = __webpack_require__(212); var _CanvasRenderer2 = _interopRequireDefault(_CanvasRenderer); - var _Canvas = __webpack_require__(108); + var _Canvas = __webpack_require__(213); var _Canvas2 = _interopRequireDefault(_Canvas); - var _View = __webpack_require__(109); + var _View = __webpack_require__(214); var _View2 = _interopRequireDefault(_View); - var _InteractionHandler = __webpack_require__(110); + var _InteractionHandler = __webpack_require__(215); var _InteractionHandler2 = _interopRequireDefault(_InteractionHandler); - var _SelectionHandler = __webpack_require__(113); + var _SelectionHandler = __webpack_require__(217); var _SelectionHandler2 = _interopRequireDefault(_SelectionHandler); - var _LayoutEngine = __webpack_require__(114); + var _LayoutEngine = __webpack_require__(218); var _LayoutEngine2 = _interopRequireDefault(_LayoutEngine); - var _ManipulationSystem = __webpack_require__(115); + var _ManipulationSystem = __webpack_require__(219); var _ManipulationSystem2 = _interopRequireDefault(_ManipulationSystem); - var _Configurator = __webpack_require__(28); + var _Configurator = __webpack_require__(114); var _Configurator2 = _interopRequireDefault(_Configurator); - var _Validator = __webpack_require__(31); + var _Validator = __webpack_require__(122); var _Validator2 = _interopRequireDefault(_Validator); - var _options = __webpack_require__(116); + var _options = __webpack_require__(220); - var _KamadaKawai = __webpack_require__(117); + var _KamadaKawai = __webpack_require__(221); var _KamadaKawai2 = _interopRequireDefault(_KamadaKawai); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } // Load custom shapes into CanvasRenderingContext2D - __webpack_require__(119); + __webpack_require__(223); - var Emitter = __webpack_require__(13); + var Emitter = __webpack_require__(95); var util = __webpack_require__(1); - var DataSet = __webpack_require__(9); - var DataView = __webpack_require__(11); - var dotparser = __webpack_require__(120); - var gephiParser = __webpack_require__(121); - var Activator = __webpack_require__(47); - var locales = __webpack_require__(122); + var DataSet = __webpack_require__(91); + var DataView = __webpack_require__(93); + var dotparser = __webpack_require__(224); + var gephiParser = __webpack_require__(225); + var Activator = __webpack_require__(139); + var locales = __webpack_require__(226); /** * @constructor Network @@ -29965,24 +32651,24 @@ return /******/ (function(modules) { // webpackBootstrap this.bindEventListeners(); // setting up all modules - this.images = new _Images2.default(function () { + this.images = new _Images2['default'](function () { return _this.body.emitter.emit("_requestRedraw"); }); // object with images - this.groups = new _Groups2.default(); // object with groups - this.canvas = new _Canvas2.default(this.body); // DOM handler - this.selectionHandler = new _SelectionHandler2.default(this.body, this.canvas); // Selection handler - this.interactionHandler = new _InteractionHandler2.default(this.body, this.canvas, this.selectionHandler); // Interaction handler handles all the hammer bindings (that are bound by canvas), key - this.view = new _View2.default(this.body, this.canvas); // camera handler, does animations and zooms - this.renderer = new _CanvasRenderer2.default(this.body, this.canvas); // renderer, starts renderloop, has events that modules can hook into - this.physics = new _PhysicsEngine2.default(this.body); // physics engine, does all the simulations - this.layoutEngine = new _LayoutEngine2.default(this.body); // layout engine for inital layout and hierarchical layout - this.clustering = new _Clustering2.default(this.body); // clustering api - this.manipulation = new _ManipulationSystem2.default(this.body, this.canvas, this.selectionHandler); // data manipulation system - - this.nodesHandler = new _NodesHandler2.default(this.body, this.images, this.groups, this.layoutEngine); // Handle adding, deleting and updating of nodes as well as global options - this.edgesHandler = new _EdgesHandler2.default(this.body, this.images, this.groups); // Handle adding, deleting and updating of edges as well as global options - - this.body.modules["kamadaKawai"] = new _KamadaKawai2.default(this.body, 150, 0.05); // Layouting algorithm. + this.groups = new _Groups2['default'](); // object with groups + this.canvas = new _Canvas2['default'](this.body); // DOM handler + this.selectionHandler = new _SelectionHandler2['default'](this.body, this.canvas); // Selection handler + this.interactionHandler = new _InteractionHandler2['default'](this.body, this.canvas, this.selectionHandler); // Interaction handler handles all the hammer bindings (that are bound by canvas), key + this.view = new _View2['default'](this.body, this.canvas); // camera handler, does animations and zooms + this.renderer = new _CanvasRenderer2['default'](this.body, this.canvas); // renderer, starts renderloop, has events that modules can hook into + this.physics = new _PhysicsEngine2['default'](this.body); // physics engine, does all the simulations + this.layoutEngine = new _LayoutEngine2['default'](this.body); // layout engine for inital layout and hierarchical layout + this.clustering = new _Clustering2['default'](this.body); // clustering api + this.manipulation = new _ManipulationSystem2['default'](this.body, this.canvas, this.selectionHandler); // data manipulation system + + this.nodesHandler = new _NodesHandler2['default'](this.body, this.images, this.groups, this.layoutEngine); // Handle adding, deleting and updating of nodes as well as global options + this.edgesHandler = new _EdgesHandler2['default'](this.body, this.images, this.groups); // Handle adding, deleting and updating of edges as well as global options + + this.body.modules["kamadaKawai"] = new _KamadaKawai2['default'](this.body, 150, 0.05); // Layouting algorithm. this.body.modules["clustering"] = this.clustering; // create the DOM elements @@ -30006,7 +32692,7 @@ return /******/ (function(modules) { // webpackBootstrap var _this2 = this; if (options !== undefined) { - var errorFound = _Validator2.default.validate(options, _options.allOptions); + var errorFound = _Validator2['default'].validate(options, _options.allOptions); if (errorFound === true) { console.log('%cErrors have been found in the supplied options object.', _Validator.printStyle); } @@ -30041,7 +32727,7 @@ return /******/ (function(modules) { // webpackBootstrap if ('configure' in options) { if (!this.configurator) { - this.configurator = new _Configurator2.default(this, this.body.container, _options.configureOptions, this.canvas.pixelRatio); + this.configurator = new _Configurator2['default'](this, this.body.container, _options.configureOptions, this.canvas.pixelRatio); } this.configurator.setOptions(options.configure); @@ -30441,8 +33127,8 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = Network; /***/ }, -/* 64 */ -/***/ function(module, exports) { +/* 156 */ +/***/ function(module, exports, __webpack_require__) { "use strict"; @@ -30450,9 +33136,15 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _classCallCheck2 = __webpack_require__(115); + + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _createClass3 = _interopRequireDefault(_createClass2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } /** * @class Images @@ -30460,7 +33152,7 @@ return /******/ (function(modules) { // webpackBootstrap */ var Images = function () { function Images(callback) { - _classCallCheck(this, Images); + (0, _classCallCheck3["default"])(this, Images); this.images = {}; this.imageBroken = {}; @@ -30473,7 +33165,7 @@ return /******/ (function(modules) { // webpackBootstrap */ - _createClass(Images, [{ + (0, _createClass3["default"])(Images, [{ key: "_addImageToCache", value: function _addImageToCache(url, imageToCache) { // IE11 fix -- thanks dponch! @@ -30563,14 +33255,13 @@ return /******/ (function(modules) { // webpackBootstrap return img; } }]); - return Images; }(); - exports.default = Images; + exports["default"] = Images; /***/ }, -/* 65 */ +/* 157 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -30579,9 +33270,15 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _classCallCheck2 = __webpack_require__(115); + + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); + + var _createClass3 = _interopRequireDefault(_createClass2); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } var util = __webpack_require__(1); @@ -30592,7 +33289,7 @@ return /******/ (function(modules) { // webpackBootstrap var Groups = function () { function Groups() { - _classCallCheck(this, Groups); + (0, _classCallCheck3["default"])(this, Groups); this.clear(); this.defaultIndex = 0; @@ -30631,7 +33328,7 @@ return /******/ (function(modules) { // webpackBootstrap util.extend(this.options, this.defaultOptions); } - _createClass(Groups, [{ + (0, _createClass3["default"])(Groups, [{ key: "setOptions", value: function setOptions(options) { var optionFields = ['useDefaultGroups']; @@ -30707,14 +33404,13 @@ return /******/ (function(modules) { // webpackBootstrap return style; } }]); - return Groups; }(); - exports.default = Groups; + exports["default"] = Groups; /***/ }, -/* 66 */ +/* 158 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -30723,29 +33419,33 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _classCallCheck2 = __webpack_require__(115); + + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); - var _Node = __webpack_require__(67); + var _createClass3 = _interopRequireDefault(_createClass2); + + var _Node = __webpack_require__(159); var _Node2 = _interopRequireDefault(_Node); - var _Label = __webpack_require__(68); + var _Label = __webpack_require__(160); var _Label2 = _interopRequireDefault(_Label); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var util = __webpack_require__(1); - var DataSet = __webpack_require__(9); - var DataView = __webpack_require__(11); + var DataSet = __webpack_require__(91); + var DataView = __webpack_require__(93); var NodesHandler = function () { function NodesHandler(body, images, groups, layoutEngine) { var _this = this; - _classCallCheck(this, NodesHandler); + (0, _classCallCheck3['default'])(this, NodesHandler); this.body = body; this.images = images; @@ -30795,7 +33495,24 @@ return /******/ (function(modules) { // webpackBootstrap background: 'none', strokeWidth: 0, // px strokeColor: '#ffffff', - align: 'center' + align: 'center', + vadjust: 0, + multi: false, + bold: { + mod: 'bold' + }, + boldital: { + mod: 'bold italic' + }, + ital: { + mod: 'italic' + }, + mono: { + mod: '', + size: 15, // px + face: 'courier new', + vadjust: 2 + } }, group: undefined, hidden: false, @@ -30809,6 +33526,12 @@ return /******/ (function(modules) { // webpackBootstrap label: undefined, labelHighlightBold: true, level: undefined, + margin: { + top: 5, + right: 5, + bottom: 5, + left: 5 + }, mass: 1, physics: true, scaling: { @@ -30856,7 +33579,7 @@ return /******/ (function(modules) { // webpackBootstrap this.bindEventListeners(); } - _createClass(NodesHandler, [{ + (0, _createClass3['default'])(NodesHandler, [{ key: 'bindEventListeners', value: function bindEventListeners() { var _this2 = this; @@ -30878,8 +33601,9 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: 'setOptions', value: function setOptions(options) { + this.nodeOptions = options; if (options !== undefined) { - _Node2.default.parseOptions(this.options, options); + _Node2['default'].parseOptions(this.options, options); // update the shape in all nodes if (options.shape !== undefined) { @@ -30892,7 +33616,7 @@ return /******/ (function(modules) { // webpackBootstrap // update the font in all nodes if (options.font !== undefined) { - _Label2.default.parseOptions(this.options.font, options); + _Label2['default'].parseOptions(this.options.font, options); for (var _nodeId in this.body.nodes) { if (this.body.nodes.hasOwnProperty(_nodeId)) { this.body.nodes[_nodeId].updateLabelModule(); @@ -31060,9 +33784,9 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: 'create', value: function create(properties) { - var constructorClass = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _Node2.default; + var constructorClass = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _Node2['default']; - return new constructorClass(properties, this.body, this.images, this.groups, this.options); + return new constructorClass(properties, this.body, this.images, this.groups, this.options, this.defaultOptions, this.nodeOptions); } }, { key: 'refresh', @@ -31232,14 +33956,13 @@ return /******/ (function(modules) { // webpackBootstrap } } }]); - return NodesHandler; }(); - exports.default = NodesHandler; + exports['default'] = NodesHandler; /***/ }, -/* 67 */ +/* 159 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -31248,75 +33971,83 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _typeof2 = __webpack_require__(62); + + var _typeof3 = _interopRequireDefault(_typeof2); - var _Label = __webpack_require__(68); + var _classCallCheck2 = __webpack_require__(115); + + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); + + var _createClass3 = _interopRequireDefault(_createClass2); + + var _Label = __webpack_require__(160); var _Label2 = _interopRequireDefault(_Label); - var _Box = __webpack_require__(69); + var _Box = __webpack_require__(165); var _Box2 = _interopRequireDefault(_Box); - var _Circle = __webpack_require__(71); + var _Circle = __webpack_require__(176); var _Circle2 = _interopRequireDefault(_Circle); - var _CircularImage = __webpack_require__(73); + var _CircularImage = __webpack_require__(178); var _CircularImage2 = _interopRequireDefault(_CircularImage); - var _Database = __webpack_require__(74); + var _Database = __webpack_require__(179); var _Database2 = _interopRequireDefault(_Database); - var _Diamond = __webpack_require__(75); + var _Diamond = __webpack_require__(180); var _Diamond2 = _interopRequireDefault(_Diamond); - var _Dot = __webpack_require__(77); + var _Dot = __webpack_require__(182); var _Dot2 = _interopRequireDefault(_Dot); - var _Ellipse = __webpack_require__(78); + var _Ellipse = __webpack_require__(183); var _Ellipse2 = _interopRequireDefault(_Ellipse); - var _Icon = __webpack_require__(79); + var _Icon = __webpack_require__(184); var _Icon2 = _interopRequireDefault(_Icon); - var _Image = __webpack_require__(80); + var _Image = __webpack_require__(185); var _Image2 = _interopRequireDefault(_Image); - var _Square = __webpack_require__(81); + var _Square = __webpack_require__(186); var _Square2 = _interopRequireDefault(_Square); - var _Star = __webpack_require__(82); + var _Star = __webpack_require__(187); var _Star2 = _interopRequireDefault(_Star); - var _Text = __webpack_require__(83); + var _Text = __webpack_require__(188); var _Text2 = _interopRequireDefault(_Text); - var _Triangle = __webpack_require__(84); + var _Triangle = __webpack_require__(189); var _Triangle2 = _interopRequireDefault(_Triangle); - var _TriangleDown = __webpack_require__(85); + var _TriangleDown = __webpack_require__(190); var _TriangleDown2 = _interopRequireDefault(_TriangleDown); - var _Validator = __webpack_require__(31); + var _Validator = __webpack_require__(122); var _Validator2 = _interopRequireDefault(_Validator); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var util = __webpack_require__(1); @@ -31346,11 +34077,13 @@ return /******/ (function(modules) { // webpackBootstrap * */ var Node = function () { - function Node(options, body, imagelist, grouplist, globalOptions) { - _classCallCheck(this, Node); + function Node(options, body, imagelist, grouplist, globalOptions, defaultOptions, nodeOptions) { + (0, _classCallCheck3['default'])(this, Node); this.options = util.bridgeObject(globalOptions); this.globalOptions = globalOptions; + this.defaultOptions = defaultOptions; + this.nodeOptions = nodeOptions; this.body = body; this.edges = []; // all edges connected to this node @@ -31369,7 +34102,7 @@ return /******/ (function(modules) { // webpackBootstrap this.selected = false; this.hover = false; - this.labelModule = new _Label2.default(this.body, this.options, false /* Not edge label */); + this.labelModule = new _Label2['default'](this.body, this.options, false /* Not edge label */); this.setOptions(options); } @@ -31379,7 +34112,7 @@ return /******/ (function(modules) { // webpackBootstrap */ - _createClass(Node, [{ + (0, _createClass3['default'])(Node, [{ key: 'attachEdge', value: function attachEdge(edge) { if (this.edges.indexOf(edge) === -1) { @@ -31457,6 +34190,8 @@ return /******/ (function(modules) { // webpackBootstrap // this transforms all shorthands into fully defined options Node.parseOptions(this.options, options, true, this.globalOptions); + this.choosify(options); + // load the images if (this.options.image !== undefined) { if (this.imagelist) { @@ -31466,8 +34201,9 @@ return /******/ (function(modules) { // webpackBootstrap } } - this.updateLabelModule(); + this.updateLabelModule(options); this.updateShape(currentShape); + this.labelModule.propagateFonts(this.nodeOptions, options, this.defaultOptions); if (options.hidden !== undefined || options.physics !== undefined) { return true; @@ -31484,9 +34220,67 @@ return /******/ (function(modules) { // webpackBootstrap * @param globalOptions */ + }, { + key: 'choosify', + value: function choosify(options) { + this.chooser = true; + + var pile = [options, this.options, this.defaultOptions]; + + var chosen = util.topMost(pile, 'chosen'); + if (typeof chosen === 'boolean') { + this.chooser = chosen; + } else if ((typeof chosen === 'undefined' ? 'undefined' : (0, _typeof3['default'])(chosen)) === 'object') { + var chosenNode = util.topMost(pile, ['chosen', 'node']); + if (typeof chosenNode === 'boolean' || typeof chosenNode === 'function') { + this.chooser = chosenNode; + } + } + } + }, { + key: 'getFormattingValues', + value: function getFormattingValues() { + var values = { + 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 + }; + if (this.selected || this.hover) { + if (this.chooser === true) { + if (this.selected) { + values.borderWidth *= 2; + values.color = this.options.color.highlight.background; + values.borderColor = this.options.color.highlight.border; + values.shadow = this.options.shadow.enabled; + } else if (this.hover) { + values.color = this.options.color.hover.background; + values.borderColor = this.options.color.hover.border; + values.shadow = this.options.shadow.enabled; + } + } else if (typeof this.chooser === 'function') { + this.chooser(values, this.options.id, this.selected, this.hover); + if (values.shadow === false) { + if (values.shadowColor !== this.options.shadow.color || values.shadowSize !== this.options.shadow.size || values.shadowX !== this.options.shadow.x || values.shadowY !== this.options.shadow.y) { + values.shadow = true; + } + } + } + } else { + values.shadow = this.options.shadow.enabled; + } + return values; + } }, { key: 'updateLabelModule', - value: function updateLabelModule() { + value: function updateLabelModule(options) { if (this.options.label === undefined || this.options.label === null) { this.options.label = ''; } @@ -31494,6 +34288,8 @@ return /******/ (function(modules) { // webpackBootstrap if (this.labelModule.baseSize !== undefined) { this.baseFontSize = this.labelModule.baseSize; } + this.labelModule.constrain(this.nodeOptions, options, this.defaultOptions); + this.labelModule.choosify(this.nodeOptions, options, this.defaultOptions); } }, { key: 'updateShape', @@ -31504,49 +34300,49 @@ return /******/ (function(modules) { // webpackBootstrap // choose draw method depending on the shape switch (this.options.shape) { case 'box': - this.shape = new _Box2.default(this.options, this.body, this.labelModule); + this.shape = new _Box2['default'](this.options, this.body, this.labelModule); break; case 'circle': - this.shape = new _Circle2.default(this.options, this.body, this.labelModule); + this.shape = new _Circle2['default'](this.options, this.body, this.labelModule); break; case 'circularImage': - this.shape = new _CircularImage2.default(this.options, this.body, this.labelModule, this.imageObj); + this.shape = new _CircularImage2['default'](this.options, this.body, this.labelModule, this.imageObj); break; case 'database': - this.shape = new _Database2.default(this.options, this.body, this.labelModule); + this.shape = new _Database2['default'](this.options, this.body, this.labelModule); break; case 'diamond': - this.shape = new _Diamond2.default(this.options, this.body, this.labelModule); + this.shape = new _Diamond2['default'](this.options, this.body, this.labelModule); break; case 'dot': - this.shape = new _Dot2.default(this.options, this.body, this.labelModule); + this.shape = new _Dot2['default'](this.options, this.body, this.labelModule); break; case 'ellipse': - this.shape = new _Ellipse2.default(this.options, this.body, this.labelModule); + this.shape = new _Ellipse2['default'](this.options, this.body, this.labelModule); break; case 'icon': - this.shape = new _Icon2.default(this.options, this.body, this.labelModule); + this.shape = new _Icon2['default'](this.options, this.body, this.labelModule); break; case 'image': - this.shape = new _Image2.default(this.options, this.body, this.labelModule, this.imageObj); + this.shape = new _Image2['default'](this.options, this.body, this.labelModule, this.imageObj); break; case 'square': - this.shape = new _Square2.default(this.options, this.body, this.labelModule); + this.shape = new _Square2['default'](this.options, this.body, this.labelModule); break; case 'star': - this.shape = new _Star2.default(this.options, this.body, this.labelModule); + this.shape = new _Star2['default'](this.options, this.body, this.labelModule); break; case 'text': - this.shape = new _Text2.default(this.options, this.body, this.labelModule); + this.shape = new _Text2['default'](this.options, this.body, this.labelModule); break; case 'triangle': - this.shape = new _Triangle2.default(this.options, this.body, this.labelModule); + this.shape = new _Triangle2['default'](this.options, this.body, this.labelModule); break; case 'triangleDown': - this.shape = new _TriangleDown2.default(this.options, this.body, this.labelModule); + this.shape = new _TriangleDown2['default'](this.options, this.body, this.labelModule); break; default: - this.shape = new _Ellipse2.default(this.options, this.body, this.labelModule); + this.shape = new _Ellipse2['default'](this.options, this.body, this.labelModule); break; } } @@ -31680,7 +34476,8 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: 'draw', value: function draw(ctx) { - this.shape.draw(ctx, this.x, this.y, this.selected, this.hover); + var values = this.getFormattingValues(); + this.shape.draw(ctx, this.x, this.y, this.selected, this.hover, values); } /** @@ -31702,7 +34499,8 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: 'resize', value: function resize(ctx) { - this.shape.resize(ctx, this.selected); + var values = this.getFormattingValues(); + this.shape.resize(ctx, this.selected, this.hover, values); } /** @@ -31765,7 +34563,7 @@ return /******/ (function(modules) { // webpackBootstrap // handle the font options if (newOptions.font !== undefined && newOptions.font !== null) { - _Label2.default.parseOptions(parentOptions.font, newOptions); + _Label2['default'].parseOptions(parentOptions.font, newOptions); } else if (allowDeletion === true && newOptions.font === null) { parentOptions.font = util.bridgeObject(globalOptions.font); // set the object back to the global options } @@ -31776,14 +34574,13 @@ return /******/ (function(modules) { // webpackBootstrap } } }]); - return Node; }(); - exports.default = Node; + exports['default'] = Node; /***/ }, -/* 68 */ +/* 160 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -31792,21 +34589,34 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + var _slicedToArray2 = __webpack_require__(161); - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + var _slicedToArray3 = _interopRequireDefault(_slicedToArray2); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _getIterator2 = __webpack_require__(2); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _getIterator3 = _interopRequireDefault(_getIterator2); + + var _typeof2 = __webpack_require__(62); + + var _typeof3 = _interopRequireDefault(_typeof2); + + var _classCallCheck2 = __webpack_require__(115); + + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); + + var _createClass3 = _interopRequireDefault(_createClass2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var util = __webpack_require__(1); var Label = function () { function Label(body, options) { var edgelabel = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - - _classCallCheck(this, Label); + (0, _classCallCheck3['default'])(this, Label); this.body = body; @@ -31818,12 +34628,12 @@ return /******/ (function(modules) { // webpackBootstrap this.isEdgeLabel = edgelabel; } - _createClass(Label, [{ + (0, _createClass3['default'])(Label, [{ key: 'setOptions', value: function setOptions(options) { var allowDeletion = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - this.nodeOptions = options; + this.elementOptions = options; // We want to keep the font options seperated from the node options. // The node options have to mirror the globals when they are not overruled. @@ -31837,7 +34647,7 @@ return /******/ (function(modules) { // webpackBootstrap Label.parseOptions(this.fontOptions, options, allowDeletion); if (typeof options.font === 'string') { this.baseSize = this.fontOptions.size; - } else if (_typeof(options.font) === 'object') { + } else if ((0, _typeof3['default'])(options.font) === 'object') { if (options.font.size !== undefined) { this.baseSize = options.font.size; } @@ -31845,8 +34655,220 @@ return /******/ (function(modules) { // webpackBootstrap } } }, { - key: 'draw', + key: 'constrain', + + + // set the width and height constraints based on 'nearest' value + value: function constrain(elementOptions, options, defaultOptions) { + this.fontOptions.constrainWidth = false; + this.fontOptions.maxWdt = -1; + this.fontOptions.minWdt = -1; + var pile = [options, elementOptions, defaultOptions]; + + var widthConstraint = util.topMost(pile, 'widthConstraint'); + if (typeof widthConstraint === 'number') { + this.fontOptions.maxWdt = Number(widthConstraint); + this.fontOptions.minWdt = Number(widthConstraint); + } else if ((typeof widthConstraint === 'undefined' ? 'undefined' : (0, _typeof3['default'])(widthConstraint)) === 'object') { + var widthConstraintMaximum = util.topMost(pile, ['widthConstraint', 'maximum']); + if (typeof widthConstraintMaximum === 'number') { + this.fontOptions.maxWdt = Number(widthConstraintMaximum); + } + var widthConstraintMinimum = util.topMost(pile, ['widthConstraint', 'minimum']); + if (typeof widthConstraintMinimum === 'number') { + this.fontOptions.minWdt = Number(widthConstraintMinimum); + } + } + + this.fontOptions.constrainHeight = false; + this.fontOptions.minHgt = -1; + this.fontOptions.valign = 'middle'; + + var heightConstraint = util.topMost(pile, 'heightConstraint'); + if (typeof heightConstraint === 'number') { + this.fontOptions.minHgt = Number(heightConstraint); + } else if ((typeof heightConstraint === 'undefined' ? 'undefined' : (0, _typeof3['default'])(heightConstraint)) === 'object') { + var heightConstraintMinimum = util.topMost(pile, ['heightConstraint', 'minimum']); + if (typeof heightConstraintMinimum === 'number') { + this.fontOptions.minHgt = Number(heightConstraintMinimum); + } + var heightConstraintValign = util.topMost(pile, ['heightConstraint', 'valign']); + if (typeof heightConstraintValign === 'string') { + if (heightConstraintValign === 'top' || heightConstraintValign === 'bottom') { + this.fontOptions.valign = heightConstraintValign; + } + } + } + } + + // set the selected functions based on 'nearest' value + + }, { + key: 'choosify', + value: function choosify(elementOptions, options, defaultOptions) { + this.fontOptions.chooser = true; + + var pile = [options, elementOptions, defaultOptions]; + + var chosen = util.topMost(pile, 'chosen'); + if (typeof chosen === 'boolean') { + this.fontOptions.chooser = chosen; + } else if ((typeof chosen === 'undefined' ? 'undefined' : (0, _typeof3['default'])(chosen)) === 'object') { + var chosenLabel = util.topMost(pile, ['chosen', 'label']); + if (typeof chosenLabel === 'boolean' || typeof chosenLabel === 'function') { + this.fontOptions.chooser = chosenLabel; + } + } + } + + // When margins are set in an element, adjust sizes is called to remove them + // from the width/height constraints. This must be done prior to label sizing. + + }, { + key: 'adjustSizes', + value: function adjustSizes(margins) { + var widthBias = margins ? margins.right + margins.left : 0; + if (this.fontOptions.constrainWidth) { + this.fontOptions.maxWdt -= widthBias; + this.fontOptions.minWdt -= widthBias; + } + var heightBias = margins ? margins.top + margins.bottom : 0; + if (this.fontOptions.constrainHeight) { + this.fontOptions.minHgt -= heightBias; + } + } + }, { + key: 'propagateFonts', + value: function propagateFonts(options, groupOptions, defaultOptions) { + if (this.fontOptions.multi) { + var mods = ['bold', 'ital', 'boldital', 'mono']; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = (0, _getIterator3['default'])(mods), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var mod = _step.value; + + var optionsFontMod = void 0; + if (options.font) { + optionsFontMod = options.font[mod]; + } + if (typeof optionsFontMod === 'string') { + var modOptionsArray = optionsFontMod.split(" "); + this.fontOptions[mod].size = modOptionsArray[0].replace("px", ""); + this.fontOptions[mod].face = modOptionsArray[1]; + this.fontOptions[mod].color = modOptionsArray[2]; + this.fontOptions[mod].vadjust = this.fontOptions.vadjust; + this.fontOptions[mod].mod = defaultOptions.font[mod].mod; + } else { + // We need to be crafty about loading the modded fonts. We want as + // much 'natural' versatility as we can get, so a simple global + // change propagates in an expected way, even if not stictly logical. + + // face: We want to capture any direct settings and overrides, but + // fall back to the base font if there aren't any. We make a + // special exception for mono, since we probably don't want to + // sync to a the base font face. + // + // if the mod face is in the node's options, use it + // else if the mod face is in the global options, use it + // else if the face is in the global options, use it + // else use the base font's face. + if (optionsFontMod && optionsFontMod.hasOwnProperty('face')) { + this.fontOptions[mod].face = optionsFontMod.face; + } else if (groupOptions.font && groupOptions.font[mod] && groupOptions.font[mod].hasOwnProperty('face')) { + this.fontOptions[mod].face = groupOptions.font[mod].face; + } else if (mod === 'mono') { + this.fontOptions[mod].face = defaultOptions.font[mod].face; + } else if (groupOptions.font && groupOptions.font.hasOwnProperty('face')) { + this.fontOptions[mod].face = groupOptions.font.face; + } else { + this.fontOptions[mod].face = this.fontOptions.face; + } + + // color: this is handled just like the face. + if (optionsFontMod && optionsFontMod.hasOwnProperty('color')) { + this.fontOptions[mod].color = optionsFontMod.color; + } else if (groupOptions.font && groupOptions.font[mod] && groupOptions.font[mod].hasOwnProperty('color')) { + this.fontOptions[mod].color = groupOptions.font[mod].color; + } else if (groupOptions.font && groupOptions.font.hasOwnProperty('color')) { + this.fontOptions[mod].color = groupOptions.font.color; + } else { + this.fontOptions[mod].color = this.fontOptions.color; + } + + // mod: this is handled just like the face, except we never grab the + // base font's mod. We know they're in the defaultOptions, and unless + // we've been steered away from them, we use the default. + if (optionsFontMod && optionsFontMod.hasOwnProperty('mod')) { + this.fontOptions[mod].mod = optionsFontMod.mod; + } else if (groupOptions.font && groupOptions.font[mod] && groupOptions.font[mod].hasOwnProperty('mod')) { + this.fontOptions[mod].mod = groupOptions.font[mod].mod; + } else if (groupOptions.font && groupOptions.font.hasOwnProperty('mod')) { + this.fontOptions[mod].mod = groupOptions.font.mod; + } else { + this.fontOptions[mod].mod = defaultOptions.font[mod].mod; + } + + // size: It's important that we size up defaults similarly if we're + // using default faces unless overriden. We want to preserve the + // ratios closely - but if faces have changed, all bets are off. + // + // if the mod size is in the node's options, use it + // else if the mod size is in the global options, use it + // else if the mod face is the same as the default and the base face + // is the same as the default, scale the mod size using the same + // ratio + // else if the size is in the global options, use it + // else use the base font's size. + if (optionsFontMod && optionsFontMod.hasOwnProperty('size')) { + this.fontOptions[mod].size = optionsFontMod.size; + } else if (groupOptions.font && groupOptions.font[mod] && groupOptions.font[mod].hasOwnProperty('size')) { + this.fontOptions[mod].size = groupOptions.font[mod].size; + } else if (this.fontOptions[mod].face === defaultOptions.font[mod].face && this.fontOptions.face === defaultOptions.font.face) { + var ratio = this.fontOptions.size / Number(defaultOptions.font.size); + this.fontOptions[mod].size = defaultOptions.font[mod].size * ratio; + } else if (groupOptions.font && groupOptions.font.hasOwnProperty('size')) { + this.fontOptions[mod].size = groupOptions.font.size; + } else { + this.fontOptions[mod].size = this.fontOptions.size; + } + + // vadjust: this is handled just like the size. + if (optionsFontMod && optionsFontMod.hasOwnProperty('vadjust')) { + this.fontOptions[mod].vadjust = optionsFontMod.vadjust; + } else if (groupOptions.font && groupOptions.font[mod] && groupOptions.font[mod].hasOwnProperty('vadjust')) { + this.fontOptions[mod].vadjust = groupOptions.font[mod].vadjust; + } else if (this.fontOptions[mod].face === defaultOptions.font[mod].face && this.fontOptions.face === defaultOptions.font.face) { + var _ratio = this.fontOptions.size / Number(defaultOptions.font.size); + this.fontOptions[mod].vadjust = defaultOptions.font[mod].vadjust * Math.round(_ratio); + } else if (groupOptions.font && groupOptions.font.hasOwnProperty('vadjust')) { + this.fontOptions[mod].vadjust = groupOptions.font.vadjust; + } else { + this.fontOptions[mod].vadjust = this.fontOptions.vadjust; + } + } + this.fontOptions[mod].size = Number(this.fontOptions[mod].size); + this.fontOptions[mod].vadjust = Number(this.fontOptions[mod].vadjust); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator['return']) { + _iterator['return'](); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } + } /** * Main function. This is called from anything that wants to draw a label. @@ -31856,23 +34878,26 @@ return /******/ (function(modules) { // webpackBootstrap * @param selected * @param baseline */ - value: function draw(ctx, x, y, selected) { - var baseline = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'middle'; + + }, { + key: 'draw', + value: function draw(ctx, x, y, selected, hover) { + var baseline = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 'middle'; // if no label, return - if (this.nodeOptions.label === undefined) return; + if (this.elementOptions.label === undefined) return; // check if we have to render the label var viewFontSize = this.fontOptions.size * this.body.view.scale; - if (this.nodeOptions.label && viewFontSize < this.nodeOptions.scaling.label.drawThreshold - 1) return; + if (this.elementOptions.label && viewFontSize < this.elementOptions.scaling.label.drawThreshold - 1) return; // update the size cache if required - this.calculateLabelSize(ctx, selected, x, y, baseline); + this.calculateLabelSize(ctx, selected, hover, x, y, baseline); // create the fontfill background this._drawBackground(ctx); // draw text - this._drawText(ctx, selected, x, y, baseline); + this._drawText(ctx, selected, hover, x, y, baseline); } /** @@ -31920,54 +34945,70 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: '_drawText', - value: function _drawText(ctx, selected, x, y) { - var baseline = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'middle'; + value: function _drawText(ctx, selected, hover, x, y) { + var baseline = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 'middle'; var fontSize = this.fontOptions.size; var viewFontSize = fontSize * this.body.view.scale; // this ensures that there will not be HUGE letters on screen by setting an upper limit on the visible text size (regardless of zoomLevel) - if (viewFontSize >= this.nodeOptions.scaling.label.maxVisible) { - fontSize = Number(this.nodeOptions.scaling.label.maxVisible) / this.body.view.scale; + if (viewFontSize >= this.elementOptions.scaling.label.maxVisible) { + fontSize = Number(this.elementOptions.scaling.label.maxVisible) / this.body.view.scale; } var yLine = this.size.yLine; - var _getColor2 = this._getColor(viewFontSize), - _getColor3 = _slicedToArray(_getColor2, 2), - fontColor = _getColor3[0], - strokeColor = _getColor3[1]; - - // configure context for drawing the text var _setAlignment2 = this._setAlignment(ctx, x, yLine, baseline); - var _setAlignment3 = _slicedToArray(_setAlignment2, 2); + var _setAlignment3 = (0, _slicedToArray3['default'])(_setAlignment2, 2); x = _setAlignment3[0]; yLine = _setAlignment3[1]; - ctx.font = (selected && this.nodeOptions.labelHighlightBold ? 'bold ' : '') + fontSize + "px " + this.fontOptions.face; - ctx.fillStyle = fontColor; - // When the textAlign property is 'left', make label left-justified - if (!this.isEdgeLabel && this.fontOptions.align === 'left') { - ctx.textAlign = this.fontOptions.align; - x = x - 0.5 * this.size.width; // Shift label 1/2-distance to the left - } else { - ctx.textAlign = 'center'; - } - // set the strokeWidth - if (this.fontOptions.strokeWidth > 0) { - ctx.lineWidth = this.fontOptions.strokeWidth; - ctx.strokeStyle = strokeColor; - ctx.lineJoin = 'round'; + + ctx.textAlign = 'left'; + x = x - this.size.width / 2; // Shift label 1/2-distance to the left + if (this.fontOptions.valign && this.size.height > this.size.labelHeight) { + if (this.fontOptions.valign === 'top') { + yLine -= (this.size.height - this.size.labelHeight) / 2; + } + if (this.fontOptions.valign === 'bottom') { + yLine += (this.size.height - this.size.labelHeight) / 2; + } } // draw the text for (var i = 0; i < this.lineCount; i++) { - if (this.fontOptions.strokeWidth > 0) { - ctx.strokeText(this.lines[i], x, yLine); + if (this.lines[i] && this.lines[i].blocks) { + var width = 0; + if (this.isEdgeLabel || this.fontOptions.align === 'center') { + width += (this.size.width - this.lines[i].width) / 2; + } else if (this.fontOptions.align === 'right') { + width += this.size.width - this.lines[i].width; + } + for (var j = 0; j < this.lines[i].blocks.length; j++) { + var block = this.lines[i].blocks[j]; + ctx.font = block.font; + + var _getColor2 = this._getColor(block.color, viewFontSize, block.strokeColor), + _getColor3 = (0, _slicedToArray3['default'])(_getColor2, 2), + fontColor = _getColor3[0], + strokeColor = _getColor3[1]; + + if (block.strokeWidth > 0) { + ctx.lineWidth = block.strokeWidth; + ctx.strokeStyle = strokeColor; + ctx.lineJoin = 'round'; + } + ctx.fillStyle = fontColor; + + if (block.strokeWidth > 0) { + ctx.strokeText(block.text, x + width, yLine + block.vadjust); + } + ctx.fillText(block.text, x + width, yLine + block.vadjust); + width += block.width; + } + yLine += this.lines[i].height; } - ctx.fillText(this.lines[i], x, yLine); - yLine += fontSize; } } }, { @@ -31992,7 +35033,6 @@ return /******/ (function(modules) { // webpackBootstrap } else { ctx.textBaseline = baseline; } - return [x, yLine]; } @@ -32007,11 +35047,11 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: '_getColor', - value: function _getColor(viewFontSize) { - var fontColor = this.fontOptions.color || '#000000'; - var strokeColor = this.fontOptions.strokeColor || '#ffffff'; - if (viewFontSize <= this.nodeOptions.scaling.label.drawThreshold) { - var opacity = Math.max(0, Math.min(1, 1 - (this.nodeOptions.scaling.label.drawThreshold - viewFontSize))); + value: function _getColor(color, viewFontSize, initialStrokeColor) { + var fontColor = color || '#000000'; + var strokeColor = initialStrokeColor || '#ffffff'; + if (viewFontSize <= this.elementOptions.scaling.label.drawThreshold) { + var opacity = Math.max(0, Math.min(1, 1 - (this.elementOptions.scaling.label.drawThreshold - viewFontSize))); fontColor = util.overrideOpacity(fontColor, opacity); strokeColor = util.overrideOpacity(strokeColor, opacity); } @@ -32029,13 +35069,14 @@ return /******/ (function(modules) { // webpackBootstrap key: 'getTextSize', value: function getTextSize(ctx) { var selected = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var hover = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - var size = { - width: this._processLabel(ctx, selected), - height: this.fontOptions.size * this.lineCount, + this._processLabel(ctx, selected, hover); + return { + width: this.size.width, + height: this.size.height, lineCount: this.lineCount }; - return size; } /** @@ -32049,15 +35090,14 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: 'calculateLabelSize', - value: function calculateLabelSize(ctx, selected) { - var x = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; - var y = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; - var baseline = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'middle'; + value: function calculateLabelSize(ctx, selected, hover) { + var x = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; + var y = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0; + var baseline = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 'middle'; if (this.labelDirty === true) { - this.size.width = this._processLabel(ctx, selected); + this._processLabel(ctx, selected, hover); } - this.size.height = this.fontOptions.size * this.lineCount; this.size.left = x - this.size.width * 0.5; this.size.top = y - this.size.height * 0.5; this.size.yLine = y + (1 - this.lineCount) * 0.5 * this.fontOptions.size; @@ -32066,38 +35106,463 @@ return /******/ (function(modules) { // webpackBootstrap this.size.top += 4; // distance from node, required because we use hanging. Hanging has less difference between browsers this.size.yLine += 4; // distance from node } - this.labelDirty = false; } /** - * This calculates the width as well as explodes the label string and calculates the amount of lines. + * normalize the markup system + */ + + }, { + key: 'decodeMarkupSystem', + value: function decodeMarkupSystem(markupSystem) { + var system = 'none'; + if (markupSystem === 'markdown' || markupSystem === 'md') { + system = 'markdown'; + } else if (markupSystem === true || markupSystem === 'html') { + system = 'html'; + } + return system; + } + + /** + * Explodes a piece of text into single-font blocks using a given markup + * @param text + * @param markupSystem + * @returns [{ text, mod }] + */ + + }, { + key: 'splitBlocks', + value: function splitBlocks(text, markupSystem) { + var system = this.decodeMarkupSystem(markupSystem); + if (system === 'none') { + return [{ + text: text, + mod: 'normal' + }]; + } else if (system === 'markdown') { + return this.splitMarkdownBlocks(text); + } else if (system === 'html') { + return this.splitHtmlBlocks(text); + } + } + }, { + key: 'splitMarkdownBlocks', + value: function splitMarkdownBlocks(text) { + var blocks = []; + var s = { + bold: false, + ital: false, + mono: false, + beginable: true, + spacing: false, + position: 0, + buffer: "", + modStack: [] + }; + s.mod = function () { + return this.modStack.length === 0 ? 'normal' : this.modStack[0]; + }; + s.modName = function () { + if (this.modStack.length === 0) return 'normal';else if (this.modStack[0] === 'mono') return 'mono';else { + if (s.bold && s.ital) { + return 'boldital'; + } else if (s.bold) { + return 'bold'; + } else if (s.ital) { + return 'ital'; + } + } + }; + s.emitBlock = function () { + var override = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + + if (this.spacing) { + this.add(" "); + this.spacing = false; + } + if (this.buffer.length > 0) { + blocks.push({ text: this.buffer, mod: this.modName() }); + this.buffer = ""; + } + }; + s.add = function (text) { + if (text === " ") { + s.spacing = true; + } + if (s.spacing) { + this.buffer += " "; + this.spacing = false; + } + if (text != " ") { + this.buffer += text; + } + }; + while (s.position < text.length) { + var ch = text.charAt(s.position); + if (/[ \t]/.test(ch)) { + if (!s.mono) { + s.spacing = true; + } else { + s.add(ch); + } + s.beginable = true; + } else if (/\\/.test(ch)) { + if (s.position < text.length + 1) { + s.position++; + ch = text.charAt(s.position); + if (/ \t/.test(ch)) { + s.spacing = true; + } else { + s.add(ch); + s.beginable = false; + } + } + } else if (!s.mono && !s.bold && (s.beginable || s.spacing) && /\*/.test(ch)) { + s.emitBlock(); + s.bold = true; + s.modStack.unshift("bold"); + } else if (!s.mono && !s.ital && (s.beginable || s.spacing) && /\_/.test(ch)) { + s.emitBlock(); + s.ital = true; + s.modStack.unshift("ital"); + } else if (!s.mono && (s.beginable || s.spacing) && /`/.test(ch)) { + s.emitBlock(); + s.mono = true; + s.modStack.unshift("mono"); + } else if (!s.mono && s.mod() === "bold" && /\*/.test(ch)) { + if (s.position === text.length - 1 || /[.,_` \t\n]/.test(text.charAt(s.position + 1))) { + s.emitBlock(); + s.bold = false; + s.modStack.shift(); + } else { + s.add(ch); + } + } else if (!s.mono && s.mod() === "ital" && /\_/.test(ch)) { + if (s.position === text.length - 1 || /[.,*` \t\n]/.test(text.charAt(s.position + 1))) { + s.emitBlock(); + s.ital = false; + s.modStack.shift(); + } else { + s.add(ch); + } + } else if (s.mono && s.mod() === "mono" && /`/.test(ch)) { + if (s.position === text.length - 1 || /[.,*_ \t\n]/.test(text.charAt(s.position + 1))) { + s.emitBlock(); + s.mono = false; + s.modStack.shift(); + } else { + s.add(ch); + } + } else { + s.add(ch); + s.beginable = false; + } + s.position++; + } + s.emitBlock(); + return blocks; + } + }, { + key: 'splitHtmlBlocks', + value: function splitHtmlBlocks(text) { + var blocks = []; + var s = { + bold: false, + ital: false, + mono: false, + spacing: false, + position: 0, + buffer: "", + modStack: [] + }; + s.mod = function () { + return this.modStack.length === 0 ? 'normal' : this.modStack[0]; + }; + s.modName = function () { + if (this.modStack.length === 0) return 'normal';else if (this.modStack[0] === 'mono') return 'mono';else { + if (s.bold && s.ital) { + return 'boldital'; + } else if (s.bold) { + return 'bold'; + } else if (s.ital) { + return 'ital'; + } + } + }; + s.emitBlock = function () { + var override = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + + if (this.spacing) { + this.add(" "); + this.spacing = false; + } + if (this.buffer.length > 0) { + blocks.push({ text: this.buffer, mod: this.modName() }); + this.buffer = ""; + } + }; + s.add = function (text) { + if (text === " ") { + s.spacing = true; + } + if (s.spacing) { + this.buffer += " "; + this.spacing = false; + } + if (text != " ") { + this.buffer += text; + } + }; + while (s.position < text.length) { + var ch = text.charAt(s.position); + if (/[ \t]/.test(ch)) { + if (!s.mono) { + s.spacing = true; + } else { + s.add(ch); + } + } else if (//.test(text.substr(s.position, 3))) { + s.emitBlock(); + s.bold = true; + s.modStack.unshift("bold"); + s.position += 2; + } else if (!s.mono && !s.ital && //.test(text.substr(s.position, 3))) { + s.emitBlock(); + s.ital = true; + s.modStack.unshift("ital"); + s.position += 2; + } else if (!s.mono && //.test(text.substr(s.position, 6))) { + s.emitBlock(); + s.mono = true; + s.modStack.unshift("mono"); + s.position += 5; + } else if (!s.mono && s.mod() === 'bold' && /<\/b>/.test(text.substr(s.position, 4))) { + s.emitBlock(); + s.bold = false; + s.modStack.shift(); + s.position += 3; + } else if (!s.mono && s.mod() === 'ital' && /<\/i>/.test(text.substr(s.position, 4))) { + s.emitBlock(); + s.ital = false; + s.modStack.shift(); + s.position += 3; + } else if (s.mod() === 'mono' && /<\/code>/.test(text.substr(s.position, 7))) { + s.emitBlock(); + s.mono = false; + s.modStack.shift(); + s.position += 6; + } else { + s.add(ch); + } + } else if (/&/.test(ch)) { + if (/</.test(text.substr(s.position, 4))) { + s.add("<"); + s.position += 3; + } else if (/&/.test(text.substr(s.position, 5))) { + s.add("&"); + s.position += 4; + } else { + s.add("&"); + } + } else { + s.add(ch); + } + s.position++; + } + s.emitBlock(); + return blocks; + } + }, { + key: 'getFormattingValues', + value: function getFormattingValues(ctx, selected, hover, mod) { + var values = { + color: mod === "normal" ? this.fontOptions.color : this.fontOptions[mod].color, + size: mod === "normal" ? this.fontOptions.size : this.fontOptions[mod].size, + face: mod === "normal" ? this.fontOptions.face : this.fontOptions[mod].face, + mod: mod === "normal" ? "" : this.fontOptions[mod].mod, + vadjust: mod === "normal" ? this.fontOptions.vadjust : this.fontOptions[mod].vadjust, + strokeWidth: this.fontOptions.strokeWidth, + strokeColor: this.fontOptions.strokeColor + }; + if (mod === "normal") { + if (selected || hover) { + if (this.fontOptions.chooser === true && this.elementOptions.labelHighlightBold) { + values.mod = 'bold'; + } else if (typeof this.fontOptions.chooser === 'function') { + this.fontOptions.chooser(ctx, values, this.elementOptions.id, selected, hover); + } + } + } else { + if ((selected || hover) && typeof this.fontOptions.chooser === 'function') { + this.fontOptions.chooser(ctx, values, this.elementOptions.id, selected, hover); + } + } + ctx.font = (values.mod + " " + values.size + "px " + values.face).replace(/"/g, ""); + values.font = ctx.font; + values.height = values.size; + return values; + } + }, { + key: 'differentState', + value: function differentState(selected, hover) { + return selected !== this.fontOptions.selectedState && hover !== this.fontOptions.hoverState; + } + + /** + * This explodes the label string into lines and sets the width, height and number of lines. * @param ctx * @param selected - * @returns {number} * @private */ }, { key: '_processLabel', - value: function _processLabel(ctx, selected) { + value: function _processLabel(ctx, selected, hover) { var width = 0; - var lines = ['']; - var lineCount = 0; - if (this.nodeOptions.label !== undefined) { - lines = String(this.nodeOptions.label).split('\n'); - lineCount = lines.length; - ctx.font = (selected && this.nodeOptions.labelHighlightBold ? 'bold ' : '') + this.fontOptions.size + "px " + this.fontOptions.face; - width = ctx.measureText(lines[0]).width; - for (var i = 1; i < lineCount; i++) { - var lineWidth = ctx.measureText(lines[i]).width; - width = lineWidth > width ? lineWidth : width; + var height = 0; + var nlLines = []; + var lines = []; + var k = 0; + lines.add = function (l, text, font, color, width, height, vadjust, mod, strokeWidth, strokeColor) { + if (this.length == l) { + this[l] = { width: 0, height: 0, blocks: [] }; + } + this[l].blocks.push({ text: text, font: font, color: color, width: width, height: height, vadjust: vadjust, mod: mod, strokeWidth: strokeWidth, strokeColor: strokeColor }); + }; + lines.accumulate = function (l, width, height) { + this[l].width += width; + this[l].height = height > this[l].height ? height : this[l].height; + }; + lines.addAndAccumulate = function (l, text, font, color, width, height, vadjust, mod, strokeWidth, strokeColor) { + this.add(l, text, font, color, width, height, vadjust, mod, strokeWidth, strokeColor); + this.accumulate(l, width, height); + }; + if (this.elementOptions.label !== undefined) { + var _nlLines = String(this.elementOptions.label).split('\n'); + var lineCount = _nlLines.length; + if (this.elementOptions.font.multi) { + for (var i = 0; i < lineCount; i++) { + var blocks = this.splitBlocks(_nlLines[i], this.elementOptions.font.multi); + var lineWidth = 0; + var lineHeight = 0; + if (blocks) { + if (blocks.length == 0) { + var values = this.getFormattingValues(ctx, selected, hover, "normal"); + lines.addAndAccumulate(k, "", values.font, values.color, 0, values.size, values.vadjust, "normal", values.strokeWidth, values.strokeColor); + height += lines[k].height; + k++; + continue; + } + for (var j = 0; j < blocks.length; j++) { + if (this.fontOptions.maxWdt > 0) { + var _values = this.getFormattingValues(ctx, selected, hover, blocks[j].mod); + var words = blocks[j].text.split(" "); + var atStart = true; + var text = ""; + var measure = void 0; + var lastMeasure = void 0; + var w = 0; + while (w < words.length) { + var pre = atStart ? "" : " "; + lastMeasure = measure; + measure = ctx.measureText(text + pre + words[w]); + if (lineWidth + measure.width > this.fontOptions.maxWdt) { + lineHeight = _values.height > lineHeight ? _values.height : lineHeight; + lines.add(k, text, _values.font, _values.color, lastMeasure.width, _values.height, _values.vadjust, blocks[j].mod, _values.strokeWidth, _values.strokeColor); + lines.accumulate(k, lastMeasure.width, lineHeight); + text = ""; + atStart = true; + lineWidth = 0; + width = lines[k].width > width ? lines[k].width : width; + height += lines[k].height; + k++; + } else { + text = text + pre + words[w]; + if (w === words.length - 1) { + lineHeight = _values.height > lineHeight ? _values.height : lineHeight; + lineWidth += measure.width; + lines.add(k, text, _values.font, _values.color, measure.width, _values.height, _values.vadjust, blocks[j].mod, _values.strokeWidth, _values.strokeColor); + lines.accumulate(k, measure.width, lineHeight); + if (j === blocks.length - 1) { + width = lines[k].width > width ? lines[k].width : width; + height += lines[k].height; + k++; + } + } + w++; + atStart = false; + } + } + } else { + var _values2 = this.getFormattingValues(ctx, selected, hover, blocks[j].mod); + var _measure = ctx.measureText(blocks[j].text); + lines.addAndAccumulate(k, blocks[j].text, _values2.font, _values2.color, _measure.width, _values2.height, _values2.vadjust, blocks[j].mod, _values2.strokeWidth, _values2.strokeColor); + width = lines[k].width > width ? lines[k].width : width; + if (blocks.length - 1 === j) { + height += lines[k].height; + k++; + } + } + } + } + } + } else { + for (var _i = 0; _i < lineCount; _i++) { + var _values3 = this.getFormattingValues(ctx, selected, hover, "normal"); + if (this.fontOptions.maxWdt > 0) { + var _words = _nlLines[_i].split(" "); + var _text = ""; + var _measure2 = void 0; + var _lastMeasure = void 0; + var _w = 0; + while (_w < _words.length) { + var _pre = _text === "" ? "" : " "; + _lastMeasure = _measure2; + _measure2 = ctx.measureText(_text + _pre + _words[_w]); + if (_measure2.width > this.fontOptions.maxWdt) { + lines.addAndAccumulate(k, _text, _values3.font, _values3.color, _lastMeasure.width, _values3.size, _values3.vadjust, "normal", _values3.strokeWidth, _values3.strokeColor); + width = lines[k].width > width ? lines[k].width : width; + height += lines[k].height; + _text = ""; + k++; + } else { + _text = _text + _pre + _words[_w]; + if (_w === _words.length - 1) { + lines.addAndAccumulate(k, _text, _values3.font, _values3.color, _measure2.width, _values3.size, _values3.vadjust, "normal", _values3.strokeWidth, _values3.strokeColor); + width = lines[k].width > width ? lines[k].width : width; + height += lines[k].height; + k++; + } + _w++; + } + } + } else { + var _text2 = _nlLines[_i]; + var _measure3 = ctx.measureText(_text2); + lines.addAndAccumulate(k, _text2, _values3.font, _values3.color, _measure3.width, _values3.size, _values3.vadjust, "normal", _values3.strokeWidth, _values3.strokeColor); + width = lines[k].width > width ? lines[k].width : width; + height += lines[k].height; + k++; + } + } } } + if (this.fontOptions.minWdt > 0 && width < this.fontOptions.minWdt) { + width = this.fontOptions.minWdt; + } + this.size.labelHeight = height; + if (this.fontOptions.minHgt > 0 && height < this.fontOptions.minHgt) { + height = this.fontOptions.minHgt; + } this.lines = lines; - this.lineCount = lineCount; - - return width; + this.lineCount = lines.length; + this.size.width = width; + this.size.height = height; + this.selectedState = selected; + this.hoverState = hover; } }], [{ key: 'parseOptions', @@ -32109,20 +35574,105 @@ return /******/ (function(modules) { // webpackBootstrap parentOptions.size = newOptionsArray[0].replace("px", ''); parentOptions.face = newOptionsArray[1]; parentOptions.color = newOptionsArray[2]; - } else if (_typeof(newOptions.font) === 'object') { + parentOptions.vadjust = 0; + } else if ((0, _typeof3['default'])(newOptions.font) === 'object') { util.fillIfDefined(parentOptions, newOptions.font, allowDeletion); } parentOptions.size = Number(parentOptions.size); + parentOptions.vadjust = Number(parentOptions.vadjust); } }]); - return Label; }(); - exports.default = Label; + exports['default'] = Label; /***/ }, -/* 69 */ +/* 161 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + exports.__esModule = true; + + var _isIterable2 = __webpack_require__(162); + + var _isIterable3 = _interopRequireDefault(_isIterable2); + + var _getIterator2 = __webpack_require__(2); + + var _getIterator3 = _interopRequireDefault(_getIterator2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + exports.default = function () { + function sliceIterator(arr, i) { + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; + + try { + for (var _i = (0, _getIterator3.default)(arr), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"]) _i["return"](); + } finally { + if (_d) throw _e; + } + } + + return _arr; + } + + return function (arr, i) { + if (Array.isArray(arr)) { + return arr; + } else if ((0, _isIterable3.default)(Object(arr))) { + return sliceIterator(arr, i); + } else { + throw new TypeError("Invalid attempt to destructure non-iterable instance"); + } + }; + }(); + +/***/ }, +/* 162 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = { "default": __webpack_require__(163), __esModule: true }; + +/***/ }, +/* 163 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(4); + __webpack_require__(50); + module.exports = __webpack_require__(164); + +/***/ }, +/* 164 */ +/***/ function(module, exports, __webpack_require__) { + + var classof = __webpack_require__(54) + , ITERATOR = __webpack_require__(47)('iterator') + , Iterators = __webpack_require__(8); + module.exports = __webpack_require__(17).isIterable = function(it){ + var O = Object(it); + return O[ITERATOR] !== undefined + || '@@iterator' in O + || Iterators.hasOwnProperty(classof(O)); + }; + +/***/ }, +/* 165 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -32131,88 +35681,101 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _getPrototypeOf = __webpack_require__(166); - var _NodeBase2 = __webpack_require__(70); + var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - var _NodeBase3 = _interopRequireDefault(_NodeBase2); + var _classCallCheck2 = __webpack_require__(115); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); + + var _createClass3 = _interopRequireDefault(_createClass2); + + var _possibleConstructorReturn2 = __webpack_require__(169); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + var _inherits2 = __webpack_require__(170); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + var _inherits3 = _interopRequireDefault(_inherits2); + + var _NodeBase2 = __webpack_require__(175); + + var _NodeBase3 = _interopRequireDefault(_NodeBase2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var Box = function (_NodeBase) { - _inherits(Box, _NodeBase); + (0, _inherits3['default'])(Box, _NodeBase); function Box(options, body, labelModule) { - _classCallCheck(this, Box); + (0, _classCallCheck3['default'])(this, Box); + + var _this = (0, _possibleConstructorReturn3['default'])(this, (Box.__proto__ || (0, _getPrototypeOf2['default'])(Box)).call(this, options, body, labelModule)); - return _possibleConstructorReturn(this, (Box.__proto__ || Object.getPrototypeOf(Box)).call(this, options, body, labelModule)); + _this._setMargins(labelModule); + return _this; } - _createClass(Box, [{ + (0, _createClass3['default'])(Box, [{ key: 'resize', - value: function resize(ctx, selected) { - if (this.width === undefined) { - var margin = 5; - var textSize = this.labelModule.getTextSize(ctx, selected); - this.width = textSize.width + 2 * margin; - this.height = textSize.height + 2 * margin; - this.radius = 0.5 * this.width; + value: function resize(ctx) { + var selected = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.selected; + var hover = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.hover; + + if (this.width === undefined || this.labelModule.differentState(selected, hover)) { + this.textSize = this.labelModule.getTextSize(ctx, selected, hover); + this.width = this.textSize.width + this.margin.right + this.margin.left; + this.height = this.textSize.height + this.margin.top + this.margin.bottom; + this.radius = this.width / 2; } } }, { key: 'draw', - value: function draw(ctx, x, y, selected, hover) { - this.resize(ctx, selected); + value: function draw(ctx, x, y, selected, hover, values) { + this.resize(ctx, selected, hover); this.left = x - this.width / 2; this.top = y - this.height / 2; - var borderWidth = this.options.borderWidth; - var selectionLineWidth = this.options.borderWidthSelected || 2 * this.options.borderWidth; - - ctx.strokeStyle = selected ? this.options.color.highlight.border : hover ? this.options.color.hover.border : this.options.color.border; - ctx.lineWidth = selected ? selectionLineWidth : borderWidth; + ctx.strokeStyle = values.borderColor; + ctx.lineWidth = values.borderWidth; ctx.lineWidth /= this.body.view.scale; ctx.lineWidth = Math.min(this.width, ctx.lineWidth); - ctx.fillStyle = selected ? this.options.color.highlight.background : hover ? this.options.color.hover.background : this.options.color.background; + ctx.fillStyle = values.color; - var borderRadius = this.options.shapeProperties.borderRadius; // only effective for box - ctx.roundRect(this.left, this.top, this.width, this.height, borderRadius); + ctx.roundRect(this.left, this.top, this.width, this.height, values.borderRadius); // draw shadow if enabled - this.enableShadow(ctx); + this.enableShadow(ctx, values); // draw the background ctx.fill(); // disable shadows for other elements. - this.disableShadow(ctx); + this.disableShadow(ctx, values); //draw dashed border if enabled, save and restore is required for firefox not to crash on unix. ctx.save(); // if borders are zero width, they will be drawn with width 1 by default. This prevents that - if (borderWidth > 0) { - this.enableBorderDashes(ctx); + if (values.borderWidth > 0) { + this.enableBorderDashes(ctx, values); //draw the border ctx.stroke(); //disable dashed border for other elements - this.disableBorderDashes(ctx); + this.disableBorderDashes(ctx, values); } ctx.restore(); - this.updateBoundingBox(x, y, ctx, selected); - this.labelModule.draw(ctx, x, y, selected); + this.updateBoundingBox(x, y, ctx, selected, hover); + this.labelModule.draw(ctx, this.left + this.textSize.width / 2 + this.margin.left, this.top + this.textSize.height / 2 + this.margin.top, selected, hover); } }, { key: 'updateBoundingBox', - value: function updateBoundingBox(x, y, ctx, selected) { - this.resize(ctx, selected); - this.left = x - this.width * 0.5; - this.top = y - this.height * 0.5; + value: function updateBoundingBox(x, y, ctx, selected, hover) { + this.resize(ctx, selected, hover); + this.left = x - this.width / 2; + this.top = y - this.height / 2; var borderRadius = this.options.shapeProperties.borderRadius; // only effective for box this.boundingBox.left = this.left - borderRadius; @@ -32229,29 +35792,176 @@ return /******/ (function(modules) { // webpackBootstrap return Math.min(Math.abs(this.width / 2 / Math.cos(angle)), Math.abs(this.height / 2 / Math.sin(angle))) + borderWidth; } }]); - return Box; - }(_NodeBase3.default); + }(_NodeBase3['default']); - exports.default = Box; + exports['default'] = Box; /***/ }, -/* 70 */ -/***/ function(module, exports) { +/* 166 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = { "default": __webpack_require__(167), __esModule: true }; + +/***/ }, +/* 167 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(168); + module.exports = __webpack_require__(17).Object.getPrototypeOf; + +/***/ }, +/* 168 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.9 Object.getPrototypeOf(O) + var toObject = __webpack_require__(49) + , $getPrototypeOf = __webpack_require__(48); + + __webpack_require__(61)('getPrototypeOf', function(){ + return function getPrototypeOf(it){ + return $getPrototypeOf(toObject(it)); + }; + }); + +/***/ }, +/* 169 */ +/***/ function(module, exports, __webpack_require__) { "use strict"; + exports.__esModule = true; + + var _typeof2 = __webpack_require__(62); + + var _typeof3 = _interopRequireDefault(_typeof2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + exports.default = function (self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self; + }; + +/***/ }, +/* 170 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + exports.__esModule = true; + + var _setPrototypeOf = __webpack_require__(171); + + var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf); + + var _create = __webpack_require__(55); + + var _create2 = _interopRequireDefault(_create); + + var _typeof2 = __webpack_require__(62); + + var _typeof3 = _interopRequireDefault(_typeof2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + exports.default = function (subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass))); + } + + subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass; + }; + +/***/ }, +/* 171 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = { "default": __webpack_require__(172), __esModule: true }; + +/***/ }, +/* 172 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(173); + module.exports = __webpack_require__(17).Object.setPrototypeOf; + +/***/ }, +/* 173 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.3.19 Object.setPrototypeOf(O, proto) + var $export = __webpack_require__(15); + $export($export.S, 'Object', {setPrototypeOf: __webpack_require__(174).set}); + +/***/ }, +/* 174 */ +/***/ function(module, exports, __webpack_require__) { + + // Works with __proto__ only. Old v8 can't work with null proto objects. + /* eslint-disable no-proto */ + var isObject = __webpack_require__(23) + , anObject = __webpack_require__(22); + var check = function(O, proto){ + anObject(O); + if(!isObject(proto) && proto !== null)throw TypeError(proto + ": can't set as prototype!"); + }; + module.exports = { + set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line + function(test, buggy, set){ + try { + set = __webpack_require__(18)(Function.call, __webpack_require__(78).f(Object.prototype, '__proto__').set, 2); + set(test, []); + buggy = !(test instanceof Array); + } catch(e){ buggy = true; } + return function setPrototypeOf(O, proto){ + check(O, proto); + if(buggy)O.__proto__ = proto; + else set(O, proto); + return O; + }; + }({}, false) : undefined), + check: check + }; + +/***/ }, +/* 175 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + Object.defineProperty(exports, "__esModule", { value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _typeof2 = __webpack_require__(62); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _typeof3 = _interopRequireDefault(_typeof2); + + var _classCallCheck2 = __webpack_require__(115); + + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); + + var _createClass3 = _interopRequireDefault(_createClass2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var NodeBase = function () { function NodeBase(options, body, labelModule) { - _classCallCheck(this, NodeBase); + (0, _classCallCheck3['default'])(this, NodeBase); this.body = body; this.labelModule = labelModule; @@ -32261,35 +35971,55 @@ return /******/ (function(modules) { // webpackBootstrap this.height = undefined; this.width = undefined; this.radius = undefined; + this.margin = undefined; this.boundingBox = { top: 0, left: 0, right: 0, bottom: 0 }; } - _createClass(NodeBase, [{ - key: "setOptions", + (0, _createClass3['default'])(NodeBase, [{ + key: 'setOptions', value: function setOptions(options) { this.options = options; } }, { - key: "_distanceToBorder", + key: '_setMargins', + value: function _setMargins(labelModule) { + this.margin = {}; + if (this.options.margin) { + if ((0, _typeof3['default'])(this.options.margin) == 'object') { + 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; + } else { + this.margin.top = this.options.margin; + this.margin.right = this.options.margin; + this.margin.bottom = this.options.margin; + this.margin.left = this.options.margin; + } + } + labelModule.adjustSizes(this.margin); + } + }, { + key: '_distanceToBorder', value: function _distanceToBorder(ctx, angle) { var borderWidth = this.options.borderWidth; this.resize(ctx); return Math.min(Math.abs(this.width / 2 / Math.cos(angle)), Math.abs(this.height / 2 / Math.sin(angle))) + borderWidth; } }, { - key: "enableShadow", - value: function enableShadow(ctx) { - if (this.options.shadow.enabled === true) { - ctx.shadowColor = this.options.shadow.color; - ctx.shadowBlur = this.options.shadow.size; - ctx.shadowOffsetX = this.options.shadow.x; - ctx.shadowOffsetY = this.options.shadow.y; + key: 'enableShadow', + value: function enableShadow(ctx, values) { + if (values.shadow) { + ctx.shadowColor = values.shadowColor; + ctx.shadowBlur = values.shadowSize; + ctx.shadowOffsetX = values.shadowX; + ctx.shadowOffsetY = values.shadowY; } } }, { - key: "disableShadow", - value: function disableShadow(ctx) { - if (this.options.shadow.enabled === true) { + key: 'disableShadow', + value: function disableShadow(ctx, values) { + if (values.shadow) { ctx.shadowColor = 'rgba(0,0,0,0)'; ctx.shadowBlur = 0; ctx.shadowOffsetX = 0; @@ -32297,11 +36027,11 @@ return /******/ (function(modules) { // webpackBootstrap } } }, { - key: "enableBorderDashes", - value: function enableBorderDashes(ctx) { - if (this.options.shapeProperties.borderDashes !== false) { + key: 'enableBorderDashes', + value: function enableBorderDashes(ctx, values) { + if (values.borderDashes !== false) { if (ctx.setLineDash !== undefined) { - var dashes = this.options.shapeProperties.borderDashes; + var dashes = values.borderDashes; if (dashes === true) { dashes = [5, 15]; } @@ -32309,30 +36039,31 @@ return /******/ (function(modules) { // webpackBootstrap } else { console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."); this.options.shapeProperties.borderDashes = false; + values.borderDashes = false; } } } }, { - key: "disableBorderDashes", - value: function disableBorderDashes(ctx) { - if (this.options.shapeProperties.borderDashes !== false) { + key: 'disableBorderDashes', + value: function disableBorderDashes(ctx, values) { + if (values.borderDashes !== false) { if (ctx.setLineDash !== undefined) { ctx.setLineDash([0]); } else { console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."); this.options.shapeProperties.borderDashes = false; + values.borderDashes = false; } } } }]); - return NodeBase; }(); - exports.default = NodeBase; + exports['default'] = NodeBase; /***/ }, -/* 71 */ +/* 176 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -32341,59 +36072,77 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _getPrototypeOf = __webpack_require__(166); - var _CircleImageBase2 = __webpack_require__(72); + var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - var _CircleImageBase3 = _interopRequireDefault(_CircleImageBase2); + var _classCallCheck2 = __webpack_require__(115); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _createClass3 = _interopRequireDefault(_createClass2); - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + var _possibleConstructorReturn2 = __webpack_require__(169); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); + + var _inherits2 = __webpack_require__(170); + + var _inherits3 = _interopRequireDefault(_inherits2); + + var _CircleImageBase2 = __webpack_require__(177); + + var _CircleImageBase3 = _interopRequireDefault(_CircleImageBase2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var Circle = function (_CircleImageBase) { - _inherits(Circle, _CircleImageBase); + (0, _inherits3['default'])(Circle, _CircleImageBase); function Circle(options, body, labelModule) { - _classCallCheck(this, Circle); + (0, _classCallCheck3['default'])(this, Circle); + + var _this = (0, _possibleConstructorReturn3['default'])(this, (Circle.__proto__ || (0, _getPrototypeOf2['default'])(Circle)).call(this, options, body, labelModule)); - return _possibleConstructorReturn(this, (Circle.__proto__ || Object.getPrototypeOf(Circle)).call(this, options, body, labelModule)); + _this._setMargins(labelModule); + return _this; } - _createClass(Circle, [{ + (0, _createClass3['default'])(Circle, [{ key: 'resize', - value: function resize(ctx, selected) { - if (this.width === undefined) { - var margin = 5; - var textSize = this.labelModule.getTextSize(ctx, selected); - var diameter = Math.max(textSize.width, textSize.height) + 2 * margin; + value: function resize(ctx) { + var selected = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.selected; + var hover = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.hover; + var values = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : { size: this.options.size }; + + if (this.width === undefined || this.labelModule.differentState(selected, hover)) { + this.textSize = this.labelModule.getTextSize(ctx, selected, hover); + var diameter = Math.max(this.textSize.width + this.margin.right + this.margin.left, this.textSize.height + this.margin.top + this.margin.bottom); this.options.size = diameter / 2; this.width = diameter; this.height = diameter; - this.radius = 0.5 * this.width; + this.radius = this.width / 2; } } }, { key: 'draw', - value: function draw(ctx, x, y, selected, hover) { - this.resize(ctx, selected); + value: function draw(ctx, x, y, selected, hover, values) { + this.resize(ctx, selected, hover); this.left = x - this.width / 2; this.top = y - this.height / 2; - this._drawRawCircle(ctx, x, y, selected, hover, this.options.size); + this._drawRawCircle(ctx, x, y, selected, hover, values); - this.boundingBox.top = y - this.options.size; - this.boundingBox.left = x - this.options.size; - this.boundingBox.right = x + this.options.size; - this.boundingBox.bottom = y + this.options.size; + this.boundingBox.top = y - values.size; + this.boundingBox.left = x - values.size; + this.boundingBox.right = x + values.size; + this.boundingBox.bottom = y + values.size; this.updateBoundingBox(x, y); - this.labelModule.draw(ctx, x, y, selected); + this.labelModule.draw(ctx, this.left + this.textSize.width / 2 + this.margin.left, this.top + this.textSize.height / 2 + this.margin.top, selected, hover); } }, { key: 'updateBoundingBox', @@ -32410,14 +36159,13 @@ return /******/ (function(modules) { // webpackBootstrap return this.width * 0.5; } }]); - return Circle; - }(_CircleImageBase3.default); + }(_CircleImageBase3['default']); - exports.default = Circle; + exports['default'] = Circle; /***/ }, -/* 72 */ +/* 177 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -32426,34 +36174,46 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _getPrototypeOf = __webpack_require__(166); - var _NodeBase2 = __webpack_require__(70); + var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - var _NodeBase3 = _interopRequireDefault(_NodeBase2); + var _classCallCheck2 = __webpack_require__(115); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _createClass2 = __webpack_require__(116); - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + var _createClass3 = _interopRequireDefault(_createClass2); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + var _possibleConstructorReturn2 = __webpack_require__(169); + + var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); + + var _inherits2 = __webpack_require__(170); + + var _inherits3 = _interopRequireDefault(_inherits2); + + var _NodeBase2 = __webpack_require__(175); + + var _NodeBase3 = _interopRequireDefault(_NodeBase2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var CircleImageBase = function (_NodeBase) { - _inherits(CircleImageBase, _NodeBase); + (0, _inherits3['default'])(CircleImageBase, _NodeBase); function CircleImageBase(options, body, labelModule) { - _classCallCheck(this, CircleImageBase); + (0, _classCallCheck3['default'])(this, CircleImageBase); - var _this = _possibleConstructorReturn(this, (CircleImageBase.__proto__ || Object.getPrototypeOf(CircleImageBase)).call(this, options, body, labelModule)); + var _this = (0, _possibleConstructorReturn3['default'])(this, (CircleImageBase.__proto__ || (0, _getPrototypeOf2['default'])(CircleImageBase)).call(this, options, body, labelModule)); _this.labelOffset = 0; _this.imageLoaded = false; return _this; } - _createClass(CircleImageBase, [{ + (0, _createClass3['default'])(CircleImageBase, [{ key: 'setOptions', value: function setOptions(options, imageObj) { this.options = options; @@ -32516,44 +36276,42 @@ return /******/ (function(modules) { // webpackBootstrap } }, { key: '_drawRawCircle', - value: function _drawRawCircle(ctx, x, y, selected, hover, size) { - var neutralborderWidth = this.options.borderWidth; - var selectionLineWidth = this.options.borderWidthSelected || 2 * this.options.borderWidth; - var borderWidth = (selected ? selectionLineWidth : neutralborderWidth) / this.body.view.scale; + value: function _drawRawCircle(ctx, x, y, selected, hover, values) { + var borderWidth = values.borderWidth / this.body.view.scale; ctx.lineWidth = Math.min(this.width, borderWidth); - ctx.strokeStyle = selected ? this.options.color.highlight.border : hover ? this.options.color.hover.border : this.options.color.border; - ctx.fillStyle = selected ? this.options.color.highlight.background : hover ? this.options.color.hover.background : this.options.color.background; - ctx.circle(x, y, size); + ctx.strokeStyle = values.borderColor; + ctx.fillStyle = values.color; + ctx.circle(x, y, values.size); // draw shadow if enabled - this.enableShadow(ctx); + this.enableShadow(ctx, values); // draw the background ctx.fill(); // disable shadows for other elements. - this.disableShadow(ctx); + this.disableShadow(ctx, values); //draw dashed border if enabled, save and restore is required for firefox not to crash on unix. ctx.save(); // if borders are zero width, they will be drawn with width 1 by default. This prevents that if (borderWidth > 0) { - this.enableBorderDashes(ctx); + this.enableBorderDashes(ctx, values); //draw the border ctx.stroke(); //disable dashed border for other elements - this.disableBorderDashes(ctx); + this.disableBorderDashes(ctx, values); } ctx.restore(); } }, { key: '_drawImageAtPosition', - value: function _drawImageAtPosition(ctx) { + value: function _drawImageAtPosition(ctx, values) { if (this.imageObj.width != 0) { // draw the image ctx.globalAlpha = 1.0; // draw shadow if enabled - this.enableShadow(ctx); + this.enableShadow(ctx, values); var factor = this.imageObj.width / this.width / this.body.view.scale; if (factor > 2 && this.options.shapeProperties.interpolation === true) { @@ -32586,18 +36344,18 @@ return /******/ (function(modules) { // webpackBootstrap } // disable shadows for other elements. - this.disableShadow(ctx); + this.disableShadow(ctx, values); } } }, { key: '_drawImageLabel', - value: function _drawImageLabel(ctx, x, y, selected) { + value: function _drawImageLabel(ctx, x, y, selected, hover) { var yLabel; var offset = 0; if (this.height !== undefined) { offset = this.height * 0.5; - var labelDimensions = this.labelModule.getTextSize(ctx); + var labelDimensions = this.labelModule.getTextSize(ctx, selected, hover); if (labelDimensions.lineCount >= 1) { offset += labelDimensions.height / 2; } @@ -32608,17 +36366,16 @@ return /******/ (function(modules) { // webpackBootstrap if (this.options.label) { this.labelOffset = offset; } - this.labelModule.draw(ctx, x, yLabel, selected, 'hanging'); + this.labelModule.draw(ctx, x, yLabel, selected, hover, 'hanging'); } }]); - return CircleImageBase; - }(_NodeBase3.default); + }(_NodeBase3['default']); - exports.default = CircleImageBase; + exports['default'] = CircleImageBase; /***/ }, -/* 73 */ +/* 178 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -32627,44 +36384,57 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _getPrototypeOf = __webpack_require__(166); - var _CircleImageBase2 = __webpack_require__(72); + var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - var _CircleImageBase3 = _interopRequireDefault(_CircleImageBase2); + var _classCallCheck2 = __webpack_require__(115); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); + + var _createClass3 = _interopRequireDefault(_createClass2); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _possibleConstructorReturn2 = __webpack_require__(169); - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + var _inherits2 = __webpack_require__(170); + + var _inherits3 = _interopRequireDefault(_inherits2); + + var _CircleImageBase2 = __webpack_require__(177); + + var _CircleImageBase3 = _interopRequireDefault(_CircleImageBase2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var CircularImage = function (_CircleImageBase) { - _inherits(CircularImage, _CircleImageBase); + (0, _inherits3['default'])(CircularImage, _CircleImageBase); function CircularImage(options, body, labelModule, imageObj) { - _classCallCheck(this, CircularImage); + (0, _classCallCheck3['default'])(this, CircularImage); - var _this = _possibleConstructorReturn(this, (CircularImage.__proto__ || Object.getPrototypeOf(CircularImage)).call(this, options, body, labelModule)); + var _this = (0, _possibleConstructorReturn3['default'])(this, (CircularImage.__proto__ || (0, _getPrototypeOf2['default'])(CircularImage)).call(this, options, body, labelModule)); _this.imageObj = imageObj; _this._swapToImageResizeWhenImageLoaded = true; return _this; } - _createClass(CircularImage, [{ + (0, _createClass3['default'])(CircularImage, [{ key: 'resize', - value: function resize() { - if (this.imageObj.src === undefined || this.imageObj.width === undefined || this.imageObj.height === undefined) { - if (!this.width) { - var diameter = this.options.size * 2; - this.width = diameter; - this.height = diameter; - this._swapToImageResizeWhenImageLoaded = true; - this.radius = 0.5 * this.width; - } + value: function resize(ctx) { + var selected = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.selected; + var hover = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.hover; + + if (this.imageObj.src === undefined || this.imageObj.width === undefined || this.imageObj.height === undefined || this.labelModule.differentState(selected, hover)) { + var diameter = this.options.size * 2; + this.width = diameter; + this.height = diameter; + this._swapToImageResizeWhenImageLoaded = true; + this.radius = 0.5 * this.width; } else { if (this._swapToImageResizeWhenImageLoaded) { this.width = undefined; @@ -32676,7 +36446,7 @@ return /******/ (function(modules) { // webpackBootstrap } }, { key: 'draw', - value: function draw(ctx, x, y, selected, hover) { + value: function draw(ctx, x, y, selected, hover, values) { this.resize(); this.left = x - this.width / 2; @@ -32685,18 +36455,18 @@ return /******/ (function(modules) { // webpackBootstrap var size = Math.min(0.5 * this.height, 0.5 * this.width); // draw the background circle. IMPORTANT: the stroke in this method is used by the clip method below. - this._drawRawCircle(ctx, x, y, selected, hover, size); + this._drawRawCircle(ctx, x, y, selected, hover, values); // now we draw in the circle, we save so we can revert the clip operation after drawing. ctx.save(); // clip is used to use the stroke in drawRawCircle as an area that we can draw in. ctx.clip(); // draw the image - this._drawImageAtPosition(ctx); + this._drawImageAtPosition(ctx, values); // restore so we can again draw on the full canvas ctx.restore(); - this._drawImageLabel(ctx, x, y, selected); + this._drawImageLabel(ctx, x, y, selected, hover); this.updateBoundingBox(x, y); } @@ -32718,14 +36488,13 @@ return /******/ (function(modules) { // webpackBootstrap return this.width * 0.5; } }]); - return CircularImage; - }(_CircleImageBase3.default); + }(_CircleImageBase3['default']); - exports.default = CircularImage; + exports['default'] = CircularImage; /***/ }, -/* 74 */ +/* 179 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -32734,84 +36503,96 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _getPrototypeOf = __webpack_require__(166); - var _NodeBase2 = __webpack_require__(70); + var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - var _NodeBase3 = _interopRequireDefault(_NodeBase2); + var _classCallCheck2 = __webpack_require__(115); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _createClass3 = _interopRequireDefault(_createClass2); - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + var _possibleConstructorReturn2 = __webpack_require__(169); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); + + var _inherits2 = __webpack_require__(170); + + var _inherits3 = _interopRequireDefault(_inherits2); + + var _NodeBase2 = __webpack_require__(175); + + var _NodeBase3 = _interopRequireDefault(_NodeBase2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var Database = function (_NodeBase) { - _inherits(Database, _NodeBase); + (0, _inherits3['default'])(Database, _NodeBase); function Database(options, body, labelModule) { - _classCallCheck(this, Database); + (0, _classCallCheck3['default'])(this, Database); + + var _this = (0, _possibleConstructorReturn3['default'])(this, (Database.__proto__ || (0, _getPrototypeOf2['default'])(Database)).call(this, options, body, labelModule)); - return _possibleConstructorReturn(this, (Database.__proto__ || Object.getPrototypeOf(Database)).call(this, options, body, labelModule)); + _this._setMargins(labelModule); + return _this; } - _createClass(Database, [{ + (0, _createClass3['default'])(Database, [{ key: 'resize', - value: function resize(ctx, selected) { - if (this.width === undefined) { - var margin = 5; - var textSize = this.labelModule.getTextSize(ctx, selected); - var size = textSize.width + 2 * margin; + value: function resize(ctx, selected, hover) { + if (this.width === undefined || this.labelModule.differentState(selected, hover)) { + this.textSize = this.labelModule.getTextSize(ctx, selected, hover); + var size = this.textSize.width + this.margin.right + this.margin.left; this.width = size; this.height = size; - this.radius = 0.5 * this.width; + this.radius = this.width / 2; } } }, { key: 'draw', - value: function draw(ctx, x, y, selected, hover) { - this.resize(ctx, selected); + value: function draw(ctx, x, y, selected, hover, values) { + this.resize(ctx, selected, hover); this.left = x - this.width / 2; this.top = y - this.height / 2; - var neutralborderWidth = this.options.borderWidth; - var selectionLineWidth = this.options.borderWidthSelected || 2 * this.options.borderWidth; - var borderWidth = (selected ? selectionLineWidth : neutralborderWidth) / this.body.view.scale; + var borderWidth = values.borderWidth / this.body.view.scale; ctx.lineWidth = Math.min(this.width, borderWidth); - ctx.strokeStyle = selected ? this.options.color.highlight.border : hover ? this.options.color.hover.border : this.options.color.border; + ctx.strokeStyle = values.borderColor; - ctx.fillStyle = selected ? this.options.color.highlight.background : hover ? this.options.color.hover.background : this.options.color.background; - ctx.database(x - this.width / 2, y - this.height * 0.5, this.width, this.height); + ctx.fillStyle = values.color; + ctx.database(x - this.width / 2, y - this.height / 2, this.width, this.height); // draw shadow if enabled - this.enableShadow(ctx); + this.enableShadow(ctx, values); // draw the background ctx.fill(); // disable shadows for other elements. - this.disableShadow(ctx); + this.disableShadow(ctx, values); //draw dashed border if enabled, save and restore is required for firefox not to crash on unix. ctx.save(); // if borders are zero width, they will be drawn with width 1 by default. This prevents that if (borderWidth > 0) { - this.enableBorderDashes(ctx); + this.enableBorderDashes(ctx, values); //draw the border ctx.stroke(); //disable dashed border for other elements - this.disableBorderDashes(ctx); + this.disableBorderDashes(ctx, values); } ctx.restore(); - this.updateBoundingBox(x, y, ctx, selected); - this.labelModule.draw(ctx, x, y, selected); + this.updateBoundingBox(x, y, ctx, selected, hover); + this.labelModule.draw(ctx, this.left + this.textSize.width / 2 + this.margin.left, this.top + this.textSize.height / 2 + this.margin.top, selected, hover); } }, { key: 'updateBoundingBox', - value: function updateBoundingBox(x, y, ctx, selected) { - this.resize(ctx, selected); + value: function updateBoundingBox(x, y, ctx, selected, hover) { + this.resize(ctx, selected, hover); this.left = x - this.width * 0.5; this.top = y - this.height * 0.5; @@ -32827,14 +36608,13 @@ return /******/ (function(modules) { // webpackBootstrap return this._distanceToBorder(ctx, angle); } }]); - return Database; - }(_NodeBase3.default); + }(_NodeBase3['default']); - exports.default = Database; + exports['default'] = Database; /***/ }, -/* 75 */ +/* 180 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -32843,38 +36623,52 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _getPrototypeOf = __webpack_require__(166); - var _ShapeBase2 = __webpack_require__(76); + var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - var _ShapeBase3 = _interopRequireDefault(_ShapeBase2); + var _classCallCheck2 = __webpack_require__(115); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); + + var _createClass3 = _interopRequireDefault(_createClass2); + + var _possibleConstructorReturn2 = __webpack_require__(169); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + var _inherits2 = __webpack_require__(170); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + var _inherits3 = _interopRequireDefault(_inherits2); + + var _ShapeBase2 = __webpack_require__(181); + + var _ShapeBase3 = _interopRequireDefault(_ShapeBase2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var Diamond = function (_ShapeBase) { - _inherits(Diamond, _ShapeBase); + (0, _inherits3['default'])(Diamond, _ShapeBase); function Diamond(options, body, labelModule) { - _classCallCheck(this, Diamond); - - return _possibleConstructorReturn(this, (Diamond.__proto__ || Object.getPrototypeOf(Diamond)).call(this, options, body, labelModule)); + (0, _classCallCheck3['default'])(this, Diamond); + return (0, _possibleConstructorReturn3['default'])(this, (Diamond.__proto__ || (0, _getPrototypeOf2['default'])(Diamond)).call(this, options, body, labelModule)); } - _createClass(Diamond, [{ + (0, _createClass3['default'])(Diamond, [{ key: 'resize', - value: function resize(ctx) { - this._resizeShape(); + value: function resize(ctx, values) { + var selected = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.selected; + var hover = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : this.hover; + + this._resizeShape(selected, hover, values); } }, { key: 'draw', - value: function draw(ctx, x, y, selected, hover) { - this._drawShape(ctx, 'diamond', 4, x, y, selected, hover); + value: function draw(ctx, x, y, selected, hover, values) { + this._drawShape(ctx, 'diamond', 4, x, y, selected, hover, values); } }, { key: 'distanceToBorder', @@ -32882,14 +36676,13 @@ return /******/ (function(modules) { // webpackBootstrap return this._distanceToBorder(ctx, angle); } }]); - return Diamond; - }(_ShapeBase3.default); + }(_ShapeBase3['default']); - exports.default = Diamond; + exports['default'] = Diamond; /***/ }, -/* 76 */ +/* 181 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -32898,34 +36691,49 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _getPrototypeOf = __webpack_require__(166); - var _NodeBase2 = __webpack_require__(70); + var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - var _NodeBase3 = _interopRequireDefault(_NodeBase2); + var _classCallCheck2 = __webpack_require__(115); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); + + var _createClass3 = _interopRequireDefault(_createClass2); + + var _possibleConstructorReturn2 = __webpack_require__(169); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + var _inherits2 = __webpack_require__(170); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + var _inherits3 = _interopRequireDefault(_inherits2); + + var _NodeBase2 = __webpack_require__(175); + + var _NodeBase3 = _interopRequireDefault(_NodeBase2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var ShapeBase = function (_NodeBase) { - _inherits(ShapeBase, _NodeBase); + (0, _inherits3['default'])(ShapeBase, _NodeBase); function ShapeBase(options, body, labelModule) { - _classCallCheck(this, ShapeBase); - - return _possibleConstructorReturn(this, (ShapeBase.__proto__ || Object.getPrototypeOf(ShapeBase)).call(this, options, body, labelModule)); + (0, _classCallCheck3['default'])(this, ShapeBase); + return (0, _possibleConstructorReturn3['default'])(this, (ShapeBase.__proto__ || (0, _getPrototypeOf2['default'])(ShapeBase)).call(this, options, body, labelModule)); } - _createClass(ShapeBase, [{ + (0, _createClass3['default'])(ShapeBase, [{ key: '_resizeShape', value: function _resizeShape() { - if (this.width === undefined) { - var size = 2 * this.options.size; + var selected = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.selected; + var hover = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.hover; + var values = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : { size: this.options.size }; + + if (this.width === undefined || this.labelModule.differentState(selected, hover)) { + var size = 2 * values.size; this.width = size; this.height = size; this.radius = 0.5 * this.width; @@ -32933,43 +36741,41 @@ return /******/ (function(modules) { // webpackBootstrap } }, { key: '_drawShape', - value: function _drawShape(ctx, shape, sizeMultiplier, x, y, selected, hover) { - this._resizeShape(); + value: function _drawShape(ctx, shape, sizeMultiplier, x, y, selected, hover, values) { + this._resizeShape(selected, hover, values); this.left = x - this.width / 2; this.top = y - this.height / 2; - var neutralborderWidth = this.options.borderWidth; - var selectionLineWidth = this.options.borderWidthSelected || 2 * this.options.borderWidth; - var borderWidth = (selected ? selectionLineWidth : neutralborderWidth) / this.body.view.scale; + var borderWidth = values.borderWidth / this.body.view.scale; ctx.lineWidth = Math.min(this.width, borderWidth); - ctx.strokeStyle = selected ? this.options.color.highlight.border : hover ? this.options.color.hover.border : this.options.color.border; - ctx.fillStyle = selected ? this.options.color.highlight.background : hover ? this.options.color.hover.background : this.options.color.background; - ctx[shape](x, y, this.options.size); + ctx.strokeStyle = values.borderColor; + ctx.fillStyle = values.color; + ctx[shape](x, y, values.size); // draw shadow if enabled - this.enableShadow(ctx); + this.enableShadow(ctx, values); // draw the background ctx.fill(); // disable shadows for other elements. - this.disableShadow(ctx); + this.disableShadow(ctx, values); //draw dashed border if enabled, save and restore is required for firefox not to crash on unix. ctx.save(); // if borders are zero width, they will be drawn with width 1 by default. This prevents that if (borderWidth > 0) { - this.enableBorderDashes(ctx); + this.enableBorderDashes(ctx, values); //draw the border ctx.stroke(); //disable dashed border for other elements - this.disableBorderDashes(ctx); + this.disableBorderDashes(ctx, values); } ctx.restore(); if (this.options.label !== undefined) { var yLabel = y + 0.5 * this.height + 3; // the + 3 is to offset it a bit below the node. - this.labelModule.draw(ctx, x, yLabel, selected, 'hanging'); + this.labelModule.draw(ctx, x, yLabel, selected, hover, 'hanging'); } this.updateBoundingBox(x, y); @@ -32989,14 +36795,13 @@ return /******/ (function(modules) { // webpackBootstrap } } }]); - return ShapeBase; - }(_NodeBase3.default); + }(_NodeBase3['default']); - exports.default = ShapeBase; + exports['default'] = ShapeBase; /***/ }, -/* 77 */ +/* 182 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -33005,38 +36810,52 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _getPrototypeOf = __webpack_require__(166); - var _ShapeBase2 = __webpack_require__(76); + var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - var _ShapeBase3 = _interopRequireDefault(_ShapeBase2); + var _classCallCheck2 = __webpack_require__(115); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); + + var _createClass3 = _interopRequireDefault(_createClass2); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _possibleConstructorReturn2 = __webpack_require__(169); - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + var _inherits2 = __webpack_require__(170); + + var _inherits3 = _interopRequireDefault(_inherits2); + + var _ShapeBase2 = __webpack_require__(181); + + var _ShapeBase3 = _interopRequireDefault(_ShapeBase2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var Dot = function (_ShapeBase) { - _inherits(Dot, _ShapeBase); + (0, _inherits3['default'])(Dot, _ShapeBase); function Dot(options, body, labelModule) { - _classCallCheck(this, Dot); - - return _possibleConstructorReturn(this, (Dot.__proto__ || Object.getPrototypeOf(Dot)).call(this, options, body, labelModule)); + (0, _classCallCheck3['default'])(this, Dot); + return (0, _possibleConstructorReturn3['default'])(this, (Dot.__proto__ || (0, _getPrototypeOf2['default'])(Dot)).call(this, options, body, labelModule)); } - _createClass(Dot, [{ + (0, _createClass3['default'])(Dot, [{ key: 'resize', - value: function resize(ctx) { - this._resizeShape(); + value: function resize(ctx, values) { + var selected = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.selected; + var hover = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : this.hover; + + this._resizeShape(selected, hover, values); } }, { key: 'draw', - value: function draw(ctx, x, y, selected, hover) { - this._drawShape(ctx, 'circle', 2, x, y, selected, hover); + value: function draw(ctx, x, y, selected, hover, values) { + this._drawShape(ctx, 'circle', 2, x, y, selected, hover, values); } }, { key: 'distanceToBorder', @@ -33045,14 +36864,13 @@ return /******/ (function(modules) { // webpackBootstrap return this.options.size; } }]); - return Dot; - }(_ShapeBase3.default); + }(_ShapeBase3['default']); - exports.default = Dot; + exports['default'] = Dot; /***/ }, -/* 78 */ +/* 183 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -33061,34 +36879,48 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _getPrototypeOf = __webpack_require__(166); - var _NodeBase2 = __webpack_require__(70); + var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - var _NodeBase3 = _interopRequireDefault(_NodeBase2); + var _classCallCheck2 = __webpack_require__(115); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); + + var _createClass3 = _interopRequireDefault(_createClass2); + + var _possibleConstructorReturn2 = __webpack_require__(169); + + var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); + + var _inherits2 = __webpack_require__(170); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _inherits3 = _interopRequireDefault(_inherits2); - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + var _NodeBase2 = __webpack_require__(175); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + var _NodeBase3 = _interopRequireDefault(_NodeBase2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var Ellipse = function (_NodeBase) { - _inherits(Ellipse, _NodeBase); + (0, _inherits3['default'])(Ellipse, _NodeBase); function Ellipse(options, body, labelModule) { - _classCallCheck(this, Ellipse); - - return _possibleConstructorReturn(this, (Ellipse.__proto__ || Object.getPrototypeOf(Ellipse)).call(this, options, body, labelModule)); + (0, _classCallCheck3['default'])(this, Ellipse); + return (0, _possibleConstructorReturn3['default'])(this, (Ellipse.__proto__ || (0, _getPrototypeOf2['default'])(Ellipse)).call(this, options, body, labelModule)); } - _createClass(Ellipse, [{ + (0, _createClass3['default'])(Ellipse, [{ key: 'resize', - value: function resize(ctx, selected) { - if (this.width === undefined) { - var textSize = this.labelModule.getTextSize(ctx, selected); + value: function resize(ctx) { + var selected = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.selected; + var hover = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.hover; + + if (this.width === undefined || this.labelModule.differentState(selected, hover)) { + var textSize = this.labelModule.getTextSize(ctx, selected, hover); this.height = textSize.height * 2; this.width = textSize.width + this.height; @@ -33097,49 +36929,47 @@ return /******/ (function(modules) { // webpackBootstrap } }, { key: 'draw', - value: function draw(ctx, x, y, selected, hover) { - this.resize(ctx, selected); + value: function draw(ctx, x, y, selected, hover, values) { + this.resize(ctx, selected, hover); this.left = x - this.width * 0.5; this.top = y - this.height * 0.5; - var neutralborderWidth = this.options.borderWidth; - var selectionLineWidth = this.options.borderWidthSelected || 2 * this.options.borderWidth; - var borderWidth = (selected ? selectionLineWidth : neutralborderWidth) / this.body.view.scale; + var borderWidth = values.borderWidth / this.body.view.scale; ctx.lineWidth = Math.min(this.width, borderWidth); - ctx.strokeStyle = selected ? this.options.color.highlight.border : hover ? this.options.color.hover.border : this.options.color.border; + ctx.strokeStyle = values.borderColor; - ctx.fillStyle = selected ? this.options.color.highlight.background : hover ? this.options.color.hover.background : this.options.color.background; + ctx.fillStyle = values.color; ctx.ellipse(this.left, this.top, this.width, this.height); // draw shadow if enabled - this.enableShadow(ctx); + this.enableShadow(ctx, values); // draw the background ctx.fill(); // disable shadows for other elements. - this.disableShadow(ctx); + this.disableShadow(ctx, values); //draw dashed border if enabled, save and restore is required for firefox not to crash on unix. ctx.save(); // if borders are zero width, they will be drawn with width 1 by default. This prevents that if (borderWidth > 0) { - this.enableBorderDashes(ctx); + this.enableBorderDashes(ctx, values); //draw the border ctx.stroke(); //disable dashed border for other elements - this.disableBorderDashes(ctx); + this.disableBorderDashes(ctx, values); } ctx.restore(); - this.updateBoundingBox(x, y, ctx, selected); - this.labelModule.draw(ctx, x, y, selected); + this.updateBoundingBox(x, y, ctx, selected, hover); + this.labelModule.draw(ctx, x, y, selected, hover); } }, { key: 'updateBoundingBox', - value: function updateBoundingBox(x, y, ctx, selected) { - this.resize(ctx, selected); // just in case + value: function updateBoundingBox(x, y, ctx, selected, hover) { + this.resize(ctx, selected, hover); // just in case this.left = x - this.width * 0.5; this.top = y - this.height * 0.5; @@ -33160,14 +36990,13 @@ return /******/ (function(modules) { // webpackBootstrap return a * b / Math.sqrt(w * w + h * h); } }]); - return Ellipse; - }(_NodeBase3.default); + }(_NodeBase3['default']); - exports.default = Ellipse; + exports['default'] = Ellipse; /***/ }, -/* 79 */ +/* 184 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -33176,56 +37005,70 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _getPrototypeOf = __webpack_require__(166); - var _NodeBase2 = __webpack_require__(70); + var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - var _NodeBase3 = _interopRequireDefault(_NodeBase2); + var _classCallCheck2 = __webpack_require__(115); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); + + var _createClass3 = _interopRequireDefault(_createClass2); + + var _possibleConstructorReturn2 = __webpack_require__(169); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + var _inherits2 = __webpack_require__(170); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + var _inherits3 = _interopRequireDefault(_inherits2); + + var _NodeBase2 = __webpack_require__(175); + + var _NodeBase3 = _interopRequireDefault(_NodeBase2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var Icon = function (_NodeBase) { - _inherits(Icon, _NodeBase); + (0, _inherits3['default'])(Icon, _NodeBase); function Icon(options, body, labelModule) { - _classCallCheck(this, Icon); + (0, _classCallCheck3['default'])(this, Icon); - return _possibleConstructorReturn(this, (Icon.__proto__ || Object.getPrototypeOf(Icon)).call(this, options, body, labelModule)); + var _this = (0, _possibleConstructorReturn3['default'])(this, (Icon.__proto__ || (0, _getPrototypeOf2['default'])(Icon)).call(this, options, body, labelModule)); + + _this._setMargins(labelModule); + return _this; } - _createClass(Icon, [{ + (0, _createClass3['default'])(Icon, [{ key: 'resize', - value: function resize(ctx) { - if (this.width === undefined) { - var margin = 5; - var iconSize = { + value: function resize(ctx, selected, hover) { + if (this.width === undefined || this.labelModule.differentState(selected, hover)) { + this.iconSize = { width: Number(this.options.icon.size), height: Number(this.options.icon.size) }; - this.width = iconSize.width + 2 * margin; - this.height = iconSize.height + 2 * margin; + this.width = this.iconSize.width + this.margin.right + this.margin.left; + this.height = this.iconSize.height + this.margin.top + this.margin.bottom; this.radius = 0.5 * this.width; } } }, { key: 'draw', - value: function draw(ctx, x, y, selected, hover) { - this.resize(ctx); + value: function draw(ctx, x, y, selected, hover, values) { + this.resize(ctx, selected, hover); this.options.icon.size = this.options.icon.size || 50; - this.left = x - this.width * 0.5; - this.top = y - this.height * 0.5; - this._icon(ctx, x, y, selected); + this.left = x - this.width / 2; + this.top = y - this.height / 2; + this._icon(ctx, x, y, selected, hover, values); if (this.options.label !== undefined) { var iconTextSpacing = 5; - this.labelModule.draw(ctx, x, y + this.height * 0.5 + iconTextSpacing, selected); + this.labelModule.draw(ctx, this.left + this.iconSize.width / 2 + this.margin.left, y + this.height / 2 + iconTextSpacing, selected); } this.updateBoundingBox(x, y); @@ -33247,7 +37090,7 @@ return /******/ (function(modules) { // webpackBootstrap } }, { key: '_icon', - value: function _icon(ctx, x, y, selected) { + value: function _icon(ctx, x, y, selected, hover, values) { var iconSize = Number(this.options.icon.size); if (this.options.icon.code !== undefined) { @@ -33259,11 +37102,11 @@ return /******/ (function(modules) { // webpackBootstrap ctx.textBaseline = "middle"; // draw shadow if enabled - this.enableShadow(ctx); + this.enableShadow(ctx, values); ctx.fillText(this.options.icon.code, x, y); // disable shadows for other elements. - this.disableShadow(ctx); + this.disableShadow(ctx, values); } else { 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.'); } @@ -33274,14 +37117,13 @@ return /******/ (function(modules) { // webpackBootstrap return this._distanceToBorder(ctx, angle); } }]); - return Icon; - }(_NodeBase3.default); + }(_NodeBase3['default']); - exports.default = Icon; + exports['default'] = Icon; /***/ }, -/* 80 */ +/* 185 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -33290,40 +37132,52 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _getPrototypeOf = __webpack_require__(166); - var _CircleImageBase2 = __webpack_require__(72); + var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - var _CircleImageBase3 = _interopRequireDefault(_CircleImageBase2); + var _classCallCheck2 = __webpack_require__(115); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); + + var _createClass3 = _interopRequireDefault(_createClass2); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _possibleConstructorReturn2 = __webpack_require__(169); - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + var _inherits2 = __webpack_require__(170); + + var _inherits3 = _interopRequireDefault(_inherits2); + + var _CircleImageBase2 = __webpack_require__(177); + + var _CircleImageBase3 = _interopRequireDefault(_CircleImageBase2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var Image = function (_CircleImageBase) { - _inherits(Image, _CircleImageBase); + (0, _inherits3['default'])(Image, _CircleImageBase); function Image(options, body, labelModule, imageObj) { - _classCallCheck(this, Image); + (0, _classCallCheck3['default'])(this, Image); - var _this = _possibleConstructorReturn(this, (Image.__proto__ || Object.getPrototypeOf(Image)).call(this, options, body, labelModule)); + var _this = (0, _possibleConstructorReturn3['default'])(this, (Image.__proto__ || (0, _getPrototypeOf2['default'])(Image)).call(this, options, body, labelModule)); _this.imageObj = imageObj; return _this; } - _createClass(Image, [{ + (0, _createClass3['default'])(Image, [{ key: 'resize', value: function resize() { this._resizeImage(); } }, { key: 'draw', - value: function draw(ctx, x, y, selected, hover) { + value: function draw(ctx, x, y, selected, hover, values) { this.resize(); this.left = x - this.width / 2; this.top = y - this.height / 2; @@ -33361,9 +37215,9 @@ return /******/ (function(modules) { // webpackBootstrap ctx.closePath(); } - this._drawImageAtPosition(ctx); + this._drawImageAtPosition(ctx, values); - this._drawImageLabel(ctx, x, y, selected || hover); + this._drawImageLabel(ctx, x, y, selected, hover); this.updateBoundingBox(x, y); } @@ -33391,14 +37245,13 @@ return /******/ (function(modules) { // webpackBootstrap return this._distanceToBorder(ctx, angle); } }]); - return Image; - }(_CircleImageBase3.default); + }(_CircleImageBase3['default']); - exports.default = Image; + exports['default'] = Image; /***/ }, -/* 81 */ +/* 186 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -33407,38 +37260,49 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _getPrototypeOf = __webpack_require__(166); - var _ShapeBase2 = __webpack_require__(76); + var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - var _ShapeBase3 = _interopRequireDefault(_ShapeBase2); + var _classCallCheck2 = __webpack_require__(115); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _createClass3 = _interopRequireDefault(_createClass2); - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + var _possibleConstructorReturn2 = __webpack_require__(169); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); + + var _inherits2 = __webpack_require__(170); + + var _inherits3 = _interopRequireDefault(_inherits2); + + var _ShapeBase2 = __webpack_require__(181); + + var _ShapeBase3 = _interopRequireDefault(_ShapeBase2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var Square = function (_ShapeBase) { - _inherits(Square, _ShapeBase); + (0, _inherits3['default'])(Square, _ShapeBase); function Square(options, body, labelModule) { - _classCallCheck(this, Square); - - return _possibleConstructorReturn(this, (Square.__proto__ || Object.getPrototypeOf(Square)).call(this, options, body, labelModule)); + (0, _classCallCheck3['default'])(this, Square); + return (0, _possibleConstructorReturn3['default'])(this, (Square.__proto__ || (0, _getPrototypeOf2['default'])(Square)).call(this, options, body, labelModule)); } - _createClass(Square, [{ + (0, _createClass3['default'])(Square, [{ key: 'resize', value: function resize() { this._resizeShape(); } }, { key: 'draw', - value: function draw(ctx, x, y, selected, hover) { - this._drawShape(ctx, 'square', 2, x, y, selected, hover); + value: function draw(ctx, x, y, selected, hover, values) { + this._drawShape(ctx, 'square', 2, x, y, selected, hover, values); } }, { key: 'distanceToBorder', @@ -33446,14 +37310,13 @@ return /******/ (function(modules) { // webpackBootstrap return this._distanceToBorder(ctx, angle); } }]); - return Square; - }(_ShapeBase3.default); + }(_ShapeBase3['default']); - exports.default = Square; + exports['default'] = Square; /***/ }, -/* 82 */ +/* 187 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -33462,38 +37325,49 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _getPrototypeOf = __webpack_require__(166); - var _ShapeBase2 = __webpack_require__(76); + var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - var _ShapeBase3 = _interopRequireDefault(_ShapeBase2); + var _classCallCheck2 = __webpack_require__(115); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _createClass2 = __webpack_require__(116); - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + var _createClass3 = _interopRequireDefault(_createClass2); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + var _possibleConstructorReturn2 = __webpack_require__(169); + + var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); + + var _inherits2 = __webpack_require__(170); + + var _inherits3 = _interopRequireDefault(_inherits2); + + var _ShapeBase2 = __webpack_require__(181); + + var _ShapeBase3 = _interopRequireDefault(_ShapeBase2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var Star = function (_ShapeBase) { - _inherits(Star, _ShapeBase); + (0, _inherits3['default'])(Star, _ShapeBase); function Star(options, body, labelModule) { - _classCallCheck(this, Star); - - return _possibleConstructorReturn(this, (Star.__proto__ || Object.getPrototypeOf(Star)).call(this, options, body, labelModule)); + (0, _classCallCheck3['default'])(this, Star); + return (0, _possibleConstructorReturn3['default'])(this, (Star.__proto__ || (0, _getPrototypeOf2['default'])(Star)).call(this, options, body, labelModule)); } - _createClass(Star, [{ + (0, _createClass3['default'])(Star, [{ key: 'resize', - value: function resize(ctx) { - this._resizeShape(); + value: function resize(ctx, values, selected, hover) { + this._resizeShape(selected, hover, values); } }, { key: 'draw', - value: function draw(ctx, x, y, selected, hover) { - this._drawShape(ctx, 'star', 4, x, y, selected, hover); + value: function draw(ctx, x, y, selected, hover, values) { + this._drawShape(ctx, 'star', 4, x, y, selected, hover, values); } }, { key: 'distanceToBorder', @@ -33501,14 +37375,13 @@ return /******/ (function(modules) { // webpackBootstrap return this._distanceToBorder(ctx, angle); } }]); - return Star; - }(_ShapeBase3.default); + }(_ShapeBase3['default']); - exports.default = Star; + exports['default'] = Star; /***/ }, -/* 83 */ +/* 188 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -33517,60 +37390,74 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _getPrototypeOf = __webpack_require__(166); - var _NodeBase2 = __webpack_require__(70); + var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - var _NodeBase3 = _interopRequireDefault(_NodeBase2); + var _classCallCheck2 = __webpack_require__(115); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); + + var _createClass3 = _interopRequireDefault(_createClass2); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _possibleConstructorReturn2 = __webpack_require__(169); - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + var _inherits2 = __webpack_require__(170); + + var _inherits3 = _interopRequireDefault(_inherits2); + + var _NodeBase2 = __webpack_require__(175); + + var _NodeBase3 = _interopRequireDefault(_NodeBase2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var Text = function (_NodeBase) { - _inherits(Text, _NodeBase); + (0, _inherits3['default'])(Text, _NodeBase); function Text(options, body, labelModule) { - _classCallCheck(this, Text); + (0, _classCallCheck3['default'])(this, Text); - return _possibleConstructorReturn(this, (Text.__proto__ || Object.getPrototypeOf(Text)).call(this, options, body, labelModule)); + var _this = (0, _possibleConstructorReturn3['default'])(this, (Text.__proto__ || (0, _getPrototypeOf2['default'])(Text)).call(this, options, body, labelModule)); + + _this._setMargins(labelModule); + return _this; } - _createClass(Text, [{ + (0, _createClass3['default'])(Text, [{ key: 'resize', - value: function resize(ctx, selected) { - if (this.width === undefined) { - var margin = 5; - var textSize = this.labelModule.getTextSize(ctx, selected); - this.width = textSize.width + 2 * margin; - this.height = textSize.height + 2 * margin; + value: function resize(ctx, selected, hover) { + if (this.width === undefined || this.labelModule.differentState(selected, hover)) { + this.textSize = this.labelModule.getTextSize(ctx, selected, hover); + this.width = this.textSize.width + this.margin.right + this.margin.left; + this.height = this.textSize.height + this.margin.top + this.margin.bottom; this.radius = 0.5 * this.width; } } }, { key: 'draw', - value: function draw(ctx, x, y, selected, hover) { - this.resize(ctx, selected || hover); + value: function draw(ctx, x, y, selected, hover, values) { + this.resize(ctx, selected, hover); this.left = x - this.width / 2; this.top = y - this.height / 2; // draw shadow if enabled - this.enableShadow(ctx); - this.labelModule.draw(ctx, x, y, selected || hover); + this.enableShadow(ctx, values); + this.labelModule.draw(ctx, this.left + this.textSize.width / 2 + this.margin.left, this.top + this.textSize.height / 2 + this.margin.top, selected, hover); // disable shadows for other elements. - this.disableShadow(ctx); + this.disableShadow(ctx, values); - this.updateBoundingBox(x, y, ctx, selected); + this.updateBoundingBox(x, y, ctx, selected, hover); } }, { key: 'updateBoundingBox', - value: function updateBoundingBox(x, y, ctx, selected) { - this.resize(ctx, selected); + value: function updateBoundingBox(x, y, ctx, selected, hover) { + this.resize(ctx, selected, hover); this.left = x - this.width / 2; this.top = y - this.height / 2; @@ -33586,14 +37473,13 @@ return /******/ (function(modules) { // webpackBootstrap return this._distanceToBorder(ctx, angle); } }]); - return Text; - }(_NodeBase3.default); + }(_NodeBase3['default']); - exports.default = Text; + exports['default'] = Text; /***/ }, -/* 84 */ +/* 189 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -33602,38 +37488,49 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _getPrototypeOf = __webpack_require__(166); - var _ShapeBase2 = __webpack_require__(76); + var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - var _ShapeBase3 = _interopRequireDefault(_ShapeBase2); + var _classCallCheck2 = __webpack_require__(115); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _createClass3 = _interopRequireDefault(_createClass2); - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + var _possibleConstructorReturn2 = __webpack_require__(169); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); + + var _inherits2 = __webpack_require__(170); + + var _inherits3 = _interopRequireDefault(_inherits2); + + var _ShapeBase2 = __webpack_require__(181); + + var _ShapeBase3 = _interopRequireDefault(_ShapeBase2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var Triangle = function (_ShapeBase) { - _inherits(Triangle, _ShapeBase); + (0, _inherits3['default'])(Triangle, _ShapeBase); function Triangle(options, body, labelModule) { - _classCallCheck(this, Triangle); - - return _possibleConstructorReturn(this, (Triangle.__proto__ || Object.getPrototypeOf(Triangle)).call(this, options, body, labelModule)); + (0, _classCallCheck3['default'])(this, Triangle); + return (0, _possibleConstructorReturn3['default'])(this, (Triangle.__proto__ || (0, _getPrototypeOf2['default'])(Triangle)).call(this, options, body, labelModule)); } - _createClass(Triangle, [{ + (0, _createClass3['default'])(Triangle, [{ key: 'resize', value: function resize(ctx) { this._resizeShape(); } }, { key: 'draw', - value: function draw(ctx, x, y, selected, hover) { - this._drawShape(ctx, 'triangle', 3, x, y, selected, hover); + value: function draw(ctx, x, y, selected, hover, values) { + this._drawShape(ctx, 'triangle', 3, x, y, selected, hover, values); } }, { key: 'distanceToBorder', @@ -33641,14 +37538,13 @@ return /******/ (function(modules) { // webpackBootstrap return this._distanceToBorder(ctx, angle); } }]); - return Triangle; - }(_ShapeBase3.default); + }(_ShapeBase3['default']); - exports.default = Triangle; + exports['default'] = Triangle; /***/ }, -/* 85 */ +/* 190 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -33657,38 +37553,49 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _getPrototypeOf = __webpack_require__(166); - var _ShapeBase2 = __webpack_require__(76); + var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - var _ShapeBase3 = _interopRequireDefault(_ShapeBase2); + var _classCallCheck2 = __webpack_require__(115); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _createClass2 = __webpack_require__(116); - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + var _createClass3 = _interopRequireDefault(_createClass2); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + var _possibleConstructorReturn2 = __webpack_require__(169); + + var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); + + var _inherits2 = __webpack_require__(170); + + var _inherits3 = _interopRequireDefault(_inherits2); + + var _ShapeBase2 = __webpack_require__(181); + + var _ShapeBase3 = _interopRequireDefault(_ShapeBase2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var TriangleDown = function (_ShapeBase) { - _inherits(TriangleDown, _ShapeBase); + (0, _inherits3['default'])(TriangleDown, _ShapeBase); function TriangleDown(options, body, labelModule) { - _classCallCheck(this, TriangleDown); - - return _possibleConstructorReturn(this, (TriangleDown.__proto__ || Object.getPrototypeOf(TriangleDown)).call(this, options, body, labelModule)); + (0, _classCallCheck3['default'])(this, TriangleDown); + return (0, _possibleConstructorReturn3['default'])(this, (TriangleDown.__proto__ || (0, _getPrototypeOf2['default'])(TriangleDown)).call(this, options, body, labelModule)); } - _createClass(TriangleDown, [{ + (0, _createClass3['default'])(TriangleDown, [{ key: 'resize', value: function resize(ctx) { this._resizeShape(); } }, { key: 'draw', - value: function draw(ctx, x, y, selected, hover) { - this._drawShape(ctx, 'triangleDown', 3, x, y, selected, hover); + value: function draw(ctx, x, y, selected, hover, values) { + this._drawShape(ctx, 'triangleDown', 3, x, y, selected, hover, values); } }, { key: 'distanceToBorder', @@ -33696,14 +37603,13 @@ return /******/ (function(modules) { // webpackBootstrap return this._distanceToBorder(ctx, angle); } }]); - return TriangleDown; - }(_ShapeBase3.default); + }(_ShapeBase3['default']); - exports.default = TriangleDown; + exports['default'] = TriangleDown; /***/ }, -/* 86 */ +/* 191 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -33712,29 +37618,33 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _classCallCheck2 = __webpack_require__(115); + + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); - var _Edge = __webpack_require__(87); + var _createClass3 = _interopRequireDefault(_createClass2); + + var _Edge = __webpack_require__(192); var _Edge2 = _interopRequireDefault(_Edge); - var _Label = __webpack_require__(68); + var _Label = __webpack_require__(160); var _Label2 = _interopRequireDefault(_Label); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var util = __webpack_require__(1); - var DataSet = __webpack_require__(9); - var DataView = __webpack_require__(11); + var DataSet = __webpack_require__(91); + var DataView = __webpack_require__(93); var EdgesHandler = function () { function EdgesHandler(body, images, groups) { var _this = this; - _classCallCheck(this, EdgesHandler); + (0, _classCallCheck3['default'])(this, EdgesHandler); this.body = body; this.images = images; @@ -33778,7 +37688,24 @@ return /******/ (function(modules) { // webpackBootstrap background: 'none', strokeWidth: 2, // px strokeColor: '#ffffff', - align: 'horizontal' + align: 'horizontal', + multi: false, + vadjust: 0, + bold: { + mod: 'bold' + }, + boldital: { + mod: 'bold italic' + }, + ital: { + mod: 'italic' + }, + mono: { + mod: '', + size: 15, // px + face: 'courier new', + vadjust: 2 + } }, hidden: false, hoverWidth: 1.5, @@ -33830,7 +37757,7 @@ return /******/ (function(modules) { // webpackBootstrap this.bindEventListeners(); } - _createClass(EdgesHandler, [{ + (0, _createClass3['default'])(EdgesHandler, [{ key: 'bindEventListeners', value: function bindEventListeners() { var _this2 = this; @@ -33871,7 +37798,6 @@ return /******/ (function(modules) { // webpackBootstrap // this is called when options of EXISTING nodes or edges have changed. this.body.emitter.on("_dataUpdated", function () { _this2.reconnectEdges(); - _this2.markAllEdgesAsDirty(); }); // refresh the edges. Used when reverting from hierarchical layout @@ -33891,14 +37817,10 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: 'setOptions', value: function setOptions(options) { + this.edgeOptions = options; if (options !== undefined) { // use the parser from the Edge class to fill in all shorthand notations - _Edge2.default.parseOptions(this.options, options); - - // handle multiple input cases for color - if (options.color !== undefined) { - this.markAllEdgesAsDirty(); - } + _Edge2['default'].parseOptions(this.options, options); // update smooth settings in all edges var dataChanged = false; @@ -33913,7 +37835,7 @@ return /******/ (function(modules) { // webpackBootstrap // update fonts in all edges if (options.font !== undefined) { // use the parser from the Label class to fill in all shorthand notations - _Label2.default.parseOptions(this.options.font, options); + _Label2['default'].parseOptions(this.options.font, options); for (var _edgeId in this.body.edges) { if (this.body.edges.hasOwnProperty(_edgeId)) { this.body.edges[_edgeId].updateLabelModule(); @@ -34089,14 +38011,7 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: 'create', value: function create(properties) { - return new _Edge2.default(properties, this.body, this.options); - } - }, { - key: 'markAllEdgesAsDirty', - value: function markAllEdgesAsDirty() { - for (var edgeId in this.body.edges) { - this.body.edges[edgeId].edgeType.colorDirty = true; - } + return new _Edge2['default'](properties, this.body, this.options, this.defaultOptions, this.edgeOptions); } /** @@ -34142,14 +38057,13 @@ return /******/ (function(modules) { // webpackBootstrap return nodeList; } }]); - return EdgesHandler; }(); - exports.default = EdgesHandler; + exports['default'] = EdgesHandler; /***/ }, -/* 87 */ +/* 192 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -34158,33 +38072,47 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + var _stringify = __webpack_require__(82); + + var _stringify2 = _interopRequireDefault(_stringify); + + var _create = __webpack_require__(55); + + var _create2 = _interopRequireDefault(_create); + + var _typeof2 = __webpack_require__(62); + + var _typeof3 = _interopRequireDefault(_typeof2); + + var _classCallCheck2 = __webpack_require__(115); + + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _createClass2 = __webpack_require__(116); - var _Label = __webpack_require__(68); + var _createClass3 = _interopRequireDefault(_createClass2); + + var _Label = __webpack_require__(160); var _Label2 = _interopRequireDefault(_Label); - var _CubicBezierEdge = __webpack_require__(88); + var _CubicBezierEdge = __webpack_require__(193); var _CubicBezierEdge2 = _interopRequireDefault(_CubicBezierEdge); - var _BezierEdgeDynamic = __webpack_require__(92); + var _BezierEdgeDynamic = __webpack_require__(197); var _BezierEdgeDynamic2 = _interopRequireDefault(_BezierEdgeDynamic); - var _BezierEdgeStatic = __webpack_require__(93); + var _BezierEdgeStatic = __webpack_require__(198); var _BezierEdgeStatic2 = _interopRequireDefault(_BezierEdgeStatic); - var _StraightEdge = __webpack_require__(94); + var _StraightEdge = __webpack_require__(199); var _StraightEdge2 = _interopRequireDefault(_StraightEdge); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var util = __webpack_require__(1); @@ -34204,14 +38132,16 @@ return /******/ (function(modules) { // webpackBootstrap * example for the color */ var Edge = function () { - function Edge(options, body, globalOptions) { - _classCallCheck(this, Edge); + function Edge(options, body, globalOptions, defaultOptions, edgeOptions) { + (0, _classCallCheck3['default'])(this, Edge); if (body === undefined) { throw "No body provided"; } this.options = util.bridgeObject(globalOptions); this.globalOptions = globalOptions; + this.defaultOptions = defaultOptions; + this.edgeOptions = edgeOptions; this.body = body; // initialize variables @@ -34221,7 +38151,6 @@ return /******/ (function(modules) { // webpackBootstrap this.selected = false; this.hover = false; this.labelDirty = true; - this.colorDirty = true; this.baseWidth = this.options.width; this.baseFontSize = this.options.font.size; @@ -34233,8 +38162,7 @@ return /******/ (function(modules) { // webpackBootstrap this.connected = false; - this.labelModule = new _Label2.default(this.body, this.options, true /* It's an edge label */); - + this.labelModule = new _Label2['default'](this.body, this.options, true /* It's an edge label */); this.setOptions(options); } @@ -34245,13 +38173,12 @@ return /******/ (function(modules) { // webpackBootstrap */ - _createClass(Edge, [{ + (0, _createClass3['default'])(Edge, [{ key: 'setOptions', value: function setOptions(options) { if (!options) { return; } - this.colorDirty = true; Edge.parseOptions(this.options, options, true, this.globalOptions); @@ -34271,8 +38198,11 @@ return /******/ (function(modules) { // webpackBootstrap options.value = parseFloat(options.value); } + this.choosify(options); + // update label Module - this.updateLabelModule(); + this.updateLabelModule(options); + this.labelModule.propagateFonts(this.edgeOptions, options, this.defaultOptions); var dataChanged = this.updateEdgeType(); @@ -34289,17 +38219,107 @@ return /******/ (function(modules) { // webpackBootstrap return dataChanged; } }, { - key: 'updateLabelModule', - + key: 'choosify', + value: function choosify(options) { + this.chooser = true; + + var pile = [options, this.options, this.defaultOptions]; + + var chosen = util.topMost(pile, 'chosen'); + if (typeof chosen === 'boolean') { + this.chooser = chosen; + } else if ((typeof chosen === 'undefined' ? 'undefined' : (0, _typeof3['default'])(chosen)) === 'object') { + var chosenEdge = util.topMost(pile, ['chosen', 'edge']); + if (typeof chosenEdge === 'boolean' || typeof chosenEdge === 'function') { + this.chooser = chosenEdge; + } + } + } + }, { + key: 'getFormattingValues', + value: function getFormattingValues() { + var toArrow = this.options.arrows.to === true || this.options.arrows.to.enabled === true; + var fromArrow = this.options.arrows.from === true || this.options.arrows.from.enabled === true; + var middleArrow = this.options.arrows.middle === true || this.options.arrows.middle.enabled === true; + var inheritsColor = this.options.color.inherit; + var values = { + toArrow: toArrow, + toArrowScale: this.options.arrows.to.scaleFactor, + toArrowType: this.options.arrows.to.type, + middleArrow: middleArrow, + middleArrowScale: this.options.arrows.middle.scaleFactor, + middleArrowType: this.options.arrows.middle.type, + fromArrow: fromArrow, + fromArrowScale: this.options.arrows.from.scaleFactor, + fromArrowType: this.options.arrows.from.type, + arrowStrikethrough: this.options.arrowStrikethrough, + color: inheritsColor ? undefined : this.options.color.color, + inheritsColor: inheritsColor, + opacity: this.options.color.opacity, + hidden: this.options.hidden, + length: this.options.length, + shadow: this.options.shadow.enabled, + shadowColor: this.options.shadow.color, + shadowSize: this.options.shadow.size, + shadowX: this.options.shadow.x, + shadowY: this.options.shadow.y, + dashes: this.options.dashes, + width: this.options.width + }; + if (this.selected || this.hover) { + if (this.chooser === true) { + if (this.selected) { + var selectedWidth = this.options.selectionWidth; + if (typeof selectedWidth === 'function') { + values.width = selectedWidth(values.width); + } else if (typeof selectedWidth === 'number') { + values.width += selectedWidth; + } + values.width = Math.max(values.width, 0.3 / this.body.view.scale); + values.color = this.options.color.highlight; + values.shadow = this.options.shadow.enabled; + } else if (this.hover) { + var hoverWidth = this.options.hoverWidth; + if (typeof hoverWidth === 'function') { + values.width = hoverWidth(values.width); + } else if (typeof hoverWidth === 'number') { + values.width += hoverWidth; + } + values.width = Math.max(values.width, 0.3 / this.body.view.scale); + values.color = this.options.color.hover; + values.shadow = this.options.shadow.enabled; + } + } else if (typeof this.chooser === 'function') { + this.chooser(values, this.options.id, this.selected, this.hover); + if (values.color !== undefined) { + values.inheritsColor = false; + } + if (values.shadow === false) { + if (values.shadowColor !== this.options.shadow.color || values.shadowSize !== this.options.shadow.size || values.shadowX !== this.options.shadow.x || values.shadowY !== this.options.shadow.y) { + values.shadow = true; + } + } + } + } else { + values.shadow = this.options.shadow.enabled; + values.width = Math.max(values.width, 0.3 / this.body.view.scale); + } + return values; + } /** * update the options in the label module */ - value: function updateLabelModule() { + + }, { + key: 'updateLabelModule', + value: function updateLabelModule(options) { this.labelModule.setOptions(this.options, true); if (this.labelModule.baseSize !== undefined) { this.baseFontSize = this.labelModule.baseSize; } + this.labelModule.constrain(this.edgeOptions, options, this.defaultOptions); + this.labelModule.choosify(this.edgeOptions, options, this.defaultOptions); } /** @@ -34310,46 +38330,34 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: 'updateEdgeType', value: function updateEdgeType() { + var smooth = this.options.smooth; var dataChanged = false; var changeInType = true; - var smooth = this.options.smooth; if (this.edgeType !== undefined) { - if (this.edgeType instanceof _BezierEdgeDynamic2.default && smooth.enabled === true && smooth.type === 'dynamic') { + if (this.edgeType instanceof _BezierEdgeDynamic2['default'] && smooth.enabled === true && smooth.type === 'dynamic' || this.edgeType instanceof _CubicBezierEdge2['default'] && smooth.enabled === true && smooth.type === 'cubicBezier' || this.edgeType instanceof _BezierEdgeStatic2['default'] && smooth.enabled === true && smooth.type !== 'dynamic' && smooth.type !== 'cubicBezier' || this.edgeType instanceof _StraightEdge2['default'] && smooth.type.enabled === false) { changeInType = false; } - if (this.edgeType instanceof _CubicBezierEdge2.default && smooth.enabled === true && smooth.type === 'cubicBezier') { - changeInType = false; - } - if (this.edgeType instanceof _BezierEdgeStatic2.default && smooth.enabled === true && smooth.type !== 'dynamic' && smooth.type !== 'cubicBezier') { - changeInType = false; - } - if (this.edgeType instanceof _StraightEdge2.default && smooth.enabled === false) { - changeInType = false; - } - if (changeInType === true) { dataChanged = this.cleanup(); } } - if (changeInType === true) { - if (this.options.smooth.enabled === true) { - if (this.options.smooth.type === 'dynamic') { + if (smooth.enabled === true) { + if (smooth.type === 'dynamic') { dataChanged = true; - this.edgeType = new _BezierEdgeDynamic2.default(this.options, this.body, this.labelModule); - } else if (this.options.smooth.type === 'cubicBezier') { - this.edgeType = new _CubicBezierEdge2.default(this.options, this.body, this.labelModule); + this.edgeType = new _BezierEdgeDynamic2['default'](this.options, this.body, this.labelModule); + } else if (smooth.type === 'cubicBezier') { + this.edgeType = new _CubicBezierEdge2['default'](this.options, this.body, this.labelModule); } else { - this.edgeType = new _BezierEdgeStatic2.default(this.options, this.body, this.labelModule); + this.edgeType = new _BezierEdgeStatic2['default'](this.options, this.body, this.labelModule); } } else { - this.edgeType = new _StraightEdge2.default(this.options, this.body, this.labelModule); + this.edgeType = new _StraightEdge2['default'](this.options, this.body, this.labelModule); } } else { // if nothing changes, we just set the options. this.edgeType.setOptions(this.options); } - return dataChanged; } @@ -34469,7 +38477,6 @@ return /******/ (function(modules) { // webpackBootstrap } else { this.edgeType.hoverWidth = this.options.hoverWidth + this.options.width; } - if (typeof this.options.selectionWidth === 'function') { this.edgeType.selectionWidth = this.options.selectionWidth(this.options.width); } else { @@ -34487,6 +38494,11 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: 'draw', value: function draw(ctx) { + var values = this.getFormattingValues(); + if (values.hidden) { + return; + } + // get the via node from the edge type var viaNode = this.edgeType.getViaNode(); var arrowData = {}; @@ -34496,36 +38508,36 @@ return /******/ (function(modules) { // webpackBootstrap this.edgeType.toPoint = this.edgeType.to; // from and to arrows give a different end point for edges. we set them here - if (this.options.arrows.from.enabled === true) { - arrowData.from = this.edgeType.getArrowData(ctx, 'from', viaNode, this.selected, this.hover); - if (this.options.arrowStrikethrough === false) this.edgeType.fromPoint = arrowData.from.core; + if (values.fromArrow) { + arrowData.from = this.edgeType.getArrowData(ctx, 'from', viaNode, this.selected, this.hover, values); + if (values.arrowStrikethrough === false) this.edgeType.fromPoint = arrowData.from.core; } - if (this.options.arrows.to.enabled === true) { - arrowData.to = this.edgeType.getArrowData(ctx, 'to', viaNode, this.selected, this.hover); - if (this.options.arrowStrikethrough === false) this.edgeType.toPoint = arrowData.to.core; + if (values.toArrow) { + arrowData.to = this.edgeType.getArrowData(ctx, 'to', viaNode, this.selected, this.hover, values); + if (values.arrowStrikethrough === false) this.edgeType.toPoint = arrowData.to.core; } // the middle arrow depends on the line, which can depend on the to and from arrows so we do this one lastly. - if (this.options.arrows.middle.enabled === true) { - arrowData.middle = this.edgeType.getArrowData(ctx, 'middle', viaNode, this.selected, this.hover); + if (values.middleArrow) { + arrowData.middle = this.edgeType.getArrowData(ctx, 'middle', viaNode, this.selected, this.hover, values); } // draw everything - this.edgeType.drawLine(ctx, this.selected, this.hover, viaNode); - this.drawArrows(ctx, arrowData); + this.edgeType.drawLine(ctx, values, this.selected, this.hover, viaNode); + this.drawArrows(ctx, arrowData, values); this.drawLabel(ctx, viaNode); } }, { key: 'drawArrows', - value: function drawArrows(ctx, arrowData) { - if (this.options.arrows.from.enabled === true) { - this.edgeType.drawArrowHead(ctx, this.selected, this.hover, arrowData.from); + value: function drawArrows(ctx, arrowData, values) { + if (values.fromArrow) { + this.edgeType.drawArrowHead(ctx, values, this.selected, this.hover, arrowData.from); } - if (this.options.arrows.middle.enabled === true) { - this.edgeType.drawArrowHead(ctx, this.selected, this.hover, arrowData.middle); + if (values.middleArrow) { + this.edgeType.drawArrowHead(ctx, values, this.selected, this.hover, arrowData.middle); } - if (this.options.arrows.to.enabled === true) { - this.edgeType.drawArrowHead(ctx, this.selected, this.hover, arrowData.to); + if (values.toArrow) { + this.edgeType.drawArrowHead(ctx, values, this.selected, this.hover, arrowData.to); } } }, { @@ -34543,13 +38555,13 @@ return /******/ (function(modules) { // webpackBootstrap // if the label has to be rotated: if (this.options.font.align !== "horizontal") { - this.labelModule.calculateLabelSize(ctx, selected, point.x, point.y); + this.labelModule.calculateLabelSize(ctx, selected, this.hover, point.x, point.y); ctx.translate(point.x, this.labelModule.size.yLine); this._rotateForLabelAlignment(ctx); } // draw the label - this.labelModule.draw(ctx, point.x, point.y, selected); + this.labelModule.draw(ctx, point.x, point.y, selected, this.hover); ctx.restore(); } else { // Ignore the orientations. @@ -34564,7 +38576,7 @@ return /******/ (function(modules) { // webpackBootstrap y = node1.y - node1.shape.height * 0.5; } point = this._pointOnCircle(x, y, radius, 0.125); - this.labelModule.draw(ctx, point.x, point.y, selected); + this.labelModule.draw(ctx, point.x, point.y, selected, this.hover); } } } @@ -34673,7 +38685,7 @@ return /******/ (function(modules) { // webpackBootstrap if (newOptions.dashes !== undefined && newOptions.dashes !== null) { parentOptions.dashes = newOptions.dashes; } else if (allowDeletion === true && newOptions.dashes === null) { - parentOptions.dashes = Object.create(globalOptions.dashes); // this sets the pointer of the option back to the global option. + parentOptions.dashes = (0, _create2['default'])(globalOptions.dashes); // this sets the pointer of the option back to the global option. } // set the scaling newOptions @@ -34686,7 +38698,7 @@ return /******/ (function(modules) { // webpackBootstrap } util.mergeOptions(parentOptions.scaling, newOptions.scaling, 'label', allowDeletion, globalOptions.scaling); } else if (allowDeletion === true && newOptions.scaling === null) { - parentOptions.scaling = Object.create(globalOptions.scaling); // this sets the pointer of the option back to the global option. + parentOptions.scaling = (0, _create2['default'])(globalOptions.scaling); // this sets the pointer of the option back to the global option. } // handle multiple input cases for arrows @@ -34696,15 +38708,15 @@ return /******/ (function(modules) { // webpackBootstrap parentOptions.arrows.to.enabled = arrows.indexOf("to") != -1; parentOptions.arrows.middle.enabled = arrows.indexOf("middle") != -1; parentOptions.arrows.from.enabled = arrows.indexOf("from") != -1; - } else if (_typeof(newOptions.arrows) === 'object') { + } else if ((0, _typeof3['default'])(newOptions.arrows) === 'object') { util.mergeOptions(parentOptions.arrows, newOptions.arrows, 'to', allowDeletion, globalOptions.arrows); util.mergeOptions(parentOptions.arrows, newOptions.arrows, 'middle', allowDeletion, globalOptions.arrows); util.mergeOptions(parentOptions.arrows, newOptions.arrows, 'from', allowDeletion, globalOptions.arrows); } else { - throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:" + JSON.stringify(newOptions.arrows)); + throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:" + (0, _stringify2['default'])(newOptions.arrows)); } } else if (allowDeletion === true && newOptions.arrows === null) { - parentOptions.arrows = Object.create(globalOptions.arrows); // this sets the pointer of the option back to the global option. + parentOptions.arrows = (0, _create2['default'])(globalOptions.arrows); // this sets the pointer of the option back to the global option. } // handle multiple input cases for color @@ -34744,20 +38756,19 @@ return /******/ (function(modules) { // webpackBootstrap // handle the font settings if (newOptions.font !== undefined && newOptions.font !== null) { - _Label2.default.parseOptions(parentOptions.font, newOptions); + _Label2['default'].parseOptions(parentOptions.font, newOptions); } else if (allowDeletion === true && newOptions.font === null) { parentOptions.font = util.bridgeObject(globalOptions.font); // set the object back to the global options } } }]); - return Edge; }(); - exports.default = Edge; + exports['default'] = Edge; /***/ }, -/* 88 */ +/* 193 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -34766,29 +38777,42 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + var _slicedToArray2 = __webpack_require__(161); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _slicedToArray3 = _interopRequireDefault(_slicedToArray2); - var _CubicBezierEdgeBase2 = __webpack_require__(89); + var _getPrototypeOf = __webpack_require__(166); - var _CubicBezierEdgeBase3 = _interopRequireDefault(_CubicBezierEdgeBase2); + var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var _classCallCheck2 = __webpack_require__(115); + + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); + + var _createClass3 = _interopRequireDefault(_createClass2); + + var _possibleConstructorReturn2 = __webpack_require__(169); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + var _inherits2 = __webpack_require__(170); + + var _inherits3 = _interopRequireDefault(_inherits2); + + var _CubicBezierEdgeBase2 = __webpack_require__(194); + + var _CubicBezierEdgeBase3 = _interopRequireDefault(_CubicBezierEdgeBase2); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var CubicBezierEdge = function (_CubicBezierEdgeBase) { - _inherits(CubicBezierEdge, _CubicBezierEdgeBase); + (0, _inherits3['default'])(CubicBezierEdge, _CubicBezierEdgeBase); function CubicBezierEdge(options, body, labelModule) { - _classCallCheck(this, CubicBezierEdge); - - return _possibleConstructorReturn(this, (CubicBezierEdge.__proto__ || Object.getPrototypeOf(CubicBezierEdge)).call(this, options, body, labelModule)); + (0, _classCallCheck3['default'])(this, CubicBezierEdge); + return (0, _possibleConstructorReturn3['default'])(this, (CubicBezierEdge.__proto__ || (0, _getPrototypeOf2['default'])(CubicBezierEdge)).call(this, options, body, labelModule)); } /** @@ -34798,9 +38822,9 @@ return /******/ (function(modules) { // webpackBootstrap */ - _createClass(CubicBezierEdge, [{ + (0, _createClass3['default'])(CubicBezierEdge, [{ key: '_line', - value: function _line(ctx, viaNodes) { + value: function _line(ctx, values, viaNodes) { // get the coordinates of the support points. var via1 = viaNodes[0]; var via2 = viaNodes[1]; @@ -34816,9 +38840,9 @@ return /******/ (function(modules) { // webpackBootstrap ctx.bezierCurveTo(via1.x, via1.y, via2.x, via2.y, this.toPoint.x, this.toPoint.y); } // draw shadow if enabled - this.enableShadow(ctx); + this.enableShadow(ctx, values); ctx.stroke(); - this.disableShadow(ctx); + this.disableShadow(ctx, values); } }, { key: '_getViaCoordinates', @@ -34861,7 +38885,7 @@ return /******/ (function(modules) { // webpackBootstrap key: '_getDistanceToEdge', value: function _getDistanceToEdge(x1, y1, x2, y2, x3, y3) { var _ref = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : this._getViaCoordinates(), - _ref2 = _slicedToArray(_ref, 2), + _ref2 = (0, _slicedToArray3['default'])(_ref, 2), via1 = _ref2[0], via2 = _ref2[1]; @@ -34881,7 +38905,7 @@ return /******/ (function(modules) { // webpackBootstrap key: 'getPoint', value: function getPoint(percentage) { var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this._getViaCoordinates(), - _ref4 = _slicedToArray(_ref3, 2), + _ref4 = (0, _slicedToArray3['default'])(_ref3, 2), via1 = _ref4[0], via2 = _ref4[1]; @@ -34897,14 +38921,13 @@ return /******/ (function(modules) { // webpackBootstrap return { x: x, y: y }; } }]); - return CubicBezierEdge; - }(_CubicBezierEdgeBase3.default); + }(_CubicBezierEdgeBase3['default']); - exports.default = CubicBezierEdge; + exports['default'] = CubicBezierEdge; /***/ }, -/* 89 */ +/* 194 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -34913,27 +38936,38 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _getPrototypeOf = __webpack_require__(166); - var _BezierEdgeBase2 = __webpack_require__(90); + var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - var _BezierEdgeBase3 = _interopRequireDefault(_BezierEdgeBase2); + var _classCallCheck2 = __webpack_require__(115); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); + + var _createClass3 = _interopRequireDefault(_createClass2); + + var _possibleConstructorReturn2 = __webpack_require__(169); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + var _inherits2 = __webpack_require__(170); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + var _inherits3 = _interopRequireDefault(_inherits2); + + var _BezierEdgeBase2 = __webpack_require__(195); + + var _BezierEdgeBase3 = _interopRequireDefault(_BezierEdgeBase2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var CubicBezierEdgeBase = function (_BezierEdgeBase) { - _inherits(CubicBezierEdgeBase, _BezierEdgeBase); + (0, _inherits3['default'])(CubicBezierEdgeBase, _BezierEdgeBase); function CubicBezierEdgeBase(options, body, labelModule) { - _classCallCheck(this, CubicBezierEdgeBase); - - return _possibleConstructorReturn(this, (CubicBezierEdgeBase.__proto__ || Object.getPrototypeOf(CubicBezierEdgeBase)).call(this, options, body, labelModule)); + (0, _classCallCheck3['default'])(this, CubicBezierEdgeBase); + return (0, _possibleConstructorReturn3['default'])(this, (CubicBezierEdgeBase.__proto__ || (0, _getPrototypeOf2['default'])(CubicBezierEdgeBase)).call(this, options, body, labelModule)); } /** @@ -34951,7 +38985,7 @@ return /******/ (function(modules) { // webpackBootstrap */ - _createClass(CubicBezierEdgeBase, [{ + (0, _createClass3['default'])(CubicBezierEdgeBase, [{ key: '_getDistanceToBezierEdge', value: function _getDistanceToBezierEdge(x1, y1, x2, y2, x3, y3, via1, via2) { // x3,y3 is the point @@ -34983,14 +39017,13 @@ return /******/ (function(modules) { // webpackBootstrap return minDistance; } }]); - return CubicBezierEdgeBase; - }(_BezierEdgeBase3.default); + }(_BezierEdgeBase3['default']); - exports.default = CubicBezierEdgeBase; + exports['default'] = CubicBezierEdgeBase; /***/ }, -/* 90 */ +/* 195 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -34999,27 +39032,38 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _getPrototypeOf = __webpack_require__(166); - var _EdgeBase2 = __webpack_require__(91); + var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - var _EdgeBase3 = _interopRequireDefault(_EdgeBase2); + var _classCallCheck2 = __webpack_require__(115); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _createClass2 = __webpack_require__(116); - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + var _createClass3 = _interopRequireDefault(_createClass2); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + var _possibleConstructorReturn2 = __webpack_require__(169); + + var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); + + var _inherits2 = __webpack_require__(170); + + var _inherits3 = _interopRequireDefault(_inherits2); + + var _EdgeBase2 = __webpack_require__(196); + + var _EdgeBase3 = _interopRequireDefault(_EdgeBase2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var BezierEdgeBase = function (_EdgeBase) { - _inherits(BezierEdgeBase, _EdgeBase); + (0, _inherits3['default'])(BezierEdgeBase, _EdgeBase); function BezierEdgeBase(options, body, labelModule) { - _classCallCheck(this, BezierEdgeBase); - - return _possibleConstructorReturn(this, (BezierEdgeBase.__proto__ || Object.getPrototypeOf(BezierEdgeBase)).call(this, options, body, labelModule)); + (0, _classCallCheck3['default'])(this, BezierEdgeBase); + return (0, _possibleConstructorReturn3['default'])(this, (BezierEdgeBase.__proto__ || (0, _getPrototypeOf2['default'])(BezierEdgeBase)).call(this, options, body, labelModule)); } /** @@ -35037,7 +39081,7 @@ return /******/ (function(modules) { // webpackBootstrap */ - _createClass(BezierEdgeBase, [{ + (0, _createClass3['default'])(BezierEdgeBase, [{ key: '_findBorderPositionBezier', value: function _findBorderPositionBezier(nearNode, ctx) { var viaNode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this._getViaCoordinates(); @@ -35127,14 +39171,13 @@ return /******/ (function(modules) { // webpackBootstrap return minDistance; } }]); - return BezierEdgeBase; - }(_EdgeBase3.default); + }(_EdgeBase3['default']); - exports.default = BezierEdgeBase; + exports['default'] = BezierEdgeBase; /***/ }, -/* 91 */ +/* 196 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -35143,17 +39186,25 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + var _slicedToArray2 = __webpack_require__(161); + + var _slicedToArray3 = _interopRequireDefault(_slicedToArray2); + + var _classCallCheck2 = __webpack_require__(115); + + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _createClass2 = __webpack_require__(116); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _createClass3 = _interopRequireDefault(_createClass2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var util = __webpack_require__(1); var EdgeBase = function () { function EdgeBase(options, body, labelModule) { - _classCallCheck(this, EdgeBase); + (0, _classCallCheck3['default'])(this, EdgeBase); this.body = body; this.labelModule = labelModule; @@ -35167,7 +39218,7 @@ return /******/ (function(modules) { // webpackBootstrap this.toPoint = this.to; } - _createClass(EdgeBase, [{ + (0, _createClass3['default'])(EdgeBase, [{ key: 'connect', value: function connect() { this.from = this.body.nodes[this.options.from]; @@ -35197,40 +39248,40 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: 'drawLine', - value: function drawLine(ctx, selected, hover, viaNode) { + value: function drawLine(ctx, values, selected, hover, viaNode) { // set style - ctx.strokeStyle = this.getColor(ctx, selected, hover); - ctx.lineWidth = this.getLineWidth(selected, hover); + ctx.strokeStyle = this.getColor(ctx, values, selected, hover); + ctx.lineWidth = values.width; - if (this.options.dashes !== false) { - this._drawDashedLine(ctx, viaNode); + if (values.dashes !== false) { + this._drawDashedLine(ctx, values, viaNode); } else { - this._drawLine(ctx, viaNode); + this._drawLine(ctx, values, viaNode); } } }, { key: '_drawLine', - value: function _drawLine(ctx, viaNode, fromPoint, toPoint) { + value: function _drawLine(ctx, values, viaNode, fromPoint, toPoint) { if (this.from != this.to) { // draw line - this._line(ctx, viaNode, fromPoint, toPoint); + this._line(ctx, values, viaNode, fromPoint, toPoint); } else { - var _getCircleData2 = this._getCircleData(ctx), - _getCircleData3 = _slicedToArray(_getCircleData2, 3), + var _getCircleData2 = this._getCircleData(ctx, values), + _getCircleData3 = (0, _slicedToArray3['default'])(_getCircleData2, 3), x = _getCircleData3[0], y = _getCircleData3[1], radius = _getCircleData3[2]; - this._circle(ctx, x, y, radius); + this._circle(ctx, values, x, y, radius); } } }, { key: '_drawDashedLine', - value: function _drawDashedLine(ctx, viaNode, fromPoint, toPoint) { + value: function _drawDashedLine(ctx, values, viaNode, fromPoint, toPoint) { ctx.lineCap = 'round'; var pattern = [5, 5]; - if (Array.isArray(this.options.dashes) === true) { - pattern = this.options.dashes; + if (Array.isArray(values.dashes) === true) { + pattern = values.dashes; } // only firefox and chrome support this method, else we use the legacy one. @@ -35244,15 +39295,15 @@ return /******/ (function(modules) { // webpackBootstrap // draw the line if (this.from != this.to) { // draw line - this._line(ctx, viaNode); + this._line(ctx, values, viaNode); } else { - var _getCircleData4 = this._getCircleData(ctx), - _getCircleData5 = _slicedToArray(_getCircleData4, 3), + var _getCircleData4 = this._getCircleData(ctx, values), + _getCircleData5 = (0, _slicedToArray3['default'])(_getCircleData4, 3), x = _getCircleData5[0], y = _getCircleData5[1], radius = _getCircleData5[2]; - this._circle(ctx, x, y, radius); + this._circle(ctx, values, x, y, radius); } // restore the dash settings. @@ -35265,21 +39316,21 @@ return /******/ (function(modules) { // webpackBootstrap // draw line ctx.dashedLine(this.from.x, this.from.y, this.to.x, this.to.y, pattern); } else { - var _getCircleData6 = this._getCircleData(ctx), - _getCircleData7 = _slicedToArray(_getCircleData6, 3), + var _getCircleData6 = this._getCircleData(ctx, values), + _getCircleData7 = (0, _slicedToArray3['default'])(_getCircleData6, 3), _x = _getCircleData7[0], _y = _getCircleData7[1], _radius = _getCircleData7[2]; - this._circle(ctx, _x, _y, _radius); + this._circle(ctx, values, _x, _y, _radius); } // draw shadow if enabled - this.enableShadow(ctx); + this.enableShadow(ctx, values); ctx.stroke(); // disable shadows for other elements. - this.disableShadow(ctx); + this.disableShadow(ctx, values); } } }, { @@ -35301,7 +39352,7 @@ return /******/ (function(modules) { // webpackBootstrap to = this._findBorderPosition(this.to, ctx); } else { var _getCircleData8 = this._getCircleData(ctx), - _getCircleData9 = _slicedToArray(_getCircleData8, 3), + _getCircleData9 = (0, _slicedToArray3['default'])(_getCircleData8, 3), x = _getCircleData9[0], y = _getCircleData9[1], radius = _getCircleData9[2]; @@ -35438,11 +39489,10 @@ return /******/ (function(modules) { // webpackBootstrap } }, { key: 'getColor', - value: function getColor(ctx, selected, hover) { - var colorOptions = this.options.color; - if (colorOptions.inherit !== false) { + value: function getColor(ctx, values, selected, hover) { + if (values.inheritsColor !== false) { // when this is a loop edge, just use the 'from' method - if (colorOptions.inherit === 'both' && this.from.id !== this.to.id) { + if (values.inheritsColor === 'both' && this.from.id !== this.to.id) { var grd = ctx.createLinearGradient(this.from.x, this.from.y, this.to.x, this.to.y); var fromColor = void 0, toColor = void 0; @@ -35450,8 +39500,8 @@ return /******/ (function(modules) { // webpackBootstrap toColor = this.to.options.color.highlight.border; if (this.from.selected === false && this.to.selected === false) { - fromColor = util.overrideOpacity(this.from.options.color.border, this.options.color.opacity); - toColor = util.overrideOpacity(this.to.options.color.border, this.options.color.opacity); + fromColor = util.overrideOpacity(this.from.options.color.border, values.opacity); + toColor = util.overrideOpacity(this.to.options.color.border, values.opacity); } else if (this.from.selected === true && this.to.selected === false) { toColor = this.to.options.color.border; } else if (this.from.selected === false && this.to.selected === true) { @@ -35464,33 +39514,14 @@ return /******/ (function(modules) { // webpackBootstrap return grd; } - if (this.colorDirty === true) { - if (colorOptions.inherit === "to") { - this.color.highlight = this.to.options.color.highlight.border; - this.color.hover = this.to.options.color.hover.border; - this.color.color = util.overrideOpacity(this.to.options.color.border, colorOptions.opacity); - } else { - // (this.options.color.inherit.source === "from") { - this.color.highlight = this.from.options.color.highlight.border; - this.color.hover = this.from.options.color.hover.border; - this.color.color = util.overrideOpacity(this.from.options.color.border, colorOptions.opacity); - } + if (values.inheritsColor === "to") { + return util.overrideOpacity(this.to.options.color.border, values.opacity); + } else { + // "from" + return util.overrideOpacity(this.from.options.color.border, values.opacity); } - } else if (this.colorDirty === true) { - this.color.highlight = colorOptions.highlight; - this.color.hover = colorOptions.hover; - this.color.color = util.overrideOpacity(colorOptions.color, colorOptions.opacity); - } - - // if color inherit is on and gradients are used, the function has already returned by now. - this.colorDirty = false; - - if (selected === true) { - return this.color.highlight; - } else if (hover === true) { - return this.color.hover; } else { - return this.color.color; + return util.overrideOpacity(values.color, values.opacity); } } @@ -35505,9 +39536,9 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: '_circle', - value: function _circle(ctx, x, y, radius) { + value: function _circle(ctx, values, x, y, radius) { // draw shadow if enabled - this.enableShadow(ctx); + this.enableShadow(ctx, values); // draw a circle ctx.beginPath(); @@ -35515,7 +39546,7 @@ return /******/ (function(modules) { // webpackBootstrap ctx.stroke(); // disable shadows for other elements. - this.disableShadow(ctx); + this.disableShadow(ctx, values); } /** @@ -35533,14 +39564,14 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: 'getDistanceToEdge', - value: function getDistanceToEdge(x1, y1, x2, y2, x3, y3, via) { + value: function getDistanceToEdge(x1, y1, x2, y2, x3, y3, via, values) { // x3,y3 is the point var returnValue = 0; if (this.from != this.to) { returnValue = this._getDistanceToEdge(x1, y1, x2, y2, x3, y3, via); } else { - var _getCircleData10 = this._getCircleData(), - _getCircleData11 = _slicedToArray(_getCircleData10, 3), + var _getCircleData10 = this._getCircleData(undefined, values), + _getCircleData11 = (0, _slicedToArray3['default'])(_getCircleData10, 3), x = _getCircleData11[0], y = _getCircleData11[1], radius = _getCircleData11[2]; @@ -35593,7 +39624,7 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: 'getArrowData', - value: function getArrowData(ctx, position, viaNode, selected, hover) { + value: function getArrowData(ctx, position, viaNode, selected, hover, values) { // set lets var angle = void 0; var arrowPoint = void 0; @@ -35602,25 +39633,25 @@ return /******/ (function(modules) { // webpackBootstrap var guideOffset = void 0; var scaleFactor = void 0; var type = void 0; - var lineWidth = this.getLineWidth(selected, hover); + var lineWidth = values.width; if (position === 'from') { node1 = this.from; node2 = this.to; guideOffset = 0.1; - scaleFactor = this.options.arrows.from.scaleFactor; - type = this.options.arrows.from.type; + scaleFactor = values.fromArrowScale; + type = values.fromArrowType; } else if (position === 'to') { node1 = this.to; node2 = this.from; guideOffset = -0.1; - scaleFactor = this.options.arrows.to.scaleFactor; - type = this.options.arrows.to.type; + scaleFactor = values.toArrowScale; + type = values.toArrowType; } else { node1 = this.to; node2 = this.from; - scaleFactor = this.options.arrows.middle.scaleFactor; - type = this.options.arrows.middle.type; + scaleFactor = values.middleArrowScale; + type = values.middleArrowType; } // if not connected to itself @@ -35642,7 +39673,7 @@ return /******/ (function(modules) { // webpackBootstrap } else { // draw circle var _getCircleData12 = this._getCircleData(ctx), - _getCircleData13 = _slicedToArray(_getCircleData12, 3), + _getCircleData13 = (0, _slicedToArray3['default'])(_getCircleData12, 3), x = _getCircleData13[0], y = _getCircleData13[1], radius = _getCircleData13[2]; @@ -35678,11 +39709,11 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: 'drawArrowHead', - value: function drawArrowHead(ctx, selected, hover, arrowData) { + value: function drawArrowHead(ctx, values, selected, hover, arrowData) { // set style - ctx.strokeStyle = this.getColor(ctx, selected, hover); + ctx.strokeStyle = this.getColor(ctx, values, selected, hover); ctx.fillStyle = ctx.strokeStyle; - ctx.lineWidth = this.getLineWidth(selected, hover); + ctx.lineWidth = values.width; if (arrowData.type && arrowData.type.toLowerCase() === 'circle') { // draw circle at the end of the line @@ -35693,25 +39724,25 @@ return /******/ (function(modules) { // webpackBootstrap } // draw shadow if enabled - this.enableShadow(ctx); + this.enableShadow(ctx, values); ctx.fill(); // disable shadows for other elements. - this.disableShadow(ctx); + this.disableShadow(ctx, values); } }, { key: 'enableShadow', - value: function enableShadow(ctx) { - if (this.options.shadow.enabled === true) { - ctx.shadowColor = this.options.shadow.color; - ctx.shadowBlur = this.options.shadow.size; - ctx.shadowOffsetX = this.options.shadow.x; - ctx.shadowOffsetY = this.options.shadow.y; + value: function enableShadow(ctx, values) { + if (values.shadow === true) { + ctx.shadowColor = values.shadowColor; + ctx.shadowBlur = values.shadowSize; + ctx.shadowOffsetX = values.shadowX; + ctx.shadowOffsetY = values.shadowY; } } }, { key: 'disableShadow', - value: function disableShadow(ctx) { - if (this.options.shadow.enabled === true) { + value: function disableShadow(ctx, values) { + if (values.shadow === true) { ctx.shadowColor = 'rgba(0,0,0,0)'; ctx.shadowBlur = 0; ctx.shadowOffsetX = 0; @@ -35719,14 +39750,13 @@ return /******/ (function(modules) { // webpackBootstrap } } }]); - return EdgeBase; }(); - exports.default = EdgeBase; + exports['default'] = EdgeBase; /***/ }, -/* 92 */ +/* 197 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -35735,30 +39765,44 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + var _slicedToArray2 = __webpack_require__(161); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _slicedToArray3 = _interopRequireDefault(_slicedToArray2); - var _BezierEdgeBase2 = __webpack_require__(90); + var _getPrototypeOf = __webpack_require__(166); - var _BezierEdgeBase3 = _interopRequireDefault(_BezierEdgeBase2); + var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var _classCallCheck2 = __webpack_require__(115); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + var _createClass2 = __webpack_require__(116); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + var _createClass3 = _interopRequireDefault(_createClass2); + + var _possibleConstructorReturn2 = __webpack_require__(169); + + var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); + + var _inherits2 = __webpack_require__(170); + + var _inherits3 = _interopRequireDefault(_inherits2); + + var _BezierEdgeBase2 = __webpack_require__(195); + + var _BezierEdgeBase3 = _interopRequireDefault(_BezierEdgeBase2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } var BezierEdgeDynamic = function (_BezierEdgeBase) { - _inherits(BezierEdgeDynamic, _BezierEdgeBase); + (0, _inherits3["default"])(BezierEdgeDynamic, _BezierEdgeBase); function BezierEdgeDynamic(options, body, labelModule) { - _classCallCheck(this, BezierEdgeDynamic); + (0, _classCallCheck3["default"])(this, BezierEdgeDynamic); // --> this calls the setOptions below - var _this = _possibleConstructorReturn(this, (BezierEdgeDynamic.__proto__ || Object.getPrototypeOf(BezierEdgeDynamic)).call(this, options, body, labelModule)); + var _this = (0, _possibleConstructorReturn3["default"])(this, (BezierEdgeDynamic.__proto__ || (0, _getPrototypeOf2["default"])(BezierEdgeDynamic)).call(this, options, body, labelModule)); //this.via = undefined; // Here for completeness but not allowed to defined before super() is invoked. @@ -35769,7 +39813,7 @@ return /******/ (function(modules) { // webpackBootstrap return _this; } - _createClass(BezierEdgeDynamic, [{ + (0, _createClass3["default"])(BezierEdgeDynamic, [{ key: "setOptions", value: function setOptions(options) { // check if the physics has changed. @@ -35873,7 +39917,7 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: "_line", - value: function _line(ctx, viaNode) { + value: function _line(ctx, values, viaNode) { // draw a straight line ctx.beginPath(); ctx.moveTo(this.fromPoint.x, this.fromPoint.y); @@ -35884,9 +39928,9 @@ return /******/ (function(modules) { // webpackBootstrap ctx.quadraticCurveTo(viaNode.x, viaNode.y, this.toPoint.x, this.toPoint.y); } // draw shadow if enabled - this.enableShadow(ctx); + this.enableShadow(ctx, values); ctx.stroke(); - this.disableShadow(ctx); + this.disableShadow(ctx, values); } }, { key: "getViaNode", @@ -35912,7 +39956,7 @@ return /******/ (function(modules) { // webpackBootstrap y = void 0; if (this.from === this.to) { var _getCircleData = this._getCircleData(this.from), - _getCircleData2 = _slicedToArray(_getCircleData, 3), + _getCircleData2 = (0, _slicedToArray3["default"])(_getCircleData, 3), cx = _getCircleData2[0], cy = _getCircleData2[1], cr = _getCircleData2[2]; @@ -35939,14 +39983,13 @@ return /******/ (function(modules) { // webpackBootstrap return this._getDistanceToBezierEdge(x1, y1, x2, y2, x3, y3, this.via); } }]); - return BezierEdgeDynamic; - }(_BezierEdgeBase3.default); + }(_BezierEdgeBase3["default"]); - exports.default = BezierEdgeDynamic; + exports["default"] = BezierEdgeDynamic; /***/ }, -/* 93 */ +/* 198 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -35955,27 +39998,38 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _getPrototypeOf = __webpack_require__(166); - var _BezierEdgeBase2 = __webpack_require__(90); + var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - var _BezierEdgeBase3 = _interopRequireDefault(_BezierEdgeBase2); + var _classCallCheck2 = __webpack_require__(115); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); + + var _createClass3 = _interopRequireDefault(_createClass2); + + var _possibleConstructorReturn2 = __webpack_require__(169); + + var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _inherits2 = __webpack_require__(170); - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + var _inherits3 = _interopRequireDefault(_inherits2); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + var _BezierEdgeBase2 = __webpack_require__(195); + + var _BezierEdgeBase3 = _interopRequireDefault(_BezierEdgeBase2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var BezierEdgeStatic = function (_BezierEdgeBase) { - _inherits(BezierEdgeStatic, _BezierEdgeBase); + (0, _inherits3['default'])(BezierEdgeStatic, _BezierEdgeBase); function BezierEdgeStatic(options, body, labelModule) { - _classCallCheck(this, BezierEdgeStatic); - - return _possibleConstructorReturn(this, (BezierEdgeStatic.__proto__ || Object.getPrototypeOf(BezierEdgeStatic)).call(this, options, body, labelModule)); + (0, _classCallCheck3['default'])(this, BezierEdgeStatic); + return (0, _possibleConstructorReturn3['default'])(this, (BezierEdgeStatic.__proto__ || (0, _getPrototypeOf2['default'])(BezierEdgeStatic)).call(this, options, body, labelModule)); } /** @@ -35985,9 +40039,9 @@ return /******/ (function(modules) { // webpackBootstrap */ - _createClass(BezierEdgeStatic, [{ + (0, _createClass3['default'])(BezierEdgeStatic, [{ key: '_line', - value: function _line(ctx, viaNode) { + value: function _line(ctx, values, viaNode) { // draw a straight line ctx.beginPath(); ctx.moveTo(this.fromPoint.x, this.fromPoint.y); @@ -35999,9 +40053,9 @@ return /******/ (function(modules) { // webpackBootstrap ctx.quadraticCurveTo(viaNode.x, viaNode.y, this.toPoint.x, this.toPoint.y); } // draw shadow if enabled - this.enableShadow(ctx); + this.enableShadow(ctx, values); ctx.stroke(); - this.disableShadow(ctx); + this.disableShadow(ctx, values); } }, { key: 'getViaNode', @@ -36207,14 +40261,13 @@ return /******/ (function(modules) { // webpackBootstrap return { x: x, y: y }; } }]); - return BezierEdgeStatic; - }(_BezierEdgeBase3.default); + }(_BezierEdgeBase3['default']); - exports.default = BezierEdgeStatic; + exports['default'] = BezierEdgeStatic; /***/ }, -/* 94 */ +/* 199 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -36223,27 +40276,38 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _getPrototypeOf = __webpack_require__(166); - var _EdgeBase2 = __webpack_require__(91); + var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - var _EdgeBase3 = _interopRequireDefault(_EdgeBase2); + var _classCallCheck2 = __webpack_require__(115); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _createClass3 = _interopRequireDefault(_createClass2); - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + var _possibleConstructorReturn2 = __webpack_require__(169); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); + + var _inherits2 = __webpack_require__(170); + + var _inherits3 = _interopRequireDefault(_inherits2); + + var _EdgeBase2 = __webpack_require__(196); + + var _EdgeBase3 = _interopRequireDefault(_EdgeBase2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var StraightEdge = function (_EdgeBase) { - _inherits(StraightEdge, _EdgeBase); + (0, _inherits3['default'])(StraightEdge, _EdgeBase); function StraightEdge(options, body, labelModule) { - _classCallCheck(this, StraightEdge); - - return _possibleConstructorReturn(this, (StraightEdge.__proto__ || Object.getPrototypeOf(StraightEdge)).call(this, options, body, labelModule)); + (0, _classCallCheck3['default'])(this, StraightEdge); + return (0, _possibleConstructorReturn3['default'])(this, (StraightEdge.__proto__ || (0, _getPrototypeOf2['default'])(StraightEdge)).call(this, options, body, labelModule)); } /** @@ -36253,17 +40317,17 @@ return /******/ (function(modules) { // webpackBootstrap */ - _createClass(StraightEdge, [{ + (0, _createClass3['default'])(StraightEdge, [{ key: '_line', - value: function _line(ctx) { + value: function _line(ctx, values) { // draw a straight line ctx.beginPath(); ctx.moveTo(this.fromPoint.x, this.fromPoint.y); ctx.lineTo(this.toPoint.x, this.toPoint.y); // draw shadow if enabled - this.enableShadow(ctx); + this.enableShadow(ctx, values); ctx.stroke(); - this.disableShadow(ctx); + this.disableShadow(ctx, values); } }, { key: 'getViaNode', @@ -36317,14 +40381,13 @@ return /******/ (function(modules) { // webpackBootstrap return this._getDistanceToLine(x1, y1, x2, y2, x3, y3); } }]); - return StraightEdge; - }(_EdgeBase3.default); + }(_EdgeBase3['default']); - exports.default = StraightEdge; + exports['default'] = StraightEdge; /***/ }, -/* 95 */ +/* 200 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -36333,49 +40396,57 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _keys = __webpack_require__(58); + + var _keys2 = _interopRequireDefault(_keys); + + var _classCallCheck2 = __webpack_require__(115); + + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); - var _BarnesHutSolver = __webpack_require__(96); + var _createClass3 = _interopRequireDefault(_createClass2); + + var _BarnesHutSolver = __webpack_require__(201); var _BarnesHutSolver2 = _interopRequireDefault(_BarnesHutSolver); - var _RepulsionSolver = __webpack_require__(97); + var _RepulsionSolver = __webpack_require__(202); var _RepulsionSolver2 = _interopRequireDefault(_RepulsionSolver); - var _HierarchicalRepulsionSolver = __webpack_require__(98); + var _HierarchicalRepulsionSolver = __webpack_require__(203); var _HierarchicalRepulsionSolver2 = _interopRequireDefault(_HierarchicalRepulsionSolver); - var _SpringSolver = __webpack_require__(99); + var _SpringSolver = __webpack_require__(204); var _SpringSolver2 = _interopRequireDefault(_SpringSolver); - var _HierarchicalSpringSolver = __webpack_require__(100); + var _HierarchicalSpringSolver = __webpack_require__(205); var _HierarchicalSpringSolver2 = _interopRequireDefault(_HierarchicalSpringSolver); - var _CentralGravitySolver = __webpack_require__(101); + var _CentralGravitySolver = __webpack_require__(206); var _CentralGravitySolver2 = _interopRequireDefault(_CentralGravitySolver); - var _FA2BasedRepulsionSolver = __webpack_require__(102); + var _FA2BasedRepulsionSolver = __webpack_require__(207); var _FA2BasedRepulsionSolver2 = _interopRequireDefault(_FA2BasedRepulsionSolver); - var _FA2BasedCentralGravitySolver = __webpack_require__(103); + var _FA2BasedCentralGravitySolver = __webpack_require__(208); var _FA2BasedCentralGravitySolver2 = _interopRequireDefault(_FA2BasedCentralGravitySolver); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var util = __webpack_require__(1); var PhysicsEngine = function () { function PhysicsEngine(body) { - _classCallCheck(this, PhysicsEngine); + (0, _classCallCheck3['default'])(this, PhysicsEngine); this.body = body; this.physicsBody = { physicsNodeIndices: [], physicsEdgeIndices: [], forces: {}, velocities: {} }; @@ -36456,7 +40527,7 @@ return /******/ (function(modules) { // webpackBootstrap this.bindEventListeners(); } - _createClass(PhysicsEngine, [{ + (0, _createClass3['default'])(PhysicsEngine, [{ key: 'bindEventListeners', value: function bindEventListeners() { var _this = this; @@ -36545,25 +40616,25 @@ return /******/ (function(modules) { // webpackBootstrap var options; if (this.options.solver === 'forceAtlas2Based') { options = this.options.forceAtlas2Based; - this.nodesSolver = new _FA2BasedRepulsionSolver2.default(this.body, this.physicsBody, options); - this.edgesSolver = new _SpringSolver2.default(this.body, this.physicsBody, options); - this.gravitySolver = new _FA2BasedCentralGravitySolver2.default(this.body, this.physicsBody, options); + this.nodesSolver = new _FA2BasedRepulsionSolver2['default'](this.body, this.physicsBody, options); + this.edgesSolver = new _SpringSolver2['default'](this.body, this.physicsBody, options); + this.gravitySolver = new _FA2BasedCentralGravitySolver2['default'](this.body, this.physicsBody, options); } else if (this.options.solver === 'repulsion') { options = this.options.repulsion; - this.nodesSolver = new _RepulsionSolver2.default(this.body, this.physicsBody, options); - this.edgesSolver = new _SpringSolver2.default(this.body, this.physicsBody, options); - this.gravitySolver = new _CentralGravitySolver2.default(this.body, this.physicsBody, options); + this.nodesSolver = new _RepulsionSolver2['default'](this.body, this.physicsBody, options); + this.edgesSolver = new _SpringSolver2['default'](this.body, this.physicsBody, options); + this.gravitySolver = new _CentralGravitySolver2['default'](this.body, this.physicsBody, options); } else if (this.options.solver === 'hierarchicalRepulsion') { options = this.options.hierarchicalRepulsion; - this.nodesSolver = new _HierarchicalRepulsionSolver2.default(this.body, this.physicsBody, options); - this.edgesSolver = new _HierarchicalSpringSolver2.default(this.body, this.physicsBody, options); - this.gravitySolver = new _CentralGravitySolver2.default(this.body, this.physicsBody, options); + this.nodesSolver = new _HierarchicalRepulsionSolver2['default'](this.body, this.physicsBody, options); + this.edgesSolver = new _HierarchicalSpringSolver2['default'](this.body, this.physicsBody, options); + this.gravitySolver = new _CentralGravitySolver2['default'](this.body, this.physicsBody, options); } else { // barnesHut options = this.options.barnesHut; - this.nodesSolver = new _BarnesHutSolver2.default(this.body, this.physicsBody, options); - this.edgesSolver = new _SpringSolver2.default(this.body, this.physicsBody, options); - this.gravitySolver = new _CentralGravitySolver2.default(this.body, this.physicsBody, options); + this.nodesSolver = new _BarnesHutSolver2['default'](this.body, this.physicsBody, options); + this.edgesSolver = new _SpringSolver2['default'](this.body, this.physicsBody, options); + this.gravitySolver = new _CentralGravitySolver2['default'](this.body, this.physicsBody, options); } this.modelOptions = options; @@ -36823,7 +40894,7 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: 'revert', value: function revert() { - var nodeIds = Object.keys(this.previousStates); + var nodeIds = (0, _keys2['default'])(this.previousStates); var nodes = this.body.nodes; var velocities = this.physicsBody.velocities; this.referenceState = {}; @@ -37138,15 +41209,14 @@ return /******/ (function(modules) { // webpackBootstrap } } }]); - return PhysicsEngine; }(); - exports.default = PhysicsEngine; + exports['default'] = PhysicsEngine; /***/ }, -/* 96 */ -/***/ function(module, exports) { +/* 201 */ +/***/ function(module, exports, __webpack_require__) { "use strict"; @@ -37154,13 +41224,19 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _classCallCheck2 = __webpack_require__(115); + + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _createClass2 = __webpack_require__(116); + + var _createClass3 = _interopRequireDefault(_createClass2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } var BarnesHutSolver = function () { function BarnesHutSolver(body, physicsBody, options) { - _classCallCheck(this, BarnesHutSolver); + (0, _classCallCheck3["default"])(this, BarnesHutSolver); this.body = body; this.physicsBody = physicsBody; @@ -37172,7 +41248,7 @@ return /******/ (function(modules) { // webpackBootstrap //this.body.emitter.on("afterDrawing", (ctx) => {this._debug(ctx,'#ff0000')}) } - _createClass(BarnesHutSolver, [{ + (0, _createClass3["default"])(BarnesHutSolver, [{ key: "setOptions", value: function setOptions(options) { this.options = options; @@ -37652,15 +41728,14 @@ return /******/ (function(modules) { // webpackBootstrap */ } }]); - return BarnesHutSolver; }(); - exports.default = BarnesHutSolver; + exports["default"] = BarnesHutSolver; /***/ }, -/* 97 */ -/***/ function(module, exports) { +/* 202 */ +/***/ function(module, exports, __webpack_require__) { "use strict"; @@ -37668,20 +41743,26 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _classCallCheck2 = __webpack_require__(115); + + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); + + var _createClass3 = _interopRequireDefault(_createClass2); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } var RepulsionSolver = function () { function RepulsionSolver(body, physicsBody, options) { - _classCallCheck(this, RepulsionSolver); + (0, _classCallCheck3["default"])(this, RepulsionSolver); this.body = body; this.physicsBody = physicsBody; this.setOptions(options); } - _createClass(RepulsionSolver, [{ + (0, _createClass3["default"])(RepulsionSolver, [{ key: "setOptions", value: function setOptions(options) { this.options = options; @@ -37746,15 +41827,14 @@ return /******/ (function(modules) { // webpackBootstrap } } }]); - return RepulsionSolver; }(); - exports.default = RepulsionSolver; + exports["default"] = RepulsionSolver; /***/ }, -/* 98 */ -/***/ function(module, exports) { +/* 203 */ +/***/ function(module, exports, __webpack_require__) { "use strict"; @@ -37762,20 +41842,26 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _classCallCheck2 = __webpack_require__(115); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); + + var _createClass3 = _interopRequireDefault(_createClass2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } var HierarchicalRepulsionSolver = function () { function HierarchicalRepulsionSolver(body, physicsBody, options) { - _classCallCheck(this, HierarchicalRepulsionSolver); + (0, _classCallCheck3["default"])(this, HierarchicalRepulsionSolver); this.body = body; this.physicsBody = physicsBody; this.setOptions(options); } - _createClass(HierarchicalRepulsionSolver, [{ + (0, _createClass3["default"])(HierarchicalRepulsionSolver, [{ key: "setOptions", value: function setOptions(options) { this.options = options; @@ -37837,15 +41923,14 @@ return /******/ (function(modules) { // webpackBootstrap } } }]); - return HierarchicalRepulsionSolver; }(); - exports.default = HierarchicalRepulsionSolver; + exports["default"] = HierarchicalRepulsionSolver; /***/ }, -/* 99 */ -/***/ function(module, exports) { +/* 204 */ +/***/ function(module, exports, __webpack_require__) { "use strict"; @@ -37853,20 +41938,26 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _classCallCheck2 = __webpack_require__(115); + + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _createClass2 = __webpack_require__(116); + + var _createClass3 = _interopRequireDefault(_createClass2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } var SpringSolver = function () { function SpringSolver(body, physicsBody, options) { - _classCallCheck(this, SpringSolver); + (0, _classCallCheck3["default"])(this, SpringSolver); this.body = body; this.physicsBody = physicsBody; this.setOptions(options); } - _createClass(SpringSolver, [{ + (0, _createClass3["default"])(SpringSolver, [{ key: "setOptions", value: function setOptions(options) { this.options = options; @@ -37948,15 +42039,14 @@ return /******/ (function(modules) { // webpackBootstrap } } }]); - return SpringSolver; }(); - exports.default = SpringSolver; + exports["default"] = SpringSolver; /***/ }, -/* 100 */ -/***/ function(module, exports) { +/* 205 */ +/***/ function(module, exports, __webpack_require__) { "use strict"; @@ -37964,20 +42054,26 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _classCallCheck2 = __webpack_require__(115); + + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _createClass3 = _interopRequireDefault(_createClass2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } var HierarchicalSpringSolver = function () { function HierarchicalSpringSolver(body, physicsBody, options) { - _classCallCheck(this, HierarchicalSpringSolver); + (0, _classCallCheck3["default"])(this, HierarchicalSpringSolver); this.body = body; this.physicsBody = physicsBody; this.setOptions(options); } - _createClass(HierarchicalSpringSolver, [{ + (0, _createClass3["default"])(HierarchicalSpringSolver, [{ key: "setOptions", value: function setOptions(options) { this.options = options; @@ -38077,15 +42173,14 @@ return /******/ (function(modules) { // webpackBootstrap } } }]); - return HierarchicalSpringSolver; }(); - exports.default = HierarchicalSpringSolver; + exports["default"] = HierarchicalSpringSolver; /***/ }, -/* 101 */ -/***/ function(module, exports) { +/* 206 */ +/***/ function(module, exports, __webpack_require__) { "use strict"; @@ -38093,20 +42188,26 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _classCallCheck2 = __webpack_require__(115); + + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); + + var _createClass3 = _interopRequireDefault(_createClass2); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } var CentralGravitySolver = function () { function CentralGravitySolver(body, physicsBody, options) { - _classCallCheck(this, CentralGravitySolver); + (0, _classCallCheck3["default"])(this, CentralGravitySolver); this.body = body; this.physicsBody = physicsBody; this.setOptions(options); } - _createClass(CentralGravitySolver, [{ + (0, _createClass3["default"])(CentralGravitySolver, [{ key: "setOptions", value: function setOptions(options) { this.options = options; @@ -38146,14 +42247,13 @@ return /******/ (function(modules) { // webpackBootstrap forces[node.id].y = dy * gravityForce; } }]); - return CentralGravitySolver; }(); - exports.default = CentralGravitySolver; + exports["default"] = CentralGravitySolver; /***/ }, -/* 102 */ +/* 207 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -38162,27 +42262,38 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _getPrototypeOf = __webpack_require__(166); - var _BarnesHutSolver2 = __webpack_require__(96); + var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - var _BarnesHutSolver3 = _interopRequireDefault(_BarnesHutSolver2); + var _classCallCheck2 = __webpack_require__(115); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _createClass3 = _interopRequireDefault(_createClass2); - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + var _possibleConstructorReturn2 = __webpack_require__(169); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); + + var _inherits2 = __webpack_require__(170); + + var _inherits3 = _interopRequireDefault(_inherits2); + + var _BarnesHutSolver2 = __webpack_require__(201); + + var _BarnesHutSolver3 = _interopRequireDefault(_BarnesHutSolver2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } var ForceAtlas2BasedRepulsionSolver = function (_BarnesHutSolver) { - _inherits(ForceAtlas2BasedRepulsionSolver, _BarnesHutSolver); + (0, _inherits3["default"])(ForceAtlas2BasedRepulsionSolver, _BarnesHutSolver); function ForceAtlas2BasedRepulsionSolver(body, physicsBody, options) { - _classCallCheck(this, ForceAtlas2BasedRepulsionSolver); - - return _possibleConstructorReturn(this, (ForceAtlas2BasedRepulsionSolver.__proto__ || Object.getPrototypeOf(ForceAtlas2BasedRepulsionSolver)).call(this, body, physicsBody, options)); + (0, _classCallCheck3["default"])(this, ForceAtlas2BasedRepulsionSolver); + return (0, _possibleConstructorReturn3["default"])(this, (ForceAtlas2BasedRepulsionSolver.__proto__ || (0, _getPrototypeOf2["default"])(ForceAtlas2BasedRepulsionSolver)).call(this, body, physicsBody, options)); } /** @@ -38197,7 +42308,7 @@ return /******/ (function(modules) { // webpackBootstrap */ - _createClass(ForceAtlas2BasedRepulsionSolver, [{ + (0, _createClass3["default"])(ForceAtlas2BasedRepulsionSolver, [{ key: "_calculateForces", value: function _calculateForces(distance, dx, dy, node, parentBranch) { if (distance === 0) { @@ -38220,14 +42331,13 @@ return /******/ (function(modules) { // webpackBootstrap this.physicsBody.forces[node.id].y += fy; } }]); - return ForceAtlas2BasedRepulsionSolver; - }(_BarnesHutSolver3.default); + }(_BarnesHutSolver3["default"]); - exports.default = ForceAtlas2BasedRepulsionSolver; + exports["default"] = ForceAtlas2BasedRepulsionSolver; /***/ }, -/* 103 */ +/* 208 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -38236,27 +42346,38 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _getPrototypeOf = __webpack_require__(166); - var _CentralGravitySolver2 = __webpack_require__(101); + var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - var _CentralGravitySolver3 = _interopRequireDefault(_CentralGravitySolver2); + var _classCallCheck2 = __webpack_require__(115); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _createClass3 = _interopRequireDefault(_createClass2); - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + var _possibleConstructorReturn2 = __webpack_require__(169); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); + + var _inherits2 = __webpack_require__(170); + + var _inherits3 = _interopRequireDefault(_inherits2); + + var _CentralGravitySolver2 = __webpack_require__(206); + + var _CentralGravitySolver3 = _interopRequireDefault(_CentralGravitySolver2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } var ForceAtlas2BasedCentralGravitySolver = function (_CentralGravitySolver) { - _inherits(ForceAtlas2BasedCentralGravitySolver, _CentralGravitySolver); + (0, _inherits3["default"])(ForceAtlas2BasedCentralGravitySolver, _CentralGravitySolver); function ForceAtlas2BasedCentralGravitySolver(body, physicsBody, options) { - _classCallCheck(this, ForceAtlas2BasedCentralGravitySolver); - - return _possibleConstructorReturn(this, (ForceAtlas2BasedCentralGravitySolver.__proto__ || Object.getPrototypeOf(ForceAtlas2BasedCentralGravitySolver)).call(this, body, physicsBody, options)); + (0, _classCallCheck3["default"])(this, ForceAtlas2BasedCentralGravitySolver); + return (0, _possibleConstructorReturn3["default"])(this, (ForceAtlas2BasedCentralGravitySolver.__proto__ || (0, _getPrototypeOf2["default"])(ForceAtlas2BasedCentralGravitySolver)).call(this, body, physicsBody, options)); } /** @@ -38265,7 +42386,7 @@ return /******/ (function(modules) { // webpackBootstrap */ - _createClass(ForceAtlas2BasedCentralGravitySolver, [{ + (0, _createClass3["default"])(ForceAtlas2BasedCentralGravitySolver, [{ key: "_calculateForces", value: function _calculateForces(distance, dx, dy, forces, node) { if (distance > 0) { @@ -38276,14 +42397,13 @@ return /******/ (function(modules) { // webpackBootstrap } } }]); - return ForceAtlas2BasedCentralGravitySolver; - }(_CentralGravitySolver3.default); + }(_CentralGravitySolver3["default"]); - exports.default = ForceAtlas2BasedCentralGravitySolver; + exports["default"] = ForceAtlas2BasedCentralGravitySolver; /***/ }, -/* 104 */ +/* 209 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -38292,21 +42412,31 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + var _keys = __webpack_require__(58); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _keys2 = _interopRequireDefault(_keys); - var _NetworkUtil = __webpack_require__(105); + var _typeof2 = __webpack_require__(62); + + var _typeof3 = _interopRequireDefault(_typeof2); + + var _classCallCheck2 = __webpack_require__(115); + + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); + + var _createClass3 = _interopRequireDefault(_createClass2); + + var _NetworkUtil = __webpack_require__(210); var _NetworkUtil2 = _interopRequireDefault(_NetworkUtil); - var _Cluster = __webpack_require__(106); + var _Cluster = __webpack_require__(211); var _Cluster2 = _interopRequireDefault(_Cluster); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var util = __webpack_require__(1); @@ -38314,7 +42444,7 @@ return /******/ (function(modules) { // webpackBootstrap function ClusterEngine(body) { var _this = this; - _classCallCheck(this, ClusterEngine); + (0, _classCallCheck3['default'])(this, ClusterEngine); this.body = body; this.clusteredNodes = {}; @@ -38336,12 +42466,12 @@ return /******/ (function(modules) { // webpackBootstrap */ - _createClass(ClusterEngine, [{ + (0, _createClass3['default'])(ClusterEngine, [{ key: 'clusterByHubsize', value: function clusterByHubsize(hubsize, options) { if (hubsize === undefined) { hubsize = this._getHubSize(); - } else if ((typeof hubsize === 'undefined' ? 'undefined' : _typeof(hubsize)) === "object") { + } else if ((typeof hubsize === 'undefined' ? 'undefined' : (0, _typeof3['default'])(hubsize)) === "object") { options = this._checkOptions(hubsize); hubsize = this._getHubSize(); } @@ -38387,7 +42517,7 @@ return /******/ (function(modules) { // webpackBootstrap for (var i = 0; i < this.body.nodeIndices.length; i++) { var nodeId = this.body.nodeIndices[i]; var node = this.body.nodes[nodeId]; - var clonedOptions = _NetworkUtil2.default.cloneOptions(node); + var clonedOptions = _NetworkUtil2['default'].cloneOptions(node); if (options.joinCondition(clonedOptions) === true) { childNodesObj[nodeId] = this.body.nodes[nodeId]; @@ -38458,7 +42588,7 @@ return /******/ (function(modules) { // webpackBootstrap childNodesObj[childNodeId] = this.body.nodes[childNodeId]; usedNodes[nodeId] = true; } else { - var clonedOptions = _NetworkUtil2.default.cloneOptions(this.body.nodes[nodeId]); + var clonedOptions = _NetworkUtil2['default'].cloneOptions(this.body.nodes[nodeId]); if (options.joinCondition(clonedOptions) === true) { childEdgesObj[edge.id] = edge; childNodesObj[nodeId] = this.body.nodes[nodeId]; @@ -38472,7 +42602,7 @@ return /******/ (function(modules) { // webpackBootstrap } // add to the cluster queue - if (Object.keys(childNodesObj).length > 0 && Object.keys(childEdgesObj).length > 0 && gatheringSuccessful === true) { + if ((0, _keys2['default'])(childNodesObj).length > 0 && (0, _keys2['default'])(childEdgesObj).length > 0 && gatheringSuccessful === true) { clusters.push({ nodes: childNodesObj, edges: childEdgesObj }); } } @@ -38553,7 +42683,7 @@ return /******/ (function(modules) { // webpackBootstrap var childNodesObj = {}; var childEdgesObj = {}; var parentNodeId = node.id; - var parentClonedOptions = _NetworkUtil2.default.cloneOptions(node); + var parentClonedOptions = _NetworkUtil2['default'].cloneOptions(node); childNodesObj[parentNodeId] = node; // collect the nodes that will be in the cluster @@ -38570,7 +42700,7 @@ return /******/ (function(modules) { // webpackBootstrap childNodesObj[childNodeId] = this.body.nodes[childNodeId]; } else { // clone the options and insert some additional parameters that could be interesting. - var childClonedOptions = _NetworkUtil2.default.cloneOptions(this.body.nodes[childNodeId]); + var childClonedOptions = _NetworkUtil2['default'].cloneOptions(this.body.nodes[childNodeId]); if (options.joinCondition(parentClonedOptions, childClonedOptions) === true) { childEdgesObj[edge.id] = edge; childNodesObj[childNodeId] = this.body.nodes[childNodeId]; @@ -38583,7 +42713,7 @@ return /******/ (function(modules) { // webpackBootstrap } } } - var childNodeIDs = Object.keys(childNodesObj).map(function (childNode) { + var childNodeIDs = (0, _keys2['default'])(childNodesObj).map(function (childNode) { return childNodesObj[childNode].id; }); @@ -38622,7 +42752,7 @@ return /******/ (function(modules) { // webpackBootstrap // loop over all child nodes and their edges to find edges going out of the cluster // these edges will be replaced by clusterEdges. - var childKeys = Object.keys(childNodesObj); + var childKeys = (0, _keys2['default'])(childNodesObj); var createEdges = []; for (var i = 0; i < childKeys.length; i++) { childNodeId = childKeys[i]; @@ -38663,7 +42793,7 @@ return /******/ (function(modules) { // webpackBootstrap for (var _j2 = 0; _j2 < createEdges.length; _j2++) { var _edge = createEdges[_j2].edge; // copy the options of the edge we will replace - var clonedOptions = _NetworkUtil2.default.cloneOptions(_edge, 'edge'); + var clonedOptions = _NetworkUtil2['default'].cloneOptions(_edge, 'edge'); // make sure the properties of clusterEdges are superimposed on it util.deepExtend(clonedOptions, clusterEdgeProperties); @@ -38728,12 +42858,12 @@ return /******/ (function(modules) { // webpackBootstrap var refreshData = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true; // kill condition: no nodes don't bother - if (Object.keys(childNodesObj).length == 0) { + if ((0, _keys2['default'])(childNodesObj).length == 0) { return; } // allow clusters of 1 if options allow - if (Object.keys(childNodesObj).length == 1 && options.clusterNodeProperties.allowSingleNodeCluster != true) { + if ((0, _keys2['default'])(childNodesObj).length == 1 && options.clusterNodeProperties.allowSingleNodeCluster != true) { return; } @@ -38754,7 +42884,7 @@ return /******/ (function(modules) { // webpackBootstrap var childNodesOptions = []; for (var _nodeId in childNodesObj) { if (childNodesObj.hasOwnProperty(_nodeId)) { - var clonedOptions = _NetworkUtil2.default.cloneOptions(childNodesObj[_nodeId]); + var clonedOptions = _NetworkUtil2['default'].cloneOptions(childNodesObj[_nodeId]); childNodesOptions.push(clonedOptions); } } @@ -38765,7 +42895,7 @@ return /******/ (function(modules) { // webpackBootstrap if (childEdgesObj.hasOwnProperty(edgeId)) { // these cluster edges will be removed on creation of the cluster. if (edgeId.substr(0, 12) !== "clusterEdge:") { - var _clonedOptions = _NetworkUtil2.default.cloneOptions(childEdgesObj[edgeId], 'edge'); + var _clonedOptions = _NetworkUtil2['default'].cloneOptions(childEdgesObj[edgeId], 'edge'); childEdgesOptions.push(_clonedOptions); } } @@ -38804,7 +42934,7 @@ return /******/ (function(modules) { // webpackBootstrap clusterNodeProperties.id = clusterId; // create the clusterNode - var clusterNode = this.body.functions.createNode(clusterNodeProperties, _Cluster2.default); + var clusterNode = this.body.functions.createNode(clusterNodeProperties, _Cluster2['default']); clusterNode.isCluster = true; clusterNode.containedNodes = childNodesObj; clusterNode.containedEdges = childEdgesObj; @@ -38890,7 +43020,7 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: '_getClusterPosition', value: function _getClusterPosition(childNodesObj) { - var childKeys = Object.keys(childNodesObj); + var childKeys = (0, _keys2['default'])(childNodesObj); var minX = childNodesObj[childKeys[0]].x; var maxX = childNodesObj[childKeys[0]].x; var minY = childNodesObj[childKeys[0]].y; @@ -39020,7 +43150,7 @@ return /******/ (function(modules) { // webpackBootstrap } // clone the options and apply the cluster options to them - var clonedOptions = _NetworkUtil2.default.cloneOptions(transferEdge, 'edge'); + var clonedOptions = _NetworkUtil2['default'].cloneOptions(transferEdge, 'edge'); util.deepExtend(clonedOptions, otherCluster.clusterEdgeProperties); // apply the edge specific options to it. @@ -39254,14 +43384,13 @@ return /******/ (function(modules) { // webpackBootstrap return hubThreshold; } }]); - return ClusterEngine; }(); - exports.default = ClusterEngine; + exports['default'] = ClusterEngine; /***/ }, -/* 105 */ +/* 210 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -39270,15 +43399,21 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _classCallCheck2 = __webpack_require__(115); + + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); + + var _createClass3 = _interopRequireDefault(_createClass2); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } var util = __webpack_require__(1); var NetworkUtil = function () { function NetworkUtil() { - _classCallCheck(this, NetworkUtil); + (0, _classCallCheck3["default"])(this, NetworkUtil); } /** @@ -39286,7 +43421,7 @@ return /******/ (function(modules) { // webpackBootstrap */ - _createClass(NetworkUtil, null, [{ + (0, _createClass3["default"])(NetworkUtil, null, [{ key: "getRange", value: function getRange(allNodes) { var specificNodes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; @@ -39392,14 +43527,13 @@ return /******/ (function(modules) { // webpackBootstrap return clonedOptions; } }]); - return NetworkUtil; }(); - exports.default = NetworkUtil; + exports["default"] = NetworkUtil; /***/ }, -/* 106 */ +/* 211 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -39408,28 +43542,38 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _Node2 = __webpack_require__(67); + var _getPrototypeOf = __webpack_require__(166); - var _Node3 = _interopRequireDefault(_Node2); + var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var _classCallCheck2 = __webpack_require__(115); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + var _possibleConstructorReturn2 = __webpack_require__(169); - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); + + var _inherits2 = __webpack_require__(170); + + var _inherits3 = _interopRequireDefault(_inherits2); + + var _Node2 = __webpack_require__(159); + + var _Node3 = _interopRequireDefault(_Node2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } /** * */ var Cluster = function (_Node) { - _inherits(Cluster, _Node); + (0, _inherits3['default'])(Cluster, _Node); function Cluster(options, body, imagelist, grouplist, globalOptions) { - _classCallCheck(this, Cluster); + (0, _classCallCheck3['default'])(this, Cluster); - var _this = _possibleConstructorReturn(this, (Cluster.__proto__ || Object.getPrototypeOf(Cluster)).call(this, options, body, imagelist, grouplist, globalOptions)); + var _this = (0, _possibleConstructorReturn3['default'])(this, (Cluster.__proto__ || (0, _getPrototypeOf2['default'])(Cluster)).call(this, options, body, imagelist, grouplist, globalOptions)); _this.isCluster = true; _this.containedNodes = {}; @@ -39438,12 +43582,12 @@ return /******/ (function(modules) { // webpackBootstrap } return Cluster; - }(_Node3.default); + }(_Node3['default']); - exports.default = Cluster; + exports['default'] = Cluster; /***/ }, -/* 107 */ +/* 212 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -39452,9 +43596,15 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _classCallCheck2 = __webpack_require__(115); + + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _createClass2 = __webpack_require__(116); + + var _createClass3 = _interopRequireDefault(_createClass2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } if (typeof window !== 'undefined') { window.requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame; @@ -39464,7 +43614,7 @@ return /******/ (function(modules) { // webpackBootstrap var CanvasRenderer = function () { function CanvasRenderer(body, canvas) { - _classCallCheck(this, CanvasRenderer); + (0, _classCallCheck3['default'])(this, CanvasRenderer); this.body = body; this.canvas = canvas; @@ -39489,7 +43639,7 @@ return /******/ (function(modules) { // webpackBootstrap this.bindEventListeners(); } - _createClass(CanvasRenderer, [{ + (0, _createClass3['default'])(CanvasRenderer, [{ key: 'bindEventListeners', value: function bindEventListeners() { var _this = this; @@ -39498,10 +43648,10 @@ return /******/ (function(modules) { // webpackBootstrap _this.dragging = true; }); this.body.emitter.on("dragEnd", function () { - return _this.dragging = false; + _this.dragging = false; }); this.body.emitter.on("_resizeNodes", function () { - return _this._resizeNodes(); + _this._resizeNodes(); }); this.body.emitter.on("_redraw", function () { if (_this.renderingActive === false) { @@ -39809,14 +43959,13 @@ return /******/ (function(modules) { // webpackBootstrap } } }]); - return CanvasRenderer; }(); - exports.default = CanvasRenderer; + exports['default'] = CanvasRenderer; /***/ }, -/* 108 */ +/* 213 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -39825,12 +43974,18 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _classCallCheck2 = __webpack_require__(115); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - var Hammer = __webpack_require__(22); - var hammerUtil = __webpack_require__(30); + var _createClass2 = __webpack_require__(116); + + var _createClass3 = _interopRequireDefault(_createClass2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var Hammer = __webpack_require__(108); + var hammerUtil = __webpack_require__(121); var util = __webpack_require__(1); @@ -39844,7 +43999,7 @@ return /******/ (function(modules) { // webpackBootstrap var Canvas = function () { function Canvas(body) { - _classCallCheck(this, Canvas); + (0, _classCallCheck3['default'])(this, Canvas); this.body = body; this.pixelRatio = 1; @@ -39865,7 +44020,7 @@ return /******/ (function(modules) { // webpackBootstrap this.bindEventListeners(); } - _createClass(Canvas, [{ + (0, _createClass3['default'])(Canvas, [{ key: 'bindEventListeners', value: function bindEventListeners() { var _this = this; @@ -40279,14 +44434,13 @@ return /******/ (function(modules) { // webpackBootstrap return { x: this._XconvertDOMtoCanvas(pos.x), y: this._YconvertDOMtoCanvas(pos.y) }; } }]); - return Canvas; }(); - exports.default = Canvas; + exports['default'] = Canvas; /***/ }, -/* 109 */ +/* 214 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -40295,15 +44449,19 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _classCallCheck2 = __webpack_require__(115); - var _NetworkUtil = __webpack_require__(105); + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - var _NetworkUtil2 = _interopRequireDefault(_NetworkUtil); + var _createClass2 = __webpack_require__(116); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var _createClass3 = _interopRequireDefault(_createClass2); + + var _NetworkUtil = __webpack_require__(210); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _NetworkUtil2 = _interopRequireDefault(_NetworkUtil); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var util = __webpack_require__(1); @@ -40311,7 +44469,7 @@ return /******/ (function(modules) { // webpackBootstrap function View(body, canvas) { var _this = this; - _classCallCheck(this, View); + (0, _classCallCheck3['default'])(this, View); this.body = body; this.canvas = canvas; @@ -40336,7 +44494,7 @@ return /******/ (function(modules) { // webpackBootstrap this.body.emitter.on("unlockNode", this.releaseNode.bind(this)); } - _createClass(View, [{ + (0, _createClass3['default'])(View, [{ key: 'setOptions', value: function setOptions() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; @@ -40378,7 +44536,7 @@ return /******/ (function(modules) { // webpackBootstrap return; } - range = _NetworkUtil2.default.getRange(this.body.nodes, options.nodes); + range = _NetworkUtil2['default'].getRange(this.body.nodes, options.nodes); var numberOfNodes = this.body.nodeIndices.length; zoomLevel = 12.662 / (numberOfNodes + 7.4147) + 0.0964822; // this is obtained from fitting a dataset from 5 points with scale levels that looked good. @@ -40388,7 +44546,7 @@ return /******/ (function(modules) { // webpackBootstrap zoomLevel *= factor; } else { this.body.emitter.emit("_resizeNodes"); - range = _NetworkUtil2.default.getRange(this.body.nodes, options.nodes); + range = _NetworkUtil2['default'].getRange(this.body.nodes, options.nodes); var xDistance = Math.abs(range.maxX - range.minX) * 1.1; var yDistance = Math.abs(range.maxY - range.minY) * 1.1; @@ -40405,7 +44563,7 @@ return /******/ (function(modules) { // webpackBootstrap zoomLevel = 1.0; } - var center = _NetworkUtil2.default.findCenter(range); + var center = _NetworkUtil2['default'].findCenter(range); var animationOptions = { position: center, scale: zoomLevel, animation: options.animation }; this.moveTo(animationOptions); } @@ -40629,14 +44787,13 @@ return /******/ (function(modules) { // webpackBootstrap return this.canvas.DOMtoCanvas({ x: 0.5 * this.canvas.frame.canvas.clientWidth, y: 0.5 * this.canvas.frame.canvas.clientHeight }); } }]); - return View; }(); - exports.default = View; + exports['default'] = View; /***/ }, -/* 110 */ +/* 215 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -40645,30 +44802,34 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _classCallCheck2 = __webpack_require__(115); - var _NavigationHandler = __webpack_require__(111); + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); + + var _createClass3 = _interopRequireDefault(_createClass2); + + var _NavigationHandler = __webpack_require__(216); var _NavigationHandler2 = _interopRequireDefault(_NavigationHandler); - var _Popup = __webpack_require__(112); + var _Popup = __webpack_require__(128); var _Popup2 = _interopRequireDefault(_Popup); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var util = __webpack_require__(1); var InteractionHandler = function () { function InteractionHandler(body, canvas, selectionHandler) { - _classCallCheck(this, InteractionHandler); + (0, _classCallCheck3['default'])(this, InteractionHandler); this.body = body; this.canvas = canvas; this.selectionHandler = selectionHandler; - this.navigationHandler = new _NavigationHandler2.default(body, canvas); + this.navigationHandler = new _NavigationHandler2['default'](body, canvas); // bind the events from hammer to functions in this object this.body.eventListeners.onTap = this.onTap.bind(this); @@ -40712,7 +44873,7 @@ return /******/ (function(modules) { // webpackBootstrap this.bindEventListeners(); } - _createClass(InteractionHandler, [{ + (0, _createClass3['default'])(InteractionHandler, [{ key: 'bindEventListeners', value: function bindEventListeners() { var _this = this; @@ -41166,9 +45327,9 @@ return /******/ (function(modules) { // webpackBootstrap this.body.emitter.emit('_requestRedraw'); if (scaleOld < scale) { - this.body.emitter.emit('zoom', { direction: '+', scale: this.body.view.scale }); + this.body.emitter.emit('zoom', { direction: '+', scale: this.body.view.scale, pointer: pointer }); } else { - this.body.emitter.emit('zoom', { direction: '-', scale: this.body.view.scale }); + this.body.emitter.emit('zoom', { direction: '-', scale: this.body.view.scale, pointer: pointer }); } } } @@ -41355,7 +45516,7 @@ return /******/ (function(modules) { // webpackBootstrap // show popup message window if (this.popupObj.id !== previousPopupObjId) { if (this.popup === undefined) { - this.popup = new _Popup2.default(this.canvas.frame); + this.popup = new _Popup2['default'](this.canvas.frame); } this.popup.popupTargetType = popupType; @@ -41398,7 +45559,7 @@ return /******/ (function(modules) { // webpackBootstrap // we initially only check stillOnObj because this is much faster. if (stillOnObj === true) { var overNode = this.selectionHandler.getNodeAt(pointer); - stillOnObj = overNode.id === this.popup.popupTargetId; + stillOnObj = overNode === undefined ? false : overNode.id === this.popup.popupTargetId; } } } else { @@ -41416,14 +45577,13 @@ return /******/ (function(modules) { // webpackBootstrap } } }]); - return InteractionHandler; }(); - exports.default = InteractionHandler; + exports['default'] = InteractionHandler; /***/ }, -/* 111 */ +/* 216 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -41432,20 +45592,26 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _classCallCheck2 = __webpack_require__(115); + + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _createClass3 = _interopRequireDefault(_createClass2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var util = __webpack_require__(1); - var Hammer = __webpack_require__(22); - var hammerUtil = __webpack_require__(30); - var keycharm = __webpack_require__(25); + var Hammer = __webpack_require__(108); + var hammerUtil = __webpack_require__(121); + var keycharm = __webpack_require__(111); var NavigationHandler = function () { function NavigationHandler(body, canvas) { var _this = this; - _classCallCheck(this, NavigationHandler); + (0, _classCallCheck3['default'])(this, NavigationHandler); this.body = body; this.canvas = canvas; @@ -41471,7 +45637,7 @@ return /******/ (function(modules) { // webpackBootstrap this.options = {}; } - _createClass(NavigationHandler, [{ + (0, _createClass3['default'])(NavigationHandler, [{ key: 'setOptions', value: function setOptions(options) { if (options !== undefined) { @@ -41644,7 +45810,7 @@ return /******/ (function(modules) { // webpackBootstrap this.body.view.scale = scale; this.body.view.translation = { x: tx, y: ty }; - this.body.emitter.emit('zoom', { direction: '+', scale: this.body.view.scale }); + this.body.emitter.emit('zoom', { direction: '+', scale: this.body.view.scale, pointer: pointer }); } }, { key: '_zoomOut', @@ -41658,7 +45824,7 @@ return /******/ (function(modules) { // webpackBootstrap this.body.view.scale = scale; this.body.view.translation = { x: tx, y: ty }; - this.body.emitter.emit('zoom', { direction: '-', scale: this.body.view.scale }); + this.body.emitter.emit('zoom', { direction: '-', scale: this.body.view.scale, pointer: pointer }); } /** @@ -41761,15 +45927,14 @@ return /******/ (function(modules) { // webpackBootstrap } } }]); - return NavigationHandler; }(); - exports.default = NavigationHandler; + exports['default'] = NavigationHandler; /***/ }, -/* 112 */ -/***/ function(module, exports) { +/* 217 */ +/***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -41777,148 +45942,23 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _classCallCheck2 = __webpack_require__(115); - /** - * Popup is a class to create a popup window with some text - * @param {Element} container The container object. - * @param {Number} [x] - * @param {Number} [y] - * @param {String} [text] - * @param {Object} [style] An object containing borderColor, - * backgroundColor, etc. - */ - var Popup = function () { - function Popup(container) { - _classCallCheck(this, Popup); + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - this.container = container; + var _createClass2 = __webpack_require__(116); - this.x = 0; - this.y = 0; - this.padding = 5; - this.hidden = false; + var _createClass3 = _interopRequireDefault(_createClass2); - // create the frame - this.frame = document.createElement('div'); - this.frame.className = 'vis-network-tooltip'; - this.container.appendChild(this.frame); - } - - /** - * @param {number} x Horizontal position of the popup window - * @param {number} y Vertical position of the popup window - */ - - - _createClass(Popup, [{ - key: 'setPosition', - value: function setPosition(x, y) { - this.x = parseInt(x); - this.y = parseInt(y); - } - - /** - * Set the content for the popup window. This can be HTML code or text. - * @param {string | Element} content - */ - - }, { - key: 'setText', - value: function setText(content) { - if (content instanceof Element) { - this.frame.innerHTML = ''; - this.frame.appendChild(content); - } else { - this.frame.innerHTML = content; // string containing text or HTML - } - } - - /** - * Show the popup window - * @param {boolean} [doShow] Show or hide the window - */ - - }, { - key: 'show', - value: function show(doShow) { - if (doShow === undefined) { - doShow = true; - } - - if (doShow === true) { - var height = this.frame.clientHeight; - var width = this.frame.clientWidth; - var maxHeight = this.frame.parentNode.clientHeight; - var maxWidth = this.frame.parentNode.clientWidth; - - var top = this.y - height; - if (top + height + this.padding > maxHeight) { - top = maxHeight - height - this.padding; - } - if (top < this.padding) { - top = this.padding; - } - - var left = this.x; - if (left + width + this.padding > maxWidth) { - left = maxWidth - width - this.padding; - } - if (left < this.padding) { - left = this.padding; - } - - this.frame.style.left = left + "px"; - this.frame.style.top = top + "px"; - this.frame.style.visibility = "visible"; - this.hidden = false; - } else { - this.hide(); - } - } - - /** - * Hide the popup window - */ - - }, { - key: 'hide', - value: function hide() { - this.hidden = true; - this.frame.style.visibility = "hidden"; - } - }]); - - return Popup; - }(); - - exports.default = Popup; - -/***/ }, -/* 113 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - var _Node = __webpack_require__(67); + var _Node = __webpack_require__(159); var _Node2 = _interopRequireDefault(_Node); - var _Edge = __webpack_require__(87); + var _Edge = __webpack_require__(192); var _Edge2 = _interopRequireDefault(_Edge); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var util = __webpack_require__(1); @@ -41926,7 +45966,7 @@ return /******/ (function(modules) { // webpackBootstrap function SelectionHandler(body, canvas) { var _this = this; - _classCallCheck(this, SelectionHandler); + (0, _classCallCheck3['default'])(this, SelectionHandler); this.body = body; this.canvas = canvas; @@ -41947,7 +45987,7 @@ return /******/ (function(modules) { // webpackBootstrap }); } - _createClass(SelectionHandler, [{ + (0, _createClass3['default'])(SelectionHandler, [{ key: 'setOptions', value: function setOptions(options) { if (options !== undefined) { @@ -42028,7 +46068,7 @@ return /******/ (function(modules) { // webpackBootstrap var highlightEdges = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.options.selectConnectedEdges; if (obj !== undefined) { - if (obj instanceof _Node2.default) { + if (obj instanceof _Node2['default']) { if (highlightEdges === true) { this._selectConnectedEdges(obj); } @@ -42205,7 +46245,7 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: '_addToSelection', value: function _addToSelection(obj) { - if (obj instanceof _Node2.default) { + if (obj instanceof _Node2['default']) { this.selectionObj.nodes[obj.id] = obj; } else { this.selectionObj.edges[obj.id] = obj; @@ -42222,7 +46262,7 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: '_addToHover', value: function _addToHover(obj) { - if (obj instanceof _Node2.default) { + if (obj instanceof _Node2['default']) { this.hoverObj.nodes[obj.id] = obj; } else { this.hoverObj.edges[obj.id] = obj; @@ -42239,7 +46279,7 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: '_removeFromSelection', value: function _removeFromSelection(obj) { - if (obj instanceof _Node2.default) { + if (obj instanceof _Node2['default']) { delete this.selectionObj.nodes[obj.id]; this._unselectConnectedEdges(obj); } else { @@ -42473,7 +46513,7 @@ return /******/ (function(modules) { // webpackBootstrap value: function blurObject(object) { if (object.hover === true) { object.hover = false; - if (object instanceof _Node2.default) { + if (object instanceof _Node2['default']) { this.body.emitter.emit("blurNode", { node: object.id }); } else { this.body.emitter.emit("blurEdge", { edge: object.id }); @@ -42496,7 +46536,7 @@ return /******/ (function(modules) { // webpackBootstrap // remove all node hover highlights for (var nodeId in this.hoverObj.nodes) { if (this.hoverObj.nodes.hasOwnProperty(nodeId)) { - if (object === undefined || object instanceof _Node2.default && object.id != nodeId || object instanceof _Edge2.default) { + if (object === undefined || object instanceof _Node2['default'] && object.id != nodeId || object instanceof _Edge2['default']) { this.blurObject(this.hoverObj.nodes[nodeId]); delete this.hoverObj.nodes[nodeId]; hoverChanged = true; @@ -42514,8 +46554,8 @@ return /******/ (function(modules) { // webpackBootstrap delete this.hoverObj.edges[edgeId]; } // if the blur remains the same and the object is undefined (mouse off) or another - // edge has been hovered, we blur the edge - else if (object === undefined || object instanceof _Edge2.default) { + // edge has been hovered, or another node has been hovered we blur the edge. + else if (object === undefined || object instanceof _Edge2['default'] && object.id != edgeId || object instanceof _Node2['default'] && !object.hover) { this.blurObject(this.hoverObj.edges[edgeId]); delete this.hoverObj.edges[edgeId]; hoverChanged = true; @@ -42528,13 +46568,13 @@ return /******/ (function(modules) { // webpackBootstrap object.hover = true; this._addToHover(object); hoverChanged = true; - if (object instanceof _Node2.default) { + if (object instanceof _Node2['default']) { this.body.emitter.emit("hoverNode", { node: object.id }); } else { this.body.emitter.emit("hoverEdge", { edge: object.id }); } } - if (object instanceof _Node2.default && this.options.hoverConnectedEdges === true) { + if (object instanceof _Node2['default'] && this.options.hoverConnectedEdges === true) { this._hoverConnectedEdges(object); } } @@ -42701,14 +46741,13 @@ return /******/ (function(modules) { // webpackBootstrap } } }]); - return SelectionHandler; }(); - exports.default = SelectionHandler; + exports['default'] = SelectionHandler; /***/ }, -/* 114 */ +/* 218 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -42717,25 +46756,37 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + var _keys = __webpack_require__(58); - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + var _keys2 = _interopRequireDefault(_keys); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _slicedToArray2 = __webpack_require__(161); - var _NetworkUtil = __webpack_require__(105); + var _slicedToArray3 = _interopRequireDefault(_slicedToArray2); - var _NetworkUtil2 = _interopRequireDefault(_NetworkUtil); + var _typeof2 = __webpack_require__(62); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var _typeof3 = _interopRequireDefault(_typeof2); + + var _classCallCheck2 = __webpack_require__(115); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); + + var _createClass3 = _interopRequireDefault(_createClass2); + + var _NetworkUtil = __webpack_require__(210); + + var _NetworkUtil2 = _interopRequireDefault(_NetworkUtil); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var util = __webpack_require__(1); var LayoutEngine = function () { function LayoutEngine(body) { - _classCallCheck(this, LayoutEngine); + (0, _classCallCheck3['default'])(this, LayoutEngine); this.body = body; @@ -42764,7 +46815,7 @@ return /******/ (function(modules) { // webpackBootstrap this.bindEventListeners(); } - _createClass(LayoutEngine, [{ + (0, _createClass3['default'])(LayoutEngine, [{ key: 'bindEventListeners', value: function bindEventListeners() { var _this = this; @@ -42832,7 +46883,7 @@ return /******/ (function(modules) { // webpackBootstrap }; this.optionsBackup.physics.enabled = this.optionsBackup.physics.enabled === undefined ? true : this.optionsBackup.physics.enabled; this.optionsBackup.physics.solver = this.optionsBackup.physics.solver || 'barnesHut'; - } else if (_typeof(allOptions.physics) === 'object') { + } else if ((0, _typeof3['default'])(allOptions.physics) === 'object') { this.optionsBackup.physics.enabled = allOptions.physics.enabled === undefined ? true : allOptions.physics.enabled; this.optionsBackup.physics.solver = allOptions.physics.solver || 'barnesHut'; allOptions.physics.solver = 'hierarchicalRepulsion'; @@ -42994,8 +47045,8 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: '_shiftToCenter', value: function _shiftToCenter() { - var range = _NetworkUtil2.default.getRangeCore(this.body.nodes, this.body.nodeIndices); - var center = _NetworkUtil2.default.findCenter(range); + var range = _NetworkUtil2['default'].getRangeCore(this.body.nodes, this.body.nodeIndices); + var center = _NetworkUtil2['default'].findCenter(range); for (var i = 0; i < this.body.nodeIndices.length; i++) { this.body.nodes[this.body.nodeIndices[i]].x -= center.x; this.body.nodes[this.body.nodeIndices[i]].y -= center.y; @@ -43200,7 +47251,7 @@ return /******/ (function(modules) { // webpackBootstrap // get the space around the node. var _getSpaceAroundNode2 = _this2._getSpaceAroundNode(node, branchMap), - _getSpaceAroundNode3 = _slicedToArray(_getSpaceAroundNode2, 2), + _getSpaceAroundNode3 = (0, _slicedToArray3['default'])(_getSpaceAroundNode2, 2), minSpaceNode = _getSpaceAroundNode3[0], maxSpaceNode = _getSpaceAroundNode3[1]; @@ -43294,14 +47345,14 @@ return /******/ (function(modules) { // webpackBootstrap var maxLevel = getCollisionLevel(node1, node2); var _getBranchBoundary = getBranchBoundary(branchNodes1, maxLevel), - _getBranchBoundary2 = _slicedToArray(_getBranchBoundary, 4), + _getBranchBoundary2 = (0, _slicedToArray3['default'])(_getBranchBoundary, 4), min1 = _getBranchBoundary2[0], max1 = _getBranchBoundary2[1], minSpace1 = _getBranchBoundary2[2], maxSpace1 = _getBranchBoundary2[3]; var _getBranchBoundary3 = getBranchBoundary(branchNodes2, maxLevel), - _getBranchBoundary4 = _slicedToArray(_getBranchBoundary3, 4), + _getBranchBoundary4 = (0, _slicedToArray3['default'])(_getBranchBoundary3, 4), min2 = _getBranchBoundary4[0], max2 = _getBranchBoundary4[1], minSpace2 = _getBranchBoundary4[2], @@ -43409,7 +47460,7 @@ return /******/ (function(modules) { // webpackBootstrap } var _getBranchBoundary5 = getBranchBoundary(branches[node.id]), - _getBranchBoundary6 = _slicedToArray(_getBranchBoundary5, 4), + _getBranchBoundary6 = (0, _slicedToArray3['default'])(_getBranchBoundary5, 4), minBranch = _getBranchBoundary6[0], maxBranch = _getBranchBoundary6[1], minSpaceBranch = _getBranchBoundary6[2], @@ -43439,7 +47490,7 @@ return /******/ (function(modules) { // webpackBootstrap // position node if there is space var _getSpaceAroundNode4 = _this2._getSpaceAroundNode(node), - _getSpaceAroundNode5 = _slicedToArray(_getSpaceAroundNode4, 2), + _getSpaceAroundNode5 = (0, _slicedToArray3['default'])(_getSpaceAroundNode4, 2), minSpace = _getSpaceAroundNode5[0], maxSpace = _getSpaceAroundNode5[1]; @@ -43469,7 +47520,7 @@ return /******/ (function(modules) { // webpackBootstrap // method to remove whitespace between branches. Because we do bottom up, we can center the parents. var minimizeEdgeLengthBottomUp = function minimizeEdgeLengthBottomUp(iterations) { - var levels = Object.keys(_this2.distributionOrdering); + var levels = (0, _keys2['default'])(_this2.distributionOrdering); levels = levels.reverse(); for (var i = 0; i < iterations; i++) { stillShifting = false; @@ -43489,7 +47540,7 @@ return /******/ (function(modules) { // webpackBootstrap // method to remove whitespace between branches. Because we do bottom up, we can center the parents. var shiftBranchesCloserBottomUp = function shiftBranchesCloserBottomUp(iterations) { - var levels = Object.keys(_this2.distributionOrdering); + var levels = (0, _keys2['default'])(_this2.distributionOrdering); levels = levels.reverse(); for (var i = 0; i < iterations; i++) { stillShifting = false; @@ -43510,7 +47561,7 @@ return /******/ (function(modules) { // webpackBootstrap // center all parents var centerAllParentsBottomUp = function centerAllParentsBottomUp() { - var levels = Object.keys(_this2.distributionOrdering); + var levels = (0, _keys2['default'])(_this2.distributionOrdering); levels = levels.reverse(); for (var i = 0; i < levels.length; i++) { var level = levels[i]; @@ -43613,7 +47664,7 @@ return /******/ (function(modules) { // webpackBootstrap var position = this._getPositionForHierarchy(parentNode); var _getSpaceAroundNode6 = this._getSpaceAroundNode(parentNode), - _getSpaceAroundNode7 = _slicedToArray(_getSpaceAroundNode6, 2), + _getSpaceAroundNode7 = (0, _slicedToArray3['default'])(_getSpaceAroundNode6, 2), minSpace = _getSpaceAroundNode7[0], maxSpace = _getSpaceAroundNode7[1]; @@ -43642,7 +47693,7 @@ return /******/ (function(modules) { // webpackBootstrap for (var level in distribution) { if (distribution.hasOwnProperty(level)) { // sort nodes in level by position: - var nodeArray = Object.keys(distribution[level]); + var nodeArray = (0, _keys2['default'])(distribution[level]); nodeArray = this._indexArrayToNodes(nodeArray); this._sortNodeArray(nodeArray); var handledNodeCount = 0; @@ -43891,7 +47942,7 @@ return /******/ (function(modules) { // webpackBootstrap _this4.hierarchicalLevels[nodeA.id] = minLevel; } - var diff = customCallback(_NetworkUtil2.default.cloneOptions(nodeA, 'node'), _NetworkUtil2.default.cloneOptions(nodeB, 'node'), _NetworkUtil2.default.cloneOptions(edge, 'edge')); + var diff = customCallback(_NetworkUtil2['default'].cloneOptions(nodeA, 'node'), _NetworkUtil2['default'].cloneOptions(nodeB, 'node'), _NetworkUtil2['default'].cloneOptions(edge, 'edge')); _this4.hierarchicalLevels[nodeB.id] = _this4.hierarchicalLevels[nodeA.id] + diff; }; @@ -44187,14 +48238,13 @@ return /******/ (function(modules) { // webpackBootstrap } } }]); - return LayoutEngine; }(); - exports.default = LayoutEngine; + exports['default'] = LayoutEngine; /***/ }, -/* 115 */ +/* 219 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -44203,13 +48253,31 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _keys = __webpack_require__(58); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _keys2 = _interopRequireDefault(_keys); + + var _stringify = __webpack_require__(82); + + var _stringify2 = _interopRequireDefault(_stringify); + + var _typeof2 = __webpack_require__(62); + + var _typeof3 = _interopRequireDefault(_typeof2); + + var _classCallCheck2 = __webpack_require__(115); + + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + + var _createClass2 = __webpack_require__(116); + + var _createClass3 = _interopRequireDefault(_createClass2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var util = __webpack_require__(1); - var Hammer = __webpack_require__(22); - var hammerUtil = __webpack_require__(30); + var Hammer = __webpack_require__(108); + var hammerUtil = __webpack_require__(121); /** * clears the toolbar div element of children @@ -44221,7 +48289,7 @@ return /******/ (function(modules) { // webpackBootstrap function ManipulationSystem(body, canvas, selectionHandler) { var _this = this; - _classCallCheck(this, ManipulationSystem); + (0, _classCallCheck3['default'])(this, ManipulationSystem); this.body = body; this.canvas = canvas; @@ -44275,7 +48343,7 @@ return /******/ (function(modules) { // webpackBootstrap */ - _createClass(ManipulationSystem, [{ + (0, _createClass3['default'])(ManipulationSystem, [{ key: '_restore', value: function _restore() { if (this.inMode !== false) { @@ -44579,6 +48647,14 @@ return /******/ (function(modules) { // webpackBootstrap this._clean(); this.inMode = 'editEdge'; + if ((0, _typeof3['default'])(this.options.editEdge) === 'object' && typeof this.options.editEdge.editWithoutDrag === "function") { + this.edgeBeingEditedId = this.selectionHandler.getSelectedEdges()[0]; + if (this.edgeBeingEditedId !== undefined) { + var edge = this.body.edges[this.edgeBeingEditedId]; + this._performEditEdge(edge.from, edge.to); + return; + } + } if (this.guiEnabled === true) { var locale = this.options.locales[this.options.locale]; this.manipulationDOM = {}; @@ -45019,7 +49095,7 @@ return /******/ (function(modules) { // webpackBootstrap this.temporaryUIFunctions[UIfunctionName] = this.body.eventListeners[UIfunctionName]; this.body.eventListeners[UIfunctionName] = newFunction; } else { - throw new Error('This UI function does not exist. Typo? You tried: ' + UIfunctionName + ' possible are: ' + JSON.stringify(Object.keys(this.body.eventListeners))); + throw new Error('This UI function does not exist. Typo? You tried: ' + UIfunctionName + ' possible are: ' + (0, _stringify2['default'])((0, _keys2['default'])(this.body.eventListeners))); } } @@ -45419,14 +49495,19 @@ return /******/ (function(modules) { // webpackBootstrap value: function _performEditEdge(sourceNodeId, targetNodeId) { var _this7 = this; - var defaultData = { id: this.edgeBeingEditedId, from: sourceNodeId, to: targetNodeId }; - if (typeof this.options.editEdge === 'function') { - if (this.options.editEdge.length === 2) { - this.options.editEdge(defaultData, function (finalizedData) { + var defaultData = { id: this.edgeBeingEditedId, from: sourceNodeId, to: targetNodeId, label: this.body.data.edges._data[this.edgeBeingEditedId].label }; + var eeFunct = this.options.editEdge; + if ((typeof eeFunct === 'undefined' ? 'undefined' : (0, _typeof3['default'])(eeFunct)) === 'object') { + eeFunct = eeFunct.editWithoutDrag; + } + if (typeof eeFunct === 'function') { + if (eeFunct.length === 2) { + eeFunct(defaultData, function (finalizedData) { if (finalizedData === null || finalizedData === undefined || _this7.inMode !== 'editEdge') { // if for whatever reason the mode has changes (due to dataset change) disregard the callback) { _this7.body.edges[defaultData.id].updateEdgeType(); _this7.body.emitter.emit('_redraw'); + _this7.showManipulatorToolbar(); } else { _this7.body.data.edges.getDataSet().update(finalizedData); _this7.selectionHandler.unselectAll(); @@ -45443,14 +49524,13 @@ return /******/ (function(modules) { // webpackBootstrap } } }]); - return ManipulationSystem; }(); - exports.default = ManipulationSystem; + exports['default'] = ManipulationSystem; /***/ }, -/* 116 */ +/* 220 */ /***/ function(module, exports) { 'use strict'; @@ -45466,7 +49546,7 @@ return /******/ (function(modules) { // webpackBootstrap * __type__ is a required field for all objects and contains the allowed types of all objects */ var string = 'string'; - var boolean = 'boolean'; + var bool = 'boolean'; var number = 'number'; var array = 'array'; var object = 'object'; // should only be in a __type__ property @@ -45475,29 +49555,34 @@ return /******/ (function(modules) { // webpackBootstrap var allOptions = { configure: { - enabled: { boolean: boolean }, - filter: { boolean: boolean, string: string, array: array, 'function': 'function' }, + enabled: { boolean: bool }, + filter: { boolean: bool, string: string, array: array, 'function': 'function' }, container: { dom: dom }, - showButton: { boolean: boolean }, - __type__: { object: object, boolean: boolean, string: string, array: array, 'function': 'function' } + showButton: { boolean: bool }, + __type__: { object: object, boolean: bool, string: string, array: array, 'function': 'function' } }, edges: { arrows: { - to: { enabled: { boolean: boolean }, scaleFactor: { number: number }, type: { string: ['arrow', 'circle'] }, __type__: { object: object, boolean: boolean } }, - middle: { enabled: { boolean: boolean }, scaleFactor: { number: number }, type: { string: ['arrow', 'circle'] }, __type__: { object: object, boolean: boolean } }, - from: { enabled: { boolean: boolean }, scaleFactor: { number: number }, type: { string: ['arrow', 'circle'] }, __type__: { object: object, boolean: boolean } }, + to: { enabled: { boolean: bool }, scaleFactor: { number: number }, type: { string: ['arrow', 'circle'] }, __type__: { object: object, boolean: bool } }, + middle: { enabled: { boolean: bool }, scaleFactor: { number: number }, type: { string: ['arrow', 'circle'] }, __type__: { object: object, boolean: bool } }, + from: { enabled: { boolean: bool }, scaleFactor: { number: number }, type: { string: ['arrow', 'circle'] }, __type__: { object: object, boolean: bool } }, __type__: { string: ['from', 'to', 'middle'], object: object } }, - arrowStrikethrough: { boolean: boolean }, + arrowStrikethrough: { boolean: bool }, + chosen: { + label: { boolean: bool, 'function': 'function' }, + edge: { boolean: bool, 'function': 'function' }, + __type__: { object: object, boolean: bool } + }, color: { color: { string: string }, highlight: { string: string }, hover: { string: string }, - inherit: { string: ['from', 'to', 'both'], boolean: boolean }, + inherit: { string: ['from', 'to', 'both'], boolean: bool }, opacity: { number: number }, __type__: { object: object, string: string } }, - dashes: { boolean: boolean, array: array }, + dashes: { boolean: bool, array: array }, font: { color: { string: string }, size: { number: number }, // px @@ -45506,24 +49591,58 @@ return /******/ (function(modules) { // webpackBootstrap strokeWidth: { number: number }, // px strokeColor: { string: string }, align: { string: ['horizontal', 'top', 'middle', 'bottom'] }, + vadjust: { number: number }, + multi: { boolean: bool, string: string }, + bold: { + color: { string: string }, + size: { number: number }, // px + face: { string: string }, + mod: { string: string }, + vadjust: { number: number }, + __type__: { object: object, string: string } + }, + boldital: { + color: { string: string }, + size: { number: number }, // px + face: { string: string }, + mod: { string: string }, + vadjust: { number: number }, + __type__: { object: object, string: string } + }, + ital: { + color: { string: string }, + size: { number: number }, // px + face: { string: string }, + mod: { string: string }, + vadjust: { number: number }, + __type__: { object: object, string: string } + }, + mono: { + color: { string: string }, + size: { number: number }, // px + face: { string: string }, + mod: { string: string }, + vadjust: { number: number }, + __type__: { object: object, string: string } + }, __type__: { object: object, string: string } }, - hidden: { boolean: boolean }, + hidden: { boolean: bool }, hoverWidth: { 'function': 'function', number: number }, label: { string: string, 'undefined': 'undefined' }, - labelHighlightBold: { boolean: boolean }, + labelHighlightBold: { boolean: bool }, length: { number: number, 'undefined': 'undefined' }, - physics: { boolean: boolean }, + physics: { boolean: bool }, scaling: { min: { number: number }, max: { number: number }, label: { - enabled: { boolean: boolean }, + enabled: { boolean: bool }, min: { number: number }, max: { number: number }, maxVisible: { number: number }, drawThreshold: { number: number }, - __type__: { object: object, boolean: boolean } + __type__: { object: object, boolean: bool } }, customScalingFunction: { 'function': 'function' }, __type__: { object: object } @@ -45531,84 +49650,96 @@ return /******/ (function(modules) { // webpackBootstrap selectionWidth: { 'function': 'function', number: number }, selfReferenceSize: { number: number }, shadow: { - enabled: { boolean: boolean }, + enabled: { boolean: bool }, color: { string: string }, size: { number: number }, x: { number: number }, y: { number: number }, - __type__: { object: object, boolean: boolean } + __type__: { object: object, boolean: bool } }, smooth: { - enabled: { boolean: boolean }, + enabled: { boolean: bool }, type: { string: ['dynamic', 'continuous', 'discrete', 'diagonalCross', 'straightCross', 'horizontal', 'vertical', 'curvedCW', 'curvedCCW', 'cubicBezier'] }, roundness: { number: number }, - forceDirection: { string: ['horizontal', 'vertical', 'none'], boolean: boolean }, - __type__: { object: object, boolean: boolean } + forceDirection: { string: ['horizontal', 'vertical', 'none'], boolean: bool }, + __type__: { object: object, boolean: bool } }, title: { string: string, 'undefined': 'undefined' }, width: { number: number }, + widthConstraint: { + maximum: { number: number }, + __type__: { object: object, boolean: bool, number: number } + }, value: { number: number, 'undefined': 'undefined' }, __type__: { object: object } }, groups: { - useDefaultGroups: { boolean: boolean }, + useDefaultGroups: { boolean: bool }, __any__: 'get from nodes, will be overwritten below', __type__: { object: object } }, interaction: { - dragNodes: { boolean: boolean }, - dragView: { boolean: boolean }, - hideEdgesOnDrag: { boolean: boolean }, - hideNodesOnDrag: { boolean: boolean }, - hover: { boolean: boolean }, + dragNodes: { boolean: bool }, + dragView: { boolean: bool }, + hideEdgesOnDrag: { boolean: bool }, + hideNodesOnDrag: { boolean: bool }, + hover: { boolean: bool }, keyboard: { - enabled: { boolean: boolean }, + enabled: { boolean: bool }, speed: { x: { number: number }, y: { number: number }, zoom: { number: number }, __type__: { object: object } }, - bindToWindow: { boolean: boolean }, - __type__: { object: object, boolean: boolean } + bindToWindow: { boolean: bool }, + __type__: { object: object, boolean: bool } }, - multiselect: { boolean: boolean }, - navigationButtons: { boolean: boolean }, - selectable: { boolean: boolean }, - selectConnectedEdges: { boolean: boolean }, - hoverConnectedEdges: { boolean: boolean }, + multiselect: { boolean: bool }, + navigationButtons: { boolean: bool }, + selectable: { boolean: bool }, + selectConnectedEdges: { boolean: bool }, + hoverConnectedEdges: { boolean: bool }, tooltipDelay: { number: number }, - zoomView: { boolean: boolean }, + zoomView: { boolean: bool }, __type__: { object: object } }, layout: { randomSeed: { 'undefined': 'undefined', number: number }, - improvedLayout: { boolean: boolean }, + improvedLayout: { boolean: bool }, hierarchical: { - enabled: { boolean: boolean }, + enabled: { boolean: bool }, levelSeparation: { number: number }, nodeSpacing: { number: number }, treeSpacing: { number: number }, - blockShifting: { boolean: boolean }, - edgeMinimization: { boolean: boolean }, - parentCentralization: { boolean: boolean }, + blockShifting: { boolean: bool }, + edgeMinimization: { boolean: bool }, + parentCentralization: { boolean: bool }, direction: { string: ['UD', 'DU', 'LR', 'RL'] }, // UD, DU, LR, RL sortMethod: { string: ['hubsize', 'directed'] }, // hubsize, directed - __type__: { object: object, boolean: boolean } + __type__: { object: object, boolean: bool } }, __type__: { object: object } }, manipulation: { - enabled: { boolean: boolean }, - initiallyActive: { boolean: boolean }, - addNode: { boolean: boolean, 'function': 'function' }, - addEdge: { boolean: boolean, 'function': 'function' }, + enabled: { boolean: bool }, + initiallyActive: { boolean: bool }, + addNode: { boolean: bool, 'function': 'function' }, + addEdge: { boolean: bool, 'function': 'function' }, editNode: { 'function': 'function' }, - editEdge: { boolean: boolean, 'function': 'function' }, - deleteNode: { boolean: boolean, 'function': 'function' }, - deleteEdge: { boolean: boolean, 'function': 'function' }, + editEdge: { + editWithoutDrag: { 'function': 'function' }, + __type__: { object: object, boolean: bool, 'function': 'function' } + }, + deleteNode: { boolean: bool, 'function': 'function' }, + deleteEdge: { boolean: bool, 'function': 'function' }, controlNodeStyle: 'get from nodes, will be overwritten below', - __type__: { object: object, boolean: boolean } + __type__: { object: object, boolean: bool } }, nodes: { borderWidth: { number: number }, borderWidthSelected: { number: number, 'undefined': 'undefined' }, brokenImage: { string: string, 'undefined': 'undefined' }, + chosen: { + label: { boolean: bool, 'function': 'function' }, + node: { boolean: bool, 'function': 'function' }, + __type__: { object: object, boolean: bool } + }, color: { border: { string: string }, background: { string: string }, @@ -45625,9 +49756,9 @@ return /******/ (function(modules) { // webpackBootstrap __type__: { object: object, string: string } }, fixed: { - x: { boolean: boolean }, - y: { boolean: boolean }, - __type__: { object: object, boolean: boolean } + x: { boolean: bool }, + y: { boolean: bool }, + __type__: { object: object, boolean: bool } }, font: { align: { string: string }, @@ -45637,10 +49768,49 @@ return /******/ (function(modules) { // webpackBootstrap background: { string: string }, strokeWidth: { number: number }, // px strokeColor: { string: string }, + vadjust: { number: number }, + multi: { boolean: bool, string: string }, + bold: { + color: { string: string }, + size: { number: number }, // px + face: { string: string }, + mod: { string: string }, + vadjust: { number: number }, + __type__: { object: object, string: string } + }, + boldital: { + color: { string: string }, + size: { number: number }, // px + face: { string: string }, + mod: { string: string }, + vadjust: { number: number }, + __type__: { object: object, string: string } + }, + ital: { + color: { string: string }, + size: { number: number }, // px + face: { string: string }, + mod: { string: string }, + vadjust: { number: number }, + __type__: { object: object, string: string } + }, + mono: { + color: { string: string }, + size: { number: number }, // px + face: { string: string }, + mod: { string: string }, + vadjust: { number: number }, + __type__: { object: object, string: string } + }, __type__: { object: object, string: string } }, group: { string: string, number: number, 'undefined': 'undefined' }, - hidden: { boolean: boolean }, + heightConstraint: { + minimum: { number: number }, + valign: { string: string }, + __type__: { object: object, boolean: bool, number: number } + }, + hidden: { boolean: bool }, icon: { face: { string: string }, code: { string: string }, //'\uf007', @@ -45651,50 +49821,62 @@ return /******/ (function(modules) { // webpackBootstrap id: { string: string, number: number }, image: { string: string, 'undefined': 'undefined' }, // --> URL label: { string: string, 'undefined': 'undefined' }, - labelHighlightBold: { boolean: boolean }, + labelHighlightBold: { boolean: bool }, level: { number: number, 'undefined': 'undefined' }, + margin: { + top: { number: number }, + right: { number: number }, + bottom: { number: number }, + left: { number: number }, + __type__: { object: object, number: number } + }, mass: { number: number }, - physics: { boolean: boolean }, + physics: { boolean: bool }, scaling: { min: { number: number }, max: { number: number }, label: { - enabled: { boolean: boolean }, + enabled: { boolean: bool }, min: { number: number }, max: { number: number }, maxVisible: { number: number }, drawThreshold: { number: number }, - __type__: { object: object, boolean: boolean } + __type__: { object: object, boolean: bool } }, customScalingFunction: { 'function': 'function' }, __type__: { object: object } }, shadow: { - enabled: { boolean: boolean }, + enabled: { boolean: bool }, color: { string: string }, size: { number: number }, x: { number: number }, y: { number: number }, - __type__: { object: object, boolean: boolean } + __type__: { object: object, boolean: bool } }, shape: { string: ['ellipse', 'circle', 'database', 'box', 'text', 'image', 'circularImage', 'diamond', 'dot', 'star', 'triangle', 'triangleDown', 'square', 'icon'] }, shapeProperties: { - borderDashes: { boolean: boolean, array: array }, + borderDashes: { boolean: bool, array: array }, borderRadius: { number: number }, - interpolation: { boolean: boolean }, - useImageSize: { boolean: boolean }, - useBorderWithImage: { boolean: boolean }, + interpolation: { boolean: bool }, + useImageSize: { boolean: bool }, + useBorderWithImage: { boolean: bool }, __type__: { object: object } }, size: { number: number }, title: { string: string, 'undefined': 'undefined' }, value: { number: number, 'undefined': 'undefined' }, + widthConstraint: { + minimum: { number: number }, + maximum: { number: number }, + __type__: { object: object, boolean: bool, number: number } + }, x: { number: number }, y: { number: number }, __type__: { object: object } }, physics: { - enabled: { boolean: boolean }, + enabled: { boolean: bool }, barnesHut: { gravitationalConstant: { number: number }, centralGravity: { number: number }, @@ -45733,21 +49915,21 @@ return /******/ (function(modules) { // webpackBootstrap minVelocity: { number: number }, // px/s solver: { string: ['barnesHut', 'repulsion', 'hierarchicalRepulsion', 'forceAtlas2Based'] }, stabilization: { - enabled: { boolean: boolean }, + enabled: { boolean: bool }, iterations: { number: number }, // maximum number of iteration to stabilize updateInterval: { number: number }, - onlyDynamicEdges: { boolean: boolean }, - fit: { boolean: boolean }, - __type__: { object: object, boolean: boolean } + onlyDynamicEdges: { boolean: bool }, + fit: { boolean: bool }, + __type__: { object: object, boolean: bool } }, timestep: { number: number }, - adaptiveTimestep: { boolean: boolean }, - __type__: { object: object, boolean: boolean } + adaptiveTimestep: { boolean: bool }, + __type__: { object: object, boolean: bool } }, //globals : - autoResize: { boolean: boolean }, - clickToUse: { boolean: boolean }, + autoResize: { boolean: bool }, + clickToUse: { boolean: bool }, locale: { string: string }, locales: { __any__: { any: any }, @@ -45966,7 +50148,7 @@ return /******/ (function(modules) { // webpackBootstrap exports.configureOptions = configureOptions; /***/ }, -/* 117 */ +/* 221 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -45975,18 +50157,23 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + var _slicedToArray2 = __webpack_require__(161); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); // distance finding algorithm + var _slicedToArray3 = _interopRequireDefault(_slicedToArray2); + var _classCallCheck2 = __webpack_require__(115); - var _FloydWarshall = __webpack_require__(118); + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - var _FloydWarshall2 = _interopRequireDefault(_FloydWarshall); + var _createClass2 = __webpack_require__(116); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var _createClass3 = _interopRequireDefault(_createClass2); + + var _FloydWarshall = __webpack_require__(222); + + var _FloydWarshall2 = _interopRequireDefault(_FloydWarshall); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } /** * KamadaKawai positions the nodes initially based on @@ -45998,12 +50185,12 @@ return /******/ (function(modules) { // webpackBootstrap */ var KamadaKawai = function () { function KamadaKawai(body, edgeLength, edgeStrength) { - _classCallCheck(this, KamadaKawai); + (0, _classCallCheck3["default"])(this, KamadaKawai); this.body = body; this.springLength = edgeLength; this.springConstant = edgeStrength; - this.distanceSolver = new _FloydWarshall2.default(); + this.distanceSolver = new _FloydWarshall2["default"](); } /** @@ -46012,7 +50199,7 @@ return /******/ (function(modules) { // webpackBootstrap */ - _createClass(KamadaKawai, [{ + (0, _createClass3["default"])(KamadaKawai, [{ key: "setOptions", value: function setOptions(options) { if (options) { @@ -46064,7 +50251,7 @@ return /******/ (function(modules) { // webpackBootstrap var _getHighestEnergyNode2 = this._getHighestEnergyNode(ignoreClusters); - var _getHighestEnergyNode3 = _slicedToArray(_getHighestEnergyNode2, 4); + var _getHighestEnergyNode3 = (0, _slicedToArray3["default"])(_getHighestEnergyNode2, 4); highE_nodeId = _getHighestEnergyNode3[0]; maxEnergy = _getHighestEnergyNode3[1]; @@ -46079,7 +50266,7 @@ return /******/ (function(modules) { // webpackBootstrap var _getEnergy2 = this._getEnergy(highE_nodeId); - var _getEnergy3 = _slicedToArray(_getEnergy2, 3); + var _getEnergy3 = (0, _slicedToArray3["default"])(_getEnergy2, 3); delta_m = _getEnergy3[0]; dE_dx = _getEnergy3[1]; @@ -46109,7 +50296,7 @@ return /******/ (function(modules) { // webpackBootstrap // by not evaluating nodes with predefined positions we should only move nodes that have no positions. if (nodes[m].predefinedPosition === false || nodes[m].isCluster === true && ignoreClusters === true || nodes[m].options.fixed.x === true || nodes[m].options.fixed.y === true) { var _getEnergy4 = this._getEnergy(m), - _getEnergy5 = _slicedToArray(_getEnergy4, 3), + _getEnergy5 = (0, _slicedToArray3["default"])(_getEnergy4, 3), delta_m = _getEnergy5[0], dE_dx = _getEnergy5[1], dE_dy = _getEnergy5[2]; @@ -46247,15 +50434,15 @@ return /******/ (function(modules) { // webpackBootstrap } } }]); - return KamadaKawai; - }(); + }(); // distance finding algorithm + - exports.default = KamadaKawai; + exports["default"] = KamadaKawai; /***/ }, -/* 118 */ -/***/ function(module, exports) { +/* 222 */ +/***/ function(module, exports, __webpack_require__) { "use strict"; @@ -46263,9 +50450,15 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var _classCallCheck2 = __webpack_require__(115); + + var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var _createClass2 = __webpack_require__(116); + + var _createClass3 = _interopRequireDefault(_createClass2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } /** * Created by Alex on 10-Aug-15. @@ -46273,10 +50466,10 @@ return /******/ (function(modules) { // webpackBootstrap var FloydWarshall = function () { function FloydWarshall() { - _classCallCheck(this, FloydWarshall); + (0, _classCallCheck3["default"])(this, FloydWarshall); } - _createClass(FloydWarshall, [{ + (0, _createClass3["default"])(FloydWarshall, [{ key: "getDistances", value: function getDistances(body, nodesArray, edgesArray) { var D_matrix = {}; @@ -46317,14 +50510,13 @@ return /******/ (function(modules) { // webpackBootstrap return D_matrix; } }]); - return FloydWarshall; }(); - exports.default = FloydWarshall; + exports["default"] = FloydWarshall; /***/ }, -/* 119 */ +/* 223 */ /***/ function(module, exports) { 'use strict'; @@ -46622,11 +50814,17 @@ return /******/ (function(modules) { // webpackBootstrap } /***/ }, -/* 120 */ -/***/ function(module, exports) { +/* 224 */ +/***/ function(module, exports, __webpack_require__) { 'use strict'; + var _create = __webpack_require__(55); + + var _create2 = _interopRequireDefault(_create); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + /** * Parse a text source containing data in DOT language into a JSON object. * The object contains two lists: one with nodes and one with edges. @@ -46656,7 +50854,7 @@ return /******/ (function(modules) { // webpackBootstrap 'tooltip': 'title', 'labeltooltip': 'title' }; - var EDGE_ATTR_MAPPING = Object.create(NODE_ATTR_MAPPING); + var EDGE_ATTR_MAPPING = (0, _create2['default'])(NODE_ATTR_MAPPING); EDGE_ATTR_MAPPING.color = 'color.color'; // token types enumeration @@ -47520,7 +51718,7 @@ return /******/ (function(modules) { // webpackBootstrap exports.DOTToGraph = DOTToGraph; /***/ }, -/* 121 */ +/* 225 */ /***/ function(module, exports) { 'use strict'; @@ -47598,7 +51796,7 @@ return /******/ (function(modules) { // webpackBootstrap exports.parseGephi = parseGephi; /***/ }, -/* 122 */ +/* 226 */ /***/ function(module, exports) { 'use strict'; diff --git a/dist/vis.js.map b/dist/vis.js.map new file mode 100644 index 00000000..0c90cb78 --- /dev/null +++ b/dist/vis.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap eca1787db4da1a54ed82","webpack:///./index.js","webpack:///./lib/util.js","webpack:///./~/babel-runtime/core-js/get-iterator.js","webpack:///./~/core-js/library/fn/get-iterator.js","webpack:///./~/core-js/library/modules/web.dom.iterable.js","webpack:///./~/core-js/library/modules/es6.array.iterator.js","webpack:///./~/core-js/library/modules/_add-to-unscopables.js","webpack:///./~/core-js/library/modules/_iter-step.js","webpack:///./~/core-js/library/modules/_iterators.js","webpack:///./~/core-js/library/modules/_to-iobject.js","webpack:///./~/core-js/library/modules/_iobject.js","webpack:///./~/core-js/library/modules/_cof.js","webpack:///./~/core-js/library/modules/_defined.js","webpack:///./~/core-js/library/modules/_iter-define.js","webpack:///./~/core-js/library/modules/_library.js","webpack:///./~/core-js/library/modules/_export.js","webpack:///./~/core-js/library/modules/_global.js","webpack:///./~/core-js/library/modules/_core.js","webpack:///./~/core-js/library/modules/_ctx.js","webpack:///./~/core-js/library/modules/_a-function.js","webpack:///./~/core-js/library/modules/_hide.js","webpack:///./~/core-js/library/modules/_object-dp.js","webpack:///./~/core-js/library/modules/_an-object.js","webpack:///./~/core-js/library/modules/_is-object.js","webpack:///./~/core-js/library/modules/_ie8-dom-define.js","webpack:///./~/core-js/library/modules/_descriptors.js","webpack:///./~/core-js/library/modules/_fails.js","webpack:///./~/core-js/library/modules/_dom-create.js","webpack:///./~/core-js/library/modules/_to-primitive.js","webpack:///./~/core-js/library/modules/_property-desc.js","webpack:///./~/core-js/library/modules/_redefine.js","webpack:///./~/core-js/library/modules/_has.js","webpack:///./~/core-js/library/modules/_iter-create.js","webpack:///./~/core-js/library/modules/_object-create.js","webpack:///./~/core-js/library/modules/_object-dps.js","webpack:///./~/core-js/library/modules/_object-keys.js","webpack:///./~/core-js/library/modules/_object-keys-internal.js","webpack:///./~/core-js/library/modules/_array-includes.js","webpack:///./~/core-js/library/modules/_to-length.js","webpack:///./~/core-js/library/modules/_to-integer.js","webpack:///./~/core-js/library/modules/_to-index.js","webpack:///./~/core-js/library/modules/_shared-key.js","webpack:///./~/core-js/library/modules/_shared.js","webpack:///./~/core-js/library/modules/_uid.js","webpack:///./~/core-js/library/modules/_enum-bug-keys.js","webpack:///./~/core-js/library/modules/_html.js","webpack:///./~/core-js/library/modules/_set-to-string-tag.js","webpack:///./~/core-js/library/modules/_wks.js","webpack:///./~/core-js/library/modules/_object-gpo.js","webpack:///./~/core-js/library/modules/_to-object.js","webpack:///./~/core-js/library/modules/es6.string.iterator.js","webpack:///./~/core-js/library/modules/_string-at.js","webpack:///./~/core-js/library/modules/core.get-iterator.js","webpack:///./~/core-js/library/modules/core.get-iterator-method.js","webpack:///./~/core-js/library/modules/_classof.js","webpack:///./~/babel-runtime/core-js/object/create.js","webpack:///./~/core-js/library/fn/object/create.js","webpack:///./~/core-js/library/modules/es6.object.create.js","webpack:///./~/babel-runtime/core-js/object/keys.js","webpack:///./~/core-js/library/fn/object/keys.js","webpack:///./~/core-js/library/modules/es6.object.keys.js","webpack:///./~/core-js/library/modules/_object-sap.js","webpack:///./~/babel-runtime/helpers/typeof.js","webpack:///./~/babel-runtime/core-js/symbol/iterator.js","webpack:///./~/core-js/library/fn/symbol/iterator.js","webpack:///./~/core-js/library/modules/_wks-ext.js","webpack:///./~/babel-runtime/core-js/symbol.js","webpack:///./~/core-js/library/fn/symbol/index.js","webpack:///./~/core-js/library/modules/es6.symbol.js","webpack:///./~/core-js/library/modules/_meta.js","webpack:///./~/core-js/library/modules/_wks-define.js","webpack:///./~/core-js/library/modules/_keyof.js","webpack:///./~/core-js/library/modules/_enum-keys.js","webpack:///./~/core-js/library/modules/_object-gops.js","webpack:///./~/core-js/library/modules/_object-pie.js","webpack:///./~/core-js/library/modules/_is-array.js","webpack:///./~/core-js/library/modules/_object-gopn-ext.js","webpack:///./~/core-js/library/modules/_object-gopn.js","webpack:///./~/core-js/library/modules/_object-gopd.js","webpack:///./~/core-js/library/modules/es7.symbol.async-iterator.js","webpack:///./~/core-js/library/modules/es7.symbol.observable.js","webpack:///./~/babel-runtime/core-js/json/stringify.js","webpack:///./~/core-js/library/fn/json/stringify.js","webpack:///./lib/module/moment.js","webpack:///./~/moment/moment.js","webpack:///(webpack)/buildin/module.js","webpack:///./~/moment/locale ^\\.\\/$^$","webpack:///./lib/module/uuid.js","webpack:///./index-graph3d.js","webpack:///./lib/DOMutil.js","webpack:///./lib/DataSet.js","webpack:///./lib/Queue.js","webpack:///./lib/DataView.js","webpack:///./lib/graph3d/Graph3d.js","webpack:///./~/emitter-component/index.js","webpack:///./lib/graph3d/Point3d.js","webpack:///./lib/graph3d/Point2d.js","webpack:///./lib/graph3d/Camera.js","webpack:///./~/babel-runtime/core-js/math/sign.js","webpack:///./~/core-js/library/fn/math/sign.js","webpack:///./~/core-js/library/modules/es6.math.sign.js","webpack:///./~/core-js/library/modules/_math-sign.js","webpack:///./lib/graph3d/Filter.js","webpack:///./lib/graph3d/Slider.js","webpack:///./lib/graph3d/StepNumber.js","webpack:///./lib/graph3d/Range.js","webpack:///./lib/graph3d/Settings.js","webpack:///./lib/module/hammer.js","webpack:///./~/propagating-hammerjs/propagating.js","webpack:///./~/hammerjs/hammer.js","webpack:///./~/keycharm/keycharm.js","webpack:///./index-timeline-graph2d.js","webpack:///./lib/timeline/Timeline.js","webpack:///./lib/shared/Configurator.js","webpack:///./~/babel-runtime/helpers/classCallCheck.js","webpack:///./~/babel-runtime/helpers/createClass.js","webpack:///./~/babel-runtime/core-js/object/define-property.js","webpack:///./~/core-js/library/fn/object/define-property.js","webpack:///./~/core-js/library/modules/es6.object.define-property.js","webpack:///./lib/shared/ColorPicker.js","webpack:///./lib/hammerUtil.js","webpack:///./lib/shared/Validator.js","webpack:///./lib/timeline/Range.js","webpack:///./lib/timeline/component/Component.js","webpack:///./lib/timeline/DateUtil.js","webpack:///./lib/timeline/Core.js","webpack:///./lib/timeline/component/ItemSet.js","webpack:///./lib/shared/Popup.js","webpack:///./lib/timeline/TimeStep.js","webpack:///./lib/timeline/component/Group.js","webpack:///./lib/timeline/Stack.js","webpack:///./lib/timeline/component/item/RangeItem.js","webpack:///./lib/timeline/component/item/Item.js","webpack:///./lib/timeline/component/BackgroundGroup.js","webpack:///./lib/timeline/component/item/BoxItem.js","webpack:///./lib/timeline/component/item/PointItem.js","webpack:///./lib/timeline/component/item/BackgroundItem.js","webpack:///./lib/timeline/component/TimeAxis.js","webpack:///./lib/shared/Activator.js","webpack:///./lib/timeline/component/CustomTime.js","webpack:///./lib/timeline/locales.js","webpack:///./lib/timeline/component/CurrentTime.js","webpack:///./lib/timeline/optionsTimeline.js","webpack:///./lib/timeline/Graph2d.js","webpack:///./lib/timeline/component/LineGraph.js","webpack:///./lib/timeline/component/DataAxis.js","webpack:///./lib/timeline/component/DataScale.js","webpack:///./lib/timeline/component/GraphGroup.js","webpack:///./lib/timeline/component/graph2d_types/bar.js","webpack:///./lib/timeline/component/graph2d_types/points.js","webpack:///./lib/timeline/component/graph2d_types/line.js","webpack:///./lib/timeline/component/Legend.js","webpack:///./lib/timeline/optionsGraph2d.js","webpack:///./index-network.js","webpack:///./lib/network/Network.js","webpack:///./lib/network/Images.js","webpack:///./lib/network/modules/Groups.js","webpack:///./lib/network/modules/NodesHandler.js","webpack:///./lib/network/modules/components/Node.js","webpack:///./lib/network/modules/components/shared/Label.js","webpack:///./~/babel-runtime/helpers/slicedToArray.js","webpack:///./~/babel-runtime/core-js/is-iterable.js","webpack:///./~/core-js/library/fn/is-iterable.js","webpack:///./~/core-js/library/modules/core.is-iterable.js","webpack:///./lib/network/modules/components/nodes/shapes/Box.js","webpack:///./~/babel-runtime/core-js/object/get-prototype-of.js","webpack:///./~/core-js/library/fn/object/get-prototype-of.js","webpack:///./~/core-js/library/modules/es6.object.get-prototype-of.js","webpack:///./~/babel-runtime/helpers/possibleConstructorReturn.js","webpack:///./~/babel-runtime/helpers/inherits.js","webpack:///./~/babel-runtime/core-js/object/set-prototype-of.js","webpack:///./~/core-js/library/fn/object/set-prototype-of.js","webpack:///./~/core-js/library/modules/es6.object.set-prototype-of.js","webpack:///./~/core-js/library/modules/_set-proto.js","webpack:///./lib/network/modules/components/nodes/util/NodeBase.js","webpack:///./lib/network/modules/components/nodes/shapes/Circle.js","webpack:///./lib/network/modules/components/nodes/util/CircleImageBase.js","webpack:///./lib/network/modules/components/nodes/shapes/CircularImage.js","webpack:///./lib/network/modules/components/nodes/shapes/Database.js","webpack:///./lib/network/modules/components/nodes/shapes/Diamond.js","webpack:///./lib/network/modules/components/nodes/util/ShapeBase.js","webpack:///./lib/network/modules/components/nodes/shapes/Dot.js","webpack:///./lib/network/modules/components/nodes/shapes/Ellipse.js","webpack:///./lib/network/modules/components/nodes/shapes/Icon.js","webpack:///./lib/network/modules/components/nodes/shapes/Image.js","webpack:///./lib/network/modules/components/nodes/shapes/Square.js","webpack:///./lib/network/modules/components/nodes/shapes/Star.js","webpack:///./lib/network/modules/components/nodes/shapes/Text.js","webpack:///./lib/network/modules/components/nodes/shapes/Triangle.js","webpack:///./lib/network/modules/components/nodes/shapes/TriangleDown.js","webpack:///./lib/network/modules/EdgesHandler.js","webpack:///./lib/network/modules/components/Edge.js","webpack:///./lib/network/modules/components/edges/CubicBezierEdge.js","webpack:///./lib/network/modules/components/edges/util/CubicBezierEdgeBase.js","webpack:///./lib/network/modules/components/edges/util/BezierEdgeBase.js","webpack:///./lib/network/modules/components/edges/util/EdgeBase.js","webpack:///./lib/network/modules/components/edges/BezierEdgeDynamic.js","webpack:///./lib/network/modules/components/edges/BezierEdgeStatic.js","webpack:///./lib/network/modules/components/edges/StraightEdge.js","webpack:///./lib/network/modules/PhysicsEngine.js","webpack:///./lib/network/modules/components/physics/BarnesHutSolver.js","webpack:///./lib/network/modules/components/physics/RepulsionSolver.js","webpack:///./lib/network/modules/components/physics/HierarchicalRepulsionSolver.js","webpack:///./lib/network/modules/components/physics/SpringSolver.js","webpack:///./lib/network/modules/components/physics/HierarchicalSpringSolver.js","webpack:///./lib/network/modules/components/physics/CentralGravitySolver.js","webpack:///./lib/network/modules/components/physics/FA2BasedRepulsionSolver.js","webpack:///./lib/network/modules/components/physics/FA2BasedCentralGravitySolver.js","webpack:///./lib/network/modules/Clustering.js","webpack:///./lib/network/NetworkUtil.js","webpack:///./lib/network/modules/components/nodes/Cluster.js","webpack:///./lib/network/modules/CanvasRenderer.js","webpack:///./lib/network/modules/Canvas.js","webpack:///./lib/network/modules/View.js","webpack:///./lib/network/modules/InteractionHandler.js","webpack:///./lib/network/modules/components/NavigationHandler.js","webpack:///./lib/network/modules/SelectionHandler.js","webpack:///./lib/network/modules/LayoutEngine.js","webpack:///./lib/network/modules/ManipulationSystem.js","webpack:///./lib/network/options.js","webpack:///./lib/network/modules/KamadaKawai.js","webpack:///./lib/network/modules/components/algorithms/FloydWarshall.js","webpack:///./lib/network/shapes.js","webpack:///./lib/network/dotparser.js","webpack:///./lib/network/gephiParser.js","webpack:///./lib/network/locales.js"],"names":["util","require","extend","exports","moment","uuid","isNumber","object","Number","elementsCensor","replacer","key","value","Element","JSON","parse","recursiveDOMDelete","DOMobject","hasChildNodes","firstChild","removeChild","giveRange","min","max","total","scale","Math","isString","String","isDate","Date","match","ASPDateRegex","exec","isNaN","randomUUID","v4","assignAllKeys","obj","prop","hasOwnProperty","fillIfDefined","a","b","allowDeletion","undefined","protoExtend","i","arguments","length","other","selectiveExtend","props","Array","isArray","Error","p","selectiveDeepExtend","TypeError","constructor","Object","deepExtend","selectiveNotDeepExtend","indexOf","push","equalArray","len","convert","type","Boolean","valueOf","isMoment","toDate","getType","toISOString","format","copyAndExtendArray","arr","newValue","newArr","copyArray","getAbsoluteLeft","elem","getBoundingClientRect","left","getAbsoluteRight","right","getAbsoluteTop","top","addClassName","className","classes","split","join","removeClassName","index","splice","forEach","callback","toArray","array","updateProperty","throttle","fn","scheduled","throttled","requestAnimationFrame","addEventListener","element","action","listener","useCapture","navigator","userAgent","attachEvent","removeEventListener","detachEvent","preventDefault","event","window","returnValue","getTarget","target","srcElement","nodeType","parentNode","hasParent","parent","e","option","asBoolean","defaultValue","asNumber","asString","asSize","asElement","hexToRGB","hex","shorthandRegex","replace","m","r","g","result","parseInt","overrideOpacity","color","opacity","rgb","substr","RGBToHex","red","green","blue","toString","slice","parseColor","c","isValidRGB","map","isValidHex","hsv","hexToHSV","lighterColorHSV","h","s","v","darkerColorHSV","darkerColorHex","HSVToHex","lighterColorHex","background","border","highlight","hover","RGBToHSV","minRGB","maxRGB","d","hue","saturation","cssUtil","cssText","styles","style","trim","parts","addCssText","currentStyles","newStyles","removeCssText","removeStyles","HSVToRGB","floor","f","q","t","isOk","test","isValidRGBA","rgba","selectiveBridgeObject","fields","referenceObject","objectTo","bridgeObject","insertSort","compare","k","j","mergeOptions","mergeTarget","options","globalOptions","enabled","binarySearchCustom","orderedItems","comparator","field","field2","maxIterations","iteration","low","high","middle","item","searchResult","binarySearchValue","sidePreference","prevValue","nextValue","easingFunctions","linear","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","getScrollBarWidth","inner","document","createElement","width","height","outer","position","visibility","overflow","appendChild","body","w1","offsetWidth","w2","clientWidth","topMost","pile","accessors","candidate","member","module","_rng","globalVar","global","crypto","getRandomValues","_rnds8","Uint8Array","whatwgRNG","_rnds","random","_byteToHex","_hexToByte","buf","offset","ii","toLowerCase","oct","unparse","bth","_seedBytes","_nodeId","_clockseq","_lastMSecs","_lastNSecs","v1","clockseq","msecs","getTime","nsecs","dt","tl","tmh","node","n","rnds","rng","DOMutil","DataSet","DataView","Queue","Graph3d","graph3d","Camera","Filter","Point2d","Point3d","Slider","StepNumber","Hammer","keycharm","prepareElements","JSONcontainer","elementType","redundant","used","cleanupElements","resetElements","getSVGElement","svgContainer","shift","createElementNS","getDOMElement","DOMContainer","insertBefore","drawPoint","x","y","groupTemplate","labelObj","point","setAttributeNS","size","label","xOffset","yOffset","content","textContent","drawBar","rect","data","_options","_data","_fieldId","fieldId","_type","_subscribers","add","setOptions","prototype","queue","_queue","destroy","on","subscribers","subscribe","off","filter","unsubscribe","_trigger","params","senderId","concat","subscriber","addedIds","id","me","_addItem","items","update","updatedIds","oldData","updatedData","addOrUpdate","oldItem","_updateItem","console","warn","get","args","ids","firstType","returnType","allowedValues","itemIds","itemId","_getItem","order","_sort","_filterFields","resultant","getIds","getDataSet","mappedItems","filteredItem","itemFields","name","sort","av","bv","remove","removedIds","removedItems","_remove","ident","clear","maxField","itemField","minField","distinct","values","fieldType","count","exists","types","raw","converted","delay","Infinity","_timeout","_extended","_flushIfNeeded","flush","methods","original","method","context","entry","clearTimeout","setTimeout","apply","_ids","_onEvent","setData","refresh","oldIds","newIds","viewOptions","getArguments","defaultFilter","dataSet","oldItems","updatedItems","Emitter","Range","Settings","STYLE","autoByDefault","DEFAULTS","filterLabel","legendLabel","xLabel","yLabel","zLabel","xValueLabel","yValueLabel","zValueLabel","showGrid","showPerspective","showShadow","keepAspectRatio","verticalRatio","dotSizeRatio","showAnimationControls","animationInterval","animationPreload","animationAutoStart","axisColor","gridColor","xCenter","yCenter","DOT","tooltip","showLegend","backgroundColor","dataColor","fill","stroke","strokeWidth","cameraPosition","horizontal","vertical","distance","xBarWidth","yBarWidth","valueMin","valueMax","xMin","xMax","xStep","yMin","yMax","yStep","zMin","zMax","zStep","container","SyntaxError","containerElement","dataTable","dataPoints","create","setDefaults","colX","colY","colZ","colValue","colFilter","_setScale","xRange","range","yRange","zRange","z","valueRange","center","zCenter","camera","setArmLocation","_convert3Dto2D","point3d","translation","_convertPointToTranslation","_convertTranslationToScreen","cameraLocation","getCameraLocation","cameraRotation","getCameraRotation","ax","ay","az","cx","cy","cz","sinTx","sin","cosTx","cos","sinTy","cosTy","sinTz","cosTz","dx","dy","dz","ex","eye","ey","ez","bx","by","getArmLength","currentXCenter","frame","canvas","currentYCenter","_calcTranslations","points","trans","screen","transBottom","bottom","dist","sortDepth","getNumberOfRows","getNumberOfColumns","counter","column","getDistinctValues","distinctValues","getColumnRange","adjust","_checkValueField","hasValueField","BARCOLOR","BARSIZE","DOTCOLOR","DOTSIZE","_setRangeDefaults","defaultMin","defaultMax","_dataInitialize","rawData","_onChange","withBars","BAR","defaultXBarWidth","dataX","defaultYBarWidth","dataY","NUMSTEPS","expand","defaultXMin","defaultXMax","defaultXStep","defaultYMin","defaultYMax","defaultYStep","defaultZMin","defaultZMax","defaultZStep","defaultValueMin","defaultValueMax","dataFilter","setOnLoadCallback","redraw","_getDataPoints","GRID","SURFACE","sortNumber","dataMatrix","xIndex","yIndex","pointRight","pointTop","pointCross","LINE","pointNext","noCanvas","fontWeight","padding","innerHTML","onmousedown","_onMouseDown","ontouchstart","_onTouchStart","onmousewheel","_onWheel","ontooltip","_onTooltip","onclick","_onClick","onkeydown","_setSize","_resizeCanvas","clientHeight","animationStart","slider","play","animationStop","stop","_resizeCenter","charAt","parseFloat","getCameraPosition","pos","getArmRotation","_readData","_redrawFilter","setPointDrawingMethod","_redrawBarGraphPoint","_redrawBarColorGraphPoint","_redrawBarSizeGraphPoint","_redrawDotGraphPoint","DOTLINE","_redrawDotLineGraphPoint","_redrawDotColorGraphPoint","_redrawDotSizeGraphPoint","_redrawSurfaceGraphPoint","_redrawGridGraphPoint","_redrawLineGraphPoint","_pointDrawingMethod","_redrawSlider","_redrawClear","_redrawAxis","_redrawDataGraph","_redrawInfo","_redrawLegend","_getContext","ctx","getContext","lineJoin","lineCap","clearRect","_dotSize","_getLegendWidth","dotSize","isSizeLegend","isValueLegend","margin","lineWidth","font","ymin","ymax","_hsv2rgb","strokeStyle","beginPath","moveTo","lineTo","strokeRect","widthMin","fillStyle","closePath","gridLineLen","legendMin","legendMax","step","start","from","to","end","getCurrent","_line","textAlign","textBaseline","fillText","next","setValues","setPlayInterval","onchange","getIndex","selectValue","setOnChangeCallback","lineStyle","getLabel","getSelectedValue","drawAxisLabelX","text","armAngle","yMargin","point2d","drawAxisLabelY","drawAxisLabelZ","_line3d","from2d","to2d","prettyStep","xText","yText","zText","gridLenX","gridLenY","textMargin","armVector","msg","from3d","xMin2d","xMax2d","H","S","V","R","G","B","C","Hi","X","abs","_getStrokeWidth","_redrawBar","xWidth","yWidth","borderColor","surface","surfaces","corners","avg","transCenter","diff","_polygon","_drawCircle","radius","_calcRadius","arc","PI","_getColorsRegular","_getColorsColor","_getColorsSize","colors","fraction","cross","topSideVisible","showGrayBottom","aDiff","subtract","bDiff","crossproduct","crossProduct","zAvg","_drawGridLine","call","_storeMousePosition","startMouseX","getMouseX","startMouseY","getMouseY","_startCameraOffset","getOffset","leftButtonDown","_onMouseUp","which","button","touchDown","startStart","startEnd","startArmRotation","cursor","onmousemove","_onMouseMove","onmouseup","moving","diffX","diffY","ctrlKey","scaleX","scaleY","offXNew","armLength","offYNew","setOffset","horizontalNew","verticalNew","snapAngle","snapValue","round","setArmRotation","parameters","emit","onclick_callback","boundingRect","mouseX","mouseY","dataPoint","_dataPointFromXY","showTooltip","tooltipTimeout","_hideTooltip","_showTooltip","ontouchmove","_onTouchMove","ontouchend","_onTouchEnd","delta","wheelDelta","detail","oldLength","newLength","setArmLength","_insideTriangle","triangle","sign","as","bs","cs","distMax","closestDataPoint","closestDist","triangle1","triangle2","distX","distY","sqrt","line","dot","borderRadius","boxShadow","borderLeft","dom","contentWidth","contentHeight","offsetHeight","lineHeight","dotWidth","dotHeight","clientX","targetTouches","clientY","setCameraPosition","setSize","sub","sum","armLocation","armRotation","cameraOffset","offsetMultiplier","calculateCameraOrientation","mul","rot","xa","ya","za","graph","loaded","onLoadCallback","loadInBackground","isLoaded","getLoadedProgress","getColumn","getValues","getValue","dataView","dataPointsTemp","progress","visible","prev","bar","MozBorderRadius","slide","togglePlay","onChangeCallback","playTimeout","playInterval","playLoop","setIndex","playNext","interval","clearInterval","getPlayInterval","setPlayLoop","doLoop","onChange","indexToLeft","startClientX","startSlideX","leftToIndex","_start","_end","_step","precision","_current","setRange","isNumeric","isFinite","setStep","calculatePrettyStep","log10","log","LN10","step1","pow","step2","step5","toPrecision","getStep","checkFirst","combine","val","newMin","newMax","STYLENAME","OPTIONKEYS","PREFIXEDOPTIONKEYS","isEmpty","capitalize","str","toUpperCase","prefixFieldName","prefix","fieldName","forceCopy","src","dst","srcKey","dstKey","safeCopy","setSpecialSettings","setBackgroundColor","setDataColor","setStyle","setShowLegend","isAutoByDefault","isLegendGraphStyle","getStyleNumberByName","styleName","number","checkStyleNumber","valid","styleNumber","borderWidth","borderStyle","camPos","propagating","Timeline","Graph2d","timeline","Core","DateUtil","stack","TimeStep","components","Item","BackgroundItem","BoxItem","PointItem","RangeItem","BackgroundGroup","Component","CurrentTime","CustomTime","DataAxis","DataScale","GraphGroup","Group","ItemSet","Legend","LineGraph","TimeAxis","printStyle","allOptions","configureOptions","groups","forthArgument","throttleRedraw","defaultOptions","autoResize","orientation","axis","maxHeight","minHeight","_create","rtl","directionFromDom","domNode","root","getComputedStyle","direction","parentElement","rollingMode","domProps","emitter","bind","hiddenDates","getScale","timeAxis","toScreen","_toScreen","toGlobalScreen","_toGlobalScreen","toTime","_toTime","toGlobalTime","_toGlobalTime","timeAxis2","currentTime","itemSet","itemsData","groupsData","getEventProperties","ondblclick","oncontextmenu","onmouseover","fitDone","getItemRange","setWindow","animation","fit","setGroups","setItems","_redraw","_createConfigurator","markDirty","refreshItems","errorFound","validate","selection","getSelection","setSelection","newDataSet","group","focus","itemData","dataset","getDataRange","minItem","maxItem","factor","lhs","rhs","getStart","getEnd","groupShowing","show","repositionX","startSide","getWidthRight","endSide","getWidthLeft","centerContainer","itemFromTarget","groupFromTarget","customTime","customTimeFromTarget","snap","time","snappedTime","what","foreground","labelSet","groupId","pageX","srcEvent","pageY","Configurator","parentModule","defaultContainer","pixelRatio","changedOptions","allowCreation","initialized","popupCounter","showButton","moduleOptions","domElements","popupDiv","popupLimit","popupHistory","colorPicker","wrapper","_removePopup","_clean","_handleObject","_makeItem","_makeHeader","generateButton","_printOptions","onmouseout","optionsContainer","_push","_showPopupIfNeeded","path","base","div","objectLabel","select","selectedValue","selected","_update","_makeLabel","err","popupString","popupValue","ceil","input","oninput","itemIndex","_setupPopup","string","html","hideTimeout","deleteTimeout","correspondingElement","checkbox","checked","defaultColor","_showColorPicker","insertTo","setColor","setUpdateCallback","colorString","setCloseCallback","checkOnly","visibleInSet","subObj","newPath","_getValue","_handleArray","_makeTextInput","_makeCheckbox","draw","physics","solver","enabledPath","enabledValue","error","_makeColorField","_makeDropdown","_makeRange","_constructOptions","optionsObj","pointer","getOptions","hammerUtil","ColorPicker","generated","centerCoordinates","hueCircle","initialColor","previousColor","applied","updateCallback","closeCallback","hammer","_bindHammer","htmlColors","black","navy","darkblue","mediumblue","darkgreen","teal","darkcyan","deepskyblue","darkturquoise","mediumspringgreen","lime","springgreen","aqua","cyan","midnightblue","dodgerblue","lightseagreen","forestgreen","seagreen","darkslategray","limegreen","mediumseagreen","turquoise","royalblue","steelblue","darkslateblue","mediumturquoise","indigo","darkolivegreen","cadetblue","cornflowerblue","mediumaquamarine","dimgray","slateblue","olivedrab","slategray","lightslategray","mediumslateblue","lawngreen","chartreuse","aquamarine","maroon","purple","olive","gray","skyblue","lightskyblue","blueviolet","darkred","darkmagenta","saddlebrown","darkseagreen","lightgreen","mediumpurple","darkviolet","palegreen","darkorchid","yellowgreen","sienna","brown","darkgray","lightblue","greenyellow","paleturquoise","lightsteelblue","powderblue","firebrick","darkgoldenrod","mediumorchid","rosybrown","darkkhaki","silver","mediumvioletred","indianred","peru","chocolate","tan","lightgrey","palevioletred","thistle","orchid","goldenrod","crimson","gainsboro","plum","burlywood","lightcyan","lavender","darksalmon","violet","palegoldenrod","lightcoral","khaki","aliceblue","honeydew","azure","sandybrown","wheat","beige","whitesmoke","mintcream","ghostwhite","salmon","antiquewhite","linen","lightgoldenrodyellow","oldlace","fuchsia","magenta","deeppink","orangered","tomato","hotpink","coral","darkorange","lightsalmon","orange","lightpink","pink","gold","peachpuff","navajowhite","moccasin","bisque","mistyrose","blanchedalmond","papayawhip","lavenderblush","seashell","cornsilk","lemonchiffon","floralwhite","snow","yellow","lightyellow","ivory","white","setInitial","htmlColor","_isColorString","rgbaArray","rgbObj","alpha","_setColor","display","_generateHueCircle","storePrevious","_hide","_updatePicker","alert","angleConvert","colorPickerSelector","colorPickerCanvas","pixelRation","devicePixelRatio","webkitBackingStorePixelRatio","mozBackingStorePixelRatio","msBackingStorePixelRatio","oBackingStorePixelRatio","backingStorePixelRatio","setTransform","w","putImageData","circle","brightnessRange","opacityRange","initialColorDiv","newColorDiv","colorPickerDiv","opacityDiv","brightnessDiv","arrowDiv","_setOpacity","_setBrightness","brightnessLabel","opacityLabel","cancelButton","applyButton","_apply","saveButton","_save","loadButton","_loadLast","drag","pinch","set","enable","onTouch","_moveSelector","sat","hfac","sfac","fillRect","getImageData","centerY","centerX","angle","atan2","newTop","newLeft","inputHandler","isFirst","onRelease","isFinal","offTouch","offRelease","disablePreventDefaultVertically","pinchRecognizer","TOUCH_ACTION_PAN_Y","getTouchAction","Validator","referenceOptions","subObject","usedOptions","check","__any__","getSuggestion","__type__","checkFields","referenceOption","refOptionObj","optionType","refOptionType","print","printLocation","_isAMomentObject","localSearch","findInOptions","globalSearch","localSearchThreshold","globalSearchThreshold","indexMatch","closestMatch","recursive","closestMatchPath","lowerCaseOption","op","levenshteinDistance","matrix","now","hours","minutes","seconds","milliseconds","clone","rolling","deltaDifference","scaleOffset","startToFront","endToFront","moveable","zoomable","zoomMin","zoomMax","touch","animationTimer","_onDragStart","_onDrag","_onDragEnd","_onMouseWheel","_onTouch","_onPinch","rollingModeBtn","startRolling","validateDirection","stopRolling","conversion","currentTimeTimer","byUser","finalStart","finalEnd","_cancelAnimation","initStart","initEnd","duration","easingName","easingFunction","initTime","anyChanged","dragging","ease","done","changed","_applyRange","updateHiddenDates","newStart","newEnd","getRange","totalHidden","previousDelta","_isInsideRange","allowDragging","deltaX","deltaY","getHiddenDurationBetween","diffRange","safeStart","snapAwayFromHidden","safeEnd","startDate","endDate","zoomKey","horizontalScroll","pointerDate","getPointer","_pointerToDate","zoom","centerDate","hiddenDuration","hiddenDurationBefore","getHiddenDurationBefore","hiddenDurationAfter","move","_isResized","resized","_previousWidth","_previousHeight","convertHiddenOptions","repeat","dateItem","totalRange","pixelTime","_d","runUntil","day","dayOfYear","year","dayOffset","date","month","removeDuplicates","startHidden","isHidden","endHidden","rangeStart","rangeEnd","hidden","safeDates","printDates","dates","stepOverHiddenDates","timeStep","previousTime","stepInHidden","currentValue","current","switchedYear","switchedMonth","switchedDay","hiddenBeforeStart","getHiddenDurationBeforeStart","rangeAfterEnd","correctTimeForHidden","totalDuration","partialDuration","accumulatedHiddenDuration","getAccumulatedHiddenDuration","newTime","timeOffset","requiredDuration","previousPoint","correctionEnabled","Activator","backgroundVertical","backgroundHorizontal","leftContainer","rightContainer","shadowTop","shadowBottom","shadowTopLeft","shadowBottomLeft","shadowTopRight","shadowBottomRight","scrollTop","scrollTopMin","initialDrawDone","_origRedraw","properties","initialItemSetDrawn","threshold","DIRECTION_HORIZONTAL","listeners","events","isActive","onMouseWheel","verticalScroll","adjusted","_setScrollTop","onMouseScrollSide","itemAddedToTimeline","handleDragOver","dataTransfer","dropEffect","handleDrop","getData","_onAddItem","customTimes","redrawCount","drawPoints","onRender","clickToUse","activator","_initAutoResize","component","configurator","configure","appliedOptions","setModuleOptions","active","_stopAutoResize","setCustomTime","getCustomTime","setCustomTimeTitle","title","setCustomTitle","addCustomTime","timestamp","some","removeCustomTime","getVisibleItems","getWindow","zoomIn","percentage","newInterval","zoomOut","borderRootHeight","borderRootWidth","autoHeight","containerHeight","scrollbarWidth","_setDOM","_updateScrollTop","visibilityTop","visibilityBottom","RegExp","contentsOverflow","DIRECTION_ALL","MAX_REDRAW","centerWidth","repaint","setCurrentTime","getCurrentTime","_startAutoResize","_onResize","lastWidth","lastHeight","watchTimer","setInterval","initialScrollTop","oldScrollTop","_getScrollTop","newScrollTop","UNGROUPED","BACKGROUND","align","stackSubgroups","groupOrderSwap","fromGroup","toGroup","targetOrder","groupOrder","selectable","multiselect","itemsAlwaysDraggable","editable","updateTime","updateGroup","overrideItems","groupEditable","onAdd","onUpdate","onMove","onRemove","onMoving","onAddGroup","onMoveGroup","onRemoveGroup","followMouse","overflowMethod","tooltipOnItemUpdateTime","itemOptions","itemListeners","_onAdd","_onUpdate","_onRemove","groupListeners","_onAddGroups","_onUpdateGroups","_onRemoveGroups","groupIds","stackDirty","touchParams","groupTouchParams","box","_updateUngrouped","backgroundGroup","_onSelectItem","_onMultiSelectItem","groupHammer","_onGroupClick","_onGroupDragStart","_onGroupDrag","_onGroupDragEnd","DIRECTION_VERTICAL","_onMouseOver","_onMouseOut","addCallback","Function","dirty","displayed","hide","unselect","rawVisibleItems","visibleItems","_deselect","_orderGroups","visibleInterval","zoomed","lastVisibleInterval","restack","firstGroup","_firstGroup","firstMargin","nonFirstMargin","groupMargin","groupResized","firstGroupIndex","firstGroupId","ungrouped","_getGroupId","getLabelSet","oldItemsData","getItems","nestedGroups","nestedGroupId","updatedNestedGroup","nestedInGroup","showNested","_order","getGroups","removeItem","itemObj","popup","_getType","_removeItem","groupData","groupOptions","_orderNestedGroups","newGroupIdsOrder","nestedGroup","nestedGroupIds","oldGroupId","oldSubGroupId","subgroup","oldGroup","_constructByEndArray","endArray","dragLeftItem","dragRightItem","itemProps","_getGroupIndex","itemIsDragging","selectedItem","initialX","dragLeft","_cloneItemData","dragRight","baseGroupIndex","itemsToDrag","groupIndex","groupOffset","stopPropagation","metaKey","_onDragStartAddItem","xAbs","newItem","offsetLeft","updateGroupAllowed","newGroupBase","initial","updateTimeAllowed","initialEnd","initialStart","newOffset","_moveToGroup","collapsedDirClassName","originalOrder","movingUp","targetGroupTop","draggedGroupHeight","targetGroupHeight","targetGroup","draggedGroup","newOrder","origOrder","draggedId","numGroups","curPos","orgOffset","slippedPosition","switchGroup","shouldBeGroup","switchGroupId","shiftKey","oldSelection","newSelection","related","itemFromRelatedTarget","getTitle","setPopup","setPosition","offsetTop","_onUpdateItem","newItemData","itemGroup","lastSelectedGroup","multiselectPerGroup","_getItemRange","_item","itemFromElement","cur","relatedTarget","itemSetFromTarget","Popup","doShow","maxWidth","isLeft","isTop","minimumStep","autoScale","FORMAT","minorLabels","millisecond","second","minute","hour","weekday","majorLabels","setMoment","setFormat","defaultFormat","setMinimumStep","roundToMinor","hasNext","setScale","setAutoScale","stepYear","stepMonth","stepDay","stepHour","stepMinute","stepSecond","stepMillisecond","isMajor","getLabelMinor","getLabelMajor","getClassName","_moment","locale","lang","even","today","isSame","currentWeek","currentMonth","currentYear","subgroups","subgroupIndex","subgroupOrderer","subgroupOrder","isVisible","itemsInRange","byStart","byEnd","checkRangedItems","marker","templateFunction","paddingRight","paddingLeft","getLabelWidth","markerHeight","lastMarkerHeight","_calculateSubGroupHeights","_isGroupVisible","limitSize","customOrderedItems","_updateItemsInRange","nostack","_updateSubgroupsSizes","_calculateHeight","repositionY","resetSubgroups","setParent","orderSubgroups","_checkIfVisible","sortArray","sortField","removeFromDataSet","startArray","orderByStart","orderByEnd","oldVisibleItems","visibleItemsLookup","lowerBound","upperBound","searchFunction","_checkIfVisibleWithReference","initialPosByStart","_traceVisible","initialPosByEnd","initialPos","breakCondition","EPSILON","aTime","bTime","force","collidingItem","jj","collision","otherSubgroup","collisionByTimes","baseClassName","visibleFrame","_updateContents","_updateTitle","_updateDataAttributes","_updateStyle","_repaintOnItemUpdateTimeTooltip","_repaintDeleteButton","_repaintDragCenter","_repaintDragLeft","_repaintDragRight","parentWidth","contentStartPosition","boxWidth","groupChanged","dragCenter","dragCenterItem","anchor","deleteButton","onItemUpdateTimeTooltip","tooltipOffset","itemDistanceFromTop","isCloseToTop","template","itemVisibleFrameContent","visibleFrameTemplateFunction","frameElement","itemVisibleFrameContentElement","getElementsByClassName","visibleFrameTemplate","_contentToString","setText","dataAttributes","attributes","setAttribute","removeAttribute","outerHTML","msPerPixel","widthInMs","previousRight","previousLeft","itemSetHeight","marginLeft","marginRight","itemSubgroup","lines","majorTexts","minorTexts","lineTop","showMinorLabels","showMajorLabels","maxMinorChars","parentChanged","_calculateCharSize","minorLabelHeight","minorCharHeight","majorLabelHeight","majorCharHeight","minorLineHeight","minorLineWidth","majorLineHeight","majorLineWidth","foregroundNextSibling","nextSibling","backgroundNextSibling","_repaintLabels","timeLabelsize","minorCharWidth","xNext","nextIsMajor","prevWidth","labelMinor","xFirstMajorLabel","MAX","showMinorGrid","_repaintMinorText","_repaintMajorText","_repaintMajorLine","_repaintMinorLine","warnedForOverflow","leftTime","leftText","widthText","majorCharWidth","pop","createTextNode","childNodes","measureCharMinor","measureCharMajor","overlay","_onTapOverlay","onClick","_hasParent","deactivate","escListener","activate","unbind","locales","eventParams","warned","substring","showCurrentTime","bool","any","groupsDraggable","linegraph","initialLoad","getLegend","isGroupVisible","yAxisLeft","yAxisRight","legendLeft","legendRight","screenToValue","Bars","Lines","Points","yAxisOrientation","defaultGroup","sampling","graphHeight","shaded","barChart","sideBySide","interpolation","parametrization","dataAxis","legend","abortedGraphUpdate","updateSVGheight","updateSVGheightOnResize","forceGraphUpdate","lastStart","svgElements","groupsUsingDefaultStyles","svg","framework","_removeGroup","_updateAllGroupData","removeGroup","_updateGroup","addGroup","groupsContent","idMap","groupCounts","existing_items","extended","orginalY","_updateGraph","rangePerPixelInv","_getSortedGroupIds","grouplist","zIndex","bz","groupRanges","changeCalled","minDate","maxDate","_getRelevantData","_applySampling","_convertXcoordinates","_getYRanges","_updateYAxis","below","excludeFromStacking","_stack","_convertYcoordinates","paths","calcPath","subGroupId","drawShading","subData","subPrevPoint","subNextPoint","dateComparator","first","last","dataContainer","increment","amountOfPoints","xDistance","pointsPerPixel","sampledData","idx","combinedDataLeft","combinedDataRight","getYRange","getStackedYRange","yAxisLeftUsed","yAxisRightUsed","minLeft","minRight","maxLeft","maxRight","minVal","maxVal","ignore","_toggleAxisVisiblity","drawIcons","master","masterAxis","lineOffset","tempGroups","axisUsed","datapoints","screen_x","screen_y","svgHeight","convertValue","setZeroPosition","linegraphOptions","icons","majorLinesOffset","minorLinesOffset","labelOffsetX","labelOffsetY","iconWidth","alignZeros","linegraphSVG","DOMelements","labels","conversionFactor","minWidth","stepPixels","zeroCrossing","amountOfSteps","iconsRemoved","amountOfGroups","lineContainer","graphOptions","_redrawGroupIcons","iconHeight","iconOffset","groupArray","_cleanupIcons","activeGroups","_redrawLabels","_redrawTitle","customRange","autoScaleEnd","autoScaleStart","followScale","maxLabelSize","getLines","major","_redrawLabel","_redrawLine","titleWidth","titleCharHeight","characterHeight","largestWidth","textMinor","textMajor","textTitle","measureCharTitle","titleCharWidth","zeroAlign","formattingFunction","majorSteps","minorSteps","customLines","minorStepIdx","magnitudefactor","determineScale","rounded","setCharHeight","setHeight","minimumStepValue","orderOfMagnitude","solutionFound","l","stepSize","is_major","getFirstMajor","majorStep","formatValue","bottomOffset","oldStepIdx","oldStart","oldEnd","increaseMagnitude","decreaseMagnitude","otherZero","otherStep","newRange","myOriginalZero","majorOffset","zeroOffset","pixels","usingDefaultStyle","zeroPosition","drawIcon","icon","Bargraph","fillHeight","fillPath","outline","barWidth","originalWidth","bar1Height","bar2Height","processedGroupData","combinedData","intersections","coreDistance","drawData","barPoints","_getDataIntersections","heightOffset","_getSafeDrawData","nextKey","amount","resolved","prevKey","accumulatedNegative","accumulatedPositive","pointData","groupLabel","_getStackedYRange","xpos","getCallback","getGroupTemplate","callbackResult","Line","_catmullRom","_linear","pathArray","subPathArray","dFill","zero","serializePath","inverse","_catmullRomUniform","p0","p1","p2","p3","bp1","bp2","normalization","d1","d2","d3","A","N","M","d3powA","d2powA","d3pow2A","d2pow2A","d1pow2A","d1powA","side","iconSize","iconSpacing","excludeFromLegend","textArea","scrollableHeight","drawLegendIcons","paddingTop","Network","network","Images","dotparser","gephiParser","convertDot","DOTToGraph","convertGephi","parseGephi","nodes","nodeIndices","edges","edgeIndices","once","eventListeners","onTap","onDoubleTap","onHold","onDragStart","onDrag","onDragEnd","onPinch","onMouseMove","onContext","functions","createNode","createEdge","modules","view","bindEventListeners","images","selectionHandler","interactionHandler","renderer","layoutEngine","clustering","manipulation","nodesHandler","edgesHandler","layout","interaction","networkOptions","_updateVisibleIndices","nodeId","edgeId","_updateValueRange","unselectAll","dotData","gephi","gephiData","valueTotal","setValueRange","canvasToDOM","DOMtoCanvas","findNode","isCluster","openCluster","cluster","getNodesInCluster","clusterByConnection","clusterByHubsize","clusterOutliers","getSeed","enableEditMode","disableEditMode","addNodeMode","editNode","editNodeMode","addEdgeMode","editEdgeMode","deleteSelected","getPositions","storePositions","moveNode","getBoundingBox","getConnectedNodes","objectId","getConnectedEdges","startSimulation","stopSimulation","stabilize","getSelectedNodes","getSelectedEdges","getNodeAt","getEdgeAt","edge","selectNodes","selectEdges","getViewPosition","releaseNode","getOptionsFromConfigurator","imageBroken","url","imageToCache","brokenUrl","imageToLoadBrokenUrlOn","onerror","_addImageToCache","Image","imageToRedrawWith","cachedImage","img","onload","_redrawWithImage","_tryloadBrokenUrl","Groups","defaultIndex","groupsArray","defaultGroups","useDefaultGroups","optionFields","groupName","groupname","NodesHandler","nodesListeners","borderWidthSelected","brokenImage","fixed","face","strokeColor","vadjust","multi","bold","mod","boldital","ital","mono","code","image","labelHighlightBold","level","mass","scaling","maxVisible","drawThreshold","customScalingFunction","shadow","shape","shapeProperties","borderDashes","useImageSize","useBorderWithImage","nodeOptions","parseOptions","updateShape","updateLabelModule","_reset","doNotEmit","oldNodesData","newNodes","positionInitially","changedData","dataChanged","constructorClass","clearPositions","dataArray","boundingBox","nodeList","nodeObj","toId","fromId","edgeList","Node","imagelist","baseSize","baseFontSize","predefinedPosition","labelModule","currentShape","groupObj","choosify","imageObj","load","propagateFonts","chooser","chosen","chosenNode","shadowColor","shadowSize","shadowX","shadowY","constrain","distanceToBorder","sizeDiff","fontDiff","getFormattingValues","updateBoundingBox","resize","parentOptions","newOptions","parsedColor","Label","edgelabel","pointToSelf","fontOptions","yLine","isEdgeLabel","elementOptions","labelDirty","constrainWidth","maxWdt","minWdt","widthConstraint","widthConstraintMaximum","widthConstraintMinimum","constrainHeight","minHgt","valign","heightConstraint","heightConstraintMinimum","heightConstraintValign","chosenLabel","margins","widthBias","heightBias","mods","optionsFontMod","modOptionsArray","ratio","baseline","viewFontSize","calculateLabelSize","_drawBackground","_drawText","lineMargin","fontSize","_setAlignment","labelHeight","lineCount","blocks","block","_getColor","fontColor","strokeText","initialStrokeColor","_processLabel","markupSystem","system","decodeMarkupSystem","splitMarkdownBlocks","splitHtmlBlocks","beginable","spacing","buffer","modStack","modName","emitBlock","override","ch","unshift","selectedState","hoverState","nlLines","accumulate","addAndAccumulate","splitBlocks","words","atStart","measure","lastMeasure","pre","measureText","newOptionsArray","Box","_setMargins","differentState","textSize","getTextSize","roundRect","enableShadow","disableShadow","save","enableBorderDashes","disableBorderDashes","restore","NodeBase","adjustSizes","shadowBlur","shadowOffsetX","shadowOffsetY","setLineDash","dashes","Circle","diameter","_drawRawCircle","CircleImageBase","labelOffset","imageLoaded","globalAlpha","can2","ctx2","drawImage","iterations","labelDimensions","CircularImage","_swapToImageResizeWhenImageLoaded","_resizeImage","clip","_drawImageAtPosition","_drawImageLabel","Database","database","_distanceToBorder","Diamond","_resizeShape","_drawShape","ShapeBase","sizeMultiplier","Dot","Ellipse","ellipse","Icon","_icon","iconTextSpacing","neutralborderWidth","selectionLineWidth","Square","Star","Text","Triangle","TriangleDown","EdgesHandler","edgesListeners","arrows","scaleFactor","arrowStrikethrough","inherit","hoverWidth","selectionWidth","selfReferenceSize","smooth","forceDirection","roundness","emitChange","edgeData","edgeOptions","reconnectEdges","updateEdgeType","oldEdgesData","edgesData","oldEdge","disconnect","connect","cleanup","Edge","baseWidth","edgeType","connected","_setInteractionWidths","chosenEdge","toArrow","fromArrow","middleArrow","inheritsColor","toArrowScale","toArrowType","middleArrowScale","middleArrowType","fromArrowScale","fromArrowType","selectedWidth","changeInType","attachEdge","detachEdge","widthDiff","viaNode","getViaNode","arrowData","fromPoint","toPoint","getArrowData","core","drawLine","drawArrows","drawLabel","drawArrowHead","node1","node2","getPoint","translate","_rotateForLabelAlignment","_pointOnCircle","xFrom","yFrom","xTo","yTo","xObj","yObj","getDistanceToEdge","angleInDegrees","rotate","colorsDefined","CubicBezierEdge","viaNodes","via1","via2","bezierCurveTo","x1","y1","x2","y2","_getViaCoordinates","nearNode","_findBorderPositionBezier","x3","y3","_getDistanceToBezierEdge","vec","CubicBezierEdgeBase","minDistance","lastX","lastY","_getDistanceToLine","BezierEdgeBase","distanceToPoint","difference","via","EdgeBase","colorDirty","getColor","_drawDashedLine","_drawLine","_getCircleData","_circle","pattern","lineDashOffset","dashedLine","_findBorderPosition","_findBorderPositionCircle","grd","createLinearGradient","fromColor","toColor","addColorStop","_getDistanceToEdge","px","py","something","u","arrowPoint","guideOffset","findBorderPosition","guidePos","xi","yi","arrowCore","circleEndpoint","arrowEndpoint","BezierEdgeDynamic","_boundFunction","positionBezierNode","physicsChange","setupSupportNode","parentEdgeId","quadraticCurveTo","cr","BezierEdgeStatic","xVia","yVia","pi","originalAngle","myAngle","StraightEdge","edgeSegmentLength","toBorderDist","toBorderPoint","borderPos","PhysicsEngine","physicsBody","physicsNodeIndices","physicsEdgeIndices","forces","velocities","physicsEnabled","simulationInterval","requiresTimeout","previousStates","referenceState","freezeCache","renderTimer","adaptiveTimestep","adaptiveTimestepEnabled","adaptiveCounter","adaptiveInterval","stabilized","startedStabilization","stabilizationIterations","ready","barnesHut","theta","gravitationalConstant","centralGravity","springLength","springConstant","damping","avoidOverlap","forceAtlas2Based","repulsion","nodeDistance","hierarchicalRepulsion","maxVelocity","minVelocity","stabilization","updateInterval","onlyDynamicEdges","timestep","layoutFailed","initPhysics","updatePhysicsData","init","nodesSolver","edgesSolver","gravitySolver","modelOptions","viewFunction","simulationStep","_emitStabilized","startTime","physicsTick","physicsTime","runDoubleSpeed","amountOfIterations","calculateForces","moveNodes","revert","_evaluateStepQuality","nodeIds","positions","vx","vy","dpos","reference","posThreshold","maxNodeVelocity","averageNodeVelocity","velocityAdaptiveThreshold","nodeVelocity","_performStep","totalVelocity","solve","targetIterations","_freezeNodes","_stabilizationBatch","_finalizeStabilization","_restoreFrozenNodes","colorFactor","forceSize","arrowSize","BarnesHutSolver","barnesHutTree","randomSeed","thetaInversed","overlapAvoidanceFactor","nodeCount","_formBarnesHutTree","_getForceContribution","children","NW","NE","SW","SE","parentBranch","childrenCount","centerOfMass","calcSize","_calculateForces","gravityForce","fx","fy","minX","minY","maxX","maxY","minimumTreeSize","rootSize","halfRootSize","_splitBranch","_placeInTree","totalMass","totalMassInv","biggestSize","skipMassUpdate","_updateBranchMass","_placeInRegion","region","seededRandom","containedNode","_insertRegion","childSize","_drawBranch","branch","RepulsionSolver","repulsingForce","HierarchicalRepulsionSolver","steepness","SpringSolver","edgeLength","node3","_calculateSpringForce","springForce","HierarchicalSpringSolver","springFx","springFy","totalFx","totalFy","correctionFx","correctionFy","CentralGravitySolver","ForceAtlas2BasedRepulsionSolver","degree","ForceAtlas2BasedCentralGravitySolver","ClusterEngine","clusteredNodes","clusteredEdges","hubsize","_getHubSize","_checkOptions","nodesToCluster","refreshData","joinCondition","childNodesObj","childEdgesObj","clonedOptions","cloneOptions","_cluster","edgeCount","clusters","usedNodes","relevantEdgeCount","gatheringSuccessful","childNodeId","_getConnectedId","clusterByEdgeCount","clusterNodeProperties","parentNodeId","parentClonedOptions","childClonedOptions","childNodeIDs","childNode","childEdge","clusterEdgeProperties","otherNodeId","childKeys","createEdges","newEdge","clusteringEdgeReplacingId","edgeReplacedById","_backupEdgeOptions","allowSingleNodeCluster","processProperties","childNodesOptions","childEdgesOptions","clusterId","_getClusterPosition","clusterNode","containedNodes","containedEdges","_createClusterEdges","originalOptions","clusterNodeId","releaseFunction","clusterPosition","newPositions","edgesToBeDeleted","otherCluster","transferEdge","replacedEdge","_restoreEdge","nodesArray","reverse","clusteredNodeId","startEdgeId","allEdgeIds","getClusteredEdges","clusteredEdgeId","baseEdgeId","average","averageSquared","hubCounter","largestHub","variance","standardDeviation","hubThreshold","NetworkUtil","allNodes","specificNodes","amountOfConnections","Cluster","mozRequestAnimationFrame","webkitRequestAnimationFrame","msRequestAnimationFrame","CanvasRenderer","redrawRequested","renderingActive","renderRequests","allowRedraw","hideEdgesOnDrag","hideNodesOnDrag","_determineBrowserMethod","_resizeNodes","_requestRedraw","_startRendering","cancelAnimationFrame","_renderStep","_drawEdges","_drawNodes","alwaysShow","topLeft","bottomRight","viewableArea","isSelected","isBoundingBoxOverlappingWith","browserType","Canvas","resizeTimer","resizeFunction","cameraState","canvasViewCenter","hammerFrame","_cleanUp","previousWidth","previousHeight","widthRatio","heightRatio","newScale","currentViewCenter","distanceFromCenter","tabIndex","_prepareValue","emitEvent","oldWidth","oldHeight","previousRatio","_getCameraState","_setCameraState","_XconvertCanvasToDOM","_YconvertCanvasToDOM","_XconvertDOMtoCanvas","_YconvertDOMtoCanvas","View","animationSpeed","renderRefreshRate","animationEasingFunction","easingTime","sourceScale","targetScale","sourceTranslation","targetTranslation","lockedOnNodeId","lockedOnNodeOffset","touchTime","initialZoom","zoomLevel","positionDefined","numberOfNodes","yDistance","xZoomLevel","yZoomLevel","findCenter","animationOptions","nodePosition","lockedOnNode","animateView","locked","_transitionRedraw","viewCenter","_lockedRedraw","finished","InteractionHandler","navigationHandler","popupObj","popupTimer","dragNodes","dragView","keyboard","speed","bindToWindow","navigationButtons","tooltipDelay","zoomView","pinched","changedPointers","checkSelectionChanges","_generateClickEvent","previouslySelectedEdgeCount","_getSelectedEdgeCount","previouslySelectedNodeCount","_getSelectedNodeCount","previousSelection","selectAdditionalOnPoint","selectOnPoint","selectedEdgesCount","selectedNodesCount","currentSelection","_determineIfDifferent","nodesChanged","edgesChanged","nodeSelected","selectObject","selectionObj","xFixed","yFixed","scaleOld","preScaleDragPointer","scaleFrac","tx","ty","postScaleDragPointer","popupVisible","_checkHidePopup","_checkShowPopup","hoverObject","pointerObj","previousPopupObjId","nodeUnderCursor","popupType","overlappingNodes","isOverlappingWith","overlappingEdges","popupTargetType","popupTargetId","_pointerToPositionObject","stillOnObj","overNode","NavigationHandler","iconsCreated","navigationHammers","boundFunctions","activated","configureKeyboardBindings","loadNavigationElements","cleanNavigation","navigationDOM","navigationDivs","navigationDivActions","_fit","bindToRedraw","_stopMovement","boundAction","reset","unbindFromRedraw","SelectionHandler","hoverObj","selectConnectedEdges","hoverConnectedEdges","updateSelection","selectionChanged","deselectObject","eventType","emptySelection","DOM","highlightEdges","_selectConnectedEdges","_addToSelection","_removeFromSelection","canvasPos","returnNode","positionObject","_getAllNodesOverlappingWith","_getEdgesOverlappingWith","returnEdge","mindist","overlappingEdge","_unselectConnectedEdges","clusterSize","_addToHover","hoverChanged","blurObject","_hoverConnectedEdges","edgeIds","idArray","RangeError","LayoutEngine","initialRandomSeed","setPhysics","optionsBackup","improvedLayout","hierarchical","levelSeparation","nodeSpacing","treeSpacing","blockShifting","edgeMinimization","parentCentralization","sortMethod","setupHierarchicalLayout","layoutNetwork","prevHierarchicalState","adaptAllOptionsForHierarchicalLayout","MAX_LEVELS","clusterThreshold","startLength","before","clusterBridges","after","_declusterAll","info","kamadaKawai","_shiftToCenter","getRangeCore","clustersPresent","definedLevel","definedPositions","undefinedLevel","hierarchicalLevels","lastNodeOnLevel","hierarchicalChildrenReference","hierarchicalParentReference","hierarchicalTrees","treeIndex","distributionOrdering","distributionIndex","distributionOrderingPresence","_determineLevelsByHubsize","_determineLevelsDirected","_determineLevelsCustomCallback","distribution","_getDistribution","_generateMap","_placeNodesByHierarchy","_condenseHierarchy","stillShifting","branches","shiftTrees","treeSizes","getTreeSizes","shiftTree","_getPositionForHierarchy","_setPositionForHierarchy","getTreeSize","treeWidths","getBranchNodes","source","getBranchBoundary","branchMap","maxLevel","minSpace","maxSpace","branchNode","_getSpaceAroundNode","minSpaceNode","maxSpaceNode","getMaxLevel","getCollisionLevel","maxLevel1","maxLevel2","hasSameParent","parents1","parents2","shiftElementsCloser","levels","centerParents","levelNodes","branchShiftCallback","centerParent","pos1","pos2","diffAbs","branchNodes1","branchNodes2","min1","max1","minSpace1","maxSpace1","min2","max2","minSpace2","maxSpace2","diffBranch","_shiftBlock","_centerParent","minimizeEdgeLength","allEdges","nodeLevel","C2","referenceNodes","aboveEdges","otherNode","getFx","getDFx","getGuess","guess","guessMap","dfx","limit","moveBranch","branchNodes","minBranch","maxBranch","minSpaceBranch","maxSpaceBranch","branchOffset","newPosition","minimizeEdgeLengthBottomUp","shiftBranchesCloserBottomUp","centerAllParents","centerAllParentsBottomUp","useMap","prevNode","prevPos","nextNode","nextPos","parents","parentId","minPos","maxPos","positionedNodes","nodeArray","_indexArrayToNodes","_sortNodeArray","handledNodeCount","_validataPositionAndContinue","parentLevel","childNodeLevel","previousPos","sharedParent","_findCommonParent","withChild","_placeBranchNodes","hubSize","levelDownstream","nodeA","nodeB","_crawlNetwork","minLevel","customCallback","levelByDirection","levelA","_setMinLevelToZero","fillInRelations","startingNodeId","crawler","tree","childA","childB","iterateParents","child","findParent","foundParent","doNotUpdate","ManipulationSystem","editMode","manipulationDiv","editModeDiv","closeDiv","manipulationHammers","temporaryUIFunctions","temporaryEventFunctions","temporaryIds","guiEnabled","inMode","selectedControlNode","initiallyActive","addNode","addEdge","editEdge","deleteNode","deleteEdge","controlNodeStyle","_restore","_setup","showManipulatorToolbar","_createEditButton","manipulationDOM","selectedNodeCount","selectedEdgeCount","selectedTotalCount","needSeperator","_createAddNodeButton","_createSeperator","_createAddEdgeButton","_createEditNodeButton","_createEditEdgeButton","_createDeleteButton","_bindHammerToDiv","toggleEditMode","_temporaryBindEvent","_createBackButton","_createDescription","_performAddNode","_getSelectedNode","finalizedData","_temporaryBindUI","_handleConnect","_finishConnect","_dragControlNode","editWithoutDrag","edgeBeingEditedId","_performEditEdge","controlNodeFrom","_getNewTargetNode","controlNodeTo","_controlNodeTouch","_controlNodeDragStart","_controlNodeDrag","_controlNodeDragEnd","findBorderPositions","selectedNodes","selectedEdges","deleteFunction","_createWrappers","_removeManipulationDOM","_createButton","_cleanManipulatorHammers","_cleanupTemporaryNodesAndEdges","_unbindTemporaryUIs","_unbindTemporaryEvents","deleteBtnClass","labelClassName","newFunction","boundFunction","UIfunctionName","functionName","eventName","domElement","indexTempEdge","indexTempNode","lastTouch","fromSelect","toSelect","overlappingNodeIds","targetNode","connectionEdge","connectFromId","_performAddEdge","clickData","defaultData","sourceNodeId","targetNodeId","eeFunct","boolean","maximum","minimum","KamadaKawai","edgeStrength","distanceSolver","edgesArray","ignoreClusters","D_matrix","getDistances","_createL_matrix","_createK_matrix","innerThreshold","maxInnerIterations","maxEnergy","highE_nodeId","dE_dx","dE_dy","delta_m","subIterations","_getHighestEnergyNode","_moveNode","_getEnergy","maxEnergyNodeId","dE_dx_max","dE_dy_max","nodeIdx","x_m","y_m","iIdx","x_i","y_i","denominator","K_matrix","L_matrix","d2E_dx2","d2E_dxdy","d2E_dy2","D","E","FloydWarshall","CanvasRenderingContext2D","square","s2","ir","triangleDown","star","diamond","r2d","kappa","ox","oy","xe","ye","xm","ym","wEllipse","hEllipse","ymb","yeb","xt","yt","xl","yl","xr","yr","xc","yc","patternLength","slope","distRemaining","patternIndex","dashLength","parseDOT","parseGraph","NODE_ATTR_MAPPING","EDGE_ATTR_MAPPING","TOKENTYPE","NULL","DELIMITER","IDENTIFIER","UNKNOWN","DELIMITERS","token","tokenType","nextPreview","regexAlphaNumeric","isAlphaNumeric","merge","setValue","keys","o","graphs","attr","getToken","isComment","c2","newSyntaxError","chop","strict","parseStatements","parseStatement","subgraph","parseSubgraph","parseEdge","parseAttributeStatement","parseNodeStatement","subgraphs","parseAttributeList","message","maxLength","forEach2","array1","array2","elem1","elem2","setProp","names","convertAttr","mapping","visProp","visPropI","graphData","dotNode","graphNode","convertEdge","dotEdge","graphEdge","subEdge","gephiJSON","inheritColor","gEdges","gNodes","gEdge","gNode","edit","del","back","addDescription","edgeDescription","editEdgeDescription","createEdgeError","deleteClusterError","editClusterError"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;ACtCA,MAAIA,OAAO,mBAAAC,CAAQ,CAAR,CAAX;;AAEA;AACAD,OAAKE,MAAL,CAAYC,OAAZ,EAAqB,mBAAAF,CAAQ,EAAR,CAArB;;AAEA;AACAD,OAAKE,MAAL,CAAYC,OAAZ,EAAqB,mBAAAF,CAAQ,GAAR,CAArB;;AAEA;AACAD,OAAKE,MAAL,CAAYC,OAAZ,EAAqB,mBAAAF,CAAQ,GAAR,CAArB,E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACTA;;AAEA;AACA;;;AAGA,MAAIG,SAAS,mBAAAH,CAAQ,EAAR,CAAb;AACA,MAAII,OAAO,mBAAAJ,CAAQ,EAAR,CAAX;;AAEA;;;;;AAKAE,UAAQG,QAAR,GAAmB,UAAUC,MAAV,EAAkB;AACnC,WAAQA,kBAAkBC,MAAlB,IAA4B,OAAOD,MAAP,IAAiB,QAArD;AACD,GAFD;;AAIA;;;;;AA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,EAAe;AACbA,0BAAYA,UAAUD,UAAUxN,CAAV,CAAV,CAAZ;AACD,aAFD,MAEO;AACL;AACD;AACF;AACD,cAAI,OAAOyN,SAAP,IAAoB,WAAxB,EAAqC;AACnC;AACD;AACF;AACF;AAnB0C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAoB3C,WAAOA,SAAP;AACD,GArBD,C;;;;;;AC79CA,oBAAkB,uD;;;;;;ACAlB;AACA;AACA,2C;;;;;;ACFA;AACA;AACA;AACA;AACA;;AAEA,0GAAwG,OAAO;AAC/G;AACA;AACA;AACA;AACA;AACA,G;;;;;;ACZA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kCAAgC;AAChC,gBAAc;AACd,mBAAiB;AACjB;AACA,GAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAC;;AAED;AACA;;AAEA;AACA;AACA,8B;;;;;;ACjCA,8BAA4B,e;;;;;;ACA5B;AACA,YAAU;AACV,I;;;;;;ACFA,sB;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA,I;;;;;;ACLA;AACA;AACA;AACA;AACA,I;;;;;;ACJA,mBAAiB;;AAEjB;AACA;AACA,I;;;;;;ACJA;AACA;AACA;AACA;AACA,I;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,8BAA4B,aAAa;;AAEzC;AACA;AACA;AACA;AACA;AACA,0CAAwC,oCAAoC;AAC5E,8CAA4C,oCAAoC;AAChF,OAAK,2BAA2B,oCAAoC;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAgB,mBAAmB;AACnC;AACA;AACA,mCAAiC,2BAA2B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAK;AACL;AACA;AACA,I;;;;;;ACrEA,wB;;;;;;ACAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qEAAmE;AACnE;AACA,uFAAqF;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAW;AACX,WAAS;AACT;AACA;AACA;AACA;AACA,OAAK;AACL;AACA;AACA,iDAA+C;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,gBAAc;AACd,gBAAc;AACd,gBAAc;AACd,gBAAc;AACd,iBAAe;AACf,iBAAe;AACf,iBAAe;AACf,kBAAgB;AAChB,2B;;;;;;AC5DA;AACA;AACA;AACA,yCAAuC,gC;;;;;;ACHvC,+BAA6B;AAC7B,uCAAqC,gC;;;;;;ACDrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,I;;;;;;ACnBA;AACA;AACA;AACA,I;;;;;;ACHA;AACA;AACA;AACA;AACA,GAAC;AACD;AACA;AACA,I;;;;;;ACPA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAG,UAAU;AACb;AACA;AACA;AACA,I;;;;;;ACfA;AACA;AACA;AACA;AACA,I;;;;;;ACJA;AACA;AACA,I;;;;;;ACFA;AACA,uEAAsE,gBAAgB,UAAU,GAAG;AACnG,GAAC,E;;;;;;ACFD;AACA;AACA,mCAAiC,QAAQ,gBAAgB,UAAU,GAAG;AACtE,GAAC,E;;;;;;ACHD;AACA;AACA;AACA,KAAG;AACH;AACA;AACA,I;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA,I;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,I;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,I;;;;;;ACPA,2C;;;;;;ACAA,yBAAuB;AACvB;AACA;AACA,I;;;;;;ACHA;AACA;AACA;AACA;AACA;;AAEA;AACA,6FAAgF,aAAa,EAAE;;AAE/F;AACA,uDAAqD,0BAA0B;AAC/E;AACA,I;;;;;;ACZA;AACA;AACA;AACA;AACA;AACA,+BAA6B;AAC7B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAG;AACH;AACA;;;;;;;ACxCA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,I;;;;;;ACZA;AACA;AACA;;AAEA;AACA;AACA,I;;;;;;ACNA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,I;;;;;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAK,WAAW,eAAe;AAC/B;AACA,OAAK;AACL;AACA,I;;;;;;ACpBA;AACA;AACA;AACA;AACA,6DAA2D;AAC3D,I;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA,I;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA,I;;;;;;ACNA;AACA;AACA;AACA;AACA,I;;;;;;ACJA;AACA;AACA,qDAAmD;AACnD;AACA,yCAAuC;AACvC,I;;;;;;ACLA;AACA;AACA;AACA;AACA,I;;;;;;ACJA;AACA;AACA;AACA,e;;;;;;ACHA,gF;;;;;;ACAA;AACA;AACA;;AAEA;AACA,oEAAkE,+BAA+B;AACjG,I;;;;;;ACNA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,yB;;;;;;ACVA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAG;AACH,I;;;;;;ACZA;AACA;AACA;AACA;AACA,I;;;;;;ACJA;AACA;;AAEA;AACA;AACA,+BAA6B;AAC7B,gBAAc;AACd;AACA,GAAC;AACD;AACA;AACA;AACA,iCAA+B;AAC/B;AACA;AACA,YAAU;AACV,GAAC,E;;;;;;AChBD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,I;;;;;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA,I;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,I;;;;;;ACPA;AACA;AACA;AACA;AACA,2BAAyB,kBAAkB,EAAE;;AAE7C;AACA;AACA;AACA;AACA,KAAG,UAAU;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,I;;;;;;ACtBA,oBAAkB,wD;;;;;;ACAlB;AACA;AACA;AACA;AACA,I;;;;;;ACJA;AACA;AACA,gCAA8B,gCAAoC,E;;;;;;ACFlE,oBAAkB,wD;;;;;;ACAlB;AACA,uD;;;;;;ACDA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAC,E;;;;;;ACRD;AACA;AACA;AACA;AACA;AACA,gCAA8B;AAC9B;AACA;AACA,qDAAmD,OAAO,EAAE;AAC5D,I;;;;;;ACTA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,mHAAiH,mBAAmB,EAAE,mBAAmB,4JAA4J;;AAErT,wCAAsC,uCAAuC,gBAAgB;;AAE7F;AACA;AACA,GAAC;AACD;AACA,I;;;;;;ACpBA,oBAAkB,wD;;;;;;ACAlB;AACA;AACA,yD;;;;;;ACFA,sC;;;;;;ACAA,oBAAkB,wD;;;;;;ACAlB;AACA;AACA;AACA;AACA,kD;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,wBAAsB;AACtB,sBAAoB,uBAAuB,SAAS,IAAI;AACxD,KAAG;AACH,GAAC;AACD;AACA;AACA;AACA;AACA,GAAC;;AAED;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAC;AACD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAAyD;AACzD;AACA,OAAK;AACL;AACA,wBAAsB,iCAAiC;AACvD,OAAK;AACL,KAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAA8D,8BAA8B;AAC5F;AACA;AACA;AACA;AACA,KAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,4DAA0D,gBAAgB;;AAE1E;AACA;AACA;AACA,sBAAoB,oBAAoB;;AAExC,4CAA0C,oBAAoB;;AAE9D;AACA;AACA;AACA;AACA;AACA;AACA,KAAG;AACH;AACA;AACA;AACA;AACA,KAAG;AACH,0BAAwB,eAAe,EAAE;AACzC,0BAAwB,gBAAgB;AACxC,GAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,sDAAoD,KAAK,QAAQ,iCAAiC;AAClG,GAAC;AACD;AACA,iDAA+C;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4C;;;;;;AC1OA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAiD;AACjD,GAAC;AACD;AACA,uBAAqB;AACrB;AACA,WAAS;AACT,MAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,I;;;;;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA0D,sBAAsB;AAChF,kFAAgF,sBAAsB;AACtG,I;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,I;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAG;AACH,I;;;;;;ACdA,2C;;;;;;ACAA,gBAAc,sB;;;;;;ACAd;AACA;AACA;AACA;AACA,I;;;;;;ACJA;AACA;AACA;AACA,oBAAkB;;AAElB;AACA;;AAEA;AACA;AACA;AACA,KAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;;;;;;AClBA;AACA;AACA;;AAEA;AACA;AACA,I;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAG,UAAU;AACb;AACA,I;;;;;;;;;;;;ACfA,2C;;;;;;ACAA,wC;;;;;;ACAA,oBAAkB,wD;;;;;;ACAlB;AACA,yCAAuC,0BAA0B;AACjE,0CAAwC;AACxC;AACA,I;;;;;;;;ACJA;AACA;AACAE,SAAOvQ,OAAP,GAAkB,OAAOoH,MAAP,KAAkB,WAAnB,IAAmCA,OAAO,QAAP,CAAnC,IAAuD,mBAAAtH,CAAQ,EAAR,CAAxE,C;;;;;;ACFA;AACA;AACA;AACA;AACA;;AAEA,GAAC;AACD;AACA;AACA;AACA,GAAC,qBAAqB;;AAEtB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,iBAAe,gBAAgB;AAC/B;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAC;AACD;AACA;AACA;;AAEA,yBAAuB,SAAS;AAChC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA2B,sBAAsB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA,6CAA2C;AAC3C,mBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAK;AACL;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,oFAAkF,IAAI;AACtF;;AAEA;AACA,yBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,eAAa;AACb;AACA,eAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAiC;AACjC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,OAAK;;AAEL;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,gCAA8B,IAAI;;AAElC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,8BAA4B;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,sBAAoB,iCAAiC;AACrD;AACA;AACA;AACA,OAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,yBAAuB,wBAAwB;AAC/C;AACA;AACA,OAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,0LAAwL,IAAI;;AAE5L,mEAAiE,IAAI;;AAErE;;AAEA;;AAEA;AACA;AACA;AACA,4BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,wCAAsC,YAAY;AAClD;AACA;AACA,WAAS;AACT;AACA;AACA;;AAEA;AACA;AACA,qBAAmB,YAAY;AAC/B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,4BAA0B;AAC1B,8BAA4B;AAC5B,2BAAyB,EAAE,EAAE;AAC7B,2BAAyB,EAAE,EAAE;AAC7B,gCAA8B,EAAE,EAAE;AAClC,+BAA6B;AAC7B,mCAAiC;AACjC,uCAAqC;AACrC,2BAAyB,IAAI,EAAE;AAC/B,2BAAyB,IAAI,EAAE;AAC/B,gCAA8B,IAAI,EAAE;;AAEpC,6BAA2B;AAC3B,kCAAgC;;AAEhC,4CAA0C;AAC1C,mDAAiD;;AAEjD,sCAAoC,IAAI,IAAI;;AAE5C;AACA;AACA,8HAA4H,IAAI;;;AAGhI;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAK;AACL;;AAEA;AACA,4CAA0C;AAC1C;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAe,kBAAkB;AACjC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAC;AACD;AACA;AACA;AACA,qBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAC;;AAED;AACA;AACA,GAAC;;AAED;AACA;AACA,GAAC;;AAED;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAC;AACD;AACA;AACA,GAAC;;AAED;AACA;AACA,GAAC;;AAED;AACA;AACA;AACA;AACA;AACA,OAAK;AACL;AACA;AACA,GAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAmB,QAAQ;AAC3B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAS;AACT;AACA;AACA;AACA,OAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAS;AACT;AACA,WAAS;AACT;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAS;AACT;AACA;AACA,OAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAS;AACT;AACA;AACA,OAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAe,QAAQ;AACvB;AACA;AACA;AACA,iBAAe,QAAQ;AACvB;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,GAAC;;AAED;AACA;AACA,GAAC;;AAED;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAC;AACD;AACA;AACA,GAAC;AACD;AACA;AACA,GAAC;;AAED;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAK;AACL;AACA;AACA,OAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAK;AACL;AACA;AACA,OAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAC;;AAED;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA,GAAC;;AAED;AACA;AACA,GAAC;;AAED;AACA;AACA,GAAC;;AAED;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAC;AACD;AACA;AACA,GAAC;AACD;AACA;AACA,GAAC;;AAED;AACA;AACA;AACA;AACA;AACA,OAAK;AACL;AACA;AACA,GAAC;;AAED;AACA;AACA,GAAC;;AAED;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,qBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAS;AACT;AACA;AACA,WAAS;AACT;AACA;AACA;AACA,OAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAe,OAAO;AACtB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAS;AACT;AACA,WAAS;AACT;AACA,WAAS;AACT;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAS;AACT;AACA;AACA,OAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAS;AACT;AACA;AACA,OAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAS;AACT;AACA;AACA,OAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAC;;AAED;AACA;AACA;AACA,GAAC;;AAED;AACA;AACA,GAAC;;AAED;AACA;AACA;AACA,GAAC;;AAED;AACA;AACA;AACA,OAAK;AACL;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAC;AACD;AACA;AACA;AACA,GAAC;AACD;AACA;AACA;AACA;AACA;AACA,GAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAC;AACD;AACA;AACA;AACA;AACA,GAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,GAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAK;AACL;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAS,YAAY;AACrB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAS;AACT;AACA;AACA,eAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,mBAAiB;AACjB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAa;AACb;;AAEA;AACA;AACA;AACA;;;AAGA;AACA,OAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAK;AACL;AACA;AACA;AACA;AACA,eAAa;AACb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,yCAAuC,EAAE,IAAI,EAAE;AAC/C,sCAAoC,EAAE,IAAI,EAAE;;AAE5C;;AAEA;AACA,+BAA6B,EAAE;AAC/B,yBAAuB,EAAE;AACzB,2BAAyB,EAAE;AAC3B,yBAAuB,EAAE;AACzB,uBAAqB,EAAE,IAAI,EAAE;AAC7B,sBAAoB,EAAE;AACtB,6BAA2B,GAAG;AAC9B,uBAAqB,EAAE;AACvB;AACA,yBAAuB,EAAE,IAAI,EAAE;AAC/B,wBAAsB,EAAE,IAAI,EAAE;AAC9B,sBAAoB,EAAE;AACtB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,0CAAwC,OAAO;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,OAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAe,+BAA+B;AAC9C;AACA;;AAEA;AACA,YAAU,OAAO;AACjB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAK;AACL;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,OAAK;AACL;AACA,OAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,iBAAe,mBAAmB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,iBAAe,sBAAsB;AACrC;AACA,oCAAkC;AAClC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,gCAA8B,gBAAgB;AAC9C;;AAEA;AACA;AACA;;AAEA;AACA;AACA,OAAK;AACL;AACA,OAAK;AACL;AACA,OAAK;AACL;AACA,OAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAK;AACL;AACA,OAAK;AACL;AACA,OAAK;AACL;AACA;AACA,WAAS;AACT;AACA,OAAK;AACL;AACA,OAAK;AACL;AACA;AACA,OAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAe,oBAAoB;AACnC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iCAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAK;AACL;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAK;AACL;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAC;;AAED;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,OAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,OAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAK;AACL;AACA;AACA;AACA,WAAS;AACT;AACA;AACA,OAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAK,6BAA6B;AAClC;AACA,OAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iBAAe;;AAEf;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kBAAgB;AAChB;;AAEA;AACA;AACA;AACA,OAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAsB,cAAc;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,WAAS;AACT;AACA;AACA,OAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAS;AACT;AACA;AACA,OAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iCAA+B,qBAAqB;AACpD,OAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iCAA+B,qBAAqB;AACpD,OAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,sBAAoB;AACpB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAC;;AAED;AACA;AACA,GAAC;;AAED;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAC;;AAED;AACA;AACA,GAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,GAAC;;AAED;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAC;;AAED;AACA;AACA;AACA,GAAC;;AAED;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAC;;AAED;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA,GAAC;;AAED;AACA;AACA,GAAC;;AAED;AACA;AACA;AACA,GAAC;AACD;AACA;AACA,GAAC;AACD;AACA;AACA,GAAC;AACD;AACA;AACA,GAAC;AACD;AACA;AACA,GAAC;AACD;AACA;AACA,GAAC;;;AAGD;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,sBAAoB,mBAAmB;AACvC;AACA;;AAEA;AACA;AACA;;AAEA,mBAAiB,mBAAmB;AACpC;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,iBAAe,QAAQ;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,iBAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,wBAAsB,IAAI;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAC;;AAED;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,OAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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AAR,CAAkBugB,OAAlB,GAA4B,UAASjnB,KAAT,EAAgBC,MAAhB,EAAwB;AACnD,SAAKqY,QAAL,CAActY,KAAd,EAAqBC,MAArB;AACA,SAAKyW,MAAL;AACA,GAHD;;AAKA;AACA;AACA;;;AAGAzV,SAAOvQ,OAAP,GAAiBgT,OAAjB,C;;;;;;;ACv4EA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAW,OAAO;AAClB,cAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAW,OAAO;AAClB,aAAW,SAAS;AACpB,cAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAW,OAAO;AAClB,aAAW,SAAS;AACpB,cAAY;AACZ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAW,OAAO;AAClB,aAAW,SAAS;AACpB,cAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,mBAAiB,sBAAsB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAW,OAAO;AAClB,aAAW,MAAM;AACjB,cAAY;AACZ;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,6CAA2C,SAAS;AACpD;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,aAAW,OAAO;AAClB,cAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAW,OAAO;AAClB,cAAY;AACZ;AACA;;AAEA;AACA;AACA;;;;;;;;;ACnKA;;;;;;AAMA,WAASK,OAAT,CAAiBoB,CAAjB,EAA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A;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAO;;AAEP;AACA;;AAEA;AACA;AACA,iBAAe,OAAO;AACtB,iBAAe,SAAS;AACxB;AACA;AACA,mBAAiB,eAAe;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAW;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAO;;AAEP;AACA;;AAEA;AACA;AACA,iBAAe,OAAO;AACtB,iBAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,0BAAwB,uBAAuB;AAC/C;AACA,2CAAyC,kCAAkC;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAC;;;;;;;ACtOD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,aAAW,SAAS;AACpB,aAAW,OAAO;AAClB,aAAW,OAAO;AAClB,eAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAW,QAAQ;AACnB,aAAW,OAAO;AAClB,aAAW,OAAO;AAClB,eAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAW,OAAO;AAClB,aAAW,SAAS;AACpB,aAAW,OAAO;AAClB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,OAAK;AACL;AACA;AACA;AACA;AACA;AACA,OAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAW,SAAS;AACpB,aAAW,OAAO;AAClB,aAAW,OAAO;AAClB,eAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAqD,UAAU;;AAE/D;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAW,OAAO;AAClB,aAAW,UAAU;AACrB,eAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,6BAA2B,0BAA0B;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAC;AACD;AACA;;AAEA;AACA;AACA;AACA,aAAW,OAAO;AAClB,aAAW,OAAO;AAClB,aAAW,QAAQ;AACnB,eAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAC;;AAED;AACA;AACA;AACA,aAAW,OAAO;AAClB,aAAW,OAAO;AAClB,eAAa,OAAO;AACpB;AACA;AACA;AACA,GAAC;;AAED;AACA;AACA,aAAW,SAAS;AACpB,aAAW,SAAS;AACpB,aAAW,OAAO;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAW,SAAS;AACpB,aAAW,OAAO;AAClB,eAAa;AACb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAW,iBAAiB;AAC5B,aAAW,MAAM;AACjB,eAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAW,EAAE;AACb,aAAW,EAAE;AACb,eAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAW,YAAY;AACvB,aAAW,OAAO;AAClB,aAAW,SAAS;AACpB;AACA;AACA;AACA;AACA,OAAK;AACL;;AAEA;AACA;AACA,aAAW,YAAY;AACvB,aAAW,OAAO;AAClB,aAAW,SAAS;AACpB;AACA;AACA;AACA;AACA,OAAK;AACL;;AAEA;AACA;AACA;AACA,aAAW,YAAY;AACvB,aAAW,YAAY;AACvB,cAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAW,OAAO;AAClB,aAAW,OAAO;AAClB,eAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAW,OAAO;AAClB,eAAa,MAAM;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAW,MAAM;AACjB,aAAW,OAAO;AAClB,aAAW,OAAO;AAClB,cAAY,eAAe;AAC3B;AACA;AACA;AACA;AACA,OAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAW,OAAO;AAClB,eAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAW,MAAM,OAAO,KAAK,EAAE,KAAK,EAAE,KAAK;AAC3C,aAAW,OAAO;AAClB,aAAW,QAAQ;AACnB,eAAa,MAAM,GAAG,KAAK,EAAE,KAAK;AAClC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAS;AACT;AACA;AACA,eAAa;AACb;AACA;;AAEA;AACA;;AAEA;AACA;AACA,aAAW,OAAO;AAClB,aAAW,OAAO;AAClB,eAAa,iBAAiB;AAC9B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAW,YAAY;AACvB,eAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,aAAW,QAAQ;AACnB,aAAW,SAAS;AACpB,eAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,2BAAyB,EAAE;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAW,OAAO;AAClB,eAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAK;AACL;AACA,OAAK;AACL;AACA,OAAK;AACL;AACA,OAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAW,QAAQ;AACnB,aAAW,OAAO;AAClB,aAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,aAAW,OAAO;AAClB,aAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,aAAW,OAAO;AAClB,aAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAW,OAAO;AAClB,eAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAW,MAAM;AACjB,cAAY,OAAO;AACnB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAW,OAAO;AAClB,aAAW,OAAO;AAClB,aAAW,OAAO;AAClB,cAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAW,OAAO;AAClB,aAAW,OAAO;AAClB,cAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAW,OAAO,KAAK;AACvB,aAAW,OAAO,KAAK;AACvB,aAAW,MAAM;AACjB,cAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,aAAW,OAAO;AAClB,aAAW,OAAO;AAClB,aAAW,MAAM;AACjB,cAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAW,MAAM;AACjB,aAAW,MAAM;AACjB,cAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAW,MAAM;AACjB,aAAW,MAAM;AACjB,cAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,2BAAyB;;AAEzB;AACA;;AAEA;AACA;AACA;AACA,iBAAe,OAAO;AACtB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAS;AACT;AACA,GAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,iBAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAS;;AAET;AACA;AACA;AACA;AACA;AACA,GAAC;;AAED;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAS;AACT;AACA,GAAC;;AAED;AACA,YAAU;AACV,aAAW,OAAO;AAClB,aAAW,OAAO;AAClB,eAAa,gBAAgB;AAC7B;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAS;AACT;AACA,GAAC;;AAED;AACA,YAAU;AACV,aAAW,OAAO;AAClB,aAAW,OAAO;AAClB,eAAa,gBAAgB;AAC7B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAe,OAAO;AACtB,iBAAe,OAAO;AACtB,iBAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAS;AACT;AACA;;AAEA;AACA,OAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAC;;AAED;AACA;AACA;AACA;AACA,OAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA,2BAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAmB,6BAA6B;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,iDAA+C;AAC/C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAW,QAAQ;AACnB,aAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,OAAK;;AAEL;AACA;AACA,mBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAS;AACT;AACA,OAAK;;AAEL;AACA;AACA,iBAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAK;;AAEL;AACA;AACA,iBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAW,OAAO;AAClB,eAAa;AACb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAK;AACL;AACA;;AAEA;AACA,+BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAW,OAAO;AAClB;AACA;AACA,8BAA4B,8BAA8B;;AAE1D;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,gBAAc;AACd;AACA,kBAAgB;;AAEhB;AACA;AACA,iBAAe,OAAO;AACtB,kBAAgB;AAChB;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAK;;AAEL;AACA;AACA,iBAAe,WAAW;AAC1B,mBAAiB,WAAW;AAC5B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAK;;AAEL;AACA;AACA,iBAAe,WAAW;AAC1B,mBAAiB,WAAW;AAC5B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAK;;AAEL;AACA;AACA,iBAAe,WAAW;AAC1B,mBAAiB,WAAW;AAC5B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAK;;AAEL;AACA;AACA,iBAAe,WAAW;AAC1B,mBAAiB,WAAW;AAC5B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAK;;AAEL;AACA;AACA,mBAAiB;AACjB;AACA;AACA;AACA,OAAK;;AAEL;AACA;AACA,iBAAe,WAAW;AAC1B,mBAAiB;AACjB;AACA;AACA;AACA,OAAK;;AAEL;AACA;AACA;AACA,iBAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,mCAAiC;;AAEjC,sCAAoC;AACpC;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAK;;AAEL;AACA;AACA;AACA;AACA,iBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAK;;AAEL;AACA;AACA,mBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAK;;AAEL;AACA;AACA,iBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA,wCAAsC;;AAEtC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAK;;AAEL;AACA;AACA;AACA;AACA,iBAAe,OAAO;AACtB,mBAAiB,MAAM;AACvB;AACA,oCAAkC,EAAE;;AAEpC;AACA;AACA;AACA,mBAAiB;AACjB;AACA,kCAAgC,EAAE;;AAElC;AACA;AACA;AACA;AACA;AACA,yBAAuB;AACvB;;AAEA;AACA;AACA,aAAW,MAAM;AACjB,eAAa,OAAO;AACpB;AACA;AACA;AACA;AACA,OAAK;AACL;AACA,OAAK;AACL;AACA,OAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAW,MAAM;AACjB,eAAa;AACb;AACA;AACA;AACA;AACA,OAAK;AACL;AACA,OAAK;AACL;AACA,OAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAW,kBAAkB;AAC7B,aAAW,WAAW;AACtB,eAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAkB;AAClB;AACA;AACA;AACA,OAAK;;AAEL;AACA;AACA;AACA,iBAAe,OAAO;AACtB,mBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA,OAAK;;AAEL;AACA;AACA;AACA,iBAAe,OAAO;AACtB,mBAAiB,EAAE;AACnB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAS;AACT;AACA;AACA,eAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,GAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAK;;AAEL;AACA;AACA;AACA,OAAK;;AAEL;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAK;;AAEL;AACA;AACA,OAAK;;AAEL;AACA;AACA;AACA,OAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAK;;AAEL;AACA;AACA,OAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,WAAS;AACT;AACA;AACA;AACA;AACA,eAAa;AACb,WAAS;AACT;AACA;AACA;AACA,OAAK;;AAEL;AACA;AACA,OAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAS;AACT;AACA;AACA;AACA;AACA,GAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAK;;AAEL;AACA;AACA,OAAK;;AAEL;AACA;AACA;AACA;AACA,GAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAK;;AAEL;AACA;AACA,OAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA,WAAS;AACT;AACA,WAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAK;;AAEL;AACA;AACA,OAAK;;AAEL;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,eAAa;AACb;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAiB;AACjB;AACA;AACA;AACA,uBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,OAAK;;AAEL;AACA;AACA;AACA,WAAS;AACT;AACA,OAAK;;AAEL;AACA;AACA,OAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,GAAC;;AAED;AACA;AACA,aAAW,YAAY;AACvB,aAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAW;AACX;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,gBAAc;AACd;AACA;AACA;;AAEA;AACA,gBAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,gBAAc;AACd;AACA;AACA;;AAEA;AACA;AACA,gBAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,gBAAc;AACd;AACA;AACA;AACA,8BAA4B,cAAc;AAC1C,6BAA2B,cAAc;AACzC,6BAA2B,gCAAgC;AAC3D,2BAAyB,gCAAgC;AACzD;AACA,2BAAyB,4BAA4B;AACrD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA,oBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,oBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA,oBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA,oBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA,oBAAkB;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,aAAW,YAAY;AACvB,aAAW,OAAO;AAClB;AACA;AACA;AACA,8BAA4B,gCAAgC;;AAE5D;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,OAAK;AACL;;AAEA;AACA;AACA;AACA,iBAAe,OAAO;AACtB,mBAAiB;AACjB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAK;;AAEL;AACA;AACA;AACA;AACA,iBAAe,QAAQ;AACvB;AACA;AACA;AACA,OAAK;;AAEL;AACA;AACA;AACA;AACA,iBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAkE;AAClE;AACA,eAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAK;;AAEL;AACA;AACA,iBAAe,kBAAkB;AACjC,mBAAiB;AACjB;AACA;AACA;AACA;AACA;;AAEA;AACA,yBAAuB,wBAAwB;AAC/C;AACA;AACA;AACA;AACA;AACA,OAAK;;AAEL;AACA;AACA;AACA,iBAAe,WAAW;AAC1B,mBAAiB;AACjB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,OAAK;;AAEL;AACA;AACA,iBAAe,kBAAkB;AACjC,mBAAiB;AACjB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAK;;AAEL;AACA;AACA,iBAAe,OAAO;AACtB,iBAAe,SAAS;AACxB,mBAAiB,aAAa;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAS;AACT;AACA,OAAK;;AAEL;AACA;AACA,iBAAe,OAAO;AACtB,iBAAe,SAAS;AACxB,mBAAiB,aAAa;AAC9B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAa;AACb;AACA;AACA,WAAS;AACT;AACA,OAAK;;AAEL;AACA;AACA,iBAAe,OAAO;AACtB,iBAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAW,QAAQ;AACnB,aAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAS;AACT;AACA;AACA,OAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAW,OAAO;AAClB,aAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAC;;AAED;AACA;AACA,qGAAmG,GAAG;AACtG;;AAEA;AACA;AACA;AACA,OAAK;AACL,GAAC;AACD;AACA,GAAC;AACD;AACA;;AAEA,GAAC;;;;;;;ACllFD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAG;AACH;AACA;AACA;AACA;AACA,KAAG;AACH;AACA;AACA;AACA,GAAC;;AAED;AACA;;AAEA;;AAEA;AACA,oBAAkB,UAAU;AAC5B;AACA;;AAEA;AACA,kBAAgB,UAAU,OAAO,iCAAiC;AAClE;AACA,kBAAgB,SAAS,OAAO,iCAAiC;AACjE;AACA,iBAAe,SAAS,SAAS,iBAAiB;AAClD;AACA,iBAAe,UAAU,SAAS,kBAAkB;AACpD;AACA,iBAAe,SAAS,SAAS,oBAAoB;;AAErD;AACA,uBAAqB;AACrB,uBAAqB;AACrB,uBAAqB;AACrB,uBAAqB;AACrB,uBAAqB;AACrB;AACA,wBAAsB;AACtB,wBAAsB;AACtB,wBAAsB;AACtB,wBAAsB;AACtB;AACA,wBAAsB;AACtB,wBAAsB;AACtB,wBAAsB;AACtB,wBAAsB;AACtB,4BAA0B;AAC1B,4BAA0B;AAC1B,4BAA0B;AAC1B,4BAA0B;AAC1B,4BAA0B;AAC1B,4BAA0B;AAC1B,4BAA0B;AAC1B;AACA,wBAAsB;AACtB,wBAAsB;AACtB,wBAAsB;AACtB,wBAAsB;;;;AAItB,kCAAgC;AAChC,gCAA8B;;AAE9B;AACA;AACA;AACA;AACA,yBAAuB,kBAAkB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,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,cAJQ;AAKjBC,aAAS,kBALQ;AAMjB59B,cAAU,WANO;AAOjB69B,cAAU,eAPO;AAQjBqN,oBAAgB,yDARC;AASjBC,qBAAiB,kEATA;AAUjBC,yBAAqB,wEAVJ;AAWjBC,qBAAiB,+CAXA;AAYjBC,wBAAoB,qCAZH;AAajBC,sBAAkB;AAbD,GAAnB;AAeAr9G,UAAQ,OAAR,IAAmBA,QAAQ,OAAR,CAAnB;AACAA,UAAQ,OAAR,IAAmBA,QAAQ,OAAR,CAAnB;AACAA,UAAQ,OAAR,IAAmBA,QAAQ,OAAR,CAAnB;;AAEA;AACAA,UAAQ,IAAR,IAAgB;AACd68G,UAAM,eADQ;AAEdC,SAAK,mBAFS;AAGdC,UAAM,OAHQ;AAIdtN,aAAS,eAJK;AAKdC,aAAS,gBALK;AAMd59B,cAAU,oBANI;AAOd69B,cAAU,qBAPI;AAQdqN,oBAAgB,wDARF;AASdC,qBAAiB,wEATH;AAUdC,yBAAqB,kFAVP;AAWdC,qBAAiB,uCAXH;AAYdC,wBAAoB,gCAZN;AAadC,sBAAkB;AAbJ,GAAhB;AAeAr9G,UAAQ,OAAR,IAAmBA,QAAQ,IAAR,CAAnB,C","file":"vis.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"vis\"] = factory();\n\telse\n\t\troot[\"vis\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap eca1787db4da1a54ed82","var util = require('./lib/util');\n\n// Graph3d\nutil.extend(exports, require('./index-graph3d'));\n\n// Timeline & Graph2d\nutil.extend(exports, require('./index-timeline-graph2d'));\n\n// Network\nutil.extend(exports, require('./index-network'));\n\n\n\n// WEBPACK FOOTER //\n// ./index.js","// utility functions\n\n// first check if moment.js is already loaded in the browser window, if so,\n// use this instance. Else, load via commonjs.\n\n\nvar moment = require('./module/moment');\nvar uuid = require('./module/uuid');\n\n/**\n * Test whether given object is a number\n * @param {*} object\n * @return {Boolean} isNumber\n */\nexports.isNumber = function (object) {\n return (object instanceof Number || typeof object == 'number');\n};\n\n/**\n * Censors object elements containing dom elements\n * @param {*} object\n * @return {Object} object without elements\n */\nexports.elementsCensor = function (object) {\n if (!object) return;\n var replacer = function(key, value) {\n if (value instanceof Element) {\n return \"DOM Element\";\n } else {\n return value;\n }\n }\n return JSON.parse(JSON.stringify(object, replacer))\n}\n\n\n/**\n * Remove everything in the DOM object\n * @param DOMobject\n */\nexports.recursiveDOMDelete = function (DOMobject) {\n if (DOMobject) {\n while (DOMobject.hasChildNodes() === true) {\n exports.recursiveDOMDelete(DOMobject.firstChild);\n DOMobject.removeChild(DOMobject.firstChild);\n }\n }\n};\n\n/**\n * this function gives you a range between 0 and 1 based on the min and max values in the set, the total sum of all values and the current value.\n *\n * @param min\n * @param max\n * @param total\n * @param value\n * @returns {number}\n */\nexports.giveRange = function (min, max, total, value) {\n if (max == min) {\n return 0.5;\n }\n else {\n var scale = 1 / (max - min);\n return Math.max(0, (value - min) * scale);\n }\n}\n\n/**\n * Test whether given object is a string\n * @param {*} object\n * @return {Boolean} isString\n */\nexports.isString = function (object) {\n return (object instanceof String || typeof object == 'string');\n};\n\n/**\n * Test whether given object is a Date, or a String containing a Date\n * @param {Date | String} object\n * @return {Boolean} isDate\n */\nexports.isDate = function (object) {\n if (object instanceof Date) {\n return true;\n }\n else if (exports.isString(object)) {\n // test whether this string contains a date\n var match = ASPDateRegex.exec(object);\n if (match) {\n return true;\n }\n else if (!isNaN(Date.parse(object))) {\n return true;\n }\n }\n\n return false;\n};\n\n/**\n * Create a semi UUID\n * source: http://stackoverflow.com/a/105074/1262753\n * @return {String} uuid\n */\nexports.randomUUID = function () {\n return uuid.v4();\n};\n\n/**\n * assign all keys of an object that are not nested objects to a certain value (used for color objects).\n * @param obj\n * @param value\n */\nexports.assignAllKeys = function (obj, value) {\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n if (typeof obj[prop] !== 'object') {\n obj[prop] = value;\n }\n }\n }\n}\n\n\n/**\n * Fill an object with a possibly partially defined other object. Only copies values if the a object has an object requiring values.\n * That means an object is not created on a property if only the b object has it.\n * @param obj\n * @param value\n */\nexports.fillIfDefined = function (a, b, allowDeletion = false) {\n for (var prop in a) {\n if (b[prop] !== undefined) {\n if (typeof b[prop] !== 'object') {\n if ((b[prop] === undefined || b[prop] === null) && a[prop] !== undefined && allowDeletion === true) {\n delete a[prop];\n }\n else {\n a[prop] = b[prop];\n }\n }\n else {\n if (typeof a[prop] === 'object') {\n exports.fillIfDefined(a[prop], b[prop], allowDeletion);\n }\n }\n }\n }\n}\n\n\n\n/**\n * Extend object a with the properties of object b or a series of objects\n * Only properties with defined values are copied\n * @param {Object} a\n * @param {... Object} b\n * @return {Object} a\n */\nexports.protoExtend = function (a, b) {\n for (var i = 1; i < arguments.length; i++) {\n var other = arguments[i];\n for (var prop in other) {\n a[prop] = other[prop];\n }\n }\n return a;\n};\n\n/**\n * Extend object a with the properties of object b or a series of objects\n * Only properties with defined values are copied\n * @param {Object} a\n * @param {... Object} b\n * @return {Object} a\n */\nexports.extend = function (a, b) {\n for (var i = 1; i < arguments.length; i++) {\n var other = arguments[i];\n for (var prop in other) {\n if (other.hasOwnProperty(prop)) {\n a[prop] = other[prop];\n }\n }\n }\n return a;\n};\n\n/**\n * Extend object a with selected properties of object b or a series of objects\n * Only properties with defined values are copied\n * @param {Array.} props\n * @param {Object} a\n * @param {Object} b\n * @return {Object} a\n */\nexports.selectiveExtend = function (props, a, b) {\n if (!Array.isArray(props)) {\n throw new Error('Array with property names expected as first argument');\n }\n\n for (var i = 2; i < arguments.length; i++) {\n var other = arguments[i];\n\n for (var p = 0; p < props.length; p++) {\n var prop = props[p];\n if (other.hasOwnProperty(prop)) {\n a[prop] = other[prop];\n }\n }\n }\n return a;\n};\n\n/**\n * Extend object a with selected properties of object b or a series of objects\n * Only properties with defined values are copied\n * @param {Array.} props\n * @param {Object} a\n * @param {Object} b\n * @return {Object} a\n */\nexports.selectiveDeepExtend = function (props, a, b, allowDeletion = false) {\n // TODO: add support for Arrays to deepExtend\n if (Array.isArray(b)) {\n throw new TypeError('Arrays are not supported by deepExtend');\n }\n for (var i = 2; i < arguments.length; i++) {\n var other = arguments[i];\n for (var p = 0; p < props.length; p++) {\n var prop = props[p];\n if (other.hasOwnProperty(prop)) {\n if (b[prop] && b[prop].constructor === Object) {\n if (a[prop] === undefined) {\n a[prop] = {};\n }\n if (a[prop].constructor === Object) {\n exports.deepExtend(a[prop], b[prop], false, allowDeletion);\n }\n else {\n if ((b[prop] === null) && a[prop] !== undefined && allowDeletion === true) {\n delete a[prop];\n }\n else {\n a[prop] = b[prop];\n }\n }\n } else if (Array.isArray(b[prop])) {\n throw new TypeError('Arrays are not supported by deepExtend');\n } else {\n if ((b[prop] === null) && a[prop] !== undefined && allowDeletion === true) {\n delete a[prop];\n }\n else {\n a[prop] = b[prop];\n }\n }\n\n }\n }\n }\n return a;\n};\n\n/**\n * Extend object a with selected properties of object b or a series of objects\n * Only properties with defined values are copied\n * @param {Array.} props\n * @param {Object} a\n * @param {Object} b\n * @return {Object} a\n */\nexports.selectiveNotDeepExtend = function (props, a, b, allowDeletion = false) {\n // TODO: add support for Arrays to deepExtend\n if (Array.isArray(b)) {\n throw new TypeError('Arrays are not supported by deepExtend');\n }\n for (var prop in b) {\n if (b.hasOwnProperty(prop)) {\n if (props.indexOf(prop) == -1) {\n if (b[prop] && b[prop].constructor === Object) {\n if (a[prop] === undefined) {\n a[prop] = {};\n }\n if (a[prop].constructor === Object) {\n exports.deepExtend(a[prop], b[prop]);\n }\n else {\n if ((b[prop] === null) && a[prop] !== undefined && allowDeletion === true) {\n delete a[prop];\n }\n else {\n a[prop] = b[prop];\n }\n }\n } else if (Array.isArray(b[prop])) {\n a[prop] = [];\n for (let i = 0; i < b[prop].length; i++) {\n a[prop].push(b[prop][i]);\n }\n } else {\n if ((b[prop] === null) && a[prop] !== undefined && allowDeletion === true) {\n delete a[prop];\n }\n else {\n a[prop] = b[prop];\n }\n }\n }\n }\n }\n return a;\n};\n\n/**\n * Deep extend an object a with the properties of object b\n * @param {Object} a\n * @param {Object} b\n * @param [Boolean] protoExtend --> optional parameter. If true, the prototype values will also be extended.\n * (ie. the options objects that inherit from others will also get the inherited options)\n * @param [Boolean] global --> optional parameter. If true, the values of fields that are null will not deleted\n * @returns {Object}\n */\nexports.deepExtend = function (a, b, protoExtend, allowDeletion) {\n for (var prop in b) {\n if (b.hasOwnProperty(prop) || protoExtend === true) {\n if (b[prop] && b[prop].constructor === Object) {\n if (a[prop] === undefined) {\n a[prop] = {};\n }\n if (a[prop].constructor === Object) {\n exports.deepExtend(a[prop], b[prop], protoExtend);\n }\n else {\n if ((b[prop] === null) && a[prop] !== undefined && allowDeletion === true) {\n delete a[prop];\n }\n else {\n a[prop] = b[prop];\n }\n }\n } else if (Array.isArray(b[prop])) {\n a[prop] = [];\n for (let i = 0; i < b[prop].length; i++) {\n a[prop].push(b[prop][i]);\n }\n } else {\n if ((b[prop] === null) && a[prop] !== undefined && allowDeletion === true) {\n delete a[prop];\n }\n else {\n a[prop] = b[prop];\n }\n }\n }\n }\n return a;\n};\n\n/**\n * Test whether all elements in two arrays are equal.\n * @param {Array} a\n * @param {Array} b\n * @return {boolean} Returns true if both arrays have the same length and same\n * elements.\n */\nexports.equalArray = function (a, b) {\n if (a.length != b.length) return false;\n\n for (var i = 0, len = a.length; i < len; i++) {\n if (a[i] != b[i]) return false;\n }\n\n return true;\n};\n\n/**\n * Convert an object to another type\n * @param {Boolean | Number | String | Date | Moment | Null | undefined} object\n * @param {String | undefined} type Name of the type. Available types:\n * 'Boolean', 'Number', 'String',\n * 'Date', 'Moment', ISODate', 'ASPDate'.\n * @return {*} object\n * @throws Error\n */\nexports.convert = function (object, type) {\n var match;\n\n if (object === undefined) {\n return undefined;\n }\n if (object === null) {\n return null;\n }\n\n if (!type) {\n return object;\n }\n if (!(typeof type === 'string') && !(type instanceof String)) {\n throw new Error('Type must be a string');\n }\n\n //noinspection FallthroughInSwitchStatementJS\n switch (type) {\n case 'boolean':\n case 'Boolean':\n return Boolean(object);\n\n case 'number':\n case 'Number':\n if (exports.isString(object) && !isNaN(Date.parse(object))) {\n return moment(object).valueOf();\n } else {\n return Number(object.valueOf());\n }\n case 'string':\n case 'String':\n return String(object);\n\n case 'Date':\n if (exports.isNumber(object)) {\n return new Date(object);\n }\n if (object instanceof Date) {\n return new Date(object.valueOf());\n }\n else if (moment.isMoment(object)) {\n return new Date(object.valueOf());\n }\n if (exports.isString(object)) {\n match = ASPDateRegex.exec(object);\n if (match) {\n // object is an ASP date\n return new Date(Number(match[1])); // parse number\n }\n else {\n return moment(new Date(object)).toDate(); // parse string\n }\n }\n else {\n throw new Error(\n 'Cannot convert object of type ' + exports.getType(object) +\n ' to type Date');\n }\n\n case 'Moment':\n if (exports.isNumber(object)) {\n return moment(object);\n }\n if (object instanceof Date) {\n return moment(object.valueOf());\n }\n else if (moment.isMoment(object)) {\n return moment(object);\n }\n if (exports.isString(object)) {\n match = ASPDateRegex.exec(object);\n if (match) {\n // object is an ASP date\n return moment(Number(match[1])); // parse number\n }\n else {\n return moment(object); // parse string\n }\n }\n else {\n throw new Error(\n 'Cannot convert object of type ' + exports.getType(object) +\n ' to type Date');\n }\n\n case 'ISODate':\n if (exports.isNumber(object)) {\n return new Date(object);\n }\n else if (object instanceof Date) {\n return object.toISOString();\n }\n else if (moment.isMoment(object)) {\n return object.toDate().toISOString();\n }\n else if (exports.isString(object)) {\n match = ASPDateRegex.exec(object);\n if (match) {\n // object is an ASP date\n return new Date(Number(match[1])).toISOString(); // parse number\n }\n else {\n return moment(object).format(); // ISO 8601\n }\n }\n else {\n throw new Error(\n 'Cannot convert object of type ' + exports.getType(object) +\n ' to type ISODate');\n }\n\n case 'ASPDate':\n if (exports.isNumber(object)) {\n return '/Date(' + object + ')/';\n }\n else if (object instanceof Date) {\n return '/Date(' + object.valueOf() + ')/';\n }\n else if (exports.isString(object)) {\n match = ASPDateRegex.exec(object);\n var value;\n if (match) {\n // object is an ASP date\n value = new Date(Number(match[1])).valueOf(); // parse number\n }\n else {\n value = new Date(object).valueOf(); // parse string\n }\n return '/Date(' + value + ')/';\n }\n else {\n throw new Error(\n 'Cannot convert object of type ' + exports.getType(object) +\n ' to type ASPDate');\n }\n\n default:\n throw new Error('Unknown type \"' + type + '\"');\n }\n};\n\n// parse ASP.Net Date pattern,\n// for example '/Date(1198908717056)/' or '/Date(1198908717056-0700)/'\n// code from http://momentjs.com/\nvar ASPDateRegex = /^\\/?Date\\((\\-?\\d+)/i;\n\n/**\n * Get the type of an object, for example exports.getType([]) returns 'Array'\n * @param {*} object\n * @return {String} type\n */\nexports.getType = function (object) {\n var type = typeof object;\n\n if (type == 'object') {\n if (object === null) {\n return 'null';\n }\n if (object instanceof Boolean) {\n return 'Boolean';\n }\n if (object instanceof Number) {\n return 'Number';\n }\n if (object instanceof String) {\n return 'String';\n }\n if (Array.isArray(object)) {\n return 'Array';\n }\n if (object instanceof Date) {\n return 'Date';\n }\n return 'Object';\n }\n else if (type == 'number') {\n return 'Number';\n }\n else if (type == 'boolean') {\n return 'Boolean';\n }\n else if (type == 'string') {\n return 'String';\n }\n else if (type === undefined) {\n return 'undefined';\n }\n\n\n return type;\n};\n\n\n/**\n * Used to extend an array and copy it. This is used to propagate paths recursively.\n *\n * @param arr\n * @param newValue\n * @returns {Array}\n */\nexports.copyAndExtendArray = function (arr, newValue) {\n let newArr = [];\n for (let i = 0; i < arr.length; i++) {\n newArr.push(arr[i]);\n }\n newArr.push(newValue);\n return newArr;\n}\n\n/**\n * Used to extend an array and copy it. This is used to propagate paths recursively.\n *\n * @param arr\n * @param newValue\n * @returns {Array}\n */\nexports.copyArray = function (arr) {\n let newArr = [];\n for (let i = 0; i < arr.length; i++) {\n newArr.push(arr[i]);\n }\n return newArr;\n}\n\n/**\n * Retrieve the absolute left value of a DOM element\n * @param {Element} elem A dom element, for example a div\n * @return {number} left The absolute left position of this element\n * in the browser page.\n */\nexports.getAbsoluteLeft = function (elem) {\n return elem.getBoundingClientRect().left;\n};\n\nexports.getAbsoluteRight = function (elem) {\n return elem.getBoundingClientRect().right;\n};\n\n/**\n * Retrieve the absolute top value of a DOM element\n * @param {Element} elem A dom element, for example a div\n * @return {number} top The absolute top position of this element\n * in the browser page.\n */\nexports.getAbsoluteTop = function (elem) {\n return elem.getBoundingClientRect().top;\n};\n\n/**\n * add a className to the given elements style\n * @param {Element} elem\n * @param {String} className\n */\nexports.addClassName = function (elem, className) {\n var classes = elem.className.split(' ');\n if (classes.indexOf(className) == -1) {\n classes.push(className); // add the class to the array\n elem.className = classes.join(' ');\n }\n};\n\n/**\n * add a className to the given elements style\n * @param {Element} elem\n * @param {String} className\n */\nexports.removeClassName = function (elem, className) {\n var classes = elem.className.split(' ');\n var index = classes.indexOf(className);\n if (index != -1) {\n classes.splice(index, 1); // remove the class from the array\n elem.className = classes.join(' ');\n }\n};\n\n/**\n * For each method for both arrays and objects.\n * In case of an array, the built-in Array.forEach() is applied.\n * In case of an Object, the method loops over all properties of the object.\n * @param {Object | Array} object An Object or Array\n * @param {function} callback Callback method, called for each item in\n * the object or array with three parameters:\n * callback(value, index, object)\n */\nexports.forEach = function (object, callback) {\n var i,\n len;\n if (Array.isArray(object)) {\n // array\n for (i = 0, len = object.length; i < len; i++) {\n callback(object[i], i, object);\n }\n }\n else {\n // object\n for (i in object) {\n if (object.hasOwnProperty(i)) {\n callback(object[i], i, object);\n }\n }\n }\n};\n\n/**\n * Convert an object into an array: all objects properties are put into the\n * array. The resulting array is unordered.\n * @param {Object} object\n * @param {Array} array\n */\nexports.toArray = function (object) {\n var array = [];\n\n for (var prop in object) {\n if (object.hasOwnProperty(prop)) array.push(object[prop]);\n }\n\n return array;\n};\n\n/**\n * Update a property in an object\n * @param {Object} object\n * @param {String} key\n * @param {*} value\n * @return {Boolean} changed\n */\nexports.updateProperty = function (object, key, value) {\n if (object[key] !== value) {\n object[key] = value;\n return true;\n }\n else {\n return false;\n }\n};\n\n/**\n * Throttle the given function to be only executed once per animation frame\n * @param {function} fn\n * @returns {function} Returns the throttled function\n */\nexports.throttle = function (fn) {\n var scheduled = false;\n\n return function throttled () {\n if (!scheduled) {\n scheduled = true;\n requestAnimationFrame(function () {\n scheduled = false;\n fn();\n });\n }\n }\n};\n\n/**\n * Add and event listener. Works for all browsers\n * @param {Element} element An html element\n * @param {string} action The action, for example \"click\",\n * without the prefix \"on\"\n * @param {function} listener The callback function to be executed\n * @param {boolean} [useCapture]\n */\nexports.addEventListener = function (element, action, listener, useCapture) {\n if (element.addEventListener) {\n if (useCapture === undefined)\n useCapture = false;\n\n if (action === \"mousewheel\" && navigator.userAgent.indexOf(\"Firefox\") >= 0) {\n action = \"DOMMouseScroll\"; // For Firefox\n }\n\n element.addEventListener(action, listener, useCapture);\n } else {\n element.attachEvent(\"on\" + action, listener); // IE browsers\n }\n};\n\n/**\n * Remove an event listener from an element\n * @param {Element} element An html dom element\n * @param {string} action The name of the event, for example \"mousedown\"\n * @param {function} listener The listener function\n * @param {boolean} [useCapture]\n */\nexports.removeEventListener = function (element, action, listener, useCapture) {\n if (element.removeEventListener) {\n // non-IE browsers\n if (useCapture === undefined)\n useCapture = false;\n\n if (action === \"mousewheel\" && navigator.userAgent.indexOf(\"Firefox\") >= 0) {\n action = \"DOMMouseScroll\"; // For Firefox\n }\n\n element.removeEventListener(action, listener, useCapture);\n } else {\n // IE browsers\n element.detachEvent(\"on\" + action, listener);\n }\n};\n\n/**\n * Cancels the event if it is cancelable, without stopping further propagation of the event.\n */\nexports.preventDefault = function (event) {\n if (!event)\n event = window.event;\n\n if (event.preventDefault) {\n event.preventDefault(); // non-IE browsers\n }\n else {\n event.returnValue = false; // IE browsers\n }\n};\n\n/**\n * Get HTML element which is the target of the event\n * @param {Event} event\n * @return {Element} target element\n */\nexports.getTarget = function (event) {\n // code from http://www.quirksmode.org/js/events_properties.html\n if (!event) {\n event = window.event;\n }\n\n var target;\n\n if (event.target) {\n target = event.target;\n }\n else if (event.srcElement) {\n target = event.srcElement;\n }\n\n if (target.nodeType != undefined && target.nodeType == 3) {\n // defeat Safari bug\n target = target.parentNode;\n }\n\n return target;\n};\n\n/**\n * Check if given element contains given parent somewhere in the DOM tree\n * @param {Element} element\n * @param {Element} parent\n */\nexports.hasParent = function (element, parent) {\n var e = element;\n\n while (e) {\n if (e === parent) {\n return true;\n }\n e = e.parentNode;\n }\n\n return false;\n};\n\nexports.option = {};\n\n/**\n * Convert a value into a boolean\n * @param {Boolean | function | undefined} value\n * @param {Boolean} [defaultValue]\n * @returns {Boolean} bool\n */\nexports.option.asBoolean = function (value, defaultValue) {\n if (typeof value == 'function') {\n value = value();\n }\n\n if (value != null) {\n return (value != false);\n }\n\n return defaultValue || null;\n};\n\n/**\n * Convert a value into a number\n * @param {Boolean | function | undefined} value\n * @param {Number} [defaultValue]\n * @returns {Number} number\n */\nexports.option.asNumber = function (value, defaultValue) {\n if (typeof value == 'function') {\n value = value();\n }\n\n if (value != null) {\n return Number(value) || defaultValue || null;\n }\n\n return defaultValue || null;\n};\n\n/**\n * Convert a value into a string\n * @param {String | function | undefined} value\n * @param {String} [defaultValue]\n * @returns {String} str\n */\nexports.option.asString = function (value, defaultValue) {\n if (typeof value == 'function') {\n value = value();\n }\n\n if (value != null) {\n return String(value);\n }\n\n return defaultValue || null;\n};\n\n/**\n * Convert a size or location into a string with pixels or a percentage\n * @param {String | Number | function | undefined} value\n * @param {String} [defaultValue]\n * @returns {String} size\n */\nexports.option.asSize = function (value, defaultValue) {\n if (typeof value == 'function') {\n value = value();\n }\n\n if (exports.isString(value)) {\n return value;\n }\n else if (exports.isNumber(value)) {\n return value + 'px';\n }\n else {\n return defaultValue || null;\n }\n};\n\n/**\n * Convert a value into a DOM element\n * @param {HTMLElement | function | undefined} value\n * @param {HTMLElement} [defaultValue]\n * @returns {HTMLElement | null} dom\n */\nexports.option.asElement = function (value, defaultValue) {\n if (typeof value == 'function') {\n value = value();\n }\n\n return value || defaultValue || null;\n};\n\n/**\n * http://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb\n *\n * @param {String} hex\n * @returns {{r: *, g: *, b: *}} | 255 range\n */\nexports.hexToRGB = function (hex) {\n // Expand shorthand form (e.g. \"03F\") to full form (e.g. \"0033FF\")\n var shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n hex = hex.replace(shorthandRegex, function (m, r, g, b) {\n return r + r + g + g + b + b;\n });\n var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result ? {\n r: parseInt(result[1], 16),\n g: parseInt(result[2], 16),\n b: parseInt(result[3], 16)\n } : null;\n};\n\n/**\n * This function takes color in hex format or rgb() or rgba() format and overrides the opacity. Returns rgba() string.\n * @param color\n * @param opacity\n * @returns {*}\n */\nexports.overrideOpacity = function (color, opacity) {\n if (color.indexOf(\"rgba\") != -1) {\n return color;\n }\n else if (color.indexOf(\"rgb\") != -1) {\n var rgb = color.substr(color.indexOf(\"(\") + 1).replace(\")\", \"\").split(\",\");\n return \"rgba(\" + rgb[0] + \",\" + rgb[1] + \",\" + rgb[2] + \",\" + opacity + \")\"\n }\n else {\n var rgb = exports.hexToRGB(color);\n if (rgb == null) {\n return color;\n }\n else {\n return \"rgba(\" + rgb.r + \",\" + rgb.g + \",\" + rgb.b + \",\" + opacity + \")\"\n }\n }\n}\n\n/**\n *\n * @param red 0 -- 255\n * @param green 0 -- 255\n * @param blue 0 -- 255\n * @returns {string}\n * @constructor\n */\nexports.RGBToHex = function (red, green, blue) {\n return \"#\" + ((1 << 24) + (red << 16) + (green << 8) + blue).toString(16).slice(1);\n};\n\n/**\n * Parse a color property into an object with border, background, and\n * highlight colors\n * @param {Object | String} color\n * @return {Object} colorObject\n */\nexports.parseColor = function (color) {\n var c;\n if (exports.isString(color) === true) {\n if (exports.isValidRGB(color) === true) {\n var rgb = color.substr(4).substr(0, color.length - 5).split(',').map(function (value) { return parseInt(value) });\n color = exports.RGBToHex(rgb[0], rgb[1], rgb[2]);\n }\n if (exports.isValidHex(color) === true) {\n var hsv = exports.hexToHSV(color);\n var lighterColorHSV = { h: hsv.h, s: hsv.s * 0.8, v: Math.min(1, hsv.v * 1.02) };\n var darkerColorHSV = { h: hsv.h, s: Math.min(1, hsv.s * 1.25), v: hsv.v * 0.8 };\n var darkerColorHex = exports.HSVToHex(darkerColorHSV.h, darkerColorHSV.s, darkerColorHSV.v);\n var lighterColorHex = exports.HSVToHex(lighterColorHSV.h, lighterColorHSV.s, lighterColorHSV.v);\n c = {\n background: color,\n border: darkerColorHex,\n highlight: {\n background: lighterColorHex,\n border: darkerColorHex\n },\n hover: {\n background: lighterColorHex,\n border: darkerColorHex\n }\n };\n }\n else {\n c = {\n background: color,\n border: color,\n highlight: {\n background: color,\n border: color\n },\n hover: {\n background: color,\n border: color\n }\n };\n }\n }\n else {\n c = {};\n c.background = color.background || undefined;\n c.border = color.border || undefined;\n\n if (exports.isString(color.highlight)) {\n c.highlight = {\n border: color.highlight,\n background: color.highlight\n }\n }\n else {\n c.highlight = {};\n c.highlight.background = color.highlight && color.highlight.background || undefined;\n c.highlight.border = color.highlight && color.highlight.border || undefined;\n }\n\n if (exports.isString(color.hover)) {\n c.hover = {\n border: color.hover,\n background: color.hover\n }\n }\n else {\n c.hover = {};\n c.hover.background = color.hover && color.hover.background || undefined;\n c.hover.border = color.hover && color.hover.border || undefined;\n }\n }\n\n return c;\n};\n\n\n\n/**\n * http://www.javascripter.net/faq/rgb2hsv.htm\n *\n * @param red\n * @param green\n * @param blue\n * @returns {*}\n * @constructor\n */\nexports.RGBToHSV = function (red, green, blue) {\n red = red / 255; green = green / 255; blue = blue / 255;\n var minRGB = Math.min(red, Math.min(green, blue));\n var maxRGB = Math.max(red, Math.max(green, blue));\n\n // Black-gray-white\n if (minRGB == maxRGB) {\n return { h: 0, s: 0, v: minRGB };\n }\n\n // Colors other than black-gray-white:\n var d = (red == minRGB) ? green - blue : ((blue == minRGB) ? red - green : blue - red);\n var h = (red == minRGB) ? 3 : ((blue == minRGB) ? 1 : 5);\n var hue = 60 * (h - d / (maxRGB - minRGB)) / 360;\n var saturation = (maxRGB - minRGB) / maxRGB;\n var value = maxRGB;\n return { h: hue, s: saturation, v: value };\n};\n\nvar cssUtil = {\n // split a string with css styles into an object with key/values\n split: function (cssText) {\n var styles = {};\n\n cssText.split(';').forEach(function (style) {\n if (style.trim() != '') {\n var parts = style.split(':');\n var key = parts[0].trim();\n var value = parts[1].trim();\n styles[key] = value;\n }\n });\n\n return styles;\n },\n\n // build a css text string from an object with key/values\n join: function (styles) {\n return Object.keys(styles)\n .map(function (key) {\n return key + ': ' + styles[key];\n })\n .join('; ');\n }\n};\n\n/**\n * Append a string with css styles to an element\n * @param {Element} element\n * @param {String} cssText\n */\nexports.addCssText = function (element, cssText) {\n var currentStyles = cssUtil.split(element.style.cssText);\n var newStyles = cssUtil.split(cssText);\n var styles = exports.extend(currentStyles, newStyles);\n\n element.style.cssText = cssUtil.join(styles);\n};\n\n/**\n * Remove a string with css styles from an element\n * @param {Element} element\n * @param {String} cssText\n */\nexports.removeCssText = function (element, cssText) {\n var styles = cssUtil.split(element.style.cssText);\n var removeStyles = cssUtil.split(cssText);\n\n for (var key in removeStyles) {\n if (removeStyles.hasOwnProperty(key)) {\n delete styles[key];\n }\n }\n\n element.style.cssText = cssUtil.join(styles);\n};\n\n/**\n * https://gist.github.com/mjijackson/5311256\n * @param h\n * @param s\n * @param v\n * @returns {{r: number, g: number, b: number}}\n * @constructor\n */\nexports.HSVToRGB = function (h, s, v) {\n var r, g, b;\n\n var i = Math.floor(h * 6);\n var f = h * 6 - i;\n var p = v * (1 - s);\n var q = v * (1 - f * s);\n var t = v * (1 - (1 - f) * s);\n\n switch (i % 6) {\n case 0: r = v, g = t, b = p; break;\n case 1: r = q, g = v, b = p; break;\n case 2: r = p, g = v, b = t; break;\n case 3: r = p, g = q, b = v; break;\n case 4: r = t, g = p, b = v; break;\n case 5: r = v, g = p, b = q; break;\n }\n\n return { r: Math.floor(r * 255), g: Math.floor(g * 255), b: Math.floor(b * 255) };\n};\n\nexports.HSVToHex = function (h, s, v) {\n var rgb = exports.HSVToRGB(h, s, v);\n return exports.RGBToHex(rgb.r, rgb.g, rgb.b);\n};\n\nexports.hexToHSV = function (hex) {\n var rgb = exports.hexToRGB(hex);\n return exports.RGBToHSV(rgb.r, rgb.g, rgb.b);\n};\n\nexports.isValidHex = function (hex) {\n var isOk = /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(hex);\n return isOk;\n};\n\nexports.isValidRGB = function (rgb) {\n rgb = rgb.replace(\" \", \"\");\n var isOk = /rgb\\((\\d{1,3}),(\\d{1,3}),(\\d{1,3})\\)/i.test(rgb);\n return isOk;\n}\nexports.isValidRGBA = function (rgba) {\n rgba = rgba.replace(\" \", \"\");\n var isOk = /rgba\\((\\d{1,3}),(\\d{1,3}),(\\d{1,3}),(.{1,3})\\)/i.test(rgba);\n return isOk;\n}\n\n/**\n * This recursively redirects the prototype of JSON objects to the referenceObject\n * This is used for default options.\n *\n * @param referenceObject\n * @returns {*}\n */\nexports.selectiveBridgeObject = function (fields, referenceObject) {\n if (typeof referenceObject == \"object\") {\n var objectTo = Object.create(referenceObject);\n for (var i = 0; i < fields.length; i++) {\n if (referenceObject.hasOwnProperty(fields[i])) {\n if (typeof referenceObject[fields[i]] == \"object\") {\n objectTo[fields[i]] = exports.bridgeObject(referenceObject[fields[i]]);\n }\n }\n }\n return objectTo;\n }\n else {\n return null;\n }\n};\n\n/**\n * This recursively redirects the prototype of JSON objects to the referenceObject\n * This is used for default options.\n *\n * @param referenceObject\n * @returns {*}\n */\nexports.bridgeObject = function (referenceObject) {\n if (typeof referenceObject == \"object\") {\n var objectTo = Object.create(referenceObject);\n for (var i in referenceObject) {\n if (referenceObject.hasOwnProperty(i)) {\n if (typeof referenceObject[i] == \"object\") {\n objectTo[i] = exports.bridgeObject(referenceObject[i]);\n }\n }\n }\n return objectTo;\n }\n else {\n return null;\n }\n};\n\n/**\n * This method provides a stable sort implementation, very fast for presorted data\n *\n * @param a the array\n * @param a order comparator\n * @returns {the array}\n */\nexports.insertSort = function (a,compare) {\n for (var i = 0; i < a.length; i++) {\n var k = a[i];\n for (var j = i; j > 0 && compare(k,a[j - 1])<0; j--) {\n a[j] = a[j - 1];\n }\n a[j] = k;\n }\n return a;\n}\n\n/**\n * this is used to set the options of subobjects in the options object. A requirement of these subobjects\n * is that they have an 'enabled' element which is optional for the user but mandatory for the program.\n *\n * @param [object] mergeTarget | this is either this.options or the options used for the groups.\n * @param [object] options | options\n * @param [String] option | this is the option key in the options argument\n */\nexports.mergeOptions = function (mergeTarget, options, option, allowDeletion = false, globalOptions = {}) {\n if (options[option] === null) {\n mergeTarget[option] = Object.create(globalOptions[option]);\n }\n else {\n if (options[option] !== undefined) {\n if (typeof options[option] === 'boolean') {\n mergeTarget[option].enabled = options[option];\n }\n else {\n if (options[option].enabled === undefined) {\n mergeTarget[option].enabled = true;\n }\n for (var prop in options[option]) {\n if (options[option].hasOwnProperty(prop)) {\n mergeTarget[option][prop] = options[option][prop];\n }\n }\n }\n }\n }\n}\n\n\n/**\n * This function does a binary search for a visible item in a sorted list. If we find a visible item, the code that uses\n * this function will then iterate in both directions over this sorted list to find all visible items.\n *\n * @param {Item[]} orderedItems | Items ordered by start\n * @param {function} comparator | -1 is lower, 0 is equal, 1 is higher\n * @param {String} field\n * @param {String} field2\n * @returns {number}\n * @private\n */\nexports.binarySearchCustom = function (orderedItems, comparator, field, field2) {\n var maxIterations = 10000;\n var iteration = 0;\n var low = 0;\n var high = orderedItems.length - 1;\n\n while (low <= high && iteration < maxIterations) {\n var middle = Math.floor((low + high) / 2);\n\n var item = orderedItems[middle];\n var value = (field2 === undefined) ? item[field] : item[field][field2];\n\n var searchResult = comparator(value);\n if (searchResult == 0) { // jihaa, found a visible item!\n return middle;\n }\n else if (searchResult == -1) { // it is too small --> increase low\n low = middle + 1;\n }\n else { // it is too big --> decrease high\n high = middle - 1;\n }\n\n iteration++;\n }\n\n return -1;\n};\n\n/**\n * This function does a binary search for a specific value in a sorted array. If it does not exist but is in between of\n * two values, we return either the one before or the one after, depending on user input\n * If it is found, we return the index, else -1.\n *\n * @param {Array} orderedItems\n * @param {{start: number, end: number}} target\n * @param {String} field\n * @param {String} sidePreference 'before' or 'after'\n * @param {function} comparator an optional comparator, returning -1,0,1 for <,==,>.\n * @returns {number}\n * @private\n */\nexports.binarySearchValue = function (orderedItems, target, field, sidePreference, comparator) {\n var maxIterations = 10000;\n var iteration = 0;\n var low = 0;\n var high = orderedItems.length - 1;\n var prevValue, value, nextValue, middle;\n\n var comparator = comparator != undefined ? comparator : function (a, b) {\n return a == b ? 0 : a < b ? -1 : 1\n };\n\n while (low <= high && iteration < maxIterations) {\n // get a new guess\n middle = Math.floor(0.5 * (high + low));\n prevValue = orderedItems[Math.max(0, middle - 1)][field];\n value = orderedItems[middle][field];\n nextValue = orderedItems[Math.min(orderedItems.length - 1, middle + 1)][field];\n\n if (comparator(value, target) == 0) { // we found the target\n return middle;\n }\n else if (comparator(prevValue, target) < 0 && comparator(value, target) > 0) { // target is in between of the previous and the current\n return sidePreference == 'before' ? Math.max(0, middle - 1) : middle;\n }\n else if (comparator(value, target) < 0 && comparator(nextValue, target) > 0) { // target is in between of the current and the next\n return sidePreference == 'before' ? middle : Math.min(orderedItems.length - 1, middle + 1);\n }\n else { // didnt find the target, we need to change our boundaries.\n if (comparator(value, target) < 0) { // it is too small --> increase low\n low = middle + 1;\n }\n else { // it is too big --> decrease high\n high = middle - 1;\n }\n }\n iteration++;\n }\n\n // didnt find anything. Return -1.\n return -1;\n};\n\n/*\n * Easing Functions - inspired from http://gizma.com/easing/\n * only considering the t value for the range [0, 1] => [0, 1]\n * https://gist.github.com/gre/1650294\n */\nexports.easingFunctions = {\n // no easing, no acceleration\n linear: function (t) {\n return t\n },\n // accelerating from zero velocity\n easeInQuad: function (t) {\n return t * t\n },\n // decelerating to zero velocity\n easeOutQuad: function (t) {\n return t * (2 - t)\n },\n // acceleration until halfway, then deceleration\n easeInOutQuad: function (t) {\n return t < .5 ? 2 * t * t : -1 + (4 - 2 * t) * t\n },\n // accelerating from zero velocity\n easeInCubic: function (t) {\n return t * t * t\n },\n // decelerating to zero velocity\n easeOutCubic: function (t) {\n return (--t) * t * t + 1\n },\n // acceleration until halfway, then deceleration\n easeInOutCubic: function (t) {\n return t < .5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1\n },\n // accelerating from zero velocity\n easeInQuart: function (t) {\n return t * t * t * t\n },\n // decelerating to zero velocity\n easeOutQuart: function (t) {\n return 1 - (--t) * t * t * t\n },\n // acceleration until halfway, then deceleration\n easeInOutQuart: function (t) {\n return t < .5 ? 8 * t * t * t * t : 1 - 8 * (--t) * t * t * t\n },\n // accelerating from zero velocity\n easeInQuint: function (t) {\n return t * t * t * t * t\n },\n // decelerating to zero velocity\n easeOutQuint: function (t) {\n return 1 + (--t) * t * t * t * t\n },\n // acceleration until halfway, then deceleration\n easeInOutQuint: function (t) {\n return t < .5 ? 16 * t * t * t * t * t : 1 + 16 * (--t) * t * t * t * t\n }\n};\n\nexports.getScrollBarWidth = function () {\n var inner = document.createElement('p');\n inner.style.width = \"100%\";\n inner.style.height = \"200px\";\n\n var outer = document.createElement('div');\n outer.style.position = \"absolute\";\n outer.style.top = \"0px\";\n outer.style.left = \"0px\";\n outer.style.visibility = \"hidden\";\n outer.style.width = \"200px\";\n outer.style.height = \"150px\";\n outer.style.overflow = \"hidden\";\n outer.appendChild (inner);\n\n document.body.appendChild (outer);\n var w1 = inner.offsetWidth;\n outer.style.overflow = 'scroll';\n var w2 = inner.offsetWidth;\n if (w1 == w2) w2 = outer.clientWidth;\n\n document.body.removeChild (outer);\n\n return (w1 - w2);\n};\n\nexports.topMost = function (pile, accessors) {\n let candidate;\n if (!Array.isArray(accessors)) {\n accessors = [accessors];\n }\n for (const member of pile) {\n if (member) {\n candidate = member[accessors[0]];\n for (let i = 1; i < accessors.length; i++){\n if (candidate) {\n candidate = candidate[accessors[i]]\n } else {\n continue;\n }\n }\n if (typeof candidate != 'undefined') {\n break;\n }\n }\n }\n return candidate;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./lib/util.js","module.exports = { \"default\": require(\"core-js/library/fn/get-iterator\"), __esModule: true };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/babel-runtime/core-js/get-iterator.js\n// module id = 2\n// module chunks = 0","require('../modules/web.dom.iterable');\nrequire('../modules/es6.string.iterator');\nmodule.exports = require('../modules/core.get-iterator');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/fn/get-iterator.js\n// module id = 3\n// module chunks = 0","require('./es6.array.iterator');\nvar global = require('./_global')\n , hide = require('./_hide')\n , Iterators = require('./_iterators')\n , TO_STRING_TAG = require('./_wks')('toStringTag');\n\nfor(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++){\n var NAME = collections[i]\n , Collection = global[NAME]\n , proto = Collection && Collection.prototype;\n if(proto && !proto[TO_STRING_TAG])hide(proto, TO_STRING_TAG, NAME);\n Iterators[NAME] = Iterators.Array;\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/web.dom.iterable.js\n// module id = 4\n// module chunks = 0","'use strict';\nvar addToUnscopables = require('./_add-to-unscopables')\n , step = require('./_iter-step')\n , Iterators = require('./_iterators')\n , toIObject = require('./_to-iobject');\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nmodule.exports = require('./_iter-define')(Array, 'Array', function(iterated, kind){\n this._t = toIObject(iterated); // target\n this._i = 0; // next index\n this._k = kind; // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function(){\n var O = this._t\n , kind = this._k\n , index = this._i++;\n if(!O || index >= O.length){\n this._t = undefined;\n return step(1);\n }\n if(kind == 'keys' )return step(0, index);\n if(kind == 'values')return step(0, O[index]);\n return step(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\nIterators.Arguments = Iterators.Array;\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/es6.array.iterator.js\n// module id = 5\n// module chunks = 0","module.exports = function(){ /* empty */ };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_add-to-unscopables.js\n// module id = 6\n// module chunks = 0","module.exports = function(done, value){\n return {value: value, done: !!done};\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_iter-step.js\n// module id = 7\n// module chunks = 0","module.exports = {};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_iterators.js\n// module id = 8\n// module chunks = 0","// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = require('./_iobject')\n , defined = require('./_defined');\nmodule.exports = function(it){\n return IObject(defined(it));\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_to-iobject.js\n// module id = 9\n// module chunks = 0","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_iobject.js\n// module id = 10\n// module chunks = 0","var toString = {}.toString;\n\nmodule.exports = function(it){\n return toString.call(it).slice(8, -1);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_cof.js\n// module id = 11\n// module chunks = 0","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function(it){\n if(it == undefined)throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_defined.js\n// module id = 12\n// module chunks = 0","'use strict';\nvar LIBRARY = require('./_library')\n , $export = require('./_export')\n , redefine = require('./_redefine')\n , hide = require('./_hide')\n , has = require('./_has')\n , Iterators = require('./_iterators')\n , $iterCreate = require('./_iter-create')\n , setToStringTag = require('./_set-to-string-tag')\n , getPrototypeOf = require('./_object-gpo')\n , ITERATOR = require('./_wks')('iterator')\n , BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next`\n , FF_ITERATOR = '@@iterator'\n , KEYS = 'keys'\n , VALUES = 'values';\n\nvar returnThis = function(){ return this; };\n\nmodule.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){\n $iterCreate(Constructor, NAME, next);\n var getMethod = function(kind){\n if(!BUGGY && kind in proto)return proto[kind];\n switch(kind){\n case KEYS: return function keys(){ return new Constructor(this, kind); };\n case VALUES: return function values(){ return new Constructor(this, kind); };\n } return function entries(){ return new Constructor(this, kind); };\n };\n var TAG = NAME + ' Iterator'\n , DEF_VALUES = DEFAULT == VALUES\n , VALUES_BUG = false\n , proto = Base.prototype\n , $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]\n , $default = $native || getMethod(DEFAULT)\n , $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined\n , $anyNative = NAME == 'Array' ? proto.entries || $native : $native\n , methods, key, IteratorPrototype;\n // Fix native\n if($anyNative){\n IteratorPrototype = getPrototypeOf($anyNative.call(new Base));\n if(IteratorPrototype !== Object.prototype){\n // Set @@toStringTag to native iterators\n setToStringTag(IteratorPrototype, TAG, true);\n // fix for some old engines\n if(!LIBRARY && !has(IteratorPrototype, ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis);\n }\n }\n // fix Array#{values, @@iterator}.name in V8 / FF\n if(DEF_VALUES && $native && $native.name !== VALUES){\n VALUES_BUG = true;\n $default = function values(){ return $native.call(this); };\n }\n // Define iterator\n if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){\n hide(proto, ITERATOR, $default);\n }\n // Plug for library\n Iterators[NAME] = $default;\n Iterators[TAG] = returnThis;\n if(DEFAULT){\n methods = {\n values: DEF_VALUES ? $default : getMethod(VALUES),\n keys: IS_SET ? $default : getMethod(KEYS),\n entries: $entries\n };\n if(FORCED)for(key in methods){\n if(!(key in proto))redefine(proto, key, methods[key]);\n } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);\n }\n return methods;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_iter-define.js\n// module id = 13\n// module chunks = 0","module.exports = true;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_library.js\n// module id = 14\n// module chunks = 0","var global = require('./_global')\n , core = require('./_core')\n , ctx = require('./_ctx')\n , hide = require('./_hide')\n , PROTOTYPE = 'prototype';\n\nvar $export = function(type, name, source){\n var IS_FORCED = type & $export.F\n , IS_GLOBAL = type & $export.G\n , IS_STATIC = type & $export.S\n , IS_PROTO = type & $export.P\n , IS_BIND = type & $export.B\n , IS_WRAP = type & $export.W\n , exports = IS_GLOBAL ? core : core[name] || (core[name] = {})\n , expProto = exports[PROTOTYPE]\n , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]\n , key, own, out;\n if(IS_GLOBAL)source = name;\n for(key in source){\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n if(own && key in exports)continue;\n // export native or passed\n out = own ? target[key] : source[key];\n // prevent global pollution for namespaces\n exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]\n // bind timers to global for call from export context\n : IS_BIND && own ? ctx(out, global)\n // wrap global constructors for prevent change them in library\n : IS_WRAP && target[key] == out ? (function(C){\n var F = function(a, b, c){\n if(this instanceof C){\n switch(arguments.length){\n case 0: return new C;\n case 1: return new C(a);\n case 2: return new C(a, b);\n } return new C(a, b, c);\n } return C.apply(this, arguments);\n };\n F[PROTOTYPE] = C[PROTOTYPE];\n return F;\n // make static versions for prototype methods\n })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%\n if(IS_PROTO){\n (exports.virtual || (exports.virtual = {}))[key] = out;\n // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%\n if(type & $export.R && expProto && !expProto[key])hide(expProto, key, out);\n }\n }\n};\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library` \nmodule.exports = $export;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_export.js\n// module id = 15\n// module chunks = 0","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();\nif(typeof __g == 'number')__g = global; // eslint-disable-line no-undef\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_global.js\n// module id = 16\n// module chunks = 0","var core = module.exports = {version: '2.4.0'};\nif(typeof __e == 'number')__e = core; // eslint-disable-line no-undef\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_core.js\n// module id = 17\n// module chunks = 0","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function(fn, that, length){\n aFunction(fn);\n if(that === undefined)return fn;\n switch(length){\n case 1: return function(a){\n return fn.call(that, a);\n };\n case 2: return function(a, b){\n return fn.call(that, a, b);\n };\n case 3: return function(a, b, c){\n return fn.call(that, a, b, c);\n };\n }\n return function(/* ...args */){\n return fn.apply(that, arguments);\n };\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_ctx.js\n// module id = 18\n// module chunks = 0","module.exports = function(it){\n if(typeof it != 'function')throw TypeError(it + ' is not a function!');\n return it;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_a-function.js\n// module id = 19\n// module chunks = 0","var dP = require('./_object-dp')\n , createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function(object, key, value){\n return dP.f(object, key, createDesc(1, value));\n} : function(object, key, value){\n object[key] = value;\n return object;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_hide.js\n// module id = 20\n// module chunks = 0","var anObject = require('./_an-object')\n , IE8_DOM_DEFINE = require('./_ie8-dom-define')\n , toPrimitive = require('./_to-primitive')\n , dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes){\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if(IE8_DOM_DEFINE)try {\n return dP(O, P, Attributes);\n } catch(e){ /* empty */ }\n if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');\n if('value' in Attributes)O[P] = Attributes.value;\n return O;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_object-dp.js\n// module id = 21\n// module chunks = 0","var isObject = require('./_is-object');\nmodule.exports = function(it){\n if(!isObject(it))throw TypeError(it + ' is not an object!');\n return it;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_an-object.js\n// module id = 22\n// module chunks = 0","module.exports = function(it){\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_is-object.js\n// module id = 23\n// module chunks = 0","module.exports = !require('./_descriptors') && !require('./_fails')(function(){\n return Object.defineProperty(require('./_dom-create')('div'), 'a', {get: function(){ return 7; }}).a != 7;\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_ie8-dom-define.js\n// module id = 24\n// module chunks = 0","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function(){\n return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_descriptors.js\n// module id = 25\n// module chunks = 0","module.exports = function(exec){\n try {\n return !!exec();\n } catch(e){\n return true;\n }\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_fails.js\n// module id = 26\n// module chunks = 0","var isObject = require('./_is-object')\n , document = require('./_global').document\n // in old IE typeof document.createElement is 'object'\n , is = isObject(document) && isObject(document.createElement);\nmodule.exports = function(it){\n return is ? document.createElement(it) : {};\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_dom-create.js\n// module id = 27\n// module chunks = 0","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function(it, S){\n if(!isObject(it))return it;\n var fn, val;\n if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;\n if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_to-primitive.js\n// module id = 28\n// module chunks = 0","module.exports = function(bitmap, value){\n return {\n enumerable : !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable : !(bitmap & 4),\n value : value\n };\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_property-desc.js\n// module id = 29\n// module chunks = 0","module.exports = require('./_hide');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_redefine.js\n// module id = 30\n// module chunks = 0","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function(it, key){\n return hasOwnProperty.call(it, key);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_has.js\n// module id = 31\n// module chunks = 0","'use strict';\nvar create = require('./_object-create')\n , descriptor = require('./_property-desc')\n , setToStringTag = require('./_set-to-string-tag')\n , IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\nrequire('./_hide')(IteratorPrototype, require('./_wks')('iterator'), function(){ return this; });\n\nmodule.exports = function(Constructor, NAME, next){\n Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)});\n setToStringTag(Constructor, NAME + ' Iterator');\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_iter-create.js\n// module id = 32\n// module chunks = 0","// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\nvar anObject = require('./_an-object')\n , dPs = require('./_object-dps')\n , enumBugKeys = require('./_enum-bug-keys')\n , IE_PROTO = require('./_shared-key')('IE_PROTO')\n , Empty = function(){ /* empty */ }\n , PROTOTYPE = 'prototype';\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar createDict = function(){\n // Thrash, waste and sodomy: IE GC bug\n var iframe = require('./_dom-create')('iframe')\n , i = enumBugKeys.length\n , lt = '<'\n , gt = '>'\n , iframeDocument;\n iframe.style.display = 'none';\n require('./_html').appendChild(iframe);\n iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n // createDict = iframe.contentWindow.Object;\n // html.removeChild(iframe);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);\n iframeDocument.close();\n createDict = iframeDocument.F;\n while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]];\n return createDict();\n};\n\nmodule.exports = Object.create || function create(O, Properties){\n var result;\n if(O !== null){\n Empty[PROTOTYPE] = anObject(O);\n result = new Empty;\n Empty[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = createDict();\n return Properties === undefined ? result : dPs(result, Properties);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_object-create.js\n// module id = 33\n// module chunks = 0","var dP = require('./_object-dp')\n , anObject = require('./_an-object')\n , getKeys = require('./_object-keys');\n\nmodule.exports = require('./_descriptors') ? Object.defineProperties : function defineProperties(O, Properties){\n anObject(O);\n var keys = getKeys(Properties)\n , length = keys.length\n , i = 0\n , P;\n while(length > i)dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_object-dps.js\n// module id = 34\n// module chunks = 0","// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal')\n , enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O){\n return $keys(O, enumBugKeys);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_object-keys.js\n// module id = 35\n// module chunks = 0","var has = require('./_has')\n , toIObject = require('./_to-iobject')\n , arrayIndexOf = require('./_array-includes')(false)\n , IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function(object, names){\n var O = toIObject(object)\n , i = 0\n , result = []\n , key;\n for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while(names.length > i)if(has(O, key = names[i++])){\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_object-keys-internal.js\n// module id = 36\n// module chunks = 0","// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = require('./_to-iobject')\n , toLength = require('./_to-length')\n , toIndex = require('./_to-index');\nmodule.exports = function(IS_INCLUDES){\n return function($this, el, fromIndex){\n var O = toIObject($this)\n , length = toLength(O.length)\n , index = toIndex(fromIndex, length)\n , value;\n // Array#includes uses SameValueZero equality algorithm\n if(IS_INCLUDES && el != el)while(length > index){\n value = O[index++];\n if(value != value)return true;\n // Array#toIndex ignores holes, Array#includes - not\n } else for(;length > index; index++)if(IS_INCLUDES || index in O){\n if(O[index] === el)return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_array-includes.js\n// module id = 37\n// module chunks = 0","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer')\n , min = Math.min;\nmodule.exports = function(it){\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_to-length.js\n// module id = 38\n// module chunks = 0","// 7.1.4 ToInteger\nvar ceil = Math.ceil\n , floor = Math.floor;\nmodule.exports = function(it){\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_to-integer.js\n// module id = 39\n// module chunks = 0","var toInteger = require('./_to-integer')\n , max = Math.max\n , min = Math.min;\nmodule.exports = function(index, length){\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_to-index.js\n// module id = 40\n// module chunks = 0","var shared = require('./_shared')('keys')\n , uid = require('./_uid');\nmodule.exports = function(key){\n return shared[key] || (shared[key] = uid(key));\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_shared-key.js\n// module id = 41\n// module chunks = 0","var global = require('./_global')\n , SHARED = '__core-js_shared__'\n , store = global[SHARED] || (global[SHARED] = {});\nmodule.exports = function(key){\n return store[key] || (store[key] = {});\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_shared.js\n// module id = 42\n// module chunks = 0","var id = 0\n , px = Math.random();\nmodule.exports = function(key){\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_uid.js\n// module id = 43\n// module chunks = 0","// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_enum-bug-keys.js\n// module id = 44\n// module chunks = 0","module.exports = require('./_global').document && document.documentElement;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_html.js\n// module id = 45\n// module chunks = 0","var def = require('./_object-dp').f\n , has = require('./_has')\n , TAG = require('./_wks')('toStringTag');\n\nmodule.exports = function(it, tag, stat){\n if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag});\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_set-to-string-tag.js\n// module id = 46\n// module chunks = 0","var store = require('./_shared')('wks')\n , uid = require('./_uid')\n , Symbol = require('./_global').Symbol\n , USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function(name){\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_wks.js\n// module id = 47\n// module chunks = 0","// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = require('./_has')\n , toObject = require('./_to-object')\n , IE_PROTO = require('./_shared-key')('IE_PROTO')\n , ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function(O){\n O = toObject(O);\n if(has(O, IE_PROTO))return O[IE_PROTO];\n if(typeof O.constructor == 'function' && O instanceof O.constructor){\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectProto : null;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_object-gpo.js\n// module id = 48\n// module chunks = 0","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function(it){\n return Object(defined(it));\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_to-object.js\n// module id = 49\n// module chunks = 0","'use strict';\nvar $at = require('./_string-at')(true);\n\n// 21.1.3.27 String.prototype[@@iterator]()\nrequire('./_iter-define')(String, 'String', function(iterated){\n this._t = String(iterated); // target\n this._i = 0; // next index\n// 21.1.5.2.1 %StringIteratorPrototype%.next()\n}, function(){\n var O = this._t\n , index = this._i\n , point;\n if(index >= O.length)return {value: undefined, done: true};\n point = $at(O, index);\n this._i += point.length;\n return {value: point, done: false};\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/es6.string.iterator.js\n// module id = 50\n// module chunks = 0","var toInteger = require('./_to-integer')\n , defined = require('./_defined');\n// true -> String#at\n// false -> String#codePointAt\nmodule.exports = function(TO_STRING){\n return function(that, pos){\n var s = String(defined(that))\n , i = toInteger(pos)\n , l = s.length\n , a, b;\n if(i < 0 || i >= l)return TO_STRING ? '' : undefined;\n a = s.charCodeAt(i);\n return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n ? TO_STRING ? s.charAt(i) : a\n : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n };\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_string-at.js\n// module id = 51\n// module chunks = 0","var anObject = require('./_an-object')\n , get = require('./core.get-iterator-method');\nmodule.exports = require('./_core').getIterator = function(it){\n var iterFn = get(it);\n if(typeof iterFn != 'function')throw TypeError(it + ' is not iterable!');\n return anObject(iterFn.call(it));\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/core.get-iterator.js\n// module id = 52\n// module chunks = 0","var classof = require('./_classof')\n , ITERATOR = require('./_wks')('iterator')\n , Iterators = require('./_iterators');\nmodule.exports = require('./_core').getIteratorMethod = function(it){\n if(it != undefined)return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/core.get-iterator-method.js\n// module id = 53\n// module chunks = 0","// getting tag from 19.1.3.6 Object.prototype.toString()\nvar cof = require('./_cof')\n , TAG = require('./_wks')('toStringTag')\n // ES3 wrong here\n , ARG = cof(function(){ return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function(it, key){\n try {\n return it[key];\n } catch(e){ /* empty */ }\n};\n\nmodule.exports = function(it){\n var O, T, B;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T\n // builtinTag case\n : ARG ? cof(O)\n // ES3 arguments fallback\n : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_classof.js\n// module id = 54\n// module chunks = 0","module.exports = { \"default\": require(\"core-js/library/fn/object/create\"), __esModule: true };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/babel-runtime/core-js/object/create.js\n// module id = 55\n// module chunks = 0","require('../../modules/es6.object.create');\nvar $Object = require('../../modules/_core').Object;\nmodule.exports = function create(P, D){\n return $Object.create(P, D);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/fn/object/create.js\n// module id = 56\n// module chunks = 0","var $export = require('./_export')\n// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\n$export($export.S, 'Object', {create: require('./_object-create')});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/es6.object.create.js\n// module id = 57\n// module chunks = 0","module.exports = { \"default\": require(\"core-js/library/fn/object/keys\"), __esModule: true };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/babel-runtime/core-js/object/keys.js\n// module id = 58\n// module chunks = 0","require('../../modules/es6.object.keys');\nmodule.exports = require('../../modules/_core').Object.keys;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/fn/object/keys.js\n// module id = 59\n// module chunks = 0","// 19.1.2.14 Object.keys(O)\nvar toObject = require('./_to-object')\n , $keys = require('./_object-keys');\n\nrequire('./_object-sap')('keys', function(){\n return function keys(it){\n return $keys(toObject(it));\n };\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/es6.object.keys.js\n// module id = 60\n// module chunks = 0","// most Object methods by ES6 should accept primitives\nvar $export = require('./_export')\n , core = require('./_core')\n , fails = require('./_fails');\nmodule.exports = function(KEY, exec){\n var fn = (core.Object || {})[KEY] || Object[KEY]\n , exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_object-sap.js\n// module id = 61\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\n\nvar _iterator = require(\"../core-js/symbol/iterator\");\n\nvar _iterator2 = _interopRequireDefault(_iterator);\n\nvar _symbol = require(\"../core-js/symbol\");\n\nvar _symbol2 = _interopRequireDefault(_symbol);\n\nvar _typeof = typeof _symbol2.default === \"function\" && typeof _iterator2.default === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === \"function\" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? \"symbol\" : typeof obj; };\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = typeof _symbol2.default === \"function\" && _typeof(_iterator2.default) === \"symbol\" ? function (obj) {\n return typeof obj === \"undefined\" ? \"undefined\" : _typeof(obj);\n} : function (obj) {\n return obj && typeof _symbol2.default === \"function\" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? \"symbol\" : typeof obj === \"undefined\" ? \"undefined\" : _typeof(obj);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/babel-runtime/helpers/typeof.js\n// module id = 62\n// module chunks = 0","module.exports = { \"default\": require(\"core-js/library/fn/symbol/iterator\"), __esModule: true };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/babel-runtime/core-js/symbol/iterator.js\n// module id = 63\n// module chunks = 0","require('../../modules/es6.string.iterator');\nrequire('../../modules/web.dom.iterable');\nmodule.exports = require('../../modules/_wks-ext').f('iterator');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/fn/symbol/iterator.js\n// module id = 64\n// module chunks = 0","exports.f = require('./_wks');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_wks-ext.js\n// module id = 65\n// module chunks = 0","module.exports = { \"default\": require(\"core-js/library/fn/symbol\"), __esModule: true };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/babel-runtime/core-js/symbol.js\n// module id = 66\n// module chunks = 0","require('../../modules/es6.symbol');\nrequire('../../modules/es6.object.to-string');\nrequire('../../modules/es7.symbol.async-iterator');\nrequire('../../modules/es7.symbol.observable');\nmodule.exports = require('../../modules/_core').Symbol;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/fn/symbol/index.js\n// module id = 67\n// module chunks = 0","'use strict';\n// ECMAScript 6 symbols shim\nvar global = require('./_global')\n , has = require('./_has')\n , DESCRIPTORS = require('./_descriptors')\n , $export = require('./_export')\n , redefine = require('./_redefine')\n , META = require('./_meta').KEY\n , $fails = require('./_fails')\n , shared = require('./_shared')\n , setToStringTag = require('./_set-to-string-tag')\n , uid = require('./_uid')\n , wks = require('./_wks')\n , wksExt = require('./_wks-ext')\n , wksDefine = require('./_wks-define')\n , keyOf = require('./_keyof')\n , enumKeys = require('./_enum-keys')\n , isArray = require('./_is-array')\n , anObject = require('./_an-object')\n , toIObject = require('./_to-iobject')\n , toPrimitive = require('./_to-primitive')\n , createDesc = require('./_property-desc')\n , _create = require('./_object-create')\n , gOPNExt = require('./_object-gopn-ext')\n , $GOPD = require('./_object-gopd')\n , $DP = require('./_object-dp')\n , $keys = require('./_object-keys')\n , gOPD = $GOPD.f\n , dP = $DP.f\n , gOPN = gOPNExt.f\n , $Symbol = global.Symbol\n , $JSON = global.JSON\n , _stringify = $JSON && $JSON.stringify\n , PROTOTYPE = 'prototype'\n , HIDDEN = wks('_hidden')\n , TO_PRIMITIVE = wks('toPrimitive')\n , isEnum = {}.propertyIsEnumerable\n , SymbolRegistry = shared('symbol-registry')\n , AllSymbols = shared('symbols')\n , OPSymbols = shared('op-symbols')\n , ObjectProto = Object[PROTOTYPE]\n , USE_NATIVE = typeof $Symbol == 'function'\n , QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDesc = DESCRIPTORS && $fails(function(){\n return _create(dP({}, 'a', {\n get: function(){ return dP(this, 'a', {value: 7}).a; }\n })).a != 7;\n}) ? function(it, key, D){\n var protoDesc = gOPD(ObjectProto, key);\n if(protoDesc)delete ObjectProto[key];\n dP(it, key, D);\n if(protoDesc && it !== ObjectProto)dP(ObjectProto, key, protoDesc);\n} : dP;\n\nvar wrap = function(tag){\n var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);\n sym._k = tag;\n return sym;\n};\n\nvar isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function(it){\n return typeof it == 'symbol';\n} : function(it){\n return it instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(it, key, D){\n if(it === ObjectProto)$defineProperty(OPSymbols, key, D);\n anObject(it);\n key = toPrimitive(key, true);\n anObject(D);\n if(has(AllSymbols, key)){\n if(!D.enumerable){\n if(!has(it, HIDDEN))dP(it, HIDDEN, createDesc(1, {}));\n it[HIDDEN][key] = true;\n } else {\n if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false;\n D = _create(D, {enumerable: createDesc(0, false)});\n } return setSymbolDesc(it, key, D);\n } return dP(it, key, D);\n};\nvar $defineProperties = function defineProperties(it, P){\n anObject(it);\n var keys = enumKeys(P = toIObject(P))\n , i = 0\n , l = keys.length\n , key;\n while(l > i)$defineProperty(it, key = keys[i++], P[key]);\n return it;\n};\nvar $create = function create(it, P){\n return P === undefined ? _create(it) : $defineProperties(_create(it), P);\n};\nvar $propertyIsEnumerable = function propertyIsEnumerable(key){\n var E = isEnum.call(this, key = toPrimitive(key, true));\n if(this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return false;\n return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;\n};\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key){\n it = toIObject(it);\n key = toPrimitive(key, true);\n if(it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return;\n var D = gOPD(it, key);\n if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true;\n return D;\n};\nvar $getOwnPropertyNames = function getOwnPropertyNames(it){\n var names = gOPN(toIObject(it))\n , result = []\n , i = 0\n , key;\n while(names.length > i){\n if(!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META)result.push(key);\n } return result;\n};\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(it){\n var IS_OP = it === ObjectProto\n , names = gOPN(IS_OP ? OPSymbols : toIObject(it))\n , result = []\n , i = 0\n , key;\n while(names.length > i){\n if(has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true))result.push(AllSymbols[key]);\n } return result;\n};\n\n// 19.4.1.1 Symbol([description])\nif(!USE_NATIVE){\n $Symbol = function Symbol(){\n if(this instanceof $Symbol)throw TypeError('Symbol is not a constructor!');\n var tag = uid(arguments.length > 0 ? arguments[0] : undefined);\n var $set = function(value){\n if(this === ObjectProto)$set.call(OPSymbols, value);\n if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false;\n setSymbolDesc(this, tag, createDesc(1, value));\n };\n if(DESCRIPTORS && setter)setSymbolDesc(ObjectProto, tag, {configurable: true, set: $set});\n return wrap(tag);\n };\n redefine($Symbol[PROTOTYPE], 'toString', function toString(){\n return this._k;\n });\n\n $GOPD.f = $getOwnPropertyDescriptor;\n $DP.f = $defineProperty;\n require('./_object-gopn').f = gOPNExt.f = $getOwnPropertyNames;\n require('./_object-pie').f = $propertyIsEnumerable;\n require('./_object-gops').f = $getOwnPropertySymbols;\n\n if(DESCRIPTORS && !require('./_library')){\n redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);\n }\n\n wksExt.f = function(name){\n return wrap(wks(name));\n }\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, {Symbol: $Symbol});\n\nfor(var symbols = (\n // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'\n).split(','), i = 0; symbols.length > i; )wks(symbols[i++]);\n\nfor(var symbols = $keys(wks.store), i = 0; symbols.length > i; )wksDefine(symbols[i++]);\n\n$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {\n // 19.4.2.1 Symbol.for(key)\n 'for': function(key){\n return has(SymbolRegistry, key += '')\n ? SymbolRegistry[key]\n : SymbolRegistry[key] = $Symbol(key);\n },\n // 19.4.2.5 Symbol.keyFor(sym)\n keyFor: function keyFor(key){\n if(isSymbol(key))return keyOf(SymbolRegistry, key);\n throw TypeError(key + ' is not a symbol!');\n },\n useSetter: function(){ setter = true; },\n useSimple: function(){ setter = false; }\n});\n\n$export($export.S + $export.F * !USE_NATIVE, 'Object', {\n // 19.1.2.2 Object.create(O [, Properties])\n create: $create,\n // 19.1.2.4 Object.defineProperty(O, P, Attributes)\n defineProperty: $defineProperty,\n // 19.1.2.3 Object.defineProperties(O, Properties)\n defineProperties: $defineProperties,\n // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\n // 19.1.2.7 Object.getOwnPropertyNames(O)\n getOwnPropertyNames: $getOwnPropertyNames,\n // 19.1.2.8 Object.getOwnPropertySymbols(O)\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\n$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function(){\n var S = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n // WebKit converts symbol values to JSON as null\n // V8 throws on boxed symbols\n return _stringify([S]) != '[null]' || _stringify({a: S}) != '{}' || _stringify(Object(S)) != '{}';\n})), 'JSON', {\n stringify: function stringify(it){\n if(it === undefined || isSymbol(it))return; // IE8 returns string on undefined\n var args = [it]\n , i = 1\n , replacer, $replacer;\n while(arguments.length > i)args.push(arguments[i++]);\n replacer = args[1];\n if(typeof replacer == 'function')$replacer = replacer;\n if($replacer || !isArray(replacer))replacer = function(key, value){\n if($replacer)value = $replacer.call(this, key, value);\n if(!isSymbol(value))return value;\n };\n args[1] = replacer;\n return _stringify.apply($JSON, args);\n }\n});\n\n// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)\n$Symbol[PROTOTYPE][TO_PRIMITIVE] || require('./_hide')($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\nsetToStringTag($Symbol, 'Symbol');\n// 20.2.1.9 Math[@@toStringTag]\nsetToStringTag(Math, 'Math', true);\n// 24.3.3 JSON[@@toStringTag]\nsetToStringTag(global.JSON, 'JSON', true);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/es6.symbol.js\n// module id = 68\n// module chunks = 0","var META = require('./_uid')('meta')\n , isObject = require('./_is-object')\n , has = require('./_has')\n , setDesc = require('./_object-dp').f\n , id = 0;\nvar isExtensible = Object.isExtensible || function(){\n return true;\n};\nvar FREEZE = !require('./_fails')(function(){\n return isExtensible(Object.preventExtensions({}));\n});\nvar setMeta = function(it){\n setDesc(it, META, {value: {\n i: 'O' + ++id, // object ID\n w: {} // weak collections IDs\n }});\n};\nvar fastKey = function(it, create){\n // return primitive with prefix\n if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if(!has(it, META)){\n // can't set metadata to uncaught frozen object\n if(!isExtensible(it))return 'F';\n // not necessary to add metadata\n if(!create)return 'E';\n // add missing metadata\n setMeta(it);\n // return object ID\n } return it[META].i;\n};\nvar getWeak = function(it, create){\n if(!has(it, META)){\n // can't set metadata to uncaught frozen object\n if(!isExtensible(it))return true;\n // not necessary to add metadata\n if(!create)return false;\n // add missing metadata\n setMeta(it);\n // return hash weak collections IDs\n } return it[META].w;\n};\n// add metadata on freeze-family methods calling\nvar onFreeze = function(it){\n if(FREEZE && meta.NEED && isExtensible(it) && !has(it, META))setMeta(it);\n return it;\n};\nvar meta = module.exports = {\n KEY: META,\n NEED: false,\n fastKey: fastKey,\n getWeak: getWeak,\n onFreeze: onFreeze\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_meta.js\n// module id = 69\n// module chunks = 0","var global = require('./_global')\n , core = require('./_core')\n , LIBRARY = require('./_library')\n , wksExt = require('./_wks-ext')\n , defineProperty = require('./_object-dp').f;\nmodule.exports = function(name){\n var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});\n if(name.charAt(0) != '_' && !(name in $Symbol))defineProperty($Symbol, name, {value: wksExt.f(name)});\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_wks-define.js\n// module id = 70\n// module chunks = 0","var getKeys = require('./_object-keys')\n , toIObject = require('./_to-iobject');\nmodule.exports = function(object, el){\n var O = toIObject(object)\n , keys = getKeys(O)\n , length = keys.length\n , index = 0\n , key;\n while(length > index)if(O[key = keys[index++]] === el)return key;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_keyof.js\n// module id = 71\n// module chunks = 0","// all enumerable object keys, includes symbols\nvar getKeys = require('./_object-keys')\n , gOPS = require('./_object-gops')\n , pIE = require('./_object-pie');\nmodule.exports = function(it){\n var result = getKeys(it)\n , getSymbols = gOPS.f;\n if(getSymbols){\n var symbols = getSymbols(it)\n , isEnum = pIE.f\n , i = 0\n , key;\n while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))result.push(key);\n } return result;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_enum-keys.js\n// module id = 72\n// module chunks = 0","exports.f = Object.getOwnPropertySymbols;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_object-gops.js\n// module id = 73\n// module chunks = 0","exports.f = {}.propertyIsEnumerable;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_object-pie.js\n// module id = 74\n// module chunks = 0","// 7.2.2 IsArray(argument)\nvar cof = require('./_cof');\nmodule.exports = Array.isArray || function isArray(arg){\n return cof(arg) == 'Array';\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_is-array.js\n// module id = 75\n// module chunks = 0","// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nvar toIObject = require('./_to-iobject')\n , gOPN = require('./_object-gopn').f\n , toString = {}.toString;\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function(it){\n try {\n return gOPN(it);\n } catch(e){\n return windowNames.slice();\n }\n};\n\nmodule.exports.f = function getOwnPropertyNames(it){\n return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_object-gopn-ext.js\n// module id = 76\n// module chunks = 0","// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)\nvar $keys = require('./_object-keys-internal')\n , hiddenKeys = require('./_enum-bug-keys').concat('length', 'prototype');\n\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O){\n return $keys(O, hiddenKeys);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_object-gopn.js\n// module id = 77\n// module chunks = 0","var pIE = require('./_object-pie')\n , createDesc = require('./_property-desc')\n , toIObject = require('./_to-iobject')\n , toPrimitive = require('./_to-primitive')\n , has = require('./_has')\n , IE8_DOM_DEFINE = require('./_ie8-dom-define')\n , gOPD = Object.getOwnPropertyDescriptor;\n\nexports.f = require('./_descriptors') ? gOPD : function getOwnPropertyDescriptor(O, P){\n O = toIObject(O);\n P = toPrimitive(P, true);\n if(IE8_DOM_DEFINE)try {\n return gOPD(O, P);\n } catch(e){ /* empty */ }\n if(has(O, P))return createDesc(!pIE.f.call(O, P), O[P]);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_object-gopd.js\n// module id = 78\n// module chunks = 0","require('./_wks-define')('asyncIterator');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/es7.symbol.async-iterator.js\n// module id = 80\n// module chunks = 0","require('./_wks-define')('observable');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/es7.symbol.observable.js\n// module id = 81\n// module chunks = 0","module.exports = { \"default\": require(\"core-js/library/fn/json/stringify\"), __esModule: true };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/babel-runtime/core-js/json/stringify.js\n// module id = 82\n// module chunks = 0","var core = require('../../modules/_core')\n , $JSON = core.JSON || (core.JSON = {stringify: JSON.stringify});\nmodule.exports = function stringify(it){ // eslint-disable-line no-unused-vars\n return $JSON.stringify.apply($JSON, arguments);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/fn/json/stringify.js\n// module id = 83\n// module chunks = 0","// first check if moment.js is already loaded in the browser window, if so,\n// use this instance. Else, load via commonjs.\nmodule.exports = (typeof window !== 'undefined') && window['moment'] || require('moment');\n\n\n\n// WEBPACK FOOTER //\n// ./lib/module/moment.js","//! moment.js\n//! version : 2.17.1\n//! authors : Tim Wood, Iskren Chernev, Moment.js contributors\n//! license : MIT\n//! momentjs.com\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n global.moment = factory()\n}(this, (function () { 'use strict';\n\nvar hookCallback;\n\nfunction hooks () {\n return hookCallback.apply(null, arguments);\n}\n\n// This is done to register the method called with moment()\n// without creating circular dependencies.\nfunction setHookCallback (callback) {\n hookCallback = callback;\n}\n\nfunction isArray(input) {\n return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';\n}\n\nfunction isObject(input) {\n // IE8 will treat undefined and null as object if it wasn't for\n // input != null\n return input != null && Object.prototype.toString.call(input) === '[object Object]';\n}\n\nfunction isObjectEmpty(obj) {\n var k;\n for (k in obj) {\n // even if its not own property I'd still call it non-empty\n return false;\n }\n return true;\n}\n\nfunction isNumber(input) {\n return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]';\n}\n\nfunction isDate(input) {\n return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';\n}\n\nfunction map(arr, fn) {\n var res = [], i;\n for (i = 0; i < arr.length; ++i) {\n res.push(fn(arr[i], i));\n }\n return res;\n}\n\nfunction hasOwnProp(a, b) {\n return Object.prototype.hasOwnProperty.call(a, b);\n}\n\nfunction extend(a, b) {\n for (var i in b) {\n if (hasOwnProp(b, i)) {\n a[i] = b[i];\n }\n }\n\n if (hasOwnProp(b, 'toString')) {\n a.toString = b.toString;\n }\n\n if (hasOwnProp(b, 'valueOf')) {\n a.valueOf = b.valueOf;\n }\n\n return a;\n}\n\nfunction createUTC (input, format, locale, strict) {\n return createLocalOrUTC(input, format, locale, strict, true).utc();\n}\n\nfunction defaultParsingFlags() {\n // We need to deep clone this object.\n return {\n empty : false,\n unusedTokens : [],\n unusedInput : [],\n overflow : -2,\n charsLeftOver : 0,\n nullInput : false,\n invalidMonth : null,\n invalidFormat : false,\n userInvalidated : false,\n iso : false,\n parsedDateParts : [],\n meridiem : null\n };\n}\n\nfunction getParsingFlags(m) {\n if (m._pf == null) {\n m._pf = defaultParsingFlags();\n }\n return m._pf;\n}\n\nvar some;\nif (Array.prototype.some) {\n some = Array.prototype.some;\n} else {\n some = function (fun) {\n var t = Object(this);\n var len = t.length >>> 0;\n\n for (var i = 0; i < len; i++) {\n if (i in t && fun.call(this, t[i], i, t)) {\n return true;\n }\n }\n\n return false;\n };\n}\n\nvar some$1 = some;\n\nfunction isValid(m) {\n if (m._isValid == null) {\n var flags = getParsingFlags(m);\n var parsedParts = some$1.call(flags.parsedDateParts, function (i) {\n return i != null;\n });\n var isNowValid = !isNaN(m._d.getTime()) &&\n flags.overflow < 0 &&\n !flags.empty &&\n !flags.invalidMonth &&\n !flags.invalidWeekday &&\n !flags.nullInput &&\n !flags.invalidFormat &&\n !flags.userInvalidated &&\n (!flags.meridiem || (flags.meridiem && parsedParts));\n\n if (m._strict) {\n isNowValid = isNowValid &&\n flags.charsLeftOver === 0 &&\n flags.unusedTokens.length === 0 &&\n flags.bigHour === undefined;\n }\n\n if (Object.isFrozen == null || !Object.isFrozen(m)) {\n m._isValid = isNowValid;\n }\n else {\n return isNowValid;\n }\n }\n return m._isValid;\n}\n\nfunction createInvalid (flags) {\n var m = createUTC(NaN);\n if (flags != null) {\n extend(getParsingFlags(m), flags);\n }\n else {\n getParsingFlags(m).userInvalidated = true;\n }\n\n return m;\n}\n\nfunction isUndefined(input) {\n return input === void 0;\n}\n\n// Plugins that add properties should also add the key here (null value),\n// so we can properly clone ourselves.\nvar momentProperties = hooks.momentProperties = [];\n\nfunction copyConfig(to, from) {\n var i, prop, val;\n\n if (!isUndefined(from._isAMomentObject)) {\n to._isAMomentObject = from._isAMomentObject;\n }\n if (!isUndefined(from._i)) {\n to._i = from._i;\n }\n if (!isUndefined(from._f)) {\n to._f = from._f;\n }\n if (!isUndefined(from._l)) {\n to._l = from._l;\n }\n if (!isUndefined(from._strict)) {\n to._strict = from._strict;\n }\n if (!isUndefined(from._tzm)) {\n to._tzm = from._tzm;\n }\n if (!isUndefined(from._isUTC)) {\n to._isUTC = from._isUTC;\n }\n if (!isUndefined(from._offset)) {\n to._offset = from._offset;\n }\n if (!isUndefined(from._pf)) {\n to._pf = getParsingFlags(from);\n }\n if (!isUndefined(from._locale)) {\n to._locale = from._locale;\n }\n\n if (momentProperties.length > 0) {\n for (i in momentProperties) {\n prop = momentProperties[i];\n val = from[prop];\n if (!isUndefined(val)) {\n to[prop] = val;\n }\n }\n }\n\n return to;\n}\n\nvar updateInProgress = false;\n\n// Moment prototype object\nfunction Moment(config) {\n copyConfig(this, config);\n this._d = new Date(config._d != null ? config._d.getTime() : NaN);\n if (!this.isValid()) {\n this._d = new Date(NaN);\n }\n // Prevent infinite loop in case updateOffset creates new moment\n // objects.\n if (updateInProgress === false) {\n updateInProgress = true;\n hooks.updateOffset(this);\n updateInProgress = false;\n }\n}\n\nfunction isMoment (obj) {\n return obj instanceof Moment || (obj != null && obj._isAMomentObject != null);\n}\n\nfunction absFloor (number) {\n if (number < 0) {\n // -0 -> 0\n return Math.ceil(number) || 0;\n } else {\n return Math.floor(number);\n }\n}\n\nfunction toInt(argumentForCoercion) {\n var coercedNumber = +argumentForCoercion,\n value = 0;\n\n if (coercedNumber !== 0 && isFinite(coercedNumber)) {\n value = absFloor(coercedNumber);\n }\n\n return value;\n}\n\n// compare two arrays, return the number of differences\nfunction compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n}\n\nfunction warn(msg) {\n if (hooks.suppressDeprecationWarnings === false &&\n (typeof console !== 'undefined') && console.warn) {\n console.warn('Deprecation warning: ' + msg);\n }\n}\n\nfunction deprecate(msg, fn) {\n var firstTime = true;\n\n return extend(function () {\n if (hooks.deprecationHandler != null) {\n hooks.deprecationHandler(null, msg);\n }\n if (firstTime) {\n var args = [];\n var arg;\n for (var i = 0; i < arguments.length; i++) {\n arg = '';\n if (typeof arguments[i] === 'object') {\n arg += '\\n[' + i + '] ';\n for (var key in arguments[0]) {\n arg += key + ': ' + arguments[0][key] + ', ';\n }\n arg = arg.slice(0, -2); // Remove trailing comma and space\n } else {\n arg = arguments[i];\n }\n args.push(arg);\n }\n warn(msg + '\\nArguments: ' + Array.prototype.slice.call(args).join('') + '\\n' + (new Error()).stack);\n firstTime = false;\n }\n return fn.apply(this, arguments);\n }, fn);\n}\n\nvar deprecations = {};\n\nfunction deprecateSimple(name, msg) {\n if (hooks.deprecationHandler != null) {\n hooks.deprecationHandler(name, msg);\n }\n if (!deprecations[name]) {\n warn(msg);\n deprecations[name] = true;\n }\n}\n\nhooks.suppressDeprecationWarnings = false;\nhooks.deprecationHandler = null;\n\nfunction isFunction(input) {\n return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';\n}\n\nfunction set (config) {\n var prop, i;\n for (i in config) {\n prop = config[i];\n if (isFunction(prop)) {\n this[i] = prop;\n } else {\n this['_' + i] = prop;\n }\n }\n this._config = config;\n // Lenient ordinal parsing accepts just a number in addition to\n // number + (possibly) stuff coming from _ordinalParseLenient.\n this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + (/\\d{1,2}/).source);\n}\n\nfunction mergeConfigs(parentConfig, childConfig) {\n var res = extend({}, parentConfig), prop;\n for (prop in childConfig) {\n if (hasOwnProp(childConfig, prop)) {\n if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {\n res[prop] = {};\n extend(res[prop], parentConfig[prop]);\n extend(res[prop], childConfig[prop]);\n } else if (childConfig[prop] != null) {\n res[prop] = childConfig[prop];\n } else {\n delete res[prop];\n }\n }\n }\n for (prop in parentConfig) {\n if (hasOwnProp(parentConfig, prop) &&\n !hasOwnProp(childConfig, prop) &&\n isObject(parentConfig[prop])) {\n // make sure changes to properties don't modify parent config\n res[prop] = extend({}, res[prop]);\n }\n }\n return res;\n}\n\nfunction Locale(config) {\n if (config != null) {\n this.set(config);\n }\n}\n\nvar keys;\n\nif (Object.keys) {\n keys = Object.keys;\n} else {\n keys = function (obj) {\n var i, res = [];\n for (i in obj) {\n if (hasOwnProp(obj, i)) {\n res.push(i);\n }\n }\n return res;\n };\n}\n\nvar keys$1 = keys;\n\nvar defaultCalendar = {\n sameDay : '[Today at] LT',\n nextDay : '[Tomorrow at] LT',\n nextWeek : 'dddd [at] LT',\n lastDay : '[Yesterday at] LT',\n lastWeek : '[Last] dddd [at] LT',\n sameElse : 'L'\n};\n\nfunction calendar (key, mom, now) {\n var output = this._calendar[key] || this._calendar['sameElse'];\n return isFunction(output) ? output.call(mom, now) : output;\n}\n\nvar defaultLongDateFormat = {\n LTS : 'h:mm:ss A',\n LT : 'h:mm A',\n L : 'MM/DD/YYYY',\n LL : 'MMMM D, YYYY',\n LLL : 'MMMM D, YYYY h:mm A',\n LLLL : 'dddd, MMMM D, YYYY h:mm A'\n};\n\nfunction longDateFormat (key) {\n var format = this._longDateFormat[key],\n formatUpper = this._longDateFormat[key.toUpperCase()];\n\n if (format || !formatUpper) {\n return format;\n }\n\n this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {\n return val.slice(1);\n });\n\n return this._longDateFormat[key];\n}\n\nvar defaultInvalidDate = 'Invalid date';\n\nfunction invalidDate () {\n return this._invalidDate;\n}\n\nvar defaultOrdinal = '%d';\nvar defaultOrdinalParse = /\\d{1,2}/;\n\nfunction ordinal (number) {\n return this._ordinal.replace('%d', number);\n}\n\nvar defaultRelativeTime = {\n future : 'in %s',\n past : '%s ago',\n s : 'a few seconds',\n m : 'a minute',\n mm : '%d minutes',\n h : 'an hour',\n hh : '%d hours',\n d : 'a day',\n dd : '%d days',\n M : 'a month',\n MM : '%d months',\n y : 'a year',\n yy : '%d years'\n};\n\nfunction relativeTime (number, withoutSuffix, string, isFuture) {\n var output = this._relativeTime[string];\n return (isFunction(output)) ?\n output(number, withoutSuffix, string, isFuture) :\n output.replace(/%d/i, number);\n}\n\nfunction pastFuture (diff, output) {\n var format = this._relativeTime[diff > 0 ? 'future' : 'past'];\n return isFunction(format) ? format(output) : format.replace(/%s/i, output);\n}\n\nvar aliases = {};\n\nfunction addUnitAlias (unit, shorthand) {\n var lowerCase = unit.toLowerCase();\n aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;\n}\n\nfunction normalizeUnits(units) {\n return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;\n}\n\nfunction normalizeObjectUnits(inputObject) {\n var normalizedInput = {},\n normalizedProp,\n prop;\n\n for (prop in inputObject) {\n if (hasOwnProp(inputObject, prop)) {\n normalizedProp = normalizeUnits(prop);\n if (normalizedProp) {\n normalizedInput[normalizedProp] = inputObject[prop];\n }\n }\n }\n\n return normalizedInput;\n}\n\nvar priorities = {};\n\nfunction addUnitPriority(unit, priority) {\n priorities[unit] = priority;\n}\n\nfunction getPrioritizedUnits(unitsObj) {\n var units = [];\n for (var u in unitsObj) {\n units.push({unit: u, priority: priorities[u]});\n }\n units.sort(function (a, b) {\n return a.priority - b.priority;\n });\n return units;\n}\n\nfunction makeGetSet (unit, keepTime) {\n return function (value) {\n if (value != null) {\n set$1(this, unit, value);\n hooks.updateOffset(this, keepTime);\n return this;\n } else {\n return get(this, unit);\n }\n };\n}\n\nfunction get (mom, unit) {\n return mom.isValid() ?\n mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN;\n}\n\nfunction set$1 (mom, unit, value) {\n if (mom.isValid()) {\n mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);\n }\n}\n\n// MOMENTS\n\nfunction stringGet (units) {\n units = normalizeUnits(units);\n if (isFunction(this[units])) {\n return this[units]();\n }\n return this;\n}\n\n\nfunction stringSet (units, value) {\n if (typeof units === 'object') {\n units = normalizeObjectUnits(units);\n var prioritized = getPrioritizedUnits(units);\n for (var i = 0; i < prioritized.length; i++) {\n this[prioritized[i].unit](units[prioritized[i].unit]);\n }\n } else {\n units = normalizeUnits(units);\n if (isFunction(this[units])) {\n return this[units](value);\n }\n }\n return this;\n}\n\nfunction zeroFill(number, targetLength, forceSign) {\n var absNumber = '' + Math.abs(number),\n zerosToFill = targetLength - absNumber.length,\n sign = number >= 0;\n return (sign ? (forceSign ? '+' : '') : '-') +\n Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;\n}\n\nvar formattingTokens = /(\\[[^\\[]*\\])|(\\\\)?([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;\n\nvar localFormattingTokens = /(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g;\n\nvar formatFunctions = {};\n\nvar formatTokenFunctions = {};\n\n// token: 'M'\n// padded: ['MM', 2]\n// ordinal: 'Mo'\n// callback: function () { this.month() + 1 }\nfunction addFormatToken (token, padded, ordinal, callback) {\n var func = callback;\n if (typeof callback === 'string') {\n func = function () {\n return this[callback]();\n };\n }\n if (token) {\n formatTokenFunctions[token] = func;\n }\n if (padded) {\n formatTokenFunctions[padded[0]] = function () {\n return zeroFill(func.apply(this, arguments), padded[1], padded[2]);\n };\n }\n if (ordinal) {\n formatTokenFunctions[ordinal] = function () {\n return this.localeData().ordinal(func.apply(this, arguments), token);\n };\n }\n}\n\nfunction removeFormattingTokens(input) {\n if (input.match(/\\[[\\s\\S]/)) {\n return input.replace(/^\\[|\\]$/g, '');\n }\n return input.replace(/\\\\/g, '');\n}\n\nfunction makeFormatFunction(format) {\n var array = format.match(formattingTokens), i, length;\n\n for (i = 0, length = array.length; i < length; i++) {\n if (formatTokenFunctions[array[i]]) {\n array[i] = formatTokenFunctions[array[i]];\n } else {\n array[i] = removeFormattingTokens(array[i]);\n }\n }\n\n return function (mom) {\n var output = '', i;\n for (i = 0; i < length; i++) {\n output += array[i] instanceof Function ? array[i].call(mom, format) : array[i];\n }\n return output;\n };\n}\n\n// format date using native date object\nfunction formatMoment(m, format) {\n if (!m.isValid()) {\n return m.localeData().invalidDate();\n }\n\n format = expandFormat(format, m.localeData());\n formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);\n\n return formatFunctions[format](m);\n}\n\nfunction expandFormat(format, locale) {\n var i = 5;\n\n function replaceLongDateFormatTokens(input) {\n return locale.longDateFormat(input) || input;\n }\n\n localFormattingTokens.lastIndex = 0;\n while (i >= 0 && localFormattingTokens.test(format)) {\n format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);\n localFormattingTokens.lastIndex = 0;\n i -= 1;\n }\n\n return format;\n}\n\nvar match1 = /\\d/; // 0 - 9\nvar match2 = /\\d\\d/; // 00 - 99\nvar match3 = /\\d{3}/; // 000 - 999\nvar match4 = /\\d{4}/; // 0000 - 9999\nvar match6 = /[+-]?\\d{6}/; // -999999 - 999999\nvar match1to2 = /\\d\\d?/; // 0 - 99\nvar match3to4 = /\\d\\d\\d\\d?/; // 999 - 9999\nvar match5to6 = /\\d\\d\\d\\d\\d\\d?/; // 99999 - 999999\nvar match1to3 = /\\d{1,3}/; // 0 - 999\nvar match1to4 = /\\d{1,4}/; // 0 - 9999\nvar match1to6 = /[+-]?\\d{1,6}/; // -999999 - 999999\n\nvar matchUnsigned = /\\d+/; // 0 - inf\nvar matchSigned = /[+-]?\\d+/; // -inf - inf\n\nvar matchOffset = /Z|[+-]\\d\\d:?\\d\\d/gi; // +00:00 -00:00 +0000 -0000 or Z\nvar matchShortOffset = /Z|[+-]\\d\\d(?::?\\d\\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z\n\nvar matchTimestamp = /[+-]?\\d+(\\.\\d{1,3})?/; // 123456789 123456789.123\n\n// any word (or two) characters or numbers including two/three word month in arabic.\n// includes scottish gaelic two word and hyphenated months\nvar matchWord = /[0-9]*['a-z\\u00A0-\\u05FF\\u0700-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]+|[\\u0600-\\u06FF\\/]+(\\s*?[\\u0600-\\u06FF]+){1,2}/i;\n\n\nvar regexes = {};\n\nfunction addRegexToken (token, regex, strictRegex) {\n regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) {\n return (isStrict && strictRegex) ? strictRegex : regex;\n };\n}\n\nfunction getParseRegexForToken (token, config) {\n if (!hasOwnProp(regexes, token)) {\n return new RegExp(unescapeFormat(token));\n }\n\n return regexes[token](config._strict, config._locale);\n}\n\n// Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript\nfunction unescapeFormat(s) {\n return regexEscape(s.replace('\\\\', '').replace(/\\\\(\\[)|\\\\(\\])|\\[([^\\]\\[]*)\\]|\\\\(.)/g, function (matched, p1, p2, p3, p4) {\n return p1 || p2 || p3 || p4;\n }));\n}\n\nfunction regexEscape(s) {\n return s.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n}\n\nvar tokens = {};\n\nfunction addParseToken (token, callback) {\n var i, func = callback;\n if (typeof token === 'string') {\n token = [token];\n }\n if (isNumber(callback)) {\n func = function (input, array) {\n array[callback] = toInt(input);\n };\n }\n for (i = 0; i < token.length; i++) {\n tokens[token[i]] = func;\n }\n}\n\nfunction addWeekParseToken (token, callback) {\n addParseToken(token, function (input, array, config, token) {\n config._w = config._w || {};\n callback(input, config._w, config, token);\n });\n}\n\nfunction addTimeToArrayFromToken(token, input, config) {\n if (input != null && hasOwnProp(tokens, token)) {\n tokens[token](input, config._a, config, token);\n }\n}\n\nvar YEAR = 0;\nvar MONTH = 1;\nvar DATE = 2;\nvar HOUR = 3;\nvar MINUTE = 4;\nvar SECOND = 5;\nvar MILLISECOND = 6;\nvar WEEK = 7;\nvar WEEKDAY = 8;\n\nvar indexOf;\n\nif (Array.prototype.indexOf) {\n indexOf = Array.prototype.indexOf;\n} else {\n indexOf = function (o) {\n // I know\n var i;\n for (i = 0; i < this.length; ++i) {\n if (this[i] === o) {\n return i;\n }\n }\n return -1;\n };\n}\n\nvar indexOf$1 = indexOf;\n\nfunction daysInMonth(year, month) {\n return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();\n}\n\n// FORMATTING\n\naddFormatToken('M', ['MM', 2], 'Mo', function () {\n return this.month() + 1;\n});\n\naddFormatToken('MMM', 0, 0, function (format) {\n return this.localeData().monthsShort(this, format);\n});\n\naddFormatToken('MMMM', 0, 0, function (format) {\n return this.localeData().months(this, format);\n});\n\n// ALIASES\n\naddUnitAlias('month', 'M');\n\n// PRIORITY\n\naddUnitPriority('month', 8);\n\n// PARSING\n\naddRegexToken('M', match1to2);\naddRegexToken('MM', match1to2, match2);\naddRegexToken('MMM', function (isStrict, locale) {\n return locale.monthsShortRegex(isStrict);\n});\naddRegexToken('MMMM', function (isStrict, locale) {\n return locale.monthsRegex(isStrict);\n});\n\naddParseToken(['M', 'MM'], function (input, array) {\n array[MONTH] = toInt(input) - 1;\n});\n\naddParseToken(['MMM', 'MMMM'], function (input, array, config, token) {\n var month = config._locale.monthsParse(input, token, config._strict);\n // if we didn't find a month name, mark the date as invalid.\n if (month != null) {\n array[MONTH] = month;\n } else {\n getParsingFlags(config).invalidMonth = input;\n }\n});\n\n// LOCALES\n\nvar MONTHS_IN_FORMAT = /D[oD]?(\\[[^\\[\\]]*\\]|\\s)+MMMM?/;\nvar defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');\nfunction localeMonths (m, format) {\n if (!m) {\n return this._months;\n }\n return isArray(this._months) ? this._months[m.month()] :\n this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()];\n}\n\nvar defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');\nfunction localeMonthsShort (m, format) {\n if (!m) {\n return this._monthsShort;\n }\n return isArray(this._monthsShort) ? this._monthsShort[m.month()] :\n this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];\n}\n\nfunction handleStrictParse(monthName, format, strict) {\n var i, ii, mom, llc = monthName.toLocaleLowerCase();\n if (!this._monthsParse) {\n // this is not used\n this._monthsParse = [];\n this._longMonthsParse = [];\n this._shortMonthsParse = [];\n for (i = 0; i < 12; ++i) {\n mom = createUTC([2000, i]);\n this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();\n this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();\n }\n }\n\n if (strict) {\n if (format === 'MMM') {\n ii = indexOf$1.call(this._shortMonthsParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf$1.call(this._longMonthsParse, llc);\n return ii !== -1 ? ii : null;\n }\n } else {\n if (format === 'MMM') {\n ii = indexOf$1.call(this._shortMonthsParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf$1.call(this._longMonthsParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf$1.call(this._longMonthsParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf$1.call(this._shortMonthsParse, llc);\n return ii !== -1 ? ii : null;\n }\n }\n}\n\nfunction localeMonthsParse (monthName, format, strict) {\n var i, mom, regex;\n\n if (this._monthsParseExact) {\n return handleStrictParse.call(this, monthName, format, strict);\n }\n\n if (!this._monthsParse) {\n this._monthsParse = [];\n this._longMonthsParse = [];\n this._shortMonthsParse = [];\n }\n\n // TODO: add sorting\n // Sorting makes sure if one month (or abbr) is a prefix of another\n // see sorting in computeMonthsParse\n for (i = 0; i < 12; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, i]);\n if (strict && !this._longMonthsParse[i]) {\n this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');\n this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');\n }\n if (!strict && !this._monthsParse[i]) {\n regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');\n this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');\n }\n // test the regex\n if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {\n return i;\n } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {\n return i;\n } else if (!strict && this._monthsParse[i].test(monthName)) {\n return i;\n }\n }\n}\n\n// MOMENTS\n\nfunction setMonth (mom, value) {\n var dayOfMonth;\n\n if (!mom.isValid()) {\n // No op\n return mom;\n }\n\n if (typeof value === 'string') {\n if (/^\\d+$/.test(value)) {\n value = toInt(value);\n } else {\n value = mom.localeData().monthsParse(value);\n // TODO: Another silent failure?\n if (!isNumber(value)) {\n return mom;\n }\n }\n }\n\n dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));\n mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);\n return mom;\n}\n\nfunction getSetMonth (value) {\n if (value != null) {\n setMonth(this, value);\n hooks.updateOffset(this, true);\n return this;\n } else {\n return get(this, 'Month');\n }\n}\n\nfunction getDaysInMonth () {\n return daysInMonth(this.year(), this.month());\n}\n\nvar defaultMonthsShortRegex = matchWord;\nfunction monthsShortRegex (isStrict) {\n if (this._monthsParseExact) {\n if (!hasOwnProp(this, '_monthsRegex')) {\n computeMonthsParse.call(this);\n }\n if (isStrict) {\n return this._monthsShortStrictRegex;\n } else {\n return this._monthsShortRegex;\n }\n } else {\n if (!hasOwnProp(this, '_monthsShortRegex')) {\n this._monthsShortRegex = defaultMonthsShortRegex;\n }\n return this._monthsShortStrictRegex && isStrict ?\n this._monthsShortStrictRegex : this._monthsShortRegex;\n }\n}\n\nvar defaultMonthsRegex = matchWord;\nfunction monthsRegex (isStrict) {\n if (this._monthsParseExact) {\n if (!hasOwnProp(this, '_monthsRegex')) {\n computeMonthsParse.call(this);\n }\n if (isStrict) {\n return this._monthsStrictRegex;\n } else {\n return this._monthsRegex;\n }\n } else {\n if (!hasOwnProp(this, '_monthsRegex')) {\n this._monthsRegex = defaultMonthsRegex;\n }\n return this._monthsStrictRegex && isStrict ?\n this._monthsStrictRegex : this._monthsRegex;\n }\n}\n\nfunction computeMonthsParse () {\n function cmpLenRev(a, b) {\n return b.length - a.length;\n }\n\n var shortPieces = [], longPieces = [], mixedPieces = [],\n i, mom;\n for (i = 0; i < 12; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, i]);\n shortPieces.push(this.monthsShort(mom, ''));\n longPieces.push(this.months(mom, ''));\n mixedPieces.push(this.months(mom, ''));\n mixedPieces.push(this.monthsShort(mom, ''));\n }\n // Sorting makes sure if one month (or abbr) is a prefix of another it\n // will match the longer piece.\n shortPieces.sort(cmpLenRev);\n longPieces.sort(cmpLenRev);\n mixedPieces.sort(cmpLenRev);\n for (i = 0; i < 12; i++) {\n shortPieces[i] = regexEscape(shortPieces[i]);\n longPieces[i] = regexEscape(longPieces[i]);\n }\n for (i = 0; i < 24; i++) {\n mixedPieces[i] = regexEscape(mixedPieces[i]);\n }\n\n this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._monthsShortRegex = this._monthsRegex;\n this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');\n this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');\n}\n\n// FORMATTING\n\naddFormatToken('Y', 0, 0, function () {\n var y = this.year();\n return y <= 9999 ? '' + y : '+' + y;\n});\n\naddFormatToken(0, ['YY', 2], 0, function () {\n return this.year() % 100;\n});\n\naddFormatToken(0, ['YYYY', 4], 0, 'year');\naddFormatToken(0, ['YYYYY', 5], 0, 'year');\naddFormatToken(0, ['YYYYYY', 6, true], 0, 'year');\n\n// ALIASES\n\naddUnitAlias('year', 'y');\n\n// PRIORITIES\n\naddUnitPriority('year', 1);\n\n// PARSING\n\naddRegexToken('Y', matchSigned);\naddRegexToken('YY', match1to2, match2);\naddRegexToken('YYYY', match1to4, match4);\naddRegexToken('YYYYY', match1to6, match6);\naddRegexToken('YYYYYY', match1to6, match6);\n\naddParseToken(['YYYYY', 'YYYYYY'], YEAR);\naddParseToken('YYYY', function (input, array) {\n array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);\n});\naddParseToken('YY', function (input, array) {\n array[YEAR] = hooks.parseTwoDigitYear(input);\n});\naddParseToken('Y', function (input, array) {\n array[YEAR] = parseInt(input, 10);\n});\n\n// HELPERS\n\nfunction daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n}\n\nfunction isLeapYear(year) {\n return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n}\n\n// HOOKS\n\nhooks.parseTwoDigitYear = function (input) {\n return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);\n};\n\n// MOMENTS\n\nvar getSetYear = makeGetSet('FullYear', true);\n\nfunction getIsLeapYear () {\n return isLeapYear(this.year());\n}\n\nfunction createDate (y, m, d, h, M, s, ms) {\n //can't just apply() to create a date:\n //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply\n var date = new Date(y, m, d, h, M, s, ms);\n\n //the date constructor remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0 && isFinite(date.getFullYear())) {\n date.setFullYear(y);\n }\n return date;\n}\n\nfunction createUTCDate (y) {\n var date = new Date(Date.UTC.apply(null, arguments));\n\n //the Date.UTC function remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) {\n date.setUTCFullYear(y);\n }\n return date;\n}\n\n// start-of-first-week - start-of-year\nfunction firstWeekOffset(year, dow, doy) {\n var // first-week day -- which january is always in the first week (4 for iso, 1 for other)\n fwd = 7 + dow - doy,\n // first-week day local weekday -- which local weekday is fwd\n fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;\n\n return -fwdlw + fwd - 1;\n}\n\n//http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday\nfunction dayOfYearFromWeeks(year, week, weekday, dow, doy) {\n var localWeekday = (7 + weekday - dow) % 7,\n weekOffset = firstWeekOffset(year, dow, doy),\n dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,\n resYear, resDayOfYear;\n\n if (dayOfYear <= 0) {\n resYear = year - 1;\n resDayOfYear = daysInYear(resYear) + dayOfYear;\n } else if (dayOfYear > daysInYear(year)) {\n resYear = year + 1;\n resDayOfYear = dayOfYear - daysInYear(year);\n } else {\n resYear = year;\n resDayOfYear = dayOfYear;\n }\n\n return {\n year: resYear,\n dayOfYear: resDayOfYear\n };\n}\n\nfunction weekOfYear(mom, dow, doy) {\n var weekOffset = firstWeekOffset(mom.year(), dow, doy),\n week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,\n resWeek, resYear;\n\n if (week < 1) {\n resYear = mom.year() - 1;\n resWeek = week + weeksInYear(resYear, dow, doy);\n } else if (week > weeksInYear(mom.year(), dow, doy)) {\n resWeek = week - weeksInYear(mom.year(), dow, doy);\n resYear = mom.year() + 1;\n } else {\n resYear = mom.year();\n resWeek = week;\n }\n\n return {\n week: resWeek,\n year: resYear\n };\n}\n\nfunction weeksInYear(year, dow, doy) {\n var weekOffset = firstWeekOffset(year, dow, doy),\n weekOffsetNext = firstWeekOffset(year + 1, dow, doy);\n return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;\n}\n\n// FORMATTING\n\naddFormatToken('w', ['ww', 2], 'wo', 'week');\naddFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');\n\n// ALIASES\n\naddUnitAlias('week', 'w');\naddUnitAlias('isoWeek', 'W');\n\n// PRIORITIES\n\naddUnitPriority('week', 5);\naddUnitPriority('isoWeek', 5);\n\n// PARSING\n\naddRegexToken('w', match1to2);\naddRegexToken('ww', match1to2, match2);\naddRegexToken('W', match1to2);\naddRegexToken('WW', match1to2, match2);\n\naddWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {\n week[token.substr(0, 1)] = toInt(input);\n});\n\n// HELPERS\n\n// LOCALES\n\nfunction localeWeek (mom) {\n return weekOfYear(mom, this._week.dow, this._week.doy).week;\n}\n\nvar defaultLocaleWeek = {\n dow : 0, // Sunday is the first day of the week.\n doy : 6 // The week that contains Jan 1st is the first week of the year.\n};\n\nfunction localeFirstDayOfWeek () {\n return this._week.dow;\n}\n\nfunction localeFirstDayOfYear () {\n return this._week.doy;\n}\n\n// MOMENTS\n\nfunction getSetWeek (input) {\n var week = this.localeData().week(this);\n return input == null ? week : this.add((input - week) * 7, 'd');\n}\n\nfunction getSetISOWeek (input) {\n var week = weekOfYear(this, 1, 4).week;\n return input == null ? week : this.add((input - week) * 7, 'd');\n}\n\n// FORMATTING\n\naddFormatToken('d', 0, 'do', 'day');\n\naddFormatToken('dd', 0, 0, function (format) {\n return this.localeData().weekdaysMin(this, format);\n});\n\naddFormatToken('ddd', 0, 0, function (format) {\n return this.localeData().weekdaysShort(this, format);\n});\n\naddFormatToken('dddd', 0, 0, function (format) {\n return this.localeData().weekdays(this, format);\n});\n\naddFormatToken('e', 0, 0, 'weekday');\naddFormatToken('E', 0, 0, 'isoWeekday');\n\n// ALIASES\n\naddUnitAlias('day', 'd');\naddUnitAlias('weekday', 'e');\naddUnitAlias('isoWeekday', 'E');\n\n// PRIORITY\naddUnitPriority('day', 11);\naddUnitPriority('weekday', 11);\naddUnitPriority('isoWeekday', 11);\n\n// PARSING\n\naddRegexToken('d', match1to2);\naddRegexToken('e', match1to2);\naddRegexToken('E', match1to2);\naddRegexToken('dd', function (isStrict, locale) {\n return locale.weekdaysMinRegex(isStrict);\n});\naddRegexToken('ddd', function (isStrict, locale) {\n return locale.weekdaysShortRegex(isStrict);\n});\naddRegexToken('dddd', function (isStrict, locale) {\n return locale.weekdaysRegex(isStrict);\n});\n\naddWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {\n var weekday = config._locale.weekdaysParse(input, token, config._strict);\n // if we didn't get a weekday name, mark the date as invalid\n if (weekday != null) {\n week.d = weekday;\n } else {\n getParsingFlags(config).invalidWeekday = input;\n }\n});\n\naddWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {\n week[token] = toInt(input);\n});\n\n// HELPERS\n\nfunction parseWeekday(input, locale) {\n if (typeof input !== 'string') {\n return input;\n }\n\n if (!isNaN(input)) {\n return parseInt(input, 10);\n }\n\n input = locale.weekdaysParse(input);\n if (typeof input === 'number') {\n return input;\n }\n\n return null;\n}\n\nfunction parseIsoWeekday(input, locale) {\n if (typeof input === 'string') {\n return locale.weekdaysParse(input) % 7 || 7;\n }\n return isNaN(input) ? null : input;\n}\n\n// LOCALES\n\nvar defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');\nfunction localeWeekdays (m, format) {\n if (!m) {\n return this._weekdays;\n }\n return isArray(this._weekdays) ? this._weekdays[m.day()] :\n this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()];\n}\n\nvar defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');\nfunction localeWeekdaysShort (m) {\n return (m) ? this._weekdaysShort[m.day()] : this._weekdaysShort;\n}\n\nvar defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');\nfunction localeWeekdaysMin (m) {\n return (m) ? this._weekdaysMin[m.day()] : this._weekdaysMin;\n}\n\nfunction handleStrictParse$1(weekdayName, format, strict) {\n var i, ii, mom, llc = weekdayName.toLocaleLowerCase();\n if (!this._weekdaysParse) {\n this._weekdaysParse = [];\n this._shortWeekdaysParse = [];\n this._minWeekdaysParse = [];\n\n for (i = 0; i < 7; ++i) {\n mom = createUTC([2000, 1]).day(i);\n this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase();\n this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase();\n this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();\n }\n }\n\n if (strict) {\n if (format === 'dddd') {\n ii = indexOf$1.call(this._weekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else if (format === 'ddd') {\n ii = indexOf$1.call(this._shortWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf$1.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n }\n } else {\n if (format === 'dddd') {\n ii = indexOf$1.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf$1.call(this._shortWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf$1.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else if (format === 'ddd') {\n ii = indexOf$1.call(this._shortWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf$1.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf$1.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf$1.call(this._minWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf$1.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf$1.call(this._shortWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n }\n }\n}\n\nfunction localeWeekdaysParse (weekdayName, format, strict) {\n var i, mom, regex;\n\n if (this._weekdaysParseExact) {\n return handleStrictParse$1.call(this, weekdayName, format, strict);\n }\n\n if (!this._weekdaysParse) {\n this._weekdaysParse = [];\n this._minWeekdaysParse = [];\n this._shortWeekdaysParse = [];\n this._fullWeekdaysParse = [];\n }\n\n for (i = 0; i < 7; i++) {\n // make the regex if we don't have it already\n\n mom = createUTC([2000, 1]).day(i);\n if (strict && !this._fullWeekdaysParse[i]) {\n this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\\.?') + '$', 'i');\n this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$', 'i');\n this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$', 'i');\n }\n if (!this._weekdaysParse[i]) {\n regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');\n this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');\n }\n // test the regex\n if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {\n return i;\n } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {\n return i;\n } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {\n return i;\n } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {\n return i;\n }\n }\n}\n\n// MOMENTS\n\nfunction getSetDayOfWeek (input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();\n if (input != null) {\n input = parseWeekday(input, this.localeData());\n return this.add(input - day, 'd');\n } else {\n return day;\n }\n}\n\nfunction getSetLocaleDayOfWeek (input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;\n return input == null ? weekday : this.add(input - weekday, 'd');\n}\n\nfunction getSetISODayOfWeek (input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n\n // behaves the same as moment#day except\n // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)\n // as a setter, sunday should belong to the previous week.\n\n if (input != null) {\n var weekday = parseIsoWeekday(input, this.localeData());\n return this.day(this.day() % 7 ? weekday : weekday - 7);\n } else {\n return this.day() || 7;\n }\n}\n\nvar defaultWeekdaysRegex = matchWord;\nfunction weekdaysRegex (isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysStrictRegex;\n } else {\n return this._weekdaysRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n this._weekdaysRegex = defaultWeekdaysRegex;\n }\n return this._weekdaysStrictRegex && isStrict ?\n this._weekdaysStrictRegex : this._weekdaysRegex;\n }\n}\n\nvar defaultWeekdaysShortRegex = matchWord;\nfunction weekdaysShortRegex (isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysShortStrictRegex;\n } else {\n return this._weekdaysShortRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysShortRegex')) {\n this._weekdaysShortRegex = defaultWeekdaysShortRegex;\n }\n return this._weekdaysShortStrictRegex && isStrict ?\n this._weekdaysShortStrictRegex : this._weekdaysShortRegex;\n }\n}\n\nvar defaultWeekdaysMinRegex = matchWord;\nfunction weekdaysMinRegex (isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysMinStrictRegex;\n } else {\n return this._weekdaysMinRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysMinRegex')) {\n this._weekdaysMinRegex = defaultWeekdaysMinRegex;\n }\n return this._weekdaysMinStrictRegex && isStrict ?\n this._weekdaysMinStrictRegex : this._weekdaysMinRegex;\n }\n}\n\n\nfunction computeWeekdaysParse () {\n function cmpLenRev(a, b) {\n return b.length - a.length;\n }\n\n var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [],\n i, mom, minp, shortp, longp;\n for (i = 0; i < 7; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, 1]).day(i);\n minp = this.weekdaysMin(mom, '');\n shortp = this.weekdaysShort(mom, '');\n longp = this.weekdays(mom, '');\n minPieces.push(minp);\n shortPieces.push(shortp);\n longPieces.push(longp);\n mixedPieces.push(minp);\n mixedPieces.push(shortp);\n mixedPieces.push(longp);\n }\n // Sorting makes sure if one weekday (or abbr) is a prefix of another it\n // will match the longer piece.\n minPieces.sort(cmpLenRev);\n shortPieces.sort(cmpLenRev);\n longPieces.sort(cmpLenRev);\n mixedPieces.sort(cmpLenRev);\n for (i = 0; i < 7; i++) {\n shortPieces[i] = regexEscape(shortPieces[i]);\n longPieces[i] = regexEscape(longPieces[i]);\n mixedPieces[i] = regexEscape(mixedPieces[i]);\n }\n\n this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._weekdaysShortRegex = this._weekdaysRegex;\n this._weekdaysMinRegex = this._weekdaysRegex;\n\n this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');\n this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');\n this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i');\n}\n\n// FORMATTING\n\nfunction hFormat() {\n return this.hours() % 12 || 12;\n}\n\nfunction kFormat() {\n return this.hours() || 24;\n}\n\naddFormatToken('H', ['HH', 2], 0, 'hour');\naddFormatToken('h', ['hh', 2], 0, hFormat);\naddFormatToken('k', ['kk', 2], 0, kFormat);\n\naddFormatToken('hmm', 0, 0, function () {\n return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);\n});\n\naddFormatToken('hmmss', 0, 0, function () {\n return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) +\n zeroFill(this.seconds(), 2);\n});\n\naddFormatToken('Hmm', 0, 0, function () {\n return '' + this.hours() + zeroFill(this.minutes(), 2);\n});\n\naddFormatToken('Hmmss', 0, 0, function () {\n return '' + this.hours() + zeroFill(this.minutes(), 2) +\n zeroFill(this.seconds(), 2);\n});\n\nfunction meridiem (token, lowercase) {\n addFormatToken(token, 0, 0, function () {\n return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);\n });\n}\n\nmeridiem('a', true);\nmeridiem('A', false);\n\n// ALIASES\n\naddUnitAlias('hour', 'h');\n\n// PRIORITY\naddUnitPriority('hour', 13);\n\n// PARSING\n\nfunction matchMeridiem (isStrict, locale) {\n return locale._meridiemParse;\n}\n\naddRegexToken('a', matchMeridiem);\naddRegexToken('A', matchMeridiem);\naddRegexToken('H', match1to2);\naddRegexToken('h', match1to2);\naddRegexToken('HH', match1to2, match2);\naddRegexToken('hh', match1to2, match2);\n\naddRegexToken('hmm', match3to4);\naddRegexToken('hmmss', match5to6);\naddRegexToken('Hmm', match3to4);\naddRegexToken('Hmmss', match5to6);\n\naddParseToken(['H', 'HH'], HOUR);\naddParseToken(['a', 'A'], function (input, array, config) {\n config._isPm = config._locale.isPM(input);\n config._meridiem = input;\n});\naddParseToken(['h', 'hh'], function (input, array, config) {\n array[HOUR] = toInt(input);\n getParsingFlags(config).bigHour = true;\n});\naddParseToken('hmm', function (input, array, config) {\n var pos = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos));\n array[MINUTE] = toInt(input.substr(pos));\n getParsingFlags(config).bigHour = true;\n});\naddParseToken('hmmss', function (input, array, config) {\n var pos1 = input.length - 4;\n var pos2 = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos1));\n array[MINUTE] = toInt(input.substr(pos1, 2));\n array[SECOND] = toInt(input.substr(pos2));\n getParsingFlags(config).bigHour = true;\n});\naddParseToken('Hmm', function (input, array, config) {\n var pos = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos));\n array[MINUTE] = toInt(input.substr(pos));\n});\naddParseToken('Hmmss', function (input, array, config) {\n var pos1 = input.length - 4;\n var pos2 = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos1));\n array[MINUTE] = toInt(input.substr(pos1, 2));\n array[SECOND] = toInt(input.substr(pos2));\n});\n\n// LOCALES\n\nfunction localeIsPM (input) {\n // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays\n // Using charAt should be more compatible.\n return ((input + '').toLowerCase().charAt(0) === 'p');\n}\n\nvar defaultLocaleMeridiemParse = /[ap]\\.?m?\\.?/i;\nfunction localeMeridiem (hours, minutes, isLower) {\n if (hours > 11) {\n return isLower ? 'pm' : 'PM';\n } else {\n return isLower ? 'am' : 'AM';\n }\n}\n\n\n// MOMENTS\n\n// Setting the hour should keep the time, because the user explicitly\n// specified which hour he wants. So trying to maintain the same hour (in\n// a new timezone) makes sense. Adding/subtracting hours does not follow\n// this rule.\nvar getSetHour = makeGetSet('Hours', true);\n\n// months\n// week\n// weekdays\n// meridiem\nvar baseConfig = {\n calendar: defaultCalendar,\n longDateFormat: defaultLongDateFormat,\n invalidDate: defaultInvalidDate,\n ordinal: defaultOrdinal,\n ordinalParse: defaultOrdinalParse,\n relativeTime: defaultRelativeTime,\n\n months: defaultLocaleMonths,\n monthsShort: defaultLocaleMonthsShort,\n\n week: defaultLocaleWeek,\n\n weekdays: defaultLocaleWeekdays,\n weekdaysMin: defaultLocaleWeekdaysMin,\n weekdaysShort: defaultLocaleWeekdaysShort,\n\n meridiemParse: defaultLocaleMeridiemParse\n};\n\n// internal storage for locale config files\nvar locales = {};\nvar localeFamilies = {};\nvar globalLocale;\n\nfunction normalizeLocale(key) {\n return key ? key.toLowerCase().replace('_', '-') : key;\n}\n\n// pick the locale from the array\n// try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n// substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\nfunction chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}\n\nfunction loadLocale(name) {\n var oldLocale = null;\n // TODO: Find a better way to register and load all the locales in Node\n if (!locales[name] && (typeof module !== 'undefined') &&\n module && module.exports) {\n try {\n oldLocale = globalLocale._abbr;\n require('./locale/' + name);\n // because defineLocale currently also sets the global locale, we\n // want to undo that for lazy loaded locales\n getSetGlobalLocale(oldLocale);\n } catch (e) { }\n }\n return locales[name];\n}\n\n// This function will load locale and then set the global locale. If\n// no arguments are passed in, it will simply return the current global\n// locale key.\nfunction getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}\n\nfunction defineLocale (name, config) {\n if (config !== null) {\n var parentConfig = baseConfig;\n config.abbr = name;\n if (locales[name] != null) {\n deprecateSimple('defineLocaleOverride',\n 'use moment.updateLocale(localeName, config) to change ' +\n 'an existing locale. moment.defineLocale(localeName, ' +\n 'config) should only be used for creating a new locale ' +\n 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.');\n parentConfig = locales[name]._config;\n } else if (config.parentLocale != null) {\n if (locales[config.parentLocale] != null) {\n parentConfig = locales[config.parentLocale]._config;\n } else {\n if (!localeFamilies[config.parentLocale]) {\n localeFamilies[config.parentLocale] = [];\n }\n localeFamilies[config.parentLocale].push({\n name: name,\n config: config\n });\n return null;\n }\n }\n locales[name] = new Locale(mergeConfigs(parentConfig, config));\n\n if (localeFamilies[name]) {\n localeFamilies[name].forEach(function (x) {\n defineLocale(x.name, x.config);\n });\n }\n\n // backwards compat for now: also set the locale\n // make sure we set the locale AFTER all child locales have been\n // created, so we won't end up with the child locale set.\n getSetGlobalLocale(name);\n\n\n return locales[name];\n } else {\n // useful for testing\n delete locales[name];\n return null;\n }\n}\n\nfunction updateLocale(name, config) {\n if (config != null) {\n var locale, parentConfig = baseConfig;\n // MERGE\n if (locales[name] != null) {\n parentConfig = locales[name]._config;\n }\n config = mergeConfigs(parentConfig, config);\n locale = new Locale(config);\n locale.parentLocale = locales[name];\n locales[name] = locale;\n\n // backwards compat for now: also set the locale\n getSetGlobalLocale(name);\n } else {\n // pass null for config to unupdate, useful for tests\n if (locales[name] != null) {\n if (locales[name].parentLocale != null) {\n locales[name] = locales[name].parentLocale;\n } else if (locales[name] != null) {\n delete locales[name];\n }\n }\n }\n return locales[name];\n}\n\n// returns locale data\nfunction getLocale (key) {\n var locale;\n\n if (key && key._locale && key._locale._abbr) {\n key = key._locale._abbr;\n }\n\n if (!key) {\n return globalLocale;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n locale = loadLocale(key);\n if (locale) {\n return locale;\n }\n key = [key];\n }\n\n return chooseLocale(key);\n}\n\nfunction listLocales() {\n return keys$1(locales);\n}\n\nfunction checkOverflow (m) {\n var overflow;\n var a = m._a;\n\n if (a && getParsingFlags(m).overflow === -2) {\n overflow =\n a[MONTH] < 0 || a[MONTH] > 11 ? MONTH :\n a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE :\n a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :\n a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE :\n a[SECOND] < 0 || a[SECOND] > 59 ? SECOND :\n a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :\n -1;\n\n if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {\n overflow = DATE;\n }\n if (getParsingFlags(m)._overflowWeeks && overflow === -1) {\n overflow = WEEK;\n }\n if (getParsingFlags(m)._overflowWeekday && overflow === -1) {\n overflow = WEEKDAY;\n }\n\n getParsingFlags(m).overflow = overflow;\n }\n\n return m;\n}\n\n// iso 8601 regex\n// 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)\nvar extendedIsoRegex = /^\\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)?)?$/;\nvar basicIsoRegex = /^\\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)?)?$/;\n\nvar tzRegex = /Z|[+-]\\d\\d(?::?\\d\\d)?/;\n\nvar isoDates = [\n ['YYYYYY-MM-DD', /[+-]\\d{6}-\\d\\d-\\d\\d/],\n ['YYYY-MM-DD', /\\d{4}-\\d\\d-\\d\\d/],\n ['GGGG-[W]WW-E', /\\d{4}-W\\d\\d-\\d/],\n ['GGGG-[W]WW', /\\d{4}-W\\d\\d/, false],\n ['YYYY-DDD', /\\d{4}-\\d{3}/],\n ['YYYY-MM', /\\d{4}-\\d\\d/, false],\n ['YYYYYYMMDD', /[+-]\\d{10}/],\n ['YYYYMMDD', /\\d{8}/],\n // YYYYMM is NOT allowed by the standard\n ['GGGG[W]WWE', /\\d{4}W\\d{3}/],\n ['GGGG[W]WW', /\\d{4}W\\d{2}/, false],\n ['YYYYDDD', /\\d{7}/]\n];\n\n// iso time formats and regexes\nvar isoTimes = [\n ['HH:mm:ss.SSSS', /\\d\\d:\\d\\d:\\d\\d\\.\\d+/],\n ['HH:mm:ss,SSSS', /\\d\\d:\\d\\d:\\d\\d,\\d+/],\n ['HH:mm:ss', /\\d\\d:\\d\\d:\\d\\d/],\n ['HH:mm', /\\d\\d:\\d\\d/],\n ['HHmmss.SSSS', /\\d\\d\\d\\d\\d\\d\\.\\d+/],\n ['HHmmss,SSSS', /\\d\\d\\d\\d\\d\\d,\\d+/],\n ['HHmmss', /\\d\\d\\d\\d\\d\\d/],\n ['HHmm', /\\d\\d\\d\\d/],\n ['HH', /\\d\\d/]\n];\n\nvar aspNetJsonRegex = /^\\/?Date\\((\\-?\\d+)/i;\n\n// date from iso format\nfunction configFromISO(config) {\n var i, l,\n string = config._i,\n match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),\n allowTime, dateFormat, timeFormat, tzFormat;\n\n if (match) {\n getParsingFlags(config).iso = true;\n\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(match[1])) {\n dateFormat = isoDates[i][0];\n allowTime = isoDates[i][2] !== false;\n break;\n }\n }\n if (dateFormat == null) {\n config._isValid = false;\n return;\n }\n if (match[3]) {\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(match[3])) {\n // match[2] should be 'T' or space\n timeFormat = (match[2] || ' ') + isoTimes[i][0];\n break;\n }\n }\n if (timeFormat == null) {\n config._isValid = false;\n return;\n }\n }\n if (!allowTime && timeFormat != null) {\n config._isValid = false;\n return;\n }\n if (match[4]) {\n if (tzRegex.exec(match[4])) {\n tzFormat = 'Z';\n } else {\n config._isValid = false;\n return;\n }\n }\n config._f = dateFormat + (timeFormat || '') + (tzFormat || '');\n configFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n}\n\n// date from iso format or fallback\nfunction configFromString(config) {\n var matched = aspNetJsonRegex.exec(config._i);\n\n if (matched !== null) {\n config._d = new Date(+matched[1]);\n return;\n }\n\n configFromISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n hooks.createFromInputFallback(config);\n }\n}\n\nhooks.createFromInputFallback = deprecate(\n 'value provided is not in a recognized ISO format. moment construction falls back to js Date(), ' +\n 'which is not reliable across all browsers and versions. Non ISO date formats are ' +\n 'discouraged and will be removed in an upcoming major release. Please refer to ' +\n 'http://momentjs.com/guides/#/warnings/js-date/ for more info.',\n function (config) {\n config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));\n }\n);\n\n// Pick the first defined of two or three arguments.\nfunction defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n}\n\nfunction currentDateArray(config) {\n // hooks is actually the exported moment object\n var nowValue = new Date(hooks.now());\n if (config._useUTC) {\n return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];\n }\n return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];\n}\n\n// convert an array to a date.\n// the array should mirror the parameters below\n// note: all values past the year are optional and will default to the lowest possible value.\n// [year, month, day , hour, minute, second, millisecond]\nfunction configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n}\n\nfunction dayOfYearFromWeekInfo(config) {\n var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow;\n\n w = config._w;\n if (w.GG != null || w.W != null || w.E != null) {\n dow = 1;\n doy = 4;\n\n // TODO: We need to take the current isoWeekYear, but that depends on\n // how we interpret now (local, utc, fixed offset). So create\n // a now version of current config (take local/utc/offset flags, and\n // create now).\n weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year);\n week = defaults(w.W, 1);\n weekday = defaults(w.E, 1);\n if (weekday < 1 || weekday > 7) {\n weekdayOverflow = true;\n }\n } else {\n dow = config._locale._week.dow;\n doy = config._locale._week.doy;\n\n var curWeek = weekOfYear(createLocal(), dow, doy);\n\n weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);\n\n // Default to current week.\n week = defaults(w.w, curWeek.week);\n\n if (w.d != null) {\n // weekday -- low day numbers are considered next week\n weekday = w.d;\n if (weekday < 0 || weekday > 6) {\n weekdayOverflow = true;\n }\n } else if (w.e != null) {\n // local weekday -- counting starts from begining of week\n weekday = w.e + dow;\n if (w.e < 0 || w.e > 6) {\n weekdayOverflow = true;\n }\n } else {\n // default to begining of week\n weekday = dow;\n }\n }\n if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {\n getParsingFlags(config)._overflowWeeks = true;\n } else if (weekdayOverflow != null) {\n getParsingFlags(config)._overflowWeekday = true;\n } else {\n temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);\n config._a[YEAR] = temp.year;\n config._dayOfYear = temp.dayOfYear;\n }\n}\n\n// constant that refers to the ISO standard\nhooks.ISO_8601 = function () {};\n\n// date from string and format string\nfunction configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}\n\n\nfunction meridiemFixWrap (locale, hour, meridiem) {\n var isPm;\n\n if (meridiem == null) {\n // nothing to do\n return hour;\n }\n if (locale.meridiemHour != null) {\n return locale.meridiemHour(hour, meridiem);\n } else if (locale.isPM != null) {\n // Fallback\n isPm = locale.isPM(meridiem);\n if (isPm && hour < 12) {\n hour += 12;\n }\n if (!isPm && hour === 12) {\n hour = 0;\n }\n return hour;\n } else {\n // this is not supposed to happen\n return hour;\n }\n}\n\n// date from string and array of format strings\nfunction configFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n getParsingFlags(config).invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._f = config._f[i];\n configFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += getParsingFlags(tempConfig).charsLeftOver;\n\n //or tokens\n currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;\n\n getParsingFlags(tempConfig).score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n}\n\nfunction configFromObject(config) {\n if (config._d) {\n return;\n }\n\n var i = normalizeObjectUnits(config._i);\n config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) {\n return obj && parseInt(obj, 10);\n });\n\n configFromArray(config);\n}\n\nfunction createFromConfig (config) {\n var res = new Moment(checkOverflow(prepareConfig(config)));\n if (res._nextDay) {\n // Adding is smart enough around DST\n res.add(1, 'd');\n res._nextDay = undefined;\n }\n\n return res;\n}\n\nfunction prepareConfig (config) {\n var input = config._i,\n format = config._f;\n\n config._locale = config._locale || getLocale(config._l);\n\n if (input === null || (format === undefined && input === '')) {\n return createInvalid({nullInput: true});\n }\n\n if (typeof input === 'string') {\n config._i = input = config._locale.preparse(input);\n }\n\n if (isMoment(input)) {\n return new Moment(checkOverflow(input));\n } else if (isDate(input)) {\n config._d = input;\n } else if (isArray(format)) {\n configFromStringAndArray(config);\n } else if (format) {\n configFromStringAndFormat(config);\n } else {\n configFromInput(config);\n }\n\n if (!isValid(config)) {\n config._d = null;\n }\n\n return config;\n}\n\nfunction configFromInput(config) {\n var input = config._i;\n if (input === undefined) {\n config._d = new Date(hooks.now());\n } else if (isDate(input)) {\n config._d = new Date(input.valueOf());\n } else if (typeof input === 'string') {\n configFromString(config);\n } else if (isArray(input)) {\n config._a = map(input.slice(0), function (obj) {\n return parseInt(obj, 10);\n });\n configFromArray(config);\n } else if (typeof(input) === 'object') {\n configFromObject(config);\n } else if (isNumber(input)) {\n // from milliseconds\n config._d = new Date(input);\n } else {\n hooks.createFromInputFallback(config);\n }\n}\n\nfunction createLocalOrUTC (input, format, locale, strict, isUTC) {\n var c = {};\n\n if (locale === true || locale === false) {\n strict = locale;\n locale = undefined;\n }\n\n if ((isObject(input) && isObjectEmpty(input)) ||\n (isArray(input) && input.length === 0)) {\n input = undefined;\n }\n // object construction must be done this way.\n // https://github.com/moment/moment/issues/1423\n c._isAMomentObject = true;\n c._useUTC = c._isUTC = isUTC;\n c._l = locale;\n c._i = input;\n c._f = format;\n c._strict = strict;\n\n return createFromConfig(c);\n}\n\nfunction createLocal (input, format, locale, strict) {\n return createLocalOrUTC(input, format, locale, strict, false);\n}\n\nvar prototypeMin = deprecate(\n 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',\n function () {\n var other = createLocal.apply(null, arguments);\n if (this.isValid() && other.isValid()) {\n return other < this ? this : other;\n } else {\n return createInvalid();\n }\n }\n);\n\nvar prototypeMax = deprecate(\n 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',\n function () {\n var other = createLocal.apply(null, arguments);\n if (this.isValid() && other.isValid()) {\n return other > this ? this : other;\n } else {\n return createInvalid();\n }\n }\n);\n\n// Pick a moment m from moments so that m[fn](other) is true for all\n// other. This relies on the function fn to be transitive.\n//\n// moments should either be an array of moment objects or an array, whose\n// first element is an array of moment objects.\nfunction pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n}\n\n// TODO: Use [].sort instead?\nfunction min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}\n\nfunction max () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isAfter', args);\n}\n\nvar now = function () {\n return Date.now ? Date.now() : +(new Date());\n};\n\nfunction Duration (duration) {\n var normalizedInput = normalizeObjectUnits(duration),\n years = normalizedInput.year || 0,\n quarters = normalizedInput.quarter || 0,\n months = normalizedInput.month || 0,\n weeks = normalizedInput.week || 0,\n days = normalizedInput.day || 0,\n hours = normalizedInput.hour || 0,\n minutes = normalizedInput.minute || 0,\n seconds = normalizedInput.second || 0,\n milliseconds = normalizedInput.millisecond || 0;\n\n // representation for dateAddRemove\n this._milliseconds = +milliseconds +\n seconds * 1e3 + // 1000\n minutes * 6e4 + // 1000 * 60\n hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978\n // Because of dateAddRemove treats 24 hours as different from a\n // day when working around DST, we need to store them separately\n this._days = +days +\n weeks * 7;\n // It is impossible translate months into days without knowing\n // which months you are are talking about, so we have to store\n // it separately.\n this._months = +months +\n quarters * 3 +\n years * 12;\n\n this._data = {};\n\n this._locale = getLocale();\n\n this._bubble();\n}\n\nfunction isDuration (obj) {\n return obj instanceof Duration;\n}\n\nfunction absRound (number) {\n if (number < 0) {\n return Math.round(-1 * number) * -1;\n } else {\n return Math.round(number);\n }\n}\n\n// FORMATTING\n\nfunction offset (token, separator) {\n addFormatToken(token, 0, 0, function () {\n var offset = this.utcOffset();\n var sign = '+';\n if (offset < 0) {\n offset = -offset;\n sign = '-';\n }\n return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);\n });\n}\n\noffset('Z', ':');\noffset('ZZ', '');\n\n// PARSING\n\naddRegexToken('Z', matchShortOffset);\naddRegexToken('ZZ', matchShortOffset);\naddParseToken(['Z', 'ZZ'], function (input, array, config) {\n config._useUTC = true;\n config._tzm = offsetFromString(matchShortOffset, input);\n});\n\n// HELPERS\n\n// timezone chunker\n// '+10:00' > ['10', '00']\n// '-1530' > ['-15', '30']\nvar chunkOffset = /([\\+\\-]|\\d\\d)/gi;\n\nfunction offsetFromString(matcher, string) {\n var matches = (string || '').match(matcher);\n\n if (matches === null) {\n return null;\n }\n\n var chunk = matches[matches.length - 1] || [];\n var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];\n var minutes = +(parts[1] * 60) + toInt(parts[2]);\n\n return minutes === 0 ?\n 0 :\n parts[0] === '+' ? minutes : -minutes;\n}\n\n// Return a moment from input, that is local/utc/zone equivalent to model.\nfunction cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(res._d.valueOf() + diff);\n hooks.updateOffset(res, false);\n return res;\n } else {\n return createLocal(input).local();\n }\n}\n\nfunction getDateOffset (m) {\n // On Firefox.24 Date#getTimezoneOffset returns a floating point.\n // https://github.com/moment/moment/pull/1871\n return -Math.round(m._d.getTimezoneOffset() / 15) * 15;\n}\n\n// HOOKS\n\n// This function will be called whenever a moment is mutated.\n// It is intended to keep the offset in sync with the timezone.\nhooks.updateOffset = function () {};\n\n// MOMENTS\n\n// keepLocalTime = true means only change the timezone, without\n// affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->\n// 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset\n// +0200, so we adjust the time as needed, to be valid.\n//\n// Keeping the time actually adds/subtracts (one hour)\n// from the actual represented time. That is why we call updateOffset\n// a second time. In case it wants us to change the offset again\n// _changeInProgress == true case, then we have to adjust, because\n// there is no such time in the given timezone.\nfunction getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n}\n\nfunction getSetZone (input, keepLocalTime) {\n if (input != null) {\n if (typeof input !== 'string') {\n input = -input;\n }\n\n this.utcOffset(input, keepLocalTime);\n\n return this;\n } else {\n return -this.utcOffset();\n }\n}\n\nfunction setOffsetToUTC (keepLocalTime) {\n return this.utcOffset(0, keepLocalTime);\n}\n\nfunction setOffsetToLocal (keepLocalTime) {\n if (this._isUTC) {\n this.utcOffset(0, keepLocalTime);\n this._isUTC = false;\n\n if (keepLocalTime) {\n this.subtract(getDateOffset(this), 'm');\n }\n }\n return this;\n}\n\nfunction setOffsetToParsedOffset () {\n if (this._tzm != null) {\n this.utcOffset(this._tzm);\n } else if (typeof this._i === 'string') {\n var tZone = offsetFromString(matchOffset, this._i);\n if (tZone != null) {\n this.utcOffset(tZone);\n }\n else {\n this.utcOffset(0, true);\n }\n }\n return this;\n}\n\nfunction hasAlignedHourOffset (input) {\n if (!this.isValid()) {\n return false;\n }\n input = input ? createLocal(input).utcOffset() : 0;\n\n return (this.utcOffset() - input) % 60 === 0;\n}\n\nfunction isDaylightSavingTime () {\n return (\n this.utcOffset() > this.clone().month(0).utcOffset() ||\n this.utcOffset() > this.clone().month(5).utcOffset()\n );\n}\n\nfunction isDaylightSavingTimeShifted () {\n if (!isUndefined(this._isDSTShifted)) {\n return this._isDSTShifted;\n }\n\n var c = {};\n\n copyConfig(c, this);\n c = prepareConfig(c);\n\n if (c._a) {\n var other = c._isUTC ? createUTC(c._a) : createLocal(c._a);\n this._isDSTShifted = this.isValid() &&\n compareArrays(c._a, other.toArray()) > 0;\n } else {\n this._isDSTShifted = false;\n }\n\n return this._isDSTShifted;\n}\n\nfunction isLocal () {\n return this.isValid() ? !this._isUTC : false;\n}\n\nfunction isUtcOffset () {\n return this.isValid() ? this._isUTC : false;\n}\n\nfunction isUtc () {\n return this.isValid() ? this._isUTC && this._offset === 0 : false;\n}\n\n// ASP.NET json date format regex\nvar aspNetRegex = /^(\\-)?(?:(\\d*)[. ])?(\\d+)\\:(\\d+)(?:\\:(\\d+)(\\.\\d*)?)?$/;\n\n// from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html\n// somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere\n// and further modified to allow for strings containing both week and day\nvar isoRegex = /^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;\n\nfunction createDuration (input, key) {\n var duration = input,\n // matching against regexp is expensive, do it on demand\n match = null,\n sign,\n ret,\n diffRes;\n\n if (isDuration(input)) {\n duration = {\n ms : input._milliseconds,\n d : input._days,\n M : input._months\n };\n } else if (isNumber(input)) {\n duration = {};\n if (key) {\n duration[key] = input;\n } else {\n duration.milliseconds = input;\n }\n } else if (!!(match = aspNetRegex.exec(input))) {\n sign = (match[1] === '-') ? -1 : 1;\n duration = {\n y : 0,\n d : toInt(match[DATE]) * sign,\n h : toInt(match[HOUR]) * sign,\n m : toInt(match[MINUTE]) * sign,\n s : toInt(match[SECOND]) * sign,\n ms : toInt(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match\n };\n } else if (!!(match = isoRegex.exec(input))) {\n sign = (match[1] === '-') ? -1 : 1;\n duration = {\n y : parseIso(match[2], sign),\n M : parseIso(match[3], sign),\n w : parseIso(match[4], sign),\n d : parseIso(match[5], sign),\n h : parseIso(match[6], sign),\n m : parseIso(match[7], sign),\n s : parseIso(match[8], sign)\n };\n } else if (duration == null) {// checks for null or undefined\n duration = {};\n } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {\n diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to));\n\n duration = {};\n duration.ms = diffRes.milliseconds;\n duration.M = diffRes.months;\n }\n\n ret = new Duration(duration);\n\n if (isDuration(input) && hasOwnProp(input, '_locale')) {\n ret._locale = input._locale;\n }\n\n return ret;\n}\n\ncreateDuration.fn = Duration.prototype;\n\nfunction parseIso (inp, sign) {\n // We'd normally use ~~inp for this, but unfortunately it also\n // converts floats to ints.\n // inp may be undefined, so careful calling replace on it.\n var res = inp && parseFloat(inp.replace(',', '.'));\n // apply sign while we're at it\n return (isNaN(res) ? 0 : res) * sign;\n}\n\nfunction positiveMomentsDifference(base, other) {\n var res = {milliseconds: 0, months: 0};\n\n res.months = other.month() - base.month() +\n (other.year() - base.year()) * 12;\n if (base.clone().add(res.months, 'M').isAfter(other)) {\n --res.months;\n }\n\n res.milliseconds = +other - +(base.clone().add(res.months, 'M'));\n\n return res;\n}\n\nfunction momentsDifference(base, other) {\n var res;\n if (!(base.isValid() && other.isValid())) {\n return {milliseconds: 0, months: 0};\n }\n\n other = cloneWithOffset(other, base);\n if (base.isBefore(other)) {\n res = positiveMomentsDifference(base, other);\n } else {\n res = positiveMomentsDifference(other, base);\n res.milliseconds = -res.milliseconds;\n res.months = -res.months;\n }\n\n return res;\n}\n\n// TODO: remove 'name' arg after deprecation is removed\nfunction createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n tmp = val; val = period; period = tmp;\n }\n\n val = typeof val === 'string' ? +val : val;\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n}\n\nfunction addSubtract (mom, duration, isAdding, updateOffset) {\n var milliseconds = duration._milliseconds,\n days = absRound(duration._days),\n months = absRound(duration._months);\n\n if (!mom.isValid()) {\n // No op\n return;\n }\n\n updateOffset = updateOffset == null ? true : updateOffset;\n\n if (milliseconds) {\n mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);\n }\n if (days) {\n set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);\n }\n if (months) {\n setMonth(mom, get(mom, 'Month') + months * isAdding);\n }\n if (updateOffset) {\n hooks.updateOffset(mom, days || months);\n }\n}\n\nvar add = createAdder(1, 'add');\nvar subtract = createAdder(-1, 'subtract');\n\nfunction getCalendarFormat(myMoment, now) {\n var diff = myMoment.diff(now, 'days', true);\n return diff < -6 ? 'sameElse' :\n diff < -1 ? 'lastWeek' :\n diff < 0 ? 'lastDay' :\n diff < 1 ? 'sameDay' :\n diff < 2 ? 'nextDay' :\n diff < 7 ? 'nextWeek' : 'sameElse';\n}\n\nfunction calendar$1 (time, formats) {\n // We want to compare the start of today, vs this.\n // Getting start-of-today depends on whether we're local/utc/offset or not.\n var now = time || createLocal(),\n sod = cloneWithOffset(now, this).startOf('day'),\n format = hooks.calendarFormat(this, sod) || 'sameElse';\n\n var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]);\n\n return this.format(output || this.localeData().calendar(format, this, createLocal(now)));\n}\n\nfunction clone () {\n return new Moment(this);\n}\n\nfunction isAfter (input, units) {\n var localInput = isMoment(input) ? input : createLocal(input);\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');\n if (units === 'millisecond') {\n return this.valueOf() > localInput.valueOf();\n } else {\n return localInput.valueOf() < this.clone().startOf(units).valueOf();\n }\n}\n\nfunction isBefore (input, units) {\n var localInput = isMoment(input) ? input : createLocal(input);\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');\n if (units === 'millisecond') {\n return this.valueOf() < localInput.valueOf();\n } else {\n return this.clone().endOf(units).valueOf() < localInput.valueOf();\n }\n}\n\nfunction isBetween (from, to, units, inclusivity) {\n inclusivity = inclusivity || '()';\n return (inclusivity[0] === '(' ? this.isAfter(from, units) : !this.isBefore(from, units)) &&\n (inclusivity[1] === ')' ? this.isBefore(to, units) : !this.isAfter(to, units));\n}\n\nfunction isSame (input, units) {\n var localInput = isMoment(input) ? input : createLocal(input),\n inputMs;\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(units || 'millisecond');\n if (units === 'millisecond') {\n return this.valueOf() === localInput.valueOf();\n } else {\n inputMs = localInput.valueOf();\n return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();\n }\n}\n\nfunction isSameOrAfter (input, units) {\n return this.isSame(input, units) || this.isAfter(input,units);\n}\n\nfunction isSameOrBefore (input, units) {\n return this.isSame(input, units) || this.isBefore(input,units);\n}\n\nfunction diff (input, units, asFloat) {\n var that,\n zoneDelta,\n delta, output;\n\n if (!this.isValid()) {\n return NaN;\n }\n\n that = cloneWithOffset(input, this);\n\n if (!that.isValid()) {\n return NaN;\n }\n\n zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;\n\n units = normalizeUnits(units);\n\n if (units === 'year' || units === 'month' || units === 'quarter') {\n output = monthDiff(this, that);\n if (units === 'quarter') {\n output = output / 3;\n } else if (units === 'year') {\n output = output / 12;\n }\n } else {\n delta = this - that;\n output = units === 'second' ? delta / 1e3 : // 1000\n units === 'minute' ? delta / 6e4 : // 1000 * 60\n units === 'hour' ? delta / 36e5 : // 1000 * 60 * 60\n units === 'day' ? (delta - zoneDelta) / 864e5 : // 1000 * 60 * 60 * 24, negate dst\n units === 'week' ? (delta - zoneDelta) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst\n delta;\n }\n return asFloat ? output : absFloor(output);\n}\n\nfunction monthDiff (a, b) {\n // difference in months\n var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),\n // b is in (anchor - 1 month, anchor + 1 month)\n anchor = a.clone().add(wholeMonthDiff, 'months'),\n anchor2, adjust;\n\n if (b - anchor < 0) {\n anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');\n // linear across the month\n adjust = (b - anchor) / (anchor - anchor2);\n } else {\n anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');\n // linear across the month\n adjust = (b - anchor) / (anchor2 - anchor);\n }\n\n //check for negative zero, return zero if negative zero\n return -(wholeMonthDiff + adjust) || 0;\n}\n\nhooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';\nhooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';\n\nfunction toString () {\n return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');\n}\n\nfunction toISOString () {\n var m = this.clone().utc();\n if (0 < m.year() && m.year() <= 9999) {\n if (isFunction(Date.prototype.toISOString)) {\n // native implementation is ~50x faster, use it when we can\n return this.toDate().toISOString();\n } else {\n return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');\n }\n } else {\n return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]');\n }\n}\n\n/**\n * Return a human readable representation of a moment that can\n * also be evaluated to get a new moment which is the same\n *\n * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects\n */\nfunction inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 < this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}\n\nfunction format (inputString) {\n if (!inputString) {\n inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat;\n }\n var output = formatMoment(this, inputString);\n return this.localeData().postformat(output);\n}\n\nfunction from (time, withoutSuffix) {\n if (this.isValid() &&\n ((isMoment(time) && time.isValid()) ||\n createLocal(time).isValid())) {\n return createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);\n } else {\n return this.localeData().invalidDate();\n }\n}\n\nfunction fromNow (withoutSuffix) {\n return this.from(createLocal(), withoutSuffix);\n}\n\nfunction to (time, withoutSuffix) {\n if (this.isValid() &&\n ((isMoment(time) && time.isValid()) ||\n createLocal(time).isValid())) {\n return createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix);\n } else {\n return this.localeData().invalidDate();\n }\n}\n\nfunction toNow (withoutSuffix) {\n return this.to(createLocal(), withoutSuffix);\n}\n\n// If passed a locale key, it will set the locale for this\n// instance. Otherwise, it will return the locale configuration\n// variables for this instance.\nfunction locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}\n\nvar lang = deprecate(\n 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',\n function (key) {\n if (key === undefined) {\n return this.localeData();\n } else {\n return this.locale(key);\n }\n }\n);\n\nfunction localeData () {\n return this._locale;\n}\n\nfunction startOf (units) {\n units = normalizeUnits(units);\n // the following switch intentionally omits break keywords\n // to utilize falling through the cases.\n switch (units) {\n case 'year':\n this.month(0);\n /* falls through */\n case 'quarter':\n case 'month':\n this.date(1);\n /* falls through */\n case 'week':\n case 'isoWeek':\n case 'day':\n case 'date':\n this.hours(0);\n /* falls through */\n case 'hour':\n this.minutes(0);\n /* falls through */\n case 'minute':\n this.seconds(0);\n /* falls through */\n case 'second':\n this.milliseconds(0);\n }\n\n // weeks are a special case\n if (units === 'week') {\n this.weekday(0);\n }\n if (units === 'isoWeek') {\n this.isoWeekday(1);\n }\n\n // quarters are also special\n if (units === 'quarter') {\n this.month(Math.floor(this.month() / 3) * 3);\n }\n\n return this;\n}\n\nfunction endOf (units) {\n units = normalizeUnits(units);\n if (units === undefined || units === 'millisecond') {\n return this;\n }\n\n // 'date' is an alias for 'day', so it should be considered as such.\n if (units === 'date') {\n units = 'day';\n }\n\n return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms');\n}\n\nfunction valueOf () {\n return this._d.valueOf() - ((this._offset || 0) * 60000);\n}\n\nfunction unix () {\n return Math.floor(this.valueOf() / 1000);\n}\n\nfunction toDate () {\n return new Date(this.valueOf());\n}\n\nfunction toArray () {\n var m = this;\n return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];\n}\n\nfunction toObject () {\n var m = this;\n return {\n years: m.year(),\n months: m.month(),\n date: m.date(),\n hours: m.hours(),\n minutes: m.minutes(),\n seconds: m.seconds(),\n milliseconds: m.milliseconds()\n };\n}\n\nfunction toJSON () {\n // new Date(NaN).toJSON() === null\n return this.isValid() ? this.toISOString() : null;\n}\n\nfunction isValid$1 () {\n return isValid(this);\n}\n\nfunction parsingFlags () {\n return extend({}, getParsingFlags(this));\n}\n\nfunction invalidAt () {\n return getParsingFlags(this).overflow;\n}\n\nfunction creationData() {\n return {\n input: this._i,\n format: this._f,\n locale: this._locale,\n isUTC: this._isUTC,\n strict: this._strict\n };\n}\n\n// FORMATTING\n\naddFormatToken(0, ['gg', 2], 0, function () {\n return this.weekYear() % 100;\n});\n\naddFormatToken(0, ['GG', 2], 0, function () {\n return this.isoWeekYear() % 100;\n});\n\nfunction addWeekYearFormatToken (token, getter) {\n addFormatToken(0, [token, token.length], 0, getter);\n}\n\naddWeekYearFormatToken('gggg', 'weekYear');\naddWeekYearFormatToken('ggggg', 'weekYear');\naddWeekYearFormatToken('GGGG', 'isoWeekYear');\naddWeekYearFormatToken('GGGGG', 'isoWeekYear');\n\n// ALIASES\n\naddUnitAlias('weekYear', 'gg');\naddUnitAlias('isoWeekYear', 'GG');\n\n// PRIORITY\n\naddUnitPriority('weekYear', 1);\naddUnitPriority('isoWeekYear', 1);\n\n\n// PARSING\n\naddRegexToken('G', matchSigned);\naddRegexToken('g', matchSigned);\naddRegexToken('GG', match1to2, match2);\naddRegexToken('gg', match1to2, match2);\naddRegexToken('GGGG', match1to4, match4);\naddRegexToken('gggg', match1to4, match4);\naddRegexToken('GGGGG', match1to6, match6);\naddRegexToken('ggggg', match1to6, match6);\n\naddWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {\n week[token.substr(0, 2)] = toInt(input);\n});\n\naddWeekParseToken(['gg', 'GG'], function (input, week, config, token) {\n week[token] = hooks.parseTwoDigitYear(input);\n});\n\n// MOMENTS\n\nfunction getSetWeekYear (input) {\n return getSetWeekYearHelper.call(this,\n input,\n this.week(),\n this.weekday(),\n this.localeData()._week.dow,\n this.localeData()._week.doy);\n}\n\nfunction getSetISOWeekYear (input) {\n return getSetWeekYearHelper.call(this,\n input, this.isoWeek(), this.isoWeekday(), 1, 4);\n}\n\nfunction getISOWeeksInYear () {\n return weeksInYear(this.year(), 1, 4);\n}\n\nfunction getWeeksInYear () {\n var weekInfo = this.localeData()._week;\n return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);\n}\n\nfunction getSetWeekYearHelper(input, week, weekday, dow, doy) {\n var weeksTarget;\n if (input == null) {\n return weekOfYear(this, dow, doy).year;\n } else {\n weeksTarget = weeksInYear(input, dow, doy);\n if (week > weeksTarget) {\n week = weeksTarget;\n }\n return setWeekAll.call(this, input, week, weekday, dow, doy);\n }\n}\n\nfunction setWeekAll(weekYear, week, weekday, dow, doy) {\n var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),\n date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);\n\n this.year(date.getUTCFullYear());\n this.month(date.getUTCMonth());\n this.date(date.getUTCDate());\n return this;\n}\n\n// FORMATTING\n\naddFormatToken('Q', 0, 'Qo', 'quarter');\n\n// ALIASES\n\naddUnitAlias('quarter', 'Q');\n\n// PRIORITY\n\naddUnitPriority('quarter', 7);\n\n// PARSING\n\naddRegexToken('Q', match1);\naddParseToken('Q', function (input, array) {\n array[MONTH] = (toInt(input) - 1) * 3;\n});\n\n// MOMENTS\n\nfunction getSetQuarter (input) {\n return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);\n}\n\n// FORMATTING\n\naddFormatToken('D', ['DD', 2], 'Do', 'date');\n\n// ALIASES\n\naddUnitAlias('date', 'D');\n\n// PRIOROITY\naddUnitPriority('date', 9);\n\n// PARSING\n\naddRegexToken('D', match1to2);\naddRegexToken('DD', match1to2, match2);\naddRegexToken('Do', function (isStrict, locale) {\n return isStrict ? locale._ordinalParse : locale._ordinalParseLenient;\n});\n\naddParseToken(['D', 'DD'], DATE);\naddParseToken('Do', function (input, array) {\n array[DATE] = toInt(input.match(match1to2)[0], 10);\n});\n\n// MOMENTS\n\nvar getSetDayOfMonth = makeGetSet('Date', true);\n\n// FORMATTING\n\naddFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');\n\n// ALIASES\n\naddUnitAlias('dayOfYear', 'DDD');\n\n// PRIORITY\naddUnitPriority('dayOfYear', 4);\n\n// PARSING\n\naddRegexToken('DDD', match1to3);\naddRegexToken('DDDD', match3);\naddParseToken(['DDD', 'DDDD'], function (input, array, config) {\n config._dayOfYear = toInt(input);\n});\n\n// HELPERS\n\n// MOMENTS\n\nfunction getSetDayOfYear (input) {\n var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;\n return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');\n}\n\n// FORMATTING\n\naddFormatToken('m', ['mm', 2], 0, 'minute');\n\n// ALIASES\n\naddUnitAlias('minute', 'm');\n\n// PRIORITY\n\naddUnitPriority('minute', 14);\n\n// PARSING\n\naddRegexToken('m', match1to2);\naddRegexToken('mm', match1to2, match2);\naddParseToken(['m', 'mm'], MINUTE);\n\n// MOMENTS\n\nvar getSetMinute = makeGetSet('Minutes', false);\n\n// FORMATTING\n\naddFormatToken('s', ['ss', 2], 0, 'second');\n\n// ALIASES\n\naddUnitAlias('second', 's');\n\n// PRIORITY\n\naddUnitPriority('second', 15);\n\n// PARSING\n\naddRegexToken('s', match1to2);\naddRegexToken('ss', match1to2, match2);\naddParseToken(['s', 'ss'], SECOND);\n\n// MOMENTS\n\nvar getSetSecond = makeGetSet('Seconds', false);\n\n// FORMATTING\n\naddFormatToken('S', 0, 0, function () {\n return ~~(this.millisecond() / 100);\n});\n\naddFormatToken(0, ['SS', 2], 0, function () {\n return ~~(this.millisecond() / 10);\n});\n\naddFormatToken(0, ['SSS', 3], 0, 'millisecond');\naddFormatToken(0, ['SSSS', 4], 0, function () {\n return this.millisecond() * 10;\n});\naddFormatToken(0, ['SSSSS', 5], 0, function () {\n return this.millisecond() * 100;\n});\naddFormatToken(0, ['SSSSSS', 6], 0, function () {\n return this.millisecond() * 1000;\n});\naddFormatToken(0, ['SSSSSSS', 7], 0, function () {\n return this.millisecond() * 10000;\n});\naddFormatToken(0, ['SSSSSSSS', 8], 0, function () {\n return this.millisecond() * 100000;\n});\naddFormatToken(0, ['SSSSSSSSS', 9], 0, function () {\n return this.millisecond() * 1000000;\n});\n\n\n// ALIASES\n\naddUnitAlias('millisecond', 'ms');\n\n// PRIORITY\n\naddUnitPriority('millisecond', 16);\n\n// PARSING\n\naddRegexToken('S', match1to3, match1);\naddRegexToken('SS', match1to3, match2);\naddRegexToken('SSS', match1to3, match3);\n\nvar token;\nfor (token = 'SSSS'; token.length <= 9; token += 'S') {\n addRegexToken(token, matchUnsigned);\n}\n\nfunction parseMs(input, array) {\n array[MILLISECOND] = toInt(('0.' + input) * 1000);\n}\n\nfor (token = 'S'; token.length <= 9; token += 'S') {\n addParseToken(token, parseMs);\n}\n// MOMENTS\n\nvar getSetMillisecond = makeGetSet('Milliseconds', false);\n\n// FORMATTING\n\naddFormatToken('z', 0, 0, 'zoneAbbr');\naddFormatToken('zz', 0, 0, 'zoneName');\n\n// MOMENTS\n\nfunction getZoneAbbr () {\n return this._isUTC ? 'UTC' : '';\n}\n\nfunction getZoneName () {\n return this._isUTC ? 'Coordinated Universal Time' : '';\n}\n\nvar proto = Moment.prototype;\n\nproto.add = add;\nproto.calendar = calendar$1;\nproto.clone = clone;\nproto.diff = diff;\nproto.endOf = endOf;\nproto.format = format;\nproto.from = from;\nproto.fromNow = fromNow;\nproto.to = to;\nproto.toNow = toNow;\nproto.get = stringGet;\nproto.invalidAt = invalidAt;\nproto.isAfter = isAfter;\nproto.isBefore = isBefore;\nproto.isBetween = isBetween;\nproto.isSame = isSame;\nproto.isSameOrAfter = isSameOrAfter;\nproto.isSameOrBefore = isSameOrBefore;\nproto.isValid = isValid$1;\nproto.lang = lang;\nproto.locale = locale;\nproto.localeData = localeData;\nproto.max = prototypeMax;\nproto.min = prototypeMin;\nproto.parsingFlags = parsingFlags;\nproto.set = stringSet;\nproto.startOf = startOf;\nproto.subtract = subtract;\nproto.toArray = toArray;\nproto.toObject = toObject;\nproto.toDate = toDate;\nproto.toISOString = toISOString;\nproto.inspect = inspect;\nproto.toJSON = toJSON;\nproto.toString = toString;\nproto.unix = unix;\nproto.valueOf = valueOf;\nproto.creationData = creationData;\n\n// Year\nproto.year = getSetYear;\nproto.isLeapYear = getIsLeapYear;\n\n// Week Year\nproto.weekYear = getSetWeekYear;\nproto.isoWeekYear = getSetISOWeekYear;\n\n// Quarter\nproto.quarter = proto.quarters = getSetQuarter;\n\n// Month\nproto.month = getSetMonth;\nproto.daysInMonth = getDaysInMonth;\n\n// Week\nproto.week = proto.weeks = getSetWeek;\nproto.isoWeek = proto.isoWeeks = getSetISOWeek;\nproto.weeksInYear = getWeeksInYear;\nproto.isoWeeksInYear = getISOWeeksInYear;\n\n// Day\nproto.date = getSetDayOfMonth;\nproto.day = proto.days = getSetDayOfWeek;\nproto.weekday = getSetLocaleDayOfWeek;\nproto.isoWeekday = getSetISODayOfWeek;\nproto.dayOfYear = getSetDayOfYear;\n\n// Hour\nproto.hour = proto.hours = getSetHour;\n\n// Minute\nproto.minute = proto.minutes = getSetMinute;\n\n// Second\nproto.second = proto.seconds = getSetSecond;\n\n// Millisecond\nproto.millisecond = proto.milliseconds = getSetMillisecond;\n\n// Offset\nproto.utcOffset = getSetOffset;\nproto.utc = setOffsetToUTC;\nproto.local = setOffsetToLocal;\nproto.parseZone = setOffsetToParsedOffset;\nproto.hasAlignedHourOffset = hasAlignedHourOffset;\nproto.isDST = isDaylightSavingTime;\nproto.isLocal = isLocal;\nproto.isUtcOffset = isUtcOffset;\nproto.isUtc = isUtc;\nproto.isUTC = isUtc;\n\n// Timezone\nproto.zoneAbbr = getZoneAbbr;\nproto.zoneName = getZoneName;\n\n// Deprecations\nproto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);\nproto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);\nproto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);\nproto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone);\nproto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted);\n\nfunction createUnix (input) {\n return createLocal(input * 1000);\n}\n\nfunction createInZone () {\n return createLocal.apply(null, arguments).parseZone();\n}\n\nfunction preParsePostFormat (string) {\n return string;\n}\n\nvar proto$1 = Locale.prototype;\n\nproto$1.calendar = calendar;\nproto$1.longDateFormat = longDateFormat;\nproto$1.invalidDate = invalidDate;\nproto$1.ordinal = ordinal;\nproto$1.preparse = preParsePostFormat;\nproto$1.postformat = preParsePostFormat;\nproto$1.relativeTime = relativeTime;\nproto$1.pastFuture = pastFuture;\nproto$1.set = set;\n\n// Month\nproto$1.months = localeMonths;\nproto$1.monthsShort = localeMonthsShort;\nproto$1.monthsParse = localeMonthsParse;\nproto$1.monthsRegex = monthsRegex;\nproto$1.monthsShortRegex = monthsShortRegex;\n\n// Week\nproto$1.week = localeWeek;\nproto$1.firstDayOfYear = localeFirstDayOfYear;\nproto$1.firstDayOfWeek = localeFirstDayOfWeek;\n\n// Day of Week\nproto$1.weekdays = localeWeekdays;\nproto$1.weekdaysMin = localeWeekdaysMin;\nproto$1.weekdaysShort = localeWeekdaysShort;\nproto$1.weekdaysParse = localeWeekdaysParse;\n\nproto$1.weekdaysRegex = weekdaysRegex;\nproto$1.weekdaysShortRegex = weekdaysShortRegex;\nproto$1.weekdaysMinRegex = weekdaysMinRegex;\n\n// Hours\nproto$1.isPM = localeIsPM;\nproto$1.meridiem = localeMeridiem;\n\nfunction get$1 (format, index, field, setter) {\n var locale = getLocale();\n var utc = createUTC().set(setter, index);\n return locale[field](utc, format);\n}\n\nfunction listMonthsImpl (format, index, field) {\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n\n if (index != null) {\n return get$1(format, index, field, 'month');\n }\n\n var i;\n var out = [];\n for (i = 0; i < 12; i++) {\n out[i] = get$1(format, i, field, 'month');\n }\n return out;\n}\n\n// ()\n// (5)\n// (fmt, 5)\n// (fmt)\n// (true)\n// (true, 5)\n// (true, fmt, 5)\n// (true, fmt)\nfunction listWeekdaysImpl (localeSorted, format, index, field) {\n if (typeof localeSorted === 'boolean') {\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n } else {\n format = localeSorted;\n index = format;\n localeSorted = false;\n\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n }\n\n var locale = getLocale(),\n shift = localeSorted ? locale._week.dow : 0;\n\n if (index != null) {\n return get$1(format, (index + shift) % 7, field, 'day');\n }\n\n var i;\n var out = [];\n for (i = 0; i < 7; i++) {\n out[i] = get$1(format, (i + shift) % 7, field, 'day');\n }\n return out;\n}\n\nfunction listMonths (format, index) {\n return listMonthsImpl(format, index, 'months');\n}\n\nfunction listMonthsShort (format, index) {\n return listMonthsImpl(format, index, 'monthsShort');\n}\n\nfunction listWeekdays (localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdays');\n}\n\nfunction listWeekdaysShort (localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');\n}\n\nfunction listWeekdaysMin (localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');\n}\n\ngetSetGlobalLocale('en', {\n ordinalParse: /\\d{1,2}(th|st|nd|rd)/,\n ordinal : function (number) {\n var b = number % 10,\n output = (toInt(number % 100 / 10) === 1) ? 'th' :\n (b === 1) ? 'st' :\n (b === 2) ? 'nd' :\n (b === 3) ? 'rd' : 'th';\n return number + output;\n }\n});\n\n// Side effect imports\nhooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale);\nhooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale);\n\nvar mathAbs = Math.abs;\n\nfunction abs () {\n var data = this._data;\n\n this._milliseconds = mathAbs(this._milliseconds);\n this._days = mathAbs(this._days);\n this._months = mathAbs(this._months);\n\n data.milliseconds = mathAbs(data.milliseconds);\n data.seconds = mathAbs(data.seconds);\n data.minutes = mathAbs(data.minutes);\n data.hours = mathAbs(data.hours);\n data.months = mathAbs(data.months);\n data.years = mathAbs(data.years);\n\n return this;\n}\n\nfunction addSubtract$1 (duration, input, value, direction) {\n var other = createDuration(input, value);\n\n duration._milliseconds += direction * other._milliseconds;\n duration._days += direction * other._days;\n duration._months += direction * other._months;\n\n return duration._bubble();\n}\n\n// supports only 2.0-style add(1, 's') or add(duration)\nfunction add$1 (input, value) {\n return addSubtract$1(this, input, value, 1);\n}\n\n// supports only 2.0-style subtract(1, 's') or subtract(duration)\nfunction subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n}\n\nfunction absCeil (number) {\n if (number < 0) {\n return Math.floor(number);\n } else {\n return Math.ceil(number);\n }\n}\n\nfunction bubble () {\n var milliseconds = this._milliseconds;\n var days = this._days;\n var months = this._months;\n var data = this._data;\n var seconds, minutes, hours, years, monthsFromDays;\n\n // if we have a mix of positive and negative values, bubble down first\n // check: https://github.com/moment/moment/issues/2166\n if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||\n (milliseconds <= 0 && days <= 0 && months <= 0))) {\n milliseconds += absCeil(monthsToDays(months) + days) * 864e5;\n days = 0;\n months = 0;\n }\n\n // The following code bubbles up values, see the tests for\n // examples of what that means.\n data.milliseconds = milliseconds % 1000;\n\n seconds = absFloor(milliseconds / 1000);\n data.seconds = seconds % 60;\n\n minutes = absFloor(seconds / 60);\n data.minutes = minutes % 60;\n\n hours = absFloor(minutes / 60);\n data.hours = hours % 24;\n\n days += absFloor(hours / 24);\n\n // convert days to months\n monthsFromDays = absFloor(daysToMonths(days));\n months += monthsFromDays;\n days -= absCeil(monthsToDays(monthsFromDays));\n\n // 12 months -> 1 year\n years = absFloor(months / 12);\n months %= 12;\n\n data.days = days;\n data.months = months;\n data.years = years;\n\n return this;\n}\n\nfunction daysToMonths (days) {\n // 400 years have 146097 days (taking into account leap year rules)\n // 400 years have 12 months === 4800\n return days * 4800 / 146097;\n}\n\nfunction monthsToDays (months) {\n // the reverse of daysToMonths\n return months * 146097 / 4800;\n}\n\nfunction as (units) {\n var days;\n var months;\n var milliseconds = this._milliseconds;\n\n units = normalizeUnits(units);\n\n if (units === 'month' || units === 'year') {\n days = this._days + milliseconds / 864e5;\n months = this._months + daysToMonths(days);\n return units === 'month' ? months : months / 12;\n } else {\n // handle milliseconds separately because of floating point math errors (issue #1867)\n days = this._days + Math.round(monthsToDays(this._months));\n switch (units) {\n case 'week' : return days / 7 + milliseconds / 6048e5;\n case 'day' : return days + milliseconds / 864e5;\n case 'hour' : return days * 24 + milliseconds / 36e5;\n case 'minute' : return days * 1440 + milliseconds / 6e4;\n case 'second' : return days * 86400 + milliseconds / 1000;\n // Math.floor prevents floating point math errors here\n case 'millisecond': return Math.floor(days * 864e5) + milliseconds;\n default: throw new Error('Unknown unit ' + units);\n }\n }\n}\n\n// TODO: Use this.as('ms')?\nfunction valueOf$1 () {\n return (\n this._milliseconds +\n this._days * 864e5 +\n (this._months % 12) * 2592e6 +\n toInt(this._months / 12) * 31536e6\n );\n}\n\nfunction makeAs (alias) {\n return function () {\n return this.as(alias);\n };\n}\n\nvar asMilliseconds = makeAs('ms');\nvar asSeconds = makeAs('s');\nvar asMinutes = makeAs('m');\nvar asHours = makeAs('h');\nvar asDays = makeAs('d');\nvar asWeeks = makeAs('w');\nvar asMonths = makeAs('M');\nvar asYears = makeAs('y');\n\nfunction get$2 (units) {\n units = normalizeUnits(units);\n return this[units + 's']();\n}\n\nfunction makeGetter(name) {\n return function () {\n return this._data[name];\n };\n}\n\nvar milliseconds = makeGetter('milliseconds');\nvar seconds = makeGetter('seconds');\nvar minutes = makeGetter('minutes');\nvar hours = makeGetter('hours');\nvar days = makeGetter('days');\nvar months = makeGetter('months');\nvar years = makeGetter('years');\n\nfunction weeks () {\n return absFloor(this.days() / 7);\n}\n\nvar round = Math.round;\nvar thresholds = {\n s: 45, // seconds to minute\n m: 45, // minutes to hour\n h: 22, // hours to day\n d: 26, // days to month\n M: 11 // months to year\n};\n\n// helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize\nfunction substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {\n return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);\n}\n\nfunction relativeTime$1 (posNegDuration, withoutSuffix, locale) {\n var duration = createDuration(posNegDuration).abs();\n var seconds = round(duration.as('s'));\n var minutes = round(duration.as('m'));\n var hours = round(duration.as('h'));\n var days = round(duration.as('d'));\n var months = round(duration.as('M'));\n var years = round(duration.as('y'));\n\n var a = seconds < thresholds.s && ['s', seconds] ||\n minutes <= 1 && ['m'] ||\n minutes < thresholds.m && ['mm', minutes] ||\n hours <= 1 && ['h'] ||\n hours < thresholds.h && ['hh', hours] ||\n days <= 1 && ['d'] ||\n days < thresholds.d && ['dd', days] ||\n months <= 1 && ['M'] ||\n months < thresholds.M && ['MM', months] ||\n years <= 1 && ['y'] || ['yy', years];\n\n a[2] = withoutSuffix;\n a[3] = +posNegDuration > 0;\n a[4] = locale;\n return substituteTimeAgo.apply(null, a);\n}\n\n// This function allows you to set the rounding function for relative time strings\nfunction getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}\n\n// This function allows you to set a threshold for relative time strings\nfunction getSetRelativeTimeThreshold (threshold, limit) {\n if (thresholds[threshold] === undefined) {\n return false;\n }\n if (limit === undefined) {\n return thresholds[threshold];\n }\n thresholds[threshold] = limit;\n return true;\n}\n\nfunction humanize (withSuffix) {\n var locale = this.localeData();\n var output = relativeTime$1(this, !withSuffix, locale);\n\n if (withSuffix) {\n output = locale.pastFuture(+this, output);\n }\n\n return locale.postformat(output);\n}\n\nvar abs$1 = Math.abs;\n\nfunction toISOString$1() {\n // for ISO strings we do not use the normal bubbling rules:\n // * milliseconds bubble up until they become hours\n // * days do not bubble at all\n // * months bubble up until they become years\n // This is because there is no context-free conversion between hours and days\n // (think of clock changes)\n // and also not between days and months (28-31 days per month)\n var seconds = abs$1(this._milliseconds) / 1000;\n var days = abs$1(this._days);\n var months = abs$1(this._months);\n var minutes, hours, years;\n\n // 3600 seconds -> 60 minutes -> 1 hour\n minutes = absFloor(seconds / 60);\n hours = absFloor(minutes / 60);\n seconds %= 60;\n minutes %= 60;\n\n // 12 months -> 1 year\n years = absFloor(months / 12);\n months %= 12;\n\n\n // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js\n var Y = years;\n var M = months;\n var D = days;\n var h = hours;\n var m = minutes;\n var s = seconds;\n var total = this.asSeconds();\n\n if (!total) {\n // this is the same as C#'s (Noda) and python (isodate)...\n // but not other JS (goog.date)\n return 'P0D';\n }\n\n return (total < 0 ? '-' : '') +\n 'P' +\n (Y ? Y + 'Y' : '') +\n (M ? M + 'M' : '') +\n (D ? D + 'D' : '') +\n ((h || m || s) ? 'T' : '') +\n (h ? h + 'H' : '') +\n (m ? m + 'M' : '') +\n (s ? s + 'S' : '');\n}\n\nvar proto$2 = Duration.prototype;\n\nproto$2.abs = abs;\nproto$2.add = add$1;\nproto$2.subtract = subtract$1;\nproto$2.as = as;\nproto$2.asMilliseconds = asMilliseconds;\nproto$2.asSeconds = asSeconds;\nproto$2.asMinutes = asMinutes;\nproto$2.asHours = asHours;\nproto$2.asDays = asDays;\nproto$2.asWeeks = asWeeks;\nproto$2.asMonths = asMonths;\nproto$2.asYears = asYears;\nproto$2.valueOf = valueOf$1;\nproto$2._bubble = bubble;\nproto$2.get = get$2;\nproto$2.milliseconds = milliseconds;\nproto$2.seconds = seconds;\nproto$2.minutes = minutes;\nproto$2.hours = hours;\nproto$2.days = days;\nproto$2.weeks = weeks;\nproto$2.months = months;\nproto$2.years = years;\nproto$2.humanize = humanize;\nproto$2.toISOString = toISOString$1;\nproto$2.toString = toISOString$1;\nproto$2.toJSON = toISOString$1;\nproto$2.locale = locale;\nproto$2.localeData = localeData;\n\n// Deprecations\nproto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1);\nproto$2.lang = lang;\n\n// Side effect imports\n\n// FORMATTING\n\naddFormatToken('X', 0, 0, 'unix');\naddFormatToken('x', 0, 0, 'valueOf');\n\n// PARSING\n\naddRegexToken('x', matchSigned);\naddRegexToken('X', matchTimestamp);\naddParseToken('X', function (input, array, config) {\n config._d = new Date(parseFloat(input, 10) * 1000);\n});\naddParseToken('x', function (input, array, config) {\n config._d = new Date(toInt(input));\n});\n\n// Side effect imports\n\n\nhooks.version = '2.17.1';\n\nsetHookCallback(createLocal);\n\nhooks.fn = proto;\nhooks.min = min;\nhooks.max = max;\nhooks.now = now;\nhooks.utc = createUTC;\nhooks.unix = createUnix;\nhooks.months = listMonths;\nhooks.isDate = isDate;\nhooks.locale = getSetGlobalLocale;\nhooks.invalid = createInvalid;\nhooks.duration = createDuration;\nhooks.isMoment = isMoment;\nhooks.weekdays = listWeekdays;\nhooks.parseZone = createInZone;\nhooks.localeData = getLocale;\nhooks.isDuration = isDuration;\nhooks.monthsShort = listMonthsShort;\nhooks.weekdaysMin = listWeekdaysMin;\nhooks.defineLocale = defineLocale;\nhooks.updateLocale = updateLocale;\nhooks.locales = listLocales;\nhooks.weekdaysShort = listWeekdaysShort;\nhooks.normalizeUnits = normalizeUnits;\nhooks.relativeTimeRounding = getSetRelativeTimeRounding;\nhooks.relativeTimeThreshold = getSetRelativeTimeThreshold;\nhooks.calendarFormat = getCalendarFormat;\nhooks.prototype = proto;\n\nreturn hooks;\n\n})));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/moment/moment.js\n// module id = 85\n// module chunks = 0","module.exports = function(module) {\r\n\tif(!module.webpackPolyfill) {\r\n\t\tmodule.deprecate = function() {};\r\n\t\tmodule.paths = [];\r\n\t\t// module.parent = undefined by default\r\n\t\tmodule.children = [];\r\n\t\tmodule.webpackPolyfill = 1;\r\n\t}\r\n\treturn module;\r\n}\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// (webpack)/buildin/module.js\n// module id = 86\n// module chunks = 0","function webpackContext(req) {\n\tthrow new Error(\"Cannot find module '\" + req + \"'.\");\n}\nwebpackContext.keys = function() { return []; };\nwebpackContext.resolve = webpackContext;\nmodule.exports = webpackContext;\nwebpackContext.id = 87;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/moment/locale ^\\.\\/$^$\n// module id = 87\n// module chunks = 0","var _rng;\n\nvar globalVar = typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined' ? global : null;\n\nif (globalVar && globalVar.crypto && crypto.getRandomValues) {\n // WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto\n // Moderately fast, high quality\n var _rnds8 = new Uint8Array(16);\n _rng = function whatwgRNG() {\n crypto.getRandomValues(_rnds8);\n return _rnds8;\n };\n}\n\nif (!_rng) {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var _rnds = new Array(16);\n _rng = function () {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n _rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return _rnds;\n };\n}\n\n// uuid.js\n//\n// Copyright (c) 2010-2012 Robert Kieffer\n// MIT License - http://opensource.org/licenses/mit-license.php\n\n// Unique ID creation requires a high quality random # generator. We feature\n// detect to determine the best RNG source, normalizing to a function that\n// returns 128-bits of randomness, since that's what's usually required\n\n//var _rng = require('./rng');\n\n// Maps for number <-> hex string conversion\nvar _byteToHex = [];\nvar _hexToByte = {};\nfor (var i = 0; i < 256; i++) {\n _byteToHex[i] = (i + 0x100).toString(16).substr(1);\n _hexToByte[_byteToHex[i]] = i;\n}\n\n// **`parse()` - Parse a UUID into it's component bytes**\nfunction parse(s, buf, offset) {\n var i = (buf && offset) || 0, ii = 0;\n\n buf = buf || [];\n s.toLowerCase().replace(/[0-9a-f]{2}/g, function (oct) {\n if (ii < 16) { // Don't overflow!\n buf[i + ii++] = _hexToByte[oct];\n }\n });\n\n // Zero out remaining bytes if string was short\n while (ii < 16) {\n buf[i + ii++] = 0;\n }\n\n return buf;\n}\n\n// **`unparse()` - Convert UUID byte array (ala parse()) into a string**\nfunction unparse(buf, offset) {\n var i = offset || 0, bth = _byteToHex;\n return bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]];\n}\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\n// random #'s we need to init node and clockseq\nvar _seedBytes = _rng();\n\n// Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\nvar _nodeId = [\n _seedBytes[0] | 0x01,\n _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5]\n];\n\n// Per 4.2.2, randomize (14 bit) clockseq\nvar _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff;\n\n// Previous uuid creation time\nvar _lastMSecs = 0, _lastNSecs = 0;\n\n// See https://github.com/broofa/node-uuid for API details\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || [];\n\n options = options || {};\n\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;\n\n // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();\n\n // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;\n\n // Time since last uuid creation (in msecs)\n var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs) / 10000;\n\n // Per 4.2.1.2, Bump clockseq on clock regression\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n }\n\n // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n }\n\n // Per 4.2.1.2 Throw error if too many uuids are requested\n if (nsecs >= 10000) {\n throw new Error('uuid.v1(): Can\\'t create more than 10M uuids/sec');\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq;\n\n // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n msecs += 12219292800000;\n\n // `time_low`\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff;\n\n // `time_mid`\n var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff;\n\n // `time_high_and_version`\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n b[i++] = tmh >>> 16 & 0xff;\n\n // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n b[i++] = clockseq >>> 8 | 0x80;\n\n // `clock_seq_low`\n b[i++] = clockseq & 0xff;\n\n // `node`\n var node = options.node || _nodeId;\n for (var n = 0; n < 6; n++) {\n b[i + n] = node[n];\n }\n\n return buf ? buf : unparse(b);\n}\n\n// **`v4()` - Generate random UUID**\n\n// See https://github.com/broofa/node-uuid for API details\nfunction v4(options, buf, offset) {\n // Deprecated - 'format' argument, as supported in v1.2\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options == 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || _rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ii++) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || unparse(rnds);\n}\n\n// Export public API\nvar uuid = v4;\nuuid.v1 = v1;\nuuid.v4 = v4;\nuuid.parse = parse;\nuuid.unparse = unparse;\n\nmodule.exports = uuid;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/module/uuid.js","// utils\nexports.util = require('./lib/util');\nexports.DOMutil = require('./lib/DOMutil');\n\n// data\nexports.DataSet = require('./lib/DataSet');\nexports.DataView = require('./lib/DataView');\nexports.Queue = require('./lib/Queue');\n\n// Graph3d\nexports.Graph3d = require('./lib/graph3d/Graph3d');\nexports.graph3d = {\n Camera: require('./lib/graph3d/Camera'),\n Filter: require('./lib/graph3d/Filter'),\n Point2d: require('./lib/graph3d/Point2d'),\n Point3d: require('./lib/graph3d/Point3d'),\n Slider: require('./lib/graph3d/Slider'),\n StepNumber: require('./lib/graph3d/StepNumber')\n};\n\n// bundled external libraries\nexports.moment = require('./lib/module/moment');\nexports.Hammer = require('./lib/module/hammer');\nexports.keycharm = require('keycharm');\n\n\n\n// WEBPACK FOOTER //\n// ./index-graph3d.js","// DOM utility methods\n\n/**\n * this prepares the JSON container for allocating SVG elements\n * @param JSONcontainer\n * @private\n */\nexports.prepareElements = function(JSONcontainer) {\n // cleanup the redundant svgElements;\n for (var elementType in JSONcontainer) {\n if (JSONcontainer.hasOwnProperty(elementType)) {\n JSONcontainer[elementType].redundant = JSONcontainer[elementType].used;\n JSONcontainer[elementType].used = [];\n }\n }\n};\n\n/**\n * this cleans up all the unused SVG elements. By asking for the parentNode, we only need to supply the JSON container from\n * which to remove the redundant elements.\n *\n * @param JSONcontainer\n * @private\n */\nexports.cleanupElements = function(JSONcontainer) {\n // cleanup the redundant svgElements;\n for (var elementType in JSONcontainer) {\n if (JSONcontainer.hasOwnProperty(elementType)) {\n if (JSONcontainer[elementType].redundant) {\n for (var i = 0; i < JSONcontainer[elementType].redundant.length; i++) {\n JSONcontainer[elementType].redundant[i].parentNode.removeChild(JSONcontainer[elementType].redundant[i]);\n }\n JSONcontainer[elementType].redundant = [];\n }\n }\n }\n};\n\n/**\n * Ensures that all elements are removed first up so they can be recreated cleanly\n * @param JSONcontainer\n */\nexports.resetElements = function(JSONcontainer) {\n exports.prepareElements(JSONcontainer);\n exports.cleanupElements(JSONcontainer);\n exports.prepareElements(JSONcontainer);\n}\n\n/**\n * Allocate or generate an SVG element if needed. Store a reference to it in the JSON container and draw it in the svgContainer\n * the JSON container and the SVG container have to be supplied so other svg containers (like the legend) can use this.\n *\n * @param elementType\n * @param JSONcontainer\n * @param svgContainer\n * @returns {*}\n * @private\n */\nexports.getSVGElement = function (elementType, JSONcontainer, svgContainer) {\n var element;\n // allocate SVG element, if it doesnt yet exist, create one.\n if (JSONcontainer.hasOwnProperty(elementType)) { // this element has been created before\n // check if there is an redundant element\n if (JSONcontainer[elementType].redundant.length > 0) {\n element = JSONcontainer[elementType].redundant[0];\n JSONcontainer[elementType].redundant.shift();\n }\n else {\n // create a new element and add it to the SVG\n element = document.createElementNS('http://www.w3.org/2000/svg', elementType);\n svgContainer.appendChild(element);\n }\n }\n else {\n // create a new element and add it to the SVG, also create a new object in the svgElements to keep track of it.\n element = document.createElementNS('http://www.w3.org/2000/svg', elementType);\n JSONcontainer[elementType] = {used: [], redundant: []};\n svgContainer.appendChild(element);\n }\n JSONcontainer[elementType].used.push(element);\n return element;\n};\n\n\n/**\n * Allocate or generate an SVG element if needed. Store a reference to it in the JSON container and draw it in the svgContainer\n * the JSON container and the SVG container have to be supplied so other svg containers (like the legend) can use this.\n *\n * @param elementType\n * @param JSONcontainer\n * @param DOMContainer\n * @returns {*}\n * @private\n */\nexports.getDOMElement = function (elementType, JSONcontainer, DOMContainer, insertBefore) {\n var element;\n // allocate DOM element, if it doesnt yet exist, create one.\n if (JSONcontainer.hasOwnProperty(elementType)) { // this element has been created before\n // check if there is an redundant element\n if (JSONcontainer[elementType].redundant.length > 0) {\n element = JSONcontainer[elementType].redundant[0];\n JSONcontainer[elementType].redundant.shift();\n }\n else {\n // create a new element and add it to the SVG\n element = document.createElement(elementType);\n if (insertBefore !== undefined) {\n DOMContainer.insertBefore(element, insertBefore);\n }\n else {\n DOMContainer.appendChild(element);\n }\n }\n }\n else {\n // create a new element and add it to the SVG, also create a new object in the svgElements to keep track of it.\n element = document.createElement(elementType);\n JSONcontainer[elementType] = {used: [], redundant: []};\n if (insertBefore !== undefined) {\n DOMContainer.insertBefore(element, insertBefore);\n }\n else {\n DOMContainer.appendChild(element);\n }\n }\n JSONcontainer[elementType].used.push(element);\n return element;\n};\n\n\n\n\n/**\n * Draw a point object. This is a separate function because it can also be called by the legend.\n * The reason the JSONcontainer and the target SVG svgContainer have to be supplied is so the legend can use these functions\n * as well.\n *\n * @param x\n * @param y\n * @param groupTemplate: A template containing the necessary information to draw the datapoint e.g., {style: 'circle', size: 5, className: 'className' }\n * @param JSONcontainer\n * @param svgContainer\n * @param labelObj\n * @returns {*}\n */\nexports.drawPoint = function(x, y, groupTemplate, JSONcontainer, svgContainer, labelObj) {\n var point;\n if (groupTemplate.style == 'circle') {\n point = exports.getSVGElement('circle', JSONcontainer, svgContainer);\n point.setAttributeNS(null, \"cx\", x);\n point.setAttributeNS(null, \"cy\", y);\n point.setAttributeNS(null, \"r\", 0.5 * groupTemplate.size);\n }\n else {\n point = exports.getSVGElement('rect', JSONcontainer, svgContainer);\n point.setAttributeNS(null, \"x\", x - 0.5 * groupTemplate.size);\n point.setAttributeNS(null, \"y\", y - 0.5 * groupTemplate.size);\n point.setAttributeNS(null, \"width\", groupTemplate.size);\n point.setAttributeNS(null, \"height\", groupTemplate.size);\n }\n\n if (groupTemplate.styles !== undefined) {\n point.setAttributeNS(null, \"style\", groupTemplate.styles);\n }\n point.setAttributeNS(null, \"class\", groupTemplate.className + \" vis-point\");\n //handle label\n\n\n if (labelObj) {\n var label = exports.getSVGElement('text', JSONcontainer, svgContainer);\n if (labelObj.xOffset) {\n x = x + labelObj.xOffset;\n }\n\n if (labelObj.yOffset) {\n y = y + labelObj.yOffset;\n }\n if (labelObj.content) {\n label.textContent = labelObj.content;\n }\n\n if (labelObj.className) {\n label.setAttributeNS(null, \"class\", labelObj.className + \" vis-label\");\n }\n label.setAttributeNS(null, \"x\", x);\n label.setAttributeNS(null, \"y\", y);\n }\n\n return point;\n};\n\n/**\n * draw a bar SVG element centered on the X coordinate\n *\n * @param x\n * @param y\n * @param className\n */\nexports.drawBar = function (x, y, width, height, className, JSONcontainer, svgContainer, style) {\n if (height != 0) {\n if (height < 0) {\n height *= -1;\n y -= height;\n }\n var rect = exports.getSVGElement('rect',JSONcontainer, svgContainer);\n rect.setAttributeNS(null, \"x\", x - 0.5 * width);\n rect.setAttributeNS(null, \"y\", y);\n rect.setAttributeNS(null, \"width\", width);\n rect.setAttributeNS(null, \"height\", height);\n rect.setAttributeNS(null, \"class\", className);\n if (style) {\n rect.setAttributeNS(null, \"style\", style);\n }\n }\n};\n\n\n// WEBPACK FOOTER //\n// ./lib/DOMutil.js","var util = require('./util');\nvar Queue = require('./Queue');\n\n/**\n * DataSet\n *\n * Usage:\n * var dataSet = new DataSet({\n * fieldId: '_id',\n * type: {\n * // ...\n * }\n * });\n *\n * dataSet.add(item);\n * dataSet.add(data);\n * dataSet.update(item);\n * dataSet.update(data);\n * dataSet.remove(id);\n * dataSet.remove(ids);\n * var data = dataSet.get();\n * var data = dataSet.get(id);\n * var data = dataSet.get(ids);\n * var data = dataSet.get(ids, options, data);\n * dataSet.clear();\n *\n * A data set can:\n * - add/remove/update data\n * - gives triggers upon changes in the data\n * - can import/export data in various data formats\n *\n * @param {Array} [data] Optional array with initial data\n * @param {Object} [options] Available options:\n * {String} fieldId Field name of the id in the\n * items, 'id' by default.\n * {Object. listener.callback != callback);\n }\n};\n\n// TODO: remove this deprecated function some day (replaced with `on` since version 0.5, deprecated since v4.0)\nDataSet.prototype.unsubscribe = function () {\n throw new Error('DataSet.unsubscribe is deprecated. Use DataSet.off instead.');\n};\n\n/**\n * Trigger an event\n * @param {String} event\n * @param {Object | null} params\n * @param {String} [senderId] Optional id of the sender.\n * @private\n */\nDataSet.prototype._trigger = function (event, params, senderId) {\n if (event == '*') {\n throw new Error('Cannot trigger event *');\n }\n\n var subscribers = [];\n if (event in this._subscribers) {\n subscribers = subscribers.concat(this._subscribers[event]);\n }\n if ('*' in this._subscribers) {\n subscribers = subscribers.concat(this._subscribers['*']);\n }\n\n for (var i = 0, len = subscribers.length; i < len; i++) {\n var subscriber = subscribers[i];\n if (subscriber.callback) {\n subscriber.callback(event, params, senderId || null);\n }\n }\n};\n\n/**\n * Add data.\n * Adding an item will fail when there already is an item with the same id.\n * @param {Object | Array} data\n * @param {String} [senderId] Optional sender id\n * @return {Array} addedIds Array with the ids of the added items\n */\nDataSet.prototype.add = function (data, senderId) {\n var addedIds = [],\n id,\n me = this;\n\n if (Array.isArray(data)) {\n // Array\n for (var i = 0, len = data.length; i < len; i++) {\n id = me._addItem(data[i]);\n addedIds.push(id);\n }\n }\n else if (data instanceof Object) {\n // Single item\n id = me._addItem(data);\n addedIds.push(id);\n }\n else {\n throw new Error('Unknown dataType');\n }\n\n if (addedIds.length) {\n this._trigger('add', {items: addedIds}, senderId);\n }\n\n return addedIds;\n};\n\n/**\n * Update existing items. When an item does not exist, it will be created\n * @param {Object | Array} data\n * @param {String} [senderId] Optional sender id\n * @return {Array} updatedIds The ids of the added or updated items\n */\nDataSet.prototype.update = function (data, senderId) {\n var addedIds = [];\n var updatedIds = [];\n var oldData = [];\n var updatedData = [];\n var me = this;\n var fieldId = me._fieldId;\n\n var addOrUpdate = function (item) {\n var id = item[fieldId];\n if (me._data[id]) {\n var oldItem = util.extend({}, me._data[id]);\n // update item\n id = me._updateItem(item);\n updatedIds.push(id);\n updatedData.push(item);\n oldData.push(oldItem);\n }\n else {\n // add new item\n id = me._addItem(item);\n addedIds.push(id);\n }\n };\n\n if (Array.isArray(data)) {\n // Array\n for (var i = 0, len = data.length; i < len; i++) {\n if (data[i] instanceof Object){\n addOrUpdate(data[i]);\n } else {\n console.warn('Ignoring input item, which is not an object at index ' + i);\n }\n }\n }\n else if (data instanceof Object) {\n // Single item\n addOrUpdate(data);\n }\n else {\n throw new Error('Unknown dataType');\n }\n\n if (addedIds.length) {\n this._trigger('add', {items: addedIds}, senderId);\n }\n if (updatedIds.length) {\n var props = { items: updatedIds, oldData: oldData, data: updatedData };\n // TODO: remove deprecated property 'data' some day\n //Object.defineProperty(props, 'data', {\n // 'get': (function() {\n // console.warn('Property data is deprecated. Use DataSet.get(ids) to retrieve the new data, use the oldData property on this object to get the old data');\n // return updatedData;\n // }).bind(this)\n //});\n this._trigger('update', props, senderId);\n }\n\n return addedIds.concat(updatedIds);\n};\n\n/**\n * Get a data item or multiple items.\n *\n * Usage:\n *\n * get()\n * get(options: Object)\n *\n * get(id: Number | String)\n * get(id: Number | String, options: Object)\n *\n * get(ids: Number[] | String[])\n * get(ids: Number[] | String[], options: Object)\n *\n * Where:\n *\n * {Number | String} id The id of an item\n * {Number[] | String{}} ids An array with ids of items\n * {Object} options An Object with options. Available options:\n * {String} [returnType] Type of data to be returned.\n * Can be 'Array' (default) or 'Object'.\n * {Object.} [type]\n * {String[]} [fields] field names to be returned\n * {function} [filter] filter items\n * {String | function} [order] Order the items by a field name or custom sort function.\n * @throws Error\n */\nDataSet.prototype.get = function (args) {\n var me = this;\n\n // parse the arguments\n var id, ids, options;\n var firstType = util.getType(arguments[0]);\n if (firstType == 'String' || firstType == 'Number') {\n // get(id [, options])\n id = arguments[0];\n options = arguments[1];\n }\n else if (firstType == 'Array') {\n // get(ids [, options])\n ids = arguments[0];\n options = arguments[1];\n }\n else {\n // get([, options])\n options = arguments[0];\n }\n\n // determine the return type\n var returnType;\n if (options && options.returnType) {\n var allowedValues = ['Array', 'Object'];\n returnType = allowedValues.indexOf(options.returnType) == -1 ? 'Array' : options.returnType;\n }\n else {\n returnType = 'Array';\n }\n\n // build options\n var type = options && options.type || this._options.type;\n var filter = options && options.filter;\n var items = [], item, itemIds, itemId, i, len;\n\n // convert items\n if (id != undefined) {\n // return a single item\n item = me._getItem(id, type);\n if (item && filter && !filter(item)) {\n item = null;\n }\n }\n else if (ids != undefined) {\n // return a subset of items\n for (i = 0, len = ids.length; i < len; i++) {\n item = me._getItem(ids[i], type);\n if (!filter || filter(item)) {\n items.push(item);\n }\n }\n }\n else {\n // return all items\n itemIds = Object.keys(this._data);\n for (i = 0, len = itemIds.length; i < len; i++) {\n itemId = itemIds[i];\n item = me._getItem(itemId, type);\n if (!filter || filter(item)) {\n items.push(item);\n }\n }\n }\n\n // order the results\n if (options && options.order && id == undefined) {\n this._sort(items, options.order);\n }\n\n // filter fields of the items\n if (options && options.fields) {\n var fields = options.fields;\n if (id != undefined) {\n item = this._filterFields(item, fields);\n }\n else {\n for (i = 0, len = items.length; i < len; i++) {\n items[i] = this._filterFields(items[i], fields);\n }\n }\n }\n\n // return the results\n if (returnType == 'Object') {\n var result = {},\n resultant;\n for (i = 0, len = items.length; i < len; i++) {\n resultant = items[i];\n result[resultant.id] = resultant;\n }\n return result;\n }\n else {\n if (id != undefined) {\n // a single item\n return item;\n }\n else {\n // just return our array\n return items;\n }\n }\n};\n\n/**\n * Get ids of all items or from a filtered set of items.\n * @param {Object} [options] An Object with options. Available options:\n * {function} [filter] filter items\n * {String | function} [order] Order the items by\n * a field name or custom sort function.\n * @return {Array} ids\n */\nDataSet.prototype.getIds = function (options) {\n var data = this._data,\n filter = options && options.filter,\n order = options && options.order,\n type = options && options.type || this._options.type,\n itemIds = Object.keys(data),\n i,\n len,\n id,\n item,\n items,\n ids = [];\n\n if (filter) {\n // get filtered items\n if (order) {\n // create ordered list\n items = [];\n for (i = 0, len = itemIds.length; i < len; i++) {\n id = itemIds[i];\n item = this._getItem(id, type);\n if (filter(item)) {\n items.push(item);\n }\n }\n\n this._sort(items, order);\n\n for (i = 0, len = items.length; i < len; i++) {\n ids.push(items[i][this._fieldId]);\n }\n }\n else {\n // create unordered list\n for (i = 0, len = itemIds.length; i < len; i++) {\n id = itemIds[i];\n item = this._getItem(id, type);\n if (filter(item)) {\n ids.push(item[this._fieldId]);\n }\n }\n }\n }\n else {\n // get all items\n if (order) {\n // create an ordered list\n items = [];\n for (i = 0, len = itemIds.length; i < len; i++) {\n id = itemIds[i];\n items.push(data[id]);\n }\n\n this._sort(items, order);\n\n for (i = 0, len = items.length; i < len; i++) {\n ids.push(items[i][this._fieldId]);\n }\n }\n else {\n // create unordered list\n for (i = 0, len = itemIds.length; i < len; i++) {\n id = itemIds[i];\n item = data[id];\n ids.push(item[this._fieldId]);\n }\n }\n }\n\n return ids;\n};\n\n/**\n * Returns the DataSet itself. Is overwritten for example by the DataView,\n * which returns the DataSet it is connected to instead.\n */\nDataSet.prototype.getDataSet = function () {\n return this;\n};\n\n/**\n * Execute a callback function for every item in the dataset.\n * @param {function} callback\n * @param {Object} [options] Available options:\n * {Object.} [type]\n * {String[]} [fields] filter fields\n * {function} [filter] filter items\n * {String | function} [order] Order the items by\n * a field name or custom sort function.\n */\nDataSet.prototype.forEach = function (callback, options) {\n var filter = options && options.filter,\n type = options && options.type || this._options.type,\n data = this._data,\n itemIds = Object.keys(data),\n i,\n len,\n item,\n id;\n\n if (options && options.order) {\n // execute forEach on ordered list\n var items = this.get(options);\n\n for (i = 0, len = items.length; i < len; i++) {\n item = items[i];\n id = item[this._fieldId];\n callback(item, id);\n }\n }\n else {\n // unordered\n for (i = 0, len = itemIds.length; i < len; i++) {\n id = itemIds[i];\n item = this._getItem(id, type);\n if (!filter || filter(item)) {\n callback(item, id);\n }\n }\n }\n};\n\n/**\n * Map every item in the dataset.\n * @param {function} callback\n * @param {Object} [options] Available options:\n * {Object.} [type]\n * {String[]} [fields] filter fields\n * {function} [filter] filter items\n * {String | function} [order] Order the items by\n * a field name or custom sort function.\n * @return {Object[]} mappedItems\n */\nDataSet.prototype.map = function (callback, options) {\n var filter = options && options.filter,\n type = options && options.type || this._options.type,\n mappedItems = [],\n data = this._data,\n itemIds = Object.keys(data),\n i,\n len,\n id,\n item;\n\n // convert and filter items\n for (i = 0, len = itemIds.length; i < len; i++) {\n id = itemIds[i];\n item = this._getItem(id, type);\n if (!filter || filter(item)) {\n mappedItems.push(callback(item, id));\n }\n }\n\n // order items\n if (options && options.order) {\n this._sort(mappedItems, options.order);\n }\n\n return mappedItems;\n};\n\n/**\n * Filter the fields of an item\n * @param {Object | null} item\n * @param {String[]} fields Field names\n * @return {Object | null} filteredItem or null if no item is provided\n * @private\n */\nDataSet.prototype._filterFields = function (item, fields) {\n if (!item) { // item is null\n return item;\n }\n\n var filteredItem = {},\n itemFields = Object.keys(item),\n len = itemFields.length,\n i,\n field;\n\n if(Array.isArray(fields)){\n for (i = 0; i < len; i++) {\n field = itemFields[i];\n if (fields.indexOf(field) != -1) {\n filteredItem[field] = item[field];\n }\n }\n }else{\n for (i = 0; i < len; i++) {\n field = itemFields[i];\n if (fields.hasOwnProperty(field)) {\n filteredItem[fields[field]] = item[field];\n }\n }\n }\n\n return filteredItem;\n};\n\n/**\n * Sort the provided array with items\n * @param {Object[]} items\n * @param {String | function} order A field name or custom sort function.\n * @private\n */\nDataSet.prototype._sort = function (items, order) {\n if (util.isString(order)) {\n // order by provided field name\n var name = order; // field name\n items.sort(function (a, b) {\n var av = a[name];\n var bv = b[name];\n return (av > bv) ? 1 : ((av < bv) ? -1 : 0);\n });\n }\n else if (typeof order === 'function') {\n // order by sort function\n items.sort(order);\n }\n // TODO: extend order by an Object {field:String, direction:String}\n // where direction can be 'asc' or 'desc'\n else {\n throw new TypeError('Order must be a function or a string');\n }\n};\n\n/**\n * Remove an object by pointer or by id\n * @param {String | Number | Object | Array} id Object or id, or an array with\n * objects or ids to be removed\n * @param {String} [senderId] Optional sender id\n * @return {Array} removedIds\n */\nDataSet.prototype.remove = function (id, senderId) {\n var removedIds = [],\n removedItems = [],\n ids = [],\n i, len, itemId, item;\n\n // force everything to be an array for simplicity\n ids = Array.isArray(id) ? id : [id];\n\n for (i = 0, len = ids.length; i < len; i++) {\n item = this._remove(ids[i]);\n if (item) {\n itemId = item[this._fieldId];\n if (itemId != undefined) {\n removedIds.push(itemId);\n removedItems.push(item);\n }\n }\n }\n\n if (removedIds.length) {\n this._trigger('remove', {items: removedIds, oldData: removedItems}, senderId);\n }\n\n return removedIds;\n};\n\n/**\n * Remove an item by its id\n * @param {Number | String | Object} id id or item\n * @returns {Number | String | null} id\n * @private\n */\nDataSet.prototype._remove = function (id) {\n var item,\n ident;\n\n // confirm the id to use based on the args type\n if (util.isNumber(id) || util.isString(id)) {\n ident = id;\n }\n else if (id instanceof Object) {\n ident = id[this._fieldId]; // look for the identifier field using _fieldId\n }\n\n // do the remove if the item is found\n if (ident !== undefined && this._data[ident]) {\n item = this._data[ident];\n delete this._data[ident];\n this.length--;\n return item;\n }\n return null;\n};\n\n/**\n * Clear the data\n * @param {String} [senderId] Optional sender id\n * @return {Array} removedIds The ids of all removed items\n */\nDataSet.prototype.clear = function (senderId) {\n var i, len;\n var ids = Object.keys(this._data);\n var items = [];\n\n for (i = 0, len = ids.length; i < len; i++) {\n items.push(this._data[ids[i]]);\n }\n\n this._data = {};\n this.length = 0;\n\n this._trigger('remove', {items: ids, oldData: items}, senderId);\n\n return ids;\n};\n\n/**\n * Find the item with maximum value of a specified field\n * @param {String} field\n * @return {Object | null} item Item containing max value, or null if no items\n */\nDataSet.prototype.max = function (field) {\n var data = this._data,\n itemIds = Object.keys(data),\n max = null,\n maxField = null,\n i,\n len;\n\n for (i = 0, len = itemIds.length; i < len; i++) {\n var id = itemIds[i];\n var item = data[id];\n var itemField = item[field];\n if (itemField != null && (!max || itemField > maxField)) {\n max = item;\n maxField = itemField;\n }\n }\n\n return max;\n};\n\n/**\n * Find the item with minimum value of a specified field\n * @param {String} field\n * @return {Object | null} item Item containing max value, or null if no items\n */\nDataSet.prototype.min = function (field) {\n var data = this._data,\n itemIds = Object.keys(data),\n min = null,\n minField = null,\n i,\n len;\n\n for (i = 0, len = itemIds.length; i < len; i++) {\n var id = itemIds[i];\n var item = data[id];\n var itemField = item[field];\n if (itemField != null && (!min || itemField < minField)) {\n min = item;\n minField = itemField;\n }\n }\n\n return min;\n};\n\n/**\n * Find all distinct values of a specified field\n * @param {String} field\n * @return {Array} values Array containing all distinct values. If data items\n * do not contain the specified field are ignored.\n * The returned array is unordered.\n */\nDataSet.prototype.distinct = function (field) {\n var data = this._data;\n var itemIds = Object.keys(data);\n var values = [];\n var fieldType = this._options.type && this._options.type[field] || null;\n var count = 0;\n var i,\n j,\n len;\n\n for (i = 0, len = itemIds.length; i < len; i++) {\n var id = itemIds[i];\n var item = data[id];\n var value = item[field];\n var exists = false;\n for (j = 0; j < count; j++) {\n if (values[j] == value) {\n exists = true;\n break;\n }\n }\n if (!exists && (value !== undefined)) {\n values[count] = value;\n count++;\n }\n }\n\n if (fieldType) {\n for (i = 0, len = values.length; i < len; i++) {\n values[i] = util.convert(values[i], fieldType);\n }\n }\n\n return values;\n};\n\n/**\n * Add a single item. Will fail when an item with the same id already exists.\n * @param {Object} item\n * @return {String} id\n * @private\n */\nDataSet.prototype._addItem = function (item) {\n var id = item[this._fieldId];\n\n if (id != undefined) {\n // check whether this id is already taken\n if (this._data[id]) {\n // item already exists\n throw new Error('Cannot add item: item with id ' + id + ' already exists');\n }\n }\n else {\n // generate an id\n id = util.randomUUID();\n item[this._fieldId] = id;\n }\n\n var d = {},\n fields = Object.keys(item),\n i,\n len;\n for (i = 0, len = fields.length; i < len; i++) {\n var field = fields[i];\n var fieldType = this._type[field]; // type may be undefined\n d[field] = util.convert(item[field], fieldType);\n }\n this._data[id] = d;\n this.length++;\n\n return id;\n};\n\n/**\n * Get an item. Fields can be converted to a specific type\n * @param {String} id\n * @param {Object.} [types] field types to convert\n * @return {Object | null} item\n * @private\n */\nDataSet.prototype._getItem = function (id, types) {\n var field, value, i, len;\n\n // get the item from the dataset\n var raw = this._data[id];\n if (!raw) {\n return null;\n }\n\n // convert the items field types\n var converted = {},\n fields = Object.keys(raw);\n\n if (types) {\n for (i = 0, len = fields.length; i < len; i++) {\n field = fields[i];\n value = raw[field];\n converted[field] = util.convert(value, types[field]);\n }\n }\n else {\n // no field types specified, no converting needed\n for (i = 0, len = fields.length; i < len; i++) {\n field = fields[i];\n value = raw[field];\n converted[field] = value;\n }\n }\n\n if (!converted[this._fieldId]) {\n converted[this._fieldId] = raw.id;\n }\n\n return converted;\n};\n\n/**\n * Update a single item: merge with existing item.\n * Will fail when the item has no id, or when there does not exist an item\n * with the same id.\n * @param {Object} item\n * @return {String} id\n * @private\n */\nDataSet.prototype._updateItem = function (item) {\n var id = item[this._fieldId];\n if (id == undefined) {\n throw new Error('Cannot update item: item has no id (item: ' + JSON.stringify(item) + ')');\n }\n var d = this._data[id];\n if (!d) {\n // item doesn't exist\n throw new Error('Cannot update item: no item with id ' + id + ' found');\n }\n\n // merge with current item\n var fields = Object.keys(item);\n for (var i = 0, len = fields.length; i < len; i++) {\n var field = fields[i];\n var fieldType = this._type[field]; // type may be undefined\n d[field] = util.convert(item[field], fieldType);\n }\n\n return id;\n};\n\nmodule.exports = DataSet;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/DataSet.js","/**\n * A queue\n * @param {Object} options\n * Available options:\n * - delay: number When provided, the queue will be flushed\n * automatically after an inactivity of this delay\n * in milliseconds.\n * Default value is null.\n * - max: number When the queue exceeds the given maximum number\n * of entries, the queue is flushed automatically.\n * Default value of max is Infinity.\n * @constructor\n */\nfunction Queue(options) {\n // options\n this.delay = null;\n this.max = Infinity;\n\n // properties\n this._queue = [];\n this._timeout = null;\n this._extended = null;\n\n this.setOptions(options);\n}\n\n/**\n * Update the configuration of the queue\n * @param {Object} options\n * Available options:\n * - delay: number When provided, the queue will be flushed\n * automatically after an inactivity of this delay\n * in milliseconds.\n * Default value is null.\n * - max: number When the queue exceeds the given maximum number\n * of entries, the queue is flushed automatically.\n * Default value of max is Infinity.\n * @param options\n */\nQueue.prototype.setOptions = function (options) {\n if (options && typeof options.delay !== 'undefined') {\n this.delay = options.delay;\n }\n if (options && typeof options.max !== 'undefined') {\n this.max = options.max;\n }\n\n this._flushIfNeeded();\n};\n\n/**\n * Extend an object with queuing functionality.\n * The object will be extended with a function flush, and the methods provided\n * in options.replace will be replaced with queued ones.\n * @param {Object} object\n * @param {Object} options\n * Available options:\n * - replace: Array.\n * A list with method names of the methods\n * on the object to be replaced with queued ones.\n * - delay: number When provided, the queue will be flushed\n * automatically after an inactivity of this delay\n * in milliseconds.\n * Default value is null.\n * - max: number When the queue exceeds the given maximum number\n * of entries, the queue is flushed automatically.\n * Default value of max is Infinity.\n * @return {Queue} Returns the created queue\n */\nQueue.extend = function (object, options) {\n var queue = new Queue(options);\n\n if (object.flush !== undefined) {\n throw new Error('Target object already has a property flush');\n }\n object.flush = function () {\n queue.flush();\n };\n\n var methods = [{\n name: 'flush',\n original: undefined\n }];\n\n if (options && options.replace) {\n for (var i = 0; i < options.replace.length; i++) {\n var name = options.replace[i];\n methods.push({\n name: name,\n original: object[name]\n });\n queue.replace(object, name);\n }\n }\n\n queue._extended = {\n object: object,\n methods: methods\n };\n\n return queue;\n};\n\n/**\n * Destroy the queue. The queue will first flush all queued actions, and in\n * case it has extended an object, will restore the original object.\n */\nQueue.prototype.destroy = function () {\n this.flush();\n\n if (this._extended) {\n var object = this._extended.object;\n var methods = this._extended.methods;\n for (var i = 0; i < methods.length; i++) {\n var method = methods[i];\n if (method.original) {\n object[method.name] = method.original;\n }\n else {\n delete object[method.name];\n }\n }\n this._extended = null;\n }\n};\n\n/**\n * Replace a method on an object with a queued version\n * @param {Object} object Object having the method\n * @param {string} method The method name\n */\nQueue.prototype.replace = function(object, method) {\n var me = this;\n var original = object[method];\n if (!original) {\n throw new Error('Method ' + method + ' undefined');\n }\n\n object[method] = function () {\n // create an Array with the arguments\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args[i] = arguments[i];\n }\n\n // add this call to the queue\n me.queue({\n args: args,\n fn: original,\n context: this\n });\n };\n};\n\n/**\n * Queue a call\n * @param {function | {fn: function, args: Array} | {fn: function, args: Array, context: Object}} entry\n */\nQueue.prototype.queue = function(entry) {\n if (typeof entry === 'function') {\n this._queue.push({fn: entry});\n }\n else {\n this._queue.push(entry);\n }\n\n this._flushIfNeeded();\n};\n\n/**\n * Check whether the queue needs to be flushed\n * @private\n */\nQueue.prototype._flushIfNeeded = function () {\n // flush when the maximum is exceeded.\n if (this._queue.length > this.max) {\n this.flush();\n }\n\n // flush after a period of inactivity when a delay is configured\n clearTimeout(this._timeout);\n if (this.queue.length > 0 && typeof this.delay === 'number') {\n var me = this;\n this._timeout = setTimeout(function () {\n me.flush();\n }, this.delay);\n }\n};\n\n/**\n * Flush all queued calls\n */\nQueue.prototype.flush = function () {\n while (this._queue.length > 0) {\n var entry = this._queue.shift();\n entry.fn.apply(entry.context || entry.fn, entry.args || []);\n }\n};\n\nmodule.exports = Queue;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/Queue.js","var util = require('./util');\nvar DataSet = require('./DataSet');\n\n/**\n * DataView\n *\n * a dataview offers a filtered view on a dataset or an other dataview.\n *\n * @param {DataSet | DataView} data\n * @param {Object} [options] Available options: see method get\n *\n * @constructor DataView\n */\nfunction DataView (data, options) {\n this._data = null;\n this._ids = {}; // ids of the items currently in memory (just contains a boolean true)\n this.length = 0; // number of items in the DataView\n this._options = options || {};\n this._fieldId = 'id'; // name of the field containing id\n this._subscribers = {}; // event subscribers\n\n var me = this;\n this.listener = function () {\n me._onEvent.apply(me, arguments);\n };\n\n this.setData(data);\n}\n\n// TODO: implement a function .config() to dynamically update things like configured filter\n// and trigger changes accordingly\n\n/**\n * Set a data source for the view\n * @param {DataSet | DataView} data\n */\nDataView.prototype.setData = function (data) {\n var ids, id, i, len, items;\n\n if (this._data) {\n // unsubscribe from current dataset\n if (this._data.off) {\n this._data.off('*', this.listener);\n }\n\n // trigger a remove of all items in memory\n ids = this._data.getIds({filter: this._options && this._options.filter});\n items = [];\n\n for (i = 0, len = ids.length; i < len; i++) {\n items.push(this._data._data[ids[i]]);\n }\n\n this._ids = {};\n this.length = 0;\n this._trigger('remove', {items: ids, oldData: items});\n }\n\n this._data = data;\n\n if (this._data) {\n // update fieldId\n this._fieldId = this._options.fieldId ||\n (this._data && this._data.options && this._data.options.fieldId) ||\n 'id';\n\n // trigger an add of all added items\n ids = this._data.getIds({filter: this._options && this._options.filter});\n for (i = 0, len = ids.length; i < len; i++) {\n id = ids[i];\n this._ids[id] = true;\n }\n this.length = ids.length;\n this._trigger('add', {items: ids});\n\n // subscribe to new dataset\n if (this._data.on) {\n this._data.on('*', this.listener);\n }\n }\n};\n\n/**\n * Refresh the DataView. Useful when the DataView has a filter function\n * containing a variable parameter.\n */\nDataView.prototype.refresh = function () {\n var id, i, len;\n var ids = this._data.getIds({filter: this._options && this._options.filter}),\n oldIds = Object.keys(this._ids),\n newIds = {},\n addedIds = [],\n removedIds = [],\n removedItems = [];\n\n // check for additions\n for (i = 0, len = ids.length; i < len; i++) {\n id = ids[i];\n newIds[id] = true;\n if (!this._ids[id]) {\n addedIds.push(id);\n this._ids[id] = true;\n }\n }\n\n // check for removals\n for (i = 0, len = oldIds.length; i < len; i++) {\n id = oldIds[i];\n if (!newIds[id]) {\n removedIds.push(id);\n removedItems.push(this._data._data[id]);\n delete this._ids[id];\n }\n }\n\n this.length += addedIds.length - removedIds.length;\n\n // trigger events\n if (addedIds.length) {\n this._trigger('add', {items: addedIds});\n }\n if (removedIds.length) {\n this._trigger('remove', {items: removedIds, oldData: removedItems});\n }\n};\n\n/**\n * Get data from the data view\n *\n * Usage:\n *\n * get()\n * get(options: Object)\n * get(options: Object, data: Array | DataTable)\n *\n * get(id: Number)\n * get(id: Number, options: Object)\n * get(id: Number, options: Object, data: Array | DataTable)\n *\n * get(ids: Number[])\n * get(ids: Number[], options: Object)\n * get(ids: Number[], options: Object, data: Array | DataTable)\n *\n * Where:\n *\n * {Number | String} id The id of an item\n * {Number[] | String{}} ids An array with ids of items\n * {Object} options An Object with options. Available options:\n * {String} [type] Type of data to be returned. Can\n * be 'DataTable' or 'Array' (default)\n * {Object.} [convert]\n * {String[]} [fields] field names to be returned\n * {function} [filter] filter items\n * {String | function} [order] Order the items by\n * a field name or custom sort function.\n * {Array | DataTable} [data] If provided, items will be appended to this\n * array or table. Required in case of Google\n * DataTable.\n * @param args\n */\nDataView.prototype.get = function (args) {\n var me = this;\n\n // parse the arguments\n var ids, options, data;\n var firstType = util.getType(arguments[0]);\n if (firstType == 'String' || firstType == 'Number' || firstType == 'Array') {\n // get(id(s) [, options] [, data])\n ids = arguments[0]; // can be a single id or an array with ids\n options = arguments[1];\n data = arguments[2];\n }\n else {\n // get([, options] [, data])\n options = arguments[0];\n data = arguments[1];\n }\n\n // extend the options with the default options and provided options\n var viewOptions = util.extend({}, this._options, options);\n\n // create a combined filter method when needed\n if (this._options.filter && options && options.filter) {\n viewOptions.filter = function (item) {\n return me._options.filter(item) && options.filter(item);\n }\n }\n\n // build up the call to the linked data set\n var getArguments = [];\n if (ids != undefined) {\n getArguments.push(ids);\n }\n getArguments.push(viewOptions);\n getArguments.push(data);\n\n return this._data && this._data.get.apply(this._data, getArguments);\n};\n\n/**\n * Get ids of all items or from a filtered set of items.\n * @param {Object} [options] An Object with options. Available options:\n * {function} [filter] filter items\n * {String | function} [order] Order the items by\n * a field name or custom sort function.\n * @return {Array} ids\n */\nDataView.prototype.getIds = function (options) {\n var ids;\n\n if (this._data) {\n var defaultFilter = this._options.filter;\n var filter;\n\n if (options && options.filter) {\n if (defaultFilter) {\n filter = function (item) {\n return defaultFilter(item) && options.filter(item);\n }\n }\n else {\n filter = options.filter;\n }\n }\n else {\n filter = defaultFilter;\n }\n\n ids = this._data.getIds({\n filter: filter,\n order: options && options.order\n });\n }\n else {\n ids = [];\n }\n\n return ids;\n};\n\n/**\n * Map every item in the dataset.\n * @param {function} callback\n * @param {Object} [options] Available options:\n * {Object.} [type]\n * {String[]} [fields] filter fields\n * {function} [filter] filter items\n * {String | function} [order] Order the items by\n * a field name or custom sort function.\n * @return {Object[]} mappedItems\n */\nDataView.prototype.map = function (callback,options) {\n var mappedItems = [];\n if (this._data) {\n var defaultFilter = this._options.filter;\n var filter;\n\n if (options && options.filter) {\n if (defaultFilter) {\n filter = function (item) {\n return defaultFilter(item) && options.filter(item);\n }\n }\n else {\n filter = options.filter;\n }\n }\n else {\n filter = defaultFilter;\n }\n\n mappedItems = this._data.map(callback,{\n filter: filter,\n order: options && options.order\n });\n }\n else {\n mappedItems = [];\n }\n\n return mappedItems;\n};\n\n/**\n * Get the DataSet to which this DataView is connected. In case there is a chain\n * of multiple DataViews, the root DataSet of this chain is returned.\n * @return {DataSet} dataSet\n */\nDataView.prototype.getDataSet = function () {\n var dataSet = this;\n while (dataSet instanceof DataView) {\n dataSet = dataSet._data;\n }\n return dataSet || null;\n};\n\n/**\n * Event listener. Will propagate all events from the connected data set to\n * the subscribers of the DataView, but will filter the items and only trigger\n * when there are changes in the filtered data set.\n * @param {String} event\n * @param {Object | null} params\n * @param {String} senderId\n * @private\n */\nDataView.prototype._onEvent = function (event, params, senderId) {\n var i, len, id, item;\n var ids = params && params.items;\n var addedIds = [],\n updatedIds = [],\n removedIds = [],\n oldItems = [],\n updatedItems = [],\n removedItems = [];\n\n if (ids && this._data) {\n switch (event) {\n case 'add':\n // filter the ids of the added items\n for (i = 0, len = ids.length; i < len; i++) {\n id = ids[i];\n item = this.get(id);\n if (item) {\n this._ids[id] = true;\n addedIds.push(id);\n }\n }\n\n break;\n\n case 'update':\n // determine the event from the views viewpoint: an updated\n // item can be added, updated, or removed from this view.\n for (i = 0, len = ids.length; i < len; i++) {\n id = ids[i];\n item = this.get(id);\n\n if (item) {\n if (this._ids[id]) {\n updatedIds.push(id);\n updatedItems.push(params.data[i]);\n oldItems.push(params.oldData[i]);\n }\n else {\n this._ids[id] = true;\n addedIds.push(id);\n }\n }\n else {\n if (this._ids[id]) {\n delete this._ids[id];\n removedIds.push(id);\n removedItems.push(params.oldData[i]);\n }\n else {\n // nothing interesting for me :-(\n }\n }\n }\n\n break;\n\n case 'remove':\n // filter the ids of the removed items\n for (i = 0, len = ids.length; i < len; i++) {\n id = ids[i];\n if (this._ids[id]) {\n delete this._ids[id];\n removedIds.push(id);\n removedItems.push(params.oldData[i]);\n }\n }\n\n break;\n }\n\n this.length += addedIds.length - removedIds.length;\n\n if (addedIds.length) {\n this._trigger('add', {items: addedIds}, senderId);\n }\n if (updatedIds.length) {\n this._trigger('update', {items: updatedIds, oldData: oldItems, data: updatedItems}, senderId);\n }\n if (removedIds.length) {\n this._trigger('remove', {items: removedIds, oldData: removedItems}, senderId);\n }\n }\n};\n\n// copy subscription functionality from DataSet\nDataView.prototype.on = DataSet.prototype.on;\nDataView.prototype.off = DataSet.prototype.off;\nDataView.prototype._trigger = DataSet.prototype._trigger;\n\n// TODO: make these functions deprecated (replaced with `on` and `off` since version 0.5)\nDataView.prototype.subscribe = DataView.prototype.on;\nDataView.prototype.unsubscribe = DataView.prototype.off;\n\nmodule.exports = DataView;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/DataView.js","var Emitter = require('emitter-component'); var DataSet = require('../DataSet');\nvar DataView = require('../DataView');\nvar util = require('../util');\nvar Point3d = require('./Point3d');\nvar Point2d = require('./Point2d');\nvar Camera = require('./Camera');\nvar Filter = require('./Filter');\nvar Slider = require('./Slider');\nvar StepNumber = require('./StepNumber');\nvar Range = require('./Range');\nvar Settings = require('./Settings');\n\n\n/// enumerate the available styles\nGraph3d.STYLE = Settings.STYLE; \n\n\n/**\n * Following label is used in the settings to describe values which should be\n * determined by the code while running, from the current data and graph style.\n * \n * Using 'undefined' directly achieves the same thing, but this is more\n * descriptive by describing the intent.\n */\nvar autoByDefault = undefined;\n\n\n/**\n * Default values for option settings.\n *\n * These are the values used when a Graph3d instance is initialized without\n * custom settings.\n *\n * If a field is not in this list, a default value of 'autoByDefault' is assumed,\n * which is just an alias for 'undefined'.\n */\nvar DEFAULTS = {\n width : '400px',\n height : '400px',\n filterLabel : 'time',\n legendLabel : 'value',\n xLabel : 'x',\n yLabel : 'y',\n zLabel : 'z',\n xValueLabel : function(v) { return v; },\n yValueLabel : function(v) { return v; },\n zValueLabel : function(v) { return v; },\n showGrid : true,\n showPerspective : true,\n showShadow : false,\n keepAspectRatio : true,\n verticalRatio : 0.5, // 0.1 to 1.0, where 1.0 results in a 'cube'\n dotSizeRatio : 0.02, // size of the dots as a fraction of the graph width\n\n showAnimationControls: autoByDefault,\n animationInterval : 1000, // milliseconds\n animationPreload : false,\n animationAutoStart : autoByDefault,\n\n axisColor : '#4D4D4D',\n gridColor : '#D3D3D3',\n xCenter : '55%',\n yCenter : '50%',\n\n style : Graph3d.STYLE.DOT,\n tooltip : false,\n showLegend : autoByDefault, // determined by graph style\n backgroundColor : autoByDefault,\n\n dataColor : {\n fill : '#7DC1FF',\n stroke : '#3267D2',\n strokeWidth: 1 // px\n },\n\n cameraPosition : {\n horizontal: 1.0,\n vertical : 0.5,\n distance : 1.7\n },\n\n xBarWidth : autoByDefault,\n yBarWidth : autoByDefault,\n valueMin : autoByDefault,\n valueMax : autoByDefault,\n xMin : autoByDefault,\n xMax : autoByDefault,\n xStep : autoByDefault,\n yMin : autoByDefault,\n yMax : autoByDefault,\n yStep : autoByDefault,\n zMin : autoByDefault,\n zMax : autoByDefault,\n zStep : autoByDefault\n};\n\n\n// -----------------------------------------------------------------------------\n// Class Graph3d\n// -----------------------------------------------------------------------------\n\n\n/**\n * @constructor Graph3d\n * Graph3d displays data in 3d.\n *\n * Graph3d is developed in javascript as a Google Visualization Chart.\n *\n * @param {Element} container The DOM element in which the Graph3d will\n * be created. Normally a div element.\n * @param {DataSet | DataView | Array} [data]\n * @param {Object} [options]\n */\nfunction Graph3d(container, data, options) {\n if (!(this instanceof Graph3d)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n\n // create variables and set default values\n this.containerElement = container;\n\n this.dataTable = null; // The original data table\n this.dataPoints = null; // The table with point objects\n\n // create a frame and canvas\n this.create();\n\n Settings.setDefaults(DEFAULTS, this);\n\n // the column indexes\n this.colX = undefined;\n this.colY = undefined;\n this.colZ = undefined;\n this.colValue = undefined;\n this.colFilter = undefined;\n\n // TODO: customize axis range\n\n // apply options (also when undefined)\n this.setOptions(options);\n\n // apply data\n if (data) {\n this.setData(data);\n }\n}\n\n// Extend Graph3d with an Emitter mixin\nEmitter(Graph3d.prototype);\n\n/**\n * Calculate the scaling values, dependent on the range in x, y, and z direction\n */\nGraph3d.prototype._setScale = function() {\n this.scale = new Point3d(\n 1 / this.xRange.range(),\n 1 / this.yRange.range(),\n 1 / this.zRange.range()\n );\n\n // keep aspect ration between x and y scale if desired\n if (this.keepAspectRatio) {\n if (this.scale.x < this.scale.y) {\n //noinspection JSSuspiciousNameCombination\n this.scale.y = this.scale.x;\n }\n else {\n //noinspection JSSuspiciousNameCombination\n this.scale.x = this.scale.y;\n }\n }\n\n // scale the vertical axis\n this.scale.z *= this.verticalRatio;\n // TODO: can this be automated? verticalRatio?\n\n // determine scale for (optional) value\n if (this.valueRange !== undefined) {\n this.scale.value = 1 / this.valueRange.range();\n }\n\n // position the camera arm\n var xCenter = this.xRange.center() * this.scale.x;\n var yCenter = this.yRange.center() * this.scale.y;\n var zCenter = this.zRange.center() * this.scale.z;\n this.camera.setArmLocation(xCenter, yCenter, zCenter);\n};\n\n\n/**\n * Convert a 3D location to a 2D location on screen\n * Source: ttp://en.wikipedia.org/wiki/3D_projection\n *\n * @param {Point3d} point3d A 3D point with parameters x, y, z\n * @returns {Point2d} point2d A 2D point with parameters x, y\n */\nGraph3d.prototype._convert3Dto2D = function(point3d) {\n var translation = this._convertPointToTranslation(point3d);\n return this._convertTranslationToScreen(translation);\n};\n\n/**\n * Convert a 3D location its translation seen from the camera\n * Source: http://en.wikipedia.org/wiki/3D_projection\n *\n * @param {Point3d} point3d A 3D point with parameters x, y, z\n * @returns {Point3d} translation A 3D point with parameters x, y, z This is\n * the translation of the point, seen from the\n * camera.\n */\nGraph3d.prototype._convertPointToTranslation = function(point3d) {\n var cameraLocation = this.camera.getCameraLocation(),\n cameraRotation = this.camera.getCameraRotation(),\n ax = point3d.x * this.scale.x,\n ay = point3d.y * this.scale.y,\n az = point3d.z * this.scale.z,\n\n cx = cameraLocation.x,\n cy = cameraLocation.y,\n cz = cameraLocation.z,\n\n // calculate angles\n sinTx = Math.sin(cameraRotation.x),\n cosTx = Math.cos(cameraRotation.x),\n sinTy = Math.sin(cameraRotation.y),\n cosTy = Math.cos(cameraRotation.y),\n sinTz = Math.sin(cameraRotation.z),\n cosTz = Math.cos(cameraRotation.z),\n\n // calculate translation\n dx = cosTy * (sinTz * (ay - cy) + cosTz * (ax - cx)) - sinTy * (az - cz),\n dy = sinTx * (cosTy * (az - cz) + sinTy * (sinTz * (ay - cy) + cosTz * (ax - cx))) + cosTx * (cosTz * (ay - cy) - sinTz * (ax-cx)),\n dz = cosTx * (cosTy * (az - cz) + sinTy * (sinTz * (ay - cy) + cosTz * (ax - cx))) - sinTx * (cosTz * (ay - cy) - sinTz * (ax-cx));\n\n return new Point3d(dx, dy, dz);\n};\n\n/**\n * Convert a translation point to a point on the screen\n *\n * @param {Point3d} translation A 3D point with parameters x, y, z This is\n * the translation of the point, seen from the\n * camera.\n * @returns {Point2d} point2d A 2D point with parameters x, y\n */\nGraph3d.prototype._convertTranslationToScreen = function(translation) {\n var ex = this.eye.x,\n ey = this.eye.y,\n ez = this.eye.z,\n dx = translation.x,\n dy = translation.y,\n dz = translation.z;\n\n // calculate position on screen from translation\n var bx;\n var by;\n if (this.showPerspective) {\n bx = (dx - ex) * (ez / dz);\n by = (dy - ey) * (ez / dz);\n }\n else {\n bx = dx * -(ez / this.camera.getArmLength());\n by = dy * -(ez / this.camera.getArmLength());\n }\n\n // shift and scale the point to the center of the screen\n // use the width of the graph to scale both horizontally and vertically.\n return new Point2d(\n this.currentXCenter + bx * this.frame.canvas.clientWidth,\n this.currentYCenter - by * this.frame.canvas.clientWidth);\n};\n\n\n/**\n * Calculate the translations and screen positions of all points\n */\nGraph3d.prototype._calcTranslations = function(points, sort) {\n if (sort === undefined) {\n sort = true;\n }\n\n for (var i = 0; i < points.length; i++) {\n var point = points[i];\n point.trans = this._convertPointToTranslation(point.point);\n point.screen = this._convertTranslationToScreen(point.trans);\n\n // calculate the translation of the point at the bottom (needed for sorting)\n var transBottom = this._convertPointToTranslation(point.bottom);\n point.dist = this.showPerspective ? transBottom.length() : -transBottom.z;\n }\n\n if (!sort) {\n return;\n }\n\n // sort the points on depth of their (x,y) position (not on z)\n var sortDepth = function (a, b) {\n return b.dist - a.dist;\n };\n points.sort(sortDepth);\n};\n\n\nGraph3d.prototype.getNumberOfRows = function(data) {\n return data.length;\n}\n\n\nGraph3d.prototype.getNumberOfColumns = function(data) {\n var counter = 0;\n for (var column in data[0]) {\n if (data[0].hasOwnProperty(column)) {\n counter++;\n }\n }\n return counter;\n}\n\n\nGraph3d.prototype.getDistinctValues = function(data, column) {\n var distinctValues = [];\n for (var i = 0; i < data.length; i++) {\n if (distinctValues.indexOf(data[i][column]) == -1) {\n distinctValues.push(data[i][column]);\n }\n }\n return distinctValues;\n}\n\n\n/**\n * Get the absolute min/max values for the passed data column.\n *\n * @returns {Range} A Range instance with min/max members properly set.\n */\nGraph3d.prototype.getColumnRange = function(data,column) {\n var range = new Range();\n\n // Adjust the range so that it covers all values in the passed data elements.\n for (var i = 0; i < data.length; i++) {\n var item = data[i][column];\n range.adjust(item);\n }\n\n return range;\n};\n\n\n/**\n * Check if the state is consistent for the use of the value field.\n *\n * Throws if a problem is detected.\n */\nGraph3d.prototype._checkValueField = function (data) {\n\n var hasValueField = this.style === Graph3d.STYLE.BARCOLOR\n || this.style === Graph3d.STYLE.BARSIZE\n || this.style === Graph3d.STYLE.DOTCOLOR\n || this.style === Graph3d.STYLE.DOTSIZE;\n\n if (!hasValueField) {\n return; // No need to check further\n }\n\n // Following field must be present for the current graph style\n if (this.colValue === undefined) {\n throw new Error('Expected data to have '\n + ' field \\'style\\' '\n + ' for graph style \\'' + this.style + '\\''\n );\n }\n\n // The data must also contain this field.\n // Note that only first data element is checked.\n if (data[0][this.colValue] === undefined) {\n throw new Error('Expected data to have '\n + ' field \\'' + this.colValue + '\\' '\n + ' for graph style \\'' + this.style + '\\''\n );\n }\n};\n\n\n/**\n * Set default values for range\n *\n * The default values override the range values, if defined.\n *\n * Because it's possible that only defaultMin or defaultMax is set, it's better\n * to pass in a range already set with the min/max set from the data. Otherwise,\n * it's quite hard to process the min/max properly.\n */\nGraph3d.prototype._setRangeDefaults = function (range, defaultMin, defaultMax) {\n if (defaultMin !== undefined) {\n range.min = defaultMin;\n }\n\n if (defaultMax !== undefined) {\n range.max = defaultMax;\n }\n\n // This is the original way that the default min/max values were adjusted.\n // TODO: Perhaps it's better if an error is thrown if the values do not agree.\n // But this will change the behaviour.\n if (range.max <= range.min) range.max = range.min + 1;\n};\n\n\n/**\n * Initialize the data from the data table. Calculate minimum and maximum values\n * and column index values\n * @param {Array | DataSet | DataView} rawData The data containing the items for\n * the Graph.\n * @param {Number} style Style Number\n */\nGraph3d.prototype._dataInitialize = function (rawData, style) {\n var me = this;\n\n // unsubscribe from the dataTable\n if (this.dataSet) {\n this.dataSet.off('*', this._onChange);\n }\n\n if (rawData === undefined)\n return;\n\n if (Array.isArray(rawData)) {\n rawData = new DataSet(rawData);\n }\n\n var data;\n if (rawData instanceof DataSet || rawData instanceof DataView) {\n data = rawData.get();\n }\n else {\n throw new Error('Array, DataSet, or DataView expected');\n }\n\n if (data.length == 0)\n return;\n\n this.dataSet = rawData;\n this.dataTable = data;\n\n // subscribe to changes in the dataset\n this._onChange = function () {\n me.setData(me.dataSet);\n };\n this.dataSet.on('*', this._onChange);\n\n // determine the location of x,y,z,value,filter columns\n this.colX = 'x';\n this.colY = 'y';\n this.colZ = 'z';\n\n\n var withBars = this.style == Graph3d.STYLE.BAR ||\n this.style == Graph3d.STYLE.BARCOLOR ||\n this.style == Graph3d.STYLE.BARSIZE;\n\n // determine barWidth from data\n if (withBars) {\n if (this.defaultXBarWidth !== undefined) {\n this.xBarWidth = this.defaultXBarWidth;\n }\n else {\n var dataX = this.getDistinctValues(data,this.colX);\n this.xBarWidth = (dataX[1] - dataX[0]) || 1;\n }\n\n if (this.defaultYBarWidth !== undefined) {\n this.yBarWidth = this.defaultYBarWidth;\n }\n else {\n var dataY = this.getDistinctValues(data,this.colY);\n this.yBarWidth = (dataY[1] - dataY[0]) || 1;\n }\n }\n\n // calculate minimums and maximums\n var NUMSTEPS = 5;\n\n var xRange = this.getColumnRange(data, this.colX);\n if (withBars) {\n xRange.expand(this.xBarWidth / 2);\n }\n this._setRangeDefaults(xRange, this.defaultXMin, this.defaultXMax);\n this.xRange = xRange;\n this.xStep = (this.defaultXStep !== undefined) ? this.defaultXStep : xRange.range()/NUMSTEPS;\n\n var yRange = this.getColumnRange(data, this.colY);\n if (withBars) {\n yRange.expand(this.yBarWidth / 2);\n }\n this._setRangeDefaults(yRange, this.defaultYMin, this.defaultYMax);\n this.yRange = yRange;\n this.yStep = (this.defaultYStep !== undefined) ? this.defaultYStep : yRange.range()/NUMSTEPS;\n\n var zRange = this.getColumnRange(data, this.colZ);\n this._setRangeDefaults(zRange, this.defaultZMin, this.defaultZMax);\n this.zRange = zRange;\n this.zStep = (this.defaultZStep !== undefined) ? this.defaultZStep : zRange.range()/NUMSTEPS;\n\n if (data[0].hasOwnProperty('style')) {\n this.colValue = 'style';\n var valueRange = this.getColumnRange(data,this.colValue);\n this._setRangeDefaults(valueRange, this.defaultValueMin, this.defaultValueMax);\n this.valueRange = valueRange;\n }\n\n\n // check if a filter column is provided\n // Needs to be started after zRange is defined\n if (data[0].hasOwnProperty('filter')) {\n // Only set this field if it's actually present\n this.colFilter = 'filter';\n\n if (this.dataFilter === undefined) {\n this.dataFilter = new Filter(rawData, this.colFilter, this);\n this.dataFilter.setOnLoadCallback(function() {me.redraw();});\n }\n }\n\n \n // set the scale dependent on the ranges.\n this._setScale();\n};\n\n\n\n/**\n * Filter the data based on the current filter\n *\n * @param {Array} data\n * @returns {Array} dataPoints Array with point objects which can be drawn on\n * screen\n */\nGraph3d.prototype._getDataPoints = function (data) {\n // TODO: store the created matrix dataPoints in the filters instead of\n // reloading each time.\n var x, y, i, z, obj, point;\n\n var dataPoints = [];\n\n if (this.style === Graph3d.STYLE.GRID ||\n this.style === Graph3d.STYLE.SURFACE) {\n // copy all values from the google data table to a matrix\n // the provided values are supposed to form a grid of (x,y) positions\n\n // create two lists with all present x and y values\n var dataX = [];\n var dataY = [];\n for (i = 0; i < this.getNumberOfRows(data); i++) {\n x = data[i][this.colX] || 0;\n y = data[i][this.colY] || 0;\n\n if (dataX.indexOf(x) === -1) {\n dataX.push(x);\n }\n if (dataY.indexOf(y) === -1) {\n dataY.push(y);\n }\n }\n\n var sortNumber = function (a, b) {\n return a - b;\n };\n dataX.sort(sortNumber);\n dataY.sort(sortNumber);\n\n // create a grid, a 2d matrix, with all values.\n var dataMatrix = []; // temporary data matrix\n for (i = 0; i < data.length; i++) {\n x = data[i][this.colX] || 0;\n y = data[i][this.colY] || 0;\n z = data[i][this.colZ] || 0;\n\n // TODO: implement Array().indexOf() for Internet Explorer\n var xIndex = dataX.indexOf(x);\n var yIndex = dataY.indexOf(y);\n\n if (dataMatrix[xIndex] === undefined) {\n dataMatrix[xIndex] = [];\n }\n\n var point3d = new Point3d();\n point3d.x = x;\n point3d.y = y;\n point3d.z = z;\n point3d.data = data[i];\n\n obj = {};\n obj.point = point3d;\n obj.trans = undefined;\n obj.screen = undefined;\n obj.bottom = new Point3d(x, y, this.zRange.min);\n\n dataMatrix[xIndex][yIndex] = obj;\n\n dataPoints.push(obj);\n }\n\n // fill in the pointers to the neighbors.\n for (x = 0; x < dataMatrix.length; x++) {\n for (y = 0; y < dataMatrix[x].length; y++) {\n if (dataMatrix[x][y]) {\n dataMatrix[x][y].pointRight = (x < dataMatrix.length-1) ? dataMatrix[x+1][y] : undefined;\n dataMatrix[x][y].pointTop = (y < dataMatrix[x].length-1) ? dataMatrix[x][y+1] : undefined;\n dataMatrix[x][y].pointCross =\n (x < dataMatrix.length-1 && y < dataMatrix[x].length-1) ?\n dataMatrix[x+1][y+1] :\n undefined;\n }\n }\n }\n }\n else { // 'dot', 'dot-line', etc.\n this._checkValueField(data);\n\n // copy all values from the google data table to a list with Point3d objects\n for (i = 0; i < data.length; i++) {\n point = new Point3d();\n point.x = data[i][this.colX] || 0;\n point.y = data[i][this.colY] || 0;\n point.z = data[i][this.colZ] || 0;\n point.data = data[i];\n\n if (this.colValue !== undefined) {\n point.value = data[i][this.colValue] || 0;\n }\n\n obj = {};\n obj.point = point;\n obj.bottom = new Point3d(point.x, point.y, this.zRange.min);\n obj.trans = undefined;\n obj.screen = undefined;\n\n if (this.style === Graph3d.STYLE.LINE) {\n if (i > 0) {\n // Add next point for line drawing\n dataPoints[i - 1].pointNext = obj;\n }\n }\n\n dataPoints.push(obj);\n }\n }\n\n return dataPoints;\n};\n\n/**\n * Create the main frame for the Graph3d.\n *\n * This function is executed once when a Graph3d object is created. The frame\n * contains a canvas, and this canvas contains all objects like the axis and\n * nodes.\n */\nGraph3d.prototype.create = function () {\n // remove all elements from the container element.\n while (this.containerElement.hasChildNodes()) {\n this.containerElement.removeChild(this.containerElement.firstChild);\n }\n\n this.frame = document.createElement('div');\n this.frame.style.position = 'relative';\n this.frame.style.overflow = 'hidden';\n\n // create the graph canvas (HTML canvas element)\n this.frame.canvas = document.createElement( 'canvas' );\n this.frame.canvas.style.position = 'relative';\n this.frame.appendChild(this.frame.canvas);\n //if (!this.frame.canvas.getContext) {\n {\n var noCanvas = document.createElement( 'DIV' );\n noCanvas.style.color = 'red';\n noCanvas.style.fontWeight = 'bold' ;\n noCanvas.style.padding = '10px';\n noCanvas.innerHTML = 'Error: your browser does not support HTML canvas';\n this.frame.canvas.appendChild(noCanvas);\n }\n\n this.frame.filter = document.createElement( 'div' );\n this.frame.filter.style.position = 'absolute';\n this.frame.filter.style.bottom = '0px';\n this.frame.filter.style.left = '0px';\n this.frame.filter.style.width = '100%';\n this.frame.appendChild(this.frame.filter);\n\n // add event listeners to handle moving and zooming the contents\n var me = this;\n var onmousedown = function (event) {me._onMouseDown(event);};\n var ontouchstart = function (event) {me._onTouchStart(event);};\n var onmousewheel = function (event) {me._onWheel(event);};\n var ontooltip = function (event) {me._onTooltip(event);};\n var onclick = function(event) {me._onClick(event);};\n // TODO: these events are never cleaned up... can give a 'memory leakage'\n\n util.addEventListener(this.frame.canvas, 'keydown', onkeydown);\n util.addEventListener(this.frame.canvas, 'mousedown', onmousedown);\n util.addEventListener(this.frame.canvas, 'touchstart', ontouchstart);\n util.addEventListener(this.frame.canvas, 'mousewheel', onmousewheel);\n util.addEventListener(this.frame.canvas, 'mousemove', ontooltip);\n util.addEventListener(this.frame.canvas, 'click', onclick);\n\n // add the new graph to the container element\n this.containerElement.appendChild(this.frame);\n};\n\n\n/**\n * Set a new size for the graph\n */\nGraph3d.prototype._setSize = function(width, height) {\n this.frame.style.width = width;\n this.frame.style.height = height;\n\n this._resizeCanvas();\n};\n\n\n/**\n * Resize the canvas to the current size of the frame\n */\nGraph3d.prototype._resizeCanvas = function() {\n this.frame.canvas.style.width = '100%';\n this.frame.canvas.style.height = '100%';\n\n this.frame.canvas.width = this.frame.canvas.clientWidth;\n this.frame.canvas.height = this.frame.canvas.clientHeight;\n\n // adjust with for margin\n this.frame.filter.style.width = (this.frame.canvas.clientWidth - 2 * 10) + 'px';\n};\n\n/**\n * Start animation\n */\nGraph3d.prototype.animationStart = function() {\n if (!this.frame.filter || !this.frame.filter.slider)\n throw new Error('No animation available');\n\n this.frame.filter.slider.play();\n};\n\n\n/**\n * Stop animation\n */\nGraph3d.prototype.animationStop = function() {\n if (!this.frame.filter || !this.frame.filter.slider) return;\n\n this.frame.filter.slider.stop();\n};\n\n\n/**\n * Resize the center position based on the current values in this.xCenter\n * and this.yCenter (which are strings with a percentage or a value\n * in pixels). The center positions are the variables this.currentXCenter\n * and this.currentYCenter\n */\nGraph3d.prototype._resizeCenter = function() {\n // calculate the horizontal center position\n if (this.xCenter.charAt(this.xCenter.length-1) === '%') {\n this.currentXCenter =\n parseFloat(this.xCenter) / 100 *\n this.frame.canvas.clientWidth;\n }\n else {\n this.currentXCenter = parseFloat(this.xCenter); // supposed to be in px\n }\n\n // calculate the vertical center position\n if (this.yCenter.charAt(this.yCenter.length-1) === '%') {\n this.currentYCenter =\n parseFloat(this.yCenter) / 100 *\n (this.frame.canvas.clientHeight - this.frame.filter.clientHeight);\n }\n else {\n this.currentYCenter = parseFloat(this.yCenter); // supposed to be in px\n }\n};\n\n\n\n/**\n * Retrieve the current camera rotation\n *\n * @returns {object} An object with parameters horizontal, vertical, and\n * distance\n */\nGraph3d.prototype.getCameraPosition = function() {\n var pos = this.camera.getArmRotation();\n pos.distance = this.camera.getArmLength();\n return pos;\n};\n\n/**\n * Load data into the 3D Graph\n */\nGraph3d.prototype._readData = function(data) {\n // read the data\n this._dataInitialize(data, this.style);\n\n\n if (this.dataFilter) {\n // apply filtering\n this.dataPoints = this.dataFilter._getDataPoints();\n }\n else {\n // no filtering. load all data\n this.dataPoints = this._getDataPoints(this.dataTable);\n }\n\n // draw the filter\n this._redrawFilter();\n};\n\n/**\n * Replace the dataset of the Graph3d\n *\n * @param {Array | DataSet | DataView} data\n */\nGraph3d.prototype.setData = function (data) {\n this._readData(data);\n this.redraw();\n\n // start animation when option is true\n if (this.animationAutoStart && this.dataFilter) {\n this.animationStart();\n }\n};\n\n/**\n * Update the options. Options will be merged with current options\n *\n * @param {Object} options\n */\nGraph3d.prototype.setOptions = function (options) {\n var cameraPosition = undefined;\n\n this.animationStop();\n\n Settings.setOptions(options, this);\n\n this.setPointDrawingMethod();\n this._setSize(this.width, this.height);\n\n // re-load the data\n if (this.dataTable) {\n this.setData(this.dataTable);\n }\n\n // start animation when option is true\n if (this.animationAutoStart && this.dataFilter) {\n this.animationStart();\n }\n};\n\n\n/**\n * Determine which point drawing method to use for the current graph style.\n */\nGraph3d.prototype.setPointDrawingMethod = function() {\n var method = undefined;\n\n switch (this.style) {\n case Graph3d.STYLE.BAR:\n method = Graph3d.prototype._redrawBarGraphPoint;\n break;\n case Graph3d.STYLE.BARCOLOR:\n method = Graph3d.prototype._redrawBarColorGraphPoint;\n break;\n case Graph3d.STYLE.BARSIZE:\n method = Graph3d.prototype._redrawBarSizeGraphPoint;\n break;\n case Graph3d.STYLE.DOT:\n method = Graph3d.prototype._redrawDotGraphPoint;\n break;\n case Graph3d.STYLE.DOTLINE:\n method = Graph3d.prototype._redrawDotLineGraphPoint;\n break;\n case Graph3d.STYLE.DOTCOLOR:\n method = Graph3d.prototype._redrawDotColorGraphPoint;\n break;\n case Graph3d.STYLE.DOTSIZE:\n method = Graph3d.prototype._redrawDotSizeGraphPoint;\n break;\n case Graph3d.STYLE.SURFACE:\n method = Graph3d.prototype._redrawSurfaceGraphPoint;\n break;\n case Graph3d.STYLE.GRID:\n method = Graph3d.prototype._redrawGridGraphPoint;\n break;\n case Graph3d.STYLE.LINE:\n method = Graph3d.prototype._redrawLineGraphPoint;\n break;\n default:\n throw new Error('Can not determine point drawing method '\n + 'for graph style \\'' + this.style + '\\'');\n break;\n }\n\n this._pointDrawingMethod = method;\n};\n\n\n/**\n * Redraw the Graph.\n */\nGraph3d.prototype.redraw = function() {\n if (this.dataPoints === undefined) {\n throw new Error('Graph data not initialized');\n }\n\n this._resizeCanvas();\n this._resizeCenter();\n this._redrawSlider();\n this._redrawClear();\n this._redrawAxis();\n\n this._redrawDataGraph();\n\n this._redrawInfo();\n this._redrawLegend();\n};\n\n\n/**\n * Get drawing context without exposing canvas\n */\nGraph3d.prototype._getContext = function() {\n var canvas = this.frame.canvas;\n var ctx = canvas.getContext('2d');\n\n ctx.lineJoin = 'round';\n ctx.lineCap = 'round';\n\n return ctx;\n};\n\n\n/**\n * Clear the canvas before redrawing\n */\nGraph3d.prototype._redrawClear = function() {\n var canvas = this.frame.canvas;\n var ctx = canvas.getContext('2d');\n\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n};\n\n\nGraph3d.prototype._dotSize = function() {\n return this.frame.clientWidth * this.dotSizeRatio;\n};\n\n\n/**\n * Get legend width\n */\nGraph3d.prototype._getLegendWidth = function() {\n var width;\n\n if (this.style === Graph3d.STYLE.DOTSIZE) {\n var dotSize = this._dotSize();\n width = dotSize / 2 + dotSize * 2;\n } else if (this.style === Graph3d.STYLE.BARSIZE) {\n width = this.xBarWidth ;\n } else {\n width = 20;\n }\n return width;\n}\n\n\n/**\n * Redraw the legend based on size, dot color, or surface height\n */\nGraph3d.prototype._redrawLegend = function() {\n\n //Return without drawing anything, if no legend is specified\n if (this.showLegend !== true) {\n return;\n }\n\n // Do not draw legend when graph style does not support\n if (this.style === Graph3d.STYLE.LINE\n || this.style === Graph3d.STYLE.BARSIZE //TODO add legend support for BARSIZE\n ){\n return;\n }\n\n // Legend types - size and color. Determine if size legend.\n var isSizeLegend = (this.style === Graph3d.STYLE.BARSIZE\n || this.style === Graph3d.STYLE.DOTSIZE) ;\n\n // Legend is either tracking z values or style values. This flag if false means use z values.\n var isValueLegend = (this.style === Graph3d.STYLE.DOTSIZE\n || this.style === Graph3d.STYLE.DOTCOLOR\n || this.style === Graph3d.STYLE.BARCOLOR);\n\n var height = Math.max(this.frame.clientHeight * 0.25, 100);\n var top = this.margin;\n var width = this._getLegendWidth() ; // px - overwritten by size legend\n var right = this.frame.clientWidth - this.margin;\n var left = right - width;\n var bottom = top + height;\n\n var ctx = this._getContext();\n ctx.lineWidth = 1;\n ctx.font = '14px arial'; // TODO: put in options\n\n if (isSizeLegend === false) {\n // draw the color bar\n var ymin = 0;\n var ymax = height; // Todo: make height customizable\n var y;\n\n for (y = ymin; y < ymax; y++) {\n var f = (y - ymin) / (ymax - ymin);\n var hue = f * 240;\n var color = this._hsv2rgb(hue, 1, 1);\n\n ctx.strokeStyle = color;\n ctx.beginPath();\n ctx.moveTo(left, top + y);\n ctx.lineTo(right, top + y);\n ctx.stroke();\n }\n ctx.strokeStyle = this.axisColor;\n ctx.strokeRect(left, top, width, height);\n\n } else {\n\n // draw the size legend box\n var widthMin;\n if (this.style === Graph3d.STYLE.DOTSIZE) {\n var dotSize = this._dotSize();\n widthMin = dotSize / 2; // px\n } else if (this.style === Graph3d.STYLE.BARSIZE) {\n //widthMin = this.xBarWidth * 0.2 this is wrong - barwidth measures in terms of xvalues\n }\n ctx.strokeStyle = this.axisColor;\n ctx.fillStyle = this.dataColor.fill;\n ctx.beginPath();\n ctx.moveTo(left, top);\n ctx.lineTo(right, top);\n ctx.lineTo(right - width + widthMin, bottom);\n ctx.lineTo(left, bottom);\n ctx.closePath();\n ctx.fill();\n ctx.stroke();\n }\n\n // print value text along the legend edge\n var gridLineLen = 5; // px\n\n var legendMin = isValueLegend ? this.valueRange.min : this.zRange.min;\n var legendMax = isValueLegend ? this.valueRange.max : this.zRange.max;\n var step = new StepNumber(legendMin, legendMax, (legendMax-legendMin)/5, true);\n step.start(true);\n\n var y;\n var from;\n var to;\n while (!step.end()) {\n y = bottom - (step.getCurrent() - legendMin) / (legendMax - legendMin) * height;\n from = new Point2d(left - gridLineLen, y);\n to = new Point2d(left, y);\n this._line(ctx, from, to);\n\n ctx.textAlign = 'right';\n ctx.textBaseline = 'middle';\n ctx.fillStyle = this.axisColor;\n ctx.fillText(step.getCurrent(), left - 2 * gridLineLen, y);\n\n step.next();\n }\n\n ctx.textAlign = 'right';\n ctx.textBaseline = 'top';\n var label = this.legendLabel;\n ctx.fillText(label, right, bottom + this.margin);\n};\n\n/**\n * Redraw the filter\n */\nGraph3d.prototype._redrawFilter = function() {\n this.frame.filter.innerHTML = '';\n\n if (this.dataFilter) {\n var options = {\n 'visible': this.showAnimationControls\n };\n var slider = new Slider(this.frame.filter, options);\n this.frame.filter.slider = slider;\n\n // TODO: css here is not nice here...\n this.frame.filter.style.padding = '10px';\n //this.frame.filter.style.backgroundColor = '#EFEFEF';\n\n slider.setValues(this.dataFilter.values);\n slider.setPlayInterval(this.animationInterval);\n\n // create an event handler\n var me = this;\n var onchange = function () {\n var index = slider.getIndex();\n\n me.dataFilter.selectValue(index);\n me.dataPoints = me.dataFilter._getDataPoints();\n\n me.redraw();\n };\n slider.setOnChangeCallback(onchange);\n }\n else {\n this.frame.filter.slider = undefined;\n }\n};\n\n/**\n * Redraw the slider\n */\nGraph3d.prototype._redrawSlider = function() {\n if ( this.frame.filter.slider !== undefined) {\n this.frame.filter.slider.redraw();\n }\n};\n\n\n/**\n * Redraw common information\n */\nGraph3d.prototype._redrawInfo = function() {\n if (this.dataFilter) {\n var ctx = this._getContext();\n\n ctx.font = '14px arial'; // TODO: put in options\n ctx.lineStyle = 'gray';\n ctx.fillStyle = 'gray';\n ctx.textAlign = 'left';\n ctx.textBaseline = 'top';\n\n var x = this.margin;\n var y = this.margin;\n ctx.fillText(this.dataFilter.getLabel() + ': ' + this.dataFilter.getSelectedValue(), x, y);\n }\n};\n\n\n/**\n * Draw a line between 2d points 'from' and 'to'.\n *\n * If stroke style specified, set that as well.\n */\nGraph3d.prototype._line = function(ctx, from, to, strokeStyle) {\n if (strokeStyle !== undefined) {\n ctx.strokeStyle = strokeStyle;\n }\n\n ctx.beginPath();\n ctx.moveTo(from.x, from.y);\n ctx.lineTo(to.x , to.y );\n ctx.stroke();\n}\n\n\nGraph3d.prototype.drawAxisLabelX = function(ctx, point3d, text, armAngle, yMargin) {\n if (yMargin === undefined) {\n yMargin = 0;\n }\n\n var point2d = this._convert3Dto2D(point3d);\n\n if (Math.cos(armAngle * 2) > 0) {\n ctx.textAlign = 'center';\n ctx.textBaseline = 'top';\n point2d.y += yMargin;\n }\n else if (Math.sin(armAngle * 2) < 0){\n ctx.textAlign = 'right';\n ctx.textBaseline = 'middle';\n }\n else {\n ctx.textAlign = 'left';\n ctx.textBaseline = 'middle';\n }\n\n ctx.fillStyle = this.axisColor;\n ctx.fillText(text, point2d.x, point2d.y);\n}\n\n\nGraph3d.prototype.drawAxisLabelY = function(ctx, point3d, text, armAngle, yMargin) {\n if (yMargin === undefined) {\n yMargin = 0;\n }\n\n var point2d = this._convert3Dto2D(point3d);\n\n if (Math.cos(armAngle * 2) < 0) {\n ctx.textAlign = 'center';\n ctx.textBaseline = 'top';\n point2d.y += yMargin;\n }\n else if (Math.sin(armAngle * 2) > 0){\n ctx.textAlign = 'right';\n ctx.textBaseline = 'middle';\n }\n else {\n ctx.textAlign = 'left';\n ctx.textBaseline = 'middle';\n }\n\n ctx.fillStyle = this.axisColor;\n ctx.fillText(text, point2d.x, point2d.y);\n}\n\n\nGraph3d.prototype.drawAxisLabelZ = function(ctx, point3d, text, offset) {\n if (offset === undefined) {\n offset = 0;\n }\n\n var point2d = this._convert3Dto2D(point3d);\n ctx.textAlign = 'right';\n ctx.textBaseline = 'middle';\n ctx.fillStyle = this.axisColor;\n ctx.fillText(text, point2d.x - offset, point2d.y);\n};\n\n\n/**\n\n\n/**\n * Draw a line between 2d points 'from' and 'to'.\n *\n * If stroke style specified, set that as well.\n */\nGraph3d.prototype._line3d = function(ctx, from, to, strokeStyle) {\n var from2d = this._convert3Dto2D(from);\n var to2d = this._convert3Dto2D(to);\n\n this._line(ctx, from2d, to2d, strokeStyle);\n}\n\n\n/**\n * Redraw the axis\n */\nGraph3d.prototype._redrawAxis = function() {\n var ctx = this._getContext(),\n from, to, step, prettyStep,\n text, xText, yText, zText,\n offset, xOffset, yOffset;\n\n // TODO: get the actual rendered style of the containerElement\n //ctx.font = this.containerElement.style.font;\n ctx.font = 24 / this.camera.getArmLength() + 'px arial';\n\n // calculate the length for the short grid lines\n var gridLenX = 0.025 / this.scale.x;\n var gridLenY = 0.025 / this.scale.y;\n var textMargin = 5 / this.camera.getArmLength(); // px\n var armAngle = this.camera.getArmRotation().horizontal;\n var armVector = new Point2d(Math.cos(armAngle), Math.sin(armAngle));\n\n var xRange = this.xRange;\n var yRange = this.yRange;\n var zRange = this.zRange;\n\n // draw x-grid lines\n ctx.lineWidth = 1;\n prettyStep = (this.defaultXStep === undefined);\n step = new StepNumber(xRange.min, xRange.max, this.xStep, prettyStep);\n step.start(true);\n\n while (!step.end()) {\n var x = step.getCurrent();\n\n if (this.showGrid) {\n from = new Point3d(x, yRange.min, zRange.min);\n to = new Point3d(x, yRange.max, zRange.min);\n this._line3d(ctx, from, to, this.gridColor);\n }\n else {\n from = new Point3d(x, yRange.min, zRange.min);\n to = new Point3d(x, yRange.min+gridLenX, zRange.min);\n this._line3d(ctx, from, to, this.axisColor);\n\n from = new Point3d(x, yRange.max, zRange.min);\n to = new Point3d(x, yRange.max-gridLenX, zRange.min);\n this._line3d(ctx, from, to, this.axisColor);\n }\n\n yText = (armVector.x > 0) ? yRange.min : yRange.max;\n var point3d = new Point3d(x, yText, zRange.min);\n var msg = ' ' + this.xValueLabel(x) + ' ';\n this.drawAxisLabelX(ctx, point3d, msg, armAngle, textMargin);\n\n step.next();\n }\n\n // draw y-grid lines\n ctx.lineWidth = 1;\n prettyStep = (this.defaultYStep === undefined);\n step = new StepNumber(yRange.min, yRange.max, this.yStep, prettyStep);\n step.start(true);\n\n while (!step.end()) {\n var y = step.getCurrent();\n\n if (this.showGrid) {\n from = new Point3d(xRange.min, y, zRange.min);\n to = new Point3d(xRange.max, y, zRange.min);\n this._line3d(ctx, from, to, this.gridColor);\n }\n else {\n from = new Point3d(xRange.min, y, zRange.min);\n to = new Point3d(xRange.min+gridLenY, y, zRange.min);\n this._line3d(ctx, from, to, this.axisColor);\n\n from = new Point3d(xRange.max, y, zRange.min);\n to = new Point3d(xRange.max-gridLenY, y, zRange.min);\n this._line3d(ctx, from, to, this.axisColor);\n }\n\n xText = (armVector.y > 0) ? xRange.min : xRange.max;\n point3d = new Point3d(xText, y, zRange.min);\n var msg = ' ' + this.yValueLabel(y) + ' ';\n this.drawAxisLabelY(ctx, point3d, msg, armAngle, textMargin);\n\n step.next();\n }\n\n // draw z-grid lines and axis\n ctx.lineWidth = 1;\n prettyStep = (this.defaultZStep === undefined);\n step = new StepNumber(zRange.min, zRange.max, this.zStep, prettyStep);\n step.start(true);\n\n xText = (armVector.x > 0) ? xRange.min : xRange.max;\n yText = (armVector.y < 0) ? yRange.min : yRange.max;\n\n while (!step.end()) {\n var z = step.getCurrent();\n\n // TODO: make z-grid lines really 3d?\n var from3d = new Point3d(xText, yText, z);\n var from2d = this._convert3Dto2D(from3d);\n to = new Point2d(from2d.x - textMargin, from2d.y);\n this._line(ctx, from2d, to, this.axisColor);\n\n var msg = this.zValueLabel(z) + ' ';\n this.drawAxisLabelZ(ctx, from3d, msg, 5);\n\n step.next();\n }\n\n ctx.lineWidth = 1;\n from = new Point3d(xText, yText, zRange.min);\n to = new Point3d(xText, yText, zRange.max);\n this._line3d(ctx, from, to, this.axisColor);\n\n // draw x-axis\n var xMin2d;\n var xMax2d;\n ctx.lineWidth = 1;\n\n // line at yMin\n xMin2d = new Point3d(xRange.min, yRange.min, zRange.min);\n xMax2d = new Point3d(xRange.max, yRange.min, zRange.min);\n this._line3d(ctx, xMin2d, xMax2d, this.axisColor);\n // line at ymax\n xMin2d = new Point3d(xRange.min, yRange.max, zRange.min);\n xMax2d = new Point3d(xRange.max, yRange.max, zRange.min);\n this._line3d(ctx, xMin2d, xMax2d, this.axisColor);\n\n // draw y-axis\n ctx.lineWidth = 1;\n // line at xMin\n from = new Point3d(xRange.min, yRange.min, zRange.min);\n to = new Point3d(xRange.min, yRange.max, zRange.min);\n this._line3d(ctx, from, to, this.axisColor);\n // line at xMax\n from = new Point3d(xRange.max, yRange.min, zRange.min);\n to = new Point3d(xRange.max, yRange.max, zRange.min);\n this._line3d(ctx, from, to, this.axisColor);\n\n // draw x-label\n var xLabel = this.xLabel;\n if (xLabel.length > 0) {\n yOffset = 0.1 / this.scale.y;\n xText = (xRange.max + 3*xRange.min)/4;\n yText = (armVector.x > 0) ? yRange.min - yOffset: yRange.max + yOffset;\n text = new Point3d(xText, yText, zRange.min);\n this.drawAxisLabelX(ctx, text, xLabel, armAngle);\n }\n\n // draw y-label\n var yLabel = this.yLabel;\n if (yLabel.length > 0) {\n xOffset = 0.1 / this.scale.x;\n xText = (armVector.y > 0) ? xRange.min - xOffset : xRange.max + xOffset;\n yText = (yRange.max + 3*yRange.min)/4;\n text = new Point3d(xText, yText, zRange.min);\n\n this.drawAxisLabelY(ctx, text, yLabel, armAngle);\n }\n\n // draw z-label\n var zLabel = this.zLabel;\n if (zLabel.length > 0) {\n offset = 30; // pixels. // TODO: relate to the max width of the values on the z axis?\n xText = (armVector.x > 0) ? xRange.min : xRange.max;\n yText = (armVector.y < 0) ? yRange.min : yRange.max;\n zText = (zRange.max + 3*zRange.min)/4;\n text = new Point3d(xText, yText, zText);\n\n this.drawAxisLabelZ(ctx, text, zLabel, offset);\n }\n};\n\n/**\n * Calculate the color based on the given value.\n * @param {Number} H Hue, a value be between 0 and 360\n * @param {Number} S Saturation, a value between 0 and 1\n * @param {Number} V Value, a value between 0 and 1\n */\nGraph3d.prototype._hsv2rgb = function(H, S, V) {\n var R, G, B, C, Hi, X;\n\n C = V * S;\n Hi = Math.floor(H/60); // hi = 0,1,2,3,4,5\n X = C * (1 - Math.abs(((H/60) % 2) - 1));\n\n switch (Hi) {\n case 0: R = C; G = X; B = 0; break;\n case 1: R = X; G = C; B = 0; break;\n case 2: R = 0; G = C; B = X; break;\n case 3: R = 0; G = X; B = C; break;\n case 4: R = X; G = 0; B = C; break;\n case 5: R = C; G = 0; B = X; break;\n\n default: R = 0; G = 0; B = 0; break;\n }\n\n return 'RGB(' + parseInt(R*255) + ',' + parseInt(G*255) + ',' + parseInt(B*255) + ')';\n};\n\n\nGraph3d.prototype._getStrokeWidth = function(point) {\n if (point !== undefined) {\n if (this.showPerspective) {\n return 1 / -point.trans.z * this.dataColor.strokeWidth;\n }\n else {\n return -(this.eye.z / this.camera.getArmLength()) * this.dataColor.strokeWidth;\n }\n }\n\n return this.dataColor.strokeWidth;\n};\n\n\n// -----------------------------------------------------------------------------\n// Drawing primitives for the graphs\n// -----------------------------------------------------------------------------\n\n\n/**\n * Draw a bar element in the view with the given properties.\n */\nGraph3d.prototype._redrawBar = function(ctx, point, xWidth, yWidth, color, borderColor) {\n var i, j, surface;\n\n // calculate all corner points\n var me = this;\n var point3d = point.point;\n var zMin = this.zRange.min;\n var top = [\n {point: new Point3d(point3d.x - xWidth, point3d.y - yWidth, point3d.z)},\n {point: new Point3d(point3d.x + xWidth, point3d.y - yWidth, point3d.z)},\n {point: new Point3d(point3d.x + xWidth, point3d.y + yWidth, point3d.z)},\n {point: new Point3d(point3d.x - xWidth, point3d.y + yWidth, point3d.z)}\n ];\n var bottom = [\n {point: new Point3d(point3d.x - xWidth, point3d.y - yWidth, zMin)},\n {point: new Point3d(point3d.x + xWidth, point3d.y - yWidth, zMin)},\n {point: new Point3d(point3d.x + xWidth, point3d.y + yWidth, zMin)},\n {point: new Point3d(point3d.x - xWidth, point3d.y + yWidth, zMin)}\n ];\n\n // calculate screen location of the points\n top.forEach(function (obj) {\n obj.screen = me._convert3Dto2D(obj.point);\n });\n bottom.forEach(function (obj) {\n obj.screen = me._convert3Dto2D(obj.point);\n });\n\n // create five sides, calculate both corner points and center points\n var surfaces = [\n {corners: top, center: Point3d.avg(bottom[0].point, bottom[2].point)},\n {corners: [top[0], top[1], bottom[1], bottom[0]], center: Point3d.avg(bottom[1].point, bottom[0].point)},\n {corners: [top[1], top[2], bottom[2], bottom[1]], center: Point3d.avg(bottom[2].point, bottom[1].point)},\n {corners: [top[2], top[3], bottom[3], bottom[2]], center: Point3d.avg(bottom[3].point, bottom[2].point)},\n {corners: [top[3], top[0], bottom[0], bottom[3]], center: Point3d.avg(bottom[0].point, bottom[3].point)}\n ];\n point.surfaces = surfaces;\n\n // calculate the distance of each of the surface centers to the camera\n for (j = 0; j < surfaces.length; j++) {\n surface = surfaces[j];\n var transCenter = this._convertPointToTranslation(surface.center);\n surface.dist = this.showPerspective ? transCenter.length() : -transCenter.z;\n // TODO: this dept calculation doesn't work 100% of the cases due to perspective,\n // but the current solution is fast/simple and works in 99.9% of all cases\n // the issue is visible in example 14, with graph.setCameraPosition({horizontal: 2.97, vertical: 0.5, distance: 0.9})\n }\n\n // order the surfaces by their (translated) depth\n surfaces.sort(function (a, b) {\n var diff = b.dist - a.dist;\n if (diff) return diff;\n\n // if equal depth, sort the top surface last\n if (a.corners === top) return 1;\n if (b.corners === top) return -1;\n\n // both are equal\n return 0;\n });\n\n // draw the ordered surfaces\n ctx.lineWidth = this._getStrokeWidth(point);\n ctx.strokeStyle = borderColor;\n ctx.fillStyle = color;\n // NOTE: we start at j=2 instead of j=0 as we don't need to draw the two surfaces at the backside\n for (j = 2; j < surfaces.length; j++) {\n surface = surfaces[j];\n this._polygon(ctx, surface.corners);\n }\n};\n\n\n/**\n * Draw a polygon using the passed points and fill it with the passed style and stroke.\n *\n * @param points an array of points.\n * @param fillStyle optional; the fill style to set\n * @param strokeStyle optional; the stroke style to set\n */\nGraph3d.prototype._polygon = function(ctx, points, fillStyle, strokeStyle) {\n if (points.length < 2) {\n return;\n }\n\n if (fillStyle !== undefined) {\n ctx.fillStyle = fillStyle;\n }\n if (strokeStyle !== undefined) {\n ctx.strokeStyle = strokeStyle;\n }\n ctx.beginPath();\n ctx.moveTo(points[0].screen.x, points[0].screen.y);\n\n for (var i = 1; i < points.length; ++i) {\n var point = points[i];\n ctx.lineTo(point.screen.x, point.screen.y);\n }\n\n ctx.closePath();\n ctx.fill();\n ctx.stroke(); // TODO: only draw stroke when strokeWidth > 0\n};\n\n\n/**\n * @param size optional; if not specified use value from 'this._dotSize()`\n */\nGraph3d.prototype._drawCircle = function(ctx, point, color, borderColor, size) {\n var radius = this._calcRadius(point, size);\n\n ctx.lineWidth = this._getStrokeWidth(point);\n ctx.strokeStyle = borderColor;\n ctx.fillStyle = color;\n ctx.beginPath();\n ctx.arc(point.screen.x, point.screen.y, radius, 0, Math.PI*2, true);\n ctx.fill();\n ctx.stroke();\n};\n\n\n/**\n * Determine the colors for the 'regular' graph styles.\n */\nGraph3d.prototype._getColorsRegular = function(point) {\n // calculate Hue from the current value. At zMin the hue is 240, at zMax the hue is 0\n var hue = (1 - (point.point.z - this.zRange.min) * this.scale.z / this.verticalRatio) * 240;\n var color = this._hsv2rgb(hue, 1, 1);\n var borderColor = this._hsv2rgb(hue, 1, 0.8);\n\n return {\n fill : color,\n border: borderColor\n };\n};\n\n\n/**\n * Get the colors for the 'color' graph styles.\n * These styles are currently: 'bar-color' and 'dot-color'\n * Color may be set as a string representation of HTML color, like #ff00ff,\n * or calculated from a number, for example, distance from this point\n * The first option is useful when we have some pre-given legend, to which we have to adjust ourselves\n * The second option is useful when we are interested in automatically setting the color, from some value,\n * using some color scale\n */\nGraph3d.prototype._getColorsColor = function(point) {\n // calculate the color based on the value\n var color, borderColor;\n\n if (typeof point.point.value === \"string\") {\n color = point.point.value;\n borderColor = point.point.value;\n }\n else {\n var hue = (1 - (point.point.value - this.valueRange.min) * this.scale.value) * 240;\n color = this._hsv2rgb(hue, 1, 1);\n borderColor = this._hsv2rgb(hue, 1, 0.8);\n }\n return {\n fill : color,\n border : borderColor\n };\n};\n\n\n/**\n * Get the colors for the 'size' graph styles.\n * These styles are currently: 'bar-size' and 'dot-size'\n */\nGraph3d.prototype._getColorsSize = function() {\n return {\n fill : this.dataColor.fill,\n border : this.dataColor.stroke\n };\n};\n\n\n/**\n * Determine the size of a point on-screen, as determined by the\n * distance to the camera.\n *\n * @param size the size that needs to be translated to screen coordinates.\n * optional; if not passed, use the default point size.\n */\nGraph3d.prototype._calcRadius = function(point, size) {\n if (size === undefined) {\n size = this._dotSize();\n }\n\n var radius;\n if (this.showPerspective) {\n radius = size / -point.trans.z;\n }\n else {\n radius = size * -(this.eye.z / this.camera.getArmLength());\n }\n if (radius < 0) {\n radius = 0;\n }\n\n return radius;\n};\n\n\n// -----------------------------------------------------------------------------\n// Methods for drawing points per graph style.\n// -----------------------------------------------------------------------------\n\n\n/**\n * Draw single datapoint for graph style 'bar'.\n */\nGraph3d.prototype._redrawBarGraphPoint = function(ctx, point) {\n var xWidth = this.xBarWidth / 2;\n var yWidth = this.yBarWidth / 2;\n var colors = this._getColorsRegular(point);\n\n this._redrawBar(ctx, point, xWidth, yWidth, colors.fill, colors.border);\n};\n\n\n/**\n * Draw single datapoint for graph style 'bar-color'.\n */\nGraph3d.prototype._redrawBarColorGraphPoint = function(ctx, point) {\n var xWidth = this.xBarWidth / 2;\n var yWidth = this.yBarWidth / 2;\n var colors = this._getColorsColor(point);\n\n this._redrawBar(ctx, point, xWidth, yWidth, colors.fill, colors.border);\n};\n\n\n/**\n * Draw single datapoint for graph style 'bar-size'.\n */\nGraph3d.prototype._redrawBarSizeGraphPoint = function(ctx, point) {\n // calculate size for the bar\n var fraction = (point.point.value - this.valueRange.min) / this.valueRange.range();\n var xWidth = (this.xBarWidth / 2) * (fraction * 0.8 + 0.2);\n var yWidth = (this.yBarWidth / 2) * (fraction * 0.8 + 0.2);\n\n var colors = this._getColorsSize();\n\n this._redrawBar(ctx, point, xWidth, yWidth, colors.fill, colors.border);\n};\n\n\n/**\n * Draw single datapoint for graph style 'dot'.\n */\nGraph3d.prototype._redrawDotGraphPoint = function(ctx, point) {\n var colors = this._getColorsRegular(point);\n\n this._drawCircle(ctx, point, colors.fill, colors.border);\n};\n\n\n/**\n * Draw single datapoint for graph style 'dot-line'.\n */\nGraph3d.prototype._redrawDotLineGraphPoint = function(ctx, point) {\n // draw a vertical line from the XY-plane to the graph value\n var from = this._convert3Dto2D(point.bottom);\n ctx.lineWidth = 1;\n this._line(ctx, from, point.screen, this.gridColor);\n\n this._redrawDotGraphPoint(ctx, point);\n};\n\n\n/**\n * Draw single datapoint for graph style 'dot-color'.\n */\nGraph3d.prototype._redrawDotColorGraphPoint = function(ctx, point) {\n var colors = this._getColorsColor(point);\n\n this._drawCircle(ctx, point, colors.fill, colors.border);\n};\n\n\n/**\n * Draw single datapoint for graph style 'dot-size'.\n */\nGraph3d.prototype._redrawDotSizeGraphPoint = function(ctx, point) {\n var dotSize = this._dotSize();\n var fraction = (point.point.value - this.valueRange.min) / this.valueRange.range();\n var size = dotSize/2 + 2*dotSize * fraction;\n var colors = this._getColorsSize();\n\n this._drawCircle(ctx, point, colors.fill, colors.border, size);\n};\n\n\n/**\n * Draw single datapoint for graph style 'surface'.\n */\nGraph3d.prototype._redrawSurfaceGraphPoint = function(ctx, point) {\n var right = point.pointRight;\n var top = point.pointTop;\n var cross = point.pointCross;\n\n if (point === undefined || right === undefined || top === undefined || cross === undefined) {\n return;\n }\n\n var topSideVisible = true;\n var fillStyle;\n var strokeStyle;\n var lineWidth;\n\n if (this.showGrayBottom || this.showShadow) {\n // calculate the cross product of the two vectors from center\n // to left and right, in order to know whether we are looking at the\n // bottom or at the top side. We can also use the cross product\n // for calculating light intensity\n var aDiff = Point3d.subtract(cross.trans, point.trans);\n var bDiff = Point3d.subtract(top.trans, right.trans);\n var crossproduct = Point3d.crossProduct(aDiff, bDiff);\n var len = crossproduct.length();\n // FIXME: there is a bug with determining the surface side (shadow or colored)\n\n topSideVisible = (crossproduct.z > 0);\n }\n\n if (topSideVisible) {\n\n // calculate Hue from the current value. At zMin the hue is 240, at zMax the hue is 0\n var zAvg = (point.point.z + right.point.z + top.point.z + cross.point.z) / 4;\n var h = (1 - (zAvg - this.zRange.min) * this.scale.z / this.verticalRatio) * 240;\n var s = 1; // saturation\n var v;\n\n if (this.showShadow) {\n v = Math.min(1 + (crossproduct.x / len) / 2, 1); // value. TODO: scale\n fillStyle = this._hsv2rgb(h, s, v);\n strokeStyle = fillStyle;\n }\n else {\n v = 1;\n fillStyle = this._hsv2rgb(h, s, v);\n strokeStyle = this.axisColor; // TODO: should be customizable\n }\n }\n else {\n fillStyle = 'gray';\n strokeStyle = this.axisColor;\n }\n\n ctx.lineWidth = this._getStrokeWidth(point);\n // TODO: only draw stroke when strokeWidth > 0\n\n var points = [point, right, cross, top];\n this._polygon(ctx, points, fillStyle, strokeStyle);\n};\n\n\n/**\n * Helper method for _redrawGridGraphPoint()\n */\nGraph3d.prototype._drawGridLine = function(ctx, from, to) {\n if (from === undefined || to === undefined) {\n return;\n }\n\n // calculate Hue from the current value. At zMin the hue is 240, at zMax the hue is 0\n var zAvg = (from.point.z + to.point.z) / 2;\n var h = (1 - (zAvg - this.zRange.min) * this.scale.z / this.verticalRatio) * 240;\n\n ctx.lineWidth = this._getStrokeWidth(from) * 2;\n ctx.strokeStyle = this._hsv2rgb(h, 1, 1);\n this._line(ctx, from.screen, to.screen);\n};\n\n\n/**\n * Draw single datapoint for graph style 'Grid'.\n */\nGraph3d.prototype._redrawGridGraphPoint = function(ctx, point) {\n this._drawGridLine(ctx, point, point.pointRight);\n this._drawGridLine(ctx, point, point.pointTop);\n};\n\n\n/**\n * Draw single datapoint for graph style 'line'.\n */\nGraph3d.prototype._redrawLineGraphPoint = function(ctx, point) {\n if (point.pointNext === undefined) {\n return;\n }\n\n ctx.lineWidth = this._getStrokeWidth(point);\n ctx.strokeStyle = this.dataColor.stroke;\n\n this._line(ctx, point.screen, point.pointNext.screen);\n};\n\n\n/**\n * Draw all datapoints for currently selected graph style.\n *\n */\nGraph3d.prototype._redrawDataGraph = function() {\n var ctx = this._getContext();\n var i;\n\n if (this.dataPoints === undefined || this.dataPoints.length <= 0)\n return; // TODO: throw exception?\n\n this._calcTranslations(this.dataPoints);\n\n for (i = 0; i < this.dataPoints.length; i++) {\n var point = this.dataPoints[i];\n\n // Using call() ensures that the correct context is used\n this._pointDrawingMethod.call(this, ctx, point);\n }\n};\n\n\n// -----------------------------------------------------------------------------\n// End methods for drawing points per graph style.\n// -----------------------------------------------------------------------------\n\n/**\n * Store startX, startY and startOffset for mouse operations\n *\n * @param {Event} event The event that occurred\n */\nGraph3d.prototype._storeMousePosition = function(event) {\n // get mouse position (different code for IE and all other browsers)\n this.startMouseX = getMouseX(event);\n this.startMouseY = getMouseY(event);\n\n this._startCameraOffset = this.camera.getOffset();\n};\n\n\n/**\n * Start a moving operation inside the provided parent element\n * @param {Event} event The event that occurred (required for\n * retrieving the mouse position)\n */\nGraph3d.prototype._onMouseDown = function(event) {\n event = event || window.event;\n\n // check if mouse is still down (may be up when focus is lost for example\n // in an iframe)\n if (this.leftButtonDown) {\n this._onMouseUp(event);\n }\n\n // only react on left mouse button down\n this.leftButtonDown = event.which ? (event.which === 1) : (event.button === 1);\n if (!this.leftButtonDown && !this.touchDown) return;\n\n this._storeMousePosition(event);\n\n this.startStart = new Date(this.start);\n this.startEnd = new Date(this.end);\n this.startArmRotation = this.camera.getArmRotation();\n\n this.frame.style.cursor = 'move';\n\n // add event listeners to handle moving the contents\n // we store the function onmousemove and onmouseup in the graph, so we can\n // remove the eventlisteners lateron in the function mouseUp()\n var me = this;\n this.onmousemove = function (event) {me._onMouseMove(event);};\n this.onmouseup = function (event) {me._onMouseUp(event);};\n util.addEventListener(document, 'mousemove', me.onmousemove);\n util.addEventListener(document, 'mouseup', me.onmouseup);\n util.preventDefault(event);\n};\n\n\n/**\n * Perform moving operating.\n * This function activated from within the funcion Graph.mouseDown().\n * @param {Event} event Well, eehh, the event\n */\nGraph3d.prototype._onMouseMove = function (event) {\n this.moving = true;\n event = event || window.event;\n\n // calculate change in mouse position\n var diffX = parseFloat(getMouseX(event)) - this.startMouseX;\n var diffY = parseFloat(getMouseY(event)) - this.startMouseY;\n\n // move with ctrl or rotate by other\n if (event && event.ctrlKey === true) {\n // calculate change in mouse position\n var scaleX = this.frame.clientWidth * 0.5;\n var scaleY = this.frame.clientHeight * 0.5;\n\n var offXNew = (this._startCameraOffset.x || 0) - ((diffX / scaleX) * this.camera.armLength) * 0.8;\n var offYNew = (this._startCameraOffset.y || 0) + ((diffY / scaleY) * this.camera.armLength) * 0.8;\n\n this.camera.setOffset(offXNew, offYNew);\n this._storeMousePosition(event);\n } else {\n var horizontalNew = this.startArmRotation.horizontal + diffX / 200;\n var verticalNew = this.startArmRotation.vertical + diffY / 200;\n\n var snapAngle = 4; // degrees\n var snapValue = Math.sin(snapAngle / 360 * 2 * Math.PI);\n\n // snap horizontally to nice angles at 0pi, 0.5pi, 1pi, 1.5pi, etc...\n // the -0.001 is to take care that the vertical axis is always drawn at the left front corner\n if (Math.abs(Math.sin(horizontalNew)) < snapValue) {\n horizontalNew = Math.round(horizontalNew / Math.PI) * Math.PI - 0.001;\n }\n if (Math.abs(Math.cos(horizontalNew)) < snapValue) {\n horizontalNew = (Math.round(horizontalNew / Math.PI - 0.5) + 0.5) * Math.PI - 0.001;\n }\n\n // snap vertically to nice angles\n if (Math.abs(Math.sin(verticalNew)) < snapValue) {\n verticalNew = Math.round(verticalNew / Math.PI) * Math.PI;\n }\n if (Math.abs(Math.cos(verticalNew)) < snapValue) {\n verticalNew = (Math.round(verticalNew / Math.PI - 0.5) + 0.5) * Math.PI;\n }\n this.camera.setArmRotation(horizontalNew, verticalNew);\n }\n\n this.redraw();\n\n // fire a cameraPositionChange event\n var parameters = this.getCameraPosition();\n this.emit('cameraPositionChange', parameters);\n\n util.preventDefault(event);\n};\n\n\n/**\n * Stop moving operating.\n * This function activated from within the funcion Graph.mouseDown().\n * @param {event} event The event\n */\nGraph3d.prototype._onMouseUp = function (event) {\n this.frame.style.cursor = 'auto';\n this.leftButtonDown = false;\n\n // remove event listeners here\n util.removeEventListener(document, 'mousemove', this.onmousemove);\n util.removeEventListener(document, 'mouseup', this.onmouseup);\n util.preventDefault(event);\n};\n\n/**\n * @param {event} event The event\n */\nGraph3d.prototype._onClick = function (event) {\n if (!this.onclick_callback)\n return;\n if (!this.moving) {\n var boundingRect = this.frame.getBoundingClientRect();\n var mouseX = getMouseX(event) - boundingRect.left;\n var mouseY = getMouseY(event) - boundingRect.top;\n var dataPoint = this._dataPointFromXY(mouseX, mouseY);\n if (dataPoint)\n this.onclick_callback(dataPoint.point.data);\n }\n else { // disable onclick callback, if it came immediately after rotate/pan\n this.moving = false;\n }\n util.preventDefault(event);\n};\n\n/**\n * After having moved the mouse, a tooltip should pop up when the mouse is resting on a data point\n * @param {Event} event A mouse move event\n */\nGraph3d.prototype._onTooltip = function (event) {\n var delay = 300; // ms\n var boundingRect = this.frame.getBoundingClientRect();\n var mouseX = getMouseX(event) - boundingRect.left;\n var mouseY = getMouseY(event) - boundingRect.top;\n\n if (!this.showTooltip) {\n return;\n }\n\n if (this.tooltipTimeout) {\n clearTimeout(this.tooltipTimeout);\n }\n\n // (delayed) display of a tooltip only if no mouse button is down\n if (this.leftButtonDown) {\n this._hideTooltip();\n return;\n }\n\n if (this.tooltip && this.tooltip.dataPoint) {\n // tooltip is currently visible\n var dataPoint = this._dataPointFromXY(mouseX, mouseY);\n if (dataPoint !== this.tooltip.dataPoint) {\n // datapoint changed\n if (dataPoint) {\n this._showTooltip(dataPoint);\n }\n else {\n this._hideTooltip();\n }\n }\n }\n else {\n // tooltip is currently not visible\n var me = this;\n this.tooltipTimeout = setTimeout(function () {\n me.tooltipTimeout = null;\n\n // show a tooltip if we have a data point\n var dataPoint = me._dataPointFromXY(mouseX, mouseY);\n if (dataPoint) {\n me._showTooltip(dataPoint);\n }\n }, delay);\n }\n};\n\n/**\n * Event handler for touchstart event on mobile devices\n */\nGraph3d.prototype._onTouchStart = function(event) {\n this.touchDown = true;\n\n var me = this;\n this.ontouchmove = function (event) {me._onTouchMove(event);};\n this.ontouchend = function (event) {me._onTouchEnd(event);};\n util.addEventListener(document, 'touchmove', me.ontouchmove);\n util.addEventListener(document, 'touchend', me.ontouchend);\n\n this._onMouseDown(event);\n};\n\n/**\n * Event handler for touchmove event on mobile devices\n */\nGraph3d.prototype._onTouchMove = function(event) {\n this._onMouseMove(event);\n};\n\n/**\n * Event handler for touchend event on mobile devices\n */\nGraph3d.prototype._onTouchEnd = function(event) {\n this.touchDown = false;\n\n util.removeEventListener(document, 'touchmove', this.ontouchmove);\n util.removeEventListener(document, 'touchend', this.ontouchend);\n\n this._onMouseUp(event);\n};\n\n\n/**\n * Event handler for mouse wheel event, used to zoom the graph\n * Code from http://adomas.org/javascript-mouse-wheel/\n * @param {event} event The event\n */\nGraph3d.prototype._onWheel = function(event) {\n if (!event) /* For IE. */\n event = window.event;\n\n // retrieve delta\n var delta = 0;\n if (event.wheelDelta) { /* IE/Opera. */\n delta = event.wheelDelta/120;\n } else if (event.detail) { /* Mozilla case. */\n // In Mozilla, sign of delta is different than in IE.\n // Also, delta is multiple of 3.\n delta = -event.detail/3;\n }\n\n // If delta is nonzero, handle it.\n // Basically, delta is now positive if wheel was scrolled up,\n // and negative, if wheel was scrolled down.\n if (delta) {\n var oldLength = this.camera.getArmLength();\n var newLength = oldLength * (1 - delta / 10);\n\n this.camera.setArmLength(newLength);\n this.redraw();\n\n this._hideTooltip();\n }\n\n // fire a cameraPositionChange event\n var parameters = this.getCameraPosition();\n this.emit('cameraPositionChange', parameters);\n\n // Prevent default actions caused by mouse wheel.\n // That might be ugly, but we handle scrolls somehow\n // anyway, so don't bother here..\n util.preventDefault(event);\n};\n\n/**\n * Test whether a point lies inside given 2D triangle\n *\n * @param {Point2d} point\n * @param {Point2d[]} triangle\n * @returns {boolean} true if given point lies inside or on the edge of the\n * triangle, false otherwise\n * @private\n */\nGraph3d.prototype._insideTriangle = function (point, triangle) {\n var a = triangle[0],\n b = triangle[1],\n c = triangle[2];\n\n function sign (x) {\n return x > 0 ? 1 : x < 0 ? -1 : 0;\n }\n\n var as = sign((b.x - a.x) * (point.y - a.y) - (b.y - a.y) * (point.x - a.x));\n var bs = sign((c.x - b.x) * (point.y - b.y) - (c.y - b.y) * (point.x - b.x));\n var cs = sign((a.x - c.x) * (point.y - c.y) - (a.y - c.y) * (point.x - c.x));\n\n // each of the three signs must be either equal to each other or zero\n return (as == 0 || bs == 0 || as == bs) &&\n (bs == 0 || cs == 0 || bs == cs) &&\n (as == 0 || cs == 0 || as == cs);\n};\n\n/**\n * Find a data point close to given screen position (x, y)\n *\n * @param {Number} x\n * @param {Number} y\n * @returns {Object | null} The closest data point or null if not close to any\n * data point\n * @private\n */\nGraph3d.prototype._dataPointFromXY = function (x, y) {\n var i,\n distMax = 100, // px\n dataPoint = null,\n closestDataPoint = null,\n closestDist = null,\n center = new Point2d(x, y);\n\n if (this.style === Graph3d.STYLE.BAR ||\n this.style === Graph3d.STYLE.BARCOLOR ||\n this.style === Graph3d.STYLE.BARSIZE) {\n // the data points are ordered from far away to closest\n for (i = this.dataPoints.length - 1; i >= 0; i--) {\n dataPoint = this.dataPoints[i];\n var surfaces = dataPoint.surfaces;\n if (surfaces) {\n for (var s = surfaces.length - 1; s >= 0; s--) {\n // split each surface in two triangles, and see if the center point is inside one of these\n var surface = surfaces[s];\n var corners = surface.corners;\n var triangle1 = [corners[0].screen, corners[1].screen, corners[2].screen];\n var triangle2 = [corners[2].screen, corners[3].screen, corners[0].screen];\n if (this._insideTriangle(center, triangle1) ||\n this._insideTriangle(center, triangle2)) {\n // return immediately at the first hit\n return dataPoint;\n }\n }\n }\n }\n }\n else {\n // find the closest data point, using distance to the center of the point on 2d screen\n for (i = 0; i < this.dataPoints.length; i++) {\n dataPoint = this.dataPoints[i];\n var point = dataPoint.screen;\n if (point) {\n var distX = Math.abs(x - point.x);\n var distY = Math.abs(y - point.y);\n var dist = Math.sqrt(distX * distX + distY * distY);\n\n if ((closestDist === null || dist < closestDist) && dist < distMax) {\n closestDist = dist;\n closestDataPoint = dataPoint;\n }\n }\n }\n }\n\n\n return closestDataPoint;\n};\n\n/**\n * Display a tooltip for given data point\n * @param {Object} dataPoint\n * @private\n */\nGraph3d.prototype._showTooltip = function (dataPoint) {\n var content, line, dot;\n\n if (!this.tooltip) {\n content = document.createElement('div');\n content.style.position = 'absolute';\n content.style.padding = '10px';\n content.style.border = '1px solid #4d4d4d';\n content.style.color = '#1a1a1a';\n content.style.background = 'rgba(255,255,255,0.7)';\n content.style.borderRadius = '2px';\n content.style.boxShadow = '5px 5px 10px rgba(128,128,128,0.5)';\n\n line = document.createElement('div');\n line.style.position = 'absolute';\n line.style.height = '40px';\n line.style.width = '0';\n line.style.borderLeft = '1px solid #4d4d4d';\n\n dot = document.createElement('div');\n dot.style.position = 'absolute';\n dot.style.height = '0';\n dot.style.width = '0';\n dot.style.border = '5px solid #4d4d4d';\n dot.style.borderRadius = '5px';\n\n this.tooltip = {\n dataPoint: null,\n dom: {\n content: content,\n line: line,\n dot: dot\n }\n };\n }\n else {\n content = this.tooltip.dom.content;\n line = this.tooltip.dom.line;\n dot = this.tooltip.dom.dot;\n }\n\n this._hideTooltip();\n\n this.tooltip.dataPoint = dataPoint;\n if (typeof this.showTooltip === 'function') {\n content.innerHTML = this.showTooltip(dataPoint.point);\n }\n else {\n content.innerHTML = '' +\n '' +\n '' +\n '' +\n '
' + this.xLabel + ':' + dataPoint.point.x + '
' + this.yLabel + ':' + dataPoint.point.y + '
' + this.zLabel + ':' + dataPoint.point.z + '
';\n }\n\n content.style.left = '0';\n content.style.top = '0';\n this.frame.appendChild(content);\n this.frame.appendChild(line);\n this.frame.appendChild(dot);\n\n // calculate sizes\n var contentWidth = content.offsetWidth;\n var contentHeight = content.offsetHeight;\n var lineHeight = line.offsetHeight;\n var dotWidth = dot.offsetWidth;\n var dotHeight = dot.offsetHeight;\n\n var left = dataPoint.screen.x - contentWidth / 2;\n left = Math.min(Math.max(left, 10), this.frame.clientWidth - 10 - contentWidth);\n\n line.style.left = dataPoint.screen.x + 'px';\n line.style.top = (dataPoint.screen.y - lineHeight) + 'px';\n content.style.left = left + 'px';\n content.style.top = (dataPoint.screen.y - lineHeight - contentHeight) + 'px';\n dot.style.left = (dataPoint.screen.x - dotWidth / 2) + 'px';\n dot.style.top = (dataPoint.screen.y - dotHeight / 2) + 'px';\n};\n\n/**\n * Hide the tooltip when displayed\n * @private\n */\nGraph3d.prototype._hideTooltip = function () {\n if (this.tooltip) {\n this.tooltip.dataPoint = null;\n\n for (var prop in this.tooltip.dom) {\n if (this.tooltip.dom.hasOwnProperty(prop)) {\n var elem = this.tooltip.dom[prop];\n if (elem && elem.parentNode) {\n elem.parentNode.removeChild(elem);\n }\n }\n }\n }\n};\n\n/**--------------------------------------------------------------------------**/\n\n\n/**\n * Get the horizontal mouse position from a mouse event\n *\n * @param {Event} event\n * @returns {Number} mouse x\n */\nfunction getMouseX (event) {\n if ('clientX' in event) return event.clientX;\n return event.targetTouches[0] && event.targetTouches[0].clientX || 0;\n}\n\n/**\n * Get the vertical mouse position from a mouse event\n *\n * @param {Event} event\n * @returns {Number} mouse y\n */\nfunction getMouseY (event) {\n if ('clientY' in event) return event.clientY;\n return event.targetTouches[0] && event.targetTouches[0].clientY || 0;\n}\n\n\n// -----------------------------------------------------------------------------\n// Public methods for specific settings\n// -----------------------------------------------------------------------------\n\n/**\n * Set the rotation and distance of the camera\n *\n * @param {Object} pos An object with the camera position\n * @param {?Number} pos.horizontal The horizontal rotation, between 0 and 2*PI.\n * Optional, can be left undefined.\n * @param {?Number} pos.vertical The vertical rotation, between 0 and 0.5*PI.\n * if vertical=0.5*PI, the graph is shown from\n * the top. Optional, can be left undefined.\n * @param {?Number} pos.distance The (normalized) distance of the camera to the\n * center of the graph, a value between 0.71 and\n * 5.0. Optional, can be left undefined.\n */\nGraph3d.prototype.setCameraPosition = function(pos) {\n Settings.setCameraPosition(pos, this);\n this.redraw();\n};\n\n\n/**\n * Set a new size for the graph\n *\n * @param {string} width Width in pixels or percentage (for example '800px'\n * or '50%')\n * @param {string} height Height in pixels or percentage (for example '400px'\n * or '30%')\n */\nGraph3d.prototype.setSize = function(width, height) {\n\tthis._setSize(width, height);\n\tthis.redraw();\n};\n\n// -----------------------------------------------------------------------------\n// End public methods for specific settings\n// -----------------------------------------------------------------------------\n\n\nmodule.exports = Graph3d;\n\n\n// WEBPACK FOOTER //\n// ./lib/graph3d/Graph3d.js","\n/**\n * Expose `Emitter`.\n */\n\nmodule.exports = Emitter;\n\n/**\n * Initialize a new `Emitter`.\n *\n * @api public\n */\n\nfunction Emitter(obj) {\n if (obj) return mixin(obj);\n};\n\n/**\n * Mixin the emitter properties.\n *\n * @param {Object} obj\n * @return {Object}\n * @api private\n */\n\nfunction mixin(obj) {\n for (var key in Emitter.prototype) {\n obj[key] = Emitter.prototype[key];\n }\n return obj;\n}\n\n/**\n * Listen on the given `event` with `fn`.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.on =\nEmitter.prototype.addEventListener = function(event, fn){\n this._callbacks = this._callbacks || {};\n (this._callbacks[event] = this._callbacks[event] || [])\n .push(fn);\n return this;\n};\n\n/**\n * Adds an `event` listener that will be invoked a single\n * time then automatically removed.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.once = function(event, fn){\n var self = this;\n this._callbacks = this._callbacks || {};\n\n function on() {\n self.off(event, on);\n fn.apply(this, arguments);\n }\n\n on.fn = fn;\n this.on(event, on);\n return this;\n};\n\n/**\n * Remove the given callback for `event` or all\n * registered callbacks.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.off =\nEmitter.prototype.removeListener =\nEmitter.prototype.removeAllListeners =\nEmitter.prototype.removeEventListener = function(event, fn){\n this._callbacks = this._callbacks || {};\n\n // all\n if (0 == arguments.length) {\n this._callbacks = {};\n return this;\n }\n\n // specific event\n var callbacks = this._callbacks[event];\n if (!callbacks) return this;\n\n // remove all handlers\n if (1 == arguments.length) {\n delete this._callbacks[event];\n return this;\n }\n\n // remove specific handler\n var cb;\n for (var i = 0; i < callbacks.length; i++) {\n cb = callbacks[i];\n if (cb === fn || cb.fn === fn) {\n callbacks.splice(i, 1);\n break;\n }\n }\n return this;\n};\n\n/**\n * Emit `event` with the given args.\n *\n * @param {String} event\n * @param {Mixed} ...\n * @return {Emitter}\n */\n\nEmitter.prototype.emit = function(event){\n this._callbacks = this._callbacks || {};\n var args = [].slice.call(arguments, 1)\n , callbacks = this._callbacks[event];\n\n if (callbacks) {\n callbacks = callbacks.slice(0);\n for (var i = 0, len = callbacks.length; i < len; ++i) {\n callbacks[i].apply(this, args);\n }\n }\n\n return this;\n};\n\n/**\n * Return array of callbacks for `event`.\n *\n * @param {String} event\n * @return {Array}\n * @api public\n */\n\nEmitter.prototype.listeners = function(event){\n this._callbacks = this._callbacks || {};\n return this._callbacks[event] || [];\n};\n\n/**\n * Check if this emitter has `event` handlers.\n *\n * @param {String} event\n * @return {Boolean}\n * @api public\n */\n\nEmitter.prototype.hasListeners = function(event){\n return !! this.listeners(event).length;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/emitter-component/index.js\n// module id = 95\n// module chunks = 0","/**\n * @prototype Point3d\n * @param {Number} [x]\n * @param {Number} [y]\n * @param {Number} [z]\n */\nfunction Point3d(x, y, z) {\n this.x = x !== undefined ? x : 0;\n this.y = y !== undefined ? y : 0;\n this.z = z !== undefined ? z : 0;\n};\n\n/**\n * Subtract the two provided points, returns a-b\n * @param {Point3d} a\n * @param {Point3d} b\n * @return {Point3d} a-b\n */\nPoint3d.subtract = function(a, b) {\n var sub = new Point3d();\n sub.x = a.x - b.x;\n sub.y = a.y - b.y;\n sub.z = a.z - b.z;\n return sub;\n};\n\n/**\n * Add the two provided points, returns a+b\n * @param {Point3d} a\n * @param {Point3d} b\n * @return {Point3d} a+b\n */\nPoint3d.add = function(a, b) {\n var sum = new Point3d();\n sum.x = a.x + b.x;\n sum.y = a.y + b.y;\n sum.z = a.z + b.z;\n return sum;\n};\n\n/**\n * Calculate the average of two 3d points\n * @param {Point3d} a\n * @param {Point3d} b\n * @return {Point3d} The average, (a+b)/2\n */\nPoint3d.avg = function(a, b) {\n return new Point3d(\n (a.x + b.x) / 2,\n (a.y + b.y) / 2,\n (a.z + b.z) / 2\n );\n};\n\n/**\n * Calculate the cross product of the two provided points, returns axb\n * Documentation: http://en.wikipedia.org/wiki/Cross_product\n * @param {Point3d} a\n * @param {Point3d} b\n * @return {Point3d} cross product axb\n */\nPoint3d.crossProduct = function(a, b) {\n var crossproduct = new Point3d();\n\n crossproduct.x = a.y * b.z - a.z * b.y;\n crossproduct.y = a.z * b.x - a.x * b.z;\n crossproduct.z = a.x * b.y - a.y * b.x;\n\n return crossproduct;\n};\n\n\n/**\n * Rtrieve the length of the vector (or the distance from this point to the origin\n * @return {Number} length\n */\nPoint3d.prototype.length = function() {\n return Math.sqrt(\n this.x * this.x +\n this.y * this.y +\n this.z * this.z\n );\n};\n\nmodule.exports = Point3d;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/graph3d/Point3d.js","/**\n * @prototype Point2d\n * @param {Number} [x]\n * @param {Number} [y]\n */\nfunction Point2d (x, y) {\n this.x = x !== undefined ? x : 0;\n this.y = y !== undefined ? y : 0;\n}\n\nmodule.exports = Point2d;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/graph3d/Point2d.js","var Point3d = require('./Point3d');\n\n/**\n * @class Camera\n * The camera is mounted on a (virtual) camera arm. The camera arm can rotate\n * The camera is always looking in the direction of the origin of the arm.\n * This way, the camera always rotates around one fixed point, the location\n * of the camera arm.\n *\n * Documentation:\n * http://en.wikipedia.org/wiki/3D_projection\n */\nfunction Camera() {\n this.armLocation = new Point3d();\n this.armRotation = {};\n this.armRotation.horizontal = 0;\n this.armRotation.vertical = 0;\n this.armLength = 1.7;\n this.cameraOffset = new Point3d();\n this.offsetMultiplier = 0.6;\n\n this.cameraLocation = new Point3d();\n this.cameraRotation = new Point3d(0.5*Math.PI, 0, 0);\n\n this.calculateCameraOrientation();\n}\n\n/**\n * Set offset camera in camera coordinates\n * @param {Number} x offset by camera horisontal\n * @param {Number} y offset by camera vertical\n */\nCamera.prototype.setOffset = function(x, y) {\n var abs = Math.abs,\n sign = Math.sign,\n mul = this.offsetMultiplier,\n border = this.armLength * mul;\n\n if (abs(x) > border) {\n x = sign(x) * border;\n }\n if (abs(y) > border) {\n y = sign(y) * border;\n }\n this.cameraOffset.x = x;\n this.cameraOffset.y = y;\n this.calculateCameraOrientation();\n};\n\n/**\n * Get camera offset by horizontal and vertical\n * @return {Point3d} x - horizontal offset, y - vertical offset, z - not used\n */\nCamera.prototype.getOffset = function(x, y) {\n return this.cameraOffset;\n};\n\n/**\n * Set the location (origin) of the arm\n * @param {Number} x Normalized value of x\n * @param {Number} y Normalized value of y\n * @param {Number} z Normalized value of z\n */\nCamera.prototype.setArmLocation = function(x, y, z) {\n this.armLocation.x = x;\n this.armLocation.y = y;\n this.armLocation.z = z;\n\n this.calculateCameraOrientation();\n};\n\n/**\n * Set the rotation of the camera arm\n * @param {Number} horizontal The horizontal rotation, between 0 and 2*PI.\n * Optional, can be left undefined.\n * @param {Number} vertical The vertical rotation, between 0 and 0.5*PI\n * if vertical=0.5*PI, the graph is shown from the\n * top. Optional, can be left undefined.\n */\nCamera.prototype.setArmRotation = function(horizontal, vertical) {\n if (horizontal !== undefined) {\n this.armRotation.horizontal = horizontal;\n }\n\n if (vertical !== undefined) {\n this.armRotation.vertical = vertical;\n if (this.armRotation.vertical < 0) this.armRotation.vertical = 0;\n if (this.armRotation.vertical > 0.5*Math.PI) this.armRotation.vertical = 0.5*Math.PI;\n }\n\n if (horizontal !== undefined || vertical !== undefined) {\n this.calculateCameraOrientation();\n }\n};\n\n/**\n * Retrieve the current arm rotation\n * @return {object} An object with parameters horizontal and vertical\n */\nCamera.prototype.getArmRotation = function() {\n var rot = {};\n rot.horizontal = this.armRotation.horizontal;\n rot.vertical = this.armRotation.vertical;\n\n return rot;\n};\n\n/**\n * Set the (normalized) length of the camera arm.\n * @param {Number} length A length between 0.71 and 5.0\n */\nCamera.prototype.setArmLength = function(length) {\n if (length === undefined)\n return;\n\n this.armLength = length;\n\n // Radius must be larger than the corner of the graph,\n // which has a distance of sqrt(0.5^2+0.5^2) = 0.71 from the center of the\n // graph\n if (this.armLength < 0.71) this.armLength = 0.71;\n if (this.armLength > 5.0) this.armLength = 5.0;\n\n this.setOffset(this.cameraOffset.x, this.cameraOffset.y);\n this.calculateCameraOrientation();\n};\n\n/**\n * Retrieve the arm length\n * @return {Number} length\n */\nCamera.prototype.getArmLength = function() {\n return this.armLength;\n};\n\n/**\n * Retrieve the camera location\n * @return {Point3d} cameraLocation\n */\nCamera.prototype.getCameraLocation = function() {\n return this.cameraLocation;\n};\n\n/**\n * Retrieve the camera rotation\n * @return {Point3d} cameraRotation\n */\nCamera.prototype.getCameraRotation = function() {\n return this.cameraRotation;\n};\n\n/**\n * Calculate the location and rotation of the camera based on the\n * position and orientation of the camera arm\n */\nCamera.prototype.calculateCameraOrientation = function() {\n // calculate location of the camera\n this.cameraLocation.x = this.armLocation.x - this.armLength * Math.sin(this.armRotation.horizontal) * Math.cos(this.armRotation.vertical);\n this.cameraLocation.y = this.armLocation.y - this.armLength * Math.cos(this.armRotation.horizontal) * Math.cos(this.armRotation.vertical);\n this.cameraLocation.z = this.armLocation.z + this.armLength * Math.sin(this.armRotation.vertical);\n\n // calculate rotation of the camera\n this.cameraRotation.x = Math.PI/2 - this.armRotation.vertical;\n this.cameraRotation.y = 0;\n this.cameraRotation.z = -this.armRotation.horizontal;\n\n var xa = this.cameraRotation.x;\n var ya = this.cameraRotation.y;\n var za = this.cameraRotation.z;\n var dx = this.cameraOffset.x;\n var dy = this.cameraOffset.y;\n var sin = Math.sin, cos = Math.cos;\n\n this.cameraLocation.x = this.cameraLocation.x + dx * cos(za) + dy * - sin(za) * cos(xa);\n this.cameraLocation.y = this.cameraLocation.y + dx * sin(za) + dy * cos(za) * cos(xa);\n this.cameraLocation.z = this.cameraLocation.z + dy * sin(xa);\n};\n\nmodule.exports = Camera;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/graph3d/Camera.js","module.exports = { \"default\": require(\"core-js/library/fn/math/sign\"), __esModule: true };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/babel-runtime/core-js/math/sign.js\n// module id = 99\n// module chunks = 0","require('../../modules/es6.math.sign');\nmodule.exports = require('../../modules/_core').Math.sign;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/fn/math/sign.js\n// module id = 100\n// module chunks = 0","// 20.2.2.28 Math.sign(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {sign: require('./_math-sign')});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/es6.math.sign.js\n// module id = 101\n// module chunks = 0","// 20.2.2.28 Math.sign(x)\nmodule.exports = Math.sign || function sign(x){\n return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_math-sign.js\n// module id = 102\n// module chunks = 0","var DataView = require('../DataView');\n\n/**\n * @class Filter\n *\n * @param {DataSet} data The google data table\n * @param {Number} column The index of the column to be filtered\n * @param {Graph} graph The graph\n */\nfunction Filter (data, column, graph) {\n this.data = data;\n this.column = column;\n this.graph = graph; // the parent graph\n\n this.index = undefined;\n this.value = undefined;\n\n // read all distinct values and select the first one\n this.values = graph.getDistinctValues(data.get(), this.column);\n\n // sort both numeric and string values correctly\n this.values.sort(function (a, b) {\n return a > b ? 1 : a < b ? -1 : 0;\n });\n\n if (this.values.length > 0) {\n this.selectValue(0);\n }\n\n // create an array with the filtered datapoints. this will be loaded afterwards\n this.dataPoints = [];\n\n this.loaded = false;\n this.onLoadCallback = undefined;\n\n if (graph.animationPreload) {\n this.loaded = false;\n this.loadInBackground();\n }\n else {\n this.loaded = true;\n }\n};\n\n\n/**\n * Return the label\n * @return {string} label\n */\nFilter.prototype.isLoaded = function() {\n return this.loaded;\n};\n\n\n/**\n * Return the loaded progress\n * @return {Number} percentage between 0 and 100\n */\nFilter.prototype.getLoadedProgress = function() {\n var len = this.values.length;\n\n var i = 0;\n while (this.dataPoints[i]) {\n i++;\n }\n\n return Math.round(i / len * 100);\n};\n\n\n/**\n * Return the label\n * @return {string} label\n */\nFilter.prototype.getLabel = function() {\n return this.graph.filterLabel;\n};\n\n\n/**\n * Return the columnIndex of the filter\n * @return {Number} columnIndex\n */\nFilter.prototype.getColumn = function() {\n return this.column;\n};\n\n/**\n * Return the currently selected value. Returns undefined if there is no selection\n * @return {*} value\n */\nFilter.prototype.getSelectedValue = function() {\n if (this.index === undefined)\n return undefined;\n\n return this.values[this.index];\n};\n\n/**\n * Retrieve all values of the filter\n * @return {Array} values\n */\nFilter.prototype.getValues = function() {\n return this.values;\n};\n\n/**\n * Retrieve one value of the filter\n * @param {Number} index\n * @return {*} value\n */\nFilter.prototype.getValue = function(index) {\n if (index >= this.values.length)\n throw new Error('Index out of range');\n\n return this.values[index];\n};\n\n\n/**\n * Retrieve the (filtered) dataPoints for the currently selected filter index\n * @param {Number} [index] (optional)\n * @return {Array} dataPoints\n */\nFilter.prototype._getDataPoints = function(index) {\n if (index === undefined)\n index = this.index;\n\n if (index === undefined)\n return [];\n\n var dataPoints;\n if (this.dataPoints[index]) {\n dataPoints = this.dataPoints[index];\n }\n else {\n var f = {};\n f.column = this.column;\n f.value = this.values[index];\n\n var dataView = new DataView(this.data,{filter: function (item) {return (item[f.column] == f.value);}}).get();\n dataPoints = this.graph._getDataPoints(dataView);\n\n this.dataPoints[index] = dataPoints;\n }\n\n return dataPoints;\n};\n\n\n\n/**\n * Set a callback function when the filter is fully loaded.\n */\nFilter.prototype.setOnLoadCallback = function(callback) {\n this.onLoadCallback = callback;\n};\n\n\n/**\n * Add a value to the list with available values for this filter\n * No double entries will be created.\n * @param {Number} index\n */\nFilter.prototype.selectValue = function(index) {\n if (index >= this.values.length)\n throw new Error('Index out of range');\n\n this.index = index;\n this.value = this.values[index];\n};\n\n/**\n * Load all filtered rows in the background one by one\n * Start this method without providing an index!\n */\nFilter.prototype.loadInBackground = function(index) {\n if (index === undefined)\n index = 0;\n\n var frame = this.graph.frame;\n\n if (index < this.values.length) {\n var dataPointsTemp = this._getDataPoints(index);\n //this.graph.redrawInfo(); // TODO: not neat\n\n // create a progress box\n if (frame.progress === undefined) {\n frame.progress = document.createElement('DIV');\n frame.progress.style.position = 'absolute';\n frame.progress.style.color = 'gray';\n frame.appendChild(frame.progress);\n }\n var progress = this.getLoadedProgress();\n frame.progress.innerHTML = 'Loading animation... ' + progress + '%';\n // TODO: this is no nice solution...\n frame.progress.style.bottom = 60 + 'px'; // TODO: use height of slider\n frame.progress.style.left = 10 + 'px';\n\n var me = this;\n setTimeout(function() {me.loadInBackground(index+1);}, 10);\n this.loaded = false;\n }\n else {\n this.loaded = true;\n\n // remove the progress box\n if (frame.progress !== undefined) {\n frame.removeChild(frame.progress);\n frame.progress = undefined;\n }\n\n if (this.onLoadCallback)\n this.onLoadCallback();\n }\n};\n\nmodule.exports = Filter;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/graph3d/Filter.js","var util = require('../util');\n\n/**\n * @constructor Slider\n *\n * An html slider control with start/stop/prev/next buttons\n * @param {Element} container The element where the slider will be created\n * @param {Object} options Available options:\n * {boolean} visible If true (default) the\n * slider is visible.\n */\nfunction Slider(container, options) {\n if (container === undefined) {\n throw new Error('No container element defined');\n }\n this.container = container;\n this.visible = (options && options.visible != undefined) ? options.visible : true;\n\n if (this.visible) {\n this.frame = document.createElement('DIV');\n //this.frame.style.backgroundColor = '#E5E5E5';\n this.frame.style.width = '100%';\n this.frame.style.position = 'relative';\n this.container.appendChild(this.frame);\n\n this.frame.prev = document.createElement('INPUT');\n this.frame.prev.type = 'BUTTON';\n this.frame.prev.value = 'Prev';\n this.frame.appendChild(this.frame.prev);\n\n this.frame.play = document.createElement('INPUT');\n this.frame.play.type = 'BUTTON';\n this.frame.play.value = 'Play';\n this.frame.appendChild(this.frame.play);\n\n this.frame.next = document.createElement('INPUT');\n this.frame.next.type = 'BUTTON';\n this.frame.next.value = 'Next';\n this.frame.appendChild(this.frame.next);\n\n this.frame.bar = document.createElement('INPUT');\n this.frame.bar.type = 'BUTTON';\n this.frame.bar.style.position = 'absolute';\n this.frame.bar.style.border = '1px solid red';\n this.frame.bar.style.width = '100px';\n this.frame.bar.style.height = '6px';\n this.frame.bar.style.borderRadius = '2px';\n this.frame.bar.style.MozBorderRadius = '2px';\n this.frame.bar.style.border = '1px solid #7F7F7F';\n this.frame.bar.style.backgroundColor = '#E5E5E5';\n this.frame.appendChild(this.frame.bar);\n\n this.frame.slide = document.createElement('INPUT');\n this.frame.slide.type = 'BUTTON';\n this.frame.slide.style.margin = '0px';\n this.frame.slide.value = ' ';\n this.frame.slide.style.position = 'relative';\n this.frame.slide.style.left = '-100px';\n this.frame.appendChild(this.frame.slide);\n\n // create events\n var me = this;\n this.frame.slide.onmousedown = function (event) {me._onMouseDown(event);};\n this.frame.prev.onclick = function (event) {me.prev(event);};\n this.frame.play.onclick = function (event) {me.togglePlay(event);};\n this.frame.next.onclick = function (event) {me.next(event);};\n }\n\n this.onChangeCallback = undefined;\n\n this.values = [];\n this.index = undefined;\n\n this.playTimeout = undefined;\n this.playInterval = 1000; // milliseconds\n this.playLoop = true;\n}\n\n/**\n * Select the previous index\n */\nSlider.prototype.prev = function() {\n var index = this.getIndex();\n if (index > 0) {\n index--;\n this.setIndex(index);\n }\n};\n\n/**\n * Select the next index\n */\nSlider.prototype.next = function() {\n var index = this.getIndex();\n if (index < this.values.length - 1) {\n index++;\n this.setIndex(index);\n }\n};\n\n/**\n * Select the next index\n */\nSlider.prototype.playNext = function() {\n var start = new Date();\n\n var index = this.getIndex();\n if (index < this.values.length - 1) {\n index++;\n this.setIndex(index);\n }\n else if (this.playLoop) {\n // jump to the start\n index = 0;\n this.setIndex(index);\n }\n\n var end = new Date();\n var diff = (end - start);\n\n // calculate how much time it to to set the index and to execute the callback\n // function.\n var interval = Math.max(this.playInterval - diff, 0);\n // document.title = diff // TODO: cleanup\n\n var me = this;\n this.playTimeout = setTimeout(function() {me.playNext();}, interval);\n};\n\n/**\n * Toggle start or stop playing\n */\nSlider.prototype.togglePlay = function() {\n if (this.playTimeout === undefined) {\n this.play();\n } else {\n this.stop();\n }\n};\n\n/**\n * Start playing\n */\nSlider.prototype.play = function() {\n // Test whether already playing\n if (this.playTimeout) return;\n\n this.playNext();\n\n if (this.frame) {\n this.frame.play.value = 'Stop';\n }\n};\n\n/**\n * Stop playing\n */\nSlider.prototype.stop = function() {\n clearInterval(this.playTimeout);\n this.playTimeout = undefined;\n\n if (this.frame) {\n this.frame.play.value = 'Play';\n }\n};\n\n/**\n * Set a callback function which will be triggered when the value of the\n * slider bar has changed.\n */\nSlider.prototype.setOnChangeCallback = function(callback) {\n this.onChangeCallback = callback;\n};\n\n/**\n * Set the interval for playing the list\n * @param {Number} interval The interval in milliseconds\n */\nSlider.prototype.setPlayInterval = function(interval) {\n this.playInterval = interval;\n};\n\n/**\n * Retrieve the current play interval\n * @return {Number} interval The interval in milliseconds\n */\nSlider.prototype.getPlayInterval = function(interval) {\n return this.playInterval;\n};\n\n/**\n * Set looping on or off\n * @pararm {boolean} doLoop If true, the slider will jump to the start when\n * the end is passed, and will jump to the end\n * when the start is passed.\n */\nSlider.prototype.setPlayLoop = function(doLoop) {\n this.playLoop = doLoop;\n};\n\n\n/**\n * Execute the onchange callback function\n */\nSlider.prototype.onChange = function() {\n if (this.onChangeCallback !== undefined) {\n this.onChangeCallback();\n }\n};\n\n/**\n * redraw the slider on the correct place\n */\nSlider.prototype.redraw = function() {\n if (this.frame) {\n // resize the bar\n this.frame.bar.style.top = (this.frame.clientHeight/2 -\n this.frame.bar.offsetHeight/2) + 'px';\n this.frame.bar.style.width = (this.frame.clientWidth -\n this.frame.prev.clientWidth -\n this.frame.play.clientWidth -\n this.frame.next.clientWidth - 30) + 'px';\n\n // position the slider button\n var left = this.indexToLeft(this.index);\n this.frame.slide.style.left = (left) + 'px';\n }\n};\n\n\n/**\n * Set the list with values for the slider\n * @param {Array} values A javascript array with values (any type)\n */\nSlider.prototype.setValues = function(values) {\n this.values = values;\n\n if (this.values.length > 0)\n this.setIndex(0);\n else\n this.index = undefined;\n};\n\n/**\n * Select a value by its index\n * @param {Number} index\n */\nSlider.prototype.setIndex = function(index) {\n if (index < this.values.length) {\n this.index = index;\n\n this.redraw();\n this.onChange();\n }\n else {\n throw new Error('Index out of range');\n }\n};\n\n/**\n * retrieve the index of the currently selected vaue\n * @return {Number} index\n */\nSlider.prototype.getIndex = function() {\n return this.index;\n};\n\n\n/**\n * retrieve the currently selected value\n * @return {*} value\n */\nSlider.prototype.get = function() {\n return this.values[this.index];\n};\n\n\nSlider.prototype._onMouseDown = function(event) {\n // only react on left mouse button down\n var leftButtonDown = event.which ? (event.which === 1) : (event.button === 1);\n if (!leftButtonDown) return;\n\n this.startClientX = event.clientX;\n this.startSlideX = parseFloat(this.frame.slide.style.left);\n\n this.frame.style.cursor = 'move';\n\n // add event listeners to handle moving the contents\n // we store the function onmousemove and onmouseup in the graph, so we can\n // remove the eventlisteners lateron in the function mouseUp()\n var me = this;\n this.onmousemove = function (event) {me._onMouseMove(event);};\n this.onmouseup = function (event) {me._onMouseUp(event);};\n util.addEventListener(document, 'mousemove', this.onmousemove);\n util.addEventListener(document, 'mouseup', this.onmouseup);\n util.preventDefault(event);\n};\n\n\nSlider.prototype.leftToIndex = function (left) {\n var width = parseFloat(this.frame.bar.style.width) -\n this.frame.slide.clientWidth - 10;\n var x = left - 3;\n\n var index = Math.round(x / width * (this.values.length-1));\n if (index < 0) index = 0;\n if (index > this.values.length-1) index = this.values.length-1;\n\n return index;\n};\n\nSlider.prototype.indexToLeft = function (index) {\n var width = parseFloat(this.frame.bar.style.width) -\n this.frame.slide.clientWidth - 10;\n\n var x = index / (this.values.length-1) * width;\n var left = x + 3;\n\n return left;\n};\n\n\n\nSlider.prototype._onMouseMove = function (event) {\n var diff = event.clientX - this.startClientX;\n var x = this.startSlideX + diff;\n\n var index = this.leftToIndex(x);\n\n this.setIndex(index);\n\n util.preventDefault();\n};\n\n\nSlider.prototype._onMouseUp = function (event) {\n this.frame.style.cursor = 'auto';\n\n // remove event listeners\n util.removeEventListener(document, 'mousemove', this.onmousemove);\n util.removeEventListener(document, 'mouseup', this.onmouseup);\n\n util.preventDefault();\n};\n\nmodule.exports = Slider;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/graph3d/Slider.js","/**\n * @prototype StepNumber\n * The class StepNumber is an iterator for Numbers. You provide a start and end\n * value, and a best step size. StepNumber itself rounds to fixed values and\n * a finds the step that best fits the provided step.\n *\n * If prettyStep is true, the step size is chosen as close as possible to the\n * provided step, but being a round value like 1, 2, 5, 10, 20, 50, ....\n *\n * Example usage:\n * var step = new StepNumber(0, 10, 2.5, true);\n * step.start();\n * while (!step.end()) {\n * alert(step.getCurrent());\n * step.next();\n * }\n *\n * Version: 1.0\n *\n * @param {Number} start The start value\n * @param {Number} end The end value\n * @param {Number} step Optional. Step size. Must be a positive value.\n * @param {boolean} prettyStep Optional. If true, the step size is rounded\n * To a pretty step size (like 1, 2, 5, 10, 20, 50, ...)\n */\nfunction StepNumber(start, end, step, prettyStep) {\n // set default values\n this._start = 0;\n this._end = 0;\n this._step = 1;\n this.prettyStep = true;\n this.precision = 5;\n\n this._current = 0;\n this.setRange(start, end, step, prettyStep);\n};\n\n\n/**\n * Check for input values, to prevent disasters from happening\n *\n * Source: http://stackoverflow.com/a/1830844\n */\nStepNumber.prototype.isNumeric = function(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n};\n\n\n/**\n * Set a new range: start, end and step.\n *\n * @param {Number} start The start value\n * @param {Number} end The end value\n * @param {Number} step Optional. Step size. Must be a positive value.\n * @param {boolean} prettyStep Optional. If true, the step size is rounded\n * To a pretty step size (like 1, 2, 5, 10, 20, 50, ...)\n */\nStepNumber.prototype.setRange = function(start, end, step, prettyStep) {\n if (!this.isNumeric(start)) {\n throw new Error('Parameter \\'start\\' is not numeric; value: ' + start);\n }\n if (!this.isNumeric(end)) {\n throw new Error('Parameter \\'end\\' is not numeric; value: ' + start);\n }\n if (!this.isNumeric(step)) {\n throw new Error('Parameter \\'step\\' is not numeric; value: ' + start);\n }\n\n this._start = start ? start : 0;\n this._end = end ? end : 0;\n\n this.setStep(step, prettyStep);\n};\n\n/**\n * Set a new step size\n * @param {Number} step New step size. Must be a positive value\n * @param {boolean} prettyStep Optional. If true, the provided step is rounded\n * to a pretty step size (like 1, 2, 5, 10, 20, 50, ...)\n */\nStepNumber.prototype.setStep = function(step, prettyStep) {\n if (step === undefined || step <= 0)\n return;\n\n if (prettyStep !== undefined)\n this.prettyStep = prettyStep;\n\n if (this.prettyStep === true)\n this._step = StepNumber.calculatePrettyStep(step);\n else\n this._step = step;\n};\n\n/**\n * Calculate a nice step size, closest to the desired step size.\n * Returns a value in one of the ranges 1*10^n, 2*10^n, or 5*10^n, where n is an\n * integer Number. For example 1, 2, 5, 10, 20, 50, etc...\n * @param {Number} step Desired step size\n * @return {Number} Nice step size\n */\nStepNumber.calculatePrettyStep = function (step) {\n var log10 = function (x) {return Math.log(x) / Math.LN10;};\n\n // try three steps (multiple of 1, 2, or 5\n var step1 = Math.pow(10, Math.round(log10(step))),\n step2 = 2 * Math.pow(10, Math.round(log10(step / 2))),\n step5 = 5 * Math.pow(10, Math.round(log10(step / 5)));\n\n // choose the best step (closest to minimum step)\n var prettyStep = step1;\n if (Math.abs(step2 - step) <= Math.abs(prettyStep - step)) prettyStep = step2;\n if (Math.abs(step5 - step) <= Math.abs(prettyStep - step)) prettyStep = step5;\n\n // for safety\n if (prettyStep <= 0) {\n prettyStep = 1;\n }\n\n return prettyStep;\n};\n\n/**\n * returns the current value of the step\n * @return {Number} current value\n */\nStepNumber.prototype.getCurrent = function () {\n return parseFloat(this._current.toPrecision(this.precision));\n};\n\n/**\n * returns the current step size\n * @return {Number} current step size\n */\nStepNumber.prototype.getStep = function () {\n return this._step;\n};\n\n/**\n * Set the current to its starting value.\n *\n * By default, this will be the largest value smaller than start, which\n * is a multiple of the step size.\n *\n * Parameters checkFirst is optional, default false.\n * If set to true, move the current value one step if smaller than start.\n */\nStepNumber.prototype.start = function(checkFirst) {\n if (checkFirst === undefined) {\n checkFirst = false;\n }\n\n this._current = this._start - this._start % this._step;\n\n if (checkFirst) {\n if (this.getCurrent() < this._start) {\n this.next();\n }\n }\n};\n\n\n/**\n * Do a step, add the step size to the current value\n */\nStepNumber.prototype.next = function () {\n this._current += this._step;\n};\n\n/**\n * Returns true whether the end is reached\n * @return {boolean} True if the current value has passed the end value.\n */\nStepNumber.prototype.end = function () {\n return (this._current > this._end);\n};\n\nmodule.exports = StepNumber;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/graph3d/StepNumber.js","/**\n * @prototype Range\n *\n * Helper class to make working with related min and max values easier.\n *\n * The range is inclusive; a given value is considered part of the range if:\n *\n * this.min <= value <= this.max\n */\nfunction Range() {\n this.min = undefined;\n this.max = undefined;\n}\n\n\n/**\n * Adjust the range so that the passed value fits in it.\n *\n * If the value is outside of the current extremes, adjust\n * the min or max so that the value is within the range.\n *\n * @param {number} value Numeric value to fit in range\n */\nRange.prototype.adjust = function(value) {\n if (value === undefined) return;\n\n if (this.min === undefined || this.min > value ) {\n this.min = value;\n }\n\n if (this.max === undefined || this.max < value) {\n this.max = value;\n }\n};\n\n\n/**\n * Adjust the current range so that the passed range fits in it.\n *\n * @param {Range} range Range instance to fit in current instance\n */\nRange.prototype.combine = function(range) {\n this.add(range.min);\n this.add(range.max);\n};\n\n\n/**\n * Expand the range by the given value\n *\n * min will be lowered by given value;\n * max will be raised by given value\n *\n * Shrinking by passing a negative value is allowed.\n *\n * @param {number} val Amount by which to expand or shrink current range with\n */\nRange.prototype.expand = function(val) {\n if (val === undefined) {\n return;\n }\n\n var newMin = this.min - val;\n var newMax = this.max + val;\n\n // Note that following allows newMin === newMax.\n // This should be OK, since method expand() allows this also.\n if (newMin > newMax) {\n throw new Error('Passed expansion value makes range invalid');\n }\n\n this.min = newMin;\n this.max = newMax;\n};\n\n\n/**\n * Determine the full range width of current instance.\n *\n * @returns {num} The calculated width of this range\n */\nRange.prototype.range = function() {\n return this.max - this.min;\n};\n\n\n/**\n * Determine the central point of current instance.\n *\n * @returns {number} the value in the middle of min and max\n */\nRange.prototype.center = function() {\n return (this.min + this.max) / 2;\n};\n\n\nmodule.exports = Range;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/graph3d/Range.js","////////////////////////////////////////////////////////////////////////////////\n// This modules handles the options for Graph3d.\n//\n////////////////////////////////////////////////////////////////////////////////\nvar Camera = require('./Camera');\nvar Point3d = require('./Point3d');\n\n\n// enumerate the available styles\nvar STYLE = {\n BAR : 0,\n BARCOLOR: 1,\n BARSIZE : 2,\n DOT : 3,\n DOTLINE : 4,\n DOTCOLOR: 5,\n DOTSIZE : 6,\n GRID : 7,\n LINE : 8,\n SURFACE : 9\n};\n\n\n// The string representations of the styles\nvar STYLENAME = {\n 'dot' : STYLE.DOT,\n 'dot-line' : STYLE.DOTLINE,\n 'dot-color': STYLE.DOTCOLOR,\n 'dot-size' : STYLE.DOTSIZE,\n 'line' : STYLE.LINE,\n 'grid' : STYLE.GRID,\n 'surface' : STYLE.SURFACE,\n 'bar' : STYLE.BAR,\n 'bar-color': STYLE.BARCOLOR,\n 'bar-size' : STYLE.BARSIZE\n};\n\n\n/**\n * Field names in the options hash which are of relevance to the user.\n *\n * Specifically, these are the fields which require no special handling,\n * and can be directly copied over.\n */\nvar OPTIONKEYS = [\n 'width',\n 'height',\n 'filterLabel',\n 'legendLabel',\n 'xLabel',\n 'yLabel',\n 'zLabel',\n 'xValueLabel',\n 'yValueLabel',\n 'zValueLabel',\n 'showGrid',\n 'showPerspective',\n 'showShadow',\n 'keepAspectRatio',\n 'verticalRatio',\n 'dotSizeRatio',\n 'showAnimationControls',\n 'animationInterval',\n 'animationPreload',\n 'animationAutoStart',\n 'axisColor',\n 'gridColor',\n 'xCenter',\n 'yCenter'\n];\n\n\n/**\n * Field names in the options hash which are of relevance to the user.\n *\n * Same as OPTIONKEYS, but internally these fields are stored with \n * prefix 'default' in the name.\n */\nvar PREFIXEDOPTIONKEYS = [\n 'xBarWidth',\n 'yBarWidth',\n 'valueMin',\n 'valueMax',\n 'xMin',\n 'xMax',\n 'xStep',\n 'yMin',\n 'yMax',\n 'yStep',\n 'zMin',\n 'zMax',\n 'zStep'\n];\n\n\n// Placeholder for DEFAULTS reference\nvar DEFAULTS = undefined; \n\n\n/**\n * Check if given hash is empty.\n *\n * Source: http://stackoverflow.com/a/679937\n */\nfunction isEmpty(obj) {\n for(var prop in obj) {\n if (obj.hasOwnProperty(prop))\n return false;\n }\n\n return true;\n}\n\n\n\n/**\n * Make first letter of parameter upper case.\n *\n * Source: http://stackoverflow.com/a/1026087\n */\nfunction capitalize(str) {\n if (str === undefined || str === \"\" || typeof str != \"string\") {\n return str;\n }\n\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n\n\n/**\n * Add a prefix to a field name, taking style guide into account\n */\nfunction prefixFieldName(prefix, fieldName) {\n if (prefix === undefined || prefix === \"\") {\n return fieldName;\n }\n\n return prefix + capitalize(fieldName);\n}\n\n\n/**\n * Forcibly copy fields from src to dst in a controlled manner.\n *\n * A given field in dst will always be overwitten. If this field\n * is undefined or not present in src, the field in dst will \n * be explicitly set to undefined.\n * \n * The intention here is to be able to reset all option fields.\n * \n * Only the fields mentioned in array 'fields' will be handled.\n *\n * @param fields array with names of fields to copy\n * @param prefix optional; prefix to use for the target fields.\n */\nfunction forceCopy(src, dst, fields, prefix) {\n var srcKey;\n var dstKey;\n\n for (var i in fields) {\n srcKey = fields[i];\n dstKey = prefixFieldName(prefix, srcKey);\n\n dst[dstKey] = src[srcKey];\n }\n}\n\n\n/**\n * Copy fields from src to dst in a safe and controlled manner.\n *\n * Only the fields mentioned in array 'fields' will be copied over,\n * and only if these are actually defined.\n *\n * @param fields array with names of fields to copy\n * @param prefix optional; prefix to use for the target fields.\n */\nfunction safeCopy(src, dst, fields, prefix) {\n var srcKey;\n var dstKey;\n\n for (var i in fields) {\n srcKey = fields[i];\n if (src[srcKey] === undefined) continue;\n\n dstKey = prefixFieldName(prefix, srcKey);\n\n dst[dstKey] = src[srcKey];\n }\n}\n\n\n/**\n * Initialize dst with the values in src.\n *\n * src is the hash with the default values. \n * A reference DEFAULTS to this hash is stored locally for \n * further handling.\n *\n * For now, dst is assumed to be a Graph3d instance.\n */\nfunction setDefaults(src, dst) {\n if (src === undefined || isEmpty(src)) {\n throw new Error('No DEFAULTS passed');\n }\n if (dst === undefined) {\n throw new Error('No dst passed');\n }\n\n // Remember defaults for future reference\n DEFAULTS = src;\n\n // Handle the defaults which can be simply copied over\n forceCopy(src, dst, OPTIONKEYS);\n forceCopy(src, dst, PREFIXEDOPTIONKEYS, 'default');\n\n // Handle the more complex ('special') fields\n setSpecialSettings(src, dst);\n\n // Following are internal fields, not part of the user settings\n dst.margin = 10; // px\n dst.showGrayBottom = false; // TODO: this does not work correctly\n dst.showTooltip = false;\n dst.onclick_callback = null;\n dst.eye = new Point3d(0, 0, -1); // TODO: set eye.z about 3/4 of the width of the window?\n}\n\n\nfunction setOptions(options, dst) {\n if (options === undefined) {\n return;\n }\n if (dst === undefined) {\n throw new Error('No dst passed');\n }\n\n if (DEFAULTS === undefined || isEmpty(DEFAULTS)) {\n throw new Error('DEFAULTS not set for module Settings');\n }\n\n\n // Handle the parameters which can be simply copied over\n safeCopy(options, dst, OPTIONKEYS);\n safeCopy(options, dst, PREFIXEDOPTIONKEYS, 'default');\n\n // Handle the more complex ('special') fields\n setSpecialSettings(options, dst);\n}\n\n\n/**\n * Special handling for certain parameters\n *\n * 'Special' here means: setting requires more than a simple copy\n */\nfunction setSpecialSettings(src, dst) {\n if (src.backgroundColor !== undefined) {\n setBackgroundColor(src.backgroundColor, dst);\n }\n\n setDataColor(src.dataColor, dst);\n setStyle(src.style, dst);\n setShowLegend(src.showLegend, dst);\n setCameraPosition(src.cameraPosition, dst);\n\n // As special fields go, this is an easy one; just a translation of the name.\n // Can't use this.tooltip directly, because that field exists internally\n if (src.tooltip !== undefined) {\n dst.showTooltip = src.tooltip;\n }\n if (src.onclick != undefined) {\n dst.onclick_callback = src.onclick;\n }\n}\n\n\n/**\n * Set the value of setting 'showLegend'\n *\n * This depends on the value of the style fields, so it must be called\n * after the style field has been initialized.\n */\nfunction setShowLegend(showLegend, dst) {\n if (showLegend === undefined) {\n // If the default was auto, make a choice for this field\n var isAutoByDefault = (DEFAULTS.showLegend === undefined);\n\n if (isAutoByDefault) {\n // these styles default to having legends\n var isLegendGraphStyle = dst.style === STYLE.DOTCOLOR\n || dst.style === STYLE.DOTSIZE;\n\n dst.showLegend = isLegendGraphStyle;\n } else {\n // Leave current value as is\n }\n } else {\n dst.showLegend = showLegend;\n }\n}\n\n\n/**\n * Retrieve the style index from given styleName\n * @param {string} styleName Style name such as 'dot', 'grid', 'dot-line'\n * @return {Number} styleNumber Enumeration value representing the style, or -1\n * when not found\n */\nfunction getStyleNumberByName(styleName) {\n var number = STYLENAME[styleName];\n\n if (number === undefined) {\n return -1;\n }\n\n return number;\n}\n\n\n/**\n * Check if given number is a valid style number.\n *\n * @return true if valid, false otherwise\n */\nfunction checkStyleNumber(style) {\n var valid = false;\n\n for (var n in STYLE) {\n if (STYLE[n] === style) {\n valid = true;\n break;\n }\n }\n\n return valid;\n}\n\n\nfunction setStyle(style, dst) {\n if (style === undefined) {\n return; // Nothing to do\n }\n\n var styleNumber;\n\n if (typeof style === 'string') {\n styleNumber = getStyleNumberByName(style);\n\n if (styleNumber === -1 ) {\n throw new Error('Style \\'' + style + '\\' is invalid');\n }\n } else {\n // Do a pedantic check on style number value\n if (!checkStyleNumber(style)) {\n throw new Error('Style \\'' + style + '\\' is invalid');\n }\n\n styleNumber = style;\n }\n\n dst.style = styleNumber;\n}\n\n\n/**\n * Set the background styling for the graph\n * @param {string | {fill: string, stroke: string, strokeWidth: string}} backgroundColor\n */\nfunction setBackgroundColor(backgroundColor, dst) {\n var fill = 'white';\n var stroke = 'gray';\n var strokeWidth = 1;\n\n if (typeof(backgroundColor) === 'string') {\n fill = backgroundColor;\n stroke = 'none';\n strokeWidth = 0;\n }\n else if (typeof(backgroundColor) === 'object') {\n if (backgroundColor.fill !== undefined) fill = backgroundColor.fill;\n if (backgroundColor.stroke !== undefined) stroke = backgroundColor.stroke;\n if (backgroundColor.strokeWidth !== undefined) strokeWidth = backgroundColor.strokeWidth;\n }\n else {\n throw new Error('Unsupported type of backgroundColor');\n }\n\n dst.frame.style.backgroundColor = fill;\n dst.frame.style.borderColor = stroke;\n dst.frame.style.borderWidth = strokeWidth + 'px';\n dst.frame.style.borderStyle = 'solid';\n}\n\n\nfunction setDataColor(dataColor, dst) {\n if (dataColor === undefined) {\n return; // Nothing to do\n }\n\n if (dst.dataColor === undefined) {\n dst.dataColor = {};\n }\n\n if (typeof dataColor === 'string') {\n dst.dataColor.fill = dataColor;\n dst.dataColor.stroke = dataColor;\n }\n else {\n if (dataColor.fill) {\n dst.dataColor.fill = dataColor.fill;\n }\n if (dataColor.stroke) {\n dst.dataColor.stroke = dataColor.stroke;\n }\n if (dataColor.strokeWidth !== undefined) {\n dst.dataColor.strokeWidth = dataColor.strokeWidth;\n }\n }\n}\n\n\nfunction setCameraPosition(cameraPosition, dst) {\n var camPos = cameraPosition;\n if (camPos === undefined) {\n return;\n }\n\n if (dst.camera === undefined) {\n dst.camera = new Camera();\n }\n\n dst.camera.setArmRotation(camPos.horizontal, camPos.vertical);\n dst.camera.setArmLength(camPos.distance);\n}\n\n\nmodule.exports.STYLE = STYLE;\nmodule.exports.setDefaults = setDefaults;\nmodule.exports.setOptions = setOptions;\nmodule.exports.setCameraPosition = setCameraPosition;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/graph3d/Settings.js","// Only load hammer.js when in a browser environment\n// (loading hammer.js in a node.js environment gives errors)\nif (typeof window !== 'undefined') {\n var propagating = require('propagating-hammerjs');\n var Hammer = window['Hammer'] || require('hammerjs');\n module.exports = propagating(Hammer, {\n preventDefault: 'mouse'\n });\n}\nelse {\n module.exports = function () {\n throw Error('hammer.js is only available in a browser, not in node.js.');\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./lib/module/hammer.js","'use strict';\n\n(function (factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define([], factory);\n } else if (typeof exports === 'object') {\n // Node. Does not work with strict CommonJS, but\n // only CommonJS-like environments that support module.exports,\n // like Node.\n module.exports = factory();\n } else {\n // Browser globals (root is window)\n window.propagating = factory();\n }\n}(function () {\n var _firstTarget = null; // singleton, will contain the target element where the touch event started\n\n /**\n * Extend an Hammer.js instance with event propagation.\n *\n * Features:\n * - Events emitted by hammer will propagate in order from child to parent\n * elements.\n * - Events are extended with a function `event.stopPropagation()` to stop\n * propagation to parent elements.\n * - An option `preventDefault` to stop all default browser behavior.\n *\n * Usage:\n * var hammer = propagatingHammer(new Hammer(element));\n * var hammer = propagatingHammer(new Hammer(element), {preventDefault: true});\n *\n * @param {Hammer.Manager} hammer An hammer instance.\n * @param {Object} [options] Available options:\n * - `preventDefault: true | false | 'mouse' | 'touch' | 'pen'`.\n * Enforce preventing the default browser behavior.\n * Cannot be set to `false`.\n * @return {Hammer.Manager} Returns the same hammer instance with extended\n * functionality\n */\n return function propagating(hammer, options) {\n var _options = options || {\n preventDefault: false\n };\n\n if (hammer.Manager) {\n // This looks like the Hammer constructor.\n // Overload the constructors with our own.\n var Hammer = hammer;\n\n var PropagatingHammer = function(element, options) {\n var o = Object.create(_options);\n if (options) Hammer.assign(o, options);\n return propagating(new Hammer(element, o), o);\n };\n Hammer.assign(PropagatingHammer, Hammer);\n\n PropagatingHammer.Manager = function (element, options) {\n var o = Object.create(_options);\n if (options) Hammer.assign(o, options);\n return propagating(new Hammer.Manager(element, o), o);\n };\n\n return PropagatingHammer;\n }\n\n // create a wrapper object which will override the functions\n // `on`, `off`, `destroy`, and `emit` of the hammer instance\n var wrapper = Object.create(hammer);\n\n // attach to DOM element\n var element = hammer.element;\n\n if(!element.hammer) element.hammer = [];\n element.hammer.push(wrapper);\n\n // register an event to catch the start of a gesture and store the\n // target in a singleton\n hammer.on('hammer.input', function (event) {\n if (_options.preventDefault === true || (_options.preventDefault === event.pointerType)) {\n event.preventDefault();\n }\n if (event.isFirst) {\n _firstTarget = event.target;\n }\n });\n\n /** @type {Object.>} */\n wrapper._handlers = {};\n\n /**\n * Register a handler for one or multiple events\n * @param {String} events A space separated string with events\n * @param {function} handler A callback function, called as handler(event)\n * @returns {Hammer.Manager} Returns the hammer instance\n */\n wrapper.on = function (events, handler) {\n // register the handler\n split(events).forEach(function (event) {\n var _handlers = wrapper._handlers[event];\n if (!_handlers) {\n wrapper._handlers[event] = _handlers = [];\n\n // register the static, propagated handler\n hammer.on(event, propagatedHandler);\n }\n _handlers.push(handler);\n });\n\n return wrapper;\n };\n\n /**\n * Unregister a handler for one or multiple events\n * @param {String} events A space separated string with events\n * @param {function} [handler] Optional. The registered handler. If not\n * provided, all handlers for given events\n * are removed.\n * @returns {Hammer.Manager} Returns the hammer instance\n */\n wrapper.off = function (events, handler) {\n // unregister the handler\n split(events).forEach(function (event) {\n var _handlers = wrapper._handlers[event];\n if (_handlers) {\n _handlers = handler ? _handlers.filter(function (h) {\n return h !== handler;\n }) : [];\n\n if (_handlers.length > 0) {\n wrapper._handlers[event] = _handlers;\n }\n else {\n // remove static, propagated handler\n hammer.off(event, propagatedHandler);\n delete wrapper._handlers[event];\n }\n }\n });\n\n return wrapper;\n };\n\n /**\n * Emit to the event listeners\n * @param {string} eventType\n * @param {Event} event\n */\n wrapper.emit = function(eventType, event) {\n _firstTarget = event.target;\n hammer.emit(eventType, event);\n };\n\n wrapper.destroy = function () {\n // Detach from DOM element\n var hammers = hammer.element.hammer;\n var idx = hammers.indexOf(wrapper);\n if(idx !== -1) hammers.splice(idx,1);\n if(!hammers.length) delete hammer.element.hammer;\n\n // clear all handlers\n wrapper._handlers = {};\n\n // call original hammer destroy\n hammer.destroy();\n };\n\n // split a string with space separated words\n function split(events) {\n return events.match(/[^ ]+/g);\n }\n\n /**\n * A static event handler, applying event propagation.\n * @param {Object} event\n */\n function propagatedHandler(event) {\n // let only a single hammer instance handle this event\n if (event.type !== 'hammer.input') {\n // it is possible that the same srcEvent is used with multiple hammer events,\n // we keep track on which events are handled in an object _handled\n if (!event.srcEvent._handled) {\n event.srcEvent._handled = {};\n }\n\n if (event.srcEvent._handled[event.type]) {\n return;\n }\n else {\n event.srcEvent._handled[event.type] = true;\n }\n }\n\n // attach a stopPropagation function to the event\n var stopped = false;\n event.stopPropagation = function () {\n stopped = true;\n };\n\n //wrap the srcEvent's stopPropagation to also stop hammer propagation:\n var srcStop = event.srcEvent.stopPropagation.bind(event.srcEvent);\n if(typeof srcStop == \"function\") {\n event.srcEvent.stopPropagation = function(){\n srcStop();\n event.stopPropagation();\n }\n }\n\n // attach firstTarget property to the event\n event.firstTarget = _firstTarget;\n\n // propagate over all elements (until stopped)\n var elem = _firstTarget;\n while (elem && !stopped) {\n var elemHammer = elem.hammer;\n if(elemHammer){\n var _handlers;\n for(var k = 0; k < elemHammer.length; k++){\n _handlers = elemHammer[k]._handlers[event.type];\n if(_handlers) for (var i = 0; i < _handlers.length && !stopped; i++) {\n _handlers[i](event);\n }\n }\n }\n elem = elem.parentNode;\n }\n }\n\n return wrapper;\n };\n}));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/propagating-hammerjs/propagating.js\n// module id = 109\n// module chunks = 0","/*! Hammer.JS - v2.0.7 - 2016-04-22\n * http://hammerjs.github.io/\n *\n * Copyright (c) 2016 Jorik Tangelder;\n * Licensed under the MIT license */\n(function(window, document, exportName, undefined) {\n 'use strict';\n\nvar VENDOR_PREFIXES = ['', 'webkit', 'Moz', 'MS', 'ms', 'o'];\nvar TEST_ELEMENT = document.createElement('div');\n\nvar TYPE_FUNCTION = 'function';\n\nvar round = Math.round;\nvar abs = Math.abs;\nvar now = Date.now;\n\n/**\n * set a timeout with a given scope\n * @param {Function} fn\n * @param {Number} timeout\n * @param {Object} context\n * @returns {number}\n */\nfunction setTimeoutContext(fn, timeout, context) {\n return setTimeout(bindFn(fn, context), timeout);\n}\n\n/**\n * if the argument is an array, we want to execute the fn on each entry\n * if it aint an array we don't want to do a thing.\n * this is used by all the methods that accept a single and array argument.\n * @param {*|Array} arg\n * @param {String} fn\n * @param {Object} [context]\n * @returns {Boolean}\n */\nfunction invokeArrayArg(arg, fn, context) {\n if (Array.isArray(arg)) {\n each(arg, context[fn], context);\n return true;\n }\n return false;\n}\n\n/**\n * walk objects and arrays\n * @param {Object} obj\n * @param {Function} iterator\n * @param {Object} context\n */\nfunction each(obj, iterator, context) {\n var i;\n\n if (!obj) {\n return;\n }\n\n if (obj.forEach) {\n obj.forEach(iterator, context);\n } else if (obj.length !== undefined) {\n i = 0;\n while (i < obj.length) {\n iterator.call(context, obj[i], i, obj);\n i++;\n }\n } else {\n for (i in obj) {\n obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj);\n }\n }\n}\n\n/**\n * wrap a method with a deprecation warning and stack trace\n * @param {Function} method\n * @param {String} name\n * @param {String} message\n * @returns {Function} A new function wrapping the supplied method.\n */\nfunction deprecate(method, name, message) {\n var deprecationMessage = 'DEPRECATED METHOD: ' + name + '\\n' + message + ' AT \\n';\n return function() {\n var e = new Error('get-stack-trace');\n var stack = e && e.stack ? e.stack.replace(/^[^\\(]+?[\\n$]/gm, '')\n .replace(/^\\s+at\\s+/gm, '')\n .replace(/^Object.\\s*\\(/gm, '{anonymous}()@') : 'Unknown Stack Trace';\n\n var log = window.console && (window.console.warn || window.console.log);\n if (log) {\n log.call(window.console, deprecationMessage, stack);\n }\n return method.apply(this, arguments);\n };\n}\n\n/**\n * extend object.\n * means that properties in dest will be overwritten by the ones in src.\n * @param {Object} target\n * @param {...Object} objects_to_assign\n * @returns {Object} target\n */\nvar assign;\nif (typeof Object.assign !== 'function') {\n assign = function assign(target) {\n if (target === undefined || target === null) {\n throw new TypeError('Cannot convert undefined or null to object');\n }\n\n var output = Object(target);\n for (var index = 1; index < arguments.length; index++) {\n var source = arguments[index];\n if (source !== undefined && source !== null) {\n for (var nextKey in source) {\n if (source.hasOwnProperty(nextKey)) {\n output[nextKey] = source[nextKey];\n }\n }\n }\n }\n return output;\n };\n} else {\n assign = Object.assign;\n}\n\n/**\n * extend object.\n * means that properties in dest will be overwritten by the ones in src.\n * @param {Object} dest\n * @param {Object} src\n * @param {Boolean} [merge=false]\n * @returns {Object} dest\n */\nvar extend = deprecate(function extend(dest, src, merge) {\n var keys = Object.keys(src);\n var i = 0;\n while (i < keys.length) {\n if (!merge || (merge && dest[keys[i]] === undefined)) {\n dest[keys[i]] = src[keys[i]];\n }\n i++;\n }\n return dest;\n}, 'extend', 'Use `assign`.');\n\n/**\n * merge the values from src in the dest.\n * means that properties that exist in dest will not be overwritten by src\n * @param {Object} dest\n * @param {Object} src\n * @returns {Object} dest\n */\nvar merge = deprecate(function merge(dest, src) {\n return extend(dest, src, true);\n}, 'merge', 'Use `assign`.');\n\n/**\n * simple class inheritance\n * @param {Function} child\n * @param {Function} base\n * @param {Object} [properties]\n */\nfunction inherit(child, base, properties) {\n var baseP = base.prototype,\n childP;\n\n childP = child.prototype = Object.create(baseP);\n childP.constructor = child;\n childP._super = baseP;\n\n if (properties) {\n assign(childP, properties);\n }\n}\n\n/**\n * simple function bind\n * @param {Function} fn\n * @param {Object} context\n * @returns {Function}\n */\nfunction bindFn(fn, context) {\n return function boundFn() {\n return fn.apply(context, arguments);\n };\n}\n\n/**\n * let a boolean value also be a function that must return a boolean\n * this first item in args will be used as the context\n * @param {Boolean|Function} val\n * @param {Array} [args]\n * @returns {Boolean}\n */\nfunction boolOrFn(val, args) {\n if (typeof val == TYPE_FUNCTION) {\n return val.apply(args ? args[0] || undefined : undefined, args);\n }\n return val;\n}\n\n/**\n * use the val2 when val1 is undefined\n * @param {*} val1\n * @param {*} val2\n * @returns {*}\n */\nfunction ifUndefined(val1, val2) {\n return (val1 === undefined) ? val2 : val1;\n}\n\n/**\n * addEventListener with multiple events at once\n * @param {EventTarget} target\n * @param {String} types\n * @param {Function} handler\n */\nfunction addEventListeners(target, types, handler) {\n each(splitStr(types), function(type) {\n target.addEventListener(type, handler, false);\n });\n}\n\n/**\n * removeEventListener with multiple events at once\n * @param {EventTarget} target\n * @param {String} types\n * @param {Function} handler\n */\nfunction removeEventListeners(target, types, handler) {\n each(splitStr(types), function(type) {\n target.removeEventListener(type, handler, false);\n });\n}\n\n/**\n * find if a node is in the given parent\n * @method hasParent\n * @param {HTMLElement} node\n * @param {HTMLElement} parent\n * @return {Boolean} found\n */\nfunction hasParent(node, parent) {\n while (node) {\n if (node == parent) {\n return true;\n }\n node = node.parentNode;\n }\n return false;\n}\n\n/**\n * small indexOf wrapper\n * @param {String} str\n * @param {String} find\n * @returns {Boolean} found\n */\nfunction inStr(str, find) {\n return str.indexOf(find) > -1;\n}\n\n/**\n * split string on whitespace\n * @param {String} str\n * @returns {Array} words\n */\nfunction splitStr(str) {\n return str.trim().split(/\\s+/g);\n}\n\n/**\n * find if a array contains the object using indexOf or a simple polyFill\n * @param {Array} src\n * @param {String} find\n * @param {String} [findByKey]\n * @return {Boolean|Number} false when not found, or the index\n */\nfunction inArray(src, find, findByKey) {\n if (src.indexOf && !findByKey) {\n return src.indexOf(find);\n } else {\n var i = 0;\n while (i < src.length) {\n if ((findByKey && src[i][findByKey] == find) || (!findByKey && src[i] === find)) {\n return i;\n }\n i++;\n }\n return -1;\n }\n}\n\n/**\n * convert array-like objects to real arrays\n * @param {Object} obj\n * @returns {Array}\n */\nfunction toArray(obj) {\n return Array.prototype.slice.call(obj, 0);\n}\n\n/**\n * unique array with objects based on a key (like 'id') or just by the array's value\n * @param {Array} src [{id:1},{id:2},{id:1}]\n * @param {String} [key]\n * @param {Boolean} [sort=False]\n * @returns {Array} [{id:1},{id:2}]\n */\nfunction uniqueArray(src, key, sort) {\n var results = [];\n var values = [];\n var i = 0;\n\n while (i < src.length) {\n var val = key ? src[i][key] : src[i];\n if (inArray(values, val) < 0) {\n results.push(src[i]);\n }\n values[i] = val;\n i++;\n }\n\n if (sort) {\n if (!key) {\n results = results.sort();\n } else {\n results = results.sort(function sortUniqueArray(a, b) {\n return a[key] > b[key];\n });\n }\n }\n\n return results;\n}\n\n/**\n * get the prefixed property\n * @param {Object} obj\n * @param {String} property\n * @returns {String|Undefined} prefixed\n */\nfunction prefixed(obj, property) {\n var prefix, prop;\n var camelProp = property[0].toUpperCase() + property.slice(1);\n\n var i = 0;\n while (i < VENDOR_PREFIXES.length) {\n prefix = VENDOR_PREFIXES[i];\n prop = (prefix) ? prefix + camelProp : property;\n\n if (prop in obj) {\n return prop;\n }\n i++;\n }\n return undefined;\n}\n\n/**\n * get a unique id\n * @returns {number} uniqueId\n */\nvar _uniqueId = 1;\nfunction uniqueId() {\n return _uniqueId++;\n}\n\n/**\n * get the window object of an element\n * @param {HTMLElement} element\n * @returns {DocumentView|Window}\n */\nfunction getWindowForElement(element) {\n var doc = element.ownerDocument || element;\n return (doc.defaultView || doc.parentWindow || window);\n}\n\nvar MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;\n\nvar SUPPORT_TOUCH = ('ontouchstart' in window);\nvar SUPPORT_POINTER_EVENTS = prefixed(window, 'PointerEvent') !== undefined;\nvar SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);\n\nvar INPUT_TYPE_TOUCH = 'touch';\nvar INPUT_TYPE_PEN = 'pen';\nvar INPUT_TYPE_MOUSE = 'mouse';\nvar INPUT_TYPE_KINECT = 'kinect';\n\nvar COMPUTE_INTERVAL = 25;\n\nvar INPUT_START = 1;\nvar INPUT_MOVE = 2;\nvar INPUT_END = 4;\nvar INPUT_CANCEL = 8;\n\nvar DIRECTION_NONE = 1;\nvar DIRECTION_LEFT = 2;\nvar DIRECTION_RIGHT = 4;\nvar DIRECTION_UP = 8;\nvar DIRECTION_DOWN = 16;\n\nvar DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT;\nvar DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN;\nvar DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;\n\nvar PROPS_XY = ['x', 'y'];\nvar PROPS_CLIENT_XY = ['clientX', 'clientY'];\n\n/**\n * create new input type manager\n * @param {Manager} manager\n * @param {Function} callback\n * @returns {Input}\n * @constructor\n */\nfunction Input(manager, callback) {\n var self = this;\n this.manager = manager;\n this.callback = callback;\n this.element = manager.element;\n this.target = manager.options.inputTarget;\n\n // smaller wrapper around the handler, for the scope and the enabled state of the manager,\n // so when disabled the input events are completely bypassed.\n this.domHandler = function(ev) {\n if (boolOrFn(manager.options.enable, [manager])) {\n self.handler(ev);\n }\n };\n\n this.init();\n\n}\n\nInput.prototype = {\n /**\n * should handle the inputEvent data and trigger the callback\n * @virtual\n */\n handler: function() { },\n\n /**\n * bind the events\n */\n init: function() {\n this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);\n this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);\n this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);\n },\n\n /**\n * unbind the events\n */\n destroy: function() {\n this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);\n this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);\n this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);\n }\n};\n\n/**\n * create new input type manager\n * called by the Manager constructor\n * @param {Hammer} manager\n * @returns {Input}\n */\nfunction createInputInstance(manager) {\n var Type;\n var inputClass = manager.options.inputClass;\n\n if (inputClass) {\n Type = inputClass;\n } else if (SUPPORT_POINTER_EVENTS) {\n Type = PointerEventInput;\n } else if (SUPPORT_ONLY_TOUCH) {\n Type = TouchInput;\n } else if (!SUPPORT_TOUCH) {\n Type = MouseInput;\n } else {\n Type = TouchMouseInput;\n }\n return new (Type)(manager, inputHandler);\n}\n\n/**\n * handle input events\n * @param {Manager} manager\n * @param {String} eventType\n * @param {Object} input\n */\nfunction inputHandler(manager, eventType, input) {\n var pointersLen = input.pointers.length;\n var changedPointersLen = input.changedPointers.length;\n var isFirst = (eventType & INPUT_START && (pointersLen - changedPointersLen === 0));\n var isFinal = (eventType & (INPUT_END | INPUT_CANCEL) && (pointersLen - changedPointersLen === 0));\n\n input.isFirst = !!isFirst;\n input.isFinal = !!isFinal;\n\n if (isFirst) {\n manager.session = {};\n }\n\n // source event is the normalized value of the domEvents\n // like 'touchstart, mouseup, pointerdown'\n input.eventType = eventType;\n\n // compute scale, rotation etc\n computeInputData(manager, input);\n\n // emit secret event\n manager.emit('hammer.input', input);\n\n manager.recognize(input);\n manager.session.prevInput = input;\n}\n\n/**\n * extend the data with some usable properties like scale, rotate, velocity etc\n * @param {Object} manager\n * @param {Object} input\n */\nfunction computeInputData(manager, input) {\n var session = manager.session;\n var pointers = input.pointers;\n var pointersLength = pointers.length;\n\n // store the first input to calculate the distance and direction\n if (!session.firstInput) {\n session.firstInput = simpleCloneInputData(input);\n }\n\n // to compute scale and rotation we need to store the multiple touches\n if (pointersLength > 1 && !session.firstMultiple) {\n session.firstMultiple = simpleCloneInputData(input);\n } else if (pointersLength === 1) {\n session.firstMultiple = false;\n }\n\n var firstInput = session.firstInput;\n var firstMultiple = session.firstMultiple;\n var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;\n\n var center = input.center = getCenter(pointers);\n input.timeStamp = now();\n input.deltaTime = input.timeStamp - firstInput.timeStamp;\n\n input.angle = getAngle(offsetCenter, center);\n input.distance = getDistance(offsetCenter, center);\n\n computeDeltaXY(session, input);\n input.offsetDirection = getDirection(input.deltaX, input.deltaY);\n\n var overallVelocity = getVelocity(input.deltaTime, input.deltaX, input.deltaY);\n input.overallVelocityX = overallVelocity.x;\n input.overallVelocityY = overallVelocity.y;\n input.overallVelocity = (abs(overallVelocity.x) > abs(overallVelocity.y)) ? overallVelocity.x : overallVelocity.y;\n\n input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;\n input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;\n\n input.maxPointers = !session.prevInput ? input.pointers.length : ((input.pointers.length >\n session.prevInput.maxPointers) ? input.pointers.length : session.prevInput.maxPointers);\n\n computeIntervalInputData(session, input);\n\n // find the correct target\n var target = manager.element;\n if (hasParent(input.srcEvent.target, target)) {\n target = input.srcEvent.target;\n }\n input.target = target;\n}\n\nfunction computeDeltaXY(session, input) {\n var center = input.center;\n var offset = session.offsetDelta || {};\n var prevDelta = session.prevDelta || {};\n var prevInput = session.prevInput || {};\n\n if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) {\n prevDelta = session.prevDelta = {\n x: prevInput.deltaX || 0,\n y: prevInput.deltaY || 0\n };\n\n offset = session.offsetDelta = {\n x: center.x,\n y: center.y\n };\n }\n\n input.deltaX = prevDelta.x + (center.x - offset.x);\n input.deltaY = prevDelta.y + (center.y - offset.y);\n}\n\n/**\n * velocity is calculated every x ms\n * @param {Object} session\n * @param {Object} input\n */\nfunction computeIntervalInputData(session, input) {\n var last = session.lastInterval || input,\n deltaTime = input.timeStamp - last.timeStamp,\n velocity, velocityX, velocityY, direction;\n\n if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) {\n var deltaX = input.deltaX - last.deltaX;\n var deltaY = input.deltaY - last.deltaY;\n\n var v = getVelocity(deltaTime, deltaX, deltaY);\n velocityX = v.x;\n velocityY = v.y;\n velocity = (abs(v.x) > abs(v.y)) ? v.x : v.y;\n direction = getDirection(deltaX, deltaY);\n\n session.lastInterval = input;\n } else {\n // use latest velocity info if it doesn't overtake a minimum period\n velocity = last.velocity;\n velocityX = last.velocityX;\n velocityY = last.velocityY;\n direction = last.direction;\n }\n\n input.velocity = velocity;\n input.velocityX = velocityX;\n input.velocityY = velocityY;\n input.direction = direction;\n}\n\n/**\n * create a simple clone from the input used for storage of firstInput and firstMultiple\n * @param {Object} input\n * @returns {Object} clonedInputData\n */\nfunction simpleCloneInputData(input) {\n // make a simple copy of the pointers because we will get a reference if we don't\n // we only need clientXY for the calculations\n var pointers = [];\n var i = 0;\n while (i < input.pointers.length) {\n pointers[i] = {\n clientX: round(input.pointers[i].clientX),\n clientY: round(input.pointers[i].clientY)\n };\n i++;\n }\n\n return {\n timeStamp: now(),\n pointers: pointers,\n center: getCenter(pointers),\n deltaX: input.deltaX,\n deltaY: input.deltaY\n };\n}\n\n/**\n * get the center of all the pointers\n * @param {Array} pointers\n * @return {Object} center contains `x` and `y` properties\n */\nfunction getCenter(pointers) {\n var pointersLength = pointers.length;\n\n // no need to loop when only one touch\n if (pointersLength === 1) {\n return {\n x: round(pointers[0].clientX),\n y: round(pointers[0].clientY)\n };\n }\n\n var x = 0, y = 0, i = 0;\n while (i < pointersLength) {\n x += pointers[i].clientX;\n y += pointers[i].clientY;\n i++;\n }\n\n return {\n x: round(x / pointersLength),\n y: round(y / pointersLength)\n };\n}\n\n/**\n * calculate the velocity between two points. unit is in px per ms.\n * @param {Number} deltaTime\n * @param {Number} x\n * @param {Number} y\n * @return {Object} velocity `x` and `y`\n */\nfunction getVelocity(deltaTime, x, y) {\n return {\n x: x / deltaTime || 0,\n y: y / deltaTime || 0\n };\n}\n\n/**\n * get the direction between two points\n * @param {Number} x\n * @param {Number} y\n * @return {Number} direction\n */\nfunction getDirection(x, y) {\n if (x === y) {\n return DIRECTION_NONE;\n }\n\n if (abs(x) >= abs(y)) {\n return x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;\n }\n return y < 0 ? DIRECTION_UP : DIRECTION_DOWN;\n}\n\n/**\n * calculate the absolute distance between two points\n * @param {Object} p1 {x, y}\n * @param {Object} p2 {x, y}\n * @param {Array} [props] containing x and y keys\n * @return {Number} distance\n */\nfunction getDistance(p1, p2, props) {\n if (!props) {\n props = PROPS_XY;\n }\n var x = p2[props[0]] - p1[props[0]],\n y = p2[props[1]] - p1[props[1]];\n\n return Math.sqrt((x * x) + (y * y));\n}\n\n/**\n * calculate the angle between two coordinates\n * @param {Object} p1\n * @param {Object} p2\n * @param {Array} [props] containing x and y keys\n * @return {Number} angle\n */\nfunction getAngle(p1, p2, props) {\n if (!props) {\n props = PROPS_XY;\n }\n var x = p2[props[0]] - p1[props[0]],\n y = p2[props[1]] - p1[props[1]];\n return Math.atan2(y, x) * 180 / Math.PI;\n}\n\n/**\n * calculate the rotation degrees between two pointersets\n * @param {Array} start array of pointers\n * @param {Array} end array of pointers\n * @return {Number} rotation\n */\nfunction getRotation(start, end) {\n return getAngle(end[1], end[0], PROPS_CLIENT_XY) + getAngle(start[1], start[0], PROPS_CLIENT_XY);\n}\n\n/**\n * calculate the scale factor between two pointersets\n * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out\n * @param {Array} start array of pointers\n * @param {Array} end array of pointers\n * @return {Number} scale\n */\nfunction getScale(start, end) {\n return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);\n}\n\nvar MOUSE_INPUT_MAP = {\n mousedown: INPUT_START,\n mousemove: INPUT_MOVE,\n mouseup: INPUT_END\n};\n\nvar MOUSE_ELEMENT_EVENTS = 'mousedown';\nvar MOUSE_WINDOW_EVENTS = 'mousemove mouseup';\n\n/**\n * Mouse events input\n * @constructor\n * @extends Input\n */\nfunction MouseInput() {\n this.evEl = MOUSE_ELEMENT_EVENTS;\n this.evWin = MOUSE_WINDOW_EVENTS;\n\n this.pressed = false; // mousedown state\n\n Input.apply(this, arguments);\n}\n\ninherit(MouseInput, Input, {\n /**\n * handle mouse events\n * @param {Object} ev\n */\n handler: function MEhandler(ev) {\n var eventType = MOUSE_INPUT_MAP[ev.type];\n\n // on start we want to have the left mouse button down\n if (eventType & INPUT_START && ev.button === 0) {\n this.pressed = true;\n }\n\n if (eventType & INPUT_MOVE && ev.which !== 1) {\n eventType = INPUT_END;\n }\n\n // mouse must be down\n if (!this.pressed) {\n return;\n }\n\n if (eventType & INPUT_END) {\n this.pressed = false;\n }\n\n this.callback(this.manager, eventType, {\n pointers: [ev],\n changedPointers: [ev],\n pointerType: INPUT_TYPE_MOUSE,\n srcEvent: ev\n });\n }\n});\n\nvar POINTER_INPUT_MAP = {\n pointerdown: INPUT_START,\n pointermove: INPUT_MOVE,\n pointerup: INPUT_END,\n pointercancel: INPUT_CANCEL,\n pointerout: INPUT_CANCEL\n};\n\n// in IE10 the pointer types is defined as an enum\nvar IE10_POINTER_TYPE_ENUM = {\n 2: INPUT_TYPE_TOUCH,\n 3: INPUT_TYPE_PEN,\n 4: INPUT_TYPE_MOUSE,\n 5: INPUT_TYPE_KINECT // see https://twitter.com/jacobrossi/status/480596438489890816\n};\n\nvar POINTER_ELEMENT_EVENTS = 'pointerdown';\nvar POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel';\n\n// IE10 has prefixed support, and case-sensitive\nif (window.MSPointerEvent && !window.PointerEvent) {\n POINTER_ELEMENT_EVENTS = 'MSPointerDown';\n POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';\n}\n\n/**\n * Pointer events input\n * @constructor\n * @extends Input\n */\nfunction PointerEventInput() {\n this.evEl = POINTER_ELEMENT_EVENTS;\n this.evWin = POINTER_WINDOW_EVENTS;\n\n Input.apply(this, arguments);\n\n this.store = (this.manager.session.pointerEvents = []);\n}\n\ninherit(PointerEventInput, Input, {\n /**\n * handle mouse events\n * @param {Object} ev\n */\n handler: function PEhandler(ev) {\n var store = this.store;\n var removePointer = false;\n\n var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');\n var eventType = POINTER_INPUT_MAP[eventTypeNormalized];\n var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;\n\n var isTouch = (pointerType == INPUT_TYPE_TOUCH);\n\n // get index of the event in the store\n var storeIndex = inArray(store, ev.pointerId, 'pointerId');\n\n // start and mouse must be down\n if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {\n if (storeIndex < 0) {\n store.push(ev);\n storeIndex = store.length - 1;\n }\n } else if (eventType & (INPUT_END | INPUT_CANCEL)) {\n removePointer = true;\n }\n\n // it not found, so the pointer hasn't been down (so it's probably a hover)\n if (storeIndex < 0) {\n return;\n }\n\n // update the event in the store\n store[storeIndex] = ev;\n\n this.callback(this.manager, eventType, {\n pointers: store,\n changedPointers: [ev],\n pointerType: pointerType,\n srcEvent: ev\n });\n\n if (removePointer) {\n // remove from the store\n store.splice(storeIndex, 1);\n }\n }\n});\n\nvar SINGLE_TOUCH_INPUT_MAP = {\n touchstart: INPUT_START,\n touchmove: INPUT_MOVE,\n touchend: INPUT_END,\n touchcancel: INPUT_CANCEL\n};\n\nvar SINGLE_TOUCH_TARGET_EVENTS = 'touchstart';\nvar SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel';\n\n/**\n * Touch events input\n * @constructor\n * @extends Input\n */\nfunction SingleTouchInput() {\n this.evTarget = SINGLE_TOUCH_TARGET_EVENTS;\n this.evWin = SINGLE_TOUCH_WINDOW_EVENTS;\n this.started = false;\n\n Input.apply(this, arguments);\n}\n\ninherit(SingleTouchInput, Input, {\n handler: function TEhandler(ev) {\n var type = SINGLE_TOUCH_INPUT_MAP[ev.type];\n\n // should we handle the touch events?\n if (type === INPUT_START) {\n this.started = true;\n }\n\n if (!this.started) {\n return;\n }\n\n var touches = normalizeSingleTouches.call(this, ev, type);\n\n // when done, reset the started state\n if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) {\n this.started = false;\n }\n\n this.callback(this.manager, type, {\n pointers: touches[0],\n changedPointers: touches[1],\n pointerType: INPUT_TYPE_TOUCH,\n srcEvent: ev\n });\n }\n});\n\n/**\n * @this {TouchInput}\n * @param {Object} ev\n * @param {Number} type flag\n * @returns {undefined|Array} [all, changed]\n */\nfunction normalizeSingleTouches(ev, type) {\n var all = toArray(ev.touches);\n var changed = toArray(ev.changedTouches);\n\n if (type & (INPUT_END | INPUT_CANCEL)) {\n all = uniqueArray(all.concat(changed), 'identifier', true);\n }\n\n return [all, changed];\n}\n\nvar TOUCH_INPUT_MAP = {\n touchstart: INPUT_START,\n touchmove: INPUT_MOVE,\n touchend: INPUT_END,\n touchcancel: INPUT_CANCEL\n};\n\nvar TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel';\n\n/**\n * Multi-user touch events input\n * @constructor\n * @extends Input\n */\nfunction TouchInput() {\n this.evTarget = TOUCH_TARGET_EVENTS;\n this.targetIds = {};\n\n Input.apply(this, arguments);\n}\n\ninherit(TouchInput, Input, {\n handler: function MTEhandler(ev) {\n var type = TOUCH_INPUT_MAP[ev.type];\n var touches = getTouches.call(this, ev, type);\n if (!touches) {\n return;\n }\n\n this.callback(this.manager, type, {\n pointers: touches[0],\n changedPointers: touches[1],\n pointerType: INPUT_TYPE_TOUCH,\n srcEvent: ev\n });\n }\n});\n\n/**\n * @this {TouchInput}\n * @param {Object} ev\n * @param {Number} type flag\n * @returns {undefined|Array} [all, changed]\n */\nfunction getTouches(ev, type) {\n var allTouches = toArray(ev.touches);\n var targetIds = this.targetIds;\n\n // when there is only one touch, the process can be simplified\n if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {\n targetIds[allTouches[0].identifier] = true;\n return [allTouches, allTouches];\n }\n\n var i,\n targetTouches,\n changedTouches = toArray(ev.changedTouches),\n changedTargetTouches = [],\n target = this.target;\n\n // get target touches from touches\n targetTouches = allTouches.filter(function(touch) {\n return hasParent(touch.target, target);\n });\n\n // collect touches\n if (type === INPUT_START) {\n i = 0;\n while (i < targetTouches.length) {\n targetIds[targetTouches[i].identifier] = true;\n i++;\n }\n }\n\n // filter changed touches to only contain touches that exist in the collected target ids\n i = 0;\n while (i < changedTouches.length) {\n if (targetIds[changedTouches[i].identifier]) {\n changedTargetTouches.push(changedTouches[i]);\n }\n\n // cleanup removed touches\n if (type & (INPUT_END | INPUT_CANCEL)) {\n delete targetIds[changedTouches[i].identifier];\n }\n i++;\n }\n\n if (!changedTargetTouches.length) {\n return;\n }\n\n return [\n // merge targetTouches with changedTargetTouches so it contains ALL touches, including 'end' and 'cancel'\n uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier', true),\n changedTargetTouches\n ];\n}\n\n/**\n * Combined touch and mouse input\n *\n * Touch has a higher priority then mouse, and while touching no mouse events are allowed.\n * This because touch devices also emit mouse events while doing a touch.\n *\n * @constructor\n * @extends Input\n */\n\nvar DEDUP_TIMEOUT = 2500;\nvar DEDUP_DISTANCE = 25;\n\nfunction TouchMouseInput() {\n Input.apply(this, arguments);\n\n var handler = bindFn(this.handler, this);\n this.touch = new TouchInput(this.manager, handler);\n this.mouse = new MouseInput(this.manager, handler);\n\n this.primaryTouch = null;\n this.lastTouches = [];\n}\n\ninherit(TouchMouseInput, Input, {\n /**\n * handle mouse and touch events\n * @param {Hammer} manager\n * @param {String} inputEvent\n * @param {Object} inputData\n */\n handler: function TMEhandler(manager, inputEvent, inputData) {\n var isTouch = (inputData.pointerType == INPUT_TYPE_TOUCH),\n isMouse = (inputData.pointerType == INPUT_TYPE_MOUSE);\n\n if (isMouse && inputData.sourceCapabilities && inputData.sourceCapabilities.firesTouchEvents) {\n return;\n }\n\n // when we're in a touch event, record touches to de-dupe synthetic mouse event\n if (isTouch) {\n recordTouches.call(this, inputEvent, inputData);\n } else if (isMouse && isSyntheticEvent.call(this, inputData)) {\n return;\n }\n\n this.callback(manager, inputEvent, inputData);\n },\n\n /**\n * remove the event listeners\n */\n destroy: function destroy() {\n this.touch.destroy();\n this.mouse.destroy();\n }\n});\n\nfunction recordTouches(eventType, eventData) {\n if (eventType & INPUT_START) {\n this.primaryTouch = eventData.changedPointers[0].identifier;\n setLastTouch.call(this, eventData);\n } else if (eventType & (INPUT_END | INPUT_CANCEL)) {\n setLastTouch.call(this, eventData);\n }\n}\n\nfunction setLastTouch(eventData) {\n var touch = eventData.changedPointers[0];\n\n if (touch.identifier === this.primaryTouch) {\n var lastTouch = {x: touch.clientX, y: touch.clientY};\n this.lastTouches.push(lastTouch);\n var lts = this.lastTouches;\n var removeLastTouch = function() {\n var i = lts.indexOf(lastTouch);\n if (i > -1) {\n lts.splice(i, 1);\n }\n };\n setTimeout(removeLastTouch, DEDUP_TIMEOUT);\n }\n}\n\nfunction isSyntheticEvent(eventData) {\n var x = eventData.srcEvent.clientX, y = eventData.srcEvent.clientY;\n for (var i = 0; i < this.lastTouches.length; i++) {\n var t = this.lastTouches[i];\n var dx = Math.abs(x - t.x), dy = Math.abs(y - t.y);\n if (dx <= DEDUP_DISTANCE && dy <= DEDUP_DISTANCE) {\n return true;\n }\n }\n return false;\n}\n\nvar PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');\nvar NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined;\n\n// magical touchAction value\nvar TOUCH_ACTION_COMPUTE = 'compute';\nvar TOUCH_ACTION_AUTO = 'auto';\nvar TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented\nvar TOUCH_ACTION_NONE = 'none';\nvar TOUCH_ACTION_PAN_X = 'pan-x';\nvar TOUCH_ACTION_PAN_Y = 'pan-y';\nvar TOUCH_ACTION_MAP = getTouchActionProps();\n\n/**\n * Touch Action\n * sets the touchAction property or uses the js alternative\n * @param {Manager} manager\n * @param {String} value\n * @constructor\n */\nfunction TouchAction(manager, value) {\n this.manager = manager;\n this.set(value);\n}\n\nTouchAction.prototype = {\n /**\n * set the touchAction value on the element or enable the polyfill\n * @param {String} value\n */\n set: function(value) {\n // find out the touch-action by the event handlers\n if (value == TOUCH_ACTION_COMPUTE) {\n value = this.compute();\n }\n\n if (NATIVE_TOUCH_ACTION && this.manager.element.style && TOUCH_ACTION_MAP[value]) {\n this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;\n }\n this.actions = value.toLowerCase().trim();\n },\n\n /**\n * just re-set the touchAction value\n */\n update: function() {\n this.set(this.manager.options.touchAction);\n },\n\n /**\n * compute the value for the touchAction property based on the recognizer's settings\n * @returns {String} value\n */\n compute: function() {\n var actions = [];\n each(this.manager.recognizers, function(recognizer) {\n if (boolOrFn(recognizer.options.enable, [recognizer])) {\n actions = actions.concat(recognizer.getTouchAction());\n }\n });\n return cleanTouchActions(actions.join(' '));\n },\n\n /**\n * this method is called on each input cycle and provides the preventing of the browser behavior\n * @param {Object} input\n */\n preventDefaults: function(input) {\n var srcEvent = input.srcEvent;\n var direction = input.offsetDirection;\n\n // if the touch action did prevented once this session\n if (this.manager.session.prevented) {\n srcEvent.preventDefault();\n return;\n }\n\n var actions = this.actions;\n var hasNone = inStr(actions, TOUCH_ACTION_NONE) && !TOUCH_ACTION_MAP[TOUCH_ACTION_NONE];\n var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_Y];\n var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_X];\n\n if (hasNone) {\n //do not prevent defaults if this is a tap gesture\n\n var isTapPointer = input.pointers.length === 1;\n var isTapMovement = input.distance < 2;\n var isTapTouchTime = input.deltaTime < 250;\n\n if (isTapPointer && isTapMovement && isTapTouchTime) {\n return;\n }\n }\n\n if (hasPanX && hasPanY) {\n // `pan-x pan-y` means browser handles all scrolling/panning, do not prevent\n return;\n }\n\n if (hasNone ||\n (hasPanY && direction & DIRECTION_HORIZONTAL) ||\n (hasPanX && direction & DIRECTION_VERTICAL)) {\n return this.preventSrc(srcEvent);\n }\n },\n\n /**\n * call preventDefault to prevent the browser's default behavior (scrolling in most cases)\n * @param {Object} srcEvent\n */\n preventSrc: function(srcEvent) {\n this.manager.session.prevented = true;\n srcEvent.preventDefault();\n }\n};\n\n/**\n * when the touchActions are collected they are not a valid value, so we need to clean things up. *\n * @param {String} actions\n * @returns {*}\n */\nfunction cleanTouchActions(actions) {\n // none\n if (inStr(actions, TOUCH_ACTION_NONE)) {\n return TOUCH_ACTION_NONE;\n }\n\n var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);\n var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);\n\n // if both pan-x and pan-y are set (different recognizers\n // for different directions, e.g. horizontal pan but vertical swipe?)\n // we need none (as otherwise with pan-x pan-y combined none of these\n // recognizers will work, since the browser would handle all panning\n if (hasPanX && hasPanY) {\n return TOUCH_ACTION_NONE;\n }\n\n // pan-x OR pan-y\n if (hasPanX || hasPanY) {\n return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y;\n }\n\n // manipulation\n if (inStr(actions, TOUCH_ACTION_MANIPULATION)) {\n return TOUCH_ACTION_MANIPULATION;\n }\n\n return TOUCH_ACTION_AUTO;\n}\n\nfunction getTouchActionProps() {\n if (!NATIVE_TOUCH_ACTION) {\n return false;\n }\n var touchMap = {};\n var cssSupports = window.CSS && window.CSS.supports;\n ['auto', 'manipulation', 'pan-y', 'pan-x', 'pan-x pan-y', 'none'].forEach(function(val) {\n\n // If css.supports is not supported but there is native touch-action assume it supports\n // all values. This is the case for IE 10 and 11.\n touchMap[val] = cssSupports ? window.CSS.supports('touch-action', val) : true;\n });\n return touchMap;\n}\n\n/**\n * Recognizer flow explained; *\n * All recognizers have the initial state of POSSIBLE when a input session starts.\n * The definition of a input session is from the first input until the last input, with all it's movement in it. *\n * Example session for mouse-input: mousedown -> mousemove -> mouseup\n *\n * On each recognizing cycle (see Manager.recognize) the .recognize() method is executed\n * which determines with state it should be.\n *\n * If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals ENDED), it is reset to\n * POSSIBLE to give it another change on the next cycle.\n *\n * Possible\n * |\n * +-----+---------------+\n * | |\n * +-----+-----+ |\n * | | |\n * Failed Cancelled |\n * +-------+------+\n * | |\n * Recognized Began\n * |\n * Changed\n * |\n * Ended/Recognized\n */\nvar STATE_POSSIBLE = 1;\nvar STATE_BEGAN = 2;\nvar STATE_CHANGED = 4;\nvar STATE_ENDED = 8;\nvar STATE_RECOGNIZED = STATE_ENDED;\nvar STATE_CANCELLED = 16;\nvar STATE_FAILED = 32;\n\n/**\n * Recognizer\n * Every recognizer needs to extend from this class.\n * @constructor\n * @param {Object} options\n */\nfunction Recognizer(options) {\n this.options = assign({}, this.defaults, options || {});\n\n this.id = uniqueId();\n\n this.manager = null;\n\n // default is enable true\n this.options.enable = ifUndefined(this.options.enable, true);\n\n this.state = STATE_POSSIBLE;\n\n this.simultaneous = {};\n this.requireFail = [];\n}\n\nRecognizer.prototype = {\n /**\n * @virtual\n * @type {Object}\n */\n defaults: {},\n\n /**\n * set options\n * @param {Object} options\n * @return {Recognizer}\n */\n set: function(options) {\n assign(this.options, options);\n\n // also update the touchAction, in case something changed about the directions/enabled state\n this.manager && this.manager.touchAction.update();\n return this;\n },\n\n /**\n * recognize simultaneous with an other recognizer.\n * @param {Recognizer} otherRecognizer\n * @returns {Recognizer} this\n */\n recognizeWith: function(otherRecognizer) {\n if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) {\n return this;\n }\n\n var simultaneous = this.simultaneous;\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n if (!simultaneous[otherRecognizer.id]) {\n simultaneous[otherRecognizer.id] = otherRecognizer;\n otherRecognizer.recognizeWith(this);\n }\n return this;\n },\n\n /**\n * drop the simultaneous link. it doesnt remove the link on the other recognizer.\n * @param {Recognizer} otherRecognizer\n * @returns {Recognizer} this\n */\n dropRecognizeWith: function(otherRecognizer) {\n if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) {\n return this;\n }\n\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n delete this.simultaneous[otherRecognizer.id];\n return this;\n },\n\n /**\n * recognizer can only run when an other is failing\n * @param {Recognizer} otherRecognizer\n * @returns {Recognizer} this\n */\n requireFailure: function(otherRecognizer) {\n if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) {\n return this;\n }\n\n var requireFail = this.requireFail;\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n if (inArray(requireFail, otherRecognizer) === -1) {\n requireFail.push(otherRecognizer);\n otherRecognizer.requireFailure(this);\n }\n return this;\n },\n\n /**\n * drop the requireFailure link. it does not remove the link on the other recognizer.\n * @param {Recognizer} otherRecognizer\n * @returns {Recognizer} this\n */\n dropRequireFailure: function(otherRecognizer) {\n if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) {\n return this;\n }\n\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\n var index = inArray(this.requireFail, otherRecognizer);\n if (index > -1) {\n this.requireFail.splice(index, 1);\n }\n return this;\n },\n\n /**\n * has require failures boolean\n * @returns {boolean}\n */\n hasRequireFailures: function() {\n return this.requireFail.length > 0;\n },\n\n /**\n * if the recognizer can recognize simultaneous with an other recognizer\n * @param {Recognizer} otherRecognizer\n * @returns {Boolean}\n */\n canRecognizeWith: function(otherRecognizer) {\n return !!this.simultaneous[otherRecognizer.id];\n },\n\n /**\n * You should use `tryEmit` instead of `emit` directly to check\n * that all the needed recognizers has failed before emitting.\n * @param {Object} input\n */\n emit: function(input) {\n var self = this;\n var state = this.state;\n\n function emit(event) {\n self.manager.emit(event, input);\n }\n\n // 'panstart' and 'panmove'\n if (state < STATE_ENDED) {\n emit(self.options.event + stateStr(state));\n }\n\n emit(self.options.event); // simple 'eventName' events\n\n if (input.additionalEvent) { // additional event(panleft, panright, pinchin, pinchout...)\n emit(input.additionalEvent);\n }\n\n // panend and pancancel\n if (state >= STATE_ENDED) {\n emit(self.options.event + stateStr(state));\n }\n },\n\n /**\n * Check that all the require failure recognizers has failed,\n * if true, it emits a gesture event,\n * otherwise, setup the state to FAILED.\n * @param {Object} input\n */\n tryEmit: function(input) {\n if (this.canEmit()) {\n return this.emit(input);\n }\n // it's failing anyway\n this.state = STATE_FAILED;\n },\n\n /**\n * can we emit?\n * @returns {boolean}\n */\n canEmit: function() {\n var i = 0;\n while (i < this.requireFail.length) {\n if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) {\n return false;\n }\n i++;\n }\n return true;\n },\n\n /**\n * update the recognizer\n * @param {Object} inputData\n */\n recognize: function(inputData) {\n // make a new copy of the inputData\n // so we can change the inputData without messing up the other recognizers\n var inputDataClone = assign({}, inputData);\n\n // is is enabled and allow recognizing?\n if (!boolOrFn(this.options.enable, [this, inputDataClone])) {\n this.reset();\n this.state = STATE_FAILED;\n return;\n }\n\n // reset when we've reached the end\n if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) {\n this.state = STATE_POSSIBLE;\n }\n\n this.state = this.process(inputDataClone);\n\n // the recognizer has recognized a gesture\n // so trigger an event\n if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) {\n this.tryEmit(inputDataClone);\n }\n },\n\n /**\n * return the state of the recognizer\n * the actual recognizing happens in this method\n * @virtual\n * @param {Object} inputData\n * @returns {Const} STATE\n */\n process: function(inputData) { }, // jshint ignore:line\n\n /**\n * return the preferred touch-action\n * @virtual\n * @returns {Array}\n */\n getTouchAction: function() { },\n\n /**\n * called when the gesture isn't allowed to recognize\n * like when another is being recognized or it is disabled\n * @virtual\n */\n reset: function() { }\n};\n\n/**\n * get a usable string, used as event postfix\n * @param {Const} state\n * @returns {String} state\n */\nfunction stateStr(state) {\n if (state & STATE_CANCELLED) {\n return 'cancel';\n } else if (state & STATE_ENDED) {\n return 'end';\n } else if (state & STATE_CHANGED) {\n return 'move';\n } else if (state & STATE_BEGAN) {\n return 'start';\n }\n return '';\n}\n\n/**\n * direction cons to string\n * @param {Const} direction\n * @returns {String}\n */\nfunction directionStr(direction) {\n if (direction == DIRECTION_DOWN) {\n return 'down';\n } else if (direction == DIRECTION_UP) {\n return 'up';\n } else if (direction == DIRECTION_LEFT) {\n return 'left';\n } else if (direction == DIRECTION_RIGHT) {\n return 'right';\n }\n return '';\n}\n\n/**\n * get a recognizer by name if it is bound to a manager\n * @param {Recognizer|String} otherRecognizer\n * @param {Recognizer} recognizer\n * @returns {Recognizer}\n */\nfunction getRecognizerByNameIfManager(otherRecognizer, recognizer) {\n var manager = recognizer.manager;\n if (manager) {\n return manager.get(otherRecognizer);\n }\n return otherRecognizer;\n}\n\n/**\n * This recognizer is just used as a base for the simple attribute recognizers.\n * @constructor\n * @extends Recognizer\n */\nfunction AttrRecognizer() {\n Recognizer.apply(this, arguments);\n}\n\ninherit(AttrRecognizer, Recognizer, {\n /**\n * @namespace\n * @memberof AttrRecognizer\n */\n defaults: {\n /**\n * @type {Number}\n * @default 1\n */\n pointers: 1\n },\n\n /**\n * Used to check if it the recognizer receives valid input, like input.distance > 10.\n * @memberof AttrRecognizer\n * @param {Object} input\n * @returns {Boolean} recognized\n */\n attrTest: function(input) {\n var optionPointers = this.options.pointers;\n return optionPointers === 0 || input.pointers.length === optionPointers;\n },\n\n /**\n * Process the input and return the state for the recognizer\n * @memberof AttrRecognizer\n * @param {Object} input\n * @returns {*} State\n */\n process: function(input) {\n var state = this.state;\n var eventType = input.eventType;\n\n var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);\n var isValid = this.attrTest(input);\n\n // on cancel input and we've recognized before, return STATE_CANCELLED\n if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {\n return state | STATE_CANCELLED;\n } else if (isRecognized || isValid) {\n if (eventType & INPUT_END) {\n return state | STATE_ENDED;\n } else if (!(state & STATE_BEGAN)) {\n return STATE_BEGAN;\n }\n return state | STATE_CHANGED;\n }\n return STATE_FAILED;\n }\n});\n\n/**\n * Pan\n * Recognized when the pointer is down and moved in the allowed direction.\n * @constructor\n * @extends AttrRecognizer\n */\nfunction PanRecognizer() {\n AttrRecognizer.apply(this, arguments);\n\n this.pX = null;\n this.pY = null;\n}\n\ninherit(PanRecognizer, AttrRecognizer, {\n /**\n * @namespace\n * @memberof PanRecognizer\n */\n defaults: {\n event: 'pan',\n threshold: 10,\n pointers: 1,\n direction: DIRECTION_ALL\n },\n\n getTouchAction: function() {\n var direction = this.options.direction;\n var actions = [];\n if (direction & DIRECTION_HORIZONTAL) {\n actions.push(TOUCH_ACTION_PAN_Y);\n }\n if (direction & DIRECTION_VERTICAL) {\n actions.push(TOUCH_ACTION_PAN_X);\n }\n return actions;\n },\n\n directionTest: function(input) {\n var options = this.options;\n var hasMoved = true;\n var distance = input.distance;\n var direction = input.direction;\n var x = input.deltaX;\n var y = input.deltaY;\n\n // lock to axis?\n if (!(direction & options.direction)) {\n if (options.direction & DIRECTION_HORIZONTAL) {\n direction = (x === 0) ? DIRECTION_NONE : (x < 0) ? DIRECTION_LEFT : DIRECTION_RIGHT;\n hasMoved = x != this.pX;\n distance = Math.abs(input.deltaX);\n } else {\n direction = (y === 0) ? DIRECTION_NONE : (y < 0) ? DIRECTION_UP : DIRECTION_DOWN;\n hasMoved = y != this.pY;\n distance = Math.abs(input.deltaY);\n }\n }\n input.direction = direction;\n return hasMoved && distance > options.threshold && direction & options.direction;\n },\n\n attrTest: function(input) {\n return AttrRecognizer.prototype.attrTest.call(this, input) &&\n (this.state & STATE_BEGAN || (!(this.state & STATE_BEGAN) && this.directionTest(input)));\n },\n\n emit: function(input) {\n\n this.pX = input.deltaX;\n this.pY = input.deltaY;\n\n var direction = directionStr(input.direction);\n\n if (direction) {\n input.additionalEvent = this.options.event + direction;\n }\n this._super.emit.call(this, input);\n }\n});\n\n/**\n * Pinch\n * Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-out).\n * @constructor\n * @extends AttrRecognizer\n */\nfunction PinchRecognizer() {\n AttrRecognizer.apply(this, arguments);\n}\n\ninherit(PinchRecognizer, AttrRecognizer, {\n /**\n * @namespace\n * @memberof PinchRecognizer\n */\n defaults: {\n event: 'pinch',\n threshold: 0,\n pointers: 2\n },\n\n getTouchAction: function() {\n return [TOUCH_ACTION_NONE];\n },\n\n attrTest: function(input) {\n return this._super.attrTest.call(this, input) &&\n (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);\n },\n\n emit: function(input) {\n if (input.scale !== 1) {\n var inOut = input.scale < 1 ? 'in' : 'out';\n input.additionalEvent = this.options.event + inOut;\n }\n this._super.emit.call(this, input);\n }\n});\n\n/**\n * Press\n * Recognized when the pointer is down for x ms without any movement.\n * @constructor\n * @extends Recognizer\n */\nfunction PressRecognizer() {\n Recognizer.apply(this, arguments);\n\n this._timer = null;\n this._input = null;\n}\n\ninherit(PressRecognizer, Recognizer, {\n /**\n * @namespace\n * @memberof PressRecognizer\n */\n defaults: {\n event: 'press',\n pointers: 1,\n time: 251, // minimal time of the pointer to be pressed\n threshold: 9 // a minimal movement is ok, but keep it low\n },\n\n getTouchAction: function() {\n return [TOUCH_ACTION_AUTO];\n },\n\n process: function(input) {\n var options = this.options;\n var validPointers = input.pointers.length === options.pointers;\n var validMovement = input.distance < options.threshold;\n var validTime = input.deltaTime > options.time;\n\n this._input = input;\n\n // we only allow little movement\n // and we've reached an end event, so a tap is possible\n if (!validMovement || !validPointers || (input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime)) {\n this.reset();\n } else if (input.eventType & INPUT_START) {\n this.reset();\n this._timer = setTimeoutContext(function() {\n this.state = STATE_RECOGNIZED;\n this.tryEmit();\n }, options.time, this);\n } else if (input.eventType & INPUT_END) {\n return STATE_RECOGNIZED;\n }\n return STATE_FAILED;\n },\n\n reset: function() {\n clearTimeout(this._timer);\n },\n\n emit: function(input) {\n if (this.state !== STATE_RECOGNIZED) {\n return;\n }\n\n if (input && (input.eventType & INPUT_END)) {\n this.manager.emit(this.options.event + 'up', input);\n } else {\n this._input.timeStamp = now();\n this.manager.emit(this.options.event, this._input);\n }\n }\n});\n\n/**\n * Rotate\n * Recognized when two or more pointer are moving in a circular motion.\n * @constructor\n * @extends AttrRecognizer\n */\nfunction RotateRecognizer() {\n AttrRecognizer.apply(this, arguments);\n}\n\ninherit(RotateRecognizer, AttrRecognizer, {\n /**\n * @namespace\n * @memberof RotateRecognizer\n */\n defaults: {\n event: 'rotate',\n threshold: 0,\n pointers: 2\n },\n\n getTouchAction: function() {\n return [TOUCH_ACTION_NONE];\n },\n\n attrTest: function(input) {\n return this._super.attrTest.call(this, input) &&\n (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN);\n }\n});\n\n/**\n * Swipe\n * Recognized when the pointer is moving fast (velocity), with enough distance in the allowed direction.\n * @constructor\n * @extends AttrRecognizer\n */\nfunction SwipeRecognizer() {\n AttrRecognizer.apply(this, arguments);\n}\n\ninherit(SwipeRecognizer, AttrRecognizer, {\n /**\n * @namespace\n * @memberof SwipeRecognizer\n */\n defaults: {\n event: 'swipe',\n threshold: 10,\n velocity: 0.3,\n direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,\n pointers: 1\n },\n\n getTouchAction: function() {\n return PanRecognizer.prototype.getTouchAction.call(this);\n },\n\n attrTest: function(input) {\n var direction = this.options.direction;\n var velocity;\n\n if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {\n velocity = input.overallVelocity;\n } else if (direction & DIRECTION_HORIZONTAL) {\n velocity = input.overallVelocityX;\n } else if (direction & DIRECTION_VERTICAL) {\n velocity = input.overallVelocityY;\n }\n\n return this._super.attrTest.call(this, input) &&\n direction & input.offsetDirection &&\n input.distance > this.options.threshold &&\n input.maxPointers == this.options.pointers &&\n abs(velocity) > this.options.velocity && input.eventType & INPUT_END;\n },\n\n emit: function(input) {\n var direction = directionStr(input.offsetDirection);\n if (direction) {\n this.manager.emit(this.options.event + direction, input);\n }\n\n this.manager.emit(this.options.event, input);\n }\n});\n\n/**\n * A tap is ecognized when the pointer is doing a small tap/click. Multiple taps are recognized if they occur\n * between the given interval and position. The delay option can be used to recognize multi-taps without firing\n * a single tap.\n *\n * The eventData from the emitted event contains the property `tapCount`, which contains the amount of\n * multi-taps being recognized.\n * @constructor\n * @extends Recognizer\n */\nfunction TapRecognizer() {\n Recognizer.apply(this, arguments);\n\n // previous time and center,\n // used for tap counting\n this.pTime = false;\n this.pCenter = false;\n\n this._timer = null;\n this._input = null;\n this.count = 0;\n}\n\ninherit(TapRecognizer, Recognizer, {\n /**\n * @namespace\n * @memberof PinchRecognizer\n */\n defaults: {\n event: 'tap',\n pointers: 1,\n taps: 1,\n interval: 300, // max time between the multi-tap taps\n time: 250, // max time of the pointer to be down (like finger on the screen)\n threshold: 9, // a minimal movement is ok, but keep it low\n posThreshold: 10 // a multi-tap can be a bit off the initial position\n },\n\n getTouchAction: function() {\n return [TOUCH_ACTION_MANIPULATION];\n },\n\n process: function(input) {\n var options = this.options;\n\n var validPointers = input.pointers.length === options.pointers;\n var validMovement = input.distance < options.threshold;\n var validTouchTime = input.deltaTime < options.time;\n\n this.reset();\n\n if ((input.eventType & INPUT_START) && (this.count === 0)) {\n return this.failTimeout();\n }\n\n // we only allow little movement\n // and we've reached an end event, so a tap is possible\n if (validMovement && validTouchTime && validPointers) {\n if (input.eventType != INPUT_END) {\n return this.failTimeout();\n }\n\n var validInterval = this.pTime ? (input.timeStamp - this.pTime < options.interval) : true;\n var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold;\n\n this.pTime = input.timeStamp;\n this.pCenter = input.center;\n\n if (!validMultiTap || !validInterval) {\n this.count = 1;\n } else {\n this.count += 1;\n }\n\n this._input = input;\n\n // if tap count matches we have recognized it,\n // else it has began recognizing...\n var tapCount = this.count % options.taps;\n if (tapCount === 0) {\n // no failing requirements, immediately trigger the tap event\n // or wait as long as the multitap interval to trigger\n if (!this.hasRequireFailures()) {\n return STATE_RECOGNIZED;\n } else {\n this._timer = setTimeoutContext(function() {\n this.state = STATE_RECOGNIZED;\n this.tryEmit();\n }, options.interval, this);\n return STATE_BEGAN;\n }\n }\n }\n return STATE_FAILED;\n },\n\n failTimeout: function() {\n this._timer = setTimeoutContext(function() {\n this.state = STATE_FAILED;\n }, this.options.interval, this);\n return STATE_FAILED;\n },\n\n reset: function() {\n clearTimeout(this._timer);\n },\n\n emit: function() {\n if (this.state == STATE_RECOGNIZED) {\n this._input.tapCount = this.count;\n this.manager.emit(this.options.event, this._input);\n }\n }\n});\n\n/**\n * Simple way to create a manager with a default set of recognizers.\n * @param {HTMLElement} element\n * @param {Object} [options]\n * @constructor\n */\nfunction Hammer(element, options) {\n options = options || {};\n options.recognizers = ifUndefined(options.recognizers, Hammer.defaults.preset);\n return new Manager(element, options);\n}\n\n/**\n * @const {string}\n */\nHammer.VERSION = '2.0.7';\n\n/**\n * default settings\n * @namespace\n */\nHammer.defaults = {\n /**\n * set if DOM events are being triggered.\n * But this is slower and unused by simple implementations, so disabled by default.\n * @type {Boolean}\n * @default false\n */\n domEvents: false,\n\n /**\n * The value for the touchAction property/fallback.\n * When set to `compute` it will magically set the correct value based on the added recognizers.\n * @type {String}\n * @default compute\n */\n touchAction: TOUCH_ACTION_COMPUTE,\n\n /**\n * @type {Boolean}\n * @default true\n */\n enable: true,\n\n /**\n * EXPERIMENTAL FEATURE -- can be removed/changed\n * Change the parent input target element.\n * If Null, then it is being set the to main element.\n * @type {Null|EventTarget}\n * @default null\n */\n inputTarget: null,\n\n /**\n * force an input class\n * @type {Null|Function}\n * @default null\n */\n inputClass: null,\n\n /**\n * Default recognizer setup when calling `Hammer()`\n * When creating a new Manager these will be skipped.\n * @type {Array}\n */\n preset: [\n // RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...]\n [RotateRecognizer, {enable: false}],\n [PinchRecognizer, {enable: false}, ['rotate']],\n [SwipeRecognizer, {direction: DIRECTION_HORIZONTAL}],\n [PanRecognizer, {direction: DIRECTION_HORIZONTAL}, ['swipe']],\n [TapRecognizer],\n [TapRecognizer, {event: 'doubletap', taps: 2}, ['tap']],\n [PressRecognizer]\n ],\n\n /**\n * Some CSS properties can be used to improve the working of Hammer.\n * Add them to this method and they will be set when creating a new Manager.\n * @namespace\n */\n cssProps: {\n /**\n * Disables text selection to improve the dragging gesture. Mainly for desktop browsers.\n * @type {String}\n * @default 'none'\n */\n userSelect: 'none',\n\n /**\n * Disable the Windows Phone grippers when pressing an element.\n * @type {String}\n * @default 'none'\n */\n touchSelect: 'none',\n\n /**\n * Disables the default callout shown when you touch and hold a touch target.\n * On iOS, when you touch and hold a touch target such as a link, Safari displays\n * a callout containing information about the link. This property allows you to disable that callout.\n * @type {String}\n * @default 'none'\n */\n touchCallout: 'none',\n\n /**\n * Specifies whether zooming is enabled. Used by IE10>\n * @type {String}\n * @default 'none'\n */\n contentZooming: 'none',\n\n /**\n * Specifies that an entire element should be draggable instead of its contents. Mainly for desktop browsers.\n * @type {String}\n * @default 'none'\n */\n userDrag: 'none',\n\n /**\n * Overrides the highlight color shown when the user taps a link or a JavaScript\n * clickable element in iOS. This property obeys the alpha value, if specified.\n * @type {String}\n * @default 'rgba(0,0,0,0)'\n */\n tapHighlightColor: 'rgba(0,0,0,0)'\n }\n};\n\nvar STOP = 1;\nvar FORCED_STOP = 2;\n\n/**\n * Manager\n * @param {HTMLElement} element\n * @param {Object} [options]\n * @constructor\n */\nfunction Manager(element, options) {\n this.options = assign({}, Hammer.defaults, options || {});\n\n this.options.inputTarget = this.options.inputTarget || element;\n\n this.handlers = {};\n this.session = {};\n this.recognizers = [];\n this.oldCssProps = {};\n\n this.element = element;\n this.input = createInputInstance(this);\n this.touchAction = new TouchAction(this, this.options.touchAction);\n\n toggleCssProps(this, true);\n\n each(this.options.recognizers, function(item) {\n var recognizer = this.add(new (item[0])(item[1]));\n item[2] && recognizer.recognizeWith(item[2]);\n item[3] && recognizer.requireFailure(item[3]);\n }, this);\n}\n\nManager.prototype = {\n /**\n * set options\n * @param {Object} options\n * @returns {Manager}\n */\n set: function(options) {\n assign(this.options, options);\n\n // Options that need a little more setup\n if (options.touchAction) {\n this.touchAction.update();\n }\n if (options.inputTarget) {\n // Clean up existing event listeners and reinitialize\n this.input.destroy();\n this.input.target = options.inputTarget;\n this.input.init();\n }\n return this;\n },\n\n /**\n * stop recognizing for this session.\n * This session will be discarded, when a new [input]start event is fired.\n * When forced, the recognizer cycle is stopped immediately.\n * @param {Boolean} [force]\n */\n stop: function(force) {\n this.session.stopped = force ? FORCED_STOP : STOP;\n },\n\n /**\n * run the recognizers!\n * called by the inputHandler function on every movement of the pointers (touches)\n * it walks through all the recognizers and tries to detect the gesture that is being made\n * @param {Object} inputData\n */\n recognize: function(inputData) {\n var session = this.session;\n if (session.stopped) {\n return;\n }\n\n // run the touch-action polyfill\n this.touchAction.preventDefaults(inputData);\n\n var recognizer;\n var recognizers = this.recognizers;\n\n // this holds the recognizer that is being recognized.\n // so the recognizer's state needs to be BEGAN, CHANGED, ENDED or RECOGNIZED\n // if no recognizer is detecting a thing, it is set to `null`\n var curRecognizer = session.curRecognizer;\n\n // reset when the last recognizer is recognized\n // or when we're in a new session\n if (!curRecognizer || (curRecognizer && curRecognizer.state & STATE_RECOGNIZED)) {\n curRecognizer = session.curRecognizer = null;\n }\n\n var i = 0;\n while (i < recognizers.length) {\n recognizer = recognizers[i];\n\n // find out if we are allowed try to recognize the input for this one.\n // 1. allow if the session is NOT forced stopped (see the .stop() method)\n // 2. allow if we still haven't recognized a gesture in this session, or the this recognizer is the one\n // that is being recognized.\n // 3. allow if the recognizer is allowed to run simultaneous with the current recognized recognizer.\n // this can be setup with the `recognizeWith()` method on the recognizer.\n if (session.stopped !== FORCED_STOP && ( // 1\n !curRecognizer || recognizer == curRecognizer || // 2\n recognizer.canRecognizeWith(curRecognizer))) { // 3\n recognizer.recognize(inputData);\n } else {\n recognizer.reset();\n }\n\n // if the recognizer has been recognizing the input as a valid gesture, we want to store this one as the\n // current active recognizer. but only if we don't already have an active recognizer\n if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) {\n curRecognizer = session.curRecognizer = recognizer;\n }\n i++;\n }\n },\n\n /**\n * get a recognizer by its event name.\n * @param {Recognizer|String} recognizer\n * @returns {Recognizer|Null}\n */\n get: function(recognizer) {\n if (recognizer instanceof Recognizer) {\n return recognizer;\n }\n\n var recognizers = this.recognizers;\n for (var i = 0; i < recognizers.length; i++) {\n if (recognizers[i].options.event == recognizer) {\n return recognizers[i];\n }\n }\n return null;\n },\n\n /**\n * add a recognizer to the manager\n * existing recognizers with the same event name will be removed\n * @param {Recognizer} recognizer\n * @returns {Recognizer|Manager}\n */\n add: function(recognizer) {\n if (invokeArrayArg(recognizer, 'add', this)) {\n return this;\n }\n\n // remove existing\n var existing = this.get(recognizer.options.event);\n if (existing) {\n this.remove(existing);\n }\n\n this.recognizers.push(recognizer);\n recognizer.manager = this;\n\n this.touchAction.update();\n return recognizer;\n },\n\n /**\n * remove a recognizer by name or instance\n * @param {Recognizer|String} recognizer\n * @returns {Manager}\n */\n remove: function(recognizer) {\n if (invokeArrayArg(recognizer, 'remove', this)) {\n return this;\n }\n\n recognizer = this.get(recognizer);\n\n // let's make sure this recognizer exists\n if (recognizer) {\n var recognizers = this.recognizers;\n var index = inArray(recognizers, recognizer);\n\n if (index !== -1) {\n recognizers.splice(index, 1);\n this.touchAction.update();\n }\n }\n\n return this;\n },\n\n /**\n * bind event\n * @param {String} events\n * @param {Function} handler\n * @returns {EventEmitter} this\n */\n on: function(events, handler) {\n if (events === undefined) {\n return;\n }\n if (handler === undefined) {\n return;\n }\n\n var handlers = this.handlers;\n each(splitStr(events), function(event) {\n handlers[event] = handlers[event] || [];\n handlers[event].push(handler);\n });\n return this;\n },\n\n /**\n * unbind event, leave emit blank to remove all handlers\n * @param {String} events\n * @param {Function} [handler]\n * @returns {EventEmitter} this\n */\n off: function(events, handler) {\n if (events === undefined) {\n return;\n }\n\n var handlers = this.handlers;\n each(splitStr(events), function(event) {\n if (!handler) {\n delete handlers[event];\n } else {\n handlers[event] && handlers[event].splice(inArray(handlers[event], handler), 1);\n }\n });\n return this;\n },\n\n /**\n * emit event to the listeners\n * @param {String} event\n * @param {Object} data\n */\n emit: function(event, data) {\n // we also want to trigger dom events\n if (this.options.domEvents) {\n triggerDomEvent(event, data);\n }\n\n // no handlers, so skip it all\n var handlers = this.handlers[event] && this.handlers[event].slice();\n if (!handlers || !handlers.length) {\n return;\n }\n\n data.type = event;\n data.preventDefault = function() {\n data.srcEvent.preventDefault();\n };\n\n var i = 0;\n while (i < handlers.length) {\n handlers[i](data);\n i++;\n }\n },\n\n /**\n * destroy the manager and unbinds all events\n * it doesn't unbind dom events, that is the user own responsibility\n */\n destroy: function() {\n this.element && toggleCssProps(this, false);\n\n this.handlers = {};\n this.session = {};\n this.input.destroy();\n this.element = null;\n }\n};\n\n/**\n * add/remove the css properties as defined in manager.options.cssProps\n * @param {Manager} manager\n * @param {Boolean} add\n */\nfunction toggleCssProps(manager, add) {\n var element = manager.element;\n if (!element.style) {\n return;\n }\n var prop;\n each(manager.options.cssProps, function(value, name) {\n prop = prefixed(element.style, name);\n if (add) {\n manager.oldCssProps[prop] = element.style[prop];\n element.style[prop] = value;\n } else {\n element.style[prop] = manager.oldCssProps[prop] || '';\n }\n });\n if (!add) {\n manager.oldCssProps = {};\n }\n}\n\n/**\n * trigger dom event\n * @param {String} event\n * @param {Object} data\n */\nfunction triggerDomEvent(event, data) {\n var gestureEvent = document.createEvent('Event');\n gestureEvent.initEvent(event, true, true);\n gestureEvent.gesture = data;\n data.target.dispatchEvent(gestureEvent);\n}\n\nassign(Hammer, {\n INPUT_START: INPUT_START,\n INPUT_MOVE: INPUT_MOVE,\n INPUT_END: INPUT_END,\n INPUT_CANCEL: INPUT_CANCEL,\n\n STATE_POSSIBLE: STATE_POSSIBLE,\n STATE_BEGAN: STATE_BEGAN,\n STATE_CHANGED: STATE_CHANGED,\n STATE_ENDED: STATE_ENDED,\n STATE_RECOGNIZED: STATE_RECOGNIZED,\n STATE_CANCELLED: STATE_CANCELLED,\n STATE_FAILED: STATE_FAILED,\n\n DIRECTION_NONE: DIRECTION_NONE,\n DIRECTION_LEFT: DIRECTION_LEFT,\n DIRECTION_RIGHT: DIRECTION_RIGHT,\n DIRECTION_UP: DIRECTION_UP,\n DIRECTION_DOWN: DIRECTION_DOWN,\n DIRECTION_HORIZONTAL: DIRECTION_HORIZONTAL,\n DIRECTION_VERTICAL: DIRECTION_VERTICAL,\n DIRECTION_ALL: DIRECTION_ALL,\n\n Manager: Manager,\n Input: Input,\n TouchAction: TouchAction,\n\n TouchInput: TouchInput,\n MouseInput: MouseInput,\n PointerEventInput: PointerEventInput,\n TouchMouseInput: TouchMouseInput,\n SingleTouchInput: SingleTouchInput,\n\n Recognizer: Recognizer,\n AttrRecognizer: AttrRecognizer,\n Tap: TapRecognizer,\n Pan: PanRecognizer,\n Swipe: SwipeRecognizer,\n Pinch: PinchRecognizer,\n Rotate: RotateRecognizer,\n Press: PressRecognizer,\n\n on: addEventListeners,\n off: removeEventListeners,\n each: each,\n merge: merge,\n extend: extend,\n assign: assign,\n inherit: inherit,\n bindFn: bindFn,\n prefixed: prefixed\n});\n\n// this prevents errors when Hammer is loaded in the presence of an AMD\n// style loader but by script tag, not by the loader.\nvar freeGlobal = (typeof window !== 'undefined' ? window : (typeof self !== 'undefined' ? self : {})); // jshint ignore:line\nfreeGlobal.Hammer = Hammer;\n\nif (typeof define === 'function' && define.amd) {\n define(function() {\n return Hammer;\n });\n} else if (typeof module != 'undefined' && module.exports) {\n module.exports = Hammer;\n} else {\n window[exportName] = Hammer;\n}\n\n})(window, document, 'Hammer');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/hammerjs/hammer.js\n// module id = 110\n// module chunks = 0","\"use strict\";\r\n/**\r\n * Created by Alex on 11/6/2014.\r\n */\r\n\r\n// https://github.com/umdjs/umd/blob/master/returnExports.js#L40-L60\r\n// if the module has no dependencies, the above pattern can be simplified to\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n // AMD. Register as an anonymous module.\r\n define([], factory);\r\n } else if (typeof exports === 'object') {\r\n // Node. Does not work with strict CommonJS, but\r\n // only CommonJS-like environments that support module.exports,\r\n // like Node.\r\n module.exports = factory();\r\n } else {\r\n // Browser globals (root is window)\r\n root.keycharm = factory();\r\n }\r\n}(this, function () {\r\n\r\n function keycharm(options) {\r\n var preventDefault = options && options.preventDefault || false;\r\n\r\n var container = options && options.container || window;\r\n\r\n var _exportFunctions = {};\r\n var _bound = {keydown:{}, keyup:{}};\r\n var _keys = {};\r\n var i;\r\n\r\n // a - z\r\n for (i = 97; i <= 122; i++) {_keys[String.fromCharCode(i)] = {code:65 + (i - 97), shift: false};}\r\n // A - Z\r\n for (i = 65; i <= 90; i++) {_keys[String.fromCharCode(i)] = {code:i, shift: true};}\r\n // 0 - 9\r\n for (i = 0; i <= 9; i++) {_keys['' + i] = {code:48 + i, shift: false};}\r\n // F1 - F12\r\n for (i = 1; i <= 12; i++) {_keys['F' + i] = {code:111 + i, shift: false};}\r\n // num0 - num9\r\n for (i = 0; i <= 9; i++) {_keys['num' + i] = {code:96 + i, shift: false};}\r\n\r\n // numpad misc\r\n _keys['num*'] = {code:106, shift: false};\r\n _keys['num+'] = {code:107, shift: false};\r\n _keys['num-'] = {code:109, shift: false};\r\n _keys['num/'] = {code:111, shift: false};\r\n _keys['num.'] = {code:110, shift: false};\r\n // arrows\r\n _keys['left'] = {code:37, shift: false};\r\n _keys['up'] = {code:38, shift: false};\r\n _keys['right'] = {code:39, shift: false};\r\n _keys['down'] = {code:40, shift: false};\r\n // extra keys\r\n _keys['space'] = {code:32, shift: false};\r\n _keys['enter'] = {code:13, shift: false};\r\n _keys['shift'] = {code:16, shift: undefined};\r\n _keys['esc'] = {code:27, shift: false};\r\n _keys['backspace'] = {code:8, shift: false};\r\n _keys['tab'] = {code:9, shift: false};\r\n _keys['ctrl'] = {code:17, shift: false};\r\n _keys['alt'] = {code:18, shift: false};\r\n _keys['delete'] = {code:46, shift: false};\r\n _keys['pageup'] = {code:33, shift: false};\r\n _keys['pagedown'] = {code:34, shift: false};\r\n // symbols\r\n _keys['='] = {code:187, shift: false};\r\n _keys['-'] = {code:189, shift: false};\r\n _keys[']'] = {code:221, shift: false};\r\n _keys['['] = {code:219, shift: false};\r\n\r\n\r\n\r\n var down = function(event) {handleEvent(event,'keydown');};\r\n var up = function(event) {handleEvent(event,'keyup');};\r\n\r\n // handle the actualy bound key with the event\r\n var handleEvent = function(event,type) {\r\n if (_bound[type][event.keyCode] !== undefined) {\r\n var bound = _bound[type][event.keyCode];\r\n for (var i = 0; i < bound.length; i++) {\r\n if (bound[i].shift === undefined) {\r\n bound[i].fn(event);\r\n }\r\n else if (bound[i].shift == true && event.shiftKey == true) {\r\n bound[i].fn(event);\r\n }\r\n else if (bound[i].shift == false && event.shiftKey == false) {\r\n bound[i].fn(event);\r\n }\r\n }\r\n\r\n if (preventDefault == true) {\r\n event.preventDefault();\r\n }\r\n }\r\n };\r\n\r\n // bind a key to a callback\r\n _exportFunctions.bind = function(key, callback, type) {\r\n if (type === undefined) {\r\n type = 'keydown';\r\n }\r\n if (_keys[key] === undefined) {\r\n throw new Error(\"unsupported key: \" + key);\r\n }\r\n if (_bound[type][_keys[key].code] === undefined) {\r\n _bound[type][_keys[key].code] = [];\r\n }\r\n _bound[type][_keys[key].code].push({fn:callback, shift:_keys[key].shift});\r\n };\r\n\r\n\r\n // bind all keys to a call back (demo purposes)\r\n _exportFunctions.bindAll = function(callback, type) {\r\n if (type === undefined) {\r\n type = 'keydown';\r\n }\r\n for (var key in _keys) {\r\n if (_keys.hasOwnProperty(key)) {\r\n _exportFunctions.bind(key,callback,type);\r\n }\r\n }\r\n };\r\n\r\n // get the key label from an event\r\n _exportFunctions.getKey = function(event) {\r\n for (var key in _keys) {\r\n if (_keys.hasOwnProperty(key)) {\r\n if (event.shiftKey == true && _keys[key].shift == true && event.keyCode == _keys[key].code) {\r\n return key;\r\n }\r\n else if (event.shiftKey == false && _keys[key].shift == false && event.keyCode == _keys[key].code) {\r\n return key;\r\n }\r\n else if (event.keyCode == _keys[key].code && key == 'shift') {\r\n return key;\r\n }\r\n }\r\n }\r\n return \"unknown key, currently not supported\";\r\n };\r\n\r\n // unbind either a specific callback from a key or all of them (by leaving callback undefined)\r\n _exportFunctions.unbind = function(key, callback, type) {\r\n if (type === undefined) {\r\n type = 'keydown';\r\n }\r\n if (_keys[key] === undefined) {\r\n throw new Error(\"unsupported key: \" + key);\r\n }\r\n if (callback !== undefined) {\r\n var newBindings = [];\r\n var bound = _bound[type][_keys[key].code];\r\n if (bound !== undefined) {\r\n for (var i = 0; i < bound.length; i++) {\r\n if (!(bound[i].fn == callback && bound[i].shift == _keys[key].shift)) {\r\n newBindings.push(_bound[type][_keys[key].code][i]);\r\n }\r\n }\r\n }\r\n _bound[type][_keys[key].code] = newBindings;\r\n }\r\n else {\r\n _bound[type][_keys[key].code] = [];\r\n }\r\n };\r\n\r\n // reset all bound variables.\r\n _exportFunctions.reset = function() {\r\n _bound = {keydown:{}, keyup:{}};\r\n };\r\n\r\n // unbind all listeners and reset all variables.\r\n _exportFunctions.destroy = function() {\r\n _bound = {keydown:{}, keyup:{}};\r\n container.removeEventListener('keydown', down, true);\r\n container.removeEventListener('keyup', up, true);\r\n };\r\n\r\n // create listeners.\r\n container.addEventListener('keydown',down,true);\r\n container.addEventListener('keyup',up,true);\r\n\r\n // return the public functions.\r\n return _exportFunctions;\r\n }\r\n\r\n return keycharm;\r\n}));\r\n\r\n\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/keycharm/keycharm.js\n// module id = 111\n// module chunks = 0","// utils\nexports.util = require('./lib/util');\nexports.DOMutil = require('./lib/DOMutil');\n\n// data\nexports.DataSet = require('./lib/DataSet');\nexports.DataView = require('./lib/DataView');\nexports.Queue = require('./lib/Queue');\n\n// Timeline\nexports.Timeline = require('./lib/timeline/Timeline');\nexports.Graph2d = require('./lib/timeline/Graph2d');\nexports.timeline = {\n Core: require('./lib/timeline/Core'),\n DateUtil: require('./lib/timeline/DateUtil'),\n Range: require('./lib/timeline/Range'),\n stack: require('./lib/timeline/Stack'),\n TimeStep: require('./lib/timeline/TimeStep'),\n\n components: {\n items: {\n Item: require('./lib/timeline/component/item/Item'),\n BackgroundItem: require('./lib/timeline/component/item/BackgroundItem'),\n BoxItem: require('./lib/timeline/component/item/BoxItem'),\n PointItem: require('./lib/timeline/component/item/PointItem'),\n RangeItem: require('./lib/timeline/component/item/RangeItem')\n },\n\n BackgroundGroup: require('./lib/timeline/component/BackgroundGroup'),\n Component: require('./lib/timeline/component/Component'),\n CurrentTime: require('./lib/timeline/component/CurrentTime'),\n CustomTime: require('./lib/timeline/component/CustomTime'),\n DataAxis: require('./lib/timeline/component/DataAxis'),\n DataScale: require('./lib/timeline/component/DataScale'),\n GraphGroup: require('./lib/timeline/component/GraphGroup'),\n Group: require('./lib/timeline/component/Group'),\n ItemSet: require('./lib/timeline/component/ItemSet'),\n Legend: require('./lib/timeline/component/Legend'),\n LineGraph: require('./lib/timeline/component/LineGraph'),\n TimeAxis: require('./lib/timeline/component/TimeAxis')\n }\n};\n\n// bundled external libraries\nexports.moment = require('./lib/module/moment');\nexports.Hammer = require('./lib/module/hammer');\nexports.keycharm = require('keycharm');\n\n\n\n// WEBPACK FOOTER //\n// ./index-timeline-graph2d.js","var Emitter = require('emitter-component');\nvar Hammer = require('../module/hammer');\nvar moment = require('../module/moment');\nvar util = require('../util');\nvar DataSet = require('../DataSet');\nvar DataView = require('../DataView');\nvar Range = require('./Range');\nvar Core = require('./Core');\nvar TimeAxis = require('./component/TimeAxis');\nvar CurrentTime = require('./component/CurrentTime');\nvar CustomTime = require('./component/CustomTime');\nvar ItemSet = require('./component/ItemSet');\n\nvar printStyle = require('../shared/Validator').printStyle;\nvar allOptions = require('./optionsTimeline').allOptions;\nvar configureOptions = require('./optionsTimeline').configureOptions;\n\nimport Configurator from '../shared/Configurator';\nimport Validator from '../shared/Validator';\n\n\n/**\n * Create a timeline visualization\n * @param {HTMLElement} container\n * @param {vis.DataSet | vis.DataView | Array} [items]\n * @param {vis.DataSet | vis.DataView | Array} [groups]\n * @param {Object} [options] See Timeline.setOptions for the available options.\n * @constructor\n * @extends Core\n */\nfunction Timeline (container, items, groups, options) {\n\n if (!(this instanceof Timeline)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n\n // if the third element is options, the forth is groups (optionally);\n if (!(Array.isArray(groups) || groups instanceof DataSet || groups instanceof DataView) && groups instanceof Object) {\n var forthArgument = options;\n options = groups;\n groups = forthArgument;\n }\n\n // TODO: REMOVE THIS in the next MAJOR release\n // see https://github.com/almende/vis/issues/2511\n if (options && options.throttleRedraw) {\n console.warn(\"Timeline option \\\"throttleRedraw\\\" is DEPRICATED and no longer supported. It will be removed in the next MAJOR release.\");\n }\n\n var me = this;\n this.defaultOptions = {\n start: null,\n end: null,\n autoResize: true,\n orientation: {\n axis: 'bottom', // axis orientation: 'bottom', 'top', or 'both'\n item: 'bottom' // not relevant\n },\n moment: moment,\n width: null,\n height: null,\n maxHeight: null,\n minHeight: null\n };\n this.options = util.deepExtend({}, this.defaultOptions);\n\n // Create the DOM, props, and emitter\n this._create(container);\n if (!options || (options && typeof options.rtl == \"undefined\")) {\n var directionFromDom, domNode = this.dom.root;\n while (!directionFromDom && domNode) {\n directionFromDom = window.getComputedStyle(domNode, null).direction;\n domNode = domNode.parentElement;\n }\n this.options.rtl = (directionFromDom && (directionFromDom.toLowerCase() == \"rtl\"));\n } else {\n this.options.rtl = options.rtl;\n }\n\n this.options.rollingMode = options && options.rollingMode;\n\n // all components listed here will be repainted automatically\n this.components = [];\n\n this.body = {\n dom: this.dom,\n domProps: this.props,\n emitter: {\n on: this.on.bind(this),\n off: this.off.bind(this),\n emit: this.emit.bind(this)\n },\n hiddenDates: [],\n util: {\n getScale: function () {\n return me.timeAxis.step.scale;\n },\n getStep: function () {\n return me.timeAxis.step.step;\n },\n\n toScreen: me._toScreen.bind(me),\n toGlobalScreen: me._toGlobalScreen.bind(me), // this refers to the root.width\n toTime: me._toTime.bind(me),\n toGlobalTime : me._toGlobalTime.bind(me)\n }\n };\n\n // range\n this.range = new Range(this.body, this.options);\n this.components.push(this.range);\n this.body.range = this.range;\n\n // time axis\n this.timeAxis = new TimeAxis(this.body, this.options);\n this.timeAxis2 = null; // used in case of orientation option 'both'\n this.components.push(this.timeAxis);\n\n // current time bar\n this.currentTime = new CurrentTime(this.body, this.options);\n this.components.push(this.currentTime);\n\n // item set\n this.itemSet = new ItemSet(this.body, this.options);\n this.components.push(this.itemSet);\n\n this.itemsData = null; // DataSet\n this.groupsData = null; // DataSet\n\n this.dom.root.onclick = function (event) {\n me.emit('click', me.getEventProperties(event))\n };\n this.dom.root.ondblclick = function (event) {\n me.emit('doubleClick', me.getEventProperties(event))\n };\n this.dom.root.oncontextmenu = function (event) {\n me.emit('contextmenu', me.getEventProperties(event))\n };\n this.dom.root.onmouseover = function (event) {\n me.emit('mouseOver', me.getEventProperties(event))\n };\n this.dom.root.onmousemove = function (event) {\n me.emit('mouseMove', me.getEventProperties(event))\n };\n\n //Single time autoscale/fit\n this.fitDone = false;\n this.on('changed', function (){\n if (this.itemsData == null || this.options.rollingMode) return;\n if (!me.fitDone) {\n me.fitDone = true;\n if (me.options.start != undefined || me.options.end != undefined) {\n if (me.options.start == undefined || me.options.end == undefined) {\n var range = me.getItemRange();\n }\n\n var start = me.options.start != undefined ? me.options.start : range.min;\n var end = me.options.end != undefined ? me.options.end : range.max;\n me.setWindow(start, end, {animation: false});\n }\n else {\n me.fit({animation: false});\n }\n }\n });\n\n // apply options\n if (options) {\n this.setOptions(options);\n }\n\n // IMPORTANT: THIS HAPPENS BEFORE SET ITEMS!\n if (groups) {\n this.setGroups(groups);\n }\n\n // create itemset\n if (items) {\n this.setItems(items);\n }\n\n // draw for the first time\n this._redraw();\n}\n\n// Extend the functionality from Core\nTimeline.prototype = new Core();\n\n/**\n * Load a configurator\n * @return {Object}\n * @private\n */\nTimeline.prototype._createConfigurator = function () {\n return new Configurator(this, this.dom.container, configureOptions);\n};\n\n/**\n * Force a redraw. The size of all items will be recalculated.\n * Can be useful to manually redraw when option autoResize=false and the window\n * has been resized, or when the items CSS has been changed.\n *\n * Note: this function will be overridden on construction with a trottled version\n */\nTimeline.prototype.redraw = function() {\n this.itemSet && this.itemSet.markDirty({refreshItems: true});\n this._redraw();\n};\n\nTimeline.prototype.setOptions = function (options) {\n // validate options\n let errorFound = Validator.validate(options, allOptions);\n\n if (errorFound === true) {\n console.log('%cErrors have been found in the supplied options object.', printStyle);\n }\n Core.prototype.setOptions.call(this, options);\n\n if ('type' in options) {\n if (options.type !== this.options.type) {\n this.options.type = options.type;\n\n // force recreation of all items\n var itemsData = this.itemsData;\n if (itemsData) {\n var selection = this.getSelection();\n this.setItems(null); // remove all\n this.setItems(itemsData); // add all\n this.setSelection(selection); // restore selection\n }\n }\n }\n};\n\n/**\n * Set items\n * @param {vis.DataSet | Array | null} items\n */\nTimeline.prototype.setItems = function(items) {\n // convert to type DataSet when needed\n var newDataSet;\n if (!items) {\n newDataSet = null;\n }\n else if (items instanceof DataSet || items instanceof DataView) {\n newDataSet = items;\n }\n else {\n // turn an array into a dataset\n newDataSet = new DataSet(items, {\n type: {\n start: 'Date',\n end: 'Date'\n }\n });\n }\n\n // set items\n this.itemsData = newDataSet;\n this.itemSet && this.itemSet.setItems(newDataSet);\n};\n\n/**\n * Set groups\n * @param {vis.DataSet | Array} groups\n */\nTimeline.prototype.setGroups = function(groups) {\n // convert to type DataSet when needed\n var newDataSet;\n if (!groups) {\n newDataSet = null;\n }\n else {\n var filter = function(group) {\n return group.visible !== false;\n }\n if (groups instanceof DataSet || groups instanceof DataView) {\n newDataSet = new DataView(groups,{filter: filter});\n }\n else {\n // turn an array into a dataset\n newDataSet = new DataSet(groups.filter(filter));\n }\n }\n\n\n this.groupsData = newDataSet;\n this.itemSet.setGroups(newDataSet);\n};\n\n/**\n * Set both items and groups in one go\n * @param {{items: Array | vis.DataSet, groups: Array | vis.DataSet}} data\n */\nTimeline.prototype.setData = function (data) {\n if (data && data.groups) {\n this.setGroups(data.groups);\n }\n\n if (data && data.items) {\n this.setItems(data.items);\n }\n};\n\n/**\n * Set selected items by their id. Replaces the current selection\n * Unknown id's are silently ignored.\n * @param {string[] | string} [ids] An array with zero or more id's of the items to be\n * selected. If ids is an empty array, all items will be\n * unselected.\n * @param {Object} [options] Available options:\n * `focus: boolean`\n * If true, focus will be set to the selected item(s)\n * `animation: boolean | {duration: number, easingFunction: string}`\n * If true (default), the range is animated\n * smoothly to the new window. An object can be\n * provided to specify duration and easing function.\n * Default duration is 500 ms, and default easing\n * function is 'easeInOutQuad'.\n * Only applicable when option focus is true.\n */\nTimeline.prototype.setSelection = function(ids, options) {\n this.itemSet && this.itemSet.setSelection(ids);\n\n if (options && options.focus) {\n this.focus(ids, options);\n }\n};\n\n/**\n * Get the selected items by their id\n * @return {Array} ids The ids of the selected items\n */\nTimeline.prototype.getSelection = function() {\n return this.itemSet && this.itemSet.getSelection() || [];\n};\n\n/**\n * Adjust the visible window such that the selected item (or multiple items)\n * are centered on screen.\n * @param {String | String[]} id An item id or array with item ids\n * @param {Object} [options] Available options:\n * `animation: boolean | {duration: number, easingFunction: string}`\n * If true (default), the range is animated\n * smoothly to the new window. An object can be\n * provided to specify duration and easing function.\n * Default duration is 500 ms, and default easing\n * function is 'easeInOutQuad'.\n */\nTimeline.prototype.focus = function(id, options) {\n if (!this.itemsData || id == undefined) return;\n\n var ids = Array.isArray(id) ? id : [id];\n\n // get the specified item(s)\n var itemsData = this.itemsData.getDataSet().get(ids, {\n type: {\n start: 'Date',\n end: 'Date'\n }\n });\n\n // calculate minimum start and maximum end of specified items\n var start = null;\n var end = null;\n itemsData.forEach(function (itemData) {\n var s = itemData.start.valueOf();\n var e = 'end' in itemData ? itemData.end.valueOf() : itemData.start.valueOf();\n\n if (start === null || s < start) {\n start = s;\n }\n\n if (end === null || e > end) {\n end = e;\n }\n });\n\n if (start !== null && end !== null) {\n // calculate the new middle and interval for the window\n var middle = (start + end) / 2;\n var interval = Math.max((this.range.end - this.range.start), (end - start) * 1.1);\n\n var animation = (options && options.animation !== undefined) ? options.animation : true;\n this.range.setRange(middle - interval / 2, middle + interval / 2, animation);\n }\n};\n\n/**\n * Set Timeline window such that it fits all items\n * @param {Object} [options] Available options:\n * `animation: boolean | {duration: number, easingFunction: string}`\n * If true (default), the range is animated\n * smoothly to the new window. An object can be\n * provided to specify duration and easing function.\n * Default duration is 500 ms, and default easing\n * function is 'easeInOutQuad'.\n */\nTimeline.prototype.fit = function (options) {\n var animation = (options && options.animation !== undefined) ? options.animation : true;\n var range;\n\n var dataset = this.itemsData && this.itemsData.getDataSet();\n if (dataset.length === 1 && dataset.get()[0].end === undefined) {\n // a single item -> don't fit, just show a range around the item from -4 to +3 days\n range = this.getDataRange();\n this.moveTo(range.min.valueOf(), {animation});\n }\n else {\n // exactly fit the items (plus a small margin)\n range = this.getItemRange();\n this.range.setRange(range.min, range.max, animation);\n }\n};\n\n/**\n * Determine the range of the items, taking into account their actual width\n * and a margin of 10 pixels on both sides.\n * @return {{min: Date | null, max: Date | null}}\n */\nTimeline.prototype.getItemRange = function () {\n // get a rough approximation for the range based on the items start and end dates\n var range = this.getDataRange();\n var min = range.min !== null ? range.min.valueOf() : null;\n var max = range.max !== null ? range.max.valueOf() : null;\n var minItem = null;\n var maxItem = null;\n\n if (min != null && max != null) {\n var interval = (max - min); // ms\n if (interval <= 0) {\n interval = 10;\n }\n var factor = interval / this.props.center.width;\n\n function getStart(item) {\n return util.convert(item.data.start, 'Date').valueOf()\n }\n\n function getEnd(item) {\n var end = item.data.end != undefined ? item.data.end : item.data.start;\n return util.convert(end, 'Date').valueOf();\n }\n\n // calculate the date of the left side and right side of the items given\n util.forEach(this.itemSet.items, function (item) {\n if (item.groupShowing) {\n item.show();\n item.repositionX();\n }\n\n var start = getStart(item);\n var end = getEnd(item);\n\n if (this.options.rtl) {\n var startSide = start - (item.getWidthRight() + 10) * factor;\n var endSide = end + (item.getWidthLeft() + 10) * factor;\n } else {\n var startSide = start - (item.getWidthLeft() + 10) * factor;\n var endSide = end + (item.getWidthRight() + 10) * factor;\n }\n\n\n if (startSide < min) {\n min = startSide;\n minItem = item;\n }\n if (endSide > max) {\n max = endSide;\n maxItem = item;\n }\n }.bind(this));\n\n if (minItem && maxItem) {\n var lhs = minItem.getWidthLeft() + 10;\n var rhs = maxItem.getWidthRight() + 10;\n var delta = this.props.center.width - lhs - rhs; // px\n\n if (delta > 0) {\n if (this.options.rtl) {\n min = getStart(minItem) - rhs * interval / delta; // ms\n max = getEnd(maxItem) + lhs * interval / delta; // ms\n } else {\n min = getStart(minItem) - lhs * interval / delta; // ms\n max = getEnd(maxItem) + rhs * interval / delta; // ms\n }\n }\n }\n }\n\n return {\n min: min != null ? new Date(min) : null,\n max: max != null ? new Date(max) : null\n }\n};\n\n/**\n * Calculate the data range of the items start and end dates\n * @returns {{min: Date | null, max: Date | null}}\n */\nTimeline.prototype.getDataRange = function() {\n var min = null;\n var max = null;\n\n var dataset = this.itemsData && this.itemsData.getDataSet();\n if (dataset) {\n dataset.forEach(function (item) {\n var start = util.convert(item.start, 'Date').valueOf();\n var end = util.convert(item.end != undefined ? item.end : item.start, 'Date').valueOf();\n if (min === null || start < min) {\n min = start;\n }\n if (max === null || end > max) {\n max = end;\n }\n });\n }\n\n return {\n min: min != null ? new Date(min) : null,\n max: max != null ? new Date(max) : null\n }\n};\n\n/**\n * Generate Timeline related information from an event\n * @param {Event} event\n * @return {Object} An object with related information, like on which area\n * The event happened, whether clicked on an item, etc.\n */\nTimeline.prototype.getEventProperties = function (event) {\n var clientX = event.center ? event.center.x : event.clientX;\n var clientY = event.center ? event.center.y : event.clientY;\n if (this.options.rtl) {\n var x = util.getAbsoluteRight(this.dom.centerContainer) - clientX;\n } else {\n var x = clientX - util.getAbsoluteLeft(this.dom.centerContainer);\n }\n var y = clientY - util.getAbsoluteTop(this.dom.centerContainer);\n\n var item = this.itemSet.itemFromTarget(event);\n var group = this.itemSet.groupFromTarget(event);\n var customTime = CustomTime.customTimeFromTarget(event);\n\n var snap = this.itemSet.options.snap || null;\n var scale = this.body.util.getScale();\n var step = this.body.util.getStep();\n var time = this._toTime(x);\n var snappedTime = snap ? snap(time, scale, step) : time;\n\n var element = util.getTarget(event);\n var what = null;\n if (item != null) {what = 'item';}\n else if (customTime != null) {what = 'custom-time';}\n else if (util.hasParent(element, this.timeAxis.dom.foreground)) {what = 'axis';}\n else if (this.timeAxis2 && util.hasParent(element, this.timeAxis2.dom.foreground)) {what = 'axis';}\n else if (util.hasParent(element, this.itemSet.dom.labelSet)) {what = 'group-label';}\n else if (util.hasParent(element, this.currentTime.bar)) {what = 'current-time';}\n else if (util.hasParent(element, this.dom.center)) {what = 'background';}\n\n return {\n event: event,\n item: item ? item.id : null,\n group: group ? group.groupId : null,\n what: what,\n pageX: event.srcEvent ? event.srcEvent.pageX : event.pageX,\n pageY: event.srcEvent ? event.srcEvent.pageY : event.pageY,\n x: x,\n y: y,\n time: time,\n snappedTime: snappedTime\n }\n};\n\nmodule.exports = Timeline;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/timeline/Timeline.js","var util = require('../util');\n\nimport ColorPicker from './ColorPicker'\n\n/**\n * The way this works is for all properties of this.possible options, you can supply the property name in any form to list the options.\n * Boolean options are recognised as Boolean\n * Number options should be written as array: [default value, min value, max value, stepsize]\n * Colors should be written as array: ['color', '#ffffff']\n * Strings with should be written as array: [option1, option2, option3, ..]\n *\n * The options are matched with their counterparts in each of the modules and the values used in the configuration are\n *\n * @param parentModule | the location where parentModule.setOptions() can be called\n * @param defaultContainer | the default container of the module\n * @param configureOptions | the fully configured and predefined options set found in allOptions.js\n * @param pixelRatio | canvas pixel ratio\n */\nclass Configurator {\n constructor(parentModule, defaultContainer, configureOptions, pixelRatio = 1) {\n this.parent = parentModule;\n this.changedOptions = [];\n this.container = defaultContainer;\n this.allowCreation = false;\n\n this.options = {};\n this.initialized = false;\n this.popupCounter = 0;\n this.defaultOptions = {\n enabled: false,\n filter: true,\n container: undefined,\n showButton: true\n };\n util.extend(this.options, this.defaultOptions);\n\n this.configureOptions = configureOptions;\n this.moduleOptions = {};\n this.domElements = [];\n this.popupDiv = {};\n this.popupLimit = 5;\n this.popupHistory = {};\n this.colorPicker = new ColorPicker(pixelRatio);\n this.wrapper = undefined;\n }\n\n\n /**\n * refresh all options.\n * Because all modules parse their options by themselves, we just use their options. We copy them here.\n *\n * @param options\n */\n setOptions(options) {\n if (options !== undefined) {\n // reset the popup history because the indices may have been changed.\n this.popupHistory = {};\n this._removePopup();\n\n let enabled = true;\n if (typeof options === 'string') {\n this.options.filter = options;\n }\n else if (options instanceof Array) {\n this.options.filter = options.join();\n }\n else if (typeof options === 'object') {\n if (options.container !== undefined) {\n this.options.container = options.container;\n }\n if (options.filter !== undefined) {\n this.options.filter = options.filter;\n }\n if (options.showButton !== undefined) {\n this.options.showButton = options.showButton;\n }\n if (options.enabled !== undefined) {\n enabled = options.enabled;\n }\n }\n else if (typeof options === 'boolean') {\n this.options.filter = true;\n enabled = options;\n }\n else if (typeof options === 'function') {\n this.options.filter = options;\n enabled = true;\n }\n if (this.options.filter === false) {\n enabled = false;\n }\n\n this.options.enabled = enabled;\n }\n this._clean();\n }\n\n\n setModuleOptions(moduleOptions) {\n this.moduleOptions = moduleOptions;\n if (this.options.enabled === true) {\n this._clean();\n if (this.options.container !== undefined) {\n this.container = this.options.container;\n }\n this._create();\n }\n }\n\n /**\n * Create all DOM elements\n * @private\n */\n _create() {\n this._clean();\n this.changedOptions = [];\n\n let filter = this.options.filter;\n let counter = 0;\n let show = false;\n for (let option in this.configureOptions) {\n if (this.configureOptions.hasOwnProperty(option)) {\n this.allowCreation = false;\n show = false;\n if (typeof filter === 'function') {\n show = filter(option,[]);\n show = show || this._handleObject(this.configureOptions[option], [option], true);\n }\n else if (filter === true || filter.indexOf(option) !== -1) {\n show = true;\n }\n\n if (show !== false) {\n this.allowCreation = true;\n\n // linebreak between categories\n if (counter > 0) {\n this._makeItem([]);\n }\n // a header for the category\n this._makeHeader(option);\n\n // get the sub options\n this._handleObject(this.configureOptions[option], [option]);\n }\n counter++;\n }\n }\n\n if (this.options.showButton === true) {\n let generateButton = document.createElement('div');\n generateButton.className = 'vis-configuration vis-config-button';\n generateButton.innerHTML = 'generate options';\n generateButton.onclick = () => {this._printOptions();};\n generateButton.onmouseover = () => {generateButton.className = 'vis-configuration vis-config-button hover';};\n generateButton.onmouseout = () => {generateButton.className = 'vis-configuration vis-config-button';};\n\n this.optionsContainer = document.createElement('div');\n this.optionsContainer.className = 'vis-configuration vis-config-option-container';\n\n this.domElements.push(this.optionsContainer);\n this.domElements.push(generateButton);\n }\n\n this._push();\n //~ this.colorPicker.insertTo(this.container);\n }\n\n\n /**\n * draw all DOM elements on the screen\n * @private\n */\n _push() {\n this.wrapper = document.createElement('div');\n this.wrapper.className = 'vis-configuration-wrapper';\n this.container.appendChild(this.wrapper);\n for (var i = 0; i < this.domElements.length; i++) {\n this.wrapper.appendChild(this.domElements[i]);\n }\n\n this._showPopupIfNeeded()\n }\n\n\n /**\n * delete all DOM elements\n * @private\n */\n _clean() {\n for (var i = 0; i < this.domElements.length; i++) {\n this.wrapper.removeChild(this.domElements[i]);\n }\n\n if (this.wrapper !== undefined) {\n this.container.removeChild(this.wrapper);\n this.wrapper = undefined;\n }\n this.domElements = [];\n\n this._removePopup();\n }\n\n\n /**\n * get the value from the actualOptions if it exists\n * @param {array} path | where to look for the actual option\n * @returns {*}\n * @private\n */\n _getValue(path) {\n let base = this.moduleOptions;\n for (let i = 0; i < path.length; i++) {\n if (base[path[i]] !== undefined) {\n base = base[path[i]];\n }\n else {\n base = undefined;\n break;\n }\n }\n return base;\n }\n\n\n /**\n * all option elements are wrapped in an item\n * @param path\n * @param domElements\n * @private\n */\n _makeItem(path, ...domElements) {\n if (this.allowCreation === true) {\n let item = document.createElement('div');\n item.className = 'vis-configuration vis-config-item vis-config-s' + path.length;\n domElements.forEach((element) => {\n item.appendChild(element);\n });\n this.domElements.push(item);\n return this.domElements.length;\n }\n return 0;\n }\n\n\n /**\n * header for major subjects\n * @param name\n * @private\n */\n _makeHeader(name) {\n let div = document.createElement('div');\n div.className = 'vis-configuration vis-config-header';\n div.innerHTML = name;\n this._makeItem([],div);\n }\n\n\n /**\n * make a label, if it is an object label, it gets different styling.\n * @param name\n * @param path\n * @param objectLabel\n * @returns {HTMLElement}\n * @private\n */\n _makeLabel(name, path, objectLabel = false) {\n let div = document.createElement('div');\n div.className = 'vis-configuration vis-config-label vis-config-s' + path.length;\n if (objectLabel === true) {\n div.innerHTML = '' + name + ':';\n }\n else {\n div.innerHTML = name + ':';\n }\n return div;\n }\n\n\n /**\n * make a dropdown list for multiple possible string optoins\n * @param arr\n * @param value\n * @param path\n * @private\n */\n _makeDropdown(arr, value, path) {\n let select = document.createElement('select');\n select.className = 'vis-configuration vis-config-select';\n let selectedValue = 0;\n if (value !== undefined) {\n if (arr.indexOf(value) !== -1) {\n selectedValue = arr.indexOf(value);\n }\n }\n\n for (let i = 0; i < arr.length; i++) {\n let option = document.createElement('option');\n option.value = arr[i];\n if (i === selectedValue) {\n option.selected = 'selected';\n }\n option.innerHTML = arr[i];\n select.appendChild(option);\n }\n\n let me = this;\n select.onchange = function () {me._update(this.value, path);};\n\n let label = this._makeLabel(path[path.length-1], path);\n this._makeItem(path, label, select);\n }\n\n\n /**\n * make a range object for numeric options\n * @param arr\n * @param value\n * @param path\n * @private\n */\n _makeRange(arr, value, path) {\n let defaultValue = arr[0];\n let min = arr[1];\n let max = arr[2];\n let step = arr[3];\n let range = document.createElement('input');\n range.className = 'vis-configuration vis-config-range';\n try {\n range.type = 'range'; // not supported on IE9\n range.min = min;\n range.max = max;\n }\n catch (err) {}\n range.step = step;\n\n // set up the popup settings in case they are needed.\n let popupString = '';\n let popupValue = 0;\n\n if (value !== undefined) {\n let factor = 1.20;\n if (value < 0 && value * factor < min) {\n range.min = Math.ceil(value * factor);\n popupValue = range.min;\n popupString = 'range increased';\n }\n else if (value / factor < min) {\n range.min = Math.ceil(value / factor);\n popupValue = range.min;\n popupString = 'range increased';\n }\n if (value * factor > max && max !== 1) {\n range.max = Math.ceil(value * factor);\n popupValue = range.max;\n popupString = 'range increased';\n }\n range.value = value;\n }\n else {\n range.value = defaultValue;\n }\n\n let input = document.createElement('input');\n input.className = 'vis-configuration vis-config-rangeinput';\n input.value = range.value;\n\n var me = this;\n range.onchange = function () {input.value = this.value; me._update(Number(this.value), path);};\n range.oninput = function () {input.value = this.value; };\n\n let label = this._makeLabel(path[path.length-1], path);\n let itemIndex = this._makeItem(path, label, range, input);\n\n // if a popup is needed AND it has not been shown for this value, show it.\n if (popupString !== '' && this.popupHistory[itemIndex] !== popupValue) {\n this.popupHistory[itemIndex] = popupValue;\n this._setupPopup(popupString, itemIndex);\n }\n\n }\n\n\n /**\n * prepare the popup\n * @param string\n * @param index\n * @private\n */\n _setupPopup(string, index) {\n if (this.initialized === true && this.allowCreation === true && this.popupCounter < this.popupLimit) {\n let div = document.createElement(\"div\");\n div.id = \"vis-configuration-popup\";\n div.className = \"vis-configuration-popup\";\n div.innerHTML = string;\n div.onclick = () => {this._removePopup()};\n this.popupCounter += 1;\n this.popupDiv = {html:div, index:index};\n }\n }\n\n\n /**\n * remove the popup from the dom\n * @private\n */\n _removePopup() {\n if (this.popupDiv.html !== undefined) {\n this.popupDiv.html.parentNode.removeChild(this.popupDiv.html);\n clearTimeout(this.popupDiv.hideTimeout);\n clearTimeout(this.popupDiv.deleteTimeout);\n this.popupDiv = {};\n }\n }\n\n\n /**\n * Show the popup if it is needed.\n * @private\n */\n _showPopupIfNeeded() {\n if (this.popupDiv.html !== undefined) {\n let correspondingElement = this.domElements[this.popupDiv.index];\n let rect = correspondingElement.getBoundingClientRect();\n this.popupDiv.html.style.left = rect.left + \"px\";\n this.popupDiv.html.style.top = rect.top - 30 + \"px\"; // 30 is the height;\n document.body.appendChild(this.popupDiv.html)\n this.popupDiv.hideTimeout = setTimeout(() => {\n this.popupDiv.html.style.opacity = 0;\n },1500);\n this.popupDiv.deleteTimeout = setTimeout(() => {\n this._removePopup();\n },1800)\n }\n }\n\n /**\n * make a checkbox for boolean options.\n * @param defaultValue\n * @param value\n * @param path\n * @private\n */\n _makeCheckbox(defaultValue, value, path) {\n var checkbox = document.createElement('input');\n checkbox.type = 'checkbox';\n checkbox.className = 'vis-configuration vis-config-checkbox';\n checkbox.checked = defaultValue;\n if (value !== undefined) {\n checkbox.checked = value;\n if (value !== defaultValue) {\n if (typeof defaultValue === 'object') {\n if (value !== defaultValue.enabled) {\n this.changedOptions.push({path:path, value:value});\n }\n }\n else {\n this.changedOptions.push({path:path, value:value});\n }\n }\n }\n\n let me = this;\n checkbox.onchange = function() {me._update(this.checked, path)};\n\n let label = this._makeLabel(path[path.length-1], path);\n this._makeItem(path, label, checkbox);\n }\n\n /**\n * make a text input field for string options.\n * @param defaultValue\n * @param value\n * @param path\n * @private\n */\n _makeTextInput(defaultValue, value, path) {\n var checkbox = document.createElement('input');\n checkbox.type = 'text';\n checkbox.className = 'vis-configuration vis-config-text';\n checkbox.value = value;\n if (value !== defaultValue) {\n this.changedOptions.push({path:path, value:value});\n }\n\n let me = this;\n checkbox.onchange = function() {me._update(this.value, path)};\n\n let label = this._makeLabel(path[path.length-1], path);\n this._makeItem(path, label, checkbox);\n }\n\n\n /**\n * make a color field with a color picker for color fields\n * @param arr\n * @param value\n * @param path\n * @private\n */\n _makeColorField(arr, value, path) {\n let defaultColor = arr[1];\n let div = document.createElement('div');\n value = value === undefined ? defaultColor : value;\n\n if (value !== 'none') {\n div.className = 'vis-configuration vis-config-colorBlock';\n div.style.backgroundColor = value;\n }\n else {\n div.className = 'vis-configuration vis-config-colorBlock none';\n }\n\n value = value === undefined ? defaultColor : value;\n div.onclick = () => {\n this._showColorPicker(value,div,path);\n };\n\n let label = this._makeLabel(path[path.length-1], path);\n this._makeItem(path,label, div);\n }\n\n\n /**\n * used by the color buttons to call the color picker.\n * @param event\n * @param value\n * @param div\n * @param path\n * @private\n */\n _showColorPicker(value, div, path) {\n // clear the callback from this div\n div.onclick = function() {};\n\n this.colorPicker.insertTo(div);\n this.colorPicker.show();\n\n this.colorPicker.setColor(value);\n this.colorPicker.setUpdateCallback((color) => {\n let colorString = 'rgba(' + color.r + ',' + color.g + ',' + color.b + ',' + color.a + ')';\n div.style.backgroundColor = colorString;\n this._update(colorString,path);\n });\n\n // on close of the colorpicker, restore the callback.\n this.colorPicker.setCloseCallback(() => {\n div.onclick = () => {\n this._showColorPicker(value,div,path);\n };\n });\n }\n\n\n /**\n * parse an object and draw the correct items\n * @param obj\n * @param path\n * @private\n */\n _handleObject(obj, path = [], checkOnly = false) {\n let show = false;\n let filter = this.options.filter;\n let visibleInSet = false;\n for (let subObj in obj) {\n if (obj.hasOwnProperty(subObj)) {\n show = true;\n let item = obj[subObj];\n let newPath = util.copyAndExtendArray(path, subObj);\n if (typeof filter === 'function') {\n show = filter(subObj,path);\n\n // if needed we must go deeper into the object.\n if (show === false) {\n if (!(item instanceof Array) && typeof item !== 'string' && typeof item !== 'boolean' && item instanceof Object) {\n this.allowCreation = false;\n show = this._handleObject(item, newPath, true);\n this.allowCreation = checkOnly === false;\n }\n }\n }\n\n if (show !== false) {\n visibleInSet = true;\n let value = this._getValue(newPath);\n\n if (item instanceof Array) {\n this._handleArray(item, value, newPath);\n }\n else if (typeof item === 'string') {\n this._makeTextInput(item, value, newPath);\n }\n else if (typeof item === 'boolean') {\n this._makeCheckbox(item, value, newPath);\n }\n else if (item instanceof Object) {\n // collapse the physics options that are not enabled\n let draw = true;\n if (path.indexOf('physics') !== -1) {\n if (this.moduleOptions.physics.solver !== subObj) {\n draw = false;\n }\n }\n\n if (draw === true) {\n // initially collapse options with an disabled enabled option.\n if (item.enabled !== undefined) {\n let enabledPath = util.copyAndExtendArray(newPath, 'enabled');\n let enabledValue = this._getValue(enabledPath);\n if (enabledValue === true) {\n let label = this._makeLabel(subObj, newPath, true);\n this._makeItem(newPath, label);\n visibleInSet = this._handleObject(item, newPath) || visibleInSet;\n }\n else {\n this._makeCheckbox(item, enabledValue, newPath);\n }\n }\n else {\n let label = this._makeLabel(subObj, newPath, true);\n this._makeItem(newPath, label);\n visibleInSet = this._handleObject(item, newPath) || visibleInSet;\n }\n }\n }\n else {\n console.error('dont know how to handle', item, subObj, newPath);\n }\n }\n }\n }\n return visibleInSet;\n }\n\n\n /**\n * handle the array type of option\n * @param optionName\n * @param arr\n * @param value\n * @param path\n * @private\n */\n _handleArray(arr, value, path) {\n if (typeof arr[0] === 'string' && arr[0] === 'color') {\n this._makeColorField(arr, value, path);\n if (arr[1] !== value) {this.changedOptions.push({path:path, value:value});}\n }\n else if (typeof arr[0] === 'string') {\n this._makeDropdown(arr, value, path);\n if (arr[0] !== value) {this.changedOptions.push({path:path, value:value});}\n }\n else if (typeof arr[0] === 'number') {\n this._makeRange(arr, value, path);\n if (arr[0] !== value) {this.changedOptions.push({path:path, value:Number(value)});}\n }\n }\n\n\n\n /**\n * called to update the network with the new settings.\n * @param value\n * @param path\n * @private\n */\n _update(value, path) {\n let options = this._constructOptions(value,path);\n\n if (this.parent.body && this.parent.body.emitter && this.parent.body.emitter.emit) {\n this.parent.body.emitter.emit(\"configChange\", options);\n }\n this.initialized = true;\n this.parent.setOptions(options);\n }\n\n _constructOptions(value, path, optionsObj = {}) {\n let pointer = optionsObj;\n\n // when dropdown boxes can be string or boolean, we typecast it into correct types\n value = value === 'true' ? true : value;\n value = value === 'false' ? false : value;\n\n for (let i = 0; i < path.length; i++) {\n if (path[i] !== 'global') {\n if (pointer[path[i]] === undefined) {\n pointer[path[i]] = {};\n }\n if (i !== path.length - 1) {\n pointer = pointer[path[i]];\n }\n else {\n pointer[path[i]] = value;\n }\n }\n }\n return optionsObj;\n }\n\n _printOptions() {\n let options = this.getOptions();\n this.optionsContainer.innerHTML = '
var options = ' + JSON.stringify(options, null, 2) + '
';\n }\n\n getOptions() {\n let options = {};\n for (var i = 0; i < this.changedOptions.length; i++) {\n this._constructOptions(this.changedOptions[i].value, this.changedOptions[i].path, options)\n }\n return options;\n }\n}\n\n\nexport default Configurator;\n\n\n// WEBPACK FOOTER //\n// ./lib/shared/Configurator.js","\"use strict\";\n\nexports.__esModule = true;\n\nexports.default = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/babel-runtime/helpers/classCallCheck.js\n// module id = 115\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\n\nvar _defineProperty = require(\"../core-js/object/define-property\");\n\nvar _defineProperty2 = _interopRequireDefault(_defineProperty);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n (0, _defineProperty2.default)(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/babel-runtime/helpers/createClass.js\n// module id = 116\n// module chunks = 0","module.exports = { \"default\": require(\"core-js/library/fn/object/define-property\"), __esModule: true };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/babel-runtime/core-js/object/define-property.js\n// module id = 117\n// module chunks = 0","require('../../modules/es6.object.define-property');\nvar $Object = require('../../modules/_core').Object;\nmodule.exports = function defineProperty(it, key, desc){\n return $Object.defineProperty(it, key, desc);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/fn/object/define-property.js\n// module id = 118\n// module chunks = 0","var $export = require('./_export');\n// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\n$export($export.S + $export.F * !require('./_descriptors'), 'Object', {defineProperty: require('./_object-dp').f});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/es6.object.define-property.js\n// module id = 119\n// module chunks = 0","let Hammer = require('../module/hammer');\nlet hammerUtil = require('../hammerUtil');\nlet util = require('../util');\n\nclass ColorPicker {\n constructor(pixelRatio = 1) {\n this.pixelRatio = pixelRatio;\n this.generated = false;\n this.centerCoordinates = {x:289/2, y:289/2};\n this.r = 289 * 0.49;\n this.color = {r:255,g:255,b:255,a:1.0};\n this.hueCircle = undefined;\n this.initialColor = {r:255,g:255,b:255,a:1.0};\n this.previousColor= undefined;\n this.applied = false;\n\n // bound by\n this.updateCallback = () => {};\n this.closeCallback = () => {};\n\n // create all DOM elements\n this._create();\n }\n\n\n /**\n * this inserts the colorPicker into a div from the DOM\n * @param container\n */\n insertTo(container) {\n if (this.hammer !== undefined) {\n this.hammer.destroy();\n this.hammer = undefined;\n }\n this.container = container;\n this.container.appendChild(this.frame);\n this._bindHammer();\n\n this._setSize();\n }\n\n /**\n * the callback is executed on apply and save. Bind it to the application\n * @param callback\n */\n setUpdateCallback(callback) {\n if (typeof callback === 'function') {\n this.updateCallback = callback;\n }\n else {\n throw new Error(\"Function attempted to set as colorPicker update callback is not a function.\");\n }\n }\n\n /**\n * the callback is executed on apply and save. Bind it to the application\n * @param callback\n */\n setCloseCallback(callback) {\n if (typeof callback === 'function') {\n this.closeCallback = callback;\n }\n else {\n throw new Error(\"Function attempted to set as colorPicker closing callback is not a function.\");\n }\n }\n\n _isColorString(color) {\n var htmlColors = {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'};\n if (typeof color === 'string') {\n return htmlColors[color];\n }\n }\n\n\n /**\n * Set the color of the colorPicker\n * Supported formats:\n * 'red' --> HTML color string\n * '#ffffff' --> hex string\n * 'rbg(255,255,255)' --> rgb string\n * 'rgba(255,255,255,1.0)' --> rgba string\n * {r:255,g:255,b:255} --> rgb object\n * {r:255,g:255,b:255,a:1.0} --> rgba object\n * @param color\n * @param setInitial\n */\n setColor(color, setInitial = true) {\n if (color === 'none') {\n return;\n }\n\n let rgba;\n\n // if a html color shorthand is used, convert to hex\n var htmlColor = this._isColorString(color);\n if (htmlColor !== undefined) {\n color = htmlColor;\n }\n\n // check format\n if (util.isString(color) === true) {\n if (util.isValidRGB(color) === true) {\n let rgbaArray = color.substr(4).substr(0, color.length - 5).split(',');\n rgba = {r:rgbaArray[0], g:rgbaArray[1], b:rgbaArray[2], a:1.0};\n }\n else if (util.isValidRGBA(color) === true) {\n let rgbaArray = color.substr(5).substr(0, color.length - 6).split(',');\n rgba = {r:rgbaArray[0], g:rgbaArray[1], b:rgbaArray[2], a:rgbaArray[3]};\n }\n else if (util.isValidHex(color) === true) {\n let rgbObj = util.hexToRGB(color);\n rgba = {r:rgbObj.r, g:rgbObj.g, b:rgbObj.b, a:1.0};\n }\n }\n else {\n if (color instanceof Object) {\n if (color.r !== undefined && color.g !== undefined && color.b !== undefined) {\n let alpha = color.a !== undefined ? color.a : '1.0';\n rgba = {r:color.r, g:color.g, b:color.b, a:alpha};\n }\n }\n }\n\n // set color\n if (rgba === undefined) {\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(color));\n }\n else {\n this._setColor(rgba, setInitial);\n }\n }\n\n\n /**\n * this shows the color picker.\n * The hue circle is constructed once and stored.\n */\n show() {\n if (this.closeCallback !== undefined) {\n this.closeCallback();\n this.closeCallback = undefined;\n }\n\n this.applied = false;\n this.frame.style.display = 'block';\n this._generateHueCircle();\n }\n\n // ------------------------------------------ PRIVATE ----------------------------- //\n\n /**\n * Hide the picker. Is called by the cancel button.\n * Optional boolean to store the previous color for easy access later on.\n * @param storePrevious\n * @private\n */\n _hide(storePrevious = true) {\n // store the previous color for next time;\n if (storePrevious === true) {\n this.previousColor = util.extend({}, this.color);\n }\n\n if (this.applied === true) {\n this.updateCallback(this.initialColor);\n }\n\n this.frame.style.display = 'none';\n\n // call the closing callback, restoring the onclick method.\n // this is in a setTimeout because it will trigger the show again before the click is done.\n setTimeout(() => {\n if (this.closeCallback !== undefined) {\n this.closeCallback();\n this.closeCallback = undefined;\n }\n },0);\n }\n\n\n /**\n * bound to the save button. Saves and hides.\n * @private\n */\n _save() {\n this.updateCallback(this.color);\n this.applied = false;\n this._hide();\n }\n\n\n /**\n * Bound to apply button. Saves but does not close. Is undone by the cancel button.\n * @private\n */\n _apply() {\n this.applied = true;\n this.updateCallback(this.color);\n this._updatePicker(this.color);\n }\n\n\n /**\n * load the color from the previous session.\n * @private\n */\n _loadLast() {\n if (this.previousColor !== undefined) {\n this.setColor(this.previousColor, false);\n }\n else {\n alert(\"There is no last color to load...\");\n }\n }\n\n\n /**\n * set the color, place the picker\n * @param rgba\n * @param setInitial\n * @private\n */\n _setColor(rgba, setInitial = true) {\n // store the initial color\n if (setInitial === true) {\n this.initialColor = util.extend({}, rgba);\n }\n\n this.color = rgba;\n let hsv = util.RGBToHSV(rgba.r, rgba.g, rgba.b);\n\n let angleConvert = 2 * Math.PI;\n let radius = this.r * hsv.s;\n let x = this.centerCoordinates.x + radius * Math.sin(angleConvert * hsv.h);\n let y = this.centerCoordinates.y + radius * Math.cos(angleConvert * hsv.h);\n\n this.colorPickerSelector.style.left = x - 0.5 * this.colorPickerSelector.clientWidth + 'px';\n this.colorPickerSelector.style.top = y - 0.5 * this.colorPickerSelector.clientHeight + 'px';\n\n this._updatePicker(rgba);\n }\n\n\n /**\n * bound to opacity control\n * @param value\n * @private\n */\n _setOpacity(value) {\n this.color.a = value / 100;\n this._updatePicker(this.color);\n }\n\n\n /**\n * bound to brightness control\n * @param value\n * @private\n */\n _setBrightness(value) {\n let hsv = util.RGBToHSV(this.color.r, this.color.g, this.color.b);\n hsv.v = value / 100;\n let rgba = util.HSVToRGB(hsv.h, hsv.s, hsv.v);\n rgba['a'] = this.color.a;\n this.color = rgba;\n this._updatePicker();\n }\n\n\n /**\n * update the color picker. A black circle overlays the hue circle to mimic the brightness decreasing.\n * @param rgba\n * @private\n */\n _updatePicker(rgba = this.color) {\n let hsv = util.RGBToHSV(rgba.r, rgba.g, rgba.b);\n let ctx = this.colorPickerCanvas.getContext('2d');\n if (this.pixelRation === undefined) {\n this.pixelRatio = (window.devicePixelRatio || 1) / (ctx.webkitBackingStorePixelRatio ||\n ctx.mozBackingStorePixelRatio ||\n ctx.msBackingStorePixelRatio ||\n ctx.oBackingStorePixelRatio ||\n ctx.backingStorePixelRatio || 1);\n }\n ctx.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);\n\n // clear the canvas\n let w = this.colorPickerCanvas.clientWidth;\n let h = this.colorPickerCanvas.clientHeight;\n ctx.clearRect(0, 0, w, h);\n\n ctx.putImageData(this.hueCircle, 0,0);\n ctx.fillStyle = 'rgba(0,0,0,' + (1- hsv.v) + ')';\n ctx.circle(this.centerCoordinates.x, this.centerCoordinates.y, this.r);\n ctx.fill();\n\n this.brightnessRange.value = 100 * hsv.v;\n this.opacityRange.value = 100 * rgba.a;\n\n this.initialColorDiv.style.backgroundColor = 'rgba(' + this.initialColor.r + ',' + this.initialColor.g + ',' + this.initialColor.b + ',' + this.initialColor.a + ')';\n this.newColorDiv.style.backgroundColor = 'rgba(' + this.color.r + ',' + this.color.g + ',' + this.color.b + ',' + this.color.a + ')';\n }\n\n\n /**\n * used by create to set the size of the canvas.\n * @private\n */\n _setSize() {\n this.colorPickerCanvas.style.width = '100%';\n this.colorPickerCanvas.style.height = '100%';\n\n this.colorPickerCanvas.width = 289 * this.pixelRatio;\n this.colorPickerCanvas.height = 289 * this.pixelRatio;\n }\n\n\n /**\n * create all dom elements\n * TODO: cleanup, lots of similar dom elements\n * @private\n */\n _create() {\n this.frame = document.createElement('div');\n this.frame.className = 'vis-color-picker';\n\n this.colorPickerDiv = document.createElement('div');\n this.colorPickerSelector = document.createElement('div');\n this.colorPickerSelector.className = 'vis-selector';\n this.colorPickerDiv.appendChild(this.colorPickerSelector);\n\n this.colorPickerCanvas = document.createElement('canvas');\n this.colorPickerDiv.appendChild(this.colorPickerCanvas);\n\n if (!this.colorPickerCanvas.getContext) {\n let noCanvas = document.createElement( 'DIV' );\n noCanvas.style.color = 'red';\n noCanvas.style.fontWeight = 'bold' ;\n noCanvas.style.padding = '10px';\n noCanvas.innerHTML = 'Error: your browser does not support HTML canvas';\n this.colorPickerCanvas.appendChild(noCanvas);\n }\n else {\n let ctx = this.colorPickerCanvas.getContext(\"2d\");\n this.pixelRatio = (window.devicePixelRatio || 1) / (ctx.webkitBackingStorePixelRatio ||\n ctx.mozBackingStorePixelRatio ||\n ctx.msBackingStorePixelRatio ||\n ctx.oBackingStorePixelRatio ||\n ctx.backingStorePixelRatio || 1);\n\n this.colorPickerCanvas.getContext(\"2d\").setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);\n }\n\n this.colorPickerDiv.className = 'vis-color';\n\n this.opacityDiv = document.createElement('div');\n this.opacityDiv.className = 'vis-opacity';\n\n this.brightnessDiv = document.createElement('div');\n this.brightnessDiv.className = 'vis-brightness';\n\n this.arrowDiv = document.createElement('div');\n this.arrowDiv.className = 'vis-arrow';\n\n this.opacityRange = document.createElement('input');\n try {\n this.opacityRange.type = 'range'; // Not supported on IE9\n this.opacityRange.min = '0';\n this.opacityRange.max = '100';\n }\n catch (err) {}\n this.opacityRange.value = '100';\n this.opacityRange.className = 'vis-range';\n\n this.brightnessRange = document.createElement('input');\n try {\n this.brightnessRange.type = 'range'; // Not supported on IE9\n this.brightnessRange.min = '0';\n this.brightnessRange.max = '100';\n }\n catch (err) {}\n this.brightnessRange.value = '100';\n this.brightnessRange.className = 'vis-range';\n\n this.opacityDiv.appendChild(this.opacityRange);\n this.brightnessDiv.appendChild(this.brightnessRange);\n\n var me = this;\n this.opacityRange.onchange = function () {me._setOpacity(this.value);};\n this.opacityRange.oninput = function () {me._setOpacity(this.value);};\n this.brightnessRange.onchange = function () {me._setBrightness(this.value);};\n this.brightnessRange.oninput = function () {me._setBrightness(this.value);};\n\n this.brightnessLabel = document.createElement(\"div\");\n this.brightnessLabel.className = \"vis-label vis-brightness\";\n this.brightnessLabel.innerHTML = 'brightness:';\n\n this.opacityLabel = document.createElement(\"div\");\n this.opacityLabel.className = \"vis-label vis-opacity\";\n this.opacityLabel.innerHTML = 'opacity:';\n\n this.newColorDiv = document.createElement(\"div\");\n this.newColorDiv.className = \"vis-new-color\";\n this.newColorDiv.innerHTML = 'new';\n\n this.initialColorDiv = document.createElement(\"div\");\n this.initialColorDiv.className = \"vis-initial-color\";\n this.initialColorDiv.innerHTML = 'initial';\n\n this.cancelButton = document.createElement(\"div\");\n this.cancelButton.className = \"vis-button vis-cancel\";\n this.cancelButton.innerHTML = 'cancel';\n this.cancelButton.onclick = this._hide.bind(this, false);\n\n this.applyButton = document.createElement(\"div\");\n this.applyButton.className = \"vis-button vis-apply\";\n this.applyButton.innerHTML = 'apply';\n this.applyButton.onclick = this._apply.bind(this);\n\n this.saveButton = document.createElement(\"div\");\n this.saveButton.className = \"vis-button vis-save\";\n this.saveButton.innerHTML = 'save';\n this.saveButton.onclick = this._save.bind(this);\n\n this.loadButton = document.createElement(\"div\");\n this.loadButton.className = \"vis-button vis-load\";\n this.loadButton.innerHTML = 'load last';\n this.loadButton.onclick = this._loadLast.bind(this);\n\n this.frame.appendChild(this.colorPickerDiv);\n this.frame.appendChild(this.arrowDiv);\n this.frame.appendChild(this.brightnessLabel);\n this.frame.appendChild(this.brightnessDiv);\n this.frame.appendChild(this.opacityLabel);\n this.frame.appendChild(this.opacityDiv);\n this.frame.appendChild(this.newColorDiv);\n this.frame.appendChild(this.initialColorDiv);\n\n this.frame.appendChild(this.cancelButton);\n this.frame.appendChild(this.applyButton);\n this.frame.appendChild(this.saveButton);\n this.frame.appendChild(this.loadButton);\n }\n\n\n /**\n * bind hammer to the color picker\n * @private\n */\n _bindHammer() {\n this.drag = {};\n this.pinch = {};\n this.hammer = new Hammer(this.colorPickerCanvas);\n this.hammer.get('pinch').set({enable: true});\n\n hammerUtil.onTouch(this.hammer, (event) => {this._moveSelector(event)});\n this.hammer.on('tap', (event) => {this._moveSelector(event)});\n this.hammer.on('panstart', (event) => {this._moveSelector(event)});\n this.hammer.on('panmove', (event) => {this._moveSelector(event)});\n this.hammer.on('panend', (event) => {this._moveSelector(event)});\n }\n\n\n /**\n * generate the hue circle. This is relatively heavy (200ms) and is done only once on the first time it is shown.\n * @private\n */\n _generateHueCircle() {\n if (this.generated === false) {\n let ctx = this.colorPickerCanvas.getContext('2d');\n if (this.pixelRation === undefined) {\n this.pixelRatio = (window.devicePixelRatio || 1) / (ctx.webkitBackingStorePixelRatio ||\n ctx.mozBackingStorePixelRatio ||\n ctx.msBackingStorePixelRatio ||\n ctx.oBackingStorePixelRatio ||\n ctx.backingStorePixelRatio || 1);\n }\n ctx.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);\n\n // clear the canvas\n let w = this.colorPickerCanvas.clientWidth;\n let h = this.colorPickerCanvas.clientHeight;\n ctx.clearRect(0, 0, w, h);\n\n\n // draw hue circle\n let x, y, hue, sat;\n this.centerCoordinates = {x: w * 0.5, y: h * 0.5};\n this.r = 0.49 * w;\n let angleConvert = (2 * Math.PI) / 360;\n let hfac = 1 / 360;\n let sfac = 1 / this.r;\n let rgb;\n for (hue = 0; hue < 360; hue++) {\n for (sat = 0; sat < this.r; sat++) {\n x = this.centerCoordinates.x + sat * Math.sin(angleConvert * hue);\n y = this.centerCoordinates.y + sat * Math.cos(angleConvert * hue);\n rgb = util.HSVToRGB(hue * hfac, sat * sfac, 1);\n ctx.fillStyle = 'rgb(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ')';\n ctx.fillRect(x - 0.5, y - 0.5, 2, 2);\n }\n }\n ctx.strokeStyle = 'rgba(0,0,0,1)';\n ctx.circle(this.centerCoordinates.x, this.centerCoordinates.y, this.r);\n ctx.stroke();\n\n this.hueCircle = ctx.getImageData(0,0,w,h);\n }\n this.generated = true;\n }\n\n\n /**\n * move the selector. This is called by hammer functions.\n *\n * @param event\n * @private\n */\n _moveSelector(event) {\n let rect = this.colorPickerDiv.getBoundingClientRect();\n let left = event.center.x - rect.left;\n let top = event.center.y - rect.top;\n\n let centerY = 0.5 * this.colorPickerDiv.clientHeight;\n let centerX = 0.5 * this.colorPickerDiv.clientWidth;\n\n let x = left - centerX;\n let y = top - centerY;\n\n let angle = Math.atan2(x,y);\n let radius = 0.98 * Math.min(Math.sqrt(x * x + y * y), centerX);\n\n let newTop = Math.cos(angle) * radius + centerY;\n let newLeft = Math.sin(angle) * radius + centerX;\n\n this.colorPickerSelector.style.top = newTop - 0.5 * this.colorPickerSelector.clientHeight + 'px';\n this.colorPickerSelector.style.left = newLeft - 0.5 * this.colorPickerSelector.clientWidth + 'px';\n\n // set color\n let h = angle / (2 * Math.PI);\n h = h < 0 ? h + 1 : h;\n let s = radius / this.r;\n let hsv = util.RGBToHSV(this.color.r, this.color.g, this.color.b);\n hsv.h = h;\n hsv.s = s;\n let rgba = util.HSVToRGB(hsv.h, hsv.s, hsv.v);\n rgba['a'] = this.color.a;\n this.color = rgba;\n\n // update previews\n this.initialColorDiv.style.backgroundColor = 'rgba(' + this.initialColor.r + ',' + this.initialColor.g + ',' + this.initialColor.b + ',' + this.initialColor.a + ')';\n this.newColorDiv.style.backgroundColor = 'rgba(' + this.color.r + ',' + this.color.g + ',' + this.color.b + ',' + this.color.a + ')';\n }\n}\n\nexport default ColorPicker;\n\n\n// WEBPACK FOOTER //\n// ./lib/shared/ColorPicker.js","var Hammer = require('./module/hammer');\n\n/**\n * Register a touch event, taking place before a gesture\n * @param {Hammer} hammer A hammer instance\n * @param {function} callback Callback, called as callback(event)\n */\nexports.onTouch = function (hammer, callback) {\n callback.inputHandler = function (event) {\n if (event.isFirst) {\n callback(event);\n }\n };\n\n hammer.on('hammer.input', callback.inputHandler);\n};\n\n/**\n * Register a release event, taking place after a gesture\n * @param {Hammer} hammer A hammer instance\n * @param {function} callback Callback, called as callback(event)\n */\nexports.onRelease = function (hammer, callback) {\n callback.inputHandler = function (event) {\n if (event.isFinal) {\n callback(event);\n }\n };\n\n return hammer.on('hammer.input', callback.inputHandler);\n};\n\n\n/**\n * Unregister a touch event, taking place before a gesture\n * @param {Hammer} hammer A hammer instance\n * @param {function} callback Callback, called as callback(event)\n */\nexports.offTouch = function (hammer, callback) {\n hammer.off('hammer.input', callback.inputHandler);\n};\n\n/**\n * Unregister a release event, taking place before a gesture\n * @param {Hammer} hammer A hammer instance\n * @param {function} callback Callback, called as callback(event)\n */\nexports.offRelease = exports.offTouch;\n\n/**\n * Hack the PinchRecognizer such that it doesn't prevent default behavior\n * for vertical panning.\n *\n * Yeah ... this is quite a hack ... see https://github.com/hammerjs/hammer.js/issues/932\n *\n * @param {Hammer.Pinch} pinchRecognizer\n * @return {Hammer.Pinch} returns the pinchRecognizer\n */\nexports.disablePreventDefaultVertically = function (pinchRecognizer) {\n var TOUCH_ACTION_PAN_Y = 'pan-y';\n\n pinchRecognizer.getTouchAction = function() {\n // default method returns [TOUCH_ACTION_NONE]\n return [TOUCH_ACTION_PAN_Y];\n };\n\n return pinchRecognizer;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./lib/hammerUtil.js","var util = require('../util');\n\nlet errorFound = false;\nlet allOptions;\nlet printStyle = 'background: #FFeeee; color: #dd0000';\n/**\n * Used to validate options.\n */\nclass Validator {\n constructor() {\n }\n\n /**\n * Main function to be called\n * @param options\n * @param subObject\n * @returns {boolean}\n */\n static validate(options, referenceOptions, subObject) {\n errorFound = false;\n allOptions = referenceOptions;\n let usedOptions = referenceOptions;\n if (subObject !== undefined) {\n usedOptions = referenceOptions[subObject];\n }\n Validator.parse(options, usedOptions, []);\n return errorFound;\n }\n\n\n /**\n * Will traverse an object recursively and check every value\n * @param options\n * @param referenceOptions\n * @param path\n */\n static parse(options, referenceOptions, path) {\n for (let option in options) {\n if (options.hasOwnProperty(option)) {\n Validator.check(option, options, referenceOptions, path);\n }\n }\n }\n\n\n /**\n * Check every value. If the value is an object, call the parse function on that object.\n * @param option\n * @param options\n * @param referenceOptions\n * @param path\n */\n static check(option, options, referenceOptions, path) {\n if (referenceOptions[option] === undefined && referenceOptions.__any__ === undefined) {\n Validator.getSuggestion(option, referenceOptions, path);\n }\n else if (referenceOptions[option] === undefined && referenceOptions.__any__ !== undefined) {\n // __any__ is a wildcard. Any value is accepted and will be further analysed by reference.\n if (Validator.getType(options[option]) === 'object' && referenceOptions['__any__'].__type__ !== undefined) {\n // if the any subgroup is not a predefined object int he configurator we do not look deeper into the object.\n Validator.checkFields(option, options, referenceOptions, '__any__', referenceOptions['__any__'].__type__, path);\n }\n else {\n Validator.checkFields(option, options, referenceOptions, '__any__', referenceOptions['__any__'], path);\n }\n }\n else {\n // Since all options in the reference are objects, we can check whether they are supposed to be object to look for the __type__ field.\n if (referenceOptions[option].__type__ !== undefined) {\n // if this should be an object, we check if the correct type has been supplied to account for shorthand options.\n Validator.checkFields(option, options, referenceOptions, option, referenceOptions[option].__type__, path);\n }\n else {\n Validator.checkFields(option, options, referenceOptions, option, referenceOptions[option], path);\n }\n }\n }\n\n /**\n *\n * @param {String} option | the option property\n * @param {Object} options | The supplied options object\n * @param {Object} referenceOptions | The reference options containing all options and their allowed formats\n * @param {String} referenceOption | Usually this is the same as option, except when handling an __any__ tag.\n * @param {String} refOptionType | This is the type object from the reference options\n * @param {Array} path | where in the object is the option\n */\n static checkFields(option, options, referenceOptions, referenceOption, refOptionObj, path) {\n let optionType = Validator.getType(options[option]);\n let refOptionType = refOptionObj[optionType];\n if (refOptionType !== undefined) {\n // if the type is correct, we check if it is supposed to be one of a few select values\n if (Validator.getType(refOptionType) === 'array') {\n if (refOptionType.indexOf(options[option]) === -1) {\n console.log('%cInvalid option detected in \"' + option + '\".' +\n ' Allowed values are:' + Validator.print(refOptionType) + ' not \"' + options[option] + '\". ' + Validator.printLocation(path, option), printStyle);\n errorFound = true;\n }\n else if (optionType === 'object' && referenceOption !== \"__any__\") {\n path = util.copyAndExtendArray(path, option);\n Validator.parse(options[option], referenceOptions[referenceOption], path);\n }\n }\n else if (optionType === 'object' && referenceOption !== \"__any__\") {\n path = util.copyAndExtendArray(path, option);\n Validator.parse(options[option], referenceOptions[referenceOption], path);\n }\n }\n else if (refOptionObj['any'] === undefined) {\n // type of the field is incorrect and the field cannot be any\n console.log('%cInvalid type received for \"' + option + '\". Expected: ' + Validator.print(Object.keys(refOptionObj)) + '. Received [' + optionType + '] \"' + options[option] + '\"' + Validator.printLocation(path, option), printStyle);\n errorFound = true;\n }\n }\n\n\n static getType(object) {\n var type = typeof object;\n\n if (type === 'object') {\n if (object === null) {\n return 'null';\n }\n if (object instanceof Boolean) {\n return 'boolean';\n }\n if (object instanceof Number) {\n return 'number';\n }\n if (object instanceof String) {\n return 'string';\n }\n if (Array.isArray(object)) {\n return 'array';\n }\n if (object instanceof Date) {\n return 'date';\n }\n if (object.nodeType !== undefined) {\n return 'dom';\n }\n if (object._isAMomentObject === true) {\n return 'moment';\n }\n return 'object';\n }\n else if (type === 'number') {\n return 'number';\n }\n else if (type === 'boolean') {\n return 'boolean';\n }\n else if (type === 'string') {\n return 'string';\n }\n else if (type === undefined) {\n return 'undefined';\n }\n return type;\n }\n\n static getSuggestion(option, options, path) {\n let localSearch = Validator.findInOptions(option,options,path,false);\n let globalSearch = Validator.findInOptions(option,allOptions,[],true);\n\n let localSearchThreshold = 8;\n let globalSearchThreshold = 4;\n\n if (localSearch.indexMatch !== undefined) {\n console.log('%cUnknown option detected: \"' + option + '\" in ' + Validator.printLocation(localSearch.path, option,'') + 'Perhaps it was incomplete? Did you mean: \"' + localSearch.indexMatch + '\"?\\n\\n', printStyle);\n }\n else if (globalSearch.distance <= globalSearchThreshold && localSearch.distance > globalSearch.distance) {\n console.log('%cUnknown option detected: \"' + option + '\" in ' + Validator.printLocation(localSearch.path, option,'') + 'Perhaps it was misplaced? Matching option found at: ' + Validator.printLocation(globalSearch.path, globalSearch.closestMatch,''), printStyle);\n }\n else if (localSearch.distance <= localSearchThreshold) {\n console.log('%cUnknown option detected: \"' + option + '\". Did you mean \"' + localSearch.closestMatch + '\"?' + Validator.printLocation(localSearch.path, option), printStyle);\n }\n else {\n console.log('%cUnknown option detected: \"' + option + '\". Did you mean one of these: ' + Validator.print(Object.keys(options)) + Validator.printLocation(path, option), printStyle);\n }\n\n errorFound = true;\n }\n\n /**\n * traverse the options in search for a match.\n * @param option\n * @param options\n * @param path\n * @param recursive\n * @returns {{closestMatch: string, path: Array, distance: number}}\n */\n static findInOptions(option, options, path, recursive = false) {\n let min = 1e9;\n let closestMatch = '';\n let closestMatchPath = [];\n let lowerCaseOption = option.toLowerCase();\n let indexMatch = undefined;\n for (let op in options) {\n let distance;\n if (options[op].__type__ !== undefined && recursive === true) {\n let result = Validator.findInOptions(option, options[op], util.copyAndExtendArray(path,op));\n if (min > result.distance) {\n closestMatch = result.closestMatch;\n closestMatchPath = result.path;\n min = result.distance;\n indexMatch = result.indexMatch;\n }\n }\n else {\n if (op.toLowerCase().indexOf(lowerCaseOption) !== -1) {\n indexMatch = op;\n }\n distance = Validator.levenshteinDistance(option, op);\n if (min > distance) {\n closestMatch = op;\n closestMatchPath = util.copyArray(path);\n min = distance;\n }\n }\n }\n return {closestMatch:closestMatch, path:closestMatchPath, distance:min, indexMatch: indexMatch};\n }\n\n static printLocation(path, option, prefix = 'Problem value found at: \\n') {\n let str = '\\n\\n' + prefix + 'options = {\\n';\n for (let i = 0; i < path.length; i++) {\n for (let j = 0; j < i + 1; j++) {\n str += ' ';\n }\n str += path[i] + ': {\\n'\n }\n for (let j = 0; j < path.length + 1; j++) {\n str += ' ';\n }\n str += option + '\\n';\n for (let i = 0; i < path.length + 1; i++) {\n for (let j = 0; j < path.length - i; j++) {\n str += ' ';\n }\n str += '}\\n'\n }\n return str + '\\n\\n';\n }\n\n static print(options) {\n return JSON.stringify(options).replace(/(\\\")|(\\[)|(\\])|(,\"__type__\")/g, \"\").replace(/(\\,)/g, ', ')\n }\n\n\n // Compute the edit distance between the two given strings\n // http://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Levenshtein_distance#JavaScript\n /*\n Copyright (c) 2011 Andrei Mackenzie\n\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n static levenshteinDistance(a, b) {\n if (a.length === 0) return b.length;\n if (b.length === 0) return a.length;\n\n var matrix = [];\n\n // increment along the first column of each row\n var i;\n for (i = 0; i <= b.length; i++) {\n matrix[i] = [i];\n }\n\n // increment each column in the first row\n var j;\n for (j = 0; j <= a.length; j++) {\n matrix[0][j] = j;\n }\n\n // Fill in the rest of the matrix\n for (i = 1; i <= b.length; i++) {\n for (j = 1; j <= a.length; j++) {\n if (b.charAt(i - 1) == a.charAt(j - 1)) {\n matrix[i][j] = matrix[i - 1][j - 1];\n } else {\n matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, // substitution\n Math.min(matrix[i][j - 1] + 1, // insertion\n matrix[i - 1][j] + 1)); // deletion\n }\n }\n }\n\n return matrix[b.length][a.length];\n }\n\n;\n}\n\n\nexport default Validator;\nexport {printStyle}\n\n\n// WEBPACK FOOTER //\n// ./lib/shared/Validator.js","var util = require('../util');\nvar hammerUtil = require('../hammerUtil');\nvar moment = require('../module/moment');\nvar Component = require('./component/Component');\nvar DateUtil = require('./DateUtil');\n\n/**\n * @constructor Range\n * A Range controls a numeric range with a start and end value.\n * The Range adjusts the range based on mouse events or programmatic changes,\n * and triggers events when the range is changing or has been changed.\n * @param {{dom: Object, domProps: Object, emitter: Emitter}} body\n * @param {Object} [options] See description at Range.setOptions\n */\nfunction Range(body, options) {\n var now = moment().hours(0).minutes(0).seconds(0).milliseconds(0);\n var start = now.clone().add(-3, 'days').valueOf();\n var end = now.clone().add(-3, 'days').valueOf(); \n\n if(options === undefined) {\n this.start = start;\n this.end = end;\n } else {\n this.start = options.start || start\n this.end = options.end || end\n }\n\n this.rolling = false;\n\n this.body = body;\n this.deltaDifference = 0;\n this.scaleOffset = 0;\n this.startToFront = false;\n this.endToFront = true;\n\n // default options\n this.defaultOptions = {\n rtl: false,\n start: null,\n end: null,\n moment: moment,\n direction: 'horizontal', // 'horizontal' or 'vertical'\n moveable: true,\n zoomable: true,\n min: null,\n max: null,\n zoomMin: 10, // milliseconds\n zoomMax: 1000 * 60 * 60 * 24 * 365 * 10000 // milliseconds\n };\n this.options = util.extend({}, this.defaultOptions);\n this.props = {\n touch: {}\n };\n this.animationTimer = null;\n\n // drag listeners for dragging\n this.body.emitter.on('panstart', this._onDragStart.bind(this));\n this.body.emitter.on('panmove', this._onDrag.bind(this));\n this.body.emitter.on('panend', this._onDragEnd.bind(this));\n\n // mouse wheel for zooming\n this.body.emitter.on('mousewheel', this._onMouseWheel.bind(this));\n\n // pinch to zoom\n this.body.emitter.on('touch', this._onTouch.bind(this));\n this.body.emitter.on('pinch', this._onPinch.bind(this));\n\n // on click of rolling mode button\n this.body.dom.rollingModeBtn.addEventListener('click', this.startRolling.bind(this));\n\n this.setOptions(options);\n}\n\nRange.prototype = new Component();\n\n/**\n * Set options for the range controller\n * @param {Object} options Available options:\n * {Number | Date | String} start Start date for the range\n * {Number | Date | String} end End date for the range\n * {Number} min Minimum value for start\n * {Number} max Maximum value for end\n * {Number} zoomMin Set a minimum value for\n * (end - start).\n * {Number} zoomMax Set a maximum value for\n * (end - start).\n * {Boolean} moveable Enable moving of the range\n * by dragging. True by default\n * {Boolean} zoomable Enable zooming of the range\n * by pinching/scrolling. True by default\n */\nRange.prototype.setOptions = function (options) {\n if (options) {\n // copy the options that we know\n var fields = [\n 'animation', 'direction', 'min', 'max', 'zoomMin', 'zoomMax', 'moveable', 'zoomable',\n 'moment', 'activate', 'hiddenDates', 'zoomKey', 'rtl', 'showCurrentTime', 'rollMode', 'horizontalScroll'\n ];\n util.selectiveExtend(fields, this.options, options);\n\n if (options.rollingMode) {\n this.startRolling();\n }\n if ('start' in options || 'end' in options) {\n // apply a new range. both start and end are optional\n this.setRange(options.start, options.end);\n }\n }\n};\n\n/**\n * Test whether direction has a valid value\n * @param {String} direction 'horizontal' or 'vertical'\n */\nfunction validateDirection (direction) {\n if (direction != 'horizontal' && direction != 'vertical') {\n throw new TypeError('Unknown direction \"' + direction + '\". ' +\n 'Choose \"horizontal\" or \"vertical\".');\n }\n}\n\n/**\n * Start auto refreshing the current time bar\n */\nRange.prototype.startRolling = function() {\n var me = this;\n\n\n function update () {\n me.stopRolling();\n me.rolling = true;\n\n\n var interval = me.end - me.start;\n var t = util.convert(new Date(), 'Date').valueOf();\n\n var start = t - interval / 2;\n var end = t + interval / 2;\n var animation = (me.options && me.options.animation !== undefined) ? me.options.animation : true;\n\n me.setRange(start, end, false);\n\n // determine interval to refresh\n var scale = me.conversion(me.body.domProps.center.width).scale;\n var interval = 1 / scale / 10;\n if (interval < 30) interval = 30;\n if (interval > 1000) interval = 1000;\n\n me.body.dom.rollingModeBtn.style.visibility = \"hidden\";\n // start a renderTimer to adjust for the new time\n me.currentTimeTimer = setTimeout(update, interval);\n }\n\n update();\n};\n\n/**\n * Stop auto refreshing the current time bar\n */\nRange.prototype.stopRolling = function() {\n if (this.currentTimeTimer !== undefined) {\n clearTimeout(this.currentTimeTimer);\n this.rolling = false;\n this.body.dom.rollingModeBtn.style.visibility = \"visible\";\n }\n};\n\n/**\n * Set a new start and end range\n * @param {Date | Number | String} [start]\n * @param {Date | Number | String} [end]\n * @param {boolean | {duration: number, easingFunction: string}} [animation=false]\n * If true (default), the range is animated\n * smoothly to the new window. An object can be\n * provided to specify duration and easing function.\n * Default duration is 500 ms, and default easing\n * function is 'easeInOutQuad'.\n * @param {Boolean} [byUser=false]\n *\n */\nRange.prototype.setRange = function(start, end, animation, byUser, event) {\n if (byUser !== true) {\n byUser = false;\n }\n var finalStart = start != undefined ? util.convert(start, 'Date').valueOf() : null;\n var finalEnd = end != undefined ? util.convert(end, 'Date').valueOf() : null;\n this._cancelAnimation();\n\n if (animation) { // true or an Object\n var me = this;\n var initStart = this.start;\n var initEnd = this.end;\n var duration = (typeof animation === 'object' && 'duration' in animation) ? animation.duration : 500;\n var easingName = (typeof animation === 'object' && 'easingFunction' in animation) ? animation.easingFunction : 'easeInOutQuad';\n var easingFunction = util.easingFunctions[easingName];\n if (!easingFunction) {\n throw new Error('Unknown easing function ' + JSON.stringify(easingName) + '. ' +\n 'Choose from: ' + Object.keys(util.easingFunctions).join(', '));\n }\n\n var initTime = new Date().valueOf();\n var anyChanged = false;\n\n var next = function () {\n if (!me.props.touch.dragging) {\n var now = new Date().valueOf();\n var time = now - initTime;\n var ease = easingFunction(time / duration);\n var done = time > duration;\n var s = (done || finalStart === null) ? finalStart : initStart + (finalStart - initStart) * ease;\n var e = (done || finalEnd === null) ? finalEnd : initEnd + (finalEnd - initEnd) * ease;\n\n changed = me._applyRange(s, e);\n DateUtil.updateHiddenDates(me.options.moment, me.body, me.options.hiddenDates);\n anyChanged = anyChanged || changed;\n\n var params = {\n start: new Date(me.start), \n end: new Date(me.end), \n byUser:byUser,\n event: util.elementsCensor(event)\n }\n\n if (changed) {\n me.body.emitter.emit('rangechange', params);\n }\n\n if (done) {\n if (anyChanged) {\n me.body.emitter.emit('rangechanged', params);\n }\n }\n else {\n // animate with as high as possible frame rate, leave 20 ms in between\n // each to prevent the browser from blocking\n me.animationTimer = setTimeout(next, 20);\n }\n }\n };\n\n return next();\n }\n else {\n var changed = this._applyRange(finalStart, finalEnd);\n DateUtil.updateHiddenDates(this.options.moment, this.body, this.options.hiddenDates);\n if (changed) {\n var params = {\n start: new Date(this.start), \n end: new Date(this.end), \n byUser:byUser, \n event: util.elementsCensor(event)\n };\n this.body.emitter.emit('rangechange', params);\n this.body.emitter.emit('rangechanged', params);\n }\n }\n};\n\n/**\n * Stop an animation\n * @private\n */\nRange.prototype._cancelAnimation = function () {\n if (this.animationTimer) {\n clearTimeout(this.animationTimer);\n this.animationTimer = null;\n }\n};\n\n/**\n * Set a new start and end range. This method is the same as setRange, but\n * does not trigger a range change and range changed event, and it returns\n * true when the range is changed\n * @param {Number} [start]\n * @param {Number} [end]\n * @return {Boolean} changed\n * @private\n */\nRange.prototype._applyRange = function(start, end) {\n var newStart = (start != null) ? util.convert(start, 'Date').valueOf() : this.start,\n newEnd = (end != null) ? util.convert(end, 'Date').valueOf() : this.end,\n max = (this.options.max != null) ? util.convert(this.options.max, 'Date').valueOf() : null,\n min = (this.options.min != null) ? util.convert(this.options.min, 'Date').valueOf() : null,\n diff;\n\n // check for valid number\n if (isNaN(newStart) || newStart === null) {\n throw new Error('Invalid start \"' + start + '\"');\n }\n if (isNaN(newEnd) || newEnd === null) {\n throw new Error('Invalid end \"' + end + '\"');\n }\n\n // prevent start < end\n if (newEnd < newStart) {\n newEnd = newStart;\n }\n\n // prevent start < min\n if (min !== null) {\n if (newStart < min) {\n diff = (min - newStart);\n newStart += diff;\n newEnd += diff;\n\n // prevent end > max\n if (max != null) {\n if (newEnd > max) {\n newEnd = max;\n }\n }\n }\n }\n\n // prevent end > max\n if (max !== null) {\n if (newEnd > max) {\n diff = (newEnd - max);\n newStart -= diff;\n newEnd -= diff;\n\n // prevent start < min\n if (min != null) {\n if (newStart < min) {\n newStart = min;\n }\n }\n }\n }\n\n // prevent (end-start) < zoomMin\n if (this.options.zoomMin !== null) {\n var zoomMin = parseFloat(this.options.zoomMin);\n if (zoomMin < 0) {\n zoomMin = 0;\n }\n if ((newEnd - newStart) < zoomMin) {\n if ((this.end - this.start) === zoomMin && newStart > this.start && newEnd < this.end) {\n // ignore this action, we are already zoomed to the minimum\n newStart = this.start;\n newEnd = this.end;\n }\n else {\n // zoom to the minimum\n diff = (zoomMin - (newEnd - newStart));\n newStart -= diff / 2;\n newEnd += diff / 2;\n }\n }\n }\n\n // prevent (end-start) > zoomMax\n if (this.options.zoomMax !== null) {\n var zoomMax = parseFloat(this.options.zoomMax);\n if (zoomMax < 0) {\n zoomMax = 0;\n }\n\n if ((newEnd - newStart) > zoomMax) {\n if ((this.end - this.start) === zoomMax && newStart < this.start && newEnd > this.end) {\n // ignore this action, we are already zoomed to the maximum\n newStart = this.start;\n newEnd = this.end;\n }\n else {\n // zoom to the maximum\n diff = ((newEnd - newStart) - zoomMax);\n newStart += diff / 2;\n newEnd -= diff / 2;\n }\n }\n }\n\n var changed = (this.start != newStart || this.end != newEnd);\n\n // if the new range does NOT overlap with the old range, emit checkRangedItems to avoid not showing ranged items (ranged meaning has end time, not necessarily of type Range)\n if (!((newStart >= this.start && newStart <= this.end) || (newEnd >= this.start && newEnd <= this.end)) &&\n !((this.start >= newStart && this.start <= newEnd) || (this.end >= newStart && this.end <= newEnd) )) {\n this.body.emitter.emit('checkRangedItems');\n }\n\n this.start = newStart;\n this.end = newEnd;\n return changed;\n};\n\n/**\n * Retrieve the current range.\n * @return {Object} An object with start and end properties\n */\nRange.prototype.getRange = function() {\n return {\n start: this.start,\n end: this.end\n };\n};\n\n/**\n * Calculate the conversion offset and scale for current range, based on\n * the provided width\n * @param {Number} width\n * @returns {{offset: number, scale: number}} conversion\n */\nRange.prototype.conversion = function (width, totalHidden) {\n return Range.conversion(this.start, this.end, width, totalHidden);\n};\n\n/**\n * Static method to calculate the conversion offset and scale for a range,\n * based on the provided start, end, and width\n * @param {Number} start\n * @param {Number} end\n * @param {Number} width\n * @returns {{offset: number, scale: number}} conversion\n */\nRange.conversion = function (start, end, width, totalHidden) {\n if (totalHidden === undefined) {\n totalHidden = 0;\n }\n if (width != 0 && (end - start != 0)) {\n return {\n offset: start,\n scale: width / (end - start - totalHidden)\n }\n }\n else {\n return {\n offset: 0,\n scale: 1\n };\n }\n};\n\n/**\n * Start dragging horizontally or vertically\n * @param {Event} event\n * @private\n */\nRange.prototype._onDragStart = function(event) {\n this.deltaDifference = 0;\n this.previousDelta = 0;\n\n // only allow dragging when configured as movable\n if (!this.options.moveable) return;\n\n // only start dragging when the mouse is inside the current range\n if (!this._isInsideRange(event)) return;\n\n // refuse to drag when we where pinching to prevent the timeline make a jump\n // when releasing the fingers in opposite order from the touch screen\n if (!this.props.touch.allowDragging) return;\n\n this.stopRolling();\n\n this.props.touch.start = this.start;\n this.props.touch.end = this.end;\n this.props.touch.dragging = true;\n\n if (this.body.dom.root) {\n this.body.dom.root.style.cursor = 'move';\n }\n};\n\n/**\n * Perform dragging operation\n * @param {Event} event\n * @private\n */\nRange.prototype._onDrag = function (event) {\n if (!event) return\n\n if (!this.props.touch.dragging) return;\n\n // only allow dragging when configured as movable\n if (!this.options.moveable) return;\n\n // TODO: this may be redundant in hammerjs2\n // refuse to drag when we where pinching to prevent the timeline make a jump\n // when releasing the fingers in opposite order from the touch screen\n if (!this.props.touch.allowDragging) return;\n\n var direction = this.options.direction;\n validateDirection(direction);\n var delta = (direction == 'horizontal') ? event.deltaX : event.deltaY;\n delta -= this.deltaDifference;\n var interval = (this.props.touch.end - this.props.touch.start);\n\n // normalize dragging speed if cutout is in between.\n var duration = DateUtil.getHiddenDurationBetween(this.body.hiddenDates, this.start, this.end);\n interval -= duration;\n\n var width = (direction == 'horizontal') ? this.body.domProps.center.width : this.body.domProps.center.height;\n\n if (this.options.rtl) {\n var diffRange = delta / width * interval;\n } else {\n var diffRange = -delta / width * interval;\n }\n\n var newStart = this.props.touch.start + diffRange;\n var newEnd = this.props.touch.end + diffRange;\n\n // snapping times away from hidden zones\n var safeStart = DateUtil.snapAwayFromHidden(this.body.hiddenDates, newStart, this.previousDelta-delta, true);\n var safeEnd = DateUtil.snapAwayFromHidden(this.body.hiddenDates, newEnd, this.previousDelta-delta, true);\n if (safeStart != newStart || safeEnd != newEnd) {\n this.deltaDifference += delta;\n this.props.touch.start = safeStart;\n this.props.touch.end = safeEnd;\n this._onDrag(event);\n return;\n }\n\n this.previousDelta = delta;\n this._applyRange(newStart, newEnd);\n\n\n var startDate = new Date(this.start);\n var endDate = new Date(this.end);\n\n // fire a rangechange event\n this.body.emitter.emit('rangechange', {\n start: startDate,\n end: endDate,\n byUser: true,\n event: util.elementsCensor(event)\n });\n\n // fire a panmove event\n this.body.emitter.emit('panmove');\n};\n\n/**\n * Stop dragging operation\n * @param {event} event\n * @private\n */\nRange.prototype._onDragEnd = function (event) {\n if (!this.props.touch.dragging) return;\n\n // only allow dragging when configured as movable\n if (!this.options.moveable) return;\n\n // TODO: this may be redundant in hammerjs2\n // refuse to drag when we where pinching to prevent the timeline make a jump\n // when releasing the fingers in opposite order from the touch screen\n if (!this.props.touch.allowDragging) return;\n\n this.props.touch.dragging = false;\n if (this.body.dom.root) {\n this.body.dom.root.style.cursor = 'auto';\n }\n\n // fire a rangechanged event\n this.body.emitter.emit('rangechanged', {\n start: new Date(this.start),\n end: new Date(this.end),\n byUser: true,\n event: util.elementsCensor(event)\n });\n};\n\n/**\n * Event handler for mouse wheel event, used to zoom\n * Code from http://adomas.org/javascript-mouse-wheel/\n * @param {Event} event\n * @private\n */\nRange.prototype._onMouseWheel = function(event) {\n // retrieve delta\n var delta = 0;\n if (event.wheelDelta) { /* IE/Opera. */\n delta = event.wheelDelta / 120;\n } else if (event.detail) { /* Mozilla case. */\n // In Mozilla, sign of delta is different than in IE.\n // Also, delta is multiple of 3.\n delta = -event.detail / 3;\n }\n\n // don't allow zoom when the according key is pressed and the zoomKey option or not zoomable but movable\n if ((this.options.zoomKey && !event[this.options.zoomKey] && this.options.zoomable) \n || (!this.options.zoomable && this.options.moveable)) {\n if (this.options.horizontalScroll) {\n // Prevent default actions caused by mouse wheel\n // (else the page and timeline both scroll)\n event.preventDefault();\n \n // calculate a single scroll jump relative to the range scale\n var diff = delta * (this.end - this.start) / 20;\n // calculate new start and end\n var newStart = this.start - diff;\n var newEnd = this.end - diff;\n\n this.setRange(newStart, newEnd, false, true, event);\n }\n return;\n }\n\n // only allow zooming when configured as zoomable and moveable\n if (!(this.options.zoomable && this.options.moveable)) return;\n \n // only zoom when the mouse is inside the current range\n if (!this._isInsideRange(event)) return;\n\n // If delta is nonzero, handle it.\n // Basically, delta is now positive if wheel was scrolled up,\n // and negative, if wheel was scrolled down.\n if (delta) {\n // perform the zoom action. Delta is normally 1 or -1\n\n // adjust a negative delta such that zooming in with delta 0.1\n // equals zooming out with a delta -0.1\n var scale;\n if (delta < 0) {\n scale = 1 - (delta / 5);\n }\n else {\n scale = 1 / (1 + (delta / 5)) ;\n }\n\n // calculate center, the date to zoom around\n var pointerDate\n if (this.rolling) {\n pointerDate = (this.start + this.end) / 2;\n } else {\n var pointer = this.getPointer({x: event.clientX, y: event.clientY}, this.body.dom.center);\n pointerDate = this._pointerToDate(pointer);\n }\n this.zoom(scale, pointerDate, delta, event);\n\n // Prevent default actions caused by mouse wheel\n // (else the page and timeline both scroll)\n event.preventDefault();\n }\n};\n\n/**\n * Start of a touch gesture\n * @private\n */\nRange.prototype._onTouch = function (event) {\n this.props.touch.start = this.start;\n this.props.touch.end = this.end;\n this.props.touch.allowDragging = true;\n this.props.touch.center = null;\n this.scaleOffset = 0;\n this.deltaDifference = 0;\n};\n\n/**\n * Handle pinch event\n * @param {Event} event\n * @private\n */\nRange.prototype._onPinch = function (event) {\n // only allow zooming when configured as zoomable and moveable\n if (!(this.options.zoomable && this.options.moveable)) return;\n\n this.props.touch.allowDragging = false;\n\n if (!this.props.touch.center) {\n this.props.touch.center = this.getPointer(event.center, this.body.dom.center);\n }\n\n this.stopRolling();\n\n var scale = 1 / (event.scale + this.scaleOffset);\n var centerDate = this._pointerToDate(this.props.touch.center);\n\n var hiddenDuration = DateUtil.getHiddenDurationBetween(this.body.hiddenDates, this.start, this.end);\n var hiddenDurationBefore = DateUtil.getHiddenDurationBefore(this.options.moment, this.body.hiddenDates, this, centerDate);\n var hiddenDurationAfter = hiddenDuration - hiddenDurationBefore;\n\n // calculate new start and end\n var newStart = (centerDate - hiddenDurationBefore) + (this.props.touch.start - (centerDate - hiddenDurationBefore)) * scale;\n var newEnd = (centerDate + hiddenDurationAfter) + (this.props.touch.end - (centerDate + hiddenDurationAfter)) * scale;\n\n // snapping times away from hidden zones\n this.startToFront = 1 - scale <= 0; // used to do the right auto correction with periodic hidden times\n this.endToFront = scale - 1 <= 0; // used to do the right auto correction with periodic hidden times\n\n var safeStart = DateUtil.snapAwayFromHidden(this.body.hiddenDates, newStart, 1 - scale, true);\n var safeEnd = DateUtil.snapAwayFromHidden(this.body.hiddenDates, newEnd, scale - 1, true);\n if (safeStart != newStart || safeEnd != newEnd) {\n this.props.touch.start = safeStart;\n this.props.touch.end = safeEnd;\n this.scaleOffset = 1 - event.scale;\n newStart = safeStart;\n newEnd = safeEnd;\n }\n\n this.setRange(newStart, newEnd, false, true, event);\n\n this.startToFront = false; // revert to default\n this.endToFront = true; // revert to default\n};\n\n/**\n * Test whether the mouse from a mouse event is inside the visible window,\n * between the current start and end date\n * @param {Object} event\n * @return {boolean} Returns true when inside the visible window\n * @private\n */\nRange.prototype._isInsideRange = function(event) {\n // calculate the time where the mouse is, check whether inside\n // and no scroll action should happen.\n var clientX = event.center ? event.center.x : event.clientX;\n if (this.options.rtl) {\n var x = clientX - util.getAbsoluteLeft(this.body.dom.centerContainer);\n } else {\n var x = util.getAbsoluteRight(this.body.dom.centerContainer) - clientX;\n }\n var time = this.body.util.toTime(x);\n\n return time >= this.start && time <= this.end;\n};\n\n/**\n * Helper function to calculate the center date for zooming\n * @param {{x: Number, y: Number}} pointer\n * @return {number} date\n * @private\n */\nRange.prototype._pointerToDate = function (pointer) {\n var conversion;\n var direction = this.options.direction;\n\n validateDirection(direction);\n\n if (direction == 'horizontal') {\n return this.body.util.toTime(pointer.x).valueOf();\n }\n else {\n var height = this.body.domProps.center.height;\n conversion = this.conversion(height);\n return pointer.y / conversion.scale + conversion.offset;\n }\n};\n\n/**\n * Get the pointer location relative to the location of the dom element\n * @param {{x: Number, y: Number}} touch\n * @param {Element} element HTML DOM element\n * @return {{x: Number, y: Number}} pointer\n * @private\n */\nRange.prototype.getPointer = function (touch, element) {\n if (this.options.rtl) {\n return {\n x: util.getAbsoluteRight(element) - touch.x,\n y: touch.y - util.getAbsoluteTop(element)\n };\n } else {\n return {\n x: touch.x - util.getAbsoluteLeft(element),\n y: touch.y - util.getAbsoluteTop(element)\n };\n }\n}\n\n/**\n * Zoom the range the given scale in or out. Start and end date will\n * be adjusted, and the timeline will be redrawn. You can optionally give a\n * date around which to zoom.\n * For example, try scale = 0.9 or 1.1\n * @param {Number} scale Scaling factor. Values above 1 will zoom out,\n * values below 1 will zoom in.\n * @param {Number} [center] Value representing a date around which will\n * be zoomed.\n */\nRange.prototype.zoom = function(scale, center, delta, event) {\n // if centerDate is not provided, take it half between start Date and end Date\n if (center == null) {\n center = (this.start + this.end) / 2;\n }\n\n var hiddenDuration = DateUtil.getHiddenDurationBetween(this.body.hiddenDates, this.start, this.end);\n var hiddenDurationBefore = DateUtil.getHiddenDurationBefore(this.options.moment, this.body.hiddenDates, this, center);\n var hiddenDurationAfter = hiddenDuration - hiddenDurationBefore;\n\n // calculate new start and end\n var newStart = (center-hiddenDurationBefore) + (this.start - (center-hiddenDurationBefore)) * scale;\n var newEnd = (center+hiddenDurationAfter) + (this.end - (center+hiddenDurationAfter)) * scale;\n\n // snapping times away from hidden zones\n this.startToFront = delta > 0 ? false : true; // used to do the right autocorrection with periodic hidden times\n this.endToFront = -delta > 0 ? false : true; // used to do the right autocorrection with periodic hidden times\n var safeStart = DateUtil.snapAwayFromHidden(this.body.hiddenDates, newStart, delta, true);\n var safeEnd = DateUtil.snapAwayFromHidden(this.body.hiddenDates, newEnd, -delta, true);\n if (safeStart != newStart || safeEnd != newEnd) {\n newStart = safeStart;\n newEnd = safeEnd;\n }\n\n this.setRange(newStart, newEnd, false, true, event);\n\n this.startToFront = false; // revert to default\n this.endToFront = true; // revert to default\n};\n\n\n\n/**\n * Move the range with a given delta to the left or right. Start and end\n * value will be adjusted. For example, try delta = 0.1 or -0.1\n * @param {Number} delta Moving amount. Positive value will move right,\n * negative value will move left\n */\nRange.prototype.move = function(delta) {\n // zoom start Date and end Date relative to the centerDate\n var diff = (this.end - this.start);\n\n // apply new values\n var newStart = this.start + diff * delta;\n var newEnd = this.end + diff * delta;\n\n // TODO: reckon with min and max range\n\n this.start = newStart;\n this.end = newEnd;\n};\n\n/**\n * Move the range to a new center point\n * @param {Number} moveTo New center point of the range\n */\nRange.prototype.moveTo = function(moveTo) {\n var center = (this.start + this.end) / 2;\n\n var diff = center - moveTo;\n\n // calculate new start and end\n var newStart = this.start - diff;\n var newEnd = this.end - diff;\n\n this.setRange(newStart, newEnd, false, true, event);\n};\n\nmodule.exports = Range;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/timeline/Range.js","var util = require('../../util');\n\n/**\n * Prototype for visual components\n * @param {{dom: Object, domProps: Object, emitter: Emitter, range: Range}} [body]\n * @param {Object} [options]\n */\nfunction Component (body, options) {\n this.options = null;\n this.props = null;\n}\n\n/**\n * Set options for the component. The new options will be merged into the\n * current options.\n * @param {Object} options\n */\nComponent.prototype.setOptions = function(options) {\n if (options) {\n util.extend(this.options, options);\n }\n};\n\n/**\n * Repaint the component\n * @return {boolean} Returns true if the component is resized\n */\nComponent.prototype.redraw = function() {\n // should be implemented by the component\n return false;\n};\n\n/**\n * Destroy the component. Cleanup DOM and event listeners\n */\nComponent.prototype.destroy = function() {\n // should be implemented by the component\n};\n\n/**\n * Test whether the component is resized since the last time _isResized() was\n * called.\n * @return {Boolean} Returns true if the component is resized\n * @protected\n */\nComponent.prototype._isResized = function() {\n var resized = (this.props._previousWidth !== this.props.width ||\n this.props._previousHeight !== this.props.height);\n\n this.props._previousWidth = this.props.width;\n this.props._previousHeight = this.props.height;\n\n return resized;\n};\n\nmodule.exports = Component;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/timeline/component/Component.js","\n/**\n * used in Core to convert the options into a volatile variable\n * \n * @param {function} moment\n * @param {Object} body\n * @param {Array | Object} hiddenDates\n */\nexports.convertHiddenOptions = function(moment, body, hiddenDates) {\n if (hiddenDates && !Array.isArray(hiddenDates)) {\n return exports.convertHiddenOptions(moment, body, [hiddenDates])\n }\n\n body.hiddenDates = [];\n if (hiddenDates) {\n if (Array.isArray(hiddenDates) == true) {\n for (var i = 0; i < hiddenDates.length; i++) {\n if (hiddenDates[i].repeat === undefined) {\n var dateItem = {};\n dateItem.start = moment(hiddenDates[i].start).toDate().valueOf();\n dateItem.end = moment(hiddenDates[i].end).toDate().valueOf();\n body.hiddenDates.push(dateItem);\n }\n }\n body.hiddenDates.sort(function (a, b) {\n return a.start - b.start;\n }); // sort by start time\n }\n }\n};\n\n\n/**\n * create new entrees for the repeating hidden dates\n * @param {function} moment\n * @param {Object} body\n * @param {Array | Object} hiddenDates\n */\nexports.updateHiddenDates = function (moment, body, hiddenDates) {\n if (hiddenDates && !Array.isArray(hiddenDates)) {\n return exports.updateHiddenDates(moment, body, [hiddenDates])\n }\n\n if (hiddenDates && body.domProps.centerContainer.width !== undefined) {\n exports.convertHiddenOptions(moment, body, hiddenDates);\n\n var start = moment(body.range.start);\n var end = moment(body.range.end);\n\n var totalRange = (body.range.end - body.range.start);\n var pixelTime = totalRange / body.domProps.centerContainer.width;\n\n for (var i = 0; i < hiddenDates.length; i++) {\n if (hiddenDates[i].repeat !== undefined) {\n var startDate = moment(hiddenDates[i].start);\n var endDate = moment(hiddenDates[i].end);\n\n if (startDate._d == \"Invalid Date\") {\n throw new Error(\"Supplied start date is not valid: \" + hiddenDates[i].start);\n }\n if (endDate._d == \"Invalid Date\") {\n throw new Error(\"Supplied end date is not valid: \" + hiddenDates[i].end);\n }\n\n var duration = endDate - startDate;\n if (duration >= 4 * pixelTime) {\n\n var offset = 0;\n var runUntil = end.clone();\n switch (hiddenDates[i].repeat) {\n case \"daily\": // case of time\n if (startDate.day() != endDate.day()) {\n offset = 1;\n }\n startDate.dayOfYear(start.dayOfYear());\n startDate.year(start.year());\n startDate.subtract(7,'days');\n\n endDate.dayOfYear(start.dayOfYear());\n endDate.year(start.year());\n endDate.subtract(7 - offset,'days');\n\n runUntil.add(1, 'weeks');\n break;\n case \"weekly\":\n var dayOffset = endDate.diff(startDate,'days')\n var day = startDate.day();\n\n // set the start date to the range.start\n startDate.date(start.date());\n startDate.month(start.month());\n startDate.year(start.year());\n endDate = startDate.clone();\n\n // force\n startDate.day(day);\n endDate.day(day);\n endDate.add(dayOffset,'days');\n\n startDate.subtract(1,'weeks');\n endDate.subtract(1,'weeks');\n\n runUntil.add(1, 'weeks');\n break\n case \"monthly\":\n if (startDate.month() != endDate.month()) {\n offset = 1;\n }\n startDate.month(start.month());\n startDate.year(start.year());\n startDate.subtract(1,'months');\n\n endDate.month(start.month());\n endDate.year(start.year());\n endDate.subtract(1,'months');\n endDate.add(offset,'months');\n\n runUntil.add(1, 'months');\n break;\n case \"yearly\":\n if (startDate.year() != endDate.year()) {\n offset = 1;\n }\n startDate.year(start.year());\n startDate.subtract(1,'years');\n endDate.year(start.year());\n endDate.subtract(1,'years');\n endDate.add(offset,'years');\n\n runUntil.add(1, 'years');\n break;\n default:\n console.log(\"Wrong repeat format, allowed are: daily, weekly, monthly, yearly. Given:\", hiddenDates[i].repeat);\n return;\n }\n while (startDate < runUntil) {\n body.hiddenDates.push({start: startDate.valueOf(), end: endDate.valueOf()});\n switch (hiddenDates[i].repeat) {\n case \"daily\":\n startDate.add(1, 'days');\n endDate.add(1, 'days');\n break;\n case \"weekly\":\n startDate.add(1, 'weeks');\n endDate.add(1, 'weeks');\n break;\n case \"monthly\":\n startDate.add(1, 'months');\n endDate.add(1, 'months');\n break;\n case \"yearly\":\n startDate.add(1, 'y');\n endDate.add(1, 'y');\n break;\n default:\n console.log(\"Wrong repeat format, allowed are: daily, weekly, monthly, yearly. Given:\", hiddenDates[i].repeat);\n return;\n }\n }\n body.hiddenDates.push({start: startDate.valueOf(), end: endDate.valueOf()});\n }\n }\n }\n // remove duplicates, merge where possible\n exports.removeDuplicates(body);\n // ensure the new positions are not on hidden dates\n var startHidden = exports.isHidden(body.range.start, body.hiddenDates);\n var endHidden = exports.isHidden(body.range.end,body.hiddenDates);\n var rangeStart = body.range.start;\n var rangeEnd = body.range.end;\n if (startHidden.hidden == true) {rangeStart = body.range.startToFront == true ? startHidden.startDate - 1 : startHidden.endDate + 1;}\n if (endHidden.hidden == true) {rangeEnd = body.range.endToFront == true ? endHidden.startDate - 1 : endHidden.endDate + 1;}\n if (startHidden.hidden == true || endHidden.hidden == true) {\n body.range._applyRange(rangeStart, rangeEnd);\n }\n }\n\n}\n\n\n/**\n * remove duplicates from the hidden dates list. Duplicates are evil. They mess everything up.\n * Scales with N^2\n * @param body\n */\nexports.removeDuplicates = function(body) {\n var hiddenDates = body.hiddenDates;\n var safeDates = [];\n for (var i = 0; i < hiddenDates.length; i++) {\n for (var j = 0; j < hiddenDates.length; j++) {\n if (i != j && hiddenDates[j].remove != true && hiddenDates[i].remove != true) {\n // j inside i\n if (hiddenDates[j].start >= hiddenDates[i].start && hiddenDates[j].end <= hiddenDates[i].end) {\n hiddenDates[j].remove = true;\n }\n // j start inside i\n else if (hiddenDates[j].start >= hiddenDates[i].start && hiddenDates[j].start <= hiddenDates[i].end) {\n hiddenDates[i].end = hiddenDates[j].end;\n hiddenDates[j].remove = true;\n }\n // j end inside i\n else if (hiddenDates[j].end >= hiddenDates[i].start && hiddenDates[j].end <= hiddenDates[i].end) {\n hiddenDates[i].start = hiddenDates[j].start;\n hiddenDates[j].remove = true;\n }\n }\n }\n }\n\n for (var i = 0; i < hiddenDates.length; i++) {\n if (hiddenDates[i].remove !== true) {\n safeDates.push(hiddenDates[i]);\n }\n }\n\n body.hiddenDates = safeDates;\n body.hiddenDates.sort(function (a, b) {\n return a.start - b.start;\n }); // sort by start time\n};\n\nexports.printDates = function(dates) {\n for (var i =0; i < dates.length; i++) {\n console.log(i, new Date(dates[i].start),new Date(dates[i].end), dates[i].start, dates[i].end, dates[i].remove);\n }\n};\n\n/**\n * Used in TimeStep to avoid the hidden times.\n * @param {function} moment\n * @param {TimeStep} timeStep\n * @param previousTime\n */\nexports.stepOverHiddenDates = function(moment, timeStep, previousTime) {\n var stepInHidden = false;\n var currentValue = timeStep.current.valueOf();\n for (var i = 0; i < timeStep.hiddenDates.length; i++) {\n var startDate = timeStep.hiddenDates[i].start;\n var endDate = timeStep.hiddenDates[i].end;\n if (currentValue >= startDate && currentValue < endDate) {\n stepInHidden = true;\n break;\n }\n }\n\n if (stepInHidden == true && currentValue < timeStep._end.valueOf() && currentValue != previousTime) {\n var prevValue = moment(previousTime);\n var newValue = moment(endDate);\n //check if the next step should be major\n if (prevValue.year() != newValue.year()) {timeStep.switchedYear = true;}\n else if (prevValue.month() != newValue.month()) {timeStep.switchedMonth = true;}\n else if (prevValue.dayOfYear() != newValue.dayOfYear()) {timeStep.switchedDay = true;}\n\n timeStep.current = newValue;\n }\n};\n\n\n///**\n// * Used in TimeStep to avoid the hidden times.\n// * @param timeStep\n// * @param previousTime\n// */\n//exports.checkFirstStep = function(timeStep) {\n// var stepInHidden = false;\n// var currentValue = timeStep.current.valueOf();\n// for (var i = 0; i < timeStep.hiddenDates.length; i++) {\n// var startDate = timeStep.hiddenDates[i].start;\n// var endDate = timeStep.hiddenDates[i].end;\n// if (currentValue >= startDate && currentValue < endDate) {\n// stepInHidden = true;\n// break;\n// }\n// }\n//\n// if (stepInHidden == true && currentValue <= timeStep._end.valueOf()) {\n// var newValue = moment(endDate);\n// timeStep.current = newValue.toDate();\n// }\n//};\n\n/**\n * replaces the Core toScreen methods\n * @param Core\n * @param time\n * @param width\n * @returns {number}\n */\nexports.toScreen = function (Core, time, width) {\n if (Core.body.hiddenDates.length == 0) {\n var conversion = Core.range.conversion(width);\n return (time.valueOf() - conversion.offset) * conversion.scale;\n } else {\n var hidden = exports.isHidden(time, Core.body.hiddenDates);\n if (hidden.hidden == true) {\n time = hidden.startDate;\n }\n\n var duration = exports.getHiddenDurationBetween(Core.body.hiddenDates, Core.range.start, Core.range.end);\n if (time < Core.range.start) {\n var conversion = Core.range.conversion(width, duration);\n var hiddenBeforeStart = exports.getHiddenDurationBeforeStart(Core.body.hiddenDates, time, conversion.offset);\n time = Core.options.moment(time).toDate().valueOf();\n time = time + hiddenBeforeStart;\n return -(conversion.offset - time.valueOf()) * conversion.scale;\n \n } else if (time > Core.range.end) {\n var rangeAfterEnd = {start: Core.range.start, end: time};\n time = exports.correctTimeForHidden(Core.options.moment, Core.body.hiddenDates, rangeAfterEnd, time);\n var conversion = Core.range.conversion(width, duration);\n return (time.valueOf() - conversion.offset) * conversion.scale;\n\n } else {\n time = exports.correctTimeForHidden(Core.options.moment, Core.body.hiddenDates, Core.range, time);\n var conversion = Core.range.conversion(width, duration);\n return (time.valueOf() - conversion.offset) * conversion.scale;\n }\n }\n };\n\n\n/**\n * Replaces the core toTime methods\n * @param body\n * @param range\n * @param x\n * @param width\n * @returns {Date}\n */\nexports.toTime = function(Core, x, width) {\n if (Core.body.hiddenDates.length == 0) {\n var conversion = Core.range.conversion(width);\n return new Date(x / conversion.scale + conversion.offset);\n }\n else {\n var hiddenDuration = exports.getHiddenDurationBetween(Core.body.hiddenDates, Core.range.start, Core.range.end);\n var totalDuration = Core.range.end - Core.range.start - hiddenDuration;\n var partialDuration = totalDuration * x / width;\n var accumulatedHiddenDuration = exports.getAccumulatedHiddenDuration(Core.body.hiddenDates, Core.range, partialDuration);\n\n var newTime = new Date(accumulatedHiddenDuration + partialDuration + Core.range.start);\n return newTime;\n }\n};\n\n\n/**\n * Support function\n *\n * @param hiddenDates\n * @param range\n * @returns {number}\n */\nexports.getHiddenDurationBetween = function(hiddenDates, start, end) {\n var duration = 0;\n for (var i = 0; i < hiddenDates.length; i++) {\n var startDate = hiddenDates[i].start;\n var endDate = hiddenDates[i].end;\n // if time after the cutout, and the\n if (startDate >= start && endDate < end) {\n duration += endDate - startDate;\n }\n }\n return duration;\n};\n\n/**\n * Support function\n *\n * @param hiddenDates\n * @param start\n * @param end\n * @returns {number}\n */\nexports.getHiddenDurationBeforeStart = function (hiddenDates, start, end) {\n var duration = 0;\n for (var i = 0; i < hiddenDates.length; i++) {\n var startDate = hiddenDates[i].start;\n var endDate = hiddenDates[i].end;\n\n if (startDate >= start && endDate <= end) {\n duration += endDate - startDate;\n }\n }\n return duration;\n};\n\n\n/**\n * Support function\n * @param moment\n * @param hiddenDates\n * @param range\n * @param time\n * @returns {{duration: number, time: *, offset: number}}\n */\nexports.correctTimeForHidden = function(moment, hiddenDates, range, time) {\n time = moment(time).toDate().valueOf();\n time -= exports.getHiddenDurationBefore(moment, hiddenDates,range,time);\n return time;\n};\n\nexports.getHiddenDurationBefore = function(moment, hiddenDates, range, time) {\n var timeOffset = 0;\n time = moment(time).toDate().valueOf();\n\n for (var i = 0; i < hiddenDates.length; i++) {\n var startDate = hiddenDates[i].start;\n var endDate = hiddenDates[i].end;\n // if time after the cutout, and the\n if (startDate >= range.start && endDate < range.end) {\n if (time >= endDate) {\n timeOffset += (endDate - startDate);\n }\n }\n }\n return timeOffset;\n}\n\n/**\n * sum the duration from start to finish, including the hidden duration,\n * until the required amount has been reached, return the accumulated hidden duration\n * @param hiddenDates\n * @param range\n * @param time\n * @returns {{duration: number, time: *, offset: number}}\n */\nexports.getAccumulatedHiddenDuration = function(hiddenDates, range, requiredDuration) {\n var hiddenDuration = 0;\n var duration = 0;\n var previousPoint = range.start;\n //exports.printDates(hiddenDates)\n for (var i = 0; i < hiddenDates.length; i++) {\n var startDate = hiddenDates[i].start;\n var endDate = hiddenDates[i].end;\n // if time after the cutout, and the\n if (startDate >= range.start && endDate < range.end) {\n duration += startDate - previousPoint;\n previousPoint = endDate;\n if (duration >= requiredDuration) {\n break;\n }\n else {\n hiddenDuration += endDate - startDate;\n }\n }\n }\n\n return hiddenDuration;\n};\n\n\n\n/**\n * used to step over to either side of a hidden block. Correction is disabled on tablets, might be set to true\n * @param hiddenDates\n * @param time\n * @param direction\n * @param correctionEnabled\n * @returns {*}\n */\nexports.snapAwayFromHidden = function(hiddenDates, time, direction, correctionEnabled) {\n var isHidden = exports.isHidden(time, hiddenDates);\n if (isHidden.hidden == true) {\n if (direction < 0) {\n if (correctionEnabled == true) {\n return isHidden.startDate - (isHidden.endDate - time) - 1;\n }\n else {\n return isHidden.startDate - 1;\n }\n }\n else {\n if (correctionEnabled == true) {\n return isHidden.endDate + (time - isHidden.startDate) + 1;\n }\n else {\n return isHidden.endDate + 1;\n }\n }\n }\n else {\n return time;\n }\n\n}\n\n\n/**\n * Check if a time is hidden\n *\n * @param time\n * @param hiddenDates\n * @returns {{hidden: boolean, startDate: Window.start, endDate: *}}\n */\nexports.isHidden = function(time, hiddenDates) {\n for (var i = 0; i < hiddenDates.length; i++) {\n var startDate = hiddenDates[i].start;\n var endDate = hiddenDates[i].end;\n\n if (time >= startDate && time < endDate) { // if the start is entering a hidden zone\n return {hidden: true, startDate: startDate, endDate: endDate};\n break;\n }\n }\n return {hidden: false, startDate: startDate, endDate: endDate};\n}\n\n\n\n// WEBPACK FOOTER //\n// ./lib/timeline/DateUtil.js","var Emitter = require('emitter-component');\nvar Hammer = require('../module/hammer');\nvar hammerUtil = require('../hammerUtil');\nvar util = require('../util');\nvar DataSet = require('../DataSet');\nvar DataView = require('../DataView');\nvar Range = require('./Range');\nvar ItemSet = require('./component/ItemSet');\nvar TimeAxis = require('./component/TimeAxis');\nvar Activator = require('../shared/Activator');\nvar DateUtil = require('./DateUtil');\nvar CustomTime = require('./component/CustomTime');\n\n/**\n * Create a timeline visualization\n * @constructor\n */\nfunction Core () {}\n\n// turn Core into an event emitter\nEmitter(Core.prototype);\n\n/**\n * Create the main DOM for the Core: a root panel containing left, right,\n * top, bottom, content, and background panel.\n * @param {Element} container The container element where the Core will\n * be attached.\n * @protected\n */\nCore.prototype._create = function (container) {\n this.dom = {};\n\n this.dom.container = container;\n\n this.dom.root = document.createElement('div');\n this.dom.background = document.createElement('div');\n this.dom.backgroundVertical = document.createElement('div');\n this.dom.backgroundHorizontal = document.createElement('div');\n this.dom.centerContainer = document.createElement('div');\n this.dom.leftContainer = document.createElement('div');\n this.dom.rightContainer = document.createElement('div');\n this.dom.center = document.createElement('div');\n this.dom.left = document.createElement('div');\n this.dom.right = document.createElement('div');\n this.dom.top = document.createElement('div');\n this.dom.bottom = document.createElement('div');\n this.dom.shadowTop = document.createElement('div');\n this.dom.shadowBottom = document.createElement('div');\n this.dom.shadowTopLeft = document.createElement('div');\n this.dom.shadowBottomLeft = document.createElement('div');\n this.dom.shadowTopRight = document.createElement('div');\n this.dom.shadowBottomRight = document.createElement('div');\n this.dom.rollingModeBtn = document.createElement('div');\n\n this.dom.root.className = 'vis-timeline';\n this.dom.background.className = 'vis-panel vis-background';\n this.dom.backgroundVertical.className = 'vis-panel vis-background vis-vertical';\n this.dom.backgroundHorizontal.className = 'vis-panel vis-background vis-horizontal';\n this.dom.centerContainer.className = 'vis-panel vis-center';\n this.dom.leftContainer.className = 'vis-panel vis-left';\n this.dom.rightContainer.className = 'vis-panel vis-right';\n this.dom.top.className = 'vis-panel vis-top';\n this.dom.bottom.className = 'vis-panel vis-bottom';\n this.dom.left.className = 'vis-content';\n this.dom.center.className = 'vis-content';\n this.dom.right.className = 'vis-content';\n this.dom.shadowTop.className = 'vis-shadow vis-top';\n this.dom.shadowBottom.className = 'vis-shadow vis-bottom';\n this.dom.shadowTopLeft.className = 'vis-shadow vis-top';\n this.dom.shadowBottomLeft.className = 'vis-shadow vis-bottom';\n this.dom.shadowTopRight.className = 'vis-shadow vis-top';\n this.dom.shadowBottomRight.className = 'vis-shadow vis-bottom';\n this.dom.rollingModeBtn.className = 'vis-rolling-mode-btn';\n\n this.dom.root.appendChild(this.dom.background);\n this.dom.root.appendChild(this.dom.backgroundVertical);\n this.dom.root.appendChild(this.dom.backgroundHorizontal);\n this.dom.root.appendChild(this.dom.centerContainer);\n this.dom.root.appendChild(this.dom.leftContainer);\n this.dom.root.appendChild(this.dom.rightContainer);\n this.dom.root.appendChild(this.dom.top);\n this.dom.root.appendChild(this.dom.bottom);\n this.dom.root.appendChild(this.dom.bottom);\n this.dom.root.appendChild(this.dom.rollingModeBtn);\n\n this.dom.centerContainer.appendChild(this.dom.center);\n this.dom.leftContainer.appendChild(this.dom.left);\n this.dom.rightContainer.appendChild(this.dom.right);\n this.dom.centerContainer.appendChild(this.dom.shadowTop);\n this.dom.centerContainer.appendChild(this.dom.shadowBottom);\n this.dom.leftContainer.appendChild(this.dom.shadowTopLeft);\n this.dom.leftContainer.appendChild(this.dom.shadowBottomLeft);\n this.dom.rightContainer.appendChild(this.dom.shadowTopRight);\n this.dom.rightContainer.appendChild(this.dom.shadowBottomRight);\n\n // size properties of each of the panels\n this.props = {\n root: {},\n background: {},\n centerContainer: {},\n leftContainer: {},\n rightContainer: {},\n center: {},\n left: {},\n right: {},\n top: {},\n bottom: {},\n border: {},\n scrollTop: 0,\n scrollTopMin: 0\n };\n\n this.on('rangechange', function () {\n if (this.initialDrawDone === true) {\n this._redraw();\n }\n }.bind(this));\n this.on('touch', this._onTouch.bind(this));\n this.on('panmove', this._onDrag.bind(this));\n\n var me = this;\n this._origRedraw = this._redraw.bind(this);\n this._redraw = util.throttle(this._origRedraw);\n\n this.on('_change', function (properties) {\n if (me.itemSet && me.itemSet.initialItemSetDrawn && properties && properties.queue == true) {\n me._redraw()\n } else {\n me._origRedraw();\n }\n });\n\n // create event listeners for all interesting events, these events will be\n // emitted via emitter\n this.hammer = new Hammer(this.dom.root);\n var pinchRecognizer = this.hammer.get('pinch').set({enable: true});\n hammerUtil.disablePreventDefaultVertically(pinchRecognizer);\n this.hammer.get('pan').set({threshold:5, direction: Hammer.DIRECTION_HORIZONTAL});\n this.listeners = {};\n\n var events = [\n 'tap', 'doubletap', 'press',\n 'pinch',\n 'pan', 'panstart', 'panmove', 'panend'\n // TODO: cleanup\n //'touch', 'pinch',\n //'tap', 'doubletap', 'hold',\n //'dragstart', 'drag', 'dragend',\n //'mousewheel', 'DOMMouseScroll' // DOMMouseScroll is needed for Firefox\n ];\n events.forEach(function (type) {\n var listener = function (event) {\n if (me.isActive()) {\n me.emit(type, event);\n }\n };\n me.hammer.on(type, listener);\n me.listeners[type] = listener;\n });\n\n // emulate a touch event (emitted before the start of a pan, pinch, tap, or press)\n hammerUtil.onTouch(this.hammer, function (event) {\n me.emit('touch', event);\n }.bind(this));\n\n // emulate a release event (emitted after a pan, pinch, tap, or press)\n hammerUtil.onRelease(this.hammer, function (event) {\n me.emit('release', event);\n }.bind(this));\n\n function onMouseWheel(event) {\n if (this.isActive()) {\n this.emit('mousewheel', event);\n }\n\n // prevent scrolling if not specified explicitly or when horizontalScroll is true\n if (!this.options.verticalScroll || this.options.horizontalScroll) return;\n\n // prevent scrolling when zoomKey defined or activated\n if (!this.options.zoomKey || event[this.options.zoomKey]) return;\n\n // Prevent default actions caused by mouse wheel\n // (else the page and timeline both scroll)\n event.preventDefault();\n\n var delta = 0;\n if (event.wheelDelta) { /* IE/Opera. */\n delta = event.wheelDelta / 120;\n } else if (event.detail) { /* Mozilla case. */\n // In Mozilla, sign of delta is different than in IE.\n // Also, delta is multiple of 3.\n delta = -event.detail / 3;\n }\n\n var current = this.props.scrollTop;\n var adjusted = current + delta * 120;\n\n if (this.isActive()) {\n this._setScrollTop(adjusted);\n this._redraw();\n this.emit('scroll', event);\n }\n }\n\n if (this.dom.centerContainer.addEventListener) {\n // IE9, Chrome, Safari, Opera\n this.dom.centerContainer.addEventListener(\"mousewheel\", onMouseWheel.bind(this), false);\n // Firefox\n this.dom.centerContainer.addEventListener(\"DOMMouseScroll\", onMouseWheel.bind(this), false);\n } else {\n // IE 6/7/8\n this.dom.centerContainer.attachEvent(\"onmousewheel\", onMouseWheel.bind(this));\n }\n\n function onMouseScrollSide(event) {\n if (!me.options.verticalScroll) return;\n event.preventDefault();\n if (me.isActive()) {\n var adjusted = -event.target.scrollTop;\n me._setScrollTop(adjusted);\n me._redraw();\n me.emit('scrollSide', event);\n }\n }\n\n this.dom.left.parentNode.addEventListener('scroll', onMouseScrollSide.bind(this));\n this.dom.right.parentNode.addEventListener('scroll', onMouseScrollSide.bind(this));\n\n var itemAddedToTimeline = false;\n\n function handleDragOver(event) {\n if (event.preventDefault) {\n event.preventDefault(); // Necessary. Allows us to drop.\n }\n\n // make sure your target is a vis element\n if (!event.target.className.indexOf(\"vis\") > -1) return;\n\n // make sure only one item is added every time you're over the timeline\n if (itemAddedToTimeline) return;\n\n event.dataTransfer.dropEffect = 'move'; \n itemAddedToTimeline = true;\n return false;\n }\n\n function handleDrop(event) {\n // return when dropping non-vis items \n try {\n var itemData = JSON.parse(event.dataTransfer.getData(\"text\"))\n if (!itemData.content) return\n } catch (err) {\n return false;\n }\n\n itemAddedToTimeline = false;\n event.center = {\n x: event.clientX,\n y: event.clientY\n }\n me.itemSet._onAddItem(event);\n\n return false;\n }\n\n this.dom.center.addEventListener('dragover', handleDragOver.bind(this), false);\n this.dom.center.addEventListener('drop', handleDrop.bind(this), false);\n\n this.customTimes = [];\n\n // store state information needed for touch events\n this.touch = {};\n\n this.redrawCount = 0;\n this.initialDrawDone = false;\n\n // attach the root panel to the provided container\n if (!container) throw new Error('No container provided');\n container.appendChild(this.dom.root);\n};\n\n/**\n * Set options. Options will be passed to all components loaded in the Timeline.\n * @param {Object} [options]\n * {String} orientation\n * Vertical orientation for the Timeline,\n * can be 'bottom' (default) or 'top'.\n * {String | Number} width\n * Width for the timeline, a number in pixels or\n * a css string like '1000px' or '75%'. '100%' by default.\n * {String | Number} height\n * Fixed height for the Timeline, a number in pixels or\n * a css string like '400px' or '75%'. If undefined,\n * The Timeline will automatically size such that\n * its contents fit.\n * {String | Number} minHeight\n * Minimum height for the Timeline, a number in pixels or\n * a css string like '400px' or '75%'.\n * {String | Number} maxHeight\n * Maximum height for the Timeline, a number in pixels or\n * a css string like '400px' or '75%'.\n * {Number | Date | String} start\n * Start date for the visible window\n * {Number | Date | String} end\n * End date for the visible window\n */\nCore.prototype.setOptions = function (options) {\n if (options) {\n // copy the known options\n var fields = [\n 'width', 'height', 'minHeight', 'maxHeight', 'autoResize',\n 'start', 'end', 'clickToUse', 'dataAttributes', 'hiddenDates',\n 'locale', 'locales', 'moment', 'rtl', 'zoomKey', 'horizontalScroll', 'verticalScroll'\n ];\n util.selectiveExtend(fields, this.options, options); \n\n this.dom.rollingModeBtn.style.visibility = 'hidden';\n\n if (this.options.rtl) {\n this.dom.container.style.direction = \"rtl\";\n this.dom.backgroundVertical.className = 'vis-panel vis-background vis-vertical-rtl'; \n }\n\n if (this.options.verticalScroll) {\n if (this.options.rtl) {\n this.dom.rightContainer.className = 'vis-panel vis-right vis-vertical-scroll';\n } else {\n this.dom.leftContainer.className = 'vis-panel vis-left vis-vertical-scroll';\n }\n }\n\n this.options.orientation = {item:undefined,axis:undefined};\n if ('orientation' in options) {\n if (typeof options.orientation === 'string') {\n this.options.orientation = {\n item: options.orientation,\n axis: options.orientation\n };\n }\n else if (typeof options.orientation === 'object') {\n if ('item' in options.orientation) {\n this.options.orientation.item = options.orientation.item;\n }\n if ('axis' in options.orientation) {\n this.options.orientation.axis = options.orientation.axis;\n }\n }\n }\n\n if (this.options.orientation.axis === 'both') {\n if (!this.timeAxis2) {\n var timeAxis2 = this.timeAxis2 = new TimeAxis(this.body);\n timeAxis2.setOptions = function (options) {\n var _options = options ? util.extend({}, options) : {};\n _options.orientation = 'top'; // override the orientation option, always top\n TimeAxis.prototype.setOptions.call(timeAxis2, _options);\n };\n this.components.push(timeAxis2);\n }\n }\n else {\n if (this.timeAxis2) {\n var index = this.components.indexOf(this.timeAxis2);\n if (index !== -1) {\n this.components.splice(index, 1);\n }\n this.timeAxis2.destroy();\n this.timeAxis2 = null;\n }\n }\n\n // if the graph2d's drawPoints is a function delegate the callback to the onRender property\n if (typeof options.drawPoints == 'function') {\n options.drawPoints = {\n onRender: options.drawPoints\n };\n }\n\n if ('hiddenDates' in this.options) {\n DateUtil.convertHiddenOptions(this.options.moment, this.body, this.options.hiddenDates);\n }\n\n if ('clickToUse' in options) {\n if (options.clickToUse) {\n if (!this.activator) {\n this.activator = new Activator(this.dom.root);\n }\n }\n else {\n if (this.activator) {\n this.activator.destroy();\n delete this.activator;\n }\n }\n }\n\n if ('showCustomTime' in options) {\n throw new Error('Option `showCustomTime` is deprecated. Create a custom time bar via timeline.addCustomTime(time [, id])');\n }\n\n // enable/disable autoResize\n this._initAutoResize();\n }\n\n // propagate options to all components\n this.components.forEach(component => component.setOptions(options));\n\n // enable/disable configure\n if ('configure' in options) {\n if (!this.configurator) {\n this.configurator = this._createConfigurator();\n }\n\n this.configurator.setOptions(options.configure);\n\n // collect the settings of all components, and pass them to the configuration system\n var appliedOptions = util.deepExtend({}, this.options);\n this.components.forEach(function (component) {\n util.deepExtend(appliedOptions, component.options);\n });\n this.configurator.setModuleOptions({global: appliedOptions});\n }\n\n this._redraw();\n};\n\n/**\n * Returns true when the Timeline is active.\n * @returns {boolean}\n */\nCore.prototype.isActive = function () {\n return !this.activator || this.activator.active;\n};\n\n/**\n * Destroy the Core, clean up all DOM elements and event listeners.\n */\nCore.prototype.destroy = function () {\n // unbind datasets\n this.setItems(null);\n this.setGroups(null);\n\n // remove all event listeners\n this.off();\n\n // stop checking for changed size\n this._stopAutoResize();\n\n // remove from DOM\n if (this.dom.root.parentNode) {\n this.dom.root.parentNode.removeChild(this.dom.root);\n }\n this.dom = null;\n\n // remove Activator\n if (this.activator) {\n this.activator.destroy();\n delete this.activator;\n }\n\n // cleanup hammer touch events\n for (var event in this.listeners) {\n if (this.listeners.hasOwnProperty(event)) {\n delete this.listeners[event];\n }\n }\n this.listeners = null;\n this.hammer = null;\n\n // give all components the opportunity to cleanup\n this.components.forEach(component => component.destroy());\n\n this.body = null;\n};\n\n\n/**\n * Set a custom time bar\n * @param {Date} time\n * @param {number} [id=undefined] Optional id of the custom time bar to be adjusted.\n */\nCore.prototype.setCustomTime = function (time, id) {\n var customTimes = this.customTimes.filter(function (component) {\n return id === component.options.id;\n });\n\n if (customTimes.length === 0) {\n throw new Error('No custom time bar found with id ' + JSON.stringify(id))\n }\n\n if (customTimes.length > 0) {\n customTimes[0].setCustomTime(time);\n }\n};\n\n/**\n * Retrieve the current custom time.\n * @param {number} [id=undefined] Id of the custom time bar.\n * @return {Date | undefined} customTime\n */\nCore.prototype.getCustomTime = function(id) {\n var customTimes = this.customTimes.filter(function (component) {\n return component.options.id === id;\n });\n\n if (customTimes.length === 0) {\n throw new Error('No custom time bar found with id ' + JSON.stringify(id))\n }\n return customTimes[0].getCustomTime();\n};\n\n/**\n * Set a custom title for the custom time bar.\n * @param {String} [title] Custom title\n * @param {number} [id=undefined] Id of the custom time bar.\n */\nCore.prototype.setCustomTimeTitle = function(title, id) {\n var customTimes = this.customTimes.filter(function (component) {\n return component.options.id === id;\n });\n\n if (customTimes.length === 0) {\n throw new Error('No custom time bar found with id ' + JSON.stringify(id))\n }\n if (customTimes.length > 0) {\n return customTimes[0].setCustomTitle(title);\n }\n};\n\n/**\n * Retrieve meta information from an event.\n * Should be overridden by classes extending Core\n * @param {Event} event\n * @return {Object} An object with related information.\n */\nCore.prototype.getEventProperties = function (event) {\n return { event: event };\n};\n\n/**\n * Add custom vertical bar\n * @param {Date | String | Number} [time] A Date, unix timestamp, or\n * ISO date string. Time point where\n * the new bar should be placed.\n * If not provided, `new Date()` will\n * be used.\n * @param {Number | String} [id=undefined] Id of the new bar. Optional\n * @return {Number | String} Returns the id of the new bar\n */\nCore.prototype.addCustomTime = function (time, id) {\n var timestamp = time !== undefined\n ? util.convert(time, 'Date').valueOf()\n : new Date();\n\n var exists = this.customTimes.some(function (customTime) {\n return customTime.options.id === id;\n });\n if (exists) {\n throw new Error('A custom time with id ' + JSON.stringify(id) + ' already exists');\n }\n\n var customTime = new CustomTime(this.body, util.extend({}, this.options, {\n time : timestamp,\n id : id\n }));\n\n this.customTimes.push(customTime);\n this.components.push(customTime);\n this._redraw();\n\n return id;\n};\n\n/**\n * Remove previously added custom bar\n * @param {int} id ID of the custom bar to be removed\n * @return {boolean} True if the bar exists and is removed, false otherwise\n */\nCore.prototype.removeCustomTime = function (id) {\n var customTimes = this.customTimes.filter(function (bar) {\n return (bar.options.id === id);\n });\n\n if (customTimes.length === 0) {\n throw new Error('No custom time bar found with id ' + JSON.stringify(id))\n }\n\n customTimes.forEach(function (customTime) {\n this.customTimes.splice(this.customTimes.indexOf(customTime), 1);\n this.components.splice(this.components.indexOf(customTime), 1);\n customTime.destroy();\n }.bind(this))\n};\n\n\n/**\n * Get the id's of the currently visible items.\n * @returns {Array} The ids of the visible items\n */\nCore.prototype.getVisibleItems = function() {\n return this.itemSet && this.itemSet.getVisibleItems() || [];\n};\n\n/**\n * Set Core window such that it fits all items\n * @param {Object} [options] Available options:\n * `animation: boolean | {duration: number, easingFunction: string}`\n * If true (default), the range is animated\n * smoothly to the new window. An object can be\n * provided to specify duration and easing function.\n * Default duration is 500 ms, and default easing\n * function is 'easeInOutQuad'.\n */\nCore.prototype.fit = function(options) {\n var range = this.getDataRange();\n\n // skip range set if there is no min and max date\n if (range.min === null && range.max === null) {\n return;\n }\n\n // apply a margin of 1% left and right of the data\n var interval = range.max - range.min;\n var min = new Date(range.min.valueOf() - interval * 0.01);\n var max = new Date(range.max.valueOf() + interval * 0.01);\n var animation = (options && options.animation !== undefined) ? options.animation : true;\n this.range.setRange(min, max, animation);\n};\n\n/**\n * Calculate the data range of the items start and end dates\n * @returns {{min: Date | null, max: Date | null}}\n * @protected\n */\nCore.prototype.getDataRange = function() {\n // must be implemented by Timeline and Graph2d\n throw new Error('Cannot invoke abstract method getDataRange');\n};\n\n/**\n * Set the visible window. Both parameters are optional, you can change only\n * start or only end. Syntax:\n *\n * TimeLine.setWindow(start, end)\n * TimeLine.setWindow(start, end, options)\n * TimeLine.setWindow(range)\n *\n * Where start and end can be a Date, number, or string, and range is an\n * object with properties start and end.\n *\n * @param {Date | Number | String | Object} [start] Start date of visible window\n * @param {Date | Number | String} [end] End date of visible window\n * @param {Object} [options] Available options:\n * `animation: boolean | {duration: number, easingFunction: string}`\n * If true (default), the range is animated\n * smoothly to the new window. An object can be\n * provided to specify duration and easing function.\n * Default duration is 500 ms, and default easing\n * function is 'easeInOutQuad'.\n */\nCore.prototype.setWindow = function(start, end, options) {\n var animation;\n if (arguments.length == 1) {\n var range = arguments[0];\n animation = (range.animation !== undefined) ? range.animation : true;\n this.range.setRange(range.start, range.end, animation);\n }\n else {\n animation = (options && options.animation !== undefined) ? options.animation : true;\n this.range.setRange(start, end, animation);\n }\n};\n\n/**\n * Move the window such that given time is centered on screen.\n * @param {Date | Number | String} time\n * @param {Object} [options] Available options:\n * `animation: boolean | {duration: number, easingFunction: string}`\n * If true (default), the range is animated\n * smoothly to the new window. An object can be\n * provided to specify duration and easing function.\n * Default duration is 500 ms, and default easing\n * function is 'easeInOutQuad'.\n */\nCore.prototype.moveTo = function(time, options) {\n var interval = this.range.end - this.range.start;\n var t = util.convert(time, 'Date').valueOf();\n\n var start = t - interval / 2;\n var end = t + interval / 2;\n var animation = (options && options.animation !== undefined) ? options.animation : true;\n\n this.range.setRange(start, end, animation);\n};\n\n/**\n * Get the visible window\n * @return {{start: Date, end: Date}} Visible range\n */\nCore.prototype.getWindow = function() {\n var range = this.range.getRange();\n return {\n start: new Date(range.start),\n end: new Date(range.end)\n };\n};\n\n/**\n * Zoom in the window such that given time is centered on screen.\n * @param {Number} percentage - must be between [0..1]\n */\nCore.prototype.zoomIn = function(percentage) {\n if (!percentage || percentage < 0 || percentage > 1) return\n var range = this.getWindow();\n var start = range.start.valueOf();\n var end = range.end.valueOf();\n var interval = end - start;\n var newInterval = interval / (1 + percentage);\n var distance = (interval - newInterval) / 2;\n var newStart = start + distance;\n var newEnd = end - distance;\n\n this.setWindow({\n start : newStart,\n end : newEnd\n });\n};\n\n/**\n * Zoom out the window such that given time is centered on screen.\n * @param {Number} percentage - must be between [0..1]\n */\nCore.prototype.zoomOut = function(percentage) {\n if (!percentage || percentage < 0 || percentage > 1) return\n var range = this.getWindow();\n var start = range.start.valueOf();\n var end = range.end.valueOf();\n var interval = end - start;\n var newStart = start - interval * percentage / 2;\n var newEnd = end + interval * percentage / 2;\n\n this.setWindow({\n start : newStart,\n end : newEnd\n });\n};\n\n/**\n * Force a redraw. Can be overridden by implementations of Core\n *\n * Note: this function will be overridden on construction with a trottled version\n */\nCore.prototype.redraw = function() {\n this._redraw();\n};\n\n/**\n * Redraw for internal use. Redraws all components. See also the public\n * method redraw.\n * @protected\n */\nCore.prototype._redraw = function() {\n this.redrawCount++;\n var resized = false;\n var options = this.options;\n var props = this.props;\n var dom = this.dom;\n\n if (!dom || !dom.container || dom.root.offsetWidth == 0) return; // when destroyed, or invisible\n\n DateUtil.updateHiddenDates(this.options.moment, this.body, this.options.hiddenDates);\n\n // update class names\n if (options.orientation == 'top') {\n util.addClassName(dom.root, 'vis-top');\n util.removeClassName(dom.root, 'vis-bottom');\n }\n else {\n util.removeClassName(dom.root, 'vis-top');\n util.addClassName(dom.root, 'vis-bottom');\n }\n\n // update root width and height options\n dom.root.style.maxHeight = util.option.asSize(options.maxHeight, '');\n dom.root.style.minHeight = util.option.asSize(options.minHeight, '');\n dom.root.style.width = util.option.asSize(options.width, '');\n\n // calculate border widths\n props.border.left = (dom.centerContainer.offsetWidth - dom.centerContainer.clientWidth) / 2;\n props.border.right = props.border.left;\n props.border.top = (dom.centerContainer.offsetHeight - dom.centerContainer.clientHeight) / 2;\n props.border.bottom = props.border.top;\n props.borderRootHeight= dom.root.offsetHeight - dom.root.clientHeight;\n props.borderRootWidth = dom.root.offsetWidth - dom.root.clientWidth;\n\n // workaround for a bug in IE: the clientWidth of an element with\n // a height:0px and overflow:hidden is not calculated and always has value 0\n if (dom.centerContainer.clientHeight === 0) {\n props.border.left = props.border.top;\n props.border.right = props.border.left;\n }\n if (dom.root.clientHeight === 0) {\n props.borderRootWidth = props.borderRootHeight;\n }\n\n // calculate the heights. If any of the side panels is empty, we set the height to\n // minus the border width, such that the border will be invisible\n props.center.height = dom.center.offsetHeight;\n props.left.height = dom.left.offsetHeight;\n props.right.height = dom.right.offsetHeight;\n props.top.height = dom.top.clientHeight || -props.border.top;\n props.bottom.height = dom.bottom.clientHeight || -props.border.bottom;\n\n // TODO: compensate borders when any of the panels is empty.\n\n // apply auto height\n // TODO: only calculate autoHeight when needed (else we cause an extra reflow/repaint of the DOM)\n var contentHeight = Math.max(props.left.height, props.center.height, props.right.height);\n var autoHeight = props.top.height + contentHeight + props.bottom.height +\n props.borderRootHeight + props.border.top + props.border.bottom;\n dom.root.style.height = util.option.asSize(options.height, autoHeight + 'px');\n\n // calculate heights of the content panels\n props.root.height = dom.root.offsetHeight;\n props.background.height = props.root.height - props.borderRootHeight;\n var containerHeight = props.root.height - props.top.height - props.bottom.height -\n props.borderRootHeight;\n props.centerContainer.height = containerHeight;\n props.leftContainer.height = containerHeight;\n props.rightContainer.height = props.leftContainer.height;\n\n // calculate the widths of the panels\n props.root.width = dom.root.offsetWidth;\n props.background.width = props.root.width - props.borderRootWidth;\n\n if (!this.initialDrawDone) {\n props.scrollbarWidth = util.getScrollBarWidth();\n }\n\n if (options.verticalScroll) {\n if (options.rtl) {\n props.left.width = dom.leftContainer.clientWidth || -props.border.left;\n props.right.width = dom.rightContainer.clientWidth + props.scrollbarWidth || -props.border.right;\n } else {\n props.left.width = dom.leftContainer.clientWidth + props.scrollbarWidth || -props.border.left;\n props.right.width = dom.rightContainer.clientWidth || -props.border.right;\n }\n } else {\n props.left.width = dom.leftContainer.clientWidth || -props.border.left;\n props.right.width = dom.rightContainer.clientWidth || -props.border.right;\n }\n\n this._setDOM();\n\n // update the scrollTop, feasible range for the offset can be changed\n // when the height of the Core or of the contents of the center changed\n var offset = this._updateScrollTop();\n\n // reposition the scrollable contents\n if (options.orientation.item != 'top') {\n offset += Math.max(props.centerContainer.height - props.center.height -\n props.border.top - props.border.bottom, 0);\n }\n dom.center.style.top = offset + 'px';\n \n // show shadows when vertical scrolling is available\n var visibilityTop = props.scrollTop == 0 ? 'hidden' : '';\n var visibilityBottom = props.scrollTop == props.scrollTopMin ? 'hidden' : '';\n dom.shadowTop.style.visibility = visibilityTop;\n dom.shadowBottom.style.visibility = visibilityBottom;\n dom.shadowTopLeft.style.visibility = visibilityTop;\n dom.shadowBottomLeft.style.visibility = visibilityBottom;\n dom.shadowTopRight.style.visibility = visibilityTop;\n dom.shadowBottomRight.style.visibility = visibilityBottom;\n\n if (options.verticalScroll) {\n dom.rightContainer.className = 'vis-panel vis-right vis-vertical-scroll';\n dom.leftContainer.className = 'vis-panel vis-left vis-vertical-scroll';\n\n dom.shadowTopRight.style.visibility = \"hidden\";\n dom.shadowBottomRight.style.visibility = \"hidden\";\n dom.shadowTopLeft.style.visibility = \"hidden\";\n dom.shadowBottomLeft.style.visibility = \"hidden\";\n\n dom.left.style.top = '0px';\n dom.right.style.top = '0px';\n }\n\n if (!options.verticalScroll || props.center.height < props.centerContainer.height) {\n dom.left.style.top = offset + 'px';\n dom.right.style.top = offset + 'px';\n dom.rightContainer.className = dom.rightContainer.className.replace(new RegExp('(?:^|\\\\s)'+ 'vis-vertical-scroll' + '(?:\\\\s|$)'), ' ');\n dom.leftContainer.className = dom.leftContainer.className.replace(new RegExp('(?:^|\\\\s)'+ 'vis-vertical-scroll' + '(?:\\\\s|$)'), ' ');\n props.left.width = dom.leftContainer.clientWidth || -props.border.left;\n props.right.width = dom.rightContainer.clientWidth || -props.border.right;\n this._setDOM();\n }\n\n // enable/disable vertical panning\n var contentsOverflow = props.center.height > props.centerContainer.height;\n this.hammer.get('pan').set({\n direction: contentsOverflow ? Hammer.DIRECTION_ALL : Hammer.DIRECTION_HORIZONTAL\n });\n\n // redraw all components\n this.components.forEach(function (component) {\n resized = component.redraw() || resized;\n });\n var MAX_REDRAW = 5;\n if (resized) {\n if (this.redrawCount < MAX_REDRAW) {\n this.body.emitter.emit('_change');\n return;\n }\n else {\n console.log('WARNING: infinite loop in redraw?');\n }\n } else {\n this.redrawCount = 0;\n }\n this.initialDrawDone = true;\n\n //Emit public 'changed' event for UI updates, see issue #1592\n this.body.emitter.emit(\"changed\");\n};\n\nCore.prototype._setDOM = function () {\n var props = this.props;\n var dom = this.dom;\n\n props.leftContainer.width = props.left.width;\n props.rightContainer.width = props.right.width;\n var centerWidth = props.root.width - props.left.width - props.right.width - props.borderRootWidth;\n props.center.width = centerWidth;\n props.centerContainer.width = centerWidth;\n props.top.width = centerWidth;\n props.bottom.width = centerWidth;\n\n // resize the panels\n dom.background.style.height = props.background.height + 'px';\n dom.backgroundVertical.style.height = props.background.height + 'px';\n dom.backgroundHorizontal.style.height = props.centerContainer.height + 'px';\n dom.centerContainer.style.height = props.centerContainer.height + 'px';\n dom.leftContainer.style.height = props.leftContainer.height + 'px';\n dom.rightContainer.style.height = props.rightContainer.height + 'px';\n\n dom.background.style.width = props.background.width + 'px';\n dom.backgroundVertical.style.width = props.centerContainer.width + 'px';\n dom.backgroundHorizontal.style.width = props.background.width + 'px';\n dom.centerContainer.style.width = props.center.width + 'px';\n dom.top.style.width = props.top.width + 'px';\n dom.bottom.style.width = props.bottom.width + 'px';\n\n // reposition the panels\n dom.background.style.left = '0';\n dom.background.style.top = '0';\n dom.backgroundVertical.style.left = (props.left.width + props.border.left) + 'px';\n dom.backgroundVertical.style.top = '0';\n dom.backgroundHorizontal.style.left = '0';\n dom.backgroundHorizontal.style.top = props.top.height + 'px';\n dom.centerContainer.style.left = props.left.width + 'px';\n dom.centerContainer.style.top = props.top.height + 'px';\n dom.leftContainer.style.left = '0';\n dom.leftContainer.style.top = props.top.height + 'px';\n dom.rightContainer.style.left = (props.left.width + props.center.width) + 'px';\n dom.rightContainer.style.top = props.top.height + 'px';\n dom.top.style.left = props.left.width + 'px';\n dom.top.style.top = '0';\n dom.bottom.style.left = props.left.width + 'px';\n dom.bottom.style.top = (props.top.height + props.centerContainer.height) + 'px';\n dom.center.style.left = '0';\n dom.left.style.left = '0';\n dom.right.style.left = '0';\n}\n\n// TODO: deprecated since version 1.1.0, remove some day\nCore.prototype.repaint = function () {\n throw new Error('Function repaint is deprecated. Use redraw instead.');\n};\n\n/**\n * Set a current time. This can be used for example to ensure that a client's\n * time is synchronized with a shared server time.\n * Only applicable when option `showCurrentTime` is true.\n * @param {Date | String | Number} time A Date, unix timestamp, or\n * ISO date string.\n */\nCore.prototype.setCurrentTime = function(time) {\n if (!this.currentTime) {\n throw new Error('Option showCurrentTime must be true');\n }\n\n this.currentTime.setCurrentTime(time);\n};\n\n/**\n * Get the current time.\n * Only applicable when option `showCurrentTime` is true.\n * @return {Date} Returns the current time.\n */\nCore.prototype.getCurrentTime = function() {\n if (!this.currentTime) {\n throw new Error('Option showCurrentTime must be true');\n }\n\n return this.currentTime.getCurrentTime();\n};\n\n/**\n * Convert a position on screen (pixels) to a datetime\n * @param {int} x Position on the screen in pixels\n * @return {Date} time The datetime the corresponds with given position x\n * @protected\n */\n// TODO: move this function to Range\nCore.prototype._toTime = function(x) {\n return DateUtil.toTime(this, x, this.props.center.width);\n};\n\n/**\n * Convert a position on the global screen (pixels) to a datetime\n * @param {int} x Position on the screen in pixels\n * @return {Date} time The datetime the corresponds with given position x\n * @protected\n */\n// TODO: move this function to Range\nCore.prototype._toGlobalTime = function(x) {\n return DateUtil.toTime(this, x, this.props.root.width);\n //var conversion = this.range.conversion(this.props.root.width);\n //return new Date(x / conversion.scale + conversion.offset);\n};\n\n/**\n * Convert a datetime (Date object) into a position on the screen\n * @param {Date} time A date\n * @return {int} x The position on the screen in pixels which corresponds\n * with the given date.\n * @protected\n */\n// TODO: move this function to Range\nCore.prototype._toScreen = function(time) {\n return DateUtil.toScreen(this, time, this.props.center.width);\n};\n\n\n\n/**\n * Convert a datetime (Date object) into a position on the root\n * This is used to get the pixel density estimate for the screen, not the center panel\n * @param {Date} time A date\n * @return {int} x The position on root in pixels which corresponds\n * with the given date.\n * @protected\n */\n// TODO: move this function to Range\nCore.prototype._toGlobalScreen = function(time) {\n return DateUtil.toScreen(this, time, this.props.root.width);\n //var conversion = this.range.conversion(this.props.root.width);\n //return (time.valueOf() - conversion.offset) * conversion.scale;\n};\n\n\n/**\n * Initialize watching when option autoResize is true\n * @private\n */\nCore.prototype._initAutoResize = function () {\n if (this.options.autoResize == true) {\n this._startAutoResize();\n }\n else {\n this._stopAutoResize();\n }\n};\n\n/**\n * Watch for changes in the size of the container. On resize, the Panel will\n * automatically redraw itself.\n * @private\n */\nCore.prototype._startAutoResize = function () {\n var me = this;\n\n this._stopAutoResize();\n\n this._onResize = function() {\n if (me.options.autoResize != true) {\n // stop watching when the option autoResize is changed to false\n me._stopAutoResize();\n return;\n }\n\n if (me.dom.root) {\n // check whether the frame is resized\n // Note: we compare offsetWidth here, not clientWidth. For some reason,\n // IE does not restore the clientWidth from 0 to the actual width after\n // changing the timeline's container display style from none to visible\n if ((me.dom.root.offsetWidth != me.props.lastWidth) ||\n (me.dom.root.offsetHeight != me.props.lastHeight)) {\n me.props.lastWidth = me.dom.root.offsetWidth;\n me.props.lastHeight = me.dom.root.offsetHeight;\n me.props.scrollbarWidth = util.getScrollBarWidth();\n\n me.body.emitter.emit('_change');\n }\n }\n };\n\n // add event listener to window resize\n util.addEventListener(window, 'resize', this._onResize);\n\n //Prevent initial unnecessary redraw\n if (me.dom.root) {\n me.props.lastWidth = me.dom.root.offsetWidth;\n me.props.lastHeight = me.dom.root.offsetHeight;\n }\n\n this.watchTimer = setInterval(this._onResize, 1000);\n};\n\n/**\n * Stop watching for a resize of the frame.\n * @private\n */\nCore.prototype._stopAutoResize = function () {\n if (this.watchTimer) {\n clearInterval(this.watchTimer);\n this.watchTimer = undefined;\n }\n\n // remove event listener on window.resize\n if (this._onResize) {\n util.removeEventListener(window, 'resize', this._onResize);\n this._onResize = null;\n }\n};\n\n/**\n * Start moving the timeline vertically\n * @param {Event} event\n * @private\n */\nCore.prototype._onTouch = function (event) {\n this.touch.allowDragging = true;\n this.touch.initialScrollTop = this.props.scrollTop;\n};\n\n/**\n * Start moving the timeline vertically\n * @param {Event} event\n * @private\n */\nCore.prototype._onPinch = function (event) {\n this.touch.allowDragging = false;\n};\n\n/**\n * Move the timeline vertically\n * @param {Event} event\n * @private\n */\nCore.prototype._onDrag = function (event) {\n if (!event) return\n // refuse to drag when we where pinching to prevent the timeline make a jump\n // when releasing the fingers in opposite order from the touch screen\n if (!this.touch.allowDragging) return;\n\n var delta = event.deltaY;\n\n var oldScrollTop = this._getScrollTop();\n var newScrollTop = this._setScrollTop(this.touch.initialScrollTop + delta);\n\n if (this.options.verticalScroll) {\n this.dom.left.parentNode.scrollTop = -this.props.scrollTop;\n this.dom.right.parentNode.scrollTop = -this.props.scrollTop;\n }\n\n if (newScrollTop != oldScrollTop) {\n this.emit(\"verticalDrag\");\n }\n};\n\n/**\n * Apply a scrollTop\n * @param {Number} scrollTop\n * @returns {Number} scrollTop Returns the applied scrollTop\n * @private\n */\nCore.prototype._setScrollTop = function (scrollTop) {\n this.props.scrollTop = scrollTop;\n this._updateScrollTop();\n return this.props.scrollTop;\n};\n\n/**\n * Update the current scrollTop when the height of the containers has been changed\n * @returns {Number} scrollTop Returns the applied scrollTop\n * @private\n */\nCore.prototype._updateScrollTop = function () {\n // recalculate the scrollTopMin\n var scrollTopMin = Math.min(this.props.centerContainer.height - this.props.center.height, 0); // is negative or zero\n if (scrollTopMin != this.props.scrollTopMin) {\n // in case of bottom orientation, change the scrollTop such that the contents\n // do not move relative to the time axis at the bottom\n if (this.options.orientation.item != 'top') {\n this.props.scrollTop += (scrollTopMin - this.props.scrollTopMin);\n }\n this.props.scrollTopMin = scrollTopMin;\n }\n\n // limit the scrollTop to the feasible scroll range\n if (this.props.scrollTop > 0) this.props.scrollTop = 0;\n if (this.props.scrollTop < scrollTopMin) this.props.scrollTop = scrollTopMin;\n\n if (this.options.verticalScroll) {\n this.dom.left.parentNode.scrollTop = -this.props.scrollTop;\n this.dom.right.parentNode.scrollTop = -this.props.scrollTop;\n }\n\n return this.props.scrollTop;\n};\n\n/**\n * Get the current scrollTop\n * @returns {number} scrollTop\n * @private\n */\nCore.prototype._getScrollTop = function () {\n return this.props.scrollTop;\n};\n\n/**\n * Load a configurator\n * @return {Object}\n * @private\n */\nCore.prototype._createConfigurator = function () {\n throw new Error('Cannot invoke abstract method _createConfigurator');\n};\n\nmodule.exports = Core;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/timeline/Core.js","var Hammer = require('../../module/hammer');\nvar util = require('../../util');\nvar DataSet = require('../../DataSet');\nvar DataView = require('../../DataView');\nvar TimeStep = require('../TimeStep');\nvar Component = require('./Component');\nvar Group = require('./Group');\nvar BackgroundGroup = require('./BackgroundGroup');\nvar BoxItem = require('./item/BoxItem');\nvar PointItem = require('./item/PointItem');\nvar RangeItem = require('./item/RangeItem');\nvar BackgroundItem = require('./item/BackgroundItem');\nimport Popup from '../../shared/Popup';\n\n\nvar UNGROUPED = '__ungrouped__'; // reserved group id for ungrouped items\nvar BACKGROUND = '__background__'; // reserved group id for background items without group\n\n/**\n * An ItemSet holds a set of items and ranges which can be displayed in a\n * range. The width is determined by the parent of the ItemSet, and the height\n * is determined by the size of the items.\n * @param {{dom: Object, domProps: Object, emitter: Emitter, range: Range}} body\n * @param {Object} [options] See ItemSet.setOptions for the available options.\n * @constructor ItemSet\n * @extends Component\n */\nfunction ItemSet(body, options) {\n this.body = body;\n this.defaultOptions = {\n type: null, // 'box', 'point', 'range', 'background'\n orientation: {\n item: 'bottom' // item orientation: 'top' or 'bottom'\n },\n align: 'auto', // alignment of box items\n stack: true,\n stackSubgroups: true,\n groupOrderSwap: function(fromGroup, toGroup, groups) {\n \tvar targetOrder = toGroup.order;\n \ttoGroup.order = fromGroup.order;\n \tfromGroup.order = targetOrder;\n },\n groupOrder: 'order',\n\n selectable: true,\n multiselect: false,\n itemsAlwaysDraggable: false,\n\n editable: {\n updateTime: false,\n updateGroup: false,\n add: false,\n remove: false,\n overrideItems: false\n },\n\n groupEditable: {\n order: false,\n add: false,\n remove: false\n }, \n \n snap: TimeStep.snap,\n\n onAdd: function (item, callback) {\n callback(item);\n },\n onUpdate: function (item, callback) {\n callback(item);\n },\n onMove: function (item, callback) {\n callback(item);\n },\n onRemove: function (item, callback) {\n callback(item);\n },\n onMoving: function (item, callback) {\n callback(item);\n },\n onAddGroup: function (item, callback) {\n callback(item);\n },\n onMoveGroup: function (item, callback) {\n callback(item);\n },\n onRemoveGroup: function (item, callback) {\n callback(item);\n },\n\n margin: {\n item: {\n horizontal: 10,\n vertical: 10\n },\n axis: 20\n },\n\n tooltip: {\n followMouse: false,\n overflowMethod: 'flip'\n },\n\n tooltipOnItemUpdateTime: false\n };\n\n // options is shared by this ItemSet and all its items\n this.options = util.extend({}, this.defaultOptions);\n this.options.rtl = options.rtl;\n\n // options for getting items from the DataSet with the correct type\n this.itemOptions = {\n type: {start: 'Date', end: 'Date'}\n };\n\n this.conversion = {\n toScreen: body.util.toScreen,\n toTime: body.util.toTime\n };\n this.dom = {};\n this.props = {};\n this.hammer = null;\n\n var me = this;\n this.itemsData = null; // DataSet\n this.groupsData = null; // DataSet\n\n // listeners for the DataSet of the items\n this.itemListeners = {\n 'add': function (event, params, senderId) {\n me._onAdd(params.items);\n },\n 'update': function (event, params, senderId) {\n me._onUpdate(params.items);\n },\n 'remove': function (event, params, senderId) {\n me._onRemove(params.items);\n }\n };\n\n // listeners for the DataSet of the groups\n this.groupListeners = {\n 'add': function (event, params, senderId) {\n me._onAddGroups(params.items);\n },\n 'update': function (event, params, senderId) {\n me._onUpdateGroups(params.items);\n },\n 'remove': function (event, params, senderId) {\n me._onRemoveGroups(params.items);\n }\n };\n\n this.items = {}; // object with an Item for every data item\n this.groups = {}; // Group object for every group\n this.groupIds = [];\n\n this.selection = []; // list with the ids of all selected nodes\n this.stackDirty = true; // if true, all items will be restacked on next redraw\n\n this.touchParams = {}; // stores properties while dragging\n this.groupTouchParams = {};\n // create the HTML DOM\n\n this._create();\n\n this.setOptions(options);\n}\n\nItemSet.prototype = new Component();\n\n// available item types will be registered here\nItemSet.types = {\n background: BackgroundItem,\n box: BoxItem,\n range: RangeItem,\n point: PointItem\n};\n\n/**\n * Create the HTML DOM for the ItemSet\n */\nItemSet.prototype._create = function(){\n var frame = document.createElement('div');\n frame.className = 'vis-itemset';\n frame['timeline-itemset'] = this;\n this.dom.frame = frame;\n\n // create background panel\n var background = document.createElement('div');\n background.className = 'vis-background';\n frame.appendChild(background);\n this.dom.background = background;\n\n // create foreground panel\n var foreground = document.createElement('div');\n foreground.className = 'vis-foreground';\n frame.appendChild(foreground);\n this.dom.foreground = foreground;\n\n // create axis panel\n var axis = document.createElement('div');\n axis.className = 'vis-axis';\n this.dom.axis = axis;\n\n // create labelset\n var labelSet = document.createElement('div');\n labelSet.className = 'vis-labelset';\n this.dom.labelSet = labelSet;\n\n // create ungrouped Group\n this._updateUngrouped();\n\n // create background Group\n var backgroundGroup = new BackgroundGroup(BACKGROUND, null, this);\n backgroundGroup.show();\n this.groups[BACKGROUND] = backgroundGroup;\n\n // attach event listeners\n // Note: we bind to the centerContainer for the case where the height\n // of the center container is larger than of the ItemSet, so we\n // can click in the empty area to create a new item or deselect an item.\n this.hammer = new Hammer(this.body.dom.centerContainer);\n\n // drag items when selected\n this.hammer.on('hammer.input', function (event) {\n if (event.isFirst) {\n this._onTouch(event);\n }\n }.bind(this));\n this.hammer.on('panstart', this._onDragStart.bind(this));\n this.hammer.on('panmove', this._onDrag.bind(this));\n this.hammer.on('panend', this._onDragEnd.bind(this));\n this.hammer.get('pan').set({threshold:5, direction: Hammer.DIRECTION_HORIZONTAL});\n\n // single select (or unselect) when tapping an item\n this.hammer.on('tap', this._onSelectItem.bind(this));\n\n // multi select when holding mouse/touch, or on ctrl+click\n this.hammer.on('press', this._onMultiSelectItem.bind(this));\n\n // add item on doubletap\n this.hammer.on('doubletap', this._onAddItem.bind(this));\n\n if (this.options.rtl) {\n this.groupHammer = new Hammer(this.body.dom.rightContainer);\n } else {\n this.groupHammer = new Hammer(this.body.dom.leftContainer);\n }\n \n this.groupHammer.on('tap', this._onGroupClick.bind(this));\n this.groupHammer.on('panstart', this._onGroupDragStart.bind(this));\n this.groupHammer.on('panmove', this._onGroupDrag.bind(this));\n this.groupHammer.on('panend', this._onGroupDragEnd.bind(this));\n this.groupHammer.get('pan').set({threshold:5, direction: Hammer.DIRECTION_VERTICAL});\n \n this.body.dom.centerContainer.addEventListener('mouseover', this._onMouseOver.bind(this));\n this.body.dom.centerContainer.addEventListener('mouseout', this._onMouseOut.bind(this));\n this.body.dom.centerContainer.addEventListener('mousemove', this._onMouseMove.bind(this));\n // right-click on timeline \n this.body.dom.centerContainer.addEventListener('contextmenu', this._onDragEnd.bind(this));\n\n // attach to the DOM\n this.show();\n};\n\n/**\n * Set options for the ItemSet. Existing options will be extended/overwritten.\n * @param {Object} [options] The following options are available:\n * {String} type\n * Default type for the items. Choose from 'box'\n * (default), 'point', 'range', or 'background'.\n * The default style can be overwritten by\n * individual items.\n * {String} align\n * Alignment for the items, only applicable for\n * BoxItem. Choose 'center' (default), 'left', or\n * 'right'.\n * {String} orientation.item\n * Orientation of the item set. Choose 'top' or\n * 'bottom' (default).\n * {Function} groupOrder\n * A sorting function for ordering groups\n * {Boolean} stack\n * If true (default), items will be stacked on\n * top of each other.\n * {Number} margin.axis\n * Margin between the axis and the items in pixels.\n * Default is 20.\n * {Number} margin.item.horizontal\n * Horizontal margin between items in pixels.\n * Default is 10.\n * {Number} margin.item.vertical\n * Vertical Margin between items in pixels.\n * Default is 10.\n * {Number} margin.item\n * Margin between items in pixels in both horizontal\n * and vertical direction. Default is 10.\n * {Number} margin\n * Set margin for both axis and items in pixels.\n * {Boolean} selectable\n * If true (default), items can be selected.\n * {Boolean} multiselect\n * If true, multiple items can be selected.\n * False by default.\n * {Boolean} editable\n * Set all editable options to true or false\n * {Boolean} editable.updateTime\n * Allow dragging an item to an other moment in time\n * {Boolean} editable.updateGroup\n * Allow dragging an item to an other group\n * {Boolean} editable.add\n * Allow creating new items on double tap\n * {Boolean} editable.remove\n * Allow removing items by clicking the delete button\n * top right of a selected item.\n * {Function(item: Item, callback: Function)} onAdd\n * Callback function triggered when an item is about to be added:\n * when the user double taps an empty space in the Timeline.\n * {Function(item: Item, callback: Function)} onUpdate\n * Callback function fired when an item is about to be updated.\n * This function typically has to show a dialog where the user\n * change the item. If not implemented, nothing happens.\n * {Function(item: Item, callback: Function)} onMove\n * Fired when an item has been moved. If not implemented,\n * the move action will be accepted.\n * {Function(item: Item, callback: Function)} onRemove\n * Fired when an item is about to be deleted.\n * If not implemented, the item will be always removed.\n */\nItemSet.prototype.setOptions = function(options) {\n if (options) {\n // copy all options that we know\n var fields = [\n 'type', 'rtl', 'align', 'order', 'stack', 'stackSubgroups', 'selectable', 'multiselect', 'itemsAlwaysDraggable', \n 'multiselectPerGroup', 'groupOrder', 'dataAttributes', 'template', 'groupTemplate', 'visibleFrameTemplate',\n 'hide', 'snap', 'groupOrderSwap', 'tooltip', 'tooltipOnItemUpdateTime'\n ];\n util.selectiveExtend(fields, this.options, options);\n\n if ('orientation' in options) {\n if (typeof options.orientation === 'string') {\n this.options.orientation.item = options.orientation === 'top' ? 'top' : 'bottom';\n }\n else if (typeof options.orientation === 'object' && 'item' in options.orientation) {\n this.options.orientation.item = options.orientation.item;\n }\n }\n\n if ('margin' in options) {\n if (typeof options.margin === 'number') {\n this.options.margin.axis = options.margin;\n this.options.margin.item.horizontal = options.margin;\n this.options.margin.item.vertical = options.margin;\n }\n else if (typeof options.margin === 'object') {\n util.selectiveExtend(['axis'], this.options.margin, options.margin);\n if ('item' in options.margin) {\n if (typeof options.margin.item === 'number') {\n this.options.margin.item.horizontal = options.margin.item;\n this.options.margin.item.vertical = options.margin.item;\n }\n else if (typeof options.margin.item === 'object') {\n util.selectiveExtend(['horizontal', 'vertical'], this.options.margin.item, options.margin.item);\n }\n }\n }\n }\n\n if ('editable' in options) {\n if (typeof options.editable === 'boolean') {\n this.options.editable.updateTime = options.editable;\n this.options.editable.updateGroup = options.editable;\n this.options.editable.add = options.editable;\n this.options.editable.remove = options.editable;\n this.options.editable.overrideItems = false;\n }\n else if (typeof options.editable === 'object') {\n util.selectiveExtend(['updateTime', 'updateGroup', 'add', 'remove', 'overrideItems'], this.options.editable, options.editable);\n }\n }\n\n if ('groupEditable' in options) {\n if (typeof options.groupEditable === 'boolean') {\n this.options.groupEditable.order = options.groupEditable;\n this.options.groupEditable.add = options.groupEditable;\n this.options.groupEditable.remove = options.groupEditable;\n }\n else if (typeof options.groupEditable === 'object') {\n util.selectiveExtend(['order', 'add', 'remove'], this.options.groupEditable, options.groupEditable);\n }\n }\n\n // callback functions\n var addCallback = (function (name) {\n var fn = options[name];\n if (fn) {\n if (!(fn instanceof Function)) {\n throw new Error('option ' + name + ' must be a function ' + name + '(item, callback)');\n }\n this.options[name] = fn;\n }\n }).bind(this);\n ['onAdd', 'onUpdate', 'onRemove', 'onMove', 'onMoving', 'onAddGroup', 'onMoveGroup', 'onRemoveGroup'].forEach(addCallback);\n\n // force the itemSet to refresh: options like orientation and margins may be changed\n this.markDirty();\n }\n};\n\n/**\n * Mark the ItemSet dirty so it will refresh everything with next redraw.\n * Optionally, all items can be marked as dirty and be refreshed.\n * @param {{refreshItems: boolean}} [options]\n */\nItemSet.prototype.markDirty = function(options) {\n this.groupIds = [];\n this.stackDirty = true;\n\n if (options && options.refreshItems) {\n util.forEach(this.items, function (item) {\n item.dirty = true;\n if (item.displayed) item.redraw();\n });\n }\n};\n\n/**\n * Destroy the ItemSet\n */\nItemSet.prototype.destroy = function() {\n this.hide();\n this.setItems(null);\n this.setGroups(null);\n\n this.hammer = null;\n\n this.body = null;\n this.conversion = null;\n};\n\n/**\n * Hide the component from the DOM\n */\nItemSet.prototype.hide = function() {\n // remove the frame containing the items\n if (this.dom.frame.parentNode) {\n this.dom.frame.parentNode.removeChild(this.dom.frame);\n }\n\n // remove the axis with dots\n if (this.dom.axis.parentNode) {\n this.dom.axis.parentNode.removeChild(this.dom.axis);\n }\n\n // remove the labelset containing all group labels\n if (this.dom.labelSet.parentNode) {\n this.dom.labelSet.parentNode.removeChild(this.dom.labelSet);\n }\n};\n\n/**\n * Show the component in the DOM (when not already visible).\n * @return {Boolean} changed\n */\nItemSet.prototype.show = function() {\n // show frame containing the items\n if (!this.dom.frame.parentNode) {\n this.body.dom.center.appendChild(this.dom.frame);\n }\n\n // show axis with dots\n if (!this.dom.axis.parentNode) {\n this.body.dom.backgroundVertical.appendChild(this.dom.axis);\n }\n\n // show labelset containing labels\n if (!this.dom.labelSet.parentNode) {\n if (this.options.rtl) {\n this.body.dom.right.appendChild(this.dom.labelSet);\n } else {\n this.body.dom.left.appendChild(this.dom.labelSet);\n }\n }\n};\n\n/**\n * Set selected items by their id. Replaces the current selection\n * Unknown id's are silently ignored.\n * @param {string[] | string} [ids] An array with zero or more id's of the items to be\n * selected, or a single item id. If ids is undefined\n * or an empty array, all items will be unselected.\n */\nItemSet.prototype.setSelection = function(ids) {\n var i, ii, id, item;\n\n if (ids == undefined) ids = [];\n if (!Array.isArray(ids)) ids = [ids];\n\n // unselect currently selected items\n for (i = 0, ii = this.selection.length; i < ii; i++) {\n id = this.selection[i];\n item = this.items[id];\n if (item) item.unselect();\n }\n\n // select items\n this.selection = [];\n for (i = 0, ii = ids.length; i < ii; i++) {\n id = ids[i];\n item = this.items[id];\n if (item) {\n this.selection.push(id);\n item.select();\n }\n }\n};\n\n/**\n * Get the selected items by their id\n * @return {Array} ids The ids of the selected items\n */\nItemSet.prototype.getSelection = function() {\n return this.selection.concat([]);\n};\n\n/**\n * Get the id's of the currently visible items.\n * @returns {Array} The ids of the visible items\n */\nItemSet.prototype.getVisibleItems = function() {\n var range = this.body.range.getRange();\n\n if (this.options.rtl) { \n var right = this.body.util.toScreen(range.start);\n var left = this.body.util.toScreen(range.end);\n } else {\n var left = this.body.util.toScreen(range.start);\n var right = this.body.util.toScreen(range.end);\n }\n\n var ids = [];\n for (var groupId in this.groups) {\n if (this.groups.hasOwnProperty(groupId)) {\n var group = this.groups[groupId];\n var rawVisibleItems = group.visibleItems;\n\n // filter the \"raw\" set with visibleItems into a set which is really\n // visible by pixels\n for (var i = 0; i < rawVisibleItems.length; i++) {\n var item = rawVisibleItems[i];\n // TODO: also check whether visible vertically\n if (this.options.rtl) { \n if ((item.right < left) && (item.right + item.width > right)) {\n ids.push(item.id);\n }\n } else {\n if ((item.left < right) && (item.left + item.width > left)) {\n ids.push(item.id);\n }\n }\n }\n }\n }\n\n return ids;\n};\n\n/**\n * Deselect a selected item\n * @param {String | Number} id\n * @private\n */\nItemSet.prototype._deselect = function(id) {\n var selection = this.selection;\n for (var i = 0, ii = selection.length; i < ii; i++) {\n if (selection[i] == id) { // non-strict comparison!\n selection.splice(i, 1);\n break;\n }\n }\n};\n\n/**\n * Repaint the component\n * @return {boolean} Returns true if the component is resized\n */\nItemSet.prototype.redraw = function() {\n var margin = this.options.margin,\n range = this.body.range,\n asSize = util.option.asSize,\n options = this.options,\n orientation = options.orientation.item,\n resized = false,\n frame = this.dom.frame;\n\n // recalculate absolute position (before redrawing groups)\n this.props.top = this.body.domProps.top.height + this.body.domProps.border.top;\n\n if (this.options.rtl) {\n this.props.right = this.body.domProps.right.width + this.body.domProps.border.right;\n } else {\n this.props.left = this.body.domProps.left.width + this.body.domProps.border.left;\n }\n\n // update class name\n frame.className = 'vis-itemset';\n\n // reorder the groups (if needed)\n resized = this._orderGroups() || resized;\n\n // check whether zoomed (in that case we need to re-stack everything)\n // TODO: would be nicer to get this as a trigger from Range\n var visibleInterval = range.end - range.start;\n var zoomed = (visibleInterval != this.lastVisibleInterval) || (this.props.width != this.props.lastWidth);\n if (zoomed) this.stackDirty = true;\n this.lastVisibleInterval = visibleInterval;\n this.props.lastWidth = this.props.width;\n\n var restack = this.stackDirty;\n var firstGroup = this._firstGroup();\n var firstMargin = {\n item: margin.item,\n axis: margin.axis\n };\n var nonFirstMargin = {\n item: margin.item,\n axis: margin.item.vertical / 2\n };\n var height = 0;\n var minHeight = margin.axis + margin.item.vertical;\n\n // redraw the background group\n this.groups[BACKGROUND].redraw(range, nonFirstMargin, restack);\n\n // redraw all regular groups\n util.forEach(this.groups, function (group) {\n var groupMargin = (group == firstGroup) ? firstMargin : nonFirstMargin;\n var groupResized = group.redraw(range, groupMargin, restack);\n resized = groupResized || resized;\n height += group.height;\n });\n height = Math.max(height, minHeight);\n this.stackDirty = false;\n\n // update frame height\n frame.style.height = asSize(height);\n\n // calculate actual size\n this.props.width = frame.offsetWidth;\n this.props.height = height;\n\n // reposition axis\n this.dom.axis.style.top = asSize((orientation == 'top') ?\n (this.body.domProps.top.height + this.body.domProps.border.top) :\n (this.body.domProps.top.height + this.body.domProps.centerContainer.height));\n if (this.options.rtl) {\n this.dom.axis.style.right = '0';\n } else {\n this.dom.axis.style.left = '0';\n }\n\n this.initialItemSetDrawn = true;\n // check if this component is resized\n resized = this._isResized() || resized;\n\n return resized;\n};\n\n/**\n * Get the first group, aligned with the axis\n * @return {Group | null} firstGroup\n * @private\n */\nItemSet.prototype._firstGroup = function() {\n var firstGroupIndex = (this.options.orientation.item == 'top') ? 0 : (this.groupIds.length - 1);\n var firstGroupId = this.groupIds[firstGroupIndex];\n var firstGroup = this.groups[firstGroupId] || this.groups[UNGROUPED];\n\n return firstGroup || null;\n};\n\n/**\n * Create or delete the group holding all ungrouped items. This group is used when\n * there are no groups specified.\n * @protected\n */\nItemSet.prototype._updateUngrouped = function() {\n var ungrouped = this.groups[UNGROUPED];\n var background = this.groups[BACKGROUND];\n var item, itemId;\n\n if (this.groupsData) {\n // remove the group holding all ungrouped items\n if (ungrouped) {\n ungrouped.hide();\n delete this.groups[UNGROUPED];\n\n for (itemId in this.items) {\n if (this.items.hasOwnProperty(itemId)) {\n item = this.items[itemId];\n item.parent && item.parent.remove(item);\n var groupId = this._getGroupId(item.data);\n var group = this.groups[groupId];\n group && group.add(item) || item.hide();\n }\n }\n }\n }\n else {\n // create a group holding all (unfiltered) items\n if (!ungrouped) {\n var id = null;\n var data = null;\n ungrouped = new Group(id, data, this);\n this.groups[UNGROUPED] = ungrouped;\n\n for (itemId in this.items) {\n if (this.items.hasOwnProperty(itemId)) {\n item = this.items[itemId];\n ungrouped.add(item);\n }\n }\n\n ungrouped.show();\n }\n }\n};\n\n/**\n * Get the element for the labelset\n * @return {HTMLElement} labelSet\n */\nItemSet.prototype.getLabelSet = function() {\n return this.dom.labelSet;\n};\n\n/**\n * Set items\n * @param {vis.DataSet | null} items\n */\nItemSet.prototype.setItems = function(items) {\n var me = this,\n ids,\n oldItemsData = this.itemsData;\n\n // replace the dataset\n if (!items) {\n this.itemsData = null;\n }\n else if (items instanceof DataSet || items instanceof DataView) {\n this.itemsData = items;\n }\n else {\n throw new TypeError('Data must be an instance of DataSet or DataView');\n }\n\n if (oldItemsData) {\n // unsubscribe from old dataset\n util.forEach(this.itemListeners, function (callback, event) {\n oldItemsData.off(event, callback);\n });\n\n // remove all drawn items\n ids = oldItemsData.getIds();\n this._onRemove(ids);\n }\n\n if (this.itemsData) {\n // subscribe to new dataset\n var id = this.id;\n util.forEach(this.itemListeners, function (callback, event) {\n me.itemsData.on(event, callback, id);\n });\n\n // add all new items\n ids = this.itemsData.getIds();\n this._onAdd(ids);\n\n // update the group holding all ungrouped items\n this._updateUngrouped();\n }\n\n this.body.emitter.emit('_change', {queue: true});\n};\n\n/**\n * Get the current items\n * @returns {vis.DataSet | null}\n */\nItemSet.prototype.getItems = function() {\n return this.itemsData;\n};\n\n/**\n * Set groups\n * @param {vis.DataSet} groups\n */\nItemSet.prototype.setGroups = function(groups) {\n var me = this,\n ids;\n\n // unsubscribe from current dataset\n if (this.groupsData) {\n util.forEach(this.groupListeners, function (callback, event) {\n me.groupsData.off(event, callback);\n });\n\n // remove all drawn groups\n ids = this.groupsData.getIds();\n this.groupsData = null;\n this._onRemoveGroups(ids); // note: this will cause a redraw\n }\n\n // replace the dataset\n if (!groups) {\n this.groupsData = null;\n }\n else if (groups instanceof DataSet || groups instanceof DataView) {\n this.groupsData = groups;\n }\n else {\n throw new TypeError('Data must be an instance of DataSet or DataView');\n }\n\n if (this.groupsData) {\n // go over all groups nesting\n var groupsData = this.groupsData;\n if (this.groupsData instanceof DataView) {\n groupsData = this.groupsData.getDataSet()\n }\n\n groupsData.get().forEach(function(group){\n if (group.nestedGroups) {\n group.nestedGroups.forEach(function(nestedGroupId) {\n var updatedNestedGroup = groupsData.get(nestedGroupId);\n updatedNestedGroup.nestedInGroup = group.id;\n if (group.showNested == false) {\n updatedNestedGroup.visible = false;\n }\n groupsData.update(updatedNestedGroup);\n })\n }\n })\n\n\n // subscribe to new dataset\n var id = this.id;\n util.forEach(this.groupListeners, function (callback, event) {\n me.groupsData.on(event, callback, id);\n });\n\n // draw all ms\n ids = this.groupsData.getIds();\n this._onAddGroups(ids);\n }\n\n // update the group holding all ungrouped items\n this._updateUngrouped();\n\n // update the order of all items in each group\n this._order();\n\n this.body.emitter.emit('_change', {queue: true});\n};\n\n/**\n * Get the current groups\n * @returns {vis.DataSet | null} groups\n */\nItemSet.prototype.getGroups = function() {\n return this.groupsData;\n};\n\n/**\n * Remove an item by its id\n * @param {String | Number} id\n */\nItemSet.prototype.removeItem = function(id) {\n var item = this.itemsData.get(id),\n dataset = this.itemsData.getDataSet(),\n itemObj = this.items[id];\n\n if (item) {\n // confirm deletion\n this.options.onRemove(item, function (item) {\n if (item) {\n // remove by id here, it is possible that an item has no id defined\n // itself, so better not delete by the item itself\n dataset.remove(id);\n\n // Remove it's popup\n if (itemObj.popup) {\n itemObj.popup.destroy();\n itemObj.popup = null;\n }\n }\n });\n }\n};\n\n/**\n * Get the time of an item based on it's data and options.type\n * @param {Object} itemData\n * @returns {string} Returns the type\n * @private\n */\nItemSet.prototype._getType = function (itemData) {\n return itemData.type || this.options.type || (itemData.end ? 'range' : 'box');\n};\n\n\n/**\n * Get the group id for an item\n * @param {Object} itemData\n * @returns {string} Returns the groupId\n * @private\n */\nItemSet.prototype._getGroupId = function (itemData) {\n var type = this._getType(itemData);\n if (type == 'background' && itemData.group == undefined) {\n return BACKGROUND;\n }\n else {\n return this.groupsData ? itemData.group : UNGROUPED;\n }\n};\n\n/**\n * Handle updated items\n * @param {Number[]} ids\n * @protected\n */\nItemSet.prototype._onUpdate = function(ids) {\n var me = this;\n\n ids.forEach(function (id) {\n var itemData = me.itemsData.get(id, me.itemOptions);\n var item = me.items[id];\n var type = itemData ? me._getType(itemData) : null;\n\n var constructor = ItemSet.types[type];\n var selected;\n\n if (item) {\n // update item \t\n if (!constructor || !(item instanceof constructor)) {\n // item type has changed, delete the item and recreate it\n selected = item.selected; // preserve selection of this item\n me._removeItem(item);\n item = null;\n }\n else {\n me._updateItem(item, itemData);\n }\n }\n\n if (!item && itemData) {\n // create item\n if (constructor) {\n item = new constructor(itemData, me.conversion, me.options);\n item.id = id; // TODO: not so nice setting id afterwards\n\n me._addItem(item);\n if (selected) {\n this.selection.push(id);\n item.select();\n }\n }\n else if (type == 'rangeoverflow') {\n // TODO: deprecated since version 2.1.0 (or 3.0.0?). cleanup some day\n throw new TypeError('Item type \"rangeoverflow\" is deprecated. Use css styling instead: ' +\n '.vis-item.vis-range .vis-item-content {overflow: visible;}');\n }\n else {\n throw new TypeError('Unknown item type \"' + type + '\"');\n }\n }\n }.bind(this));\n\n this._order();\n this.stackDirty = true; // force re-stacking of all items next redraw\n this.body.emitter.emit('_change', {queue: true});\n};\n\n/**\n * Handle added items\n * @param {Number[]} ids\n * @protected\n */\nItemSet.prototype._onAdd = ItemSet.prototype._onUpdate;\n\n/**\n * Handle removed items\n * @param {Number[]} ids\n * @protected\n */\nItemSet.prototype._onRemove = function(ids) {\n var count = 0;\n var me = this;\n ids.forEach(function (id) {\n var item = me.items[id];\n if (item) {\n count++;\n me._removeItem(item);\n }\n });\n\n if (count) {\n // update order\n this._order();\n this.stackDirty = true; // force re-stacking of all items next redraw\n this.body.emitter.emit('_change', {queue: true});\n }\n};\n\n/**\n * Update the order of item in all groups\n * @private\n */\nItemSet.prototype._order = function() {\n // reorder the items in all groups\n // TODO: optimization: only reorder groups affected by the changed items\n util.forEach(this.groups, function (group) {\n group.order();\n });\n};\n\n/**\n * Handle updated groups\n * @param {Number[]} ids\n * @private\n */\nItemSet.prototype._onUpdateGroups = function(ids) {\n this._onAddGroups(ids);\n};\n\n/**\n * Handle changed groups (added or updated)\n * @param {Number[]} ids\n * @private\n */\nItemSet.prototype._onAddGroups = function(ids) {\n var me = this;\n\n ids.forEach(function (id) {\n var groupData = me.groupsData.get(id);\n var group = me.groups[id];\n\n if (!group) {\n // check for reserved ids\n if (id == UNGROUPED || id == BACKGROUND) {\n throw new Error('Illegal group id. ' + id + ' is a reserved id.');\n }\n\n var groupOptions = Object.create(me.options);\n util.extend(groupOptions, {\n height: null\n });\n\n group = new Group(id, groupData, me);\n me.groups[id] = group;\n\n // add items with this groupId to the new group\n for (var itemId in me.items) {\n if (me.items.hasOwnProperty(itemId)) {\n var item = me.items[itemId];\n if (item.data.group == id) {\n group.add(item);\n }\n }\n }\n\n group.order();\n group.show();\n }\n else {\n // update group\n group.setData(groupData);\n }\n });\n\n this.body.emitter.emit('_change', {queue: true});\n};\n\n/**\n * Handle removed groups\n * @param {Number[]} ids\n * @private\n */\nItemSet.prototype._onRemoveGroups = function(ids) {\n var groups = this.groups;\n ids.forEach(function (id) {\n var group = groups[id];\n\n if (group) {\n group.hide();\n delete groups[id];\n }\n });\n\n this.markDirty();\n\n this.body.emitter.emit('_change', {queue: true});\n};\n\n/**\n * Reorder the groups if needed\n * @return {boolean} changed\n * @private\n */\nItemSet.prototype._orderGroups = function () {\n if (this.groupsData) {\n // reorder the groups\n var groupIds = this.groupsData.getIds({\n order: this.options.groupOrder\n });\n\n groupIds = this._orderNestedGroups(groupIds);\n\n var changed = !util.equalArray(groupIds, this.groupIds);\n if (changed) {\n // hide all groups, removes them from the DOM\n var groups = this.groups;\n groupIds.forEach(function (groupId) {\n groups[groupId].hide();\n });\n\n // show the groups again, attach them to the DOM in correct order\n groupIds.forEach(function (groupId) {\n groups[groupId].show();\n });\n\n this.groupIds = groupIds;\n }\n\n return changed;\n }\n else {\n return false;\n }\n};\n\n/**\n * Reorder the nested groups\n * @return {boolean} changed\n * @private\n */\nItemSet.prototype._orderNestedGroups = function(groupIds) {\n var newGroupIdsOrder = [];\n\n groupIds.forEach(function(groupId){\n var groupData = this.groupsData.get(groupId);\n if (!groupData.nestedInGroup) {\n newGroupIdsOrder.push(groupId)\n }\n if (groupData.nestedGroups) {\n var nestedGroups = this.groupsData.get({\n filter: function(nestedGroup) {\n return nestedGroup.nestedInGroup == groupId;\n }\n });\n var nestedGroupIds = nestedGroups.map(function(nestedGroup) { return nestedGroup.id })\n newGroupIdsOrder = newGroupIdsOrder.concat(nestedGroupIds);\n }\n }, this)\n return newGroupIdsOrder;\n}\n\n\n/**\n * Add a new item\n * @param {Item} item\n * @private\n */\nItemSet.prototype._addItem = function(item) {\n this.items[item.id] = item;\n\n // add to group\n var groupId = this._getGroupId(item.data);\n var group = this.groups[groupId];\n\n if (!group) {\n \titem.groupShowing = false;\n } else if (group && group.data && group.data.showNested) {\n \titem.groupShowing = true;\n }\n\n if (group) group.add(item);\n};\n\n/**\n * Update an existing item\n * @param {Item} item\n * @param {Object} itemData\n * @private\n */\nItemSet.prototype._updateItem = function(item, itemData) {\n var oldGroupId = item.data.group;\n var oldSubGroupId = item.data.subgroup;\n\n // update the items data (will redraw the item when displayed)\n item.setData(itemData);\n\n var groupId = this._getGroupId(item.data);\n\tvar group = this.groups[groupId];\n if (!group) {\n \titem.groupShowing = false;\n } else if (group && group.data && group.data.showNested) {\n \titem.groupShowing = true;\n }\n // update group\n if (oldGroupId != item.data.group || oldSubGroupId != item.data.subgroup) {\n var oldGroup = this.groups[oldGroupId];\n if (oldGroup) oldGroup.remove(item);\n if (group) group.add(item);\n }\n};\n\n/**\n * Delete an item from the ItemSet: remove it from the DOM, from the map\n * with items, and from the map with visible items, and from the selection\n * @param {Item} item\n * @private\n */\nItemSet.prototype._removeItem = function(item) {\n // remove from DOM\n item.hide();\n\n // remove from items\n delete this.items[item.id];\n\n // remove from selection\n var index = this.selection.indexOf(item.id);\n if (index != -1) this.selection.splice(index, 1);\n\n // remove from group\n item.parent && item.parent.remove(item);\n};\n\n/**\n * Create an array containing all items being a range (having an end date)\n * @param array\n * @returns {Array}\n * @private\n */\nItemSet.prototype._constructByEndArray = function(array) {\n var endArray = [];\n\n for (var i = 0; i < array.length; i++) {\n if (array[i] instanceof RangeItem) {\n endArray.push(array[i]);\n }\n }\n return endArray;\n};\n\n/**\n * Register the clicked item on touch, before dragStart is initiated.\n *\n * dragStart is initiated from a mousemove event, AFTER the mouse/touch is\n * already moving. Therefore, the mouse/touch can sometimes be above an other\n * DOM element than the item itself.\n *\n * @param {Event} event\n * @private\n */\nItemSet.prototype._onTouch = function (event) {\n // store the touched item, used in _onDragStart\n this.touchParams.item = this.itemFromTarget(event);\n this.touchParams.dragLeftItem = event.target.dragLeftItem || false;\n this.touchParams.dragRightItem = event.target.dragRightItem || false;\n this.touchParams.itemProps = null;\n};\n\n\n/**\n * Given an group id, returns the index it has.\n *\n * @param {Number} groupID\n * @private\n */\nItemSet.prototype._getGroupIndex = function(groupId) {\n for (var i = 0; i < this.groupIds.length; i++) {\n if (groupId == this.groupIds[i])\n return i;\n }\n};\n\n/**\n * Start dragging the selected events\n * @param {Event} event\n * @private\n */\nItemSet.prototype._onDragStart = function (event) {\n if (this.touchParams.itemIsDragging) { return; }\n var item = this.touchParams.item || null;\n var me = this;\n var props;\n\n if (item && (item.selected || this.options.itemsAlwaysDraggable)) {\n\n if (this.options.editable.overrideItems &&\n !this.options.editable.updateTime &&\n !this.options.editable.updateGroup) {\n return;\n }\n\n // override options.editable\n if ((item.editable != null && !item.editable.updateTime && !item.editable.updateGroup)\n && !this.options.editable.overrideItems) {\n return;\n }\n\n var dragLeftItem = this.touchParams.dragLeftItem;\n var dragRightItem = this.touchParams.dragRightItem;\n this.touchParams.itemIsDragging = true;\n this.touchParams.selectedItem = item;\n\n if (dragLeftItem) {\n props = {\n item: dragLeftItem,\n initialX: event.center.x,\n dragLeft: true,\n data: this._cloneItemData(item.data)\n };\n\n this.touchParams.itemProps = [props];\n }\n else if (dragRightItem) {\n props = {\n item: dragRightItem,\n initialX: event.center.x,\n dragRight: true,\n data: this._cloneItemData(item.data)\n };\n\n this.touchParams.itemProps = [props];\n }\n else {\n var baseGroupIndex = this._getGroupIndex(item.data.group);\n\n var itemsToDrag = (this.options.itemsAlwaysDraggable && !item.selected) ? [item.id] : this.getSelection();\n\n this.touchParams.itemProps = itemsToDrag.map(function (id) {\n var item = me.items[id];\n var groupIndex = me._getGroupIndex(item.data.group);\n return {\n item: item,\n initialX: event.center.x,\n groupOffset: baseGroupIndex-groupIndex,\n data: this._cloneItemData(item.data)\n };\n }.bind(this));\n }\n\n event.stopPropagation();\n }\n else if (this.options.editable.add && (event.srcEvent.ctrlKey || event.srcEvent.metaKey)) {\n // create a new range item when dragging with ctrl key down\n this._onDragStartAddItem(event);\n }\n};\n\n/**\n * Start creating a new range item by dragging.\n * @param {Event} event\n * @private\n */\nItemSet.prototype._onDragStartAddItem = function (event) {\n var snap = this.options.snap || null;\n\n if (this.options.rtl) {\n var xAbs = util.getAbsoluteRight(this.dom.frame);\n var x = xAbs - event.center.x + 10; // plus 10 to compensate for the drag starting as soon as you've moved 10px\n } else {\n var xAbs = util.getAbsoluteLeft(this.dom.frame);\n var x = event.center.x - xAbs - 10; // minus 10 to compensate for the drag starting as soon as you've moved 10px\n }\n\n var time = this.body.util.toTime(x);\n var scale = this.body.util.getScale();\n var step = this.body.util.getStep();\n var start = snap ? snap(time, scale, step) : time;\n var end = start;\n\n var itemData = {\n type: 'range',\n start: start,\n end: end,\n content: 'new item'\n };\n\n var id = util.randomUUID();\n itemData[this.itemsData._fieldId] = id;\n\n var group = this.groupFromTarget(event);\n if (group) {\n itemData.group = group.groupId;\n }\n var newItem = new RangeItem(itemData, this.conversion, this.options);\n newItem.id = id; // TODO: not so nice setting id afterwards\n newItem.data = this._cloneItemData(itemData);\n this._addItem(newItem);\n this.touchParams.selectedItem = newItem;\n \n var props = {\n item: newItem,\n initialX: event.center.x,\n data: newItem.data\n };\n\n if (this.options.rtl) {\n props.dragLeft = true;\n } else {\n props.dragRight = true;\n }\n this.touchParams.itemProps = [props];\n\n event.stopPropagation();\n};\n\n/**\n * Drag selected items\n * @param {Event} event\n * @private\n */\nItemSet.prototype._onDrag = function (event) {\n if (this.touchParams.itemProps) {\n event.stopPropagation();\n\n var me = this;\n var snap = this.options.snap || null;\n\n if (this.options.rtl) {\n var xOffset = this.body.dom.root.offsetLeft + this.body.domProps.right.width;\n } else {\n var xOffset = this.body.dom.root.offsetLeft + this.body.domProps.left.width;\n }\n\n var scale = this.body.util.getScale();\n var step = this.body.util.getStep();\n\n //only calculate the new group for the item that's actually dragged\n var selectedItem = this.touchParams.selectedItem;\n var updateGroupAllowed = ((this.options.editable.overrideItems || selectedItem.editable == null) && this.options.editable.updateGroup) ||\n (!this.options.editable.overrideItems && selectedItem.editable != null && selectedItem.editable.updateGroup);\n var newGroupBase = null;\n if (updateGroupAllowed && selectedItem) {\n if (selectedItem.data.group != undefined) {\n // drag from one group to another\n var group = me.groupFromTarget(event);\n if (group) {\n //we know the offset for all items, so the new group for all items\n //will be relative to this one.\n newGroupBase = this._getGroupIndex(group.groupId);\n }\n }\n }\n\n // move\n this.touchParams.itemProps.forEach(function (props) {\n var current = me.body.util.toTime(event.center.x - xOffset);\n var initial = me.body.util.toTime(props.initialX - xOffset);\n\n if (this.options.rtl) {\n var offset = -(current - initial); // ms\n } else {\n var offset = (current - initial); // ms\n }\n\n var itemData = this._cloneItemData(props.item.data); // clone the data\n if (props.item.editable != null\n && !props.item.editable.updateTime\n && !props.item.editable.updateGroup\n && !me.options.editable.overrideItems) {\n return;\n }\n\n var updateTimeAllowed = ((this.options.editable.overrideItems || selectedItem.editable == null) && this.options.editable.updateTime) ||\n (!this.options.editable.overrideItems && selectedItem.editable != null && selectedItem.editable.updateTime);\n if (updateTimeAllowed) {\n if (props.dragLeft) {\n // drag left side of a range item\n if (this.options.rtl) {\n if (itemData.end != undefined) {\n var initialEnd = util.convert(props.data.end, 'Date');\n var end = new Date(initialEnd.valueOf() + offset);\n // TODO: pass a Moment instead of a Date to snap(). (Breaking change)\n itemData.end = snap ? snap(end, scale, step) : end;\n }\n } else {\n if (itemData.start != undefined) {\n var initialStart = util.convert(props.data.start, 'Date');\n var start = new Date(initialStart.valueOf() + offset);\n // TODO: pass a Moment instead of a Date to snap(). (Breaking change)\n itemData.start = snap ? snap(start, scale, step) : start;\n }\n }\n }\n else if (props.dragRight) {\n // drag right side of a range item\n if (this.options.rtl) {\n if (itemData.start != undefined) {\n var initialStart = util.convert(props.data.start, 'Date');\n var start = new Date(initialStart.valueOf() + offset);\n // TODO: pass a Moment instead of a Date to snap(). (Breaking change)\n itemData.start = snap ? snap(start, scale, step) : start;\n }\n } else {\n if (itemData.end != undefined) {\n var initialEnd = util.convert(props.data.end, 'Date');\n var end = new Date(initialEnd.valueOf() + offset);\n // TODO: pass a Moment instead of a Date to snap(). (Breaking change)\n itemData.end = snap ? snap(end, scale, step) : end;\n }\n }\n }\n else {\n // drag both start and end\n if (itemData.start != undefined) {\n\n var initialStart = util.convert(props.data.start, 'Date').valueOf();\n var start = new Date(initialStart + offset);\n\n if (itemData.end != undefined) {\n var initialEnd = util.convert(props.data.end, 'Date');\n var duration = initialEnd.valueOf() - initialStart.valueOf();\n\n // TODO: pass a Moment instead of a Date to snap(). (Breaking change)\n itemData.start = snap ? snap(start, scale, step) : start;\n itemData.end = new Date(itemData.start.valueOf() + duration);\n }\n else {\n // TODO: pass a Moment instead of a Date to snap(). (Breaking change)\n itemData.start = snap ? snap(start, scale, step) : start;\n }\n\n\n }\n }\n }\n\n\n if (updateGroupAllowed && (!props.dragLeft && !props.dragRight) && newGroupBase!=null) {\n if (itemData.group != undefined) {\n var newOffset = newGroupBase - props.groupOffset;\n\n //make sure we stay in bounds\n newOffset = Math.max(0, newOffset);\n newOffset = Math.min(me.groupIds.length-1, newOffset);\n\n itemData.group = me.groupIds[newOffset];\n }\n }\n\n // confirm moving the item\n itemData = this._cloneItemData(itemData); // convert start and end to the correct type\n me.options.onMoving(itemData, function (itemData) {\n if (itemData) {\n props.item.setData(this._cloneItemData(itemData, 'Date'));\n }\n }.bind(this));\n }.bind(this));\n\n this.stackDirty = true; // force re-stacking of all items next redraw\n this.body.emitter.emit('_change');\n }\n};\n\n/**\n * Move an item to another group\n * @param {Item} item\n * @param {String | Number} groupId\n * @private\n */\nItemSet.prototype._moveToGroup = function(item, groupId) {\n var group = this.groups[groupId];\n if (group && group.groupId != item.data.group) {\n var oldGroup = item.parent;\n oldGroup.remove(item);\n oldGroup.order();\n group.add(item);\n group.order();\n\n item.data.group = group.groupId;\n }\n};\n\n/**\n * End of dragging selected items\n * @param {Event} event\n * @private\n */\nItemSet.prototype._onDragEnd = function (event) {\n this.touchParams.itemIsDragging = false;\n if (this.touchParams.itemProps) {\n event.stopPropagation();\n\n var me = this;\n var dataset = this.itemsData.getDataSet();\n var itemProps = this.touchParams.itemProps ;\n this.touchParams.itemProps = null;\n\n itemProps.forEach(function (props) {\n var id = props.item.id;\n var exists = me.itemsData.get(id, me.itemOptions) != null;\n\n if (!exists) {\n // add a new item\n me.options.onAdd(props.item.data, function (itemData) {\n me._removeItem(props.item); // remove temporary item\n if (itemData) {\n me.itemsData.getDataSet().add(itemData);\n }\n\n // force re-stacking of all items next redraw\n me.stackDirty = true;\n me.body.emitter.emit('_change');\n });\n }\n else {\n // update existing item\n var itemData = this._cloneItemData(props.item.data); // convert start and end to the correct type\n me.options.onMove(itemData, function (itemData) {\n if (itemData) {\n // apply changes\n itemData[dataset._fieldId] = id; // ensure the item contains its id (can be undefined)\n dataset.update(itemData);\n }\n else {\n // restore original values\n props.item.setData(props.data);\n\n me.stackDirty = true; // force re-stacking of all items next redraw\n me.body.emitter.emit('_change');\n }\n });\n }\n }.bind(this));\n }\n};\n\nItemSet.prototype._onGroupClick = function (event) {\n var group = this.groupFromTarget(event);\n\n if (!group.nestedGroups) return;\n\n var groupsData = this.groupsData;\n if (this.groupsData instanceof DataView) {\n groupsData = this.groupsData.getDataSet()\n }\n\n group.showNested = !group.showNested;\n\n var nestedGroups = groupsData.get(group.nestedGroups).map(function(nestedGroup) {\n if (nestedGroup.visible == undefined) { nestedGroup.visible = true; }\n nestedGroup.visible = !!group.showNested;\n return nestedGroup;\n });\n groupsData.update(nestedGroups);\n\n if (group.showNested) {\n util.removeClassName(group.dom.label, 'collapsed');\n util.addClassName(group.dom.label, 'expanded');\n } else {\n util.removeClassName(group.dom.label, 'expanded');\n var collapsedDirClassName = this.options.rtl ? 'collapsed-rtl' : 'collapsed'\n util.addClassName(group.dom.label, collapsedDirClassName);\n }\n}\n\nItemSet.prototype._onGroupDragStart = function (event) {\n\tif (this.options.groupEditable.order) {\n\t\tthis.groupTouchParams.group = this.groupFromTarget(event);\n\t\t\n\t\tif (this.groupTouchParams.group) {\n\t\t\tevent.stopPropagation();\n\t\t\t\n\t\t\tthis.groupTouchParams.originalOrder = this.groupsData.getIds({\n\t\t\t order: this.options.groupOrder\n\t\t });\n\t\t}\n\t}\n}\n\nItemSet.prototype._onGroupDrag = function (event) {\n\tif (this.options.groupEditable.order && this.groupTouchParams.group) {\n\t\tevent.stopPropagation();\n\t\t\n var groupsData = this.groupsData;\n if (this.groupsData instanceof DataView) {\n groupsData = this.groupsData.getDataSet()\n }\n\t\t// drag from one group to another\n\t\tvar group = this.groupFromTarget(event);\n\t\t\n\t\t// try to avoid toggling when groups differ in height\n\t\tif (group && group.height != this.groupTouchParams.group.height) {\n\t\t\tvar movingUp = (group.top < this.groupTouchParams.group.top);\n\t\t\tvar clientY = event.center ? event.center.y : event.clientY;\n\t\t\tvar targetGroupTop = util.getAbsoluteTop(group.dom.foreground);\n\t\t\tvar draggedGroupHeight = this.groupTouchParams.group.height;\n\t\t\tif (movingUp) {\n\t\t\t\t// skip swapping the groups when the dragged group is not below clientY afterwards\n\t\t\t\tif (targetGroupTop + draggedGroupHeight < clientY) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvar targetGroupHeight = group.height;\n\t\t\t\t// skip swapping the groups when the dragged group is not below clientY afterwards\n\t\t\t\tif (targetGroupTop + targetGroupHeight - draggedGroupHeight > clientY) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (group && group != this.groupTouchParams.group) {\n\t\t\tvar targetGroup = groupsData.get(group.groupId);\n\t\t\tvar draggedGroup = groupsData.get(this.groupTouchParams.group.groupId);\n\t\t\t\n\t\t\t// switch groups\n\t\t\tif (draggedGroup && targetGroup) {\n\t\t\t\tthis.options.groupOrderSwap(draggedGroup, targetGroup, groupsData);\n\t\t\t\tgroupsData.update(draggedGroup);\n\t\t\t\tgroupsData.update(targetGroup);\n\t\t\t}\n\t\t\t\n\t\t\t// fetch current order of groups\n\t\t\tvar newOrder = groupsData.getIds({\n\t\t\t order: this.options.groupOrder\n\t\t });\n\n\t\t\t\n\t\t\t// in case of changes since _onGroupDragStart\n\t\t\tif (!util.equalArray(newOrder, this.groupTouchParams.originalOrder)) {\n\t\t\t\tvar origOrder = this.groupTouchParams.originalOrder;\n\t\t\t\tvar draggedId = this.groupTouchParams.group.groupId;\n\t\t\t\tvar numGroups = Math.min(origOrder.length, newOrder.length);\n\t\t\t\tvar curPos = 0;\n\t\t\t\tvar newOffset = 0;\n\t\t\t\tvar orgOffset = 0;\n\t\t\t\twhile (curPos < numGroups) {\n\t\t\t\t\t// as long as the groups are where they should be step down along the groups order\n\t\t\t\t\twhile ((curPos+newOffset) < numGroups \n\t\t\t\t\t\t&& (curPos+orgOffset) < numGroups \n\t\t\t\t\t\t&& newOrder[curPos+newOffset] == origOrder[curPos+orgOffset]) {\n\t\t\t\t\t\tcurPos++;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// all ok\n\t\t\t\t\tif (curPos+newOffset >= numGroups) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// not all ok\n\t\t\t\t\t// if dragged group was move upwards everything below should have an offset\n\t\t\t\t\tif (newOrder[curPos+newOffset] == draggedId) {\n\t\t\t\t\t\tnewOffset = 1;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t// if dragged group was move downwards everything above should have an offset\n\t\t\t\t\telse if (origOrder[curPos+orgOffset] == draggedId) {\n\t\t\t\t\t\torgOffset = 1;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} \n\t\t\t\t\t// found a group (apart from dragged group) that has the wrong position -> switch with the \n\t\t\t\t\t// group at the position where other one should be, fix index arrays and continue\n\t\t\t\t\telse {\n\t\t\t\t\t\tvar slippedPosition = newOrder.indexOf(origOrder[curPos+orgOffset])\n\t\t\t\t\t\tvar switchGroup = groupsData.get(newOrder[curPos+newOffset]);\n\t\t\t\t\t\tvar shouldBeGroup = groupsData.get(origOrder[curPos+orgOffset]);\n\t\t\t\t\t\tthis.options.groupOrderSwap(switchGroup, shouldBeGroup, groupsData);\n\t\t\t\t\t\tgroupsData.update(switchGroup);\n\t\t\t\t\t\tgroupsData.update(shouldBeGroup);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar switchGroupId = newOrder[curPos+newOffset];\n\t\t\t\t\t\tnewOrder[curPos+newOffset] = origOrder[curPos+orgOffset];\n\t\t\t\t\t\tnewOrder[slippedPosition] = switchGroupId;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcurPos++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n}\n\nItemSet.prototype._onGroupDragEnd = function (event) {\n\tif (this.options.groupEditable.order && this.groupTouchParams.group) {\n\t\tevent.stopPropagation();\n\t\t\n\t\t// update existing group\n\t\tvar me = this;\n\t\tvar id = me.groupTouchParams.group.groupId;\n\t\tvar dataset = me.groupsData.getDataSet();\n var groupData = util.extend({}, dataset.get(id)); // clone the data\n me.options.onMoveGroup(groupData, function (groupData) {\n if (groupData) {\n // apply changes\n \tgroupData[dataset._fieldId] = id; // ensure the group contains its id (can be undefined)\n dataset.update(groupData);\n }\n else {\n \t \n \t// fetch current order of groups\n \t\t\tvar newOrder = dataset.getIds({\n \t\t\t order: me.options.groupOrder\n \t\t });\n \t \n // restore original order\n \tif (!util.equalArray(newOrder, me.groupTouchParams.originalOrder)) {\n \t\tvar origOrder = me.groupTouchParams.originalOrder;\n \t\t\t\tvar numGroups = Math.min(origOrder.length, newOrder.length);\n \t\t\t\tvar curPos = 0;\n \t\t\t\twhile (curPos < numGroups) {\n \t\t\t\t\t// as long as the groups are where they should be step down along the groups order\n \t\t\t\t\twhile (curPos < numGroups && newOrder[curPos] == origOrder[curPos]) {\n \t\t\t\t\t curPos++;\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\t// all ok\n \t\t\t\t\tif (curPos >= numGroups) {\n \t\t\t\t\t\tbreak;\n \t\t\t\t\t}\n \t\t\t\t\t\n\t\t\t\t\t\t// found a group that has the wrong position -> switch with the \n\t\t\t\t\t\t// group at the position where other one should be, fix index arrays and continue\n\t\t\t\t\t\tvar slippedPosition = newOrder.indexOf(origOrder[curPos])\n\t\t\t\t\t\tvar switchGroup = dataset.get(newOrder[curPos]);\n\t\t\t\t\t\tvar shouldBeGroup = dataset.get(origOrder[curPos]);\n\t\t\t\t\t\tme.options.groupOrderSwap(switchGroup, shouldBeGroup, dataset);\n\t\t\t\t\t\tgroupsData.update(switchGroup);\n\t\t\t\t\t\tgroupsData.update(shouldBeGroup);\n \t\t\t\t\t\t\n \t\t\t\t\tvar switchGroupId = newOrder[curPos];\n \t\t\t\t\tnewOrder[curPos] = origOrder[curPos];\n \t\t\t\t\tnewOrder[slippedPosition] = switchGroupId;\n \t\t\t\t\t\t\n \t\t\t\t\tcurPos++;\n \t\t\t\t}\n \t\t\t}\n\n }\n });\n \n me.body.emitter.emit('groupDragged', { groupId: id });\n\t}\n}\n\n/**\n * Handle selecting/deselecting an item when tapping it\n * @param {Event} event\n * @private\n */\nItemSet.prototype._onSelectItem = function (event) {\n if (!this.options.selectable) return;\n\n var ctrlKey = event.srcEvent && (event.srcEvent.ctrlKey || event.srcEvent.metaKey);\n var shiftKey = event.srcEvent && event.srcEvent.shiftKey;\n if (ctrlKey || shiftKey) {\n this._onMultiSelectItem(event);\n return;\n }\n\n var oldSelection = this.getSelection();\n\n var item = this.itemFromTarget(event);\n var selection = item ? [item.id] : [];\n this.setSelection(selection);\n\n var newSelection = this.getSelection();\n\n // emit a select event,\n // except when old selection is empty and new selection is still empty\n if (newSelection.length > 0 || oldSelection.length > 0) {\n this.body.emitter.emit('select', {\n items: newSelection,\n event: util.elementsCensor(event)\n });\n }\n};\n\n/**\n * Handle hovering an item\n * @param {Event} event\n * @private\n */\nItemSet.prototype._onMouseOver = function (event) {\n var item = this.itemFromTarget(event);\n if (!item) return;\n\n // Item we just left\n var related = this.itemFromRelatedTarget(event);\n if (item === related) {\n // We haven't changed item, just element in the item\n return;\n }\n\n if (item.getTitle()) {\n if (item.popup == null) {\n item.setPopup(new Popup(this.body.dom.root, this.options.tooltip.overflowMethod || 'flip'));\n }\n\n var container = this.body.dom.centerContainer;\n item.popup.setPosition(\n event.clientX - util.getAbsoluteLeft(container) + container.offsetLeft,\n event.clientY - util.getAbsoluteTop(container) + container.offsetTop\n );\n item.popup.show();\n }\n\n this.body.emitter.emit('itemover', {\n item: item.id,\n event: util.elementsCensor(event)\n });\n};\nItemSet.prototype._onMouseOut = function (event) {\n var item = this.itemFromTarget(event);\n if (!item) return;\n\n // Item we are going to\n var related = this.itemFromRelatedTarget(event);\n if (item === related) {\n // We aren't changing item, just element in the item\n return;\n }\n\n if (item.popup != null) {\n item.popup.hide();\n }\n\n this.body.emitter.emit('itemout', {\n item: item.id,\n event: util.elementsCensor(event)\n });\n};\nItemSet.prototype._onMouseMove = function (event) {\n var item = this.itemFromTarget(event);\n if (!item) return;\n\n if (this.options.tooltip.followMouse) {\n if (item.popup) {\n if (!item.popup.hidden) {\n var container = this.body.dom.centerContainer;\n item.popup.setPosition(\n event.clientX - util.getAbsoluteLeft(container) + container.offsetLeft,\n event.clientY - util.getAbsoluteTop(container) + container.offsetTop\n );\n item.popup.show(); // Redraw\n }\n }\n }\n};\n\n\n/**\n * Handle updates of an item on double tap\n * @param event\n * @private\n */\nItemSet.prototype._onUpdateItem = function (item) {\n if (!this.options.selectable) return;\n if (!this.options.editable.add) return;\n\n var me = this;\n \n if (item) {\n // execute async handler to update the item (or cancel it)\n var itemData = me.itemsData.get(item.id); // get a clone of the data from the dataset\n this.options.onUpdate(itemData, function (itemData) {\n if (itemData) {\n me.itemsData.getDataSet().update(itemData);\n }\n });\n }\n}\n\n/**\n * Handle creation of an item on double tap\n * @param event\n * @private\n */\nItemSet.prototype._onAddItem = function (event) {\n if (!this.options.selectable) return;\n if (!this.options.editable.add) return;\n\n var me = this;\n var snap = this.options.snap || null;\n var item = this.itemFromTarget(event);\n\n if (!item) {\n // add item\n if (this.options.rtl) {\n var xAbs = util.getAbsoluteRight(this.dom.frame);\n var x = xAbs - event.center.x;\n } else {\n var xAbs = util.getAbsoluteLeft(this.dom.frame);\n var x = event.center.x - xAbs; \n }\n // var xAbs = util.getAbsoluteLeft(this.dom.frame);\n // var x = event.center.x - xAbs;\n var start = this.body.util.toTime(x);\n var scale = this.body.util.getScale();\n var step = this.body.util.getStep();\n\n var newItemData = {\n start: snap ? snap(start, scale, step) : start,\n content: 'new item'\n };\n\n if (event.type == 'drop') {\n var itemData = JSON.parse(event.dataTransfer.getData(\"text\"))\n newItemData.content = itemData.content; // content is required \n newItemData.type = itemData.type || 'box';\n newItemData[this.itemsData._fieldId] = itemData.id || util.randomUUID();\n\n if (itemData.type == 'range' || (itemData.end && itemData.start)) {\n if (!itemData.end) {\n var end = this.body.util.toTime(x + this.props.width / 5);\n newItemData.end = snap ? snap(end, scale, step) : end;\n } else {\n newItemData.end = itemData.end;\n newItemData.start = itemData.start;\n }\n }\n } else {\n newItemData[this.itemsData._fieldId] = util.randomUUID();\n\n // when default type is a range, add a default end date to the new item\n if (this.options.type === 'range') {\n var end = this.body.util.toTime(x + this.props.width / 5);\n newItemData.end = snap ? snap(end, scale, step) : end;\n }\n }\n\n var group = this.groupFromTarget(event);\n if (group) {\n newItemData.group = group.groupId;\n }\n\n // execute async handler to customize (or cancel) adding an item\n newItemData = this._cloneItemData(newItemData); // convert start and end to the correct type\n this.options.onAdd(newItemData, function (item) {\n if (item) {\n me.itemsData.getDataSet().add(item);\n if (event.type == 'drop') {\n me.setSelection([item.id]);\n }\n // TODO: need to trigger a redraw?\n }\n });\n }\n};\n\n/**\n * Handle selecting/deselecting multiple items when holding an item\n * @param {Event} event\n * @private\n */\nItemSet.prototype._onMultiSelectItem = function (event) {\n if (!this.options.selectable) return;\n\n var item = this.itemFromTarget(event);\n\n if (item) {\n // multi select items (if allowed)\n\n var selection = this.options.multiselect\n ? this.getSelection() // take current selection\n : []; // deselect current selection\n\n var shiftKey = event.srcEvent && event.srcEvent.shiftKey || false;\n\n if (shiftKey && this.options.multiselect) {\n // select all items between the old selection and the tapped item\n var itemGroup = this.itemsData.get(item.id).group;\n \t\n // when filtering get the group of the last selected item\n var lastSelectedGroup = undefined;\n if (this.options.multiselectPerGroup) {\n if (selection.length > 0) {\n lastSelectedGroup = this.itemsData.get(selection[0]).group;\n }\n }\n \t\n // determine the selection range\n if (!this.options.multiselectPerGroup || lastSelectedGroup == undefined || lastSelectedGroup == itemGroup) {\n selection.push(item.id);\n }\n var range = ItemSet._getItemRange(this.itemsData.get(selection, this.itemOptions));\n \n if (!this.options.multiselectPerGroup || lastSelectedGroup == itemGroup) {\n // select all items within the selection range\n selection = [];\n for (var id in this.items) {\n if (this.items.hasOwnProperty(id)) {\n var _item = this.items[id];\n var start = _item.data.start;\n var end = (_item.data.end !== undefined) ? _item.data.end : start;\n\n if (start >= range.min &&\n end <= range.max &&\n (!this.options.multiselectPerGroup || lastSelectedGroup == this.itemsData.get(_item.id).group) &&\n !(_item instanceof BackgroundItem)) {\n selection.push(_item.id); // do not use id but item.id, id itself is stringified\n }\n }\n }\n }\n }\n else {\n // add/remove this item from the current selection\n var index = selection.indexOf(item.id);\n if (index == -1) {\n // item is not yet selected -> select it\n selection.push(item.id);\n }\n else {\n // item is already selected -> deselect it\n selection.splice(index, 1);\n }\n }\n\n this.setSelection(selection);\n\n this.body.emitter.emit('select', {\n items: this.getSelection(),\n event: util.elementsCensor(event)\n });\n }\n};\n\n/**\n * Calculate the time range of a list of items\n * @param {Array.} itemsData\n * @return {{min: Date, max: Date}} Returns the range of the provided items\n * @private\n */\nItemSet._getItemRange = function(itemsData) {\n var max = null;\n var min = null;\n\n itemsData.forEach(function (data) {\n if (min == null || data.start < min) {\n min = data.start;\n }\n\n if (data.end != undefined) {\n if (max == null || data.end > max) {\n max = data.end;\n }\n }\n else {\n if (max == null || data.start > max) {\n max = data.start;\n }\n }\n });\n\n return {\n min: min,\n max: max\n }\n};\n\n/**\n * Find an item from an element:\n * searches for the attribute 'timeline-item' in the element's tree\n * @param {HTMLElement} element\n * @return {Item | null} item\n */\nItemSet.prototype.itemFromElement = function(element) {\n var cur = element;\n while (cur) {\n if (cur.hasOwnProperty('timeline-item')) {\n return cur['timeline-item'];\n }\n cur = cur.parentNode;\n }\n\n return null;\n};\n\n/**\n * Find an item from an event target:\n * searches for the attribute 'timeline-item' in the event target's element tree\n * @param {Event} event\n * @return {Item | null} item\n */\nItemSet.prototype.itemFromTarget = function(event) {\n return this.itemFromElement(event.target);\n};\n\n/**\n * Find an item from an event's related target:\n * searches for the attribute 'timeline-item' in the related target's element tree\n * @param {Event} event\n * @return {Item | null} item\n */\nItemSet.prototype.itemFromRelatedTarget = function(event) {\n return this.itemFromElement(event.relatedTarget);\n};\n\n/**\n * Find the Group from an event target:\n * searches for the attribute 'timeline-group' in the event target's element tree\n * @param {Event} event\n * @return {Group | null} group\n */\nItemSet.prototype.groupFromTarget = function(event) {\n var clientY = event.center ? event.center.y : event.clientY;\n for (var i = 0; i < this.groupIds.length; i++) {\n var groupId = this.groupIds[i];\n var group = this.groups[groupId];\n var foreground = group.dom.foreground;\n var top = util.getAbsoluteTop(foreground);\n if (clientY > top && clientY < top + foreground.offsetHeight) {\n return group;\n }\n\n if (this.options.orientation.item === 'top') {\n if (i === this.groupIds.length - 1 && clientY > top) {\n return group;\n }\n }\n else {\n if (i === 0 && clientY < top + foreground.offset) {\n return group;\n }\n }\n }\n\n return null;\n};\n\n/**\n * Find the ItemSet from an event target:\n * searches for the attribute 'timeline-itemset' in the event target's element tree\n * @param {Event} event\n * @return {ItemSet | null} item\n */\nItemSet.itemSetFromTarget = function(event) {\n var target = event.target;\n while (target) {\n if (target.hasOwnProperty('timeline-itemset')) {\n return target['timeline-itemset'];\n }\n target = target.parentNode;\n }\n\n return null;\n};\n\n/**\n * Clone the data of an item, and \"normalize\" it: convert the start and end date\n * to the type (Date, Moment, ...) configured in the DataSet. If not configured,\n * start and end are converted to Date.\n * @param {Object} itemData, typically `item.data`\n * @param {string} [type] Optional Date type. If not provided, the type from the DataSet is taken\n * @return {Object} The cloned object\n * @private\n */\nItemSet.prototype._cloneItemData = function (itemData, type) {\n var clone = util.extend({}, itemData);\n\n if (!type) {\n // convert start and end date to the type (Date, Moment, ...) configured in the DataSet\n type = this.itemsData.getDataSet()._options.type;\n }\n\n if (clone.start != undefined) {\n clone.start = util.convert(clone.start, type && type.start || 'Date');\n }\n if (clone.end != undefined) {\n clone.end = util.convert(clone.end , type && type.end || 'Date');\n }\n\n return clone;\n};\n\nmodule.exports = ItemSet;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/timeline/component/ItemSet.js","/**\n * Popup is a class to create a popup window with some text\n * @param {Element} container The container object.\n * @param {string} overflowMethod How the popup should act to overflowing ('flip' or 'cap')\n */\nclass Popup {\n constructor(container, overflowMethod) {\n this.container = container;\n this.overflowMethod = overflowMethod || 'cap';\n\n this.x = 0;\n this.y = 0;\n this.padding = 5;\n this.hidden = false;\n\n // create the frame\n this.frame = document.createElement('div');\n this.frame.className = 'vis-tooltip';\n this.container.appendChild(this.frame);\n }\n\n /**\n * @param {number} x Horizontal position of the popup window\n * @param {number} y Vertical position of the popup window\n */\n setPosition(x, y) {\n this.x = parseInt(x);\n this.y = parseInt(y);\n }\n\n /**\n * Set the content for the popup window. This can be HTML code or text.\n * @param {string | Element} content\n */\n setText(content) {\n if (content instanceof Element) {\n this.frame.innerHTML = '';\n this.frame.appendChild(content);\n }\n else {\n this.frame.innerHTML = content; // string containing text or HTML\n }\n }\n\n /**\n * Show the popup window\n * @param {boolean} [doShow] Show or hide the window\n */\n show(doShow) {\n if (doShow === undefined) {\n doShow = true;\n }\n\n if (doShow === true) {\n var height = this.frame.clientHeight;\n var width = this.frame.clientWidth;\n var maxHeight = this.frame.parentNode.clientHeight;\n var maxWidth = this.frame.parentNode.clientWidth;\n\n var left = 0, top = 0;\n\n if (this.overflowMethod == 'flip') {\n var isLeft = false, isTop = true; // Where around the position it's located\n\n if (this.y - height < this.padding) {\n isTop = false;\n }\n\n if (this.x + width > maxWidth - this.padding) {\n isLeft = true;\n }\n\n if (isLeft) {\n left = this.x - width;\n } else {\n left = this.x;\n }\n\n if (isTop) {\n top = this.y - height;\n } else {\n top = this.y;\n }\n } else {\n top = (this.y - height);\n if (top + height + this.padding > maxHeight) {\n top = maxHeight - height - this.padding;\n }\n if (top < this.padding) {\n top = this.padding;\n }\n\n left = this.x;\n if (left + width + this.padding > maxWidth) {\n left = maxWidth - width - this.padding;\n }\n if (left < this.padding) {\n left = this.padding;\n }\n }\n\n this.frame.style.left = left + \"px\";\n this.frame.style.top = top + \"px\";\n this.frame.style.visibility = \"visible\";\n this.hidden = false;\n }\n else {\n this.hide();\n }\n }\n\n /**\n * Hide the popup window\n */\n hide() {\n this.hidden = true;\n this.frame.style.visibility = \"hidden\";\n }\n\n /**\n * Remove the popup window\n */\n destroy() {\n this.frame.parentNode.removeChild(this.frame); // Remove element from DOM\n }\n}\n\nexport default Popup;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/shared/Popup.js","var moment = require('../module/moment');\nvar DateUtil = require('./DateUtil');\nvar util = require('../util');\n\n/**\n * @constructor TimeStep\n * The class TimeStep is an iterator for dates. You provide a start date and an\n * end date. The class itself determines the best scale (step size) based on the\n * provided start Date, end Date, and minimumStep.\n *\n * If minimumStep is provided, the step size is chosen as close as possible\n * to the minimumStep but larger than minimumStep. If minimumStep is not\n * provided, the scale is set to 1 DAY.\n * The minimumStep should correspond with the onscreen size of about 6 characters\n *\n * Alternatively, you can set a scale by hand.\n * After creation, you can initialize the class by executing first(). Then you\n * can iterate from the start date to the end date via next(). You can check if\n * the end date is reached with the function hasNext(). After each step, you can\n * retrieve the current date via getCurrent().\n * The TimeStep has scales ranging from milliseconds, seconds, minutes, hours,\n * days, to years.\n *\n * Version: 1.2\n *\n * @param {Date} [start] The start date, for example new Date(2010, 9, 21)\n * or new Date(2010, 9, 21, 23, 45, 00)\n * @param {Date} [end] The end date\n * @param {Number} [minimumStep] Optional. Minimum step size in milliseconds\n */\nfunction TimeStep(start, end, minimumStep, hiddenDates) {\n this.moment = moment;\n\n // variables\n this.current = this.moment();\n this._start = this.moment();\n this._end = this.moment();\n\n this.autoScale = true;\n this.scale = 'day';\n this.step = 1;\n\n // initialize the range\n this.setRange(start, end, minimumStep);\n\n // hidden Dates options\n this.switchedDay = false;\n this.switchedMonth = false;\n this.switchedYear = false;\n if (Array.isArray(hiddenDates)) {\n this.hiddenDates = hiddenDates;\n }\n else if (hiddenDates != undefined) {\n this.hiddenDates = [hiddenDates];\n }\n else {\n this.hiddenDates = [];\n }\n\n this.format = TimeStep.FORMAT; // default formatting\n}\n\n// Time formatting\nTimeStep.FORMAT = {\n minorLabels: {\n millisecond:'SSS',\n second: 's',\n minute: 'HH:mm',\n hour: 'HH:mm',\n weekday: 'ddd D',\n day: 'D',\n month: 'MMM',\n year: 'YYYY'\n },\n majorLabels: {\n millisecond:'HH:mm:ss',\n second: 'D MMMM HH:mm',\n minute: 'ddd D MMMM',\n hour: 'ddd D MMMM',\n weekday: 'MMMM YYYY',\n day: 'MMMM YYYY',\n month: 'YYYY',\n year: ''\n }\n};\n\n/**\n * Set custom constructor function for moment. Can be used to set dates\n * to UTC or to set a utcOffset.\n * @param {function} moment\n */\nTimeStep.prototype.setMoment = function (moment) {\n this.moment = moment;\n\n // update the date properties, can have a new utcOffset\n this.current = this.moment(this.current.valueOf());\n this._start = this.moment(this._start.valueOf());\n this._end = this.moment(this._end.valueOf());\n};\n\n/**\n * Set custom formatting for the minor an major labels of the TimeStep.\n * Both `minorLabels` and `majorLabels` are an Object with properties:\n * 'millisecond', 'second', 'minute', 'hour', 'weekday', 'day', 'month', 'year'.\n * @param {{minorLabels: Object, majorLabels: Object}} format\n */\nTimeStep.prototype.setFormat = function (format) {\n var defaultFormat = util.deepExtend({}, TimeStep.FORMAT);\n this.format = util.deepExtend(defaultFormat, format);\n};\n\n/**\n * Set a new range\n * If minimumStep is provided, the step size is chosen as close as possible\n * to the minimumStep but larger than minimumStep. If minimumStep is not\n * provided, the scale is set to 1 DAY.\n * The minimumStep should correspond with the onscreen size of about 6 characters\n * @param {Date} [start] The start date and time.\n * @param {Date} [end] The end date and time.\n * @param {int} [minimumStep] Optional. Minimum step size in milliseconds\n */\nTimeStep.prototype.setRange = function(start, end, minimumStep) {\n if (!(start instanceof Date) || !(end instanceof Date)) {\n throw \"No legal start or end date in method setRange\";\n }\n\n this._start = (start != undefined) ? this.moment(start.valueOf()) : new Date();\n this._end = (end != undefined) ? this.moment(end.valueOf()) : new Date();\n\n if (this.autoScale) {\n this.setMinimumStep(minimumStep);\n }\n};\n\n/**\n * Set the range iterator to the start date.\n */\nTimeStep.prototype.start = function() {\n this.current = this._start.clone();\n this.roundToMinor();\n};\n\n/**\n * Round the current date to the first minor date value\n * This must be executed once when the current date is set to start Date\n */\nTimeStep.prototype.roundToMinor = function() {\n // round to floor\n // IMPORTANT: we have no breaks in this switch! (this is no bug)\n // noinspection FallThroughInSwitchStatementJS\n switch (this.scale) {\n case 'year':\n this.current.year(this.step * Math.floor(this.current.year() / this.step));\n this.current.month(0);\n case 'month': this.current.date(1);\n case 'day': // intentional fall through\n case 'weekday': this.current.hours(0);\n case 'hour': this.current.minutes(0);\n case 'minute': this.current.seconds(0);\n case 'second': this.current.milliseconds(0);\n //case 'millisecond': // nothing to do for milliseconds\n }\n\n if (this.step != 1) {\n // round down to the first minor value that is a multiple of the current step size\n switch (this.scale) {\n case 'millisecond': this.current.subtract(this.current.milliseconds() % this.step, 'milliseconds'); break;\n case 'second': this.current.subtract(this.current.seconds() % this.step, 'seconds'); break;\n case 'minute': this.current.subtract(this.current.minutes() % this.step, 'minutes'); break;\n case 'hour': this.current.subtract(this.current.hours() % this.step, 'hours'); break;\n case 'weekday': // intentional fall through\n case 'day': this.current.subtract((this.current.date() - 1) % this.step, 'day'); break;\n case 'month': this.current.subtract(this.current.month() % this.step, 'month'); break;\n case 'year': this.current.subtract(this.current.year() % this.step, 'year'); break;\n default: break;\n }\n }\n};\n\n/**\n * Check if the there is a next step\n * @return {boolean} true if the current date has not passed the end date\n */\nTimeStep.prototype.hasNext = function () {\n return (this.current.valueOf() <= this._end.valueOf());\n};\n\n/**\n * Do the next step\n */\nTimeStep.prototype.next = function() {\n var prev = this.current.valueOf();\n\n // Two cases, needed to prevent issues with switching daylight savings\n // (end of March and end of October)\n if (this.current.month() < 6) {\n switch (this.scale) {\n case 'millisecond': this.current.add(this.step, 'millisecond'); break;\n case 'second': this.current.add(this.step, 'second'); break;\n case 'minute': this.current.add(this.step, 'minute'); break;\n case 'hour':\n this.current.add(this.step, 'hour');\n // in case of skipping an hour for daylight savings, adjust the hour again (else you get: 0h 5h 9h ... instead of 0h 4h 8h ...)\n // TODO: is this still needed now we use the function of moment.js?\n this.current.subtract(this.current.hours() % this.step, 'hour');\n break;\n case 'weekday': // intentional fall through\n case 'day': this.current.add(this.step, 'day'); break;\n case 'month': this.current.add(this.step, 'month'); break;\n case 'year': this.current.add(this.step, 'year'); break;\n default: break;\n }\n }\n else {\n switch (this.scale) {\n case 'millisecond': this.current.add(this.step, 'millisecond'); break;\n case 'second': this.current.add(this.step, 'second'); break;\n case 'minute': this.current.add(this.step, 'minute'); break;\n case 'hour':\n this.current.add(this.moment.duration(this.step, 'hour'));\n\n // correct for daylight saving\n // FIXME: use this.current.add(moment.duration(this.step, 'hour'))\n // see http://momentjs.com/docs/#special-considerations-for-months-and-years\n if (this.current.hours() % this.step !== 0) {\n this.current.add(this.step - this.current.hours() % this.step, 'hour');\n }\n\n break;\n case 'weekday': // intentional fall through\n case 'day': this.current.add(this.step, 'day'); break;\n case 'month': this.current.add(this.step, 'month'); break;\n case 'year': this.current.add(this.step, 'year'); break;\n default: break;\n }\n }\n\n if (this.step != 1) {\n // round down to the correct major value\n switch (this.scale) {\n case 'millisecond': if(this.current.milliseconds() > 0 && this.current.milliseconds() < this.step) this.current.milliseconds(0); break;\n case 'second': if(this.current.seconds() > 0 && this.current.seconds() < this.step) this.current.seconds(0); break;\n case 'minute': if(this.current.minutes() > 0 && this.current.minutes() < this.step) this.current.minutes(0); break;\n case 'hour': if(this.current.hours() > 0 && this.current.hours() < this.step) this.current.hours(0); break;\n case 'weekday': // intentional fall through\n case 'day': if(this.current.date() < this.step+1) this.current.date(1); break;\n case 'month': if(this.current.month() < this.step) this.current.month(0); break;\n case 'year': break; // nothing to do for year\n default: break;\n }\n }\n\n // safety mechanism: if current time is still unchanged, move to the end\n if (this.current.valueOf() == prev) {\n this.current = this._end.clone();\n }\n\n // Reset switches for year, month and day. Will get set to true where appropriate in DateUtil.stepOverHiddenDates\n this.switchedDay = false;\n this.switchedMonth = false;\n this.switchedYear = false;\n\n DateUtil.stepOverHiddenDates(this.moment, this, prev);\n};\n\n\n/**\n * Get the current datetime\n * @return {Moment} current The current date\n */\nTimeStep.prototype.getCurrent = function() {\n return this.current;\n};\n\n/**\n * Set a custom scale. Autoscaling will be disabled.\n * For example setScale('minute', 5) will result\n * in minor steps of 5 minutes, and major steps of an hour.\n *\n * @param {{scale: string, step: number}} params\n * An object containing two properties:\n * - A string 'scale'. Choose from 'millisecond', 'second',\n * 'minute', 'hour', 'weekday', 'day', 'month', 'year'.\n * - A number 'step'. A step size, by default 1.\n * Choose for example 1, 2, 5, or 10.\n */\nTimeStep.prototype.setScale = function(params) {\n if (params && typeof params.scale == 'string') {\n this.scale = params.scale;\n this.step = params.step > 0 ? params.step : 1;\n this.autoScale = false;\n }\n};\n\n/**\n * Enable or disable autoscaling\n * @param {boolean} enable If true, autoascaling is set true\n */\nTimeStep.prototype.setAutoScale = function (enable) {\n this.autoScale = enable;\n};\n\n\n/**\n * Automatically determine the scale that bests fits the provided minimum step\n * @param {Number} [minimumStep] The minimum step size in milliseconds\n */\nTimeStep.prototype.setMinimumStep = function(minimumStep) {\n if (minimumStep == undefined) {\n return;\n }\n\n //var b = asc + ds;\n\n var stepYear = (1000 * 60 * 60 * 24 * 30 * 12);\n var stepMonth = (1000 * 60 * 60 * 24 * 30);\n var stepDay = (1000 * 60 * 60 * 24);\n var stepHour = (1000 * 60 * 60);\n var stepMinute = (1000 * 60);\n var stepSecond = (1000);\n var stepMillisecond= (1);\n\n // find the smallest step that is larger than the provided minimumStep\n if (stepYear*1000 > minimumStep) {this.scale = 'year'; this.step = 1000;}\n if (stepYear*500 > minimumStep) {this.scale = 'year'; this.step = 500;}\n if (stepYear*100 > minimumStep) {this.scale = 'year'; this.step = 100;}\n if (stepYear*50 > minimumStep) {this.scale = 'year'; this.step = 50;}\n if (stepYear*10 > minimumStep) {this.scale = 'year'; this.step = 10;}\n if (stepYear*5 > minimumStep) {this.scale = 'year'; this.step = 5;}\n if (stepYear > minimumStep) {this.scale = 'year'; this.step = 1;}\n if (stepMonth*3 > minimumStep) {this.scale = 'month'; this.step = 3;}\n if (stepMonth > minimumStep) {this.scale = 'month'; this.step = 1;}\n if (stepDay*5 > minimumStep) {this.scale = 'day'; this.step = 5;}\n if (stepDay*2 > minimumStep) {this.scale = 'day'; this.step = 2;}\n if (stepDay > minimumStep) {this.scale = 'day'; this.step = 1;}\n if (stepDay/2 > minimumStep) {this.scale = 'weekday'; this.step = 1;}\n if (stepHour*4 > minimumStep) {this.scale = 'hour'; this.step = 4;}\n if (stepHour > minimumStep) {this.scale = 'hour'; this.step = 1;}\n if (stepMinute*15 > minimumStep) {this.scale = 'minute'; this.step = 15;}\n if (stepMinute*10 > minimumStep) {this.scale = 'minute'; this.step = 10;}\n if (stepMinute*5 > minimumStep) {this.scale = 'minute'; this.step = 5;}\n if (stepMinute > minimumStep) {this.scale = 'minute'; this.step = 1;}\n if (stepSecond*15 > minimumStep) {this.scale = 'second'; this.step = 15;}\n if (stepSecond*10 > minimumStep) {this.scale = 'second'; this.step = 10;}\n if (stepSecond*5 > minimumStep) {this.scale = 'second'; this.step = 5;}\n if (stepSecond > minimumStep) {this.scale = 'second'; this.step = 1;}\n if (stepMillisecond*200 > minimumStep) {this.scale = 'millisecond'; this.step = 200;}\n if (stepMillisecond*100 > minimumStep) {this.scale = 'millisecond'; this.step = 100;}\n if (stepMillisecond*50 > minimumStep) {this.scale = 'millisecond'; this.step = 50;}\n if (stepMillisecond*10 > minimumStep) {this.scale = 'millisecond'; this.step = 10;}\n if (stepMillisecond*5 > minimumStep) {this.scale = 'millisecond'; this.step = 5;}\n if (stepMillisecond > minimumStep) {this.scale = 'millisecond'; this.step = 1;}\n};\n\n/**\n * Snap a date to a rounded value.\n * The snap intervals are dependent on the current scale and step.\n * Static function\n * @param {Date} date the date to be snapped.\n * @param {string} scale Current scale, can be 'millisecond', 'second',\n * 'minute', 'hour', 'weekday, 'day', 'month', 'year'.\n * @param {number} step Current step (1, 2, 4, 5, ...\n * @return {Date} snappedDate\n */\nTimeStep.snap = function(date, scale, step) {\n var clone = moment(date);\n\n if (scale == 'year') {\n var year = clone.year() + Math.round(clone.month() / 12);\n clone.year(Math.round(year / step) * step);\n clone.month(0);\n clone.date(0);\n clone.hours(0);\n clone.minutes(0);\n clone.seconds(0);\n clone.milliseconds(0);\n }\n else if (scale == 'month') {\n if (clone.date() > 15) {\n clone.date(1);\n clone.add(1, 'month');\n // important: first set Date to 1, after that change the month.\n }\n else {\n clone.date(1);\n }\n\n clone.hours(0);\n clone.minutes(0);\n clone.seconds(0);\n clone.milliseconds(0);\n }\n else if (scale == 'day') {\n //noinspection FallthroughInSwitchStatementJS\n switch (step) {\n case 5:\n case 2:\n clone.hours(Math.round(clone.hours() / 24) * 24); break;\n default:\n clone.hours(Math.round(clone.hours() / 12) * 12); break;\n }\n clone.minutes(0);\n clone.seconds(0);\n clone.milliseconds(0);\n }\n else if (scale == 'weekday') {\n //noinspection FallthroughInSwitchStatementJS\n switch (step) {\n case 5:\n case 2:\n clone.hours(Math.round(clone.hours() / 12) * 12); break;\n default:\n clone.hours(Math.round(clone.hours() / 6) * 6); break;\n }\n clone.minutes(0);\n clone.seconds(0);\n clone.milliseconds(0);\n }\n else if (scale == 'hour') {\n switch (step) {\n case 4:\n clone.minutes(Math.round(clone.minutes() / 60) * 60); break;\n default:\n clone.minutes(Math.round(clone.minutes() / 30) * 30); break;\n }\n clone.seconds(0);\n clone.milliseconds(0);\n } else if (scale == 'minute') {\n //noinspection FallthroughInSwitchStatementJS\n switch (step) {\n case 15:\n case 10:\n clone.minutes(Math.round(clone.minutes() / 5) * 5);\n clone.seconds(0);\n break;\n case 5:\n clone.seconds(Math.round(clone.seconds() / 60) * 60); break;\n default:\n clone.seconds(Math.round(clone.seconds() / 30) * 30); break;\n }\n clone.milliseconds(0);\n }\n else if (scale == 'second') {\n //noinspection FallthroughInSwitchStatementJS\n switch (step) {\n case 15:\n case 10:\n clone.seconds(Math.round(clone.seconds() / 5) * 5);\n clone.milliseconds(0);\n break;\n case 5:\n clone.milliseconds(Math.round(clone.milliseconds() / 1000) * 1000); break;\n default:\n clone.milliseconds(Math.round(clone.milliseconds() / 500) * 500); break;\n }\n }\n else if (scale == 'millisecond') {\n var _step = step > 5 ? step / 2 : 1;\n clone.milliseconds(Math.round(clone.milliseconds() / _step) * _step);\n }\n\n return clone;\n};\n\n/**\n * Check if the current value is a major value (for example when the step\n * is DAY, a major value is each first day of the MONTH)\n * @return {boolean} true if current date is major, else false.\n */\nTimeStep.prototype.isMajor = function() {\n if (this.switchedYear == true) {\n switch (this.scale) {\n case 'year':\n case 'month':\n case 'weekday':\n case 'day':\n case 'hour':\n case 'minute':\n case 'second':\n case 'millisecond':\n return true;\n default:\n return false;\n }\n }\n else if (this.switchedMonth == true) {\n switch (this.scale) {\n case 'weekday':\n case 'day':\n case 'hour':\n case 'minute':\n case 'second':\n case 'millisecond':\n return true;\n default:\n return false;\n }\n }\n else if (this.switchedDay == true) {\n switch (this.scale) {\n case 'millisecond':\n case 'second':\n case 'minute':\n case 'hour':\n return true;\n default:\n return false;\n }\n }\n\n var date = this.moment(this.current);\n switch (this.scale) {\n case 'millisecond':\n return (date.milliseconds() == 0);\n case 'second':\n return (date.seconds() == 0);\n case 'minute':\n return (date.hours() == 0) && (date.minutes() == 0);\n case 'hour':\n return (date.hours() == 0);\n case 'weekday': // intentional fall through\n case 'day':\n return (date.date() == 1);\n case 'month':\n return (date.month() == 0);\n case 'year':\n return false;\n default:\n return false;\n }\n};\n\n\n/**\n * Returns formatted text for the minor axislabel, depending on the current\n * date and the scale. For example when scale is MINUTE, the current time is\n * formatted as \"hh:mm\".\n * @param {Date} [date] custom date. if not provided, current date is taken\n */\nTimeStep.prototype.getLabelMinor = function(date) {\n if (date == undefined) {\n date = this.current;\n }\n\n if (typeof(this.format.minorLabels) === \"function\") {\n return this.format.minorLabels(date, this.scale, this.step);\n }\n\n var format = this.format.minorLabels[this.scale];\n return (format && format.length > 0) ? this.moment(date).format(format) : '';\n};\n\n/**\n * Returns formatted text for the major axis label, depending on the current\n * date and the scale. For example when scale is MINUTE, the major scale is\n * hours, and the hour will be formatted as \"hh\".\n * @param {Date} [date] custom date. if not provided, current date is taken\n */\nTimeStep.prototype.getLabelMajor = function(date) {\n if (date == undefined) {\n date = this.current;\n }\n \n if (typeof(this.format.majorLabels) === \"function\") {\n return this.format.majorLabels(date, this.scale, this.step);\n }\n\n var format = this.format.majorLabels[this.scale];\n return (format && format.length > 0) ? this.moment(date).format(format) : '';\n};\n\nTimeStep.prototype.getClassName = function() {\n var _moment = this.moment;\n var m = this.moment(this.current);\n var current = m.locale ? m.locale('en') : m.lang('en'); // old versions of moment have .lang() function\n var step = this.step;\n\n function even(value) {\n return (value / step % 2 == 0) ? ' vis-even' : ' vis-odd';\n }\n\n function today(date) {\n if (date.isSame(new Date(), 'day')) {\n return ' vis-today';\n }\n if (date.isSame(_moment().add(1, 'day'), 'day')) {\n return ' vis-tomorrow';\n }\n if (date.isSame(_moment().add(-1, 'day'), 'day')) {\n return ' vis-yesterday';\n }\n return '';\n }\n\n function currentWeek(date) {\n return date.isSame(new Date(), 'week') ? ' vis-current-week' : '';\n }\n\n function currentMonth(date) {\n return date.isSame(new Date(), 'month') ? ' vis-current-month' : '';\n }\n\n function currentYear(date) {\n return date.isSame(new Date(), 'year') ? ' vis-current-year' : '';\n }\n\n switch (this.scale) {\n case 'millisecond':\n return today(current) +\n even(current.milliseconds()).trim();\n\n case 'second':\n return today(current) +\n even(current.seconds()).trim();\n\n case 'minute':\n return today(current) +\n even(current.minutes()).trim();\n\n case 'hour':\n return 'vis-h' + current.hours() + \n (this.step == 4 ? '-h' + (current.hours() + 4) : '') +\n today(current) +\n even(current.hours());\n\n case 'weekday':\n return 'vis-' + current.format('dddd').toLowerCase() +\n today(current) +\n currentWeek(current) +\n even(current.date());\n\n case 'day':\n return 'vis-day' + current.date() +\n ' vis-' + current.format('MMMM').toLowerCase() +\n today(current) +\n currentMonth(current) +\n (this.step <= 2 ? today(current) : '') +\n (this.step <= 2 ? ' vis-' + current.format('dddd').toLowerCase() : '' + even(current.date() - 1));\n\n case 'month':\n return 'vis-' + current.format('MMMM').toLowerCase() +\n currentMonth(current) +\n even(current.month());\n\n case 'year':\n var year = current.year();\n return 'vis-year' + year +\n currentYear(current) +\n even(year);\n\n default:\n return '';\n }\n};\n\nmodule.exports = TimeStep;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/timeline/TimeStep.js","var util = require('../../util');\nvar stack = require('../Stack');\nvar RangeItem = require('./item/RangeItem');\n\n/**\n * @constructor Group\n * @param {Number | String} groupId\n * @param {Object} data\n * @param {ItemSet} itemSet\n */\nfunction Group (groupId, data, itemSet) {\n this.groupId = groupId;\n this.subgroups = {};\n this.subgroupIndex = 0;\n this.subgroupOrderer = data && data.subgroupOrder;\n this.itemSet = itemSet;\n this.isVisible = null;\n \n if (data && data.nestedGroups) {\n this.nestedGroups = data.nestedGroups;\n if (data.showNested == false) {\n this.showNested = false;\n } else {\n this.showNested = true;\n }\n }\n\n this.nestedInGroup = null;\n\n this.dom = {};\n this.props = {\n label: {\n width: 0,\n height: 0\n }\n };\n this.className = null;\n\n this.items = {}; // items filtered by groupId of this group\n this.visibleItems = []; // items currently visible in window\n this.itemsInRange = []; // items currently in range\n this.orderedItems = {\n byStart: [],\n byEnd: []\n };\n this.checkRangedItems = false; // needed to refresh the ranged items if the window is programatically changed with NO overlap.\n var me = this;\n this.itemSet.body.emitter.on(\"checkRangedItems\", function () {\n me.checkRangedItems = true;\n })\n\n this._create();\n\n this.setData(data);\n}\n\n/**\n * Create DOM elements for the group\n * @private\n */\nGroup.prototype._create = function() {\n var label = document.createElement('div');\n if (this.itemSet.options.groupEditable.order) {\n label.className = 'vis-label draggable';\n } else {\n label.className = 'vis-label';\n }\n this.dom.label = label;\n\n var inner = document.createElement('div');\n inner.className = 'vis-inner';\n label.appendChild(inner);\n this.dom.inner = inner;\n\n var foreground = document.createElement('div');\n foreground.className = 'vis-group';\n foreground['timeline-group'] = this;\n this.dom.foreground = foreground;\n\n this.dom.background = document.createElement('div');\n this.dom.background.className = 'vis-group';\n\n this.dom.axis = document.createElement('div');\n this.dom.axis.className = 'vis-group';\n\n // create a hidden marker to detect when the Timelines container is attached\n // to the DOM, or the style of a parent of the Timeline is changed from\n // display:none is changed to visible.\n this.dom.marker = document.createElement('div');\n this.dom.marker.style.visibility = 'hidden';\n this.dom.marker.style.position = 'absolute';\n this.dom.marker.innerHTML = '';\n this.dom.background.appendChild(this.dom.marker);\n};\n\n/**\n * Set the group data for this group\n * @param {Object} data Group data, can contain properties content and className\n */\nGroup.prototype.setData = function(data) {\n // update contents\n var content;\n var templateFunction;\n\n if (this.itemSet.options && this.itemSet.options.groupTemplate) {\n templateFunction = this.itemSet.options.groupTemplate.bind(this);\n content = templateFunction(data, this.dom.inner);\n } else {\n content = data && data.content;\n }\n\n if (content instanceof Element) {\n this.dom.inner.appendChild(content);\n while (this.dom.inner.firstChild) {\n this.dom.inner.removeChild(this.dom.inner.firstChild);\n }\n this.dom.inner.appendChild(content);\n } else if (content instanceof Object) {\n templateFunction(data, this.dom.inner);\n } else if (content !== undefined && content !== null) {\n this.dom.inner.innerHTML = content;\n } else {\n this.dom.inner.innerHTML = this.groupId || ''; // groupId can be null\n }\n\n // update title\n this.dom.label.title = data && data.title || '';\n if (!this.dom.inner.firstChild) {\n util.addClassName(this.dom.inner, 'vis-hidden');\n }\n else {\n util.removeClassName(this.dom.inner, 'vis-hidden');\n }\n\n if (data && data.nestedGroups) {\n if (data.showNested == false) {\n this.showNested = false;\n } else {\n this.showNested = true;\n }\n\n util.addClassName(this.dom.label, 'vis-nesting-group');\n if (this.showNested) {\n util.removeClassName(this.dom.label, 'collapsed');\n util.addClassName(this.dom.label, 'expanded');\n } else {\n util.removeClassName(this.dom.label, 'expanded');\n var collapsedDirClassName = this.itemSet.options.rtl ? 'collapsed-rtl' : 'collapsed'\n util.addClassName(this.dom.label, collapsedDirClassName);\n }\n }\n\n if (data && data.nestedInGroup) {\n util.addClassName(this.dom.label, 'vis-nested-group');\n if (this.itemSet.options && this.itemSet.options.rtl) {\n this.dom.inner.style.paddingRight = '30px';\n } else {\n this.dom.inner.style.paddingLeft = '30px';\n }\n }\n\n // update className\n var className = data && data.className || null;\n if (className != this.className) {\n if (this.className) {\n util.removeClassName(this.dom.label, this.className);\n util.removeClassName(this.dom.foreground, this.className);\n util.removeClassName(this.dom.background, this.className);\n util.removeClassName(this.dom.axis, this.className);\n }\n util.addClassName(this.dom.label, className);\n util.addClassName(this.dom.foreground, className);\n util.addClassName(this.dom.background, className);\n util.addClassName(this.dom.axis, className);\n this.className = className;\n }\n\n // update style\n if (this.style) {\n util.removeCssText(this.dom.label, this.style);\n this.style = null;\n }\n if (data && data.style) {\n util.addCssText(this.dom.label, data.style);\n this.style = data.style;\n }\n};\n\n/**\n * Get the width of the group label\n * @return {number} width\n */\nGroup.prototype.getLabelWidth = function() {\n return this.props.label.width;\n};\n\n\n/**\n * Repaint this group\n * @param {{start: number, end: number}} range\n * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin\n * @param {boolean} [restack=false] Force restacking of all items\n * @return {boolean} Returns true if the group is resized\n */\nGroup.prototype.redraw = function(range, margin, restack) {\n var resized = false;\n\n // force recalculation of the height of the items when the marker height changed\n // (due to the Timeline being attached to the DOM or changed from display:none to visible)\n var markerHeight = this.dom.marker.clientHeight;\n if (markerHeight != this.lastMarkerHeight) {\n this.lastMarkerHeight = markerHeight;\n util.forEach(this.items, function (item) {\n item.dirty = true;\n if (item.displayed) item.redraw();\n });\n\n restack = true;\n }\n\n // recalculate the height of the subgroups\n this._calculateSubGroupHeights(margin);\n\n // calculate actual size and position\n var foreground = this.dom.foreground;\n this.top = foreground.offsetTop;\n this.right = foreground.offsetLeft;\n this.width = foreground.offsetWidth;\n\n this.isVisible = this._isGroupVisible(range, margin);\n // reposition visible items vertically\n if (typeof this.itemSet.options.order === 'function') {\n // a custom order function\n\n if (restack) {\n // brute force restack of all items\n\n // show all items\n var me = this;\n var limitSize = false;\n util.forEach(this.items, function (item) {\n if (!item.displayed) {\n item.redraw();\n me.visibleItems.push(item);\n }\n item.repositionX(limitSize);\n });\n\n // order all items and force a restacking\n var customOrderedItems = this.orderedItems.byStart.slice().sort(function (a, b) {\n return me.itemSet.options.order(a.data, b.data);\n });\n stack.stack(customOrderedItems, margin, true /* restack=true */);\n }\n\n this.visibleItems = this._updateItemsInRange(this.orderedItems, this.visibleItems, range);\n }\n else {\n // no custom order function, lazy stacking\n\n this.visibleItems = this._updateItemsInRange(this.orderedItems, this.visibleItems, range);\n\n if (this.itemSet.options.stack) { // TODO: ugly way to access options...\n stack.stack(this.visibleItems, margin, restack);\n }\n else { // no stacking\n stack.nostack(this.visibleItems, margin, this.subgroups, this.itemSet.options.stackSubgroups);\n }\n }\n\t\n this._updateSubgroupsSizes();\n\n // recalculate the height of the group\n var height = this._calculateHeight(margin);\n\n // calculate actual size and position\n var foreground = this.dom.foreground;\n this.top = foreground.offsetTop;\n this.right = foreground.offsetLeft;\n this.width = foreground.offsetWidth;\n resized = util.updateProperty(this, 'height', height) || resized;\n // recalculate size of label\n resized = util.updateProperty(this.props.label, 'width', this.dom.inner.clientWidth) || resized;\n resized = util.updateProperty(this.props.label, 'height', this.dom.inner.clientHeight) || resized;\n\n // apply new height\n this.dom.background.style.height = height + 'px';\n this.dom.foreground.style.height = height + 'px';\n this.dom.label.style.height = height + 'px';\n\n // update vertical position of items after they are re-stacked and the height of the group is calculated\n for (var i = 0, ii = this.visibleItems.length; i < ii; i++) {\n var item = this.visibleItems[i];\n item.repositionY(margin);\n if (!this.isVisible && this.groupId != \"__background__\") {\n if (item.displayed) item.hide();\n }\n }\n\n if (!this.isVisible && this.height) {\n return resized = false;\n }\n\n return resized;\n};\n\n/**\n * recalculate the height of the subgroups\n * @private\n */\nGroup.prototype._calculateSubGroupHeights = function (margin) {\n if (Object.keys(this.subgroups).length > 0) {\n var me = this;\n\n this.resetSubgroups();\n\n util.forEach(this.visibleItems, function (item) {\n if (item.data.subgroup !== undefined) {\n me.subgroups[item.data.subgroup].height = Math.max(me.subgroups[item.data.subgroup].height, item.height + margin.item.vertical);\n me.subgroups[item.data.subgroup].visible = true;\n }\n });\n }\n};\n\n/**\n * check if group is visible\n * @private\n */\nGroup.prototype._isGroupVisible = function (range, margin) {\n var isVisible = \n (this.top <= range.body.domProps.centerContainer.height - range.body.domProps.scrollTop + margin.axis) \n && (this.top + this.height + margin.axis >= - range.body.domProps.scrollTop);\n return isVisible;\n}\n\n/**\n * recalculate the height of the group\n * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin\n * @returns {number} Returns the height\n * @private\n */\nGroup.prototype._calculateHeight = function (margin) {\n // recalculate the height of the group\n var height;\n var itemsInRange = this.visibleItems;\n if (itemsInRange.length > 0) {\n var min = itemsInRange[0].top;\n var max = itemsInRange[0].top + itemsInRange[0].height;\n util.forEach(itemsInRange, function (item) {\n min = Math.min(min, item.top);\n max = Math.max(max, (item.top + item.height));\n });\n if (min > margin.axis) {\n // there is an empty gap between the lowest item and the axis\n var offset = min - margin.axis;\n max -= offset;\n util.forEach(itemsInRange, function (item) {\n item.top -= offset;\n });\n }\n height = max + margin.item.vertical / 2;\n }\n else {\n height = 0;\n }\n height = Math.max(height, this.props.label.height);\n\n return height;\n};\n\n/**\n * Show this group: attach to the DOM\n */\nGroup.prototype.show = function() {\n if (!this.dom.label.parentNode) {\n this.itemSet.dom.labelSet.appendChild(this.dom.label);\n }\n\n if (!this.dom.foreground.parentNode) {\n this.itemSet.dom.foreground.appendChild(this.dom.foreground);\n }\n\n if (!this.dom.background.parentNode) {\n this.itemSet.dom.background.appendChild(this.dom.background);\n }\n\n if (!this.dom.axis.parentNode) {\n this.itemSet.dom.axis.appendChild(this.dom.axis);\n }\n};\n\n/**\n * Hide this group: remove from the DOM\n */\nGroup.prototype.hide = function() {\n var label = this.dom.label;\n if (label.parentNode) {\n label.parentNode.removeChild(label);\n }\n\n var foreground = this.dom.foreground;\n if (foreground.parentNode) {\n foreground.parentNode.removeChild(foreground);\n }\n\n var background = this.dom.background;\n if (background.parentNode) {\n background.parentNode.removeChild(background);\n }\n\n var axis = this.dom.axis;\n if (axis.parentNode) {\n axis.parentNode.removeChild(axis);\n }\n};\n\n/**\n * Add an item to the group\n * @param {Item} item\n */\nGroup.prototype.add = function(item) {\n this.items[item.id] = item;\n item.setParent(this);\n\n // add to\n if (item.data.subgroup !== undefined) {\n if (this.subgroups[item.data.subgroup] === undefined) {\n this.subgroups[item.data.subgroup] = {\n height:0, \n top: 0,\n start: item.data.start,\n end: item.data.end,\n visible: false, \n index:this.subgroupIndex, \n items: []\n };\n this.subgroupIndex++;\n }\n\n\n if (new Date(item.data.start) < new Date(this.subgroups[item.data.subgroup].start)) { \n this.subgroups[item.data.subgroup].start = item.data.start; \n }\n if (new Date(item.data.end) > new Date(this.subgroups[item.data.subgroup].end)) { \n this.subgroups[item.data.subgroup].end = item.data.end; \n }\n\n this.subgroups[item.data.subgroup].items.push(item);\n }\n this.orderSubgroups();\n\n if (this.visibleItems.indexOf(item) == -1) {\n var range = this.itemSet.body.range; // TODO: not nice accessing the range like this\n this._checkIfVisible(item, this.visibleItems, range);\n }\n};\n\nGroup.prototype._updateSubgroupsSizes = function () {\n var me = this;\n if (me.subgroups) {\n for (var subgroup in me.subgroups) {\n var newStart = me.subgroups[subgroup].items[0].data.start;\n var newEnd = me.subgroups[subgroup].items[0].data.end;\n\n me.subgroups[subgroup].items.forEach(function(item) {\n if (new Date(item.data.start) < new Date(newStart)) { \n newStart = item.data.start; \n }\n if (new Date(item.data.end) > new Date(newEnd)) { \n newEnd = item.data.end; \n }\n })\n\n me.subgroups[subgroup].start = newStart;\n me.subgroups[subgroup].end = newEnd;\n\n }\n }\n}\n\nGroup.prototype.orderSubgroups = function() {\n if (this.subgroupOrderer !== undefined) {\n var sortArray = [];\n if (typeof this.subgroupOrderer == 'string') {\n for (var subgroup in this.subgroups) {\n sortArray.push({subgroup: subgroup, sortField: this.subgroups[subgroup].items[0].data[this.subgroupOrderer]})\n }\n sortArray.sort(function (a, b) {\n return a.sortField - b.sortField;\n })\n }\n else if (typeof this.subgroupOrderer == 'function') {\n for (var subgroup in this.subgroups) {\n sortArray.push(this.subgroups[subgroup].items[0].data);\n }\n sortArray.sort(this.subgroupOrderer);\n }\n\n if (sortArray.length > 0) {\n for (var i = 0; i < sortArray.length; i++) {\n this.subgroups[sortArray[i].subgroup].index = i;\n }\n }\n }\n};\n\nGroup.prototype.resetSubgroups = function() {\n for (var subgroup in this.subgroups) {\n if (this.subgroups.hasOwnProperty(subgroup)) {\n this.subgroups[subgroup].visible = false;\n }\n }\n};\n\n/**\n * Remove an item from the group\n * @param {Item} item\n */\nGroup.prototype.remove = function(item) {\n delete this.items[item.id];\n item.setParent(null);\n\n // remove from visible items\n var index = this.visibleItems.indexOf(item);\n if (index != -1) this.visibleItems.splice(index, 1);\n\n if(item.data.subgroup !== undefined){\n var subgroup = this.subgroups[item.data.subgroup];\n if (subgroup){\n var itemIndex = subgroup.items.indexOf(item);\n subgroup.items.splice(itemIndex,1);\n if (!subgroup.items.length){\n delete this.subgroups[item.data.subgroup];\n this.subgroupIndex--;\n } else {\n this._updateSubgroupsSizes();\n }\n this.orderSubgroups();\n }\n }\n};\n\n\n/**\n * Remove an item from the corresponding DataSet\n * @param {Item} item\n */\nGroup.prototype.removeFromDataSet = function(item) {\n this.itemSet.removeItem(item.id);\n};\n\n\n/**\n * Reorder the items\n */\nGroup.prototype.order = function() {\n var array = util.toArray(this.items);\n var startArray = [];\n var endArray = [];\n\n for (var i = 0; i < array.length; i++) {\n if (array[i].data.end !== undefined) {\n endArray.push(array[i]);\n }\n startArray.push(array[i]);\n }\n this.orderedItems = {\n byStart: startArray,\n byEnd: endArray\n };\n\n stack.orderByStart(this.orderedItems.byStart);\n stack.orderByEnd(this.orderedItems.byEnd);\n};\n\n\n/**\n * Update the visible items\n * @param {{byStart: Item[], byEnd: Item[]}} orderedItems All items ordered by start date and by end date\n * @param {Item[]} visibleItems The previously visible items.\n * @param {{start: number, end: number}} range Visible range\n * @return {Item[]} visibleItems The new visible items.\n * @private\n */\nGroup.prototype._updateItemsInRange = function(orderedItems, oldVisibleItems, range) {\n var visibleItems = [];\n var visibleItemsLookup = {}; // we keep this to quickly look up if an item already exists in the list without using indexOf on visibleItems\n\n var interval = (range.end - range.start) / 4;\n var lowerBound = range.start - interval;\n var upperBound = range.end + interval;\n\n // this function is used to do the binary search.\n var searchFunction = function (value) {\n if (value < lowerBound) {return -1;}\n else if (value <= upperBound) {return 0;}\n else {return 1;}\n }\n\n // first check if the items that were in view previously are still in view.\n // IMPORTANT: this handles the case for the items with startdate before the window and enddate after the window!\n // also cleans up invisible items.\n if (oldVisibleItems.length > 0) {\n for (var i = 0; i < oldVisibleItems.length; i++) {\n this._checkIfVisibleWithReference(oldVisibleItems[i], visibleItems, visibleItemsLookup, range);\n }\n }\n\n // we do a binary search for the items that have only start values.\n var initialPosByStart = util.binarySearchCustom(orderedItems.byStart, searchFunction, 'data','start');\n\n // trace the visible items from the inital start pos both ways until an invisible item is found, we only look at the start values.\n this._traceVisible(initialPosByStart, orderedItems.byStart, visibleItems, visibleItemsLookup, function (item) {\n return (item.data.start < lowerBound || item.data.start > upperBound);\n });\n\n // if the window has changed programmatically without overlapping the old window, the ranged items with start < lowerBound and end > upperbound are not shown.\n // We therefore have to brute force check all items in the byEnd list\n if (this.checkRangedItems == true) {\n this.checkRangedItems = false;\n for (i = 0; i < orderedItems.byEnd.length; i++) {\n this._checkIfVisibleWithReference(orderedItems.byEnd[i], visibleItems, visibleItemsLookup, range);\n }\n }\n else {\n // we do a binary search for the items that have defined end times.\n var initialPosByEnd = util.binarySearchCustom(orderedItems.byEnd, searchFunction, 'data','end');\n\n // trace the visible items from the inital start pos both ways until an invisible item is found, we only look at the end values.\n this._traceVisible(initialPosByEnd, orderedItems.byEnd, visibleItems, visibleItemsLookup, function (item) {\n return (item.data.end < lowerBound || item.data.end > upperBound);\n });\n }\n\n // finally, we reposition all the visible items.\n for (var i = 0; i < visibleItems.length; i++) {\n var item = visibleItems[i];\n if (!item.displayed) item.show();\n // reposition item horizontally\n item.repositionX();\n }\n \n return visibleItems;\n};\n\nGroup.prototype._traceVisible = function (initialPos, items, visibleItems, visibleItemsLookup, breakCondition) {\n if (initialPos != -1) {\n for (var i = initialPos; i >= 0; i--) {\n var item = items[i];\n if (breakCondition(item)) {\n break;\n }\n else {\n if (visibleItemsLookup[item.id] === undefined) {\n visibleItemsLookup[item.id] = true;\n visibleItems.push(item);\n }\n }\n }\n\n for (var i = initialPos + 1; i < items.length; i++) {\n var item = items[i];\n if (breakCondition(item)) {\n break;\n }\n else {\n if (visibleItemsLookup[item.id] === undefined) {\n visibleItemsLookup[item.id] = true;\n visibleItems.push(item);\n }\n }\n }\n }\n}\n\n\n/**\n * this function is very similar to the _checkIfInvisible() but it does not\n * return booleans, hides the item if it should not be seen and always adds to\n * the visibleItems.\n * this one is for brute forcing and hiding.\n *\n * @param {Item} item\n * @param {Array} visibleItems\n * @param {{start:number, end:number}} range\n * @private\n */\nGroup.prototype._checkIfVisible = function(item, visibleItems, range) {\n if (item.isVisible(range)) {\n if (!item.displayed) item.show();\n // reposition item horizontally\n item.repositionX();\n visibleItems.push(item);\n }\n else {\n if (item.displayed) item.hide();\n }\n};\n\n\n/**\n * this function is very similar to the _checkIfInvisible() but it does not\n * return booleans, hides the item if it should not be seen and always adds to\n * the visibleItems.\n * this one is for brute forcing and hiding.\n *\n * @param {Item} item\n * @param {Array} visibleItems\n * @param {{start:number, end:number}} range\n * @private\n */\nGroup.prototype._checkIfVisibleWithReference = function(item, visibleItems, visibleItemsLookup, range) {\n if (item.isVisible(range)) {\n if (visibleItemsLookup[item.id] === undefined) {\n visibleItemsLookup[item.id] = true;\n visibleItems.push(item);\n }\n }\n else {\n if (item.displayed) item.hide();\n }\n};\n\n\n\nmodule.exports = Group;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/timeline/component/Group.js","// Utility functions for ordering and stacking of items\nvar EPSILON = 0.001; // used when checking collisions, to prevent round-off errors\n\n/**\n * Order items by their start data\n * @param {Item[]} items\n */\nexports.orderByStart = function(items) {\n items.sort(function (a, b) {\n return a.data.start - b.data.start;\n });\n};\n\n/**\n * Order items by their end date. If they have no end date, their start date\n * is used.\n * @param {Item[]} items\n */\nexports.orderByEnd = function(items) {\n items.sort(function (a, b) {\n var aTime = ('end' in a.data) ? a.data.end : a.data.start,\n bTime = ('end' in b.data) ? b.data.end : b.data.start;\n\n return aTime - bTime;\n });\n};\n\n/**\n * Adjust vertical positions of the items such that they don't overlap each\n * other.\n * @param {Item[]} items\n * All visible items\n * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin\n * Margins between items and between items and the axis.\n * @param {boolean} [force=false]\n * If true, all items will be repositioned. If false (default), only\n * items having a top===null will be re-stacked\n */\nexports.stack = function(items, margin, force) {\n if (force) {\n // reset top position of all items\n for (var i = 0; i < items.length; i++) {\n items[i].top = null;\n }\n }\n\n // calculate new, non-overlapping positions\n for (var i = 0; i < items.length; i++) {\n var item = items[i];\n if (item.stack && item.top === null) {\n // initialize top position\n item.top = margin.axis;\n\n do {\n // TODO: optimize checking for overlap. when there is a gap without items,\n // you only need to check for items from the next item on, not from zero\n var collidingItem = null;\n for (var j = 0, jj = items.length; j < jj; j++) {\n var other = items[j];\n if (other.top !== null && other !== item && other.stack && exports.collision(item, other, margin.item, other.options.rtl)) {\n collidingItem = other;\n break;\n }\n }\n\n if (collidingItem != null) {\n // There is a collision. Reposition the items above the colliding element\n item.top = collidingItem.top + collidingItem.height + margin.item.vertical;\n }\n } while (collidingItem);\n }\n }\n};\n\n\n/**\n * Adjust vertical positions of the items without stacking them\n * @param {Item[]} items\n * All visible items\n * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin\n * Margins between items and between items and the axis.\n* @param {subgroups[]} subgroups\n * All subgroups\n */\n exports.nostack = function(items, margin, subgroups, stackSubgroups) {\n for (var i = 0; i < items.length; i++) {\n if (items[i].data.subgroup == undefined) {\n items[i].top = margin.item.vertical;\n } else if (items[i].data.subgroup !== undefined && stackSubgroups) {\n var newTop = 0;\n for (var subgroup in subgroups) {\n if (subgroups.hasOwnProperty(subgroup)) {\n if (subgroups[subgroup].visible == true && subgroups[subgroup].index < subgroups[items[i].data.subgroup].index) {\n newTop += subgroups[subgroup].height;\n subgroups[items[i].data.subgroup].top = newTop;\n }\n }\n }\n items[i].top = newTop + 0.5 * margin.item.vertical;\n }\n }\n if (!stackSubgroups) {\n exports.stackSubgroups(items, margin, subgroups)\n }\n};\n\n/**\n * Adjust vertical positions of the subgroups such that they don't overlap each\n * other.\n * @param {subgroups[]} subgroups\n * All subgroups\n * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin\n * Margins between items and between items and the axis.\n */\nexports.stackSubgroups = function(items, margin, subgroups) {\n for (var subgroup in subgroups) {\n if (subgroups.hasOwnProperty(subgroup)) {\n\n\n subgroups[subgroup].top = 0;\n do {\n // TODO: optimize checking for overlap. when there is a gap without items,\n // you only need to check for items from the next item on, not from zero\n var collidingItem = null;\n for (var otherSubgroup in subgroups) {\n if (subgroups[otherSubgroup].top !== null && otherSubgroup !== subgroup && subgroups[subgroup].index > subgroups[otherSubgroup].index && exports.collisionByTimes(subgroups[subgroup], subgroups[otherSubgroup])) {\n collidingItem = subgroups[otherSubgroup];\n break;\n }\n }\n\n if (collidingItem != null) {\n // There is a collision. Reposition the subgroups above the colliding element\n subgroups[subgroup].top = collidingItem.top + collidingItem.height;\n }\n } while (collidingItem);\n }\n }\n for (var i = 0; i < items.length; i++) {\n if (items[i].data.subgroup !== undefined) {\n items[i].top = subgroups[items[i].data.subgroup].top + 0.5 * margin.item.vertical;\n }\n }\n}\n\n/**\n * Test if the two provided items collide\n * The items must have parameters left, width, top, and height.\n * @param {Item} a The first item\n * @param {Item} b The second item\n * @param {{horizontal: number, vertical: number}} margin\n * An object containing a horizontal and vertical\n * minimum required margin.\n * @param {boolean} rtl\n * @return {boolean} true if a and b collide, else false\n */\nexports.collision = function(a, b, margin, rtl) {\n if (rtl) {\n return ((a.right - margin.horizontal + EPSILON) < (b.right + b.width) &&\n (a.right + a.width + margin.horizontal - EPSILON) > b.right &&\n (a.top - margin.vertical + EPSILON) < (b.top + b.height) &&\n (a.top + a.height + margin.vertical - EPSILON) > b.top);\n } else {\n return ((a.left - margin.horizontal + EPSILON) < (b.left + b.width) &&\n (a.left + a.width + margin.horizontal - EPSILON) > b.left &&\n (a.top - margin.vertical + EPSILON) < (b.top + b.height) &&\n (a.top + a.height + margin.vertical - EPSILON) > b.top);\n }\n};\n\n/**\n * Test if the two provided objects collide\n * The objects must have parameters start, end, top, and height.\n * @param {Object} a The first Object\n * @param {Object} b The second Object\n * @return {boolean} true if a and b collide, else false\n */\nexports.collisionByTimes = function(a, b) {\n return (\n (a.start <= b.start && a.end >= b.start && a.top < (b.top + b.height) && (a.top + a.height) > b.top ) ||\n (b.start <= a.start && b.end >= a.start && b.top < (a.top + a.height) && (b.top + b.height) > a.top )\n )\n}\n\n\n// WEBPACK FOOTER //\n// ./lib/timeline/Stack.js","var Hammer = require('../../../module/hammer');\nvar Item = require('./Item');\n\n/**\n * @constructor RangeItem\n * @extends Item\n * @param {Object} data Object containing parameters start, end\n * content, className.\n * @param {{toScreen: function, toTime: function}} conversion\n * Conversion functions from time to screen and vice versa\n * @param {Object} [options] Configuration options\n * // TODO: describe options\n */\nfunction RangeItem (data, conversion, options) {\n this.props = {\n content: {\n width: 0\n }\n };\n this.overflow = false; // if contents can overflow (css styling), this flag is set to true\n this.options = options;\n // validate data\n if (data) {\n if (data.start == undefined) {\n throw new Error('Property \"start\" missing in item ' + data.id);\n }\n if (data.end == undefined) {\n throw new Error('Property \"end\" missing in item ' + data.id);\n }\n }\n\n Item.call(this, data, conversion, options);\n}\n\nRangeItem.prototype = new Item (null, null, null);\n\nRangeItem.prototype.baseClassName = 'vis-item vis-range';\n\n/**\n * Check whether this item is visible inside given range\n * @returns {{start: Number, end: Number}} range with a timestamp for start and end\n * @returns {boolean} True if visible\n */\nRangeItem.prototype.isVisible = function(range) {\n // determine visibility\n return (this.data.start < range.end) && (this.data.end > range.start);\n};\n\n/**\n * Repaint the item\n */\nRangeItem.prototype.redraw = function() {\n var dom = this.dom;\n if (!dom) {\n // create DOM\n this.dom = {};\n dom = this.dom;\n\n // background box\n dom.box = document.createElement('div');\n // className is updated in redraw()\n\n // frame box (to prevent the item contents from overflowing)\n dom.frame = document.createElement('div');\n dom.frame.className = 'vis-item-overflow';\n dom.box.appendChild(dom.frame);\n \n // visible frame box (showing the frame that is always visible)\n dom.visibleFrame = document.createElement('div');\n dom.visibleFrame.className = 'vis-item-visible-frame';\n dom.box.appendChild(dom.visibleFrame);\n\n // contents box\n dom.content = document.createElement('div');\n dom.content.className = 'vis-item-content';\n dom.frame.appendChild(dom.content);\n\n // attach this item as attribute\n dom.box['timeline-item'] = this;\n\n this.dirty = true;\n }\n\n // append DOM to parent DOM\n if (!this.parent) {\n throw new Error('Cannot redraw item: no parent attached');\n }\n if (!dom.box.parentNode) {\n var foreground = this.parent.dom.foreground;\n if (!foreground) {\n throw new Error('Cannot redraw item: parent has no foreground container element');\n }\n foreground.appendChild(dom.box);\n }\n this.displayed = true;\n\n // Update DOM when item is marked dirty. An item is marked dirty when:\n // - the item is not yet rendered\n // - the item's data is changed\n // - the item is selected/deselected\n if (this.dirty) {\n this._updateContents(this.dom.content);\n this._updateTitle();\n this._updateDataAttributes(this.dom.box);\n this._updateStyle(this.dom.box);\n\n var editable = (this.options.editable.updateTime || \n this.options.editable.updateGroup ||\n this.editable === true) &&\n this.editable !== false;\n\n // update class\n var className = (this.data.className ? (' ' + this.data.className) : '') +\n (this.selected ? ' vis-selected' : '') + \n (editable ? ' vis-editable' : ' vis-readonly');\n dom.box.className = this.baseClassName + className;\n\n // determine from css whether this box has overflow\n this.overflow = window.getComputedStyle(dom.frame).overflow !== 'hidden';\n\n // recalculate size\n // turn off max-width to be able to calculate the real width\n // this causes an extra browser repaint/reflow, but so be it\n this.dom.content.style.maxWidth = 'none';\n this.props.content.width = this.dom.content.offsetWidth;\n this.height = this.dom.box.offsetHeight;\n this.dom.content.style.maxWidth = '';\n\n this.dirty = false;\n }\n\n this._repaintOnItemUpdateTimeTooltip(dom.box);\n this._repaintDeleteButton(dom.box);\n this._repaintDragCenter();\n this._repaintDragLeft();\n this._repaintDragRight();\n};\n\n/**\n * Show the item in the DOM (when not already visible). The items DOM will\n * be created when needed.\n */\nRangeItem.prototype.show = function() {\n if (!this.displayed) {\n this.redraw();\n }\n};\n\n/**\n * Hide the item from the DOM (when visible)\n * @return {Boolean} changed\n */\nRangeItem.prototype.hide = function() {\n if (this.displayed) {\n var box = this.dom.box;\n\n if (box.parentNode) {\n box.parentNode.removeChild(box);\n }\n\n this.displayed = false;\n }\n};\n\n/**\n * Reposition the item horizontally\n * @param {boolean} [limitSize=true] If true (default), the width of the range\n * item will be limited, as the browser cannot\n * display very wide divs. This means though\n * that the applied left and width may\n * not correspond to the ranges start and end\n * @Override\n */\nRangeItem.prototype.repositionX = function(limitSize) {\n var parentWidth = this.parent.width;\n var start = this.conversion.toScreen(this.data.start);\n var end = this.conversion.toScreen(this.data.end);\n var contentStartPosition;\n var contentWidth;\n\n // limit the width of the range, as browsers cannot draw very wide divs\n if (limitSize === undefined || limitSize === true) {\n if (start < -parentWidth) {\n start = -parentWidth;\n }\n if (end > 2 * parentWidth) {\n end = 2 * parentWidth;\n }\n }\n\n // add 0.5 to compensate floating-point values rounding\n var boxWidth = Math.max(end - start + 0.5, 1);\n\n if (this.overflow) {\n if (this.options.rtl) {\n this.right = start;\n } else {\n this.left = start;\n }\n this.width = boxWidth + this.props.content.width;\n contentWidth = this.props.content.width;\n\n // Note: The calculation of width is an optimistic calculation, giving\n // a width which will not change when moving the Timeline\n // So no re-stacking needed, which is nicer for the eye;\n }\n else {\n if (this.options.rtl) {\n this.right = start;\n } else {\n this.left = start;\n }\n this.width = boxWidth;\n contentWidth = Math.min(end - start, this.props.content.width);\n }\n\n if (this.options.rtl) {\n this.dom.box.style.right = this.right + 'px';\n } else {\n this.dom.box.style.left = this.left + 'px'; \n }\n this.dom.box.style.width = boxWidth + 'px';\n\n switch (this.options.align) {\n case 'left':\n if (this.options.rtl) {\n this.dom.content.style.right = '0';\n } else {\n this.dom.content.style.left = '0';\n }\n break;\n\n case 'right':\n if (this.options.rtl) {\n this.dom.content.style.right = Math.max((boxWidth - contentWidth), 0) + 'px';\n } else {\n this.dom.content.style.left = Math.max((boxWidth - contentWidth), 0) + 'px';\n }\n break;\n\n case 'center':\n if (this.options.rtl) {\n this.dom.content.style.right = Math.max((boxWidth - contentWidth) / 2, 0) + 'px';\n } else {\n this.dom.content.style.left = Math.max((boxWidth - contentWidth) / 2, 0) + 'px';\n }\n \n break;\n\n default: // 'auto'\n // when range exceeds left of the window, position the contents at the left of the visible area\n if (this.overflow) {\n if (end > 0) {\n contentStartPosition = Math.max(-start, 0);\n }\n else {\n contentStartPosition = -contentWidth; // ensure it's not visible anymore\n }\n }\n else {\n if (start < 0) {\n contentStartPosition = -start;\n }\n else {\n contentStartPosition = 0;\n }\n }\n if (this.options.rtl) {\n this.dom.content.style.right = contentStartPosition + 'px';\n } else {\n this.dom.content.style.left = contentStartPosition + 'px';\n this.dom.content.style.width = 'calc(100% - ' + contentStartPosition + 'px)';\n }\n }\n};\n\n/**\n * Reposition the item vertically\n * @Override\n */\nRangeItem.prototype.repositionY = function() {\n var orientation = this.options.orientation.item;\n var box = this.dom.box;\n\n if (orientation == 'top') {\n box.style.top = this.top + 'px';\n }\n else {\n box.style.top = (this.parent.height - this.top - this.height) + 'px';\n }\n};\n\n/**\n * Repaint a drag area on the left side of the range when the range is selected\n * @protected\n */\nRangeItem.prototype._repaintDragLeft = function () {\n if (this.selected && this.options.editable.updateTime && !this.dom.dragLeft) {\n // create and show drag area\n var dragLeft = document.createElement('div');\n dragLeft.className = 'vis-drag-left';\n dragLeft.dragLeftItem = this;\n\n this.dom.box.appendChild(dragLeft);\n this.dom.dragLeft = dragLeft;\n }\n else if (!this.selected && this.dom.dragLeft) {\n // delete drag area\n if (this.dom.dragLeft.parentNode) {\n this.dom.dragLeft.parentNode.removeChild(this.dom.dragLeft);\n }\n this.dom.dragLeft = null;\n }\n};\n\n/**\n * Repaint a drag area on the right side of the range when the range is selected\n * @protected\n */\nRangeItem.prototype._repaintDragRight = function () {\n if (this.selected && this.options.editable.updateTime && !this.dom.dragRight) {\n // create and show drag area\n var dragRight = document.createElement('div');\n dragRight.className = 'vis-drag-right';\n dragRight.dragRightItem = this;\n\n this.dom.box.appendChild(dragRight);\n this.dom.dragRight = dragRight;\n }\n else if (!this.selected && this.dom.dragRight) {\n // delete drag area\n if (this.dom.dragRight.parentNode) {\n this.dom.dragRight.parentNode.removeChild(this.dom.dragRight);\n }\n this.dom.dragRight = null;\n }\n};\n\nmodule.exports = RangeItem;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/timeline/component/item/RangeItem.js","var Hammer = require('../../../module/hammer');\nvar util = require('../../../util');\nvar moment = require('../../../module/moment');\n\n\n/**\n * @constructor Item\n * @param {Object} data Object containing (optional) parameters type,\n * start, end, content, group, className.\n * @param {{toScreen: function, toTime: function}} conversion\n * Conversion functions from time to screen and vice versa\n * @param {Object} options Configuration options\n * // TODO: describe available options\n */\nfunction Item (data, conversion, options) {\n this.id = null;\n this.parent = null;\n this.data = data;\n this.dom = null;\n this.conversion = conversion || {};\n this.options = options || {}; \n this.selected = false;\n this.displayed = false;\n this.groupShowing = true;\n this.dirty = true;\n this.popup = null;\n\n this.top = null;\n this.right = null;\n this.left = null;\n this.width = null;\n this.height = null;\n\n this.editable = null;\n if (this.data && this.data.hasOwnProperty('editable')){\n if(typeof this.data.editable === 'boolean') {\n this.editable = {\n updateTime: this.data.editable,\n updateGroup: this.data.editable,\n remove: this.data.editable\n }\n }\n else if(typeof options.editable === 'object') {\n this.editable = {};\n util.selectiveExtend(['updateTime', 'updateGroup', 'remove'], this.editable, data.editable);\n };\n }\n}\n\nItem.prototype.stack = true;\n\n/**\n * Select current item\n */\nItem.prototype.select = function() {\n this.selected = true;\n this.dirty = true;\n if (this.displayed) this.redraw();\n};\n\n/**\n * Unselect current item\n */\nItem.prototype.unselect = function() {\n this.selected = false;\n this.dirty = true;\n if (this.displayed) this.redraw();\n};\n\n/**\n * Set data for the item. Existing data will be updated. The id should not\n * be changed. When the item is displayed, it will be redrawn immediately.\n * @param {Object} data\n */\nItem.prototype.setData = function(data) {\n var groupChanged = data.group != undefined && this.data.group != data.group;\n if (groupChanged) {\n this.parent.itemSet._moveToGroup(this, data.group);\n }\n\n if (data.hasOwnProperty('editable')){\n if (typeof data.editable === 'boolean') {\n this.editable = {\n updateTime: this.data.editable,\n updateGroup: this.data.editable,\n remove: this.data.editable\n }\n }\n else if(typeof options.editable === 'object') {\n this.editable = {};\n util.selectiveExtend(['updateTime', 'updateGroup', 'remove'], this.editable, data.editable);\n }\n }\n\n this.data = data;\n this.dirty = true;\n if (this.displayed) this.redraw();\n};\n\n/**\n * Set a parent for the item\n * @param {ItemSet | Group} parent\n */\nItem.prototype.setParent = function(parent) {\n if (this.displayed) {\n this.hide();\n this.parent = parent;\n if (this.parent) {\n this.show();\n }\n }\n else {\n this.parent = parent;\n }\n};\n\n/**\n * Check whether this item is visible inside given range\n * @returns {{start: Number, end: Number}} range with a timestamp for start and end\n * @returns {boolean} True if visible\n */\nItem.prototype.isVisible = function(range) {\n return false;\n};\n\n/**\n * Show the Item in the DOM (when not already visible)\n * @return {Boolean} changed\n */\nItem.prototype.show = function() {\n return false;\n};\n\n/**\n * Hide the Item from the DOM (when visible)\n * @return {Boolean} changed\n */\nItem.prototype.hide = function() {\n return false;\n};\n\n/**\n * Repaint the item\n */\nItem.prototype.redraw = function() {\n // should be implemented by the item\n};\n\n/**\n * Reposition the Item horizontally\n */\nItem.prototype.repositionX = function() {\n // should be implemented by the item\n};\n\n/**\n * Reposition the Item vertically\n */\nItem.prototype.repositionY = function() {\n // should be implemented by the item\n};\n\n/**\n * Repaint a drag area on the center of the item when the item is selected\n * @protected\n */\nItem.prototype._repaintDragCenter = function () {\n if (this.selected && this.options.editable.updateTime && !this.dom.dragCenter) {\n var me = this;\n\n // create and show drag area\n var dragCenter = document.createElement('div');\n dragCenter.className = 'vis-drag-center';\n dragCenter.dragCenterItem = this;\n\n new Hammer(dragCenter).on('doubletap', function (event) {\n event.stopPropagation();\n me.parent.itemSet._onUpdateItem(me);\n });\n\n if (this.dom.box) {\n this.dom.box.appendChild(dragCenter);\n } \n else if (this.dom.point) {\n this.dom.point.appendChild(dragCenter);\n }\n \n this.dom.dragCenter = dragCenter;\n }\n else if (!this.selected && this.dom.dragCenter) {\n // delete drag area\n if (this.dom.dragCenter.parentNode) {\n this.dom.dragCenter.parentNode.removeChild(this.dom.dragCenter);\n }\n this.dom.dragCenter = null;\n }\n};\n\n/**\n * Repaint a delete button on the top right of the item when the item is selected\n * @param {HTMLElement} anchor\n * @protected\n */\nItem.prototype._repaintDeleteButton = function (anchor) {\n var editable = ((this.options.editable.overrideItems || this.editable == null) && this.options.editable.remove) ||\n (!this.options.editable.overrideItems && this.editable != null && this.editable.remove);\n\n if (this.selected && editable && !this.dom.deleteButton) {\n // create and show button\n var me = this;\n\n var deleteButton = document.createElement('div');\n\n if (this.options.rtl) {\n deleteButton.className = 'vis-delete-rtl';\n } else {\n deleteButton.className = 'vis-delete';\n }\n deleteButton.title = 'Delete this item';\n\n // TODO: be able to destroy the delete button\n new Hammer(deleteButton).on('tap', function (event) {\n event.stopPropagation();\n me.parent.removeFromDataSet(me);\n });\n\n anchor.appendChild(deleteButton);\n this.dom.deleteButton = deleteButton;\n }\n else if (!this.selected && this.dom.deleteButton) {\n // remove button\n if (this.dom.deleteButton.parentNode) {\n this.dom.deleteButton.parentNode.removeChild(this.dom.deleteButton);\n }\n this.dom.deleteButton = null;\n }\n};\n\n/**\n * Repaint a onChange tooltip on the top right of the item when the item is selected\n * @param {HTMLElement} anchor\n * @protected\n */\nItem.prototype._repaintOnItemUpdateTimeTooltip = function (anchor) {\n if (!this.options.tooltipOnItemUpdateTime) return;\n\n var editable = (this.options.editable.updateTime || \n this.data.editable === true) &&\n this.data.editable !== false;\n\n if (this.selected && editable && !this.dom.onItemUpdateTimeTooltip) {\n // create and show tooltip\n var me = this;\n\n var onItemUpdateTimeTooltip = document.createElement('div');\n\n onItemUpdateTimeTooltip.className = 'vis-onUpdateTime-tooltip';\n anchor.appendChild(onItemUpdateTimeTooltip);\n this.dom.onItemUpdateTimeTooltip = onItemUpdateTimeTooltip;\n\n } else if (!this.selected && this.dom.onItemUpdateTimeTooltip) {\n // remove button\n if (this.dom.onItemUpdateTimeTooltip.parentNode) {\n this.dom.onItemUpdateTimeTooltip.parentNode.removeChild(this.dom.onItemUpdateTimeTooltip);\n }\n this.dom.onItemUpdateTimeTooltip = null;\n }\n\n // position onChange tooltip\n if (this.dom.onItemUpdateTimeTooltip) {\n\n // only show when editing\n this.dom.onItemUpdateTimeTooltip.style.visibility = this.parent.itemSet.touchParams.itemIsDragging ? 'visible' : 'hidden';\n \n // position relative to item's content\n if (this.options.rtl) {\n this.dom.onItemUpdateTimeTooltip.style.right = this.dom.content.style.right;\n } else {\n this.dom.onItemUpdateTimeTooltip.style.left = this.dom.content.style.left;\n }\n\n // position above or below the item depending on the item's position in the window\n var tooltipOffset = 50; // TODO: should be tooltip height (depends on template)\n var scrollTop = this.parent.itemSet.body.domProps.scrollTop;\n\n // TODO: this.top for orientation:true is actually the items distance from the bottom... \n // (should be this.bottom)\n var itemDistanceFromTop \n if (this.options.orientation.item == 'top') {\n itemDistanceFromTop = this.top;\n } else {\n itemDistanceFromTop = (this.parent.height - this.top - this.height)\n }\n var isCloseToTop = itemDistanceFromTop + this.parent.top - tooltipOffset < -scrollTop;\n\n if (isCloseToTop) {\n this.dom.onItemUpdateTimeTooltip.style.bottom = \"\";\n this.dom.onItemUpdateTimeTooltip.style.top = this.height + 2 + \"px\";\n } else {\n this.dom.onItemUpdateTimeTooltip.style.top = \"\";\n this.dom.onItemUpdateTimeTooltip.style.bottom = this.height + 2 + \"px\";\n }\n \n // handle tooltip content\n var content;\n var templateFunction;\n\n if (this.options.tooltipOnItemUpdateTime && this.options.tooltipOnItemUpdateTime.template) {\n templateFunction = this.options.tooltipOnItemUpdateTime.template.bind(this);\n content = templateFunction(this.data);\n } else {\n content = 'start: ' + moment(this.data.start).format('MM/DD/YYYY hh:mm');\n if (this.data.end) { \n content += '
end: ' + moment(this.data.end).format('MM/DD/YYYY hh:mm');\n }\n }\n this.dom.onItemUpdateTimeTooltip.innerHTML = content;\n }\n};\n\n\n/**\n * Set HTML contents for the item\n * @param {Element} element HTML element to fill with the contents\n * @private\n */\nItem.prototype._updateContents = function (element) {\n var content;\n var templateFunction;\n var itemVisibleFrameContent;\n var visibleFrameTemplateFunction; \n var itemData = this.parent.itemSet.itemsData.get(this.id); // get a clone of the data from the dataset\n\n var frameElement = this.dom.box || this.dom.point;\n var itemVisibleFrameContentElement = frameElement.getElementsByClassName('vis-item-visible-frame')[0]\n\n if (this.options.visibleFrameTemplate) {\n visibleFrameTemplateFunction = this.options.visibleFrameTemplate.bind(this);\n itemVisibleFrameContent = visibleFrameTemplateFunction(itemData, frameElement);\n } else {\n itemVisibleFrameContent = '';\n }\n \n if (itemVisibleFrameContentElement) {\n if ((itemVisibleFrameContent instanceof Object) && !(itemVisibleFrameContent instanceof Element)) {\n visibleFrameTemplateFunction(itemData, itemVisibleFrameContentElement)\n } else {\n var changed = this._contentToString(this.itemVisibleFrameContent) !== this._contentToString(itemVisibleFrameContent);\n if (changed) {\n // only replace the content when changed\n if (itemVisibleFrameContent instanceof Element) {\n itemVisibleFrameContentElement.innerHTML = '';\n itemVisibleFrameContentElement.appendChild(itemVisibleFrameContent);\n }\n else if (itemVisibleFrameContent != undefined) {\n itemVisibleFrameContentElement.innerHTML = itemVisibleFrameContent;\n }\n else {\n if (!(this.data.type == 'background' && this.data.content === undefined)) {\n throw new Error('Property \"content\" missing in item ' + this.id);\n }\n }\n\n this.itemVisibleFrameContent = itemVisibleFrameContent;\n }\n }\n }\n\n if (this.options.template) {\n templateFunction = this.options.template.bind(this);\n content = templateFunction(itemData, element);\n } else {\n content = this.data.content;\n }\n\n if ((content instanceof Object) && !(content instanceof Element)) {\n templateFunction(itemData, element)\n } else {\n var changed = this._contentToString(this.content) !== this._contentToString(content);\n if (changed) {\n // only replace the content when changed\n if (content instanceof Element) {\n element.innerHTML = '';\n element.appendChild(content);\n }\n else if (content != undefined) {\n element.innerHTML = content;\n }\n else {\n if (!(this.data.type == 'background' && this.data.content === undefined)) {\n throw new Error('Property \"content\" missing in item ' + this.id);\n }\n }\n\n this.content = content;\n }\n }\n};\n\n/**\n * Set HTML contents for the item\n * @private\n */\nItem.prototype._updateTitle = function () {\n if (this.data.title != null) {\n if (this.popup != null) {\n this.popup.setText(this.data.title || '');\n }\n }\n};\n\n/**\n * Process dataAttributes timeline option and set as data- attributes on dom.content\n * @param {Element} element HTML element to which the attributes will be attached\n * @private\n */\n Item.prototype._updateDataAttributes = function(element) {\n if (this.options.dataAttributes && this.options.dataAttributes.length > 0) {\n var attributes = [];\n\n if (Array.isArray(this.options.dataAttributes)) {\n attributes = this.options.dataAttributes;\n }\n else if (this.options.dataAttributes == 'all') {\n attributes = Object.keys(this.data);\n }\n else {\n return;\n }\n\n for (var i = 0; i < attributes.length; i++) {\n var name = attributes[i];\n var value = this.data[name];\n\n if (value != null) {\n element.setAttribute('data-' + name, value);\n }\n else {\n element.removeAttribute('data-' + name);\n }\n }\n }\n};\n\n/**\n * Update custom styles of the element\n * @param element\n * @private\n */\nItem.prototype._updateStyle = function(element) {\n // remove old styles\n if (this.style) {\n util.removeCssText(element, this.style);\n this.style = null;\n }\n\n // append new styles\n if (this.data.style) {\n util.addCssText(element, this.data.style);\n this.style = this.data.style;\n }\n};\n\n\n/**\n * Stringify the items contents\n * @param {string | Element | undefined} content\n * @returns {string | undefined}\n * @private\n */\nItem.prototype._contentToString = function (content) {\n if (typeof content === 'string') return content;\n if (content && 'outerHTML' in content) return content.outerHTML;\n return content;\n};\n\n/**\n * Return the width of the item left from its start date\n * @return {number}\n */\nItem.prototype.getWidthLeft = function () {\n return 0;\n};\n\n/**\n * Return the width of the item right from the max of its start and end date\n * @return {number}\n */\nItem.prototype.getWidthRight = function () {\n return 0;\n};\n\n/**\n * Return the title of the item\n * @return {string | undefined}\n */\nItem.prototype.getTitle = function () {\n return this.data.title;\n};\n\n/**\n * Set the popup object, and update the title\n * @param {Popup} popup\n */\nItem.prototype.setPopup = function (popup) {\n this.popup = popup;\n this._updateTitle();\n};\n\nmodule.exports = Item;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/timeline/component/item/Item.js","var util = require('../../util');\nvar Group = require('./Group');\n\n/**\n * @constructor BackgroundGroup\n * @param {Number | String} groupId\n * @param {Object} data\n * @param {ItemSet} itemSet\n */\nfunction BackgroundGroup (groupId, data, itemSet) {\n Group.call(this, groupId, data, itemSet);\n\n this.width = 0;\n this.height = 0;\n this.top = 0;\n this.left = 0;\n}\n\nBackgroundGroup.prototype = Object.create(Group.prototype);\n\n/**\n * Repaint this group\n * @param {{start: number, end: number}} range\n * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin\n * @param {boolean} [restack=false] Force restacking of all items\n * @return {boolean} Returns true if the group is resized\n */\nBackgroundGroup.prototype.redraw = function(range, margin, restack) {\n var resized = false;\n\n this.visibleItems = this._updateItemsInRange(this.orderedItems, this.visibleItems, range);\n\n // calculate actual size\n this.width = this.dom.background.offsetWidth;\n\n // apply new height (just always zero for BackgroundGroup\n this.dom.background.style.height = '0';\n\n // update vertical position of items after they are re-stacked and the height of the group is calculated\n for (var i = 0, ii = this.visibleItems.length; i < ii; i++) {\n var item = this.visibleItems[i];\n item.repositionY(margin);\n }\n\n return resized;\n};\n\n/**\n * Show this group: attach to the DOM\n */\nBackgroundGroup.prototype.show = function() {\n if (!this.dom.background.parentNode) {\n this.itemSet.dom.background.appendChild(this.dom.background);\n }\n};\n\nmodule.exports = BackgroundGroup;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/timeline/component/BackgroundGroup.js","var Item = require('./Item');\nvar util = require('../../../util');\n\n/**\n * @constructor BoxItem\n * @extends Item\n * @param {Object} data Object containing parameters start\n * content, className.\n * @param {{toScreen: function, toTime: function}} conversion\n * Conversion functions from time to screen and vice versa\n * @param {Object} [options] Configuration options\n * // TODO: describe available options\n */\nfunction BoxItem (data, conversion, options) {\n this.props = {\n dot: {\n width: 0,\n height: 0\n },\n line: {\n width: 0,\n height: 0\n }\n };\n this.options = options;\n // validate data\n if (data) {\n if (data.start == undefined) {\n throw new Error('Property \"start\" missing in item ' + data);\n }\n }\n\n Item.call(this, data, conversion, options);\n}\n\nBoxItem.prototype = new Item (null, null, null);\n\n/**\n * Check whether this item is visible inside given range\n * @returns {{start: Number, end: Number}} range with a timestamp for start and end\n * @returns {boolean} True if visible\n */\nBoxItem.prototype.isVisible = function(range) {\n // determine visibility\n var isVisible;\n var align = this.options.align;\n var msPerPixel = (range.end - range.start) / range.body.dom.center.clientWidth;\n var widthInMs = this.width * msPerPixel;\n\n if (align == 'right') {\n isVisible = (this.data.start.getTime() > range.start ) && (this.data.start.getTime() - widthInMs < range.end);\n }\n else if (align == 'left') {\n isVisible = (this.data.start.getTime() + widthInMs > range.start ) && (this.data.start.getTime() < range.end);\n }\n else {\n // default or 'center'\n isVisible = (this.data.start.getTime() + widthInMs/2 > range.start ) && (this.data.start.getTime() - widthInMs/2 < range.end);\n }\n return isVisible;\n};\n\n/**\n * Repaint the item\n */\nBoxItem.prototype.redraw = function() {\n var dom = this.dom;\n if (!dom) {\n // create DOM\n this.dom = {};\n dom = this.dom;\n\n // create main box\n dom.box = document.createElement('DIV');\n\n // contents box (inside the background box). used for making margins\n dom.content = document.createElement('DIV');\n dom.content.className = 'vis-item-content';\n dom.box.appendChild(dom.content);\n\n // line to axis\n dom.line = document.createElement('DIV');\n dom.line.className = 'vis-line';\n\n // dot on axis\n dom.dot = document.createElement('DIV');\n dom.dot.className = 'vis-dot';\n\n // attach this item as attribute\n dom.box['timeline-item'] = this;\n\n this.dirty = true;\n }\n\n // append DOM to parent DOM\n if (!this.parent) {\n throw new Error('Cannot redraw item: no parent attached');\n }\n if (!dom.box.parentNode) {\n var foreground = this.parent.dom.foreground;\n if (!foreground) throw new Error('Cannot redraw item: parent has no foreground container element');\n foreground.appendChild(dom.box);\n }\n if (!dom.line.parentNode) {\n var background = this.parent.dom.background;\n if (!background) throw new Error('Cannot redraw item: parent has no background container element');\n background.appendChild(dom.line);\n }\n if (!dom.dot.parentNode) {\n var axis = this.parent.dom.axis;\n if (!background) throw new Error('Cannot redraw item: parent has no axis container element');\n axis.appendChild(dom.dot);\n }\n this.displayed = true;\n\n // Update DOM when item is marked dirty. An item is marked dirty when:\n // - the item is not yet rendered\n // - the item's data is changed\n // - the item is selected/deselected\n if (this.dirty) {\n this._updateContents(this.dom.content);\n this._updateTitle();\n this._updateDataAttributes(this.dom.box);\n this._updateStyle(this.dom.box);\n\n var editable = (this.options.editable.updateTime ||\n this.options.editable.updateGroup ||\n this.editable === true) &&\n this.editable !== false;\n\n // update class\n var className = (this.data.className? ' ' + this.data.className : '') +\n (this.selected ? ' vis-selected' : '') +\n (editable ? ' vis-editable' : ' vis-readonly');\n dom.box.className = 'vis-item vis-box' + className;\n dom.line.className = 'vis-item vis-line' + className;\n dom.dot.className = 'vis-item vis-dot' + className;\n\n // set initial position in the visible range of the grid so that the\n // rendered box size can be determinated correctly, even the content\n // has a dynamic width (fixes #2032).\n var previousRight = dom.box.style.right;\n var previousLeft = dom.box.style.left;\n if (this.options.rtl) {\n dom.box.style.right = \"0px\";\n } else {\n dom.box.style.left = \"0px\";\n }\n\n // recalculate size\n this.props.dot.height = dom.dot.offsetHeight;\n this.props.dot.width = dom.dot.offsetWidth;\n this.props.line.width = dom.line.offsetWidth;\n this.width = dom.box.offsetWidth;\n this.height = dom.box.offsetHeight;\n\n // restore previous position\n if (this.options.rtl) {\n dom.box.style.right = previousRight;\n } else {\n dom.box.style.left = previousLeft;\n }\n\n this.dirty = false;\n }\n\n this._repaintOnItemUpdateTimeTooltip(dom.box);\n this._repaintDragCenter();\n this._repaintDeleteButton(dom.box);\n};\n\n/**\n * Show the item in the DOM (when not already displayed). The items DOM will\n * be created when needed.\n */\nBoxItem.prototype.show = function() {\n if (!this.displayed) {\n this.redraw();\n }\n};\n\n/**\n * Hide the item from the DOM (when visible)\n */\nBoxItem.prototype.hide = function() {\n if (this.displayed) {\n var dom = this.dom;\n\n if (dom.box.parentNode) dom.box.parentNode.removeChild(dom.box);\n if (dom.line.parentNode) dom.line.parentNode.removeChild(dom.line);\n if (dom.dot.parentNode) dom.dot.parentNode.removeChild(dom.dot);\n\n this.displayed = false;\n }\n};\n\n/**\n * Reposition the item horizontally\n * @Override\n */\nBoxItem.prototype.repositionX = function() {\n var start = this.conversion.toScreen(this.data.start);\n var align = this.options.align;\n\n // calculate left position of the box\n if (align == 'right') {\n if (this.options.rtl) {\n this.right = start - this.width;\n\n // reposition box, line, and dot\n this.dom.box.style.right = this.right + 'px';\n this.dom.line.style.right = (start - this.props.line.width) + 'px';\n this.dom.dot.style.right = (start - this.props.line.width / 2 - this.props.dot.width / 2) + 'px';\n } else {\n this.left = start - this.width;\n\n // reposition box, line, and dot\n this.dom.box.style.left = this.left + 'px';\n this.dom.line.style.left = (start - this.props.line.width) + 'px';\n this.dom.dot.style.left = (start - this.props.line.width / 2 - this.props.dot.width / 2) + 'px';\n }\n }\n else if (align == 'left') {\n if (this.options.rtl) {\n this.right = start;\n\n // reposition box, line, and dot\n this.dom.box.style.right = this.right + 'px';\n this.dom.line.style.right = start + 'px';\n this.dom.dot.style.right = (start + this.props.line.width / 2 - this.props.dot.width / 2) + 'px';\n } else {\n this.left = start;\n\n // reposition box, line, and dot\n this.dom.box.style.left = this.left + 'px';\n this.dom.line.style.left = start + 'px';\n this.dom.dot.style.left = (start + this.props.line.width / 2 - this.props.dot.width / 2) + 'px';\n }\n }\n else {\n // default or 'center'\n if (this.options.rtl) {\n this.right = start - this.width / 2;\n\n // reposition box, line, and dot\n this.dom.box.style.right = this.right + 'px';\n this.dom.line.style.right = (start - this.props.line.width) + 'px';\n this.dom.dot.style.right = (start - this.props.dot.width / 2) + 'px';\n } else {\n this.left = start - this.width / 2;\n\n // reposition box, line, and dot\n this.dom.box.style.left = this.left + 'px';\n this.dom.line.style.left = (start - this.props.line.width / 2) + 'px';\n this.dom.dot.style.left = (start - this.props.dot.width / 2) + 'px';\n }\n }\n};\n\n/**\n * Reposition the item vertically\n * @Override\n */\nBoxItem.prototype.repositionY = function() {\n var orientation = this.options.orientation.item;\n var box = this.dom.box;\n var line = this.dom.line;\n var dot = this.dom.dot;\n\n if (orientation == 'top') {\n box.style.top = (this.top || 0) + 'px';\n\n line.style.top = '0';\n line.style.height = (this.parent.top + this.top + 1) + 'px';\n line.style.bottom = '';\n }\n else { // orientation 'bottom'\n var itemSetHeight = this.parent.itemSet.props.height; // TODO: this is nasty\n var lineHeight = itemSetHeight - this.parent.top - this.parent.height + this.top;\n\n box.style.top = (this.parent.height - this.top - this.height || 0) + 'px';\n line.style.top = (itemSetHeight - lineHeight) + 'px';\n line.style.bottom = '0';\n }\n\n dot.style.top = (-this.props.dot.height / 2) + 'px';\n};\n\n/**\n * Return the width of the item left from its start date\n * @return {number}\n */\nBoxItem.prototype.getWidthLeft = function () {\n return this.width / 2;\n};\n\n/**\n * Return the width of the item right from its start date\n * @return {number}\n */\nBoxItem.prototype.getWidthRight = function () {\n return this.width / 2;\n};\n\nmodule.exports = BoxItem;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/timeline/component/item/BoxItem.js","var Item = require('./Item');\n\n/**\n * @constructor PointItem\n * @extends Item\n * @param {Object} data Object containing parameters start\n * content, className.\n * @param {{toScreen: function, toTime: function}} conversion\n * Conversion functions from time to screen and vice versa\n * @param {Object} [options] Configuration options\n * // TODO: describe available options\n */\nfunction PointItem (data, conversion, options) {\n this.props = {\n dot: {\n top: 0,\n width: 0,\n height: 0\n },\n content: {\n height: 0,\n marginLeft: 0,\n marginRight: 0\n }\n };\n this.options = options;\n // validate data\n if (data) {\n if (data.start == undefined) {\n throw new Error('Property \"start\" missing in item ' + data);\n }\n }\n\n Item.call(this, data, conversion, options);\n}\n\nPointItem.prototype = new Item (null, null, null);\n\n/**\n * Check whether this item is visible inside given range\n * @returns {{start: Number, end: Number}} range with a timestamp for start and end\n * @returns {boolean} True if visible\n */\nPointItem.prototype.isVisible = function(range) {\n // determine visibility\n var msPerPixel = (range.end - range.start) / range.body.dom.center.clientWidth;\n var widthInMs = this.width * msPerPixel;\n \n return (this.data.start.getTime() + widthInMs > range.start ) && (this.data.start < range.end);\n};\n\n/**\n * Repaint the item\n */\nPointItem.prototype.redraw = function() {\n var dom = this.dom;\n if (!dom) {\n // create DOM\n this.dom = {};\n dom = this.dom;\n\n // background box\n dom.point = document.createElement('div');\n // className is updated in redraw()\n\n // contents box, right from the dot\n dom.content = document.createElement('div');\n dom.content.className = 'vis-item-content';\n dom.point.appendChild(dom.content);\n\n // dot at start\n dom.dot = document.createElement('div');\n dom.point.appendChild(dom.dot);\n\n // attach this item as attribute\n dom.point['timeline-item'] = this;\n\n this.dirty = true;\n }\n\n // append DOM to parent DOM\n if (!this.parent) {\n throw new Error('Cannot redraw item: no parent attached');\n }\n if (!dom.point.parentNode) {\n var foreground = this.parent.dom.foreground;\n if (!foreground) {\n throw new Error('Cannot redraw item: parent has no foreground container element');\n }\n foreground.appendChild(dom.point);\n }\n this.displayed = true;\n\n // Update DOM when item is marked dirty. An item is marked dirty when:\n // - the item is not yet rendered\n // - the item's data is changed\n // - the item is selected/deselected\n if (this.dirty) {\n this._updateContents(this.dom.content);\n this._updateTitle();\n this._updateDataAttributes(this.dom.point);\n this._updateStyle(this.dom.point);\n\n var editable = (this.options.editable.updateTime || \n this.options.editable.updateGroup ||\n this.editable === true) &&\n this.editable !== false;\n\n // update class\n var className = (this.data.className ? ' ' + this.data.className : '') +\n (this.selected ? ' vis-selected' : '') +\n (editable ? ' vis-editable' : ' vis-readonly');\n dom.point.className = 'vis-item vis-point' + className;\n dom.dot.className = 'vis-item vis-dot' + className;\n\n // recalculate size of dot and contents\n this.props.dot.width = dom.dot.offsetWidth;\n this.props.dot.height = dom.dot.offsetHeight;\n this.props.content.height = dom.content.offsetHeight;\n\n // resize contents\n if (this.options.rtl) {\n dom.content.style.marginRight = 2 * this.props.dot.width + 'px';\n } else {\n dom.content.style.marginLeft = 2 * this.props.dot.width + 'px';\n }\n //dom.content.style.marginRight = ... + 'px'; // TODO: margin right\n\n // recalculate size\n this.width = dom.point.offsetWidth;\n this.height = dom.point.offsetHeight;\n\n // reposition the dot\n dom.dot.style.top = ((this.height - this.props.dot.height) / 2) + 'px';\n if (this.options.rtl) {\n dom.dot.style.right = (this.props.dot.width / 2) + 'px';\n } else {\n dom.dot.style.left = (this.props.dot.width / 2) + 'px';\n }\n\n this.dirty = false;\n }\n \n this._repaintOnItemUpdateTimeTooltip(dom.point);\n this._repaintDragCenter();\n this._repaintDeleteButton(dom.point);\n};\n\n/**\n * Show the item in the DOM (when not already visible). The items DOM will\n * be created when needed.\n */\nPointItem.prototype.show = function() {\n if (!this.displayed) {\n this.redraw();\n }\n};\n\n/**\n * Hide the item from the DOM (when visible)\n */\nPointItem.prototype.hide = function() {\n if (this.displayed) {\n if (this.dom.point.parentNode) {\n this.dom.point.parentNode.removeChild(this.dom.point);\n }\n\n this.displayed = false;\n }\n};\n\n/**\n * Reposition the item horizontally\n * @Override\n */\nPointItem.prototype.repositionX = function() {\n var start = this.conversion.toScreen(this.data.start);\n\n if (this.options.rtl) {\n this.right = start - this.props.dot.width;\n\n // reposition point\n this.dom.point.style.right = this.right + 'px';\n } else {\n this.left = start - this.props.dot.width;\n\n // reposition point\n this.dom.point.style.left = this.left + 'px';\n }\n};\n\n/**\n * Reposition the item vertically\n * @Override\n */\nPointItem.prototype.repositionY = function() {\n var orientation = this.options.orientation.item;\n var point = this.dom.point;\n if (orientation == 'top') {\n point.style.top = this.top + 'px';\n }\n else {\n point.style.top = (this.parent.height - this.top - this.height) + 'px';\n }\n};\n\n/**\n * Return the width of the item left from its start date\n * @return {number}\n */\nPointItem.prototype.getWidthLeft = function () {\n return this.props.dot.width;\n};\n\n/**\n * Return the width of the item right from its start date\n * @return {number}\n */\nPointItem.prototype.getWidthRight = function () {\n return this.props.dot.width;\n};\n\nmodule.exports = PointItem;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/timeline/component/item/PointItem.js","var Hammer = require('../../../module/hammer');\nvar Item = require('./Item');\nvar BackgroundGroup = require('../BackgroundGroup');\nvar RangeItem = require('./RangeItem');\n\n/**\n * @constructor BackgroundItem\n * @extends Item\n * @param {Object} data Object containing parameters start, end\n * content, className.\n * @param {{toScreen: function, toTime: function}} conversion\n * Conversion functions from time to screen and vice versa\n * @param {Object} [options] Configuration options\n * // TODO: describe options\n */\n// TODO: implement support for the BackgroundItem just having a start, then being displayed as a sort of an annotation\nfunction BackgroundItem (data, conversion, options) {\n this.props = {\n content: {\n width: 0\n }\n };\n this.overflow = false; // if contents can overflow (css styling), this flag is set to true\n\n // validate data\n if (data) {\n if (data.start == undefined) {\n throw new Error('Property \"start\" missing in item ' + data.id);\n }\n if (data.end == undefined) {\n throw new Error('Property \"end\" missing in item ' + data.id);\n }\n }\n\n Item.call(this, data, conversion, options);\n}\n\nBackgroundItem.prototype = new Item (null, null, null);\n\nBackgroundItem.prototype.baseClassName = 'vis-item vis-background';\nBackgroundItem.prototype.stack = false;\n\n/**\n * Check whether this item is visible inside given range\n * @returns {{start: Number, end: Number}} range with a timestamp for start and end\n * @returns {boolean} True if visible\n */\nBackgroundItem.prototype.isVisible = function(range) {\n // determine visibility\n return (this.data.start < range.end) && (this.data.end > range.start); \n};\n\n/**\n * Repaint the item\n */\nBackgroundItem.prototype.redraw = function() {\n var dom = this.dom;\n if (!dom) {\n // create DOM\n this.dom = {};\n dom = this.dom;\n\n // background box\n dom.box = document.createElement('div');\n // className is updated in redraw()\n\n // frame box (to prevent the item contents from overflowing\n dom.frame = document.createElement('div');\n dom.frame.className = 'vis-item-overflow';\n dom.box.appendChild(dom.frame);\n\n // contents box\n dom.content = document.createElement('div');\n dom.content.className = 'vis-item-content';\n dom.frame.appendChild(dom.content);\n\n // Note: we do NOT attach this item as attribute to the DOM,\n // such that background items cannot be selected\n //dom.box['timeline-item'] = this;\n\n this.dirty = true;\n }\n\n // append DOM to parent DOM\n if (!this.parent) {\n throw new Error('Cannot redraw item: no parent attached');\n }\n if (!dom.box.parentNode) {\n var background = this.parent.dom.background;\n if (!background) {\n throw new Error('Cannot redraw item: parent has no background container element');\n }\n background.appendChild(dom.box);\n }\n this.displayed = true;\n\n // Update DOM when item is marked dirty. An item is marked dirty when:\n // - the item is not yet rendered\n // - the item's data is changed\n // - the item is selected/deselected\n if (this.dirty) {\n this._updateContents(this.dom.content);\n this._updateTitle();\n this._updateDataAttributes(this.dom.content);\n this._updateStyle(this.dom.box);\n\n // update class\n var className = (this.data.className ? (' ' + this.data.className) : '') +\n (this.selected ? ' vis-selected' : '');\n dom.box.className = this.baseClassName + className;\n\n // determine from css whether this box has overflow\n this.overflow = window.getComputedStyle(dom.content).overflow !== 'hidden';\n\n // recalculate size\n this.props.content.width = this.dom.content.offsetWidth;\n this.height = 0; // set height zero, so this item will be ignored when stacking items\n\n this.dirty = false;\n }\n};\n\n/**\n * Show the item in the DOM (when not already visible). The items DOM will\n * be created when needed.\n */\nBackgroundItem.prototype.show = RangeItem.prototype.show;\n\n/**\n * Hide the item from the DOM (when visible)\n * @return {Boolean} changed\n */\nBackgroundItem.prototype.hide = RangeItem.prototype.hide;\n\n/**\n * Reposition the item horizontally\n * @Override\n */\nBackgroundItem.prototype.repositionX = RangeItem.prototype.repositionX;\n\n/**\n * Reposition the item vertically\n * @Override\n */\nBackgroundItem.prototype.repositionY = function(margin) {\n var height;\n\n // special positioning for subgroups\n if (this.data.subgroup !== undefined) {\n // TODO: instead of calculating the top position of the subgroups here for every BackgroundItem, calculate the top of the subgroup once in Itemset\n\n var itemSubgroup = this.data.subgroup;\n var subgroups = this.parent.subgroups;\n var subgroupIndex = subgroups[itemSubgroup].index;\n\n this.dom.box.style.height = this.parent.subgroups[itemSubgroup].height + 'px';\n\n var orientation = this.options.orientation.item;\n if (orientation == 'top') { \n this.dom.box.style.top = this.parent.top + this.parent.subgroups[itemSubgroup].top + 'px';\n } else {\n this.dom.box.style.top = (this.parent.top + this.parent.height - this.parent.subgroups[itemSubgroup].top - this.parent.subgroups[itemSubgroup].height) + 'px';\n }\n this.dom.box.style.bottom = '';\n }\n // and in the case of no subgroups:\n else {\n // we want backgrounds with groups to only show in groups.\n if (this.parent instanceof BackgroundGroup) {\n // if the item is not in a group:\n height = Math.max(this.parent.height,\n this.parent.itemSet.body.domProps.center.height,\n this.parent.itemSet.body.domProps.centerContainer.height);\n this.dom.box.style.top = orientation == 'top' ? '0' : '';\n this.dom.box.style.bottom = orientation == 'top' ? '' : '0';\n }\n else {\n height = this.parent.height;\n // same alignment for items when orientation is top or bottom\n this.dom.box.style.top = this.parent.top + 'px';\n this.dom.box.style.bottom = '';\n }\n }\n this.dom.box.style.height = height + 'px';\n};\n\nmodule.exports = BackgroundItem;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/timeline/component/item/BackgroundItem.js","var util = require('../../util');\nvar Component = require('./Component');\nvar TimeStep = require('../TimeStep');\nvar DateUtil = require('../DateUtil');\nvar moment = require('../../module/moment');\n\n/**\n * A horizontal time axis\n * @param {{dom: Object, domProps: Object, emitter: Emitter, range: Range}} body\n * @param {Object} [options] See TimeAxis.setOptions for the available\n * options.\n * @constructor TimeAxis\n * @extends Component\n */\nfunction TimeAxis (body, options) {\n this.dom = {\n foreground: null,\n lines: [],\n majorTexts: [],\n minorTexts: [],\n redundant: {\n lines: [],\n majorTexts: [],\n minorTexts: []\n }\n };\n this.props = {\n range: {\n start: 0,\n end: 0,\n minimumStep: 0\n },\n lineTop: 0\n };\n\n this.defaultOptions = {\n orientation: {\n axis: 'bottom'\n }, // axis orientation: 'top' or 'bottom'\n showMinorLabels: true,\n showMajorLabels: true,\n maxMinorChars: 7,\n format: TimeStep.FORMAT,\n moment: moment,\n timeAxis: null\n };\n this.options = util.extend({}, this.defaultOptions);\n\n this.body = body;\n\n // create the HTML DOM\n this._create();\n\n this.setOptions(options);\n}\n\nTimeAxis.prototype = new Component();\n\n/**\n * Set options for the TimeAxis.\n * Parameters will be merged in current options.\n * @param {Object} options Available options:\n * {string} [orientation.axis]\n * {boolean} [showMinorLabels]\n * {boolean} [showMajorLabels]\n */\nTimeAxis.prototype.setOptions = function(options) {\n if (options) {\n // copy all options that we know\n util.selectiveExtend([\n 'showMinorLabels',\n 'showMajorLabels',\n 'maxMinorChars',\n 'hiddenDates',\n 'timeAxis',\n 'moment',\n 'rtl'\n ], this.options, options);\n\n // deep copy the format options\n util.selectiveDeepExtend(['format'], this.options, options);\n\n if ('orientation' in options) {\n if (typeof options.orientation === 'string') {\n this.options.orientation.axis = options.orientation;\n }\n else if (typeof options.orientation === 'object' && 'axis' in options.orientation) {\n this.options.orientation.axis = options.orientation.axis;\n }\n }\n\n // apply locale to moment.js\n // TODO: not so nice, this is applied globally to moment.js\n if ('locale' in options) {\n if (typeof moment.locale === 'function') {\n // moment.js 2.8.1+\n moment.locale(options.locale);\n }\n else {\n moment.lang(options.locale);\n }\n }\n }\n};\n\n/**\n * Create the HTML DOM for the TimeAxis\n */\nTimeAxis.prototype._create = function() {\n this.dom.foreground = document.createElement('div');\n this.dom.background = document.createElement('div');\n\n this.dom.foreground.className = 'vis-time-axis vis-foreground';\n this.dom.background.className = 'vis-time-axis vis-background';\n};\n\n/**\n * Destroy the TimeAxis\n */\nTimeAxis.prototype.destroy = function() {\n // remove from DOM\n if (this.dom.foreground.parentNode) {\n this.dom.foreground.parentNode.removeChild(this.dom.foreground);\n }\n if (this.dom.background.parentNode) {\n this.dom.background.parentNode.removeChild(this.dom.background);\n }\n\n this.body = null;\n};\n\n/**\n * Repaint the component\n * @return {boolean} Returns true if the component is resized\n */\nTimeAxis.prototype.redraw = function () {\n var props = this.props;\n var foreground = this.dom.foreground;\n var background = this.dom.background;\n\n // determine the correct parent DOM element (depending on option orientation)\n var parent = (this.options.orientation.axis == 'top') ? this.body.dom.top : this.body.dom.bottom;\n var parentChanged = (foreground.parentNode !== parent);\n\n // calculate character width and height\n this._calculateCharSize();\n\n // TODO: recalculate sizes only needed when parent is resized or options is changed\n var showMinorLabels = this.options.showMinorLabels && this.options.orientation.axis !== 'none';\n var showMajorLabels = this.options.showMajorLabels && this.options.orientation.axis !== 'none';\n\n // determine the width and height of the elemens for the axis\n props.minorLabelHeight = showMinorLabels ? props.minorCharHeight : 0;\n props.majorLabelHeight = showMajorLabels ? props.majorCharHeight : 0;\n props.height = props.minorLabelHeight + props.majorLabelHeight;\n props.width = foreground.offsetWidth;\n\n props.minorLineHeight = this.body.domProps.root.height - props.majorLabelHeight -\n (this.options.orientation.axis == 'top' ? this.body.domProps.bottom.height : this.body.domProps.top.height);\n props.minorLineWidth = 1; // TODO: really calculate width\n props.majorLineHeight = props.minorLineHeight + props.majorLabelHeight;\n props.majorLineWidth = 1; // TODO: really calculate width\n\n // take foreground and background offline while updating (is almost twice as fast)\n var foregroundNextSibling = foreground.nextSibling;\n var backgroundNextSibling = background.nextSibling;\n foreground.parentNode && foreground.parentNode.removeChild(foreground);\n background.parentNode && background.parentNode.removeChild(background);\n\n foreground.style.height = this.props.height + 'px';\n\n this._repaintLabels();\n\n // put DOM online again (at the same place)\n if (foregroundNextSibling) {\n parent.insertBefore(foreground, foregroundNextSibling);\n }\n else {\n parent.appendChild(foreground)\n }\n if (backgroundNextSibling) {\n this.body.dom.backgroundVertical.insertBefore(background, backgroundNextSibling);\n }\n else {\n this.body.dom.backgroundVertical.appendChild(background)\n }\n return this._isResized() || parentChanged;\n};\n\n/**\n * Repaint major and minor text labels and vertical grid lines\n * @private\n */\nTimeAxis.prototype._repaintLabels = function () {\n var orientation = this.options.orientation.axis;\n\n // calculate range and step (step such that we have space for 7 characters per label)\n var start = util.convert(this.body.range.start, 'Number');\n var end = util.convert(this.body.range.end, 'Number');\n var timeLabelsize = this.body.util.toTime((this.props.minorCharWidth || 10) * this.options.maxMinorChars).valueOf();\n var minimumStep = timeLabelsize - DateUtil.getHiddenDurationBefore(this.options.moment, this.body.hiddenDates, this.body.range, timeLabelsize);\n minimumStep -= this.body.util.toTime(0).valueOf();\n\n var step = new TimeStep(new Date(start), new Date(end), minimumStep, this.body.hiddenDates);\n step.setMoment(this.options.moment);\n if (this.options.format) {\n step.setFormat(this.options.format);\n }\n if (this.options.timeAxis) {\n step.setScale(this.options.timeAxis);\n }\n this.step = step;\n\n // Move all DOM elements to a \"redundant\" list, where they\n // can be picked for re-use, and clear the lists with lines and texts.\n // At the end of the function _repaintLabels, left over elements will be cleaned up\n var dom = this.dom;\n dom.redundant.lines = dom.lines;\n dom.redundant.majorTexts = dom.majorTexts;\n dom.redundant.minorTexts = dom.minorTexts;\n dom.lines = [];\n dom.majorTexts = [];\n dom.minorTexts = [];\n\n var current;\n var next;\n var x;\n var xNext;\n var isMajor, nextIsMajor;\n var width = 0, prevWidth;\n var line;\n var labelMinor;\n var xFirstMajorLabel = undefined;\n var count = 0;\n const MAX = 1000;\n var className;\n\n step.start();\n next = step.getCurrent();\n xNext = this.body.util.toScreen(next);\n while (step.hasNext() && count < MAX) {\n count++;\n\n isMajor = step.isMajor();\n className = step.getClassName();\n labelMinor = step.getLabelMinor();\n\n current = next;\n x = xNext;\n\n step.next();\n next = step.getCurrent();\n nextIsMajor = step.isMajor();\n xNext = this.body.util.toScreen(next);\n\n prevWidth = width;\n width = xNext - x;\n var showMinorGrid = (width >= prevWidth * 0.4); // prevent displaying of the 31th of the month on a scale of 5 days\n\n if (this.options.showMinorLabels && showMinorGrid) {\n var label = this._repaintMinorText(x, labelMinor, orientation, className);\n label.style.width = width + 'px'; // set width to prevent overflow\n }\n\n if (isMajor && this.options.showMajorLabels) {\n if (x > 0) {\n if (xFirstMajorLabel == undefined) {\n xFirstMajorLabel = x;\n }\n label = this._repaintMajorText(x, step.getLabelMajor(), orientation, className);\n }\n line = this._repaintMajorLine(x, width, orientation, className);\n }\n else { // minor line\n if (showMinorGrid) {\n line = this._repaintMinorLine(x, width, orientation, className);\n }\n else {\n if (line) {\n // adjust the width of the previous grid\n line.style.width = (parseInt (line.style.width) + width) + 'px';\n }\n }\n }\n }\n\n if (count === MAX && !warnedForOverflow) {\n console.warn(`Something is wrong with the Timeline scale. Limited drawing of grid lines to ${MAX} lines.`);\n warnedForOverflow = true;\n }\n\n // create a major label on the left when needed\n if (this.options.showMajorLabels) {\n var leftTime = this.body.util.toTime(0),\n leftText = step.getLabelMajor(leftTime),\n widthText = leftText.length * (this.props.majorCharWidth || 10) + 10; // upper bound estimation\n\n if (xFirstMajorLabel == undefined || widthText < xFirstMajorLabel) {\n this._repaintMajorText(0, leftText, orientation, className);\n }\n }\n\n // Cleanup leftover DOM elements from the redundant list\n util.forEach(this.dom.redundant, function (arr) {\n while (arr.length) {\n var elem = arr.pop();\n if (elem && elem.parentNode) {\n elem.parentNode.removeChild(elem);\n }\n }\n });\n};\n\n/**\n * Create a minor label for the axis at position x\n * @param {Number} x\n * @param {String} text\n * @param {String} orientation \"top\" or \"bottom\" (default)\n * @param {String} className\n * @return {Element} Returns the HTML element of the created label\n * @private\n */\nTimeAxis.prototype._repaintMinorText = function (x, text, orientation, className) {\n // reuse redundant label\n var label = this.dom.redundant.minorTexts.shift();\n\n if (!label) {\n // create new label\n var content = document.createTextNode('');\n label = document.createElement('div');\n label.appendChild(content);\n this.dom.foreground.appendChild(label);\n }\n this.dom.minorTexts.push(label);\n label.innerHTML = text;\n\n label.style.top = (orientation == 'top') ? (this.props.majorLabelHeight + 'px') : '0';\n\n if (this.options.rtl) {\n label.style.left = \"\";\n label.style.right = x + 'px';\n } else {\n label.style.left = x + 'px';\n };\n label.className = 'vis-text vis-minor ' + className;\n //label.title = title; // TODO: this is a heavy operation\n\n return label;\n};\n\n/**\n * Create a Major label for the axis at position x\n * @param {Number} x\n * @param {String} text\n * @param {String} orientation \"top\" or \"bottom\" (default)\n * @param {String} className\n * @return {Element} Returns the HTML element of the created label\n * @private\n */\nTimeAxis.prototype._repaintMajorText = function (x, text, orientation, className) {\n // reuse redundant label\n var label = this.dom.redundant.majorTexts.shift();\n\n if (!label) {\n // create label\n var content = document.createElement('div');\n label = document.createElement('div');\n label.appendChild(content);\n this.dom.foreground.appendChild(label);\n }\n\n label.childNodes[0].innerHTML = text;\n label.className = 'vis-text vis-major ' + className;\n //label.title = title; // TODO: this is a heavy operation\n\n label.style.top = (orientation == 'top') ? '0' : (this.props.minorLabelHeight + 'px');\n if (this.options.rtl) {\n label.style.left = \"\";\n label.style.right = x + 'px';\n } else {\n label.style.left = x + 'px';\n };\n\n this.dom.majorTexts.push(label);\n return label;\n};\n\n/**\n * Create a minor line for the axis at position x\n * @param {Number} x\n * @param {Number} width\n * @param {String} orientation \"top\" or \"bottom\" (default)\n * @param {String} className\n * @return {Element} Returns the created line\n * @private\n */\nTimeAxis.prototype._repaintMinorLine = function (x, width, orientation, className) {\n // reuse redundant line\n var line = this.dom.redundant.lines.shift();\n if (!line) {\n // create vertical line\n line = document.createElement('div');\n this.dom.background.appendChild(line);\n }\n this.dom.lines.push(line);\n\n var props = this.props;\n if (orientation == 'top') {\n line.style.top = props.majorLabelHeight + 'px';\n }\n else {\n line.style.top = this.body.domProps.top.height + 'px';\n }\n line.style.height = props.minorLineHeight + 'px';\n if (this.options.rtl) {\n line.style.left = \"\";\n line.style.right = (x - props.minorLineWidth / 2) + 'px';\n line.className = 'vis-grid vis-vertical-rtl vis-minor ' + className;\n } else {\n line.style.left = (x - props.minorLineWidth / 2) + 'px';\n line.className = 'vis-grid vis-vertical vis-minor ' + className;\n };\n line.style.width = width + 'px';\n\n \n\n return line;\n};\n\n/**\n * Create a Major line for the axis at position x\n * @param {Number} x\n * @param {Number} width\n * @param {String} orientation \"top\" or \"bottom\" (default)\n * @param {String} className\n * @return {Element} Returns the created line\n * @private\n */\nTimeAxis.prototype._repaintMajorLine = function (x, width, orientation, className) {\n // reuse redundant line\n var line = this.dom.redundant.lines.shift();\n if (!line) {\n // create vertical line\n line = document.createElement('div');\n this.dom.background.appendChild(line);\n }\n this.dom.lines.push(line);\n\n var props = this.props;\n if (orientation == 'top') {\n line.style.top = '0';\n }\n else {\n line.style.top = this.body.domProps.top.height + 'px';\n }\n\n if (this.options.rtl) {\n line.style.left = \"\";\n line.style.right = (x - props.majorLineWidth / 2) + 'px';\n line.className = 'vis-grid vis-vertical-rtl vis-major ' + className;\n } else {\n line.style.left = (x - props.majorLineWidth / 2) + 'px';\n line.className = 'vis-grid vis-vertical vis-major ' + className;\n }\n\n line.style.height = props.majorLineHeight + 'px';\n line.style.width = width + 'px';\n\n return line;\n};\n\n/**\n * Determine the size of text on the axis (both major and minor axis).\n * The size is calculated only once and then cached in this.props.\n * @private\n */\nTimeAxis.prototype._calculateCharSize = function () {\n // Note: We calculate char size with every redraw. Size may change, for\n // example when any of the timelines parents had display:none for example.\n\n // determine the char width and height on the minor axis\n if (!this.dom.measureCharMinor) {\n this.dom.measureCharMinor = document.createElement('DIV');\n this.dom.measureCharMinor.className = 'vis-text vis-minor vis-measure';\n this.dom.measureCharMinor.style.position = 'absolute';\n\n this.dom.measureCharMinor.appendChild(document.createTextNode('0'));\n this.dom.foreground.appendChild(this.dom.measureCharMinor);\n }\n this.props.minorCharHeight = this.dom.measureCharMinor.clientHeight;\n this.props.minorCharWidth = this.dom.measureCharMinor.clientWidth;\n\n // determine the char width and height on the major axis\n if (!this.dom.measureCharMajor) {\n this.dom.measureCharMajor = document.createElement('DIV');\n this.dom.measureCharMajor.className = 'vis-text vis-major vis-measure';\n this.dom.measureCharMajor.style.position = 'absolute';\n\n this.dom.measureCharMajor.appendChild(document.createTextNode('0'));\n this.dom.foreground.appendChild(this.dom.measureCharMajor);\n }\n this.props.majorCharHeight = this.dom.measureCharMajor.clientHeight;\n this.props.majorCharWidth = this.dom.measureCharMajor.clientWidth;\n};\n\n\nvar warnedForOverflow = false;\n\nmodule.exports = TimeAxis;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/timeline/component/TimeAxis.js","var keycharm = require('keycharm');\nvar Emitter = require('emitter-component');\nvar Hammer = require('../module/hammer');\nvar util = require('../util');\n\n/**\n * Turn an element into an clickToUse element.\n * When not active, the element has a transparent overlay. When the overlay is\n * clicked, the mode is changed to active.\n * When active, the element is displayed with a blue border around it, and\n * the interactive contents of the element can be used. When clicked outside\n * the element, the elements mode is changed to inactive.\n * @param {Element} container\n * @constructor\n */\nfunction Activator(container) {\n this.active = false;\n\n this.dom = {\n container: container\n };\n\n this.dom.overlay = document.createElement('div');\n this.dom.overlay.className = 'vis-overlay';\n\n this.dom.container.appendChild(this.dom.overlay);\n\n this.hammer = Hammer(this.dom.overlay);\n this.hammer.on('tap', this._onTapOverlay.bind(this));\n\n // block all touch events (except tap)\n var me = this;\n var events = [\n 'tap', 'doubletap', 'press',\n 'pinch',\n 'pan', 'panstart', 'panmove', 'panend'\n ];\n events.forEach(function (event) {\n me.hammer.on(event, function (event) {\n event.stopPropagation();\n });\n });\n\n // attach a click event to the window, in order to deactivate when clicking outside the timeline\n if (document && document.body) {\n this.onClick = function (event) {\n if (!_hasParent(event.target, container)) {\n me.deactivate();\n }\n };\n document.body.addEventListener('click', this.onClick);\n }\n\n if (this.keycharm !== undefined) {\n this.keycharm.destroy();\n }\n this.keycharm = keycharm();\n\n // keycharm listener only bounded when active)\n this.escListener = this.deactivate.bind(this);\n}\n\n// turn into an event emitter\nEmitter(Activator.prototype);\n\n// The currently active activator\nActivator.current = null;\n\n/**\n * Destroy the activator. Cleans up all created DOM and event listeners\n */\nActivator.prototype.destroy = function () {\n this.deactivate();\n\n // remove dom\n this.dom.overlay.parentNode.removeChild(this.dom.overlay);\n\n // remove global event listener\n if (this.onClick) {\n document.body.removeEventListener('click', this.onClick);\n }\n\n // cleanup hammer instances\n this.hammer.destroy();\n this.hammer = null;\n // FIXME: cleaning up hammer instances doesn't work (Timeline not removed from memory)\n};\n\n/**\n * Activate the element\n * Overlay is hidden, element is decorated with a blue shadow border\n */\nActivator.prototype.activate = function () {\n // we allow only one active activator at a time\n if (Activator.current) {\n Activator.current.deactivate();\n }\n Activator.current = this;\n\n this.active = true;\n this.dom.overlay.style.display = 'none';\n util.addClassName(this.dom.container, 'vis-active');\n\n this.emit('change');\n this.emit('activate');\n\n // ugly hack: bind ESC after emitting the events, as the Network rebinds all\n // keyboard events on a 'change' event\n this.keycharm.bind('esc', this.escListener);\n};\n\n/**\n * Deactivate the element\n * Overlay is displayed on top of the element\n */\nActivator.prototype.deactivate = function () {\n this.active = false;\n this.dom.overlay.style.display = '';\n util.removeClassName(this.dom.container, 'vis-active');\n this.keycharm.unbind('esc', this.escListener);\n\n this.emit('change');\n this.emit('deactivate');\n};\n\n/**\n * Handle a tap event: activate the container\n * @param event\n * @private\n */\nActivator.prototype._onTapOverlay = function (event) {\n // activate the container\n this.activate();\n event.stopPropagation();\n};\n\n/**\n * Test whether the element has the requested parent element somewhere in\n * its chain of parent nodes.\n * @param {HTMLElement} element\n * @param {HTMLElement} parent\n * @returns {boolean} Returns true when the parent is found somewhere in the\n * chain of parent nodes.\n * @private\n */\nfunction _hasParent(element, parent) {\n while (element) {\n if (element === parent) {\n return true\n }\n element = element.parentNode;\n }\n return false;\n}\n\nmodule.exports = Activator;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/shared/Activator.js","var Hammer = require('../../module/hammer');\nvar util = require('../../util');\nvar Component = require('./Component');\nvar moment = require('../../module/moment');\nvar locales = require('../locales');\n\n/**\n * A custom time bar\n * @param {{range: Range, dom: Object}} body\n * @param {Object} [options] Available parameters:\n * {number | string} id\n * {string} locales\n * {string} locale\n * @constructor CustomTime\n * @extends Component\n */\n\nfunction CustomTime (body, options) {\n this.body = body;\n\n // default options\n this.defaultOptions = {\n moment: moment,\n locales: locales,\n locale: 'en',\n id: undefined,\n title: undefined\n };\n this.options = util.extend({}, this.defaultOptions);\n\n if (options && options.time) {\n this.customTime = options.time;\n } else {\n this.customTime = new Date();\n }\n\n this.eventParams = {}; // stores state parameters while dragging the bar\n\n this.setOptions(options);\n\n // create the DOM\n this._create();\n}\n\nCustomTime.prototype = new Component();\n\n/**\n * Set options for the component. Options will be merged in current options.\n * @param {Object} options Available parameters:\n * {number | string} id\n * {string} locales\n * {string} locale\n */\nCustomTime.prototype.setOptions = function(options) {\n if (options) {\n // copy all options that we know\n util.selectiveExtend(['moment', 'locale', 'locales', 'id'], this.options, options);\n }\n};\n\n/**\n * Create the DOM for the custom time\n * @private\n */\nCustomTime.prototype._create = function() {\n var bar = document.createElement('div');\n bar['custom-time'] = this;\n bar.className = 'vis-custom-time ' + (this.options.id || '');\n bar.style.position = 'absolute';\n bar.style.top = '0px';\n bar.style.height = '100%';\n this.bar = bar;\n\n var drag = document.createElement('div');\n drag.style.position = 'relative';\n drag.style.top = '0px';\n drag.style.left = '-10px';\n drag.style.height = '100%';\n drag.style.width = '20px';\n\n function onMouseWheel (e) {\n this.body.range._onMouseWheel(e);\n }\n\n if (drag.addEventListener) {\n // IE9, Chrome, Safari, Opera\n drag.addEventListener(\"mousewheel\", onMouseWheel.bind(this), false);\n // Firefox\n drag.addEventListener(\"DOMMouseScroll\", onMouseWheel.bind(this), false);\n } else {\n // IE 6/7/8\n drag.attachEvent(\"onmousewheel\", onMouseWheel.bind(this));\n }\n\n bar.appendChild(drag);\n // attach event listeners\n this.hammer = new Hammer(drag);\n this.hammer.on('panstart', this._onDragStart.bind(this));\n this.hammer.on('panmove', this._onDrag.bind(this));\n this.hammer.on('panend', this._onDragEnd.bind(this));\n this.hammer.get('pan').set({threshold:5, direction: Hammer.DIRECTION_HORIZONTAL});\n};\n\n/**\n * Destroy the CustomTime bar\n */\nCustomTime.prototype.destroy = function () {\n this.hide();\n\n this.hammer.destroy();\n this.hammer = null;\n\n this.body = null;\n};\n\n/**\n * Repaint the component\n * @return {boolean} Returns true if the component is resized\n */\nCustomTime.prototype.redraw = function () {\n var parent = this.body.dom.backgroundVertical;\n if (this.bar.parentNode != parent) {\n // attach to the dom\n if (this.bar.parentNode) {\n this.bar.parentNode.removeChild(this.bar);\n }\n parent.appendChild(this.bar);\n }\n\n var x = this.body.util.toScreen(this.customTime);\n\n var locale = this.options.locales[this.options.locale];\n if (!locale) {\n if (!this.warned) {\n console.log('WARNING: options.locales[\\'' + this.options.locale + '\\'] not found. See http://visjs.org/docs/timeline/#Localization');\n this.warned = true;\n }\n locale = this.options.locales['en']; // fall back on english when not available\n }\n\n var title = this.options.title;\n // To hide the title completely use empty string ''.\n if (title === undefined) {\n title = locale.time + ': ' + this.options.moment(this.customTime).format('dddd, MMMM Do YYYY, H:mm:ss');\n title = title.charAt(0).toUpperCase() + title.substring(1);\n }\n\n this.bar.style.left = x + 'px';\n this.bar.title = title;\n\n return false;\n};\n\n/**\n * Remove the CustomTime from the DOM\n */\nCustomTime.prototype.hide = function () {\n // remove the line from the DOM\n if (this.bar.parentNode) {\n this.bar.parentNode.removeChild(this.bar);\n }\n};\n\n/**\n * Set custom time.\n * @param {Date | number | string} time\n */\nCustomTime.prototype.setCustomTime = function(time) {\n this.customTime = util.convert(time, 'Date');\n this.redraw();\n};\n\n/**\n * Retrieve the current custom time.\n * @return {Date} customTime\n */\nCustomTime.prototype.getCustomTime = function() {\n return new Date(this.customTime.valueOf());\n};\n\n/**\n * Set custom title.\n * @param {Date | number | string} title\n */\nCustomTime.prototype.setCustomTitle = function(title) {\n this.options.title = title;\n};\n\n/**\n * Start moving horizontally\n * @param {Event} event\n * @private\n */\nCustomTime.prototype._onDragStart = function(event) {\n this.eventParams.dragging = true;\n this.eventParams.customTime = this.customTime;\n\n event.stopPropagation();\n};\n\n/**\n * Perform moving operating.\n * @param {Event} event\n * @private\n */\nCustomTime.prototype._onDrag = function (event) {\n if (!this.eventParams.dragging) return;\n\n var x = this.body.util.toScreen(this.eventParams.customTime) + event.deltaX;\n var time = this.body.util.toTime(x);\n\n this.setCustomTime(time);\n\n // fire a timechange event\n this.body.emitter.emit('timechange', {\n id: this.options.id,\n time: new Date(this.customTime.valueOf()),\n event: util.elementsCensor(event)\n });\n\n event.stopPropagation();\n};\n\n/**\n * Stop moving operating.\n * @param {Event} event\n * @private\n */\nCustomTime.prototype._onDragEnd = function (event) {\n if (!this.eventParams.dragging) return;\n\n // fire a timechanged event\n this.body.emitter.emit('timechanged', {\n id: this.options.id,\n time: new Date(this.customTime.valueOf()),\n event: util.elementsCensor(event)\n });\n\n event.stopPropagation();\n};\n\n/**\n * Find a custom time from an event target:\n * searches for the attribute 'custom-time' in the event target's element tree\n * @param {Event} event\n * @return {CustomTime | null} customTime\n */\nCustomTime.customTimeFromTarget = function(event) {\n var target = event.target;\n while (target) {\n if (target.hasOwnProperty('custom-time')) {\n return target['custom-time'];\n }\n target = target.parentNode;\n }\n\n return null;\n};\n\nmodule.exports = CustomTime;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/timeline/component/CustomTime.js","// English\nexports['en'] = {\n current: 'current',\n time: 'time'\n};\nexports['en_EN'] = exports['en'];\nexports['en_US'] = exports['en'];\n\n// Italiano\nexports['it'] = {\n current: 'attuale',\n time: 'tempo'\n};\nexports['it_IT'] = exports['it'];\nexports['it_CH'] = exports['it'];\n\n// Dutch\nexports['nl'] = {\n current: 'huidige',\n time: 'tijd'\n};\nexports['nl_NL'] = exports['nl'];\nexports['nl_BE'] = exports['nl'];\n\n// German\nexports['de'] = {\n current: 'Aktuelle',\n time: 'Zeit'\n};\nexports['de_DE'] = exports['de'];\n\n\n\n// WEBPACK FOOTER //\n// ./lib/timeline/locales.js","var util = require('../../util');\nvar Component = require('./Component');\nvar moment = require('../../module/moment');\nvar locales = require('../locales');\n\n/**\n * A current time bar\n * @param {{range: Range, dom: Object, domProps: Object}} body\n * @param {Object} [options] Available parameters:\n * {Boolean} [showCurrentTime]\n * @constructor CurrentTime\n * @extends Component\n */\nfunction CurrentTime (body, options) {\n this.body = body;\n\n // default options\n this.defaultOptions = {\n rtl: false,\n showCurrentTime: true,\n\n moment: moment,\n locales: locales,\n locale: 'en'\n };\n this.options = util.extend({}, this.defaultOptions);\n this.offset = 0;\n\n this._create();\n\n this.setOptions(options);\n}\n\nCurrentTime.prototype = new Component();\n\n/**\n * Create the HTML DOM for the current time bar\n * @private\n */\nCurrentTime.prototype._create = function() {\n var bar = document.createElement('div');\n bar.className = 'vis-current-time';\n bar.style.position = 'absolute';\n bar.style.top = '0px';\n bar.style.height = '100%';\n\n this.bar = bar;\n};\n\n/**\n * Destroy the CurrentTime bar\n */\nCurrentTime.prototype.destroy = function () {\n this.options.showCurrentTime = false;\n this.redraw(); // will remove the bar from the DOM and stop refreshing\n\n this.body = null;\n};\n\n/**\n * Set options for the component. Options will be merged in current options.\n * @param {Object} options Available parameters:\n * {boolean} [showCurrentTime]\n */\nCurrentTime.prototype.setOptions = function(options) {\n if (options) {\n // copy all options that we know\n util.selectiveExtend(['rtl', 'showCurrentTime', 'moment', 'locale', 'locales'], this.options, options);\n }\n};\n\n/**\n * Repaint the component\n * @return {boolean} Returns true if the component is resized\n */\nCurrentTime.prototype.redraw = function() {\n if (this.options.showCurrentTime) {\n var parent = this.body.dom.backgroundVertical;\n if (this.bar.parentNode != parent) {\n // attach to the dom\n if (this.bar.parentNode) {\n this.bar.parentNode.removeChild(this.bar);\n }\n parent.appendChild(this.bar);\n\n this.start();\n }\n\n var now = this.options.moment(new Date().valueOf() + this.offset);\n var x = this.body.util.toScreen(now);\n\n var locale = this.options.locales[this.options.locale];\n if (!locale) {\n if (!this.warned) {\n console.log('WARNING: options.locales[\\'' + this.options.locale + '\\'] not found. See http://visjs.org/docs/timeline/#Localization');\n this.warned = true;\n }\n locale = this.options.locales['en']; // fall back on english when not available\n }\n var title = locale.current + ' ' + locale.time + ': ' + now.format('dddd, MMMM Do YYYY, H:mm:ss');\n title = title.charAt(0).toUpperCase() + title.substring(1);\n\n if (this.options.rtl) {\n this.bar.style.right = x + 'px';\n } else {\n this.bar.style.left = x + 'px';\n }\n this.bar.title = title;\n }\n else {\n // remove the line from the DOM\n if (this.bar.parentNode) {\n this.bar.parentNode.removeChild(this.bar);\n }\n this.stop();\n }\n\n return false;\n};\n\n/**\n * Start auto refreshing the current time bar\n */\nCurrentTime.prototype.start = function() {\n var me = this;\n\n function update () {\n me.stop();\n\n // determine interval to refresh\n var scale = me.body.range.conversion(me.body.domProps.center.width).scale;\n var interval = 1 / scale / 10;\n if (interval < 30) interval = 30;\n if (interval > 1000) interval = 1000;\n\n me.redraw();\n me.body.emitter.emit('currentTimeTick');\n\n // start a renderTimer to adjust for the new time\n me.currentTimeTimer = setTimeout(update, interval);\n }\n\n update();\n};\n\n/**\n * Stop auto refreshing the current time bar\n */\nCurrentTime.prototype.stop = function() {\n if (this.currentTimeTimer !== undefined) {\n clearTimeout(this.currentTimeTimer);\n delete this.currentTimeTimer;\n }\n};\n\n/**\n * Set a current time. This can be used for example to ensure that a client's\n * time is synchronized with a shared server time.\n * @param {Date | String | Number} time A Date, unix timestamp, or\n * ISO date string.\n */\nCurrentTime.prototype.setCurrentTime = function(time) {\n var t = util.convert(time, 'Date').valueOf();\n var now = new Date().valueOf();\n this.offset = t - now;\n this.redraw();\n};\n\n/**\n * Get the current time.\n * @return {Date} Returns the current time.\n */\nCurrentTime.prototype.getCurrentTime = function() {\n return new Date(new Date().valueOf() + this.offset);\n};\n\nmodule.exports = CurrentTime;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/timeline/component/CurrentTime.js","/**\n * This object contains all possible options. It will check if the types are correct, if required if the option is one\n * of the allowed values.\n *\n * __any__ means that the name of the property does not matter.\n * __type__ is a required field for all objects and contains the allowed types of all objects\n */\nlet string = 'string';\nlet bool = 'boolean';\nlet number = 'number';\nlet array = 'array';\nlet date = 'date';\nlet object = 'object'; // should only be in a __type__ property\nlet dom = 'dom';\nlet moment = 'moment';\nlet any = 'any';\n\nlet allOptions = {\n configure: {\n enabled: { 'boolean': bool},\n filter: { 'boolean': bool,'function': 'function'},\n container: {dom},\n __type__: {object, 'boolean': bool,'function': 'function'}\n },\n\n //globals :\n align: {string},\n rtl: { 'boolean': bool, 'undefined': 'undefined'},\n rollingMode: { 'boolean': bool, 'undefined': 'undefined'},\n verticalScroll: { 'boolean': bool, 'undefined': 'undefined'},\n horizontalScroll: { 'boolean': bool, 'undefined': 'undefined'},\n autoResize: { 'boolean': bool},\n throttleRedraw: {number}, // TODO: DEPRICATED see https://github.com/almende/vis/issues/2511\n clickToUse: { 'boolean': bool},\n dataAttributes: {string, array},\n editable: {\n add: { 'boolean': bool, 'undefined': 'undefined'},\n remove: { 'boolean': bool, 'undefined': 'undefined'},\n updateGroup: { 'boolean': bool, 'undefined': 'undefined'},\n updateTime: { 'boolean': bool, 'undefined': 'undefined'},\n overrideItems: { 'boolean': bool, 'undefined': 'undefined'},\n __type__: { 'boolean': bool, object}\n },\n end: {number, date, string, moment},\n format: {\n minorLabels: {\n millisecond: {string,'undefined': 'undefined'},\n second: {string,'undefined': 'undefined'},\n minute: {string,'undefined': 'undefined'},\n hour: {string,'undefined': 'undefined'},\n weekday: {string,'undefined': 'undefined'},\n day: {string,'undefined': 'undefined'},\n month: {string,'undefined': 'undefined'},\n year: {string,'undefined': 'undefined'},\n __type__: {object, 'function': 'function'}\n },\n majorLabels: {\n millisecond: {string,'undefined': 'undefined'},\n second: {string,'undefined': 'undefined'},\n minute: {string,'undefined': 'undefined'},\n hour: {string,'undefined': 'undefined'},\n weekday: {string,'undefined': 'undefined'},\n day: {string,'undefined': 'undefined'},\n month: {string,'undefined': 'undefined'},\n year: {string,'undefined': 'undefined'},\n __type__: {object, 'function': 'function'}\n },\n __type__: {object}\n },\n moment: {'function': 'function'},\n groupOrder: {string, 'function': 'function'},\n groupEditable: {\n\t add: { 'boolean': bool, 'undefined': 'undefined'},\n\t remove: { 'boolean': bool, 'undefined': 'undefined'},\n\t order: { 'boolean': bool, 'undefined': 'undefined'},\n\t __type__: { 'boolean': bool, object}\n },\n groupOrderSwap: {'function': 'function'},\n height: {string, number},\n hiddenDates: {\n start: {date, number, string, moment},\n end: {date, number, string, moment},\n repeat: {string},\n __type__: {object, array}\n },\n itemsAlwaysDraggable: { 'boolean': bool},\n locale:{string},\n locales:{\n __any__: {any},\n __type__: {object}\n },\n margin: {\n axis: {number},\n item: {\n horizontal: {number,'undefined': 'undefined'},\n vertical: {number,'undefined': 'undefined'},\n __type__: {object,number}\n },\n __type__: {object,number}\n },\n max: {date, number, string, moment},\n maxHeight: {number, string},\n maxMinorChars: {number},\n min: {date, number, string, moment},\n minHeight: {number, string},\n moveable: { 'boolean': bool},\n multiselect: { 'boolean': bool},\n multiselectPerGroup: { 'boolean': bool},\n onAdd: {'function': 'function'},\n onUpdate: {'function': 'function'},\n onMove: {'function': 'function'},\n onMoving: {'function': 'function'},\n onRemove: {'function': 'function'},\n onAddGroup: {'function': 'function'},\n onMoveGroup: {'function': 'function'},\n onRemoveGroup: {'function': 'function'},\n order: {'function': 'function'},\n orientation: {\n axis: {string,'undefined': 'undefined'},\n item: {string,'undefined': 'undefined'},\n __type__: {string, object}\n },\n selectable: { 'boolean': bool},\n showCurrentTime: { 'boolean': bool},\n showMajorLabels: { 'boolean': bool},\n showMinorLabels: { 'boolean': bool},\n stack: { 'boolean': bool},\n stackSubgroups: { 'boolean': bool},\n snap: {'function': 'function', 'null': 'null'},\n start: {date, number, string, moment},\n template: {'function': 'function'},\n groupTemplate: {'function': 'function'},\n visibleFrameTemplate: {string, 'function': 'function'},\n tooltip: {\n followMouse: { 'boolean': bool },\n overflowMethod: { 'string': ['cap', 'flip'] },\n __type__: {object}\n },\n tooltipOnItemUpdateTime: {\n template: {'function': 'function'},\n __type__: { 'boolean': bool, object}\n },\n timeAxis: {\n scale: {string,'undefined': 'undefined'},\n step: {number,'undefined': 'undefined'},\n __type__: {object}\n },\n type: {string},\n width: {string, number},\n zoomable: { 'boolean': bool},\n zoomKey: {string: ['ctrlKey', 'altKey', 'metaKey', '']},\n zoomMax: {number},\n zoomMin: {number},\n\n __type__: {object}\n};\n\nlet configureOptions = {\n global: {\n align: ['center', 'left', 'right'],\n direction: false,\n autoResize: true,\n clickToUse: false,\n // dataAttributes: ['all'], // FIXME: can be 'all' or string[]\n editable: {\n add: false,\n remove: false,\n updateGroup: false,\n updateTime: false\n },\n end: '',\n format: {\n minorLabels: {\n millisecond:'SSS',\n second: 's',\n minute: 'HH:mm',\n hour: 'HH:mm',\n weekday: 'ddd D',\n day: 'D',\n month: 'MMM',\n year: 'YYYY'\n },\n majorLabels: {\n millisecond:'HH:mm:ss',\n second: 'D MMMM HH:mm',\n minute: 'ddd D MMMM',\n hour: 'ddd D MMMM',\n weekday: 'MMMM YYYY',\n day: 'MMMM YYYY',\n month: 'YYYY',\n year: ''\n }\n },\n\n //groupOrder: {string, 'function': 'function'},\n groupsDraggable: false,\n height: '',\n //hiddenDates: {object, array},\n locale: '',\n margin: {\n axis: [20, 0, 100, 1],\n item: {\n horizontal: [10, 0, 100, 1],\n vertical: [10, 0, 100, 1]\n }\n },\n max: '',\n maxHeight: '',\n maxMinorChars: [7, 0, 20, 1],\n min: '',\n minHeight: '',\n moveable: false,\n multiselect: false,\n multiselectPerGroup: false,\n //onAdd: {'function': 'function'},\n //onUpdate: {'function': 'function'},\n //onMove: {'function': 'function'},\n //onMoving: {'function': 'function'},\n //onRename: {'function': 'function'},\n //order: {'function': 'function'},\n orientation: {\n axis: ['both', 'bottom', 'top'],\n item: ['bottom', 'top']\n },\n selectable: true,\n showCurrentTime: false,\n showMajorLabels: true,\n showMinorLabels: true,\n stack: true,\n stackSubgroups: true,\n //snap: {'function': 'function', nada},\n start: '',\n //template: {'function': 'function'},\n //timeAxis: {\n // scale: ['millisecond', 'second', 'minute', 'hour', 'weekday', 'day', 'month', 'year'],\n // step: [1, 1, 10, 1]\n //},\n tooltip: {\n followMouse: false,\n overflowMethod: 'flip'\n },\n tooltipOnItemUpdateTime: false,\n type: ['box', 'point', 'range', 'background'],\n width: '100%',\n zoomable: true,\n zoomKey: ['ctrlKey', 'altKey', 'metaKey', ''],\n zoomMax: [315360000000000, 10, 315360000000000, 1],\n zoomMin: [10, 10, 315360000000000, 1]\n }\n};\n\nexport {allOptions, configureOptions};\n\n\n\n// WEBPACK FOOTER //\n// ./lib/timeline/optionsTimeline.js","var Emitter = require('emitter-component');\nvar Hammer = require('../module/hammer');\nvar moment = require('../module/moment');\nvar util = require('../util');\nvar DataSet = require('../DataSet');\nvar DataView = require('../DataView');\nvar Range = require('./Range');\nvar Core = require('./Core');\nvar TimeAxis = require('./component/TimeAxis');\nvar CurrentTime = require('./component/CurrentTime');\nvar CustomTime = require('./component/CustomTime');\nvar LineGraph = require('./component/LineGraph');\n\nvar printStyle = require('../shared/Validator').printStyle;\nvar allOptions = require('./optionsGraph2d').allOptions;\nvar configureOptions = require('./optionsGraph2d').configureOptions;\n\nimport Configurator from '../shared/Configurator';\nimport Validator from '../shared/Validator';\n\n/**\n * Create a timeline visualization\n * @param {HTMLElement} container\n * @param {vis.DataSet | Array} [items]\n * @param {Object} [options] See Graph2d.setOptions for the available options.\n * @constructor\n * @extends Core\n */\nfunction Graph2d (container, items, groups, options) {\n // if the third element is options, the forth is groups (optionally);\n if (!(Array.isArray(groups) || groups instanceof DataSet || groups instanceof DataView) && groups instanceof Object) {\n var forthArgument = options;\n options = groups;\n groups = forthArgument;\n }\n\n // TODO: REMOVE THIS in the next MAJOR release\n // see https://github.com/almende/vis/issues/2511\n if (options && options.throttleRedraw) {\n console.warn(\"Graph2d option \\\"throttleRedraw\\\" is DEPRICATED and no longer supported. It will be removed in the next MAJOR release.\");\n }\n\n var me = this;\n this.defaultOptions = {\n start: null,\n end: null,\n\n autoResize: true,\n\n orientation: {\n axis: 'bottom', // axis orientation: 'bottom', 'top', or 'both'\n item: 'bottom' // not relevant for Graph2d\n },\n\n moment: moment,\n\n width: null,\n height: null,\n maxHeight: null,\n minHeight: null\n };\n this.options = util.deepExtend({}, this.defaultOptions);\n\n // Create the DOM, props, and emitter\n this._create(container);\n\n // all components listed here will be repainted automatically\n this.components = [];\n\n this.body = {\n dom: this.dom,\n domProps: this.props,\n emitter: {\n on: this.on.bind(this),\n off: this.off.bind(this),\n emit: this.emit.bind(this)\n },\n hiddenDates: [],\n util: {\n toScreen: me._toScreen.bind(me),\n toGlobalScreen: me._toGlobalScreen.bind(me), // this refers to the root.width\n toTime: me._toTime.bind(me),\n toGlobalTime : me._toGlobalTime.bind(me)\n }\n };\n\n // range\n this.range = new Range(this.body);\n this.components.push(this.range);\n this.body.range = this.range;\n\n // time axis\n this.timeAxis = new TimeAxis(this.body);\n this.components.push(this.timeAxis);\n //this.body.util.snap = this.timeAxis.snap.bind(this.timeAxis);\n\n // current time bar\n this.currentTime = new CurrentTime(this.body);\n this.components.push(this.currentTime);\n\n // item set\n this.linegraph = new LineGraph(this.body);\n\n this.components.push(this.linegraph);\n\n this.itemsData = null; // DataSet\n this.groupsData = null; // DataSet\n\n\n this.on('tap', function (event) {\n me.emit('click', me.getEventProperties(event))\n });\n this.on('doubletap', function (event) {\n me.emit('doubleClick', me.getEventProperties(event))\n });\n this.dom.root.oncontextmenu = function (event) {\n me.emit('contextmenu', me.getEventProperties(event))\n };\n\n // apply options\n if (options) {\n this.setOptions(options);\n }\n\n // IMPORTANT: THIS HAPPENS BEFORE SET ITEMS!\n if (groups) {\n this.setGroups(groups);\n }\n\n // create itemset\n if (items) {\n this.setItems(items);\n }\n\n // draw for the first time\n this._redraw();\n}\n\n// Extend the functionality from Core\nGraph2d.prototype = new Core();\n\nGraph2d.prototype.setOptions = function (options) {\n // validate options\n let errorFound = Validator.validate(options, allOptions);\n if (errorFound === true) {\n console.log('%cErrors have been found in the supplied options object.', printStyle);\n }\n\n Core.prototype.setOptions.call(this, options);\n};\n\n/**\n * Set items\n * @param {vis.DataSet | Array | null} items\n */\nGraph2d.prototype.setItems = function(items) {\n var initialLoad = (this.itemsData == null);\n\n // convert to type DataSet when needed\n var newDataSet;\n if (!items) {\n newDataSet = null;\n }\n else if (items instanceof DataSet || items instanceof DataView) {\n newDataSet = items;\n }\n else {\n // turn an array into a dataset\n newDataSet = new DataSet(items, {\n type: {\n start: 'Date',\n end: 'Date'\n }\n });\n }\n\n // set items\n this.itemsData = newDataSet;\n this.linegraph && this.linegraph.setItems(newDataSet);\n\n if (initialLoad) {\n if (this.options.start != undefined || this.options.end != undefined) {\n var start = this.options.start != undefined ? this.options.start : null;\n var end = this.options.end != undefined ? this.options.end : null;\n this.setWindow(start, end, {animation: false});\n }\n else {\n this.fit({animation: false});\n }\n }\n};\n\n/**\n * Set groups\n * @param {vis.DataSet | Array} groups\n */\nGraph2d.prototype.setGroups = function(groups) {\n // convert to type DataSet when needed\n var newDataSet;\n if (!groups) {\n newDataSet = null;\n }\n else if (groups instanceof DataSet || groups instanceof DataView) {\n newDataSet = groups;\n }\n else {\n // turn an array into a dataset\n newDataSet = new DataSet(groups);\n }\n\n this.groupsData = newDataSet;\n this.linegraph.setGroups(newDataSet);\n};\n\n/**\n * Returns an object containing an SVG element with the icon of the group (size determined by iconWidth and iconHeight), the label of the group (content) and the yAxisOrientation of the group (left or right).\n * @param groupId\n * @param width\n * @param height\n */\nGraph2d.prototype.getLegend = function(groupId, width, height) {\n if (width === undefined) {width = 15;}\n if (height === undefined) {height = 15;}\n if (this.linegraph.groups[groupId] !== undefined) {\n return this.linegraph.groups[groupId].getLegend(width,height);\n }\n else {\n return \"cannot find group:'\" + groupId + \"'\";\n }\n};\n\n/**\n * This checks if the visible option of the supplied group (by ID) is true or false.\n * @param groupId\n * @returns {*}\n */\nGraph2d.prototype.isGroupVisible = function(groupId) {\n if (this.linegraph.groups[groupId] !== undefined) {\n return (this.linegraph.groups[groupId].visible && (this.linegraph.options.groups.visibility[groupId] === undefined || this.linegraph.options.groups.visibility[groupId] == true));\n }\n else {\n return false;\n }\n};\n\n\n/**\n * Get the data range of the item set.\n * @returns {{min: Date, max: Date}} range A range with a start and end Date.\n * When no minimum is found, min==null\n * When no maximum is found, max==null\n */\nGraph2d.prototype.getDataRange = function() {\n var min = null;\n var max = null;\n\n // calculate min from start filed\n for (var groupId in this.linegraph.groups) {\n if (this.linegraph.groups.hasOwnProperty(groupId)) {\n if (this.linegraph.groups[groupId].visible == true) {\n for (var i = 0; i < this.linegraph.groups[groupId].itemsData.length; i++) {\n var item = this.linegraph.groups[groupId].itemsData[i];\n var value = util.convert(item.x, 'Date').valueOf();\n min = min == null ? value : min > value ? value : min;\n max = max == null ? value : max < value ? value : max;\n }\n }\n }\n }\n\n return {\n min: (min != null) ? new Date(min) : null,\n max: (max != null) ? new Date(max) : null\n };\n};\n\n\n/**\n * Generate Timeline related information from an event\n * @param {Event} event\n * @return {Object} An object with related information, like on which area\n * The event happened, whether clicked on an item, etc.\n */\nGraph2d.prototype.getEventProperties = function (event) {\n var clientX = event.center ? event.center.x : event.clientX;\n var clientY = event.center ? event.center.y : event.clientY;\n var x = clientX - util.getAbsoluteLeft(this.dom.centerContainer);\n var y = clientY - util.getAbsoluteTop(this.dom.centerContainer);\n var time = this._toTime(x);\n\n var customTime = CustomTime.customTimeFromTarget(event);\n\n var element = util.getTarget(event);\n var what = null;\n if (util.hasParent(element, this.timeAxis.dom.foreground)) {what = 'axis';}\n else if (this.timeAxis2 && util.hasParent(element, this.timeAxis2.dom.foreground)) {what = 'axis';}\n else if (util.hasParent(element, this.linegraph.yAxisLeft.dom.frame)) {what = 'data-axis';}\n else if (util.hasParent(element, this.linegraph.yAxisRight.dom.frame)) {what = 'data-axis';}\n else if (util.hasParent(element, this.linegraph.legendLeft.dom.frame)) {what = 'legend';}\n else if (util.hasParent(element, this.linegraph.legendRight.dom.frame)) {what = 'legend';}\n else if (customTime != null) {what = 'custom-time';}\n else if (util.hasParent(element, this.currentTime.bar)) {what = 'current-time';}\n else if (util.hasParent(element, this.dom.center)) {what = 'background';}\n\n var value = [];\n var yAxisLeft = this.linegraph.yAxisLeft;\n var yAxisRight = this.linegraph.yAxisRight;\n if (!yAxisLeft.hidden && this.itemsData.length > 0) {\n value.push(yAxisLeft.screenToValue(y));\n }\n if (!yAxisRight.hidden && this.itemsData.length > 0) {\n value.push(yAxisRight.screenToValue(y));\n }\n\n return {\n event: event,\n what: what,\n pageX: event.srcEvent ? event.srcEvent.pageX : event.pageX,\n pageY: event.srcEvent ? event.srcEvent.pageY : event.pageY,\n x: x,\n y: y,\n time: time,\n value: value\n }\n};\n\n/**\n * Load a configurator\n * @return {Object}\n * @private\n */\nGraph2d.prototype._createConfigurator = function () {\n return new Configurator(this, this.dom.container, configureOptions);\n};\n\n\nmodule.exports = Graph2d;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/timeline/Graph2d.js","var util = require('../../util');\nvar DOMutil = require('../../DOMutil');\nvar DataSet = require('../../DataSet');\nvar DataView = require('../../DataView');\nvar Component = require('./Component');\nvar DataAxis = require('./DataAxis');\nvar GraphGroup = require('./GraphGroup');\nvar Legend = require('./Legend');\nvar Bars = require('./graph2d_types/bar');\nvar Lines = require('./graph2d_types/line');\nvar Points = require('./graph2d_types/points');\n\nvar UNGROUPED = '__ungrouped__'; // reserved group id for ungrouped items\n\n/**\n * This is the constructor of the LineGraph. It requires a Timeline body and options.\n *\n * @param body\n * @param options\n * @constructor\n */\nfunction LineGraph(body, options) {\n this.id = util.randomUUID();\n this.body = body;\n\n this.defaultOptions = {\n yAxisOrientation: 'left',\n defaultGroup: 'default',\n sort: true,\n sampling: true,\n stack: false,\n graphHeight: '400px',\n shaded: {\n enabled: false,\n orientation: 'bottom' // top, bottom, zero\n },\n style: 'line', // line, bar\n barChart: {\n width: 50,\n sideBySide: false,\n align: 'center' // left, center, right\n },\n interpolation: {\n enabled: true,\n parametrization: 'centripetal', // uniform (alpha = 0.0), chordal (alpha = 1.0), centripetal (alpha = 0.5)\n alpha: 0.5\n },\n drawPoints: {\n enabled: true,\n size: 6,\n style: 'square' // square, circle\n },\n dataAxis: {}, //Defaults are done on DataAxis level\n legend: {}, //Defaults are done on Legend level\n groups: {\n visibility: {}\n }\n };\n\n // options is shared by this lineGraph and all its items\n this.options = util.extend({}, this.defaultOptions);\n this.dom = {};\n this.props = {};\n this.hammer = null;\n this.groups = {};\n this.abortedGraphUpdate = false;\n this.updateSVGheight = false;\n this.updateSVGheightOnResize = false;\n this.forceGraphUpdate = true;\n\n var me = this;\n this.itemsData = null; // DataSet\n this.groupsData = null; // DataSet\n\n // listeners for the DataSet of the items\n this.itemListeners = {\n 'add': function (event, params, senderId) {\n me._onAdd(params.items);\n },\n 'update': function (event, params, senderId) {\n me._onUpdate(params.items);\n },\n 'remove': function (event, params, senderId) {\n me._onRemove(params.items);\n }\n };\n\n // listeners for the DataSet of the groups\n this.groupListeners = {\n 'add': function (event, params, senderId) {\n me._onAddGroups(params.items);\n },\n 'update': function (event, params, senderId) {\n me._onUpdateGroups(params.items);\n },\n 'remove': function (event, params, senderId) {\n me._onRemoveGroups(params.items);\n }\n };\n\n this.items = {}; // object with an Item for every data item\n this.selection = []; // list with the ids of all selected nodes\n this.lastStart = this.body.range.start;\n this.touchParams = {}; // stores properties while dragging\n\n this.svgElements = {};\n this.setOptions(options);\n this.groupsUsingDefaultStyles = [0];\n this.body.emitter.on('rangechanged', function () {\n me.lastStart = me.body.range.start;\n me.svg.style.left = util.option.asSize(-me.props.width);\n\n me.forceGraphUpdate = true;\n //Is this local redraw necessary? (Core also does a change event!)\n me.redraw.call(me);\n });\n\n // create the HTML DOM\n this._create();\n this.framework = {svg: this.svg, svgElements: this.svgElements, options: this.options, groups: this.groups};\n}\n\nLineGraph.prototype = new Component();\n\n/**\n * Create the HTML DOM for the ItemSet\n */\nLineGraph.prototype._create = function () {\n var frame = document.createElement('div');\n frame.className = 'vis-line-graph';\n this.dom.frame = frame;\n\n // create svg element for graph drawing.\n this.svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n this.svg.style.position = 'relative';\n this.svg.style.height = ('' + this.options.graphHeight).replace('px', '') + 'px';\n this.svg.style.display = 'block';\n frame.appendChild(this.svg);\n\n // data axis\n this.options.dataAxis.orientation = 'left';\n this.yAxisLeft = new DataAxis(this.body, this.options.dataAxis, this.svg, this.options.groups);\n\n this.options.dataAxis.orientation = 'right';\n this.yAxisRight = new DataAxis(this.body, this.options.dataAxis, this.svg, this.options.groups);\n delete this.options.dataAxis.orientation;\n\n // legends\n this.legendLeft = new Legend(this.body, this.options.legend, 'left', this.options.groups);\n this.legendRight = new Legend(this.body, this.options.legend, 'right', this.options.groups);\n\n this.show();\n};\n\n/**\n * set the options of the LineGraph. the mergeOptions is used for subObjects that have an enabled element.\n * @param {object} options\n */\nLineGraph.prototype.setOptions = function (options) {\n if (options) {\n var fields = ['sampling', 'defaultGroup', 'stack', 'height', 'graphHeight', 'yAxisOrientation', 'style', 'barChart', 'dataAxis', 'sort', 'groups'];\n if (options.graphHeight === undefined && options.height !== undefined) {\n this.updateSVGheight = true;\n this.updateSVGheightOnResize = true;\n }\n else if (this.body.domProps.centerContainer.height !== undefined && options.graphHeight !== undefined) {\n if (parseInt((options.graphHeight + '').replace(\"px\", '')) < this.body.domProps.centerContainer.height) {\n this.updateSVGheight = true;\n }\n }\n util.selectiveDeepExtend(fields, this.options, options);\n util.mergeOptions(this.options, options, 'interpolation');\n util.mergeOptions(this.options, options, 'drawPoints');\n util.mergeOptions(this.options, options, 'shaded');\n util.mergeOptions(this.options, options, 'legend');\n\n if (options.interpolation) {\n if (typeof options.interpolation == 'object') {\n if (options.interpolation.parametrization) {\n if (options.interpolation.parametrization == 'uniform') {\n this.options.interpolation.alpha = 0;\n }\n else if (options.interpolation.parametrization == 'chordal') {\n this.options.interpolation.alpha = 1.0;\n }\n else {\n this.options.interpolation.parametrization = 'centripetal';\n this.options.interpolation.alpha = 0.5;\n }\n }\n }\n }\n\n if (this.yAxisLeft) {\n if (options.dataAxis !== undefined) {\n this.yAxisLeft.setOptions(this.options.dataAxis);\n this.yAxisRight.setOptions(this.options.dataAxis);\n }\n }\n\n if (this.legendLeft) {\n if (options.legend !== undefined) {\n this.legendLeft.setOptions(this.options.legend);\n this.legendRight.setOptions(this.options.legend);\n }\n }\n\n if (this.groups.hasOwnProperty(UNGROUPED)) {\n this.groups[UNGROUPED].setOptions(options);\n }\n }\n\n // this is used to redraw the graph if the visibility of the groups is changed.\n if (this.dom.frame) { //not on initial run?\n this.forceGraphUpdate=true;\n this.body.emitter.emit(\"_change\",{queue: true});\n }\n};\n\n/**\n * Hide the component from the DOM\n */\nLineGraph.prototype.hide = function () {\n // remove the frame containing the items\n if (this.dom.frame.parentNode) {\n this.dom.frame.parentNode.removeChild(this.dom.frame);\n }\n};\n\n\n/**\n * Show the component in the DOM (when not already visible).\n * @return {Boolean} changed\n */\nLineGraph.prototype.show = function () {\n // show frame containing the items\n if (!this.dom.frame.parentNode) {\n this.body.dom.center.appendChild(this.dom.frame);\n }\n};\n\n\n/**\n * Set items\n * @param {vis.DataSet | null} items\n */\nLineGraph.prototype.setItems = function (items) {\n var me = this,\n ids,\n oldItemsData = this.itemsData;\n\n // replace the dataset\n if (!items) {\n this.itemsData = null;\n }\n else if (items instanceof DataSet || items instanceof DataView) {\n this.itemsData = items;\n }\n else {\n throw new TypeError('Data must be an instance of DataSet or DataView');\n }\n\n if (oldItemsData) {\n // unsubscribe from old dataset\n util.forEach(this.itemListeners, function (callback, event) {\n oldItemsData.off(event, callback);\n });\n\n // remove all drawn items\n ids = oldItemsData.getIds();\n this._onRemove(ids);\n }\n\n if (this.itemsData) {\n // subscribe to new dataset\n var id = this.id;\n util.forEach(this.itemListeners, function (callback, event) {\n me.itemsData.on(event, callback, id);\n });\n\n // add all new items\n ids = this.itemsData.getIds();\n this._onAdd(ids);\n }\n};\n\n\n/**\n * Set groups\n * @param {vis.DataSet} groups\n */\nLineGraph.prototype.setGroups = function (groups) {\n var me = this;\n var ids;\n\n // unsubscribe from current dataset\n if (this.groupsData) {\n util.forEach(this.groupListeners, function (callback, event) {\n me.groupsData.off(event, callback);\n });\n\n // remove all drawn groups\n ids = this.groupsData.getIds();\n this.groupsData = null;\n for (var i = 0; i < ids.length; i++) {\n this._removeGroup(ids[i]);\n }\n }\n\n // replace the dataset\n if (!groups) {\n this.groupsData = null;\n }\n else if (groups instanceof DataSet || groups instanceof DataView) {\n this.groupsData = groups;\n }\n else {\n throw new TypeError('Data must be an instance of DataSet or DataView');\n }\n\n if (this.groupsData) {\n // subscribe to new dataset\n var id = this.id;\n util.forEach(this.groupListeners, function (callback, event) {\n me.groupsData.on(event, callback, id);\n });\n\n // draw all ms\n ids = this.groupsData.getIds();\n this._onAddGroups(ids);\n }\n};\n\nLineGraph.prototype._onUpdate = function (ids) {\n this._updateAllGroupData(ids);\n};\nLineGraph.prototype._onAdd = function (ids) {\n this._onUpdate(ids);\n};\nLineGraph.prototype._onRemove = function (ids) {\n this._onUpdate(ids);\n};\nLineGraph.prototype._onUpdateGroups = function (groupIds) {\n this._updateAllGroupData(null, groupIds);\n};\nLineGraph.prototype._onAddGroups = function (groupIds) {\n this._onUpdateGroups(groupIds);\n};\n\n/**\n * this cleans the group out off the legends and the dataaxis, updates the ungrouped and updates the graph\n * @param {Array} groupIds\n * @private\n */\nLineGraph.prototype._onRemoveGroups = function (groupIds) {\n for (var i = 0; i < groupIds.length; i++) {\n this._removeGroup(groupIds[i]);\n }\n this.forceGraphUpdate = true;\n this.body.emitter.emit(\"_change\",{queue: true});\n};\n\n/**\n * this cleans the group out off the legends and the dataaxis\n * @param groupId\n * @private\n */\nLineGraph.prototype._removeGroup = function (groupId) {\n if (this.groups.hasOwnProperty(groupId)) {\n if (this.groups[groupId].options.yAxisOrientation == 'right') {\n this.yAxisRight.removeGroup(groupId);\n this.legendRight.removeGroup(groupId);\n this.legendRight.redraw();\n }\n else {\n this.yAxisLeft.removeGroup(groupId);\n this.legendLeft.removeGroup(groupId);\n this.legendLeft.redraw();\n }\n delete this.groups[groupId];\n }\n}\n\n/**\n * update a group object with the group dataset entree\n *\n * @param group\n * @param groupId\n * @private\n */\nLineGraph.prototype._updateGroup = function (group, groupId) {\n if (!this.groups.hasOwnProperty(groupId)) {\n this.groups[groupId] = new GraphGroup(group, groupId, this.options, this.groupsUsingDefaultStyles);\n if (this.groups[groupId].options.yAxisOrientation == 'right') {\n this.yAxisRight.addGroup(groupId, this.groups[groupId]);\n this.legendRight.addGroup(groupId, this.groups[groupId]);\n }\n else {\n this.yAxisLeft.addGroup(groupId, this.groups[groupId]);\n this.legendLeft.addGroup(groupId, this.groups[groupId]);\n }\n }\n else {\n this.groups[groupId].update(group);\n if (this.groups[groupId].options.yAxisOrientation == 'right') {\n this.yAxisRight.updateGroup(groupId, this.groups[groupId]);\n this.legendRight.updateGroup(groupId, this.groups[groupId]);\n //If yAxisOrientation changed, clean out the group from the other axis.\n this.yAxisLeft.removeGroup(groupId);\n this.legendLeft.removeGroup(groupId);\n }\n else {\n this.yAxisLeft.updateGroup(groupId, this.groups[groupId]);\n this.legendLeft.updateGroup(groupId, this.groups[groupId]);\n //If yAxisOrientation changed, clean out the group from the other axis.\n this.yAxisRight.removeGroup(groupId);\n this.legendRight.removeGroup(groupId);\n }\n }\n this.legendLeft.redraw();\n this.legendRight.redraw();\n};\n\n\n/**\n * this updates all groups, it is used when there is an update the the itemset.\n *\n * @param {Array} ids\n * @param {Array} groupIds\n * @private\n */\nLineGraph.prototype._updateAllGroupData = function (ids, groupIds) {\n if (this.itemsData != null) {\n var groupsContent = {};\n var items = this.itemsData.get();\n var fieldId = this.itemsData._fieldId;\n var idMap = {};\n if (ids){\n ids.map(function (id) {\n idMap[id] = id;\n });\n }\n\n //pre-Determine array sizes, for more efficient memory claim\n var groupCounts = {};\n for (var i = 0; i < items.length; i++) {\n var item = items[i];\n var groupId = item.group;\n if (groupId === null || groupId === undefined) {\n groupId = UNGROUPED;\n }\n groupCounts.hasOwnProperty(groupId) ? groupCounts[groupId]++ : groupCounts[groupId] = 1;\n }\n\n //Pre-load arrays from existing groups if items are not changed (not in ids)\n if (!groupIds && ids) {\n for (var groupId in this.groups) {\n if (this.groups.hasOwnProperty(groupId)) {\n var group = this.groups[groupId];\n var existing_items = group.getItems();\n\n groupsContent[groupId] = existing_items.filter(function (item) {\n return (item[fieldId] !== idMap[item[fieldId]]);\n });\n var newLength = groupCounts[groupId];\n groupCounts[groupId] -= groupsContent[groupId].length;\n if (groupsContent[groupId].length < newLength) {\n groupsContent[groupId][newLength - 1] = {};\n }\n }\n }\n }\n\n //Now insert data into the arrays.\n for (var i = 0; i < items.length; i++) {\n var item = items[i];\n var groupId = item.group;\n if (groupId === null || groupId === undefined) {\n groupId = UNGROUPED;\n }\n if (!groupIds && ids && (item[fieldId] !== idMap[item[fieldId]])) {\n continue;\n }\n if (!groupsContent.hasOwnProperty(groupId)) {\n groupsContent[groupId] = new Array(groupCounts[groupId]);\n }\n //Copy data (because of unmodifiable DataView input.\n var extended = util.bridgeObject(item);\n extended.x = util.convert(item.x, 'Date');\n extended.orginalY = item.y; //real Y\n extended.y = Number(item.y);\n extended[fieldId] = item[fieldId];\n\n var index= groupsContent[groupId].length - groupCounts[groupId]--;\n groupsContent[groupId][index] = extended;\n }\n\n //Make sure all groups are present, to allow removal of old groups\n for (var groupId in this.groups){\n if (this.groups.hasOwnProperty(groupId)){\n if (!groupsContent.hasOwnProperty(groupId)) {\n groupsContent[groupId] = new Array(0);\n }\n }\n }\n\n //Update legendas, style and axis\n for (var groupId in groupsContent) {\n if (groupsContent.hasOwnProperty(groupId)) {\n if (groupsContent[groupId].length == 0) {\n if (this.groups.hasOwnProperty(groupId)) {\n this._removeGroup(groupId);\n }\n } else {\n var group = undefined;\n if (this.groupsData != undefined) {\n group = this.groupsData.get(groupId);\n }\n if (group == undefined) {\n group = {id: groupId, content: this.options.defaultGroup + groupId};\n }\n this._updateGroup(group, groupId);\n this.groups[groupId].setItems(groupsContent[groupId]);\n }\n }\n }\n this.forceGraphUpdate = true;\n this.body.emitter.emit(\"_change\",{queue: true});\n }\n};\n\n/**\n * Redraw the component, mandatory function\n * @return {boolean} Returns true if the component is resized\n */\nLineGraph.prototype.redraw = function () {\n var resized = false;\n\n // calculate actual size and position\n this.props.width = this.dom.frame.offsetWidth;\n this.props.height = this.body.domProps.centerContainer.height\n - this.body.domProps.border.top\n - this.body.domProps.border.bottom;\n\n // check if this component is resized\n resized = this._isResized() || resized;\n\n // check whether zoomed (in that case we need to re-stack everything)\n var visibleInterval = this.body.range.end - this.body.range.start;\n var zoomed = (visibleInterval != this.lastVisibleInterval);\n this.lastVisibleInterval = visibleInterval;\n\n\n // the svg element is three times as big as the width, this allows for fully dragging left and right\n // without reloading the graph. the controls for this are bound to events in the constructor\n if (resized == true) {\n this.svg.style.width = util.option.asSize(3 * this.props.width);\n this.svg.style.left = util.option.asSize(-this.props.width);\n\n // if the height of the graph is set as proportional, change the height of the svg\n if ((this.options.height + '').indexOf(\"%\") != -1 || this.updateSVGheightOnResize == true) {\n this.updateSVGheight = true;\n }\n }\n\n // update the height of the graph on each redraw of the graph.\n if (this.updateSVGheight == true) {\n if (this.options.graphHeight != this.props.height + 'px') {\n this.options.graphHeight = this.props.height + 'px';\n this.svg.style.height = this.props.height + 'px';\n }\n this.updateSVGheight = false;\n }\n else {\n this.svg.style.height = ('' + this.options.graphHeight).replace('px', '') + 'px';\n }\n\n // zoomed is here to ensure that animations are shown correctly.\n if (resized == true || zoomed == true || this.abortedGraphUpdate == true || this.forceGraphUpdate == true) {\n resized = this._updateGraph() || resized;\n this.forceGraphUpdate = false;\n }\n else {\n // move the whole svg while dragging\n if (this.lastStart != 0) {\n var offset = this.body.range.start - this.lastStart;\n var range = this.body.range.end - this.body.range.start;\n if (this.props.width != 0) {\n var rangePerPixelInv = this.props.width / range;\n var xOffset = offset * rangePerPixelInv;\n this.svg.style.left = (-this.props.width - xOffset) + 'px';\n }\n }\n }\n this.legendLeft.redraw();\n this.legendRight.redraw();\n return resized;\n};\n\n\nLineGraph.prototype._getSortedGroupIds = function(){\n // getting group Ids\n var grouplist = [];\n for (var groupId in this.groups) {\n if (this.groups.hasOwnProperty(groupId)) {\n var group = this.groups[groupId];\n if (group.visible == true && (this.options.groups.visibility[groupId] === undefined || this.options.groups.visibility[groupId] == true)) {\n grouplist.push({id:groupId,zIndex:group.options.zIndex});\n }\n }\n }\n util.insertSort(grouplist,function(a,b){\n var az = a.zIndex;\n var bz = b.zIndex;\n if (az === undefined) az=0;\n if (bz === undefined) bz=0;\n return az==bz? 0: (az 0) {\n var groupsData = {};\n\n // fill groups data, this only loads the data we require based on the timewindow\n this._getRelevantData(groupIds, groupsData, minDate, maxDate);\n\n // apply sampling, if disabled, it will pass through this function.\n this._applySampling(groupIds, groupsData);\n\n // we transform the X coordinates to detect collisions\n for (i = 0; i < groupIds.length; i++) {\n this._convertXcoordinates(groupsData[groupIds[i]]);\n }\n\n // now all needed data has been collected we start the processing.\n this._getYRanges(groupIds, groupsData, groupRanges);\n\n // update the Y axis first, we use this data to draw at the correct Y points\n changeCalled = this._updateYAxis(groupIds, groupRanges);\n\n // at changeCalled, abort this update cycle as the graph needs another update with new Width input from the Redraw container.\n // Cleanup SVG elements on abort.\n if (changeCalled == true) {\n DOMutil.cleanupElements(this.svgElements);\n this.abortedGraphUpdate = true;\n return true;\n }\n this.abortedGraphUpdate = false;\n\n // With the yAxis scaled correctly, use this to get the Y values of the points.\n var below = undefined;\n for (i = 0; i < groupIds.length; i++) {\n group = this.groups[groupIds[i]];\n if (this.options.stack === true && this.options.style === 'line') {\n if (group.options.excludeFromStacking == undefined || !group.options.excludeFromStacking) {\n if (below != undefined) {\n this._stack(groupsData[group.id], groupsData[below.id]);\n if (group.options.shaded.enabled == true && group.options.shaded.orientation !== \"group\"){\n if (group.options.shaded.orientation == \"top\" && below.options.shaded.orientation !== \"group\"){\n below.options.shaded.orientation=\"group\";\n below.options.shaded.groupId=group.id;\n } else {\n group.options.shaded.orientation=\"group\";\n group.options.shaded.groupId=below.id;\n }\n }\n }\n below = group;\n }\n }\n this._convertYcoordinates(groupsData[groupIds[i]], group);\n }\n\n //Precalculate paths and draw shading if appropriate. This will make sure the shading is always behind any lines.\n var paths = {};\n for (i = 0; i < groupIds.length; i++) {\n group = this.groups[groupIds[i]];\n if (group.options.style === 'line' && group.options.shaded.enabled == true) {\n var dataset = groupsData[groupIds[i]];\n if (dataset == null || dataset.length == 0) {\n continue;\n }\n if (!paths.hasOwnProperty(groupIds[i])) {\n paths[groupIds[i]] = Lines.calcPath(dataset, group);\n }\n if (group.options.shaded.orientation === \"group\") {\n var subGroupId = group.options.shaded.groupId;\n if (groupIds.indexOf(subGroupId) === -1) {\n console.log(group.id + \": Unknown shading group target given:\" + subGroupId);\n continue;\n }\n if (!paths.hasOwnProperty(subGroupId)) {\n paths[subGroupId] = Lines.calcPath(groupsData[subGroupId], this.groups[subGroupId]);\n }\n Lines.drawShading(paths[groupIds[i]], group, paths[subGroupId], this.framework);\n }\n else {\n Lines.drawShading(paths[groupIds[i]], group, undefined, this.framework);\n }\n }\n }\n\n // draw the groups, calculating paths if still necessary.\n Bars.draw(groupIds, groupsData, this.framework);\n for (i = 0; i < groupIds.length; i++) {\n group = this.groups[groupIds[i]];\n if (groupsData[groupIds[i]].length > 0) {\n switch (group.options.style) {\n case \"line\":\n if (!paths.hasOwnProperty(groupIds[i])) {\n paths[groupIds[i]] = Lines.calcPath(groupsData[groupIds[i]], group);\n }\n Lines.draw(paths[groupIds[i]], group, this.framework);\n //explicit no break;\n case \"point\":\n //explicit no break;\n case \"points\":\n if (group.options.style == \"point\" || group.options.style == \"points\" || group.options.drawPoints.enabled == true) {\n Points.draw(groupsData[groupIds[i]], group, this.framework);\n }\n break;\n case \"bar\":\n // bar needs to be drawn enmasse\n //explicit no break\n default:\n //do nothing...\n }\n }\n\n }\n }\n }\n\n // cleanup unused svg elements\n DOMutil.cleanupElements(this.svgElements);\n return false;\n};\n\nLineGraph.prototype._stack = function (data, subData) {\n var index, dx, dy, subPrevPoint, subNextPoint;\n index = 0;\n // for each data point we look for a matching on in the set below\n for (var j = 0; j < data.length; j++) {\n subPrevPoint = undefined;\n subNextPoint = undefined;\n // we look for time matches or a before-after point\n for (var k = index; k < subData.length; k++) {\n // if times match exactly\n if (subData[k].x === data[j].x) {\n subPrevPoint = subData[k];\n subNextPoint = subData[k];\n index = k;\n break;\n }\n else if (subData[k].x > data[j].x) { // overshoot\n subNextPoint = subData[k];\n if (k == 0) {\n subPrevPoint = subNextPoint;\n }\n else {\n subPrevPoint = subData[k - 1];\n }\n index = k;\n break;\n }\n }\n // in case the last data point has been used, we assume it stays like this.\n if (subNextPoint === undefined) {\n subPrevPoint = subData[subData.length - 1];\n subNextPoint = subData[subData.length - 1];\n }\n // linear interpolation\n dx = subNextPoint.x - subPrevPoint.x;\n dy = subNextPoint.y - subPrevPoint.y;\n if (dx == 0) {\n data[j].y = data[j].orginalY + subNextPoint.y;\n }\n else {\n data[j].y = data[j].orginalY + (dy / dx) * (data[j].x - subPrevPoint.x) + subPrevPoint.y; // ax + b where b is data[j].y\n }\n }\n}\n\n\n/**\n * first select and preprocess the data from the datasets.\n * the groups have their preselection of data, we now loop over this data to see\n * what data we need to draw. Sorted data is much faster.\n * more optimization is possible by doing the sampling before and using the binary search\n * to find the end date to determine the increment.\n *\n * @param {array} groupIds\n * @param {object} groupsData\n * @param {date} minDate\n * @param {date} maxDate\n * @private\n */\nLineGraph.prototype._getRelevantData = function (groupIds, groupsData, minDate, maxDate) {\n var group, i, j, item;\n if (groupIds.length > 0) {\n for (i = 0; i < groupIds.length; i++) {\n group = this.groups[groupIds[i]];\n var itemsData = group.getItems();\n // optimization for sorted data\n if (group.options.sort == true) {\n var dateComparator = function (a, b) {\n return a.getTime() == b.getTime() ? 0 : a < b ? -1 : 1\n };\n var first = Math.max(0, util.binarySearchValue(itemsData, minDate, 'x', 'before', dateComparator));\n var last = Math.min(itemsData.length, util.binarySearchValue(itemsData, maxDate, 'x', 'after', dateComparator) + 1);\n if (last <= 0) {\n last = itemsData.length;\n }\n var dataContainer = new Array(last-first);\n for (j = first; j < last; j++) {\n item = group.itemsData[j];\n dataContainer[j-first] = item;\n }\n groupsData[groupIds[i]] = dataContainer;\n }\n else {\n // If unsorted data, all data is relevant, just returning entire structure\n groupsData[groupIds[i]] = group.itemsData;\n }\n }\n }\n};\n\n\n/**\n *\n * @param groupIds\n * @param groupsData\n * @private\n */\nLineGraph.prototype._applySampling = function (groupIds, groupsData) {\n var group;\n if (groupIds.length > 0) {\n for (var i = 0; i < groupIds.length; i++) {\n group = this.groups[groupIds[i]];\n if (group.options.sampling == true) {\n var dataContainer = groupsData[groupIds[i]];\n if (dataContainer.length > 0) {\n var increment = 1;\n var amountOfPoints = dataContainer.length;\n\n // the global screen is used because changing the width of the yAxis may affect the increment, resulting in an endless loop\n // of width changing of the yAxis.\n //TODO: This assumes sorted data, but that's not guaranteed!\n var xDistance = this.body.util.toGlobalScreen(dataContainer[dataContainer.length - 1].x) - this.body.util.toGlobalScreen(dataContainer[0].x);\n var pointsPerPixel = amountOfPoints / xDistance;\n increment = Math.min(Math.ceil(0.2 * amountOfPoints), Math.max(1, Math.round(pointsPerPixel)));\n\n var sampledData = new Array(amountOfPoints);\n for (var j = 0; j < amountOfPoints; j += increment) {\n var idx = Math.round(j/increment);\n sampledData[idx]=dataContainer[j];\n }\n groupsData[groupIds[i]] = sampledData.splice(0,Math.round(amountOfPoints/increment));\n }\n }\n }\n }\n};\n\n\n/**\n *\n *\n * @param {array} groupIds\n * @param {object} groupsData\n * @param {object} groupRanges | this is being filled here\n * @private\n */\nLineGraph.prototype._getYRanges = function (groupIds, groupsData, groupRanges) {\n var groupData, group, i;\n var combinedDataLeft = [];\n var combinedDataRight = [];\n var options;\n if (groupIds.length > 0) {\n for (i = 0; i < groupIds.length; i++) {\n groupData = groupsData[groupIds[i]];\n options = this.groups[groupIds[i]].options;\n if (groupData.length > 0) {\n group = this.groups[groupIds[i]];\n // if bar graphs are stacked, their range need to be handled differently and accumulated over all groups.\n if (options.stack === true && options.style === 'bar') {\n if (options.yAxisOrientation === 'left') {\n combinedDataLeft = combinedDataLeft.concat(group.getItems());\n }\n else {\n combinedDataRight = combinedDataRight.concat(group.getItems());\n }\n }\n else {\n groupRanges[groupIds[i]] = group.getYRange(groupData, groupIds[i]);\n }\n }\n }\n\n // if bar graphs are stacked, their range need to be handled differently and accumulated over all groups.\n Bars.getStackedYRange(combinedDataLeft, groupRanges, groupIds, '__barStackLeft', 'left');\n Bars.getStackedYRange(combinedDataRight, groupRanges, groupIds, '__barStackRight', 'right');\n }\n};\n\n\n/**\n * this sets the Y ranges for the Y axis. It also determines which of the axis should be shown or hidden.\n * @param {Array} groupIds\n * @param {Object} groupRanges\n * @private\n */\nLineGraph.prototype._updateYAxis = function (groupIds, groupRanges) {\n var resized = false;\n var yAxisLeftUsed = false;\n var yAxisRightUsed = false;\n var minLeft = 1e9, minRight = 1e9, maxLeft = -1e9, maxRight = -1e9, minVal, maxVal;\n // if groups are present\n if (groupIds.length > 0) {\n // this is here to make sure that if there are no items in the axis but there are groups, that there is no infinite draw/redraw loop.\n for (var i = 0; i < groupIds.length; i++) {\n var group = this.groups[groupIds[i]];\n if (group && group.options.yAxisOrientation != 'right') {\n yAxisLeftUsed = true;\n minLeft = 1e9;\n maxLeft = -1e9;\n }\n else if (group && group.options.yAxisOrientation) {\n yAxisRightUsed = true;\n minRight = 1e9;\n maxRight = -1e9;\n }\n }\n\n // if there are items:\n for (var i = 0; i < groupIds.length; i++) {\n if (groupRanges.hasOwnProperty(groupIds[i])) {\n if (groupRanges[groupIds[i]].ignore !== true) {\n minVal = groupRanges[groupIds[i]].min;\n maxVal = groupRanges[groupIds[i]].max;\n\n if (groupRanges[groupIds[i]].yAxisOrientation != 'right') {\n yAxisLeftUsed = true;\n minLeft = minLeft > minVal ? minVal : minLeft;\n maxLeft = maxLeft < maxVal ? maxVal : maxLeft;\n }\n else {\n yAxisRightUsed = true;\n minRight = minRight > minVal ? minVal : minRight;\n maxRight = maxRight < maxVal ? maxVal : maxRight;\n }\n }\n }\n }\n\n if (yAxisLeftUsed == true) {\n this.yAxisLeft.setRange(minLeft, maxLeft);\n }\n if (yAxisRightUsed == true) {\n this.yAxisRight.setRange(minRight, maxRight);\n }\n }\n resized = this._toggleAxisVisiblity(yAxisLeftUsed, this.yAxisLeft) || resized;\n resized = this._toggleAxisVisiblity(yAxisRightUsed, this.yAxisRight) || resized;\n\n if (yAxisRightUsed == true && yAxisLeftUsed == true) {\n this.yAxisLeft.drawIcons = true;\n this.yAxisRight.drawIcons = true;\n }\n else {\n this.yAxisLeft.drawIcons = false;\n this.yAxisRight.drawIcons = false;\n }\n this.yAxisRight.master = !yAxisLeftUsed;\n this.yAxisRight.masterAxis = this.yAxisLeft;\n\n if (this.yAxisRight.master == false) {\n if (yAxisRightUsed == true) {\n this.yAxisLeft.lineOffset = this.yAxisRight.width;\n }\n else {\n this.yAxisLeft.lineOffset = 0;\n }\n\n resized = this.yAxisLeft.redraw() || resized;\n resized = this.yAxisRight.redraw() || resized;\n }\n else {\n resized = this.yAxisRight.redraw() || resized;\n }\n\n // clean the accumulated lists\n var tempGroups = ['__barStackLeft', '__barStackRight', '__lineStackLeft', '__lineStackRight'];\n for (var i = 0; i < tempGroups.length; i++) {\n if (groupIds.indexOf(tempGroups[i]) != -1) {\n groupIds.splice(groupIds.indexOf(tempGroups[i]), 1);\n }\n }\n\n return resized;\n};\n\n\n/**\n * This shows or hides the Y axis if needed. If there is a change, the changed event is emitted by the updateYAxis function\n *\n * @param {boolean} axisUsed\n * @returns {boolean}\n * @private\n * @param axis\n */\nLineGraph.prototype._toggleAxisVisiblity = function (axisUsed, axis) {\n var changed = false;\n if (axisUsed == false) {\n if (axis.dom.frame.parentNode && axis.hidden == false) {\n axis.hide();\n changed = true;\n }\n }\n else {\n if (!axis.dom.frame.parentNode && axis.hidden == true) {\n axis.show();\n changed = true;\n }\n }\n return changed;\n};\n\n\n/**\n * This uses the DataAxis object to generate the correct X coordinate on the SVG window. It uses the\n * util function toScreen to get the x coordinate from the timestamp. It also pre-filters the data and get the minMax ranges for\n * the yAxis.\n *\n * @param datapoints\n * @returns {Array}\n * @private\n */\nLineGraph.prototype._convertXcoordinates = function (datapoints) {\n var toScreen = this.body.util.toScreen;\n for (var i = 0; i < datapoints.length; i++) {\n datapoints[i].screen_x = toScreen(datapoints[i].x) + this.props.width;\n datapoints[i].screen_y = datapoints[i].y; //starting point for range calculations\n }\n};\n\n\n/**\n * This uses the DataAxis object to generate the correct X coordinate on the SVG window. It uses the\n * util function toScreen to get the x coordinate from the timestamp. It also pre-filters the data and get the minMax ranges for\n * the yAxis.\n *\n * @param datapoints\n * @param group\n * @returns {Array}\n * @private\n */\nLineGraph.prototype._convertYcoordinates = function (datapoints, group) {\n var axis = this.yAxisLeft;\n var svgHeight = Number(this.svg.style.height.replace('px', ''));\n if (group.options.yAxisOrientation == 'right') {\n axis = this.yAxisRight;\n }\n for (var i = 0; i < datapoints.length; i++) {\n datapoints[i].screen_y = Math.round(axis.convertValue(datapoints[i].y));\n }\n group.setZeroPosition(Math.min(svgHeight, axis.convertValue(0)));\n};\n\n\nmodule.exports = LineGraph;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/timeline/component/LineGraph.js","var util = require('../../util');\nvar DOMutil = require('../../DOMutil');\nvar Component = require('./Component');\nvar DataScale = require('./DataScale');\n/**\n * A horizontal time axis\n * @param {Object} [options] See DataAxis.setOptions for the available\n * options.\n * @constructor DataAxis\n * @extends Component\n * @param body\n */\nfunction DataAxis(body, options, svg, linegraphOptions) {\n this.id = util.randomUUID();\n this.body = body;\n\n this.defaultOptions = {\n orientation: 'left', // supported: 'left', 'right'\n showMinorLabels: true,\n showMajorLabels: true,\n icons: false,\n majorLinesOffset: 7,\n minorLinesOffset: 4,\n labelOffsetX: 10,\n labelOffsetY: 2,\n iconWidth: 20,\n width: '40px',\n visible: true,\n alignZeros: true,\n left: {\n range: {min: undefined, max: undefined},\n format: function (value) {\n return '' + parseFloat(value.toPrecision(3));\n },\n title: {text: undefined, style: undefined}\n },\n right: {\n range: {min: undefined, max: undefined},\n format: function (value) {\n return '' + parseFloat(value.toPrecision(3));\n },\n title: {text: undefined, style: undefined}\n }\n };\n\n this.linegraphOptions = linegraphOptions;\n this.linegraphSVG = svg;\n this.props = {};\n this.DOMelements = { // dynamic elements\n lines: {},\n labels: {},\n title: {}\n };\n\n this.dom = {};\n this.scale = undefined;\n this.range = {start: 0, end: 0};\n\n this.options = util.extend({}, this.defaultOptions);\n this.conversionFactor = 1;\n\n this.setOptions(options);\n this.width = Number(('' + this.options.width).replace(\"px\", \"\"));\n this.minWidth = this.width;\n this.height = this.linegraphSVG.getBoundingClientRect().height;\n this.hidden = false;\n\n this.stepPixels = 25;\n this.zeroCrossing = -1;\n this.amountOfSteps = -1;\n\n this.lineOffset = 0;\n this.master = true;\n this.masterAxis = null;\n this.svgElements = {};\n this.iconsRemoved = false;\n\n this.groups = {};\n this.amountOfGroups = 0;\n\n // create the HTML DOM\n this._create();\n this.framework = {svg: this.svg, svgElements: this.svgElements, options: this.options, groups: this.groups};\n\n var me = this;\n this.body.emitter.on(\"verticalDrag\", function () {\n me.dom.lineContainer.style.top = me.body.domProps.scrollTop + 'px';\n });\n}\n\nDataAxis.prototype = new Component();\n\n\nDataAxis.prototype.addGroup = function (label, graphOptions) {\n if (!this.groups.hasOwnProperty(label)) {\n this.groups[label] = graphOptions;\n }\n this.amountOfGroups += 1;\n};\n\nDataAxis.prototype.updateGroup = function (label, graphOptions) {\n if (!this.groups.hasOwnProperty(label)) {\n this.amountOfGroups += 1;\n }\n this.groups[label] = graphOptions;\n};\n\nDataAxis.prototype.removeGroup = function (label) {\n if (this.groups.hasOwnProperty(label)) {\n delete this.groups[label];\n this.amountOfGroups -= 1;\n }\n};\n\n\nDataAxis.prototype.setOptions = function (options) {\n if (options) {\n var redraw = false;\n if (this.options.orientation != options.orientation && options.orientation !== undefined) {\n redraw = true;\n }\n var fields = [\n 'orientation',\n 'showMinorLabels',\n 'showMajorLabels',\n 'icons',\n 'majorLinesOffset',\n 'minorLinesOffset',\n 'labelOffsetX',\n 'labelOffsetY',\n 'iconWidth',\n 'width',\n 'visible',\n 'left',\n 'right',\n 'alignZeros'\n ];\n util.selectiveDeepExtend(fields, this.options, options);\n\n this.minWidth = Number(('' + this.options.width).replace(\"px\", \"\"));\n if (redraw === true && this.dom.frame) {\n this.hide();\n this.show();\n }\n }\n};\n\n\n/**\n * Create the HTML DOM for the DataAxis\n */\nDataAxis.prototype._create = function () {\n this.dom.frame = document.createElement('div');\n this.dom.frame.style.width = this.options.width;\n this.dom.frame.style.height = this.height;\n\n this.dom.lineContainer = document.createElement('div');\n this.dom.lineContainer.style.width = '100%';\n this.dom.lineContainer.style.height = this.height;\n this.dom.lineContainer.style.position = 'relative';\n\n // create svg element for graph drawing.\n this.svg = document.createElementNS('http://www.w3.org/2000/svg', \"svg\");\n this.svg.style.position = \"absolute\";\n this.svg.style.top = '0px';\n this.svg.style.height = '100%';\n this.svg.style.width = '100%';\n this.svg.style.display = \"block\";\n this.dom.frame.appendChild(this.svg);\n};\n\nDataAxis.prototype._redrawGroupIcons = function () {\n DOMutil.prepareElements(this.svgElements);\n\n var x;\n var iconWidth = this.options.iconWidth;\n var iconHeight = 15;\n var iconOffset = 4;\n var y = iconOffset + 0.5 * iconHeight;\n\n if (this.options.orientation === 'left') {\n x = iconOffset;\n }\n else {\n x = this.width - iconWidth - iconOffset;\n }\n\n var groupArray = Object.keys(this.groups);\n groupArray.sort(function (a, b) {\n return (a < b ? -1 : 1);\n })\n\n for (var i = 0; i < groupArray.length; i++) {\n var groupId = groupArray[i];\n if (this.groups[groupId].visible === true && (this.linegraphOptions.visibility[groupId] === undefined || this.linegraphOptions.visibility[groupId] === true)) {\n this.groups[groupId].getLegend(iconWidth, iconHeight, this.framework, x, y);\n y += iconHeight + iconOffset;\n }\n }\n\n DOMutil.cleanupElements(this.svgElements);\n this.iconsRemoved = false;\n};\n\nDataAxis.prototype._cleanupIcons = function () {\n if (this.iconsRemoved === false) {\n DOMutil.prepareElements(this.svgElements);\n DOMutil.cleanupElements(this.svgElements);\n this.iconsRemoved = true;\n }\n}\n\n/**\n * Create the HTML DOM for the DataAxis\n */\nDataAxis.prototype.show = function () {\n this.hidden = false;\n if (!this.dom.frame.parentNode) {\n if (this.options.orientation === 'left') {\n this.body.dom.left.appendChild(this.dom.frame);\n }\n else {\n this.body.dom.right.appendChild(this.dom.frame);\n }\n }\n\n if (!this.dom.lineContainer.parentNode) {\n this.body.dom.backgroundHorizontal.appendChild(this.dom.lineContainer);\n }\n};\n\n/**\n * Create the HTML DOM for the DataAxis\n */\nDataAxis.prototype.hide = function () {\n this.hidden = true;\n if (this.dom.frame.parentNode) {\n this.dom.frame.parentNode.removeChild(this.dom.frame);\n }\n\n if (this.dom.lineContainer.parentNode) {\n this.dom.lineContainer.parentNode.removeChild(this.dom.lineContainer);\n }\n};\n\n/**\n * Set a range (start and end)\n * @param end\n * @param start\n * @param end\n */\nDataAxis.prototype.setRange = function (start, end) {\n this.range.start = start;\n this.range.end = end;\n};\n\n/**\n * Repaint the component\n * @return {boolean} Returns true if the component is resized\n */\nDataAxis.prototype.redraw = function () {\n var resized = false;\n var activeGroups = 0;\n\n // Make sure the line container adheres to the vertical scrolling.\n this.dom.lineContainer.style.top = this.body.domProps.scrollTop + 'px';\n\n for (var groupId in this.groups) {\n if (this.groups.hasOwnProperty(groupId)) {\n if (this.groups[groupId].visible === true && (this.linegraphOptions.visibility[groupId] === undefined || this.linegraphOptions.visibility[groupId] === true)) {\n activeGroups++;\n }\n }\n }\n if (this.amountOfGroups === 0 || activeGroups === 0) {\n this.hide();\n }\n else {\n this.show();\n this.height = Number(this.linegraphSVG.style.height.replace(\"px\", \"\"));\n\n // svg offsetheight did not work in firefox and explorer...\n this.dom.lineContainer.style.height = this.height + 'px';\n this.width = this.options.visible === true ? Number(('' + this.options.width).replace(\"px\", \"\")) : 0;\n\n var props = this.props;\n var frame = this.dom.frame;\n\n // update classname\n frame.className = 'vis-data-axis';\n\n // calculate character width and height\n this._calculateCharSize();\n\n var orientation = this.options.orientation;\n var showMinorLabels = this.options.showMinorLabels;\n var showMajorLabels = this.options.showMajorLabels;\n\n // determine the width and height of the elements for the axis\n props.minorLabelHeight = showMinorLabels ? props.minorCharHeight : 0;\n props.majorLabelHeight = showMajorLabels ? props.majorCharHeight : 0;\n\n props.minorLineWidth = this.body.dom.backgroundHorizontal.offsetWidth - this.lineOffset - this.width + 2 * this.options.minorLinesOffset;\n props.minorLineHeight = 1;\n props.majorLineWidth = this.body.dom.backgroundHorizontal.offsetWidth - this.lineOffset - this.width + 2 * this.options.majorLinesOffset;\n props.majorLineHeight = 1;\n\n // take frame offline while updating (is almost twice as fast)\n if (orientation === 'left') {\n frame.style.top = '0';\n frame.style.left = '0';\n frame.style.bottom = '';\n frame.style.width = this.width + 'px';\n frame.style.height = this.height + \"px\";\n this.props.width = this.body.domProps.left.width;\n this.props.height = this.body.domProps.left.height;\n }\n else { // right\n frame.style.top = '';\n frame.style.bottom = '0';\n frame.style.left = '0';\n frame.style.width = this.width + 'px';\n frame.style.height = this.height + \"px\";\n this.props.width = this.body.domProps.right.width;\n this.props.height = this.body.domProps.right.height;\n }\n\n resized = this._redrawLabels();\n resized = this._isResized() || resized;\n\n if (this.options.icons === true) {\n this._redrawGroupIcons();\n }\n else {\n this._cleanupIcons();\n }\n\n this._redrawTitle(orientation);\n }\n return resized;\n};\n\n/**\n * Repaint major and minor text labels and vertical grid lines\n * @private\n */\nDataAxis.prototype._redrawLabels = function () {\n var resized = false;\n DOMutil.prepareElements(this.DOMelements.lines);\n DOMutil.prepareElements(this.DOMelements.labels);\n var orientation = this.options['orientation'];\n var customRange = this.options[orientation].range != undefined ? this.options[orientation].range : {};\n\n //Override range with manual options:\n var autoScaleEnd = true;\n if (customRange.max != undefined) {\n this.range.end = customRange.max;\n autoScaleEnd = false;\n }\n var autoScaleStart = true;\n if (customRange.min != undefined) {\n this.range.start = customRange.min;\n autoScaleStart = false;\n }\n\n this.scale = new DataScale(\n this.range.start,\n this.range.end,\n autoScaleStart,\n autoScaleEnd,\n this.dom.frame.offsetHeight,\n this.props.majorCharHeight,\n this.options.alignZeros,\n this.options[orientation].format\n );\n\n if (this.master === false && this.masterAxis != undefined) {\n this.scale.followScale(this.masterAxis.scale);\n }\n\n //Is updated in side-effect of _redrawLabel():\n this.maxLabelSize = 0;\n\n var lines = this.scale.getLines();\n lines.forEach(\n line=> {\n var y = line.y;\n var isMajor = line.major;\n if (this.options['showMinorLabels'] && isMajor === false) {\n this._redrawLabel(y - 2, line.val, orientation, 'vis-y-axis vis-minor', this.props.minorCharHeight);\n }\n if (isMajor) {\n if (y >= 0) {\n this._redrawLabel(y - 2, line.val, orientation, 'vis-y-axis vis-major', this.props.majorCharHeight);\n }\n }\n if (this.master === true) {\n if (isMajor) {\n this._redrawLine(y, orientation, 'vis-grid vis-horizontal vis-major', this.options.majorLinesOffset, this.props.majorLineWidth);\n }\n else {\n this._redrawLine(y, orientation, 'vis-grid vis-horizontal vis-minor', this.options.minorLinesOffset, this.props.minorLineWidth);\n }\n }\n });\n\n // Note that title is rotated, so we're using the height, not width!\n var titleWidth = 0;\n if (this.options[orientation].title !== undefined && this.options[orientation].title.text !== undefined) {\n titleWidth = this.props.titleCharHeight;\n }\n var offset = this.options.icons === true ? Math.max(this.options.iconWidth, titleWidth) + this.options.labelOffsetX + 15 : titleWidth + this.options.labelOffsetX + 15;\n\n // this will resize the yAxis to accommodate the labels.\n if (this.maxLabelSize > (this.width - offset) && this.options.visible === true) {\n this.width = this.maxLabelSize + offset;\n this.options.width = this.width + \"px\";\n DOMutil.cleanupElements(this.DOMelements.lines);\n DOMutil.cleanupElements(this.DOMelements.labels);\n this.redraw();\n resized = true;\n }\n // this will resize the yAxis if it is too big for the labels.\n else if (this.maxLabelSize < (this.width - offset) && this.options.visible === true && this.width > this.minWidth) {\n this.width = Math.max(this.minWidth, this.maxLabelSize + offset);\n this.options.width = this.width + \"px\";\n DOMutil.cleanupElements(this.DOMelements.lines);\n DOMutil.cleanupElements(this.DOMelements.labels);\n this.redraw();\n resized = true;\n }\n else {\n DOMutil.cleanupElements(this.DOMelements.lines);\n DOMutil.cleanupElements(this.DOMelements.labels);\n resized = false;\n }\n\n return resized;\n};\n\nDataAxis.prototype.convertValue = function (value) {\n return this.scale.convertValue(value);\n};\n\nDataAxis.prototype.screenToValue = function (x) {\n return this.scale.screenToValue(x);\n};\n\n/**\n * Create a label for the axis at position x\n * @private\n * @param y\n * @param text\n * @param orientation\n * @param className\n * @param characterHeight\n */\nDataAxis.prototype._redrawLabel = function (y, text, orientation, className, characterHeight) {\n // reuse redundant label\n var label = DOMutil.getDOMElement('div', this.DOMelements.labels, this.dom.frame); //this.dom.redundant.labels.shift();\n label.className = className;\n label.innerHTML = text;\n if (orientation === 'left') {\n label.style.left = '-' + this.options.labelOffsetX + 'px';\n label.style.textAlign = \"right\";\n }\n else {\n label.style.right = '-' + this.options.labelOffsetX + 'px';\n label.style.textAlign = \"left\";\n }\n\n label.style.top = y - 0.5 * characterHeight + this.options.labelOffsetY + 'px';\n\n text += '';\n\n var largestWidth = Math.max(this.props.majorCharWidth, this.props.minorCharWidth);\n if (this.maxLabelSize < text.length * largestWidth) {\n this.maxLabelSize = text.length * largestWidth;\n }\n};\n\n/**\n * Create a minor line for the axis at position y\n * @param y\n * @param orientation\n * @param className\n * @param offset\n * @param width\n */\nDataAxis.prototype._redrawLine = function (y, orientation, className, offset, width) {\n if (this.master === true) {\n var line = DOMutil.getDOMElement('div', this.DOMelements.lines, this.dom.lineContainer);//this.dom.redundant.lines.shift();\n line.className = className;\n line.innerHTML = '';\n\n if (orientation === 'left') {\n line.style.left = (this.width - offset) + 'px';\n }\n else {\n line.style.right = (this.width - offset) + 'px';\n }\n\n line.style.width = width + 'px';\n line.style.top = y + 'px';\n }\n};\n\n/**\n * Create a title for the axis\n * @private\n * @param orientation\n */\nDataAxis.prototype._redrawTitle = function (orientation) {\n DOMutil.prepareElements(this.DOMelements.title);\n\n // Check if the title is defined for this axes\n if (this.options[orientation].title !== undefined && this.options[orientation].title.text !== undefined) {\n var title = DOMutil.getDOMElement('div', this.DOMelements.title, this.dom.frame);\n title.className = 'vis-y-axis vis-title vis-' + orientation;\n title.innerHTML = this.options[orientation].title.text;\n\n // Add style - if provided\n if (this.options[orientation].title.style !== undefined) {\n util.addCssText(title, this.options[orientation].title.style);\n }\n\n if (orientation === 'left') {\n title.style.left = this.props.titleCharHeight + 'px';\n }\n else {\n title.style.right = this.props.titleCharHeight + 'px';\n }\n\n title.style.width = this.height + 'px';\n }\n\n // we need to clean up in case we did not use all elements.\n DOMutil.cleanupElements(this.DOMelements.title);\n};\n\n\n/**\n * Determine the size of text on the axis (both major and minor axis).\n * The size is calculated only once and then cached in this.props.\n * @private\n */\nDataAxis.prototype._calculateCharSize = function () {\n // determine the char width and height on the minor axis\n if (!('minorCharHeight' in this.props)) {\n var textMinor = document.createTextNode('0');\n var measureCharMinor = document.createElement('div');\n measureCharMinor.className = 'vis-y-axis vis-minor vis-measure';\n measureCharMinor.appendChild(textMinor);\n this.dom.frame.appendChild(measureCharMinor);\n\n this.props.minorCharHeight = measureCharMinor.clientHeight;\n this.props.minorCharWidth = measureCharMinor.clientWidth;\n\n this.dom.frame.removeChild(measureCharMinor);\n }\n\n if (!('majorCharHeight' in this.props)) {\n var textMajor = document.createTextNode('0');\n var measureCharMajor = document.createElement('div');\n measureCharMajor.className = 'vis-y-axis vis-major vis-measure';\n measureCharMajor.appendChild(textMajor);\n this.dom.frame.appendChild(measureCharMajor);\n\n this.props.majorCharHeight = measureCharMajor.clientHeight;\n this.props.majorCharWidth = measureCharMajor.clientWidth;\n\n this.dom.frame.removeChild(measureCharMajor);\n }\n\n if (!('titleCharHeight' in this.props)) {\n var textTitle = document.createTextNode('0');\n var measureCharTitle = document.createElement('div');\n measureCharTitle.className = 'vis-y-axis vis-title vis-measure';\n measureCharTitle.appendChild(textTitle);\n this.dom.frame.appendChild(measureCharTitle);\n\n this.props.titleCharHeight = measureCharTitle.clientHeight;\n this.props.titleCharWidth = measureCharTitle.clientWidth;\n\n this.dom.frame.removeChild(measureCharTitle);\n }\n};\n\nmodule.exports = DataAxis;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/timeline/component/DataAxis.js","/**\n * Created by ludo on 25-1-16.\n */\n\nfunction DataScale(start, end, autoScaleStart, autoScaleEnd, containerHeight, majorCharHeight, zeroAlign = false, formattingFunction=false) {\n this.majorSteps = [1, 2, 5, 10];\n this.minorSteps = [0.25, 0.5, 1, 2];\n this.customLines = null;\n\n this.containerHeight = containerHeight;\n this.majorCharHeight = majorCharHeight;\n this._start = start;\n this._end = end;\n\n this.scale = 1;\n this.minorStepIdx = -1;\n this.magnitudefactor = 1;\n this.determineScale();\n\n this.zeroAlign = zeroAlign;\n this.autoScaleStart = autoScaleStart;\n this.autoScaleEnd = autoScaleEnd;\n\n this.formattingFunction = formattingFunction;\n\n if (autoScaleStart || autoScaleEnd) {\n var me = this;\n var roundToMinor = function (value) {\n var rounded = value - (value % (me.magnitudefactor * me.minorSteps[me.minorStepIdx]));\n if (value % (me.magnitudefactor * me.minorSteps[me.minorStepIdx]) > 0.5 * (me.magnitudefactor * me.minorSteps[me.minorStepIdx])) {\n return rounded + (me.magnitudefactor * me.minorSteps[me.minorStepIdx]);\n }\n else {\n return rounded;\n }\n };\n if (autoScaleStart) {\n this._start -= this.magnitudefactor * 2 * this.minorSteps[this.minorStepIdx];\n this._start = roundToMinor(this._start);\n }\n\n if (autoScaleEnd) {\n this._end += this.magnitudefactor * this.minorSteps[this.minorStepIdx];\n this._end = roundToMinor(this._end);\n }\n this.determineScale();\n }\n}\n\nDataScale.prototype.setCharHeight = function (majorCharHeight) {\n this.majorCharHeight = majorCharHeight;\n};\n\nDataScale.prototype.setHeight = function (containerHeight) {\n this.containerHeight = containerHeight;\n};\n\nDataScale.prototype.determineScale = function () {\n var range = this._end - this._start;\n this.scale = this.containerHeight / range;\n var minimumStepValue = this.majorCharHeight / this.scale;\n var orderOfMagnitude = (range > 0)\n ? Math.round(Math.log(range) / Math.LN10)\n : 0;\n\n this.minorStepIdx = -1;\n this.magnitudefactor = Math.pow(10, orderOfMagnitude);\n\n var start = 0;\n if (orderOfMagnitude < 0) {\n start = orderOfMagnitude;\n }\n\n var solutionFound = false;\n for (var l = start; Math.abs(l) <= Math.abs(orderOfMagnitude); l++) {\n this.magnitudefactor = Math.pow(10, l);\n for (var j = 0; j < this.minorSteps.length; j++) {\n var stepSize = this.magnitudefactor * this.minorSteps[j];\n if (stepSize >= minimumStepValue) {\n solutionFound = true;\n this.minorStepIdx = j;\n break;\n }\n }\n if (solutionFound === true) {\n break;\n }\n }\n};\n\nDataScale.prototype.is_major = function (value) {\n return (value % (this.magnitudefactor * this.majorSteps[this.minorStepIdx]) === 0);\n};\n\nDataScale.prototype.getStep = function(){\n return this.magnitudefactor * this.minorSteps[this.minorStepIdx];\n};\n\nDataScale.prototype.getFirstMajor = function(){\n var majorStep = this.magnitudefactor * this.majorSteps[this.minorStepIdx];\n return this.convertValue(this._start + ((majorStep - (this._start % majorStep)) % majorStep));\n};\n\nDataScale.prototype.formatValue = function(current) {\n var returnValue = current.toPrecision(5);\n if (typeof this.formattingFunction === 'function') {\n returnValue = this.formattingFunction(current);\n }\n\n if (typeof returnValue === 'number') {\n return '' + returnValue;\n }\n else if (typeof returnValue === 'string') {\n return returnValue;\n }\n else {\n return current.toPrecision(5);\n }\n\n};\n\nDataScale.prototype.getLines = function () {\n var lines = [];\n var step = this.getStep();\n var bottomOffset = (step - (this._start % step)) % step;\n for (var i = (this._start + bottomOffset); this._end-i > 0.00001; i += step) {\n if (i != this._start) { //Skip the bottom line\n lines.push({major: this.is_major(i), y: this.convertValue(i), val: this.formatValue(i)});\n }\n }\n return lines;\n};\n\nDataScale.prototype.followScale = function (other) {\n var oldStepIdx = this.minorStepIdx;\n var oldStart = this._start;\n var oldEnd = this._end;\n\n var me = this;\n var increaseMagnitude = function () {\n me.magnitudefactor *= 2;\n };\n var decreaseMagnitude = function () {\n me.magnitudefactor /= 2;\n };\n\n if ((other.minorStepIdx <= 1 && this.minorStepIdx <= 1) || (other.minorStepIdx > 1 && this.minorStepIdx > 1)) {\n //easy, no need to change stepIdx nor multiplication factor\n } else if (other.minorStepIdx < this.minorStepIdx) {\n //I'm 5, they are 4 per major.\n this.minorStepIdx = 1;\n if (oldStepIdx == 2) {\n increaseMagnitude();\n } else {\n increaseMagnitude();\n increaseMagnitude();\n }\n } else {\n //I'm 4, they are 5 per major\n this.minorStepIdx = 2;\n if (oldStepIdx == 1) {\n decreaseMagnitude();\n } else {\n decreaseMagnitude();\n decreaseMagnitude();\n }\n }\n\n //Get masters stats:\n var lines = other.getLines();\n var otherZero = other.convertValue(0);\n var otherStep = other.getStep() * other.scale;\n\n var done = false;\n var count = 0;\n //Loop until magnitude is correct for given constrains.\n while (!done && count++ <5) {\n\n //Get my stats:\n this.scale = otherStep / (this.minorSteps[this.minorStepIdx] * this.magnitudefactor);\n var newRange = this.containerHeight / this.scale;\n\n //For the case the magnitudefactor has changed:\n this._start = oldStart;\n this._end = this._start + newRange;\n\n var myOriginalZero = this._end * this.scale;\n var majorStep = this.magnitudefactor * this.majorSteps[this.minorStepIdx];\n var majorOffset = this.getFirstMajor() - other.getFirstMajor();\n\n if (this.zeroAlign) {\n var zeroOffset = otherZero - myOriginalZero;\n this._end += (zeroOffset / this.scale);\n this._start = this._end - newRange;\n } else {\n if (!this.autoScaleStart) {\n this._start += majorStep - (majorOffset / this.scale);\n this._end = this._start + newRange;\n } else {\n this._start -= majorOffset / this.scale;\n this._end = this._start + newRange;\n }\n }\n if (!this.autoScaleEnd && this._end > oldEnd+0.00001) {\n //Need to decrease magnitude to prevent scale overshoot! (end)\n decreaseMagnitude();\n done = false;\n continue;\n }\n if (!this.autoScaleStart && this._start < oldStart-0.00001) {\n if (this.zeroAlign && oldStart >= 0) {\n console.warn(\"Can't adhere to given 'min' range, due to zeroalign\");\n } else {\n //Need to decrease magnitude to prevent scale overshoot! (start)\n decreaseMagnitude();\n done = false;\n continue;\n }\n }\n if (this.autoScaleStart && this.autoScaleEnd && newRange < (oldEnd-oldStart)){\n increaseMagnitude();\n done = false;\n continue;\n }\n done = true;\n }\n};\n\nDataScale.prototype.convertValue = function (value) {\n return this.containerHeight - ((value - this._start) * this.scale);\n};\n\nDataScale.prototype.screenToValue = function (pixels) {\n return ((this.containerHeight - pixels) / this.scale) + this._start;\n};\n\nmodule.exports = DataScale;\n\n\n// WEBPACK FOOTER //\n// ./lib/timeline/component/DataScale.js","var util = require('../../util');\nvar DOMutil = require('../../DOMutil');\nvar Bars = require('./graph2d_types/bar');\nvar Lines = require('./graph2d_types/line');\nvar Points = require('./graph2d_types/points');\n\n/**\n * /**\n * @param {object} group | the object of the group from the dataset\n * @param {string} groupId | ID of the group\n * @param {object} options | the default options\n * @param {array} groupsUsingDefaultStyles | this array has one entree.\n * It is passed as an array so it is passed by reference.\n * It enumerates through the default styles\n * @constructor\n */\nfunction GraphGroup(group, groupId, options, groupsUsingDefaultStyles) {\n this.id = groupId;\n var fields = ['sampling', 'style', 'sort', 'yAxisOrientation', 'barChart', 'drawPoints', 'shaded', 'interpolation', 'zIndex','excludeFromStacking', 'excludeFromLegend'];\n this.options = util.selectiveBridgeObject(fields, options);\n this.usingDefaultStyle = group.className === undefined;\n this.groupsUsingDefaultStyles = groupsUsingDefaultStyles;\n this.zeroPosition = 0;\n this.update(group);\n if (this.usingDefaultStyle == true) {\n this.groupsUsingDefaultStyles[0] += 1;\n }\n this.itemsData = [];\n this.visible = group.visible === undefined ? true : group.visible;\n}\n\n/**\n * this loads a reference to all items in this group into this group.\n * @param {array} items\n */\nGraphGroup.prototype.setItems = function (items) {\n if (items != null) {\n this.itemsData = items;\n if (this.options.sort == true) {\n util.insertSort(this.itemsData,function (a, b) {\n return a.x > b.x ? 1 : -1;\n });\n }\n }\n else {\n this.itemsData = [];\n }\n};\n\nGraphGroup.prototype.getItems = function () {\n return this.itemsData;\n}\n\n/**\n * this is used for barcharts and shading, this way, we only have to calculate it once.\n * @param pos\n */\nGraphGroup.prototype.setZeroPosition = function (pos) {\n this.zeroPosition = pos;\n};\n\n/**\n * set the options of the graph group over the default options.\n * @param options\n */\nGraphGroup.prototype.setOptions = function (options) {\n if (options !== undefined) {\n var fields = ['sampling', 'style', 'sort', 'yAxisOrientation', 'barChart', 'zIndex','excludeFromStacking', 'excludeFromLegend'];\n util.selectiveDeepExtend(fields, this.options, options);\n\n // if the group's drawPoints is a function delegate the callback to the onRender property\n if (typeof options.drawPoints == 'function') {\n options.drawPoints = {\n onRender: options.drawPoints\n }\n }\n\n util.mergeOptions(this.options, options, 'interpolation');\n util.mergeOptions(this.options, options, 'drawPoints');\n util.mergeOptions(this.options, options, 'shaded');\n\n if (options.interpolation) {\n if (typeof options.interpolation == 'object') {\n if (options.interpolation.parametrization) {\n if (options.interpolation.parametrization == 'uniform') {\n this.options.interpolation.alpha = 0;\n }\n else if (options.interpolation.parametrization == 'chordal') {\n this.options.interpolation.alpha = 1.0;\n }\n else {\n this.options.interpolation.parametrization = 'centripetal';\n this.options.interpolation.alpha = 0.5;\n }\n }\n }\n }\n }\n};\n\n\n/**\n * this updates the current group class with the latest group dataset entree, used in _updateGroup in linegraph\n * @param group\n */\nGraphGroup.prototype.update = function (group) {\n this.group = group;\n this.content = group.content || 'graph';\n this.className = group.className || this.className || 'vis-graph-group' + this.groupsUsingDefaultStyles[0] % 10;\n this.visible = group.visible === undefined ? true : group.visible;\n this.style = group.style;\n this.setOptions(group.options);\n};\n\n/**\n * return the legend entree for this group.\n *\n * @param iconWidth\n * @param iconHeight\n * @returns {{icon: HTMLElement, label: (group.content|*|string), orientation: (.options.yAxisOrientation|*)}}\n */\nGraphGroup.prototype.getLegend = function (iconWidth, iconHeight, framework, x, y) {\n if (framework == undefined || framework == null) {\n var svg = document.createElementNS('http://www.w3.org/2000/svg', \"svg\");\n framework = {svg: svg, svgElements:{}, options: this.options, groups: [this]}\n }\n if (x == undefined || x == null){\n x = 0;\n }\n if (y == undefined || y == null){\n y = 0.5 * iconHeight;\n }\n switch (this.options.style){\n case \"line\":\n Lines.drawIcon(this, x, y, iconWidth, iconHeight, framework);\n break;\n case \"points\": //explicit no break\n case \"point\":\n Points.drawIcon(this, x, y, iconWidth, iconHeight, framework);\n break;\n case \"bar\":\n Bars.drawIcon(this, x, y, iconWidth, iconHeight, framework);\n break;\n }\n return {icon: framework.svg, label: this.content, orientation: this.options.yAxisOrientation};\n};\n\nGraphGroup.prototype.getYRange = function (groupData) {\n var yMin = groupData[0].y;\n var yMax = groupData[0].y;\n for (var j = 0; j < groupData.length; j++) {\n yMin = yMin > groupData[j].y ? groupData[j].y : yMin;\n yMax = yMax < groupData[j].y ? groupData[j].y : yMax;\n }\n return {min: yMin, max: yMax, yAxisOrientation: this.options.yAxisOrientation};\n};\n\nmodule.exports = GraphGroup;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/timeline/component/GraphGroup.js","var DOMutil = require('../../../DOMutil');\nvar Points = require('./points');\n\nfunction Bargraph(groupId, options) {\n}\n\nBargraph.drawIcon = function (group, x, y, iconWidth, iconHeight, framework) {\n var fillHeight = iconHeight * 0.5;\n var path, fillPath;\n\n var outline = DOMutil.getSVGElement(\"rect\", framework.svgElements, framework.svg);\n outline.setAttributeNS(null, \"x\", x);\n outline.setAttributeNS(null, \"y\", y - fillHeight);\n outline.setAttributeNS(null, \"width\", iconWidth);\n outline.setAttributeNS(null, \"height\", 2 * fillHeight);\n outline.setAttributeNS(null, \"class\", \"vis-outline\");\n\n var barWidth = Math.round(0.3 * iconWidth);\n var originalWidth = group.options.barChart.width;\n var scale = originalWidth / barWidth;\n var bar1Height = Math.round(0.4 * iconHeight);\n var bar2Height = Math.round(0.75 * iconHeight);\n\n var offset = Math.round((iconWidth - (2 * barWidth)) / 3);\n\n DOMutil.drawBar(x + 0.5 * barWidth + offset, y + fillHeight - bar1Height - 1, barWidth, bar1Height, group.className + ' vis-bar', framework.svgElements, framework.svg, group.style);\n DOMutil.drawBar(x + 1.5 * barWidth + offset + 2, y + fillHeight - bar2Height - 1, barWidth, bar2Height, group.className + ' vis-bar', framework.svgElements, framework.svg, group.style);\n\n if (group.options.drawPoints.enabled == true) {\n var groupTemplate = {\n style: group.options.drawPoints.style,\n styles: group.options.drawPoints.styles,\n size: (group.options.drawPoints.size / scale),\n className: group.className\n };\n DOMutil.drawPoint(x + 0.5 * barWidth + offset, y + fillHeight - bar1Height - 1, groupTemplate, framework.svgElements, framework.svg);\n DOMutil.drawPoint(x + 1.5 * barWidth + offset + 2, y + fillHeight - bar2Height - 1, groupTemplate, framework.svgElements, framework.svg);\n }\n\n}\n\n/**\n * draw a bar graph\n *\n * @param groupIds\n * @param processedGroupData\n */\nBargraph.draw = function (groupIds, processedGroupData, framework) {\n var combinedData = [];\n var intersections = {};\n var coreDistance;\n var key, drawData;\n var group;\n var i, j;\n var barPoints = 0;\n\n // combine all barchart data\n for (i = 0; i < groupIds.length; i++) {\n group = framework.groups[groupIds[i]];\n if (group.options.style === 'bar') {\n if (group.visible === true && (framework.options.groups.visibility[groupIds[i]] === undefined || framework.options.groups.visibility[groupIds[i]] === true)) {\n for (j = 0; j < processedGroupData[groupIds[i]].length; j++) {\n combinedData.push({\n screen_x: processedGroupData[groupIds[i]][j].screen_x,\n screen_y: processedGroupData[groupIds[i]][j].screen_y,\n x: processedGroupData[groupIds[i]][j].x,\n y: processedGroupData[groupIds[i]][j].y,\n groupId: groupIds[i],\n label: processedGroupData[groupIds[i]][j].label\n });\n barPoints += 1;\n }\n }\n }\n }\n\n if (barPoints === 0) {\n return;\n }\n\n // sort by time and by group\n combinedData.sort(function (a, b) {\n if (a.screen_x === b.screen_x) {\n return a.groupId < b.groupId ? -1 : 1;\n }\n else {\n return a.screen_x - b.screen_x;\n }\n });\n\n // get intersections\n Bargraph._getDataIntersections(intersections, combinedData);\n\n // plot barchart\n for (i = 0; i < combinedData.length; i++) {\n group = framework.groups[combinedData[i].groupId];\n var minWidth = group.options.barChart.minWidth != undefined ? group.options.barChart.minWidth : 0.1 * group.options.barChart.width;\n\n key = combinedData[i].screen_x;\n var heightOffset = 0;\n if (intersections[key] === undefined) {\n if (i + 1 < combinedData.length) {\n coreDistance = Math.abs(combinedData[i + 1].screen_x - key);\n }\n drawData = Bargraph._getSafeDrawData(coreDistance, group, minWidth);\n }\n else {\n var nextKey = i + (intersections[key].amount - intersections[key].resolved);\n var prevKey = i - (intersections[key].resolved + 1);\n if (nextKey < combinedData.length) {\n coreDistance = Math.abs(combinedData[nextKey].screen_x - key);\n }\n drawData = Bargraph._getSafeDrawData(coreDistance, group, minWidth);\n intersections[key].resolved += 1;\n\n if (group.options.stack === true && group.options.excludeFromStacking !== true) {\n if (combinedData[i].screen_y < group.zeroPosition) {\n heightOffset = intersections[key].accumulatedNegative;\n intersections[key].accumulatedNegative += group.zeroPosition - combinedData[i].screen_y;\n }\n else {\n heightOffset = intersections[key].accumulatedPositive;\n intersections[key].accumulatedPositive += group.zeroPosition - combinedData[i].screen_y;\n }\n }\n else if (group.options.barChart.sideBySide === true) {\n drawData.width = drawData.width / intersections[key].amount;\n drawData.offset += (intersections[key].resolved) * drawData.width - (0.5 * drawData.width * (intersections[key].amount + 1));\n }\n }\n DOMutil.drawBar(combinedData[i].screen_x + drawData.offset, combinedData[i].screen_y - heightOffset, drawData.width, group.zeroPosition - combinedData[i].screen_y, group.className + ' vis-bar', framework.svgElements, framework.svg, group.style);\n // draw points\n if (group.options.drawPoints.enabled === true) {\n let pointData = {\n screen_x: combinedData[i].screen_x,\n screen_y: combinedData[i].screen_y - heightOffset,\n x: combinedData[i].x,\n y: combinedData[i].y,\n groupId: combinedData[i].groupId,\n label: combinedData[i].label\n };\n Points.draw([pointData], group, framework, drawData.offset);\n //DOMutil.drawPoint(combinedData[i].x + drawData.offset, combinedData[i].y, group, framework.svgElements, framework.svg);\n }\n }\n};\n\n\n/**\n * Fill the intersections object with counters of how many datapoints share the same x coordinates\n * @param intersections\n * @param combinedData\n * @private\n */\nBargraph._getDataIntersections = function (intersections, combinedData) {\n // get intersections\n var coreDistance;\n for (var i = 0; i < combinedData.length; i++) {\n if (i + 1 < combinedData.length) {\n coreDistance = Math.abs(combinedData[i + 1].screen_x - combinedData[i].screen_x);\n }\n if (i > 0) {\n coreDistance = Math.min(coreDistance, Math.abs(combinedData[i - 1].screen_x - combinedData[i].screen_x));\n }\n if (coreDistance === 0) {\n if (intersections[combinedData[i].screen_x] === undefined) {\n intersections[combinedData[i].screen_x] = {\n amount: 0,\n resolved: 0,\n accumulatedPositive: 0,\n accumulatedNegative: 0\n };\n }\n intersections[combinedData[i].screen_x].amount += 1;\n }\n }\n};\n\n\n/**\n * Get the width and offset for bargraphs based on the coredistance between datapoints\n *\n * @param coreDistance\n * @param group\n * @param minWidth\n * @returns {{width: Number, offset: Number}}\n * @private\n */\nBargraph._getSafeDrawData = function (coreDistance, group, minWidth) {\n var width, offset;\n if (coreDistance < group.options.barChart.width && coreDistance > 0) {\n width = coreDistance < minWidth ? minWidth : coreDistance\n\n offset = 0; // recalculate offset with the new width;\n if (group.options.barChart.align === 'left') {\n offset -= 0.5 * coreDistance;\n }\n else if (group.options.barChart.align === 'right') {\n offset += 0.5 * coreDistance;\n }\n }\n else {\n // default settings\n width = group.options.barChart.width;\n offset = 0;\n if (group.options.barChart.align === 'left') {\n offset -= 0.5 * group.options.barChart.width;\n }\n else if (group.options.barChart.align === 'right') {\n offset += 0.5 * group.options.barChart.width;\n }\n }\n\n return {width: width, offset: offset};\n};\n\nBargraph.getStackedYRange = function (combinedData, groupRanges, groupIds, groupLabel, orientation) {\n if (combinedData.length > 0) {\n // sort by time and by group\n combinedData.sort(function (a, b) {\n if (a.screen_x === b.screen_x) {\n return a.groupId < b.groupId ? -1 : 1;\n }\n else {\n return a.screen_x - b.screen_x;\n }\n });\n var intersections = {};\n\n Bargraph._getDataIntersections(intersections, combinedData);\n groupRanges[groupLabel] = Bargraph._getStackedYRange(intersections, combinedData);\n groupRanges[groupLabel].yAxisOrientation = orientation;\n groupIds.push(groupLabel);\n }\n}\n\nBargraph._getStackedYRange = function (intersections, combinedData) {\n var key;\n var yMin = combinedData[0].screen_y;\n var yMax = combinedData[0].screen_y;\n for (var i = 0; i < combinedData.length; i++) {\n key = combinedData[i].screen_x;\n if (intersections[key] === undefined) {\n yMin = yMin > combinedData[i].screen_y ? combinedData[i].screen_y : yMin;\n yMax = yMax < combinedData[i].screen_y ? combinedData[i].screen_y : yMax;\n }\n else {\n if (combinedData[i].screen_y < 0) {\n intersections[key].accumulatedNegative += combinedData[i].screen_y;\n }\n else {\n intersections[key].accumulatedPositive += combinedData[i].screen_y;\n }\n }\n }\n for (var xpos in intersections) {\n if (intersections.hasOwnProperty(xpos)) {\n yMin = yMin > intersections[xpos].accumulatedNegative ? intersections[xpos].accumulatedNegative : yMin;\n yMin = yMin > intersections[xpos].accumulatedPositive ? intersections[xpos].accumulatedPositive : yMin;\n yMax = yMax < intersections[xpos].accumulatedNegative ? intersections[xpos].accumulatedNegative : yMax;\n yMax = yMax < intersections[xpos].accumulatedPositive ? intersections[xpos].accumulatedPositive : yMax;\n }\n }\n\n return {min: yMin, max: yMax};\n};\n\nmodule.exports = Bargraph;\n\n\n// WEBPACK FOOTER //\n// ./lib/timeline/component/graph2d_types/bar.js","var DOMutil = require('../../../DOMutil');\n\nfunction Points(groupId, options) {\n}\n\n/**\n * draw the data points\n *\n * @param {Array} dataset\n * @param {Object} JSONcontainer\n * @param {Object} svg | SVG DOM element\n * @param {GraphGroup} group\n * @param {Number} [offset]\n */\nPoints.draw = function (dataset, group, framework, offset) {\n offset = offset || 0;\n var callback = getCallback(framework, group);\n\n for (var i = 0; i < dataset.length; i++) {\n if (!callback) {\n // draw the point the simple way.\n DOMutil.drawPoint(dataset[i].screen_x + offset, dataset[i].screen_y, getGroupTemplate(group), framework.svgElements, framework.svg, dataset[i].label);\n }\n else {\n var callbackResult = callback(dataset[i], group); // result might be true, false or an object\n if (callbackResult === true || typeof callbackResult === 'object') {\n DOMutil.drawPoint(dataset[i].screen_x + offset, dataset[i].screen_y, getGroupTemplate(group, callbackResult), framework.svgElements, framework.svg, dataset[i].label);\n }\n }\n }\n};\n\nPoints.drawIcon = function (group, x, y, iconWidth, iconHeight, framework) {\n var fillHeight = iconHeight * 0.5;\n var path, fillPath;\n\n var outline = DOMutil.getSVGElement(\"rect\", framework.svgElements, framework.svg);\n outline.setAttributeNS(null, \"x\", x);\n outline.setAttributeNS(null, \"y\", y - fillHeight);\n outline.setAttributeNS(null, \"width\", iconWidth);\n outline.setAttributeNS(null, \"height\", 2 * fillHeight);\n outline.setAttributeNS(null, \"class\", \"vis-outline\");\n\n //Don't call callback on icon\n DOMutil.drawPoint(x + 0.5 * iconWidth, y, getGroupTemplate(group), framework.svgElements, framework.svg);\n};\n\nfunction getGroupTemplate(group, callbackResult) {\n callbackResult = (typeof callbackResult === 'undefined') ? {} : callbackResult;\n return {\n style: callbackResult.style || group.options.drawPoints.style,\n styles: callbackResult.styles || group.options.drawPoints.styles,\n size: callbackResult.size || group.options.drawPoints.size,\n className: callbackResult.className || group.className\n };\n}\n\nfunction getCallback(framework, group) {\n var callback = undefined;\n // check for the graph2d onRender\n if (framework.options && framework.options.drawPoints && framework.options.drawPoints.onRender && typeof framework.options.drawPoints.onRender == 'function') {\n callback = framework.options.drawPoints.onRender;\n }\n\n // override it with the group onRender if defined\n if (group.group.options && group.group.options.drawPoints && group.group.options.drawPoints.onRender && typeof group.group.options.drawPoints.onRender == 'function') {\n callback = group.group.options.drawPoints.onRender;\n }\n return callback;\n}\n\n\nmodule.exports = Points;\n\n\n// WEBPACK FOOTER //\n// ./lib/timeline/component/graph2d_types/points.js","var DOMutil = require('../../../DOMutil');\n\nfunction Line(groupId, options) {\n}\n\nLine.calcPath = function (dataset, group) {\n if (dataset != null) {\n if (dataset.length > 0) {\n var d = [];\n\n // construct path from dataset\n if (group.options.interpolation.enabled == true) {\n d = Line._catmullRom(dataset, group);\n }\n else {\n d = Line._linear(dataset);\n }\n return d;\n }\n }\n}\n\nLine.drawIcon = function (group, x, y, iconWidth, iconHeight, framework) {\n var fillHeight = iconHeight * 0.5;\n var path, fillPath;\n\n var outline = DOMutil.getSVGElement(\"rect\", framework.svgElements, framework.svg);\n outline.setAttributeNS(null, \"x\", x);\n outline.setAttributeNS(null, \"y\", y - fillHeight);\n outline.setAttributeNS(null, \"width\", iconWidth);\n outline.setAttributeNS(null, \"height\", 2 * fillHeight);\n outline.setAttributeNS(null, \"class\", \"vis-outline\");\n\n path = DOMutil.getSVGElement(\"path\", framework.svgElements, framework.svg);\n path.setAttributeNS(null, \"class\", group.className);\n if (group.style !== undefined) {\n path.setAttributeNS(null, \"style\", group.style);\n }\n\n path.setAttributeNS(null, \"d\", \"M\" + x + \",\" + y + \" L\" + (x + iconWidth) + \",\" + y + \"\");\n if (group.options.shaded.enabled == true) {\n fillPath = DOMutil.getSVGElement(\"path\", framework.svgElements, framework.svg);\n if (group.options.shaded.orientation == 'top') {\n fillPath.setAttributeNS(null, \"d\", \"M\" + x + \", \" + (y - fillHeight) +\n \"L\" + x + \",\" + y + \" L\" + (x + iconWidth) + \",\" + y + \" L\" + (x + iconWidth) + \",\" + (y - fillHeight));\n }\n else {\n fillPath.setAttributeNS(null, \"d\", \"M\" + x + \",\" + y + \" \" +\n \"L\" + x + \",\" + (y + fillHeight) + \" \" +\n \"L\" + (x + iconWidth) + \",\" + (y + fillHeight) +\n \"L\" + (x + iconWidth) + \",\" + y);\n }\n fillPath.setAttributeNS(null, \"class\", group.className + \" vis-icon-fill\");\n if (group.options.shaded.style !== undefined && group.options.shaded.style !== \"\") {\n fillPath.setAttributeNS(null, \"style\", group.options.shaded.style);\n }\n }\n\n if (group.options.drawPoints.enabled == true) {\n var groupTemplate = {\n style: group.options.drawPoints.style,\n styles: group.options.drawPoints.styles,\n size: group.options.drawPoints.size,\n className: group.className\n };\n DOMutil.drawPoint(x + 0.5 * iconWidth, y, groupTemplate, framework.svgElements, framework.svg);\n }\n}\n\nLine.drawShading = function (pathArray, group, subPathArray, framework) {\n // append shading to the path\n if (group.options.shaded.enabled == true) {\n var svgHeight = Number(framework.svg.style.height.replace('px',''));\n var fillPath = DOMutil.getSVGElement('path', framework.svgElements, framework.svg);\n var type = \"L\";\n if (group.options.interpolation.enabled == true){\n type = \"C\";\n }\n var dFill;\n var zero = 0;\n if (group.options.shaded.orientation == 'top') {\n zero = 0;\n }\n else if (group.options.shaded.orientation == 'bottom') {\n zero = svgHeight;\n }\n else {\n zero = Math.min(Math.max(0, group.zeroPosition), svgHeight);\n }\n if (group.options.shaded.orientation == 'group' && (subPathArray != null && subPathArray != undefined)) {\n dFill = 'M' + pathArray[0][0]+ \",\"+pathArray[0][1] + \" \" +\n this.serializePath(pathArray,type,false) +\n ' L'+ subPathArray[subPathArray.length-1][0]+ \",\" + subPathArray[subPathArray.length-1][1] + \" \" +\n this.serializePath(subPathArray,type,true) +\n subPathArray[0][0]+ \",\"+subPathArray[0][1] + \" Z\";\n }\n else {\n dFill = 'M' + pathArray[0][0]+ \",\"+pathArray[0][1] + \" \" +\n this.serializePath(pathArray,type,false) +\n ' V' + zero + ' H'+ pathArray[0][0] + \" Z\";\n }\n\n fillPath.setAttributeNS(null, 'class', group.className + ' vis-fill');\n if (group.options.shaded.style !== undefined) {\n fillPath.setAttributeNS(null, 'style', group.options.shaded.style);\n }\n fillPath.setAttributeNS(null, 'd', dFill);\n }\n}\n\n/**\n * draw a line graph\n *\n * @param dataset\n * @param group\n */\nLine.draw = function (pathArray, group, framework) {\n if (pathArray != null && pathArray != undefined) {\n var path = DOMutil.getSVGElement('path', framework.svgElements, framework.svg);\n path.setAttributeNS(null, \"class\", group.className);\n if (group.style !== undefined) {\n path.setAttributeNS(null, \"style\", group.style);\n }\n\n var type = \"L\";\n if (group.options.interpolation.enabled == true){\n type = \"C\";\n }\n // copy properties to path for drawing.\n path.setAttributeNS(null, 'd', 'M' + pathArray[0][0]+ \",\"+pathArray[0][1] + \" \" + this.serializePath(pathArray,type,false));\n }\n};\n\nLine.serializePath = function(pathArray,type,inverse){\n if (pathArray.length < 2){\n //Too little data to create a path.\n return \"\";\n }\n var d = type;\n if (inverse){\n for (var i = pathArray.length-2; i > 0; i--){\n d += pathArray[i][0] + \",\" + pathArray[i][1] + \" \";\n }\n }\n else {\n for (var i = 1; i < pathArray.length; i++){\n d += pathArray[i][0] + \",\" + pathArray[i][1] + \" \";\n }\n }\n return d;\n}\n\n/**\n * This uses an uniform parametrization of the interpolation algorithm:\n * 'On the Parameterization of Catmull-Rom Curves' by Cem Yuksel et al.\n * @param data\n * @returns {string}\n * @private\n */\nLine._catmullRomUniform = function (data) {\n // catmull rom\n var p0, p1, p2, p3, bp1, bp2;\n var d = [];\n d.push( [ Math.round(data[0].screen_x) , Math.round(data[0].screen_y) ]);\n var normalization = 1 / 6;\n var length = data.length;\n for (var i = 0; i < length - 1; i++) {\n\n p0 = (i == 0) ? data[0] : data[i - 1];\n p1 = data[i];\n p2 = data[i + 1];\n p3 = (i + 2 < length) ? data[i + 2] : p2;\n\n\n // Catmull-Rom to Cubic Bezier conversion matrix\n // 0 1 0 0\n // -1/6 1 1/6 0\n // 0 1/6 1 -1/6\n // 0 0 1 0\n\n // bp0 = { x: p1.x, y: p1.y };\n bp1 = {\n screen_x: ((-p0.screen_x + 6 * p1.screen_x + p2.screen_x) * normalization),\n screen_y: ((-p0.screen_y + 6 * p1.screen_y + p2.screen_y) * normalization)\n };\n bp2 = {\n screen_x: (( p1.screen_x + 6 * p2.screen_x - p3.screen_x) * normalization),\n screen_y: (( p1.screen_y + 6 * p2.screen_y - p3.screen_y) * normalization)\n };\n // bp0 = { x: p2.x, y: p2.y };\n\n d.push( [ bp1.screen_x , bp1.screen_y ]);\n d.push( [ bp2.screen_x , bp2.screen_y ]);\n d.push( [ p2.screen_x , p2.screen_y ]);\n }\n\n return d;\n};\n\n/**\n * This uses either the chordal or centripetal parameterization of the catmull-rom algorithm.\n * By default, the centripetal parameterization is used because this gives the nicest results.\n * These parameterizations are relatively heavy because the distance between 4 points have to be calculated.\n *\n * One optimization can be used to reuse distances since this is a sliding window approach.\n * @param data\n * @param group\n * @returns {string}\n * @private\n */\nLine._catmullRom = function (data, group) {\n var alpha = group.options.interpolation.alpha;\n if (alpha == 0 || alpha === undefined) {\n return this._catmullRomUniform(data);\n }\n else {\n var p0, p1, p2, p3, bp1, bp2, d1, d2, d3, A, B, N, M;\n var d3powA, d2powA, d3pow2A, d2pow2A, d1pow2A, d1powA;\n var d = [];\n d.push( [ Math.round(data[0].screen_x) , Math.round(data[0].screen_y) ]);\n var length = data.length;\n for (var i = 0; i < length - 1; i++) {\n\n p0 = (i == 0) ? data[0] : data[i - 1];\n p1 = data[i];\n p2 = data[i + 1];\n p3 = (i + 2 < length) ? data[i + 2] : p2;\n\n d1 = Math.sqrt(Math.pow(p0.screen_x - p1.screen_x, 2) + Math.pow(p0.screen_y - p1.screen_y, 2));\n d2 = Math.sqrt(Math.pow(p1.screen_x - p2.screen_x, 2) + Math.pow(p1.screen_y - p2.screen_y, 2));\n d3 = Math.sqrt(Math.pow(p2.screen_x - p3.screen_x, 2) + Math.pow(p2.screen_y - p3.screen_y, 2));\n\n // Catmull-Rom to Cubic Bezier conversion matrix\n\n // A = 2d1^2a + 3d1^a * d2^a + d3^2a\n // B = 2d3^2a + 3d3^a * d2^a + d2^2a\n\n // [ 0 1 0 0 ]\n // [ -d2^2a /N A/N d1^2a /N 0 ]\n // [ 0 d3^2a /M B/M -d2^2a /M ]\n // [ 0 0 1 0 ]\n\n d3powA = Math.pow(d3, alpha);\n d3pow2A = Math.pow(d3, 2 * alpha);\n d2powA = Math.pow(d2, alpha);\n d2pow2A = Math.pow(d2, 2 * alpha);\n d1powA = Math.pow(d1, alpha);\n d1pow2A = Math.pow(d1, 2 * alpha);\n\n A = 2 * d1pow2A + 3 * d1powA * d2powA + d2pow2A;\n B = 2 * d3pow2A + 3 * d3powA * d2powA + d2pow2A;\n N = 3 * d1powA * (d1powA + d2powA);\n if (N > 0) {\n N = 1 / N;\n }\n M = 3 * d3powA * (d3powA + d2powA);\n if (M > 0) {\n M = 1 / M;\n }\n\n bp1 = {\n screen_x: ((-d2pow2A * p0.screen_x + A * p1.screen_x + d1pow2A * p2.screen_x) * N),\n screen_y: ((-d2pow2A * p0.screen_y + A * p1.screen_y + d1pow2A * p2.screen_y) * N)\n };\n\n bp2 = {\n screen_x: (( d3pow2A * p1.screen_x + B * p2.screen_x - d2pow2A * p3.screen_x) * M),\n screen_y: (( d3pow2A * p1.screen_y + B * p2.screen_y - d2pow2A * p3.screen_y) * M)\n };\n\n if (bp1.screen_x == 0 && bp1.screen_y == 0) {\n bp1 = p1;\n }\n if (bp2.screen_x == 0 && bp2.screen_y == 0) {\n bp2 = p2;\n }\n d.push( [ bp1.screen_x , bp1.screen_y ]);\n d.push( [ bp2.screen_x , bp2.screen_y ]);\n d.push( [ p2.screen_x , p2.screen_y ]);\n }\n\n return d;\n }\n};\n\n/**\n * this generates the SVG path for a linear drawing between datapoints.\n * @param data\n * @returns {string}\n * @private\n */\nLine._linear = function (data) {\n // linear\n var d = [];\n for (var i = 0; i < data.length; i++) {\n d.push([ data[i].screen_x , data[i].screen_y ]);\n }\n return d;\n};\n\nmodule.exports = Line;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/timeline/component/graph2d_types/line.js","var util = require('../../util');\nvar DOMutil = require('../../DOMutil');\nvar Component = require('./Component');\n\n/**\n * Legend for Graph2d\n */\nfunction Legend(body, options, side, linegraphOptions) {\n this.body = body;\n this.defaultOptions = {\n enabled: false,\n icons: true,\n iconSize: 20,\n iconSpacing: 6,\n left: {\n visible: true,\n position: 'top-left' // top/bottom - left,center,right\n },\n right: {\n visible: true,\n position: 'top-right' // top/bottom - left,center,right\n }\n }\n\n this.side = side;\n this.options = util.extend({},this.defaultOptions);\n this.linegraphOptions = linegraphOptions;\n\n this.svgElements = {};\n this.dom = {};\n this.groups = {};\n this.amountOfGroups = 0;\n this._create();\n this.framework = {svg: this.svg, svgElements: this.svgElements, options: this.options, groups: this.groups};\n\n this.setOptions(options);\n}\n\nLegend.prototype = new Component();\n\nLegend.prototype.clear = function() {\n this.groups = {};\n this.amountOfGroups = 0;\n};\n\nLegend.prototype.addGroup = function(label, graphOptions) {\n\n // Include a group only if the group option 'excludeFromLegend: false' is not set.\n if (graphOptions.options.excludeFromLegend != true) {\n if (!this.groups.hasOwnProperty(label)) {\n this.groups[label] = graphOptions;\n }\n this.amountOfGroups += 1;\n }\n};\n\nLegend.prototype.updateGroup = function(label, graphOptions) {\n this.groups[label] = graphOptions;\n};\n\nLegend.prototype.removeGroup = function(label) {\n if (this.groups.hasOwnProperty(label)) {\n delete this.groups[label];\n this.amountOfGroups -= 1;\n }\n};\n\nLegend.prototype._create = function() {\n this.dom.frame = document.createElement('div');\n this.dom.frame.className = 'vis-legend';\n this.dom.frame.style.position = \"absolute\";\n this.dom.frame.style.top = \"10px\";\n this.dom.frame.style.display = \"block\";\n\n this.dom.textArea = document.createElement('div');\n this.dom.textArea.className = 'vis-legend-text';\n this.dom.textArea.style.position = \"relative\";\n this.dom.textArea.style.top = \"0px\";\n\n this.svg = document.createElementNS('http://www.w3.org/2000/svg',\"svg\");\n this.svg.style.position = 'absolute';\n this.svg.style.top = 0 +'px';\n this.svg.style.width = this.options.iconSize + 5 + 'px';\n this.svg.style.height = '100%';\n\n this.dom.frame.appendChild(this.svg);\n this.dom.frame.appendChild(this.dom.textArea);\n};\n\n/**\n * Hide the component from the DOM\n */\nLegend.prototype.hide = function() {\n // remove the frame containing the items\n if (this.dom.frame.parentNode) {\n this.dom.frame.parentNode.removeChild(this.dom.frame);\n }\n};\n\n/**\n * Show the component in the DOM (when not already visible).\n * @return {Boolean} changed\n */\nLegend.prototype.show = function() {\n // show frame containing the items\n if (!this.dom.frame.parentNode) {\n this.body.dom.center.appendChild(this.dom.frame);\n }\n};\n\nLegend.prototype.setOptions = function(options) {\n var fields = ['enabled','orientation','icons','left','right'];\n util.selectiveDeepExtend(fields, this.options, options);\n};\n\nLegend.prototype.redraw = function() {\n var activeGroups = 0;\n var groupArray = Object.keys(this.groups);\n groupArray.sort(function (a,b) {\n return (a < b ? -1 : 1);\n })\n\n for (var i = 0; i < groupArray.length; i++) {\n var groupId = groupArray[i];\n if (this.groups[groupId].visible == true && (this.linegraphOptions.visibility[groupId] === undefined || this.linegraphOptions.visibility[groupId] == true)) {\n activeGroups++;\n }\n }\n\n if (this.options[this.side].visible == false || this.amountOfGroups == 0 || this.options.enabled == false || activeGroups == 0) {\n this.hide();\n }\n else {\n this.show();\n if (this.options[this.side].position == 'top-left' || this.options[this.side].position == 'bottom-left') {\n this.dom.frame.style.left = '4px';\n this.dom.frame.style.textAlign = \"left\";\n this.dom.textArea.style.textAlign = \"left\";\n this.dom.textArea.style.left = (this.options.iconSize + 15) + 'px';\n this.dom.textArea.style.right = '';\n this.svg.style.left = 0 +'px';\n this.svg.style.right = '';\n }\n else {\n this.dom.frame.style.right = '4px';\n this.dom.frame.style.textAlign = \"right\";\n this.dom.textArea.style.textAlign = \"right\";\n this.dom.textArea.style.right = (this.options.iconSize + 15) + 'px';\n this.dom.textArea.style.left = '';\n this.svg.style.right = 0 +'px';\n this.svg.style.left = '';\n }\n\n if (this.options[this.side].position == 'top-left' || this.options[this.side].position == 'top-right') {\n this.dom.frame.style.top = 4 - Number(this.body.dom.center.style.top.replace(\"px\",\"\")) + 'px';\n this.dom.frame.style.bottom = '';\n }\n else {\n var scrollableHeight = this.body.domProps.center.height - this.body.domProps.centerContainer.height;\n this.dom.frame.style.bottom = 4 + scrollableHeight + Number(this.body.dom.center.style.top.replace(\"px\",\"\")) + 'px';\n this.dom.frame.style.top = '';\n }\n\n if (this.options.icons == false) {\n this.dom.frame.style.width = this.dom.textArea.offsetWidth + 10 + 'px';\n this.dom.textArea.style.right = '';\n this.dom.textArea.style.left = '';\n this.svg.style.width = '0px';\n }\n else {\n this.dom.frame.style.width = this.options.iconSize + 15 + this.dom.textArea.offsetWidth + 10 + 'px'\n this.drawLegendIcons();\n }\n\n var content = '';\n for (var i = 0; i < groupArray.length; i++) {\n var groupId = groupArray[i];\n if (this.groups[groupId].visible == true && (this.linegraphOptions.visibility[groupId] === undefined || this.linegraphOptions.visibility[groupId] == true)) {\n content += this.groups[groupId].content + '
';\n }\n }\n this.dom.textArea.innerHTML = content;\n this.dom.textArea.style.lineHeight = ((0.75 * this.options.iconSize) + this.options.iconSpacing) + 'px';\n }\n};\n\nLegend.prototype.drawLegendIcons = function() {\n if (this.dom.frame.parentNode) {\n var groupArray = Object.keys(this.groups);\n groupArray.sort(function (a,b) {\n return (a < b ? -1 : 1);\n });\n\n // this resets the elements so the order is maintained\n DOMutil.resetElements(this.svgElements);\n\n var padding = window.getComputedStyle(this.dom.frame).paddingTop;\n var iconOffset = Number(padding.replace('px',''));\n var x = iconOffset;\n var iconWidth = this.options.iconSize;\n var iconHeight = 0.75 * this.options.iconSize;\n var y = iconOffset + 0.5 * iconHeight + 3;\n\n this.svg.style.width = iconWidth + 5 + iconOffset + 'px';\n\n for (var i = 0; i < groupArray.length; i++) {\n var groupId = groupArray[i];\n if (this.groups[groupId].visible == true && (this.linegraphOptions.visibility[groupId] === undefined || this.linegraphOptions.visibility[groupId] == true)) {\n this.groups[groupId].getLegend(iconWidth, iconHeight, this.framework, x, y);\n y += iconHeight + this.options.iconSpacing;\n }\n }\n }\n};\n\nmodule.exports = Legend;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/timeline/component/Legend.js","/**\n * This object contains all possible options. It will check if the types are correct, if required if the option is one\n * of the allowed values.\n *\n * __any__ means that the name of the property does not matter.\n * __type__ is a required field for all objects and contains the allowed types of all objects\n */\nlet string = 'string';\nlet bool = 'boolean';\nlet number = 'number';\nlet array = 'array';\nlet date = 'date';\nlet object = 'object'; // should only be in a __type__ property\nlet dom = 'dom';\nlet moment = 'moment';\nlet any = 'any';\n\n\nlet allOptions = {\n configure: {\n enabled: {'boolean': bool},\n filter: {'boolean': bool,'function': 'function'},\n container: {dom},\n __type__: {object,'boolean': bool,'function': 'function'}\n },\n\n //globals :\n yAxisOrientation: {string:['left','right']},\n defaultGroup: {string},\n sort: {'boolean': bool},\n sampling: {'boolean': bool},\n stack:{'boolean': bool},\n graphHeight: {string, number},\n shaded: {\n enabled: {'boolean': bool},\n orientation: {string:['bottom','top','zero','group']}, // top, bottom, zero, group\n groupId: {object},\n __type__: {'boolean': bool,object}\n },\n style: {string:['line','bar','points']}, // line, bar\n barChart: {\n width: {number},\n minWidth: {number},\n sideBySide: {'boolean': bool},\n align: {string:['left','center','right']},\n __type__: {object}\n },\n interpolation: {\n enabled: {'boolean': bool},\n parametrization: {string:['centripetal', 'chordal','uniform']}, // uniform (alpha = 0.0), chordal (alpha = 1.0), centripetal (alpha = 0.5)\n alpha: {number},\n __type__: {object,'boolean': bool}\n },\n drawPoints: {\n enabled: {'boolean': bool},\n onRender: { 'function': 'function' },\n size: {number},\n style: {string:['square','circle']}, // square, circle\n __type__: {object,'boolean': bool,'function': 'function'}\n },\n dataAxis: {\n showMinorLabels: {'boolean': bool},\n showMajorLabels: {'boolean': bool},\n icons: {'boolean': bool},\n width: {string, number},\n visible: {'boolean': bool},\n alignZeros: {'boolean': bool},\n left:{\n range: {min:{number},max:{number},__type__: {object}},\n format: {'function': 'function'},\n title: {text:{string,number},style:{string},__type__: {object}},\n __type__: {object}\n },\n right:{\n range: {min:{number},max:{number},__type__: {object}},\n format: {'function': 'function'},\n title: {text:{string,number},style:{string},__type__: {object}},\n __type__: {object}\n },\n __type__: {object}\n },\n legend: {\n enabled: {'boolean': bool},\n icons: {'boolean': bool},\n left: {\n visible: {'boolean': bool},\n position: {string:['top-right','bottom-right','top-left','bottom-left']},\n __type__: {object}\n },\n right: {\n visible: {'boolean': bool},\n position: {string:['top-right','bottom-right','top-left','bottom-left']},\n __type__: {object}\n },\n __type__: {object,'boolean': bool}\n },\n groups: {\n visibility: {any},\n __type__: {object}\n },\n\n autoResize: {'boolean': bool},\n throttleRedraw: {number}, // TODO: DEPRICATED see https://github.com/almende/vis/issues/2511\n clickToUse: {'boolean': bool},\n end: {number, date, string, moment},\n format: {\n minorLabels: {\n millisecond: {string,'undefined': 'undefined'},\n second: {string,'undefined': 'undefined'},\n minute: {string,'undefined': 'undefined'},\n hour: {string,'undefined': 'undefined'},\n weekday: {string,'undefined': 'undefined'},\n day: {string,'undefined': 'undefined'},\n month: {string,'undefined': 'undefined'},\n year: {string,'undefined': 'undefined'},\n __type__: {object}\n },\n majorLabels: {\n millisecond: {string,'undefined': 'undefined'},\n second: {string,'undefined': 'undefined'},\n minute: {string,'undefined': 'undefined'},\n hour: {string,'undefined': 'undefined'},\n weekday: {string,'undefined': 'undefined'},\n day: {string,'undefined': 'undefined'},\n month: {string,'undefined': 'undefined'},\n year: {string,'undefined': 'undefined'},\n __type__: {object}\n },\n __type__: {object}\n },\n moment: {'function': 'function'},\n height: {string, number},\n hiddenDates: {\n start: {date, number, string, moment},\n end: {date, number, string, moment},\n repeat: {string},\n __type__: {object, array}\n },\n locale:{string},\n locales:{\n __any__: {any},\n __type__: {object}\n },\n max: {date, number, string, moment},\n maxHeight: {number, string},\n maxMinorChars: {number},\n min: {date, number, string, moment},\n minHeight: {number, string},\n moveable: {'boolean': bool},\n multiselect: {'boolean': bool},\n orientation: {string},\n showCurrentTime: {'boolean': bool},\n showMajorLabels: {'boolean': bool},\n showMinorLabels: {'boolean': bool},\n start: {date, number, string, moment},\n timeAxis: {\n scale: {string,'undefined': 'undefined'},\n step: {number,'undefined': 'undefined'},\n __type__: {object}\n },\n width: {string, number},\n zoomable: {'boolean': bool},\n zoomKey: {string: ['ctrlKey', 'altKey', 'metaKey', '']},\n zoomMax: {number},\n zoomMin: {number},\n zIndex: {number},\n __type__: {object}\n};\n\nlet configureOptions = {\n global: {\n //yAxisOrientation: ['left','right'], // TDOO: enable as soon as Grahp2d doesn't crash when changing this on the fly\n sort: true,\n sampling: true,\n stack:false,\n shaded: {\n enabled: false,\n orientation: ['zero','top','bottom','group'] // zero, top, bottom\n },\n style: ['line','bar','points'], // line, bar\n barChart: {\n width: [50,5,100,5],\n minWidth: [50,5,100,5],\n sideBySide: false,\n align: ['left','center','right'] // left, center, right\n },\n interpolation: {\n enabled: true,\n parametrization: ['centripetal','chordal','uniform'] // uniform (alpha = 0.0), chordal (alpha = 1.0), centripetal (alpha = 0.5)\n },\n drawPoints: {\n enabled: true,\n size: [6,2,30,1],\n style: ['square', 'circle'] // square, circle\n },\n dataAxis: {\n showMinorLabels: true,\n showMajorLabels: true,\n icons: false,\n width: [40,0,200,1],\n visible: true,\n alignZeros: true,\n left:{\n //range: {min:'undefined': 'undefined'ined,max:'undefined': 'undefined'ined},\n //format: function (value) {return value;},\n title: {text:'',style:''}\n },\n right:{\n //range: {min:'undefined': 'undefined'ined,max:'undefined': 'undefined'ined},\n //format: function (value) {return value;},\n title: {text:'',style:''}\n }\n },\n legend: {\n enabled: false,\n icons: true,\n left: {\n visible: true,\n position: ['top-right','bottom-right','top-left','bottom-left'] // top/bottom - left,right\n },\n right: {\n visible: true,\n position: ['top-right','bottom-right','top-left','bottom-left'] // top/bottom - left,right\n }\n },\n\n autoResize: true,\n clickToUse: false,\n end: '',\n format: {\n minorLabels: {\n millisecond:'SSS',\n second: 's',\n minute: 'HH:mm',\n hour: 'HH:mm',\n weekday: 'ddd D',\n day: 'D',\n month: 'MMM',\n year: 'YYYY'\n },\n majorLabels: {\n millisecond:'HH:mm:ss',\n second: 'D MMMM HH:mm',\n minute: 'ddd D MMMM',\n hour: 'ddd D MMMM',\n weekday: 'MMMM YYYY',\n day: 'MMMM YYYY',\n month: 'YYYY',\n year: ''\n }\n },\n\n height: '',\n locale: '',\n max: '',\n maxHeight: '',\n maxMinorChars: [7, 0, 20, 1],\n min: '',\n minHeight: '',\n moveable:true,\n orientation: ['both', 'bottom', 'top'],\n showCurrentTime: false,\n showMajorLabels: true,\n showMinorLabels: true,\n start: '',\n width: '100%',\n zoomable: true,\n zoomKey: ['ctrlKey', 'altKey', 'metaKey', ''],\n zoomMax: [315360000000000, 10, 315360000000000, 1],\n zoomMin: [10, 10, 315360000000000, 1],\n zIndex: 0\n }\n};\n\nexport {allOptions, configureOptions};\n\n\n\n// WEBPACK FOOTER //\n// ./lib/timeline/optionsGraph2d.js","// utils\nexports.util = require('./lib/util');\nexports.DOMutil = require('./lib/DOMutil');\n\n// data\nexports.DataSet = require('./lib/DataSet');\nexports.DataView = require('./lib/DataView');\nexports.Queue = require('./lib/Queue');\n\n// Network\nexports.Network = require('./lib/network/Network');\nexports.network = {\n Images: require('./lib/network/Images'),\n dotparser: require('./lib/network/dotparser'),\n gephiParser: require('./lib/network/gephiParser'),\n allOptions: require('./lib/network/options')\n};\nexports.network.convertDot = function (input) {return exports.network.dotparser.DOTToGraph(input)};\nexports.network.convertGephi = function (input,options) {return exports.network.gephiParser.parseGephi(input,options)};\n\n// bundled external libraries\nexports.moment = require('./lib/module/moment');\nexports.Hammer = require('./lib/module/hammer');\nexports.keycharm = require('keycharm');\n\n\n// WEBPACK FOOTER //\n// ./index-network.js","// Load custom shapes into CanvasRenderingContext2D\nrequire('./shapes');\n\nlet Emitter = require('emitter-component');\nlet util = require('../util');\nlet DataSet = require('../DataSet');\nlet DataView = require('../DataView');\nlet dotparser = require('./dotparser');\nlet gephiParser = require('./gephiParser');\nlet Activator = require('../shared/Activator');\nlet locales = require('./locales');\n\nimport Images from './Images';\nimport Groups from './modules/Groups';\nimport NodesHandler from './modules/NodesHandler';\nimport EdgesHandler from './modules/EdgesHandler';\nimport PhysicsEngine from './modules/PhysicsEngine';\nimport ClusterEngine from './modules/Clustering';\nimport CanvasRenderer from './modules/CanvasRenderer';\nimport Canvas from './modules/Canvas';\nimport View from './modules/View';\nimport InteractionHandler from './modules/InteractionHandler';\nimport SelectionHandler from \"./modules/SelectionHandler\";\nimport LayoutEngine from \"./modules/LayoutEngine\";\nimport ManipulationSystem from \"./modules/ManipulationSystem\";\nimport Configurator from \"./../shared/Configurator\";\nimport Validator from \"./../shared/Validator\";\nimport {printStyle} from \"./../shared/Validator\";\nimport {allOptions, configureOptions} from './options.js';\nimport KamadaKawai from \"./modules/KamadaKawai.js\"\n\n\n/**\n * @constructor Network\n * Create a network visualization, displaying nodes and edges.\n *\n * @param {Element} container The DOM element in which the Network will\n * be created. Normally a div element.\n * @param {Object} data An object containing parameters\n * {Array} nodes\n * {Array} edges\n * @param {Object} options Options\n */\nfunction Network(container, data, options) {\n if (!(this instanceof Network)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n\n // set constant values\n this.options = {};\n this.defaultOptions = {\n locale: 'en',\n locales: locales,\n clickToUse: false\n };\n util.extend(this.options, this.defaultOptions);\n\n // containers for nodes and edges\n this.body = {\n container: container,\n nodes: {},\n nodeIndices: [],\n edges: {},\n edgeIndices: [],\n emitter: {\n on: this.on.bind(this),\n off: this.off.bind(this),\n emit: this.emit.bind(this),\n once: this.once.bind(this)\n },\n eventListeners: {\n onTap: function() {},\n onTouch: function() {},\n onDoubleTap: function() {},\n onHold: function() {},\n onDragStart: function() {},\n onDrag: function() {},\n onDragEnd: function() {},\n onMouseWheel: function() {},\n onPinch: function() {},\n onMouseMove: function() {},\n onRelease: function() {},\n onContext: function() {}\n },\n data: {\n nodes: null, // A DataSet or DataView\n edges: null // A DataSet or DataView\n },\n functions: {\n createNode: function() {},\n createEdge: function() {},\n getPointer: function() {}\n },\n modules: {},\n view: {\n scale: 1,\n translation: {x: 0, y: 0}\n }\n };\n\n\n\n // bind the event listeners\n this.bindEventListeners();\n\n // setting up all modules\n this.images = new Images(() => this.body.emitter.emit(\"_requestRedraw\")); // object with images\n this.groups = new Groups(); // object with groups\n this.canvas = new Canvas(this.body); // DOM handler\n this.selectionHandler = new SelectionHandler(this.body, this.canvas); // Selection handler\n this.interactionHandler = new InteractionHandler(this.body, this.canvas, this.selectionHandler); // Interaction handler handles all the hammer bindings (that are bound by canvas), key\n this.view = new View(this.body, this.canvas); // camera handler, does animations and zooms\n this.renderer = new CanvasRenderer(this.body, this.canvas); // renderer, starts renderloop, has events that modules can hook into\n this.physics = new PhysicsEngine(this.body); // physics engine, does all the simulations\n this.layoutEngine = new LayoutEngine(this.body); // layout engine for inital layout and hierarchical layout\n this.clustering = new ClusterEngine(this.body); // clustering api\n this.manipulation = new ManipulationSystem(this.body, this.canvas, this.selectionHandler); // data manipulation system\n\n this.nodesHandler = new NodesHandler(this.body, this.images, this.groups, this.layoutEngine); // Handle adding, deleting and updating of nodes as well as global options\n this.edgesHandler = new EdgesHandler(this.body, this.images, this.groups); // Handle adding, deleting and updating of edges as well as global options\n\n this.body.modules[\"kamadaKawai\"] = new KamadaKawai(this.body,150,0.05); // Layouting algorithm.\n this.body.modules[\"clustering\"] = this.clustering;\n\n // create the DOM elements\n this.canvas._create();\n\n // apply options\n this.setOptions(options);\n\n // load data (the disable start variable will be the same as the enabled clustering)\n this.setData(data);\n\n}\n\n// Extend Network with an Emitter mixin\nEmitter(Network.prototype);\n\n\n/**\n * Set options\n * @param {Object} options\n */\nNetwork.prototype.setOptions = function (options) {\n if (options !== undefined) {\n let errorFound = Validator.validate(options, allOptions);\n if (errorFound === true) {\n console.log('%cErrors have been found in the supplied options object.', printStyle);\n }\n\n // copy the global fields over\n let fields = ['locale','locales','clickToUse'];\n util.selectiveDeepExtend(fields,this.options, options);\n\n // the hierarchical system can adapt the edges and the physics to it's own options because not all combinations work with the hierarichical system.\n options = this.layoutEngine.setOptions(options.layout, options);\n\n this.canvas.setOptions(options); // options for canvas are in globals\n\n // pass the options to the modules\n this.groups.setOptions(options.groups);\n this.nodesHandler.setOptions(options.nodes);\n this.edgesHandler.setOptions(options.edges);\n this.physics.setOptions(options.physics);\n this.manipulation.setOptions(options.manipulation, options, this.options); // manipulation uses the locales in the globals\n\n this.interactionHandler.setOptions(options.interaction);\n this.renderer.setOptions(options.interaction); // options for rendering are in interaction\n this.selectionHandler.setOptions(options.interaction); // options for selection are in interaction\n\n // reload the settings of the nodes to apply changes in groups that are not referenced by pointer.\n if (options.groups !== undefined) {\n this.body.emitter.emit(\"refreshNodes\");\n }\n // these two do not have options at the moment, here for completeness\n //this.view.setOptions(options.view);\n //this.clustering.setOptions(options.clustering);\n\n if ('configure' in options) {\n if (!this.configurator) {\n this.configurator = new Configurator(this, this.body.container, configureOptions, this.canvas.pixelRatio);\n }\n\n this.configurator.setOptions(options.configure);\n }\n\n // if the configuration system is enabled, copy all options and put them into the config system\n if (this.configurator && this.configurator.options.enabled === true) {\n let networkOptions = {nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};\n util.deepExtend(networkOptions.nodes, this.nodesHandler.options);\n util.deepExtend(networkOptions.edges, this.edgesHandler.options);\n util.deepExtend(networkOptions.layout, this.layoutEngine.options);\n // load the selectionHandler and render default options in to the interaction group\n util.deepExtend(networkOptions.interaction, this.selectionHandler.options);\n util.deepExtend(networkOptions.interaction, this.renderer.options);\n\n util.deepExtend(networkOptions.interaction, this.interactionHandler.options);\n util.deepExtend(networkOptions.manipulation, this.manipulation.options);\n util.deepExtend(networkOptions.physics, this.physics.options);\n\n // load globals into the global object\n util.deepExtend(networkOptions.global, this.canvas.options);\n util.deepExtend(networkOptions.global, this.options);\n\n this.configurator.setModuleOptions(networkOptions);\n }\n\n // handle network global options\n if (options.clickToUse !== undefined) {\n if (options.clickToUse === true) {\n if (this.activator === undefined) {\n this.activator = new Activator(this.canvas.frame);\n this.activator.on('change', () => {this.body.emitter.emit(\"activate\")});\n }\n }\n else {\n if (this.activator !== undefined) {\n this.activator.destroy();\n delete this.activator;\n }\n this.body.emitter.emit(\"activate\");\n }\n }\n else {\n this.body.emitter.emit(\"activate\");\n }\n\n this.canvas.setSize();\n // start the physics simulation. Can be safely called multiple times.\n this.body.emitter.emit(\"startSimulation\");\n }\n};\n\n\n/**\n * Update the this.body.nodeIndices with the most recent node index list\n * @private\n */\nNetwork.prototype._updateVisibleIndices = function () {\n let nodes = this.body.nodes;\n let edges = this.body.edges;\n this.body.nodeIndices = [];\n this.body.edgeIndices = [];\n\n for (let nodeId in nodes) {\n if (nodes.hasOwnProperty(nodeId)) {\n if (nodes[nodeId].options.hidden === false) {\n this.body.nodeIndices.push(nodes[nodeId].id);\n }\n }\n }\n\n for (let edgeId in edges) {\n if (edges.hasOwnProperty(edgeId)) {\n if (edges[edgeId].options.hidden === false) {\n this.body.edgeIndices.push(edges[edgeId].id);\n }\n }\n }\n};\n\n\n/**\n * Bind all events\n */\nNetwork.prototype.bindEventListeners = function () {\n // this event will trigger a rebuilding of the cache everything. Used when nodes or edges have been added or removed.\n this.body.emitter.on(\"_dataChanged\", () => {\n // update shortcut lists\n this._updateVisibleIndices();\n this.body.emitter.emit(\"_requestRedraw\");\n // call the dataUpdated event because the only difference between the two is the updating of the indices\n this.body.emitter.emit(\"_dataUpdated\");\n });\n\n // this is called when options of EXISTING nodes or edges have changed.\n this.body.emitter.on(\"_dataUpdated\", () => {\n // update values\n this._updateValueRange(this.body.nodes);\n this._updateValueRange(this.body.edges);\n // start simulation (can be called safely, even if already running)\n this.body.emitter.emit(\"startSimulation\");\n this.body.emitter.emit(\"_requestRedraw\");\n });\n};\n\n\n/**\n * Set nodes and edges, and optionally options as well.\n *\n * @param {Object} data Object containing parameters:\n * {Array | DataSet | DataView} [nodes] Array with nodes\n * {Array | DataSet | DataView} [edges] Array with edges\n * {String} [dot] String containing data in DOT format\n * {String} [gephi] String containing data in gephi JSON format\n * {Options} [options] Object with options\n */\nNetwork.prototype.setData = function (data) {\n // reset the physics engine.\n this.body.emitter.emit(\"resetPhysics\");\n this.body.emitter.emit(\"_resetData\");\n\n // unselect all to ensure no selections from old data are carried over.\n this.selectionHandler.unselectAll();\n\n if (data && data.dot && (data.nodes || data.edges)) {\n throw new SyntaxError('Data must contain either parameter \"dot\" or ' +\n ' parameter pair \"nodes\" and \"edges\", but not both.');\n }\n\n // set options\n this.setOptions(data && data.options);\n // set all data\n if (data && data.dot) {\n 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);');\n // parse DOT file\n var dotData = dotparser.DOTToGraph(data.dot);\n this.setData(dotData);\n return;\n }\n else if (data && data.gephi) {\n // parse DOT file\n 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);');\n var gephiData = gephiParser.parseGephi(data.gephi);\n this.setData(gephiData);\n return;\n }\n else {\n this.nodesHandler.setData(data && data.nodes, true);\n this.edgesHandler.setData(data && data.edges, true);\n }\n\n // emit change in data\n this.body.emitter.emit(\"_dataChanged\");\n\n // emit data loaded\n this.body.emitter.emit(\"_dataLoaded\");\n\n // find a stable position or start animating to a stable position\n this.body.emitter.emit(\"initPhysics\");\n};\n\n\n/**\n * Cleans up all bindings of the network, removing it fully from the memory IF the variable is set to null after calling this function.\n * var network = new vis.Network(..);\n * network.destroy();\n * network = null;\n */\nNetwork.prototype.destroy = function () {\n this.body.emitter.emit(\"destroy\");\n // clear events\n this.body.emitter.off();\n this.off();\n\n // delete modules\n delete this.groups;\n delete this.canvas;\n delete this.selectionHandler;\n delete this.interactionHandler;\n delete this.view;\n delete this.renderer;\n delete this.physics;\n delete this.layoutEngine;\n delete this.clustering;\n delete this.manipulation;\n delete this.nodesHandler;\n delete this.edgesHandler;\n delete this.configurator;\n delete this.images;\n\n for (var nodeId in this.body.nodes) {\n delete this.body.nodes[nodeId];\n }\n for (var edgeId in this.body.edges) {\n delete this.body.edges[edgeId];\n }\n\n // remove the container and everything inside it recursively\n util.recursiveDOMDelete(this.body.container);\n};\n\n\n/**\n * Update the values of all object in the given array according to the current\n * value range of the objects in the array.\n * @param {Object} obj An object containing a set of Edges or Nodes\n * The objects must have a method getValue() and\n * setValueRange(min, max).\n * @private\n */\nNetwork.prototype._updateValueRange = function (obj) {\n var id;\n\n // determine the range of the objects\n var valueMin = undefined;\n var valueMax = undefined;\n var valueTotal = 0;\n for (id in obj) {\n if (obj.hasOwnProperty(id)) {\n var value = obj[id].getValue();\n if (value !== undefined) {\n valueMin = (valueMin === undefined) ? value : Math.min(value, valueMin);\n valueMax = (valueMax === undefined) ? value : Math.max(value, valueMax);\n valueTotal += value;\n }\n }\n }\n\n // adjust the range of all objects\n if (valueMin !== undefined && valueMax !== undefined) {\n for (id in obj) {\n if (obj.hasOwnProperty(id)) {\n obj[id].setValueRange(valueMin, valueMax, valueTotal);\n }\n }\n }\n};\n\n\n/**\n * Returns true when the Network is active.\n * @returns {boolean}\n */\nNetwork.prototype.isActive = function () {\n return !this.activator || this.activator.active;\n};\n\n\nNetwork.prototype.setSize = function() {return this.canvas.setSize.apply(this.canvas,arguments);};\nNetwork.prototype.canvasToDOM = function() {return this.canvas.canvasToDOM.apply(this.canvas,arguments);};\nNetwork.prototype.DOMtoCanvas = function() {return this.canvas.DOMtoCanvas.apply(this.canvas,arguments);};\nNetwork.prototype.findNode = function() {return this.clustering.findNode.apply(this.clustering,arguments);};\nNetwork.prototype.isCluster = function() {return this.clustering.isCluster.apply(this.clustering,arguments);};\nNetwork.prototype.openCluster = function() {return this.clustering.openCluster.apply(this.clustering,arguments);};\nNetwork.prototype.cluster = function() {return this.clustering.cluster.apply(this.clustering,arguments);};\nNetwork.prototype.getNodesInCluster = function() {return this.clustering.getNodesInCluster.apply(this.clustering,arguments);};\nNetwork.prototype.clusterByConnection = function() {return this.clustering.clusterByConnection.apply(this.clustering,arguments);};\nNetwork.prototype.clusterByHubsize = function() {return this.clustering.clusterByHubsize.apply(this.clustering,arguments);};\nNetwork.prototype.clusterOutliers = function() {return this.clustering.clusterOutliers.apply(this.clustering,arguments);};\nNetwork.prototype.getSeed = function() {return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments);};\nNetwork.prototype.enableEditMode = function() {return this.manipulation.enableEditMode.apply(this.manipulation,arguments);};\nNetwork.prototype.disableEditMode = function() {return this.manipulation.disableEditMode.apply(this.manipulation,arguments);};\nNetwork.prototype.addNodeMode = function() {return this.manipulation.addNodeMode.apply(this.manipulation,arguments);};\nNetwork.prototype.editNode = function() {return this.manipulation.editNode.apply(this.manipulation,arguments);};\nNetwork.prototype.editNodeMode = function() {console.log(\"Deprecated: Please use editNode instead of editNodeMode.\"); return this.manipulation.editNode.apply(this.manipulation,arguments);};\nNetwork.prototype.addEdgeMode = function() {return this.manipulation.addEdgeMode.apply(this.manipulation,arguments);};\nNetwork.prototype.editEdgeMode = function() {return this.manipulation.editEdgeMode.apply(this.manipulation,arguments);};\nNetwork.prototype.deleteSelected = function() {return this.manipulation.deleteSelected.apply(this.manipulation,arguments);};\nNetwork.prototype.getPositions = function() {return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments);};\nNetwork.prototype.storePositions = function() {return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments);};\nNetwork.prototype.moveNode = function() {return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments);};\nNetwork.prototype.getBoundingBox = function() {return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments);};\nNetwork.prototype.getConnectedNodes = function(objectId) {\n if (this.body.nodes[objectId] !== undefined) {\n return this.nodesHandler.getConnectedNodes.apply(this.nodesHandler,arguments);\n }\n else {\n return this.edgesHandler.getConnectedNodes.apply(this.edgesHandler,arguments);\n }\n};\nNetwork.prototype.getConnectedEdges = function() {return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments);};\nNetwork.prototype.startSimulation = function() {return this.physics.startSimulation.apply(this.physics,arguments);};\nNetwork.prototype.stopSimulation = function() {return this.physics.stopSimulation.apply(this.physics,arguments);};\nNetwork.prototype.stabilize = function() {return this.physics.stabilize.apply(this.physics,arguments);};\nNetwork.prototype.getSelection = function() {return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments);};\nNetwork.prototype.setSelection = function() {return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments);};\nNetwork.prototype.getSelectedNodes = function() {return this.selectionHandler.getSelectedNodes.apply(this.selectionHandler,arguments);};\nNetwork.prototype.getSelectedEdges = function() {return this.selectionHandler.getSelectedEdges.apply(this.selectionHandler,arguments);};\nNetwork.prototype.getNodeAt = function() {\n var node = this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);\n if (node !== undefined && node.id !== undefined) {\n return node.id;\n }\n return node;\n};\nNetwork.prototype.getEdgeAt = function() {\n var edge = this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);\n if (edge !== undefined && edge.id !== undefined) {\n return edge.id;\n }\n return edge;\n };\nNetwork.prototype.selectNodes = function() {return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments);};\nNetwork.prototype.selectEdges = function() {return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments);};\nNetwork.prototype.unselectAll = function() {\n this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments);\n this.redraw();\n};\nNetwork.prototype.redraw = function() {return this.renderer.redraw.apply(this.renderer,arguments);};\nNetwork.prototype.getScale = function() {return this.view.getScale.apply(this.view,arguments);};\nNetwork.prototype.getViewPosition = function() {return this.view.getViewPosition.apply(this.view,arguments);};\nNetwork.prototype.fit = function() {return this.view.fit.apply(this.view,arguments);};\nNetwork.prototype.moveTo = function() {return this.view.moveTo.apply(this.view,arguments);};\nNetwork.prototype.focus = function() {return this.view.focus.apply(this.view,arguments);};\nNetwork.prototype.releaseNode = function() {return this.view.releaseNode.apply(this.view,arguments);};\nNetwork.prototype.getOptionsFromConfigurator = function() {\n let options = {};\n if (this.configurator) {\n options = this.configurator.getOptions.apply(this.configurator);\n }\n return options;\n};\n\n\n\nmodule.exports = Network;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/Network.js","/**\n * @class Images\n * This class loads images and keeps them stored.\n */\nclass Images{\n constructor(callback){\n this.images = {};\n this.imageBroken = {};\n this.callback = callback;\n }\n \n /**\n * @param {string} url The Url to cache the image as \n * @return {Image} imageToLoadBrokenUrlOn The image object\n */ \n _addImageToCache (url, imageToCache) {\n // IE11 fix -- thanks dponch!\n if (imageToCache.width === 0) {\n document.body.appendChild(imageToCache);\n imageToCache.width = imageToCache.offsetWidth;\n imageToCache.height = imageToCache.offsetHeight;\n document.body.removeChild(imageToCache);\n }\n \n this.images[url] = imageToCache;\n } \n \n /**\n * @param {string} url The original Url that failed to load, if the broken image is successfully loaded it will be added to the cache using this Url as the key so that subsequent requests for this Url will return the broken image\n * @param {string} brokenUrl Url the broken image to try and load\n * @return {Image} imageToLoadBrokenUrlOn The image object\n */ \n _tryloadBrokenUrl (url, brokenUrl, imageToLoadBrokenUrlOn) {\n //If any of the parameters aren't specified then exit the function because nothing constructive can be done\n if (url === undefined || brokenUrl === undefined || imageToLoadBrokenUrlOn === undefined) return;\n \n //Clear the old subscription to the error event and put a new in place that only handle errors in loading the brokenImageUrl\n imageToLoadBrokenUrlOn.onerror = () => {\n console.error(\"Could not load brokenImage:\", brokenUrl);\n //Add an empty image to the cache so that when subsequent load calls are made for the url we don't try load the image and broken image again\n this._addImageToCache(url, new Image());\n };\n \n //Set the source of the image to the brokenUrl, this is actually what kicks off the loading of the broken image\n imageToLoadBrokenUrlOn.src = brokenUrl;\n }\n \n /**\n * @return {Image} imageToRedrawWith The images that will be passed to the callback when it is invoked\n */ \n _redrawWithImage (imageToRedrawWith) {\n if (this.callback) {\n this.callback(imageToRedrawWith);\n }\n }\n \n /**\n * @param {string} url Url of the image\n * @param {string} brokenUrl Url of an image to use if the url image is not found\n * @return {Image} img The image object\n */ \n load (url, brokenUrl, id) {\n //Try and get the image from the cache, if successful then return the cached image \n var cachedImage = this.images[url]; \n if (cachedImage) return cachedImage;\n \n //Create a new image\n var img = new Image();\n \n //Subscribe to the event that is raised if the image loads successfully \n img.onload = () => {\n //Add the image to the cache and then request a redraw\n this._addImageToCache(url, img);\n this._redrawWithImage(img);\n };\n \n //Subscribe to the event that is raised if the image fails to load\n img.onerror = () => {\n console.error(\"Could not load image:\", url);\n //Try and load the image specified by the brokenUrl using\n this._tryloadBrokenUrl(url, brokenUrl, img);\n }\n \n //Set the source of the image to the url, this is actuall what kicks off the loading of the image\n img.src = url;\n \n //Return the new image\n return img;\n } \n}\n\nexport default Images;\n\n\n// WEBPACK FOOTER //\n// ./lib/network/Images.js","let util = require('../../util');\n\n/**\n * @class Groups\n * This class can store groups and options specific for groups.\n */\nclass Groups {\n constructor() {\n this.clear();\n this.defaultIndex = 0;\n this.groupsArray = [];\n this.groupIndex = 0;\n\n this.defaultGroups = [\n {border: \"#2B7CE9\", background: \"#97C2FC\", highlight: {border: \"#2B7CE9\", background: \"#D2E5FF\"}, hover: {border: \"#2B7CE9\", background: \"#D2E5FF\"}}, // 0: blue\n {border: \"#FFA500\", background: \"#FFFF00\", highlight: {border: \"#FFA500\", background: \"#FFFFA3\"}, hover: {border: \"#FFA500\", background: \"#FFFFA3\"}}, // 1: yellow\n {border: \"#FA0A10\", background: \"#FB7E81\", highlight: {border: \"#FA0A10\", background: \"#FFAFB1\"}, hover: {border: \"#FA0A10\", background: \"#FFAFB1\"}}, // 2: red\n {border: \"#41A906\", background: \"#7BE141\", highlight: {border: \"#41A906\", background: \"#A1EC76\"}, hover: {border: \"#41A906\", background: \"#A1EC76\"}}, // 3: green\n {border: \"#E129F0\", background: \"#EB7DF4\", highlight: {border: \"#E129F0\", background: \"#F0B3F5\"}, hover: {border: \"#E129F0\", background: \"#F0B3F5\"}}, // 4: magenta\n {border: \"#7C29F0\", background: \"#AD85E4\", highlight: {border: \"#7C29F0\", background: \"#D3BDF0\"}, hover: {border: \"#7C29F0\", background: \"#D3BDF0\"}}, // 5: purple\n {border: \"#C37F00\", background: \"#FFA807\", highlight: {border: \"#C37F00\", background: \"#FFCA66\"}, hover: {border: \"#C37F00\", background: \"#FFCA66\"}}, // 6: orange\n {border: \"#4220FB\", background: \"#6E6EFD\", highlight: {border: \"#4220FB\", background: \"#9B9BFD\"}, hover: {border: \"#4220FB\", background: \"#9B9BFD\"}}, // 7: darkblue\n {border: \"#FD5A77\", background: \"#FFC0CB\", highlight: {border: \"#FD5A77\", background: \"#FFD1D9\"}, hover: {border: \"#FD5A77\", background: \"#FFD1D9\"}}, // 8: pink\n {border: \"#4AD63A\", background: \"#C2FABC\", highlight: {border: \"#4AD63A\", background: \"#E6FFE3\"}, hover: {border: \"#4AD63A\", background: \"#E6FFE3\"}}, // 9: mint\n\n {border: \"#990000\", background: \"#EE0000\", highlight: {border: \"#BB0000\", background: \"#FF3333\"}, hover: {border: \"#BB0000\", background: \"#FF3333\"}}, // 10:bright red\n\n {border: \"#FF6000\", background: \"#FF6000\", highlight: {border: \"#FF6000\", background: \"#FF6000\"}, hover: {border: \"#FF6000\", background: \"#FF6000\"}}, // 12: real orange\n {border: \"#97C2FC\", background: \"#2B7CE9\", highlight: {border: \"#D2E5FF\", background: \"#2B7CE9\"}, hover: {border: \"#D2E5FF\", background: \"#2B7CE9\"}}, // 13: blue\n {border: \"#399605\", background: \"#255C03\", highlight: {border: \"#399605\", background: \"#255C03\"}, hover: {border: \"#399605\", background: \"#255C03\"}}, // 14: green\n {border: \"#B70054\", background: \"#FF007E\", highlight: {border: \"#B70054\", background: \"#FF007E\"}, hover: {border: \"#B70054\", background: \"#FF007E\"}}, // 15: magenta\n {border: \"#AD85E4\", background: \"#7C29F0\", highlight: {border: \"#D3BDF0\", background: \"#7C29F0\"}, hover: {border: \"#D3BDF0\", background: \"#7C29F0\"}}, // 16: purple\n {border: \"#4557FA\", background: \"#000EA1\", highlight: {border: \"#6E6EFD\", background: \"#000EA1\"}, hover: {border: \"#6E6EFD\", background: \"#000EA1\"}}, // 17: darkblue\n {border: \"#FFC0CB\", background: \"#FD5A77\", highlight: {border: \"#FFD1D9\", background: \"#FD5A77\"}, hover: {border: \"#FFD1D9\", background: \"#FD5A77\"}}, // 18: pink\n {border: \"#C2FABC\", background: \"#74D66A\", highlight: {border: \"#E6FFE3\", background: \"#74D66A\"}, hover: {border: \"#E6FFE3\", background: \"#74D66A\"}}, // 19: mint\n\n {border: \"#EE0000\", background: \"#990000\", highlight: {border: \"#FF3333\", background: \"#BB0000\"}, hover: {border: \"#FF3333\", background: \"#BB0000\"}} // 20:bright red\n ];\n\n this.options = {};\n this.defaultOptions = {\n useDefaultGroups: true\n };\n util.extend(this.options, this.defaultOptions);\n }\n\n\n setOptions(options) {\n let optionFields = ['useDefaultGroups'];\n\n if (options !== undefined) {\n for (let groupName in options) {\n if (options.hasOwnProperty(groupName)) {\n if (optionFields.indexOf(groupName) === -1) {\n let group = options[groupName];\n this.add(groupName, group);\n }\n }\n }\n }\n }\n\n \n /**\n * Clear all groups\n */\n clear() {\n this.groups = {};\n this.groupsArray = [];\n }\n \n /**\n * get group options of a groupname. If groupname is not found, a new group\n * is added.\n * @param {*} groupname Can be a number, string, Date, etc.\n * @return {Object} group The created group, containing all group options\n */\n get(groupname) {\n let group = this.groups[groupname];\n if (group === undefined) {\n if (this.options.useDefaultGroups === false && this.groupsArray.length > 0) {\n // create new group\n let index = this.groupIndex % this.groupsArray.length;\n this.groupIndex++;\n group = {};\n group.color = this.groups[this.groupsArray[index]];\n this.groups[groupname] = group;\n }\n else {\n // create new group\n let index = this.defaultIndex % this.defaultGroups.length;\n this.defaultIndex++;\n group = {};\n group.color = this.defaultGroups[index];\n this.groups[groupname] = group;\n }\n }\n \n return group;\n }\n \n /**\n * Add a custom group style\n * @param {String} groupName\n * @param {Object} style An object containing borderColor,\n * backgroundColor, etc.\n * @return {Object} group The created group object\n */\n add(groupName, style) {\n this.groups[groupName] = style;\n this.groupsArray.push(groupName);\n return style;\n }\n}\n\nexport default Groups;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/Groups.js","let util = require(\"../../util\");\nlet DataSet = require('../../DataSet');\nlet DataView = require('../../DataView');\n\nimport Node from \"./components/Node\";\nimport Label from \"./components/shared/Label\";\n\nclass NodesHandler {\n constructor(body, images, groups, layoutEngine) {\n this.body = body;\n this.images = images;\n this.groups = groups;\n this.layoutEngine = layoutEngine;\n\n // create the node API in the body container\n this.body.functions.createNode = this.create.bind(this);\n\n this.nodesListeners = {\n add: (event, params) => { this.add(params.items); },\n update: (event, params) => { this.update(params.items, params.data); },\n remove: (event, params) => { this.remove(params.items); }\n };\n\n this.options = {};\n this.defaultOptions = {\n borderWidth: 1,\n borderWidthSelected: 2,\n brokenImage: undefined,\n color: {\n border: '#2B7CE9',\n background: '#97C2FC',\n highlight: {\n border: '#2B7CE9',\n background: '#D2E5FF'\n },\n hover: {\n border: '#2B7CE9',\n background: '#D2E5FF'\n }\n },\n fixed: {\n x: false,\n y: false\n },\n font: {\n color: '#343434',\n size: 14, // px\n face: 'arial',\n background: 'none',\n strokeWidth: 0, // px\n strokeColor: '#ffffff',\n align: 'center',\n vadjust: 0,\n multi: false,\n bold: {\n mod: 'bold'\n },\n boldital: {\n mod: 'bold italic'\n },\n ital: {\n mod: 'italic'\n },\n mono: {\n mod: '',\n size: 15, // px\n face: 'courier new',\n vadjust: 2\n }\n },\n group: undefined,\n hidden: false,\n icon: {\n face: 'FontAwesome', //'FontAwesome',\n code: undefined, //'\\uf007',\n size: 50, //50,\n color: '#2B7CE9' //'#aa00ff'\n },\n image: undefined, // --> URL\n label: undefined,\n labelHighlightBold: true,\n level: undefined,\n margin: {\n top: 5,\n right: 5,\n bottom: 5,\n left: 5\n },\n mass: 1,\n physics: true,\n scaling: {\n min: 10,\n max: 30,\n label: {\n enabled: false,\n min: 14,\n max: 30,\n maxVisible: 30,\n drawThreshold: 5\n },\n customScalingFunction: function (min, max, total, value) {\n if (max === min) {\n return 0.5;\n }\n else {\n let scale = 1 / (max - min);\n return Math.max(0, (value - min) * scale);\n }\n }\n },\n shadow: {\n enabled: false,\n color: 'rgba(0,0,0,0.5)',\n size: 10,\n x: 5,\n y: 5\n },\n shape: 'ellipse',\n shapeProperties: {\n borderDashes: false, // only for borders\n borderRadius: 6, // only for box shape\n interpolation: true, // only for image and circularImage shapes\n useImageSize: false, // only for image and circularImage shapes\n useBorderWithImage: false // only for image shape\n },\n size: 25,\n title: undefined,\n value: undefined,\n x: undefined,\n y: undefined\n };\n util.extend(this.options, this.defaultOptions);\n\n this.bindEventListeners();\n }\n\n bindEventListeners() {\n // refresh the nodes. Used when reverting from hierarchical layout\n this.body.emitter.on('refreshNodes', this.refresh.bind(this));\n this.body.emitter.on('refresh', this.refresh.bind(this));\n this.body.emitter.on('destroy', () => {\n util.forEach(this.nodesListeners, (callback, event) => {\n if (this.body.data.nodes)\n this.body.data.nodes.off(event, callback);\n });\n delete this.body.functions.createNode;\n delete this.nodesListeners.add;\n delete this.nodesListeners.update;\n delete this.nodesListeners.remove;\n delete this.nodesListeners;\n });\n }\n\n setOptions(options) {\n this.nodeOptions = options;\n if (options !== undefined) {\n Node.parseOptions(this.options, options);\n\n // update the shape in all nodes\n if (options.shape !== undefined) {\n for (let nodeId in this.body.nodes) {\n if (this.body.nodes.hasOwnProperty(nodeId)) {\n this.body.nodes[nodeId].updateShape();\n }\n }\n }\n\n // update the font in all nodes\n if (options.font !== undefined) {\n Label.parseOptions(this.options.font, options);\n for (let nodeId in this.body.nodes) {\n if (this.body.nodes.hasOwnProperty(nodeId)) {\n this.body.nodes[nodeId].updateLabelModule();\n this.body.nodes[nodeId]._reset();\n }\n }\n }\n\n // update the shape size in all nodes\n if (options.size !== undefined) {\n for (let nodeId in this.body.nodes) {\n if (this.body.nodes.hasOwnProperty(nodeId)) {\n this.body.nodes[nodeId]._reset();\n }\n }\n }\n\n // update the state of the letiables if needed\n if (options.hidden !== undefined || options.physics !== undefined) {\n this.body.emitter.emit('_dataChanged');\n }\n }\n }\n\n /**\n * Set a data set with nodes for the network\n * @param {Array | DataSet | DataView} nodes The data containing the nodes.\n * @private\n */\n setData(nodes, doNotEmit = false) {\n let oldNodesData = this.body.data.nodes;\n\n if (nodes instanceof DataSet || nodes instanceof DataView) {\n this.body.data.nodes = nodes;\n }\n else if (Array.isArray(nodes)) {\n this.body.data.nodes = new DataSet();\n this.body.data.nodes.add(nodes);\n }\n else if (!nodes) {\n this.body.data.nodes = new DataSet();\n }\n else {\n throw new TypeError('Array or DataSet expected');\n }\n\n if (oldNodesData) {\n // unsubscribe from old dataset\n util.forEach(this.nodesListeners, function (callback, event) {\n oldNodesData.off(event, callback);\n });\n }\n\n // remove drawn nodes\n this.body.nodes = {};\n\n if (this.body.data.nodes) {\n // subscribe to new dataset\n let me = this;\n util.forEach(this.nodesListeners, function (callback, event) {\n me.body.data.nodes.on(event, callback);\n });\n\n // draw all new nodes\n let ids = this.body.data.nodes.getIds();\n this.add(ids, true);\n }\n\n if (doNotEmit === false) {\n this.body.emitter.emit(\"_dataChanged\");\n }\n }\n\n\n /**\n * Add nodes\n * @param {Number[] | String[]} ids\n * @private\n */\n add(ids, doNotEmit = false) {\n let id;\n let newNodes = [];\n for (let i = 0; i < ids.length; i++) {\n id = ids[i];\n let properties = this.body.data.nodes.get(id);\n let node = this.create(properties);\n newNodes.push(node);\n this.body.nodes[id] = node; // note: this may replace an existing node\n }\n\n this.layoutEngine.positionInitially(newNodes);\n\n if (doNotEmit === false) {\n this.body.emitter.emit(\"_dataChanged\");\n }\n }\n\n /**\n * Update existing nodes, or create them when not yet existing\n * @param {Number[] | String[]} ids\n * @private\n */\n update(ids, changedData) {\n let nodes = this.body.nodes;\n let dataChanged = false;\n for (let i = 0; i < ids.length; i++) {\n let id = ids[i];\n let node = nodes[id];\n let data = changedData[i];\n if (node !== undefined) {\n // update node\n dataChanged = node.setOptions(data);\n }\n else {\n dataChanged = true;\n // create node\n node = this.create(data);\n nodes[id] = node;\n }\n }\n if (dataChanged === true) {\n this.body.emitter.emit(\"_dataChanged\");\n }\n else {\n this.body.emitter.emit(\"_dataUpdated\");\n }\n }\n\n /**\n * Remove existing nodes. If nodes do not exist, the method will just ignore it.\n * @param {Number[] | String[]} ids\n * @private\n */\n remove(ids) {\n let nodes = this.body.nodes;\n\n for (let i = 0; i < ids.length; i++) {\n let id = ids[i];\n delete nodes[id];\n }\n\n this.body.emitter.emit(\"_dataChanged\");\n }\n\n\n /**\n * create a node\n * @param properties\n * @param constructorClass\n */\n create(properties, constructorClass = Node) {\n return new constructorClass(properties, this.body, this.images, this.groups, this.options, this.defaultOptions, this.nodeOptions)\n }\n\n\n refresh(clearPositions = false) {\n let nodes = this.body.nodes;\n for (let nodeId in nodes) {\n let node = undefined;\n if (nodes.hasOwnProperty(nodeId)) {\n node = nodes[nodeId];\n }\n let data = this.body.data.nodes._data[nodeId];\n if (node !== undefined && data !== undefined) {\n if (clearPositions === true) {\n node.setOptions({x:null, y:null});\n }\n node.setOptions({ fixed: false });\n node.setOptions(data);\n }\n }\n }\n\n /**\n * Returns the positions of the nodes.\n * @param ids --> optional, can be array of nodeIds, can be string\n * @returns {{}}\n */\n getPositions(ids) {\n let dataArray = {};\n if (ids !== undefined) {\n if (Array.isArray(ids) === true) {\n for (let i = 0; i < ids.length; i++) {\n if (this.body.nodes[ids[i]] !== undefined) {\n let node = this.body.nodes[ids[i]];\n dataArray[ids[i]] = { x: Math.round(node.x), y: Math.round(node.y) };\n }\n }\n }\n else {\n if (this.body.nodes[ids] !== undefined) {\n let node = this.body.nodes[ids];\n dataArray[ids] = { x: Math.round(node.x), y: Math.round(node.y) };\n }\n }\n }\n else {\n for (let i = 0; i < this.body.nodeIndices.length; i++) {\n let node = this.body.nodes[this.body.nodeIndices[i]];\n dataArray[this.body.nodeIndices[i]] = { x: Math.round(node.x), y: Math.round(node.y) };\n }\n }\n return dataArray;\n }\n\n\n /**\n * Load the XY positions of the nodes into the dataset.\n */\n storePositions() {\n // todo: add support for clusters and hierarchical.\n let dataArray = [];\n var dataset = this.body.data.nodes.getDataSet();\n\n for (let nodeId in dataset._data) {\n if (dataset._data.hasOwnProperty(nodeId)) {\n let node = this.body.nodes[nodeId];\n if (dataset._data[nodeId].x != Math.round(node.x) || dataset._data[nodeId].y != Math.round(node.y)) {\n dataArray.push({ id: node.id, x: Math.round(node.x), y: Math.round(node.y) });\n }\n }\n }\n dataset.update(dataArray);\n }\n\n /**\n * get the bounding box of a node.\n * @param nodeId\n * @returns {j|*}\n */\n getBoundingBox(nodeId) {\n if (this.body.nodes[nodeId] !== undefined) {\n return this.body.nodes[nodeId].shape.boundingBox;\n }\n }\n\n\n /**\n * Get the Ids of nodes connected to this node.\n * @param nodeId\n * @returns {Array}\n */\n getConnectedNodes(nodeId) {\n let nodeList = [];\n if (this.body.nodes[nodeId] !== undefined) {\n let node = this.body.nodes[nodeId];\n let nodeObj = {}; // used to quickly check if node already exists\n for (let i = 0; i < node.edges.length; i++) {\n let edge = node.edges[i];\n if (edge.toId == node.id) { // these are double equals since ids can be numeric or string\n if (nodeObj[edge.fromId] === undefined) {\n nodeList.push(edge.fromId);\n nodeObj[edge.fromId] = true;\n }\n }\n else if (edge.fromId == node.id) { // these are double equals since ids can be numeric or string\n if (nodeObj[edge.toId] === undefined) {\n nodeList.push(edge.toId);\n nodeObj[edge.toId] = true;\n }\n }\n }\n }\n return nodeList;\n }\n\n /**\n * Get the ids of the edges connected to this node.\n * @param nodeId\n * @returns {*}\n */\n getConnectedEdges(nodeId) {\n let edgeList = [];\n if (this.body.nodes[nodeId] !== undefined) {\n let node = this.body.nodes[nodeId];\n for (let i = 0; i < node.edges.length; i++) {\n edgeList.push(node.edges[i].id)\n }\n }\n else {\n console.log(\"NodeId provided for getConnectedEdges does not exist. Provided: \", nodeId);\n }\n return edgeList;\n }\n\n\n /**\n * Move a node.\n * @param String nodeId\n * @param Number x\n * @param Number y\n */\n moveNode(nodeId, x, y) {\n if (this.body.nodes[nodeId] !== undefined) {\n this.body.nodes[nodeId].x = Number(x);\n this.body.nodes[nodeId].y = Number(y);\n setTimeout(() => {this.body.emitter.emit(\"startSimulation\")},0);\n }\n else {\n console.log(\"Node id supplied to moveNode does not exist. Provided: \", nodeId);\n }\n }\n}\n\nexport default NodesHandler;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/NodesHandler.js","var util = require('../../../util');\n\nimport Label from './shared/Label'\n\nimport Box from './nodes/shapes/Box'\nimport Circle from './nodes/shapes/Circle'\nimport CircularImage from './nodes/shapes/CircularImage'\nimport Database from './nodes/shapes/Database'\nimport Diamond from './nodes/shapes/Diamond'\nimport Dot from './nodes/shapes/Dot'\nimport Ellipse from './nodes/shapes/Ellipse'\nimport Icon from './nodes/shapes/Icon'\nimport Image from './nodes/shapes/Image'\nimport Square from './nodes/shapes/Square'\nimport Star from './nodes/shapes/Star'\nimport Text from './nodes/shapes/Text'\nimport Triangle from './nodes/shapes/Triangle'\nimport TriangleDown from './nodes/shapes/TriangleDown'\nimport Validator from \"../../../shared/Validator\";\nimport {printStyle} from \"../../../shared/Validator\";\n\n\n/**\n * @class Node\n * A node. A node can be connected to other nodes via one or multiple edges.\n * @param {object} options An object containing options for the node. All\n * options are optional, except for the id.\n * {number} id Id of the node. Required\n * {string} label Text label for the node\n * {number} x Horizontal position of the node\n * {number} y Vertical position of the node\n * {string} shape Node shape, available:\n * \"database\", \"circle\", \"ellipse\",\n * \"box\", \"image\", \"text\", \"dot\",\n * \"star\", \"triangle\", \"triangleDown\",\n * \"square\", \"icon\"\n * {string} image An image url\n * {string} title An title text, can be HTML\n * {anytype} group A group name or number\n * @param {Network.Images} imagelist A list with images. Only needed\n * when the node has an image\n * @param {Network.Groups} grouplist A list with groups. Needed for\n * retrieving group options\n * @param {Object} constants An object with default values for\n * example for the color\n *\n */\nclass Node {\n constructor(options, body, imagelist, grouplist, globalOptions, defaultOptions, nodeOptions) {\n this.options = util.bridgeObject(globalOptions);\n this.globalOptions = globalOptions;\n this.defaultOptions = defaultOptions;\n this.nodeOptions = nodeOptions;\n this.body = body;\n\n this.edges = []; // all edges connected to this node\n\n // set defaults for the options\n this.id = undefined;\n this.imagelist = imagelist;\n this.grouplist = grouplist;\n\n // state options\n this.x = undefined;\n this.y = undefined;\n this.baseSize = this.options.size;\n this.baseFontSize = this.options.font.size;\n this.predefinedPosition = false; // used to check if initial fit should just take the range or approximate\n this.selected = false;\n this.hover = false;\n\n this.labelModule = new Label(this.body, this.options, false /* Not edge label */);\n this.setOptions(options);\n }\n\n\n /**\n * Attach a edge to the node\n * @param {Edge} edge\n */\n attachEdge(edge) {\n if (this.edges.indexOf(edge) === -1) {\n this.edges.push(edge);\n }\n }\n\n\n /**\n * Detach a edge from the node\n * @param {Edge} edge\n */\n detachEdge(edge) {\n var index = this.edges.indexOf(edge);\n if (index != -1) {\n this.edges.splice(index, 1);\n }\n }\n\n\n /**\n * Set or overwrite options for the node\n * @param {Object} options an object with options\n * @param {Object} constants and object with default, global options\n */\n setOptions(options) {\n let currentShape = this.options.shape;\n if (!options) {\n return;\n }\n // basic options\n if (options.id !== undefined) {this.id = options.id;}\n\n if (this.id === undefined) {\n throw \"Node must have an id\";\n }\n\n\n // set these options locally\n // clear x and y positions\n if (options.x !== undefined) {\n if (options.x === null) {this.x = undefined; this.predefinedPosition = false;}\n else {this.x = parseInt(options.x); this.predefinedPosition = true;}\n }\n if (options.y !== undefined) {\n if (options.y === null) {this.y = undefined; this.predefinedPosition = false;}\n else {this.y = parseInt(options.y); this.predefinedPosition = true;}\n }\n if (options.size !== undefined) {this.baseSize = options.size;}\n if (options.value !== undefined) {options.value = parseFloat(options.value);}\n\n // copy group options\n if (typeof options.group === 'number' || (typeof options.group === 'string' && options.group != '')) {\n var groupObj = this.grouplist.get(options.group);\n util.deepExtend(this.options, groupObj);\n // the color object needs to be completely defined. Since groups can partially overwrite the colors, we parse it again, just in case.\n this.options.color = util.parseColor(this.options.color);\n }\n\n // this transforms all shorthands into fully defined options\n Node.parseOptions(this.options, options, true, this.globalOptions);\n\n this.choosify(options);\n\n // load the images\n if (this.options.image !== undefined) {\n if (this.imagelist) {\n this.imageObj = this.imagelist.load(this.options.image, this.options.brokenImage, this.id);\n }\n else {\n throw \"No imagelist provided\";\n }\n }\n\n this.updateLabelModule(options);\n this.updateShape(currentShape);\n this.labelModule.propagateFonts(this.nodeOptions, options, this.defaultOptions);\n\n if (options.hidden !== undefined || options.physics !== undefined) {\n return true;\n }\n return false;\n }\n\n\n /**\n * This process all possible shorthands in the new options and makes sure that the parentOptions are fully defined.\n * Static so it can also be used by the handler.\n * @param parentOptions\n * @param newOptions\n * @param allowDeletion\n * @param globalOptions\n */\n static parseOptions(parentOptions, newOptions, allowDeletion = false, globalOptions = {}) {\n var fields = [\n 'color',\n 'font',\n 'fixed',\n 'shadow'\n ];\n util.selectiveNotDeepExtend(fields, parentOptions, newOptions, allowDeletion);\n\n // merge the shadow options into the parent.\n util.mergeOptions(parentOptions, newOptions, 'shadow', allowDeletion, globalOptions);\n\n // individual shape newOptions\n if (newOptions.color !== undefined && newOptions.color !== null) {\n let parsedColor = util.parseColor(newOptions.color);\n util.fillIfDefined(parentOptions.color, parsedColor);\n }\n else if (allowDeletion === true && newOptions.color === null) {\n parentOptions.color = util.bridgeObject(globalOptions.color); // set the object back to the global options\n }\n\n // handle the fixed options\n if (newOptions.fixed !== undefined && newOptions.fixed !== null) {\n if (typeof newOptions.fixed === 'boolean') {\n parentOptions.fixed.x = newOptions.fixed;\n parentOptions.fixed.y = newOptions.fixed;\n }\n else {\n if (newOptions.fixed.x !== undefined && typeof newOptions.fixed.x === 'boolean') {\n parentOptions.fixed.x = newOptions.fixed.x;\n }\n if (newOptions.fixed.y !== undefined && typeof newOptions.fixed.y === 'boolean') {\n parentOptions.fixed.y = newOptions.fixed.y;\n }\n }\n }\n\n // handle the font options\n if (newOptions.font !== undefined && newOptions.font !== null) {\n Label.parseOptions(parentOptions.font, newOptions);\n }\n else if (allowDeletion === true && newOptions.font === null) {\n parentOptions.font = util.bridgeObject(globalOptions.font); // set the object back to the global options\n }\n\n // handle the scaling options, specifically the label part\n if (newOptions.scaling !== undefined) {\n util.mergeOptions(parentOptions.scaling, newOptions.scaling, 'label', allowDeletion, globalOptions.scaling);\n }\n }\n\n choosify(options) {\n this.chooser = true;\n\n let pile = [options, this.options, this.defaultOptions];\n\n let chosen = util.topMost(pile, 'chosen');\n if (typeof chosen === 'boolean') {\n this.chooser = chosen;\n } else if (typeof chosen === 'object') {\n let chosenNode = util.topMost(pile, ['chosen', 'node']);\n if ((typeof chosenNode === 'boolean') || (typeof chosenNode === 'function')) {\n this.chooser = chosenNode;\n }\n }\n }\n\n getFormattingValues() {\n let values = {\n color: this.options.color.background,\n borderWidth: this.options.borderWidth,\n borderColor: this.options.color.border,\n size: this.options.size,\n borderDashes: this.options.shapeProperties.borderDashes,\n borderRadius: this.options.shapeProperties.borderRadius,\n shadow: this.options.shadow.enabled,\n shadowColor: this.options.shadow.color,\n shadowSize: this.options.shadow.size,\n shadowX: this.options.shadow.x,\n shadowY: this.options.shadow.y\n };\n if (this.selected || this.hover) {\n if (this.chooser === true) {\n if (this.selected) {\n values.borderWidth *= 2;\n values.color = this.options.color.highlight.background;\n values.borderColor = this.options.color.highlight.border;\n values.shadow = this.options.shadow.enabled;\n } else if (this.hover) {\n values.color = this.options.color.hover.background;\n values.borderColor = this.options.color.hover.border;\n values.shadow = this.options.shadow.enabled;\n }\n } else if (typeof this.chooser === 'function') {\n this.chooser(values, this.options.id, this.selected, this.hover);\n if (values.shadow === false) {\n if ((values.shadowColor !== this.options.shadow.color) ||\n (values.shadowSize !== this.options.shadow.size) ||\n (values.shadowX !== this.options.shadow.x) ||\n (values.shadowY !== this.options.shadow.y)) {\n values.shadow = true;\n }\n }\n }\n } else {\n values.shadow = this.options.shadow.enabled;\n }\n return values;\n }\n\n\n updateLabelModule(options) {\n if (this.options.label === undefined || this.options.label === null) {\n this.options.label = '';\n }\n this.labelModule.setOptions(this.options, true);\n if (this.labelModule.baseSize !== undefined) {\n this.baseFontSize = this.labelModule.baseSize;\n }\n this.labelModule.constrain(this.nodeOptions, options, this.defaultOptions);\n this.labelModule.choosify(this.nodeOptions, options, this.defaultOptions);\n }\n\n updateShape(currentShape) {\n if (currentShape === this.options.shape && this.shape) {\n this.shape.setOptions(this.options, this.imageObj);\n }\n else {\n // choose draw method depending on the shape\n switch (this.options.shape) {\n case 'box':\n this.shape = new Box(this.options, this.body, this.labelModule);\n break;\n case 'circle':\n this.shape = new Circle(this.options, this.body, this.labelModule);\n break;\n case 'circularImage':\n this.shape = new CircularImage(this.options, this.body, this.labelModule, this.imageObj);\n break;\n case 'database':\n this.shape = new Database(this.options, this.body, this.labelModule);\n break;\n case 'diamond':\n this.shape = new Diamond(this.options, this.body, this.labelModule);\n break;\n case 'dot':\n this.shape = new Dot(this.options, this.body, this.labelModule);\n break;\n case 'ellipse':\n this.shape = new Ellipse(this.options, this.body, this.labelModule);\n break;\n case 'icon':\n this.shape = new Icon(this.options, this.body, this.labelModule);\n break;\n case 'image':\n this.shape = new Image(this.options, this.body, this.labelModule, this.imageObj);\n break;\n case 'square':\n this.shape = new Square(this.options, this.body, this.labelModule);\n break;\n case 'star':\n this.shape = new Star(this.options, this.body, this.labelModule);\n break;\n case 'text':\n this.shape = new Text(this.options, this.body, this.labelModule);\n break;\n case 'triangle':\n this.shape = new Triangle(this.options, this.body, this.labelModule);\n break;\n case 'triangleDown':\n this.shape = new TriangleDown(this.options, this.body, this.labelModule);\n break;\n default:\n this.shape = new Ellipse(this.options, this.body, this.labelModule);\n break;\n }\n }\n this._reset();\n }\n\n\n /**\n * select this node\n */\n select() {\n this.selected = true;\n this._reset();\n }\n\n\n /**\n * unselect this node\n */\n unselect() {\n this.selected = false;\n this._reset();\n }\n\n\n\n /**\n * Reset the calculated size of the node, forces it to recalculate its size\n * @private\n */\n _reset() {\n this.shape.width = undefined;\n this.shape.height = undefined;\n }\n\n\n /**\n * get the title of this node.\n * @return {string} title The title of the node, or undefined when no title\n * has been set.\n */\n getTitle() {\n return this.options.title;\n }\n\n\n /**\n * Calculate the distance to the border of the Node\n * @param {CanvasRenderingContext2D} ctx\n * @param {Number} angle Angle in radians\n * @returns {number} distance Distance to the border in pixels\n */\n distanceToBorder(ctx, angle) {\n return this.shape.distanceToBorder(ctx,angle);\n }\n\n\n /**\n * Check if this node has a fixed x and y position\n * @return {boolean} true if fixed, false if not\n */\n isFixed() {\n return (this.options.fixed.x && this.options.fixed.y);\n }\n\n\n /**\n * check if this node is selecte\n * @return {boolean} selected True if node is selected, else false\n */\n isSelected() {\n return this.selected;\n }\n\n\n /**\n * Retrieve the value of the node. Can be undefined\n * @return {Number} value\n */\n getValue() {\n return this.options.value;\n }\n\n\n /**\n * Adjust the value range of the node. The node will adjust it's size\n * based on its value.\n * @param {Number} min\n * @param {Number} max\n */\n setValueRange(min, max, total) {\n if (this.options.value !== undefined) {\n var scale = this.options.scaling.customScalingFunction(min, max, total, this.options.value);\n var sizeDiff = this.options.scaling.max - this.options.scaling.min;\n if (this.options.scaling.label.enabled === true) {\n var fontDiff = this.options.scaling.label.max - this.options.scaling.label.min;\n this.options.font.size = this.options.scaling.label.min + scale * fontDiff;\n }\n this.options.size = this.options.scaling.min + scale * sizeDiff;\n }\n else {\n this.options.size = this.baseSize;\n this.options.font.size = this.baseFontSize;\n }\n\n this.updateLabelModule();\n }\n\n\n /**\n * Draw this node in the given canvas\n * The 2d context of a HTML canvas can be retrieved by canvas.getContext(\"2d\");\n * @param {CanvasRenderingContext2D} ctx\n */\n draw(ctx) {\n let values = this.getFormattingValues();\n this.shape.draw(ctx, this.x, this.y, this.selected, this.hover, values);\n }\n\n\n /**\n * Update the bounding box of the shape\n */\n updateBoundingBox(ctx) {\n this.shape.updateBoundingBox(this.x,this.y,ctx);\n }\n\n /**\n * Recalculate the size of this node in the given canvas\n * The 2d context of a HTML canvas can be retrieved by canvas.getContext(\"2d\");\n * @param {CanvasRenderingContext2D} ctx\n */\n resize(ctx) {\n let values = this.getFormattingValues();\n this.shape.resize(ctx, this.selected, this.hover, values);\n }\n\n\n /**\n * Check if this object is overlapping with the provided object\n * @param {Object} obj an object with parameters left, top, right, bottom\n * @return {boolean} True if location is located on node\n */\n isOverlappingWith(obj) {\n return (\n this.shape.left < obj.right &&\n this.shape.left + this.shape.width > obj.left &&\n this.shape.top < obj.bottom &&\n this.shape.top + this.shape.height > obj.top\n );\n }\n\n /**\n * Check if this object is overlapping with the provided object\n * @param {Object} obj an object with parameters left, top, right, bottom\n * @return {boolean} True if location is located on node\n */\n isBoundingBoxOverlappingWith(obj) {\n return (\n this.shape.boundingBox.left < obj.right &&\n this.shape.boundingBox.right > obj.left &&\n this.shape.boundingBox.top < obj.bottom &&\n this.shape.boundingBox.bottom > obj.top\n );\n }\n}\n\nexport default Node;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/Node.js","let util = require('../../../../util');\n\nclass Label {\n constructor(body, options, edgelabel = false) {\n this.body = body;\n\n this.pointToSelf = false;\n this.baseSize = undefined;\n this.fontOptions = {};\n this.setOptions(options);\n this.size = {top: 0, left: 0, width: 0, height: 0, yLine: 0}; // could be cached\n this.isEdgeLabel = edgelabel;\n }\n\n setOptions(options, allowDeletion = false) {\n this.elementOptions = options;\n\n // We want to keep the font options seperated from the node options.\n // The node options have to mirror the globals when they are not overruled.\n this.fontOptions = util.deepExtend({},options.font, true);\n\n if (options.label !== undefined) {\n this.labelDirty = true;\n }\n\n if (options.font !== undefined) {\n Label.parseOptions(this.fontOptions, options, allowDeletion);\n if (typeof options.font === 'string') {\n this.baseSize = this.fontOptions.size;\n }\n else if (typeof options.font === 'object') {\n if (options.font.size !== undefined) {\n this.baseSize = options.font.size;\n }\n }\n }\n }\n\n static parseOptions(parentOptions, newOptions, allowDeletion = false) {\n if (typeof newOptions.font === 'string') {\n let newOptionsArray = newOptions.font.split(\" \");\n parentOptions.size = newOptionsArray[0].replace(\"px\",'');\n parentOptions.face = newOptionsArray[1];\n parentOptions.color = newOptionsArray[2];\n parentOptions.vadjust = 0;\n }\n else if (typeof newOptions.font === 'object') {\n util.fillIfDefined(parentOptions, newOptions.font, allowDeletion);\n }\n parentOptions.size = Number(parentOptions.size);\n parentOptions.vadjust = Number(parentOptions.vadjust);\n }\n\n // set the width and height constraints based on 'nearest' value\n constrain(elementOptions, options, defaultOptions) {\n this.fontOptions.constrainWidth = false;\n this.fontOptions.maxWdt = -1;\n this.fontOptions.minWdt = -1;\n\n let pile = [options, elementOptions, defaultOptions];\n\n let widthConstraint = util.topMost(pile, 'widthConstraint');\n if (typeof widthConstraint === 'number') {\n this.fontOptions.maxWdt = Number(widthConstraint);\n this.fontOptions.minWdt = Number(widthConstraint);\n } else if (typeof widthConstraint === 'object') {\n let widthConstraintMaximum = util.topMost(pile, ['widthConstraint', 'maximum']);\n if (typeof widthConstraintMaximum === 'number') {\n this.fontOptions.maxWdt = Number(widthConstraintMaximum);\n }\n let widthConstraintMinimum = util.topMost(pile, ['widthConstraint', 'minimum'])\n if (typeof widthConstraintMinimum === 'number') {\n this.fontOptions.minWdt = Number(widthConstraintMinimum);\n }\n }\n\n this.fontOptions.constrainHeight = false;\n this.fontOptions.minHgt = -1;\n this.fontOptions.valign = 'middle';\n\n let heightConstraint = util.topMost(pile, 'heightConstraint');\n if (typeof heightConstraint === 'number') {\n this.fontOptions.minHgt = Number(heightConstraint);\n } else if (typeof heightConstraint === 'object') {\n let heightConstraintMinimum = util.topMost(pile, ['heightConstraint', 'minimum']);\n if (typeof heightConstraintMinimum === 'number') {\n this.fontOptions.minHgt = Number(heightConstraintMinimum);\n }\n let heightConstraintValign = util.topMost(pile, ['heightConstraint', 'valign']);\n if (typeof heightConstraintValign === 'string') {\n if ((heightConstraintValign === 'top')||(heightConstraintValign === 'bottom')) {\n this.fontOptions.valign = heightConstraintValign;\n }\n }\n }\n }\n\n // set the selected functions based on 'nearest' value\n choosify(elementOptions, options, defaultOptions) {\n this.fontOptions.chooser = true;\n\n let pile = [options, elementOptions, defaultOptions];\n\n let chosen = util.topMost(pile, 'chosen');\n if (typeof chosen === 'boolean') {\n this.fontOptions.chooser = chosen;\n } else if (typeof chosen === 'object') {\n let chosenLabel = util.topMost(pile, ['chosen', 'label']);\n if ((typeof chosenLabel === 'boolean') || (typeof chosenLabel === 'function')) {\n this.fontOptions.chooser = chosenLabel;\n }\n }\n }\n\n // When margins are set in an element, adjust sizes is called to remove them\n // from the width/height constraints. This must be done prior to label sizing.\n adjustSizes(margins) {\n let widthBias = (margins) ? (margins.right + margins.left) : 0;\n if (this.fontOptions.constrainWidth) {\n this.fontOptions.maxWdt -= widthBias;\n this.fontOptions.minWdt -= widthBias;\n }\n let heightBias = (margins) ? (margins.top + margins.bottom) : 0;\n if (this.fontOptions.constrainHeight) {\n this.fontOptions.minHgt -= heightBias;\n }\n }\n\n propagateFonts(options, groupOptions, defaultOptions) {\n if (this.fontOptions.multi) {\n let mods = [ 'bold', 'ital', 'boldital', 'mono' ];\n for (const mod of mods) {\n let optionsFontMod;\n if (options.font) {\n optionsFontMod = options.font[mod];\n }\n if (typeof optionsFontMod === 'string') {\n let modOptionsArray = optionsFontMod.split(\" \");\n this.fontOptions[mod].size = modOptionsArray[0].replace(\"px\",\"\");\n this.fontOptions[mod].face = modOptionsArray[1];\n this.fontOptions[mod].color = modOptionsArray[2];\n this.fontOptions[mod].vadjust = this.fontOptions.vadjust;\n this.fontOptions[mod].mod = defaultOptions.font[mod].mod;\n } else {\n // We need to be crafty about loading the modded fonts. We want as\n // much 'natural' versatility as we can get, so a simple global\n // change propagates in an expected way, even if not stictly logical.\n\n // face: We want to capture any direct settings and overrides, but\n // fall back to the base font if there aren't any. We make a\n // special exception for mono, since we probably don't want to\n // sync to a the base font face.\n //\n // if the mod face is in the node's options, use it\n // else if the mod face is in the global options, use it\n // else if the face is in the global options, use it\n // else use the base font's face.\n if (optionsFontMod && optionsFontMod.hasOwnProperty('face')) {\n this.fontOptions[mod].face = optionsFontMod.face;\n } else if (groupOptions.font && groupOptions.font[mod] &&\n groupOptions.font[mod].hasOwnProperty('face')) {\n this.fontOptions[mod].face = groupOptions.font[mod].face;\n } else if (mod === 'mono') {\n this.fontOptions[mod].face = defaultOptions.font[mod].face;\n } else if (groupOptions.font &&\n groupOptions.font.hasOwnProperty('face')) {\n this.fontOptions[mod].face = groupOptions.font.face;\n } else {\n this.fontOptions[mod].face = this.fontOptions.face;\n }\n\n // color: this is handled just like the face.\n if (optionsFontMod && optionsFontMod.hasOwnProperty('color')) {\n this.fontOptions[mod].color = optionsFontMod.color;\n } else if (groupOptions.font && groupOptions.font[mod] &&\n groupOptions.font[mod].hasOwnProperty('color')) {\n this.fontOptions[mod].color = groupOptions.font[mod].color;\n } else if (groupOptions.font &&\n groupOptions.font.hasOwnProperty('color')) {\n this.fontOptions[mod].color = groupOptions.font.color;\n } else {\n this.fontOptions[mod].color = this.fontOptions.color;\n }\n\n // mod: this is handled just like the face, except we never grab the\n // base font's mod. We know they're in the defaultOptions, and unless\n // we've been steered away from them, we use the default.\n if (optionsFontMod && optionsFontMod.hasOwnProperty('mod')) {\n this.fontOptions[mod].mod = optionsFontMod.mod;\n } else if (groupOptions.font && groupOptions.font[mod] &&\n groupOptions.font[mod].hasOwnProperty('mod')) {\n this.fontOptions[mod].mod = groupOptions.font[mod].mod;\n } else if (groupOptions.font &&\n groupOptions.font.hasOwnProperty('mod')) {\n this.fontOptions[mod].mod = groupOptions.font.mod;\n } else {\n this.fontOptions[mod].mod = defaultOptions.font[mod].mod;\n }\n\n // size: It's important that we size up defaults similarly if we're\n // using default faces unless overriden. We want to preserve the\n // ratios closely - but if faces have changed, all bets are off.\n //\n // if the mod size is in the node's options, use it\n // else if the mod size is in the global options, use it\n // else if the mod face is the same as the default and the base face\n // is the same as the default, scale the mod size using the same\n // ratio\n // else if the size is in the global options, use it\n // else use the base font's size.\n if (optionsFontMod && optionsFontMod.hasOwnProperty('size')) {\n this.fontOptions[mod].size = optionsFontMod.size;\n } else if (groupOptions.font && groupOptions.font[mod] &&\n groupOptions.font[mod].hasOwnProperty('size')) {\n this.fontOptions[mod].size = groupOptions.font[mod].size;\n } else if ((this.fontOptions[mod].face === defaultOptions.font[mod].face) &&\n (this.fontOptions.face === defaultOptions.font.face)) {\n let ratio = this.fontOptions.size / Number(defaultOptions.font.size);\n this.fontOptions[mod].size = defaultOptions.font[mod].size * ratio;\n } else if (groupOptions.font &&\n groupOptions.font.hasOwnProperty('size')) {\n this.fontOptions[mod].size = groupOptions.font.size;\n } else {\n this.fontOptions[mod].size = this.fontOptions.size;\n }\n\n // vadjust: this is handled just like the size.\n if (optionsFontMod && optionsFontMod.hasOwnProperty('vadjust')) {\n this.fontOptions[mod].vadjust = optionsFontMod.vadjust;\n } else if (groupOptions.font &&\n groupOptions.font[mod] && groupOptions.font[mod].hasOwnProperty('vadjust')) {\n this.fontOptions[mod].vadjust = groupOptions.font[mod].vadjust;\n } else if ((this.fontOptions[mod].face === defaultOptions.font[mod].face) &&\n (this.fontOptions.face === defaultOptions.font.face)) {\n let ratio = this.fontOptions.size / Number(defaultOptions.font.size);\n this.fontOptions[mod].vadjust = defaultOptions.font[mod].vadjust * Math.round(ratio);\n } else if (groupOptions.font &&\n groupOptions.font.hasOwnProperty('vadjust')) {\n this.fontOptions[mod].vadjust = groupOptions.font.vadjust;\n } else {\n this.fontOptions[mod].vadjust = this.fontOptions.vadjust;\n }\n }\n this.fontOptions[mod].size = Number(this.fontOptions[mod].size);\n this.fontOptions[mod].vadjust = Number(this.fontOptions[mod].vadjust);\n }\n }\n }\n\n\n /**\n * Main function. This is called from anything that wants to draw a label.\n * @param ctx\n * @param x\n * @param y\n * @param selected\n * @param baseline\n */\n draw(ctx, x, y, selected, hover, baseline = 'middle') {\n // if no label, return\n if (this.elementOptions.label === undefined)\n return;\n\n // check if we have to render the label\n let viewFontSize = this.fontOptions.size * this.body.view.scale;\n if (this.elementOptions.label && viewFontSize < this.elementOptions.scaling.label.drawThreshold - 1)\n return;\n\n // update the size cache if required\n this.calculateLabelSize(ctx, selected, hover, x, y, baseline);\n\n // create the fontfill background\n this._drawBackground(ctx);\n // draw text\n this._drawText(ctx, selected, hover, x, y, baseline);\n }\n\n /**\n * Draws the label background\n * @param {CanvasRenderingContext2D} ctx\n * @private\n */\n _drawBackground(ctx) {\n if (this.fontOptions.background !== undefined && this.fontOptions.background !== \"none\") {\n ctx.fillStyle = this.fontOptions.background;\n\n let lineMargin = 2;\n\n if (this.isEdgeLabel) {\n switch (this.fontOptions.align) {\n case 'middle':\n ctx.fillRect(-this.size.width * 0.5, -this.size.height * 0.5, this.size.width, this.size.height);\n break;\n case 'top':\n ctx.fillRect(-this.size.width * 0.5, -(this.size.height + lineMargin), this.size.width, this.size.height);\n break;\n case 'bottom':\n ctx.fillRect(-this.size.width * 0.5, lineMargin, this.size.width, this.size.height);\n break;\n default:\n ctx.fillRect(this.size.left, this.size.top - 0.5*lineMargin, this.size.width, this.size.height);\n break;\n }\n } else {\n ctx.fillRect(this.size.left, this.size.top - 0.5*lineMargin, this.size.width, this.size.height);\n }\n }\n }\n\n\n /**\n *\n * @param ctx\n * @param x\n * @param baseline\n * @private\n */\n _drawText(ctx, selected, hover, x, y, baseline = 'middle') {\n let fontSize = this.fontOptions.size;\n let viewFontSize = fontSize * this.body.view.scale;\n // this ensures that there will not be HUGE letters on screen by setting an upper limit on the visible text size (regardless of zoomLevel)\n if (viewFontSize >= this.elementOptions.scaling.label.maxVisible) {\n fontSize = Number(this.elementOptions.scaling.label.maxVisible) / this.body.view.scale;\n }\n\n let yLine = this.size.yLine;\n [x, yLine] = this._setAlignment(ctx, x, yLine, baseline);\n\n ctx.textAlign = 'left'\n x = x - this.size.width / 2; // Shift label 1/2-distance to the left\n if ((this.fontOptions.valign) && (this.size.height > this.size.labelHeight)) {\n if (this.fontOptions.valign === 'top') {\n yLine -= (this.size.height - this.size.labelHeight) / 2;\n }\n if (this.fontOptions.valign === 'bottom') {\n yLine += (this.size.height - this.size.labelHeight) / 2;\n }\n }\n\n // draw the text\n for (let i = 0; i < this.lineCount; i++) {\n if (this.lines[i] && this.lines[i].blocks) {\n let width = 0;\n if (this.isEdgeLabel || this.fontOptions.align === 'center') {\n width += (this.size.width - this.lines[i].width) / 2\n } else if (this.fontOptions.align === 'right') {\n width += (this.size.width - this.lines[i].width)\n }\n for (let j = 0; j < this.lines[i].blocks.length; j++) {\n let block = this.lines[i].blocks[j];\n ctx.font = block.font;\n let [fontColor, strokeColor] = this._getColor(block.color, viewFontSize, block.strokeColor);\n if (block.strokeWidth > 0) {\n ctx.lineWidth = block.strokeWidth;\n ctx.strokeStyle = strokeColor;\n ctx.lineJoin = 'round';\n }\n ctx.fillStyle = fontColor;\n\n if (block.strokeWidth > 0) {\n ctx.strokeText(block.text, x + width, yLine + block.vadjust);\n }\n ctx.fillText(block.text, x + width, yLine + block.vadjust);\n width += block.width;\n }\n yLine += this.lines[i].height;\n }\n }\n }\n\n _setAlignment(ctx, x, yLine, baseline) {\n // check for label alignment (for edges)\n // TODO: make alignment for nodes\n if (this.isEdgeLabel && this.fontOptions.align !== 'horizontal' && this.pointToSelf === false) {\n x = 0;\n yLine = 0;\n\n let lineMargin = 2;\n if (this.fontOptions.align === 'top') {\n ctx.textBaseline = 'alphabetic';\n yLine -= 2 * lineMargin; // distance from edge, required because we use alphabetic. Alphabetic has less difference between browsers\n }\n else if (this.fontOptions.align === 'bottom') {\n ctx.textBaseline = 'hanging';\n yLine += 2 * lineMargin;// distance from edge, required because we use hanging. Hanging has less difference between browsers\n }\n else {\n ctx.textBaseline = 'middle';\n }\n }\n else {\n ctx.textBaseline = baseline;\n }\n return [x,yLine];\n }\n\n /**\n * fade in when relative scale is between threshold and threshold - 1.\n * If the relative scale would be smaller than threshold -1 the draw function would have returned before coming here.\n *\n * @param viewFontSize\n * @returns {*[]}\n * @private\n */\n _getColor(color, viewFontSize, initialStrokeColor) {\n let fontColor = color || '#000000';\n let strokeColor = initialStrokeColor || '#ffffff';\n if (viewFontSize <= this.elementOptions.scaling.label.drawThreshold) {\n let opacity = Math.max(0, Math.min(1, 1 - (this.elementOptions.scaling.label.drawThreshold - viewFontSize)));\n fontColor = util.overrideOpacity(fontColor, opacity);\n strokeColor = util.overrideOpacity(strokeColor, opacity);\n }\n return [fontColor, strokeColor];\n }\n\n\n /**\n *\n * @param ctx\n * @param selected\n * @returns {{width: number, height: number}}\n */\n getTextSize(ctx, selected = false, hover = false) {\n this._processLabel(ctx, selected, hover);\n return {\n width: this.size.width,\n height: this.size.height,\n lineCount: this.lineCount\n };\n }\n\n\n /**\n *\n * @param ctx\n * @param selected\n * @param x\n * @param y\n * @param baseline\n */\n calculateLabelSize(ctx, selected, hover, x = 0, y = 0, baseline = 'middle') {\n if (this.labelDirty === true) {\n this._processLabel(ctx, selected, hover);\n }\n this.size.left = x - this.size.width * 0.5;\n this.size.top = y - this.size.height * 0.5;\n this.size.yLine = y + (1 - this.lineCount) * 0.5 * this.fontOptions.size;\n if (baseline === \"hanging\") {\n this.size.top += 0.5 * this.fontOptions.size;\n this.size.top += 4; // distance from node, required because we use hanging. Hanging has less difference between browsers\n this.size.yLine += 4; // distance from node\n }\n this.labelDirty = false;\n }\n\n /**\n * normalize the markup system\n */\n decodeMarkupSystem(markupSystem) {\n let system = 'none';\n if (markupSystem === 'markdown' || markupSystem === 'md') {\n system = 'markdown';\n } else if (markupSystem === true || markupSystem === 'html') {\n system = 'html'\n }\n return system;\n }\n\n /**\n * Explodes a piece of text into single-font blocks using a given markup\n * @param text\n * @param markupSystem\n * @returns [{ text, mod }]\n */\n splitBlocks(text, markupSystem) {\n let system = this.decodeMarkupSystem(markupSystem);\n if (system === 'none') {\n return [{\n text: text,\n mod: 'normal'\n }]\n } else if (system === 'markdown') {\n return this.splitMarkdownBlocks(text);\n } else if (system === 'html') {\n return this.splitHtmlBlocks(text);\n }\n }\n\n splitMarkdownBlocks(text) {\n let blocks = [];\n let s = {\n bold: false,\n ital: false,\n mono: false,\n beginable: true,\n spacing: false,\n position: 0,\n buffer: \"\",\n modStack: []\n };\n s.mod = function() {\n return (this.modStack.length === 0) ? 'normal' : this.modStack[0];\n }\n s.modName = function() {\n if (this.modStack.length === 0)\n return 'normal';\n else if (this.modStack[0] === 'mono')\n return 'mono';\n else {\n if (s.bold && s.ital) {\n return 'boldital';\n } else if (s.bold) {\n return 'bold';\n } else if (s.ital) {\n return 'ital';\n }\n }\n }\n s.emitBlock = function(override = false) {\n if (this.spacing) {\n this.add(\" \");\n this.spacing = false;\n }\n if (this.buffer.length > 0) {\n blocks.push({ text: this.buffer, mod: this.modName() });\n this.buffer = \"\";\n }\n }\n s.add = function(text) {\n if (text === \" \") {\n s.spacing = true;\n }\n if (s.spacing) {\n this.buffer += \" \";\n this.spacing = false;\n }\n if (text != \" \") {\n this.buffer += text;\n }\n }\n while (s.position < text.length) {\n let ch = text.charAt(s.position);\n if (/[ \\t]/.test(ch)) {\n if (!s.mono) {\n s.spacing = true;\n } else {\n s.add(ch);\n }\n s.beginable = true\n } else if (/\\\\/.test(ch)) {\n if (s.position < text.length+1) {\n s.position++;\n ch = text.charAt(s.position);\n if (/ \\t/.test(ch)) {\n s.spacing = true;\n } else {\n s.add(ch);\n s.beginable = false;\n }\n }\n } else if (!s.mono && !s.bold && (s.beginable || s.spacing) && /\\*/.test(ch)) {\n s.emitBlock();\n s.bold = true;\n s.modStack.unshift(\"bold\");\n } else if (!s.mono && !s.ital && (s.beginable || s.spacing) && /\\_/.test(ch)) {\n s.emitBlock();\n s.ital = true;\n s.modStack.unshift(\"ital\");\n } else if (!s.mono && (s.beginable || s.spacing) && /`/.test(ch)) {\n s.emitBlock();\n s.mono = true;\n s.modStack.unshift(\"mono\");\n } else if (!s.mono && (s.mod() === \"bold\") && /\\*/.test(ch)) {\n if ((s.position === text.length-1) || /[.,_` \\t\\n]/.test(text.charAt(s.position+1))) {\n s.emitBlock();\n s.bold = false;\n s.modStack.shift();\n } else {\n s.add(ch);\n }\n } else if (!s.mono && (s.mod() === \"ital\") && /\\_/.test(ch)) {\n if ((s.position === text.length-1) || /[.,*` \\t\\n]/.test(text.charAt(s.position+1))) {\n s.emitBlock();\n s.ital = false;\n s.modStack.shift();\n } else {\n s.add(ch);\n }\n } else if (s.mono && (s.mod() === \"mono\") && /`/.test(ch)) {\n if ((s.position === text.length-1) || (/[.,*_ \\t\\n]/.test(text.charAt(s.position+1)))) {\n s.emitBlock();\n s.mono = false;\n s.modStack.shift();\n } else {\n s.add(ch);\n }\n } else {\n s.add(ch);\n s.beginable = false;\n }\n s.position++\n }\n s.emitBlock();\n return blocks;\n }\n\n splitHtmlBlocks(text) {\n let blocks = [];\n let s = {\n bold: false,\n ital: false,\n mono: false,\n spacing: false,\n position: 0,\n buffer: \"\",\n modStack: []\n };\n s.mod = function() {\n return (this.modStack.length === 0) ? 'normal' : this.modStack[0];\n }\n s.modName = function() {\n if (this.modStack.length === 0)\n return 'normal';\n else if (this.modStack[0] === 'mono')\n return 'mono';\n else {\n if (s.bold && s.ital) {\n return 'boldital';\n } else if (s.bold) {\n return 'bold';\n } else if (s.ital) {\n return 'ital';\n }\n }\n }\n s.emitBlock = function(override = false) {\n if (this.spacing) {\n this.add(\" \");\n this.spacing = false;\n }\n if (this.buffer.length > 0) {\n blocks.push({ text: this.buffer, mod: this.modName() });\n this.buffer = \"\";\n }\n }\n s.add = function(text) {\n if (text === \" \") {\n s.spacing = true;\n }\n if (s.spacing) {\n this.buffer += \" \";\n this.spacing = false;\n }\n if (text != \" \") {\n this.buffer += text;\n }\n }\n while (s.position < text.length) {\n let ch = text.charAt(s.position);\n if (/[ \\t]/.test(ch)) {\n if (!s.mono) {\n s.spacing = true;\n } else {\n s.add(ch);\n }\n } else if (//.test(text.substr(s.position,3))) {\n s.emitBlock();\n s.bold = true;\n s.modStack.unshift(\"bold\");\n s.position += 2;\n } else if (!s.mono && !s.ital && //.test(text.substr(s.position,3))) {\n s.emitBlock();\n s.ital = true;\n s.modStack.unshift(\"ital\");\n s.position += 2;\n } else if (!s.mono && //.test(text.substr(s.position,6))) {\n s.emitBlock();\n s.mono = true;\n s.modStack.unshift(\"mono\");\n s.position += 5;\n } else if (!s.mono && (s.mod() === 'bold') && /<\\/b>/.test(text.substr(s.position,4))) {\n s.emitBlock();\n s.bold = false;\n s.modStack.shift();\n s.position += 3;\n } else if (!s.mono && (s.mod() === 'ital') && /<\\/i>/.test(text.substr(s.position,4))) {\n s.emitBlock();\n s.ital = false;\n s.modStack.shift();\n s.position += 3;\n } else if ((s.mod() === 'mono') && /<\\/code>/.test(text.substr(s.position,7))) {\n s.emitBlock();\n s.mono = false;\n s.modStack.shift();\n s.position += 6;\n } else {\n s.add(ch);\n }\n } else if (/&/.test(ch)) {\n if (/</.test(text.substr(s.position,4))) {\n s.add(\"<\");\n s.position += 3;\n } else if (/&/.test(text.substr(s.position,5))) {\n s.add(\"&\");\n s.position += 4;\n } else {\n s.add(\"&\");\n }\n } else {\n s.add(ch);\n }\n s.position++\n }\n s.emitBlock();\n return blocks;\n }\n\n getFormattingValues(ctx, selected, hover, mod) {\n let values = {\n color: (mod === \"normal\") ? this.fontOptions.color : this.fontOptions[mod].color,\n size: (mod === \"normal\") ? this.fontOptions.size : this.fontOptions[mod].size,\n face: (mod === \"normal\") ? this.fontOptions.face : this.fontOptions[mod].face,\n mod: (mod === \"normal\") ? \"\" : this.fontOptions[mod].mod,\n vadjust: (mod === \"normal\") ? this.fontOptions.vadjust : this.fontOptions[mod].vadjust,\n strokeWidth: this.fontOptions.strokeWidth,\n strokeColor: this.fontOptions.strokeColor\n };\n if (mod === \"normal\") {\n if (selected || hover) {\n if ((this.fontOptions.chooser === true) && (this.elementOptions.labelHighlightBold)) {\n values.mod = 'bold';\n } else if (typeof this.fontOptions.chooser === 'function') {\n this.fontOptions.chooser(ctx, values, this.elementOptions.id, selected, hover);\n }\n }\n } else {\n if ((selected || hover) && (typeof this.fontOptions.chooser === 'function')) {\n this.fontOptions.chooser(ctx, values, this.elementOptions.id, selected, hover);\n }\n }\n ctx.font = (values.mod + \" \" + values.size + \"px \" + values.face).replace(/\"/g, \"\");\n values.font = ctx.font;\n values.height = values.size;\n return values;\n }\n\n differentState(selected, hover) {\n return ((selected !== this.fontOptions.selectedState) && (hover !== this.fontOptions.hoverState));\n }\n\n /**\n * This explodes the label string into lines and sets the width, height and number of lines.\n * @param ctx\n * @param selected\n * @private\n */\n _processLabel(ctx, selected, hover) {\n let width = 0;\n let height = 0;\n let nlLines = [];\n let lines = [];\n let k = 0;\n lines.add = function(l, text, font, color, width, height, vadjust, mod, strokeWidth, strokeColor) {\n if (this.length == l) {\n this[l] = { width: 0, height: 0, blocks: [] };\n }\n this[l].blocks.push({ text, font, color, width, height, vadjust, mod, strokeWidth, strokeColor });\n }\n lines.accumulate = function(l, width, height) {\n this[l].width += width;\n this[l].height = height > this[l].height ? height : this[l].height;\n }\n lines.addAndAccumulate = function(l, text, font, color, width, height, vadjust, mod, strokeWidth, strokeColor) {\n this.add(l, text, font, color, width, height, vadjust, mod, strokeWidth, strokeColor);\n this.accumulate(l, width, height);\n }\n if (this.elementOptions.label !== undefined) {\n let nlLines = String(this.elementOptions.label).split('\\n');\n let lineCount = nlLines.length;\n if (this.elementOptions.font.multi) {\n for (let i = 0; i < lineCount; i++) {\n let blocks = this.splitBlocks(nlLines[i], this.elementOptions.font.multi);\n let lineWidth = 0;\n let lineHeight = 0;\n if (blocks) {\n if (blocks.length == 0) {\n let values = this.getFormattingValues(ctx, selected, hover, \"normal\");\n lines.addAndAccumulate(k, \"\", values.font, values.color, 0, values.size, values.vadjust, \"normal\", values.strokeWidth, values.strokeColor);\n height += lines[k].height;\n k++;\n continue;\n }\n for (let j = 0; j < blocks.length; j++) {\n if (this.fontOptions.maxWdt > 0) {\n let values = this.getFormattingValues(ctx, selected, hover, blocks[j].mod);\n let words = blocks[j].text.split(\" \");\n let atStart = true\n let text = \"\";\n let measure;\n let lastMeasure;\n let w = 0;\n while (w < words.length) {\n let pre = atStart ? \"\" : \" \";\n lastMeasure = measure;\n measure = ctx.measureText(text + pre + words[w]);\n if (lineWidth + measure.width > this.fontOptions.maxWdt) {\n lineHeight = (values.height > lineHeight) ? values.height : lineHeight;\n lines.add(k, text, values.font, values.color, lastMeasure.width, values.height, values.vadjust, blocks[j].mod, values.strokeWidth, values.strokeColor);\n lines.accumulate(k, lastMeasure.width, lineHeight);\n text = \"\";\n atStart = true;\n lineWidth = 0;\n width = lines[k].width > width ? lines[k].width : width;\n height += lines[k].height;\n k++;\n } else {\n text = text + pre + words[w];\n if (w === words.length-1) {\n lineHeight = (values.height > lineHeight) ? values.height : lineHeight;\n lineWidth += measure.width;\n lines.add(k, text, values.font, values.color, measure.width, values.height, values.vadjust, blocks[j].mod, values.strokeWidth, values.strokeColor);\n lines.accumulate(k, measure.width, lineHeight);\n if (j === blocks.length-1) {\n width = lines[k].width > width ? lines[k].width : width;\n height += lines[k].height;\n k++;\n }\n }\n w++;\n atStart = false;\n }\n }\n } else {\n let values = this.getFormattingValues(ctx, selected, hover, blocks[j].mod);\n let measure = ctx.measureText(blocks[j].text);\n lines.addAndAccumulate(k, blocks[j].text, values.font, values.color, measure.width, values.height, values.vadjust, blocks[j].mod, values.strokeWidth, values.strokeColor);\n width = lines[k].width > width ? lines[k].width : width;\n if (blocks.length-1 === j) {\n height += lines[k].height;\n k++;\n }\n }\n }\n }\n }\n } else {\n for (let i = 0; i < lineCount; i++) {\n let values = this.getFormattingValues(ctx, selected, hover, \"normal\");\n if (this.fontOptions.maxWdt > 0) {\n let words = nlLines[i].split(\" \");\n let text = \"\";\n let measure;\n let lastMeasure;\n let w = 0;\n while (w < words.length) {\n let pre = (text === \"\") ? \"\" : \" \";\n lastMeasure = measure;\n measure = ctx.measureText(text + pre + words[w]);\n if (measure.width > this.fontOptions.maxWdt) {\n lines.addAndAccumulate(k, text, values.font, values.color, lastMeasure.width, values.size, values.vadjust, \"normal\", values.strokeWidth, values.strokeColor)\n width = lines[k].width > width ? lines[k].width : width;\n height += lines[k].height;\n text = \"\";\n k++;\n } else {\n text = text + pre + words[w];\n if (w === words.length-1) {\n lines.addAndAccumulate(k, text, values.font, values.color, measure.width, values.size, values.vadjust, \"normal\", values.strokeWidth, values.strokeColor)\n width = lines[k].width > width ? lines[k].width : width;\n height += lines[k].height;\n k++;\n }\n w++;\n }\n }\n } else {\n let text = nlLines[i];\n let measure = ctx.measureText(text);\n lines.addAndAccumulate(k, text, values.font, values.color, measure.width, values.size, values.vadjust, \"normal\", values.strokeWidth, values.strokeColor);\n width = lines[k].width > width ? lines[k].width : width;\n height += lines[k].height;\n k++;\n }\n }\n }\n }\n if ((this.fontOptions.minWdt > 0) && (width < this.fontOptions.minWdt)) {\n width = this.fontOptions.minWdt;\n }\n this.size.labelHeight = height;\n if ((this.fontOptions.minHgt > 0) && (height < this.fontOptions.minHgt)) {\n height = this.fontOptions.minHgt;\n }\n this.lines = lines;\n this.lineCount = lines.length;\n this.size.width = width;\n this.size.height = height;\n this.selectedState = selected;\n this.hoverState = hover;\n }\n}\n\nexport default Label;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/shared/Label.js","\"use strict\";\n\nexports.__esModule = true;\n\nvar _isIterable2 = require(\"../core-js/is-iterable\");\n\nvar _isIterable3 = _interopRequireDefault(_isIterable2);\n\nvar _getIterator2 = require(\"../core-js/get-iterator\");\n\nvar _getIterator3 = _interopRequireDefault(_getIterator2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function () {\n function sliceIterator(arr, i) {\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = (0, _getIterator3.default)(arr), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"]) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n }\n\n return function (arr, i) {\n if (Array.isArray(arr)) {\n return arr;\n } else if ((0, _isIterable3.default)(Object(arr))) {\n return sliceIterator(arr, i);\n } else {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n }\n };\n}();\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/babel-runtime/helpers/slicedToArray.js\n// module id = 161\n// module chunks = 0","module.exports = { \"default\": require(\"core-js/library/fn/is-iterable\"), __esModule: true };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/babel-runtime/core-js/is-iterable.js\n// module id = 162\n// module chunks = 0","require('../modules/web.dom.iterable');\nrequire('../modules/es6.string.iterator');\nmodule.exports = require('../modules/core.is-iterable');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/fn/is-iterable.js\n// module id = 163\n// module chunks = 0","var classof = require('./_classof')\n , ITERATOR = require('./_wks')('iterator')\n , Iterators = require('./_iterators');\nmodule.exports = require('./_core').isIterable = function(it){\n var O = Object(it);\n return O[ITERATOR] !== undefined\n || '@@iterator' in O\n || Iterators.hasOwnProperty(classof(O));\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/core.is-iterable.js\n// module id = 164\n// module chunks = 0","'use strict';\n\nimport NodeBase from '../util/NodeBase'\n\nclass Box extends NodeBase {\n constructor (options, body, labelModule) {\n super(options,body,labelModule);\n this._setMargins(labelModule);\n }\n\n resize(ctx, selected = this.selected, hover = this.hover) {\n if ((this.width === undefined) || this.labelModule.differentState(selected, hover)) {\n this.textSize = this.labelModule.getTextSize(ctx, selected, hover);\n this.width = this.textSize.width + this.margin.right + this.margin.left;\n this.height = this.textSize.height + this.margin.top + this.margin.bottom;\n this.radius = this.width / 2;\n }\n }\n\n draw(ctx, x, y, selected, hover, values) {\n this.resize(ctx, selected, hover);\n this.left = x - this.width / 2;\n this.top = y - this.height / 2;\n\n ctx.strokeStyle = values.borderColor;\n ctx.lineWidth = values.borderWidth;\n ctx.lineWidth /= this.body.view.scale;\n ctx.lineWidth = Math.min(this.width, ctx.lineWidth);\n\n ctx.fillStyle = values.color;\n\n ctx.roundRect(this.left, this.top, this.width, this.height, values.borderRadius);\n\n // draw shadow if enabled\n this.enableShadow(ctx, values);\n // draw the background\n ctx.fill();\n // disable shadows for other elements.\n this.disableShadow(ctx, values);\n\n //draw dashed border if enabled, save and restore is required for firefox not to crash on unix.\n ctx.save();\n // if borders are zero width, they will be drawn with width 1 by default. This prevents that\n if (values.borderWidth > 0) {\n this.enableBorderDashes(ctx, values);\n //draw the border\n ctx.stroke();\n //disable dashed border for other elements\n this.disableBorderDashes(ctx, values);\n }\n ctx.restore();\n\n this.updateBoundingBox(x, y, ctx, selected, hover);\n this.labelModule.draw(ctx, this.left + this.textSize.width / 2 + this.margin.left,\n this.top + this.textSize.height / 2 + this.margin.top, selected, hover);\n }\n\n updateBoundingBox(x, y, ctx, selected, hover) {\n this.resize(ctx, selected, hover);\n this.left = x - this.width / 2;\n this.top = y - this.height / 2;\n\n let borderRadius = this.options.shapeProperties.borderRadius; // only effective for box\n this.boundingBox.left = this.left - borderRadius;\n this.boundingBox.top = this.top - borderRadius;\n this.boundingBox.bottom = this.top + this.height + borderRadius;\n this.boundingBox.right = this.left + this.width + borderRadius;\n }\n\n distanceToBorder(ctx, angle) {\n this.resize(ctx);\n let borderWidth = this.options.borderWidth;\n\n return Math.min(\n Math.abs((this.width) / 2 / Math.cos(angle)),\n Math.abs((this.height) / 2 / Math.sin(angle))) + borderWidth;\n }\n}\n\nexport default Box;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/nodes/shapes/Box.js","module.exports = { \"default\": require(\"core-js/library/fn/object/get-prototype-of\"), __esModule: true };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/babel-runtime/core-js/object/get-prototype-of.js\n// module id = 166\n// module chunks = 0","require('../../modules/es6.object.get-prototype-of');\nmodule.exports = require('../../modules/_core').Object.getPrototypeOf;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/fn/object/get-prototype-of.js\n// module id = 167\n// module chunks = 0","// 19.1.2.9 Object.getPrototypeOf(O)\nvar toObject = require('./_to-object')\n , $getPrototypeOf = require('./_object-gpo');\n\nrequire('./_object-sap')('getPrototypeOf', function(){\n return function getPrototypeOf(it){\n return $getPrototypeOf(toObject(it));\n };\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/es6.object.get-prototype-of.js\n// module id = 168\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\n\nvar _typeof2 = require(\"../helpers/typeof\");\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && ((typeof call === \"undefined\" ? \"undefined\" : (0, _typeof3.default)(call)) === \"object\" || typeof call === \"function\") ? call : self;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/babel-runtime/helpers/possibleConstructorReturn.js\n// module id = 169\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\n\nvar _setPrototypeOf = require(\"../core-js/object/set-prototype-of\");\n\nvar _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf);\n\nvar _create = require(\"../core-js/object/create\");\n\nvar _create2 = _interopRequireDefault(_create);\n\nvar _typeof2 = require(\"../helpers/typeof\");\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + (typeof superClass === \"undefined\" ? \"undefined\" : (0, _typeof3.default)(superClass)));\n }\n\n subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/babel-runtime/helpers/inherits.js\n// module id = 170\n// module chunks = 0","module.exports = { \"default\": require(\"core-js/library/fn/object/set-prototype-of\"), __esModule: true };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/babel-runtime/core-js/object/set-prototype-of.js\n// module id = 171\n// module chunks = 0","require('../../modules/es6.object.set-prototype-of');\nmodule.exports = require('../../modules/_core').Object.setPrototypeOf;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/fn/object/set-prototype-of.js\n// module id = 172\n// module chunks = 0","// 19.1.3.19 Object.setPrototypeOf(O, proto)\nvar $export = require('./_export');\n$export($export.S, 'Object', {setPrototypeOf: require('./_set-proto').set});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/es6.object.set-prototype-of.js\n// module id = 173\n// module chunks = 0","// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nvar isObject = require('./_is-object')\n , anObject = require('./_an-object');\nvar check = function(O, proto){\n anObject(O);\n if(!isObject(proto) && proto !== null)throw TypeError(proto + \": can't set as prototype!\");\n};\nmodule.exports = {\n set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line\n function(test, buggy, set){\n try {\n set = require('./_ctx')(Function.call, require('./_object-gopd').f(Object.prototype, '__proto__').set, 2);\n set(test, []);\n buggy = !(test instanceof Array);\n } catch(e){ buggy = true; }\n return function setPrototypeOf(O, proto){\n check(O, proto);\n if(buggy)O.__proto__ = proto;\n else set(O, proto);\n return O;\n };\n }({}, false) : undefined),\n check: check\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_set-proto.js\n// module id = 174\n// module chunks = 0","class NodeBase {\n constructor(options, body, labelModule) {\n this.body = body;\n this.labelModule = labelModule;\n this.setOptions(options);\n this.top = undefined;\n this.left = undefined;\n this.height = undefined;\n this.width = undefined;\n this.radius = undefined;\n this.margin = undefined;\n this.boundingBox = {top: 0, left: 0, right: 0, bottom: 0};\n }\n\n setOptions(options) {\n this.options = options;\n }\n\n _setMargins(labelModule) {\n this.margin = {};\n if (this.options.margin) {\n if (typeof this.options.margin == 'object') {\n this.margin.top = this.options.margin.top;\n this.margin.right = this.options.margin.right;\n this.margin.bottom = this.options.margin.bottom;\n this.margin.left = this.options.margin.left;\n } else {\n this.margin.top = this.options.margin;\n this.margin.right = this.options.margin;\n this.margin.bottom = this.options.margin;\n this.margin.left = this.options.margin;\n }\n }\n labelModule.adjustSizes(this.margin)\n }\n\n _distanceToBorder(ctx,angle) {\n var borderWidth = this.options.borderWidth;\n this.resize(ctx);\n return Math.min(\n Math.abs(this.width / 2 / Math.cos(angle)),\n Math.abs(this.height / 2 / Math.sin(angle))) + borderWidth;\n }\n\n enableShadow(ctx, values) {\n if (values.shadow) {\n ctx.shadowColor = values.shadowColor;\n ctx.shadowBlur = values.shadowSize;\n ctx.shadowOffsetX = values.shadowX;\n ctx.shadowOffsetY = values.shadowY;\n }\n }\n\n disableShadow(ctx, values) {\n if (values.shadow) {\n ctx.shadowColor = 'rgba(0,0,0,0)';\n ctx.shadowBlur = 0;\n ctx.shadowOffsetX = 0;\n ctx.shadowOffsetY = 0;\n }\n }\n\n enableBorderDashes(ctx, values) {\n if (values.borderDashes !== false) {\n if (ctx.setLineDash !== undefined) {\n let dashes = values.borderDashes;\n if (dashes === true) {\n dashes = [5,15]\n }\n ctx.setLineDash(dashes);\n }\n else {\n console.warn(\"setLineDash is not supported in this browser. The dashed borders cannot be used.\");\n this.options.shapeProperties.borderDashes = false;\n values.borderDashes = false;\n }\n }\n }\n\n disableBorderDashes(ctx, values) {\n if (values.borderDashes !== false) {\n if (ctx.setLineDash !== undefined) {\n ctx.setLineDash([0]);\n }\n else {\n console.warn(\"setLineDash is not supported in this browser. The dashed borders cannot be used.\");\n this.options.shapeProperties.borderDashes = false;\n values.borderDashes = false;\n }\n }\n }\n}\n\nexport default NodeBase;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/nodes/util/NodeBase.js","'use strict';\n\nimport CircleImageBase from '../util/CircleImageBase'\n\nclass Circle extends CircleImageBase {\n constructor(options, body, labelModule) {\n super(options, body, labelModule)\n this._setMargins(labelModule);\n }\n\n resize(ctx, selected = this.selected, hover = this.hover, values = { size: this.options.size}) {\n if ((this.width === undefined) || (this.labelModule.differentState(selected, hover))) {\n this.textSize = this.labelModule.getTextSize(ctx, selected, hover);\n var diameter = Math.max(this.textSize.width + this.margin.right + this.margin.left,\n this.textSize.height + this.margin.top + this.margin.bottom);\n this.options.size = diameter / 2;\n\n this.width = diameter;\n this.height = diameter;\n this.radius = this.width / 2;\n }\n }\n\n draw(ctx, x, y, selected, hover, values) {\n this.resize(ctx, selected, hover);\n this.left = x - this.width / 2;\n this.top = y - this.height / 2;\n\n this._drawRawCircle(ctx, x, y, selected, hover, values);\n\n this.boundingBox.top = y - values.size;\n this.boundingBox.left = x - values.size;\n this.boundingBox.right = x + values.size;\n this.boundingBox.bottom = y + values.size;\n\n this.updateBoundingBox(x,y);\n this.labelModule.draw(ctx, this.left + this.textSize.width / 2 + this.margin.left,\n this.top + this.textSize.height / 2 + this.margin.top, selected, hover);\n }\n\n updateBoundingBox(x,y) {\n this.boundingBox.top = y - this.options.size;\n this.boundingBox.left = x - this.options.size;\n this.boundingBox.right = x + this.options.size;\n this.boundingBox.bottom = y + this.options.size;\n }\n\n distanceToBorder(ctx, angle) {\n this.resize(ctx);\n return this.width * 0.5;\n }\n}\n\nexport default Circle;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/nodes/shapes/Circle.js","import NodeBase from '../util/NodeBase'\n\nclass CircleImageBase extends NodeBase {\n constructor(options, body, labelModule) {\n super(options, body, labelModule);\n this.labelOffset = 0;\n this.imageLoaded = false;\n }\n\n setOptions(options, imageObj) {\n this.options = options;\n if (imageObj) {\n this.imageObj = imageObj;\n }\n }\n\n /**\n * This function resizes the image by the options size when the image has not yet loaded. If the image has loaded, we\n * force the update of the size again.\n *\n * @private\n */\n _resizeImage() {\n let force = false;\n if (!this.imageObj.width || !this.imageObj.height) { // undefined or 0\n this.imageLoaded = false;\n }\n else if (this.imageLoaded === false) {\n this.imageLoaded = true;\n force = true;\n }\n\n if (!this.width || !this.height || force === true) { // undefined or 0\n var width, height, ratio;\n if (this.imageObj.width && this.imageObj.height) { // not undefined or 0\n width = 0;\n height = 0;\n }\n if (this.options.shapeProperties.useImageSize === false) {\n if (this.imageObj.width > this.imageObj.height) {\n ratio = this.imageObj.width / this.imageObj.height;\n width = this.options.size * 2 * ratio || this.imageObj.width;\n height = this.options.size * 2 || this.imageObj.height;\n }\n else {\n if (this.imageObj.width && this.imageObj.height) { // not undefined or 0\n ratio = this.imageObj.height / this.imageObj.width;\n }\n else {\n ratio = 1;\n }\n width = this.options.size * 2;\n height = this.options.size * 2 * ratio;\n }\n }\n else {\n // when not using the size property, we use the image size\n width = this.imageObj.width;\n height = this.imageObj.height;\n }\n this.width = width;\n this.height = height;\n this.radius = 0.5 * this.width;\n }\n\n }\n\n _drawRawCircle(ctx, x, y, selected, hover, values) {\n var borderWidth = values.borderWidth / this.body.view.scale;\n ctx.lineWidth = Math.min(this.width, borderWidth);\n\n ctx.strokeStyle = values.borderColor;\n ctx.fillStyle = values.color;\n ctx.circle(x, y, values.size);\n\n // draw shadow if enabled\n this.enableShadow(ctx, values);\n // draw the background\n ctx.fill();\n // disable shadows for other elements.\n this.disableShadow(ctx, values);\n\n //draw dashed border if enabled, save and restore is required for firefox not to crash on unix.\n ctx.save();\n // if borders are zero width, they will be drawn with width 1 by default. This prevents that\n if (borderWidth > 0) {\n this.enableBorderDashes(ctx, values);\n //draw the border\n ctx.stroke();\n //disable dashed border for other elements\n this.disableBorderDashes(ctx, values);\n }\n ctx.restore();\n }\n\n _drawImageAtPosition(ctx, values) {\n if (this.imageObj.width != 0) {\n // draw the image\n ctx.globalAlpha = 1.0;\n\n // draw shadow if enabled\n this.enableShadow(ctx, values);\n\n let factor = (this.imageObj.width / this.width) / this.body.view.scale;\n if (factor > 2 && this.options.shapeProperties.interpolation === true) {\n let w = this.imageObj.width;\n let h = this.imageObj.height;\n var can2 = document.createElement('canvas');\n can2.width = w;\n can2.height = w;\n var ctx2 = can2.getContext('2d');\n\n factor *= 0.5;\n w *= 0.5;\n h *= 0.5;\n ctx2.drawImage(this.imageObj, 0, 0, w, h);\n\n let distance = 0;\n let iterations = 1;\n while (factor > 2 && iterations < 4) {\n ctx2.drawImage(can2, distance, 0, w, h, distance+w, 0, w/2, h/2);\n distance += w;\n factor *= 0.5;\n w *= 0.5;\n h *= 0.5;\n iterations += 1;\n }\n ctx.drawImage(can2, distance, 0, w, h, this.left, this.top, this.width, this.height);\n }\n else {\n // draw image\n ctx.drawImage(this.imageObj, this.left, this.top, this.width, this.height);\n }\n\n\n // disable shadows for other elements.\n this.disableShadow(ctx, values);\n }\n }\n\n _drawImageLabel(ctx, x, y, selected, hover) {\n var yLabel;\n var offset = 0;\n\n if (this.height !== undefined) {\n offset = this.height * 0.5;\n var labelDimensions = this.labelModule.getTextSize(ctx, selected, hover);\n if (labelDimensions.lineCount >= 1) {\n offset += labelDimensions.height / 2;\n }\n }\n\n yLabel = y + offset;\n\n if (this.options.label) {\n this.labelOffset = offset;\n }\n this.labelModule.draw(ctx, x, yLabel, selected, hover, 'hanging');\n }\n}\n\nexport default CircleImageBase;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/nodes/util/CircleImageBase.js","'use strict';\n\n\nimport CircleImageBase from '../util/CircleImageBase'\n\nclass CircularImage extends CircleImageBase {\n constructor (options, body, labelModule, imageObj) {\n super(options, body, labelModule);\n this.imageObj = imageObj;\n this._swapToImageResizeWhenImageLoaded = true;\n }\n\n resize(ctx, selected = this.selected, hover = this.hover) {\n if ((this.imageObj.src === undefined) ||\n (this.imageObj.width === undefined) ||\n (this.imageObj.height === undefined) ||\n (this.labelModule.differentState(selected, hover))) {\n var diameter = this.options.size * 2;\n this.width = diameter;\n this.height = diameter;\n this._swapToImageResizeWhenImageLoaded = true;\n this.radius = 0.5*this.width;\n } else {\n if (this._swapToImageResizeWhenImageLoaded) {\n this.width = undefined;\n this.height = undefined;\n this._swapToImageResizeWhenImageLoaded = false;\n }\n this._resizeImage();\n }\n }\n\n draw(ctx, x, y, selected, hover, values) {\n this.resize();\n\n this.left = x - this.width / 2;\n this.top = y - this.height / 2;\n\n let size = Math.min(0.5*this.height, 0.5*this.width);\n\n // draw the background circle. IMPORTANT: the stroke in this method is used by the clip method below.\n this._drawRawCircle(ctx, x, y, selected, hover, values);\n\n // now we draw in the circle, we save so we can revert the clip operation after drawing.\n ctx.save();\n // clip is used to use the stroke in drawRawCircle as an area that we can draw in.\n ctx.clip();\n // draw the image\n this._drawImageAtPosition(ctx, values);\n // restore so we can again draw on the full canvas\n ctx.restore();\n\n this._drawImageLabel(ctx, x, y, selected, hover);\n\n this.updateBoundingBox(x,y);\n }\n\n updateBoundingBox(x,y) {\n this.boundingBox.top = y - this.options.size;\n this.boundingBox.left = x - this.options.size;\n this.boundingBox.right = x + this.options.size;\n this.boundingBox.bottom = y + this.options.size;\n this.boundingBox.left = Math.min(this.boundingBox.left, this.labelModule.size.left);\n this.boundingBox.right = Math.max(this.boundingBox.right, this.labelModule.size.left + this.labelModule.size.width);\n this.boundingBox.bottom = Math.max(this.boundingBox.bottom, this.boundingBox.bottom + this.labelOffset);\n }\n\n\n distanceToBorder(ctx, angle) {\n this.resize(ctx);\n return this.width * 0.5;\n }\n}\n\nexport default CircularImage;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/nodes/shapes/CircularImage.js","'use strict';\n\nimport NodeBase from '../util/NodeBase'\n\nclass Database extends NodeBase {\n constructor (options, body, labelModule) {\n super(options, body, labelModule);\n this._setMargins(labelModule);\n }\n\n resize(ctx, selected, hover) {\n if ((this.width === undefined) || (this.labelModule.differentState(selected, hover))) {\n this.textSize = this.labelModule.getTextSize(ctx, selected, hover);\n var size = this.textSize.width + this.margin.right + this.margin.left;\n this.width = size;\n this.height = size;\n this.radius = this.width / 2;\n }\n }\n\n draw(ctx, x, y, selected, hover, values) {\n this.resize(ctx, selected, hover);\n this.left = x - this.width / 2;\n this.top = y - this.height / 2;\n\n var borderWidth = values.borderWidth / this.body.view.scale;\n ctx.lineWidth = Math.min(this.width, borderWidth);\n\n ctx.strokeStyle = values.borderColor;\n\n ctx.fillStyle = values.color;\n ctx.database(x - this.width / 2, y - this.height / 2, this.width, this.height);\n\n // draw shadow if enabled\n this.enableShadow(ctx, values);\n // draw the background\n ctx.fill();\n // disable shadows for other elements.\n this.disableShadow(ctx, values);\n\n //draw dashed border if enabled, save and restore is required for firefox not to crash on unix.\n ctx.save();\n // if borders are zero width, they will be drawn with width 1 by default. This prevents that\n if (borderWidth > 0) {\n this.enableBorderDashes(ctx, values);\n //draw the border\n ctx.stroke();\n //disable dashed border for other elements\n this.disableBorderDashes(ctx, values);\n }\n ctx.restore();\n\n this.updateBoundingBox(x, y, ctx, selected, hover);\n this.labelModule.draw(ctx, this.left + this.textSize.width / 2 + this.margin.left,\n this.top + this.textSize.height / 2 + this.margin.top, selected, hover);\n }\n\n updateBoundingBox(x, y, ctx, selected, hover) {\n this.resize(ctx, selected, hover);\n\n this.left = x - this.width * 0.5;\n this.top = y - this.height * 0.5;\n\n this.boundingBox.left = this.left;\n this.boundingBox.top = this.top;\n this.boundingBox.bottom = this.top + this.height;\n this.boundingBox.right = this.left + this.width;\n }\n\n distanceToBorder(ctx, angle) {\n return this._distanceToBorder(ctx,angle);\n }\n}\n\nexport default Database;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/nodes/shapes/Database.js","'use strict';\n\nimport ShapeBase from '../util/ShapeBase'\n\nclass Diamond extends ShapeBase {\n constructor(options, body, labelModule) {\n super(options, body, labelModule)\n }\n\n resize(ctx, values, selected = this.selected, hover = this.hover) {\n this._resizeShape(selected, hover, values);\n }\n\n draw(ctx, x, y, selected, hover, values) {\n this._drawShape(ctx, 'diamond', 4, x, y, selected, hover, values);\n }\n\n distanceToBorder(ctx, angle) {\n return this._distanceToBorder(ctx,angle);\n }\n}\n\nexport default Diamond;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/nodes/shapes/Diamond.js","import NodeBase from '../util/NodeBase'\n\nclass ShapeBase extends NodeBase {\n constructor(options, body, labelModule) {\n super(options, body, labelModule)\n }\n\n _resizeShape(selected = this.selected, hover = this.hover, values = { size: this.options.size }) {\n if ((this.width === undefined) || (this.labelModule.differentState(selected, hover))) {\n var size = 2 * values.size;\n this.width = size;\n this.height = size;\n this.radius = 0.5*this.width;\n }\n }\n\n _drawShape(ctx, shape, sizeMultiplier, x, y, selected, hover, values) {\n this._resizeShape(selected, hover, values);\n\n this.left = x - this.width / 2;\n this.top = y - this.height / 2;\n\n var borderWidth = values.borderWidth / this.body.view.scale;\n ctx.lineWidth = Math.min(this.width, borderWidth);\n\n ctx.strokeStyle = values.borderColor;\n ctx.fillStyle = values.color;\n ctx[shape](x, y, values.size);\n\n // draw shadow if enabled\n this.enableShadow(ctx, values);\n // draw the background\n ctx.fill();\n // disable shadows for other elements.\n this.disableShadow(ctx, values);\n\n //draw dashed border if enabled, save and restore is required for firefox not to crash on unix.\n ctx.save();\n // if borders are zero width, they will be drawn with width 1 by default. This prevents that\n if (borderWidth > 0) {\n this.enableBorderDashes(ctx, values);\n //draw the border\n ctx.stroke();\n //disable dashed border for other elements\n this.disableBorderDashes(ctx, values);\n }\n ctx.restore();\n\n if (this.options.label !== undefined) {\n let yLabel = y + 0.5 * this.height + 3; // the + 3 is to offset it a bit below the node.\n this.labelModule.draw(ctx, x, yLabel, selected, hover, 'hanging');\n }\n\n this.updateBoundingBox(x,y);\n }\n\n updateBoundingBox(x,y) {\n this.boundingBox.top = y - this.options.size;\n this.boundingBox.left = x - this.options.size;\n this.boundingBox.right = x + this.options.size;\n this.boundingBox.bottom = y + this.options.size;\n\n if (this.options.label !== undefined && this.labelModule.size.width > 0) {\n this.boundingBox.left = Math.min(this.boundingBox.left, this.labelModule.size.left);\n this.boundingBox.right = Math.max(this.boundingBox.right, this.labelModule.size.left + this.labelModule.size.width);\n this.boundingBox.bottom = Math.max(this.boundingBox.bottom, this.boundingBox.bottom + this.labelModule.size.height + 3);\n }\n }\n\n\n\n}\n\nexport default ShapeBase;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/nodes/util/ShapeBase.js","'use strict';\n\nimport ShapeBase from '../util/ShapeBase'\n\nclass Dot extends ShapeBase {\n constructor(options, body, labelModule) {\n super(options, body, labelModule)\n }\n\n resize(ctx, values, selected = this.selected, hover = this.hover) {\n this._resizeShape(selected, hover, values);\n }\n\n draw(ctx, x, y, selected, hover, values) {\n this._drawShape(ctx, 'circle', 2, x, y, selected, hover, values);\n }\n\n distanceToBorder(ctx, angle) {\n this.resize(ctx);\n return this.options.size;\n }\n}\n\nexport default Dot;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/nodes/shapes/Dot.js","'use strict';\n\nimport NodeBase from '../util/NodeBase'\n\nclass Ellipse extends NodeBase {\n constructor(options, body, labelModule) {\n super(options, body, labelModule);\n }\n\n resize(ctx, selected = this.selected, hover = this.hover) {\n if ((this.width === undefined) || (this.labelModule.differentState(selected, hover))) {\n var textSize = this.labelModule.getTextSize(ctx, selected, hover);\n\n this.height = textSize.height * 2;\n this.width = textSize.width + this.height;\n this.radius = 0.5*this.width;\n }\n }\n\n draw(ctx, x, y, selected, hover, values) {\n this.resize(ctx, selected, hover);\n this.left = x - this.width * 0.5;\n this.top = y - this.height * 0.5;\n\n var borderWidth = values.borderWidth / this.body.view.scale;\n ctx.lineWidth = Math.min(this.width, borderWidth);\n\n ctx.strokeStyle = values.borderColor;\n\n ctx.fillStyle = values.color;\n ctx.ellipse(this.left, this.top, this.width, this.height);\n\n // draw shadow if enabled\n this.enableShadow(ctx, values);\n // draw the background\n ctx.fill();\n // disable shadows for other elements.\n this.disableShadow(ctx, values);\n\n //draw dashed border if enabled, save and restore is required for firefox not to crash on unix.\n ctx.save();\n\n // if borders are zero width, they will be drawn with width 1 by default. This prevents that\n if (borderWidth > 0) {\n this.enableBorderDashes(ctx, values);\n //draw the border\n ctx.stroke();\n //disable dashed border for other elements\n this.disableBorderDashes(ctx, values);\n }\n\n ctx.restore();\n\n this.updateBoundingBox(x, y, ctx, selected, hover);\n this.labelModule.draw(ctx, x, y, selected, hover);\n }\n\n updateBoundingBox(x, y, ctx, selected, hover) {\n this.resize(ctx, selected, hover); // just in case\n\n this.left = x - this.width * 0.5;\n this.top = y - this.height * 0.5;\n\n this.boundingBox.left = this.left;\n this.boundingBox.top = this.top;\n this.boundingBox.bottom = this.top + this.height;\n this.boundingBox.right = this.left + this.width;\n }\n\n distanceToBorder(ctx, angle) {\n this.resize(ctx);\n var a = this.width * 0.5;\n var b = this.height * 0.5;\n var w = (Math.sin(angle) * a);\n var h = (Math.cos(angle) * b);\n return a * b / Math.sqrt(w * w + h * h);\n }\n}\n\nexport default Ellipse;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/nodes/shapes/Ellipse.js","'use strict';\n\nimport NodeBase from '../util/NodeBase'\n\nclass Icon extends NodeBase {\n constructor(options, body, labelModule) {\n super(options, body, labelModule);\n this._setMargins(labelModule);\n }\n\n resize(ctx, selected, hover) {\n if ((this.width === undefined) || (this.labelModule.differentState(selected, hover))) {\n this.iconSize = {\n width: Number(this.options.icon.size),\n height: Number(this.options.icon.size)\n };\n this.width = this.iconSize.width + this.margin.right + this.margin.left;\n this.height = this.iconSize.height + this.margin.top + this.margin.bottom;\n this.radius = 0.5*this.width;\n }\n }\n\n draw(ctx, x, y, selected, hover, values) {\n this.resize(ctx, selected, hover);\n this.options.icon.size = this.options.icon.size || 50;\n\n this.left = x - this.width / 2;\n this.top = y - this.height / 2;\n this._icon(ctx, x, y, selected, hover, values);\n\n if (this.options.label !== undefined) {\n var iconTextSpacing = 5;\n this.labelModule.draw(ctx, this.left + this.iconSize.width / 2 + this.margin.left,\n y + this.height / 2 + iconTextSpacing, selected);\n }\n\n this.updateBoundingBox(x, y)\n }\n\n updateBoundingBox(x, y) {\n this.boundingBox.top = y - this.options.icon.size * 0.5;\n this.boundingBox.left = x - this.options.icon.size * 0.5;\n this.boundingBox.right = x + this.options.icon.size * 0.5;\n this.boundingBox.bottom = y + this.options.icon.size * 0.5;\n\n if (this.options.label !== undefined && this.labelModule.size.width > 0) {\n var iconTextSpacing = 5;\n this.boundingBox.left = Math.min(this.boundingBox.left, this.labelModule.size.left);\n this.boundingBox.right = Math.max(this.boundingBox.right, this.labelModule.size.left + this.labelModule.size.width);\n this.boundingBox.bottom = Math.max(this.boundingBox.bottom, this.boundingBox.bottom + this.labelModule.size.height + iconTextSpacing);\n }\n }\n\n _icon(ctx, x, y, selected, hover, values) {\n let iconSize = Number(this.options.icon.size);\n\n if (this.options.icon.code !== undefined) {\n ctx.font = (selected ? \"bold \" : \"\") + iconSize + \"px \" + this.options.icon.face;\n\n // draw icon\n ctx.fillStyle = this.options.icon.color || \"black\";\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n\n // draw shadow if enabled\n this.enableShadow(ctx, values);\n ctx.fillText(this.options.icon.code, x, y);\n\n // disable shadows for other elements.\n this.disableShadow(ctx, values);\n } else {\n 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.')\n }\n\n }\n\n distanceToBorder(ctx, angle) {\n return this._distanceToBorder(ctx,angle);\n }\n}\n\nexport default Icon;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/nodes/shapes/Icon.js","'use strict';\n\nimport CircleImageBase from '../util/CircleImageBase'\n\nclass Image extends CircleImageBase {\n constructor (options, body, labelModule, imageObj) {\n super(options, body, labelModule);\n this.imageObj = imageObj;\n }\n\n resize() {\n this._resizeImage();\n }\n\n draw(ctx, x, y, selected, hover, values) {\n this.resize();\n this.left = x - this.width / 2;\n this.top = y - this.height / 2;\n\n if (this.options.shapeProperties.useBorderWithImage === true) {\n var neutralborderWidth = this.options.borderWidth;\n var selectionLineWidth = this.options.borderWidthSelected || 2 * this.options.borderWidth;\n var borderWidth = (selected ? selectionLineWidth : neutralborderWidth) / this.body.view.scale;\n ctx.lineWidth = Math.min(this.width, borderWidth);\n\n ctx.beginPath();\n\n // setup the line properties.\n ctx.strokeStyle = selected ? this.options.color.highlight.border : hover ? this.options.color.hover.border : this.options.color.border;\n\n // set a fillstyle\n ctx.fillStyle = selected ? this.options.color.highlight.background : hover ? this.options.color.hover.background : this.options.color.background;\n\n // draw a rectangle to form the border around. This rectangle is filled so the opacity of a picture (in future vis releases?) can be used to tint the image\n ctx.rect(this.left - 0.5 * ctx.lineWidth,\n this.top - 0.5 * ctx.lineWidth,\n this.width + ctx.lineWidth,\n this.height + ctx.lineWidth);\n ctx.fill();\n\n //draw dashed border if enabled, save and restore is required for firefox not to crash on unix.\n ctx.save();\n // if borders are zero width, they will be drawn with width 1 by default. This prevents that\n if (borderWidth > 0) {\n this.enableBorderDashes(ctx);\n //draw the border\n ctx.stroke();\n //disable dashed border for other elements\n this.disableBorderDashes(ctx);\n }\n ctx.restore();\n\n ctx.closePath();\n }\n\n this._drawImageAtPosition(ctx, values);\n\n this._drawImageLabel(ctx, x, y, selected, hover);\n\n this.updateBoundingBox(x,y);\n }\n\n updateBoundingBox(x,y) {\n this.resize();\n this.left = x - this.width / 2;\n this.top = y - this.height / 2;\n\n this.boundingBox.top = this.top;\n this.boundingBox.left = this.left;\n this.boundingBox.right = this.left + this.width;\n this.boundingBox.bottom = this.top + this.height;\n\n if (this.options.label !== undefined && this.labelModule.size.width > 0) {\n this.boundingBox.left = Math.min(this.boundingBox.left, this.labelModule.size.left);\n this.boundingBox.right = Math.max(this.boundingBox.right, this.labelModule.size.left + this.labelModule.size.width);\n this.boundingBox.bottom = Math.max(this.boundingBox.bottom, this.boundingBox.bottom + this.labelOffset);\n }\n }\n\n distanceToBorder(ctx, angle) {\n return this._distanceToBorder(ctx,angle);\n }\n}\n\nexport default Image;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/nodes/shapes/Image.js","'use strict';\n\nimport ShapeBase from '../util/ShapeBase'\n\nclass Square extends ShapeBase {\n constructor(options, body, labelModule) {\n super(options, body, labelModule)\n }\n\n resize() {\n this._resizeShape();\n }\n\n draw(ctx, x, y, selected, hover, values) {\n this._drawShape(ctx, 'square', 2, x, y, selected, hover, values);\n }\n\n distanceToBorder(ctx, angle) {\n return this._distanceToBorder(ctx,angle);\n }\n}\n\nexport default Square;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/nodes/shapes/Square.js","'use strict';\n\nimport ShapeBase from '../util/ShapeBase'\n\nclass Star extends ShapeBase {\n constructor(options, body, labelModule) {\n super(options, body, labelModule)\n }\n\n resize(ctx, values, selected, hover) {\n this._resizeShape(selected, hover, values);\n }\n\n draw(ctx, x, y, selected, hover, values) {\n this._drawShape(ctx, 'star', 4, x, y, selected, hover, values);\n }\n\n distanceToBorder(ctx, angle) {\n return this._distanceToBorder(ctx,angle);\n }\n}\n\nexport default Star;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/nodes/shapes/Star.js","'use strict';\n\nimport NodeBase from '../util/NodeBase'\n\nclass Text extends NodeBase {\n constructor(options, body, labelModule) {\n super(options, body, labelModule);\n this._setMargins(labelModule);\n }\n\n resize(ctx, selected, hover) {\n if ((this.width === undefined) || this.labelModule.differentState(selected, hover)) {\n this.textSize = this.labelModule.getTextSize(ctx, selected, hover);\n this.width = this.textSize.width + this.margin.right + this.margin.left;\n this.height = this.textSize.height + this.margin.top + this.margin.bottom;\n this.radius = 0.5*this.width;\n }\n }\n\n draw(ctx, x, y, selected, hover, values) {\n this.resize(ctx, selected, hover);\n this.left = x - this.width / 2;\n this.top = y - this.height / 2;\n\n // draw shadow if enabled\n this.enableShadow(ctx, values);\n this.labelModule.draw(ctx, this.left + this.textSize.width / 2 + this.margin.left,\n this.top + this.textSize.height / 2 + this.margin.top, selected, hover);\n\n // disable shadows for other elements.\n this.disableShadow(ctx, values);\n\n this.updateBoundingBox(x, y, ctx, selected, hover);\n }\n\n updateBoundingBox(x, y, ctx, selected, hover) {\n this.resize(ctx, selected, hover);\n\n this.left = x - this.width / 2;\n this.top = y - this.height / 2;\n\n this.boundingBox.top = this.top;\n this.boundingBox.left = this.left;\n this.boundingBox.right = this.left + this.width;\n this.boundingBox.bottom = this.top + this.height;\n }\n\n distanceToBorder(ctx, angle) {\n return this._distanceToBorder(ctx,angle);\n }\n}\n\nexport default Text;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/nodes/shapes/Text.js","'use strict';\n\nimport ShapeBase from '../util/ShapeBase'\n\nclass Triangle extends ShapeBase {\n constructor(options, body, labelModule) {\n super(options, body, labelModule)\n }\n\n resize(ctx) {\n this._resizeShape();\n }\n\n draw(ctx, x, y, selected, hover, values) {\n this._drawShape(ctx, 'triangle', 3, x, y, selected, hover, values);\n }\n\n distanceToBorder(ctx, angle) {\n return this._distanceToBorder(ctx,angle);\n }\n}\n\nexport default Triangle;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/nodes/shapes/Triangle.js","'use strict';\n\nimport ShapeBase from '../util/ShapeBase'\n\nclass TriangleDown extends ShapeBase {\n constructor(options, body, labelModule) {\n super(options, body, labelModule)\n }\n\n resize(ctx) {\n this._resizeShape();\n }\n\n draw(ctx, x, y, selected, hover, values) {\n this._drawShape(ctx, 'triangleDown', 3, x, y, selected, hover, values);\n }\n\n distanceToBorder(ctx, angle) {\n return this._distanceToBorder(ctx,angle);\n }\n}\n\nexport default TriangleDown;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/nodes/shapes/TriangleDown.js","var util = require(\"../../util\");\nvar DataSet = require('../../DataSet');\nvar DataView = require('../../DataView');\n\nimport Edge from \"./components/Edge\"\nimport Label from \"./components/shared/Label\"\n\nclass EdgesHandler {\n constructor(body, images, groups) {\n this.body = body;\n this.images = images;\n this.groups = groups;\n\n // create the edge API in the body container\n this.body.functions.createEdge = this.create.bind(this);\n\n this.edgesListeners = {\n add: (event, params) => {this.add(params.items);},\n update: (event, params) => {this.update(params.items);},\n remove: (event, params) => {this.remove(params.items);}\n };\n\n this.options = {};\n this.defaultOptions = {\n arrows: {\n to: {enabled: false, scaleFactor:1, type: 'arrow'}, // boolean / {arrowScaleFactor:1} / {enabled: false, arrowScaleFactor:1}\n middle: {enabled: false, scaleFactor:1, type: 'arrow'},\n from: {enabled: false, scaleFactor:1, type: 'arrow'}\n },\n arrowStrikethrough: true,\n color: {\n color:'#848484',\n highlight:'#848484',\n hover: '#848484',\n inherit: 'from',\n opacity:1.0\n },\n dashes: false,\n font: {\n color: '#343434',\n size: 14, // px\n face: 'arial',\n background: 'none',\n strokeWidth: 2, // px\n strokeColor: '#ffffff',\n align:'horizontal',\n multi: false,\n vadjust: 0,\n bold: {\n mod: 'bold'\n },\n boldital: {\n mod: 'bold italic'\n },\n ital: {\n mod: 'italic'\n },\n mono: {\n mod: '',\n size: 15, // px\n face: 'courier new',\n vadjust: 2\n }\n },\n hidden: false,\n hoverWidth: 1.5,\n label: undefined,\n labelHighlightBold: true,\n length: undefined,\n physics: true,\n scaling:{\n min: 1,\n max: 15,\n label: {\n enabled: true,\n min: 14,\n max: 30,\n maxVisible: 30,\n drawThreshold: 5\n },\n customScalingFunction: function (min,max,total,value) {\n if (max === min) {\n return 0.5;\n }\n else {\n var scale = 1 / (max - min);\n return Math.max(0,(value - min)*scale);\n }\n }\n },\n selectionWidth: 1.5,\n selfReferenceSize:20,\n shadow:{\n enabled: false,\n color: 'rgba(0,0,0,0.5)',\n size:10,\n x:5,\n y:5\n },\n smooth: {\n enabled: true,\n type: \"dynamic\",\n forceDirection:'none',\n roundness: 0.5\n },\n title:undefined,\n width: 1,\n value: undefined\n };\n\n util.extend(this.options, this.defaultOptions);\n\n this.bindEventListeners();\n }\n\n bindEventListeners() {\n // this allows external modules to force all dynamic curves to turn static.\n this.body.emitter.on(\"_forceDisableDynamicCurves\", (type) => {\n if (type === 'dynamic') {\n type = 'continuous';\n }\n let emitChange = false;\n for (let edgeId in this.body.edges) {\n if (this.body.edges.hasOwnProperty(edgeId)) {\n let edge = this.body.edges[edgeId];\n let edgeData = this.body.data.edges._data[edgeId];\n\n // only forcibly remove the smooth curve if the data has been set of the edge has the smooth curves defined.\n // this is because a change in the global would not affect these curves.\n if (edgeData !== undefined) {\n let edgeOptions = edgeData.smooth;\n if (edgeOptions !== undefined) {\n if (edgeOptions.enabled === true && edgeOptions.type === 'dynamic') {\n if (type === undefined) {\n edge.setOptions({smooth: false});\n }\n else {\n edge.setOptions({smooth: {type: type}});\n }\n emitChange = true;\n }\n }\n }\n }\n }\n if (emitChange === true) {\n this.body.emitter.emit(\"_dataChanged\");\n }\n });\n\n // this is called when options of EXISTING nodes or edges have changed.\n this.body.emitter.on(\"_dataUpdated\", () => {\n this.reconnectEdges();\n });\n\n // refresh the edges. Used when reverting from hierarchical layout\n this.body.emitter.on(\"refreshEdges\", this.refresh.bind(this));\n this.body.emitter.on(\"refresh\", this.refresh.bind(this));\n this.body.emitter.on(\"destroy\", () => {\n util.forEach(this.edgesListeners, (callback, event) => {\n if (this.body.data.edges)\n this.body.data.edges.off(event, callback);\n });\n delete this.body.functions.createEdge;\n delete this.edgesListeners.add;\n delete this.edgesListeners.update;\n delete this.edgesListeners.remove;\n delete this.edgesListeners;\n });\n\n }\n\n setOptions(options) {\n this.edgeOptions = options;\n if (options !== undefined) {\n // use the parser from the Edge class to fill in all shorthand notations\n Edge.parseOptions(this.options, options);\n\n // update smooth settings in all edges\n let dataChanged = false;\n if (options.smooth !== undefined) {\n for (let edgeId in this.body.edges) {\n if (this.body.edges.hasOwnProperty(edgeId)) {\n dataChanged = this.body.edges[edgeId].updateEdgeType() || dataChanged;\n }\n }\n }\n\n // update fonts in all edges\n if (options.font !== undefined) {\n // use the parser from the Label class to fill in all shorthand notations\n Label.parseOptions(this.options.font, options);\n for (let edgeId in this.body.edges) {\n if (this.body.edges.hasOwnProperty(edgeId)) {\n this.body.edges[edgeId].updateLabelModule();\n }\n }\n }\n\n // update the state of the variables if needed\n if (options.hidden !== undefined || options.physics !== undefined || dataChanged === true) {\n this.body.emitter.emit('_dataChanged');\n }\n }\n }\n\n\n /**\n * Load edges by reading the data table\n * @param {Array | DataSet | DataView} edges The data containing the edges.\n * @private\n * @private\n */\n setData(edges, doNotEmit = false) {\n var oldEdgesData = this.body.data.edges;\n\n if (edges instanceof DataSet || edges instanceof DataView) {\n this.body.data.edges = edges;\n }\n else if (Array.isArray(edges)) {\n this.body.data.edges = new DataSet();\n this.body.data.edges.add(edges);\n }\n else if (!edges) {\n this.body.data.edges = new DataSet();\n }\n else {\n throw new TypeError('Array or DataSet expected');\n }\n\n // TODO: is this null or undefined or false?\n if (oldEdgesData) {\n // unsubscribe from old dataset\n util.forEach(this.edgesListeners, (callback, event) => {oldEdgesData.off(event, callback);});\n }\n\n // remove drawn edges\n this.body.edges = {};\n\n // TODO: is this null or undefined or false?\n if (this.body.data.edges) {\n // subscribe to new dataset\n util.forEach(this.edgesListeners, (callback, event) => {this.body.data.edges.on(event, callback);});\n\n // draw all new nodes\n var ids = this.body.data.edges.getIds();\n this.add(ids, true);\n }\n\n if (doNotEmit === false) {\n this.body.emitter.emit(\"_dataChanged\");\n }\n }\n\n\n /**\n * Add edges\n * @param {Number[] | String[]} ids\n * @private\n */\n add(ids, doNotEmit = false) {\n var edges = this.body.edges;\n var edgesData = this.body.data.edges;\n\n for (let i = 0; i < ids.length; i++) {\n var id = ids[i];\n\n var oldEdge = edges[id];\n if (oldEdge) {\n oldEdge.disconnect();\n }\n\n var data = edgesData.get(id, {\"showInternalIds\" : true});\n edges[id] = this.create(data);\n }\n\n if (doNotEmit === false) {\n this.body.emitter.emit(\"_dataChanged\");\n }\n }\n\n\n\n /**\n * Update existing edges, or create them when not yet existing\n * @param {Number[] | String[]} ids\n * @private\n */\n update(ids) {\n var edges = this.body.edges;\n var edgesData = this.body.data.edges;\n var dataChanged = false;\n for (var i = 0; i < ids.length; i++) {\n var id = ids[i];\n var data = edgesData.get(id);\n var edge = edges[id];\n if (edge !== undefined) {\n // update edge\n edge.disconnect();\n dataChanged = edge.setOptions(data) || dataChanged; // if a support node is added, data can be changed.\n edge.connect();\n }\n else {\n // create edge\n this.body.edges[id] = this.create(data);\n dataChanged = true;\n }\n }\n\n if (dataChanged === true) {\n this.body.emitter.emit(\"_dataChanged\");\n }\n else {\n this.body.emitter.emit(\"_dataUpdated\");\n }\n }\n\n\n\n /**\n * Remove existing edges. Non existing ids will be ignored\n * @param {Number[] | String[]} ids\n * @private\n */\n remove(ids) {\n var edges = this.body.edges;\n for (var i = 0; i < ids.length; i++) {\n var id = ids[i];\n var edge = edges[id];\n if (edge !== undefined) {\n edge.cleanup();\n edge.disconnect();\n delete edges[id];\n }\n }\n\n this.body.emitter.emit(\"_dataChanged\");\n }\n\n refresh() {\n let edges = this.body.edges;\n for (let edgeId in edges) {\n let edge = undefined;\n if (edges.hasOwnProperty(edgeId)) {\n edge = edges[edgeId];\n }\n let data = this.body.data.edges._data[edgeId];\n if (edge !== undefined && data !== undefined) {\n edge.setOptions(data);\n }\n }\n }\n\n create(properties) {\n return new Edge(properties, this.body, this.options, this.defaultOptions, this.edgeOptions)\n }\n\n /**\n * Reconnect all edges\n * @private\n */\n reconnectEdges() {\n var id;\n var nodes = this.body.nodes;\n var edges = this.body.edges;\n\n for (id in nodes) {\n if (nodes.hasOwnProperty(id)) {\n nodes[id].edges = [];\n }\n }\n\n for (id in edges) {\n if (edges.hasOwnProperty(id)) {\n var edge = edges[id];\n edge.from = null;\n edge.to = null;\n edge.connect();\n }\n }\n }\n\n\n getConnectedNodes(edgeId) {\n let nodeList = [];\n if (this.body.edges[edgeId] !== undefined) {\n let edge = this.body.edges[edgeId];\n if (edge.fromId) {nodeList.push(edge.fromId);}\n if (edge.toId) {nodeList.push(edge.toId);}\n }\n return nodeList;\n }\n\n}\n\nexport default EdgesHandler;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/EdgesHandler.js","var util = require('../../../util');\n\nimport Label from './shared/Label'\nimport CubicBezierEdge from './edges/CubicBezierEdge'\nimport BezierEdgeDynamic from './edges/BezierEdgeDynamic'\nimport BezierEdgeStatic from './edges/BezierEdgeStatic'\nimport StraightEdge from './edges/StraightEdge'\n\n/**\n * @class Edge\n *\n * A edge connects two nodes\n * @param {Object} properties Object with options. Must contain\n * At least options from and to.\n * Available options: from (number),\n * to (number), label (string, color (string),\n * width (number), style (string),\n * length (number), title (string)\n * @param {Network} network A Network object, used to find and edge to\n * nodes.\n * @param {Object} constants An object with default values for\n * example for the color\n */\nclass Edge {\n constructor(options, body, globalOptions, defaultOptions, edgeOptions) {\n if (body === undefined) {\n throw \"No body provided\";\n }\n this.options = util.bridgeObject(globalOptions);\n this.globalOptions = globalOptions;\n this.defaultOptions = defaultOptions;\n this.edgeOptions = edgeOptions;\n this.body = body;\n\n // initialize variables\n this.id = undefined;\n this.fromId = undefined;\n this.toId = undefined;\n this.selected = false;\n this.hover = false;\n this.labelDirty = true;\n\n this.baseWidth = this.options.width;\n this.baseFontSize = this.options.font.size;\n\n this.from = undefined; // a node\n this.to = undefined; // a node\n\n this.edgeType = undefined;\n\n this.connected = false;\n\n this.labelModule = new Label(this.body, this.options, true /* It's an edge label */);\n this.setOptions(options);\n }\n\n\n /**\n * Set or overwrite options for the edge\n * @param {Object} options an object with options\n * @param doNotEmit\n */\n setOptions(options) {\n if (!options) {\n return;\n }\n\n Edge.parseOptions(this.options, options, true, this.globalOptions);\n\n if (options.id !== undefined) {\n this.id = options.id;\n }\n if (options.from !== undefined) {\n this.fromId = options.from;\n }\n if (options.to !== undefined) {\n this.toId = options.to;\n }\n if (options.title !== undefined) {\n this.title = options.title;\n }\n if (options.value !== undefined) {\n options.value = parseFloat(options.value);\n }\n\n this.choosify(options);\n\n // update label Module\n this.updateLabelModule(options);\n this.labelModule.propagateFonts(this.edgeOptions, options, this.defaultOptions);\n\n let dataChanged = this.updateEdgeType();\n\n // if anything has been updates, reset the selection width and the hover width\n this._setInteractionWidths();\n\n // A node is connected when it has a from and to node that both exist in the network.body.nodes.\n this.connect();\n\n if (options.hidden !== undefined || options.physics !== undefined) {\n dataChanged = true;\n }\n\n return dataChanged;\n }\n\n static parseOptions(parentOptions, newOptions, allowDeletion = false, globalOptions = {}) {\n var fields = [\n 'arrowStrikethrough',\n 'id',\n 'from',\n 'hidden',\n 'hoverWidth',\n 'label',\n 'labelHighlightBold',\n 'length',\n 'line',\n 'opacity',\n 'physics',\n 'scaling',\n 'selectionWidth',\n 'selfReferenceSize',\n 'to',\n 'title',\n 'value',\n 'width'\n ];\n\n // only deep extend the items in the field array. These do not have shorthand.\n util.selectiveDeepExtend(fields, parentOptions, newOptions, allowDeletion);\n\n util.mergeOptions(parentOptions, newOptions, 'smooth', allowDeletion, globalOptions);\n util.mergeOptions(parentOptions, newOptions, 'shadow', allowDeletion, globalOptions);\n\n if (newOptions.dashes !== undefined && newOptions.dashes !== null) {\n parentOptions.dashes = newOptions.dashes;\n }\n else if (allowDeletion === true && newOptions.dashes === null) {\n parentOptions.dashes = Object.create(globalOptions.dashes); // this sets the pointer of the option back to the global option.\n }\n\n // set the scaling newOptions\n if (newOptions.scaling !== undefined && newOptions.scaling !== null) {\n if (newOptions.scaling.min !== undefined) {parentOptions.scaling.min = newOptions.scaling.min;}\n if (newOptions.scaling.max !== undefined) {parentOptions.scaling.max = newOptions.scaling.max;}\n util.mergeOptions(parentOptions.scaling, newOptions.scaling, 'label', allowDeletion, globalOptions.scaling);\n }\n else if (allowDeletion === true && newOptions.scaling === null) {\n parentOptions.scaling = Object.create(globalOptions.scaling); // this sets the pointer of the option back to the global option.\n }\n\n // handle multiple input cases for arrows\n if (newOptions.arrows !== undefined && newOptions.arrows !== null) {\n if (typeof newOptions.arrows === 'string') {\n let arrows = newOptions.arrows.toLowerCase();\n parentOptions.arrows.to.enabled = arrows.indexOf(\"to\") != -1;\n parentOptions.arrows.middle.enabled = arrows.indexOf(\"middle\") != -1;\n parentOptions.arrows.from.enabled = arrows.indexOf(\"from\") != -1;\n }\n else if (typeof newOptions.arrows === 'object') {\n util.mergeOptions(parentOptions.arrows, newOptions.arrows, 'to', allowDeletion, globalOptions.arrows);\n util.mergeOptions(parentOptions.arrows, newOptions.arrows, 'middle', allowDeletion, globalOptions.arrows);\n util.mergeOptions(parentOptions.arrows, newOptions.arrows, 'from', allowDeletion, globalOptions.arrows);\n }\n else {\n throw new Error(\"The arrow newOptions can only be an object or a string. Refer to the documentation. You used:\" + JSON.stringify(newOptions.arrows));\n }\n }\n else if (allowDeletion === true && newOptions.arrows === null) {\n parentOptions.arrows = Object.create(globalOptions.arrows); // this sets the pointer of the option back to the global option.\n }\n\n // handle multiple input cases for color\n if (newOptions.color !== undefined && newOptions.color !== null) {\n // make a copy of the parent object in case this is referring to the global one (due to object create once, then update)\n parentOptions.color = util.deepExtend({}, parentOptions.color, true);\n if (util.isString(newOptions.color)) {\n parentOptions.color.color = newOptions.color;\n parentOptions.color.highlight = newOptions.color;\n parentOptions.color.hover = newOptions.color;\n parentOptions.color.inherit = false;\n }\n else {\n let colorsDefined = false;\n if (newOptions.color.color !== undefined) {parentOptions.color.color = newOptions.color.color; colorsDefined = true;}\n if (newOptions.color.highlight !== undefined) {parentOptions.color.highlight = newOptions.color.highlight; colorsDefined = true;}\n if (newOptions.color.hover !== undefined) {parentOptions.color.hover = newOptions.color.hover; colorsDefined = true;}\n if (newOptions.color.inherit !== undefined) {parentOptions.color.inherit = newOptions.color.inherit;}\n if (newOptions.color.opacity !== undefined) {parentOptions.color.opacity = Math.min(1,Math.max(0,newOptions.color.opacity));}\n\n if (newOptions.color.inherit === undefined && colorsDefined === true) {\n parentOptions.color.inherit = false;\n }\n }\n }\n else if (allowDeletion === true && newOptions.color === null) {\n parentOptions.color = util.bridgeObject(globalOptions.color); // set the object back to the global options\n }\n\n // handle the font settings\n if (newOptions.font !== undefined && newOptions.font !== null) {\n Label.parseOptions(parentOptions.font, newOptions);\n }\n else if (allowDeletion === true && newOptions.font === null) {\n parentOptions.font = util.bridgeObject(globalOptions.font); // set the object back to the global options\n }\n }\n\n choosify(options) {\n this.chooser = true;\n\n let pile = [options, this.options, this.defaultOptions];\n\n let chosen = util.topMost(pile, 'chosen');\n if (typeof chosen === 'boolean') {\n this.chooser = chosen;\n } else if (typeof chosen === 'object') {\n let chosenEdge = util.topMost(pile, ['chosen', 'edge']);\n if ((typeof chosenEdge === 'boolean') || (typeof chosenEdge === 'function')) {\n this.chooser = chosenEdge;\n }\n }\n }\n\n getFormattingValues() {\n let toArrow = (this.options.arrows.to === true) || (this.options.arrows.to.enabled === true)\n let fromArrow = (this.options.arrows.from === true) || (this.options.arrows.from.enabled === true)\n let middleArrow = (this.options.arrows.middle === true) || (this.options.arrows.middle.enabled === true)\n let inheritsColor = this.options.color.inherit;\n let values = {\n toArrow: toArrow,\n toArrowScale: this.options.arrows.to.scaleFactor,\n toArrowType: this.options.arrows.to.type,\n middleArrow: middleArrow,\n middleArrowScale: this.options.arrows.middle.scaleFactor,\n middleArrowType: this.options.arrows.middle.type,\n fromArrow: fromArrow,\n fromArrowScale: this.options.arrows.from.scaleFactor,\n fromArrowType: this.options.arrows.from.type,\n arrowStrikethrough: this.options.arrowStrikethrough,\n color: (inheritsColor? undefined : this.options.color.color),\n inheritsColor: inheritsColor,\n opacity: this.options.color.opacity,\n hidden: this.options.hidden,\n length: this.options.length,\n shadow: this.options.shadow.enabled,\n shadowColor: this.options.shadow.color,\n shadowSize: this.options.shadow.size,\n shadowX: this.options.shadow.x,\n shadowY: this.options.shadow.y,\n dashes: this.options.dashes,\n width: this.options.width\n };\n if (this.selected || this.hover) {\n if (this.chooser === true) {\n if (this.selected) {\n let selectedWidth = this.options.selectionWidth;\n if (typeof selectedWidth === 'function') {\n values.width = selectedWidth(values.width);\n } else if (typeof selectedWidth === 'number') {\n values.width += selectedWidth;\n }\n values.width = Math.max(values.width, 0.3 / this.body.view.scale);\n values.color = this.options.color.highlight;\n values.shadow = this.options.shadow.enabled;\n } else if (this.hover) {\n let hoverWidth = this.options.hoverWidth;\n if (typeof hoverWidth === 'function') {\n values.width = hoverWidth(values.width);\n } else if (typeof hoverWidth === 'number') {\n values.width += hoverWidth;\n }\n values.width = Math.max(values.width, 0.3 / this.body.view.scale);\n values.color = this.options.color.hover;\n values.shadow = this.options.shadow.enabled;\n }\n } else if (typeof this.chooser === 'function') {\n this.chooser(values, this.options.id, this.selected, this.hover);\n if (values.color !== undefined) {\n values.inheritsColor = false;\n }\n if (values.shadow === false) {\n if ((values.shadowColor !== this.options.shadow.color) ||\n (values.shadowSize !== this.options.shadow.size) ||\n (values.shadowX !== this.options.shadow.x) ||\n (values.shadowY !== this.options.shadow.y)) {\n values.shadow = true;\n }\n }\n }\n } else {\n values.shadow = this.options.shadow.enabled;\n values.width = Math.max(values.width, 0.3 / this.body.view.scale);\n }\n return values;\n }\n\n /**\n * update the options in the label module\n */\n updateLabelModule(options) {\n this.labelModule.setOptions(this.options, true);\n if (this.labelModule.baseSize !== undefined) {\n this.baseFontSize = this.labelModule.baseSize;\n }\n this.labelModule.constrain(this.edgeOptions, options, this.defaultOptions);\n this.labelModule.choosify(this.edgeOptions, options, this.defaultOptions);\n }\n\n /**\n * update the edge type, set the options\n * @returns {boolean}\n */\n updateEdgeType() {\n let smooth = this.options.smooth;\n let dataChanged = false;\n let changeInType = true;\n if (this.edgeType !== undefined) {\n if ((((this.edgeType instanceof BezierEdgeDynamic) &&\n (smooth.enabled === true) &&\n (smooth.type === 'dynamic'))) ||\n (((this.edgeType instanceof CubicBezierEdge) &&\n (smooth.enabled === true) &&\n (smooth.type === 'cubicBezier'))) ||\n (((this.edgeType instanceof BezierEdgeStatic) &&\n (smooth.enabled === true) &&\n (smooth.type !== 'dynamic') &&\n (smooth.type !== 'cubicBezier'))) ||\n (((this.edgeType instanceof StraightEdge) &&\n (smooth.type.enabled === false)))) {\n changeInType = false;\n }\n if (changeInType === true) {\n dataChanged = this.cleanup();\n }\n }\n if (changeInType === true) {\n if (smooth.enabled === true) {\n if (smooth.type === 'dynamic') {\n dataChanged = true;\n this.edgeType = new BezierEdgeDynamic(this.options, this.body, this.labelModule);\n } else if (smooth.type === 'cubicBezier') {\n this.edgeType = new CubicBezierEdge(this.options, this.body, this.labelModule);\n } else {\n this.edgeType = new BezierEdgeStatic(this.options, this.body, this.labelModule);\n }\n } else {\n this.edgeType = new StraightEdge(this.options, this.body, this.labelModule);\n }\n } else { // if nothing changes, we just set the options.\n this.edgeType.setOptions(this.options);\n }\n return dataChanged;\n }\n\n /**\n * Connect an edge to its nodes\n */\n connect() {\n this.disconnect();\n\n this.from = this.body.nodes[this.fromId] || undefined;\n this.to = this.body.nodes[this.toId] || undefined;\n this.connected = (this.from !== undefined && this.to !== undefined);\n\n if (this.connected === true) {\n this.from.attachEdge(this);\n this.to.attachEdge(this);\n }\n else {\n if (this.from) {\n this.from.detachEdge(this);\n }\n if (this.to) {\n this.to.detachEdge(this);\n }\n }\n\n this.edgeType.connect();\n }\n\n\n /**\n * Disconnect an edge from its nodes\n */\n disconnect() {\n if (this.from) {\n this.from.detachEdge(this);\n this.from = undefined;\n }\n if (this.to) {\n this.to.detachEdge(this);\n this.to = undefined;\n }\n\n this.connected = false;\n }\n\n\n /**\n * get the title of this edge.\n * @return {string} title The title of the edge, or undefined when no title\n * has been set.\n */\n getTitle() {\n return this.title;\n }\n\n\n /**\n * check if this node is selecte\n * @return {boolean} selected True if node is selected, else false\n */\n isSelected() {\n return this.selected;\n }\n\n\n\n /**\n * Retrieve the value of the edge. Can be undefined\n * @return {Number} value\n */\n getValue() {\n return this.options.value;\n }\n\n\n /**\n * Adjust the value range of the edge. The edge will adjust it's width\n * based on its value.\n * @param {Number} min\n * @param {Number} max\n * @param total\n */\n setValueRange(min, max, total) {\n if (this.options.value !== undefined) {\n var scale = this.options.scaling.customScalingFunction(min, max, total, this.options.value);\n var widthDiff = this.options.scaling.max - this.options.scaling.min;\n if (this.options.scaling.label.enabled === true) {\n var fontDiff = this.options.scaling.label.max - this.options.scaling.label.min;\n this.options.font.size = this.options.scaling.label.min + scale * fontDiff;\n }\n this.options.width = this.options.scaling.min + scale * widthDiff;\n }\n else {\n this.options.width = this.baseWidth;\n this.options.font.size = this.baseFontSize;\n }\n\n this._setInteractionWidths();\n this.updateLabelModule();\n }\n\n _setInteractionWidths() {\n if (typeof this.options.hoverWidth === 'function') {\n this.edgeType.hoverWidth = this.options.hoverWidth(this.options.width);\n } else {\n this.edgeType.hoverWidth = this.options.hoverWidth + this.options.width;\n }\n if (typeof this.options.selectionWidth === 'function') {\n this.edgeType.selectionWidth = this.options.selectionWidth(this.options.width);\n } else {\n this.edgeType.selectionWidth = this.options.selectionWidth + this.options.width;\n }\n }\n\n\n /**\n * Redraw a edge\n * Draw this edge in the given canvas\n * The 2d context of a HTML canvas can be retrieved by canvas.getContext(\"2d\");\n * @param {CanvasRenderingContext2D} ctx\n */\n draw(ctx) {\n let values = this.getFormattingValues();\n if (values.hidden) {\n return;\n }\n\n // get the via node from the edge type\n let viaNode = this.edgeType.getViaNode();\n let arrowData = {};\n\n // restore edge targets to defaults\n this.edgeType.fromPoint = this.edgeType.from;\n this.edgeType.toPoint = this.edgeType.to;\n\n // from and to arrows give a different end point for edges. we set them here\n if (values.fromArrow) {\n arrowData.from = this.edgeType.getArrowData(ctx, 'from', viaNode, this.selected, this.hover, values);\n if (values.arrowStrikethrough === false)\n this.edgeType.fromPoint = arrowData.from.core;\n }\n if (values.toArrow) {\n arrowData.to = this.edgeType.getArrowData(ctx, 'to', viaNode, this.selected, this.hover, values);\n if (values.arrowStrikethrough === false)\n this.edgeType.toPoint = arrowData.to.core;\n }\n\n // the middle arrow depends on the line, which can depend on the to and from arrows so we do this one lastly.\n if (values.middleArrow) {\n arrowData.middle = this.edgeType.getArrowData(ctx,'middle', viaNode, this.selected, this.hover, values);\n }\n\n // draw everything\n this.edgeType.drawLine(ctx, values, this.selected, this.hover, viaNode);\n this.drawArrows(ctx, arrowData, values);\n this.drawLabel (ctx, viaNode);\n }\n\n\n drawArrows(ctx, arrowData, values) {\n if (values.fromArrow) {\n this.edgeType.drawArrowHead(ctx, values, this.selected, this.hover, arrowData.from);\n }\n if (values.middleArrow) {\n this.edgeType.drawArrowHead(ctx, values, this.selected, this.hover, arrowData.middle);\n }\n if (values.toArrow) {\n this.edgeType.drawArrowHead(ctx, values, this.selected, this.hover, arrowData.to);\n }\n }\n\n\n drawLabel(ctx, viaNode) {\n if (this.options.label !== undefined) {\n // set style\n var node1 = this.from;\n var node2 = this.to;\n var selected = (this.from.selected || this.to.selected || this.selected);\n if (node1.id != node2.id) {\n this.labelModule.pointToSelf = false;\n var point = this.edgeType.getPoint(0.5, viaNode);\n ctx.save();\n\n // if the label has to be rotated:\n if (this.options.font.align !== \"horizontal\") {\n this.labelModule.calculateLabelSize(ctx, selected, this.hover, point.x, point.y);\n ctx.translate(point.x, this.labelModule.size.yLine);\n this._rotateForLabelAlignment(ctx);\n }\n\n // draw the label\n this.labelModule.draw(ctx, point.x, point.y, selected, this.hover);\n ctx.restore();\n }\n else {\n // Ignore the orientations.\n this.labelModule.pointToSelf = true;\n var x, y;\n var radius = this.options.selfReferenceSize;\n if (node1.shape.width > node1.shape.height) {\n x = node1.x + node1.shape.width * 0.5;\n y = node1.y - radius;\n }\n else {\n x = node1.x + radius;\n y = node1.y - node1.shape.height * 0.5;\n }\n point = this._pointOnCircle(x, y, radius, 0.125);\n this.labelModule.draw(ctx, point.x, point.y, selected, this.hover);\n }\n }\n }\n\n\n /**\n * Check if this object is overlapping with the provided object\n * @param {Object} obj an object with parameters left, top\n * @return {boolean} True if location is located on the edge\n */\n isOverlappingWith(obj) {\n if (this.connected) {\n var distMax = 10;\n var xFrom = this.from.x;\n var yFrom = this.from.y;\n var xTo = this.to.x;\n var yTo = this.to.y;\n var xObj = obj.left;\n var yObj = obj.top;\n\n var dist = this.edgeType.getDistanceToEdge(xFrom, yFrom, xTo, yTo, xObj, yObj);\n\n return (dist < distMax);\n }\n else {\n return false\n }\n }\n\n\n /**\n * Rotates the canvas so the text is most readable\n * @param {CanvasRenderingContext2D} ctx\n * @private\n */\n _rotateForLabelAlignment(ctx) {\n var dy = this.from.y - this.to.y;\n var dx = this.from.x - this.to.x;\n var angleInDegrees = Math.atan2(dy, dx);\n\n // rotate so label it is readable\n if ((angleInDegrees < -1 && dx < 0) || (angleInDegrees > 0 && dx < 0)) {\n angleInDegrees = angleInDegrees + Math.PI;\n }\n\n ctx.rotate(angleInDegrees);\n }\n\n\n /**\n * Get a point on a circle\n * @param {Number} x\n * @param {Number} y\n * @param {Number} radius\n * @param {Number} percentage. Value between 0 (line start) and 1 (line end)\n * @return {Object} point\n * @private\n */\n _pointOnCircle(x, y, radius, percentage) {\n var angle = percentage * 2 * Math.PI;\n return {\n x: x + radius * Math.cos(angle),\n y: y - radius * Math.sin(angle)\n }\n }\n\n\n select() {\n this.selected = true;\n }\n\n\n unselect() {\n this.selected = false;\n }\n\n\n /**\n * cleans all required things on delete\n * @returns {*}\n */\n cleanup() {\n return this.edgeType.cleanup();\n }\n}\n\nexport default Edge;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/Edge.js","import CubicBezierEdgeBase from './util/CubicBezierEdgeBase'\n\nclass CubicBezierEdge extends CubicBezierEdgeBase {\n constructor(options, body, labelModule) {\n super(options, body, labelModule);\n }\n\n /**\n * Draw a line between two nodes\n * @param {CanvasRenderingContext2D} ctx\n * @private\n */\n _line(ctx, values, viaNodes) {\n // get the coordinates of the support points.\n let via1 = viaNodes[0];\n let via2 = viaNodes[1];\n\n // start drawing the line.\n ctx.beginPath();\n ctx.moveTo(this.fromPoint.x, this.fromPoint.y);\n\n // fallback to normal straight edges\n if (viaNodes === undefined || via1.x === undefined) {\n ctx.lineTo(this.toPoint.x, this.toPoint.y);\n }\n else {\n ctx.bezierCurveTo(via1.x, via1.y, via2.x, via2.y, this.toPoint.x, this.toPoint.y);\n }\n // draw shadow if enabled\n this.enableShadow(ctx, values);\n ctx.stroke();\n this.disableShadow(ctx, values);\n }\n\n _getViaCoordinates() {\n let dx = this.from.x - this.to.x;\n let dy = this.from.y - this.to.y;\n\n let x1, y1, x2, y2;\n let roundness = this.options.smooth.roundness;\n\n // horizontal if x > y or if direction is forced or if direction is horizontal\n if ((Math.abs(dx) > Math.abs(dy) || this.options.smooth.forceDirection === true || this.options.smooth.forceDirection === 'horizontal') && this.options.smooth.forceDirection !== 'vertical') {\n y1 = this.from.y;\n y2 = this.to.y;\n x1 = this.from.x - roundness * dx;\n x2 = this.to.x + roundness * dx;\n }\n else {\n y1 = this.from.y - roundness * dy;\n y2 = this.to.y + roundness * dy;\n x1 = this.from.x;\n x2 = this.to.x;\n }\n\n return [{x: x1, y: y1},{x: x2, y: y2}];\n }\n\n getViaNode() {\n return this._getViaCoordinates();\n }\n\n _findBorderPosition(nearNode, ctx) {\n return this._findBorderPositionBezier(nearNode, ctx);\n }\n\n _getDistanceToEdge(x1, y1, x2, y2, x3, y3, [via1, via2] = this._getViaCoordinates()) { // x3,y3 is the point\n return this._getDistanceToBezierEdge(x1, y1, x2, y2, x3, y3, via1, via2);\n }\n\n /**\n * Combined function of pointOnLine and pointOnBezier. This gives the coordinates of a point on the line at a certain percentage of the way\n * @param percentage\n * @param via\n * @returns {{x: number, y: number}}\n * @private\n */\n getPoint(percentage, [via1, via2] = this._getViaCoordinates()) {\n let t = percentage;\n let vec = [];\n vec[0] = Math.pow(1 - t, 3);\n vec[1] = 3 * t * Math.pow(1 - t, 2);\n vec[2] = 3 * Math.pow(t,2) * (1 - t);\n vec[3] = Math.pow(t, 3);\n let x = vec[0] * this.fromPoint.x + vec[1] * via1.x + vec[2] * via2.x + vec[3] * this.toPoint.x;\n let y = vec[0] * this.fromPoint.y + vec[1] * via1.y + vec[2] * via2.y + vec[3] * this.toPoint.y;\n\n return {x: x, y: y};\n }\n}\n\n\nexport default CubicBezierEdge;\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/edges/CubicBezierEdge.js","import BezierEdgeBase from './BezierEdgeBase'\n\nclass CubicBezierEdgeBase extends BezierEdgeBase {\n constructor(options, body, labelModule) {\n super(options, body, labelModule);\n }\n\n /**\n * Calculate the distance between a point (x3,y3) and a line segment from\n * (x1,y1) to (x2,y2).\n * http://stackoverflow.com/questions/849211/shortest-distancae-between-a-point-and-a-line-segment\n * https://en.wikipedia.org/wiki/B%C3%A9zier_curve\n * @param {number} x1 from x\n * @param {number} y1 from y\n * @param {number} x2 to x\n * @param {number} y2 to y\n * @param {number} x3 point to check x\n * @param {number} y3 point to check y\n * @private\n */\n _getDistanceToBezierEdge(x1, y1, x2, y2, x3, y3, via1, via2) { // x3,y3 is the point\n let minDistance = 1e9;\n let distance;\n let i, t, x, y;\n let lastX = x1;\n let lastY = y1;\n let vec = [0,0,0,0]\n for (i = 1; i < 10; i++) {\n t = 0.1 * i;\n vec[0] = Math.pow(1 - t, 3);\n vec[1] = 3 * t * Math.pow(1 - t, 2);\n vec[2] = 3 * Math.pow(t,2) * (1 - t);\n vec[3] = Math.pow(t, 3);\n x = vec[0] * x1 + vec[1] * via1.x + vec[2] * via2.x + vec[3] * x2;\n y = vec[0] * y1 + vec[1] * via1.y + vec[2] * via2.y + vec[3] * y2;\n if (i > 0) {\n distance = this._getDistanceToLine(lastX, lastY, x, y, x3, y3);\n minDistance = distance < minDistance ? distance : minDistance;\n }\n lastX = x;\n lastY = y;\n }\n\n return minDistance;\n }\n}\n\nexport default CubicBezierEdgeBase;\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/edges/util/CubicBezierEdgeBase.js","import EdgeBase from './EdgeBase'\n\nclass BezierEdgeBase extends EdgeBase {\n constructor(options, body, labelModule) {\n super(options, body, labelModule);\n }\n\n /**\n * This function uses binary search to look for the point where the bezier curve crosses the border of the node.\n *\n * @param nearNode\n * @param ctx\n * @param viaNode\n * @param nearNode\n * @param ctx\n * @param viaNode\n * @param nearNode\n * @param ctx\n * @param viaNode\n */\n _findBorderPositionBezier(nearNode, ctx, viaNode = this._getViaCoordinates()) {\n var maxIterations = 10;\n var iteration = 0;\n var low = 0;\n var high = 1;\n var pos, angle, distanceToBorder, distanceToPoint, difference;\n var threshold = 0.2;\n var node = this.to;\n var from = false;\n if (nearNode.id === this.from.id) {\n node = this.from;\n from = true;\n }\n\n while (low <= high && iteration < maxIterations) {\n var middle = (low + high) * 0.5;\n\n pos = this.getPoint(middle, viaNode);\n angle = Math.atan2((node.y - pos.y), (node.x - pos.x));\n distanceToBorder = node.distanceToBorder(ctx, angle);\n distanceToPoint = Math.sqrt(Math.pow(pos.x - node.x, 2) + Math.pow(pos.y - node.y, 2));\n difference = distanceToBorder - distanceToPoint;\n if (Math.abs(difference) < threshold) {\n break; // found\n }\n else if (difference < 0) { // distance to nodes is larger than distance to border --> t needs to be bigger if we're looking at the to node.\n if (from === false) {\n low = middle;\n }\n else {\n high = middle;\n }\n }\n else {\n if (from === false) {\n high = middle;\n }\n else {\n low = middle;\n }\n }\n\n iteration++;\n }\n pos.t = middle;\n\n return pos;\n }\n\n\n\n /**\n * Calculate the distance between a point (x3,y3) and a line segment from\n * (x1,y1) to (x2,y2).\n * http://stackoverflow.com/questions/849211/shortest-distancae-between-a-point-and-a-line-segment\n * @param {number} x1 from x\n * @param {number} y1 from y\n * @param {number} x2 to x\n * @param {number} y2 to y\n * @param {number} x3 point to check x\n * @param {number} y3 point to check y\n * @private\n */\n _getDistanceToBezierEdge(x1, y1, x2, y2, x3, y3, via) { // x3,y3 is the point\n let minDistance = 1e9;\n let distance;\n let i, t, x, y;\n let lastX = x1;\n let lastY = y1;\n for (i = 1; i < 10; i++) {\n t = 0.1 * i;\n x = Math.pow(1 - t, 2) * x1 + (2 * t * (1 - t)) * via.x + Math.pow(t, 2) * x2;\n y = Math.pow(1 - t, 2) * y1 + (2 * t * (1 - t)) * via.y + Math.pow(t, 2) * y2;\n if (i > 0) {\n distance = this._getDistanceToLine(lastX, lastY, x, y, x3, y3);\n minDistance = distance < minDistance ? distance : minDistance;\n }\n lastX = x;\n lastY = y;\n }\n\n return minDistance;\n }\n}\n\nexport default BezierEdgeBase;\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/edges/util/BezierEdgeBase.js","let util = require(\"../../../../../util\");\n\nclass EdgeBase {\n constructor(options, body, labelModule) {\n this.body = body;\n this.labelModule = labelModule;\n this.options = {};\n this.setOptions(options);\n this.colorDirty = true;\n this.color = {};\n this.selectionWidth = 2;\n this.hoverWidth = 1.5;\n this.fromPoint = this.from;\n this.toPoint = this.to;\n }\n\n connect() {\n this.from = this.body.nodes[this.options.from];\n this.to = this.body.nodes[this.options.to];\n }\n\n cleanup() {\n return false;\n }\n\n setOptions(options) {\n this.options = options;\n this.from = this.body.nodes[this.options.from];\n this.to = this.body.nodes[this.options.to];\n this.id = this.options.id;\n }\n\n /**\n * Redraw a edge as a line\n * Draw this edge in the given canvas\n * The 2d context of a HTML canvas can be retrieved by canvas.getContext(\"2d\");\n * @param {CanvasRenderingContext2D} ctx\n * @private\n */\n drawLine(ctx, values, selected, hover, viaNode) {\n // set style\n ctx.strokeStyle = this.getColor(ctx, values, selected, hover);\n ctx.lineWidth = values.width;\n\n if (values.dashes !== false) {\n this._drawDashedLine(ctx, values, viaNode);\n }\n else {\n this._drawLine(ctx, values, viaNode);\n }\n }\n\n\n _drawLine(ctx, values, viaNode, fromPoint, toPoint) {\n if (this.from != this.to) {\n // draw line\n this._line(ctx, values, viaNode, fromPoint, toPoint);\n }\n else {\n let [x,y,radius] = this._getCircleData(ctx, values);\n this._circle(ctx, values, x, y, radius);\n }\n }\n\n _drawDashedLine(ctx, values, viaNode, fromPoint, toPoint) {\n ctx.lineCap = 'round';\n let pattern = [5,5];\n if (Array.isArray(values.dashes) === true) {\n pattern = values.dashes;\n }\n\n // only firefox and chrome support this method, else we use the legacy one.\n if (ctx.setLineDash !== undefined) {\n ctx.save();\n\n // set dash settings for chrome or firefox\n ctx.setLineDash(pattern);\n ctx.lineDashOffset = 0;\n\n // draw the line\n if (this.from != this.to) {\n // draw line\n this._line(ctx, values, viaNode);\n }\n else {\n let [x,y,radius] = this._getCircleData(ctx, values);\n this._circle(ctx, values, x, y, radius);\n }\n\n // restore the dash settings.\n ctx.setLineDash([0]);\n ctx.lineDashOffset = 0;\n ctx.restore();\n }\n else { // unsupporting smooth lines\n if (this.from != this.to) {\n // draw line\n ctx.dashedLine(this.from.x, this.from.y, this.to.x, this.to.y, pattern);\n }\n else {\n let [x,y,radius] = this._getCircleData(ctx, values);\n this._circle(ctx, values, x, y, radius);\n }\n // draw shadow if enabled\n this.enableShadow(ctx, values);\n\n ctx.stroke();\n\n // disable shadows for other elements.\n this.disableShadow(ctx, values);\n }\n }\n\n\n findBorderPosition(nearNode, ctx, options) {\n if (this.from != this.to) {\n return this._findBorderPosition(nearNode, ctx, options);\n }\n else {\n return this._findBorderPositionCircle(nearNode, ctx, options);\n }\n }\n\n findBorderPositions(ctx) {\n let from = {};\n let to = {};\n if (this.from != this.to) {\n from = this._findBorderPosition(this.from, ctx);\n to = this._findBorderPosition(this.to, ctx);\n }\n else {\n let [x,y,radius] = this._getCircleData(ctx);\n\n from = this._findBorderPositionCircle(this.from, ctx, {x, y, low:0.25, high:0.6, direction:-1});\n to = this._findBorderPositionCircle(this.from, ctx, {x, y, low:0.6, high:0.8, direction:1});\n }\n return {from, to};\n }\n\n _getCircleData(ctx) {\n let x, y;\n let node = this.from;\n let radius = this.options.selfReferenceSize;\n\n if (ctx !== undefined) {\n if (node.shape.width === undefined) {\n node.shape.resize(ctx);\n }\n }\n\n // get circle coordinates\n if (node.shape.width > node.shape.height) {\n x = node.x + node.shape.width * 0.5;\n y = node.y - radius;\n }\n else {\n x = node.x + radius;\n y = node.y - node.shape.height * 0.5;\n }\n return [x,y,radius];\n }\n\n /**\n * Get a point on a circle\n * @param {Number} x\n * @param {Number} y\n * @param {Number} radius\n * @param {Number} percentage. Value between 0 (line start) and 1 (line end)\n * @return {Object} point\n * @private\n */\n _pointOnCircle(x, y, radius, percentage) {\n let angle = percentage * 2 * Math.PI;\n return {\n x: x + radius * Math.cos(angle),\n y: y - radius * Math.sin(angle)\n }\n }\n\n /**\n * This function uses binary search to look for the point where the circle crosses the border of the node.\n * @param node\n * @param ctx\n * @param options\n * @returns {*}\n * @private\n */\n _findBorderPositionCircle(node, ctx, options) {\n let x = options.x;\n let y = options.y;\n let low = options.low;\n let high = options.high;\n let direction = options.direction;\n\n let maxIterations = 10;\n let iteration = 0;\n let radius = this.options.selfReferenceSize;\n let pos, angle, distanceToBorder, distanceToPoint, difference;\n let threshold = 0.05;\n let middle = (low + high) * 0.5;\n\n while (low <= high && iteration < maxIterations) {\n middle = (low + high) * 0.5;\n\n pos = this._pointOnCircle(x, y, radius, middle);\n angle = Math.atan2((node.y - pos.y), (node.x - pos.x));\n distanceToBorder = node.distanceToBorder(ctx, angle);\n distanceToPoint = Math.sqrt(Math.pow(pos.x - node.x, 2) + Math.pow(pos.y - node.y, 2));\n difference = distanceToBorder - distanceToPoint;\n if (Math.abs(difference) < threshold) {\n break; // found\n }\n else if (difference > 0) { // distance to nodes is larger than distance to border --> t needs to be bigger if we're looking at the to node.\n if (direction > 0) {\n low = middle;\n }\n else {\n high = middle;\n }\n }\n else {\n if (direction > 0) {\n high = middle;\n }\n else {\n low = middle;\n }\n }\n iteration++;\n\n }\n pos.t = middle;\n\n return pos;\n }\n\n /**\n * Get the line width of the edge. Depends on width and whether one of the\n * connected nodes is selected.\n * @return {Number} width\n * @private\n */\n getLineWidth(selected, hover) {\n if (selected === true) {\n return Math.max(this.selectionWidth, 0.3 / this.body.view.scale);\n }\n else {\n if (hover === true) {\n return Math.max(this.hoverWidth, 0.3 / this.body.view.scale);\n }\n else {\n return Math.max(this.options.width, 0.3 / this.body.view.scale);\n }\n }\n }\n\n\n getColor(ctx, values, selected, hover) {\n if (values.inheritsColor !== false) {\n // when this is a loop edge, just use the 'from' method\n if ((values.inheritsColor === 'both') && (this.from.id !== this.to.id)) {\n let grd = ctx.createLinearGradient(this.from.x, this.from.y, this.to.x, this.to.y);\n let fromColor, toColor;\n fromColor = this.from.options.color.highlight.border;\n toColor = this.to.options.color.highlight.border;\n\n if ((this.from.selected === false) && (this.to.selected === false)) {\n fromColor = util.overrideOpacity(this.from.options.color.border, values.opacity);\n toColor = util.overrideOpacity(this.to.options.color.border, values.opacity);\n }\n else if ((this.from.selected === true) && (this.to.selected === false)) {\n toColor = this.to.options.color.border;\n }\n else if ((this.from.selected === false) && (this.to.selected === true)) {\n fromColor = this.from.options.color.border;\n }\n grd.addColorStop(0, fromColor);\n grd.addColorStop(1, toColor);\n\n // -------------------- this returns -------------------- //\n return grd;\n }\n\n if (values.inheritsColor === \"to\") {\n return util.overrideOpacity(this.to.options.color.border, values.opacity);\n } else { // \"from\"\n return util.overrideOpacity(this.from.options.color.border, values.opacity);\n }\n } else {\n return util.overrideOpacity(values.color, values.opacity);\n }\n }\n\n /**\n * Draw a line from a node to itself, a circle\n * @param {CanvasRenderingContext2D} ctx\n * @param {Number} x\n * @param {Number} y\n * @param {Number} radius\n * @private\n */\n _circle(ctx, values, x, y, radius) {\n // draw shadow if enabled\n this.enableShadow(ctx, values);\n\n // draw a circle\n ctx.beginPath();\n ctx.arc(x, y, radius, 0, 2 * Math.PI, false);\n ctx.stroke();\n\n // disable shadows for other elements.\n this.disableShadow(ctx, values);\n }\n\n\n /**\n * Calculate the distance between a point (x3,y3) and a line segment from\n * (x1,y1) to (x2,y2).\n * http://stackoverflow.com/questions/849211/shortest-distancae-between-a-point-and-a-line-segment\n * @param {number} x1\n * @param {number} y1\n * @param {number} x2\n * @param {number} y2\n * @param {number} x3\n * @param {number} y3\n * @private\n */\n getDistanceToEdge(x1, y1, x2, y2, x3, y3, via, values) { // x3,y3 is the point\n let returnValue = 0;\n if (this.from != this.to) {\n returnValue = this._getDistanceToEdge(x1, y1, x2, y2, x3, y3, via)\n }\n else {\n let [x,y,radius] = this._getCircleData(undefined, values);\n let dx = x - x3;\n let dy = y - y3;\n returnValue = Math.abs(Math.sqrt(dx * dx + dy * dy) - radius);\n }\n\n if (this.labelModule.size.left < x3 &&\n this.labelModule.size.left + this.labelModule.size.width > x3 &&\n this.labelModule.size.top < y3 &&\n this.labelModule.size.top + this.labelModule.size.height > y3) {\n return 0;\n }\n else {\n return returnValue;\n }\n }\n\n _getDistanceToLine(x1, y1, x2, y2, x3, y3) {\n let px = x2 - x1;\n let py = y2 - y1;\n let something = px * px + py * py;\n let u = ((x3 - x1) * px + (y3 - y1) * py) / something;\n\n if (u > 1) {\n u = 1;\n }\n else if (u < 0) {\n u = 0;\n }\n\n let x = x1 + u * px;\n let y = y1 + u * py;\n let dx = x - x3;\n let dy = y - y3;\n\n //# Note: If the actual distance does not matter,\n //# if you only want to compare what this function\n //# returns to other results of this function, you\n //# can just return the squared distance instead\n //# (i.e. remove the sqrt) to gain a little performance\n\n return Math.sqrt(dx * dx + dy * dy);\n }\n\n\n /**\n *\n * @param ctx\n * @param position\n * @param viaNode\n */\n getArrowData(ctx, position, viaNode, selected, hover, values) {\n // set lets\n let angle;\n let arrowPoint;\n let node1;\n let node2;\n let guideOffset;\n let scaleFactor;\n let type;\n let lineWidth = values.width;\n\n if (position === 'from') {\n node1 = this.from;\n node2 = this.to;\n guideOffset = 0.1;\n scaleFactor = values.fromArrowScale;\n type = values.fromArrowType;\n }\n else if (position === 'to') {\n node1 = this.to;\n node2 = this.from;\n guideOffset = -0.1;\n scaleFactor = values.toArrowScale;\n type = values.toArrowType;\n }\n else {\n node1 = this.to;\n node2 = this.from;\n scaleFactor = values.middleArrowScale;\n type = values.middleArrowType;\n }\n\n // if not connected to itself\n if (node1 != node2) {\n if (position !== 'middle') {\n // draw arrow head\n if (this.options.smooth.enabled === true) {\n arrowPoint = this.findBorderPosition(node1, ctx, { via: viaNode });\n let guidePos = this.getPoint(Math.max(0.0, Math.min(1.0, arrowPoint.t + guideOffset)), viaNode);\n angle = Math.atan2((arrowPoint.y - guidePos.y), (arrowPoint.x - guidePos.x));\n } else {\n angle = Math.atan2((node1.y - node2.y), (node1.x - node2.x));\n arrowPoint = this.findBorderPosition(node1, ctx);\n }\n } else {\n angle = Math.atan2((node1.y - node2.y), (node1.x - node2.x));\n arrowPoint = this.getPoint(0.5, viaNode); // this is 0.6 to account for the size of the arrow.\n }\n } else {\n // draw circle\n let [x,y,radius] = this._getCircleData(ctx);\n\n if (position === 'from') {\n arrowPoint = this.findBorderPosition(this.from, ctx, { x, y, low: 0.25, high: 0.6, direction: -1 });\n angle = arrowPoint.t * -2 * Math.PI + 1.5 * Math.PI + 0.1 * Math.PI;\n } else if (position === 'to') {\n arrowPoint = this.findBorderPosition(this.from, ctx, { x, y, low: 0.6, high: 1.0, direction: 1 });\n angle = arrowPoint.t * -2 * Math.PI + 1.5 * Math.PI - 1.1 * Math.PI;\n } else {\n arrowPoint = this._pointOnCircle(x, y, radius, 0.175);\n angle = 3.9269908169872414; // === 0.175 * -2 * Math.PI + 1.5 * Math.PI + 0.1 * Math.PI;\n }\n }\n\n let length = 15 * scaleFactor + 3 * lineWidth; // 3* lineWidth is the width of the edge.\n\n var xi = arrowPoint.x - length * 0.9 * Math.cos(angle);\n var yi = arrowPoint.y - length * 0.9 * Math.sin(angle);\n let arrowCore = { x: xi, y: yi };\n\n return { point: arrowPoint, core: arrowCore, angle: angle, length: length, type: type };\n }\n\n /**\n *\n * @param ctx\n * @param selected\n * @param hover\n * @param arrowData\n */\n drawArrowHead(ctx, values, selected, hover, arrowData) {\n // set style\n ctx.strokeStyle = this.getColor(ctx, values, selected, hover);\n ctx.fillStyle = ctx.strokeStyle;\n ctx.lineWidth = values.width;\n\n if (arrowData.type && arrowData.type.toLowerCase() === 'circle') {\n // draw circle at the end of the line\n ctx.circleEndpoint(arrowData.point.x, arrowData.point.y, arrowData.angle, arrowData.length);\n } else {\n // draw arrow at the end of the line\n ctx.arrowEndpoint(arrowData.point.x, arrowData.point.y, arrowData.angle, arrowData.length);\n }\n\n // draw shadow if enabled\n this.enableShadow(ctx, values);\n ctx.fill();\n // disable shadows for other elements.\n this.disableShadow(ctx, values);\n }\n\n\n enableShadow(ctx, values) {\n if (values.shadow === true) {\n ctx.shadowColor = values.shadowColor;\n ctx.shadowBlur = values.shadowSize;\n ctx.shadowOffsetX = values.shadowX;\n ctx.shadowOffsetY = values.shadowY;\n }\n }\n\n disableShadow(ctx, values) {\n if (values.shadow === true) {\n ctx.shadowColor = 'rgba(0,0,0,0)';\n ctx.shadowBlur = 0;\n ctx.shadowOffsetX = 0;\n ctx.shadowOffsetY = 0;\n }\n }\n}\n\nexport default EdgeBase;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/edges/util/EdgeBase.js","import BezierEdgeBase from './util/BezierEdgeBase'\n\nclass BezierEdgeDynamic extends BezierEdgeBase {\n constructor(options, body, labelModule) {\n //this.via = undefined; // Here for completeness but not allowed to defined before super() is invoked.\n super(options, body, labelModule); // --> this calls the setOptions below\n this._boundFunction = () => {this.positionBezierNode();};\n this.body.emitter.on(\"_repositionBezierNodes\", this._boundFunction);\n }\n\n setOptions(options) {\n // check if the physics has changed.\n let physicsChange = false;\n if (this.options.physics !== options.physics) {\n physicsChange = true;\n }\n\n // set the options and the to and from nodes\n this.options = options;\n this.id = this.options.id;\n this.from = this.body.nodes[this.options.from];\n this.to = this.body.nodes[this.options.to];\n\n // setup the support node and connect\n this.setupSupportNode();\n this.connect();\n\n // when we change the physics state of the edge, we reposition the support node.\n if (physicsChange === true) {\n this.via.setOptions({physics: this.options.physics})\n this.positionBezierNode();\n }\n }\n\n connect() {\n this.from = this.body.nodes[this.options.from];\n this.to = this.body.nodes[this.options.to];\n if (this.from === undefined || this.to === undefined || this.options.physics === false) {\n this.via.setOptions({physics:false})\n }\n else {\n // fix weird behaviour where a self referencing node has physics enabled\n if (this.from.id === this.to.id) {\n this.via.setOptions({physics: false})\n }\n else {\n this.via.setOptions({physics: true})\n }\n }\n }\n\n /**\n * remove the support nodes\n * @returns {boolean}\n */\n cleanup() {\n this.body.emitter.off(\"_repositionBezierNodes\", this._boundFunction);\n if (this.via !== undefined) {\n delete this.body.nodes[this.via.id];\n this.via = undefined;\n return true;\n }\n return false;\n }\n\n /**\n * Bezier curves require an anchor point to calculate the smooth flow. These points are nodes. These nodes are invisible but\n * are used for the force calculation.\n *\n * The changed data is not called, if needed, it is returned by the main edge constructor.\n * @private\n */\n setupSupportNode() {\n if (this.via === undefined) {\n var nodeId = \"edgeId:\" + this.id;\n var node = this.body.functions.createNode({\n id: nodeId,\n shape: 'circle',\n physics:true,\n hidden:true\n });\n this.body.nodes[nodeId] = node;\n this.via = node;\n this.via.parentEdgeId = this.id;\n this.positionBezierNode();\n }\n }\n\n positionBezierNode() {\n if (this.via !== undefined && this.from !== undefined && this.to !== undefined) {\n this.via.x = 0.5 * (this.from.x + this.to.x);\n this.via.y = 0.5 * (this.from.y + this.to.y);\n }\n else if (this.via !== undefined) {\n this.via.x = 0;\n this.via.y = 0;\n }\n }\n\n /**\n * Draw a line between two nodes\n * @param {CanvasRenderingContext2D} ctx\n * @private\n */\n _line(ctx, values, viaNode) {\n // draw a straight line\n ctx.beginPath();\n ctx.moveTo(this.fromPoint.x, this.fromPoint.y);\n // fallback to normal straight edges\n if (viaNode.x === undefined) {\n ctx.lineTo(this.toPoint.x, this.toPoint.y);\n }\n else {\n ctx.quadraticCurveTo(viaNode.x, viaNode.y, this.toPoint.x, this.toPoint.y);\n }\n // draw shadow if enabled\n this.enableShadow(ctx, values);\n ctx.stroke();\n this.disableShadow(ctx, values);\n }\n\n getViaNode() {\n return this.via;\n }\n\n\n /**\n * Combined function of pointOnLine and pointOnBezier. This gives the coordinates of a point on the line at a certain percentage of the way\n * @param percentage\n * @param viaNode\n * @returns {{x: number, y: number}}\n * @private\n */\n getPoint(percentage, viaNode = this.via) {\n let t = percentage;\n let x, y;\n if (this.from === this.to){\n let [cx,cy,cr] = this._getCircleData(this.from)\n let a = 2 * Math.PI * (1 - t);\n x = cx + cr * Math.sin(a);\n y = cy + cr - cr * (1 - Math.cos(a));\n } else {\n x = Math.pow(1 - t, 2) * this.fromPoint.x + 2 * t * (1 - t) * viaNode.x + Math.pow(t, 2) * this.toPoint.x;\n y = Math.pow(1 - t, 2) * this.fromPoint.y + 2 * t * (1 - t) * viaNode.y + Math.pow(t, 2) * this.toPoint.y;\n }\n\n return {x: x, y: y};\n }\n\n _findBorderPosition(nearNode, ctx) {\n return this._findBorderPositionBezier(nearNode, ctx, this.via);\n }\n\n _getDistanceToEdge(x1, y1, x2, y2, x3, y3) { // x3,y3 is the point\n return this._getDistanceToBezierEdge(x1, y1, x2, y2, x3, y3, this.via);\n }\n\n\n}\n\n\nexport default BezierEdgeDynamic;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/edges/BezierEdgeDynamic.js","import BezierEdgeBase from './util/BezierEdgeBase'\n\nclass BezierEdgeStatic extends BezierEdgeBase {\n constructor(options, body, labelModule) {\n super(options, body, labelModule);\n }\n\n /**\n * Draw a line between two nodes\n * @param {CanvasRenderingContext2D} ctx\n * @private\n */\n _line(ctx, values, viaNode) {\n // draw a straight line\n ctx.beginPath();\n ctx.moveTo(this.fromPoint.x, this.fromPoint.y);\n\n // fallback to normal straight edges\n if (viaNode.x === undefined) {\n ctx.lineTo(this.toPoint.x, this.toPoint.y);\n }\n else {\n ctx.quadraticCurveTo(viaNode.x, viaNode.y, this.toPoint.x, this.toPoint.y);\n }\n // draw shadow if enabled\n this.enableShadow(ctx, values);\n ctx.stroke();\n this.disableShadow(ctx, values);\n }\n\n getViaNode() {\n return this._getViaCoordinates();\n }\n\n\n /**\n * We do not use the to and fromPoints here to make the via nodes the same as edges without arrows.\n * @returns {{x: undefined, y: undefined}}\n * @private\n */\n _getViaCoordinates() {\n let xVia = undefined;\n let yVia = undefined;\n let factor = this.options.smooth.roundness;\n let type = this.options.smooth.type;\n let dx = Math.abs(this.from.x - this.to.x);\n let dy = Math.abs(this.from.y - this.to.y);\n if (type === 'discrete' || type === 'diagonalCross') {\n if (Math.abs(this.from.x - this.to.x) <= Math.abs(this.from.y - this.to.y)) {\n if (this.from.y >= this.to.y) {\n if (this.from.x <= this.to.x) {\n xVia = this.from.x + factor * dy;\n yVia = this.from.y - factor * dy;\n }\n else if (this.from.x > this.to.x) {\n xVia = this.from.x - factor * dy;\n yVia = this.from.y - factor * dy;\n }\n }\n else if (this.from.y < this.to.y) {\n if (this.from.x <= this.to.x) {\n xVia = this.from.x + factor * dy;\n yVia = this.from.y + factor * dy;\n }\n else if (this.from.x > this.to.x) {\n xVia = this.from.x - factor * dy;\n yVia = this.from.y + factor * dy;\n }\n }\n if (type === \"discrete\") {\n xVia = dx < factor * dy ? this.from.x : xVia;\n }\n }\n else if (Math.abs(this.from.x - this.to.x) > Math.abs(this.from.y - this.to.y)) {\n if (this.from.y >= this.to.y) {\n if (this.from.x <= this.to.x) {\n xVia = this.from.x + factor * dx;\n yVia = this.from.y - factor * dx;\n }\n else if (this.from.x > this.to.x) {\n xVia = this.from.x - factor * dx;\n yVia = this.from.y - factor * dx;\n }\n }\n else if (this.from.y < this.to.y) {\n if (this.from.x <= this.to.x) {\n xVia = this.from.x + factor * dx;\n yVia = this.from.y + factor * dx;\n }\n else if (this.from.x > this.to.x) {\n xVia = this.from.x - factor * dx;\n yVia = this.from.y + factor * dx;\n }\n }\n if (type === \"discrete\") {\n yVia = dy < factor * dx ? this.from.y : yVia;\n }\n }\n }\n else if (type === \"straightCross\") {\n if (Math.abs(this.from.x - this.to.x) <= Math.abs(this.from.y - this.to.y)) { // up - down\n xVia = this.from.x;\n if (this.from.y < this.to.y) {\n yVia = this.to.y - (1 - factor) * dy;\n }\n else {\n yVia = this.to.y + (1 - factor) * dy;\n }\n }\n else if (Math.abs(this.from.x - this.to.x) > Math.abs(this.from.y - this.to.y)) { // left - right\n if (this.from.x < this.to.x) {\n xVia = this.to.x - (1 - factor) * dx;\n }\n else {\n xVia = this.to.x + (1 - factor) * dx;\n }\n yVia = this.from.y;\n }\n }\n else if (type === 'horizontal') {\n if (this.from.x < this.to.x) {\n xVia = this.to.x - (1 - factor) * dx;\n }\n else {\n xVia = this.to.x + (1 - factor) * dx;\n }\n yVia = this.from.y;\n }\n else if (type === 'vertical') {\n xVia = this.from.x;\n if (this.from.y < this.to.y) {\n yVia = this.to.y - (1 - factor) * dy;\n }\n else {\n yVia = this.to.y + (1 - factor) * dy;\n }\n }\n else if (type === 'curvedCW') {\n dx = this.to.x - this.from.x;\n dy = this.from.y - this.to.y;\n let radius = Math.sqrt(dx * dx + dy * dy);\n let pi = Math.PI;\n\n let originalAngle = Math.atan2(dy, dx);\n let myAngle = (originalAngle + ((factor * 0.5) + 0.5) * pi) % (2 * pi);\n\n xVia = this.from.x + (factor * 0.5 + 0.5) * radius * Math.sin(myAngle);\n yVia = this.from.y + (factor * 0.5 + 0.5) * radius * Math.cos(myAngle);\n }\n else if (type === 'curvedCCW') {\n dx = this.to.x - this.from.x;\n dy = this.from.y - this.to.y;\n let radius = Math.sqrt(dx * dx + dy * dy);\n let pi = Math.PI;\n\n let originalAngle = Math.atan2(dy, dx);\n let myAngle = (originalAngle + ((-factor * 0.5) + 0.5) * pi) % (2 * pi);\n\n xVia = this.from.x + (factor * 0.5 + 0.5) * radius * Math.sin(myAngle);\n yVia = this.from.y + (factor * 0.5 + 0.5) * radius * Math.cos(myAngle);\n }\n else { // continuous\n if (Math.abs(this.from.x - this.to.x) <= Math.abs(this.from.y - this.to.y)) {\n if (this.from.y >= this.to.y) {\n if (this.from.x <= this.to.x) {\n xVia = this.from.x + factor * dy;\n yVia = this.from.y - factor * dy;\n xVia = this.to.x < xVia ? this.to.x : xVia;\n }\n else if (this.from.x > this.to.x) {\n xVia = this.from.x - factor * dy;\n yVia = this.from.y - factor * dy;\n xVia = this.to.x > xVia ? this.to.x : xVia;\n }\n }\n else if (this.from.y < this.to.y) {\n if (this.from.x <= this.to.x) {\n xVia = this.from.x + factor * dy;\n yVia = this.from.y + factor * dy;\n xVia = this.to.x < xVia ? this.to.x : xVia;\n }\n else if (this.from.x > this.to.x) {\n xVia = this.from.x - factor * dy;\n yVia = this.from.y + factor * dy;\n xVia = this.to.x > xVia ? this.to.x : xVia;\n }\n }\n }\n else if (Math.abs(this.from.x - this.to.x) > Math.abs(this.from.y - this.to.y)) {\n if (this.from.y >= this.to.y) {\n if (this.from.x <= this.to.x) {\n xVia = this.from.x + factor * dx;\n yVia = this.from.y - factor * dx;\n yVia = this.to.y > yVia ? this.to.y : yVia;\n }\n else if (this.from.x > this.to.x) {\n xVia = this.from.x - factor * dx;\n yVia = this.from.y - factor * dx;\n yVia = this.to.y > yVia ? this.to.y : yVia;\n }\n }\n else if (this.from.y < this.to.y) {\n if (this.from.x <= this.to.x) {\n xVia = this.from.x + factor * dx;\n yVia = this.from.y + factor * dx;\n yVia = this.to.y < yVia ? this.to.y : yVia;\n }\n else if (this.from.x > this.to.x) {\n xVia = this.from.x - factor * dx;\n yVia = this.from.y + factor * dx;\n yVia = this.to.y < yVia ? this.to.y : yVia;\n }\n }\n }\n }\n return {x: xVia, y: yVia};\n }\n\n _findBorderPosition(nearNode, ctx, options = {}) {\n return this._findBorderPositionBezier(nearNode, ctx, options.via);\n }\n\n _getDistanceToEdge(x1, y1, x2, y2, x3, y3, viaNode = this._getViaCoordinates()) { // x3,y3 is the point\n return this._getDistanceToBezierEdge(x1, y1, x2, y2, x3, y3, viaNode);\n }\n\n /**\n * Combined function of pointOnLine and pointOnBezier. This gives the coordinates of a point on the line at a certain percentage of the way\n * @param percentage\n * @param viaNode\n * @returns {{x: number, y: number}}\n * @private\n */\n getPoint(percentage, viaNode = this._getViaCoordinates()) {\n var t = percentage;\n var x = Math.pow(1 - t, 2) * this.fromPoint.x + (2 * t * (1 - t)) * viaNode.x + Math.pow(t, 2) * this.toPoint.x;\n var y = Math.pow(1 - t, 2) * this.fromPoint.y + (2 * t * (1 - t)) * viaNode.y + Math.pow(t, 2) * this.toPoint.y;\n\n return {x: x, y: y};\n }\n}\n\n\nexport default BezierEdgeStatic;\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/edges/BezierEdgeStatic.js","import EdgeBase from './util/EdgeBase'\n\nclass StraightEdge extends EdgeBase {\n constructor(options, body, labelModule) {\n super(options, body, labelModule);\n }\n\n /**\n * Draw a line between two nodes\n * @param {CanvasRenderingContext2D} ctx\n * @private\n */\n _line(ctx, values) {\n // draw a straight line\n ctx.beginPath();\n ctx.moveTo(this.fromPoint.x, this.fromPoint.y);\n ctx.lineTo(this.toPoint.x, this.toPoint.y);\n // draw shadow if enabled\n this.enableShadow(ctx, values);\n ctx.stroke();\n this.disableShadow(ctx, values);\n }\n\n getViaNode() {\n return undefined;\n }\n\n /**\n * Combined function of pointOnLine and pointOnBezier. This gives the coordinates of a point on the line at a certain percentage of the way\n * @param percentage\n * @param via\n * @returns {{x: number, y: number}}\n * @private\n */\n getPoint(percentage) {\n return {\n x: (1 - percentage) * this.fromPoint.x + percentage * this.toPoint.x,\n y: (1 - percentage) * this.fromPoint.y + percentage * this.toPoint.y\n }\n }\n\n _findBorderPosition(nearNode, ctx) {\n let node1 = this.to;\n let node2 = this.from;\n if (nearNode.id === this.from.id) {\n node1 = this.from;\n node2 = this.to;\n }\n\n let angle = Math.atan2((node1.y - node2.y), (node1.x - node2.x));\n let dx = (node1.x - node2.x);\n let dy = (node1.y - node2.y);\n let edgeSegmentLength = Math.sqrt(dx * dx + dy * dy);\n let toBorderDist = nearNode.distanceToBorder(ctx, angle);\n let toBorderPoint = (edgeSegmentLength - toBorderDist) / edgeSegmentLength;\n\n let borderPos = {};\n borderPos.x = (1 - toBorderPoint) * node2.x + toBorderPoint * node1.x;\n borderPos.y = (1 - toBorderPoint) * node2.y + toBorderPoint * node1.y;\n\n return borderPos;\n }\n\n _getDistanceToEdge(x1, y1, x2, y2, x3, y3) { // x3,y3 is the point\n return this._getDistanceToLine(x1, y1, x2, y2, x3, y3);\n }\n\n}\n\nexport default StraightEdge;\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/edges/StraightEdge.js","import BarnesHutSolver from './components/physics/BarnesHutSolver';\nimport Repulsion from './components/physics/RepulsionSolver';\nimport HierarchicalRepulsion from './components/physics/HierarchicalRepulsionSolver';\nimport SpringSolver from './components/physics/SpringSolver';\nimport HierarchicalSpringSolver from './components/physics/HierarchicalSpringSolver';\nimport CentralGravitySolver from './components/physics/CentralGravitySolver';\nimport ForceAtlas2BasedRepulsionSolver from './components/physics/FA2BasedRepulsionSolver';\nimport ForceAtlas2BasedCentralGravitySolver from './components/physics/FA2BasedCentralGravitySolver';\n\nvar util = require('../../util');\n\n\nclass PhysicsEngine {\n constructor(body) {\n this.body = body;\n this.physicsBody = {physicsNodeIndices:[], physicsEdgeIndices:[], forces: {}, velocities: {}};\n\n this.physicsEnabled = true;\n this.simulationInterval = 1000 / 60;\n this.requiresTimeout = true;\n this.previousStates = {};\n this.referenceState = {};\n this.freezeCache = {};\n this.renderTimer = undefined;\n\n // parameters for the adaptive timestep\n this.adaptiveTimestep = false;\n this.adaptiveTimestepEnabled = false;\n this.adaptiveCounter = 0;\n this.adaptiveInterval = 3;\n\n this.stabilized = false;\n this.startedStabilization = false;\n this.stabilizationIterations = 0;\n this.ready = false; // will be set to true if the stabilize\n\n // default options\n this.options = {};\n this.defaultOptions = {\n enabled: true,\n barnesHut: {\n theta: 0.5,\n gravitationalConstant: -2000,\n centralGravity: 0.3,\n springLength: 95,\n springConstant: 0.04,\n damping: 0.09,\n avoidOverlap: 0\n },\n forceAtlas2Based: {\n theta: 0.5,\n gravitationalConstant: -50,\n centralGravity: 0.01,\n springConstant: 0.08,\n springLength: 100,\n damping: 0.4,\n avoidOverlap: 0\n },\n repulsion: {\n centralGravity: 0.2,\n springLength: 200,\n springConstant: 0.05,\n nodeDistance: 100,\n damping: 0.09,\n avoidOverlap: 0\n },\n hierarchicalRepulsion: {\n centralGravity: 0.0,\n springLength: 100,\n springConstant: 0.01,\n nodeDistance: 120,\n damping: 0.09\n },\n maxVelocity: 50,\n minVelocity: 0.75, // px/s\n solver: 'barnesHut',\n stabilization: {\n enabled: true,\n iterations: 1000, // maximum number of iteration to stabilize\n updateInterval: 50,\n onlyDynamicEdges: false,\n fit: true\n },\n timestep: 0.5,\n adaptiveTimestep: true\n };\n util.extend(this.options, this.defaultOptions);\n this.timestep = 0.5;\n this.layoutFailed = false;\n\n this.bindEventListeners();\n }\n\n bindEventListeners() {\n this.body.emitter.on('initPhysics', () => {this.initPhysics();});\n this.body.emitter.on('_layoutFailed', () => {this.layoutFailed = true;});\n this.body.emitter.on('resetPhysics', () => {this.stopSimulation(); this.ready = false;});\n this.body.emitter.on('disablePhysics', () => {this.physicsEnabled = false; this.stopSimulation();});\n this.body.emitter.on('restorePhysics', () => {\n this.setOptions(this.options);\n if (this.ready === true) {\n this.startSimulation();\n }\n });\n this.body.emitter.on('startSimulation', () => {\n if (this.ready === true) {\n this.startSimulation();\n }\n });\n this.body.emitter.on('stopSimulation', () => {this.stopSimulation();});\n this.body.emitter.on('destroy', () => {\n this.stopSimulation(false);\n this.body.emitter.off();\n });\n // this event will trigger a rebuilding of the cache everything. Used when nodes or edges have been added or removed.\n this.body.emitter.on(\"_dataChanged\", () => {\n // update shortcut lists\n this.updatePhysicsData();\n });\n\n // debug: show forces\n // this.body.emitter.on(\"afterDrawing\", (ctx) => {this._drawForces(ctx);});\n }\n\n\n /**\n * set the physics options\n * @param options\n */\n setOptions(options) {\n if (options !== undefined) {\n if (options === false) {\n this.options.enabled = false;\n this.physicsEnabled = false;\n this.stopSimulation();\n }\n else {\n this.physicsEnabled = true;\n util.selectiveNotDeepExtend(['stabilization'], this.options, options);\n util.mergeOptions(this.options, options, 'stabilization');\n\n if (options.enabled === undefined) {\n this.options.enabled = true;\n }\n\n if (this.options.enabled === false) {\n this.physicsEnabled = false;\n this.stopSimulation();\n }\n\n // set the timestep\n this.timestep = this.options.timestep;\n }\n }\n this.init();\n }\n\n\n /**\n * configure the engine.\n */\n init() {\n var options;\n if (this.options.solver === 'forceAtlas2Based') {\n options = this.options.forceAtlas2Based;\n this.nodesSolver = new ForceAtlas2BasedRepulsionSolver(this.body, this.physicsBody, options);\n this.edgesSolver = new SpringSolver(this.body, this.physicsBody, options);\n this.gravitySolver = new ForceAtlas2BasedCentralGravitySolver(this.body, this.physicsBody, options);\n }\n else if (this.options.solver === 'repulsion') {\n options = this.options.repulsion;\n this.nodesSolver = new Repulsion(this.body, this.physicsBody, options);\n this.edgesSolver = new SpringSolver(this.body, this.physicsBody, options);\n this.gravitySolver = new CentralGravitySolver(this.body, this.physicsBody, options);\n }\n else if (this.options.solver === 'hierarchicalRepulsion') {\n options = this.options.hierarchicalRepulsion;\n this.nodesSolver = new HierarchicalRepulsion(this.body, this.physicsBody, options);\n this.edgesSolver = new HierarchicalSpringSolver(this.body, this.physicsBody, options);\n this.gravitySolver = new CentralGravitySolver(this.body, this.physicsBody, options);\n }\n else { // barnesHut\n options = this.options.barnesHut;\n this.nodesSolver = new BarnesHutSolver(this.body, this.physicsBody, options);\n this.edgesSolver = new SpringSolver(this.body, this.physicsBody, options);\n this.gravitySolver = new CentralGravitySolver(this.body, this.physicsBody, options);\n }\n\n this.modelOptions = options;\n }\n\n\n /**\n * initialize the engine\n */\n initPhysics() {\n if (this.physicsEnabled === true && this.options.enabled === true) {\n if (this.options.stabilization.enabled === true) {\n this.stabilize();\n }\n else {\n this.stabilized = false;\n this.ready = true;\n this.body.emitter.emit('fit', {}, this.layoutFailed); // if the layout failed, we use the approximation for the zoom\n this.startSimulation();\n }\n }\n else {\n this.ready = true;\n this.body.emitter.emit('fit');\n }\n }\n\n /**\n * Start the simulation\n */\n startSimulation() {\n if (this.physicsEnabled === true && this.options.enabled === true) {\n this.stabilized = false;\n\n // when visible, adaptivity is disabled.\n this.adaptiveTimestep = false;\n\n // this sets the width of all nodes initially which could be required for the avoidOverlap\n this.body.emitter.emit(\"_resizeNodes\");\n if (this.viewFunction === undefined) {\n this.viewFunction = this.simulationStep.bind(this);\n this.body.emitter.on('initRedraw', this.viewFunction);\n this.body.emitter.emit('_startRendering');\n }\n }\n else {\n this.body.emitter.emit('_redraw');\n }\n }\n\n\n /**\n * Stop the simulation, force stabilization.\n */\n stopSimulation(emit = true) {\n this.stabilized = true;\n if (emit === true) {\n this._emitStabilized();\n }\n if (this.viewFunction !== undefined) {\n this.body.emitter.off('initRedraw', this.viewFunction);\n this.viewFunction = undefined;\n if (emit === true) {\n this.body.emitter.emit('_stopRendering');\n }\n }\n }\n\n\n /**\n * The viewFunction inserts this step into each render loop. It calls the physics tick and handles the cleanup at stabilized.\n *\n */\n simulationStep() {\n // check if the physics have settled\n var startTime = Date.now();\n this.physicsTick();\n var physicsTime = Date.now() - startTime;\n\n // run double speed if it is a little graph\n if ((physicsTime < 0.4 * this.simulationInterval || this.runDoubleSpeed === true) && this.stabilized === false) {\n this.physicsTick();\n\n // this makes sure there is no jitter. The decision is taken once to run it at double speed.\n this.runDoubleSpeed = true;\n }\n\n if (this.stabilized === true) {\n this.stopSimulation();\n }\n }\n\n\n /**\n * trigger the stabilized event.\n * @private\n */\n _emitStabilized(amountOfIterations = this.stabilizationIterations) {\n if (this.stabilizationIterations > 1 || this.startedStabilization === true) {\n setTimeout(() => {\n this.body.emitter.emit('stabilized', {iterations: amountOfIterations});\n this.startedStabilization = false;\n this.stabilizationIterations = 0;\n }, 0);\n }\n }\n\n /**\n * A single simulation step (or 'tick') in the physics simulation\n *\n * @private\n */\n physicsTick() {\n // this is here to ensure that there is no start event when the network is already stable.\n if (this.startedStabilization === false) {\n this.body.emitter.emit('startStabilizing');\n this.startedStabilization = true;\n }\n\n if (this.stabilized === false) {\n // adaptivity means the timestep adapts to the situation, only applicable for stabilization\n if (this.adaptiveTimestep === true && this.adaptiveTimestepEnabled === true) {\n // this is the factor for increasing the timestep on success.\n let factor = 1.2;\n\n // we assume the adaptive interval is\n if (this.adaptiveCounter % this.adaptiveInterval === 0) { // we leave the timestep stable for \"interval\" iterations.\n // first the big step and revert. Revert saves the reference state.\n this.timestep = 2 * this.timestep;\n this.calculateForces();\n this.moveNodes();\n this.revert();\n\n // now the normal step. Since this is the last step, it is the more stable one and we will take this.\n this.timestep = 0.5 * this.timestep;\n\n // since it's half the step, we do it twice.\n this.calculateForces();\n this.moveNodes();\n this.calculateForces();\n this.moveNodes();\n\n // we compare the two steps. if it is acceptable we double the step.\n if (this._evaluateStepQuality() === true) {\n this.timestep = factor * this.timestep;\n }\n else {\n // if not, we decrease the step to a minimum of the options timestep.\n // if the decreased timestep is smaller than the options step, we do not reset the counter\n // we assume that the options timestep is stable enough.\n if (this.timestep/factor < this.options.timestep) {\n this.timestep = this.options.timestep;\n }\n else {\n // if the timestep was larger than 2 times the option one we check the adaptivity again to ensure\n // that large instabilities do not form.\n this.adaptiveCounter = -1; // check again next iteration\n this.timestep = Math.max(this.options.timestep, this.timestep/factor);\n }\n }\n }\n else {\n // normal step, keeping timestep constant\n this.calculateForces();\n this.moveNodes();\n }\n\n // increment the counter\n this.adaptiveCounter += 1;\n }\n else {\n // case for the static timestep, we reset it to the one in options and take a normal step.\n this.timestep = this.options.timestep;\n this.calculateForces();\n this.moveNodes();\n }\n\n // determine if the network has stabilzied\n if (this.stabilized === true) {\n this.revert();\n }\n\n this.stabilizationIterations++;\n }\n }\n\n /**\n * Nodes and edges can have the physics toggles on or off. A collection of indices is created here so we can skip the check all the time.\n *\n * @private\n */\n updatePhysicsData() {\n this.physicsBody.forces = {};\n this.physicsBody.physicsNodeIndices = [];\n this.physicsBody.physicsEdgeIndices = [];\n let nodes = this.body.nodes;\n let edges = this.body.edges;\n\n // get node indices for physics\n for (let nodeId in nodes) {\n if (nodes.hasOwnProperty(nodeId)) {\n if (nodes[nodeId].options.physics === true) {\n this.physicsBody.physicsNodeIndices.push(nodes[nodeId].id);\n }\n }\n }\n\n // get edge indices for physics\n for (let edgeId in edges) {\n if (edges.hasOwnProperty(edgeId)) {\n if (edges[edgeId].options.physics === true) {\n this.physicsBody.physicsEdgeIndices.push(edges[edgeId].id);\n }\n }\n }\n\n // get the velocity and the forces vector\n for (let i = 0; i < this.physicsBody.physicsNodeIndices.length; i++) {\n let nodeId = this.physicsBody.physicsNodeIndices[i];\n this.physicsBody.forces[nodeId] = {x:0,y:0};\n\n // forces can be reset because they are recalculated. Velocities have to persist.\n if (this.physicsBody.velocities[nodeId] === undefined) {\n this.physicsBody.velocities[nodeId] = {x:0,y:0};\n }\n }\n\n // clean deleted nodes from the velocity vector\n for (let nodeId in this.physicsBody.velocities) {\n if (nodes[nodeId] === undefined) {\n delete this.physicsBody.velocities[nodeId];\n }\n }\n }\n\n\n /**\n * Revert the simulation one step. This is done so after stabilization, every new start of the simulation will also say stabilized.\n */\n revert() {\n var nodeIds = Object.keys(this.previousStates);\n var nodes = this.body.nodes;\n var velocities = this.physicsBody.velocities;\n this.referenceState = {};\n\n for (let i = 0; i < nodeIds.length; i++) {\n let nodeId = nodeIds[i];\n if (nodes[nodeId] !== undefined) {\n if (nodes[nodeId].options.physics === true) {\n this.referenceState[nodeId] = {\n positions: {x:nodes[nodeId].x, y:nodes[nodeId].y}\n };\n velocities[nodeId].x = this.previousStates[nodeId].vx;\n velocities[nodeId].y = this.previousStates[nodeId].vy;\n nodes[nodeId].x = this.previousStates[nodeId].x;\n nodes[nodeId].y = this.previousStates[nodeId].y;\n }\n }\n else {\n delete this.previousStates[nodeId];\n }\n }\n }\n\n /**\n * This compares the reference state to the current state\n */\n _evaluateStepQuality() {\n let dx, dy, dpos;\n let nodes = this.body.nodes;\n let reference = this.referenceState;\n let posThreshold = 0.3;\n\n for (let nodeId in this.referenceState) {\n if (this.referenceState.hasOwnProperty(nodeId) && nodes[nodeId] !== undefined) {\n dx = nodes[nodeId].x - reference[nodeId].positions.x;\n dy = nodes[nodeId].y - reference[nodeId].positions.y;\n\n dpos = Math.sqrt(Math.pow(dx,2) + Math.pow(dy,2))\n\n if (dpos > posThreshold) {\n return false;\n }\n }\n }\n return true;\n }\n\n /**\n * move the nodes one timestep and check if they are stabilized\n * @returns {boolean}\n */\n moveNodes() {\n var nodeIndices = this.physicsBody.physicsNodeIndices;\n var maxVelocity = this.options.maxVelocity ? this.options.maxVelocity : 1e9;\n var maxNodeVelocity = 0;\n var averageNodeVelocity = 0;\n\n // the velocity threshold (energy in the system) for the adaptivity toggle\n var velocityAdaptiveThreshold = 5;\n\n for (let i = 0; i < nodeIndices.length; i++) {\n let nodeId = nodeIndices[i];\n let nodeVelocity = this._performStep(nodeId, maxVelocity);\n // stabilized is true if stabilized is true and velocity is smaller than vmin --> all nodes must be stabilized\n maxNodeVelocity = Math.max(maxNodeVelocity,nodeVelocity);\n averageNodeVelocity += nodeVelocity;\n }\n\n // evaluating the stabilized and adaptiveTimestepEnabled conditions\n this.adaptiveTimestepEnabled = (averageNodeVelocity/nodeIndices.length) < velocityAdaptiveThreshold;\n this.stabilized = maxNodeVelocity < this.options.minVelocity;\n }\n\n\n /**\n * Perform the actual step\n *\n * @param nodeId\n * @param maxVelocity\n * @returns {number}\n * @private\n */\n _performStep(nodeId,maxVelocity) {\n let node = this.body.nodes[nodeId];\n let timestep = this.timestep;\n let forces = this.physicsBody.forces;\n let velocities = this.physicsBody.velocities;\n\n // store the state so we can revert\n this.previousStates[nodeId] = {x:node.x, y:node.y, vx:velocities[nodeId].x, vy:velocities[nodeId].y};\n\n if (node.options.fixed.x === false) {\n let dx = this.modelOptions.damping * velocities[nodeId].x; // damping force\n let ax = (forces[nodeId].x - dx) / node.options.mass; // acceleration\n velocities[nodeId].x += ax * timestep; // velocity\n velocities[nodeId].x = (Math.abs(velocities[nodeId].x) > maxVelocity) ? ((velocities[nodeId].x > 0) ? maxVelocity : -maxVelocity) : velocities[nodeId].x;\n node.x += velocities[nodeId].x * timestep; // position\n }\n else {\n forces[nodeId].x = 0;\n velocities[nodeId].x = 0;\n }\n\n if (node.options.fixed.y === false) {\n let dy = this.modelOptions.damping * velocities[nodeId].y; // damping force\n let ay = (forces[nodeId].y - dy) / node.options.mass; // acceleration\n velocities[nodeId].y += ay * timestep; // velocity\n velocities[nodeId].y = (Math.abs(velocities[nodeId].y) > maxVelocity) ? ((velocities[nodeId].y > 0) ? maxVelocity : -maxVelocity) : velocities[nodeId].y;\n node.y += velocities[nodeId].y * timestep; // position\n }\n else {\n forces[nodeId].y = 0;\n velocities[nodeId].y = 0;\n }\n\n let totalVelocity = Math.sqrt(Math.pow(velocities[nodeId].x,2) + Math.pow(velocities[nodeId].y,2));\n return totalVelocity;\n }\n\n\n /**\n * calculate the forces for one physics iteration.\n */\n calculateForces() {\n this.gravitySolver.solve();\n this.nodesSolver.solve();\n this.edgesSolver.solve();\n }\n\n\n\n /**\n * When initializing and stabilizing, we can freeze nodes with a predefined position. This greatly speeds up stabilization\n * because only the supportnodes for the smoothCurves have to settle.\n *\n * @private\n */\n _freezeNodes() {\n var nodes = this.body.nodes;\n for (var id in nodes) {\n if (nodes.hasOwnProperty(id)) {\n if (nodes[id].x && nodes[id].y) {\n this.freezeCache[id] = {x:nodes[id].options.fixed.x,y:nodes[id].options.fixed.y};\n nodes[id].options.fixed.x = true;\n nodes[id].options.fixed.y = true;\n }\n }\n }\n }\n\n /**\n * Unfreezes the nodes that have been frozen by _freezeDefinedNodes.\n *\n * @private\n */\n _restoreFrozenNodes() {\n var nodes = this.body.nodes;\n for (var id in nodes) {\n if (nodes.hasOwnProperty(id)) {\n if (this.freezeCache[id] !== undefined) {\n nodes[id].options.fixed.x = this.freezeCache[id].x;\n nodes[id].options.fixed.y = this.freezeCache[id].y;\n }\n }\n }\n this.freezeCache = {};\n }\n\n /**\n * Find a stable position for all nodes\n */\n stabilize(iterations = this.options.stabilization.iterations) {\n if (typeof iterations !== 'number') {\n console.log('The stabilize method needs a numeric amount of iterations. Switching to default: ', this.options.stabilization.iterations);\n iterations = this.options.stabilization.iterations;\n }\n\n if (this.physicsBody.physicsNodeIndices.length === 0) {\n this.ready = true;\n return;\n }\n\n // enable adaptive timesteps\n this.adaptiveTimestep = true && this.options.adaptiveTimestep;\n\n // this sets the width of all nodes initially which could be required for the avoidOverlap\n this.body.emitter.emit(\"_resizeNodes\");\n\n // stop the render loop\n this.stopSimulation();\n\n // set stabilze to false\n this.stabilized = false;\n\n // block redraw requests\n this.body.emitter.emit('_blockRedraw');\n this.targetIterations = iterations;\n\n // start the stabilization\n if (this.options.stabilization.onlyDynamicEdges === true) {\n this._freezeNodes();\n }\n this.stabilizationIterations = 0;\n\n setTimeout(() => this._stabilizationBatch(),0);\n }\n\n\n /**\n * One batch of stabilization\n * @private\n */\n _stabilizationBatch() {\n // this is here to ensure that there is at least one start event.\n if (this.startedStabilization === false) {\n this.body.emitter.emit('startStabilizing');\n this.startedStabilization = true;\n }\n\n var count = 0;\n while (this.stabilized === false && count < this.options.stabilization.updateInterval && this.stabilizationIterations < this.targetIterations) {\n this.physicsTick();\n count++;\n }\n\n if (this.stabilized === false && this.stabilizationIterations < this.targetIterations) {\n this.body.emitter.emit('stabilizationProgress', {iterations: this.stabilizationIterations, total: this.targetIterations});\n setTimeout(this._stabilizationBatch.bind(this),0);\n }\n else {\n this._finalizeStabilization();\n }\n }\n\n\n /**\n * Wrap up the stabilization, fit and emit the events.\n * @private\n */\n _finalizeStabilization() {\n this.body.emitter.emit('_allowRedraw');\n if (this.options.stabilization.fit === true) {\n this.body.emitter.emit('fit');\n }\n\n if (this.options.stabilization.onlyDynamicEdges === true) {\n this._restoreFrozenNodes();\n }\n\n this.body.emitter.emit('stabilizationIterationsDone');\n this.body.emitter.emit('_requestRedraw');\n\n if (this.stabilized === true) {\n this._emitStabilized();\n }\n else {\n this.startSimulation();\n }\n\n this.ready = true;\n }\n\n\n _drawForces(ctx) {\n for (var i = 0; i < this.physicsBody.physicsNodeIndices.length; i++) {\n let node = this.body.nodes[this.physicsBody.physicsNodeIndices[i]];\n let force = this.physicsBody.forces[this.physicsBody.physicsNodeIndices[i]];\n let factor = 20;\n let colorFactor = 0.03;\n let forceSize = Math.sqrt(Math.pow(force.x,2) + Math.pow(force.x,2));\n\n let size = Math.min(Math.max(5,forceSize),15);\n let arrowSize = 3*size;\n\n let color = util.HSVToHex((180 - Math.min(1,Math.max(0,colorFactor*forceSize))*180) / 360,1,1);\n\n ctx.lineWidth = size;\n ctx.strokeStyle = color;\n ctx.beginPath();\n ctx.moveTo(node.x,node.y);\n ctx.lineTo(node.x+factor*force.x, node.y+factor*force.y);\n ctx.stroke();\n\n let angle = Math.atan2(force.y, force.x);\n ctx.fillStyle = color;\n ctx.arrowEndpoint(node.x + factor*force.x + Math.cos(angle)*arrowSize, node.y + factor*force.y+Math.sin(angle)*arrowSize, angle, arrowSize);\n ctx.fill();\n }\n }\n\n}\n\nexport default PhysicsEngine;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/PhysicsEngine.js","\nclass BarnesHutSolver {\n constructor(body, physicsBody, options) {\n this.body = body;\n this.physicsBody = physicsBody;\n this.barnesHutTree;\n this.setOptions(options);\n this.randomSeed = 5;\n\n // debug: show grid\n //this.body.emitter.on(\"afterDrawing\", (ctx) => {this._debug(ctx,'#ff0000')})\n }\n\n setOptions(options) {\n this.options = options;\n this.thetaInversed = 1 / this.options.theta;\n this.overlapAvoidanceFactor = 1 - Math.max(0, Math.min(1,this.options.avoidOverlap)); // if 1 then min distance = 0.5, if 0.5 then min distance = 0.5 + 0.5*node.shape.radius\n }\n\n seededRandom() {\n var x = Math.sin(this.randomSeed++) * 10000;\n return x - Math.floor(x);\n }\n\n\n /**\n * This function calculates the forces the nodes apply on each other based on a gravitational model.\n * The Barnes Hut method is used to speed up this N-body simulation.\n *\n * @private\n */\n solve() {\n if (this.options.gravitationalConstant !== 0 && this.physicsBody.physicsNodeIndices.length > 0) {\n let node;\n let nodes = this.body.nodes;\n let nodeIndices = this.physicsBody.physicsNodeIndices;\n let nodeCount = nodeIndices.length;\n\n // create the tree\n let barnesHutTree = this._formBarnesHutTree(nodes, nodeIndices);\n\n // for debugging\n this.barnesHutTree = barnesHutTree;\n\n // place the nodes one by one recursively\n for (let i = 0; i < nodeCount; i++) {\n node = nodes[nodeIndices[i]];\n if (node.options.mass > 0) {\n // starting with root is irrelevant, it never passes the BarnesHutSolver condition\n this._getForceContribution(barnesHutTree.root.children.NW, node);\n this._getForceContribution(barnesHutTree.root.children.NE, node);\n this._getForceContribution(barnesHutTree.root.children.SW, node);\n this._getForceContribution(barnesHutTree.root.children.SE, node);\n }\n }\n }\n }\n\n\n /**\n * This function traverses the barnesHutTree. It checks when it can approximate distant nodes with their center of mass.\n * If a region contains a single node, we check if it is not itself, then we apply the force.\n *\n * @param parentBranch\n * @param node\n * @private\n */\n _getForceContribution(parentBranch, node) {\n // we get no force contribution from an empty region\n if (parentBranch.childrenCount > 0) {\n let dx, dy, distance;\n\n // get the distance from the center of mass to the node.\n dx = parentBranch.centerOfMass.x - node.x;\n dy = parentBranch.centerOfMass.y - node.y;\n distance = Math.sqrt(dx * dx + dy * dy);\n\n // BarnesHutSolver condition\n // original condition : s/d < theta = passed === d/s > 1/theta = passed\n // calcSize = 1/s --> d * 1/s > 1/theta = passed\n if (distance * parentBranch.calcSize > this.thetaInversed) {\n this._calculateForces(distance, dx, dy, node, parentBranch);\n }\n else {\n // Did not pass the condition, go into children if available\n if (parentBranch.childrenCount === 4) {\n this._getForceContribution(parentBranch.children.NW, node);\n this._getForceContribution(parentBranch.children.NE, node);\n this._getForceContribution(parentBranch.children.SW, node);\n this._getForceContribution(parentBranch.children.SE, node);\n }\n else { // parentBranch must have only one node, if it was empty we wouldnt be here\n if (parentBranch.children.data.id != node.id) { // if it is not self\n this._calculateForces(distance, dx, dy, node, parentBranch);\n }\n }\n }\n }\n }\n\n\n /**\n * Calculate the forces based on the distance.\n *\n * @param distance\n * @param dx\n * @param dy\n * @param node\n * @param parentBranch\n * @private\n */\n _calculateForces(distance, dx, dy, node, parentBranch) {\n if (distance === 0) {\n distance = 0.1;\n dx = distance;\n }\n\n if (this.overlapAvoidanceFactor < 1 && node.shape.radius) {\n distance = Math.max(0.1 + (this.overlapAvoidanceFactor * node.shape.radius), distance - node.shape.radius);\n }\n\n // the dividing by the distance cubed instead of squared allows us to get the fx and fy components without sines and cosines\n // it is shorthand for gravityforce with distance squared and fx = dx/distance * gravityForce\n let gravityForce = this.options.gravitationalConstant * parentBranch.mass * node.options.mass / Math.pow(distance,3);\n let fx = dx * gravityForce;\n let fy = dy * gravityForce;\n\n this.physicsBody.forces[node.id].x += fx;\n this.physicsBody.forces[node.id].y += fy;\n }\n\n\n /**\n * This function constructs the barnesHut tree recursively. It creates the root, splits it and starts placing the nodes.\n *\n * @param nodes\n * @param nodeIndices\n * @private\n */\n _formBarnesHutTree(nodes, nodeIndices) {\n let node;\n let nodeCount = nodeIndices.length;\n\n let minX = nodes[nodeIndices[0]].x;\n let minY = nodes[nodeIndices[0]].y;\n let maxX = nodes[nodeIndices[0]].x;\n let maxY = nodes[nodeIndices[0]].y;\n\n // get the range of the nodes\n for (let i = 1; i < nodeCount; i++) {\n let x = nodes[nodeIndices[i]].x;\n let y = nodes[nodeIndices[i]].y;\n if (nodes[nodeIndices[i]].options.mass > 0) {\n if (x < minX) {\n minX = x;\n }\n if (x > maxX) {\n maxX = x;\n }\n if (y < minY) {\n minY = y;\n }\n if (y > maxY) {\n maxY = y;\n }\n }\n }\n // make the range a square\n let sizeDiff = Math.abs(maxX - minX) - Math.abs(maxY - minY); // difference between X and Y\n if (sizeDiff > 0) {\n minY -= 0.5 * sizeDiff;\n maxY += 0.5 * sizeDiff;\n } // xSize > ySize\n else {\n minX += 0.5 * sizeDiff;\n maxX -= 0.5 * sizeDiff;\n } // xSize < ySize\n\n\n let minimumTreeSize = 1e-5;\n let rootSize = Math.max(minimumTreeSize, Math.abs(maxX - minX));\n let halfRootSize = 0.5 * rootSize;\n let centerX = 0.5 * (minX + maxX), centerY = 0.5 * (minY + maxY);\n\n // construct the barnesHutTree\n let barnesHutTree = {\n root: {\n centerOfMass: {x: 0, y: 0},\n mass: 0,\n range: {\n minX: centerX - halfRootSize, maxX: centerX + halfRootSize,\n minY: centerY - halfRootSize, maxY: centerY + halfRootSize\n },\n size: rootSize,\n calcSize: 1 / rootSize,\n children: {data: null},\n maxWidth: 0,\n level: 0,\n childrenCount: 4\n }\n };\n this._splitBranch(barnesHutTree.root);\n\n // place the nodes one by one recursively\n for (let i = 0; i < nodeCount; i++) {\n node = nodes[nodeIndices[i]];\n if (node.options.mass > 0) {\n this._placeInTree(barnesHutTree.root, node);\n }\n }\n\n // make global\n return barnesHutTree\n }\n\n\n /**\n * this updates the mass of a branch. this is increased by adding a node.\n *\n * @param parentBranch\n * @param node\n * @private\n */\n _updateBranchMass(parentBranch, node) {\n let totalMass = parentBranch.mass + node.options.mass;\n let totalMassInv = 1 / totalMass;\n\n parentBranch.centerOfMass.x = parentBranch.centerOfMass.x * parentBranch.mass + node.x * node.options.mass;\n parentBranch.centerOfMass.x *= totalMassInv;\n\n parentBranch.centerOfMass.y = parentBranch.centerOfMass.y * parentBranch.mass + node.y * node.options.mass;\n parentBranch.centerOfMass.y *= totalMassInv;\n\n parentBranch.mass = totalMass;\n let biggestSize = Math.max(Math.max(node.height, node.radius), node.width);\n parentBranch.maxWidth = (parentBranch.maxWidth < biggestSize) ? biggestSize : parentBranch.maxWidth;\n\n }\n\n\n /**\n * determine in which branch the node will be placed.\n *\n * @param parentBranch\n * @param node\n * @param skipMassUpdate\n * @private\n */\n _placeInTree(parentBranch, node, skipMassUpdate) {\n if (skipMassUpdate != true || skipMassUpdate === undefined) {\n // update the mass of the branch.\n this._updateBranchMass(parentBranch, node);\n }\n\n if (parentBranch.children.NW.range.maxX > node.x) { // in NW or SW\n if (parentBranch.children.NW.range.maxY > node.y) { // in NW\n this._placeInRegion(parentBranch, node, \"NW\");\n }\n else { // in SW\n this._placeInRegion(parentBranch, node, \"SW\");\n }\n }\n else { // in NE or SE\n if (parentBranch.children.NW.range.maxY > node.y) { // in NE\n this._placeInRegion(parentBranch, node, \"NE\");\n }\n else { // in SE\n this._placeInRegion(parentBranch, node, \"SE\");\n }\n }\n }\n\n\n /**\n * actually place the node in a region (or branch)\n *\n * @param parentBranch\n * @param node\n * @param region\n * @private\n */\n _placeInRegion(parentBranch, node, region) {\n switch (parentBranch.children[region].childrenCount) {\n case 0: // place node here\n parentBranch.children[region].children.data = node;\n parentBranch.children[region].childrenCount = 1;\n this._updateBranchMass(parentBranch.children[region], node);\n break;\n case 1: // convert into children\n // if there are two nodes exactly overlapping (on init, on opening of cluster etc.)\n // we move one node a little bit and we do not put it in the tree.\n if (parentBranch.children[region].children.data.x === node.x &&\n parentBranch.children[region].children.data.y === node.y) {\n node.x += this.seededRandom();\n node.y += this.seededRandom();\n }\n else {\n this._splitBranch(parentBranch.children[region]);\n this._placeInTree(parentBranch.children[region], node);\n }\n break;\n case 4: // place in branch\n this._placeInTree(parentBranch.children[region], node);\n break;\n }\n }\n\n\n /**\n * this function splits a branch into 4 sub branches. If the branch contained a node, we place it in the subbranch\n * after the split is complete.\n *\n * @param parentBranch\n * @private\n */\n _splitBranch(parentBranch) {\n // if the branch is shaded with a node, replace the node in the new subset.\n let containedNode = null;\n if (parentBranch.childrenCount === 1) {\n containedNode = parentBranch.children.data;\n parentBranch.mass = 0;\n parentBranch.centerOfMass.x = 0;\n parentBranch.centerOfMass.y = 0;\n }\n parentBranch.childrenCount = 4;\n parentBranch.children.data = null;\n this._insertRegion(parentBranch, \"NW\");\n this._insertRegion(parentBranch, \"NE\");\n this._insertRegion(parentBranch, \"SW\");\n this._insertRegion(parentBranch, \"SE\");\n\n if (containedNode != null) {\n this._placeInTree(parentBranch, containedNode);\n }\n }\n\n\n /**\n * This function subdivides the region into four new segments.\n * Specifically, this inserts a single new segment.\n * It fills the children section of the parentBranch\n *\n * @param parentBranch\n * @param region\n * @param parentRange\n * @private\n */\n _insertRegion(parentBranch, region) {\n let minX, maxX, minY, maxY;\n let childSize = 0.5 * parentBranch.size;\n switch (region) {\n case \"NW\":\n minX = parentBranch.range.minX;\n maxX = parentBranch.range.minX + childSize;\n minY = parentBranch.range.minY;\n maxY = parentBranch.range.minY + childSize;\n break;\n case \"NE\":\n minX = parentBranch.range.minX + childSize;\n maxX = parentBranch.range.maxX;\n minY = parentBranch.range.minY;\n maxY = parentBranch.range.minY + childSize;\n break;\n case \"SW\":\n minX = parentBranch.range.minX;\n maxX = parentBranch.range.minX + childSize;\n minY = parentBranch.range.minY + childSize;\n maxY = parentBranch.range.maxY;\n break;\n case \"SE\":\n minX = parentBranch.range.minX + childSize;\n maxX = parentBranch.range.maxX;\n minY = parentBranch.range.minY + childSize;\n maxY = parentBranch.range.maxY;\n break;\n }\n\n\n parentBranch.children[region] = {\n centerOfMass: {x: 0, y: 0},\n mass: 0,\n range: {minX: minX, maxX: maxX, minY: minY, maxY: maxY},\n size: 0.5 * parentBranch.size,\n calcSize: 2 * parentBranch.calcSize,\n children: {data: null},\n maxWidth: 0,\n level: parentBranch.level + 1,\n childrenCount: 0\n };\n }\n\n\n\n\n //--------------------------- DEBUGGING BELOW ---------------------------//\n\n\n /**\n * This function is for debugging purposed, it draws the tree.\n *\n * @param ctx\n * @param color\n * @private\n */\n _debug(ctx, color) {\n if (this.barnesHutTree !== undefined) {\n\n ctx.lineWidth = 1;\n\n this._drawBranch(this.barnesHutTree.root, ctx, color);\n }\n }\n\n\n /**\n * This function is for debugging purposes. It draws the branches recursively.\n *\n * @param branch\n * @param ctx\n * @param color\n * @private\n */\n _drawBranch(branch, ctx, color) {\n if (color === undefined) {\n color = \"#FF0000\";\n }\n\n if (branch.childrenCount === 4) {\n this._drawBranch(branch.children.NW, ctx);\n this._drawBranch(branch.children.NE, ctx);\n this._drawBranch(branch.children.SE, ctx);\n this._drawBranch(branch.children.SW, ctx);\n }\n ctx.strokeStyle = color;\n ctx.beginPath();\n ctx.moveTo(branch.range.minX, branch.range.minY);\n ctx.lineTo(branch.range.maxX, branch.range.minY);\n ctx.stroke();\n\n ctx.beginPath();\n ctx.moveTo(branch.range.maxX, branch.range.minY);\n ctx.lineTo(branch.range.maxX, branch.range.maxY);\n ctx.stroke();\n\n ctx.beginPath();\n ctx.moveTo(branch.range.maxX, branch.range.maxY);\n ctx.lineTo(branch.range.minX, branch.range.maxY);\n ctx.stroke();\n\n ctx.beginPath();\n ctx.moveTo(branch.range.minX, branch.range.maxY);\n ctx.lineTo(branch.range.minX, branch.range.minY);\n ctx.stroke();\n\n /*\n if (branch.mass > 0) {\n ctx.circle(branch.centerOfMass.x, branch.centerOfMass.y, 3*branch.mass);\n ctx.stroke();\n }\n */\n }\n}\n\n\nexport default BarnesHutSolver;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/physics/BarnesHutSolver.js","class RepulsionSolver {\n constructor(body, physicsBody, options) {\n this.body = body;\n this.physicsBody = physicsBody;\n this.setOptions(options);\n }\n\n setOptions(options) {\n this.options = options;\n }\n /**\n * Calculate the forces the nodes apply on each other based on a repulsion field.\n * This field is linearly approximated.\n *\n * @private\n */\n solve() {\n var dx, dy, distance, fx, fy, repulsingForce, node1, node2;\n\n var nodes = this.body.nodes;\n var nodeIndices = this.physicsBody.physicsNodeIndices;\n var forces = this.physicsBody.forces;\n\n // repulsing forces between nodes\n var nodeDistance = this.options.nodeDistance;\n\n // approximation constants\n var a = (-2 / 3) / nodeDistance;\n var b = 4 / 3;\n\n // we loop from i over all but the last entree in the array\n // j loops from i+1 to the last. This way we do not double count any of the indices, nor i === j\n for (let i = 0; i < nodeIndices.length - 1; i++) {\n node1 = nodes[nodeIndices[i]];\n for (let j = i + 1; j < nodeIndices.length; j++) {\n node2 = nodes[nodeIndices[j]];\n\n dx = node2.x - node1.x;\n dy = node2.y - node1.y;\n distance = Math.sqrt(dx * dx + dy * dy);\n\n // same condition as BarnesHutSolver, making sure nodes are never 100% overlapping.\n if (distance === 0) {\n distance = 0.1*Math.random();\n dx = distance;\n }\n\n if (distance < 2 * nodeDistance) {\n if (distance < 0.5 * nodeDistance) {\n repulsingForce = 1.0;\n }\n else {\n repulsingForce = a * distance + b; // linear approx of 1 / (1 + Math.exp((distance / nodeDistance - 1) * steepness))\n }\n repulsingForce = repulsingForce / distance;\n\n fx = dx * repulsingForce;\n fy = dy * repulsingForce;\n\n forces[node1.id].x -= fx;\n forces[node1.id].y -= fy;\n forces[node2.id].x += fx;\n forces[node2.id].y += fy;\n }\n }\n }\n }\n}\n\n\nexport default RepulsionSolver;\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/physics/RepulsionSolver.js","class HierarchicalRepulsionSolver {\n constructor(body, physicsBody, options) {\n this.body = body;\n this.physicsBody = physicsBody;\n this.setOptions(options);\n }\n\n setOptions(options) {\n this.options = options;\n }\n\n /**\n * Calculate the forces the nodes apply on each other based on a repulsion field.\n * This field is linearly approximated.\n *\n * @private\n */\n solve() {\n var dx, dy, distance, fx, fy, repulsingForce, node1, node2, i, j;\n\n var nodes = this.body.nodes;\n var nodeIndices = this.physicsBody.physicsNodeIndices;\n var forces = this.physicsBody.forces;\n\n // repulsing forces between nodes\n var nodeDistance = this.options.nodeDistance;\n\n // we loop from i over all but the last entree in the array\n // j loops from i+1 to the last. This way we do not double count any of the indices, nor i === j\n for (i = 0; i < nodeIndices.length - 1; i++) {\n node1 = nodes[nodeIndices[i]];\n for (j = i + 1; j < nodeIndices.length; j++) {\n node2 = nodes[nodeIndices[j]];\n\n // nodes only affect nodes on their level\n if (node1.level === node2.level) {\n dx = node2.x - node1.x;\n dy = node2.y - node1.y;\n distance = Math.sqrt(dx * dx + dy * dy);\n\n var steepness = 0.05;\n if (distance < nodeDistance) {\n repulsingForce = -Math.pow(steepness * distance, 2) + Math.pow(steepness * nodeDistance, 2);\n }\n else {\n repulsingForce = 0;\n }\n // normalize force with\n if (distance === 0) {\n distance = 0.01;\n }\n else {\n repulsingForce = repulsingForce / distance;\n }\n fx = dx * repulsingForce;\n fy = dy * repulsingForce;\n\n forces[node1.id].x -= fx;\n forces[node1.id].y -= fy;\n forces[node2.id].x += fx;\n forces[node2.id].y += fy;\n }\n }\n }\n }\n}\n\n\nexport default HierarchicalRepulsionSolver;\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/physics/HierarchicalRepulsionSolver.js","class SpringSolver {\n constructor(body, physicsBody, options) {\n this.body = body;\n this.physicsBody = physicsBody;\n this.setOptions(options);\n }\n\n setOptions(options) {\n this.options = options;\n }\n\n /**\n * This function calculates the springforces on the nodes, accounting for the support nodes.\n *\n * @private\n */\n solve() {\n let edgeLength, edge;\n let edgeIndices = this.physicsBody.physicsEdgeIndices;\n let edges = this.body.edges;\n let node1, node2, node3;\n\n // forces caused by the edges, modelled as springs\n for (let i = 0; i < edgeIndices.length; i++) {\n edge = edges[edgeIndices[i]];\n if (edge.connected === true && edge.toId !== edge.fromId) {\n // only calculate forces if nodes are in the same sector\n if (this.body.nodes[edge.toId] !== undefined && this.body.nodes[edge.fromId] !== undefined) {\n if (edge.edgeType.via !== undefined) {\n edgeLength = edge.options.length === undefined ? this.options.springLength : edge.options.length;\n node1 = edge.to;\n node2 = edge.edgeType.via;\n node3 = edge.from;\n\n this._calculateSpringForce(node1, node2, 0.5 * edgeLength);\n this._calculateSpringForce(node2, node3, 0.5 * edgeLength);\n }\n else {\n // the * 1.5 is here so the edge looks as large as a smooth edge. It does not initially because the smooth edges use\n // the support nodes which exert a repulsive force on the to and from nodes, making the edge appear larger.\n edgeLength = edge.options.length === undefined ? this.options.springLength * 1.5: edge.options.length;\n this._calculateSpringForce(edge.from, edge.to, edgeLength);\n }\n }\n }\n }\n }\n\n\n /**\n * This is the code actually performing the calculation for the function above.\n *\n * @param node1\n * @param node2\n * @param edgeLength\n * @private\n */\n _calculateSpringForce(node1, node2, edgeLength) {\n let dx = (node1.x - node2.x);\n let dy = (node1.y - node2.y);\n let distance = Math.max(Math.sqrt(dx * dx + dy * dy),0.01);\n\n // the 1/distance is so the fx and fy can be calculated without sine or cosine.\n let springForce = this.options.springConstant * (edgeLength - distance) / distance;\n\n let fx = dx * springForce;\n let fy = dy * springForce;\n\n // handle the case where one node is not part of the physcis\n if (this.physicsBody.forces[node1.id] !== undefined) {\n this.physicsBody.forces[node1.id].x += fx;\n this.physicsBody.forces[node1.id].y += fy;\n }\n\n if (this.physicsBody.forces[node2.id] !== undefined) {\n this.physicsBody.forces[node2.id].x -= fx;\n this.physicsBody.forces[node2.id].y -= fy;\n }\n }\n}\n\nexport default SpringSolver;\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/physics/SpringSolver.js","class HierarchicalSpringSolver {\n constructor(body, physicsBody, options) {\n this.body = body;\n this.physicsBody = physicsBody;\n this.setOptions(options);\n }\n\n setOptions(options) {\n this.options = options;\n }\n\n /**\n * This function calculates the springforces on the nodes, accounting for the support nodes.\n *\n * @private\n */\n solve() {\n var edgeLength, edge;\n var dx, dy, fx, fy, springForce, distance;\n var edges = this.body.edges;\n var factor = 0.5;\n\n var edgeIndices = this.physicsBody.physicsEdgeIndices;\n var nodeIndices = this.physicsBody.physicsNodeIndices;\n var forces = this.physicsBody.forces;\n\n // initialize the spring force counters\n for (let i = 0; i < nodeIndices.length; i++) {\n let nodeId = nodeIndices[i];\n forces[nodeId].springFx = 0;\n forces[nodeId].springFy = 0;\n }\n\n\n // forces caused by the edges, modelled as springs\n for (let i = 0; i < edgeIndices.length; i++) {\n edge = edges[edgeIndices[i]];\n if (edge.connected === true) {\n edgeLength = edge.options.length === undefined ? this.options.springLength : edge.options.length;\n\n dx = (edge.from.x - edge.to.x);\n dy = (edge.from.y - edge.to.y);\n distance = Math.sqrt(dx * dx + dy * dy);\n distance = distance === 0 ? 0.01 : distance;\n\n // the 1/distance is so the fx and fy can be calculated without sine or cosine.\n springForce = this.options.springConstant * (edgeLength - distance) / distance;\n\n fx = dx * springForce;\n fy = dy * springForce;\n\n if (edge.to.level != edge.from.level) {\n if (forces[edge.toId] !== undefined) {\n forces[edge.toId].springFx -= fx;\n forces[edge.toId].springFy -= fy;\n }\n if (forces[edge.fromId] !== undefined) {\n forces[edge.fromId].springFx += fx;\n forces[edge.fromId].springFy += fy;\n }\n }\n else {\n if (forces[edge.toId] !== undefined) {\n forces[edge.toId].x -= factor * fx;\n forces[edge.toId].y -= factor * fy;\n }\n if (forces[edge.fromId] !== undefined) {\n forces[edge.fromId].x += factor * fx;\n forces[edge.fromId].y += factor * fy;\n }\n }\n }\n }\n\n // normalize spring forces\n var springForce = 1;\n var springFx, springFy;\n for (let i = 0; i < nodeIndices.length; i++) {\n let nodeId = nodeIndices[i];\n springFx = Math.min(springForce,Math.max(-springForce,forces[nodeId].springFx));\n springFy = Math.min(springForce,Math.max(-springForce,forces[nodeId].springFy));\n\n forces[nodeId].x += springFx;\n forces[nodeId].y += springFy;\n }\n\n // retain energy balance\n var totalFx = 0;\n var totalFy = 0;\n for (let i = 0; i < nodeIndices.length; i++) {\n let nodeId = nodeIndices[i];\n totalFx += forces[nodeId].x;\n totalFy += forces[nodeId].y;\n }\n var correctionFx = totalFx / nodeIndices.length;\n var correctionFy = totalFy / nodeIndices.length;\n\n for (let i = 0; i < nodeIndices.length; i++) {\n let nodeId = nodeIndices[i];\n forces[nodeId].x -= correctionFx;\n forces[nodeId].y -= correctionFy;\n }\n }\n\n}\n\nexport default HierarchicalSpringSolver;\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/physics/HierarchicalSpringSolver.js","class CentralGravitySolver {\n constructor(body, physicsBody, options) {\n this.body = body;\n this.physicsBody = physicsBody;\n this.setOptions(options);\n }\n\n setOptions(options) {\n this.options = options;\n }\n\n solve() {\n let dx, dy, distance, node;\n let nodes = this.body.nodes;\n let nodeIndices = this.physicsBody.physicsNodeIndices;\n let forces = this.physicsBody.forces;\n\n for (let i = 0; i < nodeIndices.length; i++) {\n let nodeId = nodeIndices[i];\n node = nodes[nodeId];\n dx = -node.x;\n dy = -node.y;\n distance = Math.sqrt(dx * dx + dy * dy);\n\n this._calculateForces(distance, dx, dy, forces, node);\n }\n }\n\n /**\n * Calculate the forces based on the distance.\n * @private\n */\n _calculateForces(distance, dx, dy, forces, node) {\n let gravityForce = (distance === 0) ? 0 : (this.options.centralGravity / distance);\n forces[node.id].x = dx * gravityForce;\n forces[node.id].y = dy * gravityForce;\n }\n}\n\n\nexport default CentralGravitySolver;\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/physics/CentralGravitySolver.js","import BarnesHutSolver from \"./BarnesHutSolver\"\n\nclass ForceAtlas2BasedRepulsionSolver extends BarnesHutSolver {\n constructor(body, physicsBody, options) {\n super(body, physicsBody, options);\n }\n\n /**\n * Calculate the forces based on the distance.\n *\n * @param distance\n * @param dx\n * @param dy\n * @param node\n * @param parentBranch\n * @private\n */\n _calculateForces(distance, dx, dy, node, parentBranch) {\n if (distance === 0) {\n distance = 0.1 * Math.random();\n dx = distance;\n }\n\n if (this.overlapAvoidanceFactor < 1 && node.shape.radius) {\n distance = Math.max(0.1 + (this.overlapAvoidanceFactor * node.shape.radius), distance - node.shape.radius);\n }\n\n let degree = (node.edges.length + 1);\n // the dividing by the distance cubed instead of squared allows us to get the fx and fy components without sines and cosines\n // it is shorthand for gravityforce with distance squared and fx = dx/distance * gravityForce\n let gravityForce = this.options.gravitationalConstant * parentBranch.mass * node.options.mass * degree / Math.pow(distance,2);\n let fx = dx * gravityForce;\n let fy = dy * gravityForce;\n\n this.physicsBody.forces[node.id].x += fx;\n this.physicsBody.forces[node.id].y += fy;\n }\n}\n\nexport default ForceAtlas2BasedRepulsionSolver;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/physics/FA2BasedRepulsionSolver.js","import CentralGravitySolver from \"./CentralGravitySolver\"\n\nclass ForceAtlas2BasedCentralGravitySolver extends CentralGravitySolver {\n constructor(body, physicsBody, options) {\n super(body, physicsBody, options);\n }\n\n\n /**\n * Calculate the forces based on the distance.\n * @private\n */\n _calculateForces(distance, dx, dy, forces, node) {\n if (distance > 0) {\n let degree = (node.edges.length + 1);\n let gravityForce = this.options.centralGravity * degree * node.options.mass;\n forces[node.id].x = dx * gravityForce;\n forces[node.id].y = dy * gravityForce;\n }\n }\n}\n\nexport default ForceAtlas2BasedCentralGravitySolver;\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/physics/FA2BasedCentralGravitySolver.js","let util = require(\"../../util\");\nimport NetworkUtil from '../NetworkUtil';\nimport Cluster from './components/nodes/Cluster'\n\nclass ClusterEngine {\n constructor(body) {\n this.body = body;\n this.clusteredNodes = {};\n this.clusteredEdges = {};\n\n this.options = {};\n this.defaultOptions = {};\n util.extend(this.options, this.defaultOptions);\n\n this.body.emitter.on('_resetData', () => {this.clusteredNodes = {}; this.clusteredEdges = {};})\n }\n\n /**\n *\n * @param hubsize\n * @param options\n */\n clusterByHubsize(hubsize, options) {\n if (hubsize === undefined) {\n hubsize = this._getHubSize();\n }\n else if (typeof(hubsize) === \"object\") {\n options = this._checkOptions(hubsize);\n hubsize = this._getHubSize();\n }\n\n let nodesToCluster = [];\n for (let i = 0; i < this.body.nodeIndices.length; i++) {\n let node = this.body.nodes[this.body.nodeIndices[i]];\n if (node.edges.length >= hubsize) {\n nodesToCluster.push(node.id);\n }\n }\n\n for (let i = 0; i < nodesToCluster.length; i++) {\n this.clusterByConnection(nodesToCluster[i],options,true);\n }\n\n this.body.emitter.emit('_dataChanged');\n }\n\n\n /**\n * loop over all nodes, check if they adhere to the condition and cluster if needed.\n * @param options\n * @param refreshData\n */\n cluster(options = {}, refreshData = true) {\n if (options.joinCondition === undefined) {throw new Error(\"Cannot call clusterByNodeData without a joinCondition function in the options.\");}\n\n // check if the options object is fine, append if needed\n options = this._checkOptions(options);\n\n let childNodesObj = {};\n let childEdgesObj = {};\n\n // collect the nodes that will be in the cluster\n for (let i = 0; i < this.body.nodeIndices.length; i++) {\n let nodeId = this.body.nodeIndices[i];\n let node = this.body.nodes[nodeId];\n let clonedOptions = NetworkUtil.cloneOptions(node);\n if (options.joinCondition(clonedOptions) === true) {\n childNodesObj[nodeId] = this.body.nodes[nodeId];\n\n // collect the nodes that will be in the cluster\n for (let i = 0; i < node.edges.length; i++) {\n let edge = node.edges[i];\n if (this.clusteredEdges[edge.id] === undefined) {\n childEdgesObj[edge.id] = edge;\n }\n }\n }\n }\n\n this._cluster(childNodesObj, childEdgesObj, options, refreshData);\n }\n\n\n /**\n * Cluster all nodes in the network that have only X edges\n * @param edgeCount\n * @param options\n * @param refreshData\n */\n clusterByEdgeCount(edgeCount, options, refreshData = true) {\n options = this._checkOptions(options);\n let clusters = [];\n let usedNodes = {};\n let edge, edges, node, nodeId, relevantEdgeCount;\n // collect the nodes that will be in the cluster\n for (let i = 0; i < this.body.nodeIndices.length; i++) {\n let childNodesObj = {};\n let childEdgesObj = {};\n nodeId = this.body.nodeIndices[i];\n\n // if this node is already used in another cluster this session, we do not have to re-evaluate it.\n if (usedNodes[nodeId] === undefined) {\n relevantEdgeCount = 0;\n node = this.body.nodes[nodeId];\n edges = [];\n for (let j = 0; j < node.edges.length; j++) {\n edge = node.edges[j];\n if (this.clusteredEdges[edge.id] === undefined) {\n if (edge.toId !== edge.fromId) {\n relevantEdgeCount++;\n }\n edges.push(edge);\n }\n }\n\n // this node qualifies, we collect its neighbours to start the clustering process.\n if (relevantEdgeCount === edgeCount) {\n let gatheringSuccessful = true;\n for (let j = 0; j < edges.length; j++) {\n edge = edges[j];\n let childNodeId = this._getConnectedId(edge, nodeId);\n // add the nodes to the list by the join condition.\n if (options.joinCondition === undefined) {\n childEdgesObj[edge.id] = edge;\n childNodesObj[nodeId] = this.body.nodes[nodeId];\n childNodesObj[childNodeId] = this.body.nodes[childNodeId];\n usedNodes[nodeId] = true;\n }\n else {\n let clonedOptions = NetworkUtil.cloneOptions(this.body.nodes[nodeId]);\n if (options.joinCondition(clonedOptions) === true) {\n childEdgesObj[edge.id] = edge;\n childNodesObj[nodeId] = this.body.nodes[nodeId];\n usedNodes[nodeId] = true;\n }\n else {\n // this node does not qualify after all.\n gatheringSuccessful = false;\n break;\n }\n }\n }\n\n // add to the cluster queue\n if (Object.keys(childNodesObj).length > 0 && Object.keys(childEdgesObj).length > 0 && gatheringSuccessful === true) {\n clusters.push({nodes: childNodesObj, edges: childEdgesObj})\n }\n }\n }\n }\n\n for (let i = 0; i < clusters.length; i++) {\n this._cluster(clusters[i].nodes, clusters[i].edges, options, false)\n }\n\n if (refreshData === true) {\n this.body.emitter.emit('_dataChanged');\n }\n }\n\n /**\n * Cluster all nodes in the network that have only 1 edge\n * @param options\n * @param refreshData\n */\n clusterOutliers(options, refreshData = true) {\n this.clusterByEdgeCount(1,options,refreshData);\n }\n\n /**\n * Cluster all nodes in the network that have only 2 edge\n * @param options\n * @param refreshData\n */\n clusterBridges(options, refreshData = true) {\n this.clusterByEdgeCount(2,options,refreshData);\n }\n\n\n\n /**\n * suck all connected nodes of a node into the node.\n * @param nodeId\n * @param options\n * @param refreshData\n */\n clusterByConnection(nodeId, options, refreshData = true) {\n // kill conditions\n if (nodeId === undefined) {throw new Error(\"No nodeId supplied to clusterByConnection!\");}\n if (this.body.nodes[nodeId] === undefined) {throw new Error(\"The nodeId given to clusterByConnection does not exist!\");}\n\n let node = this.body.nodes[nodeId];\n options = this._checkOptions(options, node);\n if (options.clusterNodeProperties.x === undefined) {options.clusterNodeProperties.x = node.x;}\n if (options.clusterNodeProperties.y === undefined) {options.clusterNodeProperties.y = node.y;}\n if (options.clusterNodeProperties.fixed === undefined) {\n options.clusterNodeProperties.fixed = {};\n options.clusterNodeProperties.fixed.x = node.options.fixed.x;\n options.clusterNodeProperties.fixed.y = node.options.fixed.y;\n }\n\n\n let childNodesObj = {};\n let childEdgesObj = {};\n let parentNodeId = node.id;\n let parentClonedOptions = NetworkUtil.cloneOptions(node);\n childNodesObj[parentNodeId] = node;\n\n // collect the nodes that will be in the cluster\n for (let i = 0; i < node.edges.length; i++) {\n let edge = node.edges[i];\n if (this.clusteredEdges[edge.id] === undefined) {\n let childNodeId = this._getConnectedId(edge, parentNodeId);\n\n // if the child node is not in a cluster\n if (this.clusteredNodes[childNodeId] === undefined) {\n if (childNodeId !== parentNodeId) {\n if (options.joinCondition === undefined) {\n childEdgesObj[edge.id] = edge;\n childNodesObj[childNodeId] = this.body.nodes[childNodeId];\n }\n else {\n // clone the options and insert some additional parameters that could be interesting.\n let childClonedOptions = NetworkUtil.cloneOptions(this.body.nodes[childNodeId]);\n if (options.joinCondition(parentClonedOptions, childClonedOptions) === true) {\n childEdgesObj[edge.id] = edge;\n childNodesObj[childNodeId] = this.body.nodes[childNodeId];\n }\n }\n }\n else {\n // swallow the edge if it is self-referencing.\n childEdgesObj[edge.id] = edge;\n }\n }\n }\n }\n var childNodeIDs = Object.keys(childNodesObj).map(function(childNode){\n return childNodesObj[childNode].id;\n })\n\n for (childNode in childNodesObj) {\n var childNode = childNodesObj[childNode];\n for (var y=0; y < childNode.edges.length; y++){\n var childEdge = childNode.edges[y];\n if (childNodeIDs.indexOf(this._getConnectedId(childEdge,childNode.id)) > -1){\n childEdgesObj[childEdge.id] = childEdge;\n }\n }\n }\n this._cluster(childNodesObj, childEdgesObj, options, refreshData);\n }\n\n\n /**\n * This function creates the edges that will be attached to the cluster\n * It looks for edges that are connected to the nodes from the \"outside' of the cluster.\n *\n * @param childNodesObj\n * @param childEdgesObj\n * @param clusterNodeProperties\n * @param clusterEdgeProperties\n * @private\n */\n _createClusterEdges (childNodesObj, childEdgesObj, clusterNodeProperties, clusterEdgeProperties) {\n let edge, childNodeId, childNode, toId, fromId, otherNodeId;\n\n // loop over all child nodes and their edges to find edges going out of the cluster\n // these edges will be replaced by clusterEdges.\n let childKeys = Object.keys(childNodesObj);\n let createEdges = [];\n for (let i = 0; i < childKeys.length; i++) {\n childNodeId = childKeys[i];\n childNode = childNodesObj[childNodeId];\n\n // construct new edges from the cluster to others\n for (let j = 0; j < childNode.edges.length; j++) {\n edge = childNode.edges[j];\n // we only handle edges that are visible to the system, not the disabled ones from the clustering process.\n if (this.clusteredEdges[edge.id] === undefined) {\n // self-referencing edges will be added to the \"hidden\" list\n if (edge.toId == edge.fromId) {\n childEdgesObj[edge.id] = edge;\n }\n else {\n // set up the from and to.\n if (edge.toId == childNodeId) { // this is a double equals because ints and strings can be interchanged here.\n toId = clusterNodeProperties.id;\n fromId = edge.fromId;\n otherNodeId = fromId;\n }\n else {\n toId = edge.toId;\n fromId = clusterNodeProperties.id;\n otherNodeId = toId;\n }\n }\n\n // Only edges from the cluster outwards are being replaced.\n if (childNodesObj[otherNodeId] === undefined) {\n createEdges.push({edge: edge, fromId: fromId, toId: toId});\n }\n }\n }\n }\n\n // here we actually create the replacement edges. We could not do this in the loop above as the creation process\n // would add an edge to the edges array we are iterating over.\n for (let j = 0; j < createEdges.length; j++) {\n let edge = createEdges[j].edge;\n // copy the options of the edge we will replace\n let clonedOptions = NetworkUtil.cloneOptions(edge, 'edge');\n // make sure the properties of clusterEdges are superimposed on it\n util.deepExtend(clonedOptions, clusterEdgeProperties);\n\n // set up the edge\n clonedOptions.from = createEdges[j].fromId;\n clonedOptions.to = createEdges[j].toId;\n clonedOptions.id = 'clusterEdge:' + util.randomUUID();\n //clonedOptions.id = '(cf: ' + createEdges[j].fromId + \" to: \" + createEdges[j].toId + \")\" + Math.random();\n\n // create the edge and give a reference to the one it replaced.\n let newEdge = this.body.functions.createEdge(clonedOptions);\n newEdge.clusteringEdgeReplacingId = edge.id;\n\n // also reference the new edge in the old edge\n this.body.edges[edge.id].edgeReplacedById = newEdge.id;\n\n // connect the edge.\n this.body.edges[newEdge.id] = newEdge;\n newEdge.connect();\n\n // hide the replaced edge\n this._backupEdgeOptions(edge);\n edge.setOptions({physics:false, hidden:true});\n }\n\n }\n\n /**\n * This function checks the options that can be supplied to the different cluster functions\n * for certain fields and inserts defaults if needed\n * @param options\n * @returns {*}\n * @private\n */\n _checkOptions(options = {}) {\n if (options.clusterEdgeProperties === undefined) {options.clusterEdgeProperties = {};}\n if (options.clusterNodeProperties === undefined) {options.clusterNodeProperties = {};}\n\n return options;\n }\n\n /**\n *\n * @param {Object} childNodesObj | object with node objects, id as keys, same as childNodes except it also contains a source node\n * @param {Object} childEdgesObj | object with edge objects, id as keys\n * @param {Array} options | object with {clusterNodeProperties, clusterEdgeProperties, processProperties}\n * @param {Boolean} refreshData | when true, do not wrap up\n * @private\n */\n _cluster(childNodesObj, childEdgesObj, options, refreshData = true) {\n // kill condition: no nodes don't bother\n if (Object.keys(childNodesObj).length == 0) {return;}\n\n // allow clusters of 1 if options allow\n if (Object.keys(childNodesObj).length == 1 && options.clusterNodeProperties.allowSingleNodeCluster != true) {return;}\n\n // check if this cluster call is not trying to cluster anything that is in another cluster.\n for (let nodeId in childNodesObj) {\n if (childNodesObj.hasOwnProperty(nodeId)) {\n if (this.clusteredNodes[nodeId] !== undefined) {\n return;\n }\n }\n }\n\n let clusterNodeProperties = util.deepExtend({},options.clusterNodeProperties);\n\n // construct the clusterNodeProperties\n if (options.processProperties !== undefined) {\n // get the childNode options\n let childNodesOptions = [];\n for (let nodeId in childNodesObj) {\n if (childNodesObj.hasOwnProperty(nodeId)) {\n let clonedOptions = NetworkUtil.cloneOptions(childNodesObj[nodeId]);\n childNodesOptions.push(clonedOptions);\n }\n }\n\n // get cluster properties based on childNodes\n let childEdgesOptions = [];\n for (let edgeId in childEdgesObj) {\n if (childEdgesObj.hasOwnProperty(edgeId)) {\n // these cluster edges will be removed on creation of the cluster.\n if (edgeId.substr(0, 12) !== \"clusterEdge:\") {\n let clonedOptions = NetworkUtil.cloneOptions(childEdgesObj[edgeId], 'edge');\n childEdgesOptions.push(clonedOptions);\n }\n }\n }\n\n clusterNodeProperties = options.processProperties(clusterNodeProperties, childNodesOptions, childEdgesOptions);\n if (!clusterNodeProperties) {\n throw new Error(\"The processProperties function does not return properties!\");\n }\n }\n\n // check if we have an unique id;\n if (clusterNodeProperties.id === undefined) {clusterNodeProperties.id = 'cluster:' + util.randomUUID();}\n let clusterId = clusterNodeProperties.id;\n\n if (clusterNodeProperties.label === undefined) {\n clusterNodeProperties.label = 'cluster';\n }\n\n\n // give the clusterNode a position if it does not have one.\n let pos = undefined;\n if (clusterNodeProperties.x === undefined) {\n pos = this._getClusterPosition(childNodesObj);\n clusterNodeProperties.x = pos.x;\n }\n if (clusterNodeProperties.y === undefined) {\n if (pos === undefined) {pos = this._getClusterPosition(childNodesObj);}\n clusterNodeProperties.y = pos.y;\n }\n\n // force the ID to remain the same\n clusterNodeProperties.id = clusterId;\n\n // create the clusterNode\n let clusterNode = this.body.functions.createNode(clusterNodeProperties, Cluster);\n clusterNode.isCluster = true;\n clusterNode.containedNodes = childNodesObj;\n clusterNode.containedEdges = childEdgesObj;\n // cache a copy from the cluster edge properties if we have to reconnect others later on\n clusterNode.clusterEdgeProperties = options.clusterEdgeProperties;\n\n // finally put the cluster node into global\n this.body.nodes[clusterNodeProperties.id] = clusterNode;\n\n // create the new edges that will connect to the cluster, all self-referencing edges will be added to childEdgesObject here.\n this._createClusterEdges(childNodesObj, childEdgesObj, clusterNodeProperties, options.clusterEdgeProperties);\n\n // disable the childEdges\n for (let edgeId in childEdgesObj) {\n if (childEdgesObj.hasOwnProperty(edgeId)) {\n if (this.body.edges[edgeId] !== undefined) {\n let edge = this.body.edges[edgeId];\n // cache the options before changing\n this._backupEdgeOptions(edge);\n // disable physics and hide the edge\n edge.setOptions({physics:false, hidden:true});\n }\n }\n }\n\n // disable the childNodes\n for (let nodeId in childNodesObj) {\n if (childNodesObj.hasOwnProperty(nodeId)) {\n this.clusteredNodes[nodeId] = {clusterId:clusterNodeProperties.id, node: this.body.nodes[nodeId]};\n this.body.nodes[nodeId].setOptions({hidden:true, physics:false});\n }\n }\n\n // set ID to undefined so no duplicates arise\n clusterNodeProperties.id = undefined;\n\n // wrap up\n if (refreshData === true) {\n this.body.emitter.emit('_dataChanged');\n }\n }\n\n _backupEdgeOptions(edge) {\n if (this.clusteredEdges[edge.id] === undefined) {\n this.clusteredEdges[edge.id] = {physics: edge.options.physics, hidden: edge.options.hidden};\n }\n }\n\n _restoreEdge(edge) {\n let originalOptions = this.clusteredEdges[edge.id];\n if (originalOptions !== undefined) {\n edge.setOptions({physics: originalOptions.physics, hidden: originalOptions.hidden});\n delete this.clusteredEdges[edge.id];\n }\n }\n\n\n /**\n * Check if a node is a cluster.\n * @param nodeId\n * @returns {*}\n */\n isCluster(nodeId) {\n if (this.body.nodes[nodeId] !== undefined) {\n return this.body.nodes[nodeId].isCluster === true;\n }\n else {\n console.log(\"Node does not exist.\");\n return false;\n }\n }\n\n /**\n * get the position of the cluster node based on what's inside\n * @param {object} childNodesObj | object with node objects, id as keys\n * @returns {{x: number, y: number}}\n * @private\n */\n _getClusterPosition(childNodesObj) {\n let childKeys = Object.keys(childNodesObj);\n let minX = childNodesObj[childKeys[0]].x;\n let maxX = childNodesObj[childKeys[0]].x;\n let minY = childNodesObj[childKeys[0]].y;\n let maxY = childNodesObj[childKeys[0]].y;\n let node;\n for (let i = 1; i < childKeys.length; i++) {\n node = childNodesObj[childKeys[i]];\n minX = node.x < minX ? node.x : minX;\n maxX = node.x > maxX ? node.x : maxX;\n minY = node.y < minY ? node.y : minY;\n maxY = node.y > maxY ? node.y : maxY;\n }\n\n\n return {x: 0.5*(minX + maxX), y: 0.5*(minY + maxY)};\n }\n\n\n\n /**\n * Open a cluster by calling this function.\n * @param {String} clusterNodeId | the ID of the cluster node\n * @param {Boolean} refreshData | wrap up afterwards if not true\n */\n openCluster(clusterNodeId, options, refreshData = true) {\n // kill conditions\n if (clusterNodeId === undefined) {throw new Error(\"No clusterNodeId supplied to openCluster.\");}\n if (this.body.nodes[clusterNodeId] === undefined) {throw new Error(\"The clusterNodeId supplied to openCluster does not exist.\");}\n if (this.body.nodes[clusterNodeId].containedNodes === undefined) {\n console.log(\"The node:\" + clusterNodeId + \" is not a cluster.\");\n return\n }\n let clusterNode = this.body.nodes[clusterNodeId];\n let containedNodes = clusterNode.containedNodes;\n let containedEdges = clusterNode.containedEdges;\n\n // allow the user to position the nodes after release.\n if (options !== undefined && options.releaseFunction !== undefined && typeof options.releaseFunction === 'function') {\n let positions = {};\n let clusterPosition = {x:clusterNode.x, y:clusterNode.y};\n for (let nodeId in containedNodes) {\n if (containedNodes.hasOwnProperty(nodeId)) {\n let containedNode = this.body.nodes[nodeId];\n positions[nodeId] = {x: containedNode.x, y: containedNode.y};\n }\n }\n let newPositions = options.releaseFunction(clusterPosition, positions);\n\n for (let nodeId in containedNodes) {\n if (containedNodes.hasOwnProperty(nodeId)) {\n let containedNode = this.body.nodes[nodeId];\n if (newPositions[nodeId] !== undefined) {\n containedNode.x = (newPositions[nodeId].x === undefined ? clusterNode.x : newPositions[nodeId].x);\n containedNode.y = (newPositions[nodeId].y === undefined ? clusterNode.y : newPositions[nodeId].y);\n }\n }\n }\n }\n else {\n // copy the position from the cluster\n for (let nodeId in containedNodes) {\n if (containedNodes.hasOwnProperty(nodeId)) {\n let containedNode = this.body.nodes[nodeId];\n containedNode = containedNodes[nodeId];\n // inherit position\n if (containedNode.options.fixed.x === false) {containedNode.x = clusterNode.x;}\n if (containedNode.options.fixed.y === false) {containedNode.y = clusterNode.y;}\n }\n }\n }\n\n // release nodes\n for (let nodeId in containedNodes) {\n if (containedNodes.hasOwnProperty(nodeId)) {\n let containedNode = this.body.nodes[nodeId];\n\n // inherit speed\n containedNode.vx = clusterNode.vx;\n containedNode.vy = clusterNode.vy;\n\n // we use these methods to avoid re-instantiating the shape, which happens with setOptions.\n containedNode.setOptions({hidden:false, physics:true});\n\n delete this.clusteredNodes[nodeId];\n }\n }\n\n // copy the clusterNode edges because we cannot iterate over an object that we add or remove from.\n let edgesToBeDeleted = [];\n for (let i = 0; i < clusterNode.edges.length; i++) {\n edgesToBeDeleted.push(clusterNode.edges[i]);\n }\n\n // actually handling the deleting.\n for (let i = 0; i < edgesToBeDeleted.length; i++) {\n let edge = edgesToBeDeleted[i];\n\n let otherNodeId = this._getConnectedId(edge, clusterNodeId);\n // if the other node is in another cluster, we transfer ownership of this edge to the other cluster\n if (this.clusteredNodes[otherNodeId] !== undefined) {\n // transfer ownership:\n let otherCluster = this.body.nodes[this.clusteredNodes[otherNodeId].clusterId];\n let transferEdge = this.body.edges[edge.clusteringEdgeReplacingId];\n if (transferEdge !== undefined) {\n otherCluster.containedEdges[transferEdge.id] = transferEdge;\n\n // delete local reference\n delete containedEdges[transferEdge.id];\n\n // create new cluster edge from the otherCluster:\n // get to and from\n let fromId = transferEdge.fromId;\n let toId = transferEdge.toId;\n if (transferEdge.toId == otherNodeId) {\n toId = this.clusteredNodes[otherNodeId].clusterId;\n }\n else {\n fromId = this.clusteredNodes[otherNodeId].clusterId;\n }\n\n // clone the options and apply the cluster options to them\n let clonedOptions = NetworkUtil.cloneOptions(transferEdge, 'edge');\n util.deepExtend(clonedOptions, otherCluster.clusterEdgeProperties);\n\n // apply the edge specific options to it.\n let id = 'clusterEdge:' + util.randomUUID();\n util.deepExtend(clonedOptions, {from: fromId, to: toId, hidden: false, physics: true, id: id});\n\n // create it\n let newEdge = this.body.functions.createEdge(clonedOptions);\n newEdge.clusteringEdgeReplacingId = transferEdge.id;\n this.body.edges[id] = newEdge;\n this.body.edges[id].connect();\n }\n }\n else {\n let replacedEdge = this.body.edges[edge.clusteringEdgeReplacingId];\n if (replacedEdge !== undefined) {\n this._restoreEdge(replacedEdge);\n }\n }\n edge.cleanup();\n // this removes the edge from node.edges, which is why edgeIds is formed\n edge.disconnect();\n delete this.body.edges[edge.id];\n }\n\n // handle the releasing of the edges\n for (let edgeId in containedEdges) {\n if (containedEdges.hasOwnProperty(edgeId)) {\n this._restoreEdge(containedEdges[edgeId]);\n }\n }\n\n // remove clusterNode\n delete this.body.nodes[clusterNodeId];\n\n if (refreshData === true) {\n this.body.emitter.emit('_dataChanged');\n }\n }\n\n getNodesInCluster(clusterId) {\n let nodesArray = [];\n if (this.isCluster(clusterId) === true) {\n let containedNodes = this.body.nodes[clusterId].containedNodes;\n for (let nodeId in containedNodes) {\n if (containedNodes.hasOwnProperty(nodeId)) {\n nodesArray.push(this.body.nodes[nodeId].id)\n }\n }\n }\n\n return nodesArray;\n }\n\n /**\n * Get the stack clusterId's that a certain node resides in. cluster A -> cluster B -> cluster C -> node\n * @param nodeId\n * @returns {Array}\n */\n findNode(nodeId) {\n let stack = [];\n let max = 100;\n let counter = 0;\n\n while (this.clusteredNodes[nodeId] !== undefined && counter < max) {\n stack.push(this.body.nodes[nodeId].id);\n nodeId = this.clusteredNodes[nodeId].clusterId;\n counter++;\n }\n stack.push(this.body.nodes[nodeId].id);\n stack.reverse();\n\n return stack;\n }\n\n /**\n * Using a clustered nodeId, update with the new options\n * @param clusteredNodeId\n * @param {object} newOptions\n */\n updateClusteredNode(clusteredNodeId, newOptions) {\n if (clusteredNodeId === undefined) {throw new Error(\"No clusteredNodeId supplied to updateClusteredNode.\");}\n if (newOptions === undefined) {throw new Error(\"No newOptions supplied to updateClusteredNode.\");}\n if (this.body.nodes[clusteredNodeId] === undefined) {throw new Error(\"The clusteredNodeId supplied to updateClusteredNode does not exist.\");}\n\n this.body.nodes[clusteredNodeId].setOptions(newOptions);\n this.body.emitter.emit('_dataChanged');\n }\n\n /**\n * Using a base edgeId, update all related clustered edges with the new options\n * @param startEdgeId\n * @param {object} newOptions\n */\n updateEdge(startEdgeId, newOptions) {\n if (startEdgeId === undefined) {throw new Error(\"No startEdgeId supplied to updateEdge.\");}\n if (newOptions === undefined) {throw new Error(\"No newOptions supplied to updateEdge.\");}\n if (this.body.edges[startEdgeId] === undefined) {throw new Error(\"The startEdgeId supplied to updateEdge does not exist.\");}\n\n let allEdgeIds = this.getClusteredEdges(startEdgeId);\n for (let i = 0; i < allEdgeIds.length; i++) {\n var edge = this.body.edges[allEdgeIds[i]];\n edge.setOptions(newOptions);\n }\n this.body.emitter.emit('_dataChanged');\n }\n\n /**\n * Get a stack of clusterEdgeId's (+base edgeid) that a base edge is the same as. cluster edge C -> cluster edge B -> cluster edge A -> base edge(edgeId)\n * @param edgeId\n * @returns {Array}\n */\n getClusteredEdges(edgeId) {\n let stack = [];\n let max = 100;\n let counter = 0;\n\n while (edgeId !== undefined && this.body.edges[edgeId] !== undefined && counter < max) {\n stack.push(this.body.edges[edgeId].id);\n edgeId = this.body.edges[edgeId].edgeReplacedById;\n counter++;\n }\n stack.reverse();\n return stack;\n }\n\n /**\n * Get the base edge id of clusterEdgeId. cluster edge (clusteredEdgeId) -> cluster edge B -> cluster edge C -> base edge\n * @param clusteredEdgeId\n * @returns baseEdgeId\n */\n getBaseEdge(clusteredEdgeId) {\n let baseEdgeId = clusteredEdgeId;\n let max = 100;\n let counter = 0;\n\n while (clusteredEdgeId !== undefined && this.body.edges[clusteredEdgeId] !== undefined && counter < max) {\n clusteredEdgeId = this.body.edges[clusteredEdgeId].clusteringEdgeReplacingId;\n counter++;\n if (clusteredEdgeId !== undefined) {\n baseEdgeId = clusteredEdgeId;\n }\n }\n return baseEdgeId;\n }\n\n /**\n * Get the Id the node is connected to\n * @param edge\n * @param nodeId\n * @returns {*}\n * @private\n */\n _getConnectedId(edge, nodeId) {\n if (edge.toId != nodeId) {\n return edge.toId;\n }\n else if (edge.fromId != nodeId) {\n return edge.fromId;\n }\n else {\n return edge.fromId;\n }\n }\n\n /**\n * We determine how many connections denote an important hub.\n * We take the mean + 2*std as the important hub size. (Assuming a normal distribution of data, ~2.2%)\n *\n * @private\n */\n _getHubSize() {\n let average = 0;\n let averageSquared = 0;\n let hubCounter = 0;\n let largestHub = 0;\n\n for (let i = 0; i < this.body.nodeIndices.length; i++) {\n let node = this.body.nodes[this.body.nodeIndices[i]];\n if (node.edges.length > largestHub) {\n largestHub = node.edges.length;\n }\n average += node.edges.length;\n averageSquared += Math.pow(node.edges.length,2);\n hubCounter += 1;\n }\n average = average / hubCounter;\n averageSquared = averageSquared / hubCounter;\n\n let variance = averageSquared - Math.pow(average,2);\n let standardDeviation = Math.sqrt(variance);\n\n let hubThreshold = Math.floor(average + 2*standardDeviation);\n\n // always have at least one to cluster\n if (hubThreshold > largestHub) {\n hubThreshold = largestHub;\n }\n\n return hubThreshold;\n };\n\n}\n\n\nexport default ClusterEngine;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/Clustering.js","let util = require(\"../util\");\nclass NetworkUtil {\n constructor() {}\n\n /**\n * Find the center position of the network considering the bounding boxes\n */\n static getRange(allNodes, specificNodes = []) {\n var minY = 1e9, maxY = -1e9, minX = 1e9, maxX = -1e9, node;\n if (specificNodes.length > 0) {\n for (var i = 0; i < specificNodes.length; i++) {\n node = allNodes[specificNodes[i]];\n if (minX > node.shape.boundingBox.left) {\n minX = node.shape.boundingBox.left;\n }\n if (maxX < node.shape.boundingBox.right) {\n maxX = node.shape.boundingBox.right;\n }\n if (minY > node.shape.boundingBox.top) {\n minY = node.shape.boundingBox.top;\n } // top is negative, bottom is positive\n if (maxY < node.shape.boundingBox.bottom) {\n maxY = node.shape.boundingBox.bottom;\n } // top is negative, bottom is positive\n }\n }\n\n if (minX === 1e9 && maxX === -1e9 && minY === 1e9 && maxY === -1e9) {\n minY = 0, maxY = 0, minX = 0, maxX = 0;\n }\n return {minX: minX, maxX: maxX, minY: minY, maxY: maxY};\n }\n\n /**\n * Find the center position of the network\n */\n static getRangeCore(allNodes, specificNodes = []) {\n var minY = 1e9, maxY = -1e9, minX = 1e9, maxX = -1e9, node;\n if (specificNodes.length > 0) {\n for (var i = 0; i < specificNodes.length; i++) {\n node = allNodes[specificNodes[i]];\n if (minX > node.x) {\n minX = node.x;\n }\n if (maxX < node.x) {\n maxX = node.x;\n }\n if (minY > node.y) {\n minY = node.y;\n } // top is negative, bottom is positive\n if (maxY < node.y) {\n maxY = node.y;\n } // top is negative, bottom is positive\n }\n }\n\n if (minX === 1e9 && maxX === -1e9 && minY === 1e9 && maxY === -1e9) {\n minY = 0, maxY = 0, minX = 0, maxX = 0;\n }\n return {minX: minX, maxX: maxX, minY: minY, maxY: maxY};\n }\n\n\n /**\n * @param {object} range = {minX: minX, maxX: maxX, minY: minY, maxY: maxY};\n * @returns {{x: number, y: number}}\n */\n static findCenter(range) {\n return {x: (0.5 * (range.maxX + range.minX)),\n y: (0.5 * (range.maxY + range.minY))};\n }\n\n\n /**\n * This returns a clone of the options or options of the edge or node to be used for construction of new edges or check functions for new nodes.\n * @param item\n * @param type\n * @returns {{}}\n */\n static cloneOptions(item, type) {\n let clonedOptions = {};\n if (type === undefined || type === 'node') {\n util.deepExtend(clonedOptions, item.options, true);\n clonedOptions.x = item.x;\n clonedOptions.y = item.y;\n clonedOptions.amountOfConnections = item.edges.length;\n }\n else {\n util.deepExtend(clonedOptions, item.options, true);\n }\n return clonedOptions;\n }\n\n}\n\nexport default NetworkUtil;\n\n\n// WEBPACK FOOTER //\n// ./lib/network/NetworkUtil.js","import Node from '../Node'\n\n/**\n *\n */\nclass Cluster extends Node {\n constructor(options, body, imagelist, grouplist, globalOptions) {\n super(options, body, imagelist, grouplist, globalOptions);\n\n this.isCluster = true;\n this.containedNodes = {};\n this.containedEdges = {};\n }\n}\n\nexport default Cluster;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/nodes/Cluster.js","if (typeof window !== 'undefined') {\n window.requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame ||\n window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;\n}\n\nlet util = require('../../util');\n\n\nclass CanvasRenderer {\n constructor(body, canvas) {\n this.body = body;\n this.canvas = canvas;\n\n this.redrawRequested = false;\n this.renderTimer = undefined;\n this.requiresTimeout = true;\n this.renderingActive = false;\n this.renderRequests = 0;\n this.pixelRatio = undefined;\n this.allowRedraw = true;\n\n this.dragging = false;\n this.options = {};\n this.defaultOptions = {\n hideEdgesOnDrag: false,\n hideNodesOnDrag: false\n };\n util.extend(this.options, this.defaultOptions);\n\n this._determineBrowserMethod();\n this.bindEventListeners();\n }\n\n bindEventListeners() {\n this.body.emitter.on(\"dragStart\", () => { this.dragging = true; });\n this.body.emitter.on(\"dragEnd\", () => { this.dragging = false; });\n this.body.emitter.on(\"_resizeNodes\", () => { this._resizeNodes(); });\n this.body.emitter.on(\"_redraw\", () => {\n if (this.renderingActive === false) {\n this._redraw();\n }\n });\n this.body.emitter.on(\"_blockRedraw\", () => {this.allowRedraw = false;});\n this.body.emitter.on(\"_allowRedraw\", () => {this.allowRedraw = true; this.redrawRequested = false;});\n this.body.emitter.on(\"_requestRedraw\", this._requestRedraw.bind(this));\n this.body.emitter.on(\"_startRendering\", () => {\n this.renderRequests += 1;\n this.renderingActive = true;\n this._startRendering();\n });\n this.body.emitter.on(\"_stopRendering\", () => {\n this.renderRequests -= 1;\n this.renderingActive = this.renderRequests > 0;\n this.renderTimer = undefined;\n });\n this.body.emitter.on('destroy', () => {\n this.renderRequests = 0;\n this.allowRedraw = false;\n this.renderingActive = false;\n if (this.requiresTimeout === true) {\n clearTimeout(this.renderTimer);\n }\n else {\n cancelAnimationFrame(this.renderTimer);\n }\n this.body.emitter.off();\n });\n\n }\n\n setOptions(options) {\n if (options !== undefined) {\n let fields = ['hideEdgesOnDrag','hideNodesOnDrag'];\n util.selectiveDeepExtend(fields,this.options, options);\n }\n }\n\n _startRendering() {\n if (this.renderingActive === true) {\n if (this.renderTimer === undefined) {\n if (this.requiresTimeout === true) {\n this.renderTimer = window.setTimeout(this._renderStep.bind(this), this.simulationInterval); // wait this.renderTimeStep milliseconds and perform the animation step function\n }\n else {\n this.renderTimer = window.requestAnimationFrame(this._renderStep.bind(this)); // wait this.renderTimeStep milliseconds and perform the animation step function\n }\n }\n }\n }\n\n _renderStep() {\n if (this.renderingActive === true) {\n // reset the renderTimer so a new scheduled animation step can be set\n this.renderTimer = undefined;\n\n if (this.requiresTimeout === true) {\n // this schedules a new simulation step\n this._startRendering();\n }\n\n this._redraw();\n\n if (this.requiresTimeout === false) {\n // this schedules a new simulation step\n this._startRendering();\n }\n }\n }\n\n /**\n * Redraw the network with the current data\n * chart will be resized too.\n */\n redraw() {\n this.body.emitter.emit('setSize');\n this._redraw();\n }\n\n /**\n * Redraw the network with the current data\n * @param hidden | used to get the first estimate of the node sizes. only the nodes are drawn after which they are quickly drawn over.\n * @private\n */\n _requestRedraw() {\n if (this.redrawRequested !== true && this.renderingActive === false && this.allowRedraw === true) {\n this.redrawRequested = true;\n if (this.requiresTimeout === true) {\n window.setTimeout(() => {this._redraw(false);}, 0);\n }\n else {\n window.requestAnimationFrame(() => {this._redraw(false);});\n }\n }\n }\n\n _redraw(hidden = false) {\n if (this.allowRedraw === true) {\n this.body.emitter.emit(\"initRedraw\");\n\n this.redrawRequested = false;\n let ctx = this.canvas.frame.canvas.getContext('2d');\n\n // when the container div was hidden, this fixes it back up!\n if (this.canvas.frame.canvas.width === 0 || this.canvas.frame.canvas.height === 0) {\n this.canvas.setSize();\n }\n\n this.pixelRatio = (window.devicePixelRatio || 1) / (ctx.webkitBackingStorePixelRatio ||\n ctx.mozBackingStorePixelRatio ||\n ctx.msBackingStorePixelRatio ||\n ctx.oBackingStorePixelRatio ||\n ctx.backingStorePixelRatio || 1);\n\n ctx.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);\n\n // clear the canvas\n let w = this.canvas.frame.canvas.clientWidth;\n let h = this.canvas.frame.canvas.clientHeight;\n ctx.clearRect(0, 0, w, h);\n\n // if the div is hidden, we stop the redraw here for performance.\n if (this.canvas.frame.clientWidth === 0) {\n return;\n }\n\n // set scaling and translation\n ctx.save();\n ctx.translate(this.body.view.translation.x, this.body.view.translation.y);\n ctx.scale(this.body.view.scale, this.body.view.scale);\n\n ctx.beginPath();\n this.body.emitter.emit(\"beforeDrawing\", ctx);\n ctx.closePath();\n\n if (hidden === false) {\n if (this.dragging === false || (this.dragging === true && this.options.hideEdgesOnDrag === false)) {\n this._drawEdges(ctx);\n }\n }\n\n if (this.dragging === false || (this.dragging === true && this.options.hideNodesOnDrag === false)) {\n this._drawNodes(ctx, hidden);\n }\n\n ctx.beginPath();\n this.body.emitter.emit(\"afterDrawing\", ctx);\n ctx.closePath();\n\n\n // restore original scaling and translation\n ctx.restore();\n if (hidden === true) {\n ctx.clearRect(0, 0, w, h);\n }\n }\n }\n\n\n /**\n * Redraw all nodes\n * The 2d context of a HTML canvas can be retrieved by canvas.getContext('2d');\n * @param {CanvasRenderingContext2D} ctx\n * @param {Boolean} [alwaysShow]\n * @private\n */\n _resizeNodes() {\n let ctx = this.canvas.frame.canvas.getContext('2d');\n if (this.pixelRatio === undefined) {\n this.pixelRatio = (window.devicePixelRatio || 1) / (ctx.webkitBackingStorePixelRatio ||\n ctx.mozBackingStorePixelRatio ||\n ctx.msBackingStorePixelRatio ||\n ctx.oBackingStorePixelRatio ||\n ctx.backingStorePixelRatio || 1);\n }\n ctx.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);\n ctx.save();\n ctx.translate(this.body.view.translation.x, this.body.view.translation.y);\n ctx.scale(this.body.view.scale, this.body.view.scale);\n\n let nodes = this.body.nodes;\n let node;\n\n // resize all nodes\n for (let nodeId in nodes) {\n if (nodes.hasOwnProperty(nodeId)) {\n node = nodes[nodeId];\n node.resize(ctx);\n node.updateBoundingBox(ctx, node.selected);\n }\n }\n\n // restore original scaling and translation\n ctx.restore();\n }\n\n /**\n * Redraw all nodes\n * The 2d context of a HTML canvas can be retrieved by canvas.getContext('2d');\n * @param {CanvasRenderingContext2D} ctx\n * @param {Boolean} [alwaysShow]\n * @private\n */\n _drawNodes(ctx, alwaysShow = false) {\n let nodes = this.body.nodes;\n let nodeIndices = this.body.nodeIndices;\n let node;\n let selected = [];\n let margin = 20;\n let topLeft = this.canvas.DOMtoCanvas({x:-margin,y:-margin});\n let bottomRight = this.canvas.DOMtoCanvas({\n x: this.canvas.frame.canvas.clientWidth+margin,\n y: this.canvas.frame.canvas.clientHeight+margin\n });\n let viewableArea = {top:topLeft.y,left:topLeft.x,bottom:bottomRight.y,right:bottomRight.x};\n\n // draw unselected nodes;\n for (let i = 0; i < nodeIndices.length; i++) {\n node = nodes[nodeIndices[i]];\n // set selected nodes aside\n if (node.isSelected()) {\n selected.push(nodeIndices[i]);\n }\n else {\n if (alwaysShow === true) {\n node.draw(ctx);\n }\n else if (node.isBoundingBoxOverlappingWith(viewableArea) === true) {\n node.draw(ctx);\n }\n else {\n node.updateBoundingBox(ctx, node.selected);\n }\n }\n }\n\n // draw the selected nodes on top\n for (let i = 0; i < selected.length; i++) {\n node = nodes[selected[i]];\n node.draw(ctx);\n }\n }\n\n\n /**\n * Redraw all edges\n * The 2d context of a HTML canvas can be retrieved by canvas.getContext('2d');\n * @param {CanvasRenderingContext2D} ctx\n * @private\n */\n _drawEdges(ctx) {\n let edges = this.body.edges;\n let edgeIndices = this.body.edgeIndices;\n let edge;\n\n for (let i = 0; i < edgeIndices.length; i++) {\n edge = edges[edgeIndices[i]];\n if (edge.connected === true) {\n edge.draw(ctx);\n }\n }\n }\n\n /**\n * Determine if the browser requires a setTimeout or a requestAnimationFrame. This was required because\n * some implementations (safari and IE9) did not support requestAnimationFrame\n * @private\n */\n _determineBrowserMethod() {\n if (typeof window !== 'undefined') {\n let browserType = navigator.userAgent.toLowerCase();\n this.requiresTimeout = false;\n if (browserType.indexOf('msie 9.0') != -1) { // IE 9\n this.requiresTimeout = true;\n }\n else if (browserType.indexOf('safari') != -1) { // safari\n if (browserType.indexOf('chrome') <= -1) {\n this.requiresTimeout = true;\n }\n }\n }\n else {\n this.requiresTimeout = true;\n }\n }\n\n}\n\nexport default CanvasRenderer;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/CanvasRenderer.js","let Hammer = require('../../module/hammer');\nlet hammerUtil = require('../../hammerUtil');\n\nlet util = require('../../util');\n\n/**\n * Create the main frame for the Network.\n * This function is executed once when a Network object is created. The frame\n * contains a canvas, and this canvas contains all objects like the axis and\n * nodes.\n * @private\n */\nclass Canvas {\n constructor(body) {\n this.body = body;\n this.pixelRatio = 1;\n this.resizeTimer = undefined;\n this.resizeFunction = this._onResize.bind(this);\n this.cameraState = {};\n this.initialized = false;\n this.canvasViewCenter = {};\n\n this.options = {};\n this.defaultOptions = {\n autoResize: true,\n height: '100%',\n width: '100%'\n };\n util.extend(this.options, this.defaultOptions);\n\n this.bindEventListeners();\n }\n\n bindEventListeners() {\n // bind the events\n this.body.emitter.once(\"resize\", (obj) => {\n if (obj.width !== 0) {\n this.body.view.translation.x = obj.width * 0.5;\n }\n if (obj.height !== 0) {\n this.body.view.translation.y = obj.height * 0.5;\n }\n });\n this.body.emitter.on(\"setSize\", this.setSize.bind(this));\n this.body.emitter.on(\"destroy\", () => {\n this.hammerFrame.destroy();\n this.hammer.destroy();\n this._cleanUp();\n });\n\n\n }\n\n setOptions(options) {\n if (options !== undefined) {\n let fields = ['width','height','autoResize'];\n util.selectiveDeepExtend(fields,this.options, options);\n }\n\n if (this.options.autoResize === true) {\n // automatically adapt to a changing size of the browser.\n this._cleanUp();\n this.resizeTimer = setInterval(() => {\n let changed = this.setSize();\n if (changed === true) {\n this.body.emitter.emit(\"_requestRedraw\");\n }\n }, 1000);\n this.resizeFunction = this._onResize.bind(this);\n util.addEventListener(window,'resize',this.resizeFunction);\n }\n }\n\n _cleanUp() {\n // automatically adapt to a changing size of the browser.\n if (this.resizeTimer !== undefined) {\n clearInterval(this.resizeTimer);\n }\n util.removeEventListener(window,'resize',this.resizeFunction);\n this.resizeFunction = undefined;\n }\n\n _onResize() {\n this.setSize();\n this.body.emitter.emit(\"_redraw\");\n }\n\n /**\n * Get and store the cameraState\n * @private\n */\n _getCameraState(pixelRatio = this.pixelRatio) {\n if (this.initialized === true) {\n this.cameraState.previousWidth = this.frame.canvas.width / pixelRatio;\n this.cameraState.previousHeight = this.frame.canvas.height / pixelRatio;\n this.cameraState.scale = this.body.view.scale;\n this.cameraState.position = this.DOMtoCanvas({\n x: 0.5 * this.frame.canvas.width / pixelRatio,\n y: 0.5 * this.frame.canvas.height / pixelRatio\n });\n }\n }\n\n /**\n * Set the cameraState\n * @private\n */\n _setCameraState() {\n if (this.cameraState.scale !== undefined &&\n this.frame.canvas.clientWidth !== 0 &&\n this.frame.canvas.clientHeight !== 0 &&\n this.pixelRatio !== 0 &&\n this.cameraState.previousWidth > 0) {\n\n let widthRatio = (this.frame.canvas.width / this.pixelRatio) / this.cameraState.previousWidth;\n let heightRatio = (this.frame.canvas.height / this.pixelRatio) / this.cameraState.previousHeight;\n let newScale = this.cameraState.scale;\n\n if (widthRatio != 1 && heightRatio != 1) {\n newScale = this.cameraState.scale * 0.5 * (widthRatio + heightRatio);\n }\n else if (widthRatio != 1) {\n newScale = this.cameraState.scale * widthRatio;\n }\n else if (heightRatio != 1) {\n newScale = this.cameraState.scale * heightRatio;\n }\n\n this.body.view.scale = newScale;\n // this comes from the view module.\n var currentViewCenter = this.DOMtoCanvas({\n x: 0.5 * this.frame.canvas.clientWidth,\n y: 0.5 * this.frame.canvas.clientHeight\n });\n\n var distanceFromCenter = { // offset from view, distance view has to change by these x and y to center the node\n x: currentViewCenter.x - this.cameraState.position.x,\n y: currentViewCenter.y - this.cameraState.position.y\n };\n this.body.view.translation.x += distanceFromCenter.x * this.body.view.scale;\n this.body.view.translation.y += distanceFromCenter.y * this.body.view.scale;\n }\n }\n\n _prepareValue(value) {\n if (typeof value === 'number') {\n return value + 'px';\n }\n else if (typeof value === 'string') {\n if (value.indexOf('%') !== -1 || value.indexOf('px') !== -1) {\n return value;\n }\n else if (value.indexOf('%') === -1) {\n return value + 'px';\n }\n }\n throw new Error('Could not use the value supplied for width or height:' + value);\n }\n\n\n /**\n * Create the HTML\n */\n _create() {\n // remove all elements from the container element.\n while (this.body.container.hasChildNodes()) {\n this.body.container.removeChild(this.body.container.firstChild);\n }\n\n this.frame = document.createElement('div');\n this.frame.className = 'vis-network';\n this.frame.style.position = 'relative';\n this.frame.style.overflow = 'hidden';\n this.frame.tabIndex = 900; // tab index is required for keycharm to bind keystrokes to the div instead of the window\n\n //////////////////////////////////////////////////////////////////\n\n this.frame.canvas = document.createElement(\"canvas\");\n this.frame.canvas.style.position = 'relative';\n this.frame.appendChild(this.frame.canvas);\n\n if (!this.frame.canvas.getContext) {\n let noCanvas = document.createElement( 'DIV' );\n noCanvas.style.color = 'red';\n noCanvas.style.fontWeight = 'bold' ;\n noCanvas.style.padding = '10px';\n noCanvas.innerHTML = 'Error: your browser does not support HTML canvas';\n this.frame.canvas.appendChild(noCanvas);\n }\n else {\n let ctx = this.frame.canvas.getContext(\"2d\");\n this.pixelRatio = (window.devicePixelRatio || 1) / (ctx.webkitBackingStorePixelRatio ||\n ctx.mozBackingStorePixelRatio ||\n ctx.msBackingStorePixelRatio ||\n ctx.oBackingStorePixelRatio ||\n ctx.backingStorePixelRatio || 1);\n\n this.frame.canvas.getContext(\"2d\").setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);\n }\n\n // add the frame to the container element\n this.body.container.appendChild(this.frame);\n\n this.body.view.scale = 1;\n this.body.view.translation = {x: 0.5 * this.frame.canvas.clientWidth,y: 0.5 * this.frame.canvas.clientHeight};\n\n this._bindHammer();\n }\n\n\n /**\n * This function binds hammer, it can be repeated over and over due to the uniqueness check.\n * @private\n */\n _bindHammer() {\n if (this.hammer !== undefined) {\n this.hammer.destroy();\n }\n this.drag = {};\n this.pinch = {};\n\n // init hammer\n this.hammer = new Hammer(this.frame.canvas);\n this.hammer.get('pinch').set({enable: true});\n // enable to get better response, todo: test on mobile.\n this.hammer.get('pan').set({threshold:5, direction: Hammer.DIRECTION_ALL});\n\n hammerUtil.onTouch(this.hammer, (event) => {this.body.eventListeners.onTouch(event)});\n this.hammer.on('tap', (event) => {this.body.eventListeners.onTap(event)});\n this.hammer.on('doubletap', (event) => {this.body.eventListeners.onDoubleTap(event)});\n this.hammer.on('press', (event) => {this.body.eventListeners.onHold(event)});\n this.hammer.on('panstart', (event) => {this.body.eventListeners.onDragStart(event)});\n this.hammer.on('panmove', (event) => {this.body.eventListeners.onDrag(event)});\n this.hammer.on('panend', (event) => {this.body.eventListeners.onDragEnd(event)});\n this.hammer.on('pinch', (event) => {this.body.eventListeners.onPinch(event)});\n\n // TODO: neatly cleanup these handlers when re-creating the Canvas, IF these are done with hammer, event.stopPropagation will not work?\n this.frame.canvas.addEventListener('mousewheel', (event) => {this.body.eventListeners.onMouseWheel(event)});\n this.frame.canvas.addEventListener('DOMMouseScroll', (event) => {this.body.eventListeners.onMouseWheel(event)});\n\n this.frame.canvas.addEventListener('mousemove', (event) => {this.body.eventListeners.onMouseMove(event)});\n this.frame.canvas.addEventListener('contextmenu', (event) => {this.body.eventListeners.onContext(event)});\n\n this.hammerFrame = new Hammer(this.frame);\n hammerUtil.onRelease(this.hammerFrame, (event) => {this.body.eventListeners.onRelease(event)});\n }\n\n\n /**\n * Set a new size for the network\n * @param {string} width Width in pixels or percentage (for example '800px'\n * or '50%')\n * @param {string} height Height in pixels or percentage (for example '400px'\n * or '30%')\n */\n setSize(width = this.options.width, height = this.options.height) {\n width = this._prepareValue(width);\n height= this._prepareValue(height);\n\n let emitEvent = false;\n let oldWidth = this.frame.canvas.width;\n let oldHeight = this.frame.canvas.height;\n\n // update the pixel ratio\n let ctx = this.frame.canvas.getContext(\"2d\");\n let previousRatio = this.pixelRatio; // we cache this because the camera state storage needs the old value\n this.pixelRatio = (window.devicePixelRatio || 1) / (ctx.webkitBackingStorePixelRatio ||\n ctx.mozBackingStorePixelRatio ||\n ctx.msBackingStorePixelRatio ||\n ctx.oBackingStorePixelRatio ||\n ctx.backingStorePixelRatio || 1);\n\n if (width != this.options.width || height != this.options.height || this.frame.style.width != width || this.frame.style.height != height) {\n this._getCameraState(previousRatio);\n\n this.frame.style.width = width;\n this.frame.style.height = height;\n\n this.frame.canvas.style.width = '100%';\n this.frame.canvas.style.height = '100%';\n\n this.frame.canvas.width = Math.round(this.frame.canvas.clientWidth * this.pixelRatio);\n this.frame.canvas.height = Math.round(this.frame.canvas.clientHeight * this.pixelRatio);\n\n this.options.width = width;\n this.options.height = height;\n\n this.canvasViewCenter = {\n x: 0.5 * this.frame.clientWidth,\n y: 0.5 * this.frame.clientHeight\n };\n\n emitEvent = true;\n }\n else {\n // this would adapt the width of the canvas to the width from 100% if and only if\n // there is a change.\n\n // store the camera if there is a change in size.\n if (this.frame.canvas.width != Math.round(this.frame.canvas.clientWidth * this.pixelRatio) || this.frame.canvas.height != Math.round(this.frame.canvas.clientHeight * this.pixelRatio)) {\n this._getCameraState(previousRatio);\n }\n\n if (this.frame.canvas.width != Math.round(this.frame.canvas.clientWidth * this.pixelRatio)) {\n this.frame.canvas.width = Math.round(this.frame.canvas.clientWidth * this.pixelRatio);\n emitEvent = true;\n }\n if (this.frame.canvas.height != Math.round(this.frame.canvas.clientHeight * this.pixelRatio)) {\n this.frame.canvas.height = Math.round(this.frame.canvas.clientHeight * this.pixelRatio);\n emitEvent = true;\n }\n }\n\n if (emitEvent === true) {\n this.body.emitter.emit('resize', {\n width:Math.round(this.frame.canvas.width / this.pixelRatio),\n height:Math.round(this.frame.canvas.height / this.pixelRatio),\n oldWidth: Math.round(oldWidth / this.pixelRatio),\n oldHeight: Math.round(oldHeight / this.pixelRatio)\n });\n\n // restore the camera on change.\n this._setCameraState();\n }\n\n\n // set initialized so the get and set camera will work from now on.\n this.initialized = true;\n return emitEvent;\n };\n\n\n /**\n * Convert the X coordinate in DOM-space (coordinate point in browser relative to the container div) to\n * the X coordinate in canvas-space (the simulation sandbox, which the camera looks upon)\n * @param {number} x\n * @returns {number}\n * @private\n */\n _XconvertDOMtoCanvas(x) {\n return (x - this.body.view.translation.x) / this.body.view.scale;\n }\n\n /**\n * Convert the X coordinate in canvas-space (the simulation sandbox, which the camera looks upon) to\n * the X coordinate in DOM-space (coordinate point in browser relative to the container div)\n * @param {number} x\n * @returns {number}\n * @private\n */\n _XconvertCanvasToDOM(x) {\n return x * this.body.view.scale + this.body.view.translation.x;\n }\n\n /**\n * Convert the Y coordinate in DOM-space (coordinate point in browser relative to the container div) to\n * the Y coordinate in canvas-space (the simulation sandbox, which the camera looks upon)\n * @param {number} y\n * @returns {number}\n * @private\n */\n _YconvertDOMtoCanvas(y) {\n return (y - this.body.view.translation.y) / this.body.view.scale;\n }\n\n /**\n * Convert the Y coordinate in canvas-space (the simulation sandbox, which the camera looks upon) to\n * the Y coordinate in DOM-space (coordinate point in browser relative to the container div)\n * @param {number} y\n * @returns {number}\n * @private\n */\n _YconvertCanvasToDOM(y) {\n return y * this.body.view.scale + this.body.view.translation.y;\n }\n\n\n /**\n *\n * @param {object} pos = {x: number, y: number}\n * @returns {{x: number, y: number}}\n * @constructor\n */\n canvasToDOM (pos) {\n return {x: this._XconvertCanvasToDOM(pos.x), y: this._YconvertCanvasToDOM(pos.y)};\n }\n\n /**\n *\n * @param {object} pos = {x: number, y: number}\n * @returns {{x: number, y: number}}\n * @constructor\n */\n DOMtoCanvas (pos) {\n return {x: this._XconvertDOMtoCanvas(pos.x), y: this._YconvertDOMtoCanvas(pos.y)};\n }\n\n}\n\nexport default Canvas;\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/Canvas.js","let util = require('../../util');\n\nimport NetworkUtil from '../NetworkUtil';\n\nclass View {\n constructor(body, canvas) {\n this.body = body;\n this.canvas = canvas;\n\n this.animationSpeed = 1/this.renderRefreshRate;\n this.animationEasingFunction = \"easeInOutQuint\";\n this.easingTime = 0;\n this.sourceScale = 0;\n this.targetScale = 0;\n this.sourceTranslation = 0;\n this.targetTranslation = 0;\n this.lockedOnNodeId = undefined;\n this.lockedOnNodeOffset = undefined;\n this.touchTime = 0;\n\n this.viewFunction = undefined;\n\n this.body.emitter.on(\"fit\", this.fit.bind(this));\n this.body.emitter.on(\"animationFinished\", () => {this.body.emitter.emit(\"_stopRendering\");});\n this.body.emitter.on(\"unlockNode\", this.releaseNode.bind(this));\n }\n\n\n setOptions(options = {}) {\n this.options = options;\n }\n\n\n /**\n * This function zooms out to fit all data on screen based on amount of nodes\n * @param {Object} Options\n * @param {Boolean} [initialZoom] | zoom based on fitted formula or range, true = fitted, default = false;\n */\n fit(options = {nodes:[]}, initialZoom = false) {\n let range;\n let zoomLevel;\n if (options.nodes === undefined || options.nodes.length === 0) {\n options.nodes = this.body.nodeIndices;\n }\n\n\n if (initialZoom === true) {\n // check if more than half of the nodes have a predefined position. If so, we use the range, not the approximation.\n let positionDefined = 0;\n for (let nodeId in this.body.nodes) {\n if (this.body.nodes.hasOwnProperty(nodeId)) {\n let node = this.body.nodes[nodeId];\n if (node.predefinedPosition === true) {\n positionDefined += 1;\n }\n }\n }\n if (positionDefined > 0.5 * this.body.nodeIndices.length) {\n this.fit(options,false);\n return;\n }\n\n range = NetworkUtil.getRange(this.body.nodes, options.nodes);\n\n let numberOfNodes = this.body.nodeIndices.length;\n zoomLevel = 12.662 / (numberOfNodes + 7.4147) + 0.0964822; // this is obtained from fitting a dataset from 5 points with scale levels that looked good.\n\n // correct for larger canvasses.\n let factor = Math.min(this.canvas.frame.canvas.clientWidth / 600, this.canvas.frame.canvas.clientHeight / 600);\n zoomLevel *= factor;\n }\n else {\n this.body.emitter.emit(\"_resizeNodes\");\n range = NetworkUtil.getRange(this.body.nodes, options.nodes);\n\n let xDistance = Math.abs(range.maxX - range.minX) * 1.1;\n let yDistance = Math.abs(range.maxY - range.minY) * 1.1;\n\n let xZoomLevel = this.canvas.frame.canvas.clientWidth / xDistance;\n let yZoomLevel = this.canvas.frame.canvas.clientHeight / yDistance;\n\n zoomLevel = (xZoomLevel <= yZoomLevel) ? xZoomLevel : yZoomLevel;\n }\n\n if (zoomLevel > 1.0) {\n zoomLevel = 1.0;\n }\n else if (zoomLevel === 0) {\n zoomLevel = 1.0;\n }\n\n let center = NetworkUtil.findCenter(range);\n let animationOptions = {position: center, scale: zoomLevel, animation: options.animation};\n this.moveTo(animationOptions);\n }\n \n // animation\n\n /**\n * Center a node in view.\n *\n * @param {Number} nodeId\n * @param {Number} [options]\n */\n focus(nodeId, options = {}) {\n if (this.body.nodes[nodeId] !== undefined) {\n let nodePosition = {x: this.body.nodes[nodeId].x, y: this.body.nodes[nodeId].y};\n options.position = nodePosition;\n options.lockedOnNode = nodeId;\n\n this.moveTo(options)\n }\n else {\n console.log(\"Node: \" + nodeId + \" cannot be found.\");\n }\n }\n\n /**\n *\n * @param {Object} options | options.offset = {x:Number, y:Number} // offset from the center in DOM pixels\n * | options.scale = Number // scale to move to\n * | options.position = {x:Number, y:Number} // position to move to\n * | options.animation = {duration:Number, easingFunction:String} || Boolean // position to move to\n */\n moveTo(options) {\n if (options === undefined) {\n options = {};\n return;\n }\n if (options.offset === undefined) {options.offset = {x: 0, y: 0}; }\n if (options.offset.x === undefined) {options.offset.x = 0; }\n if (options.offset.y === undefined) {options.offset.y = 0; }\n if (options.scale === undefined) {options.scale = this.body.view.scale; }\n if (options.position === undefined) {options.position = this.getViewPosition();}\n if (options.animation === undefined) {options.animation = {duration:0}; }\n if (options.animation === false ) {options.animation = {duration:0}; }\n if (options.animation === true ) {options.animation = {}; }\n if (options.animation.duration === undefined) {options.animation.duration = 1000; } // default duration\n if (options.animation.easingFunction === undefined) {options.animation.easingFunction = \"easeInOutQuad\"; } // default easing function\n\n this.animateView(options);\n }\n\n /**\n *\n * @param {Object} options | options.offset = {x:Number, y:Number} // offset from the center in DOM pixels\n * | options.time = Number // animation time in milliseconds\n * | options.scale = Number // scale to animate to\n * | options.position = {x:Number, y:Number} // position to animate to\n * | options.easingFunction = String // linear, easeInQuad, easeOutQuad, easeInOutQuad,\n * // easeInCubic, easeOutCubic, easeInOutCubic,\n * // easeInQuart, easeOutQuart, easeInOutQuart,\n * // easeInQuint, easeOutQuint, easeInOutQuint\n */\n animateView(options) {\n if (options === undefined) {\n return;\n }\n this.animationEasingFunction = options.animation.easingFunction;\n // release if something focussed on the node\n this.releaseNode();\n if (options.locked === true) {\n this.lockedOnNodeId = options.lockedOnNode;\n this.lockedOnNodeOffset = options.offset;\n }\n\n // forcefully complete the old animation if it was still running\n if (this.easingTime != 0) {\n this._transitionRedraw(true); // by setting easingtime to 1, we finish the animation.\n }\n\n this.sourceScale = this.body.view.scale;\n this.sourceTranslation = this.body.view.translation;\n this.targetScale = options.scale;\n\n // set the scale so the viewCenter is based on the correct zoom level. This is overridden in the transitionRedraw\n // but at least then we'll have the target transition\n this.body.view.scale = this.targetScale;\n let viewCenter = this.canvas.DOMtoCanvas({x: 0.5 * this.canvas.frame.canvas.clientWidth, y: 0.5 * this.canvas.frame.canvas.clientHeight});\n\n let distanceFromCenter = { // offset from view, distance view has to change by these x and y to center the node\n x: viewCenter.x - options.position.x,\n y: viewCenter.y - options.position.y\n };\n this.targetTranslation = {\n x: this.sourceTranslation.x + distanceFromCenter.x * this.targetScale + options.offset.x,\n y: this.sourceTranslation.y + distanceFromCenter.y * this.targetScale + options.offset.y\n };\n\n // if the time is set to 0, don't do an animation\n if (options.animation.duration === 0) {\n if (this.lockedOnNodeId != undefined) {\n this.viewFunction = this._lockedRedraw.bind(this);\n this.body.emitter.on(\"initRedraw\", this.viewFunction);\n }\n else {\n this.body.view.scale = this.targetScale;\n this.body.view.translation = this.targetTranslation;\n this.body.emitter.emit(\"_requestRedraw\");\n }\n }\n else {\n this.animationSpeed = 1 / (60 * options.animation.duration * 0.001) || 1 / 60; // 60 for 60 seconds, 0.001 for milli's\n this.animationEasingFunction = options.animation.easingFunction;\n\n\n this.viewFunction = this._transitionRedraw.bind(this);\n this.body.emitter.on(\"initRedraw\", this.viewFunction);\n this.body.emitter.emit(\"_startRendering\");\n }\n }\n\n /**\n * used to animate smoothly by hijacking the redraw function.\n * @private\n */\n _lockedRedraw() {\n let nodePosition = {x: this.body.nodes[this.lockedOnNodeId].x, y: this.body.nodes[this.lockedOnNodeId].y};\n let viewCenter = this.canvas.DOMtoCanvas({x: 0.5 * this.canvas.frame.canvas.clientWidth, y: 0.5 * this.canvas.frame.canvas.clientHeight});\n let distanceFromCenter = { // offset from view, distance view has to change by these x and y to center the node\n x: viewCenter.x - nodePosition.x,\n y: viewCenter.y - nodePosition.y\n };\n let sourceTranslation = this.body.view.translation;\n let targetTranslation = {\n x: sourceTranslation.x + distanceFromCenter.x * this.body.view.scale + this.lockedOnNodeOffset.x,\n y: sourceTranslation.y + distanceFromCenter.y * this.body.view.scale + this.lockedOnNodeOffset.y\n };\n\n this.body.view.translation = targetTranslation;\n }\n\n releaseNode() {\n if (this.lockedOnNodeId !== undefined && this.viewFunction !== undefined) {\n this.body.emitter.off(\"initRedraw\", this.viewFunction);\n this.lockedOnNodeId = undefined;\n this.lockedOnNodeOffset = undefined;\n }\n }\n\n /**\n *\n * @param easingTime\n * @private\n */\n _transitionRedraw(finished = false) {\n this.easingTime += this.animationSpeed;\n this.easingTime = finished === true ? 1.0 : this.easingTime;\n\n let progress = util.easingFunctions[this.animationEasingFunction](this.easingTime);\n\n this.body.view.scale = this.sourceScale + (this.targetScale - this.sourceScale) * progress;\n this.body.view.translation = {\n x: this.sourceTranslation.x + (this.targetTranslation.x - this.sourceTranslation.x) * progress,\n y: this.sourceTranslation.y + (this.targetTranslation.y - this.sourceTranslation.y) * progress\n };\n\n // cleanup\n if (this.easingTime >= 1.0) {\n this.body.emitter.off(\"initRedraw\", this.viewFunction);\n this.easingTime = 0;\n if (this.lockedOnNodeId != undefined) {\n this.viewFunction = this._lockedRedraw.bind(this);\n this.body.emitter.on(\"initRedraw\", this.viewFunction);\n }\n this.body.emitter.emit(\"animationFinished\");\n }\n };\n\n\n getScale() {\n return this.body.view.scale;\n }\n\n getViewPosition() {\n return this.canvas.DOMtoCanvas({x: 0.5 * this.canvas.frame.canvas.clientWidth, y: 0.5 * this.canvas.frame.canvas.clientHeight});\n }\n\n\n}\n\nexport default View;\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/View.js","let util = require('../../util');\n\nimport NavigationHandler from './components/NavigationHandler'\nimport Popup from './../../shared/Popup'\n\nclass InteractionHandler {\n constructor(body, canvas, selectionHandler) {\n this.body = body;\n this.canvas = canvas;\n this.selectionHandler = selectionHandler;\n this.navigationHandler = new NavigationHandler(body,canvas);\n\n // bind the events from hammer to functions in this object\n this.body.eventListeners.onTap = this.onTap.bind(this);\n this.body.eventListeners.onTouch = this.onTouch.bind(this);\n this.body.eventListeners.onDoubleTap = this.onDoubleTap.bind(this);\n this.body.eventListeners.onHold = this.onHold.bind(this);\n this.body.eventListeners.onDragStart = this.onDragStart.bind(this);\n this.body.eventListeners.onDrag = this.onDrag.bind(this);\n this.body.eventListeners.onDragEnd = this.onDragEnd.bind(this);\n this.body.eventListeners.onMouseWheel = this.onMouseWheel.bind(this);\n this.body.eventListeners.onPinch = this.onPinch.bind(this);\n this.body.eventListeners.onMouseMove = this.onMouseMove.bind(this);\n this.body.eventListeners.onRelease = this.onRelease.bind(this);\n this.body.eventListeners.onContext = this.onContext.bind(this);\n\n this.touchTime = 0;\n this.drag = {};\n this.pinch = {};\n this.popup = undefined;\n this.popupObj = undefined;\n this.popupTimer = undefined;\n\n this.body.functions.getPointer = this.getPointer.bind(this);\n\n this.options = {};\n this.defaultOptions = {\n dragNodes:true,\n dragView: true,\n hover: false,\n keyboard: {\n enabled: false,\n speed: {x: 10, y: 10, zoom: 0.02},\n bindToWindow: true\n },\n navigationButtons: false,\n tooltipDelay: 300,\n zoomView: true\n };\n util.extend(this.options,this.defaultOptions);\n\n this.bindEventListeners()\n }\n\n bindEventListeners() {\n this.body.emitter.on('destroy', () => {\n clearTimeout(this.popupTimer);\n delete this.body.functions.getPointer;\n })\n }\n\n setOptions(options) {\n if (options !== undefined) {\n // extend all but the values in fields\n let fields = ['hideEdgesOnDrag','hideNodesOnDrag','keyboard','multiselect','selectable','selectConnectedEdges'];\n util.selectiveNotDeepExtend(fields, this.options, options);\n\n // merge the keyboard options in.\n util.mergeOptions(this.options, options, 'keyboard');\n\n if (options.tooltip) {\n util.extend(this.options.tooltip, options.tooltip);\n if (options.tooltip.color) {\n this.options.tooltip.color = util.parseColor(options.tooltip.color);\n }\n }\n }\n\n this.navigationHandler.setOptions(this.options);\n }\n\n\n /**\n * Get the pointer location from a touch location\n * @param {{x: Number, y: Number}} touch\n * @return {{x: Number, y: Number}} pointer\n * @private\n */\n getPointer(touch) {\n return {\n x: touch.x - util.getAbsoluteLeft(this.canvas.frame.canvas),\n y: touch.y - util.getAbsoluteTop(this.canvas.frame.canvas)\n };\n }\n\n\n /**\n * On start of a touch gesture, store the pointer\n * @param event\n * @private\n */\n onTouch(event) {\n if (new Date().valueOf() - this.touchTime > 50) {\n this.drag.pointer = this.getPointer(event.center);\n this.drag.pinched = false;\n this.pinch.scale = this.body.view.scale;\n // to avoid double fireing of this event because we have two hammer instances. (on canvas and on frame)\n this.touchTime = new Date().valueOf();\n }\n }\n\n /**\n * handle tap/click event: select/unselect a node\n * @private\n */\n onTap(event) {\n let pointer = this.getPointer(event.center);\n let multiselect = this.selectionHandler.options.multiselect &&\n (event.changedPointers[0].ctrlKey || event.changedPointers[0].metaKey);\n\n this.checkSelectionChanges(pointer, event, multiselect);\n this.selectionHandler._generateClickEvent('click', event, pointer);\n }\n\n\n /**\n * handle doubletap event\n * @private\n */\n onDoubleTap(event) {\n let pointer = this.getPointer(event.center);\n this.selectionHandler._generateClickEvent('doubleClick', event, pointer);\n }\n\n\n\n /**\n * handle long tap event: multi select nodes\n * @private\n */\n onHold(event) {\n let pointer = this.getPointer(event.center);\n let multiselect = this.selectionHandler.options.multiselect;\n\n this.checkSelectionChanges(pointer, event, multiselect);\n\n this.selectionHandler._generateClickEvent('click', event, pointer);\n this.selectionHandler._generateClickEvent('hold', event, pointer);\n }\n\n\n /**\n * handle the release of the screen\n *\n * @private\n */\n onRelease(event) {\n if (new Date().valueOf() - this.touchTime > 10) {\n let pointer = this.getPointer(event.center);\n this.selectionHandler._generateClickEvent('release', event, pointer);\n // to avoid double fireing of this event because we have two hammer instances. (on canvas and on frame)\n this.touchTime = new Date().valueOf();\n }\n }\n\n onContext(event) {\n let pointer = this.getPointer({x:event.clientX, y:event.clientY});\n this.selectionHandler._generateClickEvent('oncontext', event, pointer);\n }\n\n\n /**\n *\n * @param pointer\n * @param add\n */\n checkSelectionChanges(pointer, event, add = false) {\n let previouslySelectedEdgeCount = this.selectionHandler._getSelectedEdgeCount();\n let previouslySelectedNodeCount = this.selectionHandler._getSelectedNodeCount();\n let previousSelection = this.selectionHandler.getSelection();\n let selected;\n if (add === true) {\n selected = this.selectionHandler.selectAdditionalOnPoint(pointer);\n }\n else {\n selected = this.selectionHandler.selectOnPoint(pointer);\n }\n let selectedEdgesCount = this.selectionHandler._getSelectedEdgeCount();\n let selectedNodesCount = this.selectionHandler._getSelectedNodeCount();\n let currentSelection = this.selectionHandler.getSelection();\n\n let {nodesChanged, edgesChanged} = this._determineIfDifferent(previousSelection, currentSelection);\n let nodeSelected = false;\n\n if (selectedNodesCount - previouslySelectedNodeCount > 0) { // node was selected\n this.selectionHandler._generateClickEvent('selectNode', event, pointer);\n selected = true;\n nodeSelected = true;\n }\n else if (nodesChanged === true && selectedNodesCount > 0) {\n this.selectionHandler._generateClickEvent('deselectNode', event, pointer, previousSelection);\n this.selectionHandler._generateClickEvent('selectNode', event, pointer);\n nodeSelected = true;\n selected = true;\n }\n else if (selectedNodesCount - previouslySelectedNodeCount < 0) { // node was deselected\n this.selectionHandler._generateClickEvent('deselectNode', event, pointer, previousSelection);\n selected = true;\n }\n\n\n // handle the selected edges\n if (selectedEdgesCount - previouslySelectedEdgeCount > 0 && nodeSelected === false) { // edge was selected\n this.selectionHandler._generateClickEvent('selectEdge', event, pointer);\n selected = true;\n }\n else if (selectedEdgesCount > 0 && edgesChanged === true) {\n this.selectionHandler._generateClickEvent('deselectEdge', event, pointer, previousSelection);\n this.selectionHandler._generateClickEvent('selectEdge', event, pointer);\n selected = true;\n }\n else if (selectedEdgesCount - previouslySelectedEdgeCount < 0) { // edge was deselected\n this.selectionHandler._generateClickEvent('deselectEdge', event, pointer, previousSelection);\n selected = true;\n }\n\n\n // fire the select event if anything has been selected or deselected\n if (selected === true) { // select or unselect\n this.selectionHandler._generateClickEvent('select', event, pointer);\n }\n }\n\n\n /**\n * This function checks if the nodes and edges previously selected have changed.\n * @param previousSelection\n * @param currentSelection\n * @returns {{nodesChanged: boolean, edgesChanged: boolean}}\n * @private\n */\n _determineIfDifferent(previousSelection,currentSelection) {\n let nodesChanged = false;\n let edgesChanged = false;\n\n for (let i = 0; i < previousSelection.nodes.length; i++) {\n if (currentSelection.nodes.indexOf(previousSelection.nodes[i]) === -1) {\n nodesChanged = true;\n }\n }\n for (let i = 0; i < currentSelection.nodes.length; i++) {\n if (previousSelection.nodes.indexOf(previousSelection.nodes[i]) === -1) {\n nodesChanged = true;\n }\n }\n for (let i = 0; i < previousSelection.edges.length; i++) {\n if (currentSelection.edges.indexOf(previousSelection.edges[i]) === -1) {\n edgesChanged = true;\n }\n }\n for (let i = 0; i < currentSelection.edges.length; i++) {\n if (previousSelection.edges.indexOf(previousSelection.edges[i]) === -1) {\n edgesChanged = true;\n }\n }\n\n return {nodesChanged, edgesChanged};\n }\n\n\n /**\n * This function is called by onDragStart.\n * It is separated out because we can then overload it for the datamanipulation system.\n *\n * @private\n */\n onDragStart(event) {\n //in case the touch event was triggered on an external div, do the initial touch now.\n if (this.drag.pointer === undefined) {\n this.onTouch(event);\n }\n\n // note: drag.pointer is set in onTouch to get the initial touch location\n let node = this.selectionHandler.getNodeAt(this.drag.pointer);\n\n this.drag.dragging = true;\n this.drag.selection = [];\n this.drag.translation = util.extend({},this.body.view.translation); // copy the object\n this.drag.nodeId = undefined;\n\n if (node !== undefined && this.options.dragNodes === true) {\n this.drag.nodeId = node.id;\n // select the clicked node if not yet selected\n if (node.isSelected() === false) {\n this.selectionHandler.unselectAll();\n this.selectionHandler.selectObject(node);\n }\n\n // after select to contain the node\n this.selectionHandler._generateClickEvent('dragStart', event, this.drag.pointer);\n\n let selection = this.selectionHandler.selectionObj.nodes;\n // create an array with the selected nodes and their original location and status\n for (let nodeId in selection) {\n if (selection.hasOwnProperty(nodeId)) {\n let object = selection[nodeId];\n let s = {\n id: object.id,\n node: object,\n\n // store original x, y, xFixed and yFixed, make the node temporarily Fixed\n x: object.x,\n y: object.y,\n xFixed: object.options.fixed.x,\n yFixed: object.options.fixed.y\n };\n\n object.options.fixed.x = true;\n object.options.fixed.y = true;\n\n this.drag.selection.push(s);\n }\n }\n }\n else {\n // fallback if no node is selected and thus the view is dragged.\n this.selectionHandler._generateClickEvent('dragStart', event, this.drag.pointer, undefined, true);\n }\n }\n\n\n /**\n * handle drag event\n * @private\n */\n onDrag(event) {\n if (this.drag.pinched === true) {\n return;\n }\n\n // remove the focus on node if it is focussed on by the focusOnNode\n this.body.emitter.emit('unlockNode');\n\n let pointer = this.getPointer(event.center);\n\n let selection = this.drag.selection;\n if (selection && selection.length && this.options.dragNodes === true) {\n this.selectionHandler._generateClickEvent('dragging', event, pointer);\n\n // calculate delta's and new location\n let deltaX = pointer.x - this.drag.pointer.x;\n let deltaY = pointer.y - this.drag.pointer.y;\n\n // update position of all selected nodes\n selection.forEach((selection) => {\n let node = selection.node;\n // only move the node if it was not fixed initially\n if (selection.xFixed === false) {\n node.x = this.canvas._XconvertDOMtoCanvas(this.canvas._XconvertCanvasToDOM(selection.x) + deltaX);\n }\n // only move the node if it was not fixed initially\n if (selection.yFixed === false) {\n node.y = this.canvas._YconvertDOMtoCanvas(this.canvas._YconvertCanvasToDOM(selection.y) + deltaY);\n }\n });\n\n // start the simulation of the physics\n this.body.emitter.emit('startSimulation');\n }\n else {\n // move the network\n if (this.options.dragView === true) {\n this.selectionHandler._generateClickEvent('dragging', event, pointer, undefined, true);\n\n // if the drag was not started properly because the click started outside the network div, start it now.\n if (this.drag.pointer === undefined) {\n this.onDragStart(event);\n return;\n }\n let diffX = pointer.x - this.drag.pointer.x;\n let diffY = pointer.y - this.drag.pointer.y;\n\n this.body.view.translation = {x:this.drag.translation.x + diffX, y:this.drag.translation.y + diffY};\n this.body.emitter.emit('_redraw');\n }\n }\n }\n\n\n /**\n * handle drag start event\n * @private\n */\n onDragEnd(event) {\n this.drag.dragging = false;\n let selection = this.drag.selection;\n if (selection && selection.length) {\n selection.forEach(function (s) {\n // restore original xFixed and yFixed\n s.node.options.fixed.x = s.xFixed;\n s.node.options.fixed.y = s.yFixed;\n });\n this.selectionHandler._generateClickEvent('dragEnd', event, this.getPointer(event.center));\n this.body.emitter.emit('startSimulation');\n }\n else {\n this.selectionHandler._generateClickEvent('dragEnd', event, this.getPointer(event.center), undefined, true);\n this.body.emitter.emit('_requestRedraw');\n }\n }\n\n\n\n /**\n * Handle pinch event\n * @param event\n * @private\n */\n onPinch(event) {\n let pointer = this.getPointer(event.center);\n\n this.drag.pinched = true;\n if (this.pinch['scale'] === undefined) {\n this.pinch.scale = 1;\n }\n\n // TODO: enabled moving while pinching?\n let scale = this.pinch.scale * event.scale;\n this.zoom(scale, pointer)\n }\n\n\n /**\n * Zoom the network in or out\n * @param {Number} scale a number around 1, and between 0.01 and 10\n * @param {{x: Number, y: Number}} pointer Position on screen\n * @return {Number} appliedScale scale is limited within the boundaries\n * @private\n */\n zoom(scale, pointer) {\n if (this.options.zoomView === true) {\n let scaleOld = this.body.view.scale;\n if (scale < 0.00001) {\n scale = 0.00001;\n }\n if (scale > 10) {\n scale = 10;\n }\n\n let preScaleDragPointer = undefined;\n if (this.drag !== undefined) {\n if (this.drag.dragging === true) {\n preScaleDragPointer = this.canvas.DOMtoCanvas(this.drag.pointer);\n }\n }\n // + this.canvas.frame.canvas.clientHeight / 2\n let translation = this.body.view.translation;\n\n let scaleFrac = scale / scaleOld;\n let tx = (1 - scaleFrac) * pointer.x + translation.x * scaleFrac;\n let ty = (1 - scaleFrac) * pointer.y + translation.y * scaleFrac;\n\n this.body.view.scale = scale;\n this.body.view.translation = {x:tx, y:ty};\n\n if (preScaleDragPointer != undefined) {\n let postScaleDragPointer = this.canvas.canvasToDOM(preScaleDragPointer);\n this.drag.pointer.x = postScaleDragPointer.x;\n this.drag.pointer.y = postScaleDragPointer.y;\n }\n\n this.body.emitter.emit('_requestRedraw');\n\n if (scaleOld < scale) {\n this.body.emitter.emit('zoom', {direction: '+', scale: this.body.view.scale, pointer: pointer});\n }\n else {\n this.body.emitter.emit('zoom', {direction: '-', scale: this.body.view.scale, pointer: pointer});\n }\n }\n }\n\n\n /**\n * Event handler for mouse wheel event, used to zoom the timeline\n * See http://adomas.org/javascript-mouse-wheel/\n * https://github.com/EightMedia/hammer.js/issues/256\n * @param {MouseEvent} event\n * @private\n */\n onMouseWheel(event) {\n if (this.options.zoomView === true) {\n // retrieve delta\n let delta = 0;\n if (event.wheelDelta) { /* IE/Opera. */\n delta = event.wheelDelta / 120;\n }\n else if (event.detail) { /* Mozilla case. */\n // In Mozilla, sign of delta is different than in IE.\n // Also, delta is multiple of 3.\n delta = -event.detail / 3;\n }\n\n // If delta is nonzero, handle it.\n // Basically, delta is now positive if wheel was scrolled up,\n // and negative, if wheel was scrolled down.\n if (delta !== 0) {\n\n // calculate the new scale\n let scale = this.body.view.scale;\n let zoom = delta / 10;\n if (delta < 0) {\n zoom = zoom / (1 - zoom);\n }\n scale *= (1 + zoom);\n\n // calculate the pointer location\n let pointer = this.getPointer({x: event.clientX, y: event.clientY});\n\n // apply the new scale\n this.zoom(scale, pointer);\n }\n\n // Prevent default actions caused by mouse wheel.\n event.preventDefault();\n }\n }\n\n\n /**\n * Mouse move handler for checking whether the title moves over a node with a title.\n * @param {Event} event\n * @private\n */\n onMouseMove(event) {\n let pointer = this.getPointer({x:event.clientX, y:event.clientY});\n let popupVisible = false;\n\n // check if the previously selected node is still selected\n if (this.popup !== undefined) {\n if (this.popup.hidden === false) {\n this._checkHidePopup(pointer);\n }\n\n // if the popup was not hidden above\n if (this.popup.hidden === false) {\n popupVisible = true;\n this.popup.setPosition(pointer.x + 3, pointer.y - 5);\n this.popup.show();\n }\n }\n\n // if we bind the keyboard to the div, we have to highlight it to use it. This highlights it on mouse over.\n if (this.options.keyboard.bindToWindow === false && this.options.keyboard.enabled === true) {\n this.canvas.frame.focus();\n }\n\n // start a timeout that will check if the mouse is positioned above an element\n if (popupVisible === false) {\n if (this.popupTimer !== undefined) {\n clearInterval(this.popupTimer); // stop any running calculationTimer\n this.popupTimer = undefined;\n }\n if (!this.drag.dragging) {\n this.popupTimer = setTimeout(() => this._checkShowPopup(pointer), this.options.tooltipDelay);\n }\n }\n\n /**\n * Adding hover highlights\n */\n if (this.options.hover === true) {\n // adding hover highlights\n let obj = this.selectionHandler.getNodeAt(pointer);\n if (obj === undefined) {\n obj = this.selectionHandler.getEdgeAt(pointer);\n }\n this.selectionHandler.hoverObject(obj);\n }\n }\n\n\n\n /**\n * Check if there is an element on the given position in the network\n * (a node or edge). If so, and if this element has a title,\n * show a popup window with its title.\n *\n * @param {{x:Number, y:Number}} pointer\n * @private\n */\n _checkShowPopup(pointer) {\n let x = this.canvas._XconvertDOMtoCanvas(pointer.x);\n let y = this.canvas._YconvertDOMtoCanvas(pointer.y);\n let pointerObj = {\n left: x,\n top: y,\n right: x,\n bottom: y\n };\n\n let previousPopupObjId = this.popupObj === undefined ? undefined : this.popupObj.id;\n let nodeUnderCursor = false;\n let popupType = 'node';\n\n // check if a node is under the cursor.\n if (this.popupObj === undefined) {\n // search the nodes for overlap, select the top one in case of multiple nodes\n let nodeIndices = this.body.nodeIndices;\n let nodes = this.body.nodes;\n let node;\n let overlappingNodes = [];\n for (let i = 0; i < nodeIndices.length; i++) {\n node = nodes[nodeIndices[i]];\n if (node.isOverlappingWith(pointerObj) === true) {\n if (node.getTitle() !== undefined) {\n overlappingNodes.push(nodeIndices[i]);\n }\n }\n }\n\n if (overlappingNodes.length > 0) {\n // if there are overlapping nodes, select the last one, this is the one which is drawn on top of the others\n this.popupObj = nodes[overlappingNodes[overlappingNodes.length - 1]];\n // if you hover over a node, the title of the edge is not supposed to be shown.\n nodeUnderCursor = true;\n }\n }\n\n if (this.popupObj === undefined && nodeUnderCursor === false) {\n // search the edges for overlap\n let edgeIndices = this.body.edgeIndices;\n let edges = this.body.edges;\n let edge;\n let overlappingEdges = [];\n for (let i = 0; i < edgeIndices.length; i++) {\n edge = edges[edgeIndices[i]];\n if (edge.isOverlappingWith(pointerObj) === true) {\n if (edge.connected === true && edge.getTitle() !== undefined) {\n overlappingEdges.push(edgeIndices[i]);\n }\n }\n }\n\n if (overlappingEdges.length > 0) {\n this.popupObj = edges[overlappingEdges[overlappingEdges.length - 1]];\n popupType = 'edge';\n }\n }\n\n if (this.popupObj !== undefined) {\n // show popup message window\n if (this.popupObj.id !== previousPopupObjId) {\n if (this.popup === undefined) {\n this.popup = new Popup(this.canvas.frame);\n }\n\n this.popup.popupTargetType = popupType;\n this.popup.popupTargetId = this.popupObj.id;\n\n // adjust a small offset such that the mouse cursor is located in the\n // bottom left location of the popup, and you can easily move over the\n // popup area\n this.popup.setPosition(pointer.x + 3, pointer.y - 5);\n this.popup.setText(this.popupObj.getTitle());\n this.popup.show();\n this.body.emitter.emit('showPopup',this.popupObj.id);\n }\n }\n else {\n if (this.popup !== undefined) {\n this.popup.hide();\n this.body.emitter.emit('hidePopup');\n }\n }\n }\n\n\n /**\n * Check if the popup must be hidden, which is the case when the mouse is no\n * longer hovering on the object\n * @param {{x:Number, y:Number}} pointer\n * @private\n */\n _checkHidePopup(pointer) {\n let pointerObj = this.selectionHandler._pointerToPositionObject(pointer);\n\n let stillOnObj = false;\n if (this.popup.popupTargetType === 'node') {\n if (this.body.nodes[this.popup.popupTargetId] !== undefined) {\n stillOnObj = this.body.nodes[this.popup.popupTargetId].isOverlappingWith(pointerObj);\n\n // if the mouse is still one the node, we have to check if it is not also on one that is drawn on top of it.\n // we initially only check stillOnObj because this is much faster.\n if (stillOnObj === true) {\n let overNode = this.selectionHandler.getNodeAt(pointer);\n stillOnObj = overNode === undefined ? false : overNode.id === this.popup.popupTargetId;\n }\n }\n }\n else {\n if (this.selectionHandler.getNodeAt(pointer) === undefined) {\n if (this.body.edges[this.popup.popupTargetId] !== undefined) {\n stillOnObj = this.body.edges[this.popup.popupTargetId].isOverlappingWith(pointerObj);\n }\n }\n }\n\n\n if (stillOnObj === false) {\n this.popupObj = undefined;\n this.popup.hide();\n this.body.emitter.emit('hidePopup');\n }\n }\n\n}\n\nexport default InteractionHandler;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/InteractionHandler.js","var util = require('../../../util');\nvar Hammer = require('../../../module/hammer');\nvar hammerUtil = require('../../../hammerUtil');\nvar keycharm = require('keycharm');\n\nclass NavigationHandler {\n constructor(body, canvas) {\n this.body = body;\n this.canvas = canvas;\n\n this.iconsCreated = false;\n this.navigationHammers = [];\n this.boundFunctions = {};\n this.touchTime = 0;\n this.activated = false;\n\n\n this.body.emitter.on(\"activate\", () => {this.activated = true; this.configureKeyboardBindings();});\n this.body.emitter.on(\"deactivate\", () => {this.activated = false; this.configureKeyboardBindings();});\n this.body.emitter.on(\"destroy\", () => {if (this.keycharm !== undefined) {this.keycharm.destroy();}});\n\n this.options = {}\n }\n\n setOptions(options) {\n if (options !== undefined) {\n this.options = options;\n this.create();\n }\n }\n\n create() {\n if (this.options.navigationButtons === true) {\n if (this.iconsCreated === false) {\n this.loadNavigationElements();\n }\n }\n else if (this.iconsCreated === true) {\n this.cleanNavigation();\n }\n\n this.configureKeyboardBindings();\n }\n\n cleanNavigation() {\n // clean hammer bindings\n if (this.navigationHammers.length != 0) {\n for (var i = 0; i < this.navigationHammers.length; i++) {\n this.navigationHammers[i].destroy();\n }\n this.navigationHammers = [];\n }\n\n // clean up previous navigation items\n if (this.navigationDOM && this.navigationDOM['wrapper'] && this.navigationDOM['wrapper'].parentNode) {\n this.navigationDOM['wrapper'].parentNode.removeChild(this.navigationDOM['wrapper']);\n }\n\n this.iconsCreated = false;\n }\n\n /**\n * Creation of the navigation controls nodes. They are drawn over the rest of the nodes and are not affected by scale and translation\n * they have a triggerFunction which is called on click. If the position of the navigation controls is dependent\n * on this.frame.canvas.clientWidth or this.frame.canvas.clientHeight, we flag horizontalAlignLeft and verticalAlignTop false.\n * This means that the location will be corrected by the _relocateNavigation function on a size change of the canvas.\n *\n * @private\n */\n loadNavigationElements() {\n this.cleanNavigation();\n\n this.navigationDOM = {};\n var navigationDivs = ['up','down','left','right','zoomIn','zoomOut','zoomExtends'];\n var navigationDivActions = ['_moveUp','_moveDown','_moveLeft','_moveRight','_zoomIn','_zoomOut','_fit'];\n\n this.navigationDOM['wrapper'] = document.createElement('div');\n this.navigationDOM['wrapper'].className = 'vis-navigation';\n this.canvas.frame.appendChild(this.navigationDOM['wrapper']);\n\n for (var i = 0; i < navigationDivs.length; i++) {\n this.navigationDOM[navigationDivs[i]] = document.createElement('div');\n this.navigationDOM[navigationDivs[i]].className = 'vis-button vis-' + navigationDivs[i];\n this.navigationDOM['wrapper'].appendChild(this.navigationDOM[navigationDivs[i]]);\n\n var hammer = new Hammer(this.navigationDOM[navigationDivs[i]]);\n if (navigationDivActions[i] === \"_fit\") {\n hammerUtil.onTouch(hammer, this._fit.bind(this));\n }\n else {\n hammerUtil.onTouch(hammer, this.bindToRedraw.bind(this,navigationDivActions[i]));\n }\n\n this.navigationHammers.push(hammer);\n }\n\n // use a hammer for the release so we do not require the one used in the rest of the network\n // the one the rest uses can be overloaded by the manipulation system.\n var hammerFrame = new Hammer(this.canvas.frame);\n hammerUtil.onRelease(hammerFrame, () => {this._stopMovement();});\n this.navigationHammers.push(hammerFrame);\n\n this.iconsCreated = true;\n }\n\n bindToRedraw(action) {\n if (this.boundFunctions[action] === undefined) {\n this.boundFunctions[action] = this[action].bind(this);\n this.body.emitter.on(\"initRedraw\", this.boundFunctions[action]);\n this.body.emitter.emit(\"_startRendering\");\n }\n }\n\n unbindFromRedraw(action) {\n if (this.boundFunctions[action] !== undefined) {\n this.body.emitter.off(\"initRedraw\", this.boundFunctions[action]);\n this.body.emitter.emit(\"_stopRendering\");\n delete this.boundFunctions[action];\n }\n }\n\n /**\n * this stops all movement induced by the navigation buttons\n *\n * @private\n */\n _fit() {\n if (new Date().valueOf() - this.touchTime > 700) { // TODO: fix ugly hack to avoid hammer's double fireing of event (because we use release?)\n this.body.emitter.emit(\"fit\", {duration: 700});\n this.touchTime = new Date().valueOf();\n }\n }\n\n /**\n * this stops all movement induced by the navigation buttons\n *\n * @private\n */\n _stopMovement() {\n for (let boundAction in this.boundFunctions) {\n if (this.boundFunctions.hasOwnProperty(boundAction)) {\n this.body.emitter.off(\"initRedraw\", this.boundFunctions[boundAction]);\n this.body.emitter.emit(\"_stopRendering\");\n }\n }\n this.boundFunctions = {};\n }\n\n _moveUp() {this.body.view.translation.y += this.options.keyboard.speed.y;}\n _moveDown() {this.body.view.translation.y -= this.options.keyboard.speed.y;}\n _moveLeft() {this.body.view.translation.x += this.options.keyboard.speed.x;}\n _moveRight(){this.body.view.translation.x -= this.options.keyboard.speed.x;}\n _zoomIn() {\n var scaleOld = this.body.view.scale;\n var scale = this.body.view.scale * (1 + this.options.keyboard.speed.zoom);\n var translation = this.body.view.translation;\n var scaleFrac = scale / scaleOld;\n var tx = (1 - scaleFrac) * this.canvas.canvasViewCenter.x + translation.x * scaleFrac;\n var ty = (1 - scaleFrac) * this.canvas.canvasViewCenter.y + translation.y * scaleFrac;\n\n this.body.view.scale = scale;\n this.body.view.translation = { x: tx, y: ty };\n this.body.emitter.emit('zoom', { direction: '+', scale: this.body.view.scale, pointer: pointer });\n }\n _zoomOut() {\n var scaleOld = this.body.view.scale;\n var scale = this.body.view.scale / (1 + this.options.keyboard.speed.zoom);\n var translation = this.body.view.translation;\n var scaleFrac = scale / scaleOld;\n var tx = (1 - scaleFrac) * this.canvas.canvasViewCenter.x + translation.x * scaleFrac;\n var ty = (1 - scaleFrac) * this.canvas.canvasViewCenter.y + translation.y * scaleFrac;\n\n this.body.view.scale = scale;\n this.body.view.translation = { x: tx, y: ty };\n this.body.emitter.emit('zoom', { direction: '-', scale: this.body.view.scale, pointer: pointer });\n }\n\n\n /**\n * bind all keys using keycharm.\n */\n configureKeyboardBindings() {\n if (this.keycharm !== undefined) {\n this.keycharm.destroy();\n }\n\n if (this.options.keyboard.enabled === true) {\n if (this.options.keyboard.bindToWindow === true) {\n this.keycharm = keycharm({container: window, preventDefault: true});\n }\n else {\n this.keycharm = keycharm({container: this.canvas.frame, preventDefault: true});\n }\n\n this.keycharm.reset();\n\n if (this.activated === true) {\n this.keycharm.bind(\"up\", () => {this.bindToRedraw(\"_moveUp\") ;}, \"keydown\");\n this.keycharm.bind(\"down\", () => {this.bindToRedraw(\"_moveDown\") ;}, \"keydown\");\n this.keycharm.bind(\"left\", () => {this.bindToRedraw(\"_moveLeft\") ;}, \"keydown\");\n this.keycharm.bind(\"right\", () => {this.bindToRedraw(\"_moveRight\");}, \"keydown\");\n this.keycharm.bind(\"=\", () => {this.bindToRedraw(\"_zoomIn\") ;}, \"keydown\");\n this.keycharm.bind(\"num+\", () => {this.bindToRedraw(\"_zoomIn\") ;}, \"keydown\");\n this.keycharm.bind(\"num-\", () => {this.bindToRedraw(\"_zoomOut\") ;}, \"keydown\");\n this.keycharm.bind(\"-\", () => {this.bindToRedraw(\"_zoomOut\") ;}, \"keydown\");\n this.keycharm.bind(\"[\", () => {this.bindToRedraw(\"_zoomOut\") ;}, \"keydown\");\n this.keycharm.bind(\"]\", () => {this.bindToRedraw(\"_zoomIn\") ;}, \"keydown\");\n this.keycharm.bind(\"pageup\", () => {this.bindToRedraw(\"_zoomIn\") ;}, \"keydown\");\n this.keycharm.bind(\"pagedown\", () => {this.bindToRedraw(\"_zoomOut\") ;}, \"keydown\");\n\n this.keycharm.bind(\"up\", () => {this.unbindFromRedraw(\"_moveUp\") ;}, \"keyup\");\n this.keycharm.bind(\"down\", () => {this.unbindFromRedraw(\"_moveDown\") ;}, \"keyup\");\n this.keycharm.bind(\"left\", () => {this.unbindFromRedraw(\"_moveLeft\") ;}, \"keyup\");\n this.keycharm.bind(\"right\", () => {this.unbindFromRedraw(\"_moveRight\");}, \"keyup\");\n this.keycharm.bind(\"=\", () => {this.unbindFromRedraw(\"_zoomIn\") ;}, \"keyup\");\n this.keycharm.bind(\"num+\", () => {this.unbindFromRedraw(\"_zoomIn\") ;}, \"keyup\");\n this.keycharm.bind(\"num-\", () => {this.unbindFromRedraw(\"_zoomOut\") ;}, \"keyup\");\n this.keycharm.bind(\"-\", () => {this.unbindFromRedraw(\"_zoomOut\") ;}, \"keyup\");\n this.keycharm.bind(\"[\", () => {this.unbindFromRedraw(\"_zoomOut\") ;}, \"keyup\");\n this.keycharm.bind(\"]\", () => {this.unbindFromRedraw(\"_zoomIn\") ;}, \"keyup\");\n this.keycharm.bind(\"pageup\", () => {this.unbindFromRedraw(\"_zoomIn\") ;}, \"keyup\");\n this.keycharm.bind(\"pagedown\", () => {this.unbindFromRedraw(\"_zoomOut\") ;}, \"keyup\");\n }\n }\n }\n}\n\n\nexport default NavigationHandler;\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/NavigationHandler.js","import Node from './components/Node';\nimport Edge from './components/Edge';\n\nlet util = require('../../util');\n\nclass SelectionHandler {\n constructor(body, canvas) {\n this.body = body;\n this.canvas = canvas;\n this.selectionObj = {nodes: [], edges: []};\n this.hoverObj = {nodes:{},edges:{}};\n\n this.options = {};\n this.defaultOptions = {\n multiselect: false,\n selectable: true,\n selectConnectedEdges: true,\n hoverConnectedEdges: true\n };\n util.extend(this.options, this.defaultOptions);\n\n this.body.emitter.on(\"_dataChanged\", () => {\n this.updateSelection()\n });\n }\n\n\n setOptions(options) {\n if (options !== undefined) {\n let fields = ['multiselect','hoverConnectedEdges','selectable','selectConnectedEdges'];\n util.selectiveDeepExtend(fields,this.options, options);\n }\n }\n\n\n /**\n * handles the selection part of the tap;\n *\n * @param {Object} pointer\n * @private\n */\n selectOnPoint(pointer) {\n let selected = false;\n if (this.options.selectable === true) {\n let obj = this.getNodeAt(pointer) || this.getEdgeAt(pointer);\n\n // unselect after getting the objects in order to restore width and height.\n this.unselectAll();\n\n if (obj !== undefined) {\n selected = this.selectObject(obj);\n }\n this.body.emitter.emit(\"_requestRedraw\");\n }\n return selected;\n }\n\n selectAdditionalOnPoint(pointer) {\n let selectionChanged = false;\n if (this.options.selectable === true) {\n let obj = this.getNodeAt(pointer) || this.getEdgeAt(pointer);\n\n if (obj !== undefined) {\n selectionChanged = true;\n if (obj.isSelected() === true) {\n this.deselectObject(obj);\n }\n else {\n this.selectObject(obj);\n }\n\n this.body.emitter.emit(\"_requestRedraw\");\n }\n }\n return selectionChanged;\n }\n\n _generateClickEvent(eventType, event, pointer, oldSelection, emptySelection = false) {\n let properties;\n if (emptySelection === true) {\n properties = {nodes:[], edges:[]};\n }\n else {\n properties = this.getSelection();\n }\n properties['pointer'] = {\n DOM: {x: pointer.x, y: pointer.y},\n canvas: this.canvas.DOMtoCanvas(pointer)\n };\n properties['event'] = event;\n\n if (oldSelection !== undefined) {\n properties['previousSelection'] = oldSelection;\n }\n this.body.emitter.emit(eventType, properties);\n }\n\n selectObject(obj, highlightEdges = this.options.selectConnectedEdges) {\n if (obj !== undefined) {\n if (obj instanceof Node) {\n if (highlightEdges === true) {\n this._selectConnectedEdges(obj);\n }\n }\n obj.select();\n this._addToSelection(obj);\n return true;\n }\n return false;\n }\n\n deselectObject(obj) {\n if (obj.isSelected() === true) {\n obj.selected = false;\n this._removeFromSelection(obj);\n }\n }\n\n\n\n /**\n * retrieve all nodes overlapping with given object\n * @param {Object} object An object with parameters left, top, right, bottom\n * @return {Number[]} An array with id's of the overlapping nodes\n * @private\n */\n _getAllNodesOverlappingWith(object) {\n let overlappingNodes = [];\n let nodes = this.body.nodes;\n for (let i = 0; i < this.body.nodeIndices.length; i++) {\n let nodeId = this.body.nodeIndices[i];\n if (nodes[nodeId].isOverlappingWith(object)) {\n overlappingNodes.push(nodeId);\n }\n }\n return overlappingNodes;\n }\n\n\n /**\n * Return a position object in canvasspace from a single point in screenspace\n *\n * @param pointer\n * @returns {{left: number, top: number, right: number, bottom: number}}\n * @private\n */\n _pointerToPositionObject(pointer) {\n let canvasPos = this.canvas.DOMtoCanvas(pointer);\n return {\n left: canvasPos.x - 1,\n top: canvasPos.y + 1,\n right: canvasPos.x + 1,\n bottom: canvasPos.y - 1\n };\n }\n\n\n /**\n * Get the top node at the a specific point (like a click)\n *\n * @param {{x: Number, y: Number}} pointer\n * @return {Node | undefined} node\n */\n getNodeAt(pointer, returnNode = true) {\n // we first check if this is an navigation controls element\n let positionObject = this._pointerToPositionObject(pointer);\n let overlappingNodes = this._getAllNodesOverlappingWith(positionObject);\n // if there are overlapping nodes, select the last one, this is the\n // one which is drawn on top of the others\n if (overlappingNodes.length > 0) {\n if (returnNode === true) {\n return this.body.nodes[overlappingNodes[overlappingNodes.length - 1]];\n }\n else {\n return overlappingNodes[overlappingNodes.length - 1];\n }\n }\n else {\n return undefined;\n }\n }\n\n\n /**\n * retrieve all edges overlapping with given object, selector is around center\n * @param {Object} object An object with parameters left, top, right, bottom\n * @return {Number[]} An array with id's of the overlapping nodes\n * @private\n */\n _getEdgesOverlappingWith(object, overlappingEdges) {\n let edges = this.body.edges;\n for (let i = 0; i < this.body.edgeIndices.length; i++) {\n let edgeId = this.body.edgeIndices[i];\n if (edges[edgeId].isOverlappingWith(object)) {\n overlappingEdges.push(edgeId);\n }\n }\n }\n\n\n /**\n * retrieve all nodes overlapping with given object\n * @param {Object} object An object with parameters left, top, right, bottom\n * @return {Number[]} An array with id's of the overlapping nodes\n * @private\n */\n _getAllEdgesOverlappingWith(object) {\n let overlappingEdges = [];\n this._getEdgesOverlappingWith(object,overlappingEdges);\n return overlappingEdges;\n }\n\n\n /**\n * Place holder. To implement change the getNodeAt to a _getObjectAt. Have the _getObjectAt call\n * getNodeAt and _getEdgesAt, then priortize the selection to user preferences.\n *\n * @param pointer\n * @returns {undefined}\n */\n getEdgeAt(pointer, returnEdge = true) {\n // Iterate over edges, pick closest within 10\n var canvasPos = this.canvas.DOMtoCanvas(pointer);\n var mindist = 10;\n var overlappingEdge = null;\n var edges = this.body.edges;\n for (var i = 0; i < this.body.edgeIndices.length; i++) {\n var edgeId = this.body.edgeIndices[i];\n var edge = edges[edgeId];\n if (edge.connected) {\n var xFrom = edge.from.x;\n var yFrom = edge.from.y;\n var xTo = edge.to.x;\n var yTo = edge.to.y;\n var dist = edge.edgeType.getDistanceToEdge(xFrom, yFrom, xTo, yTo, canvasPos.x, canvasPos.y);\n if(dist < mindist){\n overlappingEdge = edgeId;\n mindist = dist;\n }\n }\n }\n if (overlappingEdge) {\n if (returnEdge === true) {\n return this.body.edges[overlappingEdge];\n }\n else {\n return overlappingEdge;\n }\n }\n else {\n return undefined;\n }\n }\n\n\n /**\n * Add object to the selection array.\n *\n * @param obj\n * @private\n */\n _addToSelection(obj) {\n if (obj instanceof Node) {\n this.selectionObj.nodes[obj.id] = obj;\n }\n else {\n this.selectionObj.edges[obj.id] = obj;\n }\n }\n\n /**\n * Add object to the selection array.\n *\n * @param obj\n * @private\n */\n _addToHover(obj) {\n if (obj instanceof Node) {\n this.hoverObj.nodes[obj.id] = obj;\n }\n else {\n this.hoverObj.edges[obj.id] = obj;\n }\n }\n\n\n /**\n * Remove a single option from selection.\n *\n * @param {Object} obj\n * @private\n */\n _removeFromSelection(obj) {\n if (obj instanceof Node) {\n delete this.selectionObj.nodes[obj.id];\n this._unselectConnectedEdges(obj);\n }\n else {\n delete this.selectionObj.edges[obj.id];\n }\n }\n\n /**\n * Unselect all. The selectionObj is useful for this.\n */\n unselectAll() {\n for(let nodeId in this.selectionObj.nodes) {\n if(this.selectionObj.nodes.hasOwnProperty(nodeId)) {\n this.selectionObj.nodes[nodeId].unselect();\n }\n }\n for(let edgeId in this.selectionObj.edges) {\n if(this.selectionObj.edges.hasOwnProperty(edgeId)) {\n this.selectionObj.edges[edgeId].unselect();\n }\n }\n\n this.selectionObj = {nodes:{},edges:{}};\n }\n\n\n /**\n * return the number of selected nodes\n *\n * @returns {number}\n * @private\n */\n _getSelectedNodeCount() {\n let count = 0;\n for (let nodeId in this.selectionObj.nodes) {\n if (this.selectionObj.nodes.hasOwnProperty(nodeId)) {\n count += 1;\n }\n }\n return count;\n }\n\n /**\n * return the selected node\n *\n * @returns {number}\n * @private\n */\n _getSelectedNode() {\n for (let nodeId in this.selectionObj.nodes) {\n if (this.selectionObj.nodes.hasOwnProperty(nodeId)) {\n return this.selectionObj.nodes[nodeId];\n }\n }\n return undefined;\n }\n\n /**\n * return the selected edge\n *\n * @returns {number}\n * @private\n */\n _getSelectedEdge() {\n for (let edgeId in this.selectionObj.edges) {\n if (this.selectionObj.edges.hasOwnProperty(edgeId)) {\n return this.selectionObj.edges[edgeId];\n }\n }\n return undefined;\n }\n\n\n /**\n * return the number of selected edges\n *\n * @returns {number}\n * @private\n */\n _getSelectedEdgeCount() {\n let count = 0;\n for (let edgeId in this.selectionObj.edges) {\n if (this.selectionObj.edges.hasOwnProperty(edgeId)) {\n count += 1;\n }\n }\n return count;\n }\n\n\n /**\n * return the number of selected objects.\n *\n * @returns {number}\n * @private\n */\n _getSelectedObjectCount() {\n let count = 0;\n for(let nodeId in this.selectionObj.nodes) {\n if(this.selectionObj.nodes.hasOwnProperty(nodeId)) {\n count += 1;\n }\n }\n for(let edgeId in this.selectionObj.edges) {\n if(this.selectionObj.edges.hasOwnProperty(edgeId)) {\n count += 1;\n }\n }\n return count;\n }\n\n /**\n * Check if anything is selected\n *\n * @returns {boolean}\n * @private\n */\n _selectionIsEmpty() {\n for(let nodeId in this.selectionObj.nodes) {\n if(this.selectionObj.nodes.hasOwnProperty(nodeId)) {\n return false;\n }\n }\n for(let edgeId in this.selectionObj.edges) {\n if(this.selectionObj.edges.hasOwnProperty(edgeId)) {\n return false;\n }\n }\n return true;\n }\n\n\n /**\n * check if one of the selected nodes is a cluster.\n *\n * @returns {boolean}\n * @private\n */\n _clusterInSelection() {\n for(let nodeId in this.selectionObj.nodes) {\n if(this.selectionObj.nodes.hasOwnProperty(nodeId)) {\n if (this.selectionObj.nodes[nodeId].clusterSize > 1) {\n return true;\n }\n }\n }\n return false;\n }\n\n /**\n * select the edges connected to the node that is being selected\n *\n * @param {Node} node\n * @private\n */\n _selectConnectedEdges(node) {\n for (let i = 0; i < node.edges.length; i++) {\n let edge = node.edges[i];\n edge.select();\n this._addToSelection(edge);\n }\n }\n\n /**\n * select the edges connected to the node that is being selected\n *\n * @param {Node} node\n * @private\n */\n _hoverConnectedEdges(node) {\n for (let i = 0; i < node.edges.length; i++) {\n let edge = node.edges[i];\n edge.hover = true;\n this._addToHover(edge);\n }\n }\n\n\n /**\n * unselect the edges connected to the node that is being selected\n *\n * @param {Node} node\n * @private\n */\n _unselectConnectedEdges(node) {\n for (let i = 0; i < node.edges.length; i++) {\n let edge = node.edges[i];\n edge.unselect();\n this._removeFromSelection(edge);\n }\n }\n\n\n /**\n * This is called when someone clicks on a node. either select or deselect it.\n * If there is an existing selection and we don't want to append to it, clear the existing selection\n *\n * @param {Node || Edge} object\n * @private\n */\n blurObject(object) {\n if (object.hover === true) {\n object.hover = false;\n if (object instanceof Node) {\n this.body.emitter.emit(\"blurNode\", {node: object.id});\n }\n else {\n this.body.emitter.emit(\"blurEdge\", {edge: object.id});\n }\n }\n }\n\n /**\n * This is called when someone clicks on a node. either select or deselect it.\n * If there is an existing selection and we don't want to append to it, clear the existing selection\n *\n * @param {Node || Edge} object\n * @private\n */\n hoverObject(object) {\n let hoverChanged = false;\n // remove all node hover highlights\n for (let nodeId in this.hoverObj.nodes) {\n if (this.hoverObj.nodes.hasOwnProperty(nodeId)) {\n if (object === undefined || (object instanceof Node && object.id != nodeId) || object instanceof Edge) {\n this.blurObject(this.hoverObj.nodes[nodeId]);\n delete this.hoverObj.nodes[nodeId];\n hoverChanged = true;\n }\n }\n }\n\n // removing all edge hover highlights\n for (let edgeId in this.hoverObj.edges) {\n if (this.hoverObj.edges.hasOwnProperty(edgeId)) {\n // if the hover has been changed here it means that the node has been hovered over or off\n // we then do not use the blurObject method here.\n if (hoverChanged === true) {\n this.hoverObj.edges[edgeId].hover = false;\n delete this.hoverObj.edges[edgeId];\n }\n // if the blur remains the same and the object is undefined (mouse off) or another\n // edge has been hovered, or another node has been hovered we blur the edge.\n else if (object === undefined || (object instanceof Edge && object.id != edgeId) || (object instanceof Node && !object.hover)) {\n this.blurObject(this.hoverObj.edges[edgeId]);\n delete this.hoverObj.edges[edgeId];\n hoverChanged = true;\n }\n }\n }\n\n if (object !== undefined) {\n if (object.hover === false) {\n object.hover = true;\n this._addToHover(object);\n hoverChanged = true;\n if (object instanceof Node) {\n this.body.emitter.emit(\"hoverNode\", {node: object.id});\n }\n else {\n this.body.emitter.emit(\"hoverEdge\", {edge: object.id});\n }\n }\n if (object instanceof Node && this.options.hoverConnectedEdges === true) {\n this._hoverConnectedEdges(object);\n }\n }\n\n if (hoverChanged === true) {\n this.body.emitter.emit('_requestRedraw');\n }\n }\n\n\n\n\n /**\n *\n * retrieve the currently selected objects\n * @return {{nodes: Array., edges: Array.}} selection\n */\n getSelection() {\n let nodeIds = this.getSelectedNodes();\n let edgeIds = this.getSelectedEdges();\n return {nodes:nodeIds, edges:edgeIds};\n }\n\n /**\n *\n * retrieve the currently selected nodes\n * @return {String[]} selection An array with the ids of the\n * selected nodes.\n */\n getSelectedNodes() {\n let idArray = [];\n if (this.options.selectable === true) {\n for (let nodeId in this.selectionObj.nodes) {\n if (this.selectionObj.nodes.hasOwnProperty(nodeId)) {\n idArray.push(this.selectionObj.nodes[nodeId].id);\n }\n }\n }\n return idArray;\n }\n\n /**\n *\n * retrieve the currently selected edges\n * @return {Array} selection An array with the ids of the\n * selected nodes.\n */\n getSelectedEdges() {\n let idArray = [];\n if (this.options.selectable === true) {\n for (let edgeId in this.selectionObj.edges) {\n if (this.selectionObj.edges.hasOwnProperty(edgeId)) {\n idArray.push(this.selectionObj.edges[edgeId].id);\n }\n }\n }\n return idArray;\n }\n\n /**\n * Updates the current selection\n * @param {{nodes: Array., edges: Array.}} Selection\n * @param {Object} options Options\n */\n setSelection(selection, options = {}) {\n let i, id;\n\n if (!selection || (!selection.nodes && !selection.edges))\n throw 'Selection must be an object with nodes and/or edges properties';\n // first unselect any selected node, if option is true or undefined\n if (options.unselectAll || options.unselectAll === undefined) {\n this.unselectAll();\n }\n if (selection.nodes) {\n for (i = 0; i < selection.nodes.length; i++) {\n id = selection.nodes[i];\n\n let node = this.body.nodes[id];\n if (!node) {\n throw new RangeError('Node with id \"' + id + '\" not found');\n }\n // don't select edges with it\n this.selectObject(node, options.highlightEdges);\n }\n }\n\n if (selection.edges) {\n for (i = 0; i < selection.edges.length; i++) {\n id = selection.edges[i];\n\n let edge = this.body.edges[id];\n if (!edge) {\n throw new RangeError('Edge with id \"' + id + '\" not found');\n }\n this.selectObject(edge);\n }\n }\n this.body.emitter.emit('_requestRedraw');\n }\n\n\n /**\n * select zero or more nodes with the option to highlight edges\n * @param {Number[] | String[]} selection An array with the ids of the\n * selected nodes.\n * @param {boolean} [highlightEdges]\n */\n selectNodes(selection, highlightEdges = true) {\n if (!selection || (selection.length === undefined))\n throw 'Selection must be an array with ids';\n\n this.setSelection({nodes: selection}, {highlightEdges: highlightEdges});\n }\n\n\n /**\n * select zero or more edges\n * @param {Number[] | String[]} selection An array with the ids of the\n * selected nodes.\n */\n selectEdges(selection) {\n if (!selection || (selection.length === undefined))\n throw 'Selection must be an array with ids';\n\n this.setSelection({edges: selection});\n }\n\n /**\n * Validate the selection: remove ids of nodes which no longer exist\n * @private\n */\n updateSelection() {\n for (let nodeId in this.selectionObj.nodes) {\n if (this.selectionObj.nodes.hasOwnProperty(nodeId)) {\n if (!this.body.nodes.hasOwnProperty(nodeId)) {\n delete this.selectionObj.nodes[nodeId];\n }\n }\n }\n for (let edgeId in this.selectionObj.edges) {\n if (this.selectionObj.edges.hasOwnProperty(edgeId)) {\n if (!this.body.edges.hasOwnProperty(edgeId)) {\n delete this.selectionObj.edges[edgeId];\n }\n }\n }\n }\n}\n\nexport default SelectionHandler;\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/SelectionHandler.js","'use strict';\n\nlet util = require('../../util');\nimport NetworkUtil from '../NetworkUtil';\n\nclass LayoutEngine {\n constructor(body) {\n this.body = body;\n\n this.initialRandomSeed = Math.round(Math.random() * 1000000);\n this.randomSeed = this.initialRandomSeed;\n this.setPhysics = false;\n this.options = {};\n this.optionsBackup = {physics:{}};\n\n this.defaultOptions = {\n randomSeed: undefined,\n improvedLayout: true,\n hierarchical: {\n enabled:false,\n levelSeparation: 150,\n nodeSpacing: 100,\n treeSpacing: 200,\n blockShifting: true,\n edgeMinimization: true,\n parentCentralization: true,\n direction: 'UD', // UD, DU, LR, RL\n sortMethod: 'hubsize' // hubsize, directed\n }\n };\n util.extend(this.options, this.defaultOptions);\n this.bindEventListeners();\n }\n\n bindEventListeners() {\n this.body.emitter.on('_dataChanged', () => {\n this.setupHierarchicalLayout();\n });\n this.body.emitter.on('_dataLoaded', () => {\n this.layoutNetwork();\n });\n this.body.emitter.on('_resetHierarchicalLayout', () => {\n this.setupHierarchicalLayout();\n });\n }\n\n setOptions(options, allOptions) {\n if (options !== undefined) {\n let prevHierarchicalState = this.options.hierarchical.enabled;\n util.selectiveDeepExtend([\"randomSeed\", \"improvedLayout\"],this.options, options);\n util.mergeOptions(this.options, options, 'hierarchical');\n if (options.randomSeed !== undefined) {this.initialRandomSeed = options.randomSeed;}\n\n if (this.options.hierarchical.enabled === true) {\n if (prevHierarchicalState === true) {\n // refresh the overridden options for nodes and edges.\n this.body.emitter.emit('refresh', true);\n }\n\n // make sure the level separation is the right way up\n if (this.options.hierarchical.direction === 'RL' || this.options.hierarchical.direction === 'DU') {\n if (this.options.hierarchical.levelSeparation > 0) {\n this.options.hierarchical.levelSeparation *= -1;\n }\n }\n else {\n if (this.options.hierarchical.levelSeparation < 0) {\n this.options.hierarchical.levelSeparation *= -1;\n }\n }\n\n this.body.emitter.emit('_resetHierarchicalLayout');\n // because the hierarchical system needs it's own physics and smooth curve settings, we adapt the other options if needed.\n return this.adaptAllOptionsForHierarchicalLayout(allOptions);\n }\n else {\n if (prevHierarchicalState === true) {\n // refresh the overridden options for nodes and edges.\n this.body.emitter.emit('refresh');\n return util.deepExtend(allOptions,this.optionsBackup);\n }\n }\n }\n return allOptions;\n }\n\n adaptAllOptionsForHierarchicalLayout(allOptions) {\n if (this.options.hierarchical.enabled === true) {\n // set the physics\n if (allOptions.physics === undefined || allOptions.physics === true) {\n allOptions.physics = {\n enabled:this.optionsBackup.physics.enabled === undefined ? true : this.optionsBackup.physics.enabled,\n solver:'hierarchicalRepulsion'\n };\n this.optionsBackup.physics.enabled = this.optionsBackup.physics.enabled === undefined ? true : this.optionsBackup.physics.enabled;\n this.optionsBackup.physics.solver = this.optionsBackup.physics.solver || 'barnesHut';\n }\n else if (typeof allOptions.physics === 'object') {\n this.optionsBackup.physics.enabled = allOptions.physics.enabled === undefined ? true : allOptions.physics.enabled;\n this.optionsBackup.physics.solver = allOptions.physics.solver || 'barnesHut';\n allOptions.physics.solver = 'hierarchicalRepulsion';\n }\n else if (allOptions.physics !== false) {\n this.optionsBackup.physics.solver ='barnesHut';\n allOptions.physics = {solver:'hierarchicalRepulsion'};\n }\n\n // get the type of static smooth curve in case it is required\n let type = 'horizontal';\n if (this.options.hierarchical.direction === 'RL' || this.options.hierarchical.direction === 'LR') {\n type = 'vertical';\n }\n\n // disable smooth curves if nothing is defined. If smooth curves have been turned on, turn them into static smooth curves.\n if (allOptions.edges === undefined) {\n this.optionsBackup.edges = {smooth:{enabled:true, type:'dynamic'}};\n allOptions.edges = {smooth: false};\n }\n else if (allOptions.edges.smooth === undefined) {\n this.optionsBackup.edges = {smooth:{enabled:true, type:'dynamic'}};\n allOptions.edges.smooth = false;\n }\n else {\n if (typeof allOptions.edges.smooth === 'boolean') {\n this.optionsBackup.edges = {smooth:allOptions.edges.smooth};\n allOptions.edges.smooth = {enabled: allOptions.edges.smooth, type:type}\n }\n else {\n // allow custom types except for dynamic\n if (allOptions.edges.smooth.type !== undefined && allOptions.edges.smooth.type !== 'dynamic') {\n type = allOptions.edges.smooth.type;\n }\n\n this.optionsBackup.edges = {\n smooth: allOptions.edges.smooth.enabled === undefined ? true : allOptions.edges.smooth.enabled,\n type: allOptions.edges.smooth.type === undefined ? 'dynamic' : allOptions.edges.smooth.type,\n roundness: allOptions.edges.smooth.roundness === undefined ? 0.5 : allOptions.edges.smooth.roundness,\n forceDirection: allOptions.edges.smooth.forceDirection === undefined ? false : allOptions.edges.smooth.forceDirection\n };\n allOptions.edges.smooth = {\n enabled: allOptions.edges.smooth.enabled === undefined ? true : allOptions.edges.smooth.enabled,\n type:type,\n roundness: allOptions.edges.smooth.roundness === undefined ? 0.5 : allOptions.edges.smooth.roundness,\n forceDirection: allOptions.edges.smooth.forceDirection === undefined ? false : allOptions.edges.smooth.forceDirection\n }\n }\n }\n\n // force all edges into static smooth curves. Only applies to edges that do not use the global options for smooth.\n this.body.emitter.emit('_forceDisableDynamicCurves', type);\n }\n\n return allOptions;\n }\n\n seededRandom() {\n let x = Math.sin(this.randomSeed++) * 10000;\n return x - Math.floor(x);\n }\n\n positionInitially(nodesArray) {\n if (this.options.hierarchical.enabled !== true) {\n this.randomSeed = this.initialRandomSeed;\n for (let i = 0; i < nodesArray.length; i++) {\n let node = nodesArray[i];\n let radius = 10 * 0.1 * nodesArray.length + 10;\n let angle = 2 * Math.PI * this.seededRandom();\n if (node.x === undefined) {\n node.x = radius * Math.cos(angle);\n }\n if (node.y === undefined) {\n node.y = radius * Math.sin(angle);\n }\n }\n }\n }\n\n\n /**\n * Use Kamada Kawai to position nodes. This is quite a heavy algorithm so if there are a lot of nodes we\n * cluster them first to reduce the amount.\n */\n layoutNetwork() {\n if (this.options.hierarchical.enabled !== true && this.options.improvedLayout === true) {\n // first check if we should Kamada Kawai to layout. The threshold is if less than half of the visible\n // nodes have predefined positions we use this.\n let positionDefined = 0;\n for (let i = 0; i < this.body.nodeIndices.length; i++) {\n let node = this.body.nodes[this.body.nodeIndices[i]];\n if (node.predefinedPosition === true) {\n positionDefined += 1;\n }\n }\n\n // if less than half of the nodes have a predefined position we continue\n if (positionDefined < 0.5 * this.body.nodeIndices.length) {\n let MAX_LEVELS = 10;\n let level = 0;\n let clusterThreshold = 100;\n // if there are a lot of nodes, we cluster before we run the algorithm.\n if (this.body.nodeIndices.length > clusterThreshold) {\n let startLength = this.body.nodeIndices.length;\n while (this.body.nodeIndices.length > clusterThreshold) {\n //console.time(\"clustering\")\n level += 1;\n let before = this.body.nodeIndices.length;\n // if there are many nodes we do a hubsize cluster\n if (level % 3 === 0) {\n this.body.modules.clustering.clusterBridges();\n }\n else {\n this.body.modules.clustering.clusterOutliers();\n }\n let after = this.body.nodeIndices.length;\n if ((before == after && level % 3 !== 0) || level > MAX_LEVELS) {\n this._declusterAll();\n this.body.emitter.emit(\"_layoutFailed\");\n console.info(\"This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.\");\n return;\n }\n //console.timeEnd(\"clustering\")\n //console.log(level,after)\n }\n // increase the size of the edges\n this.body.modules.kamadaKawai.setOptions({springLength: Math.max(150, 2 * startLength)})\n }\n\n // position the system for these nodes and edges\n this.body.modules.kamadaKawai.solve(this.body.nodeIndices, this.body.edgeIndices, true);\n\n // shift to center point\n this._shiftToCenter();\n\n // perturb the nodes a little bit to force the physics to kick in\n let offset = 70;\n for (let i = 0; i < this.body.nodeIndices.length; i++) {\n // Only perturb the nodes that aren't fixed\n if (this.body.nodes[this.body.nodeIndices[i]].predefinedPosition === false) {\n this.body.nodes[this.body.nodeIndices[i]].x += (0.5 - this.seededRandom())*offset;\n this.body.nodes[this.body.nodeIndices[i]].y += (0.5 - this.seededRandom())*offset;\n }\n }\n\n // uncluster all clusters\n this._declusterAll();\n\n // reposition all bezier nodes.\n this.body.emitter.emit(\"_repositionBezierNodes\");\n }\n }\n }\n\n /**\n * Move all the nodes towards to the center so gravitational pull wil not move the nodes away from view\n * @private\n */\n _shiftToCenter() {\n let range = NetworkUtil.getRangeCore(this.body.nodes, this.body.nodeIndices);\n let center = NetworkUtil.findCenter(range);\n for (let i = 0; i < this.body.nodeIndices.length; i++) {\n this.body.nodes[this.body.nodeIndices[i]].x -= center.x;\n this.body.nodes[this.body.nodeIndices[i]].y -= center.y;\n }\n }\n\n _declusterAll() {\n let clustersPresent = true;\n while (clustersPresent === true) {\n clustersPresent = false;\n for (let i = 0; i < this.body.nodeIndices.length; i++) {\n if (this.body.nodes[this.body.nodeIndices[i]].isCluster === true) {\n clustersPresent = true;\n this.body.modules.clustering.openCluster(this.body.nodeIndices[i], {}, false);\n }\n }\n if (clustersPresent === true) {\n this.body.emitter.emit('_dataChanged');\n }\n }\n }\n\n getSeed() {\n return this.initialRandomSeed;\n }\n\n /**\n * This is the main function to layout the nodes in a hierarchical way.\n * It checks if the node details are supplied correctly\n *\n * @private\n */\n setupHierarchicalLayout() {\n if (this.options.hierarchical.enabled === true && this.body.nodeIndices.length > 0) {\n // get the size of the largest hubs and check if the user has defined a level for a node.\n let node, nodeId;\n let definedLevel = false;\n let definedPositions = true;\n let undefinedLevel = false;\n this.hierarchicalLevels = {};\n this.lastNodeOnLevel = {};\n this.hierarchicalChildrenReference = {};\n this.hierarchicalParentReference = {};\n this.hierarchicalTrees = {};\n this.treeIndex = -1;\n\n this.distributionOrdering = {};\n this.distributionIndex = {};\n this.distributionOrderingPresence = {};\n\n\n for (nodeId in this.body.nodes) {\n if (this.body.nodes.hasOwnProperty(nodeId)) {\n node = this.body.nodes[nodeId];\n if (node.options.x === undefined && node.options.y === undefined) {\n definedPositions = false;\n }\n if (node.options.level !== undefined) {\n definedLevel = true;\n this.hierarchicalLevels[nodeId] = node.options.level;\n }\n else {\n undefinedLevel = true;\n }\n }\n }\n\n // if the user defined some levels but not all, alert and run without hierarchical layout\n if (undefinedLevel === true && definedLevel === true) {\n throw new Error('To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.');\n return;\n }\n else {\n // define levels if undefined by the users. Based on hubsize.\n if (undefinedLevel === true) {\n if (this.options.hierarchical.sortMethod === 'hubsize') {\n this._determineLevelsByHubsize();\n }\n else if (this.options.hierarchical.sortMethod === 'directed') {\n this._determineLevelsDirected();\n }\n else if (this.options.hierarchical.sortMethod === 'custom') {\n this._determineLevelsCustomCallback();\n }\n }\n\n\n // fallback for cases where there are nodes but no edges\n for (let nodeId in this.body.nodes) {\n if (this.body.nodes.hasOwnProperty(nodeId)) {\n if (this.hierarchicalLevels[nodeId] === undefined) {\n this.hierarchicalLevels[nodeId] = 0;\n }\n }\n }\n // check the distribution of the nodes per level.\n let distribution = this._getDistribution();\n\n // get the parent children relations.\n this._generateMap();\n\n // place the nodes on the canvas.\n this._placeNodesByHierarchy(distribution);\n\n // condense the whitespace.\n this._condenseHierarchy();\n\n // shift to center so gravity does not have to do much\n this._shiftToCenter();\n }\n }\n }\n\n /**\n * @private\n */\n _condenseHierarchy() {\n // Global var in this scope to define when the movement has stopped.\n let stillShifting = false;\n let branches = {};\n // first we have some methods to help shifting trees around.\n // the main method to shift the trees\n let shiftTrees = () => {\n let treeSizes = getTreeSizes();\n for (let i = 0; i < treeSizes.length - 1; i++) {\n let diff = treeSizes[i].max - treeSizes[i+1].min;\n shiftTree(i + 1, diff + this.options.hierarchical.treeSpacing);\n }\n };\n\n // shift a single tree by an offset\n let shiftTree = (index, offset) => {\n for (let nodeId in this.hierarchicalTrees) {\n if (this.hierarchicalTrees.hasOwnProperty(nodeId)) {\n if (this.hierarchicalTrees[nodeId] === index) {\n let node = this.body.nodes[nodeId];\n let pos = this._getPositionForHierarchy(node);\n this._setPositionForHierarchy(node, pos + offset, undefined, true);\n }\n }\n }\n };\n\n // get the width of a tree\n let getTreeSize = (index) => {\n let min = 1e9;\n let max = -1e9;\n for (let nodeId in this.hierarchicalTrees) {\n if (this.hierarchicalTrees.hasOwnProperty(nodeId)) {\n if (this.hierarchicalTrees[nodeId] === index) {\n let pos = this._getPositionForHierarchy(this.body.nodes[nodeId]);\n min = Math.min(pos, min);\n max = Math.max(pos, max);\n }\n }\n }\n return {min:min, max:max};\n };\n\n // get the width of all trees\n let getTreeSizes = () => {\n let treeWidths = [];\n for (let i = 0; i <= this.treeIndex; i++) {\n treeWidths.push(getTreeSize(i));\n }\n return treeWidths;\n };\n\n\n // get a map of all nodes in this branch\n let getBranchNodes = (source, map) => {\n map[source.id] = true;\n if (this.hierarchicalChildrenReference[source.id]) {\n let children = this.hierarchicalChildrenReference[source.id];\n if (children.length > 0) {\n for (let i = 0; i < children.length; i++) {\n getBranchNodes(this.body.nodes[children[i]], map);\n }\n }\n }\n };\n\n // get a min max width as well as the maximum movement space it has on either sides\n // we use min max terminology because width and height can interchange depending on the direction of the layout\n let getBranchBoundary = (branchMap, maxLevel = 1e9) => {\n let minSpace = 1e9;\n let maxSpace = 1e9;\n let min = 1e9;\n let max = -1e9;\n for (let branchNode in branchMap) {\n if (branchMap.hasOwnProperty(branchNode)) {\n let node = this.body.nodes[branchNode];\n let level = this.hierarchicalLevels[node.id];\n let position = this._getPositionForHierarchy(node);\n\n // get the space around the node.\n let [minSpaceNode, maxSpaceNode] = this._getSpaceAroundNode(node,branchMap);\n minSpace = Math.min(minSpaceNode, minSpace);\n maxSpace = Math.min(maxSpaceNode, maxSpace);\n\n // the width is only relevant for the levels two nodes have in common. This is why we filter on this.\n if (level <= maxLevel) {\n min = Math.min(position, min);\n max = Math.max(position, max);\n }\n }\n }\n\n return [min, max, minSpace, maxSpace];\n };\n\n // get the maximum level of a branch.\n let getMaxLevel = (nodeId) => {\n let level = this.hierarchicalLevels[nodeId];\n if (this.hierarchicalChildrenReference[nodeId]) {\n let children = this.hierarchicalChildrenReference[nodeId];\n if (children.length > 0) {\n for (let i = 0; i < children.length; i++) {\n level = Math.max(level,getMaxLevel(children[i]));\n }\n }\n }\n return level;\n };\n\n // check what the maximum level is these nodes have in common.\n let getCollisionLevel = (node1, node2) => {\n let maxLevel1 = getMaxLevel(node1.id);\n let maxLevel2 = getMaxLevel(node2.id);\n return Math.min(maxLevel1, maxLevel2);\n };\n\n // check if two nodes have the same parent(s)\n let hasSameParent = (node1, node2) => {\n let parents1 = this.hierarchicalParentReference[node1.id];\n let parents2 = this.hierarchicalParentReference[node2.id];\n if (parents1 === undefined || parents2 === undefined) {\n return false;\n }\n\n for (let i = 0; i < parents1.length; i++) {\n for (let j = 0; j < parents2.length; j++) {\n if (parents1[i] == parents2[j]) {\n return true;\n }\n }\n }\n return false;\n };\n\n // condense elements. These can be nodes or branches depending on the callback.\n let shiftElementsCloser = (callback, levels, centerParents) => {\n for (let i = 0; i < levels.length; i++) {\n let level = levels[i];\n let levelNodes = this.distributionOrdering[level];\n if (levelNodes.length > 1) {\n for (let j = 0; j < levelNodes.length - 1; j++) {\n if (hasSameParent(levelNodes[j],levelNodes[j+1]) === true) {\n if (this.hierarchicalTrees[levelNodes[j].id] === this.hierarchicalTrees[levelNodes[j+1].id]) {\n callback(levelNodes[j],levelNodes[j+1], centerParents);\n }\n }}\n }\n }\n };\n\n // callback for shifting branches\n let branchShiftCallback = (node1, node2, centerParent = false) => {\n //window.CALLBACKS.push(() => {\n let pos1 = this._getPositionForHierarchy(node1);\n let pos2 = this._getPositionForHierarchy(node2);\n let diffAbs = Math.abs(pos2 - pos1);\n //console.log(\"NOW CHEcKING:\", node1.id, node2.id, diffAbs);\n if (diffAbs > this.options.hierarchical.nodeSpacing) {\n let branchNodes1 = {}; branchNodes1[node1.id] = true;\n let branchNodes2 = {}; branchNodes2[node2.id] = true;\n\n getBranchNodes(node1, branchNodes1);\n getBranchNodes(node2, branchNodes2);\n\n // check the largest distance between the branches\n let maxLevel = getCollisionLevel(node1, node2);\n let [min1,max1, minSpace1, maxSpace1] = getBranchBoundary(branchNodes1, maxLevel);\n let [min2,max2, minSpace2, maxSpace2] = getBranchBoundary(branchNodes2, maxLevel);\n\n //console.log(node1.id, getBranchBoundary(branchNodes1, maxLevel), node2.id, getBranchBoundary(branchNodes2, maxLevel), maxLevel);\n let diffBranch = Math.abs(max1 - min2);\n if (diffBranch > this.options.hierarchical.nodeSpacing) {\n let offset = max1 - min2 + this.options.hierarchical.nodeSpacing;\n if (offset < -minSpace2 + this.options.hierarchical.nodeSpacing) {\n offset = -minSpace2 + this.options.hierarchical.nodeSpacing;\n //console.log(\"RESETTING OFFSET\", max1 - min2 + this.options.hierarchical.nodeSpacing, -minSpace2, offset);\n }\n if (offset < 0) {\n //console.log(\"SHIFTING\", node2.id, offset);\n this._shiftBlock(node2.id, offset);\n stillShifting = true;\n\n if (centerParent === true)\n this._centerParent(node2);\n }\n }\n\n }\n //this.body.emitter.emit(\"_redraw\");})\n };\n\n let minimizeEdgeLength = (iterations, node) => {\n //window.CALLBACKS.push(() => {\n // console.log(\"ts\",node.id);\n let nodeId = node.id;\n let allEdges = node.edges;\n let nodeLevel = this.hierarchicalLevels[node.id];\n\n // gather constants\n let C2 = this.options.hierarchical.levelSeparation * this.options.hierarchical.levelSeparation;\n let referenceNodes = {};\n let aboveEdges = [];\n for (let i = 0; i < allEdges.length; i++) {\n let edge = allEdges[i];\n if (edge.toId != edge.fromId) {\n let otherNode = edge.toId == nodeId ? edge.from : edge.to;\n referenceNodes[allEdges[i].id] = otherNode;\n if (this.hierarchicalLevels[otherNode.id] < nodeLevel) {\n aboveEdges.push(edge);\n }\n }\n }\n\n // differentiated sum of lengths based on only moving one node over one axis\n let getFx = (point, edges) => {\n let sum = 0;\n for (let i = 0; i < edges.length; i++) {\n if (referenceNodes[edges[i].id] !== undefined) {\n let a = this._getPositionForHierarchy(referenceNodes[edges[i].id]) - point;\n sum += a / Math.sqrt(a * a + C2);\n }\n }\n return sum;\n };\n\n // doubly differentiated sum of lengths based on only moving one node over one axis\n let getDFx = (point, edges) => {\n let sum = 0;\n for (let i = 0; i < edges.length; i++) {\n if (referenceNodes[edges[i].id] !== undefined) {\n let a = this._getPositionForHierarchy(referenceNodes[edges[i].id]) - point;\n sum -= (C2 * Math.pow(a * a + C2, -1.5));\n }\n }\n return sum;\n };\n\n let getGuess = (iterations, edges) => {\n let guess = this._getPositionForHierarchy(node);\n // Newton's method for optimization\n let guessMap = {};\n for (let i = 0; i < iterations; i++) {\n let fx = getFx(guess, edges);\n let dfx = getDFx(guess, edges);\n\n // we limit the movement to avoid instability.\n let limit = 40;\n let ratio = Math.max(-limit, Math.min(limit, Math.round(fx/dfx)));\n guess = guess - ratio;\n // reduce duplicates\n if (guessMap[guess] !== undefined) {\n break;\n }\n guessMap[guess] = i;\n }\n return guess;\n };\n\n let moveBranch = (guess) => {\n // position node if there is space\n let nodePosition = this._getPositionForHierarchy(node);\n\n // check movable area of the branch\n if (branches[node.id] === undefined) {\n let branchNodes = {};\n branchNodes[node.id] = true;\n getBranchNodes(node, branchNodes);\n branches[node.id] = branchNodes;\n }\n let [minBranch, maxBranch, minSpaceBranch, maxSpaceBranch] = getBranchBoundary(branches[node.id]);\n\n let diff = guess - nodePosition;\n\n // check if we are allowed to move the node:\n let branchOffset = 0;\n if (diff > 0) {\n branchOffset = Math.min(diff, maxSpaceBranch - this.options.hierarchical.nodeSpacing);\n }\n else if (diff < 0) {\n branchOffset = -Math.min(-diff, minSpaceBranch - this.options.hierarchical.nodeSpacing);\n }\n\n if (branchOffset != 0) {\n //console.log(\"moving branch:\",branchOffset, maxSpaceBranch, minSpaceBranch)\n this._shiftBlock(node.id, branchOffset);\n //this.body.emitter.emit(\"_redraw\");\n stillShifting = true;\n }\n };\n\n let moveNode = (guess) => {\n let nodePosition = this._getPositionForHierarchy(node);\n\n // position node if there is space\n let [minSpace, maxSpace] = this._getSpaceAroundNode(node);\n let diff = guess - nodePosition;\n // check if we are allowed to move the node:\n let newPosition = nodePosition;\n if (diff > 0) {\n newPosition = Math.min(nodePosition + (maxSpace - this.options.hierarchical.nodeSpacing), guess);\n }\n else if (diff < 0) {\n newPosition = Math.max(nodePosition - (minSpace - this.options.hierarchical.nodeSpacing), guess);\n }\n\n if (newPosition !== nodePosition) {\n //console.log(\"moving Node:\",diff, minSpace, maxSpace);\n this._setPositionForHierarchy(node, newPosition, undefined, true);\n //this.body.emitter.emit(\"_redraw\");\n stillShifting = true;\n }\n };\n\n let guess = getGuess(iterations, aboveEdges);\n moveBranch(guess);\n guess = getGuess(iterations, allEdges);\n moveNode(guess);\n //})\n };\n\n // method to remove whitespace between branches. Because we do bottom up, we can center the parents.\n let minimizeEdgeLengthBottomUp = (iterations) => {\n let levels = Object.keys(this.distributionOrdering);\n levels = levels.reverse();\n for (let i = 0; i < iterations; i++) {\n stillShifting = false;\n for (let j = 0; j < levels.length; j++) {\n let level = levels[j];\n let levelNodes = this.distributionOrdering[level];\n for (let k = 0; k < levelNodes.length; k++) {\n minimizeEdgeLength(1000, levelNodes[k]);\n }\n }\n if (stillShifting !== true) {\n //console.log(\"FINISHED minimizeEdgeLengthBottomUp IN \" + i);\n break;\n }\n }\n };\n\n // method to remove whitespace between branches. Because we do bottom up, we can center the parents.\n let shiftBranchesCloserBottomUp = (iterations) => {\n let levels = Object.keys(this.distributionOrdering);\n levels = levels.reverse();\n for (let i = 0; i < iterations; i++) {\n stillShifting = false;\n shiftElementsCloser(branchShiftCallback, levels, true);\n if (stillShifting !== true) {\n //console.log(\"FINISHED shiftBranchesCloserBottomUp IN \" + (i+1));\n break;\n }\n }\n };\n\n // center all parents\n let centerAllParents = () => {\n for (let nodeId in this.body.nodes) {\n if (this.body.nodes.hasOwnProperty(nodeId))\n this._centerParent(this.body.nodes[nodeId]);\n }\n };\n\n // center all parents\n let centerAllParentsBottomUp = () => {\n let levels = Object.keys(this.distributionOrdering);\n levels = levels.reverse();\n for (let i = 0; i < levels.length; i++) {\n let level = levels[i];\n let levelNodes = this.distributionOrdering[level];\n for (let j = 0; j < levelNodes.length; j++) {\n this._centerParent(levelNodes[j]);\n }\n }\n };\n\n // the actual work is done here.\n if (this.options.hierarchical.blockShifting === true) {\n shiftBranchesCloserBottomUp(5);\n centerAllParents();\n }\n\n // minimize edge length\n if (this.options.hierarchical.edgeMinimization === true) {\n minimizeEdgeLengthBottomUp(20);\n }\n\n if (this.options.hierarchical.parentCentralization === true) {\n centerAllParentsBottomUp()\n }\n\n shiftTrees();\n }\n\n /**\n * This gives the space around the node. IF a map is supplied, it will only check against nodes NOT in the map.\n * This is used to only get the distances to nodes outside of a branch.\n * @param node\n * @param map\n * @returns {*[]}\n * @private\n */\n _getSpaceAroundNode(node, map) {\n let useMap = true;\n if (map === undefined) {\n useMap = false;\n }\n let level = this.hierarchicalLevels[node.id];\n if (level !== undefined) {\n let index = this.distributionIndex[node.id];\n let position = this._getPositionForHierarchy(node);\n let minSpace = 1e9;\n let maxSpace = 1e9;\n if (index !== 0) {\n let prevNode = this.distributionOrdering[level][index - 1];\n if ((useMap === true && map[prevNode.id] === undefined) || useMap === false) {\n let prevPos = this._getPositionForHierarchy(prevNode);\n minSpace = position - prevPos;\n }\n }\n\n if (index != this.distributionOrdering[level].length - 1) {\n let nextNode = this.distributionOrdering[level][index + 1];\n if ((useMap === true && map[nextNode.id] === undefined) || useMap === false) {\n let nextPos = this._getPositionForHierarchy(nextNode);\n maxSpace = Math.min(maxSpace, nextPos - position);\n }\n }\n\n return [minSpace, maxSpace];\n }\n else {\n return [0, 0];\n }\n }\n\n /**\n * We use this method to center a parent node and check if it does not cross other nodes when it does.\n * @param node\n * @private\n */\n _centerParent(node) {\n if (this.hierarchicalParentReference[node.id]) {\n let parents = this.hierarchicalParentReference[node.id];\n for (var i = 0; i < parents.length; i++) {\n let parentId = parents[i];\n let parentNode = this.body.nodes[parentId];\n if (this.hierarchicalChildrenReference[parentId]) {\n // get the range of the children\n let minPos = 1e9;\n let maxPos = -1e9;\n let children = this.hierarchicalChildrenReference[parentId];\n if (children.length > 0) {\n for (let i = 0; i < children.length; i++) {\n let childNode = this.body.nodes[children[i]];\n minPos = Math.min(minPos, this._getPositionForHierarchy(childNode));\n maxPos = Math.max(maxPos, this._getPositionForHierarchy(childNode));\n }\n }\n\n let position = this._getPositionForHierarchy(parentNode);\n let [minSpace, maxSpace] = this._getSpaceAroundNode(parentNode);\n let newPosition = 0.5 * (minPos + maxPos);\n let diff = position - newPosition;\n if ((diff < 0 && Math.abs(diff) < maxSpace - this.options.hierarchical.nodeSpacing) || (diff > 0 && Math.abs(diff) < minSpace - this.options.hierarchical.nodeSpacing)) {\n this._setPositionForHierarchy(parentNode, newPosition, undefined, true);\n }\n }\n }\n }\n }\n\n\n\n /**\n * This function places the nodes on the canvas based on the hierarchial distribution.\n *\n * @param {Object} distribution | obtained by the function this._getDistribution()\n * @private\n */\n _placeNodesByHierarchy(distribution) {\n this.positionedNodes = {};\n // start placing all the level 0 nodes first. Then recursively position their branches.\n for (let level in distribution) {\n if (distribution.hasOwnProperty(level)) {\n // sort nodes in level by position:\n let nodeArray = Object.keys(distribution[level]);\n nodeArray = this._indexArrayToNodes(nodeArray);\n this._sortNodeArray(nodeArray);\n let handledNodeCount = 0;\n\n for (let i = 0; i < nodeArray.length; i++) {\n let node = nodeArray[i];\n if (this.positionedNodes[node.id] === undefined) {\n let pos = this.options.hierarchical.nodeSpacing * handledNodeCount;\n // we get the X or Y values we need and store them in pos and previousPos. The get and set make sure we get X or Y\n if (handledNodeCount > 0) {pos = this._getPositionForHierarchy(nodeArray[i-1]) + this.options.hierarchical.nodeSpacing;}\n this._setPositionForHierarchy(node, pos, level);\n this._validataPositionAndContinue(node, level, pos);\n\n handledNodeCount++;\n }\n }\n }\n }\n }\n\n\n /**\n * This is a recursively called function to enumerate the branches from the largest hubs and place the nodes\n * on a X position that ensures there will be no overlap.\n *\n * @param parentId\n * @param parentLevel\n * @private\n */\n _placeBranchNodes(parentId, parentLevel) {\n // if this is not a parent, cancel the placing. This can happen with multiple parents to one child.\n if (this.hierarchicalChildrenReference[parentId] === undefined) {\n return;\n }\n\n // get a list of childNodes\n let childNodes = [];\n for (let i = 0; i < this.hierarchicalChildrenReference[parentId].length; i++) {\n childNodes.push(this.body.nodes[this.hierarchicalChildrenReference[parentId][i]]);\n }\n\n // use the positions to order the nodes.\n this._sortNodeArray(childNodes);\n\n // position the childNodes\n for (let i = 0; i < childNodes.length; i++) {\n let childNode = childNodes[i];\n let childNodeLevel = this.hierarchicalLevels[childNode.id];\n // check if the child node is below the parent node and if it has already been positioned.\n if (childNodeLevel > parentLevel && this.positionedNodes[childNode.id] === undefined) {\n // get the amount of space required for this node. If parent the width is based on the amount of children.\n let pos;\n\n // we get the X or Y values we need and store them in pos and previousPos. The get and set make sure we get X or Y\n if (i === 0) {pos = this._getPositionForHierarchy(this.body.nodes[parentId]);}\n else {pos = this._getPositionForHierarchy(childNodes[i-1]) + this.options.hierarchical.nodeSpacing;}\n this._setPositionForHierarchy(childNode, pos, childNodeLevel);\n this._validataPositionAndContinue(childNode, childNodeLevel, pos);\n }\n else {\n return;\n }\n }\n\n // center the parent nodes.\n let minPos = 1e9;\n let maxPos = -1e9;\n for (let i = 0; i < childNodes.length; i++) {\n let childNodeId = childNodes[i].id;\n minPos = Math.min(minPos, this._getPositionForHierarchy(this.body.nodes[childNodeId]));\n maxPos = Math.max(maxPos, this._getPositionForHierarchy(this.body.nodes[childNodeId]));\n }\n this._setPositionForHierarchy(this.body.nodes[parentId], 0.5 * (minPos + maxPos), parentLevel);\n }\n\n\n /**\n * This method checks for overlap and if required shifts the branch. It also keeps records of positioned nodes.\n * Finally it will call _placeBranchNodes to place the branch nodes.\n * @param node\n * @param level\n * @param pos\n * @private\n */\n _validataPositionAndContinue(node, level, pos) {\n // if overlap has been detected, we shift the branch\n if (this.lastNodeOnLevel[level] !== undefined) {\n let previousPos = this._getPositionForHierarchy(this.body.nodes[this.lastNodeOnLevel[level]]);\n if (pos - previousPos < this.options.hierarchical.nodeSpacing) {\n let diff = (previousPos + this.options.hierarchical.nodeSpacing) - pos;\n let sharedParent = this._findCommonParent(this.lastNodeOnLevel[level], node.id);\n this._shiftBlock(sharedParent.withChild, diff);\n }\n }\n\n // store change in position.\n this.lastNodeOnLevel[level] = node.id;\n\n this.positionedNodes[node.id] = true;\n\n this._placeBranchNodes(node.id, level);\n }\n\n /**\n * Receives an array with node indices and returns an array with the actual node references. Used for sorting based on\n * node properties.\n * @param idArray\n */\n _indexArrayToNodes(idArray) {\n let array = [];\n for (let i = 0; i < idArray.length; i++) {\n array.push(this.body.nodes[idArray[i]])\n }\n return array;\n }\n\n /**\n * This function get the distribution of levels based on hubsize\n *\n * @returns {Object}\n * @private\n */\n _getDistribution() {\n let distribution = {};\n let nodeId, node;\n\n // we fix Y because the hierarchy is vertical, we fix X so we do not give a node an x position for a second time.\n // the fix of X is removed after the x value has been set.\n for (nodeId in this.body.nodes) {\n if (this.body.nodes.hasOwnProperty(nodeId)) {\n node = this.body.nodes[nodeId];\n let level = this.hierarchicalLevels[nodeId] === undefined ? 0 : this.hierarchicalLevels[nodeId];\n if (this.options.hierarchical.direction === 'UD' || this.options.hierarchical.direction === 'DU') {\n node.y = this.options.hierarchical.levelSeparation * level;\n node.options.fixed.y = true;\n }\n else {\n node.x = this.options.hierarchical.levelSeparation * level;\n node.options.fixed.x = true;\n }\n if (distribution[level] === undefined) {\n distribution[level] = {};\n }\n distribution[level][nodeId] = node;\n }\n }\n return distribution;\n }\n\n\n /**\n * Get the hubsize from all remaining unlevelled nodes.\n *\n * @returns {number}\n * @private\n */\n _getHubSize() {\n let hubSize = 0;\n for (let nodeId in this.body.nodes) {\n if (this.body.nodes.hasOwnProperty(nodeId)) {\n let node = this.body.nodes[nodeId];\n if (this.hierarchicalLevels[nodeId] === undefined) {\n hubSize = node.edges.length < hubSize ? hubSize : node.edges.length;\n }\n }\n }\n return hubSize;\n }\n\n\n /**\n * this function allocates nodes in levels based on the recursive branching from the largest hubs.\n *\n * @param hubsize\n * @private\n */\n _determineLevelsByHubsize() {\n let hubSize = 1;\n\n let levelDownstream = (nodeA, nodeB) => {\n if (this.hierarchicalLevels[nodeB.id] === undefined) {\n // set initial level\n if (this.hierarchicalLevels[nodeA.id] === undefined) {\n this.hierarchicalLevels[nodeA.id] = 0;\n }\n // set level\n this.hierarchicalLevels[nodeB.id] = this.hierarchicalLevels[nodeA.id] + 1;\n }\n };\n\n while (hubSize > 0) {\n // determine hubs\n hubSize = this._getHubSize();\n if (hubSize === 0)\n break;\n\n for (let nodeId in this.body.nodes) {\n if (this.body.nodes.hasOwnProperty(nodeId)) {\n let node = this.body.nodes[nodeId];\n if (node.edges.length === hubSize) {\n this._crawlNetwork(levelDownstream,nodeId);\n }\n }\n }\n }\n }\n\n /**\n * TODO: release feature\n * @private\n */\n _determineLevelsCustomCallback() {\n let minLevel = 100000;\n\n // TODO: this should come from options.\n let customCallback = function(nodeA, nodeB, edge) {\n\n };\n\n let levelByDirection = (nodeA, nodeB, edge) => {\n let levelA = this.hierarchicalLevels[nodeA.id];\n // set initial level\n if (levelA === undefined) {this.hierarchicalLevels[nodeA.id] = minLevel;}\n\n let diff = customCallback(\n NetworkUtil.cloneOptions(nodeA,'node'),\n NetworkUtil.cloneOptions(nodeB,'node'),\n NetworkUtil.cloneOptions(edge,'edge')\n );\n\n this.hierarchicalLevels[nodeB.id] = this.hierarchicalLevels[nodeA.id] + diff;\n };\n\n this._crawlNetwork(levelByDirection);\n this._setMinLevelToZero();\n }\n\n /**\n * this function allocates nodes in levels based on the direction of the edges\n *\n * @param hubsize\n * @private\n */\n _determineLevelsDirected() {\n let minLevel = 10000;\n let levelByDirection = (nodeA, nodeB, edge) => {\n let levelA = this.hierarchicalLevels[nodeA.id];\n // set initial level\n if (levelA === undefined) {this.hierarchicalLevels[nodeA.id] = minLevel;}\n if (edge.toId == nodeB.id) {\n this.hierarchicalLevels[nodeB.id] = this.hierarchicalLevels[nodeA.id] + 1;\n }\n else {\n this.hierarchicalLevels[nodeB.id] = this.hierarchicalLevels[nodeA.id] - 1;\n }\n };\n this._crawlNetwork(levelByDirection);\n this._setMinLevelToZero();\n }\n\n\n /**\n * Small util method to set the minimum levels of the nodes to zero.\n * @private\n */\n _setMinLevelToZero() {\n let minLevel = 1e9;\n // get the minimum level\n for (let nodeId in this.body.nodes) {\n if (this.body.nodes.hasOwnProperty(nodeId)) {\n if (this.hierarchicalLevels[nodeId] !== undefined) {\n minLevel = Math.min(this.hierarchicalLevels[nodeId], minLevel);\n }\n }\n }\n\n // subtract the minimum from the set so we have a range starting from 0\n for (let nodeId in this.body.nodes) {\n if (this.body.nodes.hasOwnProperty(nodeId)) {\n if (this.hierarchicalLevels[nodeId] !== undefined) {\n this.hierarchicalLevels[nodeId] -= minLevel;\n }\n }\n }\n }\n\n\n /**\n * Update the bookkeeping of parent and child.\n * @private\n */\n _generateMap() {\n let fillInRelations = (parentNode, childNode) => {\n if (this.hierarchicalLevels[childNode.id] > this.hierarchicalLevels[parentNode.id]) {\n let parentNodeId = parentNode.id;\n let childNodeId = childNode.id;\n if (this.hierarchicalChildrenReference[parentNodeId] === undefined) {\n this.hierarchicalChildrenReference[parentNodeId] = [];\n }\n this.hierarchicalChildrenReference[parentNodeId].push(childNodeId);\n if (this.hierarchicalParentReference[childNodeId] === undefined) {\n this.hierarchicalParentReference[childNodeId] = [];\n }\n this.hierarchicalParentReference[childNodeId].push(parentNodeId);\n }\n };\n\n this._crawlNetwork(fillInRelations);\n }\n\n\n /**\n * Crawl over the entire network and use a callback on each node couple that is connected to each other.\n * @param callback | will receive nodeA nodeB and the connecting edge. A and B are unique.\n * @param startingNodeId\n * @private\n */\n _crawlNetwork(callback = function() {}, startingNodeId) {\n let progress = {};\n let treeIndex = 0;\n\n let crawler = (node, tree) => {\n if (progress[node.id] === undefined) {\n\n if (this.hierarchicalTrees[node.id] === undefined) {\n this.hierarchicalTrees[node.id] = tree;\n this.treeIndex = Math.max(tree, this.treeIndex);\n }\n\n progress[node.id] = true;\n let childNode;\n for (let i = 0; i < node.edges.length; i++) {\n if (node.edges[i].connected === true) {\n if (node.edges[i].toId === node.id) {\n childNode = node.edges[i].from;\n }\n else {\n childNode = node.edges[i].to;\n }\n\n if (node.id !== childNode.id) {\n callback(node, childNode, node.edges[i]);\n crawler(childNode, tree);\n }\n }\n }\n }\n };\n\n\n // we can crawl from a specific node or over all nodes.\n if (startingNodeId === undefined) {\n for (let i = 0; i < this.body.nodeIndices.length; i++) {\n let node = this.body.nodes[this.body.nodeIndices[i]];\n if (progress[node.id] === undefined) {\n crawler(node, treeIndex);\n treeIndex += 1;\n }\n }\n }\n else {\n let node = this.body.nodes[startingNodeId];\n if (node === undefined) {\n console.error(\"Node not found:\", startingNodeId);\n return;\n }\n crawler(node);\n }\n }\n\n\n /**\n * Shift a branch a certain distance\n * @param parentId\n * @param diff\n * @private\n */\n _shiftBlock(parentId, diff) {\n if (this.options.hierarchical.direction === 'UD' || this.options.hierarchical.direction === 'DU') {\n this.body.nodes[parentId].x += diff;\n }\n else {\n this.body.nodes[parentId].y += diff;\n }\n if (this.hierarchicalChildrenReference[parentId] !== undefined) {\n for (let i = 0; i < this.hierarchicalChildrenReference[parentId].length; i++) {\n this._shiftBlock(this.hierarchicalChildrenReference[parentId][i], diff);\n }\n }\n }\n\n\n /**\n * Find a common parent between branches.\n * @param childA\n * @param childB\n * @returns {{foundParent, withChild}}\n * @private\n */\n _findCommonParent(childA,childB) {\n let parents = {};\n let iterateParents = (parents,child) => {\n if (this.hierarchicalParentReference[child] !== undefined) {\n for (let i = 0; i < this.hierarchicalParentReference[child].length; i++) {\n let parent = this.hierarchicalParentReference[child][i];\n parents[parent] = true;\n iterateParents(parents, parent)\n }\n }\n };\n let findParent = (parents, child) => {\n if (this.hierarchicalParentReference[child] !== undefined) {\n for (let i = 0; i < this.hierarchicalParentReference[child].length; i++) {\n let parent = this.hierarchicalParentReference[child][i];\n if (parents[parent] !== undefined) {\n return {foundParent:parent, withChild:child};\n }\n let branch = findParent(parents, parent);\n if (branch.foundParent !== null) {\n return branch;\n }\n }\n }\n return {foundParent:null, withChild:child};\n };\n\n iterateParents(parents, childA);\n return findParent(parents, childB);\n }\n\n /**\n * Abstract the getting of the position so we won't have to repeat the check for direction all the time\n * @param node\n * @param position\n * @param level\n * @private\n */\n _setPositionForHierarchy(node, position, level, doNotUpdate = false) {\n //console.log('_setPositionForHierarchy',node.id, position)\n if (doNotUpdate !== true) {\n if (this.distributionOrdering[level] === undefined) {\n this.distributionOrdering[level] = [];\n this.distributionOrderingPresence[level] = {};\n }\n\n if (this.distributionOrderingPresence[level][node.id] === undefined) {\n this.distributionOrdering[level].push(node);\n this.distributionIndex[node.id] = this.distributionOrdering[level].length - 1;\n }\n this.distributionOrderingPresence[level][node.id] = true;\n }\n\n if (this.options.hierarchical.direction === 'UD' || this.options.hierarchical.direction === 'DU') {\n node.x = position;\n }\n else {\n node.y = position;\n }\n }\n\n /**\n * Abstract the getting of the position of a node so we do not have to repeat the direction check all the time.\n * @param node\n * @returns {number|*}\n * @private\n */\n _getPositionForHierarchy(node) {\n if (this.options.hierarchical.direction === 'UD' || this.options.hierarchical.direction === 'DU') {\n return node.x;\n }\n else {\n return node.y;\n }\n }\n\n /**\n * Use the x or y value to sort the array, allowing users to specify order.\n * @param nodeArray\n * @private\n */\n _sortNodeArray(nodeArray) {\n if (nodeArray.length > 1) {\n if (this.options.hierarchical.direction === 'UD' || this.options.hierarchical.direction === 'DU') {\n nodeArray.sort(function (a, b) {\n return a.x - b.x;\n })\n }\n else {\n nodeArray.sort(function (a, b) {\n return a.y - b.y;\n })\n }\n }\n }\n\n\n\n}\n\nexport default LayoutEngine;\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/LayoutEngine.js","\nlet util = require('../../util');\nlet Hammer = require('../../module/hammer');\nlet hammerUtil = require('../../hammerUtil');\n\n/**\n * clears the toolbar div element of children\n *\n * @private\n */\nclass ManipulationSystem {\n constructor(body, canvas, selectionHandler) {\n this.body = body;\n this.canvas = canvas;\n this.selectionHandler = selectionHandler;\n\n this.editMode = false;\n this.manipulationDiv = undefined;\n this.editModeDiv = undefined;\n this.closeDiv = undefined;\n\n this.manipulationHammers = [];\n this.temporaryUIFunctions = {};\n this.temporaryEventFunctions = [];\n\n this.touchTime = 0;\n this.temporaryIds = {nodes: [], edges:[]};\n this.guiEnabled = false;\n this.inMode = false;\n this.selectedControlNode = undefined;\n\n this.options = {};\n this.defaultOptions = {\n enabled: false,\n initiallyActive: false,\n addNode: true,\n addEdge: true,\n editNode: undefined,\n editEdge: true,\n deleteNode: true,\n deleteEdge: true,\n controlNodeStyle:{\n shape:'dot',\n size:6,\n color: {background: '#ff0000', border: '#3c3c3c', highlight: {background: '#07f968', border: '#3c3c3c'}},\n borderWidth: 2,\n borderWidthSelected: 2\n }\n };\n util.extend(this.options, this.defaultOptions);\n\n this.body.emitter.on('destroy', () => {this._clean();});\n this.body.emitter.on('_dataChanged',this._restore.bind(this));\n this.body.emitter.on('_resetData', this._restore.bind(this));\n }\n\n\n /**\n * If something changes in the data during editing, switch back to the initial datamanipulation state and close all edit modes.\n * @private\n */\n _restore() {\n if (this.inMode !== false) {\n if (this.options.initiallyActive === true) {\n this.enableEditMode();\n }\n else {\n this.disableEditMode();\n }\n }\n }\n\n /**\n * Set the Options\n * @param options\n */\n setOptions(options, allOptions, globalOptions) {\n if (allOptions !== undefined) {\n if (allOptions.locale !== undefined) {this.options.locale = allOptions.locale} else {this.options.locale = globalOptions.locale;}\n if (allOptions.locales !== undefined) {this.options.locales = allOptions.locales} else {this.options.locales = globalOptions.locales;}\n }\n\n if (options !== undefined) {\n if (typeof options === 'boolean') {\n this.options.enabled = options;\n }\n else {\n this.options.enabled = true;\n util.deepExtend(this.options, options);\n }\n if (this.options.initiallyActive === true) {\n this.editMode = true;\n }\n this._setup();\n }\n }\n\n\n /**\n * Enable or disable edit-mode. Draws the DOM required and cleans up after itself.\n *\n * @private\n */\n toggleEditMode() {\n if (this.editMode === true) {\n this.disableEditMode();\n }\n else {\n this.enableEditMode();\n }\n }\n\n\n enableEditMode() {\n this.editMode = true;\n\n this._clean();\n if (this.guiEnabled === true) {\n this.manipulationDiv.style.display = 'block';\n this.closeDiv.style.display = 'block';\n this.editModeDiv.style.display = 'none';\n this.showManipulatorToolbar();\n }\n }\n\n disableEditMode() {\n this.editMode = false;\n\n this._clean();\n if (this.guiEnabled === true) {\n this.manipulationDiv.style.display = 'none';\n this.closeDiv.style.display = 'none';\n this.editModeDiv.style.display = 'block';\n this._createEditButton();\n }\n }\n\n /**\n * Creates the main toolbar. Removes functions bound to the select event. Binds all the buttons of the toolbar.\n *\n * @private\n */\n showManipulatorToolbar() {\n // restore the state of any bound functions or events, remove control nodes, restore physics\n this._clean();\n\n // reset global variables\n this.manipulationDOM = {};\n\n // if the gui is enabled, draw all elements.\n if (this.guiEnabled === true) {\n // a _restore will hide these menus\n this.editMode = true;\n this.manipulationDiv.style.display = 'block';\n this.closeDiv.style.display = 'block';\n\n let selectedNodeCount = this.selectionHandler._getSelectedNodeCount();\n let selectedEdgeCount = this.selectionHandler._getSelectedEdgeCount();\n let selectedTotalCount = selectedNodeCount + selectedEdgeCount;\n let locale = this.options.locales[this.options.locale];\n let needSeperator = false;\n\n\n if (this.options.addNode !== false) {\n this._createAddNodeButton(locale);\n needSeperator = true;\n }\n if (this.options.addEdge !== false) {\n if (needSeperator === true) {\n this._createSeperator(1);\n } else {\n needSeperator = true;\n }\n this._createAddEdgeButton(locale);\n }\n\n if (selectedNodeCount === 1 && typeof this.options.editNode === 'function') {\n if (needSeperator === true) {\n this._createSeperator(2);\n } else {\n needSeperator = true;\n }\n this._createEditNodeButton(locale);\n }\n else if (selectedEdgeCount === 1 && selectedNodeCount === 0 && this.options.editEdge !== false) {\n if (needSeperator === true) {\n this._createSeperator(3);\n } else {\n needSeperator = true;\n }\n this._createEditEdgeButton(locale);\n }\n\n // remove buttons\n if (selectedTotalCount !== 0) {\n if (selectedNodeCount > 0 && this.options.deleteNode !== false) {\n if (needSeperator === true) {\n this._createSeperator(4);\n }\n this._createDeleteButton(locale);\n }\n else if (selectedNodeCount === 0 && this.options.deleteEdge !== false) {\n if (needSeperator === true) {\n this._createSeperator(4);\n }\n this._createDeleteButton(locale);\n }\n }\n\n // bind the close button\n this._bindHammerToDiv(this.closeDiv, this.toggleEditMode.bind(this));\n\n // refresh this bar based on what has been selected\n this._temporaryBindEvent('select', this.showManipulatorToolbar.bind(this));\n }\n\n // redraw to show any possible changes\n this.body.emitter.emit('_redraw');\n\n }\n\n\n /**\n * Create the toolbar for adding Nodes\n */\n addNodeMode() {\n // when using the gui, enable edit mode if it wasnt already.\n if (this.editMode !== true) {\n this.enableEditMode();\n }\n\n // restore the state of any bound functions or events, remove control nodes, restore physics\n this._clean();\n\n this.inMode = 'addNode';\n if (this.guiEnabled === true) {\n let locale = this.options.locales[this.options.locale];\n this.manipulationDOM = {};\n this._createBackButton(locale);\n this._createSeperator();\n this._createDescription(locale['addDescription'] || this.options.locales['en']['addDescription']);\n\n // bind the close button\n this._bindHammerToDiv(this.closeDiv, this.toggleEditMode.bind(this));\n }\n\n this._temporaryBindEvent('click', this._performAddNode.bind(this));\n }\n\n /**\n * call the bound function to handle the editing of the node. The node has to be selected.\n */\n editNode() {\n // when using the gui, enable edit mode if it wasnt already.\n if (this.editMode !== true) {\n this.enableEditMode();\n }\n\n // restore the state of any bound functions or events, remove control nodes, restore physics\n this._clean();\n let node = this.selectionHandler._getSelectedNode();\n if (node !== undefined) {\n this.inMode = 'editNode';\n if (typeof this.options.editNode === 'function') {\n if (node.isCluster !== true) {\n let data = util.deepExtend({}, node.options, false);\n data.x = node.x;\n data.y = node.y;\n\n if (this.options.editNode.length === 2) {\n this.options.editNode(data, (finalizedData) => {\n if (finalizedData !== null && finalizedData !== undefined && this.inMode === 'editNode') { // if for whatever reason the mode has changes (due to dataset change) disregard the callback) {\n this.body.data.nodes.getDataSet().update(finalizedData);\n }\n this.showManipulatorToolbar();\n });\n }\n else {\n throw new Error('The function for edit does not support two arguments (data, callback)');\n }\n }\n else {\n alert(this.options.locales[this.options.locale]['editClusterError'] || this.options.locales['en']['editClusterError']);\n }\n }\n else {\n throw new Error('No function has been configured to handle the editing of nodes.');\n }\n }\n else {\n this.showManipulatorToolbar();\n }\n }\n\n\n /**\n * create the toolbar to connect nodes\n */\n addEdgeMode() {\n // when using the gui, enable edit mode if it wasnt already.\n if (this.editMode !== true) {\n this.enableEditMode();\n }\n\n // restore the state of any bound functions or events, remove control nodes, restore physics\n this._clean();\n\n this.inMode = 'addEdge';\n if (this.guiEnabled === true) {\n let locale = this.options.locales[this.options.locale];\n this.manipulationDOM = {};\n this._createBackButton(locale);\n this._createSeperator();\n this._createDescription(locale['edgeDescription'] || this.options.locales['en']['edgeDescription']);\n\n // bind the close button\n this._bindHammerToDiv(this.closeDiv, this.toggleEditMode.bind(this));\n }\n\n // temporarily overload functions\n this._temporaryBindUI('onTouch', this._handleConnect.bind(this));\n this._temporaryBindUI('onDragEnd', this._finishConnect.bind(this));\n this._temporaryBindUI('onDrag', this._dragControlNode.bind(this));\n this._temporaryBindUI('onRelease', this._finishConnect.bind(this));\n\n this._temporaryBindUI('onDragStart', () => {});\n this._temporaryBindUI('onHold', () => {});\n }\n\n /**\n * create the toolbar to edit edges\n */\n editEdgeMode() {\n // when using the gui, enable edit mode if it wasn't already.\n if (this.editMode !== true) {\n this.enableEditMode();\n }\n\n // restore the state of any bound functions or events, remove control nodes, restore physics\n this._clean();\n\n this.inMode = 'editEdge';\n if (typeof this.options.editEdge === 'object' && typeof this.options.editEdge.editWithoutDrag === \"function\") {\n this.edgeBeingEditedId = this.selectionHandler.getSelectedEdges()[0];\n if (this.edgeBeingEditedId !== undefined) {\n var edge = this.body.edges[this.edgeBeingEditedId];\n this._performEditEdge(edge.from, edge.to);\n return;\n }\n }\n if (this.guiEnabled === true) {\n let locale = this.options.locales[this.options.locale];\n this.manipulationDOM = {};\n this._createBackButton(locale);\n this._createSeperator();\n this._createDescription(locale['editEdgeDescription'] || this.options.locales['en']['editEdgeDescription']);\n\n // bind the close button\n this._bindHammerToDiv(this.closeDiv, this.toggleEditMode.bind(this));\n }\n\n this.edgeBeingEditedId = this.selectionHandler.getSelectedEdges()[0];\n if (this.edgeBeingEditedId !== undefined) {\n let edge = this.body.edges[this.edgeBeingEditedId];\n\n // create control nodes\n let controlNodeFrom = this._getNewTargetNode(edge.from.x, edge.from.y);\n let controlNodeTo = this._getNewTargetNode(edge.to.x, edge.to.y);\n\n this.temporaryIds.nodes.push(controlNodeFrom.id);\n this.temporaryIds.nodes.push(controlNodeTo.id);\n\n this.body.nodes[controlNodeFrom.id] = controlNodeFrom;\n this.body.nodeIndices.push(controlNodeFrom.id);\n this.body.nodes[controlNodeTo.id] = controlNodeTo;\n this.body.nodeIndices.push(controlNodeTo.id);\n\n // temporarily overload UI functions, cleaned up automatically because of _temporaryBindUI\n this._temporaryBindUI('onTouch', this._controlNodeTouch.bind(this)); // used to get the position\n this._temporaryBindUI('onTap', () => {}); // disabled\n this._temporaryBindUI('onHold', () => {}); // disabled\n this._temporaryBindUI('onDragStart', this._controlNodeDragStart.bind(this));// used to select control node\n this._temporaryBindUI('onDrag', this._controlNodeDrag.bind(this)); // used to drag control node\n this._temporaryBindUI('onDragEnd', this._controlNodeDragEnd.bind(this)); // used to connect or revert control nodes\n this._temporaryBindUI('onMouseMove', () => {}); // disabled\n\n // create function to position control nodes correctly on movement\n // automatically cleaned up because we use the temporary bind\n this._temporaryBindEvent('beforeDrawing', (ctx) => {\n let positions = edge.edgeType.findBorderPositions(ctx);\n if (controlNodeFrom.selected === false) {\n controlNodeFrom.x = positions.from.x;\n controlNodeFrom.y = positions.from.y;\n }\n if (controlNodeTo.selected === false) {\n controlNodeTo.x = positions.to.x;\n controlNodeTo.y = positions.to.y;\n }\n });\n\n this.body.emitter.emit('_redraw');\n }\n else {\n this.showManipulatorToolbar();\n }\n }\n\n /**\n * delete everything in the selection\n */\n deleteSelected() {\n // when using the gui, enable edit mode if it wasnt already.\n if (this.editMode !== true) {\n this.enableEditMode();\n }\n\n // restore the state of any bound functions or events, remove control nodes, restore physics\n this._clean();\n\n this.inMode = 'delete';\n let selectedNodes = this.selectionHandler.getSelectedNodes();\n let selectedEdges = this.selectionHandler.getSelectedEdges();\n let deleteFunction = undefined;\n if (selectedNodes.length > 0) {\n for (let i = 0; i < selectedNodes.length; i++) {\n if (this.body.nodes[selectedNodes[i]].isCluster === true) {\n alert(this.options.locales[this.options.locale]['deleteClusterError'] || this.options.locales['en']['deleteClusterError']);\n return;\n }\n }\n\n if (typeof this.options.deleteNode === 'function') {\n deleteFunction = this.options.deleteNode;\n }\n }\n else if (selectedEdges.length > 0) {\n if (typeof this.options.deleteEdge === 'function') {\n deleteFunction = this.options.deleteEdge;\n }\n }\n\n if (typeof deleteFunction === 'function') {\n let data = {nodes: selectedNodes, edges: selectedEdges};\n if (deleteFunction.length === 2) {\n deleteFunction(data, (finalizedData) => {\n if (finalizedData !== null && finalizedData !== undefined && this.inMode === 'delete') { // if for whatever reason the mode has changes (due to dataset change) disregard the callback) {\n this.body.data.edges.getDataSet().remove(finalizedData.edges);\n this.body.data.nodes.getDataSet().remove(finalizedData.nodes);\n this.body.emitter.emit('startSimulation');\n this.showManipulatorToolbar();\n }\n else {\n this.body.emitter.emit('startSimulation');\n this.showManipulatorToolbar();\n }\n });\n }\n else {\n throw new Error('The function for delete does not support two arguments (data, callback)')\n }\n }\n else {\n this.body.data.edges.getDataSet().remove(selectedEdges);\n this.body.data.nodes.getDataSet().remove(selectedNodes);\n this.body.emitter.emit('startSimulation');\n this.showManipulatorToolbar();\n }\n }\n\n\n\n\n //********************************************** PRIVATE ***************************************//\n\n /**\n * draw or remove the DOM\n * @private\n */\n _setup() {\n if (this.options.enabled === true) {\n // Enable the GUI\n this.guiEnabled = true;\n\n this._createWrappers();\n if (this.editMode === false) {\n this._createEditButton();\n }\n else {\n this.showManipulatorToolbar();\n }\n }\n else {\n this._removeManipulationDOM();\n\n // disable the gui\n this.guiEnabled = false;\n }\n }\n\n\n /**\n * create the div overlays that contain the DOM\n * @private\n */\n _createWrappers() {\n // load the manipulator HTML elements. All styling done in css.\n if (this.manipulationDiv === undefined) {\n this.manipulationDiv = document.createElement('div');\n this.manipulationDiv.className = 'vis-manipulation';\n if (this.editMode === true) {\n this.manipulationDiv.style.display = 'block';\n }\n else {\n this.manipulationDiv.style.display = 'none';\n }\n this.canvas.frame.appendChild(this.manipulationDiv);\n }\n\n // container for the edit button.\n if (this.editModeDiv === undefined) {\n this.editModeDiv = document.createElement('div');\n this.editModeDiv.className = 'vis-edit-mode';\n if (this.editMode === true) {\n this.editModeDiv.style.display = 'none';\n }\n else {\n this.editModeDiv.style.display = 'block';\n }\n this.canvas.frame.appendChild(this.editModeDiv);\n }\n\n\n // container for the close div button\n if (this.closeDiv === undefined) {\n this.closeDiv = document.createElement('div');\n this.closeDiv.className = 'vis-close';\n this.closeDiv.style.display = this.manipulationDiv.style.display;\n this.canvas.frame.appendChild(this.closeDiv);\n }\n }\n\n\n /**\n * generate a new target node. Used for creating new edges and editing edges\n * @param x\n * @param y\n * @returns {*}\n * @private\n */\n _getNewTargetNode(x,y) {\n let controlNodeStyle = util.deepExtend({}, this.options.controlNodeStyle);\n\n controlNodeStyle.id = 'targetNode' + util.randomUUID();\n controlNodeStyle.hidden = false;\n controlNodeStyle.physics = false;\n controlNodeStyle.x = x;\n controlNodeStyle.y = y;\n\n // we have to define the bounding box in order for the nodes to be drawn immediately\n let node = this.body.functions.createNode(controlNodeStyle);\n node.shape.boundingBox = {left: x, right:x, top:y, bottom:y};\n\n return node;\n }\n\n\n /**\n * Create the edit button\n */\n _createEditButton() {\n // restore everything to it's original state (if applicable)\n this._clean();\n\n // reset the manipulationDOM\n this.manipulationDOM = {};\n\n // empty the editModeDiv\n util.recursiveDOMDelete(this.editModeDiv);\n\n\n // create the contents for the editMode button\n let locale = this.options.locales[this.options.locale];\n let button = this._createButton('editMode', 'vis-button vis-edit vis-edit-mode', locale['edit'] || this.options.locales['en']['edit']);\n this.editModeDiv.appendChild(button);\n\n // bind a hammer listener to the button, calling the function toggleEditMode.\n this._bindHammerToDiv(button, this.toggleEditMode.bind(this));\n }\n\n\n /**\n * this function cleans up after everything this module does. Temporary elements, functions and events are removed, physics restored, hammers removed.\n * @private\n */\n _clean() {\n // not in mode\n this.inMode = false;\n\n // _clean the divs\n if (this.guiEnabled === true) {\n util.recursiveDOMDelete(this.editModeDiv);\n util.recursiveDOMDelete(this.manipulationDiv);\n\n // removes all the bindings and overloads\n this._cleanManipulatorHammers();\n }\n\n // remove temporary nodes and edges\n this._cleanupTemporaryNodesAndEdges();\n\n // restore overloaded UI functions\n this._unbindTemporaryUIs();\n\n // remove the temporaryEventFunctions\n this._unbindTemporaryEvents();\n\n // restore the physics if required\n this.body.emitter.emit('restorePhysics');\n }\n\n\n /**\n * Each dom element has it's own hammer. They are stored in this.manipulationHammers. This cleans them up.\n * @private\n */\n _cleanManipulatorHammers() {\n // _clean hammer bindings\n if (this.manipulationHammers.length != 0) {\n for (let i = 0; i < this.manipulationHammers.length; i++) {\n this.manipulationHammers[i].destroy();\n }\n this.manipulationHammers = [];\n }\n }\n\n\n /**\n * Remove all DOM elements created by this module.\n * @private\n */\n _removeManipulationDOM() {\n // removes all the bindings and overloads\n this._clean();\n\n // empty the manipulation divs\n util.recursiveDOMDelete(this.manipulationDiv);\n util.recursiveDOMDelete(this.editModeDiv);\n util.recursiveDOMDelete(this.closeDiv);\n\n // remove the manipulation divs\n if (this.manipulationDiv) {this.canvas.frame.removeChild(this.manipulationDiv);}\n if (this.editModeDiv) {this.canvas.frame.removeChild(this.editModeDiv);}\n if (this.closeDiv) {this.canvas.frame.removeChild(this.closeDiv);}\n\n // set the references to undefined\n this.manipulationDiv = undefined;\n this.editModeDiv = undefined;\n this.closeDiv = undefined;\n }\n\n\n /**\n * create a seperator line. the index is to differentiate in the manipulation dom\n * @param index\n * @private\n */\n _createSeperator(index = 1) {\n this.manipulationDOM['seperatorLineDiv' + index] = document.createElement('div');\n this.manipulationDOM['seperatorLineDiv' + index].className = 'vis-separator-line';\n this.manipulationDiv.appendChild(this.manipulationDOM['seperatorLineDiv' + index]);\n }\n\n // ---------------------- DOM functions for buttons --------------------------//\n\n _createAddNodeButton(locale) {\n let button = this._createButton('addNode', 'vis-button vis-add', locale['addNode'] || this.options.locales['en']['addNode']);\n this.manipulationDiv.appendChild(button);\n this._bindHammerToDiv(button, this.addNodeMode.bind(this));\n }\n\n _createAddEdgeButton(locale) {\n let button = this._createButton('addEdge', 'vis-button vis-connect', locale['addEdge'] || this.options.locales['en']['addEdge']);\n this.manipulationDiv.appendChild(button);\n this._bindHammerToDiv(button, this.addEdgeMode.bind(this));\n }\n\n _createEditNodeButton(locale) {\n let button = this._createButton('editNode', 'vis-button vis-edit', locale['editNode'] || this.options.locales['en']['editNode']);\n this.manipulationDiv.appendChild(button);\n this._bindHammerToDiv(button, this.editNode.bind(this));\n }\n\n _createEditEdgeButton(locale) {\n let button = this._createButton('editEdge', 'vis-button vis-edit', locale['editEdge'] || this.options.locales['en']['editEdge']);\n this.manipulationDiv.appendChild(button);\n this._bindHammerToDiv(button, this.editEdgeMode.bind(this));\n }\n\n _createDeleteButton(locale) {\n if (this.options.rtl) {\n var deleteBtnClass = 'vis-button vis-delete-rtl';\n } else {\n var deleteBtnClass = 'vis-button vis-delete';\n }\n let button = this._createButton('delete', deleteBtnClass, locale['del'] || this.options.locales['en']['del']);\n this.manipulationDiv.appendChild(button);\n this._bindHammerToDiv(button, this.deleteSelected.bind(this));\n }\n\n _createBackButton(locale) {\n let button = this._createButton('back', 'vis-button vis-back', locale['back'] || this.options.locales['en']['back']);\n this.manipulationDiv.appendChild(button);\n this._bindHammerToDiv(button, this.showManipulatorToolbar.bind(this));\n }\n\n _createButton(id, className, label, labelClassName = 'vis-label') {\n\n this.manipulationDOM[id+'Div'] = document.createElement('div');\n this.manipulationDOM[id+'Div'].className = className;\n this.manipulationDOM[id+'Label'] = document.createElement('div');\n this.manipulationDOM[id+'Label'].className = labelClassName;\n this.manipulationDOM[id+'Label'].innerHTML = label;\n this.manipulationDOM[id+'Div'].appendChild(this.manipulationDOM[id+'Label']);\n return this.manipulationDOM[id+'Div'];\n }\n\n _createDescription(label) {\n this.manipulationDiv.appendChild(\n this._createButton('description', 'vis-button vis-none', label)\n );\n }\n\n // -------------------------- End of DOM functions for buttons ------------------------------//\n\n /**\n * this binds an event until cleanup by the clean functions.\n * @param event\n * @param newFunction\n * @private\n */\n _temporaryBindEvent(event, newFunction) {\n this.temporaryEventFunctions.push({event:event, boundFunction:newFunction});\n this.body.emitter.on(event, newFunction);\n }\n\n /**\n * this overrides an UI function until cleanup by the clean function\n * @param UIfunctionName\n * @param newFunction\n * @private\n */\n _temporaryBindUI(UIfunctionName, newFunction) {\n if (this.body.eventListeners[UIfunctionName] !== undefined) {\n this.temporaryUIFunctions[UIfunctionName] = this.body.eventListeners[UIfunctionName];\n this.body.eventListeners[UIfunctionName] = newFunction;\n }\n else {\n throw new Error('This UI function does not exist. Typo? You tried: ' + UIfunctionName + ' possible are: ' + JSON.stringify(Object.keys(this.body.eventListeners)));\n }\n }\n\n /**\n * Restore the overridden UI functions to their original state.\n *\n * @private\n */\n _unbindTemporaryUIs() {\n for (let functionName in this.temporaryUIFunctions) {\n if (this.temporaryUIFunctions.hasOwnProperty(functionName)) {\n this.body.eventListeners[functionName] = this.temporaryUIFunctions[functionName];\n delete this.temporaryUIFunctions[functionName];\n }\n }\n this.temporaryUIFunctions = {};\n }\n\n /**\n * Unbind the events created by _temporaryBindEvent\n * @private\n */\n _unbindTemporaryEvents() {\n for (let i = 0; i < this.temporaryEventFunctions.length; i++) {\n let eventName = this.temporaryEventFunctions[i].event;\n let boundFunction = this.temporaryEventFunctions[i].boundFunction;\n this.body.emitter.off(eventName, boundFunction);\n }\n this.temporaryEventFunctions = [];\n }\n\n /**\n * Bind an hammer instance to a DOM element.\n * @param domElement\n * @param funct\n */\n _bindHammerToDiv(domElement, boundFunction) {\n let hammer = new Hammer(domElement, {});\n hammerUtil.onTouch(hammer, boundFunction);\n this.manipulationHammers.push(hammer);\n }\n\n\n /**\n * Neatly clean up temporary edges and nodes\n * @private\n */\n _cleanupTemporaryNodesAndEdges() {\n // _clean temporary edges\n for (let i = 0; i < this.temporaryIds.edges.length; i++) {\n this.body.edges[this.temporaryIds.edges[i]].disconnect();\n delete this.body.edges[this.temporaryIds.edges[i]];\n let indexTempEdge = this.body.edgeIndices.indexOf(this.temporaryIds.edges[i]);\n if (indexTempEdge !== -1) {this.body.edgeIndices.splice(indexTempEdge,1);}\n }\n\n // _clean temporary nodes\n for (let i = 0; i < this.temporaryIds.nodes.length; i++) {\n delete this.body.nodes[this.temporaryIds.nodes[i]];\n let indexTempNode = this.body.nodeIndices.indexOf(this.temporaryIds.nodes[i]);\n if (indexTempNode !== -1) {this.body.nodeIndices.splice(indexTempNode,1);}\n }\n\n this.temporaryIds = {nodes: [], edges: []};\n }\n\n // ------------------------------------------ EDIT EDGE FUNCTIONS -----------------------------------------//\n\n /**\n * the touch is used to get the position of the initial click\n * @param event\n * @private\n */\n _controlNodeTouch(event) {\n this.selectionHandler.unselectAll();\n this.lastTouch = this.body.functions.getPointer(event.center);\n this.lastTouch.translation = util.extend({},this.body.view.translation); // copy the object\n }\n\n\n /**\n * the drag start is used to mark one of the control nodes as selected.\n * @param event\n * @private\n */\n _controlNodeDragStart(event) {\n let pointer = this.lastTouch;\n let pointerObj = this.selectionHandler._pointerToPositionObject(pointer);\n let from = this.body.nodes[this.temporaryIds.nodes[0]];\n let to = this.body.nodes[this.temporaryIds.nodes[1]];\n let edge = this.body.edges[this.edgeBeingEditedId];\n this.selectedControlNode = undefined;\n\n let fromSelect = from.isOverlappingWith(pointerObj);\n let toSelect = to.isOverlappingWith(pointerObj);\n\n if (fromSelect === true) {\n this.selectedControlNode = from;\n edge.edgeType.from = from;\n }\n else if (toSelect === true) {\n this.selectedControlNode = to;\n edge.edgeType.to = to;\n }\n\n // we use the selection to find the node that is being dragged. We explicitly select it here.\n if (this.selectedControlNode !== undefined) {\n this.selectionHandler.selectObject(this.selectedControlNode)\n }\n\n this.body.emitter.emit('_redraw');\n }\n\n /**\n * dragging the control nodes or the canvas\n * @param event\n * @private\n */\n _controlNodeDrag(event) {\n this.body.emitter.emit('disablePhysics');\n let pointer = this.body.functions.getPointer(event.center);\n let pos = this.canvas.DOMtoCanvas(pointer);\n if (this.selectedControlNode !== undefined) {\n this.selectedControlNode.x = pos.x;\n this.selectedControlNode.y = pos.y;\n }\n else {\n // if the drag was not started properly because the click started outside the network div, start it now.\n let diffX = pointer.x - this.lastTouch.x;\n let diffY = pointer.y - this.lastTouch.y;\n this.body.view.translation = {x:this.lastTouch.translation.x + diffX, y:this.lastTouch.translation.y + diffY};\n }\n this.body.emitter.emit('_redraw');\n }\n\n\n /**\n * connecting or restoring the control nodes.\n * @param event\n * @private\n */\n _controlNodeDragEnd(event) {\n let pointer = this.body.functions.getPointer(event.center);\n let pointerObj = this.selectionHandler._pointerToPositionObject(pointer);\n let edge = this.body.edges[this.edgeBeingEditedId];\n // if the node that was dragged is not a control node, return\n if (this.selectedControlNode === undefined) {\n return;\n }\n\n // we use the selection to find the node that is being dragged. We explicitly DEselect the control node here.\n this.selectionHandler.unselectAll();\n let overlappingNodeIds = this.selectionHandler._getAllNodesOverlappingWith(pointerObj);\n let node = undefined;\n for (let i = overlappingNodeIds.length-1; i >= 0; i--) {\n if (overlappingNodeIds[i] !== this.selectedControlNode.id) {\n node = this.body.nodes[overlappingNodeIds[i]];\n break;\n }\n }\n // perform the connection\n if (node !== undefined && this.selectedControlNode !== undefined) {\n if (node.isCluster === true) {\n alert(this.options.locales[this.options.locale]['createEdgeError'] || this.options.locales['en']['createEdgeError'])\n }\n else {\n let from = this.body.nodes[this.temporaryIds.nodes[0]];\n if (this.selectedControlNode.id === from.id) {\n this._performEditEdge(node.id, edge.to.id);\n }\n else {\n this._performEditEdge(edge.from.id, node.id);\n }\n }\n }\n else {\n edge.updateEdgeType();\n this.body.emitter.emit('restorePhysics');\n }\n this.body.emitter.emit('_redraw');\n }\n\n // ------------------------------------ END OF EDIT EDGE FUNCTIONS -----------------------------------------//\n\n\n\n // ------------------------------------------- ADD EDGE FUNCTIONS -----------------------------------------//\n /**\n * the function bound to the selection event. It checks if you want to connect a cluster and changes the description\n * to walk the user through the process.\n *\n * @private\n */\n _handleConnect(event) {\n // check to avoid double fireing of this function.\n if (new Date().valueOf() - this.touchTime > 100) {\n this.lastTouch = this.body.functions.getPointer(event.center);\n this.lastTouch.translation = util.extend({},this.body.view.translation); // copy the object\n\n let pointer = this.lastTouch;\n let node = this.selectionHandler.getNodeAt(pointer);\n\n if (node !== undefined) {\n if (node.isCluster === true) {\n alert(this.options.locales[this.options.locale]['createEdgeError'] || this.options.locales['en']['createEdgeError'])\n }\n else {\n // create a node the temporary line can look at\n let targetNode = this._getNewTargetNode(node.x,node.y);\n this.body.nodes[targetNode.id] = targetNode;\n this.body.nodeIndices.push(targetNode.id);\n\n // create a temporary edge\n let connectionEdge = this.body.functions.createEdge({\n id: 'connectionEdge' + util.randomUUID(),\n from: node.id,\n to: targetNode.id,\n physics: false,\n smooth: {\n enabled: true,\n type: 'continuous',\n roundness: 0.5\n }\n });\n this.body.edges[connectionEdge.id] = connectionEdge;\n this.body.edgeIndices.push(connectionEdge.id);\n\n this.temporaryIds.nodes.push(targetNode.id);\n this.temporaryIds.edges.push(connectionEdge.id);\n }\n }\n this.touchTime = new Date().valueOf();\n }\n }\n\n _dragControlNode(event) {\n let pointer = this.body.functions.getPointer(event.center);\n if (this.temporaryIds.nodes[0] !== undefined) {\n let targetNode = this.body.nodes[this.temporaryIds.nodes[0]]; // there is only one temp node in the add edge mode.\n targetNode.x = this.canvas._XconvertDOMtoCanvas(pointer.x);\n targetNode.y = this.canvas._YconvertDOMtoCanvas(pointer.y);\n this.body.emitter.emit('_redraw');\n }\n else {\n let diffX = pointer.x - this.lastTouch.x;\n let diffY = pointer.y - this.lastTouch.y;\n this.body.view.translation = {x:this.lastTouch.translation.x + diffX, y:this.lastTouch.translation.y + diffY};\n }\n\n }\n\n\n /**\n * Connect the new edge to the target if one exists, otherwise remove temp line\n * @param event\n * @private\n */\n _finishConnect(event) {\n let pointer = this.body.functions.getPointer(event.center);\n let pointerObj = this.selectionHandler._pointerToPositionObject(pointer);\n\n // remember the edge id\n let connectFromId = undefined;\n if (this.temporaryIds.edges[0] !== undefined) {\n connectFromId = this.body.edges[this.temporaryIds.edges[0]].fromId;\n }\n\n // get the overlapping node but NOT the temporary node;\n let overlappingNodeIds = this.selectionHandler._getAllNodesOverlappingWith(pointerObj);\n let node = undefined;\n for (let i = overlappingNodeIds.length-1; i >= 0; i--) {\n // if the node id is NOT a temporary node, accept the node.\n if (this.temporaryIds.nodes.indexOf(overlappingNodeIds[i]) === -1) {\n node = this.body.nodes[overlappingNodeIds[i]];\n break;\n }\n }\n\n // clean temporary nodes and edges.\n this._cleanupTemporaryNodesAndEdges();\n\n // perform the connection\n if (node !== undefined) {\n if (node.isCluster === true) {\n alert(this.options.locales[this.options.locale]['createEdgeError'] || this.options.locales['en']['createEdgeError']);\n }\n else {\n if (this.body.nodes[connectFromId] !== undefined && this.body.nodes[node.id] !== undefined) {\n this._performAddEdge(connectFromId, node.id);\n }\n }\n }\n this.body.emitter.emit('_redraw');\n }\n\n // --------------------------------------- END OF ADD EDGE FUNCTIONS -------------------------------------//\n\n\n // ------------------------------ Performing all the actual data manipulation ------------------------//\n\n /**\n * Adds a node on the specified location\n */\n _performAddNode(clickData) {\n let defaultData = {\n id: util.randomUUID(),\n x: clickData.pointer.canvas.x,\n y: clickData.pointer.canvas.y,\n label: 'new'\n };\n\n if (typeof this.options.addNode === 'function') {\n if (this.options.addNode.length === 2) {\n this.options.addNode(defaultData, (finalizedData) => {\n if (finalizedData !== null && finalizedData !== undefined && this.inMode === 'addNode') { // if for whatever reason the mode has changes (due to dataset change) disregard the callback\n this.body.data.nodes.getDataSet().add(finalizedData);\n this.showManipulatorToolbar();\n }\n });\n }\n else {\n throw new Error('The function for add does not support two arguments (data,callback)');\n this.showManipulatorToolbar();\n }\n }\n else {\n this.body.data.nodes.getDataSet().add(defaultData);\n this.showManipulatorToolbar();\n }\n }\n\n\n /**\n * connect two nodes with a new edge.\n *\n * @private\n */\n _performAddEdge(sourceNodeId, targetNodeId) {\n let defaultData = {from: sourceNodeId, to: targetNodeId};\n if (typeof this.options.addEdge === 'function') {\n if (this.options.addEdge.length === 2) {\n this.options.addEdge(defaultData, (finalizedData) => {\n if (finalizedData !== null && finalizedData !== undefined && this.inMode === 'addEdge') { // if for whatever reason the mode has changes (due to dataset change) disregard the callback\n this.body.data.edges.getDataSet().add(finalizedData);\n this.selectionHandler.unselectAll();\n this.showManipulatorToolbar();\n }\n });\n }\n else {\n throw new Error('The function for connect does not support two arguments (data,callback)');\n }\n }\n else {\n this.body.data.edges.getDataSet().add(defaultData);\n this.selectionHandler.unselectAll();\n this.showManipulatorToolbar();\n }\n }\n\n /**\n * connect two nodes with a new edge.\n *\n * @private\n */\n _performEditEdge(sourceNodeId, targetNodeId) {\n let defaultData = {id: this.edgeBeingEditedId, from: sourceNodeId, to: targetNodeId, label: this.body.data.edges._data[this.edgeBeingEditedId].label };\n let eeFunct = this.options.editEdge;\n if (typeof eeFunct === 'object') {\n eeFunct = eeFunct.editWithoutDrag;\n }\n if (typeof eeFunct === 'function') {\n if (eeFunct.length === 2) {\n eeFunct(defaultData, (finalizedData) => {\n if (finalizedData === null || finalizedData === undefined || this.inMode !== 'editEdge') { // if for whatever reason the mode has changes (due to dataset change) disregard the callback) {\n this.body.edges[defaultData.id].updateEdgeType();\n this.body.emitter.emit('_redraw');\n this.showManipulatorToolbar();\n }\n else {\n this.body.data.edges.getDataSet().update(finalizedData);\n this.selectionHandler.unselectAll();\n this.showManipulatorToolbar();\n }\n });\n }\n else {\n throw new Error('The function for edit does not support two arguments (data, callback)');\n }\n }\n else {\n this.body.data.edges.getDataSet().update(defaultData);\n this.selectionHandler.unselectAll();\n this.showManipulatorToolbar();\n }\n }\n\n\n}\n\nexport default ManipulationSystem;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/ManipulationSystem.js","/**\n * This object contains all possible options. It will check if the types are correct, if required if the option is one\n * of the allowed values.\n *\n * __any__ means that the name of the property does not matter.\n * __type__ is a required field for all objects and contains the allowed types of all objects\n */\nlet string = 'string';\nlet bool = 'boolean';\nlet number = 'number';\nlet array = 'array';\nlet object = 'object'; // should only be in a __type__ property\nlet dom = 'dom';\nlet any = 'any';\n\n\nlet allOptions = {\n configure: {\n enabled: { boolean: bool },\n filter: { boolean: bool, string, array, 'function': 'function' },\n container: { dom },\n showButton: { boolean: bool },\n __type__: { object, boolean: bool, string, array, 'function': 'function' }\n },\n edges: {\n arrows: {\n to: { enabled: { boolean: bool }, scaleFactor: { number }, type: { string: ['arrow', 'circle'] }, __type__: { object, boolean: bool } },\n middle: { enabled: { boolean: bool }, scaleFactor: { number }, type: { string: ['arrow', 'circle'] }, __type__: { object, boolean: bool } },\n from: { enabled: { boolean: bool }, scaleFactor: { number }, type: { string: ['arrow', 'circle'] }, __type__: { object, boolean: bool } },\n __type__: { string: ['from', 'to', 'middle'], object }\n },\n arrowStrikethrough: { boolean: bool },\n chosen: {\n label: { boolean: bool, 'function': 'function' },\n edge: { boolean: bool, 'function': 'function' },\n __type__: { object, boolean: bool }\n },\n color: {\n color: { string },\n highlight: { string },\n hover: { string },\n inherit: { string: ['from', 'to', 'both'], boolean: bool },\n opacity: { number },\n __type__: { object, string }\n },\n dashes: { boolean: bool, array },\n font: {\n color: { string },\n size: { number }, // px\n face: { string },\n background: { string },\n strokeWidth: { number }, // px\n strokeColor: { string },\n align: { string: ['horizontal', 'top', 'middle', 'bottom'] },\n vadjust: { number },\n multi: { boolean: bool, string },\n bold: {\n color: { string },\n size: { number }, // px\n face: { string },\n mod: { string },\n vadjust: { number },\n __type__: { object, string }\n },\n boldital: {\n color: { string },\n size: { number }, // px\n face: { string },\n mod: { string },\n vadjust: { number },\n __type__: { object, string }\n },\n ital: {\n color: { string },\n size: { number }, // px\n face: { string },\n mod: { string },\n vadjust: { number },\n __type__: { object, string }\n },\n mono: {\n color: { string },\n size: { number }, // px\n face: { string },\n mod: { string },\n vadjust: { number },\n __type__: { object, string }\n },\n __type__: { object, string }\n },\n hidden: { boolean: bool },\n hoverWidth: { 'function': 'function', number },\n label: { string, 'undefined': 'undefined' },\n labelHighlightBold: { boolean: bool },\n length: { number, 'undefined': 'undefined' },\n physics: { boolean: bool },\n scaling: {\n min: { number },\n max: { number },\n label: {\n enabled: { boolean: bool },\n min: { number },\n max: { number },\n maxVisible: { number },\n drawThreshold: { number },\n __type__: { object, boolean: bool }\n },\n customScalingFunction: { 'function': 'function' },\n __type__: { object }\n },\n selectionWidth: { 'function': 'function', number },\n selfReferenceSize: { number },\n shadow: {\n enabled: { boolean: bool },\n color: { string },\n size: { number },\n x: { number },\n y: { number },\n __type__: { object, boolean: bool }\n },\n smooth: {\n enabled: { boolean: bool },\n type: { string: ['dynamic', 'continuous', 'discrete', 'diagonalCross', 'straightCross', 'horizontal', 'vertical', 'curvedCW', 'curvedCCW', 'cubicBezier'] },\n roundness: { number },\n forceDirection: { string: ['horizontal', 'vertical', 'none'], boolean: bool },\n __type__: { object, boolean: bool }\n },\n title: { string, 'undefined': 'undefined' },\n width: { number },\n widthConstraint: {\n maximum: { number },\n __type__: { object, boolean: bool, number }\n },\n value: { number, 'undefined': 'undefined' },\n __type__: { object }\n },\n groups: {\n useDefaultGroups: { boolean: bool },\n __any__: 'get from nodes, will be overwritten below',\n __type__: { object }\n },\n interaction: {\n dragNodes: { boolean: bool },\n dragView: { boolean: bool },\n hideEdgesOnDrag: { boolean: bool },\n hideNodesOnDrag: { boolean: bool },\n hover: { boolean: bool },\n keyboard: {\n enabled: { boolean: bool },\n speed: { x: { number }, y: { number }, zoom: { number }, __type__: { object } },\n bindToWindow: { boolean: bool },\n __type__: { object, boolean: bool }\n },\n multiselect: { boolean: bool },\n navigationButtons: { boolean: bool },\n selectable: { boolean: bool },\n selectConnectedEdges: { boolean: bool },\n hoverConnectedEdges: { boolean: bool },\n tooltipDelay: { number },\n zoomView: { boolean: bool },\n __type__: { object }\n },\n layout: {\n randomSeed: { 'undefined': 'undefined', number },\n improvedLayout: { boolean: bool },\n hierarchical: {\n enabled: { boolean: bool },\n levelSeparation: { number },\n nodeSpacing: { number },\n treeSpacing: { number },\n blockShifting: { boolean: bool },\n edgeMinimization: { boolean: bool },\n parentCentralization: { boolean: bool },\n direction: { string: ['UD', 'DU', 'LR', 'RL'] }, // UD, DU, LR, RL\n sortMethod: { string: ['hubsize', 'directed'] }, // hubsize, directed\n __type__: { object, boolean: bool }\n },\n __type__: { object }\n },\n manipulation: {\n enabled: { boolean: bool },\n initiallyActive: { boolean: bool },\n addNode: { boolean: bool, 'function': 'function' },\n addEdge: { boolean: bool, 'function': 'function' },\n editNode: { 'function': 'function' },\n editEdge: {\n editWithoutDrag: { 'function' : 'function' },\n __type__: {object, boolean: bool, 'function': 'function' }\n },\n deleteNode: { boolean: bool, 'function': 'function' },\n deleteEdge: { boolean: bool, 'function': 'function' },\n controlNodeStyle: 'get from nodes, will be overwritten below',\n __type__: { object, boolean: bool }\n },\n nodes: {\n borderWidth: { number },\n borderWidthSelected: { number, 'undefined': 'undefined' },\n brokenImage: { string, 'undefined': 'undefined' },\n chosen: {\n label: { boolean: bool, 'function': 'function' },\n node: { boolean: bool, 'function': 'function' },\n __type__: { object, boolean: bool }\n },\n color: {\n border: { string },\n background: { string },\n highlight: {\n border: { string },\n background: { string },\n __type__: { object, string }\n },\n hover: {\n border: { string },\n background: { string },\n __type__: { object, string }\n },\n __type__: { object, string }\n },\n fixed: {\n x: { boolean: bool },\n y: { boolean: bool },\n __type__: { object, boolean: bool }\n },\n font: {\n align: { string },\n color: { string },\n size: { number }, // px\n face: { string },\n background: { string },\n strokeWidth: { number }, // px\n strokeColor: { string },\n vadjust: { number },\n multi: { boolean: bool, string },\n bold: {\n color: { string },\n size: { number }, // px\n face: { string },\n mod: { string },\n vadjust: { number },\n __type__: { object, string }\n },\n boldital: {\n color: { string },\n size: { number }, // px\n face: { string },\n mod: { string },\n vadjust: { number },\n __type__: { object, string }\n },\n ital: {\n color: { string },\n size: { number }, // px\n face: { string },\n mod: { string },\n vadjust: { number },\n __type__: { object, string }\n },\n mono: {\n color: { string },\n size: { number }, // px\n face: { string },\n mod: { string },\n vadjust: { number },\n __type__: { object, string }\n },\n __type__: { object, string }\n },\n group: { string, number, 'undefined': 'undefined' },\n heightConstraint: {\n minimum: { number },\n valign: { string },\n __type__: { object, boolean: bool, number }\n },\n hidden: { boolean: bool },\n icon: {\n face: { string },\n code: { string }, //'\\uf007',\n size: { number }, //50,\n color: { string },\n __type__: { object }\n },\n id: { string, number },\n image: { string, 'undefined': 'undefined' }, // --> URL\n label: { string, 'undefined': 'undefined' },\n labelHighlightBold: { boolean: bool },\n level: { number, 'undefined': 'undefined' },\n margin: {\n top: { number },\n right: { number },\n bottom: { number },\n left: { number },\n __type__: { object, number }\n },\n mass: { number },\n physics: { boolean: bool },\n scaling: {\n min: { number },\n max: { number },\n label: {\n enabled: { boolean: bool },\n min: { number },\n max: { number },\n maxVisible: { number },\n drawThreshold: { number },\n __type__: { object, boolean: bool }\n },\n customScalingFunction: { 'function': 'function' },\n __type__: { object }\n },\n shadow: {\n enabled: { boolean: bool },\n color: { string },\n size: { number },\n x: { number },\n y: { number },\n __type__: { object, boolean: bool }\n },\n shape: { string: ['ellipse', 'circle', 'database', 'box', 'text', 'image', 'circularImage', 'diamond', 'dot', 'star', 'triangle', 'triangleDown', 'square', 'icon'] },\n shapeProperties: {\n borderDashes: { boolean: bool, array },\n borderRadius: { number },\n interpolation: { boolean: bool },\n useImageSize: { boolean: bool },\n useBorderWithImage: { boolean: bool },\n __type__: { object }\n },\n size: { number },\n title: { string, 'undefined': 'undefined' },\n value: { number, 'undefined': 'undefined' },\n widthConstraint: {\n minimum: { number },\n maximum: { number },\n __type__: { object, boolean: bool, number }\n },\n x: { number },\n y: { number },\n __type__: { object }\n },\n physics: {\n enabled: { boolean: bool },\n barnesHut: {\n gravitationalConstant: { number },\n centralGravity: { number },\n springLength: { number },\n springConstant: { number },\n damping: { number },\n avoidOverlap: { number },\n __type__: { object }\n },\n forceAtlas2Based: {\n gravitationalConstant: { number },\n centralGravity: { number },\n springLength: { number },\n springConstant: { number },\n damping: { number },\n avoidOverlap: { number },\n __type__: { object }\n },\n repulsion: {\n centralGravity: { number },\n springLength: { number },\n springConstant: { number },\n nodeDistance: { number },\n damping: { number },\n __type__: { object }\n },\n hierarchicalRepulsion: {\n centralGravity: { number },\n springLength: { number },\n springConstant: { number },\n nodeDistance: { number },\n damping: { number },\n __type__: { object }\n },\n maxVelocity: { number },\n minVelocity: { number }, // px/s\n solver: { string: ['barnesHut', 'repulsion', 'hierarchicalRepulsion', 'forceAtlas2Based'] },\n stabilization: {\n enabled: { boolean: bool },\n iterations: { number }, // maximum number of iteration to stabilize\n updateInterval: { number },\n onlyDynamicEdges: { boolean: bool },\n fit: { boolean: bool },\n __type__: { object, boolean: bool }\n },\n timestep: { number },\n adaptiveTimestep: { boolean: bool },\n __type__: { object, boolean: bool }\n },\n\n //globals :\n autoResize: { boolean: bool },\n clickToUse: { boolean: bool },\n locale: { string },\n locales: {\n __any__: { any },\n __type__: { object }\n },\n height: { string },\n width: { string },\n __type__: { object }\n};\n\nallOptions.groups.__any__ = allOptions.nodes;\nallOptions.manipulation.controlNodeStyle = allOptions.nodes;\n\n\nlet configureOptions = {\n nodes: {\n borderWidth: [1, 0, 10, 1],\n borderWidthSelected: [2, 0, 10, 1],\n color: {\n border: ['color', '#2B7CE9'],\n background: ['color', '#97C2FC'],\n highlight: {\n border: ['color', '#2B7CE9'],\n background: ['color', '#D2E5FF']\n },\n hover: {\n border: ['color', '#2B7CE9'],\n background: ['color', '#D2E5FF']\n }\n },\n fixed: {\n x: false,\n y: false\n },\n font: {\n color: ['color', '#343434'],\n size: [14, 0, 100, 1], // px\n face: ['arial', 'verdana', 'tahoma'],\n background: ['color', 'none'],\n strokeWidth: [0, 0, 50, 1], // px\n strokeColor: ['color', '#ffffff']\n },\n //group: 'string',\n hidden: false,\n labelHighlightBold: true,\n //icon: {\n // face: 'string', //'FontAwesome',\n // code: 'string', //'\\uf007',\n // size: [50, 0, 200, 1], //50,\n // color: ['color','#2B7CE9'] //'#aa00ff'\n //},\n //image: 'string', // --> URL\n physics: true,\n scaling: {\n min: [10, 0, 200, 1],\n max: [30, 0, 200, 1],\n label: {\n enabled: false,\n min: [14, 0, 200, 1],\n max: [30, 0, 200, 1],\n maxVisible: [30, 0, 200, 1],\n drawThreshold: [5, 0, 20, 1]\n }\n },\n shadow: {\n enabled: false,\n color: 'rgba(0,0,0,0.5)',\n size: [10, 0, 20, 1],\n x: [5, -30, 30, 1],\n y: [5, -30, 30, 1]\n },\n shape: ['ellipse', 'box', 'circle', 'database', 'diamond', 'dot', 'square', 'star', 'text', 'triangle', 'triangleDown'],\n shapeProperties: {\n borderDashes: false,\n borderRadius: [6, 0, 20, 1],\n interpolation: true,\n useImageSize: false\n },\n size: [25, 0, 200, 1]\n },\n edges: {\n arrows: {\n to: { enabled: false, scaleFactor: [1, 0, 3, 0.05], type: 'arrow' },\n middle: { enabled: false, scaleFactor: [1, 0, 3, 0.05], type: 'arrow' },\n from: { enabled: false, scaleFactor: [1, 0, 3, 0.05], type: 'arrow' }\n },\n arrowStrikethrough: true,\n color: {\n color: ['color', '#848484'],\n highlight: ['color', '#848484'],\n hover: ['color', '#848484'],\n inherit: ['from', 'to', 'both', true, false],\n opacity: [1, 0, 1, 0.05]\n },\n dashes: false,\n font: {\n color: ['color', '#343434'],\n size: [14, 0, 100, 1], // px\n face: ['arial', 'verdana', 'tahoma'],\n background: ['color', 'none'],\n strokeWidth: [2, 0, 50, 1], // px\n strokeColor: ['color', '#ffffff'],\n align: ['horizontal', 'top', 'middle', 'bottom']\n },\n hidden: false,\n hoverWidth: [1.5, 0, 5, 0.1],\n labelHighlightBold: true,\n physics: true,\n scaling: {\n min: [1, 0, 100, 1],\n max: [15, 0, 100, 1],\n label: {\n enabled: true,\n min: [14, 0, 200, 1],\n max: [30, 0, 200, 1],\n maxVisible: [30, 0, 200, 1],\n drawThreshold: [5, 0, 20, 1]\n }\n },\n selectionWidth: [1.5, 0, 5, 0.1],\n selfReferenceSize: [20, 0, 200, 1],\n shadow: {\n enabled: false,\n color: 'rgba(0,0,0,0.5)',\n size: [10, 0, 20, 1],\n x: [5, -30, 30, 1],\n y: [5, -30, 30, 1]\n },\n smooth: {\n enabled: true,\n type: ['dynamic', 'continuous', 'discrete', 'diagonalCross', 'straightCross', 'horizontal', 'vertical', 'curvedCW', 'curvedCCW', 'cubicBezier'],\n forceDirection: ['horizontal', 'vertical', 'none'],\n roundness: [0.5, 0, 1, 0.05]\n },\n width: [1, 0, 30, 1]\n },\n layout: {\n //randomSeed: [0, 0, 500, 1],\n //improvedLayout: true,\n hierarchical: {\n enabled: false,\n levelSeparation: [150, 20, 500, 5],\n nodeSpacing: [100, 20, 500, 5],\n treeSpacing: [200, 20, 500, 5],\n blockShifting: true,\n edgeMinimization: true,\n parentCentralization: true,\n direction: ['UD', 'DU', 'LR', 'RL'], // UD, DU, LR, RL\n sortMethod: ['hubsize', 'directed'] // hubsize, directed\n }\n },\n interaction: {\n dragNodes: true,\n dragView: true,\n hideEdgesOnDrag: false,\n hideNodesOnDrag: false,\n hover: false,\n keyboard: {\n enabled: false,\n speed: { x: [10, 0, 40, 1], y: [10, 0, 40, 1], zoom: [0.02, 0, 0.1, 0.005] },\n bindToWindow: true\n },\n multiselect: false,\n navigationButtons: false,\n selectable: true,\n selectConnectedEdges: true,\n hoverConnectedEdges: true,\n tooltipDelay: [300, 0, 1000, 25],\n zoomView: true\n },\n manipulation: {\n enabled: false,\n initiallyActive: false\n },\n physics: {\n enabled: true,\n barnesHut: {\n //theta: [0.5, 0.1, 1, 0.05],\n gravitationalConstant: [-2000, -30000, 0, 50],\n centralGravity: [0.3, 0, 10, 0.05],\n springLength: [95, 0, 500, 5],\n springConstant: [0.04, 0, 1.2, 0.005],\n damping: [0.09, 0, 1, 0.01],\n avoidOverlap: [0, 0, 1, 0.01]\n },\n forceAtlas2Based: {\n //theta: [0.5, 0.1, 1, 0.05],\n gravitationalConstant: [-50, -500, 0, 1],\n centralGravity: [0.01, 0, 1, 0.005],\n springLength: [95, 0, 500, 5],\n springConstant: [0.08, 0, 1.2, 0.005],\n damping: [0.4, 0, 1, 0.01],\n avoidOverlap: [0, 0, 1, 0.01]\n },\n repulsion: {\n centralGravity: [0.2, 0, 10, 0.05],\n springLength: [200, 0, 500, 5],\n springConstant: [0.05, 0, 1.2, 0.005],\n nodeDistance: [100, 0, 500, 5],\n damping: [0.09, 0, 1, 0.01]\n },\n hierarchicalRepulsion: {\n centralGravity: [0.2, 0, 10, 0.05],\n springLength: [100, 0, 500, 5],\n springConstant: [0.01, 0, 1.2, 0.005],\n nodeDistance: [120, 0, 500, 5],\n damping: [0.09, 0, 1, 0.01]\n },\n maxVelocity: [50, 0, 150, 1],\n minVelocity: [0.1, 0.01, 0.5, 0.01],\n solver: ['barnesHut', 'forceAtlas2Based', 'repulsion', 'hierarchicalRepulsion'],\n timestep: [0.5, 0.01, 1, 0.01],\n //adaptiveTimestep: true\n }\n};\n\nexport {allOptions, configureOptions};\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/options.js","// distance finding algorithm\nimport FloydWarshall from \"./components/algorithms/FloydWarshall.js\"\n\n\n/**\n * KamadaKawai positions the nodes initially based on\n *\n * \"AN ALGORITHM FOR DRAWING GENERAL UNDIRECTED GRAPHS\"\n * -- Tomihisa KAMADA and Satoru KAWAI in 1989\n *\n * Possible optimizations in the distance calculation can be implemented.\n */\nclass KamadaKawai {\n constructor(body, edgeLength, edgeStrength) {\n this.body = body;\n this.springLength = edgeLength;\n this.springConstant = edgeStrength;\n this.distanceSolver = new FloydWarshall();\n }\n\n /**\n * Not sure if needed but can be used to update the spring length and spring constant\n * @param options\n */\n setOptions(options) {\n if (options) {\n if (options.springLength) {\n this.springLength = options.springLength;\n }\n if (options.springConstant) {\n this.springConstant = options.springConstant;\n }\n }\n }\n\n\n /**\n * Position the system\n * @param nodesArray\n * @param edgesArray\n */\n solve(nodesArray, edgesArray, ignoreClusters = false) {\n // get distance matrix\n let D_matrix = this.distanceSolver.getDistances(this.body, nodesArray, edgesArray); // distance matrix\n\n // get the L Matrix\n this._createL_matrix(D_matrix);\n\n // get the K Matrix\n this._createK_matrix(D_matrix);\n\n // calculate positions\n let threshold = 0.01;\n let innerThreshold = 1;\n let iterations = 0;\n let maxIterations = Math.max(1000,Math.min(10*this.body.nodeIndices.length,6000));\n let maxInnerIterations = 5;\n\n let maxEnergy = 1e9;\n let highE_nodeId = 0, dE_dx = 0, dE_dy = 0, delta_m = 0, subIterations = 0;\n\n while (maxEnergy > threshold && iterations < maxIterations) {\n iterations += 1;\n [highE_nodeId, maxEnergy, dE_dx, dE_dy] = this._getHighestEnergyNode(ignoreClusters);\n delta_m = maxEnergy;\n subIterations = 0;\n while(delta_m > innerThreshold && subIterations < maxInnerIterations) {\n subIterations += 1;\n this._moveNode(highE_nodeId, dE_dx, dE_dy);\n [delta_m,dE_dx,dE_dy] = this._getEnergy(highE_nodeId);\n }\n }\n }\n\n /**\n * get the node with the highest energy\n * @returns {*[]}\n * @private\n */\n _getHighestEnergyNode(ignoreClusters) {\n let nodesArray = this.body.nodeIndices;\n let nodes = this.body.nodes;\n let maxEnergy = 0;\n let maxEnergyNodeId = nodesArray[0];\n let dE_dx_max = 0, dE_dy_max = 0;\n\n for (let nodeIdx = 0; nodeIdx < nodesArray.length; nodeIdx++) {\n let m = nodesArray[nodeIdx];\n // by not evaluating nodes with predefined positions we should only move nodes that have no positions.\n if ((nodes[m].predefinedPosition === false || nodes[m].isCluster === true && ignoreClusters === true) || nodes[m].options.fixed.x === true || nodes[m].options.fixed.y === true) {\n let [delta_m,dE_dx,dE_dy] = this._getEnergy(m);\n if (maxEnergy < delta_m) {\n maxEnergy = delta_m;\n maxEnergyNodeId = m;\n dE_dx_max = dE_dx;\n dE_dy_max = dE_dy;\n }\n }\n }\n\n return [maxEnergyNodeId, maxEnergy, dE_dx_max, dE_dy_max];\n }\n\n /**\n * calculate the energy of a single node\n * @param m\n * @returns {*[]}\n * @private\n */\n _getEnergy(m) {\n let nodesArray = this.body.nodeIndices;\n let nodes = this.body.nodes;\n\n let x_m = nodes[m].x;\n let y_m = nodes[m].y;\n let dE_dx = 0;\n let dE_dy = 0;\n for (let iIdx = 0; iIdx < nodesArray.length; iIdx++) {\n let i = nodesArray[iIdx];\n if (i !== m) {\n let x_i = nodes[i].x;\n let y_i = nodes[i].y;\n let denominator = 1.0 / Math.sqrt(Math.pow(x_m - x_i, 2) + Math.pow(y_m - y_i, 2));\n dE_dx += this.K_matrix[m][i] * ((x_m - x_i) - this.L_matrix[m][i] * (x_m - x_i) * denominator);\n dE_dy += this.K_matrix[m][i] * ((y_m - y_i) - this.L_matrix[m][i] * (y_m - y_i) * denominator);\n }\n }\n\n let delta_m = Math.sqrt(Math.pow(dE_dx, 2) + Math.pow(dE_dy, 2));\n return [delta_m, dE_dx, dE_dy];\n }\n\n /**\n * move the node based on it's energy\n * the dx and dy are calculated from the linear system proposed by Kamada and Kawai\n * @param m\n * @param dE_dx\n * @param dE_dy\n * @private\n */\n _moveNode(m, dE_dx, dE_dy) {\n let nodesArray = this.body.nodeIndices;\n let nodes = this.body.nodes;\n let d2E_dx2 = 0;\n let d2E_dxdy = 0;\n let d2E_dy2 = 0;\n\n let x_m = nodes[m].x;\n let y_m = nodes[m].y;\n for (let iIdx = 0; iIdx < nodesArray.length; iIdx++) {\n let i = nodesArray[iIdx];\n if (i !== m) {\n let x_i = nodes[i].x;\n let y_i = nodes[i].y;\n let denominator = 1.0 / Math.pow(Math.pow(x_m - x_i, 2) + Math.pow(y_m - y_i, 2), 1.5);\n d2E_dx2 += this.K_matrix[m][i] * (1 - this.L_matrix[m][i] * Math.pow(y_m - y_i, 2) * denominator);\n d2E_dxdy += this.K_matrix[m][i] * (this.L_matrix[m][i] * (x_m - x_i) * (y_m - y_i) * denominator);\n d2E_dy2 += this.K_matrix[m][i] * (1 - this.L_matrix[m][i] * Math.pow(x_m - x_i, 2) * denominator);\n }\n }\n // make the variable names easier to make the solving of the linear system easier to read\n let A = d2E_dx2, B = d2E_dxdy, C = dE_dx, D = d2E_dy2, E = dE_dy;\n\n // solve the linear system for dx and dy\n let dy = (C / A + E / B) / (B / A - D / B);\n let dx = -(B * dy + C) / A;\n\n // move the node\n nodes[m].x += dx;\n nodes[m].y += dy;\n }\n\n\n /**\n * Create the L matrix: edge length times shortest path\n * @param D_matrix\n * @private\n */\n _createL_matrix(D_matrix) {\n let nodesArray = this.body.nodeIndices;\n let edgeLength = this.springLength;\n\n this.L_matrix = [];\n for (let i = 0; i < nodesArray.length; i++) {\n this.L_matrix[nodesArray[i]] = {};\n for (let j = 0; j < nodesArray.length; j++) {\n this.L_matrix[nodesArray[i]][nodesArray[j]] = edgeLength * D_matrix[nodesArray[i]][nodesArray[j]];\n }\n }\n }\n\n\n /**\n * Create the K matrix: spring constants times shortest path\n * @param D_matrix\n * @private\n */\n _createK_matrix(D_matrix) {\n let nodesArray = this.body.nodeIndices;\n let edgeStrength = this.springConstant;\n\n this.K_matrix = [];\n for (let i = 0; i < nodesArray.length; i++) {\n this.K_matrix[nodesArray[i]] = {};\n for (let j = 0; j < nodesArray.length; j++) {\n this.K_matrix[nodesArray[i]][nodesArray[j]] = edgeStrength * Math.pow(D_matrix[nodesArray[i]][nodesArray[j]], -2);\n }\n }\n }\n\n\n\n}\n\nexport default KamadaKawai;\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/KamadaKawai.js","/**\n * Created by Alex on 10-Aug-15.\n */\n\n\nclass FloydWarshall {\n constructor(){}\n\n getDistances(body, nodesArray, edgesArray) {\n let D_matrix = {};\n let edges = body.edges;\n\n // prepare matrix with large numbers\n for (let i = 0; i < nodesArray.length; i++) {\n D_matrix[nodesArray[i]] = {};\n D_matrix[nodesArray[i]] = {};\n for (let j = 0; j < nodesArray.length; j++) {\n D_matrix[nodesArray[i]][nodesArray[j]] = (i == j ? 0 : 1e9);\n D_matrix[nodesArray[i]][nodesArray[j]] = (i == j ? 0 : 1e9);\n }\n }\n\n // put the weights for the edges in. This assumes unidirectionality.\n for (let i = 0; i < edgesArray.length; i++) {\n let edge = edges[edgesArray[i]];\n // edge has to be connected if it counts to the distances. If it is connected to inner clusters it will crash so we also check if it is in the D_matrix\n if (edge.connected === true && D_matrix[edge.fromId] !== undefined && D_matrix[edge.toId] !== undefined) {\n D_matrix[edge.fromId][edge.toId] = 1;\n D_matrix[edge.toId][edge.fromId] = 1;\n }\n }\n\n let nodeCount = nodesArray.length;\n\n // Adapted FloydWarshall based on unidirectionality to greatly reduce complexity.\n for (let k = 0; k < nodeCount; k++) {\n for (let i = 0; i < nodeCount-1; i++) {\n for (let j = i+1; j < nodeCount; j++) {\n D_matrix[nodesArray[i]][nodesArray[j]] = Math.min(D_matrix[nodesArray[i]][nodesArray[j]],D_matrix[nodesArray[i]][nodesArray[k]] + D_matrix[nodesArray[k]][nodesArray[j]])\n D_matrix[nodesArray[j]][nodesArray[i]] = D_matrix[nodesArray[i]][nodesArray[j]];\n }\n }\n }\n\n return D_matrix;\n }\n}\n\nexport default FloydWarshall;\n\n\n// WEBPACK FOOTER //\n// ./lib/network/modules/components/algorithms/FloydWarshall.js","/**\n * Canvas shapes used by Network\n */\nif (typeof CanvasRenderingContext2D !== 'undefined') {\n\n /**\n * Draw a circle shape\n */\n CanvasRenderingContext2D.prototype.circle = function (x, y, r) {\n this.beginPath();\n this.arc(x, y, r, 0, 2 * Math.PI, false);\n this.closePath();\n };\n\n /**\n * Draw a square shape\n * @param {Number} x horizontal center\n * @param {Number} y vertical center\n * @param {Number} r size, width and height of the square\n */\n CanvasRenderingContext2D.prototype.square = function (x, y, r) {\n this.beginPath();\n this.rect(x - r, y - r, r * 2, r * 2);\n this.closePath();\n };\n\n /**\n * Draw a triangle shape\n * @param {Number} x horizontal center\n * @param {Number} y vertical center\n * @param {Number} r radius, half the length of the sides of the triangle\n */\n CanvasRenderingContext2D.prototype.triangle = function (x, y, r) {\n // http://en.wikipedia.org/wiki/Equilateral_triangle\n this.beginPath();\n\n // the change in radius and the offset is here to center the shape\n r *= 1.15;\n y += 0.275 * r;\n\n var s = r * 2;\n var s2 = s / 2;\n var ir = Math.sqrt(3) / 6 * s; // radius of inner circle\n var h = Math.sqrt(s * s - s2 * s2); // height\n\n\n this.moveTo(x, y - (h - ir));\n this.lineTo(x + s2, y + ir);\n this.lineTo(x - s2, y + ir);\n this.lineTo(x, y - (h - ir));\n this.closePath();\n\n\n };\n\n /**\n * Draw a triangle shape in downward orientation\n * @param {Number} x horizontal center\n * @param {Number} y vertical center\n * @param {Number} r radius\n */\n CanvasRenderingContext2D.prototype.triangleDown = function (x, y, r) {\n // http://en.wikipedia.org/wiki/Equilateral_triangle\n this.beginPath();\n\n // the change in radius and the offset is here to center the shape\n r *= 1.15;\n y -= 0.275 * r;\n\n var s = r * 2;\n var s2 = s / 2;\n var ir = Math.sqrt(3) / 6 * s; // radius of inner circle\n var h = Math.sqrt(s * s - s2 * s2); // height\n\n this.moveTo(x, y + (h - ir));\n this.lineTo(x + s2, y - ir);\n this.lineTo(x - s2, y - ir);\n this.lineTo(x, y + (h - ir));\n this.closePath();\n };\n\n /**\n * Draw a star shape, a star with 5 points\n * @param {Number} x horizontal center\n * @param {Number} y vertical center\n * @param {Number} r radius, half the length of the sides of the triangle\n */\n CanvasRenderingContext2D.prototype.star = function (x, y, r) {\n // http://www.html5canvastutorials.com/labs/html5-canvas-star-spinner/\n this.beginPath();\n\n // the change in radius and the offset is here to center the shape\n r *= 0.82;\n y += 0.1 * r;\n\n for (var n = 0; n < 10; n++) {\n var radius = (n % 2 === 0) ? r * 1.3 : r * 0.5;\n this.lineTo(\n x + radius * Math.sin(n * 2 * Math.PI / 10),\n y - radius * Math.cos(n * 2 * Math.PI / 10)\n );\n }\n\n this.closePath();\n };\n\n /**\n * Draw a Diamond shape\n * @param {Number} x horizontal center\n * @param {Number} y vertical center\n * @param {Number} r radius, half the length of the sides of the triangle\n */\n CanvasRenderingContext2D.prototype.diamond = function (x, y, r) {\n // http://www.html5canvastutorials.com/labs/html5-canvas-star-spinner/\n this.beginPath();\n\n this.lineTo(x, y + r);\n this.lineTo(x + r, y);\n this.lineTo(x, y - r);\n this.lineTo(x - r, y);\n\n\n this.closePath();\n };\n\n /**\n * http://stackoverflow.com/questions/1255512/how-to-draw-a-rounded-rectangle-on-html-canvas\n */\n CanvasRenderingContext2D.prototype.roundRect = function (x, y, w, h, r) {\n var r2d = Math.PI / 180;\n if (w - ( 2 * r ) < 0) {\n r = ( w / 2 );\n } //ensure that the radius isn't too large for x\n if (h - ( 2 * r ) < 0) {\n r = ( h / 2 );\n } //ensure that the radius isn't too large for y\n this.beginPath();\n this.moveTo(x + r, y);\n this.lineTo(x + w - r, y);\n this.arc(x + w - r, y + r, r, r2d * 270, r2d * 360, false);\n this.lineTo(x + w, y + h - r);\n this.arc(x + w - r, y + h - r, r, 0, r2d * 90, false);\n this.lineTo(x + r, y + h);\n this.arc(x + r, y + h - r, r, r2d * 90, r2d * 180, false);\n this.lineTo(x, y + r);\n this.arc(x + r, y + r, r, r2d * 180, r2d * 270, false);\n this.closePath();\n };\n\n /**\n * http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas\n */\n CanvasRenderingContext2D.prototype.ellipse = function (x, y, w, h) {\n var kappa = .5522848,\n ox = (w / 2) * kappa, // control point offset horizontal\n oy = (h / 2) * kappa, // control point offset vertical\n xe = x + w, // x-end\n ye = y + h, // y-end\n xm = x + w / 2, // x-middle\n ym = y + h / 2; // y-middle\n\n this.beginPath();\n this.moveTo(x, ym);\n this.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);\n this.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);\n this.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);\n this.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);\n this.closePath();\n };\n\n\n /**\n * http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas\n */\n CanvasRenderingContext2D.prototype.database = function (x, y, w, h) {\n var f = 1 / 3;\n var wEllipse = w;\n var hEllipse = h * f;\n\n var kappa = .5522848,\n ox = (wEllipse / 2) * kappa, // control point offset horizontal\n oy = (hEllipse / 2) * kappa, // control point offset vertical\n xe = x + wEllipse, // x-end\n ye = y + hEllipse, // y-end\n xm = x + wEllipse / 2, // x-middle\n ym = y + hEllipse / 2, // y-middle\n ymb = y + (h - hEllipse / 2), // y-midlle, bottom ellipse\n yeb = y + h; // y-end, bottom ellipse\n\n this.beginPath();\n this.moveTo(xe, ym);\n\n this.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);\n this.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);\n\n this.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);\n this.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);\n\n this.lineTo(xe, ymb);\n\n this.bezierCurveTo(xe, ymb + oy, xm + ox, yeb, xm, yeb);\n this.bezierCurveTo(xm - ox, yeb, x, ymb + oy, x, ymb);\n\n this.lineTo(x, ym);\n };\n\n\n /**\n * Draw an arrow at the end of a line with the given angle.\n */\n CanvasRenderingContext2D.prototype.arrowEndpoint = function (x, y, angle, length) {\n // tail\n var xt = x - length * Math.cos(angle);\n var yt = y - length * Math.sin(angle);\n\n // inner tail\n var xi = x - length * 0.9 * Math.cos(angle);\n var yi = y - length * 0.9 * Math.sin(angle);\n\n // left\n var xl = xt + length / 3 * Math.cos(angle + 0.5 * Math.PI);\n var yl = yt + length / 3 * Math.sin(angle + 0.5 * Math.PI);\n\n // right\n var xr = xt + length / 3 * Math.cos(angle - 0.5 * Math.PI);\n var yr = yt + length / 3 * Math.sin(angle - 0.5 * Math.PI);\n\n this.beginPath();\n this.moveTo(x, y);\n this.lineTo(xl, yl);\n this.lineTo(xi, yi);\n this.lineTo(xr, yr);\n this.closePath();\n };\n\n /**\n * Draw an circle an the end of an line with the given angle.\n */\n CanvasRenderingContext2D.prototype.circleEndpoint = function (x, y, angle, length) {\n var radius = length * 0.4;\n var xc = x - radius * Math.cos(angle);\n var yc = y - radius * Math.sin(angle);\n this.circle(xc, yc, radius);\n };\n\n /**\n * Sets up the dashedLine functionality for drawing\n * Original code came from http://stackoverflow.com/questions/4576724/dotted-stroke-in-canvas\n * @author David Jordan\n * @date 2012-08-08\n */\n CanvasRenderingContext2D.prototype.dashedLine = function (x, y, x2, y2, pattern) {\n this.beginPath();\n this.moveTo(x, y);\n\n var patternLength = pattern.length;\n var dx = (x2 - x);\n var dy = (y2 - y);\n var slope = dy / dx;\n var distRemaining = Math.sqrt(dx * dx + dy * dy);\n var patternIndex = 0;\n var draw = true;\n var xStep = 0;\n var dashLength = pattern[0];\n\n while (distRemaining >= 0.1) {\n dashLength = pattern[patternIndex++ % patternLength];\n if (dashLength > distRemaining) {\n dashLength = distRemaining;\n }\n\n xStep = Math.sqrt(dashLength * dashLength / (1 + slope * slope));\n xStep = dx < 0 ? -xStep : xStep;\n x += xStep;\n y += slope * xStep;\n\n if (draw === true) {this.lineTo(x,y);}\n else {this.moveTo(x,y);}\n\n distRemaining -= dashLength;\n draw = !draw;\n }\n };\n\n\n}\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/shapes.js","/**\n * Parse a text source containing data in DOT language into a JSON object.\n * The object contains two lists: one with nodes and one with edges.\n *\n * DOT language reference: http://www.graphviz.org/doc/info/lang.html\n *\n * DOT language attributes: http://graphviz.org/content/attrs\n *\n * @param {String} data Text containing a graph in DOT-notation\n * @return {Object} graph An object containing two parameters:\n * {Object[]} nodes\n * {Object[]} edges\n */\nfunction parseDOT (data) {\n dot = data;\n return parseGraph();\n}\n\n// mapping of attributes from DOT (the keys) to vis.js (the values)\nvar NODE_ATTR_MAPPING = {\n 'fontsize': 'font.size',\n 'fontcolor': 'font.color',\n 'labelfontcolor': 'font.color',\n 'fontname': 'font.face',\n 'color': ['color.border', 'color.background'],\n 'fillcolor': 'color.background',\n 'tooltip': 'title',\n 'labeltooltip': 'title'\n};\nvar EDGE_ATTR_MAPPING = Object.create(NODE_ATTR_MAPPING);\nEDGE_ATTR_MAPPING.color = 'color.color';\n\n// token types enumeration\nvar TOKENTYPE = {\n NULL : 0,\n DELIMITER : 1,\n IDENTIFIER: 2,\n UNKNOWN : 3\n};\n\n// map with all delimiters\nvar DELIMITERS = {\n '{': true,\n '}': true,\n '[': true,\n ']': true,\n ';': true,\n '=': true,\n ',': true,\n\n '->': true,\n '--': true\n};\n\nvar dot = ''; // current dot file\nvar index = 0; // current index in dot file\nvar c = ''; // current token character in expr\nvar token = ''; // current token\nvar tokenType = TOKENTYPE.NULL; // type of the token\n\n/**\n * Get the first character from the dot file.\n * The character is stored into the char c. If the end of the dot file is\n * reached, the function puts an empty string in c.\n */\nfunction first() {\n index = 0;\n c = dot.charAt(0);\n}\n\n/**\n * Get the next character from the dot file.\n * The character is stored into the char c. If the end of the dot file is\n * reached, the function puts an empty string in c.\n */\nfunction next() {\n index++;\n c = dot.charAt(index);\n}\n\n/**\n * Preview the next character from the dot file.\n * @return {String} cNext\n */\nfunction nextPreview() {\n return dot.charAt(index + 1);\n}\n\n/**\n * Test whether given character is alphabetic or numeric\n * @param {String} c\n * @return {Boolean} isAlphaNumeric\n */\nvar regexAlphaNumeric = /[a-zA-Z_0-9.:#]/;\nfunction isAlphaNumeric(c) {\n return regexAlphaNumeric.test(c);\n}\n\n/**\n * Merge all options of object b into object b\n * @param {Object} a\n * @param {Object} b\n * @return {Object} a\n */\nfunction merge (a, b) {\n if (!a) {\n a = {};\n }\n\n if (b) {\n for (var name in b) {\n if (b.hasOwnProperty(name)) {\n a[name] = b[name];\n }\n }\n }\n return a;\n}\n\n/**\n * Set a value in an object, where the provided parameter name can be a\n * path with nested parameters. For example:\n *\n * var obj = {a: 2};\n * setValue(obj, 'b.c', 3); // obj = {a: 2, b: {c: 3}}\n *\n * @param {Object} obj\n * @param {String} path A parameter name or dot-separated parameter path,\n * like \"color.highlight.border\".\n * @param {*} value\n */\nfunction setValue(obj, path, value) {\n var keys = path.split('.');\n var o = obj;\n while (keys.length) {\n var key = keys.shift();\n if (keys.length) {\n // this isn't the end point\n if (!o[key]) {\n o[key] = {};\n }\n o = o[key];\n }\n else {\n // this is the end point\n o[key] = value;\n }\n }\n}\n\n/**\n * Add a node to a graph object. If there is already a node with\n * the same id, their attributes will be merged.\n * @param {Object} graph\n * @param {Object} node\n */\nfunction addNode(graph, node) {\n var i, len;\n var current = null;\n\n // find root graph (in case of subgraph)\n var graphs = [graph]; // list with all graphs from current graph to root graph\n var root = graph;\n while (root.parent) {\n graphs.push(root.parent);\n root = root.parent;\n }\n\n // find existing node (at root level) by its id\n if (root.nodes) {\n for (i = 0, len = root.nodes.length; i < len; i++) {\n if (node.id === root.nodes[i].id) {\n current = root.nodes[i];\n break;\n }\n }\n }\n\n if (!current) {\n // this is a new node\n current = {\n id: node.id\n };\n if (graph.node) {\n // clone default attributes\n current.attr = merge(current.attr, graph.node);\n }\n }\n\n // add node to this (sub)graph and all its parent graphs\n for (i = graphs.length - 1; i >= 0; i--) {\n var g = graphs[i];\n\n if (!g.nodes) {\n g.nodes = [];\n }\n if (g.nodes.indexOf(current) === -1) {\n g.nodes.push(current);\n }\n }\n\n // merge attributes\n if (node.attr) {\n current.attr = merge(current.attr, node.attr);\n }\n}\n\n/**\n * Add an edge to a graph object\n * @param {Object} graph\n * @param {Object} edge\n */\nfunction addEdge(graph, edge) {\n if (!graph.edges) {\n graph.edges = [];\n }\n graph.edges.push(edge);\n if (graph.edge) {\n var attr = merge({}, graph.edge); // clone default attributes\n edge.attr = merge(attr, edge.attr); // merge attributes\n }\n}\n\n/**\n * Create an edge to a graph object\n * @param {Object} graph\n * @param {String | Number | Object} from\n * @param {String | Number | Object} to\n * @param {String} type\n * @param {Object | null} attr\n * @return {Object} edge\n */\nfunction createEdge(graph, from, to, type, attr) {\n var edge = {\n from: from,\n to: to,\n type: type\n };\n\n if (graph.edge) {\n edge.attr = merge({}, graph.edge); // clone default attributes\n }\n edge.attr = merge(edge.attr || {}, attr); // merge attributes\n\n return edge;\n}\n\n/**\n * Get next token in the current dot file.\n * The token and token type are available as token and tokenType\n */\nfunction getToken() {\n tokenType = TOKENTYPE.NULL;\n token = '';\n\n // skip over whitespaces\n while (c === ' ' || c === '\\t' || c === '\\n' || c === '\\r') { // space, tab, enter\n next();\n }\n\n do {\n var isComment = false;\n\n // skip comment\n if (c === '#') {\n // find the previous non-space character\n var i = index - 1;\n while (dot.charAt(i) === ' ' || dot.charAt(i) === '\\t') {\n i--;\n }\n if (dot.charAt(i) === '\\n' || dot.charAt(i) === '') {\n // the # is at the start of a line, this is indeed a line comment\n while (c != '' && c != '\\n') {\n next();\n }\n isComment = true;\n }\n }\n if (c === '/' && nextPreview() === '/') {\n // skip line comment\n while (c != '' && c != '\\n') {\n next();\n }\n isComment = true;\n }\n if (c === '/' && nextPreview() === '*') {\n // skip block comment\n while (c != '') {\n if (c === '*' && nextPreview() === '/') {\n // end of block comment found. skip these last two characters\n next();\n next();\n break;\n }\n else {\n next();\n }\n }\n isComment = true;\n }\n\n // skip over whitespaces\n while (c === ' ' || c === '\\t' || c === '\\n' || c === '\\r') { // space, tab, enter\n next();\n }\n }\n while (isComment);\n\n // check for end of dot file\n if (c === '') {\n // token is still empty\n tokenType = TOKENTYPE.DELIMITER;\n return;\n }\n\n // check for delimiters consisting of 2 characters\n var c2 = c + nextPreview();\n if (DELIMITERS[c2]) {\n tokenType = TOKENTYPE.DELIMITER;\n token = c2;\n next();\n next();\n return;\n }\n\n // check for delimiters consisting of 1 character\n if (DELIMITERS[c]) {\n tokenType = TOKENTYPE.DELIMITER;\n token = c;\n next();\n return;\n }\n\n // check for an identifier (number or string)\n // TODO: more precise parsing of numbers/strings (and the port separator ':')\n if (isAlphaNumeric(c) || c === '-') {\n token += c;\n next();\n\n while (isAlphaNumeric(c)) {\n token += c;\n next();\n }\n if (token === 'false') {\n token = false; // convert to boolean\n }\n else if (token === 'true') {\n token = true; // convert to boolean\n }\n else if (!isNaN(Number(token))) {\n token = Number(token); // convert to number\n }\n tokenType = TOKENTYPE.IDENTIFIER;\n return;\n }\n\n // check for a string enclosed by double quotes\n if (c === '\"') {\n next();\n while (c != '' && (c != '\"' || (c === '\"' && nextPreview() === '\"'))) {\n token += c;\n if (c === '\"') { // skip the escape character\n next();\n }\n next();\n }\n if (c != '\"') {\n throw newSyntaxError('End of string \" expected');\n }\n next();\n tokenType = TOKENTYPE.IDENTIFIER;\n return;\n }\n\n // something unknown is found, wrong characters, a syntax error\n tokenType = TOKENTYPE.UNKNOWN;\n while (c != '') {\n token += c;\n next();\n }\n throw new SyntaxError('Syntax error in part \"' + chop(token, 30) + '\"');\n}\n\n/**\n * Parse a graph.\n * @returns {Object} graph\n */\nfunction parseGraph() {\n var graph = {};\n\n first();\n getToken();\n\n // optional strict keyword\n if (token === 'strict') {\n graph.strict = true;\n getToken();\n }\n\n // graph or digraph keyword\n if (token === 'graph' || token === 'digraph') {\n graph.type = token;\n getToken();\n }\n\n // optional graph id\n if (tokenType === TOKENTYPE.IDENTIFIER) {\n graph.id = token;\n getToken();\n }\n\n // open angle bracket\n if (token != '{') {\n throw newSyntaxError('Angle bracket { expected');\n }\n getToken();\n\n // statements\n parseStatements(graph);\n\n // close angle bracket\n if (token != '}') {\n throw newSyntaxError('Angle bracket } expected');\n }\n getToken();\n\n // end of file\n if (token !== '') {\n throw newSyntaxError('End of file expected');\n }\n getToken();\n\n // remove temporary default options\n delete graph.node;\n delete graph.edge;\n delete graph.graph;\n\n return graph;\n}\n\n/**\n * Parse a list with statements.\n * @param {Object} graph\n */\nfunction parseStatements (graph) {\n while (token !== '' && token != '}') {\n parseStatement(graph);\n if (token === ';') {\n getToken();\n }\n }\n}\n\n/**\n * Parse a single statement. Can be a an attribute statement, node\n * statement, a series of node statements and edge statements, or a\n * parameter.\n * @param {Object} graph\n */\nfunction parseStatement(graph) {\n // parse subgraph\n var subgraph = parseSubgraph(graph);\n if (subgraph) {\n // edge statements\n parseEdge(graph, subgraph);\n\n return;\n }\n\n // parse an attribute statement\n var attr = parseAttributeStatement(graph);\n if (attr) {\n return;\n }\n\n // parse node\n if (tokenType != TOKENTYPE.IDENTIFIER) {\n throw newSyntaxError('Identifier expected');\n }\n var id = token; // id can be a string or a number\n getToken();\n\n if (token === '=') {\n // id statement\n getToken();\n if (tokenType != TOKENTYPE.IDENTIFIER) {\n throw newSyntaxError('Identifier expected');\n }\n graph[id] = token;\n getToken();\n // TODO: implement comma separated list with \"a_list: ID=ID [','] [a_list] \"\n }\n else {\n parseNodeStatement(graph, id);\n }\n}\n\n/**\n * Parse a subgraph\n * @param {Object} graph parent graph object\n * @return {Object | null} subgraph\n */\nfunction parseSubgraph (graph) {\n var subgraph = null;\n\n // optional subgraph keyword\n if (token === 'subgraph') {\n subgraph = {};\n subgraph.type = 'subgraph';\n getToken();\n\n // optional graph id\n if (tokenType === TOKENTYPE.IDENTIFIER) {\n subgraph.id = token;\n getToken();\n }\n }\n\n // open angle bracket\n if (token === '{') {\n getToken();\n\n if (!subgraph) {\n subgraph = {};\n }\n subgraph.parent = graph;\n subgraph.node = graph.node;\n subgraph.edge = graph.edge;\n subgraph.graph = graph.graph;\n\n // statements\n parseStatements(subgraph);\n\n // close angle bracket\n if (token != '}') {\n throw newSyntaxError('Angle bracket } expected');\n }\n getToken();\n\n // remove temporary default options\n delete subgraph.node;\n delete subgraph.edge;\n delete subgraph.graph;\n delete subgraph.parent;\n\n // register at the parent graph\n if (!graph.subgraphs) {\n graph.subgraphs = [];\n }\n graph.subgraphs.push(subgraph);\n }\n\n return subgraph;\n}\n\n/**\n * parse an attribute statement like \"node [shape=circle fontSize=16]\".\n * Available keywords are 'node', 'edge', 'graph'.\n * The previous list with default attributes will be replaced\n * @param {Object} graph\n * @returns {String | null} keyword Returns the name of the parsed attribute\n * (node, edge, graph), or null if nothing\n * is parsed.\n */\nfunction parseAttributeStatement (graph) {\n // attribute statements\n if (token === 'node') {\n getToken();\n\n // node attributes\n graph.node = parseAttributeList();\n return 'node';\n }\n else if (token === 'edge') {\n getToken();\n\n // edge attributes\n graph.edge = parseAttributeList();\n return 'edge';\n }\n else if (token === 'graph') {\n getToken();\n\n // graph attributes\n graph.graph = parseAttributeList();\n return 'graph';\n }\n\n return null;\n}\n\n/**\n * parse a node statement\n * @param {Object} graph\n * @param {String | Number} id\n */\nfunction parseNodeStatement(graph, id) {\n // node statement\n var node = {\n id: id\n };\n var attr = parseAttributeList();\n if (attr) {\n node.attr = attr;\n }\n addNode(graph, node);\n\n // edge statements\n parseEdge(graph, id);\n}\n\n/**\n * Parse an edge or a series of edges\n * @param {Object} graph\n * @param {String | Number} from Id of the from node\n */\nfunction parseEdge(graph, from) {\n while (token === '->' || token === '--') {\n var to;\n var type = token;\n getToken();\n\n var subgraph = parseSubgraph(graph);\n if (subgraph) {\n to = subgraph;\n }\n else {\n if (tokenType != TOKENTYPE.IDENTIFIER) {\n throw newSyntaxError('Identifier or subgraph expected');\n }\n to = token;\n addNode(graph, {\n id: to\n });\n getToken();\n }\n\n // parse edge attributes\n var attr = parseAttributeList();\n\n // create edge\n var edge = createEdge(graph, from, to, type, attr);\n addEdge(graph, edge);\n\n from = to;\n }\n}\n\n/**\n * Parse a set with attributes,\n * for example [label=\"1.000\", shape=solid]\n * @return {Object | null} attr\n */\nfunction parseAttributeList() {\n var attr = null;\n\n while (token === '[') {\n getToken();\n attr = {};\n while (token !== '' && token != ']') {\n if (tokenType != TOKENTYPE.IDENTIFIER) {\n throw newSyntaxError('Attribute name expected');\n }\n var name = token;\n\n getToken();\n if (token != '=') {\n throw newSyntaxError('Equal sign = expected');\n }\n getToken();\n\n if (tokenType != TOKENTYPE.IDENTIFIER) {\n throw newSyntaxError('Attribute value expected');\n }\n var value = token;\n setValue(attr, name, value); // name can be a path\n\n getToken();\n if (token ==',') {\n getToken();\n }\n }\n\n if (token != ']') {\n throw newSyntaxError('Bracket ] expected');\n }\n getToken();\n }\n\n return attr;\n}\n\n/**\n * Create a syntax error with extra information on current token and index.\n * @param {String} message\n * @returns {SyntaxError} err\n */\nfunction newSyntaxError(message) {\n return new SyntaxError(message + ', got \"' + chop(token, 30) + '\" (char ' + index + ')');\n}\n\n/**\n * Chop off text after a maximum length\n * @param {String} text\n * @param {Number} maxLength\n * @returns {String}\n */\nfunction chop (text, maxLength) {\n return (text.length <= maxLength) ? text : (text.substr(0, 27) + '...');\n}\n\n/**\n * Execute a function fn for each pair of elements in two arrays\n * @param {Array | *} array1\n * @param {Array | *} array2\n * @param {function} fn\n */\nfunction forEach2(array1, array2, fn) {\n if (Array.isArray(array1)) {\n array1.forEach(function (elem1) {\n if (Array.isArray(array2)) {\n array2.forEach(function (elem2) {\n fn(elem1, elem2);\n });\n }\n else {\n fn(elem1, array2);\n }\n });\n }\n else {\n if (Array.isArray(array2)) {\n array2.forEach(function (elem2) {\n fn(array1, elem2);\n });\n }\n else {\n fn(array1, array2);\n }\n }\n}\n\n/**\n * Set a nested property on an object\n * When nested objects are missing, they will be created.\n * For example setProp({}, 'font.color', 'red') will return {font: {color: 'red'}}\n * @param {Object} object\n * @param {string} path A dot separated string like 'font.color'\n * @param {*} value Value for the property\n * @return {Object} Returns the original object, allows for chaining.\n */\nfunction setProp(object, path, value) {\n var names = path.split('.');\n var prop = names.pop();\n\n // traverse over the nested objects\n var obj = object;\n for (var i = 0; i < names.length; i++) {\n var name = names[i];\n if (!(name in obj)) {\n obj[name] = {};\n }\n obj = obj[name];\n }\n\n // set the property value\n obj[prop] = value;\n\n return object;\n}\n\n/**\n * Convert an object with DOT attributes to their vis.js equivalents.\n * @param {Object} attr Object with DOT attributes\n * @param {Object} mapping\n * @return {Object} Returns an object with vis.js attributes\n */\nfunction convertAttr (attr, mapping) {\n var converted = {};\n\n for (var prop in attr) {\n if (attr.hasOwnProperty(prop)) {\n var visProp = mapping[prop];\n if (Array.isArray(visProp)) {\n visProp.forEach(function (visPropI) {\n setProp(converted, visPropI, attr[prop]);\n })\n }\n else if (typeof visProp === 'string') {\n setProp(converted, visProp, attr[prop]);\n }\n else {\n setProp(converted, prop, attr[prop]);\n }\n }\n }\n\n return converted;\n}\n\n/**\n * Convert a string containing a graph in DOT language into a map containing\n * with nodes and edges in the format of graph.\n * @param {String} data Text containing a graph in DOT-notation\n * @return {Object} graphData\n */\nfunction DOTToGraph (data) {\n // parse the DOT file\n var dotData = parseDOT(data);\n var graphData = {\n nodes: [],\n edges: [],\n options: {}\n };\n\n // copy the nodes\n if (dotData.nodes) {\n dotData.nodes.forEach(function (dotNode) {\n var graphNode = {\n id: dotNode.id,\n label: String(dotNode.label || dotNode.id)\n };\n merge(graphNode, convertAttr(dotNode.attr, NODE_ATTR_MAPPING));\n if (graphNode.image) {\n graphNode.shape = 'image';\n }\n graphData.nodes.push(graphNode);\n });\n }\n\n // copy the edges\n if (dotData.edges) {\n /**\n * Convert an edge in DOT format to an edge with VisGraph format\n * @param {Object} dotEdge\n * @returns {Object} graphEdge\n */\n var convertEdge = function (dotEdge) {\n var graphEdge = {\n from: dotEdge.from,\n to: dotEdge.to\n };\n merge(graphEdge, convertAttr(dotEdge.attr, EDGE_ATTR_MAPPING));\n graphEdge.arrows = (dotEdge.type === '->') ? 'to' : undefined;\n\n return graphEdge;\n };\n\n dotData.edges.forEach(function (dotEdge) {\n var from, to;\n if (dotEdge.from instanceof Object) {\n from = dotEdge.from.nodes;\n }\n else {\n from = {\n id: dotEdge.from\n }\n }\n\n // TODO: support of solid/dotted/dashed edges (attr = 'style')\n // TODO: support for attributes 'dir' and 'arrowhead' (edge arrows)\n\n if (dotEdge.to instanceof Object) {\n to = dotEdge.to.nodes;\n }\n else {\n to = {\n id: dotEdge.to\n }\n }\n\n if (dotEdge.from instanceof Object && dotEdge.from.edges) {\n dotEdge.from.edges.forEach(function (subEdge) {\n var graphEdge = convertEdge(subEdge);\n graphData.edges.push(graphEdge);\n });\n }\n\n forEach2(from, to, function (from, to) {\n var subEdge = createEdge(graphData, from.id, to.id, dotEdge.type, dotEdge.attr);\n var graphEdge = convertEdge(subEdge);\n graphData.edges.push(graphEdge);\n });\n\n if (dotEdge.to instanceof Object && dotEdge.to.edges) {\n dotEdge.to.edges.forEach(function (subEdge) {\n var graphEdge = convertEdge(subEdge);\n graphData.edges.push(graphEdge);\n });\n }\n });\n }\n\n // copy the options\n if (dotData.attr) {\n graphData.options = dotData.attr;\n }\n\n return graphData;\n}\n\n// exports\nexports.parseDOT = parseDOT;\nexports.DOTToGraph = DOTToGraph;\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/dotparser.js","\nfunction parseGephi(gephiJSON, optionsObj) {\n var edges = [];\n var nodes = [];\n var options = {\n edges: {\n inheritColor: false\n },\n nodes: {\n fixed: false,\n parseColor: false\n }\n };\n\n if (optionsObj !== undefined) {\n if (optionsObj.fixed !== undefined) {options.nodes.fixed = optionsObj.fixed}\n if (optionsObj.parseColor !== undefined) {options.nodes.parseColor = optionsObj.parseColor}\n if (optionsObj.inheritColor !== undefined) {options.edges.inheritColor = optionsObj.inheritColor}\n }\n\n var gEdges = gephiJSON.edges;\n var gNodes = gephiJSON.nodes;\n for (var i = 0; i < gEdges.length; i++) {\n var edge = {};\n var gEdge = gEdges[i];\n edge['id'] = gEdge.id;\n edge['from'] = gEdge.source;\n edge['to'] = gEdge.target;\n edge['attributes'] = gEdge.attributes;\n edge['label'] = gEdge.label;\n edge['title'] = gEdge.attributes !== undefined ? gEdge.attributes.title : undefined;\n if (gEdge['type'] === 'Directed') {\n edge['arrows'] = 'to';\n }\n// edge['value'] = gEdge.attributes !== undefined ? gEdge.attributes.Weight : undefined;\n// edge['width'] = edge['value'] !== undefined ? undefined : edgegEdge.size;\n if (gEdge.color && options.inheritColor === false) {\n edge['color'] = gEdge.color;\n }\n edges.push(edge);\n }\n\n for (var i = 0; i < gNodes.length; i++) {\n var node = {};\n var gNode = gNodes[i];\n node['id'] = gNode.id;\n node['attributes'] = gNode.attributes;\n node['title'] = gNode.title;\n node['x'] = gNode.x;\n node['y'] = gNode.y;\n node['label'] = gNode.label;\n node['title'] = gNode.attributes !== undefined ? gNode.attributes.title : undefined;\n if (options.nodes.parseColor === true) {\n node['color'] = gNode.color;\n }\n else {\n node['color'] = gNode.color !== undefined ? {background:gNode.color, border:gNode.color, highlight: {background:gNode.color, border:gNode.color}, hover:{background:gNode.color, border:gNode.color}} : undefined;\n }\n node['size'] = gNode.size;\n node['fixed'] = options.nodes.fixed && gNode.x !== undefined && gNode.y !== undefined;\n nodes.push(node);\n }\n\n return {nodes:nodes, edges:edges};\n}\n\nexports.parseGephi = parseGephi;\n\n\n// WEBPACK FOOTER //\n// ./lib/network/gephiParser.js","// English\nexports['en'] = {\n edit: 'Edit',\n del: 'Delete selected',\n back: 'Back',\n addNode: 'Add Node',\n addEdge: 'Add Edge',\n editNode: 'Edit Node',\n editEdge: 'Edit Edge',\n addDescription: 'Click in an empty space to place a new node.',\n edgeDescription: 'Click on a node and drag the edge to another node to connect them.',\n editEdgeDescription: 'Click on the control points and drag them to a node to connect to it.',\n createEdgeError: 'Cannot link edges to a cluster.',\n deleteClusterError: 'Clusters cannot be deleted.',\n editClusterError: 'Clusters cannot be edited.'\n};\nexports['en_EN'] = exports['en'];\nexports['en_US'] = exports['en'];\n\n// German\nexports['de'] = {\n edit: 'Editieren',\n del: 'L\\u00f6sche Auswahl',\n back: 'Zur\\u00fcck',\n addNode: 'Knoten hinzuf\\u00fcgen',\n addEdge: 'Kante hinzuf\\u00fcgen',\n editNode: 'Knoten editieren',\n editEdge: 'Kante editieren',\n addDescription: 'Klicke auf eine freie Stelle, um einen neuen Knoten zu plazieren.',\n edgeDescription: 'Klicke auf einen Knoten und ziehe die Kante zu einem anderen Knoten, um diese zu verbinden.',\n editEdgeDescription: 'Klicke auf die Verbindungspunkte und ziehe diese auf einen Knoten, um sie zu verbinden.',\n createEdgeError: 'Es ist nicht m\\u00f6glich, Kanten mit Clustern zu verbinden.',\n deleteClusterError: 'Cluster k\\u00f6nnen nicht gel\\u00f6scht werden.',\n editClusterError: 'Cluster k\\u00f6nnen nicht editiert werden.'\n};\nexports['de_DE'] = exports['de'];\n\n// Spanish\nexports['es'] = {\n edit: 'Editar',\n del: 'Eliminar selecci\\u00f3n',\n back: '\\u00c1tras',\n addNode: 'A\\u00f1adir nodo',\n addEdge: 'A\\u00f1adir arista',\n editNode: 'Editar nodo',\n editEdge: 'Editar arista',\n addDescription: 'Haga clic en un lugar vac\\u00edo para colocar un nuevo nodo.',\n edgeDescription: 'Haga clic en un nodo y arrastre la arista hacia otro nodo para conectarlos.',\n editEdgeDescription: 'Haga clic en un punto de control y arrastrelo a un nodo para conectarlo.',\n createEdgeError: 'No se puede conectar una arista a un grupo.',\n deleteClusterError: 'No es posible eliminar grupos.',\n editClusterError: 'No es posible editar grupos.'\n};\nexports['es_ES'] = exports['es'];\n\n//Italiano\nexports['it'] = {\n edit: 'Modifica',\n del: 'Cancella la selezione',\n back: 'Indietro',\n addNode: 'Aggiungi un nodo',\n addEdge: 'Aggiungi un vertice',\n editNode: 'Modifica il nodo',\n editEdge: 'Modifica il vertice',\n addDescription: 'Clicca per aggiungere un nuovo nodo',\n edgeDescription: 'Clicca su un nodo e trascinalo ad un altro nodo per connetterli.',\n editEdgeDescription: 'Clicca sui Punti di controllo e trascinali ad un nodo per connetterli.',\n createEdgeError: 'Non si possono collegare vertici ad un cluster',\n deleteClusterError: 'I cluster non possono essere cancellati',\n editClusterError: 'I clusters non possono essere modificati.'\n};\nexports['it_IT'] = exports['it'];\n\n// Dutch\nexports['nl'] = {\n edit: 'Wijzigen',\n del: 'Selectie verwijderen',\n back: 'Terug',\n addNode: 'Node toevoegen',\n addEdge: 'Link toevoegen',\n editNode: 'Node wijzigen',\n editEdge: 'Link wijzigen',\n addDescription: 'Klik op een leeg gebied om een nieuwe node te maken.',\n edgeDescription: 'Klik op een node en sleep de link naar een andere node om ze te verbinden.',\n editEdgeDescription: 'Klik op de verbindingspunten en sleep ze naar een node om daarmee te verbinden.',\n createEdgeError: 'Kan geen link maken naar een cluster.',\n deleteClusterError: 'Clusters kunnen niet worden verwijderd.',\n editClusterError: 'Clusters kunnen niet worden aangepast.'\n};\nexports['nl_NL'] = exports['nl'];\nexports['nl_BE'] = exports['nl'];\n\n// Portuguese Brazil\nexports['pt-br'] = {\n edit: 'Editar',\n del: 'Remover selecionado',\n back: 'Voltar',\n addNode: 'Adicionar nó',\n addEdge: 'Adicionar aresta',\n editNode: 'Editar nó',\n editEdge: 'Editar aresta',\n addDescription: 'Clique em um espaço em branco para adicionar um novo nó',\n edgeDescription: 'Clique em um nó e arraste a aresta até outro nó para conectá-los',\n editEdgeDescription: 'Clique nos pontos de controle e os arraste para um nó para conectá-los',\n createEdgeError: 'Não foi possível linkar arestas a um cluster.',\n deleteClusterError: 'Clusters não puderam ser removidos.',\n editClusterError: 'Clusters não puderam ser editados.'\n};\nexports['pt-BR'] = exports['pt-br'];\nexports['pt_BR'] = exports['pt-br'];\nexports['pt_br'] = exports['pt-br'];\n\n// Russian\nexports['ru'] = {\n edit: 'Редактировать',\n del: 'Удалить выбранное',\n back: 'Назад',\n addNode: 'Добавить узел',\n addEdge: 'Добавить ребро',\n editNode: 'Редактировать узел',\n editEdge: 'Редактировать ребро',\n addDescription: 'Кликните в свободное место, чтобы добавить новый узел.',\n edgeDescription: 'Кликните на узел и протяните ребро к другому узлу, чтобы соединить их.',\n editEdgeDescription: 'Кликните на контрольные точки и перетащите их в узел, чтобы подключиться к нему.',\n createEdgeError: 'Невозможно соединить ребра в кластер.',\n deleteClusterError: 'Кластеры не могут быть удалены',\n editClusterError: 'Кластеры недоступны для редактирования.'\n};\nexports['ru_RU'] = exports['ru'];\n\n\n\n// WEBPACK FOOTER //\n// ./lib/network/locales.js"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/vis.map b/dist/vis.map new file mode 100644 index 00000000..a597eeea --- /dev/null +++ b/dist/vis.map @@ -0,0 +1 @@ +{"version":3,"sources":["vis.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","util","extend","_interopRequireDefault","obj","__esModule","default","_getIterator2","_getIterator3","_create","_create2","_keys","_keys2","_typeof2","_typeof3","_stringify","_stringify2","moment","uuid","isNumber","object","Number","elementsCensor","replacer","key","value","Element","JSON","parse","recursiveDOMDelete","DOMobject","hasChildNodes","firstChild","removeChild","giveRange","min","max","total","scale","Math","isString","String","isDate","Date","match","ASPDateRegex","exec","isNaN","randomUUID","v4","assignAllKeys","prop","hasOwnProperty","fillIfDefined","a","b","allowDeletion","arguments","length","undefined","protoExtend","i","other","selectiveExtend","props","Array","isArray","Error","selectiveDeepExtend","TypeError","constructor","Object","deepExtend","selectiveNotDeepExtend","indexOf","push","equalArray","len","convert","type","Boolean","valueOf","isMoment","toDate","getType","toISOString","format","copyAndExtendArray","arr","newValue","newArr","copyArray","getAbsoluteLeft","elem","getBoundingClientRect","left","getAbsoluteRight","right","getAbsoluteTop","top","addClassName","className","classes","split","join","removeClassName","index","splice","forEach","callback","toArray","array","updateProperty","throttle","fn","scheduled","requestAnimationFrame","addEventListener","element","action","listener","useCapture","navigator","userAgent","attachEvent","removeEventListener","detachEvent","preventDefault","event","window","returnValue","getTarget","target","srcElement","nodeType","parentNode","hasParent","parent","e","option","asBoolean","defaultValue","asNumber","asString","asSize","asElement","hexToRGB","hex","shorthandRegex","replace","r","g","result","parseInt","overrideOpacity","color","opacity","rgb","substr","RGBToHex","red","green","blue","toString","slice","parseColor","isValidRGB","map","isValidHex","hsv","hexToHSV","lighterColorHSV","h","s","v","darkerColorHSV","darkerColorHex","HSVToHex","lighterColorHex","background","border","highlight","hover","RGBToHSV","minRGB","maxRGB","d","hue","saturation","cssUtil","cssText","styles","style","trim","parts","addCssText","currentStyles","newStyles","removeCssText","removeStyles","HSVToRGB","floor","f","q","t","isOk","test","isValidRGBA","rgba","selectiveBridgeObject","fields","referenceObject","objectTo","bridgeObject","insertSort","compare","k","j","mergeOptions","mergeTarget","options","globalOptions","enabled","binarySearchCustom","orderedItems","comparator","field","field2","maxIterations","iteration","low","high","middle","item","searchResult","binarySearchValue","sidePreference","prevValue","nextValue","easingFunctions","linear","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","getScrollBarWidth","inner","document","createElement","width","height","outer","position","visibility","overflow","appendChild","body","w1","offsetWidth","w2","clientWidth","topMost","pile","accessors","candidate","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_step","_iterator","next","done","member","err","global","hide","Iterators","TO_STRING_TAG","collections","NAME","Collection","proto","prototype","addToUnscopables","step","toIObject","iterated","kind","_t","_i","_k","O","Arguments","IObject","defined","it","cof","propertyIsEnumerable","LIBRARY","$export","redefine","has","$iterCreate","setToStringTag","getPrototypeOf","ITERATOR","BUGGY","keys","FF_ITERATOR","KEYS","VALUES","returnThis","Base","Constructor","DEFAULT","IS_SET","FORCED","methods","IteratorPrototype","getMethod","TAG","DEF_VALUES","VALUES_BUG","$native","$default","$entries","$anyNative","entries","name","values","P","F","core","ctx","PROTOTYPE","source","own","out","IS_FORCED","IS_GLOBAL","G","IS_STATIC","S","IS_PROTO","IS_BIND","B","IS_WRAP","W","expProto","C","apply","Function","virtual","R","U","self","__g","version","__e","aFunction","that","dP","createDesc","anObject","IE8_DOM_DEFINE","toPrimitive","defineProperty","Attributes","isObject","get","is","val","bitmap","enumerable","configurable","writable","create","descriptor","dPs","enumBugKeys","IE_PROTO","Empty","createDict","iframeDocument","iframe","lt","gt","display","src","contentWindow","open","write","close","Properties","getKeys","defineProperties","$keys","arrayIndexOf","names","toLength","toIndex","IS_INCLUDES","$this","el","fromIndex","toInteger","ceil","shared","uid","SHARED","store","px","random","concat","documentElement","def","tag","stat","Symbol","USE_SYMBOL","$exports","toObject","ObjectProto","$at","point","TO_STRING","pos","l","charCodeAt","charAt","getIterator","iterFn","classof","getIteratorMethod","ARG","tryGet","T","callee","$Object","D","fails","KEY","exp","_iterator2","_symbol","_symbol2","_typeof","DESCRIPTORS","META","$fails","wks","wksExt","wksDefine","keyOf","enumKeys","gOPNExt","$GOPD","$DP","gOPD","gOPN","$Symbol","$JSON","stringify","HIDDEN","TO_PRIMITIVE","isEnum","SymbolRegistry","AllSymbols","OPSymbols","USE_NATIVE","QObject","setter","findChild","setSymbolDesc","protoDesc","wrap","sym","isSymbol","iterator","$defineProperty","$defineProperties","$create","$propertyIsEnumerable","E","$getOwnPropertyDescriptor","$getOwnPropertyNames","$getOwnPropertySymbols","IS_OP","$set","set","symbols","for","keyFor","useSetter","useSimple","getOwnPropertyDescriptor","getOwnPropertyNames","getOwnPropertySymbols","$replacer","args","setDesc","isExtensible","FREEZE","preventExtensions","setMeta","w","fastKey","getWeak","onFreeze","meta","NEED","gOPS","pIE","getSymbols","arg","windowNames","getWindowNames","hiddenKeys","hooks","hookCallback","setHookCallback","input","isObjectEmpty","res","hasOwnProp","createUTC","locale","strict","createLocalOrUTC","utc","defaultParsingFlags","empty","unusedTokens","unusedInput","charsLeftOver","nullInput","invalidMonth","invalidFormat","userInvalidated","iso","parsedDateParts","meridiem","getParsingFlags","_pf","isValid","_isValid","flags","parsedParts","some$1","isNowValid","_d","getTime","invalidWeekday","_strict","bigHour","isFrozen","createInvalid","NaN","isUndefined","copyConfig","to","from","_isAMomentObject","_f","_l","_tzm","_isUTC","_offset","_locale","momentProperties","Moment","config","updateInProgress","updateOffset","absFloor","number","toInt","argumentForCoercion","coercedNumber","isFinite","compareArrays","array1","array2","dontConvert","lengthDiff","abs","diffs","warn","msg","suppressDeprecationWarnings","console","deprecate","firstTime","deprecationHandler","stack","deprecateSimple","deprecations","isFunction","_config","_ordinalParseLenient","RegExp","_ordinalParse","mergeConfigs","parentConfig","childConfig","Locale","calendar","mom","now","output","_calendar","longDateFormat","_longDateFormat","formatUpper","toUpperCase","invalidDate","_invalidDate","ordinal","_ordinal","relativeTime","withoutSuffix","string","isFuture","_relativeTime","pastFuture","diff","addUnitAlias","unit","shorthand","lowerCase","toLowerCase","aliases","normalizeUnits","units","normalizeObjectUnits","inputObject","normalizedProp","normalizedInput","addUnitPriority","priority","priorities","getPrioritizedUnits","unitsObj","u","sort","makeGetSet","keepTime","set$1","stringGet","stringSet","prioritized","zeroFill","targetLength","forceSign","absNumber","zerosToFill","sign","pow","addFormatToken","token","padded","func","formatTokenFunctions","localeData","removeFormattingTokens","makeFormatFunction","formattingTokens","formatMoment","expandFormat","formatFunctions","replaceLongDateFormatTokens","localFormattingTokens","lastIndex","addRegexToken","regex","strictRegex","regexes","isStrict","getParseRegexForToken","unescapeFormat","regexEscape","matched","p1","p2","p3","p4","addParseToken","tokens","addWeekParseToken","_w","addTimeToArrayFromToken","_a","daysInMonth","year","month","UTC","getUTCDate","localeMonths","_months","isFormat","MONTHS_IN_FORMAT","localeMonthsShort","_monthsShort","handleStrictParse","monthName","ii","llc","toLocaleLowerCase","_monthsParse","_longMonthsParse","_shortMonthsParse","monthsShort","months","indexOf$1","localeMonthsParse","_monthsParseExact","setMonth","dayOfMonth","monthsParse","date","getSetMonth","getDaysInMonth","monthsShortRegex","computeMonthsParse","_monthsShortStrictRegex","_monthsShortRegex","defaultMonthsShortRegex","monthsRegex","_monthsStrictRegex","_monthsRegex","defaultMonthsRegex","cmpLenRev","shortPieces","longPieces","mixedPieces","daysInYear","isLeapYear","getIsLeapYear","createDate","y","M","ms","getFullYear","setFullYear","createUTCDate","getUTCFullYear","setUTCFullYear","firstWeekOffset","dow","doy","fwd","fwdlw","getUTCDay","dayOfYearFromWeeks","week","weekday","resYear","resDayOfYear","localWeekday","weekOffset","dayOfYear","weekOfYear","resWeek","weeksInYear","weekOffsetNext","localeWeek","_week","localeFirstDayOfWeek","localeFirstDayOfYear","getSetWeek","add","getSetISOWeek","parseWeekday","weekdaysParse","parseIsoWeekday","localeWeekdays","_weekdays","day","localeWeekdaysShort","_weekdaysShort","localeWeekdaysMin","_weekdaysMin","handleStrictParse$1","weekdayName","_weekdaysParse","_shortWeekdaysParse","_minWeekdaysParse","weekdaysMin","weekdaysShort","weekdays","localeWeekdaysParse","_weekdaysParseExact","_fullWeekdaysParse","getSetDayOfWeek","getDay","getSetLocaleDayOfWeek","getSetISODayOfWeek","weekdaysRegex","computeWeekdaysParse","_weekdaysStrictRegex","_weekdaysRegex","defaultWeekdaysRegex","weekdaysShortRegex","_weekdaysShortStrictRegex","_weekdaysShortRegex","defaultWeekdaysShortRegex","weekdaysMinRegex","_weekdaysMinStrictRegex","_weekdaysMinRegex","defaultWeekdaysMinRegex","minp","shortp","longp","minPieces","hFormat","hours","kFormat","lowercase","minutes","matchMeridiem","_meridiemParse","localeIsPM","localeMeridiem","isLower","normalizeLocale","chooseLocale","loadLocale","oldLocale","locales","globalLocale","_abbr","code","getSetGlobalLocale","data","getLocale","defineLocale","baseConfig","abbr","parentLocale","localeFamilies","x","updateLocale","listLocales","keys$1","checkOverflow","MONTH","DATE","YEAR","HOUR","MINUTE","SECOND","MILLISECOND","_overflowDayOfYear","_overflowWeeks","WEEK","_overflowWeekday","WEEKDAY","configFromISO","allowTime","dateFormat","timeFormat","tzFormat","extendedIsoRegex","basicIsoRegex","isoDates","isoTimes","tzRegex","configFromStringAndFormat","configFromString","aspNetJsonRegex","createFromInputFallback","defaults","currentDateArray","nowValue","_useUTC","getUTCMonth","getMonth","getDate","configFromArray","currentDate","yearToUse","dayOfYearFromWeekInfo","_dayOfYear","_nextDay","setUTCMinutes","getUTCMinutes","weekYear","temp","weekdayOverflow","GG","createLocal","curWeek","gg","ISO_8601","parsedInput","skipped","stringLength","totalParsedInputLength","_meridiem","meridiemFixWrap","hour","isPm","meridiemHour","isPM","configFromStringAndArray","tempConfig","bestMoment","scoreToBeat","currentScore","score","configFromObject","minute","second","millisecond","createFromConfig","prepareConfig","preparse","configFromInput","isUTC","pickBy","moments","Duration","duration","years","quarters","quarter","weeks","days","seconds","milliseconds","_milliseconds","_days","_data","_bubble","isDuration","absRound","round","offset","separator","utcOffset","offsetFromString","matcher","matches","chunk","chunkOffset","cloneWithOffset","model","clone","setTime","local","getDateOffset","getTimezoneOffset","getSetOffset","keepLocalTime","localAdjust","matchShortOffset","_changeInProgress","addSubtract","createDuration","getSetZone","setOffsetToUTC","setOffsetToLocal","subtract","setOffsetToParsedOffset","tZone","matchOffset","hasAlignedHourOffset","isDaylightSavingTime","isDaylightSavingTimeShifted","_isDSTShifted","isLocal","isUtcOffset","isUtc","ret","diffRes","aspNetRegex","isoRegex","parseIso","momentsDifference","inp","parseFloat","positiveMomentsDifference","base","isAfter","isBefore","createAdder","direction","period","dur","tmp","isAdding","getCalendarFormat","myMoment","calendar$1","time","formats","sod","startOf","calendarFormat","localInput","endOf","isBetween","inclusivity","isSame","inputMs","isSameOrAfter","isSameOrBefore","asFloat","zoneDelta","delta","monthDiff","anchor2","adjust","wholeMonthDiff","anchor","inspect","zone","prefix","datetime","suffix","inputString","defaultFormatUtc","defaultFormat","postformat","humanize","fromNow","toNow","newLocaleData","isoWeekday","unix","toJSON","isValid$1","parsingFlags","invalidAt","creationData","addWeekYearFormatToken","getter","getSetWeekYear","getSetWeekYearHelper","getSetISOWeekYear","isoWeek","getISOWeeksInYear","getWeeksInYear","weekInfo","weeksTarget","setWeekAll","dayOfYearData","getSetQuarter","getSetDayOfYear","parseMs","getZoneAbbr","getZoneName","createUnix","createInZone","parseZone","preParsePostFormat","get$1","listMonthsImpl","listWeekdaysImpl","localeSorted","shift","listMonths","listMonthsShort","listWeekdays","listWeekdaysShort","listWeekdaysMin","mathAbs","addSubtract$1","add$1","subtract$1","absCeil","bubble","monthsFromDays","monthsToDays","daysToMonths","as","valueOf$1","makeAs","alias","get$2","makeGetter","substituteTimeAgo","relativeTime$1","posNegDuration","thresholds","getSetRelativeTimeRounding","roundingFunction","getSetRelativeTimeThreshold","threshold","limit","withSuffix","toISOString$1","abs$1","Y","asSeconds","some","fun","defaultCalendar","sameDay","nextDay","nextWeek","lastDay","lastWeek","sameElse","defaultLongDateFormat","LTS","LT","L","LL","LLL","LLLL","defaultInvalidDate","defaultOrdinal","defaultOrdinalParse","defaultRelativeTime","future","past","mm","hh","dd","MM","yy","match1","match2","match3","match4","match6","match1to2","match3to4","match5to6","match1to3","match1to4","match1to6","matchUnsigned","matchSigned","matchTimestamp","matchWord","o","defaultLocaleMonths","defaultLocaleMonthsShort","parseTwoDigitYear","getSetYear","defaultLocaleWeek","defaultLocaleWeekdays","defaultLocaleWeekdaysShort","defaultLocaleWeekdaysMin","_isPm","pos1","pos2","defaultLocaleMeridiemParse","getSetHour","ordinalParse","meridiemParse","prototypeMin","prototypeMax","lang","isoWeekYear","getSetDayOfMonth","getSetMinute","getSetSecond","getSetMillisecond","isoWeeks","isoWeeksInYear","isDST","zoneAbbr","zoneName","dates","isDSTShifted","proto$1","firstDayOfYear","firstDayOfWeek","langData","asMilliseconds","asMinutes","asHours","asDays","asWeeks","asMonths","asYears","proto$2","toIsoString","invalid","relativeTimeRounding","relativeTimeThreshold","webpackPolyfill","paths","children","webpackContext","req","resolve","buf","oct","_hexToByte","unparse","bth","_byteToHex","v1","clockseq","_clockseq","msecs","nsecs","_lastNSecs","dt","_lastMSecs","tl","tmh","node","_nodeId","n","rnds","rng","_rng","globalVar","crypto","getRandomValues","_rnds8","Uint8Array","_rnds","_seedBytes","DOMutil","DataSet","DataView","Queue","Graph3d","graph3d","Camera","Filter","Point2d","Point3d","Slider","StepNumber","Hammer","keycharm","prepareElements","JSONcontainer","elementType","redundant","used","cleanupElements","resetElements","getSVGElement","svgContainer","createElementNS","getDOMElement","DOMContainer","insertBefore","drawPoint","groupTemplate","labelObj","setAttributeNS","size","label","xOffset","yOffset","content","textContent","drawBar","rect","_options","_fieldId","fieldId","_type","_subscribers","setOptions","queue","_queue","destroy","on","subscribers","subscribe","off","filter","unsubscribe","_trigger","params","senderId","subscriber","addedIds","me","_addItem","items","update","updatedIds","oldData","updatedData","addOrUpdate","oldItem","_updateItem","ids","firstType","returnType","allowedValues","itemIds","itemId","_getItem","order","_sort","_filterFields","resultant","getIds","getDataSet","mappedItems","filteredItem","itemFields","av","bv","remove","removedIds","removedItems","_remove","ident","clear","maxField","itemField","minField","distinct","fieldType","count","exists","types","raw","converted","delay","Infinity","_timeout","_extended","_flushIfNeeded","flush","original","method","context","entry","clearTimeout","setTimeout","_ids","_onEvent","setData","refresh","oldIds","newIds","viewOptions","getArguments","defaultFilter","dataSet","oldItems","updatedItems","container","SyntaxError","containerElement","dataTable","dataPoints","Settings","setDefaults","DEFAULTS","colX","colY","colZ","colValue","colFilter","getMouseX","clientX","targetTouches","getMouseY","clientY","Emitter","Range","STYLE","autoByDefault","filterLabel","legendLabel","xLabel","yLabel","zLabel","xValueLabel","yValueLabel","zValueLabel","showGrid","showPerspective","showShadow","keepAspectRatio","verticalRatio","dotSizeRatio","showAnimationControls","animationInterval","animationPreload","animationAutoStart","axisColor","gridColor","xCenter","yCenter","DOT","tooltip","showLegend","backgroundColor","dataColor","fill","stroke","strokeWidth","cameraPosition","horizontal","vertical","distance","xBarWidth","yBarWidth","valueMin","valueMax","xMin","xMax","xStep","yMin","yMax","yStep","zMin","zMax","zStep","_setScale","xRange","range","yRange","zRange","z","valueRange","center","zCenter","camera","setArmLocation","_convert3Dto2D","point3d","translation","_convertPointToTranslation","_convertTranslationToScreen","cameraLocation","getCameraLocation","cameraRotation","getCameraRotation","ax","ay","az","cx","cy","cz","sinTx","sin","cosTx","cos","sinTy","cosTy","sinTz","cosTz","dx","dy","dz","bx","by","ex","eye","ey","ez","getArmLength","currentXCenter","frame","canvas","currentYCenter","_calcTranslations","points","trans","screen","transBottom","bottom","dist","sortDepth","getNumberOfRows","getNumberOfColumns","counter","column","getDistinctValues","distinctValues","getColumnRange","_checkValueField","hasValueField","BARCOLOR","BARSIZE","DOTCOLOR","DOTSIZE","_setRangeDefaults","defaultMin","defaultMax","_dataInitialize","rawData","_onChange","withBars","BAR","defaultXBarWidth","dataX","defaultYBarWidth","dataY","NUMSTEPS","expand","defaultXMin","defaultXMax","defaultXStep","defaultYMin","defaultYMax","defaultYStep","defaultZMin","defaultZMax","defaultZStep","defaultValueMin","defaultValueMax","dataFilter","setOnLoadCallback","redraw","_getDataPoints","GRID","SURFACE","sortNumber","dataMatrix","xIndex","yIndex","pointRight","pointTop","pointCross","LINE","pointNext","noCanvas","fontWeight","padding","innerHTML","onmousedown","_onMouseDown","ontouchstart","_onTouchStart","onmousewheel","_onWheel","ontooltip","_onTooltip","onclick","_onClick","onkeydown","_setSize","_resizeCanvas","clientHeight","animationStart","slider","play","animationStop","stop","_resizeCenter","getCameraPosition","getArmRotation","_readData","_redrawFilter","setPointDrawingMethod","_redrawBarGraphPoint","_redrawBarColorGraphPoint","_redrawBarSizeGraphPoint","_redrawDotGraphPoint","DOTLINE","_redrawDotLineGraphPoint","_redrawDotColorGraphPoint","_redrawDotSizeGraphPoint","_redrawSurfaceGraphPoint","_redrawGridGraphPoint","_redrawLineGraphPoint","_pointDrawingMethod","_redrawSlider","_redrawClear","_redrawAxis","_redrawDataGraph","_redrawInfo","_redrawLegend","_getContext","getContext","lineJoin","lineCap","clearRect","_dotSize","_getLegendWidth","dotSize","isSizeLegend","isValueLegend","margin","lineWidth","font","ymin","ymax","_hsv2rgb","strokeStyle","beginPath","moveTo","lineTo","strokeRect","widthMin","fillStyle","closePath","gridLineLen","legendMin","legendMax","start","end","getCurrent","_line","textAlign","textBaseline","fillText","visible","setValues","setPlayInterval","onchange","getIndex","selectValue","setOnChangeCallback","lineStyle","getLabel","getSelectedValue","drawAxisLabelX","text","armAngle","yMargin","point2d","drawAxisLabelY","drawAxisLabelZ","_line3d","from2d","to2d","prettyStep","xText","yText","zText","gridLenX","gridLenY","textMargin","armVector","from3d","xMin2d","xMax2d","H","V","Hi","X","_getStrokeWidth","_redrawBar","xWidth","yWidth","borderColor","surface","surfaces","corners","avg","transCenter","_polygon","_drawCircle","radius","_calcRadius","arc","PI","_getColorsRegular","_getColorsColor","_getColorsSize","colors","fraction","cross","topSideVisible","showGrayBottom","aDiff","bDiff","crossproduct","crossProduct","zAvg","_drawGridLine","_storeMousePosition","startMouseX","startMouseY","_startCameraOffset","getOffset","leftButtonDown","_onMouseUp","which","button","touchDown","startStart","startEnd","startArmRotation","cursor","onmousemove","_onMouseMove","onmouseup","moving","diffX","diffY","ctrlKey","scaleX","scaleY","offXNew","armLength","offYNew","setOffset","horizontalNew","verticalNew","snapAngle","snapValue","setArmRotation","parameters","emit","onclick_callback","boundingRect","mouseX","mouseY","dataPoint","_dataPointFromXY","showTooltip","tooltipTimeout","_hideTooltip","_showTooltip","ontouchmove","_onTouchMove","ontouchend","_onTouchEnd","wheelDelta","detail","oldLength","newLength","setArmLength","_insideTriangle","triangle","bs","cs","distMax","closestDataPoint","closestDist","triangle1","triangle2","distX","distY","sqrt","line","dot","dom","borderRadius","boxShadow","borderLeft","contentWidth","contentHeight","offsetHeight","lineHeight","dotWidth","dotHeight","setCameraPosition","setSize","mixin","_callbacks","once","removeListener","removeAllListeners","callbacks","cb","listeners","hasListeners","sub","sum","armLocation","armRotation","cameraOffset","offsetMultiplier","calculateCameraOrientation","_sign","_sign2","mul","rot","xa","za","graph","onLoadCallback","loadInBackground","isLoaded","getLoadedProgress","getColumn","getValues","getValue","dataView","progress","prev","bar","MozBorderRadius","slide","togglePlay","onChangeCallback","playTimeout","playInterval","playLoop","setIndex","playNext","interval","clearInterval","getPlayInterval","setPlayLoop","doLoop","onChange","indexToLeft","startClientX","startSlideX","leftToIndex","_start","_end","precision","_current","setRange","isNumeric","setStep","calculatePrettyStep","log10","log","LN10","step1","step2","step5","toPrecision","getStep","checkFirst","combine","newMin","newMax","isEmpty","capitalize","str","prefixFieldName","fieldName","forceCopy","dst","srcKey","dstKey","safeCopy","OPTIONKEYS","PREFIXEDOPTIONKEYS","setSpecialSettings","setBackgroundColor","setDataColor","setStyle","setShowLegend","isAutoByDefault","isLegendGraphStyle","getStyleNumberByName","styleName","STYLENAME","checkStyleNumber","valid","styleNumber","borderWidth","borderStyle","camPos","dot-line","dot-color","dot-size","grid","bar-color","bar-size","propagating","__WEBPACK_AMD_DEFINE_FACTORY__","__WEBPACK_AMD_DEFINE_ARRAY__","__WEBPACK_AMD_DEFINE_RESULT__","_firstTarget","hammer","events","propagatedHandler","srcEvent","_handled","stopped","stopPropagation","srcStop","bind","firstTarget","elemHammer","_handlers","Manager","PropagatingHammer","assign","wrapper","pointerType","isFirst","handler","eventType","hammers","idx","exportName","setTimeoutContext","timeout","bindFn","invokeArrayArg","each","message","deprecationMessage","inherit","child","properties","childP","baseP","_super","boolOrFn","TYPE_FUNCTION","ifUndefined","val1","val2","addEventListeners","splitStr","removeEventListeners","inStr","find","inArray","findByKey","uniqueArray","results","prefixed","property","camelProp","VENDOR_PREFIXES","uniqueId","_uniqueId","getWindowForElement","doc","ownerDocument","defaultView","parentWindow","Input","manager","inputTarget","domHandler","ev","enable","init","createInputInstance","Type","inputClass","SUPPORT_POINTER_EVENTS","PointerEventInput","SUPPORT_ONLY_TOUCH","TouchInput","SUPPORT_TOUCH","TouchMouseInput","MouseInput","inputHandler","pointersLen","pointers","changedPointersLen","changedPointers","INPUT_START","isFinal","INPUT_END","INPUT_CANCEL","session","computeInputData","recognize","prevInput","pointersLength","firstInput","simpleCloneInputData","firstMultiple","offsetCenter","getCenter","timeStamp","deltaTime","angle","getAngle","getDistance","computeDeltaXY","offsetDirection","getDirection","deltaX","deltaY","overallVelocity","getVelocity","overallVelocityX","overallVelocityY","getScale","rotation","getRotation","maxPointers","computeIntervalInputData","offsetDelta","prevDelta","velocity","velocityX","velocityY","last","lastInterval","COMPUTE_INTERVAL","DIRECTION_NONE","DIRECTION_LEFT","DIRECTION_RIGHT","DIRECTION_UP","DIRECTION_DOWN","PROPS_XY","atan2","PROPS_CLIENT_XY","evEl","MOUSE_ELEMENT_EVENTS","evWin","MOUSE_WINDOW_EVENTS","pressed","POINTER_ELEMENT_EVENTS","POINTER_WINDOW_EVENTS","pointerEvents","SingleTouchInput","evTarget","SINGLE_TOUCH_TARGET_EVENTS","SINGLE_TOUCH_WINDOW_EVENTS","started","normalizeSingleTouches","all","touches","changed","changedTouches","TOUCH_TARGET_EVENTS","targetIds","getTouches","allTouches","INPUT_MOVE","identifier","changedTargetTouches","touch","mouse","primaryTouch","lastTouches","recordTouches","eventData","setLastTouch","lastTouch","lts","removeLastTouch","DEDUP_TIMEOUT","isSyntheticEvent","DEDUP_DISTANCE","TouchAction","cleanTouchActions","actions","TOUCH_ACTION_NONE","hasPanX","TOUCH_ACTION_PAN_X","hasPanY","TOUCH_ACTION_PAN_Y","TOUCH_ACTION_MANIPULATION","TOUCH_ACTION_AUTO","getTouchActionProps","NATIVE_TOUCH_ACTION","touchMap","cssSupports","CSS","supports","Recognizer","state","STATE_POSSIBLE","simultaneous","requireFail","stateStr","STATE_CANCELLED","STATE_ENDED","STATE_CHANGED","STATE_BEGAN","directionStr","getRecognizerByNameIfManager","otherRecognizer","recognizer","AttrRecognizer","PanRecognizer","pX","pY","PinchRecognizer","PressRecognizer","_timer","_input","RotateRecognizer","SwipeRecognizer","TapRecognizer","pTime","pCenter","recognizers","preset","handlers","oldCssProps","touchAction","toggleCssProps","recognizeWith","requireFailure","cssProps","triggerDomEvent","gestureEvent","createEvent","initEvent","gesture","dispatchEvent","TEST_ELEMENT","nextKey","dest","merge","MOBILE_REGEX","INPUT_TYPE_TOUCH","INPUT_TYPE_PEN","INPUT_TYPE_MOUSE","INPUT_TYPE_KINECT","DIRECTION_HORIZONTAL","DIRECTION_VERTICAL","DIRECTION_ALL","MOUSE_INPUT_MAP","mousedown","mousemove","mouseup","POINTER_INPUT_MAP","pointerdown","pointermove","pointerup","pointercancel","pointerout","IE10_POINTER_TYPE_ENUM","2","3","4","5","MSPointerEvent","PointerEvent","removePointer","eventTypeNormalized","isTouch","storeIndex","pointerId","SINGLE_TOUCH_INPUT_MAP","touchstart","touchmove","touchend","touchcancel","TOUCH_INPUT_MAP","inputEvent","inputData","isMouse","sourceCapabilities","firesTouchEvents","PREFIXED_TOUCH_ACTION","TOUCH_ACTION_COMPUTE","TOUCH_ACTION_MAP","compute","getTouchAction","preventDefaults","prevented","hasNone","isTapPointer","isTapMovement","isTapTouchTime","preventSrc","STATE_RECOGNIZED","STATE_FAILED","dropRecognizeWith","dropRequireFailure","hasRequireFailures","canRecognizeWith","additionalEvent","tryEmit","canEmit","inputDataClone","process","reset","attrTest","optionPointers","isRecognized","directionTest","hasMoved","inOut","validPointers","validMovement","validTime","taps","posThreshold","validTouchTime","failTimeout","validInterval","validMultiTap","tapCount","VERSION","domEvents","userSelect","touchSelect","touchCallout","contentZooming","userDrag","tapHighlightColor","STOP","FORCED_STOP","force","curRecognizer","existing","Tap","Pan","Swipe","Pinch","Rotate","Press","freeGlobal","_exportFunctions","_bound","keydown","keyup","fromCharCode","down","handleEvent","up","keyCode","bound","shiftKey","bindAll","getKey","unbind","newBindings","Timeline","Graph2d","timeline","Core","DateUtil","TimeStep","components","Item","BackgroundItem","BoxItem","PointItem","RangeItem","BackgroundGroup","Component","CurrentTime","CustomTime","DataAxis","DataScale","GraphGroup","Group","ItemSet","Legend","LineGraph","TimeAxis","groups","forthArgument","throttleRedraw","defaultOptions","autoResize","orientation","axis","maxHeight","minHeight","rtl","directionFromDom","domNode","getComputedStyle","parentElement","rollingMode","domProps","emitter","hiddenDates","timeAxis","toScreen","_toScreen","toGlobalScreen","_toGlobalScreen","toTime","_toTime","toGlobalTime","_toGlobalTime","timeAxis2","currentTime","itemSet","itemsData","groupsData","getEventProperties","ondblclick","oncontextmenu","onmouseover","fitDone","getItemRange","setWindow","animation","fit","setGroups","setItems","_redraw","_Configurator","_Configurator2","_Validator","_Validator2","printStyle","allOptions","configureOptions","_createConfigurator","markDirty","refreshItems","errorFound","validate","selection","getSelection","setSelection","newDataSet","group","focus","itemData","dataset","getDataRange","_this","minItem","maxItem","factor","lhs","rhs","getStart","getEnd","groupShowing","show","repositionX","startSide","getWidthRight","endSide","getWidthLeft","centerContainer","itemFromTarget","groupFromTarget","customTime","customTimeFromTarget","snap","snappedTime","what","foreground","labelSet","groupId","pageX","pageY","_classCallCheck2","_classCallCheck3","_createClass2","_createClass3","_ColorPicker","_ColorPicker2","Configurator","parentModule","defaultContainer","pixelRatio","changedOptions","allowCreation","initialized","popupCounter","showButton","moduleOptions","domElements","popupDiv","popupLimit","popupHistory","colorPicker","_removePopup","_clean","_handleObject","_makeItem","_makeHeader","generateButton","_printOptions","onmouseout","optionsContainer","_push","_showPopupIfNeeded","path","_arguments","_this2","_len","_key","_ret2","div","objectLabel","select","selectedValue","selected","_update","_makeLabel","popupString","popupValue","oninput","itemIndex","_setupPopup","_this3","html","hideTimeout","deleteTimeout","_this4","correspondingElement","checkbox","checked","_this5","defaultColor","_showColorPicker","_this6","insertTo","setColor","setUpdateCallback","colorString","setCloseCallback","checkOnly","visibleInSet","subObj","newPath","_getValue","_handleArray","_makeTextInput","_makeCheckbox","draw","physics","solver","enabledPath","enabledValue","_label","error","_makeColorField","_makeDropdown","_makeRange","_constructOptions","optionsObj","pointer","getOptions","instance","_defineProperty","_defineProperty2","protoProps","staticProps","desc","hammerUtil","ColorPicker","generated","centerCoordinates","hueCircle","initialColor","previousColor","applied","updateCallback","closeCallback","_bindHammer","htmlColors","black","navy","darkblue","mediumblue","darkgreen","teal","darkcyan","deepskyblue","darkturquoise","mediumspringgreen","lime","springgreen","aqua","cyan","midnightblue","dodgerblue","lightseagreen","forestgreen","seagreen","darkslategray","limegreen","mediumseagreen","turquoise","royalblue","steelblue","darkslateblue","mediumturquoise","indigo","darkolivegreen","cadetblue","cornflowerblue","mediumaquamarine","dimgray","slateblue","olivedrab","slategray","lightslategray","mediumslateblue","lawngreen","chartreuse","aquamarine","maroon","purple","olive","gray","skyblue","lightskyblue","blueviolet","darkred","darkmagenta","saddlebrown","darkseagreen","lightgreen","mediumpurple","darkviolet","palegreen","darkorchid","yellowgreen","sienna","brown","darkgray","lightblue","greenyellow","paleturquoise","lightsteelblue","powderblue","firebrick","darkgoldenrod","mediumorchid","rosybrown","darkkhaki","silver","mediumvioletred","indianred","peru","chocolate","tan","lightgrey","palevioletred","thistle","orchid","goldenrod","crimson","gainsboro","plum","burlywood","lightcyan","lavender","darksalmon","violet","palegoldenrod","lightcoral","khaki","aliceblue","honeydew","azure","sandybrown","wheat","beige","whitesmoke","mintcream","ghostwhite","salmon","antiquewhite","linen","lightgoldenrodyellow","oldlace","fuchsia","magenta","deeppink","orangered","tomato","hotpink","coral","darkorange","lightsalmon","orange","lightpink","pink","gold","peachpuff","navajowhite","moccasin","bisque","mistyrose","blanchedalmond","papayawhip","lavenderblush","seashell","cornsilk","lemonchiffon","floralwhite","snow","yellow","lightyellow","ivory","white","setInitial","htmlColor","_isColorString","rgbaArray","_rgbaArray","rgbObj","alpha","_setColor","_generateHueCircle","storePrevious","_hide","_updatePicker","alert","angleConvert","colorPickerSelector","colorPickerCanvas","pixelRation","devicePixelRatio","webkitBackingStorePixelRatio","mozBackingStorePixelRatio","msBackingStorePixelRatio","oBackingStorePixelRatio","backingStorePixelRatio","setTransform","putImageData","circle","brightnessRange","opacityRange","initialColorDiv","newColorDiv","colorPickerDiv","opacityDiv","brightnessDiv","arrowDiv","_setOpacity","_setBrightness","brightnessLabel","opacityLabel","cancelButton","applyButton","_apply","saveButton","_save","loadButton","_loadLast","drag","pinch","onTouch","_moveSelector","sat","hfac","sfac","fillRect","getImageData","centerY","centerX","newTop","newLeft","onRelease","offTouch","offRelease","disablePreventDefaultVertically","pinchRecognizer","Validator","referenceOptions","subObject","usedOptions","check","__any__","getSuggestion","__type__","checkFields","referenceOption","refOptionObj","optionType","refOptionType","print","printLocation","localSearch","findInOptions","globalSearch","localSearchThreshold","globalSearchThreshold","indexMatch","closestMatch","recursive","closestMatchPath","lowerCaseOption","op","levenshteinDistance","_j","_j2","matrix","rolling","deltaDifference","scaleOffset","startToFront","endToFront","moveable","zoomable","zoomMin","zoomMax","animationTimer","_onDragStart","_onDrag","_onDragEnd","_onMouseWheel","_onTouch","_onPinch","rollingModeBtn","startRolling","validateDirection","stopRolling","conversion","currentTimeTimer","byUser","finalStart","finalEnd","_cancelAnimation","initStart","initEnd","easingName","easingFunction","initTime","anyChanged","dragging","ease","_applyRange","updateHiddenDates","newStart","newEnd","getRange","totalHidden","previousDelta","_isInsideRange","allowDragging","getHiddenDurationBetween","diffRange","safeStart","snapAwayFromHidden","safeEnd","startDate","endDate","zoomKey","horizontalScroll","pointerDate","getPointer","_pointerToDate","zoom","centerDate","hiddenDuration","hiddenDurationBefore","getHiddenDurationBefore","hiddenDurationAfter","move","_isResized","resized","_previousWidth","_previousHeight","convertHiddenOptions","repeat","dateItem","totalRange","pixelTime","runUntil","dayOffset","removeDuplicates","startHidden","isHidden","endHidden","rangeStart","rangeEnd","hidden","safeDates","printDates","stepOverHiddenDates","timeStep","previousTime","stepInHidden","currentValue","current","switchedYear","switchedMonth","switchedDay","hiddenBeforeStart","getHiddenDurationBeforeStart","rangeAfterEnd","correctTimeForHidden","totalDuration","partialDuration","accumulatedHiddenDuration","getAccumulatedHiddenDuration","newTime","timeOffset","requiredDuration","previousPoint","correctionEnabled","Activator","onMouseWheel","isActive","verticalScroll","scrollTop","adjusted","_setScrollTop","onMouseScrollSide","handleDragOver","itemAddedToTimeline","dataTransfer","dropEffect","handleDrop","getData","_onAddItem","backgroundVertical","backgroundHorizontal","leftContainer","rightContainer","shadowTop","shadowBottom","shadowTopLeft","shadowBottomLeft","shadowTopRight","shadowBottomRight","scrollTopMin","initialDrawDone","_origRedraw","initialItemSetDrawn","customTimes","redrawCount","drawPoints","onRender","clickToUse","activator","_initAutoResize","component","configurator","configure","appliedOptions","setModuleOptions","active","_stopAutoResize","setCustomTime","getCustomTime","setCustomTimeTitle","title","setCustomTitle","addCustomTime","timestamp","removeCustomTime","getVisibleItems","getWindow","zoomIn","percentage","newInterval","zoomOut","borderRootHeight","borderRootWidth","autoHeight","containerHeight","scrollbarWidth","_setDOM","_updateScrollTop","visibilityTop","visibilityBottom","contentsOverflow","MAX_REDRAW","centerWidth","repaint","setCurrentTime","getCurrentTime","_startAutoResize","_onResize","lastWidth","lastHeight","watchTimer","setInterval","initialScrollTop","oldScrollTop","_getScrollTop","newScrollTop","align","stackSubgroups","groupOrderSwap","fromGroup","toGroup","targetOrder","groupOrder","selectable","multiselect","itemsAlwaysDraggable","editable","updateTime","updateGroup","overrideItems","groupEditable","onAdd","onUpdate","onMove","onRemove","onMoving","onAddGroup","onMoveGroup","onRemoveGroup","followMouse","overflowMethod","tooltipOnItemUpdateTime","itemOptions","itemListeners","_onAdd","_onUpdate","_onRemove","groupListeners","_onAddGroups","_onUpdateGroups","_onRemoveGroups","groupIds","stackDirty","touchParams","groupTouchParams","_Popup","_Popup2","UNGROUPED","BACKGROUND","box","_updateUngrouped","backgroundGroup","_onSelectItem","_onMultiSelectItem","groupHammer","_onGroupClick","_onGroupDragStart","_onGroupDrag","_onGroupDragEnd","_onMouseOver","_onMouseOut","addCallback","dirty","displayed","unselect","rawVisibleItems","visibleItems","_deselect","_orderGroups","visibleInterval","zoomed","lastVisibleInterval","restack","firstGroup","_firstGroup","firstMargin","nonFirstMargin","groupMargin","groupResized","firstGroupIndex","firstGroupId","ungrouped","_getGroupId","getLabelSet","oldItemsData","getItems","nestedGroups","nestedGroupId","updatedNestedGroup","nestedInGroup","showNested","_order","getGroups","removeItem","itemObj","popup","_getType","_removeItem","groupData","groupOptions","_orderNestedGroups","newGroupIdsOrder","nestedGroup","nestedGroupIds","oldGroupId","oldSubGroupId","subgroup","oldGroup","_constructByEndArray","endArray","dragLeftItem","dragRightItem","itemProps","_getGroupIndex","itemIsDragging","selectedItem","initialX","dragLeft","_cloneItemData","dragRight","baseGroupIndex","itemsToDrag","groupIndex","groupOffset","metaKey","_onDragStartAddItem","xAbs","newItem","offsetLeft","updateGroupAllowed","newGroupBase","initial","updateTimeAllowed","initialEnd","initialStart","newOffset","_moveToGroup","collapsedDirClassName","originalOrder","movingUp","targetGroupTop","draggedGroupHeight","targetGroupHeight","targetGroup","draggedGroup","newOrder","origOrder","draggedId","numGroups","curPos","orgOffset","slippedPosition","switchGroup","shouldBeGroup","switchGroupId","oldSelection","newSelection","related","itemFromRelatedTarget","getTitle","setPopup","setPosition","offsetTop","_onUpdateItem","newItemData","itemGroup","lastSelectedGroup","multiselectPerGroup","_getItemRange","_item","itemFromElement","cur","relatedTarget","itemSetFromTarget","Popup","doShow","maxWidth","isLeft","isTop","minimumStep","autoScale","FORMAT","minorLabels","majorLabels","setMoment","setFormat","setMinimumStep","roundToMinor","hasNext","setScale","setAutoScale","stepYear","stepMonth","stepDay","stepHour","stepMinute","stepSecond","stepMillisecond","isMajor","getLabelMinor","getLabelMajor","getClassName","even","today","_moment","currentWeek","currentMonth","currentYear","subgroups","subgroupIndex","subgroupOrderer","subgroupOrder","isVisible","itemsInRange","byStart","byEnd","checkRangedItems","marker","templateFunction","paddingRight","paddingLeft","getLabelWidth","markerHeight","lastMarkerHeight","_calculateSubGroupHeights","_isGroupVisible","limitSize","customOrderedItems","_updateItemsInRange","nostack","_updateSubgroupsSizes","_calculateHeight","repositionY","resetSubgroups","setParent","orderSubgroups","_checkIfVisible","sortArray","sortField","removeFromDataSet","startArray","orderByStart","orderByEnd","oldVisibleItems","visibleItemsLookup","lowerBound","upperBound","searchFunction","_checkIfVisibleWithReference","initialPosByStart","_traceVisible","initialPosByEnd","initialPos","breakCondition","EPSILON","aTime","bTime","collidingItem","jj","collision","otherSubgroup","collisionByTimes","baseClassName","visibleFrame","_updateContents","_updateTitle","_updateDataAttributes","_updateStyle","_repaintOnItemUpdateTimeTooltip","_repaintDeleteButton","_repaintDragCenter","_repaintDragLeft","_repaintDragRight","contentStartPosition","parentWidth","boxWidth","groupChanged","dragCenter","dragCenterItem","deleteButton","onItemUpdateTimeTooltip","itemDistanceFromTop","tooltipOffset","isCloseToTop","template","itemVisibleFrameContent","visibleFrameTemplateFunction","frameElement","itemVisibleFrameContentElement","getElementsByClassName","visibleFrameTemplate","_contentToString","setText","dataAttributes","attributes","setAttribute","removeAttribute","outerHTML","msPerPixel","widthInMs","previousRight","previousLeft","itemSetHeight","marginLeft","marginRight","itemSubgroup","lines","majorTexts","minorTexts","lineTop","showMinorLabels","showMajorLabels","maxMinorChars","parentChanged","_calculateCharSize","minorLabelHeight","minorCharHeight","majorLabelHeight","majorCharHeight","minorLineHeight","minorLineWidth","majorLineHeight","majorLineWidth","foregroundNextSibling","nextSibling","backgroundNextSibling","_repaintLabels","timeLabelsize","minorCharWidth","xNext","nextIsMajor","prevWidth","labelMinor","xFirstMajorLabel","MAX","showMinorGrid","_repaintMinorText","_repaintMajorText","_repaintMajorLine","_repaintMinorLine","warnedForOverflow","leftTime","leftText","widthText","majorCharWidth","pop","createTextNode","childNodes","measureCharMinor","measureCharMajor","overlay","_onTapOverlay","onClick","_hasParent","deactivate","escListener","activate","eventParams","warned","substring","showCurrentTime","bool","any","boolean","function","null","groupsDraggable","linegraph","initialLoad","getLegend","isGroupVisible","yAxisLeft","yAxisRight","legendLeft","legendRight","screenToValue","yAxisOrientation","defaultGroup","sampling","graphHeight","shaded","barChart","sideBySide","interpolation","parametrization","dataAxis","legend","abortedGraphUpdate","updateSVGheight","updateSVGheightOnResize","forceGraphUpdate","lastStart","svgElements","groupsUsingDefaultStyles","svg","framework","Bars","Lines","Points","_removeGroup","_updateAllGroupData","removeGroup","_updateGroup","addGroup","groupsContent","idMap","groupCounts","existing_items","extended","orginalY","_updateGraph","rangePerPixelInv","_getSortedGroupIds","grouplist","zIndex","bz","groupRanges","changeCalled","minDate","maxDate","_getRelevantData","_applySampling","_convertXcoordinates","_getYRanges","_updateYAxis","below","excludeFromStacking","_stack","_convertYcoordinates","calcPath","subGroupId","drawShading","subData","subPrevPoint","subNextPoint","dateComparator","first","dataContainer","increment","amountOfPoints","xDistance","pointsPerPixel","sampledData","combinedDataLeft","combinedDataRight","getYRange","getStackedYRange","minVal","maxVal","yAxisLeftUsed","yAxisRightUsed","minLeft","minRight","maxLeft","maxRight","ignore","_toggleAxisVisiblity","drawIcons","master","masterAxis","lineOffset","tempGroups","axisUsed","datapoints","screen_x","screen_y","svgHeight","convertValue","setZeroPosition","linegraphOptions","icons","majorLinesOffset","minorLinesOffset","labelOffsetX","labelOffsetY","iconWidth","alignZeros","linegraphSVG","DOMelements","labels","conversionFactor","minWidth","stepPixels","zeroCrossing","amountOfSteps","iconsRemoved","amountOfGroups","lineContainer","graphOptions","_redrawGroupIcons","iconHeight","iconOffset","groupArray","_cleanupIcons","activeGroups","_redrawLabels","_redrawTitle","customRange","autoScaleEnd","autoScaleStart","followScale","maxLabelSize","getLines","major","_redrawLabel","_redrawLine","titleWidth","titleCharHeight","characterHeight","largestWidth","textMinor","textMajor","textTitle","measureCharTitle","titleCharWidth","zeroAlign","formattingFunction","majorSteps","minorSteps","customLines","minorStepIdx","magnitudefactor","determineScale","rounded","setCharHeight","setHeight","minimumStepValue","orderOfMagnitude","solutionFound","stepSize","is_major","getFirstMajor","majorStep","formatValue","bottomOffset","oldStepIdx","oldStart","oldEnd","increaseMagnitude","decreaseMagnitude","otherZero","otherStep","newRange","myOriginalZero","majorOffset","zeroOffset","pixels","usingDefaultStyle","zeroPosition","drawIcon","icon","Bargraph","fillHeight","outline","barWidth","originalWidth","bar1Height","bar2Height","processedGroupData","coreDistance","drawData","combinedData","intersections","barPoints","_getDataIntersections","heightOffset","_getSafeDrawData","amount","resolved","accumulatedNegative","accumulatedPositive","pointData","groupLabel","_getStackedYRange","xpos","getGroupTemplate","callbackResult","getCallback","Line","_catmullRom","_linear","fillPath","pathArray","subPathArray","dFill","zero","serializePath","inverse","_catmullRomUniform","p0","bp1","bp2","normalization","d1","d2","d3","A","N","d3powA","d2powA","d3pow2A","d2pow2A","d1pow2A","d1powA","side","iconSize","iconSpacing","excludeFromLegend","textArea","scrollableHeight","drawLegendIcons","paddingTop","Network","network","Images","dotparser","gephiParser","convertDot","DOTToGraph","convertGephi","parseGephi","nodes","nodeIndices","edges","edgeIndices","eventListeners","onTap","onDoubleTap","onHold","onDragStart","onDrag","onDragEnd","onPinch","onMouseMove","onContext","functions","createNode","createEdge","view","bindEventListeners","images","_Images2","_Groups2","_Canvas2","selectionHandler","_SelectionHandler2","interactionHandler","_InteractionHandler2","_View2","renderer","_CanvasRenderer2","_PhysicsEngine2","layoutEngine","_LayoutEngine2","clustering","_Clustering2","manipulation","_ManipulationSystem2","nodesHandler","_NodesHandler2","edgesHandler","_EdgesHandler2","_KamadaKawai2","_Images","_Groups","_NodesHandler","_EdgesHandler","_PhysicsEngine","_Clustering","_CanvasRenderer","_Canvas","_View","_InteractionHandler","_SelectionHandler","_LayoutEngine","_ManipulationSystem","_KamadaKawai","layout","interaction","networkOptions","_updateVisibleIndices","nodeId","edgeId","_updateValueRange","unselectAll","dotData","gephi","gephiData","valueTotal","setValueRange","canvasToDOM","DOMtoCanvas","findNode","isCluster","openCluster","cluster","getNodesInCluster","clusterByConnection","clusterByHubsize","clusterOutliers","getSeed","enableEditMode","disableEditMode","addNodeMode","editNode","editNodeMode","addEdgeMode","editEdgeMode","deleteSelected","getPositions","storePositions","moveNode","getBoundingBox","getConnectedNodes","objectId","getConnectedEdges","startSimulation","stopSimulation","stabilize","getSelectedNodes","getSelectedEdges","getNodeAt","getEdgeAt","edge","selectNodes","selectEdges","getViewPosition","releaseNode","getOptionsFromConfigurator","imageBroken","url","imageToCache","brokenUrl","imageToLoadBrokenUrlOn","onerror","_addImageToCache","Image","imageToRedrawWith","cachedImage","img","onload","_redrawWithImage","_tryloadBrokenUrl","Groups","defaultIndex","groupsArray","defaultGroups","useDefaultGroups","optionFields","groupName","groupname","_index","_Node","_Node2","_Label","_Label2","NodesHandler","nodesListeners","borderWidthSelected","brokenImage","fixed","face","strokeColor","vadjust","multi","bold","mod","boldital","ital","mono","image","labelHighlightBold","level","mass","scaling","maxVisible","drawThreshold","customScalingFunction","shadow","shape","shapeProperties","borderDashes","useImageSize","useBorderWithImage","nodeOptions","parseOptions","updateShape","updateLabelModule","_reset","_nodeId2","doNotEmit","oldNodesData","newNodes","positionInitially","changedData","dataChanged","constructorClass","clearPositions","dataArray","_node","_node2","boundingBox","nodeList","nodeObj","toId","fromId","edgeList","_Box","_Box2","_Circle","_Circle2","_CircularImage","_CircularImage2","_Database","_Database2","_Diamond","_Diamond2","_Dot","_Dot2","_Ellipse","_Ellipse2","_Icon","_Icon2","_Image","_Image2","_Square","_Square2","_Star","_Star2","_Text","_Text2","_Triangle","_Triangle2","_TriangleDown","_TriangleDown2","Node","imagelist","baseSize","baseFontSize","predefinedPosition","labelModule","currentShape","groupObj","choosify","imageObj","load","propagateFonts","chooser","chosen","chosenNode","shadowColor","shadowSize","shadowX","shadowY","constrain","distanceToBorder","sizeDiff","fontDiff","getFormattingValues","updateBoundingBox","resize","parentOptions","newOptions","parsedColor","_slicedToArray2","_slicedToArray3","Label","edgelabel","pointToSelf","fontOptions","yLine","isEdgeLabel","elementOptions","labelDirty","constrainWidth","maxWdt","minWdt","widthConstraint","widthConstraintMaximum","widthConstraintMinimum","constrainHeight","minHgt","valign","heightConstraint","heightConstraintMinimum","heightConstraintValign","chosenLabel","margins","widthBias","heightBias","mods","optionsFontMod","modOptionsArray","ratio","_ratio","baseline","viewFontSize","calculateLabelSize","_drawBackground","_drawText","lineMargin","fontSize","_setAlignment2","_setAlignment","_setAlignment3","labelHeight","lineCount","blocks","block","_getColor2","_getColor","_getColor3","fontColor","strokeText","initialStrokeColor","_processLabel","markupSystem","system","decodeMarkupSystem","splitMarkdownBlocks","splitHtmlBlocks","beginable","spacing","buffer","modStack","modName","emitBlock","ch","unshift","selectedState","hoverState","accumulate","addAndAccumulate","_nlLines","splitBlocks","_values","words","atStart","measure","lastMeasure","pre","measureText","_values2","_measure","_values3","_words","_text","_measure2","_lastMeasure","_pre","_text2","_measure3","newOptionsArray","_isIterable2","_isIterable3","sliceIterator","_arr","_n","_e","_s","isIterable","_getPrototypeOf","_getPrototypeOf2","_possibleConstructorReturn2","_possibleConstructorReturn3","_inherits2","_inherits3","_NodeBase2","_NodeBase3","Box","_NodeBase","__proto__","_setMargins","differentState","textSize","getTextSize","roundRect","enableShadow","disableShadow","save","enableBorderDashes","disableBorderDashes","restore","$getPrototypeOf","ReferenceError","_setPrototypeOf","_setPrototypeOf2","subClass","superClass","setPrototypeOf","buggy","NodeBase","adjustSizes","shadowBlur","shadowOffsetX","shadowOffsetY","setLineDash","dashes","_CircleImageBase2","_CircleImageBase3","Circle","_CircleImageBase","diameter","_drawRawCircle","CircleImageBase","labelOffset","imageLoaded","globalAlpha","can2","ctx2","drawImage","iterations","labelDimensions","CircularImage","_swapToImageResizeWhenImageLoaded","_resizeImage","clip","_drawImageAtPosition","_drawImageLabel","Database","database","_distanceToBorder","_ShapeBase2","_ShapeBase3","Diamond","_ShapeBase","_resizeShape","_drawShape","ShapeBase","sizeMultiplier","Dot","Ellipse","ellipse","Icon","_icon","iconTextSpacing","neutralborderWidth","selectionLineWidth","Square","Star","Text","Triangle","TriangleDown","_Edge","_Edge2","EdgesHandler","edgesListeners","arrows","scaleFactor","arrowStrikethrough","hoverWidth","selectionWidth","selfReferenceSize","smooth","forceDirection","roundness","emitChange","edgeData","edgeOptions","reconnectEdges","updateEdgeType","_edgeId","oldEdgesData","edgesData","oldEdge","disconnect","showInternalIds","connect","cleanup","_CubicBezierEdge","_CubicBezierEdge2","_BezierEdgeDynamic","_BezierEdgeDynamic2","_BezierEdgeStatic","_BezierEdgeStatic2","_StraightEdge","_StraightEdge2","Edge","baseWidth","edgeType","connected","_setInteractionWidths","chosenEdge","toArrow","fromArrow","middleArrow","inheritsColor","toArrowScale","toArrowType","middleArrowScale","middleArrowType","fromArrowScale","fromArrowType","selectedWidth","changeInType","attachEdge","detachEdge","widthDiff","viaNode","getViaNode","arrowData","fromPoint","toPoint","getArrowData","drawLine","drawArrows","drawLabel","drawArrowHead","node1","node2","getPoint","translate","_rotateForLabelAlignment","_pointOnCircle","xFrom","yFrom","xTo","yTo","xObj","yObj","getDistanceToEdge","angleInDegrees","rotate","colorsDefined","_CubicBezierEdgeBase2","_CubicBezierEdgeBase3","CubicBezierEdge","_CubicBezierEdgeBase","viaNodes","via1","via2","bezierCurveTo","x1","y1","x2","y2","_getViaCoordinates","nearNode","_findBorderPositionBezier","x3","y3","_ref","_ref2","_getDistanceToBezierEdge","_ref3","_ref4","vec","_BezierEdgeBase2","_BezierEdgeBase3","CubicBezierEdgeBase","_BezierEdgeBase","minDistance","lastX","lastY","_getDistanceToLine","_EdgeBase2","_EdgeBase3","BezierEdgeBase","_EdgeBase","distanceToPoint","difference","via","EdgeBase","colorDirty","getColor","_drawDashedLine","_drawLine","_getCircleData2","_getCircleData","_getCircleData3","_circle","pattern","lineDashOffset","_getCircleData4","_getCircleData5","dashedLine","_getCircleData6","_getCircleData7","_x","_y","_radius","_findBorderPosition","_findBorderPositionCircle","_getCircleData8","_getCircleData9","grd","createLinearGradient","fromColor","toColor","addColorStop","_getDistanceToEdge","_getCircleData10","_getCircleData11","py","something","arrowPoint","guideOffset","findBorderPosition","guidePos","_getCircleData12","_getCircleData13","xi","yi","arrowCore","circleEndpoint","arrowEndpoint","BezierEdgeDynamic","_boundFunction","positionBezierNode","physicsChange","setupSupportNode","parentEdgeId","quadraticCurveTo","cr","BezierEdgeStatic","xVia","yVia","pi","originalAngle","myAngle","_pi","_originalAngle","_myAngle","StraightEdge","edgeSegmentLength","toBorderDist","toBorderPoint","borderPos","_BarnesHutSolver","_BarnesHutSolver2","_RepulsionSolver","_RepulsionSolver2","_HierarchicalRepulsionSolver","_HierarchicalRepulsionSolver2","_SpringSolver","_SpringSolver2","_HierarchicalSpringSolver","_HierarchicalSpringSolver2","_CentralGravitySolver","_CentralGravitySolver2","_FA2BasedRepulsionSolver","_FA2BasedRepulsionSolver2","_FA2BasedCentralGravitySolver","_FA2BasedCentralGravitySolver2","PhysicsEngine","physicsBody","physicsNodeIndices","physicsEdgeIndices","forces","velocities","physicsEnabled","simulationInterval","requiresTimeout","previousStates","referenceState","freezeCache","renderTimer","adaptiveTimestep","adaptiveTimestepEnabled","adaptiveCounter","adaptiveInterval","stabilized","startedStabilization","stabilizationIterations","ready","barnesHut","theta","gravitationalConstant","centralGravity","springLength","springConstant","damping","avoidOverlap","forceAtlas2Based","repulsion","nodeDistance","hierarchicalRepulsion","maxVelocity","minVelocity","stabilization","updateInterval","onlyDynamicEdges","timestep","layoutFailed","initPhysics","updatePhysicsData","nodesSolver","edgesSolver","gravitySolver","modelOptions","viewFunction","simulationStep","_emitStabilized","startTime","physicsTick","physicsTime","runDoubleSpeed","amountOfIterations","calculateForces","moveNodes","revert","_evaluateStepQuality","nodeIds","positions","vx","vy","dpos","reference","maxNodeVelocity","averageNodeVelocity","velocityAdaptiveThreshold","nodeVelocity","_performStep","totalVelocity","solve","targetIterations","_freezeNodes","_stabilizationBatch","_finalizeStabilization","_restoreFrozenNodes","colorFactor","forceSize","arrowSize","BarnesHutSolver","barnesHutTree","randomSeed","thetaInversed","overlapAvoidanceFactor","nodeCount","_formBarnesHutTree","_getForceContribution","NW","NE","SW","SE","parentBranch","childrenCount","centerOfMass","calcSize","_calculateForces","gravityForce","fx","fy","minX","minY","maxX","maxY","minimumTreeSize","rootSize","halfRootSize","_splitBranch","_placeInTree","totalMass","totalMassInv","biggestSize","skipMassUpdate","_updateBranchMass","_placeInRegion","region","seededRandom","containedNode","_insertRegion","childSize","_drawBranch","branch","RepulsionSolver","repulsingForce","HierarchicalRepulsionSolver","steepness","SpringSolver","edgeLength","node3","_calculateSpringForce","springForce","HierarchicalSpringSolver","springFx","springFy","_i2","totalFx","totalFy","_i3","correctionFx","correctionFy","_i4","_nodeId3","CentralGravitySolver","_BarnesHutSolver3","ForceAtlas2BasedRepulsionSolver","degree","_CentralGravitySolver3","ForceAtlas2BasedCentralGravitySolver","_NetworkUtil","_NetworkUtil2","_Cluster","_Cluster2","ClusterEngine","clusteredNodes","clusteredEdges","hubsize","_getHubSize","_checkOptions","nodesToCluster","refreshData","joinCondition","childNodesObj","childEdgesObj","clonedOptions","cloneOptions","_cluster","edgeCount","clusters","usedNodes","relevantEdgeCount","gatheringSuccessful","childNodeId","_getConnectedId","clusterByEdgeCount","clusterNodeProperties","parentNodeId","parentClonedOptions","childClonedOptions","childNodeIDs","childNode","childEdge","clusterEdgeProperties","otherNodeId","childKeys","createEdges","_edge","newEdge","clusteringEdgeReplacingId","edgeReplacedById","_backupEdgeOptions","allowSingleNodeCluster","processProperties","childNodesOptions","childEdgesOptions","_clonedOptions","clusterId","_getClusterPosition","clusterNode","containedNodes","containedEdges","_createClusterEdges","originalOptions","clusterNodeId","releaseFunction","clusterPosition","newPositions","_containedNode","_nodeId4","_containedNode2","_nodeId5","_containedNode3","edgesToBeDeleted","otherCluster","transferEdge","replacedEdge","_restoreEdge","nodesArray","reverse","clusteredNodeId","startEdgeId","allEdgeIds","getClusteredEdges","clusteredEdgeId","baseEdgeId","average","averageSquared","hubCounter","largestHub","variance","standardDeviation","hubThreshold","NetworkUtil","allNodes","specificNodes","amountOfConnections","_Node3","Cluster","mozRequestAnimationFrame","webkitRequestAnimationFrame","msRequestAnimationFrame","CanvasRenderer","redrawRequested","renderingActive","renderRequests","allowRedraw","hideEdgesOnDrag","hideNodesOnDrag","_determineBrowserMethod","_resizeNodes","_requestRedraw","_startRendering","cancelAnimationFrame","_renderStep","_drawEdges","_drawNodes","alwaysShow","topLeft","bottomRight","viewableArea","isSelected","isBoundingBoxOverlappingWith","browserType","Canvas","resizeTimer","resizeFunction","cameraState","canvasViewCenter","hammerFrame","_cleanUp","previousWidth","previousHeight","widthRatio","heightRatio","newScale","currentViewCenter","distanceFromCenter","tabIndex","_prepareValue","emitEvent","oldWidth","oldHeight","previousRatio","_getCameraState","_setCameraState","_XconvertCanvasToDOM","_YconvertCanvasToDOM","_XconvertDOMtoCanvas","_YconvertDOMtoCanvas","View","animationSpeed","renderRefreshRate","animationEasingFunction","easingTime","sourceScale","targetScale","sourceTranslation","targetTranslation","lockedOnNodeId","lockedOnNodeOffset","touchTime","initialZoom","zoomLevel","positionDefined","numberOfNodes","yDistance","xZoomLevel","yZoomLevel","findCenter","animationOptions","nodePosition","lockedOnNode","animateView","locked","_transitionRedraw","viewCenter","_lockedRedraw","finished","_NavigationHandler","_NavigationHandler2","InteractionHandler","navigationHandler","popupObj","popupTimer","dragNodes","dragView","keyboard","speed","bindToWindow","navigationButtons","tooltipDelay","zoomView","pinched","checkSelectionChanges","_generateClickEvent","previouslySelectedEdgeCount","_getSelectedEdgeCount","previouslySelectedNodeCount","_getSelectedNodeCount","previousSelection","selectAdditionalOnPoint","selectOnPoint","selectedEdgesCount","selectedNodesCount","currentSelection","_determineIfDifferent2","_determineIfDifferent","nodesChanged","edgesChanged","nodeSelected","selectObject","selectionObj","xFixed","yFixed","scaleOld","preScaleDragPointer","scaleFrac","tx","ty","postScaleDragPointer","popupVisible","_checkHidePopup","_checkShowPopup","hoverObject","pointerObj","previousPopupObjId","nodeUnderCursor","popupType","overlappingNodes","isOverlappingWith","overlappingEdges","popupTargetType","popupTargetId","_pointerToPositionObject","stillOnObj","overNode","NavigationHandler","iconsCreated","navigationHammers","boundFunctions","activated","configureKeyboardBindings","loadNavigationElements","cleanNavigation","navigationDOM","navigationDivs","navigationDivActions","_fit","bindToRedraw","_stopMovement","boundAction","unbindFromRedraw","SelectionHandler","hoverObj","selectConnectedEdges","hoverConnectedEdges","updateSelection","selectionChanged","deselectObject","emptySelection","DOM","highlightEdges","_selectConnectedEdges","_addToSelection","_removeFromSelection","canvasPos","returnNode","positionObject","_getAllNodesOverlappingWith","_getEdgesOverlappingWith","returnEdge","mindist","overlappingEdge","_unselectConnectedEdges","clusterSize","_addToHover","hoverChanged","blurObject","_hoverConnectedEdges","edgeIds","idArray","RangeError","LayoutEngine","initialRandomSeed","setPhysics","optionsBackup","improvedLayout","hierarchical","levelSeparation","nodeSpacing","treeSpacing","blockShifting","edgeMinimization","parentCentralization","sortMethod","setupHierarchicalLayout","layoutNetwork","prevHierarchicalState","adaptAllOptionsForHierarchicalLayout","MAX_LEVELS","clusterThreshold","startLength","before","clusterBridges","after","_declusterAll","info","kamadaKawai","_shiftToCenter","getRangeCore","clustersPresent","definedLevel","definedPositions","undefinedLevel","hierarchicalLevels","lastNodeOnLevel","hierarchicalChildrenReference","hierarchicalParentReference","hierarchicalTrees","treeIndex","distributionOrdering","distributionIndex","distributionOrderingPresence","_determineLevelsByHubsize","_determineLevelsDirected","_determineLevelsCustomCallback","distribution","_getDistribution","_generateMap","_placeNodesByHierarchy","_condenseHierarchy","stillShifting","branches","shiftTrees","treeSizes","getTreeSizes","shiftTree","_getPositionForHierarchy","_setPositionForHierarchy","getTreeSize","treeWidths","getBranchNodes","getBranchBoundary","branchMap","maxLevel","minSpace","maxSpace","branchNode","_getSpaceAroundNode2","_getSpaceAroundNode","_getSpaceAroundNode3","minSpaceNode","maxSpaceNode","getMaxLevel","getCollisionLevel","maxLevel1","maxLevel2","hasSameParent","parents1","parents2","shiftElementsCloser","levels","centerParents","levelNodes","branchShiftCallback","centerParent","diffAbs","branchNodes1","branchNodes2","_getBranchBoundary","_getBranchBoundary2","max1","_getBranchBoundary3","_getBranchBoundary4","min2","minSpace2","diffBranch","_shiftBlock","_centerParent","minimizeEdgeLength","allEdges","nodeLevel","C2","referenceNodes","aboveEdges","otherNode","getFx","getDFx","getGuess","guess","guessMap","dfx","moveBranch","branchNodes","_getBranchBoundary5","_getBranchBoundary6","minSpaceBranch","maxSpaceBranch","branchOffset","_getSpaceAroundNode4","_getSpaceAroundNode5","newPosition","minimizeEdgeLengthBottomUp","shiftBranchesCloserBottomUp","centerAllParents","centerAllParentsBottomUp","useMap","prevNode","prevPos","nextNode","nextPos","parents","parentId","minPos","maxPos","_i5","_getSpaceAroundNode6","_getSpaceAroundNode7","positionedNodes","nodeArray","_indexArrayToNodes","_sortNodeArray","handledNodeCount","_validataPositionAndContinue","parentLevel","_i6","childNodeLevel","_i7","previousPos","sharedParent","_findCommonParent","withChild","_placeBranchNodes","hubSize","levelDownstream","nodeA","nodeB","_crawlNetwork","minLevel","customCallback","levelByDirection","levelA","_setMinLevelToZero","fillInRelations","_this7","startingNodeId","crawler","tree","childA","childB","_this8","iterateParents","findParent","foundParent","doNotUpdate","ManipulationSystem","editMode","manipulationDiv","editModeDiv","closeDiv","manipulationHammers","temporaryUIFunctions","temporaryEventFunctions","temporaryIds","guiEnabled","inMode","selectedControlNode","initiallyActive","addNode","addEdge","editEdge","deleteNode","deleteEdge","controlNodeStyle","_restore","_setup","showManipulatorToolbar","_createEditButton","manipulationDOM","selectedNodeCount","selectedEdgeCount","selectedTotalCount","needSeperator","_createAddNodeButton","_createSeperator","_createAddEdgeButton","_createEditNodeButton","_createEditEdgeButton","_createDeleteButton","_bindHammerToDiv","toggleEditMode","_temporaryBindEvent","_createBackButton","_createDescription","_performAddNode","_getSelectedNode","finalizedData","_temporaryBindUI","_handleConnect","_finishConnect","_dragControlNode","editWithoutDrag","edgeBeingEditedId","_performEditEdge","controlNodeFrom","_getNewTargetNode","controlNodeTo","_controlNodeTouch","_controlNodeDragStart","_controlNodeDrag","_controlNodeDragEnd","findBorderPositions","selectedNodes","selectedEdges","deleteFunction","_createWrappers","_removeManipulationDOM","_createButton","_cleanManipulatorHammers","_cleanupTemporaryNodesAndEdges","_unbindTemporaryUIs","_unbindTemporaryEvents","deleteBtnClass","labelClassName","newFunction","boundFunction","UIfunctionName","functionName","eventName","domElement","indexTempEdge","indexTempNode","fromSelect","toSelect","overlappingNodeIds","targetNode","connectionEdge","connectFromId","_performAddEdge","clickData","defaultData","sourceNodeId","targetNodeId","eeFunct","maximum","minimum","_FloydWarshall","_FloydWarshall2","KamadaKawai","edgeStrength","distanceSolver","edgesArray","ignoreClusters","D_matrix","getDistances","_createL_matrix","_createK_matrix","innerThreshold","maxInnerIterations","maxEnergy","highE_nodeId","dE_dx","dE_dy","delta_m","subIterations","_getHighestEnergyNode2","_getHighestEnergyNode","_getHighestEnergyNode3","_moveNode","_getEnergy2","_getEnergy","_getEnergy3","maxEnergyNodeId","dE_dx_max","dE_dy_max","nodeIdx","_getEnergy4","_getEnergy5","x_m","y_m","iIdx","x_i","y_i","denominator","K_matrix","L_matrix","d2E_dx2","d2E_dxdy","d2E_dy2","FloydWarshall","CanvasRenderingContext2D","square","s2","ir","triangleDown","star","diamond","r2d","kappa","ox","oy","xe","ye","xm","ym","wEllipse","hEllipse","ymb","yeb","xt","yt","xl","yl","xr","yr","xc","yc","patternLength","slope","distRemaining","patternIndex","dashLength","parseDOT","parseGraph","nextPreview","isAlphaNumeric","regexAlphaNumeric","setValue","graphs","attr","getToken","tokenType","TOKENTYPE","NULL","isComment","DELIMITER","c2","DELIMITERS","IDENTIFIER","newSyntaxError","UNKNOWN","chop","parseStatements","parseStatement","subgraph","parseSubgraph","parseEdge","parseAttributeStatement","parseNodeStatement","subgraphs","parseAttributeList","maxLength","forEach2","elem1","elem2","setProp","convertAttr","mapping","visProp","visPropI","graphData","dotNode","graphNode","NODE_ATTR_MAPPING","convertEdge","dotEdge","graphEdge","EDGE_ATTR_MAPPING","subEdge","fontsize","fontcolor","labelfontcolor","fontname","fillcolor","labeltooltip","{","}","[","]",";","=",",","->","--","gephiJSON","inheritColor","gEdges","gNodes","gEdge","gNode","edit","del","back","addDescription","edgeDescription","editEdgeDescription","createEdgeError","deleteClusterError","editClusterError"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAyBA,cAEA,SAA2CA,EAAMC,GAC1B,gBAAZC,UAA0C,gBAAXC,QACxCA,OAAOD,QAAUD,IACQ,kBAAXG,SAAyBA,OAAOC,IAC9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B,wCACjBC,mBAAoB,iCACpBC,iBAAkB,2CAEpBj1J,EAAe,MAAIA,EAAY","file":"vis"} \ No newline at end of file diff --git a/dist/vis.min.css b/dist/vis.min.css index c324706b..3925eb8c 100644 --- a/dist/vis.min.css +++ b/dist/vis.min.css @@ -1 +1 @@ -div.vis-network div.vis-close,div.vis-network div.vis-edit-mode div.vis-button,div.vis-network div.vis-manipulation div.vis-button{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-touch-callout:none;-khtml-user-select:none}.vis .overlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:10}.vis-active{box-shadow:0 0 10px #86d5f8}.vis [class*=span]{min-height:0;width:auto}div.vis-configuration{position:relative;display:block;float:left;font-size:12px}div.vis-configuration-wrapper{display:block;width:700px}div.vis-configuration-wrapper::after{clear:both;content:"";display:block}div.vis-configuration.vis-config-option-container{display:block;width:495px;background-color:#fff;border:2px solid #f7f8fa;border-radius:4px;margin-top:20px;left:10px;padding-left:5px}div.vis-configuration.vis-config-button{display:block;width:495px;height:25px;vertical-align:middle;line-height:25px;background-color:#f7f8fa;border:2px solid #ceced0;border-radius:4px;margin-top:20px;left:10px;padding-left:5px;cursor:pointer;margin-bottom:30px}div.vis-configuration.vis-config-button.hover{background-color:#4588e6;border:2px solid #214373;color:#fff}div.vis-configuration.vis-config-item{display:block;float:left;width:495px;height:25px;vertical-align:middle;line-height:25px}div.vis-configuration.vis-config-item.vis-config-s2{left:10px;background-color:#f7f8fa;padding-left:5px;border-radius:3px}div.vis-configuration.vis-config-item.vis-config-s3{left:20px;background-color:#e4e9f0;padding-left:5px;border-radius:3px}div.vis-configuration.vis-config-item.vis-config-s4{left:30px;background-color:#cfd8e6;padding-left:5px;border-radius:3px}div.vis-configuration.vis-config-header{font-size:18px;font-weight:700}div.vis-configuration.vis-config-label{width:120px;height:25px;line-height:25px}div.vis-configuration.vis-config-label.vis-config-s3{width:110px}div.vis-configuration.vis-config-label.vis-config-s4{width:100px}div.vis-configuration.vis-config-colorBlock{top:1px;width:30px;height:19px;border:1px solid #444;border-radius:2px;padding:0;margin:0;cursor:pointer}input.vis-configuration.vis-config-checkbox{left:-5px}input.vis-configuration.vis-config-rangeinput{position:relative;top:-5px;width:60px;padding:1px;margin:0;pointer-events:none}input.vis-configuration.vis-config-range{-webkit-appearance:none;border:0 solid #fff;background-color:rgba(0,0,0,0);width:300px;height:20px}input.vis-configuration.vis-config-range::-webkit-slider-runnable-track{width:300px;height:5px;background:#dedede;background:-moz-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#dedede),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-o-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:linear-gradient(to bottom,#dedede 0,#c8c8c8 99%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#dedede', endColorstr='#c8c8c8', GradientType=0 );border:1px solid #999;box-shadow:#aaa 0 0 3px 0;border-radius:3px}input.vis-configuration.vis-config-range::-webkit-slider-thumb{-webkit-appearance:none;border:1px solid #14334b;height:17px;width:17px;border-radius:50%;background:#3876c2;background:-moz-linear-gradient(top,#3876c2 0,#385380 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#3876c2),color-stop(100%,#385380));background:-webkit-linear-gradient(top,#3876c2 0,#385380 100%);background:-o-linear-gradient(top,#3876c2 0,#385380 100%);background:-ms-linear-gradient(top,#3876c2 0,#385380 100%);background:linear-gradient(to bottom,#3876c2 0,#385380 100%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#3876c2', endColorstr='#385380', GradientType=0 );box-shadow:#111927 0 0 1px 0;margin-top:-7px}input.vis-configuration.vis-config-range:focus{outline:0}input.vis-configuration.vis-config-range:focus::-webkit-slider-runnable-track{background:#9d9d9d;background:-moz-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#9d9d9d),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-o-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:linear-gradient(to bottom,#9d9d9d 0,#c8c8c8 99%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#9d9d9d', endColorstr='#c8c8c8', GradientType=0 )}input.vis-configuration.vis-config-range::-moz-range-track{width:300px;height:10px;background:#dedede;background:-moz-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#dedede),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-o-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:linear-gradient(to bottom,#dedede 0,#c8c8c8 99%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#dedede', endColorstr='#c8c8c8', GradientType=0 );border:1px solid #999;box-shadow:#aaa 0 0 3px 0;border-radius:3px}input.vis-configuration.vis-config-range::-moz-range-thumb{border:none;height:16px;width:16px;border-radius:50%;background:#385380}input.vis-configuration.vis-config-range:-moz-focusring{outline:#fff solid 1px;outline-offset:-1px}input.vis-configuration.vis-config-range::-ms-track{width:300px;height:5px;background:0 0;border-color:transparent;border-width:6px 0;color:transparent}input.vis-configuration.vis-config-range::-ms-fill-lower{background:#777;border-radius:10px}input.vis-configuration.vis-config-range::-ms-fill-upper{background:#ddd;border-radius:10px}input.vis-configuration.vis-config-range::-ms-thumb{border:none;height:16px;width:16px;border-radius:50%;background:#385380}input.vis-configuration.vis-config-range:focus::-ms-fill-lower{background:#888}input.vis-configuration.vis-config-range:focus::-ms-fill-upper{background:#ccc}.vis-configuration-popup{position:absolute;background:rgba(57,76,89,.85);border:2px solid #f2faff;line-height:30px;height:30px;width:150px;text-align:center;color:#fff;font-size:14px;border-radius:4px;-webkit-transition:opacity .3s ease-in-out;-moz-transition:opacity .3s ease-in-out;transition:opacity .3s ease-in-out}.vis-configuration-popup:after,.vis-configuration-popup:before{left:100%;top:50%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}.vis-configuration-popup:after{border-color:rgba(136,183,213,0);border-left-color:rgba(57,76,89,.85);border-width:8px;margin-top:-8px}.vis-configuration-popup:before{border-color:rgba(194,225,245,0);border-left-color:#f2faff;border-width:12px;margin-top:-12px}div.vis-color-picker{position:absolute;top:0;left:30px;margin-top:-140px;margin-left:30px;width:310px;height:444px;z-index:1;padding:10px;border-radius:15px;background-color:#fff;display:none;box-shadow:rgba(0,0,0,.5) 0 0 10px 0}div.vis-color-picker div.vis-arrow{position:absolute;top:147px;left:5px}div.vis-color-picker div.vis-arrow::after,div.vis-color-picker div.vis-arrow::before{right:100%;top:50%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}div.vis-color-picker div.vis-arrow:after{border-color:rgba(255,255,255,0);border-right-color:#fff;border-width:30px;margin-top:-30px}div.vis-color-picker div.vis-color{position:absolute;width:289px;height:289px;cursor:pointer}div.vis-color-picker div.vis-brightness{position:absolute;top:313px}div.vis-color-picker div.vis-opacity{position:absolute;top:350px}div.vis-color-picker div.vis-selector{position:absolute;top:137px;left:137px;width:15px;height:15px;border-radius:15px;border:1px solid #fff;background:#4c4c4c;background:-moz-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#4c4c4c),color-stop(12%,#595959),color-stop(25%,#666),color-stop(39%,#474747),color-stop(50%,#2c2c2c),color-stop(51%,#000),color-stop(60%,#111),color-stop(76%,#2b2b2b),color-stop(91%,#1c1c1c),color-stop(100%,#131313));background:-webkit-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:-o-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:-ms-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:linear-gradient(to bottom,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#4c4c4c', endColorstr='#131313', GradientType=0 )}div.vis-color-picker div.vis-initial-color,div.vis-color-picker div.vis-new-color{width:140px;height:20px;top:380px;font-size:10px;color:rgba(0,0,0,.4);line-height:20px;vertical-align:middle;position:absolute}div.vis-color-picker div.vis-new-color{border:1px solid rgba(0,0,0,.1);border-radius:5px;left:159px;text-align:right;padding-right:2px}div.vis-color-picker div.vis-initial-color{border:1px solid rgba(0,0,0,.1);border-radius:5px;left:10px;text-align:left;padding-left:2px}div.vis-color-picker div.vis-label{position:absolute;width:300px;left:10px}div.vis-color-picker div.vis-label.vis-brightness{top:300px}div.vis-color-picker div.vis-label.vis-opacity{top:338px}div.vis-color-picker div.vis-button{position:absolute;width:68px;height:25px;border-radius:10px;vertical-align:middle;text-align:center;line-height:25px;top:410px;border:2px solid #d9d9d9;background-color:#f7f7f7;cursor:pointer}div.vis-color-picker div.vis-button.vis-cancel{left:5px}div.vis-color-picker div.vis-button.vis-load{left:82px}div.vis-color-picker div.vis-button.vis-apply{left:159px}div.vis-color-picker div.vis-button.vis-save{left:236px}div.vis-color-picker input.vis-range{width:290px;height:20px}div.vis-network div.vis-manipulation{border-width:0;border-bottom:1px;border-style:solid;border-color:#d6d9d8;background:#fff;background:-moz-linear-gradient(top,#fff 0,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#fff),color-stop(48%,#fcfcfc),color-stop(50%,#fafafa),color-stop(100%,#fcfcfc));background:-webkit-linear-gradient(top,#fff 0,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%);background:-o-linear-gradient(top,#fff 0,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%);background:-ms-linear-gradient(top,#fff 0,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%);background:linear-gradient(to bottom,#fff 0,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#fcfcfc', GradientType=0 );padding-top:4px;position:absolute;left:0;top:0;width:100%;height:28px}div.vis-network div.vis-edit-mode{position:absolute;left:0;top:5px;height:30px}div.vis-network div.vis-close{position:absolute;right:0;top:0;width:30px;height:30px;background-position:20px 3px;background-repeat:no-repeat;background-image:url(img/network/cross.png);user-select:none}div.vis-network div.vis-close:hover{opacity:.6}div.vis-network div.vis-edit-mode div.vis-button,div.vis-network div.vis-manipulation div.vis-button{float:left;font-family:verdana;font-size:12px;-moz-border-radius:15px;border-radius:15px;display:inline-block;background-position:0 0;background-repeat:no-repeat;height:24px;margin-left:10px;padding:0 8px;user-select:none}div.vis-network div.vis-manipulation div.vis-button:hover{box-shadow:1px 1px 8px rgba(0,0,0,.2)}div.vis-network div.vis-manipulation div.vis-button:active{box-shadow:1px 1px 8px rgba(0,0,0,.5)}div.vis-network div.vis-manipulation div.vis-button.vis-back{background-image:url(img/network/backIcon.png)}div.vis-network div.vis-manipulation div.vis-button.vis-none:hover{box-shadow:1px 1px 8px transparent;cursor:default}div.vis-network div.vis-manipulation div.vis-button.vis-none:active{box-shadow:1px 1px 8px transparent}div.vis-network div.vis-manipulation div.vis-button.vis-none{padding:0}div.vis-network div.vis-manipulation div.notification{margin:2px;font-weight:700}div.vis-network div.vis-manipulation div.vis-button.vis-add{background-image:url(img/network/addNodeIcon.png)}div.vis-network div.vis-edit-mode div.vis-button.vis-edit,div.vis-network div.vis-manipulation div.vis-button.vis-edit{background-image:url(img/network/editIcon.png)}div.vis-network div.vis-edit-mode div.vis-button.vis-edit.vis-edit-mode{background-color:#fcfcfc;border:1px solid #ccc}div.vis-network div.vis-manipulation div.vis-button.vis-connect{background-image:url(img/network/connectIcon.png)}div.vis-network div.vis-manipulation div.vis-button.vis-delete{background-image:url(img/network/deleteIcon.png)}div.vis-network div.vis-edit-mode div.vis-label,div.vis-network div.vis-manipulation div.vis-label{margin:0 0 0 23px;line-height:25px}div.vis-network div.vis-manipulation div.vis-separator-line{float:left;display:inline-block;width:1px;height:21px;background-color:#bdbdbd;margin:0 7px 0 15px}div.vis-network div.vis-navigation div.vis-button{width:34px;height:34px;-moz-border-radius:17px;border-radius:17px;position:absolute;display:inline-block;background-position:2px 2px;background-repeat:no-repeat;cursor:pointer;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}div.vis-network div.vis-navigation div.vis-button:hover{box-shadow:0 0 3px 3px rgba(56,207,21,.3)}div.vis-network div.vis-navigation div.vis-button:active{box-shadow:0 0 1px 3px rgba(56,207,21,.95)}div.vis-network div.vis-navigation div.vis-button.vis-up{background-image:url(img/network/upArrow.png);bottom:50px;left:55px}div.vis-network div.vis-navigation div.vis-button.vis-down{background-image:url(img/network/downArrow.png);bottom:10px;left:55px}div.vis-network div.vis-navigation div.vis-button.vis-left{background-image:url(img/network/leftArrow.png);bottom:10px;left:15px}div.vis-network div.vis-navigation div.vis-button.vis-right{background-image:url(img/network/rightArrow.png);bottom:10px;left:95px}div.vis-network div.vis-navigation div.vis-button.vis-zoomIn{background-image:url(img/network/plus.png);bottom:10px;right:15px}div.vis-network div.vis-navigation div.vis-button.vis-zoomOut{background-image:url(img/network/minus.png);bottom:10px;right:55px}div.vis-network div.vis-navigation div.vis-button.vis-zoomExtends{background-image:url(img/network/zoomExtends.png);bottom:50px;right:15px}div.vis-network-tooltip{position:absolute;visibility:hidden;padding:5px;white-space:nowrap;font-family:verdana;font-size:14px;color:#000;background-color:#f5f4ed;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;border:1px solid #808074;box-shadow:3px 3px 10px rgba(0,0,0,.2);pointer-events:none}.vis-current-time{background-color:#FF7F6E;width:2px;z-index:1}.vis-custom-time{background-color:#6E94FF;width:2px;cursor:move;z-index:1}.vis-panel.vis-background.vis-horizontal .vis-grid.vis-horizontal{position:absolute;width:100%;height:0;border-bottom:1px solid}.vis-panel.vis-background.vis-horizontal .vis-grid.vis-minor{border-color:#e5e5e5}.vis-panel.vis-background.vis-horizontal .vis-grid.vis-major{border-color:#bfbfbf}.vis-data-axis .vis-y-axis.vis-major{width:100%;position:absolute;color:#4d4d4d;white-space:nowrap}.vis-data-axis .vis-y-axis.vis-major.vis-measure{padding:0;margin:0;border:0;visibility:hidden;width:auto}.vis-data-axis .vis-y-axis.vis-minor{position:absolute;width:100%;color:#bebebe;white-space:nowrap}.vis-data-axis .vis-y-axis.vis-minor.vis-measure{padding:0;margin:0;border:0;visibility:hidden;width:auto}.vis-data-axis .vis-y-axis.vis-title{position:absolute;color:#4d4d4d;white-space:nowrap;bottom:20px;text-align:center}.vis-data-axis .vis-y-axis.vis-title.vis-measure{padding:0;margin:0;visibility:hidden;width:auto}.vis-data-axis .vis-y-axis.vis-title.vis-left{bottom:0;-webkit-transform-origin:left top;-moz-transform-origin:left top;-ms-transform-origin:left top;-o-transform-origin:left top;transform-origin:left bottom;-webkit-transform:rotate(-90deg);-moz-transform:rotate(-90deg);-ms-transform:rotate(-90deg);-o-transform:rotate(-90deg);transform:rotate(-90deg)}.vis-data-axis .vis-y-axis.vis-title.vis-right{bottom:0;-webkit-transform-origin:right bottom;-moz-transform-origin:right bottom;-ms-transform-origin:right bottom;-o-transform-origin:right bottom;transform-origin:right bottom;-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.vis-legend{background-color:rgba(247,252,255,.65);padding:5px;border:1px solid #b3b3b3;box-shadow:2px 2px 10px rgba(154,154,154,.55)}.vis-legend-text{white-space:nowrap;display:inline-block}.vis-item{position:absolute;color:#1A1A1A;border-color:#97B0F8;border-width:1px;background-color:#D5DDF6;display:inline-block}.vis-item.vis-point.vis-selected,.vis-item.vis-selected{background-color:#FFF785}.vis-item.vis-selected{border-color:#FFC200;z-index:2}.vis-editable.vis-selected{cursor:move}.vis-item.vis-box{text-align:center;border-style:solid;border-radius:2px}.vis-item.vis-point{background:0 0}.vis-item.vis-dot{position:absolute;padding:0;border-width:4px;border-style:solid;border-radius:4px}.vis-item.vis-range{border-style:solid;border-radius:2px;box-sizing:border-box}.vis-item.vis-background{border:none;background-color:rgba(213,221,246,.4);box-sizing:border-box;padding:0;margin:0}.vis-item .vis-item-overflow{position:relative;width:100%;height:100%;padding:0;margin:0;overflow:hidden}.vis-item.vis-range .vis-item-content{position:relative;display:inline-block}.vis-item.vis-background .vis-item-content{position:absolute;display:inline-block}.vis-item.vis-line{padding:0;position:absolute;width:0;border-left-width:1px;border-left-style:solid}.vis-item .vis-item-content{white-space:nowrap;box-sizing:border-box;padding:5px}.vis-item .vis-onUpdateTime-tooltip{position:absolute;background:#4f81bd;color:#fff;width:200px;text-align:center;white-space:nowrap;padding:5px;border-radius:1px}.vis-item .vis-delete,.vis-item .vis-delete-rtl{position:absolute;top:0;width:24px;height:24px;box-sizing:border-box;padding:0 5px;cursor:pointer;-webkit-transition:background .2s linear;-moz-transition:background .2s linear;-ms-transition:background .2s linear;-o-transition:background .2s linear;transition:background .2s linear}.vis-item .vis-delete{right:-24px}.vis-item .vis-delete-rtl{left:-24px}.vis-item .vis-delete-rtl:after,.vis-item .vis-delete:after{content:"\00D7";color:red;font-family:arial,sans-serif;font-size:22px;font-weight:700;-webkit-transition:color .2s linear;-moz-transition:color .2s linear;-ms-transition:color .2s linear;-o-transition:color .2s linear;transition:color .2s linear}.vis-item .vis-delete-rtl:hover,.vis-item .vis-delete:hover{background:red}.vis-item .vis-delete-rtl:hover:after,.vis-item .vis-delete:hover:after{color:#fff}.vis-item .vis-drag-center{position:absolute;width:100%;height:100%;top:0;left:0;cursor:move}.vis-item.vis-range .vis-drag-left,.vis-item.vis-range .vis-drag-right{position:absolute;width:24px;max-width:20%;min-width:2px;height:100%;top:0}.vis-item.vis-range .vis-drag-left{left:-4px;cursor:w-resize}.vis-item.vis-range .vis-drag-right{right:-4px;cursor:e-resize}.vis-range.vis-item.vis-readonly .vis-drag-left,.vis-range.vis-item.vis-readonly .vis-drag-right{cursor:auto}.vis-itemset{position:relative;padding:0;margin:0;box-sizing:border-box}.vis-itemset .vis-background,.vis-itemset .vis-foreground{position:absolute;width:100%;height:100%;overflow:visible}.vis-axis{position:absolute;width:100%;height:0;left:0;z-index:1}.vis-foreground .vis-group{position:relative;box-sizing:border-box;border-bottom:1px solid #bfbfbf}.vis-foreground .vis-group:last-child{border-bottom:none}.vis-overlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:10}.vis-labelset,.vis-labelset .vis-label{position:relative;box-sizing:border-box}.vis-labelset{overflow:hidden}.vis-labelset .vis-label{left:0;top:0;width:100%;color:#4d4d4d;border-bottom:1px solid #bfbfbf}.vis-labelset .vis-label.draggable{cursor:pointer}.vis-labelset .vis-label:last-child{border-bottom:none}.vis-labelset .vis-label .vis-inner{display:inline-block;padding:5px}.vis-labelset .vis-label .vis-inner.vis-hidden{padding:0}.vis-panel{position:absolute;padding:0;margin:0;box-sizing:border-box}.vis-panel.vis-bottom,.vis-panel.vis-center,.vis-panel.vis-left,.vis-panel.vis-right,.vis-panel.vis-top{border:1px #bfbfbf}.vis-panel.vis-center,.vis-panel.vis-left,.vis-panel.vis-right{border-top-style:solid;border-bottom-style:solid;overflow:hidden}.vis-left.vis-panel.vis-vertical-scroll,.vis-right.vis-panel.vis-vertical-scroll{height:100%;overflow-x:hidden;overflow-y:scroll}.vis-background,.vis-time-axis,.vis-timeline{overflow:hidden}.vis-left.vis-panel.vis-vertical-scroll{direction:rtl}.vis-left.vis-panel.vis-vertical-scroll .vis-content,.vis-right.vis-panel.vis-vertical-scroll{direction:ltr}.vis-right.vis-panel.vis-vertical-scroll .vis-content{direction:rtl}.vis-panel.vis-bottom,.vis-panel.vis-center,.vis-panel.vis-top{border-left-style:solid;border-right-style:solid}.vis-panel>.vis-content{position:relative}.vis-panel .vis-shadow{position:absolute;width:100%;height:1px;box-shadow:0 0 10px rgba(0,0,0,.8)}.vis-panel .vis-shadow.vis-top{top:-1px;left:0}.vis-panel .vis-shadow.vis-bottom{bottom:-1px;left:0}.vis-graph-group0{fill:#4f81bd;fill-opacity:0;stroke-width:2px;stroke:#4f81bd}.vis-graph-group1{fill:#f79646;fill-opacity:0;stroke-width:2px;stroke:#f79646}.vis-graph-group2{fill:#8c51cf;fill-opacity:0;stroke-width:2px;stroke:#8c51cf}.vis-graph-group3{fill:#75c841;fill-opacity:0;stroke-width:2px;stroke:#75c841}.vis-graph-group4{fill:#ff0100;fill-opacity:0;stroke-width:2px;stroke:#ff0100}.vis-graph-group5{fill:#37d8e6;fill-opacity:0;stroke-width:2px;stroke:#37d8e6}.vis-graph-group6{fill:#042662;fill-opacity:0;stroke-width:2px;stroke:#042662}.vis-graph-group7{fill:#00ff26;fill-opacity:0;stroke-width:2px;stroke:#00ff26}.vis-graph-group8{fill:#f0f;fill-opacity:0;stroke-width:2px;stroke:#f0f}.vis-graph-group9{fill:#8f3938;fill-opacity:0;stroke-width:2px;stroke:#8f3938}.vis-timeline .vis-fill{fill-opacity:.1;stroke:none}.vis-timeline .vis-bar{fill-opacity:.5;stroke-width:1px}.vis-timeline .vis-point{stroke-width:2px;fill-opacity:1}.vis-timeline .vis-legend-background{stroke-width:1px;fill-opacity:.9;fill:#fff;stroke:#c2c2c2}.vis-timeline .vis-outline{stroke-width:1px;fill-opacity:1;fill:#fff;stroke:#e5e5e5}.vis-timeline .vis-icon-fill{fill-opacity:.3;stroke:none}.vis-time-axis{position:relative}.vis-time-axis.vis-foreground{top:0;left:0;width:100%}.vis-time-axis.vis-background{position:absolute;top:0;left:0;width:100%;height:100%}.vis-time-axis .vis-text{position:absolute;color:#4d4d4d;padding:3px;overflow:hidden;box-sizing:border-box;white-space:nowrap}.vis-time-axis .vis-text.vis-measure{position:absolute;padding-left:0;padding-right:0;margin-left:0;margin-right:0;visibility:hidden}.vis-time-axis .vis-grid.vis-vertical{position:absolute;border-left:1px solid}.vis-time-axis .vis-grid.vis-vertical-rtl{position:absolute;border-right:1px solid}.vis-time-axis .vis-grid.vis-minor{border-color:#e5e5e5}.vis-time-axis .vis-grid.vis-major{border-color:#bfbfbf}.vis-timeline{position:relative;border:1px solid #bfbfbf;padding:0;margin:0;box-sizing:border-box} \ No newline at end of file +.vis .overlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:10}.vis-active{box-shadow:0 0 10px #86d5f8}.vis [class*=span]{min-height:0;width:auto}div.vis-configuration{position:relative;display:block;float:left;font-size:12px}div.vis-configuration-wrapper{display:block;width:700px}div.vis-configuration-wrapper::after{clear:both;content:"";display:block}div.vis-configuration.vis-config-option-container{display:block;width:495px;background-color:#fff;border:2px solid #f7f8fa;border-radius:4px;margin-top:20px;left:10px;padding-left:5px}div.vis-configuration.vis-config-button{display:block;width:495px;height:25px;vertical-align:middle;line-height:25px;background-color:#f7f8fa;border:2px solid #ceced0;border-radius:4px;margin-top:20px;left:10px;padding-left:5px;cursor:pointer;margin-bottom:30px}div.vis-configuration.vis-config-button.hover{background-color:#4588e6;border:2px solid #214373;color:#fff}div.vis-configuration.vis-config-item{display:block;float:left;width:495px;height:25px;vertical-align:middle;line-height:25px}div.vis-configuration.vis-config-item.vis-config-s2{left:10px;background-color:#f7f8fa;padding-left:5px;border-radius:3px}div.vis-configuration.vis-config-item.vis-config-s3{left:20px;background-color:#e4e9f0;padding-left:5px;border-radius:3px}div.vis-configuration.vis-config-item.vis-config-s4{left:30px;background-color:#cfd8e6;padding-left:5px;border-radius:3px}div.vis-configuration.vis-config-header{font-size:18px;font-weight:700}div.vis-configuration.vis-config-label{width:120px;height:25px;line-height:25px}div.vis-configuration.vis-config-label.vis-config-s3{width:110px}div.vis-configuration.vis-config-label.vis-config-s4{width:100px}div.vis-configuration.vis-config-colorBlock{top:1px;width:30px;height:19px;border:1px solid #444;border-radius:2px;padding:0;margin:0;cursor:pointer}input.vis-configuration.vis-config-checkbox{left:-5px}input.vis-configuration.vis-config-rangeinput{position:relative;top:-5px;width:60px;padding:1px;margin:0;pointer-events:none}input.vis-configuration.vis-config-range{-webkit-appearance:none;border:0 solid #fff;background-color:rgba(0,0,0,0);width:300px;height:20px}input.vis-configuration.vis-config-range::-webkit-slider-runnable-track{width:300px;height:5px;background:#dedede;background:-moz-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#dedede),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-o-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:linear-gradient(to bottom,#dedede 0,#c8c8c8 99%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#dedede', endColorstr='#c8c8c8', GradientType=0 );border:1px solid #999;box-shadow:#aaa 0 0 3px 0;border-radius:3px}input.vis-configuration.vis-config-range::-webkit-slider-thumb{-webkit-appearance:none;border:1px solid #14334b;height:17px;width:17px;border-radius:50%;background:#3876c2;background:-moz-linear-gradient(top,#3876c2 0,#385380 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#3876c2),color-stop(100%,#385380));background:-webkit-linear-gradient(top,#3876c2 0,#385380 100%);background:-o-linear-gradient(top,#3876c2 0,#385380 100%);background:-ms-linear-gradient(top,#3876c2 0,#385380 100%);background:linear-gradient(to bottom,#3876c2 0,#385380 100%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#3876c2', endColorstr='#385380', GradientType=0 );box-shadow:#111927 0 0 1px 0;margin-top:-7px}input.vis-configuration.vis-config-range:focus{outline:0}input.vis-configuration.vis-config-range:focus::-webkit-slider-runnable-track{background:#9d9d9d;background:-moz-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#9d9d9d),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-o-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:linear-gradient(to bottom,#9d9d9d 0,#c8c8c8 99%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#9d9d9d', endColorstr='#c8c8c8', GradientType=0 )}input.vis-configuration.vis-config-range::-moz-range-track{width:300px;height:10px;background:#dedede;background:-moz-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#dedede),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-o-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:linear-gradient(to bottom,#dedede 0,#c8c8c8 99%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#dedede', endColorstr='#c8c8c8', GradientType=0 );border:1px solid #999;box-shadow:#aaa 0 0 3px 0;border-radius:3px}input.vis-configuration.vis-config-range::-moz-range-thumb{border:none;height:16px;width:16px;border-radius:50%;background:#385380}input.vis-configuration.vis-config-range:-moz-focusring{outline:#fff solid 1px;outline-offset:-1px}input.vis-configuration.vis-config-range::-ms-track{width:300px;height:5px;background:0 0;border-color:transparent;border-width:6px 0;color:transparent}input.vis-configuration.vis-config-range::-ms-fill-lower{background:#777;border-radius:10px}input.vis-configuration.vis-config-range::-ms-fill-upper{background:#ddd;border-radius:10px}input.vis-configuration.vis-config-range::-ms-thumb{border:none;height:16px;width:16px;border-radius:50%;background:#385380}input.vis-configuration.vis-config-range:focus::-ms-fill-lower{background:#888}input.vis-configuration.vis-config-range:focus::-ms-fill-upper{background:#ccc}.vis-configuration-popup{position:absolute;background:rgba(57,76,89,.85);border:2px solid #f2faff;line-height:30px;height:30px;width:150px;text-align:center;color:#fff;font-size:14px;border-radius:4px;-webkit-transition:opacity .3s ease-in-out;-moz-transition:opacity .3s ease-in-out;transition:opacity .3s ease-in-out}.vis-configuration-popup:after,.vis-configuration-popup:before{left:100%;top:50%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}.vis-configuration-popup:after{border-color:rgba(136,183,213,0);border-left-color:rgba(57,76,89,.85);border-width:8px;margin-top:-8px}.vis-configuration-popup:before{border-color:rgba(194,225,245,0);border-left-color:#f2faff;border-width:12px;margin-top:-12px}div.vis-tooltip{position:absolute;visibility:hidden;padding:5px;white-space:nowrap;font-family:verdana;font-size:14px;color:#000;background-color:#f5f4ed;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;border:1px solid #808074;box-shadow:3px 3px 10px rgba(0,0,0,.2);pointer-events:none;z-index:5}div.vis-color-picker{position:absolute;top:0;left:30px;margin-top:-140px;margin-left:30px;width:310px;height:444px;z-index:1;padding:10px;border-radius:15px;background-color:#fff;display:none;box-shadow:rgba(0,0,0,.5) 0 0 10px 0}div.vis-color-picker div.vis-arrow{position:absolute;top:147px;left:5px}div.vis-color-picker div.vis-arrow::after,div.vis-color-picker div.vis-arrow::before{right:100%;top:50%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}div.vis-color-picker div.vis-arrow:after{border-color:rgba(255,255,255,0);border-right-color:#fff;border-width:30px;margin-top:-30px}div.vis-color-picker div.vis-color{position:absolute;width:289px;height:289px;cursor:pointer}div.vis-color-picker div.vis-brightness{position:absolute;top:313px}div.vis-color-picker div.vis-opacity{position:absolute;top:350px}div.vis-color-picker div.vis-selector{position:absolute;top:137px;left:137px;width:15px;height:15px;border-radius:15px;border:1px solid #fff;background:#4c4c4c;background:-moz-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#4c4c4c),color-stop(12%,#595959),color-stop(25%,#666),color-stop(39%,#474747),color-stop(50%,#2c2c2c),color-stop(51%,#000),color-stop(60%,#111),color-stop(76%,#2b2b2b),color-stop(91%,#1c1c1c),color-stop(100%,#131313));background:-webkit-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:-o-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:-ms-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:linear-gradient(to bottom,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#4c4c4c', endColorstr='#131313', GradientType=0 )}div.vis-color-picker div.vis-initial-color,div.vis-color-picker div.vis-new-color{width:140px;height:20px;top:380px;font-size:10px;color:rgba(0,0,0,.4);line-height:20px;vertical-align:middle;position:absolute}div.vis-color-picker div.vis-new-color{border:1px solid rgba(0,0,0,.1);border-radius:5px;left:159px;text-align:right;padding-right:2px}div.vis-color-picker div.vis-initial-color{border:1px solid rgba(0,0,0,.1);border-radius:5px;left:10px;text-align:left;padding-left:2px}div.vis-color-picker div.vis-label{position:absolute;width:300px;left:10px}div.vis-color-picker div.vis-label.vis-brightness{top:300px}div.vis-color-picker div.vis-label.vis-opacity{top:338px}div.vis-color-picker div.vis-button{position:absolute;width:68px;height:25px;border-radius:10px;vertical-align:middle;text-align:center;line-height:25px;top:410px;border:2px solid #d9d9d9;background-color:#f7f7f7;cursor:pointer}div.vis-color-picker div.vis-button.vis-cancel{left:5px}div.vis-color-picker div.vis-button.vis-load{left:82px}div.vis-color-picker div.vis-button.vis-apply{left:159px}div.vis-color-picker div.vis-button.vis-save{left:236px}div.vis-color-picker input.vis-range{width:290px;height:20px}div.vis-network div.vis-manipulation{border-width:0;border-bottom:1px;border-style:solid;border-color:#d6d9d8;background:#fff;background:-moz-linear-gradient(top,#fff 0,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#fff),color-stop(48%,#fcfcfc),color-stop(50%,#fafafa),color-stop(100%,#fcfcfc));background:-webkit-linear-gradient(top,#fff 0,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%);background:-o-linear-gradient(top,#fff 0,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%);background:-ms-linear-gradient(top,#fff 0,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%);background:linear-gradient(to bottom,#fff 0,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#fcfcfc', GradientType=0 );padding-top:4px;position:absolute;left:0;top:0;width:100%;height:28px}div.vis-network div.vis-edit-mode{position:absolute;left:0;top:5px;height:30px}div.vis-network div.vis-close{position:absolute;right:0;top:0;width:30px;height:30px;background-position:20px 3px;background-repeat:no-repeat;background-image:url(img/network/cross.png);cursor:pointer;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}div.vis-network div.vis-close:hover{opacity:.6}div.vis-network div.vis-edit-mode div.vis-button,div.vis-network div.vis-manipulation div.vis-button{float:left;font-family:verdana;font-size:12px;-moz-border-radius:15px;border-radius:15px;display:inline-block;background-position:0 0;background-repeat:no-repeat;height:24px;margin-left:10px;cursor:pointer;padding:0 8px;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}div.vis-network div.vis-manipulation div.vis-button:hover{box-shadow:1px 1px 8px rgba(0,0,0,.2)}div.vis-network div.vis-manipulation div.vis-button:active{box-shadow:1px 1px 8px rgba(0,0,0,.5)}div.vis-network div.vis-manipulation div.vis-button.vis-back{background-image:url(img/network/backIcon.png)}div.vis-network div.vis-manipulation div.vis-button.vis-none:hover{box-shadow:1px 1px 8px transparent;cursor:default}div.vis-network div.vis-manipulation div.vis-button.vis-none:active{box-shadow:1px 1px 8px transparent}div.vis-network div.vis-manipulation div.vis-button.vis-none{padding:0}div.vis-network div.vis-manipulation div.notification{margin:2px;font-weight:700}div.vis-network div.vis-manipulation div.vis-button.vis-add{background-image:url(img/network/addNodeIcon.png)}div.vis-network div.vis-edit-mode div.vis-button.vis-edit,div.vis-network div.vis-manipulation div.vis-button.vis-edit{background-image:url(img/network/editIcon.png)}div.vis-network div.vis-edit-mode div.vis-button.vis-edit.vis-edit-mode{background-color:#fcfcfc;border:1px solid #ccc}div.vis-network div.vis-manipulation div.vis-button.vis-connect{background-image:url(img/network/connectIcon.png)}div.vis-network div.vis-manipulation div.vis-button.vis-delete{background-image:url(img/network/deleteIcon.png)}div.vis-network div.vis-edit-mode div.vis-label,div.vis-network div.vis-manipulation div.vis-label{margin:0 0 0 23px;line-height:25px}div.vis-network div.vis-manipulation div.vis-separator-line{float:left;display:inline-block;width:1px;height:21px;background-color:#bdbdbd;margin:0 7px 0 15px}div.vis-network div.vis-navigation div.vis-button{width:34px;height:34px;-moz-border-radius:17px;border-radius:17px;position:absolute;display:inline-block;background-position:2px 2px;background-repeat:no-repeat;cursor:pointer;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}div.vis-network div.vis-navigation div.vis-button:hover{box-shadow:0 0 3px 3px rgba(56,207,21,.3)}div.vis-network div.vis-navigation div.vis-button:active{box-shadow:0 0 1px 3px rgba(56,207,21,.95)}div.vis-network div.vis-navigation div.vis-button.vis-up{background-image:url(img/network/upArrow.png);bottom:50px;left:55px}div.vis-network div.vis-navigation div.vis-button.vis-down{background-image:url(img/network/downArrow.png);bottom:10px;left:55px}div.vis-network div.vis-navigation div.vis-button.vis-left{background-image:url(img/network/leftArrow.png);bottom:10px;left:15px}div.vis-network div.vis-navigation div.vis-button.vis-right{background-image:url(img/network/rightArrow.png);bottom:10px;left:95px}div.vis-network div.vis-navigation div.vis-button.vis-zoomIn{background-image:url(img/network/plus.png);bottom:10px;right:15px}div.vis-network div.vis-navigation div.vis-button.vis-zoomOut{background-image:url(img/network/minus.png);bottom:10px;right:55px}div.vis-network div.vis-navigation div.vis-button.vis-zoomExtends{background-image:url(img/network/zoomExtends.png);bottom:50px;right:15px}.vis-current-time{background-color:#FF7F6E;width:2px;z-index:1;pointer-events:none}.vis-rolling-mode-btn{height:40px;width:40px;position:absolute;top:7px;right:20px;border-radius:50%;font-size:28px;cursor:pointer;opacity:.8;color:#fff;font-weight:700;text-align:center;background:#3876c2}.vis-rolling-mode-btn:before{content:"\26F6"}.vis-rolling-mode-btn:hover{opacity:1}.vis-custom-time{background-color:#6E94FF;width:2px;cursor:move;z-index:1}.vis-panel.vis-background.vis-horizontal .vis-grid.vis-horizontal{position:absolute;width:100%;height:0;border-bottom:1px solid}.vis-panel.vis-background.vis-horizontal .vis-grid.vis-minor{border-color:#e5e5e5}.vis-panel.vis-background.vis-horizontal .vis-grid.vis-major{border-color:#bfbfbf}.vis-data-axis .vis-y-axis.vis-major{width:100%;position:absolute;color:#4d4d4d;white-space:nowrap}.vis-data-axis .vis-y-axis.vis-major.vis-measure{padding:0;margin:0;border:0;visibility:hidden;width:auto}.vis-data-axis .vis-y-axis.vis-minor{position:absolute;width:100%;color:#bebebe;white-space:nowrap}.vis-data-axis .vis-y-axis.vis-minor.vis-measure{padding:0;margin:0;border:0;visibility:hidden;width:auto}.vis-data-axis .vis-y-axis.vis-title{position:absolute;color:#4d4d4d;white-space:nowrap;bottom:20px;text-align:center}.vis-data-axis .vis-y-axis.vis-title.vis-measure{padding:0;margin:0;visibility:hidden;width:auto}.vis-data-axis .vis-y-axis.vis-title.vis-left{bottom:0;-webkit-transform-origin:left top;-moz-transform-origin:left top;-ms-transform-origin:left top;-o-transform-origin:left top;transform-origin:left bottom;-webkit-transform:rotate(-90deg);-moz-transform:rotate(-90deg);-ms-transform:rotate(-90deg);-o-transform:rotate(-90deg);transform:rotate(-90deg)}.vis-data-axis .vis-y-axis.vis-title.vis-right{bottom:0;-webkit-transform-origin:right bottom;-moz-transform-origin:right bottom;-ms-transform-origin:right bottom;-o-transform-origin:right bottom;transform-origin:right bottom;-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.vis-legend{background-color:rgba(247,252,255,.65);padding:5px;border:1px solid #b3b3b3;box-shadow:2px 2px 10px rgba(154,154,154,.55)}.vis-legend-text{white-space:nowrap;display:inline-block}.vis-item{position:absolute;color:#1A1A1A;border-color:#97B0F8;border-width:1px;background-color:#D5DDF6;display:inline-block}.vis-item.vis-point.vis-selected,.vis-item.vis-selected{background-color:#FFF785}.vis-item.vis-selected{border-color:#FFC200;z-index:2}.vis-editable.vis-selected{cursor:move}.vis-item.vis-box{text-align:center;border-style:solid;border-radius:2px}.vis-item.vis-point{background:0 0}.vis-item.vis-dot{position:absolute;padding:0;border-width:4px;border-style:solid;border-radius:4px}.vis-item.vis-range{border-style:solid;border-radius:2px;box-sizing:border-box}.vis-item.vis-background{border:none;background-color:rgba(213,221,246,.4);box-sizing:border-box;padding:0;margin:0}.vis-item .vis-item-overflow{position:relative;width:100%;height:100%;padding:0;margin:0;overflow:hidden}.vis-item-visible-frame{white-space:nowrap}.vis-item.vis-range .vis-item-content{position:relative;display:inline-block}.vis-item.vis-background .vis-item-content{position:absolute;display:inline-block}.vis-item.vis-line{padding:0;position:absolute;width:0;border-left-width:1px;border-left-style:solid}.vis-item .vis-item-content{white-space:nowrap;box-sizing:border-box;padding:5px}.vis-item .vis-onUpdateTime-tooltip{position:absolute;background:#4f81bd;color:#fff;width:200px;text-align:center;white-space:nowrap;padding:5px;border-radius:1px}.vis-item .vis-delete,.vis-item .vis-delete-rtl{position:absolute;top:0;width:24px;height:24px;box-sizing:border-box;padding:0 5px;cursor:pointer;-webkit-transition:background .2s linear;-moz-transition:background .2s linear;-ms-transition:background .2s linear;-o-transition:background .2s linear;transition:background .2s linear}.vis-item .vis-delete{right:-24px}.vis-item .vis-delete-rtl{left:-24px}.vis-item .vis-delete-rtl:after,.vis-item .vis-delete:after{content:"\00D7";color:red;font-family:arial,sans-serif;font-size:22px;font-weight:700;-webkit-transition:color .2s linear;-moz-transition:color .2s linear;-ms-transition:color .2s linear;-o-transition:color .2s linear;transition:color .2s linear}.vis-item .vis-delete-rtl:hover,.vis-item .vis-delete:hover{background:red}.vis-item .vis-delete-rtl:hover:after,.vis-item .vis-delete:hover:after{color:#fff}.vis-item .vis-drag-center{position:absolute;width:100%;height:100%;top:0;left:0;cursor:move}.vis-item.vis-range .vis-drag-left,.vis-item.vis-range .vis-drag-right{position:absolute;width:24px;max-width:20%;min-width:2px;height:100%;top:0}.vis-item.vis-range .vis-drag-left{left:-4px;cursor:w-resize}.vis-item.vis-range .vis-drag-right{right:-4px;cursor:e-resize}.vis-range.vis-item.vis-readonly .vis-drag-left,.vis-range.vis-item.vis-readonly .vis-drag-right{cursor:auto}.vis-labelset .vis-label.draggable,.vis-nesting-group{cursor:pointer}.vis-itemset{position:relative;padding:0;margin:0;box-sizing:border-box}.vis-itemset .vis-background,.vis-itemset .vis-foreground{position:absolute;width:100%;height:100%;overflow:visible}.vis-axis{position:absolute;width:100%;height:0;left:0;z-index:1}.vis-foreground .vis-group{position:relative;box-sizing:border-box;border-bottom:1px solid #bfbfbf}.vis-foreground .vis-group:last-child{border-bottom:none}.vis-nested-group{background:#f5f5f5}.vis-label.vis-nesting-group.expanded:before{content:"\25BC"}.vis-label.vis-nesting-group.collapsed-rtl:before{content:"\25C0"}.vis-label.vis-nesting-group.collapsed:before{content:"\25B6"}.vis-overlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:10}.vis-labelset,.vis-labelset .vis-label{position:relative;box-sizing:border-box}.vis-labelset{overflow:hidden}.vis-labelset .vis-label{left:0;top:0;width:100%;color:#4d4d4d;border-bottom:1px solid #bfbfbf}.vis-labelset .vis-label:last-child{border-bottom:none}.vis-labelset .vis-label .vis-inner{display:inline-block;padding:5px}.vis-labelset .vis-label .vis-inner.vis-hidden{padding:0}.vis-panel{position:absolute;padding:0;margin:0;box-sizing:border-box}.vis-panel.vis-bottom,.vis-panel.vis-center,.vis-panel.vis-left,.vis-panel.vis-right,.vis-panel.vis-top{border:1px #bfbfbf}.vis-panel.vis-center,.vis-panel.vis-left,.vis-panel.vis-right{border-top-style:solid;border-bottom-style:solid;overflow:hidden}.vis-left.vis-panel.vis-vertical-scroll,.vis-right.vis-panel.vis-vertical-scroll{height:100%;overflow-x:hidden;overflow-y:scroll}.vis-background,.vis-time-axis,.vis-timeline{overflow:hidden}.vis-left.vis-panel.vis-vertical-scroll{direction:rtl}.vis-left.vis-panel.vis-vertical-scroll .vis-content,.vis-right.vis-panel.vis-vertical-scroll{direction:ltr}.vis-right.vis-panel.vis-vertical-scroll .vis-content{direction:rtl}.vis-panel.vis-bottom,.vis-panel.vis-center,.vis-panel.vis-top{border-left-style:solid;border-right-style:solid}.vis-panel>.vis-content{position:relative}.vis-panel .vis-shadow{position:absolute;width:100%;height:1px;box-shadow:0 0 10px rgba(0,0,0,.8)}.vis-panel .vis-shadow.vis-top{top:-1px;left:0}.vis-panel .vis-shadow.vis-bottom{bottom:-1px;left:0}.vis-graph-group0{fill:#4f81bd;fill-opacity:0;stroke-width:2px;stroke:#4f81bd}.vis-graph-group1{fill:#f79646;fill-opacity:0;stroke-width:2px;stroke:#f79646}.vis-graph-group2{fill:#8c51cf;fill-opacity:0;stroke-width:2px;stroke:#8c51cf}.vis-graph-group3{fill:#75c841;fill-opacity:0;stroke-width:2px;stroke:#75c841}.vis-graph-group4{fill:#ff0100;fill-opacity:0;stroke-width:2px;stroke:#ff0100}.vis-graph-group5{fill:#37d8e6;fill-opacity:0;stroke-width:2px;stroke:#37d8e6}.vis-graph-group6{fill:#042662;fill-opacity:0;stroke-width:2px;stroke:#042662}.vis-graph-group7{fill:#00ff26;fill-opacity:0;stroke-width:2px;stroke:#00ff26}.vis-graph-group8{fill:#f0f;fill-opacity:0;stroke-width:2px;stroke:#f0f}.vis-graph-group9{fill:#8f3938;fill-opacity:0;stroke-width:2px;stroke:#8f3938}.vis-timeline .vis-fill{fill-opacity:.1;stroke:none}.vis-timeline .vis-bar{fill-opacity:.5;stroke-width:1px}.vis-timeline .vis-point{stroke-width:2px;fill-opacity:1}.vis-timeline .vis-legend-background{stroke-width:1px;fill-opacity:.9;fill:#fff;stroke:#c2c2c2}.vis-timeline .vis-outline{stroke-width:1px;fill-opacity:1;fill:#fff;stroke:#e5e5e5}.vis-timeline .vis-icon-fill{fill-opacity:.3;stroke:none}.vis-time-axis{position:relative}.vis-time-axis.vis-foreground{top:0;left:0;width:100%}.vis-time-axis.vis-background{position:absolute;top:0;left:0;width:100%;height:100%}.vis-time-axis .vis-text{position:absolute;color:#4d4d4d;padding:3px;overflow:hidden;box-sizing:border-box;white-space:nowrap}.vis-time-axis .vis-text.vis-measure{position:absolute;padding-left:0;padding-right:0;margin-left:0;margin-right:0;visibility:hidden}.vis-time-axis .vis-grid.vis-vertical{position:absolute;border-left:1px solid}.vis-time-axis .vis-grid.vis-vertical-rtl{position:absolute;border-right:1px solid}.vis-time-axis .vis-grid.vis-minor{border-color:#e5e5e5}.vis-time-axis .vis-grid.vis-major{border-color:#bfbfbf}.vis-timeline{position:relative;border:1px solid #bfbfbf;padding:0;margin:0;box-sizing:border-box} \ No newline at end of file diff --git a/dist/vis.min.js b/dist/vis.min.js index 4faffbc2..010c88a5 100644 --- a/dist/vis.min.js +++ b/dist/vis.min.js @@ -4,8 +4,8 @@ * * A dynamic, browser-based visualization library. * - * @version 4.17.0 - * @date 2016-11-05 + * @version 4.18.0 + * @date 2017-01-15 * * @license * Copyright (C) 2011-2016 Almende B.V, http://almende.com @@ -22,24 +22,25 @@ * * Vis.js may be distributed under either license. */ -"use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.vis=e():t.vis=e()}(this,function(){return function(t){function e(o){if(i[o])return i[o].exports;var n=i[o]={exports:{},id:o,loaded:!1};return t[o].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){var o=i(1);o.extend(e,i(7)),o.extend(e,i(26)),o.extend(e,i(62))},function(t,e,i){var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n=i(2),s=i(6);e.isNumber=function(t){return t instanceof Number||"number"==typeof t},e.recursiveDOMDelete=function(t){if(t)for(;t.hasChildNodes()===!0;)e.recursiveDOMDelete(t.firstChild),t.removeChild(t.firstChild)},e.giveRange=function(t,e,i,o){if(e==t)return.5;var n=1/(e-t);return Math.max(0,(o-t)*n)},e.isString=function(t){return t instanceof String||"string"==typeof t},e.isDate=function(t){if(t instanceof Date)return!0;if(e.isString(t)){var i=r.exec(t);if(i)return!0;if(!isNaN(Date.parse(t)))return!0}return!1},e.randomUUID=function(){return s.v4()},e.assignAllKeys=function(t,e){for(var i in t)t.hasOwnProperty(i)&&"object"!==o(t[i])&&(t[i]=e)},e.fillIfDefined=function(t,i){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(var s in t)void 0!==i[s]&&("object"!==o(i[s])?void 0!==i[s]&&null!==i[s]||void 0===t[s]||n!==!0?t[s]=i[s]:delete t[s]:"object"===o(t[s])&&e.fillIfDefined(t[s],i[s],n))},e.protoExtend=function(t,e){for(var i=1;i3&&void 0!==arguments[3]&&arguments[3];if(Array.isArray(o))throw new TypeError("Arrays are not supported by deepExtend");for(var s=2;s3&&void 0!==arguments[3]&&arguments[3];if(Array.isArray(o))throw new TypeError("Arrays are not supported by deepExtend");for(var s in o)if(o.hasOwnProperty(s)&&t.indexOf(s)==-1)if(o[s]&&o[s].constructor===Object)void 0===i[s]&&(i[s]={}),i[s].constructor===Object?e.deepExtend(i[s],o[s]):null===o[s]&&void 0!==i[s]&&n===!0?delete i[s]:i[s]=o[s];else if(Array.isArray(o[s])){i[s]=[];for(var r=0;r=0&&(e="DOMMouseScroll"),t.addEventListener(e,i,o)):t.attachEvent("on"+e,i)},e.removeEventListener=function(t,e,i,o){t.removeEventListener?(void 0===o&&(o=!1),"mousewheel"===e&&navigator.userAgent.indexOf("Firefox")>=0&&(e="DOMMouseScroll"),t.removeEventListener(e,i,o)):t.detachEvent("on"+e,i)},e.preventDefault=function(t){t||(t=window.event),t.preventDefault?t.preventDefault():t.returnValue=!1},e.getTarget=function(t){t||(t=window.event);var e;return t.target?e=t.target:t.srcElement&&(e=t.srcElement),void 0!=e.nodeType&&3==e.nodeType&&(e=e.parentNode),e},e.hasParent=function(t,e){for(var i=t;i;){if(i===e)return!0;i=i.parentNode}return!1},e.option={},e.option.asBoolean=function(t,e){return"function"==typeof t&&(t=t()),null!=t?0!=t:e||null},e.option.asNumber=function(t,e){return"function"==typeof t&&(t=t()),null!=t?Number(t)||e||null:e||null},e.option.asString=function(t,e){return"function"==typeof t&&(t=t()),null!=t?String(t):e||null},e.option.asSize=function(t,i){return"function"==typeof t&&(t=t()),e.isString(t)?t:e.isNumber(t)?t+"px":i||null},e.option.asElement=function(t,e){return"function"==typeof t&&(t=t()),t||e||null},e.hexToRGB=function(t){var e=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;t=t.replace(e,function(t,e,i,o){return e+e+i+i+o+o});var i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return i?{r:parseInt(i[1],16),g:parseInt(i[2],16),b:parseInt(i[3],16)}:null},e.overrideOpacity=function(t,i){if(t.indexOf("rgba")!=-1)return t;if(t.indexOf("rgb")!=-1){var o=t.substr(t.indexOf("(")+1).replace(")","").split(",");return"rgba("+o[0]+","+o[1]+","+o[2]+","+i+")"}var o=e.hexToRGB(t);return null==o?t:"rgba("+o.r+","+o.g+","+o.b+","+i+")"},e.RGBToHex=function(t,e,i){return"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1)},e.parseColor=function(t){var i;if(e.isString(t)===!0){if(e.isValidRGB(t)===!0){var o=t.substr(4).substr(0,t.length-5).split(",").map(function(t){return parseInt(t)});t=e.RGBToHex(o[0],o[1],o[2])}if(e.isValidHex(t)===!0){var n=e.hexToHSV(t),s={h:n.h,s:.8*n.s,v:Math.min(1,1.02*n.v)},r={h:n.h,s:Math.min(1,1.25*n.s),v:.8*n.v},a=e.HSVToHex(r.h,r.s,r.v),h=e.HSVToHex(s.h,s.s,s.v);i={background:t,border:a,highlight:{background:h,border:a},hover:{background:h,border:a}}}else i={background:t,border:t,highlight:{background:t,border:t},hover:{background:t,border:t}}}else i={},i.background=t.background||void 0,i.border=t.border||void 0,e.isString(t.highlight)?i.highlight={border:t.highlight,background:t.highlight}:(i.highlight={},i.highlight.background=t.highlight&&t.highlight.background||void 0,i.highlight.border=t.highlight&&t.highlight.border||void 0),e.isString(t.hover)?i.hover={border:t.hover,background:t.hover}:(i.hover={},i.hover.background=t.hover&&t.hover.background||void 0,i.hover.border=t.hover&&t.hover.border||void 0);return i},e.RGBToHSV=function(t,e,i){t/=255,e/=255,i/=255;var o=Math.min(t,Math.min(e,i)),n=Math.max(t,Math.max(e,i));if(o==n)return{h:0,s:0,v:o};var s=t==o?e-i:i==o?t-e:i-t,r=t==o?3:i==o?1:5,a=60*(r-s/(n-o))/360,h=(n-o)/n,d=n;return{h:a,s:h,v:d}};var a={split:function(t){var e={};return t.split(";").forEach(function(t){if(""!=t.trim()){var i=t.split(":"),o=i[0].trim(),n=i[1].trim();e[o]=n}}),e},join:function(t){return Object.keys(t).map(function(e){return e+": "+t[e]}).join("; ")}};e.addCssText=function(t,i){var o=a.split(t.style.cssText),n=a.split(i),s=e.extend(o,n);t.style.cssText=a.join(s)},e.removeCssText=function(t,e){var i=a.split(t.style.cssText),o=a.split(e);for(var n in o)o.hasOwnProperty(n)&&delete i[n];t.style.cssText=a.join(i)},e.HSVToRGB=function(t,e,i){var o,n,s,r=Math.floor(6*t),a=6*t-r,h=i*(1-e),d=i*(1-a*e),l=i*(1-(1-a)*e);switch(r%6){case 0:o=i,n=l,s=h;break;case 1:o=d,n=i,s=h;break;case 2:o=h,n=i,s=l;break;case 3:o=h,n=d,s=i;break;case 4:o=l,n=h,s=i;break;case 5:o=i,n=h,s=d}return{r:Math.floor(255*o),g:Math.floor(255*n),b:Math.floor(255*s)}},e.HSVToHex=function(t,i,o){var n=e.HSVToRGB(t,i,o);return e.RGBToHex(n.r,n.g,n.b)},e.hexToHSV=function(t){var i=e.hexToRGB(t);return e.RGBToHSV(i.r,i.g,i.b)},e.isValidHex=function(t){var e=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t);return e},e.isValidRGB=function(t){t=t.replace(" ","");var e=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/i.test(t);return e},e.isValidRGBA=function(t){t=t.replace(" ","");var e=/rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(.{1,3})\)/i.test(t);return e},e.selectiveBridgeObject=function(t,i){if("object"==("undefined"==typeof i?"undefined":o(i))){for(var n=Object.create(i),s=0;s0&&e(o,t[n-1])<0;n--)t[n]=t[n-1];t[n]=o}return t},e.mergeOptions=function(t,e,i){var o=(arguments.length>3&&void 0!==arguments[3]&&arguments[3],arguments.length>4&&void 0!==arguments[4]?arguments[4]:{});if(null===e[i])t[i]=Object.create(o[i]);else if(void 0!==e[i])if("boolean"==typeof e[i])t[i].enabled=e[i];else{void 0===e[i].enabled&&(t[i].enabled=!0);for(var n in e[i])e[i].hasOwnProperty(n)&&(t[i][n]=e[i][n])}},e.binarySearchCustom=function(t,e,i,o){for(var n=1e4,s=0,r=0,a=t.length-1;r<=a&&s0)return"before"==o?Math.max(0,h-1):h;if(n(r,e)<0&&n(a,e)>0)return"before"==o?h:Math.min(t.length-1,h+1);n(r,e)<0?c=h+1:u=h-1,l++}return-1},e.easingFunctions={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return t*(2-t)},easeInOutQuad:function(t){return t<.5?2*t*t:-1+(4-2*t)*t},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return--t*t*t+1},easeInOutCubic:function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return 1- --t*t*t*t},easeInOutQuart:function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return 1+--t*t*t*t*t},easeInOutQuint:function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t}},e.getScrollBarWidth=function(){var t=document.createElement("p");t.style.width="100%",t.style.height="200px";var e=document.createElement("div");e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.visibility="hidden",e.style.width="200px",e.style.height="150px",e.style.overflow="hidden",e.appendChild(t),document.body.appendChild(e);var i=t.offsetWidth;e.style.overflow="scroll";var o=t.offsetWidth;return i==o&&(o=e.clientWidth),document.body.removeChild(e),i-o}},function(t,e,i){t.exports="undefined"!=typeof window&&window.moment||i(3)},function(t,e,i){(function(t){!function(e,i){t.exports=i()}(this,function(){function e(){return fo.apply(null,arguments)}function i(t){fo=t}function o(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function n(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function s(t){var e;for(e in t)return!1;return!0}function r(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function a(t,e){var i,o=[];for(i=0;i0)for(i in vo)o=vo[i],n=e[o],m(n)||(t[o]=n);return t}function g(t){v(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),go===!1&&(go=!0,e.updateOffset(this),go=!1)}function y(t){return t instanceof g||null!=t&&null!=t._isAMomentObject}function b(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function _(t){var e=+t,i=0;return 0!==e&&isFinite(e)&&(i=b(e)),i}function w(t,e,i){var o,n=Math.min(t.length,e.length),s=Math.abs(t.length-e.length),r=0;for(o=0;o0?"future":"past"];return D(i)?i(e):i.replace(/%s/i,e)}function L(t,e){var i=t.toLowerCase();Co[i]=Co[i+"s"]=Co[e]=t}function z(t){return"string"==typeof t?Co[t]||Co[t.toLowerCase()]:void 0}function A(t){var e,i,o={};for(i in t)h(t,i)&&(e=z(i),e&&(o[e]=t[i]));return o}function B(t,e){To[t]=e}function j(t){var e=[];for(var i in t)e.push({unit:i,priority:To[i]});return e.sort(function(t,e){return t.priority-e.priority}),e}function F(t,i){return function(o){return null!=o?(W(this,t,o),e.updateOffset(this,i),this):H(this,t)}}function H(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function W(t,e,i){t.isValid()&&t._d["set"+(t._isUTC?"UTC":"")+e](i)}function Y(t){return t=z(t),D(this[t])?this[t]():this}function G(t,e){if("object"==typeof t){t=A(t);for(var i=j(t),o=0;o=0;return(s?i?"+":"":"-")+Math.pow(10,Math.max(0,n)).toString().substr(1)+o}function U(t,e,i,o){var n=o;"string"==typeof o&&(n=function(){return this[o]()}),t&&(Io[t]=n),e&&(Io[e[0]]=function(){return V(n.apply(this,arguments),e[1],e[2])}),i&&(Io[i]=function(){return this.localeData().ordinal(n.apply(this,arguments),t)})}function q(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function X(t){var e,i,o=t.match(Eo);for(e=0,i=o.length;e=0&&Mo.test(t);)t=t.replace(Mo,i),Mo.lastIndex=0,o-=1;return t}function J(t,e,i){Ko[t]=D(e)?e:function(t,o){return t&&i?i:e}}function Q(t,e){return h(Ko,t)?Ko[t](e._strict,e._locale):new RegExp($(t))}function $(t){return tt(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,i,o,n){return e||i||o||n}))}function tt(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function et(t,e){var i,o=e;for("string"==typeof t&&(t=[t]),"number"==typeof e&&(o=function(t,i){i[e]=_(t)}),i=0;i=0&&isFinite(a.getFullYear())&&a.setFullYear(t),a}function bt(t){var e=new Date(Date.UTC.apply(null,arguments));return t<100&&t>=0&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function _t(t,e,i){var o=7+e-i,n=(7+bt(t,0,o).getUTCDay()-e)%7;return-n+o-1}function wt(t,e,i,o,n){var s,r,a=(7+i-o)%7,h=_t(t,o,n),d=1+7*(e-1)+a+h;return d<=0?(s=t-1,r=mt(s)+d):d>mt(t)?(s=t+1,r=d-mt(t)):(s=t,r=d),{year:s,dayOfYear:r}}function xt(t,e,i){var o,n,s=_t(t.year(),e,i),r=Math.floor((t.dayOfYear()-s-1)/7)+1;return r<1?(n=t.year()-1,o=r+kt(n,e,i)):r>kt(t.year(),e,i)?(o=r-kt(t.year(),e,i),n=t.year()+1):(n=t.year(),o=r),{week:o,year:n}}function kt(t,e,i){var o=_t(t,e,i),n=_t(t+1,e,i);return(mt(t)-o+n)/7}function Ot(t){return xt(t,this._week.dow,this._week.doy).week}function Dt(){return this._week.dow}function St(){return this._week.doy}function Ct(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function Tt(t){var e=xt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function Et(t,e){return"string"!=typeof t?t:isNaN(t)?(t=e.weekdaysParse(t),"number"==typeof t?t:null):parseInt(t,10)}function Mt(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function Pt(t,e){return t?o(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(e)?"format":"standalone"][t.day()]:this._weekdays}function It(t){return t?this._weekdaysShort[t.day()]:this._weekdaysShort}function Nt(t){return t?this._weekdaysMin[t.day()]:this._weekdaysMin}function Rt(t,e,i){var o,n,s,r=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],o=0;o<7;++o)s=l([2e3,1]).day(o),this._minWeekdaysParse[o]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[o]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[o]=this.weekdays(s,"").toLocaleLowerCase();return i?"dddd"===e?(n=_o.call(this._weekdaysParse,r),n!==-1?n:null):"ddd"===e?(n=_o.call(this._shortWeekdaysParse,r),n!==-1?n:null):(n=_o.call(this._minWeekdaysParse,r),n!==-1?n:null):"dddd"===e?(n=_o.call(this._weekdaysParse,r),n!==-1?n:(n=_o.call(this._shortWeekdaysParse,r),n!==-1?n:(n=_o.call(this._minWeekdaysParse,r),n!==-1?n:null))):"ddd"===e?(n=_o.call(this._shortWeekdaysParse,r),n!==-1?n:(n=_o.call(this._weekdaysParse,r),n!==-1?n:(n=_o.call(this._minWeekdaysParse,r),n!==-1?n:null))):(n=_o.call(this._minWeekdaysParse,r),n!==-1?n:(n=_o.call(this._weekdaysParse,r),n!==-1?n:(n=_o.call(this._shortWeekdaysParse,r),n!==-1?n:null)))}function Lt(t,e,i){var o,n,s;if(this._weekdaysParseExact)return Rt.call(this,t,e,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),o=0;o<7;o++){if(n=l([2e3,1]).day(o),i&&!this._fullWeekdaysParse[o]&&(this._fullWeekdaysParse[o]=new RegExp("^"+this.weekdays(n,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[o]=new RegExp("^"+this.weekdaysShort(n,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[o]=new RegExp("^"+this.weekdaysMin(n,"").replace(".",".?")+"$","i")),this._weekdaysParse[o]||(s="^"+this.weekdays(n,"")+"|^"+this.weekdaysShort(n,"")+"|^"+this.weekdaysMin(n,""),this._weekdaysParse[o]=new RegExp(s.replace(".",""),"i")),i&&"dddd"===e&&this._fullWeekdaysParse[o].test(t))return o;if(i&&"ddd"===e&&this._shortWeekdaysParse[o].test(t))return o;if(i&&"dd"===e&&this._minWeekdaysParse[o].test(t))return o;if(!i&&this._weekdaysParse[o].test(t))return o}}function zt(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=Et(t,this.localeData()),this.add(t-e,"d")):e}function At(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function Bt(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=Mt(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7}function jt(t){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||Wt.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(h(this,"_weekdaysRegex")||(this._weekdaysRegex=yn),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function Ft(t){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||Wt.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(h(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=bn),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Ht(t){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||Wt.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(h(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=_n),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Wt(){function t(t,e){return e.length-t.length}var e,i,o,n,s,r=[],a=[],h=[],d=[];for(e=0;e<7;e++)i=l([2e3,1]).day(e),o=this.weekdaysMin(i,""),n=this.weekdaysShort(i,""),s=this.weekdays(i,""),r.push(o),a.push(n),h.push(s),d.push(o),d.push(n),d.push(s);for(r.sort(t),a.sort(t),h.sort(t),d.sort(t),e=0;e<7;e++)a[e]=tt(a[e]),h[e]=tt(h[e]),d[e]=tt(d[e]);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 Yt(){return this.hours()%12||12}function Gt(){return this.hours()||24}function Vt(t,e){U(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function Ut(t,e){return e._meridiemParse}function qt(t){return"p"===(t+"").toLowerCase().charAt(0)}function Xt(t,e,i){return t>11?i?"pm":"PM":i?"am":"AM"}function Zt(t){return t?t.toLowerCase().replace("_","-"):t}function Kt(t){for(var e,i,o,n,s=0;s0;){if(o=Jt(n.slice(0,e).join("-")))return o;if(i&&i.length>=e&&w(n,i,!0)>=e-1)break;e--}s++}return null}function Jt(e){var i=null;if(!Dn[e]&&"undefined"!=typeof t&&t&&t.exports)try{i=wn._abbr,!function(){var t=new Error('Cannot find module "./locale"');throw t.code="MODULE_NOT_FOUND",t}(),Qt(i)}catch(t){}return Dn[e]}function Qt(t,e){var i;return t&&(i=m(e)?ee(t):$t(t,e),i&&(wn=i)),wn._abbr}function $t(t,e){if(null!==e){var i=On;return e.abbr=t,null!=Dn[t]?(O("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=Dn[t]._config):null!=e.parentLocale&&(null!=Dn[e.parentLocale]?i=Dn[e.parentLocale]._config:O("parentLocaleUndefined","specified parentLocale is not defined yet. See http://momentjs.com/guides/#/warnings/parent-locale/")),Dn[t]=new T(C(i,e)),Qt(t),Dn[t]}return delete Dn[t],null}function te(t,e){if(null!=e){var i,o=On;null!=Dn[t]&&(o=Dn[t]._config),e=C(o,e),i=new T(e),i.parentLocale=Dn[t],Dn[t]=i,Qt(t)}else null!=Dn[t]&&(null!=Dn[t].parentLocale?Dn[t]=Dn[t].parentLocale:null!=Dn[t]&&delete Dn[t]);return Dn[t]}function ee(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return wn;if(!o(t)){if(e=Jt(t))return e;t=[t]}return Kt(t)}function ie(){return bo(Dn)}function oe(t){var e,i=t._a;return i&&u(t).overflow===-2&&(e=i[$o]<0||i[$o]>11?$o:i[tn]<1||i[tn]>nt(i[Qo],i[$o])?tn:i[en]<0||i[en]>24||24===i[en]&&(0!==i[on]||0!==i[nn]||0!==i[sn])?en:i[on]<0||i[on]>59?on:i[nn]<0||i[nn]>59?nn:i[sn]<0||i[sn]>999?sn:-1,u(t)._overflowDayOfYear&&(etn)&&(e=tn),u(t)._overflowWeeks&&e===-1&&(e=rn),u(t)._overflowWeekday&&e===-1&&(e=an),u(t).overflow=e),t}function ne(t){var e,i,o,n,s,r,a=t._i,h=Sn.exec(a)||Cn.exec(a);if(h){for(u(t).iso=!0,e=0,i=En.length;emt(n)&&(u(t)._overflowDayOfYear=!0),i=bt(n,0,t._dayOfYear),t._a[$o]=i.getUTCMonth(),t._a[tn]=i.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=s[e]=o[e];for(;e<7;e++)t._a[e]=s[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[en]&&0===t._a[on]&&0===t._a[nn]&&0===t._a[sn]&&(t._nextDay=!0,t._a[en]=0),t._d=(t._useUTC?bt:yt).apply(null,s),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[en]=24)}}function de(t){var e,i,o,n,s,r,a,h;e=t._w,null!=e.GG||null!=e.W||null!=e.E?(s=1,r=4,i=re(e.GG,t._a[Qo],xt(ye(),1,4).year),o=re(e.W,1),n=re(e.E,1),(n<1||n>7)&&(h=!0)):(s=t._locale._week.dow,r=t._locale._week.doy,i=re(e.gg,t._a[Qo],xt(ye(),s,r).year),o=re(e.w,1),null!=e.d?(n=e.d,(n<0||n>6)&&(h=!0)):null!=e.e?(n=e.e+s,(e.e<0||e.e>6)&&(h=!0)):n=s),o<1||o>kt(i,s,r)?u(t)._overflowWeeks=!0:null!=h?u(t)._overflowWeekday=!0:(a=wt(i,o,n,s,r),t._a[Qo]=a.year,t._dayOfYear=a.dayOfYear)}function le(t){if(t._f===e.ISO_8601)return void ne(t);t._a=[],u(t).empty=!0;var i,o,n,s,r,a=""+t._i,h=a.length,d=0;for(n=K(t._f,t._locale).match(Eo)||[],i=0;i0&&u(t).unusedInput.push(r),a=a.slice(a.indexOf(o)+o.length),d+=o.length),Io[s]?(o?u(t).empty=!1:u(t).unusedTokens.push(s),ot(s,o,t)):t._strict&&!o&&u(t).unusedTokens.push(s);u(t).charsLeftOver=h-d,a.length>0&&u(t).unusedInput.push(a),t._a[en]<=12&&u(t).bigHour===!0&&t._a[en]>0&&(u(t).bigHour=void 0),u(t).parsedDateParts=t._a.slice(0),u(t).meridiem=t._meridiem,t._a[en]=ce(t._locale,t._a[en],t._meridiem),he(t),oe(t)}function ce(t,e,i){var o;return null==i?e:null!=t.meridiemHour?t.meridiemHour(e,i):null!=t.isPM?(o=t.isPM(i),o&&e<12&&(e+=12),o||12!==e||(e=0),e):e}function ue(t){var e,i,o,n,s;if(0===t._f.length)return u(t).invalidFormat=!0,void(t._d=new Date(NaN));for(n=0;nthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function ze(){if(!m(this._isDSTShifted))return this._isDSTShifted;var t={};if(v(t,this),t=me(t),t._a){var e=t._isUTC?l(t._a):ye(t._a);this._isDSTShifted=this.isValid()&&w(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Ae(){return!!this.isValid()&&!this._isUTC}function Be(){return!!this.isValid()&&this._isUTC}function je(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function Fe(t,e){var i,o,n,s=t,r=null;return ke(t)?s={ms:t._milliseconds,d:t._days,M:t._months}:"number"==typeof t?(s={},e?s[e]=t:s.milliseconds=t):(r=zn.exec(t))?(i="-"===r[1]?-1:1,s={y:0,d:_(r[tn])*i,h:_(r[en])*i,m:_(r[on])*i,s:_(r[nn])*i,ms:_(Oe(1e3*r[sn]))*i}):(r=An.exec(t))?(i="-"===r[1]?-1:1,s={y:He(r[2],i),M:He(r[3],i),w:He(r[4],i),d:He(r[5],i),h:He(r[6],i),m:He(r[7],i),s:He(r[8],i)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(n=Ye(ye(s.from),ye(s.to)),s={},s.ms=n.milliseconds,s.M=n.months),o=new xe(s),ke(t)&&h(t,"_locale")&&(o._locale=t._locale),o}function He(t,e){var i=t&&parseFloat(t.replace(",","."));return(isNaN(i)?0:i)*e}function We(t,e){var i={milliseconds:0,months:0};return i.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(i.months,"M").isAfter(e)&&--i.months,i.milliseconds=+e-+t.clone().add(i.months,"M"),i}function Ye(t,e){var i;return t.isValid()&&e.isValid()?(e=Ce(e,t),t.isBefore(e)?i=We(t,e):(i=We(e,t),i.milliseconds=-i.milliseconds,i.months=-i.months),i):{milliseconds:0,months:0}}function Ge(t,e){return function(i,o){var n,s;return null===o||isNaN(+o)||(O(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),s=i,i=o,o=s),i="string"==typeof i?+i:i,n=Fe(i,o),Ve(this,n,t),this}}function Ve(t,i,o,n){var s=i._milliseconds,r=Oe(i._days),a=Oe(i._months);t.isValid()&&(n=null==n||n,s&&t._d.setTime(t._d.valueOf()+s*o),r&&W(t,"Date",H(t,"Date")+r*o),a&&dt(t,H(t,"Month")+a*o),n&&e.updateOffset(t,r||a))}function Ue(t,e){var i=t.diff(e,"days",!0);return i<-6?"sameElse":i<-1?"lastWeek":i<0?"lastDay":i<1?"sameDay":i<2?"nextDay":i<7?"nextWeek":"sameElse"}function qe(t,i){var o=t||ye(),n=Ce(o,this).startOf("day"),s=e.calendarFormat(this,n)||"sameElse",r=i&&(D(i[s])?i[s].call(this,o):i[s]);return this.format(r||this.localeData().calendar(s,this,ye(o)))}function Xe(){return new g(this)}function Ze(t,e){var i=y(t)?t:ye(t);return!(!this.isValid()||!i.isValid())&&(e=z(m(e)?"millisecond":e),"millisecond"===e?this.valueOf()>i.valueOf():i.valueOf()s&&(e=s),Mi.call(this,t,e,i,o,n))}function Mi(t,e,i,o,n){var s=wt(t,e,i,o,n),r=bt(s.year,0,s.dayOfYear);return this.year(r.getUTCFullYear()),this.month(r.getUTCMonth()),this.date(r.getUTCDate()),this}function Pi(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}function Ii(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function Ni(t,e){e[sn]=_(1e3*("0."+t))}function Ri(){return this._isUTC?"UTC":""}function Li(){return this._isUTC?"Coordinated Universal Time":""}function zi(t){return ye(1e3*t)}function Ai(){return ye.apply(null,arguments).parseZone()}function Bi(t){return t}function ji(t,e,i,o){var n=ee(),s=l().set(o,e);return n[i](s,t)}function Fi(t,e,i){if("number"==typeof t&&(e=t,t=void 0),t=t||"",null!=e)return ji(t,e,i,"month");var o,n=[];for(o=0;o<12;o++)n[o]=ji(t,o,i,"month");return n}function Hi(t,e,i,o){"boolean"==typeof t?("number"==typeof e&&(i=e,e=void 0),e=e||""):(e=t,i=e,t=!1,"number"==typeof e&&(i=e,e=void 0),e=e||"");var n=ee(),s=t?n._week.dow:0;if(null!=i)return ji(e,(i+s)%7,o,"day");var r,a=[];for(r=0;r<7;r++)a[r]=ji(e,(r+s)%7,o,"day");return a}function Wi(t,e){return Fi(t,e,"months")}function Yi(t,e){return Fi(t,e,"monthsShort")}function Gi(t,e,i){return Hi(t,e,i,"weekdays")}function Vi(t,e,i){return Hi(t,e,i,"weekdaysShort")}function Ui(t,e,i){return Hi(t,e,i,"weekdaysMin")}function qi(){var t=this._data;return this._milliseconds=Zn(this._milliseconds),this._days=Zn(this._days),this._months=Zn(this._months),t.milliseconds=Zn(t.milliseconds),t.seconds=Zn(t.seconds),t.minutes=Zn(t.minutes),t.hours=Zn(t.hours),t.months=Zn(t.months),t.years=Zn(t.years),this}function Xi(t,e,i,o){var n=Fe(e,i);return t._milliseconds+=o*n._milliseconds,t._days+=o*n._days,t._months+=o*n._months,t._bubble()}function Zi(t,e){return Xi(this,t,e,1)}function Ki(t,e){return Xi(this,t,e,-1)}function Ji(t){return t<0?Math.floor(t):Math.ceil(t)}function Qi(){var t,e,i,o,n,s=this._milliseconds,r=this._days,a=this._months,h=this._data;return s>=0&&r>=0&&a>=0||s<=0&&r<=0&&a<=0||(s+=864e5*Ji(to(a)+r),r=0,a=0),h.milliseconds=s%1e3,t=b(s/1e3),h.seconds=t%60,e=b(t/60),h.minutes=e%60,i=b(e/60),h.hours=i%24,r+=b(i/24),n=b($i(r)),a+=n,r-=Ji(to(n)),o=b(a/12),a%=12,h.days=r,h.months=a,h.years=o,this}function $i(t){return 4800*t/146097}function to(t){return 146097*t/4800}function eo(t){var e,i,o=this._milliseconds;if(t=z(t),"month"===t||"year"===t)return e=this._days+o/864e5,i=this._months+$i(e),"month"===t?i:i/12;switch(e=this._days+Math.round(to(this._months)),t){case"week":return e/7+o/6048e5;case"day":return e+o/864e5;case"hour":return 24*e+o/36e5;case"minute":return 1440*e+o/6e4;case"second":return 86400*e+o/1e3;case"millisecond":return Math.floor(864e5*e)+o;default:throw new Error("Unknown unit "+t)}}function io(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*_(this._months/12)}function oo(t){return function(){return this.as(t)}}function no(t){return t=z(t),this[t+"s"]()}function so(t){return function(){return this._data[t]}}function ro(){return b(this.days()/7)}function ao(t,e,i,o,n){return n.relativeTime(e||1,!!i,t,o)}function ho(t,e,i){var o=Fe(t).abs(),n=cs(o.as("s")),s=cs(o.as("m")),r=cs(o.as("h")),a=cs(o.as("d")),h=cs(o.as("M")),d=cs(o.as("y")),l=n0,l[4]=i,ao.apply(null,l)}function lo(t){return void 0===t?cs:"function"==typeof t&&(cs=t,!0)}function co(t,e){return void 0!==us[t]&&(void 0===e?us[t]:(us[t]=e,!0))}function uo(t){var e=this.localeData(),i=ho(this,!t,e);return t&&(i=e.pastFuture(+this,i)),e.postformat(i)}function po(){var t,e,i,o=ps(this._milliseconds)/1e3,n=ps(this._days),s=ps(this._months);t=b(o/60),e=b(t/60),o%=60,t%=60,i=b(s/12),s%=12;var r=i,a=s,h=n,d=e,l=t,c=o,u=this.asSeconds();return u?(u<0?"-":"")+"P"+(r?r+"Y":"")+(a?a+"M":"")+(h?h+"D":"")+(d||l||c?"T":"")+(d?d+"H":"")+(l?l+"M":"")+(c?c+"S":""):"P0D"}var fo,mo;mo=Array.prototype.some?Array.prototype.some:function(t){for(var e=Object(this),i=e.length>>>0,o=0;o68?1900:2e3)};var pn=F("FullYear",!0);U("w",["ww",2],"wo","week"),U("W",["WW",2],"Wo","isoWeek"),L("week","w"),L("isoWeek","W"),B("week",5),B("isoWeek",5),J("w",Bo),J("ww",Bo,Ro),J("W",Bo),J("WW",Bo,Ro),it(["w","ww","W","WW"],function(t,e,i,o){e[o.substr(0,1)]=_(t)});var fn={dow:0,doy:6};U("d",0,"do","day"),U("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),U("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),U("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),U("e",0,0,"weekday"),U("E",0,0,"isoWeekday"),L("day","d"),L("weekday","e"),L("isoWeekday","E"),B("day",11),B("weekday",11),B("isoWeekday",11),J("d",Bo),J("e",Bo),J("E",Bo),J("dd",function(t,e){return e.weekdaysMinRegex(t)}),J("ddd",function(t,e){return e.weekdaysShortRegex(t)}),J("dddd",function(t,e){return e.weekdaysRegex(t)}),it(["dd","ddd","dddd"],function(t,e,i,o){var n=i._locale.weekdaysParse(t,o,i._strict);null!=n?e.d=n:u(i).invalidWeekday=t}),it(["d","e","E"],function(t,e,i,o){e[o]=_(t)});var mn="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),vn="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),gn="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),yn=Zo,bn=Zo,_n=Zo;U("H",["HH",2],0,"hour"),U("h",["hh",2],0,Yt),U("k",["kk",2],0,Gt),U("hmm",0,0,function(){return""+Yt.apply(this)+V(this.minutes(),2)}),U("hmmss",0,0,function(){return""+Yt.apply(this)+V(this.minutes(),2)+V(this.seconds(),2)}),U("Hmm",0,0,function(){return""+this.hours()+V(this.minutes(),2)}),U("Hmmss",0,0,function(){return""+this.hours()+V(this.minutes(),2)+V(this.seconds(),2)}),Vt("a",!0),Vt("A",!1),L("hour","h"),B("hour",13),J("a",Ut),J("A",Ut),J("H",Bo),J("h",Bo),J("HH",Bo,Ro),J("hh",Bo,Ro),J("hmm",jo),J("hmmss",Fo),J("Hmm",jo),J("Hmmss",Fo),et(["H","HH"],en),et(["a","A"],function(t,e,i){i._isPm=i._locale.isPM(t),i._meridiem=t}),et(["h","hh"],function(t,e,i){e[en]=_(t),u(i).bigHour=!0}),et("hmm",function(t,e,i){var o=t.length-2;e[en]=_(t.substr(0,o)),e[on]=_(t.substr(o)),u(i).bigHour=!0}),et("hmmss",function(t,e,i){var o=t.length-4,n=t.length-2;e[en]=_(t.substr(0,o)),e[on]=_(t.substr(o,2)),e[nn]=_(t.substr(n)),u(i).bigHour=!0}),et("Hmm",function(t,e,i){var o=t.length-2;e[en]=_(t.substr(0,o)),e[on]=_(t.substr(o))}),et("Hmmss",function(t,e,i){var o=t.length-4,n=t.length-2;e[en]=_(t.substr(0,o)),e[on]=_(t.substr(o,2)),e[nn]=_(t.substr(n))});var wn,xn=/[ap]\.?m?\.?/i,kn=F("Hours",!0),On={calendar:wo,longDateFormat:xo,invalidDate:ko,ordinal:Oo,ordinalParse:Do,relativeTime:So,months:dn,monthsShort:ln,week:fn,weekdays:mn,weekdaysMin:gn,weekdaysShort:vn,meridiemParse:xn},Dn={},Sn=/^\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)?)?/,Cn=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Tn=/Z|[+-]\d\d(?::?\d\d)?/,En=[["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}/]],Mn=[["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/]],Pn=/^\/?Date\((\-?\d+)/i;e.createFromInputFallback=k("value provided is not in a recognized ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non 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(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),e.ISO_8601=function(){};var In=k("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=ye.apply(null,arguments);return this.isValid()&&t.isValid()?tthis?this:t:f()}),Rn=function(){return Date.now?Date.now():+new Date};De("Z",":"),De("ZZ",""),J("Z",qo),J("ZZ",qo),et(["Z","ZZ"],function(t,e,i){i._useUTC=!0,i._tzm=Se(qo,t)});var Ln=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var zn=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,An=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;Fe.fn=xe.prototype;var Bn=Ge(1,"add"),jn=Ge(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Fn=k("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});U(0,["gg",2],0,function(){return this.weekYear()%100}),U(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Oi("gggg","weekYear"),Oi("ggggg","weekYear"),Oi("GGGG","isoWeekYear"),Oi("GGGGG","isoWeekYear"),L("weekYear","gg"),L("isoWeekYear","GG"),B("weekYear",1),B("isoWeekYear",1),J("G",Vo),J("g",Vo),J("GG",Bo,Ro),J("gg",Bo,Ro),J("GGGG",Wo,zo),J("gggg",Wo,zo),J("GGGGG",Yo,Ao),J("ggggg",Yo,Ao),it(["gggg","ggggg","GGGG","GGGGG"],function(t,e,i,o){e[o.substr(0,2)]=_(t)}),it(["gg","GG"],function(t,i,o,n){i[n]=e.parseTwoDigitYear(t)}),U("Q",0,"Qo","quarter"),L("quarter","Q"),B("quarter",7),J("Q",No),et("Q",function(t,e){e[$o]=3*(_(t)-1)}),U("D",["DD",2],"Do","date"),L("date","D"),B("date",9),J("D",Bo),J("DD",Bo,Ro),J("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),et(["D","DD"],tn),et("Do",function(t,e){e[tn]=_(t.match(Bo)[0],10)});var Hn=F("Date",!0);U("DDD",["DDDD",3],"DDDo","dayOfYear"),L("dayOfYear","DDD"),B("dayOfYear",4),J("DDD",Ho),J("DDDD",Lo),et(["DDD","DDDD"],function(t,e,i){i._dayOfYear=_(t)}),U("m",["mm",2],0,"minute"),L("minute","m"),B("minute",14),J("m",Bo),J("mm",Bo,Ro),et(["m","mm"],on);var Wn=F("Minutes",!1);U("s",["ss",2],0,"second"),L("second","s"),B("second",15),J("s",Bo),J("ss",Bo,Ro),et(["s","ss"],nn);var Yn=F("Seconds",!1);U("S",0,0,function(){return~~(this.millisecond()/100)}),U(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),U(0,["SSS",3],0,"millisecond"),U(0,["SSSS",4],0,function(){return 10*this.millisecond()}),U(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),U(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),U(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),U(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),U(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),L("millisecond","ms"),B("millisecond",16),J("S",Ho,No),J("SS",Ho,Ro),J("SSS",Ho,Lo);var Gn;for(Gn="SSSS";Gn.length<=9;Gn+="S")J(Gn,Go);for(Gn="S";Gn.length<=9;Gn+="S")et(Gn,Ni);var Vn=F("Milliseconds",!1);U("z",0,0,"zoneAbbr"),U("zz",0,0,"zoneName");var Un=g.prototype;Un.add=Bn,Un.calendar=qe,Un.clone=Xe,Un.diff=ei,Un.endOf=pi,Un.format=si,Un.from=ri,Un.fromNow=ai,Un.to=hi,Un.toNow=di,Un.get=Y,Un.invalidAt=xi,Un.isAfter=Ze,Un.isBefore=Ke,Un.isBetween=Je,Un.isSame=Qe,Un.isSameOrAfter=$e,Un.isSameOrBefore=ti,Un.isValid=_i,Un.lang=Fn,Un.locale=li,Un.localeData=ci,Un.max=Nn,Un.min=In,Un.parsingFlags=wi,Un.set=G,Un.startOf=ui,Un.subtract=jn,Un.toArray=gi,Un.toObject=yi,Un.toDate=vi,Un.toISOString=ni,Un.toJSON=bi,Un.toString=oi,Un.unix=mi,Un.valueOf=fi,Un.creationData=ki,Un.year=pn,Un.isLeapYear=gt,Un.weekYear=Di,Un.isoWeekYear=Si,Un.quarter=Un.quarters=Pi,Un.month=lt,Un.daysInMonth=ct,Un.week=Un.weeks=Ct,Un.isoWeek=Un.isoWeeks=Tt,Un.weeksInYear=Ti,Un.isoWeeksInYear=Ci,Un.date=Hn,Un.day=Un.days=zt,Un.weekday=At,Un.isoWeekday=Bt,Un.dayOfYear=Ii,Un.hour=Un.hours=kn,Un.minute=Un.minutes=Wn,Un.second=Un.seconds=Yn,Un.millisecond=Un.milliseconds=Vn,Un.utcOffset=Ee,Un.utc=Pe,Un.local=Ie,Un.parseZone=Ne,Un.hasAlignedHourOffset=Re,Un.isDST=Le,Un.isLocal=Ae,Un.isUtcOffset=Be,Un.isUtc=je,Un.isUTC=je,Un.zoneAbbr=Ri,Un.zoneName=Li,Un.dates=k("dates accessor is deprecated. Use date instead.",Hn),Un.months=k("months accessor is deprecated. Use month instead",lt),Un.years=k("years accessor is deprecated. Use year instead",pn),Un.zone=k("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Me),Un.isDSTShifted=k("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",ze);var qn=Un,Xn=T.prototype;Xn.calendar=E,Xn.longDateFormat=M,Xn.invalidDate=P,Xn.ordinal=I,Xn.preparse=Bi,Xn.postformat=Bi,Xn.relativeTime=N,Xn.pastFuture=R,Xn.set=S,Xn.months=st,Xn.monthsShort=rt,Xn.monthsParse=ht,Xn.monthsRegex=pt,Xn.monthsShortRegex=ut,Xn.week=Ot,Xn.firstDayOfYear=St,Xn.firstDayOfWeek=Dt,Xn.weekdays=Pt,Xn.weekdaysMin=Nt,Xn.weekdaysShort=It,Xn.weekdaysParse=Lt,Xn.weekdaysRegex=jt,Xn.weekdaysShortRegex=Ft,Xn.weekdaysMinRegex=Ht,Xn.isPM=qt,Xn.meridiem=Xt,Qt("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,i=1===_(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+i}}),e.lang=k("moment.lang is deprecated. Use moment.locale instead.",Qt),e.langData=k("moment.langData is deprecated. Use moment.localeData instead.",ee);var Zn=Math.abs,Kn=oo("ms"),Jn=oo("s"),Qn=oo("m"),$n=oo("h"),ts=oo("d"),es=oo("w"),is=oo("M"),os=oo("y"),ns=so("milliseconds"),ss=so("seconds"),rs=so("minutes"),as=so("hours"),hs=so("days"),ds=so("months"),ls=so("years"),cs=Math.round,us={s:45,m:45,h:22,d:26,M:11},ps=Math.abs,fs=xe.prototype;fs.abs=qi,fs.add=Zi,fs.subtract=Ki,fs.as=eo,fs.asMilliseconds=Kn,fs.asSeconds=Jn,fs.asMinutes=Qn,fs.asHours=$n,fs.asDays=ts,fs.asWeeks=es,fs.asMonths=is,fs.asYears=os,fs.valueOf=io,fs._bubble=Qi,fs.get=no,fs.milliseconds=ns,fs.seconds=ss,fs.minutes=rs,fs.hours=as,fs.days=hs,fs.weeks=ro,fs.months=ds,fs.years=ls,fs.humanize=uo,fs.toISOString=po,fs.toString=po,fs.toJSON=po,fs.locale=li,fs.localeData=ci,fs.toIsoString=k("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",po),fs.lang=Fn,U("X",0,0,"unix"),U("x",0,0,"valueOf"),J("x",Vo),J("X",Xo),et("X",function(t,e,i){i._d=new Date(1e3*parseFloat(t,10))}),et("x",function(t,e,i){i._d=new Date(_(t))}),e.version="2.15.2",i(ye),e.fn=qn,e.min=_e,e.max=we,e.now=Rn,e.utc=l,e.unix=zi,e.months=Wi,e.isDate=r,e.locale=Qt,e.invalid=f,e.duration=Fe,e.isMoment=y,e.weekdays=Gi,e.parseZone=Ai,e.localeData=ee,e.isDuration=ke,e.monthsShort=Yi,e.weekdaysMin=Ui,e.defineLocale=$t,e.updateLocale=te,e.locales=ie,e.weekdaysShort=Vi,e.normalizeUnits=z,e.relativeTimeRounding=lo,e.relativeTimeThreshold=co,e.calendarFormat=Ue,e.prototype=qn;var ms=e;return ms})}).call(e,i(4)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e){function i(t){throw new Error("Cannot find module '"+t+"'.")}i.keys=function(){return[]},i.resolve=i,t.exports=i,i.id=5},function(t,e){(function(e){function i(t,e,i){var o=e&&i||0,n=0;for(e=e||[],t.toLowerCase().replace(/[0-9a-f]{2}/g,function(t){n<16&&(e[o+n++]=c[t])});n<16;)e[o+n++]=0;return e}function o(t,e){var i=e||0,o=l;return o[t[i++]]+o[t[i++]]+o[t[i++]]+o[t[i++]]+"-"+o[t[i++]]+o[t[i++]]+"-"+o[t[i++]]+o[t[i++]]+"-"+o[t[i++]]+o[t[i++]]+"-"+o[t[i++]]+o[t[i++]]+o[t[i++]]+o[t[i++]]+o[t[i++]]+o[t[i++]]}function n(t,e,i){var n=e&&i||0,s=e||[];t=t||{};var r=void 0!==t.clockseq?t.clockseq:m,a=void 0!==t.msecs?t.msecs:(new Date).getTime(),h=void 0!==t.nsecs?t.nsecs:g+1,d=a-v+(h-g)/1e4;if(d<0&&void 0===t.clockseq&&(r=r+1&16383),(d<0||a>v)&&void 0===t.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");v=a,g=h,m=r,a+=122192928e5;var l=(1e4*(268435455&a)+h)%4294967296;s[n++]=l>>>24&255,s[n++]=l>>>16&255,s[n++]=l>>>8&255,s[n++]=255&l;var c=a/4294967296*1e4&268435455;s[n++]=c>>>8&255,s[n++]=255&c,s[n++]=c>>>24&15|16,s[n++]=c>>>16&255,s[n++]=r>>>8|128,s[n++]=255&r;for(var u=t.node||f,p=0;p<6;p++)s[n+p]=u[p];return e?e:o(s)}function s(t,e,i){var n=e&&i||0;"string"==typeof t&&(e="binary"==t?new Array(16):null, -t=null),t=t||{};var s=t.random||(t.rng||r)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,e)for(var a=0;a<16;a++)e[n+a]=s[a];return e||o(s)}var r,a="undefined"!=typeof window?window:"undefined"!=typeof e?e:null;if(a&&a.crypto&&crypto.getRandomValues){var h=new Uint8Array(16);r=function(){return crypto.getRandomValues(h),h}}if(!r){var d=new Array(16);r=function(){for(var t,e=0;e<16;e++)0===(3&e)&&(t=4294967296*Math.random()),d[e]=t>>>((3&e)<<3)&255;return d}}for(var l=[],c={},u=0;u<256;u++)l[u]=(u+256).toString(16).substr(1),c[l[u]]=u;var p=r(),f=[1|p[0],p[1],p[2],p[3],p[4],p[5]],m=16383&(p[6]<<8|p[7]),v=0,g=0,y=s;y.v1=n,y.v4=s,y.parse=i,y.unparse=o,t.exports=y}).call(e,function(){return this}())},function(t,e,i){e.util=i(1),e.DOMutil=i(8),e.DataSet=i(9),e.DataView=i(11),e.Queue=i(10),e.Graph3d=i(12),e.graph3d={Camera:i(16),Filter:i(17),Point2d:i(15),Point3d:i(14),Slider:i(18),StepNumber:i(19)},e.moment=i(2),e.Hammer=i(22),e.keycharm=i(25)},function(t,e){e.prepareElements=function(t){for(var e in t)t.hasOwnProperty(e)&&(t[e].redundant=t[e].used,t[e].used=[])},e.cleanupElements=function(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e].redundant){for(var i=0;i0?(o=e[t].redundant[0],e[t].redundant.shift()):(o=document.createElementNS("http://www.w3.org/2000/svg",t),i.appendChild(o)):(o=document.createElementNS("http://www.w3.org/2000/svg",t),e[t]={used:[],redundant:[]},i.appendChild(o)),e[t].used.push(o),o},e.getDOMElement=function(t,e,i,o){var n;return e.hasOwnProperty(t)?e[t].redundant.length>0?(n=e[t].redundant[0],e[t].redundant.shift()):(n=document.createElement(t),void 0!==o?i.insertBefore(n,o):i.appendChild(n)):(n=document.createElement(t),e[t]={used:[],redundant:[]},void 0!==o?i.insertBefore(n,o):i.appendChild(n)),e[t].used.push(n),n},e.drawPoint=function(t,i,o,n,s,r){var a;if("circle"==o.style?(a=e.getSVGElement("circle",n,s),a.setAttributeNS(null,"cx",t),a.setAttributeNS(null,"cy",i),a.setAttributeNS(null,"r",.5*o.size)):(a=e.getSVGElement("rect",n,s),a.setAttributeNS(null,"x",t-.5*o.size),a.setAttributeNS(null,"y",i-.5*o.size),a.setAttributeNS(null,"width",o.size),a.setAttributeNS(null,"height",o.size)),void 0!==o.styles&&a.setAttributeNS(null,"style",o.styles),a.setAttributeNS(null,"class",o.className+" vis-point"),r){var h=e.getSVGElement("text",n,s);r.xOffset&&(t+=r.xOffset),r.yOffset&&(i+=r.yOffset),r.content&&(h.textContent=r.content),r.className&&h.setAttributeNS(null,"class",r.className+" vis-label"),h.setAttributeNS(null,"x",t),h.setAttributeNS(null,"y",i)}return a},e.drawBar=function(t,i,o,n,s,r,a,h){if(0!=n){n<0&&(n*=-1,i-=n);var d=e.getSVGElement("rect",r,a);d.setAttributeNS(null,"x",t-.5*o),d.setAttributeNS(null,"y",i),d.setAttributeNS(null,"width",o),d.setAttributeNS(null,"height",n),d.setAttributeNS(null,"class",s),h&&d.setAttributeNS(null,"style",h)}}},function(t,e,i){function o(t,e){if(t&&!Array.isArray(t)&&(e=t,t=null),this._options=e||{},this._data={},this.length=0,this._fieldId=this._options.fieldId||"id",this._type={},this._options.type)for(var i=Object.keys(this._options.type),o=0,n=i.length;on?1:or)&&(s=h,r=d)}return s},o.prototype.min=function(t){var e,i,o=this._data,n=Object.keys(o),s=null,r=null;for(e=0,i=n.length;ethis.max&&this.flush(),clearTimeout(this._timeout),this.queue.length>0&&"number"==typeof this.delay){var t=this;this._timeout=setTimeout(function(){t.flush()},this.delay)}},i.prototype.flush=function(){for(;this._queue.length>0;){var t=this._queue.shift();t.fn.apply(t.context||t.fn,t.args||[])}},t.exports=i},function(t,e,i){function o(t,e){this._data=null,this._ids={},this.length=0,this._options=e||{},this._fieldId="id",this._subscribers={};var i=this;this.listener=function(){i._onEvent.apply(i,arguments)},this.setData(t)}var n=i(1),s=i(9);o.prototype.setData=function(t){var e,i,o,n,s;if(this._data){for(this._data.off&&this._data.off("*",this.listener),e=this._data.getIds({filter:this._options&&this._options.filter}),s=[],o=0,n=e.length;o0&&(h[n-1].pointNext=r),h.push(r);return h},o.prototype.create=function(){for(;this.containerElement.hasChildNodes();)this.containerElement.removeChild(this.containerElement.firstChild);this.frame=document.createElement("div"),this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas);var t=document.createElement("DIV");t.style.color="red",t.style.fontWeight="bold",t.style.padding="10px",t.innerHTML="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(t),this.frame.filter=document.createElement("div"),this.frame.filter.style.position="absolute",this.frame.filter.style.bottom="0px",this.frame.filter.style.left="0px",this.frame.filter.style.width="100%",this.frame.appendChild(this.frame.filter);var e=this,i=function(t){e._onMouseDown(t)},o=function(t){e._onTouchStart(t)},n=function(t){e._onWheel(t)},s=function(t){e._onTooltip(t)};d.addEventListener(this.frame.canvas,"keydown",onkeydown),d.addEventListener(this.frame.canvas,"mousedown",i),d.addEventListener(this.frame.canvas,"touchstart",o),d.addEventListener(this.frame.canvas,"mousewheel",n),d.addEventListener(this.frame.canvas,"mousemove",s),this.containerElement.appendChild(this.frame)},o.prototype.setSize=function(t,e){this.frame.style.width=t,this.frame.style.height=e,this._resizeCanvas()},o.prototype._resizeCanvas=function(){this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=this.frame.canvas.clientWidth,this.frame.canvas.height=this.frame.canvas.clientHeight,this.frame.filter.style.width=this.frame.canvas.clientWidth-20+"px"},o.prototype.animationStart=function(){if(!this.frame.filter||!this.frame.filter.slider)throw new Error("No animation available");this.frame.filter.slider.play()},o.prototype.animationStop=function(){this.frame.filter&&this.frame.filter.slider&&this.frame.filter.slider.stop()},o.prototype._resizeCenter=function(){"%"===this.xCenter.charAt(this.xCenter.length-1)?this.currentXCenter=parseFloat(this.xCenter)/100*this.frame.canvas.clientWidth:this.currentXCenter=parseFloat(this.xCenter),"%"===this.yCenter.charAt(this.yCenter.length-1)?this.currentYCenter=parseFloat(this.yCenter)/100*(this.frame.canvas.clientHeight-this.frame.filter.clientHeight):this.currentYCenter=parseFloat(this.yCenter)},o.prototype.getCameraPosition=function(){var t=this.camera.getArmRotation();return t.distance=this.camera.getArmLength(),t},o.prototype._readData=function(t){this._dataInitialize(t,this.style),this.dataFilter?this.dataPoints=this.dataFilter._getDataPoints():this.dataPoints=this._getDataPoints(this.dataTable),this._redrawFilter()},o.prototype.setData=function(t){this._readData(t),this.redraw(),this.animationAutoStart&&this.dataFilter&&this.animationStart()},o.prototype.setOptions=function(t){this.animationStop(),v.setOptions(t,this),this.setPointDrawingMethod(),this.setSize(this.width,this.height),this.dataTable&&this.setData(this.dataTable),this.animationAutoStart&&this.dataFilter&&this.animationStart()},o.prototype.setPointDrawingMethod=function(){var t=void 0;switch(this.style){case o.STYLE.BAR:t=o.prototype._redrawBarGraphPoint;break;case o.STYLE.BARCOLOR:t=o.prototype._redrawBarColorGraphPoint;break;case o.STYLE.BARSIZE:t=o.prototype._redrawBarSizeGraphPoint;break;case o.STYLE.DOT:t=o.prototype._redrawDotGraphPoint;break;case o.STYLE.DOTLINE:t=o.prototype._redrawDotLineGraphPoint;break;case o.STYLE.DOTCOLOR:t=o.prototype._redrawDotColorGraphPoint;break;case o.STYLE.DOTSIZE:t=o.prototype._redrawDotSizeGraphPoint;break;case o.STYLE.SURFACE:t=o.prototype._redrawSurfaceGraphPoint;break;case o.STYLE.GRID:t=o.prototype._redrawGridGraphPoint;break;case o.STYLE.LINE:t=o.prototype._redrawLineGraphPoint;break;default:throw new Error("Can not determine point drawing method for graph style '"+this.style+"'")}this._pointDrawingMethod=t},o.prototype.redraw=function(){if(void 0===this.dataPoints)throw new Error("Graph data not initialized");this._resizeCanvas(),this._resizeCenter(),this._redrawSlider(),this._redrawClear(),this._redrawAxis(),this._redrawDataGraph(),this._redrawInfo(),this._redrawLegend()},o.prototype._getContext=function(){var t=this.frame.canvas,e=t.getContext("2d");return e.lineJoin="round",e.lineCap="round",e},o.prototype._redrawClear=function(){var t=this.frame.canvas,e=t.getContext("2d");e.clearRect(0,0,t.width,t.height)},o.prototype._dotSize=function(){return this.frame.clientWidth*this.dotSizeRatio},o.prototype._getLegendWidth=function(){var t;if(this.style===o.STYLE.DOTSIZE){var e=this._dotSize();t=e/2+2*e}else t=this.style===o.STYLE.BARSIZE?this.xBarWidth:20;return t},o.prototype._redrawLegend=function(){if(this.showLegend===!0&&this.style!==o.STYLE.LINE&&this.style!==o.STYLE.BARSIZE){var t=this.style===o.STYLE.BARSIZE||this.style===o.STYLE.DOTSIZE,e=this.style===o.STYLE.DOTSIZE||this.style===o.STYLE.DOTCOLOR||this.style===o.STYLE.BARCOLOR,i=Math.max(.25*this.frame.clientHeight,100),n=this.margin,s=this._getLegendWidth(),r=this.frame.clientWidth-this.margin,a=r-s,h=n+i,d=this._getContext();if(d.lineWidth=1,d.font="14px arial",t===!1){var l,u=0,p=i;for(l=u;l0?(t.textAlign="center",t.textBaseline="top",s.y+=n):Math.sin(2*o)<0?(t.textAlign="right",t.textBaseline="middle"):(t.textAlign="left",t.textBaseline="middle"),t.fillStyle=this.axisColor,t.fillText(i,s.x,s.y)},o.prototype.drawAxisLabelY=function(t,e,i,o,n){void 0===n&&(n=0);var s=this._convert3Dto2D(e);Math.cos(2*o)<0?(t.textAlign="center",t.textBaseline="top",s.y+=n):Math.sin(2*o)>0?(t.textAlign="right",t.textBaseline="middle"):(t.textAlign="left",t.textBaseline="middle"),t.fillStyle=this.axisColor,t.fillText(i,s.x,s.y)},o.prototype.drawAxisLabelZ=function(t,e,i,o){void 0===o&&(o=0);var n=this._convert3Dto2D(e);t.textAlign="right",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(i,n.x-o,n.y)},o.prototype._line3d=function(t,e,i,o){var n=this._convert3Dto2D(e),s=this._convert3Dto2D(i);this._line(t,n,s,o)},o.prototype._redrawAxis=function(){var t,e,i,o,n,s,r,a,h,d,u,p=this._getContext();p.font=24/this.camera.getArmLength()+"px arial";var m=.025/this.scale.x,v=.025/this.scale.y,g=5/this.camera.getArmLength(),y=this.camera.getArmRotation().horizontal,b=new c(Math.cos(y),Math.sin(y)),_=this.xRange,w=this.yRange,x=this.zRange;for(p.lineWidth=1,o=void 0===this.defaultXStep,i=new f(_.min,_.max,this.xStep,o),i.start(!0);!i.end();){var k=i.getCurrent();this.showGrid?(t=new l(k,w.min,x.min),e=new l(k,w.max,x.min),this._line3d(p,t,e,this.gridColor)):(t=new l(k,w.min,x.min),e=new l(k,w.min+m,x.min),this._line3d(p,t,e,this.axisColor),t=new l(k,w.max,x.min),e=new l(k,w.max-m,x.min),this._line3d(p,t,e,this.axisColor)),r=b.x>0?w.min:w.max;var O=new l(k,r,x.min),D=" "+this.xValueLabel(k)+" ";this.drawAxisLabelX(p,O,D,y,g),i.next()}for(p.lineWidth=1,o=void 0===this.defaultYStep,i=new f(w.min,w.max,this.yStep,o),i.start(!0);!i.end();){var S=i.getCurrent();this.showGrid?(t=new l(_.min,S,x.min),e=new l(_.max,S,x.min),this._line3d(p,t,e,this.gridColor)):(t=new l(_.min,S,x.min),e=new l(_.min+v,S,x.min),this._line3d(p,t,e,this.axisColor),t=new l(_.max,S,x.min),e=new l(_.max-v,S,x.min),this._line3d(p,t,e,this.axisColor)),s=b.y>0?_.min:_.max,O=new l(s,S,x.min);var D=" "+this.yValueLabel(S)+" ";this.drawAxisLabelY(p,O,D,y,g),i.next()}for(p.lineWidth=1,o=void 0===this.defaultZStep,i=new f(x.min,x.max,this.zStep,o), -i.start(!0),s=b.x>0?_.min:_.max,r=b.y<0?w.min:w.max;!i.end();){var C=i.getCurrent(),T=new l(s,r,C),E=this._convert3Dto2D(T);e=new c(E.x-g,E.y),this._line(p,E,e,this.axisColor);var D=this.zValueLabel(C)+" ";this.drawAxisLabelZ(p,T,D,5),i.next()}p.lineWidth=1,t=new l(s,r,x.min),e=new l(s,r,x.max),this._line3d(p,t,e,this.axisColor);var M,P;p.lineWidth=1,M=new l(_.min,w.min,x.min),P=new l(_.max,w.min,x.min),this._line3d(p,M,P,this.axisColor),M=new l(_.min,w.max,x.min),P=new l(_.max,w.max,x.min),this._line3d(p,M,P,this.axisColor),p.lineWidth=1,t=new l(_.min,w.min,x.min),e=new l(_.min,w.max,x.min),this._line3d(p,t,e,this.axisColor),t=new l(_.max,w.min,x.min),e=new l(_.max,w.max,x.min),this._line3d(p,t,e,this.axisColor);var I=this.xLabel;I.length>0&&(u=.1/this.scale.y,s=_.center()/2,r=b.x>0?w.min-u:w.max+u,n=new l(s,r,x.min),this.drawAxisLabelX(p,n,I,y));var N=this.yLabel;N.length>0&&(d=.1/this.scale.x,s=b.y>0?_.min-d:_.max+d,r=w.center()/2,n=new l(s,r,x.min),this.drawAxisLabelY(p,n,N,y));var R=this.zLabel;R.length>0&&(h=30,s=b.x>0?_.min:_.max,r=b.y<0?w.min:w.max,a=x.center()/2,n=new l(s,r,a),this.drawAxisLabelZ(p,n,R,h))},o.prototype._hsv2rgb=function(t,e,i){var o,n,s,r,a,h;switch(r=i*e,a=Math.floor(t/60),h=r*(1-Math.abs(t/60%2-1)),a){case 0:o=r,n=h,s=0;break;case 1:o=h,n=r,s=0;break;case 2:o=0,n=r,s=h;break;case 3:o=0,n=h,s=r;break;case 4:o=h,n=0,s=r;break;case 5:o=r,n=0,s=h;break;default:o=0,n=0,s=0}return"RGB("+parseInt(255*o)+","+parseInt(255*n)+","+parseInt(255*s)+")"},o.prototype._getStrokeWidth=function(t){return void 0!==t?this.showPerspective?1/-t.trans.z*this.dataColor.strokeWidth:-(this.eye.z/this.camera.getArmLength())*this.dataColor.strokeWidth:this.dataColor.strokeWidth},o.prototype._redrawBar=function(t,e,i,o,n,s){var r,a,h=this,d=e.point,c=this.zRange.min,u=[{point:new l(d.x-i,d.y-o,d.z)},{point:new l(d.x+i,d.y-o,d.z)},{point:new l(d.x+i,d.y+o,d.z)},{point:new l(d.x-i,d.y+o,d.z)}],p=[{point:new l(d.x-i,d.y-o,c)},{point:new l(d.x+i,d.y-o,c)},{point:new l(d.x+i,d.y+o,c)},{point:new l(d.x-i,d.y+o,c)}];u.forEach(function(t){t.screen=h._convert3Dto2D(t.point)}),p.forEach(function(t){t.screen=h._convert3Dto2D(t.point)});var f=[{corners:u,center:l.avg(p[0].point,p[2].point)},{corners:[u[0],u[1],p[1],p[0]],center:l.avg(p[1].point,p[0].point)},{corners:[u[1],u[2],p[2],p[1]],center:l.avg(p[2].point,p[1].point)},{corners:[u[2],u[3],p[3],p[2]],center:l.avg(p[3].point,p[2].point)},{corners:[u[3],u[0],p[0],p[3]],center:l.avg(p[0].point,p[3].point)}];for(e.surfaces=f,r=0;r0}if(a){var p,f=(e.point.z+i.point.z+o.point.z+n.point.z)/4,m=240*(1-(f-this.zRange.min)*this.scale.z/this.verticalRatio),v=1;this.showShadow?(p=Math.min(1+c.x/u/2,1),s=this._hsv2rgb(m,v,p),r=s):(p=1,s=this._hsv2rgb(m,v,p),r=this.axisColor)}else s="gray",r=this.axisColor;t.lineWidth=this._getStrokeWidth(e);var g=[e,i,n,o];this._polygon(t,g,s,r)}},o.prototype._drawGridLine=function(t,e,i){if(void 0!==e&&void 0!==i){var o=(e.point.z+i.point.z)/2,n=240*(1-(o-this.zRange.min)*this.scale.z/this.verticalRatio);t.lineWidth=2*this._getStrokeWidth(e),t.strokeStyle=this._hsv2rgb(n,1,1),this._line(t,e.screen,i.screen)}},o.prototype._redrawGridGraphPoint=function(t,e){this._drawGridLine(t,e,e.pointRight),this._drawGridLine(t,e,e.pointTop)},o.prototype._redrawLineGraphPoint=function(t,e){void 0!==e.pointNext&&(t.lineWidth=this._getStrokeWidth(e),t.strokeStyle=this.dataColor.stroke,this._line(t,e.screen,e.pointNext.screen))},o.prototype._redrawDataGraph=function(){var t,e=this._getContext();if(!(void 0===this.dataPoints||this.dataPoints.length<=0))for(this._calcTranslations(this.dataPoints),t=0;t0?1:t<0?-1:0}var o=e[0],n=e[1],s=e[2],r=i((n.x-o.x)*(t.y-o.y)-(n.y-o.y)*(t.x-o.x)),a=i((s.x-n.x)*(t.y-n.y)-(s.y-n.y)*(t.x-n.x)),h=i((o.x-s.x)*(t.y-s.y)-(o.y-s.y)*(t.x-s.x));return!(0!=r&&0!=a&&r!=a||0!=a&&0!=h&&a!=h||0!=r&&0!=h&&r!=h)},o.prototype._dataPointFromXY=function(t,e){var i,n=100,s=null,r=null,a=null,h=new c(t,e);if(this.style===o.STYLE.BAR||this.style===o.STYLE.BARCOLOR||this.style===o.STYLE.BARSIZE)for(i=this.dataPoints.length-1;i>=0;i--){s=this.dataPoints[i];var d=s.surfaces;if(d)for(var l=d.length-1;l>=0;l--){var u=d[l],p=u.corners,f=[p[0].screen,p[1].screen,p[2].screen],m=[p[2].screen,p[3].screen,p[0].screen];if(this._insideTriangle(h,f)||this._insideTriangle(h,m))return s}}else for(i=0;i"+this.xLabel+":"+t.point.x+""+this.yLabel+":"+t.point.y+""+this.zLabel+":"+t.point.z+"",e.style.left="0",e.style.top="0",this.frame.appendChild(e),this.frame.appendChild(i),this.frame.appendChild(o);var n=e.offsetWidth,s=e.offsetHeight,r=i.offsetHeight,a=o.offsetWidth,h=o.offsetHeight,d=t.screen.x-n/2;d=Math.min(Math.max(d,10),this.frame.clientWidth-10-n),i.style.left=t.screen.x+"px",i.style.top=t.screen.y-r+"px",e.style.left=d+"px",e.style.top=t.screen.y-r-s+"px",o.style.left=t.screen.x-a/2+"px",o.style.top=t.screen.y-h/2+"px"},o.prototype._hideTooltip=function(){if(this.tooltip){this.tooltip.dataPoint=null;for(var t in this.tooltip.dom)if(this.tooltip.dom.hasOwnProperty(t)){var e=this.tooltip.dom[t];e&&e.parentNode&&e.parentNode.removeChild(e)}}},o.prototype.setCameraPosition=function(t){v.setCameraPosition(t,this),this.redraw()},t.exports=o},function(t,e){function i(t){if(t)return o(t)}function o(t){for(var e in i.prototype)t[e]=i.prototype[e];return t}t.exports=i,i.prototype.on=i.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks[t]=this._callbacks[t]||[]).push(e),this},i.prototype.once=function(t,e){function i(){o.off(t,i),e.apply(this,arguments)}var o=this;return this._callbacks=this._callbacks||{},i.fn=e,this.on(t,i),this},i.prototype.off=i.prototype.removeListener=i.prototype.removeAllListeners=i.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var i=this._callbacks[t];if(!i)return this;if(1==arguments.length)return delete this._callbacks[t],this;for(var o,n=0;n.5*Math.PI&&(this.armRotation.vertical=.5*Math.PI)),void 0===t&&void 0===e||this.calculateCameraOrientation()},o.prototype.getArmRotation=function(){var t={};return t.horizontal=this.armRotation.horizontal,t.vertical=this.armRotation.vertical,t},o.prototype.setArmLength=function(t){void 0!==t&&(this.armLength=t,this.armLength<.71&&(this.armLength=.71),this.armLength>5&&(this.armLength=5),this.calculateCameraOrientation())},o.prototype.getArmLength=function(){return this.armLength},o.prototype.getCameraLocation=function(){return this.cameraLocation},o.prototype.getCameraRotation=function(){return this.cameraRotation},o.prototype.calculateCameraOrientation=function(){this.cameraLocation.x=this.armLocation.x-this.armLength*Math.sin(this.armRotation.horizontal)*Math.cos(this.armRotation.vertical),this.cameraLocation.y=this.armLocation.y-this.armLength*Math.cos(this.armRotation.horizontal)*Math.cos(this.armRotation.vertical),this.cameraLocation.z=this.armLocation.z+this.armLength*Math.sin(this.armRotation.vertical),this.cameraRotation.x=Math.PI/2-this.armRotation.vertical,this.cameraRotation.y=0,this.cameraRotation.z=-this.armRotation.horizontal},t.exports=o},function(t,e,i){function o(t,e,i){this.data=t,this.column=e,this.graph=i,this.index=void 0,this.value=void 0,this.values=i.getDistinctValues(t.get(),this.column),this.values.sort(function(t,e){return t>e?1:t0&&this.selectValue(0),this.dataPoints=[],this.loaded=!1,this.onLoadCallback=void 0,i.animationPreload?(this.loaded=!1,this.loadInBackground()):this.loaded=!0}var n=i(11);o.prototype.isLoaded=function(){return this.loaded},o.prototype.getLoadedProgress=function(){for(var t=this.values.length,e=0;this.dataPoints[e];)e++;return Math.round(e/t*100)},o.prototype.getLabel=function(){return this.graph.filterLabel},o.prototype.getColumn=function(){return this.column},o.prototype.getSelectedValue=function(){if(void 0!==this.index)return this.values[this.index]},o.prototype.getValues=function(){return this.values},o.prototype.getValue=function(t){if(t>=this.values.length)throw new Error("Index out of range");return this.values[t]},o.prototype._getDataPoints=function(t){if(void 0===t&&(t=this.index),void 0===t)return[];var e;if(this.dataPoints[t])e=this.dataPoints[t];else{var i={};i.column=this.column,i.value=this.values[t];var o=new n(this.data,{filter:function(t){return t[i.column]==i.value}}).get();e=this.graph._getDataPoints(o),this.dataPoints[t]=e}return e},o.prototype.setOnLoadCallback=function(t){this.onLoadCallback=t},o.prototype.selectValue=function(t){if(t>=this.values.length)throw new Error("Index out of range");this.index=t,this.value=this.values[t]},o.prototype.loadInBackground=function(t){void 0===t&&(t=0);var e=this.graph.frame;if(t0&&(t--,this.setIndex(t))},o.prototype.next=function(){var t=this.getIndex();t0?this.setIndex(0):this.index=void 0},o.prototype.setIndex=function(t){if(!(tthis.values.length-1&&(o=this.values.length-1),o},o.prototype.indexToLeft=function(t){var e=parseFloat(this.frame.bar.style.width)-this.frame.slide.clientWidth-10,i=t/(this.values.length-1)*e,o=i+3;return o},o.prototype._onMouseMove=function(t){var e=t.clientX-this.startClientX,i=this.startSlideX+e,o=this.leftToIndex(i);this.setIndex(o),n.preventDefault()},o.prototype._onMouseUp=function(t){this.frame.style.cursor="auto",n.removeEventListener(document,"mousemove",this.onmousemove),n.removeEventListener(document,"mouseup",this.onmouseup),n.preventDefault()},t.exports=o},function(t,e){function i(t,e,i,o){this._start=0,this._end=0,this._step=1,this.prettyStep=!0,this.precision=5,this._current=0,this.setRange(t,e,i,o)}i.prototype.isNumeric=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},i.prototype.setRange=function(t,e,i,o){if(!this.isNumeric(t))throw new Error("Parameter 'start' is not numeric; value: "+t);if(!this.isNumeric(e))throw new Error("Parameter 'end' is not numeric; value: "+t);if(!this.isNumeric(i))throw new Error("Parameter 'step' is not numeric; value: "+t);this._start=t?t:0,this._end=e?e:0,this.setStep(i,o)},i.prototype.setStep=function(t,e){void 0===t||t<=0||(void 0!==e&&(this.prettyStep=e),this.prettyStep===!0?this._step=i.calculatePrettyStep(t):this._step=t)},i.calculatePrettyStep=function(t){var e=function(t){return Math.log(t)/Math.LN10},i=Math.pow(10,Math.round(e(t))),o=2*Math.pow(10,Math.round(e(t/2))),n=5*Math.pow(10,Math.round(e(t/5))),s=i;return Math.abs(o-t)<=Math.abs(s-t)&&(s=o),Math.abs(n-t)<=Math.abs(s-t)&&(s=n),s<=0&&(s=1),s},i.prototype.getCurrent=function(){return parseFloat(this._current.toPrecision(this.precision))},i.prototype.getStep=function(){return this._step},i.prototype.start=function(t){void 0===t&&(t=!1),this._current=this._start-this._start%this._step,t&&this.getCurrent()this._end},t.exports=i},function(t,e){function i(){this.min=void 0,this.max=void 0}i.prototype.adjust=function(t){void 0!==t&&((void 0===this.min||this.min>t)&&(this.min=t),(void 0===this.max||this.maxi)throw new Error("Passed expansion value makes range invalid");this.min=e,this.max=i}},i.prototype.range=function(){return this.max-this.min},i.prototype.center=function(){return(this.min+this.max)/2},t.exports=i},function(t,e,i){function o(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}function n(t){return void 0===t||""===t?t:t.charAt(0).toUpperCase()+t.slice(1)}function s(t,e){return void 0===t||""===t?e:t+n(e)}function r(t,e,i,o){var n,r;for(var a in i)n=i[a],r=s(o,n),e[r]=t[n]}function a(t,e,i,o){var n,r;for(var a in i)n=i[a],void 0!==t[n]&&(r=s(o,n),e[r]=t[n])}function h(t,e){if(void 0===t||o(t))throw new Error("No DEFAULTS passed");if(void 0===e)throw new Error("No dst passed");D=t,r(t,e,k),r(t,e,O,"default"),l(t,e),e.margin=10,e.showGrayBottom=!1,e.showTooltip=!1,e.eye=new _(0,0,-1)}function d(t,e){if(void 0!==t){if(void 0===e)throw new Error("No dst passed");if(void 0===D||o(D))throw new Error("DEFAULTS not set for module Settings");a(t,e,k),a(t,e,O,"default"),l(t,e)}}function l(t,e){void 0!==t.backgroundColor&&m(t.backgroundColor,e),v(t.dataColor,e),f(t.style,e),c(t.showLegend,e),g(t.cameraPosition,e),void 0!==t.tooltip&&(e.showTooltip=t.tooltip)}function c(t,e){if(void 0===t){var i=void 0===D.showLegend;if(i){var o=e.style===w.DOTCOLOR||e.style===w.DOTSIZE;e.showLegend=o}}else e.showLegend=t}function u(t){var e=x[t];return void 0===e?-1:e}function p(t){var e=!1;for(var i in w)if(w[i]===t){e=!0;break}return e}function f(t,e){if(void 0!==t){var i;if("string"==typeof t){if(i=u(t),i===-1)throw new Error("Style '"+t+"' is invalid")}else{if(!p(t))throw new Error("Style '"+t+"' is invalid");i=t}e.style=i}}function m(t,e){var i="white",o="gray",n=1;if("string"==typeof t)i=t,o="none",n=0;else{if("object"!==("undefined"==typeof t?"undefined":y(t)))throw new Error("Unsupported type of backgroundColor");void 0!==t.fill&&(i=t.fill),void 0!==t.stroke&&(o=t.stroke),void 0!==t.strokeWidth&&(n=t.strokeWidth)}e.frame.style.backgroundColor=i,e.frame.style.borderColor=o,e.frame.style.borderWidth=n+"px",e.frame.style.borderStyle="solid"}function v(t,e){void 0!==t&&(void 0===e.dataColor&&(e.dataColor={}),"string"==typeof t?(e.dataColor.fill=t,e.dataColor.stroke=t):(t.fill&&(e.dataColor.fill=t.fill),t.stroke&&(e.dataColor.stroke=t.stroke),void 0!==t.strokeWidth&&(e.dataColor.strokeWidth=t.strokeWidth)))}function g(t,e){var i=t;void 0!==i&&(void 0===e.camera&&(e.camera=new b),e.camera.setArmRotation(i.horizontal,i.vertical),e.camera.setArmLength(i.distance))}var y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b=i(16),_=i(14),w={BAR:0,BARCOLOR:1,BARSIZE:2,DOT:3,DOTLINE:4,DOTCOLOR:5,DOTSIZE:6,GRID:7,LINE:8,SURFACE:9},x={dot:w.DOT,"dot-line":w.DOTLINE,"dot-color":w.DOTCOLOR,"dot-size":w.DOTSIZE,line:w.LINE,grid:w.GRID,surface:w.SURFACE,bar:w.BAR,"bar-color":w.BARCOLOR,"bar-size":w.BARSIZE},k=["width","height","filterLabel","legendLabel","xLabel","yLabel","zLabel","xValueLabel","yValueLabel","zValueLabel","showGrid","showPerspective","showShadow","keepAspectRatio","verticalRatio","dotSizeRatio","showAnimationControls","animationInterval","animationPreload","animationAutoStart","axisColor","gridColor","xCenter","yCenter"],O=["xBarWidth","yBarWidth","valueMin","valueMax","xMin","xMax","xStep","yMin","yMax","yStep","zMin","zMax","zStep"],D=void 0;t.exports.STYLE=w,t.exports.setDefaults=h,t.exports.setOptions=d,t.exports.setCameraPosition=g},function(t,e,i){if("undefined"!=typeof window){var o=i(23),n=window.Hammer||i(24);t.exports=o(n,{preventDefault:"mouse"})}else t.exports=function(){throw Error("hammer.js is only available in a browser, not in node.js.")}},function(t,e,i){var o,n,s;!function(i){n=[],o=i,s="function"==typeof o?o.apply(e,n):o,!(void 0!==s&&(t.exports=s))}(function(){var t=null;return function e(i,o){function n(t){return t.match(/[^ ]+/g)}function s(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 i=!1;e.stopPropagation=function(){i=!0};var o=e.srcEvent.stopPropagation.bind(e.srcEvent);"function"==typeof o&&(e.srcEvent.stopPropagation=function(){o(),e.stopPropagation()}),e.firstTarget=t;for(var n=t;n&&!i;){var s=n.hammer;if(s)for(var r,a=0;a0?d._handlers[t]=o:(i.off(t,s),delete d._handlers[t]))}),d},d.emit=function(e,o){t=o.target,i.emit(e,o)},d.destroy=function(){var t=i.element.hammer,e=t.indexOf(d);e!==-1&&t.splice(e,1),t.length||delete i.element.hammer,d._handlers={},i.destroy()},d}})},function(t,e,i){var o;!function(n,s,r,a){function h(t,e,i){return setTimeout(p(t,i),e)}function d(t,e,i){return!!Array.isArray(t)&&(l(t,i[e],i),!0)}function l(t,e,i){var o;if(t)if(t.forEach)t.forEach(e,i);else if(t.length!==a)for(o=0;o\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",s=n.console&&(n.console.warn||n.console.log);return s&&s.call(n.console,o,i),t.apply(this,arguments)}}function u(t,e,i){var o,n=e.prototype;o=t.prototype=Object.create(n),o.constructor=t,o._super=n,i&&mt(o,i)}function p(t,e){return function(){return t.apply(e,arguments)}}function f(t,e){return typeof t==yt?t.apply(e?e[0]||a:a,e):t}function m(t,e){return t===a?e:t}function v(t,e,i){l(_(e),function(e){t.addEventListener(e,i,!1)})}function g(t,e,i){l(_(e),function(e){t.removeEventListener(e,i,!1)})}function y(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function b(t,e){return t.indexOf(e)>-1}function _(t){return t.trim().split(/\s+/g)}function w(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var o=0;oi[e]}):o.sort()),o}function O(t,e){for(var i,o,n=e[0].toUpperCase()+e.slice(1),s=0;s1&&!i.firstMultiple?i.firstMultiple=N(e):1===n&&(i.firstMultiple=!1);var s=i.firstInput,r=i.firstMultiple,a=r?r.center:s.center,h=e.center=R(o);e.timeStamp=wt(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=B(a,h),e.distance=A(a,h),P(i,e),e.offsetDirection=z(e.deltaX,e.deltaY);var d=L(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=d.x,e.overallVelocityY=d.y,e.overallVelocity=_t(d.x)>_t(d.y)?d.x:d.y,e.scale=r?F(r.pointers,o):1,e.rotation=r?j(r.pointers,o):0,e.maxPointers=i.prevInput?e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers:e.pointers.length,I(i,e);var l=t.element;y(e.srcEvent.target,l)&&(l=e.srcEvent.target),e.target=l}function P(t,e){var i=e.center,o=t.offsetDelta||{},n=t.prevDelta||{},s=t.prevInput||{};e.eventType!==Rt&&s.eventType!==zt||(n=t.prevDelta={x:s.deltaX||0,y:s.deltaY||0},o=t.offsetDelta={x:i.x,y:i.y}),e.deltaX=n.x+(i.x-o.x),e.deltaY=n.y+(i.y-o.y)}function I(t,e){var i,o,n,s,r=t.lastInterval||e,h=e.timeStamp-r.timeStamp;if(e.eventType!=At&&(h>Nt||r.velocity===a)){var d=e.deltaX-r.deltaX,l=e.deltaY-r.deltaY,c=L(h,d,l);o=c.x,n=c.y,i=_t(c.x)>_t(c.y)?c.x:c.y,s=z(d,l),t.lastInterval=e}else i=r.velocity,o=r.velocityX,n=r.velocityY,s=r.direction;e.velocity=i,e.velocityX=o,e.velocityY=n,e.direction=s}function N(t){for(var e=[],i=0;i=_t(e)?t<0?jt:Ft:e<0?Ht:Wt}function A(t,e,i){i||(i=Ut);var o=e[i[0]]-t[i[0]],n=e[i[1]]-t[i[1]];return Math.sqrt(o*o+n*n)}function B(t,e,i){i||(i=Ut);var o=e[i[0]]-t[i[0]],n=e[i[1]]-t[i[1]];return 180*Math.atan2(n,o)/Math.PI}function j(t,e){return B(e[1],e[0],qt)+B(t[1],t[0],qt)}function F(t,e){return A(e[0],e[1],qt)/A(t[0],t[1],qt)}function H(){this.evEl=Zt,this.evWin=Kt,this.pressed=!1,C.apply(this,arguments)}function W(){this.evEl=$t,this.evWin=te,C.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function Y(){this.evTarget=ie,this.evWin=oe,this.started=!1,C.apply(this,arguments)}function G(t,e){var i=x(t.touches),o=x(t.changedTouches);return e&(zt|At)&&(i=k(i.concat(o),"identifier",!0)),[i,o]}function V(){this.evTarget=se,this.targetIds={},C.apply(this,arguments)}function U(t,e){var i=x(t.touches),o=this.targetIds;if(e&(Rt|Lt)&&1===i.length)return o[i[0].identifier]=!0,[i,i];var n,s,r=x(t.changedTouches),a=[],h=this.target;if(s=i.filter(function(t){return y(t.target,h)}),e===Rt)for(n=0;n-1&&o.splice(t,1)};setTimeout(n,re)}}function K(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,o=0;o-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){function e(e){i.manager.emit(e,t)}var i=this,o=this.state;o<_e&&e(i.options.event+et(o)),e(i.options.event),t.additionalEvent&&e(t.additionalEvent),o>=_e&&e(i.options.event+et(o))},tryEmit:function(t){return this.canEmit()?this.emit(t):void(this.state=ke)},canEmit:function(){for(var t=0;te.threshold&&n&e.direction},attrTest:function(t){return nt.prototype.attrTest.call(this,t)&&(this.state&ye||!(this.state&ye)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=it(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),u(rt,nt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[pe]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&ye)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),u(at,tt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ce]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,o=t.distancee.time;if(this._input=t,!o||!i||t.eventType&(zt|At)&&!n)this.reset();else if(t.eventType&Rt)this.reset(),this._timer=h(function(){this.state=we,this.tryEmit()},e.time,this);else if(t.eventType&zt)return we;return ke},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===we&&(t&&t.eventType&zt?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=wt(),this.manager.emit(this.options.event,this._input)))}}),u(ht,nt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[pe]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&ye)}}),u(dt,nt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Yt|Gt,pointers:1},getTouchAction:function(){return st.prototype.getTouchAction.call(this)},attrTest:function(t){var e,i=this.options.direction;return i&(Yt|Gt)?e=t.overallVelocity:i&Yt?e=t.overallVelocityX:i&Gt&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&i&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&_t(e)>this.options.velocity&&t.eventType&zt},emit:function(t){var e=it(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),u(lt,tt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ue]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,o=t.distances)&&(s=i)}),null!==n&&null!==s){var r=(n+s)/2,a=Math.max(this.range.end-this.range.start,1.1*(s-n)),h=!e||void 0===e.animation||e.animation;this.range.setRange(r-a/2,r+a/2,h)}}},n.prototype.fit=function(t){var e,i=!t||void 0===t.animation||t.animation,o=this.itemsData&&this.itemsData.getDataSet();1===o.length&&void 0===o.get()[0].end?(e=this.getDataRange(),this.moveTo(e.min.valueOf(),{animation:i})):(e=this.getItemRange(),this.range.setRange(e.min,e.max,i))},n.prototype.getItemRange=function(){var t=this,e=this.getDataRange(),i=null!==e.min?e.min.valueOf():null,o=null!==e.max?e.max.valueOf():null,n=null,s=null;if(null!=i&&null!=o){var r,a,h,d,c;!function(){var e=function(t){return l.convert(t.data.start,"Date").valueOf()},u=function(t){var e=void 0!=t.data.end?t.data.end:t.data.start;return l.convert(e,"Date").valueOf()};r=o-i,r<=0&&(r=10),a=r/t.props.center.width,l.forEach(t.itemSet.items,function(t){t.show(),t.repositionX();var r=e(t),h=u(t);if(this.options.rtl)var d=r-(t.getWidthRight()+10)*a,l=h+(t.getWidthLeft()+10)*a;else var d=r-(t.getWidthLeft()+10)*a,l=h+(t.getWidthRight()+10)*a;do&&(o=l,s=t)}.bind(t)),n&&s&&(h=n.getWidthLeft()+10,d=s.getWidthRight()+10,c=t.props.center.width-h-d,c>0&&(t.options.rtl?(i=e(n)-d*r/c,o=u(s)+h*r/c):(i=e(n)-h*r/c,o=u(s)+d*r/c)))}()}return{min:null!=i?new Date(i):null,max:null!=o?new Date(o):null}},n.prototype.getDataRange=function(){var t=null,e=null,i=this.itemsData&&this.itemsData.getDataSet();return i&&i.forEach(function(i){var o=l.convert(i.start,"Date").valueOf(),n=l.convert(void 0!=i.end?i.end:i.start,"Date").valueOf();(null===t||oe)&&(e=n)}),{min:null!=t?new Date(t):null,max:null!=e?new Date(e):null}},n.prototype.getEventProperties=function(t){var e=t.center?t.center.x:t.clientX,i=t.center?t.center.y:t.clientY;if(this.options.rtl)var o=l.getAbsoluteRight(this.dom.centerContainer)-e;else var o=e-l.getAbsoluteLeft(this.dom.centerContainer);var n=i-l.getAbsoluteTop(this.dom.centerContainer),s=this.itemSet.itemFromTarget(t),r=this.itemSet.groupFromTarget(t),a=g.customTimeFromTarget(t),h=this.itemSet.options.snap||null,d=this.body.util.getScale(),c=this.body.util.getStep(),u=this._toTime(o),p=h?h(u,d,c):u,f=l.getTarget(t),m=null;return null!=s?m="item":null!=a?m="custom-time":l.hasParent(f,this.timeAxis.dom.foreground)?m="axis":this.timeAxis2&&l.hasParent(f,this.timeAxis2.dom.foreground)?m="axis":l.hasParent(f,this.itemSet.dom.labelSet)?m="group-label":l.hasParent(f,this.currentTime.bar)?m="current-time":l.hasParent(f,this.dom.center)&&(m="background"),{event:t,item:s?s.id:null,group:r?r.groupId:null,what:m,pageX:t.srcEvent?t.srcEvent.pageX:t.pageX,pageY:t.srcEvent?t.srcEvent.pageY:t.pageY,x:o,y:n,time:u,snappedTime:p}},t.exports=n},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(){function t(t,e){for(var i=0;i3&&void 0!==arguments[3]?arguments[3]:1;n(this,t),this.parent=e,this.changedOptions=[],this.container=i,this.allowCreation=!1,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},d.extend(this.options,this.defaultOptions),this.configureOptions=o,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new h.default(s),this.wrapper=void 0}return r(t,[{key:"setOptions",value:function(t){if(void 0!==t){this.popupHistory={},this._removePopup();var e=!0;"string"==typeof t?this.options.filter=t:t instanceof Array?this.options.filter=t.join():"object"===("undefined"==typeof t?"undefined":s(t))?(void 0!==t.container&&(this.options.container=t.container),void 0!==t.filter&&(this.options.filter=t.filter),void 0!==t.showButton&&(this.options.showButton=t.showButton),void 0!==t.enabled&&(e=t.enabled)):"boolean"==typeof t?(this.options.filter=!0,e=t):"function"==typeof t&&(this.options.filter=t,e=!0),this.options.filter===!1&&(e=!1),this.options.enabled=e}this._clean()}},{key:"setModuleOptions",value:function(t){this.moduleOptions=t,this.options.enabled===!0&&(this._clean(),void 0!==this.options.container&&(this.container=this.options.container),this._create())}},{key:"_create",value:function(){var t=this;this._clean(),this.changedOptions=[];var e=this.options.filter,i=0,o=!1;for(var n in this.configureOptions)this.configureOptions.hasOwnProperty(n)&&(this.allowCreation=!1,o=!1,"function"==typeof e?(o=e(n,[]),o=o||this._handleObject(this.configureOptions[n],[n],!0)):e!==!0&&e.indexOf(n)===-1||(o=!0),o!==!1&&(this.allowCreation=!0,i>0&&this._makeItem([]),this._makeHeader(n),this._handleObject(this.configureOptions[n],[n])),i++);this.options.showButton===!0&&!function(){var e=document.createElement("div");e.className="vis-configuration vis-config-button",e.innerHTML="generate options",e.onclick=function(){t._printOptions()},e.onmouseover=function(){e.className="vis-configuration vis-config-button hover"},e.onmouseout=function(){e.className="vis-configuration vis-config-button"},t.optionsContainer=document.createElement("div"),t.optionsContainer.className="vis-configuration vis-config-option-container",t.domElements.push(t.optionsContainer),t.domElements.push(e)}(),this._push()}},{key:"_push",value:function(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(var t=0;t1?o-1:0),r=1;r2&&void 0!==arguments[2]&&arguments[2],o=document.createElement("div");return o.className="vis-configuration vis-config-label vis-config-s"+e.length,i===!0?o.innerHTML=""+t+":":o.innerHTML=t+":",o}},{key:"_makeDropdown",value:function(t,e,i){var o=document.createElement("select");o.className="vis-configuration vis-config-select";var n=0;void 0!==e&&t.indexOf(e)!==-1&&(n=t.indexOf(e));for(var s=0;ss&&1!==s&&(a.max=Math.ceil(e*l),d=a.max,h="range increased"),a.value=e}else a.value=o;var c=document.createElement("input");c.className="vis-configuration vis-config-rangeinput",c.value=a.value;var u=this;a.onchange=function(){c.value=this.value,u._update(Number(this.value),i)},a.oninput=function(){c.value=this.value};var p=this._makeLabel(i[i.length-1],i),f=this._makeItem(i,p,a,c);""!==h&&this.popupHistory[f]!==d&&(this.popupHistory[f]=d,this._setupPopup(h,f))}},{key:"_setupPopup",value:function(t,e){var i=this;if(this.initialized===!0&&this.allowCreation===!0&&this.popupCounter1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=!1,n=this.options.filter,s=!1;for(var r in t)if(t.hasOwnProperty(r)){o=!0;var a=t[r],h=d.copyAndExtendArray(e,r);if("function"==typeof n&&(o=n(r,e),o===!1&&!(a instanceof Array)&&"string"!=typeof a&&"boolean"!=typeof a&&a instanceof Object&&(this.allowCreation=!1,o=this._handleObject(a,h,!0),this.allowCreation=i===!1)),o!==!1){s=!0;var l=this._getValue(h);if(a instanceof Array)this._handleArray(a,l,h);else if("string"==typeof a)this._makeTextInput(a,l,h);else if("boolean"==typeof a)this._makeCheckbox(a,l,h);else if(a instanceof Object){var c=!0;if(e.indexOf("physics")!==-1&&this.moduleOptions.physics.solver!==r&&(c=!1),c===!0)if(void 0!==a.enabled){var u=d.copyAndExtendArray(h,"enabled"),p=this._getValue(u);if(p===!0){var f=this._makeLabel(r,h,!0);this._makeItem(h,f),s=this._handleObject(a,h)||s}else this._makeCheckbox(a,p,h)}else{var m=this._makeLabel(r,h,!0);this._makeItem(h,m),s=this._handleObject(a,h)||s}}else console.error("dont know how to handle",a,r,h)}}return s}},{key:"_handleArray",value:function(t,e,i){"string"==typeof t[0]&&"color"===t[0]?(this._makeColorField(t,e,i),t[1]!==e&&this.changedOptions.push({path:i,value:e})):"string"==typeof t[0]?(this._makeDropdown(t,e,i),t[0]!==e&&this.changedOptions.push({path:i,value:e})):"number"==typeof t[0]&&(this._makeRange(t,e,i),t[0]!==e&&this.changedOptions.push({path:i,value:Number(e)}))}},{key:"_update",value:function(t,e){var i=this._constructOptions(t,e);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(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=i;t="true"===t||t,t="false"!==t&&t;for(var n=0;nvar options = "+JSON.stringify(t,null,2)+""}},{key:"getOptions",value:function(){for(var t={},e=0;e0&&void 0!==arguments[0]?arguments[0]:1;o(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 n(t,[{key:"insertTo",value:function(t){void 0!==this.hammer&&(this.hammer.destroy(),this.hammer=void 0),this.container=t,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}},{key:"setUpdateCallback",value:function(t){if("function"!=typeof t)throw new Error("Function attempted to set as colorPicker update callback is not a function.");this.updateCallback=t}},{key:"setCloseCallback",value:function(t){if("function"!=typeof t)throw new Error("Function attempted to set as colorPicker closing callback is not a function.");this.closeCallback=t}},{key:"_isColorString",value:function(t){var e={black:"#000000",navy:"#000080",darkblue:"#00008B",mediumblue:"#0000CD",blue:"#0000FF",darkgreen:"#006400",green:"#008000",teal:"#008080",darkcyan:"#008B8B",deepskyblue:"#00BFFF",darkturquoise:"#00CED1",mediumspringgreen:"#00FA9A",lime:"#00FF00",springgreen:"#00FF7F",aqua:"#00FFFF",cyan:"#00FFFF",midnightblue:"#191970",dodgerblue:"#1E90FF",lightseagreen:"#20B2AA",forestgreen:"#228B22",seagreen:"#2E8B57",darkslategray:"#2F4F4F",limegreen:"#32CD32",mediumseagreen:"#3CB371",turquoise:"#40E0D0",royalblue:"#4169E1",steelblue:"#4682B4",darkslateblue:"#483D8B",mediumturquoise:"#48D1CC",indigo:"#4B0082",darkolivegreen:"#556B2F",cadetblue:"#5F9EA0",cornflowerblue:"#6495ED",mediumaquamarine:"#66CDAA",dimgray:"#696969",slateblue:"#6A5ACD",olivedrab:"#6B8E23",slategray:"#708090",lightslategray:"#778899",mediumslateblue:"#7B68EE",lawngreen:"#7CFC00",chartreuse:"#7FFF00",aquamarine:"#7FFFD4",maroon:"#800000",purple:"#800080",olive:"#808000",gray:"#808080",skyblue:"#87CEEB",lightskyblue:"#87CEFA",blueviolet:"#8A2BE2",darkred:"#8B0000",darkmagenta:"#8B008B",saddlebrown:"#8B4513",darkseagreen:"#8FBC8F",lightgreen:"#90EE90",mediumpurple:"#9370D8",darkviolet:"#9400D3",palegreen:"#98FB98",darkorchid:"#9932CC",yellowgreen:"#9ACD32",sienna:"#A0522D",brown:"#A52A2A",darkgray:"#A9A9A9",lightblue:"#ADD8E6",greenyellow:"#ADFF2F",paleturquoise:"#AFEEEE",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",firebrick:"#B22222",darkgoldenrod:"#B8860B",mediumorchid:"#BA55D3",rosybrown:"#BC8F8F",darkkhaki:"#BDB76B",silver:"#C0C0C0",mediumvioletred:"#C71585",indianred:"#CD5C5C",peru:"#CD853F",chocolate:"#D2691E",tan:"#D2B48C",lightgrey:"#D3D3D3",palevioletred:"#D87093",thistle:"#D8BFD8",orchid:"#DA70D6",goldenrod:"#DAA520",crimson:"#DC143C",gainsboro:"#DCDCDC",plum:"#DDA0DD",burlywood:"#DEB887",lightcyan:"#E0FFFF",lavender:"#E6E6FA",darksalmon:"#E9967A",violet:"#EE82EE",palegoldenrod:"#EEE8AA",lightcoral:"#F08080",khaki:"#F0E68C",aliceblue:"#F0F8FF",honeydew:"#F0FFF0",azure:"#F0FFFF",sandybrown:"#F4A460",wheat:"#F5DEB3",beige:"#F5F5DC",whitesmoke:"#F5F5F5",mintcream:"#F5FFFA",ghostwhite:"#F8F8FF",salmon:"#FA8072",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lightgoldenrodyellow:"#FAFAD2",oldlace:"#FDF5E6",red:"#FF0000",fuchsia:"#FF00FF",magenta:"#FF00FF",deeppink:"#FF1493",orangered:"#FF4500",tomato:"#FF6347",hotpink:"#FF69B4",coral:"#FF7F50",darkorange:"#FF8C00",lightsalmon:"#FFA07A",orange:"#FFA500",lightpink:"#FFB6C1",pink:"#FFC0CB",gold:"#FFD700",peachpuff:"#FFDAB9",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",mistyrose:"#FFE4E1",blanchedalmond:"#FFEBCD",papayawhip:"#FFEFD5",lavenderblush:"#FFF0F5",seashell:"#FFF5EE",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",floralwhite:"#FFFAF0",snow:"#FFFAFA",yellow:"#FFFF00",lightyellow:"#FFFFE0",ivory:"#FFFFF0",white:"#FFFFFF"};if("string"==typeof t)return e[t]}},{key:"setColor",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("none"!==t){var i=void 0,o=this._isColorString(t);if(void 0!==o&&(t=o),a.isString(t)===!0){if(a.isValidRGB(t)===!0){var n=t.substr(4).substr(0,t.length-5).split(",");i={r:n[0],g:n[1],b:n[2],a:1}}else if(a.isValidRGBA(t)===!0){var s=t.substr(5).substr(0,t.length-6).split(",");i={r:s[0],g:s[1],b:s[2],a:s[3]}}else if(a.isValidHex(t)===!0){var r=a.hexToRGB(t);i={r:r.r,g:r.g,b:r.b,a:1}}}else if(t instanceof Object&&void 0!==t.r&&void 0!==t.g&&void 0!==t.b){var h=void 0!==t.a?t.a:"1.0";i={r:t.r,g:t.g,b:t.b,a:h}}if(void 0===i)throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: "+JSON.stringify(t));this._setColor(i,e)}}},{key:"show",value:function(){void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}},{key:"_hide",value:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e===!0&&(this.previousColor=a.extend({},this.color)),this.applied===!0&&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(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e===!0&&(this.initialColor=a.extend({},t)),this.color=t;var i=a.RGBToHSV(t.r,t.g,t.b),o=2*Math.PI,n=this.r*i.s,s=this.centerCoordinates.x+n*Math.sin(o*i.h),r=this.centerCoordinates.y+n*Math.cos(o*i.h);this.colorPickerSelector.style.left=s-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=r-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(t)}},{key:"_setOpacity",value:function(t){this.color.a=t/100,this._updatePicker(this.color)}},{key:"_setBrightness",value:function(t){var e=a.RGBToHSV(this.color.r,this.color.g,this.color.b);e.v=t/100;var i=a.HSVToRGB(e.h,e.s,e.v);i.a=this.color.a,this.color=i,this._updatePicker()}},{key:"_updatePicker",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color,e=a.RGBToHSV(t.r,t.g,t.b),i=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1)),i.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var o=this.colorPickerCanvas.clientWidth,n=this.colorPickerCanvas.clientHeight;i.clearRect(0,0,o,n),i.putImageData(this.hueCircle,0,0),i.fillStyle="rgba(0,0,0,"+(1-e.v)+")",i.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),i.fill(),this.brightnessRange.value=100*e.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 t=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}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.colorPickerCanvas.appendChild(e)}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(t){}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(t){}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 s(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),r.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(this.generated===!1){var t=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)),t.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var e=this.colorPickerCanvas.clientWidth,i=this.colorPickerCanvas.clientHeight;t.clearRect(0,0,e,i);var o=void 0,n=void 0,s=void 0,r=void 0;this.centerCoordinates={x:.5*e,y:.5*i},this.r=.49*e;var h=2*Math.PI/360,d=1/360,l=1/this.r,c=void 0;for(s=0;s<360;s++)for(r=0;rs.distance?console.log('%cUnknown option detected: "'+e+'" in '+t.printLocation(n.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+t.printLocation(s.path,s.closestMatch,""),d):n.distance<=r?console.log('%cUnknown option detected: "'+e+'". Did you mean "'+n.closestMatch+'"?'+t.printLocation(n.path,e),d):console.log('%cUnknown option detected: "'+e+'". Did you mean one of these: '+t.print(Object.keys(i))+t.printLocation(o,e),d),a=!0}},{key:"findInOptions",value:function(e,i,o){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=1e9,a="",h=[],d=e.toLowerCase(),l=void 0;for(var c in i){var u=void 0;if(void 0!==i[c].__type__&&n===!0){var p=t.findInOptions(e,i[c],r.copyAndExtendArray(o,c));s>p.distance&&(a=p.closestMatch,h=p.path,s=p.distance,l=p.indexMatch)}else c.toLowerCase().indexOf(d)!==-1&&(l=c),u=t.levenshteinDistance(e,c),s>u&&(a=c,h=r.copyArray(o),s=u)}return{closestMatch:a,path:h,distance:s,indexMatch:l}}},{key:"printLocation",value:function(t,e){for(var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Problem value found at: \n",o="\n\n"+i+"options = {\n",n=0;nu,p=r||null===n?n:l+(n-l)*s,g=r||null===a?a:c+(a-c)*s;y=h._applyRange(p,g),d.updateHiddenDates(h.options.moment,h.body,h.options.hiddenDates),v=v||y,y&&h.body.emitter.emit("rangechange",{start:new Date(h.start),end:new Date(h.end),byUser:o}),r?v&&h.body.emitter.emit("rangechanged",{start:new Date(h.start),end:new Date(h.end),byUser:o}):h.animationTimer=setTimeout(t,20)}};return g()}var y=this._applyRange(n,a);if(d.updateHiddenDates(this.options.moment,this.body,this.options.hiddenDates),y){var b={start:new Date(this.start),end:new Date(this.end),byUser:o};this.body.emitter.emit("rangechange",b),this.body.emitter.emit("rangechanged",b)}},o.prototype._cancelAnimation=function(){this.animationTimer&&(clearTimeout(this.animationTimer),this.animationTimer=null)},o.prototype._applyRange=function(t,e){var i,o=null!=t?r.convert(t,"Date").valueOf():this.start,n=null!=e?r.convert(e,"Date").valueOf():this.end,s=null!=this.options.max?r.convert(this.options.max,"Date").valueOf():null,a=null!=this.options.min?r.convert(this.options.min,"Date").valueOf():null;if(isNaN(o)||null===o)throw new Error('Invalid start "'+t+'"');if(isNaN(n)||null===n)throw new Error('Invalid end "'+e+'"');if(ns&&(n=s)),null!==s&&n>s&&(i=n-s,o-=i,n-=i,null!=a&&othis.start&&nd&&(this.end-this.start===d&&othis.end?(o=this.start,n=this.end):(i=n-o-d,o+=i/2,n-=i/2))}var l=this.start!=o||this.end!=n;return o>=this.start&&o<=this.end||n>=this.start&&n<=this.end||this.start>=o&&this.start<=n||this.end>=o&&this.end<=n||this.body.emitter.emit("checkRangedItems"),this.start=o,this.end=n,l},o.prototype.getRange=function(){return{start:this.start,end:this.end}},o.prototype.conversion=function(t,e){return o.conversion(this.start,this.end,t,e)},o.conversion=function(t,e,i,o){return void 0===o&&(o=0),0!=i&&e-t!=0?{offset:t,scale:i/(e-t-o)}:{offset:0,scale:1}},o.prototype._onDragStart=function(t){this.deltaDifference=0,this.previousDelta=0,this.options.moveable&&this._isInsideRange(t)&&this.props.touch.allowDragging&&(this.props.touch.start=this.start,this.props.touch.end=this.end,this.props.touch.dragging=!0,this.body.dom.root&&(this.body.dom.root.style.cursor="move"))},o.prototype._onDrag=function(t){if(t&&this.props.touch.dragging&&this.options.moveable&&this.props.touch.allowDragging){var e=this.options.direction;n(e);var i="horizontal"==e?t.deltaX:t.deltaY;i-=this.deltaDifference;var o=this.props.touch.end-this.props.touch.start,s=d.getHiddenDurationBetween(this.body.hiddenDates,this.start,this.end);o-=s;var r="horizontal"==e?this.body.domProps.center.width:this.body.domProps.center.height;if(this.options.rtl)var a=i/r*o;else var a=-i/r*o;var h=this.props.touch.start+a,l=this.props.touch.end+a,c=d.snapAwayFromHidden(this.body.hiddenDates,h,this.previousDelta-i,!0),u=d.snapAwayFromHidden(this.body.hiddenDates,l,this.previousDelta-i,!0);if(c!=h||u!=l)return this.deltaDifference+=i, -this.props.touch.start=c,this.props.touch.end=u,void this._onDrag(t);this.previousDelta=i,this._applyRange(h,l);var p=new Date(this.start),f=new Date(this.end);this.body.emitter.emit("rangechange",{start:p,end:f,byUser:!0}),this.body.emitter.emit("panmove")}},o.prototype._onDragEnd=function(t){this.props.touch.dragging&&this.options.moveable&&this.props.touch.allowDragging&&(this.props.touch.dragging=!1,this.body.dom.root&&(this.body.dom.root.style.cursor="auto"),this.body.emitter.emit("rangechanged",{start:new Date(this.start),end:new Date(this.end),byUser:!0}))},o.prototype._onMouseWheel=function(t){t.preventDefault();var e=0;if(t.wheelDelta?e=t.wheelDelta/120:t.detail&&(e=-t.detail/3),this.options.zoomKey&&!t[this.options.zoomKey]&&this.options.zoomable||!this.options.zoomable&&this.options.moveable){if(this.options.horizontalScroll){var i=e*(this.end-this.start)/20,o=this.start-i,n=this.end-i;this.setRange(o,n)}}else if(this.options.zoomable&&this.options.moveable&&this._isInsideRange(t)&&e){var s;s=e<0?1-e/5:1/(1+e/5);var r=this.getPointer({x:t.clientX,y:t.clientY},this.body.dom.center),a=this._pointerToDate(r);this.zoom(s,a,e)}},o.prototype._onTouch=function(t){this.props.touch.start=this.start,this.props.touch.end=this.end,this.props.touch.allowDragging=!0,this.props.touch.center=null,this.scaleOffset=0,this.deltaDifference=0},o.prototype._onPinch=function(t){if(this.options.zoomable&&this.options.moveable){this.props.touch.allowDragging=!1,this.props.touch.center||(this.props.touch.center=this.getPointer(t.center,this.body.dom.center));var e=1/(t.scale+this.scaleOffset),i=this._pointerToDate(this.props.touch.center),o=d.getHiddenDurationBetween(this.body.hiddenDates,this.start,this.end),n=d.getHiddenDurationBefore(this.options.moment,this.body.hiddenDates,this,i),s=o-n,r=i-n+(this.props.touch.start-(i-n))*e,a=i+s+(this.props.touch.end-(i+s))*e;this.startToFront=1-e<=0,this.endToFront=e-1<=0;var h=d.snapAwayFromHidden(this.body.hiddenDates,r,1-e,!0),l=d.snapAwayFromHidden(this.body.hiddenDates,a,e-1,!0);h==r&&l==a||(this.props.touch.start=h,this.props.touch.end=l,this.scaleOffset=1-t.scale,r=h,a=l),this.setRange(r,a,!1,!0),this.startToFront=!1,this.endToFront=!0}},o.prototype._isInsideRange=function(t){var e=t.center?t.center.x:t.clientX;if(this.options.rtl)var i=e-r.getAbsoluteLeft(this.body.dom.centerContainer);else var i=r.getAbsoluteRight(this.body.dom.centerContainer)-e;var o=this.body.util.toTime(i);return o>=this.start&&o<=this.end},o.prototype._pointerToDate=function(t){var e,i=this.options.direction;if(n(i),"horizontal"==i)return this.body.util.toTime(t.x).valueOf();var o=this.body.domProps.center.height;return e=this.conversion(o),t.y/e.scale+e.offset},o.prototype.getPointer=function(t,e){return this.options.rtl?{x:r.getAbsoluteRight(e)-t.x,y:t.y-r.getAbsoluteTop(e)}:{x:t.x-r.getAbsoluteLeft(e),y:t.y-r.getAbsoluteTop(e)}},o.prototype.zoom=function(t,e,i){null==e&&(e=(this.start+this.end)/2);var o=d.getHiddenDurationBetween(this.body.hiddenDates,this.start,this.end),n=d.getHiddenDurationBefore(this.options.moment,this.body.hiddenDates,this,e),s=o-n,r=e-n+(this.start-(e-n))*t,a=e+s+(this.end-(e+s))*t;this.startToFront=!(i>0),this.endToFront=!(-i>0);var h=d.snapAwayFromHidden(this.body.hiddenDates,r,i,!0),l=d.snapAwayFromHidden(this.body.hiddenDates,a,-i,!0);h==r&&l==a||(r=h,a=l),this.setRange(r,a,!1,!0),this.startToFront=!1,this.endToFront=!0},o.prototype.move=function(t){var e=this.end-this.start,i=this.start+e*t,o=this.end+e*t;this.start=i,this.end=o},o.prototype.moveTo=function(t){var e=(this.start+this.end)/2,i=e-t,o=this.start-i,n=this.end-i;this.setRange(o,n)},t.exports=o},function(t,e,i){function o(t,e){this.options=null,this.props=null}var n=i(1);o.prototype.setOptions=function(t){t&&n.extend(this.options,t)},o.prototype.redraw=function(){return!1},o.prototype.destroy=function(){},o.prototype._isResized=function(){var t=this.props._previousWidth!==this.props.width||this.props._previousHeight!==this.props.height;return this.props._previousWidth=this.props.width,this.props._previousHeight=this.props.height,t},t.exports=o},function(t,e){e.convertHiddenOptions=function(t,i,o){if(o&&!Array.isArray(o))return e.convertHiddenOptions(t,i,[o]);if(i.hiddenDates=[],o&&1==Array.isArray(o)){for(var n=0;n=4*a){var u=0,p=s.clone();switch(o[h].repeat){case"daily":d.day()!=l.day()&&(u=1),d.dayOfYear(n.dayOfYear()),d.year(n.year()),d.subtract(7,"days"),l.dayOfYear(n.dayOfYear()),l.year(n.year()),l.subtract(7-u,"days"),p.add(1,"weeks");break;case"weekly":var f=l.diff(d,"days"),m=d.day();d.date(n.date()),d.month(n.month()),d.year(n.year()),l=d.clone(),d.day(m),l.day(m),l.add(f,"days"),d.subtract(1,"weeks"),l.subtract(1,"weeks"),p.add(1,"weeks");break;case"monthly":d.month()!=l.month()&&(u=1),d.month(n.month()),d.year(n.year()),d.subtract(1,"months"),l.month(n.month()),l.year(n.year()),l.subtract(1,"months"),l.add(u,"months"),p.add(1,"months");break;case"yearly":d.year()!=l.year()&&(u=1),d.year(n.year()),d.subtract(1,"years"),l.year(n.year()),l.subtract(1,"years"),l.add(u,"years"),p.add(1,"years");break;default:return void console.log("Wrong repeat format, allowed are: daily, weekly, monthly, yearly. Given:",o[h].repeat)}for(;d=e[o].start&&e[n].end<=e[o].end?e[n].remove=!0:e[n].start>=e[o].start&&e[n].start<=e[o].end?(e[o].end=e[n].end,e[n].remove=!0):e[n].end>=e[o].start&&e[n].end<=e[o].end&&(e[o].start=e[n].start,e[n].remove=!0));for(var o=0;o=r&&nt.range.end){var h={start:t.range.start,end:i};i=e.correctTimeForHidden(t.options.moment,t.body.hiddenDates,h,i);var n=t.range.conversion(o,r);return(i.valueOf()-n.offset)*n.scale}i=e.correctTimeForHidden(t.options.moment,t.body.hiddenDates,t.range,i);var n=t.range.conversion(o,r);return(i.valueOf()-n.offset)*n.scale},e.toTime=function(t,i,o){if(0==t.body.hiddenDates.length){var n=t.range.conversion(o);return new Date(i/n.scale+n.offset)}var s=e.getHiddenDurationBetween(t.body.hiddenDates,t.range.start,t.range.end),r=t.range.end-t.range.start-s,a=r*i/o,h=e.getAccumulatedHiddenDuration(t.body.hiddenDates,t.range,a),d=new Date(h+a+t.range.start);return d},e.getHiddenDurationBetween=function(t,e,i){for(var o=0,n=0;n=e&&r=e&&r<=i&&(o+=r-s)}return o},e.correctTimeForHidden=function(t,i,o,n){return n=t(n).toDate().valueOf(),n-=e.getHiddenDurationBefore(t,i,o,n)},e.getHiddenDurationBefore=function(t,e,i,o){var n=0;o=t(o).toDate().valueOf();for(var s=0;s=i.start&&a=a&&(n+=a-r)}return n},e.getAccumulatedHiddenDuration=function(t,e,i){for(var o=0,n=0,s=e.start,r=0;r=e.start&&h=i)break;o+=h-a}}return o},e.snapAwayFromHidden=function(t,i,o,n){var s=e.isHidden(i,t);return 1==s.hidden?o<0?1==n?s.startDate-(s.endDate-i)-1:s.startDate-1:1==n?s.endDate+(i-s.startDate)+1:s.endDate+1:i},e.isHidden=function(t,e){for(var i=0;i=o&&t0&&i[0].setCustomTime(t)},o.prototype.getCustomTime=function(t){var e=this.customTimes.filter(function(e){return e.options.id===t});if(0===e.length)throw new Error("No custom time bar found with id "+JSON.stringify(t));return e[0].getCustomTime()},o.prototype.setCustomTimeTitle=function(t,e){var i=this.customTimes.filter(function(t){return t.options.id===e});if(0===i.length)throw new Error("No custom time bar found with id "+JSON.stringify(e));if(i.length>0)return i[0].setCustomTitle(t)},o.prototype.getEventProperties=function(t){return{event:t}},o.prototype.addCustomTime=function(t,e){var i=void 0!==t?h.convert(t,"Date").valueOf():new Date,o=this.customTimes.some(function(t){return t.options.id===e});if(o)throw new Error("A custom time with id "+JSON.stringify(e)+" already exists");var n=new u(this.body,h.extend({},this.options,{time:i,id:e}));return this.customTimes.push(n),this.components.push(n),this._redraw(),e},o.prototype.removeCustomTime=function(t){var e=this.customTimes.filter(function(e){return e.options.id===t});if(0===e.length)throw new Error("No custom time bar found with id "+JSON.stringify(t));e.forEach(function(t){this.customTimes.splice(this.customTimes.indexOf(t),1),this.components.splice(this.components.indexOf(t),1),t.destroy()}.bind(this))},o.prototype.getVisibleItems=function(){return this.itemSet&&this.itemSet.getVisibleItems()||[]},o.prototype.fit=function(t){var e=this.getDataRange();if(null!==e.min||null!==e.max){var i=e.max-e.min,o=new Date(e.min.valueOf()-.01*i),n=new Date(e.max.valueOf()+.01*i),s=!t||void 0===t.animation||t.animation;this.range.setRange(o,n,s)}},o.prototype.getDataRange=function(){throw new Error("Cannot invoke abstract method getDataRange")},o.prototype.setWindow=function(t,e,i){var o;if(1==arguments.length){var n=arguments[0];o=void 0===n.animation||n.animation,this.range.setRange(n.start,n.end,o)}else o=!i||void 0===i.animation||i.animation,this.range.setRange(t,e,o)},o.prototype.moveTo=function(t,e){var i=this.range.end-this.range.start,o=h.convert(t,"Date").valueOf(),n=o-i/2,s=o+i/2,r=!e||void 0===e.animation||e.animation;this.range.setRange(n,s,r)},o.prototype.getWindow=function(){var t=this.range.getRange();return{start:new Date(t.start),end:new Date(t.end)}},o.prototype.zoomIn=function(t){if(!(!t||t<0||t>1)){var e=this.getWindow(),i=e.start.valueOf(),o=e.end.valueOf(),n=o-i,s=n/(1+t),r=(n-s)/2,a=i+r,h=o-r;this.setWindow({start:a,end:h})}},o.prototype.zoomOut=function(t){if(!(!t||t<0||t>1)){var e=this.getWindow(),i=e.start.valueOf(),o=e.end.valueOf(),n=o-i,s=i-n*t/2,r=o+n*t/2;this.setWindow({start:s,end:r})}},o.prototype.redraw=function(){this._redraw()},o.prototype._redraw=function(){this.redrawCount++;var t=!1,e=this.options,i=this.props,o=this.dom;if(o&&o.container&&0!=o.root.offsetWidth){c.updateHiddenDates(this.options.moment,this.body,this.options.hiddenDates),"top"==e.orientation?(h.addClassName(o.root,"vis-top"),h.removeClassName(o.root,"vis-bottom")):(h.removeClassName(o.root,"vis-top"),h.addClassName(o.root,"vis-bottom")),o.root.style.maxHeight=h.option.asSize(e.maxHeight,""),o.root.style.minHeight=h.option.asSize(e.minHeight,""),o.root.style.width=h.option.asSize(e.width,""),i.border.left=(o.centerContainer.offsetWidth-o.centerContainer.clientWidth)/2,i.border.right=i.border.left,i.border.top=(o.centerContainer.offsetHeight-o.centerContainer.clientHeight)/2,i.border.bottom=i.border.top;var n=o.root.offsetHeight-o.root.clientHeight,s=o.root.offsetWidth-o.root.clientWidth;0===o.centerContainer.clientHeight&&(i.border.left=i.border.top,i.border.right=i.border.left),0===o.root.clientHeight&&(s=n),i.center.height=o.center.offsetHeight,i.left.height=o.left.offsetHeight,i.right.height=o.right.offsetHeight,i.top.height=o.top.clientHeight||-i.border.top,i.bottom.height=o.bottom.clientHeight||-i.border.bottom;var a=Math.max(i.left.height,i.center.height,i.right.height),d=i.top.height+a+i.bottom.height+n+i.border.top+i.border.bottom;o.root.style.height=h.option.asSize(e.height,d+"px"),i.root.height=o.root.offsetHeight,i.background.height=i.root.height-n;var l=i.root.height-i.top.height-i.bottom.height-n;i.centerContainer.height=l,i.leftContainer.height=l,i.rightContainer.height=i.leftContainer.height,i.root.width=o.root.offsetWidth,i.background.width=i.root.width-s,this.initialDrawDone||(i.scrollbarWidth=h.getScrollBarWidth()),this.options.verticalScroll?this.options.rtl?(i.left.width=o.leftContainer.clientWidth||-i.border.left,i.right.width=o.rightContainer.clientWidth+i.scrollbarWidth||-i.border.right):(i.left.width=o.leftContainer.clientWidth+i.scrollbarWidth||-i.border.left,i.right.width=o.rightContainer.clientWidth||-i.border.right):(i.left.width=o.leftContainer.clientWidth||-i.border.left,i.right.width=o.rightContainer.clientWidth||-i.border.right),i.leftContainer.width=i.left.width,i.rightContainer.width=i.right.width;var u=i.root.width-i.left.width-i.right.width-s;i.center.width=u,i.centerContainer.width=u,i.top.width=u,i.bottom.width=u,o.background.style.height=i.background.height+"px",o.backgroundVertical.style.height=i.background.height+"px",o.backgroundHorizontal.style.height=i.centerContainer.height+"px",o.centerContainer.style.height=i.centerContainer.height+"px",o.leftContainer.style.height=i.leftContainer.height+"px",o.rightContainer.style.height=i.rightContainer.height+"px",o.background.style.width=i.background.width+"px",o.backgroundVertical.style.width=i.centerContainer.width+"px",o.backgroundHorizontal.style.width=i.background.width+"px",o.centerContainer.style.width=i.center.width+"px",o.top.style.width=i.top.width+"px",o.bottom.style.width=i.bottom.width+"px",o.background.style.left="0",o.background.style.top="0",o.backgroundVertical.style.left=i.left.width+i.border.left+"px",o.backgroundVertical.style.top="0",o.backgroundHorizontal.style.left="0",o.backgroundHorizontal.style.top=i.top.height+"px",o.centerContainer.style.left=i.left.width+"px",o.centerContainer.style.top=i.top.height+"px",o.leftContainer.style.left="0",o.leftContainer.style.top=i.top.height+"px",o.rightContainer.style.left=i.left.width+i.center.width+"px",o.rightContainer.style.top=i.top.height+"px",o.top.style.left=i.left.width+"px",o.top.style.top="0",o.bottom.style.left=i.left.width+"px",o.bottom.style.top=i.top.height+i.centerContainer.height+"px";var p=this._updateScrollTop();"top"!=e.orientation.item&&(p+=Math.max(this.props.centerContainer.height-this.props.center.height-this.props.border.top-this.props.border.bottom,0)),o.center.style.left="0",o.center.style.top=p+"px",o.left.style.left="0",o.right.style.left="0";var f=0==this.props.scrollTop?"hidden":"",m=this.props.scrollTop==this.props.scrollTopMin?"hidden":"";o.shadowTop.style.visibility=f,o.shadowBottom.style.visibility=m,o.shadowTopLeft.style.visibility=f,o.shadowBottomLeft.style.visibility=m,o.shadowTopRight.style.visibility=f,o.shadowBottomRight.style.visibility=m,this.options.verticalScroll?(o.shadowTopRight.style.visibility="hidden",o.shadowBottomRight.style.visibility="hidden",o.shadowTopLeft.style.visibility="hidden",o.shadowBottomLeft.style.visibility="hidden"):(o.left.style.top=p+"px",o.right.style.top=p+"px");var v=this.props.center.height>this.props.centerContainer.height;this.hammer.get("pan").set({direction:v?r.DIRECTION_ALL:r.DIRECTION_HORIZONTAL}),this.components.forEach(function(e){t=e.redraw()||t});var g=5;if(t){if(this.redrawCount0&&(this.props.scrollTop=0),this.props.scrollTope&&o.push(h.id):h.lefti&&o.push(h.id)}return o},o.prototype._deselect=function(t){for(var e=this.selection,i=0,o=e.length;io)return}}if(e&&e!=this.groupTouchParams.group){var h=this.groupsData,d=h.get(e.groupId),l=h.get(this.groupTouchParams.group.groupId);l&&d&&(this.options.groupOrderSwap(l,d,this.groupsData),this.groupsData.update(l),this.groupsData.update(d));var c=this.groupsData.getIds({order:this.options.groupOrder});if(!r.equalArray(c,this.groupTouchParams.originalOrder))for(var h=this.groupsData,u=this.groupTouchParams.originalOrder,p=this.groupTouchParams.group.groupId,f=Math.min(u.length,c.length),m=0,v=0,g=0;m=f)break;if(c[m+v]!=p)if(u[m+g]!=p){var y=c.indexOf(u[m+g]),b=h.get(c[m+v]),_=h.get(u[m+g]);this.options.groupOrderSwap(b,_,h),h.update(b),h.update(_);var w=c[m+v];c[m+v]=u[m+g],c[y]=w,m++}else g=1;else v=1}}}},o.prototype._onGroupDragEnd=function(t){if(this.options.groupEditable.order&&this.groupTouchParams.group){t.stopPropagation();var e=this,i=e.groupTouchParams.group.groupId,o=e.groupsData.getDataSet(),n=r.extend({},o.get(i));e.options.onMoveGroup(n,function(t){if(t)t[o._fieldId]=i,o.update(t);else{var n=o.getIds({order:e.options.groupOrder});if(!r.equalArray(n,e.groupTouchParams.originalOrder))for(var s=e.groupTouchParams.originalOrder,a=Math.min(s.length,n.length),h=0;h=a)break;var d=n.indexOf(s[h]),l=o.get(n[h]),c=o.get(s[h]);e.options.groupOrderSwap(l,c,o),groupsData.update(l),groupsData.update(c);var u=n[h];n[h]=s[h],n[d]=u,h++}}}),e.body.emitter.emit("groupDragged",{groupId:i})}},o.prototype._onSelectItem=function(t){if(this.options.selectable){var e=t.srcEvent&&(t.srcEvent.ctrlKey||t.srcEvent.metaKey),i=t.srcEvent&&t.srcEvent.shiftKey;if(e||i)return void this._onMultiSelectItem(t);var o=this.getSelection(),n=this.itemFromTarget(t),s=n?[n.id]:[];this.setSelection(s);var r=this.getSelection();(r.length>0||o.length>0)&&this.body.emitter.emit("select",{items:r,event:t})}},o.prototype._onMouseOver=function(t){var e=this.itemFromTarget(t);e&&this.body.emitter.emit("itemover",{item:e.id,event:t})},o.prototype._onMouseOut=function(t){var e=this.itemFromTarget(t);e&&this.body.emitter.emit("itemout",{item:e.id,event:t})},o.prototype._onAddItem=function(t){if(this.options.selectable&&this.options.editable.add){var e=this,i=this.options.snap||null,o=this.itemFromTarget(t);if(o){var n=e.itemsData.get(o.id);this.options.onUpdate(n,function(t){t&&e.itemsData.getDataSet().update(t)})}else{if(this.options.rtl)var s=r.getAbsoluteRight(this.dom.frame),a=s-t.center.x;else var s=r.getAbsoluteLeft(this.dom.frame),a=t.center.x-s;var h=this.body.util.toTime(a),d=this.body.util.getScale(),l=this.body.util.getStep(),c={start:i?i(h,d,l):h,content:"new item"};if("drop"==t.type){var n=JSON.parse(t.dataTransfer.getData("text/plain"));if(c.content=n.content,c.type=n.type||"box",c[this.itemsData._fieldId]=n.id||r.randomUUID(),"range"==n.type||n.end&&n.start)if(n.end)c.end=new Date(c.start._i).getTime()+new Date(n.end).getTime()-new Date(n.start).getTime();else{var u=this.body.util.toTime(a+this.props.width/5);c.end=i?i(u,d,l):u}}else if(c[this.itemsData._fieldId]=r.randomUUID(),"range"===this.options.type){var u=this.body.util.toTime(a+this.props.width/5);c.end=i?i(u,d,l):u}var p=this.groupFromTarget(t);p&&(c.group=p.groupId),c=this._cloneItemData(c),this.options.onAdd(c,function(i){i&&(e.itemsData.getDataSet().add(i),"drop"==t.type&&e.setSelection([i.id]))})}}},o.prototype._onMultiSelectItem=function(t){if(this.options.selectable){var e=this.itemFromTarget(t);if(e){var i=this.options.multiselect?this.getSelection():[],n=t.srcEvent&&t.srcEvent.shiftKey||!1;if(n&&this.options.multiselect){var s=this.itemsData.get(e.id).group,r=void 0;this.options.multiselectPerGroup&&i.length>0&&(r=this.itemsData.get(i[0]).group),this.options.multiselectPerGroup&&void 0!=r&&r!=s||i.push(e.id);var a=o._getItemRange(this.itemsData.get(i,this.itemOptions));if(!this.options.multiselectPerGroup||r==s){i=[];for(var h in this.items)if(this.items.hasOwnProperty(h)){var d=this.items[h],l=d.data.start,c=void 0!==d.data.end?d.data.end:l;!(l>=a.min&&c<=a.max)||this.options.multiselectPerGroup&&r!=this.itemsData.get(d.id).group||d instanceof v||i.push(d.id)}}}else{var u=i.indexOf(e.id);u==-1?i.push(e.id):i.splice(u,1)}this.setSelection(i),this.body.emitter.emit("select",{items:this.getSelection(),event:t})}}},o._getItemRange=function(t){var e=null,i=null;return t.forEach(function(t){(null==i||t.starte)&&(e=t.end):(null==e||t.start>e)&&(e=t.start)}),{min:i,max:e}},o.prototype.itemFromTarget=function(t){for(var e=t.target;e;){if(e.hasOwnProperty("timeline-item"))return e["timeline-item"];e=e.parentNode}return null},o.prototype.groupFromTarget=function(t){for(var e=t.center?t.center.y:t.clientY,i=0;ia&&ea)return n}else if(0===i&&e0?t.step:1,this.autoScale=!1)},o.prototype.setAutoScale=function(t){this.autoScale=t},o.prototype.setMinimumStep=function(t){if(void 0!=t){var e=31104e6,i=2592e6,o=864e5,n=36e5,s=6e4,r=1e3,a=1;1e3*e>t&&(this.scale="year",this.step=1e3),500*e>t&&(this.scale="year",this.step=500),100*e>t&&(this.scale="year",this.step=100),50*e>t&&(this.scale="year",this.step=50),10*e>t&&(this.scale="year",this.step=10),5*e>t&&(this.scale="year",this.step=5),e>t&&(this.scale="year",this.step=1),3*i>t&&(this.scale="month",this.step=3),i>t&&(this.scale="month",this.step=1),5*o>t&&(this.scale="day",this.step=5),2*o>t&&(this.scale="day",this.step=2),o>t&&(this.scale="day",this.step=1),o/2>t&&(this.scale="weekday",this.step=1),4*n>t&&(this.scale="hour",this.step=4),n>t&&(this.scale="hour",this.step=1),15*s>t&&(this.scale="minute",this.step=15),10*s>t&&(this.scale="minute",this.step=10),5*s>t&&(this.scale="minute",this.step=5),s>t&&(this.scale="minute",this.step=1),15*r>t&&(this.scale="second",this.step=15),10*r>t&&(this.scale="second",this.step=10),5*r>t&&(this.scale="second",this.step=5),r>t&&(this.scale="second",this.step=1),200*a>t&&(this.scale="millisecond",this.step=200),100*a>t&&(this.scale="millisecond",this.step=100),50*a>t&&(this.scale="millisecond",this.step=50),10*a>t&&(this.scale="millisecond",this.step=10),5*a>t&&(this.scale="millisecond",this.step=5),a>t&&(this.scale="millisecond",this.step=1)}},o.snap=function(t,e,i){var o=n(t);if("year"==e){var s=o.year()+Math.round(o.month()/12);o.year(Math.round(s/i)*i),o.month(0),o.date(0),o.hours(0),o.minutes(0),o.seconds(0),o.milliseconds(0)}else if("month"==e)o.date()>15?(o.date(1),o.add(1,"month")):o.date(1),o.hours(0),o.minutes(0),o.seconds(0),o.milliseconds(0);else if("day"==e){switch(i){case 5:case 2:o.hours(24*Math.round(o.hours()/24));break;default:o.hours(12*Math.round(o.hours()/12))}o.minutes(0),o.seconds(0),o.milliseconds(0)}else if("weekday"==e){switch(i){case 5:case 2:o.hours(12*Math.round(o.hours()/12));break;default:o.hours(6*Math.round(o.hours()/6))}o.minutes(0),o.seconds(0),o.milliseconds(0)}else if("hour"==e){switch(i){case 4:o.minutes(60*Math.round(o.minutes()/60));break;default:o.minutes(30*Math.round(o.minutes()/30))}o.seconds(0),o.milliseconds(0)}else if("minute"==e){switch(i){case 15:case 10:o.minutes(5*Math.round(o.minutes()/5)),o.seconds(0);break;case 5:o.seconds(60*Math.round(o.seconds()/60));break;default:o.seconds(30*Math.round(o.seconds()/30))}o.milliseconds(0)}else if("second"==e)switch(i){case 15:case 10:o.seconds(5*Math.round(o.seconds()/5)),o.milliseconds(0);break;case 5:o.milliseconds(1e3*Math.round(o.milliseconds()/1e3));break;default:o.milliseconds(500*Math.round(o.milliseconds()/500))}else if("millisecond"==e){var r=i>5?i/2:1;o.milliseconds(Math.round(o.milliseconds()/r)*r)}return o},o.prototype.isMajor=function(){if(1==this.switchedYear)switch(this.scale){case"year":case"month":case"weekday":case"day":case"hour":case"minute":case"second":case"millisecond":return!0;default:return!1}else if(1==this.switchedMonth)switch(this.scale){case"weekday":case"day":case"hour":case"minute":case"second":case"millisecond":return!0;default:return!1}else if(1==this.switchedDay)switch(this.scale){case"millisecond":case"second":case"minute":case"hour":return!0;default:return!1}var t=this.moment(this.current);switch(this.scale){case"millisecond":return 0==t.milliseconds();case"second":return 0==t.seconds();case"minute":return 0==t.hours()&&0==t.minutes();case"hour":return 0==t.hours();case"weekday":case"day":return 1==t.date();case"month":return 0==t.month();case"year":return!1;default:return!1}},o.prototype.getLabelMinor=function(t){if(void 0==t&&(t=this.current),"function"==typeof this.format.minorLabels)return this.format.minorLabels(t,this.scale,this.step);var e=this.format.minorLabels[this.scale];return e&&e.length>0?this.moment(t).format(e):""},o.prototype.getLabelMajor=function(t){if(void 0==t&&(t=this.current),"function"==typeof this.format.majorLabels)return this.format.majorLabels(t,this.scale,this.step);var e=this.format.majorLabels[this.scale];return e&&e.length>0?this.moment(t).format(e):""},o.prototype.getClassName=function(){function t(t){return t/h%2==0?" vis-even":" vis-odd"}function e(t){return t.isSame(new Date,"day")?" vis-today":t.isSame(s().add(1,"day"),"day")?" vis-tomorrow":t.isSame(s().add(-1,"day"),"day")?" vis-yesterday":""}function i(t){return t.isSame(new Date,"week")?" vis-current-week":""}function o(t){return t.isSame(new Date,"month")?" vis-current-month":""}function n(t){return t.isSame(new Date,"year")?" vis-current-year":""}var s=this.moment,r=this.moment(this.current),a=r.locale?r.locale("en"):r.lang("en"),h=this.step;switch(this.scale){case"millisecond":return e(a)+t(a.milliseconds()).trim();case"second":return e(a)+t(a.seconds()).trim();case"minute":return e(a)+t(a.minutes()).trim();case"hour":return"vis-h"+a.hours()+(4==this.step?"-h"+(a.hours()+4):"")+e(a)+t(a.hours());case"weekday":return"vis-"+a.format("dddd").toLowerCase()+e(a)+i(a)+t(a.date());case"day":return"vis-day"+a.date()+" vis-"+a.format("MMMM").toLowerCase()+e(a)+o(a)+this.step<=2?e(a):""+this.step<=2?" vis-"+a.format("dddd").toLowerCase():""+t(a.date()-1);case"month":return"vis-"+a.format("MMMM").toLowerCase()+o(a)+t(a.month());case"year":var d=a.year();return"vis-year"+d+n(a)+t(d);default:return""}},t.exports=o},function(t,e,i){function o(t,e,i){this.groupId=t,this.subgroups={},this.subgroupIndex=0,this.subgroupOrderer=e&&e.subgroupOrder,this.itemSet=i,this.isVisible=null,this.dom={},this.props={label:{width:0,height:0}},this.className=null,this.items={},this.visibleItems=[],this.orderedItems={byStart:[],byEnd:[]},this.checkRangedItems=!1;var o=this;this.itemSet.body.emitter.on("checkRangedItems",function(){o.checkRangedItems=!0}),this._create(),this.setData(e)}var n=i(1),s=i(39);i(40);o.prototype._create=function(){var t=document.createElement("div"); -this.itemSet.options.groupEditable.order?t.className="vis-label draggable":t.className="vis-label",this.dom.label=t;var e=document.createElement("div");e.className="vis-inner",t.appendChild(e),this.dom.inner=e;var i=document.createElement("div");i.className="vis-group",i["timeline-group"]=this,this.dom.foreground=i,this.dom.background=document.createElement("div"),this.dom.background.className="vis-group",this.dom.axis=document.createElement("div"),this.dom.axis.className="vis-group",this.dom.marker=document.createElement("div"),this.dom.marker.style.visibility="hidden",this.dom.marker.innerHTML="?",this.dom.background.appendChild(this.dom.marker)},o.prototype.setData=function(t){var e,i;if(this.itemSet.options&&this.itemSet.options.groupTemplate?(i=this.itemSet.options.groupTemplate.bind(this),e=i(t,this.dom.inner)):e=t&&t.content,e instanceof Element){for(this.dom.inner.appendChild(e);this.dom.inner.firstChild;)this.dom.inner.removeChild(this.dom.inner.firstChild);this.dom.inner.appendChild(e)}else e instanceof Object?i(t,this.dom.inner):void 0!==e&&null!==e?this.dom.inner.innerHTML=e:this.dom.inner.innerHTML=this.groupId||"";this.dom.label.title=t&&t.title||"",this.dom.inner.firstChild?n.removeClassName(this.dom.inner,"vis-hidden"):n.addClassName(this.dom.inner,"vis-hidden");var o=t&&t.className||null;o!=this.className&&(this.className&&(n.removeClassName(this.dom.label,this.className),n.removeClassName(this.dom.foreground,this.className),n.removeClassName(this.dom.background,this.className),n.removeClassName(this.dom.axis,this.className)),n.addClassName(this.dom.label,o),n.addClassName(this.dom.foreground,o),n.addClassName(this.dom.background,o),n.addClassName(this.dom.axis,o),this.className=o),this.style&&(n.removeCssText(this.dom.label,this.style),this.style=null),t&&t.style&&(n.addCssText(this.dom.label,t.style),this.style=t.style)},o.prototype.getLabelWidth=function(){return this.props.label.width},o.prototype.redraw=function(t,e,i){var o=!1,r=this.dom.marker.clientHeight;r!=this.lastMarkerHeight&&(this.lastMarkerHeight=r,n.forEach(this.items,function(t){t.dirty=!0,t.displayed&&t.redraw()}),i=!0),this._calculateSubGroupHeights(),this.isVisible=this._isGroupVisible(t,e);var a=this.dom.foreground;if(this.top=a.offsetTop,this.right=a.offsetLeft,this.width=a.offsetWidth,this.isVisible=this._isGroupVisible(t,e),"function"==typeof this.itemSet.options.order){if(i){var h=this,d=!1;n.forEach(this.items,function(t){t.displayed||(t.redraw(),h.visibleItems.push(t)),t.repositionX(d)});var l=this.orderedItems.byStart.slice().sort(function(t,e){return h.itemSet.options.order(t.data,e.data)});s.stack(l,e,!0)}this.visibleItems=this._updateVisibleItems(this.orderedItems,this.visibleItems,t)}else this.visibleItems=this._updateVisibleItems(this.orderedItems,this.visibleItems,t),this.itemSet.options.stack?s.stack(this.visibleItems,e,i):s.nostack(this.visibleItems,e,this.subgroups);if(!this.isVisible&&this.height)return o=!1;var c=this._calculateHeight(e),a=this.dom.foreground;this.top=a.offsetTop,this.right=a.offsetLeft,this.width=a.offsetWidth,o=n.updateProperty(this,"height",c)||o,o=n.updateProperty(this.props.label,"width",this.dom.inner.clientWidth)||o,o=n.updateProperty(this.props.label,"height",this.dom.inner.clientHeight)||o,this.dom.background.style.height=c+"px",this.dom.foreground.style.height=c+"px",this.dom.label.style.height=c+"px";for(var u=0,p=this.visibleItems.length;u0){var t=this;this.resetSubgroups(),n.forEach(this.visibleItems,function(e){void 0!==e.data.subgroup&&(t.subgroups[e.data.subgroup].height=Math.max(t.subgroups[e.data.subgroup].height,e.height),t.subgroups[e.data.subgroup].visible=!0)})}},o.prototype._isGroupVisible=function(t,e){var i=this.top<=t.body.domProps.centerContainer.height-t.body.domProps.scrollTop+e.axis&&this.top+this.height+e.axis>=-t.body.domProps.scrollTop;return i},o.prototype._calculateHeight=function(t){var e,i=this.visibleItems;if(i.length>0){var o=i[0].top,s=i[0].top+i[0].height;if(n.forEach(i,function(t){o=Math.min(o,t.top),s=Math.max(s,t.top+t.height)}),o>t.axis){var r=o-t.axis;s-=r,n.forEach(i,function(t){t.top-=r})}e=s+t.item.vertical/2}else e=0;return e=Math.max(e,this.props.label.height)},o.prototype.show=function(){this.dom.label.parentNode||this.itemSet.dom.labelSet.appendChild(this.dom.label),this.dom.foreground.parentNode||this.itemSet.dom.foreground.appendChild(this.dom.foreground),this.dom.background.parentNode||this.itemSet.dom.background.appendChild(this.dom.background),this.dom.axis.parentNode||this.itemSet.dom.axis.appendChild(this.dom.axis)},o.prototype.hide=function(){var t=this.dom.label;t.parentNode&&t.parentNode.removeChild(t);var e=this.dom.foreground;e.parentNode&&e.parentNode.removeChild(e);var i=this.dom.background;i.parentNode&&i.parentNode.removeChild(i);var o=this.dom.axis;o.parentNode&&o.parentNode.removeChild(o)},o.prototype.add=function(t){if(this.items[t.id]=t,t.setParent(this),void 0!==t.data.subgroup&&(void 0===this.subgroups[t.data.subgroup]&&(this.subgroups[t.data.subgroup]={height:0,visible:!1,index:this.subgroupIndex,items:[]},this.subgroupIndex++),this.subgroups[t.data.subgroup].items.push(t)),this.orderSubgroups(),this.visibleItems.indexOf(t)==-1){var e=this.itemSet.body.range;this._checkIfVisible(t,this.visibleItems,e)}},o.prototype.orderSubgroups=function(){if(void 0!==this.subgroupOrderer){var t=[];if("string"==typeof this.subgroupOrderer){for(var e in this.subgroups)t.push({subgroup:e,sortField:this.subgroups[e].items[0].data[this.subgroupOrderer]});t.sort(function(t,e){return t.sortField-e.sortField})}else if("function"==typeof this.subgroupOrderer){for(var e in this.subgroups)t.push(this.subgroups[e].items[0].data);t.sort(this.subgroupOrderer)}if(t.length>0)for(var i=0;i0)for(var r=0;rl}),1==this.checkRangedItems)for(this.checkRangedItems=!1,r=0;rl})}for(var r=0;r=0;s--){var r=e[s];if(n(r))break;void 0===o[r.id]&&(o[r.id]=!0,i.push(r))}for(var s=t+1;se.right&&t.top-o.vertical+ie.top:t.left-o.horizontal+ie.left&&t.top-o.vertical+ie.top}},function(t,e,i){function o(t,e,i){if(this.props={content:{width:0}},this.overflow=!1,this.options=i,t){if(void 0==t.start)throw new Error('Property "start" missing in item '+t.id);if(void 0==t.end)throw new Error('Property "end" missing in item '+t.id)}n.call(this,t,e,i)}var n=(i(22),i(41));o.prototype=new n(null,null,null),o.prototype.baseClassName="vis-item vis-range",o.prototype.isVisible=function(t){return this.data.startt.start},o.prototype.redraw=function(){var t=this.dom;if(t||(this.dom={},t=this.dom,t.box=document.createElement("div"),t.frame=document.createElement("div"),t.frame.className="vis-item-overflow",t.box.appendChild(t.frame),t.content=document.createElement("div"),t.content.className="vis-item-content",t.frame.appendChild(t.content),t.box["timeline-item"]=this,this.dirty=!0),!this.parent)throw new Error("Cannot redraw item: no parent attached");if(!t.box.parentNode){var e=this.parent.dom.foreground;if(!e)throw new Error("Cannot redraw item: parent has no foreground container element");e.appendChild(t.box)}if(this.displayed=!0,this.dirty){this._updateContents(this.dom.content),this._updateTitle(this.dom.box),this._updateDataAttributes(this.dom.box),this._updateStyle(this.dom.box);var i=(this.options.editable.updateTime||this.options.editable.updateGroup||this.editable===!0)&&this.editable!==!1,o=(this.data.className?" "+this.data.className:"")+(this.selected?" vis-selected":"")+(i?" vis-editable":" vis-readonly");t.box.className=this.baseClassName+o,this.overflow="hidden"!==window.getComputedStyle(t.frame).overflow,this.dom.content.style.maxWidth="none",this.props.content.width=this.dom.content.offsetWidth,this.height=this.dom.box.offsetHeight,this.dom.content.style.maxWidth="",this.dirty=!1}this._repaintOnItemUpdateTimeTooltip(t.box),this._repaintDeleteButton(t.box),this._repaintDragCenter(),this._repaintDragLeft(),this._repaintDragRight()},o.prototype.show=function(){this.displayed||this.redraw()},o.prototype.hide=function(){if(this.displayed){var t=this.dom.box;t.parentNode&&t.parentNode.removeChild(t),this.displayed=!1}},o.prototype.repositionX=function(t){var e,i,o=this.parent.width,n=this.conversion.toScreen(this.data.start),s=this.conversion.toScreen(this.data.end);void 0!==t&&t!==!0||(n<-o&&(n=-o),s>2*o&&(s=2*o));var r=Math.max(s-n+.5,1);switch(this.overflow?(this.options.rtl?this.right=n:this.left=n,this.width=r+this.props.content.width,i=this.props.content.width):(this.options.rtl?this.right=n:this.left=n,this.width=r,i=Math.min(s-n,this.props.content.width)),this.options.rtl?this.dom.box.style.right=this.right+"px":this.dom.box.style.left=this.left+"px",this.dom.box.style.width=r+"px",this.options.align){case"left":this.options.rtl?this.dom.content.style.right="0":this.dom.content.style.left="0";break;case"right":this.options.rtl?this.dom.content.style.right=Math.max(r-i,0)+"px":this.dom.content.style.left=Math.max(r-i,0)+"px";break;case"center":this.options.rtl?this.dom.content.style.right=Math.max((r-i)/2,0)+"px":this.dom.content.style.left=Math.max((r-i)/2,0)+"px";break;default:e=this.overflow?s>0?Math.max(-n,0):-i:n<0?-n:0,this.options.rtl?this.dom.content.style.right=e+"px":(this.dom.content.style.left=e+"px",this.dom.content.style.width="calc(100% - "+e+"px)")}},o.prototype.repositionY=function(){var t=this.options.orientation.item,e=this.dom.box;"top"==t?e.style.top=this.top+"px":e.style.top=this.parent.height-this.top-this.height+"px"},o.prototype._repaintDragLeft=function(){if(this.selected&&this.options.editable.updateTime&&!this.dom.dragLeft){var t=document.createElement("div");t.className="vis-drag-left",t.dragLeftItem=this,this.dom.box.appendChild(t),this.dom.dragLeft=t}else!this.selected&&this.dom.dragLeft&&(this.dom.dragLeft.parentNode&&this.dom.dragLeft.parentNode.removeChild(this.dom.dragLeft),this.dom.dragLeft=null)},o.prototype._repaintDragRight=function(){if(this.selected&&this.options.editable.updateTime&&!this.dom.dragRight){var t=document.createElement("div");t.className="vis-drag-right",t.dragRightItem=this,this.dom.box.appendChild(t),this.dom.dragRight=t}else!this.selected&&this.dom.dragRight&&(this.dom.dragRight.parentNode&&this.dom.dragRight.parentNode.removeChild(this.dom.dragRight),this.dom.dragRight=null)},t.exports=o},function(t,e,i){function o(t,e,i){this.id=null,this.parent=null,this.data=t,this.dom=null,this.conversion=e||{},this.options=i||{},this.selected=!1,this.displayed=!1,this.dirty=!0,this.top=null,this.right=null,this.left=null,this.width=null,this.height=null,this.editable=null,this.data&&this.data.hasOwnProperty("editable")&&"boolean"==typeof this.data.editable&&(this.editable=t.editable)}var n=i(22),s=i(1),r=i(2);o.prototype.stack=!0,o.prototype.select=function(){this.selected=!0,this.dirty=!0,this.displayed&&this.redraw()},o.prototype.unselect=function(){this.selected=!1,this.dirty=!0,this.displayed&&this.redraw()},o.prototype.setData=function(t){var e=void 0!=t.group&&this.data.group!=t.group;e&&this.parent.itemSet._moveToGroup(this,t.group),t.hasOwnProperty("editable")&&"boolean"==typeof t.editable&&(this.editable=t.editable),this.data=t,this.dirty=!0,this.displayed&&this.redraw()},o.prototype.setParent=function(t){this.displayed?(this.hide(),this.parent=t,this.parent&&this.show()):this.parent=t},o.prototype.isVisible=function(t){return!1},o.prototype.show=function(){return!1},o.prototype.hide=function(){return!1},o.prototype.redraw=function(){},o.prototype.repositionX=function(){},o.prototype.repositionY=function(){},o.prototype._repaintDeleteButton=function(t){var e=(this.options.editable.remove||this.data.editable===!0)&&this.data.editable!==!1;if(this.selected&&e&&!this.dom.deleteButton){var i=this,o=document.createElement("div");this.options.rtl?o.className="vis-delete-rtl":o.className="vis-delete",o.title="Delete this item",new n(o).on("tap",function(t){t.stopPropagation(),i.parent.removeFromDataSet(i)}),t.appendChild(o),this.dom.deleteButton=o}else!this.selected&&this.dom.deleteButton&&(this.dom.deleteButton.parentNode&&this.dom.deleteButton.parentNode.removeChild(this.dom.deleteButton),this.dom.deleteButton=null)},o.prototype._repaintOnItemUpdateTimeTooltip=function(t){if(this.options.tooltipOnItemUpdateTime){var e=(this.options.editable.updateTime||this.data.editable===!0)&&this.data.editable!==!1;if(this.selected&&e&&!this.dom.onItemUpdateTimeTooltip){var i=document.createElement("div");i.className="vis-onUpdateTime-tooltip",t.appendChild(i),this.dom.onItemUpdateTimeTooltip=i}else!this.selected&&this.dom.onItemUpdateTimeTooltip&&(this.dom.onItemUpdateTimeTooltip.parentNode&&this.dom.onItemUpdateTimeTooltip.parentNode.removeChild(this.dom.onItemUpdateTimeTooltip),this.dom.onItemUpdateTimeTooltip=null);if(this.dom.onItemUpdateTimeTooltip){this.dom.onItemUpdateTimeTooltip.style.visibility=this.parent.itemSet.touchParams.itemIsDragging?"visible":"hidden",this.options.rtl?this.dom.onItemUpdateTimeTooltip.style.right=this.dom.content.style.right:this.dom.onItemUpdateTimeTooltip.style.left=this.dom.content.style.left;var o,n=50,s=this.parent.itemSet.body.domProps.scrollTop;o="top"==this.options.orientation.item?this.top:this.parent.height-this.top-this.height;var a=o+this.parent.top-n<-s;a?(this.dom.onItemUpdateTimeTooltip.style.bottom="",this.dom.onItemUpdateTimeTooltip.style.top=this.height+2+"px"):(this.dom.onItemUpdateTimeTooltip.style.top="",this.dom.onItemUpdateTimeTooltip.style.bottom=this.height+2+"px");var h,d;this.options.tooltipOnItemUpdateTime&&this.options.tooltipOnItemUpdateTime.template?(d=this.options.tooltipOnItemUpdateTime.template.bind(this),h=d(this.data)):(h="start: "+r(this.data.start).format("MM/DD/YYYY hh:mm"),this.data.end&&(h+="
end: "+r(this.data.end).format("MM/DD/YYYY hh:mm"))),this.dom.onItemUpdateTimeTooltip.innerHTML=h}}},o.prototype._updateContents=function(t){var e,i;if(this.options.template){var o=this.parent.itemSet.itemsData.get(this.id);i=this.options.template.bind(this),e=i(o,t)}else e=this.data.content;if(e instanceof Object&&!(e instanceof Element))i(o,t);else{var n=this._contentToString(this.content)!==this._contentToString(e);if(n){if(e instanceof Element)t.innerHTML="",t.appendChild(e);else if(void 0!=e)t.innerHTML=e;else if("background"!=this.data.type||void 0!==this.data.content)throw new Error('Property "content" missing in item '+this.id);this.content=e}}},o.prototype._updateTitle=function(t){null!=this.data.title?t.title=this.data.title||"":t.removeAttribute("vis-title")},o.prototype._updateDataAttributes=function(t){if(this.options.dataAttributes&&this.options.dataAttributes.length>0){var e=[];if(Array.isArray(this.options.dataAttributes))e=this.options.dataAttributes;else{if("all"!=this.options.dataAttributes)return;e=Object.keys(this.data)}for(var i=0;it.start&&this.data.start.getTime()-nt.start&&this.data.start.getTime()t.start&&this.data.start.getTime()-n/2t.start&&this.data.startt.start},o.prototype.redraw=function(){var t=this.dom;if(t||(this.dom={},t=this.dom,t.box=document.createElement("div"),t.frame=document.createElement("div"),t.frame.className="vis-item-overflow",t.box.appendChild(t.frame),t.content=document.createElement("div"),t.content.className="vis-item-content",t.frame.appendChild(t.content),this.dirty=!0),!this.parent)throw new Error("Cannot redraw item: no parent attached");if(!t.box.parentNode){var e=this.parent.dom.background;if(!e)throw new Error("Cannot redraw item: parent has no background container element");e.appendChild(t.box)}if(this.displayed=!0,this.dirty){this._updateContents(this.dom.content),this._updateTitle(this.dom.content),this._updateDataAttributes(this.dom.content),this._updateStyle(this.dom.box);var i=(this.data.className?" "+this.data.className:"")+(this.selected?" vis-selected":"");t.box.className=this.baseClassName+i,this.overflow="hidden"!==window.getComputedStyle(t.content).overflow,this.props.content.width=this.dom.content.offsetWidth,this.height=0,this.dirty=!1}},o.prototype.show=r.prototype.show,o.prototype.hide=r.prototype.hide,o.prototype.repositionX=r.prototype.repositionX,o.prototype.repositionY=function(t){var e="top"===this.options.orientation.item;this.dom.content.style.top=e?"":"0",this.dom.content.style.bottom=e?"0":"";var i;if(void 0!==this.data.subgroup){var o=this.data.subgroup,n=this.parent.subgroups,r=n[o].index;if(1==e){i=this.parent.subgroups[o].height+t.item.vertical,i+=0==r?t.axis-.5*t.item.vertical:0;var a=this.parent.top;for(var h in n)n.hasOwnProperty(h)&&1==n[h].visible&&n[h].indexr&&(a+=l)}i=this.parent.subgroups[o].height+t.item.vertical,this.dom.box.style.top=this.parent.height-d+a+"px",this.dom.box.style.bottom=""}}else this.parent instanceof s?(i=Math.max(this.parent.height,this.parent.itemSet.body.domProps.center.height,this.parent.itemSet.body.domProps.centerContainer.height),this.dom.box.style.top=e?"0":"",this.dom.box.style.bottom=e?"":"0"):(i=this.parent.height,this.dom.box.style.top=this.parent.top+"px",this.dom.box.style.bottom="");this.dom.box.style.height=i+"px"},t.exports=o},function(t,e,i){function o(t,e){this.dom={foreground:null,lines:[],majorTexts:[],minorTexts:[],redundant:{lines:[],majorTexts:[],minorTexts:[]}},this.props={range:{start:0,end:0,minimumStep:0},lineTop:0},this.defaultOptions={orientation:{axis:"bottom"},showMinorLabels:!0,showMajorLabels:!0,maxMinorChars:7,format:a.FORMAT,moment:d,timeAxis:null},this.options=s.extend({},this.defaultOptions),this.body=t,this._create(),this.setOptions(e)}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s=i(1),r=i(33),a=i(37),h=i(34),d=i(2);o.prototype=new r,o.prototype.setOptions=function(t){t&&(s.selectiveExtend(["showMinorLabels","showMajorLabels","maxMinorChars","hiddenDates","timeAxis","moment","rtl"],this.options,t),s.selectiveDeepExtend(["format"],this.options,t),"orientation"in t&&("string"==typeof t.orientation?this.options.orientation.axis=t.orientation:"object"===n(t.orientation)&&"axis"in t.orientation&&(this.options.orientation.axis=t.orientation.axis)),"locale"in t&&("function"==typeof d.locale?d.locale(t.locale):d.lang(t.locale)))},o.prototype._create=function(){this.dom.foreground=document.createElement("div"),this.dom.background=document.createElement("div"),this.dom.foreground.className="vis-time-axis vis-foreground",this.dom.background.className="vis-time-axis vis-background"},o.prototype.destroy=function(){this.dom.foreground.parentNode&&this.dom.foreground.parentNode.removeChild(this.dom.foreground),this.dom.background.parentNode&&this.dom.background.parentNode.removeChild(this.dom.background),this.body=null},o.prototype.redraw=function(){var t=this.props,e=this.dom.foreground,i=this.dom.background,o="top"==this.options.orientation.axis?this.body.dom.top:this.body.dom.bottom,n=e.parentNode!==o; -this._calculateCharSize();var s=this.options.showMinorLabels&&"none"!==this.options.orientation.axis,r=this.options.showMajorLabels&&"none"!==this.options.orientation.axis;t.minorLabelHeight=s?t.minorCharHeight:0,t.majorLabelHeight=r?t.majorCharHeight:0,t.height=t.minorLabelHeight+t.majorLabelHeight,t.width=e.offsetWidth,t.minorLineHeight=this.body.domProps.root.height-t.majorLabelHeight-("top"==this.options.orientation.axis?this.body.domProps.bottom.height:this.body.domProps.top.height),t.minorLineWidth=1,t.majorLineHeight=t.minorLineHeight+t.majorLabelHeight,t.majorLineWidth=1;var a=e.nextSibling,h=i.nextSibling;return e.parentNode&&e.parentNode.removeChild(e),i.parentNode&&i.parentNode.removeChild(i),e.style.height=this.props.height+"px",this._repaintLabels(),a?o.insertBefore(e,a):o.appendChild(e),h?this.body.dom.backgroundVertical.insertBefore(i,h):this.body.dom.backgroundVertical.appendChild(i),this._isResized()||n},o.prototype._repaintLabels=function(){var t=this.options.orientation.axis,e=s.convert(this.body.range.start,"Number"),i=s.convert(this.body.range.end,"Number"),o=this.body.util.toTime((this.props.minorCharWidth||10)*this.options.maxMinorChars).valueOf(),n=o-h.getHiddenDurationBefore(this.options.moment,this.body.hiddenDates,this.body.range,o);n-=this.body.util.toTime(0).valueOf();var r=new a(new Date(e),new Date(i),n,this.body.hiddenDates);r.setMoment(this.options.moment),this.options.format&&r.setFormat(this.options.format),this.options.timeAxis&&r.setScale(this.options.timeAxis),this.step=r;var d=this.dom;d.redundant.lines=d.lines,d.redundant.majorTexts=d.majorTexts,d.redundant.minorTexts=d.minorTexts,d.lines=[],d.majorTexts=[],d.minorTexts=[];var c,u,p,f,m,v,g,y,b,_,w=0,x=void 0,k=0,O=1e3;for(r.start(),u=r.getCurrent(),f=this.body.util.toScreen(u);r.hasNext()&&k=.4*g;if(this.options.showMinorLabels&&D){var S=this._repaintMinorText(p,b,t,_);S.style.width=w+"px"}m&&this.options.showMajorLabels?(p>0&&(void 0==x&&(x=p),S=this._repaintMajorText(p,r.getLabelMajor(),t,_)),y=this._repaintMajorLine(p,w,t,_)):D?y=this._repaintMinorLine(p,w,t,_):y&&(y.style.width=parseInt(y.style.width)+w+"px")}if(k!==O||l||(console.warn("Something is wrong with the Timeline scale. Limited drawing of grid lines to "+O+" lines."),l=!0),this.options.showMajorLabels){var C=this.body.util.toTime(0),T=r.getLabelMajor(C),E=T.length*(this.props.majorCharWidth||10)+10;(void 0==x||E1e3&&(o=1e3),e.redraw(),e.body.emitter.emit("currentTimeTick"),e.currentTimeTimer=setTimeout(t,o)}var e=this;t()},o.prototype.stop=function(){void 0!==this.currentTimeTimer&&(clearTimeout(this.currentTimeTimer),delete this.currentTimeTimer)},o.prototype.setCurrentTime=function(t){var e=n.convert(t,"Date").valueOf(),i=(new Date).valueOf();this.offset=e-i,this.redraw()},o.prototype.getCurrentTime=function(){return new Date((new Date).valueOf()+this.offset)},t.exports=o},function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i="string",o="boolean",n="number",s="array",r="date",a="object",h="dom",d="moment",l="any",c={configure:{enabled:{boolean:o},filter:{boolean:o,function:"function"},container:{dom:h},__type__:{object:a,boolean:o,function:"function"}},align:{string:i},rtl:{boolean:o,undefined:"undefined"},verticalScroll:{boolean:o,undefined:"undefined"},horizontalScroll:{boolean:o,undefined:"undefined"},autoResize:{boolean:o},clickToUse:{boolean:o},dataAttributes:{string:i,array:s},editable:{add:{boolean:o,undefined:"undefined"},remove:{boolean:o,undefined:"undefined"},updateGroup:{boolean:o,undefined:"undefined"},updateTime:{boolean:o,undefined:"undefined"},__type__:{boolean:o,object:a}},end:{number:n,date:r,string:i,moment:d},format:{minorLabels:{millisecond:{string:i,undefined:"undefined"},second:{string:i,undefined:"undefined"},minute:{string:i,undefined:"undefined"},hour:{string:i,undefined:"undefined"},weekday:{string:i,undefined:"undefined"},day:{string:i,undefined:"undefined"},month:{string:i,undefined:"undefined"},year:{string:i,undefined:"undefined"},__type__:{object:a,function:"function"}},majorLabels:{millisecond:{string:i,undefined:"undefined"},second:{string:i,undefined:"undefined"},minute:{string:i,undefined:"undefined"},hour:{string:i,undefined:"undefined"},weekday:{string:i,undefined:"undefined"},day:{string:i,undefined:"undefined"},month:{string:i,undefined:"undefined"},year:{string:i,undefined:"undefined"},__type__:{object:a,function:"function"}},__type__:{object:a}},moment:{function:"function"},groupOrder:{string:i,function:"function"},groupEditable:{add:{boolean:o,undefined:"undefined"},remove:{boolean:o,undefined:"undefined"},order:{boolean:o,undefined:"undefined"},__type__:{boolean:o,object:a}},groupOrderSwap:{function:"function"},height:{string:i,number:n},hiddenDates:{start:{date:r,number:n,string:i,moment:d},end:{date:r,number:n,string:i,moment:d},repeat:{string:i},__type__:{object:a,array:s}},itemsAlwaysDraggable:{boolean:o},locale:{string:i},locales:{__any__:{any:l},__type__:{object:a}},margin:{axis:{number:n},item:{horizontal:{number:n,undefined:"undefined"},vertical:{number:n,undefined:"undefined"},__type__:{object:a,number:n}},__type__:{object:a,number:n}},max:{date:r,number:n,string:i,moment:d},maxHeight:{number:n,string:i},maxMinorChars:{number:n},min:{date:r,number:n,string:i,moment:d},minHeight:{number:n,string:i},moveable:{boolean:o},multiselect:{boolean:o},multiselectPerGroup:{boolean:o},onAdd:{function:"function"},onUpdate:{function:"function"},onMove:{function:"function"},onMoving:{function:"function"},onRemove:{function:"function"},onAddGroup:{function:"function"},onMoveGroup:{function:"function"},onRemoveGroup:{function:"function"},order:{function:"function"},orientation:{axis:{string:i,undefined:"undefined"},item:{string:i,undefined:"undefined"},__type__:{string:i,object:a}},selectable:{boolean:o},showCurrentTime:{boolean:o},showMajorLabels:{boolean:o},showMinorLabels:{boolean:o},stack:{boolean:o},snap:{function:"function",null:"null"},start:{date:r,number:n,string:i,moment:d},template:{function:"function"},groupTemplate:{function:"function"},tooltipOnItemUpdateTime:{template:{function:"function"},__type__:{boolean:o,object:a}},timeAxis:{scale:{string:i,undefined:"undefined"},step:{number:n,undefined:"undefined"},__type__:{object:a}},type:{string:i},width:{string:i,number:n},zoomable:{boolean:o},zoomKey:{string:["ctrlKey","altKey","metaKey",""]},zoomMax:{number:n},zoomMin:{number:n},__type__:{object:a}},u={global:{align:["center","left","right"],direction:!1,autoResize:!0,clickToUse:!1,editable:{add:!1,remove:!1,updateGroup:!1,updateTime:!1},end:"",format:{minorLabels:{millisecond:"SSS",second:"s",minute:"HH:mm",hour:"HH:mm",weekday:"ddd D",day:"D",month:"MMM",year:"YYYY"},majorLabels:{millisecond:"HH:mm:ss",second:"D MMMM HH:mm",minute:"ddd D MMMM",hour:"ddd D MMMM",weekday:"MMMM YYYY",day:"MMMM YYYY",month:"YYYY",year:""}},groupsDraggable:!1,height:"",locale:"",margin:{axis:[20,0,100,1],item:{horizontal:[10,0,100,1],vertical:[10,0,100,1]}},max:"",maxHeight:"",maxMinorChars:[7,0,20,1],min:"",minHeight:"",moveable:!1,multiselect:!1,multiselectPerGroup:!1,orientation:{axis:["both","bottom","top"],item:["bottom","top"]},selectable:!0,showCurrentTime:!1,showMajorLabels:!0,showMinorLabels:!0,stack:!0,start:"",tooltipOnItemUpdateTime:!1,type:["box","point","range","background"],width:"100%",zoomable:!0,zoomKey:["ctrlKey","altKey","metaKey",""],zoomMax:[31536e10,10,31536e10,1],zoomMin:[10,10,31536e10,1]}};e.allOptions=c,e.configureOptions=u},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e,i,o){if(!(Array.isArray(i)||i instanceof c||i instanceof u)&&i instanceof Object){var n=o;o=i,i=n}var s=this;this.defaultOptions={start:null,end:null,autoResize:!0,orientation:{axis:"bottom",item:"bottom"},moment:d,width:null,height:null,maxHeight:null,minHeight:null},this.options=l.deepExtend({},this.defaultOptions),this._create(t),this.components=[],this.body={dom:this.dom,domProps:this.props,emitter:{on:this.on.bind(this),off:this.off.bind(this),emit:this.emit.bind(this)},hiddenDates:[],util:{toScreen:s._toScreen.bind(s),toGlobalScreen:s._toGlobalScreen.bind(s),toTime:s._toTime.bind(s),toGlobalTime:s._toGlobalTime.bind(s)}},this.range=new p(this.body),this.components.push(this.range),this.body.range=this.range,this.timeAxis=new m(this.body),this.components.push(this.timeAxis),this.currentTime=new v(this.body),this.components.push(this.currentTime),this.linegraph=new y(this.body),this.components.push(this.linegraph),this.itemsData=null,this.groupsData=null,this.on("tap",function(t){s.emit("click",s.getEventProperties(t))}),this.on("doubletap",function(t){s.emit("doubleClick",s.getEventProperties(t))}),this.dom.root.oncontextmenu=function(t){s.emit("contextmenu",s.getEventProperties(t))},o&&this.setOptions(o),i&&this.setGroups(i),e&&this.setItems(e),this._redraw()}var s=i(28),r=o(s),a=i(31),h=o(a),d=(i(13),i(22),i(2)),l=i(1),c=i(9),u=i(11),p=i(32),f=i(35),m=i(46),v=i(50),g=i(48),y=i(53),b=i(31).printStyle,_=i(61).allOptions,w=i(61).configureOptions;n.prototype=new f,n.prototype.setOptions=function(t){var e=h.default.validate(t,_);e===!0&&console.log("%cErrors have been found in the supplied options object.",b),f.prototype.setOptions.call(this,t)},n.prototype.setItems=function(t){var e,i=null==this.itemsData;if(e=t?t instanceof c||t instanceof u?t:new c(t,{type:{start:"Date",end:"Date"}}):null,this.itemsData=e,this.linegraph&&this.linegraph.setItems(e),i)if(void 0!=this.options.start||void 0!=this.options.end){var o=void 0!=this.options.start?this.options.start:null,n=void 0!=this.options.end?this.options.end:null;this.setWindow(o,n,{animation:!1})}else this.fit({animation:!1})},n.prototype.setGroups=function(t){var e;e=t?t instanceof c||t instanceof u?t:new c(t):null,this.groupsData=e,this.linegraph.setGroups(e)},n.prototype.getLegend=function(t,e,i){return void 0===e&&(e=15),void 0===i&&(i=15),void 0!==this.linegraph.groups[t]?this.linegraph.groups[t].getLegend(e,i):"cannot find group:'"+t+"'"},n.prototype.isGroupVisible=function(t){return void 0!==this.linegraph.groups[t]&&(this.linegraph.groups[t].visible&&(void 0===this.linegraph.options.groups.visibility[t]||1==this.linegraph.options.groups.visibility[t]))},n.prototype.getDataRange=function(){var t=null,e=null;for(var i in this.linegraph.groups)if(this.linegraph.groups.hasOwnProperty(i)&&1==this.linegraph.groups[i].visible)for(var o=0;os?s:t,e=null==e?s:e0){var h={};for(this._getRelevantData(a,h,n,s),this._applySampling(a,h),e=0;e0)switch(t.options.style){case"line":l.hasOwnProperty(a[e])||(l[a[e]]=f.calcPath(h[a[e]],t)),f.draw(l[a[e]],t,this.framework);case"point":case"points":"point"!=t.options.style&&"points"!=t.options.style&&1!=t.options.drawPoints.enabled||m.draw(h[a[e]],t,this.framework);break;case"bar":}}}return r.cleanupElements(this.svgElements),!1},o.prototype._stack=function(t,e){var i,o,n,s,r;i=0;for(var a=0;at[a].x){r=e[h],s=0==h?r:e[h-1],i=h;break}}void 0===r&&(s=e[e.length-1],r=e[e.length-1]),o=r.x-s.x,n=r.y-s.y,0==o?t[a].y=t[a].orginalY+r.y:t[a].y=t[a].orginalY+n/o*(t[a].x-s.x)+s.y}},o.prototype._getRelevantData=function(t,e,i,o){var n,r,a,h;if(t.length>0)for(r=0;r0)for(var o=0;o0){var s=1,r=n.length,a=this.body.util.toGlobalScreen(n[n.length-1].x)-this.body.util.toGlobalScreen(n[0].x),h=r/a;s=Math.min(Math.ceil(.2*r),Math.max(1,Math.round(h)));for(var d=new Array(r),l=0;l0){for(s=0;s0&&(n=this.groups[t[s]],r.stack===!0&&"bar"===r.style?"left"===r.yAxisOrientation?a=a.concat(n.getItems()):h=h.concat(n.getItems()):i[t[s]]=n.getYRange(o,t[s]));p.getStackedYRange(a,i,t,"__barStackLeft","left"),p.getStackedYRange(h,i,t,"__barStackRight","right")}},o.prototype._updateYAxis=function(t,e){var i,o,n=!1,s=!1,r=!1,a=1e9,h=1e9,d=-1e9,l=-1e9;if(t.length>0){for(var c=0;ci?i:a,d=di?i:h,l=l=0&&t._redrawLabel(o-2,e.val,i,"vis-y-axis vis-major",t.props.majorCharHeight),t.master===!0&&(n?t._redrawLine(o,i,"vis-grid vis-horizontal vis-major",t.options.majorLinesOffset,t.props.majorLineWidth):t._redrawLine(o,i,"vis-grid vis-horizontal vis-minor",t.options.minorLinesOffset,t.props.minorLineWidth))});var d=0;void 0!==this.options[i].title&&void 0!==this.options[i].title.text&&(d=this.props.titleCharHeight);var l=this.options.icons===!0?Math.max(this.options.iconWidth,d)+this.options.labelOffsetX+15:d+this.options.labelOffsetX+15;return this.maxLabelSize>this.width-l&&this.options.visible===!0?(this.width=this.maxLabelSize+l,this.options.width=this.width+"px",s.cleanupElements(this.DOMelements.lines),s.cleanupElements(this.DOMelements.labels),this.redraw(),e=!0):this.maxLabelSizethis.minWidth?(this.width=Math.max(this.minWidth,this.maxLabelSize+l),this.options.width=this.width+"px",s.cleanupElements(this.DOMelements.lines),s.cleanupElements(this.DOMelements.labels),this.redraw(),e=!0):(s.cleanupElements(this.DOMelements.lines),s.cleanupElements(this.DOMelements.labels),e=!1),e},o.prototype.convertValue=function(t){return this.scale.convertValue(t)},o.prototype.screenToValue=function(t){return this.scale.screenToValue(t)},o.prototype._redrawLabel=function(t,e,i,o,n){var r=s.getDOMElement("div",this.DOMelements.labels,this.dom.frame);r.className=o,r.innerHTML=e,"left"===i?(r.style.left="-"+this.options.labelOffsetX+"px",r.style.textAlign="right"):(r.style.right="-"+this.options.labelOffsetX+"px",r.style.textAlign="left"),r.style.top=t-.5*n+this.options.labelOffsetY+"px",e+="";var a=Math.max(this.props.majorCharWidth,this.props.minorCharWidth);this.maxLabelSize6&&void 0!==arguments[6]&&arguments[6],a=arguments.length>7&&void 0!==arguments[7]&&arguments[7];if(this.majorSteps=[1,2,5,10],this.minorSteps=[.25,.5,1,2],this.customLines=null,this.containerHeight=n,this.majorCharHeight=s,this._start=t,this._end=e,this.scale=1,this.minorStepIdx=-1,this.magnitudefactor=1,this.determineScale(),this.zeroAlign=r,this.autoScaleStart=i,this.autoScaleEnd=o,this.formattingFunction=a,i||o){var h=this,d=function(t){var e=t-t%(h.magnitudefactor*h.minorSteps[h.minorStepIdx]);return t%(h.magnitudefactor*h.minorSteps[h.minorStepIdx])>.5*(h.magnitudefactor*h.minorSteps[h.minorStepIdx])?e+h.magnitudefactor*h.minorSteps[h.minorStepIdx]:e};i&&(this._start-=2*this.magnitudefactor*this.minorSteps[this.minorStepIdx],this._start=d(this._start)),o&&(this._end+=this.magnitudefactor*this.minorSteps[this.minorStepIdx],this._end=d(this._end)),this.determineScale()}}i.prototype.setCharHeight=function(t){this.majorCharHeight=t},i.prototype.setHeight=function(t){this.containerHeight=t},i.prototype.determineScale=function(){var t=this._end-this._start;this.scale=this.containerHeight/t;var e=this.majorCharHeight/this.scale,i=t>0?Math.round(Math.log(t)/Math.LN10):0;this.minorStepIdx=-1,this.magnitudefactor=Math.pow(10,i);var o=0;i<0&&(o=i);for(var n=!1,s=o;Math.abs(s)<=Math.abs(i);s++){this.magnitudefactor=Math.pow(10,s);for(var r=0;r=e){n=!0,this.minorStepIdx=r;break}}if(n===!0)break}},i.prototype.is_major=function(t){return t%(this.magnitudefactor*this.majorSteps[this.minorStepIdx])===0},i.prototype.getStep=function(){return this.magnitudefactor*this.minorSteps[this.minorStepIdx]},i.prototype.getFirstMajor=function(){var t=this.magnitudefactor*this.majorSteps[this.minorStepIdx];return this.convertValue(this._start+(t-this._start%t)%t)},i.prototype.formatValue=function(t){var e=t.toPrecision(5);return"function"==typeof this.formattingFunction&&(e=this.formattingFunction(t)),"number"==typeof e?""+e:"string"==typeof e?e:t.toPrecision(5)},i.prototype.getLines=function(){for(var t=[],e=this.getStep(),i=(e-this._start%e)%e,o=this._start+i;this._end-o>1e-5;o+=e)o!=this._start&&t.push({major:this.is_major(o),y:this.convertValue(o),val:this.formatValue(o)});return t},i.prototype.followScale=function(t){var e=this.minorStepIdx,i=this._start,o=this._end,n=this,s=function(){n.magnitudefactor*=2},r=function(){n.magnitudefactor/=2};t.minorStepIdx<=1&&this.minorStepIdx<=1||t.minorStepIdx>1&&this.minorStepIdx>1||(t.minorStepIdxo+1e-5)r(),d=!1;else{if(!this.autoScaleStart&&this._start=0)){r(),d=!1;continue}console.warn("Can't adhere to given 'min' range, due to zeroalign")}this.autoScaleStart&&this.autoScaleEnd&&ce.x?1:-1})):this.itemsData=[]},o.prototype.getItems=function(){return this.itemsData},o.prototype.setZeroPosition=function(t){this.zeroPosition=t},o.prototype.setOptions=function(t){if(void 0!==t){var e=["sampling","style","sort","yAxisOrientation","barChart","zIndex","excludeFromStacking","excludeFromLegend"];s.selectiveDeepExtend(e,this.options,t),"function"==typeof t.drawPoints&&(t.drawPoints={onRender:t.drawPoints}),s.mergeOptions(this.options,t,"interpolation"),s.mergeOptions(this.options,t,"drawPoints"),s.mergeOptions(this.options,t,"shaded"),t.interpolation&&"object"==n(t.interpolation)&&t.interpolation.parametrization&&("uniform"==t.interpolation.parametrization?this.options.interpolation.alpha=0:"chordal"==t.interpolation.parametrization?this.options.interpolation.alpha=1:(this.options.interpolation.parametrization="centripetal",this.options.interpolation.alpha=.5))}},o.prototype.update=function(t){this.group=t,this.content=t.content||"graph",this.className=t.className||this.className||"vis-graph-group"+this.groupsUsingDefaultStyles[0]%10,this.visible=void 0===t.visible||t.visible,this.style=t.style,this.setOptions(t.options)},o.prototype.getLegend=function(t,e,i,o,n){if(void 0==i||null==i){var s=document.createElementNS("http://www.w3.org/2000/svg","svg");i={svg:s,svgElements:{},options:this.options,groups:[this]}}switch(void 0!=o&&null!=o||(o=0),void 0!=n&&null!=n||(n=.5*e),this.options.style){case"line":a.drawIcon(this,o,n,t,e,i);break;case"points":case"point":h.drawIcon(this,o,n,t,e,i);break;case"bar":r.drawIcon(this,o,n,t,e,i)}return{icon:i.svg,label:this.content,orientation:this.options.yAxisOrientation}},o.prototype.getYRange=function(t){for(var e=t[0].y,i=t[0].y,o=0;ot[o].y?t[o].y:e,i=i0&&(i=Math.min(i,Math.abs(e[o-1].screen_x-e[o].screen_x))),0===i&&(void 0===t[e[o].screen_x]&&(t[e[o].screen_x]={amount:0,resolved:0,accumulatedPositive:0,accumulatedNegative:0}),t[e[o].screen_x].amount+=1)},o._getSafeDrawData=function(t,e,i){var o,n;return t0?(o=t0){t.sort(function(t,e){return t.screen_x===e.screen_x?t.groupIde[s].screen_y?e[s].screen_y:o,n=nt[r].accumulatedNegative?t[r].accumulatedNegative:o,o=o>t[r].accumulatedPositive?t[r].accumulatedPositive:o,n=n0){var i=[];return i=1==e.options.interpolation.enabled?o._catmullRom(t,e):o._linear(t)}},o.drawIcon=function(t,e,i,o,s,r){var a,h,d=.5*s,l=n.getSVGElement("rect",r.svgElements,r.svg);if(l.setAttributeNS(null,"x",e),l.setAttributeNS(null,"y",i-d),l.setAttributeNS(null,"width",o),l.setAttributeNS(null,"height",2*d),l.setAttributeNS(null,"class","vis-outline"),a=n.getSVGElement("path",r.svgElements,r.svg),a.setAttributeNS(null,"class",t.className),void 0!==t.style&&a.setAttributeNS(null,"style",t.style),a.setAttributeNS(null,"d","M"+e+","+i+" L"+(e+o)+","+i),1==t.options.shaded.enabled&&(h=n.getSVGElement("path",r.svgElements,r.svg),"top"==t.options.shaded.orientation?h.setAttributeNS(null,"d","M"+e+", "+(i-d)+"L"+e+","+i+" L"+(e+o)+","+i+" L"+(e+o)+","+(i-d)):h.setAttributeNS(null,"d","M"+e+","+i+" L"+e+","+(i+d)+" L"+(e+o)+","+(i+d)+"L"+(e+o)+","+i),h.setAttributeNS(null,"class",t.className+" vis-icon-fill"),void 0!==t.options.shaded.style&&""!==t.options.shaded.style&&h.setAttributeNS(null,"style",t.options.shaded.style)),1==t.options.drawPoints.enabled){var c={style:t.options.drawPoints.style,styles:t.options.drawPoints.styles,size:t.options.drawPoints.size,className:t.className};n.drawPoint(e+.5*o,i,c,r.svgElements,r.svg)}},o.drawShading=function(t,e,i,o){if(1==e.options.shaded.enabled){var s=Number(o.svg.style.height.replace("px","")),r=n.getSVGElement("path",o.svgElements,o.svg),a="L";1==e.options.interpolation.enabled&&(a="C");var h,d=0;d="top"==e.options.shaded.orientation?0:"bottom"==e.options.shaded.orientation?s:Math.min(Math.max(0,e.zeroPosition),s),h="group"==e.options.shaded.orientation&&null!=i&&void 0!=i?"M"+t[0][0]+","+t[0][1]+" "+this.serializePath(t,a,!1)+" L"+i[i.length-1][0]+","+i[i.length-1][1]+" "+this.serializePath(i,a,!0)+i[0][0]+","+i[0][1]+" Z":"M"+t[0][0]+","+t[0][1]+" "+this.serializePath(t,a,!1)+" V"+d+" H"+t[0][0]+" Z",r.setAttributeNS(null,"class",e.className+" vis-fill"),void 0!==e.options.shaded.style&&r.setAttributeNS(null,"style",e.options.shaded.style),r.setAttributeNS(null,"d",h)}},o.draw=function(t,e,i){if(null!=t&&void 0!=t){var o=n.getSVGElement("path",i.svgElements,i.svg);o.setAttributeNS(null,"class",e.className),void 0!==e.style&&o.setAttributeNS(null,"style",e.style);var s="L";1==e.options.interpolation.enabled&&(s="C"),o.setAttributeNS(null,"d","M"+t[0][0]+","+t[0][1]+" "+this.serializePath(t,s,!1))}},o.serializePath=function(t,e,i){if(t.length<2)return"";var o=e;if(i)for(var n=t.length-2;n>0;n--)o+=t[n][0]+","+t[n][1]+" ";else for(var n=1;n0&&(f=1/f),m=3*v*(v+g),m>0&&(m=1/m),a={screen_x:(-b*o.screen_x+u*n.screen_x+_*s.screen_x)*f,screen_y:(-b*o.screen_y+u*n.screen_y+_*s.screen_y)*f},h={screen_x:(y*n.screen_x+p*s.screen_x-b*r.screen_x)*m,screen_y:(y*n.screen_y+p*s.screen_y-b*r.screen_y)*m},0==a.screen_x&&0==a.screen_y&&(a=n),0==h.screen_x&&0==h.screen_y&&(h=s),x.push([a.screen_x,a.screen_y]),x.push([h.screen_x,h.screen_y]),x.push([s.screen_x,s.screen_y]);return x},o._linear=function(t){for(var e=[],i=0;i")}this.dom.textArea.innerHTML=s,this.dom.textArea.style.lineHeight=.75*this.options.iconSize+this.options.iconSpacing+"px"}},o.prototype.drawLegendIcons=function(){if(this.dom.frame.parentNode){var t=Object.keys(this.groups);t.sort(function(t,e){return t0){var i=this.groupIndex%this.groupsArray.length;this.groupIndex++,e={},e.color=this.groups[this.groupsArray[i]],this.groups[t]=e}else{var o=this.defaultIndex%this.defaultGroups.length;this.defaultIndex++,e={},e.color=this.defaultGroups[o],this.groups[t]=e}return e}},{key:"add",value:function(t,e){return this.groups[t]=e,this.groupsArray.push(t),e}}]),t}();e.default=r},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var i=0;i1&&void 0!==arguments[1]&&arguments[1],o=this.body.data.nodes;if(t instanceof c||t instanceof u)this.body.data.nodes=t;else if(Array.isArray(t))this.body.data.nodes=new c,this.body.data.nodes.add(t);else{if(t)throw new TypeError("Array or DataSet expected");this.body.data.nodes=new c}o&&l.forEach(this.nodesListeners,function(t,e){o.off(e,t)}),this.body.nodes={},this.body.data.nodes&&!function(){var t=e;l.forEach(e.nodesListeners,function(e,i){t.body.data.nodes.on(i,e)});var i=e.body.data.nodes.getIds();e.add(i,!0)}(),i===!1&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=void 0,o=[],n=0;n1&&void 0!==arguments[1]?arguments[1]:a.default;return new e(t,this.body,this.images,this.groups,this.options)}},{key:"refresh",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.body.nodes;for(var i in e){var o=void 0;e.hasOwnProperty(i)&&(o=e[i]);var n=this.body.data.nodes._data[i];void 0!==o&&void 0!==n&&(t===!0&&o.setOptions({x:null,y:null}),o.setOptions({fixed:!1}),o.setOptions(n))}}},{key:"getPositions",value:function(t){var e={};if(void 0!==t){if(Array.isArray(t)===!0){for(var i=0;it.left&&this.shape.topt.top}},{key:"isBoundingBoxOverlappingWith",value:function(t){return this.shape.boundingBox.leftt.left&&this.shape.boundingBox.topt.top}}],[{key:"parseOptions",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=["color","font","fixed","shadow"];if(A.selectiveNotDeepExtend(n,t,e,i),A.mergeOptions(t,e,"shadow",i,o),void 0!==e.color&&null!==e.color){var s=A.parseColor(e.color);A.fillIfDefined(t.color,s)}else i===!0&&null===e.color&&(t.color=A.bridgeObject(o.color));void 0!==e.fixed&&null!==e.fixed&&("boolean"==typeof e.fixed?(t.fixed.x=e.fixed,t.fixed.y=e.fixed):(void 0!==e.fixed.x&&"boolean"==typeof e.fixed.x&&(t.fixed.x=e.fixed.x),void 0!==e.fixed.y&&"boolean"==typeof e.fixed.y&&(t.fixed.y=e.fixed.y))),void 0!==e.font&&null!==e.font?a.default.parseOptions(t.font,e):i===!0&&null===e.font&&(t.font=A.bridgeObject(o.font)),void 0!==e.scaling&&A.mergeOptions(t.scaling,e.scaling,"label",i,o.scaling)}}]),t}();e.default=B},function(t,e,i){function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){var i=[],o=!0,n=!1,s=void 0;try{for(var r,a=t[Symbol.iterator]();!(o=(r=a.next()).done)&&(i.push(r.value),!e||i.length!==e);o=!0);}catch(t){n=!0,s=t}finally{try{!o&&a.return&&a.return()}finally{if(n)throw s}}return i}return function(e,i){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(){function t(t,e){for(var i=0;i2&&void 0!==arguments[2]&&arguments[2];o(this,t),this.body=e,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(i),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=n}return r(t,[{key:"setOptions",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.nodeOptions=e,this.fontOptions=a.deepExtend({},e.font,!0),void 0!==e.label&&(this.labelDirty=!0),void 0!==e.font&&(t.parseOptions(this.fontOptions,e,i),"string"==typeof e.font?this.baseSize=this.fontOptions.size:"object"===s(e.font)&&void 0!==e.font.size&&(this.baseSize=e.font.size))}},{key:"draw",value:function(t,e,i,o){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"middle";if(void 0!==this.nodeOptions.label){var s=this.fontOptions.size*this.body.view.scale;this.nodeOptions.label&&s4&&void 0!==arguments[4]?arguments[4]:"middle",r=this.fontOptions.size,a=r*this.body.view.scale;a>=this.nodeOptions.scaling.label.maxVisible&&(r=Number(this.nodeOptions.scaling.label.maxVisible)/this.body.view.scale);var h=this.size.yLine,d=this._getColor(a),l=n(d,2),c=l[0],u=l[1],p=this._setAlignment(t,i,h,s),f=n(p,2);i=f[0],h=f[1],t.font=(e&&this.nodeOptions.labelHighlightBold?"bold ":"")+r+"px "+this.fontOptions.face,t.fillStyle=c,this.isEdgeLabel||"left"!==this.fontOptions.align?t.textAlign="center":(t.textAlign=this.fontOptions.align,i-=.5*this.size.width),this.fontOptions.strokeWidth>0&&(t.lineWidth=this.fontOptions.strokeWidth,t.strokeStyle=u,t.lineJoin="round");for(var m=0;m0&&t.strokeText(this.lines[m],i,h),t.fillText(this.lines[m],i,h),h+=r}},{key:"_setAlignment",value:function(t,e,i,o){if(this.isEdgeLabel&&"horizontal"!==this.fontOptions.align&&this.pointToSelf===!1){e=0,i=0;var n=2;"top"===this.fontOptions.align?(t.textBaseline="alphabetic",i-=2*n):"bottom"===this.fontOptions.align?(t.textBaseline="hanging",i+=2*n):t.textBaseline="middle"}else t.textBaseline=o;return[e,i]}},{key:"_getColor",value:function(t){var e=this.fontOptions.color||"#000000",i=this.fontOptions.strokeColor||"#ffffff";if(t<=this.nodeOptions.scaling.label.drawThreshold){var o=Math.max(0,Math.min(1,1-(this.nodeOptions.scaling.label.drawThreshold-t)));e=a.overrideOpacity(e,o),i=a.overrideOpacity(i,o)}return[e,i]}},{key:"getTextSize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i={width:this._processLabel(t,e),height:this.fontOptions.size*this.lineCount,lineCount:this.lineCount};return i}},{key:"calculateLabelSize",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"middle";this.labelDirty===!0&&(this.size.width=this._processLabel(t,e)),this.size.height=this.fontOptions.size*this.lineCount,this.size.left=i-.5*this.size.width,this.size.top=o-.5*this.size.height,this.size.yLine=o+.5*(1-this.lineCount)*this.fontOptions.size,"hanging"===n&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4),this.labelDirty=!1}},{key:"_processLabel",value:function(t,e){var i=0,o=[""],n=0;if(void 0!==this.nodeOptions.label){o=String(this.nodeOptions.label).split("\n"),n=o.length,t.font=(e&&this.nodeOptions.labelHighlightBold?"bold ":"")+this.fontOptions.size+"px "+this.fontOptions.face,i=t.measureText(o[0]).width;for(var s=1;si?r:i}}return this.lines=o,this.lineCount=n,i}}],[{key:"parseOptions",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"==typeof e.font){var o=e.font.split(" ");t.size=o[0].replace("px",""),t.face=o[1],t.color=o[2]}else"object"===s(e.font)&&a.fillIfDefined(t,e.font,i);t.size=Number(t.size)}}]),t}();e.default=h},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i0&&(this.enableBorderDashes(t),t.stroke(),this.disableBorderDashes(t)),t.restore(),this.updateBoundingBox(e,i,t,o),this.labelModule.draw(t,e,i,o)}},{key:"updateBoundingBox",value:function(t,e,i,o){this.resize(i,o),this.left=t-.5*this.width,this.top=e-.5*this.height;var n=this.options.shapeProperties.borderRadius;this.boundingBox.left=this.left-n,this.boundingBox.top=this.top-n,this.boundingBox.bottom=this.top+this.height+n,this.boundingBox.right=this.left+this.width+n}},{key:"distanceToBorder",value:function(t,e){this.resize(t);var i=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(e)),Math.abs(this.height/2/Math.sin(e)))+i}}]),e}(d.default);e.default=l},function(t,e){function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var i=0;ithis.imageObj.height?(o=this.imageObj.width/this.imageObj.height,e=2*this.options.size*o||this.imageObj.width,i=2*this.options.size||this.imageObj.height):(o=this.imageObj.width&&this.imageObj.height?this.imageObj.height/this.imageObj.width:1,e=2*this.options.size,i=2*this.options.size*o):(e=this.imageObj.width,i=this.imageObj.height),this.width=e,this.height=i,this.radius=.5*this.width}}},{key:"_drawRawCircle",value:function(t,e,i,o,n,s){var r=this.options.borderWidth,a=this.options.borderWidthSelected||2*this.options.borderWidth,h=(o?a:r)/this.body.view.scale;t.lineWidth=Math.min(this.width,h),t.strokeStyle=o?this.options.color.highlight.border:n?this.options.color.hover.border:this.options.color.border,t.fillStyle=o?this.options.color.highlight.background:n?this.options.color.hover.background:this.options.color.background,t.circle(e,i,s),this.enableShadow(t),t.fill(),this.disableShadow(t),t.save(),h>0&&(this.enableBorderDashes(t),t.stroke(),this.disableBorderDashes(t)),t.restore()}},{key:"_drawImageAtPosition",value:function(t){if(0!=this.imageObj.width){t.globalAlpha=1,this.enableShadow(t);var e=this.imageObj.width/this.width/this.body.view.scale;if(e>2&&this.options.shapeProperties.interpolation===!0){var i=this.imageObj.width,o=this.imageObj.height,n=document.createElement("canvas");n.width=i,n.height=i;var s=n.getContext("2d");e*=.5,i*=.5,o*=.5,s.drawImage(this.imageObj,0,0,i,o);for(var r=0,a=1;e>2&&a<4;)s.drawImage(n,r,0,i,o,r+i,0,i/2,o/2),r+=i,e*=.5,i*=.5,o*=.5,a+=1;t.drawImage(n,r,0,i,o,this.left,this.top,this.width,this.height)}else t.drawImage(this.imageObj,this.left,this.top,this.width,this.height);this.disableShadow(t)}}},{key:"_drawImageLabel",value:function(t,e,i,o){var n,s=0;if(void 0!==this.height){s=.5*this.height;var r=this.labelModule.getTextSize(t);r.lineCount>=1&&(s+=r.height/2)}n=i+s,this.options.label&&(this.labelOffset=s),this.labelModule.draw(t,e,n,o,"hanging")}}]),e}(d.default);e.default=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i0&&(this.enableBorderDashes(t),t.stroke(),this.disableBorderDashes(t)),t.restore(),this.updateBoundingBox(e,i,t,o),this.labelModule.draw(t,e,i,o)}},{key:"updateBoundingBox",value:function(t,e,i,o){this.resize(i,o),this.left=t-.5*this.width,this.top=e-.5*this.height,this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(d.default);e.default=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i0&&(this.enableBorderDashes(t), -t.stroke(),this.disableBorderDashes(t)),t.restore(),void 0!==this.options.label){var l=n+.5*this.height+3;this.labelModule.draw(t,o,l,s,"hanging")}this.updateBoundingBox(o,n)}},{key:"updateBoundingBox",value:function(t,e){this.boundingBox.top=e-this.options.size,this.boundingBox.left=t-this.options.size,this.boundingBox.right=t+this.options.size,this.boundingBox.bottom=e+this.options.size,void 0!==this.options.label&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+3))}}]),e}(d.default);e.default=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i0&&(this.enableBorderDashes(t),t.stroke(),this.disableBorderDashes(t)),t.restore(),this.updateBoundingBox(e,i,t,o),this.labelModule.draw(t,e,i,o)}},{key:"updateBoundingBox",value:function(t,e,i,o){this.resize(i,o),this.left=t-.5*this.width,this.top=e-.5*this.height,this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width}},{key:"distanceToBorder",value:function(t,e){this.resize(t);var i=.5*this.width,o=.5*this.height,n=Math.sin(e)*i,s=Math.cos(e)*o;return i*o/Math.sqrt(n*n+s*s)}}]),e}(d.default);e.default=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i0){var i=5;this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+i)}}},{key:"_icon",value:function(t,e,i,o){var n=Number(this.options.icon.size);void 0!==this.options.icon.code?(t.font=(o?"bold ":"")+n+"px "+this.options.icon.face,t.fillStyle=this.options.icon.color||"black",t.textAlign="center",t.textBaseline="middle",this.enableShadow(t),t.fillText(this.options.icon.code,e,i),this.disableShadow(t)):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(t,e){return this._distanceToBorder(t,e)}}]),e}(d.default);e.default=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i0&&(this.enableBorderDashes(t),t.stroke(),this.disableBorderDashes(t)),t.restore(),t.closePath()}this._drawImageAtPosition(t),this._drawImageLabel(t,e,i,o||n),this.updateBoundingBox(e,i)}},{key:"updateBoundingBox",value:function(t,e){this.resize(),this.left=t-this.width/2,this.top=e-this.height/2,this.boundingBox.top=this.top,this.boundingBox.left=this.left,this.boundingBox.right=this.left+this.width,this.boundingBox.bottom=this.top+this.height,void 0!==this.options.label&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset))}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(d.default);e.default=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i1&&void 0!==arguments[1]&&arguments[1],o=this.body.data.edges;if(t instanceof c||t instanceof u)this.body.data.edges=t;else if(Array.isArray(t))this.body.data.edges=new c,this.body.data.edges.add(t);else{if(t)throw new TypeError("Array or DataSet expected");this.body.data.edges=new c}if(o&&l.forEach(this.edgesListeners,function(t,e){o.off(e,t)}),this.body.edges={},this.body.data.edges){l.forEach(this.edgesListeners,function(t,i){e.body.data.edges.on(i,t)});var n=this.body.data.edges.getIds();this.add(n,!0)}i===!1&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.body.edges,o=this.body.data.edges,n=0;ni.shape.height?(r=i.x+.5*i.shape.width,a=i.y-h):(r=i.x+h,a=i.y-.5*i.shape.height),s=this._pointOnCircle(r,a,h,.125),this.labelModule.draw(t,s.x,s.y,n)}}}},{key:"isOverlappingWith",value:function(t){if(this.connected){var e=10,i=this.from.x,o=this.from.y,n=this.to.x,s=this.to.y,r=t.left,a=t.top,h=this.edgeType.getDistanceToEdge(i,o,n,s,r,a);return h0&&i<0)&&(o+=Math.PI),t.rotate(o)}},{key:"_pointOnCircle",value:function(t,e,i,o){var n=2*o*Math.PI;return{x:t+i*Math.cos(n),y:e-i*Math.sin(n)}}},{key:"select",value:function(){this.selected=!0}},{key:"unselect",value:function(){this.selected=!1}},{key:"cleanup",value:function(){return this.edgeType.cleanup()}}],[{key:"parseOptions",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=["arrowStrikethrough","id","from","hidden","hoverWidth","label","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","to","title","value","width"];if(g.selectiveDeepExtend(n,t,e,i),g.mergeOptions(t,e,"smooth",i,o),g.mergeOptions(t,e,"shadow",i,o),void 0!==e.dashes&&null!==e.dashes?t.dashes=e.dashes:i===!0&&null===e.dashes&&(t.dashes=Object.create(o.dashes)),void 0!==e.scaling&&null!==e.scaling?(void 0!==e.scaling.min&&(t.scaling.min=e.scaling.min),void 0!==e.scaling.max&&(t.scaling.max=e.scaling.max),g.mergeOptions(t.scaling,e.scaling,"label",i,o.scaling)):i===!0&&null===e.scaling&&(t.scaling=Object.create(o.scaling)),void 0!==e.arrows&&null!==e.arrows)if("string"==typeof e.arrows){var r=e.arrows.toLowerCase();t.arrows.to.enabled=r.indexOf("to")!=-1,t.arrows.middle.enabled=r.indexOf("middle")!=-1,t.arrows.from.enabled=r.indexOf("from")!=-1}else{if("object"!==s(e.arrows))throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+JSON.stringify(e.arrows));g.mergeOptions(t.arrows,e.arrows,"to",i,o.arrows),g.mergeOptions(t.arrows,e.arrows,"middle",i,o.arrows),g.mergeOptions(t.arrows,e.arrows,"from",i,o.arrows)}else i===!0&&null===e.arrows&&(t.arrows=Object.create(o.arrows));if(void 0!==e.color&&null!==e.color)if(t.color=g.deepExtend({},t.color,!0),g.isString(e.color))t.color.color=e.color,t.color.highlight=e.color,t.color.hover=e.color,t.color.inherit=!1;else{var a=!1;void 0!==e.color.color&&(t.color.color=e.color.color,a=!0),void 0!==e.color.highlight&&(t.color.highlight=e.color.highlight,a=!0),void 0!==e.color.hover&&(t.color.hover=e.color.hover,a=!0),void 0!==e.color.inherit&&(t.color.inherit=e.color.inherit),void 0!==e.color.opacity&&(t.color.opacity=Math.min(1,Math.max(0,e.color.opacity))),void 0===e.color.inherit&&a===!0&&(t.color.inherit=!1)}else i===!0&&null===e.color&&(t.color=g.bridgeObject(o.color));void 0!==e.font&&null!==e.font?h.default.parseOptions(t.font,e):i===!0&&null===e.font&&(t.font=g.bridgeObject(o.font))}}]),t}();e.default=y},function(t,e,i){ -function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){var i=[],o=!0,n=!1,s=void 0;try{for(var r,a=t[Symbol.iterator]();!(o=(r=a.next()).done)&&(i.push(r.value),!e||i.length!==e);o=!0);}catch(t){n=!0,s=t}finally{try{!o&&a.return&&a.return()}finally{if(n)throw s}}return i}return function(e,i){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),h=function(){function t(t,e){for(var i=0;iMath.abs(e)||this.options.smooth.forceDirection===!0||"horizontal"===this.options.smooth.forceDirection)&&"vertical"!==this.options.smooth.forceDirection?(o=this.from.y,s=this.to.y,i=this.from.x-r*t,n=this.to.x+r*t):(o=this.from.y-r*e,s=this.to.y+r*e,i=this.from.x,n=this.to.x),[{x:i,y:o},{x:n,y:s}]}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_findBorderPosition",value:function(t,e){return this._findBorderPositionBezier(t,e)}},{key:"_getDistanceToEdge",value:function(t,e,i,o,n,s){var r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:this._getViaCoordinates(),h=a(r,2),d=h[0],l=h[1];return this._getDistanceToBezierEdge(t,e,i,o,n,s,d,l)}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._getViaCoordinates(),i=a(e,2),o=i[0],n=i[1],s=t,r=[];r[0]=Math.pow(1-s,3),r[1]=3*s*Math.pow(1-s,2),r[2]=3*Math.pow(s,2)*(1-s),r[3]=Math.pow(s,3);var h=r[0]*this.fromPoint.x+r[1]*o.x+r[2]*n.x+r[3]*this.toPoint.x,d=r[0]*this.fromPoint.y+r[1]*o.y+r[2]*n.y+r[3]*this.toPoint.y;return{x:h,y:d}}}]),e}(l.default);e.default=c},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i0&&(d=this._getDistanceToLine(f,m,u,p,n,s),h=d2&&void 0!==arguments[2]?arguments[2]:this._getViaCoordinates(),h=10,d=0,l=0,c=1,u=.2,p=this.to,f=!1;for(t.id===this.from.id&&(p=this.from,f=!0);l<=c&&d0&&(h=this._getDistanceToLine(p,f,c,u,n,s),a=ho.shape.height?(e=o.x+.5*o.shape.width,i=o.y-n):(e=o.x+n,i=o.y-.5*o.shape.height),[e,i,n]}},{key:"_pointOnCircle",value:function(t,e,i,o){var n=2*o*Math.PI;return{x:t+i*Math.cos(n),y:e-i*Math.sin(n)}}},{key:"_findBorderPositionCircle",value:function(t,e,i){for(var o=i.x,n=i.y,s=i.low,r=i.high,a=i.direction,h=10,d=0,l=this.options.selfReferenceSize,c=void 0,u=void 0,p=void 0,f=void 0,m=void 0,v=.05,g=.5*(s+r);s<=r&&d0?a>0?s=g:r=g:a>0?r=g:s=g,d++;return c.t=g,c}},{key:"getLineWidth",value:function(t,e){return t===!0?Math.max(this.selectionWidth,.3/this.body.view.scale):e===!0?Math.max(this.hoverWidth,.3/this.body.view.scale):Math.max(this.options.width,.3/this.body.view.scale)}},{key:"getColor",value:function(t,e,i){var o=this.options.color;if(o.inherit!==!1){if("both"===o.inherit&&this.from.id!==this.to.id){var n=t.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y),s=void 0,a=void 0;return s=this.from.options.color.highlight.border,a=this.to.options.color.highlight.border,this.from.selected===!1&&this.to.selected===!1?(s=r.overrideOpacity(this.from.options.color.border,this.options.color.opacity),a=r.overrideOpacity(this.to.options.color.border,this.options.color.opacity)):this.from.selected===!0&&this.to.selected===!1?a=this.to.options.color.border:this.from.selected===!1&&this.to.selected===!0&&(s=this.from.options.color.border),n.addColorStop(0,s),n.addColorStop(1,a),n}this.colorDirty===!0&&("to"===o.inherit?(this.color.highlight=this.to.options.color.highlight.border,this.color.hover=this.to.options.color.hover.border,this.color.color=r.overrideOpacity(this.to.options.color.border,o.opacity)):(this.color.highlight=this.from.options.color.highlight.border,this.color.hover=this.from.options.color.hover.border,this.color.color=r.overrideOpacity(this.from.options.color.border,o.opacity)))}else this.colorDirty===!0&&(this.color.highlight=o.highlight,this.color.hover=o.hover,this.color.color=r.overrideOpacity(o.color,o.opacity));return this.colorDirty=!1,e===!0?this.color.highlight:i===!0?this.color.hover:this.color.color}},{key:"_circle",value:function(t,e,i,o){this.enableShadow(t),t.beginPath(),t.arc(e,i,o,0,2*Math.PI,!1),t.stroke(),this.disableShadow(t)}},{key:"getDistanceToEdge",value:function(t,e,i,o,s,r,a){var h=0;if(this.from!=this.to)h=this._getDistanceToEdge(t,e,i,o,s,r,a);else{var d=this._getCircleData(),l=n(d,3),c=l[0],u=l[1],p=l[2],f=c-s,m=u-r;h=Math.abs(Math.sqrt(f*f+m*m)-p)}return this.labelModule.size.lefts&&this.labelModule.size.topr?0:h}},{key:"_getDistanceToLine",value:function(t,e,i,o,n,s){var r=i-t,a=o-e,h=r*r+a*a,d=((n-t)*r+(s-e)*a)/h;d>1?d=1:d<0&&(d=0);var l=t+d*r,c=e+d*a,u=l-n,p=c-s;return Math.sqrt(u*u+p*p)}},{key:"getArrowData",value:function(t,e,i,o,s){var r=void 0,a=void 0,h=void 0,d=void 0,l=void 0,c=void 0,u=void 0,p=this.getLineWidth(o,s);if("from"===e?(h=this.from,d=this.to,l=.1,c=this.options.arrows.from.scaleFactor,u=this.options.arrows.from.type):"to"===e?(h=this.to,d=this.from,l=-.1,c=this.options.arrows.to.scaleFactor,u=this.options.arrows.to.type):(h=this.to,d=this.from,c=this.options.arrows.middle.scaleFactor,u=this.options.arrows.middle.type),h!=d)if("middle"!==e)if(this.options.smooth.enabled===!0){a=this.findBorderPosition(h,t,{via:i});var f=this.getPoint(Math.max(0,Math.min(1,a.t+l)),i);r=Math.atan2(a.y-f.y,a.x-f.x)}else r=Math.atan2(h.y-d.y,h.x-d.x),a=this.findBorderPosition(h,t);else r=Math.atan2(h.y-d.y,h.x-d.x),a=this.getPoint(.5,i);else{var m=this._getCircleData(t),v=n(m,3),g=v[0],y=v[1],b=v[2];"from"===e?(a=this.findBorderPosition(this.from,t,{x:g,y:y,low:.25,high:.6,direction:-1}),r=a.t*-2*Math.PI+1.5*Math.PI+.1*Math.PI):"to"===e?(a=this.findBorderPosition(this.from,t,{x:g,y:y,low:.6,high:1,direction:1}),r=a.t*-2*Math.PI+1.5*Math.PI-1.1*Math.PI):(a=this._pointOnCircle(g,y,b,.175),r=3.9269908169872414)}var _=15*c+3*p,w=a.x-.9*_*Math.cos(r),x=a.y-.9*_*Math.sin(r),k={x:w,y:x};return{point:a,core:k,angle:r,length:_,type:u}}},{key:"drawArrowHead",value:function(t,e,i,o){t.strokeStyle=this.getColor(t,e,i),t.fillStyle=t.strokeStyle,t.lineWidth=this.getLineWidth(e,i),o.type&&"circle"===o.type.toLowerCase()?t.circleEndpoint(o.point.x,o.point.y,o.angle,o.length):t.arrowEndpoint(o.point.x,o.point.y,o.angle,o.length),this.enableShadow(t),t.fill(),this.disableShadow(t)}},{key:"enableShadow",value:function(t){this.options.shadow.enabled===!0&&(t.shadowColor=this.options.shadow.color,t.shadowBlur=this.options.shadow.size,t.shadowOffsetX=this.options.shadow.x,t.shadowOffsetY=this.options.shadow.y)}},{key:"disableShadow",value:function(t){this.options.shadow.enabled===!0&&(t.shadowColor="rgba(0,0,0,0)",t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0)}}]),t}();e.default=a},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){var i=[],o=!0,n=!1,s=void 0;try{for(var r,a=t[Symbol.iterator]();!(o=(r=a.next()).done)&&(i.push(r.value),!e||i.length!==e);o=!0);}catch(t){n=!0,s=t}finally{try{!o&&a.return&&a.return()}finally{if(n)throw s}}return i}return function(e,i){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),h=function(){function t(t,e){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:this.via,i=t,o=void 0,n=void 0;if(this.from===this.to){var s=this._getCircleData(this.from),r=a(s,3),h=r[0],d=r[1],l=r[2],c=2*Math.PI*(1-i);o=h+l*Math.sin(c),n=d+l-l*(1-Math.cos(c))}else o=Math.pow(1-i,2)*this.fromPoint.x+2*i*(1-i)*e.x+Math.pow(i,2)*this.toPoint.x,n=Math.pow(1-i,2)*this.fromPoint.y+2*i*(1-i)*e.y+Math.pow(i,2)*this.toPoint.y;return{x:o,y:n}}},{key:"_findBorderPosition",value:function(t,e){return this._findBorderPositionBezier(t,e,this.via)}},{key:"_getDistanceToEdge",value:function(t,e,i,o,n,s){return this._getDistanceToBezierEdge(t,e,i,o,n,s,this.via)}}]),e}(l.default);e.default=c},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i=this.to.y?this.from.x<=this.to.x?(t=this.from.x+i*s,e=this.from.y-i*s):this.from.x>this.to.x&&(t=this.from.x-i*s,e=this.from.y-i*s):this.from.ythis.to.x&&(t=this.from.x-i*s,e=this.from.y+i*s)),"discrete"===o&&(t=nMath.abs(this.from.y-this.to.y)&&(this.from.y>=this.to.y?this.from.x<=this.to.x?(t=this.from.x+i*n,e=this.from.y-i*n):this.from.x>this.to.x&&(t=this.from.x-i*n,e=this.from.y-i*n):this.from.ythis.to.x&&(t=this.from.x-i*n,e=this.from.y+i*n)),"discrete"===o&&(e=sMath.abs(this.from.y-this.to.y)&&(t=this.from.x=this.to.y?this.from.x<=this.to.x?(t=this.from.x+i*s,e=this.from.y-i*s,t=this.to.xthis.to.x&&(t=this.from.x-i*s,e=this.from.y-i*s,t=this.to.x>t?this.to.x:t):this.from.ythis.to.x&&(t=this.from.x-i*s,e=this.from.y+i*s,t=this.to.x>t?this.to.x:t)):Math.abs(this.from.x-this.to.x)>Math.abs(this.from.y-this.to.y)&&(this.from.y>=this.to.y?this.from.x<=this.to.x?(t=this.from.x+i*n,e=this.from.y-i*n,e=this.to.y>e?this.to.y:e):this.from.x>this.to.x&&(t=this.from.x-i*n,e=this.from.y-i*n,e=this.to.y>e?this.to.y:e):this.from.ythis.to.x&&(t=this.from.x-i*n,e=this.from.y+i*n,e=this.to.y2&&void 0!==arguments[2]?arguments[2]:{};return this._findBorderPositionBezier(t,e,i.via)}},{key:"_getDistanceToEdge",value:function(t,e,i,o,n,s){var r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(t,e,i,o,n,s,r)}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._getViaCoordinates(),i=t,o=Math.pow(1-i,2)*this.fromPoint.x+2*i*(1-i)*e.x+Math.pow(i,2)*this.toPoint.x,n=Math.pow(1-i,2)*this.fromPoint.y+2*i*(1-i)*e.y+Math.pow(i,2)*this.toPoint.y;return{x:o,y:n}}}]),e}(d.default);e.default=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i0&&void 0!==arguments[0])||arguments[0];this.stabilized=!0,t===!0&&this._emitStabilized(),void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.viewFunction=void 0,t===!0&&this.body.emitter.emit("_stopRendering"))}},{key:"simulationStep",value:function(){var t=Date.now();this.physicsTick();var e=Date.now()-t;(e<.4*this.simulationInterval||this.runDoubleSpeed===!0)&&this.stabilized===!1&&(this.physicsTick(),this.runDoubleSpeed=!0),this.stabilized===!0&&this.stopSimulation()}},{key:"_emitStabilized",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.stabilizationIterations;(this.stabilizationIterations>1||this.startedStabilization===!0)&&setTimeout(function(){t.body.emitter.emit("stabilized",{iterations:e}),t.startedStabilization=!1,t.stabilizationIterations=0},0)}},{key:"physicsTick",value:function(){if(this.startedStabilization===!1&&(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0),this.stabilized===!1){if(this.adaptiveTimestep===!0&&this.adaptiveTimestepEnabled===!0){var t=1.2;this.adaptiveCounter%this.adaptiveInterval===0?(this.timestep=2*this.timestep,this.calculateForces(),this.moveNodes(),this.revert(),this.timestep=.5*this.timestep,this.calculateForces(),this.moveNodes(),this.calculateForces(),this.moveNodes(),this._evaluateStepQuality()===!0?this.timestep=t*this.timestep:this.timestep/ts))return!1;return!0}},{key:"moveNodes",value:function(){for(var t=this.physicsBody.physicsNodeIndices,e=this.options.maxVelocity?this.options.maxVelocity:1e9,i=0,o=0,n=5,s=0;se?s[t].x>0?e:-e:s[t].x,i.x+=s[t].x*o}else n[t].x=0,s[t].x=0;if(i.options.fixed.y===!1){var h=this.modelOptions.damping*s[t].y,d=(n[t].y-h)/i.options.mass;s[t].y+=d*o,s[t].y=Math.abs(s[t].y)>e?s[t].y>0?e:-e:s[t].y,i.y+=s[t].y*o}else n[t].y=0,s[t].y=0;var l=Math.sqrt(Math.pow(s[t].x,2)+Math.pow(s[t].y,2));return l}},{key:"calculateForces",value:function(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve()}},{key:"_freezeNodes",value:function(){var t=this.body.nodes;for(var e in t)t.hasOwnProperty(e)&&t[e].x&&t[e].y&&(this.freezeCache[e]={x:t[e].options.fixed.x,y:t[e].options.fixed.y},t[e].options.fixed.x=!0,t[e].options.fixed.y=!0)}},{key:"_restoreFrozenNodes",value:function(){var t=this.body.nodes;for(var e in t)t.hasOwnProperty(e)&&void 0!==this.freezeCache[e]&&(t[e].options.fixed.x=this.freezeCache[e].x,t[e].options.fixed.y=this.freezeCache[e].y);this.freezeCache={}}},{key:"stabilize",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.stabilization.iterations;return"number"!=typeof e&&(console.log("The stabilize method needs a numeric amount of iterations. Switching to default: ",this.options.stabilization.iterations),e=this.options.stabilization.iterations),0===this.physicsBody.physicsNodeIndices.length?void(this.ready=!0):(this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=e,this.options.stabilization.onlyDynamicEdges===!0&&this._freezeNodes(),this.stabilizationIterations=0,void setTimeout(function(){return t._stabilizationBatch()},0))}},{key:"_stabilizationBatch",value:function(){this.startedStabilization===!1&&(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0);for(var t=0;this.stabilized===!1&&t0){var t=void 0,e=this.body.nodes,i=this.physicsBody.physicsNodeIndices,o=i.length,n=this._formBarnesHutTree(e,i);this.barnesHutTree=n;for(var s=0;s0&&(this._getForceContribution(n.root.children.NW,t),this._getForceContribution(n.root.children.NE,t),this._getForceContribution(n.root.children.SW,t),this._getForceContribution(n.root.children.SE,t))}}},{key:"_getForceContribution",value:function(t,e){if(t.childrenCount>0){var i=void 0,o=void 0,n=void 0;i=t.centerOfMass.x-e.x,o=t.centerOfMass.y-e.y,n=Math.sqrt(i*i+o*o),n*t.calcSize>this.thetaInversed?this._calculateForces(n,i,o,e,t):4===t.childrenCount?(this._getForceContribution(t.children.NW,e),this._getForceContribution(t.children.NE,e),this._getForceContribution(t.children.SW,e),this._getForceContribution(t.children.SE,e)):t.children.data.id!=e.id&&this._calculateForces(n,i,o,e,t)}}},{key:"_calculateForces",value:function(t,e,i,o,n){0===t&&(t=.1,e=t),this.overlapAvoidanceFactor<1&&o.shape.radius&&(t=Math.max(.1+this.overlapAvoidanceFactor*o.shape.radius,t-o.shape.radius));var s=this.options.gravitationalConstant*n.mass*o.options.mass/Math.pow(t,3),r=e*s,a=i*s;this.physicsBody.forces[o.id].x+=r,this.physicsBody.forces[o.id].y+=a}},{key:"_formBarnesHutTree",value:function(t,e){for(var i=void 0,o=e.length,n=t[e[0]].x,s=t[e[0]].y,r=t[e[0]].x,a=t[e[0]].y,h=1;h0&&(dr&&(r=d),la&&(a=l))}var c=Math.abs(r-n)-Math.abs(a-s);c>0?(s-=.5*c,a+=.5*c):(n+=.5*c,r-=.5*c);var u=1e-5,p=Math.max(u,Math.abs(r-n)),f=.5*p,m=.5*(n+r),v=.5*(s+a),g={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:m-f,maxX:m+f,minY:v-f,maxY:v+f},size:p,calcSize:1/p,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(g.root);for(var y=0;y0&&this._placeInTree(g.root,i);return g}},{key:"_updateBranchMass",value:function(t,e){var i=t.mass+e.options.mass,o=1/i;t.centerOfMass.x=t.centerOfMass.x*t.mass+e.x*e.options.mass,t.centerOfMass.x*=o,t.centerOfMass.y=t.centerOfMass.y*t.mass+e.y*e.options.mass,t.centerOfMass.y*=o,t.mass=i;var n=Math.max(Math.max(e.height,e.radius),e.width);t.maxWidth=t.maxWidthe.x?t.children.NW.range.maxY>e.y?this._placeInRegion(t,e,"NW"):this._placeInRegion(t,e,"SW"):t.children.NW.range.maxY>e.y?this._placeInRegion(t,e,"NE"):this._placeInRegion(t,e,"SE")}},{key:"_placeInRegion",value:function(t,e,i){switch(t.children[i].childrenCount){case 0:t.children[i].children.data=e,t.children[i].childrenCount=1,this._updateBranchMass(t.children[i],e);break;case 1:t.children[i].children.data.x===e.x&&t.children[i].children.data.y===e.y?(e.x+=this.seededRandom(),e.y+=this.seededRandom()):(this._splitBranch(t.children[i]),this._placeInTree(t.children[i],e));break;case 4:this._placeInTree(t.children[i],e)}}},{key:"_splitBranch",value:function(t){var e=null;1===t.childrenCount&&(e=t.children.data,t.mass=0,t.centerOfMass.x=0,t.centerOfMass.y=0),t.childrenCount=4,t.children.data=null,this._insertRegion(t,"NW"),this._insertRegion(t,"NE"),this._insertRegion(t,"SW"),this._insertRegion(t,"SE"),null!=e&&this._placeInTree(t,e)}},{key:"_insertRegion",value:function(t,e){var i=void 0,o=void 0,n=void 0,s=void 0,r=.5*t.size;switch(e){case"NW":i=t.range.minX,o=t.range.minX+r,n=t.range.minY,s=t.range.minY+r;break;case"NE":i=t.range.minX+r,o=t.range.maxX,n=t.range.minY,s=t.range.minY+r;break;case"SW":i=t.range.minX,o=t.range.minX+r,n=t.range.minY+r,s=t.range.maxY;break;case"SE":i=t.range.minX+r,o=t.range.maxX,n=t.range.minY+r,s=t.range.maxY}t.children[e]={centerOfMass:{x:0,y:0},mass:0,range:{minX:i,maxX:o,minY:n,maxY:s},size:.5*t.size,calcSize:2*t.calcSize,children:{data:null},maxWidth:0,level:t.level+1,childrenCount:0}}},{key:"_debug",value:function(t,e){void 0!==this.barnesHutTree&&(t.lineWidth=1,this._drawBranch(this.barnesHutTree.root,t,e))}},{key:"_drawBranch",value:function(t,e,i){void 0===i&&(i="#FF0000"),4===t.childrenCount&&(this._drawBranch(t.children.NW,e),this._drawBranch(t.children.NE,e),this._drawBranch(t.children.SE,e),this._drawBranch(t.children.SW,e)),e.strokeStyle=i,e.beginPath(),e.moveTo(t.range.minX,t.range.minY),e.lineTo(t.range.maxX,t.range.minY),e.stroke(),e.beginPath(),e.moveTo(t.range.maxX,t.range.minY),e.lineTo(t.range.maxX,t.range.maxY),e.stroke(),e.beginPath(),e.moveTo(t.range.maxX,t.range.maxY),e.lineTo(t.range.minX,t.range.maxY),e.stroke(),e.beginPath(),e.moveTo(t.range.minX,t.range.maxY),e.lineTo(t.range.minX,t.range.minY),e.stroke()}}]),t}();e.default=n},function(t,e){function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var i=0;i0){var s=n.edges.length+1,r=this.options.centralGravity*s*n.options.mass;o[n.id].x=e*r,o[n.id].y=i*r}}}]),e}(d.default);e.default=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(){function t(t,e){for(var i=0;i=t&&i.push(n.id)}for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{},e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(void 0===t.joinCondition)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");t=this._checkOptions(t);for(var i={},o={},n=0;n2&&void 0!==arguments[2])||arguments[2];e=this._checkOptions(e);for(var o=[],n={},s=void 0,r=void 0,a=void 0,d=void 0,l=void 0,c=0;c0&&Object.keys(p).length>0&&m===!0&&o.push({nodes:u,edges:p})}}}for(var b=0;b1&&void 0!==arguments[1])||arguments[1];this.clusterByEdgeCount(1,t,e)}},{key:"clusterBridges",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.clusterByEdgeCount(2,t,e)}},{key:"clusterByConnection",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0===t)throw new Error("No nodeId supplied to clusterByConnection!");if(void 0===this.body.nodes[t])throw new Error("The nodeId given to clusterByConnection does not exist!");var o=this.body.nodes[t];e=this._checkOptions(e,o),void 0===e.clusterNodeProperties.x&&(e.clusterNodeProperties.x=o.x),void 0===e.clusterNodeProperties.y&&(e.clusterNodeProperties.y=o.y),void 0===e.clusterNodeProperties.fixed&&(e.clusterNodeProperties.fixed={},e.clusterNodeProperties.fixed.x=o.options.fixed.x,e.clusterNodeProperties.fixed.y=o.options.fixed.y);var n={},s={},r=o.id,a=h.default.cloneOptions(o);n[r]=o;for(var d=0;d-1&&(s[v.id]=v)}this._cluster(n,s,e,i)}},{key:"_createClusterEdges",value:function(t,e,i,o){for(var n=void 0,s=void 0,r=void 0,a=void 0,d=void 0,l=void 0,u=Object.keys(t),p=[],f=0;f0&&void 0!==arguments[0]?arguments[0]:{};return void 0===t.clusterEdgeProperties&&(t.clusterEdgeProperties={}),void 0===t.clusterNodeProperties&&(t.clusterNodeProperties={}),t}},{key:"_cluster",value:function(t,e,i){var o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(0!=Object.keys(t).length&&(1!=Object.keys(t).length||1==i.clusterNodeProperties.allowSingleNodeCluster)){for(var n in t)if(t.hasOwnProperty(n)&&void 0!==this.clusteredNodes[n])return;var s=c.deepExtend({},i.clusterNodeProperties);if(void 0!==i.processProperties){var r=[];for(var a in t)if(t.hasOwnProperty(a)){var d=h.default.cloneOptions(t[a]);r.push(d)}var u=[];for(var p in e)if(e.hasOwnProperty(p)&&"clusterEdge:"!==p.substr(0,12)){var f=h.default.cloneOptions(e[p],"edge");u.push(f)}if(s=i.processProperties(s,r,u),!s)throw new Error("The processProperties function does not return properties!")}void 0===s.id&&(s.id="cluster:"+c.randomUUID());var m=s.id;void 0===s.label&&(s.label="cluster");var v=void 0;void 0===s.x&&(v=this._getClusterPosition(t),s.x=v.x),void 0===s.y&&(void 0===v&&(v=this._getClusterPosition(t)),s.y=v.y),s.id=m;var g=this.body.functions.createNode(s,l.default);g.isCluster=!0,g.containedNodes=t,g.containedEdges=e,g.clusterEdgeProperties=i.clusterEdgeProperties,this.body.nodes[s.id]=g,this._createClusterEdges(t,e,s,i.clusterEdgeProperties);for(var y in e)if(e.hasOwnProperty(y)&&void 0!==this.body.edges[y]){var b=this.body.edges[y];this._backupEdgeOptions(b),b.setOptions({physics:!1,hidden:!0})}for(var _ in t)t.hasOwnProperty(_)&&(this.clusteredNodes[_]={clusterId:s.id,node:this.body.nodes[_]},this.body.nodes[_].setOptions({hidden:!0,physics:!1}));s.id=void 0,o===!0&&this.body.emitter.emit("_dataChanged")}}},{key:"_backupEdgeOptions",value:function(t){void 0===this.clusteredEdges[t.id]&&(this.clusteredEdges[t.id]={physics:t.options.physics,hidden:t.options.hidden})}},{key:"_restoreEdge",value:function(t){var e=this.clusteredEdges[t.id];void 0!==e&&(t.setOptions({physics:e.physics,hidden:e.hidden}),delete this.clusteredEdges[t.id])}},{key:"isCluster",value:function(t){return void 0!==this.body.nodes[t]?this.body.nodes[t].isCluster===!0:(console.log("Node does not exist."),!1)}},{key:"_getClusterPosition",value:function(t){for(var e=Object.keys(t),i=t[e[0]].x,o=t[e[0]].x,n=t[e[0]].y,s=t[e[0]].y,r=void 0,a=1;ao?r.x:o,n=r.ys?r.y:s;return{x:.5*(i+o),y:.5*(n+s)}}},{key:"openCluster",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0===t)throw new Error("No clusterNodeId supplied to openCluster.");if(void 0===this.body.nodes[t])throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(void 0===this.body.nodes[t].containedNodes)return void console.log("The node:"+t+" is not a cluster.");var o=this.body.nodes[t],n=o.containedNodes,s=o.containedEdges;if(void 0!==e&&void 0!==e.releaseFunction&&"function"==typeof e.releaseFunction){var r={},a={x:o.x,y:o.y};for(var d in n)if(n.hasOwnProperty(d)){var l=this.body.nodes[d];r[d]={x:l.x,y:l.y}}var u=e.releaseFunction(a,r);for(var p in n)if(n.hasOwnProperty(p)){var f=this.body.nodes[p];void 0!==u[p]&&(f.x=void 0===u[p].x?o.x:u[p].x,f.y=void 0===u[p].y?o.y:u[p].y)}}else for(var m in n)if(n.hasOwnProperty(m)){var v=this.body.nodes[m];v=n[m],v.options.fixed.x===!1&&(v.x=o.x),v.options.fixed.y===!1&&(v.y=o.y)}for(var g in n)if(n.hasOwnProperty(g)){var y=this.body.nodes[g];y.vx=o.vx,y.vy=o.vy,y.setOptions({hidden:!1,physics:!0}),delete this.clusteredNodes[g]}for(var b=[],_=0;_o&&(o=s.edges.length),t+=s.edges.length, -e+=Math.pow(s.edges.length,2),i+=1}t/=i,e/=i;var r=e-Math.pow(t,2),a=Math.sqrt(r),h=Math.floor(t+2*a);return h>o&&(h=o),h}}]),t}();e.default=u},function(t,e,i){function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:[],o=1e9,n=-1e9,s=1e9,r=-1e9;if(i.length>0)for(var a=0;ae.shape.boundingBox.left&&(s=e.shape.boundingBox.left),re.shape.boundingBox.top&&(o=e.shape.boundingBox.top),n1&&void 0!==arguments[1]?arguments[1]:[],o=1e9,n=-1e9,s=1e9,r=-1e9;if(i.length>0)for(var a=0;ae.x&&(s=e.x),re.y&&(o=e.y),n0,t.renderTimer=void 0}),this.body.emitter.on("destroy",function(){t.renderRequests=0,t.allowRedraw=!1,t.renderingActive=!1,t.requiresTimeout===!0?clearTimeout(t.renderTimer):cancelAnimationFrame(t.renderTimer),t.body.emitter.off()})}},{key:"setOptions",value:function(t){if(void 0!==t){var e=["hideEdgesOnDrag","hideNodesOnDrag"];s.selectiveDeepExtend(e,this.options,t)}}},{key:"_startRendering",value:function(){this.renderingActive===!0&&void 0===this.renderTimer&&(this.requiresTimeout===!0?this.renderTimer=window.setTimeout(this._renderStep.bind(this),this.simulationInterval):this.renderTimer=window.requestAnimationFrame(this._renderStep.bind(this)))}},{key:"_renderStep",value:function(){this.renderingActive===!0&&(this.renderTimer=void 0,this.requiresTimeout===!0&&this._startRendering(),this._redraw(),this.requiresTimeout===!1&&this._startRendering())}},{key:"redraw",value:function(){this.body.emitter.emit("setSize"),this._redraw()}},{key:"_requestRedraw",value:function(){var t=this;this.redrawRequested!==!0&&this.renderingActive===!1&&this.allowRedraw===!0&&(this.redrawRequested=!0,this.requiresTimeout===!0?window.setTimeout(function(){t._redraw(!1)},0):window.requestAnimationFrame(function(){t._redraw(!1)}))}},{key:"_redraw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.allowRedraw===!0){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1;var e=this.canvas.frame.canvas.getContext("2d");0!==this.canvas.frame.canvas.width&&0!==this.canvas.frame.canvas.height||this.canvas.setSize(),this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1),e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var i=this.canvas.frame.canvas.clientWidth,o=this.canvas.frame.canvas.clientHeight;if(e.clearRect(0,0,i,o),0===this.canvas.frame.clientWidth)return;e.save(),e.translate(this.body.view.translation.x,this.body.view.translation.y),e.scale(this.body.view.scale,this.body.view.scale),e.beginPath(),this.body.emitter.emit("beforeDrawing",e),e.closePath(),t===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&this._drawEdges(e),(this.dragging===!1||this.dragging===!0&&this.options.hideNodesOnDrag===!1)&&this._drawNodes(e,t),e.beginPath(),this.body.emitter.emit("afterDrawing",e),e.closePath(),e.restore(),t===!0&&e.clearRect(0,0,i,o)}}},{key:"_resizeNodes",value:function(){var t=this.canvas.frame.canvas.getContext("2d");void 0===this.pixelRatio&&(this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)),t.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0),t.save(),t.translate(this.body.view.translation.x,this.body.view.translation.y),t.scale(this.body.view.scale,this.body.view.scale);var e=this.body.nodes,i=void 0;for(var o in e)e.hasOwnProperty(o)&&(i=e[o],i.resize(t),i.updateBoundingBox(t,i.selected));t.restore()}},{key:"_drawNodes",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.body.nodes,o=this.body.nodeIndices,n=void 0,s=[],r=20,a=this.canvas.DOMtoCanvas({x:-r,y:-r}),h=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+r,y:this.canvas.frame.canvas.clientHeight+r}),d={top:a.y,left:a.x,bottom:h.y,right:h.x},l=0;l0&&void 0!==arguments[0]?arguments[0]:this.pixelRatio;this.initialized===!0&&(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&&this.cameraState.previousWidth>0){var t=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,e=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight,i=this.cameraState.scale;1!=t&&1!=e?i=.5*this.cameraState.scale*(t+e):1!=t?i=this.cameraState.scale*t:1!=e&&(i=this.cameraState.scale*e),this.body.view.scale=i;var o=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),n={x:o.x-this.cameraState.position.x,y:o.y-this.cameraState.position.y};this.body.view.translation.x+=n.x*this.body.view.scale,this.body.view.translation.y+=n.y*this.body.view.scale}}},{key:"_prepareValue",value:function(t){if("number"==typeof t)return t+"px";if("string"==typeof t){if(t.indexOf("%")!==-1||t.indexOf("px")!==-1)return t;if(t.indexOf("%")===-1)return t+"px"}throw new Error("Could not use the value supplied for width or height:"+t)}},{key:"_create",value:function(){for(;this.body.container.hasChildNodes();)this.body.container.removeChild(this.body.container.firstChild);if(this.frame=document.createElement("div"),this.frame.className="vis-network",this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.tabIndex=900,this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas),this.frame.canvas.getContext){var t=this.frame.canvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1),this.frame.canvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}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 s(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:s.DIRECTION_ALL}),r.onTouch(this.hammer,function(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 s(this.frame),r.onRelease(this.hammerFrame,function(e){t.body.eventListeners.onRelease(e)})}},{key:"setSize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.width,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.height;t=this._prepareValue(t),e=this._prepareValue(e);var i=!1,o=this.frame.canvas.width,n=this.frame.canvas.height,s=this.frame.canvas.getContext("2d"),r=this.pixelRatio;return this.pixelRatio=(window.devicePixelRatio||1)/(s.webkitBackingStorePixelRatio||s.mozBackingStorePixelRatio||s.msBackingStorePixelRatio||s.oBackingStorePixelRatio||s.backingStorePixelRatio||1),t!=this.options.width||e!=this.options.height||this.frame.style.width!=t||this.frame.style.height!=e?(this._getCameraState(r),this.frame.style.width=t,this.frame.style.height=e,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=t,this.options.height=e,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},i=!0):(this.frame.canvas.width==Math.round(this.frame.canvas.clientWidth*this.pixelRatio)&&this.frame.canvas.height==Math.round(this.frame.canvas.clientHeight*this.pixelRatio)||this._getCameraState(r),this.frame.canvas.width!=Math.round(this.frame.canvas.clientWidth*this.pixelRatio)&&(this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),i=!0),this.frame.canvas.height!=Math.round(this.frame.canvas.clientHeight*this.pixelRatio)&&(this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),i=!0)),i===!0&&(this.body.emitter.emit("resize",{width:Math.round(this.frame.canvas.width/this.pixelRatio),height:Math.round(this.frame.canvas.height/this.pixelRatio),oldWidth:Math.round(o/this.pixelRatio),oldHeight:Math.round(n/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,i}},{key:"_XconvertDOMtoCanvas",value:function(t){return(t-this.body.view.translation.x)/this.body.view.scale}},{key:"_XconvertCanvasToDOM",value:function(t){return t*this.body.view.scale+this.body.view.translation.x}},{key:"_YconvertDOMtoCanvas",value:function(t){return(t-this.body.view.translation.y)/this.body.view.scale}},{key:"_YconvertCanvasToDOM",value:function(t){return t*this.body.view.scale+this.body.view.translation.y}},{key:"canvasToDOM",value:function(t){return{x:this._XconvertCanvasToDOM(t.x),y:this._YconvertCanvasToDOM(t.y)}}},{key:"DOMtoCanvas",value:function(t){return{x:this._XconvertDOMtoCanvas(t.x),y:this._YconvertDOMtoCanvas(t.y)}}}]),t}();e.default=h},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:{};this.options=t}},{key:"fit",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{nodes:[]},e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=void 0,o=void 0;if(void 0!==t.nodes&&0!==t.nodes.length||(t.nodes=this.body.nodeIndices),e===!0){var n=0;for(var s in this.body.nodes)if(this.body.nodes.hasOwnProperty(s)){var r=this.body.nodes[s];r.predefinedPosition===!0&&(n+=1)}if(n>.5*this.body.nodeIndices.length)return void this.fit(t,!1);i=a.default.getRange(this.body.nodes,t.nodes);var h=this.body.nodeIndices.length;o=12.662/(h+7.4147)+.0964822;var d=Math.min(this.canvas.frame.canvas.clientWidth/600,this.canvas.frame.canvas.clientHeight/600);o*=d}else{this.body.emitter.emit("_resizeNodes"),i=a.default.getRange(this.body.nodes,t.nodes);var l=1.1*Math.abs(i.maxX-i.minX),c=1.1*Math.abs(i.maxY-i.minY),u=this.canvas.frame.canvas.clientWidth/l,p=this.canvas.frame.canvas.clientHeight/c;o=u<=p?u:p}o>1?o=1:0===o&&(o=1);var f=a.default.findCenter(i),m={position:f,scale:o,animation:t.animation};this.moveTo(m)}},{key:"focus",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(void 0!==this.body.nodes[t]){var i={x:this.body.nodes[t].x,y:this.body.nodes[t].y};e.position=i,e.lockedOnNode=t,this.moveTo(e)}else console.log("Node: "+t+" cannot be found.")}},{key:"moveTo",value:function(t){return void 0===t?void(t={}):(void 0===t.offset&&(t.offset={x:0,y:0}),void 0===t.offset.x&&(t.offset.x=0),void 0===t.offset.y&&(t.offset.y=0),void 0===t.scale&&(t.scale=this.body.view.scale),void 0===t.position&&(t.position=this.getViewPosition()),void 0===t.animation&&(t.animation={duration:0}),t.animation===!1&&(t.animation={duration:0}),t.animation===!0&&(t.animation={}),void 0===t.animation.duration&&(t.animation.duration=1e3),void 0===t.animation.easingFunction&&(t.animation.easingFunction="easeInOutQuad"),void this.animateView(t))}},{key:"animateView",value:function(t){if(void 0!==t){this.animationEasingFunction=t.animation.easingFunction,this.releaseNode(),t.locked===!0&&(this.lockedOnNodeId=t.lockedOnNode,this.lockedOnNodeOffset=t.offset),0!=this.easingTime&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=t.scale,this.body.view.scale=this.targetScale;var e=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),i={x:e.x-t.position.x,y:e.y-t.position.y};this.targetTranslation={x:this.sourceTranslation.x+i.x*this.targetScale+t.offset.x,y:this.sourceTranslation.y+i.y*this.targetScale+t.offset.y},0===t.animation.duration?void 0!=this.lockedOnNodeId?(this.viewFunction=this._lockedRedraw.bind(this),this.body.emitter.on("initRedraw",this.viewFunction)):(this.body.view.scale=this.targetScale,this.body.view.translation=this.targetTranslation,this.body.emitter.emit("_requestRedraw")):(this.animationSpeed=1/(60*t.animation.duration*.001)||1/60,this.animationEasingFunction=t.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 t={x:this.body.nodes[this.lockedOnNodeId].x,y:this.body.nodes[this.lockedOnNodeId].y},e=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),i={x:e.x-t.x,y:e.y-t.y},o=this.body.view.translation,n={x:o.x+i.x*this.body.view.scale+this.lockedOnNodeOffset.x,y:o.y+i.y*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=n}},{key:"releaseNode",value:function(){void 0!==this.lockedOnNodeId&&void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}},{key:"_transitionRedraw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.easingTime+=this.animationSpeed,this.easingTime=t===!0?1:this.easingTime;var e=h.easingFunctions[this.animationEasingFunction](this.easingTime);this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*e,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*e,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*e},this.easingTime>=1&&(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,void 0!=this.lockedOnNodeId&&(this.viewFunction=this._lockedRedraw.bind(this),this.body.emitter.on("initRedraw",this.viewFunction)),this.body.emitter.emit("animationFinished"))}},{key:"getScale",value:function(){return this.body.view.scale}},{key:"getViewPosition",value:function(){return this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight})}}]),t}();e.default=d},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var i=0;i50&&(this.drag.pointer=this.getPointer(t.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=(new Date).valueOf())}},{key:"onTap",value:function(t){var e=this.getPointer(t.center),i=this.selectionHandler.options.multiselect&&(t.changedPointers[0].ctrlKey||t.changedPointers[0].metaKey);this.checkSelectionChanges(e,t,i),this.selectionHandler._generateClickEvent("click",t,e)}},{key:"onDoubleTap",value:function(t){var e=this.getPointer(t.center);this.selectionHandler._generateClickEvent("doubleClick",t,e)}},{key:"onHold",value:function(t){var e=this.getPointer(t.center),i=this.selectionHandler.options.multiselect;this.checkSelectionChanges(e,t,i),this.selectionHandler._generateClickEvent("click",t,e),this.selectionHandler._generateClickEvent("hold",t,e)}},{key:"onRelease",value:function(t){if((new Date).valueOf()-this.touchTime>10){var e=this.getPointer(t.center);this.selectionHandler._generateClickEvent("release",t,e),this.touchTime=(new Date).valueOf()}}},{key:"onContext",value:function(t){var e=this.getPointer({x:t.clientX,y:t.clientY});this.selectionHandler._generateClickEvent("oncontext",t,e)}},{key:"checkSelectionChanges",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=this.selectionHandler._getSelectedEdgeCount(),n=this.selectionHandler._getSelectedNodeCount(),s=this.selectionHandler.getSelection(),r=void 0;r=i===!0?this.selectionHandler.selectAdditionalOnPoint(t):this.selectionHandler.selectOnPoint(t);var a=this.selectionHandler._getSelectedEdgeCount(),h=this.selectionHandler._getSelectedNodeCount(),d=this.selectionHandler.getSelection(),l=this._determineIfDifferent(s,d),c=l.nodesChanged,u=l.edgesChanged,p=!1;h-n>0?(this.selectionHandler._generateClickEvent("selectNode",e,t),r=!0,p=!0):c===!0&&h>0?(this.selectionHandler._generateClickEvent("deselectNode",e,t,s),this.selectionHandler._generateClickEvent("selectNode",e,t),p=!0,r=!0):h-n<0&&(this.selectionHandler._generateClickEvent("deselectNode",e,t,s),r=!0),a-o>0&&p===!1?(this.selectionHandler._generateClickEvent("selectEdge",e,t),r=!0):a>0&&u===!0?(this.selectionHandler._generateClickEvent("deselectEdge",e,t,s),this.selectionHandler._generateClickEvent("selectEdge",e,t),r=!0):a-o<0&&(this.selectionHandler._generateClickEvent("deselectEdge",e,t,s),r=!0),r===!0&&this.selectionHandler._generateClickEvent("select",e,t)}},{key:"_determineIfDifferent",value:function(t,e){for(var i=!1,o=!1,n=0;n10&&(t=10);var o=void 0;void 0!==this.drag&&this.drag.dragging===!0&&(o=this.canvas.DOMtoCanvas(this.drag.pointer));var n=this.body.view.translation,s=t/i,r=(1-s)*e.x+n.x*s,a=(1-s)*e.y+n.y*s;if(this.body.view.scale=t,this.body.view.translation={x:r,y:a},void 0!=o){var h=this.canvas.canvasToDOM(o);this.drag.pointer.x=h.x,this.drag.pointer.y=h.y}this.body.emitter.emit("_requestRedraw"),i0&&(this.popupObj=h[c[c.length-1]],s=!0)}if(void 0===this.popupObj&&s===!1){for(var p=this.body.edgeIndices,f=this.body.edges,m=void 0,v=[],g=0;g0&&(this.popupObj=f[v[v.length-1]],r="edge")}void 0!==this.popupObj?this.popupObj.id!==n&&(void 0===this.popup&&(this.popup=new d.default(this.canvas.frame)),this.popup.popupTargetType=r,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(t.x+3,t.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(t){var e=this.selectionHandler._pointerToPositionObject(t),i=!1;if("node"===this.popup.popupTargetType){if(void 0!==this.body.nodes[this.popup.popupTargetId]&&(i=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(e),i===!0)){var o=this.selectionHandler.getNodeAt(t);i=o.id===this.popup.popupTargetId}}else void 0===this.selectionHandler.getNodeAt(t)&&void 0!==this.body.edges[this.popup.popupTargetId]&&(i=this.body.edges[this.popup.popupTargetId].isOverlappingWith(e));i===!1&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}}]),t}();e.default=c},function(t,e,i){function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){for(var i=0;i700&&(this.body.emitter.emit("fit",{duration:700}),this.touchTime=(new Date).valueOf())}},{key:"_stopMovement",value:function(){for(var t in this.boundFunctions)this.boundFunctions.hasOwnProperty(t)&&(this.body.emitter.off("initRedraw",this.boundFunctions[t]),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 t=this.body.view.scale,e=this.body.view.scale*(1+this.options.keyboard.speed.zoom),i=this.body.view.translation,o=e/t,n=(1-o)*this.canvas.canvasViewCenter.x+i.x*o,s=(1-o)*this.canvas.canvasViewCenter.y+i.y*o;this.body.view.scale=e,this.body.view.translation={x:n,y:s},this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale})}},{key:"_zoomOut",value:function(){var t=this.body.view.scale,e=this.body.view.scale/(1+this.options.keyboard.speed.zoom),i=this.body.view.translation,o=e/t,n=(1-o)*this.canvas.canvasViewCenter.x+i.x*o,s=(1-o)*this.canvas.canvasViewCenter.y+i.y*o;this.body.view.scale=e,this.body.view.translation={x:n,y:s},this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale})}},{key:"configureKeyboardBindings",value:function(){var t=this;void 0!==this.keycharm&&this.keycharm.destroy(),this.options.keyboard.enabled===!0&&(this.options.keyboard.bindToWindow===!0?this.keycharm=a({container:window,preventDefault:!0}):this.keycharm=a({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),this.activated===!0&&(this.keycharm.bind("up",function(){t.bindToRedraw("_moveUp")},"keydown"),this.keycharm.bind("down",function(){t.bindToRedraw("_moveDown")},"keydown"),this.keycharm.bind("left",function(){t.bindToRedraw("_moveLeft")},"keydown"),this.keycharm.bind("right",function(){t.bindToRedraw("_moveRight")},"keydown"),this.keycharm.bind("=",function(){t.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("num+",function(){t.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("num-",function(){t.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("-",function(){t.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("[",function(){t.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("]",function(){t.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("pageup",function(){t.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("pagedown",function(){t.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("up",function(){t.unbindFromRedraw("_moveUp")},"keyup"),this.keycharm.bind("down",function(){t.unbindFromRedraw("_moveDown")},"keyup"),this.keycharm.bind("left",function(){t.unbindFromRedraw("_moveLeft")},"keyup"),this.keycharm.bind("right",function(){t.unbindFromRedraw("_moveRight")},"keyup"),this.keycharm.bind("=",function(){t.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("num+",function(){t.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("num-",function(){t.unbindFromRedraw("_zoomOut")},"keyup"),this.keycharm.bind("-",function(){t.unbindFromRedraw("_zoomOut")},"keyup"),this.keycharm.bind("[",function(){t.unbindFromRedraw("_zoomOut")},"keyup"),this.keycharm.bind("]",function(){t.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("pageup",function(){t.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("pagedown",function(){t.unbindFromRedraw("_zoomOut")},"keyup")))}}]),t}();e.default=h},function(t,e){function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var i=0;io&&(s=o-e-this.padding),sn&&(r=n-i-this.padding),r4&&void 0!==arguments[4]&&arguments[4],s=void 0;s=n===!0?{nodes:[],edges:[]}:this.getSelection(),s.pointer={DOM:{x:i.x,y:i.y},canvas:this.canvas.DOMtoCanvas(i)},s.event=e,void 0!==o&&(s.previousSelection=o),this.body.emitter.emit(t,s)}},{key:"selectObject",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.selectConnectedEdges;return void 0!==t&&(t instanceof a.default&&e===!0&&this._selectConnectedEdges(t),t.select(),this._addToSelection(t),!0)}},{key:"deselectObject",value:function(t){t.isSelected()===!0&&(t.selected=!1,this._removeFromSelection(t))}},{key:"_getAllNodesOverlappingWith",value:function(t){for(var e=[],i=this.body.nodes,o=0;o1&&void 0!==arguments[1])||arguments[1],i=this._pointerToPositionObject(t),o=this._getAllNodesOverlappingWith(i);return o.length>0?e===!0?this.body.nodes[o[o.length-1]]:o[o.length-1]:void 0}},{key:"_getEdgesOverlappingWith",value:function(t,e){for(var i=this.body.edges,o=0;o1&&void 0!==arguments[1])||arguments[1],i=this.canvas.DOMtoCanvas(t),o=10,n=null,s=this.body.edges,r=0;r1)return!0;return!1}},{key:"_selectConnectedEdges",value:function(t){for(var e=0;e1&&void 0!==arguments[1]?arguments[1]:{},i=void 0,o=void 0;if(!t||!t.nodes&&!t.edges)throw"Selection must be an object with nodes and/or edges properties";if((e.unselectAll||void 0===e.unselectAll)&&this.unselectAll(),t.nodes)for(i=0;i1&&void 0!==arguments[1])||arguments[1];if(!t||void 0===t.length)throw"Selection must be an array with ids";this.setSelection({nodes:t},{highlightEdges:e})}},{key:"selectEdges",value:function(t){if(!t||void 0===t.length)throw"Selection must be an array with ids";this.setSelection({edges:t})}},{key:"updateSelection",value:function(){for(var t in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(t)&&(this.body.nodes.hasOwnProperty(t)||delete this.selectionObj.nodes[t]);for(var e in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(e)&&(this.body.edges.hasOwnProperty(e)||delete this.selectionObj.edges[e])}}]),t}();e.default=c},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){var i=[],o=!0,n=!1,s=void 0;try{for(var r,a=t[Symbol.iterator]();!(o=(r=a.next()).done)&&(i.push(r.value),!e||i.length!==e);o=!0);}catch(t){n=!0,s=t}finally{try{!o&&a.return&&a.return()}finally{if(n)throw s}}return i}return function(e,i){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=function(){function t(t,e){for(var i=0;i0&&(this.options.hierarchical.levelSeparation*=-1):this.options.hierarchical.levelSeparation<0&&(this.options.hierarchical.levelSeparation*=-1),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(e);if(i===!0)return this.body.emitter.emit("refresh"),l.deepExtend(e,this.optionsBackup)}return e}},{key:"adaptAllOptionsForHierarchicalLayout",value:function(t){if(this.options.hierarchical.enabled===!0){void 0===t.physics||t.physics===!0?(t.physics={enabled:void 0===this.optionsBackup.physics.enabled||this.optionsBackup.physics.enabled,solver:"hierarchicalRepulsion"},this.optionsBackup.physics.enabled=void 0===this.optionsBackup.physics.enabled||this.optionsBackup.physics.enabled,this.optionsBackup.physics.solver=this.optionsBackup.physics.solver||"barnesHut"):"object"===r(t.physics)?(this.optionsBackup.physics.enabled=void 0===t.physics.enabled||t.physics.enabled,this.optionsBackup.physics.solver=t.physics.solver||"barnesHut",t.physics.solver="hierarchicalRepulsion"):t.physics!==!1&&(this.optionsBackup.physics.solver="barnesHut",t.physics={solver:"hierarchicalRepulsion"});var e="horizontal";"RL"!==this.options.hierarchical.direction&&"LR"!==this.options.hierarchical.direction||(e="vertical"),void 0===t.edges?(this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},t.edges={smooth:!1}):void 0===t.edges.smooth?(this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},t.edges.smooth=!1):"boolean"==typeof t.edges.smooth?(this.optionsBackup.edges={smooth:t.edges.smooth},t.edges.smooth={enabled:t.edges.smooth,type:e}):(void 0!==t.edges.smooth.type&&"dynamic"!==t.edges.smooth.type&&(e=t.edges.smooth.type),this.optionsBackup.edges={smooth:void 0===t.edges.smooth.enabled||t.edges.smooth.enabled,type:void 0===t.edges.smooth.type?"dynamic":t.edges.smooth.type,roundness:void 0===t.edges.smooth.roundness?.5:t.edges.smooth.roundness,forceDirection:void 0!==t.edges.smooth.forceDirection&&t.edges.smooth.forceDirection},t.edges.smooth={enabled:void 0===t.edges.smooth.enabled||t.edges.smooth.enabled,type:e,roundness:void 0===t.edges.smooth.roundness?.5:t.edges.smooth.roundness,forceDirection:void 0!==t.edges.smooth.forceDirection&&t.edges.smooth.forceDirection}),this.body.emitter.emit("_forceDisableDynamicCurves",e)}return t}},{key:"seededRandom",value:function(){var t=1e4*Math.sin(this.randomSeed++);return t-Math.floor(t)}},{key:"positionInitially",value:function(t){if(this.options.hierarchical.enabled!==!0){this.randomSeed=this.initialRandomSeed;for(var e=0;es){for(var r=this.body.nodeIndices.length;this.body.nodeIndices.length>s;){n+=1;var a=this.body.nodeIndices.length;n%3===0?this.body.modules.clustering.clusterBridges():this.body.modules.clustering.clusterOutliers();var h=this.body.nodeIndices.length;if(a==h&&n%3!==0||n>o)return this._declusterAll(),this.body.emitter.emit("_layoutFailed"),void console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.")}this.body.modules.kamadaKawai.setOptions({springLength:Math.max(150,2*r)})}this.body.modules.kamadaKawai.solve(this.body.nodeIndices,this.body.edgeIndices,!0),this._shiftToCenter();for(var d=70,l=0;l0){var t=void 0,e=void 0,i=!1,o=!0,n=!1;this.hierarchicalLevels={},this.lastNodeOnLevel={},this.hierarchicalChildrenReference={},this.hierarchicalParentReference={},this.hierarchicalTrees={},this.treeIndex=-1,this.distributionOrdering={},this.distributionIndex={},this.distributionOrderingPresence={};for(e in this.body.nodes)this.body.nodes.hasOwnProperty(e)&&(t=this.body.nodes[e],void 0===t.options.x&&void 0===t.options.y&&(o=!1),void 0!==t.options.level?(i=!0,this.hierarchicalLevels[e]=t.options.level):n=!0);if(n===!0&&i===!0)throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");n===!0&&("hubsize"===this.options.hierarchical.sortMethod?this._determineLevelsByHubsize():"directed"===this.options.hierarchical.sortMethod?this._determineLevelsDirected():"custom"===this.options.hierarchical.sortMethod&&this._determineLevelsCustomCallback());for(var s in this.body.nodes)this.body.nodes.hasOwnProperty(s)&&void 0===this.hierarchicalLevels[s]&&(this.hierarchicalLevels[s]=0);var r=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(r),this._condenseHierarchy(),this._shiftToCenter()}}},{key:"_condenseHierarchy",value:function(){var t=this,e=!1,i={},o=function(){for(var e=a(),i=0;i0)for(var s=0;s1&&void 0!==arguments[1]?arguments[1]:1e9,o=1e9,n=1e9,r=1e9,a=-1e9;for(var h in e)if(e.hasOwnProperty(h)){var d=t.body.nodes[h],l=t.hierarchicalLevels[d.id],c=t._getPositionForHierarchy(d),u=t._getSpaceAroundNode(d,e),p=s(u,2),f=p[0],m=p[1];o=Math.min(f,o),n=Math.min(m,n),l<=i&&(r=Math.min(c,r),a=Math.max(c,a))}return[r,a,o,n]},l=function e(i){var o=t.hierarchicalLevels[i];if(t.hierarchicalChildrenReference[i]){var n=t.hierarchicalChildrenReference[i];if(n.length>0)for(var s=0;s1)for(var a=0;a2&&void 0!==arguments[2]&&arguments[2],r=t._getPositionForHierarchy(i),a=t._getPositionForHierarchy(o),l=Math.abs(a-r);if(l>t.options.hierarchical.nodeSpacing){var u={};u[i.id]=!0;var p={};p[o.id]=!0,h(i,u),h(o,p);var f=c(i,o),m=d(u,f),v=s(m,4),g=(v[0],v[1]),y=(v[2],v[3],d(p,f)),b=s(y,4),_=b[0],w=(b[1],b[2]),x=(b[3],Math.abs(g-_));if(x>t.options.hierarchical.nodeSpacing){var k=g-_+t.options.hierarchical.nodeSpacing;k<-w+t.options.hierarchical.nodeSpacing&&(k=-w+t.options.hierarchical.nodeSpacing),k<0&&(t._shiftBlock(o.id,k),e=!0,n===!0&&t._centerParent(o))}}},m=function(o,n){for(var r=n.id,a=n.edges,l=t.hierarchicalLevels[n.id],c=t.options.hierarchical.levelSeparation*t.options.hierarchical.levelSeparation,u={},p=[],f=0;f0?m=Math.min(f,p-t.options.hierarchical.nodeSpacing):f<0&&(m=-Math.min(-f,u-t.options.hierarchical.nodeSpacing)),0!=m&&(t._shiftBlock(n.id,m),e=!0)},w=function(i){var o=t._getPositionForHierarchy(n),r=t._getSpaceAroundNode(n),a=s(r,2),h=a[0],d=a[1],l=i-o,c=o;l>0?c=Math.min(o+(d-t.options.hierarchical.nodeSpacing),i):l<0&&(c=Math.max(o-(h-t.options.hierarchical.nodeSpacing),i)),c!==o&&(t._setPositionForHierarchy(n,c,void 0,!0),e=!0)},x=b(o,p);_(x),x=b(o,a),w(x)},v=function(i){var o=Object.keys(t.distributionOrdering);o=o.reverse();for(var n=0;n0)for(var d=0;d0&&Math.abs(g)0&&(r=this._getPositionForHierarchy(i[n-1])+this.options.hierarchical.nodeSpacing),this._setPositionForHierarchy(s,r,e),this._validataPositionAndContinue(s,e,r),o++}}}}},{key:"_placeBranchNodes",value:function(t,e){if(void 0!==this.hierarchicalChildrenReference[t]){for(var i=[],o=0;oe&&void 0===this.positionedNodes[s.id]))return;var a=void 0;a=0===n?this._getPositionForHierarchy(this.body.nodes[t]):this._getPositionForHierarchy(i[n-1])+this.options.hierarchical.nodeSpacing,this._setPositionForHierarchy(s,a,r),this._validataPositionAndContinue(s,r,a)}for(var h=1e9,d=-1e9,l=0;l0&&(e=this._getHubSize(),0!==e);)for(var o in this.body.nodes)if(this.body.nodes.hasOwnProperty(o)){var n=this.body.nodes[o];n.edges.length===e&&this._crawlNetwork(i,o)}}},{key:"_determineLevelsCustomCallback",value:function(){var t=this,e=1e5,i=function(t,e,i){},o=function(o,n,s){var r=t.hierarchicalLevels[o.id];void 0===r&&(t.hierarchicalLevels[o.id]=e);var a=i(d.default.cloneOptions(o,"node"),d.default.cloneOptions(n,"node"),d.default.cloneOptions(s,"edge"));t.hierarchicalLevels[n.id]=t.hierarchicalLevels[o.id]+a};this._crawlNetwork(o),this._setMinLevelToZero()}},{key:"_determineLevelsDirected",value:function(){var t=this,e=1e4,i=function(i,o,n){var s=t.hierarchicalLevels[i.id];void 0===s&&(t.hierarchicalLevels[i.id]=e),n.toId==o.id?t.hierarchicalLevels[o.id]=t.hierarchicalLevels[i.id]+1:t.hierarchicalLevels[o.id]=t.hierarchicalLevels[i.id]-1};this._crawlNetwork(i),this._setMinLevelToZero()}},{key:"_setMinLevelToZero",value:function(){var t=1e9;for(var e in this.body.nodes)this.body.nodes.hasOwnProperty(e)&&void 0!==this.hierarchicalLevels[e]&&(t=Math.min(this.hierarchicalLevels[e],t));for(var i in this.body.nodes)this.body.nodes.hasOwnProperty(i)&&void 0!==this.hierarchicalLevels[i]&&(this.hierarchicalLevels[i]-=t)}},{key:"_generateMap",value:function(){var t=this,e=function(e,i){if(t.hierarchicalLevels[i.id]>t.hierarchicalLevels[e.id]){var o=e.id,n=i.id;void 0===t.hierarchicalChildrenReference[o]&&(t.hierarchicalChildrenReference[o]=[]),t.hierarchicalChildrenReference[o].push(n),void 0===t.hierarchicalParentReference[n]&&(t.hierarchicalParentReference[n]=[]),t.hierarchicalParentReference[n].push(o)}};this._crawlNetwork(e)}},{key:"_crawlNetwork",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},i=arguments[1],o={},n=0,s=function i(n,s){if(void 0===o[n.id]){void 0===t.hierarchicalTrees[n.id]&&(t.hierarchicalTrees[n.id]=s,t.treeIndex=Math.max(s,t.treeIndex)),o[n.id]=!0;for(var r=void 0,a=0;a3&&void 0!==arguments[3]&&arguments[3];o!==!0&&(void 0===this.distributionOrdering[i]&&(this.distributionOrdering[i]=[],this.distributionOrderingPresence[i]={}),void 0===this.distributionOrderingPresence[i][t.id]&&(this.distributionOrdering[i].push(t),this.distributionIndex[t.id]=this.distributionOrdering[i].length-1),this.distributionOrderingPresence[i][t.id]=!0),"UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?t.x=e:t.y=e}},{key:"_getPositionForHierarchy",value:function(t){return"UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?t.x:t.y}},{key:"_sortNodeArray",value:function(t){t.length>1&&("UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?t.sort(function(t,e){return t.x-e.x}):t.sort(function(t,e){return t.y-e.y}))}}]),t}();e.default=c},function(t,e,i){function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){for(var i=0;i0&&this.options.deleteNode!==!1?(n===!0&&this._createSeperator(4),this._createDeleteButton(o)):0===t&&this.options.deleteEdge!==!1&&(n===!0&&this._createSeperator(4),this._createDeleteButton(o))),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this)),this._temporaryBindEvent("select",this.showManipulatorToolbar.bind(this))}this.body.emitter.emit("_redraw")}},{key:"addNodeMode",value:function(){if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addNode",this.guiEnabled===!0){var t=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(t),this._createSeperator(),this._createDescription(t.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;this.editMode!==!0&&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(e.isCluster!==!0){var i=s.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&&void 0!==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(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addEdge",this.guiEnabled===!0){var t=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(t),this._createSeperator(),this._createDescription(t.edgeDescription||this.options.locales.en.edgeDescription),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this))}this._temporaryBindUI("onTouch",this._handleConnect.bind(this)),this._temporaryBindUI("onDragEnd",this._finishConnect.bind(this)),this._temporaryBindUI("onDrag",this._dragControlNode.bind(this)),this._temporaryBindUI("onRelease",this._finishConnect.bind(this)),this._temporaryBindUI("onDragStart",function(){}),this._temporaryBindUI("onHold",function(){})}},{key:"editEdgeMode",value:function(){var t=this;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="editEdge",this.guiEnabled===!0){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))}this.edgeBeingEditedId=this.selectionHandler.getSelectedEdges()[0],void 0!==this.edgeBeingEditedId?!function(){var e=t.body.edges[t.edgeBeingEditedId],i=t._getNewTargetNode(e.from.x,e.from.y),o=t._getNewTargetNode(e.to.x,e.to.y);t.temporaryIds.nodes.push(i.id),t.temporaryIds.nodes.push(o.id),t.body.nodes[i.id]=i,t.body.nodeIndices.push(i.id),t.body.nodes[o.id]=o,t.body.nodeIndices.push(o.id),t._temporaryBindUI("onTouch",t._controlNodeTouch.bind(t)),t._temporaryBindUI("onTap",function(){}),t._temporaryBindUI("onHold",function(){}),t._temporaryBindUI("onDragStart",t._controlNodeDragStart.bind(t)),t._temporaryBindUI("onDrag",t._controlNodeDrag.bind(t)),t._temporaryBindUI("onDragEnd",t._controlNodeDragEnd.bind(t)),t._temporaryBindUI("onMouseMove",function(){}),t._temporaryBindEvent("beforeDrawing",function(t){var n=e.edgeType.findBorderPositions(t);i.selected===!1&&(i.x=n.from.x,i.y=n.from.y),o.selected===!1&&(o.x=n.to.x,o.y=n.to.y)}),t.body.emitter.emit("_redraw")}():this.showManipulatorToolbar()}},{key:"deleteSelected",value:function(){var t=this;this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="delete";var e=this.selectionHandler.getSelectedNodes(),i=this.selectionHandler.getSelectedEdges(),o=void 0;if(e.length>0){for(var n=0;n0&&"function"==typeof this.options.deleteEdge&&(o=this.options.deleteEdge);if("function"==typeof o){var s={nodes:e,edges:i};if(2!==o.length)throw new Error("The function for delete does not support two arguments (data, callback)");o(s,function(e){null!==e&&void 0!==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()):(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(){this.options.enabled===!0?(this.guiEnabled=!0,this._createWrappers(),this.editMode===!1?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}},{key:"_createWrappers",value:function(){void 0===this.manipulationDiv&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",this.editMode===!0?this.manipulationDiv.style.display="block":this.manipulationDiv.style.display="none",this.canvas.frame.appendChild(this.manipulationDiv)),void 0===this.editModeDiv&&(this.editModeDiv=document.createElement("div"),this.editModeDiv.className="vis-edit-mode",this.editMode===!0?this.editModeDiv.style.display="none":this.editModeDiv.style.display="block",this.canvas.frame.appendChild(this.editModeDiv)),void 0===this.closeDiv&&(this.closeDiv=document.createElement("div"),this.closeDiv.className="vis-close",this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv))}},{key:"_getNewTargetNode",value:function(t,e){var i=s.deepExtend({},this.options.controlNodeStyle);i.id="targetNode"+s.randomUUID(),i.hidden=!1,i.physics=!1,i.x=t,i.y=e;var o=this.body.functions.createNode(i);return o.shape.boundingBox={left:t,right:t,top:e,bottom:e},o}},{key:"_createEditButton",value:function(){this._clean(),this.manipulationDOM={},s.recursiveDOMDelete(this.editModeDiv);var t=this.options.locales[this.options.locale],e=this._createButton("editMode","vis-button vis-edit vis-edit-mode",t.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(e),this._bindHammerToDiv(e,this.toggleEditMode.bind(this))}},{key:"_clean",value:function(){this.inMode=!1,this.guiEnabled===!0&&(s.recursiveDOMDelete(this.editModeDiv),s.recursiveDOMDelete(this.manipulationDiv),this._cleanManipulatorHammers()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}},{key:"_cleanManipulatorHammers",value:function(){if(0!=this.manipulationHammers.length){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]: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(t){var e=this._createButton("addNode","vis-button vis-add",t.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(e),this._bindHammerToDiv(e,this.addNodeMode.bind(this))}},{key:"_createAddEdgeButton",value:function(t){var e=this._createButton("addEdge","vis-button vis-connect",t.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(e),this._bindHammerToDiv(e,this.addEdgeMode.bind(this))}},{key:"_createEditNodeButton",value:function(t){var e=this._createButton("editNode","vis-button vis-edit",t.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(e),this._bindHammerToDiv(e,this.editNode.bind(this))}},{key:"_createEditEdgeButton",value:function(t){var e=this._createButton("editEdge","vis-button vis-edit",t.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(e),this._bindHammerToDiv(e,this.editEdgeMode.bind(this))}},{key:"_createDeleteButton",value:function(t){if(this.options.rtl)var e="vis-button vis-delete-rtl";else var e="vis-button vis-delete";var i=this._createButton("delete",e,t.del||this.options.locales.en.del);this.manipulationDiv.appendChild(i),this._bindHammerToDiv(i,this.deleteSelected.bind(this))}},{key:"_createBackButton",value:function(t){var e=this._createButton("back","vis-button vis-back",t.back||this.options.locales.en.back);this.manipulationDiv.appendChild(e),this._bindHammerToDiv(e,this.showManipulatorToolbar.bind(this))}},{key:"_createButton",value:function(t,e,i){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"vis-label";return this.manipulationDOM[t+"Div"]=document.createElement("div"),this.manipulationDOM[t+"Div"].className=e,this.manipulationDOM[t+"Label"]=document.createElement("div"),this.manipulationDOM[t+"Label"].className=o,this.manipulationDOM[t+"Label"].innerHTML=i,this.manipulationDOM[t+"Div"].appendChild(this.manipulationDOM[t+"Label"]),this.manipulationDOM[t+"Div"]}},{key:"_createDescription",value:function(t){this.manipulationDiv.appendChild(this._createButton("description","vis-button vis-none",t))}},{key:"_temporaryBindEvent",value:function(t,e){this.temporaryEventFunctions.push({event:t,boundFunction:e}),this.body.emitter.on(t,e)}},{key:"_temporaryBindUI",value:function(t,e){if(void 0===this.body.eventListeners[t])throw new Error("This UI function does not exist. Typo? You tried: "+t+" possible are: "+JSON.stringify(Object.keys(this.body.eventListeners)));this.temporaryUIFunctions[t]=this.body.eventListeners[t],this.body.eventListeners[t]=e}},{key:"_unbindTemporaryUIs",value:function(){for(var t in this.temporaryUIFunctions)this.temporaryUIFunctions.hasOwnProperty(t)&&(this.body.eventListeners[t]=this.temporaryUIFunctions[t],delete this.temporaryUIFunctions[t]);this.temporaryUIFunctions={}}},{key:"_unbindTemporaryEvents",value:function(){for(var t=0;t=0;r--)if(n[r]!==this.selectedControlNode.id){s=this.body.nodes[n[r]];break}if(void 0!==s&&void 0!==this.selectedControlNode)if(s.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var a=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===a.id?this._performEditEdge(s.id,o.to.id):this._performEditEdge(o.from.id,s.id)}else o.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}}},{key:"_handleConnect",value:function(t){if((new Date).valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(t.center),this.lastTouch.translation=s.extend({},this.body.view.translation);var e=this.lastTouch,i=this.selectionHandler.getNodeAt(e);if(void 0!==i)if(i.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var o=this._getNewTargetNode(i.x,i.y);this.body.nodes[o.id]=o,this.body.nodeIndices.push(o.id);var n=this.body.functions.createEdge({id:"connectionEdge"+s.randomUUID(),from:i.id,to:o.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[n.id]=n,this.body.edgeIndices.push(n.id),this.temporaryIds.nodes.push(o.id),this.temporaryIds.edges.push(n.id)}this.touchTime=(new Date).valueOf()}}},{key:"_dragControlNode",value:function(t){var e=this.body.functions.getPointer(t.center);if(void 0!==this.temporaryIds.nodes[0]){var i=this.body.nodes[this.temporaryIds.nodes[0]];i.x=this.canvas._XconvertDOMtoCanvas(e.x),i.y=this.canvas._YconvertDOMtoCanvas(e.y),this.body.emitter.emit("_redraw")}else{var o=e.x-this.lastTouch.x,n=e.y-this.lastTouch.y;this.body.view.translation={x:this.lastTouch.translation.x+o,y:this.lastTouch.translation.y+n}}}},{key:"_finishConnect",value:function(t){var e=this.body.functions.getPointer(t.center),i=this.selectionHandler._pointerToPositionObject(e),o=void 0;void 0!==this.temporaryIds.edges[0]&&(o=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var n=this.selectionHandler._getAllNodesOverlappingWith(i),s=void 0,r=n.length-1;r>=0;r--)if(this.temporaryIds.nodes.indexOf(n[r])===-1){s=this.body.nodes[n[r]];break}this._cleanupTemporaryNodesAndEdges(),void 0!==s&&(s.isCluster===!0?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):void 0!==this.body.nodes[o]&&void 0!==this.body.nodes[s.id]&&this._performAddEdge(o,s.id)),this.body.emitter.emit("_redraw")}},{key:"_performAddNode",value:function(t){var e=this,i={id:s.randomUUID(),x:t.pointer.canvas.x,y:t.pointer.canvas.y,label:"new"};if("function"==typeof this.options.addNode){if(2!==this.options.addNode.length)throw new Error("The function for add does not support two arguments (data,callback)");this.options.addNode(i,function(t){null!==t&&void 0!==t&&"addNode"===e.inMode&&(e.body.data.nodes.getDataSet().add(t),e.showManipulatorToolbar())})}else this.body.data.nodes.getDataSet().add(i),this.showManipulatorToolbar()}},{key:"_performAddEdge",value:function(t,e){var i=this,o={from:t,to:e};if("function"==typeof this.options.addEdge){if(2!==this.options.addEdge.length)throw new Error("The function for connect does not support two arguments (data,callback)");this.options.addEdge(o,function(t){null!==t&&void 0!==t&&"addEdge"===i.inMode&&(i.body.data.edges.getDataSet().add(t),i.selectionHandler.unselectAll(),i.showManipulatorToolbar())})}else this.body.data.edges.getDataSet().add(o),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}},{key:"_performEditEdge",value:function(t,e){var i=this,o={id:this.edgeBeingEditedId,from:t,to:e};if("function"==typeof this.options.editEdge){if(2!==this.options.editEdge.length)throw new Error("The function for edit does not support two arguments (data, callback)");this.options.editEdge(o,function(t){null===t||void 0===t||"editEdge"!==i.inMode?(i.body.edges[o.id].updateEdgeType(),i.body.emitter.emit("_redraw")):(i.body.data.edges.getDataSet().update(t),i.selectionHandler.unselectAll(),i.showManipulatorToolbar())})}else this.body.data.edges.getDataSet().update(o),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}]),t}();e.default=h},function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i="string",o="boolean",n="number",s="array",r="object",a="dom",h="any",d={configure:{enabled:{boolean:o},filter:{boolean:o,string:i,array:s,function:"function"},container:{dom:a},showButton:{boolean:o},__type__:{object:r,boolean:o,string:i,array:s,function:"function"}},edges:{arrows:{to:{enabled:{boolean:o},scaleFactor:{number:n},type:{string:["arrow","circle"]},__type__:{object:r,boolean:o}},middle:{enabled:{boolean:o},scaleFactor:{number:n},type:{string:["arrow","circle"]},__type__:{object:r,boolean:o}},from:{enabled:{boolean:o},scaleFactor:{number:n},type:{string:["arrow","circle"]},__type__:{object:r,boolean:o}},__type__:{string:["from","to","middle"],object:r}},arrowStrikethrough:{boolean:o},color:{color:{string:i},highlight:{string:i},hover:{string:i},inherit:{string:["from","to","both"],boolean:o},opacity:{number:n},__type__:{object:r,string:i}},dashes:{boolean:o,array:s},font:{color:{string:i},size:{number:n},face:{string:i},background:{string:i},strokeWidth:{number:n},strokeColor:{string:i},align:{string:["horizontal","top","middle","bottom"]},__type__:{object:r,string:i}},hidden:{boolean:o},hoverWidth:{function:"function",number:n},label:{string:i,undefined:"undefined"},labelHighlightBold:{boolean:o},length:{number:n,undefined:"undefined"},physics:{boolean:o},scaling:{min:{number:n},max:{number:n},label:{enabled:{boolean:o},min:{number:n},max:{number:n},maxVisible:{number:n},drawThreshold:{number:n},__type__:{object:r,boolean:o}},customScalingFunction:{function:"function"},__type__:{object:r}},selectionWidth:{function:"function",number:n},selfReferenceSize:{number:n},shadow:{enabled:{boolean:o},color:{string:i},size:{number:n},x:{number:n},y:{number:n},__type__:{object:r,boolean:o}},smooth:{enabled:{boolean:o},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:n},forceDirection:{string:["horizontal","vertical","none"],boolean:o},__type__:{object:r,boolean:o}},title:{string:i,undefined:"undefined"},width:{number:n},value:{number:n,undefined:"undefined"},__type__:{object:r}},groups:{useDefaultGroups:{boolean:o},__any__:"get from nodes, will be overwritten below", -__type__:{object:r}},interaction:{dragNodes:{boolean:o},dragView:{boolean:o},hideEdgesOnDrag:{boolean:o},hideNodesOnDrag:{boolean:o},hover:{boolean:o},keyboard:{enabled:{boolean:o},speed:{x:{number:n},y:{number:n},zoom:{number:n},__type__:{object:r}},bindToWindow:{boolean:o},__type__:{object:r,boolean:o}},multiselect:{boolean:o},navigationButtons:{boolean:o},selectable:{boolean:o},selectConnectedEdges:{boolean:o},hoverConnectedEdges:{boolean:o},tooltipDelay:{number:n},zoomView:{boolean:o},__type__:{object:r}},layout:{randomSeed:{undefined:"undefined",number:n},improvedLayout:{boolean:o},hierarchical:{enabled:{boolean:o},levelSeparation:{number:n},nodeSpacing:{number:n},treeSpacing:{number:n},blockShifting:{boolean:o},edgeMinimization:{boolean:o},parentCentralization:{boolean:o},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},__type__:{object:r,boolean:o}},__type__:{object:r}},manipulation:{enabled:{boolean:o},initiallyActive:{boolean:o},addNode:{boolean:o,function:"function"},addEdge:{boolean:o,function:"function"},editNode:{function:"function"},editEdge:{boolean:o,function:"function"},deleteNode:{boolean:o,function:"function"},deleteEdge:{boolean:o,function:"function"},controlNodeStyle:"get from nodes, will be overwritten below",__type__:{object:r,boolean:o}},nodes:{borderWidth:{number:n},borderWidthSelected:{number:n,undefined:"undefined"},brokenImage:{string:i,undefined:"undefined"},color:{border:{string:i},background:{string:i},highlight:{border:{string:i},background:{string:i},__type__:{object:r,string:i}},hover:{border:{string:i},background:{string:i},__type__:{object:r,string:i}},__type__:{object:r,string:i}},fixed:{x:{boolean:o},y:{boolean:o},__type__:{object:r,boolean:o}},font:{align:{string:i},color:{string:i},size:{number:n},face:{string:i},background:{string:i},strokeWidth:{number:n},strokeColor:{string:i},__type__:{object:r,string:i}},group:{string:i,number:n,undefined:"undefined"},hidden:{boolean:o},icon:{face:{string:i},code:{string:i},size:{number:n},color:{string:i},__type__:{object:r}},id:{string:i,number:n},image:{string:i,undefined:"undefined"},label:{string:i,undefined:"undefined"},labelHighlightBold:{boolean:o},level:{number:n,undefined:"undefined"},mass:{number:n},physics:{boolean:o},scaling:{min:{number:n},max:{number:n},label:{enabled:{boolean:o},min:{number:n},max:{number:n},maxVisible:{number:n},drawThreshold:{number:n},__type__:{object:r,boolean:o}},customScalingFunction:{function:"function"},__type__:{object:r}},shadow:{enabled:{boolean:o},color:{string:i},size:{number:n},x:{number:n},y:{number:n},__type__:{object:r,boolean:o}},shape:{string:["ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon"]},shapeProperties:{borderDashes:{boolean:o,array:s},borderRadius:{number:n},interpolation:{boolean:o},useImageSize:{boolean:o},useBorderWithImage:{boolean:o},__type__:{object:r}},size:{number:n},title:{string:i,undefined:"undefined"},value:{number:n,undefined:"undefined"},x:{number:n},y:{number:n},__type__:{object:r}},physics:{enabled:{boolean:o},barnesHut:{gravitationalConstant:{number:n},centralGravity:{number:n},springLength:{number:n},springConstant:{number:n},damping:{number:n},avoidOverlap:{number:n},__type__:{object:r}},forceAtlas2Based:{gravitationalConstant:{number:n},centralGravity:{number:n},springLength:{number:n},springConstant:{number:n},damping:{number:n},avoidOverlap:{number:n},__type__:{object:r}},repulsion:{centralGravity:{number:n},springLength:{number:n},springConstant:{number:n},nodeDistance:{number:n},damping:{number:n},__type__:{object:r}},hierarchicalRepulsion:{centralGravity:{number:n},springLength:{number:n},springConstant:{number:n},nodeDistance:{number:n},damping:{number:n},__type__:{object:r}},maxVelocity:{number:n},minVelocity:{number:n},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:o},iterations:{number:n},updateInterval:{number:n},onlyDynamicEdges:{boolean:o},fit:{boolean:o},__type__:{object:r,boolean:o}},timestep:{number:n},adaptiveTimestep:{boolean:o},__type__:{object:r,boolean:o}},autoResize:{boolean:o},clickToUse:{boolean:o},locale:{string:i},locales:{__any__:{any:h},__type__:{object:r}},height:{string:i},width:{string:i},__type__:{object:r}};d.groups.__any__=d.nodes,d.manipulation.controlNodeStyle=d.nodes;var l={nodes:{borderWidth:[1,0,10,1],borderWidthSelected:[2,0,10,1],color:{border:["color","#2B7CE9"],background:["color","#97C2FC"],highlight:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]},hover:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]}},fixed:{x:!1,y:!1},font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[0,0,50,1],strokeColor:["color","#ffffff"]},hidden:!1,labelHighlightBold:!0,physics:!0,scaling:{min:[10,0,200,1],max:[30,0,200,1],label:{enabled:!1,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},shape:["ellipse","box","circle","database","diamond","dot","square","star","text","triangle","triangleDown"],shapeProperties:{borderDashes:!1,borderRadius:[6,0,20,1],interpolation:!0,useImageSize:!1},size:[25,0,200,1]},edges:{arrows:{to:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},middle:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},from:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"}},arrowStrikethrough:!0,color:{color:["color","#848484"],highlight:["color","#848484"],hover:["color","#848484"],inherit:["from","to","both",!0,!1],opacity:[1,0,1,.05]},dashes:!1,font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[2,0,50,1],strokeColor:["color","#ffffff"],align:["horizontal","top","middle","bottom"]},hidden:!1,hoverWidth:[1.5,0,5,.1],labelHighlightBold:!0,physics:!0,scaling:{min:[1,0,100,1],max:[15,0,100,1],label:{enabled:!0,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},selectionWidth:[1.5,0,5,.1],selfReferenceSize:[20,0,200,1],shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},smooth:{enabled:!0,type:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"],forceDirection:["horizontal","vertical","none"],roundness:[.5,0,1,.05]},width:[1,0,30,1]},layout:{hierarchical:{enabled:!1,levelSeparation:[150,20,500,5],nodeSpacing:[100,20,500,5],treeSpacing:[200,20,500,5],blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:["UD","DU","LR","RL"],sortMethod:["hubsize","directed"]}},interaction:{dragNodes:!0,dragView:!0,hideEdgesOnDrag:!1,hideNodesOnDrag:!1,hover:!1,keyboard:{enabled:!1,speed:{x:[10,0,40,1],y:[10,0,40,1],zoom:[.02,0,.1,.005]},bindToWindow:!0},multiselect:!1,navigationButtons:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0,tooltipDelay:[300,0,1e3,25],zoomView:!0},manipulation:{enabled:!1,initiallyActive:!1},physics:{enabled:!0,barnesHut:{gravitationalConstant:[-2e3,-3e4,0,50],centralGravity:[.3,0,10,.05],springLength:[95,0,500,5],springConstant:[.04,0,1.2,.005],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},forceAtlas2Based:{gravitationalConstant:[-50,-500,0,1],centralGravity:[.01,0,1,.005],springLength:[95,0,500,5],springConstant:[.08,0,1.2,.005],damping:[.4,0,1,.01],avoidOverlap:[0,0,1,.01]},repulsion:{centralGravity:[.2,0,10,.05],springLength:[200,0,500,5],springConstant:[.05,0,1.2,.005],nodeDistance:[100,0,500,5],damping:[.09,0,1,.01]},hierarchicalRepulsion:{centralGravity:[.2,0,10,.05],springLength:[100,0,500,5],springConstant:[.01,0,1.2,.005],nodeDistance:[120,0,500,5],damping:[.09,0,1,.01]},maxVelocity:[50,0,150,1],minVelocity:[.1,.01,.5,.01],solver:["barnesHut","forceAtlas2Based","repulsion","hierarchicalRepulsion"],timestep:[.5,.01,1,.01]}};e.allOptions=d,e.configureOptions=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){var i=[],o=!0,n=!1,s=void 0;try{for(var r,a=t[Symbol.iterator]();!(o=(r=a.next()).done)&&(i.push(r.value),!e||i.length!==e);o=!0);}catch(t){n=!0,s=t}finally{try{!o&&a.return&&a.return()}finally{if(n)throw s}}return i}return function(e,i){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=function(){function t(t,e){for(var i=0;i2&&void 0!==arguments[2]&&arguments[2],o=this.distanceSolver.getDistances(this.body,t,e);this._createL_matrix(o),this._createK_matrix(o);for(var n=.01,r=1,a=0,h=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),d=5,l=1e9,c=0,u=0,p=0,f=0,m=0;l>n&&ar&&m=.1;)p=n[l++%s],p>d&&(p=d),u=Math.sqrt(p*p/(1+h*h)),u=r<0?-u:u,t+=u,e+=h*u,c===!0?this.lineTo(t,e):this.moveTo(t,e),d-=p,c=!c})},function(t,e){function i(t){return P=t,p()}function o(){I=0,N=P.charAt(0)}function n(){I++,N=P.charAt(I)}function s(){return P.charAt(I+1)}function r(t){return z.test(t)}function a(t,e){if(t||(t={}),e)for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}function h(t,e,i){for(var o=e.split("."),n=t;o.length;){var s=o.shift();o.length?(n[s]||(n[s]={}),n=n[s]):n[s]=i}}function d(t,e){for(var i,o,n=null,s=[t],r=t;r.parent;)s.push(r.parent),r=r.parent;if(r.nodes)for(i=0,o=r.nodes.length;i=0;i--){var h=s[i];h.nodes||(h.nodes=[]),h.nodes.indexOf(n)===-1&&h.nodes.push(n)}e.attr&&(n.attr=a(n.attr,e.attr))}function l(t,e){if(t.edges||(t.edges=[]),t.edges.push(e),t.edge){var i=a({},t.edge);e.attr=a(i,e.attr)}}function c(t,e,i,o,n){var s={from:e,to:i,type:o};return t.edge&&(s.attr=a({},t.edge)),s.attr=a(s.attr||{},n),s}function u(){for(L=E.NULL,R="";" "===N||"\t"===N||"\n"===N||"\r"===N;)n();do{var t=!1;if("#"===N){for(var e=I-1;" "===P.charAt(e)||"\t"===P.charAt(e);)e--;if("\n"===P.charAt(e)||""===P.charAt(e)){for(;""!=N&&"\n"!=N;)n();t=!0}}if("/"===N&&"/"===s()){for(;""!=N&&"\n"!=N;)n();t=!0}if("/"===N&&"*"===s()){for(;""!=N;){if("*"===N&&"/"===s()){n(),n();break}n()}t=!0}for(;" "===N||"\t"===N||"\n"===N||"\r"===N;)n()}while(t);if(""===N)return void(L=E.DELIMITER);var i=N+s();if(M[i])return L=E.DELIMITER,R=i,n(),void n();if(M[N])return L=E.DELIMITER,R=N,void n();if(r(N)||"-"===N){for(R+=N,n();r(N);)R+=N,n();return"false"===R?R=!1:"true"===R?R=!0:isNaN(Number(R))||(R=Number(R)),void(L=E.IDENTIFIER)}if('"'===N){for(n();""!=N&&('"'!=N||'"'===N&&'"'===s());)R+=N,'"'===N&&n(),n();if('"'!=N)throw w('End of string " expected');return n(),void(L=E.IDENTIFIER)}for(L=E.UNKNOWN;""!=N;)R+=N,n();throw new SyntaxError('Syntax error in part "'+x(R,30)+'"')}function p(){var t={};if(o(),u(),"strict"===R&&(t.strict=!0,u()),"graph"!==R&&"digraph"!==R||(t.type=R,u()),L===E.IDENTIFIER&&(t.id=R,u()),"{"!=R)throw w("Angle bracket { expected");if(u(),f(t),"}"!=R)throw w("Angle bracket } expected");if(u(),""!==R)throw w("End of file expected");return u(),delete t.node,delete t.edge,delete t.graph,t}function f(t){for(;""!==R&&"}"!=R;)m(t),";"===R&&u()}function m(t){var e=v(t);if(e)return void b(t,e);var i=g(t);if(!i){if(L!=E.IDENTIFIER)throw w("Identifier expected");var o=R;if(u(),"="===R){if(u(),L!=E.IDENTIFIER)throw w("Identifier expected");t[o]=R,u()}else y(t,o)}}function v(t){var e=null;if("subgraph"===R&&(e={},e.type="subgraph",u(),L===E.IDENTIFIER&&(e.id=R,u())),"{"===R){if(u(),e||(e={}),e.parent=t,e.node=t.node,e.edge=t.edge,e.graph=t.graph,f(e),"}"!=R)throw w("Angle bracket } expected");u(),delete e.node,delete e.edge,delete e.graph,delete e.parent,t.subgraphs||(t.subgraphs=[]),t.subgraphs.push(e)}return e}function g(t){return"node"===R?(u(),t.node=_(),"node"):"edge"===R?(u(),t.edge=_(),"edge"):"graph"===R?(u(),t.graph=_(),"graph"):null}function y(t,e){var i={id:e},o=_();o&&(i.attr=o),d(t,i),b(t,e)}function b(t,e){for(;"->"===R||"--"===R;){var i,o=R;u();var n=v(t);if(n)i=n;else{if(L!=E.IDENTIFIER)throw w("Identifier or subgraph expected");i=R,d(t,{id:i}),u()}var s=_(),r=c(t,e,i,o,s);l(t,r),e=i}}function _(){for(var t=null;"["===R;){for(u(),t={};""!==R&&"]"!=R;){if(L!=E.IDENTIFIER)throw w("Attribute name expected");var e=R;if(u(),"="!=R)throw w("Equal sign = expected");if(u(),L!=E.IDENTIFIER)throw w("Attribute value expected");var i=R;h(t,e,i),u(),","==R&&u()}if("]"!=R)throw w("Bracket ] expected");u()}return t}function w(t){return new SyntaxError(t+', got "'+x(R,30)+'" (char '+I+")")}function x(t,e){return t.length<=e?t:t.substr(0,27)+"..."}function k(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)}function O(t,e,i){for(var o=e.split("."),n=o.pop(),s=t,r=0;r":!0,"--":!0},P="",I=0,N="",R="",L=E.NULL,z=/[a-zA-Z_0-9.:#]/;e.parseDOT=i,e.DOTToGraph=S},function(t,e){function i(t,e){var i=[],o=[],n={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};void 0!==e&&(void 0!==e.fixed&&(n.nodes.fixed=e.fixed),void 0!==e.parseColor&&(n.nodes.parseColor=e.parseColor),void 0!==e.inheritColor&&(n.edges.inheritColor=e.inheritColor));for(var s=t.edges,r=t.nodes,a=0;a2&&void 0!==arguments[2]&&arguments[2];for(var n in t)void 0!==i[n]&&("object"!==(0,u.default)(i[n])?void 0!==i[n]&&null!==i[n]||void 0===t[n]||o!==!0?t[n]=i[n]:delete t[n]:"object"===(0,u.default)(t[n])&&e.fillIfDefined(t[n],i[n],o))},e.protoExtend=function(t,e){for(var i=1;i3&&void 0!==arguments[3]&&arguments[3];if(Array.isArray(o))throw new TypeError("Arrays are not supported by deepExtend");for(var s=2;s3&&void 0!==arguments[3]&&arguments[3];if(Array.isArray(o))throw new TypeError("Arrays are not supported by deepExtend");for(var s in o)if(o.hasOwnProperty(s)&&t.indexOf(s)==-1)if(o[s]&&o[s].constructor===Object)void 0===i[s]&&(i[s]={}),i[s].constructor===Object?e.deepExtend(i[s],o[s]):null===o[s]&&void 0!==i[s]&&n===!0?delete i[s]:i[s]=o[s];else if(Array.isArray(o[s])){i[s]=[];for(var r=0;r=0&&(e="DOMMouseScroll"),t.addEventListener(e,i,o)):t.attachEvent("on"+e,i)},e.removeEventListener=function(t,e,i,o){t.removeEventListener?(void 0===o&&(o=!1),"mousewheel"===e&&navigator.userAgent.indexOf("Firefox")>=0&&(e="DOMMouseScroll"),t.removeEventListener(e,i,o)):t.detachEvent("on"+e,i)},e.preventDefault=function(t){t||(t=window.event),t.preventDefault?t.preventDefault():t.returnValue=!1},e.getTarget=function(t){t||(t=window.event);var e;return t.target?e=t.target:t.srcElement&&(e=t.srcElement),void 0!=e.nodeType&&3==e.nodeType&&(e=e.parentNode),e},e.hasParent=function(t,e){for(var i=t;i;){if(i===e)return!0;i=i.parentNode}return!1},e.option={},e.option.asBoolean=function(t,e){return"function"==typeof t&&(t=t()),null!=t?0!=t:e||null},e.option.asNumber=function(t,e){return"function"==typeof t&&(t=t()),null!=t?Number(t)||e||null:e||null},e.option.asString=function(t,e){return"function"==typeof t&&(t=t()),null!=t?String(t):e||null},e.option.asSize=function(t,i){return"function"==typeof t&&(t=t()),e.isString(t)?t:e.isNumber(t)?t+"px":i||null},e.option.asElement=function(t,e){return"function"==typeof t&&(t=t()),t||e||null},e.hexToRGB=function(t){var e=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;t=t.replace(e,function(t,e,i,o){return e+e+i+i+o+o});var i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return i?{r:parseInt(i[1],16),g:parseInt(i[2],16),b:parseInt(i[3],16)}:null},e.overrideOpacity=function(t,i){if(t.indexOf("rgba")!=-1)return t;if(t.indexOf("rgb")!=-1){var o=t.substr(t.indexOf("(")+1).replace(")","").split(",");return"rgba("+o[0]+","+o[1]+","+o[2]+","+i+")"}var o=e.hexToRGB(t);return null==o?t:"rgba("+o.r+","+o.g+","+o.b+","+i+")"},e.RGBToHex=function(t,e,i){return"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1)},e.parseColor=function(t){var i;if(e.isString(t)===!0){if(e.isValidRGB(t)===!0){var o=t.substr(4).substr(0,t.length-5).split(",").map(function(t){return parseInt(t)});t=e.RGBToHex(o[0],o[1],o[2])}if(e.isValidHex(t)===!0){var n=e.hexToHSV(t),s={h:n.h,s:.8*n.s,v:Math.min(1,1.02*n.v)},r={h:n.h,s:Math.min(1,1.25*n.s),v:.8*n.v},a=e.HSVToHex(r.h,r.s,r.v),h=e.HSVToHex(s.h,s.s,s.v);i={background:t,border:a,highlight:{background:h,border:a},hover:{background:h,border:a}}}else i={background:t,border:t,highlight:{background:t,border:t},hover:{background:t,border:t}}}else i={},i.background=t.background||void 0,i.border=t.border||void 0,e.isString(t.highlight)?i.highlight={border:t.highlight,background:t.highlight}:(i.highlight={},i.highlight.background=t.highlight&&t.highlight.background||void 0,i.highlight.border=t.highlight&&t.highlight.border||void 0),e.isString(t.hover)?i.hover={border:t.hover,background:t.hover}:(i.hover={},i.hover.background=t.hover&&t.hover.background||void 0,i.hover.border=t.hover&&t.hover.border||void 0);return i},e.RGBToHSV=function(t,e,i){t/=255,e/=255,i/=255;var o=Math.min(t,Math.min(e,i)),n=Math.max(t,Math.max(e,i));if(o==n)return{h:0,s:0,v:o};var s=t==o?e-i:i==o?t-e:i-t,r=t==o?3:i==o?1:5,a=60*(r-s/(n-o))/360,h=(n-o)/n,d=n;return{h:a,s:h,v:d}};var g={split:function(t){var e={};return t.split(";").forEach(function(t){if(""!=t.trim()){var i=t.split(":"),o=i[0].trim(),n=i[1].trim();e[o]=n}}),e},join:function(t){return(0,d.default)(t).map(function(e){return e+": "+t[e]}).join("; ")}};e.addCssText=function(t,i){var o=g.split(t.style.cssText),n=g.split(i),s=e.extend(o,n);t.style.cssText=g.join(s)},e.removeCssText=function(t,e){var i=g.split(t.style.cssText),o=g.split(e);for(var n in o)o.hasOwnProperty(n)&&delete i[n];t.style.cssText=g.join(i)},e.HSVToRGB=function(t,e,i){var o,n,s,r=Math.floor(6*t),a=6*t-r,h=i*(1-e),d=i*(1-a*e),l=i*(1-(1-a)*e);switch(r%6){case 0:o=i,n=l,s=h;break;case 1:o=d,n=i,s=h;break;case 2:o=h,n=i,s=l;break;case 3:o=h,n=d,s=i;break;case 4:o=l,n=h,s=i;break;case 5:o=i,n=h,s=d}return{r:Math.floor(255*o),g:Math.floor(255*n),b:Math.floor(255*s)}},e.HSVToHex=function(t,i,o){var n=e.HSVToRGB(t,i,o);return e.RGBToHex(n.r,n.g,n.b)},e.hexToHSV=function(t){var i=e.hexToRGB(t);return e.RGBToHSV(i.r,i.g,i.b)},e.isValidHex=function(t){var e=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t);return e},e.isValidRGB=function(t){t=t.replace(" ","");var e=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/i.test(t);return e},e.isValidRGBA=function(t){t=t.replace(" ","");var e=/rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(.{1,3})\)/i.test(t);return e},e.selectiveBridgeObject=function(t,i){if("object"==("undefined"==typeof i?"undefined":(0,u.default)(i))){for(var o=(0,a.default)(i),n=0;n0&&e(o,t[n-1])<0;n--)t[n]=t[n-1];t[n]=o}return t},e.mergeOptions=function(t,e,i){var o=(arguments.length>3&&void 0!==arguments[3]&&arguments[3],arguments.length>4&&void 0!==arguments[4]?arguments[4]:{});if(null===e[i])t[i]=(0,a.default)(o[i]);else if(void 0!==e[i])if("boolean"==typeof e[i])t[i].enabled=e[i];else{void 0===e[i].enabled&&(t[i].enabled=!0);for(var n in e[i])e[i].hasOwnProperty(n)&&(t[i][n]=e[i][n])}},e.binarySearchCustom=function(t,e,i,o){for(var n=1e4,s=0,r=0,a=t.length-1;r<=a&&s0)return"before"==o?Math.max(0,h-1):h;if(n(r,e)<0&&n(a,e)>0)return"before"==o?h:Math.min(t.length-1,h+1);n(r,e)<0?u=h+1:c=h-1,l++}return-1},e.easingFunctions={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return t*(2-t)},easeInOutQuad:function(t){return t<.5?2*t*t:-1+(4-2*t)*t},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return--t*t*t+1},easeInOutCubic:function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return 1- --t*t*t*t},easeInOutQuart:function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return 1+--t*t*t*t*t},easeInOutQuint:function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t}},e.getScrollBarWidth=function(){var t=document.createElement("p");t.style.width="100%",t.style.height="200px";var e=document.createElement("div");e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.visibility="hidden",e.style.width="200px",e.style.height="150px",e.style.overflow="hidden",e.appendChild(t),document.body.appendChild(e);var i=t.offsetWidth;e.style.overflow="scroll";var o=t.offsetWidth;return i==o&&(o=e.clientWidth),document.body.removeChild(e),i-o},e.topMost=function(t,e){var i=void 0;Array.isArray(e)||(e=[e]);var o=!0,n=!1,r=void 0;try{for(var a,h=(0,s.default)(t);!(o=(a=h.next()).done);o=!0){var d=a.value;if(d){i=d[e[0]];for(var l=1;l=t.length?(this._t=void 0,n(1)):"keys"==e?n(0,i):"values"==e?n(0,t[i]):n(0,[i,t[i]])},"values"),s.Arguments=s.Array,o("keys"),o("values"),o("entries")},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e){t.exports={}},function(t,e,i){var o=i(10),n=i(12);t.exports=function(t){return o(n(t))}},function(t,e,i){var o=i(11);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==o(t)?t.split(""):Object(t)}},function(t,e){var i={}.toString;t.exports=function(t){return i.call(t).slice(8,-1)}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,i){var o=i(14),n=i(15),s=i(30),r=i(20),a=i(31),h=i(8),d=i(32),l=i(46),u=i(48),c=i(47)("iterator"),p=!([].keys&&"next"in[].keys()),f="@@iterator",m="keys",v="values",g=function(){return this};t.exports=function(t,e,i,y,b,_,w){d(i,e,y);var x,k,O,D=function(t){if(!p&&t in T)return T[t];switch(t){case m:return function(){return new i(this,t)};case v:return function(){return new i(this,t)}}return function(){return new i(this,t)}},S=e+" Iterator",M=b==v,C=!1,T=t.prototype,E=T[c]||T[f]||b&&T[b],P=E||D(b),I=b?M?D("entries"):P:void 0,N="Array"==e?T.entries||E:E;if(N&&(O=u(N.call(new t)),O!==Object.prototype&&(l(O,S,!0),o||a(O,c)||r(O,c,g))),M&&E&&E.name!==v&&(C=!0,P=function(){return E.call(this)}),o&&!w||!p&&!C&&T[c]||r(T,c,P),h[e]=P,h[S]=g,b)if(x={values:M?P:D(v),keys:_?P:D(m),entries:I},w)for(k in x)k in T||s(T,k,x[k]);else n(n.P+n.F*(p||C),e,x);return x}},function(t,e){t.exports=!0},function(t,e,i){var o=i(16),n=i(17),s=i(18),r=i(20),a="prototype",h=function(t,e,i){var d,l,u,c=t&h.F,p=t&h.G,f=t&h.S,m=t&h.P,v=t&h.B,g=t&h.W,y=p?n:n[e]||(n[e]={}),b=y[a],_=p?o:f?o[e]:(o[e]||{})[a];p&&(i=e);for(d in i)l=!c&&_&&void 0!==_[d],l&&d in y||(u=l?_[d]:i[d],y[d]=p&&"function"!=typeof _[d]?i[d]:v&&l?s(u,o):g&&_[d]==u?function(t){var e=function(e,i,o){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,i)}return new t(e,i,o)}return t.apply(this,arguments)};return e[a]=t[a],e}(u):m&&"function"==typeof u?s(Function.call,u):u,m&&((y.virtual||(y.virtual={}))[d]=u,t&h.R&&b&&!b[d]&&r(b,d,u)))};h.F=1,h.G=2,h.S=4,h.P=8,h.B=16,h.W=32,h.U=64,h.R=128,t.exports=h},function(t,e){var i=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},function(t,e){var i=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=i)},function(t,e,i){var o=i(19);t.exports=function(t,e,i){if(o(t),void 0===e)return t;switch(i){case 1:return function(i){return t.call(e,i)};case 2:return function(i,o){return t.call(e,i,o)};case 3:return function(i,o,n){return t.call(e,i,o,n)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,i){var o=i(21),n=i(29);t.exports=i(25)?function(t,e,i){return o.f(t,e,n(1,i))}:function(t,e,i){return t[e]=i,t}},function(t,e,i){var o=i(22),n=i(24),s=i(28),r=Object.defineProperty;e.f=i(25)?Object.defineProperty:function(t,e,i){if(o(t),e=s(e,!0),o(i),n)try{return r(t,e,i)}catch(t){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(t[e]=i.value),t}},function(t,e,i){var o=i(23);t.exports=function(t){if(!o(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,i){t.exports=!i(25)&&!i(26)(function(){return 7!=Object.defineProperty(i(27)("div"),"a",{get:function(){return 7}}).a})},function(t,e,i){t.exports=!i(26)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,i){var o=i(23),n=i(16).document,s=o(n)&&o(n.createElement);t.exports=function(t){return s?n.createElement(t):{}}},function(t,e,i){var o=i(23);t.exports=function(t,e){if(!o(t))return t;var i,n;if(e&&"function"==typeof(i=t.toString)&&!o(n=i.call(t)))return n;if("function"==typeof(i=t.valueOf)&&!o(n=i.call(t)))return n;if(!e&&"function"==typeof(i=t.toString)&&!o(n=i.call(t)))return n;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,i){t.exports=i(20)},function(t,e){var i={}.hasOwnProperty;t.exports=function(t,e){return i.call(t,e)}},function(t,e,i){var o=i(33),n=i(29),s=i(46),r={};i(20)(r,i(47)("iterator"),function(){return this}),t.exports=function(t,e,i){t.prototype=o(r,{next:n(1,i)}),s(t,e+" Iterator")}},function(t,e,i){var o=i(22),n=i(34),s=i(44),r=i(41)("IE_PROTO"),a=function(){},h="prototype",d=function(){var t,e=i(27)("iframe"),o=s.length,n="<",r=">";for(e.style.display="none",i(45).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(n+"script"+r+"document.F=Object"+n+"/script"+r),t.close(),d=t.F;o--;)delete d[h][s[o]];return d()};t.exports=Object.create||function(t,e){var i;return null!==t?(a[h]=o(t),i=new a,a[h]=null,i[r]=t):i=d(),void 0===e?i:n(i,e)}},function(t,e,i){var o=i(21),n=i(22),s=i(35);t.exports=i(25)?Object.defineProperties:function(t,e){n(t);for(var i,r=s(e),a=r.length,h=0;a>h;)o.f(t,i=r[h++],e[i]);return t}},function(t,e,i){var o=i(36),n=i(44);t.exports=Object.keys||function(t){return o(t,n)}},function(t,e,i){var o=i(31),n=i(9),s=i(37)(!1),r=i(41)("IE_PROTO");t.exports=function(t,e){var i,a=n(t),h=0,d=[];for(i in a)i!=r&&o(a,i)&&d.push(i);for(;e.length>h;)o(a,i=e[h++])&&(~s(d,i)||d.push(i));return d}},function(t,e,i){var o=i(9),n=i(38),s=i(40);t.exports=function(t){return function(e,i,r){var a,h=o(e),d=n(h.length),l=s(r,d);if(t&&i!=i){for(;d>l;)if(a=h[l++],a!=a)return!0}else for(;d>l;l++)if((t||l in h)&&h[l]===i)return t||l||0;return!t&&-1}}},function(t,e,i){var o=i(39),n=Math.min;t.exports=function(t){return t>0?n(o(t),9007199254740991):0}},function(t,e){var i=Math.ceil,o=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?o:i)(t)}},function(t,e,i){var o=i(39),n=Math.max,s=Math.min;t.exports=function(t,e){return t=o(t),t<0?n(t+e,0):s(t,e)}},function(t,e,i){var o=i(42)("keys"),n=i(43);t.exports=function(t){return o[t]||(o[t]=n(t))}},function(t,e,i){var o=i(16),n="__core-js_shared__",s=o[n]||(o[n]={});t.exports=function(t){return s[t]||(s[t]={})}},function(t,e){var i=0,o=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++i+o).toString(36))}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,i){t.exports=i(16).document&&document.documentElement},function(t,e,i){var o=i(21).f,n=i(31),s=i(47)("toStringTag");t.exports=function(t,e,i){t&&!n(t=i?t:t.prototype,s)&&o(t,s,{configurable:!0,value:e})}},function(t,e,i){var o=i(42)("wks"),n=i(43),s=i(16).Symbol,r="function"==typeof s,a=t.exports=function(t){return o[t]||(o[t]=r&&s[t]||(r?s:n)("Symbol."+t))};a.store=o},function(t,e,i){var o=i(31),n=i(49),s=i(41)("IE_PROTO"),r=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=n(t),o(t,s)?t[s]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?r:null}},function(t,e,i){var o=i(12);t.exports=function(t){return Object(o(t))}},function(t,e,i){var o=i(51)(!0);i(13)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,i=this._i;return i>=e.length?{value:void 0,done:!0}:(t=o(e,i),this._i+=t.length,{value:t,done:!1})})},function(t,e,i){var o=i(39),n=i(12);t.exports=function(t){return function(e,i){var s,r,a=String(n(e)),h=o(i),d=a.length;return h<0||h>=d?t?"":void 0:(s=a.charCodeAt(h),s<55296||s>56319||h+1===d||(r=a.charCodeAt(h+1))<56320||r>57343?t?a.charAt(h):s:t?a.slice(h,h+2):(s-55296<<10)+(r-56320)+65536)}}},function(t,e,i){var o=i(22),n=i(53);t.exports=i(17).getIterator=function(t){var e=n(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return o(e.call(t))}},function(t,e,i){var o=i(54),n=i(47)("iterator"),s=i(8);t.exports=i(17).getIteratorMethod=function(t){if(void 0!=t)return t[n]||t["@@iterator"]||s[o(t)]}},function(t,e,i){var o=i(11),n=i(47)("toStringTag"),s="Arguments"==o(function(){return arguments}()),r=function(t,e){try{return t[e]}catch(t){}};t.exports=function(t){var e,i,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=r(e=Object(t),n))?i:s?o(e):"Object"==(a=o(e))&&"function"==typeof e.callee?"Arguments":a}},function(t,e,i){t.exports={default:i(56),__esModule:!0}},function(t,e,i){i(57);var o=i(17).Object;t.exports=function(t,e){return o.create(t,e)}},function(t,e,i){var o=i(15);o(o.S,"Object",{create:i(33)})},function(t,e,i){t.exports={default:i(59),__esModule:!0}},function(t,e,i){i(60),t.exports=i(17).Object.keys},function(t,e,i){var o=i(49),n=i(35);i(61)("keys",function(){return function(t){return n(o(t))}})},function(t,e,i){var o=i(15),n=i(17),s=i(26);t.exports=function(t,e){var i=(n.Object||{})[t]||Object[t],r={};r[t]=e(i),o(o.S+o.F*s(function(){i(1)}),"Object",r)}},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var n=i(63),s=o(n),r=i(66),a=o(r),h="function"==typeof a.default&&"symbol"==typeof s.default?function(t){return typeof t}:function(t){return t&&"function"==typeof a.default&&t.constructor===a.default&&t!==a.default.prototype?"symbol":typeof t};e.default="function"==typeof a.default&&"symbol"===h(s.default)?function(t){return"undefined"==typeof t?"undefined":h(t)}:function(t){return t&&"function"==typeof a.default&&t.constructor===a.default&&t!==a.default.prototype?"symbol":"undefined"==typeof t?"undefined":h(t)}},function(t,e,i){t.exports={default:i(64),__esModule:!0}},function(t,e,i){i(50),i(4),t.exports=i(65).f("iterator")},function(t,e,i){e.f=i(47)},function(t,e,i){t.exports={default:i(67),__esModule:!0}},function(t,e,i){i(68),i(79),i(80),i(81),t.exports=i(17).Symbol},function(t,e,i){var o=i(16),n=i(31),s=i(25),r=i(15),a=i(30),h=i(69).KEY,d=i(26),l=i(42),u=i(46),c=i(43),p=i(47),f=i(65),m=i(70),v=i(71),g=i(72),y=i(75),b=i(22),_=i(9),w=i(28),x=i(29),k=i(33),O=i(76),D=i(78),S=i(21),M=i(35),C=D.f,T=S.f,E=O.f,P=o.Symbol,I=o.JSON,N=I&&I.stringify,z="prototype",R=p("_hidden"),L=p("toPrimitive"),A={}.propertyIsEnumerable,B=l("symbol-registry"),F=l("symbols"),H=l("op-symbols"),j=Object[z],W="function"==typeof P,Y=o.QObject,G=!Y||!Y[z]||!Y[z].findChild,V=s&&d(function(){return 7!=k(T({},"a",{get:function(){return T(this,"a",{value:7}).a}})).a})?function(t,e,i){var o=C(j,e);o&&delete j[e],T(t,e,i),o&&t!==j&&T(j,e,o)}:T,U=function(t){var e=F[t]=k(P[z]);return e._k=t,e},q=W&&"symbol"==typeof P.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof P},X=function(t,e,i){return t===j&&X(H,e,i),b(t),e=w(e,!0),b(i),n(F,e)?(i.enumerable?(n(t,R)&&t[R][e]&&(t[R][e]=!1),i=k(i,{enumerable:x(0,!1)})):(n(t,R)||T(t,R,x(1,{})),t[R][e]=!0),V(t,e,i)):T(t,e,i)},Z=function(t,e){b(t);for(var i,o=g(e=_(e)),n=0,s=o.length;s>n;)X(t,i=o[n++],e[i]);return t},K=function(t,e){return void 0===e?k(t):Z(k(t),e)},Q=function(t){var e=A.call(this,t=w(t,!0));return!(this===j&&n(F,t)&&!n(H,t))&&(!(e||!n(this,t)||!n(F,t)||n(this,R)&&this[R][t])||e)},J=function(t,e){if(t=_(t),e=w(e,!0),t!==j||!n(F,e)||n(H,e)){var i=C(t,e);return!i||!n(F,e)||n(t,R)&&t[R][e]||(i.enumerable=!0),i}},$=function(t){for(var e,i=E(_(t)),o=[],s=0;i.length>s;)n(F,e=i[s++])||e==R||e==h||o.push(e);return o},tt=function(t){for(var e,i=t===j,o=E(i?H:_(t)),s=[],r=0;o.length>r;)!n(F,e=o[r++])||i&&!n(j,e)||s.push(F[e]);return s};W||(P=function(){if(this instanceof P)throw TypeError("Symbol is not a constructor!");var t=c(arguments.length>0?arguments[0]:void 0),e=function(i){this===j&&e.call(H,i),n(this,R)&&n(this[R],t)&&(this[R][t]=!1),V(this,t,x(1,i))};return s&&G&&V(j,t,{configurable:!0,set:e}),U(t)},a(P[z],"toString",function(){return this._k}),D.f=J,S.f=X,i(77).f=O.f=$,i(74).f=Q,i(73).f=tt,s&&!i(14)&&a(j,"propertyIsEnumerable",Q,!0),f.f=function(t){return U(p(t))}),r(r.G+r.W+r.F*!W,{Symbol:P});for(var et="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),it=0;et.length>it;)p(et[it++]);for(var et=M(p.store),it=0;et.length>it;)m(et[it++]);r(r.S+r.F*!W,"Symbol",{for:function(t){return n(B,t+="")?B[t]:B[t]=P(t)},keyFor:function(t){if(q(t))return v(B,t);throw TypeError(t+" is not a symbol!")},useSetter:function(){G=!0},useSimple:function(){G=!1}}),r(r.S+r.F*!W,"Object",{create:K,defineProperty:X,defineProperties:Z,getOwnPropertyDescriptor:J,getOwnPropertyNames:$,getOwnPropertySymbols:tt}),I&&r(r.S+r.F*(!W||d(function(){var t=P();return"[null]"!=N([t])||"{}"!=N({a:t})||"{}"!=N(Object(t))})),"JSON",{stringify:function(t){if(void 0!==t&&!q(t)){for(var e,i,o=[t],n=1;arguments.length>n;)o.push(arguments[n++]);return e=o[1],"function"==typeof e&&(i=e),!i&&y(e)||(e=function(t,e){if(i&&(e=i.call(this,t,e)),!q(e))return e}),o[1]=e,N.apply(I,o)}}}),P[z][L]||i(20)(P[z],L,P[z].valueOf),u(P,"Symbol"),u(Math,"Math",!0),u(o.JSON,"JSON",!0)},function(t,e,i){var o=i(43)("meta"),n=i(23),s=i(31),r=i(21).f,a=0,h=Object.isExtensible||function(){return!0},d=!i(26)(function(){return h(Object.preventExtensions({}))}),l=function(t){r(t,o,{value:{i:"O"+ ++a,w:{}}})},u=function(t,e){if(!n(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!s(t,o)){if(!h(t))return"F";if(!e)return"E";l(t)}return t[o].i},c=function(t,e){if(!s(t,o)){if(!h(t))return!0;if(!e)return!1;l(t)}return t[o].w},p=function(t){return d&&f.NEED&&h(t)&&!s(t,o)&&l(t),t},f=t.exports={KEY:o,NEED:!1,fastKey:u,getWeak:c,onFreeze:p}},function(t,e,i){var o=i(16),n=i(17),s=i(14),r=i(65),a=i(21).f;t.exports=function(t){var e=n.Symbol||(n.Symbol=s?{}:o.Symbol||{});"_"==t.charAt(0)||t in e||a(e,t,{value:r.f(t)})}},function(t,e,i){var o=i(35),n=i(9);t.exports=function(t,e){for(var i,s=n(t),r=o(s),a=r.length,h=0;a>h;)if(s[i=r[h++]]===e)return i}},function(t,e,i){var o=i(35),n=i(73),s=i(74);t.exports=function(t){var e=o(t),i=n.f;if(i)for(var r,a=i(t),h=s.f,d=0;a.length>d;)h.call(t,r=a[d++])&&e.push(r);return e}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,i){var o=i(11);t.exports=Array.isArray||function(t){return"Array"==o(t)}},function(t,e,i){var o=i(9),n=i(77).f,s={}.toString,r="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(t){try{return n(t)}catch(t){return r.slice()}};t.exports.f=function(t){return r&&"[object Window]"==s.call(t)?a(t):n(o(t))}},function(t,e,i){var o=i(36),n=i(44).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return o(t,n)}},function(t,e,i){var o=i(74),n=i(29),s=i(9),r=i(28),a=i(31),h=i(24),d=Object.getOwnPropertyDescriptor;e.f=i(25)?d:function(t,e){if(t=s(t),e=r(e,!0),h)try{return d(t,e)}catch(t){}if(a(t,e))return n(!o.f.call(t,e),t[e])}},function(t,e){},function(t,e,i){i(70)("asyncIterator")},function(t,e,i){i(70)("observable")},function(t,e,i){t.exports={default:i(83),__esModule:!0}},function(t,e,i){var o=i(17),n=o.JSON||(o.JSON={stringify:JSON.stringify});t.exports=function(t){return n.stringify.apply(n,arguments)}},function(t,e,i){t.exports="undefined"!=typeof window&&window.moment||i(85)},function(t,e,i){(function(t){!function(e,i){t.exports=i()}(this,function(){function e(){return vo.apply(null,arguments)}function i(t){vo=t}function o(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function n(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function s(t){var e;for(e in t)return!1;return!0}function r(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function a(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function h(t,e){var i,o=[];for(i=0;i0)for(i in bo)o=bo[i],n=e[o],v(n)||(t[o]=n);return t}function y(t){g(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),_o===!1&&(_o=!0,e.updateOffset(this),_o=!1)}function b(t){return t instanceof y||null!=t&&null!=t._isAMomentObject}function _(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function w(t){var e=+t,i=0;return 0!==e&&isFinite(e)&&(i=_(e)),i}function x(t,e,i){var o,n=Math.min(t.length,e.length),s=Math.abs(t.length-e.length),r=0;for(o=0;o0?"future":"past"];return S(i)?i(e):i.replace(/%s/i,e)}function L(t,e){var i=t.toLowerCase();Po[i]=Po[i+"s"]=Po[e]=t}function A(t){return"string"==typeof t?Po[t]||Po[t.toLowerCase()]:void 0}function B(t){var e,i,o={};for(i in t)d(t,i)&&(e=A(i),e&&(o[e]=t[i]));return o}function F(t,e){Io[t]=e}function H(t){var e=[];for(var i in t)e.push({unit:i,priority:Io[i]});return e.sort(function(t,e){return t.priority-e.priority}),e}function j(t,i){return function(o){return null!=o?(Y(this,t,o),e.updateOffset(this,i),this):W(this,t)}}function W(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function Y(t,e,i){t.isValid()&&t._d["set"+(t._isUTC?"UTC":"")+e](i)}function G(t){return t=A(t),S(this[t])?this[t]():this}function V(t,e){if("object"==typeof t){t=B(t);for(var i=H(t),o=0;o=0;return(s?i?"+":"":"-")+Math.pow(10,Math.max(0,n)).toString().substr(1)+o}function q(t,e,i,o){var n=o;"string"==typeof o&&(n=function(){return this[o]()}),t&&(Lo[t]=n),e&&(Lo[e[0]]=function(){return U(n.apply(this,arguments),e[1],e[2])}),i&&(Lo[i]=function(){return this.localeData().ordinal(n.apply(this,arguments),t)})}function X(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function Z(t){var e,i,o=t.match(No);for(e=0,i=o.length;e=0&&zo.test(t);)t=t.replace(zo,i),zo.lastIndex=0,o-=1;return t}function J(t,e,i){tn[t]=S(e)?e:function(t,o){return t&&i?i:e}}function $(t,e){return d(tn,t)?tn[t](e._strict,e._locale):new RegExp(tt(t))}function tt(t){return et(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,i,o,n){return e||i||o||n}))}function et(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function it(t,e){var i,o=e;for("string"==typeof t&&(t=[t]),r(e)&&(o=function(t,i){i[e]=w(t)}),i=0;i=0&&isFinite(a.getFullYear())&&a.setFullYear(t),a}function _t(t){var e=new Date(Date.UTC.apply(null,arguments));return t<100&&t>=0&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function wt(t,e,i){var o=7+e-i,n=(7+_t(t,0,o).getUTCDay()-e)%7;return-n+o-1}function xt(t,e,i,o,n){var s,r,a=(7+i-o)%7,h=wt(t,o,n),d=1+7*(e-1)+a+h;return d<=0?(s=t-1,r=vt(s)+d):d>vt(t)?(s=t+1,r=d-vt(t)):(s=t,r=d),{year:s,dayOfYear:r}}function kt(t,e,i){var o,n,s=wt(t.year(),e,i),r=Math.floor((t.dayOfYear()-s-1)/7)+1;return r<1?(n=t.year()-1,o=r+Ot(n,e,i)):r>Ot(t.year(),e,i)?(o=r-Ot(t.year(),e,i),n=t.year()+1):(n=t.year(),o=r),{week:o,year:n}}function Ot(t,e,i){var o=wt(t,e,i),n=wt(t+1,e,i);return(vt(t)-o+n)/7}function Dt(t){return kt(t,this._week.dow,this._week.doy).week}function St(){return this._week.dow}function Mt(){return this._week.doy}function Ct(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function Tt(t){var e=kt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function Et(t,e){return"string"!=typeof t?t:isNaN(t)?(t=e.weekdaysParse(t),"number"==typeof t?t:null):parseInt(t,10)}function Pt(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function It(t,e){return t?o(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(e)?"format":"standalone"][t.day()]:this._weekdays}function Nt(t){return t?this._weekdaysShort[t.day()]:this._weekdaysShort}function zt(t){return t?this._weekdaysMin[t.day()]:this._weekdaysMin}function Rt(t,e,i){var o,n,s,r=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],o=0;o<7;++o)s=u([2e3,1]).day(o),this._minWeekdaysParse[o]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[o]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[o]=this.weekdays(s,"").toLocaleLowerCase();return i?"dddd"===e?(n=cn.call(this._weekdaysParse,r),n!==-1?n:null):"ddd"===e?(n=cn.call(this._shortWeekdaysParse,r),n!==-1?n:null):(n=cn.call(this._minWeekdaysParse,r),n!==-1?n:null):"dddd"===e?(n=cn.call(this._weekdaysParse,r),n!==-1?n:(n=cn.call(this._shortWeekdaysParse,r),n!==-1?n:(n=cn.call(this._minWeekdaysParse,r),n!==-1?n:null))):"ddd"===e?(n=cn.call(this._shortWeekdaysParse,r),n!==-1?n:(n=cn.call(this._weekdaysParse,r),n!==-1?n:(n=cn.call(this._minWeekdaysParse,r),n!==-1?n:null))):(n=cn.call(this._minWeekdaysParse,r),n!==-1?n:(n=cn.call(this._weekdaysParse,r),n!==-1?n:(n=cn.call(this._shortWeekdaysParse,r),n!==-1?n:null)))}function Lt(t,e,i){var o,n,s;if(this._weekdaysParseExact)return Rt.call(this,t,e,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),o=0;o<7;o++){if(n=u([2e3,1]).day(o),i&&!this._fullWeekdaysParse[o]&&(this._fullWeekdaysParse[o]=new RegExp("^"+this.weekdays(n,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[o]=new RegExp("^"+this.weekdaysShort(n,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[o]=new RegExp("^"+this.weekdaysMin(n,"").replace(".",".?")+"$","i")),this._weekdaysParse[o]||(s="^"+this.weekdays(n,"")+"|^"+this.weekdaysShort(n,"")+"|^"+this.weekdaysMin(n,""),this._weekdaysParse[o]=new RegExp(s.replace(".",""),"i")),i&&"dddd"===e&&this._fullWeekdaysParse[o].test(t))return o;if(i&&"ddd"===e&&this._shortWeekdaysParse[o].test(t))return o;if(i&&"dd"===e&&this._minWeekdaysParse[o].test(t))return o;if(!i&&this._weekdaysParse[o].test(t))return o}}function At(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=Et(t,this.localeData()),this.add(t-e,"d")):e}function Bt(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function Ft(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=Pt(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7}function Ht(t){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||Yt.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(d(this,"_weekdaysRegex")||(this._weekdaysRegex=kn),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function jt(t){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||Yt.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(d(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=On),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Wt(t){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||Yt.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(d(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Dn),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Yt(){function t(t,e){return e.length-t.length}var e,i,o,n,s,r=[],a=[],h=[],d=[];for(e=0;e<7;e++)i=u([2e3,1]).day(e),o=this.weekdaysMin(i,""),n=this.weekdaysShort(i,""),s=this.weekdays(i,""),r.push(o),a.push(n),h.push(s),d.push(o),d.push(n),d.push(s);for(r.sort(t),a.sort(t),h.sort(t),d.sort(t),e=0;e<7;e++)a[e]=et(a[e]),h[e]=et(h[e]),d[e]=et(d[e]);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 Gt(){return this.hours()%12||12}function Vt(){return this.hours()||24}function Ut(t,e){q(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function qt(t,e){return e._meridiemParse}function Xt(t){return"p"===(t+"").toLowerCase().charAt(0)}function Zt(t,e,i){return t>11?i?"pm":"PM":i?"am":"AM"}function Kt(t){return t?t.toLowerCase().replace("_","-"):t}function Qt(t){for(var e,i,o,n,s=0;s0;){if(o=Jt(n.slice(0,e).join("-")))return o;if(i&&i.length>=e&&x(n,i,!0)>=e-1)break;e--}s++}return null}function Jt(e){var i=null;if(!En[e]&&"undefined"!=typeof t&&t&&t.exports)try{i=Sn._abbr,!function(){var t=new Error('Cannot find module "./locale"');throw t.code="MODULE_NOT_FOUND",t}(),$t(i)}catch(t){}return En[e]}function $t(t,e){var i;return t&&(i=v(e)?ie(t):te(t,e),i&&(Sn=i)),Sn._abbr}function te(t,e){if(null!==e){var i=Tn;if(e.abbr=t,null!=En[t])D("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=En[t]._config;else if(null!=e.parentLocale){if(null==En[e.parentLocale])return Pn[e.parentLocale]||(Pn[e.parentLocale]=[]),Pn[e.parentLocale].push({name:t,config:e}),null;i=En[e.parentLocale]._config}return En[t]=new T(C(i,e)),Pn[t]&&Pn[t].forEach(function(t){te(t.name,t.config)}),$t(t),En[t]}return delete En[t],null}function ee(t,e){if(null!=e){var i,o=Tn;null!=En[t]&&(o=En[t]._config),e=C(o,e),i=new T(e),i.parentLocale=En[t],En[t]=i,$t(t)}else null!=En[t]&&(null!=En[t].parentLocale?En[t]=En[t].parentLocale:null!=En[t]&&delete En[t]);return En[t]}function ie(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Sn;if(!o(t)){if(e=Jt(t))return e;t=[t]}return Qt(t)}function oe(){return Oo(En)}function ne(t){var e,i=t._a;return i&&p(t).overflow===-2&&(e=i[nn]<0||i[nn]>11?nn:i[sn]<1||i[sn]>st(i[on],i[nn])?sn:i[rn]<0||i[rn]>24||24===i[rn]&&(0!==i[an]||0!==i[hn]||0!==i[dn])?rn:i[an]<0||i[an]>59?an:i[hn]<0||i[hn]>59?hn:i[dn]<0||i[dn]>999?dn:-1,p(t)._overflowDayOfYear&&(esn)&&(e=sn),p(t)._overflowWeeks&&e===-1&&(e=ln),p(t)._overflowWeekday&&e===-1&&(e=un),p(t).overflow=e),t}function se(t){var e,i,o,n,s,r,a=t._i,h=In.exec(a)||Nn.exec(a);if(h){for(p(t).iso=!0,e=0,i=Rn.length;evt(n)&&(p(t)._overflowDayOfYear=!0),i=_t(n,0,t._dayOfYear),t._a[nn]=i.getUTCMonth(),t._a[sn]=i.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=s[e]=o[e];for(;e<7;e++)t._a[e]=s[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[rn]&&0===t._a[an]&&0===t._a[hn]&&0===t._a[dn]&&(t._nextDay=!0,t._a[rn]=0),t._d=(t._useUTC?_t:bt).apply(null,s),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[rn]=24)}}function le(t){var e,i,o,n,s,r,a,h;if(e=t._w,null!=e.GG||null!=e.W||null!=e.E)s=1,r=4,i=ae(e.GG,t._a[on],kt(be(),1,4).year),o=ae(e.W,1),n=ae(e.E,1),(n<1||n>7)&&(h=!0);else{s=t._locale._week.dow,r=t._locale._week.doy;var d=kt(be(),s,r);i=ae(e.gg,t._a[on],d.year),o=ae(e.w,d.week),null!=e.d?(n=e.d,(n<0||n>6)&&(h=!0)):null!=e.e?(n=e.e+s,(e.e<0||e.e>6)&&(h=!0)):n=s}o<1||o>Ot(i,s,r)?p(t)._overflowWeeks=!0:null!=h?p(t)._overflowWeekday=!0:(a=xt(i,o,n,s,r),t._a[on]=a.year,t._dayOfYear=a.dayOfYear)}function ue(t){if(t._f===e.ISO_8601)return void se(t);t._a=[],p(t).empty=!0;var i,o,n,s,r,a=""+t._i,h=a.length,d=0;for(n=Q(t._f,t._locale).match(No)||[],i=0;i0&&p(t).unusedInput.push(r),a=a.slice(a.indexOf(o)+o.length),d+=o.length),Lo[s]?(o?p(t).empty=!1:p(t).unusedTokens.push(s),nt(s,o,t)):t._strict&&!o&&p(t).unusedTokens.push(s);p(t).charsLeftOver=h-d,a.length>0&&p(t).unusedInput.push(a),t._a[rn]<=12&&p(t).bigHour===!0&&t._a[rn]>0&&(p(t).bigHour=void 0),p(t).parsedDateParts=t._a.slice(0),p(t).meridiem=t._meridiem,t._a[rn]=ce(t._locale,t._a[rn],t._meridiem),de(t),ne(t)}function ce(t,e,i){var o;return null==i?e:null!=t.meridiemHour?t.meridiemHour(e,i):null!=t.isPM?(o=t.isPM(i),o&&e<12&&(e+=12),o||12!==e||(e=0),e):e}function pe(t){var e,i,o,n,s;if(0===t._f.length)return p(t).invalidFormat=!0,void(t._d=new Date(NaN));for(n=0;nthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ae(){if(!v(this._isDSTShifted))return this._isDSTShifted;var t={};if(g(t,this),t=ve(t),t._a){var e=t._isUTC?u(t._a):be(t._a);this._isDSTShifted=this.isValid()&&x(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Be(){return!!this.isValid()&&!this._isUTC}function Fe(){return!!this.isValid()&&this._isUTC}function He(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function je(t,e){var i,o,n,s=t,a=null;return Oe(t)?s={ms:t._milliseconds,d:t._days,M:t._months}:r(t)?(s={},e?s[e]=t:s.milliseconds=t):(a=Wn.exec(t))?(i="-"===a[1]?-1:1,s={y:0,d:w(a[sn])*i,h:w(a[rn])*i,m:w(a[an])*i,s:w(a[hn])*i,ms:w(De(1e3*a[dn]))*i}):(a=Yn.exec(t))?(i="-"===a[1]?-1:1,s={y:We(a[2],i),M:We(a[3],i),w:We(a[4],i),d:We(a[5],i),h:We(a[6],i),m:We(a[7],i),s:We(a[8],i)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(n=Ge(be(s.from),be(s.to)),s={},s.ms=n.milliseconds,s.M=n.months),o=new ke(s),Oe(t)&&d(t,"_locale")&&(o._locale=t._locale),o}function We(t,e){var i=t&&parseFloat(t.replace(",","."));return(isNaN(i)?0:i)*e}function Ye(t,e){var i={milliseconds:0,months:0};return i.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(i.months,"M").isAfter(e)&&--i.months,i.milliseconds=+e-+t.clone().add(i.months,"M"),i}function Ge(t,e){var i;return t.isValid()&&e.isValid()?(e=Ce(e,t),t.isBefore(e)?i=Ye(t,e):(i=Ye(e,t),i.milliseconds=-i.milliseconds,i.months=-i.months),i):{milliseconds:0,months:0}}function Ve(t,e){return function(i,o){var n,s;return null===o||isNaN(+o)||(D(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),s=i,i=o,o=s),i="string"==typeof i?+i:i,n=je(i,o),Ue(this,n,t),this}}function Ue(t,i,o,n){var s=i._milliseconds,r=De(i._days),a=De(i._months);t.isValid()&&(n=null==n||n,s&&t._d.setTime(t._d.valueOf()+s*o),r&&Y(t,"Date",W(t,"Date")+r*o),a&<(t,W(t,"Month")+a*o),n&&e.updateOffset(t,r||a))}function qe(t,e){var i=t.diff(e,"days",!0);return i<-6?"sameElse":i<-1?"lastWeek":i<0?"lastDay":i<1?"sameDay":i<2?"nextDay":i<7?"nextWeek":"sameElse"}function Xe(t,i){var o=t||be(),n=Ce(o,this).startOf("day"),s=e.calendarFormat(this,n)||"sameElse",r=i&&(S(i[s])?i[s].call(this,o):i[s]);return this.format(r||this.localeData().calendar(s,this,be(o)))}function Ze(){return new y(this)}function Ke(t,e){var i=b(t)?t:be(t);return!(!this.isValid()||!i.isValid())&&(e=A(v(e)?"millisecond":e),"millisecond"===e?this.valueOf()>i.valueOf():i.valueOf()s&&(e=s),Ii.call(this,t,e,i,o,n))}function Ii(t,e,i,o,n){var s=xt(t,e,i,o,n),r=_t(s.year,0,s.dayOfYear);return this.year(r.getUTCFullYear()),this.month(r.getUTCMonth()),this.date(r.getUTCDate()),this}function Ni(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}function zi(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function Ri(t,e){e[dn]=w(1e3*("0."+t))}function Li(){return this._isUTC?"UTC":""}function Ai(){return this._isUTC?"Coordinated Universal Time":""}function Bi(t){return be(1e3*t)}function Fi(){return be.apply(null,arguments).parseZone()}function Hi(t){return t}function ji(t,e,i,o){var n=ie(),s=u().set(o,e);return n[i](s,t)}function Wi(t,e,i){if(r(t)&&(e=t,t=void 0),t=t||"",null!=e)return ji(t,e,i,"month");var o,n=[];for(o=0;o<12;o++)n[o]=ji(t,o,i,"month");return n}function Yi(t,e,i,o){"boolean"==typeof t?(r(e)&&(i=e,e=void 0),e=e||""):(e=t,i=e,t=!1,r(e)&&(i=e,e=void 0),e=e||"");var n=ie(),s=t?n._week.dow:0;if(null!=i)return ji(e,(i+s)%7,o,"day");var a,h=[];for(a=0;a<7;a++)h[a]=ji(e,(a+s)%7,o,"day");return h}function Gi(t,e){return Wi(t,e,"months")}function Vi(t,e){return Wi(t,e,"monthsShort")}function Ui(t,e,i){return Yi(t,e,i,"weekdays")}function qi(t,e,i){return Yi(t,e,i,"weekdaysShort")}function Xi(t,e,i){return Yi(t,e,i,"weekdaysMin")}function Zi(){var t=this._data;return this._milliseconds=ts(this._milliseconds),this._days=ts(this._days),this._months=ts(this._months),t.milliseconds=ts(t.milliseconds),t.seconds=ts(t.seconds),t.minutes=ts(t.minutes),t.hours=ts(t.hours),t.months=ts(t.months),t.years=ts(t.years),this}function Ki(t,e,i,o){var n=je(e,i);return t._milliseconds+=o*n._milliseconds,t._days+=o*n._days,t._months+=o*n._months,t._bubble()}function Qi(t,e){return Ki(this,t,e,1)}function Ji(t,e){return Ki(this,t,e,-1)}function $i(t){return t<0?Math.floor(t):Math.ceil(t)}function to(){var t,e,i,o,n,s=this._milliseconds,r=this._days,a=this._months,h=this._data;return s>=0&&r>=0&&a>=0||s<=0&&r<=0&&a<=0||(s+=864e5*$i(io(a)+r),r=0,a=0),h.milliseconds=s%1e3,t=_(s/1e3),h.seconds=t%60,e=_(t/60),h.minutes=e%60,i=_(e/60),h.hours=i%24,r+=_(i/24),n=_(eo(r)),a+=n,r-=$i(io(n)),o=_(a/12),a%=12,h.days=r,h.months=a,h.years=o,this}function eo(t){return 4800*t/146097}function io(t){return 146097*t/4800}function oo(t){var e,i,o=this._milliseconds;if(t=A(t),"month"===t||"year"===t)return e=this._days+o/864e5,i=this._months+eo(e), +"month"===t?i:i/12;switch(e=this._days+Math.round(io(this._months)),t){case"week":return e/7+o/6048e5;case"day":return e+o/864e5;case"hour":return 24*e+o/36e5;case"minute":return 1440*e+o/6e4;case"second":return 86400*e+o/1e3;case"millisecond":return Math.floor(864e5*e)+o;default:throw new Error("Unknown unit "+t)}}function no(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*w(this._months/12)}function so(t){return function(){return this.as(t)}}function ro(t){return t=A(t),this[t+"s"]()}function ao(t){return function(){return this._data[t]}}function ho(){return _(this.days()/7)}function lo(t,e,i,o,n){return n.relativeTime(e||1,!!i,t,o)}function uo(t,e,i){var o=je(t).abs(),n=vs(o.as("s")),s=vs(o.as("m")),r=vs(o.as("h")),a=vs(o.as("d")),h=vs(o.as("M")),d=vs(o.as("y")),l=n0,l[4]=i,lo.apply(null,l)}function co(t){return void 0===t?vs:"function"==typeof t&&(vs=t,!0)}function po(t,e){return void 0!==gs[t]&&(void 0===e?gs[t]:(gs[t]=e,!0))}function fo(t){var e=this.localeData(),i=uo(this,!t,e);return t&&(i=e.pastFuture(+this,i)),e.postformat(i)}function mo(){var t,e,i,o=ys(this._milliseconds)/1e3,n=ys(this._days),s=ys(this._months);t=_(o/60),e=_(t/60),o%=60,t%=60,i=_(s/12),s%=12;var r=i,a=s,h=n,d=e,l=t,u=o,c=this.asSeconds();return c?(c<0?"-":"")+"P"+(r?r+"Y":"")+(a?a+"M":"")+(h?h+"D":"")+(d||l||u?"T":"")+(d?d+"H":"")+(l?l+"M":"")+(u?u+"S":""):"P0D"}var vo,go;go=Array.prototype.some?Array.prototype.some:function(t){for(var e=Object(this),i=e.length>>>0,o=0;o68?1900:2e3)};var yn=j("FullYear",!0);q("w",["ww",2],"wo","week"),q("W",["WW",2],"Wo","isoWeek"),L("week","w"),L("isoWeek","W"),F("week",5),F("isoWeek",5),J("w",Wo),J("ww",Wo,Bo),J("W",Wo),J("WW",Wo,Bo),ot(["w","ww","W","WW"],function(t,e,i,o){e[o.substr(0,1)]=w(t)});var bn={dow:0,doy:6};q("d",0,"do","day"),q("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),q("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),q("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),q("e",0,0,"weekday"),q("E",0,0,"isoWeekday"),L("day","d"),L("weekday","e"),L("isoWeekday","E"),F("day",11),F("weekday",11),F("isoWeekday",11),J("d",Wo),J("e",Wo),J("E",Wo),J("dd",function(t,e){return e.weekdaysMinRegex(t)}),J("ddd",function(t,e){return e.weekdaysShortRegex(t)}),J("dddd",function(t,e){return e.weekdaysRegex(t)}),ot(["dd","ddd","dddd"],function(t,e,i,o){var n=i._locale.weekdaysParse(t,o,i._strict);null!=n?e.d=n:p(i).invalidWeekday=t}),ot(["d","e","E"],function(t,e,i,o){e[o]=w(t)});var _n="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),wn="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),xn="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),kn=$o,On=$o,Dn=$o;q("H",["HH",2],0,"hour"),q("h",["hh",2],0,Gt),q("k",["kk",2],0,Vt),q("hmm",0,0,function(){return""+Gt.apply(this)+U(this.minutes(),2)}),q("hmmss",0,0,function(){return""+Gt.apply(this)+U(this.minutes(),2)+U(this.seconds(),2)}),q("Hmm",0,0,function(){return""+this.hours()+U(this.minutes(),2)}),q("Hmmss",0,0,function(){return""+this.hours()+U(this.minutes(),2)+U(this.seconds(),2)}),Ut("a",!0),Ut("A",!1),L("hour","h"),F("hour",13),J("a",qt),J("A",qt),J("H",Wo),J("h",Wo),J("HH",Wo,Bo),J("hh",Wo,Bo),J("hmm",Yo),J("hmmss",Go),J("Hmm",Yo),J("Hmmss",Go),it(["H","HH"],rn),it(["a","A"],function(t,e,i){i._isPm=i._locale.isPM(t),i._meridiem=t}),it(["h","hh"],function(t,e,i){e[rn]=w(t),p(i).bigHour=!0}),it("hmm",function(t,e,i){var o=t.length-2;e[rn]=w(t.substr(0,o)),e[an]=w(t.substr(o)),p(i).bigHour=!0}),it("hmmss",function(t,e,i){var o=t.length-4,n=t.length-2;e[rn]=w(t.substr(0,o)),e[an]=w(t.substr(o,2)),e[hn]=w(t.substr(n)),p(i).bigHour=!0}),it("Hmm",function(t,e,i){var o=t.length-2;e[rn]=w(t.substr(0,o)),e[an]=w(t.substr(o))}),it("Hmmss",function(t,e,i){var o=t.length-4,n=t.length-2;e[rn]=w(t.substr(0,o)),e[an]=w(t.substr(o,2)),e[hn]=w(t.substr(n))});var Sn,Mn=/[ap]\.?m?\.?/i,Cn=j("Hours",!0),Tn={calendar:Do,longDateFormat:So,invalidDate:Mo,ordinal:Co,ordinalParse:To,relativeTime:Eo,months:fn,monthsShort:mn,week:bn,weekdays:_n,weekdaysMin:xn,weekdaysShort:wn,meridiemParse:Mn},En={},Pn={},In=/^\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)?)?$/,Nn=/^\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)?)?$/,zn=/Z|[+-]\d\d(?::?\d\d)?/,Rn=[["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}/]],Ln=[["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/]],An=/^\/?Date\((\-?\d+)/i;e.createFromInputFallback=O("value provided is not in a recognized ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non 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(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),e.ISO_8601=function(){};var Bn=O("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=be.apply(null,arguments);return this.isValid()&&t.isValid()?tthis?this:t:m()}),Hn=function(){return Date.now?Date.now():+new Date};Se("Z",":"),Se("ZZ",""),J("Z",Qo),J("ZZ",Qo),it(["Z","ZZ"],function(t,e,i){i._useUTC=!0,i._tzm=Me(Qo,t)});var jn=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var Wn=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Yn=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;je.fn=ke.prototype;var Gn=Ve(1,"add"),Vn=Ve(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Un=O("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});q(0,["gg",2],0,function(){return this.weekYear()%100}),q(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Si("gggg","weekYear"),Si("ggggg","weekYear"),Si("GGGG","isoWeekYear"),Si("GGGGG","isoWeekYear"),L("weekYear","gg"),L("isoWeekYear","GG"),F("weekYear",1),F("isoWeekYear",1),J("G",Zo),J("g",Zo),J("GG",Wo,Bo),J("gg",Wo,Bo),J("GGGG",Uo,Ho),J("gggg",Uo,Ho),J("GGGGG",qo,jo),J("ggggg",qo,jo),ot(["gggg","ggggg","GGGG","GGGGG"],function(t,e,i,o){e[o.substr(0,2)]=w(t)}),ot(["gg","GG"],function(t,i,o,n){i[n]=e.parseTwoDigitYear(t)}),q("Q",0,"Qo","quarter"),L("quarter","Q"),F("quarter",7),J("Q",Ao),it("Q",function(t,e){e[nn]=3*(w(t)-1)}),q("D",["DD",2],"Do","date"),L("date","D"),F("date",9),J("D",Wo),J("DD",Wo,Bo),J("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),it(["D","DD"],sn),it("Do",function(t,e){e[sn]=w(t.match(Wo)[0],10)});var qn=j("Date",!0);q("DDD",["DDDD",3],"DDDo","dayOfYear"),L("dayOfYear","DDD"),F("dayOfYear",4),J("DDD",Vo),J("DDDD",Fo),it(["DDD","DDDD"],function(t,e,i){i._dayOfYear=w(t)}),q("m",["mm",2],0,"minute"),L("minute","m"),F("minute",14),J("m",Wo),J("mm",Wo,Bo),it(["m","mm"],an);var Xn=j("Minutes",!1);q("s",["ss",2],0,"second"),L("second","s"),F("second",15),J("s",Wo),J("ss",Wo,Bo),it(["s","ss"],hn);var Zn=j("Seconds",!1);q("S",0,0,function(){return~~(this.millisecond()/100)}),q(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),q(0,["SSS",3],0,"millisecond"),q(0,["SSSS",4],0,function(){return 10*this.millisecond()}),q(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),q(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),q(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),q(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),q(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),L("millisecond","ms"),F("millisecond",16),J("S",Vo,Ao),J("SS",Vo,Bo),J("SSS",Vo,Fo);var Kn;for(Kn="SSSS";Kn.length<=9;Kn+="S")J(Kn,Xo);for(Kn="S";Kn.length<=9;Kn+="S")it(Kn,Ri);var Qn=j("Milliseconds",!1);q("z",0,0,"zoneAbbr"),q("zz",0,0,"zoneName");var Jn=y.prototype;Jn.add=Gn,Jn.calendar=Xe,Jn.clone=Ze,Jn.diff=ii,Jn.endOf=mi,Jn.format=ai,Jn.from=hi,Jn.fromNow=di,Jn.to=li,Jn.toNow=ui,Jn.get=G,Jn.invalidAt=Oi,Jn.isAfter=Ke,Jn.isBefore=Qe,Jn.isBetween=Je,Jn.isSame=$e,Jn.isSameOrAfter=ti,Jn.isSameOrBefore=ei,Jn.isValid=xi,Jn.lang=Un,Jn.locale=ci,Jn.localeData=pi,Jn.max=Fn,Jn.min=Bn,Jn.parsingFlags=ki,Jn.set=V,Jn.startOf=fi,Jn.subtract=Vn,Jn.toArray=bi,Jn.toObject=_i,Jn.toDate=yi,Jn.toISOString=si,Jn.inspect=ri,Jn.toJSON=wi,Jn.toString=ni,Jn.unix=gi,Jn.valueOf=vi,Jn.creationData=Di,Jn.year=yn,Jn.isLeapYear=yt,Jn.weekYear=Mi,Jn.isoWeekYear=Ci,Jn.quarter=Jn.quarters=Ni,Jn.month=ut,Jn.daysInMonth=ct,Jn.week=Jn.weeks=Ct,Jn.isoWeek=Jn.isoWeeks=Tt,Jn.weeksInYear=Ei,Jn.isoWeeksInYear=Ti,Jn.date=qn,Jn.day=Jn.days=At,Jn.weekday=Bt,Jn.isoWeekday=Ft,Jn.dayOfYear=zi,Jn.hour=Jn.hours=Cn,Jn.minute=Jn.minutes=Xn,Jn.second=Jn.seconds=Zn,Jn.millisecond=Jn.milliseconds=Qn,Jn.utcOffset=Ee,Jn.utc=Ie,Jn.local=Ne,Jn.parseZone=ze,Jn.hasAlignedHourOffset=Re,Jn.isDST=Le,Jn.isLocal=Be,Jn.isUtcOffset=Fe,Jn.isUtc=He,Jn.isUTC=He,Jn.zoneAbbr=Li,Jn.zoneName=Ai,Jn.dates=O("dates accessor is deprecated. Use date instead.",qn),Jn.months=O("months accessor is deprecated. Use month instead",ut),Jn.years=O("years accessor is deprecated. Use year instead",yn),Jn.zone=O("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Pe),Jn.isDSTShifted=O("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Ae);var $n=T.prototype;$n.calendar=E,$n.longDateFormat=P,$n.invalidDate=I,$n.ordinal=N,$n.preparse=Hi,$n.postformat=Hi,$n.relativeTime=z,$n.pastFuture=R,$n.set=M,$n.months=rt,$n.monthsShort=at,$n.monthsParse=dt,$n.monthsRegex=ft,$n.monthsShortRegex=pt,$n.week=Dt,$n.firstDayOfYear=Mt,$n.firstDayOfWeek=St,$n.weekdays=It,$n.weekdaysMin=zt,$n.weekdaysShort=Nt,$n.weekdaysParse=Lt,$n.weekdaysRegex=Ht,$n.weekdaysShortRegex=jt,$n.weekdaysMinRegex=Wt,$n.isPM=Xt,$n.meridiem=Zt,$t("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,i=1===w(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+i}}),e.lang=O("moment.lang is deprecated. Use moment.locale instead.",$t),e.langData=O("moment.langData is deprecated. Use moment.localeData instead.",ie);var ts=Math.abs,es=so("ms"),is=so("s"),os=so("m"),ns=so("h"),ss=so("d"),rs=so("w"),as=so("M"),hs=so("y"),ds=ao("milliseconds"),ls=ao("seconds"),us=ao("minutes"),cs=ao("hours"),ps=ao("days"),fs=ao("months"),ms=ao("years"),vs=Math.round,gs={s:45,m:45,h:22,d:26,M:11},ys=Math.abs,bs=ke.prototype;return bs.abs=Zi,bs.add=Qi,bs.subtract=Ji,bs.as=oo,bs.asMilliseconds=es,bs.asSeconds=is,bs.asMinutes=os,bs.asHours=ns,bs.asDays=ss,bs.asWeeks=rs,bs.asMonths=as,bs.asYears=hs,bs.valueOf=no,bs._bubble=to,bs.get=ro,bs.milliseconds=ds,bs.seconds=ls,bs.minutes=us,bs.hours=cs,bs.days=ps,bs.weeks=ho,bs.months=fs,bs.years=ms,bs.humanize=fo,bs.toISOString=mo,bs.toString=mo,bs.toJSON=mo,bs.locale=ci,bs.localeData=pi,bs.toIsoString=O("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",mo),bs.lang=Un,q("X",0,0,"unix"),q("x",0,0,"valueOf"),J("x",Zo),J("X",Jo),it("X",function(t,e,i){i._d=new Date(1e3*parseFloat(t,10))}),it("x",function(t,e,i){i._d=new Date(w(t))}),e.version="2.17.1",i(be),e.fn=Jn,e.min=we,e.max=xe,e.now=Hn,e.utc=u,e.unix=Bi,e.months=Gi,e.isDate=a,e.locale=$t,e.invalid=m,e.duration=je,e.isMoment=b,e.weekdays=Ui,e.parseZone=Fi,e.localeData=ie,e.isDuration=Oe,e.monthsShort=Vi,e.weekdaysMin=Xi,e.defineLocale=te,e.updateLocale=ee,e.locales=oe,e.weekdaysShort=qi,e.normalizeUnits=A,e.relativeTimeRounding=co,e.relativeTimeThreshold=po,e.calendarFormat=qe,e.prototype=Jn,e})}).call(e,i(86)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e){function i(t){throw new Error("Cannot find module '"+t+"'.")}i.keys=function(){return[]},i.resolve=i,t.exports=i,i.id=87},function(t,e){(function(e){function i(t,e,i){var o=e&&i||0,n=0;for(e=e||[],t.toLowerCase().replace(/[0-9a-f]{2}/g,function(t){n<16&&(e[o+n++]=u[t])});n<16;)e[o+n++]=0;return e}function o(t,e){var i=e||0,o=l;return o[t[i++]]+o[t[i++]]+o[t[i++]]+o[t[i++]]+"-"+o[t[i++]]+o[t[i++]]+"-"+o[t[i++]]+o[t[i++]]+"-"+o[t[i++]]+o[t[i++]]+"-"+o[t[i++]]+o[t[i++]]+o[t[i++]]+o[t[i++]]+o[t[i++]]+o[t[i++]]}function n(t,e,i){var n=e&&i||0,s=e||[];t=t||{};var r=void 0!==t.clockseq?t.clockseq:m,a=void 0!==t.msecs?t.msecs:(new Date).getTime(),h=void 0!==t.nsecs?t.nsecs:g+1,d=a-v+(h-g)/1e4;if(d<0&&void 0===t.clockseq&&(r=r+1&16383),(d<0||a>v)&&void 0===t.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");v=a,g=h,m=r,a+=122192928e5;var l=(1e4*(268435455&a)+h)%4294967296;s[n++]=l>>>24&255,s[n++]=l>>>16&255,s[n++]=l>>>8&255,s[n++]=255&l;var u=a/4294967296*1e4&268435455;s[n++]=u>>>8&255,s[n++]=255&u,s[n++]=u>>>24&15|16,s[n++]=u>>>16&255,s[n++]=r>>>8|128,s[n++]=255&r;for(var c=t.node||f,p=0;p<6;p++)s[n+p]=c[p];return e?e:o(s)}function s(t,e,i){var n=e&&i||0;"string"==typeof t&&(e="binary"==t?new Array(16):null,t=null),t=t||{};var s=t.random||(t.rng||r)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,e)for(var a=0;a<16;a++)e[n+a]=s[a];return e||o(s)}var r,a="undefined"!=typeof window?window:"undefined"!=typeof e?e:null;if(a&&a.crypto&&crypto.getRandomValues){var h=new Uint8Array(16);r=function(){return crypto.getRandomValues(h),h}}if(!r){var d=new Array(16);r=function(){for(var t,e=0;e<16;e++)0===(3&e)&&(t=4294967296*Math.random()),d[e]=t>>>((3&e)<<3)&255;return d}}for(var l=[],u={},c=0;c<256;c++)l[c]=(c+256).toString(16).substr(1),u[l[c]]=c;var p=r(),f=[1|p[0],p[1],p[2],p[3],p[4],p[5]],m=16383&(p[6]<<8|p[7]),v=0,g=0,y=s;y.v1=n,y.v4=s,y.parse=i,y.unparse=o,t.exports=y}).call(e,function(){return this}())},function(t,e,i){e.util=i(1),e.DOMutil=i(90),e.DataSet=i(91),e.DataView=i(93),e.Queue=i(92),e.Graph3d=i(94),e.graph3d={Camera:i(98),Filter:i(103),Point2d:i(97),Point3d:i(96),Slider:i(104),StepNumber:i(105)},e.moment=i(84),e.Hammer=i(108),e.keycharm=i(111)},function(t,e){e.prepareElements=function(t){for(var e in t)t.hasOwnProperty(e)&&(t[e].redundant=t[e].used,t[e].used=[])},e.cleanupElements=function(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e].redundant){for(var i=0;i0?(o=e[t].redundant[0],e[t].redundant.shift()):(o=document.createElementNS("http://www.w3.org/2000/svg",t),i.appendChild(o)):(o=document.createElementNS("http://www.w3.org/2000/svg",t),e[t]={used:[],redundant:[]},i.appendChild(o)),e[t].used.push(o),o},e.getDOMElement=function(t,e,i,o){var n;return e.hasOwnProperty(t)?e[t].redundant.length>0?(n=e[t].redundant[0],e[t].redundant.shift()):(n=document.createElement(t),void 0!==o?i.insertBefore(n,o):i.appendChild(n)):(n=document.createElement(t),e[t]={used:[],redundant:[]},void 0!==o?i.insertBefore(n,o):i.appendChild(n)),e[t].used.push(n),n},e.drawPoint=function(t,i,o,n,s,r){var a;if("circle"==o.style?(a=e.getSVGElement("circle",n,s),a.setAttributeNS(null,"cx",t),a.setAttributeNS(null,"cy",i),a.setAttributeNS(null,"r",.5*o.size)):(a=e.getSVGElement("rect",n,s),a.setAttributeNS(null,"x",t-.5*o.size),a.setAttributeNS(null,"y",i-.5*o.size),a.setAttributeNS(null,"width",o.size),a.setAttributeNS(null,"height",o.size)),void 0!==o.styles&&a.setAttributeNS(null,"style",o.styles),a.setAttributeNS(null,"class",o.className+" vis-point"),r){var h=e.getSVGElement("text",n,s);r.xOffset&&(t+=r.xOffset),r.yOffset&&(i+=r.yOffset),r.content&&(h.textContent=r.content),r.className&&h.setAttributeNS(null,"class",r.className+" vis-label"),h.setAttributeNS(null,"x",t),h.setAttributeNS(null,"y",i)}return a},e.drawBar=function(t,i,o,n,s,r,a,h){if(0!=n){n<0&&(n*=-1,i-=n);var d=e.getSVGElement("rect",r,a);d.setAttributeNS(null,"x",t-.5*o),d.setAttributeNS(null,"y",i),d.setAttributeNS(null,"width",o),d.setAttributeNS(null,"height",n),d.setAttributeNS(null,"class",s),h&&d.setAttributeNS(null,"style",h)}}},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(t&&!Array.isArray(t)&&(e=t,t=null),this._options=e||{},this._data={},this.length=0,this._fieldId=this._options.fieldId||"id",this._type={},this._options.type)for(var i=(0,l.default)(this._options.type),o=0,n=i.length;on?1:or)&&(s=h,r=d)}return s},n.prototype.min=function(t){var e,i,o=this._data,n=(0,l.default)(o),s=null,r=null;for(e=0,i=n.length;ethis.max&&this.flush(),clearTimeout(this._timeout),this.queue.length>0&&"number"==typeof this.delay){var t=this;this._timeout=setTimeout(function(){t.flush()},this.delay)}},i.prototype.flush=function(){for(;this._queue.length>0;){var t=this._queue.shift();t.fn.apply(t.context||t.fn,t.args||[])}},t.exports=i},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){this._data=null,this._ids={},this.length=0,this._options=e||{},this._fieldId="id",this._subscribers={};var i=this;this.listener=function(){i._onEvent.apply(i,arguments)},this.setData(t)}var s=i(58),r=o(s),a=i(1),h=i(91);n.prototype.setData=function(t){var e,i,o,n,s;if(this._data){for(this._data.off&&this._data.off("*",this.listener),e=this._data.getIds({filter:this._options&&this._options.filter}),s=[],o=0,n=e.length;o0&&(h[n-1].pointNext=r),h.push(r);return h},o.prototype.create=function(){for(;this.containerElement.hasChildNodes();)this.containerElement.removeChild(this.containerElement.firstChild);this.frame=document.createElement("div"),this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas);var t=document.createElement("DIV");t.style.color="red",t.style.fontWeight="bold",t.style.padding="10px",t.innerHTML="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(t),this.frame.filter=document.createElement("div"),this.frame.filter.style.position="absolute",this.frame.filter.style.bottom="0px",this.frame.filter.style.left="0px",this.frame.filter.style.width="100%",this.frame.appendChild(this.frame.filter);var e=this,i=function(t){e._onMouseDown(t)},o=function(t){e._onTouchStart(t)},n=function(t){e._onWheel(t)},s=function(t){e._onTooltip(t)},r=function(t){e._onClick(t)};d.addEventListener(this.frame.canvas,"keydown",onkeydown),d.addEventListener(this.frame.canvas,"mousedown",i),d.addEventListener(this.frame.canvas,"touchstart",o),d.addEventListener(this.frame.canvas,"mousewheel",n),d.addEventListener(this.frame.canvas,"mousemove",s),d.addEventListener(this.frame.canvas,"click",r),this.containerElement.appendChild(this.frame)},o.prototype._setSize=function(t,e){this.frame.style.width=t,this.frame.style.height=e,this._resizeCanvas()},o.prototype._resizeCanvas=function(){this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=this.frame.canvas.clientWidth,this.frame.canvas.height=this.frame.canvas.clientHeight,this.frame.filter.style.width=this.frame.canvas.clientWidth-20+"px"},o.prototype.animationStart=function(){if(!this.frame.filter||!this.frame.filter.slider)throw new Error("No animation available");this.frame.filter.slider.play()},o.prototype.animationStop=function(){this.frame.filter&&this.frame.filter.slider&&this.frame.filter.slider.stop()},o.prototype._resizeCenter=function(){"%"===this.xCenter.charAt(this.xCenter.length-1)?this.currentXCenter=parseFloat(this.xCenter)/100*this.frame.canvas.clientWidth:this.currentXCenter=parseFloat(this.xCenter),"%"===this.yCenter.charAt(this.yCenter.length-1)?this.currentYCenter=parseFloat(this.yCenter)/100*(this.frame.canvas.clientHeight-this.frame.filter.clientHeight):this.currentYCenter=parseFloat(this.yCenter)},o.prototype.getCameraPosition=function(){var t=this.camera.getArmRotation();return t.distance=this.camera.getArmLength(),t},o.prototype._readData=function(t){this._dataInitialize(t,this.style),this.dataFilter?this.dataPoints=this.dataFilter._getDataPoints():this.dataPoints=this._getDataPoints(this.dataTable),this._redrawFilter()},o.prototype.setData=function(t){this._readData(t),this.redraw(),this.animationAutoStart&&this.dataFilter&&this.animationStart()},o.prototype.setOptions=function(t){this.animationStop(),v.setOptions(t,this),this.setPointDrawingMethod(),this._setSize(this.width,this.height),this.dataTable&&this.setData(this.dataTable),this.animationAutoStart&&this.dataFilter&&this.animationStart()},o.prototype.setPointDrawingMethod=function(){var t=void 0;switch(this.style){case o.STYLE.BAR:t=o.prototype._redrawBarGraphPoint;break;case o.STYLE.BARCOLOR:t=o.prototype._redrawBarColorGraphPoint;break;case o.STYLE.BARSIZE:t=o.prototype._redrawBarSizeGraphPoint;break;case o.STYLE.DOT:t=o.prototype._redrawDotGraphPoint;break;case o.STYLE.DOTLINE:t=o.prototype._redrawDotLineGraphPoint;break;case o.STYLE.DOTCOLOR:t=o.prototype._redrawDotColorGraphPoint;break;case o.STYLE.DOTSIZE:t=o.prototype._redrawDotSizeGraphPoint;break;case o.STYLE.SURFACE:t=o.prototype._redrawSurfaceGraphPoint;break;case o.STYLE.GRID:t=o.prototype._redrawGridGraphPoint;break;case o.STYLE.LINE:t=o.prototype._redrawLineGraphPoint;break;default:throw new Error("Can not determine point drawing method for graph style '"+this.style+"'")}this._pointDrawingMethod=t},o.prototype.redraw=function(){if(void 0===this.dataPoints)throw new Error("Graph data not initialized");this._resizeCanvas(),this._resizeCenter(),this._redrawSlider(),this._redrawClear(),this._redrawAxis(),this._redrawDataGraph(),this._redrawInfo(),this._redrawLegend()},o.prototype._getContext=function(){var t=this.frame.canvas,e=t.getContext("2d");return e.lineJoin="round",e.lineCap="round",e},o.prototype._redrawClear=function(){var t=this.frame.canvas,e=t.getContext("2d");e.clearRect(0,0,t.width,t.height)},o.prototype._dotSize=function(){return this.frame.clientWidth*this.dotSizeRatio},o.prototype._getLegendWidth=function(){var t;if(this.style===o.STYLE.DOTSIZE){var e=this._dotSize();t=e/2+2*e}else t=this.style===o.STYLE.BARSIZE?this.xBarWidth:20;return t},o.prototype._redrawLegend=function(){if(this.showLegend===!0&&this.style!==o.STYLE.LINE&&this.style!==o.STYLE.BARSIZE){var t=this.style===o.STYLE.BARSIZE||this.style===o.STYLE.DOTSIZE,e=this.style===o.STYLE.DOTSIZE||this.style===o.STYLE.DOTCOLOR||this.style===o.STYLE.BARCOLOR,i=Math.max(.25*this.frame.clientHeight,100),n=this.margin,s=this._getLegendWidth(),r=this.frame.clientWidth-this.margin,a=r-s,h=n+i,d=this._getContext();if(d.lineWidth=1,d.font="14px arial",t===!1){var l,c=0,p=i;for(l=c;l0?(t.textAlign="center",t.textBaseline="top",s.y+=n):Math.sin(2*o)<0?(t.textAlign="right",t.textBaseline="middle"):(t.textAlign="left",t.textBaseline="middle"),t.fillStyle=this.axisColor,t.fillText(i,s.x,s.y)},o.prototype.drawAxisLabelY=function(t,e,i,o,n){void 0===n&&(n=0);var s=this._convert3Dto2D(e);Math.cos(2*o)<0?(t.textAlign="center",t.textBaseline="top",s.y+=n):Math.sin(2*o)>0?(t.textAlign="right",t.textBaseline="middle"):(t.textAlign="left",t.textBaseline="middle"),t.fillStyle=this.axisColor,t.fillText(i,s.x,s.y)},o.prototype.drawAxisLabelZ=function(t,e,i,o){void 0===o&&(o=0);var n=this._convert3Dto2D(e);t.textAlign="right",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(i,n.x-o,n.y)},o.prototype._line3d=function(t,e,i,o){var n=this._convert3Dto2D(e),s=this._convert3Dto2D(i);this._line(t,n,s,o)},o.prototype._redrawAxis=function(){var t,e,i,o,n,s,r,a,h,d,c,p=this._getContext();p.font=24/this.camera.getArmLength()+"px arial";var m=.025/this.scale.x,v=.025/this.scale.y,g=5/this.camera.getArmLength(),y=this.camera.getArmRotation().horizontal,b=new u(Math.cos(y),Math.sin(y)),_=this.xRange,w=this.yRange,x=this.zRange;for(p.lineWidth=1,o=void 0===this.defaultXStep,i=new f(_.min,_.max,this.xStep,o),i.start(!0);!i.end();){var k=i.getCurrent();this.showGrid?(t=new l(k,w.min,x.min),e=new l(k,w.max,x.min),this._line3d(p,t,e,this.gridColor)):(t=new l(k,w.min,x.min),e=new l(k,w.min+m,x.min),this._line3d(p,t,e,this.axisColor),t=new l(k,w.max,x.min),e=new l(k,w.max-m,x.min),this._line3d(p,t,e,this.axisColor)),r=b.x>0?w.min:w.max;var O=new l(k,r,x.min),D=" "+this.xValueLabel(k)+" ";this.drawAxisLabelX(p,O,D,y,g),i.next()}for(p.lineWidth=1,o=void 0===this.defaultYStep,i=new f(w.min,w.max,this.yStep,o),i.start(!0);!i.end();){var S=i.getCurrent();this.showGrid?(t=new l(_.min,S,x.min),e=new l(_.max,S,x.min),this._line3d(p,t,e,this.gridColor)):(t=new l(_.min,S,x.min),e=new l(_.min+v,S,x.min),this._line3d(p,t,e,this.axisColor),t=new l(_.max,S,x.min),e=new l(_.max-v,S,x.min),this._line3d(p,t,e,this.axisColor)),s=b.y>0?_.min:_.max,O=new l(s,S,x.min);var D=" "+this.yValueLabel(S)+" ";this.drawAxisLabelY(p,O,D,y,g),i.next()}for(p.lineWidth=1,o=void 0===this.defaultZStep,i=new f(x.min,x.max,this.zStep,o),i.start(!0),s=b.x>0?_.min:_.max,r=b.y<0?w.min:w.max;!i.end();){var M=i.getCurrent(),C=new l(s,r,M),T=this._convert3Dto2D(C);e=new u(T.x-g,T.y),this._line(p,T,e,this.axisColor);var D=this.zValueLabel(M)+" ";this.drawAxisLabelZ(p,C,D,5),i.next()}p.lineWidth=1,t=new l(s,r,x.min),e=new l(s,r,x.max),this._line3d(p,t,e,this.axisColor);var E,P;p.lineWidth=1,E=new l(_.min,w.min,x.min),P=new l(_.max,w.min,x.min),this._line3d(p,E,P,this.axisColor),E=new l(_.min,w.max,x.min),P=new l(_.max,w.max,x.min),this._line3d(p,E,P,this.axisColor),p.lineWidth=1,t=new l(_.min,w.min,x.min),e=new l(_.min,w.max,x.min),this._line3d(p,t,e,this.axisColor),t=new l(_.max,w.min,x.min),e=new l(_.max,w.max,x.min),this._line3d(p,t,e,this.axisColor);var I=this.xLabel;I.length>0&&(c=.1/this.scale.y,s=(_.max+3*_.min)/4,r=b.x>0?w.min-c:w.max+c,n=new l(s,r,x.min),this.drawAxisLabelX(p,n,I,y));var N=this.yLabel;N.length>0&&(d=.1/this.scale.x,s=b.y>0?_.min-d:_.max+d,r=(w.max+3*w.min)/4,n=new l(s,r,x.min),this.drawAxisLabelY(p,n,N,y));var z=this.zLabel;z.length>0&&(h=30,s=b.x>0?_.min:_.max,r=b.y<0?w.min:w.max,a=(x.max+3*x.min)/4,n=new l(s,r,a),this.drawAxisLabelZ(p,n,z,h))},o.prototype._hsv2rgb=function(t,e,i){var o,n,s,r,a,h;switch(r=i*e,a=Math.floor(t/60),h=r*(1-Math.abs(t/60%2-1)),a){case 0:o=r,n=h,s=0;break;case 1:o=h,n=r,s=0;break;case 2:o=0,n=r,s=h;break;case 3:o=0,n=h,s=r;break;case 4:o=h,n=0,s=r;break;case 5:o=r,n=0,s=h;break;default:o=0,n=0,s=0}return"RGB("+parseInt(255*o)+","+parseInt(255*n)+","+parseInt(255*s)+")"},o.prototype._getStrokeWidth=function(t){return void 0!==t?this.showPerspective?1/-t.trans.z*this.dataColor.strokeWidth:-(this.eye.z/this.camera.getArmLength())*this.dataColor.strokeWidth:this.dataColor.strokeWidth},o.prototype._redrawBar=function(t,e,i,o,n,s){var r,a,h=this,d=e.point,u=this.zRange.min,c=[{point:new l(d.x-i,d.y-o,d.z)},{point:new l(d.x+i,d.y-o,d.z)},{point:new l(d.x+i,d.y+o,d.z)},{point:new l(d.x-i,d.y+o,d.z)}],p=[{point:new l(d.x-i,d.y-o,u)},{point:new l(d.x+i,d.y-o,u)},{point:new l(d.x+i,d.y+o,u)},{point:new l(d.x-i,d.y+o,u)}];c.forEach(function(t){t.screen=h._convert3Dto2D(t.point)}),p.forEach(function(t){t.screen=h._convert3Dto2D(t.point)});var f=[{corners:c,center:l.avg(p[0].point,p[2].point)},{corners:[c[0],c[1],p[1],p[0]],center:l.avg(p[1].point,p[0].point)},{corners:[c[1],c[2],p[2],p[1]],center:l.avg(p[2].point,p[1].point)},{corners:[c[2],c[3],p[3],p[2]],center:l.avg(p[3].point,p[2].point)},{corners:[c[3],c[0],p[0],p[3]],center:l.avg(p[0].point,p[3].point)}];for(e.surfaces=f,r=0;r0}if(a){var p,f=(e.point.z+i.point.z+o.point.z+n.point.z)/4,m=240*(1-(f-this.zRange.min)*this.scale.z/this.verticalRatio),v=1;this.showShadow?(p=Math.min(1+u.x/c/2,1),s=this._hsv2rgb(m,v,p),r=s):(p=1,s=this._hsv2rgb(m,v,p),r=this.axisColor)}else s="gray",r=this.axisColor;t.lineWidth=this._getStrokeWidth(e);var g=[e,i,n,o];this._polygon(t,g,s,r)}},o.prototype._drawGridLine=function(t,e,i){if(void 0!==e&&void 0!==i){var o=(e.point.z+i.point.z)/2,n=240*(1-(o-this.zRange.min)*this.scale.z/this.verticalRatio);t.lineWidth=2*this._getStrokeWidth(e),t.strokeStyle=this._hsv2rgb(n,1,1),this._line(t,e.screen,i.screen)}},o.prototype._redrawGridGraphPoint=function(t,e){this._drawGridLine(t,e,e.pointRight),this._drawGridLine(t,e,e.pointTop)},o.prototype._redrawLineGraphPoint=function(t,e){void 0!==e.pointNext&&(t.lineWidth=this._getStrokeWidth(e),t.strokeStyle=this.dataColor.stroke,this._line(t,e.screen,e.pointNext.screen))},o.prototype._redrawDataGraph=function(){var t,e=this._getContext();if(!(void 0===this.dataPoints||this.dataPoints.length<=0))for(this._calcTranslations(this.dataPoints),t=0;t0?1:t<0?-1:0}var o=e[0],n=e[1],s=e[2],r=i((n.x-o.x)*(t.y-o.y)-(n.y-o.y)*(t.x-o.x)),a=i((s.x-n.x)*(t.y-n.y)-(s.y-n.y)*(t.x-n.x)),h=i((o.x-s.x)*(t.y-s.y)-(o.y-s.y)*(t.x-s.x));return!(0!=r&&0!=a&&r!=a||0!=a&&0!=h&&a!=h||0!=r&&0!=h&&r!=h)},o.prototype._dataPointFromXY=function(t,e){var i,n=100,s=null,r=null,a=null,h=new u(t,e);if(this.style===o.STYLE.BAR||this.style===o.STYLE.BARCOLOR||this.style===o.STYLE.BARSIZE)for(i=this.dataPoints.length-1;i>=0;i--){s=this.dataPoints[i];var d=s.surfaces;if(d)for(var l=d.length-1;l>=0;l--){var c=d[l],p=c.corners,f=[p[0].screen,p[1].screen,p[2].screen],m=[p[2].screen,p[3].screen,p[0].screen];if(this._insideTriangle(h,f)||this._insideTriangle(h,m))return s}}else for(i=0;i"+this.xLabel+":"+t.point.x+""+this.yLabel+":"+t.point.y+""+this.zLabel+":"+t.point.z+"",e.style.left="0",e.style.top="0",this.frame.appendChild(e),this.frame.appendChild(i),this.frame.appendChild(o);var n=e.offsetWidth,s=e.offsetHeight,r=i.offsetHeight,a=o.offsetWidth,h=o.offsetHeight,d=t.screen.x-n/2;d=Math.min(Math.max(d,10),this.frame.clientWidth-10-n),i.style.left=t.screen.x+"px",i.style.top=t.screen.y-r+"px",e.style.left=d+"px",e.style.top=t.screen.y-r-s+"px",o.style.left=t.screen.x-a/2+"px",o.style.top=t.screen.y-h/2+"px"},o.prototype._hideTooltip=function(){if(this.tooltip){this.tooltip.dataPoint=null;for(var t in this.tooltip.dom)if(this.tooltip.dom.hasOwnProperty(t)){var e=this.tooltip.dom[t];e&&e.parentNode&&e.parentNode.removeChild(e)}}},o.prototype.setCameraPosition=function(t){v.setCameraPosition(t,this),this.redraw()},o.prototype.setSize=function(t,e){this._setSize(t,e),this.redraw()},t.exports=o},function(t,e){function i(t){if(t)return o(t)}function o(t){for(var e in i.prototype)t[e]=i.prototype[e];return t}t.exports=i,i.prototype.on=i.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks[t]=this._callbacks[t]||[]).push(e),this},i.prototype.once=function(t,e){function i(){o.off(t,i),e.apply(this,arguments)}var o=this;return this._callbacks=this._callbacks||{},i.fn=e,this.on(t,i),this},i.prototype.off=i.prototype.removeListener=i.prototype.removeAllListeners=i.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var i=this._callbacks[t];if(!i)return this;if(1==arguments.length)return delete this._callbacks[t],this;for(var o,n=0;ns&&(t=o(t)*s),i(e)>s&&(e=o(e)*s),this.cameraOffset.x=t,this.cameraOffset.y=e,this.calculateCameraOrientation()},n.prototype.getOffset=function(t,e){return this.cameraOffset},n.prototype.setArmLocation=function(t,e,i){this.armLocation.x=t,this.armLocation.y=e,this.armLocation.z=i,this.calculateCameraOrientation()},n.prototype.setArmRotation=function(t,e){void 0!==t&&(this.armRotation.horizontal=t),void 0!==e&&(this.armRotation.vertical=e,this.armRotation.vertical<0&&(this.armRotation.vertical=0),this.armRotation.vertical>.5*Math.PI&&(this.armRotation.vertical=.5*Math.PI)),void 0===t&&void 0===e||this.calculateCameraOrientation()},n.prototype.getArmRotation=function(){var t={};return t.horizontal=this.armRotation.horizontal,t.vertical=this.armRotation.vertical,t},n.prototype.setArmLength=function(t){void 0!==t&&(this.armLength=t,this.armLength<.71&&(this.armLength=.71),this.armLength>5&&(this.armLength=5),this.setOffset(this.cameraOffset.x,this.cameraOffset.y),this.calculateCameraOrientation())},n.prototype.getArmLength=function(){return this.armLength},n.prototype.getCameraLocation=function(){return this.cameraLocation},n.prototype.getCameraRotation=function(){return this.cameraRotation},n.prototype.calculateCameraOrientation=function(){this.cameraLocation.x=this.armLocation.x-this.armLength*Math.sin(this.armRotation.horizontal)*Math.cos(this.armRotation.vertical),this.cameraLocation.y=this.armLocation.y-this.armLength*Math.cos(this.armRotation.horizontal)*Math.cos(this.armRotation.vertical),this.cameraLocation.z=this.armLocation.z+this.armLength*Math.sin(this.armRotation.vertical),this.cameraRotation.x=Math.PI/2-this.armRotation.vertical,this.cameraRotation.y=0,this.cameraRotation.z=-this.armRotation.horizontal;var t=this.cameraRotation.x,e=(this.cameraRotation.y,this.cameraRotation.z),i=this.cameraOffset.x,o=this.cameraOffset.y,n=Math.sin,s=Math.cos;this.cameraLocation.x=this.cameraLocation.x+i*s(e)+o*-n(e)*s(t),this.cameraLocation.y=this.cameraLocation.y+i*n(e)+o*s(e)*s(t),this.cameraLocation.z=this.cameraLocation.z+o*n(t)},t.exports=n},function(t,e,i){t.exports={default:i(100),__esModule:!0}},function(t,e,i){i(101),t.exports=i(17).Math.sign},function(t,e,i){var o=i(15);o(o.S,"Math",{sign:i(102)})},function(t,e){t.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},function(t,e,i){function o(t,e,i){this.data=t,this.column=e,this.graph=i,this.index=void 0,this.value=void 0,this.values=i.getDistinctValues(t.get(),this.column),this.values.sort(function(t,e){return t>e?1:t0&&this.selectValue(0),this.dataPoints=[],this.loaded=!1,this.onLoadCallback=void 0,i.animationPreload?(this.loaded=!1,this.loadInBackground()):this.loaded=!0}var n=i(93);o.prototype.isLoaded=function(){return this.loaded},o.prototype.getLoadedProgress=function(){for(var t=this.values.length,e=0;this.dataPoints[e];)e++;return Math.round(e/t*100)},o.prototype.getLabel=function(){return this.graph.filterLabel},o.prototype.getColumn=function(){return this.column},o.prototype.getSelectedValue=function(){if(void 0!==this.index)return this.values[this.index]},o.prototype.getValues=function(){return this.values},o.prototype.getValue=function(t){if(t>=this.values.length)throw new Error("Index out of range");return this.values[t]},o.prototype._getDataPoints=function(t){if(void 0===t&&(t=this.index),void 0===t)return[];var e;if(this.dataPoints[t])e=this.dataPoints[t];else{var i={};i.column=this.column,i.value=this.values[t];var o=new n(this.data,{filter:function(t){return t[i.column]==i.value}}).get();e=this.graph._getDataPoints(o),this.dataPoints[t]=e}return e},o.prototype.setOnLoadCallback=function(t){this.onLoadCallback=t},o.prototype.selectValue=function(t){if(t>=this.values.length)throw new Error("Index out of range");this.index=t,this.value=this.values[t]},o.prototype.loadInBackground=function(t){void 0===t&&(t=0);var e=this.graph.frame;if(t0&&(t--,this.setIndex(t))},o.prototype.next=function(){var t=this.getIndex();t0?this.setIndex(0):this.index=void 0},o.prototype.setIndex=function(t){if(!(tthis.values.length-1&&(o=this.values.length-1),o},o.prototype.indexToLeft=function(t){var e=parseFloat(this.frame.bar.style.width)-this.frame.slide.clientWidth-10,i=t/(this.values.length-1)*e,o=i+3;return o},o.prototype._onMouseMove=function(t){var e=t.clientX-this.startClientX,i=this.startSlideX+e,o=this.leftToIndex(i);this.setIndex(o),n.preventDefault()},o.prototype._onMouseUp=function(t){this.frame.style.cursor="auto",n.removeEventListener(document,"mousemove",this.onmousemove),n.removeEventListener(document,"mouseup",this.onmouseup),n.preventDefault()},t.exports=o},function(t,e){function i(t,e,i,o){this._start=0,this._end=0,this._step=1,this.prettyStep=!0,this.precision=5,this._current=0,this.setRange(t,e,i,o)}i.prototype.isNumeric=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},i.prototype.setRange=function(t,e,i,o){if(!this.isNumeric(t))throw new Error("Parameter 'start' is not numeric; value: "+t);if(!this.isNumeric(e))throw new Error("Parameter 'end' is not numeric; value: "+t);if(!this.isNumeric(i))throw new Error("Parameter 'step' is not numeric; value: "+t);this._start=t?t:0,this._end=e?e:0,this.setStep(i,o)},i.prototype.setStep=function(t,e){void 0===t||t<=0||(void 0!==e&&(this.prettyStep=e),this.prettyStep===!0?this._step=i.calculatePrettyStep(t):this._step=t)},i.calculatePrettyStep=function(t){var e=function(t){return Math.log(t)/Math.LN10},i=Math.pow(10,Math.round(e(t))),o=2*Math.pow(10,Math.round(e(t/2))),n=5*Math.pow(10,Math.round(e(t/5))),s=i;return Math.abs(o-t)<=Math.abs(s-t)&&(s=o),Math.abs(n-t)<=Math.abs(s-t)&&(s=n),s<=0&&(s=1),s},i.prototype.getCurrent=function(){return parseFloat(this._current.toPrecision(this.precision))},i.prototype.getStep=function(){return this._step},i.prototype.start=function(t){void 0===t&&(t=!1),this._current=this._start-this._start%this._step,t&&this.getCurrent()this._end},t.exports=i},function(t,e){function i(){this.min=void 0,this.max=void 0}i.prototype.adjust=function(t){void 0!==t&&((void 0===this.min||this.min>t)&&(this.min=t),(void 0===this.max||this.maxi)throw new Error("Passed expansion value makes range invalid");this.min=e,this.max=i}},i.prototype.range=function(){return this.max-this.min},i.prototype.center=function(){return(this.min+this.max)/2},t.exports=i},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}function s(t){return void 0===t||""===t||"string"!=typeof t?t:t.charAt(0).toUpperCase()+t.slice(1)}function r(t,e){return void 0===t||""===t?e:t+s(e)}function a(t,e,i,o){var n,s;for(var a in i)n=i[a],s=r(o,n),e[s]=t[n]}function h(t,e,i,o){var n,s;for(var a in i)n=i[a],void 0!==t[n]&&(s=r(o,n),e[s]=t[n])}function d(t,e){if(void 0===t||n(t))throw new Error("No DEFAULTS passed");if(void 0===e)throw new Error("No dst passed");M=t,a(t,e,D),a(t,e,S,"default"),u(t,e),e.margin=10,e.showGrayBottom=!1,e.showTooltip=!1,e.onclick_callback=null,e.eye=new x(0,0,-1)}function l(t,e){if(void 0!==t){if(void 0===e)throw new Error("No dst passed");if(void 0===M||n(M))throw new Error("DEFAULTS not set for module Settings");h(t,e,D),h(t,e,S,"default"),u(t,e)}}function u(t,e){void 0!==t.backgroundColor&&v(t.backgroundColor,e),g(t.dataColor,e),m(t.style,e),c(t.showLegend,e),y(t.cameraPosition,e),void 0!==t.tooltip&&(e.showTooltip=t.tooltip),void 0!=t.onclick&&(e.onclick_callback=t.onclick)}function c(t,e){if(void 0===t){var i=void 0===M.showLegend;if(i){var o=e.style===k.DOTCOLOR||e.style===k.DOTSIZE;e.showLegend=o}}else e.showLegend=t}function p(t){var e=O[t];return void 0===e?-1:e}function f(t){var e=!1;for(var i in k)if(k[i]===t){e=!0;break}return e}function m(t,e){if(void 0!==t){var i;if("string"==typeof t){if(i=p(t),i===-1)throw new Error("Style '"+t+"' is invalid")}else{if(!f(t))throw new Error("Style '"+t+"' is invalid");i=t}e.style=i}}function v(t,e){var i="white",o="gray",n=1;if("string"==typeof t)i=t,o="none",n=0;else{if("object"!==("undefined"==typeof t?"undefined":(0,_.default)(t)))throw new Error("Unsupported type of backgroundColor");void 0!==t.fill&&(i=t.fill),void 0!==t.stroke&&(o=t.stroke),void 0!==t.strokeWidth&&(n=t.strokeWidth)}e.frame.style.backgroundColor=i,e.frame.style.borderColor=o,e.frame.style.borderWidth=n+"px",e.frame.style.borderStyle="solid"}function g(t,e){void 0!==t&&(void 0===e.dataColor&&(e.dataColor={}),"string"==typeof t?(e.dataColor.fill=t,e.dataColor.stroke=t):(t.fill&&(e.dataColor.fill=t.fill),t.stroke&&(e.dataColor.stroke=t.stroke),void 0!==t.strokeWidth&&(e.dataColor.strokeWidth=t.strokeWidth)))}function y(t,e){var i=t;void 0!==i&&(void 0===e.camera&&(e.camera=new w),e.camera.setArmRotation(i.horizontal,i.vertical),e.camera.setArmLength(i.distance))}var b=i(62),_=o(b),w=i(98),x=i(96),k={BAR:0,BARCOLOR:1,BARSIZE:2,DOT:3,DOTLINE:4,DOTCOLOR:5,DOTSIZE:6,GRID:7,LINE:8,SURFACE:9},O={dot:k.DOT,"dot-line":k.DOTLINE,"dot-color":k.DOTCOLOR,"dot-size":k.DOTSIZE,line:k.LINE,grid:k.GRID,surface:k.SURFACE,bar:k.BAR,"bar-color":k.BARCOLOR,"bar-size":k.BARSIZE},D=["width","height","filterLabel","legendLabel","xLabel","yLabel","zLabel","xValueLabel","yValueLabel","zValueLabel","showGrid","showPerspective","showShadow","keepAspectRatio","verticalRatio","dotSizeRatio","showAnimationControls","animationInterval","animationPreload","animationAutoStart","axisColor","gridColor","xCenter","yCenter"],S=["xBarWidth","yBarWidth","valueMin","valueMax","xMin","xMax","xStep","yMin","yMax","yStep","zMin","zMax","zStep"],M=void 0;t.exports.STYLE=k,t.exports.setDefaults=d,t.exports.setOptions=l,t.exports.setCameraPosition=y},function(t,e,i){if("undefined"!=typeof window){var o=i(109),n=window.Hammer||i(110);t.exports=o(n,{preventDefault:"mouse"})}else t.exports=function(){throw Error("hammer.js is only available in a browser, not in node.js.")}},function(t,e,i){var o,n,s;!function(i){n=[],o=i,s="function"==typeof o?o.apply(e,n):o,!(void 0!==s&&(t.exports=s))}(function(){var t=null;return function e(i,o){function n(t){return t.match(/[^ ]+/g)}function s(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 i=!1;e.stopPropagation=function(){i=!0};var o=e.srcEvent.stopPropagation.bind(e.srcEvent);"function"==typeof o&&(e.srcEvent.stopPropagation=function(){o(),e.stopPropagation()}),e.firstTarget=t;for(var n=t;n&&!i;){var s=n.hammer;if(s)for(var r,a=0;a0?d._handlers[t]=o:(i.off(t,s),delete d._handlers[t]))}),d},d.emit=function(e,o){t=o.target,i.emit(e,o)},d.destroy=function(){var t=i.element.hammer,e=t.indexOf(d);e!==-1&&t.splice(e,1),t.length||delete i.element.hammer,d._handlers={},i.destroy()},d}})},function(t,e,i){var o;!function(n,s,r,a){function h(t,e,i){return setTimeout(p(t,i),e)}function d(t,e,i){return!!Array.isArray(t)&&(l(t,i[e],i),!0)}function l(t,e,i){var o;if(t)if(t.forEach)t.forEach(e,i);else if(t.length!==a)for(o=0;o\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",s=n.console&&(n.console.warn||n.console.log);return s&&s.call(n.console,o,i),t.apply(this,arguments)}}function c(t,e,i){var o,n=e.prototype;o=t.prototype=Object.create(n),o.constructor=t,o._super=n,i&&mt(o,i)}function p(t,e){return function(){return t.apply(e,arguments)}}function f(t,e){return typeof t==yt?t.apply(e?e[0]||a:a,e):t}function m(t,e){return t===a?e:t}function v(t,e,i){l(_(e),function(e){t.addEventListener(e,i,!1)})}function g(t,e,i){l(_(e),function(e){t.removeEventListener(e,i,!1)})}function y(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function b(t,e){return t.indexOf(e)>-1}function _(t){return t.trim().split(/\s+/g)}function w(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var o=0;oi[e]}):o.sort()),o}function O(t,e){for(var i,o,n=e[0].toUpperCase()+e.slice(1),s=0;s1&&!i.firstMultiple?i.firstMultiple=N(e):1===n&&(i.firstMultiple=!1);var s=i.firstInput,r=i.firstMultiple,a=r?r.center:s.center,h=e.center=z(o);e.timeStamp=wt(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=B(a,h),e.distance=A(a,h),P(i,e),e.offsetDirection=L(e.deltaX,e.deltaY);var d=R(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=d.x,e.overallVelocityY=d.y,e.overallVelocity=_t(d.x)>_t(d.y)?d.x:d.y,e.scale=r?H(r.pointers,o):1,e.rotation=r?F(r.pointers,o):0,e.maxPointers=i.prevInput?e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers:e.pointers.length,I(i,e);var l=t.element;y(e.srcEvent.target,l)&&(l=e.srcEvent.target),e.target=l}function P(t,e){var i=e.center,o=t.offsetDelta||{},n=t.prevDelta||{},s=t.prevInput||{};e.eventType!==zt&&s.eventType!==Lt||(n=t.prevDelta={x:s.deltaX||0,y:s.deltaY||0},o=t.offsetDelta={x:i.x,y:i.y}),e.deltaX=n.x+(i.x-o.x),e.deltaY=n.y+(i.y-o.y)}function I(t,e){var i,o,n,s,r=t.lastInterval||e,h=e.timeStamp-r.timeStamp;if(e.eventType!=At&&(h>Nt||r.velocity===a)){var d=e.deltaX-r.deltaX,l=e.deltaY-r.deltaY,u=R(h,d,l);o=u.x,n=u.y,i=_t(u.x)>_t(u.y)?u.x:u.y,s=L(d,l),t.lastInterval=e}else i=r.velocity,o=r.velocityX,n=r.velocityY,s=r.direction;e.velocity=i,e.velocityX=o,e.velocityY=n,e.direction=s}function N(t){for(var e=[],i=0;i=_t(e)?t<0?Ft:Ht:e<0?jt:Wt}function A(t,e,i){i||(i=Ut);var o=e[i[0]]-t[i[0]],n=e[i[1]]-t[i[1]];return Math.sqrt(o*o+n*n)}function B(t,e,i){i||(i=Ut);var o=e[i[0]]-t[i[0]],n=e[i[1]]-t[i[1]];return 180*Math.atan2(n,o)/Math.PI}function F(t,e){return B(e[1],e[0],qt)+B(t[1],t[0],qt)}function H(t,e){return A(e[0],e[1],qt)/A(t[0],t[1],qt)}function j(){this.evEl=Zt,this.evWin=Kt,this.pressed=!1,M.apply(this,arguments)}function W(){this.evEl=$t,this.evWin=te,M.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function Y(){this.evTarget=ie,this.evWin=oe,this.started=!1,M.apply(this,arguments)}function G(t,e){var i=x(t.touches),o=x(t.changedTouches);return e&(Lt|At)&&(i=k(i.concat(o),"identifier",!0)),[i,o]}function V(){this.evTarget=se,this.targetIds={},M.apply(this,arguments)}function U(t,e){var i=x(t.touches),o=this.targetIds;if(e&(zt|Rt)&&1===i.length)return o[i[0].identifier]=!0,[i,i];var n,s,r=x(t.changedTouches),a=[],h=this.target;if(s=i.filter(function(t){return y(t.target,h)}),e===zt)for(n=0;n-1&&o.splice(t,1)};setTimeout(n,re)}}function K(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,o=0;o-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){function e(e){i.manager.emit(e,t)}var i=this,o=this.state;o<_e&&e(i.options.event+et(o)),e(i.options.event),t.additionalEvent&&e(t.additionalEvent),o>=_e&&e(i.options.event+et(o))},tryEmit:function(t){return this.canEmit()?this.emit(t):void(this.state=ke)},canEmit:function(){for(var t=0;te.threshold&&n&e.direction},attrTest:function(t){return nt.prototype.attrTest.call(this,t)&&(this.state&ye||!(this.state&ye)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=it(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),c(rt,nt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[pe]; +},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&ye)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),c(at,tt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ue]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,o=t.distancee.time;if(this._input=t,!o||!i||t.eventType&(Lt|At)&&!n)this.reset();else if(t.eventType&zt)this.reset(),this._timer=h(function(){this.state=we,this.tryEmit()},e.time,this);else if(t.eventType&Lt)return we;return ke},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===we&&(t&&t.eventType&Lt?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=wt(),this.manager.emit(this.options.event,this._input)))}}),c(ht,nt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[pe]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&ye)}}),c(dt,nt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Yt|Gt,pointers:1},getTouchAction:function(){return st.prototype.getTouchAction.call(this)},attrTest:function(t){var e,i=this.options.direction;return i&(Yt|Gt)?e=t.overallVelocity:i&Yt?e=t.overallVelocityX:i&Gt&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&i&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&_t(e)>this.options.velocity&&t.eventType&Lt},emit:function(t){var e=it(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),c(lt,tt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ce]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,o=t.distances)&&(s=i)}),null!==n&&null!==s){var r=(n+s)/2,a=Math.max(this.range.end-this.range.start,1.1*(s-n)),h=!e||void 0===e.animation||e.animation;this.range.setRange(r-a/2,r+a/2,h)}}},n.prototype.fit=function(t){var e,i=!t||void 0===t.animation||t.animation,o=this.itemsData&&this.itemsData.getDataSet();1===o.length&&void 0===o.get()[0].end?(e=this.getDataRange(),this.moveTo(e.min.valueOf(),{animation:i})):(e=this.getItemRange(),this.range.setRange(e.min,e.max,i))},n.prototype.getItemRange=function(){var t=this,e=this.getDataRange(),i=null!==e.min?e.min.valueOf():null,o=null!==e.max?e.max.valueOf():null,n=null,s=null;if(null!=i&&null!=o){var r,a,h,d,u;!function(){var e=function(t){return l.convert(t.data.start,"Date").valueOf()},c=function(t){var e=void 0!=t.data.end?t.data.end:t.data.start;return l.convert(e,"Date").valueOf()};r=o-i,r<=0&&(r=10),a=r/t.props.center.width,l.forEach(t.itemSet.items,function(t){t.groupShowing&&(t.show(),t.repositionX());var r=e(t),h=c(t);if(this.options.rtl)var d=r-(t.getWidthRight()+10)*a,l=h+(t.getWidthLeft()+10)*a;else var d=r-(t.getWidthLeft()+10)*a,l=h+(t.getWidthRight()+10)*a;do&&(o=l,s=t)}.bind(t)),n&&s&&(h=n.getWidthLeft()+10,d=s.getWidthRight()+10,u=t.props.center.width-h-d,u>0&&(t.options.rtl?(i=e(n)-d*r/u,o=c(s)+h*r/u):(i=e(n)-h*r/u,o=c(s)+d*r/u)))}()}return{min:null!=i?new Date(i):null,max:null!=o?new Date(o):null}},n.prototype.getDataRange=function(){var t=null,e=null,i=this.itemsData&&this.itemsData.getDataSet();return i&&i.forEach(function(i){var o=l.convert(i.start,"Date").valueOf(),n=l.convert(void 0!=i.end?i.end:i.start,"Date").valueOf();(null===t||oe)&&(e=n)}),{min:null!=t?new Date(t):null,max:null!=e?new Date(e):null}},n.prototype.getEventProperties=function(t){var e=t.center?t.center.x:t.clientX,i=t.center?t.center.y:t.clientY;if(this.options.rtl)var o=l.getAbsoluteRight(this.dom.centerContainer)-e;else var o=e-l.getAbsoluteLeft(this.dom.centerContainer);var n=i-l.getAbsoluteTop(this.dom.centerContainer),s=this.itemSet.itemFromTarget(t),r=this.itemSet.groupFromTarget(t),a=g.customTimeFromTarget(t),h=this.itemSet.options.snap||null,d=this.body.util.getScale(),u=this.body.util.getStep(),c=this._toTime(o),p=h?h(c,d,u):c,f=l.getTarget(t),m=null;return null!=s?m="item":null!=a?m="custom-time":l.hasParent(f,this.timeAxis.dom.foreground)?m="axis":this.timeAxis2&&l.hasParent(f,this.timeAxis2.dom.foreground)?m="axis":l.hasParent(f,this.itemSet.dom.labelSet)?m="group-label":l.hasParent(f,this.currentTime.bar)?m="current-time":l.hasParent(f,this.dom.center)&&(m="background"),{event:t,item:s?s.id:null,group:r?r.groupId:null,what:m,pageX:t.srcEvent?t.srcEvent.pageX:t.pageX,pageY:t.srcEvent?t.srcEvent.pageY:t.pageY,x:o,y:n,time:c,snappedTime:p}},t.exports=n},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(82),s=o(n),r=i(62),a=o(r),h=i(115),d=o(h),l=i(116),u=o(l),c=i(120),p=o(c),f=i(1),m=function(){function t(e,i,o){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;(0,d.default)(this,t),this.parent=e,this.changedOptions=[],this.container=i,this.allowCreation=!1,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},f.extend(this.options,this.defaultOptions),this.configureOptions=o,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new p.default(n),this.wrapper=void 0}return(0,u.default)(t,[{key:"setOptions",value:function(t){if(void 0!==t){this.popupHistory={},this._removePopup();var e=!0;"string"==typeof t?this.options.filter=t:t instanceof Array?this.options.filter=t.join():"object"===("undefined"==typeof t?"undefined":(0,a.default)(t))?(void 0!==t.container&&(this.options.container=t.container),void 0!==t.filter&&(this.options.filter=t.filter),void 0!==t.showButton&&(this.options.showButton=t.showButton),void 0!==t.enabled&&(e=t.enabled)):"boolean"==typeof t?(this.options.filter=!0,e=t):"function"==typeof t&&(this.options.filter=t,e=!0),this.options.filter===!1&&(e=!1),this.options.enabled=e}this._clean()}},{key:"setModuleOptions",value:function(t){this.moduleOptions=t,this.options.enabled===!0&&(this._clean(),void 0!==this.options.container&&(this.container=this.options.container),this._create())}},{key:"_create",value:function(){var t=this;this._clean(),this.changedOptions=[];var e=this.options.filter,i=0,o=!1;for(var n in this.configureOptions)this.configureOptions.hasOwnProperty(n)&&(this.allowCreation=!1,o=!1,"function"==typeof e?(o=e(n,[]),o=o||this._handleObject(this.configureOptions[n],[n],!0)):e!==!0&&e.indexOf(n)===-1||(o=!0),o!==!1&&(this.allowCreation=!0,i>0&&this._makeItem([]),this._makeHeader(n),this._handleObject(this.configureOptions[n],[n])),i++);this.options.showButton===!0&&!function(){var e=document.createElement("div");e.className="vis-configuration vis-config-button",e.innerHTML="generate options",e.onclick=function(){t._printOptions()},e.onmouseover=function(){e.className="vis-configuration vis-config-button hover"},e.onmouseout=function(){e.className="vis-configuration vis-config-button"},t.optionsContainer=document.createElement("div"),t.optionsContainer.className="vis-configuration vis-config-option-container",t.domElements.push(t.optionsContainer),t.domElements.push(e)}(),this._push()}},{key:"_push",value:function(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(var t=0;t1?o-1:0),s=1;s2&&void 0!==arguments[2]&&arguments[2],o=document.createElement("div");return o.className="vis-configuration vis-config-label vis-config-s"+e.length,i===!0?o.innerHTML=""+t+":":o.innerHTML=t+":",o}},{key:"_makeDropdown",value:function(t,e,i){var o=document.createElement("select");o.className="vis-configuration vis-config-select";var n=0;void 0!==e&&t.indexOf(e)!==-1&&(n=t.indexOf(e));for(var s=0;ss&&1!==s&&(a.max=Math.ceil(e*l),d=a.max,h="range increased"),a.value=e}else a.value=o;var u=document.createElement("input");u.className="vis-configuration vis-config-rangeinput",u.value=a.value;var c=this;a.onchange=function(){u.value=this.value,c._update(Number(this.value),i)},a.oninput=function(){u.value=this.value};var p=this._makeLabel(i[i.length-1],i),f=this._makeItem(i,p,a,u);""!==h&&this.popupHistory[f]!==d&&(this.popupHistory[f]=d,this._setupPopup(h,f))}},{key:"_setupPopup",value:function(t,e){var i=this;if(this.initialized===!0&&this.allowCreation===!0&&this.popupCounter1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=!1,n=this.options.filter,s=!1;for(var r in t)if(t.hasOwnProperty(r)){o=!0;var a=t[r],h=f.copyAndExtendArray(e,r);if("function"==typeof n&&(o=n(r,e),o===!1&&!(a instanceof Array)&&"string"!=typeof a&&"boolean"!=typeof a&&a instanceof Object&&(this.allowCreation=!1,o=this._handleObject(a,h,!0),this.allowCreation=i===!1)),o!==!1){s=!0;var d=this._getValue(h);if(a instanceof Array)this._handleArray(a,d,h);else if("string"==typeof a)this._makeTextInput(a,d,h);else if("boolean"==typeof a)this._makeCheckbox(a,d,h);else if(a instanceof Object){var l=!0;if(e.indexOf("physics")!==-1&&this.moduleOptions.physics.solver!==r&&(l=!1),l===!0)if(void 0!==a.enabled){var u=f.copyAndExtendArray(h,"enabled"),c=this._getValue(u);if(c===!0){var p=this._makeLabel(r,h,!0);this._makeItem(h,p),s=this._handleObject(a,h)||s}else this._makeCheckbox(a,c,h)}else{var m=this._makeLabel(r,h,!0);this._makeItem(h,m),s=this._handleObject(a,h)||s}}else console.error("dont know how to handle",a,r,h)}}return s}},{key:"_handleArray",value:function(t,e,i){"string"==typeof t[0]&&"color"===t[0]?(this._makeColorField(t,e,i),t[1]!==e&&this.changedOptions.push({path:i,value:e})):"string"==typeof t[0]?(this._makeDropdown(t,e,i),t[0]!==e&&this.changedOptions.push({path:i,value:e})):"number"==typeof t[0]&&(this._makeRange(t,e,i),t[0]!==e&&this.changedOptions.push({path:i,value:Number(e)}))}},{key:"_update",value:function(t,e){var i=this._constructOptions(t,e);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(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=i;t="true"===t||t,t="false"!==t&&t;for(var n=0;nvar options = "+(0,s.default)(t,null,2)+""}},{key:"getOptions",value:function(){for(var t={},e=0;e0&&void 0!==arguments[0]?arguments[0]:1;(0,a.default)(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(0,d.default)(t,[{key:"insertTo",value:function(t){void 0!==this.hammer&&(this.hammer.destroy(),this.hammer=void 0),this.container=t,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}},{key:"setUpdateCallback",value:function(t){if("function"!=typeof t)throw new Error("Function attempted to set as colorPicker update callback is not a function.");this.updateCallback=t}},{key:"setCloseCallback",value:function(t){if("function"!=typeof t)throw new Error("Function attempted to set as colorPicker closing callback is not a function.");this.closeCallback=t}},{key:"_isColorString",value:function(t){var e={black:"#000000",navy:"#000080",darkblue:"#00008B",mediumblue:"#0000CD",blue:"#0000FF",darkgreen:"#006400",green:"#008000",teal:"#008080",darkcyan:"#008B8B",deepskyblue:"#00BFFF",darkturquoise:"#00CED1",mediumspringgreen:"#00FA9A",lime:"#00FF00",springgreen:"#00FF7F",aqua:"#00FFFF",cyan:"#00FFFF",midnightblue:"#191970",dodgerblue:"#1E90FF",lightseagreen:"#20B2AA",forestgreen:"#228B22",seagreen:"#2E8B57",darkslategray:"#2F4F4F",limegreen:"#32CD32",mediumseagreen:"#3CB371",turquoise:"#40E0D0",royalblue:"#4169E1",steelblue:"#4682B4",darkslateblue:"#483D8B",mediumturquoise:"#48D1CC",indigo:"#4B0082",darkolivegreen:"#556B2F",cadetblue:"#5F9EA0",cornflowerblue:"#6495ED",mediumaquamarine:"#66CDAA",dimgray:"#696969",slateblue:"#6A5ACD",olivedrab:"#6B8E23",slategray:"#708090",lightslategray:"#778899",mediumslateblue:"#7B68EE",lawngreen:"#7CFC00",chartreuse:"#7FFF00",aquamarine:"#7FFFD4",maroon:"#800000",purple:"#800080",olive:"#808000",gray:"#808080",skyblue:"#87CEEB",lightskyblue:"#87CEFA",blueviolet:"#8A2BE2",darkred:"#8B0000",darkmagenta:"#8B008B",saddlebrown:"#8B4513",darkseagreen:"#8FBC8F",lightgreen:"#90EE90",mediumpurple:"#9370D8",darkviolet:"#9400D3",palegreen:"#98FB98",darkorchid:"#9932CC",yellowgreen:"#9ACD32",sienna:"#A0522D",brown:"#A52A2A",darkgray:"#A9A9A9",lightblue:"#ADD8E6",greenyellow:"#ADFF2F",paleturquoise:"#AFEEEE",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",firebrick:"#B22222",darkgoldenrod:"#B8860B",mediumorchid:"#BA55D3",rosybrown:"#BC8F8F",darkkhaki:"#BDB76B",silver:"#C0C0C0",mediumvioletred:"#C71585",indianred:"#CD5C5C",peru:"#CD853F",chocolate:"#D2691E",tan:"#D2B48C",lightgrey:"#D3D3D3",palevioletred:"#D87093",thistle:"#D8BFD8",orchid:"#DA70D6",goldenrod:"#DAA520",crimson:"#DC143C",gainsboro:"#DCDCDC",plum:"#DDA0DD",burlywood:"#DEB887",lightcyan:"#E0FFFF",lavender:"#E6E6FA",darksalmon:"#E9967A",violet:"#EE82EE",palegoldenrod:"#EEE8AA",lightcoral:"#F08080",khaki:"#F0E68C",aliceblue:"#F0F8FF",honeydew:"#F0FFF0",azure:"#F0FFFF",sandybrown:"#F4A460",wheat:"#F5DEB3",beige:"#F5F5DC",whitesmoke:"#F5F5F5",mintcream:"#F5FFFA",ghostwhite:"#F8F8FF",salmon:"#FA8072",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lightgoldenrodyellow:"#FAFAD2",oldlace:"#FDF5E6",red:"#FF0000",fuchsia:"#FF00FF",magenta:"#FF00FF",deeppink:"#FF1493",orangered:"#FF4500",tomato:"#FF6347",hotpink:"#FF69B4",coral:"#FF7F50",darkorange:"#FF8C00",lightsalmon:"#FFA07A",orange:"#FFA500",lightpink:"#FFB6C1",pink:"#FFC0CB",gold:"#FFD700",peachpuff:"#FFDAB9",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",mistyrose:"#FFE4E1",blanchedalmond:"#FFEBCD",papayawhip:"#FFEFD5",lavenderblush:"#FFF0F5",seashell:"#FFF5EE",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",floralwhite:"#FFFAF0",snow:"#FFFAFA",yellow:"#FFFF00",lightyellow:"#FFFFE0",ivory:"#FFFFF0",white:"#FFFFFF"};if("string"==typeof t)return e[t]}},{key:"setColor",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("none"!==t){var i=void 0,o=this._isColorString(t);if(void 0!==o&&(t=o),c.isString(t)===!0){if(c.isValidRGB(t)===!0){var n=t.substr(4).substr(0,t.length-5).split(",");i={r:n[0],g:n[1],b:n[2],a:1}}else if(c.isValidRGBA(t)===!0){var r=t.substr(5).substr(0,t.length-6).split(",");i={r:r[0],g:r[1],b:r[2],a:r[3]}}else if(c.isValidHex(t)===!0){var a=c.hexToRGB(t);i={r:a.r,g:a.g,b:a.b,a:1}}}else if(t instanceof Object&&void 0!==t.r&&void 0!==t.g&&void 0!==t.b){var h=void 0!==t.a?t.a:"1.0";i={r:t.r,g:t.g,b:t.b,a:h}}if(void 0===i)throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: "+(0, +s.default)(t));this._setColor(i,e)}}},{key:"show",value:function(){void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}},{key:"_hide",value:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e===!0&&(this.previousColor=c.extend({},this.color)),this.applied===!0&&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(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e===!0&&(this.initialColor=c.extend({},t)),this.color=t;var i=c.RGBToHSV(t.r,t.g,t.b),o=2*Math.PI,n=this.r*i.s,s=this.centerCoordinates.x+n*Math.sin(o*i.h),r=this.centerCoordinates.y+n*Math.cos(o*i.h);this.colorPickerSelector.style.left=s-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=r-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(t)}},{key:"_setOpacity",value:function(t){this.color.a=t/100,this._updatePicker(this.color)}},{key:"_setBrightness",value:function(t){var e=c.RGBToHSV(this.color.r,this.color.g,this.color.b);e.v=t/100;var i=c.HSVToRGB(e.h,e.s,e.v);i.a=this.color.a,this.color=i,this._updatePicker()}},{key:"_updatePicker",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color,e=c.RGBToHSV(t.r,t.g,t.b),i=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1)),i.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var o=this.colorPickerCanvas.clientWidth,n=this.colorPickerCanvas.clientHeight;i.clearRect(0,0,o,n),i.putImageData(this.hueCircle,0,0),i.fillStyle="rgba(0,0,0,"+(1-e.v)+")",i.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),i.fill(),this.brightnessRange.value=100*e.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 t=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}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.colorPickerCanvas.appendChild(e)}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(t){}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(t){}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 l(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),u.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(this.generated===!1){var t=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)),t.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var e=this.colorPickerCanvas.clientWidth,i=this.colorPickerCanvas.clientHeight;t.clearRect(0,0,e,i);var o=void 0,n=void 0,s=void 0,r=void 0;this.centerCoordinates={x:.5*e,y:.5*i},this.r=.49*e;var a=2*Math.PI/360,h=1/360,d=1/this.r,l=void 0;for(s=0;s<360;s++)for(r=0;rs.distance?console.log('%cUnknown option detected: "'+e+'" in '+t.printLocation(n.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+t.printLocation(s.path,s.closestMatch,""),g):n.distance<=r?console.log('%cUnknown option detected: "'+e+'". Did you mean "'+n.closestMatch+'"?'+t.printLocation(n.path,e),g):console.log('%cUnknown option detected: "'+e+'". Did you mean one of these: '+t.print((0,d.default)(i))+t.printLocation(o,e),g),m=!0}},{key:"findInOptions",value:function(e,i,o){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=1e9,r="",a=[],h=e.toLowerCase(),d=void 0;for(var l in i){var u=void 0;if(void 0!==i[l].__type__&&n===!0){var c=t.findInOptions(e,i[l],f.copyAndExtendArray(o,l));s>c.distance&&(r=c.closestMatch,a=c.path,s=c.distance,d=c.indexMatch)}else l.toLowerCase().indexOf(h)!==-1&&(d=l),u=t.levenshteinDistance(e,l),s>u&&(r=l,a=f.copyArray(o),s=u)}return{closestMatch:r,path:a,distance:s,indexMatch:d}}},{key:"printLocation",value:function(t,e){for(var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Problem value found at: \n",o="\n\n"+i+"options = {\n",n=0;n1e3&&(i=1e3),e.body.dom.rollingModeBtn.style.visibility="hidden",e.currentTimeTimer=setTimeout(t,i)}var e=this;t()},n.prototype.stopRolling=function(){void 0!==this.currentTimeTimer&&(clearTimeout(this.currentTimeTimer),this.rolling=!1,this.body.dom.rollingModeBtn.style.visibility="visible")},n.prototype.setRange=function(t,e,i,o,n){o!==!0&&(o=!1);var s=void 0!=t?c.convert(t,"Date").valueOf():null,r=void 0!=e?c.convert(e,"Date").valueOf():null;if(this._cancelAnimation(),i){var h=this,l=this.start,p=this.end,f="object"===("undefined"==typeof i?"undefined":(0,u.default)(i))&&"duration"in i?i.duration:500,v="object"===("undefined"==typeof i?"undefined":(0,u.default)(i))&&"easingFunction"in i?i.easingFunction:"easeInOutQuad",g=c.easingFunctions[v];if(!g)throw new Error("Unknown easing function "+(0,d.default)(v)+". Choose from: "+(0,a.default)(c.easingFunctions).join(", "));var y=(new Date).valueOf(),b=!1,_=function t(){if(!h.props.touch.dragging){var e=(new Date).valueOf(),i=e-y,a=g(i/f),d=i>f,u=d||null===s?s:l+(s-l)*a,v=d||null===r?r:p+(r-p)*a;w=h._applyRange(u,v),m.updateHiddenDates(h.options.moment,h.body,h.options.hiddenDates),b=b||w;var _={start:new Date(h.start),end:new Date(h.end),byUser:o,event:c.elementsCensor(n)};w&&h.body.emitter.emit("rangechange",_),d?b&&h.body.emitter.emit("rangechanged",_):h.animationTimer=setTimeout(t,20)}};return _()}var w=this._applyRange(s,r);if(m.updateHiddenDates(this.options.moment,this.body,this.options.hiddenDates),w){var x={start:new Date(this.start),end:new Date(this.end),byUser:o,event:c.elementsCensor(n)};this.body.emitter.emit("rangechange",x),this.body.emitter.emit("rangechanged",x)}},n.prototype._cancelAnimation=function(){this.animationTimer&&(clearTimeout(this.animationTimer),this.animationTimer=null)},n.prototype._applyRange=function(t,e){var i,o=null!=t?c.convert(t,"Date").valueOf():this.start,n=null!=e?c.convert(e,"Date").valueOf():this.end,s=null!=this.options.max?c.convert(this.options.max,"Date").valueOf():null,r=null!=this.options.min?c.convert(this.options.min,"Date").valueOf():null;if(isNaN(o)||null===o)throw new Error('Invalid start "'+t+'"');if(isNaN(n)||null===n)throw new Error('Invalid end "'+e+'"');if(ns&&(n=s)),null!==s&&n>s&&(i=n-s,o-=i,n-=i,null!=r&&othis.start&&nh&&(this.end-this.start===h&&othis.end?(o=this.start,n=this.end):(i=n-o-h,o+=i/2,n-=i/2))}var d=this.start!=o||this.end!=n;return o>=this.start&&o<=this.end||n>=this.start&&n<=this.end||this.start>=o&&this.start<=n||this.end>=o&&this.end<=n||this.body.emitter.emit("checkRangedItems"),this.start=o,this.end=n,d},n.prototype.getRange=function(){return{start:this.start,end:this.end}},n.prototype.conversion=function(t,e){return n.conversion(this.start,this.end,t,e)},n.conversion=function(t,e,i,o){return void 0===o&&(o=0),0!=i&&e-t!=0?{offset:t,scale:i/(e-t-o)}:{offset:0,scale:1}},n.prototype._onDragStart=function(t){this.deltaDifference=0,this.previousDelta=0,this.options.moveable&&this._isInsideRange(t)&&this.props.touch.allowDragging&&(this.stopRolling(),this.props.touch.start=this.start,this.props.touch.end=this.end,this.props.touch.dragging=!0,this.body.dom.root&&(this.body.dom.root.style.cursor="move"))},n.prototype._onDrag=function(t){if(t&&this.props.touch.dragging&&this.options.moveable&&this.props.touch.allowDragging){var e=this.options.direction;s(e);var i="horizontal"==e?t.deltaX:t.deltaY;i-=this.deltaDifference;var o=this.props.touch.end-this.props.touch.start,n=m.getHiddenDurationBetween(this.body.hiddenDates,this.start,this.end);o-=n;var r="horizontal"==e?this.body.domProps.center.width:this.body.domProps.center.height;if(this.options.rtl)var a=i/r*o;else var a=-i/r*o;var h=this.props.touch.start+a,d=this.props.touch.end+a,l=m.snapAwayFromHidden(this.body.hiddenDates,h,this.previousDelta-i,!0),u=m.snapAwayFromHidden(this.body.hiddenDates,d,this.previousDelta-i,!0);if(l!=h||u!=d)return this.deltaDifference+=i,this.props.touch.start=l,this.props.touch.end=u,void this._onDrag(t);this.previousDelta=i,this._applyRange(h,d);var p=new Date(this.start),f=new Date(this.end);this.body.emitter.emit("rangechange",{start:p,end:f,byUser:!0,event:c.elementsCensor(t)}),this.body.emitter.emit("panmove")}},n.prototype._onDragEnd=function(t){this.props.touch.dragging&&this.options.moveable&&this.props.touch.allowDragging&&(this.props.touch.dragging=!1,this.body.dom.root&&(this.body.dom.root.style.cursor="auto"),this.body.emitter.emit("rangechanged",{start:new Date(this.start),end:new Date(this.end),byUser:!0,event:c.elementsCensor(t)}))},n.prototype._onMouseWheel=function(t){var e=0;if(t.wheelDelta?e=t.wheelDelta/120:t.detail&&(e=-t.detail/3),this.options.zoomKey&&!t[this.options.zoomKey]&&this.options.zoomable||!this.options.zoomable&&this.options.moveable){if(this.options.horizontalScroll){t.preventDefault();var i=e*(this.end-this.start)/20,o=this.start-i,n=this.end-i;this.setRange(o,n,!1,!0,t)}}else if(this.options.zoomable&&this.options.moveable&&this._isInsideRange(t)&&e){var s;s=e<0?1-e/5:1/(1+e/5);var r;if(this.rolling)r=(this.start+this.end)/2;else{var a=this.getPointer({x:t.clientX,y:t.clientY},this.body.dom.center);r=this._pointerToDate(a)}this.zoom(s,r,e,t),t.preventDefault()}},n.prototype._onTouch=function(t){this.props.touch.start=this.start,this.props.touch.end=this.end,this.props.touch.allowDragging=!0,this.props.touch.center=null,this.scaleOffset=0,this.deltaDifference=0},n.prototype._onPinch=function(t){if(this.options.zoomable&&this.options.moveable){this.props.touch.allowDragging=!1,this.props.touch.center||(this.props.touch.center=this.getPointer(t.center,this.body.dom.center)),this.stopRolling();var e=1/(t.scale+this.scaleOffset),i=this._pointerToDate(this.props.touch.center),o=m.getHiddenDurationBetween(this.body.hiddenDates,this.start,this.end),n=m.getHiddenDurationBefore(this.options.moment,this.body.hiddenDates,this,i),s=o-n,r=i-n+(this.props.touch.start-(i-n))*e,a=i+s+(this.props.touch.end-(i+s))*e;this.startToFront=1-e<=0,this.endToFront=e-1<=0;var h=m.snapAwayFromHidden(this.body.hiddenDates,r,1-e,!0),d=m.snapAwayFromHidden(this.body.hiddenDates,a,e-1,!0);h==r&&d==a||(this.props.touch.start=h,this.props.touch.end=d,this.scaleOffset=1-t.scale,r=h,a=d),this.setRange(r,a,!1,!0,t),this.startToFront=!1,this.endToFront=!0}},n.prototype._isInsideRange=function(t){var e=t.center?t.center.x:t.clientX;if(this.options.rtl)var i=e-c.getAbsoluteLeft(this.body.dom.centerContainer);else var i=c.getAbsoluteRight(this.body.dom.centerContainer)-e;var o=this.body.util.toTime(i);return o>=this.start&&o<=this.end},n.prototype._pointerToDate=function(t){var e,i=this.options.direction;if(s(i),"horizontal"==i)return this.body.util.toTime(t.x).valueOf();var o=this.body.domProps.center.height;return e=this.conversion(o),t.y/e.scale+e.offset},n.prototype.getPointer=function(t,e){return this.options.rtl?{x:c.getAbsoluteRight(e)-t.x,y:t.y-c.getAbsoluteTop(e)}:{x:t.x-c.getAbsoluteLeft(e),y:t.y-c.getAbsoluteTop(e)}},n.prototype.zoom=function(t,e,i,o){null==e&&(e=(this.start+this.end)/2);var n=m.getHiddenDurationBetween(this.body.hiddenDates,this.start,this.end),s=m.getHiddenDurationBefore(this.options.moment,this.body.hiddenDates,this,e),r=n-s,a=e-s+(this.start-(e-s))*t,h=e+r+(this.end-(e+r))*t;this.startToFront=!(i>0),this.endToFront=!(-i>0);var d=m.snapAwayFromHidden(this.body.hiddenDates,a,i,!0),l=m.snapAwayFromHidden(this.body.hiddenDates,h,-i,!0);d==a&&l==h||(a=d,h=l),this.setRange(a,h,!1,!0,o),this.startToFront=!1,this.endToFront=!0},n.prototype.move=function(t){var e=this.end-this.start,i=this.start+e*t,o=this.end+e*t;this.start=i,this.end=o},n.prototype.moveTo=function(t){var e=(this.start+this.end)/2,i=e-t,o=this.start-i,n=this.end-i;this.setRange(o,n,!1,!0,event)},t.exports=n},function(t,e,i){function o(t,e){this.options=null,this.props=null}var n=i(1);o.prototype.setOptions=function(t){t&&n.extend(this.options,t)},o.prototype.redraw=function(){return!1},o.prototype.destroy=function(){},o.prototype._isResized=function(){var t=this.props._previousWidth!==this.props.width||this.props._previousHeight!==this.props.height;return this.props._previousWidth=this.props.width,this.props._previousHeight=this.props.height,t},t.exports=o},function(t,e){e.convertHiddenOptions=function(t,i,o){if(o&&!Array.isArray(o))return e.convertHiddenOptions(t,i,[o]);if(i.hiddenDates=[],o&&1==Array.isArray(o)){for(var n=0;n=4*a){var c=0,p=s.clone();switch(o[h].repeat){case"daily":d.day()!=l.day()&&(c=1),d.dayOfYear(n.dayOfYear()),d.year(n.year()),d.subtract(7,"days"),l.dayOfYear(n.dayOfYear()),l.year(n.year()),l.subtract(7-c,"days"),p.add(1,"weeks");break;case"weekly":var f=l.diff(d,"days"),m=d.day();d.date(n.date()),d.month(n.month()),d.year(n.year()),l=d.clone(),d.day(m),l.day(m),l.add(f,"days"),d.subtract(1,"weeks"),l.subtract(1,"weeks"),p.add(1,"weeks");break;case"monthly":d.month()!=l.month()&&(c=1),d.month(n.month()),d.year(n.year()),d.subtract(1,"months"),l.month(n.month()),l.year(n.year()),l.subtract(1,"months"),l.add(c,"months"),p.add(1,"months");break;case"yearly":d.year()!=l.year()&&(c=1),d.year(n.year()),d.subtract(1,"years"),l.year(n.year()),l.subtract(1,"years"),l.add(c,"years"),p.add(1,"years");break;default:return void console.log("Wrong repeat format, allowed are: daily, weekly, monthly, yearly. Given:",o[h].repeat)}for(;d=e[o].start&&e[n].end<=e[o].end?e[n].remove=!0:e[n].start>=e[o].start&&e[n].start<=e[o].end?(e[o].end=e[n].end,e[n].remove=!0):e[n].end>=e[o].start&&e[n].end<=e[o].end&&(e[o].start=e[n].start,e[n].remove=!0));for(var o=0;o=r&&nt.range.end){var h={start:t.range.start,end:i};i=e.correctTimeForHidden(t.options.moment,t.body.hiddenDates,h,i);var n=t.range.conversion(o,r);return(i.valueOf()-n.offset)*n.scale}i=e.correctTimeForHidden(t.options.moment,t.body.hiddenDates,t.range,i);var n=t.range.conversion(o,r);return(i.valueOf()-n.offset)*n.scale},e.toTime=function(t,i,o){if(0==t.body.hiddenDates.length){var n=t.range.conversion(o);return new Date(i/n.scale+n.offset)}var s=e.getHiddenDurationBetween(t.body.hiddenDates,t.range.start,t.range.end),r=t.range.end-t.range.start-s,a=r*i/o,h=e.getAccumulatedHiddenDuration(t.body.hiddenDates,t.range,a),d=new Date(h+a+t.range.start);return d},e.getHiddenDurationBetween=function(t,e,i){for(var o=0,n=0;n=e&&r=e&&r<=i&&(o+=r-s)}return o},e.correctTimeForHidden=function(t,i,o,n){return n=t(n).toDate().valueOf(),n-=e.getHiddenDurationBefore(t,i,o,n)},e.getHiddenDurationBefore=function(t,e,i,o){var n=0;o=t(o).toDate().valueOf();for(var s=0;s=i.start&&a=a&&(n+=a-r)}return n},e.getAccumulatedHiddenDuration=function(t,e,i){for(var o=0,n=0,s=e.start,r=0;r=e.start&&h=i)break;o+=h-a}}return o},e.snapAwayFromHidden=function(t,i,o,n){var s=e.isHidden(i,t);return 1==s.hidden?o<0?1==n?s.startDate-(s.endDate-i)-1:s.startDate-1:1==n?s.endDate+(i-s.startDate)+1:s.endDate+1:i},e.isHidden=function(t,e){for(var i=0;i=o&&t-1||h))return t.dataTransfer.dropEffect="move",h=!0,!1}function n(t){try{var e=JSON.parse(t.dataTransfer.getData("text"));if(!e.content)return}catch(t){return!1}return h=!1,t.center={x:t.clientX,y:t.clientY},s.itemSet._onAddItem(t),!1}this.dom={},this.dom.container=t,this.dom.root=document.createElement("div"),this.dom.background=document.createElement("div"),this.dom.backgroundVertical=document.createElement("div"),this.dom.backgroundHorizontal=document.createElement("div"),this.dom.centerContainer=document.createElement("div"),this.dom.leftContainer=document.createElement("div"),this.dom.rightContainer=document.createElement("div"),this.dom.center=document.createElement("div"),this.dom.left=document.createElement("div"),this.dom.right=document.createElement("div"),this.dom.top=document.createElement("div"),this.dom.bottom=document.createElement("div"),this.dom.shadowTop=document.createElement("div"), +this.dom.shadowBottom=document.createElement("div"),this.dom.shadowTopLeft=document.createElement("div"),this.dom.shadowBottomLeft=document.createElement("div"),this.dom.shadowTopRight=document.createElement("div"),this.dom.shadowBottomRight=document.createElement("div"),this.dom.rollingModeBtn=document.createElement("div"),this.dom.root.className="vis-timeline",this.dom.background.className="vis-panel vis-background",this.dom.backgroundVertical.className="vis-panel vis-background vis-vertical",this.dom.backgroundHorizontal.className="vis-panel vis-background vis-horizontal",this.dom.centerContainer.className="vis-panel vis-center",this.dom.leftContainer.className="vis-panel vis-left",this.dom.rightContainer.className="vis-panel vis-right",this.dom.top.className="vis-panel vis-top",this.dom.bottom.className="vis-panel vis-bottom",this.dom.left.className="vis-content",this.dom.center.className="vis-content",this.dom.right.className="vis-content",this.dom.shadowTop.className="vis-shadow vis-top",this.dom.shadowBottom.className="vis-shadow vis-bottom",this.dom.shadowTopLeft.className="vis-shadow vis-top",this.dom.shadowBottomLeft.className="vis-shadow vis-bottom",this.dom.shadowTopRight.className="vis-shadow vis-top",this.dom.shadowBottomRight.className="vis-shadow vis-bottom",this.dom.rollingModeBtn.className="vis-rolling-mode-btn",this.dom.root.appendChild(this.dom.background),this.dom.root.appendChild(this.dom.backgroundVertical),this.dom.root.appendChild(this.dom.backgroundHorizontal),this.dom.root.appendChild(this.dom.centerContainer),this.dom.root.appendChild(this.dom.leftContainer),this.dom.root.appendChild(this.dom.rightContainer),this.dom.root.appendChild(this.dom.top),this.dom.root.appendChild(this.dom.bottom),this.dom.root.appendChild(this.dom.bottom),this.dom.root.appendChild(this.dom.rollingModeBtn),this.dom.centerContainer.appendChild(this.dom.center),this.dom.leftContainer.appendChild(this.dom.left),this.dom.rightContainer.appendChild(this.dom.right),this.dom.centerContainer.appendChild(this.dom.shadowTop),this.dom.centerContainer.appendChild(this.dom.shadowBottom),this.dom.leftContainer.appendChild(this.dom.shadowTopLeft),this.dom.leftContainer.appendChild(this.dom.shadowBottomLeft),this.dom.rightContainer.appendChild(this.dom.shadowTopRight),this.dom.rightContainer.appendChild(this.dom.shadowBottomRight),this.props={root:{},background:{},centerContainer:{},leftContainer:{},rightContainer:{},center:{},left:{},right:{},top:{},bottom:{},border:{},scrollTop:0,scrollTopMin:0},this.on("rangechange",function(){this.initialDrawDone===!0&&this._redraw()}.bind(this)),this.on("touch",this._onTouch.bind(this)),this.on("panmove",this._onDrag.bind(this));var s=this;this._origRedraw=this._redraw.bind(this),this._redraw=c.throttle(this._origRedraw),this.on("_change",function(t){s.itemSet&&s.itemSet.initialItemSetDrawn&&t&&1==t.queue?s._redraw():s._origRedraw()}),this.hammer=new l(this.dom.root);var r=this.hammer.get("pinch").set({enable:!0});u.disablePreventDefaultVertically(r),this.hammer.get("pan").set({threshold:5,direction:l.DIRECTION_HORIZONTAL}),this.listeners={};var a=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];a.forEach(function(t){var e=function(e){s.isActive()&&s.emit(t,e)};s.hammer.on(t,e),s.listeners[t]=e}),u.onTouch(this.hammer,function(t){s.emit("touch",t)}.bind(this)),u.onRelease(this.hammer,function(t){s.emit("release",t)}.bind(this)),this.dom.centerContainer.addEventListener?(this.dom.centerContainer.addEventListener("mousewheel",e.bind(this),!1),this.dom.centerContainer.addEventListener("DOMMouseScroll",e.bind(this),!1)):this.dom.centerContainer.attachEvent("onmousewheel",e.bind(this)),this.dom.left.parentNode.addEventListener("scroll",i.bind(this)),this.dom.right.parentNode.addEventListener("scroll",i.bind(this));var h=!1;if(this.dom.center.addEventListener("dragover",o.bind(this),!1),this.dom.center.addEventListener("drop",n.bind(this),!1),this.customTimes=[],this.touch={},this.redrawCount=0,this.initialDrawDone=!1,!t)throw new Error("No container provided");t.appendChild(this.dom.root)},n.prototype.setOptions=function(t){if(t){var e=["width","height","minHeight","maxHeight","autoResize","start","end","clickToUse","dataAttributes","hiddenDates","locale","locales","moment","rtl","zoomKey","horizontalScroll","verticalScroll"];if(c.selectiveExtend(e,this.options,t),this.dom.rollingModeBtn.style.visibility="hidden",this.options.rtl&&(this.dom.container.style.direction="rtl",this.dom.backgroundVertical.className="vis-panel vis-background vis-vertical-rtl"),this.options.verticalScroll&&(this.options.rtl?this.dom.rightContainer.className="vis-panel vis-right vis-vertical-scroll":this.dom.leftContainer.className="vis-panel vis-left vis-vertical-scroll"),this.options.orientation={item:void 0,axis:void 0},"orientation"in t&&("string"==typeof t.orientation?this.options.orientation={item:t.orientation,axis:t.orientation}:"object"===(0,h.default)(t.orientation)&&("item"in t.orientation&&(this.options.orientation.item=t.orientation.item),"axis"in t.orientation&&(this.options.orientation.axis=t.orientation.axis))),"both"===this.options.orientation.axis){if(!this.timeAxis2){var i=this.timeAxis2=new p(this.body);i.setOptions=function(t){var e=t?c.extend({},t):{};e.orientation="top",p.prototype.setOptions.call(i,e)},this.components.push(i)}}else if(this.timeAxis2){var o=this.components.indexOf(this.timeAxis2);o!==-1&&this.components.splice(o,1),this.timeAxis2.destroy(),this.timeAxis2=null}if("function"==typeof t.drawPoints&&(t.drawPoints={onRender:t.drawPoints}),"hiddenDates"in this.options&&m.convertHiddenOptions(this.options.moment,this.body,this.options.hiddenDates),"clickToUse"in t&&(t.clickToUse?this.activator||(this.activator=new f(this.dom.root)):this.activator&&(this.activator.destroy(),delete this.activator)),"showCustomTime"in t)throw new Error("Option `showCustomTime` is deprecated. Create a custom time bar via timeline.addCustomTime(time [, id])");this._initAutoResize()}if(this.components.forEach(function(e){return e.setOptions(t)}),"configure"in t){this.configurator||(this.configurator=this._createConfigurator()),this.configurator.setOptions(t.configure);var n=c.deepExtend({},this.options);this.components.forEach(function(t){c.deepExtend(n,t.options)}),this.configurator.setModuleOptions({global:n})}this._redraw()},n.prototype.isActive=function(){return!this.activator||this.activator.active},n.prototype.destroy=function(){this.setItems(null),this.setGroups(null),this.off(),this._stopAutoResize(),this.dom.root.parentNode&&this.dom.root.parentNode.removeChild(this.dom.root),this.dom=null,this.activator&&(this.activator.destroy(),delete this.activator);for(var t in this.listeners)this.listeners.hasOwnProperty(t)&&delete this.listeners[t];this.listeners=null,this.hammer=null,this.components.forEach(function(t){return t.destroy()}),this.body=null},n.prototype.setCustomTime=function(t,e){var i=this.customTimes.filter(function(t){return e===t.options.id});if(0===i.length)throw new Error("No custom time bar found with id "+(0,r.default)(e));i.length>0&&i[0].setCustomTime(t)},n.prototype.getCustomTime=function(t){var e=this.customTimes.filter(function(e){return e.options.id===t});if(0===e.length)throw new Error("No custom time bar found with id "+(0,r.default)(t));return e[0].getCustomTime()},n.prototype.setCustomTimeTitle=function(t,e){var i=this.customTimes.filter(function(t){return t.options.id===e});if(0===i.length)throw new Error("No custom time bar found with id "+(0,r.default)(e));if(i.length>0)return i[0].setCustomTitle(t)},n.prototype.getEventProperties=function(t){return{event:t}},n.prototype.addCustomTime=function(t,e){var i=void 0!==t?c.convert(t,"Date").valueOf():new Date,o=this.customTimes.some(function(t){return t.options.id===e});if(o)throw new Error("A custom time with id "+(0,r.default)(e)+" already exists");var n=new v(this.body,c.extend({},this.options,{time:i,id:e}));return this.customTimes.push(n),this.components.push(n),this._redraw(),e},n.prototype.removeCustomTime=function(t){var e=this.customTimes.filter(function(e){return e.options.id===t});if(0===e.length)throw new Error("No custom time bar found with id "+(0,r.default)(t));e.forEach(function(t){this.customTimes.splice(this.customTimes.indexOf(t),1),this.components.splice(this.components.indexOf(t),1),t.destroy()}.bind(this))},n.prototype.getVisibleItems=function(){return this.itemSet&&this.itemSet.getVisibleItems()||[]},n.prototype.fit=function(t){var e=this.getDataRange();if(null!==e.min||null!==e.max){var i=e.max-e.min,o=new Date(e.min.valueOf()-.01*i),n=new Date(e.max.valueOf()+.01*i),s=!t||void 0===t.animation||t.animation;this.range.setRange(o,n,s)}},n.prototype.getDataRange=function(){throw new Error("Cannot invoke abstract method getDataRange")},n.prototype.setWindow=function(t,e,i){var o;if(1==arguments.length){var n=arguments[0];o=void 0===n.animation||n.animation,this.range.setRange(n.start,n.end,o)}else o=!i||void 0===i.animation||i.animation,this.range.setRange(t,e,o)},n.prototype.moveTo=function(t,e){var i=this.range.end-this.range.start,o=c.convert(t,"Date").valueOf(),n=o-i/2,s=o+i/2,r=!e||void 0===e.animation||e.animation;this.range.setRange(n,s,r)},n.prototype.getWindow=function(){var t=this.range.getRange();return{start:new Date(t.start),end:new Date(t.end)}},n.prototype.zoomIn=function(t){if(!(!t||t<0||t>1)){var e=this.getWindow(),i=e.start.valueOf(),o=e.end.valueOf(),n=o-i,s=n/(1+t),r=(n-s)/2,a=i+r,h=o-r;this.setWindow({start:a,end:h})}},n.prototype.zoomOut=function(t){if(!(!t||t<0||t>1)){var e=this.getWindow(),i=e.start.valueOf(),o=e.end.valueOf(),n=o-i,s=i-n*t/2,r=o+n*t/2;this.setWindow({start:s,end:r})}},n.prototype.redraw=function(){this._redraw()},n.prototype._redraw=function(){this.redrawCount++;var t=!1,e=this.options,i=this.props,o=this.dom;if(o&&o.container&&0!=o.root.offsetWidth){m.updateHiddenDates(this.options.moment,this.body,this.options.hiddenDates),"top"==e.orientation?(c.addClassName(o.root,"vis-top"),c.removeClassName(o.root,"vis-bottom")):(c.removeClassName(o.root,"vis-top"),c.addClassName(o.root,"vis-bottom")),o.root.style.maxHeight=c.option.asSize(e.maxHeight,""),o.root.style.minHeight=c.option.asSize(e.minHeight,""),o.root.style.width=c.option.asSize(e.width,""),i.border.left=(o.centerContainer.offsetWidth-o.centerContainer.clientWidth)/2,i.border.right=i.border.left,i.border.top=(o.centerContainer.offsetHeight-o.centerContainer.clientHeight)/2,i.border.bottom=i.border.top,i.borderRootHeight=o.root.offsetHeight-o.root.clientHeight,i.borderRootWidth=o.root.offsetWidth-o.root.clientWidth,0===o.centerContainer.clientHeight&&(i.border.left=i.border.top,i.border.right=i.border.left),0===o.root.clientHeight&&(i.borderRootWidth=i.borderRootHeight),i.center.height=o.center.offsetHeight,i.left.height=o.left.offsetHeight,i.right.height=o.right.offsetHeight,i.top.height=o.top.clientHeight||-i.border.top,i.bottom.height=o.bottom.clientHeight||-i.border.bottom;var n=Math.max(i.left.height,i.center.height,i.right.height),s=i.top.height+n+i.bottom.height+i.borderRootHeight+i.border.top+i.border.bottom;o.root.style.height=c.option.asSize(e.height,s+"px"),i.root.height=o.root.offsetHeight,i.background.height=i.root.height-i.borderRootHeight;var r=i.root.height-i.top.height-i.bottom.height-i.borderRootHeight;i.centerContainer.height=r,i.leftContainer.height=r,i.rightContainer.height=i.leftContainer.height,i.root.width=o.root.offsetWidth,i.background.width=i.root.width-i.borderRootWidth,this.initialDrawDone||(i.scrollbarWidth=c.getScrollBarWidth()),e.verticalScroll?e.rtl?(i.left.width=o.leftContainer.clientWidth||-i.border.left,i.right.width=o.rightContainer.clientWidth+i.scrollbarWidth||-i.border.right):(i.left.width=o.leftContainer.clientWidth+i.scrollbarWidth||-i.border.left,i.right.width=o.rightContainer.clientWidth||-i.border.right):(i.left.width=o.leftContainer.clientWidth||-i.border.left,i.right.width=o.rightContainer.clientWidth||-i.border.right),this._setDOM();var a=this._updateScrollTop();"top"!=e.orientation.item&&(a+=Math.max(i.centerContainer.height-i.center.height-i.border.top-i.border.bottom,0)),o.center.style.top=a+"px";var h=0==i.scrollTop?"hidden":"",d=i.scrollTop==i.scrollTopMin?"hidden":"";o.shadowTop.style.visibility=h,o.shadowBottom.style.visibility=d,o.shadowTopLeft.style.visibility=h,o.shadowBottomLeft.style.visibility=d,o.shadowTopRight.style.visibility=h,o.shadowBottomRight.style.visibility=d,e.verticalScroll&&(o.rightContainer.className="vis-panel vis-right vis-vertical-scroll",o.leftContainer.className="vis-panel vis-left vis-vertical-scroll",o.shadowTopRight.style.visibility="hidden",o.shadowBottomRight.style.visibility="hidden",o.shadowTopLeft.style.visibility="hidden",o.shadowBottomLeft.style.visibility="hidden",o.left.style.top="0px",o.right.style.top="0px"),(!e.verticalScroll||i.center.heighti.centerContainer.height;this.hammer.get("pan").set({direction:u?l.DIRECTION_ALL:l.DIRECTION_HORIZONTAL}),this.components.forEach(function(e){t=e.redraw()||t});var p=5;if(t){if(this.redrawCount0&&(this.props.scrollTop=0),this.props.scrollTope&&o.push(h.id):h.lefti&&o.push(h.id)}return o},n.prototype._deselect=function(t){for(var e=this.selection,i=0,o=e.length;in)return}}if(i&&i!=this.groupTouchParams.group){var h=e.get(i.groupId),d=e.get(this.groupTouchParams.group.groupId);d&&h&&(this.options.groupOrderSwap(d,h,e),e.update(d),e.update(h));var l=e.getIds({order:this.options.groupOrder});if(!c.equalArray(l,this.groupTouchParams.originalOrder))for(var u=this.groupTouchParams.originalOrder,p=this.groupTouchParams.group.groupId,m=Math.min(u.length,l.length),v=0,g=0,y=0;v=m)break;if(l[v+g]!=p)if(u[v+y]!=p){var b=l.indexOf(u[v+y]),_=e.get(l[v+g]),w=e.get(u[v+y]);this.options.groupOrderSwap(_,w,e),e.update(_),e.update(w);var x=l[v+g];l[v+g]=u[v+y],l[b]=x,v++}else y=1;else g=1}}}},n.prototype._onGroupDragEnd=function(t){if(this.options.groupEditable.order&&this.groupTouchParams.group){t.stopPropagation();var e=this,i=e.groupTouchParams.group.groupId,o=e.groupsData.getDataSet(),n=c.extend({},o.get(i));e.options.onMoveGroup(n,function(t){if(t)t[o._fieldId]=i,o.update(t);else{var n=o.getIds({order:e.options.groupOrder});if(!c.equalArray(n,e.groupTouchParams.originalOrder))for(var s=e.groupTouchParams.originalOrder,r=Math.min(s.length,n.length),a=0;a=r)break;var h=n.indexOf(s[a]),d=o.get(n[a]),l=o.get(s[a]);e.options.groupOrderSwap(d,l,o),groupsData.update(d),groupsData.update(l);var u=n[a];n[a]=s[a],n[h]=u,a++}}}),e.body.emitter.emit("groupDragged",{groupId:i})}},n.prototype._onSelectItem=function(t){if(this.options.selectable){var e=t.srcEvent&&(t.srcEvent.ctrlKey||t.srcEvent.metaKey),i=t.srcEvent&&t.srcEvent.shiftKey;if(e||i)return void this._onMultiSelectItem(t);var o=this.getSelection(),n=this.itemFromTarget(t),s=n?[n.id]:[];this.setSelection(s);var r=this.getSelection();(r.length>0||o.length>0)&&this.body.emitter.emit("select",{items:r,event:c.elementsCensor(t)})}},n.prototype._onMouseOver=function(t){var e=this.itemFromTarget(t);if(e){var i=this.itemFromRelatedTarget(t);if(e!==i){if(e.getTitle()){null==e.popup&&e.setPopup(new l.default(this.body.dom.root,this.options.tooltip.overflowMethod||"flip"));var o=this.body.dom.centerContainer;e.popup.setPosition(t.clientX-c.getAbsoluteLeft(o)+o.offsetLeft,t.clientY-c.getAbsoluteTop(o)+o.offsetTop),e.popup.show()}this.body.emitter.emit("itemover",{item:e.id,event:c.elementsCensor(t)})}}},n.prototype._onMouseOut=function(t){var e=this.itemFromTarget(t);if(e){var i=this.itemFromRelatedTarget(t);e!==i&&(null!=e.popup&&e.popup.hide(),this.body.emitter.emit("itemout",{item:e.id,event:c.elementsCensor(t)}))}},n.prototype._onMouseMove=function(t){var e=this.itemFromTarget(t);if(e&&this.options.tooltip.followMouse&&e.popup&&!e.popup.hidden){var i=this.body.dom.centerContainer;e.popup.setPosition(t.clientX-c.getAbsoluteLeft(i)+i.offsetLeft,t.clientY-c.getAbsoluteTop(i)+i.offsetTop),e.popup.show()}},n.prototype._onUpdateItem=function(t){if(this.options.selectable&&this.options.editable.add){var e=this;if(t){var i=e.itemsData.get(t.id);this.options.onUpdate(i,function(t){t&&e.itemsData.getDataSet().update(t)})}}},n.prototype._onAddItem=function(t){if(this.options.selectable&&this.options.editable.add){var e=this,i=this.options.snap||null,o=this.itemFromTarget(t);if(!o){if(this.options.rtl)var n=c.getAbsoluteRight(this.dom.frame),s=n-t.center.x;else var n=c.getAbsoluteLeft(this.dom.frame),s=t.center.x-n;var r=this.body.util.toTime(s),a=this.body.util.getScale(),h=this.body.util.getStep(),d={start:i?i(r,a,h):r,content:"new item"};if("drop"==t.type){var l=JSON.parse(t.dataTransfer.getData("text"));if(d.content=l.content,d.type=l.type||"box",d[this.itemsData._fieldId]=l.id||c.randomUUID(),"range"==l.type||l.end&&l.start)if(l.end)d.end=l.end,d.start=l.start;else{var u=this.body.util.toTime(s+this.props.width/5);d.end=i?i(u,a,h):u}}else if(d[this.itemsData._fieldId]=c.randomUUID(),"range"===this.options.type){var u=this.body.util.toTime(s+this.props.width/5);d.end=i?i(u,a,h):u}var p=this.groupFromTarget(t);p&&(d.group=p.groupId),d=this._cloneItemData(d),this.options.onAdd(d,function(i){i&&(e.itemsData.getDataSet().add(i),"drop"==t.type&&e.setSelection([i.id]))})}}},n.prototype._onMultiSelectItem=function(t){if(this.options.selectable){var e=this.itemFromTarget(t);if(e){var i=this.options.multiselect?this.getSelection():[],o=t.srcEvent&&t.srcEvent.shiftKey||!1;if(o&&this.options.multiselect){var s=this.itemsData.get(e.id).group,r=void 0;this.options.multiselectPerGroup&&i.length>0&&(r=this.itemsData.get(i[0]).group),this.options.multiselectPerGroup&&void 0!=r&&r!=s||i.push(e.id);var a=n._getItemRange(this.itemsData.get(i,this.itemOptions));if(!this.options.multiselectPerGroup||r==s){i=[];for(var h in this.items)if(this.items.hasOwnProperty(h)){var d=this.items[h],l=d.data.start,u=void 0!==d.data.end?d.data.end:l;!(l>=a.min&&u<=a.max)||this.options.multiselectPerGroup&&r!=this.itemsData.get(d.id).group||d instanceof x||i.push(d.id)}}}else{var p=i.indexOf(e.id);p==-1?i.push(e.id):i.splice(p,1)}this.setSelection(i),this.body.emitter.emit("select",{items:this.getSelection(),event:c.elementsCensor(t)})}}},n._getItemRange=function(t){var e=null,i=null;return t.forEach(function(t){(null==i||t.starte)&&(e=t.end):(null==e||t.start>e)&&(e=t.start)}),{min:i,max:e}},n.prototype.itemFromElement=function(t){for(var e=t;e;){if(e.hasOwnProperty("timeline-item"))return e["timeline-item"];e=e.parentNode}return null},n.prototype.itemFromTarget=function(t){return this.itemFromElement(t.target)},n.prototype.itemFromRelatedTarget=function(t){return this.itemFromElement(t.relatedTarget)},n.prototype.groupFromTarget=function(t){for(var e=t.center?t.center.y:t.clientY,i=0;ir&&er)return n}else if(0===i&&en-this.padding&&(a=!0),s=a?this.x-i:this.x,r=h?this.y-e:this.y}else r=this.y-e,r+e+this.padding>o&&(r=o-e-this.padding),rn&&(s=n-i-this.padding),s0&&this.current.milliseconds()0&&this.current.seconds()0&&this.current.minutes()0&&this.current.hours()0?t.step:1,this.autoScale=!1)},o.prototype.setAutoScale=function(t){this.autoScale=t},o.prototype.setMinimumStep=function(t){if(void 0!=t){var e=31104e6,i=2592e6,o=864e5,n=36e5,s=6e4,r=1e3,a=1;1e3*e>t&&(this.scale="year",this.step=1e3),500*e>t&&(this.scale="year",this.step=500),100*e>t&&(this.scale="year",this.step=100),50*e>t&&(this.scale="year",this.step=50),10*e>t&&(this.scale="year",this.step=10),5*e>t&&(this.scale="year",this.step=5),e>t&&(this.scale="year",this.step=1),3*i>t&&(this.scale="month",this.step=3),i>t&&(this.scale="month",this.step=1),5*o>t&&(this.scale="day",this.step=5),2*o>t&&(this.scale="day",this.step=2),o>t&&(this.scale="day",this.step=1),o/2>t&&(this.scale="weekday",this.step=1),4*n>t&&(this.scale="hour",this.step=4),n>t&&(this.scale="hour",this.step=1),15*s>t&&(this.scale="minute",this.step=15),10*s>t&&(this.scale="minute",this.step=10),5*s>t&&(this.scale="minute",this.step=5),s>t&&(this.scale="minute",this.step=1),15*r>t&&(this.scale="second",this.step=15),10*r>t&&(this.scale="second",this.step=10),5*r>t&&(this.scale="second",this.step=5),r>t&&(this.scale="second",this.step=1),200*a>t&&(this.scale="millisecond",this.step=200),100*a>t&&(this.scale="millisecond",this.step=100),50*a>t&&(this.scale="millisecond",this.step=50),10*a>t&&(this.scale="millisecond",this.step=10),5*a>t&&(this.scale="millisecond",this.step=5),a>t&&(this.scale="millisecond",this.step=1)}},o.snap=function(t,e,i){var o=n(t);if("year"==e){var s=o.year()+Math.round(o.month()/12);o.year(Math.round(s/i)*i),o.month(0),o.date(0),o.hours(0),o.minutes(0),o.seconds(0),o.milliseconds(0)}else if("month"==e)o.date()>15?(o.date(1),o.add(1,"month")):o.date(1),o.hours(0),o.minutes(0),o.seconds(0),o.milliseconds(0);else if("day"==e){switch(i){case 5:case 2:o.hours(24*Math.round(o.hours()/24));break;default:o.hours(12*Math.round(o.hours()/12))}o.minutes(0),o.seconds(0),o.milliseconds(0)}else if("weekday"==e){switch(i){case 5:case 2:o.hours(12*Math.round(o.hours()/12));break;default:o.hours(6*Math.round(o.hours()/6))}o.minutes(0),o.seconds(0),o.milliseconds(0)}else if("hour"==e){switch(i){case 4:o.minutes(60*Math.round(o.minutes()/60));break;default:o.minutes(30*Math.round(o.minutes()/30))}o.seconds(0),o.milliseconds(0)}else if("minute"==e){switch(i){case 15:case 10:o.minutes(5*Math.round(o.minutes()/5)),o.seconds(0);break;case 5:o.seconds(60*Math.round(o.seconds()/60));break;default:o.seconds(30*Math.round(o.seconds()/30))}o.milliseconds(0)}else if("second"==e)switch(i){case 15:case 10:o.seconds(5*Math.round(o.seconds()/5)),o.milliseconds(0);break;case 5:o.milliseconds(1e3*Math.round(o.milliseconds()/1e3));break;default:o.milliseconds(500*Math.round(o.milliseconds()/500))}else if("millisecond"==e){var r=i>5?i/2:1;o.milliseconds(Math.round(o.milliseconds()/r)*r)}return o},o.prototype.isMajor=function(){if(1==this.switchedYear)switch(this.scale){case"year":case"month":case"weekday":case"day":case"hour":case"minute":case"second":case"millisecond":return!0;default:return!1}else if(1==this.switchedMonth)switch(this.scale){case"weekday":case"day":case"hour":case"minute":case"second":case"millisecond":return!0;default:return!1}else if(1==this.switchedDay)switch(this.scale){case"millisecond":case"second":case"minute":case"hour":return!0;default:return!1}var t=this.moment(this.current);switch(this.scale){case"millisecond":return 0==t.milliseconds();case"second":return 0==t.seconds();case"minute":return 0==t.hours()&&0==t.minutes();case"hour":return 0==t.hours();case"weekday":case"day":return 1==t.date();case"month":return 0==t.month();case"year":return!1;default:return!1}},o.prototype.getLabelMinor=function(t){if(void 0==t&&(t=this.current),"function"==typeof this.format.minorLabels)return this.format.minorLabels(t,this.scale,this.step);var e=this.format.minorLabels[this.scale];return e&&e.length>0?this.moment(t).format(e):""},o.prototype.getLabelMajor=function(t){if(void 0==t&&(t=this.current),"function"==typeof this.format.majorLabels)return this.format.majorLabels(t,this.scale,this.step);var e=this.format.majorLabels[this.scale];return e&&e.length>0?this.moment(t).format(e):""},o.prototype.getClassName=function(){function t(t){return t/h%2==0?" vis-even":" vis-odd"}function e(t){return t.isSame(new Date,"day")?" vis-today":t.isSame(s().add(1,"day"),"day")?" vis-tomorrow":t.isSame(s().add(-1,"day"),"day")?" vis-yesterday":""}function i(t){return t.isSame(new Date,"week")?" vis-current-week":""}function o(t){return t.isSame(new Date,"month")?" vis-current-month":""}function n(t){return t.isSame(new Date,"year")?" vis-current-year":""}var s=this.moment,r=this.moment(this.current),a=r.locale?r.locale("en"):r.lang("en"),h=this.step;switch(this.scale){case"millisecond":return e(a)+t(a.milliseconds()).trim();case"second":return e(a)+t(a.seconds()).trim();case"minute":return e(a)+t(a.minutes()).trim();case"hour":return"vis-h"+a.hours()+(4==this.step?"-h"+(a.hours()+4):"")+e(a)+t(a.hours());case"weekday":return"vis-"+a.format("dddd").toLowerCase()+e(a)+i(a)+t(a.date());case"day":return"vis-day"+a.date()+" vis-"+a.format("MMMM").toLowerCase()+e(a)+o(a)+(this.step<=2?e(a):"")+(this.step<=2?" vis-"+a.format("dddd").toLowerCase():""+t(a.date()-1));case"month":return"vis-"+a.format("MMMM").toLowerCase()+o(a)+t(a.month());case"year":var d=a.year();return"vis-year"+d+n(a)+t(d);default:return""}},t.exports=o},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e,i){this.groupId=t,this.subgroups={},this.subgroupIndex=0,this.subgroupOrderer=e&&e.subgroupOrder,this.itemSet=i,this.isVisible=null,e&&e.nestedGroups&&(this.nestedGroups=e.nestedGroups,0==e.showNested?this.showNested=!1:this.showNested=!0),this.nestedInGroup=null,this.dom={},this.props={label:{width:0,height:0}},this.className=null,this.items={},this.visibleItems=[],this.itemsInRange=[],this.orderedItems={byStart:[],byEnd:[]},this.checkRangedItems=!1;var o=this;this.itemSet.body.emitter.on("checkRangedItems",function(){o.checkRangedItems=!0}),this._create(),this.setData(e)}var s=i(58),r=o(s),a=i(1),h=i(131);i(132);n.prototype._create=function(){var t=document.createElement("div");this.itemSet.options.groupEditable.order?t.className="vis-label draggable":t.className="vis-label",this.dom.label=t;var e=document.createElement("div");e.className="vis-inner",t.appendChild(e),this.dom.inner=e;var i=document.createElement("div");i.className="vis-group",i["timeline-group"]=this,this.dom.foreground=i,this.dom.background=document.createElement("div"),this.dom.background.className="vis-group",this.dom.axis=document.createElement("div"),this.dom.axis.className="vis-group",this.dom.marker=document.createElement("div"),this.dom.marker.style.visibility="hidden",this.dom.marker.style.position="absolute",this.dom.marker.innerHTML="",this.dom.background.appendChild(this.dom.marker)},n.prototype.setData=function(t){var e,i;if(this.itemSet.options&&this.itemSet.options.groupTemplate?(i=this.itemSet.options.groupTemplate.bind(this),e=i(t,this.dom.inner)):e=t&&t.content,e instanceof Element){for(this.dom.inner.appendChild(e);this.dom.inner.firstChild;)this.dom.inner.removeChild(this.dom.inner.firstChild);this.dom.inner.appendChild(e)}else e instanceof Object?i(t,this.dom.inner):void 0!==e&&null!==e?this.dom.inner.innerHTML=e:this.dom.inner.innerHTML=this.groupId||"";if(this.dom.label.title=t&&t.title||"",this.dom.inner.firstChild?a.removeClassName(this.dom.inner,"vis-hidden"):a.addClassName(this.dom.inner,"vis-hidden"),t&&t.nestedGroups)if(0==t.showNested?this.showNested=!1:this.showNested=!0,a.addClassName(this.dom.label,"vis-nesting-group"),this.showNested)a.removeClassName(this.dom.label,"collapsed"),a.addClassName(this.dom.label,"expanded");else{a.removeClassName(this.dom.label,"expanded");var o=this.itemSet.options.rtl?"collapsed-rtl":"collapsed";a.addClassName(this.dom.label,o)}t&&t.nestedInGroup&&(a.addClassName(this.dom.label,"vis-nested-group"),this.itemSet.options&&this.itemSet.options.rtl?this.dom.inner.style.paddingRight="30px":this.dom.inner.style.paddingLeft="30px");var n=t&&t.className||null;n!=this.className&&(this.className&&(a.removeClassName(this.dom.label,this.className),a.removeClassName(this.dom.foreground,this.className),a.removeClassName(this.dom.background,this.className),a.removeClassName(this.dom.axis,this.className)),a.addClassName(this.dom.label,n),a.addClassName(this.dom.foreground,n),a.addClassName(this.dom.background,n),a.addClassName(this.dom.axis,n),this.className=n),this.style&&(a.removeCssText(this.dom.label,this.style),this.style=null),t&&t.style&&(a.addCssText(this.dom.label,t.style),this.style=t.style)},n.prototype.getLabelWidth=function(){return this.props.label.width},n.prototype.redraw=function(t,e,i){var o=!1,n=this.dom.marker.clientHeight;n!=this.lastMarkerHeight&&(this.lastMarkerHeight=n,a.forEach(this.items,function(t){t.dirty=!0,t.displayed&&t.redraw()}),i=!0),this._calculateSubGroupHeights(e);var s=this.dom.foreground;if(this.top=s.offsetTop,this.right=s.offsetLeft,this.width=s.offsetWidth,this.isVisible=this._isGroupVisible(t,e),"function"==typeof this.itemSet.options.order){if(i){var r=this,d=!1;a.forEach(this.items,function(t){t.displayed||(t.redraw(),r.visibleItems.push(t)),t.repositionX(d)});var l=this.orderedItems.byStart.slice().sort(function(t,e){return r.itemSet.options.order(t.data,e.data)});h.stack(l,e,!0)}this.visibleItems=this._updateItemsInRange(this.orderedItems,this.visibleItems,t)}else this.visibleItems=this._updateItemsInRange(this.orderedItems,this.visibleItems,t),this.itemSet.options.stack?h.stack(this.visibleItems,e,i):h.nostack(this.visibleItems,e,this.subgroups,this.itemSet.options.stackSubgroups);this._updateSubgroupsSizes();var u=this._calculateHeight(e),s=this.dom.foreground;this.top=s.offsetTop,this.right=s.offsetLeft,this.width=s.offsetWidth,o=a.updateProperty(this,"height",u)||o,o=a.updateProperty(this.props.label,"width",this.dom.inner.clientWidth)||o,o=a.updateProperty(this.props.label,"height",this.dom.inner.clientHeight)||o,this.dom.background.style.height=u+"px",this.dom.foreground.style.height=u+"px",this.dom.label.style.height=u+"px";for(var c=0,p=this.visibleItems.length;c0){var e=this;this.resetSubgroups(),a.forEach(this.visibleItems,function(i){void 0!==i.data.subgroup&&(e.subgroups[i.data.subgroup].height=Math.max(e.subgroups[i.data.subgroup].height,i.height+t.item.vertical),e.subgroups[i.data.subgroup].visible=!0)})}},n.prototype._isGroupVisible=function(t,e){var i=this.top<=t.body.domProps.centerContainer.height-t.body.domProps.scrollTop+e.axis&&this.top+this.height+e.axis>=-t.body.domProps.scrollTop;return i},n.prototype._calculateHeight=function(t){var e,i=this.visibleItems;if(i.length>0){var o=i[0].top,n=i[0].top+i[0].height;if(a.forEach(i,function(t){o=Math.min(o,t.top),n=Math.max(n,t.top+t.height)}),o>t.axis){var s=o-t.axis;n-=s,a.forEach(i,function(t){t.top-=s})}e=n+t.item.vertical/2}else e=0;return e=Math.max(e,this.props.label.height)},n.prototype.show=function(){this.dom.label.parentNode||this.itemSet.dom.labelSet.appendChild(this.dom.label),this.dom.foreground.parentNode||this.itemSet.dom.foreground.appendChild(this.dom.foreground),this.dom.background.parentNode||this.itemSet.dom.background.appendChild(this.dom.background),this.dom.axis.parentNode||this.itemSet.dom.axis.appendChild(this.dom.axis)},n.prototype.hide=function(){var t=this.dom.label;t.parentNode&&t.parentNode.removeChild(t);var e=this.dom.foreground;e.parentNode&&e.parentNode.removeChild(e);var i=this.dom.background;i.parentNode&&i.parentNode.removeChild(i);var o=this.dom.axis;o.parentNode&&o.parentNode.removeChild(o)},n.prototype.add=function(t){ +if(this.items[t.id]=t,t.setParent(this),void 0!==t.data.subgroup&&(void 0===this.subgroups[t.data.subgroup]&&(this.subgroups[t.data.subgroup]={height:0,top:0,start:t.data.start,end:t.data.end,visible:!1,index:this.subgroupIndex,items:[]},this.subgroupIndex++),new Date(t.data.start)new Date(this.subgroups[t.data.subgroup].end)&&(this.subgroups[t.data.subgroup].end=t.data.end),this.subgroups[t.data.subgroup].items.push(t)),this.orderSubgroups(),this.visibleItems.indexOf(t)==-1){var e=this.itemSet.body.range;this._checkIfVisible(t,this.visibleItems,e)}},n.prototype._updateSubgroupsSizes=function(){var t=this;if(t.subgroups)for(var e in t.subgroups){var i=t.subgroups[e].items[0].data.start,o=t.subgroups[e].items[0].data.end;t.subgroups[e].items.forEach(function(t){new Date(t.data.start)new Date(o)&&(o=t.data.end)}),t.subgroups[e].start=i,t.subgroups[e].end=o}},n.prototype.orderSubgroups=function(){if(void 0!==this.subgroupOrderer){var t=[];if("string"==typeof this.subgroupOrderer){for(var e in this.subgroups)t.push({subgroup:e,sortField:this.subgroups[e].items[0].data[this.subgroupOrderer]});t.sort(function(t,e){return t.sortField-e.sortField})}else if("function"==typeof this.subgroupOrderer){for(var e in this.subgroups)t.push(this.subgroups[e].items[0].data);t.sort(this.subgroupOrderer)}if(t.length>0)for(var i=0;i0)for(var l=0;lh}),1==this.checkRangedItems)for(this.checkRangedItems=!1,l=0;lh})}for(var l=0;l=0;s--){var r=e[s];if(n(r))break;void 0===o[r.id]&&(o[r.id]=!0,i.push(r))}for(var s=t+1;so[r].index&&e.collisionByTimes(o[n],o[r])){s=o[r];break}null!=s&&(o[n].top=s.top+s.height)}while(s)}for(var a=0;ae.right&&t.top-o.vertical+ie.top:t.left-o.horizontal+ie.left&&t.top-o.vertical+ie.top},e.collisionByTimes=function(t,e){return t.start<=e.start&&t.end>=e.start&&t.tope.top||e.start<=t.start&&e.end>=t.start&&e.topt.top}},function(t,e,i){function o(t,e,i){if(this.props={content:{width:0}},this.overflow=!1,this.options=i,t){if(void 0==t.start)throw new Error('Property "start" missing in item '+t.id);if(void 0==t.end)throw new Error('Property "end" missing in item '+t.id)}n.call(this,t,e,i)}var n=(i(108),i(133));o.prototype=new n(null,null,null),o.prototype.baseClassName="vis-item vis-range",o.prototype.isVisible=function(t){return this.data.startt.start},o.prototype.redraw=function(){var t=this.dom;if(t||(this.dom={},t=this.dom,t.box=document.createElement("div"),t.frame=document.createElement("div"),t.frame.className="vis-item-overflow",t.box.appendChild(t.frame),t.visibleFrame=document.createElement("div"),t.visibleFrame.className="vis-item-visible-frame",t.box.appendChild(t.visibleFrame),t.content=document.createElement("div"),t.content.className="vis-item-content",t.frame.appendChild(t.content),t.box["timeline-item"]=this,this.dirty=!0),!this.parent)throw new Error("Cannot redraw item: no parent attached");if(!t.box.parentNode){var e=this.parent.dom.foreground;if(!e)throw new Error("Cannot redraw item: parent has no foreground container element");e.appendChild(t.box)}if(this.displayed=!0,this.dirty){this._updateContents(this.dom.content),this._updateTitle(),this._updateDataAttributes(this.dom.box),this._updateStyle(this.dom.box);var i=(this.options.editable.updateTime||this.options.editable.updateGroup||this.editable===!0)&&this.editable!==!1,o=(this.data.className?" "+this.data.className:"")+(this.selected?" vis-selected":"")+(i?" vis-editable":" vis-readonly");t.box.className=this.baseClassName+o,this.overflow="hidden"!==window.getComputedStyle(t.frame).overflow,this.dom.content.style.maxWidth="none",this.props.content.width=this.dom.content.offsetWidth,this.height=this.dom.box.offsetHeight,this.dom.content.style.maxWidth="",this.dirty=!1}this._repaintOnItemUpdateTimeTooltip(t.box),this._repaintDeleteButton(t.box),this._repaintDragCenter(),this._repaintDragLeft(),this._repaintDragRight()},o.prototype.show=function(){this.displayed||this.redraw()},o.prototype.hide=function(){if(this.displayed){var t=this.dom.box;t.parentNode&&t.parentNode.removeChild(t),this.displayed=!1}},o.prototype.repositionX=function(t){var e,i,o=this.parent.width,n=this.conversion.toScreen(this.data.start),s=this.conversion.toScreen(this.data.end);void 0!==t&&t!==!0||(n<-o&&(n=-o),s>2*o&&(s=2*o));var r=Math.max(s-n+.5,1);switch(this.overflow?(this.options.rtl?this.right=n:this.left=n,this.width=r+this.props.content.width,i=this.props.content.width):(this.options.rtl?this.right=n:this.left=n,this.width=r,i=Math.min(s-n,this.props.content.width)),this.options.rtl?this.dom.box.style.right=this.right+"px":this.dom.box.style.left=this.left+"px",this.dom.box.style.width=r+"px",this.options.align){case"left":this.options.rtl?this.dom.content.style.right="0":this.dom.content.style.left="0";break;case"right":this.options.rtl?this.dom.content.style.right=Math.max(r-i,0)+"px":this.dom.content.style.left=Math.max(r-i,0)+"px";break;case"center":this.options.rtl?this.dom.content.style.right=Math.max((r-i)/2,0)+"px":this.dom.content.style.left=Math.max((r-i)/2,0)+"px";break;default:e=this.overflow?s>0?Math.max(-n,0):-i:n<0?-n:0,this.options.rtl?this.dom.content.style.right=e+"px":(this.dom.content.style.left=e+"px",this.dom.content.style.width="calc(100% - "+e+"px)")}},o.prototype.repositionY=function(){var t=this.options.orientation.item,e=this.dom.box;"top"==t?e.style.top=this.top+"px":e.style.top=this.parent.height-this.top-this.height+"px"},o.prototype._repaintDragLeft=function(){if(this.selected&&this.options.editable.updateTime&&!this.dom.dragLeft){var t=document.createElement("div");t.className="vis-drag-left",t.dragLeftItem=this,this.dom.box.appendChild(t),this.dom.dragLeft=t}else!this.selected&&this.dom.dragLeft&&(this.dom.dragLeft.parentNode&&this.dom.dragLeft.parentNode.removeChild(this.dom.dragLeft),this.dom.dragLeft=null)},o.prototype._repaintDragRight=function(){if(this.selected&&this.options.editable.updateTime&&!this.dom.dragRight){var t=document.createElement("div");t.className="vis-drag-right",t.dragRightItem=this,this.dom.box.appendChild(t),this.dom.dragRight=t}else!this.selected&&this.dom.dragRight&&(this.dom.dragRight.parentNode&&this.dom.dragRight.parentNode.removeChild(this.dom.dragRight),this.dom.dragRight=null)},t.exports=o},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e,i){this.id=null,this.parent=null,this.data=t,this.dom=null,this.conversion=e||{},this.options=i||{},this.selected=!1,this.displayed=!1,this.groupShowing=!0,this.dirty=!0,this.popup=null,this.top=null,this.right=null,this.left=null,this.width=null,this.height=null,this.editable=null,this.data&&this.data.hasOwnProperty("editable")&&("boolean"==typeof this.data.editable?this.editable={updateTime:this.data.editable,updateGroup:this.data.editable,remove:this.data.editable}:"object"===(0,h.default)(i.editable)&&(this.editable={},l.selectiveExtend(["updateTime","updateGroup","remove"],this.editable,t.editable)))}var s=i(58),r=o(s),a=i(62),h=o(a),d=i(108),l=i(1),u=i(84);n.prototype.stack=!0,n.prototype.select=function(){this.selected=!0,this.dirty=!0,this.displayed&&this.redraw()},n.prototype.unselect=function(){this.selected=!1,this.dirty=!0,this.displayed&&this.redraw()},n.prototype.setData=function(t){var e=void 0!=t.group&&this.data.group!=t.group;e&&this.parent.itemSet._moveToGroup(this,t.group),t.hasOwnProperty("editable")&&("boolean"==typeof t.editable?this.editable={updateTime:this.data.editable,updateGroup:this.data.editable,remove:this.data.editable}:"object"===(0,h.default)(options.editable)&&(this.editable={},l.selectiveExtend(["updateTime","updateGroup","remove"],this.editable,t.editable))),this.data=t,this.dirty=!0,this.displayed&&this.redraw()},n.prototype.setParent=function(t){this.displayed?(this.hide(),this.parent=t,this.parent&&this.show()):this.parent=t},n.prototype.isVisible=function(t){return!1},n.prototype.show=function(){return!1},n.prototype.hide=function(){return!1},n.prototype.redraw=function(){},n.prototype.repositionX=function(){},n.prototype.repositionY=function(){},n.prototype._repaintDragCenter=function(){if(this.selected&&this.options.editable.updateTime&&!this.dom.dragCenter){var t=this,e=document.createElement("div");e.className="vis-drag-center",e.dragCenterItem=this,new d(e).on("doubletap",function(e){e.stopPropagation(),t.parent.itemSet._onUpdateItem(t)}),this.dom.box?this.dom.box.appendChild(e):this.dom.point&&this.dom.point.appendChild(e),this.dom.dragCenter=e}else!this.selected&&this.dom.dragCenter&&(this.dom.dragCenter.parentNode&&this.dom.dragCenter.parentNode.removeChild(this.dom.dragCenter),this.dom.dragCenter=null)},n.prototype._repaintDeleteButton=function(t){var e=(this.options.editable.overrideItems||null==this.editable)&&this.options.editable.remove||!this.options.editable.overrideItems&&null!=this.editable&&this.editable.remove;if(this.selected&&e&&!this.dom.deleteButton){var i=this,o=document.createElement("div");this.options.rtl?o.className="vis-delete-rtl":o.className="vis-delete",o.title="Delete this item",new d(o).on("tap",function(t){t.stopPropagation(),i.parent.removeFromDataSet(i)}),t.appendChild(o),this.dom.deleteButton=o}else!this.selected&&this.dom.deleteButton&&(this.dom.deleteButton.parentNode&&this.dom.deleteButton.parentNode.removeChild(this.dom.deleteButton),this.dom.deleteButton=null)},n.prototype._repaintOnItemUpdateTimeTooltip=function(t){if(this.options.tooltipOnItemUpdateTime){var e=(this.options.editable.updateTime||this.data.editable===!0)&&this.data.editable!==!1;if(this.selected&&e&&!this.dom.onItemUpdateTimeTooltip){var i=document.createElement("div");i.className="vis-onUpdateTime-tooltip",t.appendChild(i),this.dom.onItemUpdateTimeTooltip=i}else!this.selected&&this.dom.onItemUpdateTimeTooltip&&(this.dom.onItemUpdateTimeTooltip.parentNode&&this.dom.onItemUpdateTimeTooltip.parentNode.removeChild(this.dom.onItemUpdateTimeTooltip),this.dom.onItemUpdateTimeTooltip=null);if(this.dom.onItemUpdateTimeTooltip){this.dom.onItemUpdateTimeTooltip.style.visibility=this.parent.itemSet.touchParams.itemIsDragging?"visible":"hidden",this.options.rtl?this.dom.onItemUpdateTimeTooltip.style.right=this.dom.content.style.right:this.dom.onItemUpdateTimeTooltip.style.left=this.dom.content.style.left;var o,n=50,s=this.parent.itemSet.body.domProps.scrollTop;o="top"==this.options.orientation.item?this.top:this.parent.height-this.top-this.height;var r=o+this.parent.top-n<-s;r?(this.dom.onItemUpdateTimeTooltip.style.bottom="",this.dom.onItemUpdateTimeTooltip.style.top=this.height+2+"px"):(this.dom.onItemUpdateTimeTooltip.style.top="",this.dom.onItemUpdateTimeTooltip.style.bottom=this.height+2+"px");var a,h;this.options.tooltipOnItemUpdateTime&&this.options.tooltipOnItemUpdateTime.template?(h=this.options.tooltipOnItemUpdateTime.template.bind(this),a=h(this.data)):(a="start: "+u(this.data.start).format("MM/DD/YYYY hh:mm"),this.data.end&&(a+="
end: "+u(this.data.end).format("MM/DD/YYYY hh:mm"))),this.dom.onItemUpdateTimeTooltip.innerHTML=a}}},n.prototype._updateContents=function(t){var e,i,o,n,s=this.parent.itemSet.itemsData.get(this.id),r=this.dom.box||this.dom.point,a=r.getElementsByClassName("vis-item-visible-frame")[0];if(this.options.visibleFrameTemplate?(n=this.options.visibleFrameTemplate.bind(this),o=n(s,r)):o="",a)if(o instanceof Object&&!(o instanceof Element))n(s,a);else{var h=this._contentToString(this.itemVisibleFrameContent)!==this._contentToString(o);if(h){if(o instanceof Element)a.innerHTML="",a.appendChild(o);else if(void 0!=o)a.innerHTML=o;else if("background"!=this.data.type||void 0!==this.data.content)throw new Error('Property "content" missing in item '+this.id);this.itemVisibleFrameContent=o}}if(this.options.template?(i=this.options.template.bind(this),e=i(s,t)):e=this.data.content,e instanceof Object&&!(e instanceof Element))i(s,t);else{var h=this._contentToString(this.content)!==this._contentToString(e);if(h){if(e instanceof Element)t.innerHTML="",t.appendChild(e);else if(void 0!=e)t.innerHTML=e;else if("background"!=this.data.type||void 0!==this.data.content)throw new Error('Property "content" missing in item '+this.id);this.content=e}}},n.prototype._updateTitle=function(){null!=this.data.title&&null!=this.popup&&this.popup.setText(this.data.title||"")},n.prototype._updateDataAttributes=function(t){if(this.options.dataAttributes&&this.options.dataAttributes.length>0){var e=[];if(Array.isArray(this.options.dataAttributes))e=this.options.dataAttributes;else{if("all"!=this.options.dataAttributes)return;e=(0,r.default)(this.data)}for(var i=0;it.start&&this.data.start.getTime()-nt.start&&this.data.start.getTime()t.start&&this.data.start.getTime()-n/2t.start&&this.data.startt.start},o.prototype.redraw=function(){var t=this.dom;if(t||(this.dom={},t=this.dom,t.box=document.createElement("div"),t.frame=document.createElement("div"),t.frame.className="vis-item-overflow",t.box.appendChild(t.frame),t.content=document.createElement("div"),t.content.className="vis-item-content",t.frame.appendChild(t.content),this.dirty=!0),!this.parent)throw new Error("Cannot redraw item: no parent attached");if(!t.box.parentNode){var e=this.parent.dom.background;if(!e)throw new Error("Cannot redraw item: parent has no background container element");e.appendChild(t.box)}if(this.displayed=!0,this.dirty){this._updateContents(this.dom.content),this._updateTitle(),this._updateDataAttributes(this.dom.content),this._updateStyle(this.dom.box);var i=(this.data.className?" "+this.data.className:"")+(this.selected?" vis-selected":"");t.box.className=this.baseClassName+i,this.overflow="hidden"!==window.getComputedStyle(t.content).overflow,this.props.content.width=this.dom.content.offsetWidth,this.height=0,this.dirty=!1}},o.prototype.show=r.prototype.show,o.prototype.hide=r.prototype.hide,o.prototype.repositionX=r.prototype.repositionX,o.prototype.repositionY=function(t){var e;if(void 0!==this.data.subgroup){var i=this.data.subgroup,o=this.parent.subgroups;o[i].index;this.dom.box.style.height=this.parent.subgroups[i].height+"px";var n=this.options.orientation.item;"top"==n?this.dom.box.style.top=this.parent.top+this.parent.subgroups[i].top+"px":this.dom.box.style.top=this.parent.top+this.parent.height-this.parent.subgroups[i].top-this.parent.subgroups[i].height+"px",this.dom.box.style.bottom=""}else this.parent instanceof s?(e=Math.max(this.parent.height,this.parent.itemSet.body.domProps.center.height,this.parent.itemSet.body.domProps.centerContainer.height),this.dom.box.style.top="top"==n?"0":"",this.dom.box.style.bottom="top"==n?"":"0"):(e=this.parent.height,this.dom.box.style.top=this.parent.top+"px",this.dom.box.style.bottom="");this.dom.box.style.height=e+"px"},t.exports=o},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){this.dom={foreground:null,lines:[],majorTexts:[],minorTexts:[],redundant:{lines:[],majorTexts:[],minorTexts:[]}},this.props={range:{start:0,end:0,minimumStep:0},lineTop:0},this.defaultOptions={orientation:{axis:"bottom"},showMinorLabels:!0,showMajorLabels:!0,maxMinorChars:7,format:d.FORMAT,moment:u,timeAxis:null},this.options=a.extend({},this.defaultOptions),this.body=t,this._create(),this.setOptions(e)}var s=i(62),r=o(s),a=i(1),h=i(124),d=i(129),l=i(125),u=i(84);n.prototype=new h,n.prototype.setOptions=function(t){t&&(a.selectiveExtend(["showMinorLabels","showMajorLabels","maxMinorChars","hiddenDates","timeAxis","moment","rtl"],this.options,t),a.selectiveDeepExtend(["format"],this.options,t),"orientation"in t&&("string"==typeof t.orientation?this.options.orientation.axis=t.orientation:"object"===(0,r.default)(t.orientation)&&"axis"in t.orientation&&(this.options.orientation.axis=t.orientation.axis)),"locale"in t&&("function"==typeof u.locale?u.locale(t.locale):u.lang(t.locale)))},n.prototype._create=function(){this.dom.foreground=document.createElement("div"),this.dom.background=document.createElement("div"),this.dom.foreground.className="vis-time-axis vis-foreground",this.dom.background.className="vis-time-axis vis-background"},n.prototype.destroy=function(){this.dom.foreground.parentNode&&this.dom.foreground.parentNode.removeChild(this.dom.foreground),this.dom.background.parentNode&&this.dom.background.parentNode.removeChild(this.dom.background),this.body=null},n.prototype.redraw=function(){var t=this.props,e=this.dom.foreground,i=this.dom.background,o="top"==this.options.orientation.axis?this.body.dom.top:this.body.dom.bottom,n=e.parentNode!==o;this._calculateCharSize();var s=this.options.showMinorLabels&&"none"!==this.options.orientation.axis,r=this.options.showMajorLabels&&"none"!==this.options.orientation.axis;t.minorLabelHeight=s?t.minorCharHeight:0,t.majorLabelHeight=r?t.majorCharHeight:0,t.height=t.minorLabelHeight+t.majorLabelHeight,t.width=e.offsetWidth,t.minorLineHeight=this.body.domProps.root.height-t.majorLabelHeight-("top"==this.options.orientation.axis?this.body.domProps.bottom.height:this.body.domProps.top.height),t.minorLineWidth=1,t.majorLineHeight=t.minorLineHeight+t.majorLabelHeight,t.majorLineWidth=1;var a=e.nextSibling,h=i.nextSibling;return e.parentNode&&e.parentNode.removeChild(e),i.parentNode&&i.parentNode.removeChild(i),e.style.height=this.props.height+"px",this._repaintLabels(),a?o.insertBefore(e,a):o.appendChild(e),h?this.body.dom.backgroundVertical.insertBefore(i,h):this.body.dom.backgroundVertical.appendChild(i),this._isResized()||n},n.prototype._repaintLabels=function(){var t=this.options.orientation.axis,e=a.convert(this.body.range.start,"Number"),i=a.convert(this.body.range.end,"Number"),o=this.body.util.toTime((this.props.minorCharWidth||10)*this.options.maxMinorChars).valueOf(),n=o-l.getHiddenDurationBefore(this.options.moment,this.body.hiddenDates,this.body.range,o);n-=this.body.util.toTime(0).valueOf();var s=new d(new Date(e),new Date(i),n,this.body.hiddenDates);s.setMoment(this.options.moment),this.options.format&&s.setFormat(this.options.format),this.options.timeAxis&&s.setScale(this.options.timeAxis),this.step=s;var r=this.dom;r.redundant.lines=r.lines,r.redundant.majorTexts=r.majorTexts,r.redundant.minorTexts=r.minorTexts,r.lines=[],r.majorTexts=[],r.minorTexts=[];var h,u,p,f,m,v,g,y,b,_,w=0,x=void 0,k=0,O=1e3;for(s.start(),u=s.getCurrent(),f=this.body.util.toScreen(u);s.hasNext()&&k=.4*g;if(this.options.showMinorLabels&&D){var S=this._repaintMinorText(p,b,t,_);S.style.width=w+"px"}m&&this.options.showMajorLabels?(p>0&&(void 0==x&&(x=p),S=this._repaintMajorText(p,s.getLabelMajor(),t,_)),y=this._repaintMajorLine(p,w,t,_)):D?y=this._repaintMinorLine(p,w,t,_):y&&(y.style.width=parseInt(y.style.width)+w+"px")}if(k!==O||c||(console.warn("Something is wrong with the Timeline scale. Limited drawing of grid lines to "+O+" lines."),c=!0),this.options.showMajorLabels){var M=this.body.util.toTime(0),C=s.getLabelMajor(M),T=C.length*(this.props.majorCharWidth||10)+10;(void 0==x||T1e3&&(o=1e3),e.redraw(),e.body.emitter.emit("currentTimeTick"),e.currentTimeTimer=setTimeout(t,o)}var e=this;t()},o.prototype.stop=function(){void 0!==this.currentTimeTimer&&(clearTimeout(this.currentTimeTimer),delete this.currentTimeTimer)},o.prototype.setCurrentTime=function(t){var e=n.convert(t,"Date").valueOf(),i=(new Date).valueOf();this.offset=e-i,this.redraw()},o.prototype.getCurrentTime=function(){return new Date((new Date).valueOf()+this.offset)},t.exports=o},function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i="string",o="boolean",n="number",s="array",r="date",a="object",h="dom",d="moment",l="any",u={configure:{enabled:{boolean:o},filter:{boolean:o,function:"function"},container:{dom:h},__type__:{object:a,boolean:o,function:"function"}},align:{string:i},rtl:{boolean:o,undefined:"undefined"},rollingMode:{boolean:o,undefined:"undefined"},verticalScroll:{boolean:o,undefined:"undefined"},horizontalScroll:{boolean:o,undefined:"undefined"},autoResize:{boolean:o},throttleRedraw:{number:n},clickToUse:{boolean:o},dataAttributes:{string:i,array:s},editable:{add:{boolean:o,undefined:"undefined"},remove:{boolean:o,undefined:"undefined"},updateGroup:{boolean:o,undefined:"undefined"},updateTime:{boolean:o,undefined:"undefined"},overrideItems:{boolean:o,undefined:"undefined"},__type__:{boolean:o,object:a}},end:{number:n,date:r,string:i,moment:d},format:{minorLabels:{millisecond:{string:i,undefined:"undefined"},second:{string:i,undefined:"undefined"},minute:{string:i,undefined:"undefined"},hour:{string:i,undefined:"undefined"},weekday:{string:i,undefined:"undefined"},day:{string:i,undefined:"undefined"},month:{string:i,undefined:"undefined"},year:{string:i,undefined:"undefined"},__type__:{object:a,function:"function"}},majorLabels:{millisecond:{string:i,undefined:"undefined"},second:{string:i,undefined:"undefined"},minute:{string:i,undefined:"undefined"},hour:{string:i,undefined:"undefined"},weekday:{string:i,undefined:"undefined"},day:{string:i,undefined:"undefined"},month:{string:i,undefined:"undefined"},year:{string:i,undefined:"undefined"},__type__:{object:a,function:"function"}},__type__:{object:a}},moment:{function:"function"},groupOrder:{string:i,function:"function"},groupEditable:{add:{boolean:o,undefined:"undefined"},remove:{boolean:o,undefined:"undefined"},order:{boolean:o,undefined:"undefined"},__type__:{boolean:o,object:a}},groupOrderSwap:{function:"function"},height:{string:i,number:n},hiddenDates:{start:{date:r,number:n,string:i,moment:d},end:{date:r,number:n,string:i,moment:d},repeat:{string:i},__type__:{object:a,array:s}},itemsAlwaysDraggable:{boolean:o},locale:{string:i},locales:{__any__:{any:l},__type__:{object:a}},margin:{axis:{number:n},item:{horizontal:{number:n,undefined:"undefined"},vertical:{number:n,undefined:"undefined"},__type__:{object:a,number:n}},__type__:{object:a,number:n}},max:{date:r,number:n,string:i,moment:d},maxHeight:{number:n,string:i},maxMinorChars:{number:n},min:{date:r,number:n,string:i,moment:d},minHeight:{number:n,string:i},moveable:{boolean:o},multiselect:{boolean:o},multiselectPerGroup:{boolean:o},onAdd:{function:"function"},onUpdate:{function:"function"},onMove:{function:"function"},onMoving:{function:"function"},onRemove:{function:"function"},onAddGroup:{function:"function"},onMoveGroup:{function:"function"},onRemoveGroup:{function:"function"},order:{function:"function"},orientation:{axis:{string:i,undefined:"undefined"},item:{string:i,undefined:"undefined"},__type__:{string:i,object:a}},selectable:{boolean:o},showCurrentTime:{boolean:o},showMajorLabels:{boolean:o},showMinorLabels:{boolean:o},stack:{boolean:o},stackSubgroups:{boolean:o},snap:{function:"function",null:"null"},start:{date:r,number:n,string:i,moment:d},template:{function:"function"},groupTemplate:{function:"function"},visibleFrameTemplate:{string:i,function:"function"},tooltip:{followMouse:{boolean:o},overflowMethod:{string:["cap","flip"]},__type__:{object:a}},tooltipOnItemUpdateTime:{template:{function:"function"},__type__:{boolean:o,object:a}},timeAxis:{scale:{string:i,undefined:"undefined"},step:{number:n,undefined:"undefined"},__type__:{object:a}},type:{string:i},width:{string:i,number:n},zoomable:{boolean:o},zoomKey:{string:["ctrlKey","altKey","metaKey",""]},zoomMax:{number:n},zoomMin:{number:n},__type__:{object:a}},c={global:{align:["center","left","right"],direction:!1,autoResize:!0,clickToUse:!1,editable:{add:!1,remove:!1,updateGroup:!1,updateTime:!1},end:"",format:{minorLabels:{millisecond:"SSS",second:"s",minute:"HH:mm",hour:"HH:mm",weekday:"ddd D",day:"D",month:"MMM",year:"YYYY"},majorLabels:{millisecond:"HH:mm:ss",second:"D MMMM HH:mm",minute:"ddd D MMMM",hour:"ddd D MMMM",weekday:"MMMM YYYY",day:"MMMM YYYY",month:"YYYY",year:""}},groupsDraggable:!1,height:"",locale:"",margin:{axis:[20,0,100,1],item:{horizontal:[10,0,100,1],vertical:[10,0,100,1]}},max:"",maxHeight:"",maxMinorChars:[7,0,20,1],min:"",minHeight:"",moveable:!1,multiselect:!1,multiselectPerGroup:!1,orientation:{axis:["both","bottom","top"],item:["bottom","top"]},selectable:!0,showCurrentTime:!1,showMajorLabels:!0,showMinorLabels:!0,stack:!0,stackSubgroups:!0,start:"",tooltip:{followMouse:!1,overflowMethod:"flip"},tooltipOnItemUpdateTime:!1,type:["box","point","range","background"],width:"100%",zoomable:!0,zoomKey:["ctrlKey","altKey","metaKey",""],zoomMax:[31536e10,10,31536e10,1],zoomMin:[10,10,31536e10,1]}};e.allOptions=u,e.configureOptions=c},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e,i,o){if(!(Array.isArray(i)||i instanceof u||i instanceof c)&&i instanceof Object){var n=o;o=i,i=n}o&&o.throttleRedraw&&console.warn('Graph2d option "throttleRedraw" is DEPRICATED and no longer supported. It will be removed in the next MAJOR release.');var s=this;this.defaultOptions={start:null,end:null,autoResize:!0,orientation:{axis:"bottom",item:"bottom"},moment:d,width:null,height:null,maxHeight:null,minHeight:null},this.options=l.deepExtend({},this.defaultOptions),this._create(t),this.components=[],this.body={dom:this.dom,domProps:this.props,emitter:{on:this.on.bind(this),off:this.off.bind(this),emit:this.emit.bind(this)},hiddenDates:[],util:{toScreen:s._toScreen.bind(s),toGlobalScreen:s._toGlobalScreen.bind(s),toTime:s._toTime.bind(s),toGlobalTime:s._toGlobalTime.bind(s)}},this.range=new p(this.body),this.components.push(this.range),this.body.range=this.range,this.timeAxis=new m(this.body),this.components.push(this.timeAxis),this.currentTime=new v(this.body),this.components.push(this.currentTime),this.linegraph=new y(this.body),this.components.push(this.linegraph),this.itemsData=null,this.groupsData=null,this.on("tap",function(t){s.emit("click",s.getEventProperties(t))}),this.on("doubletap",function(t){s.emit("doubleClick",s.getEventProperties(t))}),this.dom.root.oncontextmenu=function(t){s.emit("contextmenu",s.getEventProperties(t))},o&&this.setOptions(o),i&&this.setGroups(i),e&&this.setItems(e),this._redraw()}var s=i(114),r=o(s),a=i(122),h=o(a),d=(i(95),i(108),i(84)),l=i(1),u=i(91),c=i(93),p=i(123),f=i(126),m=i(138),v=i(142),g=i(140),y=i(145),b=i(122).printStyle,_=i(153).allOptions,w=i(153).configureOptions;n.prototype=new f,n.prototype.setOptions=function(t){var e=h.default.validate(t,_);e===!0&&console.log("%cErrors have been found in the supplied options object.",b),f.prototype.setOptions.call(this,t)},n.prototype.setItems=function(t){var e,i=null==this.itemsData;if(e=t?t instanceof u||t instanceof c?t:new u(t,{type:{start:"Date",end:"Date"}}):null,this.itemsData=e,this.linegraph&&this.linegraph.setItems(e),i)if(void 0!=this.options.start||void 0!=this.options.end){var o=void 0!=this.options.start?this.options.start:null,n=void 0!=this.options.end?this.options.end:null;this.setWindow(o,n,{animation:!1})}else this.fit({animation:!1})},n.prototype.setGroups=function(t){var e;e=t?t instanceof u||t instanceof c?t:new u(t):null,this.groupsData=e,this.linegraph.setGroups(e)},n.prototype.getLegend=function(t,e,i){return void 0===e&&(e=15),void 0===i&&(i=15),void 0!==this.linegraph.groups[t]?this.linegraph.groups[t].getLegend(e,i):"cannot find group:'"+t+"'"},n.prototype.isGroupVisible=function(t){return void 0!==this.linegraph.groups[t]&&(this.linegraph.groups[t].visible&&(void 0===this.linegraph.options.groups.visibility[t]||1==this.linegraph.options.groups.visibility[t]))},n.prototype.getDataRange=function(){var t=null,e=null;for(var i in this.linegraph.groups)if(this.linegraph.groups.hasOwnProperty(i)&&1==this.linegraph.groups[i].visible)for(var o=0;os?s:t,e=null==e?s:e0&&d.push(u.screenToValue(n)),!c.hidden&&this.itemsData.length>0&&d.push(c.screenToValue(n)),{event:t,what:h,pageX:t.srcEvent?t.srcEvent.pageX:t.pageX,pageY:t.srcEvent?t.srcEvent.pageY:t.pageY,x:o,y:n,time:s,value:d}},n.prototype._createConfigurator=function(){return new r.default(this,this.dom.container,w)},t.exports=n},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){this.id=a.randomUUID(),this.body=t,this.defaultOptions={yAxisOrientation:"left",defaultGroup:"default",sort:!0,sampling:!0,stack:!1,graphHeight:"400px",shaded:{enabled:!1,orientation:"bottom"},style:"line",barChart:{width:50,sideBySide:!1,align:"center"},interpolation:{enabled:!0,parametrization:"centripetal",alpha:.5},drawPoints:{enabled:!0,size:6,style:"square"},dataAxis:{},legend:{},groups:{visibility:{}}},this.options=a.extend({},this.defaultOptions),this.dom={},this.props={},this.hammer=null,this.groups={},this.abortedGraphUpdate=!1,this.updateSVGheight=!1,this.updateSVGheightOnResize=!1,this.forceGraphUpdate=!0;var i=this;this.itemsData=null,this.groupsData=null,this.itemListeners={add:function(t,e,o){i._onAdd(e.items)},update:function(t,e,o){i._onUpdate(e.items)},remove:function(t,e,o){i._onRemove(e.items)}},this.groupListeners={add:function(t,e,o){i._onAddGroups(e.items)},update:function(t,e,o){i._onUpdateGroups(e.items)},remove:function(t,e,o){i._onRemoveGroups(e.items)}},this.items={},this.selection=[],this.lastStart=this.body.range.start,this.touchParams={},this.svgElements={},this.setOptions(e),this.groupsUsingDefaultStyles=[0],this.body.emitter.on("rangechanged",function(){i.lastStart=i.body.range.start,i.svg.style.left=a.option.asSize(-i.props.width),i.forceGraphUpdate=!0,i.redraw.call(i)}),this._create(),this.framework={svg:this.svg,svgElements:this.svgElements,options:this.options,groups:this.groups}}var s=i(62),r=o(s),a=i(1),h=i(90),d=i(91),l=i(93),u=i(124),c=i(146),p=i(148),f=i(152),m=i(149),v=i(151),g=i(150),y="__ungrouped__";n.prototype=new u,n.prototype._create=function(){var t=document.createElement("div");t.className="vis-line-graph",this.dom.frame=t,this.svg=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.svg.style.position="relative",this.svg.style.height=(""+this.options.graphHeight).replace("px","")+"px",this.svg.style.display="block",t.appendChild(this.svg),this.options.dataAxis.orientation="left",this.yAxisLeft=new c(this.body,this.options.dataAxis,this.svg,this.options.groups),this.options.dataAxis.orientation="right",this.yAxisRight=new c(this.body,this.options.dataAxis,this.svg,this.options.groups),delete this.options.dataAxis.orientation,this.legendLeft=new f(this.body,this.options.legend,"left",this.options.groups),this.legendRight=new f(this.body,this.options.legend,"right",this.options.groups),this.show()},n.prototype.setOptions=function(t){if(t){var e=["sampling","defaultGroup","stack","height","graphHeight","yAxisOrientation","style","barChart","dataAxis","sort","groups"];void 0===t.graphHeight&&void 0!==t.height?(this.updateSVGheight=!0,this.updateSVGheightOnResize=!0):void 0!==this.body.domProps.centerContainer.height&&void 0!==t.graphHeight&&parseInt((t.graphHeight+"").replace("px",""))0){var a={};for(this._getRelevantData(r,a,n,s),this._applySampling(r,a),e=0;e0)switch(t.options.style){case"line":l.hasOwnProperty(r[e])||(l[r[e]]=v.calcPath(a[r[e]],t)),v.draw(l[r[e]],t,this.framework);case"point":case"points":"point"!=t.options.style&&"points"!=t.options.style&&1!=t.options.drawPoints.enabled||g.draw(a[r[e]],t,this.framework);break;case"bar":}}}return h.cleanupElements(this.svgElements),!1},n.prototype._stack=function(t,e){var i,o,n,s,r;i=0;for(var a=0;at[a].x){r=e[h],s=0==h?r:e[h-1],i=h;break}}void 0===r&&(s=e[e.length-1],r=e[e.length-1]),o=r.x-s.x,n=r.y-s.y,0==o?t[a].y=t[a].orginalY+r.y:t[a].y=t[a].orginalY+n/o*(t[a].x-s.x)+s.y}},n.prototype._getRelevantData=function(t,e,i,o){var n,s,r,h;if(t.length>0)for(s=0;s0)for(var o=0;o0){var s=1,r=n.length,a=this.body.util.toGlobalScreen(n[n.length-1].x)-this.body.util.toGlobalScreen(n[0].x),h=r/a;s=Math.min(Math.ceil(.2*r),Math.max(1,Math.round(h)));for(var d=new Array(r),l=0;l0){for(s=0;s0&&(n=this.groups[t[s]],r.stack===!0&&"bar"===r.style?"left"===r.yAxisOrientation?a=a.concat(n.getItems()):h=h.concat(n.getItems()):i[t[s]]=n.getYRange(o,t[s]));m.getStackedYRange(a,i,t,"__barStackLeft","left"),m.getStackedYRange(h,i,t,"__barStackRight","right")}},n.prototype._updateYAxis=function(t,e){var i,o,n=!1,s=!1,r=!1,a=1e9,h=1e9,d=-1e9,l=-1e9;if(t.length>0){for(var u=0;ui?i:a,d=di?i:h,l=l=0&&t._redrawLabel(o-2,e.val,i,"vis-y-axis vis-major",t.props.majorCharHeight),t.master===!0&&(n?t._redrawLine(o,i,"vis-grid vis-horizontal vis-major",t.options.majorLinesOffset,t.props.majorLineWidth):t._redrawLine(o,i,"vis-grid vis-horizontal vis-minor",t.options.minorLinesOffset,t.props.minorLineWidth))});var a=0;void 0!==this.options[i].title&&void 0!==this.options[i].title.text&&(a=this.props.titleCharHeight);var d=this.options.icons===!0?Math.max(this.options.iconWidth,a)+this.options.labelOffsetX+15:a+this.options.labelOffsetX+15;return this.maxLabelSize>this.width-d&&this.options.visible===!0?(this.width=this.maxLabelSize+d,this.options.width=this.width+"px",h.cleanupElements(this.DOMelements.lines),h.cleanupElements(this.DOMelements.labels),this.redraw(),e=!0):this.maxLabelSizethis.minWidth?(this.width=Math.max(this.minWidth,this.maxLabelSize+d),this.options.width=this.width+"px",h.cleanupElements(this.DOMelements.lines),h.cleanupElements(this.DOMelements.labels),this.redraw(),e=!0):(h.cleanupElements(this.DOMelements.lines),h.cleanupElements(this.DOMelements.labels),e=!1),e},n.prototype.convertValue=function(t){return this.scale.convertValue(t)},n.prototype.screenToValue=function(t){return this.scale.screenToValue(t)},n.prototype._redrawLabel=function(t,e,i,o,n){var s=h.getDOMElement("div",this.DOMelements.labels,this.dom.frame);s.className=o,s.innerHTML=e,"left"===i?(s.style.left="-"+this.options.labelOffsetX+"px",s.style.textAlign="right"):(s.style.right="-"+this.options.labelOffsetX+"px",s.style.textAlign="left"),s.style.top=t-.5*n+this.options.labelOffsetY+"px",e+="";var r=Math.max(this.props.majorCharWidth,this.props.minorCharWidth);this.maxLabelSize6&&void 0!==arguments[6]&&arguments[6],a=arguments.length>7&&void 0!==arguments[7]&&arguments[7];if(this.majorSteps=[1,2,5,10],this.minorSteps=[.25,.5,1,2],this.customLines=null,this.containerHeight=n,this.majorCharHeight=s,this._start=t,this._end=e,this.scale=1,this.minorStepIdx=-1,this.magnitudefactor=1,this.determineScale(),this.zeroAlign=r,this.autoScaleStart=i,this.autoScaleEnd=o,this.formattingFunction=a,i||o){var h=this,d=function(t){var e=t-t%(h.magnitudefactor*h.minorSteps[h.minorStepIdx]);return t%(h.magnitudefactor*h.minorSteps[h.minorStepIdx])>.5*(h.magnitudefactor*h.minorSteps[h.minorStepIdx])?e+h.magnitudefactor*h.minorSteps[h.minorStepIdx]:e};i&&(this._start-=2*this.magnitudefactor*this.minorSteps[this.minorStepIdx],this._start=d(this._start)),o&&(this._end+=this.magnitudefactor*this.minorSteps[this.minorStepIdx],this._end=d(this._end)),this.determineScale()}}i.prototype.setCharHeight=function(t){this.majorCharHeight=t},i.prototype.setHeight=function(t){this.containerHeight=t},i.prototype.determineScale=function(){var t=this._end-this._start;this.scale=this.containerHeight/t;var e=this.majorCharHeight/this.scale,i=t>0?Math.round(Math.log(t)/Math.LN10):0;this.minorStepIdx=-1,this.magnitudefactor=Math.pow(10,i);var o=0;i<0&&(o=i);for(var n=!1,s=o;Math.abs(s)<=Math.abs(i);s++){this.magnitudefactor=Math.pow(10,s);for(var r=0;r=e){n=!0,this.minorStepIdx=r;break}}if(n===!0)break}},i.prototype.is_major=function(t){return t%(this.magnitudefactor*this.majorSteps[this.minorStepIdx])===0},i.prototype.getStep=function(){return this.magnitudefactor*this.minorSteps[this.minorStepIdx]},i.prototype.getFirstMajor=function(){var t=this.magnitudefactor*this.majorSteps[this.minorStepIdx];return this.convertValue(this._start+(t-this._start%t)%t)},i.prototype.formatValue=function(t){var e=t.toPrecision(5);return"function"==typeof this.formattingFunction&&(e=this.formattingFunction(t)),"number"==typeof e?""+e:"string"==typeof e?e:t.toPrecision(5)},i.prototype.getLines=function(){for(var t=[],e=this.getStep(),i=(e-this._start%e)%e,o=this._start+i;this._end-o>1e-5;o+=e)o!=this._start&&t.push({major:this.is_major(o),y:this.convertValue(o),val:this.formatValue(o)});return t},i.prototype.followScale=function(t){var e=this.minorStepIdx,i=this._start,o=this._end,n=this,s=function(){n.magnitudefactor*=2},r=function(){n.magnitudefactor/=2};t.minorStepIdx<=1&&this.minorStepIdx<=1||t.minorStepIdx>1&&this.minorStepIdx>1||(t.minorStepIdxo+1e-5)r(),d=!1;else{if(!this.autoScaleStart&&this._start=0)){r(),d=!1;continue}console.warn("Can't adhere to given 'min' range, due to zeroalign")}this.autoScaleStart&&this.autoScaleEnd&&ue.x?1:-1})):this.itemsData=[]},n.prototype.getItems=function(){return this.itemsData},n.prototype.setZeroPosition=function(t){this.zeroPosition=t},n.prototype.setOptions=function(t){if(void 0!==t){var e=["sampling","style","sort","yAxisOrientation","barChart","zIndex","excludeFromStacking","excludeFromLegend"];a.selectiveDeepExtend(e,this.options,t),"function"==typeof t.drawPoints&&(t.drawPoints={onRender:t.drawPoints}),a.mergeOptions(this.options,t,"interpolation"),a.mergeOptions(this.options,t,"drawPoints"),a.mergeOptions(this.options,t,"shaded"),t.interpolation&&"object"==(0,r.default)(t.interpolation)&&t.interpolation.parametrization&&("uniform"==t.interpolation.parametrization?this.options.interpolation.alpha=0:"chordal"==t.interpolation.parametrization?this.options.interpolation.alpha=1:(this.options.interpolation.parametrization="centripetal",this.options.interpolation.alpha=.5))}},n.prototype.update=function(t){this.group=t,this.content=t.content||"graph",this.className=t.className||this.className||"vis-graph-group"+this.groupsUsingDefaultStyles[0]%10,this.visible=void 0===t.visible||t.visible,this.style=t.style,this.setOptions(t.options)},n.prototype.getLegend=function(t,e,i,o,n){if(void 0==i||null==i){var s=document.createElementNS("http://www.w3.org/2000/svg","svg");i={svg:s,svgElements:{},options:this.options,groups:[this]}}switch(void 0!=o&&null!=o||(o=0),void 0!=n&&null!=n||(n=.5*e),this.options.style){case"line":d.drawIcon(this,o,n,t,e,i);break;case"points":case"point":l.drawIcon(this,o,n,t,e,i);break;case"bar":h.drawIcon(this,o,n,t,e,i)}return{icon:i.svg,label:this.content,orientation:this.options.yAxisOrientation}},n.prototype.getYRange=function(t){for(var e=t[0].y,i=t[0].y,o=0;ot[o].y?t[o].y:e,i=i0&&(i=Math.min(i,Math.abs(e[o-1].screen_x-e[o].screen_x))),0===i&&(void 0===t[e[o].screen_x]&&(t[e[o].screen_x]={amount:0,resolved:0,accumulatedPositive:0,accumulatedNegative:0}),t[e[o].screen_x].amount+=1)},o._getSafeDrawData=function(t,e,i){var o,n;return t0?(o=t0){t.sort(function(t,e){return t.screen_x===e.screen_x?t.groupIde[s].screen_y?e[s].screen_y:o,n=nt[r].accumulatedNegative?t[r].accumulatedNegative:o,o=o>t[r].accumulatedPositive?t[r].accumulatedPositive:o,n=n0){var i=[];return i=1==e.options.interpolation.enabled?o._catmullRom(t,e):o._linear(t)}},o.drawIcon=function(t,e,i,o,s,r){var a,h,d=.5*s,l=n.getSVGElement("rect",r.svgElements,r.svg);if(l.setAttributeNS(null,"x",e),l.setAttributeNS(null,"y",i-d),l.setAttributeNS(null,"width",o),l.setAttributeNS(null,"height",2*d),l.setAttributeNS(null,"class","vis-outline"),a=n.getSVGElement("path",r.svgElements,r.svg),a.setAttributeNS(null,"class",t.className),void 0!==t.style&&a.setAttributeNS(null,"style",t.style),a.setAttributeNS(null,"d","M"+e+","+i+" L"+(e+o)+","+i),1==t.options.shaded.enabled&&(h=n.getSVGElement("path",r.svgElements,r.svg),"top"==t.options.shaded.orientation?h.setAttributeNS(null,"d","M"+e+", "+(i-d)+"L"+e+","+i+" L"+(e+o)+","+i+" L"+(e+o)+","+(i-d)):h.setAttributeNS(null,"d","M"+e+","+i+" L"+e+","+(i+d)+" L"+(e+o)+","+(i+d)+"L"+(e+o)+","+i),h.setAttributeNS(null,"class",t.className+" vis-icon-fill"),void 0!==t.options.shaded.style&&""!==t.options.shaded.style&&h.setAttributeNS(null,"style",t.options.shaded.style)),1==t.options.drawPoints.enabled){var u={style:t.options.drawPoints.style,styles:t.options.drawPoints.styles,size:t.options.drawPoints.size,className:t.className};n.drawPoint(e+.5*o,i,u,r.svgElements,r.svg)}},o.drawShading=function(t,e,i,o){if(1==e.options.shaded.enabled){var s=Number(o.svg.style.height.replace("px","")),r=n.getSVGElement("path",o.svgElements,o.svg),a="L";1==e.options.interpolation.enabled&&(a="C");var h,d=0;d="top"==e.options.shaded.orientation?0:"bottom"==e.options.shaded.orientation?s:Math.min(Math.max(0,e.zeroPosition),s),h="group"==e.options.shaded.orientation&&null!=i&&void 0!=i?"M"+t[0][0]+","+t[0][1]+" "+this.serializePath(t,a,!1)+" L"+i[i.length-1][0]+","+i[i.length-1][1]+" "+this.serializePath(i,a,!0)+i[0][0]+","+i[0][1]+" Z":"M"+t[0][0]+","+t[0][1]+" "+this.serializePath(t,a,!1)+" V"+d+" H"+t[0][0]+" Z",r.setAttributeNS(null,"class",e.className+" vis-fill"),void 0!==e.options.shaded.style&&r.setAttributeNS(null,"style",e.options.shaded.style),r.setAttributeNS(null,"d",h)}},o.draw=function(t,e,i){if(null!=t&&void 0!=t){var o=n.getSVGElement("path",i.svgElements,i.svg);o.setAttributeNS(null,"class",e.className),void 0!==e.style&&o.setAttributeNS(null,"style",e.style);var s="L";1==e.options.interpolation.enabled&&(s="C"),o.setAttributeNS(null,"d","M"+t[0][0]+","+t[0][1]+" "+this.serializePath(t,s,!1))}},o.serializePath=function(t,e,i){if(t.length<2)return"";var o=e;if(i)for(var n=t.length-2;n>0;n--)o+=t[n][0]+","+t[n][1]+" ";else for(var n=1;n0&&(f=1/f),m=3*v*(v+g),m>0&&(m=1/m),a={screen_x:(-b*o.screen_x+c*n.screen_x+_*s.screen_x)*f,screen_y:(-b*o.screen_y+c*n.screen_y+_*s.screen_y)*f},h={screen_x:(y*n.screen_x+p*s.screen_x-b*r.screen_x)*m,screen_y:(y*n.screen_y+p*s.screen_y-b*r.screen_y)*m},0==a.screen_x&&0==a.screen_y&&(a=n),0==h.screen_x&&0==h.screen_y&&(h=s),x.push([a.screen_x,a.screen_y]),x.push([h.screen_x,h.screen_y]),x.push([s.screen_x,s.screen_y]);return x},o._linear=function(t){for(var e=[],i=0;i")}this.dom.textArea.innerHTML=s,this.dom.textArea.style.lineHeight=.75*this.options.iconSize+this.options.iconSpacing+"px"}},n.prototype.drawLegendIcons=function(){if(this.dom.frame.parentNode){var t=(0,r.default)(this.groups);t.sort(function(t,e){return t0){var i=this.groupIndex%this.groupsArray.length;this.groupIndex++,e={},e.color=this.groups[this.groupsArray[i]],this.groups[t]=e}else{var o=this.defaultIndex%this.defaultGroups.length;this.defaultIndex++,e={},e.color=this.defaultGroups[o],this.groups[t]=e}return e}},{key:"add",value:function(t,e){return this.groups[t]=e,this.groupsArray.push(t),e}}]),t}();e.default=d},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(115),s=o(n),r=i(116),a=o(r),h=i(159),d=o(h),l=i(160),u=o(l),c=i(1),p=i(91),f=i(93),m=function(){function t(e,i,o,n){var r=this;(0,s.default)(this,t),this.body=e,this.images=i,this.groups=o,this.layoutEngine=n,this.body.functions.createNode=this.create.bind(this),this.nodesListeners={add:function(t,e){r.add(e.items)},update:function(t,e){r.update(e.items,e.data)},remove:function(t,e){r.remove(e.items)}},this.options={},this.defaultOptions={borderWidth:1,borderWidthSelected:2,brokenImage:void 0,color:{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},fixed:{x:!1,y:!1},font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:0,strokeColor:"#ffffff",align:"center",vadjust:0,multi:!1,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"courier new",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(t,e,i,o){if(e===t)return.5;var n=1/(e-t);return Math.max(0,(o-t)*n)}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},shape:"ellipse",shapeProperties:{borderDashes:!1,borderRadius:6,interpolation:!0,useImageSize:!1,useBorderWithImage:!1},size:25,title:void 0,value:void 0,x:void 0,y:void 0},c.extend(this.options,this.defaultOptions),this.bindEventListeners()}return(0,a.default)(t,[{key:"bindEventListeners",value:function(){var t=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(){c.forEach(t.nodesListeners,function(e,i){t.body.data.nodes&&t.body.data.nodes.off(i,e)}),delete t.body.functions.createNode,delete t.nodesListeners.add,delete t.nodesListeners.update,delete t.nodesListeners.remove,delete t.nodesListeners})}},{key:"setOptions",value:function(t){if(this.nodeOptions=t,void 0!==t){if(d.default.parseOptions(this.options,t),void 0!==t.shape)for(var e in this.body.nodes)this.body.nodes.hasOwnProperty(e)&&this.body.nodes[e].updateShape();if(void 0!==t.font){u.default.parseOptions(this.options.font,t);for(var i in this.body.nodes)this.body.nodes.hasOwnProperty(i)&&(this.body.nodes[i].updateLabelModule(),this.body.nodes[i]._reset())}if(void 0!==t.size)for(var o in this.body.nodes)this.body.nodes.hasOwnProperty(o)&&this.body.nodes[o]._reset();void 0===t.hidden&&void 0===t.physics||this.body.emitter.emit("_dataChanged")}}},{key:"setData",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=this.body.data.nodes;if(t instanceof p||t instanceof f)this.body.data.nodes=t;else if(Array.isArray(t))this.body.data.nodes=new p,this.body.data.nodes.add(t);else{if(t)throw new TypeError("Array or DataSet expected");this.body.data.nodes=new p}o&&c.forEach(this.nodesListeners,function(t,e){o.off(e,t)}),this.body.nodes={},this.body.data.nodes&&!function(){var t=e;c.forEach(e.nodesListeners,function(e,i){t.body.data.nodes.on(i,e)});var i=e.body.data.nodes.getIds();e.add(i,!0)}(),i===!1&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=void 0,o=[],n=0;n1&&void 0!==arguments[1]?arguments[1]:d.default;return new e(t,this.body,this.images,this.groups,this.options,this.defaultOptions,this.nodeOptions)}},{key:"refresh",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.body.nodes;for(var i in e){var o=void 0;e.hasOwnProperty(i)&&(o=e[i]);var n=this.body.data.nodes._data[i];void 0!==o&&void 0!==n&&(t===!0&&o.setOptions({x:null,y:null}),o.setOptions({fixed:!1}),o.setOptions(n))}}},{key:"getPositions",value:function(t){var e={};if(void 0!==t){if(Array.isArray(t)===!0){for(var i=0;it.left&&this.shape.topt.top}},{key:"isBoundingBoxOverlappingWith",value:function(t){return this.shape.boundingBox.leftt.left&&this.shape.boundingBox.topt.top}}],[{key:"parseOptions",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=["color","font","fixed","shadow"];if(j.selectiveNotDeepExtend(n,t,e,i),j.mergeOptions(t,e,"shadow",i,o),void 0!==e.color&&null!==e.color){var s=j.parseColor(e.color);j.fillIfDefined(t.color,s)}else i===!0&&null===e.color&&(t.color=j.bridgeObject(o.color));void 0!==e.fixed&&null!==e.fixed&&("boolean"==typeof e.fixed?(t.fixed.x=e.fixed,t.fixed.y=e.fixed):(void 0!==e.fixed.x&&"boolean"==typeof e.fixed.x&&(t.fixed.x=e.fixed.x),void 0!==e.fixed.y&&"boolean"==typeof e.fixed.y&&(t.fixed.y=e.fixed.y))),void 0!==e.font&&null!==e.font?u.default.parseOptions(t.font,e):i===!0&&null===e.font&&(t.font=j.bridgeObject(o.font)),void 0!==e.scaling&&j.mergeOptions(t.scaling,e.scaling,"label",i,o.scaling)}}]),t}();e.default=W},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(161),s=o(n),r=i(2),a=o(r),h=i(62),d=o(h),l=i(115),u=o(l),c=i(116),p=o(c),f=i(1),m=function(){function t(e,i){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,u.default)(this,t),this.body=e,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(i),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=o}return(0,p.default)(t,[{key:"setOptions",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.elementOptions=e,this.fontOptions=f.deepExtend({},e.font,!0),void 0!==e.label&&(this.labelDirty=!0),void 0!==e.font&&(t.parseOptions(this.fontOptions,e,i),"string"==typeof e.font?this.baseSize=this.fontOptions.size:"object"===(0,d.default)(e.font)&&void 0!==e.font.size&&(this.baseSize=e.font.size))}},{key:"constrain",value:function(t,e,i){this.fontOptions.constrainWidth=!1,this.fontOptions.maxWdt=-1,this.fontOptions.minWdt=-1;var o=[e,t,i],n=f.topMost(o,"widthConstraint");if("number"==typeof n)this.fontOptions.maxWdt=Number(n),this.fontOptions.minWdt=Number(n);else if("object"===("undefined"==typeof n?"undefined":(0,d.default)(n))){var s=f.topMost(o,["widthConstraint","maximum"]);"number"==typeof s&&(this.fontOptions.maxWdt=Number(s));var r=f.topMost(o,["widthConstraint","minimum"]);"number"==typeof r&&(this.fontOptions.minWdt=Number(r))}this.fontOptions.constrainHeight=!1,this.fontOptions.minHgt=-1,this.fontOptions.valign="middle";var a=f.topMost(o,"heightConstraint");if("number"==typeof a)this.fontOptions.minHgt=Number(a);else if("object"===("undefined"==typeof a?"undefined":(0,d.default)(a))){var h=f.topMost(o,["heightConstraint","minimum"]);"number"==typeof h&&(this.fontOptions.minHgt=Number(h));var l=f.topMost(o,["heightConstraint","valign"]);"string"==typeof l&&("top"!==l&&"bottom"!==l||(this.fontOptions.valign=l))}}},{key:"choosify",value:function(t,e,i){this.fontOptions.chooser=!0;var o=[e,t,i],n=f.topMost(o,"chosen");if("boolean"==typeof n)this.fontOptions.chooser=n;else if("object"===("undefined"==typeof n?"undefined":(0,d.default)(n))){var s=f.topMost(o,["chosen","label"]);"boolean"!=typeof s&&"function"!=typeof s||(this.fontOptions.chooser=s)}}},{key:"adjustSizes",value:function(t){var e=t?t.right+t.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=e,this.fontOptions.minWdt-=e);var i=t?t.top+t.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=i)}},{key:"propagateFonts",value:function(t,e,i){if(this.fontOptions.multi){var o=["bold","ital","boldital","mono"],n=!0,s=!1,r=void 0;try{for(var h,d=(0,a.default)(o);!(n=(h=d.next()).done);n=!0){var l=h.value,u=void 0;if(t.font&&(u=t.font[l]),"string"==typeof u){var c=u.split(" ");this.fontOptions[l].size=c[0].replace("px",""),this.fontOptions[l].face=c[1],this.fontOptions[l].color=c[2],this.fontOptions[l].vadjust=this.fontOptions.vadjust,this.fontOptions[l].mod=i.font[l].mod}else{if(u&&u.hasOwnProperty("face")?this.fontOptions[l].face=u.face:e.font&&e.font[l]&&e.font[l].hasOwnProperty("face")?this.fontOptions[l].face=e.font[l].face:"mono"===l?this.fontOptions[l].face=i.font[l].face:e.font&&e.font.hasOwnProperty("face")?this.fontOptions[l].face=e.font.face:this.fontOptions[l].face=this.fontOptions.face,u&&u.hasOwnProperty("color")?this.fontOptions[l].color=u.color:e.font&&e.font[l]&&e.font[l].hasOwnProperty("color")?this.fontOptions[l].color=e.font[l].color:e.font&&e.font.hasOwnProperty("color")?this.fontOptions[l].color=e.font.color:this.fontOptions[l].color=this.fontOptions.color,u&&u.hasOwnProperty("mod")?this.fontOptions[l].mod=u.mod:e.font&&e.font[l]&&e.font[l].hasOwnProperty("mod")?this.fontOptions[l].mod=e.font[l].mod:e.font&&e.font.hasOwnProperty("mod")?this.fontOptions[l].mod=e.font.mod:this.fontOptions[l].mod=i.font[l].mod,u&&u.hasOwnProperty("size"))this.fontOptions[l].size=u.size;else if(e.font&&e.font[l]&&e.font[l].hasOwnProperty("size"))this.fontOptions[l].size=e.font[l].size;else if(this.fontOptions[l].face===i.font[l].face&&this.fontOptions.face===i.font.face){var p=this.fontOptions.size/Number(i.font.size);this.fontOptions[l].size=i.font[l].size*p}else e.font&&e.font.hasOwnProperty("size")?this.fontOptions[l].size=e.font.size:this.fontOptions[l].size=this.fontOptions.size;if(u&&u.hasOwnProperty("vadjust"))this.fontOptions[l].vadjust=u.vadjust;else if(e.font&&e.font[l]&&e.font[l].hasOwnProperty("vadjust"))this.fontOptions[l].vadjust=e.font[l].vadjust;else if(this.fontOptions[l].face===i.font[l].face&&this.fontOptions.face===i.font.face){var f=this.fontOptions.size/Number(i.font.size);this.fontOptions[l].vadjust=i.font[l].vadjust*Math.round(f)}else e.font&&e.font.hasOwnProperty("vadjust")?this.fontOptions[l].vadjust=e.font.vadjust:this.fontOptions[l].vadjust=this.fontOptions.vadjust}this.fontOptions[l].size=Number(this.fontOptions[l].size),this.fontOptions[l].vadjust=Number(this.fontOptions[l].vadjust)}}catch(t){s=!0,r=t}finally{try{!n&&d.return&&d.return()}finally{if(s)throw r}}}}},{key:"draw",value:function(t,e,i,o,n){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"middle";if(void 0!==this.elementOptions.label){var r=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&r5&&void 0!==arguments[5]?arguments[5]:"middle",a=this.fontOptions.size,h=a*this.body.view.scale;h>=this.elementOptions.scaling.label.maxVisible&&(a=Number(this.elementOptions.scaling.label.maxVisible)/this.body.view.scale);var d=this.size.yLine,l=this._setAlignment(t,o,d,r),u=(0,s.default)(l,2);o=u[0],d=u[1],t.textAlign="left",o-=this.size.width/2,this.fontOptions.valign&&this.size.height>this.size.labelHeight&&("top"===this.fontOptions.valign&&(d-=(this.size.height-this.size.labelHeight)/2),"bottom"===this.fontOptions.valign&&(d+=(this.size.height-this.size.labelHeight)/2));for(var c=0;c0&&(t.lineWidth=m.strokeWidth,t.strokeStyle=b,t.lineJoin="round"),t.fillStyle=y,m.strokeWidth>0&&t.strokeText(m.text,o+p,d+m.vadjust),t.fillText(m.text,o+p,d+m.vadjust),p+=m.width}d+=this.lines[c].height}}},{key:"_setAlignment",value:function(t,e,i,o){if(this.isEdgeLabel&&"horizontal"!==this.fontOptions.align&&this.pointToSelf===!1){e=0,i=0;var n=2;"top"===this.fontOptions.align?(t.textBaseline="alphabetic",i-=2*n):"bottom"===this.fontOptions.align?(t.textBaseline="hanging",i+=2*n):t.textBaseline="middle"}else t.textBaseline=o;return[e,i]}},{key:"_getColor",value:function(t,e,i){var o=t||"#000000",n=i||"#ffffff";if(e<=this.elementOptions.scaling.label.drawThreshold){var s=Math.max(0,Math.min(1,1-(this.elementOptions.scaling.label.drawThreshold-e)));o=f.overrideOpacity(o,s),n=f.overrideOpacity(n,s)}return[o,n]}},{key:"getTextSize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this._processLabel(t,e,i),{width:this.size.width,height:this.size.height,lineCount:this.lineCount}}},{key:"calculateLabelSize",value:function(t,e,i){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"middle";this.labelDirty===!0&&this._processLabel(t,e,i),this.size.left=o-.5*this.size.width,this.size.top=n-.5*this.size.height,this.size.yLine=n+.5*(1-this.lineCount)*this.fontOptions.size,"hanging"===s&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4),this.labelDirty=!1}},{key:"decodeMarkupSystem",value:function(t){var e="none";return"markdown"===t||"md"===t?e="markdown":t!==!0&&"html"!==t||(e="html"),e}},{key:"splitBlocks",value:function(t,e){var i=this.decodeMarkupSystem(e);return"none"===i?[{text:t,mod:"normal"}]:"markdown"===i?this.splitMarkdownBlocks(t):"html"===i?this.splitHtmlBlocks(t):void 0}},{key:"splitMarkdownBlocks",value:function(t){var e=[],i={bold:!1,ital:!1,mono:!1,beginable:!0,spacing:!1,position:0,buffer:"",modStack:[]};for(i.mod=function(){return 0===this.modStack.length?"normal":this.modStack[0]},i.modName=function(){return 0===this.modStack.length?"normal":"mono"===this.modStack[0]?"mono":i.bold&&i.ital?"boldital":i.bold?"bold":i.ital?"ital":void 0},i.emitBlock=function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.spacing&&(this.add(" "),this.spacing=!1),this.buffer.length>0&&(e.push({text:this.buffer,mod:this.modName()}),this.buffer="")},i.add=function(t){" "===t&&(i.spacing=!0),i.spacing&&(this.buffer+=" ",this.spacing=!1)," "!=t&&(this.buffer+=t)};i.position0&&void 0!==arguments[0]&&arguments[0];this.spacing&&(this.add(" "),this.spacing=!1),this.buffer.length>0&&(e.push({text:this.buffer,mod:this.modName()}),this.buffer="")},i.add=function(t){" "===t&&(i.spacing=!0),i.spacing&&(this.buffer+=" ",this.spacing=!1)," "!=t&&(this.buffer+=t)};i.position/.test(t.substr(i.position,3))?i.mono||i.ital||!//.test(t.substr(i.position,3))?!i.mono&&//.test(t.substr(i.position,6))?(i.emitBlock(),i.mono=!0,i.modStack.unshift("mono"),i.position+=5):!i.mono&&"bold"===i.mod()&&/<\/b>/.test(t.substr(i.position,4))?(i.emitBlock(),i.bold=!1,i.modStack.shift(),i.position+=3):!i.mono&&"ital"===i.mod()&&/<\/i>/.test(t.substr(i.position,4))?(i.emitBlock(),i.ital=!1,i.modStack.shift(),i.position+=3):"mono"===i.mod()&&/<\/code>/.test(t.substr(i.position,7))?(i.emitBlock(),i.mono=!1,i.modStack.shift(),i.position+=6):i.add(o):(i.emitBlock(),i.ital=!0,i.modStack.unshift("ital"),i.position+=2):(i.emitBlock(),i.bold=!0,i.modStack.unshift("bold"),i.position+=2):/&/.test(o)?/</.test(t.substr(i.position,4))?(i.add("<"),i.position+=3):/&/.test(t.substr(i.position,5))?(i.add("&"),i.position+=4):i.add("&"):i.add(o),i.position++}return i.emitBlock(),e}},{key:"getFormattingValues",value:function(t,e,i,o){var n={color:"normal"===o?this.fontOptions.color:this.fontOptions[o].color,size:"normal"===o?this.fontOptions.size:this.fontOptions[o].size,face:"normal"===o?this.fontOptions.face:this.fontOptions[o].face,mod:"normal"===o?"":this.fontOptions[o].mod,vadjust:"normal"===o?this.fontOptions.vadjust:this.fontOptions[o].vadjust,strokeWidth:this.fontOptions.strokeWidth,strokeColor:this.fontOptions.strokeColor};return"normal"===o?(e||i)&&(this.fontOptions.chooser===!0&&this.elementOptions.labelHighlightBold?n.mod="bold":"function"==typeof this.fontOptions.chooser&&this.fontOptions.chooser(t,n,this.elementOptions.id,e,i)):(e||i)&&"function"==typeof this.fontOptions.chooser&&this.fontOptions.chooser(t,n,this.elementOptions.id,e,i),t.font=(n.mod+" "+n.size+"px "+n.face).replace(/"/g,""),n.font=t.font,n.height=n.size,n}},{key:"differentState",value:function(t,e){return t!==this.fontOptions.selectedState&&e!==this.fontOptions.hoverState}},{key:"_processLabel",value:function(t,e,i){var o=0,n=0,s=[],r=0;if(s.add=function(t,e,i,o,n,s,r,a,h,d){this.length==t&&(this[t]={width:0,height:0,blocks:[]}),this[t].blocks.push({text:e,font:i,color:o,width:n,height:s,vadjust:r,mod:a,strokeWidth:h,strokeColor:d})},s.accumulate=function(t,e,i){this[t].width+=e,this[t].height=i>this[t].height?i:this[t].height},s.addAndAccumulate=function(t,e,i,o,n,s,r,a,h,d){this.add(t,e,i,o,n,s,r,a,h,d),this.accumulate(t,n,s)},void 0!==this.elementOptions.label){var a=String(this.elementOptions.label).split("\n"),h=a.length;if(this.elementOptions.font.multi)for(var d=0;d0)for(var m=this.getFormattingValues(t,e,i,l[f].mod),v=l[f].text.split(" "),g=!0,y="",b=void 0,_=void 0,w=0;wthis.fontOptions.maxWdt?(c=m.height>c?m.height:c,s.add(r,y,m.font,m.color,_.width,m.height,m.vadjust,l[f].mod,m.strokeWidth,m.strokeColor),s.accumulate(r,_.width,c),y="",g=!0,u=0,o=s[r].width>o?s[r].width:o,n+=s[r].height,r++):(y=y+x+v[w],w===v.length-1&&(c=m.height>c?m.height:c,u+=b.width,s.add(r,y,m.font,m.color,b.width,m.height,m.vadjust,l[f].mod,m.strokeWidth,m.strokeColor),s.accumulate(r,b.width,c),f===l.length-1&&(o=s[r].width>o?s[r].width:o,n+=s[r].height,r++)),w++,g=!1)}else{var k=this.getFormattingValues(t,e,i,l[f].mod),O=t.measureText(l[f].text);s.addAndAccumulate(r,l[f].text,k.font,k.color,O.width,k.height,k.vadjust,l[f].mod,k.strokeWidth,k.strokeColor),o=s[r].width>o?s[r].width:o,l.length-1===f&&(n+=s[r].height,r++)}}}else for(var D=0;D0)for(var M=a[D].split(" "),C="",T=void 0,E=void 0,P=0;Pthis.fontOptions.maxWdt?(s.addAndAccumulate(r,C,S.font,S.color,E.width,S.size,S.vadjust,"normal",S.strokeWidth,S.strokeColor),o=s[r].width>o?s[r].width:o,n+=s[r].height,C="",r++):(C=C+I+M[P],P===M.length-1&&(s.addAndAccumulate(r,C,S.font,S.color,T.width,S.size,S.vadjust,"normal",S.strokeWidth,S.strokeColor),o=s[r].width>o?s[r].width:o,n+=s[r].height,r++),P++)}else{var N=a[D],z=t.measureText(N);s.addAndAccumulate(r,N,S.font,S.color,z.width,S.size,S.vadjust,"normal",S.strokeWidth,S.strokeColor),o=s[r].width>o?s[r].width:o,n+=s[r].height,r++}}}this.fontOptions.minWdt>0&&o0&&n2&&void 0!==arguments[2]&&arguments[2];if("string"==typeof e.font){var o=e.font.split(" ");t.size=o[0].replace("px",""),t.face=o[1],t.color=o[2],t.vadjust=0}else"object"===(0,d.default)(e.font)&&f.fillIfDefined(t,e.font,i);t.size=Number(t.size),t.vadjust=Number(t.vadjust)}}]),t}();e.default=m},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var n=i(162),s=o(n),r=i(2),a=o(r);e.default=function(){function t(t,e){var i=[],o=!0,n=!1,s=void 0;try{for(var r,h=(0,a.default)(t);!(o=(r=h.next()).done)&&(i.push(r.value),!e||i.length!==e);o=!0);}catch(t){n=!0,s=t}finally{try{!o&&h.return&&h.return()}finally{if(n)throw s}}return i}return function(e,i){if(Array.isArray(e))return e;if((0,s.default)(Object(e)))return t(e,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()},function(t,e,i){t.exports={default:i(163),__esModule:!0}},function(t,e,i){i(4),i(50),t.exports=i(164)},function(t,e,i){var o=i(54),n=i(47)("iterator"),s=i(8);t.exports=i(17).isIterable=function(t){var e=Object(t);return void 0!==e[n]||"@@iterator"in e||s.hasOwnProperty(o(e))}},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(166),s=o(n),r=i(115),a=o(r),h=i(116),d=o(h),l=i(169),u=o(l),c=i(170),p=o(c),f=i(175),m=o(f),v=function(t){function e(t,i,o){(0,a.default)(this,e);var n=(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o));return n._setMargins(o),n}return(0,p.default)(e,t),(0,d.default)(e,[{key:"resize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;(void 0===this.width||this.labelModule.differentState(e,i))&&(this.textSize=this.labelModule.getTextSize(t,e,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=this.width/2)}},{key:"draw",value:function(t,e,i,o,n,s){this.resize(t,o,n),this.left=e-this.width/2,this.top=i-this.height/2,t.strokeStyle=s.borderColor,t.lineWidth=s.borderWidth,t.lineWidth/=this.body.view.scale,t.lineWidth=Math.min(this.width,t.lineWidth),t.fillStyle=s.color,t.roundRect(this.left,this.top,this.width,this.height,s.borderRadius),this.enableShadow(t,s),t.fill(),this.disableShadow(t,s),t.save(),s.borderWidth>0&&(this.enableBorderDashes(t,s),t.stroke(),this.disableBorderDashes(t,s)),t.restore(),this.updateBoundingBox(e,i,t,o,n),this.labelModule.draw(t,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,o,n)}},{key:"updateBoundingBox",value:function(t,e,i,o,n){this.resize(i,o,n),this.left=t-this.width/2,this.top=e-this.height/2;var s=this.options.shapeProperties.borderRadius;this.boundingBox.left=this.left-s,this.boundingBox.top=this.top-s,this.boundingBox.bottom=this.top+this.height+s,this.boundingBox.right=this.left+this.width+s}},{key:"distanceToBorder",value:function(t,e){this.resize(t);var i=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(e)),Math.abs(this.height/2/Math.sin(e)))+i}}]),e}(m.default);e.default=v},function(t,e,i){t.exports={default:i(167),__esModule:!0}},function(t,e,i){i(168),t.exports=i(17).Object.getPrototypeOf},function(t,e,i){var o=i(49),n=i(48);i(61)("getPrototypeOf",function(){return function(t){return n(o(t))}})},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var n=i(62),s=o(n);e.default=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==("undefined"==typeof e?"undefined":(0,s.default)(e))&&"function"!=typeof e?t:e}},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var n=i(171),s=o(n),r=i(55),a=o(r),h=i(62),d=o(h);e.default=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof e?"undefined":(0,d.default)(e)));t.prototype=(0,a.default)(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(s.default?(0,s.default)(t,e):t.__proto__=e)}},function(t,e,i){t.exports={default:i(172),__esModule:!0}},function(t,e,i){i(173),t.exports=i(17).Object.setPrototypeOf},function(t,e,i){var o=i(15);o(o.S,"Object",{setPrototypeOf:i(174).set})},function(t,e,i){var o=i(23),n=i(22),s=function(t,e){if(n(t),!o(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,o){try{o=i(18)(Function.call,i(78).f(Object.prototype,"__proto__").set,2),o(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,i){return s(t,i),e?t.__proto__=i:o(t,i),t}}({},!1):void 0),check:s}},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(62),s=o(n),r=i(115),a=o(r),h=i(116),d=o(h),l=function(){function t(e,i,o){(0,a.default)(this,t),this.body=i,this.labelModule=o,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.boundingBox={top:0,left:0,right:0,bottom:0}}return(0,d.default)(t,[{key:"setOptions",value:function(t){this.options=t}},{key:"_setMargins",value:function(t){this.margin={},this.options.margin&&("object"==(0,s.default)(this.options.margin)?(this.margin.top=this.options.margin.top,this.margin.right=this.options.margin.right,this.margin.bottom=this.options.margin.bottom,this.margin.left=this.options.margin.left):(this.margin.top=this.options.margin,this.margin.right=this.options.margin,this.margin.bottom=this.options.margin,this.margin.left=this.options.margin)),t.adjustSizes(this.margin)}},{key:"_distanceToBorder",value:function(t,e){var i=this.options.borderWidth;return this.resize(t),Math.min(Math.abs(this.width/2/Math.cos(e)),Math.abs(this.height/2/Math.sin(e)))+i}},{key:"enableShadow",value:function(t,e){e.shadow&&(t.shadowColor=e.shadowColor,t.shadowBlur=e.shadowSize,t.shadowOffsetX=e.shadowX,t.shadowOffsetY=e.shadowY)}},{key:"disableShadow",value:function(t,e){e.shadow&&(t.shadowColor="rgba(0,0,0,0)",t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0)}},{key:"enableBorderDashes",value:function(t,e){if(e.borderDashes!==!1)if(void 0!==t.setLineDash){var i=e.borderDashes;i===!0&&(i=[5,15]),t.setLineDash(i)}else console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,e.borderDashes=!1}},{key:"disableBorderDashes",value:function(t,e){e.borderDashes!==!1&&(void 0!==t.setLineDash?t.setLineDash([0]):(console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,e.borderDashes=!1))}}]),t}();e.default=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(166),s=o(n),r=i(115),a=o(r),h=i(116),d=o(h),l=i(169),u=o(l),c=i(170),p=o(c),f=i(177),m=o(f),v=function(t){function e(t,i,o){(0,a.default)(this,e);var n=(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o));return n._setMargins(o),n}return(0,p.default)(e,t),(0,d.default)(e,[{key:"resize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;arguments.length>3&&void 0!==arguments[3]?arguments[3]:{size:this.options.size};if(void 0===this.width||this.labelModule.differentState(e,i)){this.textSize=this.labelModule.getTextSize(t,e,i);var o=Math.max(this.textSize.width+this.margin.right+this.margin.left,this.textSize.height+this.margin.top+this.margin.bottom);this.options.size=o/2,this.width=o,this.height=o,this.radius=this.width/2}}},{key:"draw",value:function(t,e,i,o,n,s){ +this.resize(t,o,n),this.left=e-this.width/2,this.top=i-this.height/2,this._drawRawCircle(t,e,i,o,n,s),this.boundingBox.top=i-s.size,this.boundingBox.left=e-s.size,this.boundingBox.right=e+s.size,this.boundingBox.bottom=i+s.size,this.updateBoundingBox(e,i),this.labelModule.draw(t,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,o,n)}},{key:"updateBoundingBox",value:function(t,e){this.boundingBox.top=e-this.options.size,this.boundingBox.left=t-this.options.size,this.boundingBox.right=t+this.options.size,this.boundingBox.bottom=e+this.options.size}},{key:"distanceToBorder",value:function(t,e){return this.resize(t),.5*this.width}}]),e}(m.default);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(166),s=o(n),r=i(115),a=o(r),h=i(116),d=o(h),l=i(169),u=o(l),c=i(170),p=o(c),f=i(175),m=o(f),v=function(t){function e(t,i,o){(0,a.default)(this,e);var n=(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o));return n.labelOffset=0,n.imageLoaded=!1,n}return(0,p.default)(e,t),(0,d.default)(e,[{key:"setOptions",value:function(t,e){this.options=t,e&&(this.imageObj=e)}},{key:"_resizeImage",value:function(){var t=!1;if(this.imageObj.width&&this.imageObj.height?this.imageLoaded===!1&&(this.imageLoaded=!0,t=!0):this.imageLoaded=!1,!this.width||!this.height||t===!0){var e,i,o;this.imageObj.width&&this.imageObj.height&&(e=0,i=0),this.options.shapeProperties.useImageSize===!1?this.imageObj.width>this.imageObj.height?(o=this.imageObj.width/this.imageObj.height,e=2*this.options.size*o||this.imageObj.width,i=2*this.options.size||this.imageObj.height):(o=this.imageObj.width&&this.imageObj.height?this.imageObj.height/this.imageObj.width:1,e=2*this.options.size,i=2*this.options.size*o):(e=this.imageObj.width,i=this.imageObj.height),this.width=e,this.height=i,this.radius=.5*this.width}}},{key:"_drawRawCircle",value:function(t,e,i,o,n,s){var r=s.borderWidth/this.body.view.scale;t.lineWidth=Math.min(this.width,r),t.strokeStyle=s.borderColor,t.fillStyle=s.color,t.circle(e,i,s.size),this.enableShadow(t,s),t.fill(),this.disableShadow(t,s),t.save(),r>0&&(this.enableBorderDashes(t,s),t.stroke(),this.disableBorderDashes(t,s)),t.restore()}},{key:"_drawImageAtPosition",value:function(t,e){if(0!=this.imageObj.width){t.globalAlpha=1,this.enableShadow(t,e);var i=this.imageObj.width/this.width/this.body.view.scale;if(i>2&&this.options.shapeProperties.interpolation===!0){var o=this.imageObj.width,n=this.imageObj.height,s=document.createElement("canvas");s.width=o,s.height=o;var r=s.getContext("2d");i*=.5,o*=.5,n*=.5,r.drawImage(this.imageObj,0,0,o,n);for(var a=0,h=1;i>2&&h<4;)r.drawImage(s,a,0,o,n,a+o,0,o/2,n/2),a+=o,i*=.5,o*=.5,n*=.5,h+=1;t.drawImage(s,a,0,o,n,this.left,this.top,this.width,this.height)}else t.drawImage(this.imageObj,this.left,this.top,this.width,this.height);this.disableShadow(t,e)}}},{key:"_drawImageLabel",value:function(t,e,i,o,n){var s,r=0;if(void 0!==this.height){r=.5*this.height;var a=this.labelModule.getTextSize(t,o,n);a.lineCount>=1&&(r+=a.height/2)}s=i+r,this.options.label&&(this.labelOffset=r),this.labelModule.draw(t,e,s,o,n,"hanging")}}]),e}(m.default);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(166),s=o(n),r=i(115),a=o(r),h=i(116),d=o(h),l=i(169),u=o(l),c=i(170),p=o(c),f=i(177),m=o(f),v=function(t){function e(t,i,o,n){(0,a.default)(this,e);var r=(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o));return r.imageObj=n,r._swapToImageResizeWhenImageLoaded=!0,r}return(0,p.default)(e,t),(0,d.default)(e,[{key:"resize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(void 0===this.imageObj.src||void 0===this.imageObj.width||void 0===this.imageObj.height||this.labelModule.differentState(e,i)){var o=2*this.options.size;this.width=o,this.height=o,this._swapToImageResizeWhenImageLoaded=!0,this.radius=.5*this.width}else this._swapToImageResizeWhenImageLoaded&&(this.width=void 0,this.height=void 0,this._swapToImageResizeWhenImageLoaded=!1),this._resizeImage()}},{key:"draw",value:function(t,e,i,o,n,s){this.resize(),this.left=e-this.width/2,this.top=i-this.height/2;Math.min(.5*this.height,.5*this.width);this._drawRawCircle(t,e,i,o,n,s),t.save(),t.clip(),this._drawImageAtPosition(t,s),t.restore(),this._drawImageLabel(t,e,i,o,n),this.updateBoundingBox(e,i)}},{key:"updateBoundingBox",value:function(t,e){this.boundingBox.top=e-this.options.size,this.boundingBox.left=t-this.options.size,this.boundingBox.right=t+this.options.size,this.boundingBox.bottom=e+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(t,e){return this.resize(t),.5*this.width}}]),e}(m.default);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(166),s=o(n),r=i(115),a=o(r),h=i(116),d=o(h),l=i(169),u=o(l),c=i(170),p=o(c),f=i(175),m=o(f),v=function(t){function e(t,i,o){(0,a.default)(this,e);var n=(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o));return n._setMargins(o),n}return(0,p.default)(e,t),(0,d.default)(e,[{key:"resize",value:function(t,e,i){if(void 0===this.width||this.labelModule.differentState(e,i)){this.textSize=this.labelModule.getTextSize(t,e,i);var o=this.textSize.width+this.margin.right+this.margin.left;this.width=o,this.height=o,this.radius=this.width/2}}},{key:"draw",value:function(t,e,i,o,n,s){this.resize(t,o,n),this.left=e-this.width/2,this.top=i-this.height/2;var r=s.borderWidth/this.body.view.scale;t.lineWidth=Math.min(this.width,r),t.strokeStyle=s.borderColor,t.fillStyle=s.color,t.database(e-this.width/2,i-this.height/2,this.width,this.height),this.enableShadow(t,s),t.fill(),this.disableShadow(t,s),t.save(),r>0&&(this.enableBorderDashes(t,s),t.stroke(),this.disableBorderDashes(t,s)),t.restore(),this.updateBoundingBox(e,i,t,o,n),this.labelModule.draw(t,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,o,n)}},{key:"updateBoundingBox",value:function(t,e,i,o,n){this.resize(i,o,n),this.left=t-.5*this.width,this.top=e-.5*this.height,this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(m.default);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(166),s=o(n),r=i(115),a=o(r),h=i(116),d=o(h),l=i(169),u=o(l),c=i(170),p=o(c),f=i(181),m=o(f),v=function(t){function e(t,i,o){return(0,a.default)(this,e),(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o))}return(0,p.default)(e,t),(0,d.default)(e,[{key:"resize",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.selected,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.hover;this._resizeShape(i,o,e)}},{key:"draw",value:function(t,e,i,o,n,s){this._drawShape(t,"diamond",4,e,i,o,n,s)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(m.default);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(166),s=o(n),r=i(115),a=o(r),h=i(116),d=o(h),l=i(169),u=o(l),c=i(170),p=o(c),f=i(175),m=o(f),v=function(t){function e(t,i,o){return(0,a.default)(this,e),(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o))}return(0,p.default)(e,t),(0,d.default)(e,[{key:"_resizeShape",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.selected,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.hover,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{size:this.options.size};if(void 0===this.width||this.labelModule.differentState(t,e)){var o=2*i.size;this.width=o,this.height=o,this.radius=.5*this.width}}},{key:"_drawShape",value:function(t,e,i,o,n,s,r,a){this._resizeShape(s,r,a),this.left=o-this.width/2,this.top=n-this.height/2;var h=a.borderWidth/this.body.view.scale;if(t.lineWidth=Math.min(this.width,h),t.strokeStyle=a.borderColor,t.fillStyle=a.color,t[e](o,n,a.size),this.enableShadow(t,a),t.fill(),this.disableShadow(t,a),t.save(),h>0&&(this.enableBorderDashes(t,a),t.stroke(),this.disableBorderDashes(t,a)),t.restore(),void 0!==this.options.label){var d=n+.5*this.height+3;this.labelModule.draw(t,o,d,s,r,"hanging")}this.updateBoundingBox(o,n)}},{key:"updateBoundingBox",value:function(t,e){this.boundingBox.top=e-this.options.size,this.boundingBox.left=t-this.options.size,this.boundingBox.right=t+this.options.size,this.boundingBox.bottom=e+this.options.size,void 0!==this.options.label&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+3))}}]),e}(m.default);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(166),s=o(n),r=i(115),a=o(r),h=i(116),d=o(h),l=i(169),u=o(l),c=i(170),p=o(c),f=i(181),m=o(f),v=function(t){function e(t,i,o){return(0,a.default)(this,e),(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o))}return(0,p.default)(e,t),(0,d.default)(e,[{key:"resize",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.selected,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.hover;this._resizeShape(i,o,e)}},{key:"draw",value:function(t,e,i,o,n,s){this._drawShape(t,"circle",2,e,i,o,n,s)}},{key:"distanceToBorder",value:function(t,e){return this.resize(t),this.options.size}}]),e}(m.default);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(166),s=o(n),r=i(115),a=o(r),h=i(116),d=o(h),l=i(169),u=o(l),c=i(170),p=o(c),f=i(175),m=o(f),v=function(t){function e(t,i,o){return(0,a.default)(this,e),(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o))}return(0,p.default)(e,t),(0,d.default)(e,[{key:"resize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(void 0===this.width||this.labelModule.differentState(e,i)){var o=this.labelModule.getTextSize(t,e,i);this.height=2*o.height,this.width=o.width+this.height,this.radius=.5*this.width}}},{key:"draw",value:function(t,e,i,o,n,s){this.resize(t,o,n),this.left=e-.5*this.width,this.top=i-.5*this.height;var r=s.borderWidth/this.body.view.scale;t.lineWidth=Math.min(this.width,r),t.strokeStyle=s.borderColor,t.fillStyle=s.color,t.ellipse(this.left,this.top,this.width,this.height),this.enableShadow(t,s),t.fill(),this.disableShadow(t,s),t.save(),r>0&&(this.enableBorderDashes(t,s),t.stroke(),this.disableBorderDashes(t,s)),t.restore(),this.updateBoundingBox(e,i,t,o,n),this.labelModule.draw(t,e,i,o,n)}},{key:"updateBoundingBox",value:function(t,e,i,o,n){this.resize(i,o,n),this.left=t-.5*this.width,this.top=e-.5*this.height,this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width}},{key:"distanceToBorder",value:function(t,e){this.resize(t);var i=.5*this.width,o=.5*this.height,n=Math.sin(e)*i,s=Math.cos(e)*o;return i*o/Math.sqrt(n*n+s*s)}}]),e}(m.default);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(166),s=o(n),r=i(115),a=o(r),h=i(116),d=o(h),l=i(169),u=o(l),c=i(170),p=o(c),f=i(175),m=o(f),v=function(t){function e(t,i,o){(0,a.default)(this,e);var n=(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o));return n._setMargins(o),n}return(0,p.default)(e,t),(0,d.default)(e,[{key:"resize",value:function(t,e,i){(void 0===this.width||this.labelModule.differentState(e,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(t,e,i,o,n,s){if(this.resize(t,o,n),this.options.icon.size=this.options.icon.size||50,this.left=e-this.width/2,this.top=i-this.height/2,this._icon(t,e,i,o,n,s),void 0!==this.options.label){var r=5;this.labelModule.draw(t,this.left+this.iconSize.width/2+this.margin.left,i+this.height/2+r,o)}this.updateBoundingBox(e,i)}},{key:"updateBoundingBox",value:function(t,e){if(this.boundingBox.top=e-.5*this.options.icon.size,this.boundingBox.left=t-.5*this.options.icon.size,this.boundingBox.right=t+.5*this.options.icon.size,this.boundingBox.bottom=e+.5*this.options.icon.size,void 0!==this.options.label&&this.labelModule.size.width>0){var i=5;this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+i)}}},{key:"_icon",value:function(t,e,i,o,n,s){var r=Number(this.options.icon.size);void 0!==this.options.icon.code?(t.font=(o?"bold ":"")+r+"px "+this.options.icon.face,t.fillStyle=this.options.icon.color||"black",t.textAlign="center",t.textBaseline="middle",this.enableShadow(t,s),t.fillText(this.options.icon.code,e,i),this.disableShadow(t,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(t,e){return this._distanceToBorder(t,e)}}]),e}(m.default);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(166),s=o(n),r=i(115),a=o(r),h=i(116),d=o(h),l=i(169),u=o(l),c=i(170),p=o(c),f=i(177),m=o(f),v=function(t){function e(t,i,o,n){(0,a.default)(this,e);var r=(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o));return r.imageObj=n,r}return(0,p.default)(e,t),(0,d.default)(e,[{key:"resize",value:function(){this._resizeImage()}},{key:"draw",value:function(t,e,i,o,n,s){if(this.resize(),this.left=e-this.width/2,this.top=i-this.height/2,this.options.shapeProperties.useBorderWithImage===!0){var r=this.options.borderWidth,a=this.options.borderWidthSelected||2*this.options.borderWidth,h=(o?a:r)/this.body.view.scale;t.lineWidth=Math.min(this.width,h),t.beginPath(),t.strokeStyle=o?this.options.color.highlight.border:n?this.options.color.hover.border:this.options.color.border,t.fillStyle=o?this.options.color.highlight.background:n?this.options.color.hover.background:this.options.color.background,t.rect(this.left-.5*t.lineWidth,this.top-.5*t.lineWidth,this.width+t.lineWidth,this.height+t.lineWidth),t.fill(),t.save(),h>0&&(this.enableBorderDashes(t),t.stroke(),this.disableBorderDashes(t)),t.restore(),t.closePath()}this._drawImageAtPosition(t,s),this._drawImageLabel(t,e,i,o,n),this.updateBoundingBox(e,i)}},{key:"updateBoundingBox",value:function(t,e){this.resize(),this.left=t-this.width/2,this.top=e-this.height/2,this.boundingBox.top=this.top,this.boundingBox.left=this.left,this.boundingBox.right=this.left+this.width,this.boundingBox.bottom=this.top+this.height,void 0!==this.options.label&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset))}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(m.default);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(166),s=o(n),r=i(115),a=o(r),h=i(116),d=o(h),l=i(169),u=o(l),c=i(170),p=o(c),f=i(181),m=o(f),v=function(t){function e(t,i,o){return(0,a.default)(this,e),(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o))}return(0,p.default)(e,t),(0,d.default)(e,[{key:"resize",value:function(){this._resizeShape()}},{key:"draw",value:function(t,e,i,o,n,s){this._drawShape(t,"square",2,e,i,o,n,s)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(m.default);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(166),s=o(n),r=i(115),a=o(r),h=i(116),d=o(h),l=i(169),u=o(l),c=i(170),p=o(c),f=i(181),m=o(f),v=function(t){function e(t,i,o){return(0,a.default)(this,e),(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o))}return(0,p.default)(e,t),(0,d.default)(e,[{key:"resize",value:function(t,e,i,o){this._resizeShape(i,o,e)}},{key:"draw",value:function(t,e,i,o,n,s){this._drawShape(t,"star",4,e,i,o,n,s)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(m.default);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(166),s=o(n),r=i(115),a=o(r),h=i(116),d=o(h),l=i(169),u=o(l),c=i(170),p=o(c),f=i(175),m=o(f),v=function(t){function e(t,i,o){(0,a.default)(this,e);var n=(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o));return n._setMargins(o),n}return(0,p.default)(e,t),(0,d.default)(e,[{key:"resize",value:function(t,e,i){(void 0===this.width||this.labelModule.differentState(e,i))&&(this.textSize=this.labelModule.getTextSize(t,e,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(t,e,i,o,n,s){this.resize(t,o,n),this.left=e-this.width/2,this.top=i-this.height/2,this.enableShadow(t,s),this.labelModule.draw(t,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,o,n),this.disableShadow(t,s),this.updateBoundingBox(e,i,t,o,n)}},{key:"updateBoundingBox",value:function(t,e,i,o,n){this.resize(i,o,n),this.left=t-this.width/2,this.top=e-this.height/2,this.boundingBox.top=this.top,this.boundingBox.left=this.left,this.boundingBox.right=this.left+this.width,this.boundingBox.bottom=this.top+this.height}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(m.default);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(166),s=o(n),r=i(115),a=o(r),h=i(116),d=o(h),l=i(169),u=o(l),c=i(170),p=o(c),f=i(181),m=o(f),v=function(t){function e(t,i,o){return(0,a.default)(this,e),(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o))}return(0,p.default)(e,t),(0,d.default)(e,[{key:"resize",value:function(t){this._resizeShape()}},{key:"draw",value:function(t,e,i,o,n,s){this._drawShape(t,"triangle",3,e,i,o,n,s)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(m.default);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(166),s=o(n),r=i(115),a=o(r),h=i(116),d=o(h),l=i(169),u=o(l),c=i(170),p=o(c),f=i(181),m=o(f),v=function(t){function e(t,i,o){return(0,a.default)(this,e),(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o))}return(0,p.default)(e,t),(0,d.default)(e,[{key:"resize",value:function(t){this._resizeShape()}},{key:"draw",value:function(t,e,i,o,n,s){this._drawShape(t,"triangleDown",3,e,i,o,n,s)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(m.default);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(115),s=o(n),r=i(116),a=o(r),h=i(192),d=o(h),l=i(160),u=o(l),c=i(1),p=i(91),f=i(93),m=function(){function t(e,i,o){var n=this;(0,s.default)(this,t),this.body=e,this.images=i,this.groups=o,this.body.functions.createEdge=this.create.bind(this),this.edgesListeners={add:function(t,e){n.add(e.items)},update:function(t,e){n.update(e.items)},remove:function(t,e){n.remove(e.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(t,e,i,o){if(e===t)return.5;var n=1/(e-t);return Math.max(0,(o-t)*n)}},selectionWidth:1.5,selfReferenceSize:20,shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},smooth:{enabled:!0,type:"dynamic",forceDirection:"none",roundness:.5},title:void 0,width:1,value:void 0},c.extend(this.options,this.defaultOptions),this.bindEventListeners()}return(0,a.default)(t,[{key:"bindEventListeners",value:function(){var t=this;this.body.emitter.on("_forceDisableDynamicCurves",function(e){"dynamic"===e&&(e="continuous");var i=!1;for(var o in t.body.edges)if(t.body.edges.hasOwnProperty(o)){var n=t.body.edges[o],s=t.body.data.edges._data[o];if(void 0!==s){var r=s.smooth;void 0!==r&&r.enabled===!0&&"dynamic"===r.type&&(void 0===e?n.setOptions({smooth:!1}):n.setOptions({smooth:{type:e}}),i=!0)}}i===!0&&t.body.emitter.emit("_dataChanged")}),this.body.emitter.on("_dataUpdated",function(){t.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(){c.forEach(t.edgesListeners,function(e,i){t.body.data.edges&&t.body.data.edges.off(i,e)}),delete t.body.functions.createEdge,delete t.edgesListeners.add,delete t.edgesListeners.update,delete t.edgesListeners.remove,delete t.edgesListeners})}},{key:"setOptions",value:function(t){if(this.edgeOptions=t,void 0!==t){d.default.parseOptions(this.options,t);var e=!1;if(void 0!==t.smooth)for(var i in this.body.edges)this.body.edges.hasOwnProperty(i)&&(e=this.body.edges[i].updateEdgeType()||e);if(void 0!==t.font){u.default.parseOptions(this.options.font,t);for(var o in this.body.edges)this.body.edges.hasOwnProperty(o)&&this.body.edges[o].updateLabelModule()}void 0===t.hidden&&void 0===t.physics&&e!==!0||this.body.emitter.emit("_dataChanged")}}},{key:"setData",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=this.body.data.edges;if(t instanceof p||t instanceof f)this.body.data.edges=t;else if(Array.isArray(t))this.body.data.edges=new p,this.body.data.edges.add(t);else{if(t)throw new TypeError("Array or DataSet expected");this.body.data.edges=new p}if(o&&c.forEach(this.edgesListeners,function(t,e){o.off(e,t)}),this.body.edges={},this.body.data.edges){c.forEach(this.edgesListeners,function(t,i){e.body.data.edges.on(i,t)});var n=this.body.data.edges.getIds();this.add(n,!0)}i===!1&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.body.edges,o=this.body.data.edges,n=0;ni.shape.height?(r=i.x+.5*i.shape.width,a=i.y-h):(r=i.x+h,a=i.y-.5*i.shape.height),s=this._pointOnCircle(r,a,h,.125),this.labelModule.draw(t,s.x,s.y,n,this.hover)}}}},{key:"isOverlappingWith",value:function(t){if(this.connected){var e=10,i=this.from.x,o=this.from.y,n=this.to.x,s=this.to.y,r=t.left,a=t.top,h=this.edgeType.getDistanceToEdge(i,o,n,s,r,a);return h0&&i<0)&&(o+=Math.PI),t.rotate(o)}},{key:"_pointOnCircle",value:function(t,e,i,o){var n=2*o*Math.PI;return{x:t+i*Math.cos(n),y:e-i*Math.sin(n)}}},{key:"select",value:function(){this.selected=!0}},{key:"unselect",value:function(){this.selected=!1}},{key:"cleanup",value:function(){return this.edgeType.cleanup()}}],[{key:"parseOptions",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=["arrowStrikethrough","id","from","hidden","hoverWidth","label","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","to","title","value","width"];if(O.selectiveDeepExtend(n,t,e,i),O.mergeOptions(t,e,"smooth",i,o),O.mergeOptions(t,e,"shadow",i,o),void 0!==e.dashes&&null!==e.dashes?t.dashes=e.dashes:i===!0&&null===e.dashes&&(t.dashes=(0,a.default)(o.dashes)),void 0!==e.scaling&&null!==e.scaling?(void 0!==e.scaling.min&&(t.scaling.min=e.scaling.min),void 0!==e.scaling.max&&(t.scaling.max=e.scaling.max),O.mergeOptions(t.scaling,e.scaling,"label",i,o.scaling)):i===!0&&null===e.scaling&&(t.scaling=(0,a.default)(o.scaling)),void 0!==e.arrows&&null!==e.arrows)if("string"==typeof e.arrows){var r=e.arrows.toLowerCase();t.arrows.to.enabled=r.indexOf("to")!=-1,t.arrows.middle.enabled=r.indexOf("middle")!=-1,t.arrows.from.enabled=r.indexOf("from")!=-1}else{if("object"!==(0,d.default)(e.arrows))throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+(0,s.default)(e.arrows));O.mergeOptions(t.arrows,e.arrows,"to",i,o.arrows),O.mergeOptions(t.arrows,e.arrows,"middle",i,o.arrows),O.mergeOptions(t.arrows,e.arrows,"from",i,o.arrows)}else i===!0&&null===e.arrows&&(t.arrows=(0,a.default)(o.arrows));if(void 0!==e.color&&null!==e.color)if(t.color=O.deepExtend({},t.color,!0),O.isString(e.color))t.color.color=e.color,t.color.highlight=e.color,t.color.hover=e.color,t.color.inherit=!1;else{var h=!1;void 0!==e.color.color&&(t.color.color=e.color.color,h=!0),void 0!==e.color.highlight&&(t.color.highlight=e.color.highlight,h=!0),void 0!==e.color.hover&&(t.color.hover=e.color.hover,h=!0),void 0!==e.color.inherit&&(t.color.inherit=e.color.inherit),void 0!==e.color.opacity&&(t.color.opacity=Math.min(1,Math.max(0,e.color.opacity))),void 0===e.color.inherit&&h===!0&&(t.color.inherit=!1)}else i===!0&&null===e.color&&(t.color=O.bridgeObject(o.color));void 0!==e.font&&null!==e.font?m.default.parseOptions(t.font,e):i===!0&&null===e.font&&(t.font=O.bridgeObject(o.font))}}]),t}();e.default=D},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(161),s=o(n),r=i(166),a=o(r),h=i(115),d=o(h),l=i(116),u=o(l),c=i(169),p=o(c),f=i(170),m=o(f),v=i(194),g=o(v),y=function(t){function e(t,i,o){return(0,d.default)(this,e),(0,p.default)(this,(e.__proto__||(0,a.default)(e)).call(this,t,i,o))}return(0,m.default)(e,t),(0,u.default)(e,[{key:"_line",value:function(t,e,i){var o=i[0],n=i[1];t.beginPath(),t.moveTo(this.fromPoint.x,this.fromPoint.y),void 0===i||void 0===o.x?t.lineTo(this.toPoint.x,this.toPoint.y):t.bezierCurveTo(o.x,o.y,n.x,n.y,this.toPoint.x,this.toPoint.y),this.enableShadow(t,e),t.stroke(),this.disableShadow(t,e)}},{key:"_getViaCoordinates",value:function(){var t=this.from.x-this.to.x,e=this.from.y-this.to.y,i=void 0,o=void 0,n=void 0,s=void 0,r=this.options.smooth.roundness;return(Math.abs(t)>Math.abs(e)||this.options.smooth.forceDirection===!0||"horizontal"===this.options.smooth.forceDirection)&&"vertical"!==this.options.smooth.forceDirection?(o=this.from.y,s=this.to.y,i=this.from.x-r*t,n=this.to.x+r*t):(o=this.from.y-r*e,s=this.to.y+r*e,i=this.from.x,n=this.to.x),[{x:i,y:o},{x:n,y:s}]}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_findBorderPosition",value:function(t,e){return this._findBorderPositionBezier(t,e)}},{key:"_getDistanceToEdge",value:function(t,e,i,o,n,r){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:this._getViaCoordinates(),h=(0,s.default)(a,2),d=h[0],l=h[1];return this._getDistanceToBezierEdge(t,e,i,o,n,r,d,l)}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._getViaCoordinates(),i=(0,s.default)(e,2),o=i[0],n=i[1],r=t,a=[];a[0]=Math.pow(1-r,3),a[1]=3*r*Math.pow(1-r,2),a[2]=3*Math.pow(r,2)*(1-r),a[3]=Math.pow(r,3);var h=a[0]*this.fromPoint.x+a[1]*o.x+a[2]*n.x+a[3]*this.toPoint.x,d=a[0]*this.fromPoint.y+a[1]*o.y+a[2]*n.y+a[3]*this.toPoint.y;return{x:h,y:d}}}]),e}(g.default);e.default=y},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(166),s=o(n),r=i(115),a=o(r),h=i(116),d=o(h),l=i(169),u=o(l),c=i(170),p=o(c),f=i(195),m=o(f),v=function(t){function e(t,i,o){return(0,a.default)(this,e),(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o))}return(0,p.default)(e,t),(0,d.default)(e,[{key:"_getDistanceToBezierEdge",value:function(t,e,i,o,n,s,r,a){var h=1e9,d=void 0,l=void 0,u=void 0,c=void 0,p=void 0,f=t,m=e,v=[0,0,0,0];for(l=1;l<10;l++)u=.1*l,v[0]=Math.pow(1-u,3),v[1]=3*u*Math.pow(1-u,2),v[2]=3*Math.pow(u,2)*(1-u),v[3]=Math.pow(u,3),c=v[0]*t+v[1]*r.x+v[2]*a.x+v[3]*i,p=v[0]*e+v[1]*r.y+v[2]*a.y+v[3]*o,l>0&&(d=this._getDistanceToLine(f,m,c,p,n,s),h=d2&&void 0!==arguments[2]?arguments[2]:this._getViaCoordinates(),h=10,d=0,l=0,u=1,c=.2,p=this.to,f=!1;for(t.id===this.from.id&&(p=this.from,f=!0);l<=u&&d0&&(h=this._getDistanceToLine(p,f,u,c,n,s),a=ho.shape.height?(e=o.x+.5*o.shape.width,i=o.y-n):(e=o.x+n,i=o.y-.5*o.shape.height),[e,i,n]}},{key:"_pointOnCircle",value:function(t,e,i,o){var n=2*o*Math.PI;return{x:t+i*Math.cos(n),y:e-i*Math.sin(n)}}},{key:"_findBorderPositionCircle",value:function(t,e,i){for(var o=i.x,n=i.y,s=i.low,r=i.high,a=i.direction,h=10,d=0,l=this.options.selfReferenceSize,u=void 0,c=void 0,p=void 0,f=void 0,m=void 0,v=.05,g=.5*(s+r);s<=r&&d0?a>0?s=g:r=g:a>0?r=g:s=g,d++;return u.t=g,u}},{key:"getLineWidth",value:function(t,e){return t===!0?Math.max(this.selectionWidth,.3/this.body.view.scale):e===!0?Math.max(this.hoverWidth,.3/this.body.view.scale):Math.max(this.options.width,.3/this.body.view.scale)}},{key:"getColor",value:function(t,e,i,o){if(e.inheritsColor!==!1){if("both"===e.inheritsColor&&this.from.id!==this.to.id){var n=t.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y),s=void 0,r=void 0;return s=this.from.options.color.highlight.border,r=this.to.options.color.highlight.border,this.from.selected===!1&&this.to.selected===!1?(s=l.overrideOpacity(this.from.options.color.border,e.opacity),r=l.overrideOpacity(this.to.options.color.border,e.opacity)):this.from.selected===!0&&this.to.selected===!1?r=this.to.options.color.border:this.from.selected===!1&&this.to.selected===!0&&(s=this.from.options.color.border),n.addColorStop(0,s),n.addColorStop(1,r),n}return"to"===e.inheritsColor?l.overrideOpacity(this.to.options.color.border,e.opacity):l.overrideOpacity(this.from.options.color.border,e.opacity)}return l.overrideOpacity(e.color,e.opacity)}},{key:"_circle",value:function(t,e,i,o,n){this.enableShadow(t,e),t.beginPath(),t.arc(i,o,n,0,2*Math.PI,!1),t.stroke(),this.disableShadow(t,e)}},{key:"getDistanceToEdge",value:function(t,e,i,o,n,r,a,h){var d=0;if(this.from!=this.to)d=this._getDistanceToEdge(t,e,i,o,n,r,a);else{var l=this._getCircleData(void 0,h),u=(0,s.default)(l,3),c=u[0],p=u[1],f=u[2],m=c-n,v=p-r;d=Math.abs(Math.sqrt(m*m+v*v)-f)}return this.labelModule.size.leftn&&this.labelModule.size.topr?0:d}},{key:"_getDistanceToLine",value:function(t,e,i,o,n,s){var r=i-t,a=o-e,h=r*r+a*a,d=((n-t)*r+(s-e)*a)/h;d>1?d=1:d<0&&(d=0);var l=t+d*r,u=e+d*a,c=l-n,p=u-s;return Math.sqrt(c*c+p*p)}},{key:"getArrowData",value:function(t,e,i,o,n,r){var a=void 0,h=void 0,d=void 0,l=void 0,u=void 0,c=void 0,p=void 0,f=r.width;if("from"===e?(d=this.from,l=this.to,u=.1,c=r.fromArrowScale,p=r.fromArrowType):"to"===e?(d=this.to,l=this.from,u=-.1,c=r.toArrowScale,p=r.toArrowType):(d=this.to,l=this.from,c=r.middleArrowScale,p=r.middleArrowType),d!=l)if("middle"!==e)if(this.options.smooth.enabled===!0){h=this.findBorderPosition(d,t,{via:i});var m=this.getPoint(Math.max(0,Math.min(1,h.t+u)),i);a=Math.atan2(h.y-m.y,h.x-m.x)}else a=Math.atan2(d.y-l.y,d.x-l.x),h=this.findBorderPosition(d,t);else a=Math.atan2(d.y-l.y,d.x-l.x),h=this.getPoint(.5,i);else{var v=this._getCircleData(t),g=(0,s.default)(v,3),y=g[0],b=g[1],_=g[2];"from"===e?(h=this.findBorderPosition(this.from,t,{x:y,y:b,low:.25,high:.6,direction:-1}),a=h.t*-2*Math.PI+1.5*Math.PI+.1*Math.PI):"to"===e?(h=this.findBorderPosition(this.from,t,{x:y,y:b,low:.6,high:1,direction:1}),a=h.t*-2*Math.PI+1.5*Math.PI-1.1*Math.PI):(h=this._pointOnCircle(y,b,_,.175),a=3.9269908169872414)}var w=15*c+3*f,x=h.x-.9*w*Math.cos(a),k=h.y-.9*w*Math.sin(a),O={x:x,y:k};return{point:h,core:O,angle:a,length:w,type:p}}},{key:"drawArrowHead",value:function(t,e,i,o,n){t.strokeStyle=this.getColor(t,e,i,o),t.fillStyle=t.strokeStyle,t.lineWidth=e.width,n.type&&"circle"===n.type.toLowerCase()?t.circleEndpoint(n.point.x,n.point.y,n.angle,n.length):t.arrowEndpoint(n.point.x,n.point.y,n.angle,n.length),this.enableShadow(t,e),t.fill(),this.disableShadow(t,e)}},{key:"enableShadow",value:function(t,e){e.shadow===!0&&(t.shadowColor=e.shadowColor,t.shadowBlur=e.shadowSize,t.shadowOffsetX=e.shadowX,t.shadowOffsetY=e.shadowY)}},{key:"disableShadow",value:function(t,e){e.shadow===!0&&(t.shadowColor="rgba(0,0,0,0)",t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0)}}]),t}();e.default=u},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(161),s=o(n),r=i(166),a=o(r),h=i(115),d=o(h),l=i(116),u=o(l),c=i(169),p=o(c),f=i(170),m=o(f),v=i(195),g=o(v),y=function(t){function e(t,i,o){(0,d.default)(this,e);var n=(0,p.default)(this,(e.__proto__||(0,a.default)(e)).call(this,t,i,o));return n._boundFunction=function(){n.positionBezierNode()},n.body.emitter.on("_repositionBezierNodes",n._boundFunction),n}return(0,m.default)(e,t),(0,u.default)(e,[{key:"setOptions",value:function(t){var e=!1;this.options.physics!==t.physics&&(e=!0),this.options=t,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(),e===!0&&(this.via.setOptions({physics:this.options.physics}),this.positionBezierNode())}},{key:"connect",value:function(){this.from=this.body.nodes[this.options.from],this.to=this.body.nodes[this.options.to],void 0===this.from||void 0===this.to||this.options.physics===!1?this.via.setOptions({physics:!1}):this.from.id===this.to.id?this.via.setOptions({physics:!1}):this.via.setOptions({physics:!0})}},{key:"cleanup",value:function(){return this.body.emitter.off("_repositionBezierNodes",this._boundFunction),void 0!==this.via&&(delete this.body.nodes[this.via.id],this.via=void 0,!0)}},{key:"setupSupportNode",value:function(){if(void 0===this.via){var t="edgeId:"+this.id,e=this.body.functions.createNode({id:t,shape:"circle",physics:!0,hidden:!0});this.body.nodes[t]=e,this.via=e,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(t,e,i){t.beginPath(),t.moveTo(this.fromPoint.x,this.fromPoint.y),void 0===i.x?t.lineTo(this.toPoint.x,this.toPoint.y):t.quadraticCurveTo(i.x,i.y,this.toPoint.x,this.toPoint.y),this.enableShadow(t,e),t.stroke(),this.disableShadow(t,e)}},{key:"getViaNode",value:function(){return this.via}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.via,i=t,o=void 0,n=void 0;if(this.from===this.to){var r=this._getCircleData(this.from),a=(0,s.default)(r,3),h=a[0],d=a[1],l=a[2],u=2*Math.PI*(1-i);o=h+l*Math.sin(u),n=d+l-l*(1-Math.cos(u))}else o=Math.pow(1-i,2)*this.fromPoint.x+2*i*(1-i)*e.x+Math.pow(i,2)*this.toPoint.x,n=Math.pow(1-i,2)*this.fromPoint.y+2*i*(1-i)*e.y+Math.pow(i,2)*this.toPoint.y;return{x:o,y:n}}},{key:"_findBorderPosition",value:function(t,e){return this._findBorderPositionBezier(t,e,this.via)}},{key:"_getDistanceToEdge",value:function(t,e,i,o,n,s){return this._getDistanceToBezierEdge(t,e,i,o,n,s,this.via)}}]),e}(g.default);e.default=y},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(166),s=o(n),r=i(115),a=o(r),h=i(116),d=o(h),l=i(169),u=o(l),c=i(170),p=o(c),f=i(195),m=o(f),v=function(t){function e(t,i,o){return(0,a.default)(this,e),(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o))}return(0,p.default)(e,t),(0,d.default)(e,[{key:"_line",value:function(t,e,i){t.beginPath(),t.moveTo(this.fromPoint.x,this.fromPoint.y),void 0===i.x?t.lineTo(this.toPoint.x,this.toPoint.y):t.quadraticCurveTo(i.x,i.y,this.toPoint.x,this.toPoint.y),this.enableShadow(t,e),t.stroke(),this.disableShadow(t,e)}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_getViaCoordinates",value:function(){var t=void 0,e=void 0,i=this.options.smooth.roundness,o=this.options.smooth.type,n=Math.abs(this.from.x-this.to.x),s=Math.abs(this.from.y-this.to.y);if("discrete"===o||"diagonalCross"===o)Math.abs(this.from.x-this.to.x)<=Math.abs(this.from.y-this.to.y)?(this.from.y>=this.to.y?this.from.x<=this.to.x?(t=this.from.x+i*s,e=this.from.y-i*s):this.from.x>this.to.x&&(t=this.from.x-i*s,e=this.from.y-i*s):this.from.ythis.to.x&&(t=this.from.x-i*s,e=this.from.y+i*s)),"discrete"===o&&(t=nMath.abs(this.from.y-this.to.y)&&(this.from.y>=this.to.y?this.from.x<=this.to.x?(t=this.from.x+i*n,e=this.from.y-i*n):this.from.x>this.to.x&&(t=this.from.x-i*n,e=this.from.y-i*n):this.from.ythis.to.x&&(t=this.from.x-i*n,e=this.from.y+i*n)),"discrete"===o&&(e=sMath.abs(this.from.y-this.to.y)&&(t=this.from.x=this.to.y?this.from.x<=this.to.x?(t=this.from.x+i*s,e=this.from.y-i*s,t=this.to.xthis.to.x&&(t=this.from.x-i*s,e=this.from.y-i*s,t=this.to.x>t?this.to.x:t):this.from.ythis.to.x&&(t=this.from.x-i*s,e=this.from.y+i*s,t=this.to.x>t?this.to.x:t)):Math.abs(this.from.x-this.to.x)>Math.abs(this.from.y-this.to.y)&&(this.from.y>=this.to.y?this.from.x<=this.to.x?(t=this.from.x+i*n,e=this.from.y-i*n,e=this.to.y>e?this.to.y:e):this.from.x>this.to.x&&(t=this.from.x-i*n,e=this.from.y-i*n,e=this.to.y>e?this.to.y:e):this.from.ythis.to.x&&(t=this.from.x-i*n,e=this.from.y+i*n,e=this.to.y2&&void 0!==arguments[2]?arguments[2]:{};return this._findBorderPositionBezier(t,e,i.via)}},{key:"_getDistanceToEdge",value:function(t,e,i,o,n,s){var r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(t,e,i,o,n,s,r)}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._getViaCoordinates(),i=t,o=Math.pow(1-i,2)*this.fromPoint.x+2*i*(1-i)*e.x+Math.pow(i,2)*this.toPoint.x,n=Math.pow(1-i,2)*this.fromPoint.y+2*i*(1-i)*e.y+Math.pow(i,2)*this.toPoint.y;return{x:o,y:n}}}]),e}(m.default);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(166),s=o(n),r=i(115),a=o(r),h=i(116),d=o(h),l=i(169),u=o(l),c=i(170),p=o(c),f=i(196),m=o(f),v=function(t){function e(t,i,o){return(0,a.default)(this,e),(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o))}return(0,p.default)(e,t),(0,d.default)(e,[{key:"_line",value:function(t,e){t.beginPath(),t.moveTo(this.fromPoint.x,this.fromPoint.y),t.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(t,e),t.stroke(),this.disableShadow(t,e)}},{key:"getViaNode",value:function(){}},{key:"getPoint",value:function(t){return{x:(1-t)*this.fromPoint.x+t*this.toPoint.x,y:(1-t)*this.fromPoint.y+t*this.toPoint.y}}},{key:"_findBorderPosition",value:function(t,e){var i=this.to,o=this.from;t.id===this.from.id&&(i=this.from,o=this.to);var n=Math.atan2(i.y-o.y,i.x-o.x),s=i.x-o.x,r=i.y-o.y,a=Math.sqrt(s*s+r*r),h=t.distanceToBorder(e,n),d=(a-h)/a,l={};return l.x=(1-d)*o.x+d*i.x,l.y=(1-d)*o.y+d*i.y,l}},{key:"_getDistanceToEdge",value:function(t,e,i,o,n,s){return this._getDistanceToLine(t,e,i,o,n,s)}}]),e}(m.default);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(58),s=o(n),r=i(115),a=o(r),h=i(116),d=o(h),l=i(201),u=o(l),c=i(202),p=o(c),f=i(203),m=o(f),v=i(204),g=o(v),y=i(205),b=o(y),_=i(206),w=o(_),x=i(207),k=o(x),O=i(208),D=o(O),S=i(1),M=function(){function t(e){(0,a.default)(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},S.extend(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}return(0,d.default)(t,[{key:"bindEventListeners",value:function(){var t=this;this.body.emitter.on("initPhysics",function(){t.initPhysics()}),this.body.emitter.on("_layoutFailed",function(){t.layoutFailed=!0}),this.body.emitter.on("resetPhysics",function(){t.stopSimulation(),t.ready=!1}),this.body.emitter.on("disablePhysics",function(){t.physicsEnabled=!1,t.stopSimulation()}),this.body.emitter.on("restorePhysics",function(){t.setOptions(t.options),t.ready===!0&&t.startSimulation()}),this.body.emitter.on("startSimulation",function(){t.ready===!0&&t.startSimulation()}),this.body.emitter.on("stopSimulation",function(){t.stopSimulation()}),this.body.emitter.on("destroy",function(){t.stopSimulation(!1),t.body.emitter.off()}),this.body.emitter.on("_dataChanged",function(){t.updatePhysicsData()})}},{key:"setOptions",value:function(t){void 0!==t&&(t===!1?(this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation()):(this.physicsEnabled=!0,S.selectiveNotDeepExtend(["stabilization"],this.options,t),S.mergeOptions(this.options,t,"stabilization"),void 0===t.enabled&&(this.options.enabled=!0),this.options.enabled===!1&&(this.physicsEnabled=!1,this.stopSimulation()),this.timestep=this.options.timestep)),this.init()}},{key:"init",value:function(){var t;"forceAtlas2Based"===this.options.solver?(t=this.options.forceAtlas2Based,this.nodesSolver=new k.default(this.body,this.physicsBody,t),this.edgesSolver=new g.default(this.body,this.physicsBody,t),this.gravitySolver=new D.default(this.body,this.physicsBody,t)):"repulsion"===this.options.solver?(t=this.options.repulsion,this.nodesSolver=new p.default(this.body,this.physicsBody,t),this.edgesSolver=new g.default(this.body,this.physicsBody,t),this.gravitySolver=new w.default(this.body,this.physicsBody,t)):"hierarchicalRepulsion"===this.options.solver?(t=this.options.hierarchicalRepulsion,this.nodesSolver=new m.default(this.body,this.physicsBody,t),this.edgesSolver=new b.default(this.body,this.physicsBody,t),this.gravitySolver=new w.default(this.body,this.physicsBody,t)):(t=this.options.barnesHut,this.nodesSolver=new u.default(this.body,this.physicsBody,t),this.edgesSolver=new g.default(this.body,this.physicsBody,t),this.gravitySolver=new w.default(this.body,this.physicsBody,t)),this.modelOptions=t}},{key:"initPhysics",value:function(){this.physicsEnabled===!0&&this.options.enabled===!0?this.options.stabilization.enabled===!0?this.stabilize():(this.stabilized=!1,this.ready=!0,this.body.emitter.emit("fit",{},this.layoutFailed),this.startSimulation()):(this.ready=!0,this.body.emitter.emit("fit"))}},{key:"startSimulation",value:function(){this.physicsEnabled===!0&&this.options.enabled===!0?(this.stabilized=!1,this.adaptiveTimestep=!1,this.body.emitter.emit("_resizeNodes"),void 0===this.viewFunction&&(this.viewFunction=this.simulationStep.bind(this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering"))):this.body.emitter.emit("_redraw")}},{key:"stopSimulation",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.stabilized=!0,t===!0&&this._emitStabilized(),void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.viewFunction=void 0,t===!0&&this.body.emitter.emit("_stopRendering"))}},{key:"simulationStep",value:function(){var t=Date.now();this.physicsTick();var e=Date.now()-t;(e<.4*this.simulationInterval||this.runDoubleSpeed===!0)&&this.stabilized===!1&&(this.physicsTick(),this.runDoubleSpeed=!0),this.stabilized===!0&&this.stopSimulation()}},{key:"_emitStabilized",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.stabilizationIterations;(this.stabilizationIterations>1||this.startedStabilization===!0)&&setTimeout(function(){t.body.emitter.emit("stabilized",{iterations:e}),t.startedStabilization=!1,t.stabilizationIterations=0},0)}},{key:"physicsTick",value:function(){if(this.startedStabilization===!1&&(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0),this.stabilized===!1){if(this.adaptiveTimestep===!0&&this.adaptiveTimestepEnabled===!0){var t=1.2;this.adaptiveCounter%this.adaptiveInterval===0?(this.timestep=2*this.timestep,this.calculateForces(),this.moveNodes(),this.revert(),this.timestep=.5*this.timestep,this.calculateForces(),this.moveNodes(),this.calculateForces(),this.moveNodes(),this._evaluateStepQuality()===!0?this.timestep=t*this.timestep:this.timestep/ts))return!1;return!0}},{key:"moveNodes", +value:function(){for(var t=this.physicsBody.physicsNodeIndices,e=this.options.maxVelocity?this.options.maxVelocity:1e9,i=0,o=0,n=5,s=0;se?s[t].x>0?e:-e:s[t].x,i.x+=s[t].x*o}else n[t].x=0,s[t].x=0;if(i.options.fixed.y===!1){var h=this.modelOptions.damping*s[t].y,d=(n[t].y-h)/i.options.mass;s[t].y+=d*o,s[t].y=Math.abs(s[t].y)>e?s[t].y>0?e:-e:s[t].y,i.y+=s[t].y*o}else n[t].y=0,s[t].y=0;var l=Math.sqrt(Math.pow(s[t].x,2)+Math.pow(s[t].y,2));return l}},{key:"calculateForces",value:function(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve()}},{key:"_freezeNodes",value:function(){var t=this.body.nodes;for(var e in t)t.hasOwnProperty(e)&&t[e].x&&t[e].y&&(this.freezeCache[e]={x:t[e].options.fixed.x,y:t[e].options.fixed.y},t[e].options.fixed.x=!0,t[e].options.fixed.y=!0)}},{key:"_restoreFrozenNodes",value:function(){var t=this.body.nodes;for(var e in t)t.hasOwnProperty(e)&&void 0!==this.freezeCache[e]&&(t[e].options.fixed.x=this.freezeCache[e].x,t[e].options.fixed.y=this.freezeCache[e].y);this.freezeCache={}}},{key:"stabilize",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.stabilization.iterations;return"number"!=typeof e&&(console.log("The stabilize method needs a numeric amount of iterations. Switching to default: ",this.options.stabilization.iterations),e=this.options.stabilization.iterations),0===this.physicsBody.physicsNodeIndices.length?void(this.ready=!0):(this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=e,this.options.stabilization.onlyDynamicEdges===!0&&this._freezeNodes(),this.stabilizationIterations=0,void setTimeout(function(){return t._stabilizationBatch()},0))}},{key:"_stabilizationBatch",value:function(){this.startedStabilization===!1&&(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0);for(var t=0;this.stabilized===!1&&t0){var t=void 0,e=this.body.nodes,i=this.physicsBody.physicsNodeIndices,o=i.length,n=this._formBarnesHutTree(e,i);this.barnesHutTree=n;for(var s=0;s0&&(this._getForceContribution(n.root.children.NW,t),this._getForceContribution(n.root.children.NE,t),this._getForceContribution(n.root.children.SW,t),this._getForceContribution(n.root.children.SE,t))}}},{key:"_getForceContribution",value:function(t,e){if(t.childrenCount>0){var i=void 0,o=void 0,n=void 0;i=t.centerOfMass.x-e.x,o=t.centerOfMass.y-e.y,n=Math.sqrt(i*i+o*o),n*t.calcSize>this.thetaInversed?this._calculateForces(n,i,o,e,t):4===t.childrenCount?(this._getForceContribution(t.children.NW,e),this._getForceContribution(t.children.NE,e),this._getForceContribution(t.children.SW,e),this._getForceContribution(t.children.SE,e)):t.children.data.id!=e.id&&this._calculateForces(n,i,o,e,t)}}},{key:"_calculateForces",value:function(t,e,i,o,n){0===t&&(t=.1,e=t),this.overlapAvoidanceFactor<1&&o.shape.radius&&(t=Math.max(.1+this.overlapAvoidanceFactor*o.shape.radius,t-o.shape.radius));var s=this.options.gravitationalConstant*n.mass*o.options.mass/Math.pow(t,3),r=e*s,a=i*s;this.physicsBody.forces[o.id].x+=r,this.physicsBody.forces[o.id].y+=a}},{key:"_formBarnesHutTree",value:function(t,e){for(var i=void 0,o=e.length,n=t[e[0]].x,s=t[e[0]].y,r=t[e[0]].x,a=t[e[0]].y,h=1;h0&&(dr&&(r=d),la&&(a=l))}var u=Math.abs(r-n)-Math.abs(a-s);u>0?(s-=.5*u,a+=.5*u):(n+=.5*u,r-=.5*u);var c=1e-5,p=Math.max(c,Math.abs(r-n)),f=.5*p,m=.5*(n+r),v=.5*(s+a),g={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:m-f,maxX:m+f,minY:v-f,maxY:v+f},size:p,calcSize:1/p,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(g.root);for(var y=0;y0&&this._placeInTree(g.root,i);return g}},{key:"_updateBranchMass",value:function(t,e){var i=t.mass+e.options.mass,o=1/i;t.centerOfMass.x=t.centerOfMass.x*t.mass+e.x*e.options.mass,t.centerOfMass.x*=o,t.centerOfMass.y=t.centerOfMass.y*t.mass+e.y*e.options.mass,t.centerOfMass.y*=o,t.mass=i;var n=Math.max(Math.max(e.height,e.radius),e.width);t.maxWidth=t.maxWidthe.x?t.children.NW.range.maxY>e.y?this._placeInRegion(t,e,"NW"):this._placeInRegion(t,e,"SW"):t.children.NW.range.maxY>e.y?this._placeInRegion(t,e,"NE"):this._placeInRegion(t,e,"SE")}},{key:"_placeInRegion",value:function(t,e,i){switch(t.children[i].childrenCount){case 0:t.children[i].children.data=e,t.children[i].childrenCount=1,this._updateBranchMass(t.children[i],e);break;case 1:t.children[i].children.data.x===e.x&&t.children[i].children.data.y===e.y?(e.x+=this.seededRandom(),e.y+=this.seededRandom()):(this._splitBranch(t.children[i]),this._placeInTree(t.children[i],e));break;case 4:this._placeInTree(t.children[i],e)}}},{key:"_splitBranch",value:function(t){var e=null;1===t.childrenCount&&(e=t.children.data,t.mass=0,t.centerOfMass.x=0,t.centerOfMass.y=0),t.childrenCount=4,t.children.data=null,this._insertRegion(t,"NW"),this._insertRegion(t,"NE"),this._insertRegion(t,"SW"),this._insertRegion(t,"SE"),null!=e&&this._placeInTree(t,e)}},{key:"_insertRegion",value:function(t,e){var i=void 0,o=void 0,n=void 0,s=void 0,r=.5*t.size;switch(e){case"NW":i=t.range.minX,o=t.range.minX+r,n=t.range.minY,s=t.range.minY+r;break;case"NE":i=t.range.minX+r,o=t.range.maxX,n=t.range.minY,s=t.range.minY+r;break;case"SW":i=t.range.minX,o=t.range.minX+r,n=t.range.minY+r,s=t.range.maxY;break;case"SE":i=t.range.minX+r,o=t.range.maxX,n=t.range.minY+r,s=t.range.maxY}t.children[e]={centerOfMass:{x:0,y:0},mass:0,range:{minX:i,maxX:o,minY:n,maxY:s},size:.5*t.size,calcSize:2*t.calcSize,children:{data:null},maxWidth:0,level:t.level+1,childrenCount:0}}},{key:"_debug",value:function(t,e){void 0!==this.barnesHutTree&&(t.lineWidth=1,this._drawBranch(this.barnesHutTree.root,t,e))}},{key:"_drawBranch",value:function(t,e,i){void 0===i&&(i="#FF0000"),4===t.childrenCount&&(this._drawBranch(t.children.NW,e),this._drawBranch(t.children.NE,e),this._drawBranch(t.children.SE,e),this._drawBranch(t.children.SW,e)),e.strokeStyle=i,e.beginPath(),e.moveTo(t.range.minX,t.range.minY),e.lineTo(t.range.maxX,t.range.minY),e.stroke(),e.beginPath(),e.moveTo(t.range.maxX,t.range.minY),e.lineTo(t.range.maxX,t.range.maxY),e.stroke(),e.beginPath(),e.moveTo(t.range.maxX,t.range.maxY),e.lineTo(t.range.minX,t.range.maxY),e.stroke(),e.beginPath(),e.moveTo(t.range.minX,t.range.maxY),e.lineTo(t.range.minX,t.range.minY),e.stroke()}}]),t}();e.default=h},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(115),s=o(n),r=i(116),a=o(r),h=function(){function t(e,i,o){(0,s.default)(this,t),this.body=e,this.physicsBody=i,this.setOptions(o)}return(0,a.default)(t,[{key:"setOptions",value:function(t){this.options=t}},{key:"solve",value:function(){for(var t,e,i,o,n,s,r,a,h=this.body.nodes,d=this.physicsBody.physicsNodeIndices,l=this.physicsBody.forces,u=this.options.nodeDistance,c=-2/3/u,p=4/3,f=0;f0){var s=n.edges.length+1,r=this.options.centralGravity*s*n.options.mass;o[n.id].x=e*r,o[n.id].y=i*r}}}]),e}(m.default);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(58),s=o(n),r=i(62),a=o(r),h=i(115),d=o(h),l=i(116),u=o(l),c=i(210),p=o(c),f=i(211),m=o(f),v=i(1),g=function(){function t(e){var i=this;(0,d.default)(this,t),this.body=e,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},v.extend(this.options,this.defaultOptions),this.body.emitter.on("_resetData",function(){i.clusteredNodes={},i.clusteredEdges={}})}return(0,u.default)(t,[{key:"clusterByHubsize",value:function(t,e){void 0===t?t=this._getHubSize():"object"===("undefined"==typeof t?"undefined":(0,a.default)(t))&&(e=this._checkOptions(t),t=this._getHubSize());for(var i=[],o=0;o=t&&i.push(n.id)}for(var s=0;s0&&void 0!==arguments[0]?arguments[0]:{},e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(void 0===t.joinCondition)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");t=this._checkOptions(t);for(var i={},o={},n=0;n2&&void 0!==arguments[2])||arguments[2];e=this._checkOptions(e);for(var o=[],n={},r=void 0,a=void 0,h=void 0,d=void 0,l=void 0,u=0;u0&&(0,s.default)(f).length>0&&v===!0&&o.push({nodes:c,edges:f})}}}for(var _=0;_1&&void 0!==arguments[1])||arguments[1];this.clusterByEdgeCount(1,t,e)}},{key:"clusterBridges",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.clusterByEdgeCount(2,t,e)}},{key:"clusterByConnection",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0===t)throw new Error("No nodeId supplied to clusterByConnection!");if(void 0===this.body.nodes[t])throw new Error("The nodeId given to clusterByConnection does not exist!");var o=this.body.nodes[t];e=this._checkOptions(e,o),void 0===e.clusterNodeProperties.x&&(e.clusterNodeProperties.x=o.x),void 0===e.clusterNodeProperties.y&&(e.clusterNodeProperties.y=o.y),void 0===e.clusterNodeProperties.fixed&&(e.clusterNodeProperties.fixed={},e.clusterNodeProperties.fixed.x=o.options.fixed.x,e.clusterNodeProperties.fixed.y=o.options.fixed.y);var n={},r={},a=o.id,h=p.default.cloneOptions(o);n[a]=o;for(var d=0;d-1&&(r[g.id]=g)}this._cluster(n,r,e,i)}},{key:"_createClusterEdges",value:function(t,e,i,o){for(var n=void 0,r=void 0,a=void 0,h=void 0,d=void 0,l=void 0,u=(0,s.default)(t),c=[],f=0;f0&&void 0!==arguments[0]?arguments[0]:{};return void 0===t.clusterEdgeProperties&&(t.clusterEdgeProperties={}),void 0===t.clusterNodeProperties&&(t.clusterNodeProperties={}),t}},{key:"_cluster",value:function(t,e,i){var o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(0!=(0,s.default)(t).length&&(1!=(0,s.default)(t).length||1==i.clusterNodeProperties.allowSingleNodeCluster)){for(var n in t)if(t.hasOwnProperty(n)&&void 0!==this.clusteredNodes[n])return;var r=v.deepExtend({},i.clusterNodeProperties);if(void 0!==i.processProperties){var a=[];for(var h in t)if(t.hasOwnProperty(h)){var d=p.default.cloneOptions(t[h]);a.push(d)}var l=[];for(var u in e)if(e.hasOwnProperty(u)&&"clusterEdge:"!==u.substr(0,12)){var c=p.default.cloneOptions(e[u],"edge");l.push(c)}if(r=i.processProperties(r,a,l),!r)throw new Error("The processProperties function does not return properties!")}void 0===r.id&&(r.id="cluster:"+v.randomUUID());var f=r.id;void 0===r.label&&(r.label="cluster");var g=void 0;void 0===r.x&&(g=this._getClusterPosition(t),r.x=g.x),void 0===r.y&&(void 0===g&&(g=this._getClusterPosition(t)),r.y=g.y),r.id=f;var y=this.body.functions.createNode(r,m.default);y.isCluster=!0,y.containedNodes=t,y.containedEdges=e,y.clusterEdgeProperties=i.clusterEdgeProperties,this.body.nodes[r.id]=y,this._createClusterEdges(t,e,r,i.clusterEdgeProperties);for(var b in e)if(e.hasOwnProperty(b)&&void 0!==this.body.edges[b]){var _=this.body.edges[b];this._backupEdgeOptions(_),_.setOptions({physics:!1,hidden:!0})}for(var w in t)t.hasOwnProperty(w)&&(this.clusteredNodes[w]={clusterId:r.id,node:this.body.nodes[w]},this.body.nodes[w].setOptions({hidden:!0,physics:!1}));r.id=void 0,o===!0&&this.body.emitter.emit("_dataChanged")}}},{key:"_backupEdgeOptions",value:function(t){void 0===this.clusteredEdges[t.id]&&(this.clusteredEdges[t.id]={physics:t.options.physics,hidden:t.options.hidden})}},{key:"_restoreEdge",value:function(t){var e=this.clusteredEdges[t.id];void 0!==e&&(t.setOptions({physics:e.physics,hidden:e.hidden}),delete this.clusteredEdges[t.id])}},{key:"isCluster",value:function(t){return void 0!==this.body.nodes[t]?this.body.nodes[t].isCluster===!0:(console.log("Node does not exist."),!1)}},{key:"_getClusterPosition",value:function(t){for(var e=(0,s.default)(t),i=t[e[0]].x,o=t[e[0]].x,n=t[e[0]].y,r=t[e[0]].y,a=void 0,h=1;ho?a.x:o,n=a.yr?a.y:r;return{x:.5*(i+o),y:.5*(n+r)}}},{key:"openCluster",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0===t)throw new Error("No clusterNodeId supplied to openCluster.");if(void 0===this.body.nodes[t])throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(void 0===this.body.nodes[t].containedNodes)return void console.log("The node:"+t+" is not a cluster.");var o=this.body.nodes[t],n=o.containedNodes,s=o.containedEdges;if(void 0!==e&&void 0!==e.releaseFunction&&"function"==typeof e.releaseFunction){var r={},a={x:o.x,y:o.y};for(var h in n)if(n.hasOwnProperty(h)){var d=this.body.nodes[h];r[h]={x:d.x,y:d.y}}var l=e.releaseFunction(a,r);for(var u in n)if(n.hasOwnProperty(u)){var c=this.body.nodes[u];void 0!==l[u]&&(c.x=void 0===l[u].x?o.x:l[u].x,c.y=void 0===l[u].y?o.y:l[u].y)}}else for(var f in n)if(n.hasOwnProperty(f)){var m=this.body.nodes[f];m=n[f],m.options.fixed.x===!1&&(m.x=o.x),m.options.fixed.y===!1&&(m.y=o.y)}for(var g in n)if(n.hasOwnProperty(g)){var y=this.body.nodes[g];y.vx=o.vx,y.vy=o.vy,y.setOptions({hidden:!1,physics:!0}),delete this.clusteredNodes[g]}for(var b=[],_=0;_o&&(o=s.edges.length),t+=s.edges.length,e+=Math.pow(s.edges.length,2),i+=1}t/=i,e/=i;var r=e-Math.pow(t,2),a=Math.sqrt(r),h=Math.floor(t+2*a);return h>o&&(h=o),h}}]),t}();e.default=g},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(115),s=o(n),r=i(116),a=o(r),h=i(1),d=function(){function t(){(0,s.default)(this,t)}return(0,a.default)(t,null,[{key:"getRange",value:function(t){var e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=1e9,n=-1e9,s=1e9,r=-1e9;if(i.length>0)for(var a=0;ae.shape.boundingBox.left&&(s=e.shape.boundingBox.left),re.shape.boundingBox.top&&(o=e.shape.boundingBox.top),n1&&void 0!==arguments[1]?arguments[1]:[],o=1e9,n=-1e9,s=1e9,r=-1e9;if(i.length>0)for(var a=0;ae.x&&(s=e.x),re.y&&(o=e.y),n0,t.renderTimer=void 0}),this.body.emitter.on("destroy",function(){t.renderRequests=0,t.allowRedraw=!1,t.renderingActive=!1,t.requiresTimeout===!0?clearTimeout(t.renderTimer):cancelAnimationFrame(t.renderTimer),t.body.emitter.off()})}},{key:"setOptions",value:function(t){if(void 0!==t){var e=["hideEdgesOnDrag","hideNodesOnDrag"];h.selectiveDeepExtend(e,this.options,t)}}},{key:"_startRendering",value:function(){this.renderingActive===!0&&void 0===this.renderTimer&&(this.requiresTimeout===!0?this.renderTimer=window.setTimeout(this._renderStep.bind(this),this.simulationInterval):this.renderTimer=window.requestAnimationFrame(this._renderStep.bind(this)))}},{key:"_renderStep",value:function(){this.renderingActive===!0&&(this.renderTimer=void 0,this.requiresTimeout===!0&&this._startRendering(),this._redraw(),this.requiresTimeout===!1&&this._startRendering())}},{key:"redraw",value:function(){this.body.emitter.emit("setSize"),this._redraw()}},{key:"_requestRedraw",value:function(){var t=this;this.redrawRequested!==!0&&this.renderingActive===!1&&this.allowRedraw===!0&&(this.redrawRequested=!0,this.requiresTimeout===!0?window.setTimeout(function(){t._redraw(!1)},0):window.requestAnimationFrame(function(){t._redraw(!1)}))}},{key:"_redraw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0]; +if(this.allowRedraw===!0){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1;var e=this.canvas.frame.canvas.getContext("2d");0!==this.canvas.frame.canvas.width&&0!==this.canvas.frame.canvas.height||this.canvas.setSize(),this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1),e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var i=this.canvas.frame.canvas.clientWidth,o=this.canvas.frame.canvas.clientHeight;if(e.clearRect(0,0,i,o),0===this.canvas.frame.clientWidth)return;e.save(),e.translate(this.body.view.translation.x,this.body.view.translation.y),e.scale(this.body.view.scale,this.body.view.scale),e.beginPath(),this.body.emitter.emit("beforeDrawing",e),e.closePath(),t===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&this._drawEdges(e),(this.dragging===!1||this.dragging===!0&&this.options.hideNodesOnDrag===!1)&&this._drawNodes(e,t),e.beginPath(),this.body.emitter.emit("afterDrawing",e),e.closePath(),e.restore(),t===!0&&e.clearRect(0,0,i,o)}}},{key:"_resizeNodes",value:function(){var t=this.canvas.frame.canvas.getContext("2d");void 0===this.pixelRatio&&(this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)),t.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0),t.save(),t.translate(this.body.view.translation.x,this.body.view.translation.y),t.scale(this.body.view.scale,this.body.view.scale);var e=this.body.nodes,i=void 0;for(var o in e)e.hasOwnProperty(o)&&(i=e[o],i.resize(t),i.updateBoundingBox(t,i.selected));t.restore()}},{key:"_drawNodes",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.body.nodes,o=this.body.nodeIndices,n=void 0,s=[],r=20,a=this.canvas.DOMtoCanvas({x:-r,y:-r}),h=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+r,y:this.canvas.frame.canvas.clientHeight+r}),d={top:a.y,left:a.x,bottom:h.y,right:h.x},l=0;l0&&void 0!==arguments[0]?arguments[0]:this.pixelRatio;this.initialized===!0&&(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&&this.cameraState.previousWidth>0){var t=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,e=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight,i=this.cameraState.scale;1!=t&&1!=e?i=.5*this.cameraState.scale*(t+e):1!=t?i=this.cameraState.scale*t:1!=e&&(i=this.cameraState.scale*e),this.body.view.scale=i;var o=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),n={x:o.x-this.cameraState.position.x,y:o.y-this.cameraState.position.y};this.body.view.translation.x+=n.x*this.body.view.scale,this.body.view.translation.y+=n.y*this.body.view.scale}}},{key:"_prepareValue",value:function(t){if("number"==typeof t)return t+"px";if("string"==typeof t){if(t.indexOf("%")!==-1||t.indexOf("px")!==-1)return t;if(t.indexOf("%")===-1)return t+"px"}throw new Error("Could not use the value supplied for width or height:"+t)}},{key:"_create",value:function(){for(;this.body.container.hasChildNodes();)this.body.container.removeChild(this.body.container.firstChild);if(this.frame=document.createElement("div"),this.frame.className="vis-network",this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.tabIndex=900,this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas),this.frame.canvas.getContext){var t=this.frame.canvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1),this.frame.canvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}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 h(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:h.DIRECTION_ALL}),d.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 h(this.frame),d.onRelease(this.hammerFrame,function(e){t.body.eventListeners.onRelease(e)})}},{key:"setSize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.width,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.height;t=this._prepareValue(t),e=this._prepareValue(e);var i=!1,o=this.frame.canvas.width,n=this.frame.canvas.height,s=this.frame.canvas.getContext("2d"),r=this.pixelRatio;return this.pixelRatio=(window.devicePixelRatio||1)/(s.webkitBackingStorePixelRatio||s.mozBackingStorePixelRatio||s.msBackingStorePixelRatio||s.oBackingStorePixelRatio||s.backingStorePixelRatio||1),t!=this.options.width||e!=this.options.height||this.frame.style.width!=t||this.frame.style.height!=e?(this._getCameraState(r),this.frame.style.width=t,this.frame.style.height=e,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=t,this.options.height=e,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},i=!0):(this.frame.canvas.width==Math.round(this.frame.canvas.clientWidth*this.pixelRatio)&&this.frame.canvas.height==Math.round(this.frame.canvas.clientHeight*this.pixelRatio)||this._getCameraState(r),this.frame.canvas.width!=Math.round(this.frame.canvas.clientWidth*this.pixelRatio)&&(this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),i=!0),this.frame.canvas.height!=Math.round(this.frame.canvas.clientHeight*this.pixelRatio)&&(this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),i=!0)),i===!0&&(this.body.emitter.emit("resize",{width:Math.round(this.frame.canvas.width/this.pixelRatio),height:Math.round(this.frame.canvas.height/this.pixelRatio),oldWidth:Math.round(o/this.pixelRatio),oldHeight:Math.round(n/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,i}},{key:"_XconvertDOMtoCanvas",value:function(t){return(t-this.body.view.translation.x)/this.body.view.scale}},{key:"_XconvertCanvasToDOM",value:function(t){return t*this.body.view.scale+this.body.view.translation.x}},{key:"_YconvertDOMtoCanvas",value:function(t){return(t-this.body.view.translation.y)/this.body.view.scale}},{key:"_YconvertCanvasToDOM",value:function(t){return t*this.body.view.scale+this.body.view.translation.y}},{key:"canvasToDOM",value:function(t){return{x:this._XconvertCanvasToDOM(t.x),y:this._YconvertCanvasToDOM(t.y)}}},{key:"DOMtoCanvas",value:function(t){return{x:this._XconvertDOMtoCanvas(t.x),y:this._YconvertDOMtoCanvas(t.y)}}}]),t}();e.default=u},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(115),s=o(n),r=i(116),a=o(r),h=i(210),d=o(h),l=i(1),u=function(){function t(e,i){var o=this;(0,s.default)(this,t),this.body=e,this.canvas=i,this.animationSpeed=1/this.renderRefreshRate,this.animationEasingFunction="easeInOutQuint",this.easingTime=0,this.sourceScale=0,this.targetScale=0,this.sourceTranslation=0,this.targetTranslation=0,this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0,this.touchTime=0,this.viewFunction=void 0,this.body.emitter.on("fit",this.fit.bind(this)),this.body.emitter.on("animationFinished",function(){o.body.emitter.emit("_stopRendering")}),this.body.emitter.on("unlockNode",this.releaseNode.bind(this))}return(0,a.default)(t,[{key:"setOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=t}},{key:"fit",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{nodes:[]},e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=void 0,o=void 0;if(void 0!==t.nodes&&0!==t.nodes.length||(t.nodes=this.body.nodeIndices),e===!0){var n=0;for(var s in this.body.nodes)if(this.body.nodes.hasOwnProperty(s)){var r=this.body.nodes[s];r.predefinedPosition===!0&&(n+=1)}if(n>.5*this.body.nodeIndices.length)return void this.fit(t,!1);i=d.default.getRange(this.body.nodes,t.nodes);var a=this.body.nodeIndices.length;o=12.662/(a+7.4147)+.0964822;var h=Math.min(this.canvas.frame.canvas.clientWidth/600,this.canvas.frame.canvas.clientHeight/600);o*=h}else{this.body.emitter.emit("_resizeNodes"),i=d.default.getRange(this.body.nodes,t.nodes);var l=1.1*Math.abs(i.maxX-i.minX),u=1.1*Math.abs(i.maxY-i.minY),c=this.canvas.frame.canvas.clientWidth/l,p=this.canvas.frame.canvas.clientHeight/u;o=c<=p?c:p}o>1?o=1:0===o&&(o=1);var f=d.default.findCenter(i),m={position:f,scale:o,animation:t.animation};this.moveTo(m)}},{key:"focus",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(void 0!==this.body.nodes[t]){var i={x:this.body.nodes[t].x,y:this.body.nodes[t].y};e.position=i,e.lockedOnNode=t,this.moveTo(e)}else console.log("Node: "+t+" cannot be found.")}},{key:"moveTo",value:function(t){return void 0===t?void(t={}):(void 0===t.offset&&(t.offset={x:0,y:0}),void 0===t.offset.x&&(t.offset.x=0),void 0===t.offset.y&&(t.offset.y=0),void 0===t.scale&&(t.scale=this.body.view.scale),void 0===t.position&&(t.position=this.getViewPosition()),void 0===t.animation&&(t.animation={duration:0}),t.animation===!1&&(t.animation={duration:0}),t.animation===!0&&(t.animation={}),void 0===t.animation.duration&&(t.animation.duration=1e3),void 0===t.animation.easingFunction&&(t.animation.easingFunction="easeInOutQuad"),void this.animateView(t))}},{key:"animateView",value:function(t){if(void 0!==t){this.animationEasingFunction=t.animation.easingFunction,this.releaseNode(),t.locked===!0&&(this.lockedOnNodeId=t.lockedOnNode,this.lockedOnNodeOffset=t.offset),0!=this.easingTime&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=t.scale,this.body.view.scale=this.targetScale;var e=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),i={x:e.x-t.position.x,y:e.y-t.position.y};this.targetTranslation={x:this.sourceTranslation.x+i.x*this.targetScale+t.offset.x,y:this.sourceTranslation.y+i.y*this.targetScale+t.offset.y},0===t.animation.duration?void 0!=this.lockedOnNodeId?(this.viewFunction=this._lockedRedraw.bind(this),this.body.emitter.on("initRedraw",this.viewFunction)):(this.body.view.scale=this.targetScale,this.body.view.translation=this.targetTranslation,this.body.emitter.emit("_requestRedraw")):(this.animationSpeed=1/(60*t.animation.duration*.001)||1/60,this.animationEasingFunction=t.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 t={x:this.body.nodes[this.lockedOnNodeId].x,y:this.body.nodes[this.lockedOnNodeId].y},e=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),i={x:e.x-t.x,y:e.y-t.y},o=this.body.view.translation,n={x:o.x+i.x*this.body.view.scale+this.lockedOnNodeOffset.x,y:o.y+i.y*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=n}},{key:"releaseNode",value:function(){void 0!==this.lockedOnNodeId&&void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}},{key:"_transitionRedraw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.easingTime+=this.animationSpeed,this.easingTime=t===!0?1:this.easingTime;var e=l.easingFunctions[this.animationEasingFunction](this.easingTime);this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*e,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*e,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*e},this.easingTime>=1&&(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,void 0!=this.lockedOnNodeId&&(this.viewFunction=this._lockedRedraw.bind(this),this.body.emitter.on("initRedraw",this.viewFunction)),this.body.emitter.emit("animationFinished"))}},{key:"getScale",value:function(){return this.body.view.scale}},{key:"getViewPosition",value:function(){return this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight})}}]),t}();e.default=u},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(115),s=o(n),r=i(116),a=o(r),h=i(216),d=o(h),l=i(128),u=o(l),c=i(1),p=function(){function t(e,i,o){(0,s.default)(this,t),this.body=e,this.canvas=i,this.selectionHandler=o,this.navigationHandler=new d.default(e,i),this.body.eventListeners.onTap=this.onTap.bind(this),this.body.eventListeners.onTouch=this.onTouch.bind(this),this.body.eventListeners.onDoubleTap=this.onDoubleTap.bind(this),this.body.eventListeners.onHold=this.onHold.bind(this),this.body.eventListeners.onDragStart=this.onDragStart.bind(this),this.body.eventListeners.onDrag=this.onDrag.bind(this),this.body.eventListeners.onDragEnd=this.onDragEnd.bind(this),this.body.eventListeners.onMouseWheel=this.onMouseWheel.bind(this),this.body.eventListeners.onPinch=this.onPinch.bind(this),this.body.eventListeners.onMouseMove=this.onMouseMove.bind(this),this.body.eventListeners.onRelease=this.onRelease.bind(this),this.body.eventListeners.onContext=this.onContext.bind(this),this.touchTime=0,this.drag={},this.pinch={},this.popup=void 0,this.popupObj=void 0,this.popupTimer=void 0,this.body.functions.getPointer=this.getPointer.bind(this),this.options={},this.defaultOptions={dragNodes:!0,dragView:!0,hover:!1,keyboard:{enabled:!1,speed:{x:10,y:10,zoom:.02},bindToWindow:!0},navigationButtons:!1,tooltipDelay:300,zoomView:!0},c.extend(this.options,this.defaultOptions),this.bindEventListeners()}return(0,a.default)(t,[{key:"bindEventListeners",value:function(){var t=this;this.body.emitter.on("destroy",function(){clearTimeout(t.popupTimer),delete t.body.functions.getPointer})}},{key:"setOptions",value:function(t){if(void 0!==t){var e=["hideEdgesOnDrag","hideNodesOnDrag","keyboard","multiselect","selectable","selectConnectedEdges"];c.selectiveNotDeepExtend(e,this.options,t),c.mergeOptions(this.options,t,"keyboard"),t.tooltip&&(c.extend(this.options.tooltip,t.tooltip),t.tooltip.color&&(this.options.tooltip.color=c.parseColor(t.tooltip.color)))}this.navigationHandler.setOptions(this.options)}},{key:"getPointer",value:function(t){return{x:t.x-c.getAbsoluteLeft(this.canvas.frame.canvas),y:t.y-c.getAbsoluteTop(this.canvas.frame.canvas)}}},{key:"onTouch",value:function(t){(new Date).valueOf()-this.touchTime>50&&(this.drag.pointer=this.getPointer(t.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=(new Date).valueOf())}},{key:"onTap",value:function(t){var e=this.getPointer(t.center),i=this.selectionHandler.options.multiselect&&(t.changedPointers[0].ctrlKey||t.changedPointers[0].metaKey);this.checkSelectionChanges(e,t,i),this.selectionHandler._generateClickEvent("click",t,e)}},{key:"onDoubleTap",value:function(t){var e=this.getPointer(t.center);this.selectionHandler._generateClickEvent("doubleClick",t,e)}},{key:"onHold",value:function(t){var e=this.getPointer(t.center),i=this.selectionHandler.options.multiselect;this.checkSelectionChanges(e,t,i),this.selectionHandler._generateClickEvent("click",t,e),this.selectionHandler._generateClickEvent("hold",t,e)}},{key:"onRelease",value:function(t){if((new Date).valueOf()-this.touchTime>10){var e=this.getPointer(t.center);this.selectionHandler._generateClickEvent("release",t,e),this.touchTime=(new Date).valueOf()}}},{key:"onContext",value:function(t){var e=this.getPointer({x:t.clientX,y:t.clientY});this.selectionHandler._generateClickEvent("oncontext",t,e)}},{key:"checkSelectionChanges",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=this.selectionHandler._getSelectedEdgeCount(),n=this.selectionHandler._getSelectedNodeCount(),s=this.selectionHandler.getSelection(),r=void 0;r=i===!0?this.selectionHandler.selectAdditionalOnPoint(t):this.selectionHandler.selectOnPoint(t);var a=this.selectionHandler._getSelectedEdgeCount(),h=this.selectionHandler._getSelectedNodeCount(),d=this.selectionHandler.getSelection(),l=this._determineIfDifferent(s,d),u=l.nodesChanged,c=l.edgesChanged,p=!1;h-n>0?(this.selectionHandler._generateClickEvent("selectNode",e,t),r=!0,p=!0):u===!0&&h>0?(this.selectionHandler._generateClickEvent("deselectNode",e,t,s),this.selectionHandler._generateClickEvent("selectNode",e,t),p=!0,r=!0):h-n<0&&(this.selectionHandler._generateClickEvent("deselectNode",e,t,s),r=!0),a-o>0&&p===!1?(this.selectionHandler._generateClickEvent("selectEdge",e,t),r=!0):a>0&&c===!0?(this.selectionHandler._generateClickEvent("deselectEdge",e,t,s),this.selectionHandler._generateClickEvent("selectEdge",e,t),r=!0):a-o<0&&(this.selectionHandler._generateClickEvent("deselectEdge",e,t,s),r=!0),r===!0&&this.selectionHandler._generateClickEvent("select",e,t)}},{key:"_determineIfDifferent",value:function(t,e){for(var i=!1,o=!1,n=0;n10&&(t=10);var o=void 0;void 0!==this.drag&&this.drag.dragging===!0&&(o=this.canvas.DOMtoCanvas(this.drag.pointer));var n=this.body.view.translation,s=t/i,r=(1-s)*e.x+n.x*s,a=(1-s)*e.y+n.y*s;if(this.body.view.scale=t,this.body.view.translation={x:r,y:a},void 0!=o){var h=this.canvas.canvasToDOM(o);this.drag.pointer.x=h.x,this.drag.pointer.y=h.y}this.body.emitter.emit("_requestRedraw"),i0&&(this.popupObj=h[l[l.length-1]],s=!0)}if(void 0===this.popupObj&&s===!1){for(var p=this.body.edgeIndices,f=this.body.edges,m=void 0,v=[],g=0;g0&&(this.popupObj=f[v[v.length-1]],r="edge")}void 0!==this.popupObj?this.popupObj.id!==n&&(void 0===this.popup&&(this.popup=new u.default(this.canvas.frame)),this.popup.popupTargetType=r,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(t.x+3,t.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(t){var e=this.selectionHandler._pointerToPositionObject(t),i=!1;if("node"===this.popup.popupTargetType){if(void 0!==this.body.nodes[this.popup.popupTargetId]&&(i=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(e),i===!0)){var o=this.selectionHandler.getNodeAt(t);i=void 0!==o&&o.id===this.popup.popupTargetId}}else void 0===this.selectionHandler.getNodeAt(t)&&void 0!==this.body.edges[this.popup.popupTargetId]&&(i=this.body.edges[this.popup.popupTargetId].isOverlappingWith(e));i===!1&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}}]),t}();e.default=p},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(115),s=o(n),r=i(116),a=o(r),h=(i(1),i(108)),d=i(121),l=i(111),u=function(){function t(e,i){var o=this;(0,s.default)(this,t),this.body=e,this.canvas=i,this.iconsCreated=!1,this.navigationHammers=[],this.boundFunctions={},this.touchTime=0,this.activated=!1,this.body.emitter.on("activate",function(){o.activated=!0,o.configureKeyboardBindings()}),this.body.emitter.on("deactivate",function(){o.activated=!1,o.configureKeyboardBindings()}),this.body.emitter.on("destroy",function(){void 0!==o.keycharm&&o.keycharm.destroy()}),this.options={}}return(0,a.default)(t,[{key:"setOptions",value:function(t){void 0!==t&&(this.options=t,this.create())}},{key:"create",value:function(){this.options.navigationButtons===!0?this.iconsCreated===!1&&this.loadNavigationElements():this.iconsCreated===!0&&this.cleanNavigation(),this.configureKeyboardBindings()}},{key:"cleanNavigation",value:function(){if(0!=this.navigationHammers.length){for(var t=0;t700&&(this.body.emitter.emit("fit",{duration:700}),this.touchTime=(new Date).valueOf())}},{key:"_stopMovement",value:function(){for(var t in this.boundFunctions)this.boundFunctions.hasOwnProperty(t)&&(this.body.emitter.off("initRedraw",this.boundFunctions[t]),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 t=this.body.view.scale,e=this.body.view.scale*(1+this.options.keyboard.speed.zoom),i=this.body.view.translation,o=e/t,n=(1-o)*this.canvas.canvasViewCenter.x+i.x*o,s=(1-o)*this.canvas.canvasViewCenter.y+i.y*o;this.body.view.scale=e,this.body.view.translation={x:n,y:s},this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:pointer})}},{key:"_zoomOut",value:function(){var t=this.body.view.scale,e=this.body.view.scale/(1+this.options.keyboard.speed.zoom),i=this.body.view.translation,o=e/t,n=(1-o)*this.canvas.canvasViewCenter.x+i.x*o,s=(1-o)*this.canvas.canvasViewCenter.y+i.y*o;this.body.view.scale=e,this.body.view.translation={x:n,y:s},this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:pointer})}},{key:"configureKeyboardBindings",value:function(){ +var t=this;void 0!==this.keycharm&&this.keycharm.destroy(),this.options.keyboard.enabled===!0&&(this.options.keyboard.bindToWindow===!0?this.keycharm=l({container:window,preventDefault:!0}):this.keycharm=l({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),this.activated===!0&&(this.keycharm.bind("up",function(){t.bindToRedraw("_moveUp")},"keydown"),this.keycharm.bind("down",function(){t.bindToRedraw("_moveDown")},"keydown"),this.keycharm.bind("left",function(){t.bindToRedraw("_moveLeft")},"keydown"),this.keycharm.bind("right",function(){t.bindToRedraw("_moveRight")},"keydown"),this.keycharm.bind("=",function(){t.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("num+",function(){t.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("num-",function(){t.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("-",function(){t.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("[",function(){t.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("]",function(){t.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("pageup",function(){t.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("pagedown",function(){t.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("up",function(){t.unbindFromRedraw("_moveUp")},"keyup"),this.keycharm.bind("down",function(){t.unbindFromRedraw("_moveDown")},"keyup"),this.keycharm.bind("left",function(){t.unbindFromRedraw("_moveLeft")},"keyup"),this.keycharm.bind("right",function(){t.unbindFromRedraw("_moveRight")},"keyup"),this.keycharm.bind("=",function(){t.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("num+",function(){t.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("num-",function(){t.unbindFromRedraw("_zoomOut")},"keyup"),this.keycharm.bind("-",function(){t.unbindFromRedraw("_zoomOut")},"keyup"),this.keycharm.bind("[",function(){t.unbindFromRedraw("_zoomOut")},"keyup"),this.keycharm.bind("]",function(){t.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("pageup",function(){t.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("pagedown",function(){t.unbindFromRedraw("_zoomOut")},"keyup")))}}]),t}();e.default=u},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(115),s=o(n),r=i(116),a=o(r),h=i(159),d=o(h),l=i(192),u=o(l),c=i(1),p=function(){function t(e,i){var o=this;(0,s.default)(this,t),this.body=e,this.canvas=i,this.selectionObj={nodes:[],edges:[]},this.hoverObj={nodes:{},edges:{}},this.options={},this.defaultOptions={multiselect:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0},c.extend(this.options,this.defaultOptions),this.body.emitter.on("_dataChanged",function(){o.updateSelection()})}return(0,a.default)(t,[{key:"setOptions",value:function(t){if(void 0!==t){var e=["multiselect","hoverConnectedEdges","selectable","selectConnectedEdges"];c.selectiveDeepExtend(e,this.options,t)}}},{key:"selectOnPoint",value:function(t){var e=!1;if(this.options.selectable===!0){var i=this.getNodeAt(t)||this.getEdgeAt(t);this.unselectAll(),void 0!==i&&(e=this.selectObject(i)),this.body.emitter.emit("_requestRedraw")}return e}},{key:"selectAdditionalOnPoint",value:function(t){var e=!1;if(this.options.selectable===!0){var i=this.getNodeAt(t)||this.getEdgeAt(t);void 0!==i&&(e=!0,i.isSelected()===!0?this.deselectObject(i):this.selectObject(i),this.body.emitter.emit("_requestRedraw"))}return e}},{key:"_generateClickEvent",value:function(t,e,i,o){var n=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=void 0;s=n===!0?{nodes:[],edges:[]}:this.getSelection(),s.pointer={DOM:{x:i.x,y:i.y},canvas:this.canvas.DOMtoCanvas(i)},s.event=e,void 0!==o&&(s.previousSelection=o),this.body.emitter.emit(t,s)}},{key:"selectObject",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.selectConnectedEdges;return void 0!==t&&(t instanceof d.default&&e===!0&&this._selectConnectedEdges(t),t.select(),this._addToSelection(t),!0)}},{key:"deselectObject",value:function(t){t.isSelected()===!0&&(t.selected=!1,this._removeFromSelection(t))}},{key:"_getAllNodesOverlappingWith",value:function(t){for(var e=[],i=this.body.nodes,o=0;o1&&void 0!==arguments[1])||arguments[1],i=this._pointerToPositionObject(t),o=this._getAllNodesOverlappingWith(i);return o.length>0?e===!0?this.body.nodes[o[o.length-1]]:o[o.length-1]:void 0}},{key:"_getEdgesOverlappingWith",value:function(t,e){for(var i=this.body.edges,o=0;o1&&void 0!==arguments[1])||arguments[1],i=this.canvas.DOMtoCanvas(t),o=10,n=null,s=this.body.edges,r=0;r1)return!0;return!1}},{key:"_selectConnectedEdges",value:function(t){for(var e=0;e1&&void 0!==arguments[1]?arguments[1]:{},i=void 0,o=void 0;if(!t||!t.nodes&&!t.edges)throw"Selection must be an object with nodes and/or edges properties";if((e.unselectAll||void 0===e.unselectAll)&&this.unselectAll(),t.nodes)for(i=0;i1&&void 0!==arguments[1])||arguments[1];if(!t||void 0===t.length)throw"Selection must be an array with ids";this.setSelection({nodes:t},{highlightEdges:e})}},{key:"selectEdges",value:function(t){if(!t||void 0===t.length)throw"Selection must be an array with ids";this.setSelection({edges:t})}},{key:"updateSelection",value:function(){for(var t in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(t)&&(this.body.nodes.hasOwnProperty(t)||delete this.selectionObj.nodes[t]);for(var e in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(e)&&(this.body.edges.hasOwnProperty(e)||delete this.selectionObj.edges[e])}}]),t}();e.default=p},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(58),s=o(n),r=i(161),a=o(r),h=i(62),d=o(h),l=i(115),u=o(l),c=i(116),p=o(c),f=i(210),m=o(f),v=i(1),g=function(){function t(e){(0,u.default)(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"}},v.extend(this.options,this.defaultOptions),this.bindEventListeners()}return(0,p.default)(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()})}},{key:"setOptions",value:function(t,e){if(void 0!==t){var i=this.options.hierarchical.enabled;if(v.selectiveDeepExtend(["randomSeed","improvedLayout"],this.options,t),v.mergeOptions(this.options,t,"hierarchical"),void 0!==t.randomSeed&&(this.initialRandomSeed=t.randomSeed),this.options.hierarchical.enabled===!0)return i===!0&&this.body.emitter.emit("refresh",!0),"RL"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?this.options.hierarchical.levelSeparation>0&&(this.options.hierarchical.levelSeparation*=-1):this.options.hierarchical.levelSeparation<0&&(this.options.hierarchical.levelSeparation*=-1),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(e);if(i===!0)return this.body.emitter.emit("refresh"),v.deepExtend(e,this.optionsBackup)}return e}},{key:"adaptAllOptionsForHierarchicalLayout",value:function(t){if(this.options.hierarchical.enabled===!0){void 0===t.physics||t.physics===!0?(t.physics={enabled:void 0===this.optionsBackup.physics.enabled||this.optionsBackup.physics.enabled,solver:"hierarchicalRepulsion"},this.optionsBackup.physics.enabled=void 0===this.optionsBackup.physics.enabled||this.optionsBackup.physics.enabled,this.optionsBackup.physics.solver=this.optionsBackup.physics.solver||"barnesHut"):"object"===(0,d.default)(t.physics)?(this.optionsBackup.physics.enabled=void 0===t.physics.enabled||t.physics.enabled,this.optionsBackup.physics.solver=t.physics.solver||"barnesHut",t.physics.solver="hierarchicalRepulsion"):t.physics!==!1&&(this.optionsBackup.physics.solver="barnesHut",t.physics={solver:"hierarchicalRepulsion"});var e="horizontal";"RL"!==this.options.hierarchical.direction&&"LR"!==this.options.hierarchical.direction||(e="vertical"),void 0===t.edges?(this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},t.edges={smooth:!1}):void 0===t.edges.smooth?(this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},t.edges.smooth=!1):"boolean"==typeof t.edges.smooth?(this.optionsBackup.edges={smooth:t.edges.smooth},t.edges.smooth={enabled:t.edges.smooth,type:e}):(void 0!==t.edges.smooth.type&&"dynamic"!==t.edges.smooth.type&&(e=t.edges.smooth.type),this.optionsBackup.edges={smooth:void 0===t.edges.smooth.enabled||t.edges.smooth.enabled,type:void 0===t.edges.smooth.type?"dynamic":t.edges.smooth.type,roundness:void 0===t.edges.smooth.roundness?.5:t.edges.smooth.roundness,forceDirection:void 0!==t.edges.smooth.forceDirection&&t.edges.smooth.forceDirection},t.edges.smooth={enabled:void 0===t.edges.smooth.enabled||t.edges.smooth.enabled,type:e,roundness:void 0===t.edges.smooth.roundness?.5:t.edges.smooth.roundness,forceDirection:void 0!==t.edges.smooth.forceDirection&&t.edges.smooth.forceDirection}),this.body.emitter.emit("_forceDisableDynamicCurves",e)}return t}},{key:"seededRandom",value:function(){var t=1e4*Math.sin(this.randomSeed++);return t-Math.floor(t)}},{key:"positionInitially",value:function(t){if(this.options.hierarchical.enabled!==!0){this.randomSeed=this.initialRandomSeed;for(var e=0;es){for(var r=this.body.nodeIndices.length;this.body.nodeIndices.length>s;){n+=1;var a=this.body.nodeIndices.length;n%3===0?this.body.modules.clustering.clusterBridges():this.body.modules.clustering.clusterOutliers();var h=this.body.nodeIndices.length;if(a==h&&n%3!==0||n>o)return this._declusterAll(),this.body.emitter.emit("_layoutFailed"),void console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.")}this.body.modules.kamadaKawai.setOptions({springLength:Math.max(150,2*r)})}this.body.modules.kamadaKawai.solve(this.body.nodeIndices,this.body.edgeIndices,!0),this._shiftToCenter();for(var d=70,l=0;l0){var t=void 0,e=void 0,i=!1,o=!0,n=!1;this.hierarchicalLevels={},this.lastNodeOnLevel={},this.hierarchicalChildrenReference={},this.hierarchicalParentReference={},this.hierarchicalTrees={},this.treeIndex=-1,this.distributionOrdering={},this.distributionIndex={},this.distributionOrderingPresence={};for(e in this.body.nodes)this.body.nodes.hasOwnProperty(e)&&(t=this.body.nodes[e],void 0===t.options.x&&void 0===t.options.y&&(o=!1),void 0!==t.options.level?(i=!0,this.hierarchicalLevels[e]=t.options.level):n=!0);if(n===!0&&i===!0)throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");n===!0&&("hubsize"===this.options.hierarchical.sortMethod?this._determineLevelsByHubsize():"directed"===this.options.hierarchical.sortMethod?this._determineLevelsDirected():"custom"===this.options.hierarchical.sortMethod&&this._determineLevelsCustomCallback());for(var s in this.body.nodes)this.body.nodes.hasOwnProperty(s)&&void 0===this.hierarchicalLevels[s]&&(this.hierarchicalLevels[s]=0);var r=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(r),this._condenseHierarchy(),this._shiftToCenter()}}},{key:"_condenseHierarchy",value:function(){var t=this,e=!1,i={},o=function(){for(var e=h(),i=0;i0)for(var s=0;s1&&void 0!==arguments[1]?arguments[1]:1e9,o=1e9,n=1e9,s=1e9,r=-1e9;for(var h in e)if(e.hasOwnProperty(h)){var d=t.body.nodes[h],l=t.hierarchicalLevels[d.id],u=t._getPositionForHierarchy(d),c=t._getSpaceAroundNode(d,e),p=(0,a.default)(c,2),f=p[0],m=p[1];o=Math.min(f,o),n=Math.min(m,n),l<=i&&(s=Math.min(u,s),r=Math.max(u,r))}return[s,r,o,n]},u=function e(i){var o=t.hierarchicalLevels[i];if(t.hierarchicalChildrenReference[i]){var n=t.hierarchicalChildrenReference[i];if(n.length>0)for(var s=0;s1)for(var a=0;a2&&void 0!==arguments[2]&&arguments[2],s=t._getPositionForHierarchy(i),r=t._getPositionForHierarchy(o),h=Math.abs(r-s);if(h>t.options.hierarchical.nodeSpacing){var u={};u[i.id]=!0;var p={};p[o.id]=!0,d(i,u),d(o,p);var f=c(i,o),m=l(u,f),v=(0,a.default)(m,4),g=(v[0],v[1]),y=(v[2],v[3],l(p,f)),b=(0,a.default)(y,4),_=b[0],w=(b[1],b[2]),x=(b[3],Math.abs(g-_));if(x>t.options.hierarchical.nodeSpacing){var k=g-_+t.options.hierarchical.nodeSpacing;k<-w+t.options.hierarchical.nodeSpacing&&(k=-w+t.options.hierarchical.nodeSpacing),k<0&&(t._shiftBlock(o.id,k),e=!0,n===!0&&t._centerParent(o))}}},v=function(o,n){for(var s=n.id,r=n.edges,h=t.hierarchicalLevels[n.id],u=t.options.hierarchical.levelSeparation*t.options.hierarchical.levelSeparation,c={},p=[],f=0;f0?m=Math.min(f,p-t.options.hierarchical.nodeSpacing):f<0&&(m=-Math.min(-f,c-t.options.hierarchical.nodeSpacing)),0!=m&&(t._shiftBlock(n.id,m),e=!0)},w=function(i){var o=t._getPositionForHierarchy(n),s=t._getSpaceAroundNode(n),r=(0,a.default)(s,2),h=r[0],d=r[1],l=i-o,u=o;l>0?u=Math.min(o+(d-t.options.hierarchical.nodeSpacing),i):l<0&&(u=Math.max(o-(h-t.options.hierarchical.nodeSpacing),i)),u!==o&&(t._setPositionForHierarchy(n,u,void 0,!0),e=!0)},x=b(o,p);_(x),x=b(o,r),w(x)},g=function(i){var o=(0,s.default)(t.distributionOrdering);o=o.reverse();for(var n=0;n0)for(var d=0;d0&&Math.abs(g)0&&(a=this._getPositionForHierarchy(i[n-1])+this.options.hierarchical.nodeSpacing),this._setPositionForHierarchy(r,a,e),this._validataPositionAndContinue(r,e,a),o++}}}}},{key:"_placeBranchNodes",value:function(t,e){if(void 0!==this.hierarchicalChildrenReference[t]){for(var i=[],o=0;oe&&void 0===this.positionedNodes[s.id]))return;var a=void 0;a=0===n?this._getPositionForHierarchy(this.body.nodes[t]):this._getPositionForHierarchy(i[n-1])+this.options.hierarchical.nodeSpacing,this._setPositionForHierarchy(s,a,r),this._validataPositionAndContinue(s,r,a)}for(var h=1e9,d=-1e9,l=0;l0&&(e=this._getHubSize(),0!==e);)for(var o in this.body.nodes)if(this.body.nodes.hasOwnProperty(o)){var n=this.body.nodes[o];n.edges.length===e&&this._crawlNetwork(i,o)}}},{key:"_determineLevelsCustomCallback",value:function(){var t=this,e=1e5,i=function(t,e,i){},o=function(o,n,s){var r=t.hierarchicalLevels[o.id];void 0===r&&(t.hierarchicalLevels[o.id]=e);var a=i(m.default.cloneOptions(o,"node"),m.default.cloneOptions(n,"node"),m.default.cloneOptions(s,"edge"));t.hierarchicalLevels[n.id]=t.hierarchicalLevels[o.id]+a};this._crawlNetwork(o),this._setMinLevelToZero()}},{key:"_determineLevelsDirected",value:function(){var t=this,e=1e4,i=function(i,o,n){var s=t.hierarchicalLevels[i.id];void 0===s&&(t.hierarchicalLevels[i.id]=e),n.toId==o.id?t.hierarchicalLevels[o.id]=t.hierarchicalLevels[i.id]+1:t.hierarchicalLevels[o.id]=t.hierarchicalLevels[i.id]-1};this._crawlNetwork(i),this._setMinLevelToZero()}},{key:"_setMinLevelToZero",value:function(){var t=1e9;for(var e in this.body.nodes)this.body.nodes.hasOwnProperty(e)&&void 0!==this.hierarchicalLevels[e]&&(t=Math.min(this.hierarchicalLevels[e],t));for(var i in this.body.nodes)this.body.nodes.hasOwnProperty(i)&&void 0!==this.hierarchicalLevels[i]&&(this.hierarchicalLevels[i]-=t)}},{key:"_generateMap",value:function(){var t=this,e=function(e,i){if(t.hierarchicalLevels[i.id]>t.hierarchicalLevels[e.id]){var o=e.id,n=i.id;void 0===t.hierarchicalChildrenReference[o]&&(t.hierarchicalChildrenReference[o]=[]),t.hierarchicalChildrenReference[o].push(n),void 0===t.hierarchicalParentReference[n]&&(t.hierarchicalParentReference[n]=[]),t.hierarchicalParentReference[n].push(o)}};this._crawlNetwork(e)}},{key:"_crawlNetwork",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},i=arguments[1],o={},n=0,s=function i(n,s){if(void 0===o[n.id]){void 0===t.hierarchicalTrees[n.id]&&(t.hierarchicalTrees[n.id]=s,t.treeIndex=Math.max(s,t.treeIndex)),o[n.id]=!0;for(var r=void 0,a=0;a3&&void 0!==arguments[3]&&arguments[3];o!==!0&&(void 0===this.distributionOrdering[i]&&(this.distributionOrdering[i]=[],this.distributionOrderingPresence[i]={}),void 0===this.distributionOrderingPresence[i][t.id]&&(this.distributionOrdering[i].push(t),this.distributionIndex[t.id]=this.distributionOrdering[i].length-1),this.distributionOrderingPresence[i][t.id]=!0),"UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?t.x=e:t.y=e}},{key:"_getPositionForHierarchy",value:function(t){return"UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?t.x:t.y}},{key:"_sortNodeArray",value:function(t){t.length>1&&("UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction?t.sort(function(t,e){return t.x-e.x}):t.sort(function(t,e){return t.y-e.y}))}}]),t}();e.default=g},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(58),s=o(n),r=i(82),a=o(r),h=i(62),d=o(h),l=i(115),u=o(l),c=i(116),p=o(c),f=i(1),m=i(108),v=i(121),g=function(){function t(e,i,o){var n=this;(0,u.default)(this,t),this.body=e,this.canvas=i,this.selectionHandler=o,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}},f.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(0,p.default)(t,[{key:"_restore",value:function(){this.inMode!==!1&&(this.options.initiallyActive===!0?this.enableEditMode():this.disableEditMode())}},{key:"setOptions",value:function(t,e,i){void 0!==e&&(void 0!==e.locale?this.options.locale=e.locale:this.options.locale=i.locale,void 0!==e.locales?this.options.locales=e.locales:this.options.locales=i.locales),void 0!==t&&("boolean"==typeof t?this.options.enabled=t:(this.options.enabled=!0,f.deepExtend(this.options,t)),this.options.initiallyActive===!0&&(this.editMode=!0),this._setup())}},{key:"toggleEditMode",value:function(){this.editMode===!0?this.disableEditMode():this.enableEditMode()}},{key:"enableEditMode",value:function(){this.editMode=!0,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="block",this.closeDiv.style.display="block",this.editModeDiv.style.display="none",this.showManipulatorToolbar())}},{key:"disableEditMode",value:function(){this.editMode=!1,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="none",this.closeDiv.style.display="none",this.editModeDiv.style.display="block",this._createEditButton())}},{key:"showManipulatorToolbar",value:function(){if(this._clean(),this.manipulationDOM={},this.guiEnabled===!0){this.editMode=!0,this.manipulationDiv.style.display="block",this.closeDiv.style.display="block";var t=this.selectionHandler._getSelectedNodeCount(),e=this.selectionHandler._getSelectedEdgeCount(),i=t+e,o=this.options.locales[this.options.locale],n=!1;this.options.addNode!==!1&&(this._createAddNodeButton(o),n=!0),this.options.addEdge!==!1&&(n===!0?this._createSeperator(1):n=!0,this._createAddEdgeButton(o)),1===t&&"function"==typeof this.options.editNode?(n===!0?this._createSeperator(2):n=!0,this._createEditNodeButton(o)):1===e&&0===t&&this.options.editEdge!==!1&&(n===!0?this._createSeperator(3):n=!0,this._createEditEdgeButton(o)),0!==i&&(t>0&&this.options.deleteNode!==!1?(n===!0&&this._createSeperator(4),this._createDeleteButton(o)):0===t&&this.options.deleteEdge!==!1&&(n===!0&&this._createSeperator(4),this._createDeleteButton(o))),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this)),this._temporaryBindEvent("select",this.showManipulatorToolbar.bind(this))}this.body.emitter.emit("_redraw")}},{key:"addNodeMode",value:function(){if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addNode",this.guiEnabled===!0){var t=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(t),this._createSeperator(),this._createDescription(t.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;this.editMode!==!0&&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(e.isCluster!==!0){var i=f.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&&void 0!==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(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addEdge",this.guiEnabled===!0){var t=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(t),this._createSeperator(),this._createDescription(t.edgeDescription||this.options.locales.en.edgeDescription),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this))}this._temporaryBindUI("onTouch",this._handleConnect.bind(this)),this._temporaryBindUI("onDragEnd",this._finishConnect.bind(this)),this._temporaryBindUI("onDrag",this._dragControlNode.bind(this)),this._temporaryBindUI("onRelease",this._finishConnect.bind(this)),this._temporaryBindUI("onDragStart",function(){}),this._temporaryBindUI("onHold",function(){})}},{key:"editEdgeMode",value:function(){var t=this;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="editEdge","object"===(0,d.default)(this.options.editEdge)&&"function"==typeof this.options.editEdge.editWithoutDrag&&(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdges()[0],void 0!==this.edgeBeingEditedId)){var e=this.body.edges[this.edgeBeingEditedId];return void this._performEditEdge(e.from,e.to)}if(this.guiEnabled===!0){var i=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(i),this._createSeperator(),this._createDescription(i.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this))}this.edgeBeingEditedId=this.selectionHandler.getSelectedEdges()[0],void 0!==this.edgeBeingEditedId?!function(){var e=t.body.edges[t.edgeBeingEditedId],i=t._getNewTargetNode(e.from.x,e.from.y),o=t._getNewTargetNode(e.to.x,e.to.y);t.temporaryIds.nodes.push(i.id),t.temporaryIds.nodes.push(o.id),t.body.nodes[i.id]=i,t.body.nodeIndices.push(i.id),t.body.nodes[o.id]=o,t.body.nodeIndices.push(o.id),t._temporaryBindUI("onTouch",t._controlNodeTouch.bind(t)),t._temporaryBindUI("onTap",function(){}),t._temporaryBindUI("onHold",function(){}),t._temporaryBindUI("onDragStart",t._controlNodeDragStart.bind(t)),t._temporaryBindUI("onDrag",t._controlNodeDrag.bind(t)),t._temporaryBindUI("onDragEnd",t._controlNodeDragEnd.bind(t)),t._temporaryBindUI("onMouseMove",function(){}),t._temporaryBindEvent("beforeDrawing",function(t){var n=e.edgeType.findBorderPositions(t);i.selected===!1&&(i.x=n.from.x,i.y=n.from.y),o.selected===!1&&(o.x=n.to.x,o.y=n.to.y)}),t.body.emitter.emit("_redraw")}():this.showManipulatorToolbar()}},{key:"deleteSelected",value:function(){var t=this;this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="delete";var e=this.selectionHandler.getSelectedNodes(),i=this.selectionHandler.getSelectedEdges(),o=void 0;if(e.length>0){for(var n=0;n0&&"function"==typeof this.options.deleteEdge&&(o=this.options.deleteEdge);if("function"==typeof o){var s={nodes:e,edges:i};if(2!==o.length)throw new Error("The function for delete does not support two arguments (data, callback)");o(s,function(e){null!==e&&void 0!==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()):(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(){this.options.enabled===!0?(this.guiEnabled=!0,this._createWrappers(),this.editMode===!1?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}},{key:"_createWrappers",value:function(){void 0===this.manipulationDiv&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",this.editMode===!0?this.manipulationDiv.style.display="block":this.manipulationDiv.style.display="none",this.canvas.frame.appendChild(this.manipulationDiv)),void 0===this.editModeDiv&&(this.editModeDiv=document.createElement("div"),this.editModeDiv.className="vis-edit-mode",this.editMode===!0?this.editModeDiv.style.display="none":this.editModeDiv.style.display="block",this.canvas.frame.appendChild(this.editModeDiv)),void 0===this.closeDiv&&(this.closeDiv=document.createElement("div"),this.closeDiv.className="vis-close",this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv))}},{key:"_getNewTargetNode",value:function(t,e){var i=f.deepExtend({},this.options.controlNodeStyle);i.id="targetNode"+f.randomUUID(),i.hidden=!1,i.physics=!1,i.x=t,i.y=e;var o=this.body.functions.createNode(i);return o.shape.boundingBox={left:t,right:t,top:e,bottom:e},o}},{key:"_createEditButton",value:function(){this._clean(),this.manipulationDOM={},f.recursiveDOMDelete(this.editModeDiv);var t=this.options.locales[this.options.locale],e=this._createButton("editMode","vis-button vis-edit vis-edit-mode",t.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(e),this._bindHammerToDiv(e,this.toggleEditMode.bind(this))}},{key:"_clean",value:function(){this.inMode=!1,this.guiEnabled===!0&&(f.recursiveDOMDelete(this.editModeDiv),f.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 t=0;t0&&void 0!==arguments[0]?arguments[0]: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(t){var e=this._createButton("addNode","vis-button vis-add",t.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(e),this._bindHammerToDiv(e,this.addNodeMode.bind(this))}},{key:"_createAddEdgeButton",value:function(t){var e=this._createButton("addEdge","vis-button vis-connect",t.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(e),this._bindHammerToDiv(e,this.addEdgeMode.bind(this))}},{key:"_createEditNodeButton",value:function(t){var e=this._createButton("editNode","vis-button vis-edit",t.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(e),this._bindHammerToDiv(e,this.editNode.bind(this))}},{key:"_createEditEdgeButton",value:function(t){var e=this._createButton("editEdge","vis-button vis-edit",t.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(e),this._bindHammerToDiv(e,this.editEdgeMode.bind(this))}},{key:"_createDeleteButton",value:function(t){if(this.options.rtl)var e="vis-button vis-delete-rtl";else var e="vis-button vis-delete";var i=this._createButton("delete",e,t.del||this.options.locales.en.del);this.manipulationDiv.appendChild(i),this._bindHammerToDiv(i,this.deleteSelected.bind(this))}},{key:"_createBackButton",value:function(t){var e=this._createButton("back","vis-button vis-back",t.back||this.options.locales.en.back);this.manipulationDiv.appendChild(e),this._bindHammerToDiv(e,this.showManipulatorToolbar.bind(this))}},{key:"_createButton",value:function(t,e,i){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"vis-label";return this.manipulationDOM[t+"Div"]=document.createElement("div"),this.manipulationDOM[t+"Div"].className=e,this.manipulationDOM[t+"Label"]=document.createElement("div"),this.manipulationDOM[t+"Label"].className=o,this.manipulationDOM[t+"Label"].innerHTML=i,this.manipulationDOM[t+"Div"].appendChild(this.manipulationDOM[t+"Label"]),this.manipulationDOM[t+"Div"]}},{key:"_createDescription",value:function(t){this.manipulationDiv.appendChild(this._createButton("description","vis-button vis-none",t))}},{key:"_temporaryBindEvent",value:function(t,e){this.temporaryEventFunctions.push({event:t,boundFunction:e}),this.body.emitter.on(t,e)}},{key:"_temporaryBindUI",value:function(t,e){if(void 0===this.body.eventListeners[t])throw new Error("This UI function does not exist. Typo? You tried: "+t+" possible are: "+(0,a.default)((0,s.default)(this.body.eventListeners)));this.temporaryUIFunctions[t]=this.body.eventListeners[t],this.body.eventListeners[t]=e}},{key:"_unbindTemporaryUIs",value:function(){for(var t in this.temporaryUIFunctions)this.temporaryUIFunctions.hasOwnProperty(t)&&(this.body.eventListeners[t]=this.temporaryUIFunctions[t],delete this.temporaryUIFunctions[t]);this.temporaryUIFunctions={}}},{key:"_unbindTemporaryEvents",value:function(){for(var t=0;t=0;r--)if(n[r]!==this.selectedControlNode.id){s=this.body.nodes[n[r]];break}if(void 0!==s&&void 0!==this.selectedControlNode)if(s.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var a=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===a.id?this._performEditEdge(s.id,o.to.id):this._performEditEdge(o.from.id,s.id)}else o.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}}},{key:"_handleConnect",value:function(t){if((new Date).valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(t.center),this.lastTouch.translation=f.extend({},this.body.view.translation);var e=this.lastTouch,i=this.selectionHandler.getNodeAt(e);if(void 0!==i)if(i.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var o=this._getNewTargetNode(i.x,i.y);this.body.nodes[o.id]=o,this.body.nodeIndices.push(o.id);var n=this.body.functions.createEdge({id:"connectionEdge"+f.randomUUID(),from:i.id,to:o.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[n.id]=n,this.body.edgeIndices.push(n.id),this.temporaryIds.nodes.push(o.id),this.temporaryIds.edges.push(n.id)}this.touchTime=(new Date).valueOf()}}},{key:"_dragControlNode",value:function(t){var e=this.body.functions.getPointer(t.center);if(void 0!==this.temporaryIds.nodes[0]){var i=this.body.nodes[this.temporaryIds.nodes[0]];i.x=this.canvas._XconvertDOMtoCanvas(e.x),i.y=this.canvas._YconvertDOMtoCanvas(e.y),this.body.emitter.emit("_redraw")}else{var o=e.x-this.lastTouch.x,n=e.y-this.lastTouch.y;this.body.view.translation={x:this.lastTouch.translation.x+o,y:this.lastTouch.translation.y+n}}}},{key:"_finishConnect",value:function(t){var e=this.body.functions.getPointer(t.center),i=this.selectionHandler._pointerToPositionObject(e),o=void 0;void 0!==this.temporaryIds.edges[0]&&(o=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var n=this.selectionHandler._getAllNodesOverlappingWith(i),s=void 0,r=n.length-1;r>=0;r--)if(this.temporaryIds.nodes.indexOf(n[r])===-1){s=this.body.nodes[n[r]];break}this._cleanupTemporaryNodesAndEdges(),void 0!==s&&(s.isCluster===!0?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):void 0!==this.body.nodes[o]&&void 0!==this.body.nodes[s.id]&&this._performAddEdge(o,s.id)),this.body.emitter.emit("_redraw")}},{key:"_performAddNode",value:function(t){var e=this,i={id:f.randomUUID(),x:t.pointer.canvas.x,y:t.pointer.canvas.y,label:"new"};if("function"==typeof this.options.addNode){if(2!==this.options.addNode.length)throw new Error("The function for add does not support two arguments (data,callback)");this.options.addNode(i,function(t){null!==t&&void 0!==t&&"addNode"===e.inMode&&(e.body.data.nodes.getDataSet().add(t),e.showManipulatorToolbar())})}else this.body.data.nodes.getDataSet().add(i),this.showManipulatorToolbar()}},{key:"_performAddEdge",value:function(t,e){var i=this,o={from:t,to:e};if("function"==typeof this.options.addEdge){if(2!==this.options.addEdge.length)throw new Error("The function for connect does not support two arguments (data,callback)");this.options.addEdge(o,function(t){null!==t&&void 0!==t&&"addEdge"===i.inMode&&(i.body.data.edges.getDataSet().add(t),i.selectionHandler.unselectAll(),i.showManipulatorToolbar())})}else this.body.data.edges.getDataSet().add(o),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}},{key:"_performEditEdge",value:function(t,e){var i=this,o={id:this.edgeBeingEditedId,from:t,to:e,label:this.body.data.edges._data[this.edgeBeingEditedId].label},n=this.options.editEdge;if("object"===("undefined"==typeof n?"undefined":(0,d.default)(n))&&(n=n.editWithoutDrag),"function"==typeof n){if(2!==n.length)throw new Error("The function for edit does not support two arguments (data, callback)");n(o,function(t){null===t||void 0===t||"editEdge"!==i.inMode?(i.body.edges[o.id].updateEdgeType(),i.body.emitter.emit("_redraw"),i.showManipulatorToolbar()):(i.body.data.edges.getDataSet().update(t),i.selectionHandler.unselectAll(),i.showManipulatorToolbar())})}else this.body.data.edges.getDataSet().update(o),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}]),t}();e.default=g},function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i="string",o="boolean",n="number",s="array",r="object",a="dom",h="any",d={configure:{enabled:{boolean:o},filter:{boolean:o,string:i,array:s,function:"function"},container:{dom:a},showButton:{boolean:o},__type__:{object:r,boolean:o,string:i,array:s,function:"function"}},edges:{arrows:{to:{enabled:{boolean:o},scaleFactor:{number:n},type:{string:["arrow","circle"]},__type__:{object:r,boolean:o}},middle:{enabled:{boolean:o},scaleFactor:{number:n},type:{string:["arrow","circle"]},__type__:{object:r,boolean:o}},from:{enabled:{boolean:o},scaleFactor:{number:n},type:{string:["arrow","circle"]},__type__:{object:r,boolean:o}},__type__:{string:["from","to","middle"],object:r}},arrowStrikethrough:{boolean:o},chosen:{label:{boolean:o,function:"function"},edge:{boolean:o,function:"function"},__type__:{object:r,boolean:o}},color:{color:{string:i},highlight:{string:i},hover:{string:i},inherit:{string:["from","to","both"],boolean:o},opacity:{number:n},__type__:{object:r,string:i}},dashes:{boolean:o,array:s},font:{color:{string:i},size:{number:n},face:{string:i},background:{string:i},strokeWidth:{number:n},strokeColor:{string:i},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:n},multi:{boolean:o,string:i},bold:{color:{string:i},size:{number:n},face:{string:i},mod:{string:i},vadjust:{number:n},__type__:{object:r,string:i}},boldital:{color:{string:i},size:{number:n},face:{string:i},mod:{string:i},vadjust:{number:n},__type__:{object:r,string:i}},ital:{color:{string:i},size:{number:n},face:{string:i},mod:{string:i},vadjust:{number:n},__type__:{object:r,string:i}},mono:{color:{string:i},size:{number:n},face:{string:i},mod:{string:i},vadjust:{number:n},__type__:{object:r,string:i}},__type__:{object:r,string:i}},hidden:{boolean:o},hoverWidth:{function:"function",number:n},label:{string:i,undefined:"undefined"},labelHighlightBold:{boolean:o},length:{number:n,undefined:"undefined"},physics:{boolean:o},scaling:{min:{number:n},max:{number:n},label:{enabled:{boolean:o},min:{number:n},max:{number:n},maxVisible:{number:n},drawThreshold:{number:n},__type__:{object:r,boolean:o}},customScalingFunction:{function:"function"},__type__:{object:r}},selectionWidth:{function:"function",number:n},selfReferenceSize:{number:n},shadow:{enabled:{boolean:o},color:{string:i},size:{number:n},x:{number:n},y:{number:n},__type__:{object:r,boolean:o}},smooth:{enabled:{boolean:o},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:n},forceDirection:{string:["horizontal","vertical","none"],boolean:o},__type__:{object:r,boolean:o}},title:{string:i,undefined:"undefined"},width:{number:n},widthConstraint:{maximum:{number:n},__type__:{object:r,boolean:o,number:n}},value:{number:n,undefined:"undefined"},__type__:{object:r}},groups:{useDefaultGroups:{boolean:o},__any__:"get from nodes, will be overwritten below",__type__:{object:r}},interaction:{dragNodes:{boolean:o},dragView:{boolean:o},hideEdgesOnDrag:{boolean:o},hideNodesOnDrag:{boolean:o},hover:{boolean:o},keyboard:{enabled:{boolean:o},speed:{x:{number:n},y:{number:n},zoom:{number:n},__type__:{object:r}},bindToWindow:{boolean:o},__type__:{object:r,boolean:o}},multiselect:{boolean:o},navigationButtons:{boolean:o},selectable:{boolean:o},selectConnectedEdges:{boolean:o},hoverConnectedEdges:{boolean:o},tooltipDelay:{number:n},zoomView:{boolean:o},__type__:{object:r}},layout:{randomSeed:{undefined:"undefined",number:n},improvedLayout:{boolean:o},hierarchical:{enabled:{boolean:o},levelSeparation:{number:n},nodeSpacing:{number:n},treeSpacing:{number:n},blockShifting:{boolean:o},edgeMinimization:{boolean:o},parentCentralization:{boolean:o},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},__type__:{object:r,boolean:o}},__type__:{object:r}},manipulation:{enabled:{boolean:o},initiallyActive:{boolean:o},addNode:{boolean:o,function:"function"},addEdge:{boolean:o,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:r,boolean:o,function:"function"}},deleteNode:{boolean:o,function:"function"},deleteEdge:{boolean:o,function:"function"},controlNodeStyle:"get from nodes, will be overwritten below",__type__:{object:r,boolean:o}},nodes:{borderWidth:{number:n},borderWidthSelected:{number:n,undefined:"undefined"},brokenImage:{string:i,undefined:"undefined"},chosen:{label:{boolean:o,function:"function"},node:{boolean:o,function:"function"},__type__:{object:r,boolean:o}},color:{border:{string:i},background:{string:i},highlight:{border:{string:i},background:{string:i},__type__:{object:r,string:i}},hover:{border:{string:i},background:{string:i},__type__:{object:r,string:i}},__type__:{object:r,string:i}},fixed:{x:{boolean:o},y:{boolean:o},__type__:{object:r,boolean:o}},font:{align:{string:i},color:{string:i},size:{number:n},face:{string:i},background:{string:i},strokeWidth:{number:n},strokeColor:{string:i},vadjust:{number:n},multi:{boolean:o,string:i},bold:{color:{string:i},size:{number:n},face:{string:i},mod:{string:i},vadjust:{number:n},__type__:{object:r,string:i}},boldital:{color:{string:i},size:{number:n},face:{string:i},mod:{string:i},vadjust:{number:n},__type__:{object:r,string:i}},ital:{color:{string:i},size:{number:n},face:{string:i},mod:{string:i},vadjust:{number:n},__type__:{object:r,string:i}},mono:{color:{string:i},size:{number:n},face:{string:i},mod:{string:i},vadjust:{number:n},__type__:{object:r,string:i}},__type__:{object:r,string:i}},group:{string:i,number:n,undefined:"undefined"},heightConstraint:{minimum:{number:n},valign:{string:i},__type__:{object:r,boolean:o,number:n}},hidden:{boolean:o},icon:{face:{string:i},code:{string:i},size:{number:n},color:{string:i},__type__:{object:r}},id:{string:i,number:n},image:{string:i,undefined:"undefined"},label:{string:i,undefined:"undefined"},labelHighlightBold:{boolean:o},level:{number:n,undefined:"undefined"},margin:{top:{number:n},right:{number:n},bottom:{number:n},left:{number:n},__type__:{object:r,number:n}},mass:{number:n},physics:{boolean:o},scaling:{min:{number:n},max:{number:n},label:{enabled:{boolean:o},min:{number:n},max:{number:n},maxVisible:{number:n},drawThreshold:{number:n},__type__:{object:r,boolean:o}},customScalingFunction:{function:"function"},__type__:{object:r}},shadow:{enabled:{boolean:o},color:{string:i},size:{number:n},x:{number:n},y:{number:n},__type__:{object:r,boolean:o}},shape:{string:["ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon"]},shapeProperties:{borderDashes:{boolean:o,array:s},borderRadius:{number:n},interpolation:{boolean:o},useImageSize:{boolean:o},useBorderWithImage:{boolean:o},__type__:{object:r}},size:{number:n},title:{string:i,undefined:"undefined"},value:{number:n,undefined:"undefined"},widthConstraint:{minimum:{number:n},maximum:{number:n},__type__:{object:r,boolean:o,number:n}},x:{number:n},y:{number:n},__type__:{object:r}},physics:{enabled:{boolean:o},barnesHut:{gravitationalConstant:{number:n},centralGravity:{number:n},springLength:{number:n},springConstant:{number:n},damping:{number:n},avoidOverlap:{number:n},__type__:{object:r}},forceAtlas2Based:{gravitationalConstant:{number:n},centralGravity:{number:n},springLength:{number:n},springConstant:{number:n},damping:{number:n},avoidOverlap:{number:n},__type__:{object:r}},repulsion:{centralGravity:{number:n},springLength:{number:n},springConstant:{number:n},nodeDistance:{number:n},damping:{number:n},__type__:{object:r}},hierarchicalRepulsion:{centralGravity:{number:n},springLength:{number:n},springConstant:{number:n},nodeDistance:{number:n},damping:{number:n},__type__:{object:r}},maxVelocity:{number:n},minVelocity:{number:n},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:o},iterations:{number:n},updateInterval:{number:n},onlyDynamicEdges:{boolean:o},fit:{boolean:o},__type__:{object:r,boolean:o}},timestep:{number:n},adaptiveTimestep:{boolean:o},__type__:{object:r,boolean:o}},autoResize:{boolean:o},clickToUse:{boolean:o},locale:{string:i},locales:{__any__:{any:h},__type__:{object:r}},height:{string:i},width:{string:i},__type__:{object:r}};d.groups.__any__=d.nodes,d.manipulation.controlNodeStyle=d.nodes;var l={nodes:{borderWidth:[1,0,10,1],borderWidthSelected:[2,0,10,1],color:{border:["color","#2B7CE9"],background:["color","#97C2FC"],highlight:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]},hover:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]}},fixed:{x:!1,y:!1},font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[0,0,50,1],strokeColor:["color","#ffffff"]},hidden:!1,labelHighlightBold:!0,physics:!0,scaling:{min:[10,0,200,1],max:[30,0,200,1],label:{enabled:!1,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},shape:["ellipse","box","circle","database","diamond","dot","square","star","text","triangle","triangleDown"],shapeProperties:{borderDashes:!1,borderRadius:[6,0,20,1],interpolation:!0,useImageSize:!1},size:[25,0,200,1]},edges:{arrows:{to:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},middle:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},from:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"}},arrowStrikethrough:!0,color:{color:["color","#848484"],highlight:["color","#848484"],hover:["color","#848484"],inherit:["from","to","both",!0,!1],opacity:[1,0,1,.05]},dashes:!1,font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[2,0,50,1],strokeColor:["color","#ffffff"],align:["horizontal","top","middle","bottom"]},hidden:!1,hoverWidth:[1.5,0,5,.1],labelHighlightBold:!0,physics:!0,scaling:{min:[1,0,100,1],max:[15,0,100,1],label:{enabled:!0,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},selectionWidth:[1.5,0,5,.1],selfReferenceSize:[20,0,200,1],shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},smooth:{enabled:!0,type:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"],forceDirection:["horizontal","vertical","none"],roundness:[.5,0,1,.05]},width:[1,0,30,1]},layout:{hierarchical:{enabled:!1,levelSeparation:[150,20,500,5],nodeSpacing:[100,20,500,5],treeSpacing:[200,20,500,5],blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:["UD","DU","LR","RL"],sortMethod:["hubsize","directed"]}},interaction:{dragNodes:!0,dragView:!0,hideEdgesOnDrag:!1,hideNodesOnDrag:!1,hover:!1,keyboard:{enabled:!1,speed:{x:[10,0,40,1],y:[10,0,40,1],zoom:[.02,0,.1,.005]},bindToWindow:!0},multiselect:!1,navigationButtons:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0,tooltipDelay:[300,0,1e3,25],zoomView:!0},manipulation:{enabled:!1,initiallyActive:!1},physics:{enabled:!0,barnesHut:{gravitationalConstant:[-2e3,-3e4,0,50],centralGravity:[.3,0,10,.05], +springLength:[95,0,500,5],springConstant:[.04,0,1.2,.005],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},forceAtlas2Based:{gravitationalConstant:[-50,-500,0,1],centralGravity:[.01,0,1,.005],springLength:[95,0,500,5],springConstant:[.08,0,1.2,.005],damping:[.4,0,1,.01],avoidOverlap:[0,0,1,.01]},repulsion:{centralGravity:[.2,0,10,.05],springLength:[200,0,500,5],springConstant:[.05,0,1.2,.005],nodeDistance:[100,0,500,5],damping:[.09,0,1,.01]},hierarchicalRepulsion:{centralGravity:[.2,0,10,.05],springLength:[100,0,500,5],springConstant:[.01,0,1.2,.005],nodeDistance:[120,0,500,5],damping:[.09,0,1,.01]},maxVelocity:[50,0,150,1],minVelocity:[.1,.01,.5,.01],solver:["barnesHut","forceAtlas2Based","repulsion","hierarchicalRepulsion"],timestep:[.5,.01,1,.01]}};e.allOptions=d,e.configureOptions=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(161),s=o(n),r=i(115),a=o(r),h=i(116),d=o(h),l=i(222),u=o(l),c=function(){function t(e,i,o){(0,a.default)(this,t),this.body=e,this.springLength=i,this.springConstant=o,this.distanceSolver=new u.default}return(0,d.default)(t,[{key:"setOptions",value:function(t){t&&(t.springLength&&(this.springLength=t.springLength),t.springConstant&&(this.springConstant=t.springConstant))}},{key:"solve",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=this.distanceSolver.getDistances(this.body,t,e);this._createL_matrix(o),this._createK_matrix(o);for(var n=.01,r=1,a=0,h=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),d=5,l=1e9,u=0,c=0,p=0,f=0,m=0;l>n&&ar&&m=.1;)p=n[l++%s],p>d&&(p=d),c=Math.sqrt(p*p/(1+h*h)),c=r<0?-c:c,t+=c,e+=h*c,u===!0?this.lineTo(t,e):this.moveTo(t,e),d-=p,u=!u})},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(t){return R=t,m()}function s(){L=0,A=R.charAt(0)}function r(){L++,A=R.charAt(L)}function a(){return R.charAt(L+1)}function h(t){return H.test(t)}function d(t,e){if(t||(t={}),e)for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}function l(t,e,i){for(var o=e.split("."),n=t;o.length;){var s=o.shift();o.length?(n[s]||(n[s]={}),n=n[s]):n[s]=i}}function u(t,e){for(var i,o,n=null,s=[t],r=t;r.parent;)s.push(r.parent),r=r.parent;if(r.nodes)for(i=0,o=r.nodes.length;i=0;i--){var a=s[i];a.nodes||(a.nodes=[]),a.nodes.indexOf(n)===-1&&a.nodes.push(n)}e.attr&&(n.attr=d(n.attr,e.attr))}function c(t,e){if(t.edges||(t.edges=[]),t.edges.push(e),t.edge){var i=d({},t.edge);e.attr=d(i,e.attr)}}function p(t,e,i,o,n){var s={from:e,to:i,type:o};return t.edge&&(s.attr=d({},t.edge)),s.attr=d(s.attr||{},n),s}function f(){for(F=N.NULL,B="";" "===A||"\t"===A||"\n"===A||"\r"===A;)r();do{var t=!1;if("#"===A){for(var e=L-1;" "===R.charAt(e)||"\t"===R.charAt(e);)e--;if("\n"===R.charAt(e)||""===R.charAt(e)){for(;""!=A&&"\n"!=A;)r();t=!0}}if("/"===A&&"/"===a()){for(;""!=A&&"\n"!=A;)r();t=!0}if("/"===A&&"*"===a()){for(;""!=A;){if("*"===A&&"/"===a()){r(),r();break}r()}t=!0}for(;" "===A||"\t"===A||"\n"===A||"\r"===A;)r()}while(t);if(""===A)return void(F=N.DELIMITER);var i=A+a();if(z[i])return F=N.DELIMITER,B=i,r(),void r();if(z[A])return F=N.DELIMITER,B=A,void r();if(h(A)||"-"===A){for(B+=A,r();h(A);)B+=A,r();return"false"===B?B=!1:"true"===B?B=!0:isNaN(Number(B))||(B=Number(B)),void(F=N.IDENTIFIER)}if('"'===A){for(r();""!=A&&('"'!=A||'"'===A&&'"'===a());)B+=A,'"'===A&&r(),r();if('"'!=A)throw k('End of string " expected');return r(),void(F=N.IDENTIFIER)}for(F=N.UNKNOWN;""!=A;)B+=A,r();throw new SyntaxError('Syntax error in part "'+O(B,30)+'"')}function m(){var t={};if(s(),f(),"strict"===B&&(t.strict=!0,f()),"graph"!==B&&"digraph"!==B||(t.type=B,f()),F===N.IDENTIFIER&&(t.id=B,f()),"{"!=B)throw k("Angle bracket { expected");if(f(),v(t),"}"!=B)throw k("Angle bracket } expected");if(f(),""!==B)throw k("End of file expected");return f(),delete t.node,delete t.edge,delete t.graph,t}function v(t){for(;""!==B&&"}"!=B;)g(t),";"===B&&f()}function g(t){var e=y(t);if(e)return void w(t,e);var i=b(t);if(!i){if(F!=N.IDENTIFIER)throw k("Identifier expected");var o=B;if(f(),"="===B){if(f(),F!=N.IDENTIFIER)throw k("Identifier expected");t[o]=B,f()}else _(t,o)}}function y(t){var e=null;if("subgraph"===B&&(e={},e.type="subgraph",f(),F===N.IDENTIFIER&&(e.id=B,f())),"{"===B){if(f(),e||(e={}),e.parent=t,e.node=t.node,e.edge=t.edge,e.graph=t.graph,v(e),"}"!=B)throw k("Angle bracket } expected");f(),delete e.node,delete e.edge,delete e.graph,delete e.parent,t.subgraphs||(t.subgraphs=[]),t.subgraphs.push(e)}return e}function b(t){return"node"===B?(f(),t.node=x(),"node"):"edge"===B?(f(),t.edge=x(),"edge"):"graph"===B?(f(),t.graph=x(),"graph"):null}function _(t,e){var i={id:e},o=x();o&&(i.attr=o),u(t,i),w(t,e)}function w(t,e){for(;"->"===B||"--"===B;){var i,o=B;f();var n=y(t);if(n)i=n;else{if(F!=N.IDENTIFIER)throw k("Identifier or subgraph expected");i=B,u(t,{id:i}),f()}var s=x(),r=p(t,e,i,o,s);c(t,r),e=i}}function x(){for(var t=null;"["===B;){for(f(),t={};""!==B&&"]"!=B;){if(F!=N.IDENTIFIER)throw k("Attribute name expected");var e=B;if(f(),"="!=B)throw k("Equal sign = expected");if(f(),F!=N.IDENTIFIER)throw k("Attribute value expected");var i=B;l(t,e,i),f(),","==B&&f()}if("]"!=B)throw k("Bracket ] expected");f()}return t}function k(t){return new SyntaxError(t+', got "'+O(B,30)+'" (char '+L+")")}function O(t,e){return t.length<=e?t:t.substr(0,27)+"..."}function D(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)}function S(t,e,i){for(var o=e.split("."),n=o.pop(),s=t,r=0;r":!0,"--":!0},R="",L=0,A="",B="",F=N.NULL,H=/[a-zA-Z_0-9.:#]/;e.parseDOT=n,e.DOTToGraph=C},function(t,e){function i(t,e){var i=[],o=[],n={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};void 0!==e&&(void 0!==e.fixed&&(n.nodes.fixed=e.fixed),void 0!==e.parseColor&&(n.nodes.parseColor=e.parseColor),void 0!==e.inheritColor&&(n.edges.inheritColor=e.inheritColor));for(var s=t.edges,r=t.nodes,a=0;a