apexcharts 7.2.0 → 7.4.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/LICENSE +30 -11
- package/dist/apexcharts.common.js +2 -2
- package/dist/apexcharts.core.js +545 -463
- package/dist/apexcharts.core.min.js +2 -2
- package/dist/apexcharts.esm.js +1149 -801
- package/dist/apexcharts.js +684 -254
- package/dist/apexcharts.min.js +2 -2
- package/dist/apexcharts.ssr.common.js +2 -2
- package/dist/apexcharts.ssr.esm.js +684 -254
- package/dist/area.common.js +1 -1
- package/dist/area.esm.js +1 -1
- package/dist/bar.common.js +2 -2
- package/dist/bar.esm.js +20 -10
- package/dist/bar.js +2 -2
- package/dist/boxPlot.common.js +2 -2
- package/dist/boxPlot.esm.js +20 -10
- package/dist/bubble.common.js +1 -1
- package/dist/bubble.esm.js +1 -1
- package/dist/candlestick.common.js +2 -2
- package/dist/candlestick.esm.js +20 -10
- package/dist/candlestick.js +2 -2
- package/dist/column.common.js +2 -2
- package/dist/column.esm.js +20 -10
- package/dist/core.common.js +2 -2
- package/dist/core.esm.js +545 -463
- 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 +20 -10
- package/dist/features/all.common.js +2 -2
- package/dist/features/all.esm.js +364 -26
- 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 +1 -1
- package/dist/features/drilldown.esm.js +1 -1
- package/dist/features/drilldown.js +1 -1
- 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 +2 -2
- package/dist/features/exports.esm.js +12 -14
- package/dist/features/exports.js +2 -2
- 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/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 +14 -1
- package/dist/features/keyboard.js +2 -2
- package/dist/features/legend.common.js +1 -1
- package/dist/features/legend.esm.js +1 -1
- package/dist/features/legend.js +1 -1
- package/dist/features/link.common.js +1 -1
- package/dist/features/link.esm.js +38 -38
- 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 +11 -11
- 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 +1 -1
- package/dist/features/renderer-canvas.esm.js +1 -1
- package/dist/features/renderer-canvas.js +1 -1
- 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 +11 -11
- package/dist/features/storyboard.js +1 -1
- package/dist/features/streamgraph.common.js +1 -1
- package/dist/features/streamgraph.esm.js +1 -1
- package/dist/features/streamgraph.js +1 -1
- package/dist/features/toolbar.common.js +2 -2
- package/dist/features/toolbar.esm.js +172 -25
- package/dist/features/toolbar.js +2 -2
- package/dist/features/trellis.common.js +1 -1
- package/dist/features/trellis.esm.js +1 -1
- package/dist/features/trellis.js +1 -1
- 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 +2 -2
- package/dist/features/weave.esm.js +180 -2
- package/dist/features/weave.js +2 -2
- package/dist/heatmap.common.js +1 -1
- package/dist/heatmap.esm.js +1 -1
- package/dist/heatmap.js +1 -1
- package/dist/histogram.common.js +2 -2
- package/dist/histogram.esm.js +20 -10
- package/dist/line.common.js +1 -1
- package/dist/line.esm.js +1 -1
- package/dist/line.js +1 -1
- 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 +1 -1
- package/dist/radar.esm.js +1 -1
- package/dist/radar.js +1 -1
- 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 +20 -10
- package/dist/rangeArea.common.js +1 -1
- package/dist/rangeArea.esm.js +1 -1
- package/dist/rangeBar.common.js +2 -2
- package/dist/rangeBar.esm.js +20 -10
- package/dist/scatter.common.js +1 -1
- package/dist/scatter.esm.js +1 -1
- package/dist/streamgraph.common.js +1 -1
- package/dist/streamgraph.esm.js +1 -1
- package/dist/sunburst.common.js +1 -1
- package/dist/sunburst.esm.js +1 -1
- package/dist/sunburst.js +1 -1
- package/dist/treemap.common.js +1 -1
- package/dist/treemap.esm.js +1 -1
- package/dist/treemap.js +1 -1
- 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 +1 -1
- package/dist/unit.esm.js +79 -79
- package/dist/unit.js +1 -1
- package/dist/violin.common.js +2 -2
- package/dist/violin.esm.js +20 -10
- package/dist/violin.js +2 -2
- package/dist/waterfall.common.js +2 -2
- package/dist/waterfall.esm.js +20 -10
- package/package.json +2 -2
- package/src/apexcharts.js +39 -15
- package/src/charts/common/bar/Helpers.js +31 -12
- package/src/modules/Data.js +8 -2
- package/src/modules/Exports.js +14 -12
- package/src/modules/Formatters.js +24 -1
- package/src/modules/Range.js +28 -1
- package/src/modules/Toolbar.js +112 -2
- package/src/modules/ZoomPanSelection.js +85 -7
- package/src/modules/accessibility/KeyboardNavigation.js +14 -0
- package/src/modules/axes/YAxis.js +12 -15
- package/src/modules/helpers/UpdateHelpers.js +25 -8
- package/src/modules/settings/Globals.js +5 -10
- package/src/modules/settings/Options.js +15 -0
- package/src/modules/weave/PluginAPI.js +57 -1
- package/src/modules/weave/WeaveHost.js +148 -0
- package/src/ssr/DOMShim.js +50 -0
- package/src/types/internal.d.ts +1 -1
- package/src/utils/Utils.js +6 -9
- package/types/apexcharts.d.ts +17 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v7.
|
|
2
|
+
* ApexCharts v7.4.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
|
-
"use strict";var t=Object.defineProperty,e=Object.defineProperties,a=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,o=(e,a,s)=>a in e?t(e,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[a]=s,l=(t,e)=>{for(var a in e||(e={}))i.call(e,a)&&o(t,a,e[a]);if(s)for(var a of s(e))r.call(e,a)&&o(t,a,e[a]);return t},n=(t,s)=>e(t,a(s));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 a in t)if("default"!==a){const s=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(e,a,s.get?s:{enumerable:!0,get:()=>t[a]})}return e.default=t,Object.freeze(e)}const d=h(require("apexcharts/core")),c=d.__apex_CoreUtils,b=d.__apex_Graphics,u=d.__apex_DataLabels,g=(t,e,a,s)=>{if("function"!=typeof t)return t;const i=t({series:e.seriesData.series,seriesIndex:a,dataPointIndex:s,w:e});return Number.isFinite(i)?i:0},p=d.__apex_BrowserAPIs_BrowserAPIs,x=d.__apex_Environment_Environment;function f(t){var e;const a=t.config.chart.animations;if(!a||!1===a.enabled)return!1;if(!a.dynamicAnimation||!1===a.dynamicAnimation.enabled)return!1;const s=null!=(e=a.largeDatasetThreshold)?e:0;return!(s>0&&t.globals.dataPoints>s)&&!!(x.isBrowser()&&t.globals.dataChanged&&t.globals.shouldAnimate)}function m(t,e,a){var s,i,r,o;if(null==(s=t.axisFlags)?void 0:s.isXNumeric){const s=null==(r=null==(i=t.seriesData)?void 0:i.seriesX)?void 0:r[e];if(s&&s.length&&null!=s[a])return"x:"+s[a]}const l=null==(o=t.globals.labels)?void 0:o[a];return null!=l&&""!==String(l)?"c:"+(Array.isArray(l)?l.join(" "):String(l)):"j:"+a}function y(t){const e=new Map;return t.map(t=>{const a=e.get(t)||0;return e.set(t,a+1),0===a?t:`${t}#${a}`})}function v(t,e,a=!1,s=!1){var i,r;if(!f(t))return null;const o=t.globals.prevStreamFrame;if(!o)return null;const l=null==(i=o.seriesY)?void 0:i[e],n=null==(r=t.seriesData.series)?void 0:r[e];if(!Array.isArray(l)||!Array.isArray(n))return null;if(!l.length||!n.length)return null;const h=y(l.map((t,a)=>function(t,e,a){var s,i;if(t.isXNumeric){const i=null==(s=t.seriesX)?void 0:s[e];if(i&&i.length&&null!=i[a])return"x:"+i[a]}const r=null==(i=t.labels)?void 0:i[a];return null!=r&&""!==String(r)?"c:"+(Array.isArray(r)?r.join(" "):String(r)):"j:"+a}(o,e,a))),d=y(n.map((a,s)=>m(t,e,s))),c=function(t,e){const a=new Map;t.forEach((t,e)=>{a.has(t)||a.set(t,e)});const s=new Array(e.length),i=new Set;let r=-1,o=!0,l=t.length===e.length;e.forEach((t,e)=>{const n=a.has(t)&&!i.has(a.get(t))?a.get(t):-1;s[e]=n,-1!==n&&(i.add(n),n<r&&(o=!1),r=n),n!==e&&(l=!1)});const n=[];for(let e=0;e<t.length;e++)i.has(e)||n.push(e);return{toOld:s,exits:n,ordered:o,changed:!l}}(h,d);return(c.ordered||s)&&(c.changed||a)?{join:c,oldKeys:h,newKeys:d}:null}function C({w:t,elSeries:e,record:a,newKeys:s,isHorizontal:i,speed:r}){var o;if(!f(t))return;if(!a||!Array.isArray(a.paths)||!(null==e?void 0:e.node))return;const l=new Set(s),n=a.paths.filter(t=>t&&t.d&&null!=t.key&&!l.has(t.key));if(!n.length)return;const h=new b(t),d=null==(o=t.globals.colors)?void 0:o[parseInt(String(a.realIndex),10)];n.forEach(a=>{let s=a.fill||d||"#c8c8c8";0===String(s).indexOf("url(")&&(s=d||"#c8c8c8");const o=h.drawPath({d:a.d,stroke:"none",strokeWidth:0,fill:s,fillOpacity:1,classes:"apexcharts-bar-ghost"}),l=o.node;l.setAttribute("pointer-events","none"),o.attr("clip-path",`url(#gridRectBarMask${t.globals.cuid})`),e.node.insertBefore(l,e.node.firstChild);const n=function(t){const e=/^M\s*([+-]?[\d.eE]+)[\s,]+([+-]?[\d.eE]+)/.exec(t||"");if(!e)return null;const a=parseFloat(e[1]),s=parseFloat(e[2]);return isFinite(a)&&isFinite(s)?{x:a,y:s}:null}(a.d);let c=i?"left center":"center bottom";try{const t=l.getBBox();n&&t&&(c=i?Math.abs(n.x-t.x)<=Math.abs(n.x-(t.x+t.width))?"left center":"right center":Math.abs(n.y-(t.y+t.height))<=Math.abs(n.y-t.y)?"center bottom":"center top")}catch(t){}const b=l.style;b.transformBox="fill-box",b.transformOrigin=c;const u=Math.max(1,r||1),g=performance.now(),x=e=>{if(t.globals.isDestroyed||!l.parentNode)return;const a=Math.max(0,Math.min(1,(e-g)/u)),s=1-Math.pow(1-a,3),r=1-s;b.transform=i?`scaleX(${r})`:`scaleY(${r})`,b.opacity=String(1-s),a<1?p.requestAnimationFrame(x):l.parentNode.removeChild(l)};p.requestAnimationFrame(x)})}class w{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,a;const{x:s,y:i,y1:r,y2:o,i:h,j:d,realIndex:c,columnGroupIndex:u,barHeight:p,barWidth:x,barXPosition:f,barYPosition:m,visibleSeries:y}=t,v=this.w,C=new b(this.barCtx.w),w=v.waterfallData&&v.waterfallData.values,P=w&&w[c]&&null!=w[c][d]?w[c][d]:null,I=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[c]:this.barCtx.strokeWidth;let L,k;v.axisFlags.isXNumeric&&!v.globals.isBarHorizontal?(L=s+x*(y+1),k=i+p*(y+1)-I):(L=s+x*y,k=i+p*y);let S=null,D=null,H=s,A=i,O={};const X=v.config.dataLabels,W=this.barCtx.barOptions.dataLabels,F=this.barCtx.barOptions.dataLabels.total;void 0!==m&&(this.barCtx.isRangeBar||this.barCtx.isPyramid)&&(k=m,A=m),void 0!==f&&this.barCtx.isVerticalGroupedRangeBar&&(L=f,H=f);const R=g(X.offsetX,v,c,d),B=g(X.offsetY,v,c,d);let T={width:0,height:0};if(v.config.dataLabels.enabled){const t=null!==P?P:v.seriesData.series[c][d];T=C.getTextRects(v.config.dataLabels.formatter?v.config.dataLabels.formatter(t,n(l({},v),{seriesIndex:c,dataPointIndex:d,w:v})):v.formatters.yLabelFormatters[0](t),parseFloat(X.style.fontSize).toString(),X.style.fontFamily,void 0,!0,X.style.fontWeight)}const M={x:s,y:i,i:h,j:d,realIndex:c,columnGroupIndex:u,bcx:L,bcy:k,barHeight:p,barWidth:x,textRects:T,strokeWidth:I,dataLabelsX:H,dataLabelsY:A,dataLabelsConfig:X,barDataLabelsConfig:W,barTotalDataLabelsConfig:F,offX:R,offY:B};if(O=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(M):this.calculateColumnsDataLabelsPosition(M),null!==P&&this.barCtx.isHorizontal&&"center"===W.position){const t=null==(a=null==(e=v.waterfallData.geometry)?void 0:e[c])?void 0:a[d];t&&t.horizontal&&(O.dataLabelsX=(t.levelStart+t.levelEnd)/2+R)}return S=this.drawCalculatedDataLabels({x:O.dataLabelsX,y:O.dataLabelsY,val:null!==P?P:this.barCtx.isRangeBar?[r,o]:"100%"===v.config.chart.stackType?v.globals.seriesPercent[c][d]:v.seriesData.series[c][d],i:c,j:d,barWidth:x,barHeight:p,textRects:T,dataLabelsConfig:X}),v.config.chart.stacked&&F.enabled&&(D=this.drawTotalDataLabels({x:O.totalDataLabelsX,y:O.totalDataLabelsY,barWidth:x,barHeight:p,realIndex:c,j:d,textAnchor:O.totalDataLabelsAnchor,val:this.getStackedTotalDataLabel({realIndex:c,j:d}),rawVal:this.getStackedTotalValue({realIndex:c,j:d}),dataLabelsConfig:X,barTotalDataLabelsConfig:F})),{dataLabelsPos:O,dataLabels:S,totalDataLabels:D}}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,group:this.w.labelData.seriesGroups[e]}}drawsStackedTotal(t){const e=this.barCtx.lastActiveBarSerieIndexByGroup,a=this.getTotalGroupContext(t);return a&&e&&e.length>a.groupIndex?e[a.groupIndex]===t:this.barCtx.lastActiveBarSerieIndex===t}getStackedTotalValue({realIndex:t,j:e}){const a=this.w,s=this.getTotalGroupContext(t),i=a.seriesData.stackedSeriesTotalsByGroups;return s&&i&&i[s.groupIndex]?i[s.groupIndex][e]:this.barCtx.stackedSeriesTotals[e]}getStackedTotalDataLabel({realIndex:t,j:e}){const a=this.w;let s=this.getStackedTotalValue({realIndex:t,j:e});return this.totalFormatter&&(s=this.totalFormatter(s,n(l({},a),{seriesIndex:t,dataPointIndex:e,w:a}))),s}calculateColumnsDataLabelsPosition(t){const e=this.w;let a,s,{i:i,j:r,realIndex:o,y:l,bcx:n,barWidth:h,barHeight:d,textRects:c,dataLabelsX:u,dataLabelsY:g,dataLabelsConfig:p,barDataLabelsConfig:x,barTotalDataLabelsConfig:f,strokeWidth:m,offX:y,offY:v}=t;const C=n;d=Math.abs(d);const w="vertical"===e.config.plotOptions.bar.dataLabels.orientation,{zeroEncounters:P}=this.barCtx.barHelpers.getZeroValueEncounters({i:i,j:r});n-=m/2;const I=e.layout.gridWidth/e.globals.dataPoints;if(this.barCtx.isVerticalGroupedRangeBar?u+=h/2:(u=e.axisFlags.isXNumeric?n-h/2+y:n-I+h/2+y,!e.config.chart.stacked&&P>0&&e.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(u-=h*P)),w){const t=2;u=u+c.height/2-m/2-t}const L=e.seriesData.series[i][r]<0;let k=l;switch(this.barCtx.isReversed&&(k=l+(L?d:-d)),x.position){case"center":g=w?L?k-d/2+v:k+d/2-v:L?k-d/2+c.height/2+v:k+d/2+c.height/2-v;break;case"bottom":g=w?L?k-d+v:k+d-v:L?k-d+c.height+m+v:k+d-c.height/2+m-v;break;case"top":g=w?L?k+v:k-v:L?k-c.height/2-v:k+c.height+v}let S=k;const D=this.getTotalGroupContext(o);if((D?[D.group]:e.labelData.seriesGroups).forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevY.forEach(t=>{S=L?Math.max(t[r],S):Math.min(t[r],S)})}),this.drawsStackedTotal(o)&&f.enabled){const t=18,i=new b(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:o,j:r}),p.fontSize);a=L?S-i.height/2-v-f.offsetY+t:S+i.height+v+f.offsetY-t;const l=I;s=C+(e.axisFlags.isXNumeric?-h/2:h/2-l)+f.offsetX}return e.config.chart.stacked||(g<0?g=0+m:g+c.height/3>e.layout.gridHeight&&(g=e.layout.gridHeight-m)),{bcx:n,bcy:l,dataLabelsX:u,dataLabelsY:g,totalDataLabelsX:s,totalDataLabelsY:a,totalDataLabelsAnchor:"middle"}}calculateBarsDataLabelsPosition(t){var e;const a=this.w;let{x:s,i:i,j:r,realIndex:o,bcy:l,barHeight:n,barWidth:h,textRects:d,dataLabelsX:c,strokeWidth:u,dataLabelsConfig:g,barDataLabelsConfig:p,barTotalDataLabelsConfig:x,offX:f,offY:m}=t;const y=a.layout.gridHeight/a.globals.dataPoints,{zeroEncounters:v}=this.barCtx.barHelpers.getZeroValueEncounters({i:i,j:r});let C,w,P;if(h=Math.abs(h),this.barCtx.isPyramid){C=l+n/2+m-(null!=(e=d.centerOffset)?e:0)}else C=l-(this.barCtx.isRangeBar?0:y)+n/2+d.height/2+m-3;!a.config.chart.stacked&&v>0&&a.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(C-=n*v);let I="start";const L=a.seriesData.series[i][r]<0;let k=s;if(this.barCtx.isReversed&&(k=s+(L?-h:h),I=L?"start":"end"),this.barCtx.isPyramid)c=a.layout.gridWidth/2+f;else switch(p.position){case"center":c=L?k+h/2-f:Math.max(d.width/2,k-h/2)+f;break;case"bottom":c=L?k+h-u-f:k-h+u+f;break;case"top":c=L?k-u-f:k-u+f}let S=k;const D=this.getTotalGroupContext(o);if((D?[D.group]:a.labelData.seriesGroups).forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevX.forEach(t=>{S=L?Math.min(t[r],S):Math.max(t[r],S)})}),this.drawsStackedTotal(o)&&x.enabled){const t=new b(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:o,j:r}),g.fontSize);L?(w=S-u-f-x.offsetX,I="end"):w=S+f+x.offsetX+(this.barCtx.isReversed?-(h+u):u),P=C-d.height/2+t.height/2+x.offsetY+u,a.globals.barGroups.length>1&&!D&&(P-=a.globals.barGroups.length/2*(n/2))}if(!a.config.chart.stacked){const t=L&&"middle"!==g.textAnchor?"start"===g.textAnchor?"end":"start":g.textAnchor;let e;e="vertical"===p.orientation?d.height/2:"end"===t?d.width:"middle"===t?d.width/2:0;const s=("vertical"===p.orientation?d.height:d.width)-e;c+s>a.layout.gridWidth-u&&(c=a.layout.gridWidth-s-u),c-e<u&&(c=e+u)}return{bcx:s,bcy:l,dataLabelsX:c,dataLabelsY:C,totalDataLabelsX:w,totalDataLabelsY:P,totalDataLabelsAnchor:I}}drawCalculatedDataLabels({x:t,y:e,val:a,i:s,j:i,textRects:r,barHeight:o,barWidth:h,dataLabelsConfig:d}){var c,g,p;const x=this.w;let f="rotate(0)";"vertical"===x.config.plotOptions.bar.dataLabels.orientation&&(f=`rotate(-90, ${t}, ${e})`);const y=new u(this.barCtx.w,this.barCtx.ctx),v=new b(this.barCtx.w),C=d.formatter;let w=null;const P=x.globals.collapsedSeriesIndices.indexOf(s)>-1,I=(x.globals.collapsingSeriesIndices||[]).indexOf(s)>-1;if(I){const t=null==(c=x.globals.prevDataLabels)?void 0:c.get(`${s}::${m(x,s,i)}`);t&&isFinite(t.val)&&(a=t.val)}if(d.enabled&&(!P||I)){w=v.group({class:"apexcharts-data-labels",transform:f});const c=x.config.dataLabels;((null==(g=c.animate)?void 0:g.enabled)||(null==(p=c.countUp)?void 0:p.enabled))&&(w.node.setAttribute("data:dlKey",`${s}::${m(x,s,i)}`),w.node.setAttribute("data:dlJ",String(i)),"number"==typeof a&&isFinite(a)&&w.node.setAttribute("data:dlVal",String(a)));let b="";void 0!==a&&(b=C(a,n(l({},x),{seriesIndex:s,dataPointIndex:i,w:x}))),!a&&x.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(b="");const u=x.seriesData.series[s][i]<0,P=x.config.plotOptions.bar.dataLabels.position;if("vertical"===x.config.plotOptions.bar.dataLabels.orientation&&("top"===P&&(d.textAnchor=u?"end":"start"),"center"===P&&(d.textAnchor="middle"),"bottom"===P&&(d.textAnchor=u?"end":"start")),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels){h<v.getTextRects(b,parseFloat(d.style.fontSize).toString()).width&&(b="")}x.config.chart.stacked&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&!I&&(this.barCtx.isHorizontal?r.width/1.6>Math.abs(h)&&(b=""):r.height/1.6>Math.abs(o)&&(b=""));const L=l({},d);this.barCtx.isHorizontal&&a<0&&("start"===d.textAnchor?L.textAnchor="end":"end"===d.textAnchor&&(L.textAnchor="start")),y.plotDataLabelsText({x:t,y:e,text:b,i:s,j:i,parent:w,dataLabelsConfig:L,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return w}drawTotalDataLabels({x:t,y:e,val:a,rawVal:s,realIndex:i,j:r,textAnchor:o,barTotalDataLabelsConfig:l}){var n,h;const d=new b(this.barCtx.w);let c;if(l.enabled&&void 0!==t&&void 0!==e&&this.drawsStackedTotal(i)){c=d.drawText({x:t,y:e,foreColor:l.style.color,text:a,textAnchor:o,fontFamily:l.style.fontFamily,fontSize:l.style.fontSize,fontWeight:l.style.fontWeight}),c.attr({class:"apexcharts-datalabel-total",cx:t,cy:e});const b=this.w.config.dataLabels;if((null==(n=b.animate)?void 0:n.enabled)||(null==(h=b.countUp)?void 0:h.enabled)){const{groupIndex:t}=this.barCtx.barHelpers.getGroupIndex(i);c.node.setAttribute("data:dlTotalKey",`${t}::${m(this.w,i,r)}`),c.node.setAttribute("data:dlTotalSeries",String(i)),"number"==typeof s&&isFinite(s)&&c.node.setAttribute("data:dlTotalVal",String(s))}}return c}}const P=d.__apex_Series,I=d.__apex_Fill,L=d.__apex_Utils;function k(t){var e,a,s,i,r,o,l;return"histogram"===(null==(a=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:a.requestedType)&&(!1!==(null==(i=null==(s=t.config.plotOptions)?void 0:s.histogram)?void 0:i.overlap)&&(null!=(l=null==(o=null==(r=t.seriesData)?void 0:r.series)?void 0:o.length)?l:0)>1)}class S{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 a=0;a<t.length;a++)if(t[a].length>0&&(this.barCtx.seriesLen=this.barCtx.seriesLen+1,this.barCtx.totalItems+=t[a].length),e.axisFlags.isXNumeric)for(let s=0;s<t[a].length;s++)e.seriesData.seriesX[a][s]>e.globals.minX&&e.seriesData.seriesX[a][s]<e.globals.maxX&&this.barCtx.visibleItems++;else this.barCtx.visibleItems=e.globals.dataPoints;this.arrBorderRadius=this.createBorderRadiusArr(e.seriesData.series),L.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 a=t.globals.maxX-t.globals.minX;e=a>0?a/4:0}else if(e=this._unionMinXGap(),!(e>0&&isFinite(e))){const a=t.globals.minXDiff;e=a>0&&isFinite(a)&&.5!==a?a:0}return this._slotXSpan=e,e}_unionMinXGap(){const t=this.w.seriesData.seriesX||[],e=[];for(let a=0;a<t.length;a++){const s=t[a];Array.isArray(s)&&s.length>0&&e.push(s)}if(!e.length)return 0;const a=new Array(e.length).fill(0);let s=NaN,i=1/0;for(;;){let t=1/0,r=-1;for(let s=0;s<e.length;s++){const i=e[s];for(;a[s]<i.length&&"number"!=typeof i[a[s]];)a[s]++;if(a[s]>=i.length)continue;const o=i[a[s]];o==o?o<t&&(t=o,r=s):(a[s]++,s--)}if(-1===r)break;if(a[r]++,s==s){const e=t-s;e>0&&e<i&&(i=e)}s=t}return isFinite(i)?i:0}initialPositions(t){const e=this.w;let a,s,i,r,o,l,n,h,d=e.globals.dataPoints;this.barCtx.isRangeBar&&(d=e.labelData.labels.length);let c=this.barCtx.seriesLen;if((e.config.plotOptions.bar.rangeBarGroupRows||k(e))&&(c=1),this.barCtx.isHorizontal)i=e.layout.gridHeight/d,o=i/c,e.axisFlags.isXNumeric&&(i=e.layout.gridHeight/this.barCtx.totalItems,o=i/this.barCtx.seriesLen),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),s=(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),l=r/c*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),l=r/c*parseInt(this.barCtx.barOptions.columnWidth,10)/100,l<1&&(l=1)}if(-1===String(this.barCtx.barOptions.columnWidth).indexOf("%")&&(l=parseInt(this.barCtx.barOptions.columnWidth,10)),n=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){a=this.barCtx.getBarXForNumericXAxis({x:a,j:0,realIndex:t,barWidth:l}).x}else a=e.globals.padHorizontal+L.noExponents(r-l*this.barCtx.seriesLen)/2}return e.globals.barHeight=o,e.globals.barWidth=l,{x:a,y:s,yDivision:i,xDivision:r,barHeight:o,barWidth:l,zeroH:n,zeroW:h}}initializeStackedPrevVars(t){t.w.labelData.seriesGroups.forEach(e=>{t[e]||(t[e]={}),t[e].prevY=[],t[e].prevX=[],t[e].prevYF=[],t[e].prevXF=[],t[e].prevYVal=[],t[e].prevXVal=[]})}initializeStackedXYVars(t){t.w.labelData.seriesGroups.forEach(e=>{t[e]||(t[e]={}),t[e].xArrj=[],t[e].xArrjF=[],t[e].xArrjVal=[],t[e].yArrj=[],t[e].yArrjF=[],t[e].yArrjVal=[]})}getPathFillColor(t,e,a,s){var i;const r=this.w,o=new I(this.barCtx.w);let l=null;const n=this.barCtx.barOptions.distributed?a:e;let h=!1;if(this.barCtx.barOptions.colors.ranges.length>0){this.barCtx.barOptions.colors.ranges.map(s=>{t[e][a]>=s.from&&t[e][a]<=s.to&&(l=s.color,h=!0)})}const d=this.getDumbbellConnectorFill(e,a)||(null==(i=r.config.series[e].data[a])?void 0:i.fill),c=this.barCtx.barOptions.isDumbbell?r.config.plotOptions.bar.dumbbell.connector:null;let b;c&&c.color&&(l=c.color,b=c.opacity);return{color:o.fillPath({seriesNumber:this.barCtx.barOptions.distributed?n:s,dataPointIndex:a,color:l,opacity:b,value:t[e][a],fillConfig:d,fillType:(null==d?void 0:d.type)?d.type:Array.isArray(r.config.fill.type)?r.config.fill.type[s]:r.config.fill.type}),useRangeColor:h}}getDumbbellConnectorFill(t,e){const a=this.w;if(!this.barCtx.barOptions.isDumbbell)return null;const s=a.dumbbellData;if(!s||"series"!==s.form)return null;const i=a.config.plotOptions.bar.dumbbell.connector;if(i.color)return null;const r=s.order[e];if(!r)return null;const o=a.globals.colors[r[0]],l=a.globals.colors[r[1]];return o&&l?{type:"gradient",gradient:{type:this.barCtx.isHorizontal?"horizontal":"vertical",gradientFrom:o,gradientTo:l,opacityFrom:i.opacity,opacityTo:i.opacity,stops:[0,100],inverseColors:!this.barCtx.isHorizontal}}:null}getStrokeWidth(t,e,a){let s=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||(s=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[a]:this.barCtx.strokeWidth)),s}getStackedSeriesIndices(t){const e=this.w,a=e.labelData.seriesGroups,s=e.globals.columnSeries?new Set(e.globals.columnSeries.i):null,i=t=>!s||s.has(t);if(!a||a.length<2){const e=Array.from({length:t},(t,e)=>e).filter(i);return e.length?[e]:[]}const r=Array.from({length:a.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 a=this.w,s=!this.w.config.chart.stacked||a.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(s?"top":"none"));if(s)return o;const l="bar"===this.w.config.chart.type&&1===r,n=l?"top":"both",h=l?"top":"bottom";for(const e of this.getStackedSeriesIndices(i))for(let a=0;a<r;a++){const s=[],i=[];for(const r of e){const e=t[r][a];e>0?s.push(r):e<0&&i.push(r)}if(s.length>0&&0===i.length)if(1===s.length)o[s[0]][a]=n;else{const t=s[0],e=s[s.length-1];for(const i of s)o[i][a]=i===t?h:i===e?"top":"none"}else if(i.length>0&&0===s.length)if(1===i.length)o[i[0]][a]="both";else{const t=Math.max(...i),e=Math.min(...i);for(const s of i)o[s][a]=s===t?"bottom":s===e?"top":"none"}else if(s.length>0&&i.length>0){const t=s[s.length-1];for(const e of s)o[e][a]=e===t?"top":"none";const e=Math.max(...i);for(const t of i)o[t][a]=t===e?"bottom":"none"}}return o}barBackground({j:t,i:e,x1:a,x2:s,y1:i,y2:r,elSeries:o}){const l=this.w,n=new b(this.barCtx.w),h=new P(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=n.drawRect(void 0!==a?a:0,void 0!==i?i:0,void 0!==s?s:l.layout.gridWidth,void 0!==r?r:l.layout.gridHeight,this.barCtx.barOptions.colors.backgroundBarRadius,e,this.barCtx.barOptions.colors.backgroundBarOpacity);o.add(h),h.node.classList.add("apexcharts-backgroundBar")}}getColumnPaths({barWidth:t,barXPosition:e,y1:a,y2:s,strokeWidth:i,isReversed:r,series:o,seriesGroup:l,realIndex:n,i:h,j:d,w:c}){var u,g,p;const x=new b(this.barCtx.w);(i=Array.isArray(i)?i[n]:i)||(i=0);let f=t,m=e;(null==(u=c.config.series[n].data[d])?void 0:u.columnWidthOffset)&&(m=e-c.config.series[n].data[d].columnWidthOffset/2,f=t+c.config.series[n].data[d].columnWidthOffset);const y=i/2,v=m+y,C=m+f-y,w=(o[h][d]>=0?1:-1)*(r?-1:1);a+=.001-y*w,s+=.001+y*w;const P=x.line(C,a),I="around"===c.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[n][d]?" Z":" z",L=x.move(v,a)+x.line(v,s)+x.line(C,s)+P+I;let k=L;"none"!==this.arrBorderRadius[n][d]&&(k=x.roundPathCorners(k,c.config.plotOptions.bar.borderRadius));let S=null;const D=null==(p=null==(g=this.barCtx.ctx)?void 0:g.morphTypeChange)?void 0:p.getInitialPathFor(n,d);if(D?S=D:c.globals.previousPaths.length>0&&(S=this.barCtx.getPreviousPath(n,d,k,L)),null==S&&(S=x.move(v,a)+x.line(v,a)+P+P+P+P+P+x.line(v,a)+I),c.config.chart.stacked){let t=this.barCtx;t=this.barCtx[l],t.yArrj.push(s-y*w),t.yArrjF.push(Math.abs(a-s+i*w)),t.yArrjVal.push(this.barCtx.series[h][d])}return{pathTo:k,pathFrom:S,drawnBox:{x1:v,x2:C,y1:a,y2:s}}}getFunnelTrapezoidPaths({barYPosition:t,barHeight:e,series:a,i:s,j:i,realIndex:r,strokeWidth:o,w:l}){var n,h;const d=new b(this.barCtx.w),c=l.layout.gridWidth/2,u=t=>Math.abs(t/this.barCtx.invertedYRatio)/2,g=u(a[s][i]),p=i===a[s].length-1,x="taper"===l.config.plotOptions.funnel.lastShape?"taper":"flat";let f;f=p?"taper"===x?0:g:u(a[s][i+1]);const m=o/2,y=t+m,v=t+e-m,C=c-g,w=c+g,P=c-f,I=c+f,L=d.move(C,y)+d.line(w,y)+d.line(I,v)+d.line(P,v)+" Z";let k=null;const S=null==(h=null==(n=this.barCtx.ctx)?void 0:n.morphTypeChange)?void 0:h.getInitialPathFor(r,i);return S?k=S:l.globals.previousPaths.length>0&&(k=this.barCtx.getPreviousPath(r,i,L)),null==k&&(k=d.move(c,y)+d.line(c,y)+d.line(c,v)+d.line(c,v)+" Z"),{pathTo:L,pathFrom:k,x:w,x1:C,barXPosition:c}}computePyramidLayout(t){const e=this.w,a=e.layout.gridHeight,s=e.layout.gridWidth,i=t.map(t=>Math.abs(Number(t)||0)),r=i.reduce((t,e)=>t+e,0);if(0===r||a<=0)return i.map(()=>({y:0,height:0,topHalf:0,bottomHalf:0}));const o=s/2;let l=0;const n=[];for(let t=0;t<i.length;t++){const e=l/r;l+=i[t];const s=l/r,h=e*a,d=s*a;n.push({y:h,height:d-h,topHalf:e*o,bottomHalf:s*o})}return n}getPyramidPaths({barYPosition:t,barHeight:e,topHalf:a,bottomHalf:s,realIndex:i,j:r,strokeWidth:o,w:l}){var n,h;const d=new b(this.barCtx.w),c=l.layout.gridWidth/2,u=o/2,g=t+u,p=t+e-u,x=c-a,f=c+a,m=c-s,y=c+s,v=d.move(x,g)+d.line(f,g)+d.line(y,p)+d.line(m,p)+" Z";let C=null;const w=null==(h=null==(n=this.barCtx.ctx)?void 0:n.morphTypeChange)?void 0:h.getInitialPathFor(i,r);return w?C=w:l.globals.previousPaths.length>0&&(C=this.barCtx.getPreviousPath(i,r,v)),null==C&&(C=d.move(c,g)+d.line(c,g)+d.line(c,p)+d.line(c,p)+" Z"),{pathTo:v,pathFrom:C,x:f,x1:x,barXPosition:c}}getBarpaths({barYPosition:t,barHeight:e,x1:a,x2:s,strokeWidth:i,isReversed:r,series:o,seriesGroup:l,realIndex:n,i:h,j:d,w:c}){var u,g,p;const x=new b(this.barCtx.w);(i=Array.isArray(i)?i[n]:i)||(i=0);let f=t,m=e;(null==(u=c.config.series[n].data[d])?void 0:u.barHeightOffset)&&(f=t-c.config.series[n].data[d].barHeightOffset/2,m=e+c.config.series[n].data[d].barHeightOffset);const y=i/2,v=f+y,C=f+m-y,w=(o[h][d]>=0?1:-1)*(r?-1:1);a+=.001+y*w,s+=.001-y*w;const P=this.barCtx.isFunnel,I=P?(a+s)/2:a,L=x.line(a,C),k="around"===c.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[n][d]?" Z":" z",S=x.move(a,v)+x.line(s,v)+x.line(s,C)+L+k;let D=S;"none"!==this.arrBorderRadius[n][d]&&(D=x.roundPathCorners(D,c.config.plotOptions.bar.borderRadius));let H=null;const A=null==(p=null==(g=this.barCtx.ctx)?void 0:g.morphTypeChange)?void 0:p.getInitialPathFor(n,d);if(A?H=A:c.globals.previousPaths.length>0&&(H=this.barCtx.getPreviousPath(n,d,D,S)),null==H){const t=P?x.line(I,C):L;H=x.move(I,v)+x.line(I,v)+t+t+t+t+t+x.line(I,v)+k}if(c.config.chart.stacked){let t=this.barCtx;t=this.barCtx[l],t.xArrj.push(s+y*w),t.xArrjF.push(Math.abs(a-s-i*w)),t.xArrjVal.push(this.barCtx.series[h][d])}return{pathTo:D,pathFrom:H,drawnBox:{x1:a,x2:s,y1:v,y2:C}}}getXForValue(t,e,a=!0){let s=a?e:null;return null!=t&&(s=e+t/this.barCtx.invertedYRatio-2*(this.barCtx.isReversed?t/this.barCtx.invertedYRatio:0)),s}getYForValue(t,e,a,s=!0){let i=s?e:null;return null!=t&&(i=e-t/this.barCtx.yRatio[a]+2*(this.barCtx.isReversed?t/this.barCtx.yRatio[a]:0)),i}getGoalValues(t,e,a,s,i,r){const o=this.w,h=[],d=(s,i)=>{h.push({[t]:"x"===t?this.getXForValue(s,e,!1):this.getYForValue(s,a,r,!1),attrs:i})};if(o.seriesData.seriesGoals[s]&&o.seriesData.seriesGoals[s][i]&&Array.isArray(o.seriesData.seriesGoals[s][i])&&o.seriesData.seriesGoals[s][i].forEach(t=>{d(t.value,t)}),this.barCtx.barOptions.isDumbbell){const e=this.getDumbbellEnds(s,i);if(e.length){const a={strokeHeight:"x"===t?0:o.globals.markers.size[s],strokeWidth:"x"===t?o.globals.markers.size[s]: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=n(l({},a),{strokeColor:t.color});!c.enabled||e!==r&&e!==h||(o.label={text:this.getDumbbellLabelText(t.value,s,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 a=this.w,s=[],i=a.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)&&s.push({value:r,color:a.globals.colors[e],index:e})}return s}if(!a.rangeData.seriesRange.length)return s;const r=this.barCtx.barOptions.dumbbellColors?this.barCtx.barOptions.dumbbellColors:a.globals.colors,o=e=>Array.isArray(r[t])?r[t][e]:r[t];return[{value:a.rangeData.seriesRangeStart[t][e],color:o(0),index:0},{value:a.rangeData.seriesRangeEnd[t][e],color:o(1),index:1}]}getDumbbellLabelText(t,e,a,s){const i=this.w,r=i.config.plotOptions.bar.dumbbell.dataLabels;if("function"==typeof r.formatter)return r.formatter(t,{seriesIndex:e,dataPointIndex:a,endpointIndex:s,w:i});const o=this.barCtx.isHorizontal?i.formatters.xLabelFormatter:i.formatters.yLabelFormatters[0];return"function"==typeof o?o(t,a,i):String(t)}drawGoalLine({barXPosition:t,barYPosition:e,goalX:a,goalY:s,barWidth:i,barHeight:r}){if(!(Array.isArray(a)&&a.length>0||Array.isArray(s)&&s.length>0))return null;const o=new b(this.barCtx.w),l=o.group({class:"apexcharts-bar-goals-groups"});l.node.classList.add("apexcharts-element-hidden"),this.barCtx.w.globals.delayedElements.push({el:l.node}),l.attr("clip-path",`url(#gridRectMarkerMask${this.barCtx.w.globals.cuid})`);let n=null;return this.barCtx.isHorizontal?Array.isArray(a)&&a.forEach(t=>{if(t.x>=-1&&t.x<=o.w.layout.gridWidth+1){const a=void 0!==t.attrs.strokeHeight?t.attrs.strokeHeight:r/2,s=e+a+r/2;n=o.drawLine(t.x,s-2*a,t.x,s,t.attrs.strokeColor?t.attrs.strokeColor:void 0,t.attrs.strokeDashArray,t.attrs.strokeWidth?t.attrs.strokeWidth:2,t.attrs.strokeLineCap),l.add(n),t.attrs.label&&l.add(this.drawDumbbellLabel(t.attrs,{x:t.x,y:s-a,horizontal:!0,markerSize:t.attrs.strokeWidth||0}))}}):Array.isArray(s)&&s.forEach(e=>{if(e.y>=-1&&e.y<=o.w.layout.gridHeight+1){const a=void 0!==e.attrs.strokeWidth?e.attrs.strokeWidth:i/2,s=t+a+i/2;n=o.drawLine(s-2*a,e.y,s,e.y,e.attrs.strokeColor?e.attrs.strokeColor:void 0,e.attrs.strokeDashArray,e.attrs.strokeHeight?e.attrs.strokeHeight:2,e.attrs.strokeLineCap),l.add(n),e.attrs.label&&l.add(this.drawDumbbellLabel(e.attrs,{x:s-a,y:e.y,horizontal:!1,markerSize:e.attrs.strokeHeight||0}))}}),l}drawDumbbellLabel(t,e){const a=this.w,s=new b(a),i=a.config.plotOptions.bar.dumbbell.dataLabels,r=e.markerSize/2+i.offset,o=t.label.outward;return s.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:a,realIndex:s,j:i}){const r=this.w,{x:o,x1:l,barYPosition:n}=t,{x:h,x1:d,barYPosition:c}=e,u=n+e.barHeight,g=new b(this.barCtx.w),p=new L,x=g.move(l,u)+g.line(o,u)+g.line(h,c)+g.line(d,c)+g.line(l,u)+("around"===r.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[s][i]?" Z":" z");return g.drawPath({d:x,fill:p.shadeColor(.5,L.rgb2hex(a)),stroke:"none",strokeWidth:0,fillOpacity:1,classes:"apexcharts-bar-shadow apexcharts-decoration-element"})}getZeroValueEncounters({i:t,j:e}){var a;const s=this.w;let i=0,r=0;return(s.config.plotOptions.bar.horizontal?s.seriesData.series.map((t,e)=>e):(null==(a=s.globals.columnSeries)?void 0:a.i.map(t=>t))||[]).forEach(a=>{const o=s.globals.seriesPercent[a][e];o&&i++,a<t&&0===o&&r++}),{nonZeroColumns:i,zeroEncounters:r}}getSeriesGroupIndex(t){const e=this.w;return e.labelData.seriesGroups.findIndex(a=>a.indexOf(e.seriesData.seriesNames[t])>-1)}getGroupIndex(t){const e=this.w,a=e.labelData.seriesGroups.findIndex(a=>a.indexOf(e.seriesData.seriesNames[t])>-1),s=this.barCtx.columnGroupIndices;let i=s.indexOf(a);return i<0&&(s.push(a),i=s.length-1),{groupIndex:a,columnGroupIndex:i}}}const D=d.__apex_Filters,H=d.__apex_Animations_computeStagger;class A{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)/A.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*A.xRatio(t)}static screenXToPlotPx(t,e){const a=t.dom.baseEl,s=a&&a.querySelector(".apexcharts-svg");if(!s)return e-t.layout.translateX;const i=s.getBoundingClientRect(),r=t.globals.svgWidth?i.width/t.globals.svgWidth:1;return(e-i.left)/(r||1)-t.layout.translateX}}class O{constructor(t,e,a){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=a,this.xRatio=0,this.yRatio=[],this.invertedXRatio=0,this.invertedYRatio=0,this.baseLineY=[],this.baseLineInvertedY=0,null!==this.xyRatios&&(this.xRatio=a.xRatio,this.yRatio=a.yRatio,this.invertedXRatio=a.invertedXRatio,this.invertedYRatio=a.invertedYRatio,this.baseLineY=a.baseLineY,this.baseLineInvertedY=a.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 s=new P(this.w);this.lastActiveBarSerieIndex=s.getActiveConfigSeriesIndex("desc",["bar","column"]),this.lastActiveBarSerieIndexByGroup=s.getActiveConfigSeriesIndexByGroup(["bar","column"]),this.columnGroupIndices=[];const i=s.getBarSeriesIndices(),r=new c(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)}draw(t,e){var a,s,i;const r=this.w,o=new b(this.w),h=new c(this.w);t=h.getLogSeries(t),this.series=t,this.yRatio=h.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const d=o.group({class:"apexcharts-bar-series apexcharts-plot-series"});r.config.dataLabels.enabled&&(this.totalItems,this.barOptions.dataLabels.maxItems);for(let h=0,c=0;h<t.length;h++,c++){let b,u;const g=[],p=[],x=r.globals.comboCharts?e[h]:h,{columnGroupIndex:f}=this.barHelpers.getGroupIndex(x),y=o.group({class:"apexcharts-series",rel:h+1,seriesName:L.escapeString(r.seriesData.seriesNames[x]),"data:realIndex":x});P.addCollapsedClassToSeries(this.w,y,x),t[h].length>0&&(this.visibleI=this.visibleI+1),this.yRatio.length>1&&(this.yaxisIndex=r.globals.seriesYAxisReverseMap[x],this.translationsIndex=x);const v=this.translationsIndex;this.isReversed=r.config.yaxis[this.yaxisIndex]&&r.config.yaxis[this.yaxisIndex].reversed,this.isPyramid&&(this.pyramidLayout=this.barHelpers.computePyramidLayout(t[h]));const w=this.barHelpers.initialPositions(x),{y:I,yDivision:k,zeroW:S,x:H,xDivision:A,zeroH:O}=w;let X=w.barHeight,W=w.barWidth;u=I,b=H,this.isHorizontal||p.push(b+(null!=W?W:0)/2);const F=o.group({class:"apexcharts-datalabels","data:realIndex":x});r.globals.delayedElements.push({el:F.node,holdUntilComplete:!(null==(a=r.config.dataLabels.animate)?void 0:a.enabled)&&this.isLengthTransition(x)}),F.node.classList.add("apexcharts-element-hidden");const R=o.group({class:"apexcharts-bar-goals-markers"}),B=o.group({class:"apexcharts-bar-shadows"});r.globals.delayedElements.push({el:B.node}),B.node.classList.add("apexcharts-element-hidden");for(let e=0;e<t[h].length;e++){const a=this.barHelpers.getStrokeWidth(h,e,x);let o=null;const d={indexes:{i:h,j:e,realIndex:x,translationsIndex:v,bc:c},x:b,y:u,strokeWidth:a,elSeries:y};this.isHorizontal?(o=this.drawBarPaths(n(l({},d),{barHeight:X,zeroW:S,yDivision:k})),W=this.series[h][e]/this.invertedYRatio):(o=this.drawColumnPaths(n(l({},d),{xDivision:A,barWidth:W,zeroH:O})),X=this.series[h][e]/this.yRatio[v]);const m=this.barHelpers.getPathFillColor(t,h,e,x);if(this.isFunnel&&!this.isPyramid&&this.barOptions.isFunnel3d&&"trapezoid"!==(null==(s=r.config.plotOptions.funnel)?void 0:s.shape)&&this.pathArr.length&&e>0){const t=this.barHelpers.drawBarShadow({color:"string"==typeof m.color&&-1===(null==(i=m.color)?void 0:i.indexOf("url"))?m.color:L.hexToRgba(r.globals.colors[h]),prevPaths:this.pathArr[this.pathArr.length-1],currPaths:o,realIndex:x,j:e});if(B.add(t),r.config.chart.dropShadow.enabled){new D(this.w).dropShadow(t,r.config.chart.dropShadow,x)}}this.pathArr.push(o);const C=this.barHelpers.drawGoalLine({barXPosition:o.barXPosition,barYPosition:o.barYPosition,goalX:o.goalX,goalY:o.goalY,barHeight:X,barWidth:W});C&&R.add(C),u=o.y,b=o.x,e>0&&p.push(b+(null!=W?W:0)/2),g.push(u),this.renderSeries(n(l({realIndex:x,pathFill:m.color},m.useRangeColor?{lineFill:m.color}:{}),{j:e,i:h,columnGroupIndex:f,pathFrom:o.pathFrom,pathTo:o.pathTo,strokeWidth:a,elSeries:y,x:b,y:u,series:t,barHeight:Math.abs(o.barHeight?o.barHeight:X),barWidth:Math.abs(o.barWidth?o.barWidth:W),elDataLabelsWrap:F,elGoalsMarkers:R,elBarShadows:B,visibleSeries:this.visibleI,type:"bar"}))}if(r.globals.seriesXvalues[x]=p,r.globals.seriesYvalues[x]=g,r.globals.previousPaths.length>0){const e=[];for(let a=0;a<t[h].length;a++)e.push(m(r,x,a));C({w:r,elSeries:y,record:this._prevRecord(x),newKeys:e,isHorizontal:this.isHorizontal,speed:r.config.chart.animations.dynamicAnimation.speed})}d.add(y)}return d}renderSeries({realIndex:t,pathFill:e,lineFill:a,j:s,i:i,columnGroupIndex:r,pathFrom:o,pathTo:l,strokeWidth:n,elSeries:h,x:d,y:c,y1:u,y2:g,series:p,barHeight:x,barWidth:f,barXPosition:y,barYPosition:v,elDataLabelsWrap:C,elGoalsMarkers:P,elBarShadows:I,visibleSeries:L,type:k,classes:S}){var A,O,X,W,F,R,B;const T=this.w,M=new b(this.w,this.ctx),z=function(t,e){const a=t&&t.renderer;return a&&a.kind&&"svg"!==a.kind?a:e}(this.ctx,M);let j=!1;const Y=this._pathToInterp;if(this._pathToInterp=null,h._bindingsDelegated||(h._bindingsDelegated=!0,M.setupEventDelegation(h,`.apexcharts-${k}-area`)),!a){let e=function(t){const e=T.config.stroke.colors;let a;return Array.isArray(e)&&e.length>0&&(a=e[t],a||(a=""),"function"==typeof a)?a({value:T.seriesData.series[t][s],dataPointIndex:s,w:T}):a};const i="function"==typeof T.globals.stroke.colors[t]?e(t):T.globals.stroke.colors[t];a=this.barOptions.distributed?T.globals.stroke.colors[s]:i}const _=T.config.chart.animations,G=_.animateGradually;let $=0,V=0;if(G&&!1!==G.enabled&&!(T.globals.dataChanged&&this.isLayoutShift(t))){const t=T.globals.dataPoints||1,e=G.delay||0,a=Math.min(e,.5*_.speed/Math.max(1,t));V=H({style:"sequential",index:s,baseDelay:a}),T.config.chart.stacked&&!T.globals.dataChanged&&(V+=i*a*.5);$=V/(e||1)}const E=new w(this).handleBarDataLabels({x:d,y:c,y1:u,y2:g,i:i,j:s,series:p,realIndex:t,columnGroupIndex:r,barHeight:x,barWidth:f,barXPosition:y,barYPosition:v,visibleSeries:L});if(V>0){const t=T.config.dataLabels;if((null==(A=t.animate)?void 0:A.enabled)||(null==(O=t.countUp)?void 0:O.enabled)){const t=String(Math.round(V));null==(W=null==(X=E.dataLabels)?void 0:X.node)||W.setAttribute("data:dlDelay",t),null==(R=null==(F=E.totalDataLabels)?void 0:F.node)||R.setAttribute("data:dlDelay",t)}}if(T.globals.isBarHorizontal||(E.dataLabelsPos.dataLabelsX+Math.max(f,T.globals.barPadForNumericAxis)<0||E.dataLabelsPos.dataLabelsX-Math.max(f,T.globals.barPadForNumericAxis)>T.layout.gridWidth)&&(j=!0),T.config.series[i].data[s]&&T.config.series[i].data[s].strokeColor&&(a=T.config.series[i].data[s].strokeColor),this.isNullValue&&-1===T.globals.collapsingSeriesIndices.indexOf(t)&&(e="none"),!j){const r=!0===(null==(B=this.ctx.morphTypeChange)?void 0:B.isActive()),d=r?this.ctx.morphTypeChange.getSpeed():T.config.chart.animations.dynamicAnimation.speed,c=r&&this.ctx.morphTypeChange.claimsTargetMark(t,s);c&&(o=l,$=0);const b=z.renderPaths({i:i,j:s,realIndex:t,pathFrom:o,pathTo:l,stroke:a,strokeWidth:n,strokeLineCap:T.config.stroke.lineCap,fill:e,pathToInterp:Y,animationDelay:$,initialSpeed:T.config.chart.animations.speed,dataChangeSpeed:d,className:`apexcharts-${k}-area${S?` ${S}`:""}`,chartType:k,bindEventsOnPaths:!1});b.attr("clip-path",`url(#gridRectBarMask${T.globals.cuid})`),c&&(b.node.setAttribute("opacity","0"),b.node.setAttribute("data-piece-hidden","1"));const p=T.config.forecastDataPoints;p.count>0&&s>=T.globals.dataPoints-p.count&&(b.node.setAttribute("stroke-dasharray",p.dashArray),b.node.setAttribute("stroke-width",p.strokeWidth),b.node.setAttribute("fill-opacity",p.fillOpacity)),void 0!==u&&void 0!==g&&(b.attr("data-range-y1",u),b.attr("data-range-y2",g));new D(this.w).setSelectionFilter(b,t,s),h.add(b),b.attr({cy:E.dataLabelsPos.bcy,cx:E.dataLabelsPos.bcx,j:s,val:T.seriesData.series[i][s],barHeight:x,barWidth:f,"data:pathKey":m(T,t,s)}),"canvas"===z.kind&&(T.globals.barCanvasCoords||(T.globals.barCanvasCoords={}),T.globals.barCanvasCoords[t]||(T.globals.barCanvasCoords[t]={}),T.globals.barCanvasCoords[t][s]={cx:E.dataLabelsPos.bcx,cy:E.dataLabelsPos.bcy,barWidth:f}),null!==E.dataLabels&&C.add(E.dataLabels),E.totalDataLabels&&C.add(E.totalDataLabels),h.add(C),P&&h.add(P),I&&h.add(I)}return h}drawBarPaths({indexes:t,barHeight:e,strokeWidth:a,zeroW:s,x:i,y:r,yDivision:o,elSeries:l}){const n=this.w,h=t.i,d=t.j;let c;if(n.axisFlags.isXNumeric)c=(r=(n.seriesData.seriesX[h][d]-n.globals.minX)/this.invertedXRatio-e)+e*this.visibleI;else if(n.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:a}=this.barHelpers.getZeroValueEncounters({i:h,j:d});t>0&&(e=this.seriesLen*e/t),c=r+e*this.visibleI,c-=e*a}else c=r+e*this.visibleI;const b=this.isFunnel&&"trapezoid"===n.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!=s?s:0;s=t-(this.barHelpers.getXForValue(this.series[h][d],t)-t)/2}let p;return i=this.barHelpers.getXForValue(this.series[h][d],null!=s?s:0),p=u?this.barHelpers.getPyramidPaths({barYPosition:c,barHeight:e,topHalf:u.topHalf,bottomHalf:u.bottomHalf,realIndex:t.realIndex,j:d,strokeWidth:a,w:n}):b?this.barHelpers.getFunnelTrapezoidPaths({barYPosition:c,barHeight:e,series:this.series,i:h,j:d,realIndex:t.realIndex,strokeWidth:a,w:n}):this.barHelpers.getBarpaths({barYPosition:c,barHeight:e,x1:s,x2:i,strokeWidth:a,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:h,j:d,w:n}),(b||g)&&(s=p.x1,i=p.x),n.axisFlags.isXNumeric||g||(r+=o),g&&(r=c),this.barHelpers.barBackground({j:d,i:h,y1:c-e*this.visibleI,y2:e*this.seriesLen,elSeries:l}),{pathTo:p.pathTo,pathFrom:p.pathFrom,x1:s,x:i,y:r,goalX:this.barHelpers.getGoalValues("x",s,null,t.realIndex,d,0),barYPosition:c,barHeight:e}}drawColumnPaths({indexes:t,x:e,y:a,xDivision:s,barWidth:i,zeroH:r,strokeWidth:o,elSeries:l}){const n=this.w,h=t.realIndex,d=t.translationsIndex,c=t.i,b=t.j,u=t.bc;let g;if(n.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:b,realIndex:h,barWidth:i});e=t.x,g=t.barXPosition}else if(n.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:a}=this.barHelpers.getZeroValueEncounters({i:c,j:b});t>0&&(i=this.seriesLen*i/t),g=e+i*this.visibleI,g-=i*a}else g=e+i*this.visibleI;a=this.barHelpers.getYForValue(this.series[c][b],r,d);const p=this.barHelpers.getColumnPaths({barXPosition:g,barWidth:i,y1:r,y2:a,strokeWidth:o,isReversed:this.isReversed,series:this.series,realIndex:h,i:c,j:b,w:n});return n.axisFlags.isXNumeric||(e+=s),this.barHelpers.barBackground({bc:u,j:b,i:c,x1:g-o/2-i*this.visibleI,x2:i*this.seriesLen+o/2,elSeries:l}),{pathTo:p.pathTo,pathFrom:p.pathFrom,x:e,y:a,goalY:this.barHelpers.getGoalValues("y",null,r,h,b,d),barXPosition:g,barWidth:i}}getBarXForNumericXAxis({x:t,barWidth:e,realIndex:a,j:s}){const i=this.w;let r=a;return i.seriesData.seriesX[a].length||(r=i.globals.maxValsInArrayIndex),L.isNumber(i.seriesData.seriesX[r][s])&&(t=A.dataXToPx(i,i.seriesData.seriesX[r][s])-e*this.seriesLen/2),{barXPosition:t+(k(i)?0:e*this.visibleI),x:t}}_prevRecord(t){const e=this.w;let a=null;for(let s=0;s<e.globals.previousPaths.length;s++){const i=e.globals.previousPaths[s];i.paths&&i.paths.length>0&&parseInt(i.realIndex,10)===parseInt(String(t),10)&&(a=i)}return a}_prevKeyedPaths(t){if(this._prevKeyed||(this._prevKeyed={}),void 0!==this._prevKeyed[t])return this._prevKeyed[t];const e=this._prevRecord(t);let a=null;if(e&&e.paths.every(t=>null!=t.key)){const t=new Map;e.paths.forEach(e=>{t.set(e.key,e)}),a=t}return this._prevKeyed[t]=a,a}isLengthTransition(t){var e,a;if(this._ltCache||(this._ltCache={}),void 0!==this._ltCache[t])return this._ltCache[t];const s=this.w;let i=!1;if(f(s)&&s.globals.previousPaths.length>0){const r=this._prevRecord(t),o=null!=(a=null==(e=s.seriesData.series[t])?void 0:e.length)?a:0;if(r)if(r.paths.length!==o)i=!0;else{const e=this._prevKeyedPaths(t);if(e)for(let a=0;a<o;a++)if(!e.has(m(s,t,a))){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=v(this.w,t,!0,!0),a=!(!e||!e.join.changed);return this._layoutShiftCache[t]=a,a}getPreviousPath(t,e,a,s){const i=this.w;this._pathToInterp=null;const r=this._prevRecord(t);if(!r)return f(i)?null:a;let o=null,l=!1;const n=this._prevKeyedPaths(t);if(n){const a=n.get(m(i,t,e));a?o=a.d:l=!0}else void 0!==r.paths[e]?o=r.paths[e].d:l=!0;if(o){const t=O.pathCommandCount(o),e=O.pathCommandCount(a);if(t===e)return o;const r=new b(i),l=t=>{const e=O.pathBox(t);return e?Math.min(e.maxX-e.minX,e.maxY-e.minY):0},n=t<e?l(o)>1:l(a)>1;if(t<e){const t=r.roundPathCorners(o,0);if(O.pathCommandCount(t)===e){if(n&&s){const t=r.roundPathCorners(s,0);O.pathCommandCount(t)===e&&(this._pathToInterp=t)}return t}}else{const e=r.roundPathCorners(a,0);if(O.pathCommandCount(e)===t){if(this._pathToInterp=e,n){const e=O.squareLike(o),a=e?r.roundPathCorners(e,0):null;if(a&&O.pathCommandCount(a)===t)return a}return o}}}return l&&f(i)?null:a}static pathBox(t){if(!t)return null;const e=[],a=/([MLC])([^MLCZz]*)/g;let s;for(;null!==(s=a.exec(t));){const t=s[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=O.pathBox(t);if(!e)return null;const{minX:a,maxX:s,minY:i,maxY:r,start:o,vertical:l}=e,n=(t,e,a)=>Math.abs(t-e)<=Math.abs(t-a)?[e,a]:[a,e];let h,d,c,b;l?(h=Math.abs(o[0]-a)<=Math.abs(o[0]-s)?a:s,d=h===a?s:a,[c,b]=n(o[1],i,r)):(c=Math.abs(o[1]-i)<=Math.abs(o[1]-r)?i:r,b=c===i?r:i,[h,d]=n(o[0],a,s));const u=t.trim().endsWith("Z")?" Z":" z";return l?`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 a=this.w,s=this._prevRecord(t);if(!s)return null;const i=this._prevKeyedPaths(t),r=i?i.get(m(a,t,e)):s.paths[e];return r?!!r.flip:null}static pathCommandCount(t){if(!t)return 0;const e=t.match(/[A-Za-z]/g);return e?e.length:0}}function X({w:t,points:e,seedA:a,seedB:s,center:i,halfExtent:r,alongFn:o,isHorizontal:l,options:n,clampAt:h,sideSign:d}){const c=n;if(!c||!1===c.show)return[];if(!e||!e.length)return[];const b=c.maxPoints||3e3,u=e.length>b?Math.ceil(e.length/b):1,g=null!=c.size?c.size:2.5,p=r*(null!=c.jitter?c.jitter:.5),x=!1!==c.constrainToViolin&&"function"==typeof h,f="square"===c.shape,m=c.colorScale,y=m&&Array.isArray(m.colors)&&m.colors.length>0,v=y?Math.max(2,m.steps||24):1,C=y&&null!=m.min?m.min:t.globals.minY,w=(y&&null!=m.max?m.max:t.globals.maxY)-C||1,P=y?new Array(v).fill(""):[""];for(let t=0;t<e.length;t+=u){const r=e[t],n=o(r);let c=2*(B(7919*a+100003*s+t)-.5)*p;if(x){const t=h(r);c>t&&(c=t),c<-t&&(c=-t)}d&&(c=Math.abs(c)*d);const b=l?n:i+c,u=l?i+c:n,m=f?M(b,u,g):T(b,u,g);if(y){let t=(r-C)/w;t<0&&(t=0),t>1&&(t=1),P[Math.round(t*(v-1))]+=m}else P[0]+=m}if(!y)return P[0]?[{fill:null,d:P[0]}]:[];const I=[];for(let t=0;t<v;t++)P[t]&&I.push({fill:R(m.colors,t/(v-1)),d:P[t]});return I}function W({graphics:t,w:e,elSeries:a,pointsByCat:s,options:i,distributed:r,realIndex:o,wrapClass:l,pointClass:n}){if(!i||!1===i.show||!s.length)return;const h=null!=i.opacity?i.opacity:.9,d=null!=i.strokeColor?i.strokeColor:"#fff",c=null!=i.strokeWidth?i.strokeWidth:1,b=e.config.chart.animations.enabled&&!e.globals.resized&&!e.globals.dataChanged,u=t.group({class:b?`${l} apexcharts-element-hidden`:l});b&&e.globals.delayedElements.push({el:u.node}),s.forEach(({groups:a,j:s})=>{const l=r?e.globals.colors[s]:e.globals.colors[o],b=i.fillColor,g="series"===b?l:"series-dark"===b?F(l,.45):b||F(l,.45);a.forEach(a=>{const i=t.drawPath({d:a.d,fill:null!=a.fill?a.fill:g,stroke:c>0?d:"none",strokeWidth:c,fillOpacity:h,classes:n});i.attr("data:realIndex",o),i.attr("j",s),i.attr("clip-path",`url(#gridRectBarMask${e.globals.cuid})`),i.node.style.pointerEvents="none",u.add(i)})}),a.add(u)}function F(t,e){const a=L.parseHex(t);if(!a)return t;const s=Math.max(0,1-e);return`rgb(${Math.round(a[0]*s)},${Math.round(a[1]*s)},${Math.round(a[2]*s)})`}function R(t,e){if(!t.length)return"#000";if(1===t.length)return t[0];const a=Math.max(0,Math.min(1,e))*(t.length-1),s=Math.floor(a),i=a-s,r=L.parseHex(t[s])||[0,0,0],o=L.parseHex(t[Math.min(s+1,t.length-1)])||r,l=(t,e)=>Math.round(t+(e-t)*i);return`rgb(${l(r[0],o[0])},${l(r[1],o[1])},${l(r[2],o[2])})`}function B(t){let e=(2654435769^t)>>>0;return e=Math.imul(e^e>>>16,73244475),e=Math.imul(e^e>>>16,73244475),((e^e>>>16)>>>0)/4294967296}function T(t,e,a){return`M ${t-a} ${e} a ${a} ${a} 0 1 0 ${2*a} 0 a ${a} ${a} 0 1 0 ${-2*a} 0 `}function M(t,e,a){return`M ${t-a} ${e-a} h ${2*a} v ${2*a} h ${-2*a} z `}class z extends O{draw(t,e,a){var s;const i=this.w,r=new b(this.w),o=i.globals.comboCharts?e:i.config.chart.type,h=new I(this.w);this.candlestickOptions=this.w.config.plotOptions.candlestick,this.boxOptions=this.w.config.plotOptions.boxPlot,this.isHorizontal=i.config.plotOptions.bar.horizontal,this.isOHLC=this.candlestickOptions&&"ohlc"===this.candlestickOptions.type,this.coreUtils=new c(this.w),t=this.coreUtils.getLogSeries(t),this.series=t,this.yRatio=this.coreUtils.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const d=r.group({class:`apexcharts-${o}-series apexcharts-plot-series`});for(let e=0;e<t.length;e++){let o,c;this.isBoxPlot="boxPlot"===i.config.chart.type||"boxPlot"===i.config.series[e].type;const b=[],u=[],g=i.globals.comboCharts?a[e]:e,{columnGroupIndex:p}=this.barHelpers.getGroupIndex(g),x=r.group({class:"apexcharts-series",seriesName:L.escapeString(i.seriesData.seriesNames[g]),rel:e+1,"data:realIndex":g});P.addCollapsedClassToSeries(this.w,x,g),t[e].length>0&&(this.visibleI=this.visibleI+1);let f=0;this.yRatio.length>1&&(this.yaxisIndex=i.globals.seriesYAxisReverseMap[g][0],f=g);const m=this.barHelpers.initialPositions(g),{y:y,barHeight:v,yDivision:C,zeroW:w,x:I,barWidth:k,xDivision:S,zeroH:D}=m;c=y,o=I,u.push(o+(null!=k?k:0)/2);const H=r.group({class:"apexcharts-datalabels","data:realIndex":g}),A=r.group({class:"apexcharts-bar-goals-markers"}),O=this.isBoxPlot?this.boxOptions.points:null,F=[],R=i.layout.gridWidth,B=null!=k?k:0;for(let a=0;a<i.globals.dataPoints;a++){const r=this.barHelpers.getStrokeWidth(e,a,g);let d=null;const m={indexes:{i:e,j:a,realIndex:g,translationsIndex:f},x:o,y:c,strokeWidth:r,elSeries:x};if(d=this.isHorizontal?this.drawHorizontalBoxPaths(n(l({},m),{yDivision:C,barHeight:v,zeroW:w})):this.drawVerticalBoxPaths(n(l({},m),{xDivision:S,barWidth:k,zeroH:D,cullBounds:{lo:-B,hi:R+B}})),c=d.y,o=d.x,a>0&&u.push(o+(null!=k?k:0)/2),b.push(c),d.culled)continue;const y=this.barHelpers.drawGoalLine({barXPosition:d.barXPosition,barYPosition:d.barYPosition,goalX:d.goalX,goalY:d.goalY,barHeight:v,barWidth:k});if(y&&A.add(y),d.pathTo.forEach((s,l)=>{const n=!this.isBoxPlot&&this.candlestickOptions.wick.useFillColor?d.color[l]:i.globals.stroke.colors[e],b=h.fillPath({seriesNumber:g,dataPointIndex:a,color:d.color[l],value:t[e][a]});this.renderSeries({realIndex:g,pathFill:b,lineFill:n,j:a,i:e,pathFrom:d.pathFrom,pathTo:s,strokeWidth:r,elSeries:x,x:o,y:c,series:t,columnGroupIndex:p,barHeight:v,barWidth:k,elDataLabelsWrap:H,elGoalsMarkers:A,visibleSeries:this.visibleI,type:i.config.chart.type})}),O&&!1!==O.show){const t=null==(s=i.candleData.seriesBoxPoints[g])?void 0:s[a];if(t&&t.length){const e=t=>this.coreUtils.getLogValAtSeriesIndex(t,g);let s,r,o;if(this.isHorizontal){const t=this.invertedYRatio,a=null!=v?v:0,i=null!=w?w:0;s=d.barYPosition+a/2,r=a/2,o=a=>i+e(a)/t}else{const t=this.yRatio[f],a=null!=k?k:0,i=null!=D?D:0;s=d.barXPosition+a/2,r=a/2,o=a=>i-e(a)/t}const l=X({w:i,points:t,seedA:g,seedB:a,center:s,halfExtent:r,alongFn:o,isHorizontal:this.isHorizontal,options:O});l.length&&F.push({groups:l,j:a})}}}O&&W({graphics:r,w:i,elSeries:x,pointsByCat:F,options:O,distributed:i.config.plotOptions.bar.distributed,realIndex:g,wrapClass:"apexcharts-boxPlot-points-wrap",pointClass:"apexcharts-boxPlot-points"}),i.globals.seriesXvalues[g]=u,i.globals.seriesYvalues[g]=b,d.add(x)}return d}drawVerticalBoxPaths({indexes:t,x:e,xDivision:a,barWidth:s,zeroH:i,strokeWidth:r,cullBounds:o=null}){var l,n,h,d;const c=this.w,u=new b(this.w),g=t.i,p=t.j,{colors:x}=c.config.plotOptions.candlestick,{colors:f}=this.boxOptions,m=t.realIndex,y=t=>Array.isArray(t)?t[m]:t,v=y(x.upward),C=y(x.downward),w=this.yRatio[t.translationsIndex],P=this.getOHLCValue(m,p);let I=i,L=i,k=P.o<P.c?[v]:[C];this.isBoxPlot&&(k=[y(f.lower),y(f.upper)]);let S=Math.min(P.o,P.c),D=Math.max(P.o,P.c),H=P.m;c.axisFlags.isXNumeric&&(e=(c.seriesData.seriesX[m][p]-c.globals.minX)/this.xRatio-s/2);const A=e+s*this.visibleI;if(void 0===(null==(l=this.series[g])?void 0:l[p])||null===(null==(n=this.series[g])?void 0:n[p])?(S=i,D=i):(S=i-S/w,D=i-D/w,I=i-P.h/w,L=i-P.l/w,H=i-P.m/w),o&&(A+s<o.lo||A>o.hi))return{pathTo:null,pathFrom:null,x:c.axisFlags.isXNumeric?e:e+a,y:D,barXPosition:A,color:k,culled:!0};let O;if(this.isOHLC){const t=A+s/2,e=i-P.o/w,a=i-P.c/w;O=[u.move(t,I)+u.line(t,L)+u.move(t,e)+u.line(A,e)+u.move(t,a)+u.line(A+s,a)]}else O=this.isBoxPlot?[u.move(A,S)+u.line(A+s/2,S)+u.line(A+s/2,I)+u.line(A+s/4,I)+u.line(A+s-s/4,I)+u.line(A+s/2,I)+u.line(A+s/2,S)+u.line(A+s,S)+u.line(A+s,H)+u.line(A,H)+u.line(A,S+r/2),u.move(A,H)+u.line(A+s,H)+u.line(A+s,D)+u.line(A+s/2,D)+u.line(A+s/2,L)+u.line(A+s-s/4,L)+u.line(A+s/4,L)+u.line(A+s/2,L)+u.line(A+s/2,D)+u.line(A,D)+u.line(A,H)+"z"]:[u.move(A,D)+u.line(A+s/2,D)+u.line(A+s/2,I)+u.line(A+s/2,D)+u.line(A+s,D)+u.line(A+s,S)+u.line(A+s/2,S)+u.line(A+s/2,L)+u.line(A+s/2,S)+u.line(A,S)+u.line(A,D-r/2)];let X=null;const W=null==(d=null==(h=this.ctx)?void 0:h.morphTypeChange)?void 0:d.getInitialPathFor(m,p);return W?X=W:c.globals.previousPaths.length>0&&(X=this.getPreviousPath(m,p,O[0])),null==X&&(X=u.move(A+s/2,S)+u.move(A,S)),c.axisFlags.isXNumeric||(e+=a),{pathTo:O,pathFrom:X,x:e,y:D,goalY:this.barHelpers.getGoalValues("y",null,i,m,p,t.translationsIndex),barXPosition:A,color:k}}drawHorizontalBoxPaths({indexes:t,y:e,yDivision:a,barHeight:s,zeroW:i,strokeWidth:r}){var o,l,n,h;const d=this.w,c=new b(this.w),u=t.i,g=t.j,p=t.realIndex,{colors:x}=d.config.plotOptions.candlestick,{colors:f}=this.boxOptions,m=t=>Array.isArray(t)?t[p]:t,y=this.invertedYRatio,v=this.getOHLCValue(p,g);let C=v.o<v.c?[m(x.upward)]:[m(x.downward)];this.isBoxPlot&&(C=[m(f.lower),m(f.upper)]);let w=i,P=i,I=Math.min(v.o,v.c),L=Math.max(v.o,v.c),k=v.m;d.axisFlags.isXNumeric&&(e=(d.seriesData.seriesX[p][g]-d.globals.minX)/this.invertedXRatio-s/2);const S=e+s*this.visibleI;void 0===(null==(o=this.series[u])?void 0:o[g])||null===(null==(l=this.series[u])?void 0:l[g])?(I=i,L=i):(I=i+I/y,L=i+L/y,w=i+v.h/y,P=i+v.l/y,k=i+v.m/y);const D=[c.move(I,S)+c.line(I,S+s/2)+c.line(w,S+s/2)+c.line(w,S+s/2-s/4)+c.line(w,S+s/2+s/4)+c.line(w,S+s/2)+c.line(I,S+s/2)+c.line(I,S+s)+c.line(k,S+s)+c.line(k,S)+c.line(I+r/2,S),c.move(k,S)+c.line(k,S+s)+c.line(L,S+s)+c.line(L,S+s/2)+c.line(P,S+s/2)+c.line(P,S+s-s/4)+c.line(P,S+s/4)+c.line(P,S+s/2)+c.line(L,S+s/2)+c.line(L,S)+c.line(k,S)+"z"];let H=null;const A=null==(h=null==(n=this.ctx)?void 0:n.morphTypeChange)?void 0:h.getInitialPathFor(p,g);return A?H=A:d.globals.previousPaths.length>0&&(H=this.getPreviousPath(p,g,D[0])),null==H&&(H=c.move(I,S+s/2)+c.move(I,S)),d.axisFlags.isXNumeric||(e+=a),{pathTo:D,pathFrom:H,x:L,y:e,goalX:this.barHelpers.getGoalValues("x",i,null,p,g,0),barYPosition:S,color:C}}getOHLCValue(t,e){const a=this.w,s=this.coreUtils,i=a=>a[t]&&null!=a[t][e]?s.getLogValAtSeriesIndex(a[t][e],t):0,r=i(a.candleData.seriesCandleH),o=i(a.candleData.seriesCandleO),l=i(a.candleData.seriesCandleM),n=i(a.candleData.seriesCandleC),h=i(a.candleData.seriesCandleL);return{o:this.isBoxPlot?r:o,h:this.isBoxPlot?o:r,m:l,l:this.isBoxPlot?n:h,c:this.isBoxPlot?h:n}}}d.default.use({candlestick:z,boxPlot:z}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>d.default});
|
|
5
|
+
"use strict";var t=Object.defineProperty,e=Object.defineProperties,a=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,o=(e,a,s)=>a in e?t(e,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[a]=s,l=(t,e)=>{for(var a in e||(e={}))i.call(e,a)&&o(t,a,e[a]);if(s)for(var a of s(e))r.call(e,a)&&o(t,a,e[a]);return t},n=(t,s)=>e(t,a(s));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 a in t)if("default"!==a){const s=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(e,a,s.get?s:{enumerable:!0,get:()=>t[a]})}return e.default=t,Object.freeze(e)}const d=h(require("apexcharts/core")),c=d.__apex_CoreUtils,b=d.__apex_Graphics,u=d.__apex_DataLabels,g=(t,e,a,s)=>{if("function"!=typeof t)return t;const i=t({series:e.seriesData.series,seriesIndex:a,dataPointIndex:s,w:e});return Number.isFinite(i)?i:0},p=d.__apex_BrowserAPIs_BrowserAPIs,x=d.__apex_Environment_Environment;function f(t){var e;const a=t.config.chart.animations;if(!a||!1===a.enabled)return!1;if(!a.dynamicAnimation||!1===a.dynamicAnimation.enabled)return!1;const s=null!=(e=a.largeDatasetThreshold)?e:0;return!(s>0&&t.globals.dataPoints>s)&&!!(x.isBrowser()&&t.globals.dataChanged&&t.globals.shouldAnimate)}function m(t,e,a){var s,i,r,o;if(null==(s=t.axisFlags)?void 0:s.isXNumeric){const s=null==(r=null==(i=t.seriesData)?void 0:i.seriesX)?void 0:r[e];if(s&&s.length&&null!=s[a])return"x:"+s[a]}const l=null==(o=t.globals.labels)?void 0:o[a];return null!=l&&""!==String(l)?"c:"+(Array.isArray(l)?l.join(" "):String(l)):"j:"+a}function y(t){const e=new Map;return t.map(t=>{const a=e.get(t)||0;return e.set(t,a+1),0===a?t:`${t}#${a}`})}function v(t,e,a=!1,s=!1){var i,r;if(!f(t))return null;const o=t.globals.prevStreamFrame;if(!o)return null;const l=null==(i=o.seriesY)?void 0:i[e],n=null==(r=t.seriesData.series)?void 0:r[e];if(!Array.isArray(l)||!Array.isArray(n))return null;if(!l.length||!n.length)return null;const h=y(l.map((t,a)=>function(t,e,a){var s,i;if(t.isXNumeric){const i=null==(s=t.seriesX)?void 0:s[e];if(i&&i.length&&null!=i[a])return"x:"+i[a]}const r=null==(i=t.labels)?void 0:i[a];return null!=r&&""!==String(r)?"c:"+(Array.isArray(r)?r.join(" "):String(r)):"j:"+a}(o,e,a))),d=y(n.map((a,s)=>m(t,e,s))),c=function(t,e){const a=new Map;t.forEach((t,e)=>{a.has(t)||a.set(t,e)});const s=new Array(e.length),i=new Set;let r=-1,o=!0,l=t.length===e.length;e.forEach((t,e)=>{const n=a.has(t)&&!i.has(a.get(t))?a.get(t):-1;s[e]=n,-1!==n&&(i.add(n),n<r&&(o=!1),r=n),n!==e&&(l=!1)});const n=[];for(let e=0;e<t.length;e++)i.has(e)||n.push(e);return{toOld:s,exits:n,ordered:o,changed:!l}}(h,d);return(c.ordered||s)&&(c.changed||a)?{join:c,oldKeys:h,newKeys:d}:null}function C({w:t,elSeries:e,record:a,newKeys:s,isHorizontal:i,speed:r}){var o;if(!f(t))return;if(!a||!Array.isArray(a.paths)||!(null==e?void 0:e.node))return;const l=new Set(s),n=a.paths.filter(t=>t&&t.d&&null!=t.key&&!l.has(t.key));if(!n.length)return;const h=new b(t),d=null==(o=t.globals.colors)?void 0:o[parseInt(String(a.realIndex),10)];n.forEach(a=>{let s=a.fill||d||"#c8c8c8";0===String(s).indexOf("url(")&&(s=d||"#c8c8c8");const o=h.drawPath({d:a.d,stroke:"none",strokeWidth:0,fill:s,fillOpacity:1,classes:"apexcharts-bar-ghost"}),l=o.node;l.setAttribute("pointer-events","none"),o.attr("clip-path",`url(#gridRectBarMask${t.globals.cuid})`),e.node.insertBefore(l,e.node.firstChild);const n=function(t){const e=/^M\s*([+-]?[\d.eE]+)[\s,]+([+-]?[\d.eE]+)/.exec(t||"");if(!e)return null;const a=parseFloat(e[1]),s=parseFloat(e[2]);return isFinite(a)&&isFinite(s)?{x:a,y:s}:null}(a.d);let c=i?"left center":"center bottom";try{const t=l.getBBox();n&&t&&(c=i?Math.abs(n.x-t.x)<=Math.abs(n.x-(t.x+t.width))?"left center":"right center":Math.abs(n.y-(t.y+t.height))<=Math.abs(n.y-t.y)?"center bottom":"center top")}catch(t){}const b=l.style;b.transformBox="fill-box",b.transformOrigin=c;const u=Math.max(1,r||1),g=performance.now(),x=e=>{if(t.globals.isDestroyed||!l.parentNode)return;const a=Math.max(0,Math.min(1,(e-g)/u)),s=1-Math.pow(1-a,3),r=1-s;b.transform=i?`scaleX(${r})`:`scaleY(${r})`,b.opacity=String(1-s),a<1?p.requestAnimationFrame(x):l.parentNode.removeChild(l)};p.requestAnimationFrame(x)})}class w{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,a;const{x:s,y:i,y1:r,y2:o,i:h,j:d,realIndex:c,columnGroupIndex:u,barHeight:p,barWidth:x,barXPosition:f,barYPosition:m,visibleSeries:y}=t,v=this.w,C=new b(this.barCtx.w),w=v.waterfallData&&v.waterfallData.values,P=w&&w[c]&&null!=w[c][d]?w[c][d]:null,I=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[c]:this.barCtx.strokeWidth;let L,k;v.axisFlags.isXNumeric&&!v.globals.isBarHorizontal?(L=s+x*(y+1),k=i+p*(y+1)-I):(L=s+x*y,k=i+p*y);let S=null,D=null,H=s,A=i,O={};const X=v.config.dataLabels,W=this.barCtx.barOptions.dataLabels,F=this.barCtx.barOptions.dataLabels.total;void 0!==m&&(this.barCtx.isRangeBar||this.barCtx.isPyramid)&&(k=m,A=m),void 0!==f&&this.barCtx.isVerticalGroupedRangeBar&&(L=f,H=f);const R=g(X.offsetX,v,c,d),B=g(X.offsetY,v,c,d);let T={width:0,height:0};if(v.config.dataLabels.enabled){const t=null!==P?P:v.seriesData.series[c][d];T=C.getTextRects(v.config.dataLabels.formatter?v.config.dataLabels.formatter(t,n(l({},v),{seriesIndex:c,dataPointIndex:d,w:v})):v.formatters.yLabelFormatters[0](t),parseFloat(X.style.fontSize).toString(),X.style.fontFamily,void 0,!0,X.style.fontWeight)}const M={x:s,y:i,i:h,j:d,realIndex:c,columnGroupIndex:u,bcx:L,bcy:k,barHeight:p,barWidth:x,textRects:T,strokeWidth:I,dataLabelsX:H,dataLabelsY:A,dataLabelsConfig:X,barDataLabelsConfig:W,barTotalDataLabelsConfig:F,offX:R,offY:B};if(O=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(M):this.calculateColumnsDataLabelsPosition(M),null!==P&&this.barCtx.isHorizontal&&"center"===W.position){const t=null==(a=null==(e=v.waterfallData.geometry)?void 0:e[c])?void 0:a[d];t&&t.horizontal&&(O.dataLabelsX=(t.levelStart+t.levelEnd)/2+R)}return S=this.drawCalculatedDataLabels({x:O.dataLabelsX,y:O.dataLabelsY,val:null!==P?P:this.barCtx.isRangeBar?[r,o]:"100%"===v.config.chart.stackType?v.globals.seriesPercent[c][d]:v.seriesData.series[c][d],i:c,j:d,barWidth:x,barHeight:p,textRects:T,dataLabelsConfig:X}),v.config.chart.stacked&&F.enabled&&(D=this.drawTotalDataLabels({x:O.totalDataLabelsX,y:O.totalDataLabelsY,barWidth:x,barHeight:p,realIndex:c,j:d,textAnchor:O.totalDataLabelsAnchor,val:this.getStackedTotalDataLabel({realIndex:c,j:d}),rawVal:this.getStackedTotalValue({realIndex:c,j:d}),dataLabelsConfig:X,barTotalDataLabelsConfig:F})),{dataLabelsPos:O,dataLabels:S,totalDataLabels:D}}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,group:this.w.labelData.seriesGroups[e]}}drawsStackedTotal(t){const e=this.barCtx.lastActiveBarSerieIndexByGroup,a=this.getTotalGroupContext(t);return a&&e&&e.length>a.groupIndex?e[a.groupIndex]===t:this.barCtx.lastActiveBarSerieIndex===t}getStackedTotalValue({realIndex:t,j:e}){const a=this.w,s=this.getTotalGroupContext(t),i=a.seriesData.stackedSeriesTotalsByGroups;return s&&i&&i[s.groupIndex]?i[s.groupIndex][e]:this.barCtx.stackedSeriesTotals[e]}getStackedTotalDataLabel({realIndex:t,j:e}){const a=this.w;let s=this.getStackedTotalValue({realIndex:t,j:e});return this.totalFormatter&&(s=this.totalFormatter(s,n(l({},a),{seriesIndex:t,dataPointIndex:e,w:a}))),s}calculateColumnsDataLabelsPosition(t){const e=this.w;let a,s,{i:i,j:r,realIndex:o,y:l,bcx:n,barWidth:h,barHeight:d,textRects:c,dataLabelsX:u,dataLabelsY:g,dataLabelsConfig:p,barDataLabelsConfig:x,barTotalDataLabelsConfig:f,strokeWidth:m,offX:y,offY:v}=t;const C=n;d=Math.abs(d);const w="vertical"===e.config.plotOptions.bar.dataLabels.orientation,{zeroEncounters:P}=this.barCtx.barHelpers.getZeroValueEncounters({i:i,j:r});n-=m/2;const I=e.layout.gridWidth/e.globals.dataPoints;if(this.barCtx.isVerticalGroupedRangeBar?u+=h/2:(u=e.axisFlags.isXNumeric?n-h/2+y:n-I+h/2+y,!e.config.chart.stacked&&P>0&&e.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(u-=h*P)),w){const t=2;u=u+c.height/2-m/2-t}const L=e.seriesData.series[i][r]<0;let k=l;switch(this.barCtx.isReversed&&(k=l+(L?d:-d)),x.position){case"center":g=w?L?k-d/2+v:k+d/2-v:L?k-d/2+c.height/2+v:k+d/2+c.height/2-v;break;case"bottom":g=w?L?k-d+v:k+d-v:L?k-d+c.height+m+v:k+d-c.height/2+m-v;break;case"top":g=w?L?k+v:k-v:L?k-c.height/2-v:k+c.height+v}let S=k;const D=this.getTotalGroupContext(o);if((D?[D.group]:e.labelData.seriesGroups).forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevY.forEach(t=>{S=L?Math.max(t[r],S):Math.min(t[r],S)})}),this.drawsStackedTotal(o)&&f.enabled){const t=18,i=new b(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:o,j:r}),p.fontSize);a=L?S-i.height/2-v-f.offsetY+t:S+i.height+v+f.offsetY-t;const l=I;s=C+(e.axisFlags.isXNumeric?-h/2:h/2-l)+f.offsetX}return e.config.chart.stacked||(g<0?g=0+m:g+c.height/3>e.layout.gridHeight&&(g=e.layout.gridHeight-m)),{bcx:n,bcy:l,dataLabelsX:u,dataLabelsY:g,totalDataLabelsX:s,totalDataLabelsY:a,totalDataLabelsAnchor:"middle"}}calculateBarsDataLabelsPosition(t){var e;const a=this.w;let{x:s,i:i,j:r,realIndex:o,bcy:l,barHeight:n,barWidth:h,textRects:d,dataLabelsX:c,strokeWidth:u,dataLabelsConfig:g,barDataLabelsConfig:p,barTotalDataLabelsConfig:x,offX:f,offY:m}=t;const y=a.layout.gridHeight/a.globals.dataPoints,{zeroEncounters:v}=this.barCtx.barHelpers.getZeroValueEncounters({i:i,j:r});let C,w,P;if(h=Math.abs(h),this.barCtx.isPyramid){C=l+n/2+m-(null!=(e=d.centerOffset)?e:0)}else C=l-(this.barCtx.isRangeBar?0:y)+n/2+d.height/2+m-3;!a.config.chart.stacked&&v>0&&a.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(C-=n*v);let I="start";const L=a.seriesData.series[i][r]<0;let k=s;if(this.barCtx.isReversed&&(k=s+(L?-h:h),I=L?"start":"end"),this.barCtx.isPyramid)c=a.layout.gridWidth/2+f;else switch(p.position){case"center":c=L?k+h/2-f:Math.max(d.width/2,k-h/2)+f;break;case"bottom":c=L?k+h-u-f:k-h+u+f;break;case"top":c=L?k-u-f:k-u+f}let S=k;const D=this.getTotalGroupContext(o);if((D?[D.group]:a.labelData.seriesGroups).forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevX.forEach(t=>{S=L?Math.min(t[r],S):Math.max(t[r],S)})}),this.drawsStackedTotal(o)&&x.enabled){const t=new b(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:o,j:r}),g.fontSize);L?(w=S-u-f-x.offsetX,I="end"):w=S+f+x.offsetX+(this.barCtx.isReversed?-(h+u):u),P=C-d.height/2+t.height/2+x.offsetY+u,a.globals.barGroups.length>1&&!D&&(P-=a.globals.barGroups.length/2*(n/2))}if(!a.config.chart.stacked){const t=L&&"middle"!==g.textAnchor?"start"===g.textAnchor?"end":"start":g.textAnchor;let e;e="vertical"===p.orientation?d.height/2:"end"===t?d.width:"middle"===t?d.width/2:0;const s=("vertical"===p.orientation?d.height:d.width)-e;c+s>a.layout.gridWidth-u&&(c=a.layout.gridWidth-s-u),c-e<u&&(c=e+u)}return{bcx:s,bcy:l,dataLabelsX:c,dataLabelsY:C,totalDataLabelsX:w,totalDataLabelsY:P,totalDataLabelsAnchor:I}}drawCalculatedDataLabels({x:t,y:e,val:a,i:s,j:i,textRects:r,barHeight:o,barWidth:h,dataLabelsConfig:d}){var c,g,p;const x=this.w;let f="rotate(0)";"vertical"===x.config.plotOptions.bar.dataLabels.orientation&&(f=`rotate(-90, ${t}, ${e})`);const y=new u(this.barCtx.w,this.barCtx.ctx),v=new b(this.barCtx.w),C=d.formatter;let w=null;const P=x.globals.collapsedSeriesIndices.indexOf(s)>-1,I=(x.globals.collapsingSeriesIndices||[]).indexOf(s)>-1;if(I){const t=null==(c=x.globals.prevDataLabels)?void 0:c.get(`${s}::${m(x,s,i)}`);t&&isFinite(t.val)&&(a=t.val)}if(d.enabled&&(!P||I)){w=v.group({class:"apexcharts-data-labels",transform:f});const c=x.config.dataLabels;((null==(g=c.animate)?void 0:g.enabled)||(null==(p=c.countUp)?void 0:p.enabled))&&(w.node.setAttribute("data:dlKey",`${s}::${m(x,s,i)}`),w.node.setAttribute("data:dlJ",String(i)),"number"==typeof a&&isFinite(a)&&w.node.setAttribute("data:dlVal",String(a)));let b="";void 0!==a&&(b=C(a,n(l({},x),{seriesIndex:s,dataPointIndex:i,w:x}))),!a&&x.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(b="");const u=x.seriesData.series[s][i]<0,P=x.config.plotOptions.bar.dataLabels.position;if("vertical"===x.config.plotOptions.bar.dataLabels.orientation&&("top"===P&&(d.textAnchor=u?"end":"start"),"center"===P&&(d.textAnchor="middle"),"bottom"===P&&(d.textAnchor=u?"end":"start")),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels){h<v.getTextRects(b,parseFloat(d.style.fontSize).toString()).width&&(b="")}x.config.chart.stacked&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&!I&&(this.barCtx.isHorizontal?r.width/1.6>Math.abs(h)&&(b=""):r.height/1.6>Math.abs(o)&&(b=""));const L=l({},d);this.barCtx.isHorizontal&&a<0&&("start"===d.textAnchor?L.textAnchor="end":"end"===d.textAnchor&&(L.textAnchor="start")),y.plotDataLabelsText({x:t,y:e,text:b,i:s,j:i,parent:w,dataLabelsConfig:L,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return w}drawTotalDataLabels({x:t,y:e,val:a,rawVal:s,realIndex:i,j:r,textAnchor:o,barTotalDataLabelsConfig:l}){var n,h;const d=new b(this.barCtx.w);let c;if(l.enabled&&void 0!==t&&void 0!==e&&this.drawsStackedTotal(i)){c=d.drawText({x:t,y:e,foreColor:l.style.color,text:a,textAnchor:o,fontFamily:l.style.fontFamily,fontSize:l.style.fontSize,fontWeight:l.style.fontWeight}),c.attr({class:"apexcharts-datalabel-total",cx:t,cy:e});const b=this.w.config.dataLabels;if((null==(n=b.animate)?void 0:n.enabled)||(null==(h=b.countUp)?void 0:h.enabled)){const{groupIndex:t}=this.barCtx.barHelpers.getGroupIndex(i);c.node.setAttribute("data:dlTotalKey",`${t}::${m(this.w,i,r)}`),c.node.setAttribute("data:dlTotalSeries",String(i)),"number"==typeof s&&isFinite(s)&&c.node.setAttribute("data:dlTotalVal",String(s))}}return c}}const P=d.__apex_Series,I=d.__apex_Fill,L=d.__apex_Utils;function k(t){var e,a,s,i,r,o,l;return"histogram"===(null==(a=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:a.requestedType)&&(!1!==(null==(i=null==(s=t.config.plotOptions)?void 0:s.histogram)?void 0:i.overlap)&&(null!=(l=null==(o=null==(r=t.seriesData)?void 0:r.series)?void 0:o.length)?l:0)>1)}class S{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 a=0;a<t.length;a++)if(t[a].length>0&&(this.barCtx.seriesLen=this.barCtx.seriesLen+1,this.barCtx.totalItems+=t[a].length),e.axisFlags.isXNumeric)for(let s=0;s<t[a].length;s++)e.seriesData.seriesX[a][s]>e.globals.minX&&e.seriesData.seriesX[a][s]<e.globals.maxX&&this.barCtx.visibleItems++;else this.barCtx.visibleItems=e.globals.dataPoints;this.arrBorderRadius=this.createBorderRadiusArr(e.seriesData.series),L.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 a=t.globals.maxX-t.globals.minX;e=a>0?a/4:0}else if(e=this._unionMinXGap(),!(e>0&&isFinite(e))){const a=t.globals.minXDiff;e=a>0&&isFinite(a)&&.5!==a?a:0}return this._slotXSpan=e,e}_unionMinXGap(){const t=this.w.seriesData.seriesX||[],e=[];for(let a=0;a<t.length;a++){const s=t[a];Array.isArray(s)&&s.length>0&&e.push(s)}if(!e.length)return 0;const a=new Array(e.length).fill(0);let s=NaN,i=1/0;for(;;){let t=1/0,r=-1;for(let s=0;s<e.length;s++){const i=e[s];for(;a[s]<i.length&&"number"!=typeof i[a[s]];)a[s]++;if(a[s]>=i.length)continue;const o=i[a[s]];o==o?o<t&&(t=o,r=s):(a[s]++,s--)}if(-1===r)break;if(a[r]++,s==s){const e=t-s;e>0&&e<i&&(i=e)}s=t}return isFinite(i)?i:0}initialPositions(t){const e=this.w;let a,s,i,r,o,l,n,h,d=e.globals.dataPoints;this.barCtx.isRangeBar&&(d=e.labelData.labels.length);let c=this.barCtx.seriesLen;if((e.config.plotOptions.bar.rangeBarGroupRows||k(e))&&(c=1),this.barCtx.isHorizontal)i=e.layout.gridHeight/d,o=i/c,e.axisFlags.isXNumeric&&(i=e.layout.gridHeight/this.barCtx.totalItems,o=i/this.barCtx.seriesLen),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),s=(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),l=r/c*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),l=r/c*parseInt(this.barCtx.barOptions.columnWidth,10)/100,l<1&&(l=1)}if(-1===String(this.barCtx.barOptions.columnWidth).indexOf("%")&&(l=parseInt(this.barCtx.barOptions.columnWidth,10)),n=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){a=this.barCtx.getBarXForNumericXAxis({x:a,j:0,realIndex:t,barWidth:l}).x}else a=e.globals.padHorizontal+L.noExponents(r-l*this.barCtx.seriesLen)/2}return e.globals.barHeight=o,e.globals.barWidth=l,{x:a,y:s,yDivision:i,xDivision:r,barHeight:o,barWidth:l,zeroH:n,zeroW:h}}initializeStackedPrevVars(t){t.w.labelData.seriesGroups.forEach(e=>{t[e]||(t[e]={}),t[e].prevY=[],t[e].prevX=[],t[e].prevYF=[],t[e].prevXF=[],t[e].prevYVal=[],t[e].prevXVal=[]})}initializeStackedXYVars(t){t.w.labelData.seriesGroups.forEach(e=>{t[e]||(t[e]={}),t[e].xArrj=[],t[e].xArrjF=[],t[e].xArrjVal=[],t[e].yArrj=[],t[e].yArrjF=[],t[e].yArrjVal=[]})}getPathFillColor(t,e,a,s){var i;const r=this.w,o=new I(this.barCtx.w);let l=null;const n=this.barCtx.barOptions.distributed?a:e;let h=!1;if(this.barCtx.barOptions.colors.ranges.length>0){this.barCtx.barOptions.colors.ranges.map(s=>{t[e][a]>=s.from&&t[e][a]<=s.to&&(l=s.color,h=!0)})}const d=this.getDumbbellConnectorFill(e,a)||(null==(i=r.config.series[e].data[a])?void 0:i.fill),c=this.barCtx.barOptions.isDumbbell?r.config.plotOptions.bar.dumbbell.connector:null;let b;c&&c.color&&(l=c.color,b=c.opacity);return{color:o.fillPath({seriesNumber:this.barCtx.barOptions.distributed?n:s,dataPointIndex:a,color:l,opacity:b,value:t[e][a],fillConfig:d,fillType:(null==d?void 0:d.type)?d.type:Array.isArray(r.config.fill.type)?r.config.fill.type[s]:r.config.fill.type}),useRangeColor:h}}getDumbbellConnectorFill(t,e){const a=this.w;if(!this.barCtx.barOptions.isDumbbell)return null;const s=a.dumbbellData;if(!s||"series"!==s.form)return null;const i=a.config.plotOptions.bar.dumbbell.connector;if(i.color)return null;const r=s.order[e];if(!r)return null;const o=a.globals.colors[r[0]],l=a.globals.colors[r[1]];return o&&l?{type:"gradient",gradient:{type:this.barCtx.isHorizontal?"horizontal":"vertical",gradientFrom:o,gradientTo:l,opacityFrom:i.opacity,opacityTo:i.opacity,stops:[0,100],inverseColors:!this.barCtx.isHorizontal}}:null}getStrokeWidth(t,e,a){let s=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||(s=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[a]:this.barCtx.strokeWidth)),s}getStackedSeriesIndices(t){const e=this.w,a=e.labelData.seriesGroups,s=e.globals.columnSeries?new Set(e.globals.columnSeries.i):null,i=t=>!s||s.has(t);if(!a||a.length<2){const e=Array.from({length:t},(t,e)=>e).filter(i);return e.length?[e]:[]}const r=Array.from({length:a.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 a=this.w,s=!this.w.config.chart.stacked||a.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(s?"top":"none"));if(s)return o;const l="last"===a.config.plotOptions.bar.borderRadiusWhenStacked,n=l?"top":"both",h=l?"bottom":"both",d=l?"none":"bottom",c=l?"none":"top";for(const e of this.getStackedSeriesIndices(i))for(let a=0;a<r;a++){const s=[],i=[];for(const r of e){const e=t[r][a];e>0?s.push(r):e<0&&i.push(r)}if(s.length>0&&0===i.length)if(1===s.length)o[s[0]][a]=n;else{const t=s[0],e=s[s.length-1];for(const i of s)o[i][a]=i===t?d:i===e?"top":"none"}else if(i.length>0&&0===s.length)if(1===i.length)o[i[0]][a]=h;else{const t=Math.min(...i),e=Math.max(...i);for(const s of i)o[s][a]=s===t?c:s===e?"bottom":"none"}else if(s.length>0&&i.length>0){const t=s[s.length-1];for(const e of s)o[e][a]=e===t?"top":"none";const e=Math.max(...i);for(const t of i)o[t][a]=t===e?"bottom":"none"}}return o}barBackground({j:t,i:e,x1:a,x2:s,y1:i,y2:r,elSeries:o}){const l=this.w,n=new b(this.barCtx.w),h=new P(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=n.drawRect(void 0!==a?a:0,void 0!==i?i:0,void 0!==s?s:l.layout.gridWidth,void 0!==r?r:l.layout.gridHeight,this.barCtx.barOptions.colors.backgroundBarRadius,e,this.barCtx.barOptions.colors.backgroundBarOpacity);o.add(h),h.node.classList.add("apexcharts-backgroundBar")}}getColumnPaths({barWidth:t,barXPosition:e,y1:a,y2:s,strokeWidth:i,isReversed:r,series:o,seriesGroup:l,realIndex:n,i:h,j:d,w:c}){var u,g,p;const x=new b(this.barCtx.w);(i=Array.isArray(i)?i[n]:i)||(i=0);let f=t,m=e;(null==(u=c.config.series[n].data[d])?void 0:u.columnWidthOffset)&&(m=e-c.config.series[n].data[d].columnWidthOffset/2,f=t+c.config.series[n].data[d].columnWidthOffset);const y=i/2,v=m+y,C=m+f-y,w=(o[h][d]>=0?1:-1)*(r?-1:1);a+=.001-y*w,s+=.001+y*w;const P=x.line(C,a),I="around"===c.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[n][d]?" Z":" z",L=x.move(v,a)+x.line(v,s)+x.line(C,s)+P+I;let k=L;"none"!==this.arrBorderRadius[n][d]&&(k=x.roundPathCorners(k,c.config.plotOptions.bar.borderRadius));let S=null;const D=null==(p=null==(g=this.barCtx.ctx)?void 0:g.morphTypeChange)?void 0:p.getInitialPathFor(n,d);if(D?S=D:c.globals.previousPaths.length>0&&(S=this.barCtx.getPreviousPath(n,d,k,L)),null==S&&(S=x.move(v,a)+x.line(v,a)+P+P+P+P+P+x.line(v,a)+I),c.config.chart.stacked){let t=this.barCtx;t=this.barCtx[l],t.yArrj.push(s-y*w),t.yArrjF.push(Math.abs(a-s+i*w)),t.yArrjVal.push(this.barCtx.series[h][d])}return{pathTo:k,pathFrom:S,drawnBox:{x1:v,x2:C,y1:a,y2:s}}}getFunnelTrapezoidPaths({barYPosition:t,barHeight:e,series:a,i:s,j:i,realIndex:r,strokeWidth:o,w:l}){var n,h;const d=new b(this.barCtx.w),c=l.layout.gridWidth/2,u=t=>Math.abs(t/this.barCtx.invertedYRatio)/2,g=u(a[s][i]),p=i===a[s].length-1,x="taper"===l.config.plotOptions.funnel.lastShape?"taper":"flat";let f;f=p?"taper"===x?0:g:u(a[s][i+1]);const m=o/2,y=t+m,v=t+e-m,C=c-g,w=c+g,P=c-f,I=c+f,L=d.move(C,y)+d.line(w,y)+d.line(I,v)+d.line(P,v)+" Z";let k=null;const S=null==(h=null==(n=this.barCtx.ctx)?void 0:n.morphTypeChange)?void 0:h.getInitialPathFor(r,i);return S?k=S:l.globals.previousPaths.length>0&&(k=this.barCtx.getPreviousPath(r,i,L)),null==k&&(k=d.move(c,y)+d.line(c,y)+d.line(c,v)+d.line(c,v)+" Z"),{pathTo:L,pathFrom:k,x:w,x1:C,barXPosition:c}}computePyramidLayout(t){const e=this.w,a=e.layout.gridHeight,s=e.layout.gridWidth,i=t.map(t=>Math.abs(Number(t)||0)),r=i.reduce((t,e)=>t+e,0);if(0===r||a<=0)return i.map(()=>({y:0,height:0,topHalf:0,bottomHalf:0}));const o=s/2;let l=0;const n=[];for(let t=0;t<i.length;t++){const e=l/r;l+=i[t];const s=l/r,h=e*a,d=s*a;n.push({y:h,height:d-h,topHalf:e*o,bottomHalf:s*o})}return n}getPyramidPaths({barYPosition:t,barHeight:e,topHalf:a,bottomHalf:s,realIndex:i,j:r,strokeWidth:o,w:l}){var n,h;const d=new b(this.barCtx.w),c=l.layout.gridWidth/2,u=o/2,g=t+u,p=t+e-u,x=c-a,f=c+a,m=c-s,y=c+s,v=d.move(x,g)+d.line(f,g)+d.line(y,p)+d.line(m,p)+" Z";let C=null;const w=null==(h=null==(n=this.barCtx.ctx)?void 0:n.morphTypeChange)?void 0:h.getInitialPathFor(i,r);return w?C=w:l.globals.previousPaths.length>0&&(C=this.barCtx.getPreviousPath(i,r,v)),null==C&&(C=d.move(c,g)+d.line(c,g)+d.line(c,p)+d.line(c,p)+" Z"),{pathTo:v,pathFrom:C,x:f,x1:x,barXPosition:c}}getBarpaths({barYPosition:t,barHeight:e,x1:a,x2:s,strokeWidth:i,isReversed:r,series:o,seriesGroup:l,realIndex:n,i:h,j:d,w:c}){var u,g,p;const x=new b(this.barCtx.w);(i=Array.isArray(i)?i[n]:i)||(i=0);let f=t,m=e;(null==(u=c.config.series[n].data[d])?void 0:u.barHeightOffset)&&(f=t-c.config.series[n].data[d].barHeightOffset/2,m=e+c.config.series[n].data[d].barHeightOffset);const y=i/2,v=f+y,C=f+m-y,w=(o[h][d]>=0?1:-1)*(r?-1:1);a+=.001+y*w,s+=.001-y*w;const P=this.barCtx.isFunnel,I=P?(a+s)/2:a,L=x.line(a,C),k="around"===c.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[n][d]?" Z":" z",S=x.move(a,v)+x.line(s,v)+x.line(s,C)+L+k;let D=S;"none"!==this.arrBorderRadius[n][d]&&(D=x.roundPathCorners(D,c.config.plotOptions.bar.borderRadius));let H=null;const A=null==(p=null==(g=this.barCtx.ctx)?void 0:g.morphTypeChange)?void 0:p.getInitialPathFor(n,d);if(A?H=A:c.globals.previousPaths.length>0&&(H=this.barCtx.getPreviousPath(n,d,D,S)),null==H){const t=P?x.line(I,C):L;H=x.move(I,v)+x.line(I,v)+t+t+t+t+t+x.line(I,v)+k}if(c.config.chart.stacked){let t=this.barCtx;t=this.barCtx[l],t.xArrj.push(s+y*w),t.xArrjF.push(Math.abs(a-s-i*w)),t.xArrjVal.push(this.barCtx.series[h][d])}return{pathTo:D,pathFrom:H,drawnBox:{x1:a,x2:s,y1:v,y2:C}}}getXForValue(t,e,a=!0){let s=a?e:null;return null!=t&&(s=e+t/this.barCtx.invertedYRatio-2*(this.barCtx.isReversed?t/this.barCtx.invertedYRatio:0)),s}getYForValue(t,e,a,s=!0){let i=s?e:null;return null!=t&&(i=e-t/this.barCtx.yRatio[a]+2*(this.barCtx.isReversed?t/this.barCtx.yRatio[a]:0)),i}getGoalValues(t,e,a,s,i,r){const o=this.w,h=[],d=(s,i)=>{h.push({[t]:"x"===t?this.getXForValue(s,e,!1):this.getYForValue(s,a,r,!1),attrs:i})};if(o.seriesData.seriesGoals[s]&&o.seriesData.seriesGoals[s][i]&&Array.isArray(o.seriesData.seriesGoals[s][i])&&o.seriesData.seriesGoals[s][i].forEach(t=>{d(t.value,t)}),this.barCtx.barOptions.isDumbbell){const e=this.getDumbbellEnds(s,i);if(e.length){const a={strokeHeight:"x"===t?0:o.globals.markers.size[s],strokeWidth:"x"===t?o.globals.markers.size[s]: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=n(l({},a),{strokeColor:t.color});!c.enabled||e!==r&&e!==h||(o.label={text:this.getDumbbellLabelText(t.value,s,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 a=this.w,s=[],i=a.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)&&s.push({value:r,color:a.globals.colors[e],index:e})}return s}if(!a.rangeData.seriesRange.length)return s;const r=this.barCtx.barOptions.dumbbellColors?this.barCtx.barOptions.dumbbellColors:a.globals.colors,o=e=>Array.isArray(r[t])?r[t][e]:r[t];return[{value:a.rangeData.seriesRangeStart[t][e],color:o(0),index:0},{value:a.rangeData.seriesRangeEnd[t][e],color:o(1),index:1}]}getDumbbellLabelText(t,e,a,s){const i=this.w,r=i.config.plotOptions.bar.dumbbell.dataLabels;if("function"==typeof r.formatter)return r.formatter(t,{seriesIndex:e,dataPointIndex:a,endpointIndex:s,w:i});const o=this.barCtx.isHorizontal?i.formatters.xLabelFormatter:i.formatters.yLabelFormatters[0];return"function"==typeof o?o(t,a,i):String(t)}drawGoalLine({barXPosition:t,barYPosition:e,goalX:a,goalY:s,barWidth:i,barHeight:r}){if(!(Array.isArray(a)&&a.length>0||Array.isArray(s)&&s.length>0))return null;const o=new b(this.barCtx.w),l=o.group({class:"apexcharts-bar-goals-groups"});l.node.classList.add("apexcharts-element-hidden"),this.barCtx.w.globals.delayedElements.push({el:l.node}),l.attr("clip-path",`url(#gridRectMarkerMask${this.barCtx.w.globals.cuid})`);let n=null;return this.barCtx.isHorizontal?Array.isArray(a)&&a.forEach(t=>{if(t.x>=-1&&t.x<=o.w.layout.gridWidth+1){const a=void 0!==t.attrs.strokeHeight?t.attrs.strokeHeight:r/2,s=e+a+r/2;n=o.drawLine(t.x,s-2*a,t.x,s,t.attrs.strokeColor?t.attrs.strokeColor:void 0,t.attrs.strokeDashArray,t.attrs.strokeWidth?t.attrs.strokeWidth:2,t.attrs.strokeLineCap),l.add(n),t.attrs.label&&l.add(this.drawDumbbellLabel(t.attrs,{x:t.x,y:s-a,horizontal:!0,markerSize:t.attrs.strokeWidth||0}))}}):Array.isArray(s)&&s.forEach(e=>{if(e.y>=-1&&e.y<=o.w.layout.gridHeight+1){const a=void 0!==e.attrs.strokeWidth?e.attrs.strokeWidth:i/2,s=t+a+i/2;n=o.drawLine(s-2*a,e.y,s,e.y,e.attrs.strokeColor?e.attrs.strokeColor:void 0,e.attrs.strokeDashArray,e.attrs.strokeHeight?e.attrs.strokeHeight:2,e.attrs.strokeLineCap),l.add(n),e.attrs.label&&l.add(this.drawDumbbellLabel(e.attrs,{x:s-a,y:e.y,horizontal:!1,markerSize:e.attrs.strokeHeight||0}))}}),l}drawDumbbellLabel(t,e){const a=this.w,s=new b(a),i=a.config.plotOptions.bar.dumbbell.dataLabels,r=e.markerSize/2+i.offset,o=t.label.outward;return s.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:a,realIndex:s,j:i}){const r=this.w,{x:o,x1:l,barYPosition:n}=t,{x:h,x1:d,barYPosition:c}=e,u=n+e.barHeight,g=new b(this.barCtx.w),p=new L,x=g.move(l,u)+g.line(o,u)+g.line(h,c)+g.line(d,c)+g.line(l,u)+("around"===r.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[s][i]?" Z":" z");return g.drawPath({d:x,fill:p.shadeColor(.5,L.rgb2hex(a)),stroke:"none",strokeWidth:0,fillOpacity:1,classes:"apexcharts-bar-shadow apexcharts-decoration-element"})}getZeroValueEncounters({i:t,j:e}){var a;const s=this.w;let i=0,r=0;return(s.config.plotOptions.bar.horizontal?s.seriesData.series.map((t,e)=>e):(null==(a=s.globals.columnSeries)?void 0:a.i.map(t=>t))||[]).forEach(a=>{const o=s.globals.seriesPercent[a][e];o&&i++,a<t&&0===o&&r++}),{nonZeroColumns:i,zeroEncounters:r}}getSeriesGroupIndex(t){const e=this.w;return e.labelData.seriesGroups.findIndex(a=>a.indexOf(e.seriesData.seriesNames[t])>-1)}getGroupIndex(t){const e=this.w,a=e.labelData.seriesGroups.findIndex(a=>a.indexOf(e.seriesData.seriesNames[t])>-1),s=this.barCtx.columnGroupIndices;let i=s.indexOf(a);return i<0&&(s.push(a),i=s.length-1),{groupIndex:a,columnGroupIndex:i}}}const D=d.__apex_Filters,H=d.__apex_Animations_computeStagger;class A{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)/A.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*A.xRatio(t)}static screenXToPlotPx(t,e){const a=t.dom.baseEl,s=a&&a.querySelector(".apexcharts-svg");if(!s)return e-t.layout.translateX;const i=s.getBoundingClientRect(),r=t.globals.svgWidth?i.width/t.globals.svgWidth:1;return(e-i.left)/(r||1)-t.layout.translateX}}class O{constructor(t,e,a){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=a,this.xRatio=0,this.yRatio=[],this.invertedXRatio=0,this.invertedYRatio=0,this.baseLineY=[],this.baseLineInvertedY=0,null!==this.xyRatios&&(this.xRatio=a.xRatio,this.yRatio=a.yRatio,this.invertedXRatio=a.invertedXRatio,this.invertedYRatio=a.invertedYRatio,this.baseLineY=a.baseLineY,this.baseLineInvertedY=a.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 s=new P(this.w);this.lastActiveBarSerieIndex=s.getActiveConfigSeriesIndex("desc",["bar","column"]),this.lastActiveBarSerieIndexByGroup=s.getActiveConfigSeriesIndexByGroup(["bar","column"]),this.columnGroupIndices=[];const i=s.getBarSeriesIndices(),r=new c(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)}draw(t,e){var a,s,i;const r=this.w,o=new b(this.w),h=new c(this.w);t=h.getLogSeries(t),this.series=t,this.yRatio=h.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const d=o.group({class:"apexcharts-bar-series apexcharts-plot-series"});r.config.dataLabels.enabled&&(this.totalItems,this.barOptions.dataLabels.maxItems);for(let h=0,c=0;h<t.length;h++,c++){let b,u;const g=[],p=[],x=r.globals.comboCharts?e[h]:h,{columnGroupIndex:f}=this.barHelpers.getGroupIndex(x),y=o.group({class:"apexcharts-series",rel:h+1,seriesName:L.escapeString(r.seriesData.seriesNames[x]),"data:realIndex":x});P.addCollapsedClassToSeries(this.w,y,x),t[h].length>0&&(this.visibleI=this.visibleI+1),this.yRatio.length>1&&(this.yaxisIndex=r.globals.seriesYAxisReverseMap[x],this.translationsIndex=x);const v=this.translationsIndex;this.isReversed=r.config.yaxis[this.yaxisIndex]&&r.config.yaxis[this.yaxisIndex].reversed,this.isPyramid&&(this.pyramidLayout=this.barHelpers.computePyramidLayout(t[h]));const w=this.barHelpers.initialPositions(x),{y:I,yDivision:k,zeroW:S,x:H,xDivision:A,zeroH:O}=w;let X=w.barHeight,W=w.barWidth;u=I,b=H,this.isHorizontal||p.push(b+(null!=W?W:0)/2);const F=o.group({class:"apexcharts-datalabels","data:realIndex":x});r.globals.delayedElements.push({el:F.node,holdUntilComplete:!(null==(a=r.config.dataLabels.animate)?void 0:a.enabled)&&this.isLengthTransition(x)}),F.node.classList.add("apexcharts-element-hidden");const R=o.group({class:"apexcharts-bar-goals-markers"}),B=o.group({class:"apexcharts-bar-shadows"});r.globals.delayedElements.push({el:B.node}),B.node.classList.add("apexcharts-element-hidden");for(let e=0;e<t[h].length;e++){const a=this.barHelpers.getStrokeWidth(h,e,x);let o=null;const d={indexes:{i:h,j:e,realIndex:x,translationsIndex:v,bc:c},x:b,y:u,strokeWidth:a,elSeries:y};this.isHorizontal?(o=this.drawBarPaths(n(l({},d),{barHeight:X,zeroW:S,yDivision:k})),W=this.series[h][e]/this.invertedYRatio):(o=this.drawColumnPaths(n(l({},d),{xDivision:A,barWidth:W,zeroH:O})),X=this.series[h][e]/this.yRatio[v]);const m=this.barHelpers.getPathFillColor(t,h,e,x);if(this.isFunnel&&!this.isPyramid&&this.barOptions.isFunnel3d&&"trapezoid"!==(null==(s=r.config.plotOptions.funnel)?void 0:s.shape)&&this.pathArr.length&&e>0){const t=this.barHelpers.drawBarShadow({color:"string"==typeof m.color&&-1===(null==(i=m.color)?void 0:i.indexOf("url"))?m.color:L.hexToRgba(r.globals.colors[h]),prevPaths:this.pathArr[this.pathArr.length-1],currPaths:o,realIndex:x,j:e});if(B.add(t),r.config.chart.dropShadow.enabled){new D(this.w).dropShadow(t,r.config.chart.dropShadow,x)}}this.pathArr.push(o);const C=this.barHelpers.drawGoalLine({barXPosition:o.barXPosition,barYPosition:o.barYPosition,goalX:o.goalX,goalY:o.goalY,barHeight:X,barWidth:W});C&&R.add(C),u=o.y,b=o.x,e>0&&p.push(b+(null!=W?W:0)/2),g.push(u),this.renderSeries(n(l({realIndex:x,pathFill:m.color},m.useRangeColor?{lineFill:m.color}:{}),{j:e,i:h,columnGroupIndex:f,pathFrom:o.pathFrom,pathTo:o.pathTo,strokeWidth:a,elSeries:y,x:b,y:u,series:t,barHeight:Math.abs(o.barHeight?o.barHeight:X),barWidth:Math.abs(o.barWidth?o.barWidth:W),elDataLabelsWrap:F,elGoalsMarkers:R,elBarShadows:B,visibleSeries:this.visibleI,type:"bar"}))}if(r.globals.seriesXvalues[x]=p,r.globals.seriesYvalues[x]=g,r.globals.previousPaths.length>0){const e=[];for(let a=0;a<t[h].length;a++)e.push(m(r,x,a));C({w:r,elSeries:y,record:this._prevRecord(x),newKeys:e,isHorizontal:this.isHorizontal,speed:r.config.chart.animations.dynamicAnimation.speed})}d.add(y)}return d}renderSeries({realIndex:t,pathFill:e,lineFill:a,j:s,i:i,columnGroupIndex:r,pathFrom:o,pathTo:l,strokeWidth:n,elSeries:h,x:d,y:c,y1:u,y2:g,series:p,barHeight:x,barWidth:f,barXPosition:y,barYPosition:v,elDataLabelsWrap:C,elGoalsMarkers:P,elBarShadows:I,visibleSeries:L,type:k,classes:S}){var A,O,X,W,F,R,B;const T=this.w,M=new b(this.w,this.ctx),z=function(t,e){const a=t&&t.renderer;return a&&a.kind&&"svg"!==a.kind?a:e}(this.ctx,M);let j=!1;const Y=this._pathToInterp;if(this._pathToInterp=null,h._bindingsDelegated||(h._bindingsDelegated=!0,M.setupEventDelegation(h,`.apexcharts-${k}-area`)),!a){let e=function(t){const e=T.config.stroke.colors;let a;return Array.isArray(e)&&e.length>0&&(a=e[t],a||(a=""),"function"==typeof a)?a({value:T.seriesData.series[t][s],dataPointIndex:s,w:T}):a};const i="function"==typeof T.globals.stroke.colors[t]?e(t):T.globals.stroke.colors[t];a=this.barOptions.distributed?T.globals.stroke.colors[s]:i}const _=T.config.chart.animations,G=_.animateGradually;let $=0,V=0;if(G&&!1!==G.enabled&&!(T.globals.dataChanged&&this.isLayoutShift(t))){const t=T.globals.dataPoints||1,e=G.delay||0,a=Math.min(e,.5*_.speed/Math.max(1,t));V=H({style:"sequential",index:s,baseDelay:a}),T.config.chart.stacked&&!T.globals.dataChanged&&(V+=i*a*.5);$=V/(e||1)}const E=new w(this).handleBarDataLabels({x:d,y:c,y1:u,y2:g,i:i,j:s,series:p,realIndex:t,columnGroupIndex:r,barHeight:x,barWidth:f,barXPosition:y,barYPosition:v,visibleSeries:L});if(V>0){const t=T.config.dataLabels;if((null==(A=t.animate)?void 0:A.enabled)||(null==(O=t.countUp)?void 0:O.enabled)){const t=String(Math.round(V));null==(W=null==(X=E.dataLabels)?void 0:X.node)||W.setAttribute("data:dlDelay",t),null==(R=null==(F=E.totalDataLabels)?void 0:F.node)||R.setAttribute("data:dlDelay",t)}}if(T.globals.isBarHorizontal||(E.dataLabelsPos.dataLabelsX+Math.max(f,T.globals.barPadForNumericAxis)<0||E.dataLabelsPos.dataLabelsX-Math.max(f,T.globals.barPadForNumericAxis)>T.layout.gridWidth)&&(j=!0),T.config.series[i].data[s]&&T.config.series[i].data[s].strokeColor&&(a=T.config.series[i].data[s].strokeColor),this.isNullValue&&-1===T.globals.collapsingSeriesIndices.indexOf(t)&&(e="none"),!j){const r=!0===(null==(B=this.ctx.morphTypeChange)?void 0:B.isActive()),d=r?this.ctx.morphTypeChange.getSpeed():T.config.chart.animations.dynamicAnimation.speed,c=r&&this.ctx.morphTypeChange.claimsTargetMark(t,s);c&&(o=l,$=0);const b=z.renderPaths({i:i,j:s,realIndex:t,pathFrom:o,pathTo:l,stroke:a,strokeWidth:n,strokeLineCap:T.config.stroke.lineCap,fill:e,pathToInterp:Y,animationDelay:$,initialSpeed:T.config.chart.animations.speed,dataChangeSpeed:d,className:`apexcharts-${k}-area${S?` ${S}`:""}`,chartType:k,bindEventsOnPaths:!1});b.attr("clip-path",`url(#gridRectBarMask${T.globals.cuid})`),c&&(b.node.setAttribute("opacity","0"),b.node.setAttribute("data-piece-hidden","1"));const p=T.config.forecastDataPoints;p.count>0&&s>=T.globals.dataPoints-p.count&&(b.node.setAttribute("stroke-dasharray",p.dashArray),b.node.setAttribute("stroke-width",p.strokeWidth),b.node.setAttribute("fill-opacity",p.fillOpacity)),void 0!==u&&void 0!==g&&(b.attr("data-range-y1",u),b.attr("data-range-y2",g));new D(this.w).setSelectionFilter(b,t,s),h.add(b),b.attr({cy:E.dataLabelsPos.bcy,cx:E.dataLabelsPos.bcx,j:s,val:T.seriesData.series[i][s],barHeight:x,barWidth:f,"data:pathKey":m(T,t,s)}),"canvas"===z.kind&&(T.globals.barCanvasCoords||(T.globals.barCanvasCoords={}),T.globals.barCanvasCoords[t]||(T.globals.barCanvasCoords[t]={}),T.globals.barCanvasCoords[t][s]={cx:E.dataLabelsPos.bcx,cy:E.dataLabelsPos.bcy,barWidth:f}),null!==E.dataLabels&&C.add(E.dataLabels),E.totalDataLabels&&C.add(E.totalDataLabels),h.add(C),P&&h.add(P),I&&h.add(I)}return h}drawBarPaths({indexes:t,barHeight:e,strokeWidth:a,zeroW:s,x:i,y:r,yDivision:o,elSeries:l}){const n=this.w,h=t.i,d=t.j;let c;if(n.axisFlags.isXNumeric)c=(r=(n.seriesData.seriesX[h][d]-n.globals.minX)/this.invertedXRatio-e)+e*this.visibleI;else if(n.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:a}=this.barHelpers.getZeroValueEncounters({i:h,j:d});t>0&&(e=this.seriesLen*e/t),c=r+e*this.visibleI,c-=e*a}else c=r+e*this.visibleI;const b=this.isFunnel&&"trapezoid"===n.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!=s?s:0;s=t-(this.barHelpers.getXForValue(this.series[h][d],t)-t)/2}let p;return i=this.barHelpers.getXForValue(this.series[h][d],null!=s?s:0),p=u?this.barHelpers.getPyramidPaths({barYPosition:c,barHeight:e,topHalf:u.topHalf,bottomHalf:u.bottomHalf,realIndex:t.realIndex,j:d,strokeWidth:a,w:n}):b?this.barHelpers.getFunnelTrapezoidPaths({barYPosition:c,barHeight:e,series:this.series,i:h,j:d,realIndex:t.realIndex,strokeWidth:a,w:n}):this.barHelpers.getBarpaths({barYPosition:c,barHeight:e,x1:s,x2:i,strokeWidth:a,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:h,j:d,w:n}),(b||g)&&(s=p.x1,i=p.x),n.axisFlags.isXNumeric||g||(r+=o),g&&(r=c),this.barHelpers.barBackground({j:d,i:h,y1:c-e*this.visibleI,y2:e*this.seriesLen,elSeries:l}),{pathTo:p.pathTo,pathFrom:p.pathFrom,x1:s,x:i,y:r,goalX:this.barHelpers.getGoalValues("x",s,null,t.realIndex,d,0),barYPosition:c,barHeight:e}}drawColumnPaths({indexes:t,x:e,y:a,xDivision:s,barWidth:i,zeroH:r,strokeWidth:o,elSeries:l}){const n=this.w,h=t.realIndex,d=t.translationsIndex,c=t.i,b=t.j,u=t.bc;let g;if(n.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:b,realIndex:h,barWidth:i});e=t.x,g=t.barXPosition}else if(n.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:a}=this.barHelpers.getZeroValueEncounters({i:c,j:b});t>0&&(i=this.seriesLen*i/t),g=e+i*this.visibleI,g-=i*a}else g=e+i*this.visibleI;a=this.barHelpers.getYForValue(this.series[c][b],r,d);const p=this.barHelpers.getColumnPaths({barXPosition:g,barWidth:i,y1:r,y2:a,strokeWidth:o,isReversed:this.isReversed,series:this.series,realIndex:h,i:c,j:b,w:n});return n.axisFlags.isXNumeric||(e+=s),this.barHelpers.barBackground({bc:u,j:b,i:c,x1:g-o/2-i*this.visibleI,x2:i*this.seriesLen+o/2,elSeries:l}),{pathTo:p.pathTo,pathFrom:p.pathFrom,x:e,y:a,goalY:this.barHelpers.getGoalValues("y",null,r,h,b,d),barXPosition:g,barWidth:i}}getBarXForNumericXAxis({x:t,barWidth:e,realIndex:a,j:s}){const i=this.w;let r=a;return i.seriesData.seriesX[a].length||(r=i.globals.maxValsInArrayIndex),L.isNumber(i.seriesData.seriesX[r][s])&&(t=A.dataXToPx(i,i.seriesData.seriesX[r][s])-e*this.seriesLen/2),{barXPosition:t+(k(i)?0:e*this.visibleI),x:t}}_prevRecord(t){const e=this.w;let a=null;for(let s=0;s<e.globals.previousPaths.length;s++){const i=e.globals.previousPaths[s];i.paths&&i.paths.length>0&&parseInt(i.realIndex,10)===parseInt(String(t),10)&&(a=i)}return a}_prevKeyedPaths(t){if(this._prevKeyed||(this._prevKeyed={}),void 0!==this._prevKeyed[t])return this._prevKeyed[t];const e=this._prevRecord(t);let a=null;if(e&&e.paths.every(t=>null!=t.key)){const t=new Map;e.paths.forEach(e=>{t.set(e.key,e)}),a=t}return this._prevKeyed[t]=a,a}isLengthTransition(t){var e,a;if(this._ltCache||(this._ltCache={}),void 0!==this._ltCache[t])return this._ltCache[t];const s=this.w;let i=!1;if(f(s)&&s.globals.previousPaths.length>0){const r=this._prevRecord(t),o=null!=(a=null==(e=s.seriesData.series[t])?void 0:e.length)?a:0;if(r)if(r.paths.length!==o)i=!0;else{const e=this._prevKeyedPaths(t);if(e)for(let a=0;a<o;a++)if(!e.has(m(s,t,a))){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=v(this.w,t,!0,!0),a=!(!e||!e.join.changed);return this._layoutShiftCache[t]=a,a}getPreviousPath(t,e,a,s){const i=this.w;this._pathToInterp=null;const r=this._prevRecord(t);if(!r)return f(i)?null:a;let o=null,l=!1;const n=this._prevKeyedPaths(t);if(n){const a=n.get(m(i,t,e));a?o=a.d:l=!0}else void 0!==r.paths[e]?o=r.paths[e].d:l=!0;if(o){const t=O.pathCommandCount(o),e=O.pathCommandCount(a);if(t===e)return o;const r=new b(i),l=t=>{const e=O.pathBox(t);return e?Math.min(e.maxX-e.minX,e.maxY-e.minY):0},n=t<e?l(o)>1:l(a)>1;if(t<e){const t=r.roundPathCorners(o,0);if(O.pathCommandCount(t)===e){if(n&&s){const t=r.roundPathCorners(s,0);O.pathCommandCount(t)===e&&(this._pathToInterp=t)}return t}}else{const e=r.roundPathCorners(a,0);if(O.pathCommandCount(e)===t){if(this._pathToInterp=e,n){const e=O.squareLike(o),a=e?r.roundPathCorners(e,0):null;if(a&&O.pathCommandCount(a)===t)return a}return o}}}return l&&f(i)?null:a}static pathBox(t){if(!t)return null;const e=[],a=/([MLC])([^MLCZz]*)/g;let s;for(;null!==(s=a.exec(t));){const t=s[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=O.pathBox(t);if(!e)return null;const{minX:a,maxX:s,minY:i,maxY:r,start:o,vertical:l}=e,n=(t,e,a)=>Math.abs(t-e)<=Math.abs(t-a)?[e,a]:[a,e];let h,d,c,b;l?(h=Math.abs(o[0]-a)<=Math.abs(o[0]-s)?a:s,d=h===a?s:a,[c,b]=n(o[1],i,r)):(c=Math.abs(o[1]-i)<=Math.abs(o[1]-r)?i:r,b=c===i?r:i,[h,d]=n(o[0],a,s));const u=t.trim().endsWith("Z")?" Z":" z";return l?`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 a=this.w,s=this._prevRecord(t);if(!s)return null;const i=this._prevKeyedPaths(t),r=i?i.get(m(a,t,e)):s.paths[e];return r?!!r.flip:null}static pathCommandCount(t){if(!t)return 0;const e=t.match(/[A-Za-z]/g);return e?e.length:0}}function X({w:t,points:e,seedA:a,seedB:s,center:i,halfExtent:r,alongFn:o,isHorizontal:l,options:n,clampAt:h,sideSign:d}){const c=n;if(!c||!1===c.show)return[];if(!e||!e.length)return[];const b=c.maxPoints||3e3,u=e.length>b?Math.ceil(e.length/b):1,g=null!=c.size?c.size:2.5,p=r*(null!=c.jitter?c.jitter:.5),x=!1!==c.constrainToViolin&&"function"==typeof h,f="square"===c.shape,m=c.colorScale,y=m&&Array.isArray(m.colors)&&m.colors.length>0,v=y?Math.max(2,m.steps||24):1,C=y&&null!=m.min?m.min:t.globals.minY,w=(y&&null!=m.max?m.max:t.globals.maxY)-C||1,P=y?new Array(v).fill(""):[""];for(let t=0;t<e.length;t+=u){const r=e[t],n=o(r);let c=2*(B(7919*a+100003*s+t)-.5)*p;if(x){const t=h(r);c>t&&(c=t),c<-t&&(c=-t)}d&&(c=Math.abs(c)*d);const b=l?n:i+c,u=l?i+c:n,m=f?M(b,u,g):T(b,u,g);if(y){let t=(r-C)/w;t<0&&(t=0),t>1&&(t=1),P[Math.round(t*(v-1))]+=m}else P[0]+=m}if(!y)return P[0]?[{fill:null,d:P[0]}]:[];const I=[];for(let t=0;t<v;t++)P[t]&&I.push({fill:R(m.colors,t/(v-1)),d:P[t]});return I}function W({graphics:t,w:e,elSeries:a,pointsByCat:s,options:i,distributed:r,realIndex:o,wrapClass:l,pointClass:n}){if(!i||!1===i.show||!s.length)return;const h=null!=i.opacity?i.opacity:.9,d=null!=i.strokeColor?i.strokeColor:"#fff",c=null!=i.strokeWidth?i.strokeWidth:1,b=e.config.chart.animations.enabled&&!e.globals.resized&&!e.globals.dataChanged,u=t.group({class:b?`${l} apexcharts-element-hidden`:l});b&&e.globals.delayedElements.push({el:u.node}),s.forEach(({groups:a,j:s})=>{const l=r?e.globals.colors[s]:e.globals.colors[o],b=i.fillColor,g="series"===b?l:"series-dark"===b?F(l,.45):b||F(l,.45);a.forEach(a=>{const i=t.drawPath({d:a.d,fill:null!=a.fill?a.fill:g,stroke:c>0?d:"none",strokeWidth:c,fillOpacity:h,classes:n});i.attr("data:realIndex",o),i.attr("j",s),i.attr("clip-path",`url(#gridRectBarMask${e.globals.cuid})`),i.node.style.pointerEvents="none",u.add(i)})}),a.add(u)}function F(t,e){const a=L.parseHex(t);if(!a)return t;const s=Math.max(0,1-e);return`rgb(${Math.round(a[0]*s)},${Math.round(a[1]*s)},${Math.round(a[2]*s)})`}function R(t,e){if(!t.length)return"#000";if(1===t.length)return t[0];const a=Math.max(0,Math.min(1,e))*(t.length-1),s=Math.floor(a),i=a-s,r=L.parseHex(t[s])||[0,0,0],o=L.parseHex(t[Math.min(s+1,t.length-1)])||r,l=(t,e)=>Math.round(t+(e-t)*i);return`rgb(${l(r[0],o[0])},${l(r[1],o[1])},${l(r[2],o[2])})`}function B(t){let e=(2654435769^t)>>>0;return e=Math.imul(e^e>>>16,73244475),e=Math.imul(e^e>>>16,73244475),((e^e>>>16)>>>0)/4294967296}function T(t,e,a){return`M ${t-a} ${e} a ${a} ${a} 0 1 0 ${2*a} 0 a ${a} ${a} 0 1 0 ${-2*a} 0 `}function M(t,e,a){return`M ${t-a} ${e-a} h ${2*a} v ${2*a} h ${-2*a} z `}class z extends O{draw(t,e,a){var s;const i=this.w,r=new b(this.w),o=i.globals.comboCharts?e:i.config.chart.type,h=new I(this.w);this.candlestickOptions=this.w.config.plotOptions.candlestick,this.boxOptions=this.w.config.plotOptions.boxPlot,this.isHorizontal=i.config.plotOptions.bar.horizontal,this.isOHLC=this.candlestickOptions&&"ohlc"===this.candlestickOptions.type,this.coreUtils=new c(this.w),t=this.coreUtils.getLogSeries(t),this.series=t,this.yRatio=this.coreUtils.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const d=r.group({class:`apexcharts-${o}-series apexcharts-plot-series`});for(let e=0;e<t.length;e++){let o,c;this.isBoxPlot="boxPlot"===i.config.chart.type||"boxPlot"===i.config.series[e].type;const b=[],u=[],g=i.globals.comboCharts?a[e]:e,{columnGroupIndex:p}=this.barHelpers.getGroupIndex(g),x=r.group({class:"apexcharts-series",seriesName:L.escapeString(i.seriesData.seriesNames[g]),rel:e+1,"data:realIndex":g});P.addCollapsedClassToSeries(this.w,x,g),t[e].length>0&&(this.visibleI=this.visibleI+1);let f=0;this.yRatio.length>1&&(this.yaxisIndex=i.globals.seriesYAxisReverseMap[g][0],f=g);const m=this.barHelpers.initialPositions(g),{y:y,barHeight:v,yDivision:C,zeroW:w,x:I,barWidth:k,xDivision:S,zeroH:D}=m;c=y,o=I,u.push(o+(null!=k?k:0)/2);const H=r.group({class:"apexcharts-datalabels","data:realIndex":g}),A=r.group({class:"apexcharts-bar-goals-markers"}),O=this.isBoxPlot?this.boxOptions.points:null,F=[],R=i.layout.gridWidth,B=null!=k?k:0;for(let a=0;a<i.globals.dataPoints;a++){const r=this.barHelpers.getStrokeWidth(e,a,g);let d=null;const m={indexes:{i:e,j:a,realIndex:g,translationsIndex:f},x:o,y:c,strokeWidth:r,elSeries:x};if(d=this.isHorizontal?this.drawHorizontalBoxPaths(n(l({},m),{yDivision:C,barHeight:v,zeroW:w})):this.drawVerticalBoxPaths(n(l({},m),{xDivision:S,barWidth:k,zeroH:D,cullBounds:{lo:-B,hi:R+B}})),c=d.y,o=d.x,a>0&&u.push(o+(null!=k?k:0)/2),b.push(c),d.culled)continue;const y=this.barHelpers.drawGoalLine({barXPosition:d.barXPosition,barYPosition:d.barYPosition,goalX:d.goalX,goalY:d.goalY,barHeight:v,barWidth:k});if(y&&A.add(y),d.pathTo.forEach((s,l)=>{const n=!this.isBoxPlot&&this.candlestickOptions.wick.useFillColor?d.color[l]:i.globals.stroke.colors[e],b=h.fillPath({seriesNumber:g,dataPointIndex:a,color:d.color[l],value:t[e][a]});this.renderSeries({realIndex:g,pathFill:b,lineFill:n,j:a,i:e,pathFrom:d.pathFrom,pathTo:s,strokeWidth:r,elSeries:x,x:o,y:c,series:t,columnGroupIndex:p,barHeight:v,barWidth:k,elDataLabelsWrap:H,elGoalsMarkers:A,visibleSeries:this.visibleI,type:i.config.chart.type})}),O&&!1!==O.show){const t=null==(s=i.candleData.seriesBoxPoints[g])?void 0:s[a];if(t&&t.length){const e=t=>this.coreUtils.getLogValAtSeriesIndex(t,g);let s,r,o;if(this.isHorizontal){const t=this.invertedYRatio,a=null!=v?v:0,i=null!=w?w:0;s=d.barYPosition+a/2,r=a/2,o=a=>i+e(a)/t}else{const t=this.yRatio[f],a=null!=k?k:0,i=null!=D?D:0;s=d.barXPosition+a/2,r=a/2,o=a=>i-e(a)/t}const l=X({w:i,points:t,seedA:g,seedB:a,center:s,halfExtent:r,alongFn:o,isHorizontal:this.isHorizontal,options:O});l.length&&F.push({groups:l,j:a})}}}O&&W({graphics:r,w:i,elSeries:x,pointsByCat:F,options:O,distributed:i.config.plotOptions.bar.distributed,realIndex:g,wrapClass:"apexcharts-boxPlot-points-wrap",pointClass:"apexcharts-boxPlot-points"}),i.globals.seriesXvalues[g]=u,i.globals.seriesYvalues[g]=b,d.add(x)}return d}drawVerticalBoxPaths({indexes:t,x:e,xDivision:a,barWidth:s,zeroH:i,strokeWidth:r,cullBounds:o=null}){var l,n,h,d;const c=this.w,u=new b(this.w),g=t.i,p=t.j,{colors:x}=c.config.plotOptions.candlestick,{colors:f}=this.boxOptions,m=t.realIndex,y=t=>Array.isArray(t)?t[m]:t,v=y(x.upward),C=y(x.downward),w=this.yRatio[t.translationsIndex],P=this.getOHLCValue(m,p);let I=i,L=i,k=P.o<P.c?[v]:[C];this.isBoxPlot&&(k=[y(f.lower),y(f.upper)]);let S=Math.min(P.o,P.c),D=Math.max(P.o,P.c),H=P.m;c.axisFlags.isXNumeric&&(e=(c.seriesData.seriesX[m][p]-c.globals.minX)/this.xRatio-s/2);const A=e+s*this.visibleI;if(void 0===(null==(l=this.series[g])?void 0:l[p])||null===(null==(n=this.series[g])?void 0:n[p])?(S=i,D=i):(S=i-S/w,D=i-D/w,I=i-P.h/w,L=i-P.l/w,H=i-P.m/w),o&&(A+s<o.lo||A>o.hi))return{pathTo:null,pathFrom:null,x:c.axisFlags.isXNumeric?e:e+a,y:D,barXPosition:A,color:k,culled:!0};let O;if(this.isOHLC){const t=A+s/2,e=i-P.o/w,a=i-P.c/w;O=[u.move(t,I)+u.line(t,L)+u.move(t,e)+u.line(A,e)+u.move(t,a)+u.line(A+s,a)]}else O=this.isBoxPlot?[u.move(A,S)+u.line(A+s/2,S)+u.line(A+s/2,I)+u.line(A+s/4,I)+u.line(A+s-s/4,I)+u.line(A+s/2,I)+u.line(A+s/2,S)+u.line(A+s,S)+u.line(A+s,H)+u.line(A,H)+u.line(A,S+r/2),u.move(A,H)+u.line(A+s,H)+u.line(A+s,D)+u.line(A+s/2,D)+u.line(A+s/2,L)+u.line(A+s-s/4,L)+u.line(A+s/4,L)+u.line(A+s/2,L)+u.line(A+s/2,D)+u.line(A,D)+u.line(A,H)+"z"]:[u.move(A,D)+u.line(A+s/2,D)+u.line(A+s/2,I)+u.line(A+s/2,D)+u.line(A+s,D)+u.line(A+s,S)+u.line(A+s/2,S)+u.line(A+s/2,L)+u.line(A+s/2,S)+u.line(A,S)+u.line(A,D-r/2)];let X=null;const W=null==(d=null==(h=this.ctx)?void 0:h.morphTypeChange)?void 0:d.getInitialPathFor(m,p);return W?X=W:c.globals.previousPaths.length>0&&(X=this.getPreviousPath(m,p,O[0])),null==X&&(X=u.move(A+s/2,S)+u.move(A,S)),c.axisFlags.isXNumeric||(e+=a),{pathTo:O,pathFrom:X,x:e,y:D,goalY:this.barHelpers.getGoalValues("y",null,i,m,p,t.translationsIndex),barXPosition:A,color:k}}drawHorizontalBoxPaths({indexes:t,y:e,yDivision:a,barHeight:s,zeroW:i,strokeWidth:r}){var o,l,n,h;const d=this.w,c=new b(this.w),u=t.i,g=t.j,p=t.realIndex,{colors:x}=d.config.plotOptions.candlestick,{colors:f}=this.boxOptions,m=t=>Array.isArray(t)?t[p]:t,y=this.invertedYRatio,v=this.getOHLCValue(p,g);let C=v.o<v.c?[m(x.upward)]:[m(x.downward)];this.isBoxPlot&&(C=[m(f.lower),m(f.upper)]);let w=i,P=i,I=Math.min(v.o,v.c),L=Math.max(v.o,v.c),k=v.m;d.axisFlags.isXNumeric&&(e=(d.seriesData.seriesX[p][g]-d.globals.minX)/this.invertedXRatio-s/2);const S=e+s*this.visibleI;void 0===(null==(o=this.series[u])?void 0:o[g])||null===(null==(l=this.series[u])?void 0:l[g])?(I=i,L=i):(I=i+I/y,L=i+L/y,w=i+v.h/y,P=i+v.l/y,k=i+v.m/y);const D=[c.move(I,S)+c.line(I,S+s/2)+c.line(w,S+s/2)+c.line(w,S+s/2-s/4)+c.line(w,S+s/2+s/4)+c.line(w,S+s/2)+c.line(I,S+s/2)+c.line(I,S+s)+c.line(k,S+s)+c.line(k,S)+c.line(I+r/2,S),c.move(k,S)+c.line(k,S+s)+c.line(L,S+s)+c.line(L,S+s/2)+c.line(P,S+s/2)+c.line(P,S+s-s/4)+c.line(P,S+s/4)+c.line(P,S+s/2)+c.line(L,S+s/2)+c.line(L,S)+c.line(k,S)+"z"];let H=null;const A=null==(h=null==(n=this.ctx)?void 0:n.morphTypeChange)?void 0:h.getInitialPathFor(p,g);return A?H=A:d.globals.previousPaths.length>0&&(H=this.getPreviousPath(p,g,D[0])),null==H&&(H=c.move(I,S+s/2)+c.move(I,S)),d.axisFlags.isXNumeric||(e+=a),{pathTo:D,pathFrom:H,x:L,y:e,goalX:this.barHelpers.getGoalValues("x",i,null,p,g,0),barYPosition:S,color:C}}getOHLCValue(t,e){const a=this.w,s=this.coreUtils,i=a=>a[t]&&null!=a[t][e]?s.getLogValAtSeriesIndex(a[t][e],t):0,r=i(a.candleData.seriesCandleH),o=i(a.candleData.seriesCandleO),l=i(a.candleData.seriesCandleM),n=i(a.candleData.seriesCandleC),h=i(a.candleData.seriesCandleL);return{o:this.isBoxPlot?r:o,h:this.isBoxPlot?o:r,m:l,l:this.isBoxPlot?n:h,c:this.isBoxPlot?h:n}}}d.default.use({candlestick:z,boxPlot:z}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>d.default});
|
package/dist/candlestick.esm.js
CHANGED
|
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
/*!
|
|
21
|
-
* ApexCharts v7.
|
|
21
|
+
* ApexCharts v7.4.0
|
|
22
22
|
* (c) 2018-2026 ApexCharts
|
|
23
23
|
*/
|
|
24
24
|
import * as _core from "apexcharts/core";
|
|
@@ -1312,6 +1312,14 @@ class Helpers {
|
|
|
1312
1312
|
* second at the top, and nothing else touched. Stacked totals already resolve
|
|
1313
1313
|
* per group (see drawsStackedTotal, #4173); corners never got the same fix.
|
|
1314
1314
|
*
|
|
1315
|
+
* plotOptions.bar.borderRadiusWhenStacked picks which ends round: 'all'
|
|
1316
|
+
* caps both the baseline and the far end, 'last' only the far end (#4845).
|
|
1317
|
+
*
|
|
1318
|
+
* A single-data-point chart used to hand its baseline segment 'top' (and a
|
|
1319
|
+
* solo segment 'top' instead of 'both'), which on a horizontal stack rounded
|
|
1320
|
+
* the first segment on its INNER edge and left a pill in the middle of the
|
|
1321
|
+
* bar (#4845). One data point is resolved like any other now.
|
|
1322
|
+
*
|
|
1315
1323
|
* @param {any[]} series
|
|
1316
1324
|
* @returns {string[][]}
|
|
1317
1325
|
*/
|
|
@@ -1326,9 +1334,11 @@ class Helpers {
|
|
|
1326
1334
|
() => Array(numColumns).fill(alwaysApplyRadius ? "top" : "none")
|
|
1327
1335
|
);
|
|
1328
1336
|
if (alwaysApplyRadius) return output;
|
|
1329
|
-
const
|
|
1330
|
-
const
|
|
1331
|
-
const
|
|
1337
|
+
const lastOnly = w.config.plotOptions.bar.borderRadiusWhenStacked === "last";
|
|
1338
|
+
const soloPositive = lastOnly ? "top" : "both";
|
|
1339
|
+
const soloNegative = lastOnly ? "bottom" : "both";
|
|
1340
|
+
const positiveBase = lastOnly ? "none" : "bottom";
|
|
1341
|
+
const negativeBase = lastOnly ? "none" : "top";
|
|
1332
1342
|
for (const stack of this.getStackedSeriesIndices(numSeries)) {
|
|
1333
1343
|
for (let j = 0; j < numColumns; j++) {
|
|
1334
1344
|
const positiveIndices = [];
|
|
@@ -1340,22 +1350,22 @@ class Helpers {
|
|
|
1340
1350
|
}
|
|
1341
1351
|
if (positiveIndices.length > 0 && negativeIndices.length === 0) {
|
|
1342
1352
|
if (positiveIndices.length === 1) {
|
|
1343
|
-
output[positiveIndices[0]][j] =
|
|
1353
|
+
output[positiveIndices[0]][j] = soloPositive;
|
|
1344
1354
|
} else {
|
|
1345
1355
|
const first = positiveIndices[0];
|
|
1346
1356
|
const last = positiveIndices[positiveIndices.length - 1];
|
|
1347
1357
|
for (const i of positiveIndices) {
|
|
1348
|
-
output[i][j] = i === first ?
|
|
1358
|
+
output[i][j] = i === first ? positiveBase : i === last ? "top" : "none";
|
|
1349
1359
|
}
|
|
1350
1360
|
}
|
|
1351
1361
|
} else if (negativeIndices.length > 0 && positiveIndices.length === 0) {
|
|
1352
1362
|
if (negativeIndices.length === 1) {
|
|
1353
|
-
output[negativeIndices[0]][j] =
|
|
1363
|
+
output[negativeIndices[0]][j] = soloNegative;
|
|
1354
1364
|
} else {
|
|
1355
|
-
const
|
|
1356
|
-
const
|
|
1365
|
+
const nearest = Math.min(...negativeIndices);
|
|
1366
|
+
const farthest = Math.max(...negativeIndices);
|
|
1357
1367
|
for (const i of negativeIndices) {
|
|
1358
|
-
output[i][j] = i ===
|
|
1368
|
+
output[i][j] = i === nearest ? negativeBase : i === farthest ? "bottom" : "none";
|
|
1359
1369
|
}
|
|
1360
1370
|
}
|
|
1361
1371
|
} else if (positiveIndices.length > 0 && negativeIndices.length > 0) {
|