sigma
Version:
A JavaScript library dedicated to graph drawing.
2 lines • 151 kB
JavaScript
(()=>{var t,e={5214:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},a=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=n(343),c=n(9960),l=s(n(1515)),h=n(1533),f=1.5,d=function(t){function e(){var e=t.call(this)||this;return e.x=.5,e.y=.5,e.angle=0,e.ratio=1,e.nextFrame=null,e.enabled=!0,e.previousState=e.getState(),e}return i(e,t),e.from=function(t){return(new e).setState(t)},e.prototype.enable=function(){return this.enabled=!0,this},e.prototype.disable=function(){return this.enabled=!1,this},e.prototype.getState=function(){return{x:this.x,y:this.y,angle:this.angle,ratio:this.ratio}},e.prototype.getPreviousState=function(){var t=this.previousState;return{x:t.x,y:t.y,angle:t.angle,ratio:t.ratio}},e.prototype.isAnimated=function(){return!!this.nextFrame},e.prototype.framedGraphToViewport=function(t,e){var n=Math.min(t.width,t.height),r=n/t.width,i=n/t.height,o=this.ratio/n,a=(e.x-this.x)/o,s=(this.y-e.y)/o;return{x:a*Math.cos(this.angle)-s*Math.sin(this.angle)+n/2/r,y:s*Math.cos(this.angle)+a*Math.sin(this.angle)+n/2/i}},e.prototype.viewportToFramedGraph=function(t,e){var n,r=Math.min(t.width,t.height),i=r/t.width,o=r/t.height,s=this.ratio/r,u=e.x-r/2/i,c=e.y-r/2/o;return u=(n=a([u*Math.cos(-this.angle)-c*Math.sin(-this.angle),c*Math.cos(-this.angle)+u*Math.sin(-this.angle)],2))[0],c=n[1],{x:u*s+this.x,y:-c*s+this.y}},e.prototype.viewRectangle=function(t){var e=0*t.width/8,n=0*t.height/8,r=this.viewportToFramedGraph(t,{x:0-e,y:0-n}),i=this.viewportToFramedGraph(t,{x:t.width+e,y:0-n}),o=this.viewportToFramedGraph(t,{x:0,y:t.height+n});return{x1:r.x,y1:r.y,x2:i.x,y2:i.y,height:i.y-o.y}},e.prototype.setState=function(t){return this.enabled?(this.previousState=this.getState(),t.x&&(this.x=t.x),t.y&&(this.y=t.y),t.angle&&(this.angle=t.angle),t.ratio&&(this.ratio=t.ratio),this.emit("updated",this.getState()),this):this},e.prototype.getViewportZoomedState=function(t,e,n){var r=n/this.ratio,i={x:e.width/2,y:e.height/2},a=this.viewportToFramedGraph(e,t),s=this.viewportToFramedGraph(e,i);return o(o({},this.getState()),{x:(a.x-s.x)*(1-r)+this.x,y:(a.y-s.y)*(1-r)+this.y,ratio:n})},e.prototype.animate=function(t,e,n){var r=this;if(this.enabled){var i=Object.assign({},c.ANIMATE_DEFAULTS,e),o="function"==typeof i.easing?i.easing:l.default[i.easing],a=Date.now(),s=this.getState(),u=function(){var e=(Date.now()-a)/i.duration;if(e>=1)return r.nextFrame=null,r.setState(t),void(r.animationCallback&&(r.animationCallback.call(null),r.animationCallback=void 0));var n=o(e),c={};t.x&&(c.x=s.x+(t.x-s.x)*n),t.y&&(c.y=s.y+(t.y-s.y)*n),t.angle&&(c.angle=s.angle+(t.angle-s.angle)*n),t.ratio&&(c.ratio=s.ratio+(t.ratio-s.ratio)*n),r.setState(c),r.nextFrame=h.requestFrame(u)};this.nextFrame?(h.cancelFrame(this.nextFrame),this.animationCallback&&this.animationCallback.call(null),this.nextFrame=h.requestFrame(u)):u(),this.animationCallback=n}},e.prototype.animatedZoom=function(t){if(t){if("number"==typeof t)return this.animate({ratio:this.ratio/t});this.animate({ratio:this.ratio/(t.factor||f)},t)}else this.animate({ratio:this.ratio/f})},e.prototype.animatedUnzoom=function(t){if(t){if("number"==typeof t)return this.animate({ratio:this.ratio*t});this.animate({ratio:this.ratio*(t.factor||f)},t)}else this.animate({ratio:this.ratio*f})},e.prototype.animatedReset=function(t){this.animate({x:.5,y:.5,ratio:1,angle:0},t)},e.prototype.copy=function(){return e.from(this.getState())},e}(u.EventEmitter);e.default=d},3413:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.getWheelDelta=e.getTouchCoords=e.getTouchesArray=e.getMouseCoords=e.getPosition=e.getY=e.getX=void 0;var o=n(343);function a(t){if(void 0!==t.offsetX)return t.offsetX;if(void 0!==t.clientX)return t.clientX;throw new Error("Captor: could not extract x from event.")}function s(t){if(void 0!==t.offsetY)return t.offsetY;if(void 0!==t.clientY)return t.clientY;throw new Error("Captor: could not extract y from event.")}function u(t){return{x:a(t),y:s(t)}}function c(t){for(var e=[],n=0,r=Math.min(t.length,2);n<r;n++)e.push(t[n]);return e}e.getX=a,e.getY=s,e.getPosition=u,e.getMouseCoords=function(t){return{x:a(t),y:s(t),clientX:t.clientX,clientY:t.clientY,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,shiftKey:t.shiftKey,preventDefault:t.preventDefault.bind(t),original:t}},e.getTouchesArray=c,e.getTouchCoords=function(t){return{touches:c(t.touches).map(u),ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,shiftKey:t.shiftKey,preventDefault:t.preventDefault.bind(t),original:t}},e.getWheelDelta=function(t){if(void 0!==t.deltaY)return-3*t.deltaY/360;if(void 0!==t.detail)return t.detail/-9;throw new Error("Captor: could not extract delta from event.")};var l=function(t){function e(e,n){var r=t.call(this)||this;return r.container=e,r.camera=n,r}return i(e,t),e}(o.EventEmitter);e.default=l},5373:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),a=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&o(e,t,n);return a(e,t),e};Object.defineProperty(e,"__esModule",{value:!0});var u=s(n(3413)),c=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.enabled=!0,r.draggedEvents=0,r.downStartTime=null,r.lastMouseX=null,r.lastMouseY=null,r.isMouseDown=!1,r.isMoving=!1,r.movingTimeout=null,r.startCameraState=null,r.clicks=0,r.doubleClickTimeout=null,r.currentWheelDirection=0,r.handleClick=r.handleClick.bind(r),r.handleRightClick=r.handleRightClick.bind(r),r.handleDown=r.handleDown.bind(r),r.handleUp=r.handleUp.bind(r),r.handleMove=r.handleMove.bind(r),r.handleWheel=r.handleWheel.bind(r),r.handleOut=r.handleOut.bind(r),e.addEventListener("click",r.handleClick,!1),e.addEventListener("contextmenu",r.handleRightClick,!1),e.addEventListener("mousedown",r.handleDown,!1),e.addEventListener("mousemove",r.handleMove,!1),e.addEventListener("wheel",r.handleWheel,!1),e.addEventListener("mouseout",r.handleOut,!1),document.addEventListener("mouseup",r.handleUp,!1),r}return i(e,t),e.prototype.kill=function(){var t=this.container;t.removeEventListener("click",this.handleClick),t.removeEventListener("contextmenu",this.handleRightClick),t.removeEventListener("mousedown",this.handleDown),t.removeEventListener("mousemove",this.handleMove),t.removeEventListener("wheel",this.handleWheel),t.removeEventListener("mouseout",this.handleOut),document.removeEventListener("mouseup",this.handleUp)},e.prototype.handleClick=function(t){var e=this;if(this.enabled){if(this.clicks++,2===this.clicks)return this.clicks=0,"number"==typeof this.doubleClickTimeout&&(clearTimeout(this.doubleClickTimeout),this.doubleClickTimeout=null),this.handleDoubleClick(t);setTimeout((function(){e.clicks=0,e.doubleClickTimeout=null}),300),this.draggedEvents<3&&this.emit("click",u.getMouseCoords(t))}},e.prototype.handleRightClick=function(t){this.enabled&&this.emit("rightClick",u.getMouseCoords(t))},e.prototype.handleDoubleClick=function(t){if(this.enabled){var e=this.camera.getState().ratio/2.2;return this.camera.animate(this.camera.getViewportZoomedState({x:u.getX(t),y:u.getY(t)},{width:this.container.offsetWidth,height:this.container.offsetHeight},e),{easing:"quadraticInOut",duration:200}),t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation(),!1}},e.prototype.handleDown=function(t){this.enabled&&(this.startCameraState=this.camera.getState(),this.lastMouseX=u.getX(t),this.lastMouseY=u.getY(t),this.draggedEvents=0,this.downStartTime=Date.now(),t.which,this.isMouseDown=!0,this.emit("mousedown",u.getMouseCoords(t)))},e.prototype.handleUp=function(t){var e=this;if(this.enabled&&this.isMouseDown){this.isMouseDown=!1,"number"==typeof this.movingTimeout&&(clearTimeout(this.movingTimeout),this.movingTimeout=null);var n=u.getX(t),r=u.getY(t),i=this.camera.getState(),o=this.camera.getPreviousState();this.isMoving?this.camera.animate({x:i.x+3*(i.x-o.x),y:i.y+3*(i.y-o.y)},{duration:200,easing:"quadraticOut"}):this.lastMouseX===n&&this.lastMouseY===r||this.camera.setState({x:i.x,y:i.y}),this.isMoving=!1,setTimeout((function(){return e.draggedEvents=0}),0),this.emit("mouseup",u.getMouseCoords(t))}},e.prototype.handleMove=function(t){var e=this;if(this.enabled){if(this.emit("mousemove",u.getMouseCoords(t)),this.isMouseDown){this.isMoving=!0,this.draggedEvents++,"number"==typeof this.movingTimeout&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout((function(){e.movingTimeout=null,e.isMoving=!1}),200);var n={width:this.container.offsetWidth,height:this.container.offsetHeight},r=u.getX(t),i=u.getY(t),o=this.camera.viewportToFramedGraph(n,{x:this.lastMouseX,y:this.lastMouseY}),a=this.camera.viewportToFramedGraph(n,{x:r,y:i}),s=o.x-a.x,c=o.y-a.y,l=this.camera.getState(),h=l.x+s,f=l.y+c;this.camera.setState({x:h,y:f}),this.lastMouseX=r,this.lastMouseY=i}return t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation(),!1}},e.prototype.handleWheel=function(t){var e=this;if(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation(),!this.enabled)return!1;var n=u.getWheelDelta(t);if(!n)return!1;var r=n>0?1/1.7:1.7,i=this.camera.getState().ratio*r,o=n>0?1:-1,a=Date.now();return this.currentWheelDirection===o&&this.lastWheelTriggerTime&&a-this.lastWheelTriggerTime<50||(this.camera.animate(this.camera.getViewportZoomedState({x:u.getX(t),y:u.getY(t)},{width:this.container.offsetWidth,height:this.container.offsetHeight},i),{easing:"quadraticOut",duration:250},(function(){e.currentWheelDirection=0})),this.currentWheelDirection=o,this.lastWheelTriggerTime=a),!1},e.prototype.handleOut=function(){},e}(u.default);e.default=c},5518:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),a=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&o(e,t,n);return a(e,t),e},u=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},c=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var l=s(n(3413)),h=c(n(5214)),f=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.enabled=!0,r.isMoving=!1,r.touchMode=0,r.handleStart=r.handleStart.bind(r),r.handleLeave=r.handleLeave.bind(r),r.handleMove=r.handleMove.bind(r),e.addEventListener("touchstart",r.handleStart,!1),e.addEventListener("touchend",r.handleLeave,!1),e.addEventListener("touchcancel",r.handleLeave,!1),e.addEventListener("touchmove",r.handleMove,!1),r}return i(e,t),e.prototype.kill=function(){var t=this.container;t.removeEventListener("touchstart",this.handleStart),t.removeEventListener("touchend",this.handleLeave),t.removeEventListener("touchcancel",this.handleLeave),t.removeEventListener("touchmove",this.handleMove)},e.prototype.getDimensions=function(){return{width:this.container.offsetWidth,height:this.container.offsetHeight}},e.prototype.dispatchRelatedMouseEvent=function(t,e,n,r){var i=n||l.getPosition(e.touches[0]),o=new MouseEvent(t,{clientX:i.x,clientY:i.y,altKey:e.altKey,ctrlKey:e.ctrlKey});(r||this.container).dispatchEvent(o)},e.prototype.handleStart=function(t){if(this.enabled){t.preventDefault(),1===t.touches.length&&this.dispatchRelatedMouseEvent("mousedown",t);var e=l.getTouchesArray(t.touches);if(this.isMoving=!0,this.touchMode=e.length,this.startCameraState=this.camera.getState(),this.startTouchesPositions=e.map(l.getPosition),this.lastTouchesPositions=this.startTouchesPositions,2===this.touchMode){var n=u(this.startTouchesPositions,2),r=n[0],i=r.x,o=r.y,a=n[1],s=a.x,c=a.y;this.startTouchesAngle=Math.atan2(c-o,s-i),this.startTouchesDistance=Math.sqrt(Math.pow(s-i,2)+Math.pow(c-o,2))}this.emit("touchdown",l.getTouchCoords(t))}},e.prototype.handleLeave=function(t){if(this.enabled){switch(t.preventDefault(),0===t.touches.length&&this.lastTouchesPositions&&this.lastTouchesPositions.length&&(this.dispatchRelatedMouseEvent("mouseup",t,this.lastTouchesPositions[0],document),this.dispatchRelatedMouseEvent("click",t,this.lastTouchesPositions[0])),this.movingTimeout&&(this.isMoving=!1,clearTimeout(this.movingTimeout)),this.touchMode){case 2:if(1===t.touches.length){this.handleStart(t),t.preventDefault();break}case 1:if(this.isMoving){var e=this.camera.getState(),n=this.camera.getPreviousState();this.camera.animate({x:e.x+3*(e.x-n.x),y:e.y+3*(e.y-n.y)},{duration:200,easing:"quadraticOut"})}this.isMoving=!1,this.touchMode=0}this.emit("touchup",l.getTouchCoords(t))}},e.prototype.handleMove=function(t){var e,n=this;if(this.enabled){t.preventDefault(),1===t.touches.length&&this.dispatchRelatedMouseEvent("mousemove",t);var r=this.startCameraState,i=l.getTouchesArray(t.touches).map(l.getPosition);switch(this.lastTouchesPositions=i,this.isMoving=!0,this.movingTimeout&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout((function(){n.isMoving=!1}),200),this.touchMode){case 1:var o=this.camera.viewportToFramedGraph(this.getDimensions(),(this.startTouchesPositions||[])[0]),a=o.x,s=o.y,c=this.camera.viewportToFramedGraph(this.getDimensions(),i[0]),f=c.x,d=c.y;this.camera.setState({x:r.x+a-f,y:r.y+s-d});break;case 2:var g={},p=i[0],v=p.x,m=p.y,y=i[1],b=y.x,w=y.y,M=Math.atan2(w-m,b-v)-this.startTouchesAngle,x=Math.hypot(w-m,b-v)/this.startTouchesDistance;g.ratio=r.ratio/x,g.angle=r.angle+M;var _=this.getDimensions(),E=h.default.from(r).viewportToFramedGraph(_,(this.startTouchesPositions||[])[0]),T=Math.min(_.width,_.height),L=T/_.width,A=T/_.height,S=g.ratio/T;d=m-T/2/A,f=(e=u([(f=v-T/2/L)*Math.cos(-g.angle)-d*Math.sin(-g.angle),d*Math.cos(-g.angle)+f*Math.sin(-g.angle)],2))[0],d=e[1],g.x=E.x-f*S,g.y=E.y+d*S,this.camera.setState(g)}this.emit("touchmove",l.getTouchCoords(t))}},e}(l.default);e.default=f},6243:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.edgeLabelsToDisplayFromNodes=e.labelsToDisplayFromGrid=void 0;var i=r(n(5214)),o={width:250,height:175},a={width:400,height:300};e.labelsToDisplayFromGrid=function(t){var e=t.cache,n=t.camera,r=t.cell,s=t.dimensions,u=t.displayedLabels,c=t.fontSize,l=void 0===c?14:c,h=t.graph,f=t.renderedSizeThreshold,d=void 0===f?-1/0:f,g=t.visibleNodes,p=n.getState(),v=n.getPreviousState(),m=new i.default;m.setState(v);var y=Math.pow(p.ratio,.5),b=p.ratio<v.ratio,w=p.x!==v.x||p.y!==v.y,M=p.ratio>v.ratio,x=w&&!b&&!M&&p.ratio>=1,_=w&&u.size&&!b&&!M;if(M&&Math.trunc(100*p.ratio)%5!=0)return Array.from(u);if(x&&0!==u.size)return Array.from(u);if(b&&p.ratio>=1)return Array.from(u);var E=r||o;p.ratio>=1.3&&(E=a);for(var T=s.width%E.width,L=E.width+T/Math.floor(s.width/E.width),A=s.height%E.height,S=E.height+A/Math.floor(s.height/E.height),C=s.width+L,P=s.height+S,k=-L,O=-S,N=s.width+L/2,D=s.height+S/2,R=-L/2,F=-S/2,U=[],j={},q=-1/0,I=null,z=0,H=g.length;z<H;z++){var G=e[et=g[z]];if(!(G.hidden||G.size/y<d)){var Y=n.framedGraphToViewport(s,G);if(!(Y.x<k||Y.x>C||Y.y<O||Y.y>P)){if(G.size>q&&(q=G.size,I=et),_){var B=m.framedGraphToViewport(s,G);if(B.x>=R&&B.x<=N&&B.y>=F&&B.y<=D&&!u.has(et))continue}if(void 0===j[tt=Math.floor(Y.x/L)+"§"+Math.floor(Y.y/S)])j[tt]=et;else{var V=j[tt],W=e[V];if(u.size>0){var X=u.has(et),K=u.has(V);if(!X&&K)continue;if(X&&!K){j[tt]=et;continue}if((_||b)&&X&&K){U.push(et);continue}}var Z=!1;if(G.size>W.size)Z=!0;else if(G.size===W.size){var Q=h.degree(et),$=h.degree(V);(Q>$||Q===$&&et>V)&&(Z=!0)}Z&&(j[tt]=et)}}}}var J=U.some((function(t){return t===I}));for(var tt in j){var et;(et=j[tt])===I&&(J=!0),U.push(et)}!J&&I&&U.push(I);var nt,rt,it,ot,at,st,ut=new Set;for(z=0,H=U.length;z<H;z++){var ct=e[X=U[z]],lt=n.framedGraphToViewport(s,ct);if(!ut.has(X))for(var ht=z+1;ht<H;ht++){var ft=e[K=U[ht]],dt=n.framedGraphToViewport(s,ft);nt=lt.x,rt=lt.y,it=8*ct.label.length,ot=l,at=dt.x,st=dt.y,nt<at+8*ft.label.length&&nt+it>at&&rt<st+l&&rt+ot>st&&(ct.size<ft.size?ut.add(X):ut.add(K))}}return U.filter((function(t){return!ut.has(t)}))},e.edgeLabelsToDisplayFromNodes=function(t){var e=t.nodeDataCache,n=t.edgeDataCache,r=t.graph,i=t.hoveredNode,o=t.highlightedNodes,a=t.displayedNodeLabels,s=new Set,u=Array.from(a),c=Array.from(o);i&&!o.has(i)&&c.push(i);for(var l=0;l<c.length;l++)for(var h=c[l],f=r.edges(h),d=0;d<f.length;d++){var g=f[d],p=r.extremities(g),v=e[p[0]],m=e[p[1]];n[g].hidden&&v.hidden&&m.hidden&&s.add(g)}for(l=0;l<u.length;l++)for(h=u[l],f=r.outboundEdges(h),d=0;d<f.length;d++)!n[f[d]].hidden&&a.has(r.opposite(h,f[d]))&&s.add(f[d]);return Array.from(s)}},7966:function(t,e,n){"use strict";var r=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},i=this&&this.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.rectangleCollidesWithQuad=e.squareCollidesWithQuad=e.getCircumscribedAlignedRectangle=e.isRectangleAligned=void 0;var a=o(n(9239));function s(t){return t.x1===t.x2||t.y1===t.y2}function u(t){var e=Math.sqrt(Math.pow(t.x2-t.x1,2)+Math.pow(t.y2-t.y1,2)),n=(t.y1-t.y2)*t.height/e,r=(t.x2-t.x1)*t.height/e,i={x:t.x1,y:t.y1},o={x:t.x2,y:t.y2},a={x:t.x1+n,y:t.y1+r},s={x:t.x2+n,y:t.y2+r},u=Math.min(i.x,o.x,a.x,s.x),c=Math.max(i.x,o.x,a.x,s.x),l=Math.min(i.y,o.y,a.y,s.y);return{x1:u,y1:l,x2:c,y2:l,height:Math.max(i.y,o.y,a.y,s.y)-l}}function c(t,e,n,r,i,o,a){return t<r+o&&t+n>r&&e<i+a&&e+n>i}function l(t,e,n,r,i,o,a,s){return t<i+a&&t+n>i&&e<o+s&&e+r>o}function h(t,e,n,r,i,o){var a=t<n+i/2;return e<r+o/2?a?1:2:a?3:4}e.isRectangleAligned=s,e.getCircumscribedAlignedRectangle=u,e.squareCollidesWithQuad=c,e.rectangleCollidesWithQuad=l;var f=function(){function t(t){void 0===t&&(t={}),this.containers={},this.cache=null,this.lastRectangle=null;var e=Math.pow(4,5);this.data=new Float32Array((4*e-1)/3*4),t.boundaries?this.resize(t.boundaries):this.resize({x:0,y:0,width:1,height:1})}return t.prototype.add=function(t,e,n,r){return function(t,e,n,r,i,o,a){for(var s=i-a,u=o-a,l=2*a,h=0,f=0;;){if(h>=5)return n[f]=n[f]||[],void n[f].push(r);var d=4*f+4,g=4*f+8,p=4*f+12,v=4*f+16,m=c(s,u,l,e[d+0],e[d+1],e[d+2],e[d+3]),y=c(s,u,l,e[g+0],e[g+1],e[g+2],e[g+3]),b=c(s,u,l,e[p+0],e[p+1],e[p+2],e[p+3]),w=c(s,u,l,e[v+0],e[v+1],e[v+2],e[v+3]),M=[m,y,b,w].reduce((function(t,e){return e?t+1:t}),0);if(0===M)throw new Error("sigma/quadtree.insertNode: no collision (level: "+h+", key: "+r+", x: "+i+", y: "+o+", size: "+a+").");if(3===M)throw new Error("sigma/quadtree.insertNode: 3 impossible collisions (level: "+h+", key: "+r+", x: "+i+", y: "+o+", size: "+a+").");if(M>1)return n[f]=n[f]||[],void n[f].push(r);h++,m&&(f=d),y&&(f=g),b&&(f=p),w&&(f=v)}}(0,this.data,this.containers,t,e,n,r),this},t.prototype.resize=function(t){this.clear(),this.data[0]=t.x,this.data[1]=t.y,this.data[2]=t.width,this.data[3]=t.height,function(t,e){for(var n=[0,0];n.length;){var r=n.pop(),i=n.pop(),o=4*i+4,a=4*i+8,s=4*i+12,u=4*i+16,c=e[i+0],l=e[i+1],h=e[i+2]/2,f=e[i+3]/2;e[o+0]=c,e[o+1]=l,e[o+2]=h,e[o+3]=f,e[a+0]=c+h,e[a+1]=l,e[a+2]=h,e[a+3]=f,e[s+0]=c,e[s+1]=l+f,e[s+2]=h,e[s+3]=f,e[u+0]=c+h,e[u+1]=l+f,e[u+2]=h,e[u+3]=f,r<4&&(n.push(u,r+1),n.push(s,r+1),n.push(a,r+1),n.push(o,r+1))}}(0,this.data)},t.prototype.clear=function(){return this.containers={},this},t.prototype.point=function(t,e){var n=[],o=0,a=0;do{this.containers[o]&&n.push.apply(n,i([],r(this.containers[o]))),o=4*o+4*h(t,e,this.data[o+0],this.data[o+1],this.data[o+2],this.data[o+3]),a++}while(a<=5);return n},t.prototype.rectangle=function(t,e,n,r,i){var o=this.lastRectangle;return o&&t===o.x1&&n===o.x2&&e===o.y1&&r===o.y2&&i===o.height||(this.lastRectangle={x1:t,y1:e,x2:n,y2:r,height:i},s(this.lastRectangle)||(this.lastRectangle=u(this.lastRectangle)),this.cache=function(t,e,n,r,i,o,s){for(var u,c=[0,0],h=[];c.length;){var f=c.pop(),d=c.pop();if((u=n[d])&&a.default(h,u),!(f>=5)){var g=4*d+4,p=4*d+8,v=4*d+12,m=4*d+16,y=l(r,i,o,s,e[g+0],e[g+1],e[g+2],e[g+3]),b=l(r,i,o,s,e[p+0],e[p+1],e[p+2],e[p+3]),w=l(r,i,o,s,e[v+0],e[v+1],e[v+2],e[v+3]),M=l(r,i,o,s,e[m+0],e[m+1],e[m+2],e[m+3]);y&&c.push(g,f+1),b&&c.push(p,f+1),w&&c.push(v,f+1),M&&c.push(m,f+1)}}return h}(0,this.data,this.containers,t,e,Math.abs(t-n)||Math.abs(e-r),i)),this.cache},t}();e.default=f},6270:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.MouseCaptor=e.QuadTree=e.Camera=e.Sigma=void 0;var i=r(n(2122));e.Sigma=i.default;var o=r(n(5214));e.Camera=o.default;var a=r(n(7966));e.QuadTree=a.default;var s=r(n(5373));e.MouseCaptor=s.default,e.default=i.default},145:(t,e,n)=>{"use strict";function r(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(i);++r<i;)o[r]=t+r*n;return o}function i(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function o(t,e){switch(arguments.length){case 0:break;case 1:"function"==typeof t?this.interpolator(t):this.range(t);break;default:this.domain(t),"function"==typeof e?this.interpolator(e):this.range(e)}return this}n.r(e),n.d(e,{scaleBand:()=>u,scaleDiverging:()=>ii,scaleDivergingLog:()=>oi,scaleDivergingPow:()=>si,scaleDivergingSqrt:()=>ui,scaleDivergingSymlog:()=>ai,scaleIdentity:()=>zt,scaleImplicit:()=>a,scaleLinear:()=>It,scaleLog:()=>Zt,scaleOrdinal:()=>s,scalePoint:()=>l,scalePow:()=>oe,scaleQuantile:()=>ve,scaleQuantize:()=>me,scaleRadial:()=>ce,scaleSequential:()=>Zr,scaleSequentialLog:()=>Qr,scaleSequentialPow:()=>Jr,scaleSequentialQuantile:()=>ei,scaleSequentialSqrt:()=>ti,scaleSequentialSymlog:()=>$r,scaleSqrt:()=>ae,scaleSymlog:()=>te,scaleThreshold:()=>ye,scaleTime:()=>Vr,scaleUtc:()=>Wr,tickFormat:()=>jt});const a=Symbol("implicit");function s(){var t=new Map,e=[],n=[],r=a;function o(i){var o=i+"",s=t.get(o);if(!s){if(r!==a)return r;t.set(o,s=e.push(i))}return n[(s-1)%n.length]}return o.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new Map;for(const r of n){const n=r+"";t.has(n)||t.set(n,e.push(r))}return o},o.range=function(t){return arguments.length?(n=Array.from(t),o):n.slice()},o.unknown=function(t){return arguments.length?(r=t,o):r},o.copy=function(){return s(e,n).unknown(r)},i.apply(o,arguments),o}function u(){var t,e,n=s().unknown(void 0),o=n.domain,a=n.range,c=0,l=1,h=!1,f=0,d=0,g=.5;function p(){var n=o().length,i=l<c,s=i?l:c,u=i?c:l;t=(u-s)/Math.max(1,n-f+2*d),h&&(t=Math.floor(t)),s+=(u-s-t*(n-f))*g,e=t*(1-f),h&&(s=Math.round(s),e=Math.round(e));var p=r(n).map((function(e){return s+t*e}));return a(i?p.reverse():p)}return delete n.unknown,n.domain=function(t){return arguments.length?(o(t),p()):o()},n.range=function(t){return arguments.length?([c,l]=t,c=+c,l=+l,p()):[c,l]},n.rangeRound=function(t){return[c,l]=t,c=+c,l=+l,h=!0,p()},n.bandwidth=function(){return e},n.step=function(){return t},n.round=function(t){return arguments.length?(h=!!t,p()):h},n.padding=function(t){return arguments.length?(f=Math.min(1,d=+t),p()):f},n.paddingInner=function(t){return arguments.length?(f=Math.min(1,t),p()):f},n.paddingOuter=function(t){return arguments.length?(d=+t,p()):d},n.align=function(t){return arguments.length?(g=Math.max(0,Math.min(1,t)),p()):g},n.copy=function(){return u(o(),[c,l]).round(h).paddingInner(f).paddingOuter(d).align(g)},i.apply(p(),arguments)}function c(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return c(e())},t}function l(){return c(u.apply(null,arguments).paddingInner(1))}var h=Math.sqrt(50),f=Math.sqrt(10),d=Math.sqrt(2);function g(t,e,n){var r,i,o,a,s=-1;if(n=+n,(t=+t)==(e=+e)&&n>0)return[t];if((r=e<t)&&(i=t,t=e,e=i),0===(a=p(t,e,n))||!isFinite(a))return[];if(a>0){let n=Math.round(t/a),r=Math.round(e/a);for(n*a<t&&++n,r*a>e&&--r,o=new Array(i=r-n+1);++s<i;)o[s]=(n+s)*a}else{a=-a;let n=Math.round(t*a),r=Math.round(e*a);for(n/a<t&&++n,r/a>e&&--r,o=new Array(i=r-n+1);++s<i;)o[s]=(n+s)/a}return r&&o.reverse(),o}function p(t,e,n){var r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/Math.pow(10,i);return i>=0?(o>=h?10:o>=f?5:o>=d?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=h?10:o>=f?5:o>=d?2:1)}function v(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=h?i*=10:o>=f?i*=5:o>=d&&(i*=2),e<t?-i:i}function m(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function y(t){let e=t,n=t;function r(t,e,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){const o=r+i>>>1;n(t[o],e)<0?r=o+1:i=o}return r}return 1===t.length&&(e=(e,n)=>t(e)-n,n=function(t){return(e,n)=>m(t(e),n)}(t)),{left:r,center:function(t,n,i,o){null==i&&(i=0),null==o&&(o=t.length);const a=r(t,n,i,o-1);return a>i&&e(t[a-1],n)>-e(t[a],n)?a-1:a},right:function(t,e,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){const o=r+i>>>1;n(t[o],e)>0?i=o:r=o+1}return r}}}function b(t){return null===t?NaN:+t}const w=y(m),M=w.right,x=(w.left,y(b).center,M);function _(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function E(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function T(){}var L=.7,A=1/L,S="\\s*([+-]?\\d+)\\s*",C="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",P="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",k=/^#([0-9a-f]{3,8})$/,O=new RegExp("^rgb\\("+[S,S,S]+"\\)$"),N=new RegExp("^rgb\\("+[P,P,P]+"\\)$"),D=new RegExp("^rgba\\("+[S,S,S,C]+"\\)$"),R=new RegExp("^rgba\\("+[P,P,P,C]+"\\)$"),F=new RegExp("^hsl\\("+[C,P,P]+"\\)$"),U=new RegExp("^hsla\\("+[C,P,P,C]+"\\)$"),j={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 q(){return this.rgb().formatHex()}function I(){return this.rgb().formatRgb()}function z(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=k.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?H(e):3===n?new V(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?G(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?G(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=O.exec(t))?new V(e[1],e[2],e[3],1):(e=N.exec(t))?new V(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=D.exec(t))?G(e[1],e[2],e[3],e[4]):(e=R.exec(t))?G(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=F.exec(t))?Z(e[1],e[2]/100,e[3]/100,1):(e=U.exec(t))?Z(e[1],e[2]/100,e[3]/100,e[4]):j.hasOwnProperty(t)?H(j[t]):"transparent"===t?new V(NaN,NaN,NaN,0):null}function H(t){return new V(t>>16&255,t>>8&255,255&t,1)}function G(t,e,n,r){return r<=0&&(t=e=n=NaN),new V(t,e,n,r)}function Y(t){return t instanceof T||(t=z(t)),t?new V((t=t.rgb()).r,t.g,t.b,t.opacity):new V}function B(t,e,n,r){return 1===arguments.length?Y(t):new V(t,e,n,null==r?1:r)}function V(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function W(){return"#"+K(this.r)+K(this.g)+K(this.b)}function X(){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 K(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Z(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new $(t,e,n,r)}function Q(t){if(t instanceof $)return new $(t.h,t.s,t.l,t.opacity);if(t instanceof T||(t=z(t)),!t)return new $;if(t instanceof $)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n<r):n===o?(r-e)/s+2:(e-n)/s+4,s/=u<.5?o+i:2-o-i,a*=60):s=u>0&&u<1?0:a,new $(a,s,u,t.opacity)}function $(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function J(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function tt(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}_(T,z,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:q,formatHex:q,formatHsl:function(){return Q(this).formatHsl()},formatRgb:I,toString:I}),_(V,B,E(T,{brighter:function(t){return t=null==t?A:Math.pow(A,t),new V(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?L:Math.pow(L,t),new V(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:W,formatHex:W,formatRgb:X,toString:X})),_($,(function(t,e,n,r){return 1===arguments.length?Q(t):new $(t,e,n,null==r?1:r)}),E(T,{brighter:function(t){return t=null==t?A:Math.pow(A,t),new $(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?L:Math.pow(L,t),new $(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new V(J(t>=240?t-240:t+120,i,r),J(t,i,r),J(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+")")}}));const et=t=>()=>t;function nt(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):et(isNaN(t)?e:t)}const rt=function t(e){var n=function(t){return 1==(t=+t)?nt:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):et(isNaN(e)?n:e)}}(e);function r(t,e){var r=n((t=B(t)).r,(e=B(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=nt(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function it(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;n<i;++n)r=B(e[n]),o[n]=r.r||0,a[n]=r.g||0,s[n]=r.b||0;return o=t(o),a=t(a),s=t(s),r.opacity=1,function(t){return r.r=o(t),r.g=a(t),r.b=s(t),r+""}}}function ot(t,e){var n,r=e?e.length:0,i=t?Math.min(r,t.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=dt(t[n],e[n]);for(;n<r;++n)a[n]=e[n];return function(t){for(n=0;n<i;++n)a[n]=o[n](t);return a}}function at(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function st(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function ut(t,e){var n,r={},i={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?r[n]=dt(t[n],e[n]):i[n]=e[n];return function(t){for(n in r)i[n]=r[n](t);return i}}it((function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r<e-1?t[r+2]:2*o-i;return tt((n-r/e)*e,a,i,o,s)}})),it((function(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],o=t[r%e],a=t[(r+1)%e],s=t[(r+2)%e];return tt((n-r/e)*e,i,o,a,s)}}));var ct=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,lt=new RegExp(ct.source,"g");function ht(t,e){var n,r,i,o=ct.lastIndex=lt.lastIndex=0,a=-1,s=[],u=[];for(t+="",e+="";(n=ct.exec(t))&&(r=lt.exec(e));)(i=r.index)>o&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:st(n,r)})),o=lt.lastIndex;return o<e.length&&(i=e.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?u[0]?function(t){return function(e){return t(e)+""}}(u[0].x):function(t){return function(){return t}}(e):(e=u.length,function(t){for(var n,r=0;r<e;++r)s[(n=u[r]).i]=n.x(t);return s.join("")})}function ft(t,e){e||(e=[]);var n,r=t?Math.min(e.length,t.length):0,i=e.slice();return function(o){for(n=0;n<r;++n)i[n]=t[n]*(1-o)+e[n]*o;return i}}function dt(t,e){var n,r,i=typeof e;return null==e||"boolean"===i?et(e):("number"===i?st:"string"===i?(n=z(e))?(e=n,rt):ht:e instanceof z?rt:e instanceof Date?at:(r=e,!ArrayBuffer.isView(r)||r instanceof DataView?Array.isArray(e)?ot:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?ut:st:ft))(t,e)}function gt(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function pt(t){return+t}var vt=[0,1];function mt(t){return t}function yt(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:(n=isNaN(e)?NaN:.5,function(){return n});var n}function bt(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i<r?(r=yt(i,r),o=n(a,o)):(r=yt(r,i),o=n(o,a)),function(t){return o(r(t))}}function wt(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<r;)i[a]=yt(t[a],t[a+1]),o[a]=n(e[a],e[a+1]);return function(e){var n=x(t,e,1,r)-1;return o[n](i[n](e))}}function Mt(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function xt(){var t,e,n,r,i,o,a=vt,s=vt,u=dt,c=mt;function l(){var t,e,n,u=Math.min(a.length,s.length);return c!==mt&&(t=a[0],e=a[u-1],t>e&&(n=t,t=e,e=n),c=function(n){return Math.max(t,Math.min(e,n))}),r=u>2?wt:bt,i=o=null,h}function h(e){return null==e||isNaN(e=+e)?n:(i||(i=r(a.map(t),s,u)))(t(c(e)))}return h.invert=function(n){return c(e((o||(o=r(s,a.map(t),st)))(n)))},h.domain=function(t){return arguments.length?(a=Array.from(t,pt),l()):a.slice()},h.range=function(t){return arguments.length?(s=Array.from(t),l()):s.slice()},h.rangeRound=function(t){return s=Array.from(t),u=gt,l()},h.clamp=function(t){return arguments.length?(c=!!t||mt,l()):c!==mt},h.interpolate=function(t){return arguments.length?(u=t,l()):u},h.unknown=function(t){return arguments.length?(n=t,h):n},function(n,r){return t=n,e=r,l()}}function _t(){return xt()(mt,mt)}var Et,Tt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Lt(t){if(!(e=Tt.exec(t)))throw new Error("invalid format: "+t);var e;return new At({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function At(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function St(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function Ct(t){return(t=St(Math.abs(t)))?t[1]:NaN}function Pt(t,e){var n=St(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}Lt.prototype=At.prototype,At.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const kt={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Pt(100*t,e),r:Pt,s:function(t,e){var n=St(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(Et=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+St(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Ot(t){return t}var Nt,Dt,Rt,Ft=Array.prototype.map,Ut=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function jt(t,e,n,r){var i,o=v(t,e,n);switch((r=Lt(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Ct(e)/3)))-Ct(Math.abs(t)))}(o,a))||(r.precision=i),Rt(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Ct(e)-Ct(t))+1}(o,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(t){return Math.max(0,-Ct(Math.abs(t)))}(o))||(r.precision=i-2*("%"===r.type))}return Dt(r)}function qt(t){var e=t.domain;return t.ticks=function(t){var n=e();return g(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return jt(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,i,o=e(),a=0,s=o.length-1,u=o[a],c=o[s],l=10;for(c<u&&(i=u,u=c,c=i,i=a,a=s,s=i);l-- >0;){if((i=p(u,c,n))===r)return o[a]=u,o[s]=c,e(o);if(i>0)u=Math.floor(u/i)*i,c=Math.ceil(c/i)*i;else{if(!(i<0))break;u=Math.ceil(u*i)/i,c=Math.floor(c*i)/i}r=i}return t},t}function It(){var t=_t();return t.copy=function(){return Mt(t,It())},i.apply(t,arguments),qt(t)}function zt(t){var e;function n(t){return null==t||isNaN(t=+t)?e:t}return n.invert=n,n.domain=n.range=function(e){return arguments.length?(t=Array.from(e,pt),n):t.slice()},n.unknown=function(t){return arguments.length?(e=t,n):e},n.copy=function(){return zt(t).unknown(e)},t=arguments.length?Array.from(t,pt):[0,1],qt(n)}function Ht(t,e){var n,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a<o&&(n=r,r=i,i=n,n=o,o=a,a=n),t[r]=e.floor(o),t[i]=e.ceil(a),t}function Gt(t){return Math.log(t)}function Yt(t){return Math.exp(t)}function Bt(t){return-Math.log(-t)}function Vt(t){return-Math.exp(-t)}function Wt(t){return isFinite(t)?+("1e"+t):t<0?0:t}function Xt(t){return function(e){return-t(-e)}}function Kt(t){var e,n,r=t(Gt,Yt),i=r.domain,o=10;function a(){return e=function(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),function(e){return Math.log(e)/t})}(o),n=function(t){return 10===t?Wt:t===Math.E?Math.exp:function(e){return Math.pow(t,e)}}(o),i()[0]<0?(e=Xt(e),n=Xt(n),t(Bt,Vt)):t(Gt,Yt),r}return r.base=function(t){return arguments.length?(o=+t,a()):o},r.domain=function(t){return arguments.length?(i(t),a()):i()},r.ticks=function(t){var r,a=i(),s=a[0],u=a[a.length-1];(r=u<s)&&(f=s,s=u,u=f);var c,l,h,f=e(s),d=e(u),p=null==t?10:+t,v=[];if(!(o%1)&&d-f<p){if(f=Math.floor(f),d=Math.ceil(d),s>0){for(;f<=d;++f)for(l=1,c=n(f);l<o;++l)if(!((h=c*l)<s)){if(h>u)break;v.push(h)}}else for(;f<=d;++f)for(l=o-1,c=n(f);l>=1;--l)if(!((h=c*l)<s)){if(h>u)break;v.push(h)}2*v.length<p&&(v=g(s,u,p))}else v=g(f,d,Math.min(d-f,p)).map(n);return r?v.reverse():v},r.tickFormat=function(t,i){if(null==i&&(i=10===o?".0e":","),"function"!=typeof i&&(i=Dt(i)),t===1/0)return i;null==t&&(t=10);var a=Math.max(1,o*t/r.ticks().length);return function(t){var r=t/n(Math.round(e(t)));return r*o<o-.5&&(r*=o),r<=a?i(t):""}},r.nice=function(){return i(Ht(i(),{floor:function(t){return n(Math.floor(e(t)))},ceil:function(t){return n(Math.ceil(e(t)))}}))},r}function Zt(){var t=Kt(xt()).domain([1,10]);return t.copy=function(){return Mt(t,Zt()).base(t.base())},i.apply(t,arguments),t}function Qt(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function $t(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function Jt(t){var e=1,n=t(Qt(e),$t(e));return n.constant=function(n){return arguments.length?t(Qt(e=+n),$t(e)):e},qt(n)}function te(){var t=Jt(xt());return t.copy=function(){return Mt(t,te()).constant(t.constant())},i.apply(t,arguments)}function ee(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function ne(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function re(t){return t<0?-t*t:t*t}function ie(t){var e=t(mt,mt),n=1;function r(){return 1===n?t(mt,mt):.5===n?t(ne,re):t(ee(n),ee(1/n))}return e.exponent=function(t){return arguments.length?(n=+t,r()):n},qt(e)}function oe(){var t=ie(xt());return t.copy=function(){return Mt(t,oe()).exponent(t.exponent())},i.apply(t,arguments),t}function ae(){return oe.apply(null,arguments).exponent(.5)}function se(t){return Math.sign(t)*t*t}function ue(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function ce(){var t,e=_t(),n=[0,1],r=!1;function o(n){var i=ue(e(n));return isNaN(i)?t:r?Math.round(i):i}return o.invert=function(t){return e.invert(se(t))},o.domain=function(t){return arguments.length?(e.domain(t),o):e.domain()},o.range=function(t){return arguments.length?(e.range((n=Array.from(t,pt)).map(se)),o):n.slice()},o.rangeRound=function(t){return o.range(t).round(!0)},o.round=function(t){return arguments.length?(r=!!t,o):r},o.clamp=function(t){return arguments.length?(e.clamp(t),o):e.clamp()},o.unknown=function(e){return arguments.length?(t=e,o):t},o.copy=function(){return ce(e.domain(),n).round(r).clamp(e.clamp()).unknown(t)},i.apply(o,arguments),qt(o)}function le(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n<i||void 0===n&&i>=i)&&(n=i)}return n}function he(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function fe(t,e,n=0,r=t.length-1,i=m){for(;r>n;){if(r-n>600){const o=r-n+1,a=e-n+1,s=Math.log(o),u=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*u*(o-u)/o)*(a-o/2<0?-1:1);fe(t,e,Math.max(n,Math.floor(e-a*u/o+c)),Math.min(r,Math.floor(e+(o-a)*u/o+c)),i)}const o=t[e];let a=n,s=r;for(de(t,n,e),i(t[r],o)>0&&de(t,n,r);a<s;){for(de(t,a,s),++a,--s;i(t[a],o)<0;)++a;for(;i(t[s],o)>0;)--s}0===i(t[n],o)?de(t,n,s):(++s,de(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function de(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function ge(t,e,n){if(r=(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let r of t)null!=(r=e(r,++n,t))&&(r=+r)>=r&&(yield r)}}(t,n))).length){if((e=+e)<=0||r<2)return he(t);if(e>=1)return le(t);var r,i=(r-1)*e,o=Math.floor(i),a=le(fe(t,o).subarray(0,o+1));return a+(he(t.subarray(o+1))-a)*(i-o)}}function pe(t,e,n=b){if(r=t.length){if((e=+e)<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t);return a+(+n(t[o+1],o+1,t)-a)*(i-o)}}function ve(){var t,e=[],n=[],r=[];function o(){var t=0,i=Math.max(1,n.length);for(r=new Array(i-1);++t<i;)r[t-1]=pe(e,t/i);return a}function a(e){return null==e||isNaN(e=+e)?t:n[x(r,e)]}return a.invertExtent=function(t){var i=n.indexOf(t);return i<0?[NaN,NaN]:[i>0?r[i-1]:e[0],i<r.length?r[i]:e[e.length-1]]},a.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)null==n||isNaN(n=+n)||e.push(n);return e.sort(m),o()},a.range=function(t){return arguments.length?(n=Array.from(t),o()):n.slice()},a.unknown=function(e){return arguments.length?(t=e,a):t},a.quantiles=function(){return r.slice()},a.copy=function(){return ve().domain(e).range(n).unknown(t)},i.apply(a,arguments)}function me(){var t,e=0,n=1,r=1,o=[.5],a=[0,1];function s(e){return null!=e&&e<=e?a[x(o,e,0,r)]:t}function u(){var t=-1;for(o=new Array(r);++t<r;)o[t]=((t+1)*n-(t-r)*e)/(r+1);return s}return s.domain=function(t){return arguments.length?([e,n]=t,e=+e,n=+n,u()):[e,n]},s.range=function(t){return arguments.length?(r=(a=Array.from(t)).length-1,u()):a.slice()},s.invertExtent=function(t){var i=a.indexOf(t);return i<0?[NaN,NaN]:i<1?[e,o[0]]:i>=r?[o[r-1],n]:[o[i-1],o[i]]},s.unknown=function(e){return arguments.length?(t=e,s):s},s.thresholds=function(){return o.slice()},s.copy=function(){return me().domain([e,n]).range(a).unknown(t)},i.apply(qt(s),arguments)}function ye(){var t,e=[.5],n=[0,1],r=1;function o(i){return null!=i&&i<=i?n[x(e,i,0,r)]:t}return o.domain=function(t){return arguments.length?(e=Array.from(t),r=Math.min(e.length,n.length-1),o):e.slice()},o.range=function(t){return arguments.length?(n=Array.from(t),r=Math.min(e.length,n.length-1),o):n.slice()},o.invertExtent=function(t){var r=n.indexOf(t);return[e[r-1],e[r]]},o.unknown=function(e){return arguments.length?(t=e,o):t},o.copy=function(){return ye().domain(e).range(n).unknown(t)},i.apply(o,arguments)}Nt=function(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?Ot:(e=Ft.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,s=e[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),o.push(t.substring(i-=s,i+s)),!((u+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?Ot:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Ft.call(t.numerals,String)),u=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"−":t.minus+"",l=void 0===t.nan?"NaN":t.nan+"";function h(t){var e=(t=Lt(t)).fill,n=t.align,h=t.sign,f=t.symbol,d=t.zero,g=t.width,p=t.comma,v=t.precision,m=t.trim,y=t.type;"n"===y?(p=!0,y="g"):kt[y]||(void 0===v&&(v=12),m=!0,y="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var b="$"===f?i:"#"===f&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",w="$"===f?o:/[%p]/.test(y)?u:"",M=kt[y],x=/[defgprs%]/.test(y);function _(t){var i,o,u,f=b,_=w;if("c"===y)_=M(t)+_,t="";else{var E=(t=+t)<0||1/t<0;if(t=isNaN(t)?l:M(Math.abs(t),v),m&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),E&&0==+t&&"+"!==h&&(E=!1),f=(E?"("===h?h:c:"-"===h||"("===h?"":h)+f,_=("s"===y?Ut[8+Et/3]:"")+_+(E&&"("===h?")":""),x)for(i=-1,o=t.length;++i<o;)if(48>(u=t.charCodeAt(i))||u>57){_=(46===u?a+t.slice(i+1):t.slice(i))+_,t=t.slice(0,i);break}}p&&!d&&(t=r(t,1/0));var T=f.length+t.length+_.length,L=T<g?new Array(g-T+1).join(e):"";switch(p&&d&&(t=r(L+t,L.length?g-_.length:1/0),L=""),n){case"<":t=f+t+_+L;break;case"=":t=f+L+t+_;break;case"^":t=L.slice(0,T=L.length>>1)+f+t+_+L.slice(T);break;default:t=L+f+t+_}return s(t)}return v=void 0===v?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v)),_.toString=function(){return t+""},_}return{format:h,formatPrefix:function(t,e){var n=h(((t=Lt(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(Ct(e)/3))),i=Math.pow(10,-r),o=Ut[8+r/3];return function(t){return n(i*t)+o}}}}({thousands:",",grouping:[3],currency:["$",""]}),Dt=Nt.format,Rt=Nt.formatPrefix;const be=1e3,we=6e4,Me=36e5,xe=864e5,_e=6048e5,Ee=31536e6;var Te=new Date,Le=new Date;function Ae(t,e,n,r){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return i.floor=function(e){return t(e=new Date(+e)),e},i.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n},i.round=function(t){var e=i(t),n=i.ceil(t);return t-e<n-t?e:n},i.offset=function(t,n){return e(t=new Date(+t),null==n?1:Math.floor(n)),t},i.range=function(n,r,o){var a,s=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return s;do{s.push(a=new Date(+n)),e(n,o),t(n)}while(a<n&&n<r);return s},i.filter=function(n){return Ae((function(e){if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););}))},n&&(i.count=function(e,r){return Te.setTime(+e),Le.setTime(+r),t(Te),t(Le),Math.floor(n(Te,Le))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(e){return r(e)%t==0}:function(e){return i.count(0,e)%t==0}):i:null}),i}var Se=Ae((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));Se.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?Ae((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,n){e.setTime(+e+n*t)}),(function(e,n){return(n-e)/t})):Se:null};const Ce=Se;Se.range;var Pe=Ae((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+e*be)}),(function(t,e){return(e-t)/be}),(function(t){return t.getUTCSeconds()}));const ke=Pe;Pe.range;var Oe=Ae((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*be)}),(function(t,e){t.setTime(+t+e*we)}),(function(t,e){return(e-t)/we}),(function(t){return t.getMinutes()}));const Ne=Oe;Oe.range;var De=Ae((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*be-t.getMinutes()*we)}),(function(t,e){t.setTime(+t+e*Me)}),(function(t,e){return(e-t)/Me}),(function(t){return t.getHours()}));const Re=De;De.range;var Fe=Ae((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*we)/xe),(t=>t.getDate()-1));const Ue=Fe;function je(t){return Ae((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*we)/_e}))}Fe.range;var qe=je(0),Ie=je(1),ze=je(2),He=je(3),Ge=je(4),Ye=je(5),Be=je(6),Ve=(qe.range,Ie.range,ze.range,He.range,Ge.range,Ye.range,Be.range,Ae((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})));const We=Ve;Ve.range;var Xe=Ae((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));Xe.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Ae((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,n){e.setFullYear(e.getFullYear()+n*t)})):null};const Ke=Xe;Xe.range;var Ze=Ae((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+e*we)}),(function(t,e){return(e-t)/we}),(function(t){return t.getUTCMinutes()}));const Qe=Ze;Ze.range;var $e=Ae((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+e*Me)}),(function(t,e){return(e-t)/Me}),(function(t){return t.getUTCHours()}));const Je=$e;$e.range;var tn=Ae((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/xe}),(function(t){return t.getUTCDate()-1}));const en=tn;function nn(t){return Ae((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/_e}))}tn.range;var rn=nn(0),on=nn(1),an=nn(2),sn=nn(3),un=nn(4),cn=nn(5),ln=nn(6),hn=(rn.range,on.range,an.range,sn.range,un.range,cn.range,ln.range,Ae((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})));const fn=hn;hn.range;var dn=Ae((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));dn.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Ae((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null};const gn=dn;function pn(t,e,n,r,i,o){const a=[[ke,1,be],[ke,5,5e3],[ke,15,15e3],[ke,30,3e4],[o,1,we],[o,5,3e5],[o,15,9e5],[o,30,18e5],[i,1,Me],[i,3,108e5],[i,6,216e5],[i,12,432e5],[r,1,xe],[r,2,1728e5],[n,1,_e],[e,1,2592e6],[e,3,7776e6],[t,1,Ee]];function s(e,n,r){const i=Math.abs(n-e)/r,o=y((([,,t])=>t)).right(a,i);if(o===a.length)return t.every(v(e/Ee,n/Ee,r));if(0===o)return Ce.every(Math.max(v(e,n,r),1));const[s,u]=a[i/a[o-1][2]<a[o][2]/i?o-1:o];return s.every(u)}return[function(t,e,n){const r=e<t;r&&([t,e]=[e,t]);const i=n&&"function"==typeof n.range?n:s(t,e,n),o=i?i.range(t,+e+1):[];return r?o.reverse():o},s]}dn.range;const[vn,mn]=pn(gn,fn,rn,en,Je,Qe),[yn,bn]=pn(Ke,We,qe,Ue,Re,Ne);function wn(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Mn(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function xn(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}var _n,En,Tn,Ln={"-":"",_:" ",0:"0"},An=/^\s*\d+/,Sn=/^%/,Cn=/[\\^$*+?|[\]().{}]/g;function Pn(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(e)+i:i)}function kn(t){return t.replace(Cn,"\\$&")}function On(t){return new RegExp("^(?:"+t.map(kn).join("|")+")","i")}function Nn(t){return new Map(t.map(((t,e)=>[t.toLowerCase(),e])))}function Dn(t,e,n){var r=An.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Rn(t,e,n){var r=An.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function Fn(t,e,n){var r=An.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Un(t,e,n){var r=An.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function jn(t,e,n){var r=An.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function qn(t,e,n){var r=An.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function In(t,e,n){var r=An.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function zn(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Hn(t,e,n){var r=An.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function Gn(t,e,n){var r=An.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Yn(t,e,n){var r=An.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Bn(t,e,n){var r=An.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Vn(t,e,n){var r=An.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function Wn(t,e,n){var r=An.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function Xn(t,e,n){var r=An.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Kn(t,e,n){var r=An.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Zn(t,e,n){var r=An.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Qn(t,e,n){var r=Sn.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function $n(t,e,n){var r=An.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function Jn(t,e,n){var r=An.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function tr(t,e){return Pn(t.getDate(),e,2)}function er(t,e){return Pn(t.getHours(),e,2)}function nr(t,e){return Pn(t.getHours()%12||12,e,2)}function rr(t,e){return Pn(1+Ue.count(Ke(t),t),e,3)}function ir(t,e){return Pn(t.getMilliseconds(),e,3)}function or(t,e){return ir(t,e)+"000"}function ar(t,e){return Pn(t.getMonth()+1,e,2)}function sr(t,e){return Pn(t.getMinutes(),e,2)}function ur(t,e){return Pn(t.getSeconds(),e,2)}function cr(t){var e=t.getDay();return 0===e?7:e}function lr(t,e){return Pn(qe.count(Ke(t)-1,t),e,2)}function hr(t){var e=t.getDay();return e>=4||0===e?Ge(t):Ge.ceil(t)}function fr(t,e){return t=hr(t),Pn(Ge.count(Ke(t),t)+(4===Ke(t).getDay()),e,2)}function dr(t){return t.getDay()}function gr(t,e){return Pn(Ie.count(Ke(t)-1,t),e,2)}function pr(t,e){return Pn(t.getFullYear()%100,e,2)}function vr(t,e){return Pn((t=hr(t)).getFullYear()%100,e,2)}function mr(t,e){return Pn(t.getFullYear()%1e4,e,4)}function yr(t,e){var n=t.getDay();return Pn((t=n>=4||0===n?Ge(t):Ge.ceil(t)).getFullYear()%1e4,e,4)}function br(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Pn(e/60|0,"0",2)+Pn(e%60,"0",2)}function wr(t,e){return Pn(t.getUTCDate(),e,2)}function Mr(t,e){return Pn(t.getUTCHours(),e,2)}function xr(t,e){return Pn(t.getUTCHours()%12||12,e,2)}function _r(t,e){return Pn(1+en.count(gn(t),t),e,3)}function Er(t,e){return Pn(t.getUTCMilliseconds(),e,3)}function Tr(t,e){return Er(t,e)+"000"}function Lr(t,e){return Pn(t.getUTCMonth()+1,e,2)}function Ar(t,e){return Pn(t.getUTCMinutes(),e,2)}function Sr(t,e){return Pn(t.getUTCSeconds(),e,2)}function Cr(t){var e=t.getUTCDay();return 0===e?7:e}function Pr(t,e){return Pn(rn.count(gn(t)-1,t),e,2)}function kr(t){var e=t.getUTCDay();return e>=4||0===e?un(t):un.ceil(t)}function Or(t,e){return t=kr(t),Pn(un.count(gn(t),t)+(4===gn(t).getUTCDay()),e,2)}function Nr(t){return t.getUTCDay()}function Dr(t,e){return Pn(on.count(gn(t)-1,t),e,2)}function Rr(t,e){return Pn(t.getUTCFullYear()%100,e,2)}function Fr(t,e){return Pn((t=kr(t)).getUTCFullYear()%100,e,2)}function Ur(t,e){return Pn(t.getUTCFullYear()%1e4,e,4)}function jr(t,e){var n=t.getUTCDay();return Pn((t=n>=4||0===n?un(t):un.ceil(t)).getUTCFullYear()%1e4,e,4)}function qr(){return"+0000"}function Ir(){return"%"}function zr(t){return+t}function Hr(t){return Math.floor(+t/1e3)}function Gr(t){return new Date(t)}function Yr(t){return t instanceof Date?+t:+new Date(+t)}function Br(t,e,n,r,i,o,a,s,u,c){var l=_t(),h=l.invert,f=l.domain,d=c(".%L"),g=c(":%S"),p=c("%I:%M"),v=c("%I %p"),m=c("%a %d"),y=c("%b %d"),b=c("%B"),w=c("%Y");function M(t){return(u(t)<t?d:s(t)<t?g:a(t)<t?p:o(t)<t?v:r(t)<t?i(t)<t?m:y:n(t)<t?b:w)(t)}return l.invert=function(t){return new Date(h(t))},l.domain=function(t){return arguments.length?f(Array.from(t,Yr)):f().map(Gr)},l.ticks=function(e){var n=f();return t(n[0],n[n.length-1],null==e?10:e)},l.tickFormat=function(t,e){return null==e?M:c(e)},l.nice=function(t){var n=f();return t&&"function"==typeof t.range||(t=e(n[0],n[n.length-1],null==t?10:t)),t?f(Ht(n,t)):l},l.copy=function(){return Mt(l,Br(t,e,n,r,i,o,a,s,u,c))},l}function Vr(){return i.apply(Br(yn,bn,Ke,We,qe,Ue,Re,Ne,ke,En).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Wr(){return i.apply(Br(vn,mn,gn,fn,rn,en,Je,Qe,ke,Tn).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Xr(){var t,e,n,r,i,o=0,a=1,s=mt,u=!1;function c(e){return null==e||isNaN(e=+e)?i:s(0===n?.5:(e=(r(e)-t)*n,u?Math.max(0,Math.min(1,e)):e))}function l(t){return function(e){var n,r;return arguments.length?([n,r]=e,s=t(n,r),c):[s(0),s(1)]}}return c.domain=function(i){return arguments.length?([o,a]=i,t=r(o=+o),e=r(a=+a),n=t===e?0:1/(e-t),c):[o,a]},c.clamp=function(t){return arguments.length?(u=!!t,c):u},c.interpolator=function(t){return arguments.length?(s=t,c):s},c.range=l(dt),c.rangeRound=l(gt),c.unknown=function(t){return arguments.length?(i=t,c):i},function(i){return r=i,t=i(o),e=i(a),n=t===e?0:1/(e-t),c}}function Kr(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function Zr(){var t=qt(Xr()(mt));return t.copy=function(){return Kr(t,Zr())},o.apply(t,arguments)}function Qr(){var t=Kt(Xr()).domain([1,10]);return t.copy=function(){return Kr(t,Qr()).base(t.base())},o.apply(t,arguments)}function $r(){var t=Jt(Xr());return t.copy=function(){return Kr(t,$r()).constant(t.constant())},o.apply(t,arguments)}function Jr(){var t=ie(Xr());return t.copy=function(){return Kr(t,Jr()).exponent(t.exponent())},o.apply(t,arguments)}function ti(){return Jr.apply(null,arguments).exponent(.5)}function ei(){var t=[],e=mt;function n(n){if(null!=n&&!isNaN(n=+n))return e((x(t,n,1)-1)/(t.length-1))}return n.domain=function(e){if(!arguments.length)return t.slice();t=[];for(let n of e)null==n||isNaN(n=+n)||t.push(n);return t.sort(m),n},n.interpolator=function(t){return arguments.length?(e=t,n):e},n.range=function(){return t.map(((n,r)=>e(r/(t.length-1))))},n.quantiles=function(e){return Array.from({length:e+1},((n,r)=>ge(t,r/e)))},n.copy=function(){return ei(e).domain(t)},o.apply(n,arguments)}function ni(t,e){void 0===e&&(e=t,t=dt);for(var n=0,r=e.length-1,i=e[0],o=new Array(r<0?0:r);n<r;)o[n]=t(i,i=e[++n]);return function(t){var e=Math.max(0,Math.min(r-1,Math.floor(t*=r)));return o[e](t-e)}}function ri(){var t,e,n,r,i,o,a,s=0,u=.5,c=1,l=1,h=mt,f=!1;function d(t){return isNaN(t=+t)?a:(t=.5+((t=+o(t))-e)*(l*t<l*e?r:i),h(f?Math.max(0,Math.min(1,t)):t))}function g(t){return function(e){var n,r,i;return arguments.length?([n,r,i]=e,h=ni(t,[n,r,i]),d):[h(0),h(.5),h(1)]}}return d.domain=function(a){return arguments.length?([s,u,c]=a,t=o(s=+s),e=o(u=+u),n=o(c=+c),r=t===e?0:.5/(e-t),i=e===n?0:.5/(n-e),l=e<t?-1:1,d):[s,u,c]},d.clamp=function(t){return arguments.length?(f=!!t,d):f},d.interpolator=function(t){return arguments.length?(h=t,d):h},d.range=g(dt),d.rangeRound=g(gt),d.unknown=function(t){return arguments.length?(a=t,d):a},function(a){return o=a,t=a(s),e=a(u),n=a(c),r=t===e?0:.5/(e-t),i=e===n?0:.5/(n-e),l=e<t?-1:1,d}}function ii(){var t=qt(ri()(mt));return t.copy=function(){return Kr(t,ii())},o.apply(t,arguments)}function oi(){var t=Kt(ri()).domain([.1,1,10]);return t.copy=function(){return Kr(t,oi()).base(t.base())},o.apply(t,arguments)}function ai(){var t=Jt(ri());return t.copy=function(){return Kr(t,ai()).constant(t.constant())},o.apply(t,arguments)}function si(){var t=ie(ri());return t.copy=function(){return Kr(t,si()).exponent(t.exponent())},o.apply(t,arguments)}function ui(){return si.apply(null,arguments).exponent(.5)}_n=function(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,o=t.days,a=t.shortDays,s=t.months,u=t.shortMonths,c=On(i),l=Nn(i),h=On(o),f=Nn(o),d=On(a),g=Nn(a),p=On(s),v=Nn(s),m=On(u),y=Nn(u),b={a:function(t){return a[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return u[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:null,d:tr,e:tr,f:or,g:vr,G:yr,H:er,I:nr,j:rr,L:ir,m:ar,M:sr,p:function(t){return i[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:zr,s:Hr,S:ur,u:cr,U:lr,V:fr,w:dr,W:gr,x:null,X:null,y:pr,Y:mr,Z:br,"%":Ir},w={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return u[t.getUTCMonth()]},B:function(t){return s[t.getUTCMonth()]},c:null,d:wr,e:wr,f:Tr,g:Fr,G:jr,H:Mr,I:xr,j:_r,L:Er,m:Lr,M:Ar,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:zr,s:Hr,S:Sr,u:Cr,U:Pr,V:Or,w:Nr,W:Dr,x:null,X:null,y:Rr,Y:Ur,Z:qr,"%":Ir},M={a:function(t,e,n){var r=d.exec(e.slice(n));return r?(t.w=g.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(t,e,n){var r=h.exec(e.slice(n));return r?(t.w=f.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(t,e,n){var r=m.exec(e.slice(n));return r?(t.m=y.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(t,e,n){var r=p.exec(e.slice(n));return r?(t.m=v.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(t,n,r){return E(t,e,n,r)},d:Yn,e:Yn,f:Zn,g:In,G:qn,H:Vn,I:Vn,j:Bn,L:Kn,m:Gn,M:Wn,p:function(t,e,n){var r=c.exec(e.slice(n));return r?(t.p=l.get(r[0].toLowerCase()),n+r[0].length):-1},q:Hn,Q:$n,s:Jn,S:Xn,u:Rn,U:Fn,V:Un,w:Dn,W:jn,x:function(t,e,r){return E(t,n,e,r)},X:function(t,e,n){return E(t,r,e,n)},y:In,Y:qn,Z:zn,"%":Qn};function x(t,e){return function(n){var r,i,o,a=[],s=-1,u=0,c=t.length;for(n instanceof Date||(n=new Date(+n));++s<c;)37===t.charCodeAt(s)&&(a.push(t.slice(u,s)),null!=(i=Ln[r=t.charAt(++s)])?r=t.charAt(++s):i="e"===r?" ":"0",(o=e[r])&&(r=o(n,i)),a.push(r),u=s+1);return a.push(t.slice(u,s)),a.join("")}}function _(t,e){return function(n){var r,i,o=xn(1900,void 0,1);if(E(o,t,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(e&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=Mn(xn(o.y,0,1))).getUTCDay(),r=i>4||0===i?on.ceil(r):on(r),r=en.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=wn(xn(o.y,0,1))).getDay(),r=i>4||0===i?Ie.ceil(r):Ie(r),r=Ue.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?Mn(xn(o.y,0,1)).getUTCDay():wn(xn(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Mn(o)):wn(o)}}function E(t,e,n,r){for(var i,o,a=0,s=e.length,u=n.length;a<s;){if(r>=u)return-1;if(37===(i=e.charCodeAt(a++))){if(i=e.charAt(a++),!(o=M[i in Ln?e.charAt(a++):i])||(r=o(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=x(n,b),b.X=x(r,b),b.c=x(e,b),w.x=x(n,w),w.X=x(r,w),w.c=x(e,w),{format:function(t){var e=x(t+="",b);return e.toString=function(){return t},e},parse:function(t){var e=_(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=x(t+="",w);return e.toString=function(){return t},e},utcParse:function(t){var e=_(t+="",!0);return e.toString=function(){return t},e}}}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),En=_n.format,_n.parse,Tn=_n.utcFormat,_n.utcParse},6276:(t,e,n)=>{var r=n(3533),i=n(3018),o={attributes:{x:"x",y:"y"},center:.5,scale:1};function a(t,e,n){if(!i(e))throw new Error("graphology-layout/random: the given graph is not a valid graphology instance.");n=r(n,o);var a,s,u,c,l={},h=e.nodes(),f=n.center,d=n.scale,g=2*Math.PI,p=h.length;for(c=0;c<p;c++)a=h[c],s=d*Math.cos(c*g/p),u=d*Math.sin(c*g/p),.5!==f&&(s+=f-.5*d,u+=f-.5*d),l[a]={x:s,y:u},t&&(e.setNodeAttribute(a,n.attributes.x,s),e.setNodeAttribute(a,n.attributes.y,u));return l}var s=a.bind(null,!1);s.assign=a.bind(null,!0),t.exports=s},9317:(t,e)=>{"use strict";function n(t){if(0===t.length)return 0;for(var e,n=t[0],r=0,i=1;i<t.length;i++)e=n+t[i],Math.abs(n)>=Math.abs(t[i])?r+=n-e+t[i]:r+=t[i]-e+n,n=e;return n+r}function r(t){if(0===t.length)throw new Error("mean requires at least one data point");return n(t)/t.length}function i(t,e){var n,i,o=r(t),a=0;if(2===e)for(i=0;i<t.length;i++)a+=(n=t[i]-o)*n;else for(i=0;i<t.length;i++)a+=Math.pow(t[i]-o,e);return a}function o(t){if(0===t.length)throw new Error("variance requires at least one data point");return i(t,2)/t.length}function a(t){if(1===t.length)return 0;var e=o(t);return Math.sqrt(e)}function s(t){if(0===t.length)throw new Error("mode requires at least one data point");if(1===t.length)return t[0];for(var e=t[0],n=NaN,r=0,i=1,o=1;o<t.length+1;o++)t[o]!==e?(i>r&&(r=i,n=e),i=1,e=t[o]):i++;return n}function u(t){return t.slice().sort((function(t,e){return t-e}))}function c(t){if(0===t.length)throw new Error("min requires at least one data point");for(var e=t[0],n=1;n<t.length;n++)t[n]<e&&(e=t[n]);return e}function l(t){if(0===t.length)throw new Error("max requires at least one data point");for(var e=t[0],n=1;n<t.length;n++)t[n]>e&&(e=t[n]);return e}function h(t){for(var e=0,n=0;n<t.length;n++)e+=t[n];return e}function f(t,e){var n=t.length*e;if(0===t.length)throw new Error("quantile requires at least one data point.");if(e<0||e>1)throw new Error("quantiles must be between 0 and 1");return 1===e?t[t.length-1]:0===e?t[0]:n%1!=0?t[Math.ceil(n)-1]:t.length%2==0?(t[n-1]+t[n])/2:t[n]}function d(t,e,n,r){for(n=n||0,r=r||t.length-1;r>n;){if(r-n>600){var i=r-n+1,o=e-n+1,a=Math.log(i),s=.5*Math.exp(2*a/3),u=.5*Math.sqrt(a*s*(i-s)/i);o-i/2<0&&(u*=-1),d(t,e,Math.max(n,Math.floor(e-o*s/i+u)),Math.min(r,Math.floor(e+(i-o)*s/i+u)))}var c=t[e],l=n,h=r;for(g(t,n,e),t[r]>c&&g(t,n,r);l<h;){for(g(t,l,h),l++,h--;t[l]<c;)l++;for(;t[h]>c;)h--}t[n]===c?g(t,n,h):g(t,++h,r),h<=e&&(n=h+1),e<=h&&(r=h-1)}}function g(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function p(t,e){var n=t.slice();if(Array.isArray(e)){!function(t,e){for(var n=[0],r=0;r<e.length;r++)n.push(y(t.length,e[r]));n.push(t.length-1),n.sort(m);for(var i=[0,n.length-1];i.length;){var o=Math.ceil(i.pop()),a=Math.floor(i.pop());if(!(o-a<=1)){var s=Math.floor((a+o)/2);v(t,n[s],Math.floor(n[a]),Math.ceil(n[o])),i.push(a,s,s,o)}}}(n,e);for(var r=[],i=0;i<e.length;i++)r[i]=f(n,e[i]);return r}return v(n,y(n.length,e),0,n.length-1),f(n,e)}function v(t,e,n,r){e%1==0?d(t,e,n,r):(d(t,e=Math.floor(e),n,r),d(t,e+1,e+1,r))}function m(t,e){return t-e}function y(t,e){var n=t*e;return 1===e?t-1:0===e?0:n%1!=0?Math.ceil(n)-1:t%2==0?n-.5:n}function b(t,e){if(e<t[0])return 0;if(e>t[t.length-1])return 1;var n=function(t,e){for(var n=0,r=0,i=t.length;r<i;)e<=t[n=r+i>>>1]?i=n:r=-~n;return r}(t,e);if(t[n]!==e)return n/t.length;n++;var r=function(t,e){for(var n=0,r=0,i=t.length;r<i;)e>=t[n=r+i>>>1]?r=-~n:i=n;return r}(t,e);if(r===n)return n/t.length;var i=r-n+1;return i*(r+n)/2/i/t.length}function w(t){var e=p(t,.75),n=p(t,.25);if("number"==typeof e&&"number"==typeof n)return e-n}function M(t){return+p(t,.5)}function x(t){for(var e=M(t),n=[],r=0;r<t.length;r++)n.push(Math.abs(t[r]-e));return M(n)}function _(t,e){e=e||Math.random;for(var n,r,i=t.length;i>0;)r=Math.floor(e()*i--),n=t[i],t[i]=t[r],t[r]=n;return t}function E(t,e){return _(t.slice(),e)}function T(t,e,n){return E(t,n).slice(0,e)}function L(t,e){for(var n=[],r=0;r<t;r++){for(var i=[],o=0;o<e;o++)i.push(0);n.push(i)}return n}function A(t){for(var e,n=0,r=0;r<t.length;r++)0!==r&&t[r]===e||(e=t[r],n++);return n}function S(t,e,n,r){var i;if(t>0){var o=(n[e]-n[t-1])/(e-t+1);i=r[e]-r[t-1]-(e-t+1)*o*o}else i=r[e]-n[e]*n[e]/(e+1);return i<0?0:i}function C(t,e,n,r,i,o,a){if(!(t>e)){var s=Math.floor((t+e)/2);r[n][s]=r[n-1][s-1],i[n][s]=s;var u=n;t>n&&(u=Math.max(u,i[n][t-1]||0)),u=Math.max(u,i[n-1][s]||0);var c,l,h,f=s-1;e<r[0].length-1&&(f=Math.min(f,i[n][e+1]||0));for(var d=f;d>=u&&!((c=S(d,s,o,a))+r[n-1][u-1]>=r[n][s]);--d)(l=S(u,s,o,a)+r[n-1][u-1])<r[n][s]&&(r[n][s]=l,i[n][s]=u),u++,(h=c+r[n-1][d-1])<r[n][s]&&(r[n][s]=h,i[n][s]=d);C(t,s-1,n,r,i,o,a),C(s+1,e,n,r,i,o,a)}}function P(t,e){if(t.length!==e.length)throw new Error("sampleCovariance requires samples with equal lengths");if(t.length<2)throw new Error("sampleCovariance requires at least two data points in each sample");for(var n=r(t),i=r(e),o=0,a=0;a<t.length;a++)o+=(t[a]-n)*(e[a]-i);return o/(t.length-1)}function k(t){if(t.length<2)throw new Error("sampleVariance requires at least two data points");return i(t,2)/(t.length-1)}function O(t){var e=k(t);return Math.sqrt(e)}function N(t,e){return P(t,e)/O(t)/O(e)}function D(t,e,n,r){return(t*e+n*r)/(e+r)}function R(t){if(0===t.length)throw new Error("meanSimple requires at least one data point");return h(t)/t.length}function F(t){if(0===t.length)throw new Error("rootMeanSquare requires at least one data point");for(var e=0,n=0;n<t.length;n++)e+=Math.pow(t[n],2);return Math.sqrt(e/t.length)}Object.defineProperty(e,"__esModule",{value:!0});var U=function(){this.totalCount=0,this.data={}};U.prototype.train=function(t,e){for(var n in this.data[e]||(this.data[e]={}),t){var r=t[n];void 0===this.data[e][n]&&(this.data[e][n]={}),void 0===this.data[e][n][r]&&(this.data[e][n][r]=0),this.data[e][n][r]++}this.totalCount++},U.prototype.score=function(t){var e,n={};for(var r in t){var i=t[r];for(e in this.data)n[e]={},this.data[e][r]?n[e][r+"_"+i]=(this.data[e][r][i]||0)/this.totalCount:n[e][r+"_"+i]=0}var o={};for(e in n)for(var a in o[e]=0,n[e])o[e]+=n[e][a];return o};var j=function(){this.weights=[],this.bias=0};j.prototype.predict=function(t){if(t.length!==this.weights.length)return null;for(var e=0,n=0;n<this.weights.length;n++)e+=this.weights[n]*t[n];return(e+=this.bias)>0?1:0},j.prototype.train=function(t,e){if(0!==e&&1!==e)return null;t.length!==this.weights.length&&(this.weights=t,this.bias=1);var n=this.predict(t);if("number"==typeof n&&n!==e){for(var r=e-n,i=0;i<this.weights.length;i++)this.weights[i]+=r*t[i];this.bias+=r}return this};var q=1e-4;function I(t){if(t<0)throw new Error("factorial requires a non-negative value");if(Math.floor(t)!==t)throw new Error("factorial requires an integer input");for(var e=1,n=2;n<=t;n++)e*=n;return e}var z=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22],H=Math.log(Math.sqrt(2*Math.PI)),G={1:{.995:0,.99:0,.975:0,.95:0,.9:.02,.5:.45,.1:2.71,.05:3.84,.025:5.02,.01:6.63,.005:7.88},2:{.995:.01,.99:.02,.975:.05,.95:.1,.9:.21,.5:1.39,.1:4.61,.05:5.99,.025:7.38,.01:9.21,.005:10.6},3:{.995:.07,.99:.11,.975:.22,.95:.35,.9:.58,.5:2.37,.1:6.25,.05:7.81,.025:9.35,.01:11.34,.005:12.84},4:{.995:.21,.99:.3,.975:.48,.95:.71,.9:1.06,.5:3.36,.1:7.78,.05:9.49,.025:11.14,.01:13.28,.005:14.86},5:{.995:.41,.99:.55,.975:.83,.95:1.15,.9:1.61,.5:4.35,.1:9.24,.05:11.07,.025:12.83,.01:15.09,.005:16.75},6:{.995:.68,.99:.87,.975:1.24,.95:1.64,.9:2.2,.5:5.35,.1:10.65,.05:12.59,.025:14.45,.01:16.81,.005:18.55},7:{.995:.99,.99:1.25,.975:1.69,.95:2.17,.9:2.83,.5:6.35,.1:12.02,.05:14.07,.025:16.01,.01:18.48,.005:20.28},8:{.995:1.34,.99:1.65,.975:2.18,.95:2.73,.9:3.49,.5:7.34,.1:13.36,.05:15.51,.025:17.53,.01:20.09,.005:21.96},9:{.995:1.73,.99:2.09,.975:2.7,.95:3.33,.9:4.17,.5:8.34,.1:14.68,.05:16.92,.025:19.02,.01:21.67,.005:23.59},10:{.995:2.16,.99:2.56,.975:3.25,.95:3.94,.9:4.87,.5:9.34,.1:15.99,.05:18.31,.025:20.48,.01:23.21,.005:25.19},11:{.995:2.6,.99:3.05,.975:3.82,.95:4.57,.9:5.58,.5:10.34,.1:17.28,.05:19.68,.025:21.92,.01:24.72,.005:26.76},12:{.995:3.07,.99:3.57,.975:4.4,.95:5.23,.9:6.3,.5:11.34,.1:18.55,.05:21.03,.025:23.34,.01:26.22,.005:28.3},13:{.995:3.57,.99:4.11,.975:5.01,.95:5.89,.9:7.04,.5:12.34,.1:19.81,.05:22.36,.025:24.74,.01:27.69,.005:29.82},14:{.995:4.07,.99:4.66,.975:5.63,.95:6.57,.9:7.79,.5:13.34,.1:21.06,.05:23.68,.025:26.12,.01:29.14,.005:31.32},15:{.995:4.6,.99:5.23,.975:6.27,.95:7.26,.9:8.55,.5:14.34,.1:22.31,.05:25,.025:27.49,.01:30.58,.005:32.8},16:{.995:5.14,.99:5.81,.975:6.91,.95:7.96,.9:9.31,.5:15.34,.1:23.54,.05:26.3,.025:28.85,.01:32,.005:34.27},17:{.995:5.7,.99:6.41,.975:7.56,.95:8.67,.9:10.09,.5:16.34,.1:24.77,.05:27.59,.025:30.19,.01:33.41,.005:35.72},18:{.995:6.26,.99:7.01,.975:8.23,.95:9.39,.9:10.87,.5:17.34,.1:25.99,.05:28.87,.025:31.53,.01:34.81,.005:37.16},19:{.995:6.84,.99:7.63,.975:8.91,.95:10.12,.9:11.65,.5:18.34,.1:27.2,.05:30.14,.025:32.85,.01:36.19,.005:38.58},20:{.995:7.43,.99:8.26,.975:9.59,.95:10.85,.9:12.44,.5:19.34,.1:28.41,.05:31.41,.025:34.17,.01:37.57,.005:40},21:{.995:8.03,.99:8.9,.975:10.28,.95:11.59,.9:13.24,.5:20.34,.1:29.62,.05:32.67,.025:35.48,.01:38.93,.005:41.4},22:{.995:8.64,.99:9.54,.975:10.98,.95:12.34,.9:14.04,.5:21.34,.1:30.81,.05:33.92,.025:36.78,.01:40.29,.005:42.8},23:{.995:9.26,.99:10.2,.975:11.69,.95:13.09,.9:14.85,.5:22.34,.1:32.01,.05:35.17,.025:38.08,.01:41.64,.005:44.18},24:{.995:9.89,.99:10.86,.975:12.4,.95:13.85,.9:15.66,.5:23.34,.1:33.2,.05:36.42,.025:39.36,.01:42.98,.005:45.56},25:{.995:10.52,.99:11.52,.975:13.12,.95:14.61,.9:16.47,.5:24.34,.1:34.28,.05:37.65,.025:40.65,.01:44.31,.005:46.93},26:{.995:11.16,.99:12.2,.975:13.84,.95:15.38,.9:17.29,.5:25.34,.1:35.56,.05:38.89,.025:41.92,.01:45.64,.005:48.29},27:{.995:11.81,.99:12.88,.975:14.57,.95:16.15,.9:18.11,.5:26.34,.1:36.74,.05:40.11,.025:43.19,.01:46.96,.005:49.65},28:{.995:12.46,.99:13.57,.975:15.31,.95:16.93,.9:18.94,.5:27.34,.1:37.92,.05:41.34,.025:44.46,.01:48.28,.005:50.99},29:{.995:13.12,.99:14.26,.975:16.05,.95:17.71,.9:19.77,.5:28.34,.1:39.09,.05:42.56,.025:45.72,.01:49.59,.005:52.34},30:{.995:13.79,.99:14.95,.975:16.79,.95:18.49,.9:20.6,.5:29.34,.1:40.26,.05:43.77,.025:46.98,.01:50.89,.005:53.67},40:{.995:20.71,.99:22.16,.975:24.43,.95:26.51,.9:29.05,.5:39.34,.1:51.81,.05:55.76,.025:59.34,.01:63.69,.005:66.77},50:{.995:27.99,.99:29.71,.975:32.36,.95:34.76,.9:37.69,.5:49.33,.1:63.17,.05:67.5,.025:71.42,.01:76.15,.005:79.49},60:{.995:35.53,.99:37.48,.975:40.48,.95:43.19,.9:46.46,.5:59.33,.1:74.4,.05:79.08,.025:83.3,.01:88.38,.005:91.95},70:{.995:43.28,.99:45.44,.975:48.76,.95:51.74,.9:55.33,.5:69.33,.1:85.53,.05:90.53,.025:95.02,.01:100.42,.005:104.22},80:{.995:51.17,.99:53.54,.975:57.15,.95:60.39,.9:64.28,.5:79.33,.1:96.58,.05:101.88,.025:106.63,.01:112.33,.005:116.32},90:{.995:59.2,.99:61.75,.975:65.65,.95:69.13,.9:73.29,.5:89.33,.1:107.57,.05:113.14,.025:118.14,.01:124.12,.005:128.3},100:{.995:67.33,.99:70.06,.975:74.22,.95:77.93,.9:82.36,.5:99.33,.1:118.5,.05:124.34,.025:129.56,.01:135.81,.005:140.17}},Y=Math.sqrt(2*Math.PI),B={gaussian:function(t){return Math.exp(-.5*t*t)/Y}},V={nrd:function(t){var e=O(t),n=w(t);return"number"==typeof n&&(e=Math.min(e,n/1.34)),1.06*e*Math.pow(t.length,-.2)}};function W(t,e,n){var r,i;if(void 0===e)r=B.gaussian;else if("string"==typeof e){if(!B[e])throw new Error('Unknown kernel "'+e+'"');r=B[e]}else r=e;if(void 0===n)i=V.nrd(t);else if("string"==typeof n){if(!V[n])throw new Error('Unknown bandwidth method "'+n+'"');i=V[n](t)}else i=n;return function(e){var n=0,o=0;for(n=0;n<t.length;n++)o+=r((e-t[n])/i);return o/i/t.length}}var X=Math.sqrt(2*Math.PI);function K(t){for(var e=t,n=t,r=1;r<15;r++)e+=n*=t*t/(2*r+1);return Math.round(1e4*(.5+e/X*Math.exp(-t*t/2)))/1e4}for(var Z=[],Q=0;Q<=3.09;Q+=.01)Z.push(K(Q));function $(t){var e=1/(1+.5*Math.abs(t)),n=e*Math.exp(-t*t+((((((((.17087277*e-.82215223)*e+1.48851587)*e-1.13520398)*e+.27886807)*e-.18628806)*e+.09678418)*e+.37409196)*e+1.00002368)*e-1.26551223);return t>=0?1-n:n-1}function J(t){var e=8*(Math.PI-3)/(3*Math.PI*(4-Math.PI)),n=Math.sqrt(Math.sqrt(Math.pow(2/(Math.PI*e)+Math.log(1-t*t)/2,2)-Math.log(1-t*t)/e)-(2/(Math.PI*e)+Math.log(1-t*t)/2));return t>=0?n:-n}function tt(t){if("number"==typeof t)return t<0?-1:0===t?0:1;throw new TypeError("not a number")}function et(t,e){for(var n=0,r=0;r<t.length;r++){var i=t[r]-e[r];n+=i*i}return Math.sqrt(n)}function nt(t,e){return t.map((function(t){for(var n=Number.MAX_VALUE,r=-1,i=0;i<e.length;i++){var o=et(t,e[i]);o<n&&(n=o,r=i)}return r}))}function rt(t,e,n){for(var r=t[0].length,i=L(n,r),o=Array(n).fill(0),a=t.length,s=0;s<a;s++){for(var u=t[s],c=e[s],l=i[c],h=0;h<r;h++)l[h]+=u[h];o[c]+=1}for(var f=0;f<n;f++){if(0===o[f])throw new Error("Centroid "+f+" has no friends");for(var d=i[f],g=0;g<r;g++)d[g]/=o[f]}return i}function it(t,e){for(var n=0,r=0;r<t.length;r++)n+=et(t[r],e[r]);return n}function ot(t,e){if(t.length!==e.length)throw new Error("must have exactly as many labels as points");for(var n=function(t){for(var e=1+l(t),n=Array(e),r=0;r<t.length;r++){var i=t[r];void 0===n[i]&&(n[i]=[]),n[i].push(r)}return n}(e),r=function(t){for(var e=t.length,n=L(e,e),r=0;r<e;r++)for(var i=0;i<r;i++)n[r][i]=et(t[r],t[i]),n[i][r]=n[r][i];return n}(t),i=[],o=0;o<t.length;o++){var a=0;if(n[e[o]].length>1){var s=st(o,n[e[o]],r),u=at(o,e,n,r);a=(u-s)/Math.max(s,u)}i.push(a)}return i}function at(t,e,n,r){for(var i=e[t],o=Number.MAX_VALUE,a=0;a<n.length;a++)if(a!==i){var s=st(t,n[a],r);s<o&&(o=s)}return o}function st(t,e,n){for(var r=0,i=0;i<e.length;i++)r+=n[t][e[i]];return r/e.length}function ut(t,e){return 0===t&&0===e?0:Math.abs((t-e)/e)}e.BayesianClassifier=U,e.PerceptronModel=j,e.addToMean=function(t,e,n){return t+(n-t)/(e+1)},e.approxEqual=function(t,e,n){return void 0===n&&(n=q),ut(t,e)<=n},e.average=r,e.averageSimple=R,e.bayesian=U,e.bernoulliDistribution=function(t){if(t<0||t>1)throw new Error("bernoulliDistribution requires probability to be between 0 and 1 inclusive");return[1-t,t]},e.binomialDistribution=function(t,e){if(!(e<0||e>1||t<=0||t%1!=0)){var n=0,r=0,i=[],o=1;do{i[n]=o*Math.pow(e,n)*Math.pow(1-e,t-n),r+=i[n],o=o*(t-++n+1)/n}while(r<.9999);return i}},e.bisect=function(t,e,n,r,i){if("function"!=typeof t)throw new TypeError("func must be a function");for(var o=0;o<r;o++){var a=(e+n)/2;if(0===t(a)||Math.abs((n-e)/2)<i)return a;tt(t(a))===tt(t(e))?e=a:n=a}throw new Error("maximum number of iterations exceeded")},e.chiSquaredDistributionTable=G,e.chiSquaredGoodnessOfFit=function(t,e,n){for(var i=0,o=e(r(t)),a=[],s=[],u=0;u<t.length;u++)void 0===a[t[u]]&&(a[t[u]]=0),a[t[u]]++;for(var c=0;c<a.length;c++)void 0===a[c]&&(a[c]=0);for(var l in o)l in a&&(s[+l]=o[l]*t.length);for(var h=s.length-1;h>=0;h--)s[h]<3&&(s[h-1]+=s[h],s.pop(),a[h-1]+=a[h],a.pop());for(var f=0;f<a.length;f++)i+=Math.pow(a[f]-s[f],2)/s[f];var d=a.length-1-1;return G[d][n]<i},e.chunk=function(t,e){var n=[];if(e<1)throw new Error("chunk size must be a positive number");if(Math.floor(e)!==e)throw new Error("chunk size must be an integer");for(var r=0;r<t.length;r+=e)n.push(t.slice(r,r+e));return n},e.ckmeans=function(t,e){if(e>t.length)throw new Error("cannot generate more classes than there are data values");var n=u(t);if(1===A(n))return[n];var r=L(e,n.length),i=L(e,n.length);!function(t,e,n){for(var r=e[0].length,i=t[Math.floor(r/2)],o=[],a=[],s=0,u=void 0;s<r;++s)u=t[s]-i,0===s?(o.push(u),a.push(u*u)):(o.push(o[s-1]+u),a.push(a[s-1]+u*u)),e[0][s]=S(0,s,o,a),n[0][s]=0;for(var c=1;c<e.length;++c)C(c<e.length-1?c:r-1,r-1,c,e,n,o,a)}(n,r,i);for(var o=[],a=i[0].length-1,s=i.length-1;s>=0;s--){var c=i[s][a];o[s]=n.slice(c,a+1),s>0&&(a=c-1)}return o},e.coefficientOfVariation=function(t){return O(t)/r(t)},e.combinations=function t(e,n){var r,i,o,a,s=[];for(r=0;r<e.length;r++)if(1===n)s.push([e[r]]);else for(o=t(e.slice(r+1,e.length),n-1),i=0;i<o.length;i++)(a=o[i]).unshift(e[r]),s.push(a);return s},e.combinationsReplacement=function t(e,n){for(var r=[],i=0;i<e.length;i++)if(1===n)r.push([e[i]]);else for(var o=t(e.slice(i,e.length),n-1),a=0;a<o.length;a++)r.push([e[i]].concat(o[a]));return r},e.combineMeans=D,e.combineVariances=function(t,e,n,r,i,o){var a=D(e,n,i,o);return(n*(t+Math.pow(e-a,2))+o*(r+Math.pow(i-a,2)))/(n+o)},e.cumulativeStdLogisticProbability=function(t){return 1/(Math.exp(-t)+1)},e.cumulativeStdNormalProbability=function(t){var e=Math.abs(t),n=Math.min(Math.round(100*e),Z.length-1);return t>=0?Z[n]:+(1-Z[n]).toFixed(4)},e.epsilon=q,e.equalIntervalBreaks=function(t,e){if(t.length<2)return t;for(var n=c(t),r=l(t),i=[n],o=(r-n)/e,a=1;a<e;a++)i.push(i[0]+o*a);return i.push(r),i},e.erf=$,e.errorFunction=$,e.extent=function(t){if(0===t.length)throw new Error("extent requires at least one data point");for(var e=t[0],n=t[0],r=1;r<t.length;r++)t[r]>n&&(n=t[r]),t[r]<e&&(e=t[r]);return[e,n]},e.extentSorted=function(t){return[t[0],t[t.length-1]]},e.factorial=I,e.gamma=function t(e){if(Number.isInteger(e))return e<=0?NaN:I(e-1);if(--e<0)return Math.PI/(Math.sin(Math.PI*-e)*t(-e));var n=e+1/4;return Math.pow(e/Math.E,e)*Math.sqrt(2*Math.PI*(e+1/6))*(1+1/144/Math.pow(n,2)-1/12960/Math.pow(n,3)-257/207360/Math.pow(n,4)-52/2612736/Math.pow(n,5)+5741173/9405849600/Math.pow(n,6)+37529/18811699200/Math.pow(n,7))},e.gammaln=function(t){if(t<=0)return 1/0;t--;for(var e=z[0],n=1;n<15;n++)e+=z[n]/(t+n);var r=5.2421875+t;return H+Math.log(e)-r+(t+.5)*Math.log(r)},e.geometricMean=function(t){if(0===t.length)throw new Error("geometricMean requires at least one data point");for(var e=1,n=0;n<t.length;n++){if(t[n]<0)throw new Error("geometricMean requires only non-negative numbers as input");e*=t[n]}return Math.pow(e,1/t.length)},e.harmonicMean=function(t){if(0===t.length)throw new Error("harmonicMean requires at least one data point");for(var e=0,n=0;n<t.length;n++){if(t[n]<=0)throw new Error("harmonicMean requires only positive numbers as input");e+=1/t[n]}return t.length/e},e.interquartileRange=w,e.inverseErrorFunction=J,e.iqr=w,e.kMeansCluster=function(t,e,n){void 0===n&&(n=Math.random);for(var r=null,i=T(t,e,n),o=null,a=Number.MAX_VALUE;0!==a;)r=i,a=it(i=rt(t,o=nt(t,i),e),r);return{labels:o,centroids:i}},e.kde=W,e.kernelDensityEstimation=W,e.linearRegression=function(t){var e,n,r=t.length;if(1===r)e=0,n=t[0][1];else{for(var i,o,a,s=0,u=0,c=0,l=0,h=0;h<r;h++)s+=o=(i=t[h])[0],u+=a=i[1],c+=o*o,l+=o*a;n=u/r-(e=(r*l-s*u)/(r*c-s*s))*s/r}return{m:e,b:n}},e.linearRegressionLine=function(t){return function(e){return t.b+t.m*e}},e.logAverage=function(t){if(0===t.length)throw new Error("logAverage requires at least one data point");for(var e=0,n=0;n<t.length;n++){if(t[n]<0)throw new Error("logAverage requires only non-negative numbers as input");e+=Math.log(t[n])}return Math.exp(e/t.length)},e.logit=function(t){if(t<=0||t>=1)throw new Error("p must be strictly between zero and one");return Math.log(t/(1-t))},e.mad=x,e.max=l,e.maxSorted=function(t){return t[t.length-1]},e.mean=r,e.meanSimple=R,e.median=M,e.medianAbsoluteDeviation=x,e.medianSorted=function(t){return f(t,.5)},e.min=c,e.minSorted=function(t){return t[0]},e.mode=function(t){return s(u(t))},e.modeFast=function(t){for(var e,n=new Map,r=0,i=0;i<t.length;i++){var o=n.get(t[i]);void 0===o?o=1:o++,o>r&&(e=t[i],r=o),n.set(t[i],o)}if(0===r)throw new Error("mode requires at last one data point");return e},e.modeSorted=s,e.numericSort=u,e.perceptron=j,e.permutationTest=function(t,e,n,i,o){if(void 0===i&&(i=1e4),void 0===n&&(n="two_side"),"two_side"!==n&&"greater"!==n&&"less"!==n)throw new Error("`alternative` must be either 'two_side', 'greater', or 'less'");for(var a=r(t)-r(e),s=new Array(i),u=t.concat(e),c=Math.floor(u.length/2),l=0;l<i;l++){_(u,o);var h=u.slice(0,c),f=u.slice(c,u.length),d=r(h)-r(f);s[l]=d}var g=0;if("two_side"===n)for(var p=0;p<=i;p++)Math.abs(s[p])>=Math.abs(a)&&(g+=1);else if("greater"===n)for(var v=0;v<=i;v++)s[v]>=a&&(g+=1);else for(var m=0;m<=i;m++)s[m]<=a&&(g+=1);return g/i},e.permutationsHeap=function(t){for(var e=new Array(t.length),n=[t.slice()],r=0;r<t.length;r++)e[r]=0;for(var i=0;i<t.length;)if(e[i]<i){var o=0;i%2!=0&&(o=e[i]);var a=t[o];t[o]=t[i],t[i]=a,n.push(t.slice()),e[i]++,i=0}else e[i]=0,i++;return n},e.poissonDistribution=function(t){if(!(t<=0)){var e=0,n=0,r=[],i=1;do{r[e]=Math.exp(-t)*Math.pow(t,e)/i,n+=r[e],i*=++e}while(n<.9999);return r}},e.probit=function(t){return 0===t?t=q:t>=1&&(t=.9999),Math.sqrt(2)*J(2*t-1)},e.product=function(t){for(var e=1,n=0;n<t.length;n++)e*=t[n];return e},e.quantile=p,e.quantileRank=function(t,e){return b(u(t),e)},e.quantileRankSorted=b,e.quantileSorted=f,e.quickselect=d,e.rSquared=function(t,e){if(t.length<2)return 1;for(var n=0,r=0;r<t.length;r++)n+=t[r][1];for(var i=n/t.length,o=0,a=0;a<t.length;a++)o+=Math.pow(i-t[a][1],2);for(var s=0,u=0;u<t.length;u++)s+=Math.pow(t[u][1]-e(t[u][0]),2);return 1-s/o},e.relativeError=ut,e.rms=F,e.rootMeanSquare=F,e.sample=T,e.sampleCorrelation=N,e.sampleCovariance=P,e.sampleKurtosis=function(t){var e=t.length;if(e<4)throw new Error("sampleKurtosis requires at least four data points");for(var n,i=r(t),o=0,a=0,s=0;s<e;s++)o+=(n=t[s]-i)*n,a+=n*n*n*n;return(e-1)/((e-2)*(e-3))*(e*(e+1)*a/(o*o)-3*(e-1))},e.sampleRankCorrelation=function(t,e){for(var n=t.map((function(t,e){return[t,e]})).sort((function(t,e){return t[0]-e[0]})).map((function(t){return t[1]})),r=e.map((function(t,e){return[t,e]})).sort((function(t,e){return t[0]-e[0]})).map((function(t){return t[1]})),i=Array(n.length),o=Array(n.length),a=0;a<n.length;a++)i[n[a]]=a,o[r[a]]=a;return N(i,o)},e.sampleSkewness=function(t){if(t.length<3)throw new Error("sampleSkewness requires at least three data points");for(var e,n=r(t),i=0,o=0,a=0;a<t.length;a++)i+=(e=t[a]-n)*e,o+=e*e*e;var s=t.length-1,u=Math.sqrt(i/s),c=t.length;return c*o/((c-1)*(c-2)*Math.pow(u,3))},e.sampleStandardDeviation=O,e.sampleVariance=k,e.sampleWithReplacement=function(t,e,n){if(0===t.length)return[];n=n||Math.random;for(var r=t.length,i=[],o=0;o<e;o++){var a=Math.floor(n()*r);i.push(t[a])}return i},e.shuffle=E,e.shuffleInPlace=_,e.sign=tt,e.silhouette=ot,e.silhouetteMetric=function(t,e){return l(ot(t,e))},e.standardDeviation=a,e.standardNormalTable=Z,e.subtractFromMean=function(t,e,n){return(t*e-n)/(e-1)},e.sum=n,e.sumNthPowerDeviations=i,e.sumSimple=h,e.tTest=function(t,e){return(r(t)-e)/(a(t)/Math.sqrt(t.length))},e.tTestTwoSample=function(t,e,n){var i=t.length,o=e.length;if(!i||!o)return null;n||(n=0);var a=r(t),s=r(e),u=k(t),c=k(e);if("number"==typeof a&&"number"==typeof s&&"number"==typeof u&&"number"==typeof c){var l=((i-1)*u+(o-1)*c)/(i+o-2);return(a-s-n)/Math.sqrt(l*(1/i+1/o))}},e.uniqueCountSorted=A,e.variance=o,e.wilcoxonRankSum=function(t,e){if(!t.length||!e.length)throw new Error("Neither sample can be empty");for(var n=t.map((function(t){return{label:"x",value:t}})).concat(e.map((function(t){return{label:"y",value:t}}))).sort((function(t,e){return t.value-e.value})),r=0;r<n.length;r++)n[r].rank=r;for(var i=[n[0].rank],o=1;o<n.length;o++)n[o].value===n[o-1].value?(i.push(n[o].rank),o===n.length-1&&a(n,i)):i.length>1?a(n,i):i=[n[o].rank];function a(t,e){for(var n=(e[0]+e[e.length-1])/2,r=0;r<e.length;r++)t[e[r]].rank=n}for(var s=0,u=0;u<n.length;u++){var c=n[u];"x"===c.label&&(s+=c.rank+1)}return s},e.zScore=function(t,e,n){return(t-e)/n}},7108:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(9807),o=r(n(6276)),a=n(145),s=n(9317),u=r(n(6270)),c=n(9960),l=r(n(6662)),h=n(7610),f=new i.UndirectedGraph,d=s.extent(l.default.nodes.map((function(t){return t.size}))),g=s.extent(l.default.nodes.map((function(t){return t.x}))),p=s.extent(l.default.nodes.map((function(t){return t.y}))),v=a.scaleLinear().domain(d).range([3,15]),m=a.scaleLinear().domain(g).range([0,1]),y=a.scaleLinear().domain(p).range([0,1]);l.default.nodes.forEach((function(t){t.size=v(t.size),t.x=m(t.x),t.y=y(t.y)})),l.default.nodes.forEach((function(t,e){f.addNode(e,t)})),l.default.edges.forEach((function(t){f.addEdge(+t.source,+t.target,{color:"#ccc"})}));var b=document.getElementById("container"),w=new u.default(f,b),M={};l.default.nodes.forEach((function(t,e){M[e]={x:t.x,y:t.y}}));var x=o.default(f),_=!1;!function t(){var e=_?M:x;c.animateNodes(f,e,{duration:2e3},(function(){_=!_,t()}))}(),h.globalize({graph:f,renderer:w})},3188:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,n,r,i){var o=i.edgeLabelSize,a=i.edgeLabelFont,s=i.edgeLabelWeight,u=e.label;t.fillStyle=e.color,t.font=s+" "+o+"px "+a;var c,l=t.measureText(u).width,h=(n.x+r.x)/2,f=(n.y+r.y)/2,d=r.x-n.x,g=r.y-n.y,p=Math.sqrt(d*d+g*g);c=d>0?g>0?Math.acos(d/p):Math.asin(g/p):g>0?Math.acos(d/p)+Math.PI:Math.asin(d/p)+Math.PI/2,t.save(),t.translate(h,f),t.rotate(c),t.fillText(u,-l/2,e.size/2+o),t.restore()}},1040:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(4510)),o=r(n(9244));e.default=function(t,e,n){var r=n.labelSize,a=n.labelFont,s=n.labelWeight;t.font=s+" "+r+"px "+a,t.beginPath(),t.fillStyle="#fff",t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=8,t.shadowColor="#000";var u=t.measureText(e.label).width,c=Math.round(e.x-r/2-2),l=Math.round(e.y-r/2-2),h=Math.round(u+r/2+e.size+9),f=Math.round(r+4),d=Math.round(r/2+2);t.moveTo(c,l+d),t.moveTo(c,l+d),t.arcTo(c,l,c+d,l,d),t.lineTo(c+h,l),t.lineTo(c+h,l+f),t.lineTo(c+d,l+f),t.arcTo(c,l+f,c,l+f-d,d),t.lineTo(c,l+d),t.closePath(),t.fill(),t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0,i.default(t,e),o.default(t,e,n)}},9244:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,n){var r=n.labelSize,i=n.labelFont,o=n.labelWeight;t.fillStyle="#000",t.font=o+" "+r+"px "+i,t.fillText(e.label,e.x+e.size+3,e.y+r/3)}},4510:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=2*Math.PI;e.default=function(t,e){t.fillStyle=e.color,t.beginPath(),t.arc(e.x,e.y,e.size,0,n,!0),t.closePath(),t.fill()}},3680:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.createEdgeCompoundProgram=e.AbstractEdgeProgram=void 0;var o=function(t){function e(e,n,r,i,o){return t.call(this,e,n,r,i,o)||this}return i(e,t),e}(n(1256).AbstractProgram);e.AbstractEdgeProgram=o,e.createEdgeCompoundProgram=function(t){return function(){function e(e){this.programs=t.map((function(t){return new t(e)}))}return e.prototype.bufferData=function(){this.programs.forEach((function(t){return t.bufferData()}))},e.prototype.allocate=function(t){this.programs.forEach((function(e){return e.allocate(t)}))},e.prototype.bind=function(){},e.prototype.computeIndices=function(){this.programs.forEach((function(t){return t.computeIndices()}))},e.prototype.render=function(t){this.programs.forEach((function(e){e.bind(),e.bufferData(),e.render(t)}))},e.prototype.process=function(t,e,n,r,i){this.programs.forEach((function(o){return o.process(t,e,n,r,i)}))},e}()}},7379:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.createNodeCompoundProgram=e.AbstractNodeProgram=void 0;var o=function(t){function e(e,n,r,i,o){var a=t.call(this,e,n,r,i,o)||this;a.positionLocation=e.getAttribLocation(a.program,"a_position"),a.sizeLocation=e.getAttribLocation(a.program,"a_size"),a.colorLocation=e.getAttribLocation(a.program,"a_color");var s=e.getUniformLocation(a.program,"u_matrix");if(null===s)throw new Error("AbstractNodeProgram: error while getting matrixLocation");a.matrixLocation=s;var u=e.getUniformLocation(a.program,"u_ratio");if(null===u)throw new Error("AbstractNodeProgram: error while getting ratioLocation");a.ratioLocation=u;var c=e.getUniformLocation(a.program,"u_scale");if(null===c)throw new Error("AbstractNodeProgram: error while getting scaleLocation");return a.scaleLocation=c,a}return i(e,t),e.prototype.bind=function(){var t=this.gl;t.enableVertexAttribArray(this.positionLocation),t.enableVertexAttribArray(this.sizeLocation),t.enableVertexAttribArray(this.colorLocation),t.vertexAttribPointer(this.positionLocation,2,t.FLOAT,!1,this.attributes*Float32Array.BYTES_PER_ELEMENT,0),t.vertexAttribPointer(this.sizeLocation,1,t.FLOAT,!1,this.attributes*Float32Array.BYTES_PER_ELEMENT,8),t.vertexAttribPointer(this.colorLocation,4,t.UNSIGNED_BYTE,!0,this.attributes*Float32Array.BYTES_PER_ELEMENT,12)},e}(n(1256).AbstractProgram);e.AbstractNodeProgram=o,e.createNodeCompoundProgram=function(t){return function(){function e(e){this.programs=t.map((function(t){return new t(e)}))}return e.prototype.bufferData=function(){this.programs.forEach((function(t){return t.bufferData()}))},e.prototype.allocate=function(t){this.programs.forEach((function(e){return e.allocate(t)}))},e.prototype.bind=function(){},e.prototype.render=function(t){this.programs.forEach((function(e){return e.render(t)}))},e.prototype.process=function(t,e,n){this.programs.forEach((function(r){return r.process(t,e,n)}))},e}()}},1256:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractProgram=void 0;var r=n(2952),i=function(){function t(t,e,n,i,o){this.array=new Float32Array,this.points=i,this.attributes=o,this.gl=t,this.vertexShaderSource=e,this.fragmentShaderSource=n;var a=t.createBuffer();if(null===a)throw new Error("AbstractProgram: error while creating the buffer");this.buffer=a,t.bindBuffer(t.ARRAY_BUFFER,this.buffer),this.vertexShader=r.loadVertexShader(t,this.vertexShaderSource),this.fragmentShader=r.loadFragmentShader(t,this.fragmentShaderSource),this.program=r.loadProgram(t,[this.vertexShader,this.fragmentShader])}return t.prototype.bufferData=function(){var t=this.gl;t.bufferData(t.ARRAY_BUFFER,this.array,t.DYNAMIC_DRAW)},t.prototype.allocate=function(t){this.array=new Float32Array(this.points*this.attributes*t)},t}();e.AbstractProgram=i},1421:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(3680),o=r(n(5027)),a=r(n(7243)),s=i.createEdgeCompoundProgram([a.default,o.default]);e.default=s},5027:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=n(1533),s=o(n(3716)),u=o(n(9169)),c=n(3680),l=10,h=function(t){function e(e){var n=t.call(this,e,s.default,u.default,3,l)||this;n.positionLocation=e.getAttribLocation(n.program,"a_position"),n.colorLocation=e.getAttribLocation(n.program,"a_color"),n.normalLocation=e.getAttribLocation(n.program,"a_normal"),n.thicknessLocation=e.getAttribLocation(n.program,"a_thickness"),n.radiusLocation=e.getAttribLocation(n.program,"a_radius"),n.barycentricLocation=e.getAttribLocation(n.program,"a_barycentric");var r=e.getUniformLocation(n.program,"u_scale");if(null===r)throw new Error("EdgeArrowHeadProgram: error while getting scaleLocation");n.scaleLocation=r;var i=e.getUniformLocation(n.program,"u_matrix");if(null===i)throw new Error("EdgeArrowHeadProgram: error while getting matrixLocation");n.matrixLocation=i;var o=e.getUniformLocation(n.program,"u_cameraRatio");if(null===o)throw new Error("EdgeArrowHeadProgram: error while getting cameraRatioLocation");n.cameraRatioLocation=o;var a=e.getUniformLocation(n.program,"u_viewportRatio");if(null===a)throw new Error("EdgeArrowHeadProgram: error while getting viewportRatioLocation");n.viewportRatioLocation=a;var c=e.getUniformLocation(n.program,"u_thicknessRatio");if(null===c)throw new Error("EdgeArrowHeadProgram: error while getting thicknessRatioLocation");return n.thicknessRatioLocation=c,n.bind(),n}return i(e,t),e.prototype.bind=function(){var t=this.gl;t.enableVertexAttribArray(this.positionLocation),t.enableVertexAttribArray(this.normalLocation),t.enableVertexAttribArray(this.thicknessLocation),t.enableVertexAttribArray(this.radiusLocation),t.enableVertexAttribArray(this.colorLocation),t.enableVertexAttribArray(this.barycentricLocation),t.vertexAttribPointer(this.positionLocation,2,t.FLOAT,!1,l*Float32Array.BYTES_PER_ELEMENT,0),t.vertexAttribPointer(this.normalLocation,2,t.FLOAT,!1,l*Float32Array.BYTES_PER_ELEMENT,8),t.vertexAttribPointer(this.thicknessLocation,1,t.FLOAT,!1,l*Float32Array.BYTES_PER_ELEMENT,16),t.vertexAttribPointer(this.radiusLocation,1,t.FLOAT,!1,l*Float32Array.BYTES_PER_ELEMENT,20),t.vertexAttribPointer(this.colorLocation,4,t.UNSIGNED_BYTE,!0,l*Float32Array.BYTES_PER_ELEMENT,24),t.vertexAttribPointer(this.barycentricLocation,3,t.FLOAT,!1,l*Float32Array.BYTES_PER_ELEMENT,28)},e.prototype.computeIndices=function(){},e.prototype.process=function(t,e,n,r,i){if(r)for(var o=30*i,s=o+30;o<s;o++)this.array[o]=0;else{var u=n.size||1,c=e.size||1,l=t.x,h=t.y,f=e.x,d=e.y,g=a.floatColor(n.color),p=f-l,v=d-h,m=p*p+v*v,y=0,b=0;m&&(y=-v*(m=1/Math.sqrt(m)),b=p*m);var w=30*i,M=this.array;M[w++]=f,M[w++]=d,M[w++]=-y,M[w++]=-b,M[w++]=u,M[w++]=c,M[w++]=g,M[w++]=1,M[w++]=0,M[w++]=0,M[w++]=f,M[w++]=d,M[w++]=-y,M[w++]=-b,M[w++]=u,M[w++]=c,M[w++]=g,M[w++]=0,M[w++]=1,M[w++]=0,M[w++]=f,M[w++]=d,M[w++]=-y,M[w++]=-b,M[w++]=u,M[w++]=c,M[w++]=g,M[w++]=0,M[w++]=0,M[w]=1}},e.prototype.render=function(t){var e=this.gl,n=this.program;e.useProgram(n),e.uniform1f(this.scaleLocation,t.scalingRatio),e.uniformMatrix3fv(this.matrixLocation,!1,t.matrix),e.uniform1f(this.cameraRatioLocation,t.ratio),e.uniform1f(this.viewportRatioLocation,1/Math.min(t.width,t.height)),e.uniform1f(this.thicknessRatioLocation,1/Math.pow(t.ratio,t.edgesPowRatio)),e.drawArrays(e.TRIANGLES,0,this.array.length/l)},e}(c.AbstractEdgeProgram);e.default=h},7243:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=n(3680),s=n(1533),u=o(n(6825)),c=o(n(7481)),l=function(t){function e(e){var n=t.call(this,e,u.default,c.default,4,7)||this,r=e.createBuffer();if(null===r)throw new Error("EdgeClampedProgram: error while getting resolutionLocation");n.indicesBuffer=r,n.positionLocation=e.getAttribLocation(n.program,"a_position"),n.colorLocation=e.getAttribLocation(n.program,"a_color"),n.normalLocation=e.getAttribLocation(n.program,"a_normal"),n.thicknessLocation=e.getAttribLocation(n.program,"a_thickness"),n.radiusLocation=e.getAttribLocation(n.program,"a_radius");var i=e.getUniformLocation(n.program,"u_scale");if(null===i)throw new Error("EdgeClampedProgram: error while getting scaleLocation");n.scaleLocation=i;var o=e.getUniformLocation(n.program,"u_matrix");if(null===o)throw new Error("EdgeClampedProgram: error while getting matrixLocation");n.matrixLocation=o;var a=e.getUniformLocation(n.program,"u_cameraRatio");if(null===a)throw new Error("EdgeClampedProgram: error while getting cameraRatioLocation");n.cameraRatioLocation=a;var l=e.getUniformLocation(n.program,"u_viewportRatio");if(null===l)throw new Error("EdgeClampedProgram: error while getting viewportRatioLocation");n.viewportRatioLocation=l;var h=e.getUniformLocation(n.program,"u_thicknessRatio");if(null===h)throw new Error("EdgeClampedProgram: error while getting thicknessRatioLocation");return n.thicknessRatioLocation=h,n.canUse32BitsIndices=s.canUse32BitsIndices(e),n.IndicesArray=n.canUse32BitsIndices?Uint32Array:Uint16Array,n.indicesArray=new n.IndicesArray,n.indicesType=n.canUse32BitsIndices?e.UNSIGNED_INT:e.UNSIGNED_SHORT,n.bind(),n}return i(e,t),e.prototype.bind=function(){var t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indicesBuffer),t.enableVertexAttribArray(this.positionLocation),t.enableVertexAttribArray(this.normalLocation),t.enableVertexAttribArray(this.thicknessLocation),t.enableVertexAttribArray(this.colorLocation),t.enableVertexAttribArray(this.radiusLocation),t.vertexAttribPointer(this.positionLocation,2,t.FLOAT,!1,7*Float32Array.BYTES_PER_ELEMENT,0),t.vertexAttribPointer(this.normalLocation,2,t.FLOAT,!1,7*Float32Array.BYTES_PER_ELEMENT,8),t.vertexAttribPointer(this.thicknessLocation,1,t.FLOAT,!1,7*Float32Array.BYTES_PER_ELEMENT,16),t.vertexAttribPointer(this.colorLocation,4,t.UNSIGNED_BYTE,!0,7*Float32Array.BYTES_PER_ELEMENT,20),t.vertexAttribPointer(this.radiusLocation,1,t.FLOAT,!1,7*Float32Array.BYTES_PER_ELEMENT,24)},e.prototype.process=function(t,e,n,r,i){if(r)for(var o=28*i,a=o+28;o<a;o++)this.array[o]=0;else{var u=n.size||1,c=t.x,l=t.y,h=e.x,f=e.y,d=e.size||1,g=s.floatColor(n.color),p=h-c,v=f-l,m=p*p+v*v,y=0,b=0;m&&(y=-v*(m=1/Math.sqrt(m)),b=p*m);var w=28*i,M=this.array;M[w++]=c,M[w++]=l,M[w++]=y,M[w++]=b,M[w++]=u,M[w++]=g,M[w++]=0,M[w++]=c,M[w++]=l,M[w++]=-y,M[w++]=-b,M[w++]=u,M[w++]=g,M[w++]=0,M[w++]=h,M[w++]=f,M[w++]=y,M[w++]=b,M[w++]=u,M[w++]=g,M[w++]=d,M[w++]=h,M[w++]=f,M[w++]=-y,M[w++]=-b,M[w++]=u,M[w++]=g,M[w]=-d}},e.prototype.computeIndices=function(){for(var t=this.array.length/7,e=t+t/2,n=new this.IndicesArray(e),r=0,i=0;r<t;r+=4)n[i++]=r,n[i++]=r+1,n[i++]=r+2,n[i++]=r+2,n[i++]=r+1,n[i++]=r+3;this.indicesArray=n},e.prototype.bufferData=function(){t.prototype.bufferData.call(this);var e=this.gl;e.bufferData(e.ELEMENT_ARRAY_BUFFER,this.indicesArray,e.STATIC_DRAW)},e.prototype.render=function(t){var e=this.gl,n=this.program;e.useProgram(n),e.uniform1f(this.scaleLocation,t.scalingRatio),e.uniformMatrix3fv(this.matrixLocation,!1,t.matrix),e.uniform1f(this.cameraRatioLocation,t.ratio),e.uniform1f(this.viewportRatioLocation,1/Math.min(t.width,t.height)),e.uniform1f(this.thicknessRatioLocation,1/Math.pow(t.ratio,t.edgesPowRatio)),e.drawElements(e.TRIANGLES,this.indicesArray.length,this.indicesType,0)},e}(a.AbstractEdgeProgram);e.default=l},3261:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=n(1533),s=o(n(5721)),u=o(n(7481)),c=function(t){function e(e){var n=t.call(this,e,s.default,u.default,4,6)||this,r=e.createBuffer();if(null===r)throw new Error("EdgeProgram: error while getting resolutionLocation");n.indicesBuffer=r,n.positionLocation=e.getAttribLocation(n.program,"a_position"),n.colorLocation=e.getAttribLocation(n.program,"a_color"),n.normalLocation=e.getAttribLocation(n.program,"a_normal"),n.thicknessLocation=e.getAttribLocation(n.program,"a_thickness");var i=e.getUniformLocation(n.program,"u_scale");if(null===i)throw new Error("EdgeProgram: error while getting scaleLocation");n.scaleLocation=i;var o=e.getUniformLocation(n.program,"u_matrix");if(null===o)throw new Error("EdgeProgram: error while getting matrixLocation");n.matrixLocation=o;var c=e.getUniformLocation(n.program,"u_cameraRatio");if(null===c)throw new Error("EdgeProgram: error while getting cameraRatioLocation");n.cameraRatioLocation=c;var l=e.getUniformLocation(n.program,"u_viewportRatio");if(null===l)throw new Error("EdgeProgram: error while getting viewportRatioLocation");n.viewportRatioLocation=l;var h=e.getUniformLocation(n.program,"u_thicknessRatio");if(null===h)throw new Error("EdgeProgram: error while getting thicknessRatioLocation");return n.thicknessRatioLocation=h,n.canUse32BitsIndices=a.canUse32BitsIndices(e),n.IndicesArray=n.canUse32BitsIndices?Uint32Array:Uint16Array,n.indicesArray=new n.IndicesArray,n.indicesType=n.canUse32BitsIndices?e.UNSIGNED_INT:e.UNSIGNED_SHORT,n.bind(),n}return i(e,t),e.prototype.bind=function(){var t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indicesBuffer),t.enableVertexAttribArray(this.positionLocation),t.enableVertexAttribArray(this.normalLocation),t.enableVertexAttribArray(this.thicknessLocation),t.enableVertexAttribArray(this.colorLocation),t.vertexAttribPointer(this.positionLocation,2,t.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,0),t.vertexAttribPointer(this.normalLocation,2,t.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,8),t.vertexAttribPointer(this.thicknessLocation,1,t.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,16),t.vertexAttribPointer(this.colorLocation,4,t.UNSIGNED_BYTE,!0,6*Float32Array.BYTES_PER_ELEMENT,20)},e.prototype.computeIndices=function(){for(var t=this.array.length/6,e=t+t/2,n=new this.IndicesArray(e),r=0,i=0;r<t;r+=4)n[i++]=r,n[i++]=r+1,n[i++]=r+2,n[i++]=r+2,n[i++]=r+1,n[i++]=r+3;this.indicesArray=n},e.prototype.bufferData=function(){t.prototype.bufferData.call(this);var e=this.gl;e.bufferData(e.ELEMENT_ARRAY_BUFFER,this.indicesArray,e.STATIC_DRAW)},e.prototype.process=function(t,e,n,r,i){if(r)for(var o=24*i,s=o+24;o<s;o++)this.array[o]=0;else{var u=n.size||1,c=t.x,l=t.y,h=e.x,f=e.y,d=a.floatColor(n.color),g=h-c,p=f-l,v=g*g+p*p,m=0,y=0;v&&(m=-p*(v=1/Math.sqrt(v)),y=g*v);var b=24*i,w=this.array;w[b++]=c,w[b++]=l,w[b++]=m,w[b++]=y,w[b++]=u,w[b++]=d,w[b++]=c,w[b++]=l,w[b++]=-m,w[b++]=-y,w[b++]=u,w[b++]=d,w[b++]=h,w[b++]=f,w[b++]=m,w[b++]=y,w[b++]=u,w[b++]=d,w[b++]=h,w[b++]=f,w[b++]=-m,w[b++]=-y,w[b++]=u,w[b]=d}},e.prototype.render=function(t){var e=this.gl,n=this.program;e.useProgram(n),e.uniform1f(this.scaleLocation,t.scalingRatio),e.uniformMatrix3fv(this.matrixLocation,!1,t.matrix),e.uniform1f(this.cameraRatioLocation,t.ratio),e.uniform1f(this.viewportRatioLocation,1/Math.min(t.width,t.height)),e.uniform1f(this.thicknessRatioLocation,1/Math.pow(t.ratio,t.edgesPowRatio)),e.drawElements(e.TRIANGLES,this.indicesArray.length,this.indicesType,0)},e}(n(3680).AbstractEdgeProgram);e.default=c},3819:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=n(1533),s=o(n(1742)),u=o(n(6164)),c=function(t){function e(e){var n=t.call(this,e,s.default,u.default,1,4)||this;return n.bind(),n}return i(e,t),e.prototype.process=function(t,e,n){var r=this.array,i=1*n*4;if(e)return r[i++]=0,r[i++]=0,r[i++]=0,void(r[i++]=0);var o=a.floatColor(t.color);r[i++]=t.x,r[i++]=t.y,r[i++]=t.size,r[i]=o},e.prototype.render=function(t){var e=this.gl,n=this.program;e.useProgram(n),e.uniform1f(this.ratioLocation,1/Math.pow(t.ratio,t.nodesPowRatio)),e.uniform1f(this.scaleLocation,t.scalingRatio),e.uniformMatrix3fv(this.matrixLocation,!1,t.matrix),e.drawArrays(e.POINTS,0,this.array.length/4)},e}(n(7379).AbstractNodeProgram);e.default=c},9169:t=>{(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{default:()=>r});const r="precision mediump float;\n\nvarying vec4 v_color;\n\nvoid main(void) {\n gl_FragColor = v_color;\n}\n";t.exports=n})()},3716:t=>{(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{default:()=>r});const r="attribute vec2 a_position;\nattribute vec2 a_normal;\nattribute float a_thickness;\nattribute float a_radius;\nattribute vec4 a_color;\nattribute vec3 a_barycentric;\n\nuniform mat3 u_matrix;\nuniform float u_scale;\nuniform float u_cameraRatio;\nuniform float u_viewportRatio;\nuniform float u_thicknessRatio;\n\nvarying vec4 v_color;\n\nconst float arrowHeadLengthThicknessRatio = 2.5;\nconst float arrowHeadWidthLengthRatio = 0.66;\nconst float minThickness = 0.8;\nconst float bias = 255.0 / 254.0;\n\nvoid main() {\n\n // Computing thickness in screen space:\n float thickness = a_thickness * u_thicknessRatio * u_scale * u_viewportRatio / 2.0;\n thickness = max(thickness, minThickness * u_viewportRatio);\n\n float nodeRadius = a_radius * u_thicknessRatio * u_viewportRatio * u_cameraRatio;\n float arrowHeadLength = thickness * 2.0 * arrowHeadLengthThicknessRatio * u_cameraRatio;\n float arrowHeadHalfWidth = arrowHeadWidthLengthRatio * arrowHeadLength / 2.0;\n\n float da = a_barycentric.x;\n float db = a_barycentric.y;\n float dc = a_barycentric.z;\n\n vec2 delta = vec2(\n da * ((nodeRadius) * a_normal.y)\n + db * ((nodeRadius + arrowHeadLength) * a_normal.y + arrowHeadHalfWidth * a_normal.x)\n + dc * ((nodeRadius + arrowHeadLength) * a_normal.y - arrowHeadHalfWidth * a_normal.x),\n\n da * (-(nodeRadius) * a_normal.x)\n + db * (-(nodeRadius + arrowHeadLength) * a_normal.x + arrowHeadHalfWidth * a_normal.y)\n + dc * (-(nodeRadius + arrowHeadLength) * a_normal.x - arrowHeadHalfWidth * a_normal.y)\n );\n\n vec2 position = (u_matrix * vec3(a_position + delta, 1)).xy;\n\n gl_Position = vec4(position, 0, 1);\n\n // Extract the color:\n v_color = a_color;\n v_color.a *= bias;\n}\n";t.exports=n})()},6825:t=>{(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{default:()=>r});const r="attribute vec2 a_position;\nattribute vec2 a_normal;\nattribute float a_thickness;\nattribute vec4 a_color;\nattribute float a_radius;\n\nuniform mat3 u_matrix;\nuniform float u_scale;\nuniform float u_cameraRatio;\nuniform float u_viewportRatio;\nuniform float u_thicknessRatio;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_thickness;\n\nconst float arrowHeadLengthThicknessRatio = 2.5;\nconst float minThickness = 0.8;\nconst float bias = 255.0 / 254.0;\n\nvoid main() {\n\n // Computing thickness in screen space:\n float thickness = a_thickness * u_thicknessRatio * u_scale * u_viewportRatio / 2.0;\n thickness = max(thickness, minThickness * u_viewportRatio);\n\n float direction = sign(a_radius);\n float nodeRadius = direction * a_radius * u_thicknessRatio * u_viewportRatio;\n float arrowHeadLength = thickness * 2.0 * arrowHeadLengthThicknessRatio;\n\n vec2 arrowHeadVector = vec2(-direction * a_normal.y, direction * a_normal.x);\n\n // Add normal vector to the position in screen space, but correct thickness first:\n vec2 position = a_position + a_normal * thickness * u_cameraRatio;\n // Add vector that corrects the arrow head length:\n position = position + arrowHeadVector * (arrowHeadLength + nodeRadius) * u_cameraRatio;\n // Apply camera\n position = (u_matrix * vec3(position, 1)).xy;\n\n gl_Position = vec4(position, 0, 1);\n\n v_normal = a_normal;\n v_thickness = thickness;\n\n // Extract the color:\n v_color = a_color;\n v_color.a *= bias;\n}\n";t.exports=n})()},7481:t=>{(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{default:()=>r});const r="precision mediump float;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_thickness;\n\nconst float feather = 0.001;\nconst vec4 color0 = vec4(0.0, 0.0, 0.0, 0.0);\n\nvoid main(void) {\n float dist = length(v_normal) * v_thickness;\n\n float t = smoothstep(\n v_thickness - feather,\n v_thickness,\n dist\n );\n\n gl_FragColor = mix(v_color, color0, t);\n}\n";t.exports=n})()},5721:t=>{(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{default:()=>r});const r="attribute vec2 a_position;\nattribute vec2 a_normal;\nattribute float a_thickness;\nattribute vec4 a_color;\n\nuniform mat3 u_matrix;\nuniform float u_scale;\nuniform float u_cameraRatio;\nuniform float u_viewportRatio;\nuniform float u_thicknessRatio;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_thickness;\n\nconst float minThickness = 0.8;\nconst float bias = 255.0 / 254.0;\n\nvoid main() {\n\n // Computing thickness in screen space:\n float thickness = a_thickness * u_thicknessRatio * u_scale * u_viewportRatio / 2.0;\n thickness = max(thickness, minThickness * u_viewportRatio);\n\n // Add normal vector to the position in screen space, but correct thickness first:\n vec2 position = (u_matrix * vec3(a_position + a_normal * thickness * u_cameraRatio, 1)).xy;\n\n gl_Position = vec4(position, 0, 1);\n\n v_normal = a_normal;\n v_thickness = thickness;\n\n // Extract the color:\n v_color = a_color;\n v_color.a *= bias;\n}\n";t.exports=n})()},6164:t=>{(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{default:()=>r});const r="precision mediump float;\n\nvarying vec4 v_color;\nvarying float v_border;\n\nconst float radius = 0.5;\n\nvoid main(void) {\n vec4 color0 = vec4(0.0, 0.0, 0.0, 0.0);\n vec2 m = gl_PointCoord - vec2(0.5, 0.5);\n float dist = radius - length(m);\n\n float t = 0.0;\n if (dist > v_border)\n t = 1.0;\n else if (dist > 0.0)\n t = dist / v_border;\n\n gl_FragColor = mix(color0, v_color, t);\n}\n";t.exports=n})()},1742:t=>{(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{default:()=>r});const r="attribute vec2 a_position;\nattribute float a_size;\nattribute vec4 a_color;\n\nuniform float u_ratio;\nuniform float u_scale;\nuniform mat3 u_matrix;\n\nvarying vec4 v_color;\nvarying float v_border;\n\nconst float bias = 255.0 / 254.0;\n\nvoid main() {\n\n gl_Position = vec4(\n (u_matrix * vec3(a_position, 1)).xy,\n 0,\n 1\n );\n\n // Multiply the point size twice:\n // - x SCALING_RATIO to correct the canvas scaling\n // - x 2 to correct the formulae\n gl_PointSize = a_size * u_ratio * u_scale * 2.0;\n\n v_border = (1.0 / u_ratio) * (0.5 / a_size);\n\n // Extract the color:\n v_color = a_color;\n v_color.a *= bias;\n}\n";t.exports=n})()},2952:(t,e)=>{"use strict";function n(t,e,n){var r="VERTEX"===t?e.VERTEX_SHADER:e.FRAGMENT_SHADER,i=e.createShader(r);if(null===i)throw new Error("loadShader: error while creating the shader");if(e.shaderSource(i,n),e.compileShader(i),!e.getShaderParameter(i,e.COMPILE_STATUS)){var o=e.getShaderInfoLog(i);throw e.deleteShader(i),new Error("loadShader: error while compiling the shader:\n"+o+"\n"+n)}return i}Object.defineProperty(e,"__esModule",{value:!0}),e.loadProgram=e.loadFragmentShader=e.loadVertexShader=void 0,e.loadVertexShader=function(t,e){return n("VERTEX",t,e)},e.loadFragmentShader=function(t,e){return n("FRAGMENT",t,e)},e.loadProgram=function(t,e){var n,r,i=t.createProgram();if(null===i)throw new Error("loadProgram: error while creating the program.");for(n=0,r=e.length;n<r;n++)t.attachShader(i,e[n]);if(t.linkProgram(i),!t.getProgramParameter(i,t.LINK_STATUS))throw t.deleteProgram(i),new Error("loadProgram: error while linking the program.");return i}},4765:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_SETTINGS=e.validateSettings=void 0;var i=r(n(9244)),o=r(n(1040)),a=r(n(3188)),s=r(n(3819)),u=r(n(3261)),c=r(n(1421));e.validateSettings=function(t){if(t.labelGrid&&t.labelGrid.cell&&"object"==typeof t.labelGrid.cell&&(!t.labelGrid.cell.width||!t.labelGrid.cell.height))throw new Error("Settings: invalid `labelGrid.cell`. Expecting {width, height}.")},e.DEFAULT_SETTINGS={hideEdgesOnMove:!1,hideLabelsOnMove:!1,renderLabels:!0,renderEdgeLabels:!1,defaultNodeColor:"#999",defaultNodeType:"circle",defaultEdgeColor:"#ccc",defaultEdgeType:"line",labelFont:"Arial",labelSize:14,labelWeight:"normal",edgeLabelFont:"Arial",edgeLabelSize:14,edgeLabelWeight:"normal",labelGrid:{cell:null,renderedSizeThreshold:-1/0},nodeReducer:null,edgeReducer:null,zIndex:!1,labelRenderer:i.default,hoverRenderer:o.default,edgeLabelRenderer:a.default,nodeProgramClasses:{circle:s.default},edgeProgramClasses:{arrow:c.default,line:u.default}}},2122:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=n(343),s=o(n(6160)),u=o(n(5214)),c=o(n(5373)),l=o(n(7966)),h=n(1533),f=n(6243),d=n(4765),g=o(n(5518)),p=s.default.nodeExtent,v=s.default.edgeExtent,m=h.getPixelRatio(),y=h.getPixelRatio();function b(t,e,n){if(!n.hasOwnProperty("x")||!n.hasOwnProperty("y"))throw new Error('Sigma: could not find a valid position (x, y) for node "'+e+'". All your nodes must have a number "x" and "y". Maybe your forgot to apply a layout or your "nodeReducer" is not returning the correct data?');n.color||(n.color=t.defaultNodeColor),n.label||(n.label=""),n.size||(n.size=2),n.hasOwnProperty("hidden")||(n.hidden=!1),n.hasOwnProperty("highlighted")||(n.highlighted=!1)}function w(t,e,n){n.color||(n.color=t.defaultEdgeColor),n.label||(n.label=""),n.size||(n.size=.5),n.hasOwnProperty("hidden")||(n.hidden=!1)}var M=function(t){function e(e,n,r){void 0===r&&(r={});var i=t.call(this)||this;if(i.elements={},i.canvasContexts={},i.webGLContexts={},i.activeListeners={},i.quadtree=new l.default,i.nodeDataCache={},i.edgeDataCache={},i.nodeKeyToIndex={},i.edgeKeyToIndex={},i.nodeExtent=null,i.edgeExtent=null,i.normalizationFunction=h.createNormalizationFunction({x:[-1/0,1/0],y:[-1/0,1/0]}),i.width=0,i.height=0,i.highlightedNodes=new Set,i.displayedLabels=new Set,i.hoveredNode=null,i.renderFrame=null,i.renderHighlightedNodesFrame=null,i.needToProcess=!1,i.needToSoftProcess=!1,i.nodePrograms={},i.edgePrograms={},i.settings=h.assignDeep({},d.DEFAULT_SETTINGS,r),d.validateSettings(i.settings),h.validateGraph(e),!(n instanceof HTMLElement))throw new Error("Sigma: container should be an html element.");i.graph=e,i.container=n,i.initializeCache(),i.createWebGLContext("edges"),i.createWebGLContext("nodes"),i.createCanvasContext("edgeLabels"),i.createCanvasContext("labels"),i.createCanvasContext("hovers"),i.createCanvasContext("mouse");var o=i.webGLContexts.nodes;for(var a in o.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA),o.enable(o.BLEND),(o=i.webGLContexts.edges).blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA),o.enable(o.BLEND),i.settings.nodeProgramClasses){var s=i.settings.nodeProgramClasses[a];i.nodePrograms[a]=new s(i.webGLContexts.nodes)}for(var a in i.settings.edgeProgramClasses){var f=i.settings.edgeProgramClasses[a];i.edgePrograms[a]=new f(i.webGLContexts.edges)}return i.resize(),i.camera=new u.default,i.bindCameraHandlers(),i.mouseCaptor=new c.default(i.elements.mouse,i.camera),i.touchCaptor=new g.default(i.elements.mouse,i.camera),i.bindEventHandlers(),i.bindGraphHandlers(),i.process(),i.render(),i}return i(e,t),e.prototype.createCanvas=function(t){var e=h.createElement("canvas",{position:"absolute"},{class:"sigma-"+t});return this.elements[t]=e,this.container.appendChild(e),e},e.prototype.createCanvasContext=function(t){var e=this.createCanvas(t);return this.canvasContexts[t]=e.getContext("2d",{preserveDrawingBuffer:!1,antialias:!1}),this},e.prototype.createWebGLContext=function(t){var e,n=this.createCanvas(t),r={preserveDrawingBuffer:!1,antialias:!1};return(e=n.getContext("webgl2",r))||(e=n.getContext("webgl",r)),e||(e=n.getContext("experimental-webgl",r)),this.webGLContexts[t]=e,this},e.prototype.initializeCache=function(){var t=this,e=this.graph,n=0;e.forEachNode((function(e){t.nodeKeyToIndex[e]=n++,t.nodeDataCache[e]={}})),n=0,e.forEachEdge((function(e){t.edgeKeyToIndex[e]=n++,t.edgeDataCache[e]={}}))},e.prototype.bindCameraHandlers=function(){var t=this;return this.activeListeners.camera=function(){t.scheduleRefresh()},this.camera.on("updated",this.activeListeners.camera),this},e.prototype.bindEventHandlers=function(){var t=this;this.activeListeners.handleResize=function(){t.needToSoftProcess=!0,t.scheduleRefresh()},window.addEventListener("resize",this.activeListeners.handleResize);var e=function(t,e,n,r,i){return t>n-i&&t<n+i&&e>r-i&&e<r+i&&Math.sqrt(Math.pow(t-n,2)+Math.pow(e-r,2))<i},n=function(e,n){var r=t.camera.viewportToFramedGraph({width:t.width,height:t.height},{x:e,y:n});return t.quadtree.point(r.x,1-r.y)};this.activeListeners.handleMove=function(r){for(var i=Math.pow(t.camera.getState().ratio,.5),o=n(r.x,r.y),a={width:t.width,height:t.height},s=1/0,u=null,c=0,l=o.length;c<l;c++){var h=o[c],f=t.nodeDataCache[h],d=t.camera.framedGraphToViewport(a,f),g=f.size/i;if(e(r.x,r.y,d.x,d.y,g)){var p=Math.sqrt(Math.pow(r.x-d.x,2)+Math.pow(r.y-d.y,2));p<s&&(s=p,u=h)}}return u&&t.hoveredNode!==u?(t.hoveredNode&&t.emit("leaveNode",{node:t.hoveredNode}),t.hoveredNode=u,t.emit("enterNode",{node:u}),void t.scheduleHighlightedNodesRender()):t.hoveredNode&&(f=t.nodeDataCache[t.hoveredNode],d=t.camera.framedGraphToViewport(a,f),g=f.size/i,!e(r.x,r.y,d.x,d.y,g))?(h=t.hoveredNode,t.hoveredNode=null,t.emit("leaveNode",{node:h}),t.scheduleHighlightedNodesRender()):void 0};var r=function(r){return function(i){for(var o=Math.pow(t.camera.getState().ratio,.5),a=n(i.x,i.y),s={width:t.width,height:t.height},u=0,c=a.length;u<c;u++){var l=a[u],h=t.nodeDataCache[l],f=t.camera.framedGraphToViewport(s,h),d=h.size/o;if(e(i.x,i.y,f.x,f.y,d))return t.emit(r+"Node",{node:l,captor:i,event:i})}return t.emit(r+"Stage",{event:i})}};return this.activeListeners.handleClick=r("click"),this.activeListeners.handleRightClick=r("rightClick"),this.activeListeners.handleDown=r("down"),this.mouseCaptor.on("mousemove",this.activeListeners.handleMove),this.mouseCaptor.on("click",this.activeListeners.handleClick),this.mouseCaptor.on("rightClick",this.activeListeners.handleRightClick),this.mouseCaptor.on("mousedown",this.activeListeners.handleDown),this},e.prototype.bindGraphHandlers=function(){var t=this,e=this.graph;return this.activeListeners.graphUpdate=function(){t.needToProcess=!0,t.scheduleRefresh()},this.activeListeners.softGraphUpdate=function(){t.needToSoftProcess=!0,t.scheduleRefresh()},this.activeListeners.addNodeGraphUpdate=function(n){t.nodeKeyToIndex[n.key]=e.order-1,t.nodeDataCache[n.key]={},t.activeListeners.graphUpdate()},this.activeListeners.addEdgeGraphUpdate=function(n){t.nodeKeyToIndex[n.key]=e.order-1,t.edgeDataCache[n.key]={},t.activeListeners.graphUpdate()},e.on("nodeAdded",this.activeListeners.addNodeGraphUpdate),e.on("nodeDropped",this.activeListeners.graphUpdate),e.on("nodeAttributesUpdated",this.activeListeners.softGraphUpdate),e.on("eachNodeAttributesUpdated",this.activeListeners.graphUpdate),e.on("edgeAdded",this.activeListeners.addEdgeGraphUpdate),e.on("edgeDropped",this.activeListeners.graphUpdate),e.on("edgeAttributesUpdated",this.activeListeners.softGraphUpdate),e.on("eachEdgeAttributesUpdated",this.activeListeners.graphUpdate),e.on("edgesCleared",this.activeListeners.graphUpdate),e.on("cleared",this.activeListeners.graphUpdate),this},e.prototype.process=function(t){void 0===t&&(t=!1);var e=this.graph,n=this.settings;this.quadtree.clear(),this.highlightedNodes=new Set;var r=["x","y","z"];this.settings.zIndex&&(r.push("z"),this.edgeExtent=v(e,["z"])),this.nodeExtent=p(e,r),this.normalizationFunction=h.createNormalizationFunction(this.nodeExtent);var i=this.nodePrograms[this.settings.defaultNodeType];t||i.allocate(e.order);var o=e.nodes();this.settings.zIndex&&(o=h.zIndexOrdering(this.nodeExtent.z,(function(t){return e.getNodeAttribute(t,"z")}),o));for(var a=0,s=o.length;a<s;a++){var u=o[a],c=e.getNodeAttributes(u);n.nodeReducer&&(c=n.nodeReducer(u,c)),c=Object.assign(this.nodeDataCache[u],c),b(this.settings,u,c),this.normalizationFunction.applyTo(c),this.quadtree.add(u,c.x,1-c.y,c.size/this.width),i.process(c,c.hidden,a),c.highlighted&&!c.hidden&&this.highlightedNodes.add(u),this.nodeKeyToIndex[u]=a}i.bind(),i.bufferData();var l=this.edgePrograms[this.settings.defaultEdgeType];t||l.allocate(e.size);var f=e.edges();for(this.settings.zIndex&&this.edgeExtent&&(f=h.zIndexOrdering(this.edgeExtent.z,(function(t){return e.getEdgeAttribute(t,"z")}),f)),a=0,s=f.length;a<s;a++){var d=f[a];c=e.getEdgeAttributes(d),n.edgeReducer&&(c=n.edgeReducer(d,c)),c=Object.assign(this.edgeDataCache[d],c),w(this.settings,0,c);var g=e.extremities(d),m=this.nodeDataCache[g[0]],y=this.nodeDataCache[g[1]],M=c.hidden||m.hidden||y.hidden;l.process(m,y,c,M,a),this.nodeKeyToIndex[d]=a}return t||"function"!=typeof l.computeIndices||l.computeIndices(),l.bind(),l.bufferData(),this},e.prototype.renderLabels=function(){if(!this.settings.renderLabels)return this;var t,e=this.camera.getState(),n={width:this.width,height:this.height};if(e.ratio>=1)t=this.graph.nodes();else{var r=this.camera.viewRectangle(n);t=this.quadtree.rectangle(r.x1,1-r.y1,r.x2,1-r.y2,r.height)}for(var i=this.settings.labelGrid,o=f.labelsToDisplayFromGrid({cache:this.nodeDataCache,camera:this.camera,cell:i.cell,dimensions:n,displayedLabels:this.displayedLabels,fontSize:this.settings.labelSize,graph:this.graph,renderedSizeThreshold:i.renderedSizeThreshold,visibleNodes:t}),a=this.canvasContexts.labels,s=Math.pow(e.ratio,.5),u=0,c=o.length;u<c;u++){var l=this.nodeDataCache[o[u]],h=this.camera.framedGraphToViewport(n,l),d=h.x,g=h.y,p=l.size/s;this.settings.labelRenderer(a,{key:o[u],label:l.label,color:"#000",size:p,x:d,y:g},this.settings)}return this.displayedLabels=new Set(o),this},e.prototype.renderEdgeLabels=function(){if(!this.settings.renderEdgeLabels)return this;var t=this.camera.getState(),e=Math.pow(t.ratio,.5),n=this.canvasContexts.edgeLabels,r={width:this.width,height:this.height};n.clearRect(0,0,this.width,this.height);for(var i=f.edgeLabelsToDisplayFromNodes({nodeDataCache:this.nodeDataCache,edgeDataCache:this.edgeDataCache,graph:this.graph,hoveredNode:this.hoveredNode,displayedNodeLabels:this.displayedLabels,highlightedNodes:this.highlightedNodes}),o=0,a=i.length;o<a;o++){var s=i[o],u=this.graph.extremities(s),c=this.nodeDataCache[u[0]],l=this.nodeDataCache[u[1]],h=this.edgeDataCache[i[o]],d=this.camera.framedGraphToViewport(r,c),g=d.x,p=d.y,v=this.camera.framedGraphToViewport(r,l),m=v.x,y=v.y,b=h.size/e;this.settings.edgeLabelRenderer(n,{key:s,label:h.label,color:h.color,size:b},{key:u[0],x:g,y:p},{key:u[1],x:m,y},this.settings)}return this},e.prototype.renderHighlightedNodes=function(){var t=this,e=this.camera,n=Math.pow(e.getState().ratio,.5),r=this.canvasContexts.hovers;r.clearRect(0,0,this.width,this.height);var i=function(i){var o=t.nodeDataCache[i],a=e.framedGraphToViewport({width:t.width,height:t.height},o),s=a.x,u=a.y,c=o.size/n;t.settings.hoverRenderer(r,{key:i,label:o.label,color:o.color,size:c,x:s,y:u},t.settings)};this.hoveredNode&&i(this.hoveredNode),this.highlightedNodes.forEach(i)},e.prototype.scheduleHighlightedNodesRender=function(){var t=this;this.renderHighlightedNodesFrame||this.renderFrame||(this.renderHighlightedNodesFrame=h.requestFrame((function(){t.renderHighlightedNodesFrame=null,t.renderHighlightedNodes(),t.renderEdgeLabels()})))},e.prototype.render=function(){if(this.renderFrame&&(h.cancelFrame(this.renderFrame),this.renderFrame=null,this.needToProcess=!1,this.needToSoftProcess=!1),this.resize(),this.clear(),!this.graph.order)return this;var t=this.mouseCaptor,e=this.camera.isAnimated()||t.isMoving||t.draggedEvents||t.currentWheelDirection,n=this.camera.getState(),r=h.matrixFromCamera(n,{width:this.width,height:this.height});return this.nodePrograms[this.settings.defaultNodeType].render({matrix:r,width:this.width,height:this.height,ratio:n.ratio,nodesPowRatio:.5,scalingRatio:y}),this.settings.hideEdgesOnMove&&e||this.edgePrograms[this.settings.defaultEdgeType].render({matrix:r,width:this.width,height:this.height,ratio:n.ratio,edgesPowRatio:.5,scalingRatio:y}),this.settings.hideLabelsOnMove&&e||(this.renderLabels(),this.renderEdgeLabels(),this.renderHighlightedNodes()),this},e.prototype.getCamera=function(){return this.camera},e.prototype.getGraph=function(){return this.graph},e.prototype.getMouseCaptor=function(){return this.mouseCaptor},e.prototype.getTouchCaptor=function(){return this.touchCaptor},e.prototype.getDimensions=function(){return{width:this.width,height:this.height}},e.prototype.getNodeAttributes=function(t){var e=this.nodeDataCache[t];return e?Object.assign({},e):void 0},e.prototype.getEdgeAttributes=function(t){var e=this.edgeDataCache[t];return e?Object.assign({},e):void 0},e.prototype.getSetting=function(t){return this.settings[t]},e.prototype.setSetting=function(t,e){return this.settings[t]=e,d.validateSettings(this.settings),this.needToProcess=!0,this.scheduleRefresh(),this},e.prototype.updateSetting=function(t,e){return this.settings[t]=e(this.settings[t]),d.validateSettings(this.settings),this.needToProcess=!0,this.scheduleRefresh(),this},e.prototype.resize=function(){var t=this.width,e=this.height;if(this.width=this.container.offsetWidth,this.height=this.container.offsetHeight,0===this.width)throw new Error("Sigma: container has no width.");if(0===this.height)throw new Error("Sigma: container has no height.");if(t===this.width&&e===this.height)return this;for(var n in this.elements){var r=this.elements[n];r.style.width=this.width+"px",r.style.height=this.height+"px"}for(var n in this.canvasContexts)this.elements[n].setAttribute("width",this.width*m+"px"),this.elements[n].setAttribute("height",this.height*m+"px"),1!==m&&this.canvasContexts[n].scale(m,m);for(var n in this.webGLContexts)this.elements[n].setAttribute("width",this.width*y+"px"),this.elements[n].setAttribute("height",this.height*y+"px"),this.webGLContexts[n].viewport(0,0,this.width*y,this.height*y);return this},e.prototype.clear=function(){return this.webGLContexts.nodes.clear(this.webGLContexts.nodes.COLOR_BUFFER_BIT),this.webGLContexts.edges.clear(this.webGLContexts.edges.COLOR_BUFFER_BIT),this.canvasContexts.labels.clearRect(0,0,this.width,this.height),this.canvasContexts.hovers.clearRect(0,0,this.width,this.height),this.canvasContexts.edgeLabels.clearRect(0,0,this.width,this.height),this},e.prototype.refresh=function(){return this.needToProcess?this.process():this.needToSoftProcess&&this.process(!0),this.needToProcess=!1,this.needToSoftProcess=!1,this.render(),this},e.prototype.scheduleRefresh=function(){var t=this;return this.renderFrame||(this.renderFrame=h.requestFrame((function(){t.refresh(),t.renderFrame=null}))),this},e.prototype.viewportToGraph=function(t){return this.normalizationFunction.inverse(this.camera.viewportToFramedGraph(this.getDimensions(),t))},e.prototype.graphToViewport=function(t){return this.camera.framedGraphToViewport(this.getDimensions(),this.normalizationFunction(t))},e.prototype.kill=function(){var t=this.graph;this.emit("kill"),this.removeAllListeners(),this.camera.removeListener("updated",this.activeListeners.camera),window.removeEventListener("resize",this.activeListeners.handleResize),this.mouseCaptor.kill(),this.touchCaptor.kill(),t.removeListener("nodeAdded",this.activeListeners.addNodeGraphUpdate),t.removeListener("nodeDropped",this.activeListeners.graphUpdate),t.removeListener("nodeAttributesUpdated",this.activeListeners.softGraphUpdate),t.removeListener("eachNodeAttributesUpdated",this.activeListeners.graphUpdate),t.removeListener("edgeAdded",this.activeListeners.addEdgeGraphUpdate),t.removeListener("edgeDropped",this.activeListeners.graphUpdate),t.removeListener("edgeAttributesUpdated",this.activeListeners.softGraphUpdate),t.removeListener("eachEdgeAttributesUpdated",this.activeListeners.graphUpdate),t.removeListener("edgesCleared",this.activeListeners.graphUpdate),t.removeListener("cleared",this.activeListeners.graphUpdate),this.quadtree=new l.default,this.nodeDataCache={},this.edgeDataCache={},this.highlightedNodes=new Set,this.displayedLabels=new Set,this.renderFrame&&(h.cancelFrame(this.renderFrame),this.renderFrame=null),this.renderHighlightedNodesFrame&&(h.cancelFrame(this.renderHighlightedNodesFrame),this.renderHighlightedNodesFrame=null);for(var e=this.container;e.firstChild;)e.removeChild(e.firstChild)},e}(a.EventEmitter);e.default=M},9960:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.animateNodes=e.ANIMATE_DEFAULTS=void 0;var i=n(1533),o=r(n(1515));e.ANIMATE_DEFAULTS={easing:"quadraticInOut",duration:150},e.animateNodes=function(t,n,r,a){var s=Object.assign({},e.ANIMATE_DEFAULTS,r),u="function"==typeof s.easing?s.easing:o.default[s.easing],c=Date.now(),l={};for(var h in n){var f=n[h];for(var d in l[h]={},f)l[h][d]=t.getNodeAttribute(h,d)}var g=null,p=function(){var e=(Date.now()-c)/s.duration;if(e>=1){for(var r in n){var o=n[r];for(var h in o)t.setNodeAttribute(r,h,o[h])}"function"==typeof a&&a()}else{for(var r in e=u(e),n){o=n[r];var f=l[r];for(var h in o)t.setNodeAttribute(r,h,o[h]*e+f[h]*(1-e))}g=i.requestFrame(p)}};return p(),function(){g&&i.cancelFrame(g)}}},1515:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.cubicInOut=e.cubicOut=e.cubicIn=e.quadraticInOut=e.quadraticOut=e.quadraticIn=e.linear=void 0,e.linear=function(t){return t},e.quadraticIn=function(t){return t*t},e.quadraticOut=function(t){return t*(2-t)},e.quadraticInOut=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},e.cubicIn=function(t){return t*t*t},e.cubicOut=function(t){return--t*t*t+1},e.cubicInOut=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)};var n={linear:e.linear,quadraticIn:e.quadraticIn,quadraticOut:e.quadraticOut,quadraticInOut:e.quadraticInOut,cubicIn:e.cubicIn,cubicOut:e.cubicOut,cubicInOut:e.cubicInOut};e.default=n},1533:function(t,e,n){"use strict";var r=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.validateGraph=e.canUse32BitsIndices=e.extractPixel=e.matrixFromCamera=e.floatColor=e.zIndexOrdering=e.createNormalizationFunction=e.getPixelRatio=e.createElement=e.cancelFrame=e.requestFrame=e.assignDeep=e.isPlainObject=void 0;var o=i(n(227)),a=n(6659);function s(t){return"object"==typeof t&&null!==t&&t.constructor===Object}e.isPlainObject=s,e.assignDeep=function t(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];e=e||{};for(var i=0,o=n.length;i<o;i++){var a=n[i];if(a)for(var u in a)s(a[u])?e[u]=t(e[u],a[u]):e[u]=a[u]}return e},e.requestFrame="undefined"!=typeof requestAnimationFrame?function(t){return requestAnimationFrame(t)}:function(t){return setTimeout(t,0)},e.cancelFrame="undefined"!=typeof cancelAnimationFrame?function(t){return cancelAnimationFrame(t)}:function(t){return clearTimeout(t)},e.createElement=function(t,e,n){var r=document.createElement(t);if(e)for(var i in e)r.style[i]=e[i];if(n)for(var i in n)r.setAttribute(i,n[i]);return r},e.getPixelRatio=function(){return void 0!==window.devicePixelRatio?window.devicePixelRatio:1},e.createNormalizationFunction=function(t){var e=r(t.x,2),n=e[0],i=e[1],o=r(t.y,2),a=o[0],s=o[1],u=Math.max(i-n,s-a);0===u&&(u=1);var c=(i+n)/2,l=(s+a)/2,h=function(t){return{x:.5+(t.x-c)/u,y:.5+(t.y-l)/u}};return h.applyTo=function(t){t.x=.5+(t.x-c)/u,t.y=.5+(t.y-l)/u},h.inverse=function(t){return{x:c+u*(t.x-.5),y:l+u*(t.y-.5)}},h.ratio=u,h},e.zIndexOrdering=function(t,e,n){return n.sort((function(t,n){var r=e(t)||0,i=e(n)||0;return r<i?-1:r>i?1:0}))};var u={},c=new Int8Array(4),l=new Int32Array(c.buffer,0,1),h=new Float32Array(c.buffer,0,1),f=/^\s*rgba?\s*\(/,d=/^\s*rgba?\s*\(\s*([0-9]*)\s*,\s*([0-9]*)\s*,\s*([0-9]*)(?:\s*,\s*(.*)?)?\)\s*$/;e.floatColor=function(t){if(void 0!==u[t])return u[t];var e=0,n=0,r=0,i=1;if("#"===t[0])4===t.length?(e=parseInt(t.charAt(1)+t.charAt(1),16),n=parseInt(t.charAt(2)+t.charAt(2),16),r=parseInt(t.charAt(3)+t.charAt(3),16)):(e=parseInt(t.charAt(1)+t.charAt(2),16),n=parseInt(t.charAt(3)+t.charAt(4),16),r=parseInt(t.charAt(5)+t.charAt(6),16));else if(f.test(t)){var o=t.match(d);o&&(e=+o[1],n=+o[2],r=+o[3],o[4]&&(i=+o[4]))}i=255*i|0,l[0]=4278190079&(i<<24|r<<16|n<<8|e);var a=h[0];return u[t]=a,a},e.matrixFromCamera=function(t,e){var n=t.angle,r=t.ratio,i=t.x,o=t.y,s=e.width,u=e.height,c=a.identity(),l=Math.min(s,u),h=a.translate(a.identity(),-i,-o),f=a.scale(a.identity(),1/r),d=a.rotate(a.identity(),-n),g=a.scale(a.identity(),l/s*2,l/u*2);return a.multiply(c,g),a.multiply(c,d),a.multiply(c,f),a.multiply(c,h),c},e.extractPixel=function(t,e,n,r){var i=r||new Uint8Array(4);return t.readPixels(e,n,1,1,t.RGBA,t.UNSIGNED_BYTE,i),i},e.canUse32BitsIndices=function(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||!!t.getExtension("OES_element_index_uint")},e.validateGraph=function(t){if(!o.default(t))throw new Error("Sigma: invalid graph instance.");t.forEachNode((function(t,e){if(!Number.isFinite(e.x)||!Number.isFinite(e.y))throw new Error("Sigma: Coordinates of node "+t+" are invalid. A node must have a numeric 'x' and 'y' attribute.")}))}},6659:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.multiply=e.translate=e.rotate=e.scale=e.identity=void 0,e.identity=function(){return Float32Array.of(1,0,0,0,1,0,0,0,1)},e.scale=function(t,e,n){return t[0]=e,t[4]="number"==typeof n?n:e,t},e.rotate=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[3]=-n,t[4]=r,t},e.translate=function(t,e,n){return t[6]=e,t[7]=n,t},e.multiply=function(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],l=t[8],h=e[0],f=e[1],d=e[2],g=e[3],p=e[4],v=e[5],m=e[6],y=e[7],b=e[8];return t[0]=h*n+f*o+d*u,t[1]=h*r+f*a+d*c,t[2]=h*i+f*s+d*l,t[3]=g*n+p*o+v*u,t[4]=g*r+p*a+v*c,t[5]=g*i+p*s+v*l,t[6]=m*n+y*o+b*u,t[7]=m*r+y*a+b*c,t[8]=m*i+y*s+b*l,t}}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var o=n[t]={id:t,loaded:!1,exports:{}};return e[t].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.m=e,t=[],r.O=(e,n,i,o)=>{if(!n){var a=1/0;for(c=0;c<t.length;c++){for(var[n,i,o]=t[c],s=!0,u=0;u<n.length;u++)(!1&o||a>=o)&&Object.keys(r.O).every((t=>r.O[t](n[u])))?n.splice(u--,1):(s=!1,o<a&&(a=o));s&&(t.splice(c--,1),e=i())}return e}o=o||0;for(var c=t.length;c>0&&t[c-1][2]>o;c--)t[c]=t[c-1];t[c]=[n,i,o]},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{var t={900:0};r.O.j=e=>0===t[e];var e=(e,n)=>{var i,o,[a,s,u]=n,c=0;for(i in s)r.o(s,i)&&(r.m[i]=s[i]);if(u)var l=u(r);for(e&&e(n);c<a.length;c++)o=a[c],r.o(t,o)&&t[o]&&t[o][0](),t[a[c]]=0;return r.O(l)},n=self.webpackChunk=self.webpackChunk||[];n.forEach(e.bind(null,0)),n.push=e.bind(null,n.push.bind(n))})();var i=r.O(void 0,[351],(()=>r(7108)));i=r.O(i)})();
//# sourceMappingURL=animations.bundle.js.map