/** * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. * Original file: /npm/d3-drag@3.0.0/src/index.js * * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files */ import{dispatch as e}from"../d3-dispatch@3.0.1/b5f7cdc6.js";import{select as t,pointer as n}from"../d3-selection@3.0.0/5dcd62f4.js";const r={passive:!1},o={capture:!0,passive:!1};function a(e){e.stopImmediatePropagation()}function i(e){e.preventDefault(),e.stopImmediatePropagation()}function u(e){var n=e.document.documentElement,r=t(e).on("dragstart.drag",i,o);"onselectstart"in n?r.on("selectstart.drag",i,o):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function c(e,n){var r=e.document.documentElement,a=t(e).on("dragstart.drag",null);n&&(a.on("click.drag",i,o),setTimeout((function(){a.on("click.drag",null)}),0)),"onselectstart"in r?a.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}var l=e=>()=>e;function s(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:a,x:i,y:u,dx:c,dy:l,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:s}})}function f(e){return!e.ctrlKey&&!e.button}function d(){return this.parentNode}function g(e,t){return null==t?{x:e.x,y:e.y}:t}function h(){return navigator.maxTouchPoints||"ontouchstart"in this}function m(){var m,v,p,b,y=f,x=d,_=g,w=h,E={},T=e("start","drag","end"),j=0,k=0;function M(e){e.on("mousedown.drag",P).filter(w).on("touchstart.drag",S).on("touchmove.drag",U,r).on("touchend.drag touchcancel.drag",I).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function P(e,n){if(!b&&y.call(this,e,n)){var r=X(this,x.call(this,e,n),e,n,"mouse");r&&(t(e.view).on("mousemove.drag",z,o).on("mouseup.drag",D,o),u(e.view),a(e),p=!1,m=e.clientX,v=e.clientY,r("start",e))}}function z(e){if(i(e),!p){var t=e.clientX-m,n=e.clientY-v;p=t*t+n*n>k}E.mouse("drag",e)}function D(e){t(e.view).on("mousemove.drag mouseup.drag",null),c(e.view,p),i(e),E.mouse("end",e)}function S(e,t){if(y.call(this,e,t)){var n,r,o=e.changedTouches,i=x.call(this,e,t),u=o.length;for(n=0;n