/**
 * Highcharts JS v11.2.0 (2023-10-30)
 *
 * Highcharts variwide module
 *
 * (c) 2010-2021 Torstein Honsi
 *
 * License: www.highcharts.com/license
 */!function(i){"object"==typeof module&&module.exports?(i.default=i,module.exports=i):"function"==typeof define&&define.amd?define("highcharts/modules/variwide",["highcharts"],function(t){return i(t),i.Highcharts=t,i}):i("undefined"!=typeof Highcharts?Highcharts:void 0)}(function(i){"use strict";var t=i?i._modules:{};function s(i,t,s,e){i.hasOwnProperty(t)||(i[t]=e.apply(null,s),"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:t,module:i[t]}})))}s(t,"Series/Variwide/VariwideComposition.js",[t["Core/Utilities.js"]],function(i){let{addEvent:t,wrap:s}=i,e=[];function r(i){this.variwide&&this.cross&&this.cross.attr("stroke-width",i.point&&i.point.crosshairWidth)}function o(){let i=this;!this.horiz&&this.variwide&&this.chart.labelCollectors.push(function(){return i.tickPositions.filter(t=>!!i.ticks[t].label).map((t,s)=>{let e=i.ticks[t].label;return e.labelrank=i.zData[s],e})})}function a(i){let t=this.axis,s=t.horiz?"x":"y";t.variwide&&(this[s+"Orig"]=i.pos[s],this.postTranslate(i.pos,s,this.pos))}function n(i,t,s){let e=this.axis,r=i[t]-e.pos;e.horiz||(r=e.len-r),r=e.series[0].postTranslate(s,r),e.horiz||(r=e.len-r),i[t]=e.pos+r}function h(i,t,s,e,r,o,a,n){let h=Array.prototype.slice.call(arguments,1),l=r?"x":"y";this.axis.variwide&&"number"==typeof this[l+"Orig"]&&(h[r?0:1]=this[l+"Orig"]);let d=i.apply(this,h);return this.axis.variwide&&this.axis.categories&&this.postTranslate(d,l,this.pos),d}return{compose:function(l,d){if(i.pushUnique(e,l)&&(t(l,"afterDrawCrosshair",r),t(l,"afterRender",o)),i.pushUnique(e,d)){t(d,"afterGetPosition",a);let i=d.prototype;i.postTranslate=n,s(i,"getLabelPosition",h)}}}}),s(t,"Series/Variwide/VariwidePoint.js",[t["Core/Series/SeriesRegistry.js"],t["Core/Utilities.js"]],function(i,t){let{column:{prototype:{pointClass:s}}}=i.seriesTypes,{isNumber:e}=t;return class extends s{constructor(){super(...arguments),this.crosshairWidth=void 0,this.options=void 0,this.series=void 0}isValid(){return e(this.y)&&e(this.z)}}}),s(t,"Series/Variwide/VariwideSeriesDefaults.js",[],function(){return{pointPadding:0,groupPadding:0}}),s(t,"Series/Variwide/VariwideSeries.js",[t["Core/Series/SeriesRegistry.js"],t["Series/Variwide/VariwideComposition.js"],t["Series/Variwide/VariwidePoint.js"],t["Series/Variwide/VariwideSeriesDefaults.js"],t["Core/Utilities.js"]],function(i,t,s,e,r){let{column:o}=i.seriesTypes,{addEvent:a,extend:n,merge:h,pick:l}=r;class d extends o{constructor(){super(...arguments),this.data=void 0,this.options=void 0,this.points=void 0,this.relZ=void 0,this.totalZ=void 0,this.zData=void 0}processData(t){this.totalZ=0,this.relZ=[],i.seriesTypes.column.prototype.processData.call(this,t),(this.xAxis.reversed?this.zData.slice().reverse():this.zData).forEach(function(i,t){this.relZ[t]=this.totalZ,this.totalZ+=i},this),this.xAxis.categories&&(this.xAxis.variwide=!0,this.xAxis.zData=this.zData)}postTranslate(i,t,s){let e=this.xAxis,r=this.relZ,o=e.reversed?r.length-i:i,a=e.reversed?-1:1,n=e.toPixels(e.reversed?(e.dataMax||0)+e.pointRange:e.dataMin||0),h=e.toPixels(e.reversed?e.dataMin||0:(e.dataMax||0)+e.pointRange),d=Math.abs(h-n),p=this.totalZ,c=this.chart.inverted?h-(this.chart.plotTop-a*e.minPixelPadding):n-this.chart.plotLeft-a*e.minPixelPadding,u=o/r.length*d,f=(o+a)/r.length*d,x=l(r[o],p)/p*d,w=l(r[o+a],p)/p*d;return s&&(s.crosshairWidth=w-x),c+x+(t-(c+u))*(w-x)/(f-u)}translate(){this.crispOption=this.options.crisp,this.options.crisp=!1,super.translate(),this.options.crisp=this.crispOption}correctStackLabels(){let i,t,s,e;let r=this.options,o=this.yAxis;for(let a of this.points)e=a.x,t=a.shapeArgs.width,(s=o.stacking.stacks[(this.negStacks&&a.y<(r.startFromThreshold?0:r.threshold)?"-":"")+this.stackKey])&&(i=s[e])&&!a.isNull&&i.setOffset(-(t/2)||0,t||0,void 0,void 0,a.plotX,this.xAxis)}}return d.compose=t.compose,d.defaultOptions=h(o.defaultOptions,e),a(d,"afterColumnTranslate",function(){let i=this.xAxis,t=this.chart.inverted,s=this.borderWidth%2/2,e=-1;for(let r of this.points){let o,a;++e;let n=r.shapeArgs||{},{x:h=0,width:l=0}=n,{plotX:d=0,tooltipPos:p,z:c=0}=r;i.variwide?(o=this.postTranslate(e,h,r),a=this.postTranslate(e,h+l)):(o=d,a=i.translate(r.x+c,!1,!1,!1,!0)),this.crispOption&&(o=Math.round(o)-s,a=Math.round(a)-s),n.x=o,n.width=Math.max(a-o,1),r.plotX=(o+a)/2,p&&(t?p[1]=i.len-n.x-n.width/2:p[0]=n.x+n.width/2)}this.options.stacking&&this.correctStackLabels()},{order:2}),n(d.prototype,{irregularWidths:!0,pointArrayMap:["y","z"],parallelArrays:["x","y","z"],pointClass:s}),i.registerSeriesType("variwide",d),d}),s(t,"masters/modules/variwide.src.js",[t["Core/Globals.js"],t["Series/Variwide/VariwideSeries.js"]],function(i,t){t.compose(i.Axis,i.Tick)})});//# sourceMappingURL=variwide.js.map