import{n as e}from"./ordinal-DG-mcJZ_.js";import{n as t}from"./init-BXY6xdg3.js";function n(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}function r(){var i=e().unknown(void 0),a=i.domain,o=i.range,s=0,c=1,l,u,d=!1,f=0,p=0,m=.5;delete i.unknown;function h(){var e=a().length,t=c<s,r=t?c:s,i=t?s:c;l=(i-r)/Math.max(1,e-f+p*2),d&&(l=Math.floor(l)),r+=(i-r-l*(e-f))*m,u=l*(1-f),d&&(r=Math.round(r),u=Math.round(u));var h=n(e).map(function(e){return r+l*e});return o(t?h.reverse():h)}return i.domain=function(e){return arguments.length?(a(e),h()):a()},i.range=function(e){return arguments.length?([s,c]=e,s=+s,c=+c,h()):[s,c]},i.rangeRound=function(e){return[s,c]=e,s=+s,c=+c,d=!0,h()},i.bandwidth=function(){return u},i.step=function(){return l},i.round=function(e){return arguments.length?(d=!!e,h()):d},i.padding=function(e){return arguments.length?(f=Math.min(1,p=+e),h()):f},i.paddingInner=function(e){return arguments.length?(f=Math.min(1,e),h()):f},i.paddingOuter=function(e){return arguments.length?(p=+e,h()):p},i.align=function(e){return arguments.length?(m=Math.max(0,Math.min(1,e)),h()):m},i.copy=function(){return r(a(),[s,c]).round(d).paddingInner(f).paddingOuter(p).align(m)},t.apply(h(),arguments)}function i(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return i(t())},e}function a(){return i(r.apply(null,arguments).paddingInner(1))}export{a as n,r as t};