function t(t){return t}var n=1e-6;function r(t){return"translate("+t+",0)"}function e(t){return"translate(0,"+t+")"}function i(t){return n=>+t(n)}function a(t,n){return n=Math.max(0,t.bandwidth()-2*n)/2,t.round()&&(n=Math.round(n)),r=>+t(r)+n}function o(){return!this.__axis}function u(u,c){var l=[],s=null,f=null,d=6,m=6,h=3,g="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,p=1===u||4===u?-1:1,k=4===u||2===u?"x":"y",x=1===u||3===u?r:e;function y(r){var e=null==s?c.ticks?c.ticks.apply(c,l):c.domain():s,y=null==f?c.tickFormat?c.tickFormat.apply(c,l):t:f,A=Math.max(d,0)+h,M=c.range(),v=+M[0]+g,w=+M[M.length-1]+g,_=(c.bandwidth?a:i)(c.copy(),g),F=r.selection?r.selection():r,V=F.selectAll(".domain").data([null]),b=F.selectAll(".tick").data(e,c).order(),z=b.exit(),H=b.enter().append("g").attr("class","tick"),C=b.select("line"),S=b.select("text");V=V.merge(V.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),b=b.merge(H),C=C.merge(H.append("line").attr("stroke","currentColor").attr(k+"2",p*d)),S=S.merge(H.append("text").attr("fill","currentColor").attr(k,p*A).attr("dy",1===u?"0em":3===u?"0.71em":"0.32em")),r!==F&&(V=V.transition(r),b=b.transition(r),C=C.transition(r),S=S.transition(r),z=z.transition(r).attr("opacity",n).attr("transform",function(t){return isFinite(t=_(t))?x(t+g):this.getAttribute("transform")}),H.attr("opacity",n).attr("transform",function(t){var n=this.parentNode.__axis;return x((n&&isFinite(n=n(t))?n:_(t))+g)})),z.remove(),V.attr("d",4===u||2===u?m?"M"+p*m+","+v+"H"+g+"V"+w+"H"+p*m:"M"+g+","+v+"V"+w:m?"M"+v+","+p*m+"V"+g+"H"+w+"V"+p*m:"M"+v+","+g+"H"+w),b.attr("opacity",1).attr("transform",function(t){return x(_(t)+g)}),C.attr(k+"2",p*d),S.attr(k,p*A).text(y),F.filter(o).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===u?"start":4===u?"end":"middle"),F.each(function(){this.__axis=_})}return y.scale=function(t){return arguments.length?(c=t,y):c},y.ticks=function(){return l=Array.from(arguments),y},y.tickArguments=function(t){return arguments.length?(l=null==t?[]:Array.from(t),y):l.slice()},y.tickValues=function(t){return arguments.length?(s=null==t?null:Array.from(t),y):s&&s.slice()},y.tickFormat=function(t){return arguments.length?(f=t,y):f},y.tickSize=function(t){return arguments.length?(d=m=+t,y):d},y.tickSizeInner=function(t){return arguments.length?(d=+t,y):d},y.tickSizeOuter=function(t){return arguments.length?(m=+t,y):m},y.tickPadding=function(t){return arguments.length?(h=+t,y):h},y.offset=function(t){return arguments.length?(g=+t,y):g},y}function c(t){return u(1,t)}function l(t){return u(3,t)}export{l as a,c as b};
