import{s as j,p as q}from"./d3-selection-DSeOx27A.js";import{d as H}from"./d3-dispatch-kxCwF96_.js";const J={passive:!1},v={capture:!0,passive:!1};function P(t){t.stopImmediatePropagation()}function y(t){t.preventDefault(),t.stopImmediatePropagation()}function L(t){var u=t.document.documentElement,c=j(t).on("dragstart.drag",y,v);"onselectstart"in u?c.on("selectstart.drag",y,v):(u.__noselect=u.style.MozUserSelect,u.style.MozUserSelect="none")}function Q(t,u){var c=t.document.documentElement,l=j(t).on("dragstart.drag",null);u&&(l.on("click.drag",y,v),setTimeout(function(){l.on("click.drag",null)},0)),"onselectstart"in c?l.on("selectstart.drag",null):(c.style.MozUserSelect=c.__noselect,delete c.__noselect)}const k=t=>()=>t;function S(t,{sourceEvent:u,subject:c,target:l,identifier:f,active:m,x:h,y:x,dx:w,dy:p,dispatch:d}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:u,enumerable:!0,configurable:!0},subject:{value:c,enumerable:!0,configurable:!0},target:{value:l,enumerable:!0,configurable:!0},identifier:{value:f,enumerable:!0,configurable:!0},active:{value:m,enumerable:!0,configurable:!0},x:{value:h,enumerable:!0,configurable:!0},y:{value:x,enumerable:!0,configurable:!0},dx:{value:w,enumerable:!0,configurable:!0},dy:{value:p,enumerable:!0,configurable:!0},_:{value:d}})}S.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function R(t){return!t.ctrlKey&&!t.button}function V(){return this.parentNode}function W(t,u){return u??{x:t.x,y:t.y}}function Z(){return navigator.maxTouchPoints||"ontouchstart"in this}function ee(){var t=R,u=V,c=W,l=Z,f={},m=H("start","drag","end"),h=0,x,w,p,d,E=0;function a(e){e.on("mousedown.drag",C).filter(l).on("touchstart.drag",N).on("touchmove.drag",O,J).on("touchend.drag touchcancel.drag",A).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function C(e,n){if(!(d||!t.call(this,e,n))){var r=z(this,u.call(this,e,n),e,n,"mouse");r&&(j(e.view).on("mousemove.drag",F,v).on("mouseup.drag",K,v),L(e.view),P(e),p=!1,x=e.clientX,w=e.clientY,r("start",e))}}function F(e){if(y(e),!p){var n=e.clientX-x,r=e.clientY-w;p=n*n+r*r>E}f.mouse("drag",e)}function K(e){j(e.view).on("mousemove.drag mouseup.drag",null),Q(e.view,p),y(e),f.mouse("end",e)}function N(e,n){if(t.call(this,e,n)){var r=e.changedTouches,o=u.call(this,e,n),s=r.length,g,b;for(g=0;g