apexcharts 8.2.0 → 8.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/dist/apexcharts.common.js +2 -2
- package/dist/apexcharts.core.js +271 -173
- package/dist/apexcharts.core.min.js +2 -2
- package/dist/apexcharts.css +35 -0
- package/dist/apexcharts.esm.js +1722 -1527
- package/dist/apexcharts.full.js +1459 -1075
- package/dist/apexcharts.full.min.js +2 -2
- package/dist/apexcharts.js +994 -715
- package/dist/apexcharts.min.js +2 -2
- package/dist/apexcharts.ssr.common.js +2 -2
- package/dist/apexcharts.ssr.esm.js +994 -715
- package/dist/area.common.js +2 -2
- package/dist/area.esm.js +91 -40
- package/dist/bar.common.js +2 -2
- package/dist/bar.esm.js +433 -394
- package/dist/bar.js +2 -2
- package/dist/boxPlot.common.js +2 -2
- package/dist/boxPlot.esm.js +364 -322
- package/dist/bubble.common.js +2 -2
- package/dist/bubble.esm.js +91 -40
- package/dist/candlestick.common.js +2 -2
- package/dist/candlestick.esm.js +364 -322
- package/dist/candlestick.js +2 -2
- package/dist/column.common.js +2 -2
- package/dist/column.esm.js +433 -394
- package/dist/core.common.js +2 -2
- package/dist/core.esm.js +271 -173
- package/dist/donut.common.js +1 -1
- package/dist/donut.esm.js +1 -1
- package/dist/dumbbell.common.js +2 -2
- package/dist/dumbbell.esm.js +433 -394
- package/dist/features/all.common.js +2 -2
- package/dist/features/all.esm.js +250 -187
- package/dist/features/annotations.common.js +1 -1
- package/dist/features/annotations.esm.js +1 -1
- package/dist/features/annotations.js +1 -1
- package/dist/features/context-menu.common.js +1 -1
- package/dist/features/context-menu.esm.js +1 -1
- package/dist/features/context-menu.js +1 -1
- package/dist/features/drilldown.common.js +2 -2
- package/dist/features/drilldown.esm.js +4 -2
- package/dist/features/drilldown.js +2 -2
- package/dist/features/dumbbell.common.js +1 -1
- package/dist/features/dumbbell.esm.js +1 -1
- package/dist/features/dumbbell.js +1 -1
- package/dist/features/exports.common.js +1 -1
- package/dist/features/exports.esm.js +1 -1
- package/dist/features/exports.js +1 -1
- package/dist/features/facet.common.js +1 -1
- package/dist/features/facet.esm.js +1 -1
- package/dist/features/facet.js +1 -1
- package/dist/features/highlight-filter.common.js +2 -2
- package/dist/features/highlight-filter.esm.js +14 -9
- package/dist/features/highlight-filter.js +2 -2
- package/dist/features/history.common.js +1 -1
- package/dist/features/history.esm.js +1 -1
- package/dist/features/history.js +1 -1
- package/dist/features/ink.common.js +1 -1
- package/dist/features/ink.esm.js +1 -1
- package/dist/features/ink.js +1 -1
- package/dist/features/keyboard.common.js +2 -2
- package/dist/features/keyboard.esm.js +97 -145
- package/dist/features/keyboard.js +2 -2
- package/dist/features/legend.common.js +2 -2
- package/dist/features/legend.esm.js +63 -43
- package/dist/features/legend.js +2 -2
- package/dist/features/link.common.js +1 -1
- package/dist/features/link.esm.js +1 -1
- package/dist/features/link.js +1 -1
- package/dist/features/marks.common.js +1 -1
- package/dist/features/marks.esm.js +1 -1
- package/dist/features/marks.js +1 -1
- package/dist/features/measure.common.js +1 -1
- package/dist/features/measure.esm.js +1 -1
- package/dist/features/measure.js +1 -1
- package/dist/features/morph.common.js +1 -1
- package/dist/features/morph.esm.js +1 -1
- package/dist/features/morph.js +1 -1
- package/dist/features/perspectives.common.js +1 -1
- package/dist/features/perspectives.esm.js +1 -1
- package/dist/features/perspectives.js +1 -1
- package/dist/features/raincloud.common.js +1 -1
- package/dist/features/raincloud.esm.js +1 -1
- package/dist/features/raincloud.js +1 -1
- package/dist/features/renderer-canvas.common.js +2 -2
- package/dist/features/renderer-canvas.esm.js +2 -1
- package/dist/features/renderer-canvas.js +2 -2
- package/dist/features/stats.common.js +1 -1
- package/dist/features/stats.esm.js +1 -1
- package/dist/features/stats.js +1 -1
- package/dist/features/storyboard.common.js +1 -1
- package/dist/features/storyboard.esm.js +1 -1
- package/dist/features/storyboard.js +1 -1
- package/dist/features/streamgraph.common.js +2 -2
- package/dist/features/streamgraph.esm.js +3 -2
- package/dist/features/streamgraph.js +2 -2
- package/dist/features/toolbar.common.js +2 -2
- package/dist/features/toolbar.esm.js +92 -2
- package/dist/features/toolbar.js +2 -2
- package/dist/features/trellis.common.js +2 -2
- package/dist/features/trellis.esm.js +83 -47
- package/dist/features/trellis.js +2 -2
- package/dist/features/waterfall.common.js +1 -1
- package/dist/features/waterfall.esm.js +1 -1
- package/dist/features/waterfall.js +1 -1
- package/dist/features/weave.common.js +1 -1
- package/dist/features/weave.esm.js +1 -1
- package/dist/features/weave.js +1 -1
- package/dist/full.common.js +2 -2
- package/dist/full.esm.js +950 -795
- package/dist/heatmap.common.js +2 -2
- package/dist/heatmap.esm.js +3 -17
- package/dist/heatmap.js +2 -2
- package/dist/histogram.common.js +2 -2
- package/dist/histogram.esm.js +433 -394
- package/dist/icicle.common.js +2 -2
- package/dist/icicle.esm.js +54 -38
- package/dist/icicle.js +2 -2
- package/dist/line.common.js +2 -2
- package/dist/line.esm.js +91 -40
- package/dist/line.js +2 -2
- package/dist/locales/en.json +2 -1
- package/dist/locales/ro.json +3 -2
- package/dist/pictograms.common.js +1 -1
- package/dist/pictograms.esm.js +1 -1
- package/dist/pictograms.js +1 -1
- package/dist/pie.common.js +1 -1
- package/dist/pie.esm.js +1 -1
- package/dist/pie.js +1 -1
- package/dist/polarArea.common.js +1 -1
- package/dist/polarArea.esm.js +1 -1
- package/dist/radar.common.js +2 -2
- package/dist/radar.esm.js +5 -4
- package/dist/radar.js +2 -2
- package/dist/radialBar.common.js +1 -1
- package/dist/radialBar.esm.js +1 -1
- package/dist/radialBar.js +1 -1
- package/dist/raincloud.common.js +2 -2
- package/dist/raincloud.esm.js +72 -26
- package/dist/rangeArea.common.js +2 -2
- package/dist/rangeArea.esm.js +91 -40
- package/dist/rangeBar.common.js +2 -2
- package/dist/rangeBar.esm.js +433 -394
- package/dist/scatter.common.js +2 -2
- package/dist/scatter.esm.js +91 -40
- package/dist/streamgraph.common.js +2 -2
- package/dist/streamgraph.esm.js +93 -41
- package/dist/sunburst.common.js +2 -2
- package/dist/sunburst.esm.js +103 -93
- package/dist/sunburst.js +2 -2
- package/dist/treemap.common.js +2 -2
- package/dist/treemap.esm.js +105 -86
- package/dist/treemap.js +2 -2
- package/dist/unit-shapes.common.js +1 -1
- package/dist/unit-shapes.esm.js +1 -1
- package/dist/unit-shapes.js +1 -1
- package/dist/unit.common.js +2 -2
- package/dist/unit.esm.js +280 -202
- package/dist/unit.js +2 -2
- package/dist/violin.common.js +2 -2
- package/dist/violin.esm.js +72 -26
- package/dist/violin.js +2 -2
- package/dist/waterfall.common.js +2 -2
- package/dist/waterfall.esm.js +432 -393
- package/package.json +1 -1
- package/src/apexcharts.js +13 -6
- package/src/assets/apexcharts.css +35 -0
- package/src/charts/Bar.js +62 -55
- package/src/charts/BarStacked.js +80 -88
- package/src/charts/BoxCandleStick.js +28 -31
- package/src/charts/Icicle.js +37 -37
- package/src/charts/Line.js +118 -42
- package/src/charts/Radar.js +5 -7
- package/src/charts/RangeBar.js +47 -43
- package/src/charts/Sunburst.js +101 -98
- package/src/charts/Treemap.js +108 -66
- package/src/charts/Unit.js +368 -250
- package/src/charts/Violin.js +48 -30
- package/src/charts/common/Breadcrumb.js +2 -2
- package/src/charts/common/Hierarchy.js +32 -11
- package/src/charts/common/Jitter.js +32 -7
- package/src/charts/common/bar/DataLabels.js +76 -81
- package/src/charts/common/bar/Helpers.js +43 -7
- package/src/charts/common/line/Helpers.js +12 -15
- package/src/charts/common/partition/NodeTooltip.js +8 -1
- package/src/charts/common/partition/Partition.js +33 -1
- package/src/charts/common/treemap/Helpers.js +3 -11
- package/src/locales/en.json +2 -1
- package/src/locales/ro.json +3 -2
- package/src/modules/Core.js +4 -0
- package/src/modules/CoreUtils.js +18 -42
- package/src/modules/Data.js +23 -24
- package/src/modules/DataLabels.js +6 -6
- package/src/modules/Graphics.js +62 -49
- package/src/modules/Markers.js +3 -1
- package/src/modules/Range.js +44 -29
- package/src/modules/RendererController.js +17 -3
- package/src/modules/Scales.js +32 -9
- package/src/modules/Series.js +39 -18
- package/src/modules/Theme.js +1 -1
- package/src/modules/ZoomPanSelection.js +119 -2
- package/src/modules/accessibility/KeyboardNavigation.js +114 -186
- package/src/modules/animations/LengthTransition.js +22 -2
- package/src/modules/drilldown/Breadcrumb.js +5 -2
- package/src/modules/helpers/Destroy.js +1 -1
- package/src/modules/highlightFilter/HighlightFilter.js +8 -9
- package/src/modules/highlightFilter/TreemapPart.js +2 -2
- package/src/modules/legend/HeatmapGradientLegend.js +76 -45
- package/src/modules/legend/Helpers.js +2 -0
- package/src/modules/legend/Legend.js +11 -12
- package/src/modules/settings/Options.js +7 -0
- package/src/modules/streamgraph/StreamLabels.js +1 -0
- package/src/modules/tooltip/Tooltip.js +20 -4
- package/src/modules/tooltip/Utils.js +8 -0
- package/src/modules/trellis/Trellis.js +6 -0
- package/src/modules/trellis/TrellisChrome.js +18 -7
- package/src/modules/trellis/TrellisSync.js +2 -0
- package/src/renderers/canvas/CanvasGraphics.js +1 -0
- package/src/ssr/DOMShim.js +10 -0
- package/src/types/internal.d.ts +9 -3
- package/types/apexcharts.d.ts +31 -12
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v8.
|
|
2
|
+
* ApexCharts v8.3.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
|
-
"use strict";var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,a=(e,i,s)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s,l=(t,e)=>{for(var i in e||(e={}))n.call(e,i)&&a(t,i,e[i]);if(s)for(var i of s(e))o.call(e,i)&&a(t,i,e[i]);return t},r=(t,s)=>e(t,i(s));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function c(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 h=c(require("apexcharts/core")),d=h.__apex_Graphics,u=h.__apex_axes_AxesUtils,m=h.__apex_Series,g=h.__apex_Utils,p=h.__apex_Environment_Environment,x=h.__apex_BrowserAPIs_BrowserAPIs,f=h.__apex_math_SVGNS;class b{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 n=i[t],o=document.createElementNS(f,"image");o.setAttribute("x",n.getAttribute("x")||"0"),o.setAttribute("y",n.getAttribute("y")||"0"),o.setAttribute("width",n.getAttribute("width")||"0"),o.setAttribute("height",n.getAttribute("height")||"0"),o.setAttribute("href",s),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s),n.parentNode&&n.parentNode.replaceChild(o,n)}}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(!p.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=x.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(!p.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 n=s[1].trim().replace(/^['"]|['"]$/g,"");t.push({family:n.toLowerCase(),css:e,base:i})})},s=(t,e)=>{Array.from(t).forEach(t=>{5===t.type?t.cssText&&i(t.cssText,e):t.styleSheet?n(t.styleSheet):t.cssRules&&s(t.cssRules,e)})},n=t=>{let n=null;try{n=t.cssRules}catch(t){}n?s(n,t.href||document.baseURI):t.href&&e.push(fetch(t.href).then(t=>t.ok?t.text():"").then(e=>i(e,t.href)).catch(()=>{}))};return Array.from(document.styleSheets||[]).forEach(n),Promise.all(e).then(()=>t)}embedFonts(t){const e=this.w;if(!p.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(f,"style");s.textContent=i,t.insertBefore(s,t.firstChild)}).catch(()=>{}):Promise.resolve()}inlineFontFaceUrls(t,e){const i=[],s=/url\(\s*(['"]?)([^'")]+)\1\s*\)/gi;let n;for(;null!==(n=s.exec(t));)n[2].startsWith("data:")||i.push(n[2]);return i.length?Promise.all(i.map(t=>this.fetchAsDataUri(e?new URL(t,e).href:t).then(e=>({url:t,dataUri:e})).catch(()=>({url:t,dataUri:null})))).then(e=>{let i=t,s=0;return e.forEach(({url:t,dataUri:e})=>{e&&(i=i.split(t).join(e),s++)}),s?i:null}):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,n;const o=this.w;let a=t||o.config.chart.toolbar.export.scale||o.config.chart.toolbar.export.width/o.globals.svgWidth;a||(a=1);const l=o.globals.svgWidth*a,r=o.globals.svgHeight*a;null==(i=o.globals.layoutTween)||i.finish(),null==(s=o.globals.circleTween)||s.finish(),null==(n=o.globals.highlightTween)||n.finish(),[...o.globals.chromeTweens||[]].forEach(t=>t());const c=o.dom.elWrap.cloneNode(!0);c.style.width=l+"px",c.style.height=r+"px",this.inlineCanvasLayers(c),this.applyExportStyles(c);const h=(new XMLSerializer).serializeToString(c);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="${o.globals.svgWidth}px" height="${o.globals.svgHeight}px">\n <foreignObject width="100%" height="100%">\n <div xmlns="http://www.w3.org/1999/xhtml" style="width:${l}px; height:${r}px;">\n ${h}\n </div>\n </foreignObject>\n </svg>\n `;const u=this.svgStringToNode(d);1!==a&&this.scaleSvgNode(u,a),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"),n=i||s;if(!n||n.startsWith("data:"))return Promise.resolve();const o=n=>{i&&t.setAttributeNS(e,"href",n),!s&&i||t.setAttribute("href",n)};return this.fetchAsDataUri(n).then(o).catch(()=>this.getBase64FromUrl(n).then(o).catch(t=>{console.error("Error converting image to base64:",t)}))});return Promise.all(s)}getBase64FromUrl(t){return p.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 p.isSSR()?Promise.resolve({imgURI:""}):new Promise(e=>{const i=this.w,s=()=>{console.warn("ApexCharts: the PNG export could not be rendered"),e({imgURI:""})},n=t?t.scale||t.width/i.globals.svgWidth:1,o=document.createElement("canvas");o.width=i.globals.svgWidth*n,o.height=parseInt(i.dom.elWrap.style.height,10)*n;const a=this.resolveExportBackground(),l=o.getContext("2d");if(!l)return s();l.fillStyle=a,l.fillRect(0,0,o.width,o.height),this.getSvgString(n).then(t=>{const i="data:image/svg+xml,"+encodeURIComponent(t),n=new Image;n.crossOrigin="anonymous",n.onload=()=>{try{l.drawImage(n,0,0);const t=o;if(t.msToBlob){const i=t.msToBlob();e({blob:i})}else{const t=o.toDataURL("image/png");e({imgURI:t})}}catch(t){s()}},n.onerror=s,n.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 n=this.w,o=n.globals,a=n.config.chart.toolbar.export.csv,l=!t&&(o.streamgraphRawSeries||o.waterfallRawSeries||o.dumbbellRawSeries);t||(t=l||n.config.series);const r=new Set(l&&l===o.dumbbellRawSeries?n.dumbbellData.hidden:o.collapsedSeriesIndices),c=[],h=[],d="datetime"===n.config.xaxis.type,p=n.config.xaxis.labels.datetimeUTC,x=t=>{if(null==t||g.isNumber(t))return t;const e=String(t);return/^[=+\-@\t\r]/.test(e)&&isNaN(+e)?`'${e}`:e},f=t=>d&&String(t).length>=10&&!isNaN(new Date(t).getTime()),b=(t,e)=>{const i=new Date(t);if(p||i.setTime(i.getTime()-6e4*i.getTimezoneOffset()),e)return i.toISOString().slice(0,23).replace("T"," ").replace(".000","");const[s,n,o,a]=i.toUTCString().split(" ");return`${s.slice(0,3)} ${o} ${n} ${a}`},y=(t,e)=>"function"==typeof a.categoryFormatter?a.categoryFormatter(t):null==t?"":f(t)?b(t,e):g.isNumber(t)?t:x(String(t).split(i).join("")),w=t=>"function"==typeof a.valueFormatter?a.valueFormatter(t):x(t),v=new u(this.w,{theme:this.ctx.theme,timeScale:this.ctx.timeScale}),S=t=>{let e="";if(o.axisCharts){if("category"===n.config.xaxis.type||n.config.xaxis.convertedCatToNumeric)if(o.isBarHorizontal){const i=n.formatters.yLabelFormatters[0],s=new m(this.ctx.w).getActiveConfigSeriesIndex();e=i(n.labelData.labels[t],{seriesIndex:s,dataPointIndex:t,w:n})}else e=v.getLabel(n.labelData.labels,n.labelData.timescaleLabels,0,t).text;d&&(n.config.xaxis.categories.length?e=n.config.xaxis.categories[t]:n.config.labels.length&&(e=n.config.labels[t]))}else e=n.config.labels[t];return Array.isArray(e)?e.join(" "):e},M=n.candleData,R=n.rangeData,_=n.violinData,E=t.length>1,X=t.map((t,e)=>{const s=l?"":t.type||n.config.chart.type,o="candlestick"===s?{open:M.seriesCandleO,high:M.seriesCandleH,low:M.seriesCandleL,close:M.seriesCandleC}:"boxPlot"===s?{minimum:M.seriesCandleO,q1:M.seriesCandleH,median:M.seriesCandleM,q3:M.seriesCandleL,maximum:M.seriesCandleC}:"rangeBar"===s||"rangeArea"===s?{minimum:R.seriesRangeStart,maximum:R.seriesRangeEnd}:"violin"===s?{minimum:_.seriesViolinMin,maximum:_.seriesViolinMax,observations:_.seriesViolinPoints}:null,a=String(t.name||`series-${e}`).split(i).join("")||`series-${e}`,c=o?Object.keys(o):[a];return{head:o&&E?c.map(t=>`${a} ${t}`):c,cells:i=>{var s;const n=r.has(e);if(!o){const e=n||null==(s=t.data)?void 0:s[i];return[w(e&&"object"==typeof e?Array.isArray(e)?e[1]:e.y:e)]}return Object.values(o).map(t=>{var s;const o=n||null==(s=null==t?void 0:t[e])?void 0:s[i];return w(Array.isArray(o)?o.length:o)})}}});if(o.axisCharts)if(c.push([a.headerCategory,...X.flatMap(t=>t.head)].join(i)),o.allSeriesHasEqualX||n.config.xaxis.categories.length||n.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=S(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}h.push([e,...X.flatMap(t=>t.cells(i))])}}}else{const e=new Map;t.forEach((t,i)=>{var s;null==(s=null==t?void 0:t.data)||s.forEach((t,s)=>{if(!t||"object"!=typeof t)return;const n=Array.isArray(t)?t[0]:t.x,o=String(n);let a=e.get(o);a||(a={cat:n,values:X.map(t=>t.head.map(()=>""))},e.set(o,a)),a.values[i]=X[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?n.axisFlags.isXNumeric?t.cat<e.cat?-1:1:0:t.cat-e.cat}).forEach(({cat:t,values:e})=>h.push([t,...e.flat()]))}else c.push([a.headerCategory,a.headerValue].join(i)),t.forEach((t,e)=>{c.push([y(n.labelData.labels[e]),w(r.has(e)?"":n.seriesData.series[e])].join(i))});const P=h.map(t=>t[0]).filter(f),A=new Set(P.map(t=>b(t))).size<P.length;h.forEach(t=>c.push([y(t[0],A),...t.slice(1)].join(i))),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\ufeff"+c.join(s)),e||a.filename,".csv")}triggerDownload(t,e,i){if(p.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)}}class y{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 n=this.w,o=!!t.resetOnly,a=()=>x.createElementNS("http://www.w3.org/1999/xhtml","div"),c=()=>{const t=x.createElementNS("http://www.w3.org/1999/xhtml","button");return t.setAttribute("type","button"),t},h=a();if(h.setAttribute("class","apexcharts-toolbar"),h.style.top=n.config.chart.toolbar.offsetY+"px",h.style.right=3-n.config.chart.toolbar.offsetX+"px",n.dom.elWrap.appendChild(h),this.elZoom=c(),this.elZoomIn=c(),this.elZoomOut=c(),this.elPan=c(),this.elSelection=c(),this.elMeasure=c(),this.elZoomReset=c(),this.elMenuIcon=c(),this.elMenu=a(),this.elCustomIcons=[],this.t=n.config.chart.toolbar.tools,this._drawnForZoom=null,o?(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=r(l({},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(c());const u=[],m=(t,e,i)=>{const s=t.toLowerCase();this.t[s]&&n.config.chart.zoom.enabled&&u.push({el:e,icon:"string"==typeof this.t[s]?this.t[s]:i,title:this.localeValues[t],class:`apexcharts-${s}-icon`})};m("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'),m("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]&&n.config.chart[t].enabled&&u.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&&n.config.chart.zoom.enabled&&u.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&&n.config.chart.measure&&n.config.chart.measure.enabled&&u.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"}),m("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&&u.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++)u.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});u.forEach((t,e)=>{t.index&&g.moveIndexInArray(u,e,t.index)});for(let t=0;t<u.length;t++)d.setAttrs(u[t].el,{class:u[t].class,title:u[t].title,"aria-label":u[t].title}),u[t].el.innerHTML=u[t].icon,h.appendChild(u[t].el);this.elZoom.parentNode&&this.elZoom.setAttribute("aria-pressed",String(!!n.interact.zoomEnabled)),this.elSelection.parentNode&&this.elSelection.setAttribute("aria-pressed",String(!!n.interact.selectionEnabled)),this.elPan.parentNode&&this.elPan.setAttribute("aria-pressed",String(!!n.interact.panEnabled)),this.elMeasure.parentNode&&this.elMeasure.setAttribute("aria-pressed",String(!!n.interact.measureEnabled)),this.elMenuIcon.parentNode&&(this.elMenuIcon.setAttribute("aria-haspopup","true"),this.elMenuIcon.setAttribute("aria-expanded","false")),o||this._createHamburgerMenu(h),o?null==(e=this.elZoomReset)||e.addEventListener("click",this.handleZoomReset.bind(this)):(n.interact.zoomEnabled?this.elZoom.classList.add(this.selectedClass):n.interact.panEnabled?this.elPan.classList.add(this.selectedClass):n.interact.selectionEnabled?this.elSelection.classList.add(this.selectedClass):n.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),d.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(x.createElementNS("http://www.w3.org/1999/xhtml","div")),this.elMenuItems[t].innerHTML=e[t].title,d.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,n,o,a,l,r;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==(n=this.elZoomOut)||n.addEventListener("click",this.handleZoomOut.bind(this)),null==(o=this.elPan)||o.addEventListener("click",this.togglePanning.bind(this)),null==(a=this.elMeasure)||a.addEventListener("click",this.toggleMeasure.bind(this)),null==(l=this.elMenuIcon)||l.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==(r=this.elMenuIcon)||r.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",n=!!e.w.interact[s];i.toggleOtherControls();const o="selection"===t?i.elSelection:i.elZoom;n||(e.w.interact[s]=!0,null==o||o.classList.add(i.selectedClass)),null==o||o.setAttribute("aria-pressed",String(!!e.w.interact[s]))})}toggleMeasure(){var t,e,i,s;const n=this.w,o=!n.interact.measureEnabled;this.toggleOtherControls(),o&&(n.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(n.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,n=!!t.w.interact.panEnabled;s.toggleOtherControls(),n||(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,n=(e+s)/2,o=(i+s)/2,a=this._getNewMinXMaxX(n,o);t.interact.disableZoomIn||this.zoomUpdateOptions(a.minX,a.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,n=e-(s-e),o=i-(s-i),a=this._getNewMinXMaxX(n,o);t.interact.disableZoomOut||this.zoomUpdateOptions(a.minX,a.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 n=this.getBeforeZoomRange(s,void 0);n&&(s=n.xaxis);const o={xaxis:s};if(!i.globals.initialConfig)return;const a=g.clone(i.globals.initialConfig.yaxis);i.config.chart.group||(o.yaxis=a),this.w.interact.zoomed=!0,this.ctx.updateHelpers._updateOptions(o,!1,this.w.config.chart.animations.dynamicAnimation.enabled),this.zoomCallback(s,a)}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 b(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(g.clone(i.globals.initialSeries));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 w{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)/w.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*w.xRatio(t)}static screenXToPlotPx(t,e){const i=t.dom.baseEl,s=i&&i.querySelector(".apexcharts-svg");if(!s)return e-t.layout.translateX;const n=s.getBoundingClientRect(),o=t.globals.svgWidth?n.width/t.globals.svgWidth:1;return(e-n.left)/(o||1)-t.layout.translateX}}const v=h.__apex_tooltip_Utils,S=h.__apex_index_Box;h.default.registerFeatures({toolbar:y,zoomPanSelection:class extends y{constructor(t,e){super(t,e),this.w=t,this.ctx=e,this.dragged=!1,this.graphics=new d(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 S(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 n=i.interact.zoomEnabled?i.config.chart.zoom.type:i.config.chart.selection.type,o=i.config.chart.toolbar.autoSelected;if("measure"!==o&&(e.shiftKey?(i.interact.shiftWasPressed=!0,s.enableZoomPanFromToolbar("pan"===o?"zoom":"pan")):i.interact.shiftWasPressed&&(s.enableZoomPanFromToolbar(o),i.interact.shiftWasPressed=!1)),!e.target)return;const a=e.target.classList;let l;e.target.parentNode&&null!==e.target.parentNode&&(l=e.target.parentNode.classList);if(!(a.contains("apexcharts-legend-marker")||a.contains("apexcharts-legend-text")||l&&l.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:n,xyRatios:this.xyRatios})):(this.w.interact.mousedown&&i.interact.zoomEnabled||this.w.interact.mousedown&&i.interact.selectionEnabled)&&(this.selection=this.selectionDrawing({context:this,zoomtype:n}))),"mouseup"!==e.type&&"touchend"!==e.type&&"mouseleave"!==e.type||this.handleMouseUp({zoomtype:n}),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 n=this.w.config.chart;return!(!n.zoom||!n.zoom.enabled)&&("auto"!==t?!!t:!(!(null==(e=n.toolbar)?void 0:e.show)||!(null==(s=null==(i=n.toolbar)?void 0:i.tools)?void 0:s.reset)))}_wheelZoomEnabled(){const{zoom:t}=this.w.config.chart;return this._incidentalZoomEnabled(t&&t.allowMouseWheelZoom)}_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){t.preventDefault();const e=this._wheel();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:n,max:o}=this._currentXWindow(),a=o-n,l=Math.min(Math.max(this._screenXToPlotPx(e.clientX)/s,0),1);let r=a*i;const c=this._clampBounds();if(c){const e=t.globals.minXDiff>0&&isFinite(t.globals.minXDiff)?t.globals.minXDiff:0,i=Math.max(2*e,1e-6*(c.max-c.min));r<i&&(r=i),r>c.max-c.min&&(r=c.max-c.min)}let h=n+l*a-l*r,d=h+r;const u=1e-9*a;if(Math.abs(h-n)<u&&Math.abs(d-o)<u)return;if(isNaN(h)||isNaN(d))return;const m=this.getBeforeZoomRange({min:h,max:d},void 0);m&&m.xaxis&&(h=m.xaxis.min,d=m.xaxis.max),this._applyXRange(h,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?g.clone(t.globals.initialConfig.yaxis):[],n=this.ctx.toolbar;n&&n.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,n)=>"l"===n||"r"===n?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(r(l({},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=w.dataXToPx(t,t.config.chart.selection.xaxis.min),s=w.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 n={x:i,y:0,width:s,height:t.layout.gridHeight,translateX:t.layout.translateX,translateY:t.layout.translateY,selectionEnabled:!0};this.drawSelectionRect(n),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:n=0,translateY:o=0}){const a=this.w,l=this.zoomRect,r=this.selectionRect;if(this.dragged||null!==a.interact.selection){const c={transform:"translate("+n+", "+o+")"};a.interact.zoomEnabled&&this.dragged&&(i<0&&(i=1),l.attr({x:t,y:e,width:i,height:s,fill:a.config.chart.zoom.zoomedArea.fill.color,"fill-opacity":a.config.chart.zoom.zoomedArea.fill.opacity,stroke:a.config.chart.zoom.zoomedArea.stroke.color,"stroke-width":a.config.chart.zoom.zoomedArea.stroke.width,"stroke-opacity":a.config.chart.zoom.zoomedArea.stroke.opacity}),d.setAttrs(l.node,c)),a.interact.selectionEnabled&&(r.attr({x:t,y:e,width:i>0?i:0,height:s>0?s:0,fill:a.config.chart.selection.fill.color,"fill-opacity":a.config.chart.selection.fill.opacity,stroke:a.config.chart.selection.stroke.color,"stroke-width":a.config.chart.selection.stroke.width,"stroke-dasharray":a.config.chart.selection.stroke.dashArray,"stroke-opacity":a.config.chart.selection.stroke.opacity}),d.setAttrs(r.node,c))}}_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,n=t=>Math.min(Math.max(t,0),e),o=n(i),a=n(i+s);o===i&&a===i+s||(t.attr({x:o,width:a-o}),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 n=s.startX,o=s.startY;let a=!1,c=!1;const h=this._screenXToPlotPx(s.clientX),d=this._screenYToPlotPx(s.clientY);let u=h-n,m=d-o,g={translateX:i.layout.translateX,translateY:i.layout.translateY};return Math.abs(u+n)>i.layout.gridWidth?u=i.layout.gridWidth-n:h<0&&(u=n),n>h&&(a=!0,u=Math.abs(u)),o>d&&(c=!0,m=Math.abs(m)),g="x"===e?{x:a?n-u:n,y:0,width:u,height:i.layout.gridHeight}:"y"===e?{x:0,y:c?o-m:o,width:i.layout.gridWidth,height:m}:{x:a?n-u:n,y:c?o-m:o,width:u,height:m},g=r(l({},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:n,box:o}=e.detail,a=this.constraints;let{x:l,y:r}=o;l<a.x&&(l=a.x),r<a.y&&(r=a.y),o.x2>a.x2&&(l=a.x2-o.w),o.y2>a.y2&&(r=a.y2-o.h),n.move(l,r);const c=this.selectionRect;let h=0;"resizing"===t&&(h=30);const d=t=>parseFloat(c.node.getAttribute(t)),u={x:d("x"),y:d("y"),width:d("width"),height:d("height")};s.interact.selection=u;const m=s.config.chart.link,g=!(!m||!m.enabled&&"function"!=typeof m.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()},h))}_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 n=this.selectionRect.node.getBoundingClientRect(),o=this.xyRatios;let a,l,r,c;const h=this._screenXToPlotPx(n.left),d=this._screenXToPlotPx(n.right);if(e.axisFlags.isRangeBar)a=e.globals.yAxisScale[0].niceMin+h*o.invertedYRatio,l=e.globals.yAxisScale[0].niceMin+d*o.invertedYRatio,r=0,c=1;else{if(!e.globals.xAxisScale)return;a=w.pxToDataX(e,h),l=w.pxToDataX(e,d),r=e.globals.yAxisScale[0].niceMin+(e.layout.gridHeight-this._screenYToPlotPx(n.bottom))*o.yRatio[0],c=e.globals.yAxisScale[0].niceMax-this._screenYToPlotPx(n.top)*o.yRatio[0]}const u={xaxis:{min:a,max:l},yaxis:{min:r,max:c}};"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,n=t,o=this.xyRatios,a=this.ctx.toolbar,l=s.interact.zoomEnabled?n.zoomRect.node.getBoundingClientRect():n.selectionRect.node.getBoundingClientRect();if(!n._hasPlot())return;const r=this._screenXToPlotPx(l.left),c=this._screenXToPlotPx(l.right),h=this._screenYToPlotPx(l.top),d=this._screenYToPlotPx(l.bottom);let u,m;s.axisFlags.isRangeBar?(u=s.globals.yAxisScale[0].niceMin+r*o.invertedYRatio,m=s.globals.yAxisScale[0].niceMin+c*o.invertedYRatio):(u=w.pxToDataX(s,r),m=w.pxToDataX(s,c));const p=[],x=[];if(s.config.yaxis.forEach((t,e)=>{const i=s.globals.seriesYAxisMap[e][0],n=s.globals.yAxisScale[e].niceMax-o.yRatio[i]*h,a=s.globals.yAxisScale[e].niceMax-o.yRatio[i]*d;p.push(n),x.push(a)}),n.dragged&&(n.dragX>10||n.dragY>10)&&u!==m)if(s.interact.zoomEnabled){if(!s.globals.initialConfig)return;let t=g.clone(s.globals.initialConfig.yaxis),i=g.clone(s.globals.initialConfig.xaxis);if(s.interact.zoomed=!0,s.config.xaxis.convertedCatToNumeric&&(u=Math.floor(u),m=Math.floor(m),u<1&&(u=1,m=s.globals.dataPoints),m-u<2&&(m=u+1)),"xy"!==e&&"x"!==e||(i={min:u,max:m}),"xy"!==e&&"y"!==e||t.forEach((e,i)=>{t[i].min=x[i],t[i].max=p[i]}),a){const e=a.getBeforeZoomRange(i,t);e&&(i=e.xaxis?e.xaxis:i,t=e.yaxis?e.yaxis:t)}const o={xaxis:i};s.config.chart.group||(o.yaxis=t);const l=n.ctx.updateHelpers._updateOptions(o,!1,n.w.config.chart.animations.dynamicAnimation.enabled);l&&"function"==typeof l.then?l.then(()=>n._focusForKeyboard()):n._focusForKeyboard(),"function"==typeof s.config.chart.events.zoomed&&a.zoomCallback(i,t)}else if(s.interact.selectionEnabled){let t=null,o=null;if(o={min:u,max:m},"xy"===e||"y"===e){const e=g.clone(s.config.yaxis);t=e,e.forEach((t,i)=>{e[i].min=x[i],e[i].max=p[i]})}s.interact.selection=n.selection,"function"==typeof s.config.chart.events.selection&&s.config.chart.events.selection(n.ctx,{xaxis:o,yaxis:t}),null==(i=n.ctx.linkedViews)||i.onSourceSelection(o)}}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,n=(null!=(e=i.interact.lastClientPosition.y)?e:0)-s.clientY;Math.abs(t)>Math.abs(n)&&t>0?this.moveDirection="left":Math.abs(t)>Math.abs(n)&&t<0?this.moveDirection="right":Math.abs(n)>Math.abs(t)&&n>0?this.moveDirection="up":Math.abs(n)>Math.abs(t)&&n<0&&(this.moveDirection="down")}i.interact.lastClientPosition={x:s.clientX,y:s.clientY};const n=i.axisFlags.isRangeBar?i.globals.minY:i.globals.minX,o=i.axisFlags.isRangeBar?i.globals.maxY:i.globals.maxX;s.panScrolled(n,o)}panScrolled(t,e){var i,s;const n=this.w,o=this.xyRatios;if(!n.globals.initialConfig)return;const a=g.clone(n.globals.initialConfig.yaxis);let l=o.xRatio,r=n.globals.minX,c=n.globals.maxX;if(n.axisFlags.isRangeBar&&(l=o.invertedYRatio,r=n.globals.minY,c=n.globals.maxY),"left"===this.moveDirection?(t=r+n.layout.gridWidth/15*l,e=c+n.layout.gridWidth/15*l):"right"===this.moveDirection&&(t=r-n.layout.gridWidth/15*l,e=c-n.layout.gridWidth/15*l),!n.axisFlags.isRangeBar){const o=null!=(i=n.globals.dataReducerRawMinX)?i:n.globals.initialMinX,a=null!=(s=n.globals.dataReducerRawMaxX)?s:n.globals.initialMaxX;(t<o||e>a)&&(t=r,e=c)}const h={xaxis:{min:t,max:e}};n.config.chart.group||(h.yaxis=a),this.updateScrolledChart(h,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=v.plotRect(this.w);return(t-e.top)/e.zoom}_screenXToPlotPx(t){return w.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 n=this._currentXWindow(),o=i&&e-t>n.max-n.min,a=this._clampBounds();if(a){const i=e-t;t<a.min&&(e=(t=a.min)+i),e>a.max&&(t=(e=a.max)-i),t<a.min&&(t=a.min)}if(s.config.xaxis.convertedCatToNumeric&&(t=Math.floor(t),e=o?Math.ceil(e):Math.floor(e),t<1&&(t=1),a&&e>a.max&&(e=Math.floor(a.max)),e-t<2))return!1;if(!(e>t))return!1;const l={xaxis:{min:t,max:e}};return s.config.chart.group||(l.yaxis=g.clone(s.globals.initialConfig.yaxis)),i&&(s.interact.zoomed=!0),this.ctx.updateHelpers._updateOptions(l,!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)}_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],n=this._currentXWindow(),o=e.layout.gridWidth||1,a=v.plotRect(e).zoom;i.panState={startX:s.clientX,startY:s.clientY,axis:null,minX0:n.min,maxX0:n.max,zoom:a,ratio0:(n.max-n.min)/o/a},i.samples=[{x:s.clientX,t:t.timeStamp}]}}}_beginPinch(t){const e=this.w,i=t.touches[0],s=t.touches[1],n=Math.hypot(s.clientX-i.clientX,s.clientY-i.clientY)||1,o=this._screenXToPlotPx((i.clientX+s.clientX)/2),{min:a,max:l}=this._currentXWindow();this._m().pinch={d0:n,cx0:o,minX0:a,maxX0:l,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],n=t.touches[1],o=Math.hypot(n.clientX-s.clientX,n.clientY-s.clientY)||1,a=this._screenXToPlotPx((s.clientX+n.clientX)/2),l=i.maxX0-i.minX0,r=l*(i.d0/o);let c=i.minX0+i.cx0/i.gridWidth*l-a/i.gridWidth*r,h=c+r;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(h-c<i){const t=(c+h)/2;c=t-i/2,h=t+i/2}}this._applyXRange(c,h,!0)}_endPinch(){const t=this.w;this._m().pinch=null;const{min:e,max:i}=this._currentXWindow(),s={min:e,max:i},n=t.globals.initialConfig?g.clone(t.globals.initialConfig.yaxis):[],o=this.ctx.toolbar;o&&o.zoomCallback(s,n)}_movePan(t){const e=this._m(),i=e.panState,s=t.touches[0];if(!i.axis){const n=Math.abs(s.clientX-i.startX),o=Math.abs(s.clientY-i.startY);if(n<6&&o<6)return void this._pushSample(s.clientX,t.timeStamp);if(o>n)return e.busy=!1,void(e.panState=null);i.axis="x"}if("x"!==i.axis)return;t.preventDefault();const n=(s.clientX-i.startX)*i.ratio0;this._pushSample(s.clientX,t.timeStamp),this._applyXRange(i.minX0-n,i.maxX0-n,!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],n=e.t-t.t;n>0&&(i=(e.x-t.x)/n)}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,n="number"==typeof s?Math.min(Math.max(s,.5),.999):.92;let o=t,a=null;i.busy=!0;const l=t=>{if(e.globals.isDestroyed)return i.inertiaRAF=null,void(i.busy=!1);if(null==a)return a=t,void(i.inertiaRAF=requestAnimationFrame(l));const s=t-a;if(a=t,o*=Math.pow(n,s/16.6667),Math.abs(o)<.02)return i.inertiaRAF=null,i.busy=!1,void this._fireScrolled();const r=this._currentXWindow(),c=e.layout.gridWidth||1,h=(r.max-r.min)/c,d=o*s*h,u=this._applyXRange(r.min-d,r.max-d,!1),m=this._clampBounds();if(!u||m&&(d>0&&u.minX<=m.min+1e-6*(m.max-m.min)||d<0&&u.maxX>=m.max-1e-6*(m.max-m.min)))return i.inertiaRAF=null,i.busy=!1,void this._fireScrolled();i.inertiaRAF=requestAnimationFrame(l)};i.inertiaRAF=requestAnimationFrame(l)}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>h.default});
|
|
5
|
+
"use strict";var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,a=(e,i,s)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s,l=(t,e)=>{for(var i in e||(e={}))n.call(e,i)&&a(t,i,e[i]);if(s)for(var i of s(e))o.call(e,i)&&a(t,i,e[i]);return t},r=(t,s)=>e(t,i(s));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function c(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 h=c(require("apexcharts/core")),d=h.__apex_Graphics,u=h.__apex_axes_AxesUtils,m=h.__apex_Series,g=h.__apex_Utils,p=h.__apex_Environment_Environment,f=h.__apex_BrowserAPIs_BrowserAPIs,x=h.__apex_math_SVGNS;class b{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 n=i[t],o=document.createElementNS(x,"image");o.setAttribute("x",n.getAttribute("x")||"0"),o.setAttribute("y",n.getAttribute("y")||"0"),o.setAttribute("width",n.getAttribute("width")||"0"),o.setAttribute("height",n.getAttribute("height")||"0"),o.setAttribute("href",s),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s),n.parentNode&&n.parentNode.replaceChild(o,n)}}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(!p.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=f.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(!p.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 n=s[1].trim().replace(/^['"]|['"]$/g,"");t.push({family:n.toLowerCase(),css:e,base:i})})},s=(t,e)=>{Array.from(t).forEach(t=>{5===t.type?t.cssText&&i(t.cssText,e):t.styleSheet?n(t.styleSheet):t.cssRules&&s(t.cssRules,e)})},n=t=>{let n=null;try{n=t.cssRules}catch(t){}n?s(n,t.href||document.baseURI):t.href&&e.push(fetch(t.href).then(t=>t.ok?t.text():"").then(e=>i(e,t.href)).catch(()=>{}))};return Array.from(document.styleSheets||[]).forEach(n),Promise.all(e).then(()=>t)}embedFonts(t){const e=this.w;if(!p.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(x,"style");s.textContent=i,t.insertBefore(s,t.firstChild)}).catch(()=>{}):Promise.resolve()}inlineFontFaceUrls(t,e){const i=[],s=/url\(\s*(['"]?)([^'")]+)\1\s*\)/gi;let n;for(;null!==(n=s.exec(t));)n[2].startsWith("data:")||i.push(n[2]);return i.length?Promise.all(i.map(t=>this.fetchAsDataUri(e?new URL(t,e).href:t).then(e=>({url:t,dataUri:e})).catch(()=>({url:t,dataUri:null})))).then(e=>{let i=t,s=0;return e.forEach(({url:t,dataUri:e})=>{e&&(i=i.split(t).join(e),s++)}),s?i:null}):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,n;const o=this.w;let a=t||o.config.chart.toolbar.export.scale||o.config.chart.toolbar.export.width/o.globals.svgWidth;a||(a=1);const l=o.globals.svgWidth*a,r=o.globals.svgHeight*a;null==(i=o.globals.layoutTween)||i.finish(),null==(s=o.globals.circleTween)||s.finish(),null==(n=o.globals.highlightTween)||n.finish(),[...o.globals.chromeTweens||[]].forEach(t=>t());const c=o.dom.elWrap.cloneNode(!0);c.style.width=l+"px",c.style.height=r+"px",this.inlineCanvasLayers(c),this.applyExportStyles(c);const h=(new XMLSerializer).serializeToString(c);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="${o.globals.svgWidth}px" height="${o.globals.svgHeight}px">\n <foreignObject width="100%" height="100%">\n <div xmlns="http://www.w3.org/1999/xhtml" style="width:${l}px; height:${r}px;">\n ${h}\n </div>\n </foreignObject>\n </svg>\n `;const u=this.svgStringToNode(d);1!==a&&this.scaleSvgNode(u,a),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"),n=i||s;if(!n||n.startsWith("data:"))return Promise.resolve();const o=n=>{i&&t.setAttributeNS(e,"href",n),!s&&i||t.setAttribute("href",n)};return this.fetchAsDataUri(n).then(o).catch(()=>this.getBase64FromUrl(n).then(o).catch(t=>{console.error("Error converting image to base64:",t)}))});return Promise.all(s)}getBase64FromUrl(t){return p.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 p.isSSR()?Promise.resolve({imgURI:""}):new Promise(e=>{const i=this.w,s=()=>{console.warn("ApexCharts: the PNG export could not be rendered"),e({imgURI:""})},n=t?t.scale||t.width/i.globals.svgWidth:1,o=document.createElement("canvas");o.width=i.globals.svgWidth*n,o.height=parseInt(i.dom.elWrap.style.height,10)*n;const a=this.resolveExportBackground(),l=o.getContext("2d");if(!l)return s();l.fillStyle=a,l.fillRect(0,0,o.width,o.height),this.getSvgString(n).then(t=>{const i="data:image/svg+xml,"+encodeURIComponent(t),n=new Image;n.crossOrigin="anonymous",n.onload=()=>{try{l.drawImage(n,0,0);const t=o;if(t.msToBlob){const i=t.msToBlob();e({blob:i})}else{const t=o.toDataURL("image/png");e({imgURI:t})}}catch(t){s()}},n.onerror=s,n.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 n=this.w,o=n.globals,a=n.config.chart.toolbar.export.csv,l=!t&&(o.streamgraphRawSeries||o.waterfallRawSeries||o.dumbbellRawSeries);t||(t=l||n.config.series);const r=new Set(l&&l===o.dumbbellRawSeries?n.dumbbellData.hidden:o.collapsedSeriesIndices),c=[],h=[],d="datetime"===n.config.xaxis.type,p=n.config.xaxis.labels.datetimeUTC,f=t=>{if(null==t||g.isNumber(t))return t;const e=String(t);return/^[=+\-@\t\r]/.test(e)&&isNaN(+e)?`'${e}`:e},x=t=>d&&String(t).length>=10&&!isNaN(new Date(t).getTime()),b=(t,e)=>{const i=new Date(t);if(p||i.setTime(i.getTime()-6e4*i.getTimezoneOffset()),e)return i.toISOString().slice(0,23).replace("T"," ").replace(".000","");const[s,n,o,a]=i.toUTCString().split(" ");return`${s.slice(0,3)} ${o} ${n} ${a}`},w=(t,e)=>"function"==typeof a.categoryFormatter?a.categoryFormatter(t):null==t?"":x(t)?b(t,e):g.isNumber(t)?t:f(String(t).split(i).join("")),y=t=>"function"==typeof a.valueFormatter?a.valueFormatter(t):f(t),v=new u(this.w,{theme:this.ctx.theme,timeScale:this.ctx.timeScale}),S=t=>{let e="";if(o.axisCharts){if("category"===n.config.xaxis.type||n.config.xaxis.convertedCatToNumeric)if(o.isBarHorizontal){const i=n.formatters.yLabelFormatters[0],s=new m(this.ctx.w).getActiveConfigSeriesIndex();e=i(n.labelData.labels[t],{seriesIndex:s,dataPointIndex:t,w:n})}else e=v.getLabel(n.labelData.labels,n.labelData.timescaleLabels,0,t).text;d&&(n.config.xaxis.categories.length?e=n.config.xaxis.categories[t]:n.config.labels.length&&(e=n.config.labels[t]))}else e=n.config.labels[t];return Array.isArray(e)?e.join(" "):e},M=n.candleData,R=n.rangeData,_=n.violinData,E=t.length>1,X=t.map((t,e)=>{const s=l?"":t.type||n.config.chart.type,o="candlestick"===s?{open:M.seriesCandleO,high:M.seriesCandleH,low:M.seriesCandleL,close:M.seriesCandleC}:"boxPlot"===s?{minimum:M.seriesCandleO,q1:M.seriesCandleH,median:M.seriesCandleM,q3:M.seriesCandleL,maximum:M.seriesCandleC}:"rangeBar"===s||"rangeArea"===s?{minimum:R.seriesRangeStart,maximum:R.seriesRangeEnd}:"violin"===s?{minimum:_.seriesViolinMin,maximum:_.seriesViolinMax,observations:_.seriesViolinPoints}:null,a=String(t.name||`series-${e}`).split(i).join("")||`series-${e}`,c=o?Object.keys(o):[a];return{head:o&&E?c.map(t=>`${a} ${t}`):c,cells:i=>{var s;const n=r.has(e);if(!o){const e=n||null==(s=t.data)?void 0:s[i];return[y(e&&"object"==typeof e?Array.isArray(e)?e[1]:e.y:e)]}return Object.values(o).map(t=>{var s;const o=n||null==(s=null==t?void 0:t[e])?void 0:s[i];return y(Array.isArray(o)?o.length:o)})}}});if(o.axisCharts)if(c.push([a.headerCategory,...X.flatMap(t=>t.head)].join(i)),o.allSeriesHasEqualX||n.config.xaxis.categories.length||n.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=S(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}h.push([e,...X.flatMap(t=>t.cells(i))])}}}else{const e=new Map;t.forEach((t,i)=>{var s;null==(s=null==t?void 0:t.data)||s.forEach((t,s)=>{if(!t||"object"!=typeof t)return;const n=Array.isArray(t)?t[0]:t.x,o=String(n);let a=e.get(o);a||(a={cat:n,values:X.map(t=>t.head.map(()=>""))},e.set(o,a)),a.values[i]=X[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?n.axisFlags.isXNumeric?t.cat<e.cat?-1:1:0:t.cat-e.cat}).forEach(({cat:t,values:e})=>h.push([t,...e.flat()]))}else c.push([a.headerCategory,a.headerValue].join(i)),t.forEach((t,e)=>{c.push([w(n.labelData.labels[e]),y(r.has(e)?"":n.seriesData.series[e])].join(i))});const P=h.map(t=>t[0]).filter(x),A=new Set(P.map(t=>b(t))).size<P.length;h.forEach(t=>c.push([w(t[0],A),...t.slice(1)].join(i))),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\ufeff"+c.join(s)),e||a.filename,".csv")}triggerDownload(t,e,i){if(p.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)}}class w{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 n=this.w,o=!!t.resetOnly,a=()=>f.createElementNS("http://www.w3.org/1999/xhtml","div"),c=()=>{const t=f.createElementNS("http://www.w3.org/1999/xhtml","button");return t.setAttribute("type","button"),t},h=a();if(h.setAttribute("class","apexcharts-toolbar"),h.style.top=n.config.chart.toolbar.offsetY+"px",h.style.right=3-n.config.chart.toolbar.offsetX+"px",n.dom.elWrap.appendChild(h),this.elZoom=c(),this.elZoomIn=c(),this.elZoomOut=c(),this.elPan=c(),this.elSelection=c(),this.elMeasure=c(),this.elZoomReset=c(),this.elMenuIcon=c(),this.elMenu=a(),this.elCustomIcons=[],this.t=n.config.chart.toolbar.tools,this._drawnForZoom=null,o?(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=r(l({},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(c());const u=[],m=(t,e,i)=>{const s=t.toLowerCase();this.t[s]&&n.config.chart.zoom.enabled&&u.push({el:e,icon:"string"==typeof this.t[s]?this.t[s]:i,title:this.localeValues[t],class:`apexcharts-${s}-icon`})};m("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'),m("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]&&n.config.chart[t].enabled&&u.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&&n.config.chart.zoom.enabled&&u.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&&n.config.chart.measure&&n.config.chart.measure.enabled&&u.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"}),m("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&&u.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++)u.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});u.forEach((t,e)=>{t.index&&g.moveIndexInArray(u,e,t.index)});for(let t=0;t<u.length;t++)d.setAttrs(u[t].el,{class:u[t].class,title:u[t].title,"aria-label":u[t].title}),u[t].el.innerHTML=u[t].icon,h.appendChild(u[t].el);this.elZoom.parentNode&&this.elZoom.setAttribute("aria-pressed",String(!!n.interact.zoomEnabled)),this.elSelection.parentNode&&this.elSelection.setAttribute("aria-pressed",String(!!n.interact.selectionEnabled)),this.elPan.parentNode&&this.elPan.setAttribute("aria-pressed",String(!!n.interact.panEnabled)),this.elMeasure.parentNode&&this.elMeasure.setAttribute("aria-pressed",String(!!n.interact.measureEnabled)),this.elMenuIcon.parentNode&&(this.elMenuIcon.setAttribute("aria-haspopup","true"),this.elMenuIcon.setAttribute("aria-expanded","false")),o||this._createHamburgerMenu(h),o?null==(e=this.elZoomReset)||e.addEventListener("click",this.handleZoomReset.bind(this)):(n.interact.zoomEnabled?this.elZoom.classList.add(this.selectedClass):n.interact.panEnabled?this.elPan.classList.add(this.selectedClass):n.interact.selectionEnabled?this.elSelection.classList.add(this.selectedClass):n.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),d.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(f.createElementNS("http://www.w3.org/1999/xhtml","div")),this.elMenuItems[t].innerHTML=e[t].title,d.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,n,o,a,l,r;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==(n=this.elZoomOut)||n.addEventListener("click",this.handleZoomOut.bind(this)),null==(o=this.elPan)||o.addEventListener("click",this.togglePanning.bind(this)),null==(a=this.elMeasure)||a.addEventListener("click",this.toggleMeasure.bind(this)),null==(l=this.elMenuIcon)||l.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==(r=this.elMenuIcon)||r.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",n=!!e.w.interact[s];i.toggleOtherControls();const o="selection"===t?i.elSelection:i.elZoom;n||(e.w.interact[s]=!0,null==o||o.classList.add(i.selectedClass)),null==o||o.setAttribute("aria-pressed",String(!!e.w.interact[s]))})}toggleMeasure(){var t,e,i,s;const n=this.w,o=!n.interact.measureEnabled;this.toggleOtherControls(),o&&(n.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(n.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,n=!!t.w.interact.panEnabled;s.toggleOtherControls(),n||(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,n=(e+s)/2,o=(i+s)/2,a=this._getNewMinXMaxX(n,o);t.interact.disableZoomIn||this.zoomUpdateOptions(a.minX,a.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,n=e-(s-e),o=i-(s-i),a=this._getNewMinXMaxX(n,o);t.interact.disableZoomOut||this.zoomUpdateOptions(a.minX,a.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 n=this.getBeforeZoomRange(s,void 0);n&&(s=n.xaxis);const o={xaxis:s};if(!i.globals.initialConfig)return;const a=g.clone(i.globals.initialConfig.yaxis);i.config.chart.group||(o.yaxis=a),this.w.interact.zoomed=!0,this.ctx.updateHelpers._updateOptions(o,!1,this.w.config.chart.animations.dynamicAnimation.enabled),this.zoomCallback(s,a)}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 b(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(g.clone(i.globals.initialSeries));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 y{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)/y.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*y.xRatio(t)}static screenXToPlotPx(t,e){const i=t.dom.baseEl,s=i&&i.querySelector(".apexcharts-svg");if(!s)return e-t.layout.translateX;const n=s.getBoundingClientRect(),o=t.globals.svgWidth?n.width/t.globals.svgWidth:1;return(e-n.left)/(o||1)-t.layout.translateX}}const v=h.__apex_tooltip_Utils,S=h.__apex_index_Box;h.default.registerFeatures({toolbar:w,zoomPanSelection:class extends w{constructor(t,e){super(t,e),this.w=t,this.ctx=e,this.dragged=!1,this.graphics=new d(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 S(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 n=i.interact.zoomEnabled?i.config.chart.zoom.type:i.config.chart.selection.type,o=i.config.chart.toolbar.autoSelected;if("measure"!==o&&(e.shiftKey?(i.interact.shiftWasPressed=!0,s.enableZoomPanFromToolbar("pan"===o?"zoom":"pan")):i.interact.shiftWasPressed&&(s.enableZoomPanFromToolbar(o),i.interact.shiftWasPressed=!1)),!e.target)return;const a=e.target.classList;let l;e.target.parentNode&&null!==e.target.parentNode&&(l=e.target.parentNode.classList);if(!(a.contains("apexcharts-legend-marker")||a.contains("apexcharts-legend-text")||l&&l.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:n,xyRatios:this.xyRatios})):(this.w.interact.mousedown&&i.interact.zoomEnabled||this.w.interact.mousedown&&i.interact.selectionEnabled)&&(this.selection=this.selectionDrawing({context:this,zoomtype:n}))),"mouseup"!==e.type&&"touchend"!==e.type&&"mouseleave"!==e.type||this.handleMouseUp({zoomtype:n}),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 n=this.w.config.chart;return!(!n.zoom||!n.zoom.enabled)&&("auto"!==t?!!t:!(!(null==(e=n.toolbar)?void 0:e.show)||!(null==(s=null==(i=n.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=f.getWindow(),n=t&&t.navigator,o=!!n&&/Mac|iPhone|iPad/.test(n.platform||n.userAgent),a=(e.globals.locale.toolbar.wheelZoomHint||"").replace("{key}",o?"\u2318":"Ctrl");s=f.createElement("div"),s.className="apexcharts-wheel-hint",s.setAttribute("aria-hidden","true");const l=f.createElement("span");l.textContent=a,l.style.fontFamily=e.config.chart.fontFamily,s.appendChild(l),i.appendChild(s),s.offsetWidth}s.classList.add("apexcharts-wheel-hint-visible");const n=e.interact;n.wheelHintTimer&&clearTimeout(n.wheelHintTimer),n.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:n,max:o}=this._currentXWindow(),a=o-n,l=Math.min(Math.max(this._screenXToPlotPx(e.clientX)/s,0),1);let r=a*i;const c=this._clampBounds();if(c){const e=t.globals.minXDiff>0&&isFinite(t.globals.minXDiff)?t.globals.minXDiff:0,i=Math.max(2*e,1e-6*(c.max-c.min));r<i&&(r=i),r>c.max-c.min&&(r=c.max-c.min)}let h=n+l*a-l*r,d=h+r;const u=1e-9*a;if(Math.abs(h-n)<u&&Math.abs(d-o)<u)return;if(isNaN(h)||isNaN(d))return;const m=this.getBeforeZoomRange({min:h,max:d},void 0);m&&m.xaxis&&(h=m.xaxis.min,d=m.xaxis.max),this._applyXRange(h,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?g.clone(t.globals.initialConfig.yaxis):[],n=this.ctx.toolbar;n&&n.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,n)=>"l"===n||"r"===n?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(r(l({},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=y.dataXToPx(t,t.config.chart.selection.xaxis.min),s=y.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 n={x:i,y:0,width:s,height:t.layout.gridHeight,translateX:t.layout.translateX,translateY:t.layout.translateY,selectionEnabled:!0};this.drawSelectionRect(n),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:n=0,translateY:o=0}){const a=this.w,l=this.zoomRect,r=this.selectionRect;if(this.dragged||null!==a.interact.selection){const c={transform:"translate("+n+", "+o+")"};a.interact.zoomEnabled&&this.dragged&&(i<0&&(i=1),l.attr({x:t,y:e,width:i,height:s,fill:a.config.chart.zoom.zoomedArea.fill.color,"fill-opacity":a.config.chart.zoom.zoomedArea.fill.opacity,stroke:a.config.chart.zoom.zoomedArea.stroke.color,"stroke-width":a.config.chart.zoom.zoomedArea.stroke.width,"stroke-opacity":a.config.chart.zoom.zoomedArea.stroke.opacity}),d.setAttrs(l.node,c)),a.interact.selectionEnabled&&(r.attr({x:t,y:e,width:i>0?i:0,height:s>0?s:0,fill:a.config.chart.selection.fill.color,"fill-opacity":a.config.chart.selection.fill.opacity,stroke:a.config.chart.selection.stroke.color,"stroke-width":a.config.chart.selection.stroke.width,"stroke-dasharray":a.config.chart.selection.stroke.dashArray,"stroke-opacity":a.config.chart.selection.stroke.opacity}),d.setAttrs(r.node,c))}}_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,n=t=>Math.min(Math.max(t,0),e),o=n(i),a=n(i+s);o===i&&a===i+s||(t.attr({x:o,width:a-o}),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 n=s.startX,o=s.startY;let a=!1,c=!1;const h=this._screenXToPlotPx(s.clientX),d=this._screenYToPlotPx(s.clientY);let u=h-n,m=d-o,g={translateX:i.layout.translateX,translateY:i.layout.translateY};return Math.abs(u+n)>i.layout.gridWidth?u=i.layout.gridWidth-n:h<0&&(u=n),n>h&&(a=!0,u=Math.abs(u)),o>d&&(c=!0,m=Math.abs(m)),g="x"===e?{x:a?n-u:n,y:0,width:u,height:i.layout.gridHeight}:"y"===e?{x:0,y:c?o-m:o,width:i.layout.gridWidth,height:m}:{x:a?n-u:n,y:c?o-m:o,width:u,height:m},g=r(l({},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:n,box:o}=e.detail,a=this.constraints;let{x:l,y:r}=o;l<a.x&&(l=a.x),r<a.y&&(r=a.y),o.x2>a.x2&&(l=a.x2-o.w),o.y2>a.y2&&(r=a.y2-o.h),n.move(l,r);const c=this.selectionRect;let h=0;"resizing"===t&&(h=30);const d=t=>parseFloat(c.node.getAttribute(t)),u={x:d("x"),y:d("y"),width:d("width"),height:d("height")};s.interact.selection=u;const m=s.config.chart.link,g=!(!m||!m.enabled&&"function"!=typeof m.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()},h))}_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 n=this.selectionRect.node.getBoundingClientRect(),o=this.xyRatios;let a,l,r,c;const h=this._screenXToPlotPx(n.left),d=this._screenXToPlotPx(n.right);if(e.axisFlags.isRangeBar)a=e.globals.yAxisScale[0].niceMin+h*o.invertedYRatio,l=e.globals.yAxisScale[0].niceMin+d*o.invertedYRatio,r=0,c=1;else{if(!e.globals.xAxisScale)return;a=y.pxToDataX(e,h),l=y.pxToDataX(e,d),r=e.globals.yAxisScale[0].niceMin+(e.layout.gridHeight-this._screenYToPlotPx(n.bottom))*o.yRatio[0],c=e.globals.yAxisScale[0].niceMax-this._screenYToPlotPx(n.top)*o.yRatio[0]}const u={xaxis:{min:a,max:l},yaxis:{min:r,max:c}};"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,n=t,o=this.xyRatios,a=this.ctx.toolbar,l=s.interact.zoomEnabled?n.zoomRect.node.getBoundingClientRect():n.selectionRect.node.getBoundingClientRect();if(!n._hasPlot())return;const r=this._screenXToPlotPx(l.left),c=this._screenXToPlotPx(l.right),h=this._screenYToPlotPx(l.top),d=this._screenYToPlotPx(l.bottom);let u,m;s.axisFlags.isRangeBar?(u=s.globals.yAxisScale[0].niceMin+r*o.invertedYRatio,m=s.globals.yAxisScale[0].niceMin+c*o.invertedYRatio):(u=y.pxToDataX(s,r),m=y.pxToDataX(s,c));const p=[],f=[];if(s.config.yaxis.forEach((t,e)=>{const i=s.globals.seriesYAxisMap[e][0],n=s.globals.yAxisScale[e].niceMax-o.yRatio[i]*h,a=s.globals.yAxisScale[e].niceMax-o.yRatio[i]*d;p.push(n),f.push(a)}),n.dragged&&(n.dragX>10||n.dragY>10)&&u!==m)if(s.interact.zoomEnabled){if(!s.globals.initialConfig)return;let t=g.clone(s.globals.initialConfig.yaxis),i=g.clone(s.globals.initialConfig.xaxis);if(s.interact.zoomed=!0,s.config.xaxis.convertedCatToNumeric&&(u=Math.floor(u),m=Math.floor(m),u<1&&(u=1,m=s.globals.dataPoints),m-u<2&&(m=u+1)),"xy"!==e&&"x"!==e||(i={min:u,max:m}),"xy"!==e&&"y"!==e||t.forEach((e,i)=>{t[i].min=f[i],t[i].max=p[i]}),a){const e=a.getBeforeZoomRange(i,t);e&&(i=e.xaxis?e.xaxis:i,t=e.yaxis?e.yaxis:t)}const o={xaxis:i};s.config.chart.group||(o.yaxis=t);const l=n.ctx.updateHelpers._updateOptions(o,!1,n.w.config.chart.animations.dynamicAnimation.enabled);l&&"function"==typeof l.then?l.then(()=>n._focusForKeyboard()):n._focusForKeyboard(),"function"==typeof s.config.chart.events.zoomed&&a.zoomCallback(i,t)}else if(s.interact.selectionEnabled){let t=null,o=null;if(o={min:u,max:m},"xy"===e||"y"===e){const e=g.clone(s.config.yaxis);t=e,e.forEach((t,i)=>{e[i].min=f[i],e[i].max=p[i]})}s.interact.selection=n.selection,"function"==typeof s.config.chart.events.selection&&s.config.chart.events.selection(n.ctx,{xaxis:o,yaxis:t}),null==(i=n.ctx.linkedViews)||i.onSourceSelection(o)}}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,n=(null!=(e=i.interact.lastClientPosition.y)?e:0)-s.clientY;Math.abs(t)>Math.abs(n)&&t>0?this.moveDirection="left":Math.abs(t)>Math.abs(n)&&t<0?this.moveDirection="right":Math.abs(n)>Math.abs(t)&&n>0?this.moveDirection="up":Math.abs(n)>Math.abs(t)&&n<0&&(this.moveDirection="down")}i.interact.lastClientPosition={x:s.clientX,y:s.clientY};const n=i.axisFlags.isRangeBar?i.globals.minY:i.globals.minX,o=i.axisFlags.isRangeBar?i.globals.maxY:i.globals.maxX;s.panScrolled(n,o)}panScrolled(t,e){var i,s;const n=this.w,o=this.xyRatios;if(!n.globals.initialConfig)return;const a=g.clone(n.globals.initialConfig.yaxis);let l=o.xRatio,r=n.globals.minX,c=n.globals.maxX;if(n.axisFlags.isRangeBar&&(l=o.invertedYRatio,r=n.globals.minY,c=n.globals.maxY),"left"===this.moveDirection?(t=r+n.layout.gridWidth/15*l,e=c+n.layout.gridWidth/15*l):"right"===this.moveDirection&&(t=r-n.layout.gridWidth/15*l,e=c-n.layout.gridWidth/15*l),!n.axisFlags.isRangeBar){const o=null!=(i=n.globals.dataReducerRawMinX)?i:n.globals.initialMinX,a=null!=(s=n.globals.dataReducerRawMaxX)?s:n.globals.initialMaxX;(t<o||e>a)&&(t=r,e=c)}const h={xaxis:{min:t,max:e}};n.config.chart.group||(h.yaxis=a),this.updateScrolledChart(h,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=v.plotRect(this.w);return(t-e.top)/e.zoom}_screenXToPlotPx(t){return y.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 n=this._currentXWindow(),o=i&&e-t>n.max-n.min,a=this._clampBounds();if(a){const i=e-t;t<a.min&&(e=(t=a.min)+i),e>a.max&&(t=(e=a.max)-i),t<a.min&&(t=a.min)}if(s.config.xaxis.convertedCatToNumeric&&(t=Math.floor(t),e=o?Math.ceil(e):Math.floor(e),t<1&&(t=1),a&&e>a.max&&(e=Math.floor(a.max)),e-t<2))return!1;if(!(e>t))return!1;const l={xaxis:{min:t,max:e}};return s.config.chart.group||(l.yaxis=g.clone(s.globals.initialConfig.yaxis)),i&&(s.interact.zoomed=!0),this.ctx.updateHelpers._updateOptions(l,!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 n=(s-i)*t;if(e.config.xaxis.convertedCatToNumeric&&(n=n>0?Math.ceil(n):Math.floor(n)),e.axisFlags.isRangeBar){const t=e.rangeData;let o=1/0,a=-1/0;if(t.seriesRangeStart.concat(t.seriesRangeEnd).flat().forEach(t=>{null!=t&&(o=Math.min(o,t),a=Math.max(a,t))}),n=n>0?Math.min(n,Math.max(0,a-s)):Math.max(n,Math.min(0,o-i)),!n)return}this._applyXRange(i+n,s+n,!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],n=this._currentXWindow(),o=e.layout.gridWidth||1,a=v.plotRect(e).zoom;i.panState={startX:s.clientX,startY:s.clientY,axis:null,minX0:n.min,maxX0:n.max,zoom:a,ratio0:(n.max-n.min)/o/a},i.samples=[{x:s.clientX,t:t.timeStamp}]}}}_beginPinch(t){const e=this.w,i=t.touches[0],s=t.touches[1],n=Math.hypot(s.clientX-i.clientX,s.clientY-i.clientY)||1,o=this._screenXToPlotPx((i.clientX+s.clientX)/2),{min:a,max:l}=this._currentXWindow();this._m().pinch={d0:n,cx0:o,minX0:a,maxX0:l,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],n=t.touches[1],o=Math.hypot(n.clientX-s.clientX,n.clientY-s.clientY)||1,a=this._screenXToPlotPx((s.clientX+n.clientX)/2),l=i.maxX0-i.minX0,r=l*(i.d0/o);let c=i.minX0+i.cx0/i.gridWidth*l-a/i.gridWidth*r,h=c+r;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(h-c<i){const t=(c+h)/2;c=t-i/2,h=t+i/2}}this._applyXRange(c,h,!0)}_endPinch(){const t=this.w;this._m().pinch=null;const{min:e,max:i}=this._currentXWindow(),s={min:e,max:i},n=t.globals.initialConfig?g.clone(t.globals.initialConfig.yaxis):[],o=this.ctx.toolbar;o&&o.zoomCallback(s,n)}_movePan(t){const e=this._m(),i=e.panState,s=t.touches[0];if(!i.axis){const n=Math.abs(s.clientX-i.startX),o=Math.abs(s.clientY-i.startY);if(n<6&&o<6)return void this._pushSample(s.clientX,t.timeStamp);if(o>n)return e.busy=!1,void(e.panState=null);i.axis="x"}if("x"!==i.axis)return;t.preventDefault();const n=(s.clientX-i.startX)*i.ratio0;this._pushSample(s.clientX,t.timeStamp),this._applyXRange(i.minX0-n,i.maxX0-n,!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],n=e.t-t.t;n>0&&(i=(e.x-t.x)/n)}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,n="number"==typeof s?Math.min(Math.max(s,.5),.999):.92;let o=t,a=null;i.busy=!0;const l=t=>{if(e.globals.isDestroyed)return i.inertiaRAF=null,void(i.busy=!1);if(null==a)return a=t,void(i.inertiaRAF=requestAnimationFrame(l));const s=t-a;if(a=t,o*=Math.pow(n,s/16.6667),Math.abs(o)<.02)return i.inertiaRAF=null,i.busy=!1,void this._fireScrolled();const r=this._currentXWindow(),c=e.layout.gridWidth||1,h=(r.max-r.min)/c,d=o*s*h,u=this._applyXRange(r.min-d,r.max-d,!1),m=this._clampBounds();if(!u||m&&(d>0&&u.minX<=m.min+1e-6*(m.max-m.min)||d<0&&u.maxX>=m.max-1e-6*(m.max-m.min)))return i.inertiaRAF=null,i.busy=!1,void this._fireScrolled();i.inertiaRAF=requestAnimationFrame(l)};i.inertiaRAF=requestAnimationFrame(l)}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>h.default});
|
|
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
/*!
|
|
21
|
-
* ApexCharts v8.
|
|
21
|
+
* ApexCharts v8.3.0
|
|
22
22
|
* (c) 2018-2026 ApexCharts
|
|
23
23
|
*/
|
|
24
24
|
import * as _core from "apexcharts/core";
|
|
@@ -1900,6 +1900,63 @@ class ZoomPanSelection extends Toolbar {
|
|
|
1900
1900
|
const { zoom } = this.w.config.chart;
|
|
1901
1901
|
return this._incidentalZoomEnabled(zoom && zoom.allowMouseWheelZoom);
|
|
1902
1902
|
}
|
|
1903
|
+
/** An explicit `true` zooms on every wheel; 'auto' needs Ctrl/Cmd. */
|
|
1904
|
+
_wheelZoomGreedy() {
|
|
1905
|
+
return this.w.config.chart.zoom.allowMouseWheelZoom === true;
|
|
1906
|
+
}
|
|
1907
|
+
/**
|
|
1908
|
+
* Tell a viewer whose bare wheel just scrolled past the chart how to zoom it.
|
|
1909
|
+
* Shown over the chart while the scroll goes on and faded out shortly after
|
|
1910
|
+
* it stops. Only for a mostly vertical wheel: a sideways trackpad swipe is
|
|
1911
|
+
* not someone reaching for zoom.
|
|
1912
|
+
*
|
|
1913
|
+
* The node lives in elWrap and the timer on w.interact, since a re-render can
|
|
1914
|
+
* replace both this instance and the wrapper's contents while it is up.
|
|
1915
|
+
*
|
|
1916
|
+
* @param {any} e
|
|
1917
|
+
*/
|
|
1918
|
+
_showWheelHint(e) {
|
|
1919
|
+
const w = this.w;
|
|
1920
|
+
if (w.config.chart.zoom.wheelHint === false) return;
|
|
1921
|
+
if (Math.abs(e.deltaY) <= Math.abs(e.deltaX)) return;
|
|
1922
|
+
const wrap = w.dom.elWrap;
|
|
1923
|
+
if (!wrap) return;
|
|
1924
|
+
let el = wrap.querySelector(".apexcharts-wheel-hint");
|
|
1925
|
+
if (!el) {
|
|
1926
|
+
const win = BrowserAPIs.getWindow();
|
|
1927
|
+
const nav = win && win.navigator;
|
|
1928
|
+
const mac = !!nav && /Mac|iPhone|iPad/.test(nav.platform || nav.userAgent);
|
|
1929
|
+
const text = (w.globals.locale.toolbar.wheelZoomHint || "").replace(
|
|
1930
|
+
"{key}",
|
|
1931
|
+
mac ? "⌘" : "Ctrl"
|
|
1932
|
+
);
|
|
1933
|
+
el = BrowserAPIs.createElement("div");
|
|
1934
|
+
el.className = "apexcharts-wheel-hint";
|
|
1935
|
+
el.setAttribute("aria-hidden", "true");
|
|
1936
|
+
const label = BrowserAPIs.createElement("span");
|
|
1937
|
+
label.textContent = text;
|
|
1938
|
+
label.style.fontFamily = w.config.chart.fontFamily;
|
|
1939
|
+
el.appendChild(label);
|
|
1940
|
+
wrap.appendChild(el);
|
|
1941
|
+
void /** @type {HTMLElement} */
|
|
1942
|
+
el.offsetWidth;
|
|
1943
|
+
}
|
|
1944
|
+
el.classList.add("apexcharts-wheel-hint-visible");
|
|
1945
|
+
const it = w.interact;
|
|
1946
|
+
if (it.wheelHintTimer) clearTimeout(it.wheelHintTimer);
|
|
1947
|
+
it.wheelHintTimer = setTimeout(() => this._hideWheelHint(), 1200);
|
|
1948
|
+
}
|
|
1949
|
+
_hideWheelHint() {
|
|
1950
|
+
var _a;
|
|
1951
|
+
const w = this.w;
|
|
1952
|
+
const it = w.interact;
|
|
1953
|
+
if (it.wheelHintTimer) {
|
|
1954
|
+
clearTimeout(it.wheelHintTimer);
|
|
1955
|
+
it.wheelHintTimer = null;
|
|
1956
|
+
}
|
|
1957
|
+
const el = (_a = w.dom.elWrap) == null ? void 0 : _a.querySelector(".apexcharts-wheel-hint");
|
|
1958
|
+
if (el) el.classList.remove("apexcharts-wheel-hint-visible");
|
|
1959
|
+
}
|
|
1903
1960
|
/**
|
|
1904
1961
|
* Put keyboard focus on the chart, where the chart is focusable at all.
|
|
1905
1962
|
*
|
|
@@ -1971,8 +2028,13 @@ class ZoomPanSelection extends Toolbar {
|
|
|
1971
2028
|
* @param {any} e
|
|
1972
2029
|
*/
|
|
1973
2030
|
mouseWheelEvent(e) {
|
|
1974
|
-
e.preventDefault();
|
|
1975
2031
|
const st = this._wheel();
|
|
2032
|
+
if (!this._wheelZoomGreedy() && !e.ctrlKey && !e.metaKey && st.endTimer == null) {
|
|
2033
|
+
this._showWheelHint(e);
|
|
2034
|
+
return;
|
|
2035
|
+
}
|
|
2036
|
+
e.preventDefault();
|
|
2037
|
+
this._hideWheelHint();
|
|
1976
2038
|
let dy = e.deltaY;
|
|
1977
2039
|
if (e.deltaMode === 1) dy *= 33;
|
|
1978
2040
|
else if (e.deltaMode === 2) dy *= 330;
|
|
@@ -2736,6 +2798,34 @@ class ZoomPanSelection extends Toolbar {
|
|
|
2736
2798
|
w.config.chart.events.scrolled(this.ctx, args);
|
|
2737
2799
|
this.ctx.events.fireEvent("scrolled", args);
|
|
2738
2800
|
}
|
|
2801
|
+
/**
|
|
2802
|
+
* Pan a zoomed x-window by `fraction` of its width (keyboard Shift+Arrow),
|
|
2803
|
+
* clamped to the data as a drag pan is, and reported as one (`scrolled`).
|
|
2804
|
+
* @param {number} fraction
|
|
2805
|
+
*/
|
|
2806
|
+
panBy(fraction) {
|
|
2807
|
+
const w = this.w;
|
|
2808
|
+
if (!w.interact.zoomed) return;
|
|
2809
|
+
const { min, max } = this._currentXWindow();
|
|
2810
|
+
let d = (max - min) * fraction;
|
|
2811
|
+
if (w.config.xaxis.convertedCatToNumeric) {
|
|
2812
|
+
d = d > 0 ? Math.ceil(d) : Math.floor(d);
|
|
2813
|
+
}
|
|
2814
|
+
if (w.axisFlags.isRangeBar) {
|
|
2815
|
+
const r = w.rangeData;
|
|
2816
|
+
let lo = Infinity;
|
|
2817
|
+
let hi = -Infinity;
|
|
2818
|
+
r.seriesRangeStart.concat(r.seriesRangeEnd).flat().forEach((y) => {
|
|
2819
|
+
if (y != null) {
|
|
2820
|
+
lo = Math.min(lo, y);
|
|
2821
|
+
hi = Math.max(hi, y);
|
|
2822
|
+
}
|
|
2823
|
+
});
|
|
2824
|
+
d = d > 0 ? Math.min(d, Math.max(0, hi - max)) : Math.max(d, Math.min(0, lo - min));
|
|
2825
|
+
if (!d) return;
|
|
2826
|
+
}
|
|
2827
|
+
if (this._applyXRange(min + d, max + d, false)) this._fireScrolled();
|
|
2828
|
+
}
|
|
2739
2829
|
/** @param {number} x @param {number} t */
|
|
2740
2830
|
_pushSample(x, t) {
|
|
2741
2831
|
const s = this._m().samples;
|