/**
 * Highcharts JS v13.0.0 (2026-06-11)
 * @module highcharts/modules/variable-pie
 * @requires highcharts
 *
 * Variable Pie module for Highcharts
 *
 * (c) 2010-2026 Highsoft AS
 * Author: Grzegorz Blachliński
 *
 * A commercial license may be required depending on use,
 * see www.highcharts.com/license
 */import*as t from"../highcharts.js";var e={};e.n=t=>{var i=t&&t.__esModule?()=>t.default:()=>t;return e.d(i,{a:i}),i},e.d=(t,i)=>{for(var a in i)e.o(i,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:i[a]})},e.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);let i=t.default;var a=e.n(i);let r=t.default.SeriesRegistry;var s=e.n(r);let{pie:n}=s().seriesTypes;class l extends n{calculateExtremes(){let t,e,a=this.chart,r=a.plotWidth,s=a.plotHeight,n=this.options,l=2*(n.slicedOffset||0),o=[...this.getColumn("z",!1,!0)],h=Math.min(r,s)-l,p={},d=this.center||this.getCenter();for(let t of["minPointSize","maxPointSize"]){let e=n[t],i=/%$/.test(e);e=parseInt(e,10),p[t]=i?h*e/100:2*e}this.minPxSize=d[3]+p.minPointSize,this.maxPxSize=(0,i.clamp)(d[2],d[3]+p.minPointSize,p.maxPointSize),o.length&&(t=(0,i.pick)(n.zMin,(0,i.arrayMin)(o.filter(this.zValEval))),e=(0,i.pick)(n.zMax,(0,i.arrayMax)(o.filter(this.zValEval))),this.getRadii(t,e,this.minPxSize,this.maxPxSize))}getRadii(t,e,i,a){let r,s,n,l=[...this.getColumn("z",!1,!0)],o=[],h="radius"!==this.options.sizeBy,p=e-t;for(let d=0;d<l.length;d++)(s=this.zValEval(l[d])?l[d]:t)<=t?n=i/2:s>=e?n=a/2:(r=p>0?(s-t)/p:.5,h&&(r=Math.sqrt(r)),n=Math.ceil(i+r*(a-i))/2),o.push(n);this.radii=o}redraw(){this.center=null,super.redraw()}getDataLabelPosition(t,e){let{center:i,options:a}=this,r=t.angle||0,s=this.radii[t.index],n=i[0]+Math.cos(r)*s,l=i[1]+Math.sin(r)*s,o=Math.min((a.slicedOffset||0)+(a.borderWidth||0),e/5);return{distance:e,natural:{x:n+Math.cos(r)*e,y:l+Math.sin(r)*e},computed:{},alignment:t.half?"right":"left",connectorPosition:{breakAt:{x:n+Math.cos(r)*o,y:l+Math.sin(r)*o},touchingSliceAt:{x:n,y:l}}}}translate(t){this.generatePoints();let e=this.options,a=e.slicedOffset,r=e.startAngle||0,s=Math.PI/180*(r-90),n=Math.PI/180*((0,i.pick)(e.endAngle,r+360)-90),l=n-s,o=this.points,h=e.ignoreHiddenPoint,p=0,d,c,M,g,u,f,m;this.startAngleRad=s,this.endAngleRad=n,this.calculateExtremes(),t||(this.center=t=this.getCenter());for(let e=0;e<o.length;e++)f=o[e],m=this.radii[e],d=s+p*l,(!h||f.visible)&&(p+=f.percentage/100),c=s+p*l,f.shapeType="arc",f.shapeArgs={x:t[0],y:t[1],r:m,innerR:t[3]/2,start:Math.round(1e3*d)/1e3,end:Math.round(1e3*c)/1e3},(M=(c+d)/2)>1.5*Math.PI?M-=2*Math.PI:M<-Math.PI/2&&(M+=2*Math.PI),f.slicedTranslation={translateX:Math.round(Math.cos(M)*a),translateY:Math.round(Math.sin(M)*a)},g=Math.cos(M)*t[2]/2,u=Math.sin(M)*t[2]/2,f.tooltipPos=[t[0]+.7*g,t[1]+.7*u],f.half=+(M<-Math.PI/2||M>Math.PI/2),f.angle=M;(0,i.fireEvent)(this,"afterTranslate")}zValEval(t){return!("number"!=typeof t||isNaN(t))||null}}l.defaultOptions=(0,i.merge)(n.defaultOptions,{minPointSize:"10%",maxPointSize:"100%",zMin:void 0,zMax:void 0,sizeBy:"area",tooltip:{pointFormat:'<span style="color:{point.color}">●</span> {series.name}<br/>Value: {point.y}<br/>Size: {point.z}<br/>'}}),(0,i.extend)(l.prototype,{pointArrayMap:["y","z"],parallelArrays:["x","y","z"]}),s().registerSeriesType("variablepie",l);let o=a();export{o as default};