import{B as e,G as t,H as n,J as r,V as i}from"./src-BrOGWJpF.js";import{i as a,n as o,r as s,t as c}from"./defaultLocale-C8Fc0cco.js";import{t as l}from"./init-D6jRqBbL.js";function u(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function d(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function f(e){let t,n,r;e.length===2?(t=e===u||e===d?e:p,n=e,r=e):(t=u,n=(t,n)=>u(e(t),n),r=(t,n)=>e(t)-n);function i(e,r,i=0,a=e.length){if(i>>1;n(e[t],r)<0?i=t+1:a=t}while(i>>1;n(e[t],r)<=0?i=t+1:a=t}while(in&&r(e[o-1],t)>-r(e[o],t)?o-1:o}return{left:i,center:o,right:a}}function p(){return 0}function m(e){return e===null?NaN:+e}var h=f(u),g=h.right;h.left,f(m).center;var _=Math.sqrt(50),v=Math.sqrt(10),y=Math.sqrt(2);function b(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=_?10:a>=v?5:a>=y?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/lt&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*lt&&--c),c0))return[];if(e===t)return[e];let r=t=i))return[];let s=a-i+1,c=Array(s);if(r)if(o<0)for(let e=0;et&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function B(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i2?V:B,l=u=null,f}function f(i){return i==null||isNaN(i=+i)?o:(l||=c(e.map(r),t,n))(r(s(i)))}return f.invert=function(n){return s(a((u||=c(t,e.map(r),i))(n)))},f.domain=function(t){return arguments.length?(e=Array.from(t,F),d()):e.slice()},f.range=function(e){return arguments.length?(t=Array.from(e),d()):t.slice()},f.rangeRound=function(e){return t=Array.from(e),n=A,d()},f.clamp=function(e){return arguments.length?(s=e?!0:L,d()):s!==L},f.interpolate=function(e){return arguments.length?(n=e,d()):n},f.unknown=function(e){return arguments.length?(o=e,f):o},function(e,t){return r=e,a=t,d()}}function W(){return U()(L,L)}function G(e,t,n,r){var i=C(e,t,n),a;switch(r=s(r??`,f`),r.type){case`s`:var l=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=M(i,l))&&(r.precision=a),o(r,l);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=N(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=j(i))&&(r.precision=a-(r.type===`%`)*2);break}return c(r)}function K(e){var t=e.domain;return e.ticks=function(e){var n=t();return x(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return G(r[0],r[r.length-1],e??10,n)},e.nice=function(n){n??=10;var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s0;){if(l=S(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function q(){var e=W();return e.copy=function(){return H(e,q())},l.apply(e,arguments),K(e)}export{U as a,x as c,H as i,f as l,K as n,k as o,W as r,C as s,q as t};