import{a,t as M,k as V}from"./transform.B1W4q_4U.js";function j(r,u){return u<r?-1:u>r?1:u>=r?0:NaN}function q(r){return r}function B(){var r=q,u=j,o=null,p=a(0),m=a(M),h=a(0);function t(n){var e,l=(n=V(n)).length,f,k,y=0,g=new Array(l),i=new Array(l),c=+p.apply(this,arguments),A=Math.min(M,Math.max(-M,m.apply(this,arguments)-c)),d,w=Math.min(Math.abs(A)/l,h.apply(this,arguments)),N=w*(A<0?-1:1),s;for(e=0;e<l;++e)(s=i[g[e]=e]=+r(n[e],e,n))>0&&(y+=s);for(u!=null?g.sort(function(v,x){return u(i[v],i[x])}):o!=null&&g.sort(function(v,x){return o(n[v],n[x])}),e=0,k=y?(A-l*N)/y:0;e<l;++e,c=d)f=g[e],s=i[f],d=c+(s>0?s*k:0)+N,i[f]={data:n[f],index:e,value:s,startAngle:c,endAngle:d,padAngle:w};return i}return t.value=function(n){return arguments.length?(r=typeof n=="function"?n:a(+n),t):r},t.sortValues=function(n){return arguments.length?(u=n,o=null,t):u},t.sort=function(n){return arguments.length?(o=n,u=null,t):o},t.startAngle=function(n){return arguments.length?(p=typeof n=="function"?n:a(+n),t):p},t.endAngle=function(n){return arguments.length?(m=typeof n=="function"?n:a(+n),t):m},t.padAngle=function(n){return arguments.length?(h=typeof n=="function"?n:a(+n),t):h},t}export{B as d};
