// Version 1.42.4 force-graph - https://github.com/vasturiano/force-graph !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t="undefined"!=typeof globalThis?globalThis:t||self).ForceGraph=n()}(this,(function(){"use strict";function n(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}function e(t){for(var e=1;et.length)&&(n=t.length);for(var e=0,r=new Array(n);e=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),d.hasOwnProperty(n)?{space:d[n],local:t}:t}function g(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===f&&n.documentElement.namespaceURI===f?n.createElement(t):n.createElementNS(e,t)}}function y(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function v(t){var n=p(t);return(n.local?y:g)(n)}function _(){}function m(t){return null==t?_:function(){return this.querySelector(t)}}function x(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}function b(){return[]}function w(t){return null==t?b:function(){return this.querySelectorAll(t)}}function k(t){return function(){return this.matches(t)}}function z(t){return function(n){return n.matches(t)}}var A=Array.prototype.find;function M(){return this.firstElementChild}var S=Array.prototype.filter;function C(){return Array.from(this.children)}function E(t){return new Array(t.length)}function N(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function P(t){return function(){return t}}function O(t,n,e,r,i,o){for(var a,s=0,u=n.length,l=o.length;sn?1:t>=n?0:NaN}function I(t){return function(){this.removeAttribute(t)}}function U(t){return function(){this.removeAttributeNS(t.space,t.local)}}function F(t,n){return function(){this.setAttribute(t,n)}}function L(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function q(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function B(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function H(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function V(t){return function(){this.style.removeProperty(t)}}function G(t,n,e){return function(){this.style.setProperty(t,n,e)}}function X(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function Y(t,n){return t.style.getPropertyValue(n)||H(t).getComputedStyle(t,null).getPropertyValue(n)}function $(t){return function(){delete this[t]}}function W(t,n){return function(){this[t]=n}}function Z(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function Q(t){return t.trim().split(/^|\s+/)}function K(t){return t.classList||new J(t)}function J(t){this._node=t,this._names=Q(t.getAttribute("class")||"")}function tt(t,n){for(var e=K(t),r=-1,i=n.length;++r=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}function _t(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var kt=[null];function zt(t,n){this._groups=t,this._parents=n}function At(){return new zt([[document.documentElement]],kt)}function Mt(t){return"string"==typeof t?new zt([[document.querySelector(t)]],[document.documentElement]):new zt([[t]],kt)}function St(t,n){if(t=function(t){let n;for(;n=t.sourceEvent;)t=n;return t}(t),void 0===n&&(n=t.currentTarget),n){var e=n.ownerSVGElement||n;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,[(r=r.matrixTransform(n.getScreenCTM().inverse())).x,r.y]}if(n.getBoundingClientRect){var i=n.getBoundingClientRect();return[t.clientX-i.left-n.clientLeft,t.clientY-i.top-n.clientTop]}}return[t.pageX,t.pageY]}zt.prototype=At.prototype={constructor:zt,select:function(t){"function"!=typeof t&&(t=m(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i=b&&(b=x+1);!(m=y[b])&&++b=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=D);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o1?this.each((null==n?V:"function"==typeof n?X:G)(t,n,null==e?"":e)):Y(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?$:"function"==typeof n?Z:W)(t,n)):this.node()[t]},classed:function(t,n){var e=Q(t+"");if(arguments.length<2){for(var r=K(this.node()),i=-1,o=e.length;++i{}};function Et(){for(var t,n=0,e=arguments.length,r={};n=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))}function Ot(t,n){for(var e,r=0,i=t.length;r0)for(var e,r,i=new Array(e),o=0;o()=>t;function qt(t,{sourceEvent:n,subject:e,target:r,identifier:i,active:o,x:a,y:s,dx:u,dy:l,dispatch:c}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:c}})}function Bt(t){return!t.ctrlKey&&!t.button}function Ht(){return this.parentNode}function Vt(t,n){return null==n?{x:t.x,y:t.y}:n}function Gt(){return navigator.maxTouchPoints||"ontouchstart"in this}function Xt(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function Yt(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function $t(){}qt.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var Wt=.7,Zt=1/Wt,Qt="\\s*([+-]?\\d+)\\s*",Kt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Jt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",tn=/^#([0-9a-f]{3,8})$/,nn=new RegExp("^rgb\\("+[Qt,Qt,Qt]+"\\)$"),en=new RegExp("^rgb\\("+[Jt,Jt,Jt]+"\\)$"),rn=new RegExp("^rgba\\("+[Qt,Qt,Qt,Kt]+"\\)$"),on=new RegExp("^rgba\\("+[Jt,Jt,Jt,Kt]+"\\)$"),an=new RegExp("^hsl\\("+[Kt,Jt,Jt]+"\\)$"),sn=new RegExp("^hsla\\("+[Kt,Jt,Jt,Kt]+"\\)$"),un={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function ln(){return this.rgb().formatHex()}function cn(){return this.rgb().formatRgb()}function hn(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=tn.exec(t))?(e=n[1].length,n=parseInt(n[1],16),6===e?fn(n):3===e?new yn(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?dn(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?dn(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|240&n,((15&n)<<4|15&n)/255):null):(n=nn.exec(t))?new yn(n[1],n[2],n[3],1):(n=en.exec(t))?new yn(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=rn.exec(t))?dn(n[1],n[2],n[3],n[4]):(n=on.exec(t))?dn(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=an.exec(t))?xn(n[1],n[2]/100,n[3]/100,1):(n=sn.exec(t))?xn(n[1],n[2]/100,n[3]/100,n[4]):un.hasOwnProperty(t)?fn(un[t]):"transparent"===t?new yn(NaN,NaN,NaN,0):null}function fn(t){return new yn(t>>16&255,t>>8&255,255&t,1)}function dn(t,n,e,r){return r<=0&&(t=n=e=NaN),new yn(t,n,e,r)}function pn(t){return t instanceof $t||(t=hn(t)),t?new yn((t=t.rgb()).r,t.g,t.b,t.opacity):new yn}function gn(t,n,e,r){return 1===arguments.length?pn(t):new yn(t,n,e,null==r?1:r)}function yn(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function vn(){return"#"+mn(this.r)+mn(this.g)+mn(this.b)}function _n(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function mn(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function xn(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new wn(t,n,e,r)}function bn(t){if(t instanceof wn)return new wn(t.h,t.s,t.l,t.opacity);if(t instanceof $t||(t=hn(t)),!t)return new wn;if(t instanceof wn)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=n===o?(e-r)/s+6*(e0&&u<1?0:a,new wn(a,s,u,t.opacity)}function wn(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function kn(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}Xt($t,hn,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:ln,formatHex:ln,formatHsl:function(){return bn(this).formatHsl()},formatRgb:cn,toString:cn}),Xt(yn,gn,Yt($t,{brighter:function(t){return t=null==t?Zt:Math.pow(Zt,t),new yn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?Wt:Math.pow(Wt,t),new yn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:vn,formatHex:vn,formatRgb:_n,toString:_n})),Xt(wn,(function(t,n,e,r){return 1===arguments.length?bn(t):new wn(t,n,e,null==r?1:r)}),Yt($t,{brighter:function(t){return t=null==t?Zt:Math.pow(Zt,t),new wn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?Wt:Math.pow(Wt,t),new wn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new yn(kn(t>=240?t-240:t+120,i,r),kn(t,i,r),kn(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var zn=t=>()=>t;function An(t){return 1==(t=+t)?Mn:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):zn(isNaN(n)?e:n)}}function Mn(t,n){var e=n-t;return e?function(t,n){return function(e){return t+e*n}}(t,e):zn(isNaN(t)?n:t)}var Sn=function t(n){var e=An(n);function r(t,n){var r=e((t=gn(t)).r,(n=gn(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),a=Mn(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=o(n),t.opacity=a(n),t+""}}return r.gamma=t,r}(1);function Cn(t,n){return t=+t,n=+n,function(e){return t*(1-e)+n*e}}var En=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Nn=new RegExp(En.source,"g");function Pn(t,n){var e,r,i,o=En.lastIndex=Nn.lastIndex=0,a=-1,s=[],u=[];for(t+="",n+="";(e=En.exec(t))&&(r=Nn.exec(n));)(i=r.index)>o&&(i=n.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(e=e[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:Cn(e,r)})),o=Nn.lastIndex;return o180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:Cn(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(o.rotate,a.rotate,s,u),function(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:Cn(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(o.skewX,a.skewX,s,u),function(t,n,e,r,o,a){if(t!==e||n!==r){var s=o.push(i(o)+"scale(",null,",",null,")");a.push({i:s-4,x:Cn(t,e)},{i:s-2,x:Cn(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,s,u),o=a=null,function(t){for(var n,e=-1,r=u.length;++e=0&&n._call.call(void 0,t),n=n._next;--Hn}()}finally{Hn=0,function(){var t,n,e=Ln,r=1/0;for(;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Ln=n);qn=t,re(r)}(),Yn=0}}function ee(){var t=Wn.now(),n=t-Xn;n>1e3&&($n-=n,Xn=t)}function re(t){Hn||(Vn&&(Vn=clearTimeout(Vn)),t-Yn>24?(t<1/0&&(Vn=setTimeout(ne,t-Wn.now()-$n)),Gn&&(Gn=clearInterval(Gn))):(Gn||(Xn=Wn.now(),Gn=setInterval(ee,1e3)),Hn=1,Zn(ne)))}function ie(t,n,e){var r=new Jn;return n=null==n?0:+n,r.restart((e=>{r.stop(),t(e+n)}),n,e),r}Jn.prototype=te.prototype={constructor:Jn,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?Qn():+e)+(null==n?0:+n),this._next||qn===this||(qn?qn._next=this:Ln=this,qn=this),this._call=t,this._time=e,re()},stop:function(){this._call&&(this._call=null,this._time=1/0,re())}};var oe=Et("start","end","cancel","interrupt"),ae=[];function se(t,n,e,r,i,o){var a=t.__transition;if(a){if(e in a)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function o(t){e.state=1,e.timer.restart(a,e.delay,e.time),e.delay<=t&&a(t-e.delay)}function a(o){var l,c,h,f;if(1!==e.state)return u();for(l in i)if((f=i[l]).name===e.name){if(3===f.state)return ie(a);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete i[l]):+l0)throw new Error("too late; already scheduled");return e}function le(t,n){var e=ce(t,n);if(e.state>3)throw new Error("too late; already running");return e}function ce(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function he(t,n){var e,r,i,o=t.__transition,a=!0;if(o){for(i in n=null==n?null:n+"",o)(e=o[i]).name===n?(r=e.state>2&&e.state<5,e.state=6,e.timer.stop(),e.on.call(r?"interrupt":"cancel",t,t.__data__,e.index,e.group),delete o[i]):a=!1;a&&delete t.__transition}}function fe(t,n){var e,r;return function(){var i=le(this,t),o=i.tween;if(o!==e)for(var a=0,s=(r=e=o).length;a=0&&(t=t.slice(0,n)),!t||"start"===t}))}(n)?ue:le;return function(){var a=o(this,t),s=a.on;s!==r&&(i=(r=s).copy()).on(n,e),a.on=i}}var Oe=At.prototype.constructor;function Te(t){return function(){this.style.removeProperty(t)}}function je(t,n,e){return function(r){this.style.setProperty(t,n.call(this,r),e)}}function Re(t,n,e){var r,i;function o(){var o=n.apply(this,arguments);return o!==i&&(r=(i=o)&&je(t,o,e)),r}return o._value=n,o}function De(t){return function(n){this.textContent=t.call(this,n)}}function Ie(t){var n,e;function r(){var r=t.apply(this,arguments);return r!==e&&(n=(e=r)&&De(r)),n}return r._value=t,r}var Ue=0;function Fe(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function Le(){return++Ue}var qe=At.prototype;Fe.prototype={constructor:Fe,select:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=m(t));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a()=>t;function Ge(t,{sourceEvent:n,target:e,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:e,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Xe(t,n,e){this.k=t,this.x=n,this.y=e}Xe.prototype={constructor:Xe,scale:function(t){return 1===t?this:new Xe(this.k*t,this.x,this.y)},translate:function(t,n){return 0===t&0===n?this:new Xe(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Ye=new Xe(1,0,0);function $e(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Ye;return t.__zoom}function We(t){t.stopImmediatePropagation()}function Ze(t){t.preventDefault(),t.stopImmediatePropagation()}function Qe(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function Ke(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function Je(){return this.__zoom||Ye}function tr(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function nr(){return navigator.maxTouchPoints||"ontouchstart"in this}function er(t,n,e){var r=t.invertX(n[0][0])-e[0][0],i=t.invertX(n[1][0])-e[1][0],o=t.invertY(n[0][1])-e[0][1],a=t.invertY(n[1][1])-e[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function rr(){var t,n,e,r=Qe,i=Ke,o=er,a=tr,s=nr,u=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,h=Bn,f=Et("start","zoom","end"),d=500,p=0,g=10;function y(t){t.property("__zoom",Je).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",z).on("dblclick.zoom",A).filter(s).on("touchstart.zoom",M).on("touchmove.zoom",S).on("touchend.zoom touchcancel.zoom",C).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(t,n){return(n=Math.max(u[0],Math.min(u[1],n)))===t.k?t:new Xe(n,t.x,t.y)}function _(t,n,e){var r=n[0]-e[0]*t.k,i=n[1]-e[1]*t.k;return r===t.x&&i===t.y?t:new Xe(t.k,r,i)}function m(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function x(t,n,e,r){t.on("start.zoom",(function(){b(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){b(this,arguments).event(r).end()})).tween("zoom",(function(){var t=this,o=arguments,a=b(t,o).event(r),s=i.apply(t,o),u=null==e?m(s):"function"==typeof e?e.apply(t,o):e,l=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),c=t.__zoom,f="function"==typeof n?n.apply(t,o):n,d=h(c.invert(u).concat(l/c.k),f.invert(u).concat(l/f.k));return function(t){if(1===t)t=f;else{var n=d(t),e=l/n[2];t=new Xe(e,u[0]-n[0]*e,u[1]-n[1]*e)}a.zoom(null,t)}}))}function b(t,n,e){return!e&&t.__zooming||new w(t,n)}function w(t,n){this.that=t,this.args=n,this.active=0,this.sourceEvent=null,this.extent=i.apply(t,n),this.taps=0}function k(t,...n){if(r.apply(this,arguments)){var e=b(this,n).event(t),i=this.__zoom,s=Math.max(u[0],Math.min(u[1],i.k*Math.pow(2,a.apply(this,arguments)))),c=St(t);if(e.wheel)e.mouse[0][0]===c[0]&&e.mouse[0][1]===c[1]||(e.mouse[1]=i.invert(e.mouse[0]=c)),clearTimeout(e.wheel);else{if(i.k===s)return;e.mouse=[c,i.invert(c)],he(this),e.start()}Ze(t),e.wheel=setTimeout(h,150),e.zoom("mouse",o(_(v(i,s),e.mouse[0],e.mouse[1]),e.extent,l))}function h(){e.wheel=null,e.end()}}function z(t,...n){if(!e&&r.apply(this,arguments)){var i=t.currentTarget,a=b(this,n,!0).event(t),s=Mt(t.view).on("mousemove.zoom",f,!0).on("mouseup.zoom",d,!0),u=St(t,i),c=t.clientX,h=t.clientY;Ut(t.view),We(t),a.mouse=[u,this.__zoom.invert(u)],he(this),a.start()}function f(t){if(Ze(t),!a.moved){var n=t.clientX-c,e=t.clientY-h;a.moved=n*n+e*e>p}a.event(t).zoom("mouse",o(_(a.that.__zoom,a.mouse[0]=St(t,i),a.mouse[1]),a.extent,l))}function d(t){s.on("mousemove.zoom mouseup.zoom",null),Ft(t.view,a.moved),Ze(t),a.event(t).end()}}function A(t,...n){if(r.apply(this,arguments)){var e=this.__zoom,a=St(t.changedTouches?t.changedTouches[0]:t,this),s=e.invert(a),u=e.k*(t.shiftKey?.5:2),h=o(_(v(e,u),a,s),i.apply(this,n),l);Ze(t),c>0?Mt(this).transition().duration(c).call(x,h,a,t):Mt(this).call(y.transform,h,a,t)}}function M(e,...i){if(r.apply(this,arguments)){var o,a,s,u,l=e.touches,c=l.length,h=b(this,i,e.changedTouches.length===c).event(e);for(We(e),a=0;a=n)&&(e=n);else{let r=-1;for(let i of t)null!=(i=n(i,++r,t))&&(e=i)&&(e=i)}return e}function ur(t,n){let e;if(void 0===n)for(const n of t)null!=n&&(e>n||void 0===e&&n>=n)&&(e=n);else{let r=-1;for(let i of t)null!=(i=n(i,++r,t))&&(e>i||void 0===e&&i>=i)&&(e=i)}return e}var lr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},cr="Expected a function",hr=/^\s+|\s+$/g,fr=/^[-+]0x[0-9a-f]+$/i,dr=/^0b[01]+$/i,pr=/^0o[0-7]+$/i,gr=parseInt,yr="object"==typeof lr&&lr&&lr.Object===Object&&lr,vr="object"==typeof self&&self&&self.Object===Object&&self,_r=yr||vr||Function("return this")(),mr=Object.prototype.toString,xr=Math.max,br=Math.min,wr=function(){return _r.Date.now()};function kr(t,n,e){var r,i,o,a,s,u,l=0,c=!1,h=!1,f=!0;if("function"!=typeof t)throw new TypeError(cr);function d(n){var e=r,o=i;return r=i=void 0,l=n,a=t.apply(o,e)}function p(t){return l=t,s=setTimeout(y,n),c?d(t):a}function g(t){var e=t-u;return void 0===u||e>=n||e<0||h&&t-l>=o}function y(){var t=wr();if(g(t))return v(t);s=setTimeout(y,function(t){var e=n-(t-u);return h?br(e,o-(t-l)):e}(t))}function v(t){return s=void 0,f&&r?d(t):(r=i=void 0,a)}function _(){var t=wr(),e=g(t);if(r=arguments,i=this,u=t,e){if(void 0===s)return p(u);if(h)return s=setTimeout(y,n),d(u)}return void 0===s&&(s=setTimeout(y,n)),a}return n=Ar(n)||0,zr(e)&&(c=!!e.leading,o=(h="maxWait"in e)?xr(Ar(e.maxWait)||0,n):o,f="trailing"in e?!!e.trailing:f),_.cancel=function(){void 0!==s&&clearTimeout(s),l=0,r=u=i=s=void 0},_.flush=function(){return void 0===s?a:v(wr())},_}function zr(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}function Ar(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==mr.call(t)}(t))return NaN;if(zr(t)){var n="function"==typeof t.valueOf?t.valueOf():t;t=zr(n)?n+"":n}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(hr,"");var e=dr.test(t);return e||pr.test(t)?gr(t.slice(2),e?2:8):fr.test(t)?NaN:+t}var Mr=function(t,n,e){var r=!0,i=!0;if("function"!=typeof t)throw new TypeError(cr);return zr(e)&&(r="leading"in e?!!e.leading:r,i="trailing"in e?!!e.trailing:i),kr(t,n,{leading:r,maxWait:n,trailing:i})},Sr={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}},Back:{In:function(t){var n=1.70158;return t*t*((n+1)*t-n)},Out:function(t){var n=1.70158;return--t*t*((n+1)*t+n)+1},InOut:function(t){var n=2.5949095;return(t*=2)<1?t*t*((n+1)*t-n)*.5:.5*((t-=2)*t*((n+1)*t+n)+2)}},Bounce:{In:function(t){return 1-Sr.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*Sr.Bounce.In(2*t):.5*Sr.Bounce.Out(2*t-1)+.5}}},Cr="undefined"==typeof self&&"undefined"!=typeof process&&process.hrtime?function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now?self.performance.now.bind(self.performance):void 0!==Date.now?Date.now:function(){return(new Date).getTime()},Er=function(){function t(){this._tweens={},this._tweensAddedDuringUpdate={}}return t.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map((function(n){return t._tweens[n]}))},t.prototype.removeAll=function(){this._tweens={}},t.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},t.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},t.prototype.update=function(t,n){void 0===t&&(t=Cr()),void 0===n&&(n=!1);var e=Object.keys(this._tweens);if(0===e.length)return!1;for(;e.length>0;){this._tweensAddedDuringUpdate={};for(var r=0;r1?o(t[e],t[e-1],e-r):o(t[i],t[i+1>e?e:i+1],r-i)},Bezier:function(t,n){for(var e=0,r=t.length-1,i=Math.pow,o=Nr.Utils.Bernstein,a=0;a<=r;a++)e+=i(1-n,r-a)*i(n,a)*t[a]*o(r,a);return e},CatmullRom:function(t,n){var e=t.length-1,r=e*n,i=Math.floor(r),o=Nr.Utils.CatmullRom;return t[0]===t[e]?(n<0&&(i=Math.floor(r=e*(1+n))),o(t[(i-1+e)%e],t[i],t[(i+1)%e],t[(i+2)%e],r-i)):n<0?t[0]-(o(t[0],t[0],t[1],t[1],-r)-t[0]):n>1?t[e]-(o(t[e],t[e],t[e-1],t[e-1],r-e)-t[e]):o(t[i?i-1:0],t[i],t[e1;r--)e*=r;return t[n]=e,e}}(),CatmullRom:function(t,n,e,r,i){var o=.5*(e-t),a=.5*(r-n),s=i*i;return(2*n-2*e+o+a)*(i*s)+(-3*n+3*e-2*o-a)*s+o*i+n}}},Pr=function(){function t(){}return t.nextId=function(){return t._nextId++},t._nextId=0,t}(),Or=new Er,Tr=function(){function t(t,n){void 0===n&&(n=Or),this._object=t,this._group=n,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Sr.Linear.None,this._interpolationFunction=Nr.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._id=Pr.nextId(),this._isChainStopped=!1,this._goToEnd=!1}return t.prototype.getId=function(){return this._id},t.prototype.isPlaying=function(){return this._isPlaying},t.prototype.isPaused=function(){return this._isPaused},t.prototype.to=function(t,n){return this._valuesEnd=Object.create(t),void 0!==n&&(this._duration=n),this},t.prototype.duration=function(t){return this._duration=t,this},t.prototype.start=function(t){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed)for(var n in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=void 0!==t?"string"==typeof t?Cr()+parseFloat(t):t:Cr(),this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this},t.prototype._setupProperties=function(t,n,e,r){for(var i in e){var o=t[i],a=Array.isArray(o),s=a?"array":typeof o,u=!a&&Array.isArray(e[i]);if("undefined"!==s&&"function"!==s){if(u){var l=e[i];if(0===l.length)continue;l=l.map(this._handleRelativeValue.bind(this,o)),e[i]=[o].concat(l)}if("object"!==s&&!a||!o||u)void 0===n[i]&&(n[i]=o),a||(n[i]*=1),r[i]=u?e[i].slice().reverse():n[i]||0;else{for(var c in n[i]=a?[]:{},o)n[i][c]=o[c];r[i]=a?[]:{},this._setupProperties(o,n[i],e[i],r[i])}}}},t.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},t.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},t.prototype.pause=function(t){return void 0===t&&(t=Cr()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this)),this},t.prototype.resume=function(t){return void 0===t&&(t=Cr()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this):this},t.prototype.stopChainedTweens=function(){for(var t=0,n=this._chainedTweens.length;ti)return!1;n&&this.start(t)}if(this._goToEnd=!1,t1?1:r;var o=this._easingFunction(r);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,o),this._onUpdateCallback&&this._onUpdateCallback(this._object,r),1===r){if(this._repeat>0){for(e in isFinite(this._repeat)&&this._repeat--,this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[e]||(this._valuesStartRepeat[e]=this._valuesStartRepeat[e]+parseFloat(this._valuesEnd[e])),this._yoyo&&this._swapEndStartRepeatValues(e),this._valuesStart[e]=this._valuesStartRepeat[e];return this._yoyo&&(this._reversed=!this._reversed),void 0!==this._repeatDelayTime?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var a=0,s=this._chainedTweens.length;a=0?r=setTimeout(u,n-l):(r=null,e||(s=t.apply(o,i),o=i=null))}null==n&&(n=100);var l=function(){o=this,i=arguments,a=Date.now();var l=e&&!r;return r||(r=setTimeout(u,n)),l&&(s=t.apply(o,i),o=i=null),s};return l.clear=function(){r&&(clearTimeout(r),r=null)},l.flush=function(){r&&(s=t.apply(o,i),o=i=null,clearTimeout(r),r=null)},l}Br.debounce=Br;var Hr=Br;function Vr(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null==e)return;var r,i,o=[],a=!0,s=!1;try{for(e=e.call(t);!(a=(r=e.next()).done)&&(o.push(r.value),!n||o.length!==n);a=!0);}catch(t){s=!0,i=t}finally{try{a||null==e.return||e.return()}finally{if(s)throw i}}return o}(t,n)||function(t,n){if(!t)return;if("string"==typeof t)return Gr(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Gr(t,n)}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Gr(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e0&&void 0!==arguments[0]?arguments[0]:{},n=Object.assign({},e instanceof Function?e(t):e,{initialised:!1}),r={};function i(n){return o(n,t),s(),i}var o=function(t,e){c.call(i,t,n,e),n.initialised=!0},s=Hr((function(){n.initialised&&(f.call(i,n,r),r={})}),1);return d.forEach((function(t){i[t.name]=function(t){var e=t.name,o=t.triggerUpdate,a=void 0!==o&&o,u=t.onChange,l=void 0===u?function(t,n){}:u,c=t.defaultVal,h=void 0===c?null:c;return function(t){var o=n[e];if(!arguments.length)return o;var u=void 0===t?h:t;return n[e]=u,l.call(i,u,n,o),!r.hasOwnProperty(e)&&(r[e]=o),a&&s(),i}}(t)})),Object.keys(a).forEach((function(t){i[t]=function(){for(var e,r=arguments.length,o=new Array(r),s=0;s1&&(e-=1),e<1/6?t+6*(n-t)*e:e<.5?n:e<2/3?t+(n-t)*(2/3-e)*6:t}if(t=N(t,360),n=N(n,100),e=N(e,100),0===n)r=i=o=e;else{var s=e<.5?e*(1+n):e+n-e*n,u=2*e-s;r=a(u,s,t+1/3),i=a(u,s,t),o=a(u,s,t-1/3)}return{r:255*r,g:255*i,b:255*o}}(t.h,u,c),h=!0,f="hsl"),t.hasOwnProperty("a")&&(o=t.a));var d,p,g;return o=E(o),{ok:h,format:t.format||f,r:a(255,s(i.r,0)),g:a(255,s(i.g,0)),b:a(255,s(i.b,0)),a:o}}(t);this._originalInput=t,this._r=c.r,this._g=c.g,this._b=c.b,this._a=c.a,this._roundA=o(100*this._a)/100,this._format=u.format||c.format,this._gradientType=u.gradientType,this._r<1&&(this._r=o(this._r)),this._g<1&&(this._g=o(this._g)),this._b<1&&(this._b=o(this._b)),this._ok=c.ok,this._tc_id=i++}function c(t,n,e){t=N(t,255),n=N(n,255),e=N(e,255);var r,i,o=s(t,n,e),u=a(t,n,e),l=(o+u)/2;if(o==u)r=i=0;else{var c=o-u;switch(i=l>.5?c/(2-o-u):c/(o+u),o){case t:r=(n-e)/c+(n>1)+720)%360;--n;)r.h=(r.h+i)%360,o.push(l(r));return o}function M(t,n){n=n||6;for(var e=l(t).toHsv(),r=e.h,i=e.s,o=e.v,a=[],s=1/n;n--;)a.push(l({h:r,s:i,v:o})),o=(o+s)%1;return a}l.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,r,i=this.toRgb();return t=i.r/255,e=i.g/255,r=i.b/255,.2126*(t<=.03928?t/12.92:n.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:n.pow((e+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:n.pow((r+.055)/1.055,2.4))},setAlpha:function(t){return this._a=E(t),this._roundA=o(100*this._a)/100,this},toHsv:function(){var t=h(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=h(this._r,this._g,this._b),n=o(360*t.h),e=o(100*t.s),r=o(100*t.v);return 1==this._a?"hsv("+n+", "+e+"%, "+r+"%)":"hsva("+n+", "+e+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=c(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=c(this._r,this._g,this._b),n=o(360*t.h),e=o(100*t.s),r=o(100*t.l);return 1==this._a?"hsl("+n+", "+e+"%, "+r+"%)":"hsla("+n+", "+e+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return f(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,n,e,r,i){var a=[T(o(t).toString(16)),T(o(n).toString(16)),T(o(e).toString(16)),T(R(r))];if(i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1))return a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0);return a.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:o(this._r),g:o(this._g),b:o(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+o(this._r)+", "+o(this._g)+", "+o(this._b)+")":"rgba("+o(this._r)+", "+o(this._g)+", "+o(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:o(100*N(this._r,255))+"%",g:o(100*N(this._g,255))+"%",b:o(100*N(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+o(100*N(this._r,255))+"%, "+o(100*N(this._g,255))+"%, "+o(100*N(this._b,255))+"%)":"rgba("+o(100*N(this._r,255))+"%, "+o(100*N(this._g,255))+"%, "+o(100*N(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(C[f(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var n="#"+d(this._r,this._g,this._b,this._a),e=n,r=this._gradientType?"GradientType = 1, ":"";if(t){var i=l(t);e="#"+d(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+n+",endColorstr="+e+")"},toString:function(t){var n=!!t;t=t||this._format;var e=!1,r=this._a<1&&this._a>=0;return n||!r||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(e=this.toRgbString()),"prgb"===t&&(e=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(e=this.toHexString()),"hex3"===t&&(e=this.toHexString(!0)),"hex4"===t&&(e=this.toHex8String(!0)),"hex8"===t&&(e=this.toHex8String()),"name"===t&&(e=this.toName()),"hsl"===t&&(e=this.toHslString()),"hsv"===t&&(e=this.toHsvString()),e||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return l(this.toString())},_applyModification:function(t,n){var e=t.apply(null,[this].concat([].slice.call(n)));return this._r=e._r,this._g=e._g,this._b=e._b,this.setAlpha(e._a),this},lighten:function(){return this._applyModification(v,arguments)},brighten:function(){return this._applyModification(_,arguments)},darken:function(){return this._applyModification(m,arguments)},desaturate:function(){return this._applyModification(p,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(y,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(t,n){return t.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(A,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(M,arguments)},splitcomplement:function(){return this._applyCombination(z,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(k,arguments)}},l.fromRatio=function(t,n){if("object"==typeof t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[r]="a"===r?t[r]:j(t[r]));t=e}return l(t,n)},l.equals=function(t,n){return!(!t||!n)&&l(t).toRgbString()==l(n).toRgbString()},l.random=function(){return l.fromRatio({r:u(),g:u(),b:u()})},l.mix=function(t,n,e){e=0===e?0:e||50;var r=l(t).toRgb(),i=l(n).toRgb(),o=e/100;return l({r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a})}, // =4.5;break;case"AAlarge":i=o>=3;break;case"AAAsmall":i=o>=7}return i},l.mostReadable=function(t,n,e){var r,i,o,a,s=null,u=0;i=(e=e||{}).includeFallbackColors,o=e.level,a=e.size;for(var c=0;cu&&(u=r,s=l(n[c]));return l.isReadable(t,s,{level:o,size:a})||!i?s:(e.includeFallbackColors=!1,l.mostReadable(t,["#fff","#000"],e))};var S=l.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},C=l.hexNames=function(t){var n={};for(var e in t)t.hasOwnProperty(e)&&(n[t[e]]=e);return n}(S);function E(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function N(t,e){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var r=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=a(e,s(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),n.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function P(t){return a(1,s(0,t))}function O(t){return parseInt(t,16)}function T(t){return 1==t.length?"0"+t:""+t}function j(t){return t<=1&&(t=100*t+"%"),t}function R(t){return n.round(255*parseFloat(t)).toString(16)}function D(t){return O(t)/255}var I,U,F,L=(U="[\\s|\\(]+("+(I="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+I+")[,|\\s]+("+I+")\\s*\\)?",F="[\\s|\\(]+("+I+")[,|\\s]+("+I+")[,|\\s]+("+I+")[,|\\s]+("+I+")\\s*\\)?",{CSS_UNIT:new RegExp(I),rgb:new RegExp("rgb"+U),rgba:new RegExp("rgba"+F),hsl:new RegExp("hsl"+U),hsla:new RegExp("hsla"+F),hsv:new RegExp("hsv"+U),hsva:new RegExp("hsva"+F),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function q(t){return!!L.CSS_UNIT.exec(t)}t.exports?t.exports=l:window.tinycolor=l}(Math)}(Wr);var Zr=Wr.exports;function Qr(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function Kr(t,n){for(var e=0;et.length)&&(n=t.length);for(var e=0,r=new Array(n);e0&&void 0!==arguments[0]?arguments[0]:6;Qr(this,t),this.csBits=n,this.registry=["__reserved for background__"]}var n,e,r;return n=t,e=[{key:"register",value:function(t){if(this.registry.length>=Math.pow(2,24-this.csBits))return null;var n,e=this.registry.length,r=ei(e,this.csBits),i=(n=e+(r<<24-this.csBits),"#".concat(Math.min(n,Math.pow(2,24)).toString(16).padStart(6,"0")));return this.registry.push(t),i}},{key:"lookup",value:function(t){var n,e,r,i,o="string"==typeof t?(n=Zr(t).toRgb(),e=n.r,r=n.g,i=n.b,ni(e,r,i)):ni.apply(void 0,Jr(t));if(!o)return null;var a=o&Math.pow(2,24-this.csBits)-1,s=o>>24-this.csBits&Math.pow(2,this.csBits)-1;return ei(a,this.csBits)!==s||a>=this.registry.length?null:this.registry[a]}}],e&&Kr(n.prototype,e),r&&Kr(n,r),t}();function ii(t,n,e){var r,i=1;function o(){var o,a,s=r.length,u=0,l=0,c=0;for(o=0;o=(i=(h+f)/2))?h=i:f=i,r=l,!(l=l[s=+a]))return r[s]=c,t;if(n===(o=+t._x.call(null,l.data)))return c.next=l,r?r[s]=c:t._root=c,t;do{r=r?r[s]=new Array(2):t._root=new Array(2),(a=n>=(i=(h+f)/2))?h=i:f=i}while((s=+a)==(u=+(o>=i)));return r[u]=l,r[s]=c,t}function ai(t,n,e){this.node=t,this.x0=n,this.x1=e}function si(t){return t[0]}function ui(t,n){var e=new li(null==n?si:n,NaN,NaN);return null==t?e:e.addAll(t)}function li(t,n,e){this._x=t,this._x0=n,this._x1=e,this._root=void 0}function ci(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}var hi=ui.prototype=li.prototype;function fi(t,n,e,r){if(isNaN(n)||isNaN(e))return t;var i,o,a,s,u,l,c,h,f,d=t._root,p={data:r},g=t._x0,y=t._y0,v=t._x1,_=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((l=n>=(o=(g+v)/2))?g=o:v=o,(c=e>=(a=(y+_)/2))?y=a:_=a,i=d,!(d=d[h=c<<1|l]))return i[h]=p,t;if(s=+t._x.call(null,d.data),u=+t._y.call(null,d.data),n===s&&e===u)return p.next=d,i?i[h]=p:t._root=p,t;do{i=i?i[h]=new Array(4):t._root=new Array(4),(l=n>=(o=(g+v)/2))?g=o:v=o,(c=e>=(a=(y+_)/2))?y=a:_=a}while((h=c<<1|l)==(f=(u>=a)<<1|s>=o));return i[f]=d,i[h]=p,t}function di(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i}function pi(t){return t[0]}function gi(t){return t[1]}function yi(t,n,e){var r=new vi(null==n?pi:n,null==e?gi:e,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function vi(t,n,e,r,i,o){this._x=t,this._y=n,this._x0=e,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function _i(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}hi.copy=function(){var t,n,e=new li(this._x,this._x0,this._x1),r=this._root;if(!r)return e;if(!r.length)return e._root=ci(r),e;for(t=[{source:r,target:e._root=new Array(2)}];r=t.pop();)for(var i=0;i<2;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(2)}):r.target[i]=ci(n));return e},hi.add=function(t){var n=+this._x.call(null,t);return oi(this.cover(n),n,t)},hi.addAll=function(t){var n,e,r=t.length,i=new Array(r),o=1/0,a=-1/0;for(n=0;na&&(a=e));if(o>a)return this;for(this.cover(o).cover(a),n=0;nt||t>=e;)switch(i=+(tu||(i=o.x1)=h))&&(o=l[l.length-1],l[l.length-1]=l[l.length-1-a],l[l.length-1-a]=o)}else{var f=Math.abs(t-+this._x.call(null,c.data));f=(a=(h+f)/2))?h=a:f=a,n=c,!(c=c[u=+s]))return this;if(!c.length)break;n[u+1&1]&&(e=n,l=u)}for(;c.data!==t;)if(r=c,!(c=c.next))return this;return(i=c.next)&&delete c.next,r?(i?r.next=i:delete r.next,this):n?(i?n[u]=i:delete n[u],(c=n[0]||n[1])&&c===(n[1]||n[0])&&!c.length&&(e?e[l]=c:this._root=c),this):(this._root=i,this)},hi.removeAll=function(t){for(var n=0,e=t.length;n=(a=(m+w)/2))?m=a:w=a,(d=e>=(s=(x+k)/2))?x=s:k=s,(p=r>=(u=(b+z)/2))?b=u:z=u,o=v,!(v=v[g=p<<2|d<<1|f]))return o[g]=_,t;if(l=+t._x.call(null,v.data),c=+t._y.call(null,v.data),h=+t._z.call(null,v.data),n===l&&e===c&&r===h)return _.next=v,o?o[g]=_:t._root=_,t;do{o=o?o[g]=new Array(8):t._root=new Array(8),(f=n>=(a=(m+w)/2))?m=a:w=a,(d=e>=(s=(x+k)/2))?x=s:k=s,(p=r>=(u=(b+z)/2))?b=u:z=u}while((g=p<<2|d<<1|f)==(y=(h>=u)<<2|(c>=s)<<1|l>=a));return o[y]=v,o[g]=_,t}function bi(t,n,e,r,i,o,a){this.node=t,this.x0=n,this.y0=e,this.z0=r,this.x1=i,this.y1=o,this.z1=a}function wi(t){return t[0]}function ki(t){return t[1]}function zi(t){return t[2]}function Ai(t,n,e,r){var i=new Mi(null==n?wi:n,null==e?ki:e,null==r?zi:r,NaN,NaN,NaN,NaN,NaN,NaN);return null==t?i:i.addAll(t)}function Mi(t,n,e,r,i,o,a,s,u){this._x=t,this._y=n,this._z=e,this._x0=r,this._y0=i,this._z0=o,this._x1=a,this._y1=s,this._z1=u,this._root=void 0}function Si(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}mi.copy=function(){var t,n,e=new vi(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return e;if(!r.length)return e._root=_i(r),e;for(t=[{source:r,target:e._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(4)}):r.target[i]=_i(n));return e},mi.add=function(t){const n=+this._x.call(null,t),e=+this._y.call(null,t);return fi(this.cover(n,e),n,e,t)},mi.addAll=function(t){var n,e,r,i,o=t.length,a=new Array(o),s=new Array(o),u=1/0,l=1/0,c=-1/0,h=-1/0;for(e=0;ec&&(c=r),ih&&(h=i));if(u>c||l>h)return this;for(this.cover(u,l).cover(c,h),e=0;et||t>=i||r>n||n>=o;)switch(s=(nf||(o=u.y0)>d||(a=u.x1)=v)<<1|t>=y)&&(u=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=u)}else{var _=t-+this._x.call(null,g.data),m=n-+this._y.call(null,g.data),x=_*_+m*m;if(x=(s=(p+y)/2))?p=s:y=s,(c=a>=(u=(g+v)/2))?g=u:v=u,n=d,!(d=d[h=c<<1|l]))return this;if(!d.length)break;(n[h+1&3]||n[h+2&3]||n[h+3&3])&&(e=n,f=h)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):n?(i?n[h]=i:delete n[h],(d=n[0]||n[1]||n[2]||n[3])&&d===(n[3]||n[2]||n[1]||n[0])&&!d.length&&(e?e[f]=d:this._root=d),this):(this._root=i,this)},mi.removeAll=function(t){for(var n=0,e=t.length;n1&&(v=f.y+f.vy-c.y-c.vy||Ni(s)),i>2&&(_=f.z+f.vz-c.z-c.vz||Ni(s)),y*=d=((d=Math.sqrt(y*y+v*v+_*_))-e[g])/d*r*n[g],v*=d,_*=d,f.vx-=y*(p=a[g]),i>1&&(f.vy-=v*p),i>2&&(f.vz-=_*p),c.vx+=y*(p=1-p),i>1&&(c.vy+=v*p),i>2&&(c.vz+=_*p)}function d(){if(r){var i,s,l=r.length,c=t.length,h=new Map(r.map(((t,n)=>[u(t,n,r),t])));for(i=0,o=new Array(l);i"function"==typeof t))||Math.random,i=n.find((t=>[1,2,3].includes(t)))||2,d()},f.links=function(n){return arguments.length?(t=n,d(),f):t},f.id=function(t){return arguments.length?(u=t,f):u},f.iterations=function(t){return arguments.length?(h=+t,f):h},f.strength=function(t){return arguments.length?(l="function"==typeof t?t:Ei(+t),p(),f):l},f.distance=function(t){return arguments.length?(c="function"==typeof t?t:Ei(+t),g(),f):c},f}Ci.copy=function(){var t,n,e=new Mi(this._x,this._y,this._z,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1),r=this._root;if(!r)return e;if(!r.length)return e._root=Si(r),e;for(t=[{source:r,target:e._root=new Array(8)}];r=t.pop();)for(var i=0;i<8;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(8)}):r.target[i]=Si(n));return e},Ci.add=function(t){var n=+this._x.call(null,t),e=+this._y.call(null,t),r=+this._z.call(null,t);return xi(this.cover(n,e,r),n,e,r,t)},Ci.addAll=function(t){var n,e,r,i,o,a=t.length,s=new Array(a),u=new Array(a),l=new Array(a),c=1/0,h=1/0,f=1/0,d=-1/0,p=-1/0,g=-1/0;for(e=0;ed&&(d=r),ip&&(p=i),og&&(g=o));if(c>d||h>p||f>g)return this;for(this.cover(c,h,f).cover(d,p,g),e=0;et||t>=a||i>n||n>=s||o>e||e>=u;)switch(c=(ey||(a=h.y0)>v||(s=h.z0)>_||(u=h.x1)=k)<<2|(n>=w)<<1|t>=b)&&(h=m[m.length-1],m[m.length-1]=m[m.length-1-f],m[m.length-1-f]=h)}else{var z=t-+this._x.call(null,x.data),A=n-+this._y.call(null,x.data),M=e-+this._z.call(null,x.data),S=z*z+A*A+M*M;if(S=(u=(v+x)/2))?v=u:x=u,(f=a>=(l=(_+b)/2))?_=l:b=l,(d=s>=(c=(m+w)/2))?m=c:w=c,n=y,!(y=y[p=d<<2|f<<1|h]))return this;if(!y.length)break;(n[p+1&7]||n[p+2&7]||n[p+3&7]||n[p+4&7]||n[p+5&7]||n[p+6&7]||n[p+7&7])&&(e=n,g=p)}for(;y.data!==t;)if(r=y,!(y=y.next))return this;return(i=y.next)&&delete y.next,r?(i?r.next=i:delete r.next,this):n?(i?n[p]=i:delete n[p],(y=n[0]||n[1]||n[2]||n[3]||n[4]||n[5]||n[6]||n[7])&&y===(n[7]||n[6]||n[5]||n[4]||n[3]||n[2]||n[1]||n[0])&&!y.length&&(e?e[g]=y:this._root=y),this):(this._root=i,this)},Ci.removeAll=function(t){for(var n=0,e=t.length;n(t=(1664525*t+1013904223)%ji)/ji}();function d(){p(),h.call("tick",e),i1&&(null==c.fy?c.y+=c.vy*=u:(c.y=c.fy,c.vy=0)),r>2&&(null==c.fz?c.z+=c.vz*=u:(c.z=c.fz,c.vz=0));return e}function g(){for(var n,e=0,i=t.length;e1&&isNaN(n.y)||r>2&&isNaN(n.z)){var o=10*(r>2?Math.cbrt(.5+e):r>1?Math.sqrt(.5+e):e),a=e*Ui,s=e*Fi;1===r?n.x=o:2===r?(n.x=o*Math.cos(a),n.y=o*Math.sin(a)):(n.x=o*Math.sin(a)*Math.cos(s),n.y=o*Math.cos(a),n.z=o*Math.sin(a)*Math.sin(s))}(isNaN(n.vx)||r>1&&isNaN(n.vy)||r>2&&isNaN(n.vz))&&(n.vx=0,r>1&&(n.vy=0),r>2&&(n.vz=0))}}function y(n){return n.initialize&&n.initialize(t,f,r),n}return null==t&&(t=[]),g(),e={tick:p,restart:function(){return c.restart(d),e},stop:function(){return c.stop(),e},numDimensions:function(t){return arguments.length?(r=Math.min(3,Math.max(1,Math.round(t))),l.forEach(y),e):r},nodes:function(n){return arguments.length?(t=n,g(),l.forEach(y),e):t},alpha:function(t){return arguments.length?(i=+t,e):i},alphaMin:function(t){return arguments.length?(o=+t,e):o},alphaDecay:function(t){return arguments.length?(a=+t,e):+a},alphaTarget:function(t){return arguments.length?(s=+t,e):s},velocityDecay:function(t){return arguments.length?(u=1-t,e):1-u},randomSource:function(t){return arguments.length?(f=t,l.forEach(y),e):f},force:function(t,n){return arguments.length>1?(null==n?l.delete(t):l.set(t,y(n)),e):l.get(t)},find:function(){var n,e,i,o,a,s,u=Array.prototype.slice.call(arguments),l=u.shift()||0,c=(r>1?u.shift():null)||0,h=(r>2?u.shift():null)||0,f=u.shift()||1/0,d=0,p=t.length;for(f*=f,d=0;d1?(h.on(t,n),e):h.on(t)}}}function qi(){var t,n,e,r,i,o,a=Ei(-30),s=1,u=1/0,l=.81;function c(r){var o,a=t.length,s=(1===n?ui(t,Ri):2===n?yi(t,Ri,Di):3===n?Ai(t,Ri,Di,Ii):null).visitAfter(f);for(i=r,o=0;o1&&(t.y=a/c),n>2&&(t.z=s/c)}else{(e=t).x=e.data.x,n>1&&(e.y=e.data.y),n>2&&(e.z=e.data.z);do{l+=o[e.data.index]}while(e=e.next)}t.value=l}function d(t,a,c,h,f){if(!t.value)return!0;var d=[c,h,f][n-1],p=t.x-e.x,g=n>1?t.y-e.y:0,y=n>2?t.z-e.z:0,v=d-a,_=p*p+g*g+y*y;if(v*v/l<_)return _1&&0===g&&(_+=(g=Ni(r))*g),n>2&&0===y&&(_+=(y=Ni(r))*y),_1&&(e.vy+=g*t.value*i/_),n>2&&(e.vz+=y*t.value*i/_)),!0;if(!(t.length||_>=u)){(t.data!==e||t.next)&&(0===p&&(_+=(p=Ni(r))*p),n>1&&0===g&&(_+=(g=Ni(r))*g),n>2&&0===y&&(_+=(y=Ni(r))*y),_1&&(e.vy+=g*v),n>2&&(e.vz+=y*v))}while(t=t.next)}}return c.initialize=function(e,...i){t=e,r=i.find((t=>"function"==typeof t))||Math.random,n=i.find((t=>[1,2,3].includes(t)))||2,h()},c.strength=function(t){return arguments.length?(a="function"==typeof t?t:Ei(+t),h(),c):a},c.distanceMin=function(t){return arguments.length?(s=t*t,c):Math.sqrt(s)},c.distanceMax=function(t){return arguments.length?(u=t*t,c):Math.sqrt(u)},c.theta=function(t){return arguments.length?(l=t*t,c):Math.sqrt(l)},c}const{abs:Bi,cos:Hi,sin:Vi,acos:Gi,atan2:Xi,sqrt:Yi,pow:$i}=Math;function Wi(t){return t<0?-$i(-t,1/3):$i(t,1/3)}const Zi=Math.PI,Qi=2*Zi,Ki=Zi/2,Ji=Number.MAX_SAFE_INTEGER||9007199254740991,to=Number.MIN_SAFE_INTEGER||-9007199254740991,no={x:0,y:0,z:0},eo={Tvalues:[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213],Cvalues:[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872],arcfn:function(t,n){const e=n(t);let r=e.x*e.x+e.y*e.y;return void 0!==e.z&&(r+=e.z*e.z),Yi(r)},compute:function(t,n,e){if(0===t)return n[0].t=0,n[0];const r=n.length-1;if(1===t)return n[r].t=1,n[r];const i=1-t;let o=n;if(0===r)return n[0].t=t,n[0];if(1===r){const n={x:i*o[0].x+t*o[1].x,y:i*o[0].y+t*o[1].y,t:t};return e&&(n.z=i*o[0].z+t*o[1].z),n}if(r<4){let n,a,s,u=i*i,l=t*t,c=0;2===r?(o=[o[0],o[1],o[2],no],n=u,a=i*t*2,s=l):3===r&&(n=u*i,a=u*t*3,s=i*l*3,c=t*l);const h={x:n*o[0].x+a*o[1].x+s*o[2].x+c*o[3].x,y:n*o[0].y+a*o[1].y+s*o[2].y+c*o[3].y,t:t};return e&&(h.z=n*o[0].z+a*o[1].z+s*o[2].z+c*o[3].z),h}const a=JSON.parse(JSON.stringify(n));for(;a.length>1;){for(let n=0;n1;i--,o--){const t=[];for(let e,i=0;io.x.min&&(n=o.x.min),e>o.y.min&&(e=o.y.min),r0&&(a.c1=n,a.c2=r,a.s1=t,a.s2=e,o.push(a))}))})),o},makeshape:function(t,n,e){const r=n.points.length,i=t.points.length,o=eo.makeline(n.points[r-1],t.points[0]),a=eo.makeline(t.points[i-1],n.points[0]),s={startcap:o,forward:t,back:n,endcap:a,bbox:eo.findbbox([o,t,n,a]),intersections:function(t){return eo.shapeintersections(s,s.bbox,t,t.bbox,e)}};return s},getminmax:function(t,n,e){if(!e)return{min:0,max:0};let r,i,o=Ji,a=to;-1===e.indexOf(0)&&(e=[0].concat(e)),-1===e.indexOf(1)&&e.push(1);for(let s=0,u=e.length;sa&&(a=i[n]);return{min:o,mid:(o+a)/2,max:a,size:a-o}},align:function(t,n){const e=n.p1.x,r=n.p1.y,i=-Xi(n.p2.y-r,n.p2.x-e);return t.map((function(t){return{x:(t.x-e)*Hi(i)-(t.y-r)*Vi(i),y:(t.x-e)*Vi(i)+(t.y-r)*Hi(i)}}))},roots:function(t,n){n=n||{p1:{x:0,y:0},p2:{x:1,y:0}};const e=t.length-1,r=eo.align(t,n),i=function(t){return 0<=t&&t<=1};if(2===e){const t=r[0].y,n=r[1].y,e=r[2].y,o=t-2*n+e;if(0!==o){const r=-Yi(n*n-t*e),a=-t+n;return[-(r+a)/o,-(-r+a)/o].filter(i)}return n!==e&&0===o?[(2*n-e)/(2*n-2*e)].filter(i):[]}const o=r[0].y,a=r[1].y,s=r[2].y;let u=3*a-o-3*s+r[3].y,l=3*o-6*a+3*s,c=-3*o+3*a,h=o;if(eo.approximately(u,0)){if(eo.approximately(l,0))return eo.approximately(c,0)?[]:[-h/c].filter(i);const t=Yi(c*c-4*l*h),n=2*l;return[(t-c)/n,(-c-t)/n].filter(i)}l/=u,c/=u,h/=u;const f=(3*c-l*l)/3,d=f/3,p=(2*l*l*l-9*l*c+27*h)/27,g=p/2,y=g*g+d*d*d;let v,_,m,x,b;if(y<0){const t=-f/3,n=Yi(t*t*t),e=-p/(2*n),r=Gi(e<-1?-1:e>1?1:e),o=2*Wi(n);return m=o*Hi(r/3)-l/3,x=o*Hi((r+Qi)/3)-l/3,b=o*Hi((r+2*Qi)/3)-l/3,[m,x,b].filter(i)}if(0===y)return v=g<0?Wi(-g):-Wi(g),m=2*v-l/3,x=-v-l/3,[m,x].filter(i);{const t=Yi(y);return v=Wi(-g+t),_=Wi(g+t),[v-_-l/3].filter(i)}},droots:function(t){if(3===t.length){const n=t[0],e=t[1],r=t[2],i=n-2*e+r;if(0!==i){const t=-Yi(e*e-n*r),o=-n+e;return[-(t+o)/i,-(-t+o)/i]}return e!==r&&0===i?[(2*e-r)/(2*(e-r))]:[]}if(2===t.length){const n=t[0],e=t[1];return n!==e?[n/(n-e)]:[]}return[]},curvature:function(t,n,e,r,i){let o,a,s,u,l=0,c=0;const h=eo.compute(t,n),f=eo.compute(t,e),d=h.x*h.x+h.y*h.y;if(r?(o=Yi($i(h.y*f.z-f.y*h.z,2)+$i(h.z*f.x-f.z*h.x,2)+$i(h.x*f.y-f.x*h.y,2)),a=$i(d+h.z*h.z,1.5)):(o=h.x*f.y-h.y*f.x,a=$i(d,1.5)),0===o||0===a)return{k:0,r:0};if(l=o/a,c=a/o,!i){const i=eo.curvature(t-.001,n,e,r,!0).k,o=eo.curvature(t+.001,n,e,r,!0).k;u=(o-l+(l-i))/2,s=(Bi(o-l)+Bi(l-i))/2}return{k:l,r:c,dk:u,adk:s}},inflections:function(t){if(t.length<4)return[];const n=eo.align(t,{p1:t[0],p2:t.slice(-1)[0]}),e=n[2].x*n[1].y,r=n[3].x*n[1].y,i=n[1].x*n[2].y,o=18*(-3*e+2*r+3*i-n[3].x*n[2].y),a=18*(3*e-r-3*i),s=18*(i-e);if(eo.approximately(o,0)){if(!eo.approximately(a,0)){let t=-s/a;if(0<=t&&t<=1)return[t]}return[]}const u=a*a-4*o*s,l=Math.sqrt(u),c=2*o;return eo.approximately(c,0)?[]:[(l-a)/c,-(a+l)/c].filter((function(t){return 0<=t&&t<=1}))},bboxoverlap:function(t,n){const e=["x","y"],r=e.length;for(let i,o,a,s,u=0;u=s)return!1;return!0},expandbox:function(t,n){n.x.mint.x.max&&(t.x.max=n.x.max),n.y.max>t.y.max&&(t.y.max=n.y.max),n.z&&n.z.max>t.z.max&&(t.z.max=n.z.max),t.x.mid=(t.x.min+t.x.max)/2,t.y.mid=(t.y.min+t.y.max)/2,t.z&&(t.z.mid=(t.z.min+t.z.max)/2),t.x.size=t.x.max-t.x.min,t.y.size=t.y.max-t.y.min,t.z&&(t.z.size=t.z.max-t.z.min)},pairiteration:function(t,n,e){const r=t.bbox(),i=n.bbox(),o=1e5,a=e||.5;if(r.x.size+r.y.sizek||k>z)&&(w+=Qi),w>z&&(b=z,z=w,w=b)):z4){if(1!==arguments.length)throw new Error("Only new Bezier(point[]) is accepted for 4th and higher order curves");r=!0}}else if(6!==i&&8!==i&&9!==i&&12!==i&&1!==arguments.length)throw new Error("Only new Bezier(point[]) is accepted for 4th and higher order curves");const o=this._3d=!r&&(9===i||12===i)||t&&t[0]&&void 0!==t[0].z,a=this.points=[];for(let t=0,e=o?3:2;tio(t.y)>1e-4)),this._lut=[],this._t1=0,this._t2=1,this.update()}static quadraticFromPoints(t,n,e,r){if(void 0===r&&(r=.5),0===r)return new fo(n,n,e);if(1===r)return new fo(t,n,n);const i=fo.getABC(2,t,n,e,r);return new fo(t,i.A,e)}static cubicFromPoints(t,n,e,r,i){void 0===r&&(r=.5);const o=fo.getABC(3,t,n,e,r);void 0===i&&(i=eo.dist(n,o.C));const a=i*(1-r)/r,s=eo.dist(t,e),u=(e.x-t.x)/s,l=(e.y-t.y)/s,c=i*u,h=i*l,f=a*u,d=a*l,p=n.x-c,g=n.y-h,y=n.x+f,v=n.y+d,_=o.A,m=_.x+(p-_.x)/(1-r),x=_.y+(g-_.y)/(1-r),b=_.x+(y-_.x)/r,w=_.y+(v-_.y)/r,k={x:t.x+(m-t.x)/r,y:t.y+(x-t.y)/r},z={x:e.x+(b-e.x)/(1-r),y:e.y+(w-e.y)/(1-r)};return new fo(t,k,z,e)}static getUtils(){return eo}getUtils(){return fo.getUtils()}static get PolyBezier(){return ro}valueOf(){return this.toString()}toString(){return eo.pointsToString(this.points)}toSVG(){if(this._3d)return!1;const t=this.points,n=["M",t[0].x,t[0].y,2===this.order?"Q":"C"];for(let e=1,r=t.length;e0}length(){return eo.length(this.derivative.bind(this))}static getABC(t=2,n,e,r,i=.5){const o=eo.projectionratio(i,t),a=1-o,s={x:o*n.x+a*r.x,y:o*n.y+a*r.y},u=eo.abcratio(i,t);return{A:{x:e.x+(e.x-s.x)/u,y:e.y+(e.y-s.y)/u},B:e,C:s,S:n,E:r}}getABC(t,n){n=n||this.get(t);let e=this.points[0],r=this.points[this.order];return fo.getABC(this.order,e,n,r,t)}getLUT(t){if(this.verify(),t=t||100,this._lut.length===t)return this._lut;this._lut=[],t--;for(let n,e,r=0;r1?1:f,u=this.compute(f),u.t=f,u.d=c,u}get(t){return this.compute(t)}point(t){return this.points[t]}compute(t){return this.ratios?eo.computeWithRatios(t,this.points,this.ratios,this._3d):eo.compute(t,this.points,this._3d,this.ratios)}raise(){const t=this.points,n=[t[0]],e=t.length;for(let r,i,o=1;o1;){e=[];for(let o,a=0,s=n.length-1;a=0&&t<=1})),n=n.concat(t[e].sort(eo.numberSort))}.bind(this)),t.values=n.sort(eo.numberSort).filter((function(t,e){return n.indexOf(t)===e})),t}bbox(){const t=this.extrema(),n={};return this.dims.forEach(function(e){n[e]=eo.getminmax(this,e,t[e])}.bind(this)),n}overlaps(t){const n=this.bbox(),e=t.bbox();return eo.bboxoverlap(n,e)}offset(t,n){if(void 0!==n){const e=this.get(t),r=this.normal(t),i={c:e,n:r,x:e.x+r.x*n,y:e.y+r.y*n};return this._3d&&(i.z=e.z+r.z*n),i}if(this._linear){const n=this.normal(0),e=this.points.map((function(e){const r={x:e.x+t*n.x,y:e.y+t*n.y};return e.z&&n.z&&(r.z=e.z+t*n.z),r}));return[new fo(e)]}return this.reduce().map((function(n){return n._linear?n.offset(t)[0]:n.scale(t)}))}simple(){if(3===this.order){const t=eo.angle(this.points[0],this.points[3],this.points[1]),n=eo.angle(this.points[0],this.points[3],this.points[2]);if(t>0&&n<0||t<0&&n>0)return!1}const t=this.normal(0),n=this.normal(1);let e=t.x*n.x+t.y*n.y;return this._3d&&(e+=t.z*n.z),io(lo(e)){if(2===n&&t)return;const e=u[t*n],r=this.derivative(t),i={x:e.x+r.x,y:e.y+r.y};u[t+1]=eo.lli4(e,i,l,s[t+1])})),new fo(u))}outline(t,n,e,r){n=void 0===n?t:n;const i=this.reduce(),o=i.length,a=[];let s,u=[],l=0,c=this.length();const h=void 0!==e&&void 0!==r;function f(t,n,e,r,i){return function(o){const a=r/e,s=(r+i)/e,u=n-t;return eo.map(o,0,1,t+a*u,t+s*u)}}i.forEach((function(i){const o=i.length();h?(a.push(i.scale(f(t,e,c,l,o))),u.push(i.scale(f(-n,-r,c,l,o)))):(a.push(i.scale(t)),u.push(i.scale(-n))),l+=o})),u=u.map((function(t){return s=t.points,s[3]?t.points=[s[3],s[2],s[1],s[0]]:t.points=[s[2],s[1],s[0]],t})).reverse();const d=a[0].points[0],p=a[o-1].points[a[o-1].points.length-1],g=u[o-1].points[u[o-1].points.length-1],y=u[0].points[0],v=eo.makeline(g,d),_=eo.makeline(p,y),m=[v].concat(a).concat([_]).concat(u);return m.length,new ro(m)}outlineshapes(t,n,e){n=n||t;const r=this.outline(t,n).curves,i=[];for(let t=1,n=r.length;t1,o.endcap.virtual=t{var o=this.get(t);return eo.between(o.x,n,r)&&eo.between(o.y,e,i)}))}selfintersects(t){const n=this.reduce(),e=n.length-2,r=[];for(let i,o,a,s=0;s0&&(i=i.concat(n))})),i}arcs(t){return t=t||.5,this._iterate(t,[])}_error(t,n,e,r){const i=(r-e)/4,o=this.get(e+i),a=this.get(r-i),s=eo.dist(t,n),u=eo.dist(t,o),l=eo.dist(t,a);return io(u-s)+io(l-s)}_iterate(t,n){let e,r=0,i=1;do{e=0,i=1;let o,a,s,u,l,c=this.get(r),h=!1,f=!1,d=i,p=1;do{if(f=h,u=s,d=(r+i)/2,o=this.get(d),a=this.get(i),s=eo.getccenter(c,o,a),s.interval={start:r,end:i},h=this._error(s,c,r,i)<=t,l=f&&!h,l||(p=i),h){if(i>=1){if(s.interval.end=p=1,u=s,i>1){let t={x:s.x+s.r*so(s.e),y:s.y+s.r*uo(s.e)};s.e+=eo.angle({x:s.x,y:s.y},t,this.get(1))}break}i+=(i-r)/2}else i=d}while(!l&&e++<100);if(e>=100)break;u=u||s,n.push(u),r=p}while(i<1);return n}}function po(t,n){if(null==t)return{};var e,r,i=function(t,n){if(null==t)return{};var e,r,i={},o=Object.keys(t);for(r=0;r=0||(i[e]=t[e]);return i}(t,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,e)&&(i[e]=t[e])}return i}function go(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null==e)return;var r,i,o=[],a=!0,s=!1;try{for(e=e.call(t);!(a=(r=e.next()).done)&&(o.push(r.value),!n||o.length!==n);a=!0);}catch(t){s=!0,i=t}finally{try{a||null==e.return||e.return()}finally{if(s)throw i}}return o}(t,n)||vo(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yo(t){return function(t){if(Array.isArray(t))return _o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||vo(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vo(t,n){if(t){if("string"==typeof t)return _o(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?_o(t,n):void 0}}function _o(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);et.cooldownTicks||new Date-t.startTickTime>t.cooldownTime||t.d3AlphaMin>0&&t.forceLayout.alpha()0){var a=Math.atan2(r.y-e.y,r.x-e.x),s=i*n,u={x:(e.x+r.x)/2+s*Math.cos(a-Math.PI/2),y:(e.y+r.y)/2+s*Math.sin(a-Math.PI/2)};t.__controlPoints=[u.x,u.y]}else{var l=70*n;t.__controlPoints=[r.x,r.y-l,r.x+l,r.y]}}));var f=[],d=[],p=h;if(t.linkCanvasObject){var g=[],y=[];h.forEach((function(t){return({before:f,after:d,replace:g}[a(t)]||y).push(t)})),p=[].concat(l(f),d,y),f=f.concat(g)}s.save(),f.forEach((function(n){return t.linkCanvasObject(n,s,t.globalScale)})),s.restore();var v=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],e=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=(n instanceof Array?n.length?n:[void 0]:[n]).map((function(t){return{keyAccessor:t,isProp:!(t instanceof Function)}})),o=t.reduce((function(t,n){var r=t,o=n;return i.forEach((function(t,n){var a,s=t.keyAccessor;if(t.isProp){var u=o,l=u[s],c=po(u,[s].map(mo));a=l,o=c}else a=s(o,n);n+11&&void 0!==arguments[1]?arguments[1]:1;r===i.length?Object.keys(n).forEach((function(t){return n[t]=e(n[t])})):Object.values(n).forEach((function(n){return t(n,r+1)}))}(o);var a=o;return r&&(a=[],function t(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e.length===i.length?a.push({keys:e,vals:n}):Object.entries(n).forEach((function(n){var r=go(n,2),i=r[0],o=r[1];return t(o,[].concat(yo(e),[i]))}))}(o),n instanceof Array&&0===n.length&&1===a.length&&(a[0].keys=[])),a}(p,[e,r,i]);s.save(),Object.entries(v).forEach((function(n){var e=u(n,2),r=e[0],o=e[1],a=r&&"undefined"!==r?r:"rgba(0,0,0,0.15)";Object.entries(o).forEach((function(n){var e=u(n,2),r=e[0],o=e[1],h=(r||1)/t.globalScale+c;Object.entries(o).forEach((function(t){var n=u(t,2);n[0];var e=n[1],r=i(e[0]);s.beginPath(),e.forEach((function(t){var n=t.source,e=t.target;if(n&&e&&n.hasOwnProperty("x")&&e.hasOwnProperty("x")){s.moveTo(n.x,n.y);var r=t.__controlPoints;r?s[2===r.length?"quadraticCurveTo":"bezierCurveTo"].apply(s,l(r).concat([e.x,e.y])):s.lineTo(e.x,e.y)}})),s.strokeStyle=a,s.lineWidth=h,s.setLineDash(r||[]),s.stroke()}))}))})),s.restore(),s.save(),d.forEach((function(n){return t.linkCanvasObject(n,s,t.globalScale)})),s.restore()}(),!t.isShadow&&(n=$r(t.linkDirectionalArrowLength),e=$r(t.linkDirectionalArrowRelPos),r=$r(t.linkVisibility),i=$r(t.linkDirectionalArrowColor||t.linkColor),o=$r(t.nodeVal),(a=t.ctx).save(),t.graphData.links.filter(r).forEach((function(r){var u=n(r);if(u&&!(u<0)){var c=r.source,h=r.target;if(c&&h&&c.hasOwnProperty("x")&&h.hasOwnProperty("x")){var f=Math.sqrt(Math.max(0,o(c)||1))*t.nodeRelSize,d=Math.sqrt(Math.max(0,o(h)||1))*t.nodeRelSize,p=Math.min(1,Math.max(0,e(r))),g=i(r)||"rgba(0,0,0,0.28)",y=u/1.6/2,v=r.__controlPoints&&s(fo,[c.x,c.y].concat(l(r.__controlPoints),[h.x,h.y])),_=v?function(t){return v.get(t)}:function(t){return{x:c.x+(h.x-c.x)*t||0,y:c.y+(h.y-c.y)*t||0}},m=v?v.length():Math.sqrt(Math.pow(h.x-c.x,2)+Math.pow(h.y-c.y,2)),x=f+u+(m-f-d-u)*p,b=_(x/m),w=_((x-u)/m),k=_((x-.8*u)/m),z=Math.atan2(b.y-w.y,b.x-w.x)-Math.PI/2;a.beginPath(),a.moveTo(b.x,b.y),a.lineTo(w.x+y*Math.cos(z),w.y+y*Math.sin(z)),a.lineTo(k.x,k.y),a.lineTo(w.x-y*Math.cos(z),w.y-y*Math.sin(z)),a.fillStyle=g,a.fill()}}})),a.restore()),!t.isShadow&&function(){var n=$r(t.linkDirectionalParticles),e=$r(t.linkDirectionalParticleSpeed),r=$r(t.linkDirectionalParticleWidth),i=$r(t.linkVisibility),o=$r(t.linkDirectionalParticleColor||t.linkColor),a=t.ctx;a.save(),t.graphData.links.filter(i).forEach((function(i){var u=n(i);if(i.hasOwnProperty("__photons")&&i.__photons.length){var c=i.source,h=i.target;if(c&&h&&c.hasOwnProperty("x")&&h.hasOwnProperty("x")){var f=e(i),d=i.__photons||[],p=Math.max(0,r(i)/2)/Math.sqrt(t.globalScale),g=o(i)||"rgba(0,0,0,0.28)";a.fillStyle=g;var y=i.__controlPoints?s(fo,[c.x,c.y].concat(l(i.__controlPoints),[h.x,h.y])):null,v=0,_=!1;d.forEach((function(t){var n=!!t.__singleHop;if(t.hasOwnProperty("__progressRatio")||(t.__progressRatio=n?0:v/u),!n&&v++,t.__progressRatio+=f,t.__progressRatio>=1){if(n)return void(_=!0);t.__progressRatio=t.__progressRatio%1}var e=t.__progressRatio,r=y?y.get(e):{x:c.x+(h.x-c.x)*e||0,y:c.y+(h.y-c.y)*e||0};a.beginPath(),a.arc(r.x,r.y,p,0,2*Math.PI,!1),a.fill()})),_&&(i.__photons=i.__photons.filter((function(t){return!t.__singleHop||t.__progressRatio<=1})))}}})),a.restore()}(),function(){var n=$r(t.nodeVisibility),e=$r(t.nodeVal),r=$r(t.nodeColor),i=$r(t.nodeCanvasObjectMode),o=t.ctx,a=t.isShadow/t.globalScale,s=t.graphData.nodes.filter(n);o.save(),s.forEach((function(n){var s=i(n);if(!t.nodeCanvasObject||"before"!==s&&"replace"!==s||(t.nodeCanvasObject(n,o,t.globalScale),"replace"!==s)){var u=Math.sqrt(Math.max(0,e(n)||1))*t.nodeRelSize+a;o.beginPath(),o.arc(n.x,n.y,u,0,2*Math.PI,!1),o.fillStyle=r(n)||"rgba(31, 120, 180, 0.92)",o.fill(),t.nodeCanvasObject&&"after"===s&&t.nodeCanvasObject(n,t.ctx,t.globalScale)}else o.restore()})),o.restore()}(),this},emitParticle:function(t,n){return n&&(!n.__photons&&(n.__photons=[]),n.__photons.push({__singleHop:!0})),this}},stateInit:function(){return{forceLayout:Li().force("link",Ti()).force("charge",qi()).force("center",ii()).force("dagRadial",null).stop(),engineRunning:!1}},init:function(t,n){n.ctx=t},update:function(t){if(t.engineRunning=!1,t.onUpdate(),null!==t.nodeAutoColorBy&&zo(t.graphData.nodes,$r(t.nodeAutoColorBy),t.nodeColor),null!==t.linkAutoColorBy&&zo(t.graphData.links,$r(t.linkAutoColorBy),t.linkColor),t.graphData.links.forEach((function(n){n.source=n[t.linkSource],n.target=n[t.linkTarget]})),!t.isShadow){var n=$r(t.linkDirectionalParticles);t.graphData.links.forEach((function(t){var e=Math.round(Math.abs(n(t)));e?t.__photons=l(Array(e)).map((function(){return{}})):delete t.__photons}))}t.forceLayout.stop().alpha(1).nodes(t.graphData.nodes);var e=t.forceLayout.force("link");e&&e.id((function(n){return n[t.nodeId]})).links(t.graphData.links);var o=t.dagMode&&function(t,n){var e=t.nodes,o=t.links,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=a.nodeFilter,c=void 0===s?function(){return!0}:s,h=a.onLoopError,f=void 0===h?function(t){throw"Invalid DAG structure! Found cycle in node path: ".concat(t.join(" -> "),".")}:h,d={};e.forEach((function(t){return d[n(t)]={data:t,out:[],depth:-1,skip:!c(t)}})),o.forEach((function(t){var e=t.source,i=t.target,o=l(e),a=l(i);if(!d.hasOwnProperty(o))throw"Missing source node with id: ".concat(o);if(!d.hasOwnProperty(a))throw"Missing target node with id: ".concat(a);var s=d[o],u=d[a];function l(t){return"object"===r(t)?n(t):t}s.out.push(u)}));var p=[];return g(Object.values(d)),Object.assign.apply(Object,[{}].concat(l(Object.entries(d).filter((function(t){return!u(t,2)[1].skip})).map((function(t){var n=u(t,2);return i({},n[0],n[1].depth)})))));function g(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=0,o=t.length;ia.depth&&(a.depth=r,g(a.out,[].concat(l(e),[a]),r+(a.skip?0:1)))}}}(t.graphData,(function(n){return n[t.nodeId]}),{nodeFilter:t.dagNodeFilter,onLoopError:t.onDagError||void 0}),a=Math.max.apply(Math,l(Object.values(o||[]))),s=t.dagLevelDistance||t.graphData.nodes.length/(a||1)*2*(-1!==["radialin","radialout"].indexOf(t.dagMode)?.7:1);if(t.dagMode){var c=function(n,e){return function(r){return n?(o[r[t.nodeId]]-a/2)*s*(e?-1:1):void 0}},h=c(-1!==["lr","rl"].indexOf(t.dagMode),"rl"===t.dagMode),f=c(-1!==["td","bu"].indexOf(t.dagMode),"bu"===t.dagMode);t.graphData.nodes.filter(t.dagNodeFilter).forEach((function(t){t.fx=h(t),t.fy=f(t)}))}t.forceLayout.force("dagRadial",-1!==["radialin","radialout"].indexOf(t.dagMode)?function(t,n,e,r){var i,o,a,s,u=Ei(.1);function l(t){for(var u=0,l=i.length;u1&&(c.vy+=f*g),o>2&&(c.vz+=d*g)}}function c(){if(i){var n,e=i.length;for(a=new Array(e),s=new Array(e),n=0;n[1,2,3].includes(t)))||2,c()},l.strength=function(t){return arguments.length?(u="function"==typeof t?t:Ei(+t),c(),l):u},l.radius=function(n){return arguments.length?(t="function"==typeof n?n:Ei(+n),c(),l):t},l.x=function(t){return arguments.length?(n=+t,l):n},l.y=function(t){return arguments.length?(e=+t,l):e},l.z=function(t){return arguments.length?(r=+t,l):r},l}((function(n){var e=o[n[t.nodeId]]||-1;return("radialin"===t.dagMode?a-e:e)*s})).strength((function(n){return t.dagNodeFilter(n)?1:0})):null);for(var d=0;d0&&t.forceLayout.alpha()1?r-1:0),o=1;o1&&void 0!==arguments[1]?arguments[1]:0,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,r=arguments.length,i=new Array(r>3?r-3:0),o=3;o1&&void 0!==arguments[1]?arguments[1]:function(){return!0},e=$r(t.nodeVal),r=function(n){return Math.sqrt(Math.max(0,e(n)||1))*t.nodeRelSize},i=t.graphData.nodes.filter(n).map((function(t){return{x:t.x,y:t.y,r:r(t)}}));return i.length?{x:[ur(i,(function(t){return t.x-t.r})),sr(i,(function(t){return t.x+t.r}))],y:[ur(i,(function(t){return t.y-t.r})),sr(i,(function(t){return t.y+t.r}))]}:null},pauseAnimation:function(t){return t.animationFrameRequestId&&(cancelAnimationFrame(t.animationFrameRequestId),t.animationFrameRequestId=null),this},resumeAnimation:function(t){return t.animationFrameRequestId||this._animationCycle(),this},_destructor:function(){this.pauseAnimation(),this.graphData({nodes:[],links:[]})}},Po),stateInit:function(){return{lastSetZoom:1,zoom:rr(),forceGraph:new Mo,shadowGraph:(new Mo).cooldownTicks(0).nodeColor("__indexColor").linkColor("__indexColor").isShadow(!0),colorTracker:new ri}},init:function(t,n){var r=this;t.innerHTML="";var i=document.createElement("div");i.classList.add("force-graph-container"),i.style.position="relative",t.appendChild(i),n.canvas=document.createElement("canvas"),n.backgroundColor&&(n.canvas.style.background=n.backgroundColor),i.appendChild(n.canvas),n.shadowCanvas=document.createElement("canvas");var o=n.canvas.getContext("2d"),a=n.shadowCanvas.getContext("2d"),s={x:-1e12,y:-1e12},u=function(){var t=null,e=window.devicePixelRatio,r=s.x>0&&s.y>0?a.getImageData(s.x*e,s.y*e,1,1):null;return r&&(t=n.colorTracker.lookup(r.data)),t};Mt(n.canvas).call(function(){var t,n,e,r,i=Bt,o=Ht,a=Vt,s=Gt,u={},l=Et("start","drag","end"),c=0,h=0;function f(t){t.on("mousedown.drag",d).filter(s).on("touchstart.drag",y).on("touchmove.drag",v,jt).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(a,s){if(!r&&i.call(this,a,s)){var u=m(this,o.call(this,a,s),a,s,"mouse");u&&(Mt(a.view).on("mousemove.drag",p,Rt).on("mouseup.drag",g,Rt),Ut(a.view),Dt(a),e=!1,t=a.clientX,n=a.clientY,u("start",a))}}function p(r){if(It(r),!e){var i=r.clientX-t,o=r.clientY-n;e=i*i+o*o>h}u.mouse("drag",r)}function g(t){Mt(t.view).on("mousemove.drag mouseup.drag",null),Ft(t.view,e),It(t),u.mouse("end",t)}function y(t,n){if(i.call(this,t,n)){var e,r,a=t.changedTouches,s=o.call(this,t,n),u=a.length;for(e=0;e0||n.isPointerPressed)&&("touch"!==e.pointerType||void 0===e.movementX||[e.movementX,e.movementY].some((function(t){return Math.abs(t)>1})))&&(n.isPointerDragging=!0);var r,o,a,u=(r=i.getBoundingClientRect(),o=window.pageXOffset||document.documentElement.scrollLeft,a=window.pageYOffset||document.documentElement.scrollTop,{top:r.top+a,left:r.left+o});s.x=e.pageX-u.left,s.y=e.pageY-u.top,l.style.top="".concat(s.y,"px"),l.style.left="".concat(s.x,"px")}),{passive:!0})})),i.addEventListener("pointerup",(function(t){if(n.isPointerPressed=!1,n.isPointerDragging)n.isPointerDragging=!1;else{var e=[t,n.pointerDownEvent];requestAnimationFrame((function(){if(0===t.button)if(n.hoverObj){var r=n["on".concat(n.hoverObj.type,"Click")];r&&r.apply(void 0,[n.hoverObj.d].concat(e))}else n.onBackgroundClick&&n.onBackgroundClick.apply(n,e);if(2===t.button)if(n.hoverObj){var i=n["on".concat(n.hoverObj.type,"RightClick")];i&&i.apply(void 0,[n.hoverObj.d].concat(e))}else n.onBackgroundRightClick&&n.onBackgroundRightClick.apply(n,e)}))}}),{passive:!0}),i.addEventListener("contextmenu",(function(t){return!(n.onBackgroundRightClick||n.onNodeRightClick||n.onLinkRightClick)||(t.preventDefault(),!1)})),n.forceGraph(o),n.shadowGraph(a);var c=Mr((function(){jo(a,n.width,n.height),n.shadowGraph.linkWidth((function(t){return $r(n.linkWidth)(t)+n.linkHoverPrecision}));var t=$e(n.canvas);n.shadowGraph.globalScale(t.k).tickFrame()}),800);n.flushShadowCanvas=c.flush,(this._animationCycle=function t(){var e=!n.autoPauseRedraw||!!n.needsRedraw||n.forceGraph.isEngineRunning()||n.graphData.links.some((function(t){return t.__photons&&t.__photons.length}));if(n.needsRedraw=!1,n.enablePointerInteraction){var r=n.isPointerDragging?null:u();if(r!==n.hoverObj){var i=n.hoverObj,a=i?i.type:null,s=r?r.type:null;if(a&&a!==s){var h=n["on".concat(a,"Hover")];h&&h(null,i.d)}if(s){var f=n["on".concat(s,"Hover")];f&&f(r.d,a===s?i.d:null)}var d=r&&$r(n["".concat(r.type.toLowerCase(),"Label")])(r.d)||"";l.style.visibility=d?"visible":"hidden",l.innerHTML=d,n.canvas.classList[r&&n["on".concat(s,"Click")]||!r&&n.onBackgroundClick?"add":"remove"]("clickable"),n.hoverObj=r}e&&c()}if(e){jo(o,n.width,n.height);var p=$e(n.canvas).k;n.onRenderFramePre&&n.onRenderFramePre(o,p),n.forceGraph.globalScale(p).tickFrame(),n.onRenderFramePost&&n.onRenderFramePost(o,p)}qr.update(),n.animationFrameRequestId=requestAnimationFrame(t)})()},update:function(t){}});return Ro}));