apexcharts 8.4.0 → 8.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/dist/apexcharts.common.js +2 -2
- package/dist/apexcharts.core.js +90 -80
- package/dist/apexcharts.core.min.js +2 -2
- package/dist/apexcharts.esm.js +312 -206
- package/dist/apexcharts.full.js +426 -284
- package/dist/apexcharts.full.min.js +2 -2
- package/dist/apexcharts.js +425 -313
- package/dist/apexcharts.min.js +2 -2
- package/dist/apexcharts.ssr.common.js +2 -2
- package/dist/apexcharts.ssr.esm.js +425 -313
- package/dist/area.common.js +1 -1
- package/dist/area.esm.js +1 -1
- package/dist/bar.common.js +1 -1
- package/dist/bar.esm.js +1 -1
- package/dist/bar.js +1 -1
- package/dist/boxPlot.common.js +1 -1
- package/dist/boxPlot.esm.js +1 -1
- package/dist/bubble.common.js +1 -1
- package/dist/bubble.esm.js +1 -1
- package/dist/candlestick.common.js +1 -1
- package/dist/candlestick.esm.js +1 -1
- package/dist/candlestick.js +1 -1
- package/dist/column.common.js +1 -1
- package/dist/column.esm.js +1 -1
- package/dist/core.common.js +2 -2
- package/dist/core.esm.js +90 -80
- package/dist/donut.common.js +1 -1
- package/dist/donut.esm.js +1 -1
- package/dist/dumbbell.common.js +1 -1
- package/dist/dumbbell.esm.js +1 -1
- package/dist/features/all.common.js +2 -2
- package/dist/features/all.esm.js +258 -152
- 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 +2 -2
- package/dist/features/context-menu.esm.js +10 -2
- package/dist/features/context-menu.js +2 -2
- 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 +70 -2
- 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/highlight-filter.common.js +1 -1
- package/dist/features/highlight-filter.esm.js +1 -1
- package/dist/features/highlight-filter.js +1 -1
- package/dist/features/history.common.js +2 -2
- package/dist/features/history.esm.js +15 -4
- package/dist/features/history.js +2 -2
- package/dist/features/ink.common.js +2 -2
- package/dist/features/ink.esm.js +12 -5
- package/dist/features/ink.js +2 -2
- package/dist/features/keyboard.common.js +1 -1
- package/dist/features/keyboard.esm.js +1 -1
- package/dist/features/keyboard.js +1 -1
- package/dist/features/legend.common.js +2 -2
- package/dist/features/legend.esm.js +7 -6
- package/dist/features/legend.js +2 -2
- package/dist/features/link.common.js +1 -1
- package/dist/features/link.esm.js +85 -85
- 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 +2 -2
- package/dist/features/measure.esm.js +8 -5
- package/dist/features/measure.js +2 -2
- 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 +40 -40
- package/dist/features/perspectives.js +1 -1
- package/dist/features/raincloud.common.js +1 -1
- package/dist/features/raincloud.esm.js +3 -3
- 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 +46 -46
- package/dist/features/stats.js +1 -1
- package/dist/features/storyboard.common.js +2 -2
- package/dist/features/storyboard.esm.js +67 -50
- package/dist/features/storyboard.js +2 -2
- 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 +136 -31
- package/dist/features/toolbar.js +2 -2
- package/dist/features/trellis.common.js +2 -2
- package/dist/features/trellis.esm.js +53 -52
- package/dist/features/trellis.js +2 -2
- package/dist/features/waterfall.common.js +1 -1
- package/dist/features/waterfall.esm.js +1 -1
- package/dist/features/waterfall.js +1 -1
- package/dist/features/weave.common.js +1 -1
- package/dist/features/weave.esm.js +1 -1
- package/dist/features/weave.js +1 -1
- package/dist/full.common.js +2 -2
- package/dist/full.esm.js +265 -226
- package/dist/heatmap.common.js +2 -2
- package/dist/heatmap.esm.js +2 -2
- package/dist/heatmap.js +2 -2
- package/dist/histogram.common.js +1 -1
- package/dist/histogram.esm.js +46 -46
- package/dist/icicle.common.js +1 -1
- package/dist/icicle.esm.js +1 -1
- package/dist/icicle.js +1 -1
- 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 +1 -1
- package/dist/raincloud.esm.js +3 -3
- package/dist/rangeArea.common.js +1 -1
- package/dist/rangeArea.esm.js +1 -1
- package/dist/rangeBar.common.js +1 -1
- package/dist/rangeBar.esm.js +1 -1
- 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 +2 -2
- package/dist/treemap.esm.js +8 -7
- package/dist/treemap.js +2 -2
- package/dist/unit-shapes.common.js +1 -1
- package/dist/unit-shapes.esm.js +1 -1
- package/dist/unit-shapes.js +1 -1
- package/dist/unit.common.js +1 -1
- package/dist/unit.esm.js +22 -22
- package/dist/unit.js +1 -1
- package/dist/violin.common.js +1 -1
- package/dist/violin.esm.js +1 -1
- package/dist/violin.js +1 -1
- package/dist/waterfall.common.js +1 -1
- package/dist/waterfall.esm.js +1 -1
- package/package.json +2 -2
- package/src/apexcharts.js +22 -34
- package/src/charts/common/treemap/ColorScale.js +10 -4
- package/src/charts/common/treemap/Helpers.js +4 -1
- package/src/modules/Exports.js +50 -1
- package/src/modules/Toolbar.js +32 -0
- package/src/modules/contextMenu/ContextMenu.js +5 -1
- package/src/modules/history/History.js +6 -3
- package/src/modules/ink/InkLayer.js +3 -1
- package/src/modules/measure/Measure.js +13 -4
- package/src/modules/storyboard/Storyboard.js +12 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v8.4.
|
|
2
|
+
* ApexCharts v8.4.1
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
|
-
"use strict";var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,n=(e,i,s)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s,o=(t,e)=>{for(var i in e||(e={}))a.call(e,i)&&n(t,i,e[i]);if(s)for(var i of s(e))r.call(e,i)&&n(t,i,e[i]);return t},l=(t,s)=>e(t,i(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 i in t)if("default"!==i){const s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>t[i]})}return e.default=t,Object.freeze(e)}const c=h(require("apexcharts/core")),d=c.__apex_charts_Scatter,u=c.__apex_Animations,p=c.__apex_Animations_computeStagger,g=c.__apex_Animations_applyAnimationPolicy,f=c.__apex_Animations_prefersReducedMotion,m=c.__apex_Animations_applyProgressiveReveal,x=c.__apex_Easing_easeInOutSine,b=c.__apex_Easing_DEFAULT_EASING_NAME,y=c.__apex_Easing_cubicBezier,v=c.__apex_Easing_registerEasing,w=c.__apex_Easing_resolveEasing,_=c.__apex_Base,A=c.__apex_ChartFactory_register,S=c.__apex_ChartFactory_getChartClass,C=c.__apex_ChartFactory_isCustom,k=c.__apex_Core,P=c.__apex_CoreUtils,L=c.__apex_Crosshairs,M=c.__apex_Data,I=c.__apex_DataLabels,E=c.__apex_Events,F=c.__apex_Fill,D=c.__apex_Filters,T=c.__apex_Formatters,R=c.__apex_Graphics,z=c.__apex_Markers,X=c.__apex_Range,O=c.__apex_Responsive,$=c.__apex_Scales,W=c.__apex_Series,Y=c.__apex_Theme,H=c.__apex_TimeScale,B=c.__apex_TitleSubtitle,N=c.__apex_axes_Axes,j=c.__apex_axes_AxesUtils,V=c.__apex_axes_Grid,G=c.__apex_axes_XAxis,q=c.__apex_axes_YAxis,Z=c.__apex_dimensions_Dimensions,U=c.__apex_dimensions_Grid,K=c.__apex_dimensions_Helpers,J=c.__apex_dimensions_XAxis,Q=c.__apex_dimensions_YAxis,tt=c.__apex_helpers_Destroy,et=c.__apex_helpers_InitCtxVariables,it=c.__apex_helpers_Localization,st=c.__apex_helpers_UpdateHelpers,at=c.__apex_Config,rt=c.__apex_Defaults,nt=c.__apex_Globals,ot=c.__apex_Options,lt=c.__apex_tooltip_AxesTooltip,ht=c.__apex_tooltip_Intersect,ct=c.__apex_tooltip_Labels,dt=c.__apex_tooltip_Marker,ut=c.__apex_tooltip_Position,pt=c.__apex_tooltip_Tooltip,gt=c.__apex_tooltip_Utils,ft=c.__apex_BrowserAPIs_BrowserAPIs,mt=c.__apex_DOMShim_SSRDOMShim,xt=c.__apex_DOMShim_SSRElement,bt=c.__apex_DOMShim_SSRClassList,yt=c.__apex_PathMorphing_parsePath,vt=c.__apex_PathMorphing_morphPaths,wt=c.__apex_PathMorphing_pathBbox,_t=c.__apex_PathMorphing_arrayToPath,At=c.__apex_SVGAnimation_SVGAnimationRunner,St=c.__apex_SVGAnimation_installAnimationMethods,Ct=c.__apex_SVGContainer,kt=c.__apex_SVGDraggable_installDraggable,Pt=c.__apex_SVGElement,Lt=c.__apex_SVGFilter_SVGFilter,Mt=c.__apex_SVGFilter_FilterBuilder,It=c.__apex_SVGFilter_installFilterMethods,Et=c.__apex_SVGGradient_SVGGradient,Ft=c.__apex_SVGPattern_SVGPattern,Dt=c.__apex_SVGSelectable_installSelectable,Tt=c.__apex_index_SVG,Rt=c.__apex_index_Box,zt=c.__apex_math_SVGNS,Xt=c.__apex_math_Point,Ot=c.__apex_math_Matrix,$t=c.__apex_math_Box,Wt=c.__apex_Constants_LINE_HEIGHT_RATIO,Yt=c.__apex_Constants_NICE_SCALE_ALLOWED_MAG_MSD,Ht=c.__apex_Constants_NICE_SCALE_DEFAULT_TICKS,Bt=c.__apex_DateTime,Nt=c.__apex_Environment_Environment,jt=c.__apex_PerformanceCache,Vt=c.__apex_Resize_addResizeListener,Gt=c.__apex_Resize_removeResizeListener,qt=c.__apex_ThemePalettes_getThemePalettes,Zt=c.__apex_Utils,Ut=Object.freeze(Object.defineProperty({__proto__:null,__apex_Animations:u,__apex_Animations_applyAnimationPolicy:g,__apex_Animations_applyProgressiveReveal:m,__apex_Animations_computeStagger:p,__apex_Animations_prefersReducedMotion:f,__apex_Base:_,__apex_BrowserAPIs_BrowserAPIs:ft,__apex_ChartFactory_getChartClass:S,__apex_ChartFactory_isCustom:C,__apex_ChartFactory_register:A,__apex_Config:at,__apex_Constants_LINE_HEIGHT_RATIO:Wt,__apex_Constants_NICE_SCALE_ALLOWED_MAG_MSD:Yt,__apex_Constants_NICE_SCALE_DEFAULT_TICKS:Ht,__apex_Core:k,__apex_CoreUtils:P,__apex_Crosshairs:L,__apex_DOMShim_SSRClassList:bt,__apex_DOMShim_SSRDOMShim:mt,__apex_DOMShim_SSRElement:xt,__apex_Data:M,__apex_DataLabels:I,__apex_DateTime:Bt,__apex_Defaults:rt,__apex_Easing_DEFAULT_EASING_NAME:b,__apex_Easing_cubicBezier:y,__apex_Easing_easeInOutSine:x,__apex_Easing_registerEasing:v,__apex_Easing_resolveEasing:w,__apex_Environment_Environment:Nt,__apex_Events:E,__apex_Fill:F,__apex_Filters:D,__apex_Formatters:T,__apex_Globals:nt,__apex_Graphics:R,__apex_Markers:z,__apex_Options:ot,__apex_PathMorphing_arrayToPath:_t,__apex_PathMorphing_morphPaths:vt,__apex_PathMorphing_parsePath:yt,__apex_PathMorphing_pathBbox:wt,__apex_PerformanceCache:jt,__apex_Range:X,__apex_Resize_addResizeListener:Vt,__apex_Resize_removeResizeListener:Gt,__apex_Responsive:O,__apex_SVGAnimation_SVGAnimationRunner:At,__apex_SVGAnimation_installAnimationMethods:St,__apex_SVGContainer:Ct,__apex_SVGDraggable_installDraggable:kt,__apex_SVGElement:Pt,__apex_SVGFilter_FilterBuilder:Mt,__apex_SVGFilter_SVGFilter:Lt,__apex_SVGFilter_installFilterMethods:It,__apex_SVGGradient_SVGGradient:Et,__apex_SVGPattern_SVGPattern:Ft,__apex_SVGSelectable_installSelectable:Dt,__apex_Scales:$,__apex_Series:W,__apex_Theme:Y,__apex_ThemePalettes_getThemePalettes:qt,__apex_TimeScale:H,__apex_TitleSubtitle:B,__apex_Utils:Zt,__apex_axes_Axes:N,__apex_axes_AxesUtils:j,__apex_axes_Grid:V,__apex_axes_XAxis:G,__apex_axes_YAxis:q,__apex_charts_Scatter:d,__apex_dimensions_Dimensions:Z,__apex_dimensions_Grid:U,__apex_dimensions_Helpers:K,__apex_dimensions_XAxis:J,__apex_dimensions_YAxis:Q,__apex_helpers_Destroy:tt,__apex_helpers_InitCtxVariables:et,__apex_helpers_Localization:it,__apex_helpers_UpdateHelpers:st,__apex_index_Box:Rt,__apex_index_SVG:Tt,__apex_math_Box:$t,__apex_math_Matrix:Ot,__apex_math_Point:Xt,__apex_math_SVGNS:zt,__apex_tooltip_AxesTooltip:lt,__apex_tooltip_Intersect:ht,__apex_tooltip_Labels:ct,__apex_tooltip_Marker:dt,__apex_tooltip_Position:ut,__apex_tooltip_Tooltip:pt,__apex_tooltip_Utils:gt,default:c.default},Symbol.toStringTag,{value:"Module"})),Kt={},Jt=(t,e)=>Kt[t]||(Kt[t]=e(t).then(e=>(setTimeout(()=>delete Kt[t],6e4),e),e=>{throw delete Kt[t],e}));class Qt{constructor(t,e){this.w=t,this.ctx=e}svgStringToNode(t){return(new DOMParser).parseFromString(t,"image/svg+xml").documentElement}scaleSvgNode(t,e){const i=parseFloat(t.getAttributeNS(null,"width")),s=parseFloat(t.getAttributeNS(null,"height"));t.setAttributeNS(null,"width",i*e),t.setAttributeNS(null,"height",s*e),t.setAttributeNS(null,"viewBox","0 0 "+i+" "+s)}inlineCanvasLayers(t){const e=this.w.dom.elWrap.querySelectorAll(".apexcharts-series-canvas");if(!e.length)return;const i=t.querySelectorAll(".apexcharts-canvas-series");for(let t=0;t<e.length&&t<i.length;t++){let s;try{s=e[t].toDataURL()}catch(t){continue}const a=i[t],r=document.createElementNS(zt,"image");r.setAttribute("x",a.getAttribute("x")||"0"),r.setAttribute("y",a.getAttribute("y")||"0"),r.setAttribute("width",a.getAttribute("width")||"0"),r.setAttribute("height",a.getAttribute("height")||"0"),r.setAttribute("href",s),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s),a.parentNode&&a.parentNode.replaceChild(r,a)}}queryStyleable(t,e){return Array.prototype.slice.call(t.querySelectorAll(e))}setStyleDefaults(t,e){Object.keys(e).forEach(i=>{""===t.style.getPropertyValue(i)&&t.style.setProperty(i,e[i])})}applyExportStyles(t){const e=this.w;this.queryStyleable(t,"style").forEach(t=>t.remove()),this.queryStyleable(t,[".apexcharts-tooltip",".apexcharts-toolbar",".apexcharts-xaxistooltip",".apexcharts-yaxistooltip",".apexcharts-xcrosshairs",".apexcharts-ycrosshairs",".apexcharts-zoom-rect",".apexcharts-selection-rect"].join(", ")).forEach(t=>{t.style.setProperty("display","none","important")}),this.queryStyleable(t,".apexcharts-flip-y").forEach(t=>{this.setStyleDefaults(t,{transform:"scaleY(-1) translateY(-100%)","transform-origin":"top","transform-box":"fill-box"})}),this.queryStyleable(t,".apexcharts-flip-x").forEach(t=>{this.setStyleDefaults(t,{transform:"scaleX(-1)","transform-origin":"center","transform-box":"fill-box"})}),e.config.legend.show&&e.dom.elLegendWrap&&e.dom.elLegendWrap.children.length&&(this.queryStyleable(t,".apexcharts-legend").forEach(t=>{this.setStyleDefaults(t,{display:"flex",overflow:"auto",padding:"0 10px"});const e=t.classList,i=e.contains("apx-legend-position-left")||e.contains("apx-legend-position-right"),s=e.contains("apx-legend-position-top")||e.contains("apx-legend-position-bottom");e.contains("apexcharts-legend-group-horizontal")&&this.setStyleDefaults(t,{"flex-direction":"column"}),i&&this.setStyleDefaults(t,{"flex-direction":"column",bottom:"0"}),s&&this.setStyleDefaults(t,{"flex-wrap":"wrap"}),i||s&&e.contains("apexcharts-align-left")?this.setStyleDefaults(t,{"justify-content":"flex-start","align-items":"flex-start"}):s&&e.contains("apexcharts-align-center")?this.setStyleDefaults(t,{"justify-content":"center","align-items":"center"}):s&&e.contains("apexcharts-align-right")&&this.setStyleDefaults(t,{"justify-content":"flex-end","align-items":"flex-end"})}),this.queryStyleable(t,".apexcharts-legend-group").forEach(t=>{this.setStyleDefaults(t,{display:"flex"})}),this.queryStyleable(t,".apexcharts-legend-group-vertical").forEach(t=>{this.setStyleDefaults(t,{"flex-direction":"column-reverse"})}),this.queryStyleable(t,".apexcharts-legend-series").forEach(t=>{this.setStyleDefaults(t,{cursor:t.classList.contains("apexcharts-no-click")?"auto":"pointer","line-height":"normal",display:"flex","align-items":"center"})}),this.queryStyleable(t,".apexcharts-legend-text").forEach(t=>{this.setStyleDefaults(t,{position:"relative","font-size":"14px"})}),this.queryStyleable(t,".apexcharts-legend-marker").forEach(t=>{this.setStyleDefaults(t,{position:"relative",display:"flex","align-items":"center","justify-content":"center",cursor:"pointer","margin-right":"1px"})}),this.queryStyleable(t,".apexcharts-inactive-legend").forEach(t=>{this.setStyleDefaults(t,{opacity:"0.45"})}),this.queryStyleable(t,".apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series").forEach(t=>{t.style.setProperty("display","none","important")}))}resolveExportBackground(){const t=this.w,e=t.config.chart.background;return e&&"transparent"!==e?e:"dark"===t.config.theme.mode?"#343A3F":"#fff"}collectFontFamilies(){const t=new Set,e=this.w;if(!Nt.isBrowser()||!e.dom.elWrap)return t;const i=this.queryStyleable(e.dom.elWrap,"text, tspan, .apexcharts-legend-text, .apexcharts-title-text, .apexcharts-subtitle-text");return[e.dom.elWrap,...i].forEach(e=>{const i=ft.getComputedStyle(e),s=i&&i.fontFamily;s&&s.split(",").forEach(e=>{const i=e.trim().replace(/^['"]|['"]$/g,"");i&&t.add(i.toLowerCase())})}),t}collectFontFaceRules(){if(!Nt.isBrowser())return Promise.resolve([]);const t=[],e=[],i=(e,i)=>{(e.match(/@font-face\s*\{[^}]*\}/gi)||[]).forEach(e=>{const s=e.match(/font-family\s*:\s*([^;}]+)/i);if(!s)return;const a=s[1].trim().replace(/^['"]|['"]$/g,"");t.push({family:a.toLowerCase(),css:e,base:i})})},s=(t,e)=>{Array.from(t).forEach(t=>{5===t.type?t.cssText&&i(t.cssText,e):t.styleSheet?a(t.styleSheet):t.cssRules&&s(t.cssRules,e)})},a=t=>{let a=null;try{a=t.cssRules}catch(t){}a?s(a,t.href||document.baseURI):t.href&&e.push(Jt(t.href,t=>fetch(t).then(t=>t.ok?t.text():Promise.reject())).then(e=>i(e,t.href)).catch(()=>{}))};return Array.from(document.styleSheets||[]).forEach(a),Promise.all(e).then(()=>t)}embedFonts(t){const e=this.w;if(!Nt.isBrowser()||!e.config.chart.toolbar.export.embedFonts||"function"!=typeof fetch)return Promise.resolve();const i=this.collectFontFamilies();return i.size?this.collectFontFaceRules().then(t=>{const e=t.filter(t=>i.has(t.family));return e.length?Promise.all(e.map(t=>this.inlineFontFaceUrls(t.css,t.base).catch(()=>null))):Promise.resolve([])}).then(e=>{const i=(e||[]).filter(Boolean).join("\n");if(!i)return;const s=document.createElementNS(zt,"style");s.textContent=i,t.insertBefore(s,t.firstChild)}).catch(()=>{}):Promise.resolve()}inlineFontFaceUrls(t,e){const i=[],s=/url\(\s*(['"]?)([^'")]+)\1\s*\)/gi;let a;for(;null!==(a=s.exec(t));)a[2].startsWith("data:")||i.push(a[2]);return i.length?Promise.all(i.map(t=>{const i=e?new URL(t,e).href:t;return Jt(i,t=>this.fetchAsDataUri(t)).catch(()=>{})})).then(e=>{let s=t;return i.forEach((t,i)=>{e[i]&&(s=s.split(t).join(e[i]))}),s===t?null:s}):Promise.resolve(t.includes("data:")?t:null)}fetchAsDataUri(t){return"function"!=typeof fetch||"function"!=typeof btoa?Promise.reject(new Error("fetch unavailable")):fetch(t).then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status} for ${t}`);const i=e.headers.get("content-type")||"application/octet-stream";return e.arrayBuffer().then(t=>{const e=new Uint8Array(t);let s="";for(let t=0;t<e.length;t+=32768)s+=String.fromCharCode.apply(null,e.subarray(t,t+32768));return`data:${i};base64,${btoa(s)}`})})}getSvgString(t){return new Promise(e=>{var i,s,a;const r=this.w;let n=t||r.config.chart.toolbar.export.scale||r.config.chart.toolbar.export.width/r.globals.svgWidth;n||(n=1);const o=r.globals.svgWidth*n,l=r.globals.svgHeight*n;null==(i=r.globals.layoutTween)||i.finish(),null==(s=r.globals.circleTween)||s.finish(),null==(a=r.globals.highlightTween)||a.finish(),[...r.globals.chromeTweens||[]].forEach(t=>t());const h=r.dom.elWrap.cloneNode(!0);h.style.width=o+"px",h.style.height=l+"px",this.inlineCanvasLayers(h),this.applyExportStyles(h);const c=(new XMLSerializer).serializeToString(h);let d=`\n <svg xmlns="http://www.w3.org/2000/svg"\n version="1.1"\n xmlns:xlink="http://www.w3.org/1999/xlink"\n class="apexcharts-svg"\n xmlns:data="ApexChartsNS"\n transform="translate(0, 0)"\n width="${r.globals.svgWidth}px" height="${r.globals.svgHeight}px">\n <foreignObject width="100%" height="100%">\n <div xmlns="http://www.w3.org/1999/xhtml" style="width:${o}px; height:${l}px;">\n ${c}\n </div>\n </foreignObject>\n </svg>\n `;const u=this.svgStringToNode(d);1!==n&&this.scaleSvgNode(u,n),Promise.all([this.convertImagesToBase64(u),this.embedFonts(u)]).then(()=>{d=(new XMLSerializer).serializeToString(u),e(d.replace(/ /g," "))})})}convertImagesToBase64(t){const e="http://www.w3.org/1999/xlink",i=t.getElementsByTagName("image"),s=Array.from(i).map(t=>{const i=t.getAttributeNS(e,"href"),s=t.getAttribute("href"),a=i||s;if(!a||a.startsWith("data:"))return Promise.resolve();const r=a=>{i&&t.setAttributeNS(e,"href",a),!s&&i||t.setAttribute("href",a)};return this.fetchAsDataUri(a).then(r).catch(()=>this.getBase64FromUrl(a).then(r).catch(t=>{console.error("Error converting image to base64:",t)}))});return Promise.all(s)}getBase64FromUrl(t){return Nt.isSSR()?Promise.resolve(t):new Promise((e,i)=>{const s=new Image;s.crossOrigin="Anonymous",s.onload=()=>{const t=document.createElement("canvas");t.width=s.width,t.height=s.height;const i=t.getContext("2d");i&&i.drawImage(s,0,0),e(t.toDataURL())},s.onerror=i,s.src=t})}svgUrl(){return new Promise(t=>{this.getSvgString().then(e=>{const i=new Blob([e],{type:"image/svg+xml;charset=utf-8"});t(URL.createObjectURL(i))})})}dataURI(t){return Nt.isSSR()?Promise.resolve({imgURI:""}):new Promise(e=>{const i=this.w,s=()=>{console.warn("ApexCharts: the PNG export could not be rendered"),e({imgURI:""})},a=t?t.scale||t.width/i.globals.svgWidth:1,r=document.createElement("canvas");r.width=i.globals.svgWidth*a,r.height=parseInt(i.dom.elWrap.style.height,10)*a;const n=this.resolveExportBackground(),o=r.getContext("2d");if(!o)return s();o.fillStyle=n,o.fillRect(0,0,r.width,r.height),this.getSvgString(a).then(t=>{const i="data:image/svg+xml,"+encodeURIComponent(t),a=new Image;a.crossOrigin="anonymous",a.onload=()=>{try{o.drawImage(a,0,0);const t=r;if(t.msToBlob){const i=t.msToBlob();e({blob:i})}else{const t=r.toDataURL("image/png");e({imgURI:t})}}catch(t){s()}},a.onerror=s,a.src=i}).catch(s)})}exportToSVG(){this.svgUrl().then(t=>{this.triggerDownload(t,this.w.config.chart.toolbar.export.svg.filename,".svg")})}exportToPng(){const t=this.w.config.chart.toolbar.export.scale,e=this.w.config.chart.toolbar.export.width,i=t?{scale:t}:e?{width:e}:void 0;this.dataURI(i).then(({imgURI:t,blob:e})=>{e?navigator.msSaveOrOpenBlob(e,this.w.globals.chartID+".png"):t&&this.triggerDownload(t,this.w.config.chart.toolbar.export.png.filename,".png")})}exportToCSV({series:t,fileName:e,columnDelimiter:i=",",lineDelimiter:s="\n"}){const a=this.w,r=a.globals,n=a.config.chart.toolbar.export.csv,o=!t&&(r.streamgraphRawSeries||r.waterfallRawSeries||r.dumbbellRawSeries);t||(t=o||a.config.series);const l=new Set(o&&o===r.dumbbellRawSeries?a.dumbbellData.hidden:r.collapsedSeriesIndices),h=[],c=[],d="datetime"===a.config.xaxis.type,u=a.config.xaxis.labels.datetimeUTC,p=t=>{if(null==t||Zt.isNumber(t))return t;const e=String(t);return/^[=+\-@\t\r]/.test(e)&&isNaN(+e)?`'${e}`:e},g=t=>d&&String(t).length>=10&&!isNaN(new Date(t).getTime()),f=(t,e)=>{const i=new Date(t);if(u||i.setTime(i.getTime()-6e4*i.getTimezoneOffset()),e)return i.toISOString().slice(0,23).replace("T"," ").replace(".000","");const[s,a,r,n]=i.toUTCString().split(" ");return`${s.slice(0,3)} ${r} ${a} ${n}`},m=(t,e)=>"function"==typeof n.categoryFormatter?n.categoryFormatter(t):null==t?"":g(t)?f(t,e):Zt.isNumber(t)?t:p(String(t).split(i).join("")),x=t=>"function"==typeof n.valueFormatter?n.valueFormatter(t):p(t),b=new j(this.w,{theme:this.ctx.theme,timeScale:this.ctx.timeScale}),y=t=>{let e="";if(r.axisCharts){if("category"===a.config.xaxis.type||a.config.xaxis.convertedCatToNumeric)if(r.isBarHorizontal){const i=a.formatters.yLabelFormatters[0],s=new W(this.ctx.w).getActiveConfigSeriesIndex();e=i(a.labelData.labels[t],{seriesIndex:s,dataPointIndex:t,w:a})}else e=b.getLabel(a.labelData.labels,a.labelData.timescaleLabels,0,t).text;d&&(a.config.xaxis.categories.length?e=a.config.xaxis.categories[t]:a.config.labels.length&&(e=a.config.labels[t]))}else e=a.config.labels[t];return Array.isArray(e)?e.join(" "):e},v=a.candleData,w=a.rangeData,_=a.violinData,A=t.length>1,S=t.map((t,e)=>{const s=o?"":t.type||a.config.chart.type,r="candlestick"===s?{open:v.seriesCandleO,high:v.seriesCandleH,low:v.seriesCandleL,close:v.seriesCandleC}:"boxPlot"===s?{minimum:v.seriesCandleO,q1:v.seriesCandleH,median:v.seriesCandleM,q3:v.seriesCandleL,maximum:v.seriesCandleC}:"rangeBar"===s||"rangeArea"===s?{minimum:w.seriesRangeStart,maximum:w.seriesRangeEnd}:"violin"===s?{minimum:_.seriesViolinMin,maximum:_.seriesViolinMax,observations:_.seriesViolinPoints}:null,n=String(t.name||`series-${e}`).split(i).join("")||`series-${e}`,h=r?Object.keys(r):[n];return{head:r&&A?h.map(t=>`${n} ${t}`):h,cells:i=>{var s;const a=l.has(e);if(!r){const e=a||null==(s=t.data)?void 0:s[i];return[x(e&&"object"==typeof e?Array.isArray(e)?e[1]:e.y:e)]}return Object.values(r).map(t=>{var s;const r=a||null==(s=null==t?void 0:t[e])?void 0:s[i];return x(Array.isArray(r)?r.length:r)})}}});if(r.axisCharts)if(h.push([n.headerCategory,...S.flatMap(t=>t.head)].join(i)),r.allSeriesHasEqualX||a.config.xaxis.categories.length||a.config.labels.length){const e=Math.max(0,...t.map(t=>{var e;return(null==(e=t.data)?void 0:e.length)||0}));for(let i=0;i<e;i++){let e=y(i);if(null!==e){if(!e){const s=t.map(t=>{var e;return null==(e=t.data)?void 0:e[i]}).find(t=>null!=t);e=null==s?"":Array.isArray(s)?s[0]:s.x}c.push([e,...S.flatMap(t=>t.cells(i))])}}}else{const e=new Map;t.forEach((t,i)=>{var s;const a=new Map;null==(s=null==t?void 0:t.data)||s.forEach((t,s)=>{if(!t||"object"!=typeof t)return;const r=Array.isArray(t)?t[0]:t.x,n=String(r),o=a.get(n)||0;a.set(n,o+1);const l=`${o}:${n}`;let h=e.get(l);h||(h={cat:r,values:S.map(t=>t.head.map(()=>""))},e.set(l,h)),h.values[i]=S[i].cells(s)})}),Array.from(e.values()).sort((t,e)=>{const i="string"==typeof t.cat;return i!==("string"==typeof e.cat)?i?1:-1:i?a.axisFlags.isXNumeric?t.cat<e.cat?-1:t.cat>e.cat?1:0:0:t.cat-e.cat}).forEach(({cat:t,values:e})=>c.push([t,...e.flat()]))}else h.push([n.headerCategory,n.headerValue].join(i)),t.forEach((t,e)=>{h.push([m(a.labelData.labels[e]),x(l.has(e)?"":a.seriesData.series[e])].join(i))});const C=c.map(t=>t[0]).filter(g),k=new Set(C.map(t=>+new Date(t))),P=new Set([...k].map(t=>f(t))).size<k.size;c.forEach(t=>h.push([m(t[0],P),...t.slice(1)].join(i))),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\ufeff"+h.join(s)),e||n.filename,".csv")}triggerDownload(t,e,i){if(Nt.isSSR())return;const s=document.createElement("a");s.href=t,s.download=(e||this.w.globals.chartID)+i,document.body.appendChild(s),s.click(),document.body.removeChild(s)}}c.default.registerFeatures({exports:Qt});let te=class{constructor(t){this.w=t.w,this.lgCtx=t}getLegendStyles(){if(Nt.isSSR())return null;const t=document.createElement("style");t.setAttribute("type","text/css");const e=this.w.config.chart.nonce;e&&t.setAttribute("nonce",e);const i=document.createTextNode(".apexcharts-flip-y{transform:scaleY(-1) translateY(-100%);transform-origin:top;transform-box:fill-box}.apexcharts-flip-x{transform:scaleX(-1);transform-origin:center;transform-box:fill-box}.apexcharts-legend{display:flex;overflow:auto;padding:0 10px}.apexcharts-legend.apexcharts-legend-group-horizontal{flex-direction:column}.apexcharts-legend-group{display:flex}.apexcharts-legend-group-vertical{flex-direction:column-reverse}.apexcharts-legend.apx-legend-position-bottom,.apexcharts-legend.apx-legend-position-top{flex-wrap:wrap}.apexcharts-legend.apx-legend-position-right,.apexcharts-legend.apx-legend-position-left{flex-direction:column;bottom:0}.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-left,.apexcharts-legend.apx-legend-position-top.apexcharts-align-left,.apexcharts-legend.apx-legend-position-right,.apexcharts-legend.apx-legend-position-left{justify-content:flex-start;align-items:flex-start}.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-center,.apexcharts-legend.apx-legend-position-top.apexcharts-align-center{justify-content:center;align-items:center}.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-right,.apexcharts-legend.apx-legend-position-top.apexcharts-align-right{justify-content:flex-end;align-items:flex-end}.apexcharts-legend-series{cursor:pointer;line-height:normal;display:flex;align-items:center}.apexcharts-legend-text{position:relative;font-size:14px}.apexcharts-legend-text *,.apexcharts-legend-marker *{pointer-events:none}.apexcharts-legend-marker{position:relative;display:flex;align-items:center;justify-content:center;cursor:pointer;margin-right:1px}.apexcharts-legend-series.apexcharts-no-click{cursor:auto}.apexcharts-legend .apexcharts-hidden-zero-series,.apexcharts-legend .apexcharts-hidden-null-series{display:none!important}.apexcharts-inactive-legend{opacity:.45}");return t.appendChild(i),t}getLegendDimensions(){const t=this.w.dom.baseEl.querySelector(".apexcharts-legend");if(!t)return{clwh:0,clww:0};const{width:e,height:i}=t.getBoundingClientRect();return{clwh:i,clww:e}}appendToForeignObject(){var t;const e=this.getLegendStyles();!1!==this.w.config.chart.injectStyleSheet&&e&&(null==(t=this.w.dom.elLegendForeign)||t.appendChild(e))}toggleDataSeries(t,e){var i,s,a;const r=this.w;if(r.dom.baseEl)if(r.globals.axisCharts||"radialBar"===r.config.chart.type){r.globals.resized=!0;let n=null,o=null;if(r.globals.risingSeries=[],r.globals.axisCharts){if(n=null!=(i=Array.prototype.find.call(r.dom.baseEl.querySelectorAll(".apexcharts-series"),e=>e.getAttribute("data:realIndex")===String(t)))?i:null,!n)return;o=parseInt(null!=(s=n.getAttribute("data:realIndex"))?s:"",10)}else{if(n=r.dom.baseEl.querySelector(`.apexcharts-series[rel='${t+1}']`),!n)return;o=parseInt(null!=(a=n.getAttribute("rel"))?a:"",10)-1}if(e){[{cs:r.globals.collapsedSeries,csi:r.globals.collapsedSeriesIndices},{cs:r.globals.ancillaryCollapsedSeries,csi:r.globals.ancillaryCollapsedSeriesIndices}].forEach(t=>{const e=t.cs,i=t.csi;this.riseCollapsedSeries(e,i,o)})}else this.hideSeries({seriesEl:n,realIndex:o});if(r.config.chart.accessibility.enabled){const e=r.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${t+1}"]`);if(e){const i=r.globals.collapsedSeriesIndices.includes(o)||r.globals.ancillaryCollapsedSeriesIndices.includes(o);e.setAttribute("aria-pressed",i?"true":"false");const s=e.querySelector(".apexcharts-legend-text"),a=s?s.textContent:r.seriesData.seriesNames[t],n=i?"hidden":"visible";e.setAttribute("aria-label",`${a}, ${n}. Press Enter or Space to toggle.`)}}}else{if(r.globals.resized=!0,r.globals.risingSeries=[],e)this.riseCollapsedSeries(r.globals.collapsedSeries,r.globals.collapsedSeriesIndices,t);else{const e=this.getSeriesAfterCollapsing({realIndex:t});this.lgCtx.updateSeries(e,r.config.chart.animations.dynamicAnimation.enabled)}if(r.config.chart.accessibility.enabled){const e=r.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${t+1}"]`);if(e){const i=r.globals.collapsedSeriesIndices.includes(t);e.setAttribute("aria-pressed",i?"true":"false");const s=e.querySelector(".apexcharts-legend-text"),a=s?s.textContent:r.seriesData.seriesNames[t],n=i?"hidden":"visible";e.setAttribute("aria-label",`${a}, ${n}. Press Enter or Space to toggle.`)}}}}_nonAxisSliceContainer(t){const e=this.w.config.chart.type;return("pie"===e||"donut"===e||"polarArea"===e||"sunburst"===e||"icicle"===e)&&1===t.length&&t[0]&&"object"==typeof t[0]&&Array.isArray(t[0].data)?t[0].data:t}_readSliceValue(t){return"unit"===this.w.config.chart.type&&t&&Array.isArray(t.data)?t.data:t&&"object"==typeof t?t.y:t}_writeSliceValue(t,e,i){const s=t[e];"unit"===this.w.config.chart.type&&s&&Array.isArray(s.data)?s.data=Array.isArray(i)?i:[]:s&&"object"==typeof s?s.y=i:t[e]=i}getSeriesAfterCollapsing({realIndex:t}){var e,i;const s=this.w,a=s.globals,r=a.axisCharts?Zt.copySeriesShallow(s.config.series):Zt.clone(s.config.series);if(a.axisCharts){const e=s.config.yaxis[a.seriesYAxisReverseMap[t]],i={index:t,data:r[t].data.slice(),type:r[t].type||s.config.chart.type,name:(a.seriesNames||[])[t]};if(e&&e.show&&e.showAlways)a.ancillaryCollapsedSeriesIndices.indexOf(t)<0&&(a.ancillaryCollapsedSeries.push(i),a.ancillaryCollapsedSeriesIndices.push(t));else if(a.collapsedSeriesIndices.indexOf(t)<0){a.collapsedSeries.push(i),a.collapsedSeriesIndices.push(t);const e=a.risingSeries.indexOf(t);a.risingSeries.splice(e,1)}}else if(a.collapsedSeriesIndices.indexOf(t)<0){const n=this._nonAxisSliceContainer(r);a.collapsedSeries.push({index:t,data:this._readSliceValue(n[t]),type:null!=(i=null==(e=s.config.series[t])?void 0:e.type)?i:"line",name:(a.seriesNames||[])[t]}),a.collapsedSeriesIndices.push(t)}const n=a.axisCharts?s.config.series.length:this._nonAxisSliceContainer(r).length;return a.allSeriesCollapsed=a.collapsedSeries.length+a.ancillaryCollapsedSeries.length===n,this._getSeriesBasedOnCollapsedState(r)}hideSeries({seriesEl:t,realIndex:e}){const i=this.w,s=this.getSeriesAfterCollapsing({realIndex:e}),a=t.childNodes;for(let t=0;t<a.length;t++)a[t].classList.contains("apexcharts-series-markers-wrap")&&(a[t].classList.contains("apexcharts-hide")?a[t].classList.remove("apexcharts-hide"):a[t].classList.add("apexcharts-hide"));const r=i.config.chart.animations.dynamicAnimation.enabled;r&&(i.globals.collapsingSeriesIndices=[e]);const n=()=>{i.globals.collapsingSeriesIndices=[]},o=this.lgCtx.updateSeries(s,r);n(),o&&"function"==typeof o.then&&o.then(n,n)}riseCollapsedSeries(t,e,i){const s=this.w;let a=Zt.clone(s.config.series);if(t.length>0){for(let r=0;r<t.length;r++)if(t[r].index===i){if(s.globals.axisCharts)a[i].data=t[r].data.slice(),a[i].hidden=!1;else{const e=this._nonAxisSliceContainer(a);this._writeSliceValue(e,i,t[r].data)}t.splice(r,1),e.splice(r,1),s.globals.risingSeries.push(i),r--}a=this._getSeriesBasedOnCollapsedState(a);const r=this.lgCtx.updateSeries(a,s.config.chart.animations.dynamicAnimation.enabled),n=()=>{s.globals.risingSeries=[]};r&&"function"==typeof r.then?r.then(n,n):n()}}_getSeriesBasedOnCollapsedState(t){const e=this.w;let i=0;if(e.globals.axisCharts)t.forEach((s,a)=>{e.globals.collapsedSeriesIndices.indexOf(a)<0&&e.globals.ancillaryCollapsedSeriesIndices.indexOf(a)<0||(t[a].data=[],i++)});else{const s=this._nonAxisSliceContainer(t);s.forEach((t,a)=>{e.globals.collapsedSeriesIndices.indexOf(a)<0||(this._writeSliceValue(s,a,0),i++)})}const s=e.globals.axisCharts?t.length:this._nonAxisSliceContainer(t).length;return e.globals.allSeriesCollapsed=i===s,t}};const ee=["#cf4d3f","#8f9499","#26a75b"],ie=(t,e,i)=>t+(e-t)*i;function se(t){return Math.max(0,Math.min(255,Math.round(t))).toString(16).padStart(2,"0")}function ae(t,e,i){const s=Zt.parseHex(re(t)),a=Zt.parseHex(re(e));return s&&a?"#"+se(ie(s[0],a[0],i))+se(ie(s[1],a[1],i))+se(ie(s[2],a[2],i)):t}function re(t){if("string"!=typeof t)return"#000000";if(Zt.isColorHex(t))return t;return Zt.rgb2hex(t)||"#000000"}function ne(t,e,i){const s=t.config.series[e];return oe(t,s&&Array.isArray(s.data)?s.data[i]:null,e,i)}function oe(t,e,i,s){var a,r,n;if(!e||"object"!=typeof e)return null;const o=null==(n=null==(r=null==(a=t.config.plotOptions)?void 0:a.treemap)?void 0:r.colorScale)?void 0:n.colorValue;let l;if(l="function"==typeof o?o(e,{seriesIndex:i,dataPointIndex:s,w:t}):"string"==typeof o?e[o]:e.colorValue,null==l)return null;const h=Number(l);return Number.isFinite(h)?h:null}function le(t){var e,i,s;const a=null==(s=null==(i=null==(e=t.config)?void 0:e.plotOptions)?void 0:i.treemap)?void 0:s.colorScale,r=a&&a.gradient;if(!r)return null;if(!1===r.enabled)return null;const n=t.config.series||[];let o=1/0,l=-1/0,h=!1;for(let e=0;e<n.length;e++){const i=n[e]&&n[e].data;if(Array.isArray(i))for(let s=0;s<i.length;s++){const a=oe(t,i[s],e,s);null!=a&&(h=!0,a<o&&(o=a),a>l&&(l=a))}}if(!h&&!0!==r.enabled)return null;Number.isFinite(o)||(o=0,l=0);const c=t=>Number.isFinite(Number(t))?Number(t):null,d=c(r.min),u=c(r.max);let p=null!=d?d:o,g=null!=u?u:l,f=null;if(null===r.midpoint?f=null:Number.isFinite(Number(r.midpoint))?f=Number(r.midpoint):p<0&&g>0&&(f=0),null!=f&&!1!==r.symmetric&&null==d&&null==u){const t=Math.max(Math.abs(p-f),Math.abs(g-f));p=f-t,g=f+t}g===p&&(p-=.5,g+=.5);const m=Array.isArray(r.stops)&&r.stops.length>=2,x=function(t,e,i,s,a){if(a)return t.stops.filter(t=>t&&Number.isFinite(Number(t.value))).map(t=>({value:Number(t.value),color:re(t.color)})).sort((t,e)=>t.value-e.value);const r=(Array.isArray(t.colors)&&t.colors.length>=2?t.colors:ee).map(re),n=r.length;if(null!=s&&n>=3){const t=Math.floor((n-1)/2),a=[];for(let i=0;i<=t;i++)a.push({value:ie(e,s,i/t),color:r[i]});for(let e=t+1;e<n;e++)a.push({value:ie(s,i,(e-t)/(n-1-t)),color:r[e]});return a}return r.map((t,s)=>({value:ie(e,i,s/(n-1)),color:t}))}(r,p,g,f,m);if(x.length<2)return null;m&&(null==d&&(p=Math.min(p,x[0].value)),null==u&&(g=Math.max(g,x[x.length-1].value)));const b=t=>{if(!Number.isFinite(t))return x[Math.floor(x.length/2)].color;if(t<=x[0].value)return x[0].color;const e=x[x.length-1];if(t>=e.value)return e.color;for(let e=1;e<x.length;e++){const i=x[e];if(t<=i.value){const s=x[e-1],a=i.value-s.value,r=0===a?0:(t-s.value)/a;return ae(s.color,i.color,r)}}return e.color},y=g-p,v=x.map(t=>{const e=Math.min(g,Math.max(p,t.value));return{percent:y&&(e-p)/y,color:e===t.value?t.color:b(e)}});return{min:p,max:g,midpoint:f,stops:x,at:b,legendStops:v}}function he(t){const e=re(t);return Zt.getContrastRatio(e,"#ffffff")>=Zt.getContrastRatio(e,"#000000")?"#ffffff":"#000000"}const ce="http://www.w3.org/2000/svg";class de{constructor(t,e){this.w=t,this.ctx=e,this.svgEl=null,this.arrowEl=null,this.hoverValueEl=null,this._min=0,this._max=0,this._geom=null,this._grad=null,this._bandHitEls=[],this._activeBandIndex=-1,this._targetEl=null,this.panelsW=null,this._onCellEnter=this._onCellEnter.bind(this),this._onCellLeave=this._onCellLeave.bind(this),this._onBandEnter=this._onBandEnter.bind(this),this._onBandLeave=this._onBandLeave.bind(this)}_getFormatter(){const t=this._cfg();return"function"==typeof t.formatter?t.formatter:t=>{if(!Number.isFinite(t))return String(t);const e=Math.abs(t);return e>=1e3?t.toFixed(0):e>=10?t.toFixed(1):t.toFixed(2)}}static colorScaleOf(t){var e,i,s,a,r;const n=null==(i=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:i.type;return n&&(null==(r=null==(a=null==(s=null==t?void 0:t.config)?void 0:s.plotOptions)?void 0:a[n])?void 0:r.colorScale)||null}static configFor(t){const e=de.colorScaleOf(t);return e&&e.gradientLegend||null}_cfg(){return de.configFor(this.w)||{}}static isEnabled(t){if(!de.supports(t))return!1;const e=de.configFor(t);return!(!e||!e.enabled)}static supports(t){var e,i;const s=null==(i=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:i.type;return"heatmap"===s||"treemap"===s}draw(t=null){var e,i,s,a,r,n,o,l;const h=this.w;this._targetEl=t;const c=t||h.dom.elLegendWrap;if(!c)return;const d=this._cfg(),u=h.config.legend.position,p="left"===u||"right"===u,g=null!=(i=null==(e=d.arrow)?void 0:e.size)?i:8,f=g+4,m=d.showLabels?28:4,x=d.showLabels?20:4,b=d.showLabels?44:0,y=this._resolveStripLength(p?d.height:d.width,p),v=d.thickness,w=p?Math.max(v+f+4,b):y+2*m,_=p?y+2*x:v+f+4,A=(w-(v+f))/2,S=p?"left"===u?A:A+f:m,C=p?x:"top"===u?f:4,k=ft.createElementNS(ce,"svg");k.setAttribute("class","apexcharts-heatmap-gradient-legend apexcharts-gradient-legend"),k.setAttribute("width",String(w)),k.setAttribute("height",String(_)),k.setAttribute("overflow","visible");const P=ft.createElementNS(ce,"defs"),L=`apexcharts-heatmap-gradient-${h.globals.cuid}`,M=ft.createElementNS(ce,"linearGradient");M.setAttribute("id",L),p?(M.setAttribute("x1","0"),M.setAttribute("y1","1"),M.setAttribute("x2","0"),M.setAttribute("y2","0")):(M.setAttribute("x1","0"),M.setAttribute("y1","0"),M.setAttribute("x2","1"),M.setAttribute("y2","0")),this._grad=M;const{min:I,max:E,bands:F}=this._paintStops();P.appendChild(M),k.appendChild(P);const D=ft.createElementNS(ce,"rect");if(D.setAttribute("x",String(S)),D.setAttribute("y",String(C)),D.setAttribute("width",String(p?v:y)),D.setAttribute("height",String(p?y:v)),D.setAttribute("rx","2"),D.setAttribute("fill",`url(#${L})`),k.appendChild(D),d.showLabels){const t=(null==(s=d.labelStyle)?void 0:s.colors)||(Array.isArray(h.config.legend.labels.colors)?h.config.legend.labels.colors[0]:h.config.legend.labels.colors)||h.config.chart.foreColor,e=(null==(a=d.labelStyle)?void 0:a.fontSize)||"11px",i=(null==(r=d.labelStyle)?void 0:r.fontFamily)||h.config.chart.fontFamily,n=this._getFormatter(),o=(s,a,r,n)=>{const o=ft.createElementNS(ce,"text");return o.setAttribute("x",String(a)),o.setAttribute("y",String(r)),o.setAttribute("text-anchor",n),o.setAttribute("dominant-baseline","middle"),o.setAttribute("fill",t),o.setAttribute("font-size",e),i&&o.setAttribute("font-family",i),o.textContent=String(s),o};if(p){const t=S+v/2;k.appendChild(o(n(I),t,C+y+10,"middle")),k.appendChild(o(n(E),t,C-10,"middle"))}else{const t=C+v/2;k.appendChild(o(n(I),S-6,t,"end")),k.appendChild(o(n(E),S+y+6,t,"start"))}}const T=(null==(n=d.arrow)?void 0:n.color)||h.config.chart.foreColor,R=this._buildArrow(g,T,u);if(k.appendChild(R),this.arrowEl=R,this._bandHitEls=[],h.config.legend.onItemHover.highlightDataSeries&&F.length>0&&F.forEach(t=>{const e=ft.createElementNS(ce,"rect");if(p){const i=C+y-t.p2*y,s=C+y-t.p1*y;e.setAttribute("x",String(S)),e.setAttribute("y",String(i)),e.setAttribute("width",String(v)),e.setAttribute("height",String(Math.max(0,s-i)))}else e.setAttribute("x",String(S+t.p1*y)),e.setAttribute("y",String(C)),e.setAttribute("width",String(Math.max(0,(t.p2-t.p1)*y))),e.setAttribute("height",String(v));e.setAttribute("fill","transparent"),e.setAttribute("class","apexcharts-heatmap-gradient-band"),e.setAttribute("data:range-index",String(t.index)),e.style.cursor="pointer",k.appendChild(e),this._bandHitEls.push(e)}),this._geom={isVertical:p,position:u,stripX:S,stripY:C,stripLength:y,stripThickness:v,arrowSize:g,svgWidth:w,svgHeight:_},d.showHoverValue){const t=ft.createElement("div");t.classList.add("apexcharts-heatmap-gradient-legend-value"),t.style.position="absolute",t.style.fontSize=(null==(o=d.labelStyle)?void 0:o.fontSize)||"11px",t.style.fontFamily=(null==(l=d.labelStyle)?void 0:l.fontFamily)||h.config.chart.fontFamily||"",t.style.color=h.config.chart.foreColor,t.style.background="rgba(0,0,0,0.65)",t.style.color="#fff",t.style.padding="2px 6px",t.style.borderRadius="3px",t.style.pointerEvents="none",t.style.whiteSpace="nowrap",t.style.opacity="0",t.style.transition="opacity 120ms ease",this.hoverValueEl=t}c.classList.add("apexcharts-heatmap-gradient-legend-wrap"),c.classList.add("apx-legend-position-"+u),c.appendChild(k),this.hoverValueEl&&c.appendChild(this.hoverValueEl),this.svgEl=k,t?(c.style.width=w+"px",c.style.height=_+"px",c.style.position="relative",c.style.overflow="visible"):this._applyWrapAlignment(c,u,p,w,_),this._attachHoverListeners(),this._attachBandHoverListeners()}_resolveStripLength(t,e){const i=this.w,s=e?i.globals.svgHeight||i.config.chart.height||300:i.globals.svgWidth||i.config.chart.width||600;if("string"==typeof t){const e=t.trim();if(e.endsWith("%")){const t=parseFloat(e)||0;return Math.max(20,s*t/100)}const i=parseFloat(e);return Number.isFinite(i)?i:200}return"number"==typeof t&&Number.isFinite(t)?t:200}_applyWrapAlignment(t,e,i,s,a){const r=this.w,n=this._cfg().align||"center",o=12,l=r.globals.svgWidth||r.config.chart.width||600,h=r.globals.svgHeight||r.config.chart.height||300,c=r.config.legend.offsetX||0,d=r.config.legend.offsetY||0;if(t.style.position="absolute",t.style.display="block",t.style.overflow="visible",t.style.padding="0",t.style.width=s+"px",t.style.height=a+"px",t.style.right="auto",t.style.bottom="auto",i){const i=h-a-24;let r;r="start"===n?o:"end"===n?o+Math.max(0,i):o+Math.max(0,i)/2,t.style.top=r+d+"px",t.style.left="left"===e?o+c+"px":l-s-o+c+"px"}else{const i=l-s-24;let r;r="start"===n?o:"end"===n?o+Math.max(0,i):o+Math.max(0,i)/2,t.style.left=r+c+"px",t.style.top="top"===e?o+d+"px":h-a-o+d+"px"}}repositionToPlot(){var t,e;if(this._grad&&this._paintStops(),!Nt.isBrowser())return;if(this._targetEl)return;const i=this.w,s=i.globals,a=i.dom.elLegendWrap;if(!a||!this._geom)return;if(!Number.isFinite(s.gridWidth)||!Number.isFinite(s.gridHeight))return;const{isVertical:r,position:n,svgWidth:o,svgHeight:l,stripX:h,stripY:c,stripThickness:d}=this._geom,u=this._cfg().align||"center",p=i.config.legend.offsetX||0,g=i.config.legend.offsetY||0,f=null==(e=null==(t=this.ctx)?void 0:t.dimensions)?void 0:e.dimHelpers,m=f?f.getTitleSubtitleCoords("title").height+f.getTitleSubtitleCoords("subtitle").height:0,x=i.layout.xAxisHeight||0,b=(t,e)=>{const i=Math.max(0,t-e);return"start"===u?0:"end"===u?i:i/2};if(r){a.style.top=s.translateY+b(s.gridHeight,l)+g+"px";const t=(("left"===n?0:s.translateX+s.gridWidth)+("left"===n?s.translateX:s.svgWidth))/2;a.style.left=t-h-d/2+p+"px"}else{a.style.left=s.translateX+b(s.gridWidth,o)+p+"px";const t=(("top"===n?m:s.translateY+s.gridHeight+x)+("top"===n?s.translateY:s.svgHeight))/2;a.style.top=t-c-d/2+g+"px"}ft.requestAnimationFrame(()=>this._enforceMinPlotGap())}_enforceMinPlotGap(){const t=this.w,e=t.dom.elLegendWrap,i=this.svgEl&&this.svgEl.querySelector("rect");if(!e||!i||!this._geom)return;if(!t.dom.baseEl||!t.dom.baseEl.querySelector(".apexcharts-svg"))return;const s=i.getBoundingClientRect(),a=gt.plotRect(t);if(!(s.width&&s.height&&a.width&&a.height))return;const r=a.left,n=a.left+a.width,o=a.top,l=a.top+a.height,h=a.zoom,{isVertical:c,position:d}=this._geom;if(c){const t=("left"===d?r-s.right:s.left-n)/h;if(t<16){const i=parseFloat(e.style.left)||0,s=16-t;e.style.left=i+("left"===d?-s:s)+"px"}}else{const t=("top"===d?o-s.bottom:s.top-l)/h;if(t<16){const i=parseFloat(e.style.top)||0,s=16-t;e.style.top=i+("top"===d?-s:s)+"px"}}}destroy(){var t,e,i,s,a,r,n;for(let i=0;i<this._bandHitEls.length;i++){const s=this._bandHitEls[i];null==(t=s.removeEventListener)||t.call(s,"mousemove",this._onBandEnter),null==(e=s.removeEventListener)||e.call(s,"mouseout",this._onBandLeave)}if(this._bandHitEls=[],this._activeBandIndex=-1,null==(i=this.ctx)?void 0:i.events)try{null==(a=(s=this.ctx.events).removeEventListener)||a.call(s,"dataPointMouseEnter",this._onCellEnter),null==(n=(r=this.ctx.events).removeEventListener)||n.call(r,"dataPointMouseLeave",this._onCellLeave)}catch(t){}}_attachBandHoverListeners(){if(Nt.isBrowser())for(let t=0;t<this._bandHitEls.length;t++){const e=this._bandHitEls[t];e.addEventListener("mousemove",this._onBandEnter),e.addEventListener("mouseout",this._onBandLeave)}}_onBandEnter(t){var e,i,s,a;const r=this.w,n=t.currentTarget,o=parseInt(null!=(e=n.getAttribute("data:range-index"))?e:"-1",10);o<0||o===this._activeBandIndex||(this._activeBandIndex=o,null==(a=null==(s=null==(i=this.ctx)?void 0:i.events)?void 0:s.fireEvent)||a.call(s,"legendHover",[this.ctx,o,r]),this._highlightRange(o,"highlight"))}_onBandLeave(){if(this._activeBandIndex<0)return;const t=this._activeBandIndex;this._activeBandIndex=-1,this._highlightRange(t,"reset")}_highlightRange(t,e){var i;((null==(i=this.panelsW)?void 0:i.call(this))||[this.w]).forEach(i=>new W(i).highlightRangeInSeries(t,e))}_attachHoverListeners(){var t,e;Nt.isBrowser()&&(null==(e=null==(t=this.ctx)?void 0:t.events)?void 0:e.addEventListener)&&(this.ctx.events.addEventListener("dataPointMouseEnter",this._onCellEnter),this.ctx.events.addEventListener("dataPointMouseLeave",this._onCellLeave))}_onCellEnter(...t){var e,i,s;if(!this.arrowEl)return;const a=t[t.length-1];if(!a||"object"!=typeof a)return;const r=a.w||this.w,n=a.seriesIndex,o=a.dataPointIndex;if("number"!=typeof n||"number"!=typeof o)return;if(!de.supports(r))return;let l;l=this._continuous?ne(r,n,o):null==(s=null==(i=null==(e=r.seriesData)?void 0:e.series)?void 0:i[n])?void 0:s[o],null==l||Number.isNaN(l)||this._positionArrow(l)}_onCellLeave(){this.arrowEl&&(this.arrowEl.setAttribute("opacity","0"),this.hoverValueEl&&(this.hoverValueEl.style.opacity="0"))}_positionArrow(t){if(!this.arrowEl||!this._geom)return;const{isVertical:e,position:i,stripX:s,stripY:a,stripLength:r,stripThickness:n,arrowSize:o}=this._geom,l=this._min,h=this._max-l;let c;if(c=0===h?.5:(t-l)/h,c<0&&(c=0),c>1&&(c=1),e){const t=a+r-c*r;let e,l;"left"===i?(e=s+n,l=e+o):(e=s,l=e-o);const h=[`${e},${t}`,`${l},${t-o/2}`,`${l},${t+o/2}`].join(" ");this.arrowEl.setAttribute("points",h)}else{const t=s+c*r;let e,l;"top"===i?(e=a+n,l=e+o):(e=a,l=e-o);const h=[`${t},${e}`,`${t-o/2},${l}`,`${t+o/2},${l}`].join(" ");this.arrowEl.setAttribute("points",h)}if(this.arrowEl.setAttribute("opacity","1"),this.hoverValueEl){const l=this._getFormatter();if(this.hoverValueEl.textContent=l(t),e){const t=a+r-c*r;"left"===i?this.hoverValueEl.style.left=`${s+n+o+8}px`:(this.hoverValueEl.style.left=s-o-8+"px",this.hoverValueEl.style.transform="translateX(-100%)"),this.hoverValueEl.style.top=t-9+"px"}else{const t=s+c*r;this.hoverValueEl.style.left=`${t}px`,this.hoverValueEl.style.transform="translateX(-50%)",this.hoverValueEl.style.top="top"===i?`${a+n+o+8}px`:a-o-18+"px"}this.hoverValueEl.style.opacity="1"}}_buildArrow(t,e,i){const s=ft.createElementNS(ce,"polygon");return s.setAttribute("fill",e),s.setAttribute("opacity","0"),s.setAttribute("class","apexcharts-heatmap-gradient-arrow"),s.setAttribute("points","0,0 0,0 0,0"),s.setAttribute("pointer-events","none"),s}_paintStops(){const t=this._computeStops(),e=this._grad;return this._min=t.min,this._max=t.max,e.innerHTML="",t.stops.forEach(t=>{const i=ft.createElementNS(ce,"stop");i.setAttribute("offset",`${(100*t.percent).toFixed(2)}%`),i.setAttribute("stop-color",t.color),e.appendChild(i)}),t}_computeStops(){var t,e;const i=this.w,s=de.colorScaleOf(i)||{},a=this._cfg(),r=le(i);if(r)return this._continuous=!0,{min:r.min,max:r.max,stops:r.legendStops,bands:[]};this._continuous=!1;let n=1/0,h=-1/0;const c=(null==(t=i.seriesData)?void 0:t.series)||[];for(let t=0;t<c.length;t++){const e=c[t];if(e)for(let t=0;t<e.length;t++){const i=e[t];null==i||Number.isNaN(i)||(i<n&&(n=i),i>h&&(h=i))}}Number.isFinite(n)||(n=0),Number.isFinite(h)||(h=0);let d=n,u=h;const p=void 0!==s.min&&void 0!==s.max&&s.max>s.min;p?(d=s.min,u=s.max):(void 0!==s.min&&(d=s.min<n?s.min:n),void 0!==s.max&&(u=s.max>h?s.max:h));const g=[],f=[];if(s.ranges&&s.ranges.length>0){const t=s.ranges.map((t,e)=>l(o({},t),{_originalIndex:e})).sort((t,e)=>t.from-e.from),e=t[0].from,i=t[t.length-1].to;d=e,u=i;const a=i-e||1;t.forEach(t=>{const i=(t.from-e)/a,s=(t.to-e)/a;g.push({percent:(i+s)/2,color:t.color}),f.push({index:t._originalIndex,p1:i,p2:s})})}else{const t=i.globals.colors[0]||"#008FFB",r=new Zt,n=i.config.chart.type,o=i.config.plotOptions[n]||{},l=null!=(e=o.shadeIntensity)?e:.5,h=i.globals,c=h.hasNegs,f="heatmap"===n&&!o.distributed&&!p&&h.maxY>=h.minY,m=f?h.maxY:u,x=Math.abs(m)+Math.abs(f?s.min<h.minY?s.min:h.minY:d),b=1.25*l,y=Math.max(2,a.stops||16);for(let e=0;e<y;e++){const s=e/(y-1),a=0===x?0:Math.min(d+s*(u-d),m)/x,h=Math.max(-1,Math.min(1,c?o.reverseNegativeShade?(a<0?a:1-a)*b:a<=0?1-(1+a)*l:(1-a)*l:(1-a)*("treemap"===n?b:1))),p=o.enableShades?r.shadeColor("dark"===i.config.theme.mode?-h:h,t):t;g.push({percent:s,color:p})}}return{min:d,max:u,stops:g,bands:f}}}function ue(t){return t.classList.contains("apexcharts-legend-series")||t.classList.contains("apexcharts-legend-text")||t.classList.contains("apexcharts-legend-marker")}c.default.registerFeatures({legend:class{constructor(t,e){this.w=t,this.ctx=e,this.updateSeries=(...t)=>e.updateHelpers._updateSeries(...t),this.onLegendClick=this.onLegendClick.bind(this),this.onLegendHovered=this.onLegendHovered.bind(this),this.onLegendClickEvent=this.onLegendClickEvent.bind(this),this.onLegendPointerDown=this.onLegendPointerDown.bind(this),this.onLegendPointerUp=this.onLegendPointerUp.bind(this),this.legendPress=null,this.recoveredRel=null,this.isBarsDistributed="bar"===this.w.config.chart.type&&this.w.config.plotOptions.bar.distributed&&1===this.w.config.series.length,this.legendHelpers=new te(this)}init(){var t;const e=this.w,i=e.globals,s=e.config;null==(t=this.heatmapGradientLegend)||t.destroy(),this.heatmapGradientLegend=null,this.isBarsDistributed="bar"===s.chart.type&&s.plotOptions.bar.distributed&&1===s.series.length;const a=s.legend.showForSingleSeries&&1===this.w.seriesData.series.length||this.isBarsDistributed||"heatmap"===s.chart.type||de.isEnabled(e)||this.w.seriesData.series.length>1;if(this.legendHelpers.appendToForeignObject(),(a||!i.axisCharts)&&s.legend.show){const t=e.dom.elLegendWrap;for(;t.firstChild;)t.removeChild(t.firstChild);de.isEnabled(e)?(this.heatmapGradientLegend=new de(e,this.ctx),this.heatmapGradientLegend.draw()):(this.drawLegends(),"bottom"===s.legend.position||"top"===s.legend.position?this.legendAlignHorizontal():"right"!==s.legend.position&&"left"!==s.legend.position||this.legendAlignVertical())}}createLegendMarker({i:t,fillcolor:e}){const i=this.w,s=ft.createElement("span");s.classList.add("apexcharts-legend-marker");const a=i.config.legend.markers.shape||i.config.markers.shape;let r=a;Array.isArray(a)&&(r=a[t]);const n=Array.isArray(i.config.legend.markers.size)?parseFloat(i.config.legend.markers.size[t]):parseFloat(i.config.legend.markers.size),h=Array.isArray(i.config.legend.markers.offsetX)?parseFloat(i.config.legend.markers.offsetX[t]):parseFloat(i.config.legend.markers.offsetX),c=Array.isArray(i.config.legend.markers.offsetY)?parseFloat(i.config.legend.markers.offsetY[t]):parseFloat(i.config.legend.markers.offsetY),d=Array.isArray(i.config.legend.markers.strokeWidth)?parseFloat(i.config.legend.markers.strokeWidth[t]):parseFloat(i.config.legend.markers.strokeWidth),u=s.style;if(u.height=2*(n+d)+"px",u.width=2*(n+d)+"px",u.left=h+"px",u.top=c+"px",i.config.legend.markers.customHTML)u.background="transparent",u.color=e[t],Array.isArray(i.config.legend.markers.customHTML)?i.config.legend.markers.customHTML[t]&&(s.innerHTML=i.config.legend.markers.customHTML[t]()):s.innerHTML=i.config.legend.markers.customHTML();else{const i=new z(this.ctx.w,this.ctx).getMarkerConfig({cssClass:`apexcharts-legend-marker apexcharts-marker apexcharts-marker-${r}`,seriesIndex:t,strokeWidth:d,size:n}),a=(Nt.isBrowser()?window.SVG:global.SVG)().addTo(s).size("100%","100%"),h=new R(this.w).drawMarker(0,0,l(o({},i),{pointFillColor:Array.isArray(e)?e[t]:i.pointFillColor,shape:r}));h.node.style.transform="triangle"===r?"translate(50%, 45%)":"translate(50%, 50%)",a.add(h)}return s}drawLegends(){var t;const e=this,i=this.w,s=i.dom.elLegendWrap,a=i.config.legend.fontFamily;let r=i.seriesData.seriesNames,n=i.config.legend.markers.fillColors?i.config.legend.markers.fillColors.slice():i.globals.colors.slice();if("heatmap"===i.config.chart.type){const t=i.config.plotOptions.heatmap.colorScale.ranges;r=t.map(t=>t.name?t.name:t.from+" - "+t.to),n=t.map(t=>t.color)}else this.isBarsDistributed&&(r=i.labelData.labels.slice());i.config.legend.customLegendItems.length&&(r=i.config.legend.customLegendItems);const o=i.formatters.legendFormatter,l=i.config.legend.inverseOrder,h=[];i.labelData.seriesGroups.length>1&&i.config.legend.clusterGroupedSeries&&i.labelData.seriesGroups.forEach((t,e)=>{h[e]=ft.createElement("div"),h[e].classList.add("apexcharts-legend-group",`apexcharts-legend-group-${e}`),"horizontal"===i.config.legend.clusterGroupedSeriesOrientation?s.classList.add("apexcharts-legend-group-horizontal"):h[e].classList.add("apexcharts-legend-group-vertical")});for(let e=l?r.length-1:0;l?e>=0:e<=r.length-1;l?e--:e++){const l=o(r[e],{seriesIndex:e,w:i});let c=!1,d=!1;if(i.globals.collapsedSeries.length>0)for(let t=0;t<i.globals.collapsedSeries.length;t++)i.globals.collapsedSeries[t].index===e&&(c=!0);if(i.globals.ancillaryCollapsedSeriesIndices.length>0)for(let t=0;t<i.globals.ancillaryCollapsedSeriesIndices.length;t++)i.globals.ancillaryCollapsedSeriesIndices[t]===e&&(d=!0);const u=this.createLegendMarker({i:e,fillcolor:n});R.setAttrs(u,{rel:e+1,"data:collapsed":c||d}),(c||d)&&u.classList.add("apexcharts-inactive-legend");const p=ft.createElement("div");if(i.config.chart.accessibility.enabled&&i.config.chart.accessibility.keyboard.enabled){p.setAttribute("role","button"),p.setAttribute("tabindex","0");const t=Array.isArray(l)?l.join(" "):l,e=c||d,i=e?"hidden":"visible";p.setAttribute("aria-label",`${t}, ${i}. Press Enter or Space to toggle.`),p.setAttribute("aria-pressed",e?"true":"false")}const g=ft.createElement("span");g.classList.add("apexcharts-legend-text");const f=Array.isArray(l)?l.join(" "):l,m=r[e];String(f)===String(Array.isArray(m)?m.join(" "):m)?g.textContent=f:(g.innerHTML=f,g.setAttribute("data:html","1"));let x=i.config.legend.labels.useSeriesColors?i.globals.colors[e]:Array.isArray(i.config.legend.labels.colors)?null==(t=i.config.legend.labels.colors)?void 0:t[e]:i.config.legend.labels.colors;x||(x=i.config.chart.foreColor),g.style.color=x,g.style.fontSize=i.config.legend.fontSize,g.style.fontWeight=i.config.legend.fontWeight,g.style.fontFamily=a||i.config.chart.fontFamily,R.setAttrs(g,{rel:e+1,i:e,"data:default-text":encodeURIComponent(l),"data:collapsed":c||d}),p.appendChild(u),p.appendChild(g);const b=new P(this.w);if(!i.config.legend.showForZeroSeries){0===b.getSeriesTotalByIndex(e)&&b.seriesHaveSameValues(e)&&!b.isSeriesNull(e)&&-1===i.globals.collapsedSeriesIndices.indexOf(e)&&-1===i.globals.ancillaryCollapsedSeriesIndices.indexOf(e)&&p.classList.add("apexcharts-hidden-zero-series")}i.config.legend.showForNullSeries||b.isSeriesNull(e)&&-1===i.globals.collapsedSeriesIndices.indexOf(e)&&-1===i.globals.ancillaryCollapsedSeriesIndices.indexOf(e)&&p.classList.add("apexcharts-hidden-null-series");const y=h[i.labelData.seriesGroupIndex[e]];y&&!y.parentNode&&s.appendChild(y),(y||s).appendChild(p),s.classList.add(`apexcharts-align-${i.config.legend.horizontalAlign}`),s.classList.add("apx-legend-position-"+i.config.legend.position),p.classList.add("apexcharts-legend-series"),p.style.margin=`${i.config.legend.itemMargin.vertical}px ${i.config.legend.itemMargin.horizontal}px`,s.style.width=i.config.legend.width?i.config.legend.width+"px":"",s.style.height=i.config.legend.height?i.config.legend.height+"px":"",R.setAttrs(p,{rel:e+1,seriesName:Zt.escapeString(r[e]),"data:collapsed":c||d}),(c||d)&&p.classList.add("apexcharts-inactive-legend"),i.config.legend.onItemClick.toggleDataSeries||p.classList.add("apexcharts-no-click")}i.dom.elWrap.addEventListener("click",e.onLegendClickEvent,!0),i.dom.elWrap.addEventListener("pointerdown",e.onLegendPointerDown,!0),i.dom.elWrap.addEventListener("pointerup",e.onLegendPointerUp,!0),i.config.legend.onItemHover.highlightDataSeries&&0===i.config.legend.customLegendItems.length&&(i.dom.elWrap.addEventListener("mousemove",e.onLegendHovered,!0),i.dom.elWrap.addEventListener("mouseout",e.onLegendHovered,!0)),i.config.chart.accessibility.enabled&&i.config.chart.accessibility.keyboard.enabled&&i.dom.elWrap.addEventListener("keydown",e.onLegendKeyDown.bind(e),!0)}setLegendWrapXY(t,e){const i=this.w,s=i.dom.elLegendWrap,a=s.clientHeight;let r=0,n=0;if("bottom"===i.config.legend.position)n=i.globals.svgHeight-Math.min(a,i.globals.svgHeight/2)-5;else if("top"===i.config.legend.position){const t=new Z(this.w,this.ctx),e=t.dimHelpers.getTitleSubtitleCoords("title").height,i=t.dimHelpers.getTitleSubtitleCoords("subtitle").height;n=(e>0?e-10:0)+(i>0?i-10:0)}s.style.position="absolute",r=r+t+i.config.legend.offsetX,n=n+e+i.config.legend.offsetY,s.style.left=r+"px",s.style.top=n+"px","right"===i.config.legend.position&&(s.style.left="auto",s.style.right=25+i.config.legend.offsetX+"px");["width","height"].forEach(t=>{s&&s.style[t]&&(s.style[t]=parseInt(String(i.config.legend[t]),10)+"px")})}legendAlignHorizontal(){const t=this.w;t.dom.elLegendWrap.style.right="0";const e=new Z(this.w,this.ctx),i=e.dimHelpers.getTitleSubtitleCoords("title"),s=e.dimHelpers.getTitleSubtitleCoords("subtitle");let a=0;"top"===t.config.legend.position&&(a=i.height+s.height+t.config.title.margin+t.config.subtitle.margin-10),this.setLegendWrapXY(20,a)}legendAlignVertical(){this.setLegendWrapXY("left"===this.w.config.legend.position?20:0,20)}onLegendHovered(t){const e=this.w,i=t.target;if(!ue(i))return;const s=i.getAttribute("rel"),a="mousemove"===t.type,r=t.relatedTarget,n=e.globals.cachedSelectors;if(a?n.legendRel===s:r&&ue(r)&&r.getAttribute("rel")===s&&e.dom.elWrap.contains(r))return;n.legendRel=a?s:null;const o=new W(this.ctx.w);if("heatmap"===e.config.chart.type||this.isBarsDistributed){const t=parseInt(null!=s?s:"0",10)-1;a&&this.ctx.events.fireEvent("legendHover",[this.ctx,t,this.w]),o.highlightRangeInSeries(t,a?"highlight":"reset")}else i.closest(".apexcharts-inactive-legend")||o.toggleSeriesOnHover(t,i)}onLegendKeyDown(t){const e=this,i=this.w,s=t.target;if(ue(s)&&("Enter"===t.key||" "===t.key)){t.preventDefault();const a=s.getAttribute("rel");e.onLegendClick(t),null!==a&&i.config.legend.onItemClick.toggleDataSeries&&requestAnimationFrame(()=>{var t;const e=null==(t=i.dom.baseEl)?void 0:t.querySelector(`.apexcharts-legend-series[rel="${a}"]`);e&&e.focus()})}}onLegendPointerDown(t){const e=t.target;this.recoveredRel=null,this.legendPress=0===t.button&&ue(e)?{el:e,rel:e.getAttribute("rel")}:null}onLegendPointerUp(t){const e=this.legendPress;this.legendPress=null;const i=t.target;e&&!e.el.isConnected&&ue(i)&&i.getAttribute("rel")===e.rel&&(this.recoveredRel=e.rel,this.onLegendClick(t))}onLegendClickEvent(t){const e=this.recoveredRel;this.recoveredRel=null;const i=t.target;null!==e&&t.isTrusted&&i.getAttribute("rel")===e||this.onLegendClick(t)}onLegendClick(t){var e;const i=this.w,s=t.target;if(!i.config.legend.customLegendItems.length&&ue(s)){const t=parseInt(null!=(e=s.getAttribute("rel"))?e:"0",10)-1,a="true"===s.getAttribute("data:collapsed"),r=this.w.config.chart.events.legendClick;"function"==typeof r&&r(this.ctx,t,this.w),this.ctx.events.fireEvent("legendClick",[this.ctx,t,this.w]);const n=this.w.config.legend.markers.onClick;"function"==typeof n&&s.classList.contains("apexcharts-legend-marker")&&(n(this.ctx,t,this.w),this.ctx.events.fireEvent("legendMarkerClick",[this.ctx,t,this.w]));"treemap"!==i.config.chart.type&&"heatmap"!==i.config.chart.type&&!this.isBarsDistributed&&i.config.legend.onItemClick.toggleDataSeries&&this.legendHelpers.toggleDataSeries(t,a)}}}});class pe{constructor(t,e){this.w=t,this.ctx=e,this.ev=this.w.config.chart.events,this.selectedClass="apexcharts-selected",this.localeValues=this.w.globals.locale.toolbar,this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elMeasure=null,this.elZoomReset=null,this.elMenuIcon=null,this.elMenu=null,this.elMenuItems=[],this.t=null,this._drawnForZoom=null}resetControlAllowed(){const t=this.w.config.chart;if(!t.zoom||!t.zoom.enabled)return!1;const e=void 0===t.zoom.resetControl?"auto":t.zoom.resetControl;if("auto"!==e)return!!e;return!(t.toolbar&&t.toolbar.show&&t.toolbar.tools&&t.toolbar.tools.reset)}resetControlDue(){return!!this.w.interact.zoomed&&this.resetControlAllowed()}createToolbar(t={}){var e,i,s;const a=this.w,r=!!t.resetOnly,n=()=>ft.createElementNS("http://www.w3.org/1999/xhtml","div"),h=()=>{const t=ft.createElementNS("http://www.w3.org/1999/xhtml","button");return t.setAttribute("type","button"),t},c=n();if(c.setAttribute("class","apexcharts-toolbar"),c.style.top=a.config.chart.toolbar.offsetY+"px",c.style.right=3-a.config.chart.toolbar.offsetX+"px",a.dom.elWrap.appendChild(c),this.elZoom=h(),this.elZoomIn=h(),this.elZoomOut=h(),this.elPan=h(),this.elSelection=h(),this.elMeasure=h(),this.elZoomReset=h(),this.elMenuIcon=h(),this.elMenu=n(),this.elCustomIcons=[],this.t=a.config.chart.toolbar.tools,this._drawnForZoom=null,r?(this.t={zoom:!1,zoomin:!1,zoomout:!1,selection:!1,pan:!1,measure:!1,download:!1,customIcons:[],reset:!0},this._drawnForZoom="wrap"):!this.t.reset&&this.resetControlDue()&&(this.t=l(o({},this.t),{reset:!0}),this._drawnForZoom="control"),Array.isArray(this.t.customIcons))for(let t=0;t<this.t.customIcons.length;t++)this.elCustomIcons.push(h());const d=[],u=(t,e,i)=>{const s=t.toLowerCase();this.t[s]&&a.config.chart.zoom.enabled&&d.push({el:e,icon:"string"==typeof this.t[s]?this.t[s]:i,title:this.localeValues[t],class:`apexcharts-${s}-icon`})};u("zoomIn",this.elZoomIn,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M12 5v14M5 12h14"/>\n</svg>\n'),u("zoomOut",this.elZoomOut,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M5 12h14"/>\n</svg>\n');const p=t=>{this.t[t]&&a.config.chart[t].enabled&&d.push({el:"zoom"===t?this.elZoom:this.elSelection,icon:"string"==typeof this.t[t]?this.t[t]:"zoom"===t?'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="11" cy="11" r="7"/>\n <path d="m21 21-4.3-4.3M8 11h6M11 8v6"/>\n</svg>\n':'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M5 3a2 2 0 0 0-2 2"/>\n <path d="M19 3a2 2 0 0 1 2 2"/>\n <path d="M21 19a2 2 0 0 1-2 2"/>\n <path d="M5 21a2 2 0 0 1-2-2"/>\n <path d="M9 3h1M14 3h1M9 21h1M14 21h1M3 9v1M3 14v1M21 9v1M21 14v1"/>\n</svg>\n',title:this.localeValues["zoom"===t?"selectionZoom":"selection"],class:`apexcharts-${t}-icon`})};p("zoom"),p("selection"),this.t.pan&&a.config.chart.zoom.enabled&&d.push({el:this.elPan,icon:"string"==typeof this.t.pan?this.t.pan:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M5 9 2 12l3 3"/>\n <path d="M9 5l3-3 3 3"/>\n <path d="M15 19l-3 3-3-3"/>\n <path d="M19 9l3 3-3 3"/>\n <path d="M2 12h20"/>\n <path d="M12 2v20"/>\n</svg>\n',title:this.localeValues.pan,class:"apexcharts-pan-icon"}),this.t.measure&&a.config.chart.measure&&a.config.chart.measure.enabled&&d.push({el:this.elMeasure,icon:"string"==typeof this.t.measure?this.t.measure:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.4 2.4 0 0 1 0-3.4l2.6-2.6a2.4 2.4 0 0 1 3.4 0Z"/>\n <path d="m14.5 12.5 2-2"/>\n <path d="m11.5 9.5 2-2"/>\n <path d="m8.5 6.5 2-2"/>\n <path d="m17.5 15.5 2-2"/>\n</svg>\n',title:this.localeValues.measure||"Measure",class:"apexcharts-measure-icon"}),u("reset",this.elZoomReset,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/>\n <path d="M3 3v5h5"/>\n</svg>\n'),this.t.download&&d.push({el:this.elMenuIcon,icon:"string"==typeof this.t.download?this.t.download:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4 6h16M4 12h16M4 18h16"/>\n</svg>\n',title:this.localeValues.menu,class:"apexcharts-menu-icon"});for(let t=0;t<this.elCustomIcons.length;t++)d.push({el:this.elCustomIcons[t],icon:this.t.customIcons[t].icon,title:this.t.customIcons[t].title,index:this.t.customIcons[t].index,class:"apexcharts-toolbar-custom-icon "+this.t.customIcons[t].class});d.forEach((t,e)=>{t.index&&Zt.moveIndexInArray(d,e,t.index)});for(let t=0;t<d.length;t++)R.setAttrs(d[t].el,{class:d[t].class,title:d[t].title,"aria-label":d[t].title}),d[t].el.innerHTML=d[t].icon,c.appendChild(d[t].el);this.elZoom.parentNode&&this.elZoom.setAttribute("aria-pressed",String(!!a.interact.zoomEnabled)),this.elSelection.parentNode&&this.elSelection.setAttribute("aria-pressed",String(!!a.interact.selectionEnabled)),this.elPan.parentNode&&this.elPan.setAttribute("aria-pressed",String(!!a.interact.panEnabled)),this.elMeasure.parentNode&&this.elMeasure.setAttribute("aria-pressed",String(!!a.interact.measureEnabled)),this.elMenuIcon.parentNode&&(this.elMenuIcon.setAttribute("aria-haspopup","true"),this.elMenuIcon.setAttribute("aria-expanded","false")),r||this._createHamburgerMenu(c),r?null==(e=this.elZoomReset)||e.addEventListener("click",this.handleZoomReset.bind(this)):(a.interact.zoomEnabled?this.elZoom.classList.add(this.selectedClass):a.interact.panEnabled?this.elPan.classList.add(this.selectedClass):a.interact.selectionEnabled?this.elSelection.classList.add(this.selectedClass):a.interact.measureEnabled&&this.elMeasure&&(this.elMeasure.classList.add(this.selectedClass),null==(s=null==(i=this.ctx.measure)?void 0:i.startMeasure)||s.call(i)),this.addToolbarEventListeners())}_createHamburgerMenu(t){this.elMenuItems=[],t.appendChild(this.elMenu),R.setAttrs(this.elMenu,{class:"apexcharts-menu",role:"menu"});const e=[{name:"exportSVG",title:this.localeValues.exportToSVG},{name:"exportPNG",title:this.localeValues.exportToPNG},{name:"exportCSV",title:this.localeValues.exportToCSV}];for(let t=0;t<e.length;t++)this.elMenuItems.push(ft.createElementNS("http://www.w3.org/1999/xhtml","div")),this.elMenuItems[t].innerHTML=e[t].title,R.setAttrs(this.elMenuItems[t],{class:`apexcharts-menu-item ${e[t].name}`,title:e[t].title,role:"menuitem",tabindex:"-1"}),this.elMenu.appendChild(this.elMenuItems[t])}addToolbarEventListeners(){var t,e,i,s,a,r,n,o,l;null==(t=this.elZoomReset)||t.addEventListener("click",this.handleZoomReset.bind(this)),null==(e=this.elSelection)||e.addEventListener("click",this.toggleZoomSelection.bind(this,"selection")),null==(i=this.elZoom)||i.addEventListener("click",this.toggleZoomSelection.bind(this,"zoom")),null==(s=this.elZoomIn)||s.addEventListener("click",this.handleZoomIn.bind(this)),null==(a=this.elZoomOut)||a.addEventListener("click",this.handleZoomOut.bind(this)),null==(r=this.elPan)||r.addEventListener("click",this.togglePanning.bind(this)),null==(n=this.elMeasure)||n.addEventListener("click",this.toggleMeasure.bind(this)),null==(o=this.elMenuIcon)||o.addEventListener("click",this.toggleMenu.bind(this)),this.elMenuItems.forEach(t=>{t.classList.contains("exportSVG")?t.addEventListener("click",this.handleDownload.bind(this,"svg")):t.classList.contains("exportPNG")?t.addEventListener("click",this.handleDownload.bind(this,"png")):t.classList.contains("exportCSV")&&t.addEventListener("click",this.handleDownload.bind(this,"csv"))});for(let t=0;t<this.t.customIcons.length;t++)this.elCustomIcons[t].addEventListener("click",this.t.customIcons[t].click.bind(this,this.ctx,this.ctx.w));[this.elZoomReset,this.elSelection,this.elZoom,this.elZoomIn,this.elZoomOut,this.elPan,this.elMeasure,this.elMenuIcon,...this.elCustomIcons].forEach(t=>{t.addEventListener("keydown",e=>{if("Enter"===e.key||" "===e.key){e.preventDefault();const i=t.className;t.click(),requestAnimationFrame(()=>{const t=this.w.dom.baseEl;if(!t)return;const e=i.split(" ").find(t=>t.startsWith("apexcharts-"));if(!e)return;const s=t.querySelector(`.${e}`);s&&s.focus()})}})}),null==(l=this.elMenuIcon)||l.addEventListener("keydown",t=>{var e;"ArrowDown"!==t.key&&"ArrowUp"!==t.key||(t.preventDefault(),(null==(e=this.elMenu)?void 0:e.classList.contains("apexcharts-menu-open"))||this.toggleMenu(),window.setTimeout(()=>{const e="ArrowDown"===t.key?0:this.elMenuItems.length-1;this.elMenuItems[e]&&this.elMenuItems[e].focus()},20))}),this.elMenuItems.forEach((t,e)=>{t.addEventListener("keydown",i=>{var s;if("ArrowDown"===i.key){i.preventDefault();(this.elMenuItems[e+1]||this.elMenuItems[0]).focus()}else if("ArrowUp"===i.key){i.preventDefault();(this.elMenuItems[e-1]||this.elMenuItems[this.elMenuItems.length-1]).focus()}else"Escape"===i.key||"Tab"===i.key?(this._closeMenu(),null==(s=this.elMenuIcon)||s.focus(),"Tab"===i.key||i.preventDefault()):"Enter"!==i.key&&" "!==i.key||(i.preventDefault(),t.click())})})}toggleZoomSelection(t){this.ctx.getSyncedCharts().forEach(e=>{const i=e.ctx.toolbar,s="selection"===t?"selectionEnabled":"zoomEnabled",a=!!e.w.interact[s];i.toggleOtherControls();const r="selection"===t?i.elSelection:i.elZoom;a||(e.w.interact[s]=!0,null==r||r.classList.add(i.selectedClass)),null==r||r.setAttribute("aria-pressed",String(!!e.w.interact[s]))})}toggleMeasure(){var t,e,i,s;const a=this.w,r=!a.interact.measureEnabled;this.toggleOtherControls(),r&&(a.interact.measureEnabled=!0,null==(t=this.elMeasure)||t.classList.add(this.selectedClass),null==(i=null==(e=this.ctx.measure)?void 0:e.startMeasure)||i.call(e)),null==(s=this.elMeasure)||s.setAttribute("aria-pressed",String(a.interact.measureEnabled))}getToolbarIconsReference(){const t=this.w;this.elZoom||(this.elZoom=t.dom.baseEl.querySelector(".apexcharts-zoom-icon")),this.elPan||(this.elPan=t.dom.baseEl.querySelector(".apexcharts-pan-icon")),this.elSelection||(this.elSelection=t.dom.baseEl.querySelector(".apexcharts-selection-icon")),this.elMeasure||(this.elMeasure=t.dom.baseEl.querySelector(".apexcharts-measure-icon"))}enableZoomPanFromToolbar(t){this.toggleOtherControls(),"pan"===t?this.w.interact.panEnabled=!0:this.w.interact.zoomEnabled=!0;const e="pan"===t?this.elPan:this.elZoom,i="pan"===t?this.elZoom:this.elPan;e&&e.classList.add(this.selectedClass),i&&i.classList.remove(this.selectedClass)}togglePanning(){this.ctx.getSyncedCharts().forEach(t=>{var e,i;const s=t.ctx.toolbar,a=!!t.w.interact.panEnabled;s.toggleOtherControls(),a||(t.w.interact.panEnabled=!0,null==(e=s.elPan)||e.classList.add(s.selectedClass)),null==(i=s.elPan)||i.setAttribute("aria-pressed",String(!!t.w.interact.panEnabled))})}toggleOtherControls(){var t,e,i;const s=this.w;s.interact.panEnabled=!1,s.interact.zoomEnabled=!1,s.interact.selectionEnabled=!1,s.interact.measureEnabled&&(s.interact.measureEnabled=!1,null==(e=null==(t=this.ctx.measure)?void 0:t.stopMeasure)||e.call(t),null==(i=this.elMeasure)||i.setAttribute("aria-pressed","false")),this.getToolbarIconsReference();[this.elPan,this.elSelection,this.elZoom,this.elMeasure].forEach(t=>{t&&t.classList.remove(this.selectedClass)})}_currentXRange(){const t=this.w;return t.axisFlags.isRangeBar?{minX:t.globals.minY,maxX:t.globals.maxY}:{minX:t.globals.minX,maxX:t.globals.maxX}}handleZoomIn(){const t=this.w,{minX:e,maxX:i}=this._currentXRange(),s=(e+i)/2,a=(e+s)/2,r=(i+s)/2,n=this._getNewMinXMaxX(a,r);t.interact.disableZoomIn||this.zoomUpdateOptions(n.minX,n.maxX)}handleZoomOut(){const t=this.w,{minX:e,maxX:i}=this._currentXRange();if("datetime"===t.config.xaxis.type&&new Date(e).getUTCFullYear()<1e3)return;const s=(e+i)/2,a=e-(s-e),r=i-(s-i),n=this._getNewMinXMaxX(a,r);t.interact.disableZoomOut||this.zoomUpdateOptions(n.minX,n.maxX)}_getNewMinXMaxX(t,e){const i=this.w.config.xaxis.convertedCatToNumeric;return{minX:i?Math.floor(t):t,maxX:i?Math.floor(e):e}}zoomUpdateOptions(t,e){const i=this.w;if(void 0===t&&void 0===e)return void this.handleZoomReset();if(i.config.xaxis.convertedCatToNumeric&&(t<1&&(t=1,e=i.globals.dataPoints),e-t<2))return;let s={min:t,max:e};const a=this.getBeforeZoomRange(s,void 0);a&&(s=a.xaxis);const r={xaxis:s};if(!i.globals.initialConfig)return;const n=Zt.clone(i.globals.initialConfig.yaxis);i.config.chart.group||(r.yaxis=n),this.w.interact.zoomed=!0,this.ctx.updateHelpers._updateOptions(r,!1,this.w.config.chart.animations.dynamicAnimation.enabled),this.zoomCallback(s,n)}zoomCallback(t,e){"function"==typeof this.ev.zoomed&&(this.ev.zoomed(this.ctx,{xaxis:t,yaxis:e}),this.ctx.events.fireEvent("zoomed",{xaxis:t,yaxis:e}))}getBeforeZoomRange(t,e){let i=null;return"function"==typeof this.ev.beforeZoom&&(i=this.ev.beforeZoom(this,{xaxis:t,yaxis:e})),i}toggleMenu(){window.setTimeout(()=>{var t,e,i;(null==(t=this.elMenu)?void 0:t.classList.contains("apexcharts-menu-open"))?this._closeMenu():(null==(e=this.elMenu)||e.classList.add("apexcharts-menu-open"),null==(i=this.elMenuIcon)||i.setAttribute("aria-expanded","true"))},0)}_closeMenu(){var t,e;null==(t=this.elMenu)||t.classList.remove("apexcharts-menu-open"),null==(e=this.elMenuIcon)||e.setAttribute("aria-expanded","false")}handleDownload(t){const e=this.w,i=new Qt(this.w,this.ctx);switch(t){case"svg":i.exportToSVG();break;case"png":i.exportToPng();break;case"csv":i.exportToCSV({series:e.config.series,columnDelimiter:e.config.chart.toolbar.export.csv.columnDelimiter})}}clearZoomAffordance(){const t=this._drawnForZoom;if(this._drawnForZoom=null,!t||!this.elZoomReset)return;const e=this.elZoomReset.parentNode,i="wrap"===t?e:this.elZoomReset;i&&i.parentNode&&i.parentNode.removeChild(i)}handleZoomReset(){this.ctx.getSyncedCharts().forEach(t=>{var e;const i=t.w;if(!i.interact.zoomed)return;if(i.globals.lastXAxis.min=i.globals.initialConfig.xaxis.min,i.globals.lastXAxis.max=i.globals.initialConfig.xaxis.max,t.updateHelpers.revertDefaultAxisMinMax(),"function"==typeof i.config.chart.events.beforeResetZoom){const e=i.config.chart.events.beforeResetZoom(t,i);e&&t.updateHelpers.revertDefaultAxisMinMax(e)}"function"==typeof i.config.chart.events.zoomed&&t.ctx.toolbar.zoomCallback({min:i.config.xaxis.min,max:i.config.xaxis.max});const s=t.ctx.series.emptyCollapsedSeries(Zt.clone(i.globals._initialSeriesPeek));t.updateHelpers._updateSeries(s,i.config.chart.animations.dynamicAnimation.enabled),i.interact.zoomed=!1,null==(e=t.ctx.toolbar)||e.clearZoomAffordance()})}destroy(){this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elMeasure=null,this.elZoomReset=null,this.elMenuIcon=null}}class ge{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)/ge.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*ge.xRatio(t)}static plotRect(t){var e,i,s;const a=(null==(e=t.dom.Paper)?void 0:e.node)||(null==(i=t.dom.baseEl)?void 0:i.querySelector(".apexcharts-svg")),r=(null==(s=a||t.dom.elWrap)?void 0:s.getBoundingClientRect())||{left:0,top:0,width:0},n=(a&&t.globals.svgWidth?r.width/t.globals.svgWidth:1)||1;return{left:r.left+t.layout.translateX*n,top:r.top+t.layout.translateY*n,width:t.layout.gridWidth*n,height:t.layout.gridHeight*n,zoom:n}}static screenXToPlotPx(t,e,i=ge.plotRect(t)){return(e-i.left)/i.zoom}}c.default.registerFeatures({toolbar:pe,zoomPanSelection:class extends pe{constructor(t,e){super(t,e),this.w=t,this.ctx=e,this.dragged=!1,this.graphics=new R(this.w),this.eventList=["mousedown","mouseleave","mousemove","touchstart","touchmove","mouseup","touchend"],this.clientX=0,this.clientY=0,this.startX=0,this.endX=0,this.dragX=0,this.startY=0,this.endY=0,this.dragY=0,this.moveDirection="none"}init({xyRatios:t}){const e=this.w,i=this;this.xyRatios=t,this.zoomRect=this.graphics.drawRect(0,0,0,0),this.selectionRect=this.graphics.drawRect(0,0,0,0),this.constraints=new Rt(0,0,e.layout.gridWidth,e.layout.gridHeight),this.zoomRect.node.classList.add("apexcharts-zoom-rect"),this.selectionRect.node.classList.add("apexcharts-selection-rect"),e.dom.Paper.add(this.zoomRect),e.dom.Paper.add(this.selectionRect),"x"===e.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,minY:0,maxX:e.layout.gridWidth,maxY:e.layout.gridHeight}).on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")):"y"===e.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,maxX:e.layout.gridWidth}).on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")):this.slDraggableRect=this.selectionRect.draggable().on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")),this.preselectedSelection(),this.hoverArea=e.dom.baseEl.querySelector(`${e.globals.chartClass} .apexcharts-svg`),this.hoverArea&&(this.hoverArea.classList.add("apexcharts-zoomable"),this.eventList.forEach(e=>{var s;null==(s=this.hoverArea)||s.addEventListener(e,i.svgMouseEvents.bind(i,t),{capture:!1,passive:!0})}),this._wheelZoomEnabled()&&this.hoverArea.addEventListener("wheel",i.mouseWheelEvent.bind(i),{capture:!1,passive:!1}),this.hoverArea.addEventListener("keydown",i.escapeResetEvent.bind(i),{capture:!1,passive:!0}),this._momentumEnabled()&&["touchstart","touchmove","touchend","touchcancel"].forEach(t=>{var e;null==(e=this.hoverArea)||e.addEventListener(t,i.momentumTouch.bind(i),{capture:!1,passive:!1})}))}destroy(){this.slDraggableRect&&(this.slDraggableRect.draggable(!1),this.slDraggableRect.off(),this.selectionRect.off()),this.selectionRect=null,this.zoomRect=null}svgMouseEvents(t,e){const i=this.w,s=this.ctx.toolbar;if(i.interact.momentum&&i.interact.momentum.busy)return;if(this._momentumEnabled()&&e.touches&&e.touches.length>1)return;const a=i.interact.zoomEnabled?i.config.chart.zoom.type:i.config.chart.selection.type,r=i.config.chart.toolbar.autoSelected;if("measure"!==r&&(e.shiftKey?(i.interact.shiftWasPressed=!0,s.enableZoomPanFromToolbar("pan"===r?"zoom":"pan")):i.interact.shiftWasPressed&&(s.enableZoomPanFromToolbar(r),i.interact.shiftWasPressed=!1)),!e.target)return;const n=e.target.classList;let o;e.target.parentNode&&null!==e.target.parentNode&&(o=e.target.parentNode.classList);if(!(n.contains("apexcharts-legend-marker")||n.contains("apexcharts-legend-text")||o&&o.contains("apexcharts-toolbar"))){if(this.clientX="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientX:"touchend"===e.type?e.changedTouches[0].clientX:e.clientX,this.clientY="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientY:"touchend"===e.type?e.changedTouches[0].clientY:e.clientY,"mousedown"===e.type&&1===e.which||"touchstart"===e.type){if(!this._hasPlot())return;this.startX=this._screenXToPlotPx(this.clientX),this.startY=this._screenYToPlotPx(this.clientY),this.dragged=!1,this.w.interact.mousedown=!0}("mousemove"===e.type&&1===e.which||"touchmove"===e.type)&&(this.dragged=!0,i.interact.panEnabled?(i.interact.selection=null,this.w.interact.mousedown&&this.panDragging({context:this,zoomtype:a,xyRatios:this.xyRatios})):(this.w.interact.mousedown&&i.interact.zoomEnabled||this.w.interact.mousedown&&i.interact.selectionEnabled)&&(this.selection=this.selectionDrawing({context:this,zoomtype:a}))),"mouseup"!==e.type&&"touchend"!==e.type&&"mouseleave"!==e.type||this.handleMouseUp({zoomtype:a}),this.makeSelectionRectDraggable()}}handleMouseUp({zoomtype:t,isResized:e}){const i=this.w;this._hasPlot()&&(this.w.interact.mousedown||e)&&(this.endX=this._screenXToPlotPx(this.clientX),this.endY=this._screenYToPlotPx(this.clientY),this.dragX=Math.abs(this.endX-this.startX),this.dragY=Math.abs(this.endY-this.startY),(i.interact.zoomEnabled||i.interact.selectionEnabled)&&this.selectionDrawn({context:this,zoomtype:t})),i.interact.zoomEnabled&&this.hideSelectionRect(this.selectionRect),this.dragged=!1,this.w.interact.mousedown=!1}_incidentalZoomEnabled(t){var e,i,s;const a=this.w.config.chart;return!(!a.zoom||!a.zoom.enabled)&&("auto"!==t?!!t:!(!(null==(e=a.toolbar)?void 0:e.show)||!(null==(s=null==(i=a.toolbar)?void 0:i.tools)?void 0:s.reset)))}_wheelZoomEnabled(){const{zoom:t}=this.w.config.chart;return this._incidentalZoomEnabled(t&&t.allowMouseWheelZoom)}_wheelZoomGreedy(){return!0===this.w.config.chart.zoom.allowMouseWheelZoom}_showWheelHint(t){const e=this.w;if(!1===e.config.chart.zoom.wheelHint)return;if(Math.abs(t.deltaY)<=Math.abs(t.deltaX))return;const i=e.dom.elWrap;if(!i)return;let s=i.querySelector(".apexcharts-wheel-hint");if(!s){const t=ft.getWindow(),a=t&&t.navigator,r=!!a&&/Mac|iPhone|iPad/.test(a.platform||a.userAgent),n=(e.globals.locale.toolbar.wheelZoomHint||"").replace("{key}",r?"\u2318":"Ctrl");s=ft.createElement("div"),s.className="apexcharts-wheel-hint",s.setAttribute("aria-hidden","true");const o=ft.createElement("span");o.textContent=n,o.style.fontFamily=e.config.chart.fontFamily,s.appendChild(o),i.appendChild(s),s.offsetWidth}s.classList.add("apexcharts-wheel-hint-visible");const a=e.interact;a.wheelHintTimer&&clearTimeout(a.wheelHintTimer),a.wheelHintTimer=setTimeout(()=>this._hideWheelHint(),1200)}_hideWheelHint(){var t;const e=this.w,i=e.interact;i.wheelHintTimer&&(clearTimeout(i.wheelHintTimer),i.wheelHintTimer=null);const s=null==(t=e.dom.elWrap)?void 0:t.querySelector(".apexcharts-wheel-hint");s&&s.classList.remove("apexcharts-wheel-hint-visible")}_focusForKeyboard(){var t,e;const i=this.w.dom.Paper&&this.w.dom.Paper.node;if(i&&"function"==typeof i.focus&&null!==i.getAttribute("tabindex")){null==(e=null==(t=this.ctx.keyboardNavigation)?void 0:t.notePointerFocus)||e.call(t);try{i.focus({preventScroll:!0})}catch(t){i.focus()}}}escapeResetEvent(t){if("Escape"!==t.key&&"Esc"!==t.key)return;if(!this.w.interact.zoomed)return;const e=this.ctx.keyboardNavigation;e&&e.active||this.resetControlAllowed()&&this.handleZoomReset()}_wheel(){const t=this.w.interact;return t.wheel||(t.wheel={factor:1,clientX:0,rafId:null,endTimer:null}),t.wheel}mouseWheelEvent(t){const e=this._wheel();if(!this._wheelZoomGreedy()&&!t.ctrlKey&&!t.metaKey&&null==e.endTimer)return void this._showWheelHint(t);t.preventDefault(),this._hideWheelHint();let i=t.deltaY;1===t.deltaMode?i*=33:2===t.deltaMode&&(i*=330),e.factor*=Math.pow(2,i/240),e.clientX=t.clientX,null==e.rafId&&(e.rafId=requestAnimationFrame(()=>this._applyWheelZoom())),e.endTimer&&clearTimeout(e.endTimer),e.endTimer=setTimeout(()=>this._endWheelZoom(),150)}_applyWheelZoom(){const t=this.w,e=this._wheel();e.rafId=null;const i=e.factor;if(e.factor=1,1===i||t.globals.isDestroyed)return;const s=t.layout.gridWidth;if(!this._hasPlot()||!s)return;const{min:a,max:r}=this._currentXWindow(),n=r-a,o=Math.min(Math.max(this._screenXToPlotPx(e.clientX)/s,0),1);let l=n*i;const h=this._clampBounds();if(h){const e=t.globals.minXDiff>0&&isFinite(t.globals.minXDiff)?t.globals.minXDiff:0,i=Math.max(2*e,1e-6*(h.max-h.min));l<i&&(l=i),l>h.max-h.min&&(l=h.max-h.min)}let c=a+o*n-o*l,d=c+l;const u=1e-9*n;if(Math.abs(c-a)<u&&Math.abs(d-r)<u)return;if(isNaN(c)||isNaN(d))return;const p=this.getBeforeZoomRange({min:c,max:d},void 0);p&&p.xaxis&&(c=p.xaxis.min,d=p.xaxis.max),this._applyXRange(c,d,!0)}_endWheelZoom(){const t=this.w;if(this._wheel().endTimer=null,t.globals.isDestroyed||!t.interact.zoomed)return;const{min:e,max:i}=this._currentXWindow(),s=t.globals.initialConfig?Zt.clone(t.globals.initialConfig.yaxis):[],a=this.ctx.toolbar;a&&a.zoomCallback({min:e,max:i},s)}makeSelectionRectDraggable(){const t=this.w;if(!this.selectionRect)return;const e=this.selectionRect.node.getBoundingClientRect();e.width>0&&e.height>0&&(this.selectionRect.select(!1).resize(!1),this.selectionRect.select({createRot:()=>{},updateRot:()=>{},createHandle:(t,e,i,s,a)=>"l"===a||"r"===a?t.circle(8).css({"stroke-width":1,stroke:"#333",fill:"#fff"}):t.circle(0),updateHandle:(t,e)=>t.center(e[0],e[1])}).resize().on("resize",()=>{var e;if(this._clampSelectionRectToPlot(),t.interact.selectionEnabled)t.interact.selection={x:parseFloat(this.selectionRect.node.getAttribute("x")),y:parseFloat(this.selectionRect.node.getAttribute("y")),width:parseFloat(this.selectionRect.node.getAttribute("width")),height:parseFloat(this.selectionRect.node.getAttribute("height"))},clearTimeout(null!=(e=this.w.globals.selectionResizeTimer)?e:void 0),this.w.globals.selectionResizeTimer=window.setTimeout(()=>{this._emitSelectionFromRect()},30);else{const e=t.interact.zoomEnabled?t.config.chart.zoom.type:t.config.chart.selection.type;this.handleMouseUp({zoomtype:e,isResized:!0})}}))}preselectedSelection(){const t=this.w,e=this.xyRatios;if(!t.interact.zoomEnabled)if(void 0!==t.interact.selection&&null!==t.interact.selection)this.drawSelectionRect(l(o({},t.interact.selection),{translateX:t.layout.translateX,translateY:t.layout.translateY}));else if(void 0!==t.config.chart.selection.xaxis.min&&void 0!==t.config.chart.selection.xaxis.max){let i=ge.dataXToPx(t,t.config.chart.selection.xaxis.min),s=ge.dataXToPx(t,t.config.chart.selection.xaxis.max)-i;t.axisFlags.isRangeBar&&(i=(t.config.chart.selection.xaxis.min-t.globals.yAxisScale[0].niceMin)/e.invertedYRatio,s=(t.config.chart.selection.xaxis.max-t.config.chart.selection.xaxis.min)/e.invertedYRatio);const a={x:i,y:0,width:s,height:t.layout.gridHeight,translateX:t.layout.translateX,translateY:t.layout.translateY,selectionEnabled:!0};this.drawSelectionRect(a),this.makeSelectionRectDraggable(),"function"==typeof t.config.chart.events.selection&&t.config.chart.events.selection(this.ctx,{xaxis:{min:t.config.chart.selection.xaxis.min,max:t.config.chart.selection.xaxis.max},yaxis:{}})}}drawSelectionRect({x:t,y:e,width:i,height:s,translateX:a=0,translateY:r=0}){const n=this.w,o=this.zoomRect,l=this.selectionRect;if(this.dragged||null!==n.interact.selection){const h={transform:"translate("+a+", "+r+")"};n.interact.zoomEnabled&&this.dragged&&(i<0&&(i=1),o.attr({x:t,y:e,width:i,height:s,fill:n.config.chart.zoom.zoomedArea.fill.color,"fill-opacity":n.config.chart.zoom.zoomedArea.fill.opacity,stroke:n.config.chart.zoom.zoomedArea.stroke.color,"stroke-width":n.config.chart.zoom.zoomedArea.stroke.width,"stroke-opacity":n.config.chart.zoom.zoomedArea.stroke.opacity}),R.setAttrs(o.node,h)),n.interact.selectionEnabled&&(l.attr({x:t,y:e,width:i>0?i:0,height:s>0?s:0,fill:n.config.chart.selection.fill.color,"fill-opacity":n.config.chart.selection.fill.opacity,stroke:n.config.chart.selection.stroke.color,"stroke-width":n.config.chart.selection.stroke.width,"stroke-dasharray":n.config.chart.selection.stroke.dashArray,"stroke-opacity":n.config.chart.selection.stroke.opacity}),R.setAttrs(l.node,h))}}_clampSelectionRectToPlot(){const t=this.selectionRect;if(!t||!t.node)return;const e=this.w.layout.gridWidth;if(!(e>0))return;const i=parseFloat(t.node.getAttribute("x"))||0,s=parseFloat(t.node.getAttribute("width"))||0,a=t=>Math.min(Math.max(t,0),e),r=a(i),n=a(i+s);r===i&&n===i+s||(t.attr({x:r,width:n-r}),t._updateSelectPositions&&t._updateSelectPositions())}hideSelectionRect(t){t&&t.attr({x:0,y:0,width:0,height:0})}selectionDrawing({context:t,zoomtype:e}){const i=this.w,s=t;if(!this._hasPlot())return;const a=s.startX,r=s.startY;let n=!1,h=!1;const c=this._screenXToPlotPx(s.clientX),d=this._screenYToPlotPx(s.clientY);let u=c-a,p=d-r,g={translateX:i.layout.translateX,translateY:i.layout.translateY};return Math.abs(u+a)>i.layout.gridWidth?u=i.layout.gridWidth-a:c<0&&(u=a),a>c&&(n=!0,u=Math.abs(u)),r>d&&(h=!0,p=Math.abs(p)),g="x"===e?{x:n?a-u:a,y:0,width:u,height:i.layout.gridHeight}:"y"===e?{x:0,y:h?r-p:r,width:i.layout.gridWidth,height:p}:{x:n?a-u:a,y:h?r-p:r,width:u,height:p},g=l(o({},g),{translateX:i.layout.translateX,translateY:i.layout.translateY}),s.drawSelectionRect(g),s.selectionDragging("resizing"),g}selectionDragging(t,e){var i;const s=this.w;if(!e)return;e.preventDefault();const{handler:a,box:r}=e.detail,n=this.constraints;let{x:o,y:l}=r;o<n.x&&(o=n.x),l<n.y&&(l=n.y),r.x2>n.x2&&(o=n.x2-r.w),r.y2>n.y2&&(l=n.y2-r.h),a.move(o,l);const h=this.selectionRect;let c=0;"resizing"===t&&(c=30);const d=t=>parseFloat(h.node.getAttribute(t)),u={x:d("x"),y:d("y"),width:d("width"),height:d("height")};s.interact.selection=u;const p=s.config.chart.link,g=!(!p||!p.enabled&&"function"!=typeof p.dimension);("function"==typeof s.config.chart.events.selection||g)&&s.interact.selectionEnabled&&(clearTimeout(null!=(i=this.w.globals.selectionResizeTimer)?i:void 0),this.w.globals.selectionResizeTimer=window.setTimeout(()=>{this._emitSelectionFromRect()},c))}_emitSelectionFromRect(){var t;const e=this.w;if(!e.interact.selectionEnabled)return;const i=e.config.chart.link,s=!(!i||!i.enabled&&"function"!=typeof i.dimension);if("function"!=typeof e.config.chart.events.selection&&!s)return;if(!this._hasPlot())return;const a=this.selectionRect.node.getBoundingClientRect(),r=this.xyRatios;let n,o,l,h;const c=this._screenXToPlotPx(a.left),d=this._screenXToPlotPx(a.right);if(e.axisFlags.isRangeBar)n=e.globals.yAxisScale[0].niceMin+c*r.invertedYRatio,o=e.globals.yAxisScale[0].niceMin+d*r.invertedYRatio,l=0,h=1;else{if(!e.globals.xAxisScale)return;n=ge.pxToDataX(e,c),o=ge.pxToDataX(e,d),l=e.globals.yAxisScale[0].niceMin+(e.layout.gridHeight-this._screenYToPlotPx(a.bottom))*r.yRatio[0],h=e.globals.yAxisScale[0].niceMax-this._screenYToPlotPx(a.top)*r.yRatio[0]}const u={xaxis:{min:n,max:o},yaxis:{min:l,max:h}};"function"==typeof e.config.chart.events.selection&&e.config.chart.events.selection(this.ctx,u),e.config.chart.brush.enabled&&void 0!==e.config.chart.events.brushScrolled&&e.config.chart.events.brushScrolled(this.ctx,u),null==(t=this.ctx.linkedViews)||t.onSourceSelection(u.xaxis)}selectionDrawn({context:t,zoomtype:e}){var i;const s=this.w,a=t,r=this.xyRatios,n=this.ctx.toolbar,o=s.interact.zoomEnabled?a.zoomRect.node.getBoundingClientRect():a.selectionRect.node.getBoundingClientRect();if(!a._hasPlot())return;const l=this._screenXToPlotPx(o.left),h=this._screenXToPlotPx(o.right),c=this._screenYToPlotPx(o.top),d=this._screenYToPlotPx(o.bottom);let u,p;s.axisFlags.isRangeBar?(u=s.globals.yAxisScale[0].niceMin+l*r.invertedYRatio,p=s.globals.yAxisScale[0].niceMin+h*r.invertedYRatio):(u=ge.pxToDataX(s,l),p=ge.pxToDataX(s,h));const g=[],f=[];if(s.config.yaxis.forEach((t,e)=>{const i=s.globals.seriesYAxisMap[e][0],a=s.globals.yAxisScale[e].niceMax-r.yRatio[i]*c,n=s.globals.yAxisScale[e].niceMax-r.yRatio[i]*d;g.push(a),f.push(n)}),a.dragged&&(a.dragX>10||a.dragY>10)&&u!==p)if(s.interact.zoomEnabled){if(!s.globals.initialConfig)return;let t=Zt.clone(s.globals.initialConfig.yaxis),i=Zt.clone(s.globals.initialConfig.xaxis);if(s.interact.zoomed=!0,s.config.xaxis.convertedCatToNumeric&&(u=Math.floor(u),p=Math.floor(p),u<1&&(u=1,p=s.globals.dataPoints),p-u<2&&(p=u+1)),"xy"!==e&&"x"!==e||(i={min:u,max:p}),"xy"!==e&&"y"!==e||t.forEach((e,i)=>{t[i].min=f[i],t[i].max=g[i]}),n){const e=n.getBeforeZoomRange(i,t);e&&(i=e.xaxis?e.xaxis:i,t=e.yaxis?e.yaxis:t)}const r={xaxis:i};s.config.chart.group||(r.yaxis=t);const o=a.ctx.updateHelpers._updateOptions(r,!1,a.w.config.chart.animations.dynamicAnimation.enabled);o&&"function"==typeof o.then?o.then(()=>a._focusForKeyboard()):a._focusForKeyboard(),"function"==typeof s.config.chart.events.zoomed&&n.zoomCallback(i,t)}else if(s.interact.selectionEnabled){let t=null,r=null;if(r={min:u,max:p},"xy"===e||"y"===e){const e=Zt.clone(s.config.yaxis);t=e,e.forEach((t,i)=>{e[i].min=f[i],e[i].max=g[i]})}s.interact.selection=a.selection,"function"==typeof s.config.chart.events.selection&&s.config.chart.events.selection(a.ctx,{xaxis:r,yaxis:t}),null==(i=a.ctx.linkedViews)||i.onSourceSelection(r)}}panDragging({context:t}){var e;const i=this.w,s=t;if(void 0!==i.interact.lastClientPosition.x){const t=i.interact.lastClientPosition.x-s.clientX,a=(null!=(e=i.interact.lastClientPosition.y)?e:0)-s.clientY;Math.abs(t)>Math.abs(a)&&t>0?this.moveDirection="left":Math.abs(t)>Math.abs(a)&&t<0?this.moveDirection="right":Math.abs(a)>Math.abs(t)&&a>0?this.moveDirection="up":Math.abs(a)>Math.abs(t)&&a<0&&(this.moveDirection="down")}i.interact.lastClientPosition={x:s.clientX,y:s.clientY};const a=i.axisFlags.isRangeBar?i.globals.minY:i.globals.minX,r=i.axisFlags.isRangeBar?i.globals.maxY:i.globals.maxX;s.panScrolled(a,r)}panScrolled(t,e){var i,s;const a=this.w,r=this.xyRatios;if(!a.globals.initialConfig)return;const n=Zt.clone(a.globals.initialConfig.yaxis);let o=r.xRatio,l=a.globals.minX,h=a.globals.maxX;if(a.axisFlags.isRangeBar&&(o=r.invertedYRatio,l=a.globals.minY,h=a.globals.maxY),"left"===this.moveDirection?(t=l+a.layout.gridWidth/15*o,e=h+a.layout.gridWidth/15*o):"right"===this.moveDirection&&(t=l-a.layout.gridWidth/15*o,e=h-a.layout.gridWidth/15*o),!a.axisFlags.isRangeBar){const r=null!=(i=a.globals.dataReducerRawMinX)?i:a.globals.initialMinX,n=null!=(s=a.globals.dataReducerRawMaxX)?s:a.globals.initialMaxX;(t<r||e>n)&&(t=l,e=h)}if(t===l&&e===h)return;const c={xaxis:{min:t,max:e}};a.config.chart.group||(c.yaxis=n),this.updateScrolledChart(c,t,e)}updateScrolledChart(t,e,i){const s=this.w;if(this.ctx.updateHelpers._updateOptions(t,!1,!1),"function"==typeof s.config.chart.events.scrolled){const t={xaxis:{min:e,max:i}};s.config.chart.events.scrolled(this.ctx,t),this.ctx.events.fireEvent("scrolled",t)}}_momentumEnabled(){return this._pinchEnabled()||this._panInertiaEnabled()}_pinchEnabled(){return this._incidentalZoomEnabled(this.w.config.chart.zoom.pinch)}_panInertiaEnabled(){const t=this.w.config.chart;return!(!t.pan||!t.pan.inertia)}_m(){const t=this.w.interact;return t.momentum||(t.momentum={busy:!1,pinch:null,panState:null,samples:[],inertiaRAF:null}),t.momentum}_currentXWindow(){const t=this.w;return t.axisFlags.isRangeBar?{min:t.globals.minY,max:t.globals.maxY}:{min:t.globals.minX,max:t.globals.maxX}}_hasPlot(){const t=this.w.dom.baseEl;return!(!t||!t.querySelector(".apexcharts-svg"))}_screenYToPlotPx(t){const e=gt.plotRect(this.w);return(t-e.top)/e.zoom}_screenXToPlotPx(t){return ge.screenXToPlotPx(this.w,t)}_clampBounds(){var t,e;const i=this.w;return i.axisFlags.isRangeBar?null:{min:null!=(t=i.globals.dataReducerRawMinX)?t:i.globals.initialMinX,max:null!=(e=i.globals.dataReducerRawMaxX)?e:i.globals.initialMaxX}}_applyXRange(t,e,i){const s=this.w;if(!s.globals.initialConfig)return!1;const a=this._currentXWindow(),r=i&&e-t>a.max-a.min,n=this._clampBounds();if(n){const i=e-t;t<n.min&&(e=(t=n.min)+i),e>n.max&&(t=(e=n.max)-i),t<n.min&&(t=n.min)}if(s.config.xaxis.convertedCatToNumeric&&(t=Math.floor(t),e=r?Math.ceil(e):Math.floor(e),t<1&&(t=1),n&&e>n.max&&(e=Math.floor(n.max)),e-t<2))return!1;if(!(e>t))return!1;const o={xaxis:{min:t,max:e}};return s.config.chart.group||(o.yaxis=Zt.clone(s.globals.initialConfig.yaxis)),i&&(s.interact.zoomed=!0),this.ctx.updateHelpers._updateOptions(o,!1,!1),{minX:t,maxX:e}}_cancelInertia(){const t=this._m();null!=t.inertiaRAF&&(cancelAnimationFrame(t.inertiaRAF),t.inertiaRAF=null)}_fireScrolled(){const t=this.w;if("function"!=typeof t.config.chart.events.scrolled)return;const{min:e,max:i}=this._currentXWindow(),s={xaxis:{min:e,max:i}};t.config.chart.events.scrolled(this.ctx,s),this.ctx.events.fireEvent("scrolled",s)}panBy(t){const e=this.w;if(!e.interact.zoomed)return;const{min:i,max:s}=this._currentXWindow();let a=(s-i)*t;if(e.config.xaxis.convertedCatToNumeric&&(a=a>0?Math.ceil(a):Math.floor(a)),e.axisFlags.isRangeBar){const t=e.rangeData;let r=1/0,n=-1/0;if(t.seriesRangeStart.concat(t.seriesRangeEnd).flat().forEach(t=>{null!=t&&(r=Math.min(r,t),n=Math.max(n,t))}),a=a>0?Math.min(a,Math.max(0,n-s)):Math.max(a,Math.min(0,r-i)),!a)return}this._applyXRange(i+a,s+a,!1)&&this._fireScrolled()}_pushSample(t,e){const i=this._m().samples;for(i.push({x:t,t:e});i.length>6;)i.shift()}momentumTouch(t){const e=this.w,i=this._m(),s=t.type;if("touchstart"!==s)"touchmove"!==s?(i.pinch?t.touches.length<2&&this._endPinch():i.panState&&0===t.touches.length&&this._endPan(),0===t.touches.length&&(e.interact.mousedown=!1,this.dragged=!1,null!=i.inertiaRAF||i.pinch||i.panState||(i.busy=!1))):i.pinch&&t.touches.length>=2?(t.preventDefault(),this._movePinch(t)):i.panState&&1===t.touches.length&&this._movePan(t);else{if(this._cancelInertia(),!this._hasPlot())return;if(t.touches.length>=2&&this._pinchEnabled())t.preventDefault(),i.busy=!0,i.panState=null,this._beginPinch(t);else if(1===t.touches.length&&this._panInertiaEnabled()&&e.interact.panEnabled){i.busy=!0,i.pinch=null;const s=t.touches[0],a=this._currentXWindow(),r=e.layout.gridWidth||1,n=gt.plotRect(e).zoom;i.panState={startX:s.clientX,startY:s.clientY,axis:null,minX0:a.min,maxX0:a.max,zoom:n,ratio0:(a.max-a.min)/r/n},i.samples=[{x:s.clientX,t:t.timeStamp}]}}}_beginPinch(t){const e=this.w,i=t.touches[0],s=t.touches[1],a=Math.hypot(s.clientX-i.clientX,s.clientY-i.clientY)||1,r=this._screenXToPlotPx((i.clientX+s.clientX)/2),{min:n,max:o}=this._currentXWindow();this._m().pinch={d0:a,cx0:r,minX0:n,maxX0:o,gridWidth:e.layout.gridWidth||1}}_movePinch(t){const e=this.w,i=this._m().pinch;if(!i||!this._hasPlot())return;const s=t.touches[0],a=t.touches[1],r=Math.hypot(a.clientX-s.clientX,a.clientY-s.clientY)||1,n=this._screenXToPlotPx((s.clientX+a.clientX)/2),o=i.maxX0-i.minX0,l=o*(i.d0/r);let h=i.minX0+i.cx0/i.gridWidth*o-n/i.gridWidth*l,c=h+l;const d=this._clampBounds();if(d){const t=e.globals.minXDiff>0&&isFinite(e.globals.minXDiff)?e.globals.minXDiff:0,i=Math.max(2*t,1e-6*(d.max-d.min));if(c-h<i){const t=(h+c)/2;h=t-i/2,c=t+i/2}}this._applyXRange(h,c,!0)}_endPinch(){const t=this.w;this._m().pinch=null;const{min:e,max:i}=this._currentXWindow(),s={min:e,max:i},a=t.globals.initialConfig?Zt.clone(t.globals.initialConfig.yaxis):[],r=this.ctx.toolbar;r&&r.zoomCallback(s,a)}_movePan(t){const e=this._m(),i=e.panState,s=t.touches[0];if(!i.axis){const a=Math.abs(s.clientX-i.startX),r=Math.abs(s.clientY-i.startY);if(a<6&&r<6)return void this._pushSample(s.clientX,t.timeStamp);if(r>a)return e.busy=!1,void(e.panState=null);i.axis="x"}if("x"!==i.axis)return;t.preventDefault();const a=(s.clientX-i.startX)*i.ratio0;this._pushSample(s.clientX,t.timeStamp),this._applyXRange(i.minX0-a,i.maxX0-a,!1)}_endPan(){const t=this._m(),e=t.panState;t.panState=null;let i=0;const s=t.samples;if(s.length>=2){const t=s[0],e=s[s.length-1],a=e.t-t.t;a>0&&(i=(e.x-t.x)/a)}t.samples=[],e&&"x"===e.axis&&this._panInertiaEnabled()&&Math.abs(i)>.05?this._startInertia(i/e.zoom):(t.busy=!1,this._fireScrolled())}_startInertia(t){const e=this.w,i=this._m(),s=e.config.chart.pan&&e.config.chart.pan.friction,a="number"==typeof s?Math.min(Math.max(s,.5),.999):.92;let r=t,n=null;i.busy=!0;const o=t=>{if(e.globals.isDestroyed)return i.inertiaRAF=null,void(i.busy=!1);if(null==n)return n=t,void(i.inertiaRAF=requestAnimationFrame(o));const s=t-n;if(n=t,r*=Math.pow(a,s/16.6667),Math.abs(r)<.02)return i.inertiaRAF=null,i.busy=!1,void this._fireScrolled();const l=this._currentXWindow(),h=e.layout.gridWidth||1,c=(l.max-l.min)/h,d=r*s*c,u=this._applyXRange(l.min-d,l.max-d,!1),p=this._clampBounds();if(!u||p&&(d>0&&u.minX<=p.min+1e-6*(p.max-p.min)||d<0&&u.maxX>=p.max-1e-6*(p.max-p.min)))return i.inertiaRAF=null,i.busy=!1,void this._fireScrolled();i.inertiaRAF=requestAnimationFrame(o)};i.inertiaRAF=requestAnimationFrame(o)}}});let fe=class{constructor(t){this.w=t.w,this.annoCtx=t}setOrientations(t,e=null){var i,s;const a=this.w;if("vertical"===t.label.orientation){const r=null!==e?e:0,n=a.dom.baseEl.querySelector(`.apexcharts-xaxis-annotations .apexcharts-xaxis-annotation-label[rel='${r}']`);if(null!==n){const e=n.getBBox();n.setAttribute("x",String(parseFloat(null!=(i=n.getAttribute("x"))?i:"0")-e.height+4));const a="top"===t.label.position?e.width:-e.width;n.setAttribute("y",String(parseFloat(null!=(s=n.getAttribute("y"))?s:"0")+a));const{x:r,y:o}=this.annoCtx.graphics.rotateAroundCenter(n);n.setAttribute("transform",`rotate(-90 ${r} ${o})`)}}}addBackgroundToAnno(t,e,i){const s=this.w;if(!t||!e.label.text||!String(e.label.text).trim())return null;const a=s.dom.baseEl.querySelector(".apexcharts-grid");if(!a)return null;const r=a.getBoundingClientRect(),n=a.getBBox(),o=r.width/n.width||1,l=t.getBoundingClientRect();let{left:h,right:c,top:d,bottom:u}=e.label.style.padding;"vertical"===e.label.orientation&&([d,u,h,c]=[h,c,d,u]);const p=r.left-n.x*o,g=r.top-n.y*o,f=(l.left-p)/o-h,m=(l.top-g)/o-d,x=()=>{const t=this.annoCtx.graphics.drawRect(f,m,l.width/o+h+c,l.height/o+d+u,e.label.borderRadius,e.label.style.background,1,e.label.borderWidth,e.label.borderColor,0);return e.id&&t.node.classList.add(e.id),t};return i?x:x()}annotationsBackground(){const t=this.w,e=[],i=(i,s,a)=>{const r=t.dom.baseEl.querySelector(`.apexcharts-${a}-annotations .apexcharts-${a}-annotation-label[rel='${s}']`),n=this.addBackgroundToAnno(r,i,!0);n&&e.push(()=>{const e=n(),s=r.parentNode;null==s||s.insertBefore(e.node,r);const a=r.getAttribute("x");null!==a&&m(e,parseFloat(a),t),i.label.mouseEnter&&e.node.addEventListener("mouseenter",i.label.mouseEnter.bind(this,i)),i.label.mouseLeave&&e.node.addEventListener("mouseleave",i.label.mouseLeave.bind(this,i)),i.label.click&&e.node.addEventListener("click",i.label.click.bind(this,i))})};t.config.annotations.xaxis.forEach((t,e)=>i(t,e,"xaxis")),t.config.annotations.yaxis.forEach((t,e)=>i(t,e,"yaxis")),t.config.annotations.points.forEach((t,e)=>i(t,e,"point")),e.forEach(t=>t())}usesCategoryX(){const t=this.w;return("category"===t.config.xaxis.type||t.config.xaxis.convertedCatToNumeric)&&!this.annoCtx.invertAxis&&!t.axisFlags.dataFormatXNumeric&&!t.config.chart.sparkline.enabled}hasXDomain(){const t=this.w;return this.annoCtx.invertAxis?Zt.isNumber(t.globals.minY)&&Zt.isNumber(t.globals.yRange[0]):this.usesCategoryX()?t.labelData.labels.length>0||t.labelData.categoryLabels.length>0:Zt.isNumber(t.globals.minX)&&Zt.isNumber(t.globals.xRange)}getY1Y2(t,e){var i,s,a;const r=this.w,n="y1"===t?e.y:e.y2,o="string"==typeof n&&n.includes("px");let l,h=!1;if(this.annoCtx.invertAxis){const t=r.config.xaxis.convertedCatToNumeric?r.labelData.categoryLabels:r.labelData.labels,s=t.indexOf(n);if(!o&&-1===s)return{yP:0,clipped:!0};const a=r.dom.baseEl.querySelector(`.apexcharts-yaxis-texts-g text:nth-child(${s+1})`);l=a?parseFloat(null!=(i=a.getAttribute("y"))?i:"0"):(r.layout.gridHeight/t.length-1)*(s+1)-r.globals.barHeight,void 0!==e.seriesIndex&&r.globals.barHeight&&(l+=this.barSlotOffset(e.seriesIndex,r.globals.barHeight))}else{if(!r.config.yaxis[e.yAxisIndex])return{yP:0,clipped:!0};const t=r.globals.seriesYAxisMap[e.yAxisIndex],i=null!=(s=null==t?void 0:t[0])?s:null;if(null===i&&r.seriesData.series.length)return{yP:0,clipped:!0};const o=null===i?r.globals.minY:r.globals.minYArr[i],c=null===i?r.globals.maxY-r.globals.minY:r.globals.yRange[i],d=r.config.yaxis[e.yAxisIndex].logarithmic&&null!==i?new P(this.w).getLogVal(r.config.yaxis[e.yAxisIndex].logBase,n,i)/r.globals.yLogRatio[i]:(n-o)/(c/r.layout.gridHeight);l=r.layout.gridHeight-Math.min(Math.max(d,0),r.layout.gridHeight),h=d>r.layout.gridHeight||d<0,!e.marker||void 0!==e.y&&null!==e.y||(l=0),(null==(a=r.config.yaxis[e.yAxisIndex])?void 0:a.reversed)&&(l=d)}return o&&(l=parseFloat(n)),{yP:l,clipped:h}}getX1X2(t,e){const i=this.w,s="x1"===t?e.x:e.x2,a=this.annoCtx.invertAxis?i.globals.minY:i.globals.minX,r=this.annoCtx.invertAxis?i.globals.maxY:i.globals.maxX,n=this.annoCtx.invertAxis?i.globals.yRange[0]:i.globals.xRange;let o=!1;const l="string"==typeof s&&s.includes("px"),h=null==s&&e.marker;if(!l&&!h&&!this.hasXDomain())return{x:0,clipped:!0};let c=this.annoCtx.inversedReversedAxis?(r-s)/(n/i.layout.gridWidth):(s-a)/(n/i.layout.gridWidth);return this.usesCategoryX()&&(c=this.getStringX(s)),"string"==typeof s&&s.includes("px")&&(c=parseFloat(s)),null==s&&e.marker&&(c=i.layout.gridWidth),void 0!==e.seriesIndex&&i.globals.barWidth&&!this.annoCtx.invertAxis&&(c+=this.barSlotOffset(e.seriesIndex,i.globals.barWidth)),"number"!=typeof c&&(c=0,o=!0),parseFloat(c.toFixed(10))>parseFloat(i.layout.gridWidth.toFixed(10))?(c=i.layout.gridWidth,o=!0):c<0&&(c=0,o=!0),{x:c,clipped:o}}barSlotOffset(t,e){const i=this.w;if(i.config.chart.stacked)return 0;let s=0,a=0;return i.seriesData.series.forEach((e,r)=>{var n;const o=null==(n=i.config.series[r])?void 0:n.type;!e.length||i.globals.comboCharts&&"bar"!==o&&"column"!==o||(r<t&&a++,s++)}),e*(a-(s-1)/2)}getStringX(t){var e;const i=this.w;let s=t;if(i.config.xaxis.convertedCatToNumeric&&i.labelData.categoryLabels.length){const e=String(t);t=i.labelData.categoryLabels.findIndex(t=>String(t)===e)+1}const a=i.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(t),r=i.dom.baseEl.querySelector(`.apexcharts-xaxis-texts-g text:nth-child(${a+1})`);return r?s=parseFloat(null!=(e=r.getAttribute("x"))?e:"0"):a>-1&&(s=i.axisFlags.isXNumeric?(t-i.globals.minX)/(i.globals.xRange/i.layout.gridWidth):i.globals.padHorizontal+(a+.5)*i.layout.gridWidth/i.globals.dataPoints),s}};class me{constructor(t){this.w=t.w,this.annoCtx=t,this.invertAxis=this.annoCtx.invertAxis,this.helpers=new fe(this.annoCtx)}addXaxisAnnotation(t,e,i){const s=this.w,a=this.helpers.getX1X2("x1",t);let r=a.x;const n=a.clipped;let o,l=!0;const h=t.label.text,c=t.strokeDashArray;if(Zt.isNumber(r)){if(null===t.x2||void 0===t.x2){if(!n){const i=this.annoCtx.graphics.drawLine(r+t.offsetX,0+t.offsetY,r+t.offsetX,s.layout.gridHeight+t.offsetY,t.borderColor,c,t.borderWidth);e.appendChild(i.node),t.id&&i.node.classList.add(t.id),m(i,r+t.offsetX,s)}}else{const i=this.helpers.getX1X2("x2",t);if(o=i.x,l=i.clipped,o<r){const t=r;r=o,o=t}const a=this.annoCtx.graphics.drawRect(r+t.offsetX,0+t.offsetY,o-r,s.layout.gridHeight+t.offsetY,0,t.fillColor,t.opacity,1,t.borderColor,c);a.node.classList.add("apexcharts-annotation-rect"),a.attr("clip-path",`url(#gridRectMask${s.globals.cuid})`),e.appendChild(a.node),t.id&&a.node.classList.add(t.id),m(a,r+t.offsetX,s)}if(!n||!l){const a=this.annoCtx.graphics.getTextRects(h,t.label.style.fontSize),n="top"===t.label.position?4:"center"===t.label.position?s.layout.gridHeight/2+("vertical"===t.label.orientation?a.width/2:0):s.layout.gridHeight,o=this.annoCtx.graphics.drawText({x:r+t.label.offsetX,y:n+t.label.offsetY-("vertical"===t.label.orientation?"top"===t.label.position?a.width/2-12:-a.width/2:0),text:h,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-xaxis-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});o.attr({rel:i}),e.appendChild(o.node),m(o,r+t.label.offsetX,s),this.annoCtx.helpers.setOrientations(t,i)}}}drawXAxisAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-xaxis-annotations"});return t.config.annotations.xaxis.map((t,i)=>{this.addXaxisAnnotation(t,e.node,i)}),e}}class xe{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new fe(this.annoCtx),this.axesUtils=new j(this.annoCtx.w,{theme:this.annoCtx.theme,timeScale:this.annoCtx.timeScale})}addYaxisAnnotation(t,e,i){const s=this.w,a=t.strokeDashArray;let r=this.helpers.getY1Y2("y1",t),n=r.yP;const o=r.clipped;let l,h=!0,c=!1;const d=t.label.text;if(null===t.y2||void 0===t.y2){if(!o){c=!0;const i=this.annoCtx.graphics.drawLine(0+t.offsetX,n+t.offsetY,this._getYAxisAnnotationWidth(t),n+t.offsetY,t.borderColor,a,t.borderWidth);e.appendChild(i.node),t.id&&i.node.classList.add(t.id)}}else{if(r=this.helpers.getY1Y2("y2",t),l=r.yP,h=r.clipped,l>n){const t=n;n=l,l=t}if(!o||!h){c=!0;const i=this.annoCtx.graphics.drawRect(0+t.offsetX,l+t.offsetY,this._getYAxisAnnotationWidth(t),n-l,0,t.fillColor,t.opacity,1,t.borderColor,a);i.node.classList.add("apexcharts-annotation-rect"),i.attr("clip-path",`url(#gridRectMask${s.globals.cuid})`),e.appendChild(i.node),t.id&&i.node.classList.add(t.id)}}if(c){const a="right"===t.label.position?s.layout.gridWidth:"center"===t.label.position?s.layout.gridWidth/2:0,r=this.annoCtx.graphics.drawText({x:a+t.label.offsetX,y:(null!=l?l:n)+t.label.offsetY-3,text:d,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-yaxis-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});r.attr({rel:i}),e.appendChild(r.node)}}_getYAxisAnnotationWidth(t){const e=this.w;let i=e.layout.gridWidth;return i=t.width.indexOf("%")>-1?e.layout.gridWidth*parseInt(t.width,10)/100:parseInt(t.width,10),i+t.offsetX}drawYAxisAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-yaxis-annotations"});return t.config.annotations.yaxis.forEach((t,i)=>{t.yAxisIndex=this.axesUtils.translateYAxisIndex(t.yAxisIndex),this.axesUtils.isYAxisHidden(t.yAxisIndex)&&this.axesUtils.yAxisAllSeriesCollapsed(t.yAxisIndex)||this.addYaxisAnnotation(t,e.node,i)}),e}}class be{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new fe(this.annoCtx)}addPointAnnotation(t,e,i){const s=this.w;if(s.globals.collapsedSeriesIndices.indexOf(t.seriesIndex)>-1)return;const a=this.helpers.getX1X2("x1",t),r=a.x,n=a.clipped,o=this.helpers.getY1Y2("y1",t),l=o.yP,h=o.clipped;if(Zt.isNumber(r)&&!h&&!n){const a={pSize:t.marker.size,pointStrokeWidth:t.marker.strokeWidth,pointFillColor:t.marker.fillColor,pointStrokeColor:t.marker.strokeColor,shape:t.marker.shape,pRadius:t.marker.radius,class:`apexcharts-point-annotation-marker ${t.marker.cssClass} ${t.id?t.id:""}`};let n=this.annoCtx.graphics.drawMarker(r+t.marker.offsetX,l+t.marker.offsetY,a);e.appendChild(n.node);const o=[n.node];m(n,r,s);const h=t.label.text?t.label.text:"",c=this.getConstrainedLabelX(h,r+t.label.offsetX,t.label),d=this.annoCtx.graphics.drawText({x:c,y:l+t.label.offsetY-t.marker.size-parseFloat(t.label.style.fontSize)/1.6,text:h,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-point-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});if(d.attr({rel:i}),e.appendChild(d.node),m(d,r,s),t.customSVG.SVG){const i=this.annoCtx.graphics.group({class:"apexcharts-point-annotations-custom-svg "+t.customSVG.cssClass});i.attr({transform:`translate(${r+t.customSVG.offsetX}, ${l+t.customSVG.offsetY})`}),i.node.innerHTML=t.customSVG.SVG,e.appendChild(i.node),o.push(i.node)}if(t.image.path){const e=t.image.width?t.image.width:20,i=t.image.height?t.image.height:20;n=this.annoCtx.addImage({x:r+t.image.offsetX-e/2,y:l+t.image.offsetY-i/2,width:e,height:i,path:t.image.path,appendTo:".apexcharts-point-annotations"}),o.push(n.node)}t.tooltip&&t.tooltip.enabled&&o.forEach(e=>{e.addEventListener("mouseenter",()=>{this.showPointTooltip(t,e)}),e.addEventListener("mouseleave",()=>{this.hidePointTooltip()})}),t.mouseEnter&&n.node.addEventListener("mouseenter",t.mouseEnter.bind(this,t)),t.mouseLeave&&n.node.addEventListener("mouseleave",t.mouseLeave.bind(this,t)),t.click&&n.node.addEventListener("click",t.click.bind(this,t))}}getConstrainedLabelX(t,e,i){const s=this.w;if(!t)return e;const{width:a}=this.annoCtx.graphics.getTextRects(t,i.style.fontSize,i.style.fontFamily,void 0,!0,i.style.fontWeight);let r,n;switch(i.textAnchor){case"start":r=e,n=e+a;break;case"end":r=e-a,n=e;break;default:r=e-a/2,n=e+a/2}const o=i.style.padding||{};return r-=o.left||0,n+=o.right||0,r<0?e-r:n>s.layout.gridWidth?e-(n-s.layout.gridWidth):e}getPointTooltipEl(){const t=this.w;let e=t.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");return e||(e=ft.createElementNS("http://www.w3.org/1999/xhtml","div"),e.classList.add("apexcharts-tooltip","apexcharts-annotation-tooltip"),t.dom.elWrap.appendChild(e)),e}getPointTooltipContent(t){const e=this.w,i=t.tooltip||{};if("function"==typeof i.formatter)return i.formatter({annotation:t,seriesIndex:t.seriesIndex,id:t.id,w:e});let s=null!=i.text?i.text:t.label&&t.label.text;return Array.isArray(s)&&(s=s.join("<br/>")),null==s?"":String(s)}showPointTooltip(t,e){const i=this.w,s=this.getPointTooltipContent(t);if(!s)return;const a=this.getPointTooltipEl();a.innerHTML=s;const r=t.tooltip.theme||i.config.tooltip.theme||"light";a.classList.remove("apexcharts-theme-light","apexcharts-theme-dark"),a.classList.add(`apexcharts-theme-${r}`),a.classList.add("apexcharts-active");const n=i.dom.elWrap.getBoundingClientRect(),o=e.getBoundingClientRect(),l=a.getBoundingClientRect(),h=t.tooltip.offsetX||0,c=t.tooltip.offsetY||0;let d=o.left-n.left+o.width/2-l.width/2,u=o.top-n.top-l.height-10;d=Math.max(0,Math.min(d,n.width-l.width)),u<0&&(u=o.top-n.top+o.height+10),a.style.left=d+h+"px",a.style.top=u+c+"px"}hidePointTooltip(){const t=this.w.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");t&&t.classList.remove("apexcharts-active")}drawPointAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-point-annotations"});return t.config.annotations.points.map((t,i)=>{this.addPointAnnotation(t,e.node,i)}),e}}c.default.registerFeatures({annotations:class{constructor(t,{theme:e=null,timeScale:i=null}={}){this.w=t,this.theme=e,this.timeScale=i,this.invertAxis=void 0,this.inversedReversedAxis=void 0,this.graphics=new R(this.w),this.w.globals.isBarHorizontal&&(this.invertAxis=!0),this.helpers=new fe(this),this.xAxisAnnotations=new me(this),this.yAxisAnnotations=new xe(this),this.pointsAnnotations=new be(this),this.w.globals.isBarHorizontal&&this.w.config.yaxis[0].reversed&&(this.inversedReversedAxis=!0)}drawAxesAnnotations(){const t=this.w;if(t.globals.axisCharts){const e=this.yAxisAnnotations.drawYAxisAnnotations(),i=this.xAxisAnnotations.drawXAxisAnnotations(),s=this.pointsAnnotations.drawPointAnnotations(),a=t.config.chart.animations.enabled,r=[e,i,s],n=[i.node,e.node,s.node],o="line"===t.config.chart.type||"area"===t.config.chart.type||"rangeArea"===t.config.chart.type,l=[o,!1,o];for(let e=0;e<3;e++)t.dom.elGraphical.add(r[e]),!a||t.globals.resized||t.globals.dataChanged||t.globals.animationEnded||"scatter"!==t.config.chart.type&&"bubble"!==t.config.chart.type&&t.globals.dataPoints>1&&!l[e]&&n[e].classList.add("apexcharts-element-hidden"),t.globals.delayedElements.push({el:n[e],index:0});this.helpers.annotationsBackground()}}drawImageAnnos(){this.w.config.annotations.images.map(t=>{this.addImage(t)})}drawTextAnnos(){this.w.config.annotations.texts.map(t=>{this.addText(t)})}addXaxisAnnotation(t,e,i){this.xAxisAnnotations.addXaxisAnnotation(t,e,i)}addYaxisAnnotation(t,e,i){this.yAxisAnnotations.addYaxisAnnotation(t,e,i)}addPointAnnotation(t,e,i){this.pointsAnnotations.addPointAnnotation(t,e,i)}addText(t){const{x:e,y:i,text:s,textAnchor:a,foreColor:r,fontSize:n,fontFamily:o,fontWeight:l,cssClass:h,backgroundColor:c,borderWidth:d,strokeDashArray:u,borderRadius:p,borderColor:g,appendTo:f=".apexcharts-svg",paddingLeft:m=4,paddingRight:x=4,paddingBottom:b=2,paddingTop:y=2}=t,v=this.w,w=v.dom.baseEl.querySelector(f);if(!w)return;const _=this.graphics.drawText({x:e,y:i,text:s,textAnchor:a||"start",fontSize:n||"12px",fontWeight:l||"regular",fontFamily:o||v.config.chart.fontFamily,foreColor:r||v.config.chart.foreColor,cssClass:h||""});w.appendChild(_.node);const A=_.bbox();if(s){const t=this.graphics.drawRect(A.x-m,A.y-y,A.width+m+x,A.height+b+y,p,c||"transparent",1,d,g,u);w.insertBefore(t.node,_.node)}}addImage(t){const e=this.w,{path:i,x:s=0,y:a=0,width:r=20,height:n=20,appendTo:o=".apexcharts-svg"}=t,l=e.dom.Paper.image(i);l.size(r,n).move(s,a);const h=e.dom.baseEl.querySelector(o);return h&&h.appendChild(l.node),l}addXaxisAnnotationExternal(t,e,i){return this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"xaxis",contextMethod:i.addXaxisAnnotation}),i}addYaxisAnnotationExternal(t,e,i){return this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"yaxis",contextMethod:i.addYaxisAnnotation}),i}addPointAnnotationExternal(t,e,i){return void 0===this.invertAxis&&(this.invertAxis=i.w.globals.isBarHorizontal),this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"point",contextMethod:i.addPointAnnotation}),i}addAnnotationExternal({params:t,pushToMemory:e,context:i,type:s,contextMethod:a}){var r;const n=i,o=n.w,l=o.dom.baseEl.querySelector(`.apexcharts-${s}-annotations`),h=((null==(r=o.config.annotations["point"===s?"points":s])?void 0:r.length)||0)+l.childNodes.length,c=new ot,d=Object.assign({},"xaxis"===s?c.xAxisAnnotation:"yaxis"===s?c.yAxisAnnotation:c.pointAnnotation),u=Zt.extend(d,t);switch(s){case"xaxis":this.addXaxisAnnotation(u,l,h);break;case"yaxis":this.addYaxisAnnotation(u,l,h);break;case"point":this.addPointAnnotation(u,l,h)}const p=o.dom.baseEl.querySelector(`.apexcharts-${s}-annotations .apexcharts-${s}-annotation-label[rel='${h}']`),g=this.helpers.addBackgroundToAnno(p,u);return g&&l.insertBefore(g.node,p),e&&o.globals.memory.methodsToExec.push({context:n,id:u.id?u.id:Zt.randomId(),method:a,label:"addAnnotation",params:t}),i}_removeAnnotationTooltip(t){const e=t.dom.elWrap&&t.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");e&&e.parentNode&&e.parentNode.removeChild(e)}clearAnnotations(t){const e=t.w;this._removeAnnotationTooltip(e);const i=e.dom.baseEl.querySelectorAll(".apexcharts-yaxis-annotations, .apexcharts-xaxis-annotations, .apexcharts-point-annotations");for(let t=e.globals.memory.methodsToExec.length-1;t>=0;t--)"addText"!==e.globals.memory.methodsToExec[t].label&&"addAnnotation"!==e.globals.memory.methodsToExec[t].label||e.globals.memory.methodsToExec.splice(t,1);Array.prototype.forEach.call(i,t=>{for(;t.firstChild;)t.removeChild(t.firstChild)})}removeAnnotation(t,e){const i=t.w;this._removeAnnotationTooltip(i);const s=i.dom.baseEl.querySelectorAll(`.${e}`);s&&(i.globals.memory.methodsToExec=i.globals.memory.methodsToExec.filter(t=>t.id!==e),Object.keys(i.config.annotations).forEach(t=>{const s=i.config.annotations[t];Array.isArray(s)&&(i.config.annotations[t]=s.filter(t=>t.id!==e))}),Array.prototype.forEach.call(s,t=>{t.parentElement.removeChild(t)}))}}});function ye(t,e){if(!(e>0))return[];if(1===e)return[o({},t)];const i=t.width>=t.height,s=i?t.width:t.height,a=i?t.height:t.width,r=a>0?s/a:e;let n=Math.max(1,Math.ceil(Math.sqrt(r*e)));n>e&&(n=e);const l=Math.floor(e/n);let h=e-l*n;const c=[],d=s/n;let u=0;for(let e=0;e<n;e++){const e=l+(h>0?1:0);h>0&&h--;const s=e>0?a/e:0;for(let a=0;a<e;a++)c.push(i?{x:t.x+u,y:t.y+a*s,width:d,height:s}:{x:t.x+a*s,y:t.y+u,width:s,height:d});u+=d}return c}function ve(t,e,i){if(!(e>0))return[];const s=t.width>=t.height,a=s?t.width:t.height,r=s?t.height:t.width,n=s?t.y:t.x,o=n+r,l=r>0?a/r:e;let h=Math.max(Math.ceil(Math.sqrt(l*e)),Math.ceil(a/16));h>=1||(h=1),h>e&&(h=e);const c=Math.floor(e/h);let d=e-c*h;const u=[],p=a/h;let g=s?t.x:t.y;for(let t=0;t<h;t++){const t=c+(d>0?1:0);d>0&&d--;const e=[],a=i(g,g+p,s);if(Array.isArray(a))for(let t=0;t<a.length;t++){const i=a[t];if(!i)continue;const s=Math.max(n,Math.min(i[0],i[1])),r=Math.min(o,Math.max(i[0],i[1]));r>s&&e.push([s,r])}e.length||e.push([n,o]);const r=e.reduce((t,e)=>t+(e[1]-e[0]),0),l=e.map(i=>r>0?(i[1]-i[0])/r*t:t/e.length),h=l.map(t=>Math.floor(t));let f=h.reduce((t,e)=>t+e,0);const m=l.map((t,e)=>({i:e,frac:t-Math.floor(t)})).sort((t,e)=>e.frac-t.frac);for(let e=0;f<t;e++,f++)h[m[e%m.length].i]++;for(let t=0;t<e.length;t++){const i=h[t];if(i<=0)continue;const a=e[t][0],r=(e[t][1]-a)/i;for(let t=0;t<i;t++)u.push(s?{x:g,y:a+t*r,width:p,height:r}:{x:a+t*r,y:g,width:r,height:p})}g+=p}return u}function we(t,e,i,s,a,r){let n=a===i?0:Math.round((t-i)/(a-i)*32767),o=r===s?0:Math.round((e-s)/(r-s)*32767),l=0;for(let t=32768;t>=1;t/=2){const e=(n&t)>0?1:0,i=(o&t)>0?1:0;if(l+=t*t*(3*e^i),0===i){1===e&&(n=t-1-n,o=t-1-o);const i=n;n=o,o=i}}return l}function _e(t,e){let i=1/0,s=1/0,a=-1/0,r=-1/0;const n=t.map(t=>{const[n,o]=e(t);return n<i&&(i=n),n>a&&(a=n),o<s&&(s=o),o>r&&(r=o),[n,o]});return t.map((t,e)=>({item:t,d:we(n[e][0],n[e][1],i,s,a,r)})).sort((t,e)=>t.d-e.d).map(t=>t.item)}function Ae(t){if(!t||"string"!=typeof t)return null;const e=t.trim();if("#"===e[0]){const t=e.slice(1);return 3===t.length?[parseInt(t[0]+t[0],16),parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),1]:6===t.length||8===t.length?[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16),8===t.length?parseInt(t.slice(6,8),16)/255:1]:null}const i=e.match(/^rgba?\(([^)]+)\)$/i);if(i){const t=i[1].split(",").map(t=>parseFloat(t));return t.length<3||t.some(t=>!isFinite(t))?null:[t[0],t[1],t[2],t.length>3?t[3]:1]}return null}function Se(t,e){const i=Ae(t),s=Ae(e);return i&&s?t=>{const e=Math.round(i[0]+(s[0]-i[0])*t),a=Math.round(i[1]+(s[1]-i[1])*t),r=Math.round(i[2]+(s[2]-i[2])*t),n=i[3]+(s[3]-i[3])*t;return n>=1?`rgb(${e},${a},${r})`:`rgba(${e},${a},${r},${n})`}:null}c.default.registerFeatures({keyboardNavigation:class{constructor(t,e){this.w=t,this.ctx=e,this.seriesIndex=0,this.dataPointIndex=0,this.active=!1,this._tooltipDismissed=!1,this._announceTimer=void 0,this._focusedEl=null,this._hoveredBarEl=null,this._enlargedScatterMarker=null,this._onKeyDown=this._onKeyDown.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this),this._onLegendClick=this._onLegendClick.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._lastPointerDownAt=0}init(){const t=this.w,e=t.dom.Paper.node;if(!e)return;e.setAttribute("tabindex","0"),e.addEventListener("focus",this._onFocus),e.addEventListener("blur",this._onBlur),e.addEventListener("mousedown",this._onPointerDown,{capture:!0}),e.addEventListener("pointerdown",this._onPointerDown,{capture:!0}),e.addEventListener("touchstart",this._onPointerDown,{capture:!0,passive:!0}),e.addEventListener("keydown",this._onKeyDown,{passive:!1}),this.ctx.events.addEventListener("legendClick",this._onLegendClick);const i=t.interact.keyNav,s=e.ownerDocument;t.interact.keyNav=null,!i||s.activeElement&&s.activeElement!==s.body||([this.seriesIndex,this.dataPointIndex,,this._tooltipDismissed]=i,i[2]||this.notePointerFocus(),e.focus({preventScroll:!0}))}destroy(t){var e;const i=this.w,s=i.dom.Paper&&i.dom.Paper.node;this.ctx.events.removeEventListener("legendClick",this._onLegendClick),clearTimeout(this._announceTimer),s&&(t&&(null==(e=s.getRootNode)?void 0:e.call(s).activeElement)===s&&(i.interact.keyNav=[this.seriesIndex,this.dataPointIndex,this.active,this._tooltipDismissed]),s.removeEventListener("focus",this._onFocus),s.removeEventListener("blur",this._onBlur),s.removeEventListener("keydown",this._onKeyDown),s.removeEventListener("mousedown",this._onPointerDown,{capture:!0}),s.removeEventListener("pointerdown",this._onPointerDown,{capture:!0}),s.removeEventListener("touchstart",this._onPointerDown,{capture:!0}))}_onPointerDown(){this._lastPointerDownAt=Date.now()}notePointerFocus(){this._lastPointerDownAt=Date.now()}_onFocus(){this._isNavEnabled()&&(Date.now()-this._lastPointerDownAt<100||(this.active=!0,this._clampCursor(),this._snapToVisibleRange(),this._tooltipDismissed||this._showCurrentPoint()))}_onBlur(){this.active=!1,this._tooltipDismissed=!1,this._hideFocus()}_onLegendClick(){this.active&&(this.active=!1,this._hideFocus())}_onKeyDown(t){var e,i,s;if(this._isNavEnabled()&&this.active){if(t.shiftKey&&("ArrowRight"===t.key||"ArrowLeft"===t.key)&&this._canPan())return t.preventDefault(),void this._panBy("ArrowRight"===t.key?1:-1);switch(t.key){case"ArrowRight":t.preventDefault(),this._move(0,1);break;case"ArrowLeft":t.preventDefault(),this._move(0,-1);break;case"ArrowUp":t.preventDefault(),this._move(-1,0);break;case"ArrowDown":t.preventDefault(),this._move(1,0);break;case"Home":t.preventDefault(),this._seek(0,1),this._showCurrentPoint();break;case"End":t.preventDefault(),this._seek(this._getDataPointCount(this.seriesIndex)-1,-1),this._showCurrentPoint();break;case"Enter":case" ":t.preventDefault(),this._fireClick(t);break;case"+":case"=":this._canZoom()&&(t.preventDefault(),null==(e=this.ctx.toolbar)||e.handleZoomIn(),this._announce("Zoomed in"));break;case"-":case"_":this._canZoom()&&(t.preventDefault(),null==(i=this.ctx.toolbar)||i.handleZoomOut(),this._announce("Zoomed out"));break;case"0":this._canZoom()&&this.w.interact.zoomed&&(t.preventDefault(),null==(s=this.ctx.toolbar)||s.handleZoomReset(),this._announce("Zoom reset"));break;case"Escape":t.preventDefault(),this._tooltipDismissed?(this.active=!1,this._tooltipDismissed=!1,this._hideFocus()):(this._tooltipDismissed=!0,this._hideFocus())}}}_canZoom(){var t,e;const i=this.w,s=null==(t=this.ctx.toolbar)?void 0:t._currentXRange();return Boolean(i.globals.axisCharts&&(null==(e=i.config.chart.zoom)?void 0:e.enabled)&&(i.axisFlags.isXNumeric||i.config.xaxis.convertedCatToNumeric||i.axisFlags.isRangeBar)&&(null==s?void 0:s.minX)<(null==s?void 0:s.maxX))}_canPan(){return this._canZoom()&&this.w.interact.zoomed}_panBy(t){var e;null==(e=this.ctx.zoomPanSelection)||e.panBy(t/10),this._announce(t>0?"Panned right":"Panned left")}_move(t,e){var i;const s=this.w,a=s.config.chart.accessibility.keyboard.navigation.wrapAround;if(0!==t){const e=this.w.globals.tooltip,r=s.config.chart.type;if(!("heatmap"===r||"treemap"===r||"radialBar"===r)&&(null==e?void 0:e.ttItems)&&e.tConfig.shared){const t=this.dataPointIndex;if(e.tooltipUtil&&e.tooltipUtil.isXoverlap(t)&&e.tooltipUtil.isInitialSeriesSameLen())return}"heatmap"!==r||(null==(i=s.config.yaxis[0])?void 0:i.reversed)||(t=-t);const n=this._getSeriesCount();let o=this.seriesIndex;for(let e=1;e<n;e++){let i=o+t*e;if(a)i=(i+n)%n;else if(i<0||i>=n)break;if(!s.globals.collapsedSeriesIndices.includes(i)){o=i;break}}this.seriesIndex=o;const l=this._getDataPointCount(o);this.dataPointIndex>=l&&(this.dataPointIndex=l-1)}0!==e&&(this._seek(this.dataPointIndex+e,e),this._isDataPointVisible(this.seriesIndex,this.dataPointIndex)||this._snapToVisibleRangeInDirection(e)),this._showCurrentPoint()}_seek(t,e){const i=this.w,s=i.seriesData.series[this.seriesIndex],a=this._getDataPointCount(this.seriesIndex);for(let r=0;r<a;r++,t+=e){if(i.config.chart.accessibility.keyboard.navigation.wrapAround)t=(t+a)%a;else if(t<0||t>=a)return;if(!Array.isArray(s)||null!==s[t])return void(this.dataPointIndex=t)}}_showCurrentPoint(){const{seriesIndex:t,dataPointIndex:e}=this,i=this.w,s=i.globals.tooltip;if(this._tooltipDismissed=!1,i.interact.capturedSeriesIndex=t,i.interact.capturedDataPointIndex=e,this._applyFocusClass(t,e),!(null==s?void 0:s.ttItems))return this._announce(this._buildPointLabel(t,e));this._showTooltip(t,e,s)}_hideFocus(){var t;const e=this.w,i=e.globals.tooltip;if(this._removeFocusClass(),this._leaveHoveredBar(),!i)return;null==(t=i.tooltipPosition)||t.resetPlacementCache(),i.marker&&i.marker.resetPointsSize(),this._enlargedScatterMarker=null;const s=i.getElTooltip();s&&(s.classList.remove("apexcharts-active"),e.config.chart.accessibility.enabled&&e.config.chart.accessibility.announcements.enabled&&s.setAttribute("aria-hidden","true")),e.dom.baseEl.classList.remove("apexcharts-tooltip-active");const a=i.getElXCrosshairs();a&&a.classList.remove("apexcharts-active")}_showTooltip(t,e,i){const s=this.w,a=s.config.chart.type,r=i.getElTooltip();if(!r)return;const n=i.getCachedDimensions();i.tooltipRect={x:0,y:0,ttWidth:n.ttWidth||0,ttHeight:n.ttHeight||0},this._setSyntheticEvent(t,e,i),s.dom.baseEl.classList.add("apexcharts-tooltip-active"),r.classList.add("apexcharts-active"),s.config.chart.accessibility.enabled&&s.config.chart.accessibility.announcements.enabled&&r.removeAttribute("aria-hidden"),"pie"===a||"donut"===a||"polarArea"===a||"radialBar"===a?this._showTooltipNonAxis(t,e,i,r):"heatmap"===a||"treemap"===a?this._showTooltipHeatTree(t,e,i,r,a):this._isBarLikeSeries(t)?this._showTooltipBar(t,e,i):this._showTooltipAxisLine(t,e,i),i.fixedTooltip&&i.drawFixedTooltipRect()}_isBarLikeSeries(t){var e;const i=this.w,s=i.config.series[t],a=i.globals.comboCharts&&null!=(e=null==s?void 0:s.type)?e:i.config.chart.type;return gt.isBarLikeType(a)}_setSyntheticEvent(t,e,i){const s=this.w,a=s.config.chart.type;let r=0,n=0;const o=this._getFocusableElement(t,e),l=o?null:this._canvasCell(t,e)||this._canvasMark(t,e);if(o){const t=o.getBoundingClientRect();r=t.left+t.width/2,n=t.top+t.height/2}else if(l){const t=gt.plotRect(s);r=t.left+(l.x+l.width/2)*t.zoom,n=t.top+(l.y+l.height/2)*t.zoom}else if(s.globals.pointsArray&&s.globals.pointsArray[t]&&s.globals.pointsArray[t][e]){const a=s.globals.pointsArray[t][e];if(i.getElGrid&&i.getElGrid()){const t=gt.plotRect(s);r=t.left+(a[0]||0)*t.zoom,n=t.top+(a[1]||0)*t.zoom}}else{const t=s.dom.Paper&&s.dom.Paper.node;if(t){const e=t.getBoundingClientRect();r=e.left+e.width/2,n=e.top+e.height/2}}if(!this._isBarLikeSeries(t)&&("line"===a||"area"===a||"rangeArea"===a||"scatter"===a||"bubble"===a||"radar"===a)&&s.globals.pointsArray&&s.globals.pointsArray[t]&&s.globals.pointsArray[t][e]){const a=s.globals.pointsArray[t][e];if(i.getElGrid&&i.getElGrid()){const t=gt.plotRect(s);r=t.left+(a[0]||0)*t.zoom,n=t.top+(a[1]||0)*t.zoom}}i.e={type:"mousemove",clientX:r,clientY:n},i.clientX=r,i.clientY=n}_showTooltipBar(t,e,i){var s,a,r,n;const h=this.w;h.globals.comboCharts&&(i.marker.resetPointsSize(),this._enlargedScatterMarker=null);const c=i.tConfig.shared&&(i.tooltipUtil.isXoverlap(e)||h.globals.isBarHorizontal)&&i.tooltipUtil.isInitialSeriesSameLen(),d=null==(n=null==(r=null==(a=null==(s=h.rangeData.seriesRange)?void 0:s[t])?void 0:a[e])?void 0:r.y)?void 0:n[0];i.tooltipLabels.drawSeriesTexts(l(o(o({ttItems:i.ttItems,i:t,j:e},void 0!==(null==d?void 0:d.y1)&&{y1:d.y1}),void 0!==(null==d?void 0:d.y2)&&{y2:d.y2}),{shared:c}));const u=`.apexcharts-series[data\\:realIndex='${t}']`,p=this._canvasMark(t,e)?null:h.dom.Paper.findOne(`${u} path[j='${e}'], ${u} circle[j='${e}'], ${u} rect[j='${e}']`);if(p){this._leaveHoveredBar();new R(this.w,this.ctx).pathMouseEnter(p,null),this._hoveredBarEl=p}if(h.globals.isBarHorizontal){const s=i.fixedTooltip;if(!s&&!i.showOnIntersect&&!gt.isFollowCursor(h)&&i.tooltipPosition.placeHorizontalSharedTooltip(e))return;const a=this._focusedBarInWrap(t,e,p,i),r=i.getElTooltip();if(a&&r&&!s){const s=i.tooltipRect.ttWidth||0,n=i.tooltipRect.ttHeight||0,o=gt.plotInWrap(h),l={top:o.top,bottom:o.top+h.layout.gridHeight,left:o.left,right:o.left+h.layout.gridWidth},c=i.tooltipPosition.placeOnShortPlot((a.left+a.right)/2,a.top,a.bottom);if(c)i.tooltipPosition.applyTooltipPosition(r,c);else if(h.config.tooltip.arrow)i.tooltipPosition.applyTooltipPosition(r,i.tooltipPosition.placeAroundBar(a,l,e,t));else{const t=i.xyRatios&&null!=i.xyRatios.baseLineInvertedY?l.left+i.xyRatios.baseLineInvertedY:(l.left+l.right)/2;let e=(a.left+a.right)/2<t?a.left-s:a.right;if(gt.isFollowCursor(h)){const t=(a.left+a.right)/2-l.left+15;e=l.left+(t+s>h.layout.gridWidth?t-s:t)}const o=(a.top+a.bottom)/2-n/2;r.style.left=Math.max(Math.min(e,l.right-s),l.left)+"px",r.style.top=Math.max(Math.min(o,l.bottom-n),l.top)+"px",delete r.dataset.placement}}}else this._pointerHoversOneMark(i)?this._hoverFocusedMark(t,e,p,i):i.tooltipPosition.moveStickyTooltipOverBars(e,t)}_pointerHoversOneMark(t){if(!t.showOnIntersect)return!1;return!(this.w.config.chart.group&&"function"==typeof this.ctx.getSyncedCharts&&this.ctx.getSyncedCharts().length>1)}_hoverFocusedMark(t,e,i,s){const a=this.w,r=this._canvasMark(t,e),n=!r&&(null==i?void 0:i.node)&&["apexcharts-bar-area","apexcharts-candlestick-area","apexcharts-boxPlot-area","apexcharts-rangebar-area","apexcharts-violin-area"].some(t=>i.node.classList.contains(t))?i.node:null;if(!r&&!n)return void s.tooltipPosition.moveStickyTooltipOverBars(e,t);const h=a.dom.Paper.node;s.intersect.handleBarTooltip({e:l(o({},s.e),{type:"mousemove",target:n||h,apexHoverTarget:n||h,apexPaintedHit:r}),opt:{paths:n||h,hoverArea:h,elGrid:s.getElGrid(),tooltipEl:s.getElTooltip(),ttItems:s.ttItems}})}_focusedBarInWrap(t,e,i,s){var a,r,n;const o=this.w,l=("violin"===o.config.chart.type||"violin"===(null==(a=o.config.series[t])?void 0:a.type))&&(null==(r=s.intersect)?void 0:r.violinGlyphRect(t,e))||(null==(n=null==i?void 0:i.node)?void 0:n.getBoundingClientRect())||this._canvasMarkRect(t,e);if(!l)return null;const h=o.dom.elWrap.getBoundingClientRect();return{top:l.top-h.top,bottom:l.bottom-h.top,left:l.left-h.left,right:l.right-h.left}}_showTooltipAxisLine(t,e,i){var s;const a=this.w,r=a.config.chart.type,n=i.tConfig.shared&&i.tooltipUtil.isXoverlap(e)&&i.tooltipUtil.isInitialSeriesSameLen();i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,j:e,shared:n});const o="scatter"===r||"bubble"===r||"radar"===r,l=a.globals.markers.largestSize>0&&!a.globals.markers.batched&&"canvas"!==(null==(s=this.ctx.renderer)?void 0:s.kind),h=this._pointerHoversOneMark(i)?this._canvasMarker(t,e):null;h?this._hoverPaintedMarker(h,i):o||l&&!n?this._showScatterBubblePoint(t,e,i)||i.tooltipPosition.moveDynamicPointOnHover(e,t):l?i.marker.enlargePoints(e):n?i.tooltipPosition.moveDynamicPointsOnHover(e):i.tooltipPosition.moveDynamicPointOnHover(e,t)}_canvasMarker(t,e){const i=this.ctx.renderer;return i&&"canvas"===i.kind&&"function"==typeof i.findMarker?i.findMarker(t,e):null}_hoverPaintedMarker(t,e){e.intersect.handlePaintedMarkerTooltip({e:l(o({},e.e),{type:"mousemove"}),opt:{tooltipEl:e.getElTooltip(),ttItems:e.ttItems},marker:{i:t.seriesIndex,j:t.dataPointIndex,cx:t.x,cy:t.y,size:t.size}})}_showScatterBubblePoint(t,e,i){const s=this.w.dom.baseEl;this._enlargedScatterMarker&&(i.marker.oldPointSize(this._enlargedScatterMarker),this._enlargedScatterMarker=null);const a=s.querySelector(`.apexcharts-series[data\\:realIndex='${t}']`);if(!a)return!1;const r=a.querySelector(`.apexcharts-marker[rel='${e}']`);return!!r&&(i.marker.enlargeCurrentPoint(e,r),this._enlargedScatterMarker=r,!0)}_showTooltipNonAxis(t,e,i,s){i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t+e,shared:!1});const a=s.getBoundingClientRect(),r=a.width||i.tooltipRect.ttWidth||0,n=a.height||i.tooltipRect.ttHeight||0,o=i.getSliceAnchor(this._getFocusableElement(t,e));if(o){const t=i.tooltipPosition.placeOverAnchor(o.x,o.y,r,n,10);s.style.left=t.x+"px",s.style.top=t.y+"px"}}_showTooltipHeatTree(t,e,i,s,a){var r,n;const o=this.w;if(gt.isFollowCursor(o)&&this._hoverFocusedCell(t,e,i))return;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,j:e,shared:!1});const l=s.getBoundingClientRect(),h=l.width||i.tooltipRect.ttWidth||0,c=l.height||i.tooltipRect.ttHeight||0,d="heatmap"===a?"apexcharts-heatmap-rect":"apexcharts-treemap-rect",u=o.dom.baseEl.querySelector(`.${d}[i='${t}'][j='${e}']`),p=u?null:this._canvasCell(t,e);if(u||p){const t=o.dom.elWrap.getBoundingClientRect();let e=0,l=0,d=0,g=0;if(u){const s=u.getBoundingClientRect();e=s.left-t.left,l=s.top-t.top,d=s.width,g=s.height;const a=parseFloat(null!=(r=u.getAttribute("cx"))?r:""),o=parseFloat(null!=(n=u.getAttribute("width"))?n:"");i.tooltipPosition.moveXCrosshairs(a+o/2)}else if(p){const t=gt.plotInWrap(o);e=t.left+p.x,l=t.top+p.y,d=p.width,g=p.height,i.tooltipPosition.moveXCrosshairs(p.x+p.width/2)}let f=e+d+h/2;const m=l+g/2-c/2;e+d>o.layout.gridWidth/2&&(f=e-h/2);const x=i.tooltipPosition.shortPlotPlacement,b=i.tooltipPosition.placeOnShortPlot(e+d/2,l,l+g);if(b)return void i.tooltipPosition.applyTooltipPosition(s,b);if("heatmap"===a&&o.config.tooltip.arrow&&!gt.isFollowCursor(o)){const{left:t,top:a}=gt.plotInWrap(o);return void i.tooltipPosition.applyTooltipPosition(s,i.tooltipPosition.placeAroundCell({top:l,bottom:l+g,left:e,right:e+d},{top:a,bottom:a+o.layout.gridHeight,left:t,right:t+o.layout.gridWidth},{el:u,ttWidth:h,ttHeight:c}))}s.style.left=f+"px",s.style.top=m+"px",x&&delete s.dataset.placement}}_hoverFocusedCell(t,e,i){const s=this.w,a=s.config.chart.type,r=i.getElTooltip(),n=s.dom.baseEl.querySelector(`.apexcharts-${a}-rect[i='${t}'][j='${e}']`);if(!r||!n&&!this._canvasCell(t,e))return!1;const h=n||s.dom.Paper.node;s.interact.capturedSeriesIndex=-1,s.interact.capturedDataPointIndex=-1;const c=i.intersect.handleHeatTreeTooltip({e:l(o({},i.e),{type:"mousemove",target:h,apexHoverTarget:h}),opt:{ttItems:i.ttItems},x:0,y:0,type:a}),d=!c.noHit&&s.interact.capturedSeriesIndex===t&&s.interact.capturedDataPointIndex===e;return s.interact.capturedSeriesIndex=t,s.interact.capturedDataPointIndex=e,!!d&&(i.placeCellTooltip(r,c),!0)}_canvasCell(t,e){if("heatmap"!==this.w.config.chart.type)return null;const i=this.ctx.renderer;return i&&"canvas"===i.kind&&"function"==typeof i.findCell?i.findCell(t,e):null}_canvasMark(t,e){if(!this._isBarLikeSeries(t))return null;const i=this.ctx.renderer;return i&&"canvas"===i.kind&&"function"==typeof i.findMark?i.findMark(t,e):null}_canvasMarkRect(t,e){const i=this._canvasMark(t,e);if(!i)return null;const s=gt.plotRect(this.w),a=s.left+i.x*s.zoom,r=s.top+i.y*s.zoom;return{left:a,top:r,right:a+i.width*s.zoom,bottom:r+i.height*s.zoom}}_applyFocusClass(t,e){this._removeFocusClass();const i=this._getFocusableElement(t,e)||this._getBatchedFocusEl(t)||this._drawCanvasFocusRing(t,e);if(i){i.classList.add("apexcharts-keyboard-focused"),i.setAttribute("role","img");const s=this._buildPointLabel(t,e);s&&i.setAttribute("aria-label",s),this._focusedEl=i}}_getBatchedFocusEl(t){return this.w.globals.markers.batched?this.w.dom.baseEl.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] .apexcharts-series-markers path`):null}_drawCanvasFocusRing(t,e){const i=this._canvasCell(t,e);if(!i)return this._drawCanvasMarkFocusRing(t,e);const s=this.w.dom.baseEl.querySelector(`.apexcharts-heatmap .apexcharts-series[rel='${t+1}']`);if(!s)return null;const a=new R(this.w,this.ctx).drawRect(i.x,i.y,i.width,i.height,i.radius,"none");return a.node.classList.add("apexcharts-keyboard-focus-ring"),a.attr({i:t,j:e}),s.insertBefore(a.node,s.firstChild),a.node}_drawCanvasMarkFocusRing(t,e){const i=this._canvasMark(t,e);if(!i)return this._drawCanvasMarkerFocusRing(t,e);const s=this.w,a=this._seriesGroup(t);if(!a)return null;const r=new R(s,this.ctx).drawPath({d:i.d,fill:"none",classes:"apexcharts-keyboard-focus-ring"});return r.attr("clip-path",`url(#gridRectBarMask${s.globals.cuid})`),a.insertBefore(r.node,a.firstChild),r.node}_drawCanvasMarkerFocusRing(t,e){const i=this._canvasMarker(t,e);if(!i)return null;const s=this.w,a=this._seriesGroup(t);if(!a)return null;const r=new R(s,this.ctx).drawPath({d:i.d,fill:"none",classes:"apexcharts-keyboard-focus-ring"});return r.attr("clip-path",`url(#gridRectMarkerMask${s.globals.cuid})`),a.appendChild(r.node),r.node}_removeFocusClass(){this._focusedEl&&(this._focusedEl.classList.remove("apexcharts-keyboard-focused"),this._focusedEl.removeAttribute("role"),this._focusedEl.removeAttribute("aria-label"),this._focusedEl.classList.contains("apexcharts-keyboard-focus-ring")&&this._focusedEl.remove(),this._focusedEl=null)}_buildPointLabel(t,e){var i,s,a,r,n,o,l,h;const c=this.w,d=c.config.chart.type,u=c.seriesData.seriesNames||[],p=c.seriesData.series||[];if("pie"===d||"donut"===d||"polarArea"===d){const t=null!=(s=(null==(i=c.labelData)?void 0:i.labels)&&c.labelData.labels[e])?s:"",a=Array.isArray(p)?p[e]:"";return t?`${t}: ${a}`:`${a}`}if("radialBar"===d){return`${u[t]||`Series ${t+1}`}: ${Array.isArray(p)?p[t]:""}`}const g=u[t]||`Series ${t+1}`,f=(Array.isArray(p[t])?p[t]:[])[e];let m=null==f?"":String(f);const x=null==(r=null==(a=c.formatters)?void 0:a.yLabelFormatters)?void 0:r[t];if("function"==typeof x)try{m=x(f,{seriesIndex:t,dataPointIndex:e,w:c})}catch(t){}let b="";const y=null==(n=c.labelData)?void 0:n.categoryLabels,v=null==(l=null==(o=c.seriesData)?void 0:o.seriesX)?void 0:l[t];if(Array.isArray(y)&&null!=y[e])b=String(y[e]);else if(Array.isArray(v)&&null!=v[e]){const i=null==(h=c.formatters)?void 0:h.xLabelFormatter;if("function"==typeof i)try{b=String(i(v[e],{seriesIndex:t,dataPointIndex:e,w:c}))}catch(t){b=String(v[e])}else b=String(v[e])}return b?`${g}: ${m}, ${b}`:`${g}: ${m}`}_leaveHoveredBar(){if(this._hoveredBarEl){new R(this.w,this.ctx).pathMouseLeave(this._hoveredBarEl,null),this._hoveredBarEl=null}}_getFocusableElement(t,e){var i,s;const a=this.w,r=a.config.chart.type,n=a.dom.baseEl;return"pie"===r||"donut"===r||"polarArea"===r?n.querySelector(`.apexcharts-pie-area[j='${e}']`):"heatmap"===r?n.querySelector(`.apexcharts-heatmap-rect[i='${t}'][j='${e}']`):"treemap"===r?n.querySelector(`.apexcharts-treemap-rect[i='${t}'][j='${e}']`):"radialBar"===r?n.querySelector(`.apexcharts-radialbar-slice-${t}`):this._isBarLikeSeries(t)?this._canvasMark(t,e)?null:null==(i=this._seriesGroup(t))?void 0:i.querySelector(`path[j='${e}']`):null==(s=this._seriesGroup(t))?void 0:s.querySelector(`.apexcharts-marker[rel='${e}']`)}_seriesGroup(t){return Array.from(this.w.dom.baseEl.querySelectorAll(".apexcharts-series")).find(e=>e.getAttribute("data:realIndex")===String(t))}_fireClick(t){var e,i;const s=null==(e=this._focusedEl)?void 0:e.instance,a=this.ctx.pie;s&&new R(this.w,this.ctx).pathMouseDown(s,t),a&&a.getExpandOffset()>0&&a.pieClicked(this.dataPointIndex),null==(i=this.w.globals.tooltip)||i.markerClick(t,this.seriesIndex,this.dataPointIndex)}_isNavEnabled(){const t=this.w.config.chart.accessibility;return t.enabled&&t.keyboard.enabled&&t.keyboard.navigation.enabled}_getSeriesCount(){const t=this.w,e=t.config.chart.type;return"pie"===e||"donut"===e||"polarArea"===e?1:t.seriesData.series.length}_getDataPointCount(t){const e=this.w,i=e.config.chart.type;if("pie"===i||"donut"===i||"polarArea"===i)return e.seriesData.series.length;const s=e.seriesData.series[t];return Array.isArray(s)?s.length:1}_clampCursor(){const t=this._getSeriesCount();this.seriesIndex>=t&&(this.seriesIndex=t-1),this.seriesIndex<0&&(this.seriesIndex=0);const e=this._getDataPointCount(this.seriesIndex);this.dataPointIndex>=e&&(this.dataPointIndex=e-1),this.dataPointIndex<0&&(this.dataPointIndex=0)}_snapToVisibleRange(){const t=this.w,e=t.globals,i=this.seriesIndex;if(!t.interact.zoomed)return;const s=t.seriesData.seriesX&&t.seriesData.seriesX[i];if(!s||!s.length)return;const a=e.minX,r=e.maxX;if(void 0===a||void 0===r)return;const n=s[this.dataPointIndex];if(n>=a&&n<=r)return;const o=s.length;for(let t=0;t<o;t++)if(s[t]>=a&&s[t]<=r)return void(this.dataPointIndex=t)}_snapToVisibleRangeInDirection(t){const e=this.w,i=e.globals,s=this.seriesIndex,a=e.seriesData.seriesX&&e.seriesData.seriesX[s];if(!a||!a.length)return;const r=i.minX,n=i.maxX;if(void 0===r||void 0===n)return;const o=a.length;if(t>=0){for(let t=0;t<o;t++)if(a[t]>=r&&a[t]<=n)return void(this.dataPointIndex=t)}else for(let t=o-1;t>=0;t--)if(a[t]>=r&&a[t]<=n)return void(this.dataPointIndex=t)}_isDataPointVisible(t,e){const i=this.w,s=i.globals;if(!i.interact.zoomed)return!0;const a=i.seriesData.seriesX&&i.seriesData.seriesX[t];if(!a)return!0;const r=a[e];return void 0===r||r>=s.minX&&r<=s.maxX}_announce(t){const e=this.w;if(!e.config.chart.accessibility.announcements.enabled)return;const i=e.dom.baseEl;if(!i)return;const s=i.querySelector(".apexcharts-sr-status");s&&(s.textContent="",clearTimeout(this._announceTimer),this._announceTimer=setTimeout(()=>{s.textContent=t},0))}}});const Ce=new Set(["bar","funnel","pyramid","histogram"]),ke=new Set(["pie","donut","polarArea","radialBar","gauge"]),Pe=new Set(["unit","waffle"]),Le=new Set(["treemap","sunburst"]),Me=new Set(["boxPlot","violin"]);let Ie=0;const Ee=1500,Fe=t=>{t.removeAttribute("opacity"),t.removeAttribute("data-piece-hidden")};function De(t){return Ce.has(t)?"bar":ke.has(t)?"radial":Pe.has(t)?"unit":Le.has(t)?"partition":Me.has(t)?"summary":null}c.default.registerFeatures({morphTypeChange:class{constructor(t,e){this.w=t,this.ctx=e,this._snapshot=null,this._shown=!1,this._ghost=null,this._pieceLayer=null,this._pieceCancel=null,this._ghostTimer=void 0}canMorphTypes(t,e){if(t===e)return!1;const i=De(t),s=De(e);return!(!i||!s)&&("partition"===i==("partition"===s)||"unit"!==i&&"unit"!==s)}isCompatibleSeriesShape(t,e,i){if(!Array.isArray(i)||0===i.length)return!1;const s=De(t),a=De(e);return"unit"===a?!!i.every(t=>"number"==typeof t)||i.every(t=>t&&"object"==typeof t&&Array.isArray(t.data)):"partition"===a||("radial"===a?!!i.every(t=>"number"==typeof t)||1===i.length&&i[0]&&"object"==typeof i[0]&&Array.isArray(i[0].data):"bar"===a||"summary"===a?i.every(t=>t&&"object"==typeof t&&Array.isArray(t.data)):null!==s&&null!==a)}captureBeforeDestroy({fromType:t,toType:e,newSeries:i}){var s;if(this._snapshot=null,this._shown=!1,this._removeGhost(),this._cancelPieces(),!Nt.isBrowser())return!1;const a=this.w.config.chart.animations;if(!a||!1===a.enabled)return!1;if(a.chartTypeMorph&&!1===a.chartTypeMorph.enabled)return!1;if(a.respectReducedMotion&&f())return!1;if(!this.canMorphTypes(t,e))return!1;if(!this.isCompatibleSeriesShape(t,e,i))return!1;const{marks:r,branches:n,unitDots:o}=this._captureFromDOM(t);if(!r.length)return!1;const l=this._buildMapping(r,t,e,i,n);if(0===l.size)return!1;const h=this.w.globals,c=null==(s=this.w.dom.elGraphical)?void 0:s.node,d=h.layoutTween&&!h.layoutTween.done&&h.layoutTween.graphical===c?h.layoutTween.rect:null,u=h.circleTween,p=u&&!u.done&&(null==c?void 0:c.contains(u.node))?u:null,g=p?p.circle.r/p.target.r:1;this._snapshot={fromType:t,toType:e,mapping:l,oldLayout:{translateX:d?d.x:this.w.layout.translateX||0,translateY:d?d.y:this.w.layout.translateY||0,scale:g,shiftX:p?p.circle.cx-g*p.target.cx:0,shiftY:p?p.circle.cy-g*p.target.cy:0}};const m=De(t),x=De(e),b=this._canProbePaths();if("unit"===x&&("bar"===m||"summary"===m||"radial"===m&&b)){const t=this._countUnitSeries(i);this._snapshot.pieceOut=t>0&&t<=Ee}else if("unit"===m&&("bar"===x||"summary"===x||"radial"===x&&b&&!/^(radialBar|gauge)$/.test(e))){let t=0;o.forEach(e=>{t+=e.length}),t>0&&t<=Ee&&(this._snapshot.pieceIn=!0,this._snapshot.sourceDots=o,this._snapshot.keyOrder=this._targetKeys(x,i))}return!this._needsGhost(t,e)||this._snapshot.pieceOut||this._snapshot.pieceIn||this._captureGhost(),this.w.globals.previousPaths=[],!0}_needsGhost(t,e){return"unit"===De(t)||"unit"===De(e)}_captureGhost(){var t,e;const i=null==(t=this.w.dom)?void 0:t.Paper,s=i&&i.node;if(!s||"function"!=typeof s.cloneNode)return;const a=s.cloneNode(!0),r=[".apexcharts-xaxis",".apexcharts-yaxis",".apexcharts-grid",".apexcharts-legend",".apexcharts-title-text",".apexcharts-subtitle-text",".apexcharts-annotations",".apexcharts-zoom-rect",".apexcharts-selection-rect",".apexcharts-xcrosshairs",".apexcharts-ycrosshairs"];if("function"==typeof a.querySelectorAll&&r.forEach(t=>{a.querySelectorAll(t).forEach(t=>{t.remove()})}),"function"==typeof a.querySelectorAll){const t="-ghost"+ ++Ie,e=new Set;a.querySelectorAll("[id]").forEach(i=>{e.add(i.id),i.id+=t}),a.querySelectorAll("*").forEach(i=>{for(const s of i.attributes){const i=s.value.replace(/(url\(['"]?#|^#)([^'")\s]+)/g,(i,s,a)=>e.has(a)?s+a+t:i);i!==s.value&&(s.value=i)}})}null==(e=a.removeAttribute)||e.call(a,"id"),this._ghost=a}_mountGhost(){var t,e,i;const s=this._ghost;if(!s||!Nt.isBrowser())return;const a=null==(t=this.w.dom)?void 0:t.elWrap;if(!a||"function"!=typeof a.appendChild)return void(this._ghost=null);const r=s.style;r&&(r.position="absolute",r.left="0",r.top="0",r.background="transparent",r.pointerEvents="none",r.opacity="1"),null==(e=s.setAttribute)||e.call(s,"aria-hidden","true"),null==(i=s.setAttribute)||i.call(s,"class","apexcharts-morph-ghost"),a.appendChild(s);const n=this.getSpeed(),o=Math.max(120,Math.round(.55*n));ft.requestAnimationFrame(()=>{r&&(r.transition=`opacity ${o}ms ease-in`,r.opacity="0")}),this._ghostTimer=setTimeout(()=>this._removeGhost(),o+60)}_removeGhost(){clearTimeout(this._ghostTimer);const t=this._ghost;this._ghost=null,null==t||t.remove()}_countUnitSeries(t){if(!Array.isArray(t))return 0;let e=0;for(const i of t){if(!i||"object"!=typeof i||!Array.isArray(i.data))return 0;e+=i.data.length}return e}usesPieceTakeover(){return!(!this._snapshot||!this._snapshot.pieceOut)}claimsTargetMark(t,e){return!!(this._snapshot&&this._snapshot.pieceIn&&this._snapshot.mapping.has(`${t}:${e}`))}_makePieceLayer(){var t,e;const i=null==(t=this.w.dom)?void 0:t.elGraphical,s=i&&i.node;if(!s||"function"!=typeof s.appendChild)return null;const a=ft.createElementNS("http://www.w3.org/2000/svg","g");if(!a)return null;a.setAttribute("class","apexcharts-morph-pieces"),a.setAttribute("pointer-events","none");const r=null==(e=this.w.globals)?void 0:e.cuid;return r&&a.setAttribute("clip-path",`url(#gridRectBarMask${r})`),s.appendChild(a),this._pieceLayer=a,a}_revealPieceHidden(){var t;const e=null==(t=this.w.globals.dom)?void 0:t.baseEl;e&&"function"==typeof e.querySelectorAll&&e.querySelectorAll("[data-piece-hidden]").forEach(Fe)}_cancelPieces(){this._pieceCancel&&(this._pieceCancel(),this._pieceCancel=null);const t=this._pieceLayer;this._pieceLayer=null,null==t||t.remove(),this._revealPieceHidden()}_canProbePaths(){if(!Nt.isBrowser())return!1;const t=ft.createElementNS("http://www.w3.org/2000/svg","path");return!!t&&"function"==typeof t.isPointInFill}_makeExtentProber(t,e,i){const s=i.ownerDocument.createElementNS("http://www.w3.org/2000/svg","path");s.setAttribute("d",t),s.setAttribute("fill","#000"),s.setAttribute("stroke","#000"),s.setAttribute("stroke-width","3"),s.setAttribute("visibility","hidden"),i.appendChild(s);const a=s.ownerSVGElement;if("function"!=typeof s.isPointInFill||!a||"function"!=typeof a.createSVGPoint)return s.remove(),null;const r=a.createSVGPoint(),n=(t,e)=>{r.x=t,r.y=e;const i=s;return i.isPointInFill(r)||i.isPointInStroke(r)},o=48;return{intervalsAt:(t,i,s)=>{const a=s?e.y:e.x,r=a+(s?e.height:e.width);if(!(r>a))return null;const l=(t,e)=>s?n(e,t):n(t,e),h=[t+.1*(i-t),(t+i)/2,i-.1*(i-t)],c=(t,e,i)=>{let s=e,a=t;for(let t=0;t<6;t++){const t=(s+a)/2;l(t,i)?a=t:s=t}return(s+a)/2},d=(r-a)/o,u=new Array(49).fill(null);let p=!1;for(const t of h)for(let e=0;e<=o;e++)null===u[e]&&l(a+e*d,t)&&(u[e]=t,p=!0);if(!p)return null;const g=[];let f=-1;for(let t=0;t<=49;t++){const e=t<=o&&null!==u[t];if(e&&f<0&&(f=t),!e&&f>=0){const e=t-1,i=u[f],s=0===f?a:c(a+f*d,a+(f-1)*d,i),n=e===o?r:c(a+e*d,a+(e+1)*d,u[e]);n>s&&g.push([s,n]),f=-1}}return g.length?g:null},dispose:()=>{s.remove()}}}_separatePieces(){var t;const e=this._snapshot,i=null==(t=this.w.globals.dom)?void 0:t.baseEl;if(!e||!i)return this._revealPieceHidden();const s=this._readUnitDots(i,new Map);let a=0;if(s.forEach(t=>{a+=t.length}),0===a||a>Ee)return this._revealPieceHidden();const r=this._makePieceLayer();if(!r)return this._revealPieceHidden();const n=[],o=r.ownerDocument,l=o.createDocumentFragment(),h=De(e.fromType),c="summary"===h||"radial"===h;if(Array.from(s.keys()).sort((t,e)=>t-e).forEach(t=>{var i;const a=s.get(t),h=this.getInitialBBoxFor(t),d=e.mapping.get(`${t}:0`);if(!h||!d)return void a.forEach(t=>Fe(t.el));const u=d.fill&&0!==d.fill.indexOf("url(")?d.fill:(null==(i=this.w.globals.colors)?void 0:i[t])||a[0].fill;let p=null;if(c){const e=this.getInitialPathFor(t,0);e&&(p=this._makeExtentProber(e,h,r))}const g=p?ve(h,a.length,p.intervalsAt):ye(h,a.length);p&&p.dispose();const f=_e(g,t=>[t.x+t.width/2,t.y+t.height/2]),m=_e(a,t=>[t.x,t.y]);for(let e=0;e<m.length;e++){const i=f[e],s=m[e],a=o.createElementNS("http://www.w3.org/2000/svg","rect");a.setAttribute("data-i",String(t)),a.setAttribute("data-key",s.el.getAttribute("data-key")),a.setAttribute("x",String(i.x)),a.setAttribute("y",String(i.y)),a.setAttribute("width",String(i.width)),a.setAttribute("height",String(i.height)),a.setAttribute("rx","0"),a.setAttribute("fill",String(u)),l.appendChild(a),n.push({el:a,from:{x:i.x,y:i.y,width:i.width,height:i.height,rx:0},to:{x:s.x-s.r,y:s.y-s.r,width:2*s.r,height:2*s.r,rx:s.r},fill:Se(u,s.fill),fillEnd:s.fill,delay:0,meta:{dotEl:s.el}})}}),r.appendChild(l),!n.length)return this._cancelPieces();this._runPieces(n,t=>{Fe(t.meta.dotEl),t.el.remove()})}_readUnitDots(t,e){return t.querySelectorAll(".apexcharts-unit-area").forEach(t=>{var i;const s=parseInt(null!=(i=t.getAttribute("i"))?i:"",10);if(isNaN(s))return;const a=e=>parseFloat(t.getAttribute(e)),r=t.getAttribute("cx"),n=a("width")||0,o=a("height")||0,l=null!=r?parseFloat(r):a("x")+n/2,h=null!=r?a("cy"):a("y")+o/2,c=(null!=r?a("r"):Math.max(n,o)/2)||3;if(!isFinite(l)||!isFinite(h))return;let d=e.get(s);d||e.set(s,d=[]),d.push({el:t,x:l,y:h,r:c,fill:t.getAttribute("fill")})}),e}_combinePieces(){var t,e;const i=this._snapshot,s=null==(t=this.w.globals.dom)?void 0:t.baseEl;if(!(i&&i.sourceDots&&i.keyOrder&&s))return this._revealPieceHidden();const a=this._collectTargetMarks(i.toType);if(!a.size)return this._revealPieceHidden();const{dx:r,dy:n}=this._oldToNew(),o=Array.from(i.sourceDots.keys()).sort((t,e)=>t-e),l=this._makePieceLayer();if(!l)return this._revealPieceHidden();const h=l.ownerDocument,c=h.createDocumentFragment(),d=[],u=De(i.toType),p="summary"===u||"radial"===u;for(let t=0;t<o.length;t++){const s=i.sourceDots.get(o[t]),u=i.keyOrder[o[t]],g=u?a.get(u):null,f=g&&this._markD(g),m=f&&this._pathBBox(f);if(!m||!s||!s.length){g&&g.els.forEach(Fe);continue}const x={x:m.minX,y:m.minY,width:m.maxX-m.minX,height:m.maxY-m.minY},b=g.fill&&0!==g.fill.indexOf("url(")?g.fill:(null==(e=this.w.globals.colors)?void 0:e[g.realIndex])||s[0].fill,y=p?this._makeExtentProber(f,x,l):null,v=y?ve(x,s.length,y.intervalsAt):ye(x,s.length);y&&y.dispose();const w=_e(v,t=>[t.x+t.width/2,t.y+t.height/2]),_=_e(s,t=>[t.x,t.y]),A={remaining:_.length,els:g.els,g:c.appendChild(h.createElementNS("http://www.w3.org/2000/svg","g"))};for(let t=0;t<_.length;t++){const e=_[t],i=w[t],s=h.createElementNS("http://www.w3.org/2000/svg","rect"),a=e.x+r-e.r,o=e.y+n-e.r;s.setAttribute("data-key",u),s.setAttribute("x",String(a)),s.setAttribute("y",String(o)),s.setAttribute("width",String(2*e.r)),s.setAttribute("height",String(2*e.r)),s.setAttribute("rx",String(e.r)),s.setAttribute("fill",String(e.fill||b)),A.g.appendChild(s),d.push({el:s,from:{x:a,y:o,width:2*e.r,height:2*e.r,rx:e.r},to:{x:i.x,y:i.y,width:i.width,height:i.height,rx:0},fill:Se(e.fill,b),fillEnd:String(b),delay:0,meta:{markState:A}})}}if(l.appendChild(c),!d.length)return this._cancelPieces();this._runPieces(d,t=>{const e=t.meta.markState;e.remaining--,0===e.remaining&&(e.els.forEach(Fe),e.g.remove())})}_markD(t){return t.d||t.els.map(t=>t.getAttribute("pathTo")||t.getAttribute("d")).filter(Boolean).join(" ")}_runPieces(t,e){var i,s;const a=this.getSpeed(),r=Math.min(300,.35*a),n=Math.max(180,a-r);for(let e=0;e<t.length;e++)t[e].delay=t.length>1?e/(t.length-1)*r:0;const o=this.w.config.chart.animations;this._pieceCancel=function({pieces:t,duration:e,ease:i,onPieceDone:s,onAllDone:a,alive:r}){let n=!1;const o=performance.now(),l=Math.max(1,e),h=(t,e)=>{const i=t.from,s=t.to,a=t.el;a.setAttribute("x",String(i.x+(s.x-i.x)*e)),a.setAttribute("y",String(i.y+(s.y-i.y)*e)),a.setAttribute("width",String(Math.max(0,i.width+(s.width-i.width)*e))),a.setAttribute("height",String(Math.max(0,i.height+(s.height-i.height)*e))),a.setAttribute("rx",String(Math.max(0,i.rx+(s.rx-i.rx)*e))),t.fill?a.setAttribute("fill",t.fill(e)):e>=1&&t.fillEnd&&a.setAttribute("fill",t.fillEnd)},c=e=>{if(n||r&&!r())return;const d=e-o;let u=!1;for(let e=0;e<t.length;e++){const a=t[e];if(a._done)continue;const r=(d-a.delay)/l;if(r<1&&(u=!0),r<=0)continue;const n=Math.min(1,r);h(a,i(n)),n>=1&&(a._done=!0,s&&s(a))}u?ft.requestAnimationFrame(c):a&&a()};return ft.requestAnimationFrame(c),()=>{n=!0}}({pieces:t,duration:n,ease:w(null!=(s=null==(i=o.dynamicAnimation)?void 0:i.easing)?s:o.easing),onPieceDone:e,alive:()=>!this.w.globals.isDestroyed,onAllDone:()=>{this._pieceCancel=null,this._cancelPieces()}})}_collectTargetMarks(t){var e;const i=null==(e=this.w.globals.dom)?void 0:e.baseEl,s=new Map;if(!i)return s;const a=De(t);if("radial"===a)return i.querySelectorAll(".apexcharts-pie-series .apexcharts-pie-area").forEach((t,e)=>{const i=t.getAttribute("data:pathFinal")||t.getAttribute("d");i&&i.trim()&&s.set(`${e}:0`,{realIndex:e,d:i,fill:t.getAttribute("fill"),els:[t]})}),s;const r="summary"===a?`.apexcharts-${t}-series`:".apexcharts-bar-series";return i.querySelectorAll(`${r} .apexcharts-series`).forEach(t=>{var e;const i=parseInt(null!=(e=t.getAttribute("data:realIndex"))?e:"0",10)||0;let a=0;t.querySelectorAll("path[pathTo]:not(.apexcharts-highlight-part)").forEach(t=>{var e;const r=t.getAttribute("pathTo")||t.getAttribute("d");if(!r||!r.trim())return;const n=parseInt(null!=(e=t.getAttribute("j"))?e:"",10),o=isNaN(n)?a++:n,l=`${i}:${o}`,h=s.get(l);h?h.els.push(t):s.set(l,{realIndex:i,fill:t.getAttribute("fill"),els:[t]})})}),s}_captureFromDOM(t){var e;const i=null==(e=this.w.globals.dom)?void 0:e.baseEl;if(!i)return{marks:[],branches:[],unitDots:new Map};const s=[],a=[],r=new Map,n=De(t);if("bar"===n){i.querySelectorAll(".apexcharts-bar-series .apexcharts-series").forEach(t=>{var e;const i=parseInt(null!=(e=t.getAttribute("data:realIndex"))?e:"0",10);t.querySelectorAll("path[pathTo]:not(.apexcharts-highlight-part)").forEach((t,e)=>{const a=t.getAttribute("d")||t.getAttribute("pathTo");a&&s.push({realIndex:i,j:e,d:a,fill:t.getAttribute("fill")})})})}else if("summary"===n){const e=new Map;i.querySelectorAll(`.apexcharts-${t}-area`).forEach(t=>{var i,s;const a=parseInt(null!=(i=t.getAttribute("j"))?i:"",10);if(isNaN(a))return;const r=t.getAttribute("d")||t.getAttribute("pathTo");if(!r||!r.trim())return;const n="function"==typeof t.closest?t.closest(".apexcharts-series"):null,o=parseInt(null!=(s=null==n?void 0:n.getAttribute("data:realIndex"))?s:"0",10)||0,l=`${o}:${a}`,h=e.get(l);h?h.d+=` ${r}`:e.set(l,{realIndex:o,j:a,d:r,fill:t.getAttribute("fill")})}),Array.from(e.values()).sort((t,e)=>t.realIndex-e.realIndex||t.j-e.j).forEach(t=>s.push(t))}else if("partition"===n)if("treemap"===t){const t=t=>{var e,i,s,a;const r=parseFloat(null!=(e=t.getAttribute("x"))?e:""),n=parseFloat(null!=(i=t.getAttribute("y"))?i:""),o=parseFloat(null!=(s=t.getAttribute("width"))?s:""),l=parseFloat(null!=(a=t.getAttribute("height"))?a:"");return[r,n,o,l].every(t=>isFinite(t))?`M ${r} ${n} L ${r+o} ${n} L ${r+o} ${n+l} L ${r} ${n+l} Z`:null};i.querySelectorAll(".apexcharts-treemap-rect").forEach(e=>{var i,a;const r=t(e);r&&s.push({realIndex:parseInt(null!=(i=e.getAttribute("i"))?i:"0",10)||0,j:parseInt(null!=(a=e.getAttribute("j"))?a:"0",10)||0,d:r,fill:e.getAttribute("fill"),key:e.getAttribute("data:key")||null})});i.querySelectorAll(".apexcharts-treemap-parent-rect").forEach(e=>{const i=t(e),s=e.getAttribute("data:key");i&&s&&a.push({key:s,d:i,fill:e.getAttribute("fill")})})}else{const t=i.querySelectorAll(".apexcharts-sunburst-arc"),e=[];t.forEach(t=>{"true"===t.getAttribute("data:leaf")&&e.push(t)});(e.length?e:Array.from(t)).forEach((t,e)=>{const i=t.getAttribute("d");i&&i.trim()&&s.push({realIndex:e,j:0,d:i,fill:t.getAttribute("fill"),key:t.getAttribute("data:key")||null})}),t.forEach(t=>{if("true"===t.getAttribute("data:leaf"))return;const e=t.getAttribute("d"),i=t.getAttribute("data:key");e&&e.trim()&&i&&a.push({key:i,d:e,fill:t.getAttribute("fill")})})}else if("unit"===n)this._readUnitDots(i,r),Array.from(r.keys()).sort((t,e)=>t-e).forEach(t=>{const e=r.get(t),i=e.map(t=>t.x),a=e.map(t=>t.y),n=Math.min(...i)-2,o=Math.min(...a)-2,l=Math.max(...i)+2,h=Math.max(...a)+2;s.push({realIndex:t,j:0,d:`M ${n} ${o} L ${l} ${o} L ${l} ${h} L ${n} ${h} Z`,fill:e[0].fill})});else if("radial"===n)if("radialBar"===t||"gauge"===t){const t=this.w.globals.circleGeometry,e=t?t.cx:this.w.layout.gridWidth/2,a=t?t.cy:this.w.layout.gridHeight/2;i.querySelectorAll(".apexcharts-radial-series .apexcharts-radialbar-area").forEach(t=>{var i;const r=t.parentElement,n=parseInt(null!=(i=null==r?void 0:r.getAttribute("data:realIndex"))?i:"0",10),o=t.getAttribute("d");if(!o)return;const l=parseFloat(t.getAttribute("stroke-width")||"0"),h=l>1&&this._radialArcToFilledSegment(o,l,e,a)||o;s.push({realIndex:n,j:0,d:h,fill:t.getAttribute("stroke")})})}else{i.querySelectorAll(".apexcharts-pie-series .apexcharts-pie-area").forEach((t,e)=>{const i=t.getAttribute("d");i&&s.push({realIndex:e,j:0,d:i,fill:t.getAttribute("fill")})})}return{marks:s,branches:a,unitDots:r}}_radialArcToFilledSegment(t,e,i,s){const a=t.match(/M\s*(-?[\d.]+)\s+(-?[\d.]+)\s+A\s*(-?[\d.]+)\s+(?:-?[\d.]+)\s+(?:-?[\d.]+)\s+(\d)\s+(\d)\s+(-?[\d.]+)\s+(-?[\d.]+)/);if(!a)return null;const r=parseFloat(a[1]),n=parseFloat(a[2]),o=parseFloat(a[3]),l=parseInt(a[4],10),h=parseInt(a[5],10),c=parseFloat(a[6]),d=parseFloat(a[7]);if(!isFinite(o)||o<=0)return null;const u=e/2,p=o+u,g=Math.max(0,o-u),f=(t,e,a)=>{const r=t-i,n=e-s,o=Math.sqrt(r*r+n*n);if(0===o)return{x:i,y:s};const l=a/o;return{x:i+r*l,y:s+n*l}},m=f(r,n,p),x=f(c,d,p),b=f(r,n,g),y=f(c,d,g),v=h?0:1;return`M ${m.x} ${m.y} A ${p} ${p} 0 ${l} ${h} ${x.x} ${x.y} L ${y.x} ${y.y} A ${g} ${g} 0 ${l} ${v} ${b.x} ${b.y} Z`}buildRingSegmentPath(t,e,i,s,a,r){const n=s/2,o=i+n,l=Math.max(0,i-n),h=(a-90)*Math.PI/180,c=(r-90)*Math.PI/180,d=t+o*Math.cos(h),u=e+o*Math.sin(h),p=t+o*Math.cos(c),g=e+o*Math.sin(c),f=t+l*Math.cos(h),m=e+l*Math.sin(h),x=t+l*Math.cos(c),b=e+l*Math.sin(c),y=r>a?1:0,v=Math.abs(r-a)>180?1:0;return`M ${d} ${u} A ${o} ${o} 0 ${v} ${y} ${p} ${g} L ${x} ${b} A ${l} ${l} 0 ${v} ${1-y} ${f} ${m} Z`}getFromType(){return this._snapshot?this._snapshot.fromType:null}_buildMapping(t,e,i,s,a){const r=new Map,n=De(i),o=t.slice().sort((t,e)=>t.realIndex-e.realIndex||t.j-e.j);if("partition"===n&&a&&a.length){const t=o.filter(t=>t.key);t.length===o.length&&(t.forEach(t=>{r.set(`key:${t.key}`,{d:t.d,fill:t.fill})}),a.forEach(t=>{r.set(`key:${t.key}`,{d:t.d,fill:t.fill})}))}const l="unit"===De(e);if("radial"===n||"unit"===n||"partition"===n)return o.forEach((t,e)=>{r.set(`${l?t.realIndex:e}:0`,{d:t.d,fill:t.fill})}),r;if("bar"===n||"summary"===n){const t=this._targetKeys(n,s);o.forEach((e,i)=>{const s=t[l?e.realIndex:i];s&&r.set(s,{d:e.d,fill:e.fill})})}return r}_targetKeys(t,e){var i;const s=[],a=Array.isArray(e)?e:[];if("radial"===t){const t=1===a.length&&Array.isArray(null==(i=a[0])?void 0:i.data)?a[0].data.length:a.length;for(let e=0;e<t;e++)s.push(`${e}:0`)}else a.forEach((t,e)=>{const i=t&&Array.isArray(t.data)?t.data:[];for(let t=0;t<i.length;t++)s.push(`${e}:${t}`)});return s}isActive(){return null!==this._snapshot}getInitialPathFor(t,e){if(!this._snapshot)return null;const i=this._snapshot.mapping.get(`${t}:${e}`);if(!i)return null;const{k:s,dx:a,dy:r}=this._oldToNew();return 1===s&&0===a&&0===r?i.d:this._translatePathD(i.d,a,r,s)}_oldToNew(){var t,e,i;const s=this._snapshot.oldLayout;return{k:null!=(t=s.scale)?t:1,dx:s.translateX+(null!=(e=s.shiftX)?e:0)-(this.w.layout.translateX||0),dy:s.translateY+(null!=(i=s.shiftY)?i:0)-(this.w.layout.translateY||0)}}_translatePathD(t,e,i,s=1){if(0===e&&0===i&&1===s)return t;const a=yt(t),r=t=>t*s+e,n=t=>t*s+i;return a.map(t=>{const e=t[0];return"Z"===e?"Z":"M"===e||"L"===e||"T"===e?`${e} ${r(t[1])} ${n(t[2])}`:"H"===e?`${e} ${r(t[1])}`:"V"===e?`${e} ${n(t[1])}`:"C"===e?`${e} ${r(t[1])} ${n(t[2])} ${r(t[3])} ${n(t[4])} ${r(t[5])} ${n(t[6])}`:"S"===e||"Q"===e?`${e} ${r(t[1])} ${n(t[2])} ${r(t[3])} ${n(t[4])}`:"A"===e?`${e} ${t[1]*s} ${t[2]*s} ${t[3]} ${t[4]} ${t[5]} ${r(t[6])} ${n(t[7])}`:t.join(" ")}).join(" ")}getInitialCenterFor(t){const e=this.getInitialBBoxFor(t);return e?{x:e.x+e.width/2,y:e.y+e.height/2}:null}getInitialPathAt(t){return this.getInitialPathFor(t,0)}getInitialPathForKey(t){return this._snapshot&&t?this.getInitialPathFor("key",t):null}hasKeyedMarks(){if(!this._snapshot)return!1;for(const t of this._snapshot.mapping.keys())if("string"==typeof t&&t.startsWith("key:"))return!0;return!1}getInitialSlotFor(t,e,i){const s=this.getInitialBBoxFor(t);if(!s)return null;const a=s.x+s.width/2,r=s.y+s.height/2;if(!(i>1&&e>=0))return{x:a,y:r};const n=(Math.min(e,i-1)+.5)/i;return s.height>=s.width?{x:a,y:s.y+s.height*(1-n)}:{x:s.x+s.width*n,y:r}}getInitialBBoxFor(t){if(!this._snapshot)return null;const e=this._snapshot.mapping.get(`${t}:0`);if(!e)return null;const i=e.box||(e.box=this._pathBBox(e.d));if(!i)return null;const{k:s,dx:a,dy:r}=this._oldToNew();return{x:i.minX*s+a,y:i.minY*s+r,width:(i.maxX-i.minX)*s,height:(i.maxY-i.minY)*s}}_pathBBox(t){let e=1/0,i=1/0,s=-1/0,a=-1/0,r=0,n=0,o=0,l=0;const h=(t,r)=>{isFinite(t)&&isFinite(r)&&(t<e&&(e=t),t>s&&(s=t),r<i&&(i=r),r>a&&(a=r))};return yt(t).forEach(t=>{const e=t[0];if("Z"===e)return r=o,void(n=l);const i=t.length,s="H"===e?t[1]:"V"===e?r:t[i-2],a="H"===e?n:"V"===e?t[1]:t[i-1];if("A"===e){if(t[1]){const e=(r-s)/2,i=(n-a)/2,o=(t[4]===t[5]?-1:1)*Math.sqrt(Math.max(0,t[1]*t[1]/(e*e+i*i)-1)),l=r-e+o*i,c=n-i-o*e,d=Math.hypot(r-l,n-c),u=Math.atan2(n-c,r-l),p=2*Math.PI;let g=Math.atan2(a-c,s-l)-u;t[5]&&g<0?g+=p:!t[5]&&g>0&&(g-=p);for(let t=0;t<p;t+=Math.PI/2){((g>0?t-u:u-t)%p+p)%p<=Math.abs(g)&&h(l+d*Math.cos(t),c+d*Math.sin(t))}}}else if("H"!==e&&"V"!==e)for(let e=1;e+1<i;e+=2)h(t[e],t[e+1]);h(s,a),r=s,n=a,"M"===e&&(o=s,l=a)}),e>s?null:{minX:e,minY:i,maxX:s,maxY:a}}getSpeed(){const t=this.w.config.chart.animations;return t.chartTypeMorph&&t.chartTypeMorph.speed||t.speed||600}applyChromeFade(){var t;if(!this._snapshot||!Nt.isBrowser())return;this._shown=!0;const e=null==(t=this.w.globals.dom)?void 0:t.baseEl;if(!e||this._snapshot.resume)return;this._snapshot.pieceOut?this._separatePieces():this._snapshot.pieceIn?this._combinePieces():this._mountGhost();const i=this.getSpeed(),s=Array.from(e.querySelectorAll(".apexcharts-xaxis,.apexcharts-yaxis,.apexcharts-grid,.apexcharts-legend,.apexcharts-title-text,.apexcharts-subtitle-text")).filter(t=>t.style),a=(t,e)=>s.forEach(i=>{i.style.opacity=t,null!=e&&(i.style.transition=e)});a("0",`opacity ${i}ms ease-out`);const r=()=>this.w.globals.isDestroyed;ft.requestAnimationFrame(()=>r()||a("1")),setTimeout(()=>r()||a("",""),i+80);const n=this._snapshot;setTimeout(()=>{r()||this._snapshot&&this._snapshot!==n||this.cleanup()},i+100)}retire(){const t=this._snapshot;if(!t||!this._shown)return;const e=this._pieceLayer;this.ctx._unitPieces=t.pieceOut&&e;const i=new Map;null==e||e.querySelectorAll("g").forEach(t=>{const e=t.firstChild&&t.getBBox();e&&i.set(t.firstChild.getAttribute("data-key"),{d:`M${e.x} ${e.y}H${e.x+e.width}V${e.y+e.height}H${e.x}Z`})}),this.cleanup(!0),i.size&&(this._collectTargetMarks(t.toType).forEach((t,e)=>{i.has(e)||i.set(e,{d:this._markD(t)})}),this.w.globals.previousPaths=[],this._snapshot=Object.assign(t,{mapping:i,pieceIn:!1,resume:!0,oldLayout:o({},this.w.layout)}),ft.requestAnimationFrame(()=>{this._snapshot===t&&(this._shown=!0)}))}cleanup(t){this._snapshot=null,this._shown=!1,t||this._removeGhost(),this._cancelPieces()}}});const Te="__apexcharts_plugins__";function Re(t){return function(){const t=globalThis;return t[Te]||(t[Te]={}),t[Te]}()[t]||null}const ze=Object.freeze({"stroke.dashArray":Object.freeze({type:"number"}),"dataLabels.enabledOnSeries":Object.freeze({type:"boolean"})});function Xe(t,e){const i=function(t){return t.weaveClaims||(t.weaveClaims={byOption:new Map}),t.weaveClaims}(t);return i.byOption.has(e)||i.byOption.set(e,[]),i.byOption.get(e)}function Oe(t,e){const i=ze[t],s=[];for(const a of Array.isArray(e)?e:[])!a||"string"!=typeof a.series&&"number"!=typeof a.series?console.warn(`[apexcharts] claim on "${t}": each entry needs a series name or index.`):typeof a.value===i.type?s.push({series:a.series,value:a.value}):console.warn(`[apexcharts] claim on "${t}": expected a ${i.type} for series ${String(a.series)}, got ${typeof a.value}.`);return s}function $e(t,e){if("number"==typeof e)return e;const i=t.config&&t.config.series||[];for(let t=0;t<i.length;t++)if(i[t]&&i[t].name===e)return t;return-1}function We(t,e,i,s){if(!t||!t.weaveClaims)return s;const a=t.weaveClaims.byOption.get(e);if(!a||!a.length)return s;let r=s;for(const e of a)for(const s of e.entries)$e(t,s.series)===i&&(r=s.value);return r}const Ye=["xaxis","yaxis","points","texts","images"];function He(t,e){const i=t.globals;return(i.collapsedSeriesIndices||[]).indexOf(e)<0&&(i.ancillaryCollapsedSeriesIndices||[]).indexOf(e)<0}function Be(t,e){const i=e&&e._derived,s=t=>{if(!i)return"core";for(const[e,s]of i)if(s.indexOf(t)>-1)return e;return"core"};return(t.config.series||[]).map((e,i)=>{const a=e&&e.name?String(e.name):`Series ${i+1}`;return{id:`series:${i}`,kind:"series",label:a,owner:s(a),visible:He(t,i)}})}function Ne(t){const e=t.config.annotations||{},i=[];for(const t of Ye){(Array.isArray(e[t])?e[t]:[]).forEach((e,s)=>{e&&i.push({id:e.id?String(e.id):`annotation:${t}:${s}`,kind:"annotation",label:je(e,t,s),owner:e.owner?String(e.owner):"core",visible:!0})})}return i}function je(t,e,i){const s=t.label&&t.label.text;return s?String(s):t.text?String(t.text):t.id?String(t.id):`${e} annotation ${i+1}`}const Ve=Object.freeze(["layer","derived","reserve","pointer","stroke-info","claim","drawn","observations","scale-orientation","highlight"]),Ge=["updateOptions","updateSeries","appendData","appendSeries","toggleSeries","showSeries","hideSeries","highlightSeries","isSeriesHidden","zoomX","addXaxisAnnotation","addYaxisAnnotation","addPointAnnotation","clearAnnotations","removeAnnotation","dataURI","exportToCSV"];function qe(t){const e={};return Ge.forEach(i=>{"function"==typeof t[i]&&(e[i]=t[i].bind(t))}),Object.freeze(e)}function Ze(t,e){const i=t.ctx,s=t.w,a={name:e.def.name,version:7,get options(){return e.options},on(t,i){const s=e.handlers;return s.has(t)||s.set(t,[]),s.get(t).push(i),a},off(t,i){const s=e.handlers.get(t);if(s){const t=s.indexOf(i);t>-1&&s.splice(t,1)}return a},store:{},layer:i=>t._layer(e.def.name,i||{}),get scales(){return t._currentScales},get data(){return t._lastData||(t._lastData=t._dataSnapshot())},theme:Object.freeze({get mode(){return s.config.theme.mode},get foreColor(){return s.config.chart.foreColor},seriesColor:t=>s.globals.colors[t],token:e=>t._token(e)}),chart:qe(i),get info(){return Object.freeze({type:String(s.config.chart&&(s.config.chart.requestedType||s.config.chart.type)||"line"),axisChart:!0===s.globals.axisCharts,datetimeX:!(!s.config.xaxis||"datetime"!==s.config.xaxis.type),horizontalBars:!!(s.config.plotOptions&&s.config.plotOptions.bar&&s.config.plotOptions.bar.horizontal),dataLabels:Object.freeze({enabled:!(!s.config.dataLabels||!s.config.dataLabels.enabled),enabledOnSeries:Array.isArray(s.config.dataLabels&&s.config.dataLabels.enabledOnSeries)?s.config.dataLabels.enabledOnSeries.slice():null}),stroke:Object.freeze({dashArray:Array.isArray(s.config.stroke&&s.config.stroke.dashArray)?s.config.stroke.dashArray.slice():s.config.stroke&&s.config.stroke.dashArray||0}),title:String(s.config.title&&s.config.title.text||"")})},get categories(){return t._categories()},markDerived:i=>(t._markDerived(e.def.name,i),a),reserve:i=>(t._reserve(e.def.name,i),a),claim(t,i){const a=function(t,e,i,s){if(!Object.prototype.hasOwnProperty.call(ze,i))return console.warn(`[apexcharts] "${i}" is not a claimable option. Claimable: ${Object.keys(ze).join(", ")}.`),null;const a={owner:e,option:i,entries:Oe(i,s)};return Xe(t,i).push(a),a}(s,e.def.name,t,i);return a?Object.freeze({release(){!function(t,e){if(!t.weaveClaims||!e)return;const i=t.weaveClaims.byOption.get(e.option);if(!i)return;const s=i.indexOf(e);s>-1&&i.splice(s,1)}(s,a)},update(e){a.entries=Oe(t,e)}}):null},highlight:i=>t._highlight(e.def.name,i),drawn:()=>Object.freeze(function(t,e){const i=[];if(e&&e._declared)for(const[t,s]of e._declared)for(const e of s)i.push({id:`overlay:${t}:${e.id}`,kind:"overlay",label:e.label,owner:t,visible:!1!==e.visible});return[...Be(t,e),...Ne(t),...i]}(s,t).map(t=>Object.freeze(t))),declare:i=>(t._declare(e.def.name,i),a),pointer:i=>t._onPointer(e.def.name,i),emit(t,s){i.events.fireEvent(`plugin:${e.def.name}:${t}`,[i,s])},get el(){return s.dom.baseEl}},r=Ue,n=Ve.filter(t=>r[t](a)),o=new Set(n),l=a;return l.capabilities=Object.freeze(n),l.can=t=>o.has(t),Object.freeze(a)}const Ue={layer:t=>"function"==typeof t.layer,derived:t=>"function"==typeof t.markDerived,reserve:t=>"function"==typeof t.reserve,pointer:t=>"function"==typeof t.pointer,"stroke-info":t=>!(!t.info||!t.info.stroke),claim:t=>"function"==typeof t.claim,drawn:t=>"function"==typeof t.drawn&&"function"==typeof t.declare,observations:()=>!0,"scale-orientation":()=>!0,highlight:t=>"function"==typeof t.highlight};function Ke(t){const e=[];for(const i of Array.isArray(t)?t:[])!i||"string"!=typeof i.series&&"number"!=typeof i.series?console.warn("[apexcharts] highlight: each entry needs a series name or index."):Array.isArray(i.values)?e.push({series:i.series,values:i.values.map(t=>"number"==typeof t&&Number.isFinite(t)?t:null)}):console.warn(`[apexcharts] highlight: expected an array of values for series ${String(i.series)}, got ${typeof i.values}.`);return e}const Je=class t{constructor(t,e){this.w=t,this.ctx=e,this.active=[],this._layers=new Map,this._currentScales=null,this._lastPluginsRef=null,this._lastData=null,this._updatedWired=!1,this._derived=null,this._reserved=null,this._reserveTimer=null,this._highlightTimer=null,this._pointerSubs=null,this._declared=null,this._pointerWired=null,this._onUpdated=this._onUpdated.bind(this),this._init()}_init(){(this.w.config.plugins||[]).map((t,e)=>({entry:t,order:null!=t.order?t.order:e})).sort((t,e)=>t.order-e.order).forEach(t=>this._activate(t.entry)),this._lastPluginsRef=this.w.config.plugins,this._wireUpdated()}_wireUpdated(){this._updatedWired||(this.ctx.addEventListener("updated",this._onUpdated),this._updatedWired=!0)}_onUpdated(){this._repairInitialSeries(),this.dispatch("afterUpdate",{pass:"update"})}_activate(t){const e=Re(t.name);if(!e)return void console.error(`[apexcharts] plugin "${t.name}" is not registered.`);const i=null!=e.apiVersion?Math.trunc(e.apiVersion):1;if(!(i>=1)||i>7)return void console.error(`[apexcharts] plugin "${e.name}" targets Weave API v${e.apiVersion}, host is v7; skipped.`);const s={def:e,options:Object.freeze(o({},t.options||{})),handlers:new Map,disabled:!1,failures:0,api:null};s.api=Ze(this,s),this.active.push(s),this._guard(s,"setup",()=>e.setup(s.api))}dispatch(t,e){if("draw"===t&&(this._reconcile(),this._resetLayers()),this._lastData=null,!this.active.length)return;"afterParse"===t?this._currentScales=null:e&&"xyRatios"in e&&this._setScales(e.xyRatios);const i=e&&e.pass||"full",s=this;let a=null;for(const e of this.active){if(e.disabled)continue;const r=e.handlers.get(t);if(!r||!r.length)continue;const n={api:e.api,scales:this._currentScales,get data(){return a||(a=s._lastData||(s._lastData=s._dataSnapshot()))},set data(t){Object.defineProperty(this,"data",{value:t,writable:!0})},pass:i,hook:t};for(const i of r.slice())this._guard(e,t,()=>i(n))}}_guard(t,e,i){if(!t.disabled)try{i()}catch(i){console.error(`[apexcharts] plugin "${t.def.name}" threw in "${e}":`,i),t.failures=(t.failures||0)+1,t.failures>=3&&(t.disabled=!0,this._forget(t.def.name),console.error(`[apexcharts] plugin "${t.def.name}" disabled after repeated errors.`))}}_setScales(t){const e=this.w,i=e.globals,s=e.layout;if(!t||!i.axisCharts)return void(this._currentScales=null);const a=t.xRatio,r=t.yRatio||[],n=t=>null!=r[t]?r[t]:r[0],o=t=>null!=i.maxYArr[t]?i.maxYArr[t]:i.maxY,l=t=>null!=i.minYArr[t]?i.minYArr[t]:i.minY,h=!!i.isBarHorizontal,c=!!e.axisFlags.isRangeBar,d=i.dataPoints>0&&(!e.axisFlags.isXNumeric||h),u=h&&c?e.labelData.labels.length:i.dataPoints,p=h?s.gridHeight:s.gridWidth,g=d&&u>0?p/u:0,f=new Map;if(d){(c?e.labelData.labels:e.axisFlags.isXNumeric&&e.seriesData.seriesX[i.maxValsInArrayIndex]||[]).forEach((t,e)=>{f.has(t)||f.set(t,e)})}const m=d?t=>g*((f.has(t)?f.get(t):t)+.5):t=>(t-i.minX)/a,x=t=>{const s=i.seriesYAxisReverseMap&&i.seriesYAxisReverseMap[t];return e.config.yaxis[null!=s?s:t]||e.config.yaxis[0]},b=t=>{const e=x(t);return!(!e||!e.reversed)};let y=null;const v=h?(t,e=0)=>{const i=Math.abs(o(e)-l(e)),a=i?(t-l(e))/i*s.gridWidth:0;return b(e)?s.gridWidth-a:a}:(t,a=0)=>{const r=((t,s)=>{const a=x(s);return a&&a.logarithmic&&!i.invalidLogScale?(y||(y=new P(e)),y.getLogVal(a.logBase,t,s)):null})(t,a);return null!==r?b(a)?r*s.gridHeight:(1-r)*s.gridHeight:b(a)?(t-l(a))/n(a):(o(a)-t)/n(a)};this._currentScales={x:m,y:v,domainX:d?[-.5,u-.5]:[i.minX,i.maxX],domainY:(t=0)=>[l(t),o(t)],transposed:h,point:(t,e,i=0)=>h?{x:v(e,i),y:m(t)}:{x:m(t),y:v(e,i)},gridWidth:s.gridWidth,gridHeight:s.gridHeight,ratios:t}}_dataSnapshot(){const t=this.w,e=t.globals,i=t.seriesData.series||[],s=t.seriesData.seriesX||[],a=Array.isArray(t.config.series)?t.config.series:[];return i.map((i,r)=>{const n=Array.isArray(i)?i:[i],o=s[r]||[],l=n.map((t,e)=>({x:null!=o[e]?o[e]:e,y:t})),h=a[r],c=h&&"object"==typeof h&&Array.isArray(h.data)?h.data:[],d=t.seriesObservations?t.seriesObservations[r]:null,u=d?{values:d.values.slice(),byPoint:d.byPoint.map(t=>t?t.slice():null)}:null;return{name:e.seriesNames?e.seriesNames[r]:void 0,hidden:(e.collapsedSeriesIndices||[]).includes(r),color:e.colors?e.colors[r]:void 0,points:l,raw:c,observations:u}})}_categories(){const t=this.w,e=t.globals,i=t.config.xaxis&&Array.isArray(t.config.xaxis.categories)?t.config.xaxis.categories:[],s=Array.isArray(e.categoryLabels)?e.categoryLabels:[],a=Array.isArray(e.labels)?e.labels:[],r=i.length?i:s.length?s:a,n=t.seriesData.series||[];let o=0;for(let t=0;t<n.length;t++){const e=n[t];Array.isArray(e)&&e.length>o&&(o=e.length)}o||(o=r.length);const l=[];for(let t=0;t<o;t++){const e=r[t];l.push(String(null==e?t+1:e))}return l}_markDerived(t,e){this._derived||(this._derived=new Map);const i=Array.isArray(e)?e.map(t=>String(t)):[];i.length?this._derived.set(t,i):this._derived.delete(t),this._repairInitialSeries()}_onPointer(t,e){if("function"!=typeof e)return()=>{};this._pointerSubs||(this._pointerSubs=new Map);const i=this._pointerSubs.get(t)||[];return i.push(e),this._pointerSubs.set(t,i),this._wirePointer(),()=>{const i=this._pointerSubs&&this._pointerSubs.get(t);if(!i)return;const s=i.indexOf(e);s>-1&&i.splice(s,1)}}_wirePointer(){if(this._pointerWired)return;if(!this.ctx||"function"!=typeof this.ctx.addEventListener)return;const t=[["enter","dataPointMouseEnter"],["leave","dataPointMouseLeave"],["select","dataPointSelection"]];this._pointerWired=[];for(const[e,i]of t){const t=(t,i,s)=>{this._emitPointer(e,s,t)};this.ctx.addEventListener(i,t),this._pointerWired.push([i,t])}}_emitPointer(e,i,s){if(!this._pointerSubs||!this._pointerSubs.size)return;const a=i&&"number"==typeof i.seriesIndex?i.seriesIndex:-1,r=i&&"number"==typeof i.dataPointIndex?i.dataPointIndex:-1,n=this._categories()||[],o=this.w,l=o&&o.config&&o.config.series||[],h={type:e,seriesIndex:a,dataPointIndex:r,category:r>-1?n[r]:void 0,seriesName:t._seriesName(l,a),selected:"select"===e?t._isSelected(i,a,r):void 0,modifiers:t._modifiers(s)};for(const[t,e]of this._pointerSubs){const i=this.active.find(e=>e.def.name===t);if(i)for(const t of e.slice())this._guard(i,"pointer",()=>t(h))}}static _seriesName(t,e){if(e<0)return;const i=t[e];return i&&"object"==typeof i&&"string"==typeof i.name?i.name:void 0}static _isSelected(t,e,i){const s=t&&t.selectedDataPoints;if(!Array.isArray(s)||e<0)return;const a=s[e];return!!Array.isArray(a)&&a.indexOf(i)>-1}static _modifiers(t){return Object.freeze({shift:!(!t||!t.shiftKey),ctrl:!(!t||!t.ctrlKey),alt:!(!t||!t.altKey),meta:!(!t||!t.metaKey)})}_reserve(e,i){const s=t._normaliseBox(i),a=this._reserved?this._reserved.get(e):void 0;if(s){if(a&&a.left===s.left&&a.right===s.right&&a.top===s.top&&a.bottom===s.bottom)return;this._reserved||(this._reserved=new Map),this._reserved.set(e,s)}else{if(!a||!this._reserved)return;this._reserved.delete(e)}this._resizeForReservation()}static _normaliseBox(t){if(!t||"object"!=typeof t)return null;const e=t=>Number.isFinite(t)&&t>0?Math.round(t):0,i={left:e(t.left),right:e(t.right),top:e(t.top),bottom:e(t.bottom)};return i.left||i.right||i.top||i.bottom?i:null}reservedBox(){if(!this._reserved||0===this._reserved.size)return t.NO_RESERVATION;const e={left:0,right:0,top:0,bottom:0};for(const t of this._reserved.values())e.left+=t.left,e.right+=t.right,e.top+=t.top,e.bottom+=t.bottom;return e}_resizeForReservation(){null==this._reserveTimer&&(this._reserveTimer=setTimeout(()=>{this._reserveTimer=null;const t=this.w.globals;t.isDestroyed||(t.resized=!0,t.dataChanged=!1,this._update("a plugin reservation"))},0))}_update(t){try{Promise.resolve(this.ctx.update()).catch(e=>console.error(`[apexcharts] re-render for ${t} failed:`,e))}catch(t){}}_highlight(t,e){const i=this.w,s=this.ctx.highlightFilter;if(!s)return null;if(!i.globals.axisCharts)return null;if(!s.canDrawParts())return null;if(s.callerCarriesParts())return null;const a=function(t,e,i){const s=Ke(i);if(!s.length)return null;const a={owner:e,entries:s};return function(t){return t.weaveHighlights||(t.weaveHighlights={records:[]}),t.weaveHighlights}(t).records.push(a),a}(i,t,e);return a?(this._redrawForHighlight(),Object.freeze({release:()=>{!function(t,e){if(!t||!t.weaveHighlights||!e)return;const i=t.weaveHighlights.records,s=i.indexOf(e);s>-1&&i.splice(s,1)}(i,a),this._redrawForHighlight()},update:t=>{a.entries=Ke(t),this._redrawForHighlight()}})):null}_redrawForHighlight(){null==this._highlightTimer&&(this._highlightTimer=setTimeout(()=>{this._highlightTimer=null;const t=this.w.globals;t.isDestroyed||(t.dataChanged=!0,this._update("plugin highlight parts"))},0))}_derivedNames(){const t=new Set;if(!this._derived)return t;for(const e of this._derived.values())for(const i of e)t.add(i);return t}_repairInitialSeries(){const t=this._derivedNames();if(!t.size)return;const e=this.w.globals,i=e=>!t.has(String(e&&e.name)),s=t=>{if(!Array.isArray(t))return null;const e=t.filter(i);return e.length&&e.length!==t.length?e:null};try{const t=s(e._initialSeriesPeek);t&&(e.initialSeries=t);const i=e.initialConfig,a=i&&s(i.series);a&&(i.series=a)}catch(t){}}_token(t){const e=this.w,i=e.globals;switch(t){case"foreColor":return e.config.chart.foreColor;case"background":return e.config.chart.background;case"accent":case"primary":return i.colors?i.colors[0]:void 0;default:return/^series-\d+$/.test(t)&&i.colors?i.colors[Number(t.split("-")[1])]:void 0}}_layer(t,{z:e="front",className:i=""}={}){let s=this._layers.get(t);if(!s){s=this.ctx.graphics.group({class:`apexcharts-plugin-${t} ${i}`.trim()});const a=this.w.dom.elGraphical.node;"behind"===e?a.insertBefore(s.node,a.firstChild):a.appendChild(s.node),s.node.setAttribute("aria-hidden","true"),this._layers.set(t,s)}return function(t,e,i){const s=e=>(e&&t.add(e),e),a={get node(){return t.node},path(t={}){const{d:i="",stroke:a="#000",width:r=1,fill:n="none",opacity:o=1,dash:l=0,className:h=""}=t;return s(e.drawPath({d:i,stroke:a,strokeWidth:r,fill:n,fillOpacity:"none"===n?0:o,strokeOpacity:o,strokeDashArray:l,classes:h}))},line(t={}){const{x1:i,y1:a,x2:r,y2:n,stroke:o="#000",width:l=1,dash:h=0}=t;return s(e.drawLine(i,a,r,n,o,h,l))},rect(t={}){const{x:i=0,y:a=0,w:r=0,h:n=0,r:o=0,fill:l="#000",stroke:h=null,opacity:c=1}=t;return s(e.drawRect(i,a,r,n,o,l,c,null!=h?1:null,h))},circle(t={}){const{cx:i=0,cy:a=0,r:r=0,fill:n="#000",stroke:o=null}=t;return s(e.drawCircle(r,{cx:i,cy:a,fill:n,stroke:o||"none"}))},text(t={}){const{x:i=0,y:a=0,text:r="",color:n,size:o,anchor:l="start",weight:h}=t;return s(e.drawText({x:i,y:a,text:r,textAnchor:l,fontSize:o,foreColor:n,fontWeight:h}))},clear(){const e=t.node;for(;e.firstChild;)e.removeChild(e.firstChild);return i&&i(),a}};return a}(s,this.ctx.graphics,()=>this._undeclare(t))}_undeclare(t){this._declared&&this._declared.delete(t)}_resetLayers(){this._layers.forEach(t=>t.node.remove()),this._layers.clear(),this._declared=null}_declare(t,e){if(!e||"string"!=typeof e.id||!e.id)return void console.warn(`[apexcharts] plugin "${t}" declared something with no id; ignored.`);this._declared||(this._declared=new Map);const i=this._declared.get(t)||[],s={id:e.id,label:e.label?String(e.label):e.id,visible:!1!==e.visible},a=i.findIndex(t=>t.id===s.id);a>-1?i[a]=s:i.push(s),this._declared.set(t,i)}_reconcile(){const t=this.w.config.plugins||[];if(t===this._lastPluginsRef)return;this._lastPluginsRef=t;const e=new Map(t.map((t,e)=>[t.name,{entry:t,order:null!=t.order?t.order:e}]));for(let t=this.active.length-1;t>=0;t--){const i=this.active[t],s=e.get(i.def.name);s?i.options=Object.freeze(o({},s.entry.options||{})):(this._guard(i,"destroy",()=>i.def.destroy&&i.def.destroy(i.api)),this.active.splice(t,1),this._forget(i.def.name))}const i=new Set(this.active.map(t=>t.def.name)),s=[];e.forEach((t,e)=>{i.has(e)||s.push(t)}),s.sort((t,e)=>t.order-e.order).forEach(t=>this._activate(t.entry))}_forget(t){const e=this.w,i=function(t,e){if(!t.weaveClaims)return!1;let i=!1;for(const[s,a]of t.weaveClaims.byOption){const r=a.filter(t=>t.owner!==e);r.length!==a.length&&(t.weaveClaims.byOption.set(s,r),i=!0)}return i}(e,t),s=function(t,e){if(!t||!t.weaveHighlights)return!1;const i=t.weaveHighlights.records,s=i.filter(t=>t.owner!==e);return s.length!==i.length&&(t.weaveHighlights.records=s,!0)}(e,t);this._pointerSubs&&this._pointerSubs.delete(t),this._derived&&this._derived.delete(t),this._declared&&this._declared.delete(t);const a=!(!this._reserved||!this._reserved.has(t));this._reserve(t,null),!i&&!s||a||this._redrawForHighlight()}teardown(t){if(!t){this.dispatch("destroy");for(const t of this.active)this._guard(t,"destroy",()=>t.def.destroy&&t.def.destroy(t.api));for(const t of this.active)this._forget(t.def.name);if(this.active=[],this._derived=null,this._reserved=null,this._pointerSubs=null,this._declared=null,this._pointerWired){for(const[t,e]of this._pointerWired)this.ctx.removeEventListener&&this.ctx.removeEventListener(t,e);this._pointerWired=null}null!=this._reserveTimer&&(clearTimeout(this._reserveTimer),this._reserveTimer=null),null!=this._highlightTimer&&(clearTimeout(this._highlightTimer),this._highlightTimer=null),this._updatedWired&&(this.ctx.removeEventListener&&this.ctx.removeEventListener("updated",this._onUpdated),this._updatedWired=!1)}this._layers.clear()}};var Qe,ti,ei;Qe=Je,ti="NO_RESERVATION",ei=Object.freeze({left:0,right:0,top:0,bottom:0}),n(Qe,"symbol"!=typeof ti?ti+"":ti,ei);let ii=Je;function si(t,e){const i=t&&t.renderer;return i&&i.kind&&"svg"!==i.kind?i:e}c.default.registerFeatures({weave:ii}),c.default._customSeriesFactory=function(t,e){const i=class{constructor(t,e,i){this.w=t,this.ctx=e,this.xyRatios=i,this._warned=!1}draw(i,s,a){var r,n;const o=this.w,l=new R(o,this.ctx),h=si(this.ctx,l),c=l.group({class:"apexcharts-marks-series"});return i.forEach((i,s)=>{var r;const n=Array.isArray(a)?a[s]:s,d=l.group({class:"apexcharts-series",rel:n+1,seriesName:Zt.escapeString(o.seriesData.seriesNames[n]),"data:realIndex":n}),u=this._scales(n,(o.seriesData.series[n]||[]).length),p=o.globals.colors[n],g=(null==(r=o.config.series[n])?void 0:r.data)||[],f=o.seriesData.seriesX[n]||[],m=o.seriesData.series[n]||[];o.globals.seriesXvalues[n]=[],o.globals.seriesYvalues[n]=[],void 0===o.globals.pointsArray[n]&&(o.globals.pointsArray[n]=[]);for(let i=0;i<m.length;i++){const s=m[i];if(null==s)continue;const a=f[i],r=u.xAt(i,a),l=u.y(s),c=this._api(h,d,n,i);try{e.renderItem({datum:g[i],x:r,y:l,scales:u,api:c,seriesIndex:n,dataPointIndex:i,color:p})}catch(e){this._warned||(console.warn(`[apexcharts] renderItem for series type "${t}" threw; skipping datum:`,e),this._warned=!0)}o.globals.seriesXvalues[n][i]=r,o.globals.seriesYvalues[n][i]=l,o.globals.pointsArray[n][i]=[r,l]}l.setupEventDelegation(d,".apexcharts-marks-mark"),c.add(d)}),null==(n=null==(r=this.ctx.animations)?void 0:r.animationCompleted)||n.call(r,c),c}_scales(t,e){var i,s,a,r;const n=this.w.globals,o=this.w.config,l=this.xyRatios.xRatio,h=this.xyRatios.yRatio,c=null!=(s=null==(i=n.seriesYAxisReverseMap)?void 0:i[t])?s:0,d=Array.isArray(h)?null!=(a=h[c])?a:h[0]:h,u=n.maxYArr,p=Array.isArray(u)&&u.length&&null!=(r=u[c])?r:n.maxY,g=n.gridWidth,f=n.gridHeight,m=!n.isXNumeric,x=e||n.dataPoints||1,b=x>0?g/x:g,y="on"===o.xaxis.tickPlacement,v=t=>l?(t-n.minX)/l:g/2,w=n.minXDiff||1;return{x:v,xAt:(t,e)=>m?y&&x>1?t/(x-1)*g:(t+.5)*b:v(e),y:t=>(p-t)/d,gridWidth:g,gridHeight:f,band:m?b:l?w/l:g}}_api(t,e,i,s){const a=t=>{if(t){try{t.node.setAttribute("index",String(i)),t.node.setAttribute("j",String(s)),t.node.classList.add("apexcharts-marks-mark")}catch(t){}e.add(t)}return t};return{path:(e={})=>{var i,s,r,n,o,l,h,c,d;return a(t.drawPath({d:e.d||"",stroke:null!=(i=e.stroke)?i:"#000",strokeWidth:null!=(r=null!=(s=e.width)?s:e.strokeWidth)?r:1,fill:null!=(n=e.fill)?n:"none",fillOpacity:null!=(l=e.fillOpacity)?l:e.fill&&"none"!==e.fill?null!=(o=e.opacity)?o:1:0,strokeOpacity:null!=(c=null!=(h=e.strokeOpacity)?h:e.opacity)?c:1,strokeDashArray:null!=(d=e.dash)?d:0,strokeLinecap:e.lineCap}))},line:(e={})=>{var i,s,r,n;return a(t.drawLine(e.x1,e.y1,e.x2,e.y2,null!=(i=e.stroke)?i:"#000",null!=(s=e.dash)?s:0,null!=(n=null!=(r=e.width)?r:e.strokeWidth)?n:1))},rect:(e={})=>{var i,s,r,n,o,l,h,c;return a(t.drawRect(null!=(i=e.x)?i:0,null!=(s=e.y)?s:0,null!=(r=e.w)?r:0,null!=(n=e.h)?n:0,null!=(o=e.r)?o:0,null!=(l=e.fill)?l:"#000",null!=(h=e.opacity)?h:1,null!=e.stroke?null!=(c=e.strokeWidth)?c:1:null,e.stroke))},circle:(e={})=>{var i,s,r,n,o;return a(t.drawCircle(null!=(i=e.r)?i:0,{cx:null!=(s=e.cx)?s:0,cy:null!=(r=e.cy)?r:0,fill:null!=(n=e.fill)?n:"#000",stroke:e.stroke||"none","stroke-width":null!=(o=e.strokeWidth)?o:e.stroke?1:0}))},text:(e={})=>{var i,s,r,n;return a(t.drawText({x:null!=(i=e.x)?i:0,y:null!=(s=e.y)?s:0,text:null!=(r=e.text)?r:"",textAnchor:null!=(n=e.anchor)?n:"start",fontSize:e.size,foreColor:e.color,fontWeight:e.weight}))}}}};return i.dataType=e.dataType||"xy",i.yExtent="function"==typeof e.yExtent?e.yExtent:null,i};class ai{constructor(t,e){if(this.w=t,this.ctx=e,"os"!==t.config.theme.follow||!Nt.isBrowser())return;const i=this._ensureMedia();i&&(this._applyToConfig(i),this._ensureListeners(i))}_ensureMedia(){if(!this.ctx._osThemeMedia){const t=ft.matchMedia("(prefers-color-scheme: dark)"),e=ft.matchMedia("(prefers-contrast: more)");if(!t&&!e)return null;this.ctx._osThemeMedia={dark:t,contrast:e,handler:null}}return this.ctx._osThemeMedia}_applyToConfig(t){const e=this.w.config.theme;t.dark&&(e.mode=t.dark.matches?"dark":"light"),t.contrast&&t.contrast.matches&&(e.accessibility=e.accessibility||{},e.accessibility.colorBlindMode="highContrast")}_ensureListeners(t){if(t.handler)return;const e=this.ctx,i=()=>{const t=e._osThemeMedia;if(!t)return;const i={mode:t.dark&&t.dark.matches?"dark":"light"};t.contrast&&t.contrast.matches?i.accessibility={colorBlindMode:"highContrast"}:i.accessibility={colorBlindMode:""},e.updateOptions({theme:i},!1,!0,!1)};ai._add(t.dark,i),ai._add(t.contrast,i),t.handler=i}teardown(){const t=this.ctx._osThemeMedia;t&&(t.handler&&(ai._remove(t.dark,t.handler),ai._remove(t.contrast,t.handler)),this.ctx._osThemeMedia=null)}static _add(t,e){t&&("function"==typeof t.addEventListener?t.addEventListener("change",e):"function"==typeof t.addListener&&t.addListener(e))}static _remove(t,e){t&&("function"==typeof t.removeEventListener?t.removeEventListener("change",e):"function"==typeof t.removeListener&&t.removeListener(e))}}c.default.registerFeatures({osThemeWatcher:ai});const ri="__apexcharts_series_transforms__";function ni(t,e){t&&"string"==typeof t?"function"==typeof e?globalThis[ri][t]=e:console.warn(`ApexCharts: registerSeriesTransform("${t}") expects a function (series, w) => series.`):console.warn("ApexCharts: registerSeriesTransform requires a non-empty name.")}globalThis[ri]||(globalThis[ri]={});const oi="__apexcharts_row_sources__";function li(t,e){t&&"string"==typeof t?"function"==typeof e?globalThis[oi][t]=e:console.warn(`ApexCharts: registerRowSource("${t}") expects a function (w, opts) => series.`):console.warn("ApexCharts: registerRowSource requires a non-empty name.")}function hi(t){return(t.collapsedSeriesIndices||[]).concat(t.ancillaryCollapsedSeriesIndices||[])}function ci(t,e){const i=(e.collapsedSeries||[]).concat(e.ancillaryCollapsedSeries||[]);return t.map((t,e)=>{const n=t||{},{hidden:h}=n,c=((t,e)=>{var i={};for(var n in t)a.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&s)for(var n of s(t))e.indexOf(n)<0&&r.call(t,n)&&(i[n]=t[n]);return i})(n,["hidden"]);let d=c.data;if(Array.isArray(d)&&!d.length){const t=i.find(t=>t.index===e);t&&Array.isArray(t.data)&&(d=t.data)}return l(o({},c),{data:Array.isArray(d)?d.slice():d})})}globalThis[oi]||(globalThis[oi]={});function di(t,e){const i=t.length;if(0===i)return NaN;if(1===i)return t[0];const s=(i-1)*e,a=Math.floor(s),r=Math.ceil(s);return a===r?t[a]:t[a]+(t[r]-t[a])*(s-a)}function ui(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const i=t.slice().sort((t,e)=>t-e);let s=i[0],a=i[i.length-1];const r=e.range;if(Array.isArray(r)&&2===r.length){const t=Number(r[0]),e=Number(r[1]);Number.isFinite(t)&&Number.isFinite(e)&&e>t&&(s=t,a=e)}if(!(a>s)){const t=Math.abs(s)>0?.05*Math.abs(s):.5;return{edges:[s-t,s+t],binWidth:2*t,rule:"single",capped:!1}}const n=a-s;let o,l;if("number"==typeof e.binWidth&&e.binWidth>0)o=e.binWidth,l="binWidth";else if("number"==typeof e.bins&&e.bins>=1)o=n/Math.floor(e.bins),l="count";else{const t=function(t,e,i){const s=t.length,a=t=>e/Math.max(1,Math.ceil(t)),r=()=>a(Math.log2(s)+1);switch(i){case"sqrt":return{width:a(Math.sqrt(s)),rule:"sqrt"};case"rice":return{width:a(2*Math.cbrt(s)),rule:"rice"};case"scott":{const e=function(t){const e=t.length;if(e<2)return 0;let i=0;for(let s=0;s<e;s++)i+=t[s];const s=i/e;let a=0;for(let i=0;i<e;i++){const e=t[i]-s;a+=e*e}return Math.sqrt(a/e)}(t);return e>0?{width:3.49*e*Math.pow(s,-1/3),rule:"scott"}:{width:r(),rule:"sturges"}}case"fd":{const e=di(t,.75)-di(t,.25);return e>0?{width:2*e*Math.pow(s,-1/3),rule:"fd"}:{width:r(),rule:"sturges"}}case"auto":{const e=r(),i=di(t,.75)-di(t,.25);if(i<=0)return{width:e,rule:"sturges"};const a=2*i*Math.pow(s,-1/3);return a<e?{width:a,rule:"fd"}:{width:e,rule:"sturges"}}default:return{width:r(),rule:"sturges"}}}(i,n,"string"==typeof e.bins?e.bins:"auto");o=t.width,l=t.rule}(!Number.isFinite(o)||o<=0)&&(o=n);let h=Math.ceil(n/o);(!Number.isFinite(h)||h<1)&&(h=1);let c=!1;h>1e3&&(h=1e3,c=!0),o=n/h;const d=new Array(h+1);for(let t=0;t<=h;t++)d[t]=s+t*o;return d[h]=Math.max(d[h],a),{edges:d,binWidth:o,rule:l,capped:c}}function pi(t,e){const i=e.length-1;if(!(t>=e[0])||t>e[i])return-1;if(t===e[i])return i-1;const s=(e[i]-e[0])/i;if(s>0){let a=Math.floor((t-e[0])/s);return a<0&&(a=0),a>i-1&&(a=i-1),t<e[a]?a--:t>=e[a+1]&&a++,a<0||a>i-1?-1:a}let a=0,r=i-1;for(;a<=r;){const i=a+r>>1;if(t<e[i])r=i-1;else{if(!(t>=e[i+1]))return i;a=i+1}}return-1}function gi(t,e){const i=Math.max(0,e.length-1),s=new Array(i);for(let t=0;t<i;t++)s[t]=[];for(let i=0;i<t.length;i++){const a=pi(t[i],e);a>=0&&s[a].push(t[i])}return s}function fi(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const i=t.slice().sort((t,e)=>t-e),s=di(i,.25),a=di(i,.5),r=di(i,.75),n=r-s;let o=i[0],l=i[i.length-1],h=[];if("tukey"===e.whiskers&&n>0){const t=s-1.5*n,e=r+1.5*n;let a=0;for(;a<i.length&&i[a]<t;)a++;let c=i.length-1;for(;c>=0&&i[c]>e;)c--;a<=c&&(o=i[a],l=i[c],h=i.slice(0,a).concat(i.slice(c+1)))}return{summary:[o,s,a,r,l],outliers:h,iqr:n}}function mi(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const i=t.slice().sort((t,e)=>t-e),s=i.length;let a=e.bandwidth;if(!("number"==typeof a&&a>0)){const t=function(t){const e=t.length;if(e<2)return 0;let i=0;for(let s=0;s<e;s++)i+=t[s];const s=i/e;let a=0;for(let i=0;i<e;i++){const e=t[i]-s;a+=e*e}return Math.sqrt(a/e)}(i),e=di(i,.75)-di(i,.25);a=.9*(e>0?Math.min(t,e/1.349):t)*Math.pow(s,-.2)}if(!isFinite(a)||a<=0){const t=i[0],e=Math.abs(t)>0?.001*Math.abs(t):.001;return{density:[[t-e,0],[t,1],[t+e,0]],bandwidth:e}}const r=Math.max(8,Math.floor(e.resolution||64)),n=i[0]-2*a,o=(i[s-1]+2*a-n)/(r-1),l=1/(s*a*Math.sqrt(2*Math.PI)),h=[];for(let t=0;t<r;t++){const e=n+t*o;let r=0;for(let t=0;t<s;t++){const s=(e-i[t])/a;r+=Math.exp(-.5*s*s)}h.push([e,r*l])}return{density:h,bandwidth:a}}function xi(t){const e=[];if(!Array.isArray(t))return e;for(let i=0;i<t.length;i++){const s=t[i];let a=s;Array.isArray(s)?a=1===s.length?s[0]:s[1]:s&&"object"==typeof s&&(a=void 0!==s.y?s.y:s.x);const r=Zt.parseNumber(a);null!==r&&isFinite(r)&&e.push(r)}return e}function bi(t,e,i,s,a,r,n){if(!Array.isArray(t))return t;const h=function(t,e){const i=t.statsDerived||(t.statsDerived={});return i[e]||(i[e]=new Map)}(e,i),c=[],d=t.map((t,e)=>{if(!Array.isArray(null==t?void 0:t.data)||t.type&&t.type!==i)return t;let d=!1;const u=new Array(t.data.length).fill(null),p=t.data.map((t,o)=>{const l=e+":"+o,c=r(t);if(c&&!function(t,e,i){const s=(t.get(e)||{}).e;return!!s&&JSON.stringify(s.density||s.summary)===JSON.stringify(i)}(h,l,c))return t;const p=function(t,e){var i;if(!t||"object"!=typeof t||Array.isArray(t))return null;let s=null;if(Array.isArray(t.points)?s=t.points:Array.isArray(null==(i=t.y)?void 0:i.points)?s=t.y.points:e&&Array.isArray(t.y)&&"number"==typeof t.y[0]&&(s=t.y),!s)return null;const a=[];for(let t=0;t<s.length;t++){const e=Zt.parseNumber(s[t]);null!==e&&isFinite(e)&&a.push(e)}return a.length?a:null}(t,"violin"===i);if(!p)return t;const g=function(t,e,i,s,a){const r=JSON.stringify(s)+i;let n=t.get(e);return n&&n.s===r||t.set(e,n={s:r,e:a(i,s)}),n.e}(h,l,p,s,a);return g?(d=!0,u[o]=p,n(t,g,p)):t});return d&&(c[e]=u),d?l(o({},t),{data:p}):t});return function(t,e,i){if(!e.length)return;const s=[];for(let t=0;t<i;t++){const i=e[t];if(!i){s.push(null);continue}const a=[];for(const t of i)if(t)for(let e=0;e<t.length;e++)a.push(t[e]);s.push({values:a,byPoint:i})}t.seriesObservations=s}(e,c,t.length),d}function yi(t,e,i){const s=i&&null!=i.maxRows?i.maxRows:3e3,a=function(t,e){let i=0,s=0;for(const e of t)i+=e.length,e.length>s&&(s=e.length);if(i<=e)return{clusters:t,stride:1,total:i,kept:i};const a=e=>{let i=0;for(const s of t)i+=Math.ceil(s.length/e);return i};let r=Math.max(2,Math.ceil(i/e));for(;r<s&&a(r)>e;)r++;let n=0;return{clusters:t.map(t=>{const e=[];for(let i=0;i<t.length;i+=r)e.push(t[i]);return n+=e.length,e}),stride:r,total:i,kept:n}}(e.map(t=>t.rows),s);a.stride>1&&console.warn(`ApexCharts: rowSeries() thinned ${a.total} rows to ${a.kept} (every ${a.stride}${2===a.stride?"nd":3===a.stride?"rd":"th"} row) to stay under maxRows=${s}. Raise maxRows to draw more.`);const r=t.globals&&t.globals.colors||[];return e.map((t,e)=>{const i=r[t.realIndex]||r[0];return{name:t.name,data:a.clusters[e].map((s,a)=>o({id:`${t.realIndex}:${e}:${a}`,x:t.name,y:s},i?{fillColor:i}:{}))}})}function vi(t){if(!isFinite(t))return String(t);const e=Math.round(t);return Math.abs(t-e)<1e-6?String(e):String(Number(t.toFixed(2)))}function wi(t){return(e,i)=>{var s;const a=t(e);if(!Array.isArray(a)||!a.length)return null;const r=e.globals?hi(e.globals):[],n=e.globals&&((null==(s=e.globals.categoryLabels)?void 0:s.length)?e.globals.categoryLabels:e.globals.labels)||[],o=[];return a.forEach((t,i)=>{var s;if(-1!==r.indexOf(i))return;if(!Array.isArray(t))return;const l=e.seriesData&&(null==(s=e.seriesData.seriesNames)?void 0:s[i]);t.forEach((t,e)=>{const s=null!=n[e]?String(n[e]):`#${e+1}`;o.push({name:a.length>1&&l?`${l} ${s}`:s,realIndex:i,rows:Array.isArray(t)?t.slice():[]})})}),o.length?yi(e,o,i):null}}const _i=wi(t=>{var e;return null==(e=t.candleData)?void 0:e.seriesBoxPoints}),Ai=wi(t=>{var e;return null==(e=t.violinData)?void 0:e.seriesViolinPoints});ni("histogram",function(t,e){var i;const s=e.config,a=e.globals;if(!Array.isArray(t))return t;a.histogramRawSeries||(a.histogramRawSeries=ci(t,a));const r=a.histogramRawSeries,n=(null==(i=s.plotOptions)?void 0:i.histogram)||{},h=r.map(t=>xi(null==t?void 0:t.data));let c=[];if(1===h.length)c=h[0];else for(const t of h)c=c.concat(t);const d=ui(c,{bins:n.bins,binWidth:n.binWidth,range:n.range});if(!d)return e.histogramData={edges:[],binWidth:0,counts:[],rule:"",capped:!1},r;const{edges:u,binWidth:p}=d,g=h.map(t=>function(t,e){const i=new Array(Math.max(0,e.length-1)).fill(0);for(let s=0;s<t.length;s++){const a=pi(t[s],e);a>=0&&i[a]++}return i}(t,u));e.histogramData={edges:u,binWidth:p,counts:g,rule:d.rule,capped:d.capped};const f=hi(a);return e.seriesObservations=h.map((t,e)=>({values:t,byPoint:-1!==f.indexOf(e)?[]:gi(t,u)})),r.map((t,e)=>{if(-1!==f.indexOf(e))return l(o({},t),{data:[]});const i=function(t,e={}){let i=t.slice();if(e.cumulative){let t=0;i=i.map(e=>t+=e)}const s=t.reduce((t,e)=>t+e,0);if(s<=0)return i;if("relative"===e.normalize)return i.map(t=>t/s*100);if("density"===e.normalize){const t=e.binWidth;if("number"==typeof t&&t>0)return i.map(e=>e/(s*t))}return i}(g[e],{normalize:n.normalize,cumulative:n.cumulative,binWidth:p}),s=[];for(let t=0;t<i.length;t++)s.push({x:(u[t]+u[t+1])/2,y:i[t]});return l(o({},t),{data:s})})}),ni("boxPlot",function(t,e){var i,s;return bi(t,e,"boxPlot",{whiskers:(null==(s=null==(i=e.config.plotOptions)?void 0:i.boxPlot)?void 0:s.whiskers)||"minmax"},fi,t=>Array.isArray(null==t?void 0:t.y)&&5===t.y.length&&t.y,(t,e,i)=>l(o({},t),{y:e.summary,points:i}))}),ni("violin",function(t,e){var i,s;const a=(null==(s=null==(i=e.config.plotOptions)?void 0:i.violin)?void 0:s.kde)||{};return bi(t,e,"violin",{bandwidth:a.bandwidth,resolution:a.resolution},mi,t=>{var e;return Array.isArray(null==(e=null==t?void 0:t.y)?void 0:e.density)&&t.y.density.length&&t.y.density},(t,e,i)=>l(o({},t),{y:l(o({},t.y&&"object"==typeof t.y&&!Array.isArray(t.y)?t.y:{}),{density:e.density,points:i})}))}),li("histogram",function(t,e){const i=t.globals,s=t.histogramData,a=i&&i.histogramRawSeries;if(!s||!Array.isArray(s.edges)||s.edges.length<2)return null;if(!Array.isArray(a)||!a.length)return null;const r=hi(i),n=s.edges,o=[];return a.forEach((e,i)=>{var s;if(-1!==r.indexOf(i))return;const l=gi(xi(e&&e.data),n),h=t.seriesData&&(null==(s=t.seriesData.seriesNames)?void 0:s[i])||(null==e?void 0:e.name);l.forEach((t,e)=>{const s=`${vi(n[e])}-${vi(n[e+1])}`;o.push({name:a.length>1&&h?`${h} ${s}`:s,realIndex:i,rows:t})})}),o.length?yi(t,o,e):null}),li("boxPlot",_i),li("violin",Ai);const Si=(t,e,i,s)=>{if("function"!=typeof t)return t;const a=t({series:e.seriesData.series,seriesIndex:i,dataPointIndex:s,w:e});return Number.isFinite(a)?a:0};class Ci{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,i,s,a,r,n;const{x:h,y:c,y1:d,y2:u,i:p,j:g,realIndex:f,columnGroupIndex:m,barHeight:x,barWidth:b,barXPosition:y,barYPosition:v,visibleSeries:w,hl:_,noLabel:A}=t,S=this.w,C=new R(this.barCtx.w);this.hlt=null==_?void 0:_.total;const k=S.waterfallData&&S.waterfallData.values,P=_&&null!=_.val?_.val:k&&k[f]&&null!=k[f][g]?k[f][g]:null,L=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[f]:this.barCtx.strokeWidth;let M,I;S.axisFlags.isXNumeric&&!S.globals.isBarHorizontal?(M=h+b*(w+1),I=c+x*(w+1)-L):(M=h+b*w,I=c+x*w);let E=null,F=null,D=h,T=c,z={};const X=S.config.dataLabels,O=this.barCtx.barOptions.dataLabels,$=this.barCtx.barOptions.dataLabels.total;void 0!==v&&(this.barCtx.isRangeBar||this.barCtx.isPyramid)&&(I=v,T=v),void 0!==y&&this.barCtx.isVerticalGroupedRangeBar&&(M=y,D=y);const W=Si(X.offsetX,S,f,g),Y=Si(X.offsetY,S,f,g),H=(null==_?void 0:_.hide)?void 0:null!==P?P:void 0!==u?[d,u]:"100%"===S.config.chart.stackType?S.globals.seriesPercent[f][g]:S.seriesData.series[f][g];let B,N={width:0,height:0};X.enabled&&(B=void 0===H?"":X.formatter(H,l(o({},S),{seriesIndex:f,dataPointIndex:g,w:S})),N=C.getTextRects(B,parseFloat(X.style.fontSize).toString(),X.style.fontFamily,void 0,!0,X.style.fontWeight));const j=S.config.chart.stacked&&$.enabled&&!1!==this.hlt&&this.drawsStackedTotal(f),V=j?this.getStackedTotalDataLabel({realIndex:f,j:g}):void 0,G={drawTotal:j,totalText:V,x:null!=(e=null==_?void 0:_.x)?e:h,y:null!=(i=null==_?void 0:_.y)?i:c,neg:_&&null!=_.val?_.val<0:void 0,i:p,j:g,realIndex:f,columnGroupIndex:m,bcx:M,bcy:I,barHeight:null!=(s=null==_?void 0:_.barHeight)?s:x,barWidth:null!=(a=null==_?void 0:_.barWidth)?a:b,textRects:N,strokeWidth:L,dataLabelsX:D,dataLabelsY:T,dataLabelsConfig:X,barDataLabelsConfig:O,barTotalDataLabelsConfig:$,offX:W,offY:Y};if(z=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(G):this.calculateColumnsDataLabelsPosition(G),null!==P&&this.barCtx.isHorizontal&&"center"===O.position){const t=null==(n=null==(r=S.waterfallData.geometry)?void 0:r[f])?void 0:n[g];t&&t.horizontal&&(z.dataLabelsX=(t.levelStart+t.levelEnd)/2+W)}return E=A?null:this.drawCalculatedDataLabels({x:z.dataLabelsX,y:z.dataLabelsY,neg:G.neg,val:H,text:B,i:f,j:g,barWidth:G.barWidth,barHeight:G.barHeight,textRects:N,dataLabelsConfig:X}),j&&(F=this.drawTotalDataLabels({x:z.totalDataLabelsX,y:z.totalDataLabelsY,barWidth:b,barHeight:x,realIndex:f,j:g,textAnchor:z.totalDataLabelsAnchor,val:V,rawVal:this.getStackedTotalValue({realIndex:f,j:g}),dataLabelsConfig:X,barTotalDataLabelsConfig:$})),{dataLabelsPos:z,dataLabels:E,totalDataLabels:F}}hasMultipleSeriesGroups(){return this.w.labelData.seriesGroups.length>1}getTotalGroupContext(t){if(!this.hasMultipleSeriesGroups())return null;const e=this.barCtx.barHelpers.getSeriesGroupIndex(t);return e<0?null:{groupIndex:e}}drawsStackedTotal(t){const e=this.barCtx.lastActiveBarSerieIndexByGroup,i=this.getTotalGroupContext(t);return i&&e&&e.length>i.groupIndex?e[i.groupIndex]===t:this.barCtx.lastActiveBarSerieIndex===t}getStackedTotalValue({realIndex:t,j:e}){if(this.hlt)return this.hlt.val;const i=this.w,s=this.xStackTop(t,e);if(s)return s[3];const a=this.getTotalGroupContext(t),r=i.seriesData.stackedSeriesTotalsByGroups;return a&&r&&r[a.groupIndex]?r[a.groupIndex][e]:this.barCtx.stackedSeriesTotals[e]}xStackTop(t,e){var i,s;const a=this.w;return a.axisFlags.isXNumeric&&(null==(s=null==(i=this.barCtx.stacks)?void 0:i[a.labelData.seriesGroupIndex[t]])?void 0:s.tops.get(a.seriesData.seriesX[t][e]))}totalRects(t){const e=this.barCtx.barOptions.dataLabels.total.style;return new R(this.w).getTextRects(t,e.fontSize,e.fontFamily,void 0,!0,e.fontWeight)}getStackedTotalDataLabel({realIndex:t,j:e}){const i=this.w;let s=this.getStackedTotalValue({realIndex:t,j:e});return this.totalFormatter&&(s=this.totalFormatter(s,l(o({},i),{seriesIndex:t,dataPointIndex:e,w:i}))),s}zeroEncounters(t,e){const i=this.w;return!i.config.chart.stacked&&i.config.plotOptions.bar.hideZeroBarsWhenGrouped?this.barCtx.barHelpers.getZeroValueEncounters({i:t,j:e}).zeroEncounters:0}calculateColumnsDataLabelsPosition(t){var e;const i=this.w;let s,a,{j:r,realIndex:n,y:o,bcx:l,barWidth:h,barHeight:c,textRects:d,dataLabelsX:u,dataLabelsY:p,barDataLabelsConfig:g,barTotalDataLabelsConfig:f,strokeWidth:m,offX:x,offY:b}=t;const y=l;c=Math.abs(c);const v="vertical"===i.config.plotOptions.bar.dataLabels.orientation,w=this.zeroEncounters(n,r);l-=m/2;const _=i.layout.gridWidth/i.globals.dataPoints;if(this.barCtx.isVerticalGroupedRangeBar?u+=h/2:(u=i.axisFlags.isXNumeric?l-h/2+x:l-_+h/2+x,w>0&&(u-=h*w)),v){const t=2;u=u+d.height/2-m/2-t}const A=null!=(e=t.neg)?e:i.seriesData.series[n][r]<0;let S=o;switch(this.barCtx.isReversed&&(S=o+(A?c:-c)),g.position){case"center":p=v?A?S-c/2+b:S+c/2-b:A?S-c/2+d.height/2+b:S+c/2+d.height/2-b;break;case"bottom":p=v?A?S-c+b:S+c-b:A?S-c+d.height+m+b:S+c-d.height/2+m-b;break;case"top":p=v?A?S+b:S-b:A?S-d.height/2-b:S+d.height+b}if(t.drawTotal){let e=S;const o=this.getTotalGroupContext(n),l=this.xStackTop(n,r),c=l?[]:this.barCtx.stacks||[];l&&(e=A?Math.max(S,l[5]):Math.min(S,l[4])),c.forEach((t,i)=>{o&&i!==o.groupIndex||t.prevY.forEach(t=>{e=A?Math.max(t[r],e):Math.min(t[r],e)})}),this.hlt&&(e=this.hlt.edge);const d=this.totalRects(t.totalText).height;s=A?e+.77*d-b-f.offsetY:e-.3*d+b+f.offsetY;const u=_;a=y+(i.axisFlags.isXNumeric?-h/2:h/2-u)+f.offsetX}return i.config.chart.stacked||(p<0?p=0+m:p+d.height/3>i.layout.gridHeight&&(p=i.layout.gridHeight-m)),{bcx:l,bcy:o,dataLabelsX:u,dataLabelsY:p,totalDataLabelsX:a,totalDataLabelsY:s,totalDataLabelsAnchor:"middle"}}calculateBarsDataLabelsPosition(t){var e,i;const s=this.w;let{x:a,j:r,realIndex:n,bcy:o,barHeight:l,barWidth:h,textRects:c,dataLabelsX:d,strokeWidth:u,dataLabelsConfig:p,barDataLabelsConfig:g,barTotalDataLabelsConfig:f,offX:m,offY:x}=t;const b=s.layout.gridHeight/s.globals.dataPoints,y=this.zeroEncounters(n,r);let v,w,_;if(h=Math.abs(h),this.barCtx.isPyramid){v=o+l/2+x-(null!=(e=c.centerOffset)?e:0)}else v=o-(this.barCtx.isRangeBar?0:b)+l/2+c.height/2+x-3;y>0&&(v-=l*y);let A="start";const S=null!=(i=t.neg)?i:s.seriesData.series[n][r]<0;let C=a;if(this.barCtx.isReversed&&(C=a+(S?-h:h),A=S?"start":"end"),this.barCtx.isPyramid)d=s.layout.gridWidth/2+m;else switch(g.position){case"center":d=S?C+h/2-m:Math.max(c.width/2,C-h/2)+m;break;case"bottom":d=S?C+h-u-m:C-h+u+m;break;case"top":d=S?C-u-m:C-u+m}if(t.drawTotal){let e=C;const i=this.getTotalGroupContext(n),a=this.xStackTop(n,r),o=a?[]:this.barCtx.stacks||[];a&&(e=S?Math.min(C,a[4]):Math.max(C,a[5])),o.forEach((t,s)=>{i&&s!==i.groupIndex||t.prevX.forEach(t=>{e=S?Math.min(t[r],e):Math.max(t[r],e)})}),this.hlt&&(e=this.hlt.edge);const d=this.totalRects(t.totalText);S?(w=e-u-m-f.offsetX,A="end"):w=e+m+f.offsetX+(this.barCtx.isReversed?-(h+u):u),_=v-c.height/2+d.height/2+f.offsetY+u,s.globals.barGroups.length>1&&!i&&(_-=s.globals.barGroups.length/2*(l/2))}if(!s.config.chart.stacked){const t=S&&"middle"!==p.textAnchor?"start"===p.textAnchor?"end":"start":p.textAnchor;let e;e="vertical"===g.orientation?c.height/2:"end"===t?c.width:"middle"===t?c.width/2:0;const i=("vertical"===g.orientation?c.height:c.width)-e;d+i>s.layout.gridWidth-u&&(d=s.layout.gridWidth-i-u),d-e<u&&(d=e+u)}return{bcx:a,bcy:o,dataLabelsX:d,dataLabelsY:v,totalDataLabelsX:w,totalDataLabelsY:_,totalDataLabelsAnchor:A}}drawCalculatedDataLabels({x:t,y:e,val:i,text:s,neg:a,i:r,j:n,textRects:h,barHeight:c,barWidth:d,dataLabelsConfig:u}){var p,g,f;const m=this.w;let x="rotate(0)";"vertical"===m.config.plotOptions.bar.dataLabels.orientation&&(x=`rotate(-90, ${t}, ${e})`);const b=new I(this.barCtx.w,this.barCtx.ctx),y=new R(this.barCtx.w),v=u.formatter;let w=null;const _=m.globals.collapsedSeriesIndices.indexOf(r)>-1,A=(m.globals.collapsingSeriesIndices||[]).indexOf(r)>-1,S=`${r}::${this.barCtx._keys(r)[n]}`;if(A){const t=null==(p=m.globals.prevDataLabels)?void 0:p.get(S);t&&isFinite(t.val)&&(i=t.val,s=void 0)}if(u.enabled&&(!_||A)){w=y.group({class:"apexcharts-data-labels",transform:x});const p=m.config.dataLabels;((null==(g=p.animate)?void 0:g.enabled)||(null==(f=p.countUp)?void 0:f.enabled))&&(w.node.setAttribute("data:dlKey",S),w.node.setAttribute("data:dlJ",String(n)),"number"==typeof i&&isFinite(i)&&w.node.setAttribute("data:dlVal",String(i))),void 0===i?s="":void 0===s&&(s=v(i,l(o({},m),{seriesIndex:r,dataPointIndex:n,w:m}))),!i&&m.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(s="");let _=u.textAnchor;"vertical"===m.config.plotOptions.bar.dataLabels.orientation&&(_="center"===m.config.plotOptions.bar.dataLabels.position?"middle":(null!=a?a:m.seriesData.series[r][n]<0)?"end":"start"),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&d<h.width&&(s=""),m.config.chart.stacked&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&!A&&(this.barCtx.isHorizontal?h.width/1.6>Math.abs(d)&&(s=""):h.height/1.6>Math.abs(c)&&(s=""));const C=l(o({},u),{textAnchor:_});this.barCtx.isHorizontal&&i<0&&("start"===_?C.textAnchor="end":"end"===_&&(C.textAnchor="start")),b.plotDataLabelsText({x:t,y:e,text:s,i:r,j:n,parent:w,dataLabelsConfig:C,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return w}drawTotalDataLabels({x:t,y:e,val:i,rawVal:s,realIndex:a,j:r,textAnchor:n,barTotalDataLabelsConfig:o}){var l,h;const c=new R(this.barCtx.w);let d;if(o.enabled&&void 0!==t&&void 0!==e&&this.drawsStackedTotal(a)){d=c.drawText({x:t,y:e,foreColor:o.style.color,text:i,textAnchor:n,fontFamily:o.style.fontFamily,fontSize:o.style.fontSize,fontWeight:o.style.fontWeight}),d.attr({class:"apexcharts-datalabel-total",cx:t,cy:e});const u=this.w.config.dataLabels;if((null==(l=u.animate)?void 0:l.enabled)||(null==(h=u.countUp)?void 0:h.enabled)){const{groupIndex:t}=this.barCtx.barHelpers.getGroupIndex(a);d.node.setAttribute("data:dlTotalKey",`${t}::${this.barCtx._keys(a)[r]}`),d.node.setAttribute("data:dlTotalSeries",String(a)),"number"==typeof s&&isFinite(s)&&d.node.setAttribute("data:dlTotalVal",String(s))}}return d}}function ki(t){var e,i,s,a,r,n,o;return"histogram"===(null==(i=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:i.requestedType)&&(!1!==(null==(a=null==(s=t.config.plotOptions)?void 0:s.histogram)?void 0:a.overlap)&&(null!=(o=null==(n=null==(r=t.seriesData)?void 0:r.series)?void 0:n.length)?o:0)>1)}let Pi=class{constructor(t){this.w=t.w,this.barCtx=t}initVariables(t,e){const i=this.w;this.seriesIndex=e,this.barCtx.series=t,this.barCtx.totalItems=0,this.barCtx.seriesLen=0,this.barCtx.visibleI=-1,this._bgOwner=void 0;for(let e=0;e<t.length;e++)t[e].length>0&&(this.barCtx.seriesLen=this.barCtx.seriesLen+1,this.barCtx.totalItems+=t[e].length);const s=i.labelData.labels;this.rows=i.globals.isBarHorizontal&&i.axisFlags.isXNumeric&&!this.barCtx.isRangeBar&&i.seriesData.seriesX.some(t=>null==t?void 0:t.some((t,e)=>t!==s[e]))?new Map(s.map((t,e)=>[t,e])):null,this.arrBorderRadius=this.createBorderRadiusArr(i.seriesData.series),Zt.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 i=t.globals.maxX-t.globals.minX;e=i>0?i/4:0}else if(e=this._unionMinXGap(),!(e>0&&isFinite(e))){const i=t.globals.minXDiff;e=i>0&&isFinite(i)&&.5!==i?i:0}return this._slotXSpan=e,e}_unionMinXGap(){const t=this.w.seriesData.seriesX||[],e=this.seriesIndex,i=[];for(let s=0;s<t.length;s++){const a=t[s];e&&e.indexOf(s)<0||Array.isArray(a)&&a.length>0&&i.push(a.some((t,e)=>t<a[e-1])?a.filter(t=>t===+t).sort((t,e)=>t-e):a)}if(!i.length)return 0;const s=new Array(i.length).fill(0);let a=NaN,r=1/0;for(;;){let t=1/0,e=-1;for(let a=0;a<i.length;a++){const r=i[a];for(;s[a]<r.length&&"number"!=typeof r[s[a]];)s[a]++;if(s[a]>=r.length)continue;const n=r[s[a]];n==n?n<t&&(t=n,e=a):(s[a]++,a--)}if(-1===e)break;if(s[e]++,a==a){const e=t-a;e>0&&e<r&&(r=e)}a=t}return isFinite(r)?r:0}visibleItems(){const t=this.w.globals;if(!this.w.axisFlags.isXNumeric)return t.dataPoints;let e=1;const i=this.w.seriesData.seriesX;return this.barCtx.series.forEach((s,a)=>{for(let r=0;r<s.length;r++)i[a][r]>t.minX&&i[a][r]<t.maxX&&e++}),e}barRow(t,e){var i,s,a;return null!=(a=null==(s=this.rows)?void 0:s.get(null==(i=this.w.seriesData.seriesX[t])?void 0:i[e]))?a:e}initialPositions(t){const e=this.w;let i,s,a,r,n,o,l,h,c=e.globals.dataPoints;this.barCtx.isRangeBar&&(c=e.labelData.labels.length);let d=this.barCtx.seriesLen;if((e.config.plotOptions.bar.rangeBarGroupRows||ki(e))&&(d=1),this.barCtx.isHorizontal)a=e.layout.gridHeight/c,n=a/d,n=n*parseInt(this.barCtx.barOptions.barHeight,10)/100,-1===String(this.barCtx.barOptions.barHeight).indexOf("%")&&(n=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=(a-n*this.barCtx.seriesLen)/2;else{const s=this.barCtx.xRatio,a=e.axisFlags.isXNumeric?this.barSlotXSpan():0,n=a>0&&a/s>0;if(r=e.config.xaxis.convertedCatToNumeric?e.layout.gridWidth/e.globals.dataPoints:n?0:e.layout.gridWidth/this.visibleItems(),o=r/d*parseInt(this.barCtx.barOptions.columnWidth,10)/100,e.axisFlags.isXNumeric&&(n&&(r=a/s),o=r/d*parseInt(this.barCtx.barOptions.columnWidth,10)/100,o<1&&(o=1)),-1===String(this.barCtx.barOptions.columnWidth).indexOf("%")&&(o=parseInt(this.barCtx.barOptions.columnWidth,10)),l=e.layout.gridHeight-this.barCtx.baseLineY[this.barCtx.translationsIndex]-(this.barCtx.isReversed?e.layout.gridHeight:0)+(this.barCtx.isReversed?2*this.barCtx.baseLineY[this.barCtx.translationsIndex]:0),e.axisFlags.isXNumeric){i=this.barCtx.getBarXForNumericXAxis({x:i,j:0,realIndex:t,barWidth:o}).x}else i=e.globals.padHorizontal+Zt.noExponents(r-o*this.barCtx.seriesLen)/2}return e.globals.barHeight=n,e.globals.barWidth=o,{x:i,y:s,yDivision:a,xDivision:r,barHeight:n,barWidth:o,zeroH:l,zeroW:h}}initializeStackedPrevVars(t){t.stacks=t.w.labelData.seriesGroups.map(()=>({prevY:[],prevX:[],prevYF:[],prevXF:[],prevYVal:[],prevXVal:[],tops:new Map}))}initializeStackedXYVars(t){t.stacks.forEach(t=>{t.xArrj=[],t.xArrjF=[],t.xArrjVal=[],t.yArrj=[],t.yArrjF=[],t.yArrjVal=[]})}getPathFillColor(t,e,i,s){var a;const r=this.w,n=new F(this.barCtx.w);let o=null;const l=this.barCtx.barOptions.distributed?i:e;let h=!1;if(this.barCtx.barOptions.colors.ranges.length>0){this.barCtx.barOptions.colors.ranges.map(s=>{t[e][i]>=s.from&&t[e][i]<=s.to&&(o=s.color,h=!0)})}const c=this.getDumbbellConnectorFill(e,i)||(null==(a=r.config.series[s].data[i])?void 0:a.fill),d=this.barCtx.barOptions.isDumbbell?r.config.plotOptions.bar.dumbbell.connector:null;let u;d&&d.color&&(o=d.color,u=d.opacity);return{color:n.fillPath({seriesNumber:this.barCtx.barOptions.distributed?l:s,dataPointIndex:i,color:o,opacity:u,value:t[e][i],fillConfig:c,fillType:(null==c?void 0:c.type)?c.type:Array.isArray(r.config.fill.type)?r.config.fill.type[s]:r.config.fill.type}),useRangeColor:h}}getDumbbellConnectorFill(t,e){const i=this.w;if(!this.barCtx.barOptions.isDumbbell)return null;const s=i.dumbbellData;if(!s||"series"!==s.form)return null;const a=i.config.plotOptions.bar.dumbbell.connector;if(a.color)return null;const r=s.order[e];if(!r)return null;const n=i.globals.colors[r[0]],o=i.globals.colors[r[1]];return n&&o?{type:"gradient",gradient:{type:this.barCtx.isHorizontal?"horizontal":"vertical",gradientFrom:n,gradientTo:o,opacityFrom:a.opacity,opacityTo:a.opacity,stops:[0,100],inverseColors:!this.barCtx.isHorizontal}}:null}getStrokeWidth(t,e,i){let s=0;const a=this.w;return void 0===this.barCtx.series[t][e]||null===this.barCtx.series[t][e]||"bar"===a.config.chart.type&&!this.barCtx.series[t][e]?this.barCtx.isNullValue=!0:this.barCtx.isNullValue=!1,a.config.stroke.show&&(this.barCtx.isNullValue||(s=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[i]:this.barCtx.strokeWidth)),s}getStackedSeriesIndices(t){const e=this.w,i=e.labelData.seriesGroups,s=e.globals.columnSeries?new Set(e.globals.columnSeries.i):null,a=t=>!s||s.has(t);if(!i||i.length<2){const e=Array.from({length:t},(t,e)=>e).filter(a);return e.length?[e]:[]}const r=Array.from({length:i.length},()=>[]),n=[];for(let e=0;e<t;e++){if(!a(e))continue;const t=this.getSeriesGroupIndex(e);t>-1?r[t].push(e):n.push(e)}return n.length&&r.push(n),r.filter(t=>t.length>0)}createBorderRadiusArr(t){const e=this.w,i=!this.w.config.chart.stacked||e.config.plotOptions.bar.borderRadius<=0,s=t.length,a=Math.max(0,...t.map(t=>0|(null==t?void 0:t.length))),r=Array.from({length:s},()=>Array(a).fill(i?"top":"none"));if(i)return r;const n="last"===e.config.plotOptions.bar.borderRadiusWhenStacked,o=n?"top":"both",l=n?"bottom":"both",h=n?"none":"bottom",c=n?"none":"top";for(const e of this.getStackedSeriesIndices(s))for(let i=0;i<a;i++){const s=[],a=[];for(const r of e){const e=t[r][i];e>0?s.push(r):e<0&&a.push(r)}if(s.length>0&&0===a.length)if(1===s.length)r[s[0]][i]=o;else{const t=s[0],e=s[s.length-1];for(const a of s)r[a][i]=a===t?h:a===e?"top":"none"}else if(a.length>0&&0===s.length)if(1===a.length)r[a[0]][i]=l;else{const t=Math.min(...a),e=Math.max(...a);for(const s of a)r[s][i]=s===t?c:s===e?"bottom":"none"}else if(s.length>0&&a.length>0){const t=s[s.length-1];for(const e of s)r[e][i]=e===t?"top":"none";const e=Math.max(...a);for(const t of a)r[t][i]=t===e?"bottom":"none"}}return r}barBackground({j:t,i:e,x1:i,x2:s,y1:a,y2:r,elSeries:n}){const o=this.w,l=this.barCtx.barOptions.colors;if(l.backgroundBarColors.length&&(void 0===this._bgOwner&&(this._bgOwner=new W(o).getActiveConfigSeriesIndex()),this._bgOwner===e)){const e=new R(o);t>=l.backgroundBarColors.length&&(t%=l.backgroundBarColors.length);const h=l.backgroundBarColors[t],c=e.drawRect(void 0!==i?i:0,void 0!==a?a:0,void 0!==s?s:o.layout.gridWidth,void 0!==r?r:o.layout.gridHeight,l.backgroundBarRadius,h,l.backgroundBarOpacity);n.add(c),c.node.classList.add("apexcharts-backgroundBar")}}barRect({a:t,len:e,v1:i,v2:s,strokeWidth:a,insetWidth:r,realIndex:n,j:o,dir:l,horizontal:h}){const c=this.w,d=new R(c);(a=Array.isArray(a)?a[n]:a)||(a=0),void 0===r?r=a:(r=Array.isArray(r)?r[n]:r)||(r=0);const u=c.config.series[n].data[o],p=h?null==u?void 0:u.barHeightOffset:null==u?void 0:u.columnWidthOffset;p&&(t-=p/2,e+=p);const g=a/2,f=r/2,m=l*(this.barCtx.isReversed?-1:1),x=a<r,b=x?f:g;let y;const v="around"===c.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[n][o]?" Z":" z";let w,_,A,S,C,k;h?(A=t+f,S=t+e-f,w=i+.001+b*m,y=s+.001-g*m,_=x?w:y,C=d.line(w,S),k=d.move(w,A)+d.line(_,A)+d.line(_,S)+C+v):(w=t+f,_=t+e-f,A=i+.001-b*m,y=s+.001+g*m,S=x?A:y,C=d.line(_,A),k=d.move(w,A)+d.line(w,S)+d.line(_,S)+C+v);const P=c.config.plotOptions.bar.borderRadius;let L=k;return"none"!==this.arrBorderRadius[n][o]&&(L=0===P&&isFinite(w+_+A+S)?k.replace(" Z",` L ${w} ${A} Z`).replace(/ L (\S+ \S+)(?= [LZ])/g," L $1 C $1 $1 $1")+" ":d.roundPathCorners(k,P)),{x1:w,x2:_,y1:A,y2:S,sl:C,closing:v,squarePathTo:k,pathTo:L,base:d.move(w,A)+d.line(w,A)+C+C+C+C+C+d.line(w,A)+v,tip:y,strokeWidth:a,strokeCenter:g,direction:m}}collapsedSign(t,e){var i;const s=this.w.globals,a=[[s.collapsedSeriesIndices,s.collapsedSeries],[s.ancillaryCollapsedSeriesIndices,s.ancillaryCollapsedSeries]];for(const[s,r]of a){if(!s||s.indexOf(t)<0)continue;const a=(r||[]).find(e=>e.index===t),n=null==(i=null==a?void 0:a.data)?void 0:i[e],o=Array.isArray(n)?n[1]:n&&"object"==typeof n?n.y:n;return"number"==typeof o&&o?Math.sign(o):0}return 0}getColumnPaths({barWidth:t,barXPosition:e,y1:i,y2:s,strokeWidth:a,insetWidth:r,series:n,realIndex:o,i:l,j:h,w:c}){var d,u,p;const g=this.barRect({a:e,len:t,v1:i,v2:s,strokeWidth:a,insetWidth:r,realIndex:o,j:h,dir:this.collapsedSign(o,h)||(n[l][h]>=0?1:-1)}),{pathTo:f,squarePathTo:m,strokeCenter:x,direction:b}=g;i=g.y1,s=g.y2;let y=null;const v=null==(u=null==(d=this.barCtx.ctx)?void 0:d.morphTypeChange)?void 0:u.getInitialPathFor(o,h);if(v?y=v:c.globals.previousPaths.length>0&&(y=this.barCtx.getPreviousPath(o,h,f,m)),null==y&&(y=g.base),c.config.chart.stacked){const t=this.barCtx.groupCtx;t.yArrj.push(g.tip-x*b),t.yArrjF.push(Math.abs(i-s+g.strokeWidth*b)),t.yArrjVal.push(null!=(p=this.barCtx.series[l][h])?p:null)}return{pathTo:f,pathFrom:y,drawnBox:{x1:g.x1,x2:g.x2,y1:i,y2:s}}}getFunnelTrapezoidPaths({barYPosition:t,barHeight:e,series:i,i:s,j:a,realIndex:r,strokeWidth:n,w:o}){var l,h;const c=new R(this.barCtx.w),d=o.layout.gridWidth/2,u=t=>Math.abs(t/this.barCtx.invertedYRatio)/2,p=u(i[s][a]),g=a===i[s].length-1,f="taper"===o.config.plotOptions.funnel.lastShape?"taper":"flat";let m;m=g?"taper"===f?0:p:u(i[s][a+1]);const x=n/2,b=t+x,y=t+e-x,v=d-p,w=d+p,_=d-m,A=d+m,S=c.move(v,b)+c.line(w,b)+c.line(A,y)+c.line(_,y)+" Z";let C=null;const k=null==(h=null==(l=this.barCtx.ctx)?void 0:l.morphTypeChange)?void 0:h.getInitialPathFor(r,a);return k?C=k:o.globals.previousPaths.length>0&&(C=this.barCtx.getPreviousPath(r,a,S)),null==C&&(C=c.move(d,b)+c.line(d,b)+c.line(d,y)+c.line(d,y)+" Z"),{pathTo:S,pathFrom:C,x:w,x1:v,barXPosition:d}}computePyramidLayout(t){const e=this.w,i=e.layout.gridHeight,s=e.layout.gridWidth,a=t.map(t=>Math.abs(Number(t)||0)),r=a.reduce((t,e)=>t+e,0);if(0===r||i<=0)return a.map(()=>({y:0,height:0,topHalf:0,bottomHalf:0}));const n=s/2;let o=0;const l=[];for(let t=0;t<a.length;t++){const e=o/r;o+=a[t];const s=o/r,h=e*i,c=s*i;l.push({y:h,height:c-h,topHalf:e*n,bottomHalf:s*n})}return l}getPyramidPaths({barYPosition:t,barHeight:e,topHalf:i,bottomHalf:s,realIndex:a,j:r,strokeWidth:n,w:o}){var l,h;const c=new R(this.barCtx.w),d=o.layout.gridWidth/2,u=n/2,p=t+u,g=t+e-u,f=d-i,m=d+i,x=d-s,b=d+s,y=c.move(f,p)+c.line(m,p)+c.line(b,g)+c.line(x,g)+" Z";let v=null;const w=null==(h=null==(l=this.barCtx.ctx)?void 0:l.morphTypeChange)?void 0:h.getInitialPathFor(a,r);return w?v=w:o.globals.previousPaths.length>0&&(v=this.barCtx.getPreviousPath(a,r,y)),null==v&&(v=c.move(d,p)+c.line(d,p)+c.line(d,g)+c.line(d,g)+" Z"),{pathTo:y,pathFrom:v,x:m,x1:f,barXPosition:d}}getBarpaths({barYPosition:t,barHeight:e,x1:i,x2:s,strokeWidth:a,series:r,realIndex:n,i:o,j:l,w:h}){var c,d,u;const p=new R(this.barCtx.w),g=this.barRect({a:t,len:e,v1:i,v2:s,strokeWidth:a,realIndex:n,j:l,dir:r[o][l]>=0?1:-1,horizontal:!0}),{y1:f,y2:m,sl:x,closing:b,squarePathTo:y,pathTo:v,strokeCenter:w,direction:_}=g;i=g.x1,s=g.x2;const A=this.barCtx.isFunnel,S=A?(i+s)/2:i;let C=null;const k=null==(d=null==(c=this.barCtx.ctx)?void 0:c.morphTypeChange)?void 0:d.getInitialPathFor(n,l);if(k?C=k:h.globals.previousPaths.length>0&&(C=this.barCtx.getPreviousPath(n,l,v,y)),null==C){const t=A?p.line(S,m):x;C=p.move(S,f)+p.line(S,f)+t+t+t+t+t+p.line(S,f)+b}if(h.config.chart.stacked){const t=this.barCtx.groupCtx;t.xArrj.push(s+w*_),t.xArrjF.push(Math.abs(i-s-g.strokeWidth*_)),t.xArrjVal.push(null!=(u=this.barCtx.series[o][l])?u:null)}return{pathTo:v,pathFrom:C,drawnBox:{x1:i,x2:s,y1:f,y2:m}}}getXForValue(t,e,i=!0){let s=i?e:null;return null!=t&&(s=e+t/this.barCtx.invertedYRatio-2*(this.barCtx.isReversed?t/this.barCtx.invertedYRatio:0)),s}getYForValue(t,e,i,s=!0){let a=s?e:null;return null!=t&&(a=e-t/this.barCtx.yRatio[i]+2*(this.barCtx.isReversed?t/this.barCtx.yRatio[i]:0)),a}getGoalValues(t,e,i,s,a,r){const n=this.w,h=[],c=(a,o)=>{n.globals.invalidLogScale||(a=new P(n).getLogValAtSeriesIndex(a,s)),h.push({[t]:"x"===t?this.getXForValue(a,e,!1):this.getYForValue(a,i,r,!1),attrs:o})};if(n.seriesData.seriesGoals[s]&&n.seriesData.seriesGoals[s][a]&&Array.isArray(n.seriesData.seriesGoals[s][a])&&n.seriesData.seriesGoals[s][a].forEach(t=>{c(t.value,t)}),this.barCtx.barOptions.isDumbbell){const e=this.getDumbbellEnds(s,a);if(e.length){const i={strokeHeight:"x"===t?0:n.globals.markers.size[s],strokeWidth:"x"===t?n.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 d=n.config.plotOptions.bar.dumbbell.dataLabels;e.forEach((t,e)=>{const n=l(o({},i),{strokeColor:t.color});!d.enabled||e!==r&&e!==h||(n.label={text:this.getDumbbellLabelText(t.value,s,a,t.index),color:d.colorFromMarker?t.color:Array.isArray(d.style.colors)?d.style.colors[t.index]||d.style.colors[0]:d.style.colors,outward:e===r&&r!==h?-1:1}),c(t.value,n)})}}return h}getDumbbellEnds(t,e){const i=this.w,s=[],a=i.dumbbellData;if(a&&"series"===a.form){const t=a.values[e]||[];for(let e=0;e<t.length;e++){const r=t[e];null!==r&&-1===a.hidden.indexOf(e)&&s.push({value:r,color:i.globals.colors[e],index:e})}return s}if(!i.rangeData.seriesRange.length)return s;const r=this.barCtx.barOptions.dumbbellColors?this.barCtx.barOptions.dumbbellColors:i.globals.colors,n=e=>Array.isArray(r[t])?r[t][e]:r[t];return[{value:i.rangeData.seriesRangeStart[t][e],color:n(0),index:0},{value:i.rangeData.seriesRangeEnd[t][e],color:n(1),index:1}]}getDumbbellLabelText(t,e,i,s){const a=this.w,r=a.config.plotOptions.bar.dumbbell.dataLabels;if("function"==typeof r.formatter)return r.formatter(t,{seriesIndex:e,dataPointIndex:i,endpointIndex:s,w:a});const n=this.barCtx.isHorizontal?a.formatters.xLabelFormatter:a.formatters.yLabelFormatters[0];return"function"==typeof n?n(t,i,a):String(t)}drawGoalLine({barXPosition:t,barYPosition:e,goalX:i,goalY:s,barWidth:a,barHeight:r}){if(!(Array.isArray(i)&&i.length>0||Array.isArray(s)&&s.length>0))return null;const n=new R(this.barCtx.w),o=n.group({class:"apexcharts-bar-goals-groups"});o.node.classList.add("apexcharts-element-hidden"),this.barCtx.w.globals.delayedElements.push({el:o.node}),o.attr("clip-path",`url(#gridRectMarkerMask${this.barCtx.w.globals.cuid})`);let l=null;return this.barCtx.isHorizontal?Array.isArray(i)&&i.forEach(t=>{if(t.x>=-1&&t.x<=n.w.layout.gridWidth+1){const i=void 0!==t.attrs.strokeHeight?t.attrs.strokeHeight:r/2,s=e+i+r/2;l=n.drawLine(t.x,s-2*i,t.x,s,t.attrs.strokeColor?t.attrs.strokeColor:void 0,t.attrs.strokeDashArray,t.attrs.strokeWidth?t.attrs.strokeWidth:2,t.attrs.strokeLineCap),o.add(l),t.attrs.label&&o.add(this.drawDumbbellLabel(t.attrs,{x:t.x,y:s-i,horizontal:!0,markerSize:t.attrs.strokeWidth||0}))}}):Array.isArray(s)&&s.forEach(e=>{if(e.y>=-1&&e.y<=n.w.layout.gridHeight+1){const i=void 0!==e.attrs.strokeWidth?e.attrs.strokeWidth:a/2,s=t+i+a/2;l=n.drawLine(s-2*i,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),o.add(l),e.attrs.label&&o.add(this.drawDumbbellLabel(e.attrs,{x:s-i,y:e.y,horizontal:!1,markerSize:e.attrs.strokeHeight||0}))}}),o}drawDumbbellLabel(t,e){const i=this.w,s=new R(i),a=i.config.plotOptions.bar.dumbbell.dataLabels,r=e.markerSize/2+a.offset,n=t.label.outward;return s.drawText({x:e.x+(e.horizontal?r*n:0),y:e.y-(e.horizontal?0:r*n),text:t.label.text,textAnchor:e.horizontal?n<0?"end":"start":"middle",dominantBaseline:e.horizontal?"central":n<0?"hanging":"auto",foreColor:t.label.color,fontSize:a.style.fontSize,fontFamily:a.style.fontFamily,fontWeight:a.style.fontWeight,cssClass:"apexcharts-dumbbell-label"})}drawBarShadow({prevPaths:t,currPaths:e,color:i,realIndex:s,j:a}){const r=this.w,{x:n,x1:o,barYPosition:l}=t,{x:h,x1:c,barYPosition:d}=e,u=l+e.barHeight,p=new R(this.barCtx.w),g=new Zt,f=p.move(o,u)+p.line(n,u)+p.line(h,d)+p.line(c,d)+p.line(o,u)+("around"===r.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[s][a]?" Z":" z");return p.drawPath({d:f,fill:g.shadeColor(.5,Zt.rgb2hex(i)),stroke:"none",strokeWidth:0,fillOpacity:1,classes:"apexcharts-bar-shadow apexcharts-decoration-element"})}getZeroValueEncounters({i:t,j:e}){var i;const s=this.w;let a=0,r=0;return(s.config.plotOptions.bar.horizontal?s.seriesData.series.map((t,e)=>e):(null==(i=s.globals.columnSeries)?void 0:i.i.map(t=>t))||[]).forEach(i=>{const n=s.seriesData.series[i][e];n&&a++,i<t&&!n&&r++}),{nonZeroColumns:a,zeroEncounters:r}}getSeriesGroupIndex(t){var e;return null!=(e=this.w.labelData.seriesGroupIndex[t])?e:-1}getGroupIndex(t){const e=this.getSeriesGroupIndex(t),i=this.barCtx.columnGroupIndices;let s=i.indexOf(e);return s<0&&(i.push(e),s=i.length-1),{groupIndex:e,columnGroupIndex:s}}};function Li(t,e,i){if(!t||"string"!=typeof t)return null;const s=yt(t);if(!s.length||"M"!==s[0][0])return null;for(let t=1;t<s.length;t++)if("M"===s[t][0])return null;let a=s,r=null;if(i){if(s.length<5)return null;if(r=s.slice(-3),a=s.slice(0,-3),"Z"!==r[2][0])return null;if("L"!==r[1][0])return null;if("L"!==r[0][0]&&"C"!==r[0][0])return null}else if("Z"===s[s.length-1][0])return null;if(a.length!==e||a.length<2)return null;const n=a[1][0];if("L"!==n&&"C"!==n)return null;for(let t=2;t<a.length;t++)if(a[t][0]!==n)return null;const o=a.map(t=>"C"===t[0]?[Number(t[5]),Number(t[6])]:[Number(t[1]),Number(t[2])]);for(const t of o)if(!isFinite(t[0])||!isFinite(t[1]))return null;return{body:a,closing:r,segType:n,anchors:o}}function Mi(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i]}function Ii(t,e,i){const s=t,a=[e[1],e[2]],r=[e[3],e[4]],n=[e[5],e[6]],o=Mi(s,a,i),l=Mi(a,r,i),h=Mi(r,n,i),c=Mi(o,l,i),d=Mi(l,h,i),u=Mi(c,d,i);return{first:["C",o[0],o[1],c[0],c[1],u[0],u[1]],second:["C",d[0],d[1],h[0],h[1],n[0],n[1]],mid:u}}function Ei(t,e,i){const s=[e[1],e[2]],a=Mi(t,s,i);return{first:["L",a[0],a[1]],second:["L",s[0],s[1]],mid:a}}function Fi(t,e){const{body:i,closing:s,segType:a,anchors:r}=t,n=r.length,o=e.length,l=t=>"C"===a?["C",t[0],t[1],t[0],t[1],t[0],t[1]]:["L",t[0],t[1]],h=[["M",r[0][0],r[0][1]]];let c=0;for(;c<o&&0!==e[c];)c++;for(let t=1;t<=c;t++)h.push(l(r[0]));let d=c+1;for(let t=0;t<n-1;t++){let s=0;for(;d+s<o&&-1===e[d+s];)s++;const n=i[t+1];if(s){const e=s+1;let i=r[t],o=n;for(let t=0;t<s;t++){const s=1/(e-t),r="C"===a?Ii(i,o,s):Ei(i,o,s);h.push(r.first),i=r.mid,o=r.second}h.push(o)}else h.push(n.slice());d+=s+1}for(;d<o;)h.push(l(r[n-1])),d++;return s&&s.forEach(t=>h.push(t.slice())),h}function Di(t,e,i,s,a,r){const n=Li(t,s,r);if(!n)return null;const o=Li(e,a,r);if(!o)return null;if(n.segType!==o.segType)return null;if((n.closing||o.closing)&&(!n.closing||!o.closing||n.closing[0][0]!==o.closing[0][0]))return null;const l=i.map(t=>t.oldJ),h=i.map(t=>t.newJ);return{from:_t(Fi(n,l)),toInterp:_t(Fi(o,h))}}function Ti(t){var e;const i=t.config.chart.animations;if(!i||!1===i.enabled)return!1;if(!i.dynamicAnimation||!1===i.dynamicAnimation.enabled)return!1;const s=null!=(e=i.largeDatasetThreshold)?e:0;return!(s>0&&t.globals.dataPoints>s)&&!!(Nt.isBrowser()&&t.globals.dataChanged&&t.globals.shouldAnimate)}function Ri(t,e,i,s,a){if(t){const t=null==e?void 0:e[s];if(t&&t.length&&null!=t[a])return"x:"+t[a]}const r=null==i?void 0:i[a];return null!=r&&""!==String(r)?"c:"+(Array.isArray(r)?r.join(" "):String(r)):"j:"+a}function zi(t,e){const i=new Map;t.forEach((t,e)=>{i.has(t)||i.set(t,e)});const s=new Array(e.length),a=new Set;let r=-1,n=!0,o=t.length===e.length;e.forEach((t,e)=>{const l=i.has(t)&&!a.has(i.get(t))?i.get(t):-1;s[e]=l,-1!==l&&(a.add(l),l<r&&(n=!1),r=l),l!==e&&(o=!1)});const l=[];for(let e=0;e<t.length;e++)a.has(e)||l.push(e);return{toOld:s,exits:l,ordered:n,changed:!o}}function Xi(t){const e=new Map;return t.map(t=>{const i=e.get(t)||0;return e.set(t,i+1),0===i?t:`${t}#${i}`})}function Oi(t,e,i=0|(i=>null==(i=t.seriesData.series[e])?void 0:i.length)()){return Xi(Array.from({length:i},(i,s)=>function(t,e,i){var s,a;return Ri(null==(s=t.axisFlags)?void 0:s.isXNumeric,null==(a=t.seriesData)?void 0:a.seriesX,t.globals.labels,e,i)}(t,e,s)))}function $i(t,e,i=!1,s=!1,a=function(t,e){var i,s;if(!Ti(t))return null;const a=t.globals.prevStreamFrame;if(!a)return null;const r=null==(i=a.seriesY)?void 0:i[e],n=null==(s=t.seriesData.series)?void 0:s[e];if(!Array.isArray(r)||!Array.isArray(n))return null;if(!r.length||!n.length)return null;const o=Xi(r.map((t,i)=>function(t,e,i){return Ri(t.isXNumeric,t.seriesX,t.labels,e,i)}(a,e,i))),l=Oi(t,e);return{join:zi(o,l),oldKeys:o,newKeys:l}}(t,e)){return a&&(a.join.ordered||s)&&(a.join.changed||i)?a:null}function Wi(t){var e,i;const s=t.config.chart.animations;return w(null!=(i=null==(e=s.dynamicAnimation)?void 0:e.easing)?i:s.easing)}function Yi(t,e,i,s,a,r,n=performance.now()){const o=l=>{if(t.globals.isDestroyed||r&&!r())return;const h=Math.max(0,Math.min(1,(l-n)/e));s(i(h),h),h<1?ft.requestAnimationFrame(o):a&&a()};return ft.requestAnimationFrame(o),()=>{r=()=>!1}}const Hi=(t,e)=>()=>t.dom.baseEl.contains(e.node);function Bi(t,{elPointsMain:e,realIndex:i,speed:s,join:a}){var r,n,o,l;if(!(null==e?void 0:e.node)||!t.globals.prevStreamFrame||!Ti(t))return!1;const h=e.node.querySelectorAll(".apexcharts-marker");if(!h.length)return!1;const c=$i(t,i,!0,!1,null==a?void 0:a());if(!c)return!1;const d=t.globals.prevStreamFrame,u=null==(r=d.xPixels)?void 0:r[i],p=null==(n=d.yPixels)?void 0:n[i];if(!u||!p)return!1;const g=(null==(o=t.globals.seriesXvalues)?void 0:o[i])||[],f=(null==(l=t.globals.seriesYvalues)?void 0:l[i])||[],m=Wi(t),x=Math.max(1,s||1);e.node.classList.remove("apexcharts-element-hidden");const b=Hi(t,e);return h.forEach(e=>{var s,a,r,n,o,l,h,y,v;const w=parseInt(null!=(a=null!=(s=e.getAttribute("j"))?s:e.getAttribute("rel"))?a:"",10);if(!isFinite(w)||w<0||w>=c.join.toOld.length)return;const _=c.join.toOld[w],A=null!=g[w]&&null!=f[w]?[g[w],f[w]]:null;if(-1===_||!A){const i=e.style;return i.opacity="0",void Yi(t,x,m,t=>{i.opacity=String(t)},()=>{i.opacity=""},b)}const S=(null!=(r=u[_])?r:NaN)-A[0],C=(null!=(n=p[_])?n:NaN)-A[1];if(!isFinite(S)||!isFinite(C))return;const k=null!=(h=null==(l=null==(o=d.rPixels)?void 0:o[i])?void 0:l[_])?h:NaN,P=parseFloat(null!=(v=null!=(y=e.getAttribute("r"))?y:e.getAttribute("default-marker-size"))?v:""),L=isFinite(k)&&isFinite(P)&&P>0&&Math.abs(k-P)>.25;if(!(Math.abs(S)>=.5||Math.abs(C)>=.5)&&!L)return;const M=t=>{const i=S*(1-t),s=C*(1-t);if(L){const a=(k+(P-k)*t)/P;e.setAttribute("transform",`translate(${i+A[0]*(1-a)}, ${s+A[1]*(1-a)}) scale(${a})`)}else e.setAttribute("transform",`translate(${i}, ${s})`)};M(0),Yi(t,x,m,M,()=>e.removeAttribute("transform"),b)}),!0}function Ni(t,e,i,s){t.setAttribute("transform",`translate(${e*(1-s)}, ${i*(1-s)}) scale(${s})`)}function ji(t,{type:e,realIndex:i,pathFromLine:s,pathFromArea:a,linePaths:r,areaPaths:n,join:o}){var l,h;const c=$i(t,i,!1,!1,null==o?void 0:o());if(!c)return null;const{join:d,oldKeys:u,newKeys:p}=c,g=null==(l=t.globals.prevStreamFrame.seriesY)?void 0:l[i],f=null==(h=t.seriesData.series)?void 0:h[i];if(g.length<2||f.length<2)return null;if(g.some(t=>null===t)||f.some(t=>null===t))return null;const m=function(t,e){const i=new Set(t.exits),s=[];let a=0;for(let e=0;e<t.toOld.length;e++){const r=t.toOld[e];if(-1!==r){for(;a<r;)i.has(a)&&s.push({oldJ:a,newJ:-1}),a++;s.push({oldJ:r,newJ:e}),a=r+1}else s.push({oldJ:-1,newJ:e})}for(;a<e;)i.has(a)&&s.push({oldJ:a,newJ:-1}),a++;return s}(d,u.length),x={};return Array.isArray(r)&&1===r.length&&s&&(x.line=Di(s,r[0],m,u.length,p.length,!1)),"area"===e&&Array.isArray(n)&&1===n.length&&a&&(x.area=Di(a,n[0],m,u.length,p.length,!0)),x.line||x.area?x:null}const Vi=t=>1-Math.pow(1-t,3);function Gi({w:t,elSeries:e,record:i,newKeys:s,isHorizontal:a,speed:r}){var n;if(!Ti(t))return;if(!i||!Array.isArray(i.paths)||!(null==e?void 0:e.node))return;const o=new Set(s),l=i.paths.filter(t=>t&&t.d&&null!=t.key&&!o.has(t.key));if(!l.length)return;const h=new R(t),c=null==(n=t.globals.colors)?void 0:n[parseInt(String(i.realIndex),10)],d=e.node,u=d.ownerDocument.createDocumentFragment(),p=l.map(e=>{let i=e.fill||c||"#c8c8c8";0===String(i).indexOf("url(")&&(i=c||"#c8c8c8");const s=h.drawPath({d:e.d,stroke:"none",strokeWidth:0,fill:i,fillOpacity:1,classes:"apexcharts-bar-ghost"}),a=s.node;return a.setAttribute("pointer-events","none"),s.attr("clip-path",`url(#gridRectBarMask${t.globals.cuid})`),u.insertBefore(a,u.firstChild),a});d.insertBefore(u,d.firstChild);const g=p.map(t=>{try{return t.getBBox()}catch(t){return null}}),f=performance.now();l.forEach((e,s)=>{const n=p[s],o=g[s],l=function(t){const e=/^M\s*([+-]?[\d.eE]+)[\s,]+([+-]?[\d.eE]+)/.exec(t||"");if(!e)return null;const i=parseFloat(e[1]),s=parseFloat(e[2]);return isFinite(i)&&isFinite(s)?{x:i,y:s}:null}(e.d),h=!l||!o||(a?Math.abs(l.x-o.x)<=Math.abs(l.x-(o.x+o.width)):Math.abs(l.y-(o.y+o.height))<=Math.abs(l.y-o.y)),c=n.style;if(c.transformBox="fill-box",c.transformOrigin=a?h?"left center":"right center":h?"center bottom":"center top",n.setAttribute("data:ghostKey",`${i.realIndex}::${e.key}`),n.setAttribute("data:ghostStart",String(f)),o){const t=a?h?o.x:o.x+o.width:h?o.y+o.height:o.y;isFinite(t)&&n.setAttribute("data:ghostEdge",String(t))}Yi(t,Math.max(1,r||1),Vi,t=>{const e=1-t;c.transform=a?`scaleX(${e})`:`scaleY(${e})`,c.opacity=String(e)},()=>n.remove(),()=>n.parentNode,f)})}const qi=new WeakMap;function Zi(t,e){const i=t.globals.previousPaths;let s=qi.get(i);if(!s||s.n!==i.length){s={n:i.length,m:new Map};for(const t of i){const e=parseInt((t||{}).realIndex,10);if(e==e){const i=s.m.get(e);i?i.push(t):s.m.set(e,[t])}}qi.set(i,s)}return s.m.get(parseInt(String(e),10))||[]}class Ui{constructor(t,e,i){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=i,this.xRatio=0,this.yRatio=[],this.invertedXRatio=0,this.invertedYRatio=0,this.baseLineY=[],this.baseLineInvertedY=0,null!==this.xyRatios&&(this.xRatio=i.xRatio,this.yRatio=i.yRatio,this.invertedXRatio=i.invertedXRatio,this.invertedYRatio=i.invertedYRatio,this.baseLineY=i.baseLineY,this.baseLineInvertedY=i.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 W(this.w);this.lastActiveBarSerieIndex=s.getActiveConfigSeriesIndex("desc",["bar","column"]),this.lastActiveBarSerieIndexByGroup=s.getActiveConfigSeriesIndexByGroup(["bar","column"]),this.columnGroupIndices=[];const a=s.getBarSeriesIndices(),r=new P(this.w);this.stackedSeriesTotals=r.getStackedSeriesTotals(this.w.config.series.map((t,e)=>-1===a.indexOf(e)?e:-1).filter(t=>-1!==t)),this.barHelpers=new Pi(this)}setSeriesAxis(t){var e;return this.yRatio.length>1&&(this.yaxisIndex=this.w.globals.seriesYAxisReverseMap[t],this.translationsIndex=t),this.isReversed=null==(e=this.w.config.yaxis[this.yaxisIndex])?void 0:e.reversed,this.translationsIndex}draw(t,e){var i,s,a,r,n;const h=this.w,c=new R(this.w),d=new P(this.w);t=d.getLogSeries(t),this.series=t,this.yRatio=d.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t,e);const u=c.group({class:"apexcharts-bar-series apexcharts-plot-series"}),p=this.ctx.highlightFilter;h.config.dataLabels.enabled&&this.totalItems>this.barOptions.dataLabels.maxItems&&console.warn("WARNING: DataLabels are enabled but there are too many to display. This may cause performance issue when rendering - ApexCharts");for(let d=0,g=0;d<t.length;d++,g++){let f,m;const x=[],b=[],y=h.globals.comboCharts?e[d]:d,{columnGroupIndex:v}=this.barHelpers.getGroupIndex(y),w=c.group({class:"apexcharts-series",rel:d+1,seriesName:Zt.escapeString(h.seriesData.seriesNames[y]),"data:realIndex":y});W.addCollapsedClassToSeries(this.w,w,y),t[d].length>0&&(this.visibleI=this.visibleI+1);const _=this.setSeriesAxis(y);this.isPyramid&&(this.pyramidLayout=this.barHelpers.computePyramidLayout(t[d]));const A=this.barHelpers.initialPositions(y),{y:S,yDivision:C,zeroW:k,x:P,xDivision:L,zeroH:M}=A;let I=A.barHeight,E=A.barWidth;m=S,f=P,this.isHorizontal||b.push(f+(null!=E?E:0)/2);const F=c.group({class:"apexcharts-datalabels","data:realIndex":y}),T=h.config.dataLabels,R=!(null==(i=T.animate)?void 0:i.enabled)&&this.isLengthTransition(y);h.globals.dataChanged&&!R&&!(!(null==(s=T.animate)?void 0:s.enabled)&&!(null==(a=T.countUp)?void 0:a.enabled))||(h.globals.delayedElements.push({el:F.node,holdUntilComplete:R}),F.node.classList.add("apexcharts-element-hidden"));const z=c.group({class:"apexcharts-bar-goals-markers"}),X=c.group({class:"apexcharts-bar-shadows"}),O=this.ctx,$=O._barShadows,Y=O._barShadows=[],H=h.globals.dataChanged&&h.globals.shouldAnimate&&h.config.chart.animations.dynamicAnimation.enabled&&(null==$?void 0:$.length)===t[d].length-1;H||(h.globals.delayedElements.push({el:X.node}),X.node.classList.add("apexcharts-element-hidden"));for(let e=0;e<t[d].length;e++){const i=this.barHelpers.getStrokeWidth(d,e,y);let s=null;const a={indexes:{i:d,j:e,realIndex:y,translationsIndex:_,bc:g},x:f,y:m,strokeWidth:i,elSeries:w};this.isHorizontal?(s=this.drawBarPaths(l(o(o({},a),this.barHelpers.rows&&{y:S+this.barHelpers.barRow(y,e)*C}),{barHeight:I,zeroW:k,yDivision:C})),E=this.series[d][e]/this.invertedYRatio):(s=this.drawColumnPaths(l(o({},a),{xDivision:L,barWidth:E,zeroH:M})),I=this.series[d][e]/this.yRatio[_]);const c=this.barHelpers.getPathFillColor(t,d,e,y);if(this.isFunnel&&!this.isPyramid&&this.barOptions.isFunnel3d&&"trapezoid"!==(null==(r=h.config.plotOptions.funnel)?void 0:r.shape)&&this.pathArr.length&&e>0){const t=this.barHelpers.drawBarShadow({color:"string"==typeof c.color&&-1===(null==(n=c.color)?void 0:n.indexOf("url"))?c.color:Zt.hexToRgba(h.globals.colors[d]),prevPaths:this.pathArr[this.pathArr.length-1],currPaths:s,realIndex:y,j:e});if(X.add(t),Y.push(t),this._shadow=H&&[t,$[e-1].attr("d")],h.config.chart.dropShadow.enabled){new D(this.w).dropShadow(t,h.config.chart.dropShadow,y)}}this.pathArr.push(s);const u=this.barHelpers.drawGoalLine({barXPosition:s.barXPosition,barYPosition:s.barYPosition,goalX:s.goalX,goalY:s.goalY,barHeight:I,barWidth:E});u&&z.add(u),m=s.y,f=s.x,e>0&&b.push(f+(null!=E?E:0)/2),x.push(m),this.renderSeries(l(o({hl:null==p?void 0:p.bar(this,{i:d,j:e,realIndex:y,translationsIndex:_,paths:s,zeroH:M,zeroW:k}),realIndex:y,pathFill:c.color},c.useRangeColor?{lineFill:c.color}:{}),{j:e,i:d,columnGroupIndex:v,pathFrom:s.pathFrom,pathTo:s.pathTo,strokeWidth:i,elSeries:w,x:f,y:m,series:t,barHeight:Math.abs(s.barHeight?s.barHeight:I),barWidth:Math.abs(s.barWidth?s.barWidth:E),barXPosition:s.barXPosition,elDataLabelsWrap:F,elGoalsMarkers:z,elBarShadows:X,visibleSeries:this.visibleI,type:"bar"}))}h.globals.seriesXvalues[y]=b,h.globals.seriesYvalues[y]=x,h.globals.previousPaths.length>0&&Gi({w:h,elSeries:w,record:this._prevRecord(y),newKeys:this._keys(y),isHorizontal:this.isHorizontal,speed:h.config.chart.animations.dynamicAnimation.speed}),u.add(w)}return u}renderSeries({hl:t,realIndex:e,pathFill:i,lineFill:s,j:a,i:r,columnGroupIndex:n,pathFrom:h,pathTo:c,strokeWidth:d,elSeries:g,x:f,y:m,y1:x,y2:b,series:y,barHeight:v,barWidth:w,barXPosition:_,barYPosition:A,elDataLabelsWrap:S,elGoalsMarkers:C,elBarShadows:k,visibleSeries:P,type:L,classes:M,fadeReveal:I=!1,noLabel:E}){var F,T,z,X,O,$,W;const Y=this.w,H=new R(this.w,this.ctx),B=si(this.ctx,H);let N=!1;const j=this._pathToInterp;if(this._pathToInterp=null,g._bindingsDelegated||(g._bindingsDelegated=!0,H.setupEventDelegation(g,`.apexcharts-${L}-area`)),!s){let t=function(t){const e=Y.config.stroke.colors;let i;return Array.isArray(e)&&e.length>0&&(i=e[t],i||(i=""),"function"==typeof i)?i({value:Y.seriesData.series[t][a],dataPointIndex:a,w:Y}):i};const i="function"==typeof Y.globals.stroke.colors[e]?t(e):Y.globals.stroke.colors[e];s=this.barOptions.distributed?Y.globals.stroke.colors[a]:i}const V=Y.config.chart.animations,G=V.animateGradually;let q=0,Z=0;if(G&&!1!==G.enabled&&!(Y.globals.dataChanged&&this.isLayoutShift(e))){const t=Y.globals.dataPoints||1,e=G.delay||0,i=Math.min(e,.5*V.speed/Math.max(1,t));Z=p({style:"sequential",index:a,baseDelay:i}),Y.config.chart.stacked&&!Y.globals.dataChanged&&(Z+=r*i*.5);q=Z/(e||1)}const U=new Ci(this).handleBarDataLabels({x:f,y:m,y1:x,y2:b,i:r,j:a,series:y,realIndex:e,columnGroupIndex:n,barHeight:v,barWidth:w,barXPosition:_,barYPosition:A,visibleSeries:P,hl:null==t?void 0:t.label,noLabel:E});if(Z>0){const t=Y.config.dataLabels;if((null==(F=t.animate)?void 0:F.enabled)||(null==(T=t.countUp)?void 0:T.enabled)){const t=String(Math.round(Z));null==(X=null==(z=U.dataLabels)?void 0:z.node)||X.setAttribute("data:dlDelay",t),null==($=null==(O=U.totalDataLabels)?void 0:O.node)||$.setAttribute("data:dlDelay",t)}}let K=!1;if(!Y.globals.isBarHorizontal){const t=void 0===_?U.dataLabelsPos.dataLabelsX:_+w/2,i=Math.max(w,Y.globals.barPadForNumericAxis);(t+i<0||t-i>Y.layout.gridWidth)&&(this._wasOnScreen(e,a)?K=!0:N=!0)}const J=Y.config.series[e].data[a];J&&J.strokeColor&&(s=J.strokeColor);const Q=i;if(this.isNullValue&&-1===Y.globals.collapsingSeriesIndices.indexOf(e)&&(i="none"),!N){const n=!0===(null==(W=this.ctx.morphTypeChange)?void 0:W.isActive()),p=n?this.ctx.morphTypeChange.getSpeed():Y.config.chart.animations.dynamicAnimation.speed,f=n&&this.ctx.morphTypeChange.claimsTargetMark(e,a);f&&(h=c,q=0);const m=B.renderPaths({i:r,j:a,realIndex:e,pathFrom:h,pathTo:c,stroke:s,strokeWidth:d,strokeLinecap:Y.config.stroke.lineCap,fill:i,pathToInterp:j,animationDelay:q,initialSpeed:Y.config.chart.animations.speed,dataChangeSpeed:p,className:`apexcharts-${L}-area${M?` ${M}`:""}`,chartType:L,bindEventsOnPaths:!1,fadeReveal:I});m.attr("clip-path",`url(#gridRectBarMask${Y.globals.cuid})`),K&&m.node.classList.add("apexcharts-leaving");const y=this._shadow;y&&(this._shadow=null,new u(Y,this.ctx).animatePathsGradually({el:y[0],fill:"none",pathFrom:y[1],pathTo:y[0].attr("d"),speed:p,delay:q})),f&&(m.node.setAttribute("opacity","0"),m.node.setAttribute("data-piece-hidden","1"));const _=Y.config.forecastDataPoints;_.count>0&&a>=Y.globals.dataPoints-_.count&&(m.node.setAttribute("stroke-dasharray",_.dashArray),m.node.setAttribute("stroke-width",_.strokeWidth),m.node.setAttribute("fill-opacity",_.fillOpacity)),void 0!==x&&void 0!==b&&(m.attr("data-range-y1",x),m.attr("data-range-y2",b));if(new D(this.w).setSelectionFilter(m,e,a),g.add(m),m.attr({cy:U.dataLabelsPos.bcy,cx:U.dataLabelsPos.bcx,j:a,val:Y.seriesData.series[e][a],barHeight:v,barWidth:w,"data:pathKey":this._keys(e)[a]}),null==t||t.paint(m,{delay:q,delayMs:Z,speed:p,fill:Q,elSeries:g,elBarShadows:k,labels:U.dataLabels,pathFrom:h,pathTo:c}),"canvas"===B.kind){Y.globals.barCanvasCoords||(Y.globals.barCanvasCoords={}),Y.globals.barCanvasCoords[e]||(Y.globals.barCanvasCoords[e]={});const t=Y.globals.barCanvasCoords[e][a];let i=(null==t?void 0:t.bounds)||null;const s=m.bbox();(s.width>0||s.height>0)&&(i={left:Math.min(i?i.left:1/0,s.x),top:Math.min(i?i.top:1/0,s.y),right:Math.max(i?i.right:-1/0,s.x+s.width),bottom:Math.max(i?i.bottom:-1/0,s.y+s.height)}),Y.globals.barCanvasCoords[e][a]=l(o({cx:U.dataLabelsPos.bcx,cy:U.dataLabelsPos.bcy,barWidth:w,type:L},void 0!==x&&void 0!==b&&{rangeY1:x,rangeY2:b}),{bounds:i})}null!==U.dataLabels&&S.add(U.dataLabels),U.totalDataLabels&&S.add(U.totalDataLabels),g.add(S),C&&g.add(C),k&&g.add(k)}return g}drawBarPaths({indexes:t,barHeight:e,strokeWidth:i,zeroW:s,x:a,y:r,yDivision:n,elSeries:o}){const l=this.w,h=t.i,c=t.j;let d;if(l.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:i,zeroEncounters:s}=this.barHelpers.getZeroValueEncounters({i:t.realIndex,j:c});i>0&&(e=this.seriesLen*e/i),d=r+e*this.visibleI,d-=e*s}else d=r+e*this.visibleI;const u=this.isFunnel&&"trapezoid"===l.config.plotOptions.funnel.shape,p=this.isPyramid&&this.pyramidLayout?this.pyramidLayout[c]:null,g=!!p;if(p)d=p.y,e=p.height;else if(this.isFunnel&&!u){const t=null!=s?s:0;s=t-(this.barHelpers.getXForValue(this.series[h][c],t)-t)/2}let f;return a=this.barHelpers.getXForValue(this.series[h][c],null!=s?s:0),f=p?this.barHelpers.getPyramidPaths({barYPosition:d,barHeight:e,topHalf:p.topHalf,bottomHalf:p.bottomHalf,realIndex:t.realIndex,j:c,strokeWidth:i,w:l}):u?this.barHelpers.getFunnelTrapezoidPaths({barYPosition:d,barHeight:e,series:this.series,i:h,j:c,realIndex:t.realIndex,strokeWidth:i,w:l}):this.barHelpers.getBarpaths({barYPosition:d,barHeight:e,x1:s,x2:a,strokeWidth:i,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:h,j:c,w:l}),(u||g)&&(s=f.x1,a=f.x),g||(r+=n),g&&(r=d),this.barHelpers.barBackground({j:c,i:h,y1:d-e*this.visibleI,y2:e*this.seriesLen,elSeries:o}),{pathTo:f.pathTo,pathFrom:f.pathFrom,x1:s,x:a,y:r,goalX:this.barHelpers.getGoalValues("x",s,null,t.realIndex,c,0),barYPosition:d,barHeight:e}}drawColumnPaths({indexes:t,x:e,y:i,xDivision:s,barWidth:a,zeroH:r,strokeWidth:n,elSeries:o}){const l=this.w,h=t.realIndex,c=t.translationsIndex,d=t.i,u=t.j,p=t.bc;let g;if(l.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:u,realIndex:h,barWidth:a});e=t.x,g=t.barXPosition}else if(l.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:i}=this.barHelpers.getZeroValueEncounters({i:h,j:u});t>0&&(a=this.seriesLen*a/t),g=e+a*this.visibleI,g-=a*i}else g=e+a*this.visibleI;i=this.barHelpers.getYForValue(this.series[d][u],r,c);const f=this.barHelpers.getColumnPaths({barXPosition:g,barWidth:a,y1:r,y2:i,strokeWidth:n,isReversed:this.isReversed,series:this.series,realIndex:h,i:d,j:u,w:l});return l.axisFlags.isXNumeric||(e+=s),this.barHelpers.barBackground({bc:p,j:u,i:d,x1:g-n/2-a*this.visibleI,x2:a*this.seriesLen+n/2,elSeries:o}),{pathTo:f.pathTo,pathFrom:f.pathFrom,x:e,y:i,goalY:this.barHelpers.getGoalValues("y",null,r,h,u,c),barXPosition:g,barWidth:a}}getBarXForNumericXAxis({x:t,barWidth:e,realIndex:i,j:s}){const a=this.w,r=ki(a);let n=i;return a.seriesData.seriesX[i].length||(n=a.globals.maxValsInArrayIndex),Zt.isNumber(a.seriesData.seriesX[n][s])&&(t=ge.dataXToPx(a,a.seriesData.seriesX[n][s])-e*(r?1:this.seriesLen)/2),{barXPosition:t+(r?0:e*this.visibleI),x:t}}_wasOnScreen(t,e){if(!Ti(this.w))return!1;const i=this._prevKeyedPaths(t);return!!i&&i.has(this._keys(t)[e])}_keys(t){const e=this._keyCache||(this._keyCache={});return e[t]||(e[t]=Oi(this.w,t))}_prevRecord(t){const e=Zi(this.w,t);for(let t=e.length-1;t>=0;t--)if(e[t].paths&&e[t].paths.length>0)return e[t];return null}_pathFromUsed(){var t;const e=this.w,i=e.highlightData,s=e.globals.prevHighlightParts;if(i&&(i.active||(null==s?void 0:s.size)))return!0;const a=null==(t=this.ctx)?void 0:t.renderer;if(a&&a.kind&&"svg"!==a.kind)return!1;const r=new R(e,this.ctx).revealPlan("",this._fadeReveal);return r.animate&&!r.fade}_prevKeyedPaths(t){if(this._prevKeyed||(this._prevKeyed={}),void 0!==this._prevKeyed[t])return this._prevKeyed[t];const e=this._prevRecord(t);let i=null;if(e&&e.paths.every(t=>null!=t.key)){const t=new Map;e.paths.forEach(e=>{t.set(e.key,e)}),i=t}return this._prevKeyed[t]=i,i}isLengthTransition(t){var e,i,s,a,r,n;if(this._ltCache||(this._ltCache={}),void 0!==this._ltCache[t])return this._ltCache[t];const o=this.w;let l=!1;if(Ti(o)&&o.globals.previousPaths.length>0){const h=this._prevRecord(t),c=null!=(i=null==(e=o.seriesData.series[t])?void 0:e.length)?i:0,d=h&&this._prevKeyedPaths(t);if(h)if(d){const e=new Set(this._keys(t));l=(null!=(n=null==(r=null==(a=null==(s=o.globals.prevStreamFrame)?void 0:s.seriesY)?void 0:a[t])?void 0:r.length)?n:c)!==c||[...d.keys()].some(t=>!e.has(t))}else l=h.paths.length!==c;else l=c>0}return this._ltCache[t]=l,l}isLayoutShift(t){if(this.isLengthTransition(t))return!0;if(this._layoutShiftCache||(this._layoutShiftCache={}),void 0!==this._layoutShiftCache[t])return this._layoutShiftCache[t];const e=$i(this.w,t,!0,!0),i=!(!e||!e.join.changed);return this._layoutShiftCache[t]=i,i}getPreviousPath(t,e,i,s){const a=this.w;if(this._pathToInterp=null,!this._pathFromUsed())return i;const r=this._prevRecord(t);if(!r)return Ti(a)?null:i;let n=null,o=!1;const l=this._prevKeyedPaths(t);if(l){const i=l.get(this._keys(t)[e]);i?n=i.d:o=!0}else void 0!==r.paths[e]?n=r.paths[e].d:o=!0;return n?this.cornerMorph(n,i,s):o&&Ti(a)?null:i}cornerMorph(t,e,i){const s=Ui.pathCommandCount(t),a=Ui.pathCommandCount(e);if(s===a)return t;const r=new R(this.w),n=t=>{const e=Ui.pathBox(t);return e?Math.min(e.maxX-e.minX,e.maxY-e.minY):0},o=s<a?n(t)>1:n(e)>1;if(s<a){const e=r.roundPathCorners(t,0);if(Ui.pathCommandCount(e)===a){if(o&&i){const t=r.roundPathCorners(i,0);Ui.pathCommandCount(t)===a&&(this._pathToInterp=t)}return e}}else{const i=r.roundPathCorners(e,0);if(Ui.pathCommandCount(i)===s){if(this._pathToInterp=i,o){const e=Ui.squareLike(t),i=e?r.roundPathCorners(e,0):null;if(i&&Ui.pathCommandCount(i)===s)return i}return t}}return e}static pathBox(t){if(!t)return null;const e=[],i=/([MLC])([^MLCZz]*)/g;let s;for(;null!==(s=i.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 a=e.map(t=>t[0]),r=e.map(t=>t[1]);return{minX:Math.min(...a),maxX:Math.max(...a),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=Ui.pathBox(t);if(!e)return null;const{minX:i,maxX:s,minY:a,maxY:r,start:n,vertical:o}=e,l=(t,e,i)=>Math.abs(t-e)<=Math.abs(t-i)?[e,i]:[i,e];let h,c,d,u;o?(h=Math.abs(n[0]-i)<=Math.abs(n[0]-s)?i:s,c=h===i?s:i,[d,u]=l(n[1],a,r)):(d=Math.abs(n[1]-a)<=Math.abs(n[1]-r)?a:r,u=d===a?r:a,[h,c]=l(n[0],i,s));const p=t.trim().endsWith("Z")?" Z":" z";return o?`M ${h} ${d} L ${h} ${u} L ${c} ${u} L ${c} ${d}${p}`:`M ${h} ${d} L ${c} ${d} L ${c} ${u} L ${h} ${u}${p}`}getPreviousFlip(t,e){const i=this._prevRecord(t);if(!i)return null;const s=this._prevKeyedPaths(t),a=s?s.get(this._keys(t)[e]):i.paths[e];return a?!!a.flip:null}static pathCommandCount(t){if(!t)return 0;const e=t.match(/[MmLlHhVvCcSsQqTtAaZz]/g);return e?e.length:0}}function Ki({points:t,extent:e,seedA:i,seedB:s,center:a,halfExtent:r,alongFn:n,isHorizontal:o,options:l,clampAt:h,sideSign:c}){var d,u;const p=l;if(!p||!1===p.show)return[];if(!t||!t.length)return[];const g=p.maxPoints||3e3,f=t.length>g?Math.ceil(t.length/g):1,m=null!=p.size?p.size:2.5,x=r*(null!=p.jitter?p.jitter:.5),b=!1!==p.constrainToViolin&&"function"==typeof h,y="square"===p.shape,v=p.colorScale,w=v&&Array.isArray(v.colors)&&v.colors.length>0,_=w?Math.max(2,v.steps||24):1,A=null!=(d=null==v?void 0:v.min)?d:e[0],S=(null!=(u=null==v?void 0:v.max)?u:e[1])-A||1,C=w?new Array(_).fill(""):[""];for(let e=0;e<t.length;e+=f){const r=t[e],l=n(r);let d=2*(es(7919*i+100003*s+e)-.5)*x;if(b){const t=h(r);d>t&&(d=t),d<-t&&(d=-t)}c&&(d=Math.abs(d)*c);const u=o?l:a+d,p=o?a+d:l,g=y?ss(u,p,m):is(u,p,m);if(w){let t=(r-A)/S;t<0&&(t=0),t>1&&(t=1),C[Math.round(t*(_-1))]+=g}else C[0]+=g}if(!w)return C[0]?[{fill:null,d:C[0]}]:[];const k=[];for(let t=0;t<_;t++)C[t]&&k.push({fill:ts(v.colors,t/(_-1)),d:C[t]});return k}function Ji({graphics:t,w:e,elSeries:i,pointsByCat:s,options:a,distributed:r,realIndex:n,wrapClass:o,pointClass:l}){if(!a||!1===a.show||!s.length)return;const h=null!=a.opacity?a.opacity:.9,c=null!=a.strokeColor?a.strokeColor:"#fff",d=null!=a.strokeWidth?a.strokeWidth:1,u=e.config.chart.animations.enabled&&!e.globals.resized&&!e.globals.dataChanged,p=t.group({class:u?`${o} apexcharts-element-hidden`:o});u&&e.globals.delayedElements.push({el:p.node}),s.forEach(({groups:i,j:s})=>{const o=r?e.globals.colors[s]:e.globals.colors[n],u=a.fillColor,g="series"===u?o:"series-dark"===u?Qi(o,.45):u||Qi(o,.45);i.forEach(i=>{const a=t.drawPath({d:i.d,fill:null!=i.fill?i.fill:g,stroke:d>0?c:"none",strokeWidth:d,fillOpacity:h,classes:l});a.attr("data:realIndex",n),a.attr("j",s),a.attr("clip-path",`url(#gridRectBarMask${e.globals.cuid})`),a.node.style.pointerEvents="none",p.add(a)})}),i.add(p)}function Qi(t,e){const i=Zt.parseColor(t)||Zt.parseColor(Zt.resolveColor(t));if(!i)return t;const s=Math.max(0,1-e);return`rgb(${Math.round(i[0]*s)},${Math.round(i[1]*s)},${Math.round(i[2]*s)})`}function ts(t,e){if(!t.length)return"#000";if(1===t.length)return t[0];const i=Math.max(0,Math.min(1,e))*(t.length-1),s=Math.floor(i),a=i-s,r=Zt.parseHex(t[s])||[0,0,0],n=Zt.parseHex(t[Math.min(s+1,t.length-1)])||r,o=(t,e)=>Math.round(t+(e-t)*a);return`rgb(${o(r[0],n[0])},${o(r[1],n[1])},${o(r[2],n[2])})`}function es(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 is(t,e,i){return`M ${t-i} ${e} a ${i} ${i} 0 1 0 ${2*i} 0 a ${i} ${i} 0 1 0 ${-2*i} 0 `}function ss(t,e,i){return`M ${t-i} ${e-i} h ${2*i} v ${2*i} h ${-2*i} z `}class as extends Ui{_identityLost(t,e){if(!Ti(this.w))return!1;const i=this._prevKeyedPaths(t);if(!i||0===i.size||!e||0===e.length)return!1;let s=0;for(let a=0;a<e.length;a++)i.has(this._keys(t)[a])&&s++;return s/i.size<.5}_prevBoxHalf(t,e,i){if(!this.isBoxPlot||!this._pathFromUsed())return null;this._prevHalves||(this._prevHalves={});let s=this._prevHalves[t];if(void 0===s){s=null;const e=this._prevRecord(t);if(e&&e.paths.every(t=>null!=t.key)){s=new Map;for(const t of e.paths){const e=s.get(t.key)||[];e.push(t.d),s.set(t.key,e)}}this._prevHalves[t]=s}const a=s&&s.get(this._keys(t)[e]);return a&&2===a.length?a[i]:null}draw(t,e,i){var s,a;const r=this.w,n=new R(this.w),h=r.globals.comboCharts?e:r.config.chart.type,c=new F(this.w);this.candlestickOptions=this.w.config.plotOptions.candlestick,this.boxOptions=this.w.config.plotOptions.boxPlot,this.isHorizontal=r.config.plotOptions.bar.horizontal,this.coreUtils=new P(this.w),t=this.coreUtils.getLogSeries(t),this.series=t,this.yRatio=this.coreUtils.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t,i);const d=n.group({class:`apexcharts-${h}-series apexcharts-plot-series`});this.isBoxPlot="boxPlot"===h,this.isOHLC=!this.isBoxPlot&&"ohlc"===(null==(s=this.candlestickOptions)?void 0:s.type);const u=function(t,e){let i=1/0,s=-1/0;return t.slice(0,e.seriesData.series.length).flat(2).forEach(t=>{t===+t&&(t<i&&(i=t),t>s&&(s=t))}),[i,s]}(r.candleData.seriesBoxPoints,r);for(let e=0;e<t.length;e++){let s,p;const g=[],f=[],m=r.globals.comboCharts?i[e]:e,{columnGroupIndex:x}=this.barHelpers.getGroupIndex(m),b=n.group({class:"apexcharts-series",seriesName:Zt.escapeString(r.seriesData.seriesNames[m]),rel:e+1,"data:realIndex":m});W.addCollapsedClassToSeries(this.w,b,m),t[e].length>0&&(this.visibleI=this.visibleI+1);const y=this.setSeriesAxis(m),v=this.barHelpers.initialPositions(m),{y:w,barHeight:_,yDivision:A,zeroW:S,x:C,barWidth:k,xDivision:P,zeroH:L}=v;p=w,s=C,f.push(s+(null!=k?k:0)/2);const M=n.group({class:"apexcharts-datalabels","data:realIndex":m}),I=n.group({class:"apexcharts-bar-goals-markers"}),E=this.isBoxPlot?this.boxOptions.points:null,F=[],D=r.layout.gridWidth,T=Math.max(null!=k?k:0,r.globals.barPadForNumericAxis||0),R=0===t[e].length?0:r.globals.dataPoints,z=this._identityLost(m,t[e]);this._fadeReveal=z;for(let i=0;i<R;i++){const n=this.barHelpers.getStrokeWidth(e,i,m);let d=null;const v={indexes:{i:e,j:i,realIndex:m,translationsIndex:y},x:s,y:p,strokeWidth:n,elSeries:b};if(d=this.isHorizontal?this.drawHorizontalBoxPaths(l(o({},v),{yDivision:A,barHeight:_,zeroW:S})):this.drawVerticalBoxPaths(l(o({},v),{xDivision:P,barWidth:k,zeroH:L,cullBounds:{lo:-T,hi:D+T}})),p=d.y,s=d.x,i>0&&f.push(s+(null!=k?k:0)/2),g.push(p),d.culled)continue;const w=this.barHelpers.drawGoalLine({barXPosition:d.barXPosition,barYPosition:d.barYPosition,goalX:d.goalX,goalY:d.goalY,barHeight:_,barWidth:k});if(w&&I.add(w),d.pathTo.forEach((a,o)=>{var l;const u=!this.isBoxPlot&&this.candlestickOptions.wick.useFillColor?d.color[o]:r.globals.stroke.colors[m],g=c.fillPath({seriesNumber:m,dataPointIndex:i,color:d.color[o],value:t[e][i]});this.renderSeries({realIndex:m,pathFill:g,lineFill:u,j:i,i:e,pathFrom:null!=(l=this._prevBoxHalf(m,i,o))?l:d.pathFrom,fadeReveal:z,noLabel:o>0,pathTo:a,strokeWidth:n,elSeries:b,x:s,y:p,series:t,columnGroupIndex:x,barHeight:_,barWidth:k,elDataLabelsWrap:M,elGoalsMarkers:I,visibleSeries:this.visibleI,type:h})}),E&&!1!==E.show){const t=null==(a=r.candleData.seriesBoxPoints[m])?void 0:a[i];if(t&&t.length){const e=t=>this.coreUtils.getLogValAtSeriesIndex(t,m);let s,a,r;if(this.isHorizontal){const t=this.invertedYRatio*(this.isReversed?-1:1),i=null!=_?_:0,n=null!=S?S:0;s=d.barYPosition+i/2,a=i/2,r=i=>n+e(i)/t}else{const t=this.yRatio[y]*(this.isReversed?-1:1),i=null!=k?k:0,n=null!=L?L:0;s=d.barXPosition+i/2,a=i/2,r=i=>n-e(i)/t}const n=Ki({points:t,extent:u,seedA:m,seedB:i,center:s,halfExtent:a,alongFn:r,isHorizontal:this.isHorizontal,options:E});n.length&&F.push({groups:n,j:i})}}}E&&Ji({graphics:n,w:r,elSeries:b,pointsByCat:F,options:E,distributed:r.config.plotOptions.bar.distributed,realIndex:m,wrapClass:"apexcharts-boxPlot-points-wrap",pointClass:"apexcharts-boxPlot-points"}),r.globals.seriesXvalues[m]=f,r.globals.seriesYvalues[m]=g,r.globals.previousPaths.length>0&&!z&&Ti(r)&&Gi({w:r,elSeries:b,record:this._prevRecord(m),newKeys:this._keys(m).filter((i,s)=>null!=t[e][s]),isHorizontal:this.isHorizontal,speed:r.config.chart.animations.dynamicAnimation.speed}),d.add(b)}return d}drawVerticalBoxPaths({indexes:t,x:e,xDivision:i,barWidth:s,zeroH:a,strokeWidth:r,cullBounds:n=null}){var o,l,h;const c=this.w,d=new R(this.w),u=t.i,p=t.j,{colors:g}=c.config.plotOptions.candlestick,{colors:f}=this.boxOptions,m=t.realIndex,x=t=>Array.isArray(t)?t[m]:t,b=x(g.upward),y=x(g.downward),v=this.yRatio[t.translationsIndex]*(this.isReversed?-1:1),w=this.getOHLCValue(m,p);let _=a,A=a,S=w.o<w.c?[b]:[y];this.isBoxPlot&&(S=[x(f.lower),x(f.upper)]);let C=Math.min(w.o,w.c),k=Math.max(w.o,w.c),P=w.m,L=e+s*this.visibleI;if(c.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,barWidth:s,realIndex:m,j:p});e=t.x,L=t.barXPosition}const M=null==(null==(o=this.series[u])?void 0:o[p]);if(M?(C=a,k=a):(C=a-C/v,k=a-k/v,_=a-w.h/v,A=a-w.l/v,P=a-w.m/v),M||n&&(L+s<n.lo||L>n.hi)&&!this._wasOnScreen(m,p))return{pathTo:null,pathFrom:null,x:c.axisFlags.isXNumeric?e:e+i,y:k,barXPosition:L,color:S,culled:!0};let I;if(this.isOHLC){const t=L+s/2,e=a-w.o/v,i=a-w.c/v;I=[d.move(t,_)+d.line(t,A)+d.move(t,e)+d.line(L,e)+d.move(t,i)+d.line(L+s,i)]}else I=this.isBoxPlot?[d.move(L,C)+d.line(L+s/2,C)+d.line(L+s/2,_)+d.line(L+s/4,_)+d.line(L+s-s/4,_)+d.line(L+s/2,_)+d.line(L+s/2,C)+d.line(L+s,C)+d.line(L+s,P)+d.line(L,P)+d.line(L,C+r/2),d.move(L,P)+d.line(L+s,P)+d.line(L+s,k)+d.line(L+s/2,k)+d.line(L+s/2,A)+d.line(L+s-s/4,A)+d.line(L+s/4,A)+d.line(L+s/2,A)+d.line(L+s/2,k)+d.line(L,k)+d.line(L,P)+"z"]:[d.move(L,k)+d.line(L+s/2,k)+d.line(L+s/2,_)+d.line(L+s/2,k)+d.line(L+s,k)+d.line(L+s,C)+d.line(L+s/2,C)+d.line(L+s/2,A)+d.line(L+s/2,C)+d.line(L,C)+d.line(L,k-r/2)];let E=null;const F=null==(h=null==(l=this.ctx)?void 0:l.morphTypeChange)?void 0:h.getInitialPathFor(m,p);return F?E=F:c.globals.previousPaths.length>0&&(E=this.getPreviousPath(m,p,I[0])),null==E&&(E=d.move(L+s/2,C)+d.move(L,C)),c.axisFlags.isXNumeric||(e+=i),{pathTo:I,pathFrom:E,x:e,y:k,goalY:this.barHelpers.getGoalValues("y",null,a,m,p,t.translationsIndex),barXPosition:L,color:S}}drawHorizontalBoxPaths({indexes:t,y:e,yDivision:i,barHeight:s,zeroW:a,strokeWidth:r}){var n,o,l;const h=this.w,c=new R(this.w),d=t.i,u=t.j,p=t.realIndex,{colors:g}=h.config.plotOptions.candlestick,{colors:f}=this.boxOptions,m=t=>Array.isArray(t)?t[p]:t,x=this.invertedYRatio*(this.isReversed?-1:1),b=this.getOHLCValue(p,u);let y=b.o<b.c?[m(g.upward)]:[m(g.downward)];this.isBoxPlot&&(y=[m(f.lower),m(f.upper)]);let v=a,w=a,_=Math.min(b.o,b.c),A=Math.max(b.o,b.c),S=b.m;const C=e+s*this.visibleI,k=null==(null==(n=this.series[d])?void 0:n[u]);k?(_=a,A=a):(_=a+_/x,A=a+A/x,v=a+b.h/x,w=a+b.l/x,S=a+b.m/x);const P=[c.move(_,C)+c.line(_,C+s/2)+c.line(v,C+s/2)+c.line(v,C+s/2-s/4)+c.line(v,C+s/2+s/4)+c.line(v,C+s/2)+c.line(_,C+s/2)+c.line(_,C+s)+c.line(S,C+s)+c.line(S,C)+c.line(_+r/2,C),c.move(S,C)+c.line(S,C+s)+c.line(A,C+s)+c.line(A,C+s/2)+c.line(w,C+s/2)+c.line(w,C+s-s/4)+c.line(w,C+s/4)+c.line(w,C+s/2)+c.line(A,C+s/2)+c.line(A,C)+c.line(S,C)+"z"];let L=null;const M=null==(l=null==(o=this.ctx)?void 0:o.morphTypeChange)?void 0:l.getInitialPathFor(p,u);return M?L=M:h.globals.previousPaths.length>0&&(L=this.getPreviousPath(p,u,P[0])),null==L&&(L=c.move(_,C+s/2)+c.move(_,C)),{pathTo:P,pathFrom:L,x:A,y:e+=i,goalX:this.barHelpers.getGoalValues("x",a,null,p,u,0),barYPosition:C,color:y,culled:k}}getOHLCValue(t,e){const i=this.w,s=this.coreUtils,a=i=>i[t]&&null!=i[t][e]?s.getLogValAtSeriesIndex(i[t][e],t):0,r=a(i.candleData.seriesCandleH),n=a(i.candleData.seriesCandleO),o=a(i.candleData.seriesCandleM),l=a(i.candleData.seriesCandleC),h=a(i.candleData.seriesCandleL);return{o:this.isBoxPlot?r:n,h:this.isBoxPlot?n:r,m:o,l:this.isBoxPlot?l:h,c:this.isBoxPlot?h:l}}}class rs{constructor(t,e){this.ctx=e,this.w=t}checkColorRange(){const t=this.w;return this.rowExt=[],t.config.plotOptions[t.config.chart.type].colorScale.ranges.some(t=>t.from<=0)}getShadeColor(t,e,i,s){const a=this.w,r=a.config.plotOptions[t],n=r.shadeIntensity,o=1.25*n,l=this.determineColor(t,e,i),h=l.percent/100;let c;c=a.globals.hasNegs||s?r.reverseNegativeShade?(h<0?h:1-h)*o:h<=0?1-(1+h)*n:(1-h)*n:"treemap"===t?(1-h)*o:1-h;let d=l.color;if(r.enableShades){const t=(new Zt).shadeColor("dark"===a.config.theme.mode?-c:c,d);d=Zt.hexToRgba(Zt.isColorHex(t)?t:Zt.rgb2hex(t),a.config.fill.opacity)}return{color:d,colorProps:l}}determineColor(t,e,i){const s=this.w,a=s.seriesData.series[e][i],r=s.config.plotOptions[t];let n=r.colorScale.inverse?i:e;r.distributed&&"treemap"===s.config.chart.type&&(n=i);let o,l,h=s.globals.colors[n],c=null;if(r.distributed||"heatmap"!==t){let t=this.rowExt[e];if(!t){const i=s.seriesData.series[e];o=i.length?i[0]:0,l=o;for(let t=1;t<i.length;t++)i[t]<o&&(o=i[t]),i[t]>l&&(l=i[t]);t=this.rowExt[e]=[o,l]}[o,l]=t}else o=s.globals.minY,l=s.globals.maxY;const d=r.colorScale.min,u=r.colorScale.max;void 0!==d&&void 0!==u&&u>d?(o=d,l=u):void 0!==d&&(o=d<s.globals.minY?d:s.globals.minY,l=u>s.globals.maxY?u:s.globals.maxY);const p=Math.abs(l)+Math.abs(o),g=Math.min(Math.max(a,o),l);let f=0===p?0:100*g/p;if(r.colorScale.ranges.length>0){r.colorScale.ranges.map(t=>{if(a>=t.from&&a<=t.to){h=t.color,c=t.foreColor?t.foreColor:null,o=t.from,l=t.to;const e=Math.abs(l)+Math.abs(o);f=0===e?0:100*a/e}})}return{color:h,foreColor:c,percent:f}}calculateDataLabels({text:t,x:e,y:i,i:s,j:a,colorProps:r,fontSize:n}){const o=this.w.config.dataLabels,l=new R(this.w),h=new I(this.w,this.ctx);let c=null;return o.enabled&&(c=l.group({class:"apexcharts-data-labels"}),h.plotDataLabelsText({x:e,y:i+parseFloat(o.style.fontSize)/3,text:t,i:s,j:a,color:r.foreColor,parent:c,fontSize:n,dataLabelsConfig:o})),c}}function ns(t){const e=t.globals;let i=e.minXDiff;if(!t.seriesData.series.some(t=>t.length>1)){const s=t.seriesData.seriesX.map(t=>t&&t[0]).filter(Number.isFinite).sort((t,e)=>t-e);i=1/0;for(let t=1;t<s.length;t++)s[t]>s[t-1]&&(i=Math.min(i,s[t]-s[t-1]));i===1/0&&(i=(e.maxX-e.minX)/4)}return Number.isFinite(i)&&i>0?i:0}class os{constructor(t){this.w=t.w,this.lineCtx=t}sameValueSeriesFix(t,e,i){const s=this.w,a=e[t];return"gradient"!==s.config.fill.type&&"gradient"!==s.config.fill.type[i]||!a.every(t=>t===a[0])||(e[t]=a.slice(),e[t][a.length-1]+=1e-6),e}calculatePoints({series:t,realIndex:e,x:i,y:s,i:a,j:r,prevY:n}){const o=this.w,l=[],h=[];let c=this.lineCtx.categoryAxisCorrection+o.config.markers.offsetX;return o.axisFlags.isXNumeric&&(c=(o.seriesData.seriesX[e][0]-o.globals.minX)/this.lineCtx.xRatio+o.config.markers.offsetX),0===r&&(l.push(c),h.push(Zt.isNumber(t[a][0])?n+o.config.markers.offsetY:null)),l.push(i+o.config.markers.offsetX),h.push(Zt.isNumber(t[a][r+1])?s+o.config.markers.offsetY:null),{x:l,y:h}}checkPreviousPaths({pathFromLine:t,pathFromArea:e,realIndex:i}){const s=this.w;for(const a of Zi(s,i))("line"===a.type||"area"===a.type)&&a.paths.length>0&&("line"===a.type?(this.lineCtx.appendPathFrom=!1,t=a.paths[0].d):"area"===a.type&&(this.lineCtx.appendPathFrom=!1,e=a.paths[0].d,s.config.stroke.show&&a.paths[1]&&(t=a.paths[1].d)));return{pathFromLine:t,pathFromArea:e}}previousRangeAreaPath(t){for(const e of Zi(this.w,t))if("rangeArea"===e.type&&1===e.paths.length&&e.paths[0].d)return e.paths[0].d;return null}determineFirstPrevY({i:t,realIndex:e,series:i,prevY:s,lineYPosition:a,translationsIndex:r}){var n,o,l;const h=this.w,c=h.config.chart.stacked&&!h.globals.comboCharts||h.config.chart.stacked&&h.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||"bar"===(null==(n=this.w.config.series[e])?void 0:n.type)||"column"===(null==(o=this.w.config.series[e])?void 0:o.type));if(void 0!==(null==(l=i[t])?void 0:l[0])){if(c)if(t>0){const t=this.lineCtx.stackTopAt(e,0);a=void 0===t?this.lineCtx.zeroY:t}else a=this.lineCtx.zeroY;else a=this.lineCtx.zeroY;s=a-i[t][0]/this.lineCtx.yRatio[r]+2*(this.lineCtx.isReversed?i[t][0]/this.lineCtx.yRatio[r]:0)}else if(c&&t>0&&void 0===i[t][0])for(let e=t-1;e>=0;e--)if(null!==i[e][0]&&void 0!==i[e][0]){s=a=this.lineCtx.prevSeriesY[e][0];break}return{prevY:s,lineYPosition:a}}}const ls=t=>{const e=function(t){const e=[];let i=t[0],s=t[1],a=e[0]=cs(i,s),r=1;for(let n=t.length-1;r<n;r++)i=s,s=t[r+1],e[r]=.5*(a+(a=cs(i,s)));return e[r]=a,e}(t),i=t.length-1,s=[];let a,r,n,o;for(let s=0;s<i;s++)n=cs(t[s],t[s+1]),Math.abs(n)<1e-6?e[s]=e[s+1]=0:(a=e[s]/n,r=e[s+1]/n,o=a*a+r*r,o>9&&(o=3*n/Math.sqrt(o),e[s]=o*a,e[s+1]=o*r));for(let a=0;a<=i;a++)o=(t[Math.min(i,a+1)][0]-t[Math.max(0,a-1)][0])/(6*(1+e[a]*e[a])),s.push([o||0,e[a]*o||0]);return s},hs={points(t){const e=ls(t),i=t[1],s=t[0],a=[],r=e[1],n=e[0];a.push(s,[s[0]+n[0],s[1]+n[1],i[0]-r[0],i[1]-r[1],i[0],i[1]]);for(let i=2,s=e.length;i<s;i++){const s=t[i],r=e[i];a.push([s[0]-r[0],s[1]-r[1],s[0],s[1]])}return a},slice(t,e,i){const s=t.slice(e,i);if(e){if(i-e>1&&s[1].length<6){const t=s[0].length;s[1]=[2*s[0][t-2]-s[0][t-4],2*s[0][t-1]-s[0][t-3]].concat(s[1])}s[0]=s[0].slice(-2)}return s}};function cs(t,e){return(e[1]-t[1])/(e[0]-t[0])}const ds=/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi;function us(t,e){const{ax:i,bx:s,ay:a,by:r}=e,n=[],o=/([MmLlHhVvCcSsQqTtAaZz])([^MmLlHhVvCcSsQqTtAaZz]*)/g;let l;for(;null!==(l=o.exec(t));){const t=l[1].toUpperCase(),e=(l[2].match(ds)||[]).map(parseFloat);if("Z"===t){n.push("z");continue}if("H"===t){for(const t of e)n.push(`H ${i*t+s}`);continue}if("V"===t){for(const t of e)n.push(`V ${a*t+r}`);continue}if("A"===t){for(let t=0;t+6<e.length;t+=7)n.push(`A ${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${i*e[t+5]+s} ${a*e[t+6]+r}`);continue}const o=[];for(let t=0;t+1<e.length;t+=2)o.push(`${i*e[t]+s} ${a*e[t+1]+r}`);o.length&&n.push(`${t} ${o.join(" ")}`)}return n.join(" ")}class ps{constructor(t,e,i,s){this.ctx=e,this.w=t,this.xyRatios=i,this.xRatio=0,this.yRatio=[],this.zRatio=0,this.baseLineY=[],this.pointsChart=!("bubble"!==this.w.config.chart.type&&"scatter"!==this.w.config.chart.type)||s,this.scatter=new d(this.w,this.ctx),this.noNegatives=this.w.globals.minX===Number.MAX_VALUE,this.lineHelpers=new os(this),this.markers=new z(this.w,this.ctx),this.prevSeriesY=[],this.prevSeriesYByX=new Map,this.categoryAxisCorrection=0,this.yaxisIndex=0,this.xDivision=0,this.zeroY=0,this.areaBottomY=0,this.strokeWidth=0,this.isReversed=!1,this.appendPathFrom=!1,this.elSeries=null,this.elPointsMain=null,this.elDataLabelsWrap=null,this._elLastPointsWrap=null,this._shapeOnly=!1}draw(t,e,i,s){var a;const r=this.w,n=this.ctx.highlightFilter,o=new R(this.w),l=r.globals.comboCharts?e:r.config.chart.type,h=o.group({class:`apexcharts-${l}-series apexcharts-plot-series`}),c=new P(this.w);if(this.yRatio=this.xyRatios.yRatio,this.zRatio=this.xyRatios.zRatio,this.xRatio=this.xyRatios.xRatio,this.baseLineY=this.xyRatios.baseLineY,t=c.getLogSeries(t,i),this.yRatio=c.getLogYRatios(this.yRatio),this.prevSeriesY=[],this.prevSeriesYByX=new Map,this._stackXs=null,r.config.chart.stacked&&r.axisFlags.isXNumeric){const e=t.map((t,e)=>r.globals.comboCharts?i[e]:e).filter(t=>!this._hidden(t)).map(t=>r.seriesData.seriesX[t]||[]);e.some(t=>t.length!==e[0].length||t.some((t,i)=>t!==e[0][i]))&&(this._stackXs=[...new Set(e.flat())].sort((t,e)=>t-e))}const d=[];for(let e=0;e<t.length;e++){const a=r.globals.comboCharts?i[e]:e;t=this.lineHelpers.sameValueSeriesFix(e,t,a);const o=this.yRatio.length>1?a:0,h=this._collapsedBaselineRow(t,e,a);this._shapeOnly=!!h,h&&((t=t.slice())[e]=h,"rangeArea"===l&&s&&((s=s.slice())[e]=h)),this._initSerieVariables(t,e,a),W.addCollapsedClassToSeries(this.w,this.elSeries,a);const c=this._buildSeriesPaths(l,t,e,a,o,i,s);this._handlePaths({type:l,realIndex:a,i:e,paths:c}),null==n||n.line(this,l,t,e,a,o,c),this.markers.flushBatch(this.elPointsMain,a),this.elSeries.add(this.elPointsMain),this.elSeries.add(this.elDataLabelsWrap),d.push(this.elSeries)}if(void 0!==(null==(a=r.config.series[0])?void 0:a.zIndex)&&d.sort((t,e)=>Number(t.node.getAttribute("zIndex"))-Number(e.node.getAttribute("zIndex"))),r.config.chart.stacked)for(let t=d.length-1;t>=0;t--)h.add(d[t]);else for(let t=0;t<d.length;t++)h.add(d[t]);return h}_buildSeriesPaths(t,e,i,s,a,r,n){const h=this.w,c=[],d=[],u=[];let p=h.globals.padHorizontal+this.categoryAxisCorrection;h.axisFlags.isXNumeric&&h.seriesData.seriesX.length>0&&(p=(h.seriesData.seriesX[s][0]-h.globals.minX)/this.xRatio),u.push(p);const g=p;let f,m=this.zeroY,x=this.zeroY;m=this.lineHelpers.determineFirstPrevY({i:i,realIndex:s,series:e,prevY:m,lineYPosition:0,translationsIndex:a}).prevY,"monotoneCubic"===h.config.stroke.curve&&null===e[i][0]?c.push(null):c.push(m);const b=m;let y;"rangeArea"===t&&(y=this.lineHelpers.determineFirstPrevY({i:i,realIndex:s,series:n,prevY:x,lineYPosition:0,translationsIndex:a}),x=y.prevY,f=x,d.push(null!==c[0]?x:null));const v=this._calculatePathsFrom(s,m),w=[c[0]],_=[d[0]],A={type:t,series:e,realIndex:s,translationsIndex:a,i:i,x:p,y:1,pX:g,pY:b,pathsFrom:v,linePaths:[],areaPaths:[],seriesIndex:r,lineYPosition:0,xArrj:u,yArrj:c,y2Arrj:d,seriesRangeEnd:n},S=this._iterateOverDataPoints(l(o({},A),{iterations:"rangeArea"===t?e[i].length-1:void 0,isRangeStart:!0}));if("rangeArea"===t){const t=this._calculatePathsFrom(s,x),e=this._iterateOverDataPoints(l(o({},A),{series:n,xArrj:[p],yArrj:w,y2Arrj:_,pY:f,areaPaths:S.areaPaths,pathsFrom:t,iterations:n[i].length-1,isRangeStart:!1})),a=S.linePaths.length/2;for(let t=0;t<a;t++)S.linePaths[t]=e.linePaths[t+a]+S.linePaths[t];S.linePaths.splice(a);const r=1===S.linePaths.length?this.lineHelpers.previousRangeAreaPath(s):null;S.pathFromLine=null!=r?r:e.pathFromLine+S.pathFromLine}else/z\s*$/i.test(S.pathFromArea)||(S.pathFromArea+="z");return S}_collapsedBaselineRow(t,e,i){const s=this.w,a=s.globals;if(s.config.chart.stacked||this.pointsChart)return null;if(!Array.isArray(t[e])||0!==t[e].length)return null;if(!this._hidden(i))return null;const r=s.axisFlags.isXNumeric?(s.seriesData.seriesX[i]||[]).length:a.dataPoints;if(!r)return null;const n=Zt.isNumber(a.minYArr[i])?a.minYArr[i]:a.minY,o=Zt.isNumber(a.maxYArr[i])?a.maxYArr[i]:a.maxY,l=Math.min(Math.max(0,n),o);return new Array(r).fill(Zt.isNumber(l)?l:0)}_initSerieVariables(t,e,i){const s=this.w,a=new R(this.w);this.xDivision=s.layout.gridWidth/(s.globals.dataPoints-("on"===s.config.xaxis.tickPlacement?1:0)),this.strokeWidth=Array.isArray(s.config.stroke.width)?s.config.stroke.width[i]:s.config.stroke.width;let r=0;this.yRatio.length>1&&(this.yaxisIndex=s.globals.seriesYAxisReverseMap[i],r=i),this.isReversed=s.config.yaxis[this.yaxisIndex]&&s.config.yaxis[this.yaxisIndex].reversed,this.zeroY=s.layout.gridHeight-this.baseLineY[r]-(this.isReversed?s.layout.gridHeight:0)+(this.isReversed?2*this.baseLineY[r]:0),this.areaBottomY=this.zeroY,(this.zeroY>s.layout.gridHeight||"end"===s.config.plotOptions.area.fillTo)&&(this.areaBottomY=s.layout.gridHeight),this.categoryAxisCorrection=this.xDivision/2;const n=s.config.series[i];if(this.elSeries=a.group({class:"apexcharts-series",zIndex:void 0!==n.zIndex?n.zIndex:i,seriesName:Zt.escapeString(s.seriesData.seriesNames[i])}),this.elPointsMain=a.group({class:"apexcharts-series-markers-wrap","data:realIndex":i}),this.markers.resetSeriesWrapCache(),this._elLastPointsWrap=null,s.globals.hasNullValues){const t=this.markers.plotChartMarkers({pointsPos:{x:[0],y:[s.layout.gridHeight+s.globals.markers.largestSize]},seriesIndex:e,j:0,pSize:.1,alwaysDrawMarker:!0,isVirtualPoint:!0});null!==t&&this.elPointsMain.add(t)}this.elDataLabelsWrap=a.group({class:"apexcharts-datalabels","data:realIndex":i});const o=t[e].length===s.globals.dataPoints;this.elSeries.attr({"data:longestSeries":o,rel:e+1,"data:realIndex":i}),this.appendPathFrom=!0}_calculatePathsFrom(t,e){const i=new R(this.w);let s=i.move(0,this.areaBottomY)+i.line(0,this.areaBottomY),a=s;if(this.w.globals.previousPaths.length>0){const e=this.lineHelpers.checkPreviousPaths({pathFromLine:s,pathFromArea:a,realIndex:t});s=e.pathFromLine,a=e.pathFromArea}return{prevY:e,pathFromLine:s,pathFromArea:a}}_stackKey(t,e){if(!this.w.axisFlags.isXNumeric)return e;const i=this.w.seriesData.seriesX[t];return i?i[e]:void 0}stackTopAt(t,e){const i=this._stackKey(t,e);if(null!=i)return this.prevSeriesYByX.get(i)}_hidden(t){const e=this.w.globals;return e.collapsedSeriesIndices.indexOf(t)>-1||e.ancillaryCollapsedSeriesIndices.indexOf(t)>-1}_recordStackTops(t,e,i=this.w.seriesData.series[t]){if(this.w.config.chart.stacked&&Array.isArray(e)&&!this._hidden(t))for(let s=0;s<e.length;s++){const a=this._stackKey(t,s);if(null==a)continue;const r=e[s];Zt.isNumber(r)&&null!=(null==i?void 0:i[s])&&this.prevSeriesYByX.set(a,r)}}_handlePaths({type:t,realIndex:e,i:i,paths:s}){var a,r,n,h,c,d,p;const g=this.w,f=new R(this.w),m=si(this.ctx,f),x=new F(this.w);this.marks=[],this.prevSeriesY.push(s.yArrj),this._recordStackTops(e,s.yArrj);let b,y=null;"line"!==t&&"area"!==t||!g.globals.dataChanged||(y=function(t,e,i,s){var a;const r=t.globals,n=r.prevStreamFrame;if(!n||!r.dataChanged||!(null==(a=t.axisFlags)?void 0:a.isXNumeric))return null;const o=n.seriesX[e],l=n.seriesY[e],h=t.seriesData.seriesX[e],c=t.seriesData.series[e];if(!(o&&l&&h&&c))return null;if(o.length<3||h.length<3)return null;let d=-1;for(let t=0;t<o.length;t++)if(o[t]===h[0]){d=t;break}if(-1===d)return null;const u=Math.min(o.length-d,h.length);if(u<2)return null;const p=h.length-u;if(0===d&&0===p)return null;for(let t=0;t<u;t++){if(o[d+t]!==h[t])return null;const e=l[d+t],i=c[t];if(e!==i&&(null!=e||null!=i))return null}const g=n.xPixels[e],f=n.yPixels[e];if(!g||!f)return null;let m=-1,x=-1;for(let t=0;t<u;t++)null!=g[d+t]&&null!=f[d+t]&&null!=i[t]&&null!=s[t]&&(-1===m&&(m=t),x=t);if(-1===m||x<=m)return null;const b=i[m],y=i[x],v=g[d+m],w=g[d+x];if(Math.abs(y-b)<1e-6)return null;const _=(w-v)/(y-b),A=v-_*b;if(!isFinite(_)||!isFinite(A))return null;if(Math.abs(_-1)>.02)return null;if(Math.abs(A)<.5)return null;let S=m,C=m;for(let t=m;t<=x;t++){const e=s[t];null!=e&&null!=f[d+t]&&(e<s[S]&&(S=t),e>s[C]&&(C=t))}let k=1,P=0;const L=s[S],M=s[C];if(Math.abs(M-L)>1e-6?(k=(f[d+C]-f[d+S])/(M-L),P=f[d+S]-k*L):P=f[d+S]-L,!isFinite(k)||!isFinite(P)||k<.2||k>5)return null;const I=Math.floor((m+x)/2);if(I!==m&&I!==x&&null!=i[I]&&null!=g[d+I]){const t=_*i[I]+A;if(Math.abs(t-g[d+I])>1.5)return null;if(null!=s[I]&&null!=f[d+I]){const t=k*s[I]+P;if(Math.abs(t-f[d+I])>1.5)return null}}return r.streamScrolled=!0,{ax:_,bx:A,ay:k,by:P}}(g,e,s.xArrj,s.yArrj));const v=()=>b||(b=$i(g,e,!0,!0));let w=null;y||"line"!==t&&"area"!==t||(w=ji(g,{type:t,realIndex:e,pathFromLine:s.pathFromLine,pathFromArea:s.pathFromArea,linePaths:s.linePaths,areaPaths:s.areaPaths,join:v})),g.globals.seriesXvalues[e]=s.xArrj,g.globals.seriesYvalues[e]=s.yArrj;const _=g.config.forecastDataPoints;if(_.count>0&&"rangeArea"!==t){const t=s.xArrj.length-_.count-1,i=g.axisFlags.isXNumeric?(g.seriesData.seriesX[e][t]-g.globals.minX)/this.xRatio:g.globals.padHorizontal+this.categoryAxisCorrection+t*this.xDivision,a=f.drawRect(i,0,g.layout.gridWidth,g.layout.gridHeight,0);g.dom.elForecastMask.appendChild(a.node);const r=f.drawRect(0,0,i,g.layout.gridHeight,0);g.dom.elNonForecastMask.appendChild(r.node)}if(this.pointsChart)Bi(g,{elPointsMain:this.elPointsMain,realIndex:e,speed:g.config.chart.animations.dynamicAnimation.speed}),function(t,{elPointsMain:e,realIndex:i,speed:s}){if(!(null==e?void 0:e.node)||!Ti(t))return!1;if(-1===(t.globals.risingSeries||[]).indexOf(i))return!1;const a=e.node.querySelectorAll(".apexcharts-marker");if(!a.length)return!1;const r=Wi(t),n=Hi(t,e);e.node.classList.remove("apexcharts-element-hidden"),a.forEach(e=>{let i=parseFloat(e.getAttribute("cx")),a=parseFloat(e.getAttribute("cy"));if("star"===e.getAttribute("shape")||!isFinite(i+a)){const t=e.getBBox();i=t.x+t.width/2,a=t.y+t.height/2}Ni(e,i,a,0),Yi(t,Math.max(1,s||1),r,t=>Ni(e,i,a,t),()=>e.removeAttribute("transform"),n)})}(g,{elPointsMain:this.elPointsMain,realIndex:e,speed:g.config.chart.animations.dynamicAnimation.speed}),(g.seriesData.series[e]||[]).length||function(t,{elPointsMain:e,realIndex:i,speed:s,drawPoint:a}){var r,n,o;if(!(null==e?void 0:e.node)||!Ti(t))return!1;if(-1===(t.globals.collapsingSeriesIndices||[]).indexOf(i))return!1;const l=t.globals.prevStreamFrame,h=null==(r=null==l?void 0:l.xPixels)?void 0:r[i],c=null==(n=null==l?void 0:l.yPixels)?void 0:n[i];if(!Array.isArray(h)||!Array.isArray(c))return!1;const d=(null==(o=null==l?void 0:l.rPixels)?void 0:o[i])||[],p=t.globals.markers.size[i]||0,g=Wi(t);let f=!1;for(let r=0;r<h.length;r++){const n=h[r],o=c[r];if(null==n||null==o||!isFinite(n)||!isFinite(o))continue;const l=isFinite(d[r])?d[r]:p;if(!(l>0))continue;const m=a(n,o,l,r);if(!(null==m?void 0:m.node))continue;e.add(m);const x=m.node;x.classList.add("apexcharts-marker-exit");const b=u.trackSeriesTween(t,i);Yi(t,Math.max(1,s||1),g,t=>Ni(x,n,o,1-t),()=>{Ni(x,n,o,0),b()}),f=!0}f&&e.node.classList.remove("apexcharts-element-hidden")}(g,{elPointsMain:this.elPointsMain,realIndex:e,speed:g.config.chart.animations.dynamicAnimation.speed,drawPoint:(t,i,s,a)=>this.scatter.drawPoint(t,i,s,e,a,a)});else{g.globals.delayedElements.push({el:this.elPointsMain.node,index:e});Bi(g,{elPointsMain:this.elPointsMain,realIndex:e,speed:g.config.chart.animations.dynamicAnimation.speed,join:v})||"line"!==t||g.config.stroke.show||!g.globals.dataChanged&&!g.globals.resized||this.elPointsMain.node.classList.remove("apexcharts-element-hidden"),(null==(a=this.elDataLabelsWrap)?void 0:a.node)&&$i(g,e,!1,!1,v())&&(this.elDataLabelsWrap.node.classList.add("apexcharts-element-hidden"),g.globals.delayedElements.push({el:this.elDataLabelsWrap.node,holdUntilComplete:!0}))}const A={i:i,realIndex:e,animationDelay:i,initialSpeed:g.config.chart.animations.speed,dataChangeSpeed:g.config.chart.animations.dynamicAnimation.speed,className:`apexcharts-${t}`},S=s.numericXY,C="line"===t||"area"===t,k=C&&s.linePaths.length>1?[s.linePaths.join(" ")]:s.linePaths,P=C&&s.areaPaths.length>1?[s.areaPaths.join(" ")]:s.areaPaths;if("area"===t){const t=x.fillPath({seriesNumber:e});for(let e=0;e<P.length;e++){const i=m.renderPaths(l(o({},A),{pathFrom:y?us(P[e],y):null!=(n=null==(r=null==w?void 0:w.area)?void 0:r.from)?n:s.pathFromArea,pathTo:P[e],pathToNumeric:S?{xs:S.xs,ys:S.ys,closeY:S.areaCloseY}:void 0,pathToInterp:null==(h=null==w?void 0:w.area)?void 0:h.toInterp,scrollMorph:!!y,stroke:"none",strokeWidth:0,strokeLinecap:null,fill:t}));this.elSeries.add(i),this.marks.push(i)}}if(g.config.stroke.show&&!this.pointsChart){let a=null;if("line"===t)a=x.fillPath({seriesNumber:e,i:i});else if("solid"===g.config.stroke.fill.type)a=g.globals.stroke.colors[e];else{const t=g.config.fill;g.config.fill=g.config.stroke.fill,a=x.fillPath({seriesNumber:e,i:i}),g.config.fill=t}for(let i=0;i<k.length;i++){let r=a;"rangeArea"===t&&(r=x.fillPath({seriesNumber:e}));const n=l(o({},A),{pathFrom:y?us(k[i],y):null!=(d=null==(c=null==w?void 0:w.line)?void 0:c.from)?d:s.pathFromLine,pathTo:k[i],pathToNumeric:S?{xs:S.xs,ys:S.ys}:void 0,pathToInterp:null==(p=null==w?void 0:w.line)?void 0:p.toInterp,scrollMorph:!!y,stroke:a,strokeWidth:this.strokeWidth,strokeLinecap:g.config.stroke.lineCap,fill:"rangeArea"===t?r:"none"}),h=m.renderPaths(n);if(this.elSeries.add(h),this.marks.push(h),h.attr("fill-rule","evenodd"),_.count>0&&"rangeArea"!==t){const t=m.renderPaths(n);t.node.setAttribute("stroke-dasharray",_.dashArray),_.strokeWidth&&t.node.setAttribute("stroke-width",_.strokeWidth),this.elSeries.add(t),t.attr("clip-path",`url(#forecastMask${g.globals.cuid})`),h.attr("clip-path",`url(#nonForecastMask${g.globals.cuid})`)}}}}_iterateOverDataPoints({type:t,series:e,iterations:i,realIndex:s,translationsIndex:a,i:r,x:n,y:o,pX:l,pY:h,pathsFrom:c,linePaths:d,areaPaths:u,seriesIndex:p,lineYPosition:g,xArrj:f,yArrj:m,y2Arrj:x,isRangeStart:b,seriesRangeEnd:y}){var v,w,_;const A=this.w,S=new R(this.w),C=this.yRatio,k=c.prevY;let P,L,{pathFromLine:M,pathFromArea:I}=c;const E=Zt.isNumber(A.globals.minYArr[s])?A.globals.minYArr[s]:A.globals.minY;i||(i=A.globals.dataPoints>1?A.globals.dataPoints-1:A.globals.dataPoints);const F=(t,e)=>e-t/C[a]+2*(this.isReversed?t/C[a]:0);let D=o;const T=A.config.chart.stacked&&!A.globals.comboCharts||A.config.chart.stacked&&A.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||"bar"===(null==(v=this.w.config.series[s])?void 0:v.type)||"column"===(null==(w=this.w.config.series[s])?void 0:w.type));let z=A.config.stroke.curve;Array.isArray(z)&&(z=Array.isArray(p)?z[p[r]]:z[r]);let X,O=0;const $=this.pointsChart?this._scatterJitterPx(s):null;if("straight"===z&&!this.pointsChart){const p=this._fastStraightPath({type:t,series:e,i:r,realIndex:s,translationsIndex:a,iterations:i,x:n,y:o,pX:l,pY:h,pathsFrom:c,linePaths:d,areaPaths:u,xArrj:f,yArrj:m,y2Arrj:x,stackSeries:T});if(p)return p}const W=T?this._stackXs:null;let Y=0;const H=[];!this._shapeOnly&&!this.pointsChart&&i>0&&e[r].length&&A.seriesData.series[r].length>1&&(A.globals.dataChanged||A.globals.resized||A.globals.markers.batched)&&this.elPointsMain.node.classList.add("apexcharts-element-hidden");for(let a=0;a<i&&0!==e[r].length;a++){const c=void 0===e[r][a+1]||null===e[r][a+1];if(A.axisFlags.isXNumeric){const t=A.seriesData.seriesX[s];let e=t[a+1];if(void 0===e&&(e=t[i-1]),n=(e-A.globals.minX)/this.xRatio,W){const i=[];for(;W[Y]<=t[a];)Y++;for(;W[Y]<e;)i.push([(W[Y]-A.globals.minX)/this.xRatio,null!=(_=this.prevSeriesYByX.get(W[Y++]))?_:this.zeroY]);i.length&&(H[a+1]=i)}}else n+=this.xDivision;if(T)if(r>0&&A.globals.collapsedSeries.length<A.config.series.length-1){if((t=>{var e;for(let i=t;i>=0;i--){const t=null!=(e=null==p?void 0:p[i])?e:i;if(!this._hidden(t))return i}return-1})(r-1)<0)g=this.zeroY;else{const t=this.stackTopAt(s,a+1);g=void 0===t?this.zeroY:t}}else g=this.zeroY;else g=this.zeroY;c?o=F(E,g):(o=F(e[r][a+1],g),"rangeArea"===t&&(D=F(y[r][a+1],g)));let v=n,w=o;if($){const t=100003*s+(a+1);$.x&&(v=n+2*(es(7919*t+13)-.5)*$.x),$.y&&(w=o+2*(es(6271*t+97)-.5)*$.y)}f.push(null===e[r][a+1]?null:v),!c||"smooth"!==A.config.stroke.curve&&"monotoneCubic"!==A.config.stroke.curve?(m.push(w),x.push(D)):(m.push(null),x.push(null));const C=this.lineHelpers.calculatePoints({series:e,x:v,y:w,realIndex:s,i:r,j:a,prevY:k}),R=this._createPaths({type:t,series:e,i:r,j:a,x:n,y:o,midsAt:H,y2:D,xArrj:f,yArrj:m,y2Arrj:x,pX:l,pY:h,pathState:O,segmentStartX:X,linePath:P,areaPath:L,linePaths:d,areaPaths:u,curve:z,isRangeStart:b});u=R.areaPaths,d=R.linePaths,l=R.pX,h=R.pY,O=R.pathState,X=R.segmentStartX,L=R.areaPath,P=R.linePath,!this.appendPathFrom||A.globals.hasNullValues||"monotoneCubic"===z&&"rangeArea"===t||(M+=S.line(n,this.areaBottomY),I+=S.line(n,this.areaBottomY)),this._shapeOnly||(this.handleNullDataPoints(e,C,r,a,s),this._handleMarkersAndLabels({type:t,pointsPos:C,j:a,realIndex:s,isRangeStart:b}))}return{yArrj:m,xArrj:f,pathFromArea:I,areaPaths:u,pathFromLine:M,linePaths:d}}_handleMarkersAndLabels({type:t,pointsPos:e,isRangeStart:i,j:s,realIndex:a}){const r=new I(this.w,this.ctx);if(this.pointsChart)this.scatter.draw(this.elSeries,s,{realIndex:a,pointsPos:e,zRatio:this.zRatio,elParent:this.elPointsMain});else{const t=this.markers.plotChartMarkers({pointsPos:e,seriesIndex:a,j:s+1});null!==t&&t!==this._elLastPointsWrap&&(this.elPointsMain.add(t),this._elLastPointsWrap=t)}const n=r.drawDataLabel({type:t,isRangeStart:i,pos:e,i:a,j:s+1});null!==n&&this.elDataLabelsWrap.add(n)}_scatterJitterPx(t){var e;const i=this.w,s=null==(e=i.config.plotOptions.scatter)?void 0:e.jitter;if(!s||!s.enabled||!s.x&&!s.y)return null;const a=i.axisFlags.isXNumeric&&this.xRatio?1/this.xRatio:this.xDivision,r=this.yRatio.length>1?t:0,n=this.yRatio[r]?1/this.yRatio[r]:0;return{x:(s.x||0)*a,y:(s.y||0)*n}}_fastStraightPath({type:t,series:e,i:i,realIndex:s,translationsIndex:a,iterations:r,x:n,y:o,pX:l,pY:h,pathsFrom:c,linePaths:d,areaPaths:u,xArrj:p,yArrj:g,y2Arrj:f,stackSeries:m}){const x=this.w;if("line"!==t&&"area"!==t)return null;if(x.globals.comboCharts||m)return null;if(x.config.dataLabels.enabled)return null;if(x.config.markers.discrete.length)return null;if(x.globals.markers.size[s]>0)return null;const b=e[i],y=b.length;if(!r||y<2||y-1!==r)return null;for(let t=0;t<=r;t++){const e=b[t];if(null==e)return null}const v=x.axisFlags.isXNumeric,w=v?x.seriesData.seriesX[s]:null;if(v&&(!w||w.length<y))return null;const _=this.yRatio[a],A=this.isReversed,S=this.zeroY,C=this.areaBottomY,k=this.xRatio,P=x.globals.minX,L=this.xDivision,M=x.config.markers.offsetX,I=x.config.markers.offsetY,E=this.appendPathFrom&&!x.globals.hasNullValues;let{pathFromLine:F,pathFromArea:D}=c;const T=this.ctx&&this.ctx.renderer,R=!(!T||!T.kind||"svg"===T.kind),z=!R||x.globals.dataChanged&&!!x.globals.prevStreamFrame,X=R?new Float64Array(y):null,O=R?new Float64Array(y):null;X&&O&&(X[0]=l,O[0]=h),void 0===x.globals.pointsArray[s]&&(x.globals.pointsArray[s]=[]);const $=x.globals.pointsArray[s],W=w?(w[0]-P)/k+M:this.categoryAxisCorrection+M;$.push([W,c.prevY+I]);const Y=z?new Array(r+1):[];z&&(Y[0]="M "+l+" "+h);const H=z&&E?new Array(r):null;let B=n,N=l,j=h;for(let t=0;t<r;t++){w?N=(w[t+1]-P)/k:(B+=L,N=B);const e=b[t+1];j=S-e/_+2*(A?e/_:0),p.push(N),g.push(j),f.push(o),$.push([N+M,j+I]),z&&(Y[t+1]=" L "+N+" "+j,H&&(H[t]=" L "+N+" "+C)),X&&O&&(X[t+1]=N,O[t+1]=j)}let V="",G="";if(z&&(V=Y.join(""),G=V+" L "+N+" "+C+" L "+l+" "+C+"z"),H){const t=H.join("");F+=t,D+=t}else!z&&E&&(F+=" L "+N+" "+C,D+=" L "+N+" "+C);return d.push(V),u.push(G),{yArrj:g,xArrj:p,pathFromArea:D,areaPaths:u,pathFromLine:F,linePaths:d,numericXY:X?{xs:X,ys:O,areaCloseY:C}:void 0}}_createPaths({type:t,series:e,i:i,j:s,x:a,y:r,midsAt:n,xArrj:o,yArrj:l,y2:h,y2Arrj:c,pX:d,pY:u,pathState:p,segmentStartX:g,linePath:f,areaPath:m,linePaths:x,areaPaths:b,curve:y,isRangeStart:v}){const w=new R(this.w),_=this.areaBottomY,A="rangeArea"===t,S="rangeArea"===t&&v,C=n[s+1],k=t=>C?[...C,[a,r]].map(([e,i],s,a)=>t(...s?a[s-1]:[d,u],e,i)).join(""):t(d,u,a,r);switch(y){case"monotoneCubic":{const t=v?l:c,a=(t,e)=>t.map((t,i)=>[t,e[i]]).filter(t=>null!==t[1]),r=t=>{const e=[];let i=0;return t.forEach(t=>{null!==t?i++:i>0&&(e.push(i),i=0)}),i>0&&e.push(i),e},h=(t,e)=>{const i=r(t),s=[];for(let t=0,a=0;t<i.length;a+=i[t++])s[t]=hs.slice(e,a,a+i[t]);return s};switch(p){case 0:if(null===t[s+1])break;p=1;case 1:if(!(A?o.length===e[i].length:s===e[i].length-2))break;case 2:{let e=v?o:o.slice().reverse(),i=v?t:t.slice().reverse();if(n.length&&!A){const t=[];e.forEach((e,s)=>{null!==i[s]&&null!=i[s-1]&&n[s]&&t.push(...n[s]),t.push([e,i[s]])}),e=t.map(t=>t[0]),i=t.map(t=>t[1])}const s=a(e,i),r=s.length>1?hs.points(s):s;let l=[];A&&(S?b=s:l=b.reverse());let c=0,d=0;if(h(i,r).forEach(t=>{c++;const e=(t=>{let e="";for(let i=0;i<t.length;i++){const s=t[i],a=s.length;a>4?(e+=`C${s[0]}, ${s[1]}`,e+=`, ${s[2]}, ${s[3]}`,e+=`, ${s[4]}, ${s[5]}`):a>2&&(e+=`S${s[0]}, ${s[1]}`,e+=`, ${s[2]}, ${s[3]}`)}return e})(t),i=d;d+=t.length;const a=d-1;S?f=w.move(s[i][0],s[i][1])+e:A?f=w.move(l[i][0],l[i][1])+w.line(s[i][0],s[i][1])+e+w.line(l[a][0],l[a][1]):(f=w.move(s[i][0],s[i][1])+e,m=f+w.line(s[a][0],_)+w.line(s[i][0],_)+"z",b.push(m)),x.push(f)}),A&&c>1&&!S){const t=x.slice(c).reverse();x.splice(c),t.forEach(t=>x.push(t))}p=0;break}}break}case"smooth":{const t=(t,e,i,s)=>{const a=.35*(i-t);return w.curve(t+a,e,i-a,s,i,s)};if(null===e[i][s])p=0;else switch(p){case 0:if(g=d,f=S?w.move(d,c[s])+w.line(d,u):w.move(d,u),m=w.move(d,u),null===e[i][s+1]||void 0===e[i][s+1]){x.push(f),b.push(m);break}if(p=1,s<e[i].length-2){const e=k(t);f+=e,m+=e;break}case 1:if(null===e[i][s+1])f+=S?w.line(d,h):w.move(d,u),m+=w.line(d,_)+w.line(g,_)+"z",x.push(f),b.push(m),p=-1;else{const n=k(t);f+=n,m+=n,s>=e[i].length-2&&(S&&(f+=w.curve(a,r,a,r,a,h)+w.move(a,h)),m+=w.curve(a,r,a,r,a,_)+w.line(g,_)+"z",x.push(f),b.push(m),p=-1)}}d=a,u=r;break}default:{const t=(t,e,i,s)=>{let a="";switch(y){case"stepline":a=w.line(i,null,"H")+w.line(null,s,"V");break;case"linestep":a=w.line(null,s,"V")+w.line(i,null,"H");break;case"straight":a=w.line(i,s)}return a};if(null===e[i][s])p=0;else switch(p){case 0:if(g=d,f=S?w.move(d,c[s])+w.line(d,u):w.move(d,u),m=w.move(d,u),null===e[i][s+1]||void 0===e[i][s+1]){if("stepline"===y&&null===e[i][s+1]&&!A){const t=w.line(a,null,"H");f+=t,m+=t+w.line(a,_)+w.line(g,_)+"z"}x.push(f),b.push(m);break}if(p=1,s<e[i].length-2){const e=k(t);f+=e,m+=e;break}case 1:if(null===e[i][s+1]){let t=d;if(S)f+=w.line(d,h);else if("stepline"!==y||A)f+=w.move(d,u);else{const e=w.line(a,null,"H");f+=e,m+=e,t=a}m+=w.line(t,_)+w.line(g,_)+"z",x.push(f),b.push(m),p=-1}else{const r=k(t);f+=r,m+=r,s>=e[i].length-2&&(S&&(f+=w.line(a,h)),m+=w.line(a,_)+w.line(g,_)+"z",x.push(f),b.push(m),p=-1)}}d=a,u=r;break}}return{linePaths:x,areaPaths:b,pX:d,pY:u,pathState:p,segmentStartX:g,linePath:f,areaPath:m}}handleNullDataPoints(t,e,i,s,a){const r=this.w;if(null===t[i][s]&&r.config.markers.showNullDataPoints||1===t[i].length){let t=this.strokeWidth-r.config.markers.strokeWidth/2;t>0||(t=0);const i=this.markers.plotChartMarkers({pointsPos:e,seriesIndex:a,j:s+1,pSize:t,alwaysDrawMarker:!0});null!==i&&this.elPointsMain.add(i)}}}class gs{constructor(t){this.w=t}drawYAxisTexts(t,e,i,s){const a=this.w,r=a.config.yaxis[0],n=a.formatters.yLabelFormatters[0];return new R(this.w).drawText({x:t+r.labels.offsetX,y:e+r.labels.offsetY,text:n(s,i),textAnchor:"middle",fontSize:r.labels.style.fontSize,fontFamily:r.labels.style.fontFamily,foreColor:Array.isArray(r.labels.style.colors)?r.labels.style.colors[i]:r.labels.style.colors})}getMaxLabelWidth(t,{fontSize:e,fontFamily:i,fontWeight:s}={}){const a=new R(this.w);let r=0;return t.forEach(t=>{if(null==t||""===t)return;const n=a.getTextRects(`${t}`,e||"12px",i,"",!0,s);r=Math.max(r,n.width)}),r}drawExternalLabel(t){return function(t,e){const{lines:i,lineHeight:s,anchor:a,elbow:r,labelX:n,labelY:o,side:l,connector:h,style:c,foreColor:d}=e,u=new R(t),p=u.group({class:e.groupClass||"apexcharts-outer-label-group"});if(h.show){const t=`M ${a.x} ${a.y} L ${r.x} ${r.y} L ${n} ${o}`,i=u.drawPath({d:t,stroke:h.color,strokeWidth:h.width,fill:"none",strokeLinecap:"round"});i.node.classList.add(e.connectorClass||"apexcharts-outer-label-connector"),p.add(i)}const g="right"===l?n+4:n-4,f=i.length,m=o-(f-1)*s/2,x=u.drawText({x:g,y:m,text:1===f?i[0]:i,textAnchor:"right"===l?"start":"end",fontSize:c.fontSize,fontFamily:c.fontFamily,fontWeight:c.fontWeight,foreColor:d,dominantBaseline:"central",cssClass:e.textClass||"apexcharts-outer-label"});if(f>1){const t=x.node.getElementsByTagName("tspan");for(let e=0;e<t.length;e++)t[e].setAttribute("x",`${g}`),t[e].setAttribute("dy",0===e?"0":`${s}`)}return p.add(x),p}(this.w,l(o({},t),{groupClass:"apexcharts-pie-name-label-group",textClass:"apexcharts-pie-name-label",connectorClass:"apexcharts-pie-label-connector"}))}}const fs=Math.PI/180,ms=180/Math.PI;function xs(t,e,i,s){return{x:t+i*Math.cos((s-90)*fs),y:e+i*Math.sin((s-90)*fs)}}const bs=t=>`${t.x} ${t.y}`;function ys({cx:t,cy:e,rIn:i,rOut:s,a0:a,a1:r,r:n,spanDeg:o}){const l=(i,s)=>xs(t,e,i,s),h=n/s*ms,c=n/i*ms,d=l(s,a+h),u=l(s,r-h),p=o-2*h>180?1:0,g=l(s,r),f=l(s-n,r),m=l(s,a),x=l(s-n,a),b=l(i,r-c),y=l(i,a+c),v=o-2*c>180?1:0,w=l(i,r),_=l(i+n,r),A=l(i,a),S=l(i+n,a);return["M",bs(d),"A",s,s,0,p,1,bs(u),"Q",bs(g),bs(f),"L",bs(_),"Q",bs(w),bs(b),"A",i,i,0,v,0,bs(y),"Q",bs(A),bs(S),"L",bs(x),"Q",bs(m),bs(d),"Z"].join(" ")}class vs{constructor(t,e){this.ctx=e,this.w=t,this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animBeginArr=[0],this.animDur=0,this.donutDataLabels=this.w.config.plotOptions.pie.donut.labels,this.lineColorArr=void 0!==t.globals.stroke.colors?t.globals.stroke.colors:t.globals.colors,this.defaultSize=Math.min(t.layout.gridWidth,t.layout.gridHeight),this.centerY=t.layout.gridHeight/2,this.centerX=t.layout.gridWidth/2,"radialBar"===t.config.chart.type?this.fullAngle=360:this.fullAngle=Math.abs(t.config.plotOptions.pie.endAngle-t.config.plotOptions.pie.startAngle),this.initialAngle=t.config.plotOptions.pie.startAngle%this.fullAngle,t.globals.radialSize=this.defaultSize/2.05-t.config.stroke.width-(t.config.chart.sparkline.enabled?0:t.config.chart.dropShadow.blur),this.externalCfg=t.config.plotOptions.pie.dataLabels.external;const i=t.config.dataLabels.style;this.externalLabelStyle={fontSize:this.externalCfg.fontSize||i.fontSize,fontFamily:this.externalCfg.fontFamily||i.fontFamily,fontWeight:this.externalCfg.fontWeight||i.fontWeight},this.externalLabels=[],this.externalLabelMaxLines=1,this.externalLabelLineH=parseFloat(this.externalLabelStyle.fontSize)||12,t.globals.pieExternalLabelMarginY=0,this.showExternalLabels=this.externalCfg.show&&"polarArea"!==this.chartType,this.showExternalLabels&&!t.globals.noData&&this.reserveExternalLabelSpace(),this.donutSize=t.globals.radialSize*parseInt(t.config.plotOptions.pie.donut.size,10)/100;const s=t.config.plotOptions.pie.customScale,a=t.layout.gridWidth/2,r=t.layout.gridHeight/2;this.translateX=a-a*s,this.translateY=r-r*s,this.dataLabelsGroup=new R(this.w).group({class:"apexcharts-datalabels-group",transform:`translate(${this.translateX}, ${this.translateY}) scale(${s})`}),this.maxY=0,this.sliceLabels=[],this.sliceSizes=[],this.prevSliceSizes=[],this.sliceLabelGroups={},this.externalLabelGroups={},this.elHoverOutline=null,this.elHoverOutlinePath=null,this.hoverOutlineIndex=-1,this.prevSectorAngleArr=[]}getExternalLabelText(t){var e,i,s;const a=this.w,r=a.seriesData.seriesNames[t],n=this.externalCfg.formatter;return"function"==typeof n?n(r,{seriesIndex:t,percent:null==(i=null==(e=a.globals.seriesPercent)?void 0:e[t])?void 0:i[0],value:null==(s=a.globals.seriesTotals)?void 0:s[t],w:a}):null==r?"":`${r}`}getExternalLabelLines(t){const e=this.getExternalLabelText(t);return(Array.isArray(e)?e:`${null==e?"":e}`.split("\n")).map(t=>null==t?"":`${t}`)}reserveExternalLabelSpace(){const t=this.w,e=new gs(t),i=(t.seriesData.seriesNames||[]).map((t,e)=>this.getExternalLabelLines(e)),s=e.getMaxLabelWidth(i.flat(),this.externalLabelStyle);this.externalLabelMaxLines=i.reduce((t,e)=>Math.max(t,e.length),1),this.externalLabelLineH=Math.round(1.35*(parseFloat(this.externalLabelStyle.fontSize)||12));const a=this.externalCfg.connector,r=this.externalLabelMaxLines*this.externalLabelLineH,n=s+(a.length||0)+(a.gap||0)+12,o=r/2+(a.gap||0)+6,l=Math.min(t.globals.radialSize,t.layout.gridWidth/2-n,t.layout.gridHeight/2-o);t.globals.radialSize=Math.max(l,.15*this.defaultSize),t.globals.pieExternalLabelMarginY=o;const h=t.config.chart.height?String(t.config.chart.height):"",c=""!==h&&"auto"!==h;this.centerY=c?t.layout.gridHeight/2:t.globals.radialSize+o}draw(t){var e,i;const s=this.w,a=new R(this.w),r=a.group({class:"apexcharts-pie"});if(s.globals.noData)return r;null==(e=this.ctx.highlightFilter)||e.pie(this);const n=s.config.plotOptions.pie.customScale,o="donut"===this.chartType?this.donutSize:0,l=[],h=this.initialAngle,c=(t,e)=>this.translateY+n*Zt.polarToCartesian(this.centerX,this.centerY,t,e).y;for(let t=h;t<=h+this.fullAngle;t++)l.push(c(s.globals.radialSize,t),c(o,t));this.donutDataLabels.show&&l.push(c(o,180)),s.globals.circleGeometry={node:r.node,cx:this.translateX+n*this.centerX,cy:this.translateY+n*this.centerY,r:n*s.globals.radialSize,y:"polarArea"!==this.chartType&&[Math.min(...l),Math.max(...l)]};let d=0;for(let e=0;e<t.length;e++)d+=Zt.negToZero(t[e]);const u=[],p=a.group();0===d&&(d=1e-5),t.forEach(t=>{this.maxY=Math.max(this.maxY,t)}),s.config.yaxis[0].max&&(this.maxY=s.config.yaxis[0].max),"back"===s.config.grid.position&&"polarArea"===this.chartType&&this.drawPolarElements(r);const g=s.globals.collapsedSeriesIndices||[];let f=1;if("polarArea"===this.chartType){let e=0;for(let i=0;i<t.length;i++)-1===g.indexOf(i)&&e++;f=Math.max(1,e)}for(let e=0;e<t.length;e++){const i=this.fullAngle*Zt.negToZero(t[e])/d;u.push(i),"polarArea"===this.chartType?(u[e]=g.indexOf(e)>-1?0:this.fullAngle/f,this.sliceSizes.push(s.globals.radialSize*Zt.negToZero(t[e])/(this.maxY||1))):this.sliceSizes.push(s.globals.radialSize)}const m=!0===(null==(i=this.ctx.morphTypeChange)?void 0:i.isActive());if(s.globals.dataChanged&&!m){if("polarArea"===this.chartType){const t=s.globals.previousPaths,e=s.globals.prevPolarAngles;if(Array.isArray(e)&&e.length===t.length)this.prevSectorAngleArr=e.slice();else for(let e=0;e<t.length;e++)this.prevSectorAngleArr.push(this.fullAngle/Math.max(1,t.length));const i=s.globals.prevPolarSizes;if(Array.isArray(i)&&i.length===t.length)this.prevSliceSizes=i.map(t=>t*s.globals.radialSize);else{let e=0;for(let i=0;i<t.length;i++)e=Math.max(e,Zt.negToZero(t[i]));s.config.yaxis[0].max&&(e=s.config.yaxis[0].max),this.prevSliceSizes=t.map(t=>s.globals.radialSize*Zt.negToZero(t)/(e||1))}}else{let t=0;for(let e=0;e<s.globals.previousPaths.length;e++)t+=Zt.negToZero(s.globals.previousPaths[e]);for(let e=0;e<s.globals.previousPaths.length;e++)this.prevSectorAngleArr.push(t?this.fullAngle*Zt.negToZero(s.globals.previousPaths[e])/t:0)}for(;!1!==s.globals.shouldAnimate&&this.prevSectorAngleArr.length<t.length;)this.prevSectorAngleArr.push(0)}if("polarArea"===this.chartType){s.globals.prevPolarAngles=u.slice();const t=s.globals.radialSize||1;s.globals.prevPolarSizes=this.sliceSizes.map(e=>e/t)}if(this.donutSize<0&&(this.donutSize=0),"donut"===this.chartType){const t=a.drawCircle(this.donutSize);t.attr({cx:this.centerX,cy:this.centerY,fill:s.config.plotOptions.pie.donut.background?s.config.plotOptions.pie.donut.background:"transparent"}),p.add(t)}const x=this.drawArcs(u,t);if(this.sliceLabels.forEach(t=>{x.add(t)}),p.attr({transform:`translate(${this.translateX}, ${this.translateY}) scale(${s.config.plotOptions.pie.customScale})`}),p.add(x),r.add(p),this.donutDataLabels.show){const t=this.initialAnim&&!s.globals.resized&&!s.globals.dataChanged&&this.animDur>0,e=this.renderInnerDataLabels(this.dataLabelsGroup,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:t?0:this.donutDataLabels.show});if(t){const t=this.dataLabelsGroup.node;t.style.transition="opacity 280ms ease-out",setTimeout(()=>{t.style.opacity="1"},this.animDur)}r.add(e)}return"front"===s.config.grid.position&&"polarArea"===this.chartType&&this.drawPolarElements(r),r}drawArcs(t,e){var i,s,a,r,n;const o=this.w,l=new D(this.w),h=new R(this.w),c=new F(this.w),d=h.group({class:"apexcharts-slices"});this.elHoverOutline=h.group({class:"apexcharts-pie-hover-outline"}),this.elHoverOutline.node.style.pointerEvents="none",this.elHoverOutline.node.style.opacity="0",o.config.chart.animations.enabled&&(this.elHoverOutline.node.style.transition="opacity 180ms ease-out"),d.add(this.elHoverOutline);let u=this.initialAngle,p=this.initialAngle,g=this.initialAngle,f=this.initialAngle;this.strokeWidth=o.config.stroke.show?o.config.stroke.width:0;const m=!0===(null==(i=this.ctx.morphTypeChange)?void 0:i.isActive());for(let i=0;i<t.length;i++){const x=h.group({class:"apexcharts-series apexcharts-pie-series",seriesName:Zt.escapeString(o.seriesData.seriesNames[i]),rel:i+1,"data:realIndex":i});d.add(x),u=g,p=f,g=u+t[i],f=p+this.prevSectorAngleArr[i];const b=g<u?this.fullAngle+g-u:g-u,y=c.fillPath({seriesNumber:i,size:this.sliceSizes[i],value:e[i]}),v=m?this.ctx.morphTypeChange.getInitialPathFor(i,0):null,w="polarArea"===this.chartType&&o.globals.dataChanged&&!m?this.prevSliceSizes[i]||0:void 0,_=v||this.getChangedPath(p,f,w),A=h.drawPath({d:_,stroke:Array.isArray(this.lineColorArr)?null!=(s=this.lineColorArr[i])?s:this.lineColorArr[i%this.lineColorArr.length]:this.lineColorArr,strokeWidth:0,fill:y,fillOpacity:o.config.fill.opacity,classes:`apexcharts-pie-area apexcharts-${this.chartType.toLowerCase()}-slice-${i}`});if(A.attr({index:0,j:i}),l.setSelectionFilter(A,0,i),o.config.chart.dropShadow.enabled){const t=o.config.chart.dropShadow;l.dropShadow(A,t,i)}this.addListeners(A,this.donutDataLabels,i);let S={x:0,y:0};const C=(u+b/2)%this.fullAngle;let k={x:this.centerX,y:this.centerY};"pie"===this.chartType||"polarArea"===this.chartType?(S=Zt.polarToCartesian(this.centerX,this.centerY,o.globals.radialSize/1.25+o.config.plotOptions.pie.dataLabels.offset,C),k=Zt.polarToCartesian(this.centerX,this.centerY,o.globals.radialSize/2,C)):"donut"===this.chartType&&(S=Zt.polarToCartesian(this.centerX,this.centerY,(o.globals.radialSize+this.donutSize)/2+o.config.plotOptions.pie.dataLabels.offset,C),k=Zt.polarToCartesian(this.centerX,this.centerY,(o.globals.radialSize+this.donutSize)/2,C)),R.setAttrs(A.node,{"data:angle":b,"data:startAngle":u,"data:strokeWidth":this.strokeWidth,"data:value":e[i],"data:cx":k.x,"data:cy":k.y}),x.add(A);let P=!1;if(m){const t=this.getPiePath({me:this,startAngle:u,angle:b,size:this.sliceSizes[i]});A.node.setAttribute("data:pathFinal",t),P=!0===(null==(r=(a=this.ctx.morphTypeChange).claimsTargetMark)?void 0:r.call(a,i,0)),P&&(A.attr({d:t}),A.node.setAttribute("data:pathOrig",t),A.node.setAttribute("opacity","0"),A.node.setAttribute("data-piece-hidden","1"))}const L=(o.globals.collapsedSeriesIndices||[]).includes(i);let M=0;if(!this.initialAnim||o.globals.resized||o.globals.dataChanged?this.animBeginArr.push(0):(M=b/this.fullAngle*o.config.chart.animations.speed,0===M&&(M=1),this.animDur=M+this.animDur,this.animBeginArr.push(this.animDur)),P);else if(m&&v){const t=this.getPiePath({me:this,startAngle:u,angle:b,size:this.sliceSizes[i]}),e=this.ctx.morphTypeChange.getSpeed(),s=this.ctx.animations;A.node.setAttribute("data:pathOrig",t);const a=A.animate(e).plot(t,"polygons").attr({"stroke-width":this.strokeWidth});a&&"function"==typeof a.after?a.after(()=>s.animationCompleted(A)):s.animationCompleted(A)}else this.dynamicAnim&&o.globals.dataChanged?this.animatePaths(A,{size:this.sliceSizes[i],prevSize:w,endAngle:g,startAngle:u,prevStartAngle:p,prevEndAngle:f,animateStartingPos:!0,i:i,animBeginArr:this.animBeginArr,shouldSetPrevPaths:!0,dur:o.config.chart.animations.dynamicAnimation.speed,collapsed:L}):this.animatePaths(A,{size:this.sliceSizes[i],endAngle:g,startAngle:u,i:i,animBeginArr:this.animBeginArr,dur:M,collapsed:L});if(this.getExpandOffset()>0?A.node.addEventListener("mouseup",this.pieClicked.bind(this,i)):0===i&&D.drilldownBlocksSliceOffset(o)&&(null==(n=this.ctx.drilldown)||n.warnSliceOffsetDisabled()),void 0!==o.interact.selectedDataPoints[0]&&o.interact.selectedDataPoints[0].indexOf(i)>-1)if(this.initialAnim&&!o.globals.resized&&!o.globals.dataChanged&&this.animDur>0){const t=o.dom.Paper;setTimeout(()=>{o.dom.Paper===t&&this.setSliceOut(i)},this.animDur)}else this.setSliceOut(i);if(o.config.dataLabels.enabled){const e=S.x,s=S.y;let a=100*b/this.fullAngle+"%";if(0!==b&&o.config.plotOptions.pie.dataLabels.minAngleToShowLabel<t[i]){const t=o.config.dataLabels.formatter;void 0!==t&&(a=t(o.globals.seriesPercent[i][0],{seriesIndex:i,dataPointIndex:i,series:o.seriesData.series,w:o}));const r=o.globals.dataLabels.style.colors[i],n=h.group({class:"apexcharts-datalabels","data:slice":i}),c=h.drawText({x:e,y:s,text:a,textAnchor:"middle",fontSize:o.config.dataLabels.style.fontSize,fontFamily:o.config.dataLabels.style.fontFamily,fontWeight:o.config.dataLabels.style.fontWeight,foreColor:r});if(n.add(c),o.config.dataLabels.dropShadow.enabled){const t=o.config.dataLabels.dropShadow;l.dropShadow(c,t)}c.node.classList.add("apexcharts-pie-label"),!this.initialAnim||o.globals.resized||o.globals.dataChanged||(c.attr({opacity:0}),c.animate(300,o.config.chart.animations.speed).attr({opacity:1})),this.sliceLabels.push(n),this.sliceLabelGroups[i]=n.node}}if(this.showExternalLabels&&0!==b){const t=this.getExternalLabelLines(i);if(t.some(t=>""!==t)){const e=Zt.polarToCartesian(this.centerX,this.centerY,o.globals.radialSize,C),s=Zt.polarToCartesian(this.centerX,this.centerY,o.globals.radialSize+(this.externalCfg.connector.gap||0),C),a=s.x>=this.centerX,r=a?s.x+(this.externalCfg.connector.length||0):s.x-(this.externalCfg.connector.length||0);this.externalLabels.push({i:i,lines:t,anchor:e,elbow:s,side:a?"right":"left",labelX:r+parseFloat(this.externalCfg.offsetX||0),idealY:s.y+parseFloat(this.externalCfg.offsetY||0),connectorColor:this.externalCfg.connector.color||o.globals.colors[i],foreColor:this.externalCfg.color||o.config.chart.foreColor})}}}if(this.showExternalLabels&&this.externalLabels.length){this.placeExternalLabels();const t=Nt.isBrowser()&&(m||this.dynamicAnim&&o.globals.dataChanged||this.initialAnim&&!o.globals.resized&&!o.globals.dataChanged);this.externalLabels.forEach(e=>{const i=new gs(o).drawExternalLabel({lines:e.lines,lineHeight:this.externalLabelLineH,anchor:e.anchor,elbow:e.elbow,labelX:e.labelX,labelY:e.labelY,side:e.side,connector:{show:this.externalCfg.connector.show,width:this.externalCfg.connector.width,color:e.connectorColor},style:this.externalLabelStyle,foreColor:e.foreColor});t&&(i.node.classList.add("apexcharts-element-hidden"),o.globals.delayedElements.push({el:i.node})),this.externalLabelGroups[e.i]=i.node,i.node.setAttribute("data:slice",String(e.i)),d.add(i)})}return d}placeExternalLabels(){const t=this.w,e=this.externalLabelMaxLines*this.externalLabelLineH,i=t.globals.radialSize+t.globals.pieExternalLabelMarginY,s=this.centerY+i,a=this.centerY-i+e/2;["left","right"].forEach(t=>{const i=this.externalLabels.filter(e=>e.side===t);!function(t,e,i,s){const a=t.slice().sort((t,e)=>t.idealY-e.idealY);a.forEach(t=>{t.labelY=t.idealY});for(let t=1;t<a.length;t++)a[t].labelY-a[t-1].labelY<e&&(a[t].labelY=a[t-1].labelY+e);const r=a[a.length-1],n=r?r.labelY-i:0;if(n>0)for(let t=a.length-1;t>=0;t--)a[t].labelY-=n,t<a.length-1&&a[t+1].labelY-a[t].labelY<e&&(a[t].labelY=a[t+1].labelY-e);if(null!=s&&a.length&&a[0].labelY<s){const t=s-a[0].labelY;for(let e=0;e<a.length;e++)a[e].labelY+=t}}(i,Math.min(e+2,(s-a)/Math.max(1,i.length-1)),s,a)})}addListeners(t,e,i){const s=new R(this.w,this.ctx);t.node.addEventListener("mouseenter",s.pathMouseEnter.bind(s,t)),t.node.addEventListener("mouseleave",s.pathMouseLeave.bind(s,t)),t.node.addEventListener("mouseleave",this.revertDataLabelsInner.bind(this)),"number"==typeof i&&(t.node.addEventListener("mouseenter",this.showHoverOutline.bind(this,i)),t.node.addEventListener("mouseleave",this.hideHoverOutline.bind(this))),t.node.addEventListener("mousedown",s.pathMouseDown.bind(s,t)),this.donutDataLabels.total.showAlways||(t.node.addEventListener("mouseenter",this.printDataLabelsInner.bind(this,t.node,e)),t.node.addEventListener("mousedown",this.printDataLabelsInner.bind(this,t.node,e)))}animatePaths(t,e){let i=e.endAngle<e.startAngle?this.fullAngle+e.endAngle-e.startAngle:e.endAngle-e.startAngle,s=i,a=e.startAngle;const r=e.startAngle;void 0!==e.prevStartAngle&&void 0!==e.prevEndAngle&&(a=e.prevEndAngle,s=e.prevEndAngle<e.prevStartAngle?this.fullAngle+e.prevEndAngle-e.prevStartAngle:e.prevEndAngle-e.prevStartAngle),i!==this.fullAngle||this.isFullTurnSlice(i)||(i=this.fullAngle-.01),this.animateArc(t,a,r,i,s,e)}animateArc(t,e,i,s,a,r){const n=this,o=this.w,l=new u(this.w),h=r.size;let c;(isNaN(e)||isNaN(a))&&(e=i,a=0,!1===o.globals.shouldAnimate&&(a=s,r.dur=0));let d=s,p=i;const g=e<i?this.fullAngle+e-i:e-i,f="number"==typeof r.prevSize;o.globals.dataChanged&&r.shouldSetPrevPaths&&Number.isFinite(r.prevEndAngle)&&(c=n.getPiePath({me:n,startAngle:r.prevStartAngle,angle:r.prevEndAngle<r.prevStartAngle?this.fullAngle+r.prevEndAngle-r.prevStartAngle:r.prevEndAngle-r.prevStartAngle,size:f?r.prevSize:h}),t.attr({d:c})),0!==r.dur?t.animate(r.dur,r.animBeginArr[r.i]).after(function(){"pie"!==n.chartType&&"donut"!==n.chartType&&"polarArea"!==n.chartType||this.animate(o.config.chart.animations.dynamicAnimation.speed).attr({"stroke-width":n.strokeWidth}),r.collapsed&&t.attr({d:""}),r.i===o.config.series.length-1&&l.animationCompleted(t)}).during(o=>{d=g+(s-g)*o,r.animateStartingPos&&(d=a+(s-a)*o,p=e-a+(i-(e-a))*o),c=n.getPiePath({me:n,startAngle:p,angle:d,size:f?r.prevSize+(h-r.prevSize)*o:h}),t.node.setAttribute("data:pathOrig",c),t.attr({d:c})}):(c=n.getPiePath({me:n,startAngle:p,angle:s,size:h}),r.isTrack||(o.globals.animationEnded=!0),t.node.setAttribute("data:pathOrig",c),t.attr({d:r.collapsed?"":c,"stroke-width":n.strokeWidth}))}pieClicked(t,e){const i=this.w,s=!(e&&!1===e.animate),a=i.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${t}`);if(a){if("true"===a.attr("data:pieClicked"))return a.attr({"data:pieClicked":"false"}),this.revertDataLabelsInner(),void this.offsetSlice(t,0,s);if(!i.config.states.active.allowMultipleDataPointsSelection){const t=i.dom.baseEl.getElementsByClassName("apexcharts-pie-area");Array.prototype.forEach.call(t,t=>{const e="true"===t.getAttribute("data:pieClicked");t.setAttribute("data:pieClicked","false"),e&&this.offsetSlice(parseInt(t.getAttribute("j"),10),0,s)})}i.interact.capturedDataPointIndex=t,a.attr("data:pieClicked","true"),this.offsetSlice(t,this.getExpandOffset(),s)}}getExpandOffset(){return D.sliceExpandOffset(this.w)}getSliceMovers(t){const e=this.w.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${t}`);return[e?e.node:null,this.sliceLabelGroups[t],this.externalLabelGroups[t],this.hoverOutlineIndex===t&&this.elHoverOutlinePath?this.elHoverOutlinePath.node:null].filter(Boolean)}offsetSlice(t,e,i=!0){const s=this.w;if(!s.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${t}`))return;const{dx:a,dy:r}=this.getSliceOffsetVector(t,e),n=`translate(${a} ${r})`,o=i&&s.config.chart.animations.enabled?"transform 320ms cubic-bezier(0.25, 0.8, 0.3, 1)":"";this.getSliceMovers(t).forEach(t=>{t.classList.add("apexcharts-slice-mover"),t.style.transition=o,t.setAttribute("transform",n)})}getSliceOffsetVector(t,e){const i=this.w.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${t}`),s=i?parseFloat(i.attr("data:angle")):NaN;if(!e||!Number.isFinite(s)||s>=this.fullAngle)return{dx:0,dy:0};const a=parseFloat(i.attr("data:startAngle")),r=Math.PI*(a+s/2-90)/180;return{dx:e*Math.cos(r),dy:e*Math.sin(r)}}showHoverOutline(t){const e=this.w;if(!D.hoverOutlineOwnsHoverState(e))return;if(!this.elHoverOutline)return;const i=this.getHoverOutlinePath(t);if(!i)return;const s=e.config.plotOptions.pie.hoverOutline,a=s.color||e.globals.colors[t];if(!this.elHoverOutlinePath){const t=new R(e);this.elHoverOutlinePath=t.drawPath({d:i,fill:a,strokeWidth:0,classes:"apexcharts-pie-hover-outline-band"}),this.elHoverOutline.add(this.elHoverOutlinePath)}this.elHoverOutlinePath.attr({d:i,fill:a,"fill-opacity":s.opacity});const{dx:r,dy:n}=this.getSliceOffsetVector(t,this.isSliceOut(t)?this.getExpandOffset():0);this.elHoverOutlinePath.node.classList.remove("apexcharts-slice-mover"),this.elHoverOutlinePath.node.style.transition="",this.elHoverOutlinePath.node.setAttribute("transform",`translate(${r} ${n})`),this.hoverOutlineIndex=t,this.elHoverOutline.node.style.opacity="1"}hideHoverOutline(){this.elHoverOutline&&(this.elHoverOutline.node.style.opacity="0")}setSliceOut(t){this.isSliceOut(t)||this.pieClicked(t,{animate:!1})}isSliceOut(t){const e=this.w.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${t}`);return!!e&&"true"===e.attr("data:pieClicked")}getHoverOutlinePath(t){const e=this.w,i=e.config.plotOptions.pie.hoverOutline,s=e.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${t}`);if(!s)return null;const a=parseFloat(s.attr("data:angle"));if(!Number.isFinite(a)||a<=0)return null;const r=this.sliceSizes[t],n=Number(i.size);if(!Number.isFinite(r)||!Number.isFinite(n)||n<=0)return null;const{startDeg:h,spanDeg:c}=this.getSliceExtent({me:this,startAngle:parseFloat(s.attr("data:startAngle")),angle:a,size:r});if(!(c>0))return null;const d=r+(this.strokeWidth||0)/2+(Number(i.gap)||0),u=d+n,p={cx:this.centerX,cy:this.centerY,rIn:d,rOut:u,a0:h,a1:h+c,spanDeg:c},g=Math.min(n/2,c*Math.PI/180/2*d);return g>.5?ys(l(o({},p),{r:g})):function({cx:t,cy:e,rIn:i,rOut:s,a0:a,a1:r,spanDeg:n}){const o=(i,s)=>xs(t,e,i,s),l=n>180?1:0,h=o(s,a),c=o(s,r),d=o(i,r),u=o(i,a);return["M",bs(h),"A",s,s,0,l,1,bs(c),"L",bs(d),"A",i,i,0,l,0,bs(u),"Z"].join(" ")}(p)}getChangedPath(t,e,i){return this.dynamicAnim&&this.w.globals.dataChanged&&"number"==typeof i?this.getPiePath({me:this,startAngle:t,angle:e-t,size:i}):""}getSliceExtent({me:t,startAngle:e,angle:i,size:s}){const a=this.w;let r=e,n=i+e;Math.ceil(n)>=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle&&(n=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle-.01);let o=n-r;const l="pie"===t.chartType||"donut"===t.chartType||"polarArea"===t.chartType,h=a.config.plotOptions.pie.spacing;if(l&&h>0&&o>0){const e="donut"===t.chartType?(s+t.donutSize)/2:s,i=e>0?h/e*(180/Math.PI):0,a=Math.min(i/2,Math.max(0,o/2-.5));r+=a,o-=2*a}return n=r+o,Math.ceil(n)>this.fullAngle&&(n-=this.fullAngle),{startDeg:r,spanDeg:o,endDeg:n}}isFullTurnSlice(t){const e=this.chartType;return("pie"===e||"donut"===e||"polarArea"===e)&&this.fullAngle>=360&&t>=this.fullAngle-1e-4&&!(this.w.config.plotOptions.pie.spacing>0)}getFullTurnPath({me:t,startAngle:e,size:i}){const s=new R(this.w),a=t.centerX,r=t.centerY,n=Zt.polarToCartesian(a,r,i,e),o=Zt.polarToCartesian(a,r,i,e+180),l=["M",n.x,n.y,"A",i,i,0,1,1,o.x,o.y,"A",i,i,0,1,1,n.x,n.y,"z"];if("donut"===t.chartType){const i=Zt.polarToCartesian(a,r,t.donutSize,e),s=Zt.polarToCartesian(a,r,t.donutSize,e+180);l.push("M",i.x,i.y,"A",t.donutSize,t.donutSize,0,1,0,s.x,s.y,"A",t.donutSize,t.donutSize,0,1,0,i.x,i.y,"z")}return s.roundPathCorners(l.join(" "),2*this.strokeWidth)}getPiePath({me:t,startAngle:e,angle:i,size:s}){let a;const r=this.w,n=new R(this.w),o="pie"===t.chartType||"donut"===t.chartType||"polarArea"===t.chartType;if(o&&this.isFullTurnSlice(i))return this.getFullTurnPath({me:t,startAngle:e,size:s});if(o&&Number.isFinite(i)&&!(i>0)){const i=Zt.polarToCartesian(t.centerX,t.centerY,s,e);return`M ${i.x} ${i.y}`}const{startDeg:l,spanDeg:h,endDeg:c}=this.getSliceExtent({me:t,startAngle:e,angle:i,size:s}),d=Math.PI*(l-90)/180,u=r.config.plotOptions.pie.borderRadius;if(u>0&&o){const e=this.getRoundedSlicePath({me:t,startDeg:l,spanDeg:h,size:s,borderRadius:u});if(e)return e}const p=Math.PI*(c-90)/180,g=t.centerX+s*Math.cos(d),f=t.centerY+s*Math.sin(d),m=t.centerX+s*Math.cos(p),x=t.centerY+s*Math.sin(p),b=Zt.polarToCartesian(t.centerX,t.centerY,t.donutSize,c),y=Zt.polarToCartesian(t.centerX,t.centerY,t.donutSize,l),v=h>180?1:0,w=["M",g,f,"A",s,s,0,v,1,m,x];return a="donut"===t.chartType?[...w,"L",b.x,b.y,"A",t.donutSize,t.donutSize,0,v,0,y.x,y.y,"L",g,f,"z"].join(" "):"pie"===t.chartType||"polarArea"===t.chartType?[...w,"L",t.centerX,t.centerY,"L",g,f].join(" "):[...w].join(" "),n.roundPathCorners(a,2*this.strokeWidth)}getRoundedSlicePath({me:t,startDeg:e,spanDeg:i,size:s,borderRadius:a}){if(!(i>0))return null;const r=Math.PI/180,n=t.centerX,o=t.centerY,l="donut"===t.chartType,h=s,c=l?t.donutSize:0,d=i*r;let u=a;if(u=Math.min(u,d*h/2),l?(u=Math.min(u,d*c/2),u=Math.min(u,(h-c)/2)):u=Math.min(u,h/2),!(u>.5))return null;const p=e,g=e+i;return l?ys({cx:n,cy:o,rIn:c,rOut:h,a0:p,a1:g,r:u,spanDeg:i}):function({cx:t,cy:e,rOut:i,a0:s,a1:a,r:r,spanDeg:n}){const o=(i,s)=>xs(t,e,i,s),l=r/i*ms,h=o(i,s+l),c=o(i,a-l),d=n-2*l>180?1:0,u=o(i,a),p=o(i-r,a),g=o(i,s),f=o(i-r,s);return["M",bs(h),"A",i,i,0,d,1,bs(c),"Q",bs(u),bs(p),"L",`${t} ${e}`,"L",bs(f),"Q",bs(g),bs(h),"Z"].join(" ")}({cx:n,cy:o,rOut:h,a0:p,a1:g,r:u,spanDeg:i})}drawPolarElements(t){const e=this.w,i=new $(this.w),s=new R(this.w),a=new gs(this.w),r=s.group(),n=s.group(),o=i.niceScale(0,Math.ceil(this.maxY),0),l=o.result.reverse(),h=o.result.length;this.maxY=o.niceMax;let c=e.globals.radialSize;const d=c/(h-1);for(let t=0;t<h-1;t++){const i=s.drawCircle(c);if(i.attr({cx:this.centerX,cy:this.centerY,fill:"none","stroke-width":e.config.plotOptions.polarArea.rings.strokeWidth,stroke:e.config.plotOptions.polarArea.rings.strokeColor}),e.config.yaxis[0].show){const i=a.drawYAxisTexts(this.centerX,this.centerY-c+parseInt(e.config.yaxis[0].labels.style.fontSize,10)/2,t,l[t]);n.add(i)}r.add(i),c-=d}this.drawSpokes(t),t.add(r),t.add(n)}renderInnerDataLabels(t,e,i){const s=this.w,a=new R(this.w),r=e.total.show;t.node.innerHTML="",t.node.style.opacity=i.opacity;const n=i.centerX,o=i.centerY,l=e.name.show&&!!this.donutDataLabels.total.label;let h,c;h=void 0===e.name.color?s.globals.colors[0]:e.name.color;let d=e.name.fontSize,u=e.name.fontFamily,p=e.name.fontWeight;c=void 0===e.value.color?s.config.chart.foreColor:e.value.color;const g=e.value.formatter;let f="",m="";if(r?(h=e.total.color,d=e.total.fontSize,u=e.total.fontFamily,p=e.total.fontWeight,m=this.donutDataLabels.total.label?e.total.label:"",f=e.total.formatter(s)):1===s.seriesData.series.length&&(f=g(s.seriesData.series[0],s),m=s.seriesData.seriesNames[0]),m&&(m=e.name.formatter(m,e.total.show,s)),e.name.show){const i=a.drawText({x:n,y:o+parseFloat(e.name.offsetY),text:m,textAnchor:"middle",foreColor:h,fontSize:d,fontWeight:p,fontFamily:u});i.node.classList.add("apexcharts-datalabel-label"),t.add(i)}if(e.value.show){const i=l?parseFloat(e.value.offsetY)+16:e.value.offsetY,s=a.drawText({x:n,y:o+i,text:f,textAnchor:"middle",foreColor:c,fontWeight:e.value.fontWeight,fontSize:e.value.fontSize,fontFamily:e.value.fontFamily});s.node.classList.add("apexcharts-datalabel-value"),t.add(s)}return t}printInnerLabels(t,e,i,s){const a=this.w;let r;s?r=void 0===t.name.color?a.globals.colors[parseInt(s.parentNode.getAttribute("rel"),10)-1]:t.name.color:a.seriesData.series.length>1&&t.total.show&&(r=t.total.color);const n=a.dom.baseEl.querySelector(".apexcharts-datalabel-label"),o=a.dom.baseEl.querySelector(".apexcharts-datalabel-value");i=(0,t.value.formatter)(i,a),s||"function"!=typeof t.total.formatter||(i=t.total.formatter(a));const l=e===t.total.label;if(e=this.donutDataLabels.total.label?t.name.formatter(e,l,a):"",null!==n&&(n.textContent=e),null!==o&&(o.textContent=i),null!==n){n.style.fill=r}}printDataLabelsInner(t,e){const i=this.w,s=t.getAttribute("data:value"),a=i.seriesData.seriesNames[parseInt(t.parentNode.getAttribute("rel"),10)-1];i.seriesData.series.length>1&&this.printInnerLabels(e,a,s,t);const r=i.dom.baseEl.querySelector(".apexcharts-datalabels-group");if(null!==r){r.style.opacity="1"}}drawSpokes(t){const e=this.w,i=new R(this.w),s=e.config.plotOptions.polarArea.spokes;if(0===s.strokeWidth)return;const a=e.globals.collapsedSeriesIndices||[],r=e.seriesData.series.length,n=360/Math.max(1,r-a.filter(t=>t<r).length);let o=0;for(let l=0;l<r;l++){if(a.indexOf(l)>-1)continue;const r=Zt.polarToCartesian(this.centerX,this.centerY,e.globals.radialSize,e.config.plotOptions.pie.startAngle+n*o++),h=i.drawLine(r.x,r.y,this.centerX,this.centerY,Array.isArray(s.connectorColors)?s.connectorColors[l]:s.connectorColors);t.add(h)}}revertDataLabelsInner(){const t=this.w;if(this.donutDataLabels.show){const e=t.dom.Paper.findOne(".apexcharts-datalabels-group"),i=this.renderInnerDataLabels(e,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:this.donutDataLabels.show});t.dom.Paper.findOne(".apexcharts-radialbar, .apexcharts-pie").add(i)}}}function ws(t,e,i,s){const a=s*s,r=i*i;return Math.max(a*e/r,r/(a*t))}function _s(t,e,i,s,a,r){if(0===t)return!0;return ws(e,i,s,r)>=ws(Math.min(e,a),Math.max(i,a),s+a,r)}function As(t,e,i,s,a,r,n,o){if(n>=o){const n=s/o;let l=r;for(let s=0;s<i;s++){const i=e[s]/n;t.push([a,l,a+n,l+i]),l+=i}}else{const o=s/n;let l=a;for(let s=0;s<i;s++){const i=e[s]/o;t.push([l,r,l+i,r+o]),l+=i}}}function Ss(t){const e=t.children;if(e&&e.length){let i=0;for(let t=0;t<e.length;t++)i+=Ss(e[t]);return t._area=i,i}const i=Number(t.value),s=isNaN(i)?0:Math.abs(i);return t._area=s,s}function Cs(t,e,i,s,a,r,n,o){const l=t.length;if(0===l||s<=0||a<=0)return;const h=new Array(l);let c=0;for(let e=0;e<l;e++)h[e]=t[e]._area,c+=h[e];if(c<=0)return;const d=function(t,e,i,s,a){const r=[],n=t.length;if(0===n)return r;const o=new Array(n);let l=0,h=0,c=1/0,d=-1/0,u=0;for(;u<n;){const n=Math.min(s,a),p=t[u];if(_s(l,c,d,h,p,n))o[l]=p,l++,h+=p,p<c&&(c=p),p>d&&(d=p),u++;else{if(As(r,o,l,h,e,i,s,a),s>=a){const t=h/a;e+=t,s-=t}else{const t=h/s;i+=t,a-=t}l=0,h=0,c=1/0,d=-1/0}}return l>0&&As(r,o,l,h,e,i,s,a),r}(function(t,e){let i=0;for(let e=0;e<t.length;e++)i+=t[e];const s=e/i,a=new Array(t.length);for(let e=0;e<t.length;e++)a[e]=t[e]*s;return a}(h,s*a),e,i,s,a);for(let e=0;e<l;e++){const i=t[e],s=d[e];if(!s)continue;i.rect=s,i.depth=r;const a=i.children;if(!a||!a.length)continue;const l=s[2]-s[0],h=s[3]-s[1];let c=Math.max(0,n(i,r,l,h)||0);(2*c>=l||2*c>=h)&&(c=0);let u=Math.max(0,o(i,r,l,h)||0);u>0&&h-2*c-u<u&&(u=0),i.headerHeight=u,Cs(a,s[0]+c,s[1]+u+c,l-2*c,h-u-2*c,r+1,n,o)}}const ks={generateNested:function(t,e,i,s={}){if(!Array.isArray(t)||0===t.length)return t||[];const a=s.padding||(()=>0),r=s.header||(()=>0);for(let e=0;e<t.length;e++)Ss(t[e]);return Cs(t,0,0,e,i,0,a,r),t}};function Ps(t,e){var i;const s=String(t).replace(/\//g,"%2F"),a=(null!=(i=e.get(s))?i:-1)+1;return e.set(s,a),`${a}:${s}`}function Ls(t,e,i,s,a,r=null,n={},o=new Map){var l,h,c;const d=e&&"object"==typeof e,u=d&&null!=(h=null!=(l=e.x)?l:e.name)?h:"",p=d?null!=(c=e.y)?c:e.value:e,g=null==p||""===p?NaN:Number(p),f={name:String(u),value:isNaN(g)?null:g,color:d&&e.color?e.color:void 0,_key:`${a}/${Ps(u,o)}`};s&&!f.color&&(f.color=s[i%s.length]),n.keepDatum&&(f._datum=e);const m=new Map;if(d&&Array.isArray(e.children)&&e.children.length)f.children=e.children.map((e,i)=>Ls(t,e,i,null,f._key,r,n,m));else if(d&&null!=e.drilldown&&!1!==n.expandDrilldown){const i=r||new Set;if(!i.has(e.drilldown)){const s=function(t,e){const i=t.config.drilldown;return(i&&Array.isArray(i.series)?i.series:[]).find(t=>t&&t.id===e)}(t,e.drilldown);if(s&&Array.isArray(s.data)&&s.data.length){const a=new Set(i);a.add(e.drilldown);const r=Array.isArray(s.colors)?s.colors:null;f.children=s.data.map((e,i)=>Ls(t,e,i,r,f._key,a,n,m))}}}return f}function Ms(t){t.children&&t.children.length&&(t.children.forEach(t=>Ms(t)),(null==t.value||isNaN(t.value))&&(t.value=t.children.reduce((t,e)=>t+Math.max(0,e.value||0),0))),(null==t.value||isNaN(t.value))&&(t.value=0)}function Is(t){if("string"!=typeof t)return"";const e=t.indexOf("/");return-1===e?"":t.slice(e)}function Es(t){const e=t.globals.treemapRoots;if(e&&e.length)return{roots:e,maxDepth:t.globals.treemapMaxDepth||1};const i=function(t,e,i={}){const s=e||t.config.series;if(!Array.isArray(s))return[];const a=new Map;return s.map((e,s)=>{var r,n;const o=e&&Array.isArray(e.data)?e.data:[],l=Ps(null!=(r=null==e?void 0:e.name)?r:"",a),h=new Map;return{name:String(null!=(n=null==e?void 0:e.name)?n:""),value:null,color:(null==e?void 0:e.color)||void 0,_key:l,_seriesIndex:s,children:o.map((e,s)=>Ls(t,e,s,null,l,null,i,h))}})}(t,t.config.series,{keepDatum:!0,expandDrilldown:!1});i.forEach(Ms);const{maxDepth:s}=function(t){const e=[];let i=0;return t.forEach((t,s)=>{const a=[],r=(t,e,n)=>{t._parent=n,t._depth=e,t._si=s,t._leaf=!(t.children&&t.children.length),e>i&&(i=e),t._leaf?(t._di=a.length,a.push(t)):(t._di=-1,t.children.forEach(i=>r(i,e+1,t)))};r(t,0,null),e.push(a)}),{leaves:e,maxDepth:i}}(i);return{roots:i,maxDepth:s}}const Fs="http://www.w3.org/1999/xhtml";function Ds(t,e){const i=t.config.drilldown&&t.config.drilldown.breadcrumb||{};return Object.assign({show:!0,position:"top-left",separator:" / ",rootLabel:"All",offsetX:0,offsetY:0,formatter:void 0},i,e)}function Ts(t){const e=t.dom.elWrap;if(!e)return;const i=e.querySelector(".apexcharts-breadcrumb");i&&i.parentNode&&i.parentNode.removeChild(i)}const Rs=t=>"string"==typeof t&&/^(#|rgb)/i.test(t);function zs(t,e,i,s){return Rs(i)&&Rs(s)&&i!==s?[l(o({},t),{fill:i}),l(o({},e),{fill:s})]:[t,e]}const Xs=t=>{var e;const i=t.config.plotOptions.treemap.parents.show;return!0===i||!1!==i&&!!(null==(e=t.globals.treemapRoots)?void 0:e.length)},Os=t=>W.treemapHeaderLook(t);c.default.use({line:ps,area:ps,scatter:ps,bubble:ps,rangeArea:ps,bar:Ui,column:Ui,barStacked:class extends Ui{draw(t,e){const i=this.w;this.graphics=new R(this.w);const s=new P(this.w);t=s.getLogSeries(t),this.yRatio=s.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t,e),"100%"===i.config.chart.stackType&&(t=i.globals.comboCharts?e.map(t=>i.globals.seriesPercent[t]):i.globals.seriesPercent.slice()),this.series=t,this.barHelpers.initializeStackedPrevVars(this);const a=this.graphics.group({class:"apexcharts-bar-series apexcharts-plot-series"}),r=this.ctx.highlightFilter;let n=0,h=0;const c=i.config.chart.animations,d=c.enabled&&c.dynamicAnimation.enabled&&i.globals.previousPaths.length>0;let u=!1;for(let s=0,c=0;s<t.length;s++,c++){const p=i.globals.comboCharts?e[s]:s,{groupIndex:g,columnGroupIndex:f}=this.barHelpers.getGroupIndex(p);this.groupCtx=this.stacks[g];const m=[],x=[],b=this.setSeriesAxis(p);let y=this.graphics.group({class:"apexcharts-series",seriesName:Zt.escapeString(i.seriesData.seriesNames[p]),rel:s+1,"data:realIndex":p});W.addCollapsedClassToSeries(this.w,y,p);const v=this.graphics.group({class:"apexcharts-datalabels","data:realIndex":p});W.addCollapsedClassToSeries(this.w,v,p),(i.globals.collapsingSeriesIndices||[]).indexOf(p)>-1&&v.node.style.setProperty("--apexcharts-dl-exit",`${i.config.chart.animations.dynamicAnimation.speed}ms`);const w=this.graphics.group({class:"apexcharts-bar-goals-markers"}),_=this.initialPositions(n,h,void 0,void 0,void 0,void 0,b),{xDivision:A,yDivision:S,zeroH:C,zeroW:k}=_;let P=_.barHeight,L=_.barWidth;h=_.y,n=_.x,i.globals.barHeight=P,i.globals.barWidth=L,this.barHelpers.initializeStackedXYVars(this),1===this.groupCtx.prevY.length&&this.groupCtx.prevY[0].every(t=>isNaN(t))&&(this.groupCtx.prevY[0]=this.groupCtx.prevY[0].map(()=>C),this.groupCtx.prevYF[0]=this.groupCtx.prevYF[0].map(()=>0));for(let e=0;e<i.globals.dataPoints;e++){const a=this.barHelpers.getStrokeWidth(s,e,p),g={indexes:{i:s,j:e,realIndex:p,translationsIndex:b,bc:c},strokeWidth:a,x:n,y:h,elSeries:y,columnGroupIndex:f};let M=null;this.isHorizontal?(M=this.drawStackedBarPaths(l(o(o({},g),this.barHelpers.rows&&{y:_.y+this.barHelpers.barRow(p,e)*S}),{zeroW:k,barHeight:P,yDivision:S})),L=this.series[s][e]/this.invertedYRatio):(M=this.drawStackedColumnPaths(l(o({},g),{xDivision:A,barWidth:L,zeroH:C})),P=this.series[s][e]/this.yRatio[b]);const I=this.barHelpers.drawGoalLine({barXPosition:M.barXPosition,barYPosition:M.barYPosition,goalX:M.goalX,goalY:M.goalY,barHeight:P,barWidth:L});I&&w.add(I),h=M.y,n=M.x,m.push(n),x.push(h);const E=this.barHelpers.getPathFillColor(t,s,e,p);let F="";const D=i.globals.isBarHorizontal?"apexcharts-flip-x":"apexcharts-flip-y",T=this.cornerFlip(this.barHelpers.arrBorderRadius[p][e],i.seriesData.series[p][e]),R=d&&!T&&this.getPreviousFlip(p,e);(T||R)&&(F=D),R&&(F+=" apexcharts-flip-held",u=!0),y=this.renderSeries(l(o({hl:null==r?void 0:r.bar(this,{i:s,j:e,realIndex:p,translationsIndex:b,paths:M,zeroH:C,zeroW:k}),realIndex:p,pathFill:E.color},E.useRangeColor?{lineFill:E.color}:{}),{j:e,i:s,columnGroupIndex:f,pathFrom:M.pathFrom,pathTo:M.pathTo,strokeWidth:a,elSeries:y,x:n,y:h,series:t,barHeight:P,barWidth:L,barXPosition:M.barXPosition,elDataLabelsWrap:v,elGoalsMarkers:w,type:"bar",visibleSeries:f,classes:F}))}i.globals.seriesXvalues[p]=m,i.globals.seriesYvalues[p]=x,this.groupCtx.prevY.push(this.groupCtx.yArrj),this.groupCtx.prevYF.push(this.groupCtx.yArrjF),this.groupCtx.prevYVal.push(this.groupCtx.yArrjVal),this.groupCtx.prevX.push(this.groupCtx.xArrj),this.groupCtx.prevXF.push(this.groupCtx.xArrjF),this.groupCtx.prevXVal.push(this.groupCtx.xArrjVal),a.add(y)}return u&&this.settleHeldMirrors(a),a}cornerFlip(t,e){return"bottom"===t&&e>0||"top"===t&&e<0}settleHeldMirrors(t){const e=this.w;if(!Nt.isBrowser())return;const i=e.config.chart.animations,s=(i.dynamicAnimation.speed||0)+(i.speed||0)+100,a=(t?t.node:e.dom.baseEl).querySelectorAll(".apexcharts-flip-held");setTimeout(()=>{a.forEach(t=>{t.classList.remove("apexcharts-flip-held","apexcharts-flip-y","apexcharts-flip-x")})},s)}initialPositions(t,e,i,s,a,r,n){const o=this.w;let l,h;if(this.isHorizontal){s=o.layout.gridHeight/o.globals.dataPoints;const t=o.config.plotOptions.bar.barHeight;l=-1===String(t).indexOf("%")?parseInt(t,10):s*parseInt(t,10)/100,r=o.globals.padHorizontal+(this.isReversed?o.layout.gridWidth-this.baseLineInvertedY:this.baseLineInvertedY),e=(s-l)/2}else{h=i=o.layout.gridWidth/o.globals.dataPoints;const e=o.config.plotOptions.bar.columnWidth,s=o.axisFlags.isXNumeric?this.barHelpers.barSlotXSpan():0;s>0?h=(i=s/this.xRatio)*parseInt(this.barOptions.columnWidth,10)/100:h*=parseInt(e,10)/100,-1===String(e).indexOf("%")&&(h=parseInt(e,10)),a=this.isReversed?this.baseLineY[n]:o.layout.gridHeight-this.baseLineY[n],t=o.globals.padHorizontal+(i-h)/2}const c=o.globals.barGroups.length||1;return{x:t,y:e,yDivision:s,xDivision:i,barHeight:(null!=l?l:0)/c,barWidth:(null!=h?h:0)/c,zeroH:a,zeroW:r}}drawStackedBarPaths({indexes:t,barHeight:e,strokeWidth:i,zeroW:s,x:a,y:r,columnGroupIndex:n,yDivision:o,elSeries:l}){var h,c;const d=this.w,u=r+n*e;let p;const g=t.i,f=t.j,m=t.realIndex,x=t.translationsIndex,b=null!=(c=null==(h=this.series[g])?void 0:h[f])?c:null,y=this.groupCtx,v=d.axisFlags.isXNumeric?d.seriesData.seriesX[m][f]:f,w=y.tops.get(v);if(w){const[t,e,i]=w,s=2*(this.isReversed?i:0);p=e<0?b>=0?t+i-s:t:b>=0?t:t-i+s}else p=s;a=p+b/this.invertedYRatio*(this.isReversed?-1:1);const _=this.barHelpers.getBarpaths({barYPosition:u,barHeight:e,x1:p,x2:a,strokeWidth:i,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:g,j:f,w:d});return this._setTop(v,w,y.xArrj[f],y.xArrjVal[f],y.xArrjF[f],m,f),this.barHelpers.barBackground({j:f,i:g,y1:u,y2:e,elSeries:l}),r+=o,{pathTo:_.pathTo,pathFrom:_.pathFrom,goalX:this.barHelpers.getGoalValues("x",s,null,m,f,x),barXPosition:p,barYPosition:u,x:a,y:r}}drawStackedColumnPaths({indexes:t,x:e,y:i,xDivision:s,barWidth:a,zeroH:r,columnGroupIndex:n,strokeWidth:o,elSeries:l}){var h,c,d;const u=this.w,p=t.i,g=t.j,f=t.bc,m=t.realIndex,x=t.translationsIndex,b=null!=(c=null==(h=this.series[p])?void 0:h[g])?c:null;if(u.axisFlags.isXNumeric){let t=u.seriesData.seriesX[m][g];t||(t=0),e=(t-u.globals.minX)/this.xRatio-a/2*u.globals.barGroups.length}const y=e+n*a;let v;const w=this.groupCtx,_=u.axisFlags.isXNumeric?u.seriesData.seriesX[m][g]:g,A=w.tops.get(_);if(A){const[t,e,i]=A;let s;e<0?s=b>=0?t-i+2*(this.isReversed?i:0):t:e>=0&&(s=b>=0?t:t+i-2*(this.isReversed?i:0)),void 0===s&&(s=u.layout.gridHeight),v=(null==(d=w.prevYF[0])?void 0:d.every(t=>0===t))&&w.prevYF.slice(1).every(t=>t.every(t=>isNaN(t)))?r:s}else v=r;i=v-b/this.yRatio[x]*(this.isReversed?-1:1);const S=this.barHelpers.getColumnPaths({barXPosition:y,barWidth:a,y1:v,y2:i,yRatio:this.yRatio[x],strokeWidth:o,insetWidth:u.config.stroke.show?this.strokeWidth:0,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:p,j:g,w:u});return this._setTop(_,A,w.yArrj[g],w.yArrjVal[g],w.yArrjF[g],m,g),this.barHelpers.barBackground({bc:f,j:g,i:p,x1:y,x2:a,elSeries:l}),{pathTo:S.pathTo,pathFrom:S.pathFrom,goalY:this.barHelpers.getGoalValues("y",null,r,m,g,x),barXPosition:y,x:u.axisFlags.isXNumeric?e:e+s,y:i}}_setTop(t,e,i,s,a,r,n){isNaN(i)||this.groupCtx.tops.set(t,[i,s,(e?e[2]:0)+a,(e?e[3]:0)+(this.w.seriesData.series[r][n]||0),e?Math.min(e[0],e[4]):1/0,e?Math.max(e[0],e[5]):-1/0])}},rangeBar:class extends Ui{draw(t,e){var i,s,a,r,n,l;const h=this.w,c=new R(this.w);this.rangeBarOptions=this.w.config.plotOptions.rangeBar,this.series=t,this.seriesRangeStart=h.rangeData.seriesRangeStart,this.seriesRangeEnd=h.rangeData.seriesRangeEnd,this.barHelpers.initVariables(t,e);const d=c.group({class:"apexcharts-rangebar-series apexcharts-plot-series"});for(let u=0;u<t.length;u++){let p,g;const f=h.globals.comboCharts?e[u]:u,{columnGroupIndex:m}=this.barHelpers.getGroupIndex(f),x=c.group({class:"apexcharts-series",seriesName:Zt.escapeString(h.seriesData.seriesNames[f]),rel:u+1,"data:realIndex":f});W.addCollapsedClassToSeries(this.w,x,f),t[u].length>0&&(this.visibleI=this.visibleI+1);const b=this.setSeriesAxis(f);this.isHorizontal&&h.labelData.timescaleLabels.length&&(this.isReversed=!1);const y=this.barHelpers.initialPositions(f),{y:v,zeroW:w,x:_,zeroH:A}=y,S=null!=(i=y.yDivision)?i:0,C=null!=(s=y.xDivision)?s:0;g=v,p=_;const k=c.group({class:"apexcharts-datalabels","data:realIndex":f}),P=c.group({class:"apexcharts-rangebar-goals-markers"}),L=h.config.series[f].data;for(let e=0;e<h.globals.dataPoints;e++){const i=this.barHelpers.getStrokeWidth(u,e,f);let s=null!=(a=y.barWidth)?a:0,c=null!=(r=y.barHeight)?r:0;const d=this.seriesRangeStart[f][e],v=this.seriesRangeEnd[f][e];let _=null,M=null,I=null;const E={x:p,y:g,strokeWidth:i,elSeries:x};let F=this.seriesLen;if(h.config.plotOptions.bar.rangeBarGroupRows&&(F=1),void 0===(null==L?void 0:L[e]))break;if(this.isHorizontal){I=g+c*this.visibleI;const t=(S-c*F)/2;if(null!=(null==(n=L[e])?void 0:n.x)){const i=this.detectOverlappingBars({i:f,j:e,barYPosition:I,srty:t,barHeight:c,yDivision:S,initPositions:y});c=i.barHeight,I=i.barYPosition}_=this.drawRangeBarPaths(o({indexes:{i:u,j:e,realIndex:f},barHeight:c,barYPosition:I,zeroW:w,yDivision:S,y1:d,y2:v},E)),s=_.barWidth}else{h.axisFlags.isXNumeric&&(p=(h.seriesData.seriesX[f][e]-h.globals.minX)/this.xRatio-s/2),M=p+s*this.visibleI;const t=(C-s*F)/2;if(null!=(null==(l=L[e])?void 0:l.x)){const i=this.detectOverlappingBars({i:f,j:e,barXPosition:M,srtx:t,barWidth:s,xDivision:C,initPositions:y});s=i.barWidth,M=i.barXPosition}_=this.drawRangeColumnPaths(o({indexes:{i:u,j:e,realIndex:f,translationsIndex:b},barWidth:s,barXPosition:M,zeroH:A,xDivision:C},E)),c=_.barHeight,M=_.barXPosition}const D=this.barHelpers.drawGoalLine({barXPosition:M,barYPosition:I,goalX:_.goalX,goalY:_.goalY,barHeight:c,barWidth:s});D&&P.add(D),g=_.y,p=_.x;const T=this.barHelpers.getPathFillColor(t,u,e,f);this.renderSeries({realIndex:f,pathFill:T.color,lineFill:T.useRangeColor?T.color:h.globals.stroke.colors[f],j:e,i:u,x:p,y:g,y1:d,y2:v,pathFrom:_.pathFrom,pathTo:_.pathTo,strokeWidth:i,elSeries:x,series:t,barHeight:c,barWidth:s,barXPosition:M,barYPosition:I,columnGroupIndex:m,elDataLabelsWrap:k,elGoalsMarkers:P,visibleSeries:this.visibleI,type:"rangebar"})}h.globals.previousPaths.length>0&&Gi({w:h,elSeries:x,record:this._prevRecord(f),newKeys:this._keys(f),isHorizontal:this.isHorizontal,speed:h.config.chart.animations.dynamicAnimation.speed}),d.add(x)}return d}detectOverlappingBars({i:t,j:e,barYPosition:i,barXPosition:s,srty:a,srtx:r,barHeight:n,barWidth:o,yDivision:l,xDivision:h,initPositions:c}){var d,u,p,g;const f=this.w;let m=[];const x=null==(u=null==(d=f.globals.seriesRangeName)?void 0:d[t])?void 0:u[e],b=null==(g=null==(p=f.config.series[t].data)?void 0:p[e])?void 0:g.x,y=Array.isArray(b)?b.join(" "):b,v=this;v._rowKeys||(v._rowKeys=f.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t));const w=v._rowKeys.indexOf(y),_=f.config.plotOptions.bar.rangeBarOverlap?-1:f.rangeData.seriesRange[t].findIndex(t=>{var e;return t.x===y&&(null==(e=t.overlaps)?void 0:e.size)>0});return this.isHorizontal?(i=f.config.plotOptions.bar.rangeBarGroupRows?a+l*w:a+n*this.visibleI+l*w,_>-1&&(m=Array.from(f.rangeData.seriesRange[t][_].overlaps),m.indexOf(x)>-1&&(i+=(n=c.barHeight/m.length)*m.indexOf(x)))):(w>-1&&!f.axisFlags.isXNumeric&&(s=f.config.plotOptions.bar.rangeBarGroupRows?r+h*w:r+o*this.visibleI+h*w),_>-1&&(m=Array.from(f.rangeData.seriesRange[t][_].overlaps),m.indexOf(x)>-1&&(s+=(o=c.barWidth/m.length)*m.indexOf(x)))),{barYPosition:i,barXPosition:s,barHeight:n,barWidth:o}}drawRangeColumnPaths({indexes:t,x:e,xDivision:i,barWidth:s,barXPosition:a,zeroH:r}){var n,o;const l=this.w,{i:h,j:c,realIndex:d,translationsIndex:u}=t,p=this.yRatio[u]*(this.isReversed?-1:1),g=this.getRangeValue(d,c);let f=Math.min(g.start,g.end),m=Math.max(g.start,g.end);const x=!(void 0===(null==(n=this.series[h])?void 0:n[c])||null===(null==(o=this.series[h])?void 0:o[c]));x?(f=r-f/p,m=r-m/p):f=m=r;const b=Math.abs(m-f),y=this.barHelpers.getColumnPaths({barXPosition:a,barWidth:s,y1:f,y2:m,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,realIndex:d,i:d,j:c,w:l});if(x){const t=y.drawnBox,e=g.end>=g.start;this.recordColumnGeometry(d,c,{slotStart:t.x1,slotEnd:t.x2,levelStart:e?t.y1:t.y2,levelEnd:e?t.y2:t.y1,horizontal:!1})}if(l.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:c,realIndex:d,barWidth:s});e=t.x,a=t.barXPosition}else e+=i;return{pathTo:y.pathTo,pathFrom:y.pathFrom,barHeight:b,x:e,y:g.start<0&&g.end<0?f:m,goalY:this.barHelpers.getGoalValues("y",null,r,d,c,u),barXPosition:a}}_keys(t){const e=this._keyCache||(this._keyCache={}),i=this.w.config.series[t].data;return e[t]||(e[t]=Xi((i||[]).map((t,e)=>{var i;return"c:"+(null!=(i=null==t?void 0:t.x)?i:e)})))}preventBarOverflow(t){const e=this.w;return t<0&&(t=0),t>e.layout.gridWidth&&(t=e.layout.gridWidth),t}drawRangeBarPaths({indexes:t,y:e,y1:i,y2:s,yDivision:a,barHeight:r,barYPosition:n,zeroW:o}){const l=this.w,{realIndex:h,j:c}=t,d=this.invertedYRatio*(this.isReversed?-1:1),u=this.preventBarOverflow(o+i/d),p=this.preventBarOverflow(o+s/d),g=this.getRangeValue(h,c),f=Math.abs(p-u),m=this.barHelpers.getBarpaths({barYPosition:n,barHeight:r,x1:u,x2:p,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,i:h,realIndex:h,j:c,w:l});if(null!=g.start&&null!=g.end){const t=m.drawnBox;this.recordColumnGeometry(h,c,{slotStart:t.y1,slotEnd:t.y2,levelStart:t.x1,levelEnd:t.x2,horizontal:!0})}return l.axisFlags.isXNumeric||(e+=a),{pathTo:m.pathTo,pathFrom:m.pathFrom,barWidth:f,x:g.start<0&&g.end<0?u:p,goalX:this.barHelpers.getGoalValues("x",o,null,h,c,0),y:e}}recordColumnGeometry(t,e,i){const s=this.w.waterfallData&&this.w.waterfallData.geometry;s&&isFinite(i.slotStart)&&isFinite(i.levelEnd)&&(s[t]||(s[t]=[]),s[t][e]=i)}getRangeValue(t,e){const i=this.w;return{start:i.rangeData.seriesRangeStart[t][e],end:i.rangeData.seriesRangeEnd[t][e]}}},candlestick:as,boxPlot:as,pie:vs,donut:vs,polarArea:vs,radialBar:class extends vs{constructor(t,e){super(t,e),this.ctx=e,this.w=t,this.animBeginArr=[0],this.startAngle=t.config.plotOptions.radialBar.startAngle,this.endAngle=t.config.plotOptions.radialBar.endAngle,this.totalAngle=Math.abs(t.config.plotOptions.radialBar.endAngle-t.config.plotOptions.radialBar.startAngle),this.trackStartAngle=t.config.plotOptions.radialBar.track.startAngle,this.trackEndAngle=t.config.plotOptions.radialBar.track.endAngle,this.barLabels=this.w.config.plotOptions.radialBar.barLabels,this.donutDataLabels=this.w.config.plotOptions.radialBar.dataLabels,this.radialDataLabels=this.donutDataLabels,this.trackStartAngle||(this.trackStartAngle=this.startAngle),this.trackEndAngle||(this.trackEndAngle=this.endAngle),360===this.endAngle&&(this.endAngle=359.99),this.margin=parseInt(t.config.plotOptions.radialBar.track.margin,10),this.onBarLabelClick=this.onBarLabelClick.bind(this)}draw(t){var e;const i=this.w,s=new R(this.w),a=s.group({class:"apexcharts-radialbar"});if(i.globals.noData)return a;const r=s.group(),n=i.layout.gridHeight/2,h=i.layout.gridWidth/2;let c=this.defaultSize/2.05;i.config.chart.sparkline.enabled||(c=c-i.config.stroke.width-i.config.chart.dropShadow.blur),i.globals.circleGeometry={node:a.node,cx:h,cy:n,r:c};const d=i.globals.fill.colors,u=i.config.plotOptions.radialBar,p=Array.isArray(u.bands)&&u.bands.length>0,g=p&&u.bandsStyle&&u.bandsStyle.hideTrackWhenPresent,f="needle"===u.shape,m=this.radialDataLabels;if(null==m.value.offsetY){const e=this.needlePath({size:c,centerX:h,centerY:n,series:t},u.needle||{});this.donutDataLabels=this.radialDataLabels=l(o({},m),{value:l(o({},m.value),{offsetY:f?e.cy-n+Math.max(e.baseW/2,Zt.polarToCartesian(0,0,e.length,this.startAngle).y,Zt.polarToCartesian(0,0,e.length,this.endAngle).y)+parseFloat(m.value.fontSize)+4:8})})}if(u.track.show&&!g){const e=this.drawTracks({size:c,centerX:h,centerY:n,colorArr:d,series:t});r.add(e)}if(p){const e=this.drawBands({size:c,centerX:h,centerY:n,series:t});r.add(e)}const x=this.drawArcs({size:c,centerX:h,centerY:n,colorArr:d,series:t,skipValueArc:f&&!(null==(e=u.needle)?void 0:e.showValueArc)});if(u.ticks&&u.ticks.show){const e=this.drawTicks({size:c,centerX:h,centerY:n,series:t});if(this.initialAnim&&!i.globals.dataChanged&&!i.globals.resized&&Nt.isBrowser()&&i.globals.shouldAnimate){const s=e.node;s.style.opacity="0",s.style.transition="opacity 280ms ease-out";const a=f&&this.needleMotion(),r=Math.max((this.animBeginArr[t.length-1]||0)+i.config.chart.animations.speed,a?a.speed:0);i.globals.radialTickTimer=setTimeout(()=>{i.globals.isDestroyed||(s.style.opacity="1")},r)}r.add(e)}if(f){const e=this.drawNeedle({size:c,centerX:h,centerY:n,series:t});r.add(e)}let b=360;i.config.plotOptions.radialBar.startAngle<0&&(b=this.totalAngle);const y=(360-b)/360;if(i.globals.radialSize=c-c*y,this.radialDataLabels.value.show){const t=Math.max(this.radialDataLabels.value.offsetY,this.radialDataLabels.name.offsetY);i.globals.radialSize+=t*y}return r.add(x.g),"front"===i.config.plotOptions.radialBar.hollow.position&&(x.g.add(x.elHollow),x.dataLabels&&x.g.add(x.dataLabels)),a.add(r),a}drawTracks(t){const e=this.w,i=new R(this.w),s=i.group({class:"apexcharts-tracks"}),a=new D(this.w),r=new F(this.w),n=this.getStrokeWidth(t);t.size=t.size-n/2;for(let o=0;o<t.series.length;o++){const l=i.group({class:"apexcharts-radialbar-track apexcharts-track"});s.add(l),l.attr({rel:o+1}),t.size=t.size-n-this.margin;const h=e.config.plotOptions.radialBar.track,c=r.fillPath({seriesNumber:0,size:t.size,fillColors:Array.isArray(h.background)?h.background[o]:h.background,solid:!0}),d=this.trackStartAngle;let u=this.trackEndAngle;Math.abs(u)+Math.abs(d)>=360&&(u=360-Math.abs(this.startAngle)-.1);const p=i.drawPath({d:"",stroke:c,strokeWidth:n*parseInt(h.strokeWidth,10)/100,fill:"none",strokeOpacity:h.opacity,classes:"apexcharts-radialbar-area"});if(h.dropShadow.enabled){const t=h.dropShadow;a.dropShadow(p,t)}l.add(p),p.attr("id","apexcharts-radialbarTrack-"+o),this.animatePaths(p,{centerX:t.centerX,centerY:t.centerY,endAngle:u,startAngle:d,size:t.size,i:o,animBeginArr:0,dur:0,isTrack:!0})}return s}drawArcs(t){var e,i;const s=this.w;null==(e=this.ctx.highlightFilter)||e.pie(this);const a=new R(this.w),r=new F(this.w),n=new D(this.w),o=a.group(),l=this.getStrokeWidth(t);t.size=t.size-l/2;let h=s.config.plotOptions.radialBar.hollow.background;const c=t.size-l*t.series.length-this.margin*t.series.length-l*parseInt(s.config.plotOptions.radialBar.track.strokeWidth,10)/100/2,d=c-s.config.plotOptions.radialBar.hollow.margin;void 0!==s.config.plotOptions.radialBar.hollow.image&&(h=this.drawHollowImage(t,o,c,h));const u=this.drawHollow({size:d,centerX:t.centerX,centerY:t.centerY,fill:h||"transparent"});if(s.config.plotOptions.radialBar.hollow.dropShadow.enabled){const t=s.config.plotOptions.radialBar.hollow.dropShadow;n.dropShadow(u,t)}let p=1;!this.radialDataLabels.total.show&&s.seriesData.series.length>1&&(p=0);let g=null;this.radialDataLabels.show&&(g=this.renderInnerDataLabels(this.dataLabelsGroup,this.radialDataLabels,{hollowSize:c,centerX:t.centerX,centerY:t.centerY,opacity:p})),"back"===s.config.plotOptions.radialBar.hollow.position&&(o.add(u),g&&o.add(g));let f=!1;s.config.plotOptions.radialBar.inverseOrder&&(f=!0);const m=!0===(null==(i=this.ctx.morphTypeChange)?void 0:i.isActive());for(let e=f?t.series.length-1:0;f?e>=0:e<t.series.length;f?e--:e++){const i=a.group({class:"apexcharts-series apexcharts-radial-series",seriesName:Zt.escapeString(s.seriesData.seriesNames[e])});o.add(i),i.attr({rel:e+1,"data:realIndex":e}),W.addCollapsedClassToSeries(this.w,i,e),t.size=t.size-l-this.margin;const h=r.fillPath({seriesNumber:e,size:t.size,value:t.series[e]}),c=this.startAngle;let d;const u=this._arcEnd(t.series[e]);let p;if(s.globals.dataChanged){d=this.startAngle;const t=s.globals.previousPaths[e];p=void 0===t?NaN:this._arcEnd(t)}const g=u-c,f=We(s,"stroke.dashArray",e,Array.isArray(s.config.stroke.dashArray)?s.config.stroke.dashArray[e]:s.config.stroke.dashArray),x=m?this.ctx.morphTypeChange.getInitialPathFor(e,0):null,b=m?this.ctx.morphTypeChange.getFromType():null,y=!!x&&("bar"===b||"funnel"===b||"pyramid"===b||"pie"===b||"donut"===b||"polarArea"===b),v=a.drawPath({d:x||"",stroke:y||t.skipValueArc?"transparent":h,strokeWidth:y||t.skipValueArc?0:l,fill:y?h:"none",fillOpacity:s.config.fill.opacity,classes:"apexcharts-radialbar-area apexcharts-radialbar-slice-"+e,strokeDashArray:f}),w=c+g/2,_=Zt.polarToCartesian(t.centerX,t.centerY,t.size,w);if(R.setAttrs(v.node,{"data:angle":g,"data:value":t.series[e],"data:cx":_.x,"data:cy":_.y}),s.config.chart.dropShadow.enabled){const t=s.config.chart.dropShadow;n.dropShadow(v,t,e)}if(n.setSelectionFilter(v,0,e),this.addListeners(v,this.radialDataLabels),i.add(v),v.attr({index:0,j:e}),this.barLabels.enabled){const r=Zt.polarToCartesian(t.centerX,t.centerY,t.size,c),n=this.barLabels.formatter(s.seriesData.seriesNames[e],{seriesIndex:e,w:s}),o=["apexcharts-radialbar-label"];this.barLabels.onClick||o.push("apexcharts-no-click");let l=this.barLabels.useSeriesColors?s.globals.colors[e]:s.config.chart.foreColor;l||(l=s.config.chart.foreColor);const h=r.x+this.barLabels.offsetX,d=r.y+this.barLabels.offsetY,u=a.drawText({x:h,y:d,text:n,textAnchor:"end",dominantBaseline:"middle",fontFamily:this.barLabels.fontFamily,fontWeight:this.barLabels.fontWeight,fontSize:this.barLabels.fontSize,foreColor:l,cssClass:o.join(" ")});u.on("click",this.onBarLabelClick),u.attr({rel:e+1}),0!==c&&u.attr({"transform-origin":`${h} ${d}`,transform:`rotate(${c} 0 0)`}),i.add(u)}let A=0;if(!this.initialAnim||s.globals.resized||s.globals.dataChanged||(A=s.config.chart.animations.speed),this.dynamicAnim&&s.globals.dataChanged&&s.globals.shouldAnimate&&(A=s.config.chart.animations.dynamicAnimation.speed),this.animBeginArr[e]=e*A/(1.2*t.series.length),m&&x){const e=this.ctx.morphTypeChange.getSpeed(),i=this.ctx.animations,s=this.getPiePath({me:this,startAngle:c,angle:g,size:t.size});if(y){const a=this.ctx.morphTypeChange.buildRingSegmentPath(t.centerX,t.centerY,t.size,l,c,c+g);v.animate(e).plot(a,"polygons").after(function(){this.attr({d:s,fill:"none",stroke:t.skipValueArc?"transparent":h,"stroke-width":t.skipValueArc?0:l}),i.animationCompleted(v)})}else v.animate(e).plot(s,"polygons").attr({"stroke-width":l}).after(()=>i.animationCompleted(v))}else this.animatePaths(v,{centerX:t.centerX,centerY:t.centerY,endAngle:u,startAngle:c,prevEndAngle:p,prevStartAngle:d,size:t.size,i:e,animBeginArr:this.animBeginArr,dur:A,shouldSetPrevPaths:!0})}return{g:o,elHollow:u,dataLabels:g}}_domain(){const t=this.w.config.plotOptions.radialBar,e="number"==typeof t.min?t.min:0,i="number"==typeof t.max?t.max:100;return[e,i===e?e+1:i]}_fraction(t){const[e,i]=this._domain(),s=Number(t);return Number.isFinite(s)?(Math.min(Math.max(s,e),i)-e)/(i-e):0}_arcEnd(t){const e=Math.round(this.totalAngle*this._fraction(t))+this.startAngle;return Math.abs(e)+Math.abs(this.startAngle)>360?e-.01:e}_angleAtValue(t){return this.startAngle+this._fraction(t)*Math.abs(this.endAngle-this.startAngle)}_describeArc(t,e,i,s,a){const r=Zt.polarToCartesian(t,e,i,a),n=Zt.polarToCartesian(t,e,i,s),o=a-s,l=Math.abs(o)>180?1:0;return`M ${r.x} ${r.y} A ${i} ${i} 0 ${l} 0 ${n.x} ${n.y}`}drawBands(t){const e=this.w,i=new R(this.w),s=e.config.plotOptions.radialBar,a=s.bands||[],r=i.group({class:"apexcharts-gauge-bands"}),n=this.getStrokeWidth(t),o=t.size-n/2-n-this.margin,l=n*parseInt(s.bandsStyle.strokeWidth,10)/100,h=o>0?Math.abs(s.bandsStyle.gap||0)/o*(180/Math.PI):0;for(let e=0;e<a.length;e++){const n=a[e];if(void 0===n.from||void 0===n.to)continue;const c=this._angleAtValue(n.from),d=this._angleAtValue(n.to),u=Math.min(c,d)+h/2,p=Math.max(c,d)-h/2;if(p-u<=0)continue;const g=i.drawPath({d:this._describeArc(t.centerX,t.centerY,o,u,p),stroke:n.color||"#ccc",strokeWidth:l,fill:"none",strokeLinecap:s.bandsStyle.linecap||"butt",classes:"apexcharts-gauge-band"});g.node.setAttribute("data-band-index",String(e)),r.add(g)}return r}drawTicks(t){var e,i,s,a;const r=this.w,n=new R(this.w),o=r.config.plotOptions.radialBar.ticks,l=n.group({class:"apexcharts-gauge-ticks"}),h=this.getStrokeWidth(t),c=t.size-h/2-h-this.margin,[d,u]=this._domain(),p=Math.max(2,null!=(i=null==(e=o.major)?void 0:e.count)?i:11),g=Math.max(0,null!=(a=null==(s=o.minor)?void 0:s.count)?a:0),f=(e,i,s)=>{var a,r,h;const d=this._angleAtValue(e),u=null!=(a=i.length)?a:8,p="inside"===i.placement?c-u:c,g="inside"===i.placement?c:c+u,f=Zt.polarToCartesian(t.centerX,t.centerY,p,d),m=Zt.polarToCartesian(t.centerX,t.centerY,g,d),x=n.drawLine(f.x,f.y,m.x,m.y,i.color||(s?"#666":"#999"),0,i.width||(s?2:1));if(l.add(x),s&&(null==(r=o.labels)?void 0:r.show)){const s=("inside"===i.placement?p:g)+("inside"===i.placement?-1:1)*(null!=(h=o.labels.offset)?h:6),a=Zt.polarToCartesian(t.centerX,t.centerY,s,d),r="function"==typeof o.labels.formatter?o.labels.formatter(e):String(e),c=n.drawText({x:a.x,y:a.y,text:r,textAnchor:"middle",dominantBaseline:"middle",fontFamily:o.labels.fontFamily,fontSize:o.labels.fontSize,fontWeight:o.labels.fontWeight,foreColor:o.labels.color,cssClass:"apexcharts-gauge-tick-label"});l.add(c)}};for(let t=0;t<p;t++){if(f(d+t/(p-1)*(u-d),o.major||{},!0),t<p-1&&g>0)for(let e=1;e<=g;e++){f(d+(t+e/(g+1))/(p-1)*(u-d),o.minor||{},!1)}}return l}drawNeedle(t){const e=this.w,i=new R(this.w),s=e.config.plotOptions.radialBar.needle||{},a=i.group({class:"apexcharts-gauge-needle"});if(!t.series||0===t.series.length)return a;const r=s.color||"#333",{path:n,cx:o,cy:l}=this.needlePath(t,s),h=i.drawPath({d:n,stroke:r,strokeWidth:0,fill:r,classes:"apexcharts-gauge-needle-shape"});a.add(h);const c=Number(t.series[0]),d=this._angleAtValue(c),u=e.globals,p=this.needleMotion(),g=Number.isFinite(u.radialNeedleAngle)&&!(null==p?void 0:p.mount)?u.radialNeedleAngle:this.startAngle;if(u.radialNeedleAngle=d,null!=e.globals.radialNeedleRAF&&(ft.cancelAnimationFrame(e.globals.radialNeedleRAF),e.globals.radialNeedleRAF=null),p&&g!==d){const{speed:t,ease:i}=p,s=a.node;s.setAttribute("transform-origin",`${o} ${l}`),s.setAttribute("transform",`rotate(${g})`);const r=performance.now(),n=a=>{if(this.w.globals.isDestroyed)return void(e.globals.radialNeedleRAF=null);const o=Math.max(0,Math.min(1,(a-r)/t)),l=g+(d-g)*i(o);s.setAttribute("transform",`rotate(${l})`),e.globals.radialNeedleRAF=o<1?ft.requestAnimationFrame(n):null};e.globals.radialNeedleRAF=ft.requestAnimationFrame(n)}else a.attr({"transform-origin":`${o} ${l}`,transform:`rotate(${d})`});return a}needlePath(t,e){var i,s,a;const r=this.getStrokeWidth(t),n=t.size-r/2-r-this.margin,o="string"==typeof e.length&&e.length.endsWith("%")?n*parseInt(e.length,10)/100:Number(e.length||.85*n),l=null!=(i=e.baseWidth)?i:4,h=null!=(s=e.tipWidth)?s:1,c=t.centerX,d=t.centerY+Number(null!=(a=e.offsetY)?a:0);return{path:`M ${c+l/2} ${d} A ${l/2} ${l/2} 0 0 1 ${c-l/2} ${d} L ${c-h/2} ${d-o} L ${c+h/2} ${d-o} Z`,cx:c,cy:d,length:o,baseW:l}}needleMotion(){var t,e,i;const s=this.w,a=s.config.plotOptions.radialBar.needle||{},r=s.config.chart.animations,n=this.initialAnim&&!s.globals.dataChanged&&!s.globals.resized;if(!(Nt.isBrowser()&&s.globals.shouldAnimate&&!1!==(null==(t=a.animation)?void 0:t.enabled)&&(n||this.dynamicAnim&&s.globals.dataChanged)))return null;return{speed:Number(null==(e=a.animation)?void 0:e.duration)||Number(a.animationSpeed)||(n?r.speed:null==(i=r.dynamicAnimation)?void 0:i.speed)||800,mount:n,ease:w(n?"easeOutBack":"easeOutCubic")}}drawHollow(t){var e;const i=new R(this.w),s=this.w.config.plotOptions.radialBar.hollow,a=i.drawCircle(2*t.size),r={class:"apexcharts-radialbar-hollow",cx:t.centerX,cy:t.centerY,r:t.size,fill:t.fill};return(s.stroke||s.strokeDasharray)&&(r.stroke=s.stroke||"transparent",r["stroke-width"]=null!=(e=s.strokeWidth)?e:1,s.strokeDasharray&&(r["stroke-dasharray"]=s.strokeDasharray)),a.attr(r),a}drawHollowImage(t,e,i,s){const a=this.w,r=new F(this.w),n=Zt.randomId(),o=a.config.plotOptions.radialBar.hollow.image;if(a.config.plotOptions.radialBar.hollow.imageClipped)r.clippedImgArea({width:i,height:i,image:o,patternID:`pattern${a.globals.cuid}${n}`}),s=`url(#pattern${a.globals.cuid}${n})`;else{const i=a.config.plotOptions.radialBar.hollow.imageWidth,s=a.config.plotOptions.radialBar.hollow.imageHeight;if(void 0===i&&void 0===s){const i=a.dom.Paper.image(o,function(e){this.move(t.centerX-e.width/2+a.config.plotOptions.radialBar.hollow.imageOffsetX,t.centerY-e.height/2+a.config.plotOptions.radialBar.hollow.imageOffsetY)});e.add(i)}else{const r=a.dom.Paper.image(o,function(){this.move(t.centerX-i/2+a.config.plotOptions.radialBar.hollow.imageOffsetX,t.centerY-s/2+a.config.plotOptions.radialBar.hollow.imageOffsetY),this.size(i,s)});e.add(r)}}return s}getStrokeWidth(t){const e=this.w;return t.size*(100-parseInt(e.config.plotOptions.radialBar.hollow.size,10))/100/(t.series.length+1)-this.margin}onBarLabelClick(t){var e;const i=t.target,s=parseInt(null!=(e=i.getAttribute("rel"))?e:"",10)-1,a=this.barLabels.onClick,r=this.w;a&&a(r.seriesData.seriesNames[s],{w:r,seriesIndex:s})}},radar:class{constructor(t,e){this.ctx=e,this.w=t,this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animDur=0,this.graphics=new R(this.w),this.lineColorArr=void 0!==t.globals.stroke.colors?t.globals.stroke.colors:t.globals.colors,this.defaultSize=t.globals.svgHeight<t.globals.svgWidth?t.layout.gridHeight:t.layout.gridWidth,this.isLog=t.config.yaxis[0].logarithmic,this.logBase=t.config.yaxis[0].logBase,this.coreUtils=new P(this.w),this.maxValue=this.isLog?this.coreUtils.getLogVal(this.logBase,t.globals.maxY,0):t.globals.maxY,this.minValue=this.isLog?this.coreUtils.getLogVal(this.logBase,this.w.globals.minY,0):t.globals.minY,this.polygons=t.config.plotOptions.radar.polygons,this.strokeWidth=t.config.stroke.show?t.config.stroke.width:0,this.size=this.defaultSize/2.1-this.strokeWidth-t.config.chart.dropShadow.blur,t.config.xaxis.labels.show&&(this.size=this.size-t.layout.xAxisLabelsWidth/1.75),void 0!==t.config.plotOptions.radar.size&&(this.size=t.config.plotOptions.radar.size),this.dataRadiusOfPercent=[],this.dataRadius=[],this.angleArr=[],this.dataPointsLen=0,this.disAngle=0,this.yaxisLabelsTextsPos=[]}draw(t){const e=this.w,i=new F(this.w),s=[],a=new I(this.w,this.ctx);t.length&&(this.dataPointsLen=t[e.globals.maxValsInArrayIndex].length),this.disAngle=2*Math.PI/this.dataPointsLen;const r=e.layout.gridWidth/2,n=e.layout.gridHeight/2,h=r+e.config.plotOptions.radar.offsetX,c=n+e.config.plotOptions.radar.offsetY,d=this.graphics.group({class:"apexcharts-radar-series apexcharts-plot-series",transform:`translate(${h||0}, ${c||0})`});e.globals.circleGeometry={node:d.node,cx:h||0,cy:c||0,r:this.size};const u=e.globals.prevCircleFrame,p=u&&"radar"===u.type&&u.rendered.r>0?this.size/u.rendered.r:1;let g=[],f=null,m=null;if(this.yaxisLabels=this.graphics.group({class:"apexcharts-yaxis"}),t.forEach((t,r)=>{const n=t.length===e.globals.dataPoints,h=this.graphics.group().attr({class:"apexcharts-series","data:longestSeries":n,seriesName:Zt.escapeString(e.seriesData.seriesNames[r]),rel:r+1,"data:realIndex":r});W.addCollapsedClassToSeries(this.w,h,r),this.dataRadiusOfPercent[r]=[],this.dataRadius[r]=[],this.angleArr[r]=[];if(0===t.length&&(e.globals.collapsedSeriesIndices.indexOf(r)>-1||e.globals.ancillaryCollapsedSeriesIndices.indexOf(r)>-1))for(let t=0;t<e.globals.dataPoints;t++)this.dataRadiusOfPercent[r][t]=0,this.dataRadius[r][t]=0,this.angleArr[r][t]=t*this.disAngle;t.forEach((t,e)=>{const i=Math.abs(this.maxValue-this.minValue);t=Math.max(0,t-this.minValue),this.isLog&&(t=this.coreUtils.getLogVal(this.logBase,t,0)),this.dataRadiusOfPercent[r][e]=t/i,this.dataRadius[r][e]=this.dataRadiusOfPercent[r][e]*this.size,this.angleArr[r][e]=e*this.disAngle}),g=this.getDataPointsPos(this.dataRadius[r],this.angleArr[r]);const c=this.createPaths(g,{x:0,y:0});f=this.graphics.group({class:"apexcharts-series-markers-wrap apexcharts-element-hidden"}),m=this.graphics.group({class:"apexcharts-datalabels","data:realIndex":r}),e.globals.delayedElements.push({el:f.node,index:r});const d={i:r,realIndex:r,animationDelay:r,initialSpeed:e.config.chart.animations.speed,dataChangeSpeed:e.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-radar",shouldClipToGrid:!1,bindEventsOnPaths:!1,stroke:e.globals.stroke.colors[r],strokeLinecap:e.config.stroke.lineCap};let u=null;var x,b;e.globals.previousPaths.length>0&&(x=this.getPreviousPath(r),b=p,u=x&&1!==b&&Number.isFinite(b)&&!/[aA]/.test(x)?x.replace(/-?(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?/gi,t=>String(parseFloat(t)*b)):x);for(let t=0;t<c.linePathsTo.length;t++){const s=this.graphics.renderPaths(l(o({},d),{pathFrom:null===u?c.linePathsFrom[t]:u,pathTo:c.linePathsTo[t],strokeWidth:Array.isArray(this.strokeWidth)?this.strokeWidth[r]:this.strokeWidth,fill:"none",drawShadow:!1}));h.add(s);const a=i.fillPath({seriesNumber:r}),n=this.graphics.renderPaths(l(o({},d),{pathFrom:null===u?c.areaPathsFrom[t]:u,pathTo:c.areaPathsTo[t],strokeWidth:0,fill:a,drawShadow:!1,drawMask:{type:"radial",cx:0,cy:0,r:this.size}}));if(e.config.chart.dropShadow.enabled){const t=new D(this.w),i=e.config.chart.dropShadow;t.dropShadow(n,Object.assign({},i,{noUserSpaceOnUse:!0}),r)}h.add(n)}const y=new z(this.w,this.ctx);t.forEach((t,i)=>{const s=y.getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:r,dataPointIndex:i});s.pSize||(s.pSize=5,s.pointFillColor="transparent",s.pointStrokeColor="transparent",s.pointStrokeWidth=0);const n=this.graphics.drawMarker(g[i].x,g[i].y,s);n.attr("rel",i),n.attr("j",i),n.attr("index",r),n.node.setAttribute("default-marker-size",s.pSize);const l=this.graphics.group({class:"apexcharts-series-markers"});l&&l.add(n),f.add(l),h.add(f);const c=e.config.dataLabels;if(c.enabled){const t=c.formatter(e.seriesData.series[r][i],{ctx:this.ctx,seriesIndex:r,dataPointIndex:i,w:e});a.plotDataLabelsText({x:g[i].x,y:g[i].y,text:t,textAnchor:"middle",i:r,j:r,seriesIndex:r,dataPointIndex:i,parent:m,offsetCorrection:!1,dataLabelsConfig:o({},c)})}h.add(m)}),s.push(h)}),this.drawPolygons({parent:d}),e.config.xaxis.labels.show){const t=this.drawXAxisTexts();d.add(t)}return s.forEach(t=>{d.add(t)}),d.add(this.yaxisLabels),d}drawPolygons(t){const e=this.w,{parent:i}=t,s=new gs(this.w),a=e.globals.yAxisScale[0].result.slice().reverse(),r=a.length,n=[],o=this.size/(r-1);for(let t=0;t<r;t++)n[t]=o*t;n.reverse();const l=[],h=[];n.forEach((t,e)=>{const i=Zt.getPolygonPos(t,this.dataPointsLen);let s="";i.forEach((t,i)=>{if(0===e){const e=this.graphics.drawLine(t.x,t.y,0,0,Array.isArray(this.polygons.connectorColors)?this.polygons.connectorColors[i]:this.polygons.connectorColors);h.push(e)}0===i&&this.yaxisLabelsTextsPos.push({x:t.x,y:t.y}),s+=t.x+","+t.y+" "}),l.push(s)}),l.forEach((t,s)=>{const a=this.polygons.strokeColors,r=this.polygons.strokeWidth,n=this.graphics.drawPolygon(t,Array.isArray(a)?a[s]:a,Array.isArray(r)?r[s]:r,e.globals.radarPolygons.fill.colors[s]);i.add(n)}),h.forEach(t=>{i.add(t)}),e.config.yaxis[0].show&&this.yaxisLabelsTextsPos.forEach((t,e)=>{const i=s.drawYAxisTexts(t.x,t.y,e,a[e]);this.yaxisLabels.add(i)})}drawXAxisTexts(){const t=this.w,e=t.config.xaxis.labels,i=e.style.colors,s=this.graphics.group({class:"apexcharts-xaxis"}),a=Zt.getPolygonPos(this.size,this.dataPointsLen);return t.labelData.labels.forEach((r,n)=>{const l="function"==typeof t.config.xaxis.labels.formatter?t.config.xaxis.labels.formatter:t=>t,h=new I(this.w,this.ctx);if(a[n]){const c=this.getTextPos(a[n],this.size),d=l(r,{seriesIndex:-1,dataPointIndex:n,w:t});h.plotDataLabelsText({x:c.newX,y:c.newY,text:d,textAnchor:c.textAnchor,i:n,j:n,parent:s,className:"apexcharts-xaxis-label",color:(Array.isArray(i)?i[n]:i)||"#a8a8a8",dataLabelsConfig:o({textAnchor:c.textAnchor,dropShadow:{enabled:!1}},e),offsetCorrection:!1}).on("click",e=>{if("function"==typeof t.config.chart.events.xAxisLabelClick){const i=Object.assign({},t,{labelIndex:n});t.config.chart.events.xAxisLabelClick(e,this.ctx,i)}})}}),s}createPaths(t,e){const i=[];let s=[];const a=[];let r=[];if(t.length){s=[this.graphics.move(e.x,e.y)],r=[this.graphics.move(e.x,e.y)];let n=this.graphics.move(t[0].x,t[0].y),o=this.graphics.move(t[0].x,t[0].y);t.forEach((e,i)=>{n+=this.graphics.line(e.x,e.y),o+=this.graphics.line(e.x,e.y),i===t.length-1&&(n+="Z",o+="Z")}),i.push(n),a.push(o)}return{linePathsFrom:s,linePathsTo:i,areaPathsFrom:r,areaPathsTo:a}}getTextPos(t,e){let i="middle",s=t.x,a=t.y;return Math.abs(t.x)>=10?t.x>0?(i="start",s+=10):t.x<0&&(i="end",s-=10):i="middle",Math.abs(t.y)>=e-10&&(t.y<0?a-=10:t.y>0&&(a+=10)),{textAnchor:i,newX:s,newY:a}}getPreviousPath(t){let e=null;for(const i of Zi(this.w,t))Array.isArray(null==i?void 0:i.paths)&&i.paths.length>0&&void 0!==i.paths[0]&&(e=i.paths[0].d);return e}getDataPointsPos(t,e,i=this.dataPointsLen){t=t||[],e=e||[];const s=[];for(let a=0;a<i;a++){const i={};i.x=t[a]*Math.sin(e[a]),i.y=-t[a]*Math.cos(e[a]),s.push(i)}return s}},heatmap:class{constructor(t,e,i){this.ctx=e,this.w=t,this.xRatio=i.xRatio,this.yRatio=i.yRatio,this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.helpers=new rs(t,e),this.rectRadius=this.w.config.plotOptions.heatmap.radius,this.shape=this.w.config.plotOptions.heatmap.shape||"rect",this.strokeWidth=this.w.config.stroke.show?this.w.config.stroke.width:0}padXRange(t){const{w:e}=t,i=e.globals,s=e.config.xaxis;if(("numeric"===s.type||"datetime"===s.type)&&i.initialMinX<i.initialMaxX){t._getMinXDiff();const a=ns(e)/2;i.initialMinX-=a,i.initialMaxX+=a,null==s.min&&null==s.max&&null==s.range&&(i.minX-=a,i.maxX+=a,s.tickAmount||i.xTickAmount!==i.dataPoints-1||(i.xTickAmount=i.dataPoints))}}draw(t){var e,i;const s=this.w,a=new R(this.w,this.ctx),r=a.group({class:"apexcharts-heatmap"}),n=s.layout.gridWidth/s.globals.dataPoints,o=s.layout.gridHeight/s.seriesData.series.length,l=("numeric"===s.config.xaxis.type||"datetime"===s.config.xaxis.type)&&s.axisFlags.isXNumeric&&this.xRatio>0;let h=n;if(l){const t=ns(s);t&&(h=t/this.xRatio)}let c=this.shape;l&&"hexagon"===c&&(c="rect");const d=si(this.ctx,a),p="rect"===c&&d!==a&&"function"==typeof d.drawRectCell;"hexagon"===c?this.applyHexagonClipPath(r,a,n,o):r.attr("clip-path",`url(#gridRectMask${s.globals.cuid})`);const g=Array.isArray(s.config.fill.opacity)?null!=(e=s.config.fill.opacity[0])?e:1:null!=(i=s.config.fill.opacity)?i:1;let f=0,m=!1;this.negRange=this.helpers.checkColorRange();const x=t.slice();s.config.yaxis[0].reversed&&(m=!0,x.reverse());for(let e=m?0:x.length-1;m?e<x.length:e>=0;m?e++:e--){const i=a.group({class:"apexcharts-series apexcharts-heatmap-series",seriesName:Zt.escapeString(s.seriesData.seriesNames[e]),rel:e+1,"data:realIndex":e});if(W.addCollapsedClassToSeries(this.w,i,e),p||a.setupEventDelegation(i,".apexcharts-heatmap-rect"),s.config.chart.dropShadow.enabled){const t=s.config.chart.dropShadow;new D(this.w).dropShadow(i,t,e)}let m=0;const x=s.config.plotOptions.heatmap.shadeIntensity,b=Math.round(f/o),y="hexagon"===c?(b%2==0?-1:1)*n/4:0;let v=0;for(let r=0;r<s.globals.dataPoints;r++){if(!l&&s.seriesData.seriesX.length&&!s.globals.allSeriesHasEqualX&&s.globals.minX+s.globals.minXDiff*r<s.seriesData.seriesX[e][v]){m+=n;continue}if(v>=t[e].length)break;const b=l?h:n;if(l){const t=s.seriesData.seriesX[e]?s.seriesData.seriesX[e][v]:null;if(null==t||t!=t){v++;continue}m=(t-s.globals.minX)/this.xRatio-h/2}const w=this.helpers.getShadeColor(s.config.chart.type,e,v,this.negRange);let _=w.color;const A=w.colorProps;if("image"===s.config.fill.type){_=new F(this.w).fillPath({seriesNumber:e,dataPointIndex:v,opacity:s.globals.hasNegs?A.percent<0?1-(1+A.percent/100):x+A.percent/100:A.percent/100,patternID:Zt.randomId(),width:s.config.fill.image.width?s.config.fill.image.width:b,height:s.config.fill.image.height?s.config.fill.image.height:o})}const S=this.rectRadius,C=s.config.plotOptions.heatmap.useFillColorAsStroke?_:s.globals.stroke.colors[0];if(p)d.drawRectCell(m,f,b,o,{fill:_,fillOpacity:g,stroke:C,strokeWidth:this.strokeWidth,radius:S,seriesIndex:e,dataPointIndex:v});else{const r="rect"===c,n=r?a.drawRect(m,f,b,o,S):a.drawPath({d:this.cellShapePath(c,m+y,f,b,o),stroke:C,strokeWidth:this.strokeWidth,fill:_,fillOpacity:1});if(n.attr({cx:m+y,cy:f}),n.node.classList.add("apexcharts-heatmap-rect"),i.add(n),n.attr({fill:_,i:e,index:e,j:v,val:t[e][v],"stroke-width":this.strokeWidth,stroke:C,color:_}),r||n.attr({width:b,height:o}),s.config.chart.animations.enabled&&!s.globals.dataChanged){const t=s.config.chart.animations.speed;if(s.globals.resized)s.globals.animationEnded=!0;else if(r)this.animateHeatMap(n,m,f,b,o,t,e,v);else{const i=new u(this.w);i.animatePop(n,{speed:t,delay:this.enterStaggerDelay(t,e,v),onComplete:()=>{i.animationCompleted(n)}})}}if(s.globals.dataChanged){let t=1;if(this.dynamicAnim.enabled&&s.globals.shouldAnimate){t=this.dynamicAnim.speed;const i=s.globals.previousPaths[e]&&s.globals.previousPaths[e][v],a=Zt.isColorHex(_)?_:Zt.rgb2hex(_);if(null==i?void 0:i.color){const e=i.rect,l=r&&e&&Ti(s)&&[e.x,e.y,e.width,e.height].every(Number.isFinite)&&(Math.abs(e.x-m)>.5||Math.abs(e.y-f)>.5||Math.abs(e.width-b)>.5||Math.abs(e.height-o)>.5)?e:null;this.animateHeatColor(n,Zt.isColorHex(i.color)?i.color:Zt.rgb2hex(i.color),a,t,l&&{from:l,to:{x:m,y:f,width:b,height:o}})}else if(r){const e=m+b/2,i=f+o/2;this.animateHeatColor(n,a,a,t,{from:{x:e,y:i,width:0,height:0},to:{x:m,y:f,width:b,height:o}})}else new u(this.w).animatePop(n,{speed:t})}}}if(s.config.dataLabels.enabled){const t=(0,s.config.dataLabels.formatter)(s.seriesData.series[e][v],{value:s.seriesData.series[e][v],seriesIndex:e,dataPointIndex:v,w:s}),a=this.helpers.calculateDataLabels({text:t,x:m+y+b/2,y:f+o/2,i:e,j:v,colorProps:A});null!==a&&i.add(a)}l||(m+=n),v++}f+=o,r.add(i)}return r}animateHeatMap(t,e,i,s,a,r,n=0,o=0){const l=new u(this.w),h=this.enterStaggerDelay(r,n,o);l.animateRect(t,{x:e+s/2,y:i+a/2,width:0,height:0},{x:e,y:i,width:s,height:a},r,()=>{l.animationCompleted(t)},h)}enterStaggerDelay(t,e,i){const s=this.w,a=s.config.chart.animations.animateGradually;if(!a||!1===a.enabled)return 0;const r=((s.seriesData.series||[]).length||1)+(s.globals.dataPoints||1)-2,n=Math.min(a.delay||0,.5*t/Math.max(1,r));return p({style:"diagonal",index:i,row:e,col:i,baseDelay:n})}cellShapePath(t,e,i,s,a){const r=e+s/2,n=i+a/2;if("circle"===t){const t=Math.min(s,a)/2;return`M ${r-t} ${n} a ${t} ${t} 0 1 0 ${2*t} 0 a ${t} ${t} 0 1 0 ${2*-t} 0 Z`}if("diamond"===t)return`M ${r} ${i} L ${e+s} ${n} L ${r} ${i+a} L ${e} ${n} Z`;const o=e+s;return`M ${r} ${i-a/6} L ${o} ${i+a/6} L ${o} ${i+5*a/6} L ${r} ${i+7*a/6} L ${e} ${i+5*a/6} L ${e} ${i+a/6} Z`}applyHexagonClipPath(t,e,i,s){const a=this.w,r=this.strokeWidth/2+2,n=`heatmapHexMask${a.globals.cuid}`,o=a.dom.elDefs.node,l=o.querySelector(`clipPath[id="${n}"]`);l&&l.parentNode&&l.parentNode.removeChild(l);const h=ft.createElementNS(zt,"clipPath");h.setAttribute("id",n),h.appendChild(e.drawRect(-i/4-r,-s/6-r,a.layout.gridWidth+i/2+2*r,a.layout.gridHeight+s/3+2*r,0,"#fff").node),o.appendChild(h),t.attr("clip-path",`url(#${n})`)}animateHeatColor(t,e,i,s,a=null){const r=t.attr(o({fill:e},null==a?void 0:a.from)).animate(s).attr(o({fill:i},null==a?void 0:a.to));a&&r.ease(Wi(this.w))}},treemap:class{constructor(t,e){this.ctx=e,this.w=t,this.strokeWidth=this.w.config.stroke.width,this.helpers=new rs(t,e),this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.labels=[],this.roots=[],this.drawn=[],this.showParents=!1,this.scale=null,this._levelCache=null,this._total=null,this._avgLabelSize=null,this._tooltipEl=null,this._morphLeafIndex=0,this.camera=null}draw(){var t,e;const i=this.w,s=new R(this.w,this.ctx),a=new F(this.w),r=s.group({class:"apexcharts-treemap"});if(i.globals.noData)return r;this.negRange=this.helpers.checkColorRange(),i.config.series.forEach((t,e)=>{Array.isArray(this.labels[e])||(this.labels[e]=[]),t.data.forEach(t=>{this.labels[e].push(t.x)})});const n=Es(i);this.roots=n.roots,this.scale=le(i);const l=1===n.roots.length?n.roots[0].children||[]:n.roots;this.drawn=l,this.showParents=Xs(i);const h=this._resolveFocus(l),c=h?[h]:l;ks.generateNested(c,i.layout.gridWidth,i.layout.gridHeight,{padding:(t,e,i,s)=>this.showParents?this._levelPadding(e,i,s):0,header:(t,e,i,s)=>this.showParents?this._levelHeader(t,e,i,s):0}),this.camera=this._zoomCamera();const d=null==(t=this.ctx.highlightFilter)?void 0:t.treemap(this),u=null==(e=this.ctx)?void 0:e.morphTypeChange,p=!!u&&"function"==typeof u.isActive&&u.isActive()&&"function"==typeof u.getInitialPathAt;this._morphLeafIndex=0;const g=this._leavesBySeries(c,i.config.series.length),f=this.showParents?this._parentsBySeries(c,i.config.series.length):[];return g.forEach((t,e)=>{var n;const l=s.group({class:"apexcharts-series apexcharts-treemap-series",seriesName:Zt.escapeString(i.seriesData.seriesNames[e]),rel:e+1,"data:realIndex":e});if(W.addCollapsedClassToSeries(this.w,l,e),s.setupEventDelegation(l,".apexcharts-treemap-rect"),i.config.chart.dropShadow.enabled){const t=i.config.chart.dropShadow;new D(this.w).dropShadow(l,t,e)}const h=s.group({class:"apexcharts-data-labels"}),c={xMin:1/0,yMin:1/0,xMax:-1/0,yMax:-1/0},u={xMin:1/0,yMin:1/0};this.showParents&&(f[e]||[]).forEach(t=>{this._drawParent(l,t,e)});const g=i.config.chart.animations,m=g.animateGradually,x=m&&!1!==m.enabled,b=new Array(t.length).fill(0);if(x){const e=t.length||1,i=Math.min(m.delay||0,.5*g.speed/e);t.map((t,e)=>{return{j:e,area:t.rect?(i=t.rect,(i[2]-i[0])*(i[3]-i[1])):0};var i}).sort((t,e)=>e.area-t.area).forEach((t,e)=>{b[t.j]=e*i})}t.forEach((t,r)=>{var n;const h=t.rect;if(!h)return;const g=t._di,f=h[0],m=h[1],x=h[2],y=h[3];x>f&&y>m&&(c.xMin=Math.min(c.xMin,f),c.yMin=Math.min(c.yMin,m),c.xMax=Math.max(c.xMax,x),c.yMax=Math.max(c.yMax,y));const v=this._leafColor(e,g),w=v.color;let _=a.fillPath({color:w,seriesNumber:e,dataPointIndex:g});const A=p?this._morphSourceForLeaf(t):null,S=A?s.drawPath({d:this._tilePath(f,m,x,y),fill:"#fff",stroke:i.config.plotOptions.treemap.useFillColorAsStroke?w:i.globals.stroke.colors[e],strokeWidth:this.strokeWidth,fillOpacity:1}):s.drawRect(f,m,x-f,y-m,i.config.plotOptions.treemap.borderRadius,"#fff",1,this.strokeWidth,i.config.plotOptions.treemap.useFillColorAsStroke?w:i.globals.stroke.colors[e]);_=(null==d?void 0:d(S,e,g,_,t))||_,S.attr({cx:f,cy:m,index:e,i:e,j:g,width:x-f,height:y-m,fill:_}),S.node.classList.add("apexcharts-treemap-rect"),S.node.setAttribute("data:key",Is(t._key));let C=null,k={x:f+(x-f)/2,y:m+(y-m)/2,width:0,height:0};const P={x:f,y:m,width:x-f,height:y-m};A?this._morphTile(S,A,this._tilePath(f,m,x,y),this.ctx.morphTypeChange.getSpeed(),e,g):i.config.chart.animations.enabled&&!i.globals.dataChanged&&(i.globals.resized?i.globals.animationEnded=!0:C=this.animateTreemap(S,k,P,i.config.chart.animations.speed,b[r]||0));let L=null,M=null;if(i.globals.dataChanged){let t=1;if(this.dynamicAnim.enabled&&i.globals.shouldAnimate){t=this.dynamicAnim.speed;const s=null==(n=i.globals.previousPaths[e])?void 0:n[g],a=o({},P);if(!(null==s?void 0:s.rect)&&this.camera&&(k=this.camera.back(P),L={x:k.x+k.width/2,y:k.y+k.height/2}),null==s?void 0:s.rect){k=o({},s.rect),k.width>0&&k.height>0&&(u.xMin=Math.min(u.xMin,k.x),u.yMin=Math.min(u.yMin,k.y),L={x:k.x+k.width/2,y:k.y+k.height/2},M="string"==typeof s.label?s.label:null,s.labelFading&&this.camera&&(M=""));const t=t=>"string"==typeof t&&/^(#|rgb)/i.test(t);t(s.fill)&&t(_)&&s.fill!==_&&(k.fill=s.fill,a.fill=_)}C=this.animateTreemap(S,k,a,t)}}let I=this.getFontSize(h);"truncate"===i.config.plotOptions.treemap.dataLabels.format&&(I=parseInt(String(i.config.dataLabels.style.fontSize),10));let E=null;if(i.config.dataLabels.enabled&&this._labelCanShow(I,x-f,y-m)){let s=i.config.dataLabels.formatter(this.labels[e][g],{value:i.seriesData.series[e][g],seriesIndex:e,dataPointIndex:g,w:i,highlight:t.highlight});"truncate"===i.config.plotOptions.treemap.dataLabels.format&&(s=this.truncateLabels(String(s),I,f,m,x,y)),i.seriesData.series[e][g]&&(E=this.helpers.calculateDataLabels({text:s,x:(f+x)/2,y:(m+y)/2+this.strokeWidth/2+I/3,i:e,j:g,colorProps:v,fontSize:I})),i.config.dataLabels.enabled&&E&&this.rotateToFitLabel(E,I,s,f,m,x,y)}if(l.add(S),null!==E&&(E.node.setAttribute("data:key",Is(t._key)),l.add(E),C)){const t=!L||""===M||!!this.camera&&null!==M&&M!==W.treemapLabelLook(E.node);this._rideTile(E.node,L,f,m,x,y,C,t)}});const y=i.config.plotOptions.treemap.seriesTitle;if(!this.showParents&&i.config.series.length>1&&y&&y.show){const t=i.config.series[e].name||"";if(t&&c.xMin<1/0&&c.yMin<1/0){const{offsetX:e,offsetY:a,borderColor:r,borderWidth:o,borderRadius:h,style:d}=y,p=d.color||i.config.chart.foreColor,g={left:d.padding.left,right:d.padding.right,top:d.padding.top,bottom:d.padding.bottom},f=s.getTextRects(t,d.fontSize,d.fontFamily),m=f.width+g.left+g.right,x=f.height+g.top+g.bottom,b=c.xMin+(e||0),v=c.yMin+(a||0),w=s.drawRect(b,v,m,x,h,d.background,1,o,r),_=b+g.left,A=v+g.top+.75*(null!=(n=null==f?void 0:f.height)?n:0),S=s.drawText({x:_,y:A,text:t,fontSize:d.fontSize,fontFamily:d.fontFamily,fontWeight:d.fontWeight,foreColor:p,cssClass:d.cssClass||""}),C=u.xMin-c.xMin,k=u.yMin-c.yMin;if(Number.isFinite(C)&&Number.isFinite(k)&&(C||k)){const t=this.dynamicAnim.speed;this.animateTreemap(w,{x:b+C,y:v+k},{x:b,y:v},t),this.animateTreemap(S,{x:_+C,y:A+k},{x:_,y:A},t)}l.add(w),l.add(S)}}l.add(h),r.add(l)}),this.camera&&this._playZoomExit(r),this._renderBreadcrumb(),r}_levelCfg(t){if(this._levelCache||(this._levelCache=[]),this._levelCache[t])return this._levelCache[t];const e=this.w.config.plotOptions.treemap,i=e.parents||{},s=(e.levels||[])[t]||{},a=l(o(o({},i),s),{header:l(o(o({},i.header||{}),s.header||{}),{style:o(o({},(i.header||{}).style||{}),(s.header||{}).style||{})}),hover:o(o({},i.hover||{}),s.hover||{})});return this._levelCache[t]=a,a}_levelPadding(t,e,i){const s=this._levelCfg(t);return Number(s.padding)||0}_levelHeader(t,e,i,s){const a=this._levelCfg(e).header||{};if(!1===a.show)return 0;const r=Number(a.height);if(!Number.isFinite(r)||r<=0)return 0;return i<(Number(a.minWidth)||40)||s<2*r?0:r}_leavesBySeries(t,e){const i=new Array(Math.max(1,e));for(let t=0;t<i.length;t++)i[t]=[];const s=t=>{if(t.children&&t.children.length)t.children.forEach(s);else{const e=t._si||0;i[e]&&i[e].push(t)}};return t.forEach(s),i}_parentsBySeries(t,e){const i=new Array(Math.max(1,e));for(let t=0;t<i.length;t++)i[t]=[];const s=t=>{if(!t.children||!t.children.length)return;const e=t._si||0;i[e]&&i[e].push(t),t.children.forEach(s)};return t.forEach(s),i.forEach(t=>t.sort((t,e)=>(t.depth||0)-(e.depth||0))),i}_leafColor(t,e){const i=this.w;if(this.scale){const s=ne(i,t,e);if(null!=s){const t=this.scale.at(s);return{color:t,foreColor:he(t),colorProps:{color:t,foreColor:he(t),percent:0}}}}return this.helpers.getShadeColor(i.config.chart.type,t,e,this.negRange)}_parentChrome(t){const e=this.w,i=this._levelCfg(t),s="dark"===e.config.theme.mode,a=(i.header||{}).style||{},r=Math.min(t,3),n=s?255:0,o=`${n},${n},${n}`;return{fill:i.fill||`rgba(${o},${(s?.04:.03)+.02*r})`,fillOpacity:null==i.fillOpacity?1:i.fillOpacity,borderColor:i.borderColor||`rgba(${o},${s?.18:.14})`,borderWidth:null==i.borderWidth?1:i.borderWidth,borderRadius:null==i.borderRadius?e.config.plotOptions.treemap.borderRadius:i.borderRadius,headerBg:a.background||`rgba(${o},${s?.1:.07})`,headerColor:a.color||(s?"#e8e8e8":e.config.chart.foreColor),headerFontSize:a.fontSize||"12px",headerFontFamily:a.fontFamily||e.config.chart.fontFamily,headerFontWeight:null==a.fontWeight?600:a.fontWeight,hoverColor:i.hover&&i.hover.color||(s?"rgba(255,255,255,0.85)":"rgba(0,0,0,0.7)"),hoverWidth:i.hover&&i.hover.width||2,hoverShow:!(i.hover&&!1===i.hover.show)}}_drawParent(t,e,i){var s,a,r,n;const o=e.rect;if(!o)return;const l=this.w,h=new R(this.w,this.ctx),c=e.depth||0,d=this._levelCfg(c),p=this._parentChrome(c),g=o[0],f=o[1],m=o[2]-o[0],x=o[3]-o[1];if(m<=0||x<=0)return;const b=h.group({class:"apexcharts-treemap-parent","data:depth":c,"data:name":e.name}),y=Is(e._key),v=this._morphKeyed()?this.ctx.morphTypeChange.getInitialPathForKey(y):null,w=v?h.drawPath({d:this._tilePath(g,f,g+m,f+x),fill:p.fill,stroke:p.borderColor,strokeWidth:p.borderWidth,fillOpacity:p.fillOpacity}):h.drawRect(g,f,m,x,p.borderRadius,p.fill,p.fillOpacity,p.borderWidth,p.borderColor);w.node.classList.add("apexcharts-treemap-parent-rect"),w.node.setAttribute("data:key",y),w.node.setAttribute("data:depth",String(c)),v&&this._morphTile(w,v,this._tilePath(g,f,g+m,f+x),this.ctx.morphTypeChange.getSpeed(),i,c);let _=null,A=null,S=!1;const C=l.config.chart.animations.dynamicAnimation;if(!v&&l.globals.dataChanged&&C.enabled&&l.globals.shouldAnimate){const t=C.speed;if(_=null!=(a=null==(s=l.globals.prevTreemapParents)?void 0:s.get(`${i}|${y}`))?a:null,!_&&this.camera){_=this.camera.back({x:g,y:f,width:m,height:x}),S=!0;const e=l.layout;_.x<e.gridWidth&&_.y<e.gridHeight&&_.x+_.width>0&&_.y+_.height>0&&b.attr({opacity:0}).animate(t).attr({opacity:1})}_?A=new u(l).animateRect(w,...zs({x:_.x,y:_.y,width:_.width,height:_.height},{x:g,y:f,width:m,height:x},_.fill,w.node.getAttribute("fill")),t,()=>{}):b.attr({opacity:0}).animate(t).attr({opacity:1})}b.add(w);const k=e.headerHeight||0;let P="";if(k>0){const t=d.header||{},s=h.drawRect(g,f,m,k,0,p.headerBg,1,0,"transparent");if(s.node.classList.add("apexcharts-treemap-parent-header"),b.add(s),_){const t=_.header,e={x:g,y:f,width:m,height:k};new u(l).animateRect(s,...zs(t?{x:t.x,y:t.y,width:t.width,height:t.height}:S&&this.camera?this.camera.back(e):{x:_.x,y:_.y,width:_.width,height:0},e,null==t?void 0:t.fill,s.node.getAttribute("fill")),l.config.chart.animations.dynamicAnimation.speed,()=>{})}let a=String(null!=(r=e.name)?r:"");"function"==typeof t.formatter?a=String(t.formatter(e.name,{value:e._area,depth:c,seriesIndex:i,node:e,w:l})):t.showValue&&(a=`${a} ${this._formatValue(e._area,e._si)}`),P=a;const o=Number(t.offsetX)||0,y=t.align||"left",v=6,C=Math.max(0,m-2*v-Math.abs(o)),L=parseFloat(String(p.headerFontSize))||12,M=h.getTextBasedOnMaxWidth({text:a,maxWidth:C,fontSize:L,fontFamily:p.headerFontFamily,fontWeight:p.headerFontWeight});if(M){let e=g+v+o,i="start";"center"===y?(e=g+m/2+o,i="middle"):"right"===y&&(e=g+m-v+o,i="end");const s=h.drawText({x:e,y:f+k/2+L/3+(Number(t.offsetY)||0),text:M,textAnchor:i,fontSize:p.headerFontSize,fontFamily:p.headerFontFamily,fontWeight:p.headerFontWeight,foreColor:p.headerColor,cssClass:`apexcharts-treemap-parent-label ${t.style&&t.style.cssClass||""}`});if(s.node.setAttribute("pointer-events","none"),b.add(s),A&&_){const t=t=>"center"===y?t.x+t.width/2:"right"===y?t.x+t.width:t.x,e={x:t(_)-t({x:g,width:m})+(g+m/2),y:_.y-f+(f+x/2)},i=!!this.camera&&!S&&(null==(n=_.header)?void 0:n.look)!==Os(s.node);this._rideTile(s.node,e,g,f,g+m,f+x,A,i)}}this._attachParentEvents(s.node,e,p,w),this._makeParentAccessible(s.node,e,p,w,P)}this._attachParentEvents(w.node,e,p,w),b.node.setAttribute("role","group"),b.node.setAttribute("aria-label",this._parentLabel(e,P)),t.add(b)}_parentLabel(t,e){const i=this._drawnTotal(),s=i>0?(t._area/i*100).toFixed(1):"0",a=this._countLeaves(t);return`${e&&String(e).trim()?String(e).replace(/\s+/g," ").trim():`${t.name}, ${this._formatValue(t._area,t._si)}`}, ${a} ${1===a?"item":"items"}, ${s}% of total`}_makeParentAccessible(t,e,i,s,a){const r=this.w.config.chart.accessibility;if(!t||!t.setAttribute)return;if(!r.enabled||!r.keyboard.enabled||!this._zoomEnabled())return;const n=this.w.globals.treemapFocusKey===e._key;t.tmKey=e._key,t.setAttribute("role","button"),t.setAttribute("tabindex","0"),t.setAttribute("aria-label",`${this._parentLabel(e,a)}. Zoom ${n?"out":"in"}`),t.setAttribute("aria-expanded",n),Nt.isBrowser()&&t.addEventListener&&(t.addEventListener("focus",()=>{s.node.setAttribute("stroke",i.hoverColor),s.node.setAttribute("stroke-width",String(i.hoverWidth+1))}),t.addEventListener("blur",()=>{s.node.setAttribute("stroke",i.borderColor),s.node.setAttribute("stroke-width",String(i.borderWidth))}),t.addEventListener("keydown",t=>{"Enter"!==t.key&&" "!==t.key&&"Spacebar"!==t.key||(t.preventDefault(),this._zoomTo(e,!0))}))}_attachParentEvents(t,e,i,s){if(!Nt.isBrowser()||!t||!t.addEventListener)return;const a=this.w;i.hoverShow&&(t.addEventListener("mouseenter",()=>{s.node.setAttribute("stroke",i.hoverColor),s.node.setAttribute("stroke-width",String(i.hoverWidth))}),t.addEventListener("mouseleave",()=>{s.node.setAttribute("stroke",i.borderColor),s.node.setAttribute("stroke-width",String(i.borderWidth))})),a.config.tooltip.enabled&&(t.addEventListener("mouseenter",t=>this._showParentTooltip(t,e)),t.addEventListener("mousemove",t=>this._positionTooltip(t)),t.addEventListener("mouseleave",()=>this._hideParentTooltip())),this._zoomEnabled()&&(t.style.cursor="pointer",t.addEventListener("click",()=>this._zoomTo(e)))}zoomLive(t,e){var i;const s=t.config.plotOptions.treemap.zoom;if(!(null==s?void 0:s.enabled)||!Xs(t))return!1;const a=t.config.drilldown;return e&&(null==a?void 0:a.enabled)&&((null==(i=a.series)?void 0:i.length)||a.onDrillDown)?null:s}_zoomEnabled(){const t=this.ctx.drilldown,e=this.zoomLive(this.w,t);return null!==e||t.zoomWarned||(t.zoomWarned=!0,console.warn("ApexCharts treemap: zoom is ignored while drilldown is active (plotOptions.treemap.zoom vs drilldown series or onDrillDown).")),!!e}_resolveFocus(t){const e=this.w.globals.treemapFocusKey;if(!e||!this._zoomEnabled())return null;let i=null;const s=t=>{i||(t._key!==e?t.children&&t.children.forEach(s):i=t)};return t.forEach(s),i&&i.children&&i.children.length&&this._subtreeArea(i)>0?i:(this.w.globals.treemapFocusKey=null,null)}_zoomTo(t,e=!1){const i=this.w;if(!t||!t.children||!t.children.length)return;const s=i.globals.treemapFocusKey===t._key?null:t._key;this._refocus(s,e)}_refocus(t,e){const i=this.w,s=i.globals,a=s.treemapFocusKey,r=i.config.chart.animations,n=!(!r.enabled||!r.dynamicAnimation.enabled);s.treemapZoom=n&&Nt.isBrowser()?{from:null!=a?a:null,to:t}:null,s.treemapFocusKey=t,this._hideParentTooltip(),s.shouldAnimate=n,s.resized=!0,s.dataChanged=!0,s.treemapZoom&&this.ctx.series.getPreviousPaths();const o=this.ctx.update();e&&o.then(()=>{const t=i.dom.baseEl,e=Array.from(t.querySelectorAll(".apexcharts-treemap-parent-header[tabindex]"));(t.querySelector(".apexcharts-breadcrumb-item")||e.find(t=>t.tmKey===a)||e[0]||t).focus()})}_zoomCamera(){var t;const e=this.w,i=e.globals.treemapZoom;e.globals.treemapZoom=null;const s=e.globals.prevTreemapParents;if(!(i&&s&&e.globals.dataChanged&&e.globals.shouldAnimate))return null;const a=new Map,r=t=>{a.set(t._key,t),t.children&&t.children.forEach(r)};this.drawn.forEach(r);const n=(t,e)=>{for(let i=a.get(t);i;i=i._parent)if(i._key===e)return!0;return!1},{from:o,to:l}=i,h=l&&(null==o||n(l,o))?l:o&&(null==l||n(o,l))?o:null,c=h?a.get(h):null;if(!h||!c||!c.rect)return null;let d=c;for(;d._parent;)d=d._parent;const u=Math.max(0,this.roots.indexOf(d)),p=null!=(t=s.get(`${u}|${Is(h)}`))?t:null,g=c.rect,f=g[0],m=g[1],x=g[2]-g[0],b=g[3]-g[1];if(!p||!(p.width>0&&p.height>0&&x>0&&b>0))return null;const y=p,v=x/y.width,w=b/y.height;return{fwd:t=>({x:f+(t.x-y.x)*v,y:m+(t.y-y.y)*w,width:t.width*v,height:t.height*w}),back:t=>({x:y.x+(t.x-f)/v,y:y.y+(t.y-m)/w,width:t.width/v,height:t.height/w})}}_playZoomExit(t){const e=this.w,i=this.camera,s=e.globals.prevTreemapView;if(e.globals.prevTreemapView=null,!i||!Nt.isBrowser())return;const a=t.node,r=new R(this.w,this.ctx),n=[["apexcharts-treemap-rect","T"],["apexcharts-treemap-parent-rect","P"],["apexcharts-data-labels","L"]],o=t=>{var e;const i=n.find(([e])=>t.classList.contains(e)),s=null==(e=t.closest(".apexcharts-series"))?void 0:e.getAttribute("data:realIndex");return i?`${i[1]}${s}|${t.getAttribute("data:key")}`:""},l=(t,e)=>{var i;return parseFloat(null!=(i=t.getAttribute(e))?i:"")},h=t=>({x:l(t,"x"),y:l(t,"y"),width:l(t,"width"),height:l(t,"height")}),c=t=>({x:t.x+t.width/2,y:t.y+t.height/2}),d=new Map;a.querySelectorAll("[data\\:key]").forEach(t=>{const e=o(t);e&&d.set(e,t)});const u=[],p=(t,e)=>{const i=h(t);[i.x,i.y,i.width,i.height].every(Number.isFinite)&&u.push(s=>{t.setAttribute("x",String(i.x+(e.x-i.x)*s)),t.setAttribute("y",String(i.y+(e.y-i.y)*s)),t.setAttribute("width",String(i.width+(e.width-i.width)*s)),t.setAttribute("height",String(i.height+(e.height-i.height)*s))})},g=(t,e,i=!1)=>{var s;const a=t.getAttribute("transform")||"",r=parseFloat(null!=(s=t.getAttribute("opacity"))?s:"1"),n=Number.isFinite(r)?r:1;u.push(s=>{t.setAttribute("transform",`translate(${e.x*s} ${e.y*s}) ${a}`.trim()),i&&t.setAttribute("opacity",String(n*(1-s)))})},f=t=>{[t,...t.querySelectorAll("*")].forEach(t=>{t.removeAttribute("data:key"),["role","tabindex","aria-label","aria-expanded"].forEach(e=>t.removeAttribute(e)),t.classList.remove("apexcharts-treemap-rect","apexcharts-treemap-parent","apexcharts-treemap-parent-rect","apexcharts-treemap-parent-header","apexcharts-treemap-parent-label","apexcharts-data-labels")})},m=r.group({class:"apexcharts-treemap-ghosts"}).node,x=r.group({class:"apexcharts-treemap-ghosts"}).node;if(s){const t=[...s.querySelectorAll(":scope > .apexcharts-treemap-ghosts")];t.forEach((e,s)=>{e.querySelectorAll("rect").forEach(t=>p(t,i.fwd(h(t)))),e.querySelectorAll("text").forEach(t=>{const e=t=>{const e=/^translate\(\s*([-+.\deE]+)[\s,]+([-+.\deE]+)\s*\)/.exec(((null==t?void 0:t.getAttribute("transform"))||"").trim());return e?[parseFloat(e[1]),parseFloat(e[2])]:[0,0]},[s,a]=e(t.parentElement),[r,n]=e(t),o={x:l(t,"x")+s+r,y:l(t,"y")+a+n,width:0,height:0};if(!Number.isFinite(o.x)||!Number.isFinite(o.y))return;const h=i.fwd(o);g(t,{x:h.x-o.x,y:h.y-o.y})}),[...e.childNodes].forEach(e=>(s===t.length-1&&t.length>1?x:m).appendChild(e)),e.remove()});const a=new Map;s.querySelectorAll(".apexcharts-treemap-rect[data\\:key]").forEach(t=>a.set(o(t),t)),s.querySelectorAll(".apexcharts-data-labels[data\\:key]").forEach(t=>{const e=o(t),s=d.get(e);if(s&&!(t=>{var e;return parseFloat(null!=(e=t.getAttribute("opacity"))?e:"1")<.999})(t)&&W.treemapLabelLook(s)===W.treemapLabelLook(t))return;const r=a.get(`T${e.slice(1)}`);if(!r)return;const n=c(h(r)),l=d.get(`T${e.slice(1)}`),u=c(l?h(l):i.fwd(h(r)));g(t,{x:u.x-n.x,y:u.y-n.y},!!l),f(t),x.appendChild(t)}),s.querySelectorAll(".apexcharts-treemap-parent").forEach(t=>{var s;const a=t.querySelector(".apexcharts-treemap-parent-rect[data\\:key]");if(!a||"rect"!==a.tagName.toLowerCase())return;const r=d.get(o(a));if(r){const e=t.querySelector(".apexcharts-treemap-parent-label"),i=null==(s=r.parentElement)?void 0:s.querySelector(".apexcharts-treemap-parent-label");if(e&&Os(e)!==Os(i)){const t=h(a),i=h(r),s=e.getAttribute("text-anchor"),n=t=>"middle"===s?t.x+t.width/2:"end"===s?t.x+t.width:t.x;g(e,{x:n(i)-n(t),y:i.y-t.y},!0),f(e),x.appendChild(e)}return}t.querySelectorAll("rect").forEach(t=>p(t,i.fwd(h(t)))),t.querySelectorAll("text").forEach(t=>{const e={x:l(t,"x"),y:l(t,"y"),width:0,height:0};if(!Number.isFinite(e.x)||!Number.isFinite(e.y))return;const s=i.fwd(e);g(t,{x:s.x-e.x,y:s.y-e.y})});const n=i.fwd(h(a)),c=e.layout;n.x<c.gridWidth&&n.y<c.gridHeight&&n.x+n.width>0&&n.y+n.height>0&&u.push(e=>t.setAttribute("opacity",String(1-e))),f(t),m.appendChild(t)}),a.forEach((t,e)=>{d.has(e)||"rect"!==t.tagName.toLowerCase()||(p(t,i.fwd(h(t))),f(t),m.appendChild(t))});const r=s.querySelector(":scope > defs.apexcharts-treemap-ghost-defs");r&&m.insertBefore(r,m.firstChild)}[m,x].forEach(t=>{t.setAttribute("pointer-events","none"),t.setAttribute("aria-hidden","true")}),a.insertBefore(m,a.firstChild),a.appendChild(x),a.setAttribute("clip-path",`url(#gridRectMask${e.globals.cuid})`),Yi(e,Math.max(1,this.dynamicAnim.speed||1),w(e.config.chart.animations.easing),t=>u.forEach(e=>e(t)),()=>{m.remove(),x.remove(),a.removeAttribute("clip-path")})}_focusChain(){const t=[],e=new Set(this.drawn||[]);let i=this._resolveFocus(this.drawn||[]);for(;i&&(t.unshift(i),!e.has(i));)i=i._parent;return t}_breadcrumbCfg(){const t=this.w.config.plotOptions.treemap.zoom;return Ds(this.w,t&&t.breadcrumb)}_renderBreadcrumb(){if(!Nt.isBrowser())return;const t=this.w;if(!t.dom.elWrap)return;if(Ts(t),!this._zoomEnabled())return;const e=this._focusChain();if(!e.length)return;const i=function(t,e){if(!Nt.isBrowser())return null;const i=t.dom.elWrap;if(!i)return null;Ts(t);const s=e.config||Ds(t);if(!1===s.show)return null;const a=e.crumbs||[];if(a.length<2)return null;const r=ft.createElementNS(Fs,"nav");r.setAttribute("class","apexcharts-breadcrumb"),r.setAttribute("aria-label",e.ariaLabel||"Breadcrumb"),function(t,e){const i=e.offsetX||0,s=e.offsetY||0;t.style.position="absolute",t.style.top=s+"px","top-right"===e.position?t.style.right=3-i+"px":t.style.left=i+"px"}(r,s),e.compact&&(r.style.fontSize="11px",r.style.padding="0 2px");const n=null!=s.separator?s.separator:" / ";return a.forEach((t,i)=>{var o;if(i>0){const t=ft.createElementNS(Fs,"span");t.setAttribute("class","apexcharts-breadcrumb-separator"),t.setAttribute("aria-hidden","true"),t.textContent=n,r.appendChild(t)}let l=0===i?null!=(o=s.rootLabel)?o:"All":t.label;if("function"==typeof s.formatter&&(l=s.formatter(l,{index:i,depth:a.length-1,data:t.data})),i===a.length-1){const t=ft.createElementNS(Fs,"span");return t.setAttribute("class","apexcharts-breadcrumb-item apexcharts-breadcrumb-current"),t.setAttribute("aria-current","page"),t.textContent=String(l),void r.appendChild(t)}const h=ft.createElementNS(Fs,"button");if(h.setAttribute("type","button"),h.setAttribute("class","apexcharts-breadcrumb-item"),0===i){const t=ft.createElementNS(Fs,"span");t.setAttribute("class","apexcharts-breadcrumb-arrow"),t.setAttribute("aria-hidden","true"),t.textContent="\u2190",h.appendChild(t)}const c=ft.createElementNS(Fs,"span");c.setAttribute("class","apexcharts-breadcrumb-label"),c.textContent=String(l),h.appendChild(c),h.addEventListener("click",s=>e.onNavigate(i,t,s)),r.appendChild(h)}),i.appendChild(r),r}(t,{ariaLabel:"Treemap breadcrumb",config:this._breadcrumbCfg(),compact:!0,crumbs:[{label:"All",data:null}].concat(e.map(t=>({label:t.name,data:t}))),onNavigate:(t,e,i)=>{this._refocus(e.data?e.data._key:null,!i.detail)}});i&&(this._placeBreadcrumb(i),function(t,e){const i=[".apexcharts-title-text",".apexcharts-subtitle-text"].map(e=>t.dom.baseEl.querySelector(e)).filter(t=>null!==t);if(!i.length)return;const s=t.dom.elWrap.getBoundingClientRect().top;for(let t=0;t<i.length+1;t++){const t=e.getBoundingClientRect(),a=i.find(e=>{const i=e.getBoundingClientRect();return t.left<i.right&&t.right>i.left&&t.top<i.bottom&&t.bottom>i.top});if(!a)break;e.style.top=a.getBoundingClientRect().bottom-s+4+"px"}}(t,i))}_placeBreadcrumb(t){var e,i;const s=this.w,a=s.layout.translateY||0,r=null==(i=null==(e=this.ctx)?void 0:e.dimensions)?void 0:i.dimHelpers,n=r?r.getTitleSubtitleCoords("title").height+r.getTitleSubtitleCoords("subtitle").height:0,o=t.getBoundingClientRect().height||18,l=this._breadcrumbCfg().offsetY||0;if(a-n>=o+1)return void(t.style.top=`${a-o-1+l}px`);t.style.top=`${n+l}px`;const h="dark"===s.config.theme.mode;t.style.background=h?"rgba(20,24,30,0.82)":"rgba(255,255,255,0.86)",t.style.borderRadius="4px"}_showParentTooltip(t,e){var i;const s=this.w,a=this._tip();if(!a)return;const r=this._drawnTotal(),n=e._parent?this._subtreeArea(e._parent):r,o=r>0?(e._area/r*100).toFixed(1):"0.0",l=n>0?(e._area/n*100).toFixed(1):o,h=this.w.config.plotOptions.treemap.parents,c=this._countLeaves(e);let d=h&&h.tooltip&&h.tooltip.formatter;"function"!=typeof d&&(d=s.config.tooltip.custom);let u=null==(i=Array.isArray(d)?d[e._si]:d)?void 0:i({name:e.name,value:e._area,depth:e.depth||0,leafCount:c,percentOfParent:+l,percentOfTotal:+o,node:e,w:s,series:s.seriesData.series,seriesIndex:e._si,dataPointIndex:-1,ctx:this.ctx});if(null==u||!1===u){const t=this._parentChrome(e.depth||0).headerBg;u=`<div class="apexcharts-tooltip-series-group apexcharts-active" style="display:flex;${s.config.tooltip.fillSeriesColor?`background-color:${t};`:""}"><div class="apexcharts-tooltip-text"><div class="apexcharts-tooltip-y-group"><span class="apexcharts-tooltip-text-y-label">${function(t,e=t){const i=String(null!=t?t:""),s=e===i?"":e===i+": "?": ":null;return null===s?e:i.replace(/&/g,"&").replace(/</g,"<")+s}(e.name)}: </span><span class="apexcharts-tooltip-text-y-value">${this._formatValue(e._area,e._si)}</span></div><div class="apexcharts-tooltip-y-group"><span class="apexcharts-tooltip-text-y-label">${c} items, </span><span class="apexcharts-tooltip-text-y-value">${l}% of parent, ${o}% of total</span></div></div></div>`}(null==u?void 0:u.nodeName)?a.replaceChildren(u.cloneNode(!0)):a.innerHTML=u,a.classList.add("apexcharts-active"),a.removeAttribute("aria-hidden"),this._positionTooltip(t)}_tip(){const t=this.w.dom.elWrap;let e=this._tooltipEl;if(!(null==e?void 0:e.isConnected)){e=t.querySelector(".apexcharts-treemap-tooltip");const i=!e&&t.querySelector(".apexcharts-tooltip");i&&(e=i.cloneNode(!1),e.classList.add("apexcharts-treemap-tooltip"),t.appendChild(e)),this._tooltipEl=e}return e}_positionTooltip(t){const e=this._tip();if(!e)return;const i=this.w.dom.elWrap.getBoundingClientRect(),s=e.offsetWidth,a=e.offsetHeight;let r=t.clientX-i.left+12;r+s>i.width&&(r=t.clientX-i.left-s-12),r=Math.max(0,Math.min(r,i.width-s));let n=t.clientY-i.top+12;n+a>i.height&&(n=t.clientY-i.top-a-12),n=Math.max(0,Math.min(n,i.height-a)),e.style.left=r+"px",e.style.top=n+"px"}_hideParentTooltip(){const t=this._tooltipEl;null==t||t.classList.remove("apexcharts-active"),null==t||t.setAttribute("aria-hidden","true")}_drawnTotal(){return null==this._total&&(this._total=(this.drawn||[]).reduce((t,e)=>t+this._subtreeArea(e),0)),this._total||0}_subtreeArea(t){if(null!=t._area)return t._area;const e=t.children;if(e&&e.length){let t=0;for(let i=0;i<e.length;i++)t+=this._subtreeArea(e[i]);return t}const i=Number(t.value);return isNaN(i)?0:Math.abs(i)}_countLeaves(t){return t.children&&t.children.length?t.children.reduce((t,e)=>t+this._countLeaves(e),0):1}_formatValue(t,e){var i,s,a,r,n;const o=this.w,l=(null==(s=null==(i=o.config.tooltip)?void 0:i.y)?void 0:s.formatter)||(null==(n=null==(r=null==(a=o.config.yaxis)?void 0:a[0])?void 0:r.labels)?void 0:n.formatter);if("function"==typeof l)try{return String(l(t,{seriesIndex:e||0,dataPointIndex:-1,w:o}))}catch(t){}return String(t)}_labelCanShow(t,e,i){if(!Number.isFinite(t)||t<=0)return!1;const s=this.w.config.plotOptions.treemap.dataLabels;return!(t<(s&&null!=s.minFontSize?Number(s.minFontSize):0))&&Math.max(e,i)>=t}_averageLabelSize(){if(null!=this._avgLabelSize)return this._avgLabelSize;const t=this.labels.flat();let e=0;for(const i of t)e+=String(null!=i?i:"").length;return this._avgLabelSize=e/(t.length||1),this._avgLabelSize}getFontSize(t){const e=this.w,i=this._averageLabelSize();return function(t,s){const a=t*s,r=Math.pow(a,.5);return Math.min(r/i,parseInt(e.config.dataLabels.style.fontSize,10))}(t[2]-t[0],t[3]-t[1])}rotateToFitLabel(t,e,i,s,a,r,n){const o=this._labelRect(new R(this.w),i,e),l=t.node.querySelector("text");if(l&&o.width+this.w.config.stroke.width+5>r-s&&o.width<=n-a){const e=l.getAttribute("text-anchor"),i=+l.getAttribute("x")+(("start"===e)-("end"===e))*o.width/2,s=+l.getAttribute("y")+o.centerOffset;t.node.setAttribute("transform",`rotate(-90 ${i} ${s}) translate(${o.height/3})`)}}_labelRect(t,e,i){const s=this.w.config.dataLabels.style;return t.getTextRects(e,String(i),s.fontFamily,"",!0,s.fontWeight)}truncateLabels(t,e,i,s,a,r){const n=new R(this.w),h=this._labelRect(n,t,e).width+this.w.config.stroke.width+5>a-i&&r-s>a-i?r-s:a-i,c=n.getTextBasedOnMaxWidth(l(o({},this.w.config.dataLabels.style),{text:t,maxWidth:h,fontSize:e}));return t.length!==c.length&&h/e<5?"":c}_morphKeyed(){var t,e;const i=null==(t=this.ctx)?void 0:t.morphTypeChange;return null!=(e=this._keyed)?e:this._keyed=!(!i||"function"!=typeof i.hasKeyedMarks||!i.hasKeyedMarks()||"function"!=typeof i.getInitialPathForKey)}_morphSourceForLeaf(t){var e;const i=null==(e=this.ctx)?void 0:e.morphTypeChange;if(!i||"function"!=typeof i.getInitialPathAt)return null;if(this._morphKeyed()){const e=i.getInitialPathForKey(Is(t._key));if(e)return e}return i.getInitialPathAt(this._morphLeafIndex++)}_tilePath(t,e,i,s){return`M ${t} ${e} L ${i} ${e} L ${i} ${s} L ${t} ${s} Z`}_morphTile(t,e,i,s,a,r){new u(this.w,this.ctx).morphSVG(t,a,r,"none",e,i,s,0)}_rideTile(t,e,i,s,a,r,n,o=!e){const l=t.getAttribute("transform")||"",h=e?e.x-(i+a)/2:0,c=e?e.y-(s+r)/2:0,d=e=>{if(e>=1)return l?t.setAttribute("transform",l):t.removeAttribute("transform"),void t.removeAttribute("opacity");const i=1-e;t.setAttribute("transform",`translate(${h*i} ${c*i}) ${l}`.trim()),o&&t.setAttribute("opacity",String(e))};d(0),n.during(d)}animateTreemap(t,e,i,s,a=0){const r=new u(this.w);return r.animateRect(t,e,i,s,()=>{r.animationCompleted(t)},a)}}}),Object.prototype.hasOwnProperty.call(c.default,"__internals")||Object.defineProperty(c.default,"__internals",{value:Ut,enumerable:!1,writable:!1,configurable:!1}),function(t){Object.prototype.hasOwnProperty.call(t,"__drainsAddons")||Object.defineProperty(t,"__drainsAddons",{value:!0});const e=globalThis,i=()=>{var t;const i=e.__apexcharts_pending_addons__;if(!Array.isArray(i)||!i.length)return;if(!e.ApexCharts||!e.ApexCharts.__internals)return;const s=i.splice(0);for(const t of s)t.done=!0;for(const i of s)try{i.run.call(e)}catch(s){e.console.error(`ApexCharts: ${i.file}, loaded before the ApexCharts script, failed to register: ${null!=(t=null==s?void 0:s.message)?t:s}`)}};"function"==typeof queueMicrotask?queueMicrotask(i):Promise.resolve().then(i)}(c.default),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>c.default});
|
|
5
|
+
"use strict";var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,n=(e,i,s)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s,o=(t,e)=>{for(var i in e||(e={}))a.call(e,i)&&n(t,i,e[i]);if(s)for(var i of s(e))r.call(e,i)&&n(t,i,e[i]);return t},l=(t,s)=>e(t,i(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 i in t)if("default"!==i){const s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>t[i]})}return e.default=t,Object.freeze(e)}const c=h(require("apexcharts/core")),d=c.__apex_charts_Scatter,u=c.__apex_Animations,p=c.__apex_Animations_computeStagger,g=c.__apex_Animations_applyAnimationPolicy,f=c.__apex_Animations_prefersReducedMotion,m=c.__apex_Animations_applyProgressiveReveal,x=c.__apex_Easing_easeInOutSine,b=c.__apex_Easing_DEFAULT_EASING_NAME,y=c.__apex_Easing_cubicBezier,v=c.__apex_Easing_registerEasing,w=c.__apex_Easing_resolveEasing,_=c.__apex_Base,A=c.__apex_ChartFactory_register,S=c.__apex_ChartFactory_getChartClass,C=c.__apex_ChartFactory_isCustom,k=c.__apex_Core,P=c.__apex_CoreUtils,L=c.__apex_Crosshairs,M=c.__apex_Data,I=c.__apex_DataLabels,E=c.__apex_Events,F=c.__apex_Fill,D=c.__apex_Filters,T=c.__apex_Formatters,R=c.__apex_Graphics,z=c.__apex_Markers,X=c.__apex_Range,O=c.__apex_Responsive,$=c.__apex_Scales,W=c.__apex_Series,Y=c.__apex_Theme,H=c.__apex_TimeScale,B=c.__apex_TitleSubtitle,N=c.__apex_axes_Axes,j=c.__apex_axes_AxesUtils,V=c.__apex_axes_Grid,G=c.__apex_axes_XAxis,q=c.__apex_axes_YAxis,Z=c.__apex_dimensions_Dimensions,U=c.__apex_dimensions_Grid,K=c.__apex_dimensions_Helpers,J=c.__apex_dimensions_XAxis,Q=c.__apex_dimensions_YAxis,tt=c.__apex_helpers_Destroy,et=c.__apex_helpers_InitCtxVariables,it=c.__apex_helpers_Localization,st=c.__apex_helpers_UpdateHelpers,at=c.__apex_Config,rt=c.__apex_Defaults,nt=c.__apex_Globals,ot=c.__apex_Options,lt=c.__apex_tooltip_AxesTooltip,ht=c.__apex_tooltip_Intersect,ct=c.__apex_tooltip_Labels,dt=c.__apex_tooltip_Marker,ut=c.__apex_tooltip_Position,pt=c.__apex_tooltip_Tooltip,gt=c.__apex_tooltip_Utils,ft=c.__apex_BrowserAPIs_BrowserAPIs,mt=c.__apex_DOMShim_SSRDOMShim,xt=c.__apex_DOMShim_SSRElement,bt=c.__apex_DOMShim_SSRClassList,yt=c.__apex_PathMorphing_parsePath,vt=c.__apex_PathMorphing_morphPaths,wt=c.__apex_PathMorphing_pathBbox,_t=c.__apex_PathMorphing_arrayToPath,At=c.__apex_SVGAnimation_SVGAnimationRunner,St=c.__apex_SVGAnimation_installAnimationMethods,Ct=c.__apex_SVGContainer,kt=c.__apex_SVGDraggable_installDraggable,Pt=c.__apex_SVGElement,Lt=c.__apex_SVGFilter_SVGFilter,Mt=c.__apex_SVGFilter_FilterBuilder,It=c.__apex_SVGFilter_installFilterMethods,Et=c.__apex_SVGGradient_SVGGradient,Ft=c.__apex_SVGPattern_SVGPattern,Dt=c.__apex_SVGSelectable_installSelectable,Tt=c.__apex_index_SVG,Rt=c.__apex_index_Box,zt=c.__apex_math_SVGNS,Xt=c.__apex_math_Point,Ot=c.__apex_math_Matrix,$t=c.__apex_math_Box,Wt=c.__apex_Constants_LINE_HEIGHT_RATIO,Yt=c.__apex_Constants_NICE_SCALE_ALLOWED_MAG_MSD,Ht=c.__apex_Constants_NICE_SCALE_DEFAULT_TICKS,Bt=c.__apex_DateTime,Nt=c.__apex_Environment_Environment,jt=c.__apex_PerformanceCache,Vt=c.__apex_Resize_addResizeListener,Gt=c.__apex_Resize_removeResizeListener,qt=c.__apex_ThemePalettes_getThemePalettes,Zt=c.__apex_Utils,Ut=Object.freeze(Object.defineProperty({__proto__:null,__apex_Animations:u,__apex_Animations_applyAnimationPolicy:g,__apex_Animations_applyProgressiveReveal:m,__apex_Animations_computeStagger:p,__apex_Animations_prefersReducedMotion:f,__apex_Base:_,__apex_BrowserAPIs_BrowserAPIs:ft,__apex_ChartFactory_getChartClass:S,__apex_ChartFactory_isCustom:C,__apex_ChartFactory_register:A,__apex_Config:at,__apex_Constants_LINE_HEIGHT_RATIO:Wt,__apex_Constants_NICE_SCALE_ALLOWED_MAG_MSD:Yt,__apex_Constants_NICE_SCALE_DEFAULT_TICKS:Ht,__apex_Core:k,__apex_CoreUtils:P,__apex_Crosshairs:L,__apex_DOMShim_SSRClassList:bt,__apex_DOMShim_SSRDOMShim:mt,__apex_DOMShim_SSRElement:xt,__apex_Data:M,__apex_DataLabels:I,__apex_DateTime:Bt,__apex_Defaults:rt,__apex_Easing_DEFAULT_EASING_NAME:b,__apex_Easing_cubicBezier:y,__apex_Easing_easeInOutSine:x,__apex_Easing_registerEasing:v,__apex_Easing_resolveEasing:w,__apex_Environment_Environment:Nt,__apex_Events:E,__apex_Fill:F,__apex_Filters:D,__apex_Formatters:T,__apex_Globals:nt,__apex_Graphics:R,__apex_Markers:z,__apex_Options:ot,__apex_PathMorphing_arrayToPath:_t,__apex_PathMorphing_morphPaths:vt,__apex_PathMorphing_parsePath:yt,__apex_PathMorphing_pathBbox:wt,__apex_PerformanceCache:jt,__apex_Range:X,__apex_Resize_addResizeListener:Vt,__apex_Resize_removeResizeListener:Gt,__apex_Responsive:O,__apex_SVGAnimation_SVGAnimationRunner:At,__apex_SVGAnimation_installAnimationMethods:St,__apex_SVGContainer:Ct,__apex_SVGDraggable_installDraggable:kt,__apex_SVGElement:Pt,__apex_SVGFilter_FilterBuilder:Mt,__apex_SVGFilter_SVGFilter:Lt,__apex_SVGFilter_installFilterMethods:It,__apex_SVGGradient_SVGGradient:Et,__apex_SVGPattern_SVGPattern:Ft,__apex_SVGSelectable_installSelectable:Dt,__apex_Scales:$,__apex_Series:W,__apex_Theme:Y,__apex_ThemePalettes_getThemePalettes:qt,__apex_TimeScale:H,__apex_TitleSubtitle:B,__apex_Utils:Zt,__apex_axes_Axes:N,__apex_axes_AxesUtils:j,__apex_axes_Grid:V,__apex_axes_XAxis:G,__apex_axes_YAxis:q,__apex_charts_Scatter:d,__apex_dimensions_Dimensions:Z,__apex_dimensions_Grid:U,__apex_dimensions_Helpers:K,__apex_dimensions_XAxis:J,__apex_dimensions_YAxis:Q,__apex_helpers_Destroy:tt,__apex_helpers_InitCtxVariables:et,__apex_helpers_Localization:it,__apex_helpers_UpdateHelpers:st,__apex_index_Box:Rt,__apex_index_SVG:Tt,__apex_math_Box:$t,__apex_math_Matrix:Ot,__apex_math_Point:Xt,__apex_math_SVGNS:zt,__apex_tooltip_AxesTooltip:lt,__apex_tooltip_Intersect:ht,__apex_tooltip_Labels:ct,__apex_tooltip_Marker:dt,__apex_tooltip_Position:ut,__apex_tooltip_Tooltip:pt,__apex_tooltip_Utils:gt,default:c.default},Symbol.toStringTag,{value:"Module"}));function Kt(t,e){const i=t.length;if(0===i)return NaN;if(1===i)return t[0];const s=(i-1)*e,a=Math.floor(s),r=Math.ceil(s);return a===r?t[a]:t[a]+(t[r]-t[a])*(s-a)}function Jt(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const i=t.slice().sort((t,e)=>t-e);let s=i[0],a=i[i.length-1];const r=e.range;if(Array.isArray(r)&&2===r.length){const t=Number(r[0]),e=Number(r[1]);Number.isFinite(t)&&Number.isFinite(e)&&e>t&&(s=t,a=e)}if(!(a>s)){const t=Math.abs(s)>0?.05*Math.abs(s):.5;return{edges:[s-t,s+t],binWidth:2*t,rule:"single",capped:!1}}const n=a-s;let o,l;if("number"==typeof e.binWidth&&e.binWidth>0)o=e.binWidth,l="binWidth";else if("number"==typeof e.bins&&e.bins>=1)o=n/Math.floor(e.bins),l="count";else{const t=function(t,e,i){const s=t.length,a=t=>e/Math.max(1,Math.ceil(t)),r=()=>a(Math.log2(s)+1);switch(i){case"sqrt":return{width:a(Math.sqrt(s)),rule:"sqrt"};case"rice":return{width:a(2*Math.cbrt(s)),rule:"rice"};case"scott":{const e=function(t){const e=t.length;if(e<2)return 0;let i=0;for(let s=0;s<e;s++)i+=t[s];const s=i/e;let a=0;for(let i=0;i<e;i++){const e=t[i]-s;a+=e*e}return Math.sqrt(a/e)}(t);return e>0?{width:3.49*e*Math.pow(s,-1/3),rule:"scott"}:{width:r(),rule:"sturges"}}case"fd":{const e=Kt(t,.75)-Kt(t,.25);return e>0?{width:2*e*Math.pow(s,-1/3),rule:"fd"}:{width:r(),rule:"sturges"}}case"auto":{const e=r(),i=Kt(t,.75)-Kt(t,.25);if(i<=0)return{width:e,rule:"sturges"};const a=2*i*Math.pow(s,-1/3);return a<e?{width:a,rule:"fd"}:{width:e,rule:"sturges"}}default:return{width:r(),rule:"sturges"}}}(i,n,"string"==typeof e.bins?e.bins:"auto");o=t.width,l=t.rule}(!Number.isFinite(o)||o<=0)&&(o=n);let h=Math.ceil(n/o);(!Number.isFinite(h)||h<1)&&(h=1);let c=!1;h>1e3&&(h=1e3,c=!0),o=n/h;const d=new Array(h+1);for(let t=0;t<=h;t++)d[t]=s+t*o;return d[h]=Math.max(d[h],a),{edges:d,binWidth:o,rule:l,capped:c}}function Qt(t,e){const i=e.length-1;if(!(t>=e[0])||t>e[i])return-1;if(t===e[i])return i-1;const s=(e[i]-e[0])/i;if(s>0){let a=Math.floor((t-e[0])/s);return a<0&&(a=0),a>i-1&&(a=i-1),t<e[a]?a--:t>=e[a+1]&&a++,a<0||a>i-1?-1:a}let a=0,r=i-1;for(;a<=r;){const i=a+r>>1;if(t<e[i])r=i-1;else{if(!(t>=e[i+1]))return i;a=i+1}}return-1}function te(t){const e=t.getRootNode?t.getRootNode():null;return e&&(9===e.nodeType||11===e.nodeType&&"host"in e)?e:t.ownerDocument||document}const ee={},ie=(t,e)=>ee[t]||(ee[t]=e(t).then(e=>(setTimeout(()=>delete ee[t],6e4),e),e=>{throw delete ee[t],e}));class se{constructor(t,e){this.w=t,this.ctx=e}svgStringToNode(t){return(new DOMParser).parseFromString(t,"image/svg+xml").documentElement}scaleSvgNode(t,e){const i=parseFloat(t.getAttributeNS(null,"width")),s=parseFloat(t.getAttributeNS(null,"height"));t.setAttributeNS(null,"width",i*e),t.setAttributeNS(null,"height",s*e),t.setAttributeNS(null,"viewBox","0 0 "+i+" "+s)}inlineCanvasLayers(t){const e=this.w.dom.elWrap.querySelectorAll(".apexcharts-series-canvas");if(!e.length)return;const i=t.querySelectorAll(".apexcharts-canvas-series");for(let t=0;t<e.length&&t<i.length;t++){let s;try{s=e[t].toDataURL()}catch(t){continue}const a=i[t],r=document.createElementNS(zt,"image");r.setAttribute("x",a.getAttribute("x")||"0"),r.setAttribute("y",a.getAttribute("y")||"0"),r.setAttribute("width",a.getAttribute("width")||"0"),r.setAttribute("height",a.getAttribute("height")||"0"),r.setAttribute("href",s),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s),a.parentNode&&a.parentNode.replaceChild(r,a)}}queryStyleable(t,e){return Array.prototype.slice.call(t.querySelectorAll(e))}setStyleDefaults(t,e){Object.keys(e).forEach(i=>{""===t.style.getPropertyValue(i)&&t.style.setProperty(i,e[i])})}resolveCssVars(t,e){const i=[t,...Array.from(t.querySelectorAll("*"))],s=[e,...Array.from(e.querySelectorAll("*"))];if(i.length!==s.length)return;const a=["fill","stroke","stop-color","flood-color","color"];s.forEach((t,e)=>{let s=null;const r=t=>(s=s||ft.getComputedStyle(i[e]),s&&s.getPropertyValue?s.getPropertyValue(t):"");a.forEach(e=>{const i=t.getAttribute(e);if(i&&-1!==i.indexOf("var(")){const i=r(e);i&&t.setAttribute(e,i)}});const n=t.style;n&&-1!==n.cssText.indexOf("var(")&&Array.from(n).forEach(t=>{if(-1!==n.getPropertyValue(t).indexOf("var(")){const e=r(t);e&&n.setProperty(t,e)}})})}applyExportStyles(t){const e=this.w;this.queryStyleable(t,"style").forEach(t=>t.remove()),this.queryStyleable(t,[".apexcharts-tooltip",".apexcharts-toolbar",".apexcharts-xaxistooltip",".apexcharts-yaxistooltip",".apexcharts-xcrosshairs",".apexcharts-ycrosshairs",".apexcharts-zoom-rect",".apexcharts-selection-rect"].join(", ")).forEach(t=>{t.style.setProperty("display","none","important")}),this.queryStyleable(t,".apexcharts-flip-y").forEach(t=>{this.setStyleDefaults(t,{transform:"scaleY(-1) translateY(-100%)","transform-origin":"top","transform-box":"fill-box"})}),this.queryStyleable(t,".apexcharts-flip-x").forEach(t=>{this.setStyleDefaults(t,{transform:"scaleX(-1)","transform-origin":"center","transform-box":"fill-box"})}),e.config.legend.show&&e.dom.elLegendWrap&&e.dom.elLegendWrap.children.length&&(this.queryStyleable(t,".apexcharts-legend").forEach(t=>{this.setStyleDefaults(t,{display:"flex",overflow:"auto",padding:"0 10px"});const e=t.classList,i=e.contains("apx-legend-position-left")||e.contains("apx-legend-position-right"),s=e.contains("apx-legend-position-top")||e.contains("apx-legend-position-bottom");e.contains("apexcharts-legend-group-horizontal")&&this.setStyleDefaults(t,{"flex-direction":"column"}),i&&this.setStyleDefaults(t,{"flex-direction":"column",bottom:"0"}),s&&this.setStyleDefaults(t,{"flex-wrap":"wrap"}),i||s&&e.contains("apexcharts-align-left")?this.setStyleDefaults(t,{"justify-content":"flex-start","align-items":"flex-start"}):s&&e.contains("apexcharts-align-center")?this.setStyleDefaults(t,{"justify-content":"center","align-items":"center"}):s&&e.contains("apexcharts-align-right")&&this.setStyleDefaults(t,{"justify-content":"flex-end","align-items":"flex-end"})}),this.queryStyleable(t,".apexcharts-legend-group").forEach(t=>{this.setStyleDefaults(t,{display:"flex"})}),this.queryStyleable(t,".apexcharts-legend-group-vertical").forEach(t=>{this.setStyleDefaults(t,{"flex-direction":"column-reverse"})}),this.queryStyleable(t,".apexcharts-legend-series").forEach(t=>{this.setStyleDefaults(t,{cursor:t.classList.contains("apexcharts-no-click")?"auto":"pointer","line-height":"normal",display:"flex","align-items":"center"})}),this.queryStyleable(t,".apexcharts-legend-text").forEach(t=>{this.setStyleDefaults(t,{position:"relative","font-size":"14px"})}),this.queryStyleable(t,".apexcharts-legend-marker").forEach(t=>{this.setStyleDefaults(t,{position:"relative",display:"flex","align-items":"center","justify-content":"center",cursor:"pointer","margin-right":"1px"})}),this.queryStyleable(t,".apexcharts-inactive-legend").forEach(t=>{this.setStyleDefaults(t,{opacity:"0.45"})}),this.queryStyleable(t,".apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series").forEach(t=>{t.style.setProperty("display","none","important")}))}resolveExportBackground(){const t=this.w,e=t.config.chart.background;return e&&"transparent"!==e?e:"dark"===t.config.theme.mode?"#343A3F":"#fff"}collectFontFamilies(){const t=new Set,e=this.w;if(!Nt.isBrowser()||!e.dom.elWrap)return t;const i=this.queryStyleable(e.dom.elWrap,"text, tspan, .apexcharts-legend-text, .apexcharts-title-text, .apexcharts-subtitle-text");return[e.dom.elWrap,...i].forEach(e=>{const i=ft.getComputedStyle(e),s=i&&i.fontFamily;s&&s.split(",").forEach(e=>{const i=e.trim().replace(/^['"]|['"]$/g,"");i&&t.add(i.toLowerCase())})}),t}collectFontFaceRules(){if(!Nt.isBrowser())return Promise.resolve([]);const t=[],e=[],i=(e,i)=>{(e.match(/@font-face\s*\{[^}]*\}/gi)||[]).forEach(e=>{const s=e.match(/font-family\s*:\s*([^;}]+)/i);if(!s)return;const a=s[1].trim().replace(/^['"]|['"]$/g,"");t.push({family:a.toLowerCase(),css:e,base:i})})},s=(t,e)=>{Array.from(t).forEach(t=>{5===t.type?t.cssText&&i(t.cssText,e):t.styleSheet?a(t.styleSheet):t.cssRules&&s(t.cssRules,e)})},a=t=>{let a=null;try{a=t.cssRules}catch(t){}a?s(a,t.href||document.baseURI):t.href&&e.push(ie(t.href,t=>fetch(t).then(t=>t.ok?t.text():Promise.reject())).then(e=>i(e,t.href)).catch(()=>{}))},r=this.w.dom.elWrap;return(r?function(t){const e=[];let i=t;for(;i;){const t=te(i);e.unshift(t),i=11===t.nodeType?t.host:null}const s=[];for(const t of e){for(const e of Array.from(t.styleSheets||[]))s.push(e);const e=t.adoptedStyleSheets;if(e)for(const t of e)s.push(t)}return s}(r):Array.from(document.styleSheets||[])).forEach(a),Promise.all(e).then(()=>t)}embedFonts(t){const e=this.w;if(!Nt.isBrowser()||!e.config.chart.toolbar.export.embedFonts||"function"!=typeof fetch)return Promise.resolve();const i=this.collectFontFamilies();return i.size?this.collectFontFaceRules().then(t=>{const e=t.filter(t=>i.has(t.family));return e.length?Promise.all(e.map(t=>this.inlineFontFaceUrls(t.css,t.base).catch(()=>null))):Promise.resolve([])}).then(e=>{const i=(e||[]).filter(Boolean).join("\n");if(!i)return;const s=document.createElementNS(zt,"style");s.textContent=i,t.insertBefore(s,t.firstChild)}).catch(()=>{}):Promise.resolve()}inlineFontFaceUrls(t,e){const i=[],s=/url\(\s*(['"]?)([^'")]+)\1\s*\)/gi;let a;for(;null!==(a=s.exec(t));)a[2].startsWith("data:")||i.push(a[2]);return i.length?Promise.all(i.map(t=>{const i=e?new URL(t,e).href:t;return ie(i,t=>this.fetchAsDataUri(t)).catch(()=>{})})).then(e=>{let s=t;return i.forEach((t,i)=>{e[i]&&(s=s.split(t).join(e[i]))}),s===t?null:s}):Promise.resolve(t.includes("data:")?t:null)}fetchAsDataUri(t){return"function"!=typeof fetch||"function"!=typeof btoa?Promise.reject(new Error("fetch unavailable")):fetch(t).then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status} for ${t}`);const i=e.headers.get("content-type")||"application/octet-stream";return e.arrayBuffer().then(t=>{const e=new Uint8Array(t);let s="";for(let t=0;t<e.length;t+=32768)s+=String.fromCharCode.apply(null,e.subarray(t,t+32768));return`data:${i};base64,${btoa(s)}`})})}getSvgString(t){return new Promise(e=>{var i,s,a;const r=this.w;let n=t||r.config.chart.toolbar.export.scale||r.config.chart.toolbar.export.width/r.globals.svgWidth;n||(n=1);const o=r.globals.svgWidth*n,l=r.globals.svgHeight*n;null==(i=r.globals.layoutTween)||i.finish(),null==(s=r.globals.circleTween)||s.finish(),null==(a=r.globals.highlightTween)||a.finish(),[...r.globals.chromeTweens||[]].forEach(t=>t());const h=r.dom.elWrap.cloneNode(!0);this.resolveCssVars(r.dom.elWrap,h),h.style.width=o+"px",h.style.height=l+"px",this.inlineCanvasLayers(h),this.applyExportStyles(h);const c=(new XMLSerializer).serializeToString(h);let d=`\n <svg xmlns="http://www.w3.org/2000/svg"\n version="1.1"\n xmlns:xlink="http://www.w3.org/1999/xlink"\n class="apexcharts-svg"\n xmlns:data="ApexChartsNS"\n transform="translate(0, 0)"\n width="${r.globals.svgWidth}px" height="${r.globals.svgHeight}px">\n <foreignObject width="100%" height="100%">\n <div xmlns="http://www.w3.org/1999/xhtml" style="width:${o}px; height:${l}px;">\n ${c}\n </div>\n </foreignObject>\n </svg>\n `;const u=this.svgStringToNode(d);1!==n&&this.scaleSvgNode(u,n),Promise.all([this.convertImagesToBase64(u),this.embedFonts(u)]).then(()=>{d=(new XMLSerializer).serializeToString(u),e(d.replace(/ /g," "))})})}convertImagesToBase64(t){const e="http://www.w3.org/1999/xlink",i=t.getElementsByTagName("image"),s=Array.from(i).map(t=>{const i=t.getAttributeNS(e,"href"),s=t.getAttribute("href"),a=i||s;if(!a||a.startsWith("data:"))return Promise.resolve();const r=a=>{i&&t.setAttributeNS(e,"href",a),!s&&i||t.setAttribute("href",a)};return this.fetchAsDataUri(a).then(r).catch(()=>this.getBase64FromUrl(a).then(r).catch(t=>{console.error("Error converting image to base64:",t)}))});return Promise.all(s)}getBase64FromUrl(t){return Nt.isSSR()?Promise.resolve(t):new Promise((e,i)=>{const s=new Image;s.crossOrigin="Anonymous",s.onload=()=>{const t=document.createElement("canvas");t.width=s.width,t.height=s.height;const i=t.getContext("2d");i&&i.drawImage(s,0,0),e(t.toDataURL())},s.onerror=i,s.src=t})}svgUrl(){return new Promise(t=>{this.getSvgString().then(e=>{const i=new Blob([e],{type:"image/svg+xml;charset=utf-8"});t(URL.createObjectURL(i))})})}dataURI(t){return Nt.isSSR()?Promise.resolve({imgURI:""}):new Promise(e=>{const i=this.w,s=()=>{console.warn("ApexCharts: the PNG export could not be rendered"),e({imgURI:""})},a=t?t.scale||t.width/i.globals.svgWidth:1,r=document.createElement("canvas");r.width=i.globals.svgWidth*a,r.height=parseInt(i.dom.elWrap.style.height,10)*a;const n=this.resolveExportBackground(),o=r.getContext("2d");if(!o)return s();o.fillStyle=n,o.fillRect(0,0,r.width,r.height),this.getSvgString(a).then(t=>{const i="data:image/svg+xml,"+encodeURIComponent(t),a=new Image;a.crossOrigin="anonymous",a.onload=()=>{try{o.drawImage(a,0,0);const t=r;if(t.msToBlob){const i=t.msToBlob();e({blob:i})}else{const t=r.toDataURL("image/png");e({imgURI:t})}}catch(t){s()}},a.onerror=s,a.src=i}).catch(s)})}exportToSVG(){this.svgUrl().then(t=>{this.triggerDownload(t,this.w.config.chart.toolbar.export.svg.filename,".svg")})}exportToPng(){const t=this.w.config.chart.toolbar.export.scale,e=this.w.config.chart.toolbar.export.width,i=t?{scale:t}:e?{width:e}:void 0;this.dataURI(i).then(({imgURI:t,blob:e})=>{e?navigator.msSaveOrOpenBlob(e,this.w.globals.chartID+".png"):t&&this.triggerDownload(t,this.w.config.chart.toolbar.export.png.filename,".png")})}exportToCSV({series:t,fileName:e,columnDelimiter:i=",",lineDelimiter:s="\n"}){const a=this.w,r=a.globals,n=a.config.chart.toolbar.export.csv,o=!t&&(r.streamgraphRawSeries||r.waterfallRawSeries||r.dumbbellRawSeries);t||(t=o||a.config.series);const l=new Set(o&&o===r.dumbbellRawSeries?a.dumbbellData.hidden:r.collapsedSeriesIndices),h=[],c=[],d="datetime"===a.config.xaxis.type,u=a.config.xaxis.labels.datetimeUTC,p=t=>{if(null==t||Zt.isNumber(t))return t;const e=String(t);return/^[=+\-@\t\r]/.test(e)&&isNaN(+e)?`'${e}`:e},g=t=>d&&String(t).length>=10&&!isNaN(new Date(t).getTime()),f=(t,e)=>{const i=new Date(t);if(u||i.setTime(i.getTime()-6e4*i.getTimezoneOffset()),e)return i.toISOString().slice(0,23).replace("T"," ").replace(".000","");const[s,a,r,n]=i.toUTCString().split(" ");return`${s.slice(0,3)} ${r} ${a} ${n}`},m=(t,e)=>"function"==typeof n.categoryFormatter?n.categoryFormatter(t):null==t?"":g(t)?f(t,e):Zt.isNumber(t)?t:p(String(t).split(i).join("")),x=t=>"function"==typeof n.valueFormatter?n.valueFormatter(t):p(t),b=new j(this.w,{theme:this.ctx.theme,timeScale:this.ctx.timeScale}),y=t=>{let e="";if(r.axisCharts){if("category"===a.config.xaxis.type||a.config.xaxis.convertedCatToNumeric)if(r.isBarHorizontal){const i=a.formatters.yLabelFormatters[0],s=new W(this.ctx.w).getActiveConfigSeriesIndex();e=i(a.labelData.labels[t],{seriesIndex:s,dataPointIndex:t,w:a})}else e=b.getLabel(a.labelData.labels,a.labelData.timescaleLabels,0,t).text;d&&(a.config.xaxis.categories.length?e=a.config.xaxis.categories[t]:a.config.labels.length&&(e=a.config.labels[t]))}else e=a.config.labels[t];return Array.isArray(e)?e.join(" "):e},v=a.candleData,w=a.rangeData,_=a.violinData,A=t.length>1,S=t.map((t,e)=>{const s=o?"":t.type||a.config.chart.type,r="candlestick"===s?{open:v.seriesCandleO,high:v.seriesCandleH,low:v.seriesCandleL,close:v.seriesCandleC}:"boxPlot"===s?{minimum:v.seriesCandleO,q1:v.seriesCandleH,median:v.seriesCandleM,q3:v.seriesCandleL,maximum:v.seriesCandleC}:"rangeBar"===s||"rangeArea"===s?{minimum:w.seriesRangeStart,maximum:w.seriesRangeEnd}:"violin"===s?{minimum:_.seriesViolinMin,maximum:_.seriesViolinMax,observations:_.seriesViolinPoints}:null,n=String(t.name||`series-${e}`).split(i).join("")||`series-${e}`,h=r?Object.keys(r):[n];return{head:r&&A?h.map(t=>`${n} ${t}`):h,cells:i=>{var s;const a=l.has(e);if(!r){const e=a||null==(s=t.data)?void 0:s[i];return[x(e&&"object"==typeof e?Array.isArray(e)?e[1]:e.y:e)]}return Object.values(r).map(t=>{var s;const r=a||null==(s=null==t?void 0:t[e])?void 0:s[i];return x(Array.isArray(r)?r.length:r)})}}});if(r.axisCharts)if(h.push([n.headerCategory,...S.flatMap(t=>t.head)].join(i)),r.allSeriesHasEqualX||a.config.xaxis.categories.length||a.config.labels.length){const e=Math.max(0,...t.map(t=>{var e;return(null==(e=t.data)?void 0:e.length)||0}));for(let i=0;i<e;i++){let e=y(i);if(null!==e){if(!e){const s=t.map(t=>{var e;return null==(e=t.data)?void 0:e[i]}).find(t=>null!=t);e=null==s?"":Array.isArray(s)?s[0]:s.x}c.push([e,...S.flatMap(t=>t.cells(i))])}}}else{const e=new Map;t.forEach((t,i)=>{var s;const a=new Map;null==(s=null==t?void 0:t.data)||s.forEach((t,s)=>{if(!t||"object"!=typeof t)return;const r=Array.isArray(t)?t[0]:t.x,n=String(r),o=a.get(n)||0;a.set(n,o+1);const l=`${o}:${n}`;let h=e.get(l);h||(h={cat:r,values:S.map(t=>t.head.map(()=>""))},e.set(l,h)),h.values[i]=S[i].cells(s)})}),Array.from(e.values()).sort((t,e)=>{const i="string"==typeof t.cat;return i!==("string"==typeof e.cat)?i?1:-1:i?a.axisFlags.isXNumeric?t.cat<e.cat?-1:t.cat>e.cat?1:0:0:t.cat-e.cat}).forEach(({cat:t,values:e})=>c.push([t,...e.flat()]))}else h.push([n.headerCategory,n.headerValue].join(i)),t.forEach((t,e)=>{h.push([m(a.labelData.labels[e]),x(l.has(e)?"":a.seriesData.series[e])].join(i))});const C=c.map(t=>t[0]).filter(g),k=new Set(C.map(t=>+new Date(t))),P=new Set([...k].map(t=>f(t))).size<k.size;c.forEach(t=>h.push([m(t[0],P),...t.slice(1)].join(i))),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\ufeff"+h.join(s)),e||n.filename,".csv")}triggerDownload(t,e,i){if(Nt.isSSR())return;const s=document.createElement("a");s.href=t,s.download=(e||this.w.globals.chartID)+i,document.body.appendChild(s),s.click(),document.body.removeChild(s)}}c.default.registerFeatures({exports:se});let ae=class{constructor(t){this.w=t.w,this.lgCtx=t}getLegendStyles(){if(Nt.isSSR())return null;const t=document.createElement("style");t.setAttribute("type","text/css");const e=this.w.config.chart.nonce;e&&t.setAttribute("nonce",e);const i=document.createTextNode(".apexcharts-flip-y{transform:scaleY(-1) translateY(-100%);transform-origin:top;transform-box:fill-box}.apexcharts-flip-x{transform:scaleX(-1);transform-origin:center;transform-box:fill-box}.apexcharts-legend{display:flex;overflow:auto;padding:0 10px}.apexcharts-legend.apexcharts-legend-group-horizontal{flex-direction:column}.apexcharts-legend-group{display:flex}.apexcharts-legend-group-vertical{flex-direction:column-reverse}.apexcharts-legend.apx-legend-position-bottom,.apexcharts-legend.apx-legend-position-top{flex-wrap:wrap}.apexcharts-legend.apx-legend-position-right,.apexcharts-legend.apx-legend-position-left{flex-direction:column;bottom:0}.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-left,.apexcharts-legend.apx-legend-position-top.apexcharts-align-left,.apexcharts-legend.apx-legend-position-right,.apexcharts-legend.apx-legend-position-left{justify-content:flex-start;align-items:flex-start}.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-center,.apexcharts-legend.apx-legend-position-top.apexcharts-align-center{justify-content:center;align-items:center}.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-right,.apexcharts-legend.apx-legend-position-top.apexcharts-align-right{justify-content:flex-end;align-items:flex-end}.apexcharts-legend-series{cursor:pointer;line-height:normal;display:flex;align-items:center}.apexcharts-legend-text{position:relative;font-size:14px}.apexcharts-legend-text *,.apexcharts-legend-marker *{pointer-events:none}.apexcharts-legend-marker{position:relative;display:flex;align-items:center;justify-content:center;cursor:pointer;margin-right:1px}.apexcharts-legend-series.apexcharts-no-click{cursor:auto}.apexcharts-legend .apexcharts-hidden-zero-series,.apexcharts-legend .apexcharts-hidden-null-series{display:none!important}.apexcharts-inactive-legend{opacity:.45}");return t.appendChild(i),t}getLegendDimensions(){const t=this.w.dom.baseEl.querySelector(".apexcharts-legend");if(!t)return{clwh:0,clww:0};const{width:e,height:i}=t.getBoundingClientRect();return{clwh:i,clww:e}}appendToForeignObject(){var t;const e=this.getLegendStyles();!1!==this.w.config.chart.injectStyleSheet&&e&&(null==(t=this.w.dom.elLegendForeign)||t.appendChild(e))}toggleDataSeries(t,e){var i,s,a;const r=this.w;if(r.dom.baseEl)if(r.globals.axisCharts||"radialBar"===r.config.chart.type){r.globals.resized=!0;let n=null,o=null;if(r.globals.risingSeries=[],r.globals.axisCharts){if(n=null!=(i=Array.prototype.find.call(r.dom.baseEl.querySelectorAll(".apexcharts-series"),e=>e.getAttribute("data:realIndex")===String(t)))?i:null,!n)return;o=parseInt(null!=(s=n.getAttribute("data:realIndex"))?s:"",10)}else{if(n=r.dom.baseEl.querySelector(`.apexcharts-series[rel='${t+1}']`),!n)return;o=parseInt(null!=(a=n.getAttribute("rel"))?a:"",10)-1}if(e){[{cs:r.globals.collapsedSeries,csi:r.globals.collapsedSeriesIndices},{cs:r.globals.ancillaryCollapsedSeries,csi:r.globals.ancillaryCollapsedSeriesIndices}].forEach(t=>{const e=t.cs,i=t.csi;this.riseCollapsedSeries(e,i,o)})}else this.hideSeries({seriesEl:n,realIndex:o});if(r.config.chart.accessibility.enabled){const e=r.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${t+1}"]`);if(e){const i=r.globals.collapsedSeriesIndices.includes(o)||r.globals.ancillaryCollapsedSeriesIndices.includes(o);e.setAttribute("aria-pressed",i?"true":"false");const s=e.querySelector(".apexcharts-legend-text"),a=s?s.textContent:r.seriesData.seriesNames[t],n=i?"hidden":"visible";e.setAttribute("aria-label",`${a}, ${n}. Press Enter or Space to toggle.`)}}}else{if(r.globals.resized=!0,r.globals.risingSeries=[],e)this.riseCollapsedSeries(r.globals.collapsedSeries,r.globals.collapsedSeriesIndices,t);else{const e=this.getSeriesAfterCollapsing({realIndex:t});this.lgCtx.updateSeries(e,r.config.chart.animations.dynamicAnimation.enabled)}if(r.config.chart.accessibility.enabled){const e=r.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${t+1}"]`);if(e){const i=r.globals.collapsedSeriesIndices.includes(t);e.setAttribute("aria-pressed",i?"true":"false");const s=e.querySelector(".apexcharts-legend-text"),a=s?s.textContent:r.seriesData.seriesNames[t],n=i?"hidden":"visible";e.setAttribute("aria-label",`${a}, ${n}. Press Enter or Space to toggle.`)}}}}_nonAxisSliceContainer(t){const e=this.w.config.chart.type;return("pie"===e||"donut"===e||"polarArea"===e||"sunburst"===e||"icicle"===e)&&1===t.length&&t[0]&&"object"==typeof t[0]&&Array.isArray(t[0].data)?t[0].data:t}_readSliceValue(t){return"unit"===this.w.config.chart.type&&t&&Array.isArray(t.data)?t.data:t&&"object"==typeof t?t.y:t}_writeSliceValue(t,e,i){const s=t[e];"unit"===this.w.config.chart.type&&s&&Array.isArray(s.data)?s.data=Array.isArray(i)?i:[]:s&&"object"==typeof s?s.y=i:t[e]=i}getSeriesAfterCollapsing({realIndex:t}){var e,i;const s=this.w,a=s.globals,r=a.axisCharts?Zt.copySeriesShallow(s.config.series):Zt.clone(s.config.series);if(a.axisCharts){const e=s.config.yaxis[a.seriesYAxisReverseMap[t]],i={index:t,data:r[t].data.slice(),type:r[t].type||s.config.chart.type,name:(a.seriesNames||[])[t]};if(e&&e.show&&e.showAlways)a.ancillaryCollapsedSeriesIndices.indexOf(t)<0&&(a.ancillaryCollapsedSeries.push(i),a.ancillaryCollapsedSeriesIndices.push(t));else if(a.collapsedSeriesIndices.indexOf(t)<0){a.collapsedSeries.push(i),a.collapsedSeriesIndices.push(t);const e=a.risingSeries.indexOf(t);a.risingSeries.splice(e,1)}}else if(a.collapsedSeriesIndices.indexOf(t)<0){const n=this._nonAxisSliceContainer(r);a.collapsedSeries.push({index:t,data:this._readSliceValue(n[t]),type:null!=(i=null==(e=s.config.series[t])?void 0:e.type)?i:"line",name:(a.seriesNames||[])[t]}),a.collapsedSeriesIndices.push(t)}const n=a.axisCharts?s.config.series.length:this._nonAxisSliceContainer(r).length;return a.allSeriesCollapsed=a.collapsedSeries.length+a.ancillaryCollapsedSeries.length===n,this._getSeriesBasedOnCollapsedState(r)}hideSeries({seriesEl:t,realIndex:e}){const i=this.w,s=this.getSeriesAfterCollapsing({realIndex:e}),a=t.childNodes;for(let t=0;t<a.length;t++)a[t].classList.contains("apexcharts-series-markers-wrap")&&(a[t].classList.contains("apexcharts-hide")?a[t].classList.remove("apexcharts-hide"):a[t].classList.add("apexcharts-hide"));const r=i.config.chart.animations.dynamicAnimation.enabled;r&&(i.globals.collapsingSeriesIndices=[e]);const n=()=>{i.globals.collapsingSeriesIndices=[]},o=this.lgCtx.updateSeries(s,r);n(),o&&"function"==typeof o.then&&o.then(n,n)}riseCollapsedSeries(t,e,i){const s=this.w;let a=Zt.clone(s.config.series);if(t.length>0){for(let r=0;r<t.length;r++)if(t[r].index===i){if(s.globals.axisCharts)a[i].data=t[r].data.slice(),a[i].hidden=!1;else{const e=this._nonAxisSliceContainer(a);this._writeSliceValue(e,i,t[r].data)}t.splice(r,1),e.splice(r,1),s.globals.risingSeries.push(i),r--}a=this._getSeriesBasedOnCollapsedState(a);const r=this.lgCtx.updateSeries(a,s.config.chart.animations.dynamicAnimation.enabled),n=()=>{s.globals.risingSeries=[]};r&&"function"==typeof r.then?r.then(n,n):n()}}_getSeriesBasedOnCollapsedState(t){const e=this.w;let i=0;if(e.globals.axisCharts)t.forEach((s,a)=>{e.globals.collapsedSeriesIndices.indexOf(a)<0&&e.globals.ancillaryCollapsedSeriesIndices.indexOf(a)<0||(t[a].data=[],i++)});else{const s=this._nonAxisSliceContainer(t);s.forEach((t,a)=>{e.globals.collapsedSeriesIndices.indexOf(a)<0||(this._writeSliceValue(s,a,0),i++)})}const s=e.globals.axisCharts?t.length:this._nonAxisSliceContainer(t).length;return e.globals.allSeriesCollapsed=i===s,t}};const re=["#cf4d3f","#8f9499","#26a75b"],ne=(t,e,i)=>t+(e-t)*i;function oe(t){return Math.max(0,Math.min(255,Math.round(t))).toString(16).padStart(2,"0")}function le(t,e,i){const s=Zt.parseHex(he(t)),a=Zt.parseHex(he(e));return s&&a?"#"+oe(ne(s[0],a[0],i))+oe(ne(s[1],a[1],i))+oe(ne(s[2],a[2],i)):t}function he(t){if("string"!=typeof t)return"#000000";if(Zt.isColorHex(t))return t;return Zt.rgb2hex(t)||"#000000"}function ce(t,e,i){const s=t.config.series[e];return de(t,s&&Array.isArray(s.data)?s.data[i]:null,e,i)}function de(t,e,i,s){var a,r,n;if(!e||"object"!=typeof e)return null;const o=null==(n=null==(r=null==(a=t.config.plotOptions)?void 0:a.treemap)?void 0:r.colorScale)?void 0:n.colorValue;let l;if(l="function"==typeof o?o(e,{seriesIndex:i,dataPointIndex:s,w:t}):"string"==typeof o?e[o]:e.colorValue,null==l)return null;const h=Number(l);return Number.isFinite(h)?h:null}function ue(t){var e,i,s,a;const r=null==(s=null==(i=null==(e=t.config)?void 0:e.plotOptions)?void 0:i.treemap)?void 0:s.colorScale,n=r&&r.gradient;if(!n)return null;if(!1===n.enabled)return null;const o=t.config.series||[];let l=1/0,h=-1/0,c=!1;for(let e=0;e<o.length;e++){const i=o[e]&&o[e].data;if(Array.isArray(i))for(let s=0;s<i.length;s++){const a=de(t,i[s],e,s);null!=a&&(c=!0,a<l&&(l=a),a>h&&(h=a))}}if(!c&&!0!==n.enabled)return null;Number.isFinite(l)||(l=0,h=0);const d=t=>Number.isFinite(Number(t))?Number(t):null,u=d(n.min),p=d(n.max);let g=null!=u?u:l,f=null!=p?p:h,m=null;if(null===n.midpoint?m=null:Number.isFinite(Number(n.midpoint))?m=Number(n.midpoint):g<0&&f>0&&(m=0),null!=m&&!1!==n.symmetric&&null==u&&null==p){const t=Math.max(Math.abs(g-m),Math.abs(f-m));g=m-t,f=m+t}f===g&&(g-=.5,f+=.5);const x=Array.isArray(n.stops)&&n.stops.length>=2,b=function(t,e,i,s,a,r){const n=t=>he(Zt.getThemeColor(t,r));if(a)return t.stops.filter(t=>t&&Number.isFinite(Number(t.value))).map(t=>({value:Number(t.value),color:n(t.color)})).sort((t,e)=>t.value-e.value);const o=(Array.isArray(t.colors)&&t.colors.length>=2?t.colors:re).map(n),l=o.length;if(null!=s&&l>=3){const t=Math.floor((l-1)/2),a=[];for(let i=0;i<=t;i++)a.push({value:ne(e,s,i/t),color:o[i]});for(let e=t+1;e<l;e++)a.push({value:ne(s,i,(e-t)/(l-1-t)),color:o[e]});return a}return o.map((t,s)=>({value:ne(e,i,s/(l-1)),color:t}))}(n,g,f,m,x,null==(a=t.dom)?void 0:a.elWrap);if(b.length<2)return null;x&&(null==u&&(g=Math.min(g,b[0].value)),null==p&&(f=Math.max(f,b[b.length-1].value)));const y=t=>{if(!Number.isFinite(t))return b[Math.floor(b.length/2)].color;if(t<=b[0].value)return b[0].color;const e=b[b.length-1];if(t>=e.value)return e.color;for(let e=1;e<b.length;e++){const i=b[e];if(t<=i.value){const s=b[e-1],a=i.value-s.value,r=0===a?0:(t-s.value)/a;return le(s.color,i.color,r)}}return e.color},v=f-g,w=b.map(t=>{const e=Math.min(f,Math.max(g,t.value));return{percent:v&&(e-g)/v,color:e===t.value?t.color:y(e)}});return{min:g,max:f,midpoint:m,stops:b,at:y,legendStops:w}}function pe(t){const e=he(t);return Zt.getContrastRatio(e,"#ffffff")>=Zt.getContrastRatio(e,"#000000")?"#ffffff":"#000000"}const ge="http://www.w3.org/2000/svg";class fe{constructor(t,e){this.w=t,this.ctx=e,this.svgEl=null,this.arrowEl=null,this.hoverValueEl=null,this._min=0,this._max=0,this._geom=null,this._grad=null,this._bandHitEls=[],this._activeBandIndex=-1,this._targetEl=null,this.panelsW=null,this._onCellEnter=this._onCellEnter.bind(this),this._onCellLeave=this._onCellLeave.bind(this),this._onBandEnter=this._onBandEnter.bind(this),this._onBandLeave=this._onBandLeave.bind(this)}_getFormatter(){const t=this._cfg();return"function"==typeof t.formatter?t.formatter:t=>{if(!Number.isFinite(t))return String(t);const e=Math.abs(t);return e>=1e3?t.toFixed(0):e>=10?t.toFixed(1):t.toFixed(2)}}static colorScaleOf(t){var e,i,s,a,r;const n=null==(i=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:i.type;return n&&(null==(r=null==(a=null==(s=null==t?void 0:t.config)?void 0:s.plotOptions)?void 0:a[n])?void 0:r.colorScale)||null}static configFor(t){const e=fe.colorScaleOf(t);return e&&e.gradientLegend||null}_cfg(){return fe.configFor(this.w)||{}}static isEnabled(t){if(!fe.supports(t))return!1;const e=fe.configFor(t);return!(!e||!e.enabled)}static supports(t){var e,i;const s=null==(i=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:i.type;return"heatmap"===s||"treemap"===s}draw(t=null){var e,i,s,a,r,n,o,l;const h=this.w;this._targetEl=t;const c=t||h.dom.elLegendWrap;if(!c)return;const d=this._cfg(),u=h.config.legend.position,p="left"===u||"right"===u,g=null!=(i=null==(e=d.arrow)?void 0:e.size)?i:8,f=g+4,m=d.showLabels?28:4,x=d.showLabels?20:4,b=d.showLabels?44:0,y=this._resolveStripLength(p?d.height:d.width,p),v=d.thickness,w=p?Math.max(v+f+4,b):y+2*m,_=p?y+2*x:v+f+4,A=(w-(v+f))/2,S=p?"left"===u?A:A+f:m,C=p?x:"top"===u?f:4,k=ft.createElementNS(ge,"svg");k.setAttribute("class","apexcharts-heatmap-gradient-legend apexcharts-gradient-legend"),k.setAttribute("width",String(w)),k.setAttribute("height",String(_)),k.setAttribute("overflow","visible");const P=ft.createElementNS(ge,"defs"),L=`apexcharts-heatmap-gradient-${h.globals.cuid}`,M=ft.createElementNS(ge,"linearGradient");M.setAttribute("id",L),p?(M.setAttribute("x1","0"),M.setAttribute("y1","1"),M.setAttribute("x2","0"),M.setAttribute("y2","0")):(M.setAttribute("x1","0"),M.setAttribute("y1","0"),M.setAttribute("x2","1"),M.setAttribute("y2","0")),this._grad=M;const{min:I,max:E,bands:F}=this._paintStops();P.appendChild(M),k.appendChild(P);const D=ft.createElementNS(ge,"rect");if(D.setAttribute("x",String(S)),D.setAttribute("y",String(C)),D.setAttribute("width",String(p?v:y)),D.setAttribute("height",String(p?y:v)),D.setAttribute("rx","2"),D.setAttribute("fill",`url(#${L})`),k.appendChild(D),d.showLabels){const t=(null==(s=d.labelStyle)?void 0:s.colors)||(Array.isArray(h.config.legend.labels.colors)?h.config.legend.labels.colors[0]:h.config.legend.labels.colors)||h.config.chart.foreColor,e=(null==(a=d.labelStyle)?void 0:a.fontSize)||"11px",i=(null==(r=d.labelStyle)?void 0:r.fontFamily)||h.config.chart.fontFamily,n=this._getFormatter(),o=(s,a,r,n)=>{const o=ft.createElementNS(ge,"text");return o.setAttribute("x",String(a)),o.setAttribute("y",String(r)),o.setAttribute("text-anchor",n),o.setAttribute("dominant-baseline","middle"),o.setAttribute("fill",t),o.setAttribute("font-size",e),i&&o.setAttribute("font-family",i),o.textContent=String(s),o};if(p){const t=S+v/2;k.appendChild(o(n(I),t,C+y+10,"middle")),k.appendChild(o(n(E),t,C-10,"middle"))}else{const t=C+v/2;k.appendChild(o(n(I),S-6,t,"end")),k.appendChild(o(n(E),S+y+6,t,"start"))}}const T=(null==(n=d.arrow)?void 0:n.color)||h.config.chart.foreColor,R=this._buildArrow(g,T,u);if(k.appendChild(R),this.arrowEl=R,this._bandHitEls=[],h.config.legend.onItemHover.highlightDataSeries&&F.length>0&&F.forEach(t=>{const e=ft.createElementNS(ge,"rect");if(p){const i=C+y-t.p2*y,s=C+y-t.p1*y;e.setAttribute("x",String(S)),e.setAttribute("y",String(i)),e.setAttribute("width",String(v)),e.setAttribute("height",String(Math.max(0,s-i)))}else e.setAttribute("x",String(S+t.p1*y)),e.setAttribute("y",String(C)),e.setAttribute("width",String(Math.max(0,(t.p2-t.p1)*y))),e.setAttribute("height",String(v));e.setAttribute("fill","transparent"),e.setAttribute("class","apexcharts-heatmap-gradient-band"),e.setAttribute("data:range-index",String(t.index)),e.style.cursor="pointer",k.appendChild(e),this._bandHitEls.push(e)}),this._geom={isVertical:p,position:u,stripX:S,stripY:C,stripLength:y,stripThickness:v,arrowSize:g,svgWidth:w,svgHeight:_},d.showHoverValue){const t=ft.createElement("div");t.classList.add("apexcharts-heatmap-gradient-legend-value"),t.style.position="absolute",t.style.fontSize=(null==(o=d.labelStyle)?void 0:o.fontSize)||"11px",t.style.fontFamily=(null==(l=d.labelStyle)?void 0:l.fontFamily)||h.config.chart.fontFamily||"",t.style.color=h.config.chart.foreColor,t.style.background="rgba(0,0,0,0.65)",t.style.color="#fff",t.style.padding="2px 6px",t.style.borderRadius="3px",t.style.pointerEvents="none",t.style.whiteSpace="nowrap",t.style.opacity="0",t.style.transition="opacity 120ms ease",this.hoverValueEl=t}c.classList.add("apexcharts-heatmap-gradient-legend-wrap"),c.classList.add("apx-legend-position-"+u),c.appendChild(k),this.hoverValueEl&&c.appendChild(this.hoverValueEl),this.svgEl=k,t?(c.style.width=w+"px",c.style.height=_+"px",c.style.position="relative",c.style.overflow="visible"):this._applyWrapAlignment(c,u,p,w,_),this._attachHoverListeners(),this._attachBandHoverListeners()}_resolveStripLength(t,e){const i=this.w,s=e?i.globals.svgHeight||i.config.chart.height||300:i.globals.svgWidth||i.config.chart.width||600;if("string"==typeof t){const e=t.trim();if(e.endsWith("%")){const t=parseFloat(e)||0;return Math.max(20,s*t/100)}const i=parseFloat(e);return Number.isFinite(i)?i:200}return"number"==typeof t&&Number.isFinite(t)?t:200}_applyWrapAlignment(t,e,i,s,a){const r=this.w,n=this._cfg().align||"center",o=12,l=r.globals.svgWidth||r.config.chart.width||600,h=r.globals.svgHeight||r.config.chart.height||300,c=r.config.legend.offsetX||0,d=r.config.legend.offsetY||0;if(t.style.position="absolute",t.style.display="block",t.style.overflow="visible",t.style.padding="0",t.style.width=s+"px",t.style.height=a+"px",t.style.right="auto",t.style.bottom="auto",i){const i=h-a-24;let r;r="start"===n?o:"end"===n?o+Math.max(0,i):o+Math.max(0,i)/2,t.style.top=r+d+"px",t.style.left="left"===e?o+c+"px":l-s-o+c+"px"}else{const i=l-s-24;let r;r="start"===n?o:"end"===n?o+Math.max(0,i):o+Math.max(0,i)/2,t.style.left=r+c+"px",t.style.top="top"===e?o+d+"px":h-a-o+d+"px"}}repositionToPlot(){var t,e;if(this._grad&&this._paintStops(),!Nt.isBrowser())return;if(this._targetEl)return;const i=this.w,s=i.globals,a=i.dom.elLegendWrap;if(!a||!this._geom)return;if(!Number.isFinite(s.gridWidth)||!Number.isFinite(s.gridHeight))return;const{isVertical:r,position:n,svgWidth:o,svgHeight:l,stripX:h,stripY:c,stripThickness:d}=this._geom,u=this._cfg().align||"center",p=i.config.legend.offsetX||0,g=i.config.legend.offsetY||0,f=null==(e=null==(t=this.ctx)?void 0:t.dimensions)?void 0:e.dimHelpers,m=f?f.getTitleSubtitleCoords("title").height+f.getTitleSubtitleCoords("subtitle").height:0,x=i.layout.xAxisHeight||0,b=(t,e)=>{const i=Math.max(0,t-e);return"start"===u?0:"end"===u?i:i/2};if(r){a.style.top=s.translateY+b(s.gridHeight,l)+g+"px";const t=(("left"===n?0:s.translateX+s.gridWidth)+("left"===n?s.translateX:s.svgWidth))/2;a.style.left=t-h-d/2+p+"px"}else{a.style.left=s.translateX+b(s.gridWidth,o)+p+"px";const t=(("top"===n?m:s.translateY+s.gridHeight+x)+("top"===n?s.translateY:s.svgHeight))/2;a.style.top=t-c-d/2+g+"px"}ft.requestAnimationFrame(()=>this._enforceMinPlotGap())}_enforceMinPlotGap(){const t=this.w,e=t.dom.elLegendWrap,i=this.svgEl&&this.svgEl.querySelector("rect");if(!e||!i||!this._geom)return;if(!t.dom.baseEl||!t.dom.baseEl.querySelector(".apexcharts-svg"))return;const s=i.getBoundingClientRect(),a=gt.plotRect(t);if(!(s.width&&s.height&&a.width&&a.height))return;const r=a.left,n=a.left+a.width,o=a.top,l=a.top+a.height,h=a.zoom,{isVertical:c,position:d}=this._geom;if(c){const t=("left"===d?r-s.right:s.left-n)/h;if(t<16){const i=parseFloat(e.style.left)||0,s=16-t;e.style.left=i+("left"===d?-s:s)+"px"}}else{const t=("top"===d?o-s.bottom:s.top-l)/h;if(t<16){const i=parseFloat(e.style.top)||0,s=16-t;e.style.top=i+("top"===d?-s:s)+"px"}}}destroy(){var t,e,i,s,a,r,n;for(let i=0;i<this._bandHitEls.length;i++){const s=this._bandHitEls[i];null==(t=s.removeEventListener)||t.call(s,"mousemove",this._onBandEnter),null==(e=s.removeEventListener)||e.call(s,"mouseout",this._onBandLeave)}if(this._bandHitEls=[],this._activeBandIndex=-1,null==(i=this.ctx)?void 0:i.events)try{null==(a=(s=this.ctx.events).removeEventListener)||a.call(s,"dataPointMouseEnter",this._onCellEnter),null==(n=(r=this.ctx.events).removeEventListener)||n.call(r,"dataPointMouseLeave",this._onCellLeave)}catch(t){}}_attachBandHoverListeners(){if(Nt.isBrowser())for(let t=0;t<this._bandHitEls.length;t++){const e=this._bandHitEls[t];e.addEventListener("mousemove",this._onBandEnter),e.addEventListener("mouseout",this._onBandLeave)}}_onBandEnter(t){var e,i,s,a;const r=this.w,n=t.currentTarget,o=parseInt(null!=(e=n.getAttribute("data:range-index"))?e:"-1",10);o<0||o===this._activeBandIndex||(this._activeBandIndex=o,null==(a=null==(s=null==(i=this.ctx)?void 0:i.events)?void 0:s.fireEvent)||a.call(s,"legendHover",[this.ctx,o,r]),this._highlightRange(o,"highlight"))}_onBandLeave(){if(this._activeBandIndex<0)return;const t=this._activeBandIndex;this._activeBandIndex=-1,this._highlightRange(t,"reset")}_highlightRange(t,e){var i;((null==(i=this.panelsW)?void 0:i.call(this))||[this.w]).forEach(i=>new W(i).highlightRangeInSeries(t,e))}_attachHoverListeners(){var t,e;Nt.isBrowser()&&(null==(e=null==(t=this.ctx)?void 0:t.events)?void 0:e.addEventListener)&&(this.ctx.events.addEventListener("dataPointMouseEnter",this._onCellEnter),this.ctx.events.addEventListener("dataPointMouseLeave",this._onCellLeave))}_onCellEnter(...t){var e,i,s;if(!this.arrowEl)return;const a=t[t.length-1];if(!a||"object"!=typeof a)return;const r=a.w||this.w,n=a.seriesIndex,o=a.dataPointIndex;if("number"!=typeof n||"number"!=typeof o)return;if(!fe.supports(r))return;let l;l=this._continuous?ce(r,n,o):null==(s=null==(i=null==(e=r.seriesData)?void 0:e.series)?void 0:i[n])?void 0:s[o],null==l||Number.isNaN(l)||this._positionArrow(l)}_onCellLeave(){this.arrowEl&&(this.arrowEl.setAttribute("opacity","0"),this.hoverValueEl&&(this.hoverValueEl.style.opacity="0"))}_positionArrow(t){if(!this.arrowEl||!this._geom)return;const{isVertical:e,position:i,stripX:s,stripY:a,stripLength:r,stripThickness:n,arrowSize:o}=this._geom,l=this._min,h=this._max-l;let c;if(c=0===h?.5:(t-l)/h,c<0&&(c=0),c>1&&(c=1),e){const t=a+r-c*r;let e,l;"left"===i?(e=s+n,l=e+o):(e=s,l=e-o);const h=[`${e},${t}`,`${l},${t-o/2}`,`${l},${t+o/2}`].join(" ");this.arrowEl.setAttribute("points",h)}else{const t=s+c*r;let e,l;"top"===i?(e=a+n,l=e+o):(e=a,l=e-o);const h=[`${t},${e}`,`${t-o/2},${l}`,`${t+o/2},${l}`].join(" ");this.arrowEl.setAttribute("points",h)}if(this.arrowEl.setAttribute("opacity","1"),this.hoverValueEl){const l=this._getFormatter();if(this.hoverValueEl.textContent=l(t),e){const t=a+r-c*r;"left"===i?this.hoverValueEl.style.left=`${s+n+o+8}px`:(this.hoverValueEl.style.left=s-o-8+"px",this.hoverValueEl.style.transform="translateX(-100%)"),this.hoverValueEl.style.top=t-9+"px"}else{const t=s+c*r;this.hoverValueEl.style.left=`${t}px`,this.hoverValueEl.style.transform="translateX(-50%)",this.hoverValueEl.style.top="top"===i?`${a+n+o+8}px`:a-o-18+"px"}this.hoverValueEl.style.opacity="1"}}_buildArrow(t,e,i){const s=ft.createElementNS(ge,"polygon");return s.setAttribute("fill",e),s.setAttribute("opacity","0"),s.setAttribute("class","apexcharts-heatmap-gradient-arrow"),s.setAttribute("points","0,0 0,0 0,0"),s.setAttribute("pointer-events","none"),s}_paintStops(){const t=this._computeStops(),e=this._grad;return this._min=t.min,this._max=t.max,e.innerHTML="",t.stops.forEach(t=>{const i=ft.createElementNS(ge,"stop");i.setAttribute("offset",`${(100*t.percent).toFixed(2)}%`),i.setAttribute("stop-color",t.color),e.appendChild(i)}),t}_computeStops(){var t,e;const i=this.w,s=fe.colorScaleOf(i)||{},a=this._cfg(),r=ue(i);if(r)return this._continuous=!0,{min:r.min,max:r.max,stops:r.legendStops,bands:[]};this._continuous=!1;let n=1/0,h=-1/0;const c=(null==(t=i.seriesData)?void 0:t.series)||[];for(let t=0;t<c.length;t++){const e=c[t];if(e)for(let t=0;t<e.length;t++){const i=e[t];null==i||Number.isNaN(i)||(i<n&&(n=i),i>h&&(h=i))}}Number.isFinite(n)||(n=0),Number.isFinite(h)||(h=0);let d=n,u=h;const p=void 0!==s.min&&void 0!==s.max&&s.max>s.min;p?(d=s.min,u=s.max):(void 0!==s.min&&(d=s.min<n?s.min:n),void 0!==s.max&&(u=s.max>h?s.max:h));const g=[],f=[];if(s.ranges&&s.ranges.length>0){const t=s.ranges.map((t,e)=>l(o({},t),{_originalIndex:e})).sort((t,e)=>t.from-e.from),e=t[0].from,i=t[t.length-1].to;d=e,u=i;const a=i-e||1;t.forEach(t=>{const i=(t.from-e)/a,s=(t.to-e)/a;g.push({percent:(i+s)/2,color:t.color}),f.push({index:t._originalIndex,p1:i,p2:s})})}else{const t=i.globals.colors[0]||"#008FFB",r=new Zt,n=i.config.chart.type,o=i.config.plotOptions[n]||{},l=null!=(e=o.shadeIntensity)?e:.5,h=i.globals,c=h.hasNegs,f="heatmap"===n&&!o.distributed&&!p&&h.maxY>=h.minY,m=f?h.maxY:u,x=Math.abs(m)+Math.abs(f?s.min<h.minY?s.min:h.minY:d),b=1.25*l,y=Math.max(2,a.stops||16);for(let e=0;e<y;e++){const s=e/(y-1),a=0===x?0:Math.min(d+s*(u-d),m)/x,h=Math.max(-1,Math.min(1,c?o.reverseNegativeShade?(a<0?a:1-a)*b:a<=0?1-(1+a)*l:(1-a)*l:(1-a)*("treemap"===n?b:1))),p=o.enableShades?r.shadeColor("dark"===i.config.theme.mode?-h:h,t):t;g.push({percent:s,color:p})}}return{min:d,max:u,stops:g,bands:f}}}function me(t){return t.classList.contains("apexcharts-legend-series")||t.classList.contains("apexcharts-legend-text")||t.classList.contains("apexcharts-legend-marker")}c.default.registerFeatures({legend:class{constructor(t,e){this.w=t,this.ctx=e,this.updateSeries=(...t)=>e.updateHelpers._updateSeries(...t),this.onLegendClick=this.onLegendClick.bind(this),this.onLegendHovered=this.onLegendHovered.bind(this),this.onLegendClickEvent=this.onLegendClickEvent.bind(this),this.onLegendPointerDown=this.onLegendPointerDown.bind(this),this.onLegendPointerUp=this.onLegendPointerUp.bind(this),this.legendPress=null,this.recoveredRel=null,this.isBarsDistributed="bar"===this.w.config.chart.type&&this.w.config.plotOptions.bar.distributed&&1===this.w.config.series.length,this.legendHelpers=new ae(this)}init(){var t;const e=this.w,i=e.globals,s=e.config;null==(t=this.heatmapGradientLegend)||t.destroy(),this.heatmapGradientLegend=null,this.isBarsDistributed="bar"===s.chart.type&&s.plotOptions.bar.distributed&&1===s.series.length;const a=s.legend.showForSingleSeries&&1===this.w.seriesData.series.length||this.isBarsDistributed||"heatmap"===s.chart.type||fe.isEnabled(e)||this.w.seriesData.series.length>1;if(this.legendHelpers.appendToForeignObject(),(a||!i.axisCharts)&&s.legend.show){const t=e.dom.elLegendWrap;for(;t.firstChild;)t.removeChild(t.firstChild);fe.isEnabled(e)?(this.heatmapGradientLegend=new fe(e,this.ctx),this.heatmapGradientLegend.draw()):(this.drawLegends(),"bottom"===s.legend.position||"top"===s.legend.position?this.legendAlignHorizontal():"right"!==s.legend.position&&"left"!==s.legend.position||this.legendAlignVertical())}}createLegendMarker({i:t,fillcolor:e}){const i=this.w,s=ft.createElement("span");s.classList.add("apexcharts-legend-marker");const a=i.config.legend.markers.shape||i.config.markers.shape;let r=a;Array.isArray(a)&&(r=a[t]);const n=Array.isArray(i.config.legend.markers.size)?parseFloat(i.config.legend.markers.size[t]):parseFloat(i.config.legend.markers.size),h=Array.isArray(i.config.legend.markers.offsetX)?parseFloat(i.config.legend.markers.offsetX[t]):parseFloat(i.config.legend.markers.offsetX),c=Array.isArray(i.config.legend.markers.offsetY)?parseFloat(i.config.legend.markers.offsetY[t]):parseFloat(i.config.legend.markers.offsetY),d=Array.isArray(i.config.legend.markers.strokeWidth)?parseFloat(i.config.legend.markers.strokeWidth[t]):parseFloat(i.config.legend.markers.strokeWidth),u=s.style;if(u.height=2*(n+d)+"px",u.width=2*(n+d)+"px",u.left=h+"px",u.top=c+"px",i.config.legend.markers.customHTML)u.background="transparent",u.color=e[t],Array.isArray(i.config.legend.markers.customHTML)?i.config.legend.markers.customHTML[t]&&(s.innerHTML=i.config.legend.markers.customHTML[t]()):s.innerHTML=i.config.legend.markers.customHTML();else{const i=new z(this.ctx.w,this.ctx).getMarkerConfig({cssClass:`apexcharts-legend-marker apexcharts-marker apexcharts-marker-${r}`,seriesIndex:t,strokeWidth:d,size:n}),a=(Nt.isBrowser()?window.SVG:global.SVG)().addTo(s).size("100%","100%"),h=new R(this.w).drawMarker(0,0,l(o({},i),{pointFillColor:Array.isArray(e)?e[t]:i.pointFillColor,shape:r}));h.node.style.transform="triangle"===r?"translate(50%, 45%)":"translate(50%, 50%)",a.add(h)}return s}drawLegends(){var t;const e=this,i=this.w,s=i.dom.elLegendWrap,a=i.config.legend.fontFamily;let r=i.seriesData.seriesNames,n=i.config.legend.markers.fillColors?i.config.legend.markers.fillColors.slice():i.globals.colors.slice();if("heatmap"===i.config.chart.type){const t=i.config.plotOptions.heatmap.colorScale.ranges;r=t.map(t=>t.name?t.name:t.from+" - "+t.to),n=t.map(t=>t.color)}else this.isBarsDistributed&&(r=i.labelData.labels.slice());i.config.legend.customLegendItems.length&&(r=i.config.legend.customLegendItems);const o=i.formatters.legendFormatter,l=i.config.legend.inverseOrder,h=[];i.labelData.seriesGroups.length>1&&i.config.legend.clusterGroupedSeries&&i.labelData.seriesGroups.forEach((t,e)=>{h[e]=ft.createElement("div"),h[e].classList.add("apexcharts-legend-group",`apexcharts-legend-group-${e}`),"horizontal"===i.config.legend.clusterGroupedSeriesOrientation?s.classList.add("apexcharts-legend-group-horizontal"):h[e].classList.add("apexcharts-legend-group-vertical")});for(let e=l?r.length-1:0;l?e>=0:e<=r.length-1;l?e--:e++){const l=o(r[e],{seriesIndex:e,w:i});let c=!1,d=!1;if(i.globals.collapsedSeries.length>0)for(let t=0;t<i.globals.collapsedSeries.length;t++)i.globals.collapsedSeries[t].index===e&&(c=!0);if(i.globals.ancillaryCollapsedSeriesIndices.length>0)for(let t=0;t<i.globals.ancillaryCollapsedSeriesIndices.length;t++)i.globals.ancillaryCollapsedSeriesIndices[t]===e&&(d=!0);const u=this.createLegendMarker({i:e,fillcolor:n});R.setAttrs(u,{rel:e+1,"data:collapsed":c||d}),(c||d)&&u.classList.add("apexcharts-inactive-legend");const p=ft.createElement("div");if(i.config.chart.accessibility.enabled&&i.config.chart.accessibility.keyboard.enabled){p.setAttribute("role","button"),p.setAttribute("tabindex","0");const t=Array.isArray(l)?l.join(" "):l,e=c||d,i=e?"hidden":"visible";p.setAttribute("aria-label",`${t}, ${i}. Press Enter or Space to toggle.`),p.setAttribute("aria-pressed",e?"true":"false")}const g=ft.createElement("span");g.classList.add("apexcharts-legend-text");const f=Array.isArray(l)?l.join(" "):l,m=r[e];String(f)===String(Array.isArray(m)?m.join(" "):m)?g.textContent=f:(g.innerHTML=f,g.setAttribute("data:html","1"));let x=i.config.legend.labels.useSeriesColors?i.globals.colors[e]:Array.isArray(i.config.legend.labels.colors)?null==(t=i.config.legend.labels.colors)?void 0:t[e]:i.config.legend.labels.colors;x||(x=i.config.chart.foreColor),g.style.color=x,g.style.fontSize=i.config.legend.fontSize,g.style.fontWeight=i.config.legend.fontWeight,g.style.fontFamily=a||i.config.chart.fontFamily,R.setAttrs(g,{rel:e+1,i:e,"data:default-text":encodeURIComponent(l),"data:collapsed":c||d}),p.appendChild(u),p.appendChild(g);const b=new P(this.w);if(!i.config.legend.showForZeroSeries){0===b.getSeriesTotalByIndex(e)&&b.seriesHaveSameValues(e)&&!b.isSeriesNull(e)&&-1===i.globals.collapsedSeriesIndices.indexOf(e)&&-1===i.globals.ancillaryCollapsedSeriesIndices.indexOf(e)&&p.classList.add("apexcharts-hidden-zero-series")}i.config.legend.showForNullSeries||b.isSeriesNull(e)&&-1===i.globals.collapsedSeriesIndices.indexOf(e)&&-1===i.globals.ancillaryCollapsedSeriesIndices.indexOf(e)&&p.classList.add("apexcharts-hidden-null-series");const y=h[i.labelData.seriesGroupIndex[e]];y&&!y.parentNode&&s.appendChild(y),(y||s).appendChild(p),s.classList.add(`apexcharts-align-${i.config.legend.horizontalAlign}`),s.classList.add("apx-legend-position-"+i.config.legend.position),p.classList.add("apexcharts-legend-series"),p.style.margin=`${i.config.legend.itemMargin.vertical}px ${i.config.legend.itemMargin.horizontal}px`,s.style.width=i.config.legend.width?i.config.legend.width+"px":"",s.style.height=i.config.legend.height?i.config.legend.height+"px":"",R.setAttrs(p,{rel:e+1,seriesName:Zt.escapeString(r[e]),"data:collapsed":c||d}),(c||d)&&p.classList.add("apexcharts-inactive-legend"),i.config.legend.onItemClick.toggleDataSeries||p.classList.add("apexcharts-no-click")}i.dom.elWrap.addEventListener("click",e.onLegendClickEvent,!0),i.dom.elWrap.addEventListener("pointerdown",e.onLegendPointerDown,!0),i.dom.elWrap.addEventListener("pointerup",e.onLegendPointerUp,!0),i.config.legend.onItemHover.highlightDataSeries&&0===i.config.legend.customLegendItems.length&&(i.dom.elWrap.addEventListener("mousemove",e.onLegendHovered,!0),i.dom.elWrap.addEventListener("mouseout",e.onLegendHovered,!0)),i.config.chart.accessibility.enabled&&i.config.chart.accessibility.keyboard.enabled&&i.dom.elWrap.addEventListener("keydown",e.onLegendKeyDown.bind(e),!0)}setLegendWrapXY(t,e){const i=this.w,s=i.dom.elLegendWrap,a=s.clientHeight;let r=0,n=0;if("bottom"===i.config.legend.position)n=i.globals.svgHeight-Math.min(a,i.globals.svgHeight/2)-5;else if("top"===i.config.legend.position){const t=new Z(this.w,this.ctx),e=t.dimHelpers.getTitleSubtitleCoords("title").height,i=t.dimHelpers.getTitleSubtitleCoords("subtitle").height;n=(e>0?e-10:0)+(i>0?i-10:0)}s.style.position="absolute",r=r+t+i.config.legend.offsetX,n=n+e+i.config.legend.offsetY,s.style.left=r+"px",s.style.top=n+"px","right"===i.config.legend.position&&(s.style.left="auto",s.style.right=25+i.config.legend.offsetX+"px");["width","height"].forEach(t=>{s&&s.style[t]&&(s.style[t]=parseInt(String(i.config.legend[t]),10)+"px")})}legendAlignHorizontal(){const t=this.w;t.dom.elLegendWrap.style.right="0";const e=new Z(this.w,this.ctx),i=e.dimHelpers.getTitleSubtitleCoords("title"),s=e.dimHelpers.getTitleSubtitleCoords("subtitle");let a=0;"top"===t.config.legend.position&&(a=i.height+s.height+t.config.title.margin+t.config.subtitle.margin-10),this.setLegendWrapXY(20,a)}legendAlignVertical(){this.setLegendWrapXY("left"===this.w.config.legend.position?20:0,20)}onLegendHovered(t){const e=this.w,i=t.target;if(!me(i))return;const s=i.getAttribute("rel"),a="mousemove"===t.type,r=t.relatedTarget,n=e.globals.cachedSelectors;if(a?n.legendRel===s:r&&me(r)&&r.getAttribute("rel")===s&&e.dom.elWrap.contains(r))return;n.legendRel=a?s:null;const o=new W(this.ctx.w);if("heatmap"===e.config.chart.type||this.isBarsDistributed){const t=parseInt(null!=s?s:"0",10)-1;a&&this.ctx.events.fireEvent("legendHover",[this.ctx,t,this.w]),o.highlightRangeInSeries(t,a?"highlight":"reset")}else i.closest(".apexcharts-inactive-legend")||o.toggleSeriesOnHover(t,i)}onLegendKeyDown(t){const e=this,i=this.w,s=t.target;if(me(s)&&("Enter"===t.key||" "===t.key)){t.preventDefault();const a=s.getAttribute("rel");e.onLegendClick(t),null!==a&&i.config.legend.onItemClick.toggleDataSeries&&requestAnimationFrame(()=>{var t;const e=null==(t=i.dom.baseEl)?void 0:t.querySelector(`.apexcharts-legend-series[rel="${a}"]`);e&&e.focus()})}}onLegendPointerDown(t){const e=t.target;this.recoveredRel=null,this.legendPress=0===t.button&&me(e)?{el:e,rel:e.getAttribute("rel")}:null}onLegendPointerUp(t){const e=this.legendPress;this.legendPress=null;const i=t.target;e&&!e.el.isConnected&&me(i)&&i.getAttribute("rel")===e.rel&&(this.recoveredRel=e.rel,this.onLegendClick(t))}onLegendClickEvent(t){const e=this.recoveredRel;this.recoveredRel=null;const i=t.target;null!==e&&t.isTrusted&&i.getAttribute("rel")===e||this.onLegendClick(t)}onLegendClick(t){var e;const i=this.w,s=t.target;if(!i.config.legend.customLegendItems.length&&me(s)){const t=parseInt(null!=(e=s.getAttribute("rel"))?e:"0",10)-1,a="true"===s.getAttribute("data:collapsed"),r=this.w.config.chart.events.legendClick;"function"==typeof r&&r(this.ctx,t,this.w),this.ctx.events.fireEvent("legendClick",[this.ctx,t,this.w]);const n=this.w.config.legend.markers.onClick;"function"==typeof n&&s.classList.contains("apexcharts-legend-marker")&&(n(this.ctx,t,this.w),this.ctx.events.fireEvent("legendMarkerClick",[this.ctx,t,this.w]));"treemap"!==i.config.chart.type&&"heatmap"!==i.config.chart.type&&!this.isBarsDistributed&&i.config.legend.onItemClick.toggleDataSeries&&this.legendHelpers.toggleDataSeries(t,a)}}}});class xe{constructor(t,e){this.w=t,this.ctx=e,this.ev=this.w.config.chart.events,this.selectedClass="apexcharts-selected",this.localeValues=this.w.globals.locale.toolbar,this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elMeasure=null,this.elZoomReset=null,this.elMenuIcon=null,this.elMenu=null,this.elMenuItems=[],this.t=null,this._drawnForZoom=null}resetControlAllowed(){const t=this.w.config.chart;if(!t.zoom||!t.zoom.enabled)return!1;const e=void 0===t.zoom.resetControl?"auto":t.zoom.resetControl;if("auto"!==e)return!!e;return!(t.toolbar&&t.toolbar.show&&t.toolbar.tools&&t.toolbar.tools.reset)}resetControlDue(){return!!this.w.interact.zoomed&&this.resetControlAllowed()}createToolbar(t={}){var e,i,s;const a=this.w,r=!!t.resetOnly,n=()=>ft.createElementNS("http://www.w3.org/1999/xhtml","div"),h=()=>{const t=ft.createElementNS("http://www.w3.org/1999/xhtml","button");return t.setAttribute("type","button"),t},c=n();if(c.setAttribute("class","apexcharts-toolbar"),c.style.top=a.config.chart.toolbar.offsetY+"px",c.style.right=3-a.config.chart.toolbar.offsetX+"px",a.dom.elWrap.appendChild(c),this.elZoom=h(),this.elZoomIn=h(),this.elZoomOut=h(),this.elPan=h(),this.elSelection=h(),this.elMeasure=h(),this.elZoomReset=h(),this.elMenuIcon=h(),this.elMenu=n(),this.elCustomIcons=[],this.t=a.config.chart.toolbar.tools,this._drawnForZoom=null,r?(this.t={zoom:!1,zoomin:!1,zoomout:!1,selection:!1,pan:!1,measure:!1,download:!1,customIcons:[],reset:!0},this._drawnForZoom="wrap"):!this.t.reset&&this.resetControlDue()&&(this.t=l(o({},this.t),{reset:!0}),this._drawnForZoom="control"),Array.isArray(this.t.customIcons))for(let t=0;t<this.t.customIcons.length;t++)this.elCustomIcons.push(h());const d=[],u=(t,e,i)=>{const s=t.toLowerCase();this.t[s]&&a.config.chart.zoom.enabled&&d.push({el:e,icon:"string"==typeof this.t[s]?this.t[s]:i,title:this.localeValues[t],class:`apexcharts-${s}-icon`})};u("zoomIn",this.elZoomIn,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M12 5v14M5 12h14"/>\n</svg>\n'),u("zoomOut",this.elZoomOut,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M5 12h14"/>\n</svg>\n');const p=t=>{this.t[t]&&a.config.chart[t].enabled&&d.push({el:"zoom"===t?this.elZoom:this.elSelection,icon:"string"==typeof this.t[t]?this.t[t]:"zoom"===t?'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="11" cy="11" r="7"/>\n <path d="m21 21-4.3-4.3M8 11h6M11 8v6"/>\n</svg>\n':'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M5 3a2 2 0 0 0-2 2"/>\n <path d="M19 3a2 2 0 0 1 2 2"/>\n <path d="M21 19a2 2 0 0 1-2 2"/>\n <path d="M5 21a2 2 0 0 1-2-2"/>\n <path d="M9 3h1M14 3h1M9 21h1M14 21h1M3 9v1M3 14v1M21 9v1M21 14v1"/>\n</svg>\n',title:this.localeValues["zoom"===t?"selectionZoom":"selection"],class:`apexcharts-${t}-icon`})};p("zoom"),p("selection"),this.t.pan&&a.config.chart.zoom.enabled&&d.push({el:this.elPan,icon:"string"==typeof this.t.pan?this.t.pan:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M5 9 2 12l3 3"/>\n <path d="M9 5l3-3 3 3"/>\n <path d="M15 19l-3 3-3-3"/>\n <path d="M19 9l3 3-3 3"/>\n <path d="M2 12h20"/>\n <path d="M12 2v20"/>\n</svg>\n',title:this.localeValues.pan,class:"apexcharts-pan-icon"}),this.t.measure&&a.config.chart.measure&&a.config.chart.measure.enabled&&d.push({el:this.elMeasure,icon:"string"==typeof this.t.measure?this.t.measure:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.4 2.4 0 0 1 0-3.4l2.6-2.6a2.4 2.4 0 0 1 3.4 0Z"/>\n <path d="m14.5 12.5 2-2"/>\n <path d="m11.5 9.5 2-2"/>\n <path d="m8.5 6.5 2-2"/>\n <path d="m17.5 15.5 2-2"/>\n</svg>\n',title:this.localeValues.measure||"Measure",class:"apexcharts-measure-icon"}),u("reset",this.elZoomReset,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/>\n <path d="M3 3v5h5"/>\n</svg>\n'),this.t.download&&d.push({el:this.elMenuIcon,icon:"string"==typeof this.t.download?this.t.download:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4 6h16M4 12h16M4 18h16"/>\n</svg>\n',title:this.localeValues.menu,class:"apexcharts-menu-icon"});for(let t=0;t<this.elCustomIcons.length;t++)d.push({el:this.elCustomIcons[t],icon:this.t.customIcons[t].icon,title:this.t.customIcons[t].title,index:this.t.customIcons[t].index,class:"apexcharts-toolbar-custom-icon "+this.t.customIcons[t].class});d.forEach((t,e)=>{t.index&&Zt.moveIndexInArray(d,e,t.index)});for(let t=0;t<d.length;t++)R.setAttrs(d[t].el,{class:d[t].class,title:d[t].title,"aria-label":d[t].title}),d[t].el.innerHTML=d[t].icon,c.appendChild(d[t].el);this.elZoom.parentNode&&this.elZoom.setAttribute("aria-pressed",String(!!a.interact.zoomEnabled)),this.elSelection.parentNode&&this.elSelection.setAttribute("aria-pressed",String(!!a.interact.selectionEnabled)),this.elPan.parentNode&&this.elPan.setAttribute("aria-pressed",String(!!a.interact.panEnabled)),this.elMeasure.parentNode&&this.elMeasure.setAttribute("aria-pressed",String(!!a.interact.measureEnabled)),this.elMenuIcon.parentNode&&(this.elMenuIcon.setAttribute("aria-haspopup","true"),this.elMenuIcon.setAttribute("aria-expanded","false")),r||this._createHamburgerMenu(c),r?null==(e=this.elZoomReset)||e.addEventListener("click",this.handleZoomReset.bind(this)):(a.interact.zoomEnabled?this.elZoom.classList.add(this.selectedClass):a.interact.panEnabled?this.elPan.classList.add(this.selectedClass):a.interact.selectionEnabled?this.elSelection.classList.add(this.selectedClass):a.interact.measureEnabled&&this.elMeasure&&(this.elMeasure.classList.add(this.selectedClass),null==(s=null==(i=this.ctx.measure)?void 0:i.startMeasure)||s.call(i)),this.addToolbarEventListeners())}_createHamburgerMenu(t){this.elMenuItems=[],t.appendChild(this.elMenu),R.setAttrs(this.elMenu,{class:"apexcharts-menu",role:"menu"});const e=[{name:"exportSVG",title:this.localeValues.exportToSVG},{name:"exportPNG",title:this.localeValues.exportToPNG},{name:"exportCSV",title:this.localeValues.exportToCSV}];for(let t=0;t<e.length;t++)this.elMenuItems.push(ft.createElementNS("http://www.w3.org/1999/xhtml","div")),this.elMenuItems[t].innerHTML=e[t].title,R.setAttrs(this.elMenuItems[t],{class:`apexcharts-menu-item ${e[t].name}`,title:e[t].title,role:"menuitem",tabindex:"-1"}),this.elMenu.appendChild(this.elMenuItems[t])}addToolbarEventListeners(){var t,e,i,s,a,r,n,o,l;null==(t=this.elZoomReset)||t.addEventListener("click",this.handleZoomReset.bind(this)),null==(e=this.elSelection)||e.addEventListener("click",this.toggleZoomSelection.bind(this,"selection")),null==(i=this.elZoom)||i.addEventListener("click",this.toggleZoomSelection.bind(this,"zoom")),null==(s=this.elZoomIn)||s.addEventListener("click",this.handleZoomIn.bind(this)),null==(a=this.elZoomOut)||a.addEventListener("click",this.handleZoomOut.bind(this)),null==(r=this.elPan)||r.addEventListener("click",this.togglePanning.bind(this)),null==(n=this.elMeasure)||n.addEventListener("click",this.toggleMeasure.bind(this)),null==(o=this.elMenuIcon)||o.addEventListener("click",this.toggleMenu.bind(this)),this.elMenuItems.forEach(t=>{t.classList.contains("exportSVG")?t.addEventListener("click",this.handleDownload.bind(this,"svg")):t.classList.contains("exportPNG")?t.addEventListener("click",this.handleDownload.bind(this,"png")):t.classList.contains("exportCSV")&&t.addEventListener("click",this.handleDownload.bind(this,"csv"))});for(let t=0;t<this.t.customIcons.length;t++)this.elCustomIcons[t].addEventListener("click",this.t.customIcons[t].click.bind(this,this.ctx,this.ctx.w));[this.elZoomReset,this.elSelection,this.elZoom,this.elZoomIn,this.elZoomOut,this.elPan,this.elMeasure,this.elMenuIcon,...this.elCustomIcons].forEach(t=>{t.addEventListener("keydown",e=>{if("Enter"===e.key||" "===e.key){e.preventDefault();const i=t.className;t.click(),requestAnimationFrame(()=>{const t=this.w.dom.baseEl;if(!t)return;const e=i.split(" ").find(t=>t.startsWith("apexcharts-"));if(!e)return;const s=t.querySelector(`.${e}`);s&&s.focus()})}})}),null==(l=this.elMenuIcon)||l.addEventListener("keydown",t=>{var e;"ArrowDown"!==t.key&&"ArrowUp"!==t.key||(t.preventDefault(),(null==(e=this.elMenu)?void 0:e.classList.contains("apexcharts-menu-open"))||this.toggleMenu(),window.setTimeout(()=>{const e="ArrowDown"===t.key?0:this.elMenuItems.length-1;this.elMenuItems[e]&&this.elMenuItems[e].focus()},20))}),this.elMenuItems.forEach((t,e)=>{t.addEventListener("keydown",i=>{var s;if("ArrowDown"===i.key){i.preventDefault();(this.elMenuItems[e+1]||this.elMenuItems[0]).focus()}else if("ArrowUp"===i.key){i.preventDefault();(this.elMenuItems[e-1]||this.elMenuItems[this.elMenuItems.length-1]).focus()}else"Escape"===i.key||"Tab"===i.key?(this._closeMenu(),null==(s=this.elMenuIcon)||s.focus(),"Tab"===i.key||i.preventDefault()):"Enter"!==i.key&&" "!==i.key||(i.preventDefault(),t.click())})})}toggleZoomSelection(t){this.ctx.getSyncedCharts().forEach(e=>{const i=e.ctx.toolbar,s="selection"===t?"selectionEnabled":"zoomEnabled",a=!!e.w.interact[s];i.toggleOtherControls();const r="selection"===t?i.elSelection:i.elZoom;a||(e.w.interact[s]=!0,null==r||r.classList.add(i.selectedClass)),null==r||r.setAttribute("aria-pressed",String(!!e.w.interact[s]))})}toggleMeasure(){var t,e,i,s;const a=this.w,r=!a.interact.measureEnabled;this.toggleOtherControls(),r&&(a.interact.measureEnabled=!0,null==(t=this.elMeasure)||t.classList.add(this.selectedClass),null==(i=null==(e=this.ctx.measure)?void 0:e.startMeasure)||i.call(e)),null==(s=this.elMeasure)||s.setAttribute("aria-pressed",String(a.interact.measureEnabled))}getToolbarIconsReference(){const t=this.w;this.elZoom||(this.elZoom=t.dom.baseEl.querySelector(".apexcharts-zoom-icon")),this.elPan||(this.elPan=t.dom.baseEl.querySelector(".apexcharts-pan-icon")),this.elSelection||(this.elSelection=t.dom.baseEl.querySelector(".apexcharts-selection-icon")),this.elMeasure||(this.elMeasure=t.dom.baseEl.querySelector(".apexcharts-measure-icon"))}enableZoomPanFromToolbar(t){this.toggleOtherControls(),"pan"===t?this.w.interact.panEnabled=!0:this.w.interact.zoomEnabled=!0;const e="pan"===t?this.elPan:this.elZoom,i="pan"===t?this.elZoom:this.elPan;e&&e.classList.add(this.selectedClass),i&&i.classList.remove(this.selectedClass)}togglePanning(){this.ctx.getSyncedCharts().forEach(t=>{var e,i;const s=t.ctx.toolbar,a=!!t.w.interact.panEnabled;s.toggleOtherControls(),a||(t.w.interact.panEnabled=!0,null==(e=s.elPan)||e.classList.add(s.selectedClass)),null==(i=s.elPan)||i.setAttribute("aria-pressed",String(!!t.w.interact.panEnabled))})}toggleOtherControls(){var t,e,i;const s=this.w;s.interact.panEnabled=!1,s.interact.zoomEnabled=!1,s.interact.selectionEnabled=!1,s.interact.measureEnabled&&(s.interact.measureEnabled=!1,null==(e=null==(t=this.ctx.measure)?void 0:t.stopMeasure)||e.call(t),null==(i=this.elMeasure)||i.setAttribute("aria-pressed","false")),this.getToolbarIconsReference();[this.elPan,this.elSelection,this.elZoom,this.elMeasure].forEach(t=>{t&&t.classList.remove(this.selectedClass)})}_currentXRange(){const t=this.w;return t.axisFlags.isRangeBar?{minX:t.globals.minY,maxX:t.globals.maxY}:{minX:t.globals.minX,maxX:t.globals.maxX}}handleZoomIn(){const t=this.w,{minX:e,maxX:i}=this._currentXRange(),s=(e+i)/2,a=(e+s)/2,r=(i+s)/2,n=this._getNewMinXMaxX(a,r);t.interact.disableZoomIn||this.zoomUpdateOptions(n.minX,n.maxX)}handleZoomOut(){const t=this.w,{minX:e,maxX:i}=this._currentXRange();if("datetime"===t.config.xaxis.type&&new Date(e).getUTCFullYear()<1e3)return;const s=(e+i)/2,a=e-(s-e),r=i-(s-i),n=this._getNewMinXMaxX(a,r);t.interact.disableZoomOut||this.zoomUpdateOptions(n.minX,n.maxX)}_getNewMinXMaxX(t,e){const i=this.w.config.xaxis.convertedCatToNumeric;return{minX:i?Math.floor(t):t,maxX:i?Math.floor(e):e}}zoomUpdateOptions(t,e){const i=this.w;if(void 0===t&&void 0===e)return void this.handleZoomReset();if(i.config.xaxis.convertedCatToNumeric&&(t<1&&(t=1,e=i.globals.dataPoints),e-t<2))return;let s={min:t,max:e};const a=this.getBeforeZoomRange(s,void 0);a&&(s=a.xaxis);const r={xaxis:s};if(!i.globals.initialConfig)return;const n=Zt.clone(i.globals.initialConfig.yaxis);i.config.chart.group||(r.yaxis=n),this.w.interact.zoomed=!0,this.ctx.updateHelpers._updateOptions(r,!1,this.w.config.chart.animations.dynamicAnimation.enabled),this.zoomCallback(s,n)}zoomCallback(t,e){"function"==typeof this.ev.zoomed&&(this.ev.zoomed(this.ctx,{xaxis:t,yaxis:e}),this.ctx.events.fireEvent("zoomed",{xaxis:t,yaxis:e}))}getBeforeZoomRange(t,e){let i=null;return"function"==typeof this.ev.beforeZoom&&(i=this.ev.beforeZoom(this,{xaxis:t,yaxis:e})),i}toggleMenu(){window.setTimeout(()=>{var t,e,i;(null==(t=this.elMenu)?void 0:t.classList.contains("apexcharts-menu-open"))?this._closeMenu():(null==(e=this.elMenu)||e.classList.add("apexcharts-menu-open"),null==(i=this.elMenuIcon)||i.setAttribute("aria-expanded","true"),this._watchOutside())},0)}_closeMenu(){var t,e;null==(t=this.elMenu)||t.classList.remove("apexcharts-menu-open"),null==(e=this.elMenuIcon)||e.setAttribute("aria-expanded","false"),this._unwatchOutside()}_watchOutside(){var t;const e=null==(t=this.elMenu)?void 0:t.ownerDocument;e&&!this._onOutside&&(this._onOutside=t=>{var e,i;const s=function(t){const e="function"==typeof t.composedPath?t.composedPath():null;return(null==e?void 0:e.length)?e[0]:t.target}(t);(null==(e=this.elMenu)?void 0:e.contains(s))||(null==(i=this.elMenuIcon)?void 0:i.contains(s))||this._closeMenu()},this._outsideDoc=e,e.addEventListener("pointerdown",this._onOutside,!0))}_unwatchOutside(){this._onOutside&&this._outsideDoc&&(this._outsideDoc.removeEventListener("pointerdown",this._onOutside,!0),this._onOutside=null,this._outsideDoc=null)}handleDownload(t){const e=this.w,i=new se(this.w,this.ctx);switch(t){case"svg":i.exportToSVG();break;case"png":i.exportToPng();break;case"csv":i.exportToCSV({series:e.config.series,columnDelimiter:e.config.chart.toolbar.export.csv.columnDelimiter})}}clearZoomAffordance(){const t=this._drawnForZoom;if(this._drawnForZoom=null,!t||!this.elZoomReset)return;const e=this.elZoomReset.parentNode,i="wrap"===t?e:this.elZoomReset;i&&i.parentNode&&i.parentNode.removeChild(i)}handleZoomReset(){this.ctx.getSyncedCharts().forEach(t=>{var e;const i=t.w;if(!i.interact.zoomed)return;if(i.globals.lastXAxis.min=i.globals.initialConfig.xaxis.min,i.globals.lastXAxis.max=i.globals.initialConfig.xaxis.max,t.updateHelpers.revertDefaultAxisMinMax(),"function"==typeof i.config.chart.events.beforeResetZoom){const e=i.config.chart.events.beforeResetZoom(t,i);e&&t.updateHelpers.revertDefaultAxisMinMax(e)}"function"==typeof i.config.chart.events.zoomed&&t.ctx.toolbar.zoomCallback({min:i.config.xaxis.min,max:i.config.xaxis.max});const s=t.ctx.series.emptyCollapsedSeries(Zt.clone(i.globals._initialSeriesPeek));t.updateHelpers._updateSeries(s,i.config.chart.animations.dynamicAnimation.enabled),i.interact.zoomed=!1,null==(e=t.ctx.toolbar)||e.clearZoomAffordance()})}destroy(){this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elMeasure=null,this.elZoomReset=null,this.elMenuIcon=null}}class be{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)/be.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*be.xRatio(t)}static plotRect(t){var e,i,s;const a=(null==(e=t.dom.Paper)?void 0:e.node)||(null==(i=t.dom.baseEl)?void 0:i.querySelector(".apexcharts-svg")),r=(null==(s=a||t.dom.elWrap)?void 0:s.getBoundingClientRect())||{left:0,top:0,width:0},n=(a&&t.globals.svgWidth?r.width/t.globals.svgWidth:1)||1;return{left:r.left+t.layout.translateX*n,top:r.top+t.layout.translateY*n,width:t.layout.gridWidth*n,height:t.layout.gridHeight*n,zoom:n}}static screenXToPlotPx(t,e,i=be.plotRect(t)){return(e-i.left)/i.zoom}}c.default.registerFeatures({toolbar:xe,zoomPanSelection:class extends xe{constructor(t,e){super(t,e),this.w=t,this.ctx=e,this.dragged=!1,this.graphics=new R(this.w),this.eventList=["mousedown","mouseleave","mousemove","touchstart","touchmove","mouseup","touchend"],this.clientX=0,this.clientY=0,this.startX=0,this.endX=0,this.dragX=0,this.startY=0,this.endY=0,this.dragY=0,this.moveDirection="none"}init({xyRatios:t}){const e=this.w,i=this;this.xyRatios=t,this.zoomRect=this.graphics.drawRect(0,0,0,0),this.selectionRect=this.graphics.drawRect(0,0,0,0),this.constraints=new Rt(0,0,e.layout.gridWidth,e.layout.gridHeight),this.zoomRect.node.classList.add("apexcharts-zoom-rect"),this.selectionRect.node.classList.add("apexcharts-selection-rect"),e.dom.Paper.add(this.zoomRect),e.dom.Paper.add(this.selectionRect),"x"===e.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,minY:0,maxX:e.layout.gridWidth,maxY:e.layout.gridHeight}).on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")):"y"===e.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,maxX:e.layout.gridWidth}).on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")):this.slDraggableRect=this.selectionRect.draggable().on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")),this.preselectedSelection(),this.hoverArea=e.dom.baseEl.querySelector(`${e.globals.chartClass} .apexcharts-svg`),this.hoverArea&&(this.hoverArea.classList.add("apexcharts-zoomable"),this.eventList.forEach(e=>{var s;null==(s=this.hoverArea)||s.addEventListener(e,i.svgMouseEvents.bind(i,t),{capture:!1,passive:!0})}),this._wheelZoomEnabled()&&this.hoverArea.addEventListener("wheel",i.mouseWheelEvent.bind(i),{capture:!1,passive:!1}),this.hoverArea.addEventListener("keydown",i.escapeResetEvent.bind(i),{capture:!1,passive:!0}),this._momentumEnabled()&&["touchstart","touchmove","touchend","touchcancel"].forEach(t=>{var e;null==(e=this.hoverArea)||e.addEventListener(t,i.momentumTouch.bind(i),{capture:!1,passive:!1})}))}destroy(){this.slDraggableRect&&(this.slDraggableRect.draggable(!1),this.slDraggableRect.off(),this.selectionRect.off()),this.selectionRect=null,this.zoomRect=null}svgMouseEvents(t,e){const i=this.w,s=this.ctx.toolbar;if(i.interact.momentum&&i.interact.momentum.busy)return;if(this._momentumEnabled()&&e.touches&&e.touches.length>1)return;const a=i.interact.zoomEnabled?i.config.chart.zoom.type:i.config.chart.selection.type,r=i.config.chart.toolbar.autoSelected;if("measure"!==r&&(e.shiftKey?(i.interact.shiftWasPressed=!0,s.enableZoomPanFromToolbar("pan"===r?"zoom":"pan")):i.interact.shiftWasPressed&&(s.enableZoomPanFromToolbar(r),i.interact.shiftWasPressed=!1)),!e.target)return;const n=e.target.classList;let o;e.target.parentNode&&null!==e.target.parentNode&&(o=e.target.parentNode.classList);if(!(n.contains("apexcharts-legend-marker")||n.contains("apexcharts-legend-text")||o&&o.contains("apexcharts-toolbar"))){if(this.clientX="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientX:"touchend"===e.type?e.changedTouches[0].clientX:e.clientX,this.clientY="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientY:"touchend"===e.type?e.changedTouches[0].clientY:e.clientY,"mousedown"===e.type&&1===e.which||"touchstart"===e.type){if(!this._hasPlot())return;this.startX=this._screenXToPlotPx(this.clientX),this.startY=this._screenYToPlotPx(this.clientY),this.dragged=!1,this.w.interact.mousedown=!0}("mousemove"===e.type&&1===e.which||"touchmove"===e.type)&&(this.dragged=!0,i.interact.panEnabled?(i.interact.selection=null,this.w.interact.mousedown&&this.panDragging({context:this,zoomtype:a,xyRatios:this.xyRatios})):(this.w.interact.mousedown&&i.interact.zoomEnabled||this.w.interact.mousedown&&i.interact.selectionEnabled)&&(this.selection=this.selectionDrawing({context:this,zoomtype:a}))),"mouseup"!==e.type&&"touchend"!==e.type&&"mouseleave"!==e.type||this.handleMouseUp({zoomtype:a}),this.makeSelectionRectDraggable()}}handleMouseUp({zoomtype:t,isResized:e}){const i=this.w;this._hasPlot()&&(this.w.interact.mousedown||e)&&(this.endX=this._screenXToPlotPx(this.clientX),this.endY=this._screenYToPlotPx(this.clientY),this.dragX=Math.abs(this.endX-this.startX),this.dragY=Math.abs(this.endY-this.startY),(i.interact.zoomEnabled||i.interact.selectionEnabled)&&this.selectionDrawn({context:this,zoomtype:t})),i.interact.zoomEnabled&&this.hideSelectionRect(this.selectionRect),this.dragged=!1,this.w.interact.mousedown=!1}_incidentalZoomEnabled(t){var e,i,s;const a=this.w.config.chart;return!(!a.zoom||!a.zoom.enabled)&&("auto"!==t?!!t:!(!(null==(e=a.toolbar)?void 0:e.show)||!(null==(s=null==(i=a.toolbar)?void 0:i.tools)?void 0:s.reset)))}_wheelZoomEnabled(){const{zoom:t}=this.w.config.chart;return this._incidentalZoomEnabled(t&&t.allowMouseWheelZoom)}_wheelZoomGreedy(){return!0===this.w.config.chart.zoom.allowMouseWheelZoom}_showWheelHint(t){const e=this.w;if(!1===e.config.chart.zoom.wheelHint)return;if(Math.abs(t.deltaY)<=Math.abs(t.deltaX))return;const i=e.dom.elWrap;if(!i)return;let s=i.querySelector(".apexcharts-wheel-hint");if(!s){const t=ft.getWindow(),a=t&&t.navigator,r=!!a&&/Mac|iPhone|iPad/.test(a.platform||a.userAgent),n=(e.globals.locale.toolbar.wheelZoomHint||"").replace("{key}",r?"\u2318":"Ctrl");s=ft.createElement("div"),s.className="apexcharts-wheel-hint",s.setAttribute("aria-hidden","true");const o=ft.createElement("span");o.textContent=n,o.style.fontFamily=e.config.chart.fontFamily,s.appendChild(o),i.appendChild(s),s.offsetWidth}s.classList.add("apexcharts-wheel-hint-visible");const a=e.interact;a.wheelHintTimer&&clearTimeout(a.wheelHintTimer),a.wheelHintTimer=setTimeout(()=>this._hideWheelHint(),1200)}_hideWheelHint(){var t;const e=this.w,i=e.interact;i.wheelHintTimer&&(clearTimeout(i.wheelHintTimer),i.wheelHintTimer=null);const s=null==(t=e.dom.elWrap)?void 0:t.querySelector(".apexcharts-wheel-hint");s&&s.classList.remove("apexcharts-wheel-hint-visible")}_focusForKeyboard(){var t,e;const i=this.w.dom.Paper&&this.w.dom.Paper.node;if(i&&"function"==typeof i.focus&&null!==i.getAttribute("tabindex")){null==(e=null==(t=this.ctx.keyboardNavigation)?void 0:t.notePointerFocus)||e.call(t);try{i.focus({preventScroll:!0})}catch(t){i.focus()}}}escapeResetEvent(t){if("Escape"!==t.key&&"Esc"!==t.key)return;if(!this.w.interact.zoomed)return;const e=this.ctx.keyboardNavigation;e&&e.active||this.resetControlAllowed()&&this.handleZoomReset()}_wheel(){const t=this.w.interact;return t.wheel||(t.wheel={factor:1,clientX:0,rafId:null,endTimer:null}),t.wheel}mouseWheelEvent(t){const e=this._wheel();if(!this._wheelZoomGreedy()&&!t.ctrlKey&&!t.metaKey&&null==e.endTimer)return void this._showWheelHint(t);t.preventDefault(),this._hideWheelHint();let i=t.deltaY;1===t.deltaMode?i*=33:2===t.deltaMode&&(i*=330),e.factor*=Math.pow(2,i/240),e.clientX=t.clientX,null==e.rafId&&(e.rafId=requestAnimationFrame(()=>this._applyWheelZoom())),e.endTimer&&clearTimeout(e.endTimer),e.endTimer=setTimeout(()=>this._endWheelZoom(),150)}_applyWheelZoom(){const t=this.w,e=this._wheel();e.rafId=null;const i=e.factor;if(e.factor=1,1===i||t.globals.isDestroyed)return;const s=t.layout.gridWidth;if(!this._hasPlot()||!s)return;const{min:a,max:r}=this._currentXWindow(),n=r-a,o=Math.min(Math.max(this._screenXToPlotPx(e.clientX)/s,0),1);let l=n*i;const h=this._clampBounds();if(h){const e=t.globals.minXDiff>0&&isFinite(t.globals.minXDiff)?t.globals.minXDiff:0,i=Math.max(2*e,1e-6*(h.max-h.min));l<i&&(l=i),l>h.max-h.min&&(l=h.max-h.min)}let c=a+o*n-o*l,d=c+l;const u=1e-9*n;if(Math.abs(c-a)<u&&Math.abs(d-r)<u)return;if(isNaN(c)||isNaN(d))return;const p=this.getBeforeZoomRange({min:c,max:d},void 0);p&&p.xaxis&&(c=p.xaxis.min,d=p.xaxis.max),this._applyXRange(c,d,!0)}_endWheelZoom(){const t=this.w;if(this._wheel().endTimer=null,t.globals.isDestroyed||!t.interact.zoomed)return;const{min:e,max:i}=this._currentXWindow(),s=t.globals.initialConfig?Zt.clone(t.globals.initialConfig.yaxis):[],a=this.ctx.toolbar;a&&a.zoomCallback({min:e,max:i},s)}makeSelectionRectDraggable(){const t=this.w;if(!this.selectionRect)return;const e=this.selectionRect.node.getBoundingClientRect();e.width>0&&e.height>0&&(this.selectionRect.select(!1).resize(!1),this.selectionRect.select({createRot:()=>{},updateRot:()=>{},createHandle:(t,e,i,s,a)=>"l"===a||"r"===a?t.circle(8).css({"stroke-width":1,stroke:"#333",fill:"#fff"}):t.circle(0),updateHandle:(t,e)=>t.center(e[0],e[1])}).resize().on("resize",()=>{var e;if(this._clampSelectionRectToPlot(),t.interact.selectionEnabled)t.interact.selection={x:parseFloat(this.selectionRect.node.getAttribute("x")),y:parseFloat(this.selectionRect.node.getAttribute("y")),width:parseFloat(this.selectionRect.node.getAttribute("width")),height:parseFloat(this.selectionRect.node.getAttribute("height"))},clearTimeout(null!=(e=this.w.globals.selectionResizeTimer)?e:void 0),this.w.globals.selectionResizeTimer=window.setTimeout(()=>{this._emitSelectionFromRect()},30);else{const e=t.interact.zoomEnabled?t.config.chart.zoom.type:t.config.chart.selection.type;this.handleMouseUp({zoomtype:e,isResized:!0})}}))}preselectedSelection(){const t=this.w,e=this.xyRatios;if(!t.interact.zoomEnabled)if(void 0!==t.interact.selection&&null!==t.interact.selection)this.drawSelectionRect(l(o({},t.interact.selection),{translateX:t.layout.translateX,translateY:t.layout.translateY}));else if(void 0!==t.config.chart.selection.xaxis.min&&void 0!==t.config.chart.selection.xaxis.max){let i=be.dataXToPx(t,t.config.chart.selection.xaxis.min),s=be.dataXToPx(t,t.config.chart.selection.xaxis.max)-i;t.axisFlags.isRangeBar&&(i=(t.config.chart.selection.xaxis.min-t.globals.yAxisScale[0].niceMin)/e.invertedYRatio,s=(t.config.chart.selection.xaxis.max-t.config.chart.selection.xaxis.min)/e.invertedYRatio);const a={x:i,y:0,width:s,height:t.layout.gridHeight,translateX:t.layout.translateX,translateY:t.layout.translateY,selectionEnabled:!0};this.drawSelectionRect(a),this.makeSelectionRectDraggable(),"function"==typeof t.config.chart.events.selection&&t.config.chart.events.selection(this.ctx,{xaxis:{min:t.config.chart.selection.xaxis.min,max:t.config.chart.selection.xaxis.max},yaxis:{}})}}drawSelectionRect({x:t,y:e,width:i,height:s,translateX:a=0,translateY:r=0}){const n=this.w,o=this.zoomRect,l=this.selectionRect;if(this.dragged||null!==n.interact.selection){const h={transform:"translate("+a+", "+r+")"};n.interact.zoomEnabled&&this.dragged&&(i<0&&(i=1),o.attr({x:t,y:e,width:i,height:s,fill:n.config.chart.zoom.zoomedArea.fill.color,"fill-opacity":n.config.chart.zoom.zoomedArea.fill.opacity,stroke:n.config.chart.zoom.zoomedArea.stroke.color,"stroke-width":n.config.chart.zoom.zoomedArea.stroke.width,"stroke-opacity":n.config.chart.zoom.zoomedArea.stroke.opacity}),R.setAttrs(o.node,h)),n.interact.selectionEnabled&&(l.attr({x:t,y:e,width:i>0?i:0,height:s>0?s:0,fill:n.config.chart.selection.fill.color,"fill-opacity":n.config.chart.selection.fill.opacity,stroke:n.config.chart.selection.stroke.color,"stroke-width":n.config.chart.selection.stroke.width,"stroke-dasharray":n.config.chart.selection.stroke.dashArray,"stroke-opacity":n.config.chart.selection.stroke.opacity}),R.setAttrs(l.node,h))}}_clampSelectionRectToPlot(){const t=this.selectionRect;if(!t||!t.node)return;const e=this.w.layout.gridWidth;if(!(e>0))return;const i=parseFloat(t.node.getAttribute("x"))||0,s=parseFloat(t.node.getAttribute("width"))||0,a=t=>Math.min(Math.max(t,0),e),r=a(i),n=a(i+s);r===i&&n===i+s||(t.attr({x:r,width:n-r}),t._updateSelectPositions&&t._updateSelectPositions())}hideSelectionRect(t){t&&t.attr({x:0,y:0,width:0,height:0})}selectionDrawing({context:t,zoomtype:e}){const i=this.w,s=t;if(!this._hasPlot())return;const a=s.startX,r=s.startY;let n=!1,h=!1;const c=this._screenXToPlotPx(s.clientX),d=this._screenYToPlotPx(s.clientY);let u=c-a,p=d-r,g={translateX:i.layout.translateX,translateY:i.layout.translateY};return Math.abs(u+a)>i.layout.gridWidth?u=i.layout.gridWidth-a:c<0&&(u=a),a>c&&(n=!0,u=Math.abs(u)),r>d&&(h=!0,p=Math.abs(p)),g="x"===e?{x:n?a-u:a,y:0,width:u,height:i.layout.gridHeight}:"y"===e?{x:0,y:h?r-p:r,width:i.layout.gridWidth,height:p}:{x:n?a-u:a,y:h?r-p:r,width:u,height:p},g=l(o({},g),{translateX:i.layout.translateX,translateY:i.layout.translateY}),s.drawSelectionRect(g),s.selectionDragging("resizing"),g}selectionDragging(t,e){var i;const s=this.w;if(!e)return;e.preventDefault();const{handler:a,box:r}=e.detail,n=this.constraints;let{x:o,y:l}=r;o<n.x&&(o=n.x),l<n.y&&(l=n.y),r.x2>n.x2&&(o=n.x2-r.w),r.y2>n.y2&&(l=n.y2-r.h),a.move(o,l);const h=this.selectionRect;let c=0;"resizing"===t&&(c=30);const d=t=>parseFloat(h.node.getAttribute(t)),u={x:d("x"),y:d("y"),width:d("width"),height:d("height")};s.interact.selection=u;const p=s.config.chart.link,g=!(!p||!p.enabled&&"function"!=typeof p.dimension);("function"==typeof s.config.chart.events.selection||g)&&s.interact.selectionEnabled&&(clearTimeout(null!=(i=this.w.globals.selectionResizeTimer)?i:void 0),this.w.globals.selectionResizeTimer=window.setTimeout(()=>{this._emitSelectionFromRect()},c))}_emitSelectionFromRect(){var t;const e=this.w;if(!e.interact.selectionEnabled)return;const i=e.config.chart.link,s=!(!i||!i.enabled&&"function"!=typeof i.dimension);if("function"!=typeof e.config.chart.events.selection&&!s)return;if(!this._hasPlot())return;const a=this.selectionRect.node.getBoundingClientRect(),r=this.xyRatios;let n,o,l,h;const c=this._screenXToPlotPx(a.left),d=this._screenXToPlotPx(a.right);if(e.axisFlags.isRangeBar)n=e.globals.yAxisScale[0].niceMin+c*r.invertedYRatio,o=e.globals.yAxisScale[0].niceMin+d*r.invertedYRatio,l=0,h=1;else{if(!e.globals.xAxisScale)return;n=be.pxToDataX(e,c),o=be.pxToDataX(e,d),l=e.globals.yAxisScale[0].niceMin+(e.layout.gridHeight-this._screenYToPlotPx(a.bottom))*r.yRatio[0],h=e.globals.yAxisScale[0].niceMax-this._screenYToPlotPx(a.top)*r.yRatio[0]}const u={xaxis:{min:n,max:o},yaxis:{min:l,max:h}};"function"==typeof e.config.chart.events.selection&&e.config.chart.events.selection(this.ctx,u),e.config.chart.brush.enabled&&void 0!==e.config.chart.events.brushScrolled&&e.config.chart.events.brushScrolled(this.ctx,u),null==(t=this.ctx.linkedViews)||t.onSourceSelection(u.xaxis)}selectionDrawn({context:t,zoomtype:e}){var i;const s=this.w,a=t,r=this.xyRatios,n=this.ctx.toolbar,o=s.interact.zoomEnabled?a.zoomRect.node.getBoundingClientRect():a.selectionRect.node.getBoundingClientRect();if(!a._hasPlot())return;const l=this._screenXToPlotPx(o.left),h=this._screenXToPlotPx(o.right),c=this._screenYToPlotPx(o.top),d=this._screenYToPlotPx(o.bottom);let u,p;s.axisFlags.isRangeBar?(u=s.globals.yAxisScale[0].niceMin+l*r.invertedYRatio,p=s.globals.yAxisScale[0].niceMin+h*r.invertedYRatio):(u=be.pxToDataX(s,l),p=be.pxToDataX(s,h));const g=[],f=[];if(s.config.yaxis.forEach((t,e)=>{const i=s.globals.seriesYAxisMap[e][0],a=s.globals.yAxisScale[e].niceMax-r.yRatio[i]*c,n=s.globals.yAxisScale[e].niceMax-r.yRatio[i]*d;g.push(a),f.push(n)}),a.dragged&&(a.dragX>10||a.dragY>10)&&u!==p)if(s.interact.zoomEnabled){if(!s.globals.initialConfig)return;let t=Zt.clone(s.globals.initialConfig.yaxis),i=Zt.clone(s.globals.initialConfig.xaxis);if(s.interact.zoomed=!0,s.config.xaxis.convertedCatToNumeric&&(u=Math.floor(u),p=Math.floor(p),u<1&&(u=1,p=s.globals.dataPoints),p-u<2&&(p=u+1)),"xy"!==e&&"x"!==e||(i={min:u,max:p}),"xy"!==e&&"y"!==e||t.forEach((e,i)=>{t[i].min=f[i],t[i].max=g[i]}),n){const e=n.getBeforeZoomRange(i,t);e&&(i=e.xaxis?e.xaxis:i,t=e.yaxis?e.yaxis:t)}const r={xaxis:i};s.config.chart.group||(r.yaxis=t);const o=a.ctx.updateHelpers._updateOptions(r,!1,a.w.config.chart.animations.dynamicAnimation.enabled);o&&"function"==typeof o.then?o.then(()=>a._focusForKeyboard()):a._focusForKeyboard(),"function"==typeof s.config.chart.events.zoomed&&n.zoomCallback(i,t)}else if(s.interact.selectionEnabled){let t=null,r=null;if(r={min:u,max:p},"xy"===e||"y"===e){const e=Zt.clone(s.config.yaxis);t=e,e.forEach((t,i)=>{e[i].min=f[i],e[i].max=g[i]})}s.interact.selection=a.selection,"function"==typeof s.config.chart.events.selection&&s.config.chart.events.selection(a.ctx,{xaxis:r,yaxis:t}),null==(i=a.ctx.linkedViews)||i.onSourceSelection(r)}}panDragging({context:t}){var e;const i=this.w,s=t;if(void 0!==i.interact.lastClientPosition.x){const t=i.interact.lastClientPosition.x-s.clientX,a=(null!=(e=i.interact.lastClientPosition.y)?e:0)-s.clientY;Math.abs(t)>Math.abs(a)&&t>0?this.moveDirection="left":Math.abs(t)>Math.abs(a)&&t<0?this.moveDirection="right":Math.abs(a)>Math.abs(t)&&a>0?this.moveDirection="up":Math.abs(a)>Math.abs(t)&&a<0&&(this.moveDirection="down")}i.interact.lastClientPosition={x:s.clientX,y:s.clientY};const a=i.axisFlags.isRangeBar?i.globals.minY:i.globals.minX,r=i.axisFlags.isRangeBar?i.globals.maxY:i.globals.maxX;s.panScrolled(a,r)}panScrolled(t,e){var i,s;const a=this.w,r=this.xyRatios;if(!a.globals.initialConfig)return;const n=Zt.clone(a.globals.initialConfig.yaxis);let o=r.xRatio,l=a.globals.minX,h=a.globals.maxX;if(a.axisFlags.isRangeBar&&(o=r.invertedYRatio,l=a.globals.minY,h=a.globals.maxY),"left"===this.moveDirection?(t=l+a.layout.gridWidth/15*o,e=h+a.layout.gridWidth/15*o):"right"===this.moveDirection&&(t=l-a.layout.gridWidth/15*o,e=h-a.layout.gridWidth/15*o),!a.axisFlags.isRangeBar){const r=null!=(i=a.globals.dataReducerRawMinX)?i:a.globals.initialMinX,n=null!=(s=a.globals.dataReducerRawMaxX)?s:a.globals.initialMaxX;(t<r||e>n)&&(t=l,e=h)}if(t===l&&e===h)return;const c={xaxis:{min:t,max:e}};a.config.chart.group||(c.yaxis=n),this.updateScrolledChart(c,t,e)}updateScrolledChart(t,e,i){const s=this.w;if(this.ctx.updateHelpers._updateOptions(t,!1,!1),"function"==typeof s.config.chart.events.scrolled){const t={xaxis:{min:e,max:i}};s.config.chart.events.scrolled(this.ctx,t),this.ctx.events.fireEvent("scrolled",t)}}_momentumEnabled(){return this._pinchEnabled()||this._panInertiaEnabled()}_pinchEnabled(){return this._incidentalZoomEnabled(this.w.config.chart.zoom.pinch)}_panInertiaEnabled(){const t=this.w.config.chart;return!(!t.pan||!t.pan.inertia)}_m(){const t=this.w.interact;return t.momentum||(t.momentum={busy:!1,pinch:null,panState:null,samples:[],inertiaRAF:null}),t.momentum}_currentXWindow(){const t=this.w;return t.axisFlags.isRangeBar?{min:t.globals.minY,max:t.globals.maxY}:{min:t.globals.minX,max:t.globals.maxX}}_hasPlot(){const t=this.w.dom.baseEl;return!(!t||!t.querySelector(".apexcharts-svg"))}_screenYToPlotPx(t){const e=gt.plotRect(this.w);return(t-e.top)/e.zoom}_screenXToPlotPx(t){return be.screenXToPlotPx(this.w,t)}_clampBounds(){var t,e;const i=this.w;return i.axisFlags.isRangeBar?null:{min:null!=(t=i.globals.dataReducerRawMinX)?t:i.globals.initialMinX,max:null!=(e=i.globals.dataReducerRawMaxX)?e:i.globals.initialMaxX}}_applyXRange(t,e,i){const s=this.w;if(!s.globals.initialConfig)return!1;const a=this._currentXWindow(),r=i&&e-t>a.max-a.min,n=this._clampBounds();if(n){const i=e-t;t<n.min&&(e=(t=n.min)+i),e>n.max&&(t=(e=n.max)-i),t<n.min&&(t=n.min)}if(s.config.xaxis.convertedCatToNumeric&&(t=Math.floor(t),e=r?Math.ceil(e):Math.floor(e),t<1&&(t=1),n&&e>n.max&&(e=Math.floor(n.max)),e-t<2))return!1;if(!(e>t))return!1;const o={xaxis:{min:t,max:e}};return s.config.chart.group||(o.yaxis=Zt.clone(s.globals.initialConfig.yaxis)),i&&(s.interact.zoomed=!0),this.ctx.updateHelpers._updateOptions(o,!1,!1),{minX:t,maxX:e}}_cancelInertia(){const t=this._m();null!=t.inertiaRAF&&(cancelAnimationFrame(t.inertiaRAF),t.inertiaRAF=null)}_fireScrolled(){const t=this.w;if("function"!=typeof t.config.chart.events.scrolled)return;const{min:e,max:i}=this._currentXWindow(),s={xaxis:{min:e,max:i}};t.config.chart.events.scrolled(this.ctx,s),this.ctx.events.fireEvent("scrolled",s)}panBy(t){const e=this.w;if(!e.interact.zoomed)return;const{min:i,max:s}=this._currentXWindow();let a=(s-i)*t;if(e.config.xaxis.convertedCatToNumeric&&(a=a>0?Math.ceil(a):Math.floor(a)),e.axisFlags.isRangeBar){const t=e.rangeData;let r=1/0,n=-1/0;if(t.seriesRangeStart.concat(t.seriesRangeEnd).flat().forEach(t=>{null!=t&&(r=Math.min(r,t),n=Math.max(n,t))}),a=a>0?Math.min(a,Math.max(0,n-s)):Math.max(a,Math.min(0,r-i)),!a)return}this._applyXRange(i+a,s+a,!1)&&this._fireScrolled()}_pushSample(t,e){const i=this._m().samples;for(i.push({x:t,t:e});i.length>6;)i.shift()}momentumTouch(t){const e=this.w,i=this._m(),s=t.type;if("touchstart"!==s)"touchmove"!==s?(i.pinch?t.touches.length<2&&this._endPinch():i.panState&&0===t.touches.length&&this._endPan(),0===t.touches.length&&(e.interact.mousedown=!1,this.dragged=!1,null!=i.inertiaRAF||i.pinch||i.panState||(i.busy=!1))):i.pinch&&t.touches.length>=2?(t.preventDefault(),this._movePinch(t)):i.panState&&1===t.touches.length&&this._movePan(t);else{if(this._cancelInertia(),!this._hasPlot())return;if(t.touches.length>=2&&this._pinchEnabled())t.preventDefault(),i.busy=!0,i.panState=null,this._beginPinch(t);else if(1===t.touches.length&&this._panInertiaEnabled()&&e.interact.panEnabled){i.busy=!0,i.pinch=null;const s=t.touches[0],a=this._currentXWindow(),r=e.layout.gridWidth||1,n=gt.plotRect(e).zoom;i.panState={startX:s.clientX,startY:s.clientY,axis:null,minX0:a.min,maxX0:a.max,zoom:n,ratio0:(a.max-a.min)/r/n},i.samples=[{x:s.clientX,t:t.timeStamp}]}}}_beginPinch(t){const e=this.w,i=t.touches[0],s=t.touches[1],a=Math.hypot(s.clientX-i.clientX,s.clientY-i.clientY)||1,r=this._screenXToPlotPx((i.clientX+s.clientX)/2),{min:n,max:o}=this._currentXWindow();this._m().pinch={d0:a,cx0:r,minX0:n,maxX0:o,gridWidth:e.layout.gridWidth||1}}_movePinch(t){const e=this.w,i=this._m().pinch;if(!i||!this._hasPlot())return;const s=t.touches[0],a=t.touches[1],r=Math.hypot(a.clientX-s.clientX,a.clientY-s.clientY)||1,n=this._screenXToPlotPx((s.clientX+a.clientX)/2),o=i.maxX0-i.minX0,l=o*(i.d0/r);let h=i.minX0+i.cx0/i.gridWidth*o-n/i.gridWidth*l,c=h+l;const d=this._clampBounds();if(d){const t=e.globals.minXDiff>0&&isFinite(e.globals.minXDiff)?e.globals.minXDiff:0,i=Math.max(2*t,1e-6*(d.max-d.min));if(c-h<i){const t=(h+c)/2;h=t-i/2,c=t+i/2}}this._applyXRange(h,c,!0)}_endPinch(){const t=this.w;this._m().pinch=null;const{min:e,max:i}=this._currentXWindow(),s={min:e,max:i},a=t.globals.initialConfig?Zt.clone(t.globals.initialConfig.yaxis):[],r=this.ctx.toolbar;r&&r.zoomCallback(s,a)}_movePan(t){const e=this._m(),i=e.panState,s=t.touches[0];if(!i.axis){const a=Math.abs(s.clientX-i.startX),r=Math.abs(s.clientY-i.startY);if(a<6&&r<6)return void this._pushSample(s.clientX,t.timeStamp);if(r>a)return e.busy=!1,void(e.panState=null);i.axis="x"}if("x"!==i.axis)return;t.preventDefault();const a=(s.clientX-i.startX)*i.ratio0;this._pushSample(s.clientX,t.timeStamp),this._applyXRange(i.minX0-a,i.maxX0-a,!1)}_endPan(){const t=this._m(),e=t.panState;t.panState=null;let i=0;const s=t.samples;if(s.length>=2){const t=s[0],e=s[s.length-1],a=e.t-t.t;a>0&&(i=(e.x-t.x)/a)}t.samples=[],e&&"x"===e.axis&&this._panInertiaEnabled()&&Math.abs(i)>.05?this._startInertia(i/e.zoom):(t.busy=!1,this._fireScrolled())}_startInertia(t){const e=this.w,i=this._m(),s=e.config.chart.pan&&e.config.chart.pan.friction,a="number"==typeof s?Math.min(Math.max(s,.5),.999):.92;let r=t,n=null;i.busy=!0;const o=t=>{if(e.globals.isDestroyed)return i.inertiaRAF=null,void(i.busy=!1);if(null==n)return n=t,void(i.inertiaRAF=requestAnimationFrame(o));const s=t-n;if(n=t,r*=Math.pow(a,s/16.6667),Math.abs(r)<.02)return i.inertiaRAF=null,i.busy=!1,void this._fireScrolled();const l=this._currentXWindow(),h=e.layout.gridWidth||1,c=(l.max-l.min)/h,d=r*s*c,u=this._applyXRange(l.min-d,l.max-d,!1),p=this._clampBounds();if(!u||p&&(d>0&&u.minX<=p.min+1e-6*(p.max-p.min)||d<0&&u.maxX>=p.max-1e-6*(p.max-p.min)))return i.inertiaRAF=null,i.busy=!1,void this._fireScrolled();i.inertiaRAF=requestAnimationFrame(o)};i.inertiaRAF=requestAnimationFrame(o)}}});let ye=class{constructor(t){this.w=t.w,this.annoCtx=t}setOrientations(t,e=null){var i,s;const a=this.w;if("vertical"===t.label.orientation){const r=null!==e?e:0,n=a.dom.baseEl.querySelector(`.apexcharts-xaxis-annotations .apexcharts-xaxis-annotation-label[rel='${r}']`);if(null!==n){const e=n.getBBox();n.setAttribute("x",String(parseFloat(null!=(i=n.getAttribute("x"))?i:"0")-e.height+4));const a="top"===t.label.position?e.width:-e.width;n.setAttribute("y",String(parseFloat(null!=(s=n.getAttribute("y"))?s:"0")+a));const{x:r,y:o}=this.annoCtx.graphics.rotateAroundCenter(n);n.setAttribute("transform",`rotate(-90 ${r} ${o})`)}}}addBackgroundToAnno(t,e,i){const s=this.w;if(!t||!e.label.text||!String(e.label.text).trim())return null;const a=s.dom.baseEl.querySelector(".apexcharts-grid");if(!a)return null;const r=a.getBoundingClientRect(),n=a.getBBox(),o=r.width/n.width||1,l=t.getBoundingClientRect();let{left:h,right:c,top:d,bottom:u}=e.label.style.padding;"vertical"===e.label.orientation&&([d,u,h,c]=[h,c,d,u]);const p=r.left-n.x*o,g=r.top-n.y*o,f=(l.left-p)/o-h,m=(l.top-g)/o-d,x=()=>{const t=this.annoCtx.graphics.drawRect(f,m,l.width/o+h+c,l.height/o+d+u,e.label.borderRadius,e.label.style.background,1,e.label.borderWidth,e.label.borderColor,0);return e.id&&t.node.classList.add(e.id),t};return i?x:x()}annotationsBackground(){const t=this.w,e=[],i=(i,s,a)=>{const r=t.dom.baseEl.querySelector(`.apexcharts-${a}-annotations .apexcharts-${a}-annotation-label[rel='${s}']`),n=this.addBackgroundToAnno(r,i,!0);n&&e.push(()=>{const e=n(),s=r.parentNode;null==s||s.insertBefore(e.node,r);const a=r.getAttribute("x");null!==a&&m(e,parseFloat(a),t),i.label.mouseEnter&&e.node.addEventListener("mouseenter",i.label.mouseEnter.bind(this,i)),i.label.mouseLeave&&e.node.addEventListener("mouseleave",i.label.mouseLeave.bind(this,i)),i.label.click&&e.node.addEventListener("click",i.label.click.bind(this,i))})};t.config.annotations.xaxis.forEach((t,e)=>i(t,e,"xaxis")),t.config.annotations.yaxis.forEach((t,e)=>i(t,e,"yaxis")),t.config.annotations.points.forEach((t,e)=>i(t,e,"point")),e.forEach(t=>t())}usesCategoryX(){const t=this.w;return("category"===t.config.xaxis.type||t.config.xaxis.convertedCatToNumeric)&&!this.annoCtx.invertAxis&&!t.axisFlags.dataFormatXNumeric&&!t.config.chart.sparkline.enabled}hasXDomain(){const t=this.w;return this.annoCtx.invertAxis?Zt.isNumber(t.globals.minY)&&Zt.isNumber(t.globals.yRange[0]):this.usesCategoryX()?t.labelData.labels.length>0||t.labelData.categoryLabels.length>0:Zt.isNumber(t.globals.minX)&&Zt.isNumber(t.globals.xRange)}getY1Y2(t,e){var i,s,a;const r=this.w,n="y1"===t?e.y:e.y2,o="string"==typeof n&&n.includes("px");let l,h=!1;if(this.annoCtx.invertAxis){const t=r.config.xaxis.convertedCatToNumeric?r.labelData.categoryLabels:r.labelData.labels,s=t.indexOf(n);if(!o&&-1===s)return{yP:0,clipped:!0};const a=r.dom.baseEl.querySelector(`.apexcharts-yaxis-texts-g text:nth-child(${s+1})`);l=a?parseFloat(null!=(i=a.getAttribute("y"))?i:"0"):(r.layout.gridHeight/t.length-1)*(s+1)-r.globals.barHeight,void 0!==e.seriesIndex&&r.globals.barHeight&&(l+=this.barSlotOffset(e.seriesIndex,r.globals.barHeight))}else{if(!r.config.yaxis[e.yAxisIndex])return{yP:0,clipped:!0};const t=r.globals.seriesYAxisMap[e.yAxisIndex],i=null!=(s=null==t?void 0:t[0])?s:null;if(null===i&&r.seriesData.series.length)return{yP:0,clipped:!0};const o=null===i?r.globals.minY:r.globals.minYArr[i],c=null===i?r.globals.maxY-r.globals.minY:r.globals.yRange[i],d=r.config.yaxis[e.yAxisIndex].logarithmic&&null!==i?new P(this.w).getLogVal(r.config.yaxis[e.yAxisIndex].logBase,n,i)/r.globals.yLogRatio[i]:(n-o)/(c/r.layout.gridHeight);l=r.layout.gridHeight-Math.min(Math.max(d,0),r.layout.gridHeight),h=d>r.layout.gridHeight||d<0,!e.marker||void 0!==e.y&&null!==e.y||(l=0),(null==(a=r.config.yaxis[e.yAxisIndex])?void 0:a.reversed)&&(l=d)}return o&&(l=parseFloat(n)),{yP:l,clipped:h}}getX1X2(t,e){const i=this.w,s="x1"===t?e.x:e.x2,a=this.annoCtx.invertAxis?i.globals.minY:i.globals.minX,r=this.annoCtx.invertAxis?i.globals.maxY:i.globals.maxX,n=this.annoCtx.invertAxis?i.globals.yRange[0]:i.globals.xRange;let o=!1;const l="string"==typeof s&&s.includes("px"),h=null==s&&e.marker;if(!l&&!h&&!this.hasXDomain())return{x:0,clipped:!0};let c=this.annoCtx.inversedReversedAxis?(r-s)/(n/i.layout.gridWidth):(s-a)/(n/i.layout.gridWidth);return this.usesCategoryX()&&(c=this.getStringX(s)),"string"==typeof s&&s.includes("px")&&(c=parseFloat(s)),null==s&&e.marker&&(c=i.layout.gridWidth),void 0!==e.seriesIndex&&i.globals.barWidth&&!this.annoCtx.invertAxis&&(c+=this.barSlotOffset(e.seriesIndex,i.globals.barWidth)),"number"!=typeof c&&(c=0,o=!0),parseFloat(c.toFixed(10))>parseFloat(i.layout.gridWidth.toFixed(10))?(c=i.layout.gridWidth,o=!0):c<0&&(c=0,o=!0),{x:c,clipped:o}}barSlotOffset(t,e){const i=this.w;if(i.config.chart.stacked)return 0;let s=0,a=0;return i.seriesData.series.forEach((e,r)=>{var n;const o=null==(n=i.config.series[r])?void 0:n.type;!e.length||i.globals.comboCharts&&"bar"!==o&&"column"!==o||(r<t&&a++,s++)}),e*(a-(s-1)/2)}getStringX(t){var e;const i=this.w;let s=t;if(i.config.xaxis.convertedCatToNumeric&&i.labelData.categoryLabels.length){const e=String(t);t=i.labelData.categoryLabels.findIndex(t=>String(t)===e)+1}const a=i.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(t),r=i.dom.baseEl.querySelector(`.apexcharts-xaxis-texts-g text:nth-child(${a+1})`);return r?s=parseFloat(null!=(e=r.getAttribute("x"))?e:"0"):a>-1&&(s=i.axisFlags.isXNumeric?(t-i.globals.minX)/(i.globals.xRange/i.layout.gridWidth):i.globals.padHorizontal+(a+.5)*i.layout.gridWidth/i.globals.dataPoints),s}};class ve{constructor(t){this.w=t.w,this.annoCtx=t,this.invertAxis=this.annoCtx.invertAxis,this.helpers=new ye(this.annoCtx)}addXaxisAnnotation(t,e,i){const s=this.w,a=this.helpers.getX1X2("x1",t);let r=a.x;const n=a.clipped;let o,l=!0;const h=t.label.text,c=t.strokeDashArray;if(Zt.isNumber(r)){if(null===t.x2||void 0===t.x2){if(!n){const i=this.annoCtx.graphics.drawLine(r+t.offsetX,0+t.offsetY,r+t.offsetX,s.layout.gridHeight+t.offsetY,t.borderColor,c,t.borderWidth);e.appendChild(i.node),t.id&&i.node.classList.add(t.id),m(i,r+t.offsetX,s)}}else{const i=this.helpers.getX1X2("x2",t);if(o=i.x,l=i.clipped,o<r){const t=r;r=o,o=t}const a=this.annoCtx.graphics.drawRect(r+t.offsetX,0+t.offsetY,o-r,s.layout.gridHeight+t.offsetY,0,t.fillColor,t.opacity,1,t.borderColor,c);a.node.classList.add("apexcharts-annotation-rect"),a.attr("clip-path",`url(#gridRectMask${s.globals.cuid})`),e.appendChild(a.node),t.id&&a.node.classList.add(t.id),m(a,r+t.offsetX,s)}if(!n||!l){const a=this.annoCtx.graphics.getTextRects(h,t.label.style.fontSize),n="top"===t.label.position?4:"center"===t.label.position?s.layout.gridHeight/2+("vertical"===t.label.orientation?a.width/2:0):s.layout.gridHeight,o=this.annoCtx.graphics.drawText({x:r+t.label.offsetX,y:n+t.label.offsetY-("vertical"===t.label.orientation?"top"===t.label.position?a.width/2-12:-a.width/2:0),text:h,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-xaxis-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});o.attr({rel:i}),e.appendChild(o.node),m(o,r+t.label.offsetX,s),this.annoCtx.helpers.setOrientations(t,i)}}}drawXAxisAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-xaxis-annotations"});return t.config.annotations.xaxis.map((t,i)=>{this.addXaxisAnnotation(t,e.node,i)}),e}}class we{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new ye(this.annoCtx),this.axesUtils=new j(this.annoCtx.w,{theme:this.annoCtx.theme,timeScale:this.annoCtx.timeScale})}addYaxisAnnotation(t,e,i){const s=this.w,a=t.strokeDashArray;let r=this.helpers.getY1Y2("y1",t),n=r.yP;const o=r.clipped;let l,h=!0,c=!1;const d=t.label.text;if(null===t.y2||void 0===t.y2){if(!o){c=!0;const i=this.annoCtx.graphics.drawLine(0+t.offsetX,n+t.offsetY,this._getYAxisAnnotationWidth(t),n+t.offsetY,t.borderColor,a,t.borderWidth);e.appendChild(i.node),t.id&&i.node.classList.add(t.id)}}else{if(r=this.helpers.getY1Y2("y2",t),l=r.yP,h=r.clipped,l>n){const t=n;n=l,l=t}if(!o||!h){c=!0;const i=this.annoCtx.graphics.drawRect(0+t.offsetX,l+t.offsetY,this._getYAxisAnnotationWidth(t),n-l,0,t.fillColor,t.opacity,1,t.borderColor,a);i.node.classList.add("apexcharts-annotation-rect"),i.attr("clip-path",`url(#gridRectMask${s.globals.cuid})`),e.appendChild(i.node),t.id&&i.node.classList.add(t.id)}}if(c){const a="right"===t.label.position?s.layout.gridWidth:"center"===t.label.position?s.layout.gridWidth/2:0,r=this.annoCtx.graphics.drawText({x:a+t.label.offsetX,y:(null!=l?l:n)+t.label.offsetY-3,text:d,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-yaxis-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});r.attr({rel:i}),e.appendChild(r.node)}}_getYAxisAnnotationWidth(t){const e=this.w;let i=e.layout.gridWidth;return i=t.width.indexOf("%")>-1?e.layout.gridWidth*parseInt(t.width,10)/100:parseInt(t.width,10),i+t.offsetX}drawYAxisAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-yaxis-annotations"});return t.config.annotations.yaxis.forEach((t,i)=>{t.yAxisIndex=this.axesUtils.translateYAxisIndex(t.yAxisIndex),this.axesUtils.isYAxisHidden(t.yAxisIndex)&&this.axesUtils.yAxisAllSeriesCollapsed(t.yAxisIndex)||this.addYaxisAnnotation(t,e.node,i)}),e}}class _e{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new ye(this.annoCtx)}addPointAnnotation(t,e,i){const s=this.w;if(s.globals.collapsedSeriesIndices.indexOf(t.seriesIndex)>-1)return;const a=this.helpers.getX1X2("x1",t),r=a.x,n=a.clipped,o=this.helpers.getY1Y2("y1",t),l=o.yP,h=o.clipped;if(Zt.isNumber(r)&&!h&&!n){const a={pSize:t.marker.size,pointStrokeWidth:t.marker.strokeWidth,pointFillColor:t.marker.fillColor,pointStrokeColor:t.marker.strokeColor,shape:t.marker.shape,pRadius:t.marker.radius,class:`apexcharts-point-annotation-marker ${t.marker.cssClass} ${t.id?t.id:""}`};let n=this.annoCtx.graphics.drawMarker(r+t.marker.offsetX,l+t.marker.offsetY,a);e.appendChild(n.node);const o=[n.node];m(n,r,s);const h=t.label.text?t.label.text:"",c=this.getConstrainedLabelX(h,r+t.label.offsetX,t.label),d=this.annoCtx.graphics.drawText({x:c,y:l+t.label.offsetY-t.marker.size-parseFloat(t.label.style.fontSize)/1.6,text:h,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-point-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});if(d.attr({rel:i}),e.appendChild(d.node),m(d,r,s),t.customSVG.SVG){const i=this.annoCtx.graphics.group({class:"apexcharts-point-annotations-custom-svg "+t.customSVG.cssClass});i.attr({transform:`translate(${r+t.customSVG.offsetX}, ${l+t.customSVG.offsetY})`}),i.node.innerHTML=t.customSVG.SVG,e.appendChild(i.node),o.push(i.node)}if(t.image.path){const e=t.image.width?t.image.width:20,i=t.image.height?t.image.height:20;n=this.annoCtx.addImage({x:r+t.image.offsetX-e/2,y:l+t.image.offsetY-i/2,width:e,height:i,path:t.image.path,appendTo:".apexcharts-point-annotations"}),o.push(n.node)}t.tooltip&&t.tooltip.enabled&&o.forEach(e=>{e.addEventListener("mouseenter",()=>{this.showPointTooltip(t,e)}),e.addEventListener("mouseleave",()=>{this.hidePointTooltip()})}),t.mouseEnter&&n.node.addEventListener("mouseenter",t.mouseEnter.bind(this,t)),t.mouseLeave&&n.node.addEventListener("mouseleave",t.mouseLeave.bind(this,t)),t.click&&n.node.addEventListener("click",t.click.bind(this,t))}}getConstrainedLabelX(t,e,i){const s=this.w;if(!t)return e;const{width:a}=this.annoCtx.graphics.getTextRects(t,i.style.fontSize,i.style.fontFamily,void 0,!0,i.style.fontWeight);let r,n;switch(i.textAnchor){case"start":r=e,n=e+a;break;case"end":r=e-a,n=e;break;default:r=e-a/2,n=e+a/2}const o=i.style.padding||{};return r-=o.left||0,n+=o.right||0,r<0?e-r:n>s.layout.gridWidth?e-(n-s.layout.gridWidth):e}getPointTooltipEl(){const t=this.w;let e=t.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");return e||(e=ft.createElementNS("http://www.w3.org/1999/xhtml","div"),e.classList.add("apexcharts-tooltip","apexcharts-annotation-tooltip"),t.dom.elWrap.appendChild(e)),e}getPointTooltipContent(t){const e=this.w,i=t.tooltip||{};if("function"==typeof i.formatter)return i.formatter({annotation:t,seriesIndex:t.seriesIndex,id:t.id,w:e});let s=null!=i.text?i.text:t.label&&t.label.text;return Array.isArray(s)&&(s=s.join("<br/>")),null==s?"":String(s)}showPointTooltip(t,e){const i=this.w,s=this.getPointTooltipContent(t);if(!s)return;const a=this.getPointTooltipEl();a.innerHTML=s;const r=t.tooltip.theme||i.config.tooltip.theme||"light";a.classList.remove("apexcharts-theme-light","apexcharts-theme-dark"),a.classList.add(`apexcharts-theme-${r}`),a.classList.add("apexcharts-active");const n=i.dom.elWrap.getBoundingClientRect(),o=e.getBoundingClientRect(),l=a.getBoundingClientRect(),h=t.tooltip.offsetX||0,c=t.tooltip.offsetY||0;let d=o.left-n.left+o.width/2-l.width/2,u=o.top-n.top-l.height-10;d=Math.max(0,Math.min(d,n.width-l.width)),u<0&&(u=o.top-n.top+o.height+10),a.style.left=d+h+"px",a.style.top=u+c+"px"}hidePointTooltip(){const t=this.w.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");t&&t.classList.remove("apexcharts-active")}drawPointAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-point-annotations"});return t.config.annotations.points.map((t,i)=>{this.addPointAnnotation(t,e.node,i)}),e}}c.default.registerFeatures({annotations:class{constructor(t,{theme:e=null,timeScale:i=null}={}){this.w=t,this.theme=e,this.timeScale=i,this.invertAxis=void 0,this.inversedReversedAxis=void 0,this.graphics=new R(this.w),this.w.globals.isBarHorizontal&&(this.invertAxis=!0),this.helpers=new ye(this),this.xAxisAnnotations=new ve(this),this.yAxisAnnotations=new we(this),this.pointsAnnotations=new _e(this),this.w.globals.isBarHorizontal&&this.w.config.yaxis[0].reversed&&(this.inversedReversedAxis=!0)}drawAxesAnnotations(){const t=this.w;if(t.globals.axisCharts){const e=this.yAxisAnnotations.drawYAxisAnnotations(),i=this.xAxisAnnotations.drawXAxisAnnotations(),s=this.pointsAnnotations.drawPointAnnotations(),a=t.config.chart.animations.enabled,r=[e,i,s],n=[i.node,e.node,s.node],o="line"===t.config.chart.type||"area"===t.config.chart.type||"rangeArea"===t.config.chart.type,l=[o,!1,o];for(let e=0;e<3;e++)t.dom.elGraphical.add(r[e]),!a||t.globals.resized||t.globals.dataChanged||t.globals.animationEnded||"scatter"!==t.config.chart.type&&"bubble"!==t.config.chart.type&&t.globals.dataPoints>1&&!l[e]&&n[e].classList.add("apexcharts-element-hidden"),t.globals.delayedElements.push({el:n[e],index:0});this.helpers.annotationsBackground()}}drawImageAnnos(){this.w.config.annotations.images.map(t=>{this.addImage(t)})}drawTextAnnos(){this.w.config.annotations.texts.map(t=>{this.addText(t)})}addXaxisAnnotation(t,e,i){this.xAxisAnnotations.addXaxisAnnotation(t,e,i)}addYaxisAnnotation(t,e,i){this.yAxisAnnotations.addYaxisAnnotation(t,e,i)}addPointAnnotation(t,e,i){this.pointsAnnotations.addPointAnnotation(t,e,i)}addText(t){const{x:e,y:i,text:s,textAnchor:a,foreColor:r,fontSize:n,fontFamily:o,fontWeight:l,cssClass:h,backgroundColor:c,borderWidth:d,strokeDashArray:u,borderRadius:p,borderColor:g,appendTo:f=".apexcharts-svg",paddingLeft:m=4,paddingRight:x=4,paddingBottom:b=2,paddingTop:y=2}=t,v=this.w,w=v.dom.baseEl.querySelector(f);if(!w)return;const _=this.graphics.drawText({x:e,y:i,text:s,textAnchor:a||"start",fontSize:n||"12px",fontWeight:l||"regular",fontFamily:o||v.config.chart.fontFamily,foreColor:r||v.config.chart.foreColor,cssClass:h||""});w.appendChild(_.node);const A=_.bbox();if(s){const t=this.graphics.drawRect(A.x-m,A.y-y,A.width+m+x,A.height+b+y,p,c||"transparent",1,d,g,u);w.insertBefore(t.node,_.node)}}addImage(t){const e=this.w,{path:i,x:s=0,y:a=0,width:r=20,height:n=20,appendTo:o=".apexcharts-svg"}=t,l=e.dom.Paper.image(i);l.size(r,n).move(s,a);const h=e.dom.baseEl.querySelector(o);return h&&h.appendChild(l.node),l}addXaxisAnnotationExternal(t,e,i){return this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"xaxis",contextMethod:i.addXaxisAnnotation}),i}addYaxisAnnotationExternal(t,e,i){return this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"yaxis",contextMethod:i.addYaxisAnnotation}),i}addPointAnnotationExternal(t,e,i){return void 0===this.invertAxis&&(this.invertAxis=i.w.globals.isBarHorizontal),this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"point",contextMethod:i.addPointAnnotation}),i}addAnnotationExternal({params:t,pushToMemory:e,context:i,type:s,contextMethod:a}){var r;const n=i,o=n.w,l=o.dom.baseEl.querySelector(`.apexcharts-${s}-annotations`),h=((null==(r=o.config.annotations["point"===s?"points":s])?void 0:r.length)||0)+l.childNodes.length,c=new ot,d=Object.assign({},"xaxis"===s?c.xAxisAnnotation:"yaxis"===s?c.yAxisAnnotation:c.pointAnnotation),u=Zt.extend(d,t);switch(s){case"xaxis":this.addXaxisAnnotation(u,l,h);break;case"yaxis":this.addYaxisAnnotation(u,l,h);break;case"point":this.addPointAnnotation(u,l,h)}const p=o.dom.baseEl.querySelector(`.apexcharts-${s}-annotations .apexcharts-${s}-annotation-label[rel='${h}']`),g=this.helpers.addBackgroundToAnno(p,u);return g&&l.insertBefore(g.node,p),e&&o.globals.memory.methodsToExec.push({context:n,id:u.id?u.id:Zt.randomId(),method:a,label:"addAnnotation",params:t}),i}_removeAnnotationTooltip(t){const e=t.dom.elWrap&&t.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");e&&e.parentNode&&e.parentNode.removeChild(e)}clearAnnotations(t){const e=t.w;this._removeAnnotationTooltip(e);const i=e.dom.baseEl.querySelectorAll(".apexcharts-yaxis-annotations, .apexcharts-xaxis-annotations, .apexcharts-point-annotations");for(let t=e.globals.memory.methodsToExec.length-1;t>=0;t--)"addText"!==e.globals.memory.methodsToExec[t].label&&"addAnnotation"!==e.globals.memory.methodsToExec[t].label||e.globals.memory.methodsToExec.splice(t,1);Array.prototype.forEach.call(i,t=>{for(;t.firstChild;)t.removeChild(t.firstChild)})}removeAnnotation(t,e){const i=t.w;this._removeAnnotationTooltip(i);const s=i.dom.baseEl.querySelectorAll(`.${e}`);s&&(i.globals.memory.methodsToExec=i.globals.memory.methodsToExec.filter(t=>t.id!==e),Object.keys(i.config.annotations).forEach(t=>{const s=i.config.annotations[t];Array.isArray(s)&&(i.config.annotations[t]=s.filter(t=>t.id!==e))}),Array.prototype.forEach.call(s,t=>{t.parentElement.removeChild(t)}))}}});function Ae(t,e){if(!(e>0))return[];if(1===e)return[o({},t)];const i=t.width>=t.height,s=i?t.width:t.height,a=i?t.height:t.width,r=a>0?s/a:e;let n=Math.max(1,Math.ceil(Math.sqrt(r*e)));n>e&&(n=e);const l=Math.floor(e/n);let h=e-l*n;const c=[],d=s/n;let u=0;for(let e=0;e<n;e++){const e=l+(h>0?1:0);h>0&&h--;const s=e>0?a/e:0;for(let a=0;a<e;a++)c.push(i?{x:t.x+u,y:t.y+a*s,width:d,height:s}:{x:t.x+a*s,y:t.y+u,width:s,height:d});u+=d}return c}function Se(t,e,i){if(!(e>0))return[];const s=t.width>=t.height,a=s?t.width:t.height,r=s?t.height:t.width,n=s?t.y:t.x,o=n+r,l=r>0?a/r:e;let h=Math.max(Math.ceil(Math.sqrt(l*e)),Math.ceil(a/16));h>=1||(h=1),h>e&&(h=e);const c=Math.floor(e/h);let d=e-c*h;const u=[],p=a/h;let g=s?t.x:t.y;for(let t=0;t<h;t++){const t=c+(d>0?1:0);d>0&&d--;const e=[],a=i(g,g+p,s);if(Array.isArray(a))for(let t=0;t<a.length;t++){const i=a[t];if(!i)continue;const s=Math.max(n,Math.min(i[0],i[1])),r=Math.min(o,Math.max(i[0],i[1]));r>s&&e.push([s,r])}e.length||e.push([n,o]);const r=e.reduce((t,e)=>t+(e[1]-e[0]),0),l=e.map(i=>r>0?(i[1]-i[0])/r*t:t/e.length),h=l.map(t=>Math.floor(t));let f=h.reduce((t,e)=>t+e,0);const m=l.map((t,e)=>({i:e,frac:t-Math.floor(t)})).sort((t,e)=>e.frac-t.frac);for(let e=0;f<t;e++,f++)h[m[e%m.length].i]++;for(let t=0;t<e.length;t++){const i=h[t];if(i<=0)continue;const a=e[t][0],r=(e[t][1]-a)/i;for(let t=0;t<i;t++)u.push(s?{x:g,y:a+t*r,width:p,height:r}:{x:a+t*r,y:g,width:r,height:p})}g+=p}return u}function Ce(t,e,i,s,a,r){let n=a===i?0:Math.round((t-i)/(a-i)*32767),o=r===s?0:Math.round((e-s)/(r-s)*32767),l=0;for(let t=32768;t>=1;t/=2){const e=(n&t)>0?1:0,i=(o&t)>0?1:0;if(l+=t*t*(3*e^i),0===i){1===e&&(n=t-1-n,o=t-1-o);const i=n;n=o,o=i}}return l}function ke(t,e){let i=1/0,s=1/0,a=-1/0,r=-1/0;const n=t.map(t=>{const[n,o]=e(t);return n<i&&(i=n),n>a&&(a=n),o<s&&(s=o),o>r&&(r=o),[n,o]});return t.map((t,e)=>({item:t,d:Ce(n[e][0],n[e][1],i,s,a,r)})).sort((t,e)=>t.d-e.d).map(t=>t.item)}function Pe(t){if(!t||"string"!=typeof t)return null;const e=t.trim();if("#"===e[0]){const t=e.slice(1);return 3===t.length?[parseInt(t[0]+t[0],16),parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),1]:6===t.length||8===t.length?[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16),8===t.length?parseInt(t.slice(6,8),16)/255:1]:null}const i=e.match(/^rgba?\(([^)]+)\)$/i);if(i){const t=i[1].split(",").map(t=>parseFloat(t));return t.length<3||t.some(t=>!isFinite(t))?null:[t[0],t[1],t[2],t.length>3?t[3]:1]}return null}function Le(t,e){const i=Pe(t),s=Pe(e);return i&&s?t=>{const e=Math.round(i[0]+(s[0]-i[0])*t),a=Math.round(i[1]+(s[1]-i[1])*t),r=Math.round(i[2]+(s[2]-i[2])*t),n=i[3]+(s[3]-i[3])*t;return n>=1?`rgb(${e},${a},${r})`:`rgba(${e},${a},${r},${n})`}:null}c.default.registerFeatures({keyboardNavigation:class{constructor(t,e){this.w=t,this.ctx=e,this.seriesIndex=0,this.dataPointIndex=0,this.active=!1,this._tooltipDismissed=!1,this._announceTimer=void 0,this._focusedEl=null,this._hoveredBarEl=null,this._enlargedScatterMarker=null,this._onKeyDown=this._onKeyDown.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this),this._onLegendClick=this._onLegendClick.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._lastPointerDownAt=0}init(){const t=this.w,e=t.dom.Paper.node;if(!e)return;e.setAttribute("tabindex","0"),e.addEventListener("focus",this._onFocus),e.addEventListener("blur",this._onBlur),e.addEventListener("mousedown",this._onPointerDown,{capture:!0}),e.addEventListener("pointerdown",this._onPointerDown,{capture:!0}),e.addEventListener("touchstart",this._onPointerDown,{capture:!0,passive:!0}),e.addEventListener("keydown",this._onKeyDown,{passive:!1}),this.ctx.events.addEventListener("legendClick",this._onLegendClick);const i=t.interact.keyNav,s=e.ownerDocument;t.interact.keyNav=null,!i||s.activeElement&&s.activeElement!==s.body||([this.seriesIndex,this.dataPointIndex,,this._tooltipDismissed]=i,i[2]||this.notePointerFocus(),e.focus({preventScroll:!0}))}destroy(t){var e;const i=this.w,s=i.dom.Paper&&i.dom.Paper.node;this.ctx.events.removeEventListener("legendClick",this._onLegendClick),clearTimeout(this._announceTimer),s&&(t&&(null==(e=s.getRootNode)?void 0:e.call(s).activeElement)===s&&(i.interact.keyNav=[this.seriesIndex,this.dataPointIndex,this.active,this._tooltipDismissed]),s.removeEventListener("focus",this._onFocus),s.removeEventListener("blur",this._onBlur),s.removeEventListener("keydown",this._onKeyDown),s.removeEventListener("mousedown",this._onPointerDown,{capture:!0}),s.removeEventListener("pointerdown",this._onPointerDown,{capture:!0}),s.removeEventListener("touchstart",this._onPointerDown,{capture:!0}))}_onPointerDown(){this._lastPointerDownAt=Date.now()}notePointerFocus(){this._lastPointerDownAt=Date.now()}_onFocus(){this._isNavEnabled()&&(Date.now()-this._lastPointerDownAt<100||(this.active=!0,this._clampCursor(),this._snapToVisibleRange(),this._tooltipDismissed||this._showCurrentPoint()))}_onBlur(){this.active=!1,this._tooltipDismissed=!1,this._hideFocus()}_onLegendClick(){this.active&&(this.active=!1,this._hideFocus())}_onKeyDown(t){var e,i,s;if(this._isNavEnabled()&&this.active){if(t.shiftKey&&("ArrowRight"===t.key||"ArrowLeft"===t.key)&&this._canPan())return t.preventDefault(),void this._panBy("ArrowRight"===t.key?1:-1);switch(t.key){case"ArrowRight":t.preventDefault(),this._move(0,1);break;case"ArrowLeft":t.preventDefault(),this._move(0,-1);break;case"ArrowUp":t.preventDefault(),this._move(-1,0);break;case"ArrowDown":t.preventDefault(),this._move(1,0);break;case"Home":t.preventDefault(),this._seek(0,1),this._showCurrentPoint();break;case"End":t.preventDefault(),this._seek(this._getDataPointCount(this.seriesIndex)-1,-1),this._showCurrentPoint();break;case"Enter":case" ":t.preventDefault(),this._fireClick(t);break;case"+":case"=":this._canZoom()&&(t.preventDefault(),null==(e=this.ctx.toolbar)||e.handleZoomIn(),this._announce("Zoomed in"));break;case"-":case"_":this._canZoom()&&(t.preventDefault(),null==(i=this.ctx.toolbar)||i.handleZoomOut(),this._announce("Zoomed out"));break;case"0":this._canZoom()&&this.w.interact.zoomed&&(t.preventDefault(),null==(s=this.ctx.toolbar)||s.handleZoomReset(),this._announce("Zoom reset"));break;case"Escape":t.preventDefault(),this._tooltipDismissed?(this.active=!1,this._tooltipDismissed=!1,this._hideFocus()):(this._tooltipDismissed=!0,this._hideFocus())}}}_canZoom(){var t,e;const i=this.w,s=null==(t=this.ctx.toolbar)?void 0:t._currentXRange();return Boolean(i.globals.axisCharts&&(null==(e=i.config.chart.zoom)?void 0:e.enabled)&&(i.axisFlags.isXNumeric||i.config.xaxis.convertedCatToNumeric||i.axisFlags.isRangeBar)&&(null==s?void 0:s.minX)<(null==s?void 0:s.maxX))}_canPan(){return this._canZoom()&&this.w.interact.zoomed}_panBy(t){var e;null==(e=this.ctx.zoomPanSelection)||e.panBy(t/10),this._announce(t>0?"Panned right":"Panned left")}_move(t,e){var i;const s=this.w,a=s.config.chart.accessibility.keyboard.navigation.wrapAround;if(0!==t){const e=this.w.globals.tooltip,r=s.config.chart.type;if(!("heatmap"===r||"treemap"===r||"radialBar"===r)&&(null==e?void 0:e.ttItems)&&e.tConfig.shared){const t=this.dataPointIndex;if(e.tooltipUtil&&e.tooltipUtil.isXoverlap(t)&&e.tooltipUtil.isInitialSeriesSameLen())return}"heatmap"!==r||(null==(i=s.config.yaxis[0])?void 0:i.reversed)||(t=-t);const n=this._getSeriesCount();let o=this.seriesIndex;for(let e=1;e<n;e++){let i=o+t*e;if(a)i=(i+n)%n;else if(i<0||i>=n)break;if(!s.globals.collapsedSeriesIndices.includes(i)){o=i;break}}this.seriesIndex=o;const l=this._getDataPointCount(o);this.dataPointIndex>=l&&(this.dataPointIndex=l-1)}0!==e&&(this._seek(this.dataPointIndex+e,e),this._isDataPointVisible(this.seriesIndex,this.dataPointIndex)||this._snapToVisibleRangeInDirection(e)),this._showCurrentPoint()}_seek(t,e){const i=this.w,s=i.seriesData.series[this.seriesIndex],a=this._getDataPointCount(this.seriesIndex);for(let r=0;r<a;r++,t+=e){if(i.config.chart.accessibility.keyboard.navigation.wrapAround)t=(t+a)%a;else if(t<0||t>=a)return;if(!Array.isArray(s)||null!==s[t])return void(this.dataPointIndex=t)}}_showCurrentPoint(){const{seriesIndex:t,dataPointIndex:e}=this,i=this.w,s=i.globals.tooltip;if(this._tooltipDismissed=!1,i.interact.capturedSeriesIndex=t,i.interact.capturedDataPointIndex=e,this._applyFocusClass(t,e),!(null==s?void 0:s.ttItems))return this._announce(this._buildPointLabel(t,e));this._showTooltip(t,e,s)}_hideFocus(){var t;const e=this.w,i=e.globals.tooltip;if(this._removeFocusClass(),this._leaveHoveredBar(),!i)return;null==(t=i.tooltipPosition)||t.resetPlacementCache(),i.marker&&i.marker.resetPointsSize(),this._enlargedScatterMarker=null;const s=i.getElTooltip();s&&(s.classList.remove("apexcharts-active"),e.config.chart.accessibility.enabled&&e.config.chart.accessibility.announcements.enabled&&s.setAttribute("aria-hidden","true")),e.dom.baseEl.classList.remove("apexcharts-tooltip-active");const a=i.getElXCrosshairs();a&&a.classList.remove("apexcharts-active")}_showTooltip(t,e,i){const s=this.w,a=s.config.chart.type,r=i.getElTooltip();if(!r)return;const n=i.getCachedDimensions();i.tooltipRect={x:0,y:0,ttWidth:n.ttWidth||0,ttHeight:n.ttHeight||0},this._setSyntheticEvent(t,e,i),s.dom.baseEl.classList.add("apexcharts-tooltip-active"),r.classList.add("apexcharts-active"),s.config.chart.accessibility.enabled&&s.config.chart.accessibility.announcements.enabled&&r.removeAttribute("aria-hidden"),"pie"===a||"donut"===a||"polarArea"===a||"radialBar"===a?this._showTooltipNonAxis(t,e,i,r):"heatmap"===a||"treemap"===a?this._showTooltipHeatTree(t,e,i,r,a):this._isBarLikeSeries(t)?this._showTooltipBar(t,e,i):this._showTooltipAxisLine(t,e,i),i.fixedTooltip&&i.drawFixedTooltipRect()}_isBarLikeSeries(t){var e;const i=this.w,s=i.config.series[t],a=i.globals.comboCharts&&null!=(e=null==s?void 0:s.type)?e:i.config.chart.type;return gt.isBarLikeType(a)}_setSyntheticEvent(t,e,i){const s=this.w,a=s.config.chart.type;let r=0,n=0;const o=this._getFocusableElement(t,e),l=o?null:this._canvasCell(t,e)||this._canvasMark(t,e);if(o){const t=o.getBoundingClientRect();r=t.left+t.width/2,n=t.top+t.height/2}else if(l){const t=gt.plotRect(s);r=t.left+(l.x+l.width/2)*t.zoom,n=t.top+(l.y+l.height/2)*t.zoom}else if(s.globals.pointsArray&&s.globals.pointsArray[t]&&s.globals.pointsArray[t][e]){const a=s.globals.pointsArray[t][e];if(i.getElGrid&&i.getElGrid()){const t=gt.plotRect(s);r=t.left+(a[0]||0)*t.zoom,n=t.top+(a[1]||0)*t.zoom}}else{const t=s.dom.Paper&&s.dom.Paper.node;if(t){const e=t.getBoundingClientRect();r=e.left+e.width/2,n=e.top+e.height/2}}if(!this._isBarLikeSeries(t)&&("line"===a||"area"===a||"rangeArea"===a||"scatter"===a||"bubble"===a||"radar"===a)&&s.globals.pointsArray&&s.globals.pointsArray[t]&&s.globals.pointsArray[t][e]){const a=s.globals.pointsArray[t][e];if(i.getElGrid&&i.getElGrid()){const t=gt.plotRect(s);r=t.left+(a[0]||0)*t.zoom,n=t.top+(a[1]||0)*t.zoom}}i.e={type:"mousemove",clientX:r,clientY:n},i.clientX=r,i.clientY=n}_showTooltipBar(t,e,i){var s,a,r,n;const h=this.w;h.globals.comboCharts&&(i.marker.resetPointsSize(),this._enlargedScatterMarker=null);const c=i.tConfig.shared&&(i.tooltipUtil.isXoverlap(e)||h.globals.isBarHorizontal)&&i.tooltipUtil.isInitialSeriesSameLen(),d=null==(n=null==(r=null==(a=null==(s=h.rangeData.seriesRange)?void 0:s[t])?void 0:a[e])?void 0:r.y)?void 0:n[0];i.tooltipLabels.drawSeriesTexts(l(o(o({ttItems:i.ttItems,i:t,j:e},void 0!==(null==d?void 0:d.y1)&&{y1:d.y1}),void 0!==(null==d?void 0:d.y2)&&{y2:d.y2}),{shared:c}));const u=`.apexcharts-series[data\\:realIndex='${t}']`,p=this._canvasMark(t,e)?null:h.dom.Paper.findOne(`${u} path[j='${e}'], ${u} circle[j='${e}'], ${u} rect[j='${e}']`);if(p){this._leaveHoveredBar();new R(this.w,this.ctx).pathMouseEnter(p,null),this._hoveredBarEl=p}if(h.globals.isBarHorizontal){const s=i.fixedTooltip;if(!s&&!i.showOnIntersect&&!gt.isFollowCursor(h)&&i.tooltipPosition.placeHorizontalSharedTooltip(e))return;const a=this._focusedBarInWrap(t,e,p,i),r=i.getElTooltip();if(a&&r&&!s){const s=i.tooltipRect.ttWidth||0,n=i.tooltipRect.ttHeight||0,o=gt.plotInWrap(h),l={top:o.top,bottom:o.top+h.layout.gridHeight,left:o.left,right:o.left+h.layout.gridWidth},c=i.tooltipPosition.placeOnShortPlot((a.left+a.right)/2,a.top,a.bottom);if(c)i.tooltipPosition.applyTooltipPosition(r,c);else if(h.config.tooltip.arrow)i.tooltipPosition.applyTooltipPosition(r,i.tooltipPosition.placeAroundBar(a,l,e,t));else{const t=i.xyRatios&&null!=i.xyRatios.baseLineInvertedY?l.left+i.xyRatios.baseLineInvertedY:(l.left+l.right)/2;let e=(a.left+a.right)/2<t?a.left-s:a.right;if(gt.isFollowCursor(h)){const t=(a.left+a.right)/2-l.left+15;e=l.left+(t+s>h.layout.gridWidth?t-s:t)}const o=(a.top+a.bottom)/2-n/2;r.style.left=Math.max(Math.min(e,l.right-s),l.left)+"px",r.style.top=Math.max(Math.min(o,l.bottom-n),l.top)+"px",delete r.dataset.placement}}}else this._pointerHoversOneMark(i)?this._hoverFocusedMark(t,e,p,i):i.tooltipPosition.moveStickyTooltipOverBars(e,t)}_pointerHoversOneMark(t){if(!t.showOnIntersect)return!1;return!(this.w.config.chart.group&&"function"==typeof this.ctx.getSyncedCharts&&this.ctx.getSyncedCharts().length>1)}_hoverFocusedMark(t,e,i,s){const a=this.w,r=this._canvasMark(t,e),n=!r&&(null==i?void 0:i.node)&&["apexcharts-bar-area","apexcharts-candlestick-area","apexcharts-boxPlot-area","apexcharts-rangebar-area","apexcharts-violin-area"].some(t=>i.node.classList.contains(t))?i.node:null;if(!r&&!n)return void s.tooltipPosition.moveStickyTooltipOverBars(e,t);const h=a.dom.Paper.node;s.intersect.handleBarTooltip({e:l(o({},s.e),{type:"mousemove",target:n||h,apexHoverTarget:n||h,apexPaintedHit:r}),opt:{paths:n||h,hoverArea:h,elGrid:s.getElGrid(),tooltipEl:s.getElTooltip(),ttItems:s.ttItems}})}_focusedBarInWrap(t,e,i,s){var a,r,n;const o=this.w,l=("violin"===o.config.chart.type||"violin"===(null==(a=o.config.series[t])?void 0:a.type))&&(null==(r=s.intersect)?void 0:r.violinGlyphRect(t,e))||(null==(n=null==i?void 0:i.node)?void 0:n.getBoundingClientRect())||this._canvasMarkRect(t,e);if(!l)return null;const h=o.dom.elWrap.getBoundingClientRect();return{top:l.top-h.top,bottom:l.bottom-h.top,left:l.left-h.left,right:l.right-h.left}}_showTooltipAxisLine(t,e,i){var s;const a=this.w,r=a.config.chart.type,n=i.tConfig.shared&&i.tooltipUtil.isXoverlap(e)&&i.tooltipUtil.isInitialSeriesSameLen();i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,j:e,shared:n});const o="scatter"===r||"bubble"===r||"radar"===r,l=a.globals.markers.largestSize>0&&!a.globals.markers.batched&&"canvas"!==(null==(s=this.ctx.renderer)?void 0:s.kind),h=this._pointerHoversOneMark(i)?this._canvasMarker(t,e):null;h?this._hoverPaintedMarker(h,i):o||l&&!n?this._showScatterBubblePoint(t,e,i)||i.tooltipPosition.moveDynamicPointOnHover(e,t):l?i.marker.enlargePoints(e):n?i.tooltipPosition.moveDynamicPointsOnHover(e):i.tooltipPosition.moveDynamicPointOnHover(e,t)}_canvasMarker(t,e){const i=this.ctx.renderer;return i&&"canvas"===i.kind&&"function"==typeof i.findMarker?i.findMarker(t,e):null}_hoverPaintedMarker(t,e){e.intersect.handlePaintedMarkerTooltip({e:l(o({},e.e),{type:"mousemove"}),opt:{tooltipEl:e.getElTooltip(),ttItems:e.ttItems},marker:{i:t.seriesIndex,j:t.dataPointIndex,cx:t.x,cy:t.y,size:t.size}})}_showScatterBubblePoint(t,e,i){const s=this.w.dom.baseEl;this._enlargedScatterMarker&&(i.marker.oldPointSize(this._enlargedScatterMarker),this._enlargedScatterMarker=null);const a=s.querySelector(`.apexcharts-series[data\\:realIndex='${t}']`);if(!a)return!1;const r=a.querySelector(`.apexcharts-marker[rel='${e}']`);return!!r&&(i.marker.enlargeCurrentPoint(e,r),this._enlargedScatterMarker=r,!0)}_showTooltipNonAxis(t,e,i,s){i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t+e,shared:!1});const a=s.getBoundingClientRect(),r=a.width||i.tooltipRect.ttWidth||0,n=a.height||i.tooltipRect.ttHeight||0,o=i.getSliceAnchor(this._getFocusableElement(t,e));if(o){const t=i.tooltipPosition.placeOverAnchor(o.x,o.y,r,n,10);s.style.left=t.x+"px",s.style.top=t.y+"px"}}_showTooltipHeatTree(t,e,i,s,a){var r,n;const o=this.w;if(gt.isFollowCursor(o)&&this._hoverFocusedCell(t,e,i))return;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,j:e,shared:!1});const l=s.getBoundingClientRect(),h=l.width||i.tooltipRect.ttWidth||0,c=l.height||i.tooltipRect.ttHeight||0,d="heatmap"===a?"apexcharts-heatmap-rect":"apexcharts-treemap-rect",u=o.dom.baseEl.querySelector(`.${d}[i='${t}'][j='${e}']`),p=u?null:this._canvasCell(t,e);if(u||p){const t=o.dom.elWrap.getBoundingClientRect();let e=0,l=0,d=0,g=0;if(u){const s=u.getBoundingClientRect();e=s.left-t.left,l=s.top-t.top,d=s.width,g=s.height;const a=parseFloat(null!=(r=u.getAttribute("cx"))?r:""),o=parseFloat(null!=(n=u.getAttribute("width"))?n:"");i.tooltipPosition.moveXCrosshairs(a+o/2)}else if(p){const t=gt.plotInWrap(o);e=t.left+p.x,l=t.top+p.y,d=p.width,g=p.height,i.tooltipPosition.moveXCrosshairs(p.x+p.width/2)}let f=e+d+h/2;const m=l+g/2-c/2;e+d>o.layout.gridWidth/2&&(f=e-h/2);const x=i.tooltipPosition.shortPlotPlacement,b=i.tooltipPosition.placeOnShortPlot(e+d/2,l,l+g);if(b)return void i.tooltipPosition.applyTooltipPosition(s,b);if("heatmap"===a&&o.config.tooltip.arrow&&!gt.isFollowCursor(o)){const{left:t,top:a}=gt.plotInWrap(o);return void i.tooltipPosition.applyTooltipPosition(s,i.tooltipPosition.placeAroundCell({top:l,bottom:l+g,left:e,right:e+d},{top:a,bottom:a+o.layout.gridHeight,left:t,right:t+o.layout.gridWidth},{el:u,ttWidth:h,ttHeight:c}))}s.style.left=f+"px",s.style.top=m+"px",x&&delete s.dataset.placement}}_hoverFocusedCell(t,e,i){const s=this.w,a=s.config.chart.type,r=i.getElTooltip(),n=s.dom.baseEl.querySelector(`.apexcharts-${a}-rect[i='${t}'][j='${e}']`);if(!r||!n&&!this._canvasCell(t,e))return!1;const h=n||s.dom.Paper.node;s.interact.capturedSeriesIndex=-1,s.interact.capturedDataPointIndex=-1;const c=i.intersect.handleHeatTreeTooltip({e:l(o({},i.e),{type:"mousemove",target:h,apexHoverTarget:h}),opt:{ttItems:i.ttItems},x:0,y:0,type:a}),d=!c.noHit&&s.interact.capturedSeriesIndex===t&&s.interact.capturedDataPointIndex===e;return s.interact.capturedSeriesIndex=t,s.interact.capturedDataPointIndex=e,!!d&&(i.placeCellTooltip(r,c),!0)}_canvasCell(t,e){if("heatmap"!==this.w.config.chart.type)return null;const i=this.ctx.renderer;return i&&"canvas"===i.kind&&"function"==typeof i.findCell?i.findCell(t,e):null}_canvasMark(t,e){if(!this._isBarLikeSeries(t))return null;const i=this.ctx.renderer;return i&&"canvas"===i.kind&&"function"==typeof i.findMark?i.findMark(t,e):null}_canvasMarkRect(t,e){const i=this._canvasMark(t,e);if(!i)return null;const s=gt.plotRect(this.w),a=s.left+i.x*s.zoom,r=s.top+i.y*s.zoom;return{left:a,top:r,right:a+i.width*s.zoom,bottom:r+i.height*s.zoom}}_applyFocusClass(t,e){this._removeFocusClass();const i=this._getFocusableElement(t,e)||this._getBatchedFocusEl(t)||this._drawCanvasFocusRing(t,e);if(i){i.classList.add("apexcharts-keyboard-focused"),i.setAttribute("role","img");const s=this._buildPointLabel(t,e);s&&i.setAttribute("aria-label",s),this._focusedEl=i}}_getBatchedFocusEl(t){return this.w.globals.markers.batched?this.w.dom.baseEl.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] .apexcharts-series-markers path`):null}_drawCanvasFocusRing(t,e){const i=this._canvasCell(t,e);if(!i)return this._drawCanvasMarkFocusRing(t,e);const s=this.w.dom.baseEl.querySelector(`.apexcharts-heatmap .apexcharts-series[rel='${t+1}']`);if(!s)return null;const a=new R(this.w,this.ctx).drawRect(i.x,i.y,i.width,i.height,i.radius,"none");return a.node.classList.add("apexcharts-keyboard-focus-ring"),a.attr({i:t,j:e}),s.insertBefore(a.node,s.firstChild),a.node}_drawCanvasMarkFocusRing(t,e){const i=this._canvasMark(t,e);if(!i)return this._drawCanvasMarkerFocusRing(t,e);const s=this.w,a=this._seriesGroup(t);if(!a)return null;const r=new R(s,this.ctx).drawPath({d:i.d,fill:"none",classes:"apexcharts-keyboard-focus-ring"});return r.attr("clip-path",`url(#gridRectBarMask${s.globals.cuid})`),a.insertBefore(r.node,a.firstChild),r.node}_drawCanvasMarkerFocusRing(t,e){const i=this._canvasMarker(t,e);if(!i)return null;const s=this.w,a=this._seriesGroup(t);if(!a)return null;const r=new R(s,this.ctx).drawPath({d:i.d,fill:"none",classes:"apexcharts-keyboard-focus-ring"});return r.attr("clip-path",`url(#gridRectMarkerMask${s.globals.cuid})`),a.appendChild(r.node),r.node}_removeFocusClass(){this._focusedEl&&(this._focusedEl.classList.remove("apexcharts-keyboard-focused"),this._focusedEl.removeAttribute("role"),this._focusedEl.removeAttribute("aria-label"),this._focusedEl.classList.contains("apexcharts-keyboard-focus-ring")&&this._focusedEl.remove(),this._focusedEl=null)}_buildPointLabel(t,e){var i,s,a,r,n,o,l,h;const c=this.w,d=c.config.chart.type,u=c.seriesData.seriesNames||[],p=c.seriesData.series||[];if("pie"===d||"donut"===d||"polarArea"===d){const t=null!=(s=(null==(i=c.labelData)?void 0:i.labels)&&c.labelData.labels[e])?s:"",a=Array.isArray(p)?p[e]:"";return t?`${t}: ${a}`:`${a}`}if("radialBar"===d){return`${u[t]||`Series ${t+1}`}: ${Array.isArray(p)?p[t]:""}`}const g=u[t]||`Series ${t+1}`,f=(Array.isArray(p[t])?p[t]:[])[e];let m=null==f?"":String(f);const x=null==(r=null==(a=c.formatters)?void 0:a.yLabelFormatters)?void 0:r[t];if("function"==typeof x)try{m=x(f,{seriesIndex:t,dataPointIndex:e,w:c})}catch(t){}let b="";const y=null==(n=c.labelData)?void 0:n.categoryLabels,v=null==(l=null==(o=c.seriesData)?void 0:o.seriesX)?void 0:l[t];if(Array.isArray(y)&&null!=y[e])b=String(y[e]);else if(Array.isArray(v)&&null!=v[e]){const i=null==(h=c.formatters)?void 0:h.xLabelFormatter;if("function"==typeof i)try{b=String(i(v[e],{seriesIndex:t,dataPointIndex:e,w:c}))}catch(t){b=String(v[e])}else b=String(v[e])}return b?`${g}: ${m}, ${b}`:`${g}: ${m}`}_leaveHoveredBar(){if(this._hoveredBarEl){new R(this.w,this.ctx).pathMouseLeave(this._hoveredBarEl,null),this._hoveredBarEl=null}}_getFocusableElement(t,e){var i,s;const a=this.w,r=a.config.chart.type,n=a.dom.baseEl;return"pie"===r||"donut"===r||"polarArea"===r?n.querySelector(`.apexcharts-pie-area[j='${e}']`):"heatmap"===r?n.querySelector(`.apexcharts-heatmap-rect[i='${t}'][j='${e}']`):"treemap"===r?n.querySelector(`.apexcharts-treemap-rect[i='${t}'][j='${e}']`):"radialBar"===r?n.querySelector(`.apexcharts-radialbar-slice-${t}`):this._isBarLikeSeries(t)?this._canvasMark(t,e)?null:null==(i=this._seriesGroup(t))?void 0:i.querySelector(`path[j='${e}']`):null==(s=this._seriesGroup(t))?void 0:s.querySelector(`.apexcharts-marker[rel='${e}']`)}_seriesGroup(t){return Array.from(this.w.dom.baseEl.querySelectorAll(".apexcharts-series")).find(e=>e.getAttribute("data:realIndex")===String(t))}_fireClick(t){var e,i;const s=null==(e=this._focusedEl)?void 0:e.instance,a=this.ctx.pie;s&&new R(this.w,this.ctx).pathMouseDown(s,t),a&&a.getExpandOffset()>0&&a.pieClicked(this.dataPointIndex),null==(i=this.w.globals.tooltip)||i.markerClick(t,this.seriesIndex,this.dataPointIndex)}_isNavEnabled(){const t=this.w.config.chart.accessibility;return t.enabled&&t.keyboard.enabled&&t.keyboard.navigation.enabled}_getSeriesCount(){const t=this.w,e=t.config.chart.type;return"pie"===e||"donut"===e||"polarArea"===e?1:t.seriesData.series.length}_getDataPointCount(t){const e=this.w,i=e.config.chart.type;if("pie"===i||"donut"===i||"polarArea"===i)return e.seriesData.series.length;const s=e.seriesData.series[t];return Array.isArray(s)?s.length:1}_clampCursor(){const t=this._getSeriesCount();this.seriesIndex>=t&&(this.seriesIndex=t-1),this.seriesIndex<0&&(this.seriesIndex=0);const e=this._getDataPointCount(this.seriesIndex);this.dataPointIndex>=e&&(this.dataPointIndex=e-1),this.dataPointIndex<0&&(this.dataPointIndex=0)}_snapToVisibleRange(){const t=this.w,e=t.globals,i=this.seriesIndex;if(!t.interact.zoomed)return;const s=t.seriesData.seriesX&&t.seriesData.seriesX[i];if(!s||!s.length)return;const a=e.minX,r=e.maxX;if(void 0===a||void 0===r)return;const n=s[this.dataPointIndex];if(n>=a&&n<=r)return;const o=s.length;for(let t=0;t<o;t++)if(s[t]>=a&&s[t]<=r)return void(this.dataPointIndex=t)}_snapToVisibleRangeInDirection(t){const e=this.w,i=e.globals,s=this.seriesIndex,a=e.seriesData.seriesX&&e.seriesData.seriesX[s];if(!a||!a.length)return;const r=i.minX,n=i.maxX;if(void 0===r||void 0===n)return;const o=a.length;if(t>=0){for(let t=0;t<o;t++)if(a[t]>=r&&a[t]<=n)return void(this.dataPointIndex=t)}else for(let t=o-1;t>=0;t--)if(a[t]>=r&&a[t]<=n)return void(this.dataPointIndex=t)}_isDataPointVisible(t,e){const i=this.w,s=i.globals;if(!i.interact.zoomed)return!0;const a=i.seriesData.seriesX&&i.seriesData.seriesX[t];if(!a)return!0;const r=a[e];return void 0===r||r>=s.minX&&r<=s.maxX}_announce(t){const e=this.w;if(!e.config.chart.accessibility.announcements.enabled)return;const i=e.dom.baseEl;if(!i)return;const s=i.querySelector(".apexcharts-sr-status");s&&(s.textContent="",clearTimeout(this._announceTimer),this._announceTimer=setTimeout(()=>{s.textContent=t},0))}}});const Me=new Set(["bar","funnel","pyramid","histogram"]),Ie=new Set(["pie","donut","polarArea","radialBar","gauge"]),Ee=new Set(["unit","waffle"]),Fe=new Set(["treemap","sunburst"]),De=new Set(["boxPlot","violin"]);let Te=0;const Re=1500,ze=t=>{t.removeAttribute("opacity"),t.removeAttribute("data-piece-hidden")};function Xe(t){return Me.has(t)?"bar":Ie.has(t)?"radial":Ee.has(t)?"unit":Fe.has(t)?"partition":De.has(t)?"summary":null}c.default.registerFeatures({morphTypeChange:class{constructor(t,e){this.w=t,this.ctx=e,this._snapshot=null,this._shown=!1,this._ghost=null,this._pieceLayer=null,this._pieceCancel=null,this._ghostTimer=void 0}canMorphTypes(t,e){if(t===e)return!1;const i=Xe(t),s=Xe(e);return!(!i||!s)&&("partition"===i==("partition"===s)||"unit"!==i&&"unit"!==s)}isCompatibleSeriesShape(t,e,i){if(!Array.isArray(i)||0===i.length)return!1;const s=Xe(t),a=Xe(e);return"unit"===a?!!i.every(t=>"number"==typeof t)||i.every(t=>t&&"object"==typeof t&&Array.isArray(t.data)):"partition"===a||("radial"===a?!!i.every(t=>"number"==typeof t)||1===i.length&&i[0]&&"object"==typeof i[0]&&Array.isArray(i[0].data):"bar"===a||"summary"===a?i.every(t=>t&&"object"==typeof t&&Array.isArray(t.data)):null!==s&&null!==a)}captureBeforeDestroy({fromType:t,toType:e,newSeries:i}){var s;if(this._snapshot=null,this._shown=!1,this._removeGhost(),this._cancelPieces(),!Nt.isBrowser())return!1;const a=this.w.config.chart.animations;if(!a||!1===a.enabled)return!1;if(a.chartTypeMorph&&!1===a.chartTypeMorph.enabled)return!1;if(a.respectReducedMotion&&f())return!1;if(!this.canMorphTypes(t,e))return!1;if(!this.isCompatibleSeriesShape(t,e,i))return!1;const{marks:r,branches:n,unitDots:o}=this._captureFromDOM(t);if(!r.length)return!1;const l=this._buildMapping(r,t,e,i,n);if(0===l.size)return!1;const h=this.w.globals,c=null==(s=this.w.dom.elGraphical)?void 0:s.node,d=h.layoutTween&&!h.layoutTween.done&&h.layoutTween.graphical===c?h.layoutTween.rect:null,u=h.circleTween,p=u&&!u.done&&(null==c?void 0:c.contains(u.node))?u:null,g=p?p.circle.r/p.target.r:1;this._snapshot={fromType:t,toType:e,mapping:l,oldLayout:{translateX:d?d.x:this.w.layout.translateX||0,translateY:d?d.y:this.w.layout.translateY||0,scale:g,shiftX:p?p.circle.cx-g*p.target.cx:0,shiftY:p?p.circle.cy-g*p.target.cy:0}};const m=Xe(t),x=Xe(e),b=this._canProbePaths();if("unit"===x&&("bar"===m||"summary"===m||"radial"===m&&b)){const t=this._countUnitSeries(i);this._snapshot.pieceOut=t>0&&t<=Re}else if("unit"===m&&("bar"===x||"summary"===x||"radial"===x&&b&&!/^(radialBar|gauge)$/.test(e))){let t=0;o.forEach(e=>{t+=e.length}),t>0&&t<=Re&&(this._snapshot.pieceIn=!0,this._snapshot.sourceDots=o,this._snapshot.keyOrder=this._targetKeys(x,i))}return!this._needsGhost(t,e)||this._snapshot.pieceOut||this._snapshot.pieceIn||this._captureGhost(),this.w.globals.previousPaths=[],!0}_needsGhost(t,e){return"unit"===Xe(t)||"unit"===Xe(e)}_captureGhost(){var t,e;const i=null==(t=this.w.dom)?void 0:t.Paper,s=i&&i.node;if(!s||"function"!=typeof s.cloneNode)return;const a=s.cloneNode(!0),r=[".apexcharts-xaxis",".apexcharts-yaxis",".apexcharts-grid",".apexcharts-legend",".apexcharts-title-text",".apexcharts-subtitle-text",".apexcharts-annotations",".apexcharts-zoom-rect",".apexcharts-selection-rect",".apexcharts-xcrosshairs",".apexcharts-ycrosshairs"];if("function"==typeof a.querySelectorAll&&r.forEach(t=>{a.querySelectorAll(t).forEach(t=>{t.remove()})}),"function"==typeof a.querySelectorAll){const t="-ghost"+ ++Te,e=new Set;a.querySelectorAll("[id]").forEach(i=>{e.add(i.id),i.id+=t}),a.querySelectorAll("*").forEach(i=>{for(const s of i.attributes){const i=s.value.replace(/(url\(['"]?#|^#)([^'")\s]+)/g,(i,s,a)=>e.has(a)?s+a+t:i);i!==s.value&&(s.value=i)}})}null==(e=a.removeAttribute)||e.call(a,"id"),this._ghost=a}_mountGhost(){var t,e,i;const s=this._ghost;if(!s||!Nt.isBrowser())return;const a=null==(t=this.w.dom)?void 0:t.elWrap;if(!a||"function"!=typeof a.appendChild)return void(this._ghost=null);const r=s.style;r&&(r.position="absolute",r.left="0",r.top="0",r.background="transparent",r.pointerEvents="none",r.opacity="1"),null==(e=s.setAttribute)||e.call(s,"aria-hidden","true"),null==(i=s.setAttribute)||i.call(s,"class","apexcharts-morph-ghost"),a.appendChild(s);const n=this.getSpeed(),o=Math.max(120,Math.round(.55*n));ft.requestAnimationFrame(()=>{r&&(r.transition=`opacity ${o}ms ease-in`,r.opacity="0")}),this._ghostTimer=setTimeout(()=>this._removeGhost(),o+60)}_removeGhost(){clearTimeout(this._ghostTimer);const t=this._ghost;this._ghost=null,null==t||t.remove()}_countUnitSeries(t){if(!Array.isArray(t))return 0;let e=0;for(const i of t){if(!i||"object"!=typeof i||!Array.isArray(i.data))return 0;e+=i.data.length}return e}usesPieceTakeover(){return!(!this._snapshot||!this._snapshot.pieceOut)}claimsTargetMark(t,e){return!!(this._snapshot&&this._snapshot.pieceIn&&this._snapshot.mapping.has(`${t}:${e}`))}_makePieceLayer(){var t,e;const i=null==(t=this.w.dom)?void 0:t.elGraphical,s=i&&i.node;if(!s||"function"!=typeof s.appendChild)return null;const a=ft.createElementNS("http://www.w3.org/2000/svg","g");if(!a)return null;a.setAttribute("class","apexcharts-morph-pieces"),a.setAttribute("pointer-events","none");const r=null==(e=this.w.globals)?void 0:e.cuid;return r&&a.setAttribute("clip-path",`url(#gridRectBarMask${r})`),s.appendChild(a),this._pieceLayer=a,a}_revealPieceHidden(){var t;const e=null==(t=this.w.globals.dom)?void 0:t.baseEl;e&&"function"==typeof e.querySelectorAll&&e.querySelectorAll("[data-piece-hidden]").forEach(ze)}_cancelPieces(){this._pieceCancel&&(this._pieceCancel(),this._pieceCancel=null);const t=this._pieceLayer;this._pieceLayer=null,null==t||t.remove(),this._revealPieceHidden()}_canProbePaths(){if(!Nt.isBrowser())return!1;const t=ft.createElementNS("http://www.w3.org/2000/svg","path");return!!t&&"function"==typeof t.isPointInFill}_makeExtentProber(t,e,i){const s=i.ownerDocument.createElementNS("http://www.w3.org/2000/svg","path");s.setAttribute("d",t),s.setAttribute("fill","#000"),s.setAttribute("stroke","#000"),s.setAttribute("stroke-width","3"),s.setAttribute("visibility","hidden"),i.appendChild(s);const a=s.ownerSVGElement;if("function"!=typeof s.isPointInFill||!a||"function"!=typeof a.createSVGPoint)return s.remove(),null;const r=a.createSVGPoint(),n=(t,e)=>{r.x=t,r.y=e;const i=s;return i.isPointInFill(r)||i.isPointInStroke(r)},o=48;return{intervalsAt:(t,i,s)=>{const a=s?e.y:e.x,r=a+(s?e.height:e.width);if(!(r>a))return null;const l=(t,e)=>s?n(e,t):n(t,e),h=[t+.1*(i-t),(t+i)/2,i-.1*(i-t)],c=(t,e,i)=>{let s=e,a=t;for(let t=0;t<6;t++){const t=(s+a)/2;l(t,i)?a=t:s=t}return(s+a)/2},d=(r-a)/o,u=new Array(49).fill(null);let p=!1;for(const t of h)for(let e=0;e<=o;e++)null===u[e]&&l(a+e*d,t)&&(u[e]=t,p=!0);if(!p)return null;const g=[];let f=-1;for(let t=0;t<=49;t++){const e=t<=o&&null!==u[t];if(e&&f<0&&(f=t),!e&&f>=0){const e=t-1,i=u[f],s=0===f?a:c(a+f*d,a+(f-1)*d,i),n=e===o?r:c(a+e*d,a+(e+1)*d,u[e]);n>s&&g.push([s,n]),f=-1}}return g.length?g:null},dispose:()=>{s.remove()}}}_separatePieces(){var t;const e=this._snapshot,i=null==(t=this.w.globals.dom)?void 0:t.baseEl;if(!e||!i)return this._revealPieceHidden();const s=this._readUnitDots(i,new Map);let a=0;if(s.forEach(t=>{a+=t.length}),0===a||a>Re)return this._revealPieceHidden();const r=this._makePieceLayer();if(!r)return this._revealPieceHidden();const n=[],o=r.ownerDocument,l=o.createDocumentFragment(),h=Xe(e.fromType),c="summary"===h||"radial"===h;if(Array.from(s.keys()).sort((t,e)=>t-e).forEach(t=>{var i;const a=s.get(t),h=this.getInitialBBoxFor(t),d=e.mapping.get(`${t}:0`);if(!h||!d)return void a.forEach(t=>ze(t.el));const u=d.fill&&0!==d.fill.indexOf("url(")?d.fill:(null==(i=this.w.globals.colors)?void 0:i[t])||a[0].fill;let p=null;if(c){const e=this.getInitialPathFor(t,0);e&&(p=this._makeExtentProber(e,h,r))}const g=p?Se(h,a.length,p.intervalsAt):Ae(h,a.length);p&&p.dispose();const f=ke(g,t=>[t.x+t.width/2,t.y+t.height/2]),m=ke(a,t=>[t.x,t.y]);for(let e=0;e<m.length;e++){const i=f[e],s=m[e],a=o.createElementNS("http://www.w3.org/2000/svg","rect");a.setAttribute("data-i",String(t)),a.setAttribute("data-key",s.el.getAttribute("data-key")),a.setAttribute("x",String(i.x)),a.setAttribute("y",String(i.y)),a.setAttribute("width",String(i.width)),a.setAttribute("height",String(i.height)),a.setAttribute("rx","0"),a.setAttribute("fill",String(u)),l.appendChild(a),n.push({el:a,from:{x:i.x,y:i.y,width:i.width,height:i.height,rx:0},to:{x:s.x-s.r,y:s.y-s.r,width:2*s.r,height:2*s.r,rx:s.r},fill:Le(u,s.fill),fillEnd:s.fill,delay:0,meta:{dotEl:s.el}})}}),r.appendChild(l),!n.length)return this._cancelPieces();this._runPieces(n,t=>{ze(t.meta.dotEl),t.el.remove()})}_readUnitDots(t,e){return t.querySelectorAll(".apexcharts-unit-area").forEach(t=>{var i;const s=parseInt(null!=(i=t.getAttribute("i"))?i:"",10);if(isNaN(s))return;const a=e=>parseFloat(t.getAttribute(e)),r=t.getAttribute("cx"),n=a("width")||0,o=a("height")||0,l=null!=r?parseFloat(r):a("x")+n/2,h=null!=r?a("cy"):a("y")+o/2,c=(null!=r?a("r"):Math.max(n,o)/2)||3;if(!isFinite(l)||!isFinite(h))return;let d=e.get(s);d||e.set(s,d=[]),d.push({el:t,x:l,y:h,r:c,fill:t.getAttribute("fill")})}),e}_combinePieces(){var t,e;const i=this._snapshot,s=null==(t=this.w.globals.dom)?void 0:t.baseEl;if(!(i&&i.sourceDots&&i.keyOrder&&s))return this._revealPieceHidden();const a=this._collectTargetMarks(i.toType);if(!a.size)return this._revealPieceHidden();const{dx:r,dy:n}=this._oldToNew(),o=Array.from(i.sourceDots.keys()).sort((t,e)=>t-e),l=this._makePieceLayer();if(!l)return this._revealPieceHidden();const h=l.ownerDocument,c=h.createDocumentFragment(),d=[],u=Xe(i.toType),p="summary"===u||"radial"===u;for(let t=0;t<o.length;t++){const s=i.sourceDots.get(o[t]),u=i.keyOrder[o[t]],g=u?a.get(u):null,f=g&&this._markD(g),m=f&&this._pathBBox(f);if(!m||!s||!s.length){g&&g.els.forEach(ze);continue}const x={x:m.minX,y:m.minY,width:m.maxX-m.minX,height:m.maxY-m.minY},b=g.fill&&0!==g.fill.indexOf("url(")?g.fill:(null==(e=this.w.globals.colors)?void 0:e[g.realIndex])||s[0].fill,y=p?this._makeExtentProber(f,x,l):null,v=y?Se(x,s.length,y.intervalsAt):Ae(x,s.length);y&&y.dispose();const w=ke(v,t=>[t.x+t.width/2,t.y+t.height/2]),_=ke(s,t=>[t.x,t.y]),A={remaining:_.length,els:g.els,g:c.appendChild(h.createElementNS("http://www.w3.org/2000/svg","g"))};for(let t=0;t<_.length;t++){const e=_[t],i=w[t],s=h.createElementNS("http://www.w3.org/2000/svg","rect"),a=e.x+r-e.r,o=e.y+n-e.r;s.setAttribute("data-key",u),s.setAttribute("x",String(a)),s.setAttribute("y",String(o)),s.setAttribute("width",String(2*e.r)),s.setAttribute("height",String(2*e.r)),s.setAttribute("rx",String(e.r)),s.setAttribute("fill",String(e.fill||b)),A.g.appendChild(s),d.push({el:s,from:{x:a,y:o,width:2*e.r,height:2*e.r,rx:e.r},to:{x:i.x,y:i.y,width:i.width,height:i.height,rx:0},fill:Le(e.fill,b),fillEnd:String(b),delay:0,meta:{markState:A}})}}if(l.appendChild(c),!d.length)return this._cancelPieces();this._runPieces(d,t=>{const e=t.meta.markState;e.remaining--,0===e.remaining&&(e.els.forEach(ze),e.g.remove())})}_markD(t){return t.d||t.els.map(t=>t.getAttribute("pathTo")||t.getAttribute("d")).filter(Boolean).join(" ")}_runPieces(t,e){var i,s;const a=this.getSpeed(),r=Math.min(300,.35*a),n=Math.max(180,a-r);for(let e=0;e<t.length;e++)t[e].delay=t.length>1?e/(t.length-1)*r:0;const o=this.w.config.chart.animations;this._pieceCancel=function({pieces:t,duration:e,ease:i,onPieceDone:s,onAllDone:a,alive:r}){let n=!1;const o=performance.now(),l=Math.max(1,e),h=(t,e)=>{const i=t.from,s=t.to,a=t.el;a.setAttribute("x",String(i.x+(s.x-i.x)*e)),a.setAttribute("y",String(i.y+(s.y-i.y)*e)),a.setAttribute("width",String(Math.max(0,i.width+(s.width-i.width)*e))),a.setAttribute("height",String(Math.max(0,i.height+(s.height-i.height)*e))),a.setAttribute("rx",String(Math.max(0,i.rx+(s.rx-i.rx)*e))),t.fill?a.setAttribute("fill",t.fill(e)):e>=1&&t.fillEnd&&a.setAttribute("fill",t.fillEnd)},c=e=>{if(n||r&&!r())return;const d=e-o;let u=!1;for(let e=0;e<t.length;e++){const a=t[e];if(a._done)continue;const r=(d-a.delay)/l;if(r<1&&(u=!0),r<=0)continue;const n=Math.min(1,r);h(a,i(n)),n>=1&&(a._done=!0,s&&s(a))}u?ft.requestAnimationFrame(c):a&&a()};return ft.requestAnimationFrame(c),()=>{n=!0}}({pieces:t,duration:n,ease:w(null!=(s=null==(i=o.dynamicAnimation)?void 0:i.easing)?s:o.easing),onPieceDone:e,alive:()=>!this.w.globals.isDestroyed,onAllDone:()=>{this._pieceCancel=null,this._cancelPieces()}})}_collectTargetMarks(t){var e;const i=null==(e=this.w.globals.dom)?void 0:e.baseEl,s=new Map;if(!i)return s;const a=Xe(t);if("radial"===a)return i.querySelectorAll(".apexcharts-pie-series .apexcharts-pie-area").forEach((t,e)=>{const i=t.getAttribute("data:pathFinal")||t.getAttribute("d");i&&i.trim()&&s.set(`${e}:0`,{realIndex:e,d:i,fill:t.getAttribute("fill"),els:[t]})}),s;const r="summary"===a?`.apexcharts-${t}-series`:".apexcharts-bar-series";return i.querySelectorAll(`${r} .apexcharts-series`).forEach(t=>{var e;const i=parseInt(null!=(e=t.getAttribute("data:realIndex"))?e:"0",10)||0;let a=0;t.querySelectorAll("path[pathTo]:not(.apexcharts-highlight-part)").forEach(t=>{var e;const r=t.getAttribute("pathTo")||t.getAttribute("d");if(!r||!r.trim())return;const n=parseInt(null!=(e=t.getAttribute("j"))?e:"",10),o=isNaN(n)?a++:n,l=`${i}:${o}`,h=s.get(l);h?h.els.push(t):s.set(l,{realIndex:i,fill:t.getAttribute("fill"),els:[t]})})}),s}_captureFromDOM(t){var e;const i=null==(e=this.w.globals.dom)?void 0:e.baseEl;if(!i)return{marks:[],branches:[],unitDots:new Map};const s=[],a=[],r=new Map,n=Xe(t);if("bar"===n){i.querySelectorAll(".apexcharts-bar-series .apexcharts-series").forEach(t=>{var e;const i=parseInt(null!=(e=t.getAttribute("data:realIndex"))?e:"0",10);t.querySelectorAll("path[pathTo]:not(.apexcharts-highlight-part)").forEach((t,e)=>{const a=t.getAttribute("d")||t.getAttribute("pathTo");a&&s.push({realIndex:i,j:e,d:a,fill:t.getAttribute("fill")})})})}else if("summary"===n){const e=new Map;i.querySelectorAll(`.apexcharts-${t}-area`).forEach(t=>{var i,s;const a=parseInt(null!=(i=t.getAttribute("j"))?i:"",10);if(isNaN(a))return;const r=t.getAttribute("d")||t.getAttribute("pathTo");if(!r||!r.trim())return;const n="function"==typeof t.closest?t.closest(".apexcharts-series"):null,o=parseInt(null!=(s=null==n?void 0:n.getAttribute("data:realIndex"))?s:"0",10)||0,l=`${o}:${a}`,h=e.get(l);h?h.d+=` ${r}`:e.set(l,{realIndex:o,j:a,d:r,fill:t.getAttribute("fill")})}),Array.from(e.values()).sort((t,e)=>t.realIndex-e.realIndex||t.j-e.j).forEach(t=>s.push(t))}else if("partition"===n)if("treemap"===t){const t=t=>{var e,i,s,a;const r=parseFloat(null!=(e=t.getAttribute("x"))?e:""),n=parseFloat(null!=(i=t.getAttribute("y"))?i:""),o=parseFloat(null!=(s=t.getAttribute("width"))?s:""),l=parseFloat(null!=(a=t.getAttribute("height"))?a:"");return[r,n,o,l].every(t=>isFinite(t))?`M ${r} ${n} L ${r+o} ${n} L ${r+o} ${n+l} L ${r} ${n+l} Z`:null};i.querySelectorAll(".apexcharts-treemap-rect").forEach(e=>{var i,a;const r=t(e);r&&s.push({realIndex:parseInt(null!=(i=e.getAttribute("i"))?i:"0",10)||0,j:parseInt(null!=(a=e.getAttribute("j"))?a:"0",10)||0,d:r,fill:e.getAttribute("fill"),key:e.getAttribute("data:key")||null})});i.querySelectorAll(".apexcharts-treemap-parent-rect").forEach(e=>{const i=t(e),s=e.getAttribute("data:key");i&&s&&a.push({key:s,d:i,fill:e.getAttribute("fill")})})}else{const t=i.querySelectorAll(".apexcharts-sunburst-arc"),e=[];t.forEach(t=>{"true"===t.getAttribute("data:leaf")&&e.push(t)});(e.length?e:Array.from(t)).forEach((t,e)=>{const i=t.getAttribute("d");i&&i.trim()&&s.push({realIndex:e,j:0,d:i,fill:t.getAttribute("fill"),key:t.getAttribute("data:key")||null})}),t.forEach(t=>{if("true"===t.getAttribute("data:leaf"))return;const e=t.getAttribute("d"),i=t.getAttribute("data:key");e&&e.trim()&&i&&a.push({key:i,d:e,fill:t.getAttribute("fill")})})}else if("unit"===n)this._readUnitDots(i,r),Array.from(r.keys()).sort((t,e)=>t-e).forEach(t=>{const e=r.get(t),i=e.map(t=>t.x),a=e.map(t=>t.y),n=Math.min(...i)-2,o=Math.min(...a)-2,l=Math.max(...i)+2,h=Math.max(...a)+2;s.push({realIndex:t,j:0,d:`M ${n} ${o} L ${l} ${o} L ${l} ${h} L ${n} ${h} Z`,fill:e[0].fill})});else if("radial"===n)if("radialBar"===t||"gauge"===t){const t=this.w.globals.circleGeometry,e=t?t.cx:this.w.layout.gridWidth/2,a=t?t.cy:this.w.layout.gridHeight/2;i.querySelectorAll(".apexcharts-radial-series .apexcharts-radialbar-area").forEach(t=>{var i;const r=t.parentElement,n=parseInt(null!=(i=null==r?void 0:r.getAttribute("data:realIndex"))?i:"0",10),o=t.getAttribute("d");if(!o)return;const l=parseFloat(t.getAttribute("stroke-width")||"0"),h=l>1&&this._radialArcToFilledSegment(o,l,e,a)||o;s.push({realIndex:n,j:0,d:h,fill:t.getAttribute("stroke")})})}else{i.querySelectorAll(".apexcharts-pie-series .apexcharts-pie-area").forEach((t,e)=>{const i=t.getAttribute("d");i&&s.push({realIndex:e,j:0,d:i,fill:t.getAttribute("fill")})})}return{marks:s,branches:a,unitDots:r}}_radialArcToFilledSegment(t,e,i,s){const a=t.match(/M\s*(-?[\d.]+)\s+(-?[\d.]+)\s+A\s*(-?[\d.]+)\s+(?:-?[\d.]+)\s+(?:-?[\d.]+)\s+(\d)\s+(\d)\s+(-?[\d.]+)\s+(-?[\d.]+)/);if(!a)return null;const r=parseFloat(a[1]),n=parseFloat(a[2]),o=parseFloat(a[3]),l=parseInt(a[4],10),h=parseInt(a[5],10),c=parseFloat(a[6]),d=parseFloat(a[7]);if(!isFinite(o)||o<=0)return null;const u=e/2,p=o+u,g=Math.max(0,o-u),f=(t,e,a)=>{const r=t-i,n=e-s,o=Math.sqrt(r*r+n*n);if(0===o)return{x:i,y:s};const l=a/o;return{x:i+r*l,y:s+n*l}},m=f(r,n,p),x=f(c,d,p),b=f(r,n,g),y=f(c,d,g),v=h?0:1;return`M ${m.x} ${m.y} A ${p} ${p} 0 ${l} ${h} ${x.x} ${x.y} L ${y.x} ${y.y} A ${g} ${g} 0 ${l} ${v} ${b.x} ${b.y} Z`}buildRingSegmentPath(t,e,i,s,a,r){const n=s/2,o=i+n,l=Math.max(0,i-n),h=(a-90)*Math.PI/180,c=(r-90)*Math.PI/180,d=t+o*Math.cos(h),u=e+o*Math.sin(h),p=t+o*Math.cos(c),g=e+o*Math.sin(c),f=t+l*Math.cos(h),m=e+l*Math.sin(h),x=t+l*Math.cos(c),b=e+l*Math.sin(c),y=r>a?1:0,v=Math.abs(r-a)>180?1:0;return`M ${d} ${u} A ${o} ${o} 0 ${v} ${y} ${p} ${g} L ${x} ${b} A ${l} ${l} 0 ${v} ${1-y} ${f} ${m} Z`}getFromType(){return this._snapshot?this._snapshot.fromType:null}_buildMapping(t,e,i,s,a){const r=new Map,n=Xe(i),o=t.slice().sort((t,e)=>t.realIndex-e.realIndex||t.j-e.j);if("partition"===n&&a&&a.length){const t=o.filter(t=>t.key);t.length===o.length&&(t.forEach(t=>{r.set(`key:${t.key}`,{d:t.d,fill:t.fill})}),a.forEach(t=>{r.set(`key:${t.key}`,{d:t.d,fill:t.fill})}))}const l="unit"===Xe(e);if("radial"===n||"unit"===n||"partition"===n)return o.forEach((t,e)=>{r.set(`${l?t.realIndex:e}:0`,{d:t.d,fill:t.fill})}),r;if("bar"===n||"summary"===n){const t=this._targetKeys(n,s);o.forEach((e,i)=>{const s=t[l?e.realIndex:i];s&&r.set(s,{d:e.d,fill:e.fill})})}return r}_targetKeys(t,e){var i;const s=[],a=Array.isArray(e)?e:[];if("radial"===t){const t=1===a.length&&Array.isArray(null==(i=a[0])?void 0:i.data)?a[0].data.length:a.length;for(let e=0;e<t;e++)s.push(`${e}:0`)}else a.forEach((t,e)=>{const i=t&&Array.isArray(t.data)?t.data:[];for(let t=0;t<i.length;t++)s.push(`${e}:${t}`)});return s}isActive(){return null!==this._snapshot}getInitialPathFor(t,e){if(!this._snapshot)return null;const i=this._snapshot.mapping.get(`${t}:${e}`);if(!i)return null;const{k:s,dx:a,dy:r}=this._oldToNew();return 1===s&&0===a&&0===r?i.d:this._translatePathD(i.d,a,r,s)}_oldToNew(){var t,e,i;const s=this._snapshot.oldLayout;return{k:null!=(t=s.scale)?t:1,dx:s.translateX+(null!=(e=s.shiftX)?e:0)-(this.w.layout.translateX||0),dy:s.translateY+(null!=(i=s.shiftY)?i:0)-(this.w.layout.translateY||0)}}_translatePathD(t,e,i,s=1){if(0===e&&0===i&&1===s)return t;const a=yt(t),r=t=>t*s+e,n=t=>t*s+i;return a.map(t=>{const e=t[0];return"Z"===e?"Z":"M"===e||"L"===e||"T"===e?`${e} ${r(t[1])} ${n(t[2])}`:"H"===e?`${e} ${r(t[1])}`:"V"===e?`${e} ${n(t[1])}`:"C"===e?`${e} ${r(t[1])} ${n(t[2])} ${r(t[3])} ${n(t[4])} ${r(t[5])} ${n(t[6])}`:"S"===e||"Q"===e?`${e} ${r(t[1])} ${n(t[2])} ${r(t[3])} ${n(t[4])}`:"A"===e?`${e} ${t[1]*s} ${t[2]*s} ${t[3]} ${t[4]} ${t[5]} ${r(t[6])} ${n(t[7])}`:t.join(" ")}).join(" ")}getInitialCenterFor(t){const e=this.getInitialBBoxFor(t);return e?{x:e.x+e.width/2,y:e.y+e.height/2}:null}getInitialPathAt(t){return this.getInitialPathFor(t,0)}getInitialPathForKey(t){return this._snapshot&&t?this.getInitialPathFor("key",t):null}hasKeyedMarks(){if(!this._snapshot)return!1;for(const t of this._snapshot.mapping.keys())if("string"==typeof t&&t.startsWith("key:"))return!0;return!1}getInitialSlotFor(t,e,i){const s=this.getInitialBBoxFor(t);if(!s)return null;const a=s.x+s.width/2,r=s.y+s.height/2;if(!(i>1&&e>=0))return{x:a,y:r};const n=(Math.min(e,i-1)+.5)/i;return s.height>=s.width?{x:a,y:s.y+s.height*(1-n)}:{x:s.x+s.width*n,y:r}}getInitialBBoxFor(t){if(!this._snapshot)return null;const e=this._snapshot.mapping.get(`${t}:0`);if(!e)return null;const i=e.box||(e.box=this._pathBBox(e.d));if(!i)return null;const{k:s,dx:a,dy:r}=this._oldToNew();return{x:i.minX*s+a,y:i.minY*s+r,width:(i.maxX-i.minX)*s,height:(i.maxY-i.minY)*s}}_pathBBox(t){let e=1/0,i=1/0,s=-1/0,a=-1/0,r=0,n=0,o=0,l=0;const h=(t,r)=>{isFinite(t)&&isFinite(r)&&(t<e&&(e=t),t>s&&(s=t),r<i&&(i=r),r>a&&(a=r))};return yt(t).forEach(t=>{const e=t[0];if("Z"===e)return r=o,void(n=l);const i=t.length,s="H"===e?t[1]:"V"===e?r:t[i-2],a="H"===e?n:"V"===e?t[1]:t[i-1];if("A"===e){if(t[1]){const e=(r-s)/2,i=(n-a)/2,o=(t[4]===t[5]?-1:1)*Math.sqrt(Math.max(0,t[1]*t[1]/(e*e+i*i)-1)),l=r-e+o*i,c=n-i-o*e,d=Math.hypot(r-l,n-c),u=Math.atan2(n-c,r-l),p=2*Math.PI;let g=Math.atan2(a-c,s-l)-u;t[5]&&g<0?g+=p:!t[5]&&g>0&&(g-=p);for(let t=0;t<p;t+=Math.PI/2){((g>0?t-u:u-t)%p+p)%p<=Math.abs(g)&&h(l+d*Math.cos(t),c+d*Math.sin(t))}}}else if("H"!==e&&"V"!==e)for(let e=1;e+1<i;e+=2)h(t[e],t[e+1]);h(s,a),r=s,n=a,"M"===e&&(o=s,l=a)}),e>s?null:{minX:e,minY:i,maxX:s,maxY:a}}getSpeed(){const t=this.w.config.chart.animations;return t.chartTypeMorph&&t.chartTypeMorph.speed||t.speed||600}applyChromeFade(){var t;if(!this._snapshot||!Nt.isBrowser())return;this._shown=!0;const e=null==(t=this.w.globals.dom)?void 0:t.baseEl;if(!e||this._snapshot.resume)return;this._snapshot.pieceOut?this._separatePieces():this._snapshot.pieceIn?this._combinePieces():this._mountGhost();const i=this.getSpeed(),s=Array.from(e.querySelectorAll(".apexcharts-xaxis,.apexcharts-yaxis,.apexcharts-grid,.apexcharts-legend,.apexcharts-title-text,.apexcharts-subtitle-text")).filter(t=>t.style),a=(t,e)=>s.forEach(i=>{i.style.opacity=t,null!=e&&(i.style.transition=e)});a("0",`opacity ${i}ms ease-out`);const r=()=>this.w.globals.isDestroyed;ft.requestAnimationFrame(()=>r()||a("1")),setTimeout(()=>r()||a("",""),i+80);const n=this._snapshot;setTimeout(()=>{r()||this._snapshot&&this._snapshot!==n||this.cleanup()},i+100)}retire(){const t=this._snapshot;if(!t||!this._shown)return;const e=this._pieceLayer;this.ctx._unitPieces=t.pieceOut&&e;const i=new Map;null==e||e.querySelectorAll("g").forEach(t=>{const e=t.firstChild&&t.getBBox();e&&i.set(t.firstChild.getAttribute("data-key"),{d:`M${e.x} ${e.y}H${e.x+e.width}V${e.y+e.height}H${e.x}Z`})}),this.cleanup(!0),i.size&&(this._collectTargetMarks(t.toType).forEach((t,e)=>{i.has(e)||i.set(e,{d:this._markD(t)})}),this.w.globals.previousPaths=[],this._snapshot=Object.assign(t,{mapping:i,pieceIn:!1,resume:!0,oldLayout:o({},this.w.layout)}),ft.requestAnimationFrame(()=>{this._snapshot===t&&(this._shown=!0)}))}cleanup(t){this._snapshot=null,this._shown=!1,t||this._removeGhost(),this._cancelPieces()}}});const Oe="__apexcharts_plugins__";function $e(t){return function(){const t=globalThis;return t[Oe]||(t[Oe]={}),t[Oe]}()[t]||null}const We=Object.freeze({"stroke.dashArray":Object.freeze({type:"number"}),"dataLabels.enabledOnSeries":Object.freeze({type:"boolean"})});function Ye(t,e){const i=function(t){return t.weaveClaims||(t.weaveClaims={byOption:new Map}),t.weaveClaims}(t);return i.byOption.has(e)||i.byOption.set(e,[]),i.byOption.get(e)}function He(t,e){const i=We[t],s=[];for(const a of Array.isArray(e)?e:[])!a||"string"!=typeof a.series&&"number"!=typeof a.series?console.warn(`[apexcharts] claim on "${t}": each entry needs a series name or index.`):typeof a.value===i.type?s.push({series:a.series,value:a.value}):console.warn(`[apexcharts] claim on "${t}": expected a ${i.type} for series ${String(a.series)}, got ${typeof a.value}.`);return s}function Be(t,e){if("number"==typeof e)return e;const i=t.config&&t.config.series||[];for(let t=0;t<i.length;t++)if(i[t]&&i[t].name===e)return t;return-1}function Ne(t,e,i,s){if(!t||!t.weaveClaims)return s;const a=t.weaveClaims.byOption.get(e);if(!a||!a.length)return s;let r=s;for(const e of a)for(const s of e.entries)Be(t,s.series)===i&&(r=s.value);return r}const je=["xaxis","yaxis","points","texts","images"];function Ve(t,e){const i=t.globals;return(i.collapsedSeriesIndices||[]).indexOf(e)<0&&(i.ancillaryCollapsedSeriesIndices||[]).indexOf(e)<0}function Ge(t,e){const i=e&&e._derived,s=t=>{if(!i)return"core";for(const[e,s]of i)if(s.indexOf(t)>-1)return e;return"core"};return(t.config.series||[]).map((e,i)=>{const a=e&&e.name?String(e.name):`Series ${i+1}`;return{id:`series:${i}`,kind:"series",label:a,owner:s(a),visible:Ve(t,i)}})}function qe(t){const e=t.config.annotations||{},i=[];for(const t of je){(Array.isArray(e[t])?e[t]:[]).forEach((e,s)=>{e&&i.push({id:e.id?String(e.id):`annotation:${t}:${s}`,kind:"annotation",label:Ze(e,t,s),owner:e.owner?String(e.owner):"core",visible:!0})})}return i}function Ze(t,e,i){const s=t.label&&t.label.text;return s?String(s):t.text?String(t.text):t.id?String(t.id):`${e} annotation ${i+1}`}const Ue=Object.freeze(["layer","derived","reserve","pointer","stroke-info","claim","drawn","observations","scale-orientation","highlight"]),Ke=["updateOptions","updateSeries","appendData","appendSeries","toggleSeries","showSeries","hideSeries","highlightSeries","isSeriesHidden","zoomX","addXaxisAnnotation","addYaxisAnnotation","addPointAnnotation","clearAnnotations","removeAnnotation","dataURI","exportToCSV"];function Je(t){const e={};return Ke.forEach(i=>{"function"==typeof t[i]&&(e[i]=t[i].bind(t))}),Object.freeze(e)}function Qe(t,e){const i=t.ctx,s=t.w,a={name:e.def.name,version:7,get options(){return e.options},on(t,i){const s=e.handlers;return s.has(t)||s.set(t,[]),s.get(t).push(i),a},off(t,i){const s=e.handlers.get(t);if(s){const t=s.indexOf(i);t>-1&&s.splice(t,1)}return a},store:{},layer:i=>t._layer(e.def.name,i||{}),get scales(){return t._currentScales},get data(){return t._lastData||(t._lastData=t._dataSnapshot())},theme:Object.freeze({get mode(){return s.config.theme.mode},get foreColor(){return s.config.chart.foreColor},seriesColor:t=>s.globals.colors[t],token:e=>t._token(e)}),chart:Je(i),get info(){return Object.freeze({type:String(s.config.chart&&(s.config.chart.requestedType||s.config.chart.type)||"line"),axisChart:!0===s.globals.axisCharts,datetimeX:!(!s.config.xaxis||"datetime"!==s.config.xaxis.type),horizontalBars:!!(s.config.plotOptions&&s.config.plotOptions.bar&&s.config.plotOptions.bar.horizontal),dataLabels:Object.freeze({enabled:!(!s.config.dataLabels||!s.config.dataLabels.enabled),enabledOnSeries:Array.isArray(s.config.dataLabels&&s.config.dataLabels.enabledOnSeries)?s.config.dataLabels.enabledOnSeries.slice():null}),stroke:Object.freeze({dashArray:Array.isArray(s.config.stroke&&s.config.stroke.dashArray)?s.config.stroke.dashArray.slice():s.config.stroke&&s.config.stroke.dashArray||0}),title:String(s.config.title&&s.config.title.text||"")})},get categories(){return t._categories()},markDerived:i=>(t._markDerived(e.def.name,i),a),reserve:i=>(t._reserve(e.def.name,i),a),claim(t,i){const a=function(t,e,i,s){if(!Object.prototype.hasOwnProperty.call(We,i))return console.warn(`[apexcharts] "${i}" is not a claimable option. Claimable: ${Object.keys(We).join(", ")}.`),null;const a={owner:e,option:i,entries:He(i,s)};return Ye(t,i).push(a),a}(s,e.def.name,t,i);return a?Object.freeze({release(){!function(t,e){if(!t.weaveClaims||!e)return;const i=t.weaveClaims.byOption.get(e.option);if(!i)return;const s=i.indexOf(e);s>-1&&i.splice(s,1)}(s,a)},update(e){a.entries=He(t,e)}}):null},highlight:i=>t._highlight(e.def.name,i),drawn:()=>Object.freeze(function(t,e){const i=[];if(e&&e._declared)for(const[t,s]of e._declared)for(const e of s)i.push({id:`overlay:${t}:${e.id}`,kind:"overlay",label:e.label,owner:t,visible:!1!==e.visible});return[...Ge(t,e),...qe(t),...i]}(s,t).map(t=>Object.freeze(t))),declare:i=>(t._declare(e.def.name,i),a),pointer:i=>t._onPointer(e.def.name,i),emit(t,s){i.events.fireEvent(`plugin:${e.def.name}:${t}`,[i,s])},get el(){return s.dom.baseEl}},r=ti,n=Ue.filter(t=>r[t](a)),o=new Set(n),l=a;return l.capabilities=Object.freeze(n),l.can=t=>o.has(t),Object.freeze(a)}const ti={layer:t=>"function"==typeof t.layer,derived:t=>"function"==typeof t.markDerived,reserve:t=>"function"==typeof t.reserve,pointer:t=>"function"==typeof t.pointer,"stroke-info":t=>!(!t.info||!t.info.stroke),claim:t=>"function"==typeof t.claim,drawn:t=>"function"==typeof t.drawn&&"function"==typeof t.declare,observations:()=>!0,"scale-orientation":()=>!0,highlight:t=>"function"==typeof t.highlight};function ei(t){const e=[];for(const i of Array.isArray(t)?t:[])!i||"string"!=typeof i.series&&"number"!=typeof i.series?console.warn("[apexcharts] highlight: each entry needs a series name or index."):Array.isArray(i.values)?e.push({series:i.series,values:i.values.map(t=>"number"==typeof t&&Number.isFinite(t)?t:null)}):console.warn(`[apexcharts] highlight: expected an array of values for series ${String(i.series)}, got ${typeof i.values}.`);return e}const ii=class t{constructor(t,e){this.w=t,this.ctx=e,this.active=[],this._layers=new Map,this._currentScales=null,this._lastPluginsRef=null,this._lastData=null,this._updatedWired=!1,this._derived=null,this._reserved=null,this._reserveTimer=null,this._highlightTimer=null,this._pointerSubs=null,this._declared=null,this._pointerWired=null,this._onUpdated=this._onUpdated.bind(this),this._init()}_init(){(this.w.config.plugins||[]).map((t,e)=>({entry:t,order:null!=t.order?t.order:e})).sort((t,e)=>t.order-e.order).forEach(t=>this._activate(t.entry)),this._lastPluginsRef=this.w.config.plugins,this._wireUpdated()}_wireUpdated(){this._updatedWired||(this.ctx.addEventListener("updated",this._onUpdated),this._updatedWired=!0)}_onUpdated(){this._repairInitialSeries(),this.dispatch("afterUpdate",{pass:"update"})}_activate(t){const e=$e(t.name);if(!e)return void console.error(`[apexcharts] plugin "${t.name}" is not registered.`);const i=null!=e.apiVersion?Math.trunc(e.apiVersion):1;if(!(i>=1)||i>7)return void console.error(`[apexcharts] plugin "${e.name}" targets Weave API v${e.apiVersion}, host is v7; skipped.`);const s={def:e,options:Object.freeze(o({},t.options||{})),handlers:new Map,disabled:!1,failures:0,api:null};s.api=Qe(this,s),this.active.push(s),this._guard(s,"setup",()=>e.setup(s.api))}dispatch(t,e){if("draw"===t&&(this._reconcile(),this._resetLayers()),this._lastData=null,!this.active.length)return;"afterParse"===t?this._currentScales=null:e&&"xyRatios"in e&&this._setScales(e.xyRatios);const i=e&&e.pass||"full",s=this;let a=null;for(const e of this.active){if(e.disabled)continue;const r=e.handlers.get(t);if(!r||!r.length)continue;const n={api:e.api,scales:this._currentScales,get data(){return a||(a=s._lastData||(s._lastData=s._dataSnapshot()))},set data(t){Object.defineProperty(this,"data",{value:t,writable:!0})},pass:i,hook:t};for(const i of r.slice())this._guard(e,t,()=>i(n))}}_guard(t,e,i){if(!t.disabled)try{i()}catch(i){console.error(`[apexcharts] plugin "${t.def.name}" threw in "${e}":`,i),t.failures=(t.failures||0)+1,t.failures>=3&&(t.disabled=!0,this._forget(t.def.name),console.error(`[apexcharts] plugin "${t.def.name}" disabled after repeated errors.`))}}_setScales(t){const e=this.w,i=e.globals,s=e.layout;if(!t||!i.axisCharts)return void(this._currentScales=null);const a=t.xRatio,r=t.yRatio||[],n=t=>null!=r[t]?r[t]:r[0],o=t=>null!=i.maxYArr[t]?i.maxYArr[t]:i.maxY,l=t=>null!=i.minYArr[t]?i.minYArr[t]:i.minY,h=!!i.isBarHorizontal,c=!!e.axisFlags.isRangeBar,d=i.dataPoints>0&&(!e.axisFlags.isXNumeric||h),u=h&&c?e.labelData.labels.length:i.dataPoints,p=h?s.gridHeight:s.gridWidth,g=d&&u>0?p/u:0,f=new Map;if(d){(c?e.labelData.labels:e.axisFlags.isXNumeric&&e.seriesData.seriesX[i.maxValsInArrayIndex]||[]).forEach((t,e)=>{f.has(t)||f.set(t,e)})}const m=d?t=>g*((f.has(t)?f.get(t):t)+.5):t=>(t-i.minX)/a,x=t=>{const s=i.seriesYAxisReverseMap&&i.seriesYAxisReverseMap[t];return e.config.yaxis[null!=s?s:t]||e.config.yaxis[0]},b=t=>{const e=x(t);return!(!e||!e.reversed)};let y=null;const v=h?(t,e=0)=>{const i=Math.abs(o(e)-l(e)),a=i?(t-l(e))/i*s.gridWidth:0;return b(e)?s.gridWidth-a:a}:(t,a=0)=>{const r=((t,s)=>{const a=x(s);return a&&a.logarithmic&&!i.invalidLogScale?(y||(y=new P(e)),y.getLogVal(a.logBase,t,s)):null})(t,a);return null!==r?b(a)?r*s.gridHeight:(1-r)*s.gridHeight:b(a)?(t-l(a))/n(a):(o(a)-t)/n(a)};this._currentScales={x:m,y:v,domainX:d?[-.5,u-.5]:[i.minX,i.maxX],domainY:(t=0)=>[l(t),o(t)],transposed:h,point:(t,e,i=0)=>h?{x:v(e,i),y:m(t)}:{x:m(t),y:v(e,i)},gridWidth:s.gridWidth,gridHeight:s.gridHeight,ratios:t}}_dataSnapshot(){const t=this.w,e=t.globals,i=t.seriesData.series||[],s=t.seriesData.seriesX||[],a=Array.isArray(t.config.series)?t.config.series:[];return i.map((i,r)=>{const n=Array.isArray(i)?i:[i],o=s[r]||[],l=n.map((t,e)=>({x:null!=o[e]?o[e]:e,y:t})),h=a[r],c=h&&"object"==typeof h&&Array.isArray(h.data)?h.data:[],d=t.seriesObservations?t.seriesObservations[r]:null,u=d?{values:d.values.slice(),byPoint:d.byPoint.map(t=>t?t.slice():null)}:null;return{name:e.seriesNames?e.seriesNames[r]:void 0,hidden:(e.collapsedSeriesIndices||[]).includes(r),color:e.colors?e.colors[r]:void 0,points:l,raw:c,observations:u}})}_categories(){const t=this.w,e=t.globals,i=t.config.xaxis&&Array.isArray(t.config.xaxis.categories)?t.config.xaxis.categories:[],s=Array.isArray(e.categoryLabels)?e.categoryLabels:[],a=Array.isArray(e.labels)?e.labels:[],r=i.length?i:s.length?s:a,n=t.seriesData.series||[];let o=0;for(let t=0;t<n.length;t++){const e=n[t];Array.isArray(e)&&e.length>o&&(o=e.length)}o||(o=r.length);const l=[];for(let t=0;t<o;t++){const e=r[t];l.push(String(null==e?t+1:e))}return l}_markDerived(t,e){this._derived||(this._derived=new Map);const i=Array.isArray(e)?e.map(t=>String(t)):[];i.length?this._derived.set(t,i):this._derived.delete(t),this._repairInitialSeries()}_onPointer(t,e){if("function"!=typeof e)return()=>{};this._pointerSubs||(this._pointerSubs=new Map);const i=this._pointerSubs.get(t)||[];return i.push(e),this._pointerSubs.set(t,i),this._wirePointer(),()=>{const i=this._pointerSubs&&this._pointerSubs.get(t);if(!i)return;const s=i.indexOf(e);s>-1&&i.splice(s,1)}}_wirePointer(){if(this._pointerWired)return;if(!this.ctx||"function"!=typeof this.ctx.addEventListener)return;const t=[["enter","dataPointMouseEnter"],["leave","dataPointMouseLeave"],["select","dataPointSelection"]];this._pointerWired=[];for(const[e,i]of t){const t=(t,i,s)=>{this._emitPointer(e,s,t)};this.ctx.addEventListener(i,t),this._pointerWired.push([i,t])}}_emitPointer(e,i,s){if(!this._pointerSubs||!this._pointerSubs.size)return;const a=i&&"number"==typeof i.seriesIndex?i.seriesIndex:-1,r=i&&"number"==typeof i.dataPointIndex?i.dataPointIndex:-1,n=this._categories()||[],o=this.w,l=o&&o.config&&o.config.series||[],h={type:e,seriesIndex:a,dataPointIndex:r,category:r>-1?n[r]:void 0,seriesName:t._seriesName(l,a),selected:"select"===e?t._isSelected(i,a,r):void 0,modifiers:t._modifiers(s)};for(const[t,e]of this._pointerSubs){const i=this.active.find(e=>e.def.name===t);if(i)for(const t of e.slice())this._guard(i,"pointer",()=>t(h))}}static _seriesName(t,e){if(e<0)return;const i=t[e];return i&&"object"==typeof i&&"string"==typeof i.name?i.name:void 0}static _isSelected(t,e,i){const s=t&&t.selectedDataPoints;if(!Array.isArray(s)||e<0)return;const a=s[e];return!!Array.isArray(a)&&a.indexOf(i)>-1}static _modifiers(t){return Object.freeze({shift:!(!t||!t.shiftKey),ctrl:!(!t||!t.ctrlKey),alt:!(!t||!t.altKey),meta:!(!t||!t.metaKey)})}_reserve(e,i){const s=t._normaliseBox(i),a=this._reserved?this._reserved.get(e):void 0;if(s){if(a&&a.left===s.left&&a.right===s.right&&a.top===s.top&&a.bottom===s.bottom)return;this._reserved||(this._reserved=new Map),this._reserved.set(e,s)}else{if(!a||!this._reserved)return;this._reserved.delete(e)}this._resizeForReservation()}static _normaliseBox(t){if(!t||"object"!=typeof t)return null;const e=t=>Number.isFinite(t)&&t>0?Math.round(t):0,i={left:e(t.left),right:e(t.right),top:e(t.top),bottom:e(t.bottom)};return i.left||i.right||i.top||i.bottom?i:null}reservedBox(){if(!this._reserved||0===this._reserved.size)return t.NO_RESERVATION;const e={left:0,right:0,top:0,bottom:0};for(const t of this._reserved.values())e.left+=t.left,e.right+=t.right,e.top+=t.top,e.bottom+=t.bottom;return e}_resizeForReservation(){null==this._reserveTimer&&(this._reserveTimer=setTimeout(()=>{this._reserveTimer=null;const t=this.w.globals;t.isDestroyed||(t.resized=!0,t.dataChanged=!1,this._update("a plugin reservation"))},0))}_update(t){try{Promise.resolve(this.ctx.update()).catch(e=>console.error(`[apexcharts] re-render for ${t} failed:`,e))}catch(t){}}_highlight(t,e){const i=this.w,s=this.ctx.highlightFilter;if(!s)return null;if(!i.globals.axisCharts)return null;if(!s.canDrawParts())return null;if(s.callerCarriesParts())return null;const a=function(t,e,i){const s=ei(i);if(!s.length)return null;const a={owner:e,entries:s};return function(t){return t.weaveHighlights||(t.weaveHighlights={records:[]}),t.weaveHighlights}(t).records.push(a),a}(i,t,e);return a?(this._redrawForHighlight(),Object.freeze({release:()=>{!function(t,e){if(!t||!t.weaveHighlights||!e)return;const i=t.weaveHighlights.records,s=i.indexOf(e);s>-1&&i.splice(s,1)}(i,a),this._redrawForHighlight()},update:t=>{a.entries=ei(t),this._redrawForHighlight()}})):null}_redrawForHighlight(){null==this._highlightTimer&&(this._highlightTimer=setTimeout(()=>{this._highlightTimer=null;const t=this.w.globals;t.isDestroyed||(t.dataChanged=!0,this._update("plugin highlight parts"))},0))}_derivedNames(){const t=new Set;if(!this._derived)return t;for(const e of this._derived.values())for(const i of e)t.add(i);return t}_repairInitialSeries(){const t=this._derivedNames();if(!t.size)return;const e=this.w.globals,i=e=>!t.has(String(e&&e.name)),s=t=>{if(!Array.isArray(t))return null;const e=t.filter(i);return e.length&&e.length!==t.length?e:null};try{const t=s(e._initialSeriesPeek);t&&(e.initialSeries=t);const i=e.initialConfig,a=i&&s(i.series);a&&(i.series=a)}catch(t){}}_token(t){const e=this.w,i=e.globals;switch(t){case"foreColor":return e.config.chart.foreColor;case"background":return e.config.chart.background;case"accent":case"primary":return i.colors?i.colors[0]:void 0;default:return/^series-\d+$/.test(t)&&i.colors?i.colors[Number(t.split("-")[1])]:void 0}}_layer(t,{z:e="front",className:i=""}={}){let s=this._layers.get(t);if(!s){s=this.ctx.graphics.group({class:`apexcharts-plugin-${t} ${i}`.trim()});const a=this.w.dom.elGraphical.node;"behind"===e?a.insertBefore(s.node,a.firstChild):a.appendChild(s.node),s.node.setAttribute("aria-hidden","true"),this._layers.set(t,s)}return function(t,e,i){const s=e=>(e&&t.add(e),e),a={get node(){return t.node},path(t={}){const{d:i="",stroke:a="#000",width:r=1,fill:n="none",opacity:o=1,dash:l=0,className:h=""}=t;return s(e.drawPath({d:i,stroke:a,strokeWidth:r,fill:n,fillOpacity:"none"===n?0:o,strokeOpacity:o,strokeDashArray:l,classes:h}))},line(t={}){const{x1:i,y1:a,x2:r,y2:n,stroke:o="#000",width:l=1,dash:h=0}=t;return s(e.drawLine(i,a,r,n,o,h,l))},rect(t={}){const{x:i=0,y:a=0,w:r=0,h:n=0,r:o=0,fill:l="#000",stroke:h=null,opacity:c=1}=t;return s(e.drawRect(i,a,r,n,o,l,c,null!=h?1:null,h))},circle(t={}){const{cx:i=0,cy:a=0,r:r=0,fill:n="#000",stroke:o=null}=t;return s(e.drawCircle(r,{cx:i,cy:a,fill:n,stroke:o||"none"}))},text(t={}){const{x:i=0,y:a=0,text:r="",color:n,size:o,anchor:l="start",weight:h}=t;return s(e.drawText({x:i,y:a,text:r,textAnchor:l,fontSize:o,foreColor:n,fontWeight:h}))},clear(){const e=t.node;for(;e.firstChild;)e.removeChild(e.firstChild);return i&&i(),a}};return a}(s,this.ctx.graphics,()=>this._undeclare(t))}_undeclare(t){this._declared&&this._declared.delete(t)}_resetLayers(){this._layers.forEach(t=>t.node.remove()),this._layers.clear(),this._declared=null}_declare(t,e){if(!e||"string"!=typeof e.id||!e.id)return void console.warn(`[apexcharts] plugin "${t}" declared something with no id; ignored.`);this._declared||(this._declared=new Map);const i=this._declared.get(t)||[],s={id:e.id,label:e.label?String(e.label):e.id,visible:!1!==e.visible},a=i.findIndex(t=>t.id===s.id);a>-1?i[a]=s:i.push(s),this._declared.set(t,i)}_reconcile(){const t=this.w.config.plugins||[];if(t===this._lastPluginsRef)return;this._lastPluginsRef=t;const e=new Map(t.map((t,e)=>[t.name,{entry:t,order:null!=t.order?t.order:e}]));for(let t=this.active.length-1;t>=0;t--){const i=this.active[t],s=e.get(i.def.name);s?i.options=Object.freeze(o({},s.entry.options||{})):(this._guard(i,"destroy",()=>i.def.destroy&&i.def.destroy(i.api)),this.active.splice(t,1),this._forget(i.def.name))}const i=new Set(this.active.map(t=>t.def.name)),s=[];e.forEach((t,e)=>{i.has(e)||s.push(t)}),s.sort((t,e)=>t.order-e.order).forEach(t=>this._activate(t.entry))}_forget(t){const e=this.w,i=function(t,e){if(!t.weaveClaims)return!1;let i=!1;for(const[s,a]of t.weaveClaims.byOption){const r=a.filter(t=>t.owner!==e);r.length!==a.length&&(t.weaveClaims.byOption.set(s,r),i=!0)}return i}(e,t),s=function(t,e){if(!t||!t.weaveHighlights)return!1;const i=t.weaveHighlights.records,s=i.filter(t=>t.owner!==e);return s.length!==i.length&&(t.weaveHighlights.records=s,!0)}(e,t);this._pointerSubs&&this._pointerSubs.delete(t),this._derived&&this._derived.delete(t),this._declared&&this._declared.delete(t);const a=!(!this._reserved||!this._reserved.has(t));this._reserve(t,null),!i&&!s||a||this._redrawForHighlight()}teardown(t){if(!t){this.dispatch("destroy");for(const t of this.active)this._guard(t,"destroy",()=>t.def.destroy&&t.def.destroy(t.api));for(const t of this.active)this._forget(t.def.name);if(this.active=[],this._derived=null,this._reserved=null,this._pointerSubs=null,this._declared=null,this._pointerWired){for(const[t,e]of this._pointerWired)this.ctx.removeEventListener&&this.ctx.removeEventListener(t,e);this._pointerWired=null}null!=this._reserveTimer&&(clearTimeout(this._reserveTimer),this._reserveTimer=null),null!=this._highlightTimer&&(clearTimeout(this._highlightTimer),this._highlightTimer=null),this._updatedWired&&(this.ctx.removeEventListener&&this.ctx.removeEventListener("updated",this._onUpdated),this._updatedWired=!1)}this._layers.clear()}};var si,ai,ri;si=ii,ai="NO_RESERVATION",ri=Object.freeze({left:0,right:0,top:0,bottom:0}),n(si,"symbol"!=typeof ai?ai+"":ai,ri);let ni=ii;function oi(t,e){const i=t&&t.renderer;return i&&i.kind&&"svg"!==i.kind?i:e}c.default.registerFeatures({weave:ni}),c.default._customSeriesFactory=function(t,e){const i=class{constructor(t,e,i){this.w=t,this.ctx=e,this.xyRatios=i,this._warned=!1}draw(i,s,a){var r,n;const o=this.w,l=new R(o,this.ctx),h=oi(this.ctx,l),c=l.group({class:"apexcharts-marks-series"});return i.forEach((i,s)=>{var r;const n=Array.isArray(a)?a[s]:s,d=l.group({class:"apexcharts-series",rel:n+1,seriesName:Zt.escapeString(o.seriesData.seriesNames[n]),"data:realIndex":n}),u=this._scales(n,(o.seriesData.series[n]||[]).length),p=o.globals.colors[n],g=(null==(r=o.config.series[n])?void 0:r.data)||[],f=o.seriesData.seriesX[n]||[],m=o.seriesData.series[n]||[];o.globals.seriesXvalues[n]=[],o.globals.seriesYvalues[n]=[],void 0===o.globals.pointsArray[n]&&(o.globals.pointsArray[n]=[]);for(let i=0;i<m.length;i++){const s=m[i];if(null==s)continue;const a=f[i],r=u.xAt(i,a),l=u.y(s),c=this._api(h,d,n,i);try{e.renderItem({datum:g[i],x:r,y:l,scales:u,api:c,seriesIndex:n,dataPointIndex:i,color:p})}catch(e){this._warned||(console.warn(`[apexcharts] renderItem for series type "${t}" threw; skipping datum:`,e),this._warned=!0)}o.globals.seriesXvalues[n][i]=r,o.globals.seriesYvalues[n][i]=l,o.globals.pointsArray[n][i]=[r,l]}l.setupEventDelegation(d,".apexcharts-marks-mark"),c.add(d)}),null==(n=null==(r=this.ctx.animations)?void 0:r.animationCompleted)||n.call(r,c),c}_scales(t,e){var i,s,a,r;const n=this.w.globals,o=this.w.config,l=this.xyRatios.xRatio,h=this.xyRatios.yRatio,c=null!=(s=null==(i=n.seriesYAxisReverseMap)?void 0:i[t])?s:0,d=Array.isArray(h)?null!=(a=h[c])?a:h[0]:h,u=n.maxYArr,p=Array.isArray(u)&&u.length&&null!=(r=u[c])?r:n.maxY,g=n.gridWidth,f=n.gridHeight,m=!n.isXNumeric,x=e||n.dataPoints||1,b=x>0?g/x:g,y="on"===o.xaxis.tickPlacement,v=t=>l?(t-n.minX)/l:g/2,w=n.minXDiff||1;return{x:v,xAt:(t,e)=>m?y&&x>1?t/(x-1)*g:(t+.5)*b:v(e),y:t=>(p-t)/d,gridWidth:g,gridHeight:f,band:m?b:l?w/l:g}}_api(t,e,i,s){const a=t=>{if(t){try{t.node.setAttribute("index",String(i)),t.node.setAttribute("j",String(s)),t.node.classList.add("apexcharts-marks-mark")}catch(t){}e.add(t)}return t};return{path:(e={})=>{var i,s,r,n,o,l,h,c,d;return a(t.drawPath({d:e.d||"",stroke:null!=(i=e.stroke)?i:"#000",strokeWidth:null!=(r=null!=(s=e.width)?s:e.strokeWidth)?r:1,fill:null!=(n=e.fill)?n:"none",fillOpacity:null!=(l=e.fillOpacity)?l:e.fill&&"none"!==e.fill?null!=(o=e.opacity)?o:1:0,strokeOpacity:null!=(c=null!=(h=e.strokeOpacity)?h:e.opacity)?c:1,strokeDashArray:null!=(d=e.dash)?d:0,strokeLinecap:e.lineCap}))},line:(e={})=>{var i,s,r,n;return a(t.drawLine(e.x1,e.y1,e.x2,e.y2,null!=(i=e.stroke)?i:"#000",null!=(s=e.dash)?s:0,null!=(n=null!=(r=e.width)?r:e.strokeWidth)?n:1))},rect:(e={})=>{var i,s,r,n,o,l,h,c;return a(t.drawRect(null!=(i=e.x)?i:0,null!=(s=e.y)?s:0,null!=(r=e.w)?r:0,null!=(n=e.h)?n:0,null!=(o=e.r)?o:0,null!=(l=e.fill)?l:"#000",null!=(h=e.opacity)?h:1,null!=e.stroke?null!=(c=e.strokeWidth)?c:1:null,e.stroke))},circle:(e={})=>{var i,s,r,n,o;return a(t.drawCircle(null!=(i=e.r)?i:0,{cx:null!=(s=e.cx)?s:0,cy:null!=(r=e.cy)?r:0,fill:null!=(n=e.fill)?n:"#000",stroke:e.stroke||"none","stroke-width":null!=(o=e.strokeWidth)?o:e.stroke?1:0}))},text:(e={})=>{var i,s,r,n;return a(t.drawText({x:null!=(i=e.x)?i:0,y:null!=(s=e.y)?s:0,text:null!=(r=e.text)?r:"",textAnchor:null!=(n=e.anchor)?n:"start",fontSize:e.size,foreColor:e.color,fontWeight:e.weight}))}}}};return i.dataType=e.dataType||"xy",i.yExtent="function"==typeof e.yExtent?e.yExtent:null,i};class li{constructor(t,e){if(this.w=t,this.ctx=e,"os"!==t.config.theme.follow||!Nt.isBrowser())return;const i=this._ensureMedia();i&&(this._applyToConfig(i),this._ensureListeners(i))}_ensureMedia(){if(!this.ctx._osThemeMedia){const t=ft.matchMedia("(prefers-color-scheme: dark)"),e=ft.matchMedia("(prefers-contrast: more)");if(!t&&!e)return null;this.ctx._osThemeMedia={dark:t,contrast:e,handler:null}}return this.ctx._osThemeMedia}_applyToConfig(t){const e=this.w.config.theme;t.dark&&(e.mode=t.dark.matches?"dark":"light"),t.contrast&&t.contrast.matches&&(e.accessibility=e.accessibility||{},e.accessibility.colorBlindMode="highContrast")}_ensureListeners(t){if(t.handler)return;const e=this.ctx,i=()=>{const t=e._osThemeMedia;if(!t)return;const i={mode:t.dark&&t.dark.matches?"dark":"light"};t.contrast&&t.contrast.matches?i.accessibility={colorBlindMode:"highContrast"}:i.accessibility={colorBlindMode:""},e.updateOptions({theme:i},!1,!0,!1)};li._add(t.dark,i),li._add(t.contrast,i),t.handler=i}teardown(){const t=this.ctx._osThemeMedia;t&&(t.handler&&(li._remove(t.dark,t.handler),li._remove(t.contrast,t.handler)),this.ctx._osThemeMedia=null)}static _add(t,e){t&&("function"==typeof t.addEventListener?t.addEventListener("change",e):"function"==typeof t.addListener&&t.addListener(e))}static _remove(t,e){t&&("function"==typeof t.removeEventListener?t.removeEventListener("change",e):"function"==typeof t.removeListener&&t.removeListener(e))}}c.default.registerFeatures({osThemeWatcher:li});const hi="__apexcharts_series_transforms__";function ci(t,e){t&&"string"==typeof t?"function"==typeof e?globalThis[hi][t]=e:console.warn(`ApexCharts: registerSeriesTransform("${t}") expects a function (series, w) => series.`):console.warn("ApexCharts: registerSeriesTransform requires a non-empty name.")}globalThis[hi]||(globalThis[hi]={});const di="__apexcharts_row_sources__";function ui(t,e){t&&"string"==typeof t?"function"==typeof e?globalThis[di][t]=e:console.warn(`ApexCharts: registerRowSource("${t}") expects a function (w, opts) => series.`):console.warn("ApexCharts: registerRowSource requires a non-empty name.")}function pi(t){return(t.collapsedSeriesIndices||[]).concat(t.ancillaryCollapsedSeriesIndices||[])}function gi(t,e){const i=(e.collapsedSeries||[]).concat(e.ancillaryCollapsedSeries||[]);return t.map((t,e)=>{const n=t||{},{hidden:h}=n,c=((t,e)=>{var i={};for(var n in t)a.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&s)for(var n of s(t))e.indexOf(n)<0&&r.call(t,n)&&(i[n]=t[n]);return i})(n,["hidden"]);let d=c.data;if(Array.isArray(d)&&!d.length){const t=i.find(t=>t.index===e);t&&Array.isArray(t.data)&&(d=t.data)}return l(o({},c),{data:Array.isArray(d)?d.slice():d})})}function fi(t,e){const i=Math.max(0,e.length-1),s=new Array(i);for(let t=0;t<i;t++)s[t]=[];for(let i=0;i<t.length;i++){const a=Qt(t[i],e);a>=0&&s[a].push(t[i])}return s}function mi(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const i=t.slice().sort((t,e)=>t-e),s=Kt(i,.25),a=Kt(i,.5),r=Kt(i,.75),n=r-s;let o=i[0],l=i[i.length-1],h=[];if("tukey"===e.whiskers&&n>0){const t=s-1.5*n,e=r+1.5*n;let a=0;for(;a<i.length&&i[a]<t;)a++;let c=i.length-1;for(;c>=0&&i[c]>e;)c--;a<=c&&(o=i[a],l=i[c],h=i.slice(0,a).concat(i.slice(c+1)))}return{summary:[o,s,a,r,l],outliers:h,iqr:n}}function xi(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const i=t.slice().sort((t,e)=>t-e),s=i.length;let a=e.bandwidth;if(!("number"==typeof a&&a>0)){const t=function(t){const e=t.length;if(e<2)return 0;let i=0;for(let s=0;s<e;s++)i+=t[s];const s=i/e;let a=0;for(let i=0;i<e;i++){const e=t[i]-s;a+=e*e}return Math.sqrt(a/e)}(i),e=Kt(i,.75)-Kt(i,.25);a=.9*(e>0?Math.min(t,e/1.349):t)*Math.pow(s,-.2)}if(!isFinite(a)||a<=0){const t=i[0],e=Math.abs(t)>0?.001*Math.abs(t):.001;return{density:[[t-e,0],[t,1],[t+e,0]],bandwidth:e}}const r=Math.max(8,Math.floor(e.resolution||64)),n=i[0]-2*a,o=(i[s-1]+2*a-n)/(r-1),l=1/(s*a*Math.sqrt(2*Math.PI)),h=[];for(let t=0;t<r;t++){const e=n+t*o;let r=0;for(let t=0;t<s;t++){const s=(e-i[t])/a;r+=Math.exp(-.5*s*s)}h.push([e,r*l])}return{density:h,bandwidth:a}}function bi(t){const e=[];if(!Array.isArray(t))return e;for(let i=0;i<t.length;i++){const s=t[i];let a=s;Array.isArray(s)?a=1===s.length?s[0]:s[1]:s&&"object"==typeof s&&(a=void 0!==s.y?s.y:s.x);const r=Zt.parseNumber(a);null!==r&&isFinite(r)&&e.push(r)}return e}function yi(t,e,i,s,a,r,n){if(!Array.isArray(t))return t;const h=function(t,e){const i=t.statsDerived||(t.statsDerived={});return i[e]||(i[e]=new Map)}(e,i),c=[],d=t.map((t,e)=>{if(!Array.isArray(null==t?void 0:t.data)||t.type&&t.type!==i)return t;let d=!1;const u=new Array(t.data.length).fill(null),p=t.data.map((t,o)=>{const l=e+":"+o,c=r(t);if(c&&!function(t,e,i){const s=(t.get(e)||{}).e;return!!s&&JSON.stringify(s.density||s.summary)===JSON.stringify(i)}(h,l,c))return t;const p=function(t,e){var i;if(!t||"object"!=typeof t||Array.isArray(t))return null;let s=null;if(Array.isArray(t.points)?s=t.points:Array.isArray(null==(i=t.y)?void 0:i.points)?s=t.y.points:e&&Array.isArray(t.y)&&"number"==typeof t.y[0]&&(s=t.y),!s)return null;const a=[];for(let t=0;t<s.length;t++){const e=Zt.parseNumber(s[t]);null!==e&&isFinite(e)&&a.push(e)}return a.length?a:null}(t,"violin"===i);if(!p)return t;const g=function(t,e,i,s,a){const r=JSON.stringify(s)+i;let n=t.get(e);return n&&n.s===r||t.set(e,n={s:r,e:a(i,s)}),n.e}(h,l,p,s,a);return g?(d=!0,u[o]=p,n(t,g,p)):t});return d&&(c[e]=u),d?l(o({},t),{data:p}):t});return function(t,e,i){if(!e.length)return;const s=[];for(let t=0;t<i;t++){const i=e[t];if(!i){s.push(null);continue}const a=[];for(const t of i)if(t)for(let e=0;e<t.length;e++)a.push(t[e]);s.push({values:a,byPoint:i})}t.seriesObservations=s}(e,c,t.length),d}globalThis[di]||(globalThis[di]={});function vi(t,e,i){const s=i&&null!=i.maxRows?i.maxRows:3e3,a=function(t,e){let i=0,s=0;for(const e of t)i+=e.length,e.length>s&&(s=e.length);if(i<=e)return{clusters:t,stride:1,total:i,kept:i};const a=e=>{let i=0;for(const s of t)i+=Math.ceil(s.length/e);return i};let r=Math.max(2,Math.ceil(i/e));for(;r<s&&a(r)>e;)r++;let n=0;return{clusters:t.map(t=>{const e=[];for(let i=0;i<t.length;i+=r)e.push(t[i]);return n+=e.length,e}),stride:r,total:i,kept:n}}(e.map(t=>t.rows),s);a.stride>1&&console.warn(`ApexCharts: rowSeries() thinned ${a.total} rows to ${a.kept} (every ${a.stride}${2===a.stride?"nd":3===a.stride?"rd":"th"} row) to stay under maxRows=${s}. Raise maxRows to draw more.`);const r=t.globals&&t.globals.colors||[];return e.map((t,e)=>{const i=r[t.realIndex]||r[0];return{name:t.name,data:a.clusters[e].map((s,a)=>o({id:`${t.realIndex}:${e}:${a}`,x:t.name,y:s},i?{fillColor:i}:{}))}})}function wi(t){if(!isFinite(t))return String(t);const e=Math.round(t);return Math.abs(t-e)<1e-6?String(e):String(Number(t.toFixed(2)))}function _i(t){return(e,i)=>{var s;const a=t(e);if(!Array.isArray(a)||!a.length)return null;const r=e.globals?pi(e.globals):[],n=e.globals&&((null==(s=e.globals.categoryLabels)?void 0:s.length)?e.globals.categoryLabels:e.globals.labels)||[],o=[];return a.forEach((t,i)=>{var s;if(-1!==r.indexOf(i))return;if(!Array.isArray(t))return;const l=e.seriesData&&(null==(s=e.seriesData.seriesNames)?void 0:s[i]);t.forEach((t,e)=>{const s=null!=n[e]?String(n[e]):`#${e+1}`;o.push({name:a.length>1&&l?`${l} ${s}`:s,realIndex:i,rows:Array.isArray(t)?t.slice():[]})})}),o.length?vi(e,o,i):null}}const Ai=_i(t=>{var e;return null==(e=t.candleData)?void 0:e.seriesBoxPoints}),Si=_i(t=>{var e;return null==(e=t.violinData)?void 0:e.seriesViolinPoints});ci("histogram",function(t,e){var i;const s=e.config,a=e.globals;if(!Array.isArray(t))return t;a.histogramRawSeries||(a.histogramRawSeries=gi(t,a));const r=a.histogramRawSeries,n=(null==(i=s.plotOptions)?void 0:i.histogram)||{},h=r.map(t=>bi(null==t?void 0:t.data));let c=[];if(1===h.length)c=h[0];else for(const t of h)c=c.concat(t);const d=Jt(c,{bins:n.bins,binWidth:n.binWidth,range:n.range});if(!d)return e.histogramData={edges:[],binWidth:0,counts:[],rule:"",capped:!1},r;const{edges:u,binWidth:p}=d,g=h.map(t=>function(t,e){const i=new Array(Math.max(0,e.length-1)).fill(0);for(let s=0;s<t.length;s++){const a=Qt(t[s],e);a>=0&&i[a]++}return i}(t,u));e.histogramData={edges:u,binWidth:p,counts:g,rule:d.rule,capped:d.capped};const f=pi(a);return e.seriesObservations=h.map((t,e)=>({values:t,byPoint:-1!==f.indexOf(e)?[]:fi(t,u)})),r.map((t,e)=>{if(-1!==f.indexOf(e))return l(o({},t),{data:[]});const i=function(t,e={}){let i=t.slice();if(e.cumulative){let t=0;i=i.map(e=>t+=e)}const s=t.reduce((t,e)=>t+e,0);if(s<=0)return i;if("relative"===e.normalize)return i.map(t=>t/s*100);if("density"===e.normalize){const t=e.binWidth;if("number"==typeof t&&t>0)return i.map(e=>e/(s*t))}return i}(g[e],{normalize:n.normalize,cumulative:n.cumulative,binWidth:p}),s=[];for(let t=0;t<i.length;t++)s.push({x:(u[t]+u[t+1])/2,y:i[t]});return l(o({},t),{data:s})})}),ci("boxPlot",function(t,e){var i,s;return yi(t,e,"boxPlot",{whiskers:(null==(s=null==(i=e.config.plotOptions)?void 0:i.boxPlot)?void 0:s.whiskers)||"minmax"},mi,t=>Array.isArray(null==t?void 0:t.y)&&5===t.y.length&&t.y,(t,e,i)=>l(o({},t),{y:e.summary,points:i}))}),ci("violin",function(t,e){var i,s;const a=(null==(s=null==(i=e.config.plotOptions)?void 0:i.violin)?void 0:s.kde)||{};return yi(t,e,"violin",{bandwidth:a.bandwidth,resolution:a.resolution},xi,t=>{var e;return Array.isArray(null==(e=null==t?void 0:t.y)?void 0:e.density)&&t.y.density.length&&t.y.density},(t,e,i)=>l(o({},t),{y:l(o({},t.y&&"object"==typeof t.y&&!Array.isArray(t.y)?t.y:{}),{density:e.density,points:i})}))}),ui("histogram",function(t,e){const i=t.globals,s=t.histogramData,a=i&&i.histogramRawSeries;if(!s||!Array.isArray(s.edges)||s.edges.length<2)return null;if(!Array.isArray(a)||!a.length)return null;const r=pi(i),n=s.edges,o=[];return a.forEach((e,i)=>{var s;if(-1!==r.indexOf(i))return;const l=fi(bi(e&&e.data),n),h=t.seriesData&&(null==(s=t.seriesData.seriesNames)?void 0:s[i])||(null==e?void 0:e.name);l.forEach((t,e)=>{const s=`${wi(n[e])}-${wi(n[e+1])}`;o.push({name:a.length>1&&h?`${h} ${s}`:s,realIndex:i,rows:t})})}),o.length?vi(t,o,e):null}),ui("boxPlot",Ai),ui("violin",Si);const Ci=(t,e,i,s)=>{if("function"!=typeof t)return t;const a=t({series:e.seriesData.series,seriesIndex:i,dataPointIndex:s,w:e});return Number.isFinite(a)?a:0};class ki{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,i,s,a,r,n;const{x:h,y:c,y1:d,y2:u,i:p,j:g,realIndex:f,columnGroupIndex:m,barHeight:x,barWidth:b,barXPosition:y,barYPosition:v,visibleSeries:w,hl:_,noLabel:A}=t,S=this.w,C=new R(this.barCtx.w);this.hlt=null==_?void 0:_.total;const k=S.waterfallData&&S.waterfallData.values,P=_&&null!=_.val?_.val:k&&k[f]&&null!=k[f][g]?k[f][g]:null,L=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[f]:this.barCtx.strokeWidth;let M,I;S.axisFlags.isXNumeric&&!S.globals.isBarHorizontal?(M=h+b*(w+1),I=c+x*(w+1)-L):(M=h+b*w,I=c+x*w);let E=null,F=null,D=h,T=c,z={};const X=S.config.dataLabels,O=this.barCtx.barOptions.dataLabels,$=this.barCtx.barOptions.dataLabels.total;void 0!==v&&(this.barCtx.isRangeBar||this.barCtx.isPyramid)&&(I=v,T=v),void 0!==y&&this.barCtx.isVerticalGroupedRangeBar&&(M=y,D=y);const W=Ci(X.offsetX,S,f,g),Y=Ci(X.offsetY,S,f,g),H=(null==_?void 0:_.hide)?void 0:null!==P?P:void 0!==u?[d,u]:"100%"===S.config.chart.stackType?S.globals.seriesPercent[f][g]:S.seriesData.series[f][g];let B,N={width:0,height:0};X.enabled&&(B=void 0===H?"":X.formatter(H,l(o({},S),{seriesIndex:f,dataPointIndex:g,w:S})),N=C.getTextRects(B,parseFloat(X.style.fontSize).toString(),X.style.fontFamily,void 0,!0,X.style.fontWeight));const j=S.config.chart.stacked&&$.enabled&&!1!==this.hlt&&this.drawsStackedTotal(f),V=j?this.getStackedTotalDataLabel({realIndex:f,j:g}):void 0,G={drawTotal:j,totalText:V,x:null!=(e=null==_?void 0:_.x)?e:h,y:null!=(i=null==_?void 0:_.y)?i:c,neg:_&&null!=_.val?_.val<0:void 0,i:p,j:g,realIndex:f,columnGroupIndex:m,bcx:M,bcy:I,barHeight:null!=(s=null==_?void 0:_.barHeight)?s:x,barWidth:null!=(a=null==_?void 0:_.barWidth)?a:b,textRects:N,strokeWidth:L,dataLabelsX:D,dataLabelsY:T,dataLabelsConfig:X,barDataLabelsConfig:O,barTotalDataLabelsConfig:$,offX:W,offY:Y};if(z=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(G):this.calculateColumnsDataLabelsPosition(G),null!==P&&this.barCtx.isHorizontal&&"center"===O.position){const t=null==(n=null==(r=S.waterfallData.geometry)?void 0:r[f])?void 0:n[g];t&&t.horizontal&&(z.dataLabelsX=(t.levelStart+t.levelEnd)/2+W)}return E=A?null:this.drawCalculatedDataLabels({x:z.dataLabelsX,y:z.dataLabelsY,neg:G.neg,val:H,text:B,i:f,j:g,barWidth:G.barWidth,barHeight:G.barHeight,textRects:N,dataLabelsConfig:X}),j&&(F=this.drawTotalDataLabels({x:z.totalDataLabelsX,y:z.totalDataLabelsY,barWidth:b,barHeight:x,realIndex:f,j:g,textAnchor:z.totalDataLabelsAnchor,val:V,rawVal:this.getStackedTotalValue({realIndex:f,j:g}),dataLabelsConfig:X,barTotalDataLabelsConfig:$})),{dataLabelsPos:z,dataLabels:E,totalDataLabels:F}}hasMultipleSeriesGroups(){return this.w.labelData.seriesGroups.length>1}getTotalGroupContext(t){if(!this.hasMultipleSeriesGroups())return null;const e=this.barCtx.barHelpers.getSeriesGroupIndex(t);return e<0?null:{groupIndex:e}}drawsStackedTotal(t){const e=this.barCtx.lastActiveBarSerieIndexByGroup,i=this.getTotalGroupContext(t);return i&&e&&e.length>i.groupIndex?e[i.groupIndex]===t:this.barCtx.lastActiveBarSerieIndex===t}getStackedTotalValue({realIndex:t,j:e}){if(this.hlt)return this.hlt.val;const i=this.w,s=this.xStackTop(t,e);if(s)return s[3];const a=this.getTotalGroupContext(t),r=i.seriesData.stackedSeriesTotalsByGroups;return a&&r&&r[a.groupIndex]?r[a.groupIndex][e]:this.barCtx.stackedSeriesTotals[e]}xStackTop(t,e){var i,s;const a=this.w;return a.axisFlags.isXNumeric&&(null==(s=null==(i=this.barCtx.stacks)?void 0:i[a.labelData.seriesGroupIndex[t]])?void 0:s.tops.get(a.seriesData.seriesX[t][e]))}totalRects(t){const e=this.barCtx.barOptions.dataLabels.total.style;return new R(this.w).getTextRects(t,e.fontSize,e.fontFamily,void 0,!0,e.fontWeight)}getStackedTotalDataLabel({realIndex:t,j:e}){const i=this.w;let s=this.getStackedTotalValue({realIndex:t,j:e});return this.totalFormatter&&(s=this.totalFormatter(s,l(o({},i),{seriesIndex:t,dataPointIndex:e,w:i}))),s}zeroEncounters(t,e){const i=this.w;return!i.config.chart.stacked&&i.config.plotOptions.bar.hideZeroBarsWhenGrouped?this.barCtx.barHelpers.getZeroValueEncounters({i:t,j:e}).zeroEncounters:0}calculateColumnsDataLabelsPosition(t){var e;const i=this.w;let s,a,{j:r,realIndex:n,y:o,bcx:l,barWidth:h,barHeight:c,textRects:d,dataLabelsX:u,dataLabelsY:p,barDataLabelsConfig:g,barTotalDataLabelsConfig:f,strokeWidth:m,offX:x,offY:b}=t;const y=l;c=Math.abs(c);const v="vertical"===i.config.plotOptions.bar.dataLabels.orientation,w=this.zeroEncounters(n,r);l-=m/2;const _=i.layout.gridWidth/i.globals.dataPoints;if(this.barCtx.isVerticalGroupedRangeBar?u+=h/2:(u=i.axisFlags.isXNumeric?l-h/2+x:l-_+h/2+x,w>0&&(u-=h*w)),v){const t=2;u=u+d.height/2-m/2-t}const A=null!=(e=t.neg)?e:i.seriesData.series[n][r]<0;let S=o;switch(this.barCtx.isReversed&&(S=o+(A?c:-c)),g.position){case"center":p=v?A?S-c/2+b:S+c/2-b:A?S-c/2+d.height/2+b:S+c/2+d.height/2-b;break;case"bottom":p=v?A?S-c+b:S+c-b:A?S-c+d.height+m+b:S+c-d.height/2+m-b;break;case"top":p=v?A?S+b:S-b:A?S-d.height/2-b:S+d.height+b}if(t.drawTotal){let e=S;const o=this.getTotalGroupContext(n),l=this.xStackTop(n,r),c=l?[]:this.barCtx.stacks||[];l&&(e=A?Math.max(S,l[5]):Math.min(S,l[4])),c.forEach((t,i)=>{o&&i!==o.groupIndex||t.prevY.forEach(t=>{e=A?Math.max(t[r],e):Math.min(t[r],e)})}),this.hlt&&(e=this.hlt.edge);const d=this.totalRects(t.totalText).height;s=A?e+.77*d-b-f.offsetY:e-.3*d+b+f.offsetY;const u=_;a=y+(i.axisFlags.isXNumeric?-h/2:h/2-u)+f.offsetX}return i.config.chart.stacked||(p<0?p=0+m:p+d.height/3>i.layout.gridHeight&&(p=i.layout.gridHeight-m)),{bcx:l,bcy:o,dataLabelsX:u,dataLabelsY:p,totalDataLabelsX:a,totalDataLabelsY:s,totalDataLabelsAnchor:"middle"}}calculateBarsDataLabelsPosition(t){var e,i;const s=this.w;let{x:a,j:r,realIndex:n,bcy:o,barHeight:l,barWidth:h,textRects:c,dataLabelsX:d,strokeWidth:u,dataLabelsConfig:p,barDataLabelsConfig:g,barTotalDataLabelsConfig:f,offX:m,offY:x}=t;const b=s.layout.gridHeight/s.globals.dataPoints,y=this.zeroEncounters(n,r);let v,w,_;if(h=Math.abs(h),this.barCtx.isPyramid){v=o+l/2+x-(null!=(e=c.centerOffset)?e:0)}else v=o-(this.barCtx.isRangeBar?0:b)+l/2+c.height/2+x-3;y>0&&(v-=l*y);let A="start";const S=null!=(i=t.neg)?i:s.seriesData.series[n][r]<0;let C=a;if(this.barCtx.isReversed&&(C=a+(S?-h:h),A=S?"start":"end"),this.barCtx.isPyramid)d=s.layout.gridWidth/2+m;else switch(g.position){case"center":d=S?C+h/2-m:Math.max(c.width/2,C-h/2)+m;break;case"bottom":d=S?C+h-u-m:C-h+u+m;break;case"top":d=S?C-u-m:C-u+m}if(t.drawTotal){let e=C;const i=this.getTotalGroupContext(n),a=this.xStackTop(n,r),o=a?[]:this.barCtx.stacks||[];a&&(e=S?Math.min(C,a[4]):Math.max(C,a[5])),o.forEach((t,s)=>{i&&s!==i.groupIndex||t.prevX.forEach(t=>{e=S?Math.min(t[r],e):Math.max(t[r],e)})}),this.hlt&&(e=this.hlt.edge);const d=this.totalRects(t.totalText);S?(w=e-u-m-f.offsetX,A="end"):w=e+m+f.offsetX+(this.barCtx.isReversed?-(h+u):u),_=v-c.height/2+d.height/2+f.offsetY+u,s.globals.barGroups.length>1&&!i&&(_-=s.globals.barGroups.length/2*(l/2))}if(!s.config.chart.stacked){const t=S&&"middle"!==p.textAnchor?"start"===p.textAnchor?"end":"start":p.textAnchor;let e;e="vertical"===g.orientation?c.height/2:"end"===t?c.width:"middle"===t?c.width/2:0;const i=("vertical"===g.orientation?c.height:c.width)-e;d+i>s.layout.gridWidth-u&&(d=s.layout.gridWidth-i-u),d-e<u&&(d=e+u)}return{bcx:a,bcy:o,dataLabelsX:d,dataLabelsY:v,totalDataLabelsX:w,totalDataLabelsY:_,totalDataLabelsAnchor:A}}drawCalculatedDataLabels({x:t,y:e,val:i,text:s,neg:a,i:r,j:n,textRects:h,barHeight:c,barWidth:d,dataLabelsConfig:u}){var p,g,f;const m=this.w;let x="rotate(0)";"vertical"===m.config.plotOptions.bar.dataLabels.orientation&&(x=`rotate(-90, ${t}, ${e})`);const b=new I(this.barCtx.w,this.barCtx.ctx),y=new R(this.barCtx.w),v=u.formatter;let w=null;const _=m.globals.collapsedSeriesIndices.indexOf(r)>-1,A=(m.globals.collapsingSeriesIndices||[]).indexOf(r)>-1,S=`${r}::${this.barCtx._keys(r)[n]}`;if(A){const t=null==(p=m.globals.prevDataLabels)?void 0:p.get(S);t&&isFinite(t.val)&&(i=t.val,s=void 0)}if(u.enabled&&(!_||A)){w=y.group({class:"apexcharts-data-labels",transform:x});const p=m.config.dataLabels;((null==(g=p.animate)?void 0:g.enabled)||(null==(f=p.countUp)?void 0:f.enabled))&&(w.node.setAttribute("data:dlKey",S),w.node.setAttribute("data:dlJ",String(n)),"number"==typeof i&&isFinite(i)&&w.node.setAttribute("data:dlVal",String(i))),void 0===i?s="":void 0===s&&(s=v(i,l(o({},m),{seriesIndex:r,dataPointIndex:n,w:m}))),!i&&m.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(s="");let _=u.textAnchor;"vertical"===m.config.plotOptions.bar.dataLabels.orientation&&(_="center"===m.config.plotOptions.bar.dataLabels.position?"middle":(null!=a?a:m.seriesData.series[r][n]<0)?"end":"start"),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&d<h.width&&(s=""),m.config.chart.stacked&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&!A&&(this.barCtx.isHorizontal?h.width/1.6>Math.abs(d)&&(s=""):h.height/1.6>Math.abs(c)&&(s=""));const C=l(o({},u),{textAnchor:_});this.barCtx.isHorizontal&&i<0&&("start"===_?C.textAnchor="end":"end"===_&&(C.textAnchor="start")),b.plotDataLabelsText({x:t,y:e,text:s,i:r,j:n,parent:w,dataLabelsConfig:C,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return w}drawTotalDataLabels({x:t,y:e,val:i,rawVal:s,realIndex:a,j:r,textAnchor:n,barTotalDataLabelsConfig:o}){var l,h;const c=new R(this.barCtx.w);let d;if(o.enabled&&void 0!==t&&void 0!==e&&this.drawsStackedTotal(a)){d=c.drawText({x:t,y:e,foreColor:o.style.color,text:i,textAnchor:n,fontFamily:o.style.fontFamily,fontSize:o.style.fontSize,fontWeight:o.style.fontWeight}),d.attr({class:"apexcharts-datalabel-total",cx:t,cy:e});const u=this.w.config.dataLabels;if((null==(l=u.animate)?void 0:l.enabled)||(null==(h=u.countUp)?void 0:h.enabled)){const{groupIndex:t}=this.barCtx.barHelpers.getGroupIndex(a);d.node.setAttribute("data:dlTotalKey",`${t}::${this.barCtx._keys(a)[r]}`),d.node.setAttribute("data:dlTotalSeries",String(a)),"number"==typeof s&&isFinite(s)&&d.node.setAttribute("data:dlTotalVal",String(s))}}return d}}function Pi(t){var e,i,s,a,r,n,o;return"histogram"===(null==(i=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:i.requestedType)&&(!1!==(null==(a=null==(s=t.config.plotOptions)?void 0:s.histogram)?void 0:a.overlap)&&(null!=(o=null==(n=null==(r=t.seriesData)?void 0:r.series)?void 0:n.length)?o:0)>1)}let Li=class{constructor(t){this.w=t.w,this.barCtx=t}initVariables(t,e){const i=this.w;this.seriesIndex=e,this.barCtx.series=t,this.barCtx.totalItems=0,this.barCtx.seriesLen=0,this.barCtx.visibleI=-1,this._bgOwner=void 0;for(let e=0;e<t.length;e++)t[e].length>0&&(this.barCtx.seriesLen=this.barCtx.seriesLen+1,this.barCtx.totalItems+=t[e].length);const s=i.labelData.labels;this.rows=i.globals.isBarHorizontal&&i.axisFlags.isXNumeric&&!this.barCtx.isRangeBar&&i.seriesData.seriesX.some(t=>null==t?void 0:t.some((t,e)=>t!==s[e]))?new Map(s.map((t,e)=>[t,e])):null,this.arrBorderRadius=this.createBorderRadiusArr(i.seriesData.series),Zt.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 i=t.globals.maxX-t.globals.minX;e=i>0?i/4:0}else if(e=this._unionMinXGap(),!(e>0&&isFinite(e))){const i=t.globals.minXDiff;e=i>0&&isFinite(i)&&.5!==i?i:0}return this._slotXSpan=e,e}_unionMinXGap(){const t=this.w.seriesData.seriesX||[],e=this.seriesIndex,i=[];for(let s=0;s<t.length;s++){const a=t[s];e&&e.indexOf(s)<0||Array.isArray(a)&&a.length>0&&i.push(a.some((t,e)=>t<a[e-1])?a.filter(t=>t===+t).sort((t,e)=>t-e):a)}if(!i.length)return 0;const s=new Array(i.length).fill(0);let a=NaN,r=1/0;for(;;){let t=1/0,e=-1;for(let a=0;a<i.length;a++){const r=i[a];for(;s[a]<r.length&&"number"!=typeof r[s[a]];)s[a]++;if(s[a]>=r.length)continue;const n=r[s[a]];n==n?n<t&&(t=n,e=a):(s[a]++,a--)}if(-1===e)break;if(s[e]++,a==a){const e=t-a;e>0&&e<r&&(r=e)}a=t}return isFinite(r)?r:0}visibleItems(){const t=this.w.globals;if(!this.w.axisFlags.isXNumeric)return t.dataPoints;let e=1;const i=this.w.seriesData.seriesX;return this.barCtx.series.forEach((s,a)=>{for(let r=0;r<s.length;r++)i[a][r]>t.minX&&i[a][r]<t.maxX&&e++}),e}barRow(t,e){var i,s,a;return null!=(a=null==(s=this.rows)?void 0:s.get(null==(i=this.w.seriesData.seriesX[t])?void 0:i[e]))?a:e}initialPositions(t){const e=this.w;let i,s,a,r,n,o,l,h,c=e.globals.dataPoints;this.barCtx.isRangeBar&&(c=e.labelData.labels.length);let d=this.barCtx.seriesLen;if((e.config.plotOptions.bar.rangeBarGroupRows||Pi(e))&&(d=1),this.barCtx.isHorizontal)a=e.layout.gridHeight/c,n=a/d,n=n*parseInt(this.barCtx.barOptions.barHeight,10)/100,-1===String(this.barCtx.barOptions.barHeight).indexOf("%")&&(n=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=(a-n*this.barCtx.seriesLen)/2;else{const s=this.barCtx.xRatio,a=e.axisFlags.isXNumeric?this.barSlotXSpan():0,n=a>0&&a/s>0;if(r=e.config.xaxis.convertedCatToNumeric?e.layout.gridWidth/e.globals.dataPoints:n?0:e.layout.gridWidth/this.visibleItems(),o=r/d*parseInt(this.barCtx.barOptions.columnWidth,10)/100,e.axisFlags.isXNumeric&&(n&&(r=a/s),o=r/d*parseInt(this.barCtx.barOptions.columnWidth,10)/100,o<1&&(o=1)),-1===String(this.barCtx.barOptions.columnWidth).indexOf("%")&&(o=parseInt(this.barCtx.barOptions.columnWidth,10)),l=e.layout.gridHeight-this.barCtx.baseLineY[this.barCtx.translationsIndex]-(this.barCtx.isReversed?e.layout.gridHeight:0)+(this.barCtx.isReversed?2*this.barCtx.baseLineY[this.barCtx.translationsIndex]:0),e.axisFlags.isXNumeric){i=this.barCtx.getBarXForNumericXAxis({x:i,j:0,realIndex:t,barWidth:o}).x}else i=e.globals.padHorizontal+Zt.noExponents(r-o*this.barCtx.seriesLen)/2}return e.globals.barHeight=n,e.globals.barWidth=o,{x:i,y:s,yDivision:a,xDivision:r,barHeight:n,barWidth:o,zeroH:l,zeroW:h}}initializeStackedPrevVars(t){t.stacks=t.w.labelData.seriesGroups.map(()=>({prevY:[],prevX:[],prevYF:[],prevXF:[],prevYVal:[],prevXVal:[],tops:new Map}))}initializeStackedXYVars(t){t.stacks.forEach(t=>{t.xArrj=[],t.xArrjF=[],t.xArrjVal=[],t.yArrj=[],t.yArrjF=[],t.yArrjVal=[]})}getPathFillColor(t,e,i,s){var a;const r=this.w,n=new F(this.barCtx.w);let o=null;const l=this.barCtx.barOptions.distributed?i:e;let h=!1;if(this.barCtx.barOptions.colors.ranges.length>0){this.barCtx.barOptions.colors.ranges.map(s=>{t[e][i]>=s.from&&t[e][i]<=s.to&&(o=s.color,h=!0)})}const c=this.getDumbbellConnectorFill(e,i)||(null==(a=r.config.series[s].data[i])?void 0:a.fill),d=this.barCtx.barOptions.isDumbbell?r.config.plotOptions.bar.dumbbell.connector:null;let u;d&&d.color&&(o=d.color,u=d.opacity);return{color:n.fillPath({seriesNumber:this.barCtx.barOptions.distributed?l:s,dataPointIndex:i,color:o,opacity:u,value:t[e][i],fillConfig:c,fillType:(null==c?void 0:c.type)?c.type:Array.isArray(r.config.fill.type)?r.config.fill.type[s]:r.config.fill.type}),useRangeColor:h}}getDumbbellConnectorFill(t,e){const i=this.w;if(!this.barCtx.barOptions.isDumbbell)return null;const s=i.dumbbellData;if(!s||"series"!==s.form)return null;const a=i.config.plotOptions.bar.dumbbell.connector;if(a.color)return null;const r=s.order[e];if(!r)return null;const n=i.globals.colors[r[0]],o=i.globals.colors[r[1]];return n&&o?{type:"gradient",gradient:{type:this.barCtx.isHorizontal?"horizontal":"vertical",gradientFrom:n,gradientTo:o,opacityFrom:a.opacity,opacityTo:a.opacity,stops:[0,100],inverseColors:!this.barCtx.isHorizontal}}:null}getStrokeWidth(t,e,i){let s=0;const a=this.w;return void 0===this.barCtx.series[t][e]||null===this.barCtx.series[t][e]||"bar"===a.config.chart.type&&!this.barCtx.series[t][e]?this.barCtx.isNullValue=!0:this.barCtx.isNullValue=!1,a.config.stroke.show&&(this.barCtx.isNullValue||(s=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[i]:this.barCtx.strokeWidth)),s}getStackedSeriesIndices(t){const e=this.w,i=e.labelData.seriesGroups,s=e.globals.columnSeries?new Set(e.globals.columnSeries.i):null,a=t=>!s||s.has(t);if(!i||i.length<2){const e=Array.from({length:t},(t,e)=>e).filter(a);return e.length?[e]:[]}const r=Array.from({length:i.length},()=>[]),n=[];for(let e=0;e<t;e++){if(!a(e))continue;const t=this.getSeriesGroupIndex(e);t>-1?r[t].push(e):n.push(e)}return n.length&&r.push(n),r.filter(t=>t.length>0)}createBorderRadiusArr(t){const e=this.w,i=!this.w.config.chart.stacked||e.config.plotOptions.bar.borderRadius<=0,s=t.length,a=Math.max(0,...t.map(t=>0|(null==t?void 0:t.length))),r=Array.from({length:s},()=>Array(a).fill(i?"top":"none"));if(i)return r;const n="last"===e.config.plotOptions.bar.borderRadiusWhenStacked,o=n?"top":"both",l=n?"bottom":"both",h=n?"none":"bottom",c=n?"none":"top";for(const e of this.getStackedSeriesIndices(s))for(let i=0;i<a;i++){const s=[],a=[];for(const r of e){const e=t[r][i];e>0?s.push(r):e<0&&a.push(r)}if(s.length>0&&0===a.length)if(1===s.length)r[s[0]][i]=o;else{const t=s[0],e=s[s.length-1];for(const a of s)r[a][i]=a===t?h:a===e?"top":"none"}else if(a.length>0&&0===s.length)if(1===a.length)r[a[0]][i]=l;else{const t=Math.min(...a),e=Math.max(...a);for(const s of a)r[s][i]=s===t?c:s===e?"bottom":"none"}else if(s.length>0&&a.length>0){const t=s[s.length-1];for(const e of s)r[e][i]=e===t?"top":"none";const e=Math.max(...a);for(const t of a)r[t][i]=t===e?"bottom":"none"}}return r}barBackground({j:t,i:e,x1:i,x2:s,y1:a,y2:r,elSeries:n}){const o=this.w,l=this.barCtx.barOptions.colors;if(l.backgroundBarColors.length&&(void 0===this._bgOwner&&(this._bgOwner=new W(o).getActiveConfigSeriesIndex()),this._bgOwner===e)){const e=new R(o);t>=l.backgroundBarColors.length&&(t%=l.backgroundBarColors.length);const h=l.backgroundBarColors[t],c=e.drawRect(void 0!==i?i:0,void 0!==a?a:0,void 0!==s?s:o.layout.gridWidth,void 0!==r?r:o.layout.gridHeight,l.backgroundBarRadius,h,l.backgroundBarOpacity);n.add(c),c.node.classList.add("apexcharts-backgroundBar")}}barRect({a:t,len:e,v1:i,v2:s,strokeWidth:a,insetWidth:r,realIndex:n,j:o,dir:l,horizontal:h}){const c=this.w,d=new R(c);(a=Array.isArray(a)?a[n]:a)||(a=0),void 0===r?r=a:(r=Array.isArray(r)?r[n]:r)||(r=0);const u=c.config.series[n].data[o],p=h?null==u?void 0:u.barHeightOffset:null==u?void 0:u.columnWidthOffset;p&&(t-=p/2,e+=p);const g=a/2,f=r/2,m=l*(this.barCtx.isReversed?-1:1),x=a<r,b=x?f:g;let y;const v="around"===c.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[n][o]?" Z":" z";let w,_,A,S,C,k;h?(A=t+f,S=t+e-f,w=i+.001+b*m,y=s+.001-g*m,_=x?w:y,C=d.line(w,S),k=d.move(w,A)+d.line(_,A)+d.line(_,S)+C+v):(w=t+f,_=t+e-f,A=i+.001-b*m,y=s+.001+g*m,S=x?A:y,C=d.line(_,A),k=d.move(w,A)+d.line(w,S)+d.line(_,S)+C+v);const P=c.config.plotOptions.bar.borderRadius;let L=k;return"none"!==this.arrBorderRadius[n][o]&&(L=0===P&&isFinite(w+_+A+S)?k.replace(" Z",` L ${w} ${A} Z`).replace(/ L (\S+ \S+)(?= [LZ])/g," L $1 C $1 $1 $1")+" ":d.roundPathCorners(k,P)),{x1:w,x2:_,y1:A,y2:S,sl:C,closing:v,squarePathTo:k,pathTo:L,base:d.move(w,A)+d.line(w,A)+C+C+C+C+C+d.line(w,A)+v,tip:y,strokeWidth:a,strokeCenter:g,direction:m}}collapsedSign(t,e){var i;const s=this.w.globals,a=[[s.collapsedSeriesIndices,s.collapsedSeries],[s.ancillaryCollapsedSeriesIndices,s.ancillaryCollapsedSeries]];for(const[s,r]of a){if(!s||s.indexOf(t)<0)continue;const a=(r||[]).find(e=>e.index===t),n=null==(i=null==a?void 0:a.data)?void 0:i[e],o=Array.isArray(n)?n[1]:n&&"object"==typeof n?n.y:n;return"number"==typeof o&&o?Math.sign(o):0}return 0}getColumnPaths({barWidth:t,barXPosition:e,y1:i,y2:s,strokeWidth:a,insetWidth:r,series:n,realIndex:o,i:l,j:h,w:c}){var d,u,p;const g=this.barRect({a:e,len:t,v1:i,v2:s,strokeWidth:a,insetWidth:r,realIndex:o,j:h,dir:this.collapsedSign(o,h)||(n[l][h]>=0?1:-1)}),{pathTo:f,squarePathTo:m,strokeCenter:x,direction:b}=g;i=g.y1,s=g.y2;let y=null;const v=null==(u=null==(d=this.barCtx.ctx)?void 0:d.morphTypeChange)?void 0:u.getInitialPathFor(o,h);if(v?y=v:c.globals.previousPaths.length>0&&(y=this.barCtx.getPreviousPath(o,h,f,m)),null==y&&(y=g.base),c.config.chart.stacked){const t=this.barCtx.groupCtx;t.yArrj.push(g.tip-x*b),t.yArrjF.push(Math.abs(i-s+g.strokeWidth*b)),t.yArrjVal.push(null!=(p=this.barCtx.series[l][h])?p:null)}return{pathTo:f,pathFrom:y,drawnBox:{x1:g.x1,x2:g.x2,y1:i,y2:s}}}getFunnelTrapezoidPaths({barYPosition:t,barHeight:e,series:i,i:s,j:a,realIndex:r,strokeWidth:n,w:o}){var l,h;const c=new R(this.barCtx.w),d=o.layout.gridWidth/2,u=t=>Math.abs(t/this.barCtx.invertedYRatio)/2,p=u(i[s][a]),g=a===i[s].length-1,f="taper"===o.config.plotOptions.funnel.lastShape?"taper":"flat";let m;m=g?"taper"===f?0:p:u(i[s][a+1]);const x=n/2,b=t+x,y=t+e-x,v=d-p,w=d+p,_=d-m,A=d+m,S=c.move(v,b)+c.line(w,b)+c.line(A,y)+c.line(_,y)+" Z";let C=null;const k=null==(h=null==(l=this.barCtx.ctx)?void 0:l.morphTypeChange)?void 0:h.getInitialPathFor(r,a);return k?C=k:o.globals.previousPaths.length>0&&(C=this.barCtx.getPreviousPath(r,a,S)),null==C&&(C=c.move(d,b)+c.line(d,b)+c.line(d,y)+c.line(d,y)+" Z"),{pathTo:S,pathFrom:C,x:w,x1:v,barXPosition:d}}computePyramidLayout(t){const e=this.w,i=e.layout.gridHeight,s=e.layout.gridWidth,a=t.map(t=>Math.abs(Number(t)||0)),r=a.reduce((t,e)=>t+e,0);if(0===r||i<=0)return a.map(()=>({y:0,height:0,topHalf:0,bottomHalf:0}));const n=s/2;let o=0;const l=[];for(let t=0;t<a.length;t++){const e=o/r;o+=a[t];const s=o/r,h=e*i,c=s*i;l.push({y:h,height:c-h,topHalf:e*n,bottomHalf:s*n})}return l}getPyramidPaths({barYPosition:t,barHeight:e,topHalf:i,bottomHalf:s,realIndex:a,j:r,strokeWidth:n,w:o}){var l,h;const c=new R(this.barCtx.w),d=o.layout.gridWidth/2,u=n/2,p=t+u,g=t+e-u,f=d-i,m=d+i,x=d-s,b=d+s,y=c.move(f,p)+c.line(m,p)+c.line(b,g)+c.line(x,g)+" Z";let v=null;const w=null==(h=null==(l=this.barCtx.ctx)?void 0:l.morphTypeChange)?void 0:h.getInitialPathFor(a,r);return w?v=w:o.globals.previousPaths.length>0&&(v=this.barCtx.getPreviousPath(a,r,y)),null==v&&(v=c.move(d,p)+c.line(d,p)+c.line(d,g)+c.line(d,g)+" Z"),{pathTo:y,pathFrom:v,x:m,x1:f,barXPosition:d}}getBarpaths({barYPosition:t,barHeight:e,x1:i,x2:s,strokeWidth:a,series:r,realIndex:n,i:o,j:l,w:h}){var c,d,u;const p=new R(this.barCtx.w),g=this.barRect({a:t,len:e,v1:i,v2:s,strokeWidth:a,realIndex:n,j:l,dir:r[o][l]>=0?1:-1,horizontal:!0}),{y1:f,y2:m,sl:x,closing:b,squarePathTo:y,pathTo:v,strokeCenter:w,direction:_}=g;i=g.x1,s=g.x2;const A=this.barCtx.isFunnel,S=A?(i+s)/2:i;let C=null;const k=null==(d=null==(c=this.barCtx.ctx)?void 0:c.morphTypeChange)?void 0:d.getInitialPathFor(n,l);if(k?C=k:h.globals.previousPaths.length>0&&(C=this.barCtx.getPreviousPath(n,l,v,y)),null==C){const t=A?p.line(S,m):x;C=p.move(S,f)+p.line(S,f)+t+t+t+t+t+p.line(S,f)+b}if(h.config.chart.stacked){const t=this.barCtx.groupCtx;t.xArrj.push(s+w*_),t.xArrjF.push(Math.abs(i-s-g.strokeWidth*_)),t.xArrjVal.push(null!=(u=this.barCtx.series[o][l])?u:null)}return{pathTo:v,pathFrom:C,drawnBox:{x1:i,x2:s,y1:f,y2:m}}}getXForValue(t,e,i=!0){let s=i?e:null;return null!=t&&(s=e+t/this.barCtx.invertedYRatio-2*(this.barCtx.isReversed?t/this.barCtx.invertedYRatio:0)),s}getYForValue(t,e,i,s=!0){let a=s?e:null;return null!=t&&(a=e-t/this.barCtx.yRatio[i]+2*(this.barCtx.isReversed?t/this.barCtx.yRatio[i]:0)),a}getGoalValues(t,e,i,s,a,r){const n=this.w,h=[],c=(a,o)=>{n.globals.invalidLogScale||(a=new P(n).getLogValAtSeriesIndex(a,s)),h.push({[t]:"x"===t?this.getXForValue(a,e,!1):this.getYForValue(a,i,r,!1),attrs:o})};if(n.seriesData.seriesGoals[s]&&n.seriesData.seriesGoals[s][a]&&Array.isArray(n.seriesData.seriesGoals[s][a])&&n.seriesData.seriesGoals[s][a].forEach(t=>{c(t.value,t)}),this.barCtx.barOptions.isDumbbell){const e=this.getDumbbellEnds(s,a);if(e.length){const i={strokeHeight:"x"===t?0:n.globals.markers.size[s],strokeWidth:"x"===t?n.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 d=n.config.plotOptions.bar.dumbbell.dataLabels;e.forEach((t,e)=>{const n=l(o({},i),{strokeColor:t.color});!d.enabled||e!==r&&e!==h||(n.label={text:this.getDumbbellLabelText(t.value,s,a,t.index),color:d.colorFromMarker?t.color:Array.isArray(d.style.colors)?d.style.colors[t.index]||d.style.colors[0]:d.style.colors,outward:e===r&&r!==h?-1:1}),c(t.value,n)})}}return h}getDumbbellEnds(t,e){const i=this.w,s=[],a=i.dumbbellData;if(a&&"series"===a.form){const t=a.values[e]||[];for(let e=0;e<t.length;e++){const r=t[e];null!==r&&-1===a.hidden.indexOf(e)&&s.push({value:r,color:i.globals.colors[e],index:e})}return s}if(!i.rangeData.seriesRange.length)return s;const r=this.barCtx.barOptions.dumbbellColors?this.barCtx.barOptions.dumbbellColors:i.globals.colors,n=e=>Array.isArray(r[t])?r[t][e]:r[t];return[{value:i.rangeData.seriesRangeStart[t][e],color:n(0),index:0},{value:i.rangeData.seriesRangeEnd[t][e],color:n(1),index:1}]}getDumbbellLabelText(t,e,i,s){const a=this.w,r=a.config.plotOptions.bar.dumbbell.dataLabels;if("function"==typeof r.formatter)return r.formatter(t,{seriesIndex:e,dataPointIndex:i,endpointIndex:s,w:a});const n=this.barCtx.isHorizontal?a.formatters.xLabelFormatter:a.formatters.yLabelFormatters[0];return"function"==typeof n?n(t,i,a):String(t)}drawGoalLine({barXPosition:t,barYPosition:e,goalX:i,goalY:s,barWidth:a,barHeight:r}){if(!(Array.isArray(i)&&i.length>0||Array.isArray(s)&&s.length>0))return null;const n=new R(this.barCtx.w),o=n.group({class:"apexcharts-bar-goals-groups"});o.node.classList.add("apexcharts-element-hidden"),this.barCtx.w.globals.delayedElements.push({el:o.node}),o.attr("clip-path",`url(#gridRectMarkerMask${this.barCtx.w.globals.cuid})`);let l=null;return this.barCtx.isHorizontal?Array.isArray(i)&&i.forEach(t=>{if(t.x>=-1&&t.x<=n.w.layout.gridWidth+1){const i=void 0!==t.attrs.strokeHeight?t.attrs.strokeHeight:r/2,s=e+i+r/2;l=n.drawLine(t.x,s-2*i,t.x,s,t.attrs.strokeColor?t.attrs.strokeColor:void 0,t.attrs.strokeDashArray,t.attrs.strokeWidth?t.attrs.strokeWidth:2,t.attrs.strokeLineCap),o.add(l),t.attrs.label&&o.add(this.drawDumbbellLabel(t.attrs,{x:t.x,y:s-i,horizontal:!0,markerSize:t.attrs.strokeWidth||0}))}}):Array.isArray(s)&&s.forEach(e=>{if(e.y>=-1&&e.y<=n.w.layout.gridHeight+1){const i=void 0!==e.attrs.strokeWidth?e.attrs.strokeWidth:a/2,s=t+i+a/2;l=n.drawLine(s-2*i,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),o.add(l),e.attrs.label&&o.add(this.drawDumbbellLabel(e.attrs,{x:s-i,y:e.y,horizontal:!1,markerSize:e.attrs.strokeHeight||0}))}}),o}drawDumbbellLabel(t,e){const i=this.w,s=new R(i),a=i.config.plotOptions.bar.dumbbell.dataLabels,r=e.markerSize/2+a.offset,n=t.label.outward;return s.drawText({x:e.x+(e.horizontal?r*n:0),y:e.y-(e.horizontal?0:r*n),text:t.label.text,textAnchor:e.horizontal?n<0?"end":"start":"middle",dominantBaseline:e.horizontal?"central":n<0?"hanging":"auto",foreColor:t.label.color,fontSize:a.style.fontSize,fontFamily:a.style.fontFamily,fontWeight:a.style.fontWeight,cssClass:"apexcharts-dumbbell-label"})}drawBarShadow({prevPaths:t,currPaths:e,color:i,realIndex:s,j:a}){const r=this.w,{x:n,x1:o,barYPosition:l}=t,{x:h,x1:c,barYPosition:d}=e,u=l+e.barHeight,p=new R(this.barCtx.w),g=new Zt,f=p.move(o,u)+p.line(n,u)+p.line(h,d)+p.line(c,d)+p.line(o,u)+("around"===r.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[s][a]?" Z":" z");return p.drawPath({d:f,fill:g.shadeColor(.5,Zt.rgb2hex(i)),stroke:"none",strokeWidth:0,fillOpacity:1,classes:"apexcharts-bar-shadow apexcharts-decoration-element"})}getZeroValueEncounters({i:t,j:e}){var i;const s=this.w;let a=0,r=0;return(s.config.plotOptions.bar.horizontal?s.seriesData.series.map((t,e)=>e):(null==(i=s.globals.columnSeries)?void 0:i.i.map(t=>t))||[]).forEach(i=>{const n=s.seriesData.series[i][e];n&&a++,i<t&&!n&&r++}),{nonZeroColumns:a,zeroEncounters:r}}getSeriesGroupIndex(t){var e;return null!=(e=this.w.labelData.seriesGroupIndex[t])?e:-1}getGroupIndex(t){const e=this.getSeriesGroupIndex(t),i=this.barCtx.columnGroupIndices;let s=i.indexOf(e);return s<0&&(i.push(e),s=i.length-1),{groupIndex:e,columnGroupIndex:s}}};function Mi(t,e,i){if(!t||"string"!=typeof t)return null;const s=yt(t);if(!s.length||"M"!==s[0][0])return null;for(let t=1;t<s.length;t++)if("M"===s[t][0])return null;let a=s,r=null;if(i){if(s.length<5)return null;if(r=s.slice(-3),a=s.slice(0,-3),"Z"!==r[2][0])return null;if("L"!==r[1][0])return null;if("L"!==r[0][0]&&"C"!==r[0][0])return null}else if("Z"===s[s.length-1][0])return null;if(a.length!==e||a.length<2)return null;const n=a[1][0];if("L"!==n&&"C"!==n)return null;for(let t=2;t<a.length;t++)if(a[t][0]!==n)return null;const o=a.map(t=>"C"===t[0]?[Number(t[5]),Number(t[6])]:[Number(t[1]),Number(t[2])]);for(const t of o)if(!isFinite(t[0])||!isFinite(t[1]))return null;return{body:a,closing:r,segType:n,anchors:o}}function Ii(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i]}function Ei(t,e,i){const s=t,a=[e[1],e[2]],r=[e[3],e[4]],n=[e[5],e[6]],o=Ii(s,a,i),l=Ii(a,r,i),h=Ii(r,n,i),c=Ii(o,l,i),d=Ii(l,h,i),u=Ii(c,d,i);return{first:["C",o[0],o[1],c[0],c[1],u[0],u[1]],second:["C",d[0],d[1],h[0],h[1],n[0],n[1]],mid:u}}function Fi(t,e,i){const s=[e[1],e[2]],a=Ii(t,s,i);return{first:["L",a[0],a[1]],second:["L",s[0],s[1]],mid:a}}function Di(t,e){const{body:i,closing:s,segType:a,anchors:r}=t,n=r.length,o=e.length,l=t=>"C"===a?["C",t[0],t[1],t[0],t[1],t[0],t[1]]:["L",t[0],t[1]],h=[["M",r[0][0],r[0][1]]];let c=0;for(;c<o&&0!==e[c];)c++;for(let t=1;t<=c;t++)h.push(l(r[0]));let d=c+1;for(let t=0;t<n-1;t++){let s=0;for(;d+s<o&&-1===e[d+s];)s++;const n=i[t+1];if(s){const e=s+1;let i=r[t],o=n;for(let t=0;t<s;t++){const s=1/(e-t),r="C"===a?Ei(i,o,s):Fi(i,o,s);h.push(r.first),i=r.mid,o=r.second}h.push(o)}else h.push(n.slice());d+=s+1}for(;d<o;)h.push(l(r[n-1])),d++;return s&&s.forEach(t=>h.push(t.slice())),h}function Ti(t,e,i,s,a,r){const n=Mi(t,s,r);if(!n)return null;const o=Mi(e,a,r);if(!o)return null;if(n.segType!==o.segType)return null;if((n.closing||o.closing)&&(!n.closing||!o.closing||n.closing[0][0]!==o.closing[0][0]))return null;const l=i.map(t=>t.oldJ),h=i.map(t=>t.newJ);return{from:_t(Di(n,l)),toInterp:_t(Di(o,h))}}function Ri(t){var e;const i=t.config.chart.animations;if(!i||!1===i.enabled)return!1;if(!i.dynamicAnimation||!1===i.dynamicAnimation.enabled)return!1;const s=null!=(e=i.largeDatasetThreshold)?e:0;return!(s>0&&t.globals.dataPoints>s)&&!!(Nt.isBrowser()&&t.globals.dataChanged&&t.globals.shouldAnimate)}function zi(t,e,i,s,a){if(t){const t=null==e?void 0:e[s];if(t&&t.length&&null!=t[a])return"x:"+t[a]}const r=null==i?void 0:i[a];return null!=r&&""!==String(r)?"c:"+(Array.isArray(r)?r.join(" "):String(r)):"j:"+a}function Xi(t,e){const i=new Map;t.forEach((t,e)=>{i.has(t)||i.set(t,e)});const s=new Array(e.length),a=new Set;let r=-1,n=!0,o=t.length===e.length;e.forEach((t,e)=>{const l=i.has(t)&&!a.has(i.get(t))?i.get(t):-1;s[e]=l,-1!==l&&(a.add(l),l<r&&(n=!1),r=l),l!==e&&(o=!1)});const l=[];for(let e=0;e<t.length;e++)a.has(e)||l.push(e);return{toOld:s,exits:l,ordered:n,changed:!o}}function Oi(t){const e=new Map;return t.map(t=>{const i=e.get(t)||0;return e.set(t,i+1),0===i?t:`${t}#${i}`})}function $i(t,e,i=0|(i=>null==(i=t.seriesData.series[e])?void 0:i.length)()){return Oi(Array.from({length:i},(i,s)=>function(t,e,i){var s,a;return zi(null==(s=t.axisFlags)?void 0:s.isXNumeric,null==(a=t.seriesData)?void 0:a.seriesX,t.globals.labels,e,i)}(t,e,s)))}function Wi(t,e,i=!1,s=!1,a=function(t,e){var i,s;if(!Ri(t))return null;const a=t.globals.prevStreamFrame;if(!a)return null;const r=null==(i=a.seriesY)?void 0:i[e],n=null==(s=t.seriesData.series)?void 0:s[e];if(!Array.isArray(r)||!Array.isArray(n))return null;if(!r.length||!n.length)return null;const o=Oi(r.map((t,i)=>function(t,e,i){return zi(t.isXNumeric,t.seriesX,t.labels,e,i)}(a,e,i))),l=$i(t,e);return{join:Xi(o,l),oldKeys:o,newKeys:l}}(t,e)){return a&&(a.join.ordered||s)&&(a.join.changed||i)?a:null}function Yi(t){var e,i;const s=t.config.chart.animations;return w(null!=(i=null==(e=s.dynamicAnimation)?void 0:e.easing)?i:s.easing)}function Hi(t,e,i,s,a,r,n=performance.now()){const o=l=>{if(t.globals.isDestroyed||r&&!r())return;const h=Math.max(0,Math.min(1,(l-n)/e));s(i(h),h),h<1?ft.requestAnimationFrame(o):a&&a()};return ft.requestAnimationFrame(o),()=>{r=()=>!1}}const Bi=(t,e)=>()=>t.dom.baseEl.contains(e.node);function Ni(t,{elPointsMain:e,realIndex:i,speed:s,join:a}){var r,n,o,l;if(!(null==e?void 0:e.node)||!t.globals.prevStreamFrame||!Ri(t))return!1;const h=e.node.querySelectorAll(".apexcharts-marker");if(!h.length)return!1;const c=Wi(t,i,!0,!1,null==a?void 0:a());if(!c)return!1;const d=t.globals.prevStreamFrame,u=null==(r=d.xPixels)?void 0:r[i],p=null==(n=d.yPixels)?void 0:n[i];if(!u||!p)return!1;const g=(null==(o=t.globals.seriesXvalues)?void 0:o[i])||[],f=(null==(l=t.globals.seriesYvalues)?void 0:l[i])||[],m=Yi(t),x=Math.max(1,s||1);e.node.classList.remove("apexcharts-element-hidden");const b=Bi(t,e);return h.forEach(e=>{var s,a,r,n,o,l,h,y,v;const w=parseInt(null!=(a=null!=(s=e.getAttribute("j"))?s:e.getAttribute("rel"))?a:"",10);if(!isFinite(w)||w<0||w>=c.join.toOld.length)return;const _=c.join.toOld[w],A=null!=g[w]&&null!=f[w]?[g[w],f[w]]:null;if(-1===_||!A){const i=e.style;return i.opacity="0",void Hi(t,x,m,t=>{i.opacity=String(t)},()=>{i.opacity=""},b)}const S=(null!=(r=u[_])?r:NaN)-A[0],C=(null!=(n=p[_])?n:NaN)-A[1];if(!isFinite(S)||!isFinite(C))return;const k=null!=(h=null==(l=null==(o=d.rPixels)?void 0:o[i])?void 0:l[_])?h:NaN,P=parseFloat(null!=(v=null!=(y=e.getAttribute("r"))?y:e.getAttribute("default-marker-size"))?v:""),L=isFinite(k)&&isFinite(P)&&P>0&&Math.abs(k-P)>.25;if(!(Math.abs(S)>=.5||Math.abs(C)>=.5)&&!L)return;const M=t=>{const i=S*(1-t),s=C*(1-t);if(L){const a=(k+(P-k)*t)/P;e.setAttribute("transform",`translate(${i+A[0]*(1-a)}, ${s+A[1]*(1-a)}) scale(${a})`)}else e.setAttribute("transform",`translate(${i}, ${s})`)};M(0),Hi(t,x,m,M,()=>e.removeAttribute("transform"),b)}),!0}function ji(t,e,i,s){t.setAttribute("transform",`translate(${e*(1-s)}, ${i*(1-s)}) scale(${s})`)}function Vi(t,{type:e,realIndex:i,pathFromLine:s,pathFromArea:a,linePaths:r,areaPaths:n,join:o}){var l,h;const c=Wi(t,i,!1,!1,null==o?void 0:o());if(!c)return null;const{join:d,oldKeys:u,newKeys:p}=c,g=null==(l=t.globals.prevStreamFrame.seriesY)?void 0:l[i],f=null==(h=t.seriesData.series)?void 0:h[i];if(g.length<2||f.length<2)return null;if(g.some(t=>null===t)||f.some(t=>null===t))return null;const m=function(t,e){const i=new Set(t.exits),s=[];let a=0;for(let e=0;e<t.toOld.length;e++){const r=t.toOld[e];if(-1!==r){for(;a<r;)i.has(a)&&s.push({oldJ:a,newJ:-1}),a++;s.push({oldJ:r,newJ:e}),a=r+1}else s.push({oldJ:-1,newJ:e})}for(;a<e;)i.has(a)&&s.push({oldJ:a,newJ:-1}),a++;return s}(d,u.length),x={};return Array.isArray(r)&&1===r.length&&s&&(x.line=Ti(s,r[0],m,u.length,p.length,!1)),"area"===e&&Array.isArray(n)&&1===n.length&&a&&(x.area=Ti(a,n[0],m,u.length,p.length,!0)),x.line||x.area?x:null}const Gi=t=>1-Math.pow(1-t,3);function qi({w:t,elSeries:e,record:i,newKeys:s,isHorizontal:a,speed:r}){var n;if(!Ri(t))return;if(!i||!Array.isArray(i.paths)||!(null==e?void 0:e.node))return;const o=new Set(s),l=i.paths.filter(t=>t&&t.d&&null!=t.key&&!o.has(t.key));if(!l.length)return;const h=new R(t),c=null==(n=t.globals.colors)?void 0:n[parseInt(String(i.realIndex),10)],d=e.node,u=d.ownerDocument.createDocumentFragment(),p=l.map(e=>{let i=e.fill||c||"#c8c8c8";0===String(i).indexOf("url(")&&(i=c||"#c8c8c8");const s=h.drawPath({d:e.d,stroke:"none",strokeWidth:0,fill:i,fillOpacity:1,classes:"apexcharts-bar-ghost"}),a=s.node;return a.setAttribute("pointer-events","none"),s.attr("clip-path",`url(#gridRectBarMask${t.globals.cuid})`),u.insertBefore(a,u.firstChild),a});d.insertBefore(u,d.firstChild);const g=p.map(t=>{try{return t.getBBox()}catch(t){return null}}),f=performance.now();l.forEach((e,s)=>{const n=p[s],o=g[s],l=function(t){const e=/^M\s*([+-]?[\d.eE]+)[\s,]+([+-]?[\d.eE]+)/.exec(t||"");if(!e)return null;const i=parseFloat(e[1]),s=parseFloat(e[2]);return isFinite(i)&&isFinite(s)?{x:i,y:s}:null}(e.d),h=!l||!o||(a?Math.abs(l.x-o.x)<=Math.abs(l.x-(o.x+o.width)):Math.abs(l.y-(o.y+o.height))<=Math.abs(l.y-o.y)),c=n.style;if(c.transformBox="fill-box",c.transformOrigin=a?h?"left center":"right center":h?"center bottom":"center top",n.setAttribute("data:ghostKey",`${i.realIndex}::${e.key}`),n.setAttribute("data:ghostStart",String(f)),o){const t=a?h?o.x:o.x+o.width:h?o.y+o.height:o.y;isFinite(t)&&n.setAttribute("data:ghostEdge",String(t))}Hi(t,Math.max(1,r||1),Gi,t=>{const e=1-t;c.transform=a?`scaleX(${e})`:`scaleY(${e})`,c.opacity=String(e)},()=>n.remove(),()=>n.parentNode,f)})}const Zi=new WeakMap;function Ui(t,e){const i=t.globals.previousPaths;let s=Zi.get(i);if(!s||s.n!==i.length){s={n:i.length,m:new Map};for(const t of i){const e=parseInt((t||{}).realIndex,10);if(e==e){const i=s.m.get(e);i?i.push(t):s.m.set(e,[t])}}Zi.set(i,s)}return s.m.get(parseInt(String(e),10))||[]}class Ki{constructor(t,e,i){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=i,this.xRatio=0,this.yRatio=[],this.invertedXRatio=0,this.invertedYRatio=0,this.baseLineY=[],this.baseLineInvertedY=0,null!==this.xyRatios&&(this.xRatio=i.xRatio,this.yRatio=i.yRatio,this.invertedXRatio=i.invertedXRatio,this.invertedYRatio=i.invertedYRatio,this.baseLineY=i.baseLineY,this.baseLineInvertedY=i.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 W(this.w);this.lastActiveBarSerieIndex=s.getActiveConfigSeriesIndex("desc",["bar","column"]),this.lastActiveBarSerieIndexByGroup=s.getActiveConfigSeriesIndexByGroup(["bar","column"]),this.columnGroupIndices=[];const a=s.getBarSeriesIndices(),r=new P(this.w);this.stackedSeriesTotals=r.getStackedSeriesTotals(this.w.config.series.map((t,e)=>-1===a.indexOf(e)?e:-1).filter(t=>-1!==t)),this.barHelpers=new Li(this)}setSeriesAxis(t){var e;return this.yRatio.length>1&&(this.yaxisIndex=this.w.globals.seriesYAxisReverseMap[t],this.translationsIndex=t),this.isReversed=null==(e=this.w.config.yaxis[this.yaxisIndex])?void 0:e.reversed,this.translationsIndex}draw(t,e){var i,s,a,r,n;const h=this.w,c=new R(this.w),d=new P(this.w);t=d.getLogSeries(t),this.series=t,this.yRatio=d.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t,e);const u=c.group({class:"apexcharts-bar-series apexcharts-plot-series"}),p=this.ctx.highlightFilter;h.config.dataLabels.enabled&&this.totalItems>this.barOptions.dataLabels.maxItems&&console.warn("WARNING: DataLabels are enabled but there are too many to display. This may cause performance issue when rendering - ApexCharts");for(let d=0,g=0;d<t.length;d++,g++){let f,m;const x=[],b=[],y=h.globals.comboCharts?e[d]:d,{columnGroupIndex:v}=this.barHelpers.getGroupIndex(y),w=c.group({class:"apexcharts-series",rel:d+1,seriesName:Zt.escapeString(h.seriesData.seriesNames[y]),"data:realIndex":y});W.addCollapsedClassToSeries(this.w,w,y),t[d].length>0&&(this.visibleI=this.visibleI+1);const _=this.setSeriesAxis(y);this.isPyramid&&(this.pyramidLayout=this.barHelpers.computePyramidLayout(t[d]));const A=this.barHelpers.initialPositions(y),{y:S,yDivision:C,zeroW:k,x:P,xDivision:L,zeroH:M}=A;let I=A.barHeight,E=A.barWidth;m=S,f=P,this.isHorizontal||b.push(f+(null!=E?E:0)/2);const F=c.group({class:"apexcharts-datalabels","data:realIndex":y}),T=h.config.dataLabels,R=!(null==(i=T.animate)?void 0:i.enabled)&&this.isLengthTransition(y);h.globals.dataChanged&&!R&&!(!(null==(s=T.animate)?void 0:s.enabled)&&!(null==(a=T.countUp)?void 0:a.enabled))||(h.globals.delayedElements.push({el:F.node,holdUntilComplete:R}),F.node.classList.add("apexcharts-element-hidden"));const z=c.group({class:"apexcharts-bar-goals-markers"}),X=c.group({class:"apexcharts-bar-shadows"}),O=this.ctx,$=O._barShadows,Y=O._barShadows=[],H=h.globals.dataChanged&&h.globals.shouldAnimate&&h.config.chart.animations.dynamicAnimation.enabled&&(null==$?void 0:$.length)===t[d].length-1;H||(h.globals.delayedElements.push({el:X.node}),X.node.classList.add("apexcharts-element-hidden"));for(let e=0;e<t[d].length;e++){const i=this.barHelpers.getStrokeWidth(d,e,y);let s=null;const a={indexes:{i:d,j:e,realIndex:y,translationsIndex:_,bc:g},x:f,y:m,strokeWidth:i,elSeries:w};this.isHorizontal?(s=this.drawBarPaths(l(o(o({},a),this.barHelpers.rows&&{y:S+this.barHelpers.barRow(y,e)*C}),{barHeight:I,zeroW:k,yDivision:C})),E=this.series[d][e]/this.invertedYRatio):(s=this.drawColumnPaths(l(o({},a),{xDivision:L,barWidth:E,zeroH:M})),I=this.series[d][e]/this.yRatio[_]);const c=this.barHelpers.getPathFillColor(t,d,e,y);if(this.isFunnel&&!this.isPyramid&&this.barOptions.isFunnel3d&&"trapezoid"!==(null==(r=h.config.plotOptions.funnel)?void 0:r.shape)&&this.pathArr.length&&e>0){const t=this.barHelpers.drawBarShadow({color:"string"==typeof c.color&&-1===(null==(n=c.color)?void 0:n.indexOf("url"))?c.color:Zt.hexToRgba(h.globals.colors[d]),prevPaths:this.pathArr[this.pathArr.length-1],currPaths:s,realIndex:y,j:e});if(X.add(t),Y.push(t),this._shadow=H&&[t,$[e-1].attr("d")],h.config.chart.dropShadow.enabled){new D(this.w).dropShadow(t,h.config.chart.dropShadow,y)}}this.pathArr.push(s);const u=this.barHelpers.drawGoalLine({barXPosition:s.barXPosition,barYPosition:s.barYPosition,goalX:s.goalX,goalY:s.goalY,barHeight:I,barWidth:E});u&&z.add(u),m=s.y,f=s.x,e>0&&b.push(f+(null!=E?E:0)/2),x.push(m),this.renderSeries(l(o({hl:null==p?void 0:p.bar(this,{i:d,j:e,realIndex:y,translationsIndex:_,paths:s,zeroH:M,zeroW:k}),realIndex:y,pathFill:c.color},c.useRangeColor?{lineFill:c.color}:{}),{j:e,i:d,columnGroupIndex:v,pathFrom:s.pathFrom,pathTo:s.pathTo,strokeWidth:i,elSeries:w,x:f,y:m,series:t,barHeight:Math.abs(s.barHeight?s.barHeight:I),barWidth:Math.abs(s.barWidth?s.barWidth:E),barXPosition:s.barXPosition,elDataLabelsWrap:F,elGoalsMarkers:z,elBarShadows:X,visibleSeries:this.visibleI,type:"bar"}))}h.globals.seriesXvalues[y]=b,h.globals.seriesYvalues[y]=x,h.globals.previousPaths.length>0&&qi({w:h,elSeries:w,record:this._prevRecord(y),newKeys:this._keys(y),isHorizontal:this.isHorizontal,speed:h.config.chart.animations.dynamicAnimation.speed}),u.add(w)}return u}renderSeries({hl:t,realIndex:e,pathFill:i,lineFill:s,j:a,i:r,columnGroupIndex:n,pathFrom:h,pathTo:c,strokeWidth:d,elSeries:g,x:f,y:m,y1:x,y2:b,series:y,barHeight:v,barWidth:w,barXPosition:_,barYPosition:A,elDataLabelsWrap:S,elGoalsMarkers:C,elBarShadows:k,visibleSeries:P,type:L,classes:M,fadeReveal:I=!1,noLabel:E}){var F,T,z,X,O,$,W;const Y=this.w,H=new R(this.w,this.ctx),B=oi(this.ctx,H);let N=!1;const j=this._pathToInterp;if(this._pathToInterp=null,g._bindingsDelegated||(g._bindingsDelegated=!0,H.setupEventDelegation(g,`.apexcharts-${L}-area`)),!s){let t=function(t){const e=Y.config.stroke.colors;let i;return Array.isArray(e)&&e.length>0&&(i=e[t],i||(i=""),"function"==typeof i)?i({value:Y.seriesData.series[t][a],dataPointIndex:a,w:Y}):i};const i="function"==typeof Y.globals.stroke.colors[e]?t(e):Y.globals.stroke.colors[e];s=this.barOptions.distributed?Y.globals.stroke.colors[a]:i}const V=Y.config.chart.animations,G=V.animateGradually;let q=0,Z=0;if(G&&!1!==G.enabled&&!(Y.globals.dataChanged&&this.isLayoutShift(e))){const t=Y.globals.dataPoints||1,e=G.delay||0,i=Math.min(e,.5*V.speed/Math.max(1,t));Z=p({style:"sequential",index:a,baseDelay:i}),Y.config.chart.stacked&&!Y.globals.dataChanged&&(Z+=r*i*.5);q=Z/(e||1)}const U=new ki(this).handleBarDataLabels({x:f,y:m,y1:x,y2:b,i:r,j:a,series:y,realIndex:e,columnGroupIndex:n,barHeight:v,barWidth:w,barXPosition:_,barYPosition:A,visibleSeries:P,hl:null==t?void 0:t.label,noLabel:E});if(Z>0){const t=Y.config.dataLabels;if((null==(F=t.animate)?void 0:F.enabled)||(null==(T=t.countUp)?void 0:T.enabled)){const t=String(Math.round(Z));null==(X=null==(z=U.dataLabels)?void 0:z.node)||X.setAttribute("data:dlDelay",t),null==($=null==(O=U.totalDataLabels)?void 0:O.node)||$.setAttribute("data:dlDelay",t)}}let K=!1;if(!Y.globals.isBarHorizontal){const t=void 0===_?U.dataLabelsPos.dataLabelsX:_+w/2,i=Math.max(w,Y.globals.barPadForNumericAxis);(t+i<0||t-i>Y.layout.gridWidth)&&(this._wasOnScreen(e,a)?K=!0:N=!0)}const J=Y.config.series[e].data[a];J&&J.strokeColor&&(s=J.strokeColor);const Q=i;if(this.isNullValue&&-1===Y.globals.collapsingSeriesIndices.indexOf(e)&&(i="none"),!N){const n=!0===(null==(W=this.ctx.morphTypeChange)?void 0:W.isActive()),p=n?this.ctx.morphTypeChange.getSpeed():Y.config.chart.animations.dynamicAnimation.speed,f=n&&this.ctx.morphTypeChange.claimsTargetMark(e,a);f&&(h=c,q=0);const m=B.renderPaths({i:r,j:a,realIndex:e,pathFrom:h,pathTo:c,stroke:s,strokeWidth:d,strokeLinecap:Y.config.stroke.lineCap,fill:i,pathToInterp:j,animationDelay:q,initialSpeed:Y.config.chart.animations.speed,dataChangeSpeed:p,className:`apexcharts-${L}-area${M?` ${M}`:""}`,chartType:L,bindEventsOnPaths:!1,fadeReveal:I});m.attr("clip-path",`url(#gridRectBarMask${Y.globals.cuid})`),K&&m.node.classList.add("apexcharts-leaving");const y=this._shadow;y&&(this._shadow=null,new u(Y,this.ctx).animatePathsGradually({el:y[0],fill:"none",pathFrom:y[1],pathTo:y[0].attr("d"),speed:p,delay:q})),f&&(m.node.setAttribute("opacity","0"),m.node.setAttribute("data-piece-hidden","1"));const _=Y.config.forecastDataPoints;_.count>0&&a>=Y.globals.dataPoints-_.count&&(m.node.setAttribute("stroke-dasharray",_.dashArray),m.node.setAttribute("stroke-width",_.strokeWidth),m.node.setAttribute("fill-opacity",_.fillOpacity)),void 0!==x&&void 0!==b&&(m.attr("data-range-y1",x),m.attr("data-range-y2",b));if(new D(this.w).setSelectionFilter(m,e,a),g.add(m),m.attr({cy:U.dataLabelsPos.bcy,cx:U.dataLabelsPos.bcx,j:a,val:Y.seriesData.series[e][a],barHeight:v,barWidth:w,"data:pathKey":this._keys(e)[a]}),null==t||t.paint(m,{delay:q,delayMs:Z,speed:p,fill:Q,elSeries:g,elBarShadows:k,labels:U.dataLabels,pathFrom:h,pathTo:c}),"canvas"===B.kind){Y.globals.barCanvasCoords||(Y.globals.barCanvasCoords={}),Y.globals.barCanvasCoords[e]||(Y.globals.barCanvasCoords[e]={});const t=Y.globals.barCanvasCoords[e][a];let i=(null==t?void 0:t.bounds)||null;const s=m.bbox();(s.width>0||s.height>0)&&(i={left:Math.min(i?i.left:1/0,s.x),top:Math.min(i?i.top:1/0,s.y),right:Math.max(i?i.right:-1/0,s.x+s.width),bottom:Math.max(i?i.bottom:-1/0,s.y+s.height)}),Y.globals.barCanvasCoords[e][a]=l(o({cx:U.dataLabelsPos.bcx,cy:U.dataLabelsPos.bcy,barWidth:w,type:L},void 0!==x&&void 0!==b&&{rangeY1:x,rangeY2:b}),{bounds:i})}null!==U.dataLabels&&S.add(U.dataLabels),U.totalDataLabels&&S.add(U.totalDataLabels),g.add(S),C&&g.add(C),k&&g.add(k)}return g}drawBarPaths({indexes:t,barHeight:e,strokeWidth:i,zeroW:s,x:a,y:r,yDivision:n,elSeries:o}){const l=this.w,h=t.i,c=t.j;let d;if(l.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:i,zeroEncounters:s}=this.barHelpers.getZeroValueEncounters({i:t.realIndex,j:c});i>0&&(e=this.seriesLen*e/i),d=r+e*this.visibleI,d-=e*s}else d=r+e*this.visibleI;const u=this.isFunnel&&"trapezoid"===l.config.plotOptions.funnel.shape,p=this.isPyramid&&this.pyramidLayout?this.pyramidLayout[c]:null,g=!!p;if(p)d=p.y,e=p.height;else if(this.isFunnel&&!u){const t=null!=s?s:0;s=t-(this.barHelpers.getXForValue(this.series[h][c],t)-t)/2}let f;return a=this.barHelpers.getXForValue(this.series[h][c],null!=s?s:0),f=p?this.barHelpers.getPyramidPaths({barYPosition:d,barHeight:e,topHalf:p.topHalf,bottomHalf:p.bottomHalf,realIndex:t.realIndex,j:c,strokeWidth:i,w:l}):u?this.barHelpers.getFunnelTrapezoidPaths({barYPosition:d,barHeight:e,series:this.series,i:h,j:c,realIndex:t.realIndex,strokeWidth:i,w:l}):this.barHelpers.getBarpaths({barYPosition:d,barHeight:e,x1:s,x2:a,strokeWidth:i,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:h,j:c,w:l}),(u||g)&&(s=f.x1,a=f.x),g||(r+=n),g&&(r=d),this.barHelpers.barBackground({j:c,i:h,y1:d-e*this.visibleI,y2:e*this.seriesLen,elSeries:o}),{pathTo:f.pathTo,pathFrom:f.pathFrom,x1:s,x:a,y:r,goalX:this.barHelpers.getGoalValues("x",s,null,t.realIndex,c,0),barYPosition:d,barHeight:e}}drawColumnPaths({indexes:t,x:e,y:i,xDivision:s,barWidth:a,zeroH:r,strokeWidth:n,elSeries:o}){const l=this.w,h=t.realIndex,c=t.translationsIndex,d=t.i,u=t.j,p=t.bc;let g;if(l.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:u,realIndex:h,barWidth:a});e=t.x,g=t.barXPosition}else if(l.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:i}=this.barHelpers.getZeroValueEncounters({i:h,j:u});t>0&&(a=this.seriesLen*a/t),g=e+a*this.visibleI,g-=a*i}else g=e+a*this.visibleI;i=this.barHelpers.getYForValue(this.series[d][u],r,c);const f=this.barHelpers.getColumnPaths({barXPosition:g,barWidth:a,y1:r,y2:i,strokeWidth:n,isReversed:this.isReversed,series:this.series,realIndex:h,i:d,j:u,w:l});return l.axisFlags.isXNumeric||(e+=s),this.barHelpers.barBackground({bc:p,j:u,i:d,x1:g-n/2-a*this.visibleI,x2:a*this.seriesLen+n/2,elSeries:o}),{pathTo:f.pathTo,pathFrom:f.pathFrom,x:e,y:i,goalY:this.barHelpers.getGoalValues("y",null,r,h,u,c),barXPosition:g,barWidth:a}}getBarXForNumericXAxis({x:t,barWidth:e,realIndex:i,j:s}){const a=this.w,r=Pi(a);let n=i;return a.seriesData.seriesX[i].length||(n=a.globals.maxValsInArrayIndex),Zt.isNumber(a.seriesData.seriesX[n][s])&&(t=be.dataXToPx(a,a.seriesData.seriesX[n][s])-e*(r?1:this.seriesLen)/2),{barXPosition:t+(r?0:e*this.visibleI),x:t}}_wasOnScreen(t,e){if(!Ri(this.w))return!1;const i=this._prevKeyedPaths(t);return!!i&&i.has(this._keys(t)[e])}_keys(t){const e=this._keyCache||(this._keyCache={});return e[t]||(e[t]=$i(this.w,t))}_prevRecord(t){const e=Ui(this.w,t);for(let t=e.length-1;t>=0;t--)if(e[t].paths&&e[t].paths.length>0)return e[t];return null}_pathFromUsed(){var t;const e=this.w,i=e.highlightData,s=e.globals.prevHighlightParts;if(i&&(i.active||(null==s?void 0:s.size)))return!0;const a=null==(t=this.ctx)?void 0:t.renderer;if(a&&a.kind&&"svg"!==a.kind)return!1;const r=new R(e,this.ctx).revealPlan("",this._fadeReveal);return r.animate&&!r.fade}_prevKeyedPaths(t){if(this._prevKeyed||(this._prevKeyed={}),void 0!==this._prevKeyed[t])return this._prevKeyed[t];const e=this._prevRecord(t);let i=null;if(e&&e.paths.every(t=>null!=t.key)){const t=new Map;e.paths.forEach(e=>{t.set(e.key,e)}),i=t}return this._prevKeyed[t]=i,i}isLengthTransition(t){var e,i,s,a,r,n;if(this._ltCache||(this._ltCache={}),void 0!==this._ltCache[t])return this._ltCache[t];const o=this.w;let l=!1;if(Ri(o)&&o.globals.previousPaths.length>0){const h=this._prevRecord(t),c=null!=(i=null==(e=o.seriesData.series[t])?void 0:e.length)?i:0,d=h&&this._prevKeyedPaths(t);if(h)if(d){const e=new Set(this._keys(t));l=(null!=(n=null==(r=null==(a=null==(s=o.globals.prevStreamFrame)?void 0:s.seriesY)?void 0:a[t])?void 0:r.length)?n:c)!==c||[...d.keys()].some(t=>!e.has(t))}else l=h.paths.length!==c;else l=c>0}return this._ltCache[t]=l,l}isLayoutShift(t){if(this.isLengthTransition(t))return!0;if(this._layoutShiftCache||(this._layoutShiftCache={}),void 0!==this._layoutShiftCache[t])return this._layoutShiftCache[t];const e=Wi(this.w,t,!0,!0),i=!(!e||!e.join.changed);return this._layoutShiftCache[t]=i,i}getPreviousPath(t,e,i,s){const a=this.w;if(this._pathToInterp=null,!this._pathFromUsed())return i;const r=this._prevRecord(t);if(!r)return Ri(a)?null:i;let n=null,o=!1;const l=this._prevKeyedPaths(t);if(l){const i=l.get(this._keys(t)[e]);i?n=i.d:o=!0}else void 0!==r.paths[e]?n=r.paths[e].d:o=!0;return n?this.cornerMorph(n,i,s):o&&Ri(a)?null:i}cornerMorph(t,e,i){const s=Ki.pathCommandCount(t),a=Ki.pathCommandCount(e);if(s===a)return t;const r=new R(this.w),n=t=>{const e=Ki.pathBox(t);return e?Math.min(e.maxX-e.minX,e.maxY-e.minY):0},o=s<a?n(t)>1:n(e)>1;if(s<a){const e=r.roundPathCorners(t,0);if(Ki.pathCommandCount(e)===a){if(o&&i){const t=r.roundPathCorners(i,0);Ki.pathCommandCount(t)===a&&(this._pathToInterp=t)}return e}}else{const i=r.roundPathCorners(e,0);if(Ki.pathCommandCount(i)===s){if(this._pathToInterp=i,o){const e=Ki.squareLike(t),i=e?r.roundPathCorners(e,0):null;if(i&&Ki.pathCommandCount(i)===s)return i}return t}}return e}static pathBox(t){if(!t)return null;const e=[],i=/([MLC])([^MLCZz]*)/g;let s;for(;null!==(s=i.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 a=e.map(t=>t[0]),r=e.map(t=>t[1]);return{minX:Math.min(...a),maxX:Math.max(...a),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=Ki.pathBox(t);if(!e)return null;const{minX:i,maxX:s,minY:a,maxY:r,start:n,vertical:o}=e,l=(t,e,i)=>Math.abs(t-e)<=Math.abs(t-i)?[e,i]:[i,e];let h,c,d,u;o?(h=Math.abs(n[0]-i)<=Math.abs(n[0]-s)?i:s,c=h===i?s:i,[d,u]=l(n[1],a,r)):(d=Math.abs(n[1]-a)<=Math.abs(n[1]-r)?a:r,u=d===a?r:a,[h,c]=l(n[0],i,s));const p=t.trim().endsWith("Z")?" Z":" z";return o?`M ${h} ${d} L ${h} ${u} L ${c} ${u} L ${c} ${d}${p}`:`M ${h} ${d} L ${c} ${d} L ${c} ${u} L ${h} ${u}${p}`}getPreviousFlip(t,e){const i=this._prevRecord(t);if(!i)return null;const s=this._prevKeyedPaths(t),a=s?s.get(this._keys(t)[e]):i.paths[e];return a?!!a.flip:null}static pathCommandCount(t){if(!t)return 0;const e=t.match(/[MmLlHhVvCcSsQqTtAaZz]/g);return e?e.length:0}}function Ji({points:t,extent:e,seedA:i,seedB:s,center:a,halfExtent:r,alongFn:n,isHorizontal:o,options:l,clampAt:h,sideSign:c}){var d,u;const p=l;if(!p||!1===p.show)return[];if(!t||!t.length)return[];const g=p.maxPoints||3e3,f=t.length>g?Math.ceil(t.length/g):1,m=null!=p.size?p.size:2.5,x=r*(null!=p.jitter?p.jitter:.5),b=!1!==p.constrainToViolin&&"function"==typeof h,y="square"===p.shape,v=p.colorScale,w=v&&Array.isArray(v.colors)&&v.colors.length>0,_=w?Math.max(2,v.steps||24):1,A=null!=(d=null==v?void 0:v.min)?d:e[0],S=(null!=(u=null==v?void 0:v.max)?u:e[1])-A||1,C=w?new Array(_).fill(""):[""];for(let e=0;e<t.length;e+=f){const r=t[e],l=n(r);let d=2*(is(7919*i+100003*s+e)-.5)*x;if(b){const t=h(r);d>t&&(d=t),d<-t&&(d=-t)}c&&(d=Math.abs(d)*c);const u=o?l:a+d,p=o?a+d:l,g=y?as(u,p,m):ss(u,p,m);if(w){let t=(r-A)/S;t<0&&(t=0),t>1&&(t=1),C[Math.round(t*(_-1))]+=g}else C[0]+=g}if(!w)return C[0]?[{fill:null,d:C[0]}]:[];const k=[];for(let t=0;t<_;t++)C[t]&&k.push({fill:es(v.colors,t/(_-1)),d:C[t]});return k}function Qi({graphics:t,w:e,elSeries:i,pointsByCat:s,options:a,distributed:r,realIndex:n,wrapClass:o,pointClass:l}){if(!a||!1===a.show||!s.length)return;const h=null!=a.opacity?a.opacity:.9,c=null!=a.strokeColor?a.strokeColor:"#fff",d=null!=a.strokeWidth?a.strokeWidth:1,u=e.config.chart.animations.enabled&&!e.globals.resized&&!e.globals.dataChanged,p=t.group({class:u?`${o} apexcharts-element-hidden`:o});u&&e.globals.delayedElements.push({el:p.node}),s.forEach(({groups:i,j:s})=>{const o=r?e.globals.colors[s]:e.globals.colors[n],u=a.fillColor,g="series"===u?o:"series-dark"===u?ts(o,.45):u||ts(o,.45);i.forEach(i=>{const a=t.drawPath({d:i.d,fill:null!=i.fill?i.fill:g,stroke:d>0?c:"none",strokeWidth:d,fillOpacity:h,classes:l});a.attr("data:realIndex",n),a.attr("j",s),a.attr("clip-path",`url(#gridRectBarMask${e.globals.cuid})`),a.node.style.pointerEvents="none",p.add(a)})}),i.add(p)}function ts(t,e){const i=Zt.parseColor(t)||Zt.parseColor(Zt.resolveColor(t));if(!i)return t;const s=Math.max(0,1-e);return`rgb(${Math.round(i[0]*s)},${Math.round(i[1]*s)},${Math.round(i[2]*s)})`}function es(t,e){if(!t.length)return"#000";if(1===t.length)return t[0];const i=Math.max(0,Math.min(1,e))*(t.length-1),s=Math.floor(i),a=i-s,r=Zt.parseHex(t[s])||[0,0,0],n=Zt.parseHex(t[Math.min(s+1,t.length-1)])||r,o=(t,e)=>Math.round(t+(e-t)*a);return`rgb(${o(r[0],n[0])},${o(r[1],n[1])},${o(r[2],n[2])})`}function is(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 ss(t,e,i){return`M ${t-i} ${e} a ${i} ${i} 0 1 0 ${2*i} 0 a ${i} ${i} 0 1 0 ${-2*i} 0 `}function as(t,e,i){return`M ${t-i} ${e-i} h ${2*i} v ${2*i} h ${-2*i} z `}class rs extends Ki{_identityLost(t,e){if(!Ri(this.w))return!1;const i=this._prevKeyedPaths(t);if(!i||0===i.size||!e||0===e.length)return!1;let s=0;for(let a=0;a<e.length;a++)i.has(this._keys(t)[a])&&s++;return s/i.size<.5}_prevBoxHalf(t,e,i){if(!this.isBoxPlot||!this._pathFromUsed())return null;this._prevHalves||(this._prevHalves={});let s=this._prevHalves[t];if(void 0===s){s=null;const e=this._prevRecord(t);if(e&&e.paths.every(t=>null!=t.key)){s=new Map;for(const t of e.paths){const e=s.get(t.key)||[];e.push(t.d),s.set(t.key,e)}}this._prevHalves[t]=s}const a=s&&s.get(this._keys(t)[e]);return a&&2===a.length?a[i]:null}draw(t,e,i){var s,a;const r=this.w,n=new R(this.w),h=r.globals.comboCharts?e:r.config.chart.type,c=new F(this.w);this.candlestickOptions=this.w.config.plotOptions.candlestick,this.boxOptions=this.w.config.plotOptions.boxPlot,this.isHorizontal=r.config.plotOptions.bar.horizontal,this.coreUtils=new P(this.w),t=this.coreUtils.getLogSeries(t),this.series=t,this.yRatio=this.coreUtils.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t,i);const d=n.group({class:`apexcharts-${h}-series apexcharts-plot-series`});this.isBoxPlot="boxPlot"===h,this.isOHLC=!this.isBoxPlot&&"ohlc"===(null==(s=this.candlestickOptions)?void 0:s.type);const u=function(t,e){let i=1/0,s=-1/0;return t.slice(0,e.seriesData.series.length).flat(2).forEach(t=>{t===+t&&(t<i&&(i=t),t>s&&(s=t))}),[i,s]}(r.candleData.seriesBoxPoints,r);for(let e=0;e<t.length;e++){let s,p;const g=[],f=[],m=r.globals.comboCharts?i[e]:e,{columnGroupIndex:x}=this.barHelpers.getGroupIndex(m),b=n.group({class:"apexcharts-series",seriesName:Zt.escapeString(r.seriesData.seriesNames[m]),rel:e+1,"data:realIndex":m});W.addCollapsedClassToSeries(this.w,b,m),t[e].length>0&&(this.visibleI=this.visibleI+1);const y=this.setSeriesAxis(m),v=this.barHelpers.initialPositions(m),{y:w,barHeight:_,yDivision:A,zeroW:S,x:C,barWidth:k,xDivision:P,zeroH:L}=v;p=w,s=C,f.push(s+(null!=k?k:0)/2);const M=n.group({class:"apexcharts-datalabels","data:realIndex":m}),I=n.group({class:"apexcharts-bar-goals-markers"}),E=this.isBoxPlot?this.boxOptions.points:null,F=[],D=r.layout.gridWidth,T=Math.max(null!=k?k:0,r.globals.barPadForNumericAxis||0),R=0===t[e].length?0:r.globals.dataPoints,z=this._identityLost(m,t[e]);this._fadeReveal=z;for(let i=0;i<R;i++){const n=this.barHelpers.getStrokeWidth(e,i,m);let d=null;const v={indexes:{i:e,j:i,realIndex:m,translationsIndex:y},x:s,y:p,strokeWidth:n,elSeries:b};if(d=this.isHorizontal?this.drawHorizontalBoxPaths(l(o({},v),{yDivision:A,barHeight:_,zeroW:S})):this.drawVerticalBoxPaths(l(o({},v),{xDivision:P,barWidth:k,zeroH:L,cullBounds:{lo:-T,hi:D+T}})),p=d.y,s=d.x,i>0&&f.push(s+(null!=k?k:0)/2),g.push(p),d.culled)continue;const w=this.barHelpers.drawGoalLine({barXPosition:d.barXPosition,barYPosition:d.barYPosition,goalX:d.goalX,goalY:d.goalY,barHeight:_,barWidth:k});if(w&&I.add(w),d.pathTo.forEach((a,o)=>{var l;const u=!this.isBoxPlot&&this.candlestickOptions.wick.useFillColor?d.color[o]:r.globals.stroke.colors[m],g=c.fillPath({seriesNumber:m,dataPointIndex:i,color:d.color[o],value:t[e][i]});this.renderSeries({realIndex:m,pathFill:g,lineFill:u,j:i,i:e,pathFrom:null!=(l=this._prevBoxHalf(m,i,o))?l:d.pathFrom,fadeReveal:z,noLabel:o>0,pathTo:a,strokeWidth:n,elSeries:b,x:s,y:p,series:t,columnGroupIndex:x,barHeight:_,barWidth:k,elDataLabelsWrap:M,elGoalsMarkers:I,visibleSeries:this.visibleI,type:h})}),E&&!1!==E.show){const t=null==(a=r.candleData.seriesBoxPoints[m])?void 0:a[i];if(t&&t.length){const e=t=>this.coreUtils.getLogValAtSeriesIndex(t,m);let s,a,r;if(this.isHorizontal){const t=this.invertedYRatio*(this.isReversed?-1:1),i=null!=_?_:0,n=null!=S?S:0;s=d.barYPosition+i/2,a=i/2,r=i=>n+e(i)/t}else{const t=this.yRatio[y]*(this.isReversed?-1:1),i=null!=k?k:0,n=null!=L?L:0;s=d.barXPosition+i/2,a=i/2,r=i=>n-e(i)/t}const n=Ji({points:t,extent:u,seedA:m,seedB:i,center:s,halfExtent:a,alongFn:r,isHorizontal:this.isHorizontal,options:E});n.length&&F.push({groups:n,j:i})}}}E&&Qi({graphics:n,w:r,elSeries:b,pointsByCat:F,options:E,distributed:r.config.plotOptions.bar.distributed,realIndex:m,wrapClass:"apexcharts-boxPlot-points-wrap",pointClass:"apexcharts-boxPlot-points"}),r.globals.seriesXvalues[m]=f,r.globals.seriesYvalues[m]=g,r.globals.previousPaths.length>0&&!z&&Ri(r)&&qi({w:r,elSeries:b,record:this._prevRecord(m),newKeys:this._keys(m).filter((i,s)=>null!=t[e][s]),isHorizontal:this.isHorizontal,speed:r.config.chart.animations.dynamicAnimation.speed}),d.add(b)}return d}drawVerticalBoxPaths({indexes:t,x:e,xDivision:i,barWidth:s,zeroH:a,strokeWidth:r,cullBounds:n=null}){var o,l,h;const c=this.w,d=new R(this.w),u=t.i,p=t.j,{colors:g}=c.config.plotOptions.candlestick,{colors:f}=this.boxOptions,m=t.realIndex,x=t=>Array.isArray(t)?t[m]:t,b=x(g.upward),y=x(g.downward),v=this.yRatio[t.translationsIndex]*(this.isReversed?-1:1),w=this.getOHLCValue(m,p);let _=a,A=a,S=w.o<w.c?[b]:[y];this.isBoxPlot&&(S=[x(f.lower),x(f.upper)]);let C=Math.min(w.o,w.c),k=Math.max(w.o,w.c),P=w.m,L=e+s*this.visibleI;if(c.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,barWidth:s,realIndex:m,j:p});e=t.x,L=t.barXPosition}const M=null==(null==(o=this.series[u])?void 0:o[p]);if(M?(C=a,k=a):(C=a-C/v,k=a-k/v,_=a-w.h/v,A=a-w.l/v,P=a-w.m/v),M||n&&(L+s<n.lo||L>n.hi)&&!this._wasOnScreen(m,p))return{pathTo:null,pathFrom:null,x:c.axisFlags.isXNumeric?e:e+i,y:k,barXPosition:L,color:S,culled:!0};let I;if(this.isOHLC){const t=L+s/2,e=a-w.o/v,i=a-w.c/v;I=[d.move(t,_)+d.line(t,A)+d.move(t,e)+d.line(L,e)+d.move(t,i)+d.line(L+s,i)]}else I=this.isBoxPlot?[d.move(L,C)+d.line(L+s/2,C)+d.line(L+s/2,_)+d.line(L+s/4,_)+d.line(L+s-s/4,_)+d.line(L+s/2,_)+d.line(L+s/2,C)+d.line(L+s,C)+d.line(L+s,P)+d.line(L,P)+d.line(L,C+r/2),d.move(L,P)+d.line(L+s,P)+d.line(L+s,k)+d.line(L+s/2,k)+d.line(L+s/2,A)+d.line(L+s-s/4,A)+d.line(L+s/4,A)+d.line(L+s/2,A)+d.line(L+s/2,k)+d.line(L,k)+d.line(L,P)+"z"]:[d.move(L,k)+d.line(L+s/2,k)+d.line(L+s/2,_)+d.line(L+s/2,k)+d.line(L+s,k)+d.line(L+s,C)+d.line(L+s/2,C)+d.line(L+s/2,A)+d.line(L+s/2,C)+d.line(L,C)+d.line(L,k-r/2)];let E=null;const F=null==(h=null==(l=this.ctx)?void 0:l.morphTypeChange)?void 0:h.getInitialPathFor(m,p);return F?E=F:c.globals.previousPaths.length>0&&(E=this.getPreviousPath(m,p,I[0])),null==E&&(E=d.move(L+s/2,C)+d.move(L,C)),c.axisFlags.isXNumeric||(e+=i),{pathTo:I,pathFrom:E,x:e,y:k,goalY:this.barHelpers.getGoalValues("y",null,a,m,p,t.translationsIndex),barXPosition:L,color:S}}drawHorizontalBoxPaths({indexes:t,y:e,yDivision:i,barHeight:s,zeroW:a,strokeWidth:r}){var n,o,l;const h=this.w,c=new R(this.w),d=t.i,u=t.j,p=t.realIndex,{colors:g}=h.config.plotOptions.candlestick,{colors:f}=this.boxOptions,m=t=>Array.isArray(t)?t[p]:t,x=this.invertedYRatio*(this.isReversed?-1:1),b=this.getOHLCValue(p,u);let y=b.o<b.c?[m(g.upward)]:[m(g.downward)];this.isBoxPlot&&(y=[m(f.lower),m(f.upper)]);let v=a,w=a,_=Math.min(b.o,b.c),A=Math.max(b.o,b.c),S=b.m;const C=e+s*this.visibleI,k=null==(null==(n=this.series[d])?void 0:n[u]);k?(_=a,A=a):(_=a+_/x,A=a+A/x,v=a+b.h/x,w=a+b.l/x,S=a+b.m/x);const P=[c.move(_,C)+c.line(_,C+s/2)+c.line(v,C+s/2)+c.line(v,C+s/2-s/4)+c.line(v,C+s/2+s/4)+c.line(v,C+s/2)+c.line(_,C+s/2)+c.line(_,C+s)+c.line(S,C+s)+c.line(S,C)+c.line(_+r/2,C),c.move(S,C)+c.line(S,C+s)+c.line(A,C+s)+c.line(A,C+s/2)+c.line(w,C+s/2)+c.line(w,C+s-s/4)+c.line(w,C+s/4)+c.line(w,C+s/2)+c.line(A,C+s/2)+c.line(A,C)+c.line(S,C)+"z"];let L=null;const M=null==(l=null==(o=this.ctx)?void 0:o.morphTypeChange)?void 0:l.getInitialPathFor(p,u);return M?L=M:h.globals.previousPaths.length>0&&(L=this.getPreviousPath(p,u,P[0])),null==L&&(L=c.move(_,C+s/2)+c.move(_,C)),{pathTo:P,pathFrom:L,x:A,y:e+=i,goalX:this.barHelpers.getGoalValues("x",a,null,p,u,0),barYPosition:C,color:y,culled:k}}getOHLCValue(t,e){const i=this.w,s=this.coreUtils,a=i=>i[t]&&null!=i[t][e]?s.getLogValAtSeriesIndex(i[t][e],t):0,r=a(i.candleData.seriesCandleH),n=a(i.candleData.seriesCandleO),o=a(i.candleData.seriesCandleM),l=a(i.candleData.seriesCandleC),h=a(i.candleData.seriesCandleL);return{o:this.isBoxPlot?r:n,h:this.isBoxPlot?n:r,m:o,l:this.isBoxPlot?l:h,c:this.isBoxPlot?h:l}}}class ns{constructor(t,e){this.ctx=e,this.w=t}checkColorRange(){const t=this.w;return this.rowExt=[],t.config.plotOptions[t.config.chart.type].colorScale.ranges.some(t=>t.from<=0)}getShadeColor(t,e,i,s){const a=this.w,r=a.config.plotOptions[t],n=r.shadeIntensity,o=1.25*n,l=this.determineColor(t,e,i),h=l.percent/100;let c;c=a.globals.hasNegs||s?r.reverseNegativeShade?(h<0?h:1-h)*o:h<=0?1-(1+h)*n:(1-h)*n:"treemap"===t?(1-h)*o:1-h;let d=Zt.getThemeColor(l.color,a.dom.elWrap);if(r.enableShades){const t=(new Zt).shadeColor("dark"===a.config.theme.mode?-c:c,d);d=Zt.hexToRgba(Zt.isColorHex(t)?t:Zt.rgb2hex(t),a.config.fill.opacity)}return{color:d,colorProps:l}}determineColor(t,e,i){const s=this.w,a=s.seriesData.series[e][i],r=s.config.plotOptions[t];let n=r.colorScale.inverse?i:e;r.distributed&&"treemap"===s.config.chart.type&&(n=i);let o,l,h=s.globals.colors[n],c=null;if(r.distributed||"heatmap"!==t){let t=this.rowExt[e];if(!t){const i=s.seriesData.series[e];o=i.length?i[0]:0,l=o;for(let t=1;t<i.length;t++)i[t]<o&&(o=i[t]),i[t]>l&&(l=i[t]);t=this.rowExt[e]=[o,l]}[o,l]=t}else o=s.globals.minY,l=s.globals.maxY;const d=r.colorScale.min,u=r.colorScale.max;void 0!==d&&void 0!==u&&u>d?(o=d,l=u):void 0!==d&&(o=d<s.globals.minY?d:s.globals.minY,l=u>s.globals.maxY?u:s.globals.maxY);const p=Math.abs(l)+Math.abs(o),g=Math.min(Math.max(a,o),l);let f=0===p?0:100*g/p;if(r.colorScale.ranges.length>0){r.colorScale.ranges.map(t=>{if(a>=t.from&&a<=t.to){h=t.color,c=t.foreColor?t.foreColor:null,o=t.from,l=t.to;const e=Math.abs(l)+Math.abs(o);f=0===e?0:100*a/e}})}return{color:h,foreColor:c,percent:f}}calculateDataLabels({text:t,x:e,y:i,i:s,j:a,colorProps:r,fontSize:n}){const o=this.w.config.dataLabels,l=new R(this.w),h=new I(this.w,this.ctx);let c=null;return o.enabled&&(c=l.group({class:"apexcharts-data-labels"}),h.plotDataLabelsText({x:e,y:i+parseFloat(o.style.fontSize)/3,text:t,i:s,j:a,color:r.foreColor,parent:c,fontSize:n,dataLabelsConfig:o})),c}}function os(t){const e=t.globals;let i=e.minXDiff;if(!t.seriesData.series.some(t=>t.length>1)){const s=t.seriesData.seriesX.map(t=>t&&t[0]).filter(Number.isFinite).sort((t,e)=>t-e);i=1/0;for(let t=1;t<s.length;t++)s[t]>s[t-1]&&(i=Math.min(i,s[t]-s[t-1]));i===1/0&&(i=(e.maxX-e.minX)/4)}return Number.isFinite(i)&&i>0?i:0}class ls{constructor(t){this.w=t.w,this.lineCtx=t}sameValueSeriesFix(t,e,i){const s=this.w,a=e[t];return"gradient"!==s.config.fill.type&&"gradient"!==s.config.fill.type[i]||!a.every(t=>t===a[0])||(e[t]=a.slice(),e[t][a.length-1]+=1e-6),e}calculatePoints({series:t,realIndex:e,x:i,y:s,i:a,j:r,prevY:n}){const o=this.w,l=[],h=[];let c=this.lineCtx.categoryAxisCorrection+o.config.markers.offsetX;return o.axisFlags.isXNumeric&&(c=(o.seriesData.seriesX[e][0]-o.globals.minX)/this.lineCtx.xRatio+o.config.markers.offsetX),0===r&&(l.push(c),h.push(Zt.isNumber(t[a][0])?n+o.config.markers.offsetY:null)),l.push(i+o.config.markers.offsetX),h.push(Zt.isNumber(t[a][r+1])?s+o.config.markers.offsetY:null),{x:l,y:h}}checkPreviousPaths({pathFromLine:t,pathFromArea:e,realIndex:i}){const s=this.w;for(const a of Ui(s,i))("line"===a.type||"area"===a.type)&&a.paths.length>0&&("line"===a.type?(this.lineCtx.appendPathFrom=!1,t=a.paths[0].d):"area"===a.type&&(this.lineCtx.appendPathFrom=!1,e=a.paths[0].d,s.config.stroke.show&&a.paths[1]&&(t=a.paths[1].d)));return{pathFromLine:t,pathFromArea:e}}previousRangeAreaPath(t){for(const e of Ui(this.w,t))if("rangeArea"===e.type&&1===e.paths.length&&e.paths[0].d)return e.paths[0].d;return null}determineFirstPrevY({i:t,realIndex:e,series:i,prevY:s,lineYPosition:a,translationsIndex:r}){var n,o,l;const h=this.w,c=h.config.chart.stacked&&!h.globals.comboCharts||h.config.chart.stacked&&h.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||"bar"===(null==(n=this.w.config.series[e])?void 0:n.type)||"column"===(null==(o=this.w.config.series[e])?void 0:o.type));if(void 0!==(null==(l=i[t])?void 0:l[0])){if(c)if(t>0){const t=this.lineCtx.stackTopAt(e,0);a=void 0===t?this.lineCtx.zeroY:t}else a=this.lineCtx.zeroY;else a=this.lineCtx.zeroY;s=a-i[t][0]/this.lineCtx.yRatio[r]+2*(this.lineCtx.isReversed?i[t][0]/this.lineCtx.yRatio[r]:0)}else if(c&&t>0&&void 0===i[t][0])for(let e=t-1;e>=0;e--)if(null!==i[e][0]&&void 0!==i[e][0]){s=a=this.lineCtx.prevSeriesY[e][0];break}return{prevY:s,lineYPosition:a}}}const hs=t=>{const e=function(t){const e=[];let i=t[0],s=t[1],a=e[0]=ds(i,s),r=1;for(let n=t.length-1;r<n;r++)i=s,s=t[r+1],e[r]=.5*(a+(a=ds(i,s)));return e[r]=a,e}(t),i=t.length-1,s=[];let a,r,n,o;for(let s=0;s<i;s++)n=ds(t[s],t[s+1]),Math.abs(n)<1e-6?e[s]=e[s+1]=0:(a=e[s]/n,r=e[s+1]/n,o=a*a+r*r,o>9&&(o=3*n/Math.sqrt(o),e[s]=o*a,e[s+1]=o*r));for(let a=0;a<=i;a++)o=(t[Math.min(i,a+1)][0]-t[Math.max(0,a-1)][0])/(6*(1+e[a]*e[a])),s.push([o||0,e[a]*o||0]);return s},cs={points(t){const e=hs(t),i=t[1],s=t[0],a=[],r=e[1],n=e[0];a.push(s,[s[0]+n[0],s[1]+n[1],i[0]-r[0],i[1]-r[1],i[0],i[1]]);for(let i=2,s=e.length;i<s;i++){const s=t[i],r=e[i];a.push([s[0]-r[0],s[1]-r[1],s[0],s[1]])}return a},slice(t,e,i){const s=t.slice(e,i);if(e){if(i-e>1&&s[1].length<6){const t=s[0].length;s[1]=[2*s[0][t-2]-s[0][t-4],2*s[0][t-1]-s[0][t-3]].concat(s[1])}s[0]=s[0].slice(-2)}return s}};function ds(t,e){return(e[1]-t[1])/(e[0]-t[0])}const us=/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi;function ps(t,e){const{ax:i,bx:s,ay:a,by:r}=e,n=[],o=/([MmLlHhVvCcSsQqTtAaZz])([^MmLlHhVvCcSsQqTtAaZz]*)/g;let l;for(;null!==(l=o.exec(t));){const t=l[1].toUpperCase(),e=(l[2].match(us)||[]).map(parseFloat);if("Z"===t){n.push("z");continue}if("H"===t){for(const t of e)n.push(`H ${i*t+s}`);continue}if("V"===t){for(const t of e)n.push(`V ${a*t+r}`);continue}if("A"===t){for(let t=0;t+6<e.length;t+=7)n.push(`A ${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${i*e[t+5]+s} ${a*e[t+6]+r}`);continue}const o=[];for(let t=0;t+1<e.length;t+=2)o.push(`${i*e[t]+s} ${a*e[t+1]+r}`);o.length&&n.push(`${t} ${o.join(" ")}`)}return n.join(" ")}class gs{constructor(t,e,i,s){this.ctx=e,this.w=t,this.xyRatios=i,this.xRatio=0,this.yRatio=[],this.zRatio=0,this.baseLineY=[],this.pointsChart=!("bubble"!==this.w.config.chart.type&&"scatter"!==this.w.config.chart.type)||s,this.scatter=new d(this.w,this.ctx),this.noNegatives=this.w.globals.minX===Number.MAX_VALUE,this.lineHelpers=new ls(this),this.markers=new z(this.w,this.ctx),this.prevSeriesY=[],this.prevSeriesYByX=new Map,this.categoryAxisCorrection=0,this.yaxisIndex=0,this.xDivision=0,this.zeroY=0,this.areaBottomY=0,this.strokeWidth=0,this.isReversed=!1,this.appendPathFrom=!1,this.elSeries=null,this.elPointsMain=null,this.elDataLabelsWrap=null,this._elLastPointsWrap=null,this._shapeOnly=!1}draw(t,e,i,s){var a;const r=this.w,n=this.ctx.highlightFilter,o=new R(this.w),l=r.globals.comboCharts?e:r.config.chart.type,h=o.group({class:`apexcharts-${l}-series apexcharts-plot-series`}),c=new P(this.w);if(this.yRatio=this.xyRatios.yRatio,this.zRatio=this.xyRatios.zRatio,this.xRatio=this.xyRatios.xRatio,this.baseLineY=this.xyRatios.baseLineY,t=c.getLogSeries(t,i),this.yRatio=c.getLogYRatios(this.yRatio),this.prevSeriesY=[],this.prevSeriesYByX=new Map,this._stackXs=null,r.config.chart.stacked&&r.axisFlags.isXNumeric){const e=t.map((t,e)=>r.globals.comboCharts?i[e]:e).filter(t=>!this._hidden(t)).map(t=>r.seriesData.seriesX[t]||[]);e.some(t=>t.length!==e[0].length||t.some((t,i)=>t!==e[0][i]))&&(this._stackXs=[...new Set(e.flat())].sort((t,e)=>t-e))}const d=[];for(let e=0;e<t.length;e++){const a=r.globals.comboCharts?i[e]:e;t=this.lineHelpers.sameValueSeriesFix(e,t,a);const o=this.yRatio.length>1?a:0,h=this._collapsedBaselineRow(t,e,a);this._shapeOnly=!!h,h&&((t=t.slice())[e]=h,"rangeArea"===l&&s&&((s=s.slice())[e]=h)),this._initSerieVariables(t,e,a),W.addCollapsedClassToSeries(this.w,this.elSeries,a);const c=this._buildSeriesPaths(l,t,e,a,o,i,s);this._handlePaths({type:l,realIndex:a,i:e,paths:c}),null==n||n.line(this,l,t,e,a,o,c),this.markers.flushBatch(this.elPointsMain,a),this.elSeries.add(this.elPointsMain),this.elSeries.add(this.elDataLabelsWrap),d.push(this.elSeries)}if(void 0!==(null==(a=r.config.series[0])?void 0:a.zIndex)&&d.sort((t,e)=>Number(t.node.getAttribute("zIndex"))-Number(e.node.getAttribute("zIndex"))),r.config.chart.stacked)for(let t=d.length-1;t>=0;t--)h.add(d[t]);else for(let t=0;t<d.length;t++)h.add(d[t]);return h}_buildSeriesPaths(t,e,i,s,a,r,n){const h=this.w,c=[],d=[],u=[];let p=h.globals.padHorizontal+this.categoryAxisCorrection;h.axisFlags.isXNumeric&&h.seriesData.seriesX.length>0&&(p=(h.seriesData.seriesX[s][0]-h.globals.minX)/this.xRatio),u.push(p);const g=p;let f,m=this.zeroY,x=this.zeroY;m=this.lineHelpers.determineFirstPrevY({i:i,realIndex:s,series:e,prevY:m,lineYPosition:0,translationsIndex:a}).prevY,"monotoneCubic"===h.config.stroke.curve&&null===e[i][0]?c.push(null):c.push(m);const b=m;let y;"rangeArea"===t&&(y=this.lineHelpers.determineFirstPrevY({i:i,realIndex:s,series:n,prevY:x,lineYPosition:0,translationsIndex:a}),x=y.prevY,f=x,d.push(null!==c[0]?x:null));const v=this._calculatePathsFrom(s,m),w=[c[0]],_=[d[0]],A={type:t,series:e,realIndex:s,translationsIndex:a,i:i,x:p,y:1,pX:g,pY:b,pathsFrom:v,linePaths:[],areaPaths:[],seriesIndex:r,lineYPosition:0,xArrj:u,yArrj:c,y2Arrj:d,seriesRangeEnd:n},S=this._iterateOverDataPoints(l(o({},A),{iterations:"rangeArea"===t?e[i].length-1:void 0,isRangeStart:!0}));if("rangeArea"===t){const t=this._calculatePathsFrom(s,x),e=this._iterateOverDataPoints(l(o({},A),{series:n,xArrj:[p],yArrj:w,y2Arrj:_,pY:f,areaPaths:S.areaPaths,pathsFrom:t,iterations:n[i].length-1,isRangeStart:!1})),a=S.linePaths.length/2;for(let t=0;t<a;t++)S.linePaths[t]=e.linePaths[t+a]+S.linePaths[t];S.linePaths.splice(a);const r=1===S.linePaths.length?this.lineHelpers.previousRangeAreaPath(s):null;S.pathFromLine=null!=r?r:e.pathFromLine+S.pathFromLine}else/z\s*$/i.test(S.pathFromArea)||(S.pathFromArea+="z");return S}_collapsedBaselineRow(t,e,i){const s=this.w,a=s.globals;if(s.config.chart.stacked||this.pointsChart)return null;if(!Array.isArray(t[e])||0!==t[e].length)return null;if(!this._hidden(i))return null;const r=s.axisFlags.isXNumeric?(s.seriesData.seriesX[i]||[]).length:a.dataPoints;if(!r)return null;const n=Zt.isNumber(a.minYArr[i])?a.minYArr[i]:a.minY,o=Zt.isNumber(a.maxYArr[i])?a.maxYArr[i]:a.maxY,l=Math.min(Math.max(0,n),o);return new Array(r).fill(Zt.isNumber(l)?l:0)}_initSerieVariables(t,e,i){const s=this.w,a=new R(this.w);this.xDivision=s.layout.gridWidth/(s.globals.dataPoints-("on"===s.config.xaxis.tickPlacement?1:0)),this.strokeWidth=Array.isArray(s.config.stroke.width)?s.config.stroke.width[i]:s.config.stroke.width;let r=0;this.yRatio.length>1&&(this.yaxisIndex=s.globals.seriesYAxisReverseMap[i],r=i),this.isReversed=s.config.yaxis[this.yaxisIndex]&&s.config.yaxis[this.yaxisIndex].reversed,this.zeroY=s.layout.gridHeight-this.baseLineY[r]-(this.isReversed?s.layout.gridHeight:0)+(this.isReversed?2*this.baseLineY[r]:0),this.areaBottomY=this.zeroY,(this.zeroY>s.layout.gridHeight||"end"===s.config.plotOptions.area.fillTo)&&(this.areaBottomY=s.layout.gridHeight),this.categoryAxisCorrection=this.xDivision/2;const n=s.config.series[i];if(this.elSeries=a.group({class:"apexcharts-series",zIndex:void 0!==n.zIndex?n.zIndex:i,seriesName:Zt.escapeString(s.seriesData.seriesNames[i])}),this.elPointsMain=a.group({class:"apexcharts-series-markers-wrap","data:realIndex":i}),this.markers.resetSeriesWrapCache(),this._elLastPointsWrap=null,s.globals.hasNullValues){const t=this.markers.plotChartMarkers({pointsPos:{x:[0],y:[s.layout.gridHeight+s.globals.markers.largestSize]},seriesIndex:e,j:0,pSize:.1,alwaysDrawMarker:!0,isVirtualPoint:!0});null!==t&&this.elPointsMain.add(t)}this.elDataLabelsWrap=a.group({class:"apexcharts-datalabels","data:realIndex":i});const o=t[e].length===s.globals.dataPoints;this.elSeries.attr({"data:longestSeries":o,rel:e+1,"data:realIndex":i}),this.appendPathFrom=!0}_calculatePathsFrom(t,e){const i=new R(this.w);let s=i.move(0,this.areaBottomY)+i.line(0,this.areaBottomY),a=s;if(this.w.globals.previousPaths.length>0){const e=this.lineHelpers.checkPreviousPaths({pathFromLine:s,pathFromArea:a,realIndex:t});s=e.pathFromLine,a=e.pathFromArea}return{prevY:e,pathFromLine:s,pathFromArea:a}}_stackKey(t,e){if(!this.w.axisFlags.isXNumeric)return e;const i=this.w.seriesData.seriesX[t];return i?i[e]:void 0}stackTopAt(t,e){const i=this._stackKey(t,e);if(null!=i)return this.prevSeriesYByX.get(i)}_hidden(t){const e=this.w.globals;return e.collapsedSeriesIndices.indexOf(t)>-1||e.ancillaryCollapsedSeriesIndices.indexOf(t)>-1}_recordStackTops(t,e,i=this.w.seriesData.series[t]){if(this.w.config.chart.stacked&&Array.isArray(e)&&!this._hidden(t))for(let s=0;s<e.length;s++){const a=this._stackKey(t,s);if(null==a)continue;const r=e[s];Zt.isNumber(r)&&null!=(null==i?void 0:i[s])&&this.prevSeriesYByX.set(a,r)}}_handlePaths({type:t,realIndex:e,i:i,paths:s}){var a,r,n,h,c,d,p;const g=this.w,f=new R(this.w),m=oi(this.ctx,f),x=new F(this.w);this.marks=[],this.prevSeriesY.push(s.yArrj),this._recordStackTops(e,s.yArrj);let b,y=null;"line"!==t&&"area"!==t||!g.globals.dataChanged||(y=function(t,e,i,s){var a;const r=t.globals,n=r.prevStreamFrame;if(!n||!r.dataChanged||!(null==(a=t.axisFlags)?void 0:a.isXNumeric))return null;const o=n.seriesX[e],l=n.seriesY[e],h=t.seriesData.seriesX[e],c=t.seriesData.series[e];if(!(o&&l&&h&&c))return null;if(o.length<3||h.length<3)return null;let d=-1;for(let t=0;t<o.length;t++)if(o[t]===h[0]){d=t;break}if(-1===d)return null;const u=Math.min(o.length-d,h.length);if(u<2)return null;const p=h.length-u;if(0===d&&0===p)return null;for(let t=0;t<u;t++){if(o[d+t]!==h[t])return null;const e=l[d+t],i=c[t];if(e!==i&&(null!=e||null!=i))return null}const g=n.xPixels[e],f=n.yPixels[e];if(!g||!f)return null;let m=-1,x=-1;for(let t=0;t<u;t++)null!=g[d+t]&&null!=f[d+t]&&null!=i[t]&&null!=s[t]&&(-1===m&&(m=t),x=t);if(-1===m||x<=m)return null;const b=i[m],y=i[x],v=g[d+m],w=g[d+x];if(Math.abs(y-b)<1e-6)return null;const _=(w-v)/(y-b),A=v-_*b;if(!isFinite(_)||!isFinite(A))return null;if(Math.abs(_-1)>.02)return null;if(Math.abs(A)<.5)return null;let S=m,C=m;for(let t=m;t<=x;t++){const e=s[t];null!=e&&null!=f[d+t]&&(e<s[S]&&(S=t),e>s[C]&&(C=t))}let k=1,P=0;const L=s[S],M=s[C];if(Math.abs(M-L)>1e-6?(k=(f[d+C]-f[d+S])/(M-L),P=f[d+S]-k*L):P=f[d+S]-L,!isFinite(k)||!isFinite(P)||k<.2||k>5)return null;const I=Math.floor((m+x)/2);if(I!==m&&I!==x&&null!=i[I]&&null!=g[d+I]){const t=_*i[I]+A;if(Math.abs(t-g[d+I])>1.5)return null;if(null!=s[I]&&null!=f[d+I]){const t=k*s[I]+P;if(Math.abs(t-f[d+I])>1.5)return null}}return r.streamScrolled=!0,{ax:_,bx:A,ay:k,by:P}}(g,e,s.xArrj,s.yArrj));const v=()=>b||(b=Wi(g,e,!0,!0));let w=null;y||"line"!==t&&"area"!==t||(w=Vi(g,{type:t,realIndex:e,pathFromLine:s.pathFromLine,pathFromArea:s.pathFromArea,linePaths:s.linePaths,areaPaths:s.areaPaths,join:v})),g.globals.seriesXvalues[e]=s.xArrj,g.globals.seriesYvalues[e]=s.yArrj;const _=g.config.forecastDataPoints;if(_.count>0&&"rangeArea"!==t){const t=s.xArrj.length-_.count-1,i=g.axisFlags.isXNumeric?(g.seriesData.seriesX[e][t]-g.globals.minX)/this.xRatio:g.globals.padHorizontal+this.categoryAxisCorrection+t*this.xDivision,a=f.drawRect(i,0,g.layout.gridWidth,g.layout.gridHeight,0);g.dom.elForecastMask.appendChild(a.node);const r=f.drawRect(0,0,i,g.layout.gridHeight,0);g.dom.elNonForecastMask.appendChild(r.node)}if(this.pointsChart)Ni(g,{elPointsMain:this.elPointsMain,realIndex:e,speed:g.config.chart.animations.dynamicAnimation.speed}),function(t,{elPointsMain:e,realIndex:i,speed:s}){if(!(null==e?void 0:e.node)||!Ri(t))return!1;if(-1===(t.globals.risingSeries||[]).indexOf(i))return!1;const a=e.node.querySelectorAll(".apexcharts-marker");if(!a.length)return!1;const r=Yi(t),n=Bi(t,e);e.node.classList.remove("apexcharts-element-hidden"),a.forEach(e=>{let i=parseFloat(e.getAttribute("cx")),a=parseFloat(e.getAttribute("cy"));if("star"===e.getAttribute("shape")||!isFinite(i+a)){const t=e.getBBox();i=t.x+t.width/2,a=t.y+t.height/2}ji(e,i,a,0),Hi(t,Math.max(1,s||1),r,t=>ji(e,i,a,t),()=>e.removeAttribute("transform"),n)})}(g,{elPointsMain:this.elPointsMain,realIndex:e,speed:g.config.chart.animations.dynamicAnimation.speed}),(g.seriesData.series[e]||[]).length||function(t,{elPointsMain:e,realIndex:i,speed:s,drawPoint:a}){var r,n,o;if(!(null==e?void 0:e.node)||!Ri(t))return!1;if(-1===(t.globals.collapsingSeriesIndices||[]).indexOf(i))return!1;const l=t.globals.prevStreamFrame,h=null==(r=null==l?void 0:l.xPixels)?void 0:r[i],c=null==(n=null==l?void 0:l.yPixels)?void 0:n[i];if(!Array.isArray(h)||!Array.isArray(c))return!1;const d=(null==(o=null==l?void 0:l.rPixels)?void 0:o[i])||[],p=t.globals.markers.size[i]||0,g=Yi(t);let f=!1;for(let r=0;r<h.length;r++){const n=h[r],o=c[r];if(null==n||null==o||!isFinite(n)||!isFinite(o))continue;const l=isFinite(d[r])?d[r]:p;if(!(l>0))continue;const m=a(n,o,l,r);if(!(null==m?void 0:m.node))continue;e.add(m);const x=m.node;x.classList.add("apexcharts-marker-exit");const b=u.trackSeriesTween(t,i);Hi(t,Math.max(1,s||1),g,t=>ji(x,n,o,1-t),()=>{ji(x,n,o,0),b()}),f=!0}f&&e.node.classList.remove("apexcharts-element-hidden")}(g,{elPointsMain:this.elPointsMain,realIndex:e,speed:g.config.chart.animations.dynamicAnimation.speed,drawPoint:(t,i,s,a)=>this.scatter.drawPoint(t,i,s,e,a,a)});else{g.globals.delayedElements.push({el:this.elPointsMain.node,index:e});Ni(g,{elPointsMain:this.elPointsMain,realIndex:e,speed:g.config.chart.animations.dynamicAnimation.speed,join:v})||"line"!==t||g.config.stroke.show||!g.globals.dataChanged&&!g.globals.resized||this.elPointsMain.node.classList.remove("apexcharts-element-hidden"),(null==(a=this.elDataLabelsWrap)?void 0:a.node)&&Wi(g,e,!1,!1,v())&&(this.elDataLabelsWrap.node.classList.add("apexcharts-element-hidden"),g.globals.delayedElements.push({el:this.elDataLabelsWrap.node,holdUntilComplete:!0}))}const A={i:i,realIndex:e,animationDelay:i,initialSpeed:g.config.chart.animations.speed,dataChangeSpeed:g.config.chart.animations.dynamicAnimation.speed,className:`apexcharts-${t}`},S=s.numericXY,C="line"===t||"area"===t,k=C&&s.linePaths.length>1?[s.linePaths.join(" ")]:s.linePaths,P=C&&s.areaPaths.length>1?[s.areaPaths.join(" ")]:s.areaPaths;if("area"===t){const t=x.fillPath({seriesNumber:e});for(let e=0;e<P.length;e++){const i=m.renderPaths(l(o({},A),{pathFrom:y?ps(P[e],y):null!=(n=null==(r=null==w?void 0:w.area)?void 0:r.from)?n:s.pathFromArea,pathTo:P[e],pathToNumeric:S?{xs:S.xs,ys:S.ys,closeY:S.areaCloseY}:void 0,pathToInterp:null==(h=null==w?void 0:w.area)?void 0:h.toInterp,scrollMorph:!!y,stroke:"none",strokeWidth:0,strokeLinecap:null,fill:t}));this.elSeries.add(i),this.marks.push(i)}}if(g.config.stroke.show&&!this.pointsChart){let a=null;if("line"===t)a=x.fillPath({seriesNumber:e,i:i});else if("solid"===g.config.stroke.fill.type)a=g.globals.stroke.colors[e];else{const t=g.config.fill;g.config.fill=g.config.stroke.fill,a=x.fillPath({seriesNumber:e,i:i}),g.config.fill=t}for(let i=0;i<k.length;i++){let r=a;"rangeArea"===t&&(r=x.fillPath({seriesNumber:e}));const n=l(o({},A),{pathFrom:y?ps(k[i],y):null!=(d=null==(c=null==w?void 0:w.line)?void 0:c.from)?d:s.pathFromLine,pathTo:k[i],pathToNumeric:S?{xs:S.xs,ys:S.ys}:void 0,pathToInterp:null==(p=null==w?void 0:w.line)?void 0:p.toInterp,scrollMorph:!!y,stroke:a,strokeWidth:this.strokeWidth,strokeLinecap:g.config.stroke.lineCap,fill:"rangeArea"===t?r:"none"}),h=m.renderPaths(n);if(this.elSeries.add(h),this.marks.push(h),h.attr("fill-rule","evenodd"),_.count>0&&"rangeArea"!==t){const t=m.renderPaths(n);t.node.setAttribute("stroke-dasharray",_.dashArray),_.strokeWidth&&t.node.setAttribute("stroke-width",_.strokeWidth),this.elSeries.add(t),t.attr("clip-path",`url(#forecastMask${g.globals.cuid})`),h.attr("clip-path",`url(#nonForecastMask${g.globals.cuid})`)}}}}_iterateOverDataPoints({type:t,series:e,iterations:i,realIndex:s,translationsIndex:a,i:r,x:n,y:o,pX:l,pY:h,pathsFrom:c,linePaths:d,areaPaths:u,seriesIndex:p,lineYPosition:g,xArrj:f,yArrj:m,y2Arrj:x,isRangeStart:b,seriesRangeEnd:y}){var v,w,_;const A=this.w,S=new R(this.w),C=this.yRatio,k=c.prevY;let P,L,{pathFromLine:M,pathFromArea:I}=c;const E=Zt.isNumber(A.globals.minYArr[s])?A.globals.minYArr[s]:A.globals.minY;i||(i=A.globals.dataPoints>1?A.globals.dataPoints-1:A.globals.dataPoints);const F=(t,e)=>e-t/C[a]+2*(this.isReversed?t/C[a]:0);let D=o;const T=A.config.chart.stacked&&!A.globals.comboCharts||A.config.chart.stacked&&A.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||"bar"===(null==(v=this.w.config.series[s])?void 0:v.type)||"column"===(null==(w=this.w.config.series[s])?void 0:w.type));let z=A.config.stroke.curve;Array.isArray(z)&&(z=Array.isArray(p)?z[p[r]]:z[r]);let X,O=0;const $=this.pointsChart?this._scatterJitterPx(s):null;if("straight"===z&&!this.pointsChart){const p=this._fastStraightPath({type:t,series:e,i:r,realIndex:s,translationsIndex:a,iterations:i,x:n,y:o,pX:l,pY:h,pathsFrom:c,linePaths:d,areaPaths:u,xArrj:f,yArrj:m,y2Arrj:x,stackSeries:T});if(p)return p}const W=T?this._stackXs:null;let Y=0;const H=[];!this._shapeOnly&&!this.pointsChart&&i>0&&e[r].length&&A.seriesData.series[r].length>1&&(A.globals.dataChanged||A.globals.resized||A.globals.markers.batched)&&this.elPointsMain.node.classList.add("apexcharts-element-hidden");for(let a=0;a<i&&0!==e[r].length;a++){const c=void 0===e[r][a+1]||null===e[r][a+1];if(A.axisFlags.isXNumeric){const t=A.seriesData.seriesX[s];let e=t[a+1];if(void 0===e&&(e=t[i-1]),n=(e-A.globals.minX)/this.xRatio,W){const i=[];for(;W[Y]<=t[a];)Y++;for(;W[Y]<e;)i.push([(W[Y]-A.globals.minX)/this.xRatio,null!=(_=this.prevSeriesYByX.get(W[Y++]))?_:this.zeroY]);i.length&&(H[a+1]=i)}}else n+=this.xDivision;if(T)if(r>0&&A.globals.collapsedSeries.length<A.config.series.length-1){if((t=>{var e;for(let i=t;i>=0;i--){const t=null!=(e=null==p?void 0:p[i])?e:i;if(!this._hidden(t))return i}return-1})(r-1)<0)g=this.zeroY;else{const t=this.stackTopAt(s,a+1);g=void 0===t?this.zeroY:t}}else g=this.zeroY;else g=this.zeroY;c?o=F(E,g):(o=F(e[r][a+1],g),"rangeArea"===t&&(D=F(y[r][a+1],g)));let v=n,w=o;if($){const t=100003*s+(a+1);$.x&&(v=n+2*(is(7919*t+13)-.5)*$.x),$.y&&(w=o+2*(is(6271*t+97)-.5)*$.y)}f.push(null===e[r][a+1]?null:v),!c||"smooth"!==A.config.stroke.curve&&"monotoneCubic"!==A.config.stroke.curve?(m.push(w),x.push(D)):(m.push(null),x.push(null));const C=this.lineHelpers.calculatePoints({series:e,x:v,y:w,realIndex:s,i:r,j:a,prevY:k}),R=this._createPaths({type:t,series:e,i:r,j:a,x:n,y:o,midsAt:H,y2:D,xArrj:f,yArrj:m,y2Arrj:x,pX:l,pY:h,pathState:O,segmentStartX:X,linePath:P,areaPath:L,linePaths:d,areaPaths:u,curve:z,isRangeStart:b});u=R.areaPaths,d=R.linePaths,l=R.pX,h=R.pY,O=R.pathState,X=R.segmentStartX,L=R.areaPath,P=R.linePath,!this.appendPathFrom||A.globals.hasNullValues||"monotoneCubic"===z&&"rangeArea"===t||(M+=S.line(n,this.areaBottomY),I+=S.line(n,this.areaBottomY)),this._shapeOnly||(this.handleNullDataPoints(e,C,r,a,s),this._handleMarkersAndLabels({type:t,pointsPos:C,j:a,realIndex:s,isRangeStart:b}))}return{yArrj:m,xArrj:f,pathFromArea:I,areaPaths:u,pathFromLine:M,linePaths:d}}_handleMarkersAndLabels({type:t,pointsPos:e,isRangeStart:i,j:s,realIndex:a}){const r=new I(this.w,this.ctx);if(this.pointsChart)this.scatter.draw(this.elSeries,s,{realIndex:a,pointsPos:e,zRatio:this.zRatio,elParent:this.elPointsMain});else{const t=this.markers.plotChartMarkers({pointsPos:e,seriesIndex:a,j:s+1});null!==t&&t!==this._elLastPointsWrap&&(this.elPointsMain.add(t),this._elLastPointsWrap=t)}const n=r.drawDataLabel({type:t,isRangeStart:i,pos:e,i:a,j:s+1});null!==n&&this.elDataLabelsWrap.add(n)}_scatterJitterPx(t){var e;const i=this.w,s=null==(e=i.config.plotOptions.scatter)?void 0:e.jitter;if(!s||!s.enabled||!s.x&&!s.y)return null;const a=i.axisFlags.isXNumeric&&this.xRatio?1/this.xRatio:this.xDivision,r=this.yRatio.length>1?t:0,n=this.yRatio[r]?1/this.yRatio[r]:0;return{x:(s.x||0)*a,y:(s.y||0)*n}}_fastStraightPath({type:t,series:e,i:i,realIndex:s,translationsIndex:a,iterations:r,x:n,y:o,pX:l,pY:h,pathsFrom:c,linePaths:d,areaPaths:u,xArrj:p,yArrj:g,y2Arrj:f,stackSeries:m}){const x=this.w;if("line"!==t&&"area"!==t)return null;if(x.globals.comboCharts||m)return null;if(x.config.dataLabels.enabled)return null;if(x.config.markers.discrete.length)return null;if(x.globals.markers.size[s]>0)return null;const b=e[i],y=b.length;if(!r||y<2||y-1!==r)return null;for(let t=0;t<=r;t++){const e=b[t];if(null==e)return null}const v=x.axisFlags.isXNumeric,w=v?x.seriesData.seriesX[s]:null;if(v&&(!w||w.length<y))return null;const _=this.yRatio[a],A=this.isReversed,S=this.zeroY,C=this.areaBottomY,k=this.xRatio,P=x.globals.minX,L=this.xDivision,M=x.config.markers.offsetX,I=x.config.markers.offsetY,E=this.appendPathFrom&&!x.globals.hasNullValues;let{pathFromLine:F,pathFromArea:D}=c;const T=this.ctx&&this.ctx.renderer,R=!(!T||!T.kind||"svg"===T.kind),z=!R||x.globals.dataChanged&&!!x.globals.prevStreamFrame,X=R?new Float64Array(y):null,O=R?new Float64Array(y):null;X&&O&&(X[0]=l,O[0]=h),void 0===x.globals.pointsArray[s]&&(x.globals.pointsArray[s]=[]);const $=x.globals.pointsArray[s],W=w?(w[0]-P)/k+M:this.categoryAxisCorrection+M;$.push([W,c.prevY+I]);const Y=z?new Array(r+1):[];z&&(Y[0]="M "+l+" "+h);const H=z&&E?new Array(r):null;let B=n,N=l,j=h;for(let t=0;t<r;t++){w?N=(w[t+1]-P)/k:(B+=L,N=B);const e=b[t+1];j=S-e/_+2*(A?e/_:0),p.push(N),g.push(j),f.push(o),$.push([N+M,j+I]),z&&(Y[t+1]=" L "+N+" "+j,H&&(H[t]=" L "+N+" "+C)),X&&O&&(X[t+1]=N,O[t+1]=j)}let V="",G="";if(z&&(V=Y.join(""),G=V+" L "+N+" "+C+" L "+l+" "+C+"z"),H){const t=H.join("");F+=t,D+=t}else!z&&E&&(F+=" L "+N+" "+C,D+=" L "+N+" "+C);return d.push(V),u.push(G),{yArrj:g,xArrj:p,pathFromArea:D,areaPaths:u,pathFromLine:F,linePaths:d,numericXY:X?{xs:X,ys:O,areaCloseY:C}:void 0}}_createPaths({type:t,series:e,i:i,j:s,x:a,y:r,midsAt:n,xArrj:o,yArrj:l,y2:h,y2Arrj:c,pX:d,pY:u,pathState:p,segmentStartX:g,linePath:f,areaPath:m,linePaths:x,areaPaths:b,curve:y,isRangeStart:v}){const w=new R(this.w),_=this.areaBottomY,A="rangeArea"===t,S="rangeArea"===t&&v,C=n[s+1],k=t=>C?[...C,[a,r]].map(([e,i],s,a)=>t(...s?a[s-1]:[d,u],e,i)).join(""):t(d,u,a,r);switch(y){case"monotoneCubic":{const t=v?l:c,a=(t,e)=>t.map((t,i)=>[t,e[i]]).filter(t=>null!==t[1]),r=t=>{const e=[];let i=0;return t.forEach(t=>{null!==t?i++:i>0&&(e.push(i),i=0)}),i>0&&e.push(i),e},h=(t,e)=>{const i=r(t),s=[];for(let t=0,a=0;t<i.length;a+=i[t++])s[t]=cs.slice(e,a,a+i[t]);return s};switch(p){case 0:if(null===t[s+1])break;p=1;case 1:if(!(A?o.length===e[i].length:s===e[i].length-2))break;case 2:{let e=v?o:o.slice().reverse(),i=v?t:t.slice().reverse();if(n.length&&!A){const t=[];e.forEach((e,s)=>{null!==i[s]&&null!=i[s-1]&&n[s]&&t.push(...n[s]),t.push([e,i[s]])}),e=t.map(t=>t[0]),i=t.map(t=>t[1])}const s=a(e,i),r=s.length>1?cs.points(s):s;let l=[];A&&(S?b=s:l=b.reverse());let c=0,d=0;if(h(i,r).forEach(t=>{c++;const e=(t=>{let e="";for(let i=0;i<t.length;i++){const s=t[i],a=s.length;a>4?(e+=`C${s[0]}, ${s[1]}`,e+=`, ${s[2]}, ${s[3]}`,e+=`, ${s[4]}, ${s[5]}`):a>2&&(e+=`S${s[0]}, ${s[1]}`,e+=`, ${s[2]}, ${s[3]}`)}return e})(t),i=d;d+=t.length;const a=d-1;S?f=w.move(s[i][0],s[i][1])+e:A?f=w.move(l[i][0],l[i][1])+w.line(s[i][0],s[i][1])+e+w.line(l[a][0],l[a][1]):(f=w.move(s[i][0],s[i][1])+e,m=f+w.line(s[a][0],_)+w.line(s[i][0],_)+"z",b.push(m)),x.push(f)}),A&&c>1&&!S){const t=x.slice(c).reverse();x.splice(c),t.forEach(t=>x.push(t))}p=0;break}}break}case"smooth":{const t=(t,e,i,s)=>{const a=.35*(i-t);return w.curve(t+a,e,i-a,s,i,s)};if(null===e[i][s])p=0;else switch(p){case 0:if(g=d,f=S?w.move(d,c[s])+w.line(d,u):w.move(d,u),m=w.move(d,u),null===e[i][s+1]||void 0===e[i][s+1]){x.push(f),b.push(m);break}if(p=1,s<e[i].length-2){const e=k(t);f+=e,m+=e;break}case 1:if(null===e[i][s+1])f+=S?w.line(d,h):w.move(d,u),m+=w.line(d,_)+w.line(g,_)+"z",x.push(f),b.push(m),p=-1;else{const n=k(t);f+=n,m+=n,s>=e[i].length-2&&(S&&(f+=w.curve(a,r,a,r,a,h)+w.move(a,h)),m+=w.curve(a,r,a,r,a,_)+w.line(g,_)+"z",x.push(f),b.push(m),p=-1)}}d=a,u=r;break}default:{const t=(t,e,i,s)=>{let a="";switch(y){case"stepline":a=w.line(i,null,"H")+w.line(null,s,"V");break;case"linestep":a=w.line(null,s,"V")+w.line(i,null,"H");break;case"straight":a=w.line(i,s)}return a};if(null===e[i][s])p=0;else switch(p){case 0:if(g=d,f=S?w.move(d,c[s])+w.line(d,u):w.move(d,u),m=w.move(d,u),null===e[i][s+1]||void 0===e[i][s+1]){if("stepline"===y&&null===e[i][s+1]&&!A){const t=w.line(a,null,"H");f+=t,m+=t+w.line(a,_)+w.line(g,_)+"z"}x.push(f),b.push(m);break}if(p=1,s<e[i].length-2){const e=k(t);f+=e,m+=e;break}case 1:if(null===e[i][s+1]){let t=d;if(S)f+=w.line(d,h);else if("stepline"!==y||A)f+=w.move(d,u);else{const e=w.line(a,null,"H");f+=e,m+=e,t=a}m+=w.line(t,_)+w.line(g,_)+"z",x.push(f),b.push(m),p=-1}else{const r=k(t);f+=r,m+=r,s>=e[i].length-2&&(S&&(f+=w.line(a,h)),m+=w.line(a,_)+w.line(g,_)+"z",x.push(f),b.push(m),p=-1)}}d=a,u=r;break}}return{linePaths:x,areaPaths:b,pX:d,pY:u,pathState:p,segmentStartX:g,linePath:f,areaPath:m}}handleNullDataPoints(t,e,i,s,a){const r=this.w;if(null===t[i][s]&&r.config.markers.showNullDataPoints||1===t[i].length){let t=this.strokeWidth-r.config.markers.strokeWidth/2;t>0||(t=0);const i=this.markers.plotChartMarkers({pointsPos:e,seriesIndex:a,j:s+1,pSize:t,alwaysDrawMarker:!0});null!==i&&this.elPointsMain.add(i)}}}class fs{constructor(t){this.w=t}drawYAxisTexts(t,e,i,s){const a=this.w,r=a.config.yaxis[0],n=a.formatters.yLabelFormatters[0];return new R(this.w).drawText({x:t+r.labels.offsetX,y:e+r.labels.offsetY,text:n(s,i),textAnchor:"middle",fontSize:r.labels.style.fontSize,fontFamily:r.labels.style.fontFamily,foreColor:Array.isArray(r.labels.style.colors)?r.labels.style.colors[i]:r.labels.style.colors})}getMaxLabelWidth(t,{fontSize:e,fontFamily:i,fontWeight:s}={}){const a=new R(this.w);let r=0;return t.forEach(t=>{if(null==t||""===t)return;const n=a.getTextRects(`${t}`,e||"12px",i,"",!0,s);r=Math.max(r,n.width)}),r}drawExternalLabel(t){return function(t,e){const{lines:i,lineHeight:s,anchor:a,elbow:r,labelX:n,labelY:o,side:l,connector:h,style:c,foreColor:d}=e,u=new R(t),p=u.group({class:e.groupClass||"apexcharts-outer-label-group"});if(h.show){const t=`M ${a.x} ${a.y} L ${r.x} ${r.y} L ${n} ${o}`,i=u.drawPath({d:t,stroke:h.color,strokeWidth:h.width,fill:"none",strokeLinecap:"round"});i.node.classList.add(e.connectorClass||"apexcharts-outer-label-connector"),p.add(i)}const g="right"===l?n+4:n-4,f=i.length,m=o-(f-1)*s/2,x=u.drawText({x:g,y:m,text:1===f?i[0]:i,textAnchor:"right"===l?"start":"end",fontSize:c.fontSize,fontFamily:c.fontFamily,fontWeight:c.fontWeight,foreColor:d,dominantBaseline:"central",cssClass:e.textClass||"apexcharts-outer-label"});if(f>1){const t=x.node.getElementsByTagName("tspan");for(let e=0;e<t.length;e++)t[e].setAttribute("x",`${g}`),t[e].setAttribute("dy",0===e?"0":`${s}`)}return p.add(x),p}(this.w,l(o({},t),{groupClass:"apexcharts-pie-name-label-group",textClass:"apexcharts-pie-name-label",connectorClass:"apexcharts-pie-label-connector"}))}}const ms=Math.PI/180,xs=180/Math.PI;function bs(t,e,i,s){return{x:t+i*Math.cos((s-90)*ms),y:e+i*Math.sin((s-90)*ms)}}const ys=t=>`${t.x} ${t.y}`;function vs({cx:t,cy:e,rIn:i,rOut:s,a0:a,a1:r,r:n,spanDeg:o}){const l=(i,s)=>bs(t,e,i,s),h=n/s*xs,c=n/i*xs,d=l(s,a+h),u=l(s,r-h),p=o-2*h>180?1:0,g=l(s,r),f=l(s-n,r),m=l(s,a),x=l(s-n,a),b=l(i,r-c),y=l(i,a+c),v=o-2*c>180?1:0,w=l(i,r),_=l(i+n,r),A=l(i,a),S=l(i+n,a);return["M",ys(d),"A",s,s,0,p,1,ys(u),"Q",ys(g),ys(f),"L",ys(_),"Q",ys(w),ys(b),"A",i,i,0,v,0,ys(y),"Q",ys(A),ys(S),"L",ys(x),"Q",ys(m),ys(d),"Z"].join(" ")}class ws{constructor(t,e){this.ctx=e,this.w=t,this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animBeginArr=[0],this.animDur=0,this.donutDataLabels=this.w.config.plotOptions.pie.donut.labels,this.lineColorArr=void 0!==t.globals.stroke.colors?t.globals.stroke.colors:t.globals.colors,this.defaultSize=Math.min(t.layout.gridWidth,t.layout.gridHeight),this.centerY=t.layout.gridHeight/2,this.centerX=t.layout.gridWidth/2,"radialBar"===t.config.chart.type?this.fullAngle=360:this.fullAngle=Math.abs(t.config.plotOptions.pie.endAngle-t.config.plotOptions.pie.startAngle),this.initialAngle=t.config.plotOptions.pie.startAngle%this.fullAngle,t.globals.radialSize=this.defaultSize/2.05-t.config.stroke.width-(t.config.chart.sparkline.enabled?0:t.config.chart.dropShadow.blur),this.externalCfg=t.config.plotOptions.pie.dataLabels.external;const i=t.config.dataLabels.style;this.externalLabelStyle={fontSize:this.externalCfg.fontSize||i.fontSize,fontFamily:this.externalCfg.fontFamily||i.fontFamily,fontWeight:this.externalCfg.fontWeight||i.fontWeight},this.externalLabels=[],this.externalLabelMaxLines=1,this.externalLabelLineH=parseFloat(this.externalLabelStyle.fontSize)||12,t.globals.pieExternalLabelMarginY=0,this.showExternalLabels=this.externalCfg.show&&"polarArea"!==this.chartType,this.showExternalLabels&&!t.globals.noData&&this.reserveExternalLabelSpace(),this.donutSize=t.globals.radialSize*parseInt(t.config.plotOptions.pie.donut.size,10)/100;const s=t.config.plotOptions.pie.customScale,a=t.layout.gridWidth/2,r=t.layout.gridHeight/2;this.translateX=a-a*s,this.translateY=r-r*s,this.dataLabelsGroup=new R(this.w).group({class:"apexcharts-datalabels-group",transform:`translate(${this.translateX}, ${this.translateY}) scale(${s})`}),this.maxY=0,this.sliceLabels=[],this.sliceSizes=[],this.prevSliceSizes=[],this.sliceLabelGroups={},this.externalLabelGroups={},this.elHoverOutline=null,this.elHoverOutlinePath=null,this.hoverOutlineIndex=-1,this.prevSectorAngleArr=[]}getExternalLabelText(t){var e,i,s;const a=this.w,r=a.seriesData.seriesNames[t],n=this.externalCfg.formatter;return"function"==typeof n?n(r,{seriesIndex:t,percent:null==(i=null==(e=a.globals.seriesPercent)?void 0:e[t])?void 0:i[0],value:null==(s=a.globals.seriesTotals)?void 0:s[t],w:a}):null==r?"":`${r}`}getExternalLabelLines(t){const e=this.getExternalLabelText(t);return(Array.isArray(e)?e:`${null==e?"":e}`.split("\n")).map(t=>null==t?"":`${t}`)}reserveExternalLabelSpace(){const t=this.w,e=new fs(t),i=(t.seriesData.seriesNames||[]).map((t,e)=>this.getExternalLabelLines(e)),s=e.getMaxLabelWidth(i.flat(),this.externalLabelStyle);this.externalLabelMaxLines=i.reduce((t,e)=>Math.max(t,e.length),1),this.externalLabelLineH=Math.round(1.35*(parseFloat(this.externalLabelStyle.fontSize)||12));const a=this.externalCfg.connector,r=this.externalLabelMaxLines*this.externalLabelLineH,n=s+(a.length||0)+(a.gap||0)+12,o=r/2+(a.gap||0)+6,l=Math.min(t.globals.radialSize,t.layout.gridWidth/2-n,t.layout.gridHeight/2-o);t.globals.radialSize=Math.max(l,.15*this.defaultSize),t.globals.pieExternalLabelMarginY=o;const h=t.config.chart.height?String(t.config.chart.height):"",c=""!==h&&"auto"!==h;this.centerY=c?t.layout.gridHeight/2:t.globals.radialSize+o}draw(t){var e,i;const s=this.w,a=new R(this.w),r=a.group({class:"apexcharts-pie"});if(s.globals.noData)return r;null==(e=this.ctx.highlightFilter)||e.pie(this);const n=s.config.plotOptions.pie.customScale,o="donut"===this.chartType?this.donutSize:0,l=[],h=this.initialAngle,c=(t,e)=>this.translateY+n*Zt.polarToCartesian(this.centerX,this.centerY,t,e).y;for(let t=h;t<=h+this.fullAngle;t++)l.push(c(s.globals.radialSize,t),c(o,t));this.donutDataLabels.show&&l.push(c(o,180)),s.globals.circleGeometry={node:r.node,cx:this.translateX+n*this.centerX,cy:this.translateY+n*this.centerY,r:n*s.globals.radialSize,y:"polarArea"!==this.chartType&&[Math.min(...l),Math.max(...l)]};let d=0;for(let e=0;e<t.length;e++)d+=Zt.negToZero(t[e]);const u=[],p=a.group();0===d&&(d=1e-5),t.forEach(t=>{this.maxY=Math.max(this.maxY,t)}),s.config.yaxis[0].max&&(this.maxY=s.config.yaxis[0].max),"back"===s.config.grid.position&&"polarArea"===this.chartType&&this.drawPolarElements(r);const g=s.globals.collapsedSeriesIndices||[];let f=1;if("polarArea"===this.chartType){let e=0;for(let i=0;i<t.length;i++)-1===g.indexOf(i)&&e++;f=Math.max(1,e)}for(let e=0;e<t.length;e++){const i=this.fullAngle*Zt.negToZero(t[e])/d;u.push(i),"polarArea"===this.chartType?(u[e]=g.indexOf(e)>-1?0:this.fullAngle/f,this.sliceSizes.push(s.globals.radialSize*Zt.negToZero(t[e])/(this.maxY||1))):this.sliceSizes.push(s.globals.radialSize)}const m=!0===(null==(i=this.ctx.morphTypeChange)?void 0:i.isActive());if(s.globals.dataChanged&&!m){if("polarArea"===this.chartType){const t=s.globals.previousPaths,e=s.globals.prevPolarAngles;if(Array.isArray(e)&&e.length===t.length)this.prevSectorAngleArr=e.slice();else for(let e=0;e<t.length;e++)this.prevSectorAngleArr.push(this.fullAngle/Math.max(1,t.length));const i=s.globals.prevPolarSizes;if(Array.isArray(i)&&i.length===t.length)this.prevSliceSizes=i.map(t=>t*s.globals.radialSize);else{let e=0;for(let i=0;i<t.length;i++)e=Math.max(e,Zt.negToZero(t[i]));s.config.yaxis[0].max&&(e=s.config.yaxis[0].max),this.prevSliceSizes=t.map(t=>s.globals.radialSize*Zt.negToZero(t)/(e||1))}}else{let t=0;for(let e=0;e<s.globals.previousPaths.length;e++)t+=Zt.negToZero(s.globals.previousPaths[e]);for(let e=0;e<s.globals.previousPaths.length;e++)this.prevSectorAngleArr.push(t?this.fullAngle*Zt.negToZero(s.globals.previousPaths[e])/t:0)}for(;!1!==s.globals.shouldAnimate&&this.prevSectorAngleArr.length<t.length;)this.prevSectorAngleArr.push(0)}if("polarArea"===this.chartType){s.globals.prevPolarAngles=u.slice();const t=s.globals.radialSize||1;s.globals.prevPolarSizes=this.sliceSizes.map(e=>e/t)}if(this.donutSize<0&&(this.donutSize=0),"donut"===this.chartType){const t=a.drawCircle(this.donutSize);t.attr({cx:this.centerX,cy:this.centerY,fill:s.config.plotOptions.pie.donut.background?s.config.plotOptions.pie.donut.background:"transparent"}),p.add(t)}const x=this.drawArcs(u,t);if(this.sliceLabels.forEach(t=>{x.add(t)}),p.attr({transform:`translate(${this.translateX}, ${this.translateY}) scale(${s.config.plotOptions.pie.customScale})`}),p.add(x),r.add(p),this.donutDataLabels.show){const t=this.initialAnim&&!s.globals.resized&&!s.globals.dataChanged&&this.animDur>0,e=this.renderInnerDataLabels(this.dataLabelsGroup,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:t?0:this.donutDataLabels.show});if(t){const t=this.dataLabelsGroup.node;t.style.transition="opacity 280ms ease-out",setTimeout(()=>{t.style.opacity="1"},this.animDur)}r.add(e)}return"front"===s.config.grid.position&&"polarArea"===this.chartType&&this.drawPolarElements(r),r}drawArcs(t,e){var i,s,a,r,n;const o=this.w,l=new D(this.w),h=new R(this.w),c=new F(this.w),d=h.group({class:"apexcharts-slices"});this.elHoverOutline=h.group({class:"apexcharts-pie-hover-outline"}),this.elHoverOutline.node.style.pointerEvents="none",this.elHoverOutline.node.style.opacity="0",o.config.chart.animations.enabled&&(this.elHoverOutline.node.style.transition="opacity 180ms ease-out"),d.add(this.elHoverOutline);let u=this.initialAngle,p=this.initialAngle,g=this.initialAngle,f=this.initialAngle;this.strokeWidth=o.config.stroke.show?o.config.stroke.width:0;const m=!0===(null==(i=this.ctx.morphTypeChange)?void 0:i.isActive());for(let i=0;i<t.length;i++){const x=h.group({class:"apexcharts-series apexcharts-pie-series",seriesName:Zt.escapeString(o.seriesData.seriesNames[i]),rel:i+1,"data:realIndex":i});d.add(x),u=g,p=f,g=u+t[i],f=p+this.prevSectorAngleArr[i];const b=g<u?this.fullAngle+g-u:g-u,y=c.fillPath({seriesNumber:i,size:this.sliceSizes[i],value:e[i]}),v=m?this.ctx.morphTypeChange.getInitialPathFor(i,0):null,w="polarArea"===this.chartType&&o.globals.dataChanged&&!m?this.prevSliceSizes[i]||0:void 0,_=v||this.getChangedPath(p,f,w),A=h.drawPath({d:_,stroke:Array.isArray(this.lineColorArr)?null!=(s=this.lineColorArr[i])?s:this.lineColorArr[i%this.lineColorArr.length]:this.lineColorArr,strokeWidth:0,fill:y,fillOpacity:o.config.fill.opacity,classes:`apexcharts-pie-area apexcharts-${this.chartType.toLowerCase()}-slice-${i}`});if(A.attr({index:0,j:i}),l.setSelectionFilter(A,0,i),o.config.chart.dropShadow.enabled){const t=o.config.chart.dropShadow;l.dropShadow(A,t,i)}this.addListeners(A,this.donutDataLabels,i);let S={x:0,y:0};const C=(u+b/2)%this.fullAngle;let k={x:this.centerX,y:this.centerY};"pie"===this.chartType||"polarArea"===this.chartType?(S=Zt.polarToCartesian(this.centerX,this.centerY,o.globals.radialSize/1.25+o.config.plotOptions.pie.dataLabels.offset,C),k=Zt.polarToCartesian(this.centerX,this.centerY,o.globals.radialSize/2,C)):"donut"===this.chartType&&(S=Zt.polarToCartesian(this.centerX,this.centerY,(o.globals.radialSize+this.donutSize)/2+o.config.plotOptions.pie.dataLabels.offset,C),k=Zt.polarToCartesian(this.centerX,this.centerY,(o.globals.radialSize+this.donutSize)/2,C)),R.setAttrs(A.node,{"data:angle":b,"data:startAngle":u,"data:strokeWidth":this.strokeWidth,"data:value":e[i],"data:cx":k.x,"data:cy":k.y}),x.add(A);let P=!1;if(m){const t=this.getPiePath({me:this,startAngle:u,angle:b,size:this.sliceSizes[i]});A.node.setAttribute("data:pathFinal",t),P=!0===(null==(r=(a=this.ctx.morphTypeChange).claimsTargetMark)?void 0:r.call(a,i,0)),P&&(A.attr({d:t}),A.node.setAttribute("data:pathOrig",t),A.node.setAttribute("opacity","0"),A.node.setAttribute("data-piece-hidden","1"))}const L=(o.globals.collapsedSeriesIndices||[]).includes(i);let M=0;if(!this.initialAnim||o.globals.resized||o.globals.dataChanged?this.animBeginArr.push(0):(M=b/this.fullAngle*o.config.chart.animations.speed,0===M&&(M=1),this.animDur=M+this.animDur,this.animBeginArr.push(this.animDur)),P);else if(m&&v){const t=this.getPiePath({me:this,startAngle:u,angle:b,size:this.sliceSizes[i]}),e=this.ctx.morphTypeChange.getSpeed(),s=this.ctx.animations;A.node.setAttribute("data:pathOrig",t);const a=A.animate(e).plot(t,"polygons").attr({"stroke-width":this.strokeWidth});a&&"function"==typeof a.after?a.after(()=>s.animationCompleted(A)):s.animationCompleted(A)}else this.dynamicAnim&&o.globals.dataChanged?this.animatePaths(A,{size:this.sliceSizes[i],prevSize:w,endAngle:g,startAngle:u,prevStartAngle:p,prevEndAngle:f,animateStartingPos:!0,i:i,animBeginArr:this.animBeginArr,shouldSetPrevPaths:!0,dur:o.config.chart.animations.dynamicAnimation.speed,collapsed:L}):this.animatePaths(A,{size:this.sliceSizes[i],endAngle:g,startAngle:u,i:i,animBeginArr:this.animBeginArr,dur:M,collapsed:L});if(this.getExpandOffset()>0?A.node.addEventListener("mouseup",this.pieClicked.bind(this,i)):0===i&&D.drilldownBlocksSliceOffset(o)&&(null==(n=this.ctx.drilldown)||n.warnSliceOffsetDisabled()),void 0!==o.interact.selectedDataPoints[0]&&o.interact.selectedDataPoints[0].indexOf(i)>-1)if(this.initialAnim&&!o.globals.resized&&!o.globals.dataChanged&&this.animDur>0){const t=o.dom.Paper;setTimeout(()=>{o.dom.Paper===t&&this.setSliceOut(i)},this.animDur)}else this.setSliceOut(i);if(o.config.dataLabels.enabled){const e=S.x,s=S.y;let a=100*b/this.fullAngle+"%";if(0!==b&&o.config.plotOptions.pie.dataLabels.minAngleToShowLabel<t[i]){const t=o.config.dataLabels.formatter;void 0!==t&&(a=t(o.globals.seriesPercent[i][0],{seriesIndex:i,dataPointIndex:i,series:o.seriesData.series,w:o}));const r=o.globals.dataLabels.style.colors[i],n=h.group({class:"apexcharts-datalabels","data:slice":i}),c=h.drawText({x:e,y:s,text:a,textAnchor:"middle",fontSize:o.config.dataLabels.style.fontSize,fontFamily:o.config.dataLabels.style.fontFamily,fontWeight:o.config.dataLabels.style.fontWeight,foreColor:r});if(n.add(c),o.config.dataLabels.dropShadow.enabled){const t=o.config.dataLabels.dropShadow;l.dropShadow(c,t)}c.node.classList.add("apexcharts-pie-label"),!this.initialAnim||o.globals.resized||o.globals.dataChanged||(c.attr({opacity:0}),c.animate(300,o.config.chart.animations.speed).attr({opacity:1})),this.sliceLabels.push(n),this.sliceLabelGroups[i]=n.node}}if(this.showExternalLabels&&0!==b){const t=this.getExternalLabelLines(i);if(t.some(t=>""!==t)){const e=Zt.polarToCartesian(this.centerX,this.centerY,o.globals.radialSize,C),s=Zt.polarToCartesian(this.centerX,this.centerY,o.globals.radialSize+(this.externalCfg.connector.gap||0),C),a=s.x>=this.centerX,r=a?s.x+(this.externalCfg.connector.length||0):s.x-(this.externalCfg.connector.length||0);this.externalLabels.push({i:i,lines:t,anchor:e,elbow:s,side:a?"right":"left",labelX:r+parseFloat(this.externalCfg.offsetX||0),idealY:s.y+parseFloat(this.externalCfg.offsetY||0),connectorColor:this.externalCfg.connector.color||o.globals.colors[i],foreColor:this.externalCfg.color||o.config.chart.foreColor})}}}if(this.showExternalLabels&&this.externalLabels.length){this.placeExternalLabels();const t=Nt.isBrowser()&&(m||this.dynamicAnim&&o.globals.dataChanged||this.initialAnim&&!o.globals.resized&&!o.globals.dataChanged);this.externalLabels.forEach(e=>{const i=new fs(o).drawExternalLabel({lines:e.lines,lineHeight:this.externalLabelLineH,anchor:e.anchor,elbow:e.elbow,labelX:e.labelX,labelY:e.labelY,side:e.side,connector:{show:this.externalCfg.connector.show,width:this.externalCfg.connector.width,color:e.connectorColor},style:this.externalLabelStyle,foreColor:e.foreColor});t&&(i.node.classList.add("apexcharts-element-hidden"),o.globals.delayedElements.push({el:i.node})),this.externalLabelGroups[e.i]=i.node,i.node.setAttribute("data:slice",String(e.i)),d.add(i)})}return d}placeExternalLabels(){const t=this.w,e=this.externalLabelMaxLines*this.externalLabelLineH,i=t.globals.radialSize+t.globals.pieExternalLabelMarginY,s=this.centerY+i,a=this.centerY-i+e/2;["left","right"].forEach(t=>{const i=this.externalLabels.filter(e=>e.side===t);!function(t,e,i,s){const a=t.slice().sort((t,e)=>t.idealY-e.idealY);a.forEach(t=>{t.labelY=t.idealY});for(let t=1;t<a.length;t++)a[t].labelY-a[t-1].labelY<e&&(a[t].labelY=a[t-1].labelY+e);const r=a[a.length-1],n=r?r.labelY-i:0;if(n>0)for(let t=a.length-1;t>=0;t--)a[t].labelY-=n,t<a.length-1&&a[t+1].labelY-a[t].labelY<e&&(a[t].labelY=a[t+1].labelY-e);if(null!=s&&a.length&&a[0].labelY<s){const t=s-a[0].labelY;for(let e=0;e<a.length;e++)a[e].labelY+=t}}(i,Math.min(e+2,(s-a)/Math.max(1,i.length-1)),s,a)})}addListeners(t,e,i){const s=new R(this.w,this.ctx);t.node.addEventListener("mouseenter",s.pathMouseEnter.bind(s,t)),t.node.addEventListener("mouseleave",s.pathMouseLeave.bind(s,t)),t.node.addEventListener("mouseleave",this.revertDataLabelsInner.bind(this)),"number"==typeof i&&(t.node.addEventListener("mouseenter",this.showHoverOutline.bind(this,i)),t.node.addEventListener("mouseleave",this.hideHoverOutline.bind(this))),t.node.addEventListener("mousedown",s.pathMouseDown.bind(s,t)),this.donutDataLabels.total.showAlways||(t.node.addEventListener("mouseenter",this.printDataLabelsInner.bind(this,t.node,e)),t.node.addEventListener("mousedown",this.printDataLabelsInner.bind(this,t.node,e)))}animatePaths(t,e){let i=e.endAngle<e.startAngle?this.fullAngle+e.endAngle-e.startAngle:e.endAngle-e.startAngle,s=i,a=e.startAngle;const r=e.startAngle;void 0!==e.prevStartAngle&&void 0!==e.prevEndAngle&&(a=e.prevEndAngle,s=e.prevEndAngle<e.prevStartAngle?this.fullAngle+e.prevEndAngle-e.prevStartAngle:e.prevEndAngle-e.prevStartAngle),i!==this.fullAngle||this.isFullTurnSlice(i)||(i=this.fullAngle-.01),this.animateArc(t,a,r,i,s,e)}animateArc(t,e,i,s,a,r){const n=this,o=this.w,l=new u(this.w),h=r.size;let c;(isNaN(e)||isNaN(a))&&(e=i,a=0,!1===o.globals.shouldAnimate&&(a=s,r.dur=0));let d=s,p=i;const g=e<i?this.fullAngle+e-i:e-i,f="number"==typeof r.prevSize;o.globals.dataChanged&&r.shouldSetPrevPaths&&Number.isFinite(r.prevEndAngle)&&(c=n.getPiePath({me:n,startAngle:r.prevStartAngle,angle:r.prevEndAngle<r.prevStartAngle?this.fullAngle+r.prevEndAngle-r.prevStartAngle:r.prevEndAngle-r.prevStartAngle,size:f?r.prevSize:h}),t.attr({d:c})),0!==r.dur?t.animate(r.dur,r.animBeginArr[r.i]).after(function(){"pie"!==n.chartType&&"donut"!==n.chartType&&"polarArea"!==n.chartType||this.animate(o.config.chart.animations.dynamicAnimation.speed).attr({"stroke-width":n.strokeWidth}),r.collapsed&&t.attr({d:""}),r.i===o.config.series.length-1&&l.animationCompleted(t)}).during(o=>{d=g+(s-g)*o,r.animateStartingPos&&(d=a+(s-a)*o,p=e-a+(i-(e-a))*o),c=n.getPiePath({me:n,startAngle:p,angle:d,size:f?r.prevSize+(h-r.prevSize)*o:h}),t.node.setAttribute("data:pathOrig",c),t.attr({d:c})}):(c=n.getPiePath({me:n,startAngle:p,angle:s,size:h}),r.isTrack||(o.globals.animationEnded=!0),t.node.setAttribute("data:pathOrig",c),t.attr({d:r.collapsed?"":c,"stroke-width":n.strokeWidth}))}pieClicked(t,e){const i=this.w,s=!(e&&!1===e.animate),a=i.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${t}`);if(a){if("true"===a.attr("data:pieClicked"))return a.attr({"data:pieClicked":"false"}),this.revertDataLabelsInner(),void this.offsetSlice(t,0,s);if(!i.config.states.active.allowMultipleDataPointsSelection){const t=i.dom.baseEl.getElementsByClassName("apexcharts-pie-area");Array.prototype.forEach.call(t,t=>{const e="true"===t.getAttribute("data:pieClicked");t.setAttribute("data:pieClicked","false"),e&&this.offsetSlice(parseInt(t.getAttribute("j"),10),0,s)})}i.interact.capturedDataPointIndex=t,a.attr("data:pieClicked","true"),this.offsetSlice(t,this.getExpandOffset(),s)}}getExpandOffset(){return D.sliceExpandOffset(this.w)}getSliceMovers(t){const e=this.w.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${t}`);return[e?e.node:null,this.sliceLabelGroups[t],this.externalLabelGroups[t],this.hoverOutlineIndex===t&&this.elHoverOutlinePath?this.elHoverOutlinePath.node:null].filter(Boolean)}offsetSlice(t,e,i=!0){const s=this.w;if(!s.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${t}`))return;const{dx:a,dy:r}=this.getSliceOffsetVector(t,e),n=`translate(${a} ${r})`,o=i&&s.config.chart.animations.enabled?"transform 320ms cubic-bezier(0.25, 0.8, 0.3, 1)":"";this.getSliceMovers(t).forEach(t=>{t.classList.add("apexcharts-slice-mover"),t.style.transition=o,t.setAttribute("transform",n)})}getSliceOffsetVector(t,e){const i=this.w.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${t}`),s=i?parseFloat(i.attr("data:angle")):NaN;if(!e||!Number.isFinite(s)||s>=this.fullAngle)return{dx:0,dy:0};const a=parseFloat(i.attr("data:startAngle")),r=Math.PI*(a+s/2-90)/180;return{dx:e*Math.cos(r),dy:e*Math.sin(r)}}showHoverOutline(t){const e=this.w;if(!D.hoverOutlineOwnsHoverState(e))return;if(!this.elHoverOutline)return;const i=this.getHoverOutlinePath(t);if(!i)return;const s=e.config.plotOptions.pie.hoverOutline,a=s.color||e.globals.colors[t];if(!this.elHoverOutlinePath){const t=new R(e);this.elHoverOutlinePath=t.drawPath({d:i,fill:a,strokeWidth:0,classes:"apexcharts-pie-hover-outline-band"}),this.elHoverOutline.add(this.elHoverOutlinePath)}this.elHoverOutlinePath.attr({d:i,fill:a,"fill-opacity":s.opacity});const{dx:r,dy:n}=this.getSliceOffsetVector(t,this.isSliceOut(t)?this.getExpandOffset():0);this.elHoverOutlinePath.node.classList.remove("apexcharts-slice-mover"),this.elHoverOutlinePath.node.style.transition="",this.elHoverOutlinePath.node.setAttribute("transform",`translate(${r} ${n})`),this.hoverOutlineIndex=t,this.elHoverOutline.node.style.opacity="1"}hideHoverOutline(){this.elHoverOutline&&(this.elHoverOutline.node.style.opacity="0")}setSliceOut(t){this.isSliceOut(t)||this.pieClicked(t,{animate:!1})}isSliceOut(t){const e=this.w.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${t}`);return!!e&&"true"===e.attr("data:pieClicked")}getHoverOutlinePath(t){const e=this.w,i=e.config.plotOptions.pie.hoverOutline,s=e.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${t}`);if(!s)return null;const a=parseFloat(s.attr("data:angle"));if(!Number.isFinite(a)||a<=0)return null;const r=this.sliceSizes[t],n=Number(i.size);if(!Number.isFinite(r)||!Number.isFinite(n)||n<=0)return null;const{startDeg:h,spanDeg:c}=this.getSliceExtent({me:this,startAngle:parseFloat(s.attr("data:startAngle")),angle:a,size:r});if(!(c>0))return null;const d=r+(this.strokeWidth||0)/2+(Number(i.gap)||0),u=d+n,p={cx:this.centerX,cy:this.centerY,rIn:d,rOut:u,a0:h,a1:h+c,spanDeg:c},g=Math.min(n/2,c*Math.PI/180/2*d);return g>.5?vs(l(o({},p),{r:g})):function({cx:t,cy:e,rIn:i,rOut:s,a0:a,a1:r,spanDeg:n}){const o=(i,s)=>bs(t,e,i,s),l=n>180?1:0,h=o(s,a),c=o(s,r),d=o(i,r),u=o(i,a);return["M",ys(h),"A",s,s,0,l,1,ys(c),"L",ys(d),"A",i,i,0,l,0,ys(u),"Z"].join(" ")}(p)}getChangedPath(t,e,i){return this.dynamicAnim&&this.w.globals.dataChanged&&"number"==typeof i?this.getPiePath({me:this,startAngle:t,angle:e-t,size:i}):""}getSliceExtent({me:t,startAngle:e,angle:i,size:s}){const a=this.w;let r=e,n=i+e;Math.ceil(n)>=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle&&(n=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle-.01);let o=n-r;const l="pie"===t.chartType||"donut"===t.chartType||"polarArea"===t.chartType,h=a.config.plotOptions.pie.spacing;if(l&&h>0&&o>0){const e="donut"===t.chartType?(s+t.donutSize)/2:s,i=e>0?h/e*(180/Math.PI):0,a=Math.min(i/2,Math.max(0,o/2-.5));r+=a,o-=2*a}return n=r+o,Math.ceil(n)>this.fullAngle&&(n-=this.fullAngle),{startDeg:r,spanDeg:o,endDeg:n}}isFullTurnSlice(t){const e=this.chartType;return("pie"===e||"donut"===e||"polarArea"===e)&&this.fullAngle>=360&&t>=this.fullAngle-1e-4&&!(this.w.config.plotOptions.pie.spacing>0)}getFullTurnPath({me:t,startAngle:e,size:i}){const s=new R(this.w),a=t.centerX,r=t.centerY,n=Zt.polarToCartesian(a,r,i,e),o=Zt.polarToCartesian(a,r,i,e+180),l=["M",n.x,n.y,"A",i,i,0,1,1,o.x,o.y,"A",i,i,0,1,1,n.x,n.y,"z"];if("donut"===t.chartType){const i=Zt.polarToCartesian(a,r,t.donutSize,e),s=Zt.polarToCartesian(a,r,t.donutSize,e+180);l.push("M",i.x,i.y,"A",t.donutSize,t.donutSize,0,1,0,s.x,s.y,"A",t.donutSize,t.donutSize,0,1,0,i.x,i.y,"z")}return s.roundPathCorners(l.join(" "),2*this.strokeWidth)}getPiePath({me:t,startAngle:e,angle:i,size:s}){let a;const r=this.w,n=new R(this.w),o="pie"===t.chartType||"donut"===t.chartType||"polarArea"===t.chartType;if(o&&this.isFullTurnSlice(i))return this.getFullTurnPath({me:t,startAngle:e,size:s});if(o&&Number.isFinite(i)&&!(i>0)){const i=Zt.polarToCartesian(t.centerX,t.centerY,s,e);return`M ${i.x} ${i.y}`}const{startDeg:l,spanDeg:h,endDeg:c}=this.getSliceExtent({me:t,startAngle:e,angle:i,size:s}),d=Math.PI*(l-90)/180,u=r.config.plotOptions.pie.borderRadius;if(u>0&&o){const e=this.getRoundedSlicePath({me:t,startDeg:l,spanDeg:h,size:s,borderRadius:u});if(e)return e}const p=Math.PI*(c-90)/180,g=t.centerX+s*Math.cos(d),f=t.centerY+s*Math.sin(d),m=t.centerX+s*Math.cos(p),x=t.centerY+s*Math.sin(p),b=Zt.polarToCartesian(t.centerX,t.centerY,t.donutSize,c),y=Zt.polarToCartesian(t.centerX,t.centerY,t.donutSize,l),v=h>180?1:0,w=["M",g,f,"A",s,s,0,v,1,m,x];return a="donut"===t.chartType?[...w,"L",b.x,b.y,"A",t.donutSize,t.donutSize,0,v,0,y.x,y.y,"L",g,f,"z"].join(" "):"pie"===t.chartType||"polarArea"===t.chartType?[...w,"L",t.centerX,t.centerY,"L",g,f].join(" "):[...w].join(" "),n.roundPathCorners(a,2*this.strokeWidth)}getRoundedSlicePath({me:t,startDeg:e,spanDeg:i,size:s,borderRadius:a}){if(!(i>0))return null;const r=Math.PI/180,n=t.centerX,o=t.centerY,l="donut"===t.chartType,h=s,c=l?t.donutSize:0,d=i*r;let u=a;if(u=Math.min(u,d*h/2),l?(u=Math.min(u,d*c/2),u=Math.min(u,(h-c)/2)):u=Math.min(u,h/2),!(u>.5))return null;const p=e,g=e+i;return l?vs({cx:n,cy:o,rIn:c,rOut:h,a0:p,a1:g,r:u,spanDeg:i}):function({cx:t,cy:e,rOut:i,a0:s,a1:a,r:r,spanDeg:n}){const o=(i,s)=>bs(t,e,i,s),l=r/i*xs,h=o(i,s+l),c=o(i,a-l),d=n-2*l>180?1:0,u=o(i,a),p=o(i-r,a),g=o(i,s),f=o(i-r,s);return["M",ys(h),"A",i,i,0,d,1,ys(c),"Q",ys(u),ys(p),"L",`${t} ${e}`,"L",ys(f),"Q",ys(g),ys(h),"Z"].join(" ")}({cx:n,cy:o,rOut:h,a0:p,a1:g,r:u,spanDeg:i})}drawPolarElements(t){const e=this.w,i=new $(this.w),s=new R(this.w),a=new fs(this.w),r=s.group(),n=s.group(),o=i.niceScale(0,Math.ceil(this.maxY),0),l=o.result.reverse(),h=o.result.length;this.maxY=o.niceMax;let c=e.globals.radialSize;const d=c/(h-1);for(let t=0;t<h-1;t++){const i=s.drawCircle(c);if(i.attr({cx:this.centerX,cy:this.centerY,fill:"none","stroke-width":e.config.plotOptions.polarArea.rings.strokeWidth,stroke:e.config.plotOptions.polarArea.rings.strokeColor}),e.config.yaxis[0].show){const i=a.drawYAxisTexts(this.centerX,this.centerY-c+parseInt(e.config.yaxis[0].labels.style.fontSize,10)/2,t,l[t]);n.add(i)}r.add(i),c-=d}this.drawSpokes(t),t.add(r),t.add(n)}renderInnerDataLabels(t,e,i){const s=this.w,a=new R(this.w),r=e.total.show;t.node.innerHTML="",t.node.style.opacity=i.opacity;const n=i.centerX,o=i.centerY,l=e.name.show&&!!this.donutDataLabels.total.label;let h,c;h=void 0===e.name.color?s.globals.colors[0]:e.name.color;let d=e.name.fontSize,u=e.name.fontFamily,p=e.name.fontWeight;c=void 0===e.value.color?s.config.chart.foreColor:e.value.color;const g=e.value.formatter;let f="",m="";if(r?(h=e.total.color,d=e.total.fontSize,u=e.total.fontFamily,p=e.total.fontWeight,m=this.donutDataLabels.total.label?e.total.label:"",f=e.total.formatter(s)):1===s.seriesData.series.length&&(f=g(s.seriesData.series[0],s),m=s.seriesData.seriesNames[0]),m&&(m=e.name.formatter(m,e.total.show,s)),e.name.show){const i=a.drawText({x:n,y:o+parseFloat(e.name.offsetY),text:m,textAnchor:"middle",foreColor:h,fontSize:d,fontWeight:p,fontFamily:u});i.node.classList.add("apexcharts-datalabel-label"),t.add(i)}if(e.value.show){const i=l?parseFloat(e.value.offsetY)+16:e.value.offsetY,s=a.drawText({x:n,y:o+i,text:f,textAnchor:"middle",foreColor:c,fontWeight:e.value.fontWeight,fontSize:e.value.fontSize,fontFamily:e.value.fontFamily});s.node.classList.add("apexcharts-datalabel-value"),t.add(s)}return t}printInnerLabels(t,e,i,s){const a=this.w;let r;s?r=void 0===t.name.color?a.globals.colors[parseInt(s.parentNode.getAttribute("rel"),10)-1]:t.name.color:a.seriesData.series.length>1&&t.total.show&&(r=t.total.color);const n=a.dom.baseEl.querySelector(".apexcharts-datalabel-label"),o=a.dom.baseEl.querySelector(".apexcharts-datalabel-value");i=(0,t.value.formatter)(i,a),s||"function"!=typeof t.total.formatter||(i=t.total.formatter(a));const l=e===t.total.label;if(e=this.donutDataLabels.total.label?t.name.formatter(e,l,a):"",null!==n&&(n.textContent=e),null!==o&&(o.textContent=i),null!==n){n.style.fill=r}}printDataLabelsInner(t,e){const i=this.w,s=t.getAttribute("data:value"),a=i.seriesData.seriesNames[parseInt(t.parentNode.getAttribute("rel"),10)-1];i.seriesData.series.length>1&&this.printInnerLabels(e,a,s,t);const r=i.dom.baseEl.querySelector(".apexcharts-datalabels-group");if(null!==r){r.style.opacity="1"}}drawSpokes(t){const e=this.w,i=new R(this.w),s=e.config.plotOptions.polarArea.spokes;if(0===s.strokeWidth)return;const a=e.globals.collapsedSeriesIndices||[],r=e.seriesData.series.length,n=360/Math.max(1,r-a.filter(t=>t<r).length);let o=0;for(let l=0;l<r;l++){if(a.indexOf(l)>-1)continue;const r=Zt.polarToCartesian(this.centerX,this.centerY,e.globals.radialSize,e.config.plotOptions.pie.startAngle+n*o++),h=i.drawLine(r.x,r.y,this.centerX,this.centerY,Array.isArray(s.connectorColors)?s.connectorColors[l]:s.connectorColors);t.add(h)}}revertDataLabelsInner(){const t=this.w;if(this.donutDataLabels.show){const e=t.dom.Paper.findOne(".apexcharts-datalabels-group"),i=this.renderInnerDataLabels(e,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:this.donutDataLabels.show});t.dom.Paper.findOne(".apexcharts-radialbar, .apexcharts-pie").add(i)}}}function _s(t,e,i,s){const a=s*s,r=i*i;return Math.max(a*e/r,r/(a*t))}function As(t,e,i,s,a,r){if(0===t)return!0;return _s(e,i,s,r)>=_s(Math.min(e,a),Math.max(i,a),s+a,r)}function Ss(t,e,i,s,a,r,n,o){if(n>=o){const n=s/o;let l=r;for(let s=0;s<i;s++){const i=e[s]/n;t.push([a,l,a+n,l+i]),l+=i}}else{const o=s/n;let l=a;for(let s=0;s<i;s++){const i=e[s]/o;t.push([l,r,l+i,r+o]),l+=i}}}function Cs(t){const e=t.children;if(e&&e.length){let i=0;for(let t=0;t<e.length;t++)i+=Cs(e[t]);return t._area=i,i}const i=Number(t.value),s=isNaN(i)?0:Math.abs(i);return t._area=s,s}function ks(t,e,i,s,a,r,n,o){const l=t.length;if(0===l||s<=0||a<=0)return;const h=new Array(l);let c=0;for(let e=0;e<l;e++)h[e]=t[e]._area,c+=h[e];if(c<=0)return;const d=function(t,e,i,s,a){const r=[],n=t.length;if(0===n)return r;const o=new Array(n);let l=0,h=0,c=1/0,d=-1/0,u=0;for(;u<n;){const n=Math.min(s,a),p=t[u];if(As(l,c,d,h,p,n))o[l]=p,l++,h+=p,p<c&&(c=p),p>d&&(d=p),u++;else{if(Ss(r,o,l,h,e,i,s,a),s>=a){const t=h/a;e+=t,s-=t}else{const t=h/s;i+=t,a-=t}l=0,h=0,c=1/0,d=-1/0}}return l>0&&Ss(r,o,l,h,e,i,s,a),r}(function(t,e){let i=0;for(let e=0;e<t.length;e++)i+=t[e];const s=e/i,a=new Array(t.length);for(let e=0;e<t.length;e++)a[e]=t[e]*s;return a}(h,s*a),e,i,s,a);for(let e=0;e<l;e++){const i=t[e],s=d[e];if(!s)continue;i.rect=s,i.depth=r;const a=i.children;if(!a||!a.length)continue;const l=s[2]-s[0],h=s[3]-s[1];let c=Math.max(0,n(i,r,l,h)||0);(2*c>=l||2*c>=h)&&(c=0);let u=Math.max(0,o(i,r,l,h)||0);u>0&&h-2*c-u<u&&(u=0),i.headerHeight=u,ks(a,s[0]+c,s[1]+u+c,l-2*c,h-u-2*c,r+1,n,o)}}const Ps={generateNested:function(t,e,i,s={}){if(!Array.isArray(t)||0===t.length)return t||[];const a=s.padding||(()=>0),r=s.header||(()=>0);for(let e=0;e<t.length;e++)Cs(t[e]);return ks(t,0,0,e,i,0,a,r),t}};function Ls(t,e){var i;const s=String(t).replace(/\//g,"%2F"),a=(null!=(i=e.get(s))?i:-1)+1;return e.set(s,a),`${a}:${s}`}function Ms(t,e,i,s,a,r=null,n={},o=new Map){var l,h,c;const d=e&&"object"==typeof e,u=d&&null!=(h=null!=(l=e.x)?l:e.name)?h:"",p=d?null!=(c=e.y)?c:e.value:e,g=null==p||""===p?NaN:Number(p),f={name:String(u),value:isNaN(g)?null:g,color:d&&e.color?e.color:void 0,_key:`${a}/${Ls(u,o)}`};s&&!f.color&&(f.color=s[i%s.length]),n.keepDatum&&(f._datum=e);const m=new Map;if(d&&Array.isArray(e.children)&&e.children.length)f.children=e.children.map((e,i)=>Ms(t,e,i,null,f._key,r,n,m));else if(d&&null!=e.drilldown&&!1!==n.expandDrilldown){const i=r||new Set;if(!i.has(e.drilldown)){const s=function(t,e){const i=t.config.drilldown;return(i&&Array.isArray(i.series)?i.series:[]).find(t=>t&&t.id===e)}(t,e.drilldown);if(s&&Array.isArray(s.data)&&s.data.length){const a=new Set(i);a.add(e.drilldown);const r=Array.isArray(s.colors)?s.colors:null;f.children=s.data.map((e,i)=>Ms(t,e,i,r,f._key,a,n,m))}}}return f}function Is(t){t.children&&t.children.length&&(t.children.forEach(t=>Is(t)),(null==t.value||isNaN(t.value))&&(t.value=t.children.reduce((t,e)=>t+Math.max(0,e.value||0),0))),(null==t.value||isNaN(t.value))&&(t.value=0)}function Es(t){if("string"!=typeof t)return"";const e=t.indexOf("/");return-1===e?"":t.slice(e)}function Fs(t){const e=t.globals.treemapRoots;if(e&&e.length)return{roots:e,maxDepth:t.globals.treemapMaxDepth||1};const i=function(t,e,i={}){const s=e||t.config.series;if(!Array.isArray(s))return[];const a=new Map;return s.map((e,s)=>{var r,n;const o=e&&Array.isArray(e.data)?e.data:[],l=Ls(null!=(r=null==e?void 0:e.name)?r:"",a),h=new Map;return{name:String(null!=(n=null==e?void 0:e.name)?n:""),value:null,color:(null==e?void 0:e.color)||void 0,_key:l,_seriesIndex:s,children:o.map((e,s)=>Ms(t,e,s,null,l,null,i,h))}})}(t,t.config.series,{keepDatum:!0,expandDrilldown:!1});i.forEach(Is);const{maxDepth:s}=function(t){const e=[];let i=0;return t.forEach((t,s)=>{const a=[],r=(t,e,n)=>{t._parent=n,t._depth=e,t._si=s,t._leaf=!(t.children&&t.children.length),e>i&&(i=e),t._leaf?(t._di=a.length,a.push(t)):(t._di=-1,t.children.forEach(i=>r(i,e+1,t)))};r(t,0,null),e.push(a)}),{leaves:e,maxDepth:i}}(i);return{roots:i,maxDepth:s}}const Ds="http://www.w3.org/1999/xhtml";function Ts(t,e){const i=t.config.drilldown&&t.config.drilldown.breadcrumb||{};return Object.assign({show:!0,position:"top-left",separator:" / ",rootLabel:"All",offsetX:0,offsetY:0,formatter:void 0},i,e)}function Rs(t){const e=t.dom.elWrap;if(!e)return;const i=e.querySelector(".apexcharts-breadcrumb");i&&i.parentNode&&i.parentNode.removeChild(i)}const zs=t=>"string"==typeof t&&/^(#|rgb)/i.test(t);function Xs(t,e,i,s){return zs(i)&&zs(s)&&i!==s?[l(o({},t),{fill:i}),l(o({},e),{fill:s})]:[t,e]}const Os=t=>{var e;const i=t.config.plotOptions.treemap.parents.show;return!0===i||!1!==i&&!!(null==(e=t.globals.treemapRoots)?void 0:e.length)},$s=t=>W.treemapHeaderLook(t);c.default.use({line:gs,area:gs,scatter:gs,bubble:gs,rangeArea:gs,bar:Ki,column:Ki,barStacked:class extends Ki{draw(t,e){const i=this.w;this.graphics=new R(this.w);const s=new P(this.w);t=s.getLogSeries(t),this.yRatio=s.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t,e),"100%"===i.config.chart.stackType&&(t=i.globals.comboCharts?e.map(t=>i.globals.seriesPercent[t]):i.globals.seriesPercent.slice()),this.series=t,this.barHelpers.initializeStackedPrevVars(this);const a=this.graphics.group({class:"apexcharts-bar-series apexcharts-plot-series"}),r=this.ctx.highlightFilter;let n=0,h=0;const c=i.config.chart.animations,d=c.enabled&&c.dynamicAnimation.enabled&&i.globals.previousPaths.length>0;let u=!1;for(let s=0,c=0;s<t.length;s++,c++){const p=i.globals.comboCharts?e[s]:s,{groupIndex:g,columnGroupIndex:f}=this.barHelpers.getGroupIndex(p);this.groupCtx=this.stacks[g];const m=[],x=[],b=this.setSeriesAxis(p);let y=this.graphics.group({class:"apexcharts-series",seriesName:Zt.escapeString(i.seriesData.seriesNames[p]),rel:s+1,"data:realIndex":p});W.addCollapsedClassToSeries(this.w,y,p);const v=this.graphics.group({class:"apexcharts-datalabels","data:realIndex":p});W.addCollapsedClassToSeries(this.w,v,p),(i.globals.collapsingSeriesIndices||[]).indexOf(p)>-1&&v.node.style.setProperty("--apexcharts-dl-exit",`${i.config.chart.animations.dynamicAnimation.speed}ms`);const w=this.graphics.group({class:"apexcharts-bar-goals-markers"}),_=this.initialPositions(n,h,void 0,void 0,void 0,void 0,b),{xDivision:A,yDivision:S,zeroH:C,zeroW:k}=_;let P=_.barHeight,L=_.barWidth;h=_.y,n=_.x,i.globals.barHeight=P,i.globals.barWidth=L,this.barHelpers.initializeStackedXYVars(this),1===this.groupCtx.prevY.length&&this.groupCtx.prevY[0].every(t=>isNaN(t))&&(this.groupCtx.prevY[0]=this.groupCtx.prevY[0].map(()=>C),this.groupCtx.prevYF[0]=this.groupCtx.prevYF[0].map(()=>0));for(let e=0;e<i.globals.dataPoints;e++){const a=this.barHelpers.getStrokeWidth(s,e,p),g={indexes:{i:s,j:e,realIndex:p,translationsIndex:b,bc:c},strokeWidth:a,x:n,y:h,elSeries:y,columnGroupIndex:f};let M=null;this.isHorizontal?(M=this.drawStackedBarPaths(l(o(o({},g),this.barHelpers.rows&&{y:_.y+this.barHelpers.barRow(p,e)*S}),{zeroW:k,barHeight:P,yDivision:S})),L=this.series[s][e]/this.invertedYRatio):(M=this.drawStackedColumnPaths(l(o({},g),{xDivision:A,barWidth:L,zeroH:C})),P=this.series[s][e]/this.yRatio[b]);const I=this.barHelpers.drawGoalLine({barXPosition:M.barXPosition,barYPosition:M.barYPosition,goalX:M.goalX,goalY:M.goalY,barHeight:P,barWidth:L});I&&w.add(I),h=M.y,n=M.x,m.push(n),x.push(h);const E=this.barHelpers.getPathFillColor(t,s,e,p);let F="";const D=i.globals.isBarHorizontal?"apexcharts-flip-x":"apexcharts-flip-y",T=this.cornerFlip(this.barHelpers.arrBorderRadius[p][e],i.seriesData.series[p][e]),R=d&&!T&&this.getPreviousFlip(p,e);(T||R)&&(F=D),R&&(F+=" apexcharts-flip-held",u=!0),y=this.renderSeries(l(o({hl:null==r?void 0:r.bar(this,{i:s,j:e,realIndex:p,translationsIndex:b,paths:M,zeroH:C,zeroW:k}),realIndex:p,pathFill:E.color},E.useRangeColor?{lineFill:E.color}:{}),{j:e,i:s,columnGroupIndex:f,pathFrom:M.pathFrom,pathTo:M.pathTo,strokeWidth:a,elSeries:y,x:n,y:h,series:t,barHeight:P,barWidth:L,barXPosition:M.barXPosition,elDataLabelsWrap:v,elGoalsMarkers:w,type:"bar",visibleSeries:f,classes:F}))}i.globals.seriesXvalues[p]=m,i.globals.seriesYvalues[p]=x,this.groupCtx.prevY.push(this.groupCtx.yArrj),this.groupCtx.prevYF.push(this.groupCtx.yArrjF),this.groupCtx.prevYVal.push(this.groupCtx.yArrjVal),this.groupCtx.prevX.push(this.groupCtx.xArrj),this.groupCtx.prevXF.push(this.groupCtx.xArrjF),this.groupCtx.prevXVal.push(this.groupCtx.xArrjVal),a.add(y)}return u&&this.settleHeldMirrors(a),a}cornerFlip(t,e){return"bottom"===t&&e>0||"top"===t&&e<0}settleHeldMirrors(t){const e=this.w;if(!Nt.isBrowser())return;const i=e.config.chart.animations,s=(i.dynamicAnimation.speed||0)+(i.speed||0)+100,a=(t?t.node:e.dom.baseEl).querySelectorAll(".apexcharts-flip-held");setTimeout(()=>{a.forEach(t=>{t.classList.remove("apexcharts-flip-held","apexcharts-flip-y","apexcharts-flip-x")})},s)}initialPositions(t,e,i,s,a,r,n){const o=this.w;let l,h;if(this.isHorizontal){s=o.layout.gridHeight/o.globals.dataPoints;const t=o.config.plotOptions.bar.barHeight;l=-1===String(t).indexOf("%")?parseInt(t,10):s*parseInt(t,10)/100,r=o.globals.padHorizontal+(this.isReversed?o.layout.gridWidth-this.baseLineInvertedY:this.baseLineInvertedY),e=(s-l)/2}else{h=i=o.layout.gridWidth/o.globals.dataPoints;const e=o.config.plotOptions.bar.columnWidth,s=o.axisFlags.isXNumeric?this.barHelpers.barSlotXSpan():0;s>0?h=(i=s/this.xRatio)*parseInt(this.barOptions.columnWidth,10)/100:h*=parseInt(e,10)/100,-1===String(e).indexOf("%")&&(h=parseInt(e,10)),a=this.isReversed?this.baseLineY[n]:o.layout.gridHeight-this.baseLineY[n],t=o.globals.padHorizontal+(i-h)/2}const c=o.globals.barGroups.length||1;return{x:t,y:e,yDivision:s,xDivision:i,barHeight:(null!=l?l:0)/c,barWidth:(null!=h?h:0)/c,zeroH:a,zeroW:r}}drawStackedBarPaths({indexes:t,barHeight:e,strokeWidth:i,zeroW:s,x:a,y:r,columnGroupIndex:n,yDivision:o,elSeries:l}){var h,c;const d=this.w,u=r+n*e;let p;const g=t.i,f=t.j,m=t.realIndex,x=t.translationsIndex,b=null!=(c=null==(h=this.series[g])?void 0:h[f])?c:null,y=this.groupCtx,v=d.axisFlags.isXNumeric?d.seriesData.seriesX[m][f]:f,w=y.tops.get(v);if(w){const[t,e,i]=w,s=2*(this.isReversed?i:0);p=e<0?b>=0?t+i-s:t:b>=0?t:t-i+s}else p=s;a=p+b/this.invertedYRatio*(this.isReversed?-1:1);const _=this.barHelpers.getBarpaths({barYPosition:u,barHeight:e,x1:p,x2:a,strokeWidth:i,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:g,j:f,w:d});return this._setTop(v,w,y.xArrj[f],y.xArrjVal[f],y.xArrjF[f],m,f),this.barHelpers.barBackground({j:f,i:g,y1:u,y2:e,elSeries:l}),r+=o,{pathTo:_.pathTo,pathFrom:_.pathFrom,goalX:this.barHelpers.getGoalValues("x",s,null,m,f,x),barXPosition:p,barYPosition:u,x:a,y:r}}drawStackedColumnPaths({indexes:t,x:e,y:i,xDivision:s,barWidth:a,zeroH:r,columnGroupIndex:n,strokeWidth:o,elSeries:l}){var h,c,d;const u=this.w,p=t.i,g=t.j,f=t.bc,m=t.realIndex,x=t.translationsIndex,b=null!=(c=null==(h=this.series[p])?void 0:h[g])?c:null;if(u.axisFlags.isXNumeric){let t=u.seriesData.seriesX[m][g];t||(t=0),e=(t-u.globals.minX)/this.xRatio-a/2*u.globals.barGroups.length}const y=e+n*a;let v;const w=this.groupCtx,_=u.axisFlags.isXNumeric?u.seriesData.seriesX[m][g]:g,A=w.tops.get(_);if(A){const[t,e,i]=A;let s;e<0?s=b>=0?t-i+2*(this.isReversed?i:0):t:e>=0&&(s=b>=0?t:t+i-2*(this.isReversed?i:0)),void 0===s&&(s=u.layout.gridHeight),v=(null==(d=w.prevYF[0])?void 0:d.every(t=>0===t))&&w.prevYF.slice(1).every(t=>t.every(t=>isNaN(t)))?r:s}else v=r;i=v-b/this.yRatio[x]*(this.isReversed?-1:1);const S=this.barHelpers.getColumnPaths({barXPosition:y,barWidth:a,y1:v,y2:i,yRatio:this.yRatio[x],strokeWidth:o,insetWidth:u.config.stroke.show?this.strokeWidth:0,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:p,j:g,w:u});return this._setTop(_,A,w.yArrj[g],w.yArrjVal[g],w.yArrjF[g],m,g),this.barHelpers.barBackground({bc:f,j:g,i:p,x1:y,x2:a,elSeries:l}),{pathTo:S.pathTo,pathFrom:S.pathFrom,goalY:this.barHelpers.getGoalValues("y",null,r,m,g,x),barXPosition:y,x:u.axisFlags.isXNumeric?e:e+s,y:i}}_setTop(t,e,i,s,a,r,n){isNaN(i)||this.groupCtx.tops.set(t,[i,s,(e?e[2]:0)+a,(e?e[3]:0)+(this.w.seriesData.series[r][n]||0),e?Math.min(e[0],e[4]):1/0,e?Math.max(e[0],e[5]):-1/0])}},rangeBar:class extends Ki{draw(t,e){var i,s,a,r,n,l;const h=this.w,c=new R(this.w);this.rangeBarOptions=this.w.config.plotOptions.rangeBar,this.series=t,this.seriesRangeStart=h.rangeData.seriesRangeStart,this.seriesRangeEnd=h.rangeData.seriesRangeEnd,this.barHelpers.initVariables(t,e);const d=c.group({class:"apexcharts-rangebar-series apexcharts-plot-series"});for(let u=0;u<t.length;u++){let p,g;const f=h.globals.comboCharts?e[u]:u,{columnGroupIndex:m}=this.barHelpers.getGroupIndex(f),x=c.group({class:"apexcharts-series",seriesName:Zt.escapeString(h.seriesData.seriesNames[f]),rel:u+1,"data:realIndex":f});W.addCollapsedClassToSeries(this.w,x,f),t[u].length>0&&(this.visibleI=this.visibleI+1);const b=this.setSeriesAxis(f);this.isHorizontal&&h.labelData.timescaleLabels.length&&(this.isReversed=!1);const y=this.barHelpers.initialPositions(f),{y:v,zeroW:w,x:_,zeroH:A}=y,S=null!=(i=y.yDivision)?i:0,C=null!=(s=y.xDivision)?s:0;g=v,p=_;const k=c.group({class:"apexcharts-datalabels","data:realIndex":f}),P=c.group({class:"apexcharts-rangebar-goals-markers"}),L=h.config.series[f].data;for(let e=0;e<h.globals.dataPoints;e++){const i=this.barHelpers.getStrokeWidth(u,e,f);let s=null!=(a=y.barWidth)?a:0,c=null!=(r=y.barHeight)?r:0;const d=this.seriesRangeStart[f][e],v=this.seriesRangeEnd[f][e];let _=null,M=null,I=null;const E={x:p,y:g,strokeWidth:i,elSeries:x};let F=this.seriesLen;if(h.config.plotOptions.bar.rangeBarGroupRows&&(F=1),void 0===(null==L?void 0:L[e]))break;if(this.isHorizontal){I=g+c*this.visibleI;const t=(S-c*F)/2;if(null!=(null==(n=L[e])?void 0:n.x)){const i=this.detectOverlappingBars({i:f,j:e,barYPosition:I,srty:t,barHeight:c,yDivision:S,initPositions:y});c=i.barHeight,I=i.barYPosition}_=this.drawRangeBarPaths(o({indexes:{i:u,j:e,realIndex:f},barHeight:c,barYPosition:I,zeroW:w,yDivision:S,y1:d,y2:v},E)),s=_.barWidth}else{h.axisFlags.isXNumeric&&(p=(h.seriesData.seriesX[f][e]-h.globals.minX)/this.xRatio-s/2),M=p+s*this.visibleI;const t=(C-s*F)/2;if(null!=(null==(l=L[e])?void 0:l.x)){const i=this.detectOverlappingBars({i:f,j:e,barXPosition:M,srtx:t,barWidth:s,xDivision:C,initPositions:y});s=i.barWidth,M=i.barXPosition}_=this.drawRangeColumnPaths(o({indexes:{i:u,j:e,realIndex:f,translationsIndex:b},barWidth:s,barXPosition:M,zeroH:A,xDivision:C},E)),c=_.barHeight,M=_.barXPosition}const D=this.barHelpers.drawGoalLine({barXPosition:M,barYPosition:I,goalX:_.goalX,goalY:_.goalY,barHeight:c,barWidth:s});D&&P.add(D),g=_.y,p=_.x;const T=this.barHelpers.getPathFillColor(t,u,e,f);this.renderSeries({realIndex:f,pathFill:T.color,lineFill:T.useRangeColor?T.color:h.globals.stroke.colors[f],j:e,i:u,x:p,y:g,y1:d,y2:v,pathFrom:_.pathFrom,pathTo:_.pathTo,strokeWidth:i,elSeries:x,series:t,barHeight:c,barWidth:s,barXPosition:M,barYPosition:I,columnGroupIndex:m,elDataLabelsWrap:k,elGoalsMarkers:P,visibleSeries:this.visibleI,type:"rangebar"})}h.globals.previousPaths.length>0&&qi({w:h,elSeries:x,record:this._prevRecord(f),newKeys:this._keys(f),isHorizontal:this.isHorizontal,speed:h.config.chart.animations.dynamicAnimation.speed}),d.add(x)}return d}detectOverlappingBars({i:t,j:e,barYPosition:i,barXPosition:s,srty:a,srtx:r,barHeight:n,barWidth:o,yDivision:l,xDivision:h,initPositions:c}){var d,u,p,g;const f=this.w;let m=[];const x=null==(u=null==(d=f.globals.seriesRangeName)?void 0:d[t])?void 0:u[e],b=null==(g=null==(p=f.config.series[t].data)?void 0:p[e])?void 0:g.x,y=Array.isArray(b)?b.join(" "):b,v=this;v._rowKeys||(v._rowKeys=f.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t));const w=v._rowKeys.indexOf(y),_=f.config.plotOptions.bar.rangeBarOverlap?-1:f.rangeData.seriesRange[t].findIndex(t=>{var e;return t.x===y&&(null==(e=t.overlaps)?void 0:e.size)>0});return this.isHorizontal?(i=f.config.plotOptions.bar.rangeBarGroupRows?a+l*w:a+n*this.visibleI+l*w,_>-1&&(m=Array.from(f.rangeData.seriesRange[t][_].overlaps),m.indexOf(x)>-1&&(i+=(n=c.barHeight/m.length)*m.indexOf(x)))):(w>-1&&!f.axisFlags.isXNumeric&&(s=f.config.plotOptions.bar.rangeBarGroupRows?r+h*w:r+o*this.visibleI+h*w),_>-1&&(m=Array.from(f.rangeData.seriesRange[t][_].overlaps),m.indexOf(x)>-1&&(s+=(o=c.barWidth/m.length)*m.indexOf(x)))),{barYPosition:i,barXPosition:s,barHeight:n,barWidth:o}}drawRangeColumnPaths({indexes:t,x:e,xDivision:i,barWidth:s,barXPosition:a,zeroH:r}){var n,o;const l=this.w,{i:h,j:c,realIndex:d,translationsIndex:u}=t,p=this.yRatio[u]*(this.isReversed?-1:1),g=this.getRangeValue(d,c);let f=Math.min(g.start,g.end),m=Math.max(g.start,g.end);const x=!(void 0===(null==(n=this.series[h])?void 0:n[c])||null===(null==(o=this.series[h])?void 0:o[c]));x?(f=r-f/p,m=r-m/p):f=m=r;const b=Math.abs(m-f),y=this.barHelpers.getColumnPaths({barXPosition:a,barWidth:s,y1:f,y2:m,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,realIndex:d,i:d,j:c,w:l});if(x){const t=y.drawnBox,e=g.end>=g.start;this.recordColumnGeometry(d,c,{slotStart:t.x1,slotEnd:t.x2,levelStart:e?t.y1:t.y2,levelEnd:e?t.y2:t.y1,horizontal:!1})}if(l.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:c,realIndex:d,barWidth:s});e=t.x,a=t.barXPosition}else e+=i;return{pathTo:y.pathTo,pathFrom:y.pathFrom,barHeight:b,x:e,y:g.start<0&&g.end<0?f:m,goalY:this.barHelpers.getGoalValues("y",null,r,d,c,u),barXPosition:a}}_keys(t){const e=this._keyCache||(this._keyCache={}),i=this.w.config.series[t].data;return e[t]||(e[t]=Oi((i||[]).map((t,e)=>{var i;return"c:"+(null!=(i=null==t?void 0:t.x)?i:e)})))}preventBarOverflow(t){const e=this.w;return t<0&&(t=0),t>e.layout.gridWidth&&(t=e.layout.gridWidth),t}drawRangeBarPaths({indexes:t,y:e,y1:i,y2:s,yDivision:a,barHeight:r,barYPosition:n,zeroW:o}){const l=this.w,{realIndex:h,j:c}=t,d=this.invertedYRatio*(this.isReversed?-1:1),u=this.preventBarOverflow(o+i/d),p=this.preventBarOverflow(o+s/d),g=this.getRangeValue(h,c),f=Math.abs(p-u),m=this.barHelpers.getBarpaths({barYPosition:n,barHeight:r,x1:u,x2:p,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,i:h,realIndex:h,j:c,w:l});if(null!=g.start&&null!=g.end){const t=m.drawnBox;this.recordColumnGeometry(h,c,{slotStart:t.y1,slotEnd:t.y2,levelStart:t.x1,levelEnd:t.x2,horizontal:!0})}return l.axisFlags.isXNumeric||(e+=a),{pathTo:m.pathTo,pathFrom:m.pathFrom,barWidth:f,x:g.start<0&&g.end<0?u:p,goalX:this.barHelpers.getGoalValues("x",o,null,h,c,0),y:e}}recordColumnGeometry(t,e,i){const s=this.w.waterfallData&&this.w.waterfallData.geometry;s&&isFinite(i.slotStart)&&isFinite(i.levelEnd)&&(s[t]||(s[t]=[]),s[t][e]=i)}getRangeValue(t,e){const i=this.w;return{start:i.rangeData.seriesRangeStart[t][e],end:i.rangeData.seriesRangeEnd[t][e]}}},candlestick:rs,boxPlot:rs,pie:ws,donut:ws,polarArea:ws,radialBar:class extends ws{constructor(t,e){super(t,e),this.ctx=e,this.w=t,this.animBeginArr=[0],this.startAngle=t.config.plotOptions.radialBar.startAngle,this.endAngle=t.config.plotOptions.radialBar.endAngle,this.totalAngle=Math.abs(t.config.plotOptions.radialBar.endAngle-t.config.plotOptions.radialBar.startAngle),this.trackStartAngle=t.config.plotOptions.radialBar.track.startAngle,this.trackEndAngle=t.config.plotOptions.radialBar.track.endAngle,this.barLabels=this.w.config.plotOptions.radialBar.barLabels,this.donutDataLabels=this.w.config.plotOptions.radialBar.dataLabels,this.radialDataLabels=this.donutDataLabels,this.trackStartAngle||(this.trackStartAngle=this.startAngle),this.trackEndAngle||(this.trackEndAngle=this.endAngle),360===this.endAngle&&(this.endAngle=359.99),this.margin=parseInt(t.config.plotOptions.radialBar.track.margin,10),this.onBarLabelClick=this.onBarLabelClick.bind(this)}draw(t){var e;const i=this.w,s=new R(this.w),a=s.group({class:"apexcharts-radialbar"});if(i.globals.noData)return a;const r=s.group(),n=i.layout.gridHeight/2,h=i.layout.gridWidth/2;let c=this.defaultSize/2.05;i.config.chart.sparkline.enabled||(c=c-i.config.stroke.width-i.config.chart.dropShadow.blur),i.globals.circleGeometry={node:a.node,cx:h,cy:n,r:c};const d=i.globals.fill.colors,u=i.config.plotOptions.radialBar,p=Array.isArray(u.bands)&&u.bands.length>0,g=p&&u.bandsStyle&&u.bandsStyle.hideTrackWhenPresent,f="needle"===u.shape,m=this.radialDataLabels;if(null==m.value.offsetY){const e=this.needlePath({size:c,centerX:h,centerY:n,series:t},u.needle||{});this.donutDataLabels=this.radialDataLabels=l(o({},m),{value:l(o({},m.value),{offsetY:f?e.cy-n+Math.max(e.baseW/2,Zt.polarToCartesian(0,0,e.length,this.startAngle).y,Zt.polarToCartesian(0,0,e.length,this.endAngle).y)+parseFloat(m.value.fontSize)+4:8})})}if(u.track.show&&!g){const e=this.drawTracks({size:c,centerX:h,centerY:n,colorArr:d,series:t});r.add(e)}if(p){const e=this.drawBands({size:c,centerX:h,centerY:n,series:t});r.add(e)}const x=this.drawArcs({size:c,centerX:h,centerY:n,colorArr:d,series:t,skipValueArc:f&&!(null==(e=u.needle)?void 0:e.showValueArc)});if(u.ticks&&u.ticks.show){const e=this.drawTicks({size:c,centerX:h,centerY:n,series:t});if(this.initialAnim&&!i.globals.dataChanged&&!i.globals.resized&&Nt.isBrowser()&&i.globals.shouldAnimate){const s=e.node;s.style.opacity="0",s.style.transition="opacity 280ms ease-out";const a=f&&this.needleMotion(),r=Math.max((this.animBeginArr[t.length-1]||0)+i.config.chart.animations.speed,a?a.speed:0);i.globals.radialTickTimer=setTimeout(()=>{i.globals.isDestroyed||(s.style.opacity="1")},r)}r.add(e)}if(f){const e=this.drawNeedle({size:c,centerX:h,centerY:n,series:t});r.add(e)}let b=360;i.config.plotOptions.radialBar.startAngle<0&&(b=this.totalAngle);const y=(360-b)/360;if(i.globals.radialSize=c-c*y,this.radialDataLabels.value.show){const t=Math.max(this.radialDataLabels.value.offsetY,this.radialDataLabels.name.offsetY);i.globals.radialSize+=t*y}return r.add(x.g),"front"===i.config.plotOptions.radialBar.hollow.position&&(x.g.add(x.elHollow),x.dataLabels&&x.g.add(x.dataLabels)),a.add(r),a}drawTracks(t){const e=this.w,i=new R(this.w),s=i.group({class:"apexcharts-tracks"}),a=new D(this.w),r=new F(this.w),n=this.getStrokeWidth(t);t.size=t.size-n/2;for(let o=0;o<t.series.length;o++){const l=i.group({class:"apexcharts-radialbar-track apexcharts-track"});s.add(l),l.attr({rel:o+1}),t.size=t.size-n-this.margin;const h=e.config.plotOptions.radialBar.track,c=r.fillPath({seriesNumber:0,size:t.size,fillColors:Array.isArray(h.background)?h.background[o]:h.background,solid:!0}),d=this.trackStartAngle;let u=this.trackEndAngle;Math.abs(u)+Math.abs(d)>=360&&(u=360-Math.abs(this.startAngle)-.1);const p=i.drawPath({d:"",stroke:c,strokeWidth:n*parseInt(h.strokeWidth,10)/100,fill:"none",strokeOpacity:h.opacity,classes:"apexcharts-radialbar-area"});if(h.dropShadow.enabled){const t=h.dropShadow;a.dropShadow(p,t)}l.add(p),p.attr("id","apexcharts-radialbarTrack-"+o),this.animatePaths(p,{centerX:t.centerX,centerY:t.centerY,endAngle:u,startAngle:d,size:t.size,i:o,animBeginArr:0,dur:0,isTrack:!0})}return s}drawArcs(t){var e,i;const s=this.w;null==(e=this.ctx.highlightFilter)||e.pie(this);const a=new R(this.w),r=new F(this.w),n=new D(this.w),o=a.group(),l=this.getStrokeWidth(t);t.size=t.size-l/2;let h=s.config.plotOptions.radialBar.hollow.background;const c=t.size-l*t.series.length-this.margin*t.series.length-l*parseInt(s.config.plotOptions.radialBar.track.strokeWidth,10)/100/2,d=c-s.config.plotOptions.radialBar.hollow.margin;void 0!==s.config.plotOptions.radialBar.hollow.image&&(h=this.drawHollowImage(t,o,c,h));const u=this.drawHollow({size:d,centerX:t.centerX,centerY:t.centerY,fill:h||"transparent"});if(s.config.plotOptions.radialBar.hollow.dropShadow.enabled){const t=s.config.plotOptions.radialBar.hollow.dropShadow;n.dropShadow(u,t)}let p=1;!this.radialDataLabels.total.show&&s.seriesData.series.length>1&&(p=0);let g=null;this.radialDataLabels.show&&(g=this.renderInnerDataLabels(this.dataLabelsGroup,this.radialDataLabels,{hollowSize:c,centerX:t.centerX,centerY:t.centerY,opacity:p})),"back"===s.config.plotOptions.radialBar.hollow.position&&(o.add(u),g&&o.add(g));let f=!1;s.config.plotOptions.radialBar.inverseOrder&&(f=!0);const m=!0===(null==(i=this.ctx.morphTypeChange)?void 0:i.isActive());for(let e=f?t.series.length-1:0;f?e>=0:e<t.series.length;f?e--:e++){const i=a.group({class:"apexcharts-series apexcharts-radial-series",seriesName:Zt.escapeString(s.seriesData.seriesNames[e])});o.add(i),i.attr({rel:e+1,"data:realIndex":e}),W.addCollapsedClassToSeries(this.w,i,e),t.size=t.size-l-this.margin;const h=r.fillPath({seriesNumber:e,size:t.size,value:t.series[e]}),c=this.startAngle;let d;const u=this._arcEnd(t.series[e]);let p;if(s.globals.dataChanged){d=this.startAngle;const t=s.globals.previousPaths[e];p=void 0===t?NaN:this._arcEnd(t)}const g=u-c,f=Ne(s,"stroke.dashArray",e,Array.isArray(s.config.stroke.dashArray)?s.config.stroke.dashArray[e]:s.config.stroke.dashArray),x=m?this.ctx.morphTypeChange.getInitialPathFor(e,0):null,b=m?this.ctx.morphTypeChange.getFromType():null,y=!!x&&("bar"===b||"funnel"===b||"pyramid"===b||"pie"===b||"donut"===b||"polarArea"===b),v=a.drawPath({d:x||"",stroke:y||t.skipValueArc?"transparent":h,strokeWidth:y||t.skipValueArc?0:l,fill:y?h:"none",fillOpacity:s.config.fill.opacity,classes:"apexcharts-radialbar-area apexcharts-radialbar-slice-"+e,strokeDashArray:f}),w=c+g/2,_=Zt.polarToCartesian(t.centerX,t.centerY,t.size,w);if(R.setAttrs(v.node,{"data:angle":g,"data:value":t.series[e],"data:cx":_.x,"data:cy":_.y}),s.config.chart.dropShadow.enabled){const t=s.config.chart.dropShadow;n.dropShadow(v,t,e)}if(n.setSelectionFilter(v,0,e),this.addListeners(v,this.radialDataLabels),i.add(v),v.attr({index:0,j:e}),this.barLabels.enabled){const r=Zt.polarToCartesian(t.centerX,t.centerY,t.size,c),n=this.barLabels.formatter(s.seriesData.seriesNames[e],{seriesIndex:e,w:s}),o=["apexcharts-radialbar-label"];this.barLabels.onClick||o.push("apexcharts-no-click");let l=this.barLabels.useSeriesColors?s.globals.colors[e]:s.config.chart.foreColor;l||(l=s.config.chart.foreColor);const h=r.x+this.barLabels.offsetX,d=r.y+this.barLabels.offsetY,u=a.drawText({x:h,y:d,text:n,textAnchor:"end",dominantBaseline:"middle",fontFamily:this.barLabels.fontFamily,fontWeight:this.barLabels.fontWeight,fontSize:this.barLabels.fontSize,foreColor:l,cssClass:o.join(" ")});u.on("click",this.onBarLabelClick),u.attr({rel:e+1}),0!==c&&u.attr({"transform-origin":`${h} ${d}`,transform:`rotate(${c} 0 0)`}),i.add(u)}let A=0;if(!this.initialAnim||s.globals.resized||s.globals.dataChanged||(A=s.config.chart.animations.speed),this.dynamicAnim&&s.globals.dataChanged&&s.globals.shouldAnimate&&(A=s.config.chart.animations.dynamicAnimation.speed),this.animBeginArr[e]=e*A/(1.2*t.series.length),m&&x){const e=this.ctx.morphTypeChange.getSpeed(),i=this.ctx.animations,s=this.getPiePath({me:this,startAngle:c,angle:g,size:t.size});if(y){const a=this.ctx.morphTypeChange.buildRingSegmentPath(t.centerX,t.centerY,t.size,l,c,c+g);v.animate(e).plot(a,"polygons").after(function(){this.attr({d:s,fill:"none",stroke:t.skipValueArc?"transparent":h,"stroke-width":t.skipValueArc?0:l}),i.animationCompleted(v)})}else v.animate(e).plot(s,"polygons").attr({"stroke-width":l}).after(()=>i.animationCompleted(v))}else this.animatePaths(v,{centerX:t.centerX,centerY:t.centerY,endAngle:u,startAngle:c,prevEndAngle:p,prevStartAngle:d,size:t.size,i:e,animBeginArr:this.animBeginArr,dur:A,shouldSetPrevPaths:!0})}return{g:o,elHollow:u,dataLabels:g}}_domain(){const t=this.w.config.plotOptions.radialBar,e="number"==typeof t.min?t.min:0,i="number"==typeof t.max?t.max:100;return[e,i===e?e+1:i]}_fraction(t){const[e,i]=this._domain(),s=Number(t);return Number.isFinite(s)?(Math.min(Math.max(s,e),i)-e)/(i-e):0}_arcEnd(t){const e=Math.round(this.totalAngle*this._fraction(t))+this.startAngle;return Math.abs(e)+Math.abs(this.startAngle)>360?e-.01:e}_angleAtValue(t){return this.startAngle+this._fraction(t)*Math.abs(this.endAngle-this.startAngle)}_describeArc(t,e,i,s,a){const r=Zt.polarToCartesian(t,e,i,a),n=Zt.polarToCartesian(t,e,i,s),o=a-s,l=Math.abs(o)>180?1:0;return`M ${r.x} ${r.y} A ${i} ${i} 0 ${l} 0 ${n.x} ${n.y}`}drawBands(t){const e=this.w,i=new R(this.w),s=e.config.plotOptions.radialBar,a=s.bands||[],r=i.group({class:"apexcharts-gauge-bands"}),n=this.getStrokeWidth(t),o=t.size-n/2-n-this.margin,l=n*parseInt(s.bandsStyle.strokeWidth,10)/100,h=o>0?Math.abs(s.bandsStyle.gap||0)/o*(180/Math.PI):0;for(let e=0;e<a.length;e++){const n=a[e];if(void 0===n.from||void 0===n.to)continue;const c=this._angleAtValue(n.from),d=this._angleAtValue(n.to),u=Math.min(c,d)+h/2,p=Math.max(c,d)-h/2;if(p-u<=0)continue;const g=i.drawPath({d:this._describeArc(t.centerX,t.centerY,o,u,p),stroke:n.color||"#ccc",strokeWidth:l,fill:"none",strokeLinecap:s.bandsStyle.linecap||"butt",classes:"apexcharts-gauge-band"});g.node.setAttribute("data-band-index",String(e)),r.add(g)}return r}drawTicks(t){var e,i,s,a;const r=this.w,n=new R(this.w),o=r.config.plotOptions.radialBar.ticks,l=n.group({class:"apexcharts-gauge-ticks"}),h=this.getStrokeWidth(t),c=t.size-h/2-h-this.margin,[d,u]=this._domain(),p=Math.max(2,null!=(i=null==(e=o.major)?void 0:e.count)?i:11),g=Math.max(0,null!=(a=null==(s=o.minor)?void 0:s.count)?a:0),f=(e,i,s)=>{var a,r,h;const d=this._angleAtValue(e),u=null!=(a=i.length)?a:8,p="inside"===i.placement?c-u:c,g="inside"===i.placement?c:c+u,f=Zt.polarToCartesian(t.centerX,t.centerY,p,d),m=Zt.polarToCartesian(t.centerX,t.centerY,g,d),x=n.drawLine(f.x,f.y,m.x,m.y,i.color||(s?"#666":"#999"),0,i.width||(s?2:1));if(l.add(x),s&&(null==(r=o.labels)?void 0:r.show)){const s=("inside"===i.placement?p:g)+("inside"===i.placement?-1:1)*(null!=(h=o.labels.offset)?h:6),a=Zt.polarToCartesian(t.centerX,t.centerY,s,d),r="function"==typeof o.labels.formatter?o.labels.formatter(e):String(e),c=n.drawText({x:a.x,y:a.y,text:r,textAnchor:"middle",dominantBaseline:"middle",fontFamily:o.labels.fontFamily,fontSize:o.labels.fontSize,fontWeight:o.labels.fontWeight,foreColor:o.labels.color,cssClass:"apexcharts-gauge-tick-label"});l.add(c)}};for(let t=0;t<p;t++){if(f(d+t/(p-1)*(u-d),o.major||{},!0),t<p-1&&g>0)for(let e=1;e<=g;e++){f(d+(t+e/(g+1))/(p-1)*(u-d),o.minor||{},!1)}}return l}drawNeedle(t){const e=this.w,i=new R(this.w),s=e.config.plotOptions.radialBar.needle||{},a=i.group({class:"apexcharts-gauge-needle"});if(!t.series||0===t.series.length)return a;const r=s.color||"#333",{path:n,cx:o,cy:l}=this.needlePath(t,s),h=i.drawPath({d:n,stroke:r,strokeWidth:0,fill:r,classes:"apexcharts-gauge-needle-shape"});a.add(h);const c=Number(t.series[0]),d=this._angleAtValue(c),u=e.globals,p=this.needleMotion(),g=Number.isFinite(u.radialNeedleAngle)&&!(null==p?void 0:p.mount)?u.radialNeedleAngle:this.startAngle;if(u.radialNeedleAngle=d,null!=e.globals.radialNeedleRAF&&(ft.cancelAnimationFrame(e.globals.radialNeedleRAF),e.globals.radialNeedleRAF=null),p&&g!==d){const{speed:t,ease:i}=p,s=a.node;s.setAttribute("transform-origin",`${o} ${l}`),s.setAttribute("transform",`rotate(${g})`);const r=performance.now(),n=a=>{if(this.w.globals.isDestroyed)return void(e.globals.radialNeedleRAF=null);const o=Math.max(0,Math.min(1,(a-r)/t)),l=g+(d-g)*i(o);s.setAttribute("transform",`rotate(${l})`),e.globals.radialNeedleRAF=o<1?ft.requestAnimationFrame(n):null};e.globals.radialNeedleRAF=ft.requestAnimationFrame(n)}else a.attr({"transform-origin":`${o} ${l}`,transform:`rotate(${d})`});return a}needlePath(t,e){var i,s,a;const r=this.getStrokeWidth(t),n=t.size-r/2-r-this.margin,o="string"==typeof e.length&&e.length.endsWith("%")?n*parseInt(e.length,10)/100:Number(e.length||.85*n),l=null!=(i=e.baseWidth)?i:4,h=null!=(s=e.tipWidth)?s:1,c=t.centerX,d=t.centerY+Number(null!=(a=e.offsetY)?a:0);return{path:`M ${c+l/2} ${d} A ${l/2} ${l/2} 0 0 1 ${c-l/2} ${d} L ${c-h/2} ${d-o} L ${c+h/2} ${d-o} Z`,cx:c,cy:d,length:o,baseW:l}}needleMotion(){var t,e,i;const s=this.w,a=s.config.plotOptions.radialBar.needle||{},r=s.config.chart.animations,n=this.initialAnim&&!s.globals.dataChanged&&!s.globals.resized;if(!(Nt.isBrowser()&&s.globals.shouldAnimate&&!1!==(null==(t=a.animation)?void 0:t.enabled)&&(n||this.dynamicAnim&&s.globals.dataChanged)))return null;return{speed:Number(null==(e=a.animation)?void 0:e.duration)||Number(a.animationSpeed)||(n?r.speed:null==(i=r.dynamicAnimation)?void 0:i.speed)||800,mount:n,ease:w(n?"easeOutBack":"easeOutCubic")}}drawHollow(t){var e;const i=new R(this.w),s=this.w.config.plotOptions.radialBar.hollow,a=i.drawCircle(2*t.size),r={class:"apexcharts-radialbar-hollow",cx:t.centerX,cy:t.centerY,r:t.size,fill:t.fill};return(s.stroke||s.strokeDasharray)&&(r.stroke=s.stroke||"transparent",r["stroke-width"]=null!=(e=s.strokeWidth)?e:1,s.strokeDasharray&&(r["stroke-dasharray"]=s.strokeDasharray)),a.attr(r),a}drawHollowImage(t,e,i,s){const a=this.w,r=new F(this.w),n=Zt.randomId(),o=a.config.plotOptions.radialBar.hollow.image;if(a.config.plotOptions.radialBar.hollow.imageClipped)r.clippedImgArea({width:i,height:i,image:o,patternID:`pattern${a.globals.cuid}${n}`}),s=`url(#pattern${a.globals.cuid}${n})`;else{const i=a.config.plotOptions.radialBar.hollow.imageWidth,s=a.config.plotOptions.radialBar.hollow.imageHeight;if(void 0===i&&void 0===s){const i=a.dom.Paper.image(o,function(e){this.move(t.centerX-e.width/2+a.config.plotOptions.radialBar.hollow.imageOffsetX,t.centerY-e.height/2+a.config.plotOptions.radialBar.hollow.imageOffsetY)});e.add(i)}else{const r=a.dom.Paper.image(o,function(){this.move(t.centerX-i/2+a.config.plotOptions.radialBar.hollow.imageOffsetX,t.centerY-s/2+a.config.plotOptions.radialBar.hollow.imageOffsetY),this.size(i,s)});e.add(r)}}return s}getStrokeWidth(t){const e=this.w;return t.size*(100-parseInt(e.config.plotOptions.radialBar.hollow.size,10))/100/(t.series.length+1)-this.margin}onBarLabelClick(t){var e;const i=t.target,s=parseInt(null!=(e=i.getAttribute("rel"))?e:"",10)-1,a=this.barLabels.onClick,r=this.w;a&&a(r.seriesData.seriesNames[s],{w:r,seriesIndex:s})}},radar:class{constructor(t,e){this.ctx=e,this.w=t,this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animDur=0,this.graphics=new R(this.w),this.lineColorArr=void 0!==t.globals.stroke.colors?t.globals.stroke.colors:t.globals.colors,this.defaultSize=t.globals.svgHeight<t.globals.svgWidth?t.layout.gridHeight:t.layout.gridWidth,this.isLog=t.config.yaxis[0].logarithmic,this.logBase=t.config.yaxis[0].logBase,this.coreUtils=new P(this.w),this.maxValue=this.isLog?this.coreUtils.getLogVal(this.logBase,t.globals.maxY,0):t.globals.maxY,this.minValue=this.isLog?this.coreUtils.getLogVal(this.logBase,this.w.globals.minY,0):t.globals.minY,this.polygons=t.config.plotOptions.radar.polygons,this.strokeWidth=t.config.stroke.show?t.config.stroke.width:0,this.size=this.defaultSize/2.1-this.strokeWidth-t.config.chart.dropShadow.blur,t.config.xaxis.labels.show&&(this.size=this.size-t.layout.xAxisLabelsWidth/1.75),void 0!==t.config.plotOptions.radar.size&&(this.size=t.config.plotOptions.radar.size),this.dataRadiusOfPercent=[],this.dataRadius=[],this.angleArr=[],this.dataPointsLen=0,this.disAngle=0,this.yaxisLabelsTextsPos=[]}draw(t){const e=this.w,i=new F(this.w),s=[],a=new I(this.w,this.ctx);t.length&&(this.dataPointsLen=t[e.globals.maxValsInArrayIndex].length),this.disAngle=2*Math.PI/this.dataPointsLen;const r=e.layout.gridWidth/2,n=e.layout.gridHeight/2,h=r+e.config.plotOptions.radar.offsetX,c=n+e.config.plotOptions.radar.offsetY,d=this.graphics.group({class:"apexcharts-radar-series apexcharts-plot-series",transform:`translate(${h||0}, ${c||0})`});e.globals.circleGeometry={node:d.node,cx:h||0,cy:c||0,r:this.size};const u=e.globals.prevCircleFrame,p=u&&"radar"===u.type&&u.rendered.r>0?this.size/u.rendered.r:1;let g=[],f=null,m=null;if(this.yaxisLabels=this.graphics.group({class:"apexcharts-yaxis"}),t.forEach((t,r)=>{const n=t.length===e.globals.dataPoints,h=this.graphics.group().attr({class:"apexcharts-series","data:longestSeries":n,seriesName:Zt.escapeString(e.seriesData.seriesNames[r]),rel:r+1,"data:realIndex":r});W.addCollapsedClassToSeries(this.w,h,r),this.dataRadiusOfPercent[r]=[],this.dataRadius[r]=[],this.angleArr[r]=[];if(0===t.length&&(e.globals.collapsedSeriesIndices.indexOf(r)>-1||e.globals.ancillaryCollapsedSeriesIndices.indexOf(r)>-1))for(let t=0;t<e.globals.dataPoints;t++)this.dataRadiusOfPercent[r][t]=0,this.dataRadius[r][t]=0,this.angleArr[r][t]=t*this.disAngle;t.forEach((t,e)=>{const i=Math.abs(this.maxValue-this.minValue);t=Math.max(0,t-this.minValue),this.isLog&&(t=this.coreUtils.getLogVal(this.logBase,t,0)),this.dataRadiusOfPercent[r][e]=t/i,this.dataRadius[r][e]=this.dataRadiusOfPercent[r][e]*this.size,this.angleArr[r][e]=e*this.disAngle}),g=this.getDataPointsPos(this.dataRadius[r],this.angleArr[r]);const c=this.createPaths(g,{x:0,y:0});f=this.graphics.group({class:"apexcharts-series-markers-wrap apexcharts-element-hidden"}),m=this.graphics.group({class:"apexcharts-datalabels","data:realIndex":r}),e.globals.delayedElements.push({el:f.node,index:r});const d={i:r,realIndex:r,animationDelay:r,initialSpeed:e.config.chart.animations.speed,dataChangeSpeed:e.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-radar",shouldClipToGrid:!1,bindEventsOnPaths:!1,stroke:e.globals.stroke.colors[r],strokeLinecap:e.config.stroke.lineCap};let u=null;var x,b;e.globals.previousPaths.length>0&&(x=this.getPreviousPath(r),b=p,u=x&&1!==b&&Number.isFinite(b)&&!/[aA]/.test(x)?x.replace(/-?(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?/gi,t=>String(parseFloat(t)*b)):x);for(let t=0;t<c.linePathsTo.length;t++){const s=this.graphics.renderPaths(l(o({},d),{pathFrom:null===u?c.linePathsFrom[t]:u,pathTo:c.linePathsTo[t],strokeWidth:Array.isArray(this.strokeWidth)?this.strokeWidth[r]:this.strokeWidth,fill:"none",drawShadow:!1}));h.add(s);const a=i.fillPath({seriesNumber:r}),n=this.graphics.renderPaths(l(o({},d),{pathFrom:null===u?c.areaPathsFrom[t]:u,pathTo:c.areaPathsTo[t],strokeWidth:0,fill:a,drawShadow:!1,drawMask:{type:"radial",cx:0,cy:0,r:this.size}}));if(e.config.chart.dropShadow.enabled){const t=new D(this.w),i=e.config.chart.dropShadow;t.dropShadow(n,Object.assign({},i,{noUserSpaceOnUse:!0}),r)}h.add(n)}const y=new z(this.w,this.ctx);t.forEach((t,i)=>{const s=y.getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:r,dataPointIndex:i});s.pSize||(s.pSize=5,s.pointFillColor="transparent",s.pointStrokeColor="transparent",s.pointStrokeWidth=0);const n=this.graphics.drawMarker(g[i].x,g[i].y,s);n.attr("rel",i),n.attr("j",i),n.attr("index",r),n.node.setAttribute("default-marker-size",s.pSize);const l=this.graphics.group({class:"apexcharts-series-markers"});l&&l.add(n),f.add(l),h.add(f);const c=e.config.dataLabels;if(c.enabled){const t=c.formatter(e.seriesData.series[r][i],{ctx:this.ctx,seriesIndex:r,dataPointIndex:i,w:e});a.plotDataLabelsText({x:g[i].x,y:g[i].y,text:t,textAnchor:"middle",i:r,j:r,seriesIndex:r,dataPointIndex:i,parent:m,offsetCorrection:!1,dataLabelsConfig:o({},c)})}h.add(m)}),s.push(h)}),this.drawPolygons({parent:d}),e.config.xaxis.labels.show){const t=this.drawXAxisTexts();d.add(t)}return s.forEach(t=>{d.add(t)}),d.add(this.yaxisLabels),d}drawPolygons(t){const e=this.w,{parent:i}=t,s=new fs(this.w),a=e.globals.yAxisScale[0].result.slice().reverse(),r=a.length,n=[],o=this.size/(r-1);for(let t=0;t<r;t++)n[t]=o*t;n.reverse();const l=[],h=[];n.forEach((t,e)=>{const i=Zt.getPolygonPos(t,this.dataPointsLen);let s="";i.forEach((t,i)=>{if(0===e){const e=this.graphics.drawLine(t.x,t.y,0,0,Array.isArray(this.polygons.connectorColors)?this.polygons.connectorColors[i]:this.polygons.connectorColors);h.push(e)}0===i&&this.yaxisLabelsTextsPos.push({x:t.x,y:t.y}),s+=t.x+","+t.y+" "}),l.push(s)}),l.forEach((t,s)=>{const a=this.polygons.strokeColors,r=this.polygons.strokeWidth,n=this.graphics.drawPolygon(t,Array.isArray(a)?a[s]:a,Array.isArray(r)?r[s]:r,e.globals.radarPolygons.fill.colors[s]);i.add(n)}),h.forEach(t=>{i.add(t)}),e.config.yaxis[0].show&&this.yaxisLabelsTextsPos.forEach((t,e)=>{const i=s.drawYAxisTexts(t.x,t.y,e,a[e]);this.yaxisLabels.add(i)})}drawXAxisTexts(){const t=this.w,e=t.config.xaxis.labels,i=e.style.colors,s=this.graphics.group({class:"apexcharts-xaxis"}),a=Zt.getPolygonPos(this.size,this.dataPointsLen);return t.labelData.labels.forEach((r,n)=>{const l="function"==typeof t.config.xaxis.labels.formatter?t.config.xaxis.labels.formatter:t=>t,h=new I(this.w,this.ctx);if(a[n]){const c=this.getTextPos(a[n],this.size),d=l(r,{seriesIndex:-1,dataPointIndex:n,w:t});h.plotDataLabelsText({x:c.newX,y:c.newY,text:d,textAnchor:c.textAnchor,i:n,j:n,parent:s,className:"apexcharts-xaxis-label",color:(Array.isArray(i)?i[n]:i)||"#a8a8a8",dataLabelsConfig:o({textAnchor:c.textAnchor,dropShadow:{enabled:!1}},e),offsetCorrection:!1}).on("click",e=>{if("function"==typeof t.config.chart.events.xAxisLabelClick){const i=Object.assign({},t,{labelIndex:n});t.config.chart.events.xAxisLabelClick(e,this.ctx,i)}})}}),s}createPaths(t,e){const i=[];let s=[];const a=[];let r=[];if(t.length){s=[this.graphics.move(e.x,e.y)],r=[this.graphics.move(e.x,e.y)];let n=this.graphics.move(t[0].x,t[0].y),o=this.graphics.move(t[0].x,t[0].y);t.forEach((e,i)=>{n+=this.graphics.line(e.x,e.y),o+=this.graphics.line(e.x,e.y),i===t.length-1&&(n+="Z",o+="Z")}),i.push(n),a.push(o)}return{linePathsFrom:s,linePathsTo:i,areaPathsFrom:r,areaPathsTo:a}}getTextPos(t,e){let i="middle",s=t.x,a=t.y;return Math.abs(t.x)>=10?t.x>0?(i="start",s+=10):t.x<0&&(i="end",s-=10):i="middle",Math.abs(t.y)>=e-10&&(t.y<0?a-=10:t.y>0&&(a+=10)),{textAnchor:i,newX:s,newY:a}}getPreviousPath(t){let e=null;for(const i of Ui(this.w,t))Array.isArray(null==i?void 0:i.paths)&&i.paths.length>0&&void 0!==i.paths[0]&&(e=i.paths[0].d);return e}getDataPointsPos(t,e,i=this.dataPointsLen){t=t||[],e=e||[];const s=[];for(let a=0;a<i;a++){const i={};i.x=t[a]*Math.sin(e[a]),i.y=-t[a]*Math.cos(e[a]),s.push(i)}return s}},heatmap:class{constructor(t,e,i){this.ctx=e,this.w=t,this.xRatio=i.xRatio,this.yRatio=i.yRatio,this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.helpers=new ns(t,e),this.rectRadius=this.w.config.plotOptions.heatmap.radius,this.shape=this.w.config.plotOptions.heatmap.shape||"rect",this.strokeWidth=this.w.config.stroke.show?this.w.config.stroke.width:0}padXRange(t){const{w:e}=t,i=e.globals,s=e.config.xaxis;if(("numeric"===s.type||"datetime"===s.type)&&i.initialMinX<i.initialMaxX){t._getMinXDiff();const a=os(e)/2;i.initialMinX-=a,i.initialMaxX+=a,null==s.min&&null==s.max&&null==s.range&&(i.minX-=a,i.maxX+=a,s.tickAmount||i.xTickAmount!==i.dataPoints-1||(i.xTickAmount=i.dataPoints))}}draw(t){var e,i;const s=this.w,a=new R(this.w,this.ctx),r=a.group({class:"apexcharts-heatmap"}),n=s.layout.gridWidth/s.globals.dataPoints,o=s.layout.gridHeight/s.seriesData.series.length,l=("numeric"===s.config.xaxis.type||"datetime"===s.config.xaxis.type)&&s.axisFlags.isXNumeric&&this.xRatio>0;let h=n;if(l){const t=os(s);t&&(h=t/this.xRatio)}let c=this.shape;l&&"hexagon"===c&&(c="rect");const d=oi(this.ctx,a),p="rect"===c&&d!==a&&"function"==typeof d.drawRectCell;"hexagon"===c?this.applyHexagonClipPath(r,a,n,o):r.attr("clip-path",`url(#gridRectMask${s.globals.cuid})`);const g=Array.isArray(s.config.fill.opacity)?null!=(e=s.config.fill.opacity[0])?e:1:null!=(i=s.config.fill.opacity)?i:1;let f=0,m=!1;this.negRange=this.helpers.checkColorRange();const x=t.slice();s.config.yaxis[0].reversed&&(m=!0,x.reverse());for(let e=m?0:x.length-1;m?e<x.length:e>=0;m?e++:e--){const i=a.group({class:"apexcharts-series apexcharts-heatmap-series",seriesName:Zt.escapeString(s.seriesData.seriesNames[e]),rel:e+1,"data:realIndex":e});if(W.addCollapsedClassToSeries(this.w,i,e),p||a.setupEventDelegation(i,".apexcharts-heatmap-rect"),s.config.chart.dropShadow.enabled){const t=s.config.chart.dropShadow;new D(this.w).dropShadow(i,t,e)}let m=0;const x=s.config.plotOptions.heatmap.shadeIntensity,b=Math.round(f/o),y="hexagon"===c?(b%2==0?-1:1)*n/4:0;let v=0;for(let r=0;r<s.globals.dataPoints;r++){if(!l&&s.seriesData.seriesX.length&&!s.globals.allSeriesHasEqualX&&s.globals.minX+s.globals.minXDiff*r<s.seriesData.seriesX[e][v]){m+=n;continue}if(v>=t[e].length)break;const b=l?h:n;if(l){const t=s.seriesData.seriesX[e]?s.seriesData.seriesX[e][v]:null;if(null==t||t!=t){v++;continue}m=(t-s.globals.minX)/this.xRatio-h/2}const w=this.helpers.getShadeColor(s.config.chart.type,e,v,this.negRange);let _=w.color;const A=w.colorProps;if("image"===s.config.fill.type){_=new F(this.w).fillPath({seriesNumber:e,dataPointIndex:v,opacity:s.globals.hasNegs?A.percent<0?1-(1+A.percent/100):x+A.percent/100:A.percent/100,patternID:Zt.randomId(),width:s.config.fill.image.width?s.config.fill.image.width:b,height:s.config.fill.image.height?s.config.fill.image.height:o})}const S=this.rectRadius,C=s.config.plotOptions.heatmap.useFillColorAsStroke?_:s.globals.stroke.colors[0];if(p)d.drawRectCell(m,f,b,o,{fill:_,fillOpacity:g,stroke:C,strokeWidth:this.strokeWidth,radius:S,seriesIndex:e,dataPointIndex:v});else{const r="rect"===c,n=r?a.drawRect(m,f,b,o,S):a.drawPath({d:this.cellShapePath(c,m+y,f,b,o),stroke:C,strokeWidth:this.strokeWidth,fill:_,fillOpacity:1});if(n.attr({cx:m+y,cy:f}),n.node.classList.add("apexcharts-heatmap-rect"),i.add(n),n.attr({fill:_,i:e,index:e,j:v,val:t[e][v],"stroke-width":this.strokeWidth,stroke:C,color:_}),r||n.attr({width:b,height:o}),s.config.chart.animations.enabled&&!s.globals.dataChanged){const t=s.config.chart.animations.speed;if(s.globals.resized)s.globals.animationEnded=!0;else if(r)this.animateHeatMap(n,m,f,b,o,t,e,v);else{const i=new u(this.w);i.animatePop(n,{speed:t,delay:this.enterStaggerDelay(t,e,v),onComplete:()=>{i.animationCompleted(n)}})}}if(s.globals.dataChanged){let t=1;if(this.dynamicAnim.enabled&&s.globals.shouldAnimate){t=this.dynamicAnim.speed;const i=s.globals.previousPaths[e]&&s.globals.previousPaths[e][v],a=Zt.isColorHex(_)?_:Zt.rgb2hex(_);if(null==i?void 0:i.color){const e=i.rect,l=r&&e&&Ri(s)&&[e.x,e.y,e.width,e.height].every(Number.isFinite)&&(Math.abs(e.x-m)>.5||Math.abs(e.y-f)>.5||Math.abs(e.width-b)>.5||Math.abs(e.height-o)>.5)?e:null;this.animateHeatColor(n,Zt.isColorHex(i.color)?i.color:Zt.rgb2hex(i.color),a,t,l&&{from:l,to:{x:m,y:f,width:b,height:o}})}else if(r){const e=m+b/2,i=f+o/2;this.animateHeatColor(n,a,a,t,{from:{x:e,y:i,width:0,height:0},to:{x:m,y:f,width:b,height:o}})}else new u(this.w).animatePop(n,{speed:t})}}}if(s.config.dataLabels.enabled){const t=(0,s.config.dataLabels.formatter)(s.seriesData.series[e][v],{value:s.seriesData.series[e][v],seriesIndex:e,dataPointIndex:v,w:s}),a=this.helpers.calculateDataLabels({text:t,x:m+y+b/2,y:f+o/2,i:e,j:v,colorProps:A});null!==a&&i.add(a)}l||(m+=n),v++}f+=o,r.add(i)}return r}animateHeatMap(t,e,i,s,a,r,n=0,o=0){const l=new u(this.w),h=this.enterStaggerDelay(r,n,o);l.animateRect(t,{x:e+s/2,y:i+a/2,width:0,height:0},{x:e,y:i,width:s,height:a},r,()=>{l.animationCompleted(t)},h)}enterStaggerDelay(t,e,i){const s=this.w,a=s.config.chart.animations.animateGradually;if(!a||!1===a.enabled)return 0;const r=((s.seriesData.series||[]).length||1)+(s.globals.dataPoints||1)-2,n=Math.min(a.delay||0,.5*t/Math.max(1,r));return p({style:"diagonal",index:i,row:e,col:i,baseDelay:n})}cellShapePath(t,e,i,s,a){const r=e+s/2,n=i+a/2;if("circle"===t){const t=Math.min(s,a)/2;return`M ${r-t} ${n} a ${t} ${t} 0 1 0 ${2*t} 0 a ${t} ${t} 0 1 0 ${2*-t} 0 Z`}if("diamond"===t)return`M ${r} ${i} L ${e+s} ${n} L ${r} ${i+a} L ${e} ${n} Z`;const o=e+s;return`M ${r} ${i-a/6} L ${o} ${i+a/6} L ${o} ${i+5*a/6} L ${r} ${i+7*a/6} L ${e} ${i+5*a/6} L ${e} ${i+a/6} Z`}applyHexagonClipPath(t,e,i,s){const a=this.w,r=this.strokeWidth/2+2,n=`heatmapHexMask${a.globals.cuid}`,o=a.dom.elDefs.node,l=o.querySelector(`clipPath[id="${n}"]`);l&&l.parentNode&&l.parentNode.removeChild(l);const h=ft.createElementNS(zt,"clipPath");h.setAttribute("id",n),h.appendChild(e.drawRect(-i/4-r,-s/6-r,a.layout.gridWidth+i/2+2*r,a.layout.gridHeight+s/3+2*r,0,"#fff").node),o.appendChild(h),t.attr("clip-path",`url(#${n})`)}animateHeatColor(t,e,i,s,a=null){const r=t.attr(o({fill:e},null==a?void 0:a.from)).animate(s).attr(o({fill:i},null==a?void 0:a.to));a&&r.ease(Yi(this.w))}},treemap:class{constructor(t,e){this.ctx=e,this.w=t,this.strokeWidth=this.w.config.stroke.width,this.helpers=new ns(t,e),this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.labels=[],this.roots=[],this.drawn=[],this.showParents=!1,this.scale=null,this._levelCache=null,this._total=null,this._avgLabelSize=null,this._tooltipEl=null,this._morphLeafIndex=0,this.camera=null}draw(){var t,e;const i=this.w,s=new R(this.w,this.ctx),a=new F(this.w),r=s.group({class:"apexcharts-treemap"});if(i.globals.noData)return r;this.negRange=this.helpers.checkColorRange(),i.config.series.forEach((t,e)=>{Array.isArray(this.labels[e])||(this.labels[e]=[]),t.data.forEach(t=>{this.labels[e].push(t.x)})});const n=Fs(i);this.roots=n.roots,this.scale=ue(i);const l=1===n.roots.length?n.roots[0].children||[]:n.roots;this.drawn=l,this.showParents=Os(i);const h=this._resolveFocus(l),c=h?[h]:l;Ps.generateNested(c,i.layout.gridWidth,i.layout.gridHeight,{padding:(t,e,i,s)=>this.showParents?this._levelPadding(e,i,s):0,header:(t,e,i,s)=>this.showParents?this._levelHeader(t,e,i,s):0}),this.camera=this._zoomCamera();const d=null==(t=this.ctx.highlightFilter)?void 0:t.treemap(this),u=null==(e=this.ctx)?void 0:e.morphTypeChange,p=!!u&&"function"==typeof u.isActive&&u.isActive()&&"function"==typeof u.getInitialPathAt;this._morphLeafIndex=0;const g=this._leavesBySeries(c,i.config.series.length),f=this.showParents?this._parentsBySeries(c,i.config.series.length):[];return g.forEach((t,e)=>{var n;const l=s.group({class:"apexcharts-series apexcharts-treemap-series",seriesName:Zt.escapeString(i.seriesData.seriesNames[e]),rel:e+1,"data:realIndex":e});if(W.addCollapsedClassToSeries(this.w,l,e),s.setupEventDelegation(l,".apexcharts-treemap-rect"),i.config.chart.dropShadow.enabled){const t=i.config.chart.dropShadow;new D(this.w).dropShadow(l,t,e)}const h=s.group({class:"apexcharts-data-labels"}),c={xMin:1/0,yMin:1/0,xMax:-1/0,yMax:-1/0},u={xMin:1/0,yMin:1/0};this.showParents&&(f[e]||[]).forEach(t=>{this._drawParent(l,t,e)});const g=i.config.chart.animations,m=g.animateGradually,x=m&&!1!==m.enabled,b=new Array(t.length).fill(0);if(x){const e=t.length||1,i=Math.min(m.delay||0,.5*g.speed/e);t.map((t,e)=>{return{j:e,area:t.rect?(i=t.rect,(i[2]-i[0])*(i[3]-i[1])):0};var i}).sort((t,e)=>e.area-t.area).forEach((t,e)=>{b[t.j]=e*i})}t.forEach((t,r)=>{var n;const h=t.rect;if(!h)return;const g=t._di,f=h[0],m=h[1],x=h[2],y=h[3];x>f&&y>m&&(c.xMin=Math.min(c.xMin,f),c.yMin=Math.min(c.yMin,m),c.xMax=Math.max(c.xMax,x),c.yMax=Math.max(c.yMax,y));const v=this._leafColor(e,g),w=v.color;let _=a.fillPath({color:w,seriesNumber:e,dataPointIndex:g});const A=p?this._morphSourceForLeaf(t):null,S=A?s.drawPath({d:this._tilePath(f,m,x,y),fill:"#fff",stroke:i.config.plotOptions.treemap.useFillColorAsStroke?w:i.globals.stroke.colors[e],strokeWidth:this.strokeWidth,fillOpacity:1}):s.drawRect(f,m,x-f,y-m,i.config.plotOptions.treemap.borderRadius,"#fff",1,this.strokeWidth,i.config.plotOptions.treemap.useFillColorAsStroke?w:i.globals.stroke.colors[e]);_=(null==d?void 0:d(S,e,g,_,t))||_,S.attr({cx:f,cy:m,index:e,i:e,j:g,width:x-f,height:y-m,fill:_}),S.node.classList.add("apexcharts-treemap-rect"),S.node.setAttribute("data:key",Es(t._key));let C=null,k={x:f+(x-f)/2,y:m+(y-m)/2,width:0,height:0};const P={x:f,y:m,width:x-f,height:y-m};A?this._morphTile(S,A,this._tilePath(f,m,x,y),this.ctx.morphTypeChange.getSpeed(),e,g):i.config.chart.animations.enabled&&!i.globals.dataChanged&&(i.globals.resized?i.globals.animationEnded=!0:C=this.animateTreemap(S,k,P,i.config.chart.animations.speed,b[r]||0));let L=null,M=null;if(i.globals.dataChanged){let t=1;if(this.dynamicAnim.enabled&&i.globals.shouldAnimate){t=this.dynamicAnim.speed;const s=null==(n=i.globals.previousPaths[e])?void 0:n[g],a=o({},P);if(!(null==s?void 0:s.rect)&&this.camera&&(k=this.camera.back(P),L={x:k.x+k.width/2,y:k.y+k.height/2}),null==s?void 0:s.rect){k=o({},s.rect),k.width>0&&k.height>0&&(u.xMin=Math.min(u.xMin,k.x),u.yMin=Math.min(u.yMin,k.y),L={x:k.x+k.width/2,y:k.y+k.height/2},M="string"==typeof s.label?s.label:null,s.labelFading&&this.camera&&(M=""));const t=t=>"string"==typeof t&&/^(#|rgb)/i.test(t);t(s.fill)&&t(_)&&s.fill!==_&&(k.fill=s.fill,a.fill=_)}C=this.animateTreemap(S,k,a,t)}}let I=this.getFontSize(h);"truncate"===i.config.plotOptions.treemap.dataLabels.format&&(I=parseInt(String(i.config.dataLabels.style.fontSize),10));let E=null;if(i.config.dataLabels.enabled&&this._labelCanShow(I,x-f,y-m)){let s=i.config.dataLabels.formatter(this.labels[e][g],{value:i.seriesData.series[e][g],seriesIndex:e,dataPointIndex:g,w:i,highlight:t.highlight});"truncate"===i.config.plotOptions.treemap.dataLabels.format&&(s=this.truncateLabels(String(s),I,f,m,x,y)),i.seriesData.series[e][g]&&(E=this.helpers.calculateDataLabels({text:s,x:(f+x)/2,y:(m+y)/2+this.strokeWidth/2+I/3,i:e,j:g,colorProps:v,fontSize:I})),i.config.dataLabels.enabled&&E&&this.rotateToFitLabel(E,I,s,f,m,x,y)}if(l.add(S),null!==E&&(E.node.setAttribute("data:key",Es(t._key)),l.add(E),C)){const t=!L||""===M||!!this.camera&&null!==M&&M!==W.treemapLabelLook(E.node);this._rideTile(E.node,L,f,m,x,y,C,t)}});const y=i.config.plotOptions.treemap.seriesTitle;if(!this.showParents&&i.config.series.length>1&&y&&y.show){const t=i.config.series[e].name||"";if(t&&c.xMin<1/0&&c.yMin<1/0){const{offsetX:e,offsetY:a,borderColor:r,borderWidth:o,borderRadius:h,style:d}=y,p=d.color||i.config.chart.foreColor,g={left:d.padding.left,right:d.padding.right,top:d.padding.top,bottom:d.padding.bottom},f=s.getTextRects(t,d.fontSize,d.fontFamily),m=f.width+g.left+g.right,x=f.height+g.top+g.bottom,b=c.xMin+(e||0),v=c.yMin+(a||0),w=s.drawRect(b,v,m,x,h,d.background,1,o,r),_=b+g.left,A=v+g.top+.75*(null!=(n=null==f?void 0:f.height)?n:0),S=s.drawText({x:_,y:A,text:t,fontSize:d.fontSize,fontFamily:d.fontFamily,fontWeight:d.fontWeight,foreColor:p,cssClass:d.cssClass||""}),C=u.xMin-c.xMin,k=u.yMin-c.yMin;if(Number.isFinite(C)&&Number.isFinite(k)&&(C||k)){const t=this.dynamicAnim.speed;this.animateTreemap(w,{x:b+C,y:v+k},{x:b,y:v},t),this.animateTreemap(S,{x:_+C,y:A+k},{x:_,y:A},t)}l.add(w),l.add(S)}}l.add(h),r.add(l)}),this.camera&&this._playZoomExit(r),this._renderBreadcrumb(),r}_levelCfg(t){if(this._levelCache||(this._levelCache=[]),this._levelCache[t])return this._levelCache[t];const e=this.w.config.plotOptions.treemap,i=e.parents||{},s=(e.levels||[])[t]||{},a=l(o(o({},i),s),{header:l(o(o({},i.header||{}),s.header||{}),{style:o(o({},(i.header||{}).style||{}),(s.header||{}).style||{})}),hover:o(o({},i.hover||{}),s.hover||{})});return this._levelCache[t]=a,a}_levelPadding(t,e,i){const s=this._levelCfg(t);return Number(s.padding)||0}_levelHeader(t,e,i,s){const a=this._levelCfg(e).header||{};if(!1===a.show)return 0;const r=Number(a.height);if(!Number.isFinite(r)||r<=0)return 0;return i<(Number(a.minWidth)||40)||s<2*r?0:r}_leavesBySeries(t,e){const i=new Array(Math.max(1,e));for(let t=0;t<i.length;t++)i[t]=[];const s=t=>{if(t.children&&t.children.length)t.children.forEach(s);else{const e=t._si||0;i[e]&&i[e].push(t)}};return t.forEach(s),i}_parentsBySeries(t,e){const i=new Array(Math.max(1,e));for(let t=0;t<i.length;t++)i[t]=[];const s=t=>{if(!t.children||!t.children.length)return;const e=t._si||0;i[e]&&i[e].push(t),t.children.forEach(s)};return t.forEach(s),i.forEach(t=>t.sort((t,e)=>(t.depth||0)-(e.depth||0))),i}_leafColor(t,e){const i=this.w;if(this.scale){const s=ce(i,t,e);if(null!=s){const t=this.scale.at(s);return{color:t,foreColor:pe(t),colorProps:{color:t,foreColor:pe(t),percent:0}}}}return this.helpers.getShadeColor(i.config.chart.type,t,e,this.negRange)}_parentChrome(t){const e=this.w,i=this._levelCfg(t),s="dark"===e.config.theme.mode,a=(i.header||{}).style||{},r=Math.min(t,3),n=s?255:0,o=`${n},${n},${n}`;return{fill:i.fill||`rgba(${o},${(s?.04:.03)+.02*r})`,fillOpacity:null==i.fillOpacity?1:i.fillOpacity,borderColor:i.borderColor||`rgba(${o},${s?.18:.14})`,borderWidth:null==i.borderWidth?1:i.borderWidth,borderRadius:null==i.borderRadius?e.config.plotOptions.treemap.borderRadius:i.borderRadius,headerBg:a.background||`rgba(${o},${s?.1:.07})`,headerColor:a.color||(s?"#e8e8e8":e.config.chart.foreColor),headerFontSize:a.fontSize||"12px",headerFontFamily:a.fontFamily||e.config.chart.fontFamily,headerFontWeight:null==a.fontWeight?600:a.fontWeight,hoverColor:i.hover&&i.hover.color||(s?"rgba(255,255,255,0.85)":"rgba(0,0,0,0.7)"),hoverWidth:i.hover&&i.hover.width||2,hoverShow:!(i.hover&&!1===i.hover.show)}}_drawParent(t,e,i){var s,a,r,n;const o=e.rect;if(!o)return;const l=this.w,h=new R(this.w,this.ctx),c=e.depth||0,d=this._levelCfg(c),p=this._parentChrome(c),g=o[0],f=o[1],m=o[2]-o[0],x=o[3]-o[1];if(m<=0||x<=0)return;const b=h.group({class:"apexcharts-treemap-parent","data:depth":c,"data:name":e.name}),y=Es(e._key),v=this._morphKeyed()?this.ctx.morphTypeChange.getInitialPathForKey(y):null,w=v?h.drawPath({d:this._tilePath(g,f,g+m,f+x),fill:p.fill,stroke:p.borderColor,strokeWidth:p.borderWidth,fillOpacity:p.fillOpacity}):h.drawRect(g,f,m,x,p.borderRadius,p.fill,p.fillOpacity,p.borderWidth,p.borderColor);w.node.classList.add("apexcharts-treemap-parent-rect"),w.node.setAttribute("data:key",y),w.node.setAttribute("data:depth",String(c)),v&&this._morphTile(w,v,this._tilePath(g,f,g+m,f+x),this.ctx.morphTypeChange.getSpeed(),i,c);let _=null,A=null,S=!1;const C=l.config.chart.animations.dynamicAnimation;if(!v&&l.globals.dataChanged&&C.enabled&&l.globals.shouldAnimate){const t=C.speed;if(_=null!=(a=null==(s=l.globals.prevTreemapParents)?void 0:s.get(`${i}|${y}`))?a:null,!_&&this.camera){_=this.camera.back({x:g,y:f,width:m,height:x}),S=!0;const e=l.layout;_.x<e.gridWidth&&_.y<e.gridHeight&&_.x+_.width>0&&_.y+_.height>0&&b.attr({opacity:0}).animate(t).attr({opacity:1})}_?A=new u(l).animateRect(w,...Xs({x:_.x,y:_.y,width:_.width,height:_.height},{x:g,y:f,width:m,height:x},_.fill,w.node.getAttribute("fill")),t,()=>{}):b.attr({opacity:0}).animate(t).attr({opacity:1})}b.add(w);const k=e.headerHeight||0;let P="";if(k>0){const t=d.header||{},s=h.drawRect(g,f,m,k,0,p.headerBg,1,0,"transparent");if(s.node.classList.add("apexcharts-treemap-parent-header"),b.add(s),_){const t=_.header,e={x:g,y:f,width:m,height:k};new u(l).animateRect(s,...Xs(t?{x:t.x,y:t.y,width:t.width,height:t.height}:S&&this.camera?this.camera.back(e):{x:_.x,y:_.y,width:_.width,height:0},e,null==t?void 0:t.fill,s.node.getAttribute("fill")),l.config.chart.animations.dynamicAnimation.speed,()=>{})}let a=String(null!=(r=e.name)?r:"");"function"==typeof t.formatter?a=String(t.formatter(e.name,{value:e._area,depth:c,seriesIndex:i,node:e,w:l})):t.showValue&&(a=`${a} ${this._formatValue(e._area,e._si)}`),P=a;const o=Number(t.offsetX)||0,y=t.align||"left",v=6,C=Math.max(0,m-2*v-Math.abs(o)),L=parseFloat(String(p.headerFontSize))||12,M=h.getTextBasedOnMaxWidth({text:a,maxWidth:C,fontSize:L,fontFamily:p.headerFontFamily,fontWeight:p.headerFontWeight});if(M){let e=g+v+o,i="start";"center"===y?(e=g+m/2+o,i="middle"):"right"===y&&(e=g+m-v+o,i="end");const s=h.drawText({x:e,y:f+k/2+L/3+(Number(t.offsetY)||0),text:M,textAnchor:i,fontSize:p.headerFontSize,fontFamily:p.headerFontFamily,fontWeight:p.headerFontWeight,foreColor:p.headerColor,cssClass:`apexcharts-treemap-parent-label ${t.style&&t.style.cssClass||""}`});if(s.node.setAttribute("pointer-events","none"),b.add(s),A&&_){const t=t=>"center"===y?t.x+t.width/2:"right"===y?t.x+t.width:t.x,e={x:t(_)-t({x:g,width:m})+(g+m/2),y:_.y-f+(f+x/2)},i=!!this.camera&&!S&&(null==(n=_.header)?void 0:n.look)!==$s(s.node);this._rideTile(s.node,e,g,f,g+m,f+x,A,i)}}this._attachParentEvents(s.node,e,p,w),this._makeParentAccessible(s.node,e,p,w,P)}this._attachParentEvents(w.node,e,p,w),b.node.setAttribute("role","group"),b.node.setAttribute("aria-label",this._parentLabel(e,P)),t.add(b)}_parentLabel(t,e){const i=this._drawnTotal(),s=i>0?(t._area/i*100).toFixed(1):"0",a=this._countLeaves(t);return`${e&&String(e).trim()?String(e).replace(/\s+/g," ").trim():`${t.name}, ${this._formatValue(t._area,t._si)}`}, ${a} ${1===a?"item":"items"}, ${s}% of total`}_makeParentAccessible(t,e,i,s,a){const r=this.w.config.chart.accessibility;if(!t||!t.setAttribute)return;if(!r.enabled||!r.keyboard.enabled||!this._zoomEnabled())return;const n=this.w.globals.treemapFocusKey===e._key;t.tmKey=e._key,t.setAttribute("role","button"),t.setAttribute("tabindex","0"),t.setAttribute("aria-label",`${this._parentLabel(e,a)}. Zoom ${n?"out":"in"}`),t.setAttribute("aria-expanded",n),Nt.isBrowser()&&t.addEventListener&&(t.addEventListener("focus",()=>{s.node.setAttribute("stroke",i.hoverColor),s.node.setAttribute("stroke-width",String(i.hoverWidth+1))}),t.addEventListener("blur",()=>{s.node.setAttribute("stroke",i.borderColor),s.node.setAttribute("stroke-width",String(i.borderWidth))}),t.addEventListener("keydown",t=>{"Enter"!==t.key&&" "!==t.key&&"Spacebar"!==t.key||(t.preventDefault(),this._zoomTo(e,!0))}))}_attachParentEvents(t,e,i,s){if(!Nt.isBrowser()||!t||!t.addEventListener)return;const a=this.w;i.hoverShow&&(t.addEventListener("mouseenter",()=>{s.node.setAttribute("stroke",i.hoverColor),s.node.setAttribute("stroke-width",String(i.hoverWidth))}),t.addEventListener("mouseleave",()=>{s.node.setAttribute("stroke",i.borderColor),s.node.setAttribute("stroke-width",String(i.borderWidth))})),a.config.tooltip.enabled&&(t.addEventListener("mouseenter",t=>this._showParentTooltip(t,e)),t.addEventListener("mousemove",t=>this._positionTooltip(t)),t.addEventListener("mouseleave",()=>this._hideParentTooltip())),this._zoomEnabled()&&(t.style.cursor="pointer",t.addEventListener("click",()=>this._zoomTo(e)))}zoomLive(t,e){var i;const s=t.config.plotOptions.treemap.zoom;if(!(null==s?void 0:s.enabled)||!Os(t))return!1;const a=t.config.drilldown;return e&&(null==a?void 0:a.enabled)&&((null==(i=a.series)?void 0:i.length)||a.onDrillDown)?null:s}_zoomEnabled(){const t=this.ctx.drilldown,e=this.zoomLive(this.w,t);return null!==e||t.zoomWarned||(t.zoomWarned=!0,console.warn("ApexCharts treemap: zoom is ignored while drilldown is active (plotOptions.treemap.zoom vs drilldown series or onDrillDown).")),!!e}_resolveFocus(t){const e=this.w.globals.treemapFocusKey;if(!e||!this._zoomEnabled())return null;let i=null;const s=t=>{i||(t._key!==e?t.children&&t.children.forEach(s):i=t)};return t.forEach(s),i&&i.children&&i.children.length&&this._subtreeArea(i)>0?i:(this.w.globals.treemapFocusKey=null,null)}_zoomTo(t,e=!1){const i=this.w;if(!t||!t.children||!t.children.length)return;const s=i.globals.treemapFocusKey===t._key?null:t._key;this._refocus(s,e)}_refocus(t,e){const i=this.w,s=i.globals,a=s.treemapFocusKey,r=i.config.chart.animations,n=!(!r.enabled||!r.dynamicAnimation.enabled);s.treemapZoom=n&&Nt.isBrowser()?{from:null!=a?a:null,to:t}:null,s.treemapFocusKey=t,this._hideParentTooltip(),s.shouldAnimate=n,s.resized=!0,s.dataChanged=!0,s.treemapZoom&&this.ctx.series.getPreviousPaths();const o=this.ctx.update();e&&o.then(()=>{const t=i.dom.baseEl,e=Array.from(t.querySelectorAll(".apexcharts-treemap-parent-header[tabindex]"));(t.querySelector(".apexcharts-breadcrumb-item")||e.find(t=>t.tmKey===a)||e[0]||t).focus()})}_zoomCamera(){var t;const e=this.w,i=e.globals.treemapZoom;e.globals.treemapZoom=null;const s=e.globals.prevTreemapParents;if(!(i&&s&&e.globals.dataChanged&&e.globals.shouldAnimate))return null;const a=new Map,r=t=>{a.set(t._key,t),t.children&&t.children.forEach(r)};this.drawn.forEach(r);const n=(t,e)=>{for(let i=a.get(t);i;i=i._parent)if(i._key===e)return!0;return!1},{from:o,to:l}=i,h=l&&(null==o||n(l,o))?l:o&&(null==l||n(o,l))?o:null,c=h?a.get(h):null;if(!h||!c||!c.rect)return null;let d=c;for(;d._parent;)d=d._parent;const u=Math.max(0,this.roots.indexOf(d)),p=null!=(t=s.get(`${u}|${Es(h)}`))?t:null,g=c.rect,f=g[0],m=g[1],x=g[2]-g[0],b=g[3]-g[1];if(!p||!(p.width>0&&p.height>0&&x>0&&b>0))return null;const y=p,v=x/y.width,w=b/y.height;return{fwd:t=>({x:f+(t.x-y.x)*v,y:m+(t.y-y.y)*w,width:t.width*v,height:t.height*w}),back:t=>({x:y.x+(t.x-f)/v,y:y.y+(t.y-m)/w,width:t.width/v,height:t.height/w})}}_playZoomExit(t){const e=this.w,i=this.camera,s=e.globals.prevTreemapView;if(e.globals.prevTreemapView=null,!i||!Nt.isBrowser())return;const a=t.node,r=new R(this.w,this.ctx),n=[["apexcharts-treemap-rect","T"],["apexcharts-treemap-parent-rect","P"],["apexcharts-data-labels","L"]],o=t=>{var e;const i=n.find(([e])=>t.classList.contains(e)),s=null==(e=t.closest(".apexcharts-series"))?void 0:e.getAttribute("data:realIndex");return i?`${i[1]}${s}|${t.getAttribute("data:key")}`:""},l=(t,e)=>{var i;return parseFloat(null!=(i=t.getAttribute(e))?i:"")},h=t=>({x:l(t,"x"),y:l(t,"y"),width:l(t,"width"),height:l(t,"height")}),c=t=>({x:t.x+t.width/2,y:t.y+t.height/2}),d=new Map;a.querySelectorAll("[data\\:key]").forEach(t=>{const e=o(t);e&&d.set(e,t)});const u=[],p=(t,e)=>{const i=h(t);[i.x,i.y,i.width,i.height].every(Number.isFinite)&&u.push(s=>{t.setAttribute("x",String(i.x+(e.x-i.x)*s)),t.setAttribute("y",String(i.y+(e.y-i.y)*s)),t.setAttribute("width",String(i.width+(e.width-i.width)*s)),t.setAttribute("height",String(i.height+(e.height-i.height)*s))})},g=(t,e,i=!1)=>{var s;const a=t.getAttribute("transform")||"",r=parseFloat(null!=(s=t.getAttribute("opacity"))?s:"1"),n=Number.isFinite(r)?r:1;u.push(s=>{t.setAttribute("transform",`translate(${e.x*s} ${e.y*s}) ${a}`.trim()),i&&t.setAttribute("opacity",String(n*(1-s)))})},f=t=>{[t,...t.querySelectorAll("*")].forEach(t=>{t.removeAttribute("data:key"),["role","tabindex","aria-label","aria-expanded"].forEach(e=>t.removeAttribute(e)),t.classList.remove("apexcharts-treemap-rect","apexcharts-treemap-parent","apexcharts-treemap-parent-rect","apexcharts-treemap-parent-header","apexcharts-treemap-parent-label","apexcharts-data-labels")})},m=r.group({class:"apexcharts-treemap-ghosts"}).node,x=r.group({class:"apexcharts-treemap-ghosts"}).node;if(s){const t=[...s.querySelectorAll(":scope > .apexcharts-treemap-ghosts")];t.forEach((e,s)=>{e.querySelectorAll("rect").forEach(t=>p(t,i.fwd(h(t)))),e.querySelectorAll("text").forEach(t=>{const e=t=>{const e=/^translate\(\s*([-+.\deE]+)[\s,]+([-+.\deE]+)\s*\)/.exec(((null==t?void 0:t.getAttribute("transform"))||"").trim());return e?[parseFloat(e[1]),parseFloat(e[2])]:[0,0]},[s,a]=e(t.parentElement),[r,n]=e(t),o={x:l(t,"x")+s+r,y:l(t,"y")+a+n,width:0,height:0};if(!Number.isFinite(o.x)||!Number.isFinite(o.y))return;const h=i.fwd(o);g(t,{x:h.x-o.x,y:h.y-o.y})}),[...e.childNodes].forEach(e=>(s===t.length-1&&t.length>1?x:m).appendChild(e)),e.remove()});const a=new Map;s.querySelectorAll(".apexcharts-treemap-rect[data\\:key]").forEach(t=>a.set(o(t),t)),s.querySelectorAll(".apexcharts-data-labels[data\\:key]").forEach(t=>{const e=o(t),s=d.get(e);if(s&&!(t=>{var e;return parseFloat(null!=(e=t.getAttribute("opacity"))?e:"1")<.999})(t)&&W.treemapLabelLook(s)===W.treemapLabelLook(t))return;const r=a.get(`T${e.slice(1)}`);if(!r)return;const n=c(h(r)),l=d.get(`T${e.slice(1)}`),u=c(l?h(l):i.fwd(h(r)));g(t,{x:u.x-n.x,y:u.y-n.y},!!l),f(t),x.appendChild(t)}),s.querySelectorAll(".apexcharts-treemap-parent").forEach(t=>{var s;const a=t.querySelector(".apexcharts-treemap-parent-rect[data\\:key]");if(!a||"rect"!==a.tagName.toLowerCase())return;const r=d.get(o(a));if(r){const e=t.querySelector(".apexcharts-treemap-parent-label"),i=null==(s=r.parentElement)?void 0:s.querySelector(".apexcharts-treemap-parent-label");if(e&&$s(e)!==$s(i)){const t=h(a),i=h(r),s=e.getAttribute("text-anchor"),n=t=>"middle"===s?t.x+t.width/2:"end"===s?t.x+t.width:t.x;g(e,{x:n(i)-n(t),y:i.y-t.y},!0),f(e),x.appendChild(e)}return}t.querySelectorAll("rect").forEach(t=>p(t,i.fwd(h(t)))),t.querySelectorAll("text").forEach(t=>{const e={x:l(t,"x"),y:l(t,"y"),width:0,height:0};if(!Number.isFinite(e.x)||!Number.isFinite(e.y))return;const s=i.fwd(e);g(t,{x:s.x-e.x,y:s.y-e.y})});const n=i.fwd(h(a)),c=e.layout;n.x<c.gridWidth&&n.y<c.gridHeight&&n.x+n.width>0&&n.y+n.height>0&&u.push(e=>t.setAttribute("opacity",String(1-e))),f(t),m.appendChild(t)}),a.forEach((t,e)=>{d.has(e)||"rect"!==t.tagName.toLowerCase()||(p(t,i.fwd(h(t))),f(t),m.appendChild(t))});const r=s.querySelector(":scope > defs.apexcharts-treemap-ghost-defs");r&&m.insertBefore(r,m.firstChild)}[m,x].forEach(t=>{t.setAttribute("pointer-events","none"),t.setAttribute("aria-hidden","true")}),a.insertBefore(m,a.firstChild),a.appendChild(x),a.setAttribute("clip-path",`url(#gridRectMask${e.globals.cuid})`),Hi(e,Math.max(1,this.dynamicAnim.speed||1),w(e.config.chart.animations.easing),t=>u.forEach(e=>e(t)),()=>{m.remove(),x.remove(),a.removeAttribute("clip-path")})}_focusChain(){const t=[],e=new Set(this.drawn||[]);let i=this._resolveFocus(this.drawn||[]);for(;i&&(t.unshift(i),!e.has(i));)i=i._parent;return t}_breadcrumbCfg(){const t=this.w.config.plotOptions.treemap.zoom;return Ts(this.w,t&&t.breadcrumb)}_renderBreadcrumb(){if(!Nt.isBrowser())return;const t=this.w;if(!t.dom.elWrap)return;if(Rs(t),!this._zoomEnabled())return;const e=this._focusChain();if(!e.length)return;const i=function(t,e){if(!Nt.isBrowser())return null;const i=t.dom.elWrap;if(!i)return null;Rs(t);const s=e.config||Ts(t);if(!1===s.show)return null;const a=e.crumbs||[];if(a.length<2)return null;const r=ft.createElementNS(Ds,"nav");r.setAttribute("class","apexcharts-breadcrumb"),r.setAttribute("aria-label",e.ariaLabel||"Breadcrumb"),function(t,e){const i=e.offsetX||0,s=e.offsetY||0;t.style.position="absolute",t.style.top=s+"px","top-right"===e.position?t.style.right=3-i+"px":t.style.left=i+"px"}(r,s),e.compact&&(r.style.fontSize="11px",r.style.padding="0 2px");const n=null!=s.separator?s.separator:" / ";return a.forEach((t,i)=>{var o;if(i>0){const t=ft.createElementNS(Ds,"span");t.setAttribute("class","apexcharts-breadcrumb-separator"),t.setAttribute("aria-hidden","true"),t.textContent=n,r.appendChild(t)}let l=0===i?null!=(o=s.rootLabel)?o:"All":t.label;if("function"==typeof s.formatter&&(l=s.formatter(l,{index:i,depth:a.length-1,data:t.data})),i===a.length-1){const t=ft.createElementNS(Ds,"span");return t.setAttribute("class","apexcharts-breadcrumb-item apexcharts-breadcrumb-current"),t.setAttribute("aria-current","page"),t.textContent=String(l),void r.appendChild(t)}const h=ft.createElementNS(Ds,"button");if(h.setAttribute("type","button"),h.setAttribute("class","apexcharts-breadcrumb-item"),0===i){const t=ft.createElementNS(Ds,"span");t.setAttribute("class","apexcharts-breadcrumb-arrow"),t.setAttribute("aria-hidden","true"),t.textContent="\u2190",h.appendChild(t)}const c=ft.createElementNS(Ds,"span");c.setAttribute("class","apexcharts-breadcrumb-label"),c.textContent=String(l),h.appendChild(c),h.addEventListener("click",s=>e.onNavigate(i,t,s)),r.appendChild(h)}),i.appendChild(r),r}(t,{ariaLabel:"Treemap breadcrumb",config:this._breadcrumbCfg(),compact:!0,crumbs:[{label:"All",data:null}].concat(e.map(t=>({label:t.name,data:t}))),onNavigate:(t,e,i)=>{this._refocus(e.data?e.data._key:null,!i.detail)}});i&&(this._placeBreadcrumb(i),function(t,e){const i=[".apexcharts-title-text",".apexcharts-subtitle-text"].map(e=>t.dom.baseEl.querySelector(e)).filter(t=>null!==t);if(!i.length)return;const s=t.dom.elWrap.getBoundingClientRect().top;for(let t=0;t<i.length+1;t++){const t=e.getBoundingClientRect(),a=i.find(e=>{const i=e.getBoundingClientRect();return t.left<i.right&&t.right>i.left&&t.top<i.bottom&&t.bottom>i.top});if(!a)break;e.style.top=a.getBoundingClientRect().bottom-s+4+"px"}}(t,i))}_placeBreadcrumb(t){var e,i;const s=this.w,a=s.layout.translateY||0,r=null==(i=null==(e=this.ctx)?void 0:e.dimensions)?void 0:i.dimHelpers,n=r?r.getTitleSubtitleCoords("title").height+r.getTitleSubtitleCoords("subtitle").height:0,o=t.getBoundingClientRect().height||18,l=this._breadcrumbCfg().offsetY||0;if(a-n>=o+1)return void(t.style.top=`${a-o-1+l}px`);t.style.top=`${n+l}px`;const h="dark"===s.config.theme.mode;t.style.background=h?"rgba(20,24,30,0.82)":"rgba(255,255,255,0.86)",t.style.borderRadius="4px"}_showParentTooltip(t,e){var i;const s=this.w,a=this._tip();if(!a)return;const r=this._drawnTotal(),n=e._parent?this._subtreeArea(e._parent):r,o=r>0?(e._area/r*100).toFixed(1):"0.0",l=n>0?(e._area/n*100).toFixed(1):o,h=this.w.config.plotOptions.treemap.parents,c=this._countLeaves(e);let d=h&&h.tooltip&&h.tooltip.formatter;"function"!=typeof d&&(d=s.config.tooltip.custom);let u=null==(i=Array.isArray(d)?d[e._si]:d)?void 0:i({name:e.name,value:e._area,depth:e.depth||0,leafCount:c,percentOfParent:+l,percentOfTotal:+o,node:e,w:s,series:s.seriesData.series,seriesIndex:e._si,dataPointIndex:-1,ctx:this.ctx});if(null==u||!1===u){const t=this._parentChrome(e.depth||0).headerBg;u=`<div class="apexcharts-tooltip-series-group apexcharts-active" style="display:flex;${s.config.tooltip.fillSeriesColor?`background-color:${t};`:""}"><div class="apexcharts-tooltip-text"><div class="apexcharts-tooltip-y-group"><span class="apexcharts-tooltip-text-y-label">${function(t,e=t){const i=String(null!=t?t:""),s=e===i?"":e===i+": "?": ":null;return null===s?e:i.replace(/&/g,"&").replace(/</g,"<")+s}(e.name)}: </span><span class="apexcharts-tooltip-text-y-value">${this._formatValue(e._area,e._si)}</span></div><div class="apexcharts-tooltip-y-group"><span class="apexcharts-tooltip-text-y-label">${c} items, </span><span class="apexcharts-tooltip-text-y-value">${l}% of parent, ${o}% of total</span></div></div></div>`}(null==u?void 0:u.nodeName)?a.replaceChildren(u.cloneNode(!0)):a.innerHTML=u,a.classList.add("apexcharts-active"),a.removeAttribute("aria-hidden"),this._positionTooltip(t)}_tip(){const t=this.w.dom.elWrap;let e=this._tooltipEl;if(!(null==e?void 0:e.isConnected)){e=t.querySelector(".apexcharts-treemap-tooltip");const i=!e&&t.querySelector(".apexcharts-tooltip");i&&(e=i.cloneNode(!1),e.classList.add("apexcharts-treemap-tooltip"),t.appendChild(e)),this._tooltipEl=e}return e}_positionTooltip(t){const e=this._tip();if(!e)return;const i=this.w.dom.elWrap.getBoundingClientRect(),s=e.offsetWidth,a=e.offsetHeight;let r=t.clientX-i.left+12;r+s>i.width&&(r=t.clientX-i.left-s-12),r=Math.max(0,Math.min(r,i.width-s));let n=t.clientY-i.top+12;n+a>i.height&&(n=t.clientY-i.top-a-12),n=Math.max(0,Math.min(n,i.height-a)),e.style.left=r+"px",e.style.top=n+"px"}_hideParentTooltip(){const t=this._tooltipEl;null==t||t.classList.remove("apexcharts-active"),null==t||t.setAttribute("aria-hidden","true")}_drawnTotal(){return null==this._total&&(this._total=(this.drawn||[]).reduce((t,e)=>t+this._subtreeArea(e),0)),this._total||0}_subtreeArea(t){if(null!=t._area)return t._area;const e=t.children;if(e&&e.length){let t=0;for(let i=0;i<e.length;i++)t+=this._subtreeArea(e[i]);return t}const i=Number(t.value);return isNaN(i)?0:Math.abs(i)}_countLeaves(t){return t.children&&t.children.length?t.children.reduce((t,e)=>t+this._countLeaves(e),0):1}_formatValue(t,e){var i,s,a,r,n;const o=this.w,l=(null==(s=null==(i=o.config.tooltip)?void 0:i.y)?void 0:s.formatter)||(null==(n=null==(r=null==(a=o.config.yaxis)?void 0:a[0])?void 0:r.labels)?void 0:n.formatter);if("function"==typeof l)try{return String(l(t,{seriesIndex:e||0,dataPointIndex:-1,w:o}))}catch(t){}return String(t)}_labelCanShow(t,e,i){if(!Number.isFinite(t)||t<=0)return!1;const s=this.w.config.plotOptions.treemap.dataLabels;return!(t<(s&&null!=s.minFontSize?Number(s.minFontSize):0))&&Math.max(e,i)>=t}_averageLabelSize(){if(null!=this._avgLabelSize)return this._avgLabelSize;const t=this.labels.flat();let e=0;for(const i of t)e+=String(null!=i?i:"").length;return this._avgLabelSize=e/(t.length||1),this._avgLabelSize}getFontSize(t){const e=this.w,i=this._averageLabelSize();return function(t,s){const a=t*s,r=Math.pow(a,.5);return Math.min(r/i,parseInt(e.config.dataLabels.style.fontSize,10))}(t[2]-t[0],t[3]-t[1])}rotateToFitLabel(t,e,i,s,a,r,n){const o=this._labelRect(new R(this.w),i,e),l=t.node.querySelector("text");if(l&&o.width+this.w.config.stroke.width+5>r-s&&o.width<=n-a){const e=l.getAttribute("text-anchor"),i=+l.getAttribute("x")+(("start"===e)-("end"===e))*o.width/2,s=+l.getAttribute("y")+o.centerOffset;t.node.setAttribute("transform",`rotate(-90 ${i} ${s}) translate(${o.height/3})`)}}_labelRect(t,e,i){const s=this.w.config.dataLabels.style;return t.getTextRects(e,String(i),s.fontFamily,"",!0,s.fontWeight)}truncateLabels(t,e,i,s,a,r){const n=new R(this.w),h=this._labelRect(n,t,e).width+this.w.config.stroke.width+5>a-i&&r-s>a-i?r-s:a-i,c=n.getTextBasedOnMaxWidth(l(o({},this.w.config.dataLabels.style),{text:t,maxWidth:h,fontSize:e}));return t.length!==c.length&&h/e<5?"":c}_morphKeyed(){var t,e;const i=null==(t=this.ctx)?void 0:t.morphTypeChange;return null!=(e=this._keyed)?e:this._keyed=!(!i||"function"!=typeof i.hasKeyedMarks||!i.hasKeyedMarks()||"function"!=typeof i.getInitialPathForKey)}_morphSourceForLeaf(t){var e;const i=null==(e=this.ctx)?void 0:e.morphTypeChange;if(!i||"function"!=typeof i.getInitialPathAt)return null;if(this._morphKeyed()){const e=i.getInitialPathForKey(Es(t._key));if(e)return e}return i.getInitialPathAt(this._morphLeafIndex++)}_tilePath(t,e,i,s){return`M ${t} ${e} L ${i} ${e} L ${i} ${s} L ${t} ${s} Z`}_morphTile(t,e,i,s,a,r){new u(this.w,this.ctx).morphSVG(t,a,r,"none",e,i,s,0)}_rideTile(t,e,i,s,a,r,n,o=!e){const l=t.getAttribute("transform")||"",h=e?e.x-(i+a)/2:0,c=e?e.y-(s+r)/2:0,d=e=>{if(e>=1)return l?t.setAttribute("transform",l):t.removeAttribute("transform"),void t.removeAttribute("opacity");const i=1-e;t.setAttribute("transform",`translate(${h*i} ${c*i}) ${l}`.trim()),o&&t.setAttribute("opacity",String(e))};d(0),n.during(d)}animateTreemap(t,e,i,s,a=0){const r=new u(this.w);return r.animateRect(t,e,i,s,()=>{r.animationCompleted(t)},a)}}}),Object.prototype.hasOwnProperty.call(c.default,"__internals")||Object.defineProperty(c.default,"__internals",{value:Ut,enumerable:!1,writable:!1,configurable:!1}),function(t){Object.prototype.hasOwnProperty.call(t,"__drainsAddons")||Object.defineProperty(t,"__drainsAddons",{value:!0});const e=globalThis,i=()=>{var t;const i=e.__apexcharts_pending_addons__;if(!Array.isArray(i)||!i.length)return;if(!e.ApexCharts||!e.ApexCharts.__internals)return;const s=i.splice(0);for(const t of s)t.done=!0;for(const i of s)try{i.run.call(e)}catch(s){e.console.error(`ApexCharts: ${i.file}, loaded before the ApexCharts script, failed to register: ${null!=(t=null==s?void 0:s.message)?t:s}`)}};"function"==typeof queueMicrotask?queueMicrotask(i):Promise.resolve().then(i)}(c.default),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>c.default});
|