import{pasU}from"./chunk-BAOP5US2-BqSUEhjZ.js";import{aaasy,a2asz,aKasj,Basq,pasK,qasZ,sasH,gasJ,casQ,basX,_asp,lasG,vasY,dastt,Caset,Gasat,Oasrt,kasnt}from"./index-EOHikjcP.js";import{pasit}from"./gitGraph-YCYPL57B-CN6_i2o1.js";import{dasP}from"./arc-B4m5V1cp.js";import{oasst}from"./ordinal-Cboi1Yqb.js";import"./min-Dppjuofo.js";import"./_baseUniq-H04t_fXT.js";import"./init-Gi6I4Gst.js";functionot(t,a){returna<t?-1:a>t?1:a>=t?0:NaN}functionlt(t){returnt}functionct(){vart=lt,a=ot,m=null,o=y(0),g=y(z),x=y(0);functioni(e){varr,l=(e=j(e)).length,c,A,h=0,u=newArray(l),n=newArray(l),v=+o.apply(this,arguments),w=Math.min(z,Math.max(-z,g.apply(this,arguments)-v)),f,T=Math.min(Math.abs(w)/l,x.apply(this,arguments)),$=T*(w<0?-1:1),d;for(r=0;r<l;++r)(d=n[u[r]=r]=+t(e[r],r,e))>0&&(h+=d);for(a!=null?u.sort(function(S,C){returna(n[S],n[C])}):m!=null&&u.sort(function(S,C){returnm(e[S],e[C])}),r=0,A=h?(w-l*$)/h:0;r<l;++r,v=f)c=u[r],d=n[c],f=v+(d>0?d*A:0)+$,n[c]={data:e[c],index:r,value:d,startAngle:v,endAngle:f,padAngle:T};returnn}returni.value=function(e){returnarguments.length?(t=typeofe=="function"?e:y(+e),i):t},i.sortValues=function(e){returnarguments.length?(a=e,m=null,i):a},i.sort=function(e){returnarguments.length?(m=e,a=null,i):m},i.startAngle=function(e){returnarguments.length?(o=typeofe=="function"?e:y(+e),i):o},i.endAngle=function(e){returnarguments.length?(g=typeofe=="function"?e:y(+e),i):g},i.padAngle=function(e){returnarguments.length?(x=typeofe=="function"?e:y(+e),i):x},i}varR=q.pie,F={sections:newMap,showData:!1,config:R},b=F.sections,O=F.showData,ut=structuredClone(R),pt=p(()=>structuredClone(ut),"getConfig"),gt=p(()=>{b=newMap,O=F.showData,Y()},"clear"),dt=p(({label:t,value:a})=>{b.has(t)||(b.set(t,a),G.debug(`added new section: ${t}, with value: ${a}`))},"addSection"),ft=p(()=>b,"getSections"),mt=p(t=>{O=t},"setShowData"),ht=p(()=>O,"getShowData"),I={getConfig:pt,clear:gt,setDiagramTitle:K,getDiagramTitle:Z,setAccTitle:H,getAccTitle:J,setAccDescription:Q,getAccDescription:X,addSection:dt,getSections:ft,setShowData:mt,getShowData:ht},vt=p((t,a)=>{U(t,a),a.setShowData(t.showData),t.sections.map(a.addSection)},"populateDb"),St={parse:p(asynct=>{consta=awaitit("pie",t);G.debug(a),vt(a,I)},"parse")},yt=p(t=>`