apexcharts 8.2.0 → 8.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/dist/apexcharts.common.js +2 -2
- package/dist/apexcharts.core.js +271 -173
- package/dist/apexcharts.core.min.js +2 -2
- package/dist/apexcharts.css +35 -0
- package/dist/apexcharts.esm.js +1722 -1527
- package/dist/apexcharts.full.js +1459 -1075
- package/dist/apexcharts.full.min.js +2 -2
- package/dist/apexcharts.js +994 -715
- package/dist/apexcharts.min.js +2 -2
- package/dist/apexcharts.ssr.common.js +2 -2
- package/dist/apexcharts.ssr.esm.js +994 -715
- package/dist/area.common.js +2 -2
- package/dist/area.esm.js +91 -40
- package/dist/bar.common.js +2 -2
- package/dist/bar.esm.js +433 -394
- package/dist/bar.js +2 -2
- package/dist/boxPlot.common.js +2 -2
- package/dist/boxPlot.esm.js +364 -322
- package/dist/bubble.common.js +2 -2
- package/dist/bubble.esm.js +91 -40
- package/dist/candlestick.common.js +2 -2
- package/dist/candlestick.esm.js +364 -322
- package/dist/candlestick.js +2 -2
- package/dist/column.common.js +2 -2
- package/dist/column.esm.js +433 -394
- package/dist/core.common.js +2 -2
- package/dist/core.esm.js +271 -173
- package/dist/donut.common.js +1 -1
- package/dist/donut.esm.js +1 -1
- package/dist/dumbbell.common.js +2 -2
- package/dist/dumbbell.esm.js +433 -394
- package/dist/features/all.common.js +2 -2
- package/dist/features/all.esm.js +250 -187
- package/dist/features/annotations.common.js +1 -1
- package/dist/features/annotations.esm.js +1 -1
- package/dist/features/annotations.js +1 -1
- package/dist/features/context-menu.common.js +1 -1
- package/dist/features/context-menu.esm.js +1 -1
- package/dist/features/context-menu.js +1 -1
- package/dist/features/drilldown.common.js +2 -2
- package/dist/features/drilldown.esm.js +4 -2
- package/dist/features/drilldown.js +2 -2
- package/dist/features/dumbbell.common.js +1 -1
- package/dist/features/dumbbell.esm.js +1 -1
- package/dist/features/dumbbell.js +1 -1
- package/dist/features/exports.common.js +1 -1
- package/dist/features/exports.esm.js +1 -1
- package/dist/features/exports.js +1 -1
- package/dist/features/facet.common.js +1 -1
- package/dist/features/facet.esm.js +1 -1
- package/dist/features/facet.js +1 -1
- package/dist/features/highlight-filter.common.js +2 -2
- package/dist/features/highlight-filter.esm.js +14 -9
- package/dist/features/highlight-filter.js +2 -2
- package/dist/features/history.common.js +1 -1
- package/dist/features/history.esm.js +1 -1
- package/dist/features/history.js +1 -1
- package/dist/features/ink.common.js +1 -1
- package/dist/features/ink.esm.js +1 -1
- package/dist/features/ink.js +1 -1
- package/dist/features/keyboard.common.js +2 -2
- package/dist/features/keyboard.esm.js +97 -145
- package/dist/features/keyboard.js +2 -2
- package/dist/features/legend.common.js +2 -2
- package/dist/features/legend.esm.js +63 -43
- package/dist/features/legend.js +2 -2
- package/dist/features/link.common.js +1 -1
- package/dist/features/link.esm.js +1 -1
- package/dist/features/link.js +1 -1
- package/dist/features/marks.common.js +1 -1
- package/dist/features/marks.esm.js +1 -1
- package/dist/features/marks.js +1 -1
- package/dist/features/measure.common.js +1 -1
- package/dist/features/measure.esm.js +1 -1
- package/dist/features/measure.js +1 -1
- package/dist/features/morph.common.js +1 -1
- package/dist/features/morph.esm.js +1 -1
- package/dist/features/morph.js +1 -1
- package/dist/features/perspectives.common.js +1 -1
- package/dist/features/perspectives.esm.js +1 -1
- package/dist/features/perspectives.js +1 -1
- package/dist/features/raincloud.common.js +1 -1
- package/dist/features/raincloud.esm.js +1 -1
- package/dist/features/raincloud.js +1 -1
- package/dist/features/renderer-canvas.common.js +2 -2
- package/dist/features/renderer-canvas.esm.js +2 -1
- package/dist/features/renderer-canvas.js +2 -2
- package/dist/features/stats.common.js +1 -1
- package/dist/features/stats.esm.js +1 -1
- package/dist/features/stats.js +1 -1
- package/dist/features/storyboard.common.js +1 -1
- package/dist/features/storyboard.esm.js +1 -1
- package/dist/features/storyboard.js +1 -1
- package/dist/features/streamgraph.common.js +2 -2
- package/dist/features/streamgraph.esm.js +3 -2
- package/dist/features/streamgraph.js +2 -2
- package/dist/features/toolbar.common.js +2 -2
- package/dist/features/toolbar.esm.js +92 -2
- package/dist/features/toolbar.js +2 -2
- package/dist/features/trellis.common.js +2 -2
- package/dist/features/trellis.esm.js +83 -47
- package/dist/features/trellis.js +2 -2
- package/dist/features/waterfall.common.js +1 -1
- package/dist/features/waterfall.esm.js +1 -1
- package/dist/features/waterfall.js +1 -1
- package/dist/features/weave.common.js +1 -1
- package/dist/features/weave.esm.js +1 -1
- package/dist/features/weave.js +1 -1
- package/dist/full.common.js +2 -2
- package/dist/full.esm.js +950 -795
- package/dist/heatmap.common.js +2 -2
- package/dist/heatmap.esm.js +3 -17
- package/dist/heatmap.js +2 -2
- package/dist/histogram.common.js +2 -2
- package/dist/histogram.esm.js +433 -394
- package/dist/icicle.common.js +2 -2
- package/dist/icicle.esm.js +54 -38
- package/dist/icicle.js +2 -2
- package/dist/line.common.js +2 -2
- package/dist/line.esm.js +91 -40
- package/dist/line.js +2 -2
- package/dist/locales/en.json +2 -1
- package/dist/locales/ro.json +3 -2
- package/dist/pictograms.common.js +1 -1
- package/dist/pictograms.esm.js +1 -1
- package/dist/pictograms.js +1 -1
- package/dist/pie.common.js +1 -1
- package/dist/pie.esm.js +1 -1
- package/dist/pie.js +1 -1
- package/dist/polarArea.common.js +1 -1
- package/dist/polarArea.esm.js +1 -1
- package/dist/radar.common.js +2 -2
- package/dist/radar.esm.js +5 -4
- package/dist/radar.js +2 -2
- package/dist/radialBar.common.js +1 -1
- package/dist/radialBar.esm.js +1 -1
- package/dist/radialBar.js +1 -1
- package/dist/raincloud.common.js +2 -2
- package/dist/raincloud.esm.js +72 -26
- package/dist/rangeArea.common.js +2 -2
- package/dist/rangeArea.esm.js +91 -40
- package/dist/rangeBar.common.js +2 -2
- package/dist/rangeBar.esm.js +433 -394
- package/dist/scatter.common.js +2 -2
- package/dist/scatter.esm.js +91 -40
- package/dist/streamgraph.common.js +2 -2
- package/dist/streamgraph.esm.js +93 -41
- package/dist/sunburst.common.js +2 -2
- package/dist/sunburst.esm.js +103 -93
- package/dist/sunburst.js +2 -2
- package/dist/treemap.common.js +2 -2
- package/dist/treemap.esm.js +105 -86
- package/dist/treemap.js +2 -2
- package/dist/unit-shapes.common.js +1 -1
- package/dist/unit-shapes.esm.js +1 -1
- package/dist/unit-shapes.js +1 -1
- package/dist/unit.common.js +2 -2
- package/dist/unit.esm.js +280 -202
- package/dist/unit.js +2 -2
- package/dist/violin.common.js +2 -2
- package/dist/violin.esm.js +72 -26
- package/dist/violin.js +2 -2
- package/dist/waterfall.common.js +2 -2
- package/dist/waterfall.esm.js +432 -393
- package/package.json +1 -1
- package/src/apexcharts.js +13 -6
- package/src/assets/apexcharts.css +35 -0
- package/src/charts/Bar.js +62 -55
- package/src/charts/BarStacked.js +80 -88
- package/src/charts/BoxCandleStick.js +28 -31
- package/src/charts/Icicle.js +37 -37
- package/src/charts/Line.js +118 -42
- package/src/charts/Radar.js +5 -7
- package/src/charts/RangeBar.js +47 -43
- package/src/charts/Sunburst.js +101 -98
- package/src/charts/Treemap.js +108 -66
- package/src/charts/Unit.js +368 -250
- package/src/charts/Violin.js +48 -30
- package/src/charts/common/Breadcrumb.js +2 -2
- package/src/charts/common/Hierarchy.js +32 -11
- package/src/charts/common/Jitter.js +32 -7
- package/src/charts/common/bar/DataLabels.js +76 -81
- package/src/charts/common/bar/Helpers.js +43 -7
- package/src/charts/common/line/Helpers.js +12 -15
- package/src/charts/common/partition/NodeTooltip.js +8 -1
- package/src/charts/common/partition/Partition.js +33 -1
- package/src/charts/common/treemap/Helpers.js +3 -11
- package/src/locales/en.json +2 -1
- package/src/locales/ro.json +3 -2
- package/src/modules/Core.js +4 -0
- package/src/modules/CoreUtils.js +18 -42
- package/src/modules/Data.js +23 -24
- package/src/modules/DataLabels.js +6 -6
- package/src/modules/Graphics.js +62 -49
- package/src/modules/Markers.js +3 -1
- package/src/modules/Range.js +44 -29
- package/src/modules/RendererController.js +17 -3
- package/src/modules/Scales.js +32 -9
- package/src/modules/Series.js +39 -18
- package/src/modules/Theme.js +1 -1
- package/src/modules/ZoomPanSelection.js +119 -2
- package/src/modules/accessibility/KeyboardNavigation.js +114 -186
- package/src/modules/animations/LengthTransition.js +22 -2
- package/src/modules/drilldown/Breadcrumb.js +5 -2
- package/src/modules/helpers/Destroy.js +1 -1
- package/src/modules/highlightFilter/HighlightFilter.js +8 -9
- package/src/modules/highlightFilter/TreemapPart.js +2 -2
- package/src/modules/legend/HeatmapGradientLegend.js +76 -45
- package/src/modules/legend/Helpers.js +2 -0
- package/src/modules/legend/Legend.js +11 -12
- package/src/modules/settings/Options.js +7 -0
- package/src/modules/streamgraph/StreamLabels.js +1 -0
- package/src/modules/tooltip/Tooltip.js +20 -4
- package/src/modules/tooltip/Utils.js +8 -0
- package/src/modules/trellis/Trellis.js +6 -0
- package/src/modules/trellis/TrellisChrome.js +18 -7
- package/src/modules/trellis/TrellisSync.js +2 -0
- package/src/renderers/canvas/CanvasGraphics.js +1 -0
- package/src/ssr/DOMShim.js +10 -0
- package/src/types/internal.d.ts +9 -3
- package/types/apexcharts.d.ts +31 -12
package/dist/donut.common.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v8.
|
|
2
|
+
* ApexCharts v8.3.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
5
|
"use strict";var e=Object.defineProperty,t=Object.defineProperties,a=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,n=(t,a,i)=>a in t?e(t,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[a]=i,r=(e,t)=>{for(var a in t||(t={}))s.call(t,a)&&n(e,a,t[a]);if(i)for(var a of i(t))l.call(t,a)&&n(e,a,t[a]);return e},o=(e,i)=>t(e,a(i));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function h(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const a in e)if("default"!==a){const i=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,i.get?i:{enumerable:!0,get:()=>e[a]})}return t.default=e,Object.freeze(t)}const c=h(require("apexcharts/core")),d=c.__apex_Animations,g=c.__apex_Fill,p=c.__apex_Utils,u=c.__apex_Graphics,f=c.__apex_Filters,b=c.__apex_Scales;class m{constructor(e){this.w=e}drawYAxisTexts(e,t,a,i){const s=this.w,l=s.config.yaxis[0],n=s.formatters.yLabelFormatters[0];return new u(this.w).drawText({x:e+l.labels.offsetX,y:t+l.labels.offsetY,text:n(i,a),textAnchor:"middle",fontSize:l.labels.style.fontSize,fontFamily:l.labels.style.fontFamily,foreColor:Array.isArray(l.labels.style.colors)?l.labels.style.colors[a]:l.labels.style.colors})}getMaxLabelWidth(e,{fontSize:t,fontFamily:a,fontWeight:i}={}){const s=new u(this.w);let l=0;return e.forEach(e=>{if(null==e||""===e)return;const n=s.getTextRects(`${e}`,t||"12px",a,"",!0,i);l=Math.max(l,n.width)}),l}drawExternalLabel(e){return function(e,t){const{lines:a,lineHeight:i,anchor:s,elbow:l,labelX:n,labelY:r,side:o,connector:h,style:c,foreColor:d}=t,g=new u(e),p=g.group({class:t.groupClass||"apexcharts-outer-label-group"});if(h.show){const e=`M ${s.x} ${s.y} L ${l.x} ${l.y} L ${n} ${r}`,a=g.drawPath({d:e,stroke:h.color,strokeWidth:h.width,fill:"none",strokeLinecap:"round"});a.node.classList.add(t.connectorClass||"apexcharts-outer-label-connector"),p.add(a)}const f="right"===o?n+4:n-4,b=a.length,m=r-(b-1)*i/2,x=g.drawText({x:f,y:m,text:1===b?a[0]:a,textAnchor:"right"===o?"start":"end",fontSize:c.fontSize,fontFamily:c.fontFamily,fontWeight:c.fontWeight,foreColor:d,dominantBaseline:"central",cssClass:t.textClass||"apexcharts-outer-label"});if(b>1){const e=x.node.getElementsByTagName("tspan");for(let t=0;t<e.length;t++)e[t].setAttribute("x",`${f}`),e[t].setAttribute("dy",0===t?"0":`${i}`)}return p.add(x),p}(this.w,o(r({},e),{groupClass:"apexcharts-pie-name-label-group",textClass:"apexcharts-pie-name-label",connectorClass:"apexcharts-pie-label-connector"}))}}const x=c.__apex_Environment_Environment,y=Math.PI/180,A=180/Math.PI;function S(e,t,a,i){return{x:e+a*Math.cos((i-90)*y),y:t+a*Math.sin((i-90)*y)}}const w=e=>`${e.x} ${e.y}`;function v({cx:e,cy:t,rIn:a,rOut:i,a0:s,a1:l,r:n,spanDeg:r}){const o=(a,i)=>S(e,t,a,i),h=n/i*A,c=n/a*A,d=o(i,s+h),g=o(i,l-h),p=r-2*h>180?1:0,u=o(i,l),f=o(i-n,l),b=o(i,s),m=o(i-n,s),x=o(a,l-c),y=o(a,s+c),v=r-2*c>180?1:0,L=o(a,l),O=o(a+n,l),z=o(a,s),C=o(a+n,s);return["M",w(d),"A",i,i,0,p,1,w(g),"Q",w(u),w(f),"L",w(O),"Q",w(L),w(x),"A",a,a,0,v,0,w(y),"Q",w(z),w(C),"L",w(m),"Q",w(b),w(d),"Z"].join(" ")}class L{constructor(e,t){this.ctx=t,this.w=e,this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animBeginArr=[0],this.animDur=0,this.donutDataLabels=this.w.config.plotOptions.pie.donut.labels,this.lineColorArr=void 0!==e.globals.stroke.colors?e.globals.stroke.colors:e.globals.colors,this.defaultSize=Math.min(e.layout.gridWidth,e.layout.gridHeight),this.centerY=e.layout.gridHeight/2,this.centerX=e.layout.gridWidth/2,"radialBar"===e.config.chart.type?this.fullAngle=360:this.fullAngle=Math.abs(e.config.plotOptions.pie.endAngle-e.config.plotOptions.pie.startAngle),this.initialAngle=e.config.plotOptions.pie.startAngle%this.fullAngle,e.globals.radialSize=this.defaultSize/2.05-e.config.stroke.width-(e.config.chart.sparkline.enabled?0:e.config.chart.dropShadow.blur),this.externalCfg=e.config.plotOptions.pie.dataLabels.external;const a=e.config.dataLabels.style;this.externalLabelStyle={fontSize:this.externalCfg.fontSize||a.fontSize,fontFamily:this.externalCfg.fontFamily||a.fontFamily,fontWeight:this.externalCfg.fontWeight||a.fontWeight},this.externalLabels=[],this.externalLabelMaxLines=1,this.externalLabelLineH=parseFloat(this.externalLabelStyle.fontSize)||12,e.globals.pieExternalLabelMarginY=0,this.showExternalLabels=this.externalCfg.show&&"polarArea"!==this.chartType,this.showExternalLabels&&!e.globals.noData&&this.reserveExternalLabelSpace(),this.donutSize=e.globals.radialSize*parseInt(e.config.plotOptions.pie.donut.size,10)/100;const i=e.config.plotOptions.pie.customScale,s=e.layout.gridWidth/2,l=e.layout.gridHeight/2;this.translateX=s-s*i,this.translateY=l-l*i,this.dataLabelsGroup=new u(this.w).group({class:"apexcharts-datalabels-group",transform:`translate(${this.translateX}, ${this.translateY}) scale(${i})`}),this.maxY=0,this.sliceLabels=[],this.sliceSizes=[],this.prevSliceSizes=[],this.sliceLabelGroups={},this.externalLabelGroups={},this.elHoverOutline=null,this.elHoverOutlinePath=null,this.hoverOutlineIndex=-1,this.prevSectorAngleArr=[]}getExternalLabelText(e){var t,a,i;const s=this.w,l=s.seriesData.seriesNames[e],n=this.externalCfg.formatter;return"function"==typeof n?n(l,{seriesIndex:e,percent:null==(a=null==(t=s.globals.seriesPercent)?void 0:t[e])?void 0:a[0],value:null==(i=s.globals.seriesTotals)?void 0:i[e],w:s}):null==l?"":`${l}`}getExternalLabelLines(e){const t=this.getExternalLabelText(e);return(Array.isArray(t)?t:`${null==t?"":t}`.split("\n")).map(e=>null==e?"":`${e}`)}reserveExternalLabelSpace(){const e=this.w,t=new m(e),a=(e.seriesData.seriesNames||[]).map((e,t)=>this.getExternalLabelLines(t)),i=t.getMaxLabelWidth(a.flat(),this.externalLabelStyle);this.externalLabelMaxLines=a.reduce((e,t)=>Math.max(e,t.length),1),this.externalLabelLineH=Math.round(1.35*(parseFloat(this.externalLabelStyle.fontSize)||12));const s=this.externalCfg.connector,l=this.externalLabelMaxLines*this.externalLabelLineH,n=i+(s.length||0)+(s.gap||0)+12,r=l/2+(s.gap||0)+6,o=Math.min(e.globals.radialSize,e.layout.gridWidth/2-n,e.layout.gridHeight/2-r);e.globals.radialSize=Math.max(o,.15*this.defaultSize),e.globals.pieExternalLabelMarginY=r;const h=e.config.chart.height?String(e.config.chart.height):"",c=""!==h&&"auto"!==h;this.centerY=c?e.layout.gridHeight/2:e.globals.radialSize+r}draw(e){var t,a;const i=this.w,s=new u(this.w),l=s.group({class:"apexcharts-pie"});if(i.globals.noData)return l;null==(t=this.ctx.highlightFilter)||t.pie(this);const n=i.config.plotOptions.pie.customScale,r="donut"===this.chartType?this.donutSize:0,o=[],h=this.initialAngle,c=(e,t)=>this.translateY+n*p.polarToCartesian(this.centerX,this.centerY,e,t).y;for(let e=h;e<=h+this.fullAngle;e++)o.push(c(i.globals.radialSize,e),c(r,e));this.donutDataLabels.show&&o.push(c(r,180)),i.globals.circleGeometry={node:l.node,cx:this.translateX+n*this.centerX,cy:this.translateY+n*this.centerY,r:n*i.globals.radialSize,y:"polarArea"!==this.chartType&&[Math.min(...o),Math.max(...o)]};let d=0;for(let t=0;t<e.length;t++)d+=p.negToZero(e[t]);const g=[],f=s.group();0===d&&(d=1e-5),e.forEach(e=>{this.maxY=Math.max(this.maxY,e)}),i.config.yaxis[0].max&&(this.maxY=i.config.yaxis[0].max),"back"===i.config.grid.position&&"polarArea"===this.chartType&&this.drawPolarElements(l);const b=i.globals.collapsedSeriesIndices||[];let m=1;if("polarArea"===this.chartType){let t=0;for(let a=0;a<e.length;a++)-1===b.indexOf(a)&&t++;m=Math.max(1,t)}for(let t=0;t<e.length;t++){const a=this.fullAngle*p.negToZero(e[t])/d;g.push(a),"polarArea"===this.chartType?(g[t]=b.indexOf(t)>-1?0:this.fullAngle/m,this.sliceSizes.push(i.globals.radialSize*p.negToZero(e[t])/(this.maxY||1))):this.sliceSizes.push(i.globals.radialSize)}const x=!0===(null==(a=this.ctx.morphTypeChange)?void 0:a.isActive());if(i.globals.dataChanged&&!x){if("polarArea"===this.chartType){const e=i.globals.previousPaths,t=i.globals.prevPolarAngles;if(Array.isArray(t)&&t.length===e.length)this.prevSectorAngleArr=t.slice();else for(let t=0;t<e.length;t++)this.prevSectorAngleArr.push(this.fullAngle/Math.max(1,e.length));const a=i.globals.prevPolarSizes;if(Array.isArray(a)&&a.length===e.length)this.prevSliceSizes=a.map(e=>e*i.globals.radialSize);else{let t=0;for(let a=0;a<e.length;a++)t=Math.max(t,p.negToZero(e[a]));i.config.yaxis[0].max&&(t=i.config.yaxis[0].max),this.prevSliceSizes=e.map(e=>i.globals.radialSize*p.negToZero(e)/(t||1))}}else{let e=0;for(let t=0;t<i.globals.previousPaths.length;t++)e+=p.negToZero(i.globals.previousPaths[t]);for(let t=0;t<i.globals.previousPaths.length;t++)this.prevSectorAngleArr.push(e?this.fullAngle*p.negToZero(i.globals.previousPaths[t])/e:0)}for(;!1!==i.globals.shouldAnimate&&this.prevSectorAngleArr.length<e.length;)this.prevSectorAngleArr.push(0)}if("polarArea"===this.chartType){i.globals.prevPolarAngles=g.slice();const e=i.globals.radialSize||1;i.globals.prevPolarSizes=this.sliceSizes.map(t=>t/e)}if(this.donutSize<0&&(this.donutSize=0),"donut"===this.chartType){const e=s.drawCircle(this.donutSize);e.attr({cx:this.centerX,cy:this.centerY,fill:i.config.plotOptions.pie.donut.background?i.config.plotOptions.pie.donut.background:"transparent"}),f.add(e)}const y=this.drawArcs(g,e);if(this.sliceLabels.forEach(e=>{y.add(e)}),f.attr({transform:`translate(${this.translateX}, ${this.translateY}) scale(${i.config.plotOptions.pie.customScale})`}),f.add(y),l.add(f),this.donutDataLabels.show){const e=this.initialAnim&&!i.globals.resized&&!i.globals.dataChanged&&this.animDur>0,t=this.renderInnerDataLabels(this.dataLabelsGroup,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:e?0:this.donutDataLabels.show});if(e){const e=this.dataLabelsGroup.node;e.style.transition="opacity 280ms ease-out",setTimeout(()=>{e.style.opacity="1"},this.animDur)}l.add(t)}return"front"===i.config.grid.position&&"polarArea"===this.chartType&&this.drawPolarElements(l),l}drawArcs(e,t){var a,i,s,l,n;const r=this.w,o=new f(this.w),h=new u(this.w),c=new g(this.w),d=h.group({class:"apexcharts-slices"});this.elHoverOutline=h.group({class:"apexcharts-pie-hover-outline"}),this.elHoverOutline.node.style.pointerEvents="none",this.elHoverOutline.node.style.opacity="0",r.config.chart.animations.enabled&&(this.elHoverOutline.node.style.transition="opacity 180ms ease-out"),d.add(this.elHoverOutline);let b=this.initialAngle,y=this.initialAngle,A=this.initialAngle,S=this.initialAngle;this.strokeWidth=r.config.stroke.show?r.config.stroke.width:0;const w=!0===(null==(a=this.ctx.morphTypeChange)?void 0:a.isActive());for(let a=0;a<e.length;a++){const g=h.group({class:"apexcharts-series apexcharts-pie-series",seriesName:p.escapeString(r.seriesData.seriesNames[a]),rel:a+1,"data:realIndex":a});d.add(g),b=A,y=S,A=b+e[a],S=y+this.prevSectorAngleArr[a];const m=A<b?this.fullAngle+A-b:A-b,x=c.fillPath({seriesNumber:a,size:this.sliceSizes[a],value:t[a]}),v=w?this.ctx.morphTypeChange.getInitialPathFor(a,0):null,L="polarArea"===this.chartType&&r.globals.dataChanged&&!w?this.prevSliceSizes[a]||0:void 0,O=v||this.getChangedPath(y,S,L),z=h.drawPath({d:O,stroke:Array.isArray(this.lineColorArr)?null!=(i=this.lineColorArr[a])?i:this.lineColorArr[a%this.lineColorArr.length]:this.lineColorArr,strokeWidth:0,fill:x,fillOpacity:r.config.fill.opacity,classes:`apexcharts-pie-area apexcharts-${this.chartType.toLowerCase()}-slice-${a}`});if(z.attr({index:0,j:a}),o.setSelectionFilter(z,0,a),r.config.chart.dropShadow.enabled){const e=r.config.chart.dropShadow;o.dropShadow(z,e,a)}this.addListeners(z,this.donutDataLabels,a);let C={x:0,y:0};const P=(b+m/2)%this.fullAngle;let T={x:this.centerX,y:this.centerY};"pie"===this.chartType||"polarArea"===this.chartType?(C=p.polarToCartesian(this.centerX,this.centerY,r.globals.radialSize/1.25+r.config.plotOptions.pie.dataLabels.offset,P),T=p.polarToCartesian(this.centerX,this.centerY,r.globals.radialSize/2,P)):"donut"===this.chartType&&(C=p.polarToCartesian(this.centerX,this.centerY,(r.globals.radialSize+this.donutSize)/2+r.config.plotOptions.pie.dataLabels.offset,P),T=p.polarToCartesian(this.centerX,this.centerY,(r.globals.radialSize+this.donutSize)/2,P)),u.setAttrs(z.node,{"data:angle":m,"data:startAngle":b,"data:strokeWidth":this.strokeWidth,"data:value":t[a],"data:cx":T.x,"data:cy":T.y}),g.add(z);let Y=!1;if(w){const e=this.getPiePath({me:this,startAngle:b,angle:m,size:this.sliceSizes[a]});z.node.setAttribute("data:pathFinal",e),Y=!0===(null==(l=(s=this.ctx.morphTypeChange).claimsTargetMark)?void 0:l.call(s,a,0)),Y&&(z.attr({d:e}),z.node.setAttribute("data:pathOrig",e),z.node.setAttribute("opacity","0"),z.node.setAttribute("data-piece-hidden","1"))}const D=(r.globals.collapsedSeriesIndices||[]).includes(a);let M=0;if(!this.initialAnim||r.globals.resized||r.globals.dataChanged?this.animBeginArr.push(0):(M=m/this.fullAngle*r.config.chart.animations.speed,0===M&&(M=1),this.animDur=M+this.animDur,this.animBeginArr.push(this.animDur)),Y);else if(w&&v){const e=this.getPiePath({me:this,startAngle:b,angle:m,size:this.sliceSizes[a]}),t=this.ctx.morphTypeChange.getSpeed(),i=this.ctx.animations;z.node.setAttribute("data:pathOrig",e);const s=z.animate(t).plot(e,"polygons").attr({"stroke-width":this.strokeWidth});s&&"function"==typeof s.after?s.after(()=>i.animationCompleted(z)):i.animationCompleted(z)}else this.dynamicAnim&&r.globals.dataChanged?this.animatePaths(z,{size:this.sliceSizes[a],prevSize:L,endAngle:A,startAngle:b,prevStartAngle:y,prevEndAngle:S,animateStartingPos:!0,i:a,animBeginArr:this.animBeginArr,shouldSetPrevPaths:!0,dur:r.config.chart.animations.dynamicAnimation.speed,collapsed:D}):this.animatePaths(z,{size:this.sliceSizes[a],endAngle:A,startAngle:b,i:a,animBeginArr:this.animBeginArr,dur:M,collapsed:D});if(this.getExpandOffset()>0?z.node.addEventListener("mouseup",this.pieClicked.bind(this,a)):0===a&&f.drilldownBlocksSliceOffset(r)&&(null==(n=this.ctx.drilldown)||n.warnSliceOffsetDisabled()),void 0!==r.interact.selectedDataPoints[0]&&r.interact.selectedDataPoints[0].indexOf(a)>-1)if(this.initialAnim&&!r.globals.resized&&!r.globals.dataChanged&&this.animDur>0){const e=r.dom.Paper;setTimeout(()=>{r.dom.Paper===e&&this.setSliceOut(a)},this.animDur)}else this.setSliceOut(a);if(r.config.dataLabels.enabled){const t=C.x,i=C.y;let s=100*m/this.fullAngle+"%";if(0!==m&&r.config.plotOptions.pie.dataLabels.minAngleToShowLabel<e[a]){const e=r.config.dataLabels.formatter;void 0!==e&&(s=e(r.globals.seriesPercent[a][0],{seriesIndex:a,dataPointIndex:a,series:r.seriesData.series,w:r}));const l=r.globals.dataLabels.style.colors[a],n=h.group({class:"apexcharts-datalabels","data:slice":a}),c=h.drawText({x:t,y:i,text:s,textAnchor:"middle",fontSize:r.config.dataLabels.style.fontSize,fontFamily:r.config.dataLabels.style.fontFamily,fontWeight:r.config.dataLabels.style.fontWeight,foreColor:l});if(n.add(c),r.config.dataLabels.dropShadow.enabled){const e=r.config.dataLabels.dropShadow;o.dropShadow(c,e)}c.node.classList.add("apexcharts-pie-label"),!this.initialAnim||r.globals.resized||r.globals.dataChanged||(c.attr({opacity:0}),c.animate(300,r.config.chart.animations.speed).attr({opacity:1})),this.sliceLabels.push(n),this.sliceLabelGroups[a]=n.node}}if(this.showExternalLabels&&0!==m){const e=this.getExternalLabelLines(a);if(e.some(e=>""!==e)){const t=p.polarToCartesian(this.centerX,this.centerY,r.globals.radialSize,P),i=p.polarToCartesian(this.centerX,this.centerY,r.globals.radialSize+(this.externalCfg.connector.gap||0),P),s=i.x>=this.centerX,l=s?i.x+(this.externalCfg.connector.length||0):i.x-(this.externalCfg.connector.length||0);this.externalLabels.push({i:a,lines:e,anchor:t,elbow:i,side:s?"right":"left",labelX:l+parseFloat(this.externalCfg.offsetX||0),idealY:i.y+parseFloat(this.externalCfg.offsetY||0),connectorColor:this.externalCfg.connector.color||r.globals.colors[a],foreColor:this.externalCfg.color||r.config.chart.foreColor})}}}if(this.showExternalLabels&&this.externalLabels.length){this.placeExternalLabels();const e=x.isBrowser()&&(w||this.dynamicAnim&&r.globals.dataChanged||this.initialAnim&&!r.globals.resized&&!r.globals.dataChanged);this.externalLabels.forEach(t=>{const a=new m(r).drawExternalLabel({lines:t.lines,lineHeight:this.externalLabelLineH,anchor:t.anchor,elbow:t.elbow,labelX:t.labelX,labelY:t.labelY,side:t.side,connector:{show:this.externalCfg.connector.show,width:this.externalCfg.connector.width,color:t.connectorColor},style:this.externalLabelStyle,foreColor:t.foreColor});e&&(a.node.classList.add("apexcharts-element-hidden"),r.globals.delayedElements.push({el:a.node})),this.externalLabelGroups[t.i]=a.node,a.node.setAttribute("data:slice",String(t.i)),d.add(a)})}return d}placeExternalLabels(){const e=this.w,t=this.externalLabelMaxLines*this.externalLabelLineH,a=e.globals.radialSize+e.globals.pieExternalLabelMarginY,i=this.centerY+a,s=this.centerY-a+t/2;["left","right"].forEach(e=>{const a=this.externalLabels.filter(t=>t.side===e);!function(e,t,a,i){const s=e.slice().sort((e,t)=>e.idealY-t.idealY);s.forEach(e=>{e.labelY=e.idealY});for(let e=1;e<s.length;e++)s[e].labelY-s[e-1].labelY<t&&(s[e].labelY=s[e-1].labelY+t);const l=s[s.length-1],n=l?l.labelY-a:0;if(n>0)for(let e=s.length-1;e>=0;e--)s[e].labelY-=n,e<s.length-1&&s[e+1].labelY-s[e].labelY<t&&(s[e].labelY=s[e+1].labelY-t);if(null!=i&&s.length&&s[0].labelY<i){const e=i-s[0].labelY;for(let t=0;t<s.length;t++)s[t].labelY+=e}}(a,Math.min(t+2,(i-s)/Math.max(1,a.length-1)),i,s)})}addListeners(e,t,a){const i=new u(this.w,this.ctx);e.node.addEventListener("mouseenter",i.pathMouseEnter.bind(i,e)),e.node.addEventListener("mouseleave",i.pathMouseLeave.bind(i,e)),e.node.addEventListener("mouseleave",this.revertDataLabelsInner.bind(this)),"number"==typeof a&&(e.node.addEventListener("mouseenter",this.showHoverOutline.bind(this,a)),e.node.addEventListener("mouseleave",this.hideHoverOutline.bind(this))),e.node.addEventListener("mousedown",i.pathMouseDown.bind(i,e)),this.donutDataLabels.total.showAlways||(e.node.addEventListener("mouseenter",this.printDataLabelsInner.bind(this,e.node,t)),e.node.addEventListener("mousedown",this.printDataLabelsInner.bind(this,e.node,t)))}animatePaths(e,t){let a=t.endAngle<t.startAngle?this.fullAngle+t.endAngle-t.startAngle:t.endAngle-t.startAngle,i=a,s=t.startAngle;const l=t.startAngle;void 0!==t.prevStartAngle&&void 0!==t.prevEndAngle&&(s=t.prevEndAngle,i=t.prevEndAngle<t.prevStartAngle?this.fullAngle+t.prevEndAngle-t.prevStartAngle:t.prevEndAngle-t.prevStartAngle),a===this.fullAngle&&(a=this.fullAngle-.01),this.animateArc(e,s,l,a,i,t)}animateArc(e,t,a,i,s,l){const n=this,r=this.w,o=new d(this.w),h=l.size;let c;(isNaN(t)||isNaN(s))&&(t=a,s=0,!1===r.globals.shouldAnimate&&(s=i,l.dur=0));let g=i,p=a;const u=t<a?this.fullAngle+t-a:t-a,f="number"==typeof l.prevSize;r.globals.dataChanged&&l.shouldSetPrevPaths&&Number.isFinite(l.prevEndAngle)&&(c=n.getPiePath({me:n,startAngle:l.prevStartAngle,angle:l.prevEndAngle<l.prevStartAngle?this.fullAngle+l.prevEndAngle-l.prevStartAngle:l.prevEndAngle-l.prevStartAngle,size:f?l.prevSize:h}),e.attr({d:c})),0!==l.dur?e.animate(l.dur,l.animBeginArr[l.i]).after(function(){"pie"!==n.chartType&&"donut"!==n.chartType&&"polarArea"!==n.chartType||this.animate(r.config.chart.animations.dynamicAnimation.speed).attr({"stroke-width":n.strokeWidth}),l.collapsed&&e.attr({d:""}),l.i===r.config.series.length-1&&o.animationCompleted(e)}).during(r=>{g=u+(i-u)*r,l.animateStartingPos&&(g=s+(i-s)*r,p=t-s+(a-(t-s))*r),c=n.getPiePath({me:n,startAngle:p,angle:g,size:f?l.prevSize+(h-l.prevSize)*r:h}),e.node.setAttribute("data:pathOrig",c),e.attr({d:c})}):(c=n.getPiePath({me:n,startAngle:p,angle:i,size:h}),l.isTrack||(r.globals.animationEnded=!0),e.node.setAttribute("data:pathOrig",c),e.attr({d:l.collapsed?"":c,"stroke-width":n.strokeWidth}))}pieClicked(e,t){const a=this.w,i=!(t&&!1===t.animate),s=a.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${e}`);if(s){if("true"===s.attr("data:pieClicked"))return s.attr({"data:pieClicked":"false"}),this.revertDataLabelsInner(),void this.offsetSlice(e,0,i);if(!a.config.states.active.allowMultipleDataPointsSelection){const e=a.dom.baseEl.getElementsByClassName("apexcharts-pie-area");Array.prototype.forEach.call(e,e=>{const t="true"===e.getAttribute("data:pieClicked");e.setAttribute("data:pieClicked","false"),t&&this.offsetSlice(parseInt(e.getAttribute("j"),10),0,i)})}a.interact.capturedDataPointIndex=e,s.attr("data:pieClicked","true"),this.offsetSlice(e,this.getExpandOffset(),i)}}getExpandOffset(){const e=this.w.config.plotOptions.pie;if(!e.expandOnClick||"polarArea"===this.chartType)return 0;if(f.drilldownBlocksSliceOffset(this.w))return 0;const t=Number(e.expandOffset);return Number.isFinite(t)&&t>0?t:0}getSliceMovers(e){const t=this.w.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${e}`);return[t?t.node:null,this.sliceLabelGroups[e],this.externalLabelGroups[e],this.hoverOutlineIndex===e&&this.elHoverOutlinePath?this.elHoverOutlinePath.node:null].filter(Boolean)}offsetSlice(e,t,a=!0){const i=this.w;if(!i.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${e}`))return;const{dx:s,dy:l}=this.getSliceOffsetVector(e,t),n=`translate(${s} ${l})`,r=a&&i.config.chart.animations.enabled?"transform 320ms cubic-bezier(0.25, 0.8, 0.3, 1)":"";this.getSliceMovers(e).forEach(e=>{e.classList.add("apexcharts-slice-mover"),e.style.transition=r,e.setAttribute("transform",n)})}getSliceOffsetVector(e,t){const a=this.w.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${e}`),i=a?parseFloat(a.attr("data:angle")):NaN;if(!t||!Number.isFinite(i)||i>=this.fullAngle)return{dx:0,dy:0};const s=parseFloat(a.attr("data:startAngle")),l=Math.PI*(s+i/2-90)/180;return{dx:t*Math.cos(l),dy:t*Math.sin(l)}}showHoverOutline(e){const t=this.w;if(!f.hoverOutlineOwnsHoverState(t))return;if(!this.elHoverOutline)return;const a=this.getHoverOutlinePath(e);if(!a)return;const i=t.config.plotOptions.pie.hoverOutline,s=i.color||t.globals.colors[e];if(!this.elHoverOutlinePath){const e=new u(t);this.elHoverOutlinePath=e.drawPath({d:a,fill:s,strokeWidth:0,classes:"apexcharts-pie-hover-outline-band"}),this.elHoverOutline.add(this.elHoverOutlinePath)}this.elHoverOutlinePath.attr({d:a,fill:s,"fill-opacity":i.opacity});const{dx:l,dy:n}=this.getSliceOffsetVector(e,this.isSliceOut(e)?this.getExpandOffset():0);this.elHoverOutlinePath.node.classList.remove("apexcharts-slice-mover"),this.elHoverOutlinePath.node.style.transition="",this.elHoverOutlinePath.node.setAttribute("transform",`translate(${l} ${n})`),this.hoverOutlineIndex=e,this.elHoverOutline.node.style.opacity="1"}hideHoverOutline(){this.elHoverOutline&&(this.elHoverOutline.node.style.opacity="0")}setSliceOut(e){this.isSliceOut(e)||this.pieClicked(e,{animate:!1})}isSliceOut(e){const t=this.w.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${e}`);return!!t&&"true"===t.attr("data:pieClicked")}getHoverOutlinePath(e){const t=this.w,a=t.config.plotOptions.pie.hoverOutline,i=t.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${e}`);if(!i)return null;const s=parseFloat(i.attr("data:angle"));if(!Number.isFinite(s)||s<=0)return null;const l=this.sliceSizes[e],n=Number(a.size);if(!Number.isFinite(l)||!Number.isFinite(n)||n<=0)return null;const{startDeg:h,spanDeg:c}=this.getSliceExtent({me:this,startAngle:parseFloat(i.attr("data:startAngle")),angle:s,size:l});if(!(c>0))return null;const d=l+(this.strokeWidth||0)/2+(Number(a.gap)||0),g=d+n,p={cx:this.centerX,cy:this.centerY,rIn:d,rOut:g,a0:h,a1:h+c,spanDeg:c},u=Math.min(n/2,c*Math.PI/180/2*d);return u>.5?v(o(r({},p),{r:u})):function({cx:e,cy:t,rIn:a,rOut:i,a0:s,a1:l,spanDeg:n}){const r=(a,i)=>S(e,t,a,i),o=n>180?1:0,h=r(i,s),c=r(i,l),d=r(a,l),g=r(a,s);return["M",w(h),"A",i,i,0,o,1,w(c),"L",w(d),"A",a,a,0,o,0,w(g),"Z"].join(" ")}(p)}getChangedPath(e,t,a){return this.dynamicAnim&&this.w.globals.dataChanged&&"number"==typeof a?this.getPiePath({me:this,startAngle:e,angle:t-e,size:a}):""}getSliceExtent({me:e,startAngle:t,angle:a,size:i}){const s=this.w;let l=t,n=a+t;Math.ceil(n)>=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle&&(n=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle-.01);let r=n-l;const o="pie"===e.chartType||"donut"===e.chartType||"polarArea"===e.chartType,h=s.config.plotOptions.pie.spacing;if(o&&h>0&&r>0){const t="donut"===e.chartType?(i+e.donutSize)/2:i,a=t>0?h/t*(180/Math.PI):0,s=Math.min(a/2,Math.max(0,r/2-.5));l+=s,r-=2*s}return n=l+r,Math.ceil(n)>this.fullAngle&&(n-=this.fullAngle),{startDeg:l,spanDeg:r,endDeg:n}}getPiePath({me:e,startAngle:t,angle:a,size:i}){let s;const l=this.w,n=new u(this.w),{startDeg:r,spanDeg:o,endDeg:h}=this.getSliceExtent({me:e,startAngle:t,angle:a,size:i}),c="pie"===e.chartType||"donut"===e.chartType||"polarArea"===e.chartType,d=Math.PI*(r-90)/180,g=l.config.plotOptions.pie.borderRadius;if(g>0&&c){const t=this.getRoundedSlicePath({me:e,startDeg:r,spanDeg:o,size:i,borderRadius:g});if(t)return t}const f=Math.PI*(h-90)/180,b=e.centerX+i*Math.cos(d),m=e.centerY+i*Math.sin(d),x=e.centerX+i*Math.cos(f),y=e.centerY+i*Math.sin(f),A=p.polarToCartesian(e.centerX,e.centerY,e.donutSize,h),S=p.polarToCartesian(e.centerX,e.centerY,e.donutSize,r),w=o>180?1:0,v=["M",b,m,"A",i,i,0,w,1,x,y];return s="donut"===e.chartType?[...v,"L",A.x,A.y,"A",e.donutSize,e.donutSize,0,w,0,S.x,S.y,"L",b,m,"z"].join(" "):"pie"===e.chartType||"polarArea"===e.chartType?[...v,"L",e.centerX,e.centerY,"L",b,m].join(" "):[...v].join(" "),n.roundPathCorners(s,2*this.strokeWidth)}getRoundedSlicePath({me:e,startDeg:t,spanDeg:a,size:i,borderRadius:s}){if(!(a>0))return null;const l=Math.PI/180,n=e.centerX,r=e.centerY,o="donut"===e.chartType,h=i,c=o?e.donutSize:0,d=a*l;let g=s;if(g=Math.min(g,d*h/2),o?(g=Math.min(g,d*c/2),g=Math.min(g,(h-c)/2)):g=Math.min(g,h/2),!(g>.5))return null;const p=t,u=t+a;return o?v({cx:n,cy:r,rIn:c,rOut:h,a0:p,a1:u,r:g,spanDeg:a}):function({cx:e,cy:t,rOut:a,a0:i,a1:s,r:l,spanDeg:n}){const r=(a,i)=>S(e,t,a,i),o=l/a*A,h=r(a,i+o),c=r(a,s-o),d=n-2*o>180?1:0,g=r(a,s),p=r(a-l,s),u=r(a,i),f=r(a-l,i);return["M",w(h),"A",a,a,0,d,1,w(c),"Q",w(g),w(p),"L",`${e} ${t}`,"L",w(f),"Q",w(u),w(h),"Z"].join(" ")}({cx:n,cy:r,rOut:h,a0:p,a1:u,r:g,spanDeg:a})}drawPolarElements(e){const t=this.w,a=new b(this.w),i=new u(this.w),s=new m(this.w),l=i.group(),n=i.group(),r=a.niceScale(0,Math.ceil(this.maxY),0),o=r.result.reverse(),h=r.result.length;this.maxY=r.niceMax;let c=t.globals.radialSize;const d=c/(h-1);for(let e=0;e<h-1;e++){const a=i.drawCircle(c);if(a.attr({cx:this.centerX,cy:this.centerY,fill:"none","stroke-width":t.config.plotOptions.polarArea.rings.strokeWidth,stroke:t.config.plotOptions.polarArea.rings.strokeColor}),t.config.yaxis[0].show){const a=s.drawYAxisTexts(this.centerX,this.centerY-c+parseInt(t.config.yaxis[0].labels.style.fontSize,10)/2,e,o[e]);n.add(a)}l.add(a),c-=d}this.drawSpokes(e),e.add(l),e.add(n)}renderInnerDataLabels(e,t,a){const i=this.w,s=new u(this.w),l=t.total.show;e.node.innerHTML="",e.node.style.opacity=a.opacity;const n=a.centerX,r=a.centerY,o=t.name.show&&!!this.donutDataLabels.total.label;let h,c;h=void 0===t.name.color?i.globals.colors[0]:t.name.color;let d=t.name.fontSize,g=t.name.fontFamily,p=t.name.fontWeight;c=void 0===t.value.color?i.config.chart.foreColor:t.value.color;const f=t.value.formatter;let b="",m="";if(l?(h=t.total.color,d=t.total.fontSize,g=t.total.fontFamily,p=t.total.fontWeight,m=this.donutDataLabels.total.label?t.total.label:"",b=t.total.formatter(i)):1===i.seriesData.series.length&&(b=f(i.seriesData.series[0],i),m=i.seriesData.seriesNames[0]),m&&(m=t.name.formatter(m,t.total.show,i)),t.name.show){const a=s.drawText({x:n,y:r+parseFloat(t.name.offsetY),text:m,textAnchor:"middle",foreColor:h,fontSize:d,fontWeight:p,fontFamily:g});a.node.classList.add("apexcharts-datalabel-label"),e.add(a)}if(t.value.show){const a=o?parseFloat(t.value.offsetY)+16:t.value.offsetY,i=s.drawText({x:n,y:r+a,text:b,textAnchor:"middle",foreColor:c,fontWeight:t.value.fontWeight,fontSize:t.value.fontSize,fontFamily:t.value.fontFamily});i.node.classList.add("apexcharts-datalabel-value"),e.add(i)}return e}printInnerLabels(e,t,a,i){const s=this.w;let l;i?l=void 0===e.name.color?s.globals.colors[parseInt(i.parentNode.getAttribute("rel"),10)-1]:e.name.color:s.seriesData.series.length>1&&e.total.show&&(l=e.total.color);const n=s.dom.baseEl.querySelector(".apexcharts-datalabel-label"),r=s.dom.baseEl.querySelector(".apexcharts-datalabel-value");a=(0,e.value.formatter)(a,s),i||"function"!=typeof e.total.formatter||(a=e.total.formatter(s));const o=t===e.total.label;if(t=this.donutDataLabels.total.label?e.name.formatter(t,o,s):"",null!==n&&(n.textContent=t),null!==r&&(r.textContent=a),null!==n){n.style.fill=l}}printDataLabelsInner(e,t){const a=this.w,i=e.getAttribute("data:value"),s=a.seriesData.seriesNames[parseInt(e.parentNode.getAttribute("rel"),10)-1];a.seriesData.series.length>1&&this.printInnerLabels(t,s,i,e);const l=a.dom.baseEl.querySelector(".apexcharts-datalabels-group");if(null!==l){l.style.opacity="1"}}drawSpokes(e){const t=this.w,a=new u(this.w),i=t.config.plotOptions.polarArea.spokes;if(0===i.strokeWidth)return;const s=t.globals.collapsedSeriesIndices||[],l=t.seriesData.series.length,n=360/Math.max(1,l-s.filter(e=>e<l).length);let r=0;for(let o=0;o<l;o++){if(s.indexOf(o)>-1)continue;const l=p.polarToCartesian(this.centerX,this.centerY,t.globals.radialSize,t.config.plotOptions.pie.startAngle+n*r++),h=a.drawLine(l.x,l.y,this.centerX,this.centerY,Array.isArray(i.connectorColors)?i.connectorColors[o]:i.connectorColors);e.add(h)}}revertDataLabelsInner(){const e=this.w;if(this.donutDataLabels.show){const t=e.dom.Paper.findOne(".apexcharts-datalabels-group"),a=this.renderInnerDataLabels(t,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:this.donutDataLabels.show});e.dom.Paper.findOne(".apexcharts-radialbar, .apexcharts-pie").add(a)}}}c.default.use({pie:L,donut:L,polarArea:L}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>c.default});
|
package/dist/donut.esm.js
CHANGED
package/dist/dumbbell.common.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v8.
|
|
2
|
+
* ApexCharts v8.3.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
|
-
"use strict";var t=Object.defineProperty,e=Object.defineProperties,s=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,o=(e,s,a)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[s]=a,n=(t,e)=>{for(var s in e||(e={}))i.call(e,s)&&o(t,s,e[s]);if(a)for(var s of a(e))r.call(e,s)&&o(t,s,e[s]);return t},l=(t,a)=>e(t,s(a));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function h(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const s in t)if("default"!==s){const a=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>t[s]})}return e.default=t,Object.freeze(e)}const d=h(require("apexcharts/core")),c=d.__apex_Utils;function b(t,e){const s=(e.collapsedSeries||[]).concat(e.ancillaryCollapsedSeries||[]);return t.map((t,e)=>{const o=t||{},{hidden:h}=o,d=((t,e)=>{var s={};for(var o in t)i.call(t,o)&&e.indexOf(o)<0&&(s[o]=t[o]);if(null!=t&&a)for(var o of a(t))e.indexOf(o)<0&&r.call(t,o)&&(s[o]=t[o]);return s})(o,["hidden"]);let c=d.data;if(Array.isArray(c)&&!c.length){const t=s.find(t=>t.index===e);t&&Array.isArray(t.data)&&(c=t.data)}return l(n({},d),{data:Array.isArray(c)?c.slice():c})})}function u(t,e,s){const a=s&&void 0!==s[e]?s[e]:e+1;return null==t?{x:a,y:null,rest:{}}:Array.isArray(t)?{x:void 0!==t[0]?t[0]:a,y:t[1],rest:{}}:"object"==typeof t?{x:void 0!==t.x?t.x:a,y:t.y,rest:t}:{x:a,y:t,rest:{}}}const g="__apexcharts_series_transforms__";var p,x;globalThis[g]||(globalThis[g]={}),p="dumbbell","function"==typeof(x=function(t,e){var s;const a=e.config,i=e.globals;if(!Array.isArray(t))return t;i.dumbbellRawSeries||(i.dumbbellRawSeries=b(t,i));const r=i.dumbbellRawSeries;if(r.some(t=>function(t){for(let e=0;e<t.length;e++){const s=t[e],a=Array.isArray(s)?s[1]:s&&"object"==typeof s?s.y:s;if(Array.isArray(a)&&2===a.length)return!0}return!1}(Array.isArray(null==t?void 0:t.data)?t.data:[])))return e.dumbbellData={form:"pairs",names:[],values:[],order:[],carrier:0,hidden:[]},t;const o=null==(s=a.xaxis)?void 0:s.categories,h=function(t){return(t.collapsedSeriesIndices||[]).concat(t.ancillaryCollapsedSeriesIndices||[])}(i),{xs:d,rows:g,byX:p}=function(t,e){var s;const a=[],i=[],r=new Map,o=[];for(let l=0;l<t.length;l++){const h=Array.isArray(null==(s=t[l])?void 0:s.data)?t[l].data:[],d=new Map;for(let t=0;t<h.length;t++){const{x:s,y:o,rest:l}=u(h[t],t,e),b=s instanceof Date?s.getTime():s;r.has(b)||(r.set(b,a.length),a.push(s),i.push(n({},l)));const g=r.get(b);d.set(g,c.parseNumber(o))}o.push(d)}return{xs:a,rows:i,byX:o}}(r,o),x=[],f=[],y=[];for(let t=0;t<r.length;t++)-1===h.indexOf(t)&&y.push(t);const v=[];for(let t=0;t<d.length;t++){const e=[];for(let s=0;s<r.length;s++){const a=p[s].has(t)?p[s].get(t):null;e.push(null!=a&&isFinite(a)?a:null)}x.push(e);let s=null,a=null,i=-1,o=-1;for(let t=0;t<y.length;t++){const r=y[t],n=e[r];null!==n&&((null===s||n<s)&&(s=n,i=r),(null===a||n>a)&&(a=n,o=r))}null!==s&&null!==a?(f.push([i,o]),v.push(l(n({},g[t]),{x:d[t],y:[s,a]}))):(f.push(null),v.push(l(n({},g[t]),{x:d[t],y:null})))}e.dumbbellData={form:"series",names:r.map((t,e)=>{var s;return null!=(s=null==t?void 0:t.name)?s:`Series ${e+1}`}),values:x,order:f,carrier:y.length?y[0]:0,hidden:r.map((t,e)=>e).filter(t=>-1!==h.indexOf(t))};const m=e.dumbbellData.carrier;return r.map((t,e)=>l(n({},t),{data:e===m&&y.length?v:[]}))})?globalThis[g][p]=x:console.warn(`ApexCharts: registerSeriesTransform("${p}") expects a function (series, w) => series.`);const f=d.__apex_Graphics,y=d.__apex_DataLabels,v=(t,e,s,a)=>{if("function"!=typeof t)return t;const i=t({series:e.seriesData.series,seriesIndex:s,dataPointIndex:a,w:e});return Number.isFinite(i)?i:0},m=d.__apex_Animations,C=d.__apex_Animations_computeStagger,w=d.__apex_BrowserAPIs_BrowserAPIs,I=d.__apex_Environment_Environment;function P(t){var e;const s=t.config.chart.animations;if(!s||!1===s.enabled)return!1;if(!s.dynamicAnimation||!1===s.dynamicAnimation.enabled)return!1;const a=null!=(e=s.largeDatasetThreshold)?e:0;return!(a>0&&t.globals.dataPoints>a)&&!!(I.isBrowser()&&t.globals.dataChanged&&t.globals.shouldAnimate)}function S(t,e,s){var a,i,r,o;if(null==(a=t.axisFlags)?void 0:a.isXNumeric){const a=null==(r=null==(i=t.seriesData)?void 0:i.seriesX)?void 0:r[e];if(a&&a.length&&null!=a[s])return"x:"+a[s]}const n=null==(o=t.globals.labels)?void 0:o[s];return null!=n&&""!==String(n)?"c:"+(Array.isArray(n)?n.join(" "):String(n)):"j:"+s}function k(t){const e=new Map;return t.map(t=>{const s=e.get(t)||0;return e.set(t,s+1),0===s?t:`${t}#${s}`})}function H(t,e,s=!1,a=!1){var i,r;if(!P(t))return null;const o=t.globals.prevStreamFrame;if(!o)return null;const n=null==(i=o.seriesY)?void 0:i[e],l=null==(r=t.seriesData.series)?void 0:r[e];if(!Array.isArray(n)||!Array.isArray(l))return null;if(!n.length||!l.length)return null;const h=k(n.map((t,s)=>function(t,e,s){var a,i;if(t.isXNumeric){const i=null==(a=t.seriesX)?void 0:a[e];if(i&&i.length&&null!=i[s])return"x:"+i[s]}const r=null==(i=t.labels)?void 0:i[s];return null!=r&&""!==String(r)?"c:"+(Array.isArray(r)?r.join(" "):String(r)):"j:"+s}(o,e,s))),d=k(l.map((s,a)=>S(t,e,a))),c=function(t,e){const s=new Map;t.forEach((t,e)=>{s.has(t)||s.set(t,e)});const a=new Array(e.length),i=new Set;let r=-1,o=!0,n=t.length===e.length;e.forEach((t,e)=>{const l=s.has(t)&&!i.has(s.get(t))?s.get(t):-1;a[e]=l,-1!==l&&(i.add(l),l<r&&(o=!1),r=l),l!==e&&(n=!1)});const l=[];for(let e=0;e<t.length;e++)i.has(e)||l.push(e);return{toOld:a,exits:l,ordered:o,changed:!n}}(h,d);return(c.ordered||a)&&(c.changed||s)?{join:c,oldKeys:h,newKeys:d}:null}function L({w:t,elSeries:e,record:s,newKeys:a,isHorizontal:i,speed:r}){var o;if(!P(t))return;if(!s||!Array.isArray(s.paths)||!(null==e?void 0:e.node))return;const n=new Set(a),l=s.paths.filter(t=>t&&t.d&&null!=t.key&&!n.has(t.key));if(!l.length)return;const h=new f(t),d=null==(o=t.globals.colors)?void 0:o[parseInt(String(s.realIndex),10)];l.forEach(a=>{let o=a.fill||d||"#c8c8c8";0===String(o).indexOf("url(")&&(o=d||"#c8c8c8");const n=h.drawPath({d:a.d,stroke:"none",strokeWidth:0,fill:o,fillOpacity:1,classes:"apexcharts-bar-ghost"}),l=n.node;l.setAttribute("pointer-events","none"),n.attr("clip-path",`url(#gridRectBarMask${t.globals.cuid})`),e.node.insertBefore(l,e.node.firstChild);const c=function(t){const e=/^M\s*([+-]?[\d.eE]+)[\s,]+([+-]?[\d.eE]+)/.exec(t||"");if(!e)return null;const s=parseFloat(e[1]),a=parseFloat(e[2]);return isFinite(s)&&isFinite(a)?{x:s,y:a}:null}(a.d);let b=i?"left center":"center bottom";try{const t=l.getBBox();c&&t&&(b=i?Math.abs(c.x-t.x)<=Math.abs(c.x-(t.x+t.width))?"left center":"right center":Math.abs(c.y-(t.y+t.height))<=Math.abs(c.y-t.y)?"center bottom":"center top")}catch(t){}const u=l.style;u.transformBox="fill-box",u.transformOrigin=b,l.setAttribute("data:ghostKey",`${s.realIndex}::${a.key}`);try{const t=l.getBBox(),e=i?b.startsWith("left")?t.x:t.x+t.width:b.endsWith("bottom")?t.y+t.height:t.y;isFinite(e)&&l.setAttribute("data:ghostEdge",String(e))}catch(t){}const g=Math.max(1,r||1),p=performance.now(),x=e=>{if(t.globals.isDestroyed||!l.parentNode)return;const s=Math.max(0,Math.min(1,(e-p)/g)),a=1-Math.pow(1-s,3),r=1-a;u.transform=i?`scaleX(${r})`:`scaleY(${r})`,u.opacity=String(1-a),s<1?w.requestAnimationFrame(x):l.parentNode.removeChild(l)};w.requestAnimationFrame(x)})}class A{constructor(t){this.w=t.w,this.barCtx=t,this.totalFormatter=this.w.config.plotOptions.bar.dataLabels.total.formatter,this.totalFormatter||(this.totalFormatter=this.w.config.dataLabels.formatter)}handleBarDataLabels(t){var e,s,a,i,r,o;const{x:h,y:d,y1:c,y2:b,i:u,j:g,realIndex:p,columnGroupIndex:x,barHeight:y,barWidth:m,barXPosition:C,barYPosition:w,visibleSeries:I,hl:P}=t,S=this.w,k=new f(this.barCtx.w);this.hlt=null==P?void 0:P.total;const H=S.waterfallData&&S.waterfallData.values,L=P&&null!=P.val?P.val:H&&H[p]&&null!=H[p][g]?H[p][g]:null,A=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[p]:this.barCtx.strokeWidth;let W,D;S.axisFlags.isXNumeric&&!S.globals.isBarHorizontal?(W=h+m*(I+1),D=d+y*(I+1)-A):(W=h+m*I,D=d+y*I);let R=null,X=null,F=h,O=d,T={};const Y=S.config.dataLabels,j=this.barCtx.barOptions.dataLabels,B=this.barCtx.barOptions.dataLabels.total;void 0!==w&&(this.barCtx.isRangeBar||this.barCtx.isPyramid)&&(D=w,O=w),void 0!==C&&this.barCtx.isVerticalGroupedRangeBar&&(W=C,F=C);const z=v(Y.offsetX,S,p,g),_=v(Y.offsetY,S,p,g),M=(null==P?void 0:P.hide)?void 0:null!==L?L:void 0!==b?[c,b]:"100%"===S.config.chart.stackType?S.globals.seriesPercent[p][g]:S.seriesData.series[p][g];let G,V={width:0,height:0};Y.enabled&&(G=void 0===M?"":Y.formatter(M,l(n({},S),{seriesIndex:p,dataPointIndex:g,w:S})),V=k.getTextRects(G,parseFloat(Y.style.fontSize).toString(),Y.style.fontFamily,void 0,!0,Y.style.fontWeight));const N={x:null!=(e=null==P?void 0:P.x)?e:h,y:null!=(s=null==P?void 0:P.y)?s:d,neg:P&&null!=P.val?P.val<0:void 0,i:u,j:g,realIndex:p,columnGroupIndex:x,bcx:W,bcy:D,barHeight:null!=(a=null==P?void 0:P.barHeight)?a:y,barWidth:null!=(i=null==P?void 0:P.barWidth)?i:m,textRects:V,strokeWidth:A,dataLabelsX:F,dataLabelsY:O,dataLabelsConfig:Y,barDataLabelsConfig:j,barTotalDataLabelsConfig:B,offX:z,offY:_};if(T=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(N):this.calculateColumnsDataLabelsPosition(N),null!==L&&this.barCtx.isHorizontal&&"center"===j.position){const t=null==(o=null==(r=S.waterfallData.geometry)?void 0:r[p])?void 0:o[g];t&&t.horizontal&&(T.dataLabelsX=(t.levelStart+t.levelEnd)/2+z)}return R=this.drawCalculatedDataLabels({x:T.dataLabelsX,y:T.dataLabelsY,neg:N.neg,val:M,text:G,i:p,j:g,barWidth:N.barWidth,barHeight:N.barHeight,textRects:V,dataLabelsConfig:Y}),S.config.chart.stacked&&B.enabled&&!1!==this.hlt&&(X=this.drawTotalDataLabels({x:T.totalDataLabelsX,y:T.totalDataLabelsY,barWidth:m,barHeight:y,realIndex:p,j:g,textAnchor:T.totalDataLabelsAnchor,val:this.getStackedTotalDataLabel({realIndex:p,j:g}),rawVal:this.getStackedTotalValue({realIndex:p,j:g}),dataLabelsConfig:Y,barTotalDataLabelsConfig:B})),{dataLabelsPos:T,dataLabels:R,totalDataLabels:X}}hasMultipleSeriesGroups(){return this.w.labelData.seriesGroups.length>1}getTotalGroupContext(t){if(!this.hasMultipleSeriesGroups())return null;const e=this.barCtx.barHelpers.getSeriesGroupIndex(t);return e<0?null:{groupIndex:e}}drawsStackedTotal(t){const e=this.barCtx.lastActiveBarSerieIndexByGroup,s=this.getTotalGroupContext(t);return s&&e&&e.length>s.groupIndex?e[s.groupIndex]===t:this.barCtx.lastActiveBarSerieIndex===t}getStackedTotalValue({realIndex:t,j:e}){if(this.hlt)return this.hlt.val;const s=this.w,a=this.xStackTop(t,e);if(a)return a[3];const i=this.getTotalGroupContext(t),r=s.seriesData.stackedSeriesTotalsByGroups;return i&&r&&r[i.groupIndex]?r[i.groupIndex][e]:this.barCtx.stackedSeriesTotals[e]}xStackTop(t,e){var s,a;const i=this.w;return i.axisFlags.isXNumeric&&(null==(a=null==(s=this.barCtx.stacks)?void 0:s[i.labelData.seriesGroupIndex[t]])?void 0:a.tops.get(i.seriesData.seriesX[t][e]))}getStackedTotalDataLabel({realIndex:t,j:e}){const s=this.w;let a=this.getStackedTotalValue({realIndex:t,j:e});return this.totalFormatter&&(a=this.totalFormatter(a,l(n({},s),{seriesIndex:t,dataPointIndex:e,w:s}))),a}calculateColumnsDataLabelsPosition(t){var e;const s=this.w;let a,i,{i:r,j:o,realIndex:n,y:l,bcx:h,barWidth:d,barHeight:c,textRects:b,dataLabelsX:u,dataLabelsY:g,dataLabelsConfig:p,barDataLabelsConfig:x,barTotalDataLabelsConfig:y,strokeWidth:v,offX:m,offY:C}=t;const w=h;c=Math.abs(c);const I="vertical"===s.config.plotOptions.bar.dataLabels.orientation,{zeroEncounters:P}=this.barCtx.barHelpers.getZeroValueEncounters({i:r,j:o});h-=v/2;const S=s.layout.gridWidth/s.globals.dataPoints;if(this.barCtx.isVerticalGroupedRangeBar?u+=d/2:(u=s.axisFlags.isXNumeric?h-d/2+m:h-S+d/2+m,!s.config.chart.stacked&&P>0&&s.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(u-=d*P)),I){const t=2;u=u+b.height/2-v/2-t}const k=null!=(e=t.neg)?e:s.seriesData.series[r][o]<0;let H=l;switch(this.barCtx.isReversed&&(H=l+(k?c:-c)),x.position){case"center":g=I?k?H-c/2+C:H+c/2-C:k?H-c/2+b.height/2+C:H+c/2+b.height/2-C;break;case"bottom":g=I?k?H-c+C:H+c-C:k?H-c+b.height+v+C:H+c-b.height/2+v-C;break;case"top":g=I?k?H+C:H-C:k?H-b.height/2-C:H+b.height+C}let L=H;const A=this.getTotalGroupContext(n),W=this.xStackTop(n,o),D=W?[]:this.barCtx.stacks||[];if(W&&(L=k?Math.max(H,W[5]):Math.min(H,W[4])),D.forEach((t,e)=>{A&&e!==A.groupIndex||t.prevY.forEach(t=>{L=k?Math.max(t[o],L):Math.min(t[o],L)})}),this.hlt&&(L=this.hlt.edge),this.drawsStackedTotal(n)&&y.enabled){const t=18,e=new f(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:n,j:o}),p.fontSize);a=k?L-e.height/2-C-y.offsetY+t:L+e.height+C+y.offsetY-t;const r=S;i=w+(s.axisFlags.isXNumeric?-d/2:d/2-r)+y.offsetX}return s.config.chart.stacked||(g<0?g=0+v:g+b.height/3>s.layout.gridHeight&&(g=s.layout.gridHeight-v)),{bcx:h,bcy:l,dataLabelsX:u,dataLabelsY:g,totalDataLabelsX:i,totalDataLabelsY:a,totalDataLabelsAnchor:"middle"}}calculateBarsDataLabelsPosition(t){var e,s;const a=this.w;let{x:i,i:r,j:o,realIndex:n,bcy:l,barHeight:h,barWidth:d,textRects:c,dataLabelsX:b,strokeWidth:u,dataLabelsConfig:g,barDataLabelsConfig:p,barTotalDataLabelsConfig:x,offX:y,offY:v}=t;const m=a.layout.gridHeight/a.globals.dataPoints,{zeroEncounters:C}=this.barCtx.barHelpers.getZeroValueEncounters({i:r,j:o});let w,I,P;if(d=Math.abs(d),this.barCtx.isPyramid){w=l+h/2+v-(null!=(e=c.centerOffset)?e:0)}else w=l-(this.barCtx.isRangeBar?0:m)+h/2+c.height/2+v-3;!a.config.chart.stacked&&C>0&&a.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(w-=h*C);let S="start";const k=null!=(s=t.neg)?s:a.seriesData.series[r][o]<0;let H=i;if(this.barCtx.isReversed&&(H=i+(k?-d:d),S=k?"start":"end"),this.barCtx.isPyramid)b=a.layout.gridWidth/2+y;else switch(p.position){case"center":b=k?H+d/2-y:Math.max(c.width/2,H-d/2)+y;break;case"bottom":b=k?H+d-u-y:H-d+u+y;break;case"top":b=k?H-u-y:H-u+y}let L=H;const A=this.getTotalGroupContext(n);if((this.barCtx.stacks||[]).forEach((t,e)=>{A&&e!==A.groupIndex||t.prevX.forEach(t=>{L=k?Math.min(t[o],L):Math.max(t[o],L)})}),this.hlt&&(L=this.hlt.edge),this.drawsStackedTotal(n)&&x.enabled){const t=new f(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:n,j:o}),g.fontSize);k?(I=L-u-y-x.offsetX,S="end"):I=L+y+x.offsetX+(this.barCtx.isReversed?-(d+u):u),P=w-c.height/2+t.height/2+x.offsetY+u,a.globals.barGroups.length>1&&!A&&(P-=a.globals.barGroups.length/2*(h/2))}if(!a.config.chart.stacked){const t=k&&"middle"!==g.textAnchor?"start"===g.textAnchor?"end":"start":g.textAnchor;let e;e="vertical"===p.orientation?c.height/2:"end"===t?c.width:"middle"===t?c.width/2:0;const s=("vertical"===p.orientation?c.height:c.width)-e;b+s>a.layout.gridWidth-u&&(b=a.layout.gridWidth-s-u),b-e<u&&(b=e+u)}return{bcx:i,bcy:l,dataLabelsX:b,dataLabelsY:w,totalDataLabelsX:I,totalDataLabelsY:P,totalDataLabelsAnchor:S}}drawCalculatedDataLabels({x:t,y:e,val:s,text:a,neg:i,i:r,j:o,textRects:h,barHeight:d,barWidth:c,dataLabelsConfig:b}){var u,g,p;const x=this.w;let v="rotate(0)";"vertical"===x.config.plotOptions.bar.dataLabels.orientation&&(v=`rotate(-90, ${t}, ${e})`);const m=new y(this.barCtx.w,this.barCtx.ctx),C=new f(this.barCtx.w),w=b.formatter;let I=null;const P=x.globals.collapsedSeriesIndices.indexOf(r)>-1,k=(x.globals.collapsingSeriesIndices||[]).indexOf(r)>-1;if(k){const t=null==(u=x.globals.prevDataLabels)?void 0:u.get(`${r}::${S(x,r,o)}`);t&&isFinite(t.val)&&(s=t.val,a=void 0)}if(b.enabled&&(!P||k)){I=C.group({class:"apexcharts-data-labels",transform:v});const u=x.config.dataLabels;((null==(g=u.animate)?void 0:g.enabled)||(null==(p=u.countUp)?void 0:p.enabled))&&(I.node.setAttribute("data:dlKey",`${r}::${S(x,r,o)}`),I.node.setAttribute("data:dlJ",String(o)),"number"==typeof s&&isFinite(s)&&I.node.setAttribute("data:dlVal",String(s))),void 0===s?a="":void 0===a&&(a=w(s,l(n({},x),{seriesIndex:r,dataPointIndex:o,w:x}))),!s&&x.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(a="");const f=null!=i?i:x.seriesData.series[r][o]<0,y=x.config.plotOptions.bar.dataLabels.position;if("vertical"===x.config.plotOptions.bar.dataLabels.orientation&&("top"===y&&(b.textAnchor=f?"end":"start"),"center"===y&&(b.textAnchor="middle"),"bottom"===y&&(b.textAnchor=f?"end":"start")),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels){c<C.getTextRects(a,parseFloat(b.style.fontSize).toString()).width&&(a="")}x.config.chart.stacked&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&!k&&(this.barCtx.isHorizontal?h.width/1.6>Math.abs(c)&&(a=""):h.height/1.6>Math.abs(d)&&(a=""));const P=n({},b);this.barCtx.isHorizontal&&s<0&&("start"===b.textAnchor?P.textAnchor="end":"end"===b.textAnchor&&(P.textAnchor="start")),m.plotDataLabelsText({x:t,y:e,text:a,i:r,j:o,parent:I,dataLabelsConfig:P,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return I}drawTotalDataLabels({x:t,y:e,val:s,rawVal:a,realIndex:i,j:r,textAnchor:o,barTotalDataLabelsConfig:n}){var l,h;const d=new f(this.barCtx.w);let c;if(n.enabled&&void 0!==t&&void 0!==e&&this.drawsStackedTotal(i)){c=d.drawText({x:t,y:e,foreColor:n.style.color,text:s,textAnchor:o,fontFamily:n.style.fontFamily,fontSize:n.style.fontSize,fontWeight:n.style.fontWeight}),c.attr({class:"apexcharts-datalabel-total",cx:t,cy:e});const b=this.w.config.dataLabels;if((null==(l=b.animate)?void 0:l.enabled)||(null==(h=b.countUp)?void 0:h.enabled)){const{groupIndex:t}=this.barCtx.barHelpers.getGroupIndex(i);c.node.setAttribute("data:dlTotalKey",`${t}::${S(this.w,i,r)}`),c.node.setAttribute("data:dlTotalSeries",String(i)),"number"==typeof a&&isFinite(a)&&c.node.setAttribute("data:dlTotalVal",String(a))}}return c}}const W=d.__apex_Series,D=d.__apex_Fill;function R(t){var e,s,a,i,r,o,n;return"histogram"===(null==(s=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:s.requestedType)&&(!1!==(null==(i=null==(a=t.config.plotOptions)?void 0:a.histogram)?void 0:i.overlap)&&(null!=(n=null==(o=null==(r=t.seriesData)?void 0:r.series)?void 0:o.length)?n:0)>1)}class X{constructor(t){this.w=t.w,this.barCtx=t}initVariables(t){const e=this.w;this.barCtx.series=t,this.barCtx.totalItems=0,this.barCtx.seriesLen=0,this.barCtx.visibleI=-1,this.barCtx.visibleItems=1;for(let s=0;s<t.length;s++)if(t[s].length>0&&(this.barCtx.seriesLen=this.barCtx.seriesLen+1,this.barCtx.totalItems+=t[s].length),e.axisFlags.isXNumeric)for(let a=0;a<t[s].length;a++)e.seriesData.seriesX[s][a]>e.globals.minX&&e.seriesData.seriesX[s][a]<e.globals.maxX&&this.barCtx.visibleItems++;else this.barCtx.visibleItems=e.globals.dataPoints;this.arrBorderRadius=this.createBorderRadiusArr(e.seriesData.series),c.isSafari()&&(this.arrBorderRadius=this.arrBorderRadius.map(t=>t.map(t=>"none"))),0===this.barCtx.seriesLen&&(this.barCtx.seriesLen=1)}barSlotXSpan(){const t=this.w;if(void 0!==this._slotXSpan)return this._slotXSpan;let e=0;if(t.globals.dataPoints<=1){const s=t.globals.maxX-t.globals.minX;e=s>0?s/4:0}else if(e=this._unionMinXGap(),!(e>0&&isFinite(e))){const s=t.globals.minXDiff;e=s>0&&isFinite(s)&&.5!==s?s:0}return this._slotXSpan=e,e}_unionMinXGap(){const t=this.w.seriesData.seriesX||[],e=[];for(let s=0;s<t.length;s++){const a=t[s];Array.isArray(a)&&a.length>0&&e.push(a.some((t,e)=>t<a[e-1])?a.filter(t=>t===+t).sort((t,e)=>t-e):a)}if(!e.length)return 0;const s=new Array(e.length).fill(0);let a=NaN,i=1/0;for(;;){let t=1/0,r=-1;for(let a=0;a<e.length;a++){const i=e[a];for(;s[a]<i.length&&"number"!=typeof i[s[a]];)s[a]++;if(s[a]>=i.length)continue;const o=i[s[a]];o==o?o<t&&(t=o,r=a):(s[a]++,a--)}if(-1===r)break;if(s[r]++,a==a){const e=t-a;e>0&&e<i&&(i=e)}a=t}return isFinite(i)?i:0}initialPositions(t){const e=this.w;let s,a,i,r,o,n,l,h,d=e.globals.dataPoints;this.barCtx.isRangeBar&&(d=e.labelData.labels.length);let b=this.barCtx.seriesLen;if((e.config.plotOptions.bar.rangeBarGroupRows||R(e))&&(b=1),this.barCtx.isHorizontal)i=e.layout.gridHeight/d,o=i/b,o=o*parseInt(this.barCtx.barOptions.barHeight,10)/100,-1===String(this.barCtx.barOptions.barHeight).indexOf("%")&&(o=parseInt(this.barCtx.barOptions.barHeight,10)),h=this.barCtx.baseLineInvertedY+e.globals.padHorizontal+(this.barCtx.isReversed?e.layout.gridWidth:0)-(this.barCtx.isReversed?2*this.barCtx.baseLineInvertedY:0),this.barCtx.isFunnel&&(h=e.layout.gridWidth/2),a=(i-o*this.barCtx.seriesLen)/2;else{if(r=e.layout.gridWidth/this.barCtx.visibleItems,e.config.xaxis.convertedCatToNumeric&&(r=e.layout.gridWidth/e.globals.dataPoints),n=r/b*parseInt(this.barCtx.barOptions.columnWidth,10)/100,e.axisFlags.isXNumeric){const t=this.barCtx.xRatio,e=this.barSlotXSpan();e>0&&e/t>0&&(r=e/t),n=r/b*parseInt(this.barCtx.barOptions.columnWidth,10)/100,n<1&&(n=1)}if(-1===String(this.barCtx.barOptions.columnWidth).indexOf("%")&&(n=parseInt(this.barCtx.barOptions.columnWidth,10)),l=e.layout.gridHeight-this.barCtx.baseLineY[this.barCtx.translationsIndex]-(this.barCtx.isReversed?e.layout.gridHeight:0)+(this.barCtx.isReversed?2*this.barCtx.baseLineY[this.barCtx.translationsIndex]:0),e.axisFlags.isXNumeric){s=this.barCtx.getBarXForNumericXAxis({x:s,j:0,realIndex:t,barWidth:n}).x}else s=e.globals.padHorizontal+c.noExponents(r-n*this.barCtx.seriesLen)/2}return e.globals.barHeight=o,e.globals.barWidth=n,{x:s,y:a,yDivision:i,xDivision:r,barHeight:o,barWidth:n,zeroH:l,zeroW:h}}initializeStackedPrevVars(t){t.stacks=t.w.labelData.seriesGroups.map(()=>({prevY:[],prevX:[],prevYF:[],prevXF:[],prevYVal:[],prevXVal:[],tops:new Map}))}initializeStackedXYVars(t){t.stacks.forEach(t=>{t.xArrj=[],t.xArrjF=[],t.xArrjVal=[],t.yArrj=[],t.yArrjF=[],t.yArrjVal=[]})}getPathFillColor(t,e,s,a){var i;const r=this.w,o=new D(this.barCtx.w);let n=null;const l=this.barCtx.barOptions.distributed?s:e;let h=!1;if(this.barCtx.barOptions.colors.ranges.length>0){this.barCtx.barOptions.colors.ranges.map(a=>{t[e][s]>=a.from&&t[e][s]<=a.to&&(n=a.color,h=!0)})}const d=this.getDumbbellConnectorFill(e,s)||(null==(i=r.config.series[e].data[s])?void 0:i.fill),c=this.barCtx.barOptions.isDumbbell?r.config.plotOptions.bar.dumbbell.connector:null;let b;c&&c.color&&(n=c.color,b=c.opacity);return{color:o.fillPath({seriesNumber:this.barCtx.barOptions.distributed?l:a,dataPointIndex:s,color:n,opacity:b,value:t[e][s],fillConfig:d,fillType:(null==d?void 0:d.type)?d.type:Array.isArray(r.config.fill.type)?r.config.fill.type[a]:r.config.fill.type}),useRangeColor:h}}getDumbbellConnectorFill(t,e){const s=this.w;if(!this.barCtx.barOptions.isDumbbell)return null;const a=s.dumbbellData;if(!a||"series"!==a.form)return null;const i=s.config.plotOptions.bar.dumbbell.connector;if(i.color)return null;const r=a.order[e];if(!r)return null;const o=s.globals.colors[r[0]],n=s.globals.colors[r[1]];return o&&n?{type:"gradient",gradient:{type:this.barCtx.isHorizontal?"horizontal":"vertical",gradientFrom:o,gradientTo:n,opacityFrom:i.opacity,opacityTo:i.opacity,stops:[0,100],inverseColors:!this.barCtx.isHorizontal}}:null}getStrokeWidth(t,e,s){let a=0;const i=this.w;return void 0===this.barCtx.series[t][e]||null===this.barCtx.series[t][e]||"bar"===i.config.chart.type&&!this.barCtx.series[t][e]?this.barCtx.isNullValue=!0:this.barCtx.isNullValue=!1,i.config.stroke.show&&(this.barCtx.isNullValue||(a=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[s]:this.barCtx.strokeWidth)),a}getStackedSeriesIndices(t){const e=this.w,s=e.labelData.seriesGroups,a=e.globals.columnSeries?new Set(e.globals.columnSeries.i):null,i=t=>!a||a.has(t);if(!s||s.length<2){const e=Array.from({length:t},(t,e)=>e).filter(i);return e.length?[e]:[]}const r=Array.from({length:s.length},()=>[]),o=[];for(let e=0;e<t;e++){if(!i(e))continue;const t=this.getSeriesGroupIndex(e);t>-1?r[t].push(e):o.push(e)}return o.length&&r.push(o),r.filter(t=>t.length>0)}createBorderRadiusArr(t){var e;const s=this.w,a=!this.w.config.chart.stacked||s.config.plotOptions.bar.borderRadius<=0,i=t.length,r=0|(null==(e=t[0])?void 0:e.length),o=Array.from({length:i},()=>Array(r).fill(a?"top":"none"));if(a)return o;const n="last"===s.config.plotOptions.bar.borderRadiusWhenStacked,l=n?"top":"both",h=n?"bottom":"both",d=n?"none":"bottom",c=n?"none":"top";for(const e of this.getStackedSeriesIndices(i))for(let s=0;s<r;s++){const a=[],i=[];for(const r of e){const e=t[r][s];e>0?a.push(r):e<0&&i.push(r)}if(a.length>0&&0===i.length)if(1===a.length)o[a[0]][s]=l;else{const t=a[0],e=a[a.length-1];for(const i of a)o[i][s]=i===t?d:i===e?"top":"none"}else if(i.length>0&&0===a.length)if(1===i.length)o[i[0]][s]=h;else{const t=Math.min(...i),e=Math.max(...i);for(const a of i)o[a][s]=a===t?c:a===e?"bottom":"none"}else if(a.length>0&&i.length>0){const t=a[a.length-1];for(const e of a)o[e][s]=e===t?"top":"none";const e=Math.max(...i);for(const t of i)o[t][s]=t===e?"bottom":"none"}}return o}barBackground({j:t,i:e,x1:s,x2:a,y1:i,y2:r,elSeries:o}){const n=this.w,l=new f(this.barCtx.w),h=new W(this.barCtx.w).getActiveConfigSeriesIndex();if(this.barCtx.barOptions.colors.backgroundBarColors.length>0&&h===e){t>=this.barCtx.barOptions.colors.backgroundBarColors.length&&(t%=this.barCtx.barOptions.colors.backgroundBarColors.length);const e=this.barCtx.barOptions.colors.backgroundBarColors[t],h=l.drawRect(void 0!==s?s:0,void 0!==i?i:0,void 0!==a?a:n.layout.gridWidth,void 0!==r?r:n.layout.gridHeight,this.barCtx.barOptions.colors.backgroundBarRadius,e,this.barCtx.barOptions.colors.backgroundBarOpacity);o.add(h),h.node.classList.add("apexcharts-backgroundBar")}}barRect({a:t,len:e,v1:s,v2:a,strokeWidth:i,realIndex:r,j:o,dir:n,horizontal:l}){const h=this.w,d=new f(h);(i=Array.isArray(i)?i[r]:i)||(i=0);const c=h.config.series[r].data[o],b=l?null==c?void 0:c.barHeightOffset:null==c?void 0:c.columnWidthOffset;b&&(t-=b/2,e+=b);const u=i/2,g=n*(this.barCtx.isReversed?-1:1),p="around"===h.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[r][o]?" Z":" z";let x,y,v,m,C,w;l?(v=t+u,m=t+e-u,x=s+.001+u*g,y=a+.001-u*g,C=d.line(x,m),w=d.move(x,v)+d.line(y,v)+d.line(y,m)+C+p):(x=t+u,y=t+e-u,v=s+.001-u*g,m=a+.001+u*g,C=d.line(y,v),w=d.move(x,v)+d.line(x,m)+d.line(y,m)+C+p);return{x1:x,x2:y,y1:v,y2:m,sl:C,closing:p,squarePathTo:w,pathTo:"none"!==this.arrBorderRadius[r][o]?d.roundPathCorners(w,h.config.plotOptions.bar.borderRadius):w,base:d.move(x,v)+d.line(x,v)+C+C+C+C+C+d.line(x,v)+p,strokeWidth:i,strokeCenter:u,direction:g}}getColumnPaths({barWidth:t,barXPosition:e,y1:s,y2:a,strokeWidth:i,series:r,realIndex:o,i:n,j:l,w:h}){var d,c;const b=this.barRect({a:e,len:t,v1:s,v2:a,strokeWidth:i,realIndex:o,j:l,dir:r[n][l]>=0?1:-1}),{pathTo:u,squarePathTo:g,strokeCenter:p,direction:x}=b;s=b.y1,a=b.y2;let f=null;const y=null==(c=null==(d=this.barCtx.ctx)?void 0:d.morphTypeChange)?void 0:c.getInitialPathFor(o,l);if(y?f=y:h.globals.previousPaths.length>0&&(f=this.barCtx.getPreviousPath(o,l,u,g)),null==f&&(f=b.base),h.config.chart.stacked){const t=this.barCtx.groupCtx;t.yArrj.push(a-p*x),t.yArrjF.push(Math.abs(s-a+b.strokeWidth*x)),t.yArrjVal.push(this.barCtx.series[n][l])}return{pathTo:u,pathFrom:f,drawnBox:{x1:b.x1,x2:b.x2,y1:s,y2:a}}}getFunnelTrapezoidPaths({barYPosition:t,barHeight:e,series:s,i:a,j:i,realIndex:r,strokeWidth:o,w:n}){var l,h;const d=new f(this.barCtx.w),c=n.layout.gridWidth/2,b=t=>Math.abs(t/this.barCtx.invertedYRatio)/2,u=b(s[a][i]),g=i===s[a].length-1,p="taper"===n.config.plotOptions.funnel.lastShape?"taper":"flat";let x;x=g?"taper"===p?0:u:b(s[a][i+1]);const y=o/2,v=t+y,m=t+e-y,C=c-u,w=c+u,I=c-x,P=c+x,S=d.move(C,v)+d.line(w,v)+d.line(P,m)+d.line(I,m)+" Z";let k=null;const H=null==(h=null==(l=this.barCtx.ctx)?void 0:l.morphTypeChange)?void 0:h.getInitialPathFor(r,i);return H?k=H:n.globals.previousPaths.length>0&&(k=this.barCtx.getPreviousPath(r,i,S)),null==k&&(k=d.move(c,v)+d.line(c,v)+d.line(c,m)+d.line(c,m)+" Z"),{pathTo:S,pathFrom:k,x:w,x1:C,barXPosition:c}}computePyramidLayout(t){const e=this.w,s=e.layout.gridHeight,a=e.layout.gridWidth,i=t.map(t=>Math.abs(Number(t)||0)),r=i.reduce((t,e)=>t+e,0);if(0===r||s<=0)return i.map(()=>({y:0,height:0,topHalf:0,bottomHalf:0}));const o=a/2;let n=0;const l=[];for(let t=0;t<i.length;t++){const e=n/r;n+=i[t];const a=n/r,h=e*s,d=a*s;l.push({y:h,height:d-h,topHalf:e*o,bottomHalf:a*o})}return l}getPyramidPaths({barYPosition:t,barHeight:e,topHalf:s,bottomHalf:a,realIndex:i,j:r,strokeWidth:o,w:n}){var l,h;const d=new f(this.barCtx.w),c=n.layout.gridWidth/2,b=o/2,u=t+b,g=t+e-b,p=c-s,x=c+s,y=c-a,v=c+a,m=d.move(p,u)+d.line(x,u)+d.line(v,g)+d.line(y,g)+" Z";let C=null;const w=null==(h=null==(l=this.barCtx.ctx)?void 0:l.morphTypeChange)?void 0:h.getInitialPathFor(i,r);return w?C=w:n.globals.previousPaths.length>0&&(C=this.barCtx.getPreviousPath(i,r,m)),null==C&&(C=d.move(c,u)+d.line(c,u)+d.line(c,g)+d.line(c,g)+" Z"),{pathTo:m,pathFrom:C,x:x,x1:p,barXPosition:c}}getBarpaths({barYPosition:t,barHeight:e,x1:s,x2:a,strokeWidth:i,series:r,realIndex:o,i:n,j:l,w:h}){var d,c;const b=new f(this.barCtx.w),u=this.barRect({a:t,len:e,v1:s,v2:a,strokeWidth:i,realIndex:o,j:l,dir:r[n][l]>=0?1:-1,horizontal:!0}),{y1:g,y2:p,sl:x,closing:y,squarePathTo:v,pathTo:m,strokeCenter:C,direction:w}=u;s=u.x1,a=u.x2;const I=this.barCtx.isFunnel,P=I?(s+a)/2:s;let S=null;const k=null==(c=null==(d=this.barCtx.ctx)?void 0:d.morphTypeChange)?void 0:c.getInitialPathFor(o,l);if(k?S=k:h.globals.previousPaths.length>0&&(S=this.barCtx.getPreviousPath(o,l,m,v)),null==S){const t=I?b.line(P,p):x;S=b.move(P,g)+b.line(P,g)+t+t+t+t+t+b.line(P,g)+y}if(h.config.chart.stacked){const t=this.barCtx.groupCtx;t.xArrj.push(a+C*w),t.xArrjF.push(Math.abs(s-a-u.strokeWidth*w)),t.xArrjVal.push(this.barCtx.series[n][l])}return{pathTo:m,pathFrom:S,drawnBox:{x1:s,x2:a,y1:g,y2:p}}}getXForValue(t,e,s=!0){let a=s?e:null;return null!=t&&(a=e+t/this.barCtx.invertedYRatio-2*(this.barCtx.isReversed?t/this.barCtx.invertedYRatio:0)),a}getYForValue(t,e,s,a=!0){let i=a?e:null;return null!=t&&(i=e-t/this.barCtx.yRatio[s]+2*(this.barCtx.isReversed?t/this.barCtx.yRatio[s]:0)),i}getGoalValues(t,e,s,a,i,r){const o=this.w,h=[],d=(a,i)=>{h.push({[t]:"x"===t?this.getXForValue(a,e,!1):this.getYForValue(a,s,r,!1),attrs:i})};if(o.seriesData.seriesGoals[a]&&o.seriesData.seriesGoals[a][i]&&Array.isArray(o.seriesData.seriesGoals[a][i])&&o.seriesData.seriesGoals[a][i].forEach(t=>{d(t.value,t)}),this.barCtx.barOptions.isDumbbell){const e=this.getDumbbellEnds(a,i);if(e.length){const s={strokeHeight:"x"===t?0:o.globals.markers.size[a],strokeWidth:"x"===t?o.globals.markers.size[a]:0,strokeDashArray:0,strokeLineCap:"round"};let r=0,h=0;for(let t=1;t<e.length;t++)e[t].value<e[r].value&&(r=t),e[t].value>e[h].value&&(h=t);const c=o.config.plotOptions.bar.dumbbell.dataLabels;e.forEach((t,e)=>{const o=l(n({},s),{strokeColor:t.color});!c.enabled||e!==r&&e!==h||(o.label={text:this.getDumbbellLabelText(t.value,a,i,t.index),color:c.colorFromMarker?t.color:Array.isArray(c.style.colors)?c.style.colors[t.index]||c.style.colors[0]:c.style.colors,outward:e===r&&r!==h?-1:1}),d(t.value,o)})}}return h}getDumbbellEnds(t,e){const s=this.w,a=[],i=s.dumbbellData;if(i&&"series"===i.form){const t=i.values[e]||[];for(let e=0;e<t.length;e++){const r=t[e];null!==r&&-1===i.hidden.indexOf(e)&&a.push({value:r,color:s.globals.colors[e],index:e})}return a}if(!s.rangeData.seriesRange.length)return a;const r=this.barCtx.barOptions.dumbbellColors?this.barCtx.barOptions.dumbbellColors:s.globals.colors,o=e=>Array.isArray(r[t])?r[t][e]:r[t];return[{value:s.rangeData.seriesRangeStart[t][e],color:o(0),index:0},{value:s.rangeData.seriesRangeEnd[t][e],color:o(1),index:1}]}getDumbbellLabelText(t,e,s,a){const i=this.w,r=i.config.plotOptions.bar.dumbbell.dataLabels;if("function"==typeof r.formatter)return r.formatter(t,{seriesIndex:e,dataPointIndex:s,endpointIndex:a,w:i});const o=this.barCtx.isHorizontal?i.formatters.xLabelFormatter:i.formatters.yLabelFormatters[0];return"function"==typeof o?o(t,s,i):String(t)}drawGoalLine({barXPosition:t,barYPosition:e,goalX:s,goalY:a,barWidth:i,barHeight:r}){if(!(Array.isArray(s)&&s.length>0||Array.isArray(a)&&a.length>0))return null;const o=new f(this.barCtx.w),n=o.group({class:"apexcharts-bar-goals-groups"});n.node.classList.add("apexcharts-element-hidden"),this.barCtx.w.globals.delayedElements.push({el:n.node}),n.attr("clip-path",`url(#gridRectMarkerMask${this.barCtx.w.globals.cuid})`);let l=null;return this.barCtx.isHorizontal?Array.isArray(s)&&s.forEach(t=>{if(t.x>=-1&&t.x<=o.w.layout.gridWidth+1){const s=void 0!==t.attrs.strokeHeight?t.attrs.strokeHeight:r/2,a=e+s+r/2;l=o.drawLine(t.x,a-2*s,t.x,a,t.attrs.strokeColor?t.attrs.strokeColor:void 0,t.attrs.strokeDashArray,t.attrs.strokeWidth?t.attrs.strokeWidth:2,t.attrs.strokeLineCap),n.add(l),t.attrs.label&&n.add(this.drawDumbbellLabel(t.attrs,{x:t.x,y:a-s,horizontal:!0,markerSize:t.attrs.strokeWidth||0}))}}):Array.isArray(a)&&a.forEach(e=>{if(e.y>=-1&&e.y<=o.w.layout.gridHeight+1){const s=void 0!==e.attrs.strokeWidth?e.attrs.strokeWidth:i/2,a=t+s+i/2;l=o.drawLine(a-2*s,e.y,a,e.y,e.attrs.strokeColor?e.attrs.strokeColor:void 0,e.attrs.strokeDashArray,e.attrs.strokeHeight?e.attrs.strokeHeight:2,e.attrs.strokeLineCap),n.add(l),e.attrs.label&&n.add(this.drawDumbbellLabel(e.attrs,{x:a-s,y:e.y,horizontal:!1,markerSize:e.attrs.strokeHeight||0}))}}),n}drawDumbbellLabel(t,e){const s=this.w,a=new f(s),i=s.config.plotOptions.bar.dumbbell.dataLabels,r=e.markerSize/2+i.offset,o=t.label.outward;return a.drawText({x:e.x+(e.horizontal?r*o:0),y:e.y-(e.horizontal?0:r*o),text:t.label.text,textAnchor:e.horizontal?o<0?"end":"start":"middle",dominantBaseline:e.horizontal?"central":o<0?"hanging":"auto",foreColor:t.label.color,fontSize:i.style.fontSize,fontFamily:i.style.fontFamily,fontWeight:i.style.fontWeight,cssClass:"apexcharts-dumbbell-label"})}drawBarShadow({prevPaths:t,currPaths:e,color:s,realIndex:a,j:i}){const r=this.w,{x:o,x1:n,barYPosition:l}=t,{x:h,x1:d,barYPosition:b}=e,u=l+e.barHeight,g=new f(this.barCtx.w),p=new c,x=g.move(n,u)+g.line(o,u)+g.line(h,b)+g.line(d,b)+g.line(n,u)+("around"===r.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[a][i]?" Z":" z");return g.drawPath({d:x,fill:p.shadeColor(.5,c.rgb2hex(s)),stroke:"none",strokeWidth:0,fillOpacity:1,classes:"apexcharts-bar-shadow apexcharts-decoration-element"})}getZeroValueEncounters({i:t,j:e}){var s;const a=this.w;let i=0,r=0;return(a.config.plotOptions.bar.horizontal?a.seriesData.series.map((t,e)=>e):(null==(s=a.globals.columnSeries)?void 0:s.i.map(t=>t))||[]).forEach(s=>{const o=a.globals.seriesPercent[s][e];o&&i++,s<t&&0===o&&r++}),{nonZeroColumns:i,zeroEncounters:r}}getSeriesGroupIndex(t){var e;return null!=(e=this.w.labelData.seriesGroupIndex[t])?e:-1}getGroupIndex(t){const e=this.getSeriesGroupIndex(t),s=this.barCtx.columnGroupIndices;let a=s.indexOf(e);return a<0&&(s.push(e),a=s.length-1),{groupIndex:e,columnGroupIndex:a}}}const F=d.__apex_CoreUtils,O=d.__apex_Filters;class T{static xRatio(t){const e=t.layout.gridWidth||1;return(t.globals.maxX-t.globals.minX)/e}static dataXToPx(t,e){return(e-t.globals.minX)/T.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*T.xRatio(t)}static screenXToPlotPx(t,e){const s=t.dom.baseEl,a=s&&s.querySelector(".apexcharts-svg");if(!a)return e-t.layout.translateX;const i=a.getBoundingClientRect(),r=t.globals.svgWidth?i.width/t.globals.svgWidth:1;return(e-i.left)/(r||1)-t.layout.translateX}}class Y{constructor(t,e,s){this.ctx=e,this.w=t,this.barOptions=t.config.plotOptions.bar,this.isHorizontal=this.barOptions.horizontal,this.strokeWidth=t.config.stroke.width,this.isNullValue=!1,this.isRangeBar=t.rangeData.seriesRange.length&&this.isHorizontal,this.isVerticalGroupedRangeBar=!t.globals.isBarHorizontal&&t.rangeData.seriesRange.length&&t.config.plotOptions.bar.rangeBarGroupRows,this.isFunnel=this.barOptions.isFunnel,this.isPyramid=this.barOptions.isPyramid,this.pyramidLayout=null,this.xyRatios=s,this.xRatio=0,this.yRatio=[],this.invertedXRatio=0,this.invertedYRatio=0,this.baseLineY=[],this.baseLineInvertedY=0,null!==this.xyRatios&&(this.xRatio=s.xRatio,this.yRatio=s.yRatio,this.invertedXRatio=s.invertedXRatio,this.invertedYRatio=s.invertedYRatio,this.baseLineY=s.baseLineY,this.baseLineInvertedY=s.baseLineInvertedY),this.yaxisIndex=0,this.translationsIndex=0,this.seriesLen=0,this.pathArr=[],this._prevKeyed=null,this._ltCache=null,this._layoutShiftCache=null,this._pathToInterp=null,this.series=[],this.elSeries=null,this.visibleI=0,this.isReversed=!1;const a=new W(this.w);this.lastActiveBarSerieIndex=a.getActiveConfigSeriesIndex("desc",["bar","column"]),this.lastActiveBarSerieIndexByGroup=a.getActiveConfigSeriesIndexByGroup(["bar","column"]),this.columnGroupIndices=[];const i=a.getBarSeriesIndices(),r=new F(this.w);this.stackedSeriesTotals=r.getStackedSeriesTotals(this.w.config.series.map((t,e)=>-1===i.indexOf(e)?e:-1).filter(t=>-1!==t)),this.barHelpers=new X(this)}setSeriesAxis(t){return this.yRatio.length>1&&(this.yaxisIndex=this.w.globals.seriesYAxisReverseMap[t],this.translationsIndex=t),this.translationsIndex}draw(t,e){var s,a,i,r,o;const h=this.w,d=new f(this.w),b=new F(this.w);t=b.getLogSeries(t),this.series=t,this.yRatio=b.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const u=d.group({class:"apexcharts-bar-series apexcharts-plot-series"}),g=this.ctx.highlightFilter;h.config.dataLabels.enabled&&this.totalItems>this.barOptions.dataLabels.maxItems&&console.warn("WARNING: DataLabels are enabled but there are too many to display. This may cause performance issue when rendering - ApexCharts");for(let b=0,p=0;b<t.length;b++,p++){let x,f;const y=[],v=[],m=h.globals.comboCharts?e[b]:b,{columnGroupIndex:C}=this.barHelpers.getGroupIndex(m),w=d.group({class:"apexcharts-series",rel:b+1,seriesName:c.escapeString(h.seriesData.seriesNames[m]),"data:realIndex":m});W.addCollapsedClassToSeries(this.w,w,m),t[b].length>0&&(this.visibleI=this.visibleI+1);const I=this.setSeriesAxis(m);this.isReversed=h.config.yaxis[this.yaxisIndex]&&h.config.yaxis[this.yaxisIndex].reversed,this.isPyramid&&(this.pyramidLayout=this.barHelpers.computePyramidLayout(t[b]));const P=this.barHelpers.initialPositions(m),{y:k,yDivision:H,zeroW:A,x:D,xDivision:R,zeroH:X}=P;let F=P.barHeight,T=P.barWidth;f=k,x=D,this.isHorizontal||v.push(x+(null!=T?T:0)/2);const Y=d.group({class:"apexcharts-datalabels","data:realIndex":m}),j=h.config.dataLabels,B=!(null==(s=j.animate)?void 0:s.enabled)&&this.isLengthTransition(m);h.globals.dataChanged&&!B&&!(!(null==(a=j.animate)?void 0:a.enabled)&&!(null==(i=j.countUp)?void 0:i.enabled))||(h.globals.delayedElements.push({el:Y.node,holdUntilComplete:B}),Y.node.classList.add("apexcharts-element-hidden"));const z=d.group({class:"apexcharts-bar-goals-markers"}),_=d.group({class:"apexcharts-bar-shadows"}),M=this.ctx,G=M._barShadows,V=M._barShadows=[],N=h.globals.dataChanged&&h.globals.shouldAnimate&&h.config.chart.animations.dynamicAnimation.enabled&&(null==G?void 0:G.length)===t[b].length-1;N||(h.globals.delayedElements.push({el:_.node}),_.node.classList.add("apexcharts-element-hidden"));for(let e=0;e<t[b].length;e++){const s=this.barHelpers.getStrokeWidth(b,e,m);let a=null;const i={indexes:{i:b,j:e,realIndex:m,translationsIndex:I,bc:p},x:x,y:f,strokeWidth:s,elSeries:w};this.isHorizontal?(a=this.drawBarPaths(l(n({},i),{barHeight:F,zeroW:A,yDivision:H})),T=this.series[b][e]/this.invertedYRatio):(a=this.drawColumnPaths(l(n({},i),{xDivision:R,barWidth:T,zeroH:X})),F=this.series[b][e]/this.yRatio[I]);const d=this.barHelpers.getPathFillColor(t,b,e,m);if(this.isFunnel&&!this.isPyramid&&this.barOptions.isFunnel3d&&"trapezoid"!==(null==(r=h.config.plotOptions.funnel)?void 0:r.shape)&&this.pathArr.length&&e>0){const t=this.barHelpers.drawBarShadow({color:"string"==typeof d.color&&-1===(null==(o=d.color)?void 0:o.indexOf("url"))?d.color:c.hexToRgba(h.globals.colors[b]),prevPaths:this.pathArr[this.pathArr.length-1],currPaths:a,realIndex:m,j:e});if(_.add(t),V.push(t),this._shadow=N&&[t,G[e-1].attr("d")],h.config.chart.dropShadow.enabled){new O(this.w).dropShadow(t,h.config.chart.dropShadow,m)}}this.pathArr.push(a);const u=this.barHelpers.drawGoalLine({barXPosition:a.barXPosition,barYPosition:a.barYPosition,goalX:a.goalX,goalY:a.goalY,barHeight:F,barWidth:T});u&&z.add(u),f=a.y,x=a.x,e>0&&v.push(x+(null!=T?T:0)/2),y.push(f),this.renderSeries(l(n({hl:null==g?void 0:g.bar(this,{i:b,j:e,realIndex:m,translationsIndex:I,paths:a,zeroH:X,zeroW:A}),realIndex:m,pathFill:d.color},d.useRangeColor?{lineFill:d.color}:{}),{j:e,i:b,columnGroupIndex:C,pathFrom:a.pathFrom,pathTo:a.pathTo,strokeWidth:s,elSeries:w,x:x,y:f,series:t,barHeight:Math.abs(a.barHeight?a.barHeight:F),barWidth:Math.abs(a.barWidth?a.barWidth:T),elDataLabelsWrap:Y,elGoalsMarkers:z,elBarShadows:_,visibleSeries:this.visibleI,type:"bar"}))}if(h.globals.seriesXvalues[m]=v,h.globals.seriesYvalues[m]=y,h.globals.previousPaths.length>0){const e=[];for(let s=0;s<t[b].length;s++)e.push(S(h,m,s));L({w:h,elSeries:w,record:this._prevRecord(m),newKeys:e,isHorizontal:this.isHorizontal,speed:h.config.chart.animations.dynamicAnimation.speed})}u.add(w)}return u}renderSeries({hl:t,realIndex:e,pathFill:s,lineFill:a,j:i,i:r,columnGroupIndex:o,pathFrom:h,pathTo:d,strokeWidth:c,elSeries:b,x:u,y:g,y1:p,y2:x,series:y,barHeight:v,barWidth:w,barXPosition:I,barYPosition:P,elDataLabelsWrap:k,elGoalsMarkers:H,elBarShadows:L,visibleSeries:W,type:D,classes:R,fadeReveal:X=!1}){var F,T,Y,j,B,z,_;const M=this.w,G=new f(this.w,this.ctx),V=function(t,e){const s=t&&t.renderer;return s&&s.kind&&"svg"!==s.kind?s:e}(this.ctx,G);let N=!1;const E=this._pathToInterp;if(this._pathToInterp=null,b._bindingsDelegated||(b._bindingsDelegated=!0,G.setupEventDelegation(b,`.apexcharts-${D}-area`)),!a){let t=function(t){const e=M.config.stroke.colors;let s;return Array.isArray(e)&&e.length>0&&(s=e[t],s||(s=""),"function"==typeof s)?s({value:M.seriesData.series[t][i],dataPointIndex:i,w:M}):s};const s="function"==typeof M.globals.stroke.colors[e]?t(e):M.globals.stroke.colors[e];a=this.barOptions.distributed?M.globals.stroke.colors[i]:s}const $=M.config.chart.animations,Z=$.animateGradually;let K=0,q=0;if(Z&&!1!==Z.enabled&&!(M.globals.dataChanged&&this.isLayoutShift(e))){const t=M.globals.dataPoints||1,e=Z.delay||0,s=Math.min(e,.5*$.speed/Math.max(1,t));q=C({style:"sequential",index:i,baseDelay:s}),M.config.chart.stacked&&!M.globals.dataChanged&&(q+=r*s*.5);K=q/(e||1)}const U=new A(this).handleBarDataLabels({x:u,y:g,y1:p,y2:x,i:r,j:i,series:y,realIndex:e,columnGroupIndex:o,barHeight:v,barWidth:w,barXPosition:I,barYPosition:P,visibleSeries:W,hl:null==t?void 0:t.label});if(q>0){const t=M.config.dataLabels;if((null==(F=t.animate)?void 0:F.enabled)||(null==(T=t.countUp)?void 0:T.enabled)){const t=String(Math.round(q));null==(j=null==(Y=U.dataLabels)?void 0:Y.node)||j.setAttribute("data:dlDelay",t),null==(z=null==(B=U.totalDataLabels)?void 0:B.node)||z.setAttribute("data:dlDelay",t)}}let J=!1;M.globals.isBarHorizontal||(U.dataLabelsPos.dataLabelsX+Math.max(w,M.globals.barPadForNumericAxis)<0||U.dataLabelsPos.dataLabelsX-Math.max(w,M.globals.barPadForNumericAxis)>M.layout.gridWidth)&&(this._wasOnScreen(e,i)?J=!0:N=!0),M.config.series[r].data[i]&&M.config.series[r].data[i].strokeColor&&(a=M.config.series[r].data[i].strokeColor);const Q=s;if(this.isNullValue&&-1===M.globals.collapsingSeriesIndices.indexOf(e)&&(s="none"),!N){const o=!0===(null==(_=this.ctx.morphTypeChange)?void 0:_.isActive()),u=o?this.ctx.morphTypeChange.getSpeed():M.config.chart.animations.dynamicAnimation.speed,g=o&&this.ctx.morphTypeChange.claimsTargetMark(e,i);g&&(h=d,K=0);const f=V.renderPaths({i:r,j:i,realIndex:e,pathFrom:h,pathTo:d,stroke:a,strokeWidth:c,strokeLineCap:M.config.stroke.lineCap,fill:s,pathToInterp:E,animationDelay:K,initialSpeed:M.config.chart.animations.speed,dataChangeSpeed:u,className:`apexcharts-${D}-area${R?` ${R}`:""}`,chartType:D,bindEventsOnPaths:!1,fadeReveal:X});f.attr("clip-path",`url(#gridRectBarMask${M.globals.cuid})`),J&&f.node.classList.add("apexcharts-leaving");const y=this._shadow;y&&(this._shadow=null,new m(M,this.ctx).animatePathsGradually({el:y[0],fill:"none",pathFrom:y[1],pathTo:y[0].attr("d"),speed:u,delay:K})),g&&(f.node.setAttribute("opacity","0"),f.node.setAttribute("data-piece-hidden","1"));const C=M.config.forecastDataPoints;C.count>0&&i>=M.globals.dataPoints-C.count&&(f.node.setAttribute("stroke-dasharray",C.dashArray),f.node.setAttribute("stroke-width",C.strokeWidth),f.node.setAttribute("fill-opacity",C.fillOpacity)),void 0!==p&&void 0!==x&&(f.attr("data-range-y1",p),f.attr("data-range-y2",x));if(new O(this.w).setSelectionFilter(f,e,i),b.add(f),f.attr({cy:U.dataLabelsPos.bcy,cx:U.dataLabelsPos.bcx,j:i,val:M.seriesData.series[r][i],barHeight:v,barWidth:w,"data:pathKey":S(M,e,i)}),null==t||t.paint(f,{delay:K,delayMs:q,speed:u,fill:Q,elSeries:b,elBarShadows:L,labels:U.dataLabels,pathFrom:h,pathTo:d}),"canvas"===V.kind){M.globals.barCanvasCoords||(M.globals.barCanvasCoords={}),M.globals.barCanvasCoords[e]||(M.globals.barCanvasCoords[e]={});const t=M.globals.barCanvasCoords[e][i];let s=(null==t?void 0:t.bounds)||null;const a=f.bbox();(a.width>0||a.height>0)&&(s={left:Math.min(s?s.left:1/0,a.x),top:Math.min(s?s.top:1/0,a.y),right:Math.max(s?s.right:-1/0,a.x+a.width),bottom:Math.max(s?s.bottom:-1/0,a.y+a.height)}),M.globals.barCanvasCoords[e][i]=l(n({cx:U.dataLabelsPos.bcx,cy:U.dataLabelsPos.bcy,barWidth:w,type:D},void 0!==p&&void 0!==x&&{rangeY1:p,rangeY2:x}),{bounds:s})}null!==U.dataLabels&&k.add(U.dataLabels),U.totalDataLabels&&k.add(U.totalDataLabels),b.add(k),H&&b.add(H),L&&b.add(L)}return b}drawBarPaths({indexes:t,barHeight:e,strokeWidth:s,zeroW:a,x:i,y:r,yDivision:o,elSeries:n}){const l=this.w,h=t.i,d=t.j;let c;if(l.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:s}=this.barHelpers.getZeroValueEncounters({i:h,j:d});t>0&&(e=this.seriesLen*e/t),c=r+e*this.visibleI,c-=e*s}else c=r+e*this.visibleI;const b=this.isFunnel&&"trapezoid"===l.config.plotOptions.funnel.shape,u=this.isPyramid&&this.pyramidLayout?this.pyramidLayout[d]:null,g=!!u;if(u)c=u.y,e=u.height;else if(this.isFunnel&&!b){const t=null!=a?a:0;a=t-(this.barHelpers.getXForValue(this.series[h][d],t)-t)/2}let p;return i=this.barHelpers.getXForValue(this.series[h][d],null!=a?a:0),p=u?this.barHelpers.getPyramidPaths({barYPosition:c,barHeight:e,topHalf:u.topHalf,bottomHalf:u.bottomHalf,realIndex:t.realIndex,j:d,strokeWidth:s,w:l}):b?this.barHelpers.getFunnelTrapezoidPaths({barYPosition:c,barHeight:e,series:this.series,i:h,j:d,realIndex:t.realIndex,strokeWidth:s,w:l}):this.barHelpers.getBarpaths({barYPosition:c,barHeight:e,x1:a,x2:i,strokeWidth:s,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:h,j:d,w:l}),(b||g)&&(a=p.x1,i=p.x),g||(r+=o),g&&(r=c),this.barHelpers.barBackground({j:d,i:h,y1:c-e*this.visibleI,y2:e*this.seriesLen,elSeries:n}),{pathTo:p.pathTo,pathFrom:p.pathFrom,x1:a,x:i,y:r,goalX:this.barHelpers.getGoalValues("x",a,null,t.realIndex,d,0),barYPosition:c,barHeight:e}}drawColumnPaths({indexes:t,x:e,y:s,xDivision:a,barWidth:i,zeroH:r,strokeWidth:o,elSeries:n}){const l=this.w,h=t.realIndex,d=t.translationsIndex,c=t.i,b=t.j,u=t.bc;let g;if(l.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:b,realIndex:h,barWidth:i});e=t.x,g=t.barXPosition}else if(l.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:s}=this.barHelpers.getZeroValueEncounters({i:c,j:b});t>0&&(i=this.seriesLen*i/t),g=e+i*this.visibleI,g-=i*s}else g=e+i*this.visibleI;s=this.barHelpers.getYForValue(this.series[c][b],r,d);const p=this.barHelpers.getColumnPaths({barXPosition:g,barWidth:i,y1:r,y2:s,strokeWidth:o,isReversed:this.isReversed,series:this.series,realIndex:h,i:c,j:b,w:l});return l.axisFlags.isXNumeric||(e+=a),this.barHelpers.barBackground({bc:u,j:b,i:c,x1:g-o/2-i*this.visibleI,x2:i*this.seriesLen+o/2,elSeries:n}),{pathTo:p.pathTo,pathFrom:p.pathFrom,x:e,y:s,goalY:this.barHelpers.getGoalValues("y",null,r,h,b,d),barXPosition:g,barWidth:i}}getBarXForNumericXAxis({x:t,barWidth:e,realIndex:s,j:a}){const i=this.w;let r=s;return i.seriesData.seriesX[s].length||(r=i.globals.maxValsInArrayIndex),c.isNumber(i.seriesData.seriesX[r][a])&&(t=T.dataXToPx(i,i.seriesData.seriesX[r][a])-e*this.seriesLen/2),{barXPosition:t+(R(i)?0:e*this.visibleI),x:t}}_wasOnScreen(t,e){if(!P(this.w))return!1;const s=this._prevKeyedPaths(t);return!!s&&s.has(S(this.w,t,e))}_prevRecord(t){const e=this.w;let s=null;for(let a=0;a<e.globals.previousPaths.length;a++){const i=e.globals.previousPaths[a];i.paths&&i.paths.length>0&&parseInt(i.realIndex,10)===parseInt(String(t),10)&&(s=i)}return s}_prevKeyedPaths(t){if(this._prevKeyed||(this._prevKeyed={}),void 0!==this._prevKeyed[t])return this._prevKeyed[t];const e=this._prevRecord(t);let s=null;if(e&&e.paths.every(t=>null!=t.key)){const t=new Map;e.paths.forEach(e=>{t.set(e.key,e)}),s=t}return this._prevKeyed[t]=s,s}isLengthTransition(t){var e,s;if(this._ltCache||(this._ltCache={}),void 0!==this._ltCache[t])return this._ltCache[t];const a=this.w;let i=!1;if(P(a)&&a.globals.previousPaths.length>0){const r=this._prevRecord(t),o=null!=(s=null==(e=a.seriesData.series[t])?void 0:e.length)?s:0;if(r)if(r.paths.length!==o)i=!0;else{const e=this._prevKeyedPaths(t);if(e)for(let s=0;s<o;s++)if(!e.has(S(a,t,s))){i=!0;break}}else i=o>0}return this._ltCache[t]=i,i}isLayoutShift(t){if(this.isLengthTransition(t))return!0;if(this._layoutShiftCache||(this._layoutShiftCache={}),void 0!==this._layoutShiftCache[t])return this._layoutShiftCache[t];const e=H(this.w,t,!0,!0),s=!(!e||!e.join.changed);return this._layoutShiftCache[t]=s,s}getPreviousPath(t,e,s,a){const i=this.w;this._pathToInterp=null;const r=this._prevRecord(t);if(!r)return P(i)?null:s;let o=null,n=!1;const l=this._prevKeyedPaths(t);if(l){const s=l.get(S(i,t,e));s?o=s.d:n=!0}else void 0!==r.paths[e]?o=r.paths[e].d:n=!0;return o?this.cornerMorph(o,s,a):n&&P(i)?null:s}cornerMorph(t,e,s){const a=Y.pathCommandCount(t),i=Y.pathCommandCount(e);if(a===i)return t;const r=new f(this.w),o=t=>{const e=Y.pathBox(t);return e?Math.min(e.maxX-e.minX,e.maxY-e.minY):0},n=a<i?o(t)>1:o(e)>1;if(a<i){const e=r.roundPathCorners(t,0);if(Y.pathCommandCount(e)===i){if(n&&s){const t=r.roundPathCorners(s,0);Y.pathCommandCount(t)===i&&(this._pathToInterp=t)}return e}}else{const s=r.roundPathCorners(e,0);if(Y.pathCommandCount(s)===a){if(this._pathToInterp=s,n){const e=Y.squareLike(t),s=e?r.roundPathCorners(e,0):null;if(s&&Y.pathCommandCount(s)===a)return s}return t}}return e}static pathBox(t){if(!t)return null;const e=[],s=/([MLC])([^MLCZz]*)/g;let a;for(;null!==(a=s.exec(t));){const t=a[2].trim().split(/[\s,]+/).map(Number);t.length<2||t.some(isNaN)||e.push([t[t.length-2],t[t.length-1]])}if(e.length<3)return null;const i=e.map(t=>t[0]),r=e.map(t=>t[1]);return{minX:Math.min(...i),maxX:Math.max(...i),minY:Math.min(...r),maxY:Math.max(...r),start:e[0],vertical:Math.abs(e[1][0]-e[0][0])<Math.abs(e[1][1]-e[0][1])}}static squareLike(t){const e=Y.pathBox(t);if(!e)return null;const{minX:s,maxX:a,minY:i,maxY:r,start:o,vertical:n}=e,l=(t,e,s)=>Math.abs(t-e)<=Math.abs(t-s)?[e,s]:[s,e];let h,d,c,b;n?(h=Math.abs(o[0]-s)<=Math.abs(o[0]-a)?s:a,d=h===s?a:s,[c,b]=l(o[1],i,r)):(c=Math.abs(o[1]-i)<=Math.abs(o[1]-r)?i:r,b=c===i?r:i,[h,d]=l(o[0],s,a));const u=t.trim().endsWith("Z")?" Z":" z";return n?`M ${h} ${c} L ${h} ${b} L ${d} ${b} L ${d} ${c}${u}`:`M ${h} ${c} L ${d} ${c} L ${d} ${b} L ${h} ${b}${u}`}getPreviousFlip(t,e){const s=this.w,a=this._prevRecord(t);if(!a)return null;const i=this._prevKeyedPaths(t),r=i?i.get(S(s,t,e)):a.paths[e];return r?!!r.flip:null}static pathCommandCount(t){if(!t)return 0;const e=t.match(/[MmLlHhVvCcSsQqTtAaZz]/g);return e?e.length:0}}d.default.use({bar:Y,column:Y,barStacked:class extends Y{draw(t,e){const s=this.w;this.graphics=new f(this.w);const a=new F(this.w);t=a.getLogSeries(t),this.yRatio=a.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t),"100%"===s.config.chart.stackType&&(t=s.globals.comboCharts?e.map(t=>s.globals.seriesPercent[t]):s.globals.seriesPercent.slice()),this.series=t,this.barHelpers.initializeStackedPrevVars(this);const i=this.graphics.group({class:"apexcharts-bar-series apexcharts-plot-series"}),r=this.ctx.highlightFilter;let o=0,h=0;const d=s.config.chart.animations,b=d.enabled&&d.dynamicAnimation.enabled&&s.globals.previousPaths.length>0;let u=!1;for(let a=0,d=0;a<t.length;a++,d++){const g=s.globals.comboCharts?e[a]:a,{groupIndex:p,columnGroupIndex:x}=this.barHelpers.getGroupIndex(g);this.groupCtx=this.stacks[p];const f=[],y=[],v=this.setSeriesAxis(g);this.isReversed=s.config.yaxis[this.yaxisIndex]&&s.config.yaxis[this.yaxisIndex].reversed;let m=this.graphics.group({class:"apexcharts-series",seriesName:c.escapeString(s.seriesData.seriesNames[g]),rel:a+1,"data:realIndex":g});W.addCollapsedClassToSeries(this.w,m,g);const C=this.graphics.group({class:"apexcharts-datalabels","data:realIndex":g});W.addCollapsedClassToSeries(this.w,C,g),(s.globals.collapsingSeriesIndices||[]).indexOf(g)>-1&&C.node.style.setProperty("--apexcharts-dl-exit",`${s.config.chart.animations.dynamicAnimation.speed}ms`);const w=this.graphics.group({class:"apexcharts-bar-goals-markers"}),I=this.initialPositions(o,h,void 0,void 0,void 0,void 0,v),{xDivision:P,yDivision:S,zeroH:k,zeroW:H}=I;let L=I.barHeight,A=I.barWidth;h=I.y,o=I.x,s.globals.barHeight=L,s.globals.barWidth=A,this.barHelpers.initializeStackedXYVars(this),1===this.groupCtx.prevY.length&&this.groupCtx.prevY[0].every(t=>isNaN(t))&&(this.groupCtx.prevY[0]=this.groupCtx.prevY[0].map(()=>k),this.groupCtx.prevYF[0]=this.groupCtx.prevYF[0].map(()=>0));for(let e=0;e<s.globals.dataPoints;e++){const i=this.barHelpers.getStrokeWidth(a,e,g),c={indexes:{i:a,j:e,realIndex:g,translationsIndex:v,bc:d},strokeWidth:i,x:o,y:h,elSeries:m,columnGroupIndex:x};let p=null;this.isHorizontal?(p=this.drawStackedBarPaths(l(n({},c),{zeroW:H,barHeight:L,yDivision:S})),A=this.series[a][e]/this.invertedYRatio):(p=this.drawStackedColumnPaths(l(n({},c),{xDivision:P,barWidth:A,zeroH:k})),L=this.series[a][e]/this.yRatio[v]);const I=this.barHelpers.drawGoalLine({barXPosition:p.barXPosition,barYPosition:p.barYPosition,goalX:p.goalX,goalY:p.goalY,barHeight:L,barWidth:A});I&&w.add(I),h=p.y,o=p.x,f.push(o),y.push(h);const W=this.barHelpers.getPathFillColor(t,a,e,g);let D="";const R=s.globals.isBarHorizontal?"apexcharts-flip-x":"apexcharts-flip-y",X=this.cornerFlip(this.barHelpers.arrBorderRadius[g][e],s.seriesData.series[g][e]),F=b&&!X&&this.getPreviousFlip(g,e);(X||F)&&(D=R),F&&(D+=" apexcharts-flip-held",u=!0),m=this.renderSeries(l(n({hl:null==r?void 0:r.bar(this,{i:a,j:e,realIndex:g,translationsIndex:v,paths:p,zeroH:k,zeroW:H}),realIndex:g,pathFill:W.color},W.useRangeColor?{lineFill:W.color}:{}),{j:e,i:a,columnGroupIndex:x,pathFrom:p.pathFrom,pathTo:p.pathTo,strokeWidth:i,elSeries:m,x:o,y:h,series:t,barHeight:L,barWidth:A,elDataLabelsWrap:C,elGoalsMarkers:w,type:"bar",visibleSeries:x,classes:D}))}s.globals.seriesXvalues[g]=f,s.globals.seriesYvalues[g]=y,this.groupCtx.prevY.push(this.groupCtx.yArrj),this.groupCtx.prevYF.push(this.groupCtx.yArrjF),this.groupCtx.prevYVal.push(this.groupCtx.yArrjVal),this.groupCtx.prevX.push(this.groupCtx.xArrj),this.groupCtx.prevXF.push(this.groupCtx.xArrjF),this.groupCtx.prevXVal.push(this.groupCtx.xArrjVal),i.add(m)}return u&&this.settleHeldMirrors(),i}cornerFlip(t,e){return"bottom"===t&&e>0||"top"===t&&e<0}settleHeldMirrors(){const t=this.w;if(!I.isBrowser())return;const e=t.config.chart.animations,s=(e.dynamicAnimation.speed||0)+(e.speed||0)+100;setTimeout(()=>{!t.globals.isDestroyed&&c.elementExists(t.dom.baseEl)&&t.dom.baseEl.querySelectorAll(".apexcharts-flip-held").forEach(t=>{t.classList.remove("apexcharts-flip-held","apexcharts-flip-y","apexcharts-flip-x")})},s)}initialPositions(t,e,s,a,i,r,o){const n=this.w;let l,h;if(this.isHorizontal){a=n.layout.gridHeight/n.globals.dataPoints;const t=n.config.plotOptions.bar.barHeight;l=-1===String(t).indexOf("%")?parseInt(t,10):a*parseInt(t,10)/100,r=n.globals.padHorizontal+(this.isReversed?n.layout.gridWidth-this.baseLineInvertedY:this.baseLineInvertedY),e=(a-l)/2}else{h=s=n.layout.gridWidth/n.globals.dataPoints;const e=n.config.plotOptions.bar.columnWidth,a=n.axisFlags.isXNumeric?this.barHelpers.barSlotXSpan():0;a>0?h=(s=a/this.xRatio)*parseInt(this.barOptions.columnWidth,10)/100:h*=parseInt(e,10)/100,-1===String(e).indexOf("%")&&(h=parseInt(e,10)),i=this.isReversed?this.baseLineY[o]:n.layout.gridHeight-this.baseLineY[o],t=n.globals.padHorizontal+(s-h)/2}const d=n.globals.barGroups.length||1;return{x:t,y:e,yDivision:a,xDivision:s,barHeight:(null!=l?l:0)/d,barWidth:(null!=h?h:0)/d,zeroH:i,zeroW:r}}drawStackedBarPaths({indexes:t,barHeight:e,strokeWidth:s,zeroW:a,x:i,y:r,columnGroupIndex:o,yDivision:n,elSeries:l}){var h,d,c,b,u;const g=this.w,p=r+o*e;let x;const f=t.i,y=t.j,v=t.realIndex,m=t.translationsIndex;let C=0;for(let t=0;t<this.groupCtx.prevXF.length;t++)C+=this.groupCtx.prevXF[t][y];const w=this.groupCtx.prevX.length;if(w>0){let t=a;this.groupCtx.prevXVal[w-1][y]<0?t=(null==(h=this.series[f])?void 0:h[y])>=0?this.groupCtx.prevX[w-1][y]+C-2*(this.isReversed?C:0):this.groupCtx.prevX[w-1][y]:this.groupCtx.prevXVal[w-1][y]>=0&&(t=(null==(d=this.series[f])?void 0:d[y])>=0?this.groupCtx.prevX[w-1][y]:this.groupCtx.prevX[w-1][y]-C+2*(this.isReversed?C:0)),x=t}else x=a;i=null===(null==(c=this.series[f])?void 0:c[y])?x:x+(null==(b=this.series[f])?void 0:b[y])/this.invertedYRatio-2*(this.isReversed?(null==(u=this.series[f])?void 0:u[y])/this.invertedYRatio:0);const I=this.barHelpers.getBarpaths({barYPosition:p,barHeight:e,x1:x,x2:i,strokeWidth:s,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:f,j:y,w:g});return this.barHelpers.barBackground({j:y,i:f,y1:p,y2:e,elSeries:l}),r+=n,{pathTo:I.pathTo,pathFrom:I.pathFrom,goalX:this.barHelpers.getGoalValues("x",a,null,v,y,m),barXPosition:x,barYPosition:p,x:i,y:r}}drawStackedColumnPaths({indexes:t,x:e,y:s,xDivision:a,barWidth:i,zeroH:r,columnGroupIndex:o,elSeries:n}){var l,h,d,c,b,u;const g=this.w,p=t.i,x=t.j,f=t.bc,y=t.realIndex,v=t.translationsIndex;if(g.axisFlags.isXNumeric){let t=g.seriesData.seriesX[y][x];t||(t=0),e=(t-g.globals.minX)/this.xRatio-i/2*g.globals.barGroups.length}const m=e+o*i;let C;const w=this.groupCtx,I=g.axisFlags.isXNumeric?g.seriesData.seriesX[y][x]:x,P=w.tops.get(I);if(P){const[t,e,s]=P;let a;e<0?a=(null==(l=this.series[p])?void 0:l[x])>=0?t-s+2*(this.isReversed?s:0):t:e>=0&&(a=(null==(h=this.series[p])?void 0:h[x])>=0?t:t+s-2*(this.isReversed?s:0)),void 0===a&&(a=g.layout.gridHeight),C=(null==(d=w.prevYF[0])?void 0:d.every(t=>0===t))&&w.prevYF.slice(1).every(t=>t.every(t=>isNaN(t)))?r:a}else C=r;s=(null==(c=this.series[p])?void 0:c[x])?C-(null==(b=this.series[p])?void 0:b[x])/this.yRatio[v]+2*(this.isReversed?(null==(u=this.series[p])?void 0:u[x])/this.yRatio[v]:0):C;const S=this.barHelpers.getColumnPaths({barXPosition:m,barWidth:i,y1:C,y2:s,yRatio:this.yRatio[v],strokeWidth:this.strokeWidth,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:p,j:x,w:g}),k=w.yArrj[x];return isNaN(k)||w.tops.set(I,[k,w.yArrjVal[x],(P?P[2]:0)+w.yArrjF[x],(P?P[3]:0)+(g.seriesData.series[y][x]||0),P?Math.min(P[0],P[4]):1/0,P?Math.max(P[0],P[5]):-1/0]),this.barHelpers.barBackground({bc:f,j:x,i:p,x1:m,x2:i,elSeries:n}),{pathTo:S.pathTo,pathFrom:S.pathFrom,goalY:this.barHelpers.getGoalValues("y",null,r,y,x,0),barXPosition:m,x:g.axisFlags.isXNumeric?e:e+a,y:s}}},rangeBar:class extends Y{draw(t,e){var s,a,i,r,o,l,h,d,b;const u=this.w,g=new f(this.w);this.rangeBarOptions=this.w.config.plotOptions.rangeBar,this.series=t,this.seriesRangeStart=u.rangeData.seriesRangeStart,this.seriesRangeEnd=u.rangeData.seriesRangeEnd,this.barHelpers.initVariables(t);const p=g.group({class:"apexcharts-rangebar-series apexcharts-plot-series"});for(let x=0;x<t.length;x++){let f,y;const v=u.globals.comboCharts?e[x]:x,{columnGroupIndex:m}=this.barHelpers.getGroupIndex(v),C=g.group({class:"apexcharts-series",seriesName:c.escapeString(u.seriesData.seriesNames[v]),rel:x+1,"data:realIndex":v});W.addCollapsedClassToSeries(this.w,C,v),t[x].length>0&&(this.visibleI=this.visibleI+1);const w=this.setSeriesAxis(v),I=this.barHelpers.initialPositions(v),{y:P,zeroW:k,x:H,zeroH:A}=I;let D=null!=(s=I.barWidth)?s:0,R=null!=(a=I.barHeight)?a:0;const X=null!=(i=I.yDivision)?i:0,F=null!=(r=I.xDivision)?r:0;y=P,f=H;const O=g.group({class:"apexcharts-datalabels","data:realIndex":v}),T=g.group({class:"apexcharts-rangebar-goals-markers"});for(let e=0;e<u.globals.dataPoints;e++){const s=this.barHelpers.getStrokeWidth(x,e,v),a=this.seriesRangeStart[x][e],i=this.seriesRangeEnd[x][e];let r=null,c=null,g=null;const p={x:f,y:y,strokeWidth:s,elSeries:C};let P=this.seriesLen;if(u.config.plotOptions.bar.rangeBarGroupRows&&(P=1),void 0===(null==(o=u.config.series[x].data)?void 0:o[e]))break;if(this.isHorizontal){g=y+R*this.visibleI;const t=(X-R*P)/2;if(null==(h=null==(l=u.config.series[x].data)?void 0:l[e])?void 0:h.x){const s=this.detectOverlappingBars({i:x,j:e,barYPosition:g,srty:t,barHeight:R,yDivision:X,initPositions:I});R=s.barHeight,g=s.barYPosition}r=this.drawRangeBarPaths(n({indexes:{i:x,j:e,realIndex:v},barHeight:R,barYPosition:g,zeroW:k,yDivision:X,y1:a,y2:i},p)),D=r.barWidth}else{u.axisFlags.isXNumeric&&(f=(u.seriesData.seriesX[x][e]-u.globals.minX)/this.xRatio-D/2),c=f+D*this.visibleI;const t=(F-D*P)/2;if(null==(b=null==(d=u.config.series[x].data)?void 0:d[e])?void 0:b.x){const s=this.detectOverlappingBars({i:x,j:e,barXPosition:c,srtx:t,barWidth:D,xDivision:F,initPositions:I});D=s.barWidth,c=s.barXPosition}r=this.drawRangeColumnPaths(n({indexes:{i:x,j:e,realIndex:v,translationsIndex:w},barWidth:D,barXPosition:c,zeroH:A,xDivision:F},p)),R=r.barHeight}const S=this.barHelpers.drawGoalLine({barXPosition:r.barXPosition,barYPosition:g,goalX:r.goalX,goalY:r.goalY,barHeight:R,barWidth:D});S&&T.add(S),y=r.y,f=r.x;const H=this.barHelpers.getPathFillColor(t,x,e,v);this.renderSeries({realIndex:v,pathFill:H.color,lineFill:H.useRangeColor?H.color:u.globals.stroke.colors[v],j:e,i:x,x:f,y:y,y1:a,y2:i,pathFrom:r.pathFrom,pathTo:r.pathTo,strokeWidth:s,elSeries:C,series:t,barHeight:R,barWidth:D,barXPosition:c,barYPosition:g,columnGroupIndex:m,elDataLabelsWrap:O,elGoalsMarkers:T,visibleSeries:this.visibleI,type:"rangebar"})}if(u.globals.previousPaths.length>0){const t=u.config.series[x].data||[],e=[];for(let s=0;s<t.length;s++)e.push(S(u,v,s));L({w:u,elSeries:C,record:this._prevRecord(v),newKeys:e,isHorizontal:this.isHorizontal,speed:u.config.chart.animations.dynamicAnimation.speed})}p.add(C)}return p}detectOverlappingBars({i:t,j:e,barYPosition:s,barXPosition:a,srty:i,srtx:r,barHeight:o,barWidth:n,yDivision:l,xDivision:h,initPositions:d}){var c,b,u,g;const p=this.w;let x=[];const f=null==(b=null==(c=p.globals.seriesRangeName)?void 0:c[t])?void 0:b[e],y=null==(g=null==(u=p.config.series[t].data)?void 0:u[e])?void 0:g.x,v=Array.isArray(y)?y.join(" "):y,m=p.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(v),C=p.rangeData.seriesRange[t].findIndex(t=>{var e;return t.x===v&&(null==(e=t.overlaps)?void 0:e.size)>0});return this.isHorizontal?(s=p.config.plotOptions.bar.rangeBarGroupRows?i+l*m:i+o*this.visibleI+l*m,C>-1&&!p.config.plotOptions.bar.rangeBarOverlap&&(x=Array.from(p.rangeData.seriesRange[t][C].overlaps),x.indexOf(f)>-1&&(s=(o=d.barHeight/x.length)*this.visibleI+l*(100-parseInt(this.barOptions.barHeight,10))/100/2+o*(this.visibleI+x.indexOf(f))+l*m))):(m>-1&&!p.labelData.timescaleLabels.length&&(a=p.config.plotOptions.bar.rangeBarGroupRows?r+h*m:r+n*this.visibleI+h*m),C>-1&&!p.config.plotOptions.bar.rangeBarOverlap&&(x=Array.from(p.rangeData.seriesRange[t][C].overlaps),x.indexOf(f)>-1&&(a=(n=d.barWidth/x.length)*this.visibleI+h*(100-parseInt(this.barOptions.barWidth,10))/100/2+n*(this.visibleI+x.indexOf(f))+h*m))),{barYPosition:s,barXPosition:a,barHeight:o,barWidth:n}}drawRangeColumnPaths({indexes:t,x:e,xDivision:s,barWidth:a,barXPosition:i,zeroH:r}){var o,n;const l=this.w,{i:h,j:d,realIndex:c,translationsIndex:b}=t,u=this.yRatio[b],g=this.getRangeValue(c,d);let p=Math.min(g.start,g.end),x=Math.max(g.start,g.end);const f=!(void 0===(null==(o=this.series[h])?void 0:o[d])||null===(null==(n=this.series[h])?void 0:n[d]));f?(p=r-p/u,x=r-x/u):p=r;const y=Math.abs(x-p),v=this.barHelpers.getColumnPaths({barXPosition:i,barWidth:a,y1:p,y2:x,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,realIndex:c,i:c,j:d,w:l});if(f){const t=v.drawnBox,e=g.end>=g.start;this.recordColumnGeometry(c,d,{slotStart:t.x1,slotEnd:t.x2,levelStart:e?t.y1:t.y2,levelEnd:e?t.y2:t.y1,horizontal:!1})}if(l.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:d,realIndex:c,barWidth:a});e=t.x,i=t.barXPosition}else e+=s;return{pathTo:v.pathTo,pathFrom:v.pathFrom,barHeight:y,x:e,y:g.start<0&&g.end<0?p:x,goalY:this.barHelpers.getGoalValues("y",null,r,c,d,b),barXPosition:i}}preventBarOverflow(t){const e=this.w;return t<0&&(t=0),t>e.layout.gridWidth&&(t=e.layout.gridWidth),t}drawRangeBarPaths({indexes:t,y:e,y1:s,y2:a,yDivision:i,barHeight:r,barYPosition:o,zeroW:n}){const l=this.w,{realIndex:h,j:d}=t,c=this.preventBarOverflow(n+s/this.invertedYRatio),b=this.preventBarOverflow(n+a/this.invertedYRatio),u=this.getRangeValue(h,d),g=Math.abs(b-c),p=this.barHelpers.getBarpaths({barYPosition:o,barHeight:r,x1:c,x2:b,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,i:h,realIndex:h,j:d,w:l});if(null!=u.start&&null!=u.end){const t=p.drawnBox;this.recordColumnGeometry(h,d,{slotStart:t.y1,slotEnd:t.y2,levelStart:t.x1,levelEnd:t.x2,horizontal:!0})}return l.axisFlags.isXNumeric||(e+=i),{pathTo:p.pathTo,pathFrom:p.pathFrom,barWidth:g,x:u.start<0&&u.end<0?c:b,goalX:this.barHelpers.getGoalValues("x",n,null,h,d,0),y:e}}recordColumnGeometry(t,e,s){const a=this.w.waterfallData&&this.w.waterfallData.geometry;a&&isFinite(s.slotStart)&&isFinite(s.levelEnd)&&(a[t]||(a[t]=[]),a[t][e]=s)}getRangeValue(t,e){const s=this.w;return{start:s.rangeData.seriesRangeStart[t][e],end:s.rangeData.seriesRangeEnd[t][e]}}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>d.default});
|
|
5
|
+
"use strict";var t=Object.defineProperty,e=Object.defineProperties,s=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,o=(e,s,a)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[s]=a,n=(t,e)=>{for(var s in e||(e={}))i.call(e,s)&&o(t,s,e[s]);if(a)for(var s of a(e))r.call(e,s)&&o(t,s,e[s]);return t},l=(t,a)=>e(t,s(a));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function h(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const s in t)if("default"!==s){const a=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>t[s]})}return e.default=t,Object.freeze(e)}const d=h(require("apexcharts/core")),c=d.__apex_Utils;function b(t,e){const s=(e.collapsedSeries||[]).concat(e.ancillaryCollapsedSeries||[]);return t.map((t,e)=>{const o=t||{},{hidden:h}=o,d=((t,e)=>{var s={};for(var o in t)i.call(t,o)&&e.indexOf(o)<0&&(s[o]=t[o]);if(null!=t&&a)for(var o of a(t))e.indexOf(o)<0&&r.call(t,o)&&(s[o]=t[o]);return s})(o,["hidden"]);let c=d.data;if(Array.isArray(c)&&!c.length){const t=s.find(t=>t.index===e);t&&Array.isArray(t.data)&&(c=t.data)}return l(n({},d),{data:Array.isArray(c)?c.slice():c})})}function u(t,e,s){const a=s&&void 0!==s[e]?s[e]:e+1;return null==t?{x:a,y:null,rest:{}}:Array.isArray(t)?{x:void 0!==t[0]?t[0]:a,y:t[1],rest:{}}:"object"==typeof t?{x:void 0!==t.x?t.x:a,y:t.y,rest:t}:{x:a,y:t,rest:{}}}const g="__apexcharts_series_transforms__";var p,x;globalThis[g]||(globalThis[g]={}),p="dumbbell","function"==typeof(x=function(t,e){var s;const a=e.config,i=e.globals;if(!Array.isArray(t))return t;i.dumbbellRawSeries||(i.dumbbellRawSeries=b(t,i));const r=i.dumbbellRawSeries;if(r.some(t=>function(t){for(let e=0;e<t.length;e++){const s=t[e],a=Array.isArray(s)?s[1]:s&&"object"==typeof s?s.y:s;if(Array.isArray(a)&&2===a.length)return!0}return!1}(Array.isArray(null==t?void 0:t.data)?t.data:[])))return e.dumbbellData={form:"pairs",names:[],values:[],order:[],carrier:0,hidden:[]},t;const o=null==(s=a.xaxis)?void 0:s.categories,h=function(t){return(t.collapsedSeriesIndices||[]).concat(t.ancillaryCollapsedSeriesIndices||[])}(i),{xs:d,rows:g,byX:p}=function(t,e){var s;const a=[],i=[],r=new Map,o=[];for(let l=0;l<t.length;l++){const h=Array.isArray(null==(s=t[l])?void 0:s.data)?t[l].data:[],d=new Map;for(let t=0;t<h.length;t++){const{x:s,y:o,rest:l}=u(h[t],t,e),b=s instanceof Date?s.getTime():s;r.has(b)||(r.set(b,a.length),a.push(s),i.push(n({},l)));const g=r.get(b);d.set(g,c.parseNumber(o))}o.push(d)}return{xs:a,rows:i,byX:o}}(r,o),x=[],f=[],y=[];for(let t=0;t<r.length;t++)-1===h.indexOf(t)&&y.push(t);const v=[];for(let t=0;t<d.length;t++){const e=[];for(let s=0;s<r.length;s++){const a=p[s].has(t)?p[s].get(t):null;e.push(null!=a&&isFinite(a)?a:null)}x.push(e);let s=null,a=null,i=-1,o=-1;for(let t=0;t<y.length;t++){const r=y[t],n=e[r];null!==n&&((null===s||n<s)&&(s=n,i=r),(null===a||n>a)&&(a=n,o=r))}null!==s&&null!==a?(f.push([i,o]),v.push(l(n({},g[t]),{x:d[t],y:[s,a]}))):(f.push(null),v.push(l(n({},g[t]),{x:d[t],y:null})))}e.dumbbellData={form:"series",names:r.map((t,e)=>{var s;return null!=(s=null==t?void 0:t.name)?s:`Series ${e+1}`}),values:x,order:f,carrier:y.length?y[0]:0,hidden:r.map((t,e)=>e).filter(t=>-1!==h.indexOf(t))};const m=e.dumbbellData.carrier;return r.map((t,e)=>l(n({},t),{data:e===m&&y.length?v:[]}))})?globalThis[g][p]=x:console.warn(`ApexCharts: registerSeriesTransform("${p}") expects a function (series, w) => series.`);const f=d.__apex_Graphics,y=d.__apex_DataLabels,v=(t,e,s,a)=>{if("function"!=typeof t)return t;const i=t({series:e.seriesData.series,seriesIndex:s,dataPointIndex:a,w:e});return Number.isFinite(i)?i:0};class m{constructor(t){this.w=t.w,this.barCtx=t,this.totalFormatter=this.w.config.plotOptions.bar.dataLabels.total.formatter,this.totalFormatter||(this.totalFormatter=this.w.config.dataLabels.formatter)}handleBarDataLabels(t){var e,s,a,i,r,o;const{x:h,y:d,y1:c,y2:b,i:u,j:g,realIndex:p,columnGroupIndex:x,barHeight:y,barWidth:m,barXPosition:C,barYPosition:w,visibleSeries:I,hl:P,noLabel:S}=t,k=this.w,H=new f(this.barCtx.w);this.hlt=null==P?void 0:P.total;const L=k.waterfallData&&k.waterfallData.values,A=P&&null!=P.val?P.val:L&&L[p]&&null!=L[p][g]?L[p][g]:null,D=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[p]:this.barCtx.strokeWidth;let R,W;k.axisFlags.isXNumeric&&!k.globals.isBarHorizontal?(R=h+m*(I+1),W=d+y*(I+1)-D):(R=h+m*I,W=d+y*I);let X=null,F=null,O=h,T=d,j={};const _=k.config.dataLabels,Y=this.barCtx.barOptions.dataLabels,B=this.barCtx.barOptions.dataLabels.total;void 0!==w&&(this.barCtx.isRangeBar||this.barCtx.isPyramid)&&(W=w,T=w),void 0!==C&&this.barCtx.isVerticalGroupedRangeBar&&(R=C,O=C);const z=v(_.offsetX,k,p,g),M=v(_.offsetY,k,p,g),G=(null==P?void 0:P.hide)?void 0:null!==A?A:void 0!==b?[c,b]:"100%"===k.config.chart.stackType?k.globals.seriesPercent[p][g]:k.seriesData.series[p][g];let N,V={width:0,height:0};_.enabled&&(N=void 0===G?"":_.formatter(G,l(n({},k),{seriesIndex:p,dataPointIndex:g,w:k})),V=H.getTextRects(N,parseFloat(_.style.fontSize).toString(),_.style.fontFamily,void 0,!0,_.style.fontWeight));const E={x:null!=(e=null==P?void 0:P.x)?e:h,y:null!=(s=null==P?void 0:P.y)?s:d,neg:P&&null!=P.val?P.val<0:void 0,i:u,j:g,realIndex:p,columnGroupIndex:x,bcx:R,bcy:W,barHeight:null!=(a=null==P?void 0:P.barHeight)?a:y,barWidth:null!=(i=null==P?void 0:P.barWidth)?i:m,textRects:V,strokeWidth:D,dataLabelsX:O,dataLabelsY:T,dataLabelsConfig:_,barDataLabelsConfig:Y,barTotalDataLabelsConfig:B,offX:z,offY:M};if(j=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(E):this.calculateColumnsDataLabelsPosition(E),null!==A&&this.barCtx.isHorizontal&&"center"===Y.position){const t=null==(o=null==(r=k.waterfallData.geometry)?void 0:r[p])?void 0:o[g];t&&t.horizontal&&(j.dataLabelsX=(t.levelStart+t.levelEnd)/2+z)}return X=S?null:this.drawCalculatedDataLabels({x:j.dataLabelsX,y:j.dataLabelsY,neg:E.neg,val:G,text:N,i:p,j:g,barWidth:E.barWidth,barHeight:E.barHeight,textRects:V,dataLabelsConfig:_}),k.config.chart.stacked&&B.enabled&&!1!==this.hlt&&(F=this.drawTotalDataLabels({x:j.totalDataLabelsX,y:j.totalDataLabelsY,barWidth:m,barHeight:y,realIndex:p,j:g,textAnchor:j.totalDataLabelsAnchor,val:this.getStackedTotalDataLabel({realIndex:p,j:g}),rawVal:this.getStackedTotalValue({realIndex:p,j:g}),dataLabelsConfig:_,barTotalDataLabelsConfig:B})),{dataLabelsPos:j,dataLabels:X,totalDataLabels:F}}hasMultipleSeriesGroups(){return this.w.labelData.seriesGroups.length>1}getTotalGroupContext(t){if(!this.hasMultipleSeriesGroups())return null;const e=this.barCtx.barHelpers.getSeriesGroupIndex(t);return e<0?null:{groupIndex:e}}drawsStackedTotal(t){const e=this.barCtx.lastActiveBarSerieIndexByGroup,s=this.getTotalGroupContext(t);return s&&e&&e.length>s.groupIndex?e[s.groupIndex]===t:this.barCtx.lastActiveBarSerieIndex===t}getStackedTotalValue({realIndex:t,j:e}){if(this.hlt)return this.hlt.val;const s=this.w,a=this.xStackTop(t,e);if(a)return a[3];const i=this.getTotalGroupContext(t),r=s.seriesData.stackedSeriesTotalsByGroups;return i&&r&&r[i.groupIndex]?r[i.groupIndex][e]:this.barCtx.stackedSeriesTotals[e]}xStackTop(t,e){var s,a;const i=this.w;return i.axisFlags.isXNumeric&&(null==(a=null==(s=this.barCtx.stacks)?void 0:s[i.labelData.seriesGroupIndex[t]])?void 0:a.tops.get(i.seriesData.seriesX[t][e]))}totalRects(t,e){const s=this.barCtx.barOptions.dataLabels.total.style;return new f(this.w).getTextRects(this.getStackedTotalDataLabel({realIndex:t,j:e}),s.fontSize,s.fontFamily,void 0,!0,s.fontWeight)}getStackedTotalDataLabel({realIndex:t,j:e}){const s=this.w;let a=this.getStackedTotalValue({realIndex:t,j:e});return this.totalFormatter&&(a=this.totalFormatter(a,l(n({},s),{seriesIndex:t,dataPointIndex:e,w:s}))),a}calculateColumnsDataLabelsPosition(t){var e;const s=this.w;let a,i,{j:r,realIndex:o,y:n,bcx:l,barWidth:h,barHeight:d,textRects:c,dataLabelsX:b,dataLabelsY:u,barDataLabelsConfig:g,barTotalDataLabelsConfig:p,strokeWidth:x,offX:f,offY:y}=t;const v=l;d=Math.abs(d);const m="vertical"===s.config.plotOptions.bar.dataLabels.orientation,{zeroEncounters:C}=this.barCtx.barHelpers.getZeroValueEncounters({i:o,j:r});l-=x/2;const w=s.layout.gridWidth/s.globals.dataPoints;if(this.barCtx.isVerticalGroupedRangeBar?b+=h/2:(b=s.axisFlags.isXNumeric?l-h/2+f:l-w+h/2+f,!s.config.chart.stacked&&C>0&&s.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(b-=h*C)),m){const t=2;b=b+c.height/2-x/2-t}const I=null!=(e=t.neg)?e:s.seriesData.series[o][r]<0;let P=n;switch(this.barCtx.isReversed&&(P=n+(I?d:-d)),g.position){case"center":u=m?I?P-d/2+y:P+d/2-y:I?P-d/2+c.height/2+y:P+d/2+c.height/2-y;break;case"bottom":u=m?I?P-d+y:P+d-y:I?P-d+c.height+x+y:P+d-c.height/2+x-y;break;case"top":u=m?I?P+y:P-y:I?P-c.height/2-y:P+c.height+y}let S=P;const k=this.getTotalGroupContext(o),H=this.xStackTop(o,r),L=H?[]:this.barCtx.stacks||[];if(H&&(S=I?Math.max(P,H[5]):Math.min(P,H[4])),L.forEach((t,e)=>{k&&e!==k.groupIndex||t.prevY.forEach(t=>{S=I?Math.max(t[r],S):Math.min(t[r],S)})}),this.hlt&&(S=this.hlt.edge),this.drawsStackedTotal(o)&&p.enabled){const t=this.totalRects(o,r).height;a=I?S+.77*t-y-p.offsetY:S-.3*t+y+p.offsetY;const e=w;i=v+(s.axisFlags.isXNumeric?-h/2:h/2-e)+p.offsetX}return s.config.chart.stacked||(u<0?u=0+x:u+c.height/3>s.layout.gridHeight&&(u=s.layout.gridHeight-x)),{bcx:l,bcy:n,dataLabelsX:b,dataLabelsY:u,totalDataLabelsX:i,totalDataLabelsY:a,totalDataLabelsAnchor:"middle"}}calculateBarsDataLabelsPosition(t){var e,s;const a=this.w;let{x:i,j:r,realIndex:o,bcy:n,barHeight:l,barWidth:h,textRects:d,dataLabelsX:c,strokeWidth:b,dataLabelsConfig:u,barDataLabelsConfig:g,barTotalDataLabelsConfig:p,offX:x,offY:f}=t;const y=a.layout.gridHeight/a.globals.dataPoints,{zeroEncounters:v}=this.barCtx.barHelpers.getZeroValueEncounters({i:o,j:r});let m,C,w;if(h=Math.abs(h),this.barCtx.isPyramid){m=n+l/2+f-(null!=(e=d.centerOffset)?e:0)}else m=n-(this.barCtx.isRangeBar?0:y)+l/2+d.height/2+f-3;!a.config.chart.stacked&&v>0&&a.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(m-=l*v);let I="start";const P=null!=(s=t.neg)?s:a.seriesData.series[o][r]<0;let S=i;if(this.barCtx.isReversed&&(S=i+(P?-h:h),I=P?"start":"end"),this.barCtx.isPyramid)c=a.layout.gridWidth/2+x;else switch(g.position){case"center":c=P?S+h/2-x:Math.max(d.width/2,S-h/2)+x;break;case"bottom":c=P?S+h-b-x:S-h+b+x;break;case"top":c=P?S-b-x:S-b+x}let k=S;const H=this.getTotalGroupContext(o),L=this.xStackTop(o,r),A=L?[]:this.barCtx.stacks||[];if(L&&(k=P?Math.min(S,L[4]):Math.max(S,L[5])),A.forEach((t,e)=>{H&&e!==H.groupIndex||t.prevX.forEach(t=>{k=P?Math.min(t[r],k):Math.max(t[r],k)})}),this.hlt&&(k=this.hlt.edge),this.drawsStackedTotal(o)&&p.enabled){const t=this.totalRects(o,r);P?(C=k-b-x-p.offsetX,I="end"):C=k+x+p.offsetX+(this.barCtx.isReversed?-(h+b):b),w=m-d.height/2+t.height/2+p.offsetY+b,a.globals.barGroups.length>1&&!H&&(w-=a.globals.barGroups.length/2*(l/2))}if(!a.config.chart.stacked){const t=P&&"middle"!==u.textAnchor?"start"===u.textAnchor?"end":"start":u.textAnchor;let e;e="vertical"===g.orientation?d.height/2:"end"===t?d.width:"middle"===t?d.width/2:0;const s=("vertical"===g.orientation?d.height:d.width)-e;c+s>a.layout.gridWidth-b&&(c=a.layout.gridWidth-s-b),c-e<b&&(c=e+b)}return{bcx:i,bcy:n,dataLabelsX:c,dataLabelsY:m,totalDataLabelsX:C,totalDataLabelsY:w,totalDataLabelsAnchor:I}}drawCalculatedDataLabels({x:t,y:e,val:s,text:a,neg:i,i:r,j:o,textRects:h,barHeight:d,barWidth:c,dataLabelsConfig:b}){var u,g,p;const x=this.w;let v="rotate(0)";"vertical"===x.config.plotOptions.bar.dataLabels.orientation&&(v=`rotate(-90, ${t}, ${e})`);const m=new y(this.barCtx.w,this.barCtx.ctx),C=new f(this.barCtx.w),w=b.formatter;let I=null;const P=x.globals.collapsedSeriesIndices.indexOf(r)>-1,S=(x.globals.collapsingSeriesIndices||[]).indexOf(r)>-1,k=`${r}::${this.barCtx._keys(r)[o]}`;if(S){const t=null==(u=x.globals.prevDataLabels)?void 0:u.get(k);t&&isFinite(t.val)&&(s=t.val,a=void 0)}if(b.enabled&&(!P||S)){I=C.group({class:"apexcharts-data-labels",transform:v});const u=x.config.dataLabels;((null==(g=u.animate)?void 0:g.enabled)||(null==(p=u.countUp)?void 0:p.enabled))&&(I.node.setAttribute("data:dlKey",k),I.node.setAttribute("data:dlJ",String(o)),"number"==typeof s&&isFinite(s)&&I.node.setAttribute("data:dlVal",String(s))),void 0===s?a="":void 0===a&&(a=w(s,l(n({},x),{seriesIndex:r,dataPointIndex:o,w:x}))),!s&&x.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(a="");let f=b.textAnchor;"vertical"===x.config.plotOptions.bar.dataLabels.orientation&&(f="center"===x.config.plotOptions.bar.dataLabels.position?"middle":(null!=i?i:x.seriesData.series[r][o]<0)?"end":"start"),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&c<h.width&&(a=""),x.config.chart.stacked&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&!S&&(this.barCtx.isHorizontal?h.width/1.6>Math.abs(c)&&(a=""):h.height/1.6>Math.abs(d)&&(a=""));const y=l(n({},b),{textAnchor:f});this.barCtx.isHorizontal&&s<0&&("start"===f?y.textAnchor="end":"end"===f&&(y.textAnchor="start")),m.plotDataLabelsText({x:t,y:e,text:a,i:r,j:o,parent:I,dataLabelsConfig:y,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return I}drawTotalDataLabels({x:t,y:e,val:s,rawVal:a,realIndex:i,j:r,textAnchor:o,barTotalDataLabelsConfig:n}){var l,h;const d=new f(this.barCtx.w);let c;if(n.enabled&&void 0!==t&&void 0!==e&&this.drawsStackedTotal(i)){c=d.drawText({x:t,y:e,foreColor:n.style.color,text:s,textAnchor:o,fontFamily:n.style.fontFamily,fontSize:n.style.fontSize,fontWeight:n.style.fontWeight}),c.attr({class:"apexcharts-datalabel-total",cx:t,cy:e});const b=this.w.config.dataLabels;if((null==(l=b.animate)?void 0:l.enabled)||(null==(h=b.countUp)?void 0:h.enabled)){const{groupIndex:t}=this.barCtx.barHelpers.getGroupIndex(i);c.node.setAttribute("data:dlTotalKey",`${t}::${this.barCtx._keys(i)[r]}`),c.node.setAttribute("data:dlTotalSeries",String(i)),"number"==typeof a&&isFinite(a)&&c.node.setAttribute("data:dlTotalVal",String(a))}}return c}}const C=d.__apex_Series,w=d.__apex_Fill,I=d.__apex_CoreUtils;function P(t){var e,s,a,i,r,o,n;return"histogram"===(null==(s=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:s.requestedType)&&(!1!==(null==(i=null==(a=t.config.plotOptions)?void 0:a.histogram)?void 0:i.overlap)&&(null!=(n=null==(o=null==(r=t.seriesData)?void 0:r.series)?void 0:o.length)?n:0)>1)}class S{constructor(t){this.w=t.w,this.barCtx=t}initVariables(t,e){const s=this.w;this.seriesIndex=e,this.barCtx.series=t,this.barCtx.totalItems=0,this.barCtx.seriesLen=0,this.barCtx.visibleI=-1,this.barCtx.visibleItems=1;for(let e=0;e<t.length;e++)if(t[e].length>0&&(this.barCtx.seriesLen=this.barCtx.seriesLen+1,this.barCtx.totalItems+=t[e].length),s.axisFlags.isXNumeric)for(let a=0;a<t[e].length;a++)s.seriesData.seriesX[e][a]>s.globals.minX&&s.seriesData.seriesX[e][a]<s.globals.maxX&&this.barCtx.visibleItems++;else this.barCtx.visibleItems=s.globals.dataPoints;const a=s.labelData.labels;this.rows=s.globals.isBarHorizontal&&s.axisFlags.isXNumeric&&!this.barCtx.isRangeBar&&s.seriesData.seriesX.some(t=>null==t?void 0:t.some((t,e)=>t!==a[e]))?new Map(a.map((t,e)=>[t,e])):null,this.arrBorderRadius=this.createBorderRadiusArr(s.seriesData.series),c.isSafari()&&(this.arrBorderRadius=this.arrBorderRadius.map(t=>t.map(t=>"none"))),0===this.barCtx.seriesLen&&(this.barCtx.seriesLen=1)}barSlotXSpan(){const t=this.w;if(void 0!==this._slotXSpan)return this._slotXSpan;let e=0;if(t.globals.dataPoints<=1){const s=t.globals.maxX-t.globals.minX;e=s>0?s/4:0}else if(e=this._unionMinXGap(),!(e>0&&isFinite(e))){const s=t.globals.minXDiff;e=s>0&&isFinite(s)&&.5!==s?s:0}return this._slotXSpan=e,e}_unionMinXGap(){const t=this.w.seriesData.seriesX||[],e=this.seriesIndex,s=[];for(let a=0;a<t.length;a++){const i=t[a];e&&e.indexOf(a)<0||Array.isArray(i)&&i.length>0&&s.push(i.some((t,e)=>t<i[e-1])?i.filter(t=>t===+t).sort((t,e)=>t-e):i)}if(!s.length)return 0;const a=new Array(s.length).fill(0);let i=NaN,r=1/0;for(;;){let t=1/0,e=-1;for(let i=0;i<s.length;i++){const r=s[i];for(;a[i]<r.length&&"number"!=typeof r[a[i]];)a[i]++;if(a[i]>=r.length)continue;const o=r[a[i]];o==o?o<t&&(t=o,e=i):(a[i]++,i--)}if(-1===e)break;if(a[e]++,i==i){const e=t-i;e>0&&e<r&&(r=e)}i=t}return isFinite(r)?r:0}barRow(t,e){var s,a,i;return null!=(i=null==(a=this.rows)?void 0:a.get(null==(s=this.w.seriesData.seriesX[t])?void 0:s[e]))?i:e}initialPositions(t){const e=this.w;let s,a,i,r,o,n,l,h,d=e.globals.dataPoints;this.barCtx.isRangeBar&&(d=e.labelData.labels.length);let b=this.barCtx.seriesLen;if((e.config.plotOptions.bar.rangeBarGroupRows||P(e))&&(b=1),this.barCtx.isHorizontal)i=e.layout.gridHeight/d,o=i/b,o=o*parseInt(this.barCtx.barOptions.barHeight,10)/100,-1===String(this.barCtx.barOptions.barHeight).indexOf("%")&&(o=parseInt(this.barCtx.barOptions.barHeight,10)),h=this.barCtx.baseLineInvertedY+e.globals.padHorizontal+(this.barCtx.isReversed?e.layout.gridWidth:0)-(this.barCtx.isReversed?2*this.barCtx.baseLineInvertedY:0),this.barCtx.isFunnel&&(h=e.layout.gridWidth/2),a=(i-o*this.barCtx.seriesLen)/2;else{if(r=e.layout.gridWidth/this.barCtx.visibleItems,e.config.xaxis.convertedCatToNumeric&&(r=e.layout.gridWidth/e.globals.dataPoints),n=r/b*parseInt(this.barCtx.barOptions.columnWidth,10)/100,e.axisFlags.isXNumeric){const t=this.barCtx.xRatio,e=this.barSlotXSpan();e>0&&e/t>0&&(r=e/t),n=r/b*parseInt(this.barCtx.barOptions.columnWidth,10)/100,n<1&&(n=1)}if(-1===String(this.barCtx.barOptions.columnWidth).indexOf("%")&&(n=parseInt(this.barCtx.barOptions.columnWidth,10)),l=e.layout.gridHeight-this.barCtx.baseLineY[this.barCtx.translationsIndex]-(this.barCtx.isReversed?e.layout.gridHeight:0)+(this.barCtx.isReversed?2*this.barCtx.baseLineY[this.barCtx.translationsIndex]:0),e.axisFlags.isXNumeric){s=this.barCtx.getBarXForNumericXAxis({x:s,j:0,realIndex:t,barWidth:n}).x}else s=e.globals.padHorizontal+c.noExponents(r-n*this.barCtx.seriesLen)/2}return e.globals.barHeight=o,e.globals.barWidth=n,{x:s,y:a,yDivision:i,xDivision:r,barHeight:o,barWidth:n,zeroH:l,zeroW:h}}initializeStackedPrevVars(t){t.stacks=t.w.labelData.seriesGroups.map(()=>({prevY:[],prevX:[],prevYF:[],prevXF:[],prevYVal:[],prevXVal:[],tops:new Map}))}initializeStackedXYVars(t){t.stacks.forEach(t=>{t.xArrj=[],t.xArrjF=[],t.xArrjVal=[],t.yArrj=[],t.yArrjF=[],t.yArrjVal=[]})}getPathFillColor(t,e,s,a){var i;const r=this.w,o=new w(this.barCtx.w);let n=null;const l=this.barCtx.barOptions.distributed?s:e;let h=!1;if(this.barCtx.barOptions.colors.ranges.length>0){this.barCtx.barOptions.colors.ranges.map(a=>{t[e][s]>=a.from&&t[e][s]<=a.to&&(n=a.color,h=!0)})}const d=this.getDumbbellConnectorFill(e,s)||(null==(i=r.config.series[a].data[s])?void 0:i.fill),c=this.barCtx.barOptions.isDumbbell?r.config.plotOptions.bar.dumbbell.connector:null;let b;c&&c.color&&(n=c.color,b=c.opacity);return{color:o.fillPath({seriesNumber:this.barCtx.barOptions.distributed?l:a,dataPointIndex:s,color:n,opacity:b,value:t[e][s],fillConfig:d,fillType:(null==d?void 0:d.type)?d.type:Array.isArray(r.config.fill.type)?r.config.fill.type[a]:r.config.fill.type}),useRangeColor:h}}getDumbbellConnectorFill(t,e){const s=this.w;if(!this.barCtx.barOptions.isDumbbell)return null;const a=s.dumbbellData;if(!a||"series"!==a.form)return null;const i=s.config.plotOptions.bar.dumbbell.connector;if(i.color)return null;const r=a.order[e];if(!r)return null;const o=s.globals.colors[r[0]],n=s.globals.colors[r[1]];return o&&n?{type:"gradient",gradient:{type:this.barCtx.isHorizontal?"horizontal":"vertical",gradientFrom:o,gradientTo:n,opacityFrom:i.opacity,opacityTo:i.opacity,stops:[0,100],inverseColors:!this.barCtx.isHorizontal}}:null}getStrokeWidth(t,e,s){let a=0;const i=this.w;return void 0===this.barCtx.series[t][e]||null===this.barCtx.series[t][e]||"bar"===i.config.chart.type&&!this.barCtx.series[t][e]?this.barCtx.isNullValue=!0:this.barCtx.isNullValue=!1,i.config.stroke.show&&(this.barCtx.isNullValue||(a=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[s]:this.barCtx.strokeWidth)),a}getStackedSeriesIndices(t){const e=this.w,s=e.labelData.seriesGroups,a=e.globals.columnSeries?new Set(e.globals.columnSeries.i):null,i=t=>!a||a.has(t);if(!s||s.length<2){const e=Array.from({length:t},(t,e)=>e).filter(i);return e.length?[e]:[]}const r=Array.from({length:s.length},()=>[]),o=[];for(let e=0;e<t;e++){if(!i(e))continue;const t=this.getSeriesGroupIndex(e);t>-1?r[t].push(e):o.push(e)}return o.length&&r.push(o),r.filter(t=>t.length>0)}createBorderRadiusArr(t){const e=this.w,s=!this.w.config.chart.stacked||e.config.plotOptions.bar.borderRadius<=0,a=t.length,i=Math.max(0,...t.map(t=>0|(null==t?void 0:t.length))),r=Array.from({length:a},()=>Array(i).fill(s?"top":"none"));if(s)return r;const o="last"===e.config.plotOptions.bar.borderRadiusWhenStacked,n=o?"top":"both",l=o?"bottom":"both",h=o?"none":"bottom",d=o?"none":"top";for(const e of this.getStackedSeriesIndices(a))for(let s=0;s<i;s++){const a=[],i=[];for(const r of e){const e=t[r][s];e>0?a.push(r):e<0&&i.push(r)}if(a.length>0&&0===i.length)if(1===a.length)r[a[0]][s]=n;else{const t=a[0],e=a[a.length-1];for(const i of a)r[i][s]=i===t?h:i===e?"top":"none"}else if(i.length>0&&0===a.length)if(1===i.length)r[i[0]][s]=l;else{const t=Math.min(...i),e=Math.max(...i);for(const a of i)r[a][s]=a===t?d:a===e?"bottom":"none"}else if(a.length>0&&i.length>0){const t=a[a.length-1];for(const e of a)r[e][s]=e===t?"top":"none";const e=Math.max(...i);for(const t of i)r[t][s]=t===e?"bottom":"none"}}return r}barBackground({j:t,i:e,x1:s,x2:a,y1:i,y2:r,elSeries:o}){const n=this.w,l=new f(this.barCtx.w),h=new C(this.barCtx.w).getActiveConfigSeriesIndex();if(this.barCtx.barOptions.colors.backgroundBarColors.length>0&&h===e){t>=this.barCtx.barOptions.colors.backgroundBarColors.length&&(t%=this.barCtx.barOptions.colors.backgroundBarColors.length);const e=this.barCtx.barOptions.colors.backgroundBarColors[t],h=l.drawRect(void 0!==s?s:0,void 0!==i?i:0,void 0!==a?a:n.layout.gridWidth,void 0!==r?r:n.layout.gridHeight,this.barCtx.barOptions.colors.backgroundBarRadius,e,this.barCtx.barOptions.colors.backgroundBarOpacity);o.add(h),h.node.classList.add("apexcharts-backgroundBar")}}barRect({a:t,len:e,v1:s,v2:a,strokeWidth:i,realIndex:r,j:o,dir:n,horizontal:l}){const h=this.w,d=new f(h);(i=Array.isArray(i)?i[r]:i)||(i=0);const c=h.config.series[r].data[o],b=l?null==c?void 0:c.barHeightOffset:null==c?void 0:c.columnWidthOffset;b&&(t-=b/2,e+=b);const u=i/2,g=n*(this.barCtx.isReversed?-1:1),p="around"===h.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[r][o]?" Z":" z";let x,y,v,m,C,w;l?(v=t+u,m=t+e-u,x=s+.001+u*g,y=a+.001-u*g,C=d.line(x,m),w=d.move(x,v)+d.line(y,v)+d.line(y,m)+C+p):(x=t+u,y=t+e-u,v=s+.001-u*g,m=a+.001+u*g,C=d.line(y,v),w=d.move(x,v)+d.line(x,m)+d.line(y,m)+C+p);return{x1:x,x2:y,y1:v,y2:m,sl:C,closing:p,squarePathTo:w,pathTo:"none"!==this.arrBorderRadius[r][o]?d.roundPathCorners(w,h.config.plotOptions.bar.borderRadius):w,base:d.move(x,v)+d.line(x,v)+C+C+C+C+C+d.line(x,v)+p,strokeWidth:i,strokeCenter:u,direction:g}}getColumnPaths({barWidth:t,barXPosition:e,y1:s,y2:a,strokeWidth:i,series:r,realIndex:o,i:n,j:l,w:h}){var d,c,b;const u=this.barRect({a:e,len:t,v1:s,v2:a,strokeWidth:i,realIndex:o,j:l,dir:r[n][l]>=0?1:-1}),{pathTo:g,squarePathTo:p,strokeCenter:x,direction:f}=u;s=u.y1,a=u.y2;let y=null;const v=null==(c=null==(d=this.barCtx.ctx)?void 0:d.morphTypeChange)?void 0:c.getInitialPathFor(o,l);if(v?y=v:h.globals.previousPaths.length>0&&(y=this.barCtx.getPreviousPath(o,l,g,p)),null==y&&(y=u.base),h.config.chart.stacked){const t=this.barCtx.groupCtx;t.yArrj.push(a-x*f),t.yArrjF.push(Math.abs(s-a+u.strokeWidth*f)),t.yArrjVal.push(null!=(b=this.barCtx.series[n][l])?b:null)}return{pathTo:g,pathFrom:y,drawnBox:{x1:u.x1,x2:u.x2,y1:s,y2:a}}}getFunnelTrapezoidPaths({barYPosition:t,barHeight:e,series:s,i:a,j:i,realIndex:r,strokeWidth:o,w:n}){var l,h;const d=new f(this.barCtx.w),c=n.layout.gridWidth/2,b=t=>Math.abs(t/this.barCtx.invertedYRatio)/2,u=b(s[a][i]),g=i===s[a].length-1,p="taper"===n.config.plotOptions.funnel.lastShape?"taper":"flat";let x;x=g?"taper"===p?0:u:b(s[a][i+1]);const y=o/2,v=t+y,m=t+e-y,C=c-u,w=c+u,I=c-x,P=c+x,S=d.move(C,v)+d.line(w,v)+d.line(P,m)+d.line(I,m)+" Z";let k=null;const H=null==(h=null==(l=this.barCtx.ctx)?void 0:l.morphTypeChange)?void 0:h.getInitialPathFor(r,i);return H?k=H:n.globals.previousPaths.length>0&&(k=this.barCtx.getPreviousPath(r,i,S)),null==k&&(k=d.move(c,v)+d.line(c,v)+d.line(c,m)+d.line(c,m)+" Z"),{pathTo:S,pathFrom:k,x:w,x1:C,barXPosition:c}}computePyramidLayout(t){const e=this.w,s=e.layout.gridHeight,a=e.layout.gridWidth,i=t.map(t=>Math.abs(Number(t)||0)),r=i.reduce((t,e)=>t+e,0);if(0===r||s<=0)return i.map(()=>({y:0,height:0,topHalf:0,bottomHalf:0}));const o=a/2;let n=0;const l=[];for(let t=0;t<i.length;t++){const e=n/r;n+=i[t];const a=n/r,h=e*s,d=a*s;l.push({y:h,height:d-h,topHalf:e*o,bottomHalf:a*o})}return l}getPyramidPaths({barYPosition:t,barHeight:e,topHalf:s,bottomHalf:a,realIndex:i,j:r,strokeWidth:o,w:n}){var l,h;const d=new f(this.barCtx.w),c=n.layout.gridWidth/2,b=o/2,u=t+b,g=t+e-b,p=c-s,x=c+s,y=c-a,v=c+a,m=d.move(p,u)+d.line(x,u)+d.line(v,g)+d.line(y,g)+" Z";let C=null;const w=null==(h=null==(l=this.barCtx.ctx)?void 0:l.morphTypeChange)?void 0:h.getInitialPathFor(i,r);return w?C=w:n.globals.previousPaths.length>0&&(C=this.barCtx.getPreviousPath(i,r,m)),null==C&&(C=d.move(c,u)+d.line(c,u)+d.line(c,g)+d.line(c,g)+" Z"),{pathTo:m,pathFrom:C,x:x,x1:p,barXPosition:c}}getBarpaths({barYPosition:t,barHeight:e,x1:s,x2:a,strokeWidth:i,series:r,realIndex:o,i:n,j:l,w:h}){var d,c,b;const u=new f(this.barCtx.w),g=this.barRect({a:t,len:e,v1:s,v2:a,strokeWidth:i,realIndex:o,j:l,dir:r[n][l]>=0?1:-1,horizontal:!0}),{y1:p,y2:x,sl:y,closing:v,squarePathTo:m,pathTo:C,strokeCenter:w,direction:I}=g;s=g.x1,a=g.x2;const P=this.barCtx.isFunnel,S=P?(s+a)/2:s;let k=null;const H=null==(c=null==(d=this.barCtx.ctx)?void 0:d.morphTypeChange)?void 0:c.getInitialPathFor(o,l);if(H?k=H:h.globals.previousPaths.length>0&&(k=this.barCtx.getPreviousPath(o,l,C,m)),null==k){const t=P?u.line(S,x):y;k=u.move(S,p)+u.line(S,p)+t+t+t+t+t+u.line(S,p)+v}if(h.config.chart.stacked){const t=this.barCtx.groupCtx;t.xArrj.push(a+w*I),t.xArrjF.push(Math.abs(s-a-g.strokeWidth*I)),t.xArrjVal.push(null!=(b=this.barCtx.series[n][l])?b:null)}return{pathTo:C,pathFrom:k,drawnBox:{x1:s,x2:a,y1:p,y2:x}}}getXForValue(t,e,s=!0){let a=s?e:null;return null!=t&&(a=e+t/this.barCtx.invertedYRatio-2*(this.barCtx.isReversed?t/this.barCtx.invertedYRatio:0)),a}getYForValue(t,e,s,a=!0){let i=a?e:null;return null!=t&&(i=e-t/this.barCtx.yRatio[s]+2*(this.barCtx.isReversed?t/this.barCtx.yRatio[s]:0)),i}getGoalValues(t,e,s,a,i,r){const o=this.w,h=[],d=(i,n)=>{o.globals.invalidLogScale||(i=new I(o).getLogValAtSeriesIndex(i,a)),h.push({[t]:"x"===t?this.getXForValue(i,e,!1):this.getYForValue(i,s,r,!1),attrs:n})};if(o.seriesData.seriesGoals[a]&&o.seriesData.seriesGoals[a][i]&&Array.isArray(o.seriesData.seriesGoals[a][i])&&o.seriesData.seriesGoals[a][i].forEach(t=>{d(t.value,t)}),this.barCtx.barOptions.isDumbbell){const e=this.getDumbbellEnds(a,i);if(e.length){const s={strokeHeight:"x"===t?0:o.globals.markers.size[a],strokeWidth:"x"===t?o.globals.markers.size[a]:0,strokeDashArray:0,strokeLineCap:"round"};let r=0,h=0;for(let t=1;t<e.length;t++)e[t].value<e[r].value&&(r=t),e[t].value>e[h].value&&(h=t);const c=o.config.plotOptions.bar.dumbbell.dataLabels;e.forEach((t,e)=>{const o=l(n({},s),{strokeColor:t.color});!c.enabled||e!==r&&e!==h||(o.label={text:this.getDumbbellLabelText(t.value,a,i,t.index),color:c.colorFromMarker?t.color:Array.isArray(c.style.colors)?c.style.colors[t.index]||c.style.colors[0]:c.style.colors,outward:e===r&&r!==h?-1:1}),d(t.value,o)})}}return h}getDumbbellEnds(t,e){const s=this.w,a=[],i=s.dumbbellData;if(i&&"series"===i.form){const t=i.values[e]||[];for(let e=0;e<t.length;e++){const r=t[e];null!==r&&-1===i.hidden.indexOf(e)&&a.push({value:r,color:s.globals.colors[e],index:e})}return a}if(!s.rangeData.seriesRange.length)return a;const r=this.barCtx.barOptions.dumbbellColors?this.barCtx.barOptions.dumbbellColors:s.globals.colors,o=e=>Array.isArray(r[t])?r[t][e]:r[t];return[{value:s.rangeData.seriesRangeStart[t][e],color:o(0),index:0},{value:s.rangeData.seriesRangeEnd[t][e],color:o(1),index:1}]}getDumbbellLabelText(t,e,s,a){const i=this.w,r=i.config.plotOptions.bar.dumbbell.dataLabels;if("function"==typeof r.formatter)return r.formatter(t,{seriesIndex:e,dataPointIndex:s,endpointIndex:a,w:i});const o=this.barCtx.isHorizontal?i.formatters.xLabelFormatter:i.formatters.yLabelFormatters[0];return"function"==typeof o?o(t,s,i):String(t)}drawGoalLine({barXPosition:t,barYPosition:e,goalX:s,goalY:a,barWidth:i,barHeight:r}){if(!(Array.isArray(s)&&s.length>0||Array.isArray(a)&&a.length>0))return null;const o=new f(this.barCtx.w),n=o.group({class:"apexcharts-bar-goals-groups"});n.node.classList.add("apexcharts-element-hidden"),this.barCtx.w.globals.delayedElements.push({el:n.node}),n.attr("clip-path",`url(#gridRectMarkerMask${this.barCtx.w.globals.cuid})`);let l=null;return this.barCtx.isHorizontal?Array.isArray(s)&&s.forEach(t=>{if(t.x>=-1&&t.x<=o.w.layout.gridWidth+1){const s=void 0!==t.attrs.strokeHeight?t.attrs.strokeHeight:r/2,a=e+s+r/2;l=o.drawLine(t.x,a-2*s,t.x,a,t.attrs.strokeColor?t.attrs.strokeColor:void 0,t.attrs.strokeDashArray,t.attrs.strokeWidth?t.attrs.strokeWidth:2,t.attrs.strokeLineCap),n.add(l),t.attrs.label&&n.add(this.drawDumbbellLabel(t.attrs,{x:t.x,y:a-s,horizontal:!0,markerSize:t.attrs.strokeWidth||0}))}}):Array.isArray(a)&&a.forEach(e=>{if(e.y>=-1&&e.y<=o.w.layout.gridHeight+1){const s=void 0!==e.attrs.strokeWidth?e.attrs.strokeWidth:i/2,a=t+s+i/2;l=o.drawLine(a-2*s,e.y,a,e.y,e.attrs.strokeColor?e.attrs.strokeColor:void 0,e.attrs.strokeDashArray,e.attrs.strokeHeight?e.attrs.strokeHeight:2,e.attrs.strokeLineCap),n.add(l),e.attrs.label&&n.add(this.drawDumbbellLabel(e.attrs,{x:a-s,y:e.y,horizontal:!1,markerSize:e.attrs.strokeHeight||0}))}}),n}drawDumbbellLabel(t,e){const s=this.w,a=new f(s),i=s.config.plotOptions.bar.dumbbell.dataLabels,r=e.markerSize/2+i.offset,o=t.label.outward;return a.drawText({x:e.x+(e.horizontal?r*o:0),y:e.y-(e.horizontal?0:r*o),text:t.label.text,textAnchor:e.horizontal?o<0?"end":"start":"middle",dominantBaseline:e.horizontal?"central":o<0?"hanging":"auto",foreColor:t.label.color,fontSize:i.style.fontSize,fontFamily:i.style.fontFamily,fontWeight:i.style.fontWeight,cssClass:"apexcharts-dumbbell-label"})}drawBarShadow({prevPaths:t,currPaths:e,color:s,realIndex:a,j:i}){const r=this.w,{x:o,x1:n,barYPosition:l}=t,{x:h,x1:d,barYPosition:b}=e,u=l+e.barHeight,g=new f(this.barCtx.w),p=new c,x=g.move(n,u)+g.line(o,u)+g.line(h,b)+g.line(d,b)+g.line(n,u)+("around"===r.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[a][i]?" Z":" z");return g.drawPath({d:x,fill:p.shadeColor(.5,c.rgb2hex(s)),stroke:"none",strokeWidth:0,fillOpacity:1,classes:"apexcharts-bar-shadow apexcharts-decoration-element"})}getZeroValueEncounters({i:t,j:e}){var s;const a=this.w;let i=0,r=0;return(a.config.plotOptions.bar.horizontal?a.seriesData.series.map((t,e)=>e):(null==(s=a.globals.columnSeries)?void 0:s.i.map(t=>t))||[]).forEach(s=>{const o=a.seriesData.series[s][e];o&&i++,s<t&&!o&&r++}),{nonZeroColumns:i,zeroEncounters:r}}getSeriesGroupIndex(t){var e;return null!=(e=this.w.labelData.seriesGroupIndex[t])?e:-1}getGroupIndex(t){const e=this.getSeriesGroupIndex(t),s=this.barCtx.columnGroupIndices;let a=s.indexOf(e);return a<0&&(s.push(e),a=s.length-1),{groupIndex:e,columnGroupIndex:a}}}const k=d.__apex_Filters,H=d.__apex_Animations,L=d.__apex_Animations_computeStagger,A=d.__apex_BrowserAPIs_BrowserAPIs,D=d.__apex_Environment_Environment;function R(t){var e;const s=t.config.chart.animations;if(!s||!1===s.enabled)return!1;if(!s.dynamicAnimation||!1===s.dynamicAnimation.enabled)return!1;const a=null!=(e=s.largeDatasetThreshold)?e:0;return!(a>0&&t.globals.dataPoints>a)&&!!(D.isBrowser()&&t.globals.dataChanged&&t.globals.shouldAnimate)}function W(t){const e=new Map;return t.map(t=>{const s=e.get(t)||0;return e.set(t,s+1),0===s?t:`${t}#${s}`})}function X(t,e,s=0|(s=>null==(s=t.seriesData.series[e])?void 0:s.length)()){return W(Array.from({length:s},(s,a)=>function(t,e,s){var a,i,r,o;if(null==(a=t.axisFlags)?void 0:a.isXNumeric){const a=null==(r=null==(i=t.seriesData)?void 0:i.seriesX)?void 0:r[e];if(a&&a.length&&null!=a[s])return"x:"+a[s]}const n=null==(o=t.globals.labels)?void 0:o[s];return null!=n&&""!==String(n)?"c:"+(Array.isArray(n)?n.join(" "):String(n)):"j:"+s}(t,e,a)))}function F(t,e,s=!1,a=!1){var i,r;if(!R(t))return null;const o=t.globals.prevStreamFrame;if(!o)return null;const n=null==(i=o.seriesY)?void 0:i[e],l=null==(r=t.seriesData.series)?void 0:r[e];if(!Array.isArray(n)||!Array.isArray(l))return null;if(!n.length||!l.length)return null;const h=W(n.map((t,s)=>function(t,e,s){var a,i;if(t.isXNumeric){const i=null==(a=t.seriesX)?void 0:a[e];if(i&&i.length&&null!=i[s])return"x:"+i[s]}const r=null==(i=t.labels)?void 0:i[s];return null!=r&&""!==String(r)?"c:"+(Array.isArray(r)?r.join(" "):String(r)):"j:"+s}(o,e,s))),d=X(t,e),c=function(t,e){const s=new Map;t.forEach((t,e)=>{s.has(t)||s.set(t,e)});const a=new Array(e.length),i=new Set;let r=-1,o=!0,n=t.length===e.length;e.forEach((t,e)=>{const l=s.has(t)&&!i.has(s.get(t))?s.get(t):-1;a[e]=l,-1!==l&&(i.add(l),l<r&&(o=!1),r=l),l!==e&&(n=!1)});const l=[];for(let e=0;e<t.length;e++)i.has(e)||l.push(e);return{toOld:a,exits:l,ordered:o,changed:!n}}(h,d);return(c.ordered||a)&&(c.changed||s)?{join:c,oldKeys:h,newKeys:d}:null}function O({w:t,elSeries:e,record:s,newKeys:a,isHorizontal:i,speed:r}){var o;if(!R(t))return;if(!s||!Array.isArray(s.paths)||!(null==e?void 0:e.node))return;const n=new Set(a),l=s.paths.filter(t=>t&&t.d&&null!=t.key&&!n.has(t.key));if(!l.length)return;const h=new f(t),d=null==(o=t.globals.colors)?void 0:o[parseInt(String(s.realIndex),10)];l.forEach(a=>{let o=a.fill||d||"#c8c8c8";0===String(o).indexOf("url(")&&(o=d||"#c8c8c8");const n=h.drawPath({d:a.d,stroke:"none",strokeWidth:0,fill:o,fillOpacity:1,classes:"apexcharts-bar-ghost"}),l=n.node;l.setAttribute("pointer-events","none"),n.attr("clip-path",`url(#gridRectBarMask${t.globals.cuid})`),e.node.insertBefore(l,e.node.firstChild);const c=function(t){const e=/^M\s*([+-]?[\d.eE]+)[\s,]+([+-]?[\d.eE]+)/.exec(t||"");if(!e)return null;const s=parseFloat(e[1]),a=parseFloat(e[2]);return isFinite(s)&&isFinite(a)?{x:s,y:a}:null}(a.d);let b=i?"left center":"center bottom";try{const t=l.getBBox();c&&t&&(b=i?Math.abs(c.x-t.x)<=Math.abs(c.x-(t.x+t.width))?"left center":"right center":Math.abs(c.y-(t.y+t.height))<=Math.abs(c.y-t.y)?"center bottom":"center top")}catch(t){}const u=l.style;u.transformBox="fill-box",u.transformOrigin=b,l.setAttribute("data:ghostKey",`${s.realIndex}::${a.key}`);try{const t=l.getBBox(),e=i?b.startsWith("left")?t.x:t.x+t.width:b.endsWith("bottom")?t.y+t.height:t.y;isFinite(e)&&l.setAttribute("data:ghostEdge",String(e))}catch(t){}const g=Math.max(1,r||1),p=performance.now(),x=e=>{if(t.globals.isDestroyed||!l.parentNode)return;const s=Math.max(0,Math.min(1,(e-p)/g)),a=1-Math.pow(1-s,3),r=1-a;u.transform=i?`scaleX(${r})`:`scaleY(${r})`,u.opacity=String(1-a),s<1?A.requestAnimationFrame(x):l.parentNode.removeChild(l)};A.requestAnimationFrame(x)})}class T{static xRatio(t){const e=t.layout.gridWidth||1;return(t.globals.maxX-t.globals.minX)/e}static dataXToPx(t,e){return(e-t.globals.minX)/T.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*T.xRatio(t)}static screenXToPlotPx(t,e){const s=t.dom.baseEl,a=s&&s.querySelector(".apexcharts-svg");if(!a)return e-t.layout.translateX;const i=a.getBoundingClientRect(),r=t.globals.svgWidth?i.width/t.globals.svgWidth:1;return(e-i.left)/(r||1)-t.layout.translateX}}class j{constructor(t,e,s){this.ctx=e,this.w=t,this.barOptions=t.config.plotOptions.bar,this.isHorizontal=this.barOptions.horizontal,this.strokeWidth=t.config.stroke.width,this.isNullValue=!1,this.isRangeBar=t.rangeData.seriesRange.length&&this.isHorizontal,this.isVerticalGroupedRangeBar=!t.globals.isBarHorizontal&&t.rangeData.seriesRange.length&&t.config.plotOptions.bar.rangeBarGroupRows,this.isFunnel=this.barOptions.isFunnel,this.isPyramid=this.barOptions.isPyramid,this.pyramidLayout=null,this.xyRatios=s,this.xRatio=0,this.yRatio=[],this.invertedXRatio=0,this.invertedYRatio=0,this.baseLineY=[],this.baseLineInvertedY=0,null!==this.xyRatios&&(this.xRatio=s.xRatio,this.yRatio=s.yRatio,this.invertedXRatio=s.invertedXRatio,this.invertedYRatio=s.invertedYRatio,this.baseLineY=s.baseLineY,this.baseLineInvertedY=s.baseLineInvertedY),this.yaxisIndex=0,this.translationsIndex=0,this.seriesLen=0,this.pathArr=[],this._prevKeyed=null,this._ltCache=null,this._layoutShiftCache=null,this._pathToInterp=null,this.series=[],this.elSeries=null,this.visibleI=0,this.isReversed=!1;const a=new C(this.w);this.lastActiveBarSerieIndex=a.getActiveConfigSeriesIndex("desc",["bar","column"]),this.lastActiveBarSerieIndexByGroup=a.getActiveConfigSeriesIndexByGroup(["bar","column"]),this.columnGroupIndices=[];const i=a.getBarSeriesIndices(),r=new I(this.w);this.stackedSeriesTotals=r.getStackedSeriesTotals(this.w.config.series.map((t,e)=>-1===i.indexOf(e)?e:-1).filter(t=>-1!==t)),this.barHelpers=new S(this)}setSeriesAxis(t){var e;return this.yRatio.length>1&&(this.yaxisIndex=this.w.globals.seriesYAxisReverseMap[t],this.translationsIndex=t),this.isReversed=null==(e=this.w.config.yaxis[this.yaxisIndex])?void 0:e.reversed,this.translationsIndex}draw(t,e){var s,a,i,r,o;const h=this.w,d=new f(this.w),b=new I(this.w);t=b.getLogSeries(t),this.series=t,this.yRatio=b.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t,e);const u=d.group({class:"apexcharts-bar-series apexcharts-plot-series"}),g=this.ctx.highlightFilter;h.config.dataLabels.enabled&&this.totalItems>this.barOptions.dataLabels.maxItems&&console.warn("WARNING: DataLabels are enabled but there are too many to display. This may cause performance issue when rendering - ApexCharts");for(let b=0,p=0;b<t.length;b++,p++){let x,f;const y=[],v=[],m=h.globals.comboCharts?e[b]:b,{columnGroupIndex:w}=this.barHelpers.getGroupIndex(m),I=d.group({class:"apexcharts-series",rel:b+1,seriesName:c.escapeString(h.seriesData.seriesNames[m]),"data:realIndex":m});C.addCollapsedClassToSeries(this.w,I,m),t[b].length>0&&(this.visibleI=this.visibleI+1);const P=this.setSeriesAxis(m);this.isPyramid&&(this.pyramidLayout=this.barHelpers.computePyramidLayout(t[b]));const S=this.barHelpers.initialPositions(m),{y:H,yDivision:L,zeroW:A,x:D,xDivision:R,zeroH:W}=S;let X=S.barHeight,F=S.barWidth;f=H,x=D,this.isHorizontal||v.push(x+(null!=F?F:0)/2);const T=d.group({class:"apexcharts-datalabels","data:realIndex":m}),j=h.config.dataLabels,_=!(null==(s=j.animate)?void 0:s.enabled)&&this.isLengthTransition(m);h.globals.dataChanged&&!_&&!(!(null==(a=j.animate)?void 0:a.enabled)&&!(null==(i=j.countUp)?void 0:i.enabled))||(h.globals.delayedElements.push({el:T.node,holdUntilComplete:_}),T.node.classList.add("apexcharts-element-hidden"));const Y=d.group({class:"apexcharts-bar-goals-markers"}),B=d.group({class:"apexcharts-bar-shadows"}),z=this.ctx,M=z._barShadows,G=z._barShadows=[],N=h.globals.dataChanged&&h.globals.shouldAnimate&&h.config.chart.animations.dynamicAnimation.enabled&&(null==M?void 0:M.length)===t[b].length-1;N||(h.globals.delayedElements.push({el:B.node}),B.node.classList.add("apexcharts-element-hidden"));for(let e=0;e<t[b].length;e++){const s=this.barHelpers.getStrokeWidth(b,e,m);let a=null;const i={indexes:{i:b,j:e,realIndex:m,translationsIndex:P,bc:p},x:x,y:f,strokeWidth:s,elSeries:I};this.isHorizontal?(a=this.drawBarPaths(l(n(n({},i),this.barHelpers.rows&&{y:H+this.barHelpers.barRow(m,e)*L}),{barHeight:X,zeroW:A,yDivision:L})),F=this.series[b][e]/this.invertedYRatio):(a=this.drawColumnPaths(l(n({},i),{xDivision:R,barWidth:F,zeroH:W})),X=this.series[b][e]/this.yRatio[P]);const d=this.barHelpers.getPathFillColor(t,b,e,m);if(this.isFunnel&&!this.isPyramid&&this.barOptions.isFunnel3d&&"trapezoid"!==(null==(r=h.config.plotOptions.funnel)?void 0:r.shape)&&this.pathArr.length&&e>0){const t=this.barHelpers.drawBarShadow({color:"string"==typeof d.color&&-1===(null==(o=d.color)?void 0:o.indexOf("url"))?d.color:c.hexToRgba(h.globals.colors[b]),prevPaths:this.pathArr[this.pathArr.length-1],currPaths:a,realIndex:m,j:e});if(B.add(t),G.push(t),this._shadow=N&&[t,M[e-1].attr("d")],h.config.chart.dropShadow.enabled){new k(this.w).dropShadow(t,h.config.chart.dropShadow,m)}}this.pathArr.push(a);const u=this.barHelpers.drawGoalLine({barXPosition:a.barXPosition,barYPosition:a.barYPosition,goalX:a.goalX,goalY:a.goalY,barHeight:X,barWidth:F});u&&Y.add(u),f=a.y,x=a.x,e>0&&v.push(x+(null!=F?F:0)/2),y.push(f),this.renderSeries(l(n({hl:null==g?void 0:g.bar(this,{i:b,j:e,realIndex:m,translationsIndex:P,paths:a,zeroH:W,zeroW:A}),realIndex:m,pathFill:d.color},d.useRangeColor?{lineFill:d.color}:{}),{j:e,i:b,columnGroupIndex:w,pathFrom:a.pathFrom,pathTo:a.pathTo,strokeWidth:s,elSeries:I,x:x,y:f,series:t,barHeight:Math.abs(a.barHeight?a.barHeight:X),barWidth:Math.abs(a.barWidth?a.barWidth:F),barXPosition:a.barXPosition,elDataLabelsWrap:T,elGoalsMarkers:Y,elBarShadows:B,visibleSeries:this.visibleI,type:"bar"}))}h.globals.seriesXvalues[m]=v,h.globals.seriesYvalues[m]=y,h.globals.previousPaths.length>0&&O({w:h,elSeries:I,record:this._prevRecord(m),newKeys:this._keys(m),isHorizontal:this.isHorizontal,speed:h.config.chart.animations.dynamicAnimation.speed}),u.add(I)}return u}renderSeries({hl:t,realIndex:e,pathFill:s,lineFill:a,j:i,i:r,columnGroupIndex:o,pathFrom:h,pathTo:d,strokeWidth:c,elSeries:b,x:u,y:g,y1:p,y2:x,series:y,barHeight:v,barWidth:C,barXPosition:w,barYPosition:I,elDataLabelsWrap:P,elGoalsMarkers:S,elBarShadows:A,visibleSeries:D,type:R,classes:W,fadeReveal:X=!1,noLabel:F}){var O,T,j,_,Y,B,z;const M=this.w,G=new f(this.w,this.ctx),N=function(t,e){const s=t&&t.renderer;return s&&s.kind&&"svg"!==s.kind?s:e}(this.ctx,G);let V=!1;const E=this._pathToInterp;if(this._pathToInterp=null,b._bindingsDelegated||(b._bindingsDelegated=!0,G.setupEventDelegation(b,`.apexcharts-${R}-area`)),!a){let t=function(t){const e=M.config.stroke.colors;let s;return Array.isArray(e)&&e.length>0&&(s=e[t],s||(s=""),"function"==typeof s)?s({value:M.seriesData.series[t][i],dataPointIndex:i,w:M}):s};const s="function"==typeof M.globals.stroke.colors[e]?t(e):M.globals.stroke.colors[e];a=this.barOptions.distributed?M.globals.stroke.colors[i]:s}const $=M.config.chart.animations,Z=$.animateGradually;let K=0,q=0;if(Z&&!1!==Z.enabled&&!(M.globals.dataChanged&&this.isLayoutShift(e))){const t=M.globals.dataPoints||1,e=Z.delay||0,s=Math.min(e,.5*$.speed/Math.max(1,t));q=L({style:"sequential",index:i,baseDelay:s}),M.config.chart.stacked&&!M.globals.dataChanged&&(q+=r*s*.5);K=q/(e||1)}const U=new m(this).handleBarDataLabels({x:u,y:g,y1:p,y2:x,i:r,j:i,series:y,realIndex:e,columnGroupIndex:o,barHeight:v,barWidth:C,barXPosition:w,barYPosition:I,visibleSeries:D,hl:null==t?void 0:t.label,noLabel:F});if(q>0){const t=M.config.dataLabels;if((null==(O=t.animate)?void 0:O.enabled)||(null==(T=t.countUp)?void 0:T.enabled)){const t=String(Math.round(q));null==(_=null==(j=U.dataLabels)?void 0:j.node)||_.setAttribute("data:dlDelay",t),null==(B=null==(Y=U.totalDataLabels)?void 0:Y.node)||B.setAttribute("data:dlDelay",t)}}let J=!1;if(!M.globals.isBarHorizontal){const t=void 0===w?U.dataLabelsPos.dataLabelsX:w+C/2,s=Math.max(C,M.globals.barPadForNumericAxis);(t+s<0||t-s>M.layout.gridWidth)&&(this._wasOnScreen(e,i)?J=!0:V=!0)}const Q=M.config.series[e].data[i];Q&&Q.strokeColor&&(a=Q.strokeColor);const tt=s;if(this.isNullValue&&-1===M.globals.collapsingSeriesIndices.indexOf(e)&&(s="none"),!V){const o=!0===(null==(z=this.ctx.morphTypeChange)?void 0:z.isActive()),u=o?this.ctx.morphTypeChange.getSpeed():M.config.chart.animations.dynamicAnimation.speed,g=o&&this.ctx.morphTypeChange.claimsTargetMark(e,i);g&&(h=d,K=0);const f=N.renderPaths({i:r,j:i,realIndex:e,pathFrom:h,pathTo:d,stroke:a,strokeWidth:c,strokeLinecap:M.config.stroke.lineCap,fill:s,pathToInterp:E,animationDelay:K,initialSpeed:M.config.chart.animations.speed,dataChangeSpeed:u,className:`apexcharts-${R}-area${W?` ${W}`:""}`,chartType:R,bindEventsOnPaths:!1,fadeReveal:X});f.attr("clip-path",`url(#gridRectBarMask${M.globals.cuid})`),J&&f.node.classList.add("apexcharts-leaving");const y=this._shadow;y&&(this._shadow=null,new H(M,this.ctx).animatePathsGradually({el:y[0],fill:"none",pathFrom:y[1],pathTo:y[0].attr("d"),speed:u,delay:K})),g&&(f.node.setAttribute("opacity","0"),f.node.setAttribute("data-piece-hidden","1"));const m=M.config.forecastDataPoints;m.count>0&&i>=M.globals.dataPoints-m.count&&(f.node.setAttribute("stroke-dasharray",m.dashArray),f.node.setAttribute("stroke-width",m.strokeWidth),f.node.setAttribute("fill-opacity",m.fillOpacity)),void 0!==p&&void 0!==x&&(f.attr("data-range-y1",p),f.attr("data-range-y2",x));if(new k(this.w).setSelectionFilter(f,e,i),b.add(f),f.attr({cy:U.dataLabelsPos.bcy,cx:U.dataLabelsPos.bcx,j:i,val:M.seriesData.series[e][i],barHeight:v,barWidth:C,"data:pathKey":this._keys(e)[i]}),null==t||t.paint(f,{delay:K,delayMs:q,speed:u,fill:tt,elSeries:b,elBarShadows:A,labels:U.dataLabels,pathFrom:h,pathTo:d}),"canvas"===N.kind){M.globals.barCanvasCoords||(M.globals.barCanvasCoords={}),M.globals.barCanvasCoords[e]||(M.globals.barCanvasCoords[e]={});const t=M.globals.barCanvasCoords[e][i];let s=(null==t?void 0:t.bounds)||null;const a=f.bbox();(a.width>0||a.height>0)&&(s={left:Math.min(s?s.left:1/0,a.x),top:Math.min(s?s.top:1/0,a.y),right:Math.max(s?s.right:-1/0,a.x+a.width),bottom:Math.max(s?s.bottom:-1/0,a.y+a.height)}),M.globals.barCanvasCoords[e][i]=l(n({cx:U.dataLabelsPos.bcx,cy:U.dataLabelsPos.bcy,barWidth:C,type:R},void 0!==p&&void 0!==x&&{rangeY1:p,rangeY2:x}),{bounds:s})}null!==U.dataLabels&&P.add(U.dataLabels),U.totalDataLabels&&P.add(U.totalDataLabels),b.add(P),S&&b.add(S),A&&b.add(A)}return b}drawBarPaths({indexes:t,barHeight:e,strokeWidth:s,zeroW:a,x:i,y:r,yDivision:o,elSeries:n}){const l=this.w,h=t.i,d=t.j;let c;if(l.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:s,zeroEncounters:a}=this.barHelpers.getZeroValueEncounters({i:t.realIndex,j:d});s>0&&(e=this.seriesLen*e/s),c=r+e*this.visibleI,c-=e*a}else c=r+e*this.visibleI;const b=this.isFunnel&&"trapezoid"===l.config.plotOptions.funnel.shape,u=this.isPyramid&&this.pyramidLayout?this.pyramidLayout[d]:null,g=!!u;if(u)c=u.y,e=u.height;else if(this.isFunnel&&!b){const t=null!=a?a:0;a=t-(this.barHelpers.getXForValue(this.series[h][d],t)-t)/2}let p;return i=this.barHelpers.getXForValue(this.series[h][d],null!=a?a:0),p=u?this.barHelpers.getPyramidPaths({barYPosition:c,barHeight:e,topHalf:u.topHalf,bottomHalf:u.bottomHalf,realIndex:t.realIndex,j:d,strokeWidth:s,w:l}):b?this.barHelpers.getFunnelTrapezoidPaths({barYPosition:c,barHeight:e,series:this.series,i:h,j:d,realIndex:t.realIndex,strokeWidth:s,w:l}):this.barHelpers.getBarpaths({barYPosition:c,barHeight:e,x1:a,x2:i,strokeWidth:s,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:h,j:d,w:l}),(b||g)&&(a=p.x1,i=p.x),g||(r+=o),g&&(r=c),this.barHelpers.barBackground({j:d,i:h,y1:c-e*this.visibleI,y2:e*this.seriesLen,elSeries:n}),{pathTo:p.pathTo,pathFrom:p.pathFrom,x1:a,x:i,y:r,goalX:this.barHelpers.getGoalValues("x",a,null,t.realIndex,d,0),barYPosition:c,barHeight:e}}drawColumnPaths({indexes:t,x:e,y:s,xDivision:a,barWidth:i,zeroH:r,strokeWidth:o,elSeries:n}){const l=this.w,h=t.realIndex,d=t.translationsIndex,c=t.i,b=t.j,u=t.bc;let g;if(l.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:b,realIndex:h,barWidth:i});e=t.x,g=t.barXPosition}else if(l.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:s}=this.barHelpers.getZeroValueEncounters({i:h,j:b});t>0&&(i=this.seriesLen*i/t),g=e+i*this.visibleI,g-=i*s}else g=e+i*this.visibleI;s=this.barHelpers.getYForValue(this.series[c][b],r,d);const p=this.barHelpers.getColumnPaths({barXPosition:g,barWidth:i,y1:r,y2:s,strokeWidth:o,isReversed:this.isReversed,series:this.series,realIndex:h,i:c,j:b,w:l});return l.axisFlags.isXNumeric||(e+=a),this.barHelpers.barBackground({bc:u,j:b,i:c,x1:g-o/2-i*this.visibleI,x2:i*this.seriesLen+o/2,elSeries:n}),{pathTo:p.pathTo,pathFrom:p.pathFrom,x:e,y:s,goalY:this.barHelpers.getGoalValues("y",null,r,h,b,d),barXPosition:g,barWidth:i}}getBarXForNumericXAxis({x:t,barWidth:e,realIndex:s,j:a}){const i=this.w,r=P(i);let o=s;return i.seriesData.seriesX[s].length||(o=i.globals.maxValsInArrayIndex),c.isNumber(i.seriesData.seriesX[o][a])&&(t=T.dataXToPx(i,i.seriesData.seriesX[o][a])-e*(r?1:this.seriesLen)/2),{barXPosition:t+(r?0:e*this.visibleI),x:t}}_wasOnScreen(t,e){if(!R(this.w))return!1;const s=this._prevKeyedPaths(t);return!!s&&s.has(this._keys(t)[e])}_keys(t){const e=this._keyCache||(this._keyCache={});return e[t]||(e[t]=X(this.w,t))}_prevRecord(t){const e=this.w;let s=null;for(let a=0;a<e.globals.previousPaths.length;a++){const i=e.globals.previousPaths[a];i.paths&&i.paths.length>0&&parseInt(i.realIndex,10)===parseInt(String(t),10)&&(s=i)}return s}_prevKeyedPaths(t){if(this._prevKeyed||(this._prevKeyed={}),void 0!==this._prevKeyed[t])return this._prevKeyed[t];const e=this._prevRecord(t);let s=null;if(e&&e.paths.every(t=>null!=t.key)){const t=new Map;e.paths.forEach(e=>{t.set(e.key,e)}),s=t}return this._prevKeyed[t]=s,s}isLengthTransition(t){var e,s,a,i,r,o;if(this._ltCache||(this._ltCache={}),void 0!==this._ltCache[t])return this._ltCache[t];const n=this.w;let l=!1;if(R(n)&&n.globals.previousPaths.length>0){const h=this._prevRecord(t),d=null!=(s=null==(e=n.seriesData.series[t])?void 0:e.length)?s:0,c=h&&this._prevKeyedPaths(t);if(h)if(c){const e=new Set(this._keys(t));l=(null!=(o=null==(r=null==(i=null==(a=n.globals.prevStreamFrame)?void 0:a.seriesY)?void 0:i[t])?void 0:r.length)?o:d)!==d||[...c.keys()].some(t=>!e.has(t))}else l=h.paths.length!==d;else l=d>0}return this._ltCache[t]=l,l}isLayoutShift(t){if(this.isLengthTransition(t))return!0;if(this._layoutShiftCache||(this._layoutShiftCache={}),void 0!==this._layoutShiftCache[t])return this._layoutShiftCache[t];const e=F(this.w,t,!0,!0),s=!(!e||!e.join.changed);return this._layoutShiftCache[t]=s,s}getPreviousPath(t,e,s,a){const i=this.w;this._pathToInterp=null;const r=this._prevRecord(t);if(!r)return R(i)?null:s;let o=null,n=!1;const l=this._prevKeyedPaths(t);if(l){const s=l.get(this._keys(t)[e]);s?o=s.d:n=!0}else void 0!==r.paths[e]?o=r.paths[e].d:n=!0;return o?this.cornerMorph(o,s,a):n&&R(i)?null:s}cornerMorph(t,e,s){const a=j.pathCommandCount(t),i=j.pathCommandCount(e);if(a===i)return t;const r=new f(this.w),o=t=>{const e=j.pathBox(t);return e?Math.min(e.maxX-e.minX,e.maxY-e.minY):0},n=a<i?o(t)>1:o(e)>1;if(a<i){const e=r.roundPathCorners(t,0);if(j.pathCommandCount(e)===i){if(n&&s){const t=r.roundPathCorners(s,0);j.pathCommandCount(t)===i&&(this._pathToInterp=t)}return e}}else{const s=r.roundPathCorners(e,0);if(j.pathCommandCount(s)===a){if(this._pathToInterp=s,n){const e=j.squareLike(t),s=e?r.roundPathCorners(e,0):null;if(s&&j.pathCommandCount(s)===a)return s}return t}}return e}static pathBox(t){if(!t)return null;const e=[],s=/([MLC])([^MLCZz]*)/g;let a;for(;null!==(a=s.exec(t));){const t=a[2].trim().split(/[\s,]+/).map(Number);t.length<2||t.some(isNaN)||e.push([t[t.length-2],t[t.length-1]])}if(e.length<3)return null;const i=e.map(t=>t[0]),r=e.map(t=>t[1]);return{minX:Math.min(...i),maxX:Math.max(...i),minY:Math.min(...r),maxY:Math.max(...r),start:e[0],vertical:Math.abs(e[1][0]-e[0][0])<Math.abs(e[1][1]-e[0][1])}}static squareLike(t){const e=j.pathBox(t);if(!e)return null;const{minX:s,maxX:a,minY:i,maxY:r,start:o,vertical:n}=e,l=(t,e,s)=>Math.abs(t-e)<=Math.abs(t-s)?[e,s]:[s,e];let h,d,c,b;n?(h=Math.abs(o[0]-s)<=Math.abs(o[0]-a)?s:a,d=h===s?a:s,[c,b]=l(o[1],i,r)):(c=Math.abs(o[1]-i)<=Math.abs(o[1]-r)?i:r,b=c===i?r:i,[h,d]=l(o[0],s,a));const u=t.trim().endsWith("Z")?" Z":" z";return n?`M ${h} ${c} L ${h} ${b} L ${d} ${b} L ${d} ${c}${u}`:`M ${h} ${c} L ${d} ${c} L ${d} ${b} L ${h} ${b}${u}`}getPreviousFlip(t,e){const s=this._prevRecord(t);if(!s)return null;const a=this._prevKeyedPaths(t),i=a?a.get(this._keys(t)[e]):s.paths[e];return i?!!i.flip:null}static pathCommandCount(t){if(!t)return 0;const e=t.match(/[MmLlHhVvCcSsQqTtAaZz]/g);return e?e.length:0}}d.default.use({bar:j,column:j,barStacked:class extends j{draw(t,e){const s=this.w;this.graphics=new f(this.w);const a=new I(this.w);t=a.getLogSeries(t),this.yRatio=a.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t,e),"100%"===s.config.chart.stackType&&(t=s.globals.comboCharts?e.map(t=>s.globals.seriesPercent[t]):s.globals.seriesPercent.slice()),this.series=t,this.barHelpers.initializeStackedPrevVars(this);const i=this.graphics.group({class:"apexcharts-bar-series apexcharts-plot-series"}),r=this.ctx.highlightFilter;let o=0,h=0;const d=s.config.chart.animations,b=d.enabled&&d.dynamicAnimation.enabled&&s.globals.previousPaths.length>0;let u=!1;for(let a=0,d=0;a<t.length;a++,d++){const g=s.globals.comboCharts?e[a]:a,{groupIndex:p,columnGroupIndex:x}=this.barHelpers.getGroupIndex(g);this.groupCtx=this.stacks[p];const f=[],y=[],v=this.setSeriesAxis(g);let m=this.graphics.group({class:"apexcharts-series",seriesName:c.escapeString(s.seriesData.seriesNames[g]),rel:a+1,"data:realIndex":g});C.addCollapsedClassToSeries(this.w,m,g);const w=this.graphics.group({class:"apexcharts-datalabels","data:realIndex":g});C.addCollapsedClassToSeries(this.w,w,g),(s.globals.collapsingSeriesIndices||[]).indexOf(g)>-1&&w.node.style.setProperty("--apexcharts-dl-exit",`${s.config.chart.animations.dynamicAnimation.speed}ms`);const I=this.graphics.group({class:"apexcharts-bar-goals-markers"}),P=this.initialPositions(o,h,void 0,void 0,void 0,void 0,v),{xDivision:S,yDivision:k,zeroH:H,zeroW:L}=P;let A=P.barHeight,D=P.barWidth;h=P.y,o=P.x,s.globals.barHeight=A,s.globals.barWidth=D,this.barHelpers.initializeStackedXYVars(this),1===this.groupCtx.prevY.length&&this.groupCtx.prevY[0].every(t=>isNaN(t))&&(this.groupCtx.prevY[0]=this.groupCtx.prevY[0].map(()=>H),this.groupCtx.prevYF[0]=this.groupCtx.prevYF[0].map(()=>0));for(let e=0;e<s.globals.dataPoints;e++){const i=this.barHelpers.getStrokeWidth(a,e,g),c={indexes:{i:a,j:e,realIndex:g,translationsIndex:v,bc:d},strokeWidth:i,x:o,y:h,elSeries:m,columnGroupIndex:x};let p=null;this.isHorizontal?(p=this.drawStackedBarPaths(l(n(n({},c),this.barHelpers.rows&&{y:P.y+this.barHelpers.barRow(g,e)*k}),{zeroW:L,barHeight:A,yDivision:k})),D=this.series[a][e]/this.invertedYRatio):(p=this.drawStackedColumnPaths(l(n({},c),{xDivision:S,barWidth:D,zeroH:H})),A=this.series[a][e]/this.yRatio[v]);const C=this.barHelpers.drawGoalLine({barXPosition:p.barXPosition,barYPosition:p.barYPosition,goalX:p.goalX,goalY:p.goalY,barHeight:A,barWidth:D});C&&I.add(C),h=p.y,o=p.x,f.push(o),y.push(h);const R=this.barHelpers.getPathFillColor(t,a,e,g);let W="";const X=s.globals.isBarHorizontal?"apexcharts-flip-x":"apexcharts-flip-y",F=this.cornerFlip(this.barHelpers.arrBorderRadius[g][e],s.seriesData.series[g][e]),O=b&&!F&&this.getPreviousFlip(g,e);(F||O)&&(W=X),O&&(W+=" apexcharts-flip-held",u=!0),m=this.renderSeries(l(n({hl:null==r?void 0:r.bar(this,{i:a,j:e,realIndex:g,translationsIndex:v,paths:p,zeroH:H,zeroW:L}),realIndex:g,pathFill:R.color},R.useRangeColor?{lineFill:R.color}:{}),{j:e,i:a,columnGroupIndex:x,pathFrom:p.pathFrom,pathTo:p.pathTo,strokeWidth:i,elSeries:m,x:o,y:h,series:t,barHeight:A,barWidth:D,barXPosition:p.barXPosition,elDataLabelsWrap:w,elGoalsMarkers:I,type:"bar",visibleSeries:x,classes:W}))}s.globals.seriesXvalues[g]=f,s.globals.seriesYvalues[g]=y,this.groupCtx.prevY.push(this.groupCtx.yArrj),this.groupCtx.prevYF.push(this.groupCtx.yArrjF),this.groupCtx.prevYVal.push(this.groupCtx.yArrjVal),this.groupCtx.prevX.push(this.groupCtx.xArrj),this.groupCtx.prevXF.push(this.groupCtx.xArrjF),this.groupCtx.prevXVal.push(this.groupCtx.xArrjVal),i.add(m)}return u&&this.settleHeldMirrors(i),i}cornerFlip(t,e){return"bottom"===t&&e>0||"top"===t&&e<0}settleHeldMirrors(t){const e=this.w;if(!D.isBrowser())return;const s=e.config.chart.animations,a=(s.dynamicAnimation.speed||0)+(s.speed||0)+100,i=(t?t.node:e.dom.baseEl).querySelectorAll(".apexcharts-flip-held");setTimeout(()=>{i.forEach(t=>{t.classList.remove("apexcharts-flip-held","apexcharts-flip-y","apexcharts-flip-x")})},a)}initialPositions(t,e,s,a,i,r,o){const n=this.w;let l,h;if(this.isHorizontal){a=n.layout.gridHeight/n.globals.dataPoints;const t=n.config.plotOptions.bar.barHeight;l=-1===String(t).indexOf("%")?parseInt(t,10):a*parseInt(t,10)/100,r=n.globals.padHorizontal+(this.isReversed?n.layout.gridWidth-this.baseLineInvertedY:this.baseLineInvertedY),e=(a-l)/2}else{h=s=n.layout.gridWidth/n.globals.dataPoints;const e=n.config.plotOptions.bar.columnWidth,a=n.axisFlags.isXNumeric?this.barHelpers.barSlotXSpan():0;a>0?h=(s=a/this.xRatio)*parseInt(this.barOptions.columnWidth,10)/100:h*=parseInt(e,10)/100,-1===String(e).indexOf("%")&&(h=parseInt(e,10)),i=this.isReversed?this.baseLineY[o]:n.layout.gridHeight-this.baseLineY[o],t=n.globals.padHorizontal+(s-h)/2}const d=n.globals.barGroups.length||1;return{x:t,y:e,yDivision:a,xDivision:s,barHeight:(null!=l?l:0)/d,barWidth:(null!=h?h:0)/d,zeroH:i,zeroW:r}}drawStackedBarPaths({indexes:t,barHeight:e,strokeWidth:s,zeroW:a,x:i,y:r,columnGroupIndex:o,yDivision:n,elSeries:l}){var h,d;const c=this.w,b=r+o*e;let u;const g=t.i,p=t.j,x=t.realIndex,f=t.translationsIndex,y=null!=(d=null==(h=this.series[g])?void 0:h[p])?d:null,v=this.groupCtx,m=c.axisFlags.isXNumeric?c.seriesData.seriesX[x][p]:p,C=v.tops.get(m);if(C){const[t,e,s]=C,a=2*(this.isReversed?s:0);u=e<0?y>=0?t+s-a:t:y>=0?t:t-s+a}else u=a;i=u+y/this.invertedYRatio*(this.isReversed?-1:1);const w=this.barHelpers.getBarpaths({barYPosition:b,barHeight:e,x1:u,x2:i,strokeWidth:s,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:g,j:p,w:c});return this._setTop(m,C,v.xArrj[p],v.xArrjVal[p],v.xArrjF[p],x,p),this.barHelpers.barBackground({j:p,i:g,y1:b,y2:e,elSeries:l}),r+=n,{pathTo:w.pathTo,pathFrom:w.pathFrom,goalX:this.barHelpers.getGoalValues("x",a,null,x,p,f),barXPosition:u,barYPosition:b,x:i,y:r}}drawStackedColumnPaths({indexes:t,x:e,y:s,xDivision:a,barWidth:i,zeroH:r,columnGroupIndex:o,elSeries:n}){var l,h,d;const c=this.w,b=t.i,u=t.j,g=t.bc,p=t.realIndex,x=t.translationsIndex,f=null!=(h=null==(l=this.series[b])?void 0:l[u])?h:null;if(c.axisFlags.isXNumeric){let t=c.seriesData.seriesX[p][u];t||(t=0),e=(t-c.globals.minX)/this.xRatio-i/2*c.globals.barGroups.length}const y=e+o*i;let v;const m=this.groupCtx,C=c.axisFlags.isXNumeric?c.seriesData.seriesX[p][u]:u,w=m.tops.get(C);if(w){const[t,e,s]=w;let a;e<0?a=f>=0?t-s+2*(this.isReversed?s:0):t:e>=0&&(a=f>=0?t:t+s-2*(this.isReversed?s:0)),void 0===a&&(a=c.layout.gridHeight),v=(null==(d=m.prevYF[0])?void 0:d.every(t=>0===t))&&m.prevYF.slice(1).every(t=>t.every(t=>isNaN(t)))?r:a}else v=r;s=v-f/this.yRatio[x]*(this.isReversed?-1:1);const I=this.barHelpers.getColumnPaths({barXPosition:y,barWidth:i,y1:v,y2:s,yRatio:this.yRatio[x],strokeWidth:c.config.stroke.show?this.strokeWidth:0,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:b,j:u,w:c});return this._setTop(C,w,m.yArrj[u],m.yArrjVal[u],m.yArrjF[u],p,u),this.barHelpers.barBackground({bc:g,j:u,i:b,x1:y,x2:i,elSeries:n}),{pathTo:I.pathTo,pathFrom:I.pathFrom,goalY:this.barHelpers.getGoalValues("y",null,r,p,u,x),barXPosition:y,x:c.axisFlags.isXNumeric?e:e+a,y:s}}_setTop(t,e,s,a,i,r,o){isNaN(s)||this.groupCtx.tops.set(t,[s,a,(e?e[2]:0)+i,(e?e[3]:0)+(this.w.seriesData.series[r][o]||0),e?Math.min(e[0],e[4]):1/0,e?Math.max(e[0],e[5]):-1/0])}},rangeBar:class extends j{draw(t,e){var s,a,i,r,o,l;const h=this.w,d=new f(this.w);this.rangeBarOptions=this.w.config.plotOptions.rangeBar,this.series=t,this.seriesRangeStart=h.rangeData.seriesRangeStart,this.seriesRangeEnd=h.rangeData.seriesRangeEnd,this.barHelpers.initVariables(t,e);const b=d.group({class:"apexcharts-rangebar-series apexcharts-plot-series"});for(let u=0;u<t.length;u++){let g,p;const x=h.globals.comboCharts?e[u]:u,{columnGroupIndex:f}=this.barHelpers.getGroupIndex(x),y=d.group({class:"apexcharts-series",seriesName:c.escapeString(h.seriesData.seriesNames[x]),rel:u+1,"data:realIndex":x});C.addCollapsedClassToSeries(this.w,y,x),t[u].length>0&&(this.visibleI=this.visibleI+1);const v=this.setSeriesAxis(x);this.isHorizontal&&h.labelData.timescaleLabels.length&&(this.isReversed=!1);const m=this.barHelpers.initialPositions(x),{y:w,zeroW:I,x:P,zeroH:S}=m,k=null!=(s=m.yDivision)?s:0,H=null!=(a=m.xDivision)?a:0;p=w,g=P;const L=d.group({class:"apexcharts-datalabels","data:realIndex":x}),A=d.group({class:"apexcharts-rangebar-goals-markers"}),D=h.config.series[x].data;for(let e=0;e<h.globals.dataPoints;e++){const s=this.barHelpers.getStrokeWidth(u,e,x);let a=null!=(i=m.barWidth)?i:0,d=null!=(r=m.barHeight)?r:0;const c=this.seriesRangeStart[x][e],b=this.seriesRangeEnd[x][e];let C=null,w=null,P=null;const R={x:g,y:p,strokeWidth:s,elSeries:y};let W=this.seriesLen;if(h.config.plotOptions.bar.rangeBarGroupRows&&(W=1),void 0===(null==D?void 0:D[e]))break;if(this.isHorizontal){P=p+d*this.visibleI;const t=(k-d*W)/2;if(null!=(null==(o=D[e])?void 0:o.x)){const s=this.detectOverlappingBars({i:x,j:e,barYPosition:P,srty:t,barHeight:d,yDivision:k,initPositions:m});d=s.barHeight,P=s.barYPosition}C=this.drawRangeBarPaths(n({indexes:{i:u,j:e,realIndex:x},barHeight:d,barYPosition:P,zeroW:I,yDivision:k,y1:c,y2:b},R)),a=C.barWidth}else{h.axisFlags.isXNumeric&&(g=(h.seriesData.seriesX[x][e]-h.globals.minX)/this.xRatio-a/2),w=g+a*this.visibleI;const t=(H-a*W)/2;if(null!=(null==(l=D[e])?void 0:l.x)){const s=this.detectOverlappingBars({i:x,j:e,barXPosition:w,srtx:t,barWidth:a,xDivision:H,initPositions:m});a=s.barWidth,w=s.barXPosition}C=this.drawRangeColumnPaths(n({indexes:{i:u,j:e,realIndex:x,translationsIndex:v},barWidth:a,barXPosition:w,zeroH:S,xDivision:H},R)),d=C.barHeight,w=C.barXPosition}const X=this.barHelpers.drawGoalLine({barXPosition:w,barYPosition:P,goalX:C.goalX,goalY:C.goalY,barHeight:d,barWidth:a});X&&A.add(X),p=C.y,g=C.x;const F=this.barHelpers.getPathFillColor(t,u,e,x);this.renderSeries({realIndex:x,pathFill:F.color,lineFill:F.useRangeColor?F.color:h.globals.stroke.colors[x],j:e,i:u,x:g,y:p,y1:c,y2:b,pathFrom:C.pathFrom,pathTo:C.pathTo,strokeWidth:s,elSeries:y,series:t,barHeight:d,barWidth:a,barXPosition:w,barYPosition:P,columnGroupIndex:f,elDataLabelsWrap:L,elGoalsMarkers:A,visibleSeries:this.visibleI,type:"rangebar"})}h.globals.previousPaths.length>0&&O({w:h,elSeries:y,record:this._prevRecord(x),newKeys:this._keys(x),isHorizontal:this.isHorizontal,speed:h.config.chart.animations.dynamicAnimation.speed}),b.add(y)}return b}detectOverlappingBars({i:t,j:e,barYPosition:s,barXPosition:a,srty:i,srtx:r,barHeight:o,barWidth:n,yDivision:l,xDivision:h,initPositions:d}){var c,b,u,g;const p=this.w;let x=[];const f=null==(b=null==(c=p.globals.seriesRangeName)?void 0:c[t])?void 0:b[e],y=null==(g=null==(u=p.config.series[t].data)?void 0:u[e])?void 0:g.x,v=Array.isArray(y)?y.join(" "):y,m=p.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(v),C=p.rangeData.seriesRange[t].findIndex(t=>{var e;return t.x===v&&(null==(e=t.overlaps)?void 0:e.size)>0});return this.isHorizontal?(s=p.config.plotOptions.bar.rangeBarGroupRows?i+l*m:i+o*this.visibleI+l*m,C>-1&&!p.config.plotOptions.bar.rangeBarOverlap&&(x=Array.from(p.rangeData.seriesRange[t][C].overlaps),x.indexOf(f)>-1&&(s+=(o=d.barHeight/x.length)*x.indexOf(f)))):(m>-1&&!p.axisFlags.isXNumeric&&(a=p.config.plotOptions.bar.rangeBarGroupRows?r+h*m:r+n*this.visibleI+h*m),C>-1&&!p.config.plotOptions.bar.rangeBarOverlap&&(x=Array.from(p.rangeData.seriesRange[t][C].overlaps),x.indexOf(f)>-1&&(a+=(n=d.barWidth/x.length)*x.indexOf(f)))),{barYPosition:s,barXPosition:a,barHeight:o,barWidth:n}}drawRangeColumnPaths({indexes:t,x:e,xDivision:s,barWidth:a,barXPosition:i,zeroH:r}){var o,n;const l=this.w,{i:h,j:d,realIndex:c,translationsIndex:b}=t,u=this.yRatio[b]*(this.isReversed?-1:1),g=this.getRangeValue(c,d);let p=Math.min(g.start,g.end),x=Math.max(g.start,g.end);const f=!(void 0===(null==(o=this.series[h])?void 0:o[d])||null===(null==(n=this.series[h])?void 0:n[d]));f?(p=r-p/u,x=r-x/u):p=x=r;const y=Math.abs(x-p),v=this.barHelpers.getColumnPaths({barXPosition:i,barWidth:a,y1:p,y2:x,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,realIndex:c,i:c,j:d,w:l});if(f){const t=v.drawnBox,e=g.end>=g.start;this.recordColumnGeometry(c,d,{slotStart:t.x1,slotEnd:t.x2,levelStart:e?t.y1:t.y2,levelEnd:e?t.y2:t.y1,horizontal:!1})}if(l.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:d,realIndex:c,barWidth:a});e=t.x,i=t.barXPosition}else e+=s;return{pathTo:v.pathTo,pathFrom:v.pathFrom,barHeight:y,x:e,y:g.start<0&&g.end<0?p:x,goalY:this.barHelpers.getGoalValues("y",null,r,c,d,b),barXPosition:i}}_keys(t){const e=this._keyCache||(this._keyCache={}),s=this.w.config.series[t].data;return e[t]||(e[t]=W((s||[]).map((t,e)=>{var s;return"c:"+(null!=(s=null==t?void 0:t.x)?s:e)})))}preventBarOverflow(t){const e=this.w;return t<0&&(t=0),t>e.layout.gridWidth&&(t=e.layout.gridWidth),t}drawRangeBarPaths({indexes:t,y:e,y1:s,y2:a,yDivision:i,barHeight:r,barYPosition:o,zeroW:n}){const l=this.w,{realIndex:h,j:d}=t,c=this.invertedYRatio*(this.isReversed?-1:1),b=this.preventBarOverflow(n+s/c),u=this.preventBarOverflow(n+a/c),g=this.getRangeValue(h,d),p=Math.abs(u-b),x=this.barHelpers.getBarpaths({barYPosition:o,barHeight:r,x1:b,x2:u,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,i:h,realIndex:h,j:d,w:l});if(null!=g.start&&null!=g.end){const t=x.drawnBox;this.recordColumnGeometry(h,d,{slotStart:t.y1,slotEnd:t.y2,levelStart:t.x1,levelEnd:t.x2,horizontal:!0})}return l.axisFlags.isXNumeric||(e+=i),{pathTo:x.pathTo,pathFrom:x.pathFrom,barWidth:p,x:g.start<0&&g.end<0?b:u,goalX:this.barHelpers.getGoalValues("x",n,null,h,d,0),y:e}}recordColumnGeometry(t,e,s){const a=this.w.waterfallData&&this.w.waterfallData.geometry;a&&isFinite(s.slotStart)&&isFinite(s.levelEnd)&&(a[t]||(a[t]=[]),a[t][e]=s)}getRangeValue(t,e){const s=this.w;return{start:s.rangeData.seriesRangeStart[t][e],end:s.rangeData.seriesRangeEnd[t][e]}}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>d.default});
|