UNPKG

apexcharts

Version:

A JavaScript Chart Library

6 lines 182 kB
/*!
 * ApexCharts v7.0.0
 * (c) 2018-2026 ApexCharts
 */
"use strict";var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,r=(e,i,s)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s,o=(t,e)=>{for(var i in e||(e={}))n.call(e,i)&&r(t,i,e[i]);if(s)for(var i of s(e))a.call(e,i)&&r(t,i,e[i]);return t},l=(t,s)=>e(t,i(s));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_axes_AxesUtils,u=h.__apex_Data,g=h.__apex_Series,p=h.__apex_Utils,f=h.__apex_Environment_Environment,m=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],a=document.createElementNS(x,"image");a.setAttribute("x",n.getAttribute("x")||"0"),a.setAttribute("y",n.getAttribute("y")||"0"),a.setAttribute("width",n.getAttribute("width")||"0"),a.setAttribute("height",n.getAttribute("height")||"0"),a.setAttribute("href",s),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s),n.parentNode&&n.parentNode.replaceChild(a,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(!f.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=m.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(!f.isBrowser())return Promise.resolve([]);const t=[],e=[],i=e=>{(e.match(/@font-face\s*\{[^}]*\}/gi)||[]).forEach(e=>{const i=e.match(/font-family\s*:\s*([^;}]+)/i);if(!i)return;const s=i[1].trim().replace(/^['"]|['"]$/g,"");t.push({family:s.toLowerCase(),css:e})})};return Array.from(document.styleSheets||[]).forEach(t=>{let s=null;try{s=t.cssRules}catch(t){s=null}s?Array.from(s).forEach(t=>{5===t.type&&t.cssText&&i(t.cssText)}):t.href&&e.push(fetch(t.href).then(t=>t.ok?t.text():"").then(i).catch(()=>{}))}),Promise.all(e).then(()=>t)}embedFonts(t){const e=this.w;if(!f.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).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){const e=[],i=/url\(\s*(['"]?)([^'")]+)\1\s*\)/gi;let s;for(;null!==(s=i.exec(t));)s[2].startsWith("data:")||e.push(s[2]);return e.length?Promise.all(e.map(t=>this.fetchAsDataUri(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=>{const i=this.w;let s=t||i.config.chart.toolbar.export.scale||i.config.chart.toolbar.export.width/i.globals.svgWidth;s||(s=1);const n=i.globals.svgWidth*s,a=i.globals.svgHeight*s,r=i.dom.elWrap.cloneNode(!0);r.style.width=n+"px",r.style.height=a+"px",this.inlineCanvasLayers(r),this.applyExportStyles(r);const o=(new XMLSerializer).serializeToString(r);let l=`\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="${i.globals.svgWidth}px" height="${i.globals.svgHeight}px">\n          <foreignObject width="100%" height="100%">\n            <div xmlns="http://www.w3.org/1999/xhtml" style="width:${n}px; height:${a}px;">\n              ${o}\n            </div>\n          </foreignObject>\n        </svg>\n      `;const c=this.svgStringToNode(l);1!==s&&this.scaleSvgNode(c,s),Promise.all([this.convertImagesToBase64(c),this.embedFonts(c)]).then(()=>{l=(new XMLSerializer).serializeToString(c),e(l.replace(/&nbsp;/g,"&#160;"))})})}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 a=n=>{i&&t.setAttributeNS(e,"href",n),!s&&i||t.setAttribute("href",n)};return this.fetchAsDataUri(n).then(a).catch(()=>this.getBase64FromUrl(n).then(a).catch(t=>{}))});return Promise.all(s)}getBase64FromUrl(t){return f.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 f.isSSR()?Promise.resolve({imgURI:""}):new Promise(e=>{const i=this.w,s=t?t.scale||t.width/i.globals.svgWidth:1,n=document.createElement("canvas");n.width=i.globals.svgWidth*s,n.height=parseInt(i.dom.elWrap.style.height,10)*s;const a=this.resolveExportBackground(),r=n.getContext("2d");r&&(r.fillStyle=a,r.fillRect(0,0,n.width,n.height),this.getSvgString(s).then(t=>{const i="data:image/svg+xml,"+encodeURIComponent(t),s=new Image;s.crossOrigin="anonymous",s.onload=()=>{r.drawImage(s,0,0);const t=n;if(t.msToBlob){const i=t.msToBlob();e({blob:i})}else{const t=n.toDataURL("image/png");e({imgURI:t})}},s.src=i}))})}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"):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;t||(t=n.config.series);let a=[];const r=[];let o="";const l=n.seriesData.series.map((t,e)=>-1===n.globals.collapsedSeriesIndices.indexOf(e)?t:[]),c=t=>{if(null==t||p.isNumber(t))return t;const e=String(t);return/^[=+\-@\t\r]/.test(e)?`'${e}`:e},h=t=>"function"==typeof n.config.chart.toolbar.export.csv.categoryFormatter?n.config.chart.toolbar.export.csv.categoryFormatter(t):"datetime"===n.config.xaxis.type&&String(t).length>=10?new Date(t).toDateString():p.isNumber(t)?t:c(t.split(i).join("")),f=t=>"function"==typeof n.config.chart.toolbar.export.csv.valueFormatter?n.config.chart.toolbar.export.csv.valueFormatter(t):c(t),m=Math.max(...t.map(t=>t.data?t.data.length:0)),x=new u(this.w),b=new d(this.w,{theme:this.ctx.theme,timeScale:this.ctx.timeScale}),y=t=>{let e="";if(n.globals.axisCharts){if("category"===n.config.xaxis.type||n.config.xaxis.convertedCatToNumeric)if(n.globals.isBarHorizontal){const i=n.formatters.yLabelFormatters[0],s=new g(this.ctx.w).getActiveConfigSeriesIndex();e=i(n.labelData.labels[t],{seriesIndex:s,dataPointIndex:t,w:n})}else e=b.getLabel(n.labelData.labels,n.labelData.timescaleLabels,0,t).text;"datetime"===n.config.xaxis.type&&(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 null===e?"nullvalue":(Array.isArray(e)&&(e=e.join(" ")),p.isNumber(e)?e:e.split(i).join(""))},w=(e,s)=>{var o,c,d,u,g,p;if(a.length&&0===s&&r.push(a.join(i)),e.data){const b=e.data.length?e.data:[...Array(m)].map(()=>"");for(let m=0;m<b.length;m++){a=[];let b=y(m);if("nullvalue"!==b){if(b||(x.isFormatXY()?b=t[s].data[m].x:x.isFormat2DArray()&&(b=t[s].data[m]?t[s].data[m][0]:"")),0===s){a.push(h(b));for(let e=0;e<n.seriesData.series.length;e++){const i=x.isFormatXY()?null==(o=t[e].data[m])?void 0:o.y:l[e][m];a.push(f(i))}}("candlestick"===n.config.chart.type||e.type&&"candlestick"===e.type)&&(a.pop(),a.push(n.candleData.seriesCandleO[s][m]),a.push(n.candleData.seriesCandleH[s][m]),a.push(n.candleData.seriesCandleL[s][m]),a.push(n.candleData.seriesCandleC[s][m])),("boxPlot"===n.config.chart.type||e.type&&"boxPlot"===e.type)&&(a.pop(),a.push(n.candleData.seriesCandleO[s][m]),a.push(n.candleData.seriesCandleH[s][m]),a.push(n.candleData.seriesCandleM[s][m]),a.push(n.candleData.seriesCandleL[s][m]),a.push(n.candleData.seriesCandleC[s][m])),"rangeBar"===n.config.chart.type&&(a.pop(),a.push(n.rangeData.seriesRangeStart[s][m]),a.push(n.rangeData.seriesRangeEnd[s][m])),("violin"===n.config.chart.type||e.type&&"violin"===e.type)&&(a.pop(),a.push(null==(c=n.violinData.seriesViolinMin[s])?void 0:c[m]),a.push(null==(d=n.violinData.seriesViolinMax[s])?void 0:d[m]),a.push(null!=(p=null==(g=null==(u=n.violinData.seriesViolinPoints[s])?void 0:u[m])?void 0:g.length)?p:0)),a.length&&r.push(a.join(i))}}}};a.push(n.config.chart.toolbar.export.csv.headerCategory),"boxPlot"===n.config.chart.type?(a.push("minimum"),a.push("q1"),a.push("median"),a.push("q3"),a.push("maximum")):"candlestick"===n.config.chart.type?(a.push("open"),a.push("high"),a.push("low"),a.push("close")):"rangeBar"===n.config.chart.type?(a.push("minimum"),a.push("maximum")):"violin"===n.config.chart.type?(a.push("minimum"),a.push("maximum"),a.push("observations")):t.map((t,e)=>{const s=(t.name?t.name:`series-${e}`)+"";n.globals.axisCharts&&a.push(s.split(i).join("")?s.split(i).join(""):`series-${e}`)}),n.globals.axisCharts||(a.push(n.config.chart.toolbar.export.csv.headerValue),r.push(a.join(i))),n.globals.allSeriesHasEqualX||!n.globals.axisCharts||n.config.xaxis.categories.length||n.config.labels.length?t.map((t,e)=>{n.globals.axisCharts?w(t,e):(a=[],a.push(h(n.labelData.labels[e])),a.push(f(l[e])),r.push(a.join(i)))}):(()=>{const e=new Set,s={};t.forEach((i,n)=>{null==i||i.data.forEach(i=>{let a,r;if(x.isFormatXY())a=i.x,r=i.y;else{if(!x.isFormat2DArray())return;a=i[0],r=i[1]}s[a]||(s[a]=Array(t.length).fill("")),s[a][n]=f(r),e.add(a)})}),a.length&&r.push(a.join(i)),Array.from(e).sort().forEach(t=>{const e=s[t];r.push([h(t),...e].join(i))})})(),o+=r.join(s),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\ufeff"+o),e||n.config.chart.toolbar.export.csv.filename,".csv")}triggerDownload(t,e,i){if(f.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)}}h.default.registerFeatures({exports:b});const y=h.__apex_CoreUtils,w=h.__apex_dimensions_Dimensions,v=h.__apex_Graphics;let A=class{constructor(t){this.w=t.w,this.lgCtx=t}getLegendStyles(){if(f.isSSR())return null;const t=document.createElement("style");t.setAttribute("type","text/css");const e=this.w.config.chart.nonce;e&&t.setAttribute("nonce",e);const i=document.createTextNode(".apexcharts-flip-y {\n  transform: scaleY(-1) translateY(-100%);\n  transform-origin: top;\n  transform-box: fill-box;\n}\n.apexcharts-flip-x {\n  transform: scaleX(-1);\n  transform-origin: center;\n  transform-box: fill-box;\n}\n.apexcharts-legend {\n  display: flex;\n  overflow: auto;\n  padding: 0 10px;\n}\n.apexcharts-legend.apexcharts-legend-group-horizontal {\n  flex-direction: column;\n}\n.apexcharts-legend-group {\n  display: flex;\n}\n.apexcharts-legend-group-vertical {\n  flex-direction: column-reverse;\n}\n.apexcharts-legend.apx-legend-position-bottom, .apexcharts-legend.apx-legend-position-top {\n  flex-wrap: wrap\n}\n.apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left {\n  flex-direction: column;\n  bottom: 0;\n}\n.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-left, .apexcharts-legend.apx-legend-position-top.apexcharts-align-left, .apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left {\n  justify-content: flex-start;\n  align-items: flex-start;\n}\n.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-center, .apexcharts-legend.apx-legend-position-top.apexcharts-align-center {\n  justify-content: center;\n  align-items: center;\n}\n.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-right, .apexcharts-legend.apx-legend-position-top.apexcharts-align-right {\n  justify-content: flex-end;\n  align-items: flex-end;\n}\n.apexcharts-legend-series {\n  cursor: pointer;\n  line-height: normal;\n  display: flex;\n  align-items: center;\n}\n.apexcharts-legend-text {\n  position: relative;\n  font-size: 14px;\n}\n.apexcharts-legend-text *, .apexcharts-legend-marker * {\n  pointer-events: none;\n}\n.apexcharts-legend-marker {\n  position: relative;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  cursor: pointer;\n  margin-right: 1px;\n}\n\n.apexcharts-legend-series.apexcharts-no-click {\n  cursor: auto;\n}\n.apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series {\n  display: none !important;\n}\n.apexcharts-inactive-legend {\n  opacity: 0.45;\n} ");return t.appendChild(i),t}getLegendDimensions(){const t=this.w.dom.baseEl.querySelector(".apexcharts-legend");if(!t)return{clwh:0,clww:0};const{width:e,height:i}=t.getBoundingClientRect();return{clwh:i,clww:e}}appendToForeignObject(){var t;const e=this.getLegendStyles();!1!==this.w.config.chart.injectStyleSheet&&e&&(null==(t=this.w.dom.elLegendForeign)||t.appendChild(e))}toggleDataSeries(t,e){var i,s,n;const a=this.w;if(a.globals.axisCharts||"radialBar"===a.config.chart.type){a.globals.resized=!0;let r=null,o=null;if(a.globals.risingSeries=[],a.globals.axisCharts){if(r=null!=(i=Array.prototype.find.call(a.dom.baseEl.querySelectorAll(".apexcharts-series"),e=>e.getAttribute("data:realIndex")===String(t)))?i:null,!r)return;o=parseInt(null!=(s=r.getAttribute("data:realIndex"))?s:"",10)}else{if(r=a.dom.baseEl.querySelector(`.apexcharts-series[rel='${t+1}']`),!r)return;o=parseInt(null!=(n=r.getAttribute("rel"))?n:"",10)-1}if(e){[{cs:a.globals.collapsedSeries,csi:a.globals.collapsedSeriesIndices},{cs:a.globals.ancillaryCollapsedSeries,csi:a.globals.ancillaryCollapsedSeriesIndices}].forEach(t=>{const e=t.cs,i=t.csi;this.riseCollapsedSeries(e,i,o)})}else this.hideSeries({seriesEl:r,realIndex:o});if(a.config.chart.accessibility.enabled){const e=a.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${t+1}"]`);if(e){const i=a.globals.collapsedSeriesIndices.includes(o)||a.globals.ancillaryCollapsedSeriesIndices.includes(o);e.setAttribute("aria-pressed",i?"true":"false");const s=e.querySelector(".apexcharts-legend-text"),n=s?s.textContent:a.seriesData.seriesNames[t],r=i?"hidden":"visible";e.setAttribute("aria-label",`${n}, ${r}. Press Enter or Space to toggle.`)}}}else{if(a.globals.resized=!0,a.globals.risingSeries=[],e)this.riseCollapsedSeries(a.globals.collapsedSeries,a.globals.collapsedSeriesIndices,t);else{const e=this.getSeriesAfterCollapsing({realIndex:t});this.lgCtx.updateSeries(e,a.config.chart.animations.dynamicAnimation.enabled)}if(a.config.chart.accessibility.enabled){const e=a.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${t+1}"]`);if(e){const i=a.globals.collapsedSeriesIndices.includes(t);e.setAttribute("aria-pressed",i?"true":"false");const s=e.querySelector(".apexcharts-legend-text"),n=s?s.textContent:a.seriesData.seriesNames[t],r=i?"hidden":"visible";e.setAttribute("aria-label",`${n}, ${r}. Press Enter or Space to toggle.`)}}}}_nonAxisSliceContainer(t){const e=this.w.config.chart.type;return("pie"===e||"donut"===e||"polarArea"===e||"sunburst"===e)&&1===t.length&&t[0]&&"object"==typeof t[0]&&Array.isArray(t[0].data)?t[0].data:t}_readSliceValue(t){return"unit"===this.w.config.chart.type&&t&&Array.isArray(t.data)?t.data:t&&"object"==typeof t?t.y:t}_writeSliceValue(t,e,i){const s=t[e];"unit"===this.w.config.chart.type&&s&&Array.isArray(s.data)?s.data=Array.isArray(i)?i:[]:s&&"object"==typeof s?s.y=i:t[e]=i}getSeriesAfterCollapsing({realIndex:t}){var e,i;const s=this.w,n=s.globals,a=p.clone(s.config.series);if(n.axisCharts){const e=s.config.yaxis[n.seriesYAxisReverseMap[t]],i={index:t,data:a[t].data.slice(),type:a[t].type||s.config.chart.type,name:(n.seriesNames||[])[t]};if(e&&e.show&&e.showAlways)n.ancillaryCollapsedSeriesIndices.indexOf(t)<0&&(n.ancillaryCollapsedSeries.push(i),n.ancillaryCollapsedSeriesIndices.push(t));else if(n.collapsedSeriesIndices.indexOf(t)<0){n.collapsedSeries.push(i),n.collapsedSeriesIndices.push(t);const e=n.risingSeries.indexOf(t);n.risingSeries.splice(e,1)}}else if(n.collapsedSeriesIndices.indexOf(t)<0){const r=this._nonAxisSliceContainer(a);n.collapsedSeries.push({index:t,data:this._readSliceValue(r[t]),type:null!=(i=null==(e=s.config.series[t])?void 0:e.type)?i:"line",name:(n.seriesNames||[])[t]}),n.collapsedSeriesIndices.push(t)}const r=n.axisCharts?s.config.series.length:this._nonAxisSliceContainer(a).length;return n.allSeriesCollapsed=n.collapsedSeries.length+n.ancillaryCollapsedSeries.length===r,this._getSeriesBasedOnCollapsedState(a)}hideSeries({seriesEl:t,realIndex:e}){const i=this.w,s=this.getSeriesAfterCollapsing({realIndex:e}),n=t.childNodes;for(let t=0;t<n.length;t++)n[t].classList.contains("apexcharts-series-markers-wrap")&&(n[t].classList.contains("apexcharts-hide")?n[t].classList.remove("apexcharts-hide"):n[t].classList.add("apexcharts-hide"));const a=i.config.chart.animations.dynamicAnimation.enabled;a&&(i.globals.collapsingSeriesIndices=[e]);const r=()=>{i.globals.collapsingSeriesIndices=[]},o=this.lgCtx.updateSeries(s,a);r(),o&&"function"==typeof o.then&&o.then(r,r)}riseCollapsedSeries(t,e,i){const s=this.w;let n=p.clone(s.config.series);if(t.length>0){for(let a=0;a<t.length;a++)if(t[a].index===i){if(s.globals.axisCharts)n[i].data=t[a].data.slice(),n[i].hidden=!1;else{const e=this._nonAxisSliceContainer(n);this._writeSliceValue(e,i,t[a].data)}t.splice(a,1),e.splice(a,1),s.globals.risingSeries.push(i),a--}n=this._getSeriesBasedOnCollapsedState(n),this.lgCtx.updateSeries(n,s.config.chart.animations.dynamicAnimation.enabled)}}_getSeriesBasedOnCollapsedState(t){const e=this.w;let i=0;if(e.globals.axisCharts)t.forEach((s,n)=>{e.globals.collapsedSeriesIndices.indexOf(n)<0&&e.globals.ancillaryCollapsedSeriesIndices.indexOf(n)<0||(t[n].data=[],i++)});else{const s=this._nonAxisSliceContainer(t);s.forEach((t,n)=>{e.globals.collapsedSeriesIndices.indexOf(n)<0||(this._writeSliceValue(s,n,0),i++)})}const s=e.globals.axisCharts?t.length:this._nonAxisSliceContainer(t).length;return e.globals.allSeriesCollapsed=i===s,t}};const _=["#cf4d3f","#8f9499","#26a75b"],S=(t,e,i)=>t+(e-t)*i;function C(t){return Math.max(0,Math.min(255,Math.round(t))).toString(16).padStart(2,"0")}function E(t,e,i){const s=p.parseHex(k(t)),n=p.parseHex(k(e));return s&&n?"#"+C(S(s[0],n[0],i))+C(S(s[1],n[1],i))+C(S(s[2],n[2],i)):t}function k(t){if("string"!=typeof t)return"#000000";if(p.isColorHex(t))return t;return p.rgb2hex(t)||"#000000"}function M(t,e,i,s){var n,a,r;if(!e||"object"!=typeof e)return null;const o=null==(r=null==(a=null==(n=t.config.plotOptions)?void 0:n.treemap)?void 0:a.colorScale)?void 0:r.colorValue;let l;if(l="function"==typeof o?o(e,{seriesIndex:i,dataPointIndex:s,w:t}):"string"==typeof o?e[o]:e.colorValue,null==l)return null;const c=Number(l);return Number.isFinite(c)?c:null}function I(t){var e,i,s;const n=null==(s=null==(i=null==(e=t.config)?void 0:e.plotOptions)?void 0:i.treemap)?void 0:s.colorScale,a=n&&n.gradient;if(!a)return null;if(!1===a.enabled)return null;const r=t.config.series||[];let o=1/0,l=-1/0,c=!1;for(let e=0;e<r.length;e++){const i=r[e]&&r[e].data;if(Array.isArray(i))for(let s=0;s<i.length;s++){const n=M(t,i[s],e,s);null!=n&&(c=!0,n<o&&(o=n),n>l&&(l=n))}}if(!c&&!0!==a.enabled)return null;Number.isFinite(o)||(o=0,l=0);let h=Number.isFinite(Number(a.min))?Number(a.min):o,d=Number.isFinite(Number(a.max))?Number(a.max):l,u=null;if(null===a.midpoint?u=null:Number.isFinite(Number(a.midpoint))?u=Number(a.midpoint):h<0&&d>0&&(u=0),null!=u&&!1!==a.symmetric&&!Number.isFinite(Number(a.min))&&!Number.isFinite(Number(a.max))){const t=Math.max(Math.abs(h-u),Math.abs(d-u));h=u-t,d=u+t}d===h&&(h-=.5,d+=.5);const g=function(t,e,i,s){if(Array.isArray(t.stops)&&t.stops.length>=2)return t.stops.filter(t=>t&&Number.isFinite(Number(t.value))).map(t=>({value:Number(t.value),color:k(t.color)})).sort((t,e)=>t.value-e.value);const n=(Array.isArray(t.colors)&&t.colors.length>=2?t.colors:_).map(k),a=n.length;if(null!=s&&a>=3){const t=Math.floor((a-1)/2),r=[];for(let i=0;i<=t;i++)r.push({value:S(e,s,i/t),color:n[i]});for(let e=t+1;e<a;e++)r.push({value:S(s,i,(e-t)/(a-1-t)),color:n[e]});return r}return n.map((t,s)=>({value:S(e,i,s/(a-1)),color:t}))}(a,h,d,u);if(g.length<2)return null;const p=d-h,f=g.map(t=>({percent:0===p?0:(t.value-h)/p,color:t.color}));return{min:h,max:d,midpoint:u,stops:g,at:t=>{if(!Number.isFinite(t))return g[Math.floor(g.length/2)].color;if(t<=g[0].value)return g[0].color;const e=g[g.length-1];if(t>=e.value)return e.color;for(let e=1;e<g.length;e++){const i=g[e];if(t<=i.value){const s=g[e-1],n=i.value-s.value,a=0===n?0:(t-s.value)/n;return E(s.color,i.color,a)}}return e.color},legendStops:f}}const P="http://www.w3.org/2000/svg";class L{constructor(t,e){this.w=t,this.ctx=e,this.svgEl=null,this.arrowEl=null,this.hoverValueEl=null,this._min=0,this._max=0,this._geom=null,this._bandHitEls=[],this._activeBandIndex=-1,this._targetEl=null,this._onCellEnter=this._onCellEnter.bind(this),this._onCellLeave=this._onCellLeave.bind(this),this._onBandEnter=this._onBandEnter.bind(this),this._onBandLeave=this._onBandLeave.bind(this)}_getFormatter(){const t=this._cfg();return"function"==typeof t.formatter?t.formatter:t=>{if(!Number.isFinite(t))return String(t);const e=Math.abs(t);return e>=1e3?t.toFixed(0):e>=10?t.toFixed(1):t.toFixed(2)}}static colorScaleOf(t){var e,i,s,n,a;const r=null==(i=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:i.type;return r&&(null==(a=null==(n=null==(s=null==t?void 0:t.config)?void 0:s.plotOptions)?void 0:n[r])?void 0:a.colorScale)||null}static configFor(t){const e=L.colorScaleOf(t);return e&&e.gradientLegend||null}_cfg(){return L.configFor(this.w)||{}}static isEnabled(t){if(!L.supports(t))return!1;const e=L.configFor(t);return!(!e||!e.enabled)}static supports(t){var e,i;const s=null==(i=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:i.type;return"heatmap"===s||"treemap"===s}draw(t=null){var e,i,s,n,a,r,o,l;const c=this.w;this._targetEl=t;const h=t||c.dom.elLegendWrap;if(!h)return;const d=this._cfg(),u=c.config.legend.position,g="left"===u||"right"===u,p=null!=(i=null==(e=d.arrow)?void 0:e.size)?i:8,f=p+4,x=d.showLabels?28:4,b=d.showLabels?20:4,y=d.showLabels?44:0,w=this._resolveStripLength(g?d.height:d.width,g),v=d.thickness,A=g?Math.max(v+f+4,y):w+2*x,_=g?w+2*b:v+f+4,S=(A-(v+f))/2,C=g?"left"===u?S:S+f:x,E=g?b:"top"===u?f:4,k=m.createElementNS(P,"svg");k.setAttribute("class","apexcharts-heatmap-gradient-legend apexcharts-gradient-legend"),k.setAttribute("width",String(A)),k.setAttribute("height",String(_)),k.setAttribute("overflow","visible");const M=m.createElementNS(P,"defs"),I=`apexcharts-heatmap-gradient-${c.globals.cuid}`,L=m.createElementNS(P,"linearGradient");L.setAttribute("id",I),g?(L.setAttribute("x1","0"),L.setAttribute("y1","1"),L.setAttribute("x2","0"),L.setAttribute("y2","0")):(L.setAttribute("x1","0"),L.setAttribute("y1","0"),L.setAttribute("x2","1"),L.setAttribute("y2","0"));const{min:D,max:X,stops:R,bands:F}=this._computeStops();this._min=D,this._max=X,R.forEach(t=>{const e=m.createElementNS(P,"stop");e.setAttribute("offset",`${(100*t.percent).toFixed(2)}%`),e.setAttribute("stop-color",t.color),L.appendChild(e)}),M.appendChild(L),k.appendChild(M);const $=m.createElementNS(P,"rect");if($.setAttribute("x",String(C)),$.setAttribute("y",String(E)),$.setAttribute("width",String(g?v:w)),$.setAttribute("height",String(g?w:v)),$.setAttribute("rx","2"),$.setAttribute("fill",`url(#${I})`),k.appendChild($),d.showLabels){const t=(null==(s=d.labelStyle)?void 0:s.colors)||(Array.isArray(c.config.legend.labels.colors)?c.config.legend.labels.colors[0]:c.config.legend.labels.colors)||c.config.chart.foreColor,e=(null==(n=d.labelStyle)?void 0:n.fontSize)||"11px",i=(null==(a=d.labelStyle)?void 0:a.fontFamily)||c.config.chart.fontFamily,r=this._getFormatter(),o=(s,n,a,r)=>{const o=m.createElementNS(P,"text");return o.setAttribute("x",String(n)),o.setAttribute("y",String(a)),o.setAttribute("text-anchor",r),o.setAttribute("dominant-baseline","middle"),o.setAttribute("fill",t),o.setAttribute("font-size",e),i&&o.setAttribute("font-family",i),o.textContent=String(s),o};if(g){const t=C+v/2;k.appendChild(o(r(D),t,E+w+10,"middle")),k.appendChild(o(r(X),t,E-10,"middle"))}else{const t=E+v/2;k.appendChild(o(r(D),C-6,t,"end")),k.appendChild(o(r(X),C+w+6,t,"start"))}}const T=(null==(r=d.arrow)?void 0:r.color)||c.config.chart.foreColor,B=this._buildArrow(p,T,u);if(k.appendChild(B),this.arrowEl=B,this._bandHitEls=[],c.config.legend.onItemHover.highlightDataSeries&&F.length>0&&F.forEach(t=>{const e=m.createElementNS(P,"rect");if(g){const i=E+w-t.p2*w,s=E+w-t.p1*w;e.setAttribute("x",String(C)),e.setAttribute("y",String(i)),e.setAttribute("width",String(v)),e.setAttribute("height",String(Math.max(0,s-i)))}else e.setAttribute("x",String(C+t.p1*w)),e.setAttribute("y",String(E)),e.setAttribute("width",String(Math.max(0,(t.p2-t.p1)*w))),e.setAttribute("height",String(v));e.setAttribute("fill","transparent"),e.setAttribute("class","apexcharts-heatmap-gradient-band"),e.setAttribute("data:range-index",String(t.index)),e.style.cursor="pointer",k.appendChild(e),this._bandHitEls.push(e)}),this._geom={isVertical:g,position:u,stripX:C,stripY:E,stripLength:w,stripThickness:v,arrowSize:p,svgWidth:A,svgHeight:_},d.showHoverValue){const t=m.createElement("div");t.classList.add("apexcharts-heatmap-gradient-legend-value"),t.style.position="absolute",t.style.fontSize=(null==(o=d.labelStyle)?void 0:o.fontSize)||"11px",t.style.fontFamily=(null==(l=d.labelStyle)?void 0:l.fontFamily)||c.config.chart.fontFamily||"",t.style.color=c.config.chart.foreColor,t.style.background="rgba(0,0,0,0.65)",t.style.color="#fff",t.style.padding="2px 6px",t.style.borderRadius="3px",t.style.pointerEvents="none",t.style.whiteSpace="nowrap",t.style.opacity="0",t.style.transition="opacity 120ms ease",this.hoverValueEl=t}h.classList.add("apexcharts-heatmap-gradient-legend-wrap"),h.classList.add("apx-legend-position-"+u),h.appendChild(k),this.hoverValueEl&&h.appendChild(this.hoverValueEl),this.svgEl=k,t?(h.style.width=A+"px",h.style.height=_+"px",h.style.position="relative",h.style.overflow="visible"):this._applyWrapAlignment(h,u,g,A,_),this._attachHoverListeners(),this._attachBandHoverListeners()}_resolveStripLength(t,e){const i=this.w,s=e?i.globals.svgHeight||i.config.chart.height||300:i.globals.svgWidth||i.config.chart.width||600;if("string"==typeof t){const e=t.trim();if(e.endsWith("%")){const t=parseFloat(e)||0;return Math.max(20,s*t/100)}const i=parseFloat(e);return Number.isFinite(i)?i:200}return"number"==typeof t&&Number.isFinite(t)?t:200}_applyWrapAlignment(t,e,i,s,n){const a=this.w,r=this._cfg().align||"center",o=12,l=a.globals.svgWidth||a.config.chart.width||600,c=a.globals.svgHeight||a.config.chart.height||300,h=a.config.legend.offsetX||0,d=a.config.legend.offsetY||0;if(t.style.position="absolute",t.style.display="block",t.style.overflow="visible",t.style.padding="0",t.style.width=s+"px",t.style.height=n+"px",t.style.right="auto",t.style.bottom="auto",i){const i=c-n-24;let a;a="start"===r?o:"end"===r?o+Math.max(0,i):o+Math.max(0,i)/2,t.style.top=a+d+"px",t.style.left="left"===e?o+h+"px":l-s-o+h+"px"}else{const i=l-s-24;let a;a="start"===r?o:"end"===r?o+Math.max(0,i):o+Math.max(0,i)/2,t.style.left=a+h+"px",t.style.top="top"===e?o+d+"px":c-n-o+d+"px"}}repositionToPlot(){var t,e;if(!f.isBrowser())return;if(this._targetEl)return;const i=this.w,s=i.globals,n=i.dom.elLegendWrap;if(!n||!this._geom)return;if(!Number.isFinite(s.gridWidth)||!Number.isFinite(s.gridHeight))return;const{isVertical:a,position:r,svgWidth:o,svgHeight:l,stripX:c,stripY:h,stripThickness:d}=this._geom,u=this._cfg().align||"center",g=i.config.legend.offsetX||0,p=i.config.legend.offsetY||0,x=null==(e=null==(t=this.ctx)?void 0:t.dimensions)?void 0:e.dimHelpers,b=x?x.getTitleSubtitleCoords("title").height+x.getTitleSubtitleCoords("subtitle").height:0,y=i.layout.xAxisHeight||0,w=(t,e)=>{const i=Math.max(0,t-e);return"start"===u?0:"end"===u?i:i/2};if(a){n.style.top=s.translateY+w(s.gridHeight,l)+p+"px";const t=(("left"===r?0:s.translateX+s.gridWidth)+("left"===r?s.translateX:s.svgWidth))/2;n.style.left=t-c-d/2+g+"px"}else{n.style.left=s.translateX+w(s.gridWidth,o)+g+"px";const t=(("top"===r?b:s.translateY+s.gridHeight+y)+("top"===r?s.translateY:s.svgHeight))/2;n.style.top=t-h-d/2+p+"px"}m.requestAnimationFrame(()=>this._enforceMinPlotGap())}_enforceMinPlotGap(){const t=this.w,e=t.dom.elLegendWrap,i=this.svgEl&&this.svgEl.querySelector("rect"),s=t.dom.baseEl.querySelector(".apexcharts-grid");if(!(e&&i&&s&&this._geom))return;const n=i.getBoundingClientRect(),a=s.getBoundingClientRect();if(!(n.width&&n.height&&a.width&&a.height))return;const{isVertical:r,position:o}=this._geom;if(r){const t="left"===o?a.left-n.right:n.left-a.right;if(t<16){const i=parseFloat(e.style.left)||0,s=16-t;e.style.left=i+("left"===o?-s:s)+"px"}}else{const t="top"===o?a.top-n.bottom:n.top-a.bottom;if(t<16){const i=parseFloat(e.style.top)||0,s=16-t;e.style.top=i+("top"===o?-s:s)+"px"}}}destroy(){var t,e,i,s,n,a,r;for(let i=0;i<this._bandHitEls.length;i++){const s=this._bandHitEls[i];null==(t=s.removeEventListener)||t.call(s,"mousemove",this._onBandEnter),null==(e=s.removeEventListener)||e.call(s,"mouseout",this._onBandLeave)}if(this._bandHitEls=[],this._activeBandIndex=-1,null==(i=this.ctx)?void 0:i.events)try{null==(n=(s=this.ctx.events).removeEventListener)||n.call(s,"dataPointMouseEnter",this._onCellEnter),null==(r=(a=this.ctx.events).removeEventListener)||r.call(a,"dataPointMouseLeave",this._onCellLeave)}catch(t){}}_attachBandHoverListeners(){if(f.isBrowser())for(let t=0;t<this._bandHitEls.length;t++){const e=this._bandHitEls[t];e.addEventListener("mousemove",this._onBandEnter),e.addEventListener("mouseout",this._onBandLeave)}}_onBandEnter(t){var e,i,s,n;const a=this.w,r=t.currentTarget,o=parseInt(null!=(e=r.getAttribute("data:range-index"))?e:"-1",10);o<0||o===this._activeBandIndex||(this._activeBandIndex=o,null==(n=null==(s=null==(i=this.ctx)?void 0:i.events)?void 0:s.fireEvent)||n.call(s,"legendHover",[this.ctx,o,a]),new g(a).highlightRangeInSeries(o,"highlight"))}_onBandLeave(){if(this._activeBandIndex<0)return;const t=this._activeBandIndex;this._activeBandIndex=-1,new g(this.w).highlightRangeInSeries(t,"reset")}_attachHoverListeners(){var t,e;f.isBrowser()&&(null==(e=null==(t=this.ctx)?void 0:t.events)?void 0:e.addEventListener)&&(this.ctx.events.addEventListener("dataPointMouseEnter",this._onCellEnter),this.ctx.events.addEventListener("dataPointMouseLeave",this._onCellLeave))}_onCellEnter(...t){var e,i,s;const n=this.w;if(!this.arrowEl)return;const a=t[t.length-1];if(!a||"object"!=typeof a)return;const r=a.seriesIndex,o=a.dataPointIndex;if("number"!=typeof r||"number"!=typeof o)return;if(!L.supports(n))return;let l;l=this._continuous?function(t,e,i){const s=t.config.series[e];return M(t,s&&Array.isArray(s.data)?s.data[i]:null,e,i)}(n,r,o):null==(s=null==(i=null==(e=n.seriesData)?void 0:e.series)?void 0:i[r])?void 0:s[o],null==l||Number.isNaN(l)||this._positionArrow(l)}_onCellLeave(){this.arrowEl&&(this.arrowEl.setAttribute("opacity","0"),this.hoverValueEl&&(this.hoverValueEl.style.opacity="0"))}_positionArrow(t){if(!this.arrowEl||!this._geom)return;const{isVertical:e,position:i,stripX:s,stripY:n,stripLength:a,stripThickness:r,arrowSize:o}=this._geom,l=this._min,c=this._max-l;let h;if(h=0===c?.5:(t-l)/c,h<0&&(h=0),h>1&&(h=1),e){const t=n+a-h*a;let e,l;"left"===i?(e=s+r,l=e+o):(e=s,l=e-o);const c=[`${e},${t}`,`${l},${t-o/2}`,`${l},${t+o/2}`].join(" ");this.arrowEl.setAttribute("points",c)}else{const t=s+h*a;let e,l;"top"===i?(e=n+r,l=e+o):(e=n,l=e-o);const c=[`${t},${e}`,`${t-o/2},${l}`,`${t+o/2},${l}`].join(" ");this.arrowEl.setAttribute("points",c)}if(this.arrowEl.setAttribute("opacity","1"),this.hoverValueEl){const l=this._getFormatter();if(this.hoverValueEl.textContent=l(t),e){const t=n+a-h*a;"left"===i?this.hoverValueEl.style.left=`${s+r+o+8}px`:(this.hoverValueEl.style.left=s-o-8+"px",this.hoverValueEl.style.transform="translateX(-100%)"),this.hoverValueEl.style.top=t-9+"px"}else{const t=s+h*a;this.hoverValueEl.style.left=`${t}px`,this.hoverValueEl.style.transform="translateX(-50%)",this.hoverValueEl.style.top="top"===i?`${n+r+o+8}px`:n-o-18+"px"}this.hoverValueEl.style.opacity="1"}}_buildArrow(t,e,i){const s=m.createElementNS(P,"polygon");return s.setAttribute("fill",e),s.setAttribute("opacity","0"),s.setAttribute("class","apexcharts-heatmap-gradient-arrow"),s.setAttribute("points","0,0 0,0 0,0"),s.setAttribute("pointer-events","none"),s}_computeStops(){var t,e;const i=this.w,s=L.colorScaleOf(i)||{},n=this._cfg(),a=I(i);if(a)return this._continuous=!0,{min:a.min,max:a.max,stops:a.legendStops,bands:[]};this._continuous=!1;let r=1/0,c=-1/0;const h=(null==(t=i.seriesData)?void 0:t.series)||[];for(let t=0;t<h.length;t++){const e=h[t];if(e)for(let t=0;t<e.length;t++){const i=e[t];null==i||Number.isNaN(i)||(i<r&&(r=i),i>c&&(c=i))}}Number.isFinite(r)||(r=0),Number.isFinite(c)||(c=0);let d=r,u=c;void 0!==s.min&&void 0!==s.max&&s.max>s.min?(d=s.min,u=s.max):(void 0!==s.min&&(d=s.min<r?s.min:r),void 0!==s.max&&(u=s.max>c?s.max:c));const g=[],f=[];if(s.ranges&&s.ranges.length>0){const t=s.ranges.map((t,e)=>l(o({},t),{_originalIndex:e})).sort((t,e)=>t.from-e.from),e=t[0].from,i=t[t.length-1].to;d=e,u=i;const n=i-e||1;t.forEach(t=>{const i=(t.from-e)/n,s=(t.to-e)/n;g.push({percent:(i+s)/2,color:t.color}),f.push({index:t._originalIndex,p1:i,p2:s})})}else{const t=i.globals.colors[0]||"#008FFB",s=new p,a=i.config.plotOptions[i.config.chart.type]||{},r=null!=(e=a.shadeIntensity)?e:.5,o=i.globals.hasNegs,l=Math.max(2,n.stops||16);for(let e=0;e<l;e++){const n=e/(l-1),c=d+n*(u-d),h=Math.abs(u)+Math.abs(d),p=0===h?0:100*c/h;let f;f=o?a.reverseNegativeShade?p<0?p/100*(1.25*r):1.25*r*(1-p/100):p<=0?1-(1+p/100)*r:(1-p/100)*r:1-p/100,f>1&&(f=1),f<-1&&(f=-1);const m=a.enableShades?s.shadeColor("dark"===i.config.theme.mode?-1*f:f,t):t;g.push({percent:n,color:m})}}return{min:d,max:u,stops:g,bands:f}}}const D=h.__apex_Markers;h.default.registerFeatures({legend:class{constructor(t,e){this.w=t,this.ctx=e,this.updateSeries=(...t)=>e.updateHelpers._updateSeries(...t),this.onLegendClick=this.onLegendClick.bind(this),this.onLegendHovered=this.onLegendHovered.bind(this),this.isBarsDistributed="bar"===this.w.config.chart.type&&this.w.config.plotOptions.bar.distributed&&1===this.w.config.series.length,this.legendHelpers=new A(this)}init(){const t=this.w,e=t.globals,i=t.config;this.isBarsDistributed="bar"===i.chart.type&&i.plotOptions.bar.distributed&&1===i.series.length;const s=i.legend.showForSingleSeries&&1===this.w.seriesData.series.length||this.isBarsDistributed||"heatmap"===i.chart.type||L.isEnabled(t)||this.w.seriesData.series.length>1;if(this.legendHelpers.appendToForeignObject(),(s||!e.axisCharts)&&i.legend.show){const e=t.dom.elLegendWrap;for(;e.firstChild;)e.removeChild(e.firstChild);this.heatmapGradientLegend&&(this.heatmapGradientLegend.destroy(),this.heatmapGradientLegend=null),L.isEnabled(t)?(this.heatmapGradientLegend=new L(t,this.ctx),this.heatmapGradientLegend.draw()):(this.drawLegends(),"bottom"===i.legend.position||"top"===i.legend.position?this.legendAlignHorizontal():"right"!==i.legend.position&&"left"!==i.legend.position||this.legendAlignVertical())}}createLegendMarker({i:t,fillcolor:e}){const i=this.w,s=m.createElement("span");s.classList.add("apexcharts-legend-marker");const n=i.config.legend.markers.shape||i.config.markers.shape;let a=n;Array.isArray(n)&&(a=n[t]);const r=Array.isArray(i.config.legend.markers.size)?parseFloat(i.config.legend.markers.size[t]):parseFloat(i.config.legend.markers.size),c=Array.isArray(i.config.legend.markers.offsetX)?parseFloat(i.config.legend.markers.offsetX[t]):parseFloat(i.config.legend.markers.offsetX),h=Array.isArray(i.config.legend.markers.offsetY)?parseFloat(i.config.legend.markers.offsetY[t]):parseFloat(i.config.legend.markers.offsetY),d=Array.isArray(i.config.legend.markers.strokeWidth)?parseFloat(i.config.legend.markers.strokeWidth[t]):parseFloat(i.config.legend.markers.strokeWidth),u=s.style;if(u.height=2*(r+d)+"px",u.width=2*(r+d)+"px",u.left=c+"px",u.top=h+"px",i.config.legend.markers.customHTML)u.background="transparent",u.color=e[t],Array.isArray(i.config.legend.markers.customHTML)?i.config.legend.markers.customHTML[t]&&(s.innerHTML=i.config.legend.markers.customHTML[t]()):s.innerHTML=i.config.legend.markers.customHTML();else{const n=new D(this.ctx.w,this.ctx).getMarkerConfig({cssClass:`apexcharts-legend-marker apexcharts-marker apexcharts-marker-${a}`,seriesIndex:t,strokeWidth:d,size:r}),c=(f.isBrowser()?window.SVG:global.SVG)().addTo(s).size("100%","100%"),h=new v(this.w).drawMarker(0,0,l(o({},n),{pointFillColor:Array.isArray(e)?e[t]:n.pointFillColor,shape:a}));i.dom.Paper.find(".apexcharts-legend-marker.apexcharts-marker").forEach(t=>{t.node.classList.contains("apexcharts-marker-triangle")?t.node.style.transform="translate(50%, 45%)":t.node.style.transform="translate(50%, 50%)"}),c.add(h)}return s}drawLegends(){var t;const e=this,i=this.w,s=i.dom.elLegendWrap,n=i.config.legend.fontFamily;let a=i.seriesData.seriesNames,r=i.config.legend.markers.fillColors?i.config.legend.markers.fillColors.slice():i.globals.colors.slice();if("heatmap"===i.config.chart.type){const t=i.config.plotOptions.heatmap.colorScale.ranges;a=t.map(t=>t.name?t.name:t.from+" - "+t.to),r=t.map(t=>t.color)}else this.isBarsDistributed&&(a=i.labelData.labels.slice());i.config.legend.customLegendItems.length&&(a=i.config.legend.customLegendItems);const o=i.formatters.legendFormatter,l=i.config.legend.inverseOrder,c=[];i.labelData.seriesGroups.length>1&&i.config.legend.clusterGroupedSeries&&i.labelData.seriesGroups.forEach((t,e)=>{c[e]=m.createElement("div"),c[e].classList.add("apexcharts-legend-group",`apexcharts-legend-group-${e}`),"horizontal"===i.config.legend.clusterGroupedSeriesOrientation?s.classList.add("apexcharts-legend-group-horizontal"):c[e].classList.add("apexcharts-legend-group-vertical")});for(let e=l?a.length-1:0;l?e>=0:e<=a.length-1;l?e--:e++){const l=o(a[e],{seriesIndex:e,w:i});let h=!1,d=!1;if(i.globals.collapsedSeries.length>0)for(let t=0;t<i.globals.collapsedSeries.length;t++)i.globals.collapsedSeries[t].index===e&&(h=!0);if(i.globals.ancillaryCollapsedSeriesIndices.length>0)for(let t=0;t<i.globals.ancillaryCollapsedSeriesIndices.length;t++)i.globals.ancillaryCollapsedSeriesIndices[t]===e&&(d=!0);const u=this.createLegendMarker({i:e,fillcolor:r});v.setAttrs(u,{rel:e+1,"data:collapsed":h||d}),(h||d)&&u.classList.add("apexcharts-inactive-legend");const g=m.createElement("div");if(i.config.chart.accessibility.enabled&&i.config.chart.accessibility.keyboard.enabled){g.setAttribute("role","button"),g.setAttribute("tabindex","0");const t=Array.isArray(l)?l.join(" "):l,e=h||d,i=e?"hidden":"visible";g.setAttribute("aria-label",`${t}, ${i}. Press Enter or Space to toggle.`),g.setAttribute("aria-pressed",e?"true":"false")}const f=m.createElement("span");f.classList.add("apexcharts-legend-text"),f.innerHTML=Array.isArray(l)?l.join(" "):l;let x=i.config.legend.labels.useSeriesColors?i.globals.colors[e]:Array.isArray(i.config.legend.labels.colors)?null==(t=i.config.legend.labels.colors)?void 0:t[e]:i.config.legend.labels.colors;x||(x=i.config.chart.foreColor),f.style.color=x,f.style.fontSize=i.config.legend.fontSize,f.style.fontWeight=i.config.legend.fontWeight,f.style.fontFamily=n||i.config.chart.fontFamily,v.setAttrs(f,{rel:e+1,i:e,"data:default-text":encodeURIComponent(l),"data:collapsed":h||d}),g.appendChild(u),g.appendChild(f);const b=new y(this.w);if(!i.config.legend.showForZeroSeries){0===b.getSeriesTotalByIndex(e)&&b.seriesHaveSameValues(e)&&!b.isSeriesNull(e)&&-1===i.globals.collapsedSeriesIndices.indexOf(e)&&-1===i.globals.ancillaryCollapsedSeriesIndices.indexOf(e)&&g.classList.add("apexcharts-hidden-zero-series")}i.config.legend.showForNullSeries||b.isSeriesNull(e)&&-1===i.globals.collapsedSeriesIndices.indexOf(e)&&-1===i.globals.ancillaryCollapsedSeriesIndices.indexOf(e)&&g.classList.add("apexcharts-hidden-null-series"),c.length?i.labelData.seriesGroups.forEach((t,n)=>{var a,r;t.includes(null!=(r=null==(a=i.config.series[e])?void 0:a.name)?r:"")&&(s.appendChild(c[n]),c[n].appendChild(g))}):s.appendChild(g),s.classList.add(`apexcharts-align-${i.config.legend.horizontalAlign}`),s.classList.add("apx-legend-position-"+i.config.legend.position),g.classList.add("apexcharts-legend-series"),g.style.margin=`${i.config.legend.itemMargin.vertical}px ${i.config.legend.itemMargin.horizontal}px`,s.style.width=i.config.legend.width?i.config.legend.width+"px":"",s.style.height=i.config.legend.height?i.config.legend.height+"px":"",v.setAttrs(g,{rel:e+1,seriesName:p.escapeString(a[e]),"data:collapsed":h||d}),(h||d)&&g.classList.add("apexcharts-inactive-legend"),i.config.legend.onItemClick.toggleDataSeries||g.classList.add("apexcharts-no-click")}i.dom.elWrap.addEventListener("click",e.onLegendClick,!0),i.config.legend.onItemHover.highlightDataSeries&&0===i.config.legend.customLegendItems.length&&(i.dom.elWrap.addEventListener("mousemove",e.onLegendHovered,!0),i.dom.elWrap.addEventListener("mouseout",e.onLegendHovered,!0)),i.config.chart.accessibility.enabled&&i.config.chart.accessibility.keyboard.enabled&&i.dom.elWrap.addEventListener("keydown",e.onLegendKeyDown.bind(e),!0)}setLegendWrapXY(t,e){const i=this.w,s=i.dom.elLegendWrap,n=s.clientHeight;let a=0,r=0;if("bottom"===i.config.legend.position)r=i.globals.svgHeight-Math.min(n,i.globals.svgHeight/2)-5;else if("top"===i.config.legend.position){const t=new w(this.w,this.ctx),e=t.dimHelpers.getTitleSubtitleCoords("title").height,i=t.dimHelpers.getTitleSubtitleCoords("subtitle").height;r=(e>0?e-10:0)+(i>0?i-10:0)}s.style.position="absolute",a=a+t+i.config.legend.offsetX,r=r+e+i.config.legend.offsetY,s.style.left=a+"px",s.style.top=r+"px","right"===i.config.legend.position&&(s.style.left="auto",s.style.right=25+i.config.legend.offsetX+"px");["width","height"].forEach(t=>{s&&s.style[t]&&(s.style[t]=parseInt(String(i.config.legend[t]),10)+"px")})}legendAlignHorizontal(){const t=this.w;t.dom.elLegendWrap.style.right="0";const e=new w(this.w,this.ctx),i=e.dimHelpers.getTitleSubtitleCoords("title"),s=e.dimHelpers.getTitleSubtitleCoords("subtitle");let n=0;"top"===t.config.legend.position&&(n=i.height+s.height+t.config.title.margin+t.config.subtitle.margin-10),this.setLegendWrapXY(20,n)}legendAlignVertical(){const t=this.w,e=this.legendHelpers.getLegendDimensions();let i=0;"left"===t.config.legend.position&&(i=20),"right"===t.config.legend.position&&(i=t.globals.svgWidth-e.clww-10),this.setLegendWrapXY(i,20)}onLegendHovered(t){var e;const i=this.w,s=t.target,n=s.classList.contains("apexcharts-legend-series")||s.classList.contains("apexcharts-legend-text")||s.classList.contains("apexcharts-legend-marker");if("heatmap"===i.config.chart.type||this.isBarsDistributed){if(n){const i=parseInt(null!=(e=s.getAttribute("rel"))?e:"0",10)-1;this.ctx.events.fireEvent("legendHover",[this.ctx,i,this.w]);const n=new g(this.ctx.w);"mousemove"===t.type?n.highlightRangeInSeries(i,"highlight"):"mouseout"===t.type&&n.highlightRangeInSeries(i,"reset")}}else if(!s.classList.contains("apexcharts-inactive-legend")&&n){new g(this.ctx.w).toggleSeriesOnHover(t,s)}}onLegendKeyDown(t){const e=this,i=this.w,s=t.target;if((s.classList.contains("apexcharts-legend-series")||s.classList.contains("apexcharts-legend-text")||s.classList.contains("apexcharts-legend-marker"))&&("Enter"===t.key||" "===t.key)){t.preventDefault();const n=s.getAttribute("rel");e.onLegendClick(t),null!==n&&i.config.legend.onItemClick.toggleDataSeries&&requestAnimationFrame(()=>{const t=i.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${n}"]`);t&&t.focus()})}}onLegendClick(t){var e;const i=this.w,s=t.target;if(!i.config.legend.customLegendItems.length&&(s.classList.contains("apexcharts-legend-series")||s.classList.contains("apexcharts-legend-text")||s.classList.contains("apexcharts-legend-marker"))){const t=parseInt(null!=(e=s.getAttribute("rel"))?e:"0",10)-1,n="true"===s.getAttribute("data:collapsed"),a=this.w.config.chart.events.legendClick;"function"==typeof a&&a(this.ctx,t,this.w),this.ctx.events.fireEvent("legendClick",[this.ctx,t,this.w]);const r=this.w.config.legend.markers.onClick;"function"==typeof r&&s.classList.contains("apexcharts-legend-marker")&&(r(this.ctx,t,this.w),this.ctx.events.fireEvent("legendMarkerClick",[this.ctx,t,this.w]));"treemap"!==i.config.chart.type&&"heatmap"!==i.config.chart.type&&!this.isBarsDistributed&&i.config.legend.onItemClick.toggleDataSeries&&this.legendHelpers.toggleDataSeries(t,n)}}}});class X{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.minX=t.globals.minX,this.maxX=t.globals.maxX,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}createToolbar(){var t,e;const i=this.w,s=()=>m.createElementNS("http://www.w3.org/1999/xhtml","div"),n=()=>{const t=m.createElementNS("http://www.w3.org/1999/xhtml","button");return t.setAttribute("type","button"),t},a=s();if(a.setAttribute("class","apexcharts-toolbar"),a.style.top=i.config.chart.toolbar.offsetY+"px",a.style.right=3-i.config.chart.toolbar.offsetX+"px",i.dom.elWrap.appendChild(a),this.elZoom=n(),this.elZoomIn=n(),this.elZoomOut=n(),this.elPan=n(),this.elSelection=n(),this.elMeasure=n(),this.elZoomReset=n(),this.elMenuIcon=n(),this.elMenu=s(),this.elCustomIcons=[],this.t=i.config.chart.toolbar.tools,Array.isArray(this.t.customIcons))for(let t=0;t<this.t.customIcons.length;t++)this.elCustomIcons.push(n());const r=[],o=(t,e,s)=>{const n=t.toLowerCase();this.t[n]&&i.config.chart.zoom.enabled&&r.push({el:e,icon:"string"==typeof this.t[n]?this.t[n]:s,title:this.localeValues[t],class:`apexcharts-${n}-icon`})};o("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'),o("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 l=t=>{this.t[t]&&i.config.chart[t].enabled&&r.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`})};l("zoom"),l("selection"),this.t.pan&&i.config.chart.zoom.enabled&&r.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&&i.config.chart.measure&&i.config.chart.measure.enabled&&r.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"}),o("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&&r.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++)r.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});r.forEach((t,e)=>{t.index&&p.moveIndexInArray(r,e,t.index)});for(let t=0;t<r.length;t++)v.setAttrs(r[t].el,{class:r[t].class,title:r[t].title,"aria-label":r[t].title}),r[t].el.innerHTML=r[t].icon,a.appendChild(r[t].el);this.elZoom.parentNode&&this.elZoom.setAttribute("aria-pressed",String(!!i.interact.zoomEnabled)),this.elSelection.parentNode&&this.elSelection.setAttribute("aria-pressed",String(!!i.interact.selectionEnabled)),this.elPan.parentNode&&this.elPan.setAttribute("aria-pressed",String(!!i.interact.panEnabled)),this.elMeasure.parentNode&&this.elMeasure.setAttribute("aria-pressed",String(!!i.interact.measureEnabled)),this.elMenuIcon.parentNode&&(this.elMenuIcon.setAttribute("aria-haspopup","true"),this.elMenuIcon.setAttribute("aria-expanded","false")),this._createHamburgerMenu(a),i.interact.zoomEnabled?this.elZoom.classList.add(this.selectedClass):i.interact.panEnabled?this.elPan.classList.add(this.selectedClass):i.interact.selectionEnabled?this.elSelection.classList.add(this.selectedClass):i.interact.measureEnabled&&this.elMeasure&&(this.elMeasure.classList.add(this.selectedClass),null==(e=null==(t=this.ctx.measure)?void 0:t.startMeasure)||e.call(t)),this.addToolbarEventListeners()}_createHamburgerMenu(t){this.elMenuItems=[],t.appendChild(this.elMenu),v.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(m.createElementNS("http://www.w3.org/1999/xhtml","div")),this.elMenuItems[t].innerHTML=e[t].title,v.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,a,r,o,l;null==(t=this.elZoomReset)||t.addEventListener("click",this.handleZoomReset.bind(this)),null==(e=this.elSelection)||e.addEventListener("click",this.toggleZoomSelection.bind(this,"selection")),null==(i=this.elZoom)||i.addEventListener("click",this.toggleZoomSelection.bind(this,"zoom")),null==(s=this.elZoomIn)||s.addEventListener("click",this.handleZoomIn.bind(this)),null==(n=this.elZoomOut)||n.addEventListener("click",this.handleZoomOut.bind(this)),null==(a=this.elPan)||a.addEventListener("click",this.togglePanning.bind(this)),null==(r=this.elMeasure)||r.addEventListener("click",this.toggleMeasure.bind(this)),null==(o=this.elMenuIcon)||o.addEventListener("click",this.toggleMenu.bind(this)),this.elMenuItems.forEach(t=>{t.classList.contains("exportSVG")?t.addEventListener("click",this.handleDownload.bind(this,"svg")):t.classList.contains("exportPNG")?t.addEventListener("click",this.handleDownload.bind(this,"png")):t.classList.contains("exportCSV")&&t.addEventListener("click",this.handleDownload.bind(this,"csv"))});for(let t=0;t<this.t.customIcons.length;t++)this.elCustomIcons[t].addEventListener("click",this.t.customIcons[t].click.bind(this,this.ctx,this.ctx.w));[this.elZoomReset,this.elSelection,this.elZoom,this.elZoomIn,this.elZoomOut,this.elPan,this.elMeasure,this.elMenuIcon,...this.elCustomIcons].forEach(t=>{t.addEventListener("keydown",e=>{if("Enter"===e.key||" "===e.key){e.preventDefault();const i=t.className;t.click(),requestAnimationFrame(()=>{const t=this.w.dom.baseEl;if(!t)return;const e=i.split(" ").find(t=>t.startsWith("apexcharts-"));if(!e)return;const s=t.querySelector(`.${e}`);s&&s.focus()})}})}),null==(l=this.elMenuIcon)||l.addEventListener("keydown",t=>{var e;"ArrowDown"!==t.key&&"ArrowUp"!==t.key||(t.preventDefault(),(null==(e=this.elMenu)?void 0:e.classList.contains("apexcharts-menu-open"))||this.toggleMenu(),window.setTimeout(()=>{const e="ArrowDown"===t.key?0:this.elMenuItems.length-1;this.elMenuItems[e]&&this.elMenuItems[e].focus()},20))}),this.elMenuItems.forEach((t,e)=>{t.addEventListener("keydown",i=>{var s;if("ArrowDown"===i.key){i.preventDefault();(this.elMenuItems[e+1]||this.elMenuItems[0]).focus()}else if("ArrowUp"===i.key){i.preventDefault();(this.elMenuItems[e-1]||this.elMenuItems[this.elMenuItems.length-1]).focus()}else"Escape"===i.key||"Tab"===i.key?(this._closeMenu(),null==(s=this.elMenuIcon)||s.focus(),"Tab"===i.key||i.preventDefault()):"Enter"!==i.key&&" "!==i.key||(i.preventDefault(),t.click())})})}toggleZoomSelection(t){this.ctx.getSyncedCharts().forEach(e=>{const i=e.ctx.toolbar,s="selection"===t?"selectionEnabled":"zoomEnabled",n=!!e.w.globals[s];i.toggleOtherControls();const a="selection"===t?i.elSelection:i.elZoom;n||(e.w.globals[s]=!0,a.classList.add(i.selectedClass)),a.setAttribute("aria-pressed",String(!!e.w.globals[s]))})}toggleMeasure(){var t,e,i,s;const n=this.w,a=!n.interact.measureEnabled;this.toggleOtherControls(),a&&(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=>{const e=t.ctx.toolbar,i=!!t.w.interact.panEnabled;e.toggleOtherControls(),i||(t.w.interact.panEnabled=!0,e.elPan.classList.add(e.selectedClass)),e.elPan.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();this.minX=e,this.maxX=i;const s=(e+i)/2,n=(e+s)/2,a=(i+s)/2,r=this._getNewMinXMaxX(n,a);t.interact.disableZoomIn||this.zoomUpdateOptions(r.minX,r.maxX)}handleZoomOut(){const t=this.w,{minX:e,maxX:i}=this._currentXRange();if(this.minX=e,this.maxX=i,"datetime"===t.config.xaxis.type&&new Date(e).getUTCFullYear()<1e3)return;const s=(e+i)/2,n=e-(s-e),a=i-(s-i),r=this._getNewMinXMaxX(n,a);t.interact.disableZoomOut||this.zoomUpdateOptions(r.minX,r.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 a={xaxis:s};if(!i.globals.initialConfig)return;const r=p.clone(i.globals.initialConfig.yaxis);i.config.chart.group||(a.yaxis=r),this.w.interact.zoomed=!0,this.ctx.updateHelpers._updateOptions(a,!1,this.w.config.chart.animations.dynamicAnimation.enabled),this.zoomCallback(s,r)}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})}}handleZoomReset(){this.ctx.getSyncedCharts().forEach(t=>{const e=t.w;if(!e.interact.zoomed)return;if(e.globals.lastXAxis.min=e.globals.initialConfig.xaxis.min,e.globals.lastXAxis.max=e.globals.initialConfig.xaxis.max,t.updateHelpers.revertDefaultAxisMinMax(),"function"==typeof e.config.chart.events.beforeResetZoom){const i=e.config.chart.events.beforeResetZoom(t,e);i&&t.updateHelpers.revertDefaultAxisMinMax(i)}"function"==typeof e.config.chart.events.zoomed&&t.ctx.toolbar.zoomCallback({min:e.config.xaxis.min,max:e.config.xaxis.max});const i=t.ctx.series.emptyCollapsedSeries(p.clone(e.globals.initialSeries));t.updateHelpers._updateSeries(i,e.config.chart.animations.dynamicAnimation.enabled),e.interact.zoomed=!1})}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 R{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)/R.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*R.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(),a=t.globals.svgWidth?n.width/t.globals.svgWidth:1;return(e-n.left)/(a||1)-t.layout.translateX}}const F=h.__apex_index_Box;h.default.registerFeatures({toolbar:X,zoomPanSelection:class extends X{constructor(t,e){super(t,e),this.w=t,this.ctx=e,this.dragged=!1,this.graphics=new v(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 F(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._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,a=i.config.chart.toolbar.autoSelected;if("measure"!==a&&(e.shiftKey?(i.interact.shiftWasPressed=!0,s.enableZoomPanFromToolbar("pan"===a?"zoom":"pan")):i.interact.shiftWasPressed&&(s.enableZoomPanFromToolbar(a),i.interact.shiftWasPressed=!1)),!e.target)return;const r=e.target.classList;let o;e.target.parentNode&&null!==e.target.parentNode&&(o=e.target.parentNode.classList);if(!(r.contains("apexcharts-legend-marker")||r.contains("apexcharts-legend-text")||o&&o.contains("apexcharts-toolbar"))){if(this.clientX="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientX:"touchend"===e.type?e.changedTouches[0].clientX:e.clientX,this.clientY="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientY:"touchend"===e.type?e.changedTouches[0].clientY:e.clientY,"mousedown"===e.type&&1===e.which||"touchstart"===e.type){const t=this._gridRect();if(!t)return;this.startX=this._screenXToPlotPx(this.clientX),this.startY=this.clientY-t.top,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,s=this._gridRect();s&&(this.w.interact.mousedown||e)&&(this.endX=this._screenXToPlotPx(this.clientX),this.endY=this.clientY-s.top,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)}_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=this._gridRect();if(!s||!s.width)return;const{min:n,max:a}=this._currentXWindow(),r=a-n,o=Math.min(Math.max((e.clientX-s.left)/s.width,0),1);let l=r*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));l<i&&(l=i),l>c.max-c.min&&(l=c.max-c.min)}let h=n+o*r-o*l,d=h+l;const u=1e-9*r;if(Math.abs(h-n)<u&&Math.abs(d-a)<u)return;if(isNaN(h)||isNaN(d))return;const g=this.getBeforeZoomRange({min:h,max:d},void 0);g&&g.xaxis&&(h=g.xaxis.min,d=g.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?p.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(t.interact.selectionEnabled)t.interact.selection={x:parseFloat(this.selectionRect.node.getAttribute("x")),y:parseFloat(this.selectionRect.node.getAttribute("y")),width:parseFloat(this.selectionRect.node.getAttribute("width")),height:parseFloat(this.selectionRect.node.getAttribute("height"))},clearTimeout(null!=(e=this.w.globals.selectionResizeTimer)?e:void 0),this.w.globals.selectionResizeTimer=window.setTimeout(()=>{this._emitSelectionFromRect()},30);else{const e=t.interact.zoomEnabled?t.config.chart.zoom.type:t.config.chart.selection.type;this.handleMouseUp({zoomtype:e,isResized:!0})}}))}preselectedSelection(){const t=this.w,e=this.xyRatios;if(!t.interact.zoomEnabled)if(void 0!==t.interact.selection&&null!==t.interact.selection)this.drawSelectionRect(l(o({},t.interact.selection),{translateX:t.layout.translateX,translateY:t.layout.translateY}));else if(void 0!==t.config.chart.selection.xaxis.min&&void 0!==t.config.chart.selection.xaxis.max){let i=R.dataXToPx(t,t.config.chart.selection.xaxis.min),s=R.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:a=0}){const r=this.w,o=this.zoomRect,l=this.selectionRect;if(this.dragged||null!==r.interact.selection){const c={transform:"translate("+n+", "+a+")"};r.interact.zoomEnabled&&this.dragged&&(i<0&&(i=1),o.attr({x:t,y:e,width:i,height:s,fill:r.config.chart.zoom.zoomedArea.fill.color,"fill-opacity":r.config.chart.zoom.zoomedArea.fill.opacity,stroke:r.config.chart.zoom.zoomedArea.stroke.color,"stroke-width":r.config.chart.zoom.zoomedArea.stroke.width,"stroke-opacity":r.config.chart.zoom.zoomedArea.stroke.opacity}),v.setAttrs(o.node,c)),r.interact.selectionEnabled&&(l.attr({x:t,y:e,width:i>0?i:0,height:s>0?s:0,fill:r.config.chart.selection.fill.color,"fill-opacity":r.config.chart.selection.fill.opacity,stroke:r.config.chart.selection.stroke.color,"stroke-width":r.config.chart.selection.stroke.width,"stroke-dasharray":r.config.chart.selection.stroke.dashArray,"stroke-opacity":r.config.chart.selection.stroke.opacity}),v.setAttrs(l.node,c))}}hideSelectionRect(t){t&&t.attr({x:0,y:0,width:0,height:0})}selectionDrawing({context:t,zoomtype:e}){const i=this.w,s=t,n=this._gridRect();if(!n)return;const a=s.startX-1,r=s.startY;let c=!1,h=!1;const d=this._screenXToPlotPx(s.clientX),u=s.clientY-n.top;let g=d-a,p=u-r,f={translateX:i.layout.translateX,translateY:i.layout.translateY};return Math.abs(g+a)>i.layout.gridWidth?g=i.layout.gridWidth-a:d<0&&(g=a),a>d&&(c=!0,g=Math.abs(g)),r>u&&(h=!0,p=Math.abs(p)),f="x"===e?{x:c?a-g:a,y:0,width:g,height:i.layout.gridHeight}:"y"===e?{x:0,y:h?r-p:r,width:i.layout.gridWidth,height:p}:{x:c?a-g:a,y:h?r-p:r,width:g,height:p},f=l(o({},f),{translateX:i.layout.translateX,translateY:i.layout.translateY}),s.drawSelectionRect(f),s.selectionDragging("resizing"),f}selectionDragging(t,e){var i;const s=this.w;if(!e)return;e.preventDefault();const{handler:n,box:a}=e.detail,r=this.constraints;let{x:o,y:l}=a;o<r.x&&(o=r.x),l<r.y&&(l=r.y),a.x2>r.x2&&(o=r.x2-a.w),a.y2>r.y2&&(l=r.y2-a.h),n.move(o,l);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 g=s.config.chart.link,p=!(!g||!g.enabled&&"function"!=typeof g.dimension);("function"==typeof s.config.chart.events.selection||p)&&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;const n=this._gridRect();if(!n)return;const a=this.selectionRect.node.getBoundingClientRect(),r=this.xyRatios;let o,l,c,h;const d=this._screenXToPlotPx(a.left),u=this._screenXToPlotPx(a.right);if(e.axisFlags.isRangeBar)o=e.globals.yAxisScale[0].niceMin+d*r.invertedYRatio,l=e.globals.yAxisScale[0].niceMin+u*r.invertedYRatio,c=0,h=1;else{if(!e.globals.xAxisScale)return;o=R.pxToDataX(e,d),l=R.pxToDataX(e,u),c=e.globals.yAxisScale[0].niceMin+(n.bottom-a.bottom)*r.yRatio[0],h=e.globals.yAxisScale[0].niceMax-(a.top-n.top)*r.yRatio[0]}const g={xaxis:{min:o,max:l},yaxis:{min:c,max:h}};"function"==typeof e.config.chart.events.selection&&e.config.chart.events.selection(this.ctx,g),e.config.chart.brush.enabled&&void 0!==e.config.chart.events.brushScrolled&&e.config.chart.events.brushScrolled(this.ctx,g),null==(t=this.ctx.linkedViews)||t.onSourceSelection(g.xaxis)}selectionDrawn({context:t,zoomtype:e}){var i;const s=this.w,n=t,a=this.xyRatios,r=this.ctx.toolbar,o=s.interact.zoomEnabled?n.zoomRect.node.getBoundingClientRect():n.selectionRect.node.getBoundingClientRect(),l=n._gridRect();if(!l)return;const c=this._screenXToPlotPx(o.left),h=this._screenXToPlotPx(o.right),d=o.top-l.top,u=o.bottom-l.top;let g,f;s.axisFlags.isRangeBar?(g=s.globals.yAxisScale[0].niceMin+c*a.invertedYRatio,f=s.globals.yAxisScale[0].niceMin+h*a.invertedYRatio):(g=R.pxToDataX(s,c),f=R.pxToDataX(s,h));const m=[],x=[];if(s.config.yaxis.forEach((t,e)=>{const i=s.globals.seriesYAxisMap[e][0],n=s.globals.yAxisScale[e].niceMax-a.yRatio[i]*d,r=s.globals.yAxisScale[e].niceMax-a.yRatio[i]*u;m.push(n),x.push(r)}),n.dragged&&(n.dragX>10||n.dragY>10)&&g!==f)if(s.interact.zoomEnabled){if(!s.globals.initialConfig)return;let t=p.clone(s.globals.initialConfig.yaxis),i=p.clone(s.globals.initialConfig.xaxis);if(s.interact.zoomed=!0,s.config.xaxis.convertedCatToNumeric&&(g=Math.floor(g),f=Math.floor(f),g<1&&(g=1,f=s.globals.dataPoints),f-g<2&&(f=g+1)),"xy"!==e&&"x"!==e||(i={min:g,max:f}),"xy"!==e&&"y"!==e||t.forEach((e,i)=>{t[i].min=x[i],t[i].max=m[i]}),r){const e=r.getBeforeZoomRange(i,t);e&&(i=e.xaxis?e.xaxis:i,t=e.yaxis?e.yaxis:t)}const a={xaxis:i};s.config.chart.group||(a.yaxis=t),n.ctx.updateHelpers._updateOptions(a,!1,n.w.config.chart.animations.dynamicAnimation.enabled),"function"==typeof s.config.chart.events.zoomed&&r.zoomCallback(i,t)}else if(s.interact.selectionEnabled){let t=null,a=null;if(a={min:g,max:f},"xy"===e||"y"===e){const e=p.clone(s.config.yaxis);t=e,e.forEach((t,i)=>{e[i].min=x[i],e[i].max=m[i]})}s.interact.selection=n.selection,"function"==typeof s.config.chart.events.selection&&s.config.chart.events.selection(n.ctx,{xaxis:a,yaxis:t}),null==(i=n.ctx.linkedViews)||i.onSourceSelection(a)}}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,a=i.axisFlags.isRangeBar?i.globals.maxY:i.globals.maxX;s.panScrolled(n,a)}panScrolled(t,e){var i,s;const n=this.w,a=this.xyRatios;if(!n.globals.initialConfig)return;const r=p.clone(n.globals.initialConfig.yaxis);let o=a.xRatio,l=n.globals.minX,c=n.globals.maxX;if(n.axisFlags.isRangeBar&&(o=a.invertedYRatio,l=n.globals.minY,c=n.globals.maxY),"left"===this.moveDirection?(t=l+n.layout.gridWidth/15*o,e=c+n.layout.gridWidth/15*o):"right"===this.moveDirection&&(t=l-n.layout.gridWidth/15*o,e=c-n.layout.gridWidth/15*o),!n.axisFlags.isRangeBar){const a=null!=(i=n.globals.dataReducerRawMinX)?i:n.globals.initialMinX,r=null!=(s=n.globals.dataReducerRawMaxX)?s:n.globals.initialMaxX;(t<a||e>r)&&(t=l,e=c)}const h={xaxis:{min:t,max:e}};n.config.chart.group||(h.yaxis=r),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}}_gridRect(){const t=this.w.dom.baseEl,e=t&&t.querySelector(".apexcharts-grid");return e?e.getBoundingClientRect():null}_screenXToPlotPx(t){return R.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(),a=i&&e-t>n.max-n.min,r=this._clampBounds();if(r){const i=e-t;t<r.min&&(e=(t=r.min)+i),e>r.max&&(t=(e=r.max)-i),t<r.min&&(t=r.min)}if(s.config.xaxis.convertedCatToNumeric&&(t=Math.floor(t),e=a?Math.ceil(e):Math.floor(e),t<1&&(t=1),r&&e>r.max&&(e=Math.floor(r.max)),e-t<2))return!1;if(!(e>t))return!1;const o={xaxis:{min:t,max:e}};return s.config.chart.group||(o.yaxis=p.clone(s.globals.initialConfig.yaxis)),i&&(s.interact.zoomed=!0),this.ctx.updateHelpers._updateOptions(o,!1,!1),{minX:t,maxX:e}}_cancelInertia(){const t=this._m();null!=t.inertiaRAF&&(cancelAnimationFrame(t.inertiaRAF),t.inertiaRAF=null)}_fireScrolled(){const t=this.w;if("function"!=typeof t.config.chart.events.scrolled)return;const{min:e,max:i}=this._currentXWindow(),s={xaxis:{min:e,max:i}};t.config.chart.events.scrolled(this.ctx,s),this.ctx.events.fireEvent("scrolled",s)}_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){this._cancelInertia();const s=this._gridRect();if(!s)return;if(t.touches.length>=2&&this._pinchEnabled())t.preventDefault(),i.busy=!0,i.panState=null,this._beginPinch(t,s);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(),a=e.layout.gridWidth||1;i.panState={startX:s.clientX,startY:s.clientY,axis:null,minX0:n.min,maxX0:n.max,ratio0:(n.max-n.min)/a},i.samples=[{x:s.clientX,t:t.timeStamp}]}return}"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)}_beginPinch(t,e){const i=this.w,s=t.touches[0],n=t.touches[1],a=Math.hypot(n.clientX-s.clientX,n.clientY-s.clientY)||1,r=(s.clientX+n.clientX)/2-e.left-i.globals.barPadForNumericAxis,{min:o,max:l}=this._currentXWindow();this._m().pinch={d0:a,cx0:r,minX0:o,maxX0:l,gridWidth:i.layout.gridWidth||1}}_movePinch(t){const e=this.w,i=this._m().pinch;if(!i)return;const s=this._gridRect();if(!s)return;const n=t.touches[0],a=t.touches[1],r=Math.hypot(a.clientX-n.clientX,a.clientY-n.clientY)||1,o=(n.clientX+a.clientX)/2-s.left-e.globals.barPadForNumericAxis,l=i.maxX0-i.minX0,c=l*(i.d0/r);let h=i.minX0+i.cx0/i.gridWidth*l-o/i.gridWidth*c,d=h+c;const u=this._clampBounds();if(u){const t=e.globals.minXDiff>0&&isFinite(e.globals.minXDiff)?e.globals.minXDiff:0,i=Math.max(2*t,1e-6*(u.max-u.min));if(d-h<i){const t=(h+d)/2;h=t-i/2,d=t+i/2}}this._applyXRange(h,d,!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?p.clone(t.globals.initialConfig.yaxis):[],a=this.ctx.toolbar;a&&a.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),a=Math.abs(s.clientY-i.startY);if(n<6&&a<6)return void this._pushSample(s.clientX,t.timeStamp);if(a>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):(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 a=t,r=null;i.busy=!0;const o=t=>{if(e.globals.isDestroyed)return i.inertiaRAF=null,void(i.busy=!1);if(null==r)return r=t,void(i.inertiaRAF=requestAnimationFrame(o));const s=t-r;if(r=t,a*=Math.pow(n,s/16.6667),Math.abs(a)<.02)return i.inertiaRAF=null,i.busy=!1,void this._fireScrolled();const l=this._currentXWindow(),c=e.layout.gridWidth||1,h=(l.max-l.min)/c,d=a*s*h,u=this._applyXRange(l.min-d,l.max-d,!1),g=this._clampBounds();if(!u||g&&(d>0&&u.minX<=g.min+1e-6*(g.max-g.min)||d<0&&u.maxX>=g.max-1e-6*(g.max-g.min)))return i.inertiaRAF=null,i.busy=!1,void this._fireScrolled();i.inertiaRAF=requestAnimationFrame(o)};i.inertiaRAF=requestAnimationFrame(o)}}});const $=h.__apex_Animations_prefersReducedMotion,T=h.__apex_Animations_applyProgressiveReveal;class B{constructor(t){this.w=t.w,this.annoCtx=t}setOrientations(t,e=null){var i,s;const n=this.w;if("vertical"===t.label.orientation){const a=null!==e?e:0,r=n.dom.baseEl.querySelector(`.apexcharts-xaxis-annotations .apexcharts-xaxis-annotation-label[rel='${a}']`);if(null!==r){const e=r.getBBox();r.setAttribute("x",String(parseFloat(null!=(i=r.getAttribute("x"))?i:"0")-e.height+4));const n="top"===t.label.position?e.width:-e.width;r.setAttribute("y",String(parseFloat(null!=(s=r.getAttribute("y"))?s:"0")+n));const{x:a,y:o}=this.annoCtx.graphics.rotateAroundCenter(r);r.setAttribute("transform",`rotate(-90 ${a} ${o})`)}}}addBackgroundToAnno(t,e){const i=this.w;if(!t||!e.label.text||!String(e.label.text).trim())return null;const s=i.dom.baseEl.querySelector(".apexcharts-grid");if(!s)return null;const n=s.getBoundingClientRect(),a=s.getBBox(),r=n.width/a.width||1,o=t.getBoundingClientRect();let{left:l,right:c,top:h,bottom:d}=e.label.style.padding;"vertical"===e.label.orientation&&([h,d,l,c]=[l,c,h,d]);const u=n.left-a.x*r,g=n.top-a.y*r,p=(o.left-u)/r-l,f=(o.top-g)/r-h,m=this.annoCtx.graphics.drawRect(p,f,o.width/r+l+c,o.height/r+h+d,e.label.borderRadius,e.label.style.background,1,e.label.borderWidth,e.label.borderColor,0);return e.id&&m.node.classList.add(e.id),m}annotationsBackground(){const t=this.w,e=(e,i,s)=>{const n=t.dom.baseEl.querySelector(`.apexcharts-${s}-annotations .apexcharts-${s}-annotation-label[rel='${i}']`);if(n){const i=n.parentNode,s=this.addBackgroundToAnno(n,e);if(s){null==i||i.insertBefore(s.node,n);const a=n.getAttribute("x");null!==a&&T(s,parseFloat(a),t),e.label.mouseEnter&&s.node.addEventListener("mouseenter",e.label.mouseEnter.bind(this,e)),e.label.mouseLeave&&s.node.addEventListener("mouseleave",e.label.mouseLeave.bind(this,e)),e.label.click&&s.node.addEventListener("click",e.label.click.bind(this,e))}}};t.config.annotations.xaxis.forEach((t,i)=>e(t,i,"xaxis")),t.config.annotations.yaxis.forEach((t,i)=>e(t,i,"yaxis")),t.config.annotations.points.forEach((t,i)=>e(t,i,"point"))}usesCategoryX(){const t=this.w;return("category"===t.config.xaxis.type||t.config.xaxis.convertedCatToNumeric)&&!this.annoCtx.invertAxis&&!t.axisFlags.dataFormatXNumeric&&!t.config.chart.sparkline.enabled}hasXDomain(){const t=this.w;return this.annoCtx.invertAxis?p.isNumber(t.globals.minY)&&p.isNumber(t.globals.yRange[0]):this.usesCategoryX()?t.labelData.labels.length>0||t.labelData.categoryLabels.length>0:p.isNumber(t.globals.minX)&&p.isNumber(t.globals.xRange)}getY1Y2(t,e){var i,s,n;const a=this.w,r="y1"===t?e.y:e.y2,o="string"==typeof r&&r.includes("px");let l,c=!1;if(this.annoCtx.invertAxis){const t=a.config.xaxis.convertedCatToNumeric?a.labelData.categoryLabels:a.labelData.labels,s=t.indexOf(r);if(!o&&-1===s)return{yP:0,clipped:!0};const n=a.dom.baseEl.querySelector(`.apexcharts-yaxis-texts-g text:nth-child(${s+1})`);l=n?parseFloat(null!=(i=n.getAttribute("y"))?i:"0"):(a.layout.gridHeight/t.length-1)*(s+1)-a.globals.barHeight,void 0!==e.seriesIndex&&a.globals.barHeight&&(l-=a.globals.barHeight/2*(a.seriesData.series.length-1)-a.globals.barHeight*e.seriesIndex)}else{if(!a.config.yaxis[e.yAxisIndex])return{yP:0,clipped:!0};const t=a.globals.seriesYAxisMap[e.yAxisIndex],i=null!=(s=null==t?void 0:t[0])?s:null;if(null===i&&a.seriesData.series.length)return{yP:0,clipped:!0};const o=null===i?a.globals.minY:a.globals.minYArr[i],h=null===i?a.globals.maxY-a.globals.minY:a.globals.yRange[i],d=a.config.yaxis[e.yAxisIndex].logarithmic&&null!==i?new y(this.w).getLogVal(a.config.yaxis[e.yAxisIndex].logBase,r,i)/a.globals.yLogRatio[i]:(r-o)/(h/a.layout.gridHeight);l=a.layout.gridHeight-Math.min(Math.max(d,0),a.layout.gridHeight),c=d>a.layout.gridHeight||d<0,!e.marker||void 0!==e.y&&null!==e.y||(l=0),(null==(n=a.config.yaxis[e.yAxisIndex])?void 0:n.reversed)&&(l=d)}return o&&(l=parseFloat(r)),{yP:l,clipped:c}}getX1X2(t,e){const i=this.w,s="x1"===t?e.x:e.x2,n=this.annoCtx.invertAxis?i.globals.minY:i.globals.minX,a=this.annoCtx.invertAxis?i.globals.maxY:i.globals.maxX,r=this.annoCtx.invertAxis?i.globals.yRange[0]:i.globals.xRange;let o=!1;const l="string"==typeof s&&s.includes("px"),c=null==s&&e.marker;if(!l&&!c&&!this.hasXDomain())return{x:0,clipped:!0};let h=this.annoCtx.inversedReversedAxis?(a-s)/(r/i.layout.gridWidth):(s-n)/(r/i.layout.gridWidth);return"category"!==i.config.xaxis.type&&!i.config.xaxis.convertedCatToNumeric||this.annoCtx.invertAxis||i.axisFlags.dataFormatXNumeric||i.config.chart.sparkline.enabled||(h=this.getStringX(s)),"string"==typeof s&&s.includes("px")&&(h=parseFloat(s)),null==s&&e.marker&&(h=i.layout.gridWidth),void 0!==e.seriesIndex&&i.globals.barWidth&&!this.annoCtx.invertAxis&&(h-=i.globals.barWidth/2*(i.seriesData.series.length-1)-i.globals.barWidth*e.seriesIndex),"number"!=typeof h&&(h=0,o=!0),parseFloat(h.toFixed(10))>parseFloat(i.layout.gridWidth.toFixed(10))?(h=i.layout.gridWidth,o=!0):h<0&&(h=0,o=!0),{x:h,clipped:o}}getStringX(t){var e;const i=this.w;let s=t;if(i.config.xaxis.convertedCatToNumeric&&i.labelData.categoryLabels.length){const e=String(t);t=i.labelData.categoryLabels.findIndex(t=>String(t)===e)+1}const n=i.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(t),a=i.dom.baseEl.querySelector(`.apexcharts-xaxis-texts-g text:nth-child(${n+1})`);return a&&(s=parseFloat(null!=(e=a.getAttribute("x"))?e:"0")),s}}class N{constructor(t){this.w=t.w,this.annoCtx=t,this.invertAxis=this.annoCtx.invertAxis,this.helpers=new B(this.annoCtx)}addXaxisAnnotation(t,e,i){const s=this.w,n=this.helpers.getX1X2("x1",t);let a=n.x;const r=n.clipped;let o,l=!0;const c=t.label.text,h=t.strokeDashArray;if(p.isNumber(a)){if(null===t.x2||void 0===t.x2){if(!r){const i=this.annoCtx.graphics.drawLine(a+t.offsetX,0+t.offsetY,a+t.offsetX,s.layout.gridHeight+t.offsetY,t.borderColor,h,t.borderWidth);e.appendChild(i.node),t.id&&i.node.classList.add(t.id),T(i,a+t.offsetX,s)}}else{const i=this.helpers.getX1X2("x2",t);if(o=i.x,l=i.clipped,o<a){const t=a;a=o,o=t}const n=this.annoCtx.graphics.drawRect(a+t.offsetX,0+t.offsetY,o-a,s.layout.gridHeight+t.offsetY,0,t.fillColor,t.opacity,1,t.borderColor,h);n.node.classList.add("apexcharts-annotation-rect"),n.attr("clip-path",`url(#gridRectMask${s.globals.cuid})`),e.appendChild(n.node),t.id&&n.node.classList.add(t.id),T(n,a+t.offsetX,s)}if(!r||!l){const n=this.annoCtx.graphics.getTextRects(c,t.label.style.fontSize),r="top"===t.label.position?4:"center"===t.label.position?s.layout.gridHeight/2+("vertical"===t.label.orientation?n.width/2:0):s.layout.gridHeight,o=this.annoCtx.graphics.drawText({x:a+t.label.offsetX,y:r+t.label.offsetY-("vertical"===t.label.orientation?"top"===t.label.position?n.width/2-12:-n.width/2:0),text:c,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-xaxis-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});o.attr({rel:i}),e.appendChild(o.node),T(o,a+t.label.offsetX,s),this.annoCtx.helpers.setOrientations(t,i)}}}drawXAxisAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-xaxis-annotations"});return t.config.annotations.xaxis.map((t,i)=>{this.addXaxisAnnotation(t,e.node,i)}),e}}class z{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new B(this.annoCtx),this.axesUtils=new d(this.annoCtx.w,{theme:this.annoCtx.theme,timeScale:this.annoCtx.timeScale})}addYaxisAnnotation(t,e,i){const s=this.w,n=t.strokeDashArray;let a=this.helpers.getY1Y2("y1",t),r=a.yP;const o=a.clipped;let l,c=!0,h=!1;const d=t.label.text;if(null===t.y2||void 0===t.y2){if(!o){h=!0;const i=this.annoCtx.graphics.drawLine(0+t.offsetX,r+t.offsetY,this._getYAxisAnnotationWidth(t),r+t.offsetY,t.borderColor,n,t.borderWidth);e.appendChild(i.node),t.id&&i.node.classList.add(t.id)}}else{if(a=this.helpers.getY1Y2("y2",t),l=a.yP,c=a.clipped,l>r){const t=r;r=l,l=t}if(!o||!c){h=!0;const i=this.annoCtx.graphics.drawRect(0+t.offsetX,l+t.offsetY,this._getYAxisAnnotationWidth(t),r-l,0,t.fillColor,t.opacity,1,t.borderColor,n);i.node.classList.add("apexcharts-annotation-rect"),i.attr("clip-path",`url(#gridRectMask${s.globals.cuid})`),e.appendChild(i.node),t.id&&i.node.classList.add(t.id)}}if(h){const n="right"===t.label.position?s.layout.gridWidth:"center"===t.label.position?s.layout.gridWidth/2:0,a=this.annoCtx.graphics.drawText({x:n+t.label.offsetX,y:(null!=l?l:r)+t.label.offsetY-3,text:d,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-yaxis-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});a.attr({rel:i}),e.appendChild(a.node)}}_getYAxisAnnotationWidth(t){const e=this.w;let i=e.layout.gridWidth;return i=t.width.indexOf("%")>-1?e.layout.gridWidth*parseInt(t.width,10)/100:parseInt(t.width,10),i+t.offsetX}drawYAxisAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-yaxis-annotations"});return t.config.annotations.yaxis.forEach((t,i)=>{t.yAxisIndex=this.axesUtils.translateYAxisIndex(t.yAxisIndex),this.axesUtils.isYAxisHidden(t.yAxisIndex)&&this.axesUtils.yAxisAllSeriesCollapsed(t.yAxisIndex)||this.addYaxisAnnotation(t,e.node,i)}),e}}class W{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new B(this.annoCtx)}addPointAnnotation(t,e,i){const s=this.w;if(s.globals.collapsedSeriesIndices.indexOf(t.seriesIndex)>-1)return;const n=this.helpers.getX1X2("x1",t),a=n.x,r=n.clipped,o=this.helpers.getY1Y2("y1",t),l=o.yP,c=o.clipped;if(p.isNumber(a)&&!c&&!r){const n={pSize:t.marker.size,pointStrokeWidth:t.marker.strokeWidth,pointFillColor:t.marker.fillColor,pointStrokeColor:t.marker.strokeColor,shape:t.marker.shape,pRadius:t.marker.radius,class:`apexcharts-point-annotation-marker ${t.marker.cssClass} ${t.id?t.id:""}`};let r=this.annoCtx.graphics.drawMarker(a+t.marker.offsetX,l+t.marker.offsetY,n);e.appendChild(r.node);const o=[r.node];T(r,a,s);const c=t.label.text?t.label.text:"",h=this.annoCtx.graphics.drawText({x:a+t.label.offsetX,y:l+t.label.offsetY-t.marker.size-parseFloat(t.label.style.fontSize)/1.6,text:c,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-point-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});if(h.attr({rel:i}),e.appendChild(h.node),T(h,a,s),t.customSVG.SVG){const i=this.annoCtx.graphics.group({class:"apexcharts-point-annotations-custom-svg "+t.customSVG.cssClass});i.attr({transform:`translate(${a+t.customSVG.offsetX}, ${l+t.customSVG.offsetY})`}),i.node.innerHTML=t.customSVG.SVG,e.appendChild(i.node),o.push(i.node)}if(t.image.path){const e=t.image.width?t.image.width:20,i=t.image.height?t.image.height:20;r=this.annoCtx.addImage({x:a+t.image.offsetX-e/2,y:l+t.image.offsetY-i/2,width:e,height:i,path:t.image.path,appendTo:".apexcharts-point-annotations"}),o.push(r.node)}t.tooltip&&t.tooltip.enabled&&o.forEach(e=>{e.addEventListener("mouseenter",()=>{this.showPointTooltip(t,e)}),e.addEventListener("mouseleave",()=>{this.hidePointTooltip()})}),t.mouseEnter&&r.node.addEventListener("mouseenter",t.mouseEnter.bind(this,t)),t.mouseLeave&&r.node.addEventListener("mouseleave",t.mouseLeave.bind(this,t)),t.click&&r.node.addEventListener("click",t.click.bind(this,t))}}getPointTooltipEl(){const t=this.w;let e=t.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");return e||(e=m.createElementNS("http://www.w3.org/1999/xhtml","div"),e.classList.add("apexcharts-tooltip","apexcharts-annotation-tooltip"),t.dom.elWrap.appendChild(e)),e}getPointTooltipContent(t){const e=this.w,i=t.tooltip||{};if("function"==typeof i.formatter)return i.formatter({annotation:t,seriesIndex:t.seriesIndex,id:t.id,w:e});let s=null!=i.text?i.text:t.label&&t.label.text;return Array.isArray(s)&&(s=s.join("<br/>")),null==s?"":String(s)}showPointTooltip(t,e){const i=this.w,s=this.getPointTooltipContent(t);if(!s)return;const n=this.getPointTooltipEl();n.innerHTML=s;const a=t.tooltip.theme||i.config.tooltip.theme||"light";n.classList.remove("apexcharts-theme-light","apexcharts-theme-dark"),n.classList.add(`apexcharts-theme-${a}`),n.classList.add("apexcharts-active");const r=i.dom.elWrap.getBoundingClientRect(),o=e.getBoundingClientRect(),l=n.getBoundingClientRect(),c=t.tooltip.offsetX||0,h=t.tooltip.offsetY||0;let d=o.left-r.left+o.width/2-l.width/2,u=o.top-r.top-l.height-10;d=Math.max(0,Math.min(d,r.width-l.width)),u<0&&(u=o.top-r.top+o.height+10),n.style.left=d+c+"px",n.style.top=u+h+"px"}hidePointTooltip(){const t=this.w.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");t&&t.classList.remove("apexcharts-active")}drawPointAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-point-annotations"});return t.config.annotations.points.map((t,i)=>{this.addPointAnnotation(t,e.node,i)}),e}}const Y=h.__apex_Options;h.default.registerFeatures({annotations:class{constructor(t,{theme:e=null,timeScale:i=null}={}){this.w=t,this.theme=e,this.timeScale=i,this.invertAxis=void 0,this.inversedReversedAxis=void 0,this.graphics=new v(this.w),this.w.globals.isBarHorizontal&&(this.invertAxis=!0),this.helpers=new B(this),this.xAxisAnnotations=new N(this),this.yAxisAnnotations=new z(this),this.pointsAnnotations=new W(this),this.w.globals.isBarHorizontal&&this.w.config.yaxis[0].reversed&&(this.inversedReversedAxis=!0),this.xDivision=this.w.layout.gridWidth/this.w.globals.dataPoints}drawAxesAnnotations(){const t=this.w;if(t.globals.axisCharts){const e=this.yAxisAnnotations.drawYAxisAnnotations(),i=this.xAxisAnnotations.drawXAxisAnnotations(),s=this.pointsAnnotations.drawPointAnnotations(),n=t.config.chart.animations.enabled,a=[e,i,s],r=[i.node,e.node,s.node],o="line"===t.config.chart.type||"area"===t.config.chart.type||"rangeArea"===t.config.chart.type,l=[o,!1,o];for(let e=0;e<3;e++)t.dom.elGraphical.add(a[e]),!n||t.globals.resized||t.globals.dataChanged||"scatter"!==t.config.chart.type&&"bubble"!==t.config.chart.type&&t.globals.dataPoints>1&&!l[e]&&r[e].classList.add("apexcharts-element-hidden"),t.globals.delayedElements.push({el:r[e],index:0});this.helpers.annotationsBackground()}}drawImageAnnos(){this.w.config.annotations.images.map(t=>{this.addImage(t)})}drawTextAnnos(){this.w.config.annotations.texts.map(t=>{this.addText(t)})}addXaxisAnnotation(t,e,i){this.xAxisAnnotations.addXaxisAnnotation(t,e,i)}addYaxisAnnotation(t,e,i){this.yAxisAnnotations.addYaxisAnnotation(t,e,i)}addPointAnnotation(t,e,i){this.pointsAnnotations.addPointAnnotation(t,e,i)}addText(t){const{x:e,y:i,text:s,textAnchor:n,foreColor:a,fontSize:r,fontFamily:o,fontWeight:l,cssClass:c,backgroundColor:h,borderWidth:d,strokeDashArray:u,borderRadius:g,borderColor:p,appendTo:f=".apexcharts-svg",paddingLeft:m=4,paddingRight:x=4,paddingBottom:b=2,paddingTop:y=2}=t,w=this.w,v=this.graphics.drawText({x:e,y:i,text:s,textAnchor:n||"start",fontSize:r||"12px",fontWeight:l||"regular",fontFamily:o||w.config.chart.fontFamily,foreColor:a||w.config.chart.foreColor,cssClass:c}),A=w.dom.baseEl.querySelector(f);A&&A.appendChild(v.node);const _=v.bbox();if(s){const t=this.graphics.drawRect(_.x-m,_.y-y,_.width+m+x,_.height+b+y,g,h||"transparent",1,d,p,u);A.insertBefore(t.node,v.node)}}addImage(t){const e=this.w,{path:i,x:s=0,y:n=0,width:a=20,height:r=20,appendTo:o=".apexcharts-svg"}=t,l=e.dom.Paper.image(i);l.size(a,r).move(s,n);const c=e.dom.baseEl.querySelector(o);return c&&c.appendChild(l.node),l}addXaxisAnnotationExternal(t,e,i){return this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"xaxis",contextMethod:i.addXaxisAnnotation}),i}addYaxisAnnotationExternal(t,e,i){return this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"yaxis",contextMethod:i.addYaxisAnnotation}),i}addPointAnnotationExternal(t,e,i){return void 0===this.invertAxis&&(this.invertAxis=i.w.globals.isBarHorizontal),this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"point",contextMethod:i.addPointAnnotation}),i}addAnnotationExternal({params:t,pushToMemory:e,context:i,type:s,contextMethod:n}){const a=i,r=a.w,o=r.dom.baseEl.querySelector(`.apexcharts-${s}-annotations`),l=o.childNodes.length+1,c=new Y,h=Object.assign({},"xaxis"===s?c.xAxisAnnotation:"yaxis"===s?c.yAxisAnnotation:c.pointAnnotation),d=p.extend(h,t);switch(s){case"xaxis":this.addXaxisAnnotation(d,o,l);break;case"yaxis":this.addYaxisAnnotation(d,o,l);break;case"point":this.addPointAnnotation(d,o,l)}const u=r.dom.baseEl.querySelector(`.apexcharts-${s}-annotations .apexcharts-${s}-annotation-label[rel='${l}']`),g=this.helpers.addBackgroundToAnno(u,d);return g&&o.insertBefore(g.node,u),e&&r.globals.memory.methodsToExec.push({context:a,id:d.id?d.id:p.randomId(),method:n,label:"addAnnotation",params:t}),i}_removeAnnotationTooltip(t){const e=t.dom.elWrap&&t.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");e&&e.parentNode&&e.parentNode.removeChild(e)}clearAnnotations(t){const e=t.w;this._removeAnnotationTooltip(e);const i=e.dom.baseEl.querySelectorAll(".apexcharts-yaxis-annotations, .apexcharts-xaxis-annotations, .apexcharts-point-annotations");for(let t=e.globals.memory.methodsToExec.length-1;t>=0;t--)"addText"!==e.globals.memory.methodsToExec[t].label&&"addAnnotation"!==e.globals.memory.methodsToExec[t].label||e.globals.memory.methodsToExec.splice(t,1);Array.prototype.forEach.call(i,t=>{for(;t.firstChild;)t.removeChild(t.firstChild)})}removeAnnotation(t,e){const i=t.w;this._removeAnnotationTooltip(i);const s=i.dom.baseEl.querySelectorAll(`.${e}`);s&&(i.globals.memory.methodsToExec.map((t,s)=>{t.id===e&&i.globals.memory.methodsToExec.splice(s,1)}),Object.keys(i.config.annotations).forEach(t=>{const s=i.config.annotations[t];Array.isArray(s)&&(i.config.annotations[t]=s.filter(t=>t.id!==e))}),Array.prototype.forEach.call(s,t=>{t.parentElement.removeChild(t)}))}}});h.default.registerFeatures({keyboardNavigation:class{constructor(t,e){this.w=t,this.ctx=e,this.seriesIndex=0,this.dataPointIndex=0,this.active=!1,this._tooltipDismissed=!1,this._focusedEl=null,this._hoveredBarEl=null,this._enlargedScatterMarker=null,this._onKeyDown=this._onKeyDown.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this),this._onLegendClick=this._onLegendClick.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._lastPointerDownAt=0}init(){const t=this.w.dom.Paper.node;t&&(t.setAttribute("tabindex","0"),t.addEventListener("focus",this._onFocus),t.addEventListener("blur",this._onBlur),t.addEventListener("mousedown",this._onPointerDown,{capture:!0}),t.addEventListener("pointerdown",this._onPointerDown,{capture:!0}),t.addEventListener("touchstart",this._onPointerDown,{capture:!0,passive:!0}),t.addEventListener("keydown",this._onKeyDown,{passive:!1}),this.ctx.events.addEventListener("legendClick",this._onLegendClick))}destroy(){const t=this.w,e=t.dom.Paper&&t.dom.Paper.node;this.ctx.events.removeEventListener("legendClick",this._onLegendClick),e&&(e.removeEventListener("focus",this._onFocus),e.removeEventListener("blur",this._onBlur),e.removeEventListener("keydown",this._onKeyDown),e.removeEventListener("mousedown",this._onPointerDown,{capture:!0}),e.removeEventListener("pointerdown",this._onPointerDown,{capture:!0}),e.removeEventListener("touchstart",this._onPointerDown,{capture:!0}))}_onPointerDown(){this._lastPointerDownAt=Date.now()}handleKey(t){}_onFocus(){this._isNavEnabled()&&(Date.now()-this._lastPointerDownAt<100||(this.active=!0,this._clampCursor(),this._snapToVisibleRange(),this._showCurrentPoint()))}_onBlur(){this.active=!1,this._tooltipDismissed=!1,this._hideFocus()}_onLegendClick(){this.active&&(this.active=!1,this._hideFocus())}_onKeyDown(t){var e,i,s;if(this._isNavEnabled()&&this.active){if(t.shiftKey&&("ArrowRight"===t.key||"ArrowLeft"===t.key)&&this._canPan())return t.preventDefault(),void this._panBy("ArrowRight"===t.key?1:-1);switch(t.key){case"ArrowRight":t.preventDefault(),this._move(0,1);break;case"ArrowLeft":t.preventDefault(),this._move(0,-1);break;case"ArrowUp":t.preventDefault(),this._move(-1,0);break;case"ArrowDown":t.preventDefault(),this._move(1,0);break;case"Home":t.preventDefault(),this.dataPointIndex=0,this._skipNullForward(),this._showCurrentPoint();break;case"End":t.preventDefault(),this.dataPointIndex=this._getDataPointCount(this.seriesIndex)-1,this._skipNullBackward(),this._showCurrentPoint();break;case"Enter":case" ":t.preventDefault(),this._fireClick();break;case"+":case"=":this._canZoom()&&(t.preventDefault(),null==(e=this.ctx.toolbar)||e.handleZoomIn(),this._announce("Zoomed in"));break;case"-":case"_":this._canZoom()&&(t.preventDefault(),null==(i=this.ctx.toolbar)||i.handleZoomOut(),this._announce("Zoomed out"));break;case"0":this._canZoom()&&this.w.interact.zoomed&&(t.preventDefault(),null==(s=this.ctx.toolbar)||s.handleZoomReset(),this._announce("Zoom reset"));break;case"Escape":t.preventDefault(),this._tooltipDismissed?(this.active=!1,this._tooltipDismissed=!1,this._hideFocus()):(this._tooltipDismissed=!0,this._hideFocus())}}}_canZoom(){const t=this.w;return Boolean(t.globals.axisCharts&&t.config.chart.zoom&&t.config.chart.zoom.enabled)}_canPan(){return this._canZoom()}_panBy(t){const e=this.w,i=this.ctx.toolbar;if(!i)return;const s=Number(e.globals.minX),n=Number(e.globals.maxX);if(!isFinite(s)||!isFinite(n)||s===n)return;const a=.1*(n-s)*t;i.zoomUpdateOptions(s+a,n+a),this._announce(t>0?"Panned right":"Panned left")}_move(t,e){const i=this.w,s=i.config.chart.accessibility.keyboard.navigation.wrapAround;if(0!==t){const e=this.w.globals.tooltip;if(e&&e.tConfig&&e.tConfig.shared){const t=this.dataPointIndex;if(e.tooltipUtil&&e.tooltipUtil.isXoverlap(t)&&e.tooltipUtil.isInitialSeriesSameLen())return}const n=this._getSeriesCount();let a=this.seriesIndex+t,r=0;for(;r<n&&(a<0&&(a=s?n-1:0),a>=n&&(a=s?0:n-1),i.globals.collapsedSeriesIndices.includes(a));)a+=t,r++;this.seriesIndex=a;const o=this._getDataPointCount(a);this.dataPointIndex>=o&&(this.dataPointIndex=o-1)}if(0!==e){const t=this._getDataPointCount(this.seriesIndex);let i=this.dataPointIndex+e;i<0&&(i=s?t-1:0),i>=t&&(i=s?0:t-1),this.dataPointIndex=i,e>0?this._skipNullForward():this._skipNullBackward(),this._isDataPointVisible(this.seriesIndex,this.dataPointIndex)||this._snapToVisibleRangeInDirection(e)}this._showCurrentPoint()}_skipNullForward(){const t=this.w,e=this.seriesIndex,i=this._getDataPointCount(e);let s=this.dataPointIndex,n=0;if(Array.isArray(t.seriesData.series[e])){for(;n<i&&null===t.seriesData.series[e][s];)s=(s+1)%i,n++;this.dataPointIndex=s}}_skipNullBackward(){const t=this.w,e=this.seriesIndex,i=this._getDataPointCount(e);let s=this.dataPointIndex,n=0;if(Array.isArray(t.seriesData.series[e])){for(;n<i&&null===t.seriesData.series[e][s];)s=(s-1+i)%i,n++;this.dataPointIndex=s}}_showCurrentPoint(){const{seriesIndex:t,dataPointIndex:e}=this,i=this.w,s=i.globals.tooltip;s&&s.ttItems&&(i.interact.capturedSeriesIndex=t,i.interact.capturedDataPointIndex=e,this._applyFocusClass(t,e),this._showTooltip(t,e,s))}_hideFocus(){const t=this.w,e=t.globals.tooltip;if(this._removeFocusClass(),this._leaveHoveredBar(),!e)return;e.marker&&e.marker.resetPointsSize(),this._enlargedScatterMarker=null;const i=e.getElTooltip();i&&(i.classList.remove("apexcharts-active"),t.config.chart.accessibility.enabled&&t.config.chart.accessibility.announcements.enabled&&i.setAttribute("aria-hidden","true")),t.dom.baseEl.classList.remove("apexcharts-tooltip-active");const s=e.getElXCrosshairs();s&&s.classList.remove("apexcharts-active")}_showTooltip(t,e,i){const s=this.w,n=s.config.chart.type,a=i.getElTooltip();if(!a)return;const r=i.getCachedDimensions();i.tooltipRect={x:0,y:0,ttWidth:r.ttWidth||0,ttHeight:r.ttHeight||0},this._setSyntheticEvent(t,e,i),s.dom.baseEl.classList.add("apexcharts-tooltip-active"),a.classList.add("apexcharts-active"),s.config.chart.accessibility.enabled&&s.config.chart.accessibility.announcements.enabled&&a.removeAttribute("aria-hidden"),"pie"===n||"donut"===n||"polarArea"===n?this._showTooltipNonAxis(t,e,i,a):"radialBar"===n?this._showTooltipRadialBar(t,e,i,a):"heatmap"===n||"treemap"===n?this._showTooltipHeatTree(t,e,i,a,n):"bar"===n||"candlestick"===n||"boxPlot"===n||"violin"===n||"rangeBar"===n?this._showTooltipBar(t,e,i):this._showTooltipAxisLine(t,e,i)}_setSyntheticEvent(t,e,i){const s=this.w,n=s.config.chart.type;let a=0,r=0;const o=this._getFocusableElement(t,e);if(o){const t=o.getBoundingClientRect();a=t.left+t.width/2,r=t.top+t.height/2}else if(s.globals.pointsArray&&s.globals.pointsArray[t]&&s.globals.pointsArray[t][e]){const n=s.globals.pointsArray[t][e],o=i.getElGrid&&i.getElGrid();if(o){const t=o.getBoundingClientRect();a=t.left+(n[0]||0),r=t.top+(n[1]||0)}}else{const t=s.dom.Paper&&s.dom.Paper.node;if(t){const e=t.getBoundingClientRect();a=e.left+e.width/2,r=e.top+e.height/2}}if(("line"===n||"area"===n||"rangeArea"===n||"scatter"===n||"bubble"===n||"radar"===n)&&s.globals.pointsArray&&s.globals.pointsArray[t]&&s.globals.pointsArray[t][e]){const n=s.globals.pointsArray[t][e],o=i.getElGrid&&i.getElGrid();if(o){const t=o.getBoundingClientRect();a=t.left+(n[0]||0),r=t.top+(n[1]||0)}}i.e={type:"mousemove",clientX:a,clientY:r}}_showTooltipBar(t,e,i){var s,n,a,r;const c=this.w,h=i.tConfig.shared&&(i.tooltipUtil.isXoverlap(e)||c.globals.isBarHorizontal)&&i.tooltipUtil.isInitialSeriesSameLen(),d=null==(r=null==(a=null==(n=null==(s=c.rangeData.seriesRange)?void 0:s[t])?void 0:n[e])?void 0:a.y)?void 0:r[0];i.tooltipLabels.drawSeriesTexts(l(o(o({ttItems:i.ttItems,i:t,j:e},void 0!==(null==d?void 0:d.y1)&&{y1:d.y1}),void 0!==(null==d?void 0:d.y2)&&{y2:d.y2}),{shared:h}));const u=`.apexcharts-series[data\\:realIndex='${t}']`,g=c.dom.Paper.findOne(`${u} path[j='${e}'], ${u} circle[j='${e}'], ${u} rect[j='${e}']`);if(g){this._leaveHoveredBar();new v(this.w,this.ctx).pathMouseEnter(g,null),this._hoveredBarEl=g}if(c.globals.isBarHorizontal){const t=g&&g.node;if(t){const e=c.dom.elWrap.getBoundingClientRect(),s=t.getBoundingClientRect(),n=s.left-e.left,a=s.top-e.top,r=s.height,o=s.width,l=i.tooltipRect.ttWidth||0,h=a+r/2-(i.tooltipRect.ttHeight||0)/2;let d=n+o;n<(i.xyRatios&&null!=i.xyRatios.baseLineInvertedY?i.xyRatios.baseLineInvertedY:e.width/2)&&(d=n-l);const u=i.getElTooltip();u&&(u.style.left=d+"px",u.style.top=h+"px")}}else i.tooltipPosition.moveStickyTooltipOverBars(e,t)}_showTooltipAxisLine(t,e,i){const s=this.w,n=s.config.chart.type,a=i.tConfig.shared&&i.tooltipUtil.isXoverlap(e)&&i.tooltipUtil.isInitialSeriesSameLen();i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,j:e,shared:a});const r="scatter"===n||"bubble"===n,o=s.globals.markers.largestSize>0&&!s.globals.markers.batched;r?this._showScatterBubblePoint(t,e,i):o?a?i.marker.enlargePoints(e):i.tooltipPosition.moveDynamicPointOnHover(e,t):a?i.tooltipPosition.moveDynamicPointsOnHover(e):i.tooltipPosition.moveDynamicPointOnHover(e,t)}_showScatterBubblePoint(t,e,i){const s=this.w.dom.baseEl;this._enlargedScatterMarker&&(i.marker.oldPointSize(this._enlargedScatterMarker),this._enlargedScatterMarker=null);const n=s.querySelector(`.apexcharts-series[data\\:realIndex='${t}']`);if(!n)return;const a=n.querySelector(`.apexcharts-marker[rel='${e}']`);a&&(i.marker.enlargeCurrentPoint(e,a),this._enlargedScatterMarker=a)}_showTooltipNonAxis(t,e,i,s){const n=this.w;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:e,shared:!1});const a=s.getBoundingClientRect(),r=a.width||i.tooltipRect.ttWidth||0,o=a.height||i.tooltipRect.ttHeight||0,l=n.dom.baseEl.querySelector(`.apexcharts-pie-area[j='${e}']`),c=i.getSliceAnchor(l);c&&(s.style.left=c.x-r/2+"px",s.style.top=c.y-o-10+"px")}_showTooltipRadialBar(t,e,i,s){var n;const a=this.w;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,shared:!1});const{ttWidth:r=0,ttHeight:o=0}=i.getCachedDimensions(),l=a.dom.baseEl.querySelector(`.apexcharts-radialbar-series[data\\:realIndex='${t}'] path`);if(l){const e=parseFloat(null!=(n=l.getAttribute("data:angle"))?n:"")||0,i=(a.config.plotOptions.radialBar.startAngle||0)+e/2,c=a.layout.gridWidth/2,h=a.layout.gridHeight/2,d=a.globals.radialSize||Math.min(a.layout.gridWidth,a.layout.gridHeight)/2,u=a.seriesData.series.length,g=d/Math.max(u,1),f=d-t*g,m=(f+(f-g))/2,x=p.polarToCartesian(c,h,m,i),b=x.x+(a.layout.translateX||0),y=x.y+(a.layout.translateY||0);s.style.left=b-r/2+"px",s.style.top=y-o-10+"px"}}_showTooltipHeatTree(t,e,i,s,n){var a,r;const o=this.w;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,j:e,shared:!1});const l=s.getBoundingClientRect(),c=l.width||i.tooltipRect.ttWidth||0,h=l.height||i.tooltipRect.ttHeight||0,d="heatmap"===n?"apexcharts-heatmap-rect":"apexcharts-treemap-rect",u=o.dom.baseEl.querySelector(`.${d}[i='${t}'][j='${e}']`);if(u){const t=o.dom.elWrap.getBoundingClientRect(),e=u.getBoundingClientRect(),n=e.left-t.left,l=e.top-t.top,d=e.width,g=e.height,p=parseFloat(null!=(a=u.getAttribute("cx"))?a:""),f=parseFloat(null!=(r=u.getAttribute("width"))?r:"");i.tooltipPosition.moveXCrosshairs(p+f/2);let m=n+d+c/2;const x=l+g/2-h/2;n+d>o.layout.gridWidth/2&&(m=n-c/2),s.style.left=m+"px",s.style.top=x+"px"}}_applyFocusClass(t,e){this._removeFocusClass();const i=this._getFocusableElement(t,e)||this._getBatchedFocusEl(t);if(i){i.classList.add("apexcharts-keyboard-focused"),i.setAttribute("role","img");const s=this._buildPointLabel(t,e);s&&i.setAttribute("aria-label",s),this._focusedEl=i}}_getBatchedFocusEl(t){return this.w.globals.markers.batched?this.w.dom.baseEl.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] .apexcharts-series-markers path`):null}_removeFocusClass(){this._focusedEl&&(this._focusedEl.classList.remove("apexcharts-keyboard-focused"),this._focusedEl.removeAttribute("role"),this._focusedEl.removeAttribute("aria-label"),this._focusedEl=null)}_buildPointLabel(t,e){var i,s,n,a,r,o,l,c;const h=this.w,d=h.config.chart.type,u=h.seriesData.seriesNames||[],g=h.seriesData.series||[];if("pie"===d||"donut"===d||"polarArea"===d){const t=null!=(s=(null==(i=h.labelData)?void 0:i.labels)&&h.labelData.labels[e])?s:"",n=Array.isArray(g)?g[e]:"";return t?`${t}: ${n}`:`${n}`}if("radialBar"===d){return`${u[t]||`Series ${t+1}`}: ${Array.isArray(g)?g[t]:""}`}const p=u[t]||`Series ${t+1}`,f=(Array.isArray(g[t])?g[t]:[])[e];let m=null==f?"":String(f);const x=null==(a=null==(n=h.formatters)?void 0:n.yLabelFormatters)?void 0:a[t];if("function"==typeof x)try{m=x(f,{seriesIndex:t,dataPointIndex:e,w:h})}catch(t){}let b="";const y=null==(r=h.labelData)?void 0:r.categoryLabels,w=null==(l=null==(o=h.seriesData)?void 0:o.seriesX)?void 0:l[t];if(Array.isArray(y)&&null!=y[e])b=String(y[e]);else if(Array.isArray(w)&&null!=w[e]){const i=null==(c=h.formatters)?void 0:c.xLabelFormatter;if("function"==typeof i)try{b=String(i(w[e],{seriesIndex:t,dataPointIndex:e,w:h}))}catch(t){b=String(w[e])}else b=String(w[e])}return b?`${p}: ${m}, ${b}`:`${p}: ${m}`}_leaveHoveredBar(){if(this._hoveredBarEl){new v(this.w,this.ctx).pathMouseLeave(this._hoveredBarEl,null),this._hoveredBarEl=null}}_getFocusableElement(t,e){const i=this.w,s=i.config.chart.type,n=i.dom.baseEl;if("pie"===s||"donut"===s||"polarArea"===s)return n.querySelector(`.apexcharts-pie-area[j='${e}']`);if("heatmap"===s)return n.querySelector(`.apexcharts-heatmap-rect[i='${t}'][j='${e}']`);if("treemap"===s)return n.querySelector(`.apexcharts-treemap-rect[i='${t}'][j='${e}']`);if("radialBar"===s)return n.querySelector(`.apexcharts-radialbar-series[data\\:realIndex='${t}'] path`);if("bar"===s||"candlestick"===s||"boxPlot"===s||"violin"===s||"rangeBar"===s)return n.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] path[j='${e}']`);return n.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] .apexcharts-marker[rel='${e}']`)||null}_fireClick(){const t=this.w.globals.tooltip;if(!t)return;t.markerClick({type:"mouseup",clientX:0,clientY:0},this.seriesIndex,this.dataPointIndex)}_isNavEnabled(){const t=this.w.config.chart.accessibility;return t.enabled&&t.keyboard.enabled&&t.keyboard.navigation.enabled}_getSeriesCount(){const t=this.w,e=t.config.chart.type;return"pie"===e||"donut"===e||"polarArea"===e?1:t.seriesData.series.length}_getDataPointCount(t){const e=this.w,i=e.config.chart.type;if("pie"===i||"donut"===i||"polarArea"===i)return e.seriesData.series.length;const s=e.seriesData.series;return s[t]&&Array.isArray(s[t])?s[t].length:0}_clampCursor(){const t=this._getSeriesCount();this.seriesIndex>=t&&(this.seriesIndex=t-1),this.seriesIndex<0&&(this.seriesIndex=0);const e=this._getDataPointCount(this.seriesIndex);this.dataPointIndex>=e&&(this.dataPointIndex=e-1),this.dataPointIndex<0&&(this.dataPointIndex=0)}_snapToVisibleRange(){const t=this.w,e=t.globals,i=this.seriesIndex;if(!t.interact.zoomed)return;const s=t.seriesData.seriesX&&t.seriesData.seriesX[i];if(!s||!s.length)return;const n=e.minX,a=e.maxX;if(void 0===n||void 0===a)return;const r=s[this.dataPointIndex];if(r>=n&&r<=a)return;const o=s.length;for(let t=0;t<o;t++)if(s[t]>=n&&s[t]<=a)return void(this.dataPointIndex=t)}_snapToVisibleRangeInDirection(t){const e=this.w,i=e.globals,s=this.seriesIndex,n=e.seriesData.seriesX&&e.seriesData.seriesX[s];if(!n||!n.length)return;const a=i.minX,r=i.maxX;if(void 0===a||void 0===r)return;const o=n.length;if(t>=0){for(let t=0;t<o;t++)if(n[t]>=a&&n[t]<=r)return void(this.dataPointIndex=t)}else for(let t=o-1;t>=0;t--)if(n[t]>=a&&n[t]<=r)return void(this.dataPointIndex=t)}_isDataPointVisible(t,e){const i=this.w,s=i.globals;if(!i.interact.zoomed)return!0;const n=i.seriesData.seriesX&&i.seriesData.seriesX[t];if(!n)return!0;const a=n[e];return void 0===a||a>=s.minX&&a<=s.maxX}_announce(t){const e=this.w;if(!e.config.chart.accessibility.announcements.enabled)return;const i=e.dom.baseEl;if(!i)return;const s=i.querySelector(".apexcharts-sr-status");s&&(s.textContent="",setTimeout(()=>{s.textContent=t},0))}}});const O=h.__apex_PathMorphing_parsePath;function H(t,e){if(!(e>0))return[];if(1===e)return[o({},t)];const i=t.width>=t.height,s=i?t.width:t.height,n=i?t.height:t.width,a=n>0?s/n:e;let r=Math.max(1,Math.ceil(Math.sqrt(a*e)));r>e&&(r=e);const l=Math.floor(e/r);let c=e-l*r;const h=[],d=s/r;let u=0;for(let e=0;e<r;e++){const e=l+(c>0?1:0);c>0&&c--;const s=e>0?n/e:0;for(let n=0;n<e;n++)h.push(i?{x:t.x+u,y:t.y+n*s,width:d,height:s}:{x:t.x+n*s,y:t.y+u,width:s,height:d});u+=d}return h}function j(t,e,i){if(!(e>0))return[];const s=t.width>=t.height,n=s?t.width:t.height,a=s?t.height:t.width,r=s?t.y:t.x,o=r+a,l=a>0?n/a:e;let c=Math.max(Math.ceil(Math.sqrt(l*e)),Math.ceil(n/16));c>=1||(c=1),c>e&&(c=e);const h=Math.floor(e/c);let d=e-h*c;const u=[],g=n/c;let p=s?t.x:t.y;for(let t=0;t<c;t++){const t=h+(d>0?1:0);d>0&&d--;const e=[],n=i(p,p+g,s);if(Array.isArray(n))for(let t=0;t<n.length;t++){const i=n[t];if(!i)continue;const s=Math.max(r,Math.min(i[0],i[1])),a=Math.min(o,Math.max(i[0],i[1]));a>s&&e.push([s,a])}e.length||e.push([r,o]);const a=e.reduce((t,e)=>t+(e[1]-e[0]),0),l=e.map(i=>a>0?(i[1]-i[0])/a*t:t/e.length),c=l.map(t=>Math.floor(t));let f=c.reduce((t,e)=>t+e,0);const m=l.map((t,e)=>({i:e,frac:t-Math.floor(t)})).sort((t,e)=>e.frac-t.frac);for(let e=0;f<t;e++,f++)c[m[e%m.length].i]++;for(let t=0;t<e.length;t++){const i=c[t];if(i<=0)continue;const n=e[t][0],a=(e[t][1]-n)/i;for(let t=0;t<i;t++)u.push(s?{x:p,y:n+t*a,width:g,height:a}:{x:n+t*a,y:p,width:a,height:g})}p+=g}return u}function q(t,e,i,s,n,a){let r=n===i?0:Math.round((t-i)/(n-i)*32767),o=a===s?0:Math.round((e-s)/(a-s)*32767),l=0;for(let t=32768;t>=1;t/=2){const e=(r&t)>0?1:0,i=(o&t)>0?1:0;if(l+=t*t*(3*e^i),0===i){1===e&&(r=t-1-r,o=t-1-o);const i=r;r=o,o=i}}return l}function Z(t,e){let i=1/0,s=1/0,n=-1/0,a=-1/0;const r=t.map(t=>{const[r,o]=e(t);return r<i&&(i=r),r>n&&(n=r),o<s&&(s=o),o>a&&(a=o),[r,o]});return t.map((t,e)=>({item:t,d:q(r[e][0],r[e][1],i,s,n,a)})).sort((t,e)=>t.d-e.d).map(t=>t.item)}function V(t){if(!t||"string"!=typeof t)return null;const e=t.trim();if("#"===e[0]){const t=e.slice(1);return 3===t.length?[parseInt(t[0]+t[0],16),parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),1]:6===t.length||8===t.length?[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16),8===t.length?parseInt(t.slice(6,8),16)/255:1]:null}const i=e.match(/^rgba?\(([^)]+)\)$/i);if(i){const t=i[1].split(",").map(t=>parseFloat(t));return t.length<3||t.some(t=>!isFinite(t))?null:[t[0],t[1],t[2],t.length>3?t[3]:1]}return null}function U(t,e){const i=V(t),s=V(e);return i&&s?t=>{const e=Math.round(i[0]+(s[0]-i[0])*t),n=Math.round(i[1]+(s[1]-i[1])*t),a=Math.round(i[2]+(s[2]-i[2])*t),r=i[3]+(s[3]-i[3])*t;return r>=1?`rgb(${e},${n},${a})`:`rgba(${e},${n},${a},${r})`}:null}function G(t){return t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2}const K=new Set(["bar","funnel","pyramid","histogram"]),Q=new Set(["pie","donut","polarArea","radialBar","gauge"]),J=new Set(["unit","waffle"]),tt=new Set(["treemap","sunburst"]),et=new Set(["boxPlot","violin"]),it=1500;function st(t){return K.has(t)?"bar":Q.has(t)?"radial":J.has(t)?"unit":tt.has(t)?"partition":et.has(t)?"summary":null}h.default.registerFeatures({morphTypeChange:class{constructor(t,e){this.w=t,this.ctx=e,this._snapshot=null,this._ghost=null,this._pieceLayer=null,this._pieceCancel=null}canMorphTypes(t,e){if(t===e)return!1;const i=st(t),s=st(e);return!(!i||!s)&&("partition"===i==("partition"===s)||"unit"!==i&&"unit"!==s)}isCompatibleSeriesShape(t,e,i){if(!Array.isArray(i)||0===i.length)return!1;const s=st(t),n=st(e);return"unit"===n?!!i.every(t=>"number"==typeof t)||i.every(t=>t&&"object"==typeof t&&Array.isArray(t.data)):"partition"===n||("radial"===n?!!i.every(t=>"number"==typeof t)||1===i.length&&i[0]&&"object"==typeof i[0]&&Array.isArray(i[0].data):"bar"===n||"summary"===n?i.every(t=>t&&"object"==typeof t&&Array.isArray(t.data)):null!==s&&null!==n)}captureBeforeDestroy({fromType:t,toType:e,newSeries:i}){if(this._snapshot=null,this._removeGhost(),this._cancelPieces(),!f.isBrowser())return!1;const s=this.w.config.chart.animations;if(!s||!1===s.enabled)return!1;if(s.chartTypeMorph&&!1===s.chartTypeMorph.enabled)return!1;if(s.respectReducedMotion&&$())return!1;if(!this.canMorphTypes(t,e))return!1;if(!this.isCompatibleSeriesShape(t,e,i))return!1;const{marks:n,branches:a,unitDots:r}=this._captureFromDOM(t);if(!n.length)return!1;const o=this._buildMapping(n,t,e,i,a);if(0===o.size)return!1;this._snapshot={fromType:t,toType:e,mapping:o,oldLayout:{translateX:this.w.layout.translateX||0,translateY:this.w.layout.translateY||0}};const l=st(t),c=st(e),h=this._canProbePaths();if("unit"===c&&("bar"===l||"summary"===l||"radial"===l&&h)){const t=this._countUnitSeries(i);this._snapshot.pieceOut=t>0&&t<=it}else if("unit"===l&&("bar"===c||"summary"===c||"radial"===c&&h)){let t=0;if(r.forEach(e=>{t+=e.length}),t>0&&t<=it){this._snapshot.pieceIn=!0,this._snapshot.sourceDots=r;const t=[];"radial"===c?(Array.isArray(i)?i:[]).forEach((e,i)=>{t.push(`${i}:0`)}):(Array.isArray(i)?i:[]).forEach((e,i)=>{const s=e&&Array.isArray(e.data)?e.data:[];for(let e=0;e<s.length;e++)t.push(`${i}:${e}`)}),this._snapshot.keyOrder=t}}return!this._needsGhost(t,e)||this._snapshot.pieceOut||this._snapshot.pieceIn||this._captureGhost(),this.w.globals.previousPaths=[],!0}_needsGhost(t,e){return"unit"===st(t)||"unit"===st(e)}_captureGhost(){var t,e;const i=null==(t=this.w.dom)?void 0:t.Paper,s=i&&i.node;if(!s||"function"!=typeof s.cloneNode)return;const n=s.cloneNode(!0),a=[".apexcharts-xaxis",".apexcharts-yaxis",".apexcharts-grid",".apexcharts-gridlines-horizontal",".apexcharts-gridlines-vertical",".apexcharts-legend",".apexcharts-title-text",".apexcharts-subtitle-text",".apexcharts-annotations",".apexcharts-zoom-rect",".apexcharts-selection-rect",".apexcharts-xcrosshairs",".apexcharts-ycrosshairs"];"function"==typeof n.querySelectorAll&&a.forEach(t=>{n.querySelectorAll(t).forEach(t=>{t.parentNode&&t.parentNode.removeChild(t)})}),"function"==typeof n.querySelectorAll&&n.querySelectorAll("[id]").forEach(t=>{t.removeAttribute("id")}),null==(e=n.removeAttribute)||e.call(n,"id"),this._ghost=n}_mountGhost(){var t,e,i;const s=this._ghost;if(!s||!f.isBrowser())return;const n=null==(t=this.w.dom)?void 0:t.elWrap;if(!n||"function"!=typeof n.appendChild)return void(this._ghost=null);const a=s.style;a&&(a.position="absolute",a.left="0",a.top="0",a.background="transparent",a.pointerEvents="none",a.opacity="1"),null==(e=s.setAttribute)||e.call(s,"aria-hidden","true"),null==(i=s.setAttribute)||i.call(s,"class","apexcharts-morph-ghost"),n.appendChild(s);const r=this.getSpeed(),o=Math.max(120,Math.round(.55*r));m.requestAnimationFrame(()=>{a&&(a.transition=`opacity ${o}ms ease-in`,a.opacity="0")}),setTimeout(()=>this._removeGhost(),o+60)}_removeGhost(){const t=this._ghost;this._ghost=null,t&&t.parentNode&&t.parentNode.removeChild(t)}_countUnitSeries(t){if(!Array.isArray(t))return 0;let e=0;for(const i of t){if(!i||"object"!=typeof i||!Array.isArray(i.data))return 0;e+=i.data.length}return e}usesPieceTakeover(){return!(!this._snapshot||!this._snapshot.pieceOut)}claimsTargetMark(t,e){return!!(this._snapshot&&this._snapshot.pieceIn&&this._snapshot.mapping.has(`${t}:${e}`))}_makePieceLayer(){var t,e;const i=null==(t=this.w.dom)?void 0:t.elGraphical,s=i&&i.node;if(!s||"function"!=typeof s.appendChild)return null;const n=m.createElementNS("http://www.w3.org/2000/svg","g");if(!n)return null;n.setAttribute("class","apexcharts-morph-pieces"),n.setAttribute("pointer-events","none");const a=null==(e=this.w.globals)?void 0:e.cuid;return a&&n.setAttribute("clip-path",`url(#gridRectBarMask${a})`),s.appendChild(n),this._pieceLayer=n,n}_revealPieceHidden(){var t;const e=null==(t=this.w.globals.dom)?void 0:t.baseEl;e&&"function"==typeof e.querySelectorAll&&e.querySelectorAll("[data-piece-hidden]").forEach(t=>{t.removeAttribute("opacity"),t.removeAttribute("data-piece-hidden")})}_cancelPieces(){this._pieceCancel&&(this._pieceCancel(),this._pieceCancel=null);const t=this._pieceLayer;this._pieceLayer=null,t&&t.parentNode&&t.parentNode.removeChild(t),this._revealPieceHidden()}_canProbePaths(){if(!f.isBrowser())return!1;const t=m.createElementNS("http://www.w3.org/2000/svg","path");return!!t&&"function"==typeof t.isPointInFill}_makeExtentProber(t,e,i){const s=i.ownerDocument.createElementNS("http://www.w3.org/2000/svg","path");s.setAttribute("d",t),s.setAttribute("fill","#000"),s.setAttribute("stroke","#000"),s.setAttribute("stroke-width","3"),s.setAttribute("visibility","hidden"),i.appendChild(s);const n=s.ownerSVGElement;if("function"!=typeof s.isPointInFill||!n||"function"!=typeof n.createSVGPoint)return i.removeChild(s),null;const a=n.createSVGPoint(),r=(t,e)=>{a.x=t,a.y=e;const i=s;return i.isPointInFill(a)||"function"==typeof i.isPointInStroke&&i.isPointInStroke(a)},o=48;return{intervalsAt:(t,i,s)=>{const n=s?e.y:e.x,a=n+(s?e.height:e.width);if(!(a>n))return null;const l=(t,e)=>s?r(e,t):r(t,e),c=[t+.1*(i-t),(t+i)/2,i-.1*(i-t)],h=(t,e,i)=>{let s=e,n=t;for(let t=0;t<6;t++){const t=(s+n)/2;l(t,i)?n=t:s=t}return(s+n)/2},d=(a-n)/o,u=new Array(49).fill(null);let g=!1;for(const t of c)for(let e=0;e<=o;e++)null===u[e]&&l(n+e*d,t)&&(u[e]=t,g=!0);if(!g)return null;const p=[];let f=-1;for(let t=0;t<=49;t++){const e=t<=o&&null!==u[t];if(e&&f<0&&(f=t),!e&&f>=0){const e=t-1,i=u[f],s=0===f?n:h(n+f*d,n+(f-1)*d,i),r=e===o?a:h(n+e*d,n+(e+1)*d,u[e]);r>s&&p.push([s,r]),f=-1}}return p.length?p:null},dispose:()=>{s.parentNode&&s.parentNode.removeChild(s)}}}_separatePieces(){var t;const e=this._snapshot,i=null==(t=this.w.globals.dom)?void 0:t.baseEl;if(!e||!i)return this._revealPieceHidden();const s=new Map;let n=0;if(i.querySelectorAll(".apexcharts-unit-area").forEach(t=>{var e,i,a,r,o,l,c;const h=parseInt(null!=(e=t.getAttribute("i"))?e:"",10);if(isNaN(h))return;const d=t.getAttribute("cx");let u,g,p=3;if(null!=d)u=parseFloat(d),g=parseFloat(null!=(i=t.getAttribute("cy"))?i:""),p=parseFloat(null!=(a=t.getAttribute("r"))?a:"3")||3;else{const e=parseFloat(null!=(r=t.getAttribute("width"))?r:"0")||0,i=parseFloat(null!=(o=t.getAttribute("height"))?o:"0")||0;u=parseFloat(null!=(l=t.getAttribute("x"))?l:"")+e/2,g=parseFloat(null!=(c=t.getAttribute("y"))?c:"")+i/2,p=Math.max(e,i)/2||3}if(!isFinite(u)||!isFinite(g))return;let f=s.get(h);f||(f=[],s.set(h,f)),f.push({el:t,x:u,y:g,r:p,fill:t.getAttribute("fill")}),n++}),0===n||n>it)return this._revealPieceHidden();const a=this._makePieceLayer();if(!a)return this._revealPieceHidden();const r=[],o=a.ownerDocument,l=st(e.fromType),c="summary"===l||"radial"===l;if(Array.from(s.keys()).sort((t,e)=>t-e).forEach(t=>{var i;const n=s.get(t),l=this.getInitialBBoxFor(t),h=e.mapping.get(`${t}:0`);if(!l||!h)return void n.forEach(t=>{t.el.removeAttribute("opacity"),t.el.removeAttribute("data-piece-hidden")});const d=h.fill&&0!==h.fill.indexOf("url(")?h.fill:(null==(i=this.w.globals.colors)?void 0:i[t])||n[0].fill;let u=null;if(c){const e=this.getInitialPathFor(t,0);e&&(u=this._makeExtentProber(e,l,a))}const g=u?j(l,n.length,u.intervalsAt):H(l,n.length);u&&u.dispose();const p=Z(g,t=>[t.x+t.width/2,t.y+t.height/2]),f=Z(n,t=>[t.x,t.y]);for(let e=0;e<f.length;e++){const i=p[e],s=f[e],n=o.createElementNS("http://www.w3.org/2000/svg","rect");n.setAttribute("data-i",String(t)),n.setAttribute("x",String(i.x)),n.setAttribute("y",String(i.y)),n.setAttribute("width",String(i.width)),n.setAttribute("height",String(i.height)),n.setAttribute("rx","0"),n.setAttribute("fill",String(d)),a.appendChild(n),r.push({el:n,from:{x:i.x,y:i.y,width:i.width,height:i.height,rx:0},to:{x:s.x-s.r,y:s.y-s.r,width:2*s.r,height:2*s.r,rx:s.r},fill:U(d,s.fill),fillEnd:s.fill,delay:0,meta:{dotEl:s.el}})}}),!r.length)return this._cancelPieces();this._runPieces(r,t=>{const e=t.meta.dotEl;e.removeAttribute("opacity"),e.removeAttribute("data-piece-hidden"),t.el.parentNode&&t.el.parentNode.removeChild(t.el)})}_combinePieces(){var t,e;const i=this._snapshot,s=null==(t=this.w.globals.dom)?void 0:t.baseEl;if(!(i&&i.sourceDots&&i.keyOrder&&s))return this._revealPieceHidden();const n=this._collectTargetMarks(i.toType);if(!n.size)return this._revealPieceHidden();const a=i.oldLayout.translateX-(this.w.layout.translateX||0),r=i.oldLayout.translateY-(this.w.layout.translateY||0),o=Array.from(i.sourceDots.keys()).sort((t,e)=>t-e),l=this._makePieceLayer();if(!l)return this._revealPieceHidden();const c=l.ownerDocument,h=[],d=st(i.toType),u="summary"===d||"radial"===d;for(let t=0;t<o.length;t++){const s=i.sourceDots.get(o[t]),d=i.keyOrder[t],g=d?n.get(d):null;if(!g||!s||!s.length){g&&g.els.forEach(t=>{t.removeAttribute("opacity"),t.removeAttribute("data-piece-hidden")});continue}const p=g.fill&&0!==g.fill.indexOf("url(")?g.fill:(null==(e=this.w.globals.colors)?void 0:e[g.realIndex])||s[0].fill;let f=null;if(u){const t=g.d||g.els.map(t=>t.getAttribute("pathTo")||t.getAttribute("d")).filter(Boolean).join(" ");t&&(f=this._makeExtentProber(t,g.bbox,l))}const m=f?j(g.bbox,s.length,f.intervalsAt):H(g.bbox,s.length);f&&f.dispose();const x=Z(m,t=>[t.x+t.width/2,t.y+t.height/2]),b=Z(s,t=>[t.x,t.y]),y={remaining:b.length,els:g.els,tiles:[]};for(let t=0;t<b.length;t++){const e=b[t],i=x[t],s=c.createElementNS("http://www.w3.org/2000/svg","rect"),n=e.x+a-e.r,o=e.y+r-e.r;s.setAttribute("data-key",d),s.setAttribute("x",String(n)),s.setAttribute("y",String(o)),s.setAttribute("width",String(2*e.r)),s.setAttribute("height",String(2*e.r)),s.setAttribute("rx",String(e.r)),s.setAttribute("fill",String(e.fill||p)),l.appendChild(s),y.tiles.push(s),h.push({el:s,from:{x:n,y:o,width:2*e.r,height:2*e.r,rx:e.r},to:{x:i.x,y:i.y,width:i.width,height:i.height,rx:0},fill:U(e.fill,p),fillEnd:String(p),delay:0,meta:{markState:y}})}}if(!h.length)return this._cancelPieces();this._runPieces(h,t=>{const e=t.meta.markState;e.remaining--,0===e.remaining&&(e.els.forEach(t=>{t.removeAttribute("opacity"),t.removeAttribute("data-piece-hidden")}),e.tiles.forEach(t=>{t.parentNode&&t.parentNode.removeChild(t)}))})}_runPieces(t,e){const i=this.getSpeed(),s=Math.min(300,.35*i),n=Math.max(180,i-s);for(let e=0;e<t.length;e++)t[e].delay=t.length>1?e/(t.length-1)*s:0;this._pieceCancel=function({pieces:t,duration:e,onPieceDone:i,onAllDone:s}){let n=!1;const a=Date.now(),r=Math.max(1,e),o=(t,e)=>{const i=t.from,s=t.to,n=t.el;n.setAttribute("x",String(i.x+(s.x-i.x)*e)),n.setAttribute("y",String(i.y+(s.y-i.y)*e)),n.setAttribute("width",String(Math.max(0,i.width+(s.width-i.width)*e))),n.setAttribute("height",String(Math.max(0,i.height+(s.height-i.height)*e))),n.setAttribute("rx",String(Math.max(0,i.rx+(s.rx-i.rx)*e))),t.fill?n.setAttribute("fill",t.fill(e)):e>=1&&t.fillEnd&&n.setAttribute("fill",t.fillEnd)},l=()=>{if(n)return;const e=Date.now()-a;let c=!1;for(let s=0;s<t.length;s++){const n=t[s];if(n._done)continue;const a=(e-n.delay)/r;if(a<1&&(c=!0),a<=0)continue;const l=Math.min(1,a);o(n,G(l)),l>=1&&(n._done=!0,i&&i(n))}c?m.requestAnimationFrame(l):s&&s()};return m.requestAnimationFrame(l),()=>{n=!0}}({pieces:t,duration:n,onPieceDone:e,onAllDone:()=>{this._pieceCancel=null,this._cancelPieces()}})}_collectTargetMarks(t){var e;const i=null==(e=this.w.globals.dom)?void 0:e.baseEl,s=new Map;if(!i)return s;const n=st(t);if("radial"===n)return i.querySelectorAll(".apexcharts-pie-series .apexcharts-pie-area").forEach((t,e)=>{const i=t.getAttribute("data:pathFinal")||t.getAttribute("d");if(!i||!i.trim())return;const n=this._pathBBox(i);n&&s.set(`${e}:0`,{realIndex:e,j:0,d:i,bbox:{x:n.minX,y:n.minY,width:n.maxX-n.minX,height:n.maxY-n.minY},fill:t.getAttribute("fill"),els:[t]})}),s;const a="summary"===n?`.apexcharts-${t}-series`:".apexcharts-bar-series";return i.querySelectorAll(`${a} .apexcharts-series`).forEach(t=>{var e;const i=parseInt(null!=(e=t.getAttribute("data:realIndex"))?e:"0",10)||0;let n=0;t.querySelectorAll("path[pathTo]").forEach(t=>{var e;const a=t.getAttribute("pathTo")||t.getAttribute("d");if(!a||!a.trim())return;const r=parseInt(null!=(e=t.getAttribute("j"))?e:"",10),o=isNaN(r)?n++:r,l=this._pathBBox(a);if(!l)return;const c=`${i}:${o}`,h=s.get(c);h?(h.els.push(t),h.bbox={x:Math.min(h.bbox.x,l.minX),y:Math.min(h.bbox.y,l.minY),width:Math.max(h.bbox.x+h.bbox.width,l.maxX)-Math.min(h.bbox.x,l.minX),height:Math.max(h.bbox.y+h.bbox.height,l.maxY)-Math.min(h.bbox.y,l.minY)}):s.set(c,{realIndex:i,j:o,bbox:{x:l.minX,y:l.minY,width:l.maxX-l.minX,height:l.maxY-l.minY},fill:t.getAttribute("fill"),els:[t]})})}),s}_captureFromDOM(t){var e;const i=null==(e=this.w.globals.dom)?void 0:e.baseEl;if(!i)return{marks:[],branches:[],unitDots:new Map};const s=[],n=[],a=new Map,r=st(t);if("bar"===r){i.querySelectorAll(".apexcharts-bar-series .apexcharts-series").forEach(t=>{var e;const i=parseInt(null!=(e=t.getAttribute("data:realIndex"))?e:"0",10);t.querySelectorAll("path[pathTo]").forEach((t,e)=>{const n=t.getAttribute("pathTo")||t.getAttribute("d");n&&s.push({realIndex:i,j:e,d:n,fill:t.getAttribute("fill")})})})}else if("summary"===r){const e=new Map;i.querySelectorAll(`.apexcharts-${t}-area`).forEach(t=>{var i,s;const n=parseInt(null!=(i=t.getAttribute("j"))?i:"",10);if(isNaN(n))return;const a=t.getAttribute("pathTo")||t.getAttribute("d");if(!a||!a.trim())return;const r="function"==typeof t.closest?t.closest(".apexcharts-series"):null,o=parseInt(null!=(s=null==r?void 0:r.getAttribute("data:realIndex"))?s:"0",10)||0,l=`${o}:${n}`,c=e.get(l);c?c.d+=` ${a}`:e.set(l,{realIndex:o,j:n,d:a,fill:t.getAttribute("fill")})}),Array.from(e.values()).sort((t,e)=>t.realIndex-e.realIndex||t.j-e.j).forEach(t=>s.push(t))}else if("partition"===r)if("treemap"===t){const t=t=>{var e,i,s,n;const a=parseFloat(null!=(e=t.getAttribute("x"))?e:""),r=parseFloat(null!=(i=t.getAttribute("y"))?i:""),o=parseFloat(null!=(s=t.getAttribute("width"))?s:""),l=parseFloat(null!=(n=t.getAttribute("height"))?n:"");return[a,r,o,l].every(t=>isFinite(t))?`M ${a} ${r} L ${a+o} ${r} L ${a+o} ${r+l} L ${a} ${r+l} Z`:null};i.querySelectorAll(".apexcharts-treemap-rect").forEach(e=>{var i,n;const a=t(e);a&&s.push({realIndex:parseInt(null!=(i=e.getAttribute("i"))?i:"0",10)||0,j:parseInt(null!=(n=e.getAttribute("j"))?n:"0",10)||0,d:a,fill:e.getAttribute("fill"),key:e.getAttribute("data:key")||null})});i.querySelectorAll(".apexcharts-treemap-parent-rect").forEach(e=>{const i=t(e),s=e.getAttribute("data:key");i&&s&&n.push({key:s,d:i,fill:e.getAttribute("fill")})})}else{const t=i.querySelectorAll(".apexcharts-sunburst-arc"),e=[];t.forEach(t=>{"true"===t.getAttribute("data:leaf")&&e.push(t)});(e.length?e:Array.from(t)).forEach((t,e)=>{const i=t.getAttribute("d");i&&i.trim()&&s.push({realIndex:e,j:0,d:i,fill:t.getAttribute("fill"),key:t.getAttribute("data:key")||null})}),t.forEach(t=>{if("true"===t.getAttribute("data:leaf"))return;const e=t.getAttribute("d"),i=t.getAttribute("data:key");e&&e.trim()&&i&&n.push({key:i,d:e,fill:t.getAttribute("fill")})})}else if("unit"===r){const t=i.querySelectorAll(".apexcharts-unit-area"),e=new Map;t.forEach(t=>{var i,s,n,r,o,l,c;const h=parseInt(null!=(i=t.getAttribute("i"))?i:"",10);if(isNaN(h))return;const d=t.getAttribute("cx");let u,g,p=3;if(null!=d)u=parseFloat(d),g=parseFloat(null!=(s=t.getAttribute("cy"))?s:""),p=parseFloat(null!=(n=t.getAttribute("r"))?n:"3")||3;else{const e=parseFloat(null!=(r=t.getAttribute("width"))?r:"0")||0,i=parseFloat(null!=(o=t.getAttribute("height"))?o:"0")||0;u=parseFloat(null!=(l=t.getAttribute("x"))?l:"")+e/2,g=parseFloat(null!=(c=t.getAttribute("y"))?c:"")+i/2,p=Math.max(e,i)/2||3}if(!isFinite(u)||!isFinite(g))return;let f=a.get(h);f||(f=[],a.set(h,f)),f.push({x:u,y:g,r:p,fill:t.getAttribute("fill")});const m=e.get(h);m?(u<m.minX&&(m.minX=u),u>m.maxX&&(m.maxX=u),g<m.minY&&(m.minY=g),g>m.maxY&&(m.maxY=g)):e.set(h,{minX:u,minY:g,maxX:u,maxY:g,fill:t.getAttribute("fill")})}),Array.from(e.keys()).sort((t,e)=>t-e).forEach(t=>{const i=e.get(t),n=i.minX-2,a=i.minY-2,r=i.maxX+2,o=i.maxY+2;s.push({realIndex:t,j:0,d:`M ${n} ${a} L ${r} ${a} L ${r} ${o} L ${n} ${o} Z`,fill:i.fill})})}else if("radial"===r)if("radialBar"===t||"gauge"===t){const t=this.w.layout.gridWidth/2,e=Math.min(this.w.layout.gridWidth,this.w.layout.gridHeight)/2;i.querySelectorAll(".apexcharts-radial-series .apexcharts-radialbar-area").forEach(i=>{var n;const a=i.parentElement,r=parseInt(null!=(n=null==a?void 0:a.getAttribute("data:realIndex"))?n:"0",10),o=i.getAttribute("d");if(!o)return;const l=parseFloat(i.getAttribute("stroke-width")||"0"),c=l>1&&this._radialArcToFilledSegment(o,l,t,e)||o;s.push({realIndex:r,j:0,d:c,fill:i.getAttribute("stroke")})})}else{i.querySelectorAll(".apexcharts-pie-series .apexcharts-pie-area").forEach((t,e)=>{const i=t.getAttribute("d");i&&s.push({realIndex:e,j:0,d:i,fill:t.getAttribute("fill")})})}return{marks:s,branches:n,unitDots:a}}_radialArcToFilledSegment(t,e,i,s){const n=t.match(/M\s*(-?[\d.]+)\s+(-?[\d.]+)\s+A\s*(-?[\d.]+)\s+(?:-?[\d.]+)\s+(?:-?[\d.]+)\s+(\d)\s+(\d)\s+(-?[\d.]+)\s+(-?[\d.]+)/);if(!n)return null;const a=parseFloat(n[1]),r=parseFloat(n[2]),o=parseFloat(n[3]),l=parseInt(n[4],10),c=parseInt(n[5],10),h=parseFloat(n[6]),d=parseFloat(n[7]);if(!isFinite(o)||o<=0)return null;const u=e/2,g=o+u,p=Math.max(0,o-u),f=(t,e,n)=>{const a=t-i,r=e-s,o=Math.sqrt(a*a+r*r);if(0===o)return{x:i,y:s};const l=n/o;return{x:i+a*l,y:s+r*l}},m=f(a,r,g),x=f(h,d,g),b=f(a,r,p),y=f(h,d,p),w=c?0:1;return`M ${m.x} ${m.y} A ${g} ${g} 0 ${l} ${c} ${x.x} ${x.y} L ${y.x} ${y.y} A ${p} ${p} 0 ${l} ${w} ${b.x} ${b.y} Z`}buildRingSegmentPath(t,e,i,s,n,a){const r=s/2,o=i+r,l=Math.max(0,i-r),c=(n-90)*Math.PI/180,h=(a-90)*Math.PI/180,d=t+o*Math.cos(c),u=e+o*Math.sin(c),g=t+o*Math.cos(h),p=e+o*Math.sin(h),f=t+l*Math.cos(c),m=e+l*Math.sin(c),x=t+l*Math.cos(h),b=e+l*Math.sin(h),y=a>n?1:0,w=Math.abs(a-n)>180?1:0;return`M ${d} ${u} A ${o} ${o} 0 ${w} ${y} ${g} ${p} L ${x} ${b} A ${l} ${l} 0 ${w} ${1-y} ${f} ${m} Z`}getFromType(){return this._snapshot?this._snapshot.fromType:null}_buildMapping(t,e,i,s,n){const a=new Map,r=st(i),o=t.slice().sort((t,e)=>t.realIndex-e.realIndex||t.j-e.j);if("partition"===r&&n&&n.length){const t=o.filter(t=>t.key);t.length===o.length&&(t.forEach(t=>{a.set(`key:${t.key}`,{d:t.d,fill:t.fill})}),n.forEach(t=>{a.set(`key:${t.key}`,{d:t.d,fill:t.fill})}))}if("radial"===r||"unit"===r||"partition"===r)return o.forEach((t,e)=>{a.set(`${e}:0`,{d:t.d,fill:t.fill})}),a;if("bar"===r||"summary"===r){const t=[];return(Array.isArray(s)?s:[]).forEach((e,i)=>{const s=e&&Array.isArray(e.data)?e.data:[];for(let e=0;e<s.length;e++)t.push({realIndex:i,j:e})}),o.forEach((e,i)=>{const s=t[i];s&&a.set(`${s.realIndex}:${s.j}`,{d:e.d,fill:e.fill})}),a}return a}isActive(){return null!==this._snapshot}getInitialPathFor(t,e){if(!this._snapshot)return null;const i=this._snapshot.mapping.get(`${t}:${e}`);if(!i)return null;const s=this._snapshot.oldLayout.translateX-(this.w.layout.translateX||0),n=this._snapshot.oldLayout.translateY-(this.w.layout.translateY||0);return 0===s&&0===n?i.d:this._translatePathD(i.d,s,n)}_translatePathD(t,e,i){if(0===e&&0===i)return t;return O(t).map(t=>{const s=t[0];return"Z"===s?"Z":"M"===s||"L"===s||"T"===s?`${s} ${t[1]+e} ${t[2]+i}`:"H"===s?`${s} ${t[1]+e}`:"V"===s?`${s} ${t[1]+i}`:"C"===s?`${s} ${t[1]+e} ${t[2]+i} ${t[3]+e} ${t[4]+i} ${t[5]+e} ${t[6]+i}`:"S"===s||"Q"===s?`${s} ${t[1]+e} ${t[2]+i} ${t[3]+e} ${t[4]+i}`:"A"===s?`${s} ${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]+e} ${t[7]+i}`:t.join(" ")}).join(" ")}getInitialCenterFor(t){const e=this.getInitialBBoxFor(t);return e?{x:e.x+e.width/2,y:e.y+e.height/2}:null}getInitialPathAt(t){return this.getInitialPathFor(t,0)}getInitialPathForKey(t){return this._snapshot&&t?this.getInitialPathFor("key",t):null}hasKeyedMarks(){if(!this._snapshot)return!1;for(const t of this._snapshot.mapping.keys())if("string"==typeof t&&t.startsWith("key:"))return!0;return!1}getInitialSlotFor(t,e,i){const s=this.getInitialBBoxFor(t);if(!s)return null;const n=s.x+s.width/2,a=s.y+s.height/2;if(!(i>1&&e>=0))return{x:n,y:a};const r=(Math.min(e,i-1)+.5)/i;return s.height>=s.width?{x:n,y:s.y+s.height*(1-r)}:{x:s.x+s.width*r,y:a}}getInitialBBoxFor(t){if(!this._snapshot)return null;const e=this._snapshot.mapping.get(`${t}:0`);if(!e)return null;const i=this._pathBBox(e.d);if(!i)return null;const s=this._snapshot.oldLayout.translateX-(this.w.layout.translateX||0),n=this._snapshot.oldLayout.translateY-(this.w.layout.translateY||0);return{x:i.minX+s,y:i.minY+n,width:i.maxX-i.minX,height:i.maxY-i.minY}}_pathBBox(t){const e=O(t);let i=1/0,s=1/0,n=-1/0,a=-1/0,r=!1;return e.forEach(t=>{const e=t[0];if("Z"===e)return;let o=[];if("H"===e)o=[[t[1],(s+a)/2||t[1]]];else if("V"===e)o=[[(i+n)/2||t[1],t[1]]];else if("A"===e)o=[[t[6],t[7]]];else for(let e=1;e+1<t.length;e+=2)o.push([t[e],t[e+1]]);o.forEach(([t,e])=>{isFinite(t)&&isFinite(e)&&(r=!0,t<i&&(i=t),t>n&&(n=t),e<s&&(s=e),e>a&&(a=e))})}),r?{minX:i,minY:s,maxX:n,maxY:a}:null}getInitialFillFor(t,e){if(!this._snapshot)return null;const i=this._snapshot.mapping.get(`${t}:${e}`);return i?i.fill:null}getSpeed(){const t=this.w.config.chart.animations;return t.chartTypeMorph&&t.chartTypeMorph.speed||t.speed||600}applyChromeFade(){var t;if(!this._snapshot||!f.isBrowser())return;const e=null==(t=this.w.globals.dom)?void 0:t.baseEl;if(!e)return;this._snapshot.pieceOut?this._separatePieces():this._snapshot.pieceIn?this._combinePieces():this._mountGhost();const i=this.getSpeed();[".apexcharts-xaxis",".apexcharts-yaxis",".apexcharts-grid",".apexcharts-gridlines-horizontal",".apexcharts-gridlines-vertical",".apexcharts-legend",".apexcharts-title-text",".apexcharts-subtitle-text"].forEach(t=>{e.querySelectorAll(t).forEach(t=>{t.style&&(t.style.opacity="0",t.style.transition=`opacity ${i}ms ease-out`,m.requestAnimationFrame(()=>{t.style.opacity="1"}),setTimeout(()=>{t.style.transition="",t.style.opacity=""},i+80))})}),setTimeout(()=>this.cleanup(),i+100)}cleanup(){this._snapshot=null,this._removeGhost(),this._cancelPieces()}}});function nt(t,e,i,s){var n;const a=null==(n=null==e?void 0:e.dimensions)?void 0:n.dimHelpers,r=a?a.getTitleSubtitleCoords("title").height+a.getTitleSubtitleCoords("subtitle").height:0,o=i.getBoundingClientRect().height||18,l=s&&s.offsetY||0,c=function(t,e){const i=t.layout.translateY||0,s=t.dom.elWrap;if(!s)return i;const n=t.dom.baseEl.querySelectorAll(".apexcharts-yaxis-label");if(!n.length)return i;const a=s.getBoundingClientRect().top,r=e.getBoundingClientRect();let o=i;for(let t=0;t<n.length;t++){const e=n[t].getBoundingClientRect();e.height&&(e.left>=r.right||e.right<=r.left||(o=Math.min(o,e.top-a)))}return o}(t,i);if(c-r>=o+1)return i.style.top=`${c-o-1+l}px`,!0;i.style.top=`${r+l}px`;const h="dark"===t.config.theme.mode;return i.style.background=h?"rgba(20,24,30,0.82)":"rgba(255,255,255,0.86)",i.style.borderRadius="4px",!1}const at="http://www.w3.org/1999/xhtml";class rt{constructor(t,e,i){this.w=t,this.ctx=e,this.drilldown=i}render(t){if(!f.isBrowser())return;const e=this.w,i=e.dom.elWrap;if(!i)return;const s=i.querySelector(".apexcharts-breadcrumb");s&&s.parentNode&&s.parentNode.removeChild(s);const n=e.config.drilldown&&e.config.drilldown.breadcrumb;if(!n||!1===n.show)return;if(0===this.drilldown.depth)return;const a=m.createElementNS(at,"nav");a.setAttribute("class","apexcharts-breadcrumb"),a.setAttribute("aria-label","Drilldown breadcrumb"),this._position(a,n);const r=null!=n.separator?n.separator:" / ";t.forEach((e,i)=>{if(i>0){const t=m.createElementNS(at,"span");t.setAttribute("class","apexcharts-breadcrumb-separator"),t.setAttribute("aria-hidden","true"),t.textContent=r,a.appendChild(t)}const s=this._label(e,i);if(i===t.length-1){const t=m.createElementNS(at,"span");t.setAttribute("class","apexcharts-breadcrumb-item apexcharts-breadcrumb-current"),t.setAttribute("aria-current","page"),t.textContent=s,a.appendChild(t)}else{const t=m.createElementNS(at,"button");if(t.setAttribute("type","button"),t.setAttribute("class","apexcharts-breadcrumb-item"),0===i){const e=m.createElementNS(at,"span");e.setAttribute("class","apexcharts-breadcrumb-arrow"),e.setAttribute("aria-hidden","true"),e.textContent="\u2190",t.appendChild(e)}const e=m.createElementNS(at,"span");e.setAttribute("class","apexcharts-breadcrumb-label"),e.textContent=s,t.appendChild(e),t.addEventListener("click",()=>this.drilldown.drillToLevel(i)),a.appendChild(t)}}),i.appendChild(a),this.w.globals.axisCharts&&nt(this.w,this.ctx,a,n),this._avoidChromeOverlap(a)}_avoidChromeOverlap(t){const e=this.w,i=[".apexcharts-title-text",".apexcharts-subtitle-text"].map(t=>e.dom.baseEl.querySelector(t)).filter(t=>null!==t);if(!i.length)return;const s=e.dom.elWrap.getBoundingClientRect().top;for(let e=0;e<i.length+1;e++){const e=t.getBoundingClientRect(),n=i.find(t=>{const i=t.getBoundingClientRect();return e.left<i.right&&e.right>i.left&&e.top<i.bottom&&e.bottom>i.top});if(!n)break;t.style.top=n.getBoundingClientRect().bottom-s+4+"px"}}_label(t,e){const i=this.w.config.drilldown.breadcrumb;let s;if(0===e)s=null!=i.rootLabel?i.rootLabel:"All";else{const e=(this.w.config.drilldown.series||[]).find(e=>e&&e.id===t);s=e&&e.name||String(t)}return"function"==typeof i.formatter?i.formatter(s,{index:e,depth:this.drilldown.depth}):s}_position(t,e){const i=e.offsetX||0,s=e.offsetY||0;t.style.position="absolute",t.style.top=s+"px","top-right"===e.position?t.style.right=3-i+"px":t.style.left=i+"px"}}const ot="http://www.w3.org/1999/xhtml",lt="apexcharts-drilldown-loading";class ct{constructor(t){this.w=t,this.el=null}_cfg(){const t=this.w.config.drilldown,e=t&&t.loading;return!1===e?{show:!1}:e||{}}show(){if(!f.isBrowser())return;const t=this._cfg();if(!1===t.show)return;const e=this.w.dom.elWrap;if(!e)return;this.hide();const i=m.createElementNS(ot,"div");i.setAttribute("class",lt),i.setAttribute("role","status"),i.setAttribute("aria-live","polite"),i.setAttribute("aria-label",t.text||"Loading");const s=m.createElementNS(ot,"div");if(s.setAttribute("class",`${lt}-spinner`),s.setAttribute("aria-hidden","true"),i.appendChild(s),t.text){const e=m.createElementNS(ot,"span");e.setAttribute("class",`${lt}-text`),e.textContent=t.text,i.appendChild(e)}e.appendChild(i),this.el=i}hide(){const t=this.w.dom.elWrap;if(t){const e=t.querySelectorAll(`.${lt}`);for(let t=0;t<e.length;t++){const i=e[t];i.parentNode&&i.parentNode.removeChild(i)}}else this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el);this.el=null}}const ht="__apexDrilldownMarker";h.default.registerFeatures({drilldown:class{constructor(t,e){this.w=t,this.ctx=e,this.stack=[],this.rootSnapshot=null,this._wired=!1,this._asyncCache=new Map,this._pending=null,this._warnedUnreachable=!1,this._warnedNoSliceOffset=!1,this.breadcrumb=new rt(t,e,this),this.loading=new ct(t),this._onPointSelect=this._onPointSelect.bind(this),this._afterRender=this._afterRender.bind(this),this._onPlotDown=this._onPlotDown.bind(this),this._onPlotClick=this._onPlotClick.bind(this),this._downAt=null,this._plotClickWired=null,this.init()}init(){const t=this.w;t.config.drilldown&&t.config.drilldown.enabled&&(this._wired||(this._wired=!0,this.ctx.addEventListener("dataPointSelection",this._onPointSelect),this.ctx.addEventListener("mounted",this._afterRender),this.ctx.addEventListener("updated",this._afterRender),t.config.markers&&(t.config.markers.discrete=this._drillMarkers(t.config.series))))}get path(){return["root",...this.stack.map(t=>t.id)]}get depth(){return this.stack.length}drillDown(t,e,i){const s=this._resolveChild(t);return s?this._drillInto(s,e,i):"function"==typeof this.w.config.drilldown.onDrillDown?this._drillDownAsync(t,e,i):Promise.resolve(this.ctx)}drillUp(){return this.drillToLevel(this.stack.length-1)}drillToRoot(){return this.drillToLevel(0)}drillToLevel(t){const e=this.stack.length;if(t<0||t>=e)return Promise.resolve(this.ctx);const i=this.path[this.path.length-1],s=0===t?this.rootSnapshot:this.stack[t].restore;this.stack=this.stack.slice(0,t);const n=this.path[this.path.length-1];return this._apply(this._viewFromSnapshot(s),"up",{from:i,to:n})}_resolveChild(t){const e=this.w.config.drilldown&&this.w.config.drilldown.series;return Array.isArray(e)&&e.find(e=>e&&e.id===t)||null}_drillInto(t,e,i){if(this.stack.length>=32)return Promise.resolve(this.ctx);this.rootSnapshot||(this.rootSnapshot=this._snapshot());const s=this.path[this.path.length-1];return this.stack.push({id:t.id,name:t.name,restore:this._snapshot()}),this._apply(this._viewFromChild(t),"down",{from:s,to:t.id,point:e,seriesIndex:i&&i.seriesIndex,dataPointIndex:i&&i.dataPointIndex})}_drillDownAsync(t,e,i){const s=this.w.config.drilldown.onDrillDown,n=this._cacheGet(t);if(n)return this._drillInto(n,e,i);if(this._pending)return this._pending;let a;this.loading.show();try{a=s({id:t,point:e,seriesIndex:i&&i.seriesIndex,dataPointIndex:i&&i.dataPointIndex})}catch(e){return this.loading.hide(),this._fire("drillDownError",{id:t,error:e}),Promise.resolve(this.ctx)}const r=()=>{this._pending=null,this.loading.hide()},c=Promise.resolve(a).then(s=>{if(r(),this._isDead())return this.ctx;if(!s||!s.data)return this._fire("drillDownError",{id:t,error:new Error(`drilldown: onDrillDown resolved without a drillable level for id "${t}" (expected an object with a \`data\` array).`)}),this.ctx;const n=null!=s.id?s:l(o({},s),{id:t});return this._cacheSet(t,n),this._drillInto(n,e,i)},e=>(r(),this._isDead()||this._fire("drillDownError",{id:t,error:e}),this.ctx));return this._pending=c,c}_isDead(){const t=this.w;return!t||!t.globals||!0===t.globals.isDestroyed}_cacheEnabled(){const t=this.w.config.drilldown;return!(!t||!1===t.cache)}_cacheGet(t){return this._cacheEnabled()&&null!=t&&this._asyncCache.get(t)||null}_cacheSet(t,e){this._cacheEnabled()&&null!=t&&this._asyncCache.set(t,e)}clearCache(t){return null==t?this._asyncCache.clear():this._asyncCache.delete(t),this.ctx}_snapshot(){const t=this.w.config,e=this._overrideFields(),i={series:this._uncollapseSeries(p.clone(t.series))};return Array.isArray(t.labels)&&t.labels.length&&(i.labels=p.clone(t.labels)),i.chart={type:t.chart.type,stacked:t.chart.stacked},e.has("xaxis")&&(i.xaxis=p.clone(t.xaxis)),e.has("yaxis")&&(i.yaxis=p.clone(t.yaxis)),e.has("colors")&&(i.colors=t.colors?p.clone(t.colors):void 0),e.has("plotOptions")&&(i.plotOptions=p.clone(t.plotOptions)),e.has("fill")&&(i.fill=p.clone(t.fill)),e.has("legend")&&(i.legend=p.clone(t.legend)),i}_uncollapseSeries(t){const e=this.w,i=e.globals,s=[...i.collapsedSeries||[],...i.ancillaryCollapsedSeries||[]];if(!s.length)return t;const n=e.config.chart.type,a=("pie"===n||"donut"===n||"polarArea"===n)&&1===t.length&&t[0]&&"object"==typeof t[0]&&Array.isArray(t[0].data)?t[0].data:t;for(const e of s){const s=e.index;i.axisCharts?t[s]&&(t[s].data=Array.isArray(e.data)?e.data.slice():e.data):a[s]&&"object"==typeof a[s]?a[s].y=e.data:void 0!==a[s]&&(a[s]=e.data)}return t}_overrideFields(){const t=new Set,e=this.w.config.drilldown&&this.w.config.drilldown.series||[];for(const i of e)i&&(i.xaxis&&t.add("xaxis"),i.yaxis&&t.add("yaxis"),i.colors&&t.add("colors"),i.plotOptions&&t.add("plotOptions"),i.fill&&t.add("fill"),i.legend&&t.add("legend"));return t}_copyOptionalViewFields(t,e){e.xaxis&&(t.xaxis=e.xaxis),e.yaxis&&(t.yaxis=e.yaxis),e.colors&&(t.colors=e.colors),e.plotOptions&&(t.plotOptions=e.plotOptions),e.fill&&(t.fill=e.fill),e.legend&&(t.legend=e.legend)}_viewFromChild(t){const e={};Array.isArray(t.series)?e.series=t.series:e.series=[{name:t.name||"",data:t.data}];const i={};return t.chart&&t.chart.type&&(i.type=t.chart.type),t.chart&&null!=t.chart.stacked&&(i.stacked=t.chart.stacked),Object.keys(i).length&&(e.chart=i),this._copyOptionalViewFields(e,t),e}_viewFromSnapshot(t){const e={series:t.series,chart:t.chart};return t.labels&&t.labels.length&&(e.labels=t.labels),this._copyOptionalViewFields(e,t),e}_apply(t,e,i){const s=this.w;s.interact.selectedDataPoints=[],s.globals.collapsedSeries=[],s.globals.collapsedSeriesIndices=[],s.globals.ancillaryCollapsedSeries=[],s.globals.ancillaryCollapsedSeriesIndices=[],s.globals.allSeriesCollapsed=!1,s.globals.risingSeries=[],t.markers=l(o({},t.markers||{}),{discrete:this._drillMarkers(t.series)});const n=(!s.config.drilldown.animation||!1!==s.config.drilldown.animation.enabled)&&!1!==s.config.chart.animations.enabled;"down"===e&&this._fire("drillDownStart",i);const a=e=>this.ctx.updateOptions(t,!1,e,!1,!1),r=()=>(this._fire("down"===e?"drillDownEnd":"drillUp",i),this.ctx);if(n&&this._zoomEnabled()){const t=this._triggerOrigin(i);if(t)return this._zoomDrill(t,e,()=>a(!1)).then(r)}return a(n).then(r)}_zoomEnabled(){const t=this.w.config.drilldown&&this.w.config.drilldown.animation;return!(!t||!t.zoomFromPoint)}_svgNode(){const t=this.w.dom&&this.w.dom.Paper;return t&&t.node?t.node:null}_markGroup(){const t=this._svgNode();return t&&"function"==typeof t.querySelector?t.querySelector(".apexcharts-plot-series, .apexcharts-heatmap, .apexcharts-treemap"):null}_triggerOrigin(t){if(!f.isBrowser())return null;const e=this._svgNode(),i=this._markGroup();if(!e||!i||"function"!=typeof i.animate||"function"!=typeof e.getBoundingClientRect)return null;const s=e.getBoundingClientRect();let n=null;if(t&&null!=t.seriesIndex&&null!=t.dataPointIndex&&this.w.dom.baseEl&&(n=this.w.dom.baseEl.querySelector(`[index="${t.seriesIndex}"][j="${t.dataPointIndex}"]`)),n&&"function"==typeof n.getBoundingClientRect){const t=n.getBoundingClientRect();return{x:t.left+t.width/2-s.left,y:t.top+t.height/2-s.top}}const a=i.getBoundingClientRect();return{x:a.left+a.width/2-s.left,y:a.top+a.height/2-s.top}}_zoomDrill(t,e,i){return s=this,n=null,a=function*(){const s=this._zoomDuration(),n="down"===e,a=Math.round(.55*s),r=n?"scale(1.03)":"scale(0.97)",o=n?"scaleX(0.55) scaleY(0.85)":"scale(1.04)",l=e=>{e.style.transformBox="view-box",e.style.transformOrigin=`${t.x}px ${t.y}px`},c=this._markGroup();let h=null;if(c){l(c),h=c.animate([{transform:"scale(1)",opacity:1},{transform:r,opacity:0}],{duration:a,easing:"ease-in",fill:"forwards"});try{yield h.finished}catch(t){}}yield i();const d=this._markGroup();if(d){l(d),d.style.opacity="0",d.style.transform=o,h&&c===d&&h.cancel();const t=d.animate([{transform:o,opacity:0},{transform:"scale(1)",opacity:1}],{duration:s,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"});try{yield t.finished}catch(t){}(u=d).style.transform="",u.style.opacity="",u.style.transformOrigin="",u.style.transformBox="",t.cancel()}var u},new Promise((t,e)=>{var i=t=>{try{o(a.next(t))}catch(t){e(t)}},r=t=>{try{o(a.throw(t))}catch(t){e(t)}},o=e=>e.done?t(e.value):Promise.resolve(e.value).then(i,r);o((a=a.apply(s,n)).next())});var s,n,a}_zoomDuration(){const t=this.w.config.drilldown&&this.w.config.drilldown.animation,e=t&&"number"==typeof t.speed?t.speed:260;return Math.max(80,e)}_fire(t,e){const i=this.w.config.chart.events&&this.w.config.chart.events[t];"function"==typeof i&&i(e,this.ctx,this.w),this.ctx.events.fireEvent(t,[e,this.ctx,this.w])}_onPointSelect(t,e,i){if(!i)return;const s=this._pointAt(i.seriesIndex,i.dataPointIndex);return s&&"object"==typeof s&&null!=s.drilldown?this.drillDown(s.drilldown,s,i):"function"==typeof this.w.config.drilldown.onDrillDown?this._drillDownAsync(null,s,i):void 0}_pointAt(t,e){const i=this.w.config.series;if(!Array.isArray(i)||null==t||null==e)return null;const s=i[t];return s&&Array.isArray(s.data)&&null!=s.data[e]?s.data[e]:null}_afterRender(){const t=this.w;t.config.drilldown&&t.config.drilldown.enabled&&(this._markDrillableTargets(),this._wirePlotClick(),this.breadcrumb.render(this.path),t.config.markers&&(t.config.markers.discrete=this._drillMarkers(t.config.series)))}_markDrillableTargets(){if(!f.isBrowser())return;const t=this.w,e=t.dom.baseEl,i=t.config.series;if(!e||!Array.isArray(i))return;let s=0;i.forEach((t,i)=>{const n=t&&Array.isArray(t.data)?t.data:null;n&&n.forEach((t,n)=>{if(!t||"object"!=typeof t||null==t.drilldown)return;const a=e.querySelectorAll(`[index="${i}"][j="${n}"]`);a.length||s++,a.forEach(t=>{this._isClickThroughMark(t)&&t.classList.remove("no-pointer-events"),t.classList.add("apexcharts-drilldown-target")})})}),s&&!this._warnedUnreachable&&(this._warnedUnreachable=!0)}warnSliceOffsetDisabled(){this._warnedNoSliceOffset||(this._warnedNoSliceOffset=!0)}_wirePlotClick(){if(!f.isBrowser())return;const t=this.w.dom.baseEl;t&&this._plotClickWired!==t&&(this._plotClickWired&&(this._plotClickWired.removeEventListener("mousedown",this._onPlotDown),this._plotClickWired.removeEventListener("click",this._onPlotClick)),t.addEventListener("mousedown",this._onPlotDown),t.addEventListener("click",this._onPlotClick),this._plotClickWired=t)}_onPlotDown(t){this._downAt={x:t.clientX,y:t.clientY}}_onPlotClick(t){const e=this.w;if(!e.config.drilldown||!e.config.drilldown.enabled)return;const i=this._downAt;if(this._downAt=null,i&&Math.hypot(t.clientX-i.x,t.clientY-i.y)>4)return;const s=t.target;if(!s||"function"!=typeof s.closest)return;if(s.closest(".apexcharts-drilldown-target"))return;if(s.closest(".apexcharts-legend, .apexcharts-toolbar, .apexcharts-breadcrumb, .apexcharts-menu, .apexcharts-tooltip"))return;const n=e.interact.capturedSeriesIndex,a=e.interact.capturedDataPointIndex;if(null==n||null==a||n<0||a<0)return;if(!this._isPointBasedSeries(e.config.series[n]))return;const r=this._pointAt(n,a);return r&&"object"==typeof r&&null!=r.drilldown?this.drillDown(r.drilldown,r,{seriesIndex:n,dataPointIndex:a}):void 0}_isClickThroughMark(t){return!(!t.classList||!t.classList.contains("no-pointer-events"))&&(!!t.classList.contains("apexcharts-marker")&&!("function"==typeof t.closest&&t.closest(".apexcharts-tooltip")))}_drillMarkers(t){const e=this.w,i=e.config.drilldown,s=Array.isArray(e.config.markers&&e.config.markers.discrete)?e.config.markers.discrete.filter(t=>!t||!t[ht]):[],n=i&&i.marker||{};if(!1===n.show||!Array.isArray(t))return s;const a=[];return t.forEach((t,e)=>{if(!this._seriesNeedsDrillMarker(e,t))return;const i=t&&Array.isArray(t.data)?t.data:null;i&&i.forEach((t,i)=>{if(!t||"object"!=typeof t||null==t.drilldown)return;const s={seriesIndex:e,dataPointIndex:i,[ht]:!0};void 0!==n.size&&(s.size=n.size),void 0!==n.shape&&(s.shape=n.shape),void 0!==n.fillColor&&(s.fillColor=n.fillColor),void 0!==n.strokeColor&&(s.strokeColor=n.strokeColor),a.push(s)})}),s.concat(a)}_seriesNeedsDrillMarker(t,e){if(!this._isPointBasedSeries(e))return!1;const i=this.w.config.markers&&this.w.config.markers.size,s=Array.isArray(i)?i[t]:i;return!(Number(s)>0)}_isPointBasedSeries(t){const e=t&&t.type||this.w.config.chart.type;return"line"===e||"area"===e}}});const dt="__apexcharts_plugins__";function ut(t){return function(){const t=globalThis;return t[dt]||(t[dt]={}),t[dt]}()[t]||null}const gt=["updateOptions","updateSeries","appendData","appendSeries","toggleSeries","showSeries","hideSeries","highlightSeries","isSeriesHidden","zoomX","addXaxisAnnotation","addYaxisAnnotation","addPointAnnotation","clearAnnotations","removeAnnotation","dataURI","exportToCSV"];function pt(t){const e={};return gt.forEach(i=>{"function"==typeof t[i]&&(e[i]=t[i].bind(t))}),Object.freeze(e)}h.default.registerFeatures({weave:class{constructor(t,e){this.w=t,this.ctx=e,this.active=[],this._layers=new Map,this._currentScales=null,this._lastPluginsRef=null,this._lastData=null,this._updatedWired=!1,this._onUpdated=this._onUpdated.bind(this),this._init()}_init(){(this.w.config.plugins||[]).map((t,e)=>({entry:t,order:null!=t.order?t.order:e})).sort((t,e)=>t.order-e.order).forEach(t=>this._activate(t.entry)),this._lastPluginsRef=this.w.config.plugins,this._wireUpdated()}_wireUpdated(){this._updatedWired||(this.ctx.addEventListener("updated",this._onUpdated),this._updatedWired=!0)}_onUpdated(){this.dispatch("afterUpdate",{pass:"update"})}_activate(t){const e=ut(t.name);if(!e)return;const i=null!=e.apiVersion?e.apiVersion:1;if(1!==Math.trunc(i))return;const s={def:e,options:Object.freeze(o({},t.options||{})),handlers:new Map,disabled:!1,failures:0,api:null};s.api=function(t,e){const i=t.ctx,s=t.w,n={name:e.def.name,version:1,get options(){return e.options},on(t,i){const s=e.handlers;return s.has(t)||s.set(t,[]),s.get(t).push(i),n},off(t,i){const s=e.handlers.get(t);if(s){const t=s.indexOf(i);t>-1&&s.splice(t,1)}return n},store:{},layer:i=>t._layer(e.def.name,i||{}),get scales(){return t._currentScales},get data(){return t._lastData||(t._lastData=t._dataSnapshot())},theme:Object.freeze({get mode(){return s.config.theme.mode},get foreColor(){return s.config.chart.foreColor},seriesColor:t=>s.globals.colors[t],token:e=>t._token(e)}),chart:pt(i),emit(t,s){i.events.fireEvent(`plugin:${e.def.name}:${t}`,[i,s])},get el(){return s.dom.baseEl}};return Object.freeze(n)}(this,s),this.active.push(s),this._guard(s,"setup",()=>e.setup(s.api))}dispatch(t,e){if("draw"===t&&(this._reconcile(),this._resetLayers()),this._lastData=null,!this.active.length)return;"afterParse"===t?this._currentScales=null:e&&"xyRatios"in e&&this._setScales(e.xyRatios);const i=e&&e.pass||"full";let s=null;for(const e of this.active){if(e.disabled)continue;const n=e.handlers.get(t);if(!n||!n.length)continue;null===s&&(s=this._dataSnapshot(),this._lastData=s);const a={api:e.api,scales:this._currentScales,data:s,pass:i,hook:t};for(const i of n.slice())this._guard(e,t,()=>i(a))}}_guard(t,e,i){if(!t.disabled)try{i()}catch(e){t.failures=(t.failures||0)+1,t.failures>=3&&(t.disabled=!0)}}_setScales(t){const e=this.w,i=e.globals,s=e.layout;if(!t||!i.axisCharts)return void(this._currentScales=null);const n=t.xRatio,a=t.yRatio||[],r=t=>null!=i.maxYArr[t]?i.maxYArr[t]:i.maxY,o=t=>null!=i.minYArr[t]?i.minYArr[t]:i.minY;this._currentScales={x:t=>s.translateX+(t-i.minX)/n,y:(t,e=0)=>s.translateY+(r(e)-t)/(t=>null!=a[t]?a[t]:a[0])(e),domainX:[i.minX,i.maxX],domainY:(t=0)=>[o(t),r(t)],gridWidth:s.gridWidth,gridHeight:s.gridHeight,ratios:t}}_dataSnapshot(){const t=this.w,e=t.globals,i=t.seriesData.series||[],s=t.seriesData.seriesX||[];return i.map((t,i)=>{const n=s[i]||[],a=(t||[]).map((t,e)=>({x:null!=n[e]?n[e]:e,y:t}));return{name:e.seriesNames?e.seriesNames[i]:void 0,hidden:(e.collapsedSeriesIndices||[]).includes(i),color:e.colors?e.colors[i]:void 0,points:a}})}_token(t){const e=this.w,i=e.globals;switch(t){case"foreColor":return e.config.chart.foreColor;case"background":return e.config.chart.background;case"accent":case"primary":return i.colors?i.colors[0]:void 0;default:return/^series-\d+$/.test(t)&&i.colors?i.colors[Number(t.split("-")[1])]:void 0}}_layer(t,{z:e="front",className:i=""}={}){let s=this._layers.get(t);if(!s){s=this.ctx.graphics.group({class:`apexcharts-plugin-${t} ${i}`.trim()});const n=this.w.dom.elGraphical.node;"behind"===e?n.insertBefore(s.node,n.firstChild):n.appendChild(s.node),s.node.setAttribute("aria-hidden","true"),this._layers.set(t,s)}return function(t,e){const i=e=>(e&&t.add(e),e),s={get node(){return t.node},path(t={}){const{d:s="",stroke:n="#000",width:a=1,fill:r="none",opacity:o=1,dash:l=0,className:c=""}=t;return i(e.drawPath({d:s,stroke:n,strokeWidth:a,fill:r,fillOpacity:"none"===r?0:o,strokeOpacity:o,strokeDashArray:l,classes:c}))},line(t={}){const{x1:s,y1:n,x2:a,y2:r,stroke:o="#000",width:l=1,dash:c=0}=t;return i(e.drawLine(s,n,a,r,o,c,l))},rect(t={}){const{x:s=0,y:n=0,w:a=0,h:r=0,r:o=0,fill:l="#000",stroke:c=null,opacity:h=1}=t;return i(e.drawRect(s,n,a,r,o,l,h,null!=c?1:null,c))},circle(t={}){const{cx:s=0,cy:n=0,r:a=0,fill:r="#000",stroke:o=null}=t;return i(e.drawCircle(a,{cx:s,cy:n,fill:r,stroke:o||"none"}))},text(t={}){const{x:s=0,y:n=0,text:a="",color:r,size:o,anchor:l="start",weight:c}=t;return i(e.drawText({x:s,y:n,text:a,textAnchor:l,fontSize:o,foreColor:r,fontWeight:c}))},clear(){const e=t.node;for(;e.firstChild;)e.removeChild(e.firstChild);return s}};return s}(s,this.ctx.graphics)}_resetLayers(){const t=this.w.dom.elGraphical,e=t&&t.node;if(e){const t=e.querySelectorAll('g[class*="apexcharts-plugin-"]');Array.prototype.forEach.call(t,t=>t.remove())}this._layers.clear()}_reconcile(){const t=this.w.config.plugins||[];if(t===this._lastPluginsRef)return;this._lastPluginsRef=t;const e=new Map(t.map((t,e)=>[t.name,{entry:t,order:null!=t.order?t.order:e}]));for(let t=this.active.length-1;t>=0;t--){const i=this.active[t],s=e.get(i.def.name);s?i.options=Object.freeze(o({},s.entry.options||{})):(this._guard(i,"destroy",()=>i.def.destroy&&i.def.destroy(i.api)),this.active.splice(t,1))}const i=new Set(this.active.map(t=>t.def.name)),s=[];e.forEach((t,e)=>{i.has(e)||s.push(t)}),s.sort((t,e)=>t.order-e.order).forEach(t=>this._activate(t.entry))}teardown(t){if(!t){this.dispatch("destroy");for(const t of this.active)this._guard(t,"destroy",()=>t.def.destroy&&t.def.destroy(t.api));this.active=[],this._updatedWired&&(this.ctx.removeEventListener&&this.ctx.removeEventListener("updated",this._onUpdated),this._updatedWired=!1)}this._layers.clear()}}}),h.default._customSeriesFactory=function(t,e){const i=class{constructor(t,e,i){this.w=t,this.ctx=e,this.xyRatios=i,this._warned=!1}draw(t,i,s){var n,a;const r=this.w,o=new v(r,this.ctx),l=function(t,e){const i=t&&t.renderer;return i&&i.kind&&"svg"!==i.kind?i:e}(this.ctx,o),c=o.group({class:"apexcharts-marks-series"});return t.forEach((t,i)=>{var n;const a=Array.isArray(s)?s[i]:i,h=o.group({class:"apexcharts-series",rel:a+1,seriesName:p.escapeString(r.seriesData.seriesNames[a]),"data:realIndex":a}),d=this._scales(a,(r.seriesData.series[a]||[]).length),u=r.globals.colors[a],g=(null==(n=r.config.series[a])?void 0:n.data)||[],f=r.seriesData.seriesX[a]||[],m=r.seriesData.series[a]||[];r.globals.seriesXvalues[a]=[],r.globals.seriesYvalues[a]=[],void 0===r.globals.pointsArray[a]&&(r.globals.pointsArray[a]=[]);for(let t=0;t<m.length;t++){const i=m[t];if(null==i)continue;const s=f[t],n=d.xAt(t,s),o=d.y(i),c=this._api(l,h,a,t);try{e.renderItem({datum:g[t],x:n,y:o,scales:d,api:c,seriesIndex:a,dataPointIndex:t,color:u})}catch(t){this._warned||(this._warned=!0)}r.globals.seriesXvalues[a][t]=n,r.globals.seriesYvalues[a][t]=o,r.globals.pointsArray[a][t]=[n,o]}o.setupEventDelegation(h,".apexcharts-marks-mark"),c.add(h)}),null==(a=null==(n=this.ctx.animations)?void 0:n.animationCompleted)||a.call(n,c),c}_scales(t,e){var i,s,n,a;const r=this.w.globals,o=this.w.config,l=this.xyRatios.xRatio,c=this.xyRatios.yRatio,h=null!=(s=null==(i=r.seriesYAxisReverseMap)?void 0:i[t])?s:0,d=Array.isArray(c)?null!=(n=c[h])?n:c[0]:c,u=r.maxYArr,g=Array.isArray(u)&&u.length&&null!=(a=u[h])?a:r.maxY,p=r.gridWidth,f=r.gridHeight,m=!r.isXNumeric,x=e||r.dataPoints||1,b=x>0?p/x:p,y="on"===o.xaxis.tickPlacement,w=t=>l?(t-r.minX)/l:p/2,v=r.minXDiff||1;return{x:w,xAt:(t,e)=>m?y&&x>1?t/(x-1)*p:(t+.5)*b:w(e),y:t=>(g-t)/d,gridWidth:p,gridHeight:f,band:m?b:l?v/l:p}}_api(t,e,i,s){const n=t=>{if(t){try{t.node.setAttribute("index",String(i)),t.node.setAttribute("j",String(s)),t.node.classList.add("apexcharts-marks-mark")}catch(t){}e.add(t)}return t};return{path:(e={})=>{var i,s,a,r,o,l,c,h,d;return n(t.drawPath({d:e.d||"",stroke:null!=(i=e.stroke)?i:"#000",strokeWidth:null!=(a=null!=(s=e.width)?s:e.strokeWidth)?a:1,fill:null!=(r=e.fill)?r:"none",fillOpacity:null!=(l=e.fillOpacity)?l:e.fill&&"none"!==e.fill?null!=(o=e.opacity)?o:1:0,strokeOpacity:null!=(h=null!=(c=e.strokeOpacity)?c:e.opacity)?h:1,strokeDashArray:null!=(d=e.dash)?d:0,strokeLinecap:e.lineCap}))},line:(e={})=>{var i,s,a,r;return n(t.drawLine(e.x1,e.y1,e.x2,e.y2,null!=(i=e.stroke)?i:"#000",null!=(s=e.dash)?s:0,null!=(r=null!=(a=e.width)?a:e.strokeWidth)?r:1))},rect:(e={})=>{var i,s,a,r,o,l,c,h;return n(t.drawRect(null!=(i=e.x)?i:0,null!=(s=e.y)?s:0,null!=(a=e.w)?a:0,null!=(r=e.h)?r:0,null!=(o=e.r)?o:0,null!=(l=e.fill)?l:"#000",null!=(c=e.opacity)?c:1,null!=e.stroke?null!=(h=e.strokeWidth)?h:1:null,e.stroke))},circle:(e={})=>{var i,s,a,r,o;return n(t.drawCircle(null!=(i=e.r)?i:0,{cx:null!=(s=e.cx)?s:0,cy:null!=(a=e.cy)?a:0,fill:null!=(r=e.fill)?r:"#000",stroke:e.stroke||"none","stroke-width":null!=(o=e.strokeWidth)?o:e.stroke?1:0}))},text:(e={})=>{var i,s,a,r;return n(t.drawText({x:null!=(i=e.x)?i:0,y:null!=(s=e.y)?s:0,text:null!=(a=e.text)?a:"",textAnchor:null!=(r=e.anchor)?r:"start",fontSize:e.size,foreColor:e.color,fontWeight:e.weight}))}}}};return i.dataType=e.dataType||"xy",i.yExtent="function"==typeof e.yExtent?e.yExtent:null,i};class ft{constructor(t,e){if(this.w=t,this.ctx=e,"os"!==t.config.theme.follow||!f.isBrowser())return;const i=this._ensureMedia();i&&(this._applyToConfig(i),this._ensureListeners(i))}_ensureMedia(){if(!this.ctx._osThemeMedia){const t=m.matchMedia("(prefers-color-scheme: dark)"),e=m.matchMedia("(prefers-contrast: more)");if(!t&&!e)return null;this.ctx._osThemeMedia={dark:t,contrast:e,handler:null}}return this.ctx._osThemeMedia}_applyToConfig(t){const e=this.w.config.theme;t.dark&&(e.mode=t.dark.matches?"dark":"light"),t.contrast&&t.contrast.matches&&(e.accessibility=e.accessibility||{},e.accessibility.colorBlindMode="highContrast")}_ensureListeners(t){if(t.handler)return;const e=this.ctx,i=()=>{const t=e._osThemeMedia;if(!t)return;const i={mode:t.dark&&t.dark.matches?"dark":"light"};t.contrast&&t.contrast.matches?i.accessibility={colorBlindMode:"highContrast"}:i.accessibility={colorBlindMode:""},e.updateOptions({theme:i},!1,!0,!1)};ft._add(t.dark,i),ft._add(t.contrast,i),t.handler=i}teardown(){const t=this.ctx._osThemeMedia;t&&(t.handler&&(ft._remove(t.dark,t.handler),ft._remove(t.contrast,t.handler)),this.ctx._osThemeMedia=null)}static _add(t,e){t&&("function"==typeof t.addEventListener?t.addEventListener("change",e):"function"==typeof t.addListener&&t.addListener(e))}static _remove(t,e){t&&("function"==typeof t.removeEventListener?t.removeEventListener("change",e):"function"==typeof t.removeListener&&t.removeListener(e))}}h.default.registerFeatures({osThemeWatcher:ft});const mt="__apexcharts_series_transforms__";function xt(t,e){t&&"string"==typeof t&&"function"==typeof e&&(globalThis[mt][t]=e)}globalThis[mt]||(globalThis[mt]={});const bt="__apexcharts_row_sources__";function yt(t,e){t&&"string"==typeof t&&"function"==typeof e&&(globalThis[bt][t]=e)}globalThis[bt]||(globalThis[bt]={});function wt(t,e){const i=t.length;if(0===i)return NaN;if(1===i)return t[0];const s=(i-1)*e,n=Math.floor(s),a=Math.ceil(s);return n===a?t[n]:t[n]+(t[a]-t[n])*(s-n)}function vt(t){const e=t.length;if(e<2)return 0;let i=0;for(let s=0;s<e;s++)i+=t[s];const s=i/e;let n=0;for(let i=0;i<e;i++){const e=t[i]-s;n+=e*e}return Math.sqrt(n/e)}function At(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const i=t.slice().sort((t,e)=>t-e);let s=i[0],n=i[i.length-1];const a=e.range;if(Array.isArray(a)&&2===a.length){const t=Number(a[0]),e=Number(a[1]);isFinite(t)&&isFinite(e)&&e>t&&(s=t,n=e)}if(!(n>s)){const t=Math.abs(s)>0?.05*Math.abs(s):.5;return{edges:[s-t,s+t],binWidth:2*t,rule:"single",capped:!1}}const r=n-s;let o,l;if("number"==typeof e.binWidth&&e.binWidth>0)o=e.binWidth,l="binWidth";else if("number"==typeof e.bins&&e.bins>=1)o=r/Math.floor(e.bins),l="count";else{const t=function(t,e,i){const s=t.length,n=t=>e/Math.max(1,Math.ceil(t));switch(i){case"sqrt":return{width:n(Math.sqrt(s)),rule:"sqrt"};case"rice":return{width:n(2*Math.cbrt(s)),rule:"rice"};case"scott":{const e=vt(t);return e>0?{width:3.49*e*Math.pow(s,-1/3),rule:"scott"}:{width:n(Math.log2(s)+1),rule:"sturges"}}case"fd":{const e=wt(t,.75)-wt(t,.25);return e>0?{width:2*e*Math.pow(s,-1/3),rule:"fd"}:{width:n(Math.log2(s)+1),rule:"sturges"}}case"auto":{const e=n(Math.log2(s)+1),i=wt(t,.75)-wt(t,.25);if(i<=0)return{width:e,rule:"sturges"};const a=2*i*Math.pow(s,-1/3);return a<e?{width:a,rule:"fd"}:{width:e,rule:"sturges"}}default:return{width:n(Math.log2(s)+1),rule:"sturges"}}}(i,r,"string"==typeof e.bins?e.bins:"auto");o=t.width,l=t.rule}(!isFinite(o)||o<=0)&&(o=r);let c=Math.ceil(r/o);(!isFinite(c)||c<1)&&(c=1);let h=!1;c>1e3&&(c=1e3,o=r/c,h=!0),o=r/c;const d=new Array(c+1);for(let t=0;t<=c;t++)d[t]=s+t*o;return d[c]=Math.max(d[c],n),{edges:d,binWidth:o,rule:l,capped:h}}function _t(t,e){const i=e.length-1;if(!(t>=e[0])||t>e[i])return-1;if(t===e[i])return i-1;const s=(e[i]-e[0])/i;if(s>0){let n=Math.floor((t-e[0])/s);return n<0&&(n=0),n>i-1&&(n=i-1),t<e[n]?n--:t>=e[n+1]&&n++,n<0||n>i-1?-1:n}let n=0,a=i-1;for(;n<=a;){const i=n+a>>1;if(t<e[i])a=i-1;else{if(!(t>=e[i+1]))return i;n=i+1}}return-1}function St(t){const e=[];if(!Array.isArray(t))return e;for(let i=0;i<t.length;i++){const s=t[i];let n=s;Array.isArray(s)?n=1===s.length?s[0]:s[1]:s&&"object"==typeof s&&(n=void 0!==s.y?s.y:s.x);const a=p.parseNumber(n);null!==a&&isFinite(a)&&e.push(a)}return e}const Ct=new WeakSet;function Et(t,e){var i;if(!t||"object"!=typeof t||Array.isArray(t))return null;let s=null;if(Array.isArray(t.points)?s=t.points:Array.isArray(null==(i=t.y)?void 0:i.points)?s=t.y.points:e&&Array.isArray(t.y)&&"number"==typeof t.y[0]&&(s=t.y),!s)return null;const n=[];for(let t=0;t<s.length;t++){const e=p.parseNumber(s[t]);null!==e&&isFinite(e)&&n.push(e)}return n.length?n:null}function kt(t,e,i){const s=i&&null!=i.maxRows?i.maxRows:3e3,n=function(t,e){let i=0,s=0;for(const e of t)i+=e.length,e.length>s&&(s=e.length);if(i<=e)return{clusters:t,stride:1,total:i,kept:i};const n=e=>{let i=0;for(const s of t)i+=Math.ceil(s.length/e);return i};let a=Math.max(2,Math.ceil(i/e));for(;a<s&&n(a)>e;)a++;let r=0;return{clusters:t.map(t=>{const e=[];for(let i=0;i<t.length;i+=a)e.push(t[i]);return r+=e.length,e}),stride:a,total:i,kept:r}}(e.map(t=>t.rows),s);n.stride;const a=t.globals&&t.globals.colors||[];return e.map((t,e)=>{const i=a[t.realIndex]||a[0];return{name:t.name,data:n.clusters[e].map((s,n)=>o({id:`${t.realIndex}:${e}:${n}`,x:t.name,y:s},i?{fillColor:i}:{}))}})}function Mt(t){if(!isFinite(t))return String(t);const e=Math.round(t);return Math.abs(t-e)<1e-6?String(e):String(Number(t.toFixed(2)))}function It(t){return(e,i)=>{var s;const n=t(e);if(!Array.isArray(n)||!n.length)return null;const a=e.globals&&e.globals.collapsedSeriesIndices||[],r=e.globals&&((null==(s=e.globals.categoryLabels)?void 0:s.length)?e.globals.categoryLabels:e.globals.labels)||[],o=[];return n.forEach((t,i)=>{var s;if(-1!==a.indexOf(i))return;if(!Array.isArray(t))return;const l=e.seriesData&&(null==(s=e.seriesData.seriesNames)?void 0:s[i]);t.forEach((t,e)=>{const s=null!=r[e]?String(r[e]):`#${e+1}`;o.push({name:n.length>1&&l?`${l} ${s}`:s,realIndex:i,rows:Array.isArray(t)?t.slice():[]})})}),o.length?kt(e,o,i):null}}const Pt=It(t=>{var e;return null==(e=t.candleData)?void 0:e.seriesBoxPoints}),Lt=It(t=>{var e;return null==(e=t.violinData)?void 0:e.seriesViolinPoints});xt("histogram",function(t,e){var i;const s=e.config,n=e.globals;if(!Array.isArray(t))return t;n.histogramRawSeries||(n.histogramRawSeries=t.map(t=>l(o({},t),{data:Array.isArray(null==t?void 0:t.data)?t.data.slice():null==t?void 0:t.data})));const a=n.histogramRawSeries,r=(null==(i=s.plotOptions)?void 0:i.histogram)||{},c=a.map(t=>St(null==t?void 0:t.data));let h=[];if(1===c.length)h=c[0];else for(const t of c)h=h.concat(t);const d=At(h,{bins:r.bins,binWidth:r.binWidth,range:r.range});if(!d)return e.histogramData={edges:[],binWidth:0,counts:[],rule:"",capped:!1},a;const{edges:u,binWidth:g}=d,p=c.map(t=>function(t,e){const i=new Array(Math.max(0,e.length-1)).fill(0);for(let s=0;s<t.length;s++){const n=_t(t[s],e);n>=0&&i[n]++}return i}(t,u));e.histogramData={edges:u,binWidth:g,counts:p,rule:d.rule,capped:d.capped};const f=n.collapsedSeriesIndices||[];return a.map((t,e)=>{if(-1!==f.indexOf(e))return l(o({},t),{data:[]});const i=function(t,e={}){let i=t.slice();if(e.cumulative){let t=0;i=i.map(e=>t+=e)}const s=t.reduce((t,e)=>t+e,0);if(s<=0)return i;if("relative"===e.normalize)return i.map(t=>t/s*100);if("density"===e.normalize){const t=e.binWidth;if("number"==typeof t&&t>0)return i.map(e=>e/(s*t))}return i}(p[e],{normalize:r.normalize,cumulative:r.cumulative,binWidth:g}),s=[];for(let t=0;t<i.length;t++)s.push({x:(u[t]+u[t+1])/2,y:i[t]});return l(o({},t),{data:s})})}),xt("boxPlot",function(t,e){var i,s;if(!Array.isArray(t))return t;const n=(null==(s=null==(i=e.config.plotOptions)?void 0:i.boxPlot)?void 0:s.whiskers)||"minmax";return t.map(t=>{if(!Array.isArray(null==t?void 0:t.data))return t;let e=!1;const i=t.data.map(t=>{if(Array.isArray(null==t?void 0:t.y)&&5===t.y.length&&!Ct.has(t))return t;const i=Et(t,!1);if(!i)return t;const s=function(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const i=t.slice().sort((t,e)=>t-e),s=wt(i,.25),n=wt(i,.5),a=wt(i,.75),r=a-s;let o=i[0],l=i[i.length-1],c=[];if("tukey"===e.whiskers&&r>0){const t=s-1.5*r,e=a+1.5*r;let n=0;for(;n<i.length&&i[n]<t;)n++;let h=i.length-1;for(;h>=0&&i[h]>e;)h--;n<=h&&(o=i[n],l=i[h],c=i.slice(0,n).concat(i.slice(h+1)))}return{summary:[o,s,n,a,l],outliers:c,iqr:r}}(i,{whiskers:n});if(!s)return t;e=!0;const a=l(o({},t),{y:s.summary,points:i});return Ct.add(a),a});return e?l(o({},t),{data:i}):t})}),xt("violin",function(t,e){var i,s;if(!Array.isArray(t))return t;const n=(null==(s=null==(i=e.config.plotOptions)?void 0:i.violin)?void 0:s.kde)||{};return t.map(t=>{if(!Array.isArray(null==t?void 0:t.data))return t;let e=!1;const i=t.data.map(t=>{var i;if(Array.isArray(null==(i=null==t?void 0:t.y)?void 0:i.density)&&t.y.density.length&&!Ct.has(t))return t;const s=Et(t,!0);if(!s)return t;const a=function(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const i=t.slice().sort((t,e)=>t-e),s=i.length;let n=e.bandwidth;if(!("number"==typeof n&&n>0)){const t=vt(i),e=wt(i,.75)-wt(i,.25);n=.9*(e>0?Math.min(t,e/1.349):t)*Math.pow(s,-.2)}if(!isFinite(n)||n<=0){const t=i[0],e=Math.abs(t)>0?.001*Math.abs(t):.001;return{density:[[t-e,0],[t,1],[t+e,0]],bandwidth:e}}const a=Math.max(8,Math.floor(e.resolution||64)),r=i[0]-2*n,o=(i[s-1]+2*n-r)/(a-1),l=1/(s*n*Math.sqrt(2*Math.PI)),c=[];for(let t=0;t<a;t++){const e=r+t*o;let a=0;for(let t=0;t<s;t++){const s=(e-i[t])/n;a+=Math.exp(-.5*s*s)}c.push([e,a*l])}return{density:c,bandwidth:n}}(s,{bandwidth:n.bandwidth,resolution:n.resolution});if(!a)return t;e=!0;const r=l(o({},t),{y:{density:a.density,points:s}});return Ct.add(r),r});return e?l(o({},t),{data:i}):t})}),yt("histogram",function(t,e){const i=t.globals,s=t.histogramData,n=i&&i.histogramRawSeries;if(!s||!Array.isArray(s.edges)||s.edges.length<2)return null;if(!Array.isArray(n)||!n.length)return null;const a=i&&i.collapsedSeriesIndices||[],r=s.edges,o=[];return n.forEach((e,i)=>{var s;if(-1!==a.indexOf(i))return;const l=function(t,e){const i=Math.max(0,e.length-1),s=new Array(i);for(let t=0;t<i;t++)s[t]=[];for(let i=0;i<t.length;i++){const n=_t(t[i],e);n>=0&&s[n].push(t[i])}return s}(St(e&&e.data),r),c=t.seriesData&&(null==(s=t.seriesData.seriesNames)?void 0:s[i])||(null==e?void 0:e.name);l.forEach((t,e)=>{const s=`${Mt(r[e])}-${Mt(r[e+1])}`;o.push({name:n.length>1&&c?`${c} ${s}`:s,realIndex:i,rows:t})})}),o.length?kt(t,o,e):null}),yt("boxPlot",Pt),yt("violin",Lt);