UNPKG

vis-network

Version:

A dynamic, browser-based visualization library.

26 lines 338 kB
/** * vis-network - network * http://visjs.org/ * * A dynamic, browser-based visualization library. * * @version 6.2.0 * @date 2019-10-27T16:34:38Z * * @copyright (c) 2011-2017 Almende B.V, http://almende.com * @copyright (c) 2018-2019 visjs contributors, https://github.com/visjs * * @license * vis.js is dual licensed under both * * 1. The Apache 2.0 License * http://www.apache.org/licenses/LICENSE-2.0 * * and * * 2. The MIT License * http://opensource.org/licenses/MIT * * vis.js may be distributed under either license. */ import"core-js/modules/es.array.slice";import"core-js/modules/es.array.splice";import e,{extend as t,topMost as i,forEach as o,deepExtend as n,overrideOpacity as s,copyAndExtendArray as r,copyArray as a,selectiveNotDeepExtend as h,parseColor as d,mergeOptions as l,fillIfDefined as c,bridgeObject as u,selectiveDeepExtend as p,isString as v,HSVToHex as f,randomUUID as g,addEventListener as y,removeEventListener as m,easingFunctions as b,getAbsoluteLeft as w,getAbsoluteTop as k,recursiveDOMDelete as _,isValidRGB as x,isValidRGBA as E,isValidHex as C,hexToRGB as O,RGBToHSV as T,HSVToRGB as S}from"vis-util";import"core-js/modules/es.array.for-each";import"core-js/modules/es.array.includes";import"core-js/modules/es.array.index-of";import"core-js/modules/es.function.name";import"core-js/modules/es.number.constructor";import"core-js/modules/es.regexp.exec";import"core-js/modules/es.string.includes";import"core-js/modules/es.string.split";import"core-js/modules/web.dom-collections.for-each";import"core-js/modules/es.array.map";import"core-js/modules/es.string.fixed";import M from"keycharm";import"core-js/modules/es.array.concat";import"core-js/modules/es.array.filter";import"core-js/modules/es.array.join";import"core-js/modules/es.array.sort";import"core-js/modules/es.date.to-string";import"core-js/modules/es.object.assign";import"core-js/modules/es.object.keys";import"core-js/modules/es.string.replace";import"core-js/modules/es.string.trim";import"core-js/modules/es.array.some";import{DataSet as D,DataView as I}from"vis-data";import"core-js/modules/es.parse-float";import"core-js/modules/es.parse-int";import"core-js/modules/es.regexp.constructor";import"core-js/modules/es.regexp.to-string";import"core-js/modules/es.string.match";import"core-js/modules/es.string.bold";import"core-js/modules/es.array.iterator";import"core-js/modules/es.object.to-string";import"core-js/modules/web.dom-collections.iterator";import"core-js/modules/es.array.fill";import"core-js/modules/es.math.hypot";import"core-js/modules/es.array.reverse";import"core-js/modules/es.number.is-finite";import"core-js/modules/es.symbol";import"core-js/modules/es.symbol.description";import"core-js/modules/es.symbol.iterator";import"core-js/modules/es.array.every";import"core-js/modules/es.set";import"core-js/modules/es.string.iterator";"undefined"!=typeof CanvasRenderingContext2D&&(CanvasRenderingContext2D.prototype.circle=function(e,t,i){this.beginPath(),this.arc(e,t,i,0,2*Math.PI,!1),this.closePath()},CanvasRenderingContext2D.prototype.square=function(e,t,i){this.beginPath(),this.rect(e-i,t-i,2*i,2*i),this.closePath()},CanvasRenderingContext2D.prototype.triangle=function(e,t,i){this.beginPath(),t+=.275*(i*=1.15);var o=2*i,n=o/2,s=Math.sqrt(3)/6*o,r=Math.sqrt(o*o-n*n);this.moveTo(e,t-(r-s)),this.lineTo(e+n,t+s),this.lineTo(e-n,t+s),this.lineTo(e,t-(r-s)),this.closePath()},CanvasRenderingContext2D.prototype.triangleDown=function(e,t,i){this.beginPath(),t-=.275*(i*=1.15);var o=2*i,n=o/2,s=Math.sqrt(3)/6*o,r=Math.sqrt(o*o-n*n);this.moveTo(e,t+(r-s)),this.lineTo(e+n,t-s),this.lineTo(e-n,t-s),this.lineTo(e,t+(r-s)),this.closePath()},CanvasRenderingContext2D.prototype.star=function(e,t,i){this.beginPath(),t+=.1*(i*=.82);for(var o=0;o<10;o++){var n=o%2==0?1.3*i:.5*i;this.lineTo(e+n*Math.sin(2*o*Math.PI/10),t-n*Math.cos(2*o*Math.PI/10))}this.closePath()},CanvasRenderingContext2D.prototype.diamond=function(e,t,i){this.beginPath(),this.lineTo(e,t+i),this.lineTo(e+i,t),this.lineTo(e,t-i),this.lineTo(e-i,t),this.closePath()},CanvasRenderingContext2D.prototype.roundRect=function(e,t,i,o,n){var s=Math.PI/180;i-2*n<0&&(n=i/2),o-2*n<0&&(n=o/2),this.beginPath(),this.moveTo(e+n,t),this.lineTo(e+i-n,t),this.arc(e+i-n,t+n,n,270*s,360*s,!1),this.lineTo(e+i,t+o-n),this.arc(e+i-n,t+o-n,n,0,90*s,!1),this.lineTo(e+n,t+o),this.arc(e+n,t+o-n,n,90*s,180*s,!1),this.lineTo(e,t+n),this.arc(e+n,t+n,n,180*s,270*s,!1),this.closePath()},CanvasRenderingContext2D.prototype.ellipse_vis=function(e,t,i,o){var n=i/2*.5522848,s=o/2*.5522848,r=e+i,a=t+o,h=e+i/2,d=t+o/2;this.beginPath(),this.moveTo(e,d),this.bezierCurveTo(e,d-s,h-n,t,h,t),this.bezierCurveTo(h+n,t,r,d-s,r,d),this.bezierCurveTo(r,d+s,h+n,a,h,a),this.bezierCurveTo(h-n,a,e,d+s,e,d),this.closePath()},CanvasRenderingContext2D.prototype.database=function(e,t,i,o){var n=o*(1/3),s=i/2*.5522848,r=n/2*.5522848,a=e+i,h=t+n,d=e+i/2,l=t+n/2,c=t+(o-n/2),u=t+o;this.beginPath(),this.moveTo(a,l),this.bezierCurveTo(a,l+r,d+s,h,d,h),this.bezierCurveTo(d-s,h,e,l+r,e,l),this.bezierCurveTo(e,l-r,d-s,t,d,t),this.bezierCurveTo(d+s,t,a,l-r,a,l),this.lineTo(a,c),this.bezierCurveTo(a,c+r,d+s,u,d,u),this.bezierCurveTo(d-s,u,e,c+r,e,c),this.lineTo(e,l)},CanvasRenderingContext2D.prototype.dashedLine=function(e,t,i,o,n){this.beginPath(),this.moveTo(e,t);for(var s=n.length,r=i-e,a=o-t,h=a/r,d=Math.sqrt(r*r+a*a),l=0,c=!0,u=0,p=+n[0];d>=.1;)(p=+n[l++%s])>d&&(p=d),u=Math.sqrt(p*p/(1+h*h)),e+=u=r<0?-u:u,t+=h*u,!0===c?this.lineTo(e,t):this.moveTo(e,t),d-=p,c=!c},CanvasRenderingContext2D.prototype.hexagon=function(e,t,i){this.beginPath();var o=2*Math.PI/6;this.moveTo(e+i,t);for(var n=1;n<6;n++)this.lineTo(e+i*Math.cos(o*n),t+i*Math.sin(o*n));this.closePath()});"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function B(e,t){return e(t={exports:{}},t.exports),t.exports}function z(e){return e&&e.default||e}var F=B((function(e){function t(e){if(e)return function(e){for(var i in t.prototype)e[i]=t.prototype[i];return e}(e)}e.exports=t,t.prototype.on=t.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},t.prototype.once=function(e,t){function i(){this.off(e,i),t.apply(this,arguments)}return i.fn=t,this.on(e,i),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var i,o=this._callbacks["$"+e];if(!o)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var n=0;n<o.length;n++)if((i=o[n])===t||i.fn===t){o.splice(n,1);break}return 0===o.length&&delete this._callbacks["$"+e],this},t.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),i=this._callbacks["$"+e],o=1;o<arguments.length;o++)t[o-1]=arguments[o];if(i){o=0;for(var n=(i=i.slice(0)).length;o<n;++o)i[o].apply(this,t)}return this},t.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},t.prototype.hasListeners=function(e){return!!this.listeners(e).length}}));function P(e){return L=e,function(){var e={};H=0,void(W=L.charAt(0)),ee(),"strict"===q&&(e.strict=!0,ee());"graph"!==q&&"digraph"!==q||(e.type=q,ee());V===A.IDENTIFIER&&(e.id=q,ee());if("{"!=q)throw re("Angle bracket { expected");if(ee(),te(e),"}"!=q)throw re("Angle bracket } expected");if(ee(),""!==q)throw re("End of file expected");return ee(),delete e.node,delete e.edge,delete e.graph,e}()}var N={fontsize:"font.size",fontcolor:"font.color",labelfontcolor:"font.color",fontname:"font.face",color:["color.border","color.background"],fillcolor:"color.background",tooltip:"title",labeltooltip:"title"},R=Object.create(N);R.color="color.color",R.style="dashes";var A={NULL:0,DELIMITER:1,IDENTIFIER:2,UNKNOWN:3},j={"{":!0,"}":!0,"[":!0,"]":!0,";":!0,"=":!0,",":!0,"->":!0,"--":!0},L="",H=0,W="",q="",V=A.NULL;function U(){H++,W=L.charAt(H)}function Y(){return L.charAt(H+1)}var X=/[a-zA-Z_0-9.:#]/;function G(e){return X.test(e)}function K(e,t){if(e||(e={}),t)for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}function Z(e,t,i){for(var o=t.split("."),n=e;o.length;){var s=o.shift();o.length?(n[s]||(n[s]={}),n=n[s]):n[s]=i}}function $(e,t){for(var i,o,n=null,s=[e],r=e;r.parent;)s.push(r.parent),r=r.parent;if(r.nodes)for(i=0,o=r.nodes.length;i<o;i++)if(t.id===r.nodes[i].id){n=r.nodes[i];break}for(n||(n={id:t.id},e.node&&(n.attr=K(n.attr,e.node))),i=s.length-1;i>=0;i--){var a=s[i];a.nodes||(a.nodes=[]),-1===a.nodes.indexOf(n)&&a.nodes.push(n)}t.attr&&(n.attr=K(n.attr,t.attr))}function J(e,t){if(e.edges||(e.edges=[]),e.edges.push(t),e.edge){var i=K({},e.edge);t.attr=K(i,t.attr)}}function Q(e,t,i,o,n){var s={from:t,to:i,type:o};return e.edge&&(s.attr=K({},e.edge)),s.attr=K(s.attr||{},n),null!=n&&n.hasOwnProperty("arrows")&&null!=n.arrows&&(s.arrows={to:{enabled:!0,type:n.arrows.type}},n.arrows=null),s}function ee(){for(V=A.NULL,q="";" "===W||"\t"===W||"\n"===W||"\r"===W;)U();do{var e=!1;if("#"===W){for(var t=H-1;" "===L.charAt(t)||"\t"===L.charAt(t);)t--;if("\n"===L.charAt(t)||""===L.charAt(t)){for(;""!=W&&"\n"!=W;)U();e=!0}}if("/"===W&&"/"===Y()){for(;""!=W&&"\n"!=W;)U();e=!0}if("/"===W&&"*"===Y()){for(;""!=W;){if("*"===W&&"/"===Y()){U(),U();break}U()}e=!0}for(;" "===W||"\t"===W||"\n"===W||"\r"===W;)U()}while(e);if(""!==W){var i=W+Y();if(j[i])return V=A.DELIMITER,q=i,U(),void U();if(j[W])return V=A.DELIMITER,q=W,void U();if(G(W)||"-"===W){for(q+=W,U();G(W);)q+=W,U();return"false"===q?q=!1:"true"===q?q=!0:isNaN(Number(q))||(q=Number(q)),void(V=A.IDENTIFIER)}if('"'===W){for(U();""!=W&&('"'!=W||'"'===W&&'"'===Y());)'"'===W?(q+=W,U()):"\\"===W&&"n"===Y()?(q+="\n",U()):q+=W,U();if('"'!=W)throw re('End of string " expected');return U(),void(V=A.IDENTIFIER)}for(V=A.UNKNOWN;""!=W;)q+=W,U();throw new SyntaxError('Syntax error in part "'+ae(q,30)+'"')}V=A.DELIMITER}function te(e){for(;""!==q&&"}"!=q;)ie(e),";"===q&&ee()}function ie(e){var t=oe(e);if(t)ne(e,t);else if(!function(e){if("node"===q)return ee(),e.node=se(),"node";if("edge"===q)return ee(),e.edge=se(),"edge";if("graph"===q)return ee(),e.graph=se(),"graph";return null}(e)){if(V!=A.IDENTIFIER)throw re("Identifier expected");var i=q;if(ee(),"="===q){if(ee(),V!=A.IDENTIFIER)throw re("Identifier expected");e[i]=q,ee()}else!function(e,t){var i={id:t},o=se();o&&(i.attr=o);$(e,i),ne(e,t)}(e,i)}}function oe(e){var t=null;if("subgraph"===q&&((t={}).type="subgraph",ee(),V===A.IDENTIFIER&&(t.id=q,ee())),"{"===q){if(ee(),t||(t={}),t.parent=e,t.node=e.node,t.edge=e.edge,t.graph=e.graph,te(t),"}"!=q)throw re("Angle bracket } expected");ee(),delete t.node,delete t.edge,delete t.graph,delete t.parent,e.subgraphs||(e.subgraphs=[]),e.subgraphs.push(t)}return t}function ne(e,t){for(;"->"===q||"--"===q;){var i,o=q;ee();var n=oe(e);if(n)i=n;else{if(V!=A.IDENTIFIER)throw re("Identifier or subgraph expected");$(e,{id:i=q}),ee()}J(e,Q(e,t,i,o,se())),t=i}}function se(){for(var e,t,i=null,o={dashed:!0,solid:!1,dotted:[1,5]},n={dot:"circle",box:"box",crow:"crow",curve:"curve",icurve:"inv_curve",normal:"triangle",inv:"inv_triangle",diamond:"diamond",tee:"bar",vee:"vee"},s=new Array,r=new Array;"["===q;){for(ee(),i={};""!==q&&"]"!=q;){if(V!=A.IDENTIFIER)throw re("Attribute name expected");var a=q;if(ee(),"="!=q)throw re("Equal sign = expected");if(ee(),V!=A.IDENTIFIER)throw re("Attribute value expected");var h=q;"style"===a&&(h=o[h]),"arrowhead"===a&&(a="arrows",h={to:{enabled:!0,type:n[h]}}),"arrowtail"===a&&(a="arrows",h={from:{enabled:!0,type:n[h]}}),s.push({attr:i,name:a,value:h}),r.push(a),ee(),","==q&&ee()}if("]"!=q)throw re("Bracket ] expected");ee()}if(r.includes("dir")){var d={arrows:{}};for(e=0;e<s.length;e++)if("arrows"===s[e].name)if(null!=s[e].value.to)d.arrows.to=e;else{if(null==s[e].value.from)throw re("Invalid value of arrows");d.arrows.from=e}else"dir"===s[e].name&&(d.dir=e);var l,c,u=s[d.dir].value;if(!r.includes("arrows"))if("both"===u)s.push({attr:s[d.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),d.arrows.to=s.length-1,s.push({attr:s[d.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),d.arrows.from=s.length-1;else if("forward"===u)s.push({attr:s[d.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),d.arrows.to=s.length-1;else if("back"===u)s.push({attr:s[d.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),d.arrows.from=s.length-1;else{if("none"!==u)throw re('Invalid dir type "'+u+'"');s.push({attr:s[d.dir].attr,name:"arrows",value:""}),d.arrows.to=s.length-1}if("both"===u)d.arrows.to&&d.arrows.from?(c=s[d.arrows.to].value.to.type,l=s[d.arrows.from].value.from.type,s[d.arrows.to]={attr:s[d.arrows.to].attr,name:s[d.arrows.to].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:l}}},s.splice(d.arrows.from,1)):d.arrows.to?(c=s[d.arrows.to].value.to.type,l="arrow",s[d.arrows.to]={attr:s[d.arrows.to].attr,name:s[d.arrows.to].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:l}}}):d.arrows.from&&(c="arrow",l=s[d.arrows.from].value.from.type,s[d.arrows.from]={attr:s[d.arrows.from].attr,name:s[d.arrows.from].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:l}}});else if("back"===u)d.arrows.to&&d.arrows.from?(c="",l=s[d.arrows.from].value.from.type,s[d.arrows.from]={attr:s[d.arrows.from].attr,name:s[d.arrows.from].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:l}}}):d.arrows.to?(c="",l="arrow",d.arrows.from=d.arrows.to,s[d.arrows.from]={attr:s[d.arrows.from].attr,name:s[d.arrows.from].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:l}}}):d.arrows.from&&(c="",l=s[d.arrows.from].value.from.type,s[d.arrows.to]={attr:s[d.arrows.from].attr,name:s[d.arrows.from].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:l}}}),s[d.arrows.from]={attr:s[d.arrows.from].attr,name:s[d.arrows.from].name,value:{from:{enabled:!0,type:s[d.arrows.from].value.from.type}}};else if("none"===u){var p;s[p=d.arrows.to?d.arrows.to:d.arrows.from]={attr:s[p].attr,name:s[p].name,value:""}}else{if("forward"!==u)throw re('Invalid dir type "'+u+'"');d.arrows.to&&d.arrows.from?(c=s[d.arrows.to].value.to.type,l="",s[d.arrows.to]={attr:s[d.arrows.to].attr,name:s[d.arrows.to].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:l}}}):d.arrows.to?(c=s[d.arrows.to].value.to.type,l="",s[d.arrows.to]={attr:s[d.arrows.to].attr,name:s[d.arrows.to].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:l}}}):d.arrows.from&&(c="arrow",l="",d.arrows.to=d.arrows.from,s[d.arrows.to]={attr:s[d.arrows.to].attr,name:s[d.arrows.to].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:l}}}),s[d.arrows.to]={attr:s[d.arrows.to].attr,name:s[d.arrows.to].name,value:{to:{enabled:!0,type:s[d.arrows.to].value.to.type}}}}s.splice(d.dir,1)}if(r.includes("penwidth")){var v=[];for(t=s.length,e=0;e<t;e++)"width"!==s[e].name&&("penwidth"===s[e].name&&(s[e].name="width"),v.push(s[e]));s=v}for(t=s.length,e=0;e<t;e++)Z(s[e].attr,s[e].name,s[e].value);return i}function re(e){return new SyntaxError(e+', got "'+ae(q,30)+'" (char '+H+")")}function ae(e,t){return e.length<=t?e:e.substr(0,27)+"..."}function he(e,t,i){for(var o=t.split("."),n=o.pop(),s=e,r=0;r<o.length;r++){var a=o[r];a in s||(s[a]={}),s=s[a]}return s[n]=i,e}function de(e,t){var i={};for(var o in e)if(e.hasOwnProperty(o)){var n=t[o];Array.isArray(n)?n.forEach((function(t){he(i,t,e[o])})):he(i,"string"==typeof n?n:o,e[o])}return i}var le=P,ce=function(e){var t=P(e),i={nodes:[],edges:[],options:{}};if(t.nodes&&t.nodes.forEach((function(e){var t={id:e.id,label:String(e.label||e.id)};K(t,de(e.attr,N)),t.image&&(t.shape="image"),i.nodes.push(t)})),t.edges){var o=function(e){var t={from:e.from,to:e.to};return K(t,de(e.attr,R)),null==t.arrows&&"->"===e.type&&(t.arrows="to"),t};t.edges.forEach((function(e){var t,n,s,r,a;t=e.from instanceof Object?e.from.nodes:{id:e.from},n=e.to instanceof Object?e.to.nodes:{id:e.to},e.from instanceof Object&&e.from.edges&&e.from.edges.forEach((function(e){var t=o(e);i.edges.push(t)})),s=t,r=n,a=function(t,n){var s=Q(i,t.id,n.id,e.type,e.attr),r=o(s);i.edges.push(r)},Array.isArray(s)?s.forEach((function(e){Array.isArray(r)?r.forEach((function(t){a(e,t)})):a(e,r)})):Array.isArray(r)?r.forEach((function(e){a(s,e)})):a(s,r),e.to instanceof Object&&e.to.edges&&e.to.edges.forEach((function(e){var t=o(e);i.edges.push(t)}))}))}return t.attr&&(i.options=t.attr),i},ue={parseDOT:le,DOTToGraph:ce},pe=Object.freeze({__proto__:null,default:ue,__moduleExports:ue,parseDOT:le,DOTToGraph:ce});function ve(e,t){var i={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};null!=t&&(null!=t.fixed&&(i.nodes.fixed=t.fixed),null!=t.parseColor&&(i.nodes.parseColor=t.parseColor),null!=t.inheritColor&&(i.edges.inheritColor=t.inheritColor));var o=e.edges.map((function(e){var t={from:e.source,id:e.id,to:e.target};return null!=e.attributes&&(t.attributes=e.attributes),null!=e.label&&(t.label=e.label),null!=e.attributes&&null!=e.attributes.title&&(t.title=e.attributes.title),"Directed"===e.type&&(t.arrows="to"),e.color&&!1===i.edges.inheritColor&&(t.color=e.color),t}));return{nodes:e.nodes.map((function(e){var t={id:e.id,fixed:i.nodes.fixed&&null!=e.x&&null!=e.y};return null!=e.attributes&&(t.attributes=e.attributes),null!=e.label&&(t.label=e.label),null!=e.size&&(t.size=e.size),null!=e.attributes&&null!=e.attributes.title&&(t.title=e.attributes.title),null!=e.title&&(t.title=e.title),null!=e.x&&(t.x=e.x),null!=e.y&&(t.y=e.y),null!=e.color&&(!0===i.nodes.parseColor?t.color=e.color:t.color={background:e.color,border:e.color,highlight:{background:e.color,border:e.color},hover:{background:e.color,border:e.color}}),t})),edges:o}}var fe=Object.freeze({__proto__:null,parseGephi:ve}),ge=Object.freeze({__proto__:null,default:void 0});function ye(e){return(ye="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function me(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function be(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function we(e,t,i){return t&&be(e.prototype,t),i&&be(e,i),e}function ke(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _e(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,o)}return i}function xe(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?_e(i,!0).forEach((function(t){ke(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):_e(i).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Ee(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Oe(e,t)}function Ce(e){return(Ce=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Oe(e,t){return(Oe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Te(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Se(e,t,i){return(Se="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,i){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Ce(e)););return e}(e,t);if(o){var n=Object.getOwnPropertyDescriptor(o,t);return n.get?n.get.call(i):n.value}})(e,t,i||e)}function Me(e){throw new Error('"'+e+'" is read-only')}function De(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;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||null==a.return||a.return()}finally{if(n)throw s}}return i}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Ie(){return(Ie=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(e[o]=i[o])}return e}).apply(this,arguments)}function Be(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function ze(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var Fe,Pe="function"!=typeof Object.assign?function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),i=1;i<arguments.length;i++){var o=arguments[i];if(null!=o)for(var n in o)o.hasOwnProperty(n)&&(t[n]=o[n])}return t}:Object.assign,Ne=["","webkit","Moz","MS","ms","o"],Re="undefined"==typeof document?{style:{}}:document.createElement("div"),Ae="function",je=Math.round,Le=Math.abs,He=Date.now;function We(e,t){for(var i,o,n=t[0].toUpperCase()+t.slice(1),s=0;s<Ne.length;){if((o=(i=Ne[s])?i+n:t)in e)return o;s++}}Fe="undefined"==typeof window?{}:window;var qe=We(Re.style,"touchAction"),Ve=void 0!==qe;var Ue="auto",Ye="manipulation",Xe="none",Ge="pan-x",Ke="pan-y",Ze=function(){if(!Ve)return!1;var e={},t=Fe.CSS&&Fe.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(i){return e[i]=!t||Fe.CSS.supports("touch-action",i)})),e}(),$e="ontouchstart"in Fe,Je=void 0!==We(Fe,"PointerEvent"),Qe=$e&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),et="touch",tt="mouse",it=25,ot=1,nt=2,st=4,rt=8,at=1,ht=2,dt=4,lt=8,ct=16,ut=ht|dt,pt=lt|ct,vt=ut|pt,ft=["x","y"],gt=["clientX","clientY"];function yt(e,t,i){var o;if(e)if(e.forEach)e.forEach(t,i);else if(void 0!==e.length)for(o=0;o<e.length;)t.call(i,e[o],o,e),o++;else for(o in e)e.hasOwnProperty(o)&&t.call(i,e[o],o,e)}function mt(e,t){return ye(e)===Ae?e.apply(t&&t[0]||void 0,t):e}function bt(e,t){return e.indexOf(t)>-1}var wt=function(){function e(e,t){this.manager=e,this.set(t)}var t=e.prototype;return t.set=function(e){"compute"===e&&(e=this.compute()),Ve&&this.manager.element.style&&Ze[e]&&(this.manager.element.style[qe]=e),this.actions=e.toLowerCase().trim()},t.update=function(){this.set(this.manager.options.touchAction)},t.compute=function(){var e=[];return yt(this.manager.recognizers,(function(t){mt(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(bt(e,Xe))return Xe;var t=bt(e,Ge),i=bt(e,Ke);return t&&i?Xe:t||i?t?Ge:Ke:bt(e,Ye)?Ye:Ue}(e.join(" "))},t.preventDefaults=function(e){var t=e.srcEvent,i=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var o=this.actions,n=bt(o,Xe)&&!Ze[Xe],s=bt(o,Ke)&&!Ze[Ke],r=bt(o,Ge)&&!Ze[Ge];if(n){var a=1===e.pointers.length,h=e.distance<2,d=e.deltaTime<250;if(a&&h&&d)return}if(!r||!s)return n||s&&i&ut||r&&i&pt?this.preventSrc(t):void 0}},t.preventSrc=function(e){this.manager.session.prevented=!0,e.preventDefault()},e}();function kt(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function _t(e){var t=e.length;if(1===t)return{x:je(e[0].clientX),y:je(e[0].clientY)};for(var i=0,o=0,n=0;n<t;)i+=e[n].clientX,o+=e[n].clientY,n++;return{x:je(i/t),y:je(o/t)}}function xt(e){for(var t=[],i=0;i<e.pointers.length;)t[i]={clientX:je(e.pointers[i].clientX),clientY:je(e.pointers[i].clientY)},i++;return{timeStamp:He(),pointers:t,center:_t(t),deltaX:e.deltaX,deltaY:e.deltaY}}function Et(e,t,i){i||(i=ft);var o=t[i[0]]-e[i[0]],n=t[i[1]]-e[i[1]];return Math.sqrt(o*o+n*n)}function Ct(e,t,i){i||(i=ft);var o=t[i[0]]-e[i[0]],n=t[i[1]]-e[i[1]];return 180*Math.atan2(n,o)/Math.PI}function Ot(e,t){return e===t?at:Le(e)>=Le(t)?e<0?ht:dt:t<0?lt:ct}function Tt(e,t,i){return{x:t/e||0,y:i/e||0}}function St(e,t){var i=e.session,o=t.pointers,n=o.length;i.firstInput||(i.firstInput=xt(t)),n>1&&!i.firstMultiple?i.firstMultiple=xt(t):1===n&&(i.firstMultiple=!1);var s=i.firstInput,r=i.firstMultiple,a=r?r.center:s.center,h=t.center=_t(o);t.timeStamp=He(),t.deltaTime=t.timeStamp-s.timeStamp,t.angle=Ct(a,h),t.distance=Et(a,h),function(e,t){var i=t.center,o=e.offsetDelta||{},n=e.prevDelta||{},s=e.prevInput||{};t.eventType!==ot&&s.eventType!==st||(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)}(i,t),t.offsetDirection=Ot(t.deltaX,t.deltaY);var d,l,c=Tt(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=c.x,t.overallVelocityY=c.y,t.overallVelocity=Le(c.x)>Le(c.y)?c.x:c.y,t.scale=r?(d=r.pointers,Et((l=o)[0],l[1],gt)/Et(d[0],d[1],gt)):1,t.rotation=r?function(e,t){return Ct(t[1],t[0],gt)+Ct(e[1],e[0],gt)}(r.pointers,o):0,t.maxPointers=i.prevInput?t.pointers.length>i.prevInput.maxPointers?t.pointers.length:i.prevInput.maxPointers:t.pointers.length,function(e,t){var i,o,n,s,r=e.lastInterval||t,a=t.timeStamp-r.timeStamp;if(t.eventType!==rt&&(a>it||void 0===r.velocity)){var h=t.deltaX-r.deltaX,d=t.deltaY-r.deltaY,l=Tt(a,h,d);o=l.x,n=l.y,i=Le(l.x)>Le(l.y)?l.x:l.y,s=Ot(h,d),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}(i,t);var u=e.element;kt(t.srcEvent.target,u)&&(u=t.srcEvent.target),t.target=u}function Mt(e,t,i){var o=i.pointers.length,n=i.changedPointers.length,s=t&ot&&o-n==0,r=t&(st|rt)&&o-n==0;i.isFirst=!!s,i.isFinal=!!r,s&&(e.session={}),i.eventType=t,St(e,i),e.emit("hammer.input",i),e.recognize(i),e.session.prevInput=i}function Dt(e){return e.trim().split(/\s+/g)}function It(e,t,i){yt(Dt(t),(function(t){e.addEventListener(t,i,!1)}))}function Bt(e,t,i){yt(Dt(t),(function(t){e.removeEventListener(t,i,!1)}))}function zt(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||window}var Ft=function(){function e(e,t){var i=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){mt(e.options.enable,[e])&&i.handler(t)},this.init()}var t=e.prototype;return t.handler=function(){},t.init=function(){this.evEl&&It(this.element,this.evEl,this.domHandler),this.evTarget&&It(this.target,this.evTarget,this.domHandler),this.evWin&&It(zt(this.element),this.evWin,this.domHandler)},t.destroy=function(){this.evEl&&Bt(this.element,this.evEl,this.domHandler),this.evTarget&&Bt(this.target,this.evTarget,this.domHandler),this.evWin&&Bt(zt(this.element),this.evWin,this.domHandler)},e}();function Pt(e,t,i){if(e.indexOf&&!i)return e.indexOf(t);for(var o=0;o<e.length;){if(i&&e[o][i]==t||!i&&e[o]===t)return o;o++}return-1}var Nt={pointerdown:ot,pointermove:nt,pointerup:st,pointercancel:rt,pointerout:rt},Rt={2:et,3:"pen",4:tt,5:"kinect"},At="pointerdown",jt="pointermove pointerup pointercancel";Fe.MSPointerEvent&&!Fe.PointerEvent&&(At="MSPointerDown",jt="MSPointerMove MSPointerUp MSPointerCancel");var Lt=function(e){function t(){var i,o=t.prototype;return o.evEl=At,o.evWin=jt,(i=e.apply(this,arguments)||this).store=i.manager.session.pointerEvents=[],i}return Be(t,e),t.prototype.handler=function(e){var t=this.store,i=!1,o=e.type.toLowerCase().replace("ms",""),n=Nt[o],s=Rt[e.pointerType]||e.pointerType,r=s===et,a=Pt(t,e.pointerId,"pointerId");n&ot&&(0===e.button||r)?a<0&&(t.push(e),a=t.length-1):n&(st|rt)&&(i=!0),a<0||(t[a]=e,this.callback(this.manager,n,{pointers:t,changedPointers:[e],pointerType:s,srcEvent:e}),i&&t.splice(a,1))},t}(Ft);function Ht(e){return Array.prototype.slice.call(e,0)}function Wt(e,t,i){for(var o=[],n=[],s=0;s<e.length;){var r=t?e[s][t]:e[s];Pt(n,r)<0&&o.push(e[s]),n[s]=r,s++}return i&&(o=t?o.sort((function(e,i){return e[t]>i[t]})):o.sort()),o}var qt={touchstart:ot,touchmove:nt,touchend:st,touchcancel:rt},Vt="touchstart touchmove touchend touchcancel",Ut=function(e){function t(){var i;return t.prototype.evTarget=Vt,(i=e.apply(this,arguments)||this).targetIds={},i}return Be(t,e),t.prototype.handler=function(e){var t=qt[e.type],i=Yt.call(this,e,t);i&&this.callback(this.manager,t,{pointers:i[0],changedPointers:i[1],pointerType:et,srcEvent:e})},t}(Ft);function Yt(e,t){var i,o,n=Ht(e.touches),s=this.targetIds;if(t&(ot|nt)&&1===n.length)return s[n[0].identifier]=!0,[n,n];var r=Ht(e.changedTouches),a=[],h=this.target;if(o=n.filter((function(e){return kt(e.target,h)})),t===ot)for(i=0;i<o.length;)s[o[i].identifier]=!0,i++;for(i=0;i<r.length;)s[r[i].identifier]&&a.push(r[i]),t&(st|rt)&&delete s[r[i].identifier],i++;return a.length?[Wt(o.concat(a),"identifier",!0),a]:void 0}var Xt={mousedown:ot,mousemove:nt,mouseup:st},Gt="mousedown",Kt="mousemove mouseup",Zt=function(e){function t(){var i,o=t.prototype;return o.evEl=Gt,o.evWin=Kt,(i=e.apply(this,arguments)||this).pressed=!1,i}return Be(t,e),t.prototype.handler=function(e){var t=Xt[e.type];t&ot&&0===e.button&&(this.pressed=!0),t&nt&&1!==e.which&&(t=st),this.pressed&&(t&st&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:tt,srcEvent:e}))},t}(Ft),$t=2500,Jt=25;function Qt(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var i={x:t.clientX,y:t.clientY},o=this.lastTouches;this.lastTouches.push(i);setTimeout((function(){var e=o.indexOf(i);e>-1&&o.splice(e,1)}),$t)}}function ei(e,t){e&ot?(this.primaryTouch=t.changedPointers[0].identifier,Qt.call(this,t)):e&(st|rt)&&Qt.call(this,t)}function ti(e){for(var t=e.srcEvent.clientX,i=e.srcEvent.clientY,o=0;o<this.lastTouches.length;o++){var n=this.lastTouches[o],s=Math.abs(t-n.x),r=Math.abs(i-n.y);if(s<=Jt&&r<=Jt)return!0}return!1}var ii=function(){return function(e){function t(t,i){var o;return(o=e.call(this,t,i)||this).handler=function(e,t,i){var n=i.pointerType===et,s=i.pointerType===tt;if(!(s&&i.sourceCapabilities&&i.sourceCapabilities.firesTouchEvents)){if(n)ei.call(ze(ze(o)),t,i);else if(s&&ti.call(ze(ze(o)),i))return;o.callback(e,t,i)}},o.touch=new Ut(o.manager,o.handler),o.mouse=new Zt(o.manager,o.handler),o.primaryTouch=null,o.lastTouches=[],o}return Be(t,e),t.prototype.destroy=function(){this.touch.destroy(),this.mouse.destroy()},t}(Ft)}();function oi(e,t,i){return!!Array.isArray(e)&&(yt(e,i[t],i),!0)}var ni=1,si=2,ri=4,ai=8,hi=ai,di=16,li=1;function ci(e,t){var i=t.manager;return i?i.get(e):e}function ui(e){return e&di?"cancel":e&ai?"end":e&ri?"move":e&si?"start":""}var pi=function(){function e(e){void 0===e&&(e={}),this.options=Ie({enable:!0},e),this.id=li++,this.manager=null,this.state=ni,this.simultaneous={},this.requireFail=[]}var t=e.prototype;return t.set=function(e){return Pe(this.options,e),this.manager&&this.manager.touchAction.update(),this},t.recognizeWith=function(e){if(oi(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=ci(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},t.dropRecognizeWith=function(e){return oi(e,"dropRecognizeWith",this)?this:(e=ci(e,this),delete this.simultaneous[e.id],this)},t.requireFailure=function(e){if(oi(e,"requireFailure",this))return this;var t=this.requireFail;return-1===Pt(t,e=ci(e,this))&&(t.push(e),e.requireFailure(this)),this},t.dropRequireFailure=function(e){if(oi(e,"dropRequireFailure",this))return this;e=ci(e,this);var t=Pt(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},t.hasRequireFailures=function(){return this.requireFail.length>0},t.canRecognizeWith=function(e){return!!this.simultaneous[e.id]},t.emit=function(e){var t=this,i=this.state;function o(i){t.manager.emit(i,e)}i<ai&&o(t.options.event+ui(i)),o(t.options.event),e.additionalEvent&&o(e.additionalEvent),i>=ai&&o(t.options.event+ui(i))},t.tryEmit=function(e){if(this.canEmit())return this.emit(e);this.state=32},t.canEmit=function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(32|ni)))return!1;e++}return!0},t.recognize=function(e){var t=Pe({},e);if(!mt(this.options.enable,[this,t]))return this.reset(),void(this.state=32);this.state&(hi|di|32)&&(this.state=ni),this.state=this.process(t),this.state&(si|ri|ai|di)&&this.tryEmit(t)},t.process=function(e){},t.getTouchAction=function(){},t.reset=function(){},e}(),vi={domEvents:!1,touchAction:"compute",enable:!0,inputTarget:null,inputClass:null,preset:[],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function fi(e,t){var i,o=e.element;o.style&&(yt(e.options.cssProps,(function(n,s){i=We(o.style,s),t?(e.oldCssProps[i]=o.style[i],o.style[i]=n):o.style[i]=e.oldCssProps[i]||""})),t||(e.oldCssProps={}))}var gi=function(){function e(e,t){var i,o=this;this.options=Pe({},vi,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new((i=this).options.inputClass||(Je?Lt:Qe?Ut:$e?ii:Zt))(i,Mt),this.touchAction=new wt(this,this.options.touchAction),fi(this,!0),yt(this.options.recognizers,(function(e){var t=o.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}var t=e.prototype;return t.set=function(e){return Pe(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},t.stop=function(e){this.session.stopped=e?2:1},t.recognize=function(e){var t=this.session;if(!t.stopped){var i;this.touchAction.preventDefaults(e);var o=this.recognizers,n=t.curRecognizer;(!n||n&&n.state&hi)&&(t.curRecognizer=null,n=null);for(var s=0;s<o.length;)i=o[s],2===t.stopped||n&&i!==n&&!i.canRecognizeWith(n)?i.reset():i.recognize(e),!n&&i.state&(si|ri|ai)&&(t.curRecognizer=i,n=i),s++}},t.get=function(e){if(e instanceof pi)return e;for(var t=this.recognizers,i=0;i<t.length;i++)if(t[i].options.event===e)return t[i];return null},t.add=function(e){if(oi(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},t.remove=function(e){if(oi(e,"remove",this))return this;var t=this.get(e);if(e){var i=this.recognizers,o=Pt(i,t);-1!==o&&(i.splice(o,1),this.touchAction.update())}return this},t.on=function(e,t){if(void 0===e||void 0===t)return this;var i=this.handlers;return yt(Dt(e),(function(e){i[e]=i[e]||[],i[e].push(t)})),this},t.off=function(e,t){if(void 0===e)return this;var i=this.handlers;return yt(Dt(e),(function(e){t?i[e]&&i[e].splice(Pt(i[e],t),1):delete i[e]})),this},t.emit=function(e,t){this.options.domEvents&&function(e,t){var i=document.createEvent("Event");i.initEvent(e,!0,!0),i.gesture=t,t.target.dispatchEvent(i)}(e,t);var i=this.handlers[e]&&this.handlers[e].slice();if(i&&i.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var o=0;o<i.length;)i[o](t),o++}},t.destroy=function(){this.element&&fi(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},e}(),yi={touchstart:ot,touchmove:nt,touchend:st,touchcancel:rt},mi="touchstart",bi="touchstart touchmove touchend touchcancel",wi=function(e){function t(){var i,o=t.prototype;return o.evTarget=mi,o.evWin=bi,(i=e.apply(this,arguments)||this).started=!1,i}return Be(t,e),t.prototype.handler=function(e){var t=yi[e.type];if(t===ot&&(this.started=!0),this.started){var i=ki.call(this,e,t);t&(st|rt)&&i[0].length-i[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:i[0],changedPointers:i[1],pointerType:et,srcEvent:e})}},t}(Ft);function ki(e,t){var i=Ht(e.touches),o=Ht(e.changedTouches);return t&(st|rt)&&(i=Wt(i.concat(o),"identifier",!0)),[i,o]}var _i=function(e){function t(t){return void 0===t&&(t={}),e.call(this,Ie({pointers:1},t))||this}Be(t,e);var i=t.prototype;return i.attrTest=function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},i.process=function(e){var t=this.state,i=e.eventType,o=t&(si|ri),n=this.attrTest(e);return o&&(i&rt||!n)?t|di:o||n?i&st?t|ai:t&si?t|ri:si:32},t}(pi),xi=function(e){function t(t){var i;return void 0===t&&(t={}),(i=e.call(this,Ie({event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},t))||this).pTime=!1,i.pCenter=!1,i._timer=null,i._input=null,i.count=0,i}Be(t,e);var i=t.prototype;return i.getTouchAction=function(){return[Ye]},i.process=function(e){var t=this,i=this.options,o=e.pointers.length===i.pointers,n=e.distance<i.threshold,s=e.deltaTime<i.time;if(this.reset(),e.eventType&ot&&0===this.count)return this.failTimeout();if(n&&s&&o){if(e.eventType!==st)return this.failTimeout();var r=!this.pTime||e.timeStamp-this.pTime<i.interval,a=!this.pCenter||Et(this.pCenter,e.center)<i.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,a&&r?this.count+=1:this.count=1,this._input=e,0===this.count%i.taps)return this.hasRequireFailures()?(this._timer=setTimeout((function(){t.state=hi,t.tryEmit()}),i.interval),si):hi}return 32},i.failTimeout=function(){var e=this;return this._timer=setTimeout((function(){e.state=32}),this.options.interval),32},i.reset=function(){clearTimeout(this._timer)},i.emit=function(){this.state===hi&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},t}(pi);function Ei(e){return e===ct?"down":e===lt?"up":e===ht?"left":e===dt?"right":""}var Ci=function(e){function t(t){var i;return void 0===t&&(t={}),(i=e.call(this,Ie({event:"pan",threshold:10,pointers:1,direction:vt},t))||this).pX=null,i.pY=null,i}Be(t,e);var i=t.prototype;return i.getTouchAction=function(){var e=this.options.direction,t=[];return e&ut&&t.push(Ke),e&pt&&t.push(Ge),t},i.directionTest=function(e){var t=this.options,i=!0,o=e.distance,n=e.direction,s=e.deltaX,r=e.deltaY;return n&t.direction||(t.direction&ut?(n=0===s?at:s<0?ht:dt,i=s!==this.pX,o=Math.abs(e.deltaX)):(n=0===r?at:r<0?lt:ct,i=r!==this.pY,o=Math.abs(e.deltaY))),e.direction=n,i&&o>t.threshold&&n&t.direction},i.attrTest=function(e){return _i.prototype.attrTest.call(this,e)&&(this.state&si||!(this.state&si)&&this.directionTest(e))},i.emit=function(t){this.pX=t.deltaX,this.pY=t.deltaY;var i=Ei(t.direction);i&&(t.additionalEvent=this.options.event+i),e.prototype.emit.call(this,t)},t}(_i),Oi=function(e){function t(t){return void 0===t&&(t={}),e.call(this,Ie({event:"swipe",threshold:10,velocity:.3,direction:ut|pt,pointers:1},t))||this}Be(t,e);var i=t.prototype;return i.getTouchAction=function(){return Ci.prototype.getTouchAction.call(this)},i.attrTest=function(t){var i,o=this.options.direction;return o&(ut|pt)?i=t.overallVelocity:o&ut?i=t.overallVelocityX:o&pt&&(i=t.overallVelocityY),e.prototype.attrTest.call(this,t)&&o&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers===this.options.pointers&&Le(i)>this.options.velocity&&t.eventType&st},i.emit=function(e){var t=Ei(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)},t}(_i),Ti=function(e){function t(t){return void 0===t&&(t={}),e.call(this,Ie({event:"pinch",threshold:0,pointers:2},t))||this}Be(t,e);var i=t.prototype;return i.getTouchAction=function(){return[Xe]},i.attrTest=function(t){return e.prototype.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&si)},i.emit=function(t){if(1!==t.scale){var i=t.scale<1?"in":"out";t.additionalEvent=this.options.event+i}e.prototype.emit.call(this,t)},t}(_i),Si=function(e){function t(t){return void 0===t&&(t={}),e.call(this,Ie({event:"rotate",threshold:0,pointers:2},t))||this}Be(t,e);var i=t.prototype;return i.getTouchAction=function(){return[Xe]},i.attrTest=function(t){return e.prototype.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&si)},t}(_i),Mi=function(e){function t(t){var i;return void 0===t&&(t={}),(i=e.call(this,Ie({event:"press",pointers:1,time:251,threshold:9},t))||this)._timer=null,i._input=null,i}Be(t,e);var i=t.prototype;return i.getTouchAction=function(){return[Ue]},i.process=function(e){var t=this,i=this.options,o=e.pointers.length===i.pointers,n=e.distance<i.threshold,s=e.deltaTime>i.time;if(this._input=e,!n||!o||e.eventType&(st|rt)&&!s)this.reset();else if(e.eventType&ot)this.reset(),this._timer=setTimeout((function(){t.state=hi,t.tryEmit()}),i.time);else if(e.eventType&st)return hi;return 32},i.reset=function(){clearTimeout(this._timer)},i.emit=function(e){this.state===hi&&(e&&e.eventType&st?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=He(),this.manager.emit(this.options.event,this._input)))},t}(pi);function Di(e,t,i){var o="DEPRECATED METHOD: "+t+"\n"+i+" AT \n";return function(){var t=new Error("get-stack-trace"),i=t&&t.stack?t.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",n=window.console&&(window.console.warn||window.console.log);return n&&n.call(window.console,o,i),e.apply(this,arguments)}}var Ii=Di((function(e,t,i){for(var o=Object.keys(t),n=0;n<o.length;)(!i||i&&void 0===e[o[n]])&&(e[o[n]]=t[o[n]]),n++;return e}),"extend","Use `assign`."),Bi=Di((function(e,t){return Ii(e,t,!0)}),"merge","Use `assign`.");function zi(e,t,i){var o,n=t.prototype;(o=e.prototype=Object.create(n)).constructor=e,o._super=n,i&&Pe(o,i)}function Fi(e,t){return function(){return e.apply(t,arguments)}}var Pi=function(){var e=function(e,t){return void 0===t&&(t={}),new gi(e,Ie({recognizers:[[Si,{enable:!1}],[Ti,{enable:!1},["rotate"]],[Oi,{direction:ut}],[Ci,{direction:ut},["swipe"]],[xi],[xi,{event:"doubletap",taps:2},["tap"]],[Mi]]},t))};return e.VERSION="2.0.15",e.DIRECTION_ALL=vt,e.DIRECTION_DOWN=ct,e.DIRECTION_LEFT=ht,e.DIRECTION_RIGHT=dt,e.DIRECTION_UP=lt,e.DIRECTION_HORIZONTAL=ut,e.DIRECTION_VERTICAL=pt,e.DIRECTION_NONE=at,e.DIRECTION_DOWN=ct,e.INPUT_START=ot,e.INPUT_MOVE=nt,e.INPUT_END=st,e.INPUT_CANCEL=rt,e.STATE_POSSIBLE=ni,e.STATE_BEGAN=si,e.STATE_CHANGED=ri,e.STATE_ENDED=ai,e.STATE_RECOGNIZED=hi,e.STATE_CANCELLED=di,e.STATE_FAILED=32,e.Manager=gi,e.Input=Ft,e.TouchAction=wt,e.TouchInput=Ut,e.MouseInput=Zt,e.PointerEventInput=Lt,e.TouchMouseInput=ii,e.SingleTouchInput=wi,e.Recognizer=pi,e.AttrRecognizer=_i,e.Tap=xi,e.Pan=Ci,e.Swipe=Oi,e.Pinch=Ti,e.Rotate=Si,e.Press=Mi,e.on=It,e.off=Bt,e.each=yt,e.merge=Bi,e.extend=Ii,e.bindFn=Fi,e.assign=Pe,e.inherit=zi,e.bindFn=Fi,e.prefixed=We,e.toArray=Ht,e.inArray=Pt,e.uniqueArray=Wt,e.splitStr=Dt,e.boolOrFn=mt,e.hasParent=kt,e.addEventListeners=It,e.removeEventListeners=Bt,e.defaults=vi,e}(),Ni=z(Object.freeze({__proto__:null,default:Pi,INPUT_START:ot,INPUT_MOVE:nt,INPUT_END:st,INPUT_CANCEL:rt,STATE_POSSIBLE:ni,STATE_BEGAN:si,STATE_CHANGED:ri,STATE_ENDED:ai,STATE_RECOGNIZED:hi,STATE_CANCELLED:di,STATE_FAILED:32,DIRECTION_NONE:at,DIRECTION_LEFT:ht,DIRECTION_RIGHT:dt,DIRECTION_UP:lt,DIRECTION_DOWN:ct,DIRECTION_HORIZONTAL:ut,DIRECTION_VERTICAL:pt,DIRECTION_ALL:vt,Manager:gi,Input:Ft,TouchAction:wt,TouchInput:Ut,MouseInput:Zt,PointerEventInput:Lt,TouchMouseInput:ii,SingleTouchInput:wi,Recognizer:pi,AttrRecognizer:_i,Tap:xi,Pan:Ci,Swipe:Oi,Pinch:Ti,Rotate:Si,Press:Mi,on:It,off:Bt,each:yt,merge:Bi,extend:Ii,assign:Pe,inherit:zi,bindFn:Fi,prefixed:We,toArray:Ht,inArray:Pt,uniqueArray:Wt,splitStr:Dt,boolOrFn:mt,hasParent:kt,addEventListeners:It,removeEventListeners:Bt,defaults:vi})),Ri=B((function(e){if("undefined"!=typeof window){var t=window.Hammer||Ni;e.exports=t}else e.exports=function(){return{on:e=function(){},off:e,destroy:e,emit:e,get:function(t){return{set:e}}};var e}}));function Ai(e){var t=this;this.active=!1,this.dom={container:e},this.dom.overlay=document.createElement("div"),this.dom.overlay.className="vis-overlay",this.dom.container.appendChild(this.dom.overlay),this.hammer=Ri(this.dom.overlay),this.hammer.on("tap",this._onTapOverlay.bind(this));["tap","doubletap","press","pinch","pan","panstart","panmove","panend"].forEach((function(e){t.hammer.on(e,(function(e){e.srcEvent.stopPropagation()}))})),document&&document.body&&(this.onClick=function(i){(function(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1})(i.target,e)||t.deactivate()},document.body.addEventListener("click",this.onClick)),void 0!==this.keycharm&&this.keycharm.destroy(),this.keycharm=M(),this.escListener=this.deactivate.bind(this)}z(ge),F(Ai.prototype),Ai.current=null,Ai.prototype.destroy=function(){this.deactivate(),this.dom.overlay.parentNode.removeChild(this.dom.overlay),this.onClick&&document.body.removeEventListener("click",this.onClick),void 0!==this.keycharm&&this.keycharm.destroy(),this.keycharm=null,this.hammer.destroy(),this.hammer=null},Ai.prototype.activate=function(){Ai.current&&Ai.current.deactivate(),Ai.current=this,this.active=!0,this.dom.overlay.style.display="none",e.addClassName(this.dom.container,"vis-active"),this.emit("change"),this.emit("activate"),this.keycharm.bind("esc",this.escListener)},Ai.prototype.deactivate=function(){this.active=!1,this.dom.overlay.style.display="block",e.removeClassName(this.dom.container,"vis-active"),this.keycharm.unbind("esc",this.escListener),this.emit("change"),this.emit("deactivate")},Ai.prototype._onTapOverlay=function(e){this.activate(),e.srcEvent.stopPropagation()};var ji,Li=Ai,Hi=B((function(e,t){t.en={edit:"Edit",del:"Delete selected",back:"Back",addNode:"Add Node",addEdge:"Add Edge",editNode:"Edit Node",editEdge:"Edit Edge",addDescription:"Click in an empty space to place a new node.",edgeDescription:"Click on a node and drag the edge to another node to connect them.",editEdgeDescription:"Click on the control points and drag them to a node to connect to it.",createEdgeError:"Cannot link edges to a cluster.",deleteClusterError:"Clusters cannot be deleted.",editClusterError:"Clusters cannot be edited."},t.en_EN=t.en,t.en_US=t.en,t.de={edit:"Editieren",del:"Lösche Auswahl",back:"Zurück",addNode:"Knoten hinzufügen",addEdge:"Kante hinzufügen",editNode:"Knoten editieren",editEdge:"Kante editieren",addDescription:"Klicke auf eine freie Stelle, um einen neuen Knoten zu plazieren.",edgeDescription:"Klicke auf einen Knoten und ziehe die Kante zu einem anderen Knoten, um diese zu verbinden.",editEdgeDescription:"Klicke auf die Verbindungspunkte und ziehe diese auf einen Knoten, um sie zu verbinden.",createEdgeError:"Es ist nicht möglich, Kanten mit Clustern zu verbinden.",deleteClusterError:"Cluster können nicht gelöscht werden.",editClusterError:"Cluster können nicht editiert werden."},t.de_DE=t.de,t.es={edit:"Editar",del:"Eliminar selección",back:"Atrás",addNode:"Añadir nodo",addEdge:"Añadir arista",editNode:"Editar nodo",editEdge:"Editar arista",addDescription:"Haga clic en un lugar vacío para colocar un nuevo nodo.",edgeDescription:"Haga clic en un nodo y arrastre la arista hacia otro nodo para conectarlos.",editEdgeDescription:"Haga clic en un punto de control y arrastrelo a un nodo para conectarlo.",createEdgeError:"No se puede conectar una arista a un grupo.",deleteClusterError:"No es posible eliminar grupos.",editClusterError:"No es posible editar grupos."},t.es_ES=t.es,t.it={edit:"Modifica",del:"Cancella la selezione",back:"Indietro",addNode:"Aggiungi un nodo",addEdge:"Aggiungi un vertice",editNode:"Modifica il nodo",editEdge:"Modifica il vertice",addDescription:"Clicca per aggiungere un nuovo nodo",edgeDescription:"Clicca su un nodo e trascinalo ad un altro nodo per connetterli.",editEdgeDescription:"Clicca sui Punti di controllo e trascinali ad un nodo per connetterli.",createEdgeError:"Non si possono collegare vertici ad un cluster",deleteClusterError:"I cluster non possono essere cancellati",editClusterError:"I clusters non possono essere modificati."},t.it_IT=t.it,t.nl={edit:"Wijzigen",del:"Selectie verwijderen",back:"Terug",addNode:"Node toevoegen",addEdge:"Link toevoegen",editNode:"Node wijzigen",editEdge:"Link wijzigen",addDescription:"Klik op een leeg gebied om een nieuwe node te maken.",edgeDescription:"Klik op een node en sleep de link naar een andere node om ze te verbinden.",editEdgeDescription:"Klik op de verbindingspunten en sleep ze naar een node om daarmee te verbinden.",createEdgeError:"Kan geen link maken naar een cluster.",deleteClusterError:"Clusters kunnen niet worden verwijderd.",editClusterError:"Clusters kunnen niet worden aangepast."},t.nl_NL=t.nl,t.nl_BE=t.nl,t["pt-br"]={edit:"Editar",del:"Remover selecionado",back:"Voltar",addNode:"Adicionar nó",addEdge:"Adicionar aresta",editNode:"Editar nó",editEdge:"Editar aresta",addDescription:"Clique em um espaço em branco para adicionar um novo nó",edgeDescription:"Clique em um nó e arraste a aresta até outro nó para conectá-los",editEdgeDescription:"Clique nos pontos de controle e os arraste para um nó para conectá-los",createEdgeError:"Não foi possível linkar arestas a um cluster.",deleteClusterError:"Clusters não puderam ser removidos.",editClusterError:"Clusters não puderam ser editados."},t["pt-BR"]=t["pt-br"],t.pt_BR=t["pt-br"],t.pt_br=t["pt-br"],t.ru={edit:"Редактировать",del:"Удалить выбранное",back:"Назад",addNode:"Добавить узел",addEdge:"Добавить ребро",editNode:"Редактировать узел",editEdge:"Редактировать ребро",addDescription:"Кликните в свободное место, чтобы добавить новый узел.",edgeDescription:"Кликните на узел и протяните ребро к другому узлу, чтобы соединить их.",editEdgeDescription:"Кликните на контрольные точки и перетащите их в узел, чтобы подключиться к нему.",createEdgeError:"Невозможно соединить ребра в кластер.",deleteClusterError:"Кластеры не могут быть удалены",editClusterError:"Кластеры недоступны для редактирования."},t.ru_RU=t.ru,t.cn={edit:"编辑",del:"删除选定",back:"返回",addNode:"添加节点",addEdge:"添加连接线",editNode:"编辑节点",editEdge:"编辑连接线",addDescription:"单击空白处放置新节点。",edgeDescription:"单击某个节点并将该连接线拖动到另一个节点以连接它们。",editEdgeDescription:"单击控制节点并将它们拖到节点上连接。",createEdgeError: